diff --git a/docs/content/3.forms/1.input.md b/docs/content/3.forms/1.input.md index f2b29e27..b06ba702 100644 --- a/docs/content/3.forms/1.input.md +++ b/docs/content/3.forms/1.input.md @@ -148,6 +148,21 @@ excludedProps: --- :: +### Padded + +Use the `padded` prop to remove the padding of the Input. + +::component-card +--- +props: + padded: false +baseProps: + placeholder: 'Search...' + variant: 'none' + class: 'w-full' +--- +:: + ## Slots ### `leading` diff --git a/docs/content/3.forms/2.textarea.md b/docs/content/3.forms/2.textarea.md index f84871e8..fa0af370 100644 --- a/docs/content/3.forms/2.textarea.md +++ b/docs/content/3.forms/2.textarea.md @@ -132,6 +132,21 @@ props: --- :: +### Padded + +Use the `padded` prop to remove the padding of the Textarea. + +::component-card +--- +props: + padded: false +baseProps: + placeholder: 'Search...' + variant: 'none' + class: 'w-full' +--- +:: + ## Props :component-props diff --git a/docs/content/3.forms/3.select.md b/docs/content/3.forms/3.select.md index ade77cfb..9acffba3 100644 --- a/docs/content/3.forms/3.select.md +++ b/docs/content/3.forms/3.select.md @@ -175,6 +175,25 @@ excludedProps: --- :: +### Padded + +Use the `padded` prop to remove the padding of the Select. + +::component-card +--- +props: + padded: false +baseProps: + placeholder: 'Search...' + options: + - 'United States' + - 'Canada' + - 'Mexico' + variant: 'none' + class: 'w-full' +--- +:: + ## Slots ### `leading` diff --git a/src/runtime/components/elements/Alert.vue b/src/runtime/components/elements/Alert.vue index e5809b3c..07d20ccc 100644 --- a/src/runtime/components/elements/Alert.vue +++ b/src/runtime/components/elements/Alert.vue @@ -4,7 +4,7 @@ -
+

