@una-ui/nuxt 0.7.0-beta.1 → 0.8.0-beta.1

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 (33) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +10 -2
  3. package/dist/runtime/components/elements/Button.vue +7 -4
  4. package/dist/runtime/components/forms/Slider.vue +0 -1
  5. package/dist/runtime/components/forms/select/Select.vue +152 -0
  6. package/dist/runtime/components/forms/select/SelectContent.vue +64 -0
  7. package/dist/runtime/components/forms/select/SelectGroup.vue +20 -0
  8. package/dist/runtime/components/forms/select/SelectItem.vue +57 -0
  9. package/dist/runtime/components/forms/select/SelectItemIndicator.vue +31 -0
  10. package/dist/runtime/components/forms/select/SelectItemText.vue +12 -0
  11. package/dist/runtime/components/forms/select/SelectLabel.vue +13 -0
  12. package/dist/runtime/components/forms/select/SelectRoot.vue +24 -0
  13. package/dist/runtime/components/forms/select/SelectScrollDownButton.vue +27 -0
  14. package/dist/runtime/components/forms/select/SelectScrollUpButton.vue +27 -0
  15. package/dist/runtime/components/forms/select/SelectSeparator.vue +18 -0
  16. package/dist/runtime/components/forms/select/SelectTrigger.vue +82 -0
  17. package/dist/runtime/components/forms/select/SelectValue.vue +15 -0
  18. package/dist/runtime/types/button.d.ts +15 -1
  19. package/dist/runtime/types/icon.d.ts +2 -1
  20. package/dist/runtime/types/index.d.ts +1 -0
  21. package/dist/runtime/types/index.js +1 -0
  22. package/dist/runtime/types/select.d.ts +150 -0
  23. package/dist/runtime/types/select.js +0 -0
  24. package/dist/runtime/types/skeleton.d.ts +5 -5
  25. package/dist/runtime/utils/index.d.ts +10 -0
  26. package/dist/runtime/utils/index.js +7 -0
  27. package/dist/una.config.mjs +2 -0
  28. package/package.json +4 -3
  29. package/playground/.nuxt/components.d.ts +1244 -0
  30. package/playground/.nuxt/imports.d.ts +1 -1
  31. package/playground/.nuxt/nuxt.d.ts +1 -1
  32. package/playground/.nuxt/types/imports.d.ts +3 -3
  33. package/playground/.nuxt/types/plugins.d.ts +2 -2
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from 'vue';
1
2
  export interface NIconProps {
2
3
  /**
3
4
  * Icon name
@@ -5,5 +6,5 @@ export interface NIconProps {
5
6
  * @example
6
7
  * 'i-heroicons-chevron-up'
7
8
  */
8
- name: string;
9
+ name: HTMLAttributes['class'];
9
10
  }
@@ -18,6 +18,7 @@ export * from './checkbox.js';
18
18
  export * from './slider.js';
19
19
  export * from './progress.js';
20
20
  export * from './skeleton.js';
21
+ export * from './select.js';
21
22
  export interface Colors {
22
23
  [key: string]: string;
23
24
  }
@@ -18,3 +18,4 @@ export * from "./checkbox.js";
18
18
  export * from "./slider.js";
19
19
  export * from "./progress.js";
20
20
  export * from "./skeleton.js";
