numori-ui 0.1.0 → 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 ADDED
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ All notable changes to Numori UI are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+ While the library is pre-1.0, minor versions may add components and options; patch
8
+ versions are fixes.
9
+
10
+ ## [0.2.0] — 2026-08-31
11
+
12
+ Five new components, bringing the library to 33 components (34 registered tags,
13
+ including `UiIcon`). All additions are backward compatible.
14
+
15
+ ### Added
16
+
17
+ - **`UiCard`** — the surface primitive: a bordered, rounded, elevated container
18
+ with optional `header` / default / `footer` slots. Renders as any element via
19
+ `tag` (so a whole card can be a link), with `interactive` (hover lift),
20
+ `highlighted` (accent border) and `focusRing` (for the stretched-link pattern)
21
+ states, plus `padding`, `radius`, `shadow` and `bordered` options. External
22
+ classes merge via `tailwind-merge`, so a caller's hover border wins over the
23
+ default.
24
+ - **`UiSectionHeading`** — eyebrow / heading / standfirst trio. The heading tag
25
+ (`level`) follows the document outline while the visual `size` is set
26
+ separately; supports `align`, `id` and `title` / `subtitle` / default slots.
27
+ - **`UiBreadcrumb`** — navigation trail whose final item renders as
28
+ `aria-current="page"` text rather than a link. Links render through `linkTag`
29
+ (e.g. a router link component), separators are decorative, and an `item` scoped
30
+ slot allows full control of each entry.
31
+ - **`UiSegmented`** — segmented single-select control with a pill that slides to
32
+ the active option. A group of `aria-pressed` toggle buttons (not a switch),
33
+ with `size` and `shape` options; bind with `v-model`.
34
+ - **`UiIconTile`** — a rounded, tinted tile holding a single icon, for product
35
+ marks and feature glyphs. Semantic `color` palette and four `size`s; pass
36
+ `bg-*`/`text-*` classes to use a colour outside the semantic set (merged via
37
+ `tailwind-merge`).
38
+
39
+ ### Changed
40
+
41
+ - README component list and counts updated for the five additions.
42
+ - Type declarations (`dist/index.d.ts`) now export the five new components.
43
+
44
+ ## [0.1.1]
45
+
46
+ - First published release: 28 components (29 registered tags), consumable as a
47
+ Nuxt module, a Vite plugin or a framework-agnostic Vue plugin.
48
+
49
+ [0.2.0]: https://github.com/Numori-Ecosystem/Numori-UI/releases/tag/v0.2.0
50
+ [0.1.1]: https://github.com/Numori-Ecosystem/Numori-UI/releases/tag/v0.1.1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Numori UI
2
2
 
3
- The Numori design system as a standalone Vue 3 component library. 28 components, Tailwind CSS v4, no
3
+ The Numori design system as a standalone Vue 3 component library. 33 components, Tailwind CSS v4, no
4
4
  TypeScript, consumable as a **Nuxt module** or a **Vite plugin**.
5
5
 
