Skip to content

Commit

Permalink
feat(file-uploader): add buttonKind & buttonSize props
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebritor committed Aug 15, 2023
1 parent 2b3f1e3 commit 69a6e54
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/CvFileUploader/CvFileUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div v-if="kind === 'button'" :class="`${carbonPrefix}--file`" data-file>
<label
:for="cvId"
:class="[`${carbonPrefix}--btn`, `${carbonPrefix}--btn--primary`]"
:class="buttonClasses"
tabindex="0"
@keydown.enter.prevent="onKeyHit"
@keydown.space.prevent="onKeyHit"
Expand Down Expand Up @@ -82,11 +82,16 @@ import { carbonPrefix } from '../../global/settings';
import { CvFormItem } from '../CvForm';
import { useCvId, props as cvIdProps } from '../../use/cvId';
import { KINDS, STATES } from './const';
import {
props as commonCvButtonProps,
useCvButtonCommon,
} from '../CvButton/CvButtonCommon';
const emit = defineEmits(['update:modelValue']);
const props = defineProps({
accept: String,
buttonKind: commonCvButtonProps.kind,
buttonLabel: {
type: String,
default: undefined,
Expand All @@ -100,6 +105,7 @@ const props = defineProps({
return true;
},
},
buttonSize: commonCvButtonProps.size,
clearOnReselect: Boolean,
dropTargetLabel: String,
helperText: String,
Expand Down Expand Up @@ -131,6 +137,7 @@ const allowDrop = ref(false);
const internalFiles = ref([]);
// Computed
const { buttonClasses } = useCvButtonCommon(props.buttonKind, props.buttonSize);
const cvId = useCvId(props);
const internalDropTargetLabel = computed(() => {
return (
Expand Down

0 comments on commit 69a6e54

Please sign in to comment.