@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
@@ -0,0 +1,28 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { Primitive, useForwardProps } from "reka-ui";
4
+ import { cn } from "../../utils";
5
+ const props = defineProps({
6
+ una: { type: Object, required: false },
7
+ asChild: { type: Boolean, required: false },
8
+ as: { type: null, required: false },
9
+ class: { type: null, required: false },
10
+ size: { type: null, required: false }
11
+ });
12
+ const delegatedProps = reactiveOmit(props, "class");
13
+ const forwardedProps = useForwardProps(delegatedProps);
14
+ </script>
15
+
16
+ <template>
17
+ <Primitive
18
+ data-slot="pin-input-group"
19
+ v-bind="forwardedProps"
20
+ :class="cn(
21
+ 'pin-input-group',
22
+ props.una?.pinInputGroup,
23
+ props.class
24
+ )"
25
+ >
26
+ <slot />
27
+ </Primitive>
28
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { NPinInputGroupProps } from '../../types/index.js';
2
+ declare var __VLS_6: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_6) => any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<NPinInputGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NPinInputGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,30 @@
1
+ <script setup>
2
+ import { Primitive, useForwardProps } from "reka-ui";
3
+ import { cn } from "../../utils";
4
+ import Icon from "../elements/Icon.vue";
5
+ const props = defineProps({
6
+ icon: { type: String, required: false, default: "i-lucide-minus" },
7
+ una: { type: Object, required: false },
8
+ asChild: { type: Boolean, required: false },
9
+ as: { type: null, required: false },
10
+ class: { type: null, required: false },
11
+ size: { type: null, required: false }
12
+ });
13
+ const forwardedProps = useForwardProps(props);
14
+ </script>
15
+
16
+ <template>
17
+ <Primitive
18
+ data-slot="pin-input-separator"
19
+ v-bind="forwardedProps"
20
+ :class="cn(
21
+ 'pin-input-separator',
22
+ props.una?.pinInputSeparator,
23
+ props.class
24
+ )"
25
+ >
26
+ <slot>
27
+ <Icon :name="icon" />
28
+ </slot>
29
+ </Primitive>
30
+ </template>
@@ -0,0 +1,15 @@
1
+ import type { NPinInputSeparatorProps } from '../../types/index.js';
2
+ declare var __VLS_6: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_6) => any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<NPinInputSeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NPinInputSeparatorProps> & Readonly<{}>, {
7
+ icon: string;
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,46 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { PinInputInput, useForwardProps } from "reka-ui";
4
+ import { computed } from "vue";
5
+ import { cn } from "../../utils";
6
+ const props = defineProps({
7
+ pinInput: { type: null, required: false, default: "outline-primary" },
8
+ status: { type: String, required: false },
9
+ una: { type: Object, required: false },
10
+ index: { type: Number, required: true },
11
+ disabled: { type: Boolean, required: false },
12
+ asChild: { type: Boolean, required: false },
13
+ as: { type: null, required: false },
14
+ icon: { type: String, required: false },
15
+ class: { type: null, required: false },
16
+ size: { type: null, required: false }
17
+ });
18
+ const delegatedProps = reactiveOmit(props, "class");
19
+ const forwardedProps = useForwardProps(delegatedProps);
20
+ const statusClassVariants = computed(() => {
21
+ const input = {
22
+ info: "input-status-info pin-input-solid-info input-status-ring",
23
+ success: "input-status-success pin-input-solid-success input-status-ring",
24
+ warning: "input-status-warning pin-input-solid-warning input-status-ring",
25
+ error: "input-status-error pin-input-solid-error input-status-ring",
26
+ default: void 0
27
+ };
28
+ return {
29
+ input: input[props.status ?? "default"]
30
+ };
31
+ });
32
+ </script>
33
+
34
+ <template>
35
+ <PinInputInput
36
+ data-slot="pin-input-slot"
37
+ v-bind="forwardedProps"
38
+ :class="cn(
39
+ 'pin-input-slot',
40
+ props.una?.pinInputSlot,
41
+ props.class,
42
+ statusClassVariants.input
43
+ )"
44
+ :pin-input="statusClassVariants.input === void 0 && props.pinInput"
45
+ />
46
+ </template>
@@ -0,0 +1,5 @@
1
+ import type { NPinInputSlotProps } from '../../types/index.js';
2
+ declare const _default: import("vue").DefineComponent<NPinInputSlotProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NPinInputSlotProps> & Readonly<{}>, {
3
+ pinInput: import("vue").HTMLAttributes["class"];
4
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ export default _default;
@@ -12,6 +12,7 @@ const props = defineProps({
12
12
  hitAreaMargins: { type: Object, required: false },
13
13
  tabindex: { type: Number, required: false },
14
14
  disabled: { type: Boolean, required: false },
15
+ nonce: { type: String, required: false },
15
16
  asChild: { type: Boolean, required: false },
16
17
  as: { type: null, required: false },
17
18
  class: { type: null, required: false }
@@ -1,11 +1,5 @@
1
1
  import type { NResizablePanelProps } from '../../types/index.js';
2
- declare var __VLS_6: {
3
- isCollapsed: boolean;
4
- isExpanded: boolean;
5
- collapse: () => void;
6
- expand: () => void;
7
- resize: (size: number) => void;
8
- };
2
+ declare var __VLS_6: any;
9
3
  type __VLS_Slots = {} & {
10
4
  default?: (props: typeof __VLS_6) => any;
11
5
  };
@@ -1,7 +1,5 @@
1
1
  import type { NResizablePanelGroupProps } from '../../types/index.js';
2
- declare var __VLS_6: {
3
- layout: number[];
4
- };
2
+ declare var __VLS_6: any;
5
3
  type __VLS_Slots = {} & {
6
4
  default?: (props: typeof __VLS_6) => any;
7
5
  };
@@ -1,6 +1,6 @@
1
1
  import type { NSheetProps } from '../../types/index.js';
2
2
  declare var __VLS_6: {}, __VLS_11: {
3
- open: boolean;
3
+ open: any;
4
4
  }, __VLS_26: {}, __VLS_31: {}, __VLS_36: {}, __VLS_41: {}, __VLS_43: {}, __VLS_45: {}, __VLS_50: {};
5
5
  type __VLS_Slots = {} & {
6
6
  default?: (props: typeof __VLS_6) => any;
@@ -19,7 +19,6 @@ const props = defineProps({
19
19
  _sheetPortal: { type: Object, required: false },
20
20
  una: { type: Object, required: false },
21
21
  forceMount: { type: Boolean, required: false },
22
- trapFocus: { type: Boolean, required: false },
23
22
  disableOutsidePointerEvents: { type: Boolean, required: false },
24
23
  asChild: { type: Boolean, required: false },
25
24
  as: { type: null, required: false }
@@ -55,7 +54,12 @@ const contentEvents = computed(() => {
55
54
  data-slot="sheet-content"
56
55
  v-bind="{ ...forwarded, ...$attrs }"
57
56
  :sheet
58
- :class="cn('sheet-content', props.una?.sheetContent, props.class)"
57
+ :class="cn(
58
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
59
+ 'sheet-content',
60
+ props.una?.sheetContent,
61
+ props.class
62
+ )"
59
63
  v-on="contentEvents"
60
64
  >
61
65
  <slot />
@@ -15,7 +15,12 @@ const delegatedProps = reactiveOmit(props, "class");
15
15
  <template>
16
16
  <DialogOverlay
17
17
  data-slot="sheet-overlay"
18
- :class="cn('dialog-overlay', props.una?.sheetOverlay, props.class)"
18
+ :class="cn(
19
+ 'data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',
20
+ 'sheet-overlay',
21
+ props.una?.sheetOverlay,
22
+ props.class
23
+ )"
19
24
  v-bind="delegatedProps"
20
25
  >
21
26
  <slot />
@@ -9,7 +9,7 @@ declare const _default: <T extends {
9
9
  default?: (props: {}) => any;
10
10
  } & {
11
11
  item?: (props: {
12
- item: T;
12
+ item: any;
13
13
  }) => any;
14
14
  };
15
15
  emit: {};
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useCookie } from "#app";
2
3
  import { useEventListener, useMediaQuery, useVModel } from "@vueuse/core";
3
4
  import { TooltipProvider } from "reka-ui";
4
5
  import { computed, ref } from "vue";
@@ -13,13 +14,17 @@ const props = defineProps({
13
14
  const emits = defineEmits(["update:open"]);
14
15
  const isMobile = useMediaQuery("(max-width: 768px)");
15
16
  const openMobile = ref(false);
17
+ const openCookie = useCookie(SIDEBAR_COOKIE_NAME, {
18
+ maxAge: SIDEBAR_COOKIE_MAX_AGE,
19
+ default: () => props.defaultOpen ?? false
20
+ });
16
21
  const open = useVModel(props, "open", emits, {
17
- defaultValue: props.defaultOpen ?? false,
22
+ defaultValue: openCookie.value,
18
23
  passive: props.open === void 0
19
24
  });
20
25
  function setOpen(value) {
21
26
  open.value = value;
22
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${open.value}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
27
+ openCookie.value = open.value;
23
28
  }
24
29
  function setOpenMobile(value) {
25
30
  openMobile.value = value;
@@ -8,8 +8,8 @@ declare const __VLS_component: import("vue").DefineComponent<NSidebarProviderPro
8
8
  }, string, import("vue").PublicProps, Readonly<NSidebarProviderProps> & Readonly<{
9
9
  "onUpdate:open"?: ((open: boolean) => any) | undefined;
10
10
  }>, {
11
- defaultOpen: boolean;
12
11
  open: boolean;
12
+ defaultOpen: boolean;
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
15
15
  export default _default;
@@ -0,0 +1,163 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { StepperRoot, useForwardPropsEmits } from "reka-ui";
4
+ import { computed, useTemplateRef } from "vue";
5
+ import { cn } from "../../utils";
6
+ import Icon from "../elements/Icon.vue";
7
+ import StepperContainer from "./StepperContainer.vue";
8
+ import StepperDescription from "./StepperDescription.vue";
9
+ import StepperHeader from "./StepperHeader.vue";
10
+ import StepperIndicator from "./StepperIndicator.vue";
11
+ import StepperItem from "./StepperItem.vue";
12
+ import StepperSeparator from "./StepperSeparator.vue";
13
+ import StepperTitle from "./StepperTitle.vue";
14
+ import StepperTrigger from "./StepperTrigger.vue";
15
+ import StepperWrapper from "./StepperWrapper.vue";
16
+ const props = defineProps({
17
+ items: { type: Array, required: false },
18
+ stepper: { type: String, required: false, default: "solid-primary" },
19
+ _stepperItem: { type: Object, required: false },
20
+ _stepperTrigger: { type: Object, required: false },
21
+ _stepperSeparator: { type: Object, required: false },
22
+ _stepperTitle: { type: Object, required: false },
23
+ _stepperDescription: { type: Object, required: false },
24
+ _stepperIndicator: { type: Object, required: false },
25
+ _stepperHeader: { type: Object, required: false },
26
+ _stepperWrapper: { type: Object, required: false },
27
+ _stepperContainer: { type: Object, required: false },
28
+ una: { type: Object, required: false },
29
+ defaultValue: { type: Number, required: false },
30
+ orientation: { type: String, required: false, default: "horizontal" },
31
+ dir: { type: String, required: false },
32
+ modelValue: { type: Number, required: false },
33
+ linear: { type: Boolean, required: false },
34
+ asChild: { type: Boolean, required: false },
35
+ as: { type: null, required: false },
36
+ disabled: { type: Boolean, required: false },
37
+ class: { type: null, required: false },
38
+ size: { type: null, required: false }
39
+ });
40
+ const emits = defineEmits(["update:modelValue", "next", "prev"]);
41
+ const modelValue = defineModel({ type: [String, Number] });
42
+ const delegatedProps = reactiveOmit(props, [
43
+ "class",
44
+ "una"
45
+ ]);
46
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
47
+ const stepper = useTemplateRef("stepper");
48
+ const currentStepIndex = computed({
49
+ get() {
50
+ const value = modelValue.value ?? props.defaultValue;
51
+ return (typeof value === "string" ? props.items?.findIndex((item) => item.value === value) : value) ?? 0;
52
+ },
53
+ set(value) {
54
+ modelValue.value = props.items?.[value]?.value ?? value;
55
+ }
56
+ });
57
+ const currentStep = computed(() => props.items?.[currentStepIndex.value]);
58
+ const isEveryItemHasStep = computed(() => props.items?.every((item) => item.step));
59
+ const hasNextStep = computed(() => currentStepIndex.value < props.items.length - 1);
60
+ const hasPrevStep = computed(() => currentStepIndex.value > 0);
61
+ defineExpose({
62
+ goToStep: (step) => {
63
+ currentStepIndex.value = step;
64
+ stepper.value?.goToStep(step);
65
+ },
66
+ nextStep: () => {
67
+ if (!hasNextStep.value)
68
+ return;
69
+ currentStepIndex.value += 1;
70
+ stepper.value?.nextStep();
71
+ emits("next", currentStep.value);
72
+ },
73
+ prevStep: () => {
74
+ if (!hasPrevStep.value)
75
+ return;
76
+ currentStepIndex.value -= 1;
77
+ stepper.value?.prevStep();
78
+ emits("prev", currentStep.value);
79
+ },
80
+ hasNext: () => hasNextStep.value,
81
+ hasPrev: () => hasPrevStep.value
82
+ });
83
+ </script>
84
+
85
+ <template>
86
+ <StepperRoot
87
+ ref="stepper"
88
+ v-slot="slotProps"
89
+ v-bind="forwarded"
90
+ v-model="currentStepIndex"
91
+ :class="cn(
92
+ 'stepper',
93
+ orientation === 'horizontal' && 'stepper-horizontal',
94
+ props.class
95
+ )"
96
+ :una
97
+ >
98
+ <slot v-bind="slotProps">
99
+ <StepperWrapper :una v-bind="props._stepperWrapper" :orientation>
100
+ <slot name="wrapper" :items>
101
+ <StepperItem
102
+ v-for="(item, idx) in items"
103
+ :key="isEveryItemHasStep ? item.step : idx"
104
+ :step="isEveryItemHasStep ? item.step : idx"
105
+ :disabled="item.disabled ?? props.disabled"
106
+ :una
107
+ v-bind="props._stepperItem"
108
+ :orientation
109
+ >
110
+ <slot name="item" :item="item" :step="isEveryItemHasStep ? item.step : idx">
111
+ <StepperContainer :orientation :una v-bind="props._stepperContainer">
112
+ <StepperTrigger v-bind="props._stepperTrigger" :una :stepper="props.stepper" :size="size ?? item.size">
113
+ <slot name="trigger" :item="item">
114
+ <StepperIndicator
115
+ v-slot="{ step }"
116
+ v-bind="props._stepperIndicator"
117
+ :una
118
+ :size="size ?? item.size"
119
+ :stepper="props.stepper"
120
+ >
121
+ <slot name="indicator" :item :step>
122
+ <Icon v-if="item.icon" :name="item.icon" :size="size ?? item.size" />
123
+ <template v-else>
124
+ {{ idx + 1 }}
125
+ </template>
126
+ </slot>
127
+ </StepperIndicator>
128
+ </slot>
129
+ </StepperTrigger>
130
+ <StepperSeparator
131
+ v-if="items && idx < items.length - 1"
132
+ v-bind="props._stepperSeparator"
133
+ :una
134
+ :stepper="props.stepper"
135
+ :orientation
136
+ />
137
+ </StepperContainer>
138
+ <StepperHeader :una v-bind="props._stepperHeader" :orientation>
139
+ <slot name="header" :item="item">
140
+ <StepperTitle v-if="item.title" :una v-bind="props._stepperTitle" :size="size ?? item.size">
141
+ <slot name="title" :item="item">
142
+ {{ item.title }}
143
+ </slot>
144
+ </StepperTitle>
145
+ <StepperDescription v-if="item.description" :una v-bind="props._stepperDescription" :size="size ?? item.size">
146
+ <slot name="description" :item="item">
147
+ {{ item.description }}
148
+ </slot>
149
+ </StepperDescription>
150
+ </slot>
151
+ </StepperHeader>
152
+ </slot>
153
+ </StepperItem>
154
+ </slot>
155
+ </StepperWrapper>
156
+ <slot
157
+ v-if="!!$slots.content || currentStep?.slot"
158
+ :name="currentStep?.slot ?? 'content'"
159
+ :item="currentStep"
160
+ />
161
+ </slot>
162
+ </StepperRoot>
163
+ </template>
@@ -0,0 +1,62 @@
1
+ import type { NStepperItemProps, NStepperProps } from '../../types/index.js';
2
+ declare const _default: <T extends Partial<NStepperItemProps>>(__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<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
5
+ readonly onNext?: ((payload: T) => any) | undefined;
6
+ readonly onPrev?: ((payload: T) => any) | undefined;
7
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onNext" | "onPrev"> & (NStepperProps<T> & {
8
+ modelValue?: string | number;
9
+ }) & Partial<{}>> & import("vue").PublicProps;
10
+ expose(exposed: import("vue").ShallowUnwrapRef<{
11
+ goToStep: (step: number) => void;
12
+ nextStep: () => void;
13
+ prevStep: () => void;
14
+ hasNext: () => boolean;
15
+ hasPrev: () => boolean;
16
+ }>): void;
17
+ attrs: any;
18
+ slots: {
19
+ [x: string]: ((props: {
20
+ item: any;
21
+ }) => any) | undefined;
22
+ } & {
23
+ default?: (props: any) => any;
24
+ } & {
25
+ wrapper?: (props: {
26
+ items: any;
27
+ }) => any;
28
+ } & {
29
+ item?: (props: {
30
+ item: any;
31
+ step: any;
32
+ }) => any;
33
+ } & {
34
+ trigger?: (props: {
35
+ item: any;
36
+ }) => any;
37
+ } & {
38
+ indicator?: (props: {
39
+ item: any;
40
+ step: any;
41
+ }) => any;
42
+ } & {
43
+ header?: (props: {
44
+ item: any;
45
+ }) => any;
46
+ } & {
47
+ title?: (props: {
48
+ item: any;
49
+ }) => any;
50
+ } & {
51
+ description?: (props: {
52
+ item: any;
53
+ }) => any;
54
+ };
55
+ emit: (((evt: "update:modelValue", payload: number | undefined) => void) & ((evt: "next", payload: T) => void) & ((evt: "prev", payload: T) => void)) & ((evt: "update:modelValue", value: string | number | undefined) => void);
56
+ }>) => import("vue").VNode & {
57
+ __ctx?: Awaited<typeof __VLS_setup>;
58
+ };
59
+ export default _default;
60
+ type __VLS_PrettifyLocal<T> = {
61
+ [K in keyof T]: T[K];
62
+ } & {};
@@ -0,0 +1,21 @@
1
+ <script setup>
2
+ import { cn } from "../../utils";
3
+ const props = defineProps({
4
+ una: { type: Object, required: false },
5
+ class: { type: null, required: false },
6
+ orientation: { type: String, required: false, default: "horizontal" }
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ :class="cn(
13
+ 'stepper-container',
14
+ orientation === 'horizontal' && 'stepper-container-horizontal',
15
+ props.class,
16
+ props.una?.stepperContainer
17
+ )"
18
+ >
19
+ <slot />
20
+ </div>
21
+ </template>
@@ -0,0 +1,15 @@
1
+ import type { NStepperContainerProps } from '../../types/index.js';
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<NStepperContainerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NStepperContainerProps> & Readonly<{}>, {
7
+ orientation: "vertical" | "horizontal";
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,28 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { StepperDescription, useForwardProps } from "reka-ui";
4
+ import { cn } from "../../utils";
5
+ const props = defineProps({
6
+ una: { type: Object, required: false },
7
+ asChild: { type: Boolean, required: false },
8
+ as: { type: null, required: false },
9
+ class: { type: null, required: false },
10
+ size: { type: null, required: false }
11
+ });
12
+ const delegatedProps = reactiveOmit(props, "class", "una");
13
+ const forwarded = useForwardProps(delegatedProps);
14
+ </script>
15
+
16
+ <template>
17
+ <StepperDescription
18
+ v-slot="slotProps"
19
+ v-bind="forwarded"
20
+ :class="cn(
21
+ 'stepper-description',
22
+ props.class,
23
+ props.una?.stepperDescription
24
+ )"
25
+ >
26
+ <slot v-bind="slotProps" />
27
+ </StepperDescription>
28
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { NStepperDescriptionProps } from '../../types/index.js';
2
+ declare var __VLS_6: any;
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_6) => any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<NStepperDescriptionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NStepperDescriptionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,21 @@
1
+ <script setup>
2
+ import { cn } from "../../utils";
3
+ const props = defineProps({
4
+ una: { type: Object, required: false },
5
+ class: { type: null, required: false },
6
+ orientation: { type: String, required: false, default: "horizontal" }
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ :class="cn(
13
+ 'stepper-header',
14
+ orientation === 'horizontal' && 'stepper-header-horizontal',
15
+ props.class,
16
+ props.una?.stepperHeader
17
+ )"
18
+ >
19
+ <slot />
20
+ </div>
21
+ </template>
@@ -0,0 +1,15 @@
1
+ import type { NStepperHeaderProps } from '../../types/index.js';
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<NStepperHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NStepperHeaderProps> & Readonly<{}>, {
7
+ orientation: "vertical" | "horizontal";
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,34 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { StepperIndicator, useForwardProps } from "reka-ui";
4
+ import { cn } from "../../utils";
5
+ const props = defineProps({
6
+ una: { type: Object, required: false },
7
+ asChild: { type: Boolean, required: false },
8
+ as: { type: null, required: false },
9
+ stepper: { type: String, required: false, default: "solid-primary" },
10
+ class: { type: null, required: false },
11
+ size: { type: null, required: false }
12
+ });
13
+ const delegatedProps = reactiveOmit(props, [
14
+ "class",
15
+ "una",
16
+ "stepper"
17
+ ]);
18
+ const forwarded = useForwardProps(delegatedProps);
19
+ </script>
20
+
21
+ <template>
22
+ <StepperIndicator
23
+ v-slot="slotProps"
24
+ v-bind="forwarded"
25
+ :class="cn(
26
+ 'stepper-indicator',
27
+ props.class,
28
+ props.una?.stepperIndicator
29
+ )"
30
+ :stepper
31
+ >
32
+ <slot v-bind="slotProps" />
33
+ </StepperIndicator>
34
+ </template>