@una-ui/nuxt 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (140) hide show
  1. package/dist/module.json +3 -3
  2. package/dist/module.mjs +10 -8
  3. package/dist/runtime/components/alert-dialog/AlertDialog.vue.d.ts +1 -1
  4. package/dist/runtime/components/alert-dialog/AlertDialogAction.vue.d.ts +1 -1
  5. package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue.d.ts +1 -1
  6. package/dist/runtime/components/alert-dialog/AlertDialogContent.vue +0 -1
  7. package/dist/runtime/components/aspect-ratio/AspectRatio.vue.d.ts +1 -1
  8. package/dist/runtime/components/combobox/Combobox.vue +4 -2
  9. package/dist/runtime/components/combobox/Combobox.vue.d.ts +19 -19
  10. package/dist/runtime/components/combobox/ComboboxInput.vue.d.ts +1 -1
  11. package/dist/runtime/components/combobox/ComboboxList.vue +3 -0
  12. package/dist/runtime/components/combobox/ComboboxTrigger.vue.d.ts +1 -1
  13. package/dist/runtime/components/data/table/Table.vue +6 -1
  14. package/dist/runtime/components/data/table/TableEmpty.vue +17 -9
  15. package/dist/runtime/components/data/table/TableEmpty.vue.d.ts +4 -0
  16. package/dist/runtime/components/drawer/Drawer.vue.d.ts +1 -1
  17. package/dist/runtime/components/drawer/DrawerContent.vue +0 -1
  18. package/dist/runtime/components/drawer/DrawerOverlay.vue +1 -0
  19. package/dist/runtime/components/elements/Badge.vue.d.ts +1 -5
  20. package/dist/runtime/components/elements/Progress.vue.d.ts +1 -1
  21. package/dist/runtime/components/elements/Toggle.vue.d.ts +1 -1
  22. package/dist/runtime/components/elements/accordion/Accordion.vue +86 -0
  23. package/dist/runtime/components/elements/accordion/Accordion.vue.d.ts +71 -0
  24. package/dist/runtime/components/elements/accordion/AccordionContent.vue +24 -0
  25. package/dist/runtime/components/elements/accordion/AccordionContent.vue.d.ts +13 -0
  26. package/dist/runtime/components/elements/accordion/AccordionHeader.vue +17 -0
  27. package/dist/runtime/components/elements/accordion/AccordionHeader.vue.d.ts +13 -0
  28. package/dist/runtime/components/elements/accordion/AccordionItem.vue +59 -0
  29. package/dist/runtime/components/elements/accordion/AccordionItem.vue.d.ts +27 -0
  30. package/dist/runtime/components/elements/accordion/AccordionTrigger.vue +56 -0
  31. package/dist/runtime/components/elements/accordion/AccordionTrigger.vue.d.ts +16 -0
  32. package/dist/runtime/components/elements/avatar/Avatar.vue.d.ts +1 -1
  33. package/dist/runtime/components/elements/collapsible/Collapsible.vue.d.ts +2 -2
  34. package/dist/runtime/components/elements/collapsible/CollapsibleContent.vue +1 -0
  35. package/dist/runtime/components/elements/dialog/Dialog.vue.d.ts +1 -1
  36. package/dist/runtime/components/elements/dialog/DialogContent.vue +0 -1
  37. package/dist/runtime/components/elements/dialog/DialogDescription.vue +2 -1
  38. package/dist/runtime/components/elements/dialog/DialogScrollContent.vue +0 -1
  39. package/dist/runtime/components/elements/dropdown-menu/DropdownMenu.vue.d.ts +4 -4
  40. package/dist/runtime/components/elements/dropdown-menu/DropdownMenuContent.vue +3 -1
  41. package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubContent.vue +3 -1
  42. package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +1 -1
  43. package/dist/runtime/components/elements/pagination/Pagination.vue.d.ts +2 -5
  44. package/dist/runtime/components/elements/pagination/PaginationListItem.vue.d.ts +1 -1
  45. package/dist/runtime/components/elements/popover/Popover.vue.d.ts +1 -1
  46. package/dist/runtime/components/elements/popover/PopoverContent.vue +3 -0
  47. package/dist/runtime/components/elements/tabs/Tabs.vue.d.ts +1 -1
  48. package/dist/runtime/components/elements/tabs/TabsTrigger.vue.d.ts +1 -1
  49. package/dist/runtime/components/elements/tooltip/TooltipContent.vue +1 -0
  50. package/dist/runtime/components/forms/Input.vue.d.ts +1 -13
  51. package/dist/runtime/components/forms/Switch.vue.d.ts +2 -2
  52. package/dist/runtime/components/forms/radio-group/RadioGroup.vue +1 -2
  53. package/dist/runtime/components/forms/radio-group/RadioGroup.vue.d.ts +5 -5
  54. package/dist/runtime/components/forms/radio-group/RadioGroupItem.vue +1 -1
  55. package/dist/runtime/components/forms/radio-group/RadioGroupItem.vue.d.ts +2 -1
  56. package/dist/runtime/components/forms/select/Select.vue +5 -23
  57. package/dist/runtime/components/forms/select/Select.vue.d.ts +18 -20
  58. package/dist/runtime/components/forms/select/SelectContent.vue +3 -0
  59. package/dist/runtime/components/forms/select/SelectItem.vue +0 -2
  60. package/dist/runtime/components/forms/select/SelectItemIndicator.vue +7 -6
  61. package/dist/runtime/components/forms/select/SelectItemIndicator.vue.d.ts +1 -3
  62. package/dist/runtime/components/hover-card/HoverCard.vue.d.ts +1 -1
  63. package/dist/runtime/components/hover-card/HoverCardContent.vue +3 -0
  64. package/dist/runtime/components/misc/ThemeSwitcher.vue +25 -19
  65. package/dist/runtime/components/misc/ThemeSwitcher.vue.d.ts +1 -1
  66. package/dist/runtime/components/navigation/breadcrumb/Breadcrumb.vue.d.ts +6 -16
  67. package/dist/runtime/components/navigation-menu/NavigationMenu.vue.d.ts +11 -11
  68. package/dist/runtime/components/navigation-menu/NavigationMenuIndicator.vue +1 -0
  69. package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue.d.ts +2 -2
  70. package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +1 -1
  71. package/dist/runtime/components/navigation-menu/NavigationMenuViewport.vue +1 -0
  72. package/dist/runtime/components/number-field/NumberField.vue +1 -0
  73. package/dist/runtime/components/overlays/Toaster.vue +1 -0
  74. package/dist/runtime/components/overlays/Toaster.vue.d.ts +1 -1
  75. package/dist/runtime/components/overlays/toast/Toast.vue.d.ts +1 -1
  76. package/dist/runtime/components/overlays/toast/ToastAction.vue.d.ts +1 -1
  77. package/dist/runtime/components/overlays/toast/ToastProvider.vue +1 -0
  78. package/dist/runtime/components/pin-input/PinInput.vue +139 -0
  79. package/dist/runtime/components/pin-input/PinInput.vue.d.ts +33 -0
  80. package/dist/runtime/components/pin-input/PinInputGroup.vue +28 -0
  81. package/dist/runtime/components/pin-input/PinInputGroup.vue.d.ts +13 -0
  82. package/dist/runtime/components/pin-input/PinInputSeparator.vue +30 -0
  83. package/dist/runtime/components/pin-input/PinInputSeparator.vue.d.ts +15 -0
  84. package/dist/runtime/components/pin-input/PinInputSlot.vue +46 -0
  85. package/dist/runtime/components/pin-input/PinInputSlot.vue.d.ts +5 -0
  86. package/dist/runtime/components/resizable/ResizableHandle.vue +1 -0
  87. package/dist/runtime/components/resizable/ResizablePanel.vue.d.ts +1 -7
  88. package/dist/runtime/components/resizable/ResizablePanelGroup.vue.d.ts +1 -3
  89. package/dist/runtime/components/sheet/Sheet.vue.d.ts +1 -1
  90. package/dist/runtime/components/sheet/SheetContent.vue +6 -2
  91. package/dist/runtime/components/sheet/SheetOverlay.vue +6 -1
  92. package/dist/runtime/components/sidebar/SidebarMenu.vue.d.ts +1 -1
  93. package/dist/runtime/components/sidebar/SidebarProvider.vue +7 -2
  94. package/dist/runtime/components/sidebar/SidebarProvider.vue.d.ts +1 -1
  95. package/dist/runtime/components/stepper/Stepper.vue +163 -0
  96. package/dist/runtime/components/stepper/Stepper.vue.d.ts +62 -0
  97. package/dist/runtime/components/stepper/StepperContainer.vue +21 -0
  98. package/dist/runtime/components/stepper/StepperContainer.vue.d.ts +15 -0
  99. package/dist/runtime/components/stepper/StepperDescription.vue +28 -0
  100. package/dist/runtime/components/stepper/StepperDescription.vue.d.ts +13 -0
  101. package/dist/runtime/components/stepper/StepperHeader.vue +21 -0
  102. package/dist/runtime/components/stepper/StepperHeader.vue.d.ts +15 -0
  103. package/dist/runtime/components/stepper/StepperIndicator.vue +34 -0
  104. package/dist/runtime/components/stepper/StepperIndicator.vue.d.ts +15 -0
  105. package/dist/runtime/components/stepper/StepperItem.vue +44 -0
  106. package/dist/runtime/components/stepper/StepperItem.vue.d.ts +15 -0
  107. package/dist/runtime/components/stepper/StepperSeparator.vue +29 -0
  108. package/dist/runtime/components/stepper/StepperSeparator.vue.d.ts +6 -0
  109. package/dist/runtime/components/stepper/StepperTitle.vue +27 -0
  110. package/dist/runtime/components/stepper/StepperTitle.vue.d.ts +13 -0
  111. package/dist/runtime/components/stepper/StepperTrigger.vue +29 -0
  112. package/dist/runtime/components/stepper/StepperTrigger.vue.d.ts +15 -0
  113. package/dist/runtime/components/stepper/StepperWrapper.vue +21 -0
  114. package/dist/runtime/components/stepper/StepperWrapper.vue.d.ts +15 -0
  115. package/dist/runtime/components/toggle-group/ToggleGroup.vue +70 -0
  116. package/dist/runtime/components/toggle-group/ToggleGroup.vue.d.ts +23 -0
  117. package/dist/runtime/components/toggle-group/ToggleGroupItem.vue +75 -0
  118. package/dist/runtime/components/toggle-group/ToggleGroupItem.vue.d.ts +18 -0
  119. package/dist/runtime/composables/useUnaSettings.d.ts +2 -2
  120. package/dist/runtime/composables/useUnaSettings.js +7 -6
  121. package/dist/runtime/plugins/theme.client.js +3 -2
  122. package/dist/runtime/plugins/theme.server.js +4 -2
  123. package/dist/runtime/types/accordion.d.ts +36 -91
  124. package/dist/runtime/types/combobox.d.ts +3 -2
  125. package/dist/runtime/types/index.d.ts +6 -3
  126. package/dist/runtime/types/index.js +3 -0
  127. package/dist/runtime/types/pin-input.d.ts +88 -0
  128. package/dist/runtime/types/pin-input.js +0 -0
  129. package/dist/runtime/types/radio-group.d.ts +5 -3
  130. package/dist/runtime/types/select.d.ts +6 -4
  131. package/dist/runtime/types/sidebar.d.ts +5 -0
  132. package/dist/runtime/types/stepper.d.ts +129 -0
  133. package/dist/runtime/types/stepper.js +0 -0
  134. package/dist/runtime/types/table.d.ts +16 -3
  135. package/dist/runtime/types/toggle-group.d.ts +39 -0
  136. package/dist/runtime/types/toggle-group.js +0 -0
  137. package/dist/runtime/utils/index.d.ts +1 -1
  138. package/package.json +20 -20
  139. package/dist/runtime/components/elements/Accordion.vue +0 -212
  140. package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -28
