@nuxt/ui 2.10.0 → 2.11.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.
- package/README.md +11 -0
- package/dist/module.d.mts +387 -104
- package/dist/module.d.ts +387 -104
- package/dist/module.json +1 -1
- package/dist/module.mjs +16 -7
- package/dist/runtime/components/data/Table.vue +3 -3
- package/dist/runtime/components/data/Table.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Accordion.vue +2 -2
- package/dist/runtime/components/elements/Accordion.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Alert.vue +13 -12
- package/dist/runtime/components/elements/Alert.vue.d.ts +12 -11
- package/dist/runtime/components/elements/Avatar.vue +2 -2
- package/dist/runtime/components/elements/Avatar.vue.d.ts +11 -10
- package/dist/runtime/components/elements/AvatarGroup.d.ts +11 -10
- package/dist/runtime/components/elements/AvatarGroup.mjs +2 -2
- package/dist/runtime/components/elements/Badge.vue +6 -4
- package/dist/runtime/components/elements/Badge.vue.d.ts +11 -11
- package/dist/runtime/components/elements/Button.vue +16 -12
- package/dist/runtime/components/elements/Button.vue.d.ts +13 -12
- package/dist/runtime/components/elements/ButtonGroup.d.ts +12 -11
- package/dist/runtime/components/elements/ButtonGroup.mjs +8 -34
- package/dist/runtime/components/elements/Chip.vue +85 -0
- package/dist/runtime/components/elements/Chip.vue.d.ts +90 -0
- package/dist/runtime/components/elements/Dropdown.vue +35 -21
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +13 -7
- package/dist/runtime/components/elements/Icon.vue +16 -2
- package/dist/runtime/components/elements/Icon.vue.d.ts +14 -2
- package/dist/runtime/components/elements/Kbd.vue +2 -2
- package/dist/runtime/components/elements/Kbd.vue.d.ts +12 -11
- package/dist/runtime/components/elements/Link.vue +2 -5
- package/dist/runtime/components/elements/Meter.vue +2 -2
- package/dist/runtime/components/elements/Meter.vue.d.ts +9 -9
- package/dist/runtime/components/elements/MeterGroup.d.ts +10 -10
- package/dist/runtime/components/elements/MeterGroup.mjs +8 -21
- package/dist/runtime/components/elements/Progress.vue +6 -95
- package/dist/runtime/components/elements/Progress.vue.d.ts +123 -1
- package/dist/runtime/components/forms/Checkbox.vue +8 -10
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +10 -10
- package/dist/runtime/components/forms/Form.vue +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +9 -5
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +21 -11
- package/dist/runtime/components/forms/Input.vue +43 -12
- package/dist/runtime/components/forms/Input.vue.d.ts +38 -15
- package/dist/runtime/components/forms/Radio.vue +18 -12
- package/dist/runtime/components/forms/Radio.vue.d.ts +11 -10
- package/dist/runtime/components/forms/RadioGroup.vue +3 -3
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +13 -13
- package/dist/runtime/components/forms/Range.vue +5 -5
- package/dist/runtime/components/forms/Range.vue.d.ts +11 -10
- package/dist/runtime/components/forms/Select.vue +12 -9
- package/dist/runtime/components/forms/Select.vue.d.ts +15 -14
- package/dist/runtime/components/forms/SelectMenu.vue +42 -25
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +28 -19
- package/dist/runtime/components/forms/Textarea.vue +36 -6
- package/dist/runtime/components/forms/Textarea.vue.d.ts +37 -14
- package/dist/runtime/components/forms/Toggle.vue +25 -7
- package/dist/runtime/components/forms/Toggle.vue.d.ts +20 -7
- package/dist/runtime/components/layout/Card.vue +2 -2
- package/dist/runtime/components/layout/Card.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Container.vue +2 -2
- package/dist/runtime/components/layout/Container.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Divider.vue +3 -8
- package/dist/runtime/components/layout/Divider.vue.d.ts +9 -9
- package/dist/runtime/components/layout/Skeleton.vue +2 -2
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +7 -7
- package/dist/runtime/components/navigation/Breadcrumb.vue +78 -0
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +50 -0
- package/dist/runtime/components/navigation/CommandPalette.vue +50 -37
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +15 -8
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -3
- package/dist/runtime/components/navigation/Pagination.vue +7 -7
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +11 -11
- package/dist/runtime/components/navigation/Tabs.vue +8 -5
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -10
- package/dist/runtime/components/navigation/VerticalNavigation.vue +2 -2
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/ContextMenu.vue +4 -3
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Modal.vue +3 -6
- package/dist/runtime/components/overlays/Modal.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Notification.vue +30 -31
- package/dist/runtime/components/overlays/Notification.vue.d.ts +10 -9
- package/dist/runtime/components/overlays/Notifications.vue +18 -16
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Popover.vue +14 -4
- package/dist/runtime/components/overlays/Popover.vue.d.ts +20 -9
- package/dist/runtime/components/overlays/Slideover.vue +6 -6
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Tooltip.vue +6 -5
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +7 -7
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.mjs +8 -4
- package/dist/runtime/composables/useButtonGroup.d.ts +20 -0
- package/dist/runtime/composables/useButtonGroup.mjs +52 -0
- package/dist/runtime/composables/useFormGroup.d.ts +2 -0
- package/dist/runtime/composables/useFormGroup.mjs +3 -2
- package/dist/runtime/composables/useShortcuts.d.ts +2 -2
- package/dist/runtime/composables/useUI.d.ts +3 -3
- package/dist/runtime/types/alert.d.ts +7 -0
- package/dist/runtime/types/avatar.d.ts +3 -1
- package/dist/runtime/types/badge.d.ts +5 -4
- package/dist/runtime/types/breadcrumb.d.ts +9 -0
- package/dist/runtime/types/button.d.ts +5 -4
- package/dist/runtime/types/chip.d.ts +11 -0
- package/dist/runtime/types/dropdown.d.ts +2 -2
- package/dist/runtime/types/form-group.d.ts +5 -0
- package/dist/runtime/types/form.d.ts +3 -2
- package/dist/runtime/types/index.d.ts +10 -0
- package/dist/runtime/types/input.d.ts +8 -0
- package/dist/runtime/types/kbd.d.ts +5 -0
- package/dist/runtime/types/popper.d.ts +2 -0
- package/dist/runtime/types/range.d.ts +5 -0
- package/dist/runtime/types/select.d.ts +8 -0
- package/dist/runtime/types/textarea.d.ts +8 -0
- package/dist/runtime/types/toggle.d.ts +5 -0
- package/dist/runtime/types/utils.d.ts +24 -7
- package/dist/runtime/ui.config/data/table.d.ts +60 -0
- package/dist/runtime/ui.config/data/table.mjs +59 -0
- package/dist/runtime/ui.config/elements/accordion.d.ts +21 -0
- package/dist/runtime/ui.config/elements/accordion.mjs +20 -0
- package/dist/runtime/ui.config/elements/alert.d.ts +41 -0
- package/dist/runtime/ui.config/elements/alert.mjs +40 -0
- package/dist/runtime/ui.config/elements/avatar.d.ts +60 -0
- package/dist/runtime/ui.config/elements/avatar.mjs +59 -0
- package/dist/runtime/ui.config/elements/avatarGroup.d.ts +6 -0
- package/dist/runtime/ui.config/elements/avatarGroup.mjs +5 -0
- package/dist/runtime/ui.config/elements/badge.d.ts +34 -0
- package/dist/runtime/ui.config/elements/badge.mjs +33 -0
- package/dist/runtime/ui.config/elements/button.d.ts +81 -0
- package/dist/runtime/ui.config/elements/button.mjs +80 -0
- package/dist/runtime/ui.config/elements/buttonGroup.d.ts +101 -0
- package/dist/runtime/ui.config/elements/buttonGroup.mjs +19 -0
- package/dist/runtime/ui.config/elements/chip.d.ts +35 -0
- package/dist/runtime/ui.config/elements/chip.mjs +34 -0
- package/dist/runtime/ui.config/elements/dropdown.d.ts +55 -0
- package/dist/runtime/ui.config/elements/dropdown.mjs +53 -0
- package/dist/runtime/ui.config/elements/kbd.d.ts +17 -0
- package/dist/runtime/ui.config/elements/kbd.mjs +16 -0
- package/dist/runtime/ui.config/elements/meter.d.ts +77 -0
- package/dist/runtime/ui.config/elements/meter.mjs +76 -0
- package/dist/runtime/ui.config/elements/meterGroup.d.ts +52 -0
- package/dist/runtime/ui.config/elements/meterGroup.mjs +24 -0
- package/dist/runtime/ui.config/elements/progress.d.ts +75 -0
- package/dist/runtime/ui.config/elements/progress.mjs +74 -0
- package/dist/runtime/ui.config/forms/checkbox.d.ts +19 -0
- package/dist/runtime/ui.config/forms/checkbox.mjs +18 -0
- package/dist/runtime/ui.config/forms/formGroup.d.ts +25 -0
- package/dist/runtime/ui.config/forms/formGroup.mjs +25 -0
- package/dist/runtime/ui.config/forms/input.d.ts +107 -0
- package/dist/runtime/ui.config/forms/input.mjs +106 -0
- package/dist/runtime/ui.config/forms/radio.d.ts +18 -0
- package/dist/runtime/ui.config/forms/radio.mjs +17 -0
- package/dist/runtime/ui.config/forms/radioGroup.d.ts +8 -0
- package/dist/runtime/ui.config/forms/radioGroup.mjs +7 -0
- package/dist/runtime/ui.config/forms/range.d.ts +64 -0
- package/dist/runtime/ui.config/forms/range.mjs +63 -0
- package/dist/runtime/ui.config/forms/select.d.ts +108 -0
- package/dist/runtime/ui.config/forms/select.mjs +13 -0
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +68 -0
- package/dist/runtime/ui.config/forms/selectMenu.mjs +66 -0
- package/dist/runtime/ui.config/forms/textarea.d.ts +106 -0
- package/dist/runtime/ui.config/forms/textarea.mjs +10 -0
- package/dist/runtime/ui.config/forms/toggle.d.ts +61 -0
- package/dist/runtime/ui.config/forms/toggle.mjs +60 -0
- package/dist/runtime/ui.config/index.d.ts +40 -0
- package/dist/runtime/ui.config/index.mjs +40 -0
- package/dist/runtime/ui.config/layout/card.d.ts +24 -0
- package/dist/runtime/ui.config/layout/card.mjs +23 -0
- package/dist/runtime/ui.config/layout/container.d.ts +6 -0
- package/dist/runtime/ui.config/layout/container.mjs +5 -0
- package/dist/runtime/ui.config/layout/divider.d.ts +35 -0
- package/dist/runtime/ui.config/layout/divider.mjs +34 -0
- package/dist/runtime/ui.config/layout/skeleton.d.ts +6 -0
- package/dist/runtime/ui.config/layout/skeleton.mjs +5 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +20 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.mjs +19 -0
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +72 -0
- package/dist/runtime/ui.config/navigation/commandPalette.mjs +71 -0
- package/dist/runtime/ui.config/navigation/pagination.d.ts +35 -0
- package/dist/runtime/ui.config/navigation/pagination.mjs +34 -0
- package/dist/runtime/ui.config/navigation/tabs.d.ts +34 -0
- package/dist/runtime/ui.config/navigation/tabs.mjs +33 -0
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +28 -0
- package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +27 -0
- package/dist/runtime/ui.config/overlays/contextMenu.d.ts +31 -0
- package/dist/runtime/ui.config/overlays/contextMenu.mjs +25 -0
- package/dist/runtime/ui.config/overlays/modal.d.ts +36 -0
- package/dist/runtime/ui.config/overlays/modal.mjs +37 -0
- package/dist/runtime/ui.config/overlays/notification.d.ts +50 -0
- package/dist/runtime/ui.config/overlays/notification.mjs +50 -0
- package/dist/runtime/ui.config/overlays/notifications.d.ts +7 -0
- package/dist/runtime/ui.config/overlays/notifications.mjs +6 -0
- package/dist/runtime/ui.config/overlays/popover.d.ts +43 -0
- package/dist/runtime/ui.config/overlays/popover.mjs +37 -0
- package/dist/runtime/ui.config/overlays/slideover.d.ts +32 -0
- package/dist/runtime/ui.config/overlays/slideover.mjs +33 -0
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +33 -0
- package/dist/runtime/ui.config/overlays/tooltip.mjs +27 -0
- package/dist/runtime/ui.config/popper.d.ts +8 -0
- package/dist/runtime/ui.config/popper.mjs +8 -0
- package/dist/runtime/ui.css +1 -13
- package/dist/runtime/utils/index.d.ts +5 -0
- package/dist/runtime/utils/index.mjs +7 -3
- package/dist/types.d.mts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +32 -21
- package/dist/runtime/ui.config.d.ts +0 -1470
- package/dist/runtime/ui.config.mjs +0 -1273
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import defaultColors from 'tailwindcss/colors.js';
|
|
|
3
3
|
import { defaultExtractor as defaultExtractor$1 } from 'tailwindcss/lib/lib/defaultExtractor.js';
|
|
4
4
|
import { iconsPlugin, getIconCollections } from '@egoist/tailwindcss-icons';
|
|
5
5
|
import { kebabCase, upperFirst, camelCase } from 'scule';
|
|
6
|
-
import { dirname } from 'pathe';
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
@@ -15,7 +14,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
|
15
14
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
16
15
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
17
16
|
const name = "@nuxt/ui";
|
|
18
|
-
const version = "2.
|
|
17
|
+
const version = "2.11.1";
|
|
19
18
|
|
|
20
19
|
function omit(object, keysToOmit) {
|
|
21
20
|
const result = { ...object };
|
|
@@ -221,6 +220,12 @@ const safelistByComponent = {
|
|
|
221
220
|
variants: ["dark"]
|
|
222
221
|
}, {
|
|
223
222
|
pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
|
|
223
|
+
}],
|
|
224
|
+
chip: (colorsAsRegex2) => [{
|
|
225
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
|
|
226
|
+
variants: ["dark"]
|
|
227
|
+
}, {
|
|
228
|
+
pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
|
|
224
229
|
}]
|
|
225
230
|
};
|
|
226
231
|
const safelistComponentAliasesMap = {
|
|
@@ -290,7 +295,7 @@ function createTemplates(nuxt = useNuxt()) {
|
|
|
290
295
|
getContents: () => `declare module '#ui-colors' { const defaultExport: ${JSON.stringify(nuxt.options.appConfig.ui.colors)}; export default defaultExport; }`,
|
|
291
296
|
write: true
|
|
292
297
|
});
|
|
293
|
-
nuxt.options.alias["#ui-colors"] =
|
|
298
|
+
nuxt.options.alias["#ui-colors"] = template.dst;
|
|
294
299
|
nuxt.hook("prepare:types", (opts) => {
|
|
295
300
|
opts.references.push({ path: typesTemplate.dst });
|
|
296
301
|
});
|
|
@@ -324,11 +329,13 @@ const module = defineNuxtModule({
|
|
|
324
329
|
nuxt.options.alias["#ui"] = runtimeDir;
|
|
325
330
|
nuxt.options.css.push(resolve(runtimeDir, "ui.css"));
|
|
326
331
|
nuxt.hook("tailwindcss:config", function(tailwindConfig) {
|
|
332
|
+
tailwindConfig.theme = tailwindConfig.theme || {};
|
|
333
|
+
tailwindConfig.theme.extend = tailwindConfig.theme.extend || {};
|
|
334
|
+
tailwindConfig.theme.extend.colors = tailwindConfig.theme.extend.colors || {};
|
|
327
335
|
const globalColors = {
|
|
328
336
|
...tailwindConfig.theme.colors || defaultColors,
|
|
329
337
|
...tailwindConfig.theme.extend?.colors
|
|
330
338
|
};
|
|
331
|
-
tailwindConfig.theme.extend.colors = tailwindConfig.theme.extend.colors || {};
|
|
332
339
|
globalColors.primary = tailwindConfig.theme.extend.colors.primary = {
|
|
333
340
|
50: "rgb(var(--color-primary-50) / <alpha-value>)",
|
|
334
341
|
100: "rgb(var(--color-primary-100) / <alpha-value>)",
|
|
@@ -367,11 +374,12 @@ const module = defineNuxtModule({
|
|
|
367
374
|
strategy: "merge"
|
|
368
375
|
};
|
|
369
376
|
tailwindConfig.safelist = tailwindConfig.safelist || [];
|
|
370
|
-
tailwindConfig.safelist.push(...generateSafelist(options.safelistColors, colors));
|
|
377
|
+
tailwindConfig.safelist.push(...generateSafelist(options.safelistColors || [], colors));
|
|
371
378
|
tailwindConfig.plugins = tailwindConfig.plugins || [];
|
|
372
|
-
tailwindConfig.plugins.push(iconsPlugin({ collections: getIconCollections(options.icons) }));
|
|
379
|
+
tailwindConfig.plugins.push(iconsPlugin(Array.isArray(options.icons) || options.icons === "all" ? { collections: getIconCollections(options.icons) } : typeof options.icons === "object" ? options.icons : {}));
|
|
373
380
|
});
|
|
374
381
|
createTemplates(nuxt);
|
|
382
|
+
await installModule("nuxt-icon");
|
|
375
383
|
await installModule("@nuxtjs/color-mode", { classSuffix: "" });
|
|
376
384
|
await installModule("@nuxtjs/tailwindcss", {
|
|
377
385
|
exposeConfig: true,
|
|
@@ -387,7 +395,7 @@ const module = defineNuxtModule({
|
|
|
387
395
|
content: {
|
|
388
396
|
files: [
|
|
389
397
|
resolve(runtimeDir, "components/**/*.{vue,mjs,ts}"),
|
|
390
|
-
resolve(runtimeDir, "
|
|
398
|
+
resolve(runtimeDir, "ui.config/**/*.{mjs,js,ts}")
|
|
391
399
|
],
|
|
392
400
|
transform: {
|
|
393
401
|
vue: (content) => {
|
|
@@ -398,6 +406,7 @@ const module = defineNuxtModule({
|
|
|
398
406
|
vue: (content) => {
|
|
399
407
|
return [
|
|
400
408
|
...defaultExtractor(content),
|
|
409
|
+
// @ts-ignore
|
|
401
410
|
...customSafelistExtractor(options.prefix, content, nuxt.options.appConfig.ui.colors, options.safelistColors)
|
|
402
411
|
];
|
|
403
412
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<slot :name="`${column.key}-header`" :column="column" :sort="sort" :on-sort="onSort">
|
|
12
12
|
<UButton
|
|
13
13
|
v-if="column.sortable"
|
|
14
|
-
v-bind="{ ...ui.default.sortButton, ...sortButton }"
|
|
14
|
+
v-bind="{ ...(ui.default.sortButton || {}), ...sortButton }"
|
|
15
15
|
:icon="(!sort.column || sort.column !== column.key) ? (sortButton.icon || ui.default.sortButton.icon) : sort.direction === 'asc' ? sortAscIcon : sortDescIcon"
|
|
16
16
|
:label="column[columnAttribute]"
|
|
17
17
|
@click="onSort(column)"
|
|
@@ -139,11 +139,11 @@ export default defineComponent({
|
|
|
139
139
|
},
|
|
140
140
|
class: {
|
|
141
141
|
type: [String, Object, Array],
|
|
142
|
-
default:
|
|
142
|
+
default: () => ""
|
|
143
143
|
},
|
|
144
144
|
ui: {
|
|
145
145
|
type: Object,
|
|
146
|
-
default:
|
|
146
|
+
default: () => ({})
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
emits: ["update:modelValue", "update:sort"],
|
|
@@ -70,11 +70,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
70
70
|
};
|
|
71
71
|
class: {
|
|
72
72
|
type: PropType<any>;
|
|
73
|
-
default:
|
|
73
|
+
default: () => string;
|
|
74
74
|
};
|
|
75
75
|
ui: {
|
|
76
|
-
type: PropType<
|
|
77
|
-
default:
|
|
76
|
+
type: PropType<any>;
|
|
77
|
+
default: () => {};
|
|
78
78
|
};
|
|
79
79
|
}, {
|
|
80
80
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -177,11 +177,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
177
177
|
};
|
|
178
178
|
class: {
|
|
179
179
|
type: PropType<any>;
|
|
180
|
-
default:
|
|
180
|
+
default: () => string;
|
|
181
181
|
};
|
|
182
182
|
ui: {
|
|
183
|
-
type: PropType<
|
|
184
|
-
default:
|
|
183
|
+
type: PropType<any>;
|
|
184
|
+
default: () => {};
|
|
185
185
|
};
|
|
186
186
|
}>> & {
|
|
187
187
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -191,7 +191,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
191
191
|
column: string;
|
|
192
192
|
direction: 'asc' | 'desc';
|
|
193
193
|
};
|
|
194
|
-
ui:
|
|
194
|
+
ui: any;
|
|
195
195
|
class: any;
|
|
196
196
|
modelValue: unknown[];
|
|
197
197
|
by: string | Function;
|
|
@@ -24,11 +24,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
};
|
|
25
25
|
class: {
|
|
26
26
|
type: PropType<any>;
|
|
27
|
-
default:
|
|
27
|
+
default: () => string;
|
|
28
28
|
};
|
|
29
29
|
ui: {
|
|
30
|
-
type: PropType<
|
|
31
|
-
default:
|
|
30
|
+
type: PropType<any>;
|
|
31
|
+
default: () => {};
|
|
32
32
|
};
|
|
33
33
|
}, {
|
|
34
34
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -69,14 +69,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
69
|
};
|
|
70
70
|
class: {
|
|
71
71
|
type: PropType<any>;
|
|
72
|
-
default:
|
|
72
|
+
default: () => string;
|
|
73
73
|
};
|
|
74
74
|
ui: {
|
|
75
|
-
type: PropType<
|
|
76
|
-
default:
|
|
75
|
+
type: PropType<any>;
|
|
76
|
+
default: () => {};
|
|
77
77
|
};
|
|
78
78
|
}>>, {
|
|
79
|
-
ui:
|
|
79
|
+
ui: any;
|
|
80
80
|
class: any;
|
|
81
81
|
defaultOpen: boolean;
|
|
82
82
|
items: AccordionItem[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="alertClass" v-bind="attrs">
|
|
3
|
-
<div class="flex
|
|
3
|
+
<div class="flex" :class="[ui.gap, { 'items-start': (description || $slots.description), 'items-center': !description && !$slots.description }]">
|
|
4
4
|
<UIcon v-if="icon" :name="icon" :class="ui.icon.base" />
|
|
5
5
|
<UAvatar v-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
|
|
6
6
|
|
|
7
|
-
<div class="
|
|
7
|
+
<div :class="ui.inner">
|
|
8
8
|
<p :class="ui.title">
|
|
9
9
|
<slot name="title" :title="title">
|
|
10
10
|
{{ title }}
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
</slot>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
<div v-if="(description || $slots.description) && actions.length" class="
|
|
20
|
-
<UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...ui.default.actionButton, ...action }" @click.stop="action.click" />
|
|
19
|
+
<div v-if="(description || $slots.description) && actions.length" :class="ui.actions">
|
|
20
|
+
<UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="action.click" />
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
|
-
<div
|
|
24
|
-
<
|
|
25
|
-
<UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...ui.default.actionButton, ...action }" @click.stop="action.click" />
|
|
26
|
-
</
|
|
23
|
+
<div v-if="closeButton || (!description && !$slots.description && actions.length)" :class="twMerge(ui.actions, 'mt-0')">
|
|
24
|
+
<template v-if="!description && !$slots.description && actions.length">
|
|
25
|
+
<UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="action.click" />
|
|
26
|
+
</template>
|
|
27
27
|
|
|
28
|
-
<UButton v-if="closeButton" aria-label="Close" v-bind="{ ...ui.default.closeButton, ...closeButton }" @click.stop="$emit('close')" />
|
|
28
|
+
<UButton v-if="closeButton" aria-label="Close" v-bind="{ ...(ui.default.closeButton || {}), ...closeButton }" @click.stop="$emit('close')" />
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
@@ -93,11 +93,11 @@ export default defineComponent({
|
|
|
93
93
|
},
|
|
94
94
|
class: {
|
|
95
95
|
type: [String, Object, Array],
|
|
96
|
-
default:
|
|
96
|
+
default: () => ""
|
|
97
97
|
},
|
|
98
98
|
ui: {
|
|
99
99
|
type: Object,
|
|
100
|
-
default:
|
|
100
|
+
default: () => ({})
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
emits: ["close"],
|
|
@@ -117,7 +117,8 @@ export default defineComponent({
|
|
|
117
117
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
118
118
|
ui,
|
|
119
119
|
attrs,
|
|
120
|
-
alertClass
|
|
120
|
+
alertClass,
|
|
121
|
+
twMerge
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
124
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { Avatar, Button } from '../../types';
|
|
2
|
+
import type { Avatar, Button, AlertVariant } from '../../types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
title: {
|
|
5
5
|
type: StringConstructor;
|
|
@@ -33,17 +33,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
33
|
validator(value: string): boolean;
|
|
34
34
|
};
|
|
35
35
|
variant: {
|
|
36
|
-
type: PropType<
|
|
36
|
+
type: PropType<AlertVariant>;
|
|
37
37
|
default: () => any;
|
|
38
38
|
validator(value: string): boolean;
|
|
39
39
|
};
|
|
40
40
|
class: {
|
|
41
41
|
type: PropType<any>;
|
|
42
|
-
default:
|
|
42
|
+
default: () => "";
|
|
43
43
|
};
|
|
44
44
|
ui: {
|
|
45
|
-
type: PropType<
|
|
46
|
-
default:
|
|
45
|
+
type: PropType<any>;
|
|
46
|
+
default: () => {};
|
|
47
47
|
};
|
|
48
48
|
}, {
|
|
49
49
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -51,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
51
|
[x: string]: unknown;
|
|
52
52
|
}, string>>;
|
|
53
53
|
alertClass: import("vue").ComputedRef<string>;
|
|
54
|
+
twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
54
55
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
56
|
title: {
|
|
56
57
|
type: StringConstructor;
|
|
@@ -84,21 +85,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
85
|
validator(value: string): boolean;
|
|
85
86
|
};
|
|
86
87
|
variant: {
|
|
87
|
-
type: PropType<
|
|
88
|
+
type: PropType<AlertVariant>;
|
|
88
89
|
default: () => any;
|
|
89
90
|
validator(value: string): boolean;
|
|
90
91
|
};
|
|
91
92
|
class: {
|
|
92
93
|
type: PropType<any>;
|
|
93
|
-
default:
|
|
94
|
+
default: () => "";
|
|
94
95
|
};
|
|
95
96
|
ui: {
|
|
96
|
-
type: PropType<
|
|
97
|
-
default:
|
|
97
|
+
type: PropType<any>;
|
|
98
|
+
default: () => {};
|
|
98
99
|
};
|
|
99
100
|
}>> & {
|
|
100
101
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
101
102
|
}, {
|
|
103
|
+
ui: any;
|
|
102
104
|
description: string;
|
|
103
105
|
icon: string;
|
|
104
106
|
avatar: Avatar;
|
|
@@ -107,8 +109,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
107
109
|
click?: Function | undefined;
|
|
108
110
|
})[];
|
|
109
111
|
color: any;
|
|
110
|
-
ui: Partial<any>;
|
|
111
112
|
class: any;
|
|
112
|
-
variant:
|
|
113
|
+
variant: AlertVariant;
|
|
113
114
|
}, {}>;
|
|
114
115
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
+
import type { AvatarSize } from '../../types';
|
|
2
3
|
declare const _default: import("vue").DefineComponent<{
|
|
3
4
|
src: {
|
|
4
5
|
type: (BooleanConstructor | StringConstructor)[];
|
|
@@ -17,7 +18,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
18
|
default: () => any;
|
|
18
19
|
};
|
|
19
20
|
size: {
|
|
20
|
-
type: PropType<
|
|
21
|
+
type: PropType<AvatarSize>;
|
|
21
22
|
default: () => any;
|
|
22
23
|
validator(value: string): boolean;
|
|
23
24
|
};
|
|
@@ -41,11 +42,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
42
|
};
|
|
42
43
|
class: {
|
|
43
44
|
type: PropType<any>;
|
|
44
|
-
default:
|
|
45
|
+
default: () => "";
|
|
45
46
|
};
|
|
46
47
|
ui: {
|
|
47
|
-
type: PropType<
|
|
48
|
-
default:
|
|
48
|
+
type: PropType<any>;
|
|
49
|
+
default: () => {};
|
|
49
50
|
};
|
|
50
51
|
}, {
|
|
51
52
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -78,7 +79,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
78
79
|
default: () => any;
|
|
79
80
|
};
|
|
80
81
|
size: {
|
|
81
|
-
type: PropType<
|
|
82
|
+
type: PropType<AvatarSize>;
|
|
82
83
|
default: () => any;
|
|
83
84
|
validator(value: string): boolean;
|
|
84
85
|
};
|
|
@@ -102,20 +103,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
102
103
|
};
|
|
103
104
|
class: {
|
|
104
105
|
type: PropType<any>;
|
|
105
|
-
default:
|
|
106
|
+
default: () => "";
|
|
106
107
|
};
|
|
107
108
|
ui: {
|
|
108
|
-
type: PropType<
|
|
109
|
-
default:
|
|
109
|
+
type: PropType<any>;
|
|
110
|
+
default: () => {};
|
|
110
111
|
};
|
|
111
112
|
}>>, {
|
|
112
113
|
alt: string;
|
|
114
|
+
size: AvatarSize;
|
|
115
|
+
ui: any;
|
|
113
116
|
icon: string;
|
|
114
|
-
ui: Partial<any>;
|
|
115
117
|
class: any;
|
|
116
118
|
src: string | boolean;
|
|
117
119
|
text: string;
|
|
118
|
-
size: "sm" | "3xs" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl" | "3xl";
|
|
119
120
|
chipColor: any;
|
|
120
121
|
chipPosition: "top-right" | "bottom-right" | "top-left" | "bottom-left";
|
|
121
122
|
chipText: string | number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
+
import type { AvatarSize } from '../../types';
|
|
2
3
|
declare const _default: import("vue").DefineComponent<{
|
|
3
4
|
size: {
|
|
4
|
-
type: PropType<
|
|
5
|
+
type: PropType<AvatarSize>;
|
|
5
6
|
default: null;
|
|
6
7
|
validator(value: string): boolean;
|
|
7
8
|
};
|
|
@@ -11,17 +12,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
12
|
};
|
|
12
13
|
class: {
|
|
13
14
|
type: PropType<any>;
|
|
14
|
-
default:
|
|
15
|
+
default: () => "";
|
|
15
16
|
};
|
|
16
17
|
ui: {
|
|
17
|
-
type: PropType<
|
|
18
|
-
default:
|
|
18
|
+
type: PropType<any>;
|
|
19
|
+
default: () => {};
|
|
19
20
|
};
|
|
20
21
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
22
|
[key: string]: any;
|
|
22
23
|
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
24
|
size: {
|
|
24
|
-
type: PropType<
|
|
25
|
+
type: PropType<AvatarSize>;
|
|
25
26
|
default: null;
|
|
26
27
|
validator(value: string): boolean;
|
|
27
28
|
};
|
|
@@ -31,16 +32,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
32
|
};
|
|
32
33
|
class: {
|
|
33
34
|
type: PropType<any>;
|
|
34
|
-
default:
|
|
35
|
+
default: () => "";
|
|
35
36
|
};
|
|
36
37
|
ui: {
|
|
37
|
-
type: PropType<
|
|
38
|
-
default:
|
|
38
|
+
type: PropType<any>;
|
|
39
|
+
default: () => {};
|
|
39
40
|
};
|
|
40
41
|
}>>, {
|
|
41
|
-
|
|
42
|
+
size: AvatarSize;
|
|
43
|
+
ui: any;
|
|
42
44
|
class: any;
|
|
43
|
-
size: string | number | symbol;
|
|
44
45
|
max: number;
|
|
45
46
|
}, {}>;
|
|
46
47
|
export default _default;
|
|
@@ -9,6 +9,7 @@ import { computed, toRef, defineComponent } from "vue";
|
|
|
9
9
|
import { twMerge, twJoin } from "tailwind-merge";
|
|
10
10
|
import { useUI } from "../../composables/useUI";
|
|
11
11
|
import { mergeConfig } from "../../utils";
|
|
12
|
+
import { useInjectButtonGroup } from "../../composables/useButtonGroup";
|
|
12
13
|
import appConfig from "#build/app.config";
|
|
13
14
|
import { badge } from "#ui/ui.config";
|
|
14
15
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.badge, badge);
|
|
@@ -45,22 +46,23 @@ export default defineComponent({
|
|
|
45
46
|
},
|
|
46
47
|
class: {
|
|
47
48
|
type: [String, Object, Array],
|
|
48
|
-
default:
|
|
49
|
+
default: () => ""
|
|
49
50
|
},
|
|
50
51
|
ui: {
|
|
51
52
|
type: Object,
|
|
52
|
-
default:
|
|
53
|
+
default: () => ({})
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
setup(props) {
|
|
56
57
|
const { ui, attrs } = useUI("badge", toRef(props, "ui"), config);
|
|
58
|
+
const { size, rounded } = useInjectButtonGroup({ ui, props });
|
|
57
59
|
const badgeClass = computed(() => {
|
|
58
60
|
const variant = ui.value.color?.[props.color]?.[props.variant] || ui.value.variant[props.variant];
|
|
59
61
|
return twMerge(twJoin(
|
|
60
62
|
ui.value.base,
|
|
61
63
|
ui.value.font,
|
|
62
|
-
|
|
63
|
-
ui.value.size[
|
|
64
|
+
rounded.value,
|
|
65
|
+
ui.value.size[size.value],
|
|
64
66
|
variant?.replaceAll("{color}", props.color)
|
|
65
67
|
), props.class);
|
|
66
68
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { BadgeVariant } from '../../types';
|
|
2
|
+
import type { BadgeSize, BadgeVariant } from '../../types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
size: {
|
|
5
|
-
type: PropType<
|
|
5
|
+
type: PropType<BadgeSize>;
|
|
6
6
|
default: () => any;
|
|
7
7
|
validator(value: string): boolean;
|
|
8
8
|
};
|
|
@@ -22,11 +22,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
};
|
|
23
23
|
class: {
|
|
24
24
|
type: PropType<any>;
|
|
25
|
-
default:
|
|
25
|
+
default: () => "";
|
|
26
26
|
};
|
|
27
27
|
ui: {
|
|
28
|
-
type: PropType<
|
|
29
|
-
default:
|
|
28
|
+
type: PropType<any>;
|
|
29
|
+
default: () => {};
|
|
30
30
|
};
|
|
31
31
|
}, {
|
|
32
32
|
attrs: import("vue").ComputedRef<Pick<{
|
|
@@ -35,7 +35,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
35
|
badgeClass: import("vue").ComputedRef<string>;
|
|
36
36
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
37
|
size: {
|
|
38
|
-
type: PropType<
|
|
38
|
+
type: PropType<BadgeSize>;
|
|
39
39
|
default: () => any;
|
|
40
40
|
validator(value: string): boolean;
|
|
41
41
|
};
|
|
@@ -55,18 +55,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
55
55
|
};
|
|
56
56
|
class: {
|
|
57
57
|
type: PropType<any>;
|
|
58
|
-
default:
|
|
58
|
+
default: () => "";
|
|
59
59
|
};
|
|
60
60
|
ui: {
|
|
61
|
-
type: PropType<
|
|
62
|
-
default:
|
|
61
|
+
type: PropType<any>;
|
|
62
|
+
default: () => {};
|
|
63
63
|
};
|
|
64
64
|
}>>, {
|
|
65
|
+
size: BadgeSize;
|
|
66
|
+
ui: any;
|
|
65
67
|
color: any;
|
|
66
|
-
ui: Partial<any>;
|
|
67
68
|
class: any;
|
|
68
69
|
label: string | number;
|
|
69
70
|
variant: BadgeVariant;
|
|
70
|
-
size: "sm" | "md" | "xs" | "lg";
|
|
71
71
|
}, {}>;
|
|
72
72
|
export default _default;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</slot>
|
|
6
6
|
|
|
7
7
|
<slot>
|
|
8
|
-
<span v-if="label" :class="[truncate ?
|
|
8
|
+
<span v-if="label" :class="[truncate ? ui.truncate : '']">
|
|
9
9
|
{{ label }}
|
|
10
10
|
</span>
|
|
11
11
|
</slot>
|
|
@@ -23,6 +23,7 @@ import UIcon from "../elements/Icon.vue";
|
|
|
23
23
|
import ULink from "../elements/Link.vue";
|
|
24
24
|
import { useUI } from "../../composables/useUI";
|
|
25
25
|
import { mergeConfig } from "../../utils";
|
|
26
|
+
import { useInjectButtonGroup } from "../../composables/useButtonGroup";
|
|
26
27
|
import appConfig from "#build/app.config";
|
|
27
28
|
import { button } from "#ui/ui.config";
|
|
28
29
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.button, button);
|
|
@@ -115,15 +116,16 @@ export default defineComponent({
|
|
|
115
116
|
},
|
|
116
117
|
class: {
|
|
117
118
|
type: [String, Object, Array],
|
|
118
|
-
default:
|
|
119
|
+
default: () => ""
|
|
119
120
|
},
|
|
120
121
|
ui: {
|
|
121
122
|
type: Object,
|
|
122
|
-
default:
|
|
123
|
+
default: () => ({})
|
|
123
124
|
}
|
|
124
125
|
},
|
|
125
126
|
setup(props, { slots }) {
|
|
126
127
|
const { ui, attrs } = useUI("button", toRef(props, "ui"), config);
|
|
128
|
+
const { size, rounded } = useInjectButtonGroup({ ui, props });
|
|
127
129
|
const isLeading = computed(() => {
|
|
128
130
|
return props.icon && props.leading || props.icon && !props.trailing || props.loading && !props.trailing || props.leadingIcon;
|
|
129
131
|
});
|
|
@@ -136,12 +138,12 @@ export default defineComponent({
|
|
|
136
138
|
return twMerge(twJoin(
|
|
137
139
|
ui.value.base,
|
|
138
140
|
ui.value.font,
|
|
139
|
-
|
|
140
|
-
ui.value.size[
|
|
141
|
-
ui.value.gap[
|
|
142
|
-
props.padded && ui.value[isSquare.value ? "square" : "padding"][
|
|
141
|
+
rounded.value,
|
|
142
|
+
ui.value.size[size.value],
|
|
143
|
+
ui.value.gap[size.value],
|
|
144
|
+
props.padded && ui.value[isSquare.value ? "square" : "padding"][size.value],
|
|
143
145
|
variant?.replaceAll("{color}", props.color),
|
|
144
|
-
props.block ?
|
|
146
|
+
props.block ? ui.value.block : ui.value.inline
|
|
145
147
|
), props.class);
|
|
146
148
|
});
|
|
147
149
|
const leadingIconName = computed(() => {
|
|
@@ -159,18 +161,20 @@ export default defineComponent({
|
|
|
159
161
|
const leadingIconClass = computed(() => {
|
|
160
162
|
return twJoin(
|
|
161
163
|
ui.value.icon.base,
|
|
162
|
-
ui.value.icon.size[
|
|
163
|
-
props.loading &&
|
|
164
|
+
ui.value.icon.size[size.value],
|
|
165
|
+
props.loading && ui.value.icon.loading
|
|
164
166
|
);
|
|
165
167
|
});
|
|
166
168
|
const trailingIconClass = computed(() => {
|
|
167
169
|
return twJoin(
|
|
168
170
|
ui.value.icon.base,
|
|
169
|
-
ui.value.icon.size[
|
|
170
|
-
props.loading && !isLeading.value &&
|
|
171
|
+
ui.value.icon.size[size.value],
|
|
172
|
+
props.loading && !isLeading.value && ui.value.icon.loading
|
|
171
173
|
);
|
|
172
174
|
});
|
|
173
175
|
return {
|
|
176
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
177
|
+
ui,
|
|
174
178
|
attrs,
|
|
175
179
|
isLeading,
|
|
176
180
|
isTrailing,
|