@una-ui/nuxt 0.65.0 → 0.67.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 (37) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/combobox/Combobox.vue +36 -39
  4. package/dist/runtime/components/combobox/ComboboxInput.vue +1 -1
  5. package/dist/runtime/components/combobox/ComboboxInput.vue.d.ts +24 -2
  6. package/dist/runtime/components/elements/accordion/Accordion.vue +86 -0
  7. package/dist/runtime/components/elements/accordion/Accordion.vue.d.ts +71 -0
  8. package/dist/runtime/components/elements/accordion/AccordionContent.vue +24 -0
  9. package/dist/runtime/components/elements/accordion/AccordionContent.vue.d.ts +13 -0
  10. package/dist/runtime/components/elements/accordion/AccordionHeader.vue +17 -0
  11. package/dist/runtime/components/elements/accordion/AccordionHeader.vue.d.ts +13 -0
  12. package/dist/runtime/components/elements/accordion/AccordionItem.vue +59 -0
  13. package/dist/runtime/components/elements/accordion/AccordionItem.vue.d.ts +27 -0
  14. package/dist/runtime/components/elements/accordion/AccordionTrigger.vue +56 -0
  15. package/dist/runtime/components/elements/accordion/AccordionTrigger.vue.d.ts +16 -0
  16. package/dist/runtime/components/elements/avatar/Avatar.vue.d.ts +1 -1
  17. package/dist/runtime/components/forms/Checkbox.vue +5 -3
  18. package/dist/runtime/components/forms/Checkbox.vue.d.ts +1 -1
  19. package/dist/runtime/components/forms/select/Select.vue +23 -29
  20. package/dist/runtime/components/forms/select/SelectItem.vue +0 -2
  21. package/dist/runtime/components/forms/select/SelectItemIndicator.vue +7 -6
  22. package/dist/runtime/components/forms/select/SelectItemIndicator.vue.d.ts +1 -3
  23. package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue.d.ts +1 -1
  24. package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +1 -1
  25. package/dist/runtime/components/overlays/Toaster.vue +1 -0
  26. package/dist/runtime/components/overlays/toast/ToastProvider.vue +1 -0
  27. package/dist/runtime/components/sidebar/SidebarProvider.vue +7 -2
  28. package/dist/runtime/components/sidebar/SidebarProvider.vue.d.ts +1 -1
  29. package/dist/runtime/components/toggle-group/ToggleGroupItem.vue.d.ts +1 -1
  30. package/dist/runtime/types/accordion.d.ts +36 -91
  31. package/dist/runtime/types/combobox.d.ts +12 -7
  32. package/dist/runtime/types/select.d.ts +6 -7
  33. package/dist/runtime/types/sidebar.d.ts +5 -0
  34. package/dist/runtime/utils/index.d.ts +1 -1
  35. package/package.json +15 -16
  36. package/dist/runtime/components/elements/Accordion.vue +0 -212
  37. package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -28
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "0.65.0",
4
+ "version": "0.67.0",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.0.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -8,7 +8,7 @@ import 'unocss';
8
8
  import 'unocss-preset-animations';
9
9
 
10
10
  const name = "@una-ui/nuxt";
11
- const version = "0.65.0";
11
+ const version = "0.67.0";
12
12
 
