numori-ui 0.3.0 → 0.5.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 +148 -0
- package/README.md +36 -34
- package/dist/components/AppShell.js +234 -0
- package/dist/components/AppShell.js.map +1 -0
- package/dist/components/Banner.js +29 -32
- package/dist/components/Banner.js.map +1 -1
- package/dist/components/Button.js +10 -19
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.js +15 -9
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Checkbox.js +13 -9
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/CopyField.js +195 -0
- package/dist/components/CopyField.js.map +1 -0
- package/dist/components/DescriptionList.js +116 -0
- package/dist/components/DescriptionList.js.map +1 -0
- package/dist/components/Dropdown.js +10 -3
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/DropdownSubmenu.js +5 -3
- package/dist/components/DropdownSubmenu.js.map +1 -1
- package/dist/components/EmptyState.js +123 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/FileInput.js +12 -4
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/FormField.js +43 -13
- package/dist/components/FormField.js.map +1 -1
- package/dist/components/IconTile.js +5 -9
- package/dist/components/IconTile.js.map +1 -1
- package/dist/components/Input.js +21 -7
- package/dist/components/Input.js.map +1 -1
- package/dist/components/ListMenuItem.js +38 -31
- package/dist/components/ListMenuItem.js.map +1 -1
- package/dist/components/Numpad.js +4 -4
- package/dist/components/Numpad.js.map +1 -1
- package/dist/components/PageHeader.js +106 -0
- package/dist/components/PageHeader.js.map +1 -0
- package/dist/components/Pagination.js +236 -0
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Popup.js +9 -3
- package/dist/components/Popup.js.map +1 -1
- package/dist/components/Radio.js +2 -7
- package/dist/components/Radio.js.map +1 -1
- package/dist/components/Segmented.js +109 -27
- package/dist/components/Segmented.js.map +1 -1
- package/dist/components/Select.js +16 -5
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Sidebar.js +69 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/SidebarGroup.js +50 -0
- package/dist/components/SidebarGroup.js.map +1 -0
- package/dist/components/SidebarItem.js +167 -0
- package/dist/components/SidebarItem.js.map +1 -0
- package/dist/components/StatCard.js +185 -0
- package/dist/components/StatCard.js.map +1 -0
- package/dist/components/Table.js +306 -0
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Tabs.js +216 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/Toggle.js +11 -2
- package/dist/components/Toggle.js.map +1 -1
- package/dist/components/index.js +91 -76
- package/dist/components/index.js.map +1 -1
- package/dist/composables/useMergedClasses.js +52 -0
- package/dist/composables/useMergedClasses.js.map +1 -0
- package/dist/icons/mdi.js +11 -0
- package/dist/icons/mdi.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +47 -37
- package/dist/index.js.map +1 -1
- package/dist/internal/controlSizes.js +21 -0
- package/dist/internal/controlSizes.js.map +1 -0
- package/dist/internal/formField.js +26 -0
- package/dist/internal/formField.js.map +1 -0
- package/dist/internal/menu.js +20 -0
- package/dist/internal/menu.js.map +1 -0
- package/dist/manifest.js +12 -2
- package/dist/manifest.js.map +1 -1
- package/package.json +2 -1
- package/src/components/AppShell.vue +231 -0
- package/src/components/Banner.vue +20 -9
- package/src/components/Button.vue +12 -19
- package/src/components/Card.vue +11 -12
- package/src/components/Checkbox.vue +7 -10
- package/src/components/CopyField.vue +178 -0
- package/src/components/DescriptionList.vue +114 -0
- package/src/components/Dropdown.vue +14 -2
- package/src/components/DropdownSubmenu.vue +4 -2
- package/src/components/EmptyState.vue +107 -0
- package/src/components/FileInput.vue +19 -4
- package/src/components/FormField.vue +37 -4
- package/src/components/IconTile.vue +4 -9
- package/src/components/Input.vue +15 -6
- package/src/components/ListMenuItem.vue +21 -5
- package/src/components/Numpad.vue +7 -4
- package/src/components/PageHeader.vue +102 -0
- package/src/components/Pagination.vue +199 -0
- package/src/components/Popup.vue +6 -2
- package/src/components/Radio.vue +2 -10
- package/src/components/Segmented.vue +113 -38
- package/src/components/Select.vue +16 -2
- package/src/components/Sidebar.vue +61 -0
- package/src/components/SidebarGroup.vue +43 -0
- package/src/components/SidebarItem.vue +159 -0
- package/src/components/StatCard.vue +165 -0
- package/src/components/Table.vue +323 -0
- package/src/components/Tabs.vue +217 -0
- package/src/components/Toggle.vue +5 -0
- package/src/components/index.js +36 -11
- package/src/composables/useMergedClasses.js +49 -0
- package/src/icons/mdi.js +11 -0
- package/src/internal/controlSizes.js +17 -0
- package/src/internal/formField.js +23 -0
- package/src/internal/menu.js +16 -0
- package/src/manifest.js +12 -2
- package/dist/components/ButtonsGroup.js +0 -153
- package/dist/components/ButtonsGroup.js.map +0 -1
- package/dist/components/ComparisonTable.js +0 -152
- package/dist/components/ComparisonTable.js.map +0 -1
- package/src/components/ButtonsGroup.vue +0 -140
- package/src/components/ComparisonTable.vue +0 -141
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,152 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
While the library is pre-1.0, minor versions may add components and options; patch
|
|
8
8
|
versions are fixes.
|
|
9
9
|
|
|
10
|
+
## [0.5.0] — 2026-11-30
|
|
11
|
+
|
|
12
|
+
Application and dashboard building blocks. Eleven new components cover the frame
|
|
13
|
+
of an application (shell, sidebar, page header, tabs) and the pieces admin
|
|
14
|
+
screens are made of (stat cards, empty states, description lists, pagination,
|
|
15
|
+
copyable secrets). `UiTable` gains sorting and empty/loading states. Nothing
|
|
16
|
+
existing changes behaviour, so this is a drop-in upgrade from 0.4.0. The library
|
|
17
|
+
is now 49 components (50 registered tags, including `UiIcon`).
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **`UiAppShell`** — sidebar, sticky top bar and content area. The sidebar is
|
|
22
|
+
pinned from `lg` up and becomes an off-canvas drawer below that (backdrop,
|
|
23
|
+
Escape, and `inert` while closed so hidden links are not tab stops). Includes
|
|
24
|
+
a skip link, `v-model:open`, and `sidebarWidth` / `maxWidth` / `padded`.
|
|
25
|
+
- **`UiSidebar`**, **`UiSidebarGroup`**, **`UiSidebarItem`** — a labelled
|
|
26
|
+
`<nav>` with header and footer regions, labelled groups, and router-agnostic
|
|
27
|
+
items: `to` renders through `RouterLink` (or any `tag`, such as `NuxtLink`),
|
|
28
|
+
`href` an anchor, neither a button. `active` sets `aria-current="page"`; items
|
|
29
|
+
take an icon and a count badge, and close the shell's drawer when chosen.
|
|
30
|
+
- **`UiPageHeader`** — breadcrumb, title (heading `level` 1–3), inline badges,
|
|
31
|
+
description and an actions area that wraps on narrow screens.
|
|
32
|
+
- **`UiTabs`** — the WAI-ARIA tabs pattern: `tablist` / `tab` / `tabpanel`
|
|
33
|
+
roles, a roving `tabindex`, arrow keys, Home and End, skipping disabled tabs.
|
|
34
|
+
`line` and `pill` variants, per-tab icons and badges, and `:panel="false"` for
|
|
35
|
+
tabs that only navigate.
|
|
36
|
+
- **`UiStatCard`** — label, value, tinted icon, trend delta and hint, with a
|
|
37
|
+
same-height loading placeholder. Built on `UiCard`.
|
|
38
|
+
- **`UiEmptyState`** — icon, title, description and actions, with `compact` and
|
|
39
|
+
`bordered` variants.
|
|
40
|
+
- **`UiDescriptionList`** — label/value pairs as a real `<dl>` in `inline`,
|
|
41
|
+
`stacked` or `grid` layouts, with monospace values, hints, explicit empty text
|
|
42
|
+
and a `#value` slot.
|
|
43
|
+
- **`UiPagination`** — first, last and current ± `siblings` pages with gaps, a
|
|
44
|
+
"21–40 of 134" summary, `v-model:page`, and every label configurable.
|
|
45
|
+
- **`UiCopyField`** — a read-only value with a copy button. With `secret` the
|
|
46
|
+
value is masked until revealed, and the real text is not rendered while
|
|
47
|
+
masked.
|
|
48
|
+
- **`UiTable`** — controlled sorting (`sortable` columns, `sort-key`,
|
|
49
|
+
`sort-direction`, a `sort` event, `aria-sort`), `loading` (a spinner, or
|
|
50
|
+
dimmed rows while refreshing), `emptyText` and an `#empty` slot, and
|
|
51
|
+
`clickable-rows` with a `row-click` event that also fires on Enter.
|
|
52
|
+
- Icons `menu`, `arrow-up`, `arrow-down`, `unfold-more-horizontal`,
|
|
53
|
+
`inbox-outline`, `trending-up`, `trending-down` and `trending-neutral` added
|
|
54
|
+
to the bundled set.
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- **`UiFormField` labels now reach the control.** The `<label>` was not
|
|
59
|
+
associated with anything, so clicking it did nothing and screen readers
|
|
60
|
+
announced inputs without their label, hint or error. The field now provides
|
|
61
|
+
an id that `UiInput`, `UiSelect`, `UiToggle`, `UiCheckbox` and `UiSegmented`
|
|
62
|
+
apply to their real control, along with `aria-describedby` (hint and error)
|
|
63
|
+
and `aria-invalid` (when there is an error). For other controls, pass the
|
|
64
|
+
control's id as the new `for` prop.
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- The `app.use(NumoriUI)` tree-shaking budget rises from 120 kB to 150 kB to
|
|
69
|
+
cover the new components. Named imports are unaffected, and a new case checks
|
|
70
|
+
that the dashboard components do not pull in forms or overlays.
|
|
71
|
+
- README: Numori UI is now the source of truth for its components. The note
|
|
72
|
+
saying Numori Notes is where they are developed was out of date.
|
|
73
|
+
|
|
74
|
+
## [0.4.0] — 2026-08-31
|
|
75
|
+
|
|
76
|
+
A consolidation-and-polish release. Two components fold into more capable,
|
|
77
|
+
cohesive ones, related controls gain matching APIs, and a class of SSR
|
|
78
|
+
hydration bugs is fixed. The library is now 38 components (39 registered tags,
|
|
79
|
+
including `UiIcon`).
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
|
|
83
|
+
- **`UiTable`** — a general, accessible data table: `columns` / `rows`,
|
|
84
|
+
per-column alignment, row-header columns, an optional per-column leading
|
|
85
|
+
`icon`, a highlightable column, and a `#cell` scoped slot for custom cells.
|
|
86
|
+
Configuring `header` + `highlight` + `icon` columns reproduces the old
|
|
87
|
+
comparison table, so comparison is now a feature rather than a component.
|
|
88
|
+
- **`UiSegmented`** gains a `variant` prop matching `UiButton` — `solid`
|
|
89
|
+
(default), `outline`, `ghost` — a `square` shape, a `block` full-width mode,
|
|
90
|
+
and per-option `title` and `disabled`. The sliding indicator now animates in
|
|
91
|
+
every variant. (Its previous `rounded` shape is now `round`, matching
|
|
92
|
+
`UiButton`.)
|
|
93
|
+
- `mdi:chevron-left` added to the bundled icon set, completing the nav-chevron
|
|
94
|
+
family (`up` / `down` / `left` / `right`).
|
|
95
|
+
|
|
96
|
+
### Changed (breaking)
|
|
97
|
+
|
|
98
|
+
- **`UiComparisonTable` removed, replaced by the new `UiTable`** (see Added).
|
|
99
|
+
Comparison is now a configuration of a general data table. Migrate by moving
|
|
100
|
+
rows/labels into `UiTable`'s `columns` + `rows`: mark the label column
|
|
101
|
+
`header: true`, the featured column `highlight: true`, and give value columns
|
|
102
|
+
an `icon`.
|
|
103
|
+
- **`UiButton` shapes trimmed to `round` / `pill` / `square`.** The old `circle`
|
|
104
|
+
and `none` were redundant — `circle` was identical to `pill` (`rounded-full`)
|
|
105
|
+
and `none` collapsed to `round`. The set now matches `UiSegmented`'s `shape`.
|
|
106
|
+
For a circular icon button, use `shape="pill"` with `icon-only`.
|
|
107
|
+
- **`UiButtonsGroup` removed; its role is now covered by `UiSegmented`.** The two
|
|
108
|
+
were the same control — single-select from a small row of segments — with
|
|
109
|
+
different looks. `UiSegmented`'s `variant` prop mirrors `UiButton` — `solid`
|
|
110
|
+
(default), `outline`, and `ghost` — so the two read as one family, and the
|
|
111
|
+
sliding indicator animates as the selection changes in every variant. `shape`
|
|
112
|
+
is `pill` (default), `round`, or `square`, and the indicator matches the
|
|
113
|
+
track's radius. Plus a `block` full-width mode and per-option `title`. Migrate
|
|
114
|
+
a toolbar/tabs `UiButtonsGroup` by switching the tag to `UiSegmented`;
|
|
115
|
+
icon-only toolbars use options that carry an `icon` and no `label`.
|
|
116
|
+
|
|
117
|
+
### Fixed
|
|
118
|
+
|
|
119
|
+
- **SSR hydration mismatches from invalid nested `<button>`s.** `UiBanner` (when
|
|
120
|
+
`clickable` + `dismissible`) and `UiListMenuItem` (an interactive row with an
|
|
121
|
+
interactive suffix such as `UiToggle` or `UiSelect`) nested a `<button>` inside
|
|
122
|
+
a `<button>`, which browsers restructure — so the hydrated DOM no longer
|
|
123
|
+
matched the server markup and the tree re-patched on load (a visible "settling"
|
|
124
|
+
wobble). `UiBanner` now uses a full-cover click target that is a sibling of the
|
|
125
|
+
dismiss control, and `UiListMenuItem`'s interactive root is a keyboard-operable
|
|
126
|
+
`<div role="button">`. No nested interactive elements, no mismatch.
|
|
127
|
+
- **`UiFileInput` did not open the picker when its trigger was a button.** A
|
|
128
|
+
`<label>` skips forwarding a click to its control when the click lands on an
|
|
129
|
+
interactive descendant; the wrapper now handles the click itself, so any
|
|
130
|
+
trigger content works.
|
|
131
|
+
- **Floating panels drifted while opening.** `UiSelect`, `UiDropdown`, `UiPopup`
|
|
132
|
+
and `UiDropdownSubmenu` now scale in from the edge nearest their trigger
|
|
133
|
+
(transform-origin) instead of expanding from their centre.
|
|
134
|
+
- **`UiNumpad` key contrast.** Hover used a non-existent token in dark mode and
|
|
135
|
+
the page-background colour in light mode; keys now use a proper hover/active
|
|
136
|
+
progression in both themes.
|
|
137
|
+
- **`UiInput` number steppers.** The stacked-chevron columns were too narrow and
|
|
138
|
+
their buttons did not fill the column; both are corrected.
|
|
139
|
+
- **Menu-row hover highlight.** `UiButton`'s `menu-item` and `list-item`
|
|
140
|
+
variants — and the `UiDropdownItem` / `UiDropdown` / `UiListMenu` rows built on
|
|
141
|
+
them — now round their hover/active highlight instead of drawing a square that
|
|
142
|
+
poked past the rounded menu panel. `UiDropdown` also insets its rows so the
|
|
143
|
+
highlight reads as a chip.
|
|
144
|
+
- **`UiNumpad` keys keep their size** via a minimum width, rather than shrinking
|
|
145
|
+
in narrow or flex containers.
|
|
146
|
+
|
|
147
|
+
### Internal
|
|
148
|
+
|
|
149
|
+
- Extracted the shared `tailwind-merge` + attribute-forwarding pattern
|
|
150
|
+
(external classes override internal ones) into a `useMergedClasses` composable,
|
|
151
|
+
used by `UiButton`, `UiCard` and `UiIconTile`.
|
|
152
|
+
- Extracted the shared floating-menu panel chrome into a single constant reused
|
|
153
|
+
by `UiDropdown`, `UiSelect`, `UiPopup` and `UiDropdownSubmenu`.
|
|
154
|
+
- De-duplicated the identical size scale shared by `UiCheckbox` and `UiRadio`.
|
|
155
|
+
|
|
10
156
|
## [0.3.0] — 2026-08-31
|
|
11
157
|
|
|
12
158
|
Six new components, bringing the library to 39 components (40 registered tags,
|
|
@@ -85,6 +231,8 @@ including `UiIcon`). All additions are backward compatible.
|
|
|
85
231
|
- First published release: 28 components (29 registered tags), consumable as a
|
|
86
232
|
Nuxt module, a Vite plugin or a framework-agnostic Vue plugin.
|
|
87
233
|
|
|
234
|
+
[0.5.0]: https://github.com/Numori-Ecosystem/Numori-UI/releases/tag/v0.5.0
|
|
235
|
+
[0.4.0]: https://github.com/Numori-Ecosystem/Numori-UI/releases/tag/v0.4.0
|
|
88
236
|
[0.3.0]: https://github.com/Numori-Ecosystem/Numori-UI/releases/tag/v0.3.0
|
|
89
237
|
[0.2.0]: https://github.com/Numori-Ecosystem/Numori-UI/releases/tag/v0.2.0
|
|
90
238
|
[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.
|
|
3
|
+
The Numori design system as a standalone Vue 3 component library. 49 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
|
|
136
|
+
There is also `app.use(NumoriUI)`, which registers all 39 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
|
|
@@ -222,21 +222,21 @@ at. Referencing three components ships three.
|
|
|
222
222
|
Measured with `npm run treeshake`, bundling each case for real with `vue` and `tailwind-merge`
|
|
223
223
|
external, so the numbers are Numori UI's own code:
|
|
224
224
|
|
|
225
|
-
| How you consume it | Bundled
|
|
226
|
-
| ----------------------------------------- |
|
|
227
|
-
| `import { UiKbd }` | 0.4 kB
|
|
228
|
-
| `import UiKbd from 'numori-ui/…/Kbd.vue'` | 0.4 kB
|
|
229
|
-
| `import { UiButton }` |
|
|
230
|
-
| `import { UiButton, UiModal, UiInput }` |
|
|
231
|
-
| `createNumoriUI({ UiButton, UiModal })` |
|
|
232
|
-
| `app.use(NumoriUI)` |
|
|
225
|
+
| How you consume it | Bundled |
|
|
226
|
+
| ----------------------------------------- | -------- |
|
|
227
|
+
| `import { UiKbd }` | 0.4 kB |
|
|
228
|
+
| `import UiKbd from 'numori-ui/…/Kbd.vue'` | 0.4 kB |
|
|
229
|
+
| `import { UiButton }` | 18.9 kB |
|
|
230
|
+
| `import { UiButton, UiModal, UiInput }` | 34.5 kB |
|
|
231
|
+
| `createNumoriUI({ UiButton, UiModal })` | 23.2 kB |
|
|
232
|
+
| `app.use(NumoriUI)` | 101.9 kB |
|
|
233
233
|
|
|
234
234
|
**The Nuxt module and Vite plugin are already optimal.** Both point at the raw `.vue` sources and
|
|
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
|
|
239
|
-
has to reference all
|
|
238
|
+
**`app.use(NumoriUI)` is the one path that is not tree-shakeable.** To register all 39 components it
|
|
239
|
+
has to reference all 39, 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
|
|
@@ -244,7 +244,7 @@ this — it controls registration, not bundling. Use `createNumoriUI` instead wh
|
|
|
244
244
|
app.use(createNumoriUI({ UiButton, UiModal }))
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
-
**Two costs worth knowing about.** `UiButton` is
|
|
247
|
+
**Two costs worth knowing about.** `UiButton` is 19 kB because roughly 9 kB of that is the bundled
|
|
248
248
|
icon set — its loading spinner renders through `UiIcon`, and icons are resolved dynamically by name,
|
|
249
249
|
so the lookup needs the whole table. Any component drawing an icon carries it. If that matters,
|
|
250
250
|
supply your own icon component (see [Icons](#icons)) and the bundled set drops out entirely.
|
|
@@ -297,8 +297,9 @@ 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 ×
|
|
301
|
-
`UiSegmented` (single-select with
|
|
300
|
+
**Actions** — `UiButton` (8 variants × 6 colours × 5 sizes × 3 shapes),
|
|
301
|
+
`UiSegmented` (single-select segmented control with an animated sliding indicator; `solid`/`outline`/`ghost`
|
|
302
|
+
variants matching `UiButton`; `pill`/`round`/`square` shapes), `UiThemeToggle` (stateless light/dark button)
|
|
302
303
|
|
|
303
304
|
**Forms** — `UiInput` (text, number with steppers, password with toggle, email, phone, textarea,
|
|
304
305
|
built-in validation), `UiSelect` (searchable, groupable, teleported panel), `UiCheckbox`, `UiRadio`,
|
|
@@ -312,9 +313,16 @@ built-in validation), `UiSelect` (searchable, groupable, teleported panel), `UiC
|
|
|
312
313
|
|
|
313
314
|
**Layout & display** — `UiCard` (the surface primitive, with interactive and highlighted states),
|
|
314
315
|
`UiSectionHeading` (eyebrow / heading / standfirst), `UiBreadcrumb`, `UiIconTile` (tinted icon tile),
|
|
315
|
-
`
|
|
316
|
+
`UiTable` (data table with a built-in comparison mode), `UiCodeBlock` (copyable snippet), `UiListMenu`,
|
|
316
317
|
`UiListMenuItem`, `UiDivider`, `UiAvatar`, `UiKbd`, `UiIcon`
|
|
317
318
|
|
|
319
|
+
**Application & dashboard** — `UiAppShell` (sidebar + sticky top bar + content, off-canvas drawer
|
|
320
|
+
on small screens), `UiSidebar`, `UiSidebarGroup`, `UiSidebarItem` (router-agnostic: `to`, `href` or a
|
|
321
|
+
button), `UiPageHeader` (title, badges, description, actions), `UiTabs` (WAI-ARIA tabs with keyboard
|
|
322
|
+
navigation), `UiStatCard`, `UiEmptyState`, `UiDescriptionList`, `UiPagination`, `UiCopyField`
|
|
323
|
+
(copyable value with masking for secrets). `UiTable` also covers dashboards: sortable columns, empty
|
|
324
|
+
and loading states, clickable rows.
|
|
325
|
+
|
|
318
326
|
External classes always win. `UiButton` merges them with
|
|
319
327
|
[tailwind-merge](https://github.com/dcastil/tailwind-merge), so `class="bg-gray-100"` genuinely
|
|
320
328
|
replaces the variant's background instead of fighting it:
|
|
@@ -386,7 +394,7 @@ app.use(NumoriUI, {
|
|
|
386
394
|
})
|
|
387
395
|
```
|
|
388
396
|
|
|
389
|
-
Registers all
|
|
397
|
+
Registers all 39 components, and bundles all of them — reach for `createNumoriUI` when that matters:
|
|
390
398
|
|
|
391
399
|
```js
|
|
392
400
|
app.use(createNumoriUI({ UiButton, UiModal }, { icons: { component: MyIcon } }))
|
|
@@ -420,7 +428,7 @@ into the component on the source path but emit a _second_ CSS file on the bundle
|
|
|
420
428
|
with one CSS import in some setups and two in others.
|
|
421
429
|
|
|
422
430
|
**SSR-safe.** Numori Notes is a client-only SPA and never exercised server rendering, so the
|
|
423
|
-
extraction fixed several components that touched `document` or `window` during setup. All
|
|
431
|
+
extraction fixed several components that touched `document` or `window` during setup. All 38 render
|
|
424
432
|
under strict SSR with no DOM globals, verified on every build.
|
|
425
433
|
|
|
426
434
|
## Development
|
|
@@ -444,26 +452,20 @@ npm run lint
|
|
|
444
452
|
|
|
445
453
|
### Syncing from Numori Notes
|
|
446
454
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
```bash
|
|
454
|
-
npm run sync # defaults to ../numori-notes
|
|
455
|
-
npm run sync -- /path/to/numori-notes
|
|
456
|
-
npm run icons && npm run build && npm test
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
It reports anything it could not translate mechanically and exits non-zero, so an upstream change
|
|
460
|
-
that outgrows the codemod fails loudly instead of shipping broken.
|
|
455
|
+
The components were first developed inside Numori Notes and ported here with
|
|
456
|
+
`scripts/sync-from-notes.mjs`. That direction has ended: Numori Notes now installs this package from
|
|
457
|
+
npm and no longer has a `components/ui/` directory, so **this repository is the source of truth**.
|
|
458
|
+
The script is kept as a record of what the port changed (explicit `vue` imports, `<Icon>` to
|
|
459
|
+
`<UiIcon>`, local VueUse-style helpers, Tailwind v3 fixes). Pointed at a tree without that directory,
|
|
460
|
+
it exits with an error before writing anything.
|
|
461
461
|
|
|
462
462
|
## Changelog
|
|
463
463
|
|
|
464
464
|
See [CHANGELOG.md](./CHANGELOG.md) for the release history. The current release is
|
|
465
|
-
**0.
|
|
466
|
-
`
|
|
465
|
+
**0.5.0**, which adds eleven application and dashboard components (`UiAppShell`, `UiSidebar`,
|
|
466
|
+
`UiSidebarGroup`, `UiSidebarItem`, `UiPageHeader`, `UiTabs`, `UiStatCard`, `UiEmptyState`,
|
|
467
|
+
`UiDescriptionList`, `UiPagination`, `UiCopyField`) and gives `UiTable` sorting plus empty and
|
|
468
|
+
loading states. It is backwards compatible with 0.4.0.
|
|
467
469
|
|
|
468
470
|
## Licence and attribution
|
|
469
471
|
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icons/Icon.js";
|
|
2
|
+
import { Transition, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, normalizeClass, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, toDisplayString, useId, useSlots, withCtx } from "vue";
|
|
3
|
+
//#region src/components/AppShell.vue
|
|
4
|
+
var _hoisted_1 = { class: "min-h-dvh bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100" };
|
|
5
|
+
var _hoisted_2 = ["href"];
|
|
6
|
+
var _hoisted_3 = ["inert"];
|
|
7
|
+
var _hoisted_4 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "sticky top-0 z-30 flex h-14 shrink-0 items-center gap-3 border-b border-gray-200 bg-white/80 px-4 backdrop-blur sm:px-6 dark:border-gray-800 dark:bg-gray-900/80"
|
|
10
|
+
};
|
|
11
|
+
var _hoisted_5 = ["aria-label", "aria-expanded"];
|
|
12
|
+
var _hoisted_6 = { class: "flex min-w-0 flex-1 items-center gap-3" };
|
|
13
|
+
var _hoisted_7 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "border-t border-gray-200 px-4 py-4 text-sm text-gray-500 sm:px-6 dark:border-gray-800 dark:text-gray-400"
|
|
16
|
+
};
|
|
17
|
+
var _sfc_main = {
|
|
18
|
+
__name: "AppShell",
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* Drawer state on small screens, for `v-model:open`. Leave unset to let the
|
|
22
|
+
* shell manage it.
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
open: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Sidebar width.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @default 'md'
|
|
34
|
+
* @values 'sm' | 'md' | 'lg'
|
|
35
|
+
*/
|
|
36
|
+
sidebarWidth: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "md"
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Maximum width of the content column. `'none'` lets it fill the space.
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @default '7xl'
|
|
44
|
+
* @values 'none' | '4xl' | '5xl' | '6xl' | '7xl'
|
|
45
|
+
*/
|
|
46
|
+
maxWidth: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "7xl"
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Pad the content area. Turn off for full-bleed pages that lay out their own
|
|
52
|
+
* spacing.
|
|
53
|
+
* @type {boolean}
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
padded: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Accessible label for the menu button that opens the drawer.
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @default 'Open navigation'
|
|
64
|
+
*/
|
|
65
|
+
menuLabel: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "Open navigation"
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* Text of the skip link (visible only when focused).
|
|
71
|
+
* @type {string}
|
|
72
|
+
* @default 'Skip to content'
|
|
73
|
+
*/
|
|
74
|
+
skipLabel: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "Skip to content"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
emits: ["update:open"],
|
|
80
|
+
setup(__props, { emit: __emit }) {
|
|
81
|
+
/**
|
|
82
|
+
* UiAppShell — the page frame for an application: a sidebar, a sticky top bar
|
|
83
|
+
* and a scrolling content area.
|
|
84
|
+
*
|
|
85
|
+
* On large screens (`lg` and up) the sidebar is pinned to the left and the
|
|
86
|
+
* content is offset beside it. Below that it becomes an off-canvas drawer,
|
|
87
|
+
* opened by a menu button the shell adds to the top bar, closed by the
|
|
88
|
+
* backdrop, by Escape, or by any `UiSidebarItem` being chosen. While the drawer
|
|
89
|
+
* is closed on a small screen the sidebar is `inert`, so keyboard users don't
|
|
90
|
+
* tab into links they can't see.
|
|
91
|
+
*
|
|
92
|
+
* The shell owns layout only. Put a `UiSidebar` in `#sidebar`, page chrome in
|
|
93
|
+
* `#header`, and the routed page in the default slot. A skip link to the main
|
|
94
|
+
* content is the first tab stop.
|
|
95
|
+
*
|
|
96
|
+
* The drawer state is uncontrolled by default; bind `v-model:open` to drive it
|
|
97
|
+
* yourself (e.g. to close it on route change).
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* <UiAppShell>
|
|
101
|
+
* <template #sidebar>
|
|
102
|
+
* <UiSidebar label="Main">
|
|
103
|
+
* <template #header><strong>Numori CRDT</strong></template>
|
|
104
|
+
* <UiSidebarItem icon="mdi:view-grid" href="/" active>Dashboard</UiSidebarItem>
|
|
105
|
+
* <UiSidebarItem icon="mdi:sync" href="/apps">Apps</UiSidebarItem>
|
|
106
|
+
* </UiSidebar>
|
|
107
|
+
* </template>
|
|
108
|
+
* <template #header>
|
|
109
|
+
* <span class="flex-1" />
|
|
110
|
+
* <UiThemeToggle :is-dark="dark" @toggle="dark = !dark" />
|
|
111
|
+
* </template>
|
|
112
|
+
* <UiPageHeader title="Dashboard" />
|
|
113
|
+
* </UiAppShell>
|
|
114
|
+
*
|
|
115
|
+
* @emits {boolean} update:open — The drawer opened or closed (small screens).
|
|
116
|
+
*
|
|
117
|
+
* @slot sidebar — Sidebar content, usually a `UiSidebar`. Scope: `{ close }`.
|
|
118
|
+
* @slot header — Top bar content beside the menu button. Scope: `{ toggle, open }`.
|
|
119
|
+
* @slot default — Page content.
|
|
120
|
+
* @slot footer — Optional footer below the content.
|
|
121
|
+
*/
|
|
122
|
+
const props = __props;
|
|
123
|
+
const emit = __emit;
|
|
124
|
+
const slots = useSlots();
|
|
125
|
+
const baseId = useId();
|
|
126
|
+
const sidebarId = `${baseId}-sidebar`;
|
|
127
|
+
const mainId = `${baseId}-main`;
|
|
128
|
+
const hasSidebar = computed(() => !!slots.sidebar);
|
|
129
|
+
const internalOpen = ref(false);
|
|
130
|
+
const isOpen = computed(() => props.open ?? internalOpen.value);
|
|
131
|
+
function setOpen(value) {
|
|
132
|
+
internalOpen.value = value;
|
|
133
|
+
emit("update:open", value);
|
|
134
|
+
}
|
|
135
|
+
const toggle = () => setOpen(!isOpen.value);
|
|
136
|
+
const close = () => {
|
|
137
|
+
if (isOpen.value) setOpen(false);
|
|
138
|
+
};
|
|
139
|
+
provide("numori-ui:app-shell", { close });
|
|
140
|
+
const isDesktop = ref(true);
|
|
141
|
+
let media = null;
|
|
142
|
+
const onMedia = () => {
|
|
143
|
+
isDesktop.value = media.matches;
|
|
144
|
+
if (media.matches) close();
|
|
145
|
+
};
|
|
146
|
+
const onKeydown = (event) => {
|
|
147
|
+
if (event.key === "Escape" && isOpen.value) close();
|
|
148
|
+
};
|
|
149
|
+
onMounted(() => {
|
|
150
|
+
media = window.matchMedia("(min-width: 64rem)");
|
|
151
|
+
onMedia();
|
|
152
|
+
media.addEventListener("change", onMedia);
|
|
153
|
+
window.addEventListener("keydown", onKeydown);
|
|
154
|
+
});
|
|
155
|
+
onBeforeUnmount(() => {
|
|
156
|
+
media?.removeEventListener("change", onMedia);
|
|
157
|
+
window.removeEventListener("keydown", onKeydown);
|
|
158
|
+
});
|
|
159
|
+
const widthClass = computed(() => ({
|
|
160
|
+
sm: "w-60",
|
|
161
|
+
md: "w-64",
|
|
162
|
+
lg: "w-72"
|
|
163
|
+
})[props.sidebarWidth] ?? "w-64");
|
|
164
|
+
const offsetClass = computed(() => ({
|
|
165
|
+
sm: "lg:pl-60",
|
|
166
|
+
md: "lg:pl-64",
|
|
167
|
+
lg: "lg:pl-72"
|
|
168
|
+
})[props.sidebarWidth] ?? "lg:pl-64");
|
|
169
|
+
const contentClass = computed(() => {
|
|
170
|
+
return [{
|
|
171
|
+
none: "",
|
|
172
|
+
"4xl": "mx-auto max-w-4xl",
|
|
173
|
+
"5xl": "mx-auto max-w-5xl",
|
|
174
|
+
"6xl": "mx-auto max-w-6xl",
|
|
175
|
+
"7xl": "mx-auto max-w-7xl"
|
|
176
|
+
}[props.maxWidth] ?? "mx-auto max-w-7xl", props.padded ? "px-4 py-6 sm:px-6 lg:px-8 lg:py-8" : ""].filter(Boolean).join(" ");
|
|
177
|
+
});
|
|
178
|
+
return (_ctx, _cache) => {
|
|
179
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
180
|
+
createElementVNode("a", {
|
|
181
|
+
href: `#${mainId}`,
|
|
182
|
+
class: "sr-only focus:not-sr-only focus:fixed focus:top-3 focus:left-3 focus:z-[60] focus:rounded-lg focus:bg-white focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-card dark:focus:bg-gray-900"
|
|
183
|
+
}, toDisplayString(__props.skipLabel), 9, _hoisted_2),
|
|
184
|
+
createVNode(Transition, {
|
|
185
|
+
"enter-active-class": "transition-opacity duration-200 motion-reduce:transition-none",
|
|
186
|
+
"enter-from-class": "opacity-0",
|
|
187
|
+
"leave-active-class": "transition-opacity duration-200 motion-reduce:transition-none",
|
|
188
|
+
"leave-to-class": "opacity-0"
|
|
189
|
+
}, {
|
|
190
|
+
default: withCtx(() => [hasSidebar.value && isOpen.value ? (openBlock(), createElementBlock("div", {
|
|
191
|
+
key: 0,
|
|
192
|
+
class: "fixed inset-0 z-40 bg-gray-950/50 backdrop-blur-sm lg:hidden",
|
|
193
|
+
"aria-hidden": "true",
|
|
194
|
+
onClick: close
|
|
195
|
+
})) : createCommentVNode("", true)]),
|
|
196
|
+
_: 1
|
|
197
|
+
}),
|
|
198
|
+
hasSidebar.value ? (openBlock(), createElementBlock("aside", {
|
|
199
|
+
key: 0,
|
|
200
|
+
id: sidebarId,
|
|
201
|
+
class: normalizeClass(["fixed inset-y-0 left-0 z-50 flex flex-col border-r border-gray-200 bg-white transition-transform duration-200 ease-out motion-reduce:transition-none lg:translate-x-0 dark:border-gray-800 dark:bg-gray-900", [widthClass.value, isOpen.value ? "translate-x-0" : "-translate-x-full"]]),
|
|
202
|
+
inert: !isDesktop.value && !isOpen.value ? true : void 0
|
|
203
|
+
}, [renderSlot(_ctx.$slots, "sidebar", { close })], 10, _hoisted_3)) : createCommentVNode("", true),
|
|
204
|
+
createElementVNode("div", { class: normalizeClass(["flex min-h-dvh flex-col", hasSidebar.value ? offsetClass.value : ""]) }, [
|
|
205
|
+
_ctx.$slots.header || hasSidebar.value ? (openBlock(), createElementBlock("header", _hoisted_4, [hasSidebar.value ? (openBlock(), createElementBlock("button", {
|
|
206
|
+
key: 0,
|
|
207
|
+
type: "button",
|
|
208
|
+
class: "-ml-1 inline-flex size-9 items-center justify-center rounded-lg text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500 lg:hidden dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-100",
|
|
209
|
+
"aria-label": __props.menuLabel,
|
|
210
|
+
"aria-expanded": isOpen.value ? "true" : "false",
|
|
211
|
+
"aria-controls": sidebarId,
|
|
212
|
+
onClick: toggle
|
|
213
|
+
}, [createVNode(_sfc_main$1, {
|
|
214
|
+
name: "mdi:menu",
|
|
215
|
+
class: "size-5"
|
|
216
|
+
})], 8, _hoisted_5)) : createCommentVNode("", true), createElementVNode("div", _hoisted_6, [renderSlot(_ctx.$slots, "header", {
|
|
217
|
+
toggle,
|
|
218
|
+
open: isOpen.value
|
|
219
|
+
})])])) : createCommentVNode("", true),
|
|
220
|
+
createElementVNode("main", {
|
|
221
|
+
id: mainId,
|
|
222
|
+
tabindex: "-1",
|
|
223
|
+
class: "flex-1 focus:outline-none"
|
|
224
|
+
}, [createElementVNode("div", { class: normalizeClass(contentClass.value) }, [renderSlot(_ctx.$slots, "default")], 2)]),
|
|
225
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_7, [renderSlot(_ctx.$slots, "footer")])) : createCommentVNode("", true)
|
|
226
|
+
], 2)
|
|
227
|
+
]);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
//#endregion
|
|
232
|
+
export { _sfc_main as default };
|
|
233
|
+
|
|
234
|
+
//# sourceMappingURL=AppShell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShell.js","names":["$slots"],"sources":["../../src/components/AppShell.vue"],"sourcesContent":["<template>\n <div class=\"min-h-dvh bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100\">\n <!-- Skip link: the first tab stop jumps past the sidebar to the content. -->\n <a\n :href=\"`#${mainId}`\"\n class=\"sr-only focus:not-sr-only focus:fixed focus:top-3 focus:left-3 focus:z-[60] focus:rounded-lg focus:bg-white focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-card dark:focus:bg-gray-900\"\n >{{ skipLabel }}</a\n >\n\n <!-- Backdrop behind the off-canvas sidebar on small screens -->\n <Transition\n enter-active-class=\"transition-opacity duration-200 motion-reduce:transition-none\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-200 motion-reduce:transition-none\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"hasSidebar && isOpen\"\n class=\"fixed inset-0 z-40 bg-gray-950/50 backdrop-blur-sm lg:hidden\"\n aria-hidden=\"true\"\n @click=\"close\"\n />\n </Transition>\n\n <aside\n v-if=\"hasSidebar\"\n :id=\"sidebarId\"\n class=\"fixed inset-y-0 left-0 z-50 flex flex-col border-r border-gray-200 bg-white transition-transform duration-200 ease-out motion-reduce:transition-none lg:translate-x-0 dark:border-gray-800 dark:bg-gray-900\"\n :class=\"[widthClass, isOpen ? 'translate-x-0' : '-translate-x-full']\"\n :inert=\"!isDesktop && !isOpen ? true : undefined\"\n >\n <slot name=\"sidebar\" :close=\"close\" />\n </aside>\n\n <div class=\"flex min-h-dvh flex-col\" :class=\"hasSidebar ? offsetClass : ''\">\n <header\n v-if=\"$slots.header || hasSidebar\"\n class=\"sticky top-0 z-30 flex h-14 shrink-0 items-center gap-3 border-b border-gray-200 bg-white/80 px-4 backdrop-blur sm:px-6 dark:border-gray-800 dark:bg-gray-900/80\"\n >\n <button\n v-if=\"hasSidebar\"\n type=\"button\"\n class=\"-ml-1 inline-flex size-9 items-center justify-center rounded-lg text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500 lg:hidden dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-100\"\n :aria-label=\"menuLabel\"\n :aria-expanded=\"isOpen ? 'true' : 'false'\"\n :aria-controls=\"sidebarId\"\n @click=\"toggle\"\n >\n <UiIcon name=\"mdi:menu\" class=\"size-5\" />\n </button>\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\n <slot name=\"header\" :toggle=\"toggle\" :open=\"isOpen\" />\n </div>\n </header>\n\n <main :id=\"mainId\" tabindex=\"-1\" class=\"flex-1 focus:outline-none\">\n <div :class=\"contentClass\">\n <slot />\n </div>\n </main>\n\n <footer\n v-if=\"$slots.footer\"\n class=\"border-t border-gray-200 px-4 py-4 text-sm text-gray-500 sm:px-6 dark:border-gray-800 dark:text-gray-400\"\n >\n <slot name=\"footer\" />\n </footer>\n </div>\n </div>\n</template>\n\n<script setup>\n/**\n * UiAppShell — the page frame for an application: a sidebar, a sticky top bar\n * and a scrolling content area.\n *\n * On large screens (`lg` and up) the sidebar is pinned to the left and the\n * content is offset beside it. Below that it becomes an off-canvas drawer,\n * opened by a menu button the shell adds to the top bar, closed by the\n * backdrop, by Escape, or by any `UiSidebarItem` being chosen. While the drawer\n * is closed on a small screen the sidebar is `inert`, so keyboard users don't\n * tab into links they can't see.\n *\n * The shell owns layout only. Put a `UiSidebar` in `#sidebar`, page chrome in\n * `#header`, and the routed page in the default slot. A skip link to the main\n * content is the first tab stop.\n *\n * The drawer state is uncontrolled by default; bind `v-model:open` to drive it\n * yourself (e.g. to close it on route change).\n *\n * @example\n * <UiAppShell>\n * <template #sidebar>\n * <UiSidebar label=\"Main\">\n * <template #header><strong>Numori CRDT</strong></template>\n * <UiSidebarItem icon=\"mdi:view-grid\" href=\"/\" active>Dashboard</UiSidebarItem>\n * <UiSidebarItem icon=\"mdi:sync\" href=\"/apps\">Apps</UiSidebarItem>\n * </UiSidebar>\n * </template>\n * <template #header>\n * <span class=\"flex-1\" />\n * <UiThemeToggle :is-dark=\"dark\" @toggle=\"dark = !dark\" />\n * </template>\n * <UiPageHeader title=\"Dashboard\" />\n * </UiAppShell>\n *\n * @emits {boolean} update:open — The drawer opened or closed (small screens).\n *\n * @slot sidebar — Sidebar content, usually a `UiSidebar`. Scope: `{ close }`.\n * @slot header — Top bar content beside the menu button. Scope: `{ toggle, open }`.\n * @slot default — Page content.\n * @slot footer — Optional footer below the content.\n */\nimport { computed, onBeforeUnmount, onMounted, provide, ref, useId, useSlots } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\n\nconst props = defineProps({\n /**\n * Drawer state on small screens, for `v-model:open`. Leave unset to let the\n * shell manage it.\n * @type {boolean}\n * @default undefined\n */\n open: { type: Boolean, default: undefined },\n\n /**\n * Sidebar width.\n * @type {string}\n * @default 'md'\n * @values 'sm' | 'md' | 'lg'\n */\n sidebarWidth: { type: String, default: 'md' },\n\n /**\n * Maximum width of the content column. `'none'` lets it fill the space.\n * @type {string}\n * @default '7xl'\n * @values 'none' | '4xl' | '5xl' | '6xl' | '7xl'\n */\n maxWidth: { type: String, default: '7xl' },\n\n /**\n * Pad the content area. Turn off for full-bleed pages that lay out their own\n * spacing.\n * @type {boolean}\n * @default true\n */\n padded: { type: Boolean, default: true },\n\n /**\n * Accessible label for the menu button that opens the drawer.\n * @type {string}\n * @default 'Open navigation'\n */\n menuLabel: { type: String, default: 'Open navigation' },\n\n /**\n * Text of the skip link (visible only when focused).\n * @type {string}\n * @default 'Skip to content'\n */\n skipLabel: { type: String, default: 'Skip to content' },\n})\n\nconst emit = defineEmits(['update:open'])\nconst slots = useSlots()\n\nconst baseId = useId()\nconst sidebarId = `${baseId}-sidebar`\nconst mainId = `${baseId}-main`\n\nconst hasSidebar = computed(() => !!slots.sidebar)\n\nconst internalOpen = ref(false)\nconst isOpen = computed(() => props.open ?? internalOpen.value)\n\nfunction setOpen(value) {\n internalOpen.value = value\n emit('update:open', value)\n}\nconst toggle = () => setOpen(!isOpen.value)\nconst close = () => {\n if (isOpen.value) setOpen(false)\n}\n\n// UiSidebarItem closes the drawer when chosen, so navigation on a phone does\n// not leave the drawer covering the page it just opened.\nprovide('numori-ui:app-shell', { close })\n\n// Assume a desktop layout until mounted, so the server render never marks the\n// sidebar inert on a screen where it is visible.\nconst isDesktop = ref(true)\nlet media = null\nconst onMedia = () => {\n isDesktop.value = media.matches\n if (media.matches) close()\n}\nconst onKeydown = (event) => {\n if (event.key === 'Escape' && isOpen.value) close()\n}\n\nonMounted(() => {\n media = window.matchMedia('(min-width: 64rem)')\n onMedia()\n media.addEventListener('change', onMedia)\n window.addEventListener('keydown', onKeydown)\n})\nonBeforeUnmount(() => {\n media?.removeEventListener('change', onMedia)\n window.removeEventListener('keydown', onKeydown)\n})\n\nconst widthClass = computed(\n () => ({ sm: 'w-60', md: 'w-64', lg: 'w-72' })[props.sidebarWidth] ?? 'w-64',\n)\nconst offsetClass = computed(\n () => ({ sm: 'lg:pl-60', md: 'lg:pl-64', lg: 'lg:pl-72' })[props.sidebarWidth] ?? 'lg:pl-64',\n)\n\nconst contentClass = computed(() => {\n const width =\n {\n none: '',\n '4xl': 'mx-auto max-w-4xl',\n '5xl': 'mx-auto max-w-5xl',\n '6xl': 'mx-auto max-w-6xl',\n '7xl': 'mx-auto max-w-7xl',\n }[props.maxWidth] ?? 'mx-auto max-w-7xl'\n return [width, props.padded ? 'px-4 py-6 sm:px-6 lg:px-8 lg:py-8' : ''].filter(Boolean).join(' ')\n})\n</script>\n"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main$1 from "../icons/Icon.js";
|
|
2
|
-
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, normalizeClass, normalizeStyle, openBlock, renderSlot,
|
|
2
|
+
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, normalizeClass, normalizeStyle, openBlock, renderSlot, toDisplayString, withCtx, withModifiers } from "vue";
|
|
3
3
|
//#region src/components/Banner.vue
|
|
4
|
-
var _hoisted_1 =
|
|
4
|
+
var _hoisted_1 = ["aria-label"];
|
|
5
5
|
var _hoisted_2 = ["aria-label"];
|
|
6
6
|
var _sfc_main = {
|
|
7
7
|
__name: "Banner",
|
|
@@ -136,38 +136,35 @@ var _sfc_main = {
|
|
|
136
136
|
"leave-from-class": "max-h-24 opacity-100",
|
|
137
137
|
"leave-to-class": "max-h-0 opacity-0"
|
|
138
138
|
}, {
|
|
139
|
-
default: withCtx(() => [__props.show ? (openBlock(),
|
|
139
|
+
default: withCtx(() => [__props.show ? (openBlock(), createElementBlock("div", {
|
|
140
140
|
key: 0,
|
|
141
|
-
class: normalizeClass(["w-full shrink-0 overflow-hidden text-xs font-medium",
|
|
141
|
+
class: normalizeClass(["relative w-full shrink-0 overflow-hidden text-xs font-medium", colorClass.value]),
|
|
142
142
|
style: normalizeStyle(__props.safeArea ? { paddingTop: "env(safe-area-inset-top, 0px)" } : void 0),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"style",
|
|
169
|
-
"type"
|
|
170
|
-
])) : createCommentVNode("", true)]),
|
|
143
|
+
role: "status"
|
|
144
|
+
}, [__props.clickable ? (openBlock(), createElementBlock("button", {
|
|
145
|
+
key: 0,
|
|
146
|
+
type: "button",
|
|
147
|
+
class: "absolute inset-0 z-0 cursor-pointer",
|
|
148
|
+
"aria-label": __props.message || void 0,
|
|
149
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("click"))
|
|
150
|
+
}, null, 8, _hoisted_1)) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["relative z-10 flex items-center justify-center gap-2 px-4 py-1.5", __props.clickable ? "pointer-events-none" : ""]) }, [
|
|
151
|
+
__props.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
152
|
+
key: 0,
|
|
153
|
+
name: __props.icon,
|
|
154
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
155
|
+
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
156
|
+
createElementVNode("span", null, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.message), 1)])]),
|
|
157
|
+
__props.dismissible ? (openBlock(), createElementBlock("button", {
|
|
158
|
+
key: 1,
|
|
159
|
+
type: "button",
|
|
160
|
+
class: "pointer-events-auto absolute right-3 inline-flex items-center opacity-80 hover:opacity-100",
|
|
161
|
+
"aria-label": __props.dismissLabel,
|
|
162
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("dismiss"), ["stop"]))
|
|
163
|
+
}, [createVNode(_sfc_main$1, {
|
|
164
|
+
name: "mdi:close",
|
|
165
|
+
class: "w-3.5 h-3.5"
|
|
166
|
+
})], 8, _hoisted_2)) : createCommentVNode("", true)
|
|
167
|
+
], 2)], 6)) : createCommentVNode("", true)]),
|
|
171
168
|
_: 3
|
|
172
169
|
});
|
|
173
170
|
};
|