@byyuurin/ui 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/Accordion.vue +2 -2
  4. package/dist/runtime/components/Badge.vue +3 -3
  5. package/dist/runtime/components/Breadcrumb.vue +4 -4
  6. package/dist/runtime/components/Button.vue +3 -3
  7. package/dist/runtime/components/Calendar.vue +6 -8
  8. package/dist/runtime/components/Carousel.vue +19 -0
  9. package/dist/runtime/components/Checkbox.vue +1 -1
  10. package/dist/runtime/components/CheckboxGroup.vue +131 -0
  11. package/dist/runtime/components/CheckboxGroup.vue.d.ts +89 -0
  12. package/dist/runtime/components/DropdownMenuContent.vue +11 -11
  13. package/dist/runtime/components/FormField.vue +1 -1
  14. package/dist/runtime/components/Input.vue +3 -3
  15. package/dist/runtime/components/InputNumber.vue +2 -4
  16. package/dist/runtime/components/InputNumber.vue.d.ts +0 -5
  17. package/dist/runtime/components/InputTags.vue +155 -0
  18. package/dist/runtime/components/InputTags.vue.d.ts +85 -0
  19. package/dist/runtime/components/Marquee.vue +38 -0
  20. package/dist/runtime/components/Marquee.vue.d.ts +54 -0
  21. package/dist/runtime/components/NavigationMenu.vue +46 -37
  22. package/dist/runtime/components/NavigationMenu.vue.d.ts +44 -9
  23. package/dist/runtime/components/RadioGroup.vue.d.ts +2 -2
  24. package/dist/runtime/components/Select.vue +11 -11
  25. package/dist/runtime/components/Slider.vue +1 -1
  26. package/dist/runtime/components/Table.vue +54 -32
  27. package/dist/runtime/components/Table.vue.d.ts +14 -14
  28. package/dist/runtime/components/Tabs.vue +3 -3
  29. package/dist/runtime/components/Textarea.vue +3 -3
  30. package/dist/runtime/components/Timeline.vue +102 -0
  31. package/dist/runtime/components/Timeline.vue.d.ts +74 -0
  32. package/dist/runtime/types/index.d.ts +5 -0
  33. package/dist/runtime/types/index.js +5 -0
  34. package/dist/runtime/types/utils.d.ts +6 -3
  35. package/dist/shared/{ui.DSyJHSTk.mjs → ui.DLOxhmP0.mjs} +523 -68
  36. package/dist/unplugin.mjs +1 -1
  37. package/dist/vite.mjs +1 -1
  38. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byyuurin/ui",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "configKey": "ui",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.16.2"
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineNuxtModule, createResolver, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
2
2
  import { defu } from 'defu';
3
- import { v as version, n as name, a as addTemplates } from './shared/ui.DSyJHSTk.mjs';
3
+ import { v as version, n as name, a as addTemplates } from './shared/ui.DLOxhmP0.mjs';
4
4
  import { d as defaultOptions, r as resolveColors, g as getDefaultUIConfig } from './shared/ui.CzIlLITK.mjs';
5
5
  import 'node:process';
6
6
  import 'node:url';
@@ -48,7 +48,7 @@ const ui = computed(() => {
48
48
  <AccordionHeader as="div" :class="ui.header({ class: [props.ui?.header, item.ui?.header] })" data-part="header">
49
49
  <AccordionTrigger :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger], disabled: item.disabled })" data-part="trigger">
50
50
  <slot name="leading" v-bind="{ item, index, open, ui }">
51
- <Icon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" data-part="leading-icon" />
51
+ <Icon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" data-part="leadingIcon" />
52
52
  </slot>
53
53
 
54
54
  <span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })" data-part="label">