@@ -1,5 +1,6 @@
1
+ import type { AccordionContentProps, AccordionHeaderProps, AccordionItemProps, AccordionRootProps, AccordionTriggerProps } from 'reka-ui';
1
2
  import type { NButtonProps } from './button.js';
2
- export interface NAccordionProps extends Omit<NButtonProps, 'una'> {
3
+ export interface NAccordionProps extends AccordionRootProps {
3
4
  /**
4
5
  * Allows you to add `UnaUI` accordion preset properties,
5
6
  * Think of it as a shortcut for adding options or variants to the preset if available.
@@ -8,110 +9,54 @@ export interface NAccordionProps extends Omit<NButtonProps, 'una'> {
8
9
  * But you can add your own in the configuration file.
9
10
  */
10
11
  accordion?: string;
11
- /**
12
- * Update leading icon when accordion button item is open,
13
- * Accepts icon name and utility classes
14
- */
15
- trailingOpen?: string;
16
- /**
17
- * Update leading icon when accordion button item is closed,
18
- * Accepts icon name and utility classes
19
- */
20
- trailingClose?: string;
21
- /**
22
- * Allow multiple accordion items to be open at the same time
23
- *
24
- * @default false
25
- */
26
- multiple?: boolean;
27
- /**
28
- * Allow accordion item to be open by default
29
- *
30
- * @default false
31
- */
32
- defaultOpen?: boolean;
33
- /**
34
- * Removes border and divider from accordion
35
- *
36
- * @default false
37
- */
38
- unstyle?: boolean;
39
- /**
40
- * By default, the accordion is unmounted for performance reasons,
41
- * This means that the accordion will not be rendered until it is opened,
42
- * If you want to render the accordion when the page loads, you can use the `mounted` prop.
43
- *
44
- * @default false
45
- */
46
- mounted?: boolean;
47
12
  /**
48
13
  * List of items to be rendered,
49
14
  * It extends the `NButtonProps` interface
50
15
  *
51
16
  * @see https://github.com/una-ui/una-ui/blob/main/packages/nuxt/src/runtime/types/button.ts
52
17
  */
53
- items: NAccordionItemProps[];
18
+ items?: NAccordionItemProps[];
54
19
  /**
55
20
  * `UnaUI` preset configuration
56
21
  *
57
22
  * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/accordion.ts
58
23
  */
59
- una?: {
60
- accordion?: string;
61
- accordionItem?: string;
62
- accordionButton?: string;
63
- accordionPanel?: string;
64
- accordionLeading?: string;
65
- accordionTrailing?: string;
66
- accordionTrailingOpen?: string;
67
- accordionTrailingClose?: string;
68
- accordionEnterActive?: string;
69
- accordionLeaveActive?: string;
70
- } & NButtonProps['una'];
24
+ una?: NAccordionUnaProps & NButtonProps['una'];
25
+ _accordionItem?: Omit<NAccordionItemProps, 'una' | 'value'>;
26
+ _accordionHeader?: Omit<NAccordionHeaderProps, 'una'>;
27
+ _accordionTrigger?: Omit<NButtonProps, 'una'>;
28
+ _accordionContent?: Omit<NAccordionContentProps, 'una'>;
29
+ }
30
+ export interface NAccordionContentProps extends AccordionContentProps {
31
+ una?: Pick<NAccordionUnaProps, 'accordionContent' | 'accordionPanel'>;
32
+ }
33
+ export interface NAccordionHeaderProps extends AccordionHeaderProps {
34
+ una?: Pick<NAccordionUnaProps, 'accordionHeader' | 'accordionTrigger' | 'accordionTrailing' | 'accordionTrailingClose' | 'accordionTrailingOpen' | 'accordionLeading'>;
71
35
  }
72
- export interface NAccordionItemProps extends NButtonProps {
36
+ export interface NAccordionTriggerProps extends AccordionTriggerProps, NButtonProps {
37
+ una?: Pick<NAccordionUnaProps, 'accordionTrigger' | 'accordionTrailing' | 'accordionTrailingClose' | 'accordionTrailingOpen' | 'accordionLeading'> & NButtonProps['una'];
38
+ }
39
+ export interface NAccordionItemProps extends AccordionItemProps {
40
+ label?: string;
73
41
  /**
74
42
  * Accordion item content
75
43
  */
76
44
  content?: string;
77
- /**
78
- * Update item leading icon when accordion button item is open,
79
- * Accepts icon name and utility classes
80
- *
81
- * @example
82
- * trailingOpen='i-heroicons-information-circle text-info'
83
- */
84
- trailingOpen?: string;
85
- /**
86
- * Update item leading icon when accordion button item is closed,
87
- * Accepts icon name and utility classes
88
- *
89
- * @example
90
- * trailingClose='i-heroicons-information-circle text-info'
91
- */
92
- trailingClose?: string;
93
- /**
94
- * Allow accordion item to be open by default
95
- *
96
- * @default false
97
- */
98
- defaultOpen?: boolean;
99
- /**
100
- * Close other accordion items when item is open
101
- *
102
- * @default false
103
- */
104
- closeOthers?: boolean;
105
- /**
106
- * By default, all the accordion item is unmounted for performance reasons,
107
- * You can use the `mounted` prop to render the accordion specific on item.
108
- *
109
- * @default false
110
- */
111
- mounted?: boolean;
112
- /**
113
- * Allow dynamic attributes to be added to the accordion item,
114
- *
115
- */
116
- [key: string]: any;
45
+ una?: Omit<NAccordionUnaProps, 'accordion'> & NButtonProps['una'];
46
+ _accordionHeader?: Omit<NAccordionHeaderProps, 'una'>;
47
+ _accordionTrigger?: Omit<NAccordionTriggerProps, 'una'>;
48
+ _accordionContent?: Omit<NAccordionContentProps, 'una'>;
49
+ }
50
+ interface NAccordionUnaProps {
51
+ accordion?: string;
52
+ accordionItem?: string;
53
+ accordionTrailing?: string;
54
+ accordionTrailingOpen?: string;
55
+ accordionTrailingClose?: string;
56
+ accordionLeading?: string;
57
+ accordionHeader?: string;
58
+ accordionTrigger?: string;
59
+ accordionContent?: string;
60
+ accordionPanel?: string;
117
61
  }
62
+ export {};
@@ -10,12 +10,12 @@ interface BaseExtensions {
10
10
  export type ExtractItemType<T> = T extends {
11
11
  items: infer I extends AcceptableValue[];
12
12
  } ? I[number] : T;
13
- export interface NComboboxProps<T extends AcceptableValue> extends Omit<ComboboxRootProps<ExtractItemType<T>>, 'modelValue'>, Pick<NComboboxInputProps, 'status' | 'id'>, BaseExtensions {
13
+ export interface NComboboxProps<T extends AcceptableValue, M extends boolean> extends Omit<ComboboxRootProps<ExtractItemType<T>>, 'modelValue'>, Pick<NComboboxInputProps, 'status' | 'id'>, BaseExtensions {
14
14
  /**
15
15
  * The model value for the combobox.
16
16
  * When using grouped items, this will be the item type from within the groups.
17
17
  */
18
- modelValue?: ExtractItemType<T> | ExtractItemType<T>[] | null | undefined;
18
+ modelValue?: (M extends true ? ExtractItemType<T>[] : ExtractItemType<T>) | null;
19
19
  /**
20
20
  * The items to display in the combobox.
21
21
  *
@@ -52,6 +52,7 @@ export interface NComboboxProps<T extends AcceptableValue> extends Omit<Combobox
52
52
  * @default ''
53
53
  */
54
54
  label?: string;
55
+ multiple?: M;
55
56
  /**
56
57
  * Sub-component configurations
57
58
  */
@@ -26,6 +26,7 @@ export * from './link.js';
26
26
  export * from './navigation-menu.js';
27
27
  export * from './number-field.js';
28
28
  export * from './pagination.js';
29
+ export * from './pin-input.js';
29
30
  export * from './popover.js';
30
31
  export * from './progress.js';
31
32
  export * from './radio-group.js';
@@ -37,11 +38,13 @@ export * from './sheet.js';
37
38
  export * from './sidebar.js';
38
39
  export * from './skeleton.js';
39
40
  export * from './slider.js';
41
+ export * from './stepper.js';
40
42
  export * from './switch.js';
41
43
  export * from './table.js';
42
44
  export * from './tabs.js';
43
45
  export * from './toast.js';
44
46
  export * from './toggle.js';
47
+ export * from './toggle-group.js';
45
48
  export * from './tooltip.js';
46
49
  export interface Colors {
47
50
  [key: string]: string;
@@ -62,9 +65,9 @@ export interface ColorPalette {
62
65
  export interface UnaSettings {
63
66
  primaryColors: Colors;
64
67
  grayColors: Colors;
65
- theme: string | null | false | undefined;
66
- primary: string;
67
- gray: string;
68
+ theme: string | false;
69
+ primary: string | false;
70
+ gray: string | false;
68
71
  fontSize: number;
69
72
  radius: number;
70
73
  themes: {
@@ -26,6 +26,7 @@ export * from "./link.js";
26
26
  export * from "./navigation-menu.js";
27
27
  export * from "./number-field.js";
28
28
  export * from "./pagination.js";
29
+ export * from "./pin-input.js";
29
30
  export * from "./popover.js";
30
31
  export * from "./progress.js";
31
32
  export * from "./radio-group.js";
@@ -37,9 +38,11 @@ export * from "./sheet.js";
37
38
  export * from "./sidebar.js";
38
39
  export * from "./skeleton.js";
39
40
  export * from "./slider.js";
41
+ export * from "./stepper.js";
40
42
  export * from "./switch.js";
41
43
  export * from "./table.js";
42
44
  export * from "./tabs.js";
43
45
  export * from "./toast.js";
44
46
  export * from "./toggle.js";
47
+ export * from "./toggle-group.js";
45
48
  export * from "./tooltip.js";
@@ -0,0 +1,88 @@
1
+ import type { PinInputInputProps, PinInputRootProps, PrimitiveProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ interface BaseExtensions {
4
+ /** CSS class for the component */
5
+ class?: HTMLAttributes['class'];
6
+ /** Size of the component */
7
+ size?: HTMLAttributes['class'];
8
+ }
9
+ export type PinInputType = 'text' | 'number';
10
+ export type PinInputValueType<T extends PinInputType> = T extends 'text' ? string : number;
11
+ export interface NPinInputProps<T extends PinInputType = 'text'> extends Omit<PinInputRootProps<T>, 'defaultValue'>, Pick<NPinInputSlotProps, 'pinInput' | 'status'>, BaseExtensions {
12
+ /**
13
+ * The default value of the pin input.
14
+ * @default []
15
+ */
16
+ defaultValue?: PinInputValueType<T>[];
17
+ /**
18
+ * The maximum number of slots to render.
19
+ */
20
+ maxLength?: number;
21
+ /**
22
+ * The icon to use as a separator between pin-input groups.
23
+ */
24
+ separator?: boolean | string;
25
+ /**
26
+ * The number of slots to group together.
27
+ *
28
+ * @default 0
29
+ */
30
+ groupBy?: number;
31
+ /** Props for the pin input group */
32
+ _pinInputGroup?: Partial<NPinInputGroupProps>;
33
+ /** Props for the pin input separator */
34
+ _pinInputSeparator?: Partial<NPinInputSeparatorProps>;
35
+ /** Props for the pin input slots */
36
+ _pinInputSlot?: Partial<NPinInputSlotProps>;
37
+ /**
38
+ * `UnaUI` preset configuration
39
+ *
40
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/pin-input.ts
41
+ */
42
+ una?: NPinInputUnaProps;
43
+ }
44
+ export interface NPinInputGroupProps extends PrimitiveProps, BaseExtensions {
45
+ /** Additional properties for the una component */
46
+ una?: Pick<NPinInputUnaProps, 'pinInputGroup'>;
47
+ }
48
+ export interface NPinInputSlotProps extends PinInputInputProps, Pick<NPinInputSeparatorProps, 'icon'>, BaseExtensions {
49
+ /**
50
+ * Allows you to add `UnaUI` pin-input preset properties,
51
+ * Think of it as a shortcut for adding options or variants to the preset if available.
52
+ *
53
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/pin-input.ts
54
+ * @example
55
+ * pin-input="outline-indigo"
56
+ */
57
+ pinInput?: HTMLAttributes['class'];
58
+ /**
59
+ * Update the pin input status.
60
+ * Useful for validations.
61
+ *
62
+ * @default null
63
+ */
64
+ status?: 'info' | 'success' | 'warning' | 'error';
65
+ /** Additional properties for the una component */
66
+ una?: Pick<NPinInputUnaProps, 'pinInputSlot'>;
67
+ }
68
+ export interface NPinInputSeparatorProps extends PrimitiveProps, BaseExtensions {
69
+ /**
70
+ * The separator to use between pin input fields.
71
+ *@example
72
+ * 'i-lucide:dot'
73
+ */
74
+ icon?: string;
75
+ /** Additional properties for the una component */
76
+ una?: Pick<NPinInputUnaProps, 'pinInputSeparator'>;
77
+ }
78
+ interface NPinInputUnaProps {
79
+ /** CSS class for the pin input root */
80
+ pinInput?: HTMLAttributes['class'];
81
+ /** CSS class for the pin input group */
82
+ pinInputGroup?: HTMLAttributes['class'];
83
+ /** CSS class for the pin input separator */
84
+ pinInputSeparator?: HTMLAttributes['class'];
85
+ /** CSS class for the pin input slots */
86
+ pinInputSlot?: HTMLAttributes['class'];
87
+ }
88
+ export {};
File without changes
@@ -22,11 +22,12 @@ interface BaseProps {
22
22
  */
23
23
  icon?: HTMLAttributes['class'];
24
24
  }
25
- export interface NRadioGroupProps<T extends AcceptableValue> extends BaseProps, RadioGroupRootProps {
25
+ export interface NRadioGroupProps<T extends AcceptableValue, Item extends T | NRadioGroupItemProps<T>> extends BaseProps, RadioGroupRootProps {
26
+ modelValue: T;
26
27
  /**
27
28
  * The items to display in the radio group.
28
29
  */
29
- items?: T[] | NRadioGroupItemProps[];
30
+ items?: Item[];
30
31
  /**
31
32
  * The key name to use to display in the radio items.
32
33
  */
@@ -61,7 +62,8 @@ export interface NRadioGroupProps<T extends AcceptableValue> extends BaseProps,
61
62
  */
62
63
  una?: NRadioGroupUnaProps;
63
64
  }
64
- export interface NRadioGroupItemProps extends BaseProps, RadioGroupItemProps {
65
+ export interface NRadioGroupItemProps<T extends AcceptableValue = any> extends BaseProps, RadioGroupItemProps {
66
+ value: T;
65
67
  /**
66
68
  * The label to display in the radio item.
67
69
  */
@@ -15,18 +15,18 @@ type ItemTextExtensions = SelectItemTextProps & BaseExtensions;
15
15
  type GroupExtensions = SelectGroupProps & BaseExtensions;
16
16
  type LabelExtensions = SelectLabelProps & BaseExtensions;
17
17
  type SeparatorExtensions = SelectSeparatorProps & BaseExtensions;
18
- type SelectExtensions = SelectRootProps & BaseExtensions & Pick<NSelectValueProps, 'placeholder'> & Pick<NSelectItemProps, 'selectItem'> & Pick<NSelectTriggerProps, 'status' | 'select' | 'id'>;
18
+ type SelectExtensions<T extends AcceptableValue> = SelectRootProps<T> & BaseExtensions & Pick<NSelectValueProps, 'placeholder'> & Pick<NSelectItemProps, 'selectItem'> & Pick<NSelectTriggerProps, 'status' | 'select' | 'id'>;
19
19
  export interface SelectGroup<T extends AcceptableValue> {
20
20
  label?: string;
21
21
  items: T[];
22
22
  _selectLabel?: Partial<NSelectLabelProps>;
23
23
  _selectItem?: Partial<NSelectItemProps>;
24
24
  }
25
- export interface NSelectProps<T extends AcceptableValue> extends SelectExtensions {
25
+ export interface NSelectProps<T extends AcceptableValue, Items extends Array<T | SelectGroup<T>>, M extends boolean = false> extends SelectExtensions<T> {
26
26
  /**
27
27
  * The items to display in the select.
28
28
  */
29
- items: T[] | SelectGroup<T>[];
29
+ items?: Items;
30
30
  /**
31
31
  * The key name to use to display in the select items.
32
32
  */
@@ -45,6 +45,9 @@ export interface NSelectProps<T extends AcceptableValue> extends SelectExtension
45
45
  * @default false
46
46
  */
47
47
  groupSeparator?: boolean;
48
+ defaultValue?: M extends true ? T[] : T;
49
+ modelValue?: M extends true ? T[] : T;
50
+ multiple?: M;
48
51
  /**
49
52
  * Sub-component configurations
50
53
  */
@@ -107,7 +110,6 @@ export interface NSelectItemIndicatorProps extends SelectItemIndicatorProps {
107
110
  }
108
111
  export interface NSelectItemProps extends ItemExtensions {
109
112
  selectItem?: HTMLAttributes['class'];
110
- isSelected?: boolean;
111
113
  _selectItemText?: NSelectItemTextProps;
112
114
  _selectItemIndicator?: NSelectItemIndicatorProps;
113
115
  una?: Pick<NSelectUnaProps, 'selectItem' | 'selectItemIndicator'>;
@@ -56,6 +56,11 @@ export interface NSidebarProviderProps {
56
56
  /**
57
57
  * Default open state.
58
58
  *
59
+ * Sets the initial sidebar state when no persisted value exists.
60
+ *
61
+ * The sidebar state is automatically persisted in a cookie. On subsequent loads,
62
+ * the persisted cookie value takes precedence over this prop.
63
+ *
59
64
  * @default true
60
65
  */
61
66
  defaultOpen?: boolean;
@@ -0,0 +1,129 @@
1
+ import type { StepperDescriptionProps, StepperIndicatorProps, StepperItemProps, StepperRootEmits, StepperRootProps, StepperSeparatorProps, StepperTitleProps, StepperTriggerProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ interface BaseExtensions {
4
+ /** CSS class for the component */
5
+ class?: HTMLAttributes['class'];
6
+ /** Size of the component */
7
+ size?: HTMLAttributes['class'];
8
+ }
9
+ export interface NStepperProps<T> extends StepperRootProps, Pick<StepperItemProps, 'disabled'>, BaseExtensions {
10
+ /**
11
+ * The array of steps that is passed to the stepper.
12
+ *
13
+ * @default []
14
+ */
15
+ items?: T[];
16
+ /**
17
+ * Allows you to add `UnaUI` stepper preset properties,
18
+ * Think of it as a shortcut for adding options or variants to the preset if available.
19
+ *
20
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/stepper.ts
21
+ * @example
22
+ * stepper="solid-yellow"
23
+ */
24
+ stepper?: string;
25
+ /** Props for the stepper item */
26
+ _stepperItem?: Partial<NStepperItemProps>;
27
+ /** Props for the stepper trigger */
28
+ _stepperTrigger?: Partial<NStepperTriggerProps>;
29
+ /** Props for the stepper separator */
30
+ _stepperSeparator?: Partial<NStepperSeparatorProps>;
31
+ /** Props for the stepper title */
32
+ _stepperTitle?: Partial<NStepperTitleProps>;
33
+ /** Props for the stepper description */
34
+ _stepperDescription?: Partial<NStepperDescriptionProps>;
35
+ /** Props for the stepper indicator */
36
+ _stepperIndicator?: Partial<NStepperIndicatorProps>;
37
+ /** Props for the stepper header */
38
+ _stepperHeader?: Partial<NStepperHeaderProps>;
39
+ /** Props for the stepper wrapper */
40
+ _stepperWrapper?: Partial<NStepperWrapperProps>;
41
+ /** Props for the stepper container */
42
+ _stepperContainer?: Partial<NStepperContainerProps>;
43
+ /**
44
+ * `UnaUI` preset configuration
45
+ *
46
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/stepper.ts
47
+ */
48
+ una?: NStepperUnaProps;
49
+ }
50
+ export type NStepperEmits<T> = StepperRootEmits & {
51
+ next: [payload: T];
52
+ prev: [payload: T];
53
+ };
54
+ export interface NStepperItemProps extends StepperItemProps, Pick<NStepperProps<NStepperItemProps>, 'orientation'>, BaseExtensions {
55
+ /** Slot of the stepper item */
56
+ slot?: string;
57
+ /** Title of the stepper item. */
58
+ title?: string;
59
+ /** Description of the stepper item. */
60
+ description?: string;
61
+ value?: string | number;
62
+ /**
63
+ * Icon name
64
+ * @see @IconifyIcon
65
+ *
66
+ * @example
67
+ * 'i-heroicons-book-open-20-solid'
68
+ */
69
+ icon?: string;
70
+ /** Additional properties for the una component */
71
+ una?: Pick<NStepperUnaProps, 'stepperItem'>;
72
+ }
73
+ export interface NStepperTriggerProps extends StepperTriggerProps, Pick<NStepperProps<StepperItemProps>, 'stepper'>, BaseExtensions {
74
+ /** Additional properties for the una component */
75
+ una?: Pick<NStepperUnaProps, 'stepperTrigger' | 'stepperMenuDefaultVariant'>;
76
+ }
77
+ export interface NStepperSeparatorProps extends StepperSeparatorProps, Pick<NStepperProps<StepperItemProps>, 'stepper'>, Pick<BaseExtensions, 'class'> {
78
+ /** Additional properties for the una component */
79
+ una?: Pick<NStepperUnaProps, 'stepperSeparator'>;
80
+ }
81
+ export interface NStepperIndicatorProps extends StepperIndicatorProps, Pick<NStepperProps<StepperItemProps>, 'stepper'>, BaseExtensions {
82
+ /** Additional properties for the una component */
83
+ una?: Pick<NStepperUnaProps, 'stepperIndicator'>;
84
+ }
85
+ export interface NStepperHeaderProps extends Pick<BaseExtensions, 'class'>, Pick<NStepperProps<StepperItemProps>, 'orientation'> {
86
+ /** Additional properties for the una component */
87
+ una?: Pick<NStepperUnaProps, 'stepperHeader'>;
88
+ }
89
+ export interface NStepperTitleProps extends StepperTitleProps, BaseExtensions {
90
+ /** Additional properties for the una component */
91
+ una?: Pick<NStepperUnaProps, 'stepperTitle'>;
92
+ }
93
+ export interface NStepperDescriptionProps extends StepperDescriptionProps, BaseExtensions {
94
+ /** Additional properties for the una component */
95
+ una?: Pick<NStepperUnaProps, 'stepperDescription'>;
96
+ }
97
+ export interface NStepperContainerProps extends Pick<BaseExtensions, 'class'>, Pick<NStepperProps<StepperItemProps>, 'orientation'> {
98
+ /** Additional properties for the una component */
99
+ una?: Pick<NStepperUnaProps, 'stepperContainer'>;
100
+ }
101
+ export interface NStepperWrapperProps extends Pick<BaseExtensions, 'class'>, Pick<NStepperProps<StepperItemProps>, 'orientation'> {
102
+ /** Additional properties for the una component */
103
+ una?: Pick<NStepperUnaProps, 'stepperWrapper'>;
104
+ }
105
+ interface NStepperUnaProps {
106
+ /** CSS class for the stepper */
107
+ stepper?: HTMLAttributes['class'];
108
+ /** CSS class for the stepper trigger */
109
+ stepperTrigger?: HTMLAttributes['class'];
110
+ /** CSS class for the stepper trigger default variant */
111
+ stepperMenuDefaultVariant?: HTMLAttributes['class'];
112
+ /** CSS class for the stepper item */
113
+ stepperItem?: HTMLAttributes['class'];
114
+ /** CSS class for the stepper title */
115
+ stepperTitle?: HTMLAttributes['class'];
116
+ /** CSS class for the stepper description */
117
+ stepperDescription?: HTMLAttributes['class'];
118
+ /** CSS class for the stepper indicator */
119
+ stepperIndicator?: HTMLAttributes['class'];
120
+ /** CSS class for the stepper separator */
121
+ stepperSeparator?: HTMLAttributes['class'];
122
+ /** CSS class for the stepper header */
123
+ stepperHeader?: HTMLAttributes['class'];
124
+ /** CSS class for the stepper container */
125
+ stepperContainer?: HTMLAttributes['class'];
126
+ /** CSS class for the stepper wrapper */
127
+ stepperWrapper?: HTMLAttributes['class'];
128
+ }
129
+ export {};
File without changes
@@ -3,7 +3,7 @@ import type { PrimitiveProps } from 'reka-ui';
3
3
  import type { HTMLAttributes } from 'vue';
4
4
  import type { NProgressProps } from './progress.js';
5
5
  import type { NScrollAreaProps, NScrollAreaUnaProps } from './scroll-area.js';
6
- export interface NTableProps<TData, TValue> extends Omit<CoreOptions<TData>, 'data' | 'columns' | 'getCoreRowModel' | 'state' | 'onStateChange' | 'renderFallbackValue'> {
6
+ export interface NTableProps<TData, TValue> extends Omit<CoreOptions<TData>, 'data' | 'columns' | 'getCoreRowModel' | 'state' | 'onStateChange' | 'renderFallbackValue'>, Pick<NTableEmptyProps, 'emptyText' | 'emptyIcon'> {
7
7
  class?: HTMLAttributes['class'];
8
8
  /**
9
9
  * @see https://tanstack.com/table/latest/docs/api/core/table#state
@@ -115,6 +115,9 @@ export interface NTableProps<TData, TValue> extends Omit<CoreOptions<TData>, 'da
115
115
  _tableEmpty?: NTableEmptyProps;
116
116
  _tableLoading?: NTableLoadingProps;
117
117
  _scrollArea?: NScrollAreaProps;
118
+ /**
119
+ * Whether the table is loading.
120
+ */
118
121
  loading?: boolean;
119
122
  /**
120
123
  * `UnaUI` preset configuration
@@ -159,9 +162,17 @@ export interface NTableEmptyProps {
159
162
  [key: string]: any;
160
163
  class?: HTMLAttributes['class'];
161
164
  colspan?: number;
165
+ /**
166
+ * The text to display when the table is empty.
167
+ */
168
+ emptyText?: string;
169
+ /**
170
+ * The icon to display when the table is empty.
171
+ */
172
+ emptyIcon?: string;
162
173
  _tableCell?: NTableCellProps;
163
174
  _tableRow?: NTableRowProps;
164
- una?: Pick<NTableUnaProps, 'tableEmpty' | 'tableRow' | 'tableCell'>;
175
+ una?: Pick<NTableUnaProps, 'tableEmpty' | 'tableRow' | 'tableCell' | 'tableEmptyText' | 'tableEmptyIcon'>;
165
176
  }
166
177
  export interface NTableLoadingProps {
167
178
  [key: string]: any;
@@ -189,9 +200,11 @@ interface NTableUnaProps {
189
200
  tableRow?: HTMLAttributes['class'];
190
201
  tableCell?: HTMLAttributes['class'];
191
202
  tableCaption?: HTMLAttributes['class'];
192
- tableEmpty?: HTMLAttributes['class'];
193
203
  tableLoading?: HTMLAttributes['class'];
194
204
  tableLoadingRow?: HTMLAttributes['class'];
195
205
  tableLoadingCell?: HTMLAttributes['class'];
206
+ tableEmpty?: HTMLAttributes['class'];
207
+ tableEmptyText?: HTMLAttributes['class'];
208
+ tableEmptyIcon?: HTMLAttributes['class'];
196
209
  }
197
210
  export {};
@@ -0,0 +1,39 @@
1
+ import type { ToggleGroupItemProps, ToggleGroupRootProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { NButtonProps } from './button.js';
4
+ import type { NToggleProps } from './toggle.js';
5
+ interface BaseExtensions {
6
+ /** CSS class for the component */
7
+ class?: HTMLAttributes['class'];
8
+ /** Size of the component */
9
+ size?: HTMLAttributes['class'];
10
+ }
11
+ export interface NToggleGroupProps<T> extends ToggleGroupRootProps, Pick<NToggleProps, 'toggleOff' | 'toggleOn'>, BaseExtensions {
12
+ /**
13
+ * The array of items that is passed to the toggle group.
14
+ *
15
+ * @default []
16
+ */
17
+ items?: T;
18
+ /** Props for the toggle group item */
19
+ _toggleGroupItem?: Partial<NToggleGroupItemProps>;
20
+ /**
21
+ * `UnaUI` preset configuration
22
+ *
23
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/toggle-group.ts
24
+ */
25
+ una?: NToggleGroupUnaProps;
26
+ }
27
+ export interface NToggleGroupItemProps extends ToggleGroupItemProps, Omit<NToggleProps, 'una'>, Pick<BaseExtensions, 'class'> {
28
+ /** Slot of the toggle group item */
29
+ slot?: string;
30
+ /** Additional properties for the una component */
31
+ una?: Pick<NToggleGroupUnaProps, 'toggleGroupItem'> & NButtonProps['una'];
32
+ }
33
+ interface NToggleGroupUnaProps {
34
+ /** CSS class for the navigation menu */
35
+ toggleGroup?: HTMLAttributes['class'];
36
+ /** CSS class for the navigation menu content */
37
+ toggleGroupItem?: HTMLAttributes['class'];
38
+ }
39
+ export {};
File without changes
@@ -2,7 +2,7 @@ export * from './cn.js';
2
2
  export declare function rgbToHex(r: number, g: number, b: number): string;
3
3
  export declare function hexToRgb(hex: string): [number, number, number];
4
4
  export declare function randomId(prefix: string): string;
5
- export declare function omitProps<T extends Record<string, any>>(obj: T, propsToOmit: Array<keyof T>): Partial<T>;
5
+ export declare function omitProps<T extends Record<string, any>, K extends keyof T>(obj: T, propsToOmit: Array<K>): Omit<T, K>;
6
6
  export declare function pickProps<T extends Record<string, any>>(obj: T, propsToPick: Array<keyof T>): Partial<T>;
7
7
  /**
8
8
  * We want to get the first non-undefined value,