{{ title }} diff --git a/src/runtime/components/elements/AvatarGroup.ts b/src/runtime/components/elements/AvatarGroup.ts index 5c6d1728..dc87e34f 100644 --- a/src/runtime/components/elements/AvatarGroup.ts +++ b/src/runtime/components/elements/AvatarGroup.ts @@ -32,7 +32,7 @@ export default defineComponent({ default: () => '' }, ui: { - type: Object as PropType>, + type: Object as PropType & { strategy?: Strategy }>, default: () => ({}) } }, diff --git a/src/runtime/components/elements/Button.vue b/src/runtime/components/elements/Button.vue index 1c04c889..ba0d55cd 100644 --- a/src/runtime/components/elements/Button.vue +++ b/src/runtime/components/elements/Button.vue @@ -5,7 +5,7 @@ - + {{ label }} @@ -154,7 +154,7 @@ export default defineComponent({ ui.value.gap[size.value], props.padded && ui.value[isSquare.value ? 'square' : 'padding'][size.value], variant?.replaceAll('{color}', props.color), - props.block ? 'w-full flex justify-center items-center' : 'inline-flex items-center' + props.block ? ui.value.block : ui.value.inline ), props.class) }) @@ -178,7 +178,7 @@ export default defineComponent({ return twJoin( ui.value.icon.base, ui.value.icon.size[size.value], - props.loading && 'animate-spin' + props.loading && ui.value.icon.loading ) }) @@ -186,11 +186,13 @@ export default defineComponent({ return twJoin( ui.value.icon.base, ui.value.icon.size[size.value], - props.loading && !isLeading.value && 'animate-spin' + props.loading && !isLeading.value && ui.value.icon.loading ) }) return { + // eslint-disable-next-line vue/no-dupe-keys + ui, attrs, isLeading, isTrailing, diff --git a/src/runtime/components/elements/ButtonGroup.ts b/src/runtime/components/elements/ButtonGroup.ts index 4bf226f0..0d91d134 100644 --- a/src/runtime/components/elements/ButtonGroup.ts +++ b/src/runtime/components/elements/ButtonGroup.ts @@ -35,7 +35,7 @@ export default defineComponent({ default: () => '' }, ui: { - type: Object as PropType>, + type: Object as PropType & { strategy?: Strategy }>, default: () => ({}) } }, @@ -52,20 +52,7 @@ export default defineComponent({ ), props.class) }) - const rounded = computed(() => { - const roundedMap = { - 'rounded-none': { horizontal: { start: 'rounded-s-none', end: 'rounded-e-none' }, vertical: { start: 'rounded-t-none', end: 'rounded-b-none' } }, - 'rounded-sm': { horizontal: { start: 'rounded-s-sm', end: 'rounded-e-sm' }, vertical: { start: 'rounded-t-sm', end: 'rounded-b-sm' } }, - rounded: { horizontal: { start: 'rounded-s', end: 'rounded-e' }, vertical: { start: 'rounded-t', end: 'rounded-b' } }, - 'rounded-md': { horizontal: { start: 'rounded-s-md', end: 'rounded-e-md' }, vertical: { start: 'rounded-t-md', end: 'rounded-b-md' } }, - 'rounded-lg': { horizontal: { start: 'rounded-s-lg', end: 'rounded-e-lg' }, vertical: { start: 'rounded-t-lg', end: 'rounded-b-lg' } }, - 'rounded-xl': { horizontal: { start: 'rounded-s-xl', end: 'rounded-e-xl' }, vertical: { start: 'rounded-t-xl', end: 'rounded-b-xl' } }, - 'rounded-2xl': { horizontal: { start: 'rounded-s-2xl', end: 'rounded-e-2xl' }, vertical: { start: 'rounded-t-2xl', end: 'rounded-b-2xl' } }, - 'rounded-3xl': { horizontal: { start: 'rounded-s-3xl', end: 'rounded-e-3xl' }, vertical: { start: 'rounded-t-3xl', end: 'rounded-b-3xl' } }, - 'rounded-full': { horizontal: { start: 'rounded-s-full', end: 'rounded-e-full' }, vertical: { start: 'rounded-t-full', end: 'rounded-b-full' } } - } - return roundedMap[ui.value.rounded][props.orientation] - }) + const rounded = computed(() => ui.value.orientation[ui.value.rounded][props.orientation]) useProvideButtonGroup({ orientation: toRef(props, 'orientation'), size: toRef(props, 'size'), ui, rounded }) diff --git a/src/runtime/components/elements/Dropdown.vue b/src/runtime/components/elements/Dropdown.vue index d76df5d4..eda24938 100644 --- a/src/runtime/components/elements/Dropdown.vue +++ b/src/runtime/components/elements/Dropdown.vue @@ -4,7 +4,7 @@ ref="trigger" as="div" :disabled="disabled" - class="inline-flex w-full" + :class="ui.trigger" role="button" @mouseover="onMouseOver" > @@ -18,7 +18,7 @@

-
+
@@ -35,7 +35,7 @@ - {{ item.label }} + {{ item.label }} {{ shortcut }} diff --git a/src/runtime/components/elements/MeterGroup.ts b/src/runtime/components/elements/MeterGroup.ts index 7e87df01..ae0bf764 100644 --- a/src/runtime/components/elements/MeterGroup.ts +++ b/src/runtime/components/elements/MeterGroup.ts @@ -44,14 +44,14 @@ export default defineComponent({ }, icon: { type: String, - default: 'i-heroicons-minus' + default: () => meterGroupConfig.default.icon }, class: { type: [String, Object, Array] as PropType, default: () => '' }, ui: { - type: Object as PropType>, + type: Object as PropType & { strategy?: Strategy }>, default: () => ({}) } }, @@ -70,21 +70,7 @@ export default defineComponent({ const children = computed(() => getSlotsChildren(slots)) - const rounded = computed(() => { - const roundedMap = { - 'rounded-none': { left: 'rounded-s-none', right: 'rounded-e-none' }, - 'rounded-sm': { left: 'rounded-s-sm', right: 'rounded-e-sm' }, - rounded: { left: 'rounded-s', right: 'rounded-e' }, - 'rounded-md': { left: 'rounded-s-md', right: 'rounded-e-md' }, - 'rounded-lg': { left: 'rounded-s-lg', right: 'rounded-e-lg' }, - 'rounded-xl': { left: 'rounded-s-xl', right: 'rounded-e-xl' }, - 'rounded-2xl': { left: 'rounded-s-2xl', right: 'rounded-e-2xl' }, - 'rounded-3xl': { left: 'rounded-s-3xl', right: 'rounded-e-3xl' }, - 'rounded-full': { left: 'rounded-s-full', right: 'rounded-e-full' } - } - - return roundedMap[ui.value.rounded] - }) + const rounded = computed(() => ui.value.orientation[ui.value.rounded]) function clampPercent (value: number, min: number, max: number): number { if (min == max) { @@ -198,7 +184,7 @@ export default defineComponent({ vNodeSlots[0] = slots.indicator({ percent: percent.value }) } - vNodeSlots[2] = h('ol', { class: 'list-disc list-inside' }, labels.value.map((label, key) => { + vNodeSlots[2] = h('ol', { class: ui.value.list }, labels.value.map((label, key) => { const labelClass = computed(() => { return twJoin( uiMeter.value.label.base, diff --git a/src/runtime/components/forms/Checkbox.vue b/src/runtime/components/forms/Checkbox.vue index a3e8f62c..8002806c 100644 --- a/src/runtime/components/forms/Checkbox.vue +++ b/src/runtime/components/forms/Checkbox.vue @@ -1,6 +1,6 @@