@@ -56,7 +56,7 @@ const ui = computed(() => {
56
56
  </span>
57
57
 
58
58
  <slot name="trailing" v-bind="{ item, index, open, ui }">
59
- <Icon :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" data-part="trailing-icon" />
59
+ <Icon :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" data-part="trailingIcon" />
60
60
  </slot>
61
61
  </AccordionTrigger>
62
62
  </AccordionHeader>
@@ -49,14 +49,14 @@ const ui = computed(() => {
49
49
  v-if="isLeading && leadingIconName"
50
50
  :name="leadingIconName"
51
51
  :class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
52
- data-part="leading-icon"
52
+ data-part="leadingIcon"
53
53
  />
54
54
  <Avatar
55
55
  v-else-if="props.avatar"
56
56
  :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
57
57
  v-bind="props.avatar"
58
58
  :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
59
- data-part="leading-avatar"
59
+ data-part="leadingAvatar"
60
60
  />
61
61
  </slot>
62
62
 
@@ -71,7 +71,7 @@ const ui = computed(() => {
71
71
  v-if="isTrailing && trailingIconName"
72
72
  :name="trailingIconName"
73
73
  :class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
74
- data-part="trailing-icon"
74
+ data-part="trailingIcon"
75
75
  />
76
76
  </slot>
77
77
  </Primitive>
@@ -50,18 +50,18 @@ const ui = computed(() => {
50
50
  v-if="item.icon"
51
51
  :name="item.icon"
52
52
  :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active: item.active ?? index === items.length - 1 })"
53
- data-part="link-leading-icon"
53
+ data-part="linkLeadingIcon"
54
54
  />
55
55
  <Avatar
56
56
  v-else-if="item.avatar"
57
57
  :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()"
58
58
  v-bind="item.avatar"
59
59
  :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active: item.active ?? index === items.length - 1 })"
60
- data-part="link-leading-avatar"
60
+ data-part="linkLeadingAvatar"
61
61
  />
62
62
  </slot>
63
63
 
64
- <span v-if="get(item, props.labelKey) || slots[`${item.slot || 'item'}-label`]" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })" data-part="link-label">
64
+ <span v-if="get(item, props.labelKey) || slots[`${item.slot || 'item'}-label`]" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })" data-part="linkLabel">
65
65
  <slot :name="`${item.slot || 'item'}-label`" :item="item" :active="item.active ?? index === items.length - 1" :index="index">
66
66
  {{ get(item, props.labelKey) }}
67
67
  </slot>
@@ -75,7 +75,7 @@ const ui = computed(() => {
75
75
 
76
76
  <li v-if="index < items.length - 1" role="presentation" aria-hidden="true" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })" data-part="separator">
77
77
  <slot name="separator" :ui="ui">
78
- <Icon :name="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" data-part="separator-icon" />
78
+ <Icon :name="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" data-part="separatorIcon" />
79
79
  </slot>
80
80
  </li>
81
81
  </template>
@@ -132,14 +132,14 @@ const ui = computed(() => {
132
132
  v-if="isLeading && leadingIconName"
133
133
  :name="leadingIconName"
134
134
  :class="ui.leadingIcon({ class: props.ui?.leadingIcon, active })"
135
- data-part="leading-icon"
135
+ data-part="leadingIcon"
136
136
  />
137
137
  <Avatar
138
138
  v-else-if="props.avatar"
139
139
  :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
140
140
  v-bind="props.avatar"
141
141
  :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar, active })"
142
- data-part="leading-avatar"
142
+ data-part="leadingAvatar"
143
143
  />
144
144
  </slot>
145
145
 