6
6
  Extracted from [Numori Notes](https://github.com/Numori-Ecosystem/Numori-Notes), where these
@@ -133,7 +133,7 @@ import './style.css'
133
133
  createApp(App).use(createNumoriUI({ UiButton, UiModal })).mount('#app')
134
134
  ```
135
135
 
136
- There is also `app.use(NumoriUI)`, which registers all 29 components in one line — convenient for
136
+ There is also `app.use(NumoriUI)`, which registers all 34 components in one line — convenient for
137
137
  prototyping, but it bundles all of them. See [Tree-shaking](#tree-shaking).
138
138
 
139
139
  ## Styling
@@ -235,8 +235,8 @@ external, so the numbers are Numori UI's own code:
235
235
  only import what a template references, so nothing further is needed — verified by checking that
236
236
  `Numpad`, `Popup` and `Prompt` are absent from the Nuxt playground's client bundle.
237
237
 
238
- **`app.use(NumoriUI)` is the one path that is not tree-shakeable.** To register all 29 components it
239
- has to reference all 29, so they all end up in your bundle. The `include` option does not change
238
+ **`app.use(NumoriUI)` is the one path that is not tree-shakeable.** To register all 34 components it
239
+ has to reference all 34, so they all end up in your bundle. The `include` option does not change
240
240
  this — it controls registration, not bundling. Use `createNumoriUI` instead when size matters:
241
241
 
242
242
  ```js
@@ -297,7 +297,8 @@ export default defineNuxtConfig({
297
297
  Every component is documented with JSDoc at the top of its source file, including props, events,
298
298
  slots and worked examples. Prefixes below assume the default `Ui`.
299
299
 
300
- **Actions** — `UiButton` (8 variants × 6 colours × 5 sizes × 5 shapes), `UiButtonsGroup`
300
+ **Actions** — `UiButton` (8 variants × 6 colours × 5 sizes × 5 shapes), `UiButtonsGroup`,
301
+ `UiSegmented` (single-select with a sliding pill)
301
302
 
302
303
  **Forms** — `UiInput` (text, number with steppers, password with toggle, email, phone, textarea,
303
304
  built-in validation), `UiSelect` (searchable, groupable, teleported panel), `UiCheckbox`, `UiRadio`,
@@ -308,7 +309,9 @@ built-in validation), `UiSelect` (searchable, groupable, teleported panel), `UiC
308
309
 
309
310
  **Feedback** — `UiAlert`, `UiBadge`, `UiProgressBar`
310
311
 
311
- **Layout & display** — `UiListMenu`, `UiListMenuItem`, `UiDivider`, `UiAvatar`, `UiKbd`, `UiIcon`
312
+ **Layout & display** — `UiCard` (the surface primitive, with interactive and highlighted states),
313
+ `UiSectionHeading` (eyebrow / heading / standfirst), `UiBreadcrumb`, `UiIconTile` (tinted icon tile),
314
+ `UiListMenu`, `UiListMenuItem`, `UiDivider`, `UiAvatar`, `UiKbd`, `UiIcon`
312
315
 
313
316
  External classes always win. `UiButton` merges them with
314
317
  [tailwind-merge](https://github.com/dcastil/tailwind-merge), so `class="bg-gray-100"` genuinely
@@ -381,7 +384,7 @@ app.use(NumoriUI, {
381
384
  })
382
385
  ```
383
386
 
384
- Registers all 29 components, and bundles all of them — reach for `createNumoriUI` when that matters:
387
+ Registers all 34 components, and bundles all of them — reach for `createNumoriUI` when that matters:
385
388
 
386
389
  ```js
387
390
  app.use(createNumoriUI({ UiButton, UiModal }, { icons: { component: MyIcon } }))
@@ -415,7 +418,7 @@ into the component on the source path but emit a _second_ CSS file on the bundle
415
418
  with one CSS import in some setups and two in others.
416
419
 
417
420
  **SSR-safe.** Numori Notes is a client-only SPA and never exercised server rendering, so the
418
- extraction fixed several components that touched `document` or `window` during setup. All 28 render
421
+ extraction fixed several components that touched `document` or `window` during setup. All 33 render
419
422
  under strict SSR with no DOM globals, verified on every build.
420
423
 
421
424
  ## Development
@@ -454,6 +457,12 @@ npm run icons && npm run build && npm test
454
457
  It reports anything it could not translate mechanically and exits non-zero, so an upstream change
455
458
  that outgrows the codemod fails loudly instead of shipping broken.
456
459
 
460
+ ## Changelog
461
+
462
+ See [CHANGELOG.md](./CHANGELOG.md) for the release history. The current release is
463
+ **0.2.0**, which adds `UiCard`, `UiSectionHeading`, `UiBreadcrumb`, `UiSegmented` and
464
+ `UiIconTile`.
465
+
457
466
  ## Licence and attribution
458
467
 
459
468
  Numori UI is licensed under [AGPL-3.0](./LICENSE), matching the rest of the Numori ecosystem. Note
@@ -0,0 +1,107 @@
1
+ import _sfc_main$1 from "../icons/Icon.js";
2
+ import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, openBlock, renderList, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
3
+ //#region src/components/Breadcrumb.vue
4
+ var _hoisted_1 = ["aria-label"];
5
+ var _hoisted_2 = { class: "flex flex-wrap items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400" };
6
+ var _hoisted_3 = {
7
+ key: 1,
8
+ "aria-current": "page",
9
+ class: "font-medium text-gray-900 dark:text-gray-200"
10
+ };
11
+ var _sfc_main = {
12
+ __name: "Breadcrumb",
13
+ props: {
14
+ /**
15
+ * Trail entries, ordered from the root down. Each is
16
+ * `{ label, to?, href? }`; the final entry always renders as plain text.
17
+ * @type {Array<{ label: string, to?: any, href?: string }>}
18
+ */
19
+ items: {
20
+ type: Array,
21
+ required: true
22
+ },
23
+ /**
24
+ * Accessible name for the surrounding `<nav>`.
25
+ * @type {string}
26
+ * @default 'Breadcrumb'
27
+ */
28
+ ariaLabel: {
29
+ type: String,
30
+ default: "Breadcrumb"
31
+ },
32
+ /**
33
+ * Element or globally registered component used for linked entries.
34
+ * @type {string}
35
+ * @default 'a'
36
+ */
37
+ linkTag: {
38
+ type: String,
39
+ default: "a"
40
+ },
41
+ /**
42
+ * MDI icon drawn between entries.
43
+ * @type {string}
44
+ * @default 'mdi:chevron-right'
45
+ */
46
+ separatorIcon: {
47
+ type: String,
48
+ default: "mdi:chevron-right"
49
+ }
50
+ },
51
+ setup(__props) {
52
+ /**
53
+ * UiBreadcrumb — the trail from the site root down to the current page.
54
+ *
55
+ * The final item always renders as text with `aria-current="page"`, never a
56
+ * link: pointing a link at the page you are already on is noise for keyboard and
57
+ * screen-reader users. Separators are decorative icons.
58
+ *
59
+ * Links are rendered with `linkTag`, so a router link component can be used
60
+ * instead of a plain anchor — pass `link-tag="NuxtLink"` (or `RouterLink`) and
61
+ * give each item a `to`. For anything more involved, the `item` scoped slot
62
+ * hands back `{ item, index, isLast }` for full control of each entry.
63
+ *
64
+ * @example Anchor links
65
+ * <UiBreadcrumb
66
+ * :items="[
67
+ * { label: 'Home', href: '/' },
68
+ * { label: 'Docs', href: '/docs' },
69
+ * { label: 'Buttons' },
70
+ * ]"
71
+ * />
72
+ *
73
+ * @example Router links
74
+ * <UiBreadcrumb link-tag="NuxtLink" :items="[{ label: 'Products', to: '/products' }, { label: product.name }]" />
75
+ *
76
+ * @slot item — Override a single entry. Scope: `{ item, index, isLast }`.
77
+ */
78
+ return (_ctx, _cache) => {
79
+ return openBlock(), createElementBlock("nav", { "aria-label": __props.ariaLabel }, [createElementVNode("ol", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
80
+ return openBlock(), createElementBlock("li", {
81
+ key: item.label,
82
+ class: "flex items-center gap-1.5"
83
+ }, [index > 0 ? (openBlock(), createBlock(_sfc_main$1, {
84
+ key: 0,
85
+ name: __props.separatorIcon,
86
+ class: "size-4 text-gray-400 dark:text-gray-600"
87
+ }, null, 8, ["name"])) : createCommentVNode("", true), renderSlot(_ctx.$slots, "item", {
88
+ item,
89
+ index,
90
+ isLast: index === __props.items.length - 1
91
+ }, () => [(item.to || item.href) && index < __props.items.length - 1 ? (openBlock(), createBlock(resolveDynamicComponent(__props.linkTag), {
92
+ key: 0,
93
+ to: item.to,
94
+ href: item.href,
95
+ class: "rounded transition-colors hover:text-gray-900 dark:hover:text-gray-100"
96
+ }, {
97
+ default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
98
+ _: 2
99
+ }, 1032, ["to", "href"])) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(item.label), 1))])]);
100
+ }), 128))])], 8, _hoisted_1);
101
+ };
102
+ }
103
+ };
104
+ //#endregion
105
+ export { _sfc_main as default };
106
+
107
+ //# sourceMappingURL=Breadcrumb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Breadcrumb.js","names":[],"sources":["../../src/components/Breadcrumb.vue"],"sourcesContent":["<template>\n <nav :aria-label=\"ariaLabel\">\n <ol class=\"flex flex-wrap items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400\">\n <li v-for=\"(item, index) in items\" :key=\"item.label\" class=\"flex items-center gap-1.5\">\n <UiIcon\n v-if=\"index > 0\"\n :name=\"separatorIcon\"\n class=\"size-4 text-gray-400 dark:text-gray-600\"\n />\n\n <slot name=\"item\" :item=\"item\" :index=\"index\" :is-last=\"index === items.length - 1\">\n <component\n :is=\"linkTag\"\n v-if=\"(item.to || item.href) && index < items.length - 1\"\n :to=\"item.to\"\n :href=\"item.href\"\n class=\"rounded transition-colors hover:text-gray-900 dark:hover:text-gray-100\"\n >\n {{ item.label }}\n </component>\n\n <span v-else aria-current=\"page\" class=\"font-medium text-gray-900 dark:text-gray-200\">\n {{ item.label }}\n </span>\n </slot>\n </li>\n </ol>\n </nav>\n</template>\n\n<script setup>\n/**\n * UiBreadcrumb — the trail from the site root down to the current page.\n *\n * The final item always renders as text with `aria-current=\"page\"`, never a\n * link: pointing a link at the page you are already on is noise for keyboard and\n * screen-reader users. Separators are decorative icons.\n *\n * Links are rendered with `linkTag`, so a router link component can be used\n * instead of a plain anchor — pass `link-tag=\"NuxtLink\"` (or `RouterLink`) and\n * give each item a `to`. For anything more involved, the `item` scoped slot\n * hands back `{ item, index, isLast }` for full control of each entry.\n *\n * @example Anchor links\n * <UiBreadcrumb\n * :items=\"[\n * { label: 'Home', href: '/' },\n * { label: 'Docs', href: '/docs' },\n * { label: 'Buttons' },\n * ]\"\n * />\n *\n * @example Router links\n * <UiBreadcrumb link-tag=\"NuxtLink\" :items=\"[{ label: 'Products', to: '/products' }, { label: product.name }]\" />\n *\n * @slot item — Override a single entry. Scope: `{ item, index, isLast }`.\n */\nimport UiIcon from '../icons/Icon.vue'\n\ndefineProps({\n /**\n * Trail entries, ordered from the root down. Each is\n * `{ label, to?, href? }`; the final entry always renders as plain text.\n * @type {Array<{ label: string, to?: any, href?: string }>}\n */\n items: { type: Array, required: true },\n\n /**\n * Accessible name for the surrounding `<nav>`.\n * @type {string}\n * @default 'Breadcrumb'\n */\n ariaLabel: { type: String, default: 'Breadcrumb' },\n\n /**\n * Element or globally registered component used for linked entries.\n * @type {string}\n * @default 'a'\n */\n linkTag: { type: String, default: 'a' },\n\n /**\n * MDI icon drawn between entries.\n * @type {string}\n * @default 'mdi:chevron-right'\n */\n separatorIcon: { type: String, default: 'mdi:chevron-right' },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GACE,OAAA,UAAA,GAAA,mBA0BM,OAAA,EA1BA,cAAY,QAAA,UAAS,GAAA,CACzB,mBAwBK,MAxBL,YAwBK,EAvBH,UAAA,IAAA,GAAA,mBAsBK,UAAA,MAAA,WAtBuB,QAAA,QAAhB,MAAM,UAAK;IAAvB,OAAA,UAAA,GAAA,mBAsBK,MAAA;KAtB+B,KAAK,KAAK;KAAO,OAAM;IAEjD,GAAA,CAAA,QAAK,KADb,UAAA,GAAA,YAIE,aAAA;;KAFC,MAAM,QAAA;KACP,OAAM;IAGR,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAAA,WAcO,KAAA,QAAA,QAAA;KAdkB;KAAc;KAAQ,QAAS,UAAU,QAAA,MAAM,SAAM;IAA9E,SAcO,EAXI,KAAK,MAAM,KAAK,SAAS,QAAQ,QAAA,MAAM,SAAM,KAFtD,UAAA,GAAA,YAQY,wBAPL,QAAA,OAAO,GAAA;;KAEX,IAAI,KAAK;KACT,MAAM,KAAK;KACZ,OAAM;;KAEN,SAAA,cAAgB,CAAb,gBAAA,gBAAA,KAAK,KAAK,GAAA,CAAA,CAAA,CAAA;;IAGf,GAAA,MAAA,CAAA,MAAA,MAAA,CAAA,MAAA,UAAA,GAAA,mBAEO,QAFP,YAEO,gBADF,KAAK,KAAK,GAAA,CAAA,EAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,174 @@
1
+ import { computed, createBlock, createCommentVNode, createElementBlock, mergeProps, openBlock, renderSlot, resolveDynamicComponent, useAttrs, withCtx } from "vue";
2
+ import { twMerge } from "tailwind-merge";
3
+ //#region src/components/Card.vue
4
+ var _hoisted_1 = {
5
+ key: 0,
6
+ class: "mb-4 border-b border-gray-100 pb-4 dark:border-gray-800"
7
+ };
8
+ var _hoisted_2 = {
9
+ key: 1,
10
+ class: "mt-auto border-t border-gray-100 pt-4 dark:border-gray-800"
11
+ };
12
+ var _sfc_main = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
13
+ __name: "Card",
14
+ props: {
15
+ /**
16
+ * HTML element (or globally registered component name) to render as.
17
+ * @type {string}
18
+ * @default 'div'
19
+ * @values 'div' | 'article' | 'section' | 'a' | 'li' | any valid tag
20
+ */
21
+ tag: {
22
+ type: String,
23
+ default: "div"
24
+ },
25
+ /**
26
+ * Inner padding.
27
+ * @type {string}
28
+ * @default 'md'
29
+ * @values 'none' | 'xs' | 'sm' | 'md' | 'lg'
30
+ */
31
+ padding: {
32
+ type: String,
33
+ default: "md"
34
+ },
35
+ /**
36
+ * Corner radius.
37
+ * @type {string}
38
+ * @default '2xl'
39
+ * @values 'lg' | 'xl' | '2xl'
40
+ */
41
+ radius: {
42
+ type: String,
43
+ default: "2xl"
44
+ },
45
+ /**
46
+ * Base drop shadow. `interactive` raises this to `card-hover` on hover.
47
+ * @type {string}
48
+ * @default 'card'
49
+ * @values 'none' | 'card' | 'card-hover'
50
+ */
51
+ shadow: {
52
+ type: String,
53
+ default: "card"
54
+ },
55
+ /**
56
+ * Draw the surface border. On by default; turn off for cards that sit on a
57
+ * tinted panel and provide their own separation.
58
+ * @type {boolean}
59
+ * @default true
60
+ */
61
+ bordered: {
62
+ type: Boolean,
63
+ default: true
64
+ },
65
+ /**
66
+ * Hover affordance: a small lift and a stronger shadow, with the transition
67
+ * disabled under `prefers-reduced-motion`. Border-color is included in the
68
+ * transition but left untinted, so add a `hover:border-*` (or `group-hover:
69
+ * border-*`) class to colour the border on hover.
70
+ * @type {boolean}
71
+ * @default false
72
+ */
73
+ interactive: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ /**
78
+ * Recommended / featured state: accent border and a raised shadow, for the
79
+ * one card in a group that should draw the eye.
80
+ * @type {boolean}
81
+ * @default false
82
+ */
83
+ highlighted: {
84
+ type: Boolean,
85
+ default: false
86
+ },
87
+ /**
88
+ * Lift the focus ring to the card when a single descendant link is stretched
89
+ * over the whole surface (the `after:absolute after:inset-0` pattern). The
90
+ * card becomes the positioning context and shows the ring on focus-within.
91
+ * @type {boolean}
92
+ * @default false
93
+ */
94
+ focusRing: {
95
+ type: Boolean,
96
+ default: false
97
+ }
98
+ },
99
+ setup(__props) {
100
+ /**
101
+ * UiCard — the surface primitive: a bordered, rounded container with the
102
+ * design system's card elevation, dark-mode surface, and optional interactive
103
+ * and highlighted states.
104
+ *
105
+ * It is the shell only. Card lays out header / default / footer slots but takes
106
+ * no view over their contents, so product cards, blog cards, pricing tiers and
107
+ * link tiles can all share one surface while keeping their own internals.
108
+ *
109
+ * Renders as any element via `tag`, so a whole card can be a single link
110
+ * (`tag="a"`) or an article. External Tailwind classes are merged with
111
+ * `tailwind-merge`, so a caller's `hover:border-primary-300` wins over the
112
+ * neutral hover border added by `interactive` rather than doubling up.
113
+ *
114
+ * @example Basic card
115
+ * <UiCard>
116
+ * <h3 class="font-semibold">Title</h3>
117
+ * <p class="text-sm text-gray-600 dark:text-gray-400">Body copy.</p>
118
+ * </UiCard>
119
+ *
120
+ * @example Interactive card that is one big link (stretched-link pattern)
121
+ * <UiCard tag="article" interactive focus-ring>
122
+ * <h3><a href="/x" class="after:absolute after:inset-0">Title</a></h3>
123
+ * </UiCard>
124
+ *
125
+ * @example Highlighted pricing tier with a footer action
126
+ * <UiCard highlighted padding="lg" class="flex h-full flex-col">
127
+ * …
128
+ * <template #footer><UiButton block>Choose</UiButton></template>
129
+ * </UiCard>
130
+ *
131
+ * @slot default — Card body.
132
+ * @slot header — Optional header, drawn above the body with a divider.
133
+ * @slot footer — Optional footer, drawn below the body with a divider.
134
+ */
135
+ const props = __props;
136
+ const attrs = useAttrs();
137
+ const restAttrs = computed(() => {
138
+ const { class: _class, ...rest } = attrs;
139
+ return rest;
140
+ });
141
+ const paddingClass = computed(() => ({
142
+ none: "",
143
+ xs: "p-3",
144
+ sm: "p-4",
145
+ md: "p-5",
146
+ lg: "p-6"
147
+ })[props.padding] ?? "p-5");
148
+ const radiusClass = computed(() => ({
149
+ lg: "rounded-lg",
150
+ xl: "rounded-xl",
151
+ "2xl": "rounded-2xl"
152
+ })[props.radius] ?? "rounded-2xl");
153
+ const shadowClass = computed(() => ({
154
+ none: "",
155
+ card: "shadow-card",
156
+ "card-hover": "shadow-card-hover"
157
+ })[props.shadow] ?? "shadow-card");
158
+ const mergedClasses = computed(() => twMerge("bg-white dark:bg-gray-900", props.focusRing ? "relative" : "", radiusClass.value, props.bordered ? "border border-gray-200 dark:border-gray-700" : "", shadowClass.value, props.interactive ? "transition-[transform,box-shadow,border-color] duration-300 ease-out hover:-translate-y-1 hover:shadow-card-hover motion-reduce:transition-none motion-reduce:hover:translate-y-0" : "", props.highlighted ? "border-primary-400 shadow-card-hover ring-1 ring-primary-400/20 dark:border-primary-400/60 dark:ring-primary-400/25" : "", props.focusRing ? "focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-primary-500 dark:focus-within:outline-primary-400" : "", paddingClass.value, attrs.class));
159
+ return (_ctx, _cache) => {
160
+ return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps({ class: mergedClasses.value }, restAttrs.value), {
161
+ default: withCtx(() => [
162
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "header")])) : createCommentVNode("", true),
163
+ renderSlot(_ctx.$slots, "default"),
164
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_2, [renderSlot(_ctx.$slots, "footer")])) : createCommentVNode("", true)
165
+ ]),
166
+ _: 3
167
+ }, 16, ["class"]);
168
+ };
169
+ }
170
+ });
171
+ //#endregion
172
+ export { _sfc_main as default };
173
+
174
+ //# sourceMappingURL=Card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.js","names":["$slots"],"sources":["../../src/components/Card.vue"],"sourcesContent":["<template>\n <!-- Dynamic root element — renders as div, article, section, or a link via :is -->\n <component :is=\"tag\" :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <!-- Optional header region, separated from the body by a hairline rule -->\n <div v-if=\"$slots.header\" class=\"mb-4 border-b border-gray-100 pb-4 dark:border-gray-800\">\n <slot name=\"header\" />\n </div>\n\n <slot />\n\n <!-- Optional footer region, pushed to the bottom in a flex-column card -->\n <div v-if=\"$slots.footer\" class=\"mt-auto border-t border-gray-100 pt-4 dark:border-gray-800\">\n <slot name=\"footer\" />\n </div>\n </component>\n</template>\n\n<script setup>\n/**\n * UiCard — the surface primitive: a bordered, rounded container with the\n * design system's card elevation, dark-mode surface, and optional interactive\n * and highlighted states.\n *\n * It is the shell only. Card lays out header / default / footer slots but takes\n * no view over their contents, so product cards, blog cards, pricing tiers and\n * link tiles can all share one surface while keeping their own internals.\n *\n * Renders as any element via `tag`, so a whole card can be a single link\n * (`tag=\"a\"`) or an article. External Tailwind classes are merged with\n * `tailwind-merge`, so a caller's `hover:border-primary-300` wins over the\n * neutral hover border added by `interactive` rather than doubling up.\n *\n * @example Basic card\n * <UiCard>\n * <h3 class=\"font-semibold\">Title</h3>\n * <p class=\"text-sm text-gray-600 dark:text-gray-400\">Body copy.</p>\n * </UiCard>\n *\n * @example Interactive card that is one big link (stretched-link pattern)\n * <UiCard tag=\"article\" interactive focus-ring>\n * <h3><a href=\"/x\" class=\"after:absolute after:inset-0\">Title</a></h3>\n * </UiCard>\n *\n * @example Highlighted pricing tier with a footer action\n * <UiCard highlighted padding=\"lg\" class=\"flex h-full flex-col\">\n * …\n * <template #footer><UiButton block>Choose</UiButton></template>\n * </UiCard>\n *\n * @slot default — Card body.\n * @slot header — Optional header, drawn above the body with a divider.\n * @slot footer — Optional footer, drawn below the body with a divider.\n */\nimport { computed, useAttrs } from 'vue'\nimport { twMerge } from 'tailwind-merge'\n\nconst props = defineProps({\n /**\n * HTML element (or globally registered component name) to render as.\n * @type {string}\n * @default 'div'\n * @values 'div' | 'article' | 'section' | 'a' | 'li' | any valid tag\n */\n tag: { type: String, default: 'div' },\n\n /**\n * Inner padding.\n * @type {string}\n * @default 'md'\n * @values 'none' | 'xs' | 'sm' | 'md' | 'lg'\n */\n padding: { type: String, default: 'md' },\n\n /**\n * Corner radius.\n * @type {string}\n * @default '2xl'\n * @values 'lg' | 'xl' | '2xl'\n */\n radius: { type: String, default: '2xl' },\n\n /**\n * Base drop shadow. `interactive` raises this to `card-hover` on hover.\n * @type {string}\n * @default 'card'\n * @values 'none' | 'card' | 'card-hover'\n */\n shadow: { type: String, default: 'card' },\n\n /**\n * Draw the surface border. On by default; turn off for cards that sit on a\n * tinted panel and provide their own separation.\n * @type {boolean}\n * @default true\n */\n bordered: { type: Boolean, default: true },\n\n /**\n * Hover affordance: a small lift and a stronger shadow, with the transition\n * disabled under `prefers-reduced-motion`. Border-color is included in the\n * transition but left untinted, so add a `hover:border-*` (or `group-hover:\n * border-*`) class to colour the border on hover.\n * @type {boolean}\n * @default false\n */\n interactive: { type: Boolean, default: false },\n\n /**\n * Recommended / featured state: accent border and a raised shadow, for the\n * one card in a group that should draw the eye.\n * @type {boolean}\n * @default false\n */\n highlighted: { type: Boolean, default: false },\n\n /**\n * Lift the focus ring to the card when a single descendant link is stretched\n * over the whole surface (the `after:absolute after:inset-0` pattern). The\n * card becomes the positioning context and shows the ring on focus-within.\n * @type {boolean}\n * @default false\n */\n focusRing: { type: Boolean, default: false },\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst restAttrs = computed(() => {\n const { class: _class, ...rest } = attrs\n return rest\n})\n\nconst paddingClass = computed(\n () => ({ none: '', xs: 'p-3', sm: 'p-4', md: 'p-5', lg: 'p-6' })[props.padding] ?? 'p-5',\n)\n\nconst radiusClass = computed(\n () =>\n ({ lg: 'rounded-lg', xl: 'rounded-xl', '2xl': 'rounded-2xl' })[props.radius] ?? 'rounded-2xl',\n)\n\nconst shadowClass = computed(\n () =>\n ({ none: '', card: 'shadow-card', 'card-hover': 'shadow-card-hover' })[props.shadow] ??\n 'shadow-card',\n)\n\nconst mergedClasses = computed(() =>\n twMerge(\n 'bg-white dark:bg-gray-900',\n props.focusRing ? 'relative' : '',\n radiusClass.value,\n props.bordered ? 'border border-gray-200 dark:border-gray-700' : '',\n shadowClass.value,\n props.interactive\n ? 'transition-[transform,box-shadow,border-color] duration-300 ease-out hover:-translate-y-1 hover:shadow-card-hover motion-reduce:transition-none motion-reduce:hover:translate-y-0'\n : '',\n props.highlighted\n ? 'border-primary-400 shadow-card-hover ring-1 ring-primary-400/20 dark:border-primary-400/60 dark:ring-primary-400/25'\n : '',\n props.focusRing\n ? 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-primary-500 dark:focus-within:outline-primary-400'\n : '',\n paddingClass.value,\n attrs.class,\n ),\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDA,MAAM,QAAQ;EAuEd,MAAM,QAAQ,SAAS;EACvB,MAAM,YAAY,eAAe;GAC/B,MAAM,EAAE,OAAO,QAAQ,GAAG,SAAS;GACnC,OAAO;EACT,CAAC;EAED,MAAM,eAAe,gBACZ;GAAE,MAAM;GAAI,IAAI;GAAO,IAAI;GAAO,IAAI;GAAO,IAAI;EAAM,EAAA,CAAG,MAAM,YAAY,KACrF;EAEA,MAAM,cAAc,gBAEf;GAAE,IAAI;GAAc,IAAI;GAAc,OAAO;EAAc,EAAA,CAAG,MAAM,WAAW,aACpF;EAEA,MAAM,cAAc,gBAEf;GAAE,MAAM;GAAI,MAAM;GAAe,cAAc;EAAoB,EAAA,CAAG,MAAM,WAC7E,aACJ;EAEA,MAAM,gBAAgB,eACpB,QACE,6BACA,MAAM,YAAY,aAAa,IAC/B,YAAY,OACZ,MAAM,WAAW,gDAAgD,IACjE,YAAY,OACZ,MAAM,cACF,sLACA,IACJ,MAAM,cACF,wHACA,IACJ,MAAM,YACF,gIACA,IACJ,aAAa,OACb,MAAM,KACR,CACF;;GArKE,OAAA,UAAA,GAAA,YAYY,wBAZI,QAAA,GAAG,GAAnB,WAYY,EAZU,OAAO,cAAA,MAAa,GAAU,UAAA,KAAS,GAAA;IAE3D,SAAA,cAEM;KAFKA,KAAAA,OAAO,UAAlB,UAAA,GAAA,mBAEM,OAFN,YAEM,CADJ,WAAsB,KAAA,QAAA,QAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;KAGxB,WAAQ,KAAA,QAAA,SAAA;KAGGA,KAAAA,OAAO,UAAlB,UAAA,GAAA,mBAEM,OAFN,YAEM,CADJ,WAAsB,KAAA,QAAA,QAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA"}
@@ -0,0 +1,96 @@
1
+ import _sfc_main$1 from "../icons/Icon.js";
2
+ import { computed, createElementBlock, createVNode, mergeProps, normalizeClass, openBlock, useAttrs } from "vue";
3
+ import { twMerge } from "tailwind-merge";
4
+ //#region src/components/IconTile.vue
5
+ var _sfc_main = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
6
+ __name: "IconTile",
7
+ props: {
8
+ /**
9
+ * MDI icon name.
10
+ * @type {string}
11
+ */
12
+ icon: {
13
+ type: String,
14
+ required: true
15
+ },
16
+ /**
17
+ * Tint colour from the semantic palette.
18
+ * @type {string}
19
+ * @default 'primary'
20
+ * @values 'primary' | 'gray' | 'success' | 'warning' | 'error' | 'blue'
21
+ */
22
+ color: {
23
+ type: String,
24
+ default: "primary"
25
+ },
26
+ /**
27
+ * Tile size (the radius scales with it).
28
+ * @type {string}
29
+ * @default 'md'
30
+ * @values 'sm' | 'md' | 'lg' | 'xl'
31
+ */
32
+ size: {
33
+ type: String,
34
+ default: "md"
35
+ }
36
+ },
37
+ setup(__props) {
38
+ /**
39
+ * UiIconTile — a small rounded, tinted tile holding a single icon: the motif
40
+ * that stands in for a product logo or marks a feature next to a heading.
41
+ *
42
+ * Decorative by default — the icon is `aria-hidden`, on the assumption that a
43
+ * label sits next to it in text. The tint uses the design system's semantic
44
+ * colours; for a colour outside that set (a Tailwind palette, say) pass the
45
+ * `bg-*`/`text-*` classes directly and they override the built-in tint via
46
+ * `tailwind-merge`.
47
+ *
48
+ * @example Primary feature tile
49
+ * <UiIconTile icon="mdi:shield-lock-outline" />
50
+ *
51
+ * @example Large product mark in a custom colour
52
+ * <UiIconTile icon="mdi:note-text-outline" size="lg" class="bg-sky-100 text-sky-700" />
53
+ *
54
+ * @example Success tile
55
+ * <UiIconTile icon="mdi:check" color="success" size="sm" />
56
+ */
57
+ const props = __props;
58
+ const sizeClass = computed(() => ({
59
+ sm: "size-9 rounded-lg",
60
+ md: "size-11 rounded-xl",
61
+ lg: "size-14 rounded-2xl",
62
+ xl: "size-16 rounded-2xl"
63
+ })[props.size] ?? "size-11 rounded-xl");
64
+ const iconSizeClass = computed(() => ({
65
+ sm: "size-5",
66
+ md: "size-6",
67
+ lg: "size-8",
68
+ xl: "size-9"
69
+ })[props.size] ?? "size-6");
70
+ const colorClass = computed(() => ({
71
+ primary: "bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300",
72
+ gray: "bg-gray-100 text-gray-700 dark:bg-gray-700/60 dark:text-gray-200",
73
+ success: "bg-success-100 text-success-700 dark:bg-success-400/15 dark:text-success-300",
74
+ warning: "bg-warning-100 text-warning-700 dark:bg-warning-400/15 dark:text-warning-300",
75
+ error: "bg-error-100 text-error-700 dark:bg-error-400/15 dark:text-error-300",
76
+ blue: "bg-blue-100 text-blue-700 dark:bg-blue-400/15 dark:text-blue-300"
77
+ })[props.color] ?? "bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300");
78
+ const attrs = useAttrs();
79
+ const restAttrs = computed(() => {
80
+ const { class: _class, ...rest } = attrs;
81
+ return rest;
82
+ });
83
+ const mergedClasses = computed(() => twMerge(sizeClass.value, colorClass.value, attrs.class));
84
+ return (_ctx, _cache) => {
85
+ return openBlock(), createElementBlock("span", mergeProps({ class: ["inline-flex items-center justify-center", mergedClasses.value] }, restAttrs.value), [createVNode(_sfc_main$1, {
86
+ name: __props.icon,
87
+ class: normalizeClass(iconSizeClass.value),
88
+ "aria-hidden": "true"
89
+ }, null, 8, ["name", "class"])], 16);
90
+ };
91
+ }
92
+ });
93
+ //#endregion
94
+ export { _sfc_main as default };
95
+
96
+ //# sourceMappingURL=IconTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconTile.js","names":[],"sources":["../../src/components/IconTile.vue"],"sourcesContent":["<template>\n <span class=\"inline-flex items-center justify-center\" :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <UiIcon :name=\"icon\" :class=\"iconSizeClass\" aria-hidden=\"true\" />\n </span>\n</template>\n\n<script setup>\n/**\n * UiIconTile — a small rounded, tinted tile holding a single icon: the motif\n * that stands in for a product logo or marks a feature next to a heading.\n *\n * Decorative by default — the icon is `aria-hidden`, on the assumption that a\n * label sits next to it in text. The tint uses the design system's semantic\n * colours; for a colour outside that set (a Tailwind palette, say) pass the\n * `bg-*`/`text-*` classes directly and they override the built-in tint via\n * `tailwind-merge`.\n *\n * @example Primary feature tile\n * <UiIconTile icon=\"mdi:shield-lock-outline\" />\n *\n * @example Large product mark in a custom colour\n * <UiIconTile icon=\"mdi:note-text-outline\" size=\"lg\" class=\"bg-sky-100 text-sky-700\" />\n *\n * @example Success tile\n * <UiIconTile icon=\"mdi:check\" color=\"success\" size=\"sm\" />\n */\nimport { computed, useAttrs } from 'vue'\nimport { twMerge } from 'tailwind-merge'\nimport UiIcon from '../icons/Icon.vue'\n\nconst props = defineProps({\n /**\n * MDI icon name.\n * @type {string}\n */\n icon: { type: String, required: true },\n\n /**\n * Tint colour from the semantic palette.\n * @type {string}\n * @default 'primary'\n * @values 'primary' | 'gray' | 'success' | 'warning' | 'error' | 'blue'\n */\n color: { type: String, default: 'primary' },\n\n /**\n * Tile size (the radius scales with it).\n * @type {string}\n * @default 'md'\n * @values 'sm' | 'md' | 'lg' | 'xl'\n */\n size: { type: String, default: 'md' },\n})\n\nconst sizeClass = computed(\n () =>\n ({\n sm: 'size-9 rounded-lg',\n md: 'size-11 rounded-xl',\n lg: 'size-14 rounded-2xl',\n xl: 'size-16 rounded-2xl',\n })[props.size] ?? 'size-11 rounded-xl',\n)\n\nconst iconSizeClass = computed(\n () =>\n ({\n sm: 'size-5',\n md: 'size-6',\n lg: 'size-8',\n xl: 'size-9',\n })[props.size] ?? 'size-6',\n)\n\nconst colorClass = computed(\n () =>\n ({\n primary: 'bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300',\n gray: 'bg-gray-100 text-gray-700 dark:bg-gray-700/60 dark:text-gray-200',\n success: 'bg-success-100 text-success-700 dark:bg-success-400/15 dark:text-success-300',\n warning: 'bg-warning-100 text-warning-700 dark:bg-warning-400/15 dark:text-warning-300',\n error: 'bg-error-100 text-error-700 dark:bg-error-400/15 dark:text-error-300',\n blue: 'bg-blue-100 text-blue-700 dark:bg-blue-400/15 dark:text-blue-300',\n })[props.color] ??\n 'bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300',\n)\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst restAttrs = computed(() => {\n const { class: _class, ...rest } = attrs\n return rest\n})\n\n// External classes merge last so a caller's `bg-*`/`text-*` (e.g. a Tailwind\n// palette outside the semantic set) overrides the built-in tint rather than\n// colliding with it.\nconst mergedClasses = computed(() => twMerge(sizeClass.value, colorClass.value, attrs.class))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,QAAQ;EAwBd,MAAM,YAAY,gBAEb;GACC,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,EAAA,CAAG,MAAM,SAAS,oBACtB;EAEA,MAAM,gBAAgB,gBAEjB;GACC,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,EAAA,CAAG,MAAM,SAAS,QACtB;EAEA,MAAM,aAAa,gBAEd;GACC,SAAS;GACT,MAAM;GACN,SAAS;GACT,SAAS;GACT,OAAO;GACP,MAAM;EACR,EAAA,CAAG,MAAM,UACT,8EACJ;EAIA,MAAM,QAAQ,SAAS;EACvB,MAAM,YAAY,eAAe;GAC/B,MAAM,EAAE,OAAO,QAAQ,GAAG,SAAS;GACnC,OAAO;EACT,CAAC;EAKD,MAAM,gBAAgB,eAAe,QAAQ,UAAU,OAAO,WAAW,OAAO,MAAM,KAAK,CAAC;;GAjG1F,OAAA,UAAA,GAAA,mBAEO,QAFP,WAEO,EAFD,OAAK,CAAC,2CAAkD,cAAA,KAAa,EAAU,GAAA,UAAA,KAAS,GAAA,CAC5F,YAAiE,aAAA;IAAxD,MAAM,QAAA;IAAO,OAAK,eAAE,cAAA,KAAa;IAAE,eAAY"}