@una-ui/nuxt 1.0.0-alpha.6 → 1.0.0-alpha.7

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "1.0.0-alpha.6",
4
+ "version": "1.0.0-alpha.7",
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 = "1.0.0-alpha.6";
11
+ const version = "1.0.0-alpha.7";
12
12
 
13
13
  const module = defineNuxtModule({
14
14
  meta: {
@@ -25,6 +25,7 @@ const props = defineProps({
25
25
  groupSeparator: { type: Boolean, required: false },
26
26
  textEmpty: { type: String, required: false, default: "No items found." },
27
27
  label: { type: String, required: false },
28
+ multiple: { type: null, required: false },
28
29
  _comboboxAnchor: { type: Object, required: false },
29
30
  _comboboxEmpty: { type: Object, required: false },
30
31
  _comboboxGroup: { type: Object, required: false },
@@ -46,7 +47,6 @@ const props = defineProps({
46
47
  resetSearchTermOnSelect: { type: Boolean, required: false },
47
48
  ignoreFilter: { type: Boolean, required: false },
48
49
  defaultValue: { type: null, required: false },
49
- multiple: { type: Boolean, required: false },
50
50
  dir: { type: String, required: false },
51
51
  disabled: { type: Boolean, required: false },
52
52
  highlightOnHover: { type: Boolean, required: false },
@@ -139,7 +139,6 @@ function isItemSelected(item) {
139
139
 
140
140
  <template>
141
141
  <ComboboxRoot
142
- v-slot="{ modelValue, open }"
143
142
  data-slot="combobox"
144
143
  :class="cn(
145
144
  'combobox',
@@ -1,6 +1,6 @@
1
1
  import type { AcceptableValue } from 'reka-ui';
2
2
  import type { ExtractItemType, NComboboxGroupProps, NComboboxProps } from '../../types/index.js';
3
- declare const _default: <T extends AcceptableValue>(__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
+ declare const _default: <T extends AcceptableValue, M extends boolean = false>(__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<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
5
  readonly "onUpdate:modelValue"?: ((value: ExtractItemType<T>) => any) | undefined;
6
6
  readonly onHighlight?: ((payload: {
@@ -8,7 +8,7 @@ declare const _default: <T extends AcceptableValue>(__VLS_props: NonNullable<Awa
8
8
  value: ExtractItemType<T>;
9
9
  } | undefined) => any) | undefined;
10
10
  readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
11
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onHighlight" | "onUpdate:open"> & NComboboxProps<T> & Partial<{}>> & import("vue").PublicProps;
11
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onHighlight" | "onUpdate:open"> & NComboboxProps<T, M> & Partial<{}>> & import("vue").PublicProps;
12
12
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
13
13
  attrs: any;
14
14
  slots: {
@@ -19,20 +19,20 @@ declare const _default: <T extends AcceptableValue>(__VLS_props: NonNullable<Awa
19
19
  'trigger-wrapper'?: (props: {}) => any;
20
20
  } & {
21
21
  trigger?: (props: {
22
- modelValue: any;
23
- open: any;
22
+ modelValue: (M extends true ? ExtractItemType<T>[] : ExtractItemType<T>) | null | undefined;
23
+ open: boolean | undefined;
24
24
  }) => any;
25
25
  } & {
26
26
  'input-wrapper'?: (props: {
27
- modelValue: any;
28
- open: any;
27
+ modelValue: (M extends true ? ExtractItemType<T>[] : ExtractItemType<T>) | null | undefined;
28
+ open: boolean | undefined;
29
29
  }) => any;
30
30
  } & {
31
31
  list?: (props: {}) => any;
32
32
  } & {
33
33
  'input-wrapper'?: (props: {
34
- modelValue: any;
35
- open: any;
34
+ modelValue: (M extends true ? ExtractItemType<T>[] : ExtractItemType<T>) | null | undefined;
35
+ open: boolean | undefined;
36
36
  }) => any;
37
37
  } & {
38
38
  header?: (props: {}) => any;
@@ -8,6 +8,7 @@ import { RadioGroupRoot, useForwardPropsEmits } from "reka-ui";
8
8
  import { cn } from "../../../utils";
9
9
  import RadioGroupItem from "./RadioGroupItem.vue";
10
10
  const props = defineProps({
11
+ modelValue: { type: null, required: true },
11
12
  items: { type: Array, required: false },
12
13
  labelKey: { type: null, required: false },
13
14
  valueKey: { type: null, required: false },
@@ -20,7 +21,6 @@ const props = defineProps({
20
21
  square: { type: null, required: false, default: "1em" },
21
22
  rounded: { type: null, required: false },
22
23
  icon: { type: null, required: false },
23
- modelValue: { type: null, required: false },
24
24
  defaultValue: { type: null, required: false },
25
25
  disabled: { type: Boolean, required: false },
26
26
  orientation: { type: String, required: false },
@@ -71,7 +71,6 @@ function getItemDescription(item) {
71
71
 
72
72
  <template>
73
73
  <RadioGroupRoot
74
- v-slot="{ modelValue }"
75
74
  :class="cn(
76
75
  'radio-group',
77
76
  orientation === 'horizontal' ? 'radio-group-orientation-horizontal' : 'radio-group-orientation-vertical',
@@ -1,22 +1,22 @@
1
1
  import type { AcceptableValue } from 'reka-ui';
2
2
  import type { NRadioGroupItemProps, NRadioGroupProps } from '../../../types/index.js';
3
- declare const _default: <T extends AcceptableValue>(__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
+ declare const _default: <T extends AcceptableValue, Item extends T | NRadioGroupItemProps<T>>(__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<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
5
  readonly "onUpdate:modelValue"?: ((payload: string) => any) | undefined;
6
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & NRadioGroupProps<T> & Partial<{}>> & import("vue").PublicProps;
6
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & NRadioGroupProps<T, Item> & Partial<{}>> & import("vue").PublicProps;
7
7
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
8
8
  attrs: any;
9
9
  slots: {
10
10
  default?: (props: {
11
- modelValue: any;
11
+ modelValue: T;
12
12
  }) => any;
13
13
  } & {
14
14
  label?: (props: {
15
- item: NRadioGroupItemProps | T;
15
+ item: Item;
16
16
  }) => any;
17
17
  } & {
18
18
  description?: (props: {
19
- item: NRadioGroupItemProps | T;
19
+ item: Item;
20
20
  }) => any;
21
21
  };
22
22
  emit: (evt: "update:modelValue", payload: string) => void;
@@ -12,6 +12,7 @@ defineOptions({
12
12
  inheritAttrs: false
13
13
  });
14
14
  const props = defineProps({
15
+ value: { type: null, required: true },
15
16
  label: { type: String, required: false },
16
17
  radioGroup: { type: null, required: false, default: "primary" },
17
18
  description: { type: String, required: false },
@@ -22,7 +23,6 @@ const props = defineProps({
22
23
  rounded: { type: null, required: false },
23
24
  icon: { type: null, required: false, default: "radio-group-indicator-icon" },
24
25
  id: { type: String, required: false },
25
- value: { type: null, required: false },
26
26
  disabled: { type: Boolean, required: false },
27
27
  asChild: { type: Boolean, required: false },
28
28
  as: { type: null, required: false },
@@ -1,4 +1,5 @@
1
1
  import type { NRadioGroupItemProps } from '../../../types/index.js';
2
+ type __VLS_Props = NRadioGroupItemProps;
2
3
  declare var __VLS_9: {}, __VLS_17: {}, __VLS_19: {};
3
4
  type __VLS_Slots = {} & {
4
5
  icon?: (props: typeof __VLS_9) => any;
@@ -7,7 +8,7 @@ type __VLS_Slots = {} & {
7
8
  } & {
8
9
  description?: (props: typeof __VLS_19) => any;
9
10
  };
10
- declare const __VLS_component: import("vue").DefineComponent<NRadioGroupItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NRadioGroupItemProps> & Readonly<{}>, {
11
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
12
  icon: import("vue").HTMLAttributes["class"];
12
13
  size: import("vue").HTMLAttributes["class"];
13
14
  square: import("vue").HTMLAttributes["class"];
@@ -49,7 +49,6 @@ const props = defineProps({
49
49
  id: { type: String, required: false }
50
50
  });
51
51
  const emits = defineEmits(["update:modelValue", "update:open"]);
52
- defineSlots();
53
52
  const hasGroups = computed(() => {
54
53
  return Array.isArray(props.items) && props.items.length > 0 && typeof props.items[0] === "object" && "items" in props.items[0];
55
54
  });
@@ -88,15 +87,14 @@ function isItemSelected(item, modelValue) {
88
87
 
89
88
  <template>
90
89
  <SelectRoot
91
- v-slot="{ modelValue, open }"
92
90
  :class="cn(
93
91
  props.una?.select,
94
92
  props.class
95
93
  )"
96
94
  v-bind="forwarded"
97
95
  >
98
- <slot :model-value="modelValue" :open>
99
- <slot name="trigger-wrapper" :model-value="modelValue" :open>
96
+ <slot :model-value :open>
97
+ <slot name="trigger-wrapper" :model-value :open>
100
98
  <SelectTrigger
101
99
  :id
102
100
  :size
@@ -105,7 +103,7 @@ function isItemSelected(item, modelValue) {
105
103
  v-bind="props._selectTrigger"
106
104
  :una
107
105
  >
108
- <slot name="trigger" :model-value="modelValue" :open="open">
106
+ <slot name="trigger" :model-value :open="open">
109
107
  <SelectValue
110
108
  :placeholder="props.placeholder"
111
109
  v-bind="props._selectValue"
@@ -113,7 +111,7 @@ function isItemSelected(item, modelValue) {
113
111
  :data-status="status"
114
112
  :una
115
113
  >
116
- <slot name="value" :model-value="modelValue" :open>
114
+ <slot name="value" :model-value :open>
117
115
  {{ formatSelectedValue(modelValue) || props.placeholder }}
118
116
  </slot>
119
117
  </SelectValue>
@@ -1,5 +1,5 @@
1
1
  import type { AcceptableValue } from 'reka-ui';
2
- import type { NSelectProps, NSelectSlots, SelectGroup as SelectGroupType } from '../../../types/index.js';
2
+ import type { NSelectProps, SelectGroup as SelectGroupType } from '../../../types/index.js';
3
3
  declare const _default: <T extends AcceptableValue, I extends Array<T | SelectGroupType<T>>, M extends boolean = false>(__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<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
5
  readonly "onUpdate:modelValue"?: ((value: T) => any) | undefined;
@@ -7,7 +7,59 @@ declare const _default: <T extends AcceptableValue, I extends Array<T | SelectGr
7
7
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:open"> & NSelectProps<T, I, M> & Partial<{}>> & import("vue").PublicProps;
8
8
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
9
9
  attrs: any;
10
- slots: NSelectSlots<T, I, M>;
10
+ slots: {
11
+ default?: (props: {
12
+ modelValue: (M extends true ? T[] : T) | undefined;
13
+ open: boolean | undefined;
14
+ }) => any;
15
+ } & {
16
+ 'trigger-wrapper'?: (props: {
17
+ modelValue: (M extends true ? T[] : T) | undefined;
18
+ open: boolean | undefined;
19
+ }) => any;
20
+ } & {
21
+ trigger?: (props: {
22
+ modelValue: (M extends true ? T[] : T) | undefined;
23
+ open: boolean | undefined;
24
+ }) => any;
25
+ } & {
26
+ value?: (props: {
27
+ modelValue: (M extends true ? T[] : T) | undefined;
28
+ open: boolean | undefined;
29
+ }) => any;
30
+ } & {
31
+ content?: (props: {
32
+ items: I;
33
+ }) => any;
34
+ } & {
35
+ label?: (props: {
36
+ label: string;
37
+ }) => any;
38
+ } & {
39
+ item?: (props: {
40
+ item: I extends number ? number : I extends string ? string : I extends any[] ? I[number] : I extends Iterable<infer T1> ? T1 : any;
41
+ }) => any;
42
+ } & {
43
+ indicator?: (props: {
44
+ item: I extends number ? number : I extends string ? string : I extends any[] ? I[number] : I extends Iterable<infer T1> ? T1 : any;
45
+ }) => any;
46
+ } & {
47
+ group?: (props: {
48
+ items: SelectGroupType<T>;
49
+ }) => any;
50
+ } & {
51
+ label?: (props: {
52
+ label: string;
53
+ }) => any;
54
+ } & {
55
+ item?: (props: {
56
+ item: T;
57
+ }) => any;
58
+ } & {
59
+ indicator?: (props: {
60
+ item: T;
61
+ }) => any;
62
+ };
11
63
  emit: ((evt: "update:modelValue", value: T) => void) & ((evt: "update:open", value: boolean) => void);
12
64
  }>) => import("vue").VNode & {
13
65
  __ctx?: Awaited<typeof __VLS_setup>;
@@ -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
  */
@@ -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
  */
@@ -22,7 +22,6 @@ export interface SelectGroup<T extends AcceptableValue> {
22
22
  _selectLabel?: Partial<NSelectLabelProps>;
23
23
  _selectItem?: Partial<NSelectItemProps>;
24
24
  }
25
- type SelectModelType<T extends AcceptableValue, M extends boolean> = true extends M ? T[] : T;
26
25
  export interface NSelectProps<T extends AcceptableValue, Items extends Array<T | SelectGroup<T>>, M extends boolean = false> extends SelectExtensions<T> {
27
26
  /**
28
27
  * The items to display in the select.
@@ -46,8 +45,8 @@ export interface NSelectProps<T extends AcceptableValue, Items extends Array<T |
46
45
  * @default false
47
46
  */
48
47
  groupSeparator?: boolean;
49
- defaultValue?: SelectModelType<T, M>;
50
- modelValue?: SelectModelType<T, M>;
48
+ defaultValue?: M extends true ? T[] : T;
49
+ modelValue?: M extends true ? T[] : T;
51
50
  multiple?: M;
52
51
  /**
53
52
  * Sub-component configurations
@@ -64,33 +63,6 @@ export interface NSelectProps<T extends AcceptableValue, Items extends Array<T |
64
63
  _selectLabel?: Partial<NSelectLabelProps>;
65
64
  una?: NSelectUnaProps;
66
65
  }
67
- interface SelectModelSlotProps<T extends AcceptableValue, M extends boolean> {
68
- modelValue: SelectModelType<T, M> | null | undefined;
69
- open: boolean;
70
- }
71
- interface SelectContentSlotProps<T extends AcceptableValue, I extends Array<T | SelectGroup<T>>> {
72
- items: I;
73
- }
74
- interface SelectLabelSlotProps {
75
- label: string | undefined;
76
- }
77
- interface SelectItemSlotProps<T extends AcceptableValue, I extends Array<T | SelectGroup<T>>> {
78
- item: I[number];
79
- }
80
- interface SelectGroupSlotProps<T extends AcceptableValue> {
81
- items: SelectGroup<T>;
82
- }
83
- export interface NSelectSlots<T extends AcceptableValue, I extends Array<T | SelectGroup<T>>, M extends boolean = false> {
84
- 'default': (props: SelectModelSlotProps<T, M>) => any;
85
- 'trigger-wrapper': (props: SelectModelSlotProps<T, M>) => any;
86
- 'trigger': (props: SelectModelSlotProps<T, M>) => any;
87
- 'value': (props: SelectModelSlotProps<T, M>) => any;
88
- 'content': (props: SelectContentSlotProps<T, I>) => any;
89
- 'label': (props: SelectLabelSlotProps) => any;
90
- 'item': (props: SelectItemSlotProps<T, I>) => any;
91
- 'indicator': (props: SelectItemSlotProps<T, I>) => any;
92
- 'group': (props: SelectGroupSlotProps<T>) => any;
93
- }
94
66
  export interface NSelectTriggerProps extends TriggerExtensions {
95
67
  /**
96
68
  * The unique id of the select trigger to be used for the form field.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "1.0.0-alpha.6",
4
+ "version": "1.0.0-alpha.7",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -58,8 +58,8 @@
58
58
  "unocss": "^66.2.0",
59
59
  "unocss-preset-animations": "^1.2.1",
60
60
  "vaul-vue": "^0.4.1",
61
- "@una-ui/extractor-vue-script": "^1.0.0-alpha.6",
62
- "@una-ui/preset": "^1.0.0-alpha.6"
61
+ "@una-ui/preset": "^1.0.0-alpha.7",
62
+ "@una-ui/extractor-vue-script": "^1.0.0-alpha.7"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@iconify-json/lucide": "^1.2.57",