13
13
  const module = defineNuxtModule({
14
14
  meta: {
@@ -19,9 +19,10 @@ import ComboboxTrigger from "./ComboboxTrigger.vue";
19
19
  import ComboboxViewport from "./ComboboxViewport.vue";
20
20
  const props = defineProps({
21
21
  modelValue: { type: null, required: false },
22
+ defaultValue: { type: null, required: false },
22
23
  items: { type: Array, required: false },
23
- labelKey: { type: null, required: false },
24
- valueKey: { type: null, required: false },
24
+ labelKey: { type: null, required: false, default: "label" },
25
+ valueKey: { type: null, required: false, default: "value" },
25
26
  groupSeparator: { type: Boolean, required: false },
26
27
  textEmpty: { type: String, required: false, default: "No items found." },
27
28
  label: { type: String, required: false },
@@ -48,7 +49,7 @@ const props = defineProps({
48
49
  openOnFocus: { type: Boolean, required: false },
49
50
  openOnClick: { type: Boolean, required: false },
50
51
  ignoreFilter: { type: Boolean, required: false },
51
- defaultValue: { type: null, required: false },
52
+ resetModelValueOnClear: { type: Boolean, required: false },
52
53
  dir: { type: String, required: false },
53
54
  disabled: { type: Boolean, required: false },
54
55
  highlightOnHover: { type: Boolean, required: false },
@@ -86,8 +87,6 @@ const rootProps = reactiveOmit(props, [
86
87
  "_comboboxCheckbox"
87
88
  ]);
88
89
  const forwarded = useForwardPropsEmits(rootProps, emits);
89
- const labelKey = computed(() => props.labelKey?.toString() ?? "label");
90
- const valueKey = computed(() => props.valueKey?.toString() ?? "value");
91
90
  const hasGroups = computed(() => {
92
91
  return Array.isArray(props.items) && props.items.length > 0 && typeof props.items[0] === "object" && "items" in props.items[0];
93
92
  });
@@ -96,46 +95,44 @@ function getItemProperty(item, key) {
96
95
  return "";
97
96
  return typeof item !== "object" ? item : item[key];
98
97
  }
99
- function findItemByValue(value) {
100
- if (!props.items)
101
- return void 0;
102
- if (hasGroups.value) {
103
- for (const group of props.items) {
104
- const found = group.items?.find((item) => getItemProperty(item, valueKey.value) === value);
105
- if (found)
106
- return found;
107
- }
108
- return void 0;
109
- } else {
110
- return props.items.find((item) => getItemProperty(item, valueKey.value) === value);
111
- }
112
- }
113
98
  function getDisplayValue(val) {
114
- if (!val || Array.isArray(val) && val.length === 0)
99
+ if (val == null || Array.isArray(val) && val.length === 0)
115
100
  return "";
116
- if (props.multiple && Array.isArray(val)) {
101
+ if (Array.isArray(val)) {
117
102
  return val.map((v) => {
118
103
  if (typeof v !== "object" || v === null) {
119
- const item = findItemByValue(v);
120
- return item ? getItemProperty(item, labelKey.value) : v;
104
+ return String(v);
121
105
  }
122
- return getItemProperty(v, labelKey.value) || getItemProperty(v, valueKey.value) || "";
123
- }).filter(Boolean).join(", ");
106
+ return getItemProperty(v, props.labelKey) || getItemProperty(v, props.valueKey) || "";
107
+ }).filter((v) => v !== null && v !== void 0).join(", ");
124
108
  }
125
109
  if (typeof val !== "object" || val === null) {
126
- const item = findItemByValue(val);
127
- return item ? getItemProperty(item, labelKey.value) : String(val || "");
110
+ return String(val);
128
111
  }
129
- return getItemProperty(val, labelKey.value) || getItemProperty(val, valueKey.value) || "";
112
+ return getItemProperty(val, props.labelKey) || getItemProperty(val, props.valueKey) || "";
130
113
  }
131
114
  function isItemSelected(item) {
132
- if (item == null)
115
+ if (item == null || !props.modelValue)
133
116
  return false;
134
- const itemValue = getItemProperty(item, valueKey.value);
135
- if (props.multiple && Array.isArray(props.modelValue)) {
136
- return props.modelValue.includes(itemValue);
117
+ if (typeof item !== "object") {
118
+ if (Array.isArray(props.modelValue)) {
119
+ return props.modelValue.includes(item);
120
+ }
121
+ return props.modelValue === item;
122
+ }
123
+ const itemValue = getItemProperty(item, props.valueKey);
124
+ if (Array.isArray(props.modelValue)) {
125
+ return props.modelValue.some((v) => {
126
+ if (typeof v !== "object" || v === null) {
127
+ return v === itemValue;
128
+ }
129
+ return getItemProperty(v, props.valueKey) === itemValue;
130
+ });
131
+ }
132
+ if (typeof props.modelValue !== "object" || props.modelValue === null) {
133
+ return props.modelValue === itemValue;
137
134
  }
138
- return typeof props.modelValue === "object" && props.modelValue !== null ? getItemProperty(props.modelValue, valueKey.value) === itemValue : props.modelValue === itemValue;
135
+ return getItemProperty(props.modelValue, props.valueKey) === itemValue;
139
136
  }
140
137
  </script>
141
138
 
@@ -252,8 +249,8 @@ function isItemSelected(item) {
252
249
  <slot name="group">
253
250
  <ComboboxItem
254
251
  v-for="item in items"
255
- :key="getItemProperty(item, valueKey)"
256
- :value="props.multiple ? getItemProperty(item, valueKey) : item"
252
+ :key="getItemProperty(item, props.valueKey)"
253
+ :value="item"
257
254
  :size
258
255
  v-bind="props._comboboxItem"
259
256
  :class="cn(
@@ -263,7 +260,7 @@ function isItemSelected(item) {
263
260
  >
264
261
  <slot name="item" :item="item" :selected="isItemSelected(item)">
265
262
  <slot name="label" :item="item">
266
- {{ getItemProperty(item, labelKey) }}
263
+ {{ getItemProperty(item, props.labelKey) }}
267
264
  </slot>
268
265
 
269
266
  <ComboboxItemIndicator
@@ -298,8 +295,8 @@ function isItemSelected(item) {
298
295
  <slot name="group" :group="group">
299
296
  <ComboboxItem
300
297
  v-for="item in group.items"
301
- :key="getItemProperty(item, valueKey)"
302
- :value="props.multiple ? getItemProperty(item, valueKey) : item"
298
+ :key="getItemProperty(item, props.valueKey)"
299
+ :value="item"
303
300
  :size
304
301
  v-bind="{ ...props._comboboxItem, ...group._comboboxItem }"
305
302
  :class="cn(
@@ -309,7 +306,7 @@ function isItemSelected(item) {
309
306
  >
310
307
  <slot name="item" :item="item" :group="group" :selected="isItemSelected(item)">
311
308
  <slot name="label" :item="item">
312
- {{ getItemProperty(item, labelKey) }}
309
+ {{ getItemProperty(item, props.labelKey) }}
313
310
  </slot>
314
311
 
315
312
  <ComboboxItemIndicator
@@ -7,7 +7,7 @@ defineOptions({
7
7
  inheritAttrs: false
8
8
  });
9
9
  const props = defineProps({
10
- displayValue: { type: Function, required: false },
10
+ displayValue: { type: Function, required: false, default: () => "" },
11
11
  modelValue: { type: String, required: false },
12
12
  autoFocus: { type: Boolean, required: false },
13
13
  disabled: { type: Boolean, required: false },
@@ -1,16 +1,38 @@
1
+ import type { NComboboxInputProps } from '../../types/index.js';
1
2
  declare var __VLS_12: any, __VLS_13: any;
2
3
  type __VLS_Slots = {} & {
3
4
  [K in NonNullable<typeof __VLS_12>]?: (props: typeof __VLS_13) => any;
4
5
  };
5
- declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<NComboboxInputProps>, {
7
+ displayValue: () => "";
8
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
9
  "update:modelValue": (args_0: string) => any;
7
- }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
10
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<NComboboxInputProps>, {
11
+ displayValue: () => "";
12
+ }>>> & Readonly<{
8
13
  "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
9
14
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
15
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
11
16
  export default _default;
17
+ type __VLS_WithDefaults<P, D> = {
18
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
19
+ default: D[K];
20
+ }> : P[K];
21
+ };
22
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
23
+ type __VLS_TypePropsToOption<T> = {
24
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
25
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
26
+ } : {
27
+ type: import('vue').PropType<T[K]>;
28
+ required: true;
29
+ };
30
+ };
12
31
  type __VLS_WithSlots<T, S> = T & {
13
32
  new (): {
14
33
  $slots: S;
15
34
  };
16
35
  };
36
+ type __VLS_PrettifyLocal<T> = {
37
+ [K in keyof T]: T[K];
38
+ } & {};
@@ -0,0 +1,86 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { defu } from "defu";
4
+ import { AccordionRoot, useForwardPropsEmits } from "reka-ui";
5
+ import { computed } from "vue";
6
+ import { cn } from "../../../utils";
7
+ import NAccordionItem from "./AccordionItem.vue";
8
+ const props = defineProps({
9
+ accordion: { type: String, required: false, default: "divider border" },
10
+ items: { type: Array, required: false },
11
+ una: { type: Object, required: false },
12
+ _accordionItem: { type: Object, required: false },
13
+ _accordionHeader: { type: Object, required: false },
14
+ _accordionTrigger: { type: Object, required: false },
15
+ _accordionContent: { type: Object, required: false },
16
+ collapsible: { type: Boolean, required: false, default: true },
17
+ disabled: { type: Boolean, required: false },
18
+ dir: { type: String, required: false },
19
+ orientation: { type: String, required: false },
20
+ unmountOnHide: { type: Boolean, required: false },
21
+ asChild: { type: Boolean, required: false },
22
+ as: { type: null, required: false },
23
+ type: { type: String, required: false, default: "single" },
24
+ modelValue: { type: null, required: false },
25
+ defaultValue: { type: null, required: false }
26
+ });
27
+ const emits = defineEmits(["update:modelValue"]);
28
+ const rootProps = useForwardPropsEmits(reactiveOmit(props, ["una", "items", "_accordionTrigger", "_accordionContent", "_accordionHeader", "_accordionItem"]), emits);
29
+ const items = computed(() => {
30
+ if (import.meta.dev) {
31
+ const reservedValues = ["header", "trigger", "content", "item", "default"];
32
+ for (const item of props.items ?? []) {
33
+ if (reservedValues.includes(item.value)) {
34
+ console.warn(`[AccordionItem]: The value '${item.value}' is reserved and may cause unexpected behavior. Please choose a different value.`);
35
+ }
36
+ }
37
+ }
38
+ return props.items;
39
+ });
40
+ </script>
41
+
42
+ <template>
43
+ <AccordionRoot
44
+ v-slot="{ modelValue }"
45
+ v-bind="rootProps"
46
+ :class="cn(
47
+ una?.accordion
48
+ )"
49
+ >
50
+ <slot :model-value>
51
+ <NAccordionItem
52
+ v-for="(item, index) in items"
53
+ :key="item.value"
54
+ v-bind="defu(item, _accordionItem)"
55
+ :_accordion-trigger="defu(item._accordionTrigger, _accordionTrigger)"
56
+ :_accordion-content="defu(item._accordionContent, _accordionContent)"
57
+ :_accordion-header="defu(item._accordionHeader, _accordionHeader)"
58
+ :una="defu(item.una, una)"
59
+ >
60
+ <template #default="{ open }">
61
+ <slot :name="`${item.value}-item`" :open :item :index>
62
+ <slot name="item" :open :item :index />
63
+ </slot>
64
+ </template>
65
+
66
+ <template #header="{ open }">
67
+ <slot :name="`${item.value}-header`" :open :item :index>
68
+ <slot name="header" :open :item :index />
69
+ </slot>
70
+ </template>
71
+
72
+ <template #trigger="{ open }">
73
+ <slot :name="`${item.value}-trigger`" :open :item :index>
74
+ <slot name="trigger" :open :item :index />
75
+ </slot>
76
+ </template>
77
+
78
+ <template #content="{ open }">
79
+ <slot :name="`${item.value}-content`" :open :item :index>
80
+ <slot name="content" :open :item :index />
81
+ </slot>
82
+ </template>
83
+ </NAccordionItem>
84
+ </slot>
85
+ </AccordionRoot>
86
+ </template>
@@ -0,0 +1,71 @@
1
+ import type { NAccordionProps } from '../../../types/index.js';
2
+ declare var __VLS_6: {
3
+ modelValue: any;
4
+ }, __VLS_12: any, __VLS_13: {
5
+ open: any;
6
+ item: any;
7
+ index: any;
8
+ }, __VLS_15: {
9
+ open: any;
10
+ item: any;
11
+ index: any;
12
+ }, __VLS_18: any, __VLS_19: {
13
+ open: any;
14
+ item: any;
15
+ index: any;
16
+ }, __VLS_21: {
17
+ open: any;
18
+ item: any;
19
+ index: any;
20
+ }, __VLS_24: any, __VLS_25: {
21
+ open: any;
22
+ item: any;
23
+ index: any;
24
+ }, __VLS_27: {
25
+ open: any;
26
+ item: any;
27
+ index: any;
28
+ }, __VLS_30: any, __VLS_31: {
29
+ open: any;
30
+ item: any;
31
+ index: any;
32
+ }, __VLS_33: {
33
+ open: any;
34
+ item: any;
35
+ index: any;
36
+ };
37
+ type __VLS_Slots = {} & {
38
+ [K in NonNullable<typeof __VLS_12>]?: (props: typeof __VLS_13) => any;
39
+ } & {
40
+ [K in NonNullable<typeof __VLS_18>]?: (props: typeof __VLS_19) => any;
41
+ } & {
42
+ [K in NonNullable<typeof __VLS_24>]?: (props: typeof __VLS_25) => any;
43
+ } & {
44
+ [K in NonNullable<typeof __VLS_30>]?: (props: typeof __VLS_31) => any;
45
+ } & {
46
+ default?: (props: typeof __VLS_6) => any;
47
+ } & {
48
+ item?: (props: typeof __VLS_15) => any;
49
+ } & {
50
+ header?: (props: typeof __VLS_21) => any;
51
+ } & {
52
+ trigger?: (props: typeof __VLS_27) => any;
53
+ } & {
54
+ content?: (props: typeof __VLS_33) => any;
55
+ };
56
+ declare const __VLS_component: import("vue").DefineComponent<NAccordionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
+ "update:modelValue": (value: string | string[] | undefined) => any;
58
+ }, string, import("vue").PublicProps, Readonly<NAccordionProps> & Readonly<{
59
+ "onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
60
+ }>, {
61
+ type: "multiple" | "single";
62
+ accordion: string;
63
+ collapsible: boolean;
64
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
65
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
66
+ export default _default;
67
+ type __VLS_WithSlots<T, S> = T & {
68
+ new (): {
69
+ $slots: S;
70
+ };
71
+ };
@@ -0,0 +1,24 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { AccordionContent, useForwardProps } from "reka-ui";
4
+ import { cn } from "../../../utils";
5
+ const props = defineProps({
6
+ una: { type: Object, required: false },
7
+ forceMount: { type: Boolean, required: false },
8
+ asChild: { type: Boolean, required: false },
9
+ as: { type: null, required: false }
10
+ });
11
+ const forwardProps = useForwardProps(reactiveOmit(props, ["una"]));
12
+ </script>
13
+
14
+ <template>
15
+ <AccordionContent v-bind="forwardProps" :class="cn('accordion-content group/accordion-content', una?.accordionContent)">
16
+ <div :class="cn('accordion-panel', una?.accordionPanel)">
17
+ <slot />
18
+ </div>
19
+ </AccordionContent>
20
+ </template>
21
+
22
+ <style scoped>
23
+ .accordion-content[data-state=open]{animation:accordionIn .3s cubic-bezier(.86,0,.07,1)}.accordion-content[data-state=closed]{animation:accordionOut .3s cubic-bezier(.86,0,.07,1)}@keyframes accordionIn{0%{height:0}to{height:var(--reka-accordion-content-height)}}@keyframes accordionOut{0%{height:var(--reka-accordion-content-height)}to{height:0}}
24
+ </style>
@@ -0,0 +1,13 @@
1
+ import type { NAccordionContentProps } from '../../../types/accordion.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<NAccordionContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionContentProps> & 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,17 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { AccordionHeader, 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
+ });
10
+ const forwardProps = useForwardProps(reactiveOmit(props, ["una"]));
11
+ </script>
12
+
13
+ <template>
14
+ <AccordionHeader v-bind="forwardProps" :class="cn('accordion-header', una?.accordionHeader)">
15
+ <slot />
16
+ </AccordionHeader>
17
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { NAccordionHeaderProps } from '../../../types/accordion.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<NAccordionHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionHeaderProps> & 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,59 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { AccordionItem, Primitive, useForwardProps } from "reka-ui";
4
+ import { cn } from "../../../utils";
5
+ import NAccordionContent from "./AccordionContent.vue";
6
+ import NAccordionHeader from "./AccordionHeader.vue";
7
+ import NAccordionTrigger from "./AccordionTrigger.vue";
8
+ const props = defineProps({
9
+ label: { type: String, required: false },
10
+ content: { type: String, required: false },
11
+ una: { type: Object, required: false },
12
+ _accordionHeader: { type: Object, required: false },
13
+ _accordionTrigger: { type: Object, required: false },
14
+ _accordionContent: { type: Object, required: false },
15
+ disabled: { type: Boolean, required: false },
16
+ value: { type: String, required: true },
17
+ unmountOnHide: { type: Boolean, required: false },
18
+ asChild: { type: Boolean, required: false },
19
+ as: { type: null, required: false }
20
+ });
21
+ const forwardProps = useForwardProps(reactiveOmit(props, ["una", "label", "content", "_accordionContent", "_accordionHeader", "_accordionTrigger"]));
22
+ </script>
23
+
24
+ <template>
25
+ <AccordionItem
26
+ v-slot="{ open }"
27
+ v-bind="forwardProps"
28
+ :class="cn('accordion-item', una?.accordionItem)"
29
+ >
30
+ <slot :open>
31
+ <NAccordionHeader :una v-bind="_accordionHeader">
32
+ <Primitive
33
+ as-child
34
+ :label
35
+ v-bind="_accordionTrigger"
36
+ :una="{
37
+ btnLeading: cn('accordion-leading', una?.accordionLeading),
38
+ btnTrailing: cn(
39
+ 'accordion-trailing',
40
+ una?.accordionTrailing,
41
+ open ? una?.accordionTrailingOpen : una?.accordionTrailingClose
42
+ )
43
+ }"
44
+ >
45
+ <slot name="header" :open>
46
+ <NAccordionTrigger>
47
+ <slot name="trigger" :open />
48
+ </NAccordionTrigger>
49
+ </slot>
50
+ </Primitive>
51
+ </NAccordionHeader>
52
+ <NAccordionContent :una v-bind="_accordionContent">
53
+ <slot name="content" :open>
54
+ {{ content }}
55
+ </slot>
56
+ </NAccordionContent>
57
+ </slot>
58
+ </AccordionItem>
59
+ </template>
@@ -0,0 +1,27 @@
1
+ import type { NAccordionItemProps } from '../../../types/accordion.js';
2
+ declare var __VLS_6: {
3
+ open: any;
4
+ }, __VLS_15: {
5
+ open: any;
6
+ }, __VLS_20: {
7
+ open: any;
8
+ }, __VLS_25: {
9
+ open: any;
10
+ };
11
+ type __VLS_Slots = {} & {
12
+ default?: (props: typeof __VLS_6) => any;
13
+ } & {
14
+ header?: (props: typeof __VLS_15) => any;
15
+ } & {
16
+ trigger?: (props: typeof __VLS_20) => any;
17
+ } & {
18
+ content?: (props: typeof __VLS_25) => any;
19
+ };
20
+ declare const __VLS_component: import("vue").DefineComponent<NAccordionItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,56 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { AccordionTrigger, 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
+ type: { type: String, required: false },
10
+ loadingPlacement: { type: String, required: false },
11
+ icon: { type: Boolean, required: false },
12
+ disabled: { type: Boolean, required: false },
13
+ reverse: { type: Boolean, required: false },
14
+ loading: { type: Boolean, required: false },
15
+ block: { type: Boolean, required: false },
16
+ to: { type: null, required: false },
17
+ label: { type: String, required: false },
18
+ btn: { type: String, required: false, default: "~ text" },
19
+ leading: { type: String, required: false },
20
+ trailing: { type: String, required: false, default: "accordion-trailing-icon" },
21
+ size: { type: String, required: false },
22
+ square: { type: null, required: false },
23
+ rounded: { type: null, required: false },
24
+ class: { type: null, required: false },
25
+ breadcrumbActive: { type: String, required: false },
26
+ breadcrumbInactive: { type: String, required: false },
27
+ paginationSelected: { type: String, required: false },
28
+ paginationUnselected: { type: String, required: false },
29
+ dropdownMenu: { type: String, required: false },
30
+ toggleOn: { type: String, required: false },
31
+ toggleOff: { type: String, required: false },
32
+ tabsActive: { type: String, required: false },
33
+ tabsInactive: { type: String, required: false },
34
+ navigationMenu: { type: String, required: false },
35
+ navigationMenuLink: { type: String, required: false },
36
+ ariaLabel: { type: String, required: false }
37
+ });
38
+ const forwardProps = useForwardProps(reactiveOmit(props, ["una"]));
39
+ </script>
40
+
41
+ <template>
42
+ <AccordionTrigger
43
+ class="group/accordion-trigger accordion-trigger"
44
+ v-bind="forwardProps"
45
+ as-child
46
+ :una="{
47
+ ...una,
48
+ btn: cn('accordion-trigger-padding', una?.btn),
49
+ btnLabel: cn('accordion-trigger-label', una?.btnLabel)
50
+ }"
51
+ >
52
+ <slot>
53
+ <NButton />
54
+ </slot>
55
+ </AccordionTrigger>
56
+ </template>
@@ -0,0 +1,16 @@
1
+ import type { NAccordionTriggerProps } from '../../../types/accordion.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<NAccordionTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionTriggerProps> & Readonly<{}>, {
7
+ btn: string;
8
+ trailing: string;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -7,9 +7,9 @@ type __VLS_Slots = {} & {
7
7
  };
8
8
  declare const __VLS_component: import("vue").DefineComponent<NAvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAvatarProps> & Readonly<{}>, {
9
9
  size: import("vue").HTMLAttributes["class"];
10
+ as: import("reka-ui").AsTag | import("vue").Component;
10
11
  square: import("vue").HTMLAttributes["class"];
11
12
  rounded: import("vue").HTMLAttributes["class"];
12
- as: import("reka-ui").AsTag | import("vue").Component;
13
13
  avatar: import("vue").HTMLAttributes["class"];
14
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
15
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -52,7 +52,7 @@ const id = computed(() => props.id ?? randomId("checkbox"));
52
52
  <CheckboxRoot
53
53
  v-bind="{ ...forwarded, ...$attrs }"
54
54
  :id="id"
55
- v-slot="{ ...slotProps }"
55
+ v-slot="slotProps"
56
56
  :class="
57
57
  cn(
58
58
  'peer checkbox',
@@ -68,9 +68,11 @@ const id = computed(() => props.id ?? randomId("checkbox"));
68
68
  :class="cn('checkbox-indicator', una?.checkboxIndicator)"
69
69
  v-bind="props._checkboxIndicator"
70
70
  >
71
- <slot name="icon">
71
+ <slot
72
+ name="icon" v-bind="slotProps"
73
+ >
72
74
  <Icon
73
- :name="slotProps.modelValue === 'indeterminate' ? props.una?.checkboxIndeterminateIcon ?? 'checkbox-indeterminate-icon' : slotProps.modelValue ? props.una?.checkboxCheckedIcon ?? 'checkbox-checked-icon' : props.una?.checkboxUncheckedIcon ?? 'checkbox-unchecked-icon'"
75
+ :name="slotProps.state === 'indeterminate' ? props.una?.checkboxIndeterminateIcon ?? 'checkbox-indeterminate-icon' : slotProps.state ? props.una?.checkboxCheckedIcon ?? 'checkbox-checked-icon' : props.una?.checkboxUncheckedIcon ?? 'checkbox-unchecked-icon'"
74
76
  :class="cn('checkbox-icon-base', una?.checkboxIconBase)"
75
77
  />
76
78
  </slot>
@@ -1,5 +1,5 @@
1
1
  import type { NCheckboxProps } from '../../types/index.js';
2
- declare var __VLS_9: {}, __VLS_17: {};
2
+ declare var __VLS_9: any, __VLS_17: {};
3
3
  type __VLS_Slots = {} & {
4
4
  icon?: (props: typeof __VLS_9) => any;
5
5
  } & {