@@ -158,7 +158,7 @@ const ui = computed(() => {
158
158
  v-if="isTrailing && trailingIconName"
159
159
  :name="trailingIconName"
160
160
  :class="ui.trailingIcon({ class: props.ui?.trailingIcon, active })"
161
- data-part="trailing-icon"
161
+ data-part="trailingIcon"
162
162
  />
163
163
  </slot>
164
164
  </LinkBase>
@@ -58,7 +58,7 @@ const props = defineProps({
58
58
  const emit = defineEmits(["update:modelValue", "update:placeholder", "update:validModelValue", "update:startValue"]);
59
59
  defineSlots();
60
60
  const rootProps = useForwardPropsEmits(reactiveOmit(props, "range", "modelValue", "defaultValue", "size", "color", "variant", "monthControls", "yearControls", "class", "ui"), emit);
61
- const { code: locale, dir, t } = useLocale();
61
+ const { dir, t } = useLocale();
62
62
  const appConfig = useAppConfig();
63
63
  const ui = computed(() => {
64
64
  const styler = cv(merge(theme, appConfig.ui.calendar));
@@ -85,8 +85,6 @@ const Calendar = computed(() => props.range ? RangeCalendar : BaseCalendar);
85
85
  v-bind="rootProps"
86
86
  :model-value="props.modelValue"
87
87
  :default-value="props.defaultValue"
88
- :locale="locale"
89
- :dir="dir"
90
88
  :class="ui.root({ class: [props.class, props.ui?.root] })"
91
89
  data-part="root"
92
90
  >
@@ -118,20 +116,20 @@ const Calendar = computed(() => props.range ? RangeCalendar : BaseCalendar);
118
116
  data-part="grid"
119
117
  >
120
118
  <Calendar.GridHead>
121
- <Calendar.GridRow :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })" data-part="grid-week-day-row">
122
- <Calendar.HeadCell v-for="day in weekDays" :key="day" :class="ui.headCell({ class: props.ui?.headCell })" data-part="head-cell">
119
+ <Calendar.GridRow :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })" data-part="gridWeekDaysRow">
120
+ <Calendar.HeadCell v-for="day in weekDays" :key="day" :class="ui.headCell({ class: props.ui?.headCell })" data-part="headCell">
123
121
  <slot name="week-day" :day="day">
124
122
  {{ day }}
125
123
  </slot>
126
124
  </Calendar.HeadCell>
127
125
  </Calendar.GridRow>
128
126
  </Calendar.GridHead>
129
- <Calendar.GridBody :class="ui.gridBody({ class: props.ui?.gridBody })" data-part="grid-body">
127
+ <Calendar.GridBody :class="ui.gridBody({ class: props.ui?.gridBody })" data-part="gridBody">
130
128
  <Calendar.GridRow
131
129
  v-for="(weekDates, index) in month.rows"
132
130
  :key="`weekDates-${index}`"
133
131
  :class="ui.gridRow({ class: props.ui?.gridRow })"
134
- data-part="grid-row"
132
+ data-part="gridRow"
135
133
  >
136
134
  <Calendar.Cell
137
135
  v-for="weekDate in weekDates"
@@ -144,7 +142,7 @@ const Calendar = computed(() => props.range ? RangeCalendar : BaseCalendar);
144
142
  :day="weekDate"
145
143
  :month="month.value"
146
144
  :class="ui.cellTrigger({ class: props.ui?.cellTrigger })"
147
- data-part="cell-trigger"
145
+ data-part="cellTrigger"
148
146
  >
149
147
  <slot name="day" :day="weekDate">
150
148
  {{ weekDate.day }}
@@ -57,6 +57,16 @@ const ui = computed(() => {
57
57
  const rootProps = useForwardProps(reactivePick(props, "active", "align", "breakpoints", "containScroll", "dragFree", "dragThreshold", "duration", "inViewThreshold", "loop", "skipSnaps", "slidesToScroll", "startIndex", "watchDrag", "watchResize", "watchSlides", "watchFocus"));
58
58
  const prevIcon = computed(() => props.prevIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronRight : appConfig.ui.icons.chevronLeft));
59
59
  const nextIcon = computed(() => props.nextIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight));
60
+ const stopAutoplayOnInteraction = computed(() => {
61
+ if (typeof props.autoplay == "boolean")
62
+ return true;
63
+ return props.autoplay.stopOnInteraction ?? true;
64
+ });
65
+ const stopAutoScrollOnInteraction = computed(() => {
66
+ if (typeof props.autoScroll === "boolean")
67
+ return true;
68
+ return props.autoScroll.stopOnInteraction ?? true;
69
+ });
60
70
  const options = computed(() => ({
61
71
  ...props.fade ? { align: "center", containScroll: false } : {},
62
72
  ...rootProps.value,
@@ -100,14 +110,23 @@ const [emblaRef, emblaApi] = useEmblaCarousel(options, plugins);
100
110
  watch(options, () => {
101
111
  emblaApi.value?.reInit(options.value, plugins.value);
102
112
  }, { flush: "post" });
113
+ function stopOnInteraction() {
114
+ if (stopAutoplayOnInteraction.value)
115
+ emblaApi.value?.plugins().autoplay?.stop();
116
+ if (stopAutoScrollOnInteraction.value)
117
+ emblaApi.value?.plugins().autoScroll?.stop();
118
+ }
103
119
  function scrollPrev() {
104
120
  emblaApi.value?.scrollPrev();
121
+ stopOnInteraction();
105
122
  }
106
123
  function scrollNext() {
107
124
  emblaApi.value?.scrollNext();
125
+ stopOnInteraction();
108
126
  }
109
127
  function scrollTo(index) {
110
128
  emblaApi.value?.scrollTo(index);
129
+ stopOnInteraction();
111
130
  }
112
131
  function onKeyDown(event) {
113
132
  let prevKey;
@@ -55,7 +55,7 @@ function onUpdate(value) {
55
55
  </script>
56
56
 
57
57
  <template>
58
- <Primitive :as="!props.variant || props.variant === 'list' ? props.as : Label" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
58
+ <Primitive :as="props.variant && props.variant !== 'list' ? Label : props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
59
59
  <div :class="ui.container({ class: props.ui?.container })" data-part="container">
60
60
  <CheckboxRoot
61
61
  v-bind="{ id, ...rootProps, ...$attrs, ...ariaAttrs, name, disabled }"
@@ -0,0 +1,131 @@
1
+ <script>
2
+ import theme from "#build/ui/checkbox-group";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { reactivePick } from "@vueuse/core";
7
+ import { CheckboxGroupRoot, useForwardProps, useForwardPropsEmits } from "reka-ui";
8
+ import { computed, useId } from "vue";
9
+ import { useAppConfig } from "#imports";
10
+ import { useFormField } from "../composables/useFormField";
11
+ import { get, omit } from "../utils";
12
+ import { cv, merge } from "../utils/style";
13
+ import Checkbox from "./Checkbox.vue";
14
+ const props = defineProps({
15
+ as: { type: null, required: false },
16
+ legend: { type: String, required: false },
17
+ valueKey: { type: null, required: false, default: "value" },
18
+ labelKey: { type: null, required: false, default: "label" },
19
+ descriptionKey: { type: null, required: false, default: "description" },
20
+ items: { type: null, required: false },
21
+ modelValue: { type: null, required: false },
22
+ defaultValue: { type: null, required: false },
23
+ size: { type: null, required: false },
24
+ variant: { type: null, required: false },
25
+ orientation: { type: null, required: false, default: "vertical" },
26
+ ui: { type: null, required: false },
27
+ class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true },
28
+ disabled: { type: Boolean, required: false },
29
+ loop: { type: Boolean, required: false },
30
+ name: { type: String, required: false },
31
+ required: { type: Boolean, required: false },
32
+ color: { type: null, required: false },
33
+ indicator: { type: null, required: false },
34
+ icon: { type: [String, Object], required: false }
35
+ });
36
+ const emit = defineEmits(["update:modelValue", "change"]);
37
+ const slots = defineSlots();
38
+ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "orientation", "loop", "required"), emit);
39
+ const checkboxProps = useForwardProps(reactivePick(props, "indicator", "icon"));
40
+ const getProxySlots = () => omit(slots, ["legend"]);
41
+ const { id: _id, name, color, size, disabled, ariaAttrs, emitFormChange, emitFormInput } = useFormField(props, { bind: false });
42
+ const id = _id.value ?? useId();
43
+ function normalizeItem(item) {
44
+ const itemBase = {
45
+ disabled: disabled.value,
46
+ label: void 0,
47
+ description: void 0,
48
+ value: void 0,
49
+ ui: void 0,
50
+ class: void 0
51
+ };
52
+ if (typeof item === "object" && item === null) {
53
+ return {
54
+ ...itemBase,
55
+ id: `${id}:null`,
56
+ value: null
57
+ };
58
+ }
59
+ if (typeof item === "boolean" || typeof item === "string" || typeof item === "number" || typeof item === "bigint") {
60
+ return {
61
+ ...itemBase,
62
+ id: `${id}:${item}`,
63
+ label: String(item),
64
+ value: item
65
+ };
66
+ }
67
+ const value = get(item, props.valueKey);
68
+ const label = get(item, props.labelKey);
69
+ const description = get(item, props.descriptionKey);
70
+ return {
71
+ ...itemBase,
72
+ ...item,
73
+ value,
74
+ label,
75
+ description,
76
+ id: `${id}:${value}`
77
+ };
78
+ }
79
+ const normalizedItems = computed(() => {
80
+ if (!props.items)
81
+ return [];
82
+ return props.items.map(normalizeItem);
83
+ });
84
+ function onUpdate(value) {
85
+ const event = new Event("change", { target: { value } });
86
+ emit("change", event);
87
+ emitFormChange();
88
+ emitFormInput();
89
+ }
90
+ const appConfig = useAppConfig();
91
+ const ui = computed(() => {
92
+ const styler = cv(merge(theme, appConfig.ui.checkboxGroup));
93
+ return styler({
94
+ ...props,
95
+ size: size.value,
96
+ color: color.value
97
+ });
98
+ });
99
+ </script>
100
+
101
+ <template>
102
+ <CheckboxGroupRoot
103
+ v-bind="{ ...rootProps, id, name, disabled }"
104
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
105
+ data-part="root"
106
+ @update:model-value="onUpdate"
107
+ >
108
+ <fieldset v-bind="ariaAttrs" :class="ui.fieldset({ class: props.ui?.fieldset })" data-part="fieldset">
109
+ <legend v-if="props.legend || !!slots.legend" :class="ui.legend({ class: props.ui?.legend })" data-part="legend">
110
+ <slot name="legend">
111
+ {{ props.legend }}
112
+ </slot>
113
+ </legend>
114
+
115
+ <Checkbox
116
+ v-for="item in normalizedItems"
117
+ :key="item.id"
118
+ v-bind="{ ...item, ...checkboxProps, color, size, name }"
119
+ :variant="props.variant"
120
+ :disabled="item.disabled || disabled"
121
+ :ui="{ ...props.ui ? omit(props.ui, ['root']) : void 0, ...item.ui || {} }"
122
+ :class="ui.item({ disabled: item.disabled || disabled, class: [props.ui?.item, item.ui?.item, item.class] })"
123
+ data-part="item"
124
+ >
125
+ <template v-for="(_, name) in getProxySlots()" #[name]>
126
+ <slot :name="name" :item="item"></slot>
127
+ </template>
128
+ </Checkbox>
129
+ </fieldset>
130
+ </CheckboxGroupRoot>
131
+ </template>
@@ -0,0 +1,89 @@
1
+ import type { VariantProps } from '@byyuurin/ui-kit';
2
+ import type { CheckboxGroupRootEmits, CheckboxGroupRootProps, CheckboxRootProps } from 'reka-ui';
3
+ import theme from '#build/ui/checkbox-group';
4
+ import type { CheckboxProps, ComponentBaseProps, ComponentUIProps } from '../types';
5
+ import type { AcceptableValue, GetItemKeys, GetModelValue, StaticSlot } from '../types/utils';
6
+ type ThemeVariants = VariantProps<typeof theme>;
7
+ export type CheckboxGroupValue = AcceptableValue;
8
+ interface CheckboxGroupItemBase {
9
+ label?: string;
10
+ description?: string;
11
+ disabled?: boolean;
12
+ value?: AcceptableValue;
13
+ class?: ComponentBaseProps['class'];
14
+ ui?: Pick<ComponentUIProps<typeof theme>, 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
15
+ }
16
+ export type CheckboxGroupItem = CheckboxGroupValue | (CheckboxGroupItemBase & {
17
+ [key: string]: any;
18
+ });
19
+ export interface CheckboxGroupProps<T extends CheckboxGroupItem[] = CheckboxGroupItem[], VK extends GetItemKeys<T> = 'value'> extends ComponentBaseProps, Pick<CheckboxGroupRootProps, 'disabled' | 'loop' | 'name' | 'required'>, Pick<CheckboxProps, 'color' | 'indicator' | 'icon'> {
20
+ /**
21
+ * The element or component this component should render as.
22
+ * @default "div"
23
+ */
24
+ as?: CheckboxRootProps['as'];
25
+ legend?: string;
26
+ /**
27
+ * When `items` is an array of objects, select the field to use as the value.
28
+ * @default "value"
29
+ */
30
+ valueKey?: VK;
31
+ /**
32
+ * When `items` is an array of objects, select the field to use as the label.
33
+ * @default "label"
34
+ */
35
+ labelKey?: GetItemKeys<T>;
36
+ /**
37
+ * When `items` is an array of objects, select the field to use as the description.
38
+ * @default "description"
39
+ */
40
+ descriptionKey?: GetItemKeys<T>;
41
+ items?: T;
42
+ /** The controlled value of the CheckboxGroup. Can be bind as `v-model`. */
43
+ modelValue?: GetModelValue<T, VK, true>;
44
+ /** The value of the CheckboxGroup when initially rendered. Use when you do not need to control the state of the CheckboxGroup. */
45
+ defaultValue?: GetModelValue<T, VK, true>;
46
+ /** @default "md" */
47
+ size?: ThemeVariants['size'];
48
+ /** @default "list" */
49
+ variant?: ThemeVariants['variant'];
50
+ /**
51
+ * The orientation the checkbox buttons are laid out.
52
+ * @default "vertical"
53
+ */
54
+ orientation?: ThemeVariants['orientation'];
55
+ ui?: ComponentUIProps<typeof theme>;
56
+ }
57
+ export type CheckboxGroupEmits<T extends CheckboxGroupItem[] = CheckboxGroupItem[]> = CheckboxGroupRootEmits<T[number]> & {
58
+ change: [event: Event];
59
+ };
60
+ export interface CheckboxGroupSlots<T extends CheckboxGroupItem[] = CheckboxGroupItem[]> {
61
+ legend: StaticSlot;
62
+ label: StaticSlot<{
63
+ item: T[number] & {
64
+ id: string;
65
+ };
66
+ }>;
67
+ description: StaticSlot<{
68
+ item: T[number] & {
69
+ id: string;
70
+ };
71
+ }>;
72
+ }
73
+ declare const __VLS_export: <T extends CheckboxGroupItem[], VK extends GetItemKeys<T> = "value">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
74
+ props: __VLS_PrettifyLocal<CheckboxGroupProps<T, VK> & {
75
+ onChange?: ((event: Event) => any) | undefined;
76
+ "onUpdate:modelValue"?: ((value: T[number][]) => any) | undefined;
77
+ }> & import("vue").PublicProps;
78
+ expose: (exposed: {}) => void;
79
+ attrs: any;
80
+ slots: CheckboxGroupSlots<CheckboxGroupItem[]>;
81
+ emit: ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T[number][]) => void);
82
+ }>) => import("vue").VNode & {
83
+ __ctx?: Awaited<typeof __VLS_setup>;
84
+ };
85
+ declare const _default: typeof __VLS_export;
86
+ export default _default;
87
+ type __VLS_PrettifyLocal<T> = {
88
+ [K in keyof T as K]: T[K];
89
+ } & {};
@@ -73,32 +73,32 @@ const groups = computed(
73
73
  v-if="item.loading"
74
74
  :name="loadingIcon || appConfig.ui.icons.loading"
75
75
  :class="props.ui.itemLeadingIcon({ class: [props.uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item.color, loading: true })"
76
- data-part="item-leading-icon"
76
+ data-part="itemLeadingIcon"
77
77
  />
78
78
  <Icon
79
79
  v-else-if="item.icon"
80
80
  :name="item.icon"
81
81
  :class="props.ui.itemLeadingIcon({ class: [props.uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item.color, active })"
82
- data-part="item-leading-icon"
82
+ data-part="itemLeadingIcon"
83
83
  />
84
84
  <Avatar
85
85
  v-else-if="item.avatar"
86
86
  v-bind="item.avatar"
87
87
  :size="item.avatar.size || props.size"
88
88
  :class="props.ui.itemLeadingAvatar({ class: [props.uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })"
89
- data-part="item-leading-avatar"
89
+ data-part="itemLeadingAvatar"
90
90
  />
91
91
  </slot>
92
92
 
93
93
  <span
94
94
  v-if="get(item, props.labelKey) || !!slots[`${item.slot || 'item'}-label`] || (get(item, props.descriptionKey) || !!slots[`${item.slot || 'item'}-description`])"
95
95
  :class="props.ui.itemWrapper({ class: [props.uiOverride?.itemWrapper, item.ui?.itemWrapper] })"
96
- data-part="item-wrapper"
96
+ data-part="itemWrapper"
97
97
  >
98
98
  <span
99
99
  v-if="get(item, props.labelKey) || !!slots[`${item.slot || 'item'}-label`]"
100
100
  :class="props.ui.itemLabel({ class: [props.uiOverride?.itemLabel, item.ui?.itemLabel], active })"
101
- data-part="item-label"
101
+ data-part="itemLabel"
102
102
  >
103
103
  <slot :name="`${item.slot || 'item'}-label`" :item="item" :active="active" :index="index">
104
104
  {{ get(item, props.labelKey) }}
@@ -108,21 +108,21 @@ const groups = computed(
108
108
  v-if="item.target === '_blank' && props.externalIcon !== false"
109
109
  :name="typeof props.externalIcon === 'string' ? props.externalIcon : appConfig.ui.icons.external"
110
110
  :class="props.ui.itemLabelExternalIcon({ class: [props.uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item.color, active })"
111
- data-part="item-label-external-icon"
111
+ data-part="itemLabelExternalIcon"
112
112
  />
113
113
  </span>
114
114
 
115
- <span v-if="get(item, props.descriptionKey)" :class="props.ui.itemDescription({ class: [props.uiOverride?.itemDescription, item.ui?.itemDescription] })" data-part="item-description">
115
+ <span v-if="get(item, props.descriptionKey)" :class="props.ui.itemDescription({ class: [props.uiOverride?.itemDescription, item.ui?.itemDescription] })" data-part="itemDescription">
116
116
  <slot :name="`${item.slot || 'item'}-description`" :item="item" :active="active" :index="index">
117
117
  {{ get(item, props.descriptionKey) }}
118
118
  </slot>
119
119
  </span>
120
120
  </span>
121
121
 
122
- <span :class="props.ui.itemTrailing({ class: [props.uiOverride?.itemTrailing, item.ui?.itemTrailing] })" data-part="item-trailing">
122
+ <span :class="props.ui.itemTrailing({ class: [props.uiOverride?.itemTrailing, item.ui?.itemTrailing] })" data-part="itemTrailing">
123
123
  <slot :name="`${item.slot || 'item'}-trailing`" :item="item" :active="active" :index="index" :ui="ui">
124
- <Icon v-if="item.children?.length" :name="childrenIcon" :class="props.ui.itemTrailingIcon({ class: [props.uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item.color, active })" data-part="item-trailing-icon" />
125
- <span v-else-if="item.kbds?.length" :class="props.ui.itemTrailingKbds({ class: [props.uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })" data-part="item-trailing-kbds">
124
+ <Icon v-if="item.children?.length" :name="childrenIcon" :class="props.ui.itemTrailingIcon({ class: [props.uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item.color, active })" data-part="itemTrailingIcon" />
125
+ <span v-else-if="item.kbds?.length" :class="props.ui.itemTrailingKbds({ class: [props.uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })" data-part="itemTrailingKbds">
126
126
  <Kbd
127
127
  v-for="(kbd, kbdIndex) in item.kbds"
128
128
  :key="kbdIndex"
@@ -133,7 +133,7 @@ const groups = computed(
133
133
  </slot>
134
134
 
135
135
  <DropdownMenu.ItemIndicator as-child>
136
- <Icon :name="props.checkedIcon || appConfig.ui.icons.check" :class="props.ui.itemTrailingIcon({ class: [props.uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item.color })" data-part="item-trailing-icon" />
136
+ <Icon :name="props.checkedIcon || appConfig.ui.icons.check" :class="props.ui.itemTrailingIcon({ class: [props.uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item.color })" data-part="itemTrailingIcon" />
137
137
  </DropdownMenu.ItemIndicator>
138
138
  </span>
139
139
  </slot>
@@ -70,7 +70,7 @@ const ui = computed(() => {
70
70
  <template>
71
71
  <Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
72
72
  <div :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
73
- <div v-if="props.label || !!slots.label" :class="ui.labelWrapper({ class: props.ui?.labelWrapper })" data-part="label-wrapper">
73
+ <div v-if="props.label || !!slots.label" :class="ui.labelWrapper({ class: props.ui?.labelWrapper })" data-part="labelWrapper">
74
74
  <Label :for="id" :class="ui.label({ class: props.ui?.label })" data-part="label">
75
75
  <slot name="label" :label="props.label">
76
76
  {{ props.label }}
@@ -114,14 +114,14 @@ defineExpose({
114
114
  v-if="isLeading && leadingIconName"
115
115
  :name="leadingIconName"
116
116
  :class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
117
- data-part="leading-icon"
117
+ data-part="leadingIcon"
118
118
  />
119
119
  <Avatar
120
120
  v-else-if="props.avatar"
121
121
  :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
122
122
  v-bind="props.avatar"
123
123
  :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
124
- data-part="leading-avatar"
124
+ data-part="leadingAvatar"
125
125
  />
126
126
  </slot>
127
127
  </span>
@@ -150,7 +150,7 @@ defineExpose({
150
150
  v-if="trailingIconName"
151
151
  :name="trailingIconName"
152
152
  :class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
153
- data-part="trailing-icon"
153
+ data-part="trailingIcon"
154
154
  />
155
155
  </slot>
156
156
  </span>
@@ -30,7 +30,6 @@ const props = defineProps({
30
30
  autofocus: { type: Boolean, required: false },
31
31
  autofocusDelay: { type: Number, required: false },
32
32
  modelModifiers: { type: Object, required: false },
33
- locale: { type: String, required: false },
34
33
  ui: { type: null, required: false },
35
34
  class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true },
36
35
  modelValue: { type: [Number, null], required: false },
@@ -52,8 +51,7 @@ const emit = defineEmits(["update:modelValue", "blur", "change"]);
52
51
  defineSlots();
53
52
  const modelValue = useVModel(props, "modelValue", emit, { defaultValue: props.defaultValue });
54
53
  const rootProps = useForwardPropsEmits(reactivePick(props, "as", "defaultValue", "min", "max", "step", "stepSnapping", "formatOptions", "disableWheelChange", "invertWheelChange", "readonly"), emit);
55
- const { t, code: codeLocale } = useLocale();
56
- const locale = computed(() => props.locale || codeLocale.value);
54
+ const { t } = useLocale();
57
55
  const { id, name, size: formFieldSize, color, highlight, disabled, ariaAttrs, emitFormBlur, emitFormFocus, emitFormInput, emitFormChange } = useFormField(props);
58
56
  const { size: fieldGroupSize, orientation } = useFieldGroup(props);
59
57
  const appConfig = useAppConfig();
@@ -98,7 +96,7 @@ defineExpose({
98
96
 
99
97
  <template>
100
98
  <NumberFieldRoot
101
- v-bind="{ ...rootProps, id, name, disabled, locale, modelValue }"
99
+ v-bind="{ ...rootProps, id, name, disabled, modelValue }"
102
100
  :class="ui.root({ class: [props.ui?.root, props.class] })"
103
101
  data-part="root"
104
102
  @update:model-value="onUpdate"
@@ -53,11 +53,6 @@ export interface InputNumberProps extends ComponentBaseProps, Pick<NumberFieldRo
53
53
  autofocus?: boolean;
54
54
  autofocusDelay?: number;
55
55
  modelModifiers?: Pick<ModelModifiers, 'optional'>;
56
- /**
57
- * The locale to use for formatting and parsing numbers.
58
- * @default App.locale.code
59
- */
60
- locale?: string;
61
56
  ui?: ComponentUIProps<typeof theme>;
62
57
  }
63
58
  export interface InputNumberEmits {