21
+ export * from "./select.js";
@@ -0,0 +1,150 @@
1
+ import type { SelectContentProps, SelectGroupProps, SelectItemIndicatorProps, SelectItemProps, SelectItemTextProps, SelectLabelProps, SelectRootProps, SelectScrollDownButtonProps, SelectScrollUpButtonProps, SelectSeparatorProps, SelectTriggerProps, SelectValueProps } from 'radix-vue';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { NButtonProps } from './button.js';
4
+ interface BaseExtensions {
5
+ class?: HTMLAttributes['class'];
6
+ size?: HTMLAttributes['class'];
7
+ }
8
+ type RootExtensions = Omit<SelectRootProps, 'modelValue'> & BaseExtensions;
9
+ type TriggerExtensions = SelectTriggerProps & Omit<NButtonProps, 'una'> & BaseExtensions;
10
+ type ValueExtensions = SelectValueProps & BaseExtensions;
11
+ type ScrollDownButtonExtensions = SelectScrollDownButtonProps & BaseExtensions;
12
+ type ScrollUpButtonExtensions = SelectScrollUpButtonProps & BaseExtensions;
13
+ type ContentExtensions = SelectContentProps & BaseExtensions;
14
+ type ItemExtensions = Omit<SelectItemProps, 'value'> & BaseExtensions;
15
+ type ItemTextExtensions = SelectItemTextProps & BaseExtensions;
16
+ type GroupExtensions = SelectGroupProps & BaseExtensions;
17
+ type LabelExtensions = SelectLabelProps & BaseExtensions;
18
+ type SeparatorExtensions = SelectSeparatorProps & BaseExtensions;
19
+ type SelectExtensions = NSelectRootProps & BaseExtensions & Pick<NSelectItemProps, 'selectItem'> & Pick<NSelectTriggerProps, 'status'>;
20
+ export interface NSelectProps extends SelectExtensions {
21
+ /**
22
+ * The unique id of the select.
23
+ */
24
+ id?: string;
25
+ /**
26
+ * The value of the select.
27
+ */
28
+ modelValue: any;
29
+ /**
30
+ * Enable multiple group items.
31
+ *
32
+ * @default false
33
+ */
34
+ multipleGroup?: boolean;
35
+ /**
36
+ * The attribute name to use to display in the select items.
37
+ *
38
+ */
39
+ itemAttribute?: string | number;
40
+ /**
41
+ * The attribute name to use to display in the selected value.
42
+ */
43
+ valueAttribute?: string | number;
44
+ /**
45
+ * The placeholder to display when no value is selected.
46
+ */
47
+ placeholder?: string;
48
+ /**
49
+ * The label to display above the select items.
50
+ */
51
+ label?: string;
52
+ /**
53
+ * The items to display in the select.
54
+ *
55
+ * @default []
56
+ */
57
+ items: any[];
58
+ _selectScrollUpButton?: Partial<NSelectScrollUpButtonProps>;
59
+ _selectItemText?: Partial<NSelectItemTextProps>;
60
+ _selectScrollDownButton?: Partial<NSelectScrollDownButtonProps>;
61
+ _selectGroup?: Partial<NSelectGroupProps>;
62
+ _selectContent?: Partial<NSelectContentProps>;
63
+ _selectValue?: Partial<NSelectValueProps>;
64
+ _selectTrigger?: Partial<NSelectTriggerProps>;
65
+ _selectItem?: Partial<NSelectItemProps>;
66
+ _selectLabel?: Partial<NSelectLabelProps>;
67
+ }
68
+ export interface NSelectRootProps extends RootExtensions {
69
+ una?: {
70
+ selectRoot?: HTMLAttributes['class'];
71
+ };
72
+ }
73
+ export interface NSelectTriggerProps extends TriggerExtensions {
74
+ status?: 'info' | 'success' | 'warning' | 'error';
75
+ una?: {
76
+ selectTrigger?: HTMLAttributes['class'];
77
+ selectTriggerTrailing?: HTMLAttributes['class'];
78
+ selectTriggerTrailingIcon?: HTMLAttributes['class'];
79
+ selectTriggerLeading?: HTMLAttributes['class'];
80
+ selectTriggerInfoIcon?: HTMLAttributes['class'];
81
+ selectTriggerSuccessIcon?: HTMLAttributes['class'];
82
+ selectTriggerWarningIcon?: HTMLAttributes['class'];
83
+ selectTriggerErrorIcon?: HTMLAttributes['class'];
84
+ } & NButtonProps['una'];
85
+ }
86
+ export interface NSelectValueProps extends ValueExtensions {
87
+ una?: {
88
+ selectValue?: HTMLAttributes['class'];
89
+ };
90
+ }
91
+ export interface NSelectScrollDownButtonProps extends ScrollDownButtonExtensions {
92
+ una?: {
93
+ selectScrollDownButton?: HTMLAttributes['class'];
94
+ selectScrollDownButtonIcon?: HTMLAttributes['class'];
95
+ };
96
+ }
97
+ export interface NSelectScrollUpButtonProps extends ScrollUpButtonExtensions {
98
+ una?: {
99
+ selectScrollUpButton?: HTMLAttributes['class'];
100
+ selectScrollUpButtonIcon?: HTMLAttributes['class'];
101
+ };
102
+ }
103
+ export interface NSelectContentProps extends ContentExtensions {
104
+ _selectScrollDownButton?: NSelectScrollDownButtonProps;
105
+ _selectScrollUpButton?: NSelectScrollUpButtonProps;
106
+ _selectSeparator?: NSelectSeparator;
107
+ una?: {
108
+ selectContent?: HTMLAttributes['class'];
109
+ };
110
+ }
111
+ export interface NSelectItemIndicatorProps extends SelectItemIndicatorProps {
112
+ icon?: HTMLAttributes['class'];
113
+ class?: HTMLAttributes['class'];
114
+ una?: {
115
+ selectItemIndicator?: HTMLAttributes['class'];
116
+ selectItemIndicatorIcon?: HTMLAttributes;
117
+ };
118
+ }
119
+ export interface NSelectItemProps extends ItemExtensions {
120
+ value: any;
121
+ selectItem?: HTMLAttributes['class'];
122
+ isSelected?: boolean;
123
+ _selectItemText?: NSelectItemTextProps;
124
+ _selectItemIndicator?: NSelectItemIndicatorProps;
125
+ una?: {
126
+ selectItem?: HTMLAttributes['class'];
127
+ selectItemIndicatorWrapper?: HTMLAttributes['class'];
128
+ };
129
+ }
130
+ export interface NSelectItemTextProps extends ItemTextExtensions {
131
+ una?: {
132
+ selectItemText?: HTMLAttributes['class'];
133
+ };
134
+ }
135
+ export interface NSelectGroupProps extends GroupExtensions {
136
+ una?: {
137
+ selectGroup?: HTMLAttributes['class'];
138
+ };
139
+ }
140
+ export interface NSelectLabelProps extends LabelExtensions {
141
+ una?: {
142
+ selectLabel?: HTMLAttributes['class'];
143
+ };
144
+ }
145
+ export interface NSelectSeparator extends SeparatorExtensions {
146
+ una?: {
147
+ selectSeparator?: HTMLAttributes['class'];
148
+ };
149
+ }
150
+ export {};
File without changes
@@ -4,16 +4,16 @@ interface Extensions {
4
4
  }
5
5
  export interface NSkeletonProps extends Extensions {
6
6
  /**
7
- * Allows you to add `UnaUI` slider preset properties,
7
+ * Allows you to add `UnaUI` skeleton preset properties,
8
8
  * Think of it as a shortcut for adding options or variants to the preset if available.
9
9
  *
10
- * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/slider.ts
10
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/skeleton.ts
11
11
  * @example
12
- * slider="green""
12
+ * skeleton="green""
13
13
  */
14
14
  skeleton?: string;
15
15
  /**
16
- * Allows you to change the size of the slider.
16
+ * Allows you to change the size of the skeleton.
17
17
  *
18
18
  * @default base|md
19
19
  *
@@ -24,7 +24,7 @@ export interface NSkeletonProps extends Extensions {
24
24
  /**
25
25
  * `UnaUI` preset configuration
26
26
  *
27
- * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/slider.ts
27
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/skeleton.ts
28
28
  */
29
29
  una?: {
30
30
  skeleton?: HTMLAttributes['class'];
@@ -18,3 +18,13 @@ export declare function pickProps<T extends Record<string, any>>(obj: T, propsTo
18
18
  * @returns first non-undefined value
19
19
  */
20
20
  export declare function getPriority<T>(...args: (T | undefined)[]): T | undefined;
21
+ /**
22
+ * Check if all objects are equal
23
+ * @param objects - objects to compare
24
+ * @returns true if all objects are equal
25
+ * @example
26
+ * ```ts
27
+ * const equal = isEqualObject({ a: 1 }, { a: 1 }, { a: 1 })
28
+ * ```
29
+ */
30
+ export declare function isEqualObject(...objects: Record<string, any>[]): boolean;
@@ -35,3 +35,10 @@ export function getPriority(...args) {
35
35
  }
36
36
  return void 0;
37
37
  }
38
+ export function isEqualObject(...objects) {
39
+ return objects.every((obj, i) => {
40
+ if (i === 0)
41
+ return true;
42
+ return JSON.stringify(obj) === JSON.stringify(objects[i - 1]);
43
+ });
44
+ }
@@ -1,4 +1,5 @@
1
1
  import { presetUno, presetAttributify, presetIcons, transformerDirectives, transformerVariantGroup } from 'unocss';
2
+ import { presetAnimations } from 'unocss-preset-animations';
2
3
  import presetUna from '@una-ui/preset';
3
4
  import prefixes from '@una-ui/preset/prefixes';
4
5
  import extratorUna from '@una-ui/extractor-vue-script';
@@ -18,6 +19,7 @@ function extendUnocssOptions(user = {}) {
18
19
  }
19
20
  }),
20
21
  presetUna(),
22
+ presetAnimations(),
21
23
  ...user.presets || []
22
24
  ],
23
25
  extractors: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.7.0-beta.1",
4
+ "version": "0.8.0-beta.1",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -47,8 +47,9 @@
47
47
  "tailwind-merge": "^2.4.0",
48
48
  "typescript": "^5.5.3",
49
49
  "unocss": "^0.61.5",
50
- "@una-ui/preset": "^0.7.0-beta.1",
51
- "@una-ui/extractor-vue-script": "^0.7.0-beta.1"
50
+ "unocss-preset-animations": "^1.1.0",
51
+ "@una-ui/extractor-vue-script": "^0.8.0-beta.1",
52
+ "@una-ui/preset": "^0.8.0-beta.1"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@nuxt/module-builder": "^0.8.1",