numori-ui 0.1.1 → 0.2.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/CHANGELOG.md +50 -0
- package/README.md +17 -8
- package/dist/components/Breadcrumb.js +107 -0
- package/dist/components/Breadcrumb.js.map +1 -0
- package/dist/components/Card.js +174 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/IconTile.js +96 -0
- package/dist/components/IconTile.js.map +1 -0
- package/dist/components/SectionHeading.js +142 -0
- package/dist/components/SectionHeading.js.map +1 -0
- package/dist/components/Segmented.js +148 -0
- package/dist/components/Segmented.js.map +1 -0
- package/dist/components/index.js +61 -51
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +32 -27
- package/dist/index.js.map +1 -1
- package/dist/manifest.js +5 -0
- package/dist/manifest.js.map +1 -1
- package/package.json +2 -1
- package/src/components/Breadcrumb.vue +89 -0
- package/src/components/Card.vue +169 -0
- package/src/components/IconTile.vue +100 -0
- package/src/components/SectionHeading.vue +121 -0
- package/src/components/Segmented.vue +152 -0
- package/src/components/index.js +15 -0
- package/src/manifest.js +5 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
|
|
2
|
+
//#region src/components/SectionHeading.vue
|
|
3
|
+
var _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "mb-3 text-sm font-semibold uppercase tracking-wide text-primary-600 dark:text-primary-400"
|
|
6
|
+
};
|
|
7
|
+
var _sfc_main = {
|
|
8
|
+
__name: "SectionHeading",
|
|
9
|
+
props: {
|
|
10
|
+
/**
|
|
11
|
+
* Small uppercase label above the heading.
|
|
12
|
+
* @type {string}
|
|
13
|
+
* @default ''
|
|
14
|
+
*/
|
|
15
|
+
eyebrow: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* Heading text. Omit if using the `title` slot.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @default ''
|
|
23
|
+
*/
|
|
24
|
+
title: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Supporting paragraph below the heading.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @default ''
|
|
32
|
+
*/
|
|
33
|
+
subtitle: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Heading tag, chosen to match the document outline — not the visual size.
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @default 'h2'
|
|
41
|
+
* @values 'h1' | 'h2' | 'h3' | 'h4'
|
|
42
|
+
*/
|
|
43
|
+
level: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "h2"
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Visual size of the heading, independent of `level`.
|
|
49
|
+
* @type {string}
|
|
50
|
+
* @default 'md'
|
|
51
|
+
* @values 'sm' | 'md' | 'lg'
|
|
52
|
+
*/
|
|
53
|
+
size: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "md"
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Horizontal alignment.
|
|
59
|
+
* @type {string}
|
|
60
|
+
* @default 'left'
|
|
61
|
+
* @values 'left' | 'center'
|
|
62
|
+
*/
|
|
63
|
+
align: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "left"
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Optional id on the heading, so it can be targeted by `aria-labelledby`.
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
id: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: void 0
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
setup(__props) {
|
|
78
|
+
/**
|
|
79
|
+
* UiSectionHeading — the eyebrow / heading / standfirst trio used at the top of
|
|
80
|
+
* a page or the start of a section.
|
|
81
|
+
*
|
|
82
|
+
* `level` and the visual `size` are independent on purpose: the heading tag
|
|
83
|
+
* follows the document outline (an `h3` nested inside an `h2` section) while the
|
|
84
|
+
* size follows the layout, so neither is sacrificed for the other. The block is
|
|
85
|
+
* layout-neutral — no outer margins or width cap — so the caller controls
|
|
86
|
+
* spacing and measure.
|
|
87
|
+
*
|
|
88
|
+
* @example Section heading
|
|
89
|
+
* <UiSectionHeading
|
|
90
|
+
* eyebrow="Pricing"
|
|
91
|
+
* title="One price, everything included"
|
|
92
|
+
* subtitle="No tiers, no add-ons."
|
|
93
|
+
* />
|
|
94
|
+
*
|
|
95
|
+
* @example Centred page hero with a nested level
|
|
96
|
+
* <UiSectionHeading centred size="lg" level="h1" title="Own your notes" />
|
|
97
|
+
*
|
|
98
|
+
* @slot title — Overrides the `title` prop for rich heading content.
|
|
99
|
+
* @slot subtitle — Overrides the `subtitle` prop.
|
|
100
|
+
* @slot default — Extra content below the standfirst, e.g. a call to action.
|
|
101
|
+
*/
|
|
102
|
+
const props = __props;
|
|
103
|
+
const titleClasses = computed(() => {
|
|
104
|
+
const sizeMap = {
|
|
105
|
+
sm: "text-xl font-bold sm:text-2xl",
|
|
106
|
+
md: "text-2xl font-bold sm:text-3xl",
|
|
107
|
+
lg: "text-3xl font-bold sm:text-4xl"
|
|
108
|
+
};
|
|
109
|
+
return sizeMap[props.size] || sizeMap.md;
|
|
110
|
+
});
|
|
111
|
+
const subtitleClasses = computed(() => {
|
|
112
|
+
const sizeMap = {
|
|
113
|
+
sm: "mt-3 text-base text-gray-600 dark:text-gray-400",
|
|
114
|
+
md: "mt-4 text-base text-gray-600 sm:text-lg dark:text-gray-400",
|
|
115
|
+
lg: "mt-4 text-lg text-gray-600 dark:text-gray-400"
|
|
116
|
+
};
|
|
117
|
+
const base = sizeMap[props.size] || sizeMap.md;
|
|
118
|
+
return props.align === "center" ? `${base} mx-auto` : base;
|
|
119
|
+
});
|
|
120
|
+
return (_ctx, _cache) => {
|
|
121
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(__props.align === "center" ? "text-center" : "") }, [
|
|
122
|
+
__props.eyebrow ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(__props.eyebrow), 1)) : createCommentVNode("", true),
|
|
123
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.level), {
|
|
124
|
+
id: __props.id,
|
|
125
|
+
class: normalizeClass(titleClasses.value)
|
|
126
|
+
}, {
|
|
127
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])]),
|
|
128
|
+
_: 3
|
|
129
|
+
}, 8, ["id", "class"])),
|
|
130
|
+
__props.subtitle || _ctx.$slots.subtitle ? (openBlock(), createElementBlock("p", {
|
|
131
|
+
key: 1,
|
|
132
|
+
class: normalizeClass(subtitleClasses.value)
|
|
133
|
+
}, [renderSlot(_ctx.$slots, "subtitle", {}, () => [createTextVNode(toDisplayString(__props.subtitle), 1)])], 2)) : createCommentVNode("", true),
|
|
134
|
+
renderSlot(_ctx.$slots, "default")
|
|
135
|
+
], 2);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
//#endregion
|
|
140
|
+
export { _sfc_main as default };
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=SectionHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionHeading.js","names":["$slots"],"sources":["../../src/components/SectionHeading.vue"],"sourcesContent":["<template>\n <div :class=\"align === 'center' ? 'text-center' : ''\">\n <p\n v-if=\"eyebrow\"\n class=\"mb-3 text-sm font-semibold uppercase tracking-wide text-primary-600 dark:text-primary-400\"\n >\n {{ eyebrow }}\n </p>\n\n <component :is=\"level\" :id=\"id\" :class=\"titleClasses\">\n <slot name=\"title\">{{ title }}</slot>\n </component>\n\n <p v-if=\"subtitle || $slots.subtitle\" :class=\"subtitleClasses\">\n <slot name=\"subtitle\">{{ subtitle }}</slot>\n </p>\n\n <slot />\n </div>\n</template>\n\n<script setup>\n/**\n * UiSectionHeading — the eyebrow / heading / standfirst trio used at the top of\n * a page or the start of a section.\n *\n * `level` and the visual `size` are independent on purpose: the heading tag\n * follows the document outline (an `h3` nested inside an `h2` section) while the\n * size follows the layout, so neither is sacrificed for the other. The block is\n * layout-neutral — no outer margins or width cap — so the caller controls\n * spacing and measure.\n *\n * @example Section heading\n * <UiSectionHeading\n * eyebrow=\"Pricing\"\n * title=\"One price, everything included\"\n * subtitle=\"No tiers, no add-ons.\"\n * />\n *\n * @example Centred page hero with a nested level\n * <UiSectionHeading centred size=\"lg\" level=\"h1\" title=\"Own your notes\" />\n *\n * @slot title — Overrides the `title` prop for rich heading content.\n * @slot subtitle — Overrides the `subtitle` prop.\n * @slot default — Extra content below the standfirst, e.g. a call to action.\n */\nimport { computed } from 'vue'\n\nconst props = defineProps({\n /**\n * Small uppercase label above the heading.\n * @type {string}\n * @default ''\n */\n eyebrow: { type: String, default: '' },\n\n /**\n * Heading text. Omit if using the `title` slot.\n * @type {string}\n * @default ''\n */\n title: { type: String, default: '' },\n\n /**\n * Supporting paragraph below the heading.\n * @type {string}\n * @default ''\n */\n subtitle: { type: String, default: '' },\n\n /**\n * Heading tag, chosen to match the document outline — not the visual size.\n * @type {string}\n * @default 'h2'\n * @values 'h1' | 'h2' | 'h3' | 'h4'\n */\n level: { type: String, default: 'h2' },\n\n /**\n * Visual size of the heading, independent of `level`.\n * @type {string}\n * @default 'md'\n * @values 'sm' | 'md' | 'lg'\n */\n size: { type: String, default: 'md' },\n\n /**\n * Horizontal alignment.\n * @type {string}\n * @default 'left'\n * @values 'left' | 'center'\n */\n align: { type: String, default: 'left' },\n\n /**\n * Optional id on the heading, so it can be targeted by `aria-labelledby`.\n * @type {string}\n * @default undefined\n */\n id: { type: String, default: undefined },\n})\n\nconst titleClasses = computed(() => {\n const sizeMap = {\n sm: 'text-xl font-bold sm:text-2xl',\n md: 'text-2xl font-bold sm:text-3xl',\n lg: 'text-3xl font-bold sm:text-4xl',\n }\n return sizeMap[props.size] || sizeMap.md\n})\n\nconst subtitleClasses = computed(() => {\n const sizeMap = {\n sm: 'mt-3 text-base text-gray-600 dark:text-gray-400',\n md: 'mt-4 text-base text-gray-600 sm:text-lg dark:text-gray-400',\n lg: 'mt-4 text-lg text-gray-600 dark:text-gray-400',\n }\n const base = sizeMap[props.size] || sizeMap.md\n return props.align === 'center' ? `${base} mx-auto` : base\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDA,MAAM,QAAQ;EAsDd,MAAM,eAAe,eAAe;GAClC,MAAM,UAAU;IACd,IAAI;IACJ,IAAI;IACJ,IAAI;GACN;GACA,OAAO,QAAQ,MAAM,SAAS,QAAQ;EACxC,CAAC;EAED,MAAM,kBAAkB,eAAe;GACrC,MAAM,UAAU;IACd,IAAI;IACJ,IAAI;IACJ,IAAI;GACN;GACA,MAAM,OAAO,QAAQ,MAAM,SAAS,QAAQ;GAC5C,OAAO,MAAM,UAAU,WAAW,GAAG,KAAK,YAAY;EACxD,CAAC;;GAtHC,OAAA,UAAA,GAAA,mBAiBM,OAAA,EAjBA,OAAK,eAAE,QAAA,UAAK,WAAA,gBAAA,EAAA,EAAA,GAAA;IAER,QAAA,WADR,UAAA,GAAA,mBAKI,KALJ,YAKI,gBADC,QAAA,OAAO,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;KAGZ,UAAA,GAAA,YAEY,wBAFI,QAAA,KAAK,GAAA;KAAG,IAAI,QAAA;KAAK,OAAK,eAAE,aAAA,KAAY;;KAClD,SAAA,cAAqC,CAArC,WAAqC,KAAA,QAAA,SAAA,CAAA,SAAA,CAAf,gBAAA,gBAAA,QAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;IAGpB,QAAA,YAAYA,KAAAA,OAAO,YAA5B,UAAA,GAAA,mBAEI,KAAA;;KAFmC,OAAK,eAAE,gBAAA,KAAe;IAC3D,GAAA,CAAA,WAA2C,KAAA,QAAA,YAAA,CAAA,SAAA,CAAlB,gBAAA,gBAAA,QAAA,QAAQ,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;IAGnC,WAAQ,KAAA,QAAA,SAAA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icons/Icon.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, normalizeClass, normalizeStyle, openBlock, renderList, toDisplayString } from "vue";
|
|
3
|
+
//#region src/components/Segmented.vue
|
|
4
|
+
var _hoisted_1 = ["aria-label"];
|
|
5
|
+
var _hoisted_2 = [
|
|
6
|
+
"aria-pressed",
|
|
7
|
+
"disabled",
|
|
8
|
+
"onClick"
|
|
9
|
+
];
|
|
10
|
+
var activeTextClass = "text-white";
|
|
11
|
+
var idleTextClass = "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100";
|
|
12
|
+
var _sfc_main = {
|
|
13
|
+
__name: "Segmented",
|
|
14
|
+
props: {
|
|
15
|
+
/**
|
|
16
|
+
* Selected value (v-model), matched against each option's `value`.
|
|
17
|
+
* @type {string | number}
|
|
18
|
+
* @default undefined
|
|
19
|
+
*/
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* The options. Each is `{ value, label, icon?, disabled? }`.
|
|
26
|
+
* @type {Array<{ value: string|number, label: string, icon?: string, disabled?: boolean }>}
|
|
27
|
+
*/
|
|
28
|
+
options: {
|
|
29
|
+
type: Array,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Size preset controlling padding and font size.
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @default 'md'
|
|
36
|
+
* @values 'sm' | 'md'
|
|
37
|
+
*/
|
|
38
|
+
size: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "md"
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Corner shape of the track and pill.
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @default 'pill'
|
|
46
|
+
* @values 'pill' | 'rounded'
|
|
47
|
+
*/
|
|
48
|
+
shape: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "pill"
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Accessible name for the group. Omit if you label it with an external
|
|
54
|
+
* heading via `aria-labelledby` (which falls through to the root).
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @default undefined
|
|
57
|
+
*/
|
|
58
|
+
ariaLabel: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: void 0
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
emits: ["update:modelValue"],
|
|
64
|
+
setup(__props, { emit: __emit }) {
|
|
65
|
+
/**
|
|
66
|
+
* UiSegmented — a segmented control: pick one of a few named options from a row
|
|
67
|
+
* of buttons, with a pill that slides to the active choice.
|
|
68
|
+
*
|
|
69
|
+
* This is a set of toggle buttons (`role="group"` + `aria-pressed`), not a
|
|
70
|
+
* switch, because the choice is between named options rather than on/off — "the
|
|
71
|
+
* second option is off" is not something a screen reader should say. Segments
|
|
72
|
+
* are equal width so the pill can slide by whole columns.
|
|
73
|
+
*
|
|
74
|
+
* For an on/off control use `UiToggle`; for many options or a searchable list
|
|
75
|
+
* use `UiSelect`.
|
|
76
|
+
*
|
|
77
|
+
* @example Billing period
|
|
78
|
+
* <UiSegmented
|
|
79
|
+
* v-model="billing"
|
|
80
|
+
* :options="[
|
|
81
|
+
* { value: 'monthly', label: 'Monthly' },
|
|
82
|
+
* { value: 'yearly', label: 'Yearly' },
|
|
83
|
+
* ]"
|
|
84
|
+
* aria-label="Billing period"
|
|
85
|
+
* />
|
|
86
|
+
*
|
|
87
|
+
* @example With icons and a labelled-by heading
|
|
88
|
+
* <h2 id="view-h" class="sr-only">View</h2>
|
|
89
|
+
* <UiSegmented v-model="view" :options="views" aria-labelledby="view-h" />
|
|
90
|
+
*
|
|
91
|
+
* @emits {string|number} update:modelValue — the chosen option's `value`
|
|
92
|
+
*/
|
|
93
|
+
const props = __props;
|
|
94
|
+
const emit = __emit;
|
|
95
|
+
const count = computed(() => props.options?.length || 1);
|
|
96
|
+
const isActive = (option) => option.value === props.modelValue;
|
|
97
|
+
const activeIndex = computed(() => {
|
|
98
|
+
const i = (props.options ?? []).findIndex((o) => o.value === props.modelValue);
|
|
99
|
+
return i === -1 ? 0 : i;
|
|
100
|
+
});
|
|
101
|
+
function select(option, index) {
|
|
102
|
+
if (option.disabled) return;
|
|
103
|
+
emit("update:modelValue", option.value);
|
|
104
|
+
}
|
|
105
|
+
const trackClass = computed(() => props.shape === "rounded" ? "rounded-xl" : "rounded-full");
|
|
106
|
+
const buttonShapeClass = computed(() => props.shape === "rounded" ? "rounded-lg" : "rounded-full");
|
|
107
|
+
const pillClass = computed(() => props.shape === "rounded" ? "rounded-lg" : "rounded-full");
|
|
108
|
+
const buttonSizeClass = computed(() => props.size === "sm" ? "px-3 py-1 text-xs" : "px-4 py-1.5 text-sm");
|
|
109
|
+
const iconSizeClass = computed(() => props.size === "sm" ? "size-3.5" : "size-4");
|
|
110
|
+
const pillStyle = computed(() => ({
|
|
111
|
+
width: `calc((100% - 0.5rem) / ${count.value})`,
|
|
112
|
+
transform: `translateX(calc(${activeIndex.value} * 100%))`
|
|
113
|
+
}));
|
|
114
|
+
return (_ctx, _cache) => {
|
|
115
|
+
return openBlock(), createElementBlock("div", {
|
|
116
|
+
role: "group",
|
|
117
|
+
"aria-label": __props.ariaLabel,
|
|
118
|
+
class: normalizeClass(["relative inline-grid p-1", [trackClass.value, "border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-900"]]),
|
|
119
|
+
style: normalizeStyle({ gridTemplateColumns: `repeat(${count.value}, minmax(0, 1fr))` })
|
|
120
|
+
}, [createElementVNode("span", {
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
class: normalizeClass(["pointer-events-none absolute bottom-1 left-1 top-1 bg-primary-500 shadow-sm transition-transform duration-300 ease-out motion-reduce:transition-none", pillClass.value]),
|
|
123
|
+
style: normalizeStyle(pillStyle.value)
|
|
124
|
+
}, null, 6), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
|
|
125
|
+
return openBlock(), createElementBlock("button", {
|
|
126
|
+
key: option.value,
|
|
127
|
+
type: "button",
|
|
128
|
+
"aria-pressed": isActive(option) ? "true" : "false",
|
|
129
|
+
disabled: option.disabled,
|
|
130
|
+
class: normalizeClass(["relative z-10 inline-flex items-center justify-center gap-1.5 font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50", [
|
|
131
|
+
buttonSizeClass.value,
|
|
132
|
+
buttonShapeClass.value,
|
|
133
|
+
isActive(option) ? activeTextClass : idleTextClass
|
|
134
|
+
]]),
|
|
135
|
+
onClick: ($event) => select(option, index)
|
|
136
|
+
}, [option.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
137
|
+
key: 0,
|
|
138
|
+
name: option.icon,
|
|
139
|
+
class: normalizeClass(iconSizeClass.value)
|
|
140
|
+
}, null, 8, ["name", "class"])) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(option.label), 1)], 10, _hoisted_2);
|
|
141
|
+
}), 128))], 14, _hoisted_1);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
export { _sfc_main as default };
|
|
147
|
+
|
|
148
|
+
//# sourceMappingURL=Segmented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Segmented.js","names":[],"sources":["../../src/components/Segmented.vue"],"sourcesContent":["<template>\n <div\n role=\"group\"\n :aria-label=\"ariaLabel\"\n class=\"relative inline-grid p-1\"\n :class=\"[trackClass, 'border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-900']\"\n :style=\"{ gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` }\"\n >\n <!--\n A single pill slides between segments rather than each segment owning its\n own background, so the movement animates. Segments are equal-width, so the\n pill's width is one column and it translates by whole columns. `top/bottom/\n left` inset it inside the track's padding; `%` in translateX resolves\n against the pill's own (one-column) width.\n -->\n <span\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute bottom-1 left-1 top-1 bg-primary-500 shadow-sm transition-transform duration-300 ease-out motion-reduce:transition-none\"\n :class=\"pillClass\"\n :style=\"pillStyle\"\n />\n\n <button\n v-for=\"(option, index) in options\"\n :key=\"option.value\"\n type=\"button\"\n :aria-pressed=\"isActive(option) ? 'true' : 'false'\"\n :disabled=\"option.disabled\"\n class=\"relative z-10 inline-flex items-center justify-center gap-1.5 font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50\"\n :class=\"[\n buttonSizeClass,\n buttonShapeClass,\n isActive(option) ? activeTextClass : idleTextClass,\n ]\"\n @click=\"select(option, index)\"\n >\n <UiIcon v-if=\"option.icon\" :name=\"option.icon\" :class=\"iconSizeClass\" />\n {{ option.label }}\n </button>\n </div>\n</template>\n\n<script setup>\n/**\n * UiSegmented — a segmented control: pick one of a few named options from a row\n * of buttons, with a pill that slides to the active choice.\n *\n * This is a set of toggle buttons (`role=\"group\"` + `aria-pressed`), not a\n * switch, because the choice is between named options rather than on/off — \"the\n * second option is off\" is not something a screen reader should say. Segments\n * are equal width so the pill can slide by whole columns.\n *\n * For an on/off control use `UiToggle`; for many options or a searchable list\n * use `UiSelect`.\n *\n * @example Billing period\n * <UiSegmented\n * v-model=\"billing\"\n * :options=\"[\n * { value: 'monthly', label: 'Monthly' },\n * { value: 'yearly', label: 'Yearly' },\n * ]\"\n * aria-label=\"Billing period\"\n * />\n *\n * @example With icons and a labelled-by heading\n * <h2 id=\"view-h\" class=\"sr-only\">View</h2>\n * <UiSegmented v-model=\"view\" :options=\"views\" aria-labelledby=\"view-h\" />\n *\n * @emits {string|number} update:modelValue — the chosen option's `value`\n */\nimport { computed } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\n\nconst props = defineProps({\n /**\n * Selected value (v-model), matched against each option's `value`.\n * @type {string | number}\n * @default undefined\n */\n modelValue: { type: [String, Number], default: undefined },\n\n /**\n * The options. Each is `{ value, label, icon?, disabled? }`.\n * @type {Array<{ value: string|number, label: string, icon?: string, disabled?: boolean }>}\n */\n options: { type: Array, required: true },\n\n /**\n * Size preset controlling padding and font size.\n * @type {string}\n * @default 'md'\n * @values 'sm' | 'md'\n */\n size: { type: String, default: 'md' },\n\n /**\n * Corner shape of the track and pill.\n * @type {string}\n * @default 'pill'\n * @values 'pill' | 'rounded'\n */\n shape: { type: String, default: 'pill' },\n\n /**\n * Accessible name for the group. Omit if you label it with an external\n * heading via `aria-labelledby` (which falls through to the root).\n * @type {string}\n * @default undefined\n */\n ariaLabel: { type: String, default: undefined },\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst count = computed(() => props.options?.length || 1)\n\nconst isActive = (option) => option.value === props.modelValue\n\nconst activeIndex = computed(() => {\n const i = (props.options ?? []).findIndex((o) => o.value === props.modelValue)\n return i === -1 ? 0 : i\n})\n\nfunction select(option, index) {\n if (option.disabled) return\n emit('update:modelValue', option.value)\n // index is accepted for symmetry with the template call site; the value is\n // what identifies the option.\n void index\n}\n\nconst trackClass = computed(() => (props.shape === 'rounded' ? 'rounded-xl' : 'rounded-full'))\nconst buttonShapeClass = computed(() => (props.shape === 'rounded' ? 'rounded-lg' : 'rounded-full'))\nconst pillClass = computed(() => (props.shape === 'rounded' ? 'rounded-lg' : 'rounded-full'))\n\nconst buttonSizeClass = computed(() =>\n props.size === 'sm' ? 'px-3 py-1 text-xs' : 'px-4 py-1.5 text-sm',\n)\nconst iconSizeClass = computed(() => (props.size === 'sm' ? 'size-3.5' : 'size-4'))\n\nconst activeTextClass = 'text-white'\nconst idleTextClass =\n 'text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100'\n\nconst pillStyle = computed(() => ({\n // Track padding is p-1 (0.25rem) each side, so the usable width is\n // `100% - 0.5rem`; one segment is that divided by the option count.\n width: `calc((100% - 0.5rem) / ${count.value})`,\n transform: `translateX(calc(${activeIndex.value} * 100%))`,\n}))\n</script>\n"],"mappings":";;;;;;;;;AA6IA,IAAM,kBAAkB;AACxB,IAAM,gBACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EArEF,MAAM,QAAQ;EAuCd,MAAM,OAAO;EAEb,MAAM,QAAQ,eAAe,MAAM,SAAS,UAAU,CAAC;EAEvD,MAAM,YAAY,WAAW,OAAO,UAAU,MAAM;EAEpD,MAAM,cAAc,eAAe;GACjC,MAAM,KAAK,MAAM,WAAW,CAAC,EAAA,CAAG,WAAW,MAAM,EAAE,UAAU,MAAM,UAAU;GAC7E,OAAO,MAAM,KAAK,IAAI;EACxB,CAAC;EAED,SAAS,OAAO,QAAQ,OAAO;GAC7B,IAAI,OAAO,UAAU;GACrB,KAAK,qBAAqB,OAAO,KAAK;EAIxC;EAEA,MAAM,aAAa,eAAgB,MAAM,UAAU,YAAY,eAAe,cAAe;EAC7F,MAAM,mBAAmB,eAAgB,MAAM,UAAU,YAAY,eAAe,cAAe;EACnG,MAAM,YAAY,eAAgB,MAAM,UAAU,YAAY,eAAe,cAAe;EAE5F,MAAM,kBAAkB,eACtB,MAAM,SAAS,OAAO,sBAAsB,qBAC9C;EACA,MAAM,gBAAgB,eAAgB,MAAM,SAAS,OAAO,aAAa,QAAS;EAMlF,MAAM,YAAY,gBAAgB;GAGhC,OAAO,0BAA0B,MAAM,MAAM;GAC7C,WAAW,mBAAmB,YAAY,MAAM;EAClD,EAAE;;GArJA,OAAA,UAAA,GAAA,mBAsCM,OAAA;IArCJ,MAAK;IACJ,cAAY,QAAA;IACb,OAAK,eAAA,CAAC,4BAA0B,CACvB,WAAA,OAAU,yEAAA,CAAA,CAAA;IAClB,OAAK,eAAA,EAAA,qBAAA,UAAmC,MAAA,MAAK,mBAAA,CAAA;GAS9C,GAAA,CAAA,mBAKE,QAAA;IAJA,eAAY;IACZ,OAAK,eAAA,CAAC,wJACE,UAAA,KAAS,CAAA;IAChB,OAAK,eAAE,UAAA,KAAS;GAGnB,GAAA,MAAA,CAAA,IAAA,UAAA,IAAA,GAAA,mBAgBS,UAAA,MAAA,WAfmB,QAAA,UAAlB,QAAQ,UAAK;IADvB,OAAA,UAAA,GAAA,mBAgBS,UAAA;KAdN,KAAK,OAAO;KACb,MAAK;KACJ,gBAAc,SAAS,MAAM,IAAA,SAAA;KAC7B,UAAU,OAAO;KAClB,OAAK,eAAA,CAAC,iJAA+I;MACnI,gBAAA;MAAyB,iBAAA;MAA0B,SAAS,MAAM,IAAI,kBAAkB;;KAKzG,UAAK,WAAE,OAAO,QAAQ,KAAK;IAEd,GAAA,CAAA,OAAO,QAArB,UAAA,GAAA,YAAwE,aAAA;;KAA5C,MAAM,OAAO;KAAO,OAAK,eAAE,cAAA,KAAa;IAAI,GAAA,MAAA,GAAA,CAAA,QAAA,OAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAAA,gBAAA,MACxE,gBAAG,OAAO,KAAK,GAAA,CAAA,CAAA,GAAA,IAAA,UAAA"}
|
package/dist/components/index.js
CHANGED
|
@@ -2,31 +2,36 @@ import _sfc_main from "../icons/Icon.js";
|
|
|
2
2
|
import _sfc_main$1 from "./Alert.js";
|
|
3
3
|
import _sfc_main$2 from "./Avatar.js";
|
|
4
4
|
import _sfc_main$3 from "./Badge.js";
|
|
5
|
-
import _sfc_main$4 from "./
|
|
6
|
-
import _sfc_main$5 from "./
|
|
7
|
-
import _sfc_main$6 from "./
|
|
8
|
-
import _sfc_main$7 from "./
|
|
9
|
-
import _sfc_main$8 from "./
|
|
10
|
-
import _sfc_main$9 from "./
|
|
11
|
-
import _sfc_main$10 from "./
|
|
12
|
-
import _sfc_main$11 from "./
|
|
13
|
-
import _sfc_main$12 from "./
|
|
14
|
-
import _sfc_main$13 from "./
|
|
15
|
-
import _sfc_main$14 from "./
|
|
16
|
-
import _sfc_main$15 from "./
|
|
17
|
-
import _sfc_main$16 from "./
|
|
18
|
-
import _sfc_main$17 from "./
|
|
19
|
-
import _sfc_main$18 from "./
|
|
20
|
-
import _sfc_main$19 from "./
|
|
21
|
-
import _sfc_main$20 from "./
|
|
22
|
-
import _sfc_main$21 from "./
|
|
23
|
-
import _sfc_main$22 from "./
|
|
24
|
-
import _sfc_main$23 from "./
|
|
25
|
-
import _sfc_main$24 from "./
|
|
26
|
-
import _sfc_main$25 from "./
|
|
27
|
-
import _sfc_main$26 from "./
|
|
28
|
-
import _sfc_main$27 from "./
|
|
29
|
-
import _sfc_main$28 from "./
|
|
5
|
+
import _sfc_main$4 from "./Breadcrumb.js";
|
|
6
|
+
import _sfc_main$5 from "./Button.js";
|
|
7
|
+
import _sfc_main$6 from "./ButtonsGroup.js";
|
|
8
|
+
import _sfc_main$7 from "./Card.js";
|
|
9
|
+
import _sfc_main$8 from "./Checkbox.js";
|
|
10
|
+
import _sfc_main$9 from "./Divider.js";
|
|
11
|
+
import _sfc_main$10 from "./Dropdown.js";
|
|
12
|
+
import _sfc_main$11 from "./DropdownItem.js";
|
|
13
|
+
import _sfc_main$12 from "./DropdownRow.js";
|
|
14
|
+
import _sfc_main$13 from "./DropdownSubmenu.js";
|
|
15
|
+
import _sfc_main$14 from "./FileInput.js";
|
|
16
|
+
import _sfc_main$15 from "./FormField.js";
|
|
17
|
+
import _sfc_main$16 from "./IconTile.js";
|
|
18
|
+
import _sfc_main$17 from "./Input.js";
|
|
19
|
+
import _sfc_main$18 from "./Kbd.js";
|
|
20
|
+
import _sfc_main$19 from "./ListMenu.js";
|
|
21
|
+
import _sfc_main$20 from "./ListMenuItem.js";
|
|
22
|
+
import _sfc_main$21 from "./Modal.js";
|
|
23
|
+
import _sfc_main$22 from "./Numpad.js";
|
|
24
|
+
import _sfc_main$23 from "./Popup.js";
|
|
25
|
+
import _sfc_main$24 from "./ProgressBar.js";
|
|
26
|
+
import _sfc_main$25 from "./Prompt.js";
|
|
27
|
+
import _sfc_main$26 from "./Radio.js";
|
|
28
|
+
import _sfc_main$27 from "./SectionHeading.js";
|
|
29
|
+
import _sfc_main$28 from "./Segmented.js";
|
|
30
|
+
import _sfc_main$29 from "./Select.js";
|
|
31
|
+
import _sfc_main$30 from "./Slider.js";
|
|
32
|
+
import _sfc_main$31 from "./Stepper.js";
|
|
33
|
+
import _sfc_main$32 from "./Toggle.js";
|
|
34
|
+
import _sfc_main$33 from "./Tooltip.js";
|
|
30
35
|
//#region src/components/index.js
|
|
31
36
|
/**
|
|
32
37
|
* Real component imports, re-exported under the default `Ui` prefix.
|
|
@@ -48,34 +53,39 @@ var components = {
|
|
|
48
53
|
Alert: _sfc_main$1,
|
|
49
54
|
Avatar: _sfc_main$2,
|
|
50
55
|
Badge: _sfc_main$3,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
56
|
+
Breadcrumb: _sfc_main$4,
|
|
57
|
+
Button: _sfc_main$5,
|
|
58
|
+
ButtonsGroup: _sfc_main$6,
|
|
59
|
+
Card: _sfc_main$7,
|
|
60
|
+
Checkbox: _sfc_main$8,
|
|
61
|
+
Divider: _sfc_main$9,
|
|
62
|
+
Dropdown: _sfc_main$10,
|
|
63
|
+
DropdownItem: _sfc_main$11,
|
|
64
|
+
DropdownRow: _sfc_main$12,
|
|
65
|
+
DropdownSubmenu: _sfc_main$13,
|
|
66
|
+
FileInput: _sfc_main$14,
|
|
67
|
+
FormField: _sfc_main$15,
|
|
68
|
+
IconTile: _sfc_main$16,
|
|
69
|
+
Input: _sfc_main$17,
|
|
70
|
+
Kbd: _sfc_main$18,
|
|
71
|
+
ListMenu: _sfc_main$19,
|
|
72
|
+
ListMenuItem: _sfc_main$20,
|
|
73
|
+
Modal: _sfc_main$21,
|
|
74
|
+
Numpad: _sfc_main$22,
|
|
75
|
+
Popup: _sfc_main$23,
|
|
76
|
+
ProgressBar: _sfc_main$24,
|
|
77
|
+
Prompt: _sfc_main$25,
|
|
78
|
+
Radio: _sfc_main$26,
|
|
79
|
+
SectionHeading: _sfc_main$27,
|
|
80
|
+
Segmented: _sfc_main$28,
|
|
81
|
+
Select: _sfc_main$29,
|
|
82
|
+
Slider: _sfc_main$30,
|
|
83
|
+
Stepper: _sfc_main$31,
|
|
84
|
+
Toggle: _sfc_main$32,
|
|
85
|
+
Tooltip: _sfc_main$33,
|
|
76
86
|
Icon: _sfc_main
|
|
77
87
|
};
|
|
78
88
|
//#endregion
|
|
79
|
-
export { _sfc_main$1 as UiAlert, _sfc_main$2 as UiAvatar, _sfc_main$3 as UiBadge, _sfc_main$4 as
|
|
89
|
+
export { _sfc_main$1 as UiAlert, _sfc_main$2 as UiAvatar, _sfc_main$3 as UiBadge, _sfc_main$4 as UiBreadcrumb, _sfc_main$5 as UiButton, _sfc_main$6 as UiButtonsGroup, _sfc_main$7 as UiCard, _sfc_main$8 as UiCheckbox, _sfc_main$9 as UiDivider, _sfc_main$10 as UiDropdown, _sfc_main$11 as UiDropdownItem, _sfc_main$12 as UiDropdownRow, _sfc_main$13 as UiDropdownSubmenu, _sfc_main$14 as UiFileInput, _sfc_main$15 as UiFormField, _sfc_main as UiIcon, _sfc_main$16 as UiIconTile, _sfc_main$17 as UiInput, _sfc_main$18 as UiKbd, _sfc_main$19 as UiListMenu, _sfc_main$20 as UiListMenuItem, _sfc_main$21 as UiModal, _sfc_main$22 as UiNumpad, _sfc_main$23 as UiPopup, _sfc_main$24 as UiProgressBar, _sfc_main$25 as UiPrompt, _sfc_main$26 as UiRadio, _sfc_main$27 as UiSectionHeading, _sfc_main$28 as UiSegmented, _sfc_main$29 as UiSelect, _sfc_main$30 as UiSlider, _sfc_main$31 as UiStepper, _sfc_main$32 as UiToggle, _sfc_main$33 as UiTooltip, components };
|
|
80
90
|
|
|
81
91
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.js"],"sourcesContent":["/**\n * Real component imports, re-exported under the default `Ui` prefix.\n *\n * The prefix is baked into the export names so that `import { UiButton }`\n * reads the same as `<UiButton>` in a template. Consumers who register the\n * library with a different prefix still import these names — only the\n * globally registered tag changes.\n *\n * `../manifest.js` carries the same list as plain data for build-time\n * consumers; `scripts/verify.mjs` keeps the two in sync.\n */\nimport Alert from './Alert.vue'\nimport Avatar from './Avatar.vue'\nimport Badge from './Badge.vue'\nimport Button from './Button.vue'\nimport ButtonsGroup from './ButtonsGroup.vue'\nimport Checkbox from './Checkbox.vue'\nimport Divider from './Divider.vue'\nimport Dropdown from './Dropdown.vue'\nimport DropdownItem from './DropdownItem.vue'\nimport DropdownRow from './DropdownRow.vue'\nimport DropdownSubmenu from './DropdownSubmenu.vue'\nimport FileInput from './FileInput.vue'\nimport FormField from './FormField.vue'\nimport Input from './Input.vue'\nimport Kbd from './Kbd.vue'\nimport ListMenu from './ListMenu.vue'\nimport ListMenuItem from './ListMenuItem.vue'\nimport Modal from './Modal.vue'\nimport Numpad from './Numpad.vue'\nimport Popup from './Popup.vue'\nimport ProgressBar from './ProgressBar.vue'\nimport Prompt from './Prompt.vue'\nimport Radio from './Radio.vue'\nimport Select from './Select.vue'\nimport Slider from './Slider.vue'\nimport Stepper from './Stepper.vue'\nimport Toggle from './Toggle.vue'\nimport Tooltip from './Tooltip.vue'\nimport Icon from '../icons/Icon.vue'\n\nexport {\n Alert as UiAlert,\n Avatar as UiAvatar,\n Badge as UiBadge,\n Button as UiButton,\n ButtonsGroup as UiButtonsGroup,\n Checkbox as UiCheckbox,\n Divider as UiDivider,\n Dropdown as UiDropdown,\n DropdownItem as UiDropdownItem,\n DropdownRow as UiDropdownRow,\n DropdownSubmenu as UiDropdownSubmenu,\n FileInput as UiFileInput,\n FormField as UiFormField,\n Input as UiInput,\n Kbd as UiKbd,\n ListMenu as UiListMenu,\n ListMenuItem as UiListMenuItem,\n Modal as UiModal,\n Numpad as UiNumpad,\n Popup as UiPopup,\n ProgressBar as UiProgressBar,\n Prompt as UiPrompt,\n Radio as UiRadio,\n Select as UiSelect,\n Slider as UiSlider,\n Stepper as UiStepper,\n Toggle as UiToggle,\n Tooltip as UiTooltip,\n Icon as UiIcon,\n}\n\n/**\n * Base-name -> component map, used by the Vue plugin to register everything\n * under whatever prefix the host chose.\n * @type {Record<string, import('vue').Component>}\n */\nexport const components = {\n Alert,\n Avatar,\n Badge,\n Button,\n ButtonsGroup,\n Checkbox,\n Divider,\n Dropdown,\n DropdownItem,\n DropdownRow,\n DropdownSubmenu,\n FileInput,\n FormField,\n Input,\n Kbd,\n ListMenu,\n ListMenuItem,\n Modal,\n Numpad,\n Popup,\n ProgressBar,\n Prompt,\n Radio,\n Select,\n Slider,\n Stepper,\n Toggle,\n Tooltip,\n Icon,\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.js"],"sourcesContent":["/**\n * Real component imports, re-exported under the default `Ui` prefix.\n *\n * The prefix is baked into the export names so that `import { UiButton }`\n * reads the same as `<UiButton>` in a template. Consumers who register the\n * library with a different prefix still import these names — only the\n * globally registered tag changes.\n *\n * `../manifest.js` carries the same list as plain data for build-time\n * consumers; `scripts/verify.mjs` keeps the two in sync.\n */\nimport Alert from './Alert.vue'\nimport Avatar from './Avatar.vue'\nimport Badge from './Badge.vue'\nimport Breadcrumb from './Breadcrumb.vue'\nimport Button from './Button.vue'\nimport ButtonsGroup from './ButtonsGroup.vue'\nimport Card from './Card.vue'\nimport Checkbox from './Checkbox.vue'\nimport Divider from './Divider.vue'\nimport Dropdown from './Dropdown.vue'\nimport DropdownItem from './DropdownItem.vue'\nimport DropdownRow from './DropdownRow.vue'\nimport DropdownSubmenu from './DropdownSubmenu.vue'\nimport FileInput from './FileInput.vue'\nimport FormField from './FormField.vue'\nimport IconTile from './IconTile.vue'\nimport Input from './Input.vue'\nimport Kbd from './Kbd.vue'\nimport ListMenu from './ListMenu.vue'\nimport ListMenuItem from './ListMenuItem.vue'\nimport Modal from './Modal.vue'\nimport Numpad from './Numpad.vue'\nimport Popup from './Popup.vue'\nimport ProgressBar from './ProgressBar.vue'\nimport Prompt from './Prompt.vue'\nimport Radio from './Radio.vue'\nimport SectionHeading from './SectionHeading.vue'\nimport Segmented from './Segmented.vue'\nimport Select from './Select.vue'\nimport Slider from './Slider.vue'\nimport Stepper from './Stepper.vue'\nimport Toggle from './Toggle.vue'\nimport Tooltip from './Tooltip.vue'\nimport Icon from '../icons/Icon.vue'\n\nexport {\n Alert as UiAlert,\n Avatar as UiAvatar,\n Badge as UiBadge,\n Breadcrumb as UiBreadcrumb,\n Button as UiButton,\n ButtonsGroup as UiButtonsGroup,\n Card as UiCard,\n Checkbox as UiCheckbox,\n Divider as UiDivider,\n Dropdown as UiDropdown,\n DropdownItem as UiDropdownItem,\n DropdownRow as UiDropdownRow,\n DropdownSubmenu as UiDropdownSubmenu,\n FileInput as UiFileInput,\n FormField as UiFormField,\n IconTile as UiIconTile,\n Input as UiInput,\n Kbd as UiKbd,\n ListMenu as UiListMenu,\n ListMenuItem as UiListMenuItem,\n Modal as UiModal,\n Numpad as UiNumpad,\n Popup as UiPopup,\n ProgressBar as UiProgressBar,\n Prompt as UiPrompt,\n Radio as UiRadio,\n SectionHeading as UiSectionHeading,\n Segmented as UiSegmented,\n Select as UiSelect,\n Slider as UiSlider,\n Stepper as UiStepper,\n Toggle as UiToggle,\n Tooltip as UiTooltip,\n Icon as UiIcon,\n}\n\n/**\n * Base-name -> component map, used by the Vue plugin to register everything\n * under whatever prefix the host chose.\n * @type {Record<string, import('vue').Component>}\n */\nexport const components = {\n Alert,\n Avatar,\n Badge,\n Breadcrumb,\n Button,\n ButtonsGroup,\n Card,\n Checkbox,\n Divider,\n Dropdown,\n DropdownItem,\n DropdownRow,\n DropdownSubmenu,\n FileInput,\n FormField,\n IconTile,\n Input,\n Kbd,\n ListMenu,\n ListMenuItem,\n Modal,\n Numpad,\n Popup,\n ProgressBar,\n Prompt,\n Radio,\n SectionHeading,\n Segmented,\n Select,\n Slider,\n Stepper,\n Toggle,\n Tooltip,\n Icon,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,IAAa,aAAa;CACxB,OAAA;CACA,QAAA;CACA,OAAA;CACA,YAAA;CACA,QAAA;CACA,cAAA;CACA,MAAA;CACA,UAAA;CACA,SAAA;CACA,UAAA;CACA,cAAA;CACA,aAAA;CACA,iBAAA;CACA,WAAA;CACA,WAAA;CACA,UAAA;CACA,OAAA;CACA,KAAA;CACA,UAAA;CACA,cAAA;CACA,OAAA;CACA,QAAA;CACA,OAAA;CACA,aAAA;CACA,QAAA;CACA,OAAA;CACA,gBAAA;CACA,WAAA;CACA,QAAA;CACA,QAAA;CACA,SAAA;CACA,QAAA;CACA,SAAA;CACA,MAAA;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ type UiComponent = Component
|
|
|
10
10
|
export declare const UiAlert: UiComponent
|
|
11
11
|
export declare const UiAvatar: UiComponent
|
|
12
12
|
export declare const UiBadge: UiComponent
|
|
13
|
+
export declare const UiBreadcrumb: UiComponent
|
|
13
14
|
export declare const UiButton: UiComponent
|
|
14
15
|
export declare const UiButtonsGroup: UiComponent
|
|
16
|
+
export declare const UiCard: UiComponent
|
|
15
17
|
export declare const UiCheckbox: UiComponent
|
|
16
18
|
export declare const UiDivider: UiComponent
|
|
17
19
|
export declare const UiDropdown: UiComponent
|
|
@@ -20,6 +22,7 @@ export declare const UiDropdownRow: UiComponent
|
|
|
20
22
|
export declare const UiDropdownSubmenu: UiComponent
|
|
21
23
|
export declare const UiFileInput: UiComponent
|
|
22
24
|
export declare const UiFormField: UiComponent
|
|
25
|
+
export declare const UiIconTile: UiComponent
|
|
23
26
|
export declare const UiInput: UiComponent
|
|
24
27
|
export declare const UiKbd: UiComponent
|
|
25
28
|
export declare const UiListMenu: UiComponent
|
|
@@ -30,6 +33,8 @@ export declare const UiPopup: UiComponent
|
|
|
30
33
|
export declare const UiProgressBar: UiComponent
|
|
31
34
|
export declare const UiPrompt: UiComponent
|
|
32
35
|
export declare const UiRadio: UiComponent
|
|
36
|
+
export declare const UiSectionHeading: UiComponent
|
|
37
|
+
export declare const UiSegmented: UiComponent
|
|
33
38
|
export declare const UiSelect: UiComponent
|
|
34
39
|
export declare const UiSlider: UiComponent
|
|
35
40
|
export declare const UiStepper: UiComponent
|
package/dist/index.js
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
import { MDI_VIEW_BOX, mdiIconNames, mdiPaths } from "./icons/mdi.js";
|
|
2
2
|
import { iconRegistry, registerIcons, resolveIconPath } from "./icons/registry.js";
|
|
3
3
|
import { ICON_COMPONENT_KEY, provideIconComponent, useIconComponent } from "./icons/resolver.js";
|
|
4
|
-
import _sfc_main$
|
|
4
|
+
import _sfc_main$15 from "./icons/Icon.js";
|
|
5
5
|
import _sfc_main from "./components/Alert.js";
|
|
6
6
|
import _sfc_main$1 from "./components/Avatar.js";
|
|
7
7
|
import _sfc_main$2 from "./components/Badge.js";
|
|
8
|
-
import _sfc_main$3 from "./components/
|
|
9
|
-
import _sfc_main$4 from "./components/
|
|
10
|
-
import _sfc_main$5 from "./components/
|
|
11
|
-
import _sfc_main$6 from "./components/
|
|
8
|
+
import _sfc_main$3 from "./components/Breadcrumb.js";
|
|
9
|
+
import _sfc_main$4 from "./components/Button.js";
|
|
10
|
+
import _sfc_main$5 from "./components/ButtonsGroup.js";
|
|
11
|
+
import _sfc_main$6 from "./components/Card.js";
|
|
12
|
+
import _sfc_main$7 from "./components/Checkbox.js";
|
|
13
|
+
import _sfc_main$8 from "./components/Divider.js";
|
|
12
14
|
import { useEventListener } from "./composables/useEventListener.js";
|
|
13
15
|
import { onClickOutside } from "./composables/onClickOutside.js";
|
|
14
|
-
import _sfc_main$
|
|
15
|
-
import _sfc_main$
|
|
16
|
-
import _sfc_main$
|
|
17
|
-
import _sfc_main$
|
|
18
|
-
import _sfc_main$
|
|
19
|
-
import _sfc_main$
|
|
20
|
-
import _sfc_main$
|
|
21
|
-
import _sfc_main$
|
|
22
|
-
import _sfc_main$
|
|
23
|
-
import _sfc_main$
|
|
16
|
+
import _sfc_main$9 from "./components/Dropdown.js";
|
|
17
|
+
import _sfc_main$10 from "./components/DropdownItem.js";
|
|
18
|
+
import _sfc_main$11 from "./components/DropdownRow.js";
|
|
19
|
+
import _sfc_main$12 from "./components/DropdownSubmenu.js";
|
|
20
|
+
import _sfc_main$13 from "./components/FileInput.js";
|
|
21
|
+
import _sfc_main$14 from "./components/FormField.js";
|
|
22
|
+
import _sfc_main$16 from "./components/IconTile.js";
|
|
23
|
+
import _sfc_main$17 from "./components/Input.js";
|
|
24
|
+
import _sfc_main$18 from "./components/Kbd.js";
|
|
25
|
+
import _sfc_main$19 from "./components/ListMenu.js";
|
|
26
|
+
import _sfc_main$20 from "./components/ListMenuItem.js";
|
|
24
27
|
import { useBackButton } from "./composables/useBackButton.js";
|
|
25
|
-
import _sfc_main$
|
|
26
|
-
import _sfc_main$
|
|
27
|
-
import _sfc_main$
|
|
28
|
-
import _sfc_main$
|
|
29
|
-
import _sfc_main$
|
|
30
|
-
import _sfc_main$
|
|
31
|
-
import _sfc_main$
|
|
32
|
-
import _sfc_main$
|
|
33
|
-
import _sfc_main$
|
|
34
|
-
import _sfc_main$
|
|
35
|
-
import _sfc_main$
|
|
28
|
+
import _sfc_main$21 from "./components/Modal.js";
|
|
29
|
+
import _sfc_main$22 from "./components/Numpad.js";
|
|
30
|
+
import _sfc_main$23 from "./components/Popup.js";
|
|
31
|
+
import _sfc_main$24 from "./components/ProgressBar.js";
|
|
32
|
+
import _sfc_main$25 from "./components/Prompt.js";
|
|
33
|
+
import _sfc_main$26 from "./components/Radio.js";
|
|
34
|
+
import _sfc_main$27 from "./components/SectionHeading.js";
|
|
35
|
+
import _sfc_main$28 from "./components/Segmented.js";
|
|
36
|
+
import _sfc_main$29 from "./components/Select.js";
|
|
37
|
+
import _sfc_main$30 from "./components/Slider.js";
|
|
38
|
+
import _sfc_main$31 from "./components/Stepper.js";
|
|
39
|
+
import _sfc_main$32 from "./components/Toggle.js";
|
|
40
|
+
import _sfc_main$33 from "./components/Tooltip.js";
|
|
36
41
|
import { components } from "./components/index.js";
|
|
37
42
|
import { COMPONENT_NAMES, DEFAULT_PREFIX, componentEntries, prefixed } from "./manifest.js";
|
|
38
43
|
//#region src/index.js
|
|
@@ -152,6 +157,6 @@ function createNumoriUI(components = {}, options = {}) {
|
|
|
152
157
|
} };
|
|
153
158
|
}
|
|
154
159
|
//#endregion
|
|
155
|
-
export { COMPONENT_NAMES, DEFAULT_PREFIX, ICON_COMPONENT_KEY, MDI_VIEW_BOX, NumoriUI, NumoriUI as default, _sfc_main as UiAlert, _sfc_main$1 as UiAvatar, _sfc_main$2 as UiBadge, _sfc_main$3 as
|
|
160
|
+
export { COMPONENT_NAMES, DEFAULT_PREFIX, ICON_COMPONENT_KEY, MDI_VIEW_BOX, NumoriUI, NumoriUI as default, _sfc_main as UiAlert, _sfc_main$1 as UiAvatar, _sfc_main$2 as UiBadge, _sfc_main$3 as UiBreadcrumb, _sfc_main$4 as UiButton, _sfc_main$5 as UiButtonsGroup, _sfc_main$6 as UiCard, _sfc_main$7 as UiCheckbox, _sfc_main$8 as UiDivider, _sfc_main$9 as UiDropdown, _sfc_main$10 as UiDropdownItem, _sfc_main$11 as UiDropdownRow, _sfc_main$12 as UiDropdownSubmenu, _sfc_main$13 as UiFileInput, _sfc_main$14 as UiFormField, _sfc_main$15 as UiIcon, _sfc_main$16 as UiIconTile, _sfc_main$17 as UiInput, _sfc_main$18 as UiKbd, _sfc_main$19 as UiListMenu, _sfc_main$20 as UiListMenuItem, _sfc_main$21 as UiModal, _sfc_main$22 as UiNumpad, _sfc_main$23 as UiPopup, _sfc_main$24 as UiProgressBar, _sfc_main$25 as UiPrompt, _sfc_main$26 as UiRadio, _sfc_main$27 as UiSectionHeading, _sfc_main$28 as UiSegmented, _sfc_main$29 as UiSelect, _sfc_main$30 as UiSlider, _sfc_main$31 as UiStepper, _sfc_main$32 as UiToggle, _sfc_main$33 as UiTooltip, componentEntries, components, createNumoriUI, iconRegistry, mdiIconNames, mdiPaths, onClickOutside, prefixed, provideIconComponent, registerIcons, resolveIconPath, useBackButton, useEventListener, useIconComponent };
|
|
156
161
|
|
|
157
162
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.js"],"sourcesContent":["/**\n * Numori UI — the Numori design system as a standalone Vue 3 component library.\n *\n * This is the framework-agnostic entry point. It works in any Vue 3 app with\n * no build-tool integration at all:\n *\n * import { createApp } from 'vue'\n * import NumoriUI from 'numori-ui'\n * import './app.css' // @import \"tailwindcss\"; @import \"numori-ui/css\";\n *\n * createApp(App).use(NumoriUI).mount('#app')\n *\n * For a nicer developer experience there are two build-tool integrations that\n * register the components for you, so templates need no imports:\n *\n * - `numori-ui/nuxt` — a Nuxt module\n * - `numori-ui/vite` — a Vite plugin\n *\n * Styling is Tailwind CSS v4 and is deliberately NOT bundled as compiled CSS.\n * The components are plain utility classes, so they inherit the host app's\n * Tailwind build: one pass, one stylesheet, no duplication, and every token is\n * overridable. All the host has to do is import `numori-ui/css`, which supplies\n * the design tokens and tells Tailwind to scan this package for classes.\n */\n\nimport { components } from './components/index.js'\nimport { DEFAULT_PREFIX, prefixed } from './manifest.js'\nimport { ICON_COMPONENT_KEY } from './icons/resolver.js'\nimport { registerIcons } from './icons/registry.js'\n\nexport * from './components/index.js'\n\nexport { DEFAULT_PREFIX, COMPONENT_NAMES, componentEntries, prefixed } from './manifest.js'\nexport { registerIcons, iconRegistry, resolveIconPath } from './icons/registry.js'\nexport { provideIconComponent, useIconComponent, ICON_COMPONENT_KEY } from './icons/resolver.js'\nexport { MDI_VIEW_BOX, mdiPaths, mdiIconNames } from './icons/mdi.js'\nexport { useBackButton } from './composables/useBackButton.js'\nexport { onClickOutside } from './composables/onClickOutside.js'\nexport { useEventListener } from './composables/useEventListener.js'\n\n/**\n * Vue plugin that globally registers every Numori UI component.\n *\n * @type {import('vue').Plugin}\n *\n * @param {import('vue').App} app\n * @param {object} [options]\n * @param {string} [options.prefix='Ui']\n * Prefix for registered tags. `'Ui'` gives `<UiButton>`. Must be non-empty —\n * see the note in `install` for why.\n * @param {string[]} [options.include]\n * Register only these base names (e.g. `['Button', 'Modal']`). Note this\n * affects *global registration* only — it is not tree-shaking. To actually\n * drop unused components from the bundle, skip the plugin and import the\n * components you use directly.\n * @param {string[]} [options.exclude]\n * Skip these base names. Useful when the host has its own `<UiButton>`.\n * @param {object} [options.icons]\n * @param {import('vue').Component|string} [options.icons.component]\n * Render all icons with this component instead of the bundled inline SVGs.\n * Receives a `name` prop and must forward `class` to its root element.\n * @param {Record<string,string>} [options.icons.extra]\n * Extra icon path data to add to the bundled set, keyed by name.\n *\n * @example Default registration\n * app.use(NumoriUI)\n *\n * @example Custom prefix\n * app.use(NumoriUI, { prefix: 'N' }) // <NButton>\n *\n * @example Delegate icons to an existing icon component\n * app.use(NumoriUI, { icons: { component: MyIcon } })\n */\nexport const NumoriUI = {\n install(app, options = {}) {\n const { prefix = DEFAULT_PREFIX, include, exclude = [], icons = {} } = options\n\n // An empty prefix is rejected rather than merely discouraged. `Button`\n // renders its root as `<component :is=\"tag\">` with `tag` defaulting to\n // `'button'`, and Vue's dynamic-component lookup capitalises before\n // matching — so a globally registered `Button` would resolve `'button'`\n // back to itself and recurse until the stack blows. The failure is a bare\n // \"Maximum call stack size exceeded\" with no hint of the cause, so it is\n // much kinder to refuse up front.\n if (typeof prefix !== 'string' || prefix.length === 0) {\n throw new Error(\n '[numori-ui] `prefix` must be a non-empty string. Registering components under their ' +\n 'bare names would make <Button> resolve its own native `button` root element, ' +\n 'recursing infinitely. Use a prefix such as \"Ui\" or \"N\".',\n )\n }\n\n if (icons.extra) registerIcons(icons.extra)\n // app-level provide, so it reaches every component including those\n // teleported out of the tree (modals, select panels).\n if (icons.component) app.provide(ICON_COMPONENT_KEY, icons.component)\n\n for (const [name, component] of Object.entries(components)) {\n if (include && !include.includes(name)) continue\n if (exclude.includes(name)) continue\n app.component(prefixed(name, prefix), component)\n }\n },\n}\n\nexport default NumoriUI\n\n/**\n * Build a Vue plugin that globally registers only the components you hand it.\n *\n * `NumoriUI` is convenient but it is not tree-shakeable: to register everything\n * it has to reference everything, so `app.use(NumoriUI)` puts all 29 components\n * in your bundle (~82 kB) whether you render them or not. The `include` option\n * does not change that — it controls registration, not bundling.\n *\n * This factory is the way to get both. You import the components you want, so\n * the bundler sees exactly that set and drops the rest, and you still get global\n * tags instead of importing them into every file.\n *\n * Keys become the registered tag names verbatim, so no prefix option is needed\n * and there is no naming magic — rename in the object literal if you want a\n * different tag.\n *\n * @param {Record<string, import('vue').Component>} components\n * Map of tag name to component, e.g. `{ UiButton, UiModal }`.\n * @param {object} [options]\n * @param {object} [options.icons] Same shape as the `NumoriUI` plugin's option.\n * @returns {import('vue').Plugin}\n *\n * @example Global tags, but only two components bundled\n * import { createNumoriUI, UiButton, UiModal } from 'numori-ui'\n *\n * app.use(createNumoriUI({ UiButton, UiModal }))\n *\n * @example Registering under different tag names\n * app.use(createNumoriUI({ NButton: UiButton, NModal: UiModal }))\n */\nexport function createNumoriUI(components = {}, options = {}) {\n const { icons = {} } = options\n\n // `UiButton` renders its root as `<component :is=\"tag\">`, and Vue capitalises\n // when resolving a dynamic component. Registering it under a name that\n // case-insensitively matches one of those tags would make it resolve itself\n // and recurse until the stack overflows, reported only as \"Maximum call stack\n // size exceeded\". Cheap to catch here, miserable to debug later.\n const DYNAMIC_TAGS = ['button', 'a', 'div', 'span', 'label', 'li']\n for (const name of Object.keys(components)) {\n if (DYNAMIC_TAGS.includes(name.toLowerCase())) {\n throw new Error(\n `[numori-ui] Cannot register a component as \"${name}\": it collides with the native <${name.toLowerCase()}> ` +\n 'element that UiButton can render as its root, which would recurse infinitely. ' +\n `Use a prefixed name such as \"Ui${name}\".`,\n )\n }\n }\n\n return {\n install(app) {\n if (icons.extra) registerIcons(icons.extra)\n if (icons.component) app.provide(ICON_COMPONENT_KEY, icons.component)\n\n for (const [name, component] of Object.entries(components)) {\n app.component(name, component)\n }\n },\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.js"],"sourcesContent":["/**\n * Numori UI — the Numori design system as a standalone Vue 3 component library.\n *\n * This is the framework-agnostic entry point. It works in any Vue 3 app with\n * no build-tool integration at all:\n *\n * import { createApp } from 'vue'\n * import NumoriUI from 'numori-ui'\n * import './app.css' // @import \"tailwindcss\"; @import \"numori-ui/css\";\n *\n * createApp(App).use(NumoriUI).mount('#app')\n *\n * For a nicer developer experience there are two build-tool integrations that\n * register the components for you, so templates need no imports:\n *\n * - `numori-ui/nuxt` — a Nuxt module\n * - `numori-ui/vite` — a Vite plugin\n *\n * Styling is Tailwind CSS v4 and is deliberately NOT bundled as compiled CSS.\n * The components are plain utility classes, so they inherit the host app's\n * Tailwind build: one pass, one stylesheet, no duplication, and every token is\n * overridable. All the host has to do is import `numori-ui/css`, which supplies\n * the design tokens and tells Tailwind to scan this package for classes.\n */\n\nimport { components } from './components/index.js'\nimport { DEFAULT_PREFIX, prefixed } from './manifest.js'\nimport { ICON_COMPONENT_KEY } from './icons/resolver.js'\nimport { registerIcons } from './icons/registry.js'\n\nexport * from './components/index.js'\n\nexport { DEFAULT_PREFIX, COMPONENT_NAMES, componentEntries, prefixed } from './manifest.js'\nexport { registerIcons, iconRegistry, resolveIconPath } from './icons/registry.js'\nexport { provideIconComponent, useIconComponent, ICON_COMPONENT_KEY } from './icons/resolver.js'\nexport { MDI_VIEW_BOX, mdiPaths, mdiIconNames } from './icons/mdi.js'\nexport { useBackButton } from './composables/useBackButton.js'\nexport { onClickOutside } from './composables/onClickOutside.js'\nexport { useEventListener } from './composables/useEventListener.js'\n\n/**\n * Vue plugin that globally registers every Numori UI component.\n *\n * @type {import('vue').Plugin}\n *\n * @param {import('vue').App} app\n * @param {object} [options]\n * @param {string} [options.prefix='Ui']\n * Prefix for registered tags. `'Ui'` gives `<UiButton>`. Must be non-empty —\n * see the note in `install` for why.\n * @param {string[]} [options.include]\n * Register only these base names (e.g. `['Button', 'Modal']`). Note this\n * affects *global registration* only — it is not tree-shaking. To actually\n * drop unused components from the bundle, skip the plugin and import the\n * components you use directly.\n * @param {string[]} [options.exclude]\n * Skip these base names. Useful when the host has its own `<UiButton>`.\n * @param {object} [options.icons]\n * @param {import('vue').Component|string} [options.icons.component]\n * Render all icons with this component instead of the bundled inline SVGs.\n * Receives a `name` prop and must forward `class` to its root element.\n * @param {Record<string,string>} [options.icons.extra]\n * Extra icon path data to add to the bundled set, keyed by name.\n *\n * @example Default registration\n * app.use(NumoriUI)\n *\n * @example Custom prefix\n * app.use(NumoriUI, { prefix: 'N' }) // <NButton>\n *\n * @example Delegate icons to an existing icon component\n * app.use(NumoriUI, { icons: { component: MyIcon } })\n */\nexport const NumoriUI = {\n install(app, options = {}) {\n const { prefix = DEFAULT_PREFIX, include, exclude = [], icons = {} } = options\n\n // An empty prefix is rejected rather than merely discouraged. `Button`\n // renders its root as `<component :is=\"tag\">` with `tag` defaulting to\n // `'button'`, and Vue's dynamic-component lookup capitalises before\n // matching — so a globally registered `Button` would resolve `'button'`\n // back to itself and recurse until the stack blows. The failure is a bare\n // \"Maximum call stack size exceeded\" with no hint of the cause, so it is\n // much kinder to refuse up front.\n if (typeof prefix !== 'string' || prefix.length === 0) {\n throw new Error(\n '[numori-ui] `prefix` must be a non-empty string. Registering components under their ' +\n 'bare names would make <Button> resolve its own native `button` root element, ' +\n 'recursing infinitely. Use a prefix such as \"Ui\" or \"N\".',\n )\n }\n\n if (icons.extra) registerIcons(icons.extra)\n // app-level provide, so it reaches every component including those\n // teleported out of the tree (modals, select panels).\n if (icons.component) app.provide(ICON_COMPONENT_KEY, icons.component)\n\n for (const [name, component] of Object.entries(components)) {\n if (include && !include.includes(name)) continue\n if (exclude.includes(name)) continue\n app.component(prefixed(name, prefix), component)\n }\n },\n}\n\nexport default NumoriUI\n\n/**\n * Build a Vue plugin that globally registers only the components you hand it.\n *\n * `NumoriUI` is convenient but it is not tree-shakeable: to register everything\n * it has to reference everything, so `app.use(NumoriUI)` puts all 29 components\n * in your bundle (~82 kB) whether you render them or not. The `include` option\n * does not change that — it controls registration, not bundling.\n *\n * This factory is the way to get both. You import the components you want, so\n * the bundler sees exactly that set and drops the rest, and you still get global\n * tags instead of importing them into every file.\n *\n * Keys become the registered tag names verbatim, so no prefix option is needed\n * and there is no naming magic — rename in the object literal if you want a\n * different tag.\n *\n * @param {Record<string, import('vue').Component>} components\n * Map of tag name to component, e.g. `{ UiButton, UiModal }`.\n * @param {object} [options]\n * @param {object} [options.icons] Same shape as the `NumoriUI` plugin's option.\n * @returns {import('vue').Plugin}\n *\n * @example Global tags, but only two components bundled\n * import { createNumoriUI, UiButton, UiModal } from 'numori-ui'\n *\n * app.use(createNumoriUI({ UiButton, UiModal }))\n *\n * @example Registering under different tag names\n * app.use(createNumoriUI({ NButton: UiButton, NModal: UiModal }))\n */\nexport function createNumoriUI(components = {}, options = {}) {\n const { icons = {} } = options\n\n // `UiButton` renders its root as `<component :is=\"tag\">`, and Vue capitalises\n // when resolving a dynamic component. Registering it under a name that\n // case-insensitively matches one of those tags would make it resolve itself\n // and recurse until the stack overflows, reported only as \"Maximum call stack\n // size exceeded\". Cheap to catch here, miserable to debug later.\n const DYNAMIC_TAGS = ['button', 'a', 'div', 'span', 'label', 'li']\n for (const name of Object.keys(components)) {\n if (DYNAMIC_TAGS.includes(name.toLowerCase())) {\n throw new Error(\n `[numori-ui] Cannot register a component as \"${name}\": it collides with the native <${name.toLowerCase()}> ` +\n 'element that UiButton can render as its root, which would recurse infinitely. ' +\n `Use a prefixed name such as \"Ui${name}\".`,\n )\n }\n }\n\n return {\n install(app) {\n if (icons.extra) registerIcons(icons.extra)\n if (icons.component) app.provide(ICON_COMPONENT_KEY, icons.component)\n\n for (const [name, component] of Object.entries(components)) {\n app.component(name, component)\n }\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,IAAa,WAAW,EACtB,QAAQ,KAAK,UAAU,CAAC,GAAG;CACzB,MAAM,EAAE,SAAA,MAAyB,SAAS,UAAU,CAAC,GAAG,QAAQ,CAAC,MAAM;CASvE,IAAI,OAAO,WAAW,YAAY,OAAO,WAAW,GAClD,MAAM,IAAI,MACR,8NAGF;CAGF,IAAI,MAAM,OAAO,cAAc,MAAM,KAAK;CAG1C,IAAI,MAAM,WAAW,IAAI,QAAQ,oBAAoB,MAAM,SAAS;CAEpE,KAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,UAAU,GAAG;EAC1D,IAAI,WAAW,CAAC,QAAQ,SAAS,IAAI,GAAG;EACxC,IAAI,QAAQ,SAAS,IAAI,GAAG;EAC5B,IAAI,UAAU,SAAS,MAAM,MAAM,GAAG,SAAS;CACjD;AACF,EACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAgB,eAAe,aAAa,CAAC,GAAG,UAAU,CAAC,GAAG;CAC5D,MAAM,EAAE,QAAQ,CAAC,MAAM;CAOvB,MAAM,eAAe;EAAC;EAAU;EAAK;EAAO;EAAQ;EAAS;CAAI;CACjE,KAAK,MAAM,QAAQ,OAAO,KAAK,UAAU,GACvC,IAAI,aAAa,SAAS,KAAK,YAAY,CAAC,GAC1C,MAAM,IAAI,MACR,+CAA+C,KAAK,kCAAkC,KAAK,YAAY,EAAE,iHAErE,KAAK,GAC3C;CAIJ,OAAO,EACL,QAAQ,KAAK;EACX,IAAI,MAAM,OAAO,cAAc,MAAM,KAAK;EAC1C,IAAI,MAAM,WAAW,IAAI,QAAQ,oBAAoB,MAAM,SAAS;EAEpE,KAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,UAAU,GACvD,IAAI,UAAU,MAAM,SAAS;CAEjC,EACF;AACF"}
|