@nuxt/ui 2.12.3 → 2.14.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.
- package/README.md +8 -8
- package/dist/module.d.mts +170 -40
- package/dist/module.d.ts +170 -40
- package/dist/module.json +2 -2
- package/dist/module.mjs +136 -146
- package/dist/runtime/components/data/Table.vue +16 -4
- package/dist/runtime/components/data/Table.vue.d.ts +21 -3
- package/dist/runtime/components/elements/Accordion.vue +11 -2
- package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Alert.vue +2 -2
- package/dist/runtime/components/elements/Alert.vue.d.ts +4 -3
- package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Badge.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Button.vue.d.ts +63 -37
- package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Carousel.vue +156 -0
- package/dist/runtime/components/elements/Carousel.vue.d.ts +104 -0
- package/dist/runtime/components/elements/Chip.vue.d.ts +5 -5
- package/dist/runtime/components/elements/Dropdown.vue +5 -3
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Link.vue +3 -3
- package/dist/runtime/components/elements/Link.vue.d.ts +62 -36
- package/dist/runtime/components/elements/Meter.vue +4 -0
- package/dist/runtime/components/elements/Meter.vue.d.ts +4 -4
- package/dist/runtime/components/elements/MeterGroup.d.ts +4 -4
- package/dist/runtime/components/elements/Progress.vue +4 -1
- package/dist/runtime/components/elements/Progress.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Checkbox.vue +1 -6
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +6 -15
- package/dist/runtime/components/forms/Form.vue +13 -6
- package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +20 -17
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Input.vue +1 -0
- package/dist/runtime/components/forms/Input.vue.d.ts +6 -6
- package/dist/runtime/components/forms/InputMenu.vue +12 -1
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +16 -7
- package/dist/runtime/components/forms/Radio.vue +5 -11
- package/dist/runtime/components/forms/Radio.vue.d.ts +6 -6
- package/dist/runtime/components/forms/RadioGroup.vue +1 -0
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +4 -4
- package/dist/runtime/components/forms/Range.vue.d.ts +4 -4
- package/dist/runtime/components/forms/Select.vue +5 -1
- package/dist/runtime/components/forms/Select.vue.d.ts +6 -6
- package/dist/runtime/components/forms/SelectMenu.vue +5 -2
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +7 -7
- package/dist/runtime/components/forms/Textarea.vue +5 -1
- package/dist/runtime/components/forms/Textarea.vue.d.ts +15 -6
- package/dist/runtime/components/forms/Toggle.vue +4 -2
- package/dist/runtime/components/forms/Toggle.vue.d.ts +6 -6
- package/dist/runtime/components/layout/Card.vue +1 -1
- package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Divider.vue +8 -1
- package/dist/runtime/components/layout/Divider.vue.d.ts +15 -4
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPalette.vue +3 -1
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +2 -2
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +3 -1
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/HorizontalNavigation.vue +102 -0
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +44 -0
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +3 -3
- package/dist/runtime/components/navigation/Tabs.vue +8 -8
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -1
- package/dist/runtime/components/navigation/VerticalNavigation.vue +12 -3
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
- package/dist/runtime/components/overlays/Modal.vue +9 -3
- package/dist/runtime/components/overlays/Modal.vue.d.ts +6 -5
- package/dist/runtime/components/overlays/Modals.client.vue +12 -0
- package/dist/runtime/components/overlays/Notification.vue +2 -2
- package/dist/runtime/components/overlays/Notification.vue.d.ts +4 -3
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Popover.vue +5 -3
- package/dist/runtime/components/overlays/Popover.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Slideover.vue +9 -3
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +6 -5
- package/dist/runtime/components/overlays/Tooltip.vue +2 -2
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +6 -6
- package/dist/runtime/composables/useCarouselScroll.d.ts +2 -0
- package/dist/runtime/composables/useCarouselScroll.mjs +35 -0
- package/dist/runtime/composables/useFormGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormGroup.mjs +9 -12
- package/dist/runtime/composables/useModal.d.ts +12 -0
- package/dist/runtime/composables/useModal.mjs +37 -0
- package/dist/runtime/composables/usePopper.d.ts +3 -3
- package/dist/runtime/plugins/modals.d.ts +2 -0
- package/dist/runtime/plugins/modals.mjs +10 -0
- package/dist/runtime/types/component.d.ts +14 -0
- package/dist/runtime/types/divider.d.ts +3 -0
- package/dist/runtime/types/form.d.ts +2 -1
- package/dist/runtime/types/horizontal-navigation.d.ts +13 -0
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/modal.d.ts +18 -0
- package/dist/runtime/types/progress.d.ts +2 -0
- package/dist/runtime/types/range.d.ts +2 -0
- package/dist/runtime/types/toggle.d.ts +2 -0
- package/dist/runtime/types/vertical-navigation.d.ts +2 -1
- package/dist/runtime/ui.config/data/table.d.ts +7 -0
- package/dist/runtime/ui.config/data/table.mjs +10 -3
- package/dist/runtime/ui.config/elements/accordion.d.ts +1 -0
- package/dist/runtime/ui.config/elements/accordion.mjs +1 -0
- package/dist/runtime/ui.config/elements/carousel.d.ts +27 -0
- package/dist/runtime/ui.config/elements/carousel.mjs +26 -0
- package/dist/runtime/ui.config/elements/dropdown.d.ts +5 -1
- package/dist/runtime/ui.config/elements/dropdown.mjs +8 -4
- package/dist/runtime/ui.config/forms/formGroup.d.ts +1 -0
- package/dist/runtime/ui.config/forms/formGroup.mjs +1 -0
- package/dist/runtime/ui.config/forms/input.d.ts +11 -0
- package/dist/runtime/ui.config/forms/input.mjs +11 -0
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +1 -1
- package/dist/runtime/ui.config/forms/inputMenu.mjs +5 -5
- package/dist/runtime/ui.config/forms/select.d.ts +11 -0
- package/dist/runtime/ui.config/forms/select.mjs +1 -1
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +1 -1
- package/dist/runtime/ui.config/forms/textarea.d.ts +11 -0
- package/dist/runtime/ui.config/index.d.ts +2 -0
- package/dist/runtime/ui.config/index.mjs +2 -0
- package/dist/runtime/ui.config/layout/divider.d.ts +19 -2
- package/dist/runtime/ui.config/layout/divider.mjs +20 -3
- package/dist/runtime/ui.config/navigation/breadcrumb.mjs +4 -4
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +1 -1
- package/dist/runtime/ui.config/navigation/commandPalette.mjs +8 -8
- package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +27 -0
- package/dist/runtime/ui.config/navigation/horizontalNavigation.mjs +26 -0
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +4 -3
- package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +8 -7
- package/dist/runtime/ui.config/overlays/popover.d.ts +4 -0
- package/dist/runtime/ui.config/overlays/popover.mjs +4 -0
- package/dist/runtime/ui.config/overlays/slideover.mjs +2 -2
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +4 -0
- package/dist/runtime/ui.config/overlays/tooltip.mjs +4 -0
- package/dist/runtime/ui.css +1 -1
- package/dist/runtime/utils/colors.d.ts +3 -0
- package/dist/runtime/utils/colors.mjs +261 -0
- package/dist/runtime/utils/index.mjs +9 -0
- package/dist/runtime/utils/link.d.ts +24 -11
- package/dist/runtime/utils/link.mjs +26 -13
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +24 -22
- package/dist/runtime/utils/uid.d.ts +0 -1
- package/dist/runtime/utils/uid.mjs +0 -5
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { omit } from "./lodash.mjs";
|
|
2
|
+
import { kebabCase, camelCase, upperFirst } from "scule";
|
|
3
|
+
const colorsToExclude = [
|
|
4
|
+
"inherit",
|
|
5
|
+
"transparent",
|
|
6
|
+
"current",
|
|
7
|
+
"white",
|
|
8
|
+
"black",
|
|
9
|
+
"slate",
|
|
10
|
+
"gray",
|
|
11
|
+
"zinc",
|
|
12
|
+
"neutral",
|
|
13
|
+
"stone",
|
|
14
|
+
"cool"
|
|
15
|
+
];
|
|
16
|
+
const safelistByComponent = {
|
|
17
|
+
alert: (colorsAsRegex2) => [{
|
|
18
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-50`)
|
|
19
|
+
}, {
|
|
20
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
21
|
+
variants: ["dark"]
|
|
22
|
+
}, {
|
|
23
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
24
|
+
}, {
|
|
25
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
26
|
+
variants: ["dark"]
|
|
27
|
+
}, {
|
|
28
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
29
|
+
}, {
|
|
30
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
31
|
+
variants: ["dark"]
|
|
32
|
+
}, {
|
|
33
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`)
|
|
34
|
+
}],
|
|
35
|
+
avatar: (colorsAsRegex2) => [{
|
|
36
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
37
|
+
variants: ["dark"]
|
|
38
|
+
}, {
|
|
39
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
40
|
+
}],
|
|
41
|
+
badge: (colorsAsRegex2) => [{
|
|
42
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-50`)
|
|
43
|
+
}, {
|
|
44
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
45
|
+
variants: ["dark"]
|
|
46
|
+
}, {
|
|
47
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
48
|
+
}, {
|
|
49
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
50
|
+
variants: ["dark"]
|
|
51
|
+
}, {
|
|
52
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
53
|
+
}, {
|
|
54
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
55
|
+
variants: ["dark"]
|
|
56
|
+
}, {
|
|
57
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`)
|
|
58
|
+
}],
|
|
59
|
+
button: (colorsAsRegex2) => [{
|
|
60
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-50`),
|
|
61
|
+
variants: ["hover", "disabled"]
|
|
62
|
+
}, {
|
|
63
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-100`),
|
|
64
|
+
variants: ["hover"]
|
|
65
|
+
}, {
|
|
66
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
67
|
+
variants: ["dark", "dark:disabled"]
|
|
68
|
+
}, {
|
|
69
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`),
|
|
70
|
+
variants: ["disabled", "dark:hover"]
|
|
71
|
+
}, {
|
|
72
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-600`),
|
|
73
|
+
variants: ["hover"]
|
|
74
|
+
}, {
|
|
75
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-900`),
|
|
76
|
+
variants: ["dark:hover"]
|
|
77
|
+
}, {
|
|
78
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-950`),
|
|
79
|
+
variants: ["dark", "dark:hover", "dark:disabled"]
|
|
80
|
+
}, {
|
|
81
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
82
|
+
variants: ["dark", "dark:disabled"]
|
|
83
|
+
}, {
|
|
84
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`),
|
|
85
|
+
variants: ["dark:hover", "disabled"]
|
|
86
|
+
}, {
|
|
87
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-600`),
|
|
88
|
+
variants: ["hover"]
|
|
89
|
+
}, {
|
|
90
|
+
pattern: new RegExp(`outline-(${colorsAsRegex2})-400`),
|
|
91
|
+
variants: ["dark:focus-visible"]
|
|
92
|
+
}, {
|
|
93
|
+
pattern: new RegExp(`outline-(${colorsAsRegex2})-500`),
|
|
94
|
+
variants: ["focus-visible"]
|
|
95
|
+
}, {
|
|
96
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
97
|
+
variants: ["dark:focus-visible"]
|
|
98
|
+
}, {
|
|
99
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
|
|
100
|
+
variants: ["focus-visible"]
|
|
101
|
+
}],
|
|
102
|
+
input: (colorsAsRegex2) => [{
|
|
103
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
104
|
+
variants: ["dark"]
|
|
105
|
+
}, {
|
|
106
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
107
|
+
}, {
|
|
108
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
109
|
+
variants: ["dark", "dark:focus"]
|
|
110
|
+
}, {
|
|
111
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
|
|
112
|
+
variants: ["focus"]
|
|
113
|
+
}],
|
|
114
|
+
radio: (colorsAsRegex2) => [{
|
|
115
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
116
|
+
variants: ["dark"]
|
|
117
|
+
}, {
|
|
118
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
119
|
+
}, {
|
|
120
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
121
|
+
variants: ["dark:focus-visible"]
|
|
122
|
+
}, {
|
|
123
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
|
|
124
|
+
variants: ["focus-visible"]
|
|
125
|
+
}],
|
|
126
|
+
checkbox: (colorsAsRegex2) => [{
|
|
127
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
128
|
+
variants: ["dark"]
|
|
129
|
+
}, {
|
|
130
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
131
|
+
}, {
|
|
132
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
133
|
+
variants: ["dark:focus-visible"]
|
|
134
|
+
}, {
|
|
135
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
|
|
136
|
+
variants: ["focus-visible"]
|
|
137
|
+
}],
|
|
138
|
+
toggle: (colorsAsRegex2) => [{
|
|
139
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
140
|
+
variants: ["dark"]
|
|
141
|
+
}, {
|
|
142
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
143
|
+
}, {
|
|
144
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
145
|
+
variants: ["dark"]
|
|
146
|
+
}, {
|
|
147
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
148
|
+
}, {
|
|
149
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
150
|
+
variants: ["dark:focus-visible"]
|
|
151
|
+
}, {
|
|
152
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
|
|
153
|
+
variants: ["focus-visible"]
|
|
154
|
+
}],
|
|
155
|
+
range: (colorsAsRegex2) => [{
|
|
156
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
157
|
+
variants: ["dark"]
|
|
158
|
+
}, {
|
|
159
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
160
|
+
}, {
|
|
161
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
162
|
+
variants: ["dark"]
|
|
163
|
+
}, {
|
|
164
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
165
|
+
}, {
|
|
166
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
|
|
167
|
+
variants: ["dark:focus-visible"]
|
|
168
|
+
}, {
|
|
169
|
+
pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
|
|
170
|
+
variants: ["focus-visible"]
|
|
171
|
+
}],
|
|
172
|
+
progress: (colorsAsRegex2) => [{
|
|
173
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
174
|
+
variants: ["dark"]
|
|
175
|
+
}, {
|
|
176
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
177
|
+
}],
|
|
178
|
+
meter: (colorsAsRegex2) => [{
|
|
179
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
180
|
+
variants: ["dark"]
|
|
181
|
+
}, {
|
|
182
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
183
|
+
}, {
|
|
184
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
185
|
+
variants: ["dark"]
|
|
186
|
+
}, {
|
|
187
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
188
|
+
}],
|
|
189
|
+
notification: (colorsAsRegex2) => [{
|
|
190
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
191
|
+
variants: ["dark"]
|
|
192
|
+
}, {
|
|
193
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
194
|
+
}, {
|
|
195
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
|
|
196
|
+
variants: ["dark"]
|
|
197
|
+
}, {
|
|
198
|
+
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
199
|
+
}],
|
|
200
|
+
chip: (colorsAsRegex2) => [{
|
|
201
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
202
|
+
variants: ["dark"]
|
|
203
|
+
}, {
|
|
204
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
205
|
+
}]
|
|
206
|
+
};
|
|
207
|
+
const safelistComponentAliasesMap = {
|
|
208
|
+
"USelect": "UInput",
|
|
209
|
+
"USelectMenu": "UInput",
|
|
210
|
+
"UTextarea": "UInput",
|
|
211
|
+
"URadioGroup": "URadio",
|
|
212
|
+
"UMeterGroup": "UMeter"
|
|
213
|
+
};
|
|
214
|
+
const colorsAsRegex = (colors) => colors.join("|");
|
|
215
|
+
export const excludeColors = (colors) => {
|
|
216
|
+
return Object.entries(omit(colors, colorsToExclude)).filter(([, value]) => typeof value === "object").map(([key]) => kebabCase(key));
|
|
217
|
+
};
|
|
218
|
+
export const generateSafelist = (colors, globalColors) => {
|
|
219
|
+
const baseSafelist = Object.keys(safelistByComponent).flatMap((component) => safelistByComponent[component](colorsAsRegex(colors)));
|
|
220
|
+
const formsSafelist = ["input", "radio", "checkbox", "toggle", "range"].flatMap((component) => safelistByComponent[component](colorsAsRegex(["red"])));
|
|
221
|
+
return [
|
|
222
|
+
...baseSafelist,
|
|
223
|
+
...formsSafelist,
|
|
224
|
+
// Ensure all global colors are safelisted for the Notification (toast.add)
|
|
225
|
+
...safelistByComponent["notification"](colorsAsRegex(globalColors)),
|
|
226
|
+
// Gray safelist for Avatar & Notification
|
|
227
|
+
"bg-gray-500",
|
|
228
|
+
"dark:bg-gray-400",
|
|
229
|
+
"text-gray-500",
|
|
230
|
+
"dark:text-gray-400"
|
|
231
|
+
];
|
|
232
|
+
};
|
|
233
|
+
export const customSafelistExtractor = (prefix, content, colors, safelistColors) => {
|
|
234
|
+
const classes = [];
|
|
235
|
+
const regex = /<([A-Za-z][A-Za-z0-9]*(?:-[A-Za-z][A-Za-z0-9]*)*)\s+(?![^>]*:color\b)[^>]*\bcolor=["']([^"']+)["'][^>]*>/gs;
|
|
236
|
+
const matches = content.matchAll(regex);
|
|
237
|
+
const components = Object.keys(safelistByComponent).map((component) => `${prefix}${component.charAt(0).toUpperCase() + component.slice(1)}`);
|
|
238
|
+
for (const match of matches) {
|
|
239
|
+
const [, component, color] = match;
|
|
240
|
+
const camelComponent = upperFirst(camelCase(component));
|
|
241
|
+
if (!colors.includes(color) || safelistColors.includes(color)) {
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
let name = safelistComponentAliasesMap[camelComponent] ? safelistComponentAliasesMap[camelComponent] : camelComponent;
|
|
245
|
+
if (!components.includes(name)) {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
name = name.replace(prefix, "").toLowerCase();
|
|
249
|
+
const matchClasses = safelistByComponent[name](color).flatMap((group) => {
|
|
250
|
+
return ["", ...group.variants || []].flatMap((variant) => {
|
|
251
|
+
const matches2 = group.pattern.source.match(/\(([^)]+)\)/g);
|
|
252
|
+
return matches2.map((match2) => {
|
|
253
|
+
const colorOptions = match2.substring(1, match2.length - 1).split("|");
|
|
254
|
+
return colorOptions.map((color2) => `${variant ? variant + ":" : ""}` + group.pattern.source.replace(match2, color2));
|
|
255
|
+
}).flat();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
classes.push(...matchClasses);
|
|
259
|
+
}
|
|
260
|
+
return classes;
|
|
261
|
+
};
|
|
@@ -11,9 +11,18 @@ const defuTwMerge = createDefu((obj, key, value, namespace) => {
|
|
|
11
11
|
if (namespace === "default" || namespace.startsWith("default.")) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
+
if (namespace === "popper" || namespace.startsWith("popper.")) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
14
17
|
if (namespace.endsWith("avatar") && key === "size") {
|
|
15
18
|
return false;
|
|
16
19
|
}
|
|
20
|
+
if (namespace.endsWith("chip") && key === "size") {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (namespace.endsWith("badge") && key === "size" || key === "color" || key === "variant") {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
17
26
|
if (typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
|
|
18
27
|
obj[key] = customTwMerge(obj[key], value);
|
|
19
28
|
return true;
|
|
@@ -3,54 +3,67 @@ export declare const nuxtLinkProps: {
|
|
|
3
3
|
readonly to: {
|
|
4
4
|
readonly type: PropType<RouteLocationRaw>;
|
|
5
5
|
readonly default: undefined;
|
|
6
|
+
readonly required: false;
|
|
6
7
|
};
|
|
7
8
|
readonly href: {
|
|
8
9
|
readonly type: PropType<RouteLocationRaw>;
|
|
9
10
|
readonly default: undefined;
|
|
11
|
+
readonly required: false;
|
|
10
12
|
};
|
|
11
13
|
readonly target: {
|
|
12
|
-
readonly type: PropType<
|
|
14
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
13
15
|
readonly default: undefined;
|
|
16
|
+
readonly required: false;
|
|
14
17
|
};
|
|
15
18
|
readonly rel: {
|
|
16
|
-
readonly type: PropType<
|
|
19
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
17
20
|
readonly default: undefined;
|
|
21
|
+
readonly required: false;
|
|
18
22
|
};
|
|
19
23
|
readonly noRel: {
|
|
20
|
-
readonly type:
|
|
24
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
21
25
|
readonly default: undefined;
|
|
26
|
+
readonly required: false;
|
|
22
27
|
};
|
|
23
28
|
readonly prefetch: {
|
|
24
|
-
readonly type:
|
|
29
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
25
30
|
readonly default: undefined;
|
|
31
|
+
readonly required: false;
|
|
26
32
|
};
|
|
27
33
|
readonly noPrefetch: {
|
|
28
|
-
readonly type:
|
|
34
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
29
35
|
readonly default: undefined;
|
|
36
|
+
readonly required: false;
|
|
30
37
|
};
|
|
31
38
|
readonly activeClass: {
|
|
32
|
-
readonly type:
|
|
39
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
33
40
|
readonly default: undefined;
|
|
41
|
+
readonly required: false;
|
|
34
42
|
};
|
|
35
43
|
readonly exactActiveClass: {
|
|
36
|
-
readonly type:
|
|
44
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
37
45
|
readonly default: undefined;
|
|
46
|
+
readonly required: false;
|
|
38
47
|
};
|
|
39
48
|
readonly prefetchedClass: {
|
|
40
|
-
readonly type:
|
|
49
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
41
50
|
readonly default: undefined;
|
|
51
|
+
readonly required: false;
|
|
42
52
|
};
|
|
43
53
|
readonly replace: {
|
|
44
|
-
readonly type:
|
|
54
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
45
55
|
readonly default: undefined;
|
|
56
|
+
readonly required: false;
|
|
46
57
|
};
|
|
47
58
|
readonly ariaCurrentValue: {
|
|
48
|
-
readonly type:
|
|
59
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
49
60
|
readonly default: undefined;
|
|
61
|
+
readonly required: false;
|
|
50
62
|
};
|
|
51
63
|
readonly external: {
|
|
52
|
-
readonly type:
|
|
64
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
53
65
|
readonly default: undefined;
|
|
66
|
+
readonly required: false;
|
|
54
67
|
};
|
|
55
68
|
};
|
|
56
69
|
export declare const getNuxtLinkProps: (props: any) => {};
|
|
@@ -1,60 +1,73 @@
|
|
|
1
1
|
export const nuxtLinkProps = {
|
|
2
2
|
to: {
|
|
3
3
|
type: [String, Object],
|
|
4
|
-
default: void 0
|
|
4
|
+
default: void 0,
|
|
5
|
+
required: false
|
|
5
6
|
},
|
|
6
7
|
href: {
|
|
7
8
|
type: [String, Object],
|
|
8
|
-
default: void 0
|
|
9
|
+
default: void 0,
|
|
10
|
+
required: false
|
|
9
11
|
},
|
|
10
12
|
// Attributes
|
|
11
13
|
target: {
|
|
12
14
|
type: String,
|
|
13
|
-
default: void 0
|
|
15
|
+
default: void 0,
|
|
16
|
+
required: false
|
|
14
17
|
},
|
|
15
18
|
rel: {
|
|
16
19
|
type: String,
|
|
17
|
-
default: void 0
|
|
20
|
+
default: void 0,
|
|
21
|
+
required: false
|
|
18
22
|
},
|
|
19
23
|
noRel: {
|
|
20
24
|
type: Boolean,
|
|
21
|
-
default: void 0
|
|
25
|
+
default: void 0,
|
|
26
|
+
required: false
|
|
22
27
|
},
|
|
23
28
|
// Prefetching
|
|
24
29
|
prefetch: {
|
|
25
30
|
type: Boolean,
|
|
26
|
-
default: void 0
|
|
31
|
+
default: void 0,
|
|
32
|
+
required: false
|
|
27
33
|
},
|
|
28
34
|
noPrefetch: {
|
|
29
35
|
type: Boolean,
|
|
30
|
-
default: void 0
|
|
36
|
+
default: void 0,
|
|
37
|
+
required: false
|
|
31
38
|
},
|
|
32
39
|
// Styling
|
|
33
40
|
activeClass: {
|
|
34
41
|
type: String,
|
|
35
|
-
default: void 0
|
|
42
|
+
default: void 0,
|
|
43
|
+
required: false
|
|
36
44
|
},
|
|
37
45
|
exactActiveClass: {
|
|
38
46
|
type: String,
|
|
39
|
-
default: void 0
|
|
47
|
+
default: void 0,
|
|
48
|
+
required: false
|
|
40
49
|
},
|
|
41
50
|
prefetchedClass: {
|
|
42
51
|
type: String,
|
|
43
|
-
default: void 0
|
|
52
|
+
default: void 0,
|
|
53
|
+
required: false
|
|
44
54
|
},
|
|
45
55
|
// Vue Router's `<RouterLink>` additional props
|
|
46
56
|
replace: {
|
|
47
57
|
type: Boolean,
|
|
48
|
-
default: void 0
|
|
58
|
+
default: void 0,
|
|
59
|
+
required: false
|
|
49
60
|
},
|
|
50
61
|
ariaCurrentValue: {
|
|
51
62
|
type: String,
|
|
52
|
-
default: void 0
|
|
63
|
+
default: void 0,
|
|
64
|
+
required: false
|
|
53
65
|
},
|
|
54
66
|
// Edge cases handling
|
|
55
67
|
external: {
|
|
56
68
|
type: Boolean,
|
|
57
|
-
default: void 0
|
|
69
|
+
default: void 0,
|
|
70
|
+
required: false
|
|
58
71
|
}
|
|
59
72
|
};
|
|
60
73
|
const uLinkProps = {
|
package/dist/types.d.mts
CHANGED
|
@@ -13,4 +13,4 @@ declare module 'nuxt/schema' {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, checkbox, chip, commandPalette, container, contextMenu, divider, dropdown, formGroup, input, inputMenu, kbd, meter, meterGroup, modal, notification, notifications, pagination, popover, progress, radio, radioGroup, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module.js'
|
|
16
|
+
export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, carousel, checkbox, chip, commandPalette, container, contextMenu, divider, dropdown, formGroup, horizontalNavigation, input, inputMenu, kbd, meter, meterGroup, modal, notification, notifications, pagination, popover, progress, radio, radioGroup, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module.js'
|
package/dist/types.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ declare module 'nuxt/schema' {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, checkbox, chip, commandPalette, container, contextMenu, divider, dropdown, formGroup, input, inputMenu, kbd, meter, meterGroup, modal, notification, notifications, pagination, popover, progress, radio, radioGroup, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module'
|
|
16
|
+
export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, carousel, checkbox, chip, commandPalette, container, contextMenu, divider, dropdown, formGroup, horizontalNavigation, input, inputMenu, kbd, meter, meterGroup, modal, notification, notifications, pagination, popover, progress, radio, radioGroup, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module'
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"repository": "nuxt/ui",
|
|
5
5
|
"homepage": "https://ui.nuxt.com",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
@@ -32,54 +33,55 @@
|
|
|
32
33
|
"test": "vitest"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@egoist/tailwindcss-icons": "^1.7.
|
|
36
|
+
"@egoist/tailwindcss-icons": "^1.7.4",
|
|
36
37
|
"@headlessui/tailwindcss": "^0.2.0",
|
|
37
|
-
"@headlessui/vue": "1.7.
|
|
38
|
-
"@iconify-json/heroicons": "^1.1.
|
|
39
|
-
"@nuxt/kit": "^3.
|
|
38
|
+
"@headlessui/vue": "^1.7.19",
|
|
39
|
+
"@iconify-json/heroicons": "^1.1.20",
|
|
40
|
+
"@nuxt/kit": "^3.10.2",
|
|
40
41
|
"@nuxtjs/color-mode": "^3.3.2",
|
|
41
|
-
"@nuxtjs/tailwindcss": "^6.
|
|
42
|
+
"@nuxtjs/tailwindcss": "^6.11.4",
|
|
42
43
|
"@popperjs/core": "^2.11.8",
|
|
43
44
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
44
45
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
45
46
|
"@tailwindcss/forms": "^0.5.7",
|
|
46
47
|
"@tailwindcss/typography": "^0.5.10",
|
|
47
|
-
"@vueuse/core": "^10.
|
|
48
|
-
"@vueuse/integrations": "^10.
|
|
49
|
-
"@vueuse/math": "^10.
|
|
48
|
+
"@vueuse/core": "^10.8.0",
|
|
49
|
+
"@vueuse/integrations": "^10.8.0",
|
|
50
|
+
"@vueuse/math": "^10.8.0",
|
|
50
51
|
"defu": "^6.1.4",
|
|
51
52
|
"fuse.js": "^6.6.2",
|
|
52
53
|
"nuxt-icon": "^0.6.8",
|
|
53
54
|
"ohash": "^1.1.3",
|
|
54
55
|
"pathe": "^1.1.2",
|
|
55
|
-
"scule": "^1.
|
|
56
|
-
"tailwind-merge": "^2.2.
|
|
56
|
+
"scule": "^1.3.0",
|
|
57
|
+
"tailwind-merge": "^2.2.1",
|
|
57
58
|
"tailwindcss": "^3.4.1"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@nuxt/eslint-config": "^0.2.0",
|
|
61
62
|
"@nuxt/module-builder": "^0.5.5",
|
|
62
|
-
"@nuxt/test-utils": "^3.
|
|
63
|
+
"@nuxt/test-utils": "^3.11.0",
|
|
63
64
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
64
|
-
"@vue/test-utils": "^2.4.
|
|
65
|
+
"@vue/test-utils": "^2.4.4",
|
|
65
66
|
"eslint": "^8.56.0",
|
|
66
|
-
"happy-dom": "^
|
|
67
|
-
"joi": "^17.
|
|
68
|
-
"nuxt": "^3.
|
|
69
|
-
"release-it": "^17.
|
|
67
|
+
"happy-dom": "^13.3.8",
|
|
68
|
+
"joi": "^17.12.1",
|
|
69
|
+
"nuxt": "^3.10.2",
|
|
70
|
+
"release-it": "^17.1.1",
|
|
70
71
|
"typescript": "^5.3.3",
|
|
71
72
|
"unbuild": "^2.0.0",
|
|
72
|
-
"valibot": "^0.
|
|
73
|
-
"vitest": "^1.
|
|
73
|
+
"valibot": "^0.29.0",
|
|
74
|
+
"vitest": "^1.3.1",
|
|
74
75
|
"vitest-environment-nuxt": "^1.0.0",
|
|
75
76
|
"vue-tsc": "^1.8.27",
|
|
76
77
|
"yup": "^1.3.3",
|
|
77
78
|
"zod": "^3.22.4"
|
|
78
79
|
},
|
|
79
80
|
"resolutions": {
|
|
80
|
-
"@nuxt/kit": "3.
|
|
81
|
-
"@nuxt/schema": "3.
|
|
81
|
+
"@nuxt/kit": "^3.10.2",
|
|
82
|
+
"@nuxt/schema": "3.10.2",
|
|
82
83
|
"tailwindcss": "3.4.1",
|
|
83
|
-
"vue": "
|
|
84
|
+
"@headlessui/vue": "^1.7.19",
|
|
85
|
+
"vue": "3.4.19"
|
|
84
86
|
}
|
|
85
87
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function uid(): string;
|