iryx-ui 0.12.0 → 0.13.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.
Files changed (225) hide show
  1. package/README.md +35 -1315
  2. package/dist/component-names.d.ts +1 -1
  3. package/dist/component-names.js +1 -1
  4. package/dist/components/Accordion.js +5 -0
  5. package/dist/components/Accordion.vue.d.ts +80 -0
  6. package/dist/components/Accordion.vue_vue_type_script_setup_true_lang.js +87 -0
  7. package/dist/components/Alert.vue.d.ts +1 -1
  8. package/dist/components/Alert.vue_vue_type_script_setup_true_lang.js +7 -7
  9. package/dist/components/App.vue.d.ts +1 -1
  10. package/dist/components/AppShell.js +5 -0
  11. package/dist/components/AppShell.vue.d.ts +46 -0
  12. package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +59 -0
  13. package/dist/components/AspectRatio.js +5 -0
  14. package/dist/components/AspectRatio.vue.d.ts +26 -0
  15. package/dist/components/AspectRatio.vue_vue_type_script_setup_true_lang.js +27 -0
  16. package/dist/components/Avatar.js +5 -0
  17. package/dist/components/Avatar.vue.d.ts +52 -0
  18. package/dist/components/Avatar.vue_vue_type_script_setup_true_lang.js +67 -0
  19. package/dist/components/AvatarGroup.js +5 -0
  20. package/dist/components/AvatarGroup.vue.d.ts +39 -0
  21. package/dist/components/AvatarGroup.vue_vue_type_script_setup_true_lang.js +45 -0
  22. package/dist/components/Badge.vue.d.ts +1 -1
  23. package/dist/components/Banner.vue.d.ts +2 -2
  24. package/dist/components/BarChart.vue.d.ts +1 -1
  25. package/dist/components/BarChart.vue_vue_type_script_setup_true_lang.js +14 -14
  26. package/dist/components/Button.vue.d.ts +2 -2
  27. package/dist/components/ButtonGroup.vue.d.ts +1 -1
  28. package/dist/components/Card.vue.d.ts +1 -1
  29. package/dist/components/Collapsible.js +5 -0
  30. package/dist/components/Collapsible.vue.d.ts +58 -0
  31. package/dist/components/Collapsible.vue_vue_type_script_setup_true_lang.js +67 -0
  32. package/dist/components/ColorPicker.js +5 -0
  33. package/dist/components/ColorPicker.vue.d.ts +49 -0
  34. package/dist/components/ColorPicker.vue_vue_type_script_setup_true_lang.js +172 -0
  35. package/dist/components/Combobox.vue.d.ts +6 -6
  36. package/dist/components/CommandPalette.js +5 -0
  37. package/dist/components/CommandPalette.vue.d.ts +63 -0
  38. package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +185 -0
  39. package/dist/components/Container.js +5 -0
  40. package/dist/components/Container.vue.d.ts +33 -0
  41. package/dist/components/Container.vue_vue_type_script_setup_true_lang.js +40 -0
  42. package/dist/components/ContextMenu.js +5 -0
  43. package/dist/components/ContextMenu.vue.d.ts +42 -0
  44. package/dist/components/ContextMenu.vue_vue_type_script_setup_true_lang.js +49 -0
  45. package/dist/components/DateRangePicker.vue.d.ts +1 -1
  46. package/dist/components/Dialog.vue.d.ts +1 -1
  47. package/dist/components/Drawer.vue.d.ts +2 -2
  48. package/dist/components/EmptyState.vue.d.ts +1 -1
  49. package/dist/components/Input.vue.d.ts +1 -1
  50. package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +4 -4
  51. package/dist/components/Kbd.js +5 -0
  52. package/dist/components/Kbd.vue.d.ts +46 -0
  53. package/dist/components/Kbd.vue_vue_type_script_setup_true_lang.js +41 -0
  54. package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +19 -19
  55. package/dist/components/Menubar.js +5 -0
  56. package/dist/components/Menubar.vue.d.ts +62 -0
  57. package/dist/components/Menubar.vue_vue_type_script_setup_true_lang.js +79 -0
  58. package/dist/components/NavigationMenu.js +5 -0
  59. package/dist/components/NavigationMenu.vue.d.ts +75 -0
  60. package/dist/components/NavigationMenu.vue_vue_type_script_setup_true_lang.js +167 -0
  61. package/dist/components/NumberInput.vue_vue_type_script_setup_true_lang.js +2 -2
  62. package/dist/components/PageHeader.js +5 -0
  63. package/dist/components/PageHeader.vue.d.ts +52 -0
  64. package/dist/components/PageHeader.vue_vue_type_script_setup_true_lang.js +59 -0
  65. package/dist/components/PinInput.js +5 -0
  66. package/dist/components/PinInput.vue.d.ts +65 -0
  67. package/dist/components/PinInput.vue_vue_type_script_setup_true_lang.js +76 -0
  68. package/dist/components/Popover.js +5 -0
  69. package/dist/components/Popover.vue.d.ts +75 -0
  70. package/dist/components/Popover.vue_vue_type_script_setup_true_lang.js +99 -0
  71. package/dist/components/Progress.vue.d.ts +20 -1
  72. package/dist/components/Progress.vue_vue_type_script_setup_true_lang.js +84 -44
  73. package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +4 -1
  74. package/dist/components/ScrollArea.js +5 -0
  75. package/dist/components/ScrollArea.vue.d.ts +41 -0
  76. package/dist/components/ScrollArea.vue_vue_type_script_setup_true_lang.js +68 -0
  77. package/dist/components/ScrollFade.js +5 -0
  78. package/dist/components/ScrollFade.vue.d.ts +36 -0
  79. package/dist/components/ScrollFade.vue_vue_type_script_setup_true_lang.js +59 -0
  80. package/dist/components/Select.vue.d.ts +2 -2
  81. package/dist/components/Sidebar.js +5 -0
  82. package/dist/components/Sidebar.vue.d.ts +72 -0
  83. package/dist/components/Sidebar.vue_vue_type_script_setup_true_lang.js +183 -0
  84. package/dist/components/SignaturePad.js +5 -0
  85. package/dist/components/SignaturePad.vue.d.ts +60 -0
  86. package/dist/components/SignaturePad.vue_vue_type_script_setup_true_lang.js +158 -0
  87. package/dist/components/Skeleton.vue.d.ts +1 -1
  88. package/dist/components/Skeleton.vue_vue_type_script_setup_true_lang.js +8 -8
  89. package/dist/components/Slider.js +5 -0
  90. package/dist/components/Slider.vue.d.ts +80 -0
  91. package/dist/components/Slider.vue_vue_type_script_setup_true_lang.js +115 -0
  92. package/dist/components/Splitter.js +5 -0
  93. package/dist/components/Splitter.vue.d.ts +59 -0
  94. package/dist/components/Splitter.vue_vue_type_script_setup_true_lang.js +69 -0
  95. package/dist/components/Stat.vue.d.ts +1 -1
  96. package/dist/components/Switch.vue.d.ts +1 -0
  97. package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +7 -3
  98. package/dist/components/Table.vue.d.ts +7 -1
  99. package/dist/components/Table.vue_vue_type_script_setup_true_lang.js +73 -58
  100. package/dist/components/TagsInput.js +5 -0
  101. package/dist/components/TagsInput.vue.d.ts +71 -0
  102. package/dist/components/TagsInput.vue_vue_type_script_setup_true_lang.js +119 -0
  103. package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +3 -3
  104. package/dist/components/TimeField.js +5 -0
  105. package/dist/components/TimeField.vue.d.ts +50 -0
  106. package/dist/components/TimeField.vue_vue_type_script_setup_true_lang.js +85 -0
  107. package/dist/components/Timeline.js +5 -0
  108. package/dist/components/Timeline.vue.d.ts +61 -0
  109. package/dist/components/Timeline.vue_vue_type_script_setup_true_lang.js +60 -0
  110. package/dist/components/Toaster.vue.d.ts +1 -1
  111. package/dist/components/Toggle.js +5 -0
  112. package/dist/components/Toggle.vue.d.ts +42 -0
  113. package/dist/components/Toggle.vue_vue_type_script_setup_true_lang.js +52 -0
  114. package/dist/components/ToggleGroup.js +5 -0
  115. package/dist/components/ToggleGroup.vue.d.ts +64 -0
  116. package/dist/components/ToggleGroup.vue_vue_type_script_setup_true_lang.js +78 -0
  117. package/dist/components/Toolbar.js +5 -0
  118. package/dist/components/Toolbar.vue.d.ts +52 -0
  119. package/dist/components/Toolbar.vue_vue_type_script_setup_true_lang.js +94 -0
  120. package/dist/components/Tree.js +5 -0
  121. package/dist/components/Tree.vue.d.ts +70 -0
  122. package/dist/components/Tree.vue_vue_type_script_setup_true_lang.js +112 -0
  123. package/dist/components/index.d.ts +29 -0
  124. package/dist/components/index.js +144 -86
  125. package/dist/composables/appearance.js +5 -1
  126. package/dist/composables/cartesian.d.ts +11 -0
  127. package/dist/composables/cartesian.js +18 -19
  128. package/dist/composables/command-palette.d.ts +42 -0
  129. package/dist/composables/command-palette.js +32 -0
  130. package/dist/composables/date.d.ts +18 -2
  131. package/dist/composables/date.js +23 -12
  132. package/dist/composables/kbd.d.ts +26 -0
  133. package/dist/composables/kbd.js +161 -0
  134. package/dist/composables/navigation-menu.d.ts +29 -0
  135. package/dist/composables/navigation-menu.js +6 -0
  136. package/dist/composables/scroll-fade.d.ts +35 -0
  137. package/dist/composables/scroll-fade.js +36 -0
  138. package/dist/composables/sidebar.d.ts +35 -0
  139. package/dist/composables/sidebar.js +23 -0
  140. package/dist/composables/signature.d.ts +22 -0
  141. package/dist/composables/signature.js +13 -0
  142. package/dist/index.d.ts +35 -0
  143. package/dist/index.js +153 -93
  144. package/dist/theme/accordion.d.ts +68 -0
  145. package/dist/theme/accordion.js +24 -0
  146. package/dist/theme/alert.d.ts +0 -3
  147. package/dist/theme/app-shell.d.ts +77 -0
  148. package/dist/theme/app-shell.js +35 -0
  149. package/dist/theme/avatar.d.ts +253 -0
  150. package/dist/theme/avatar.js +84 -0
  151. package/dist/theme/banner.d.ts +0 -9
  152. package/dist/theme/bar-chart.d.ts +0 -16
  153. package/dist/theme/breadcrumb.d.ts +3 -3
  154. package/dist/theme/button-group.d.ts +0 -3
  155. package/dist/theme/button.d.ts +0 -3
  156. package/dist/theme/card.js +2 -2
  157. package/dist/theme/chart-legend.d.ts +3 -11
  158. package/dist/theme/collapsible.d.ts +44 -0
  159. package/dist/theme/collapsible.js +17 -0
  160. package/dist/theme/color-picker.d.ts +98 -0
  161. package/dist/theme/color-picker.js +19 -0
  162. package/dist/theme/command-palette.d.ts +122 -0
  163. package/dist/theme/command-palette.js +22 -0
  164. package/dist/theme/container.d.ts +101 -0
  165. package/dist/theme/container.js +26 -0
  166. package/dist/theme/date-picker.d.ts +12 -0
  167. package/dist/theme/date-picker.js +1 -1
  168. package/dist/theme/dropdown-menu.d.ts +0 -9
  169. package/dist/theme/file-upload.d.ts +0 -3
  170. package/dist/theme/form.d.ts +12 -12
  171. package/dist/theme/index.d.ts +25 -0
  172. package/dist/theme/kbd.d.ts +71 -0
  173. package/dist/theme/kbd.js +29 -0
  174. package/dist/theme/line-chart.d.ts +0 -9
  175. package/dist/theme/menubar.d.ts +29 -0
  176. package/dist/theme/menubar.js +11 -0
  177. package/dist/theme/navigation-menu.d.ts +161 -0
  178. package/dist/theme/navigation-menu.js +43 -0
  179. package/dist/theme/number-input.d.ts +0 -3
  180. package/dist/theme/page-header.d.ts +47 -0
  181. package/dist/theme/page-header.js +17 -0
  182. package/dist/theme/pagination.d.ts +0 -3
  183. package/dist/theme/pin-input.d.ts +86 -0
  184. package/dist/theme/pin-input.js +32 -0
  185. package/dist/theme/popover.d.ts +119 -0
  186. package/dist/theme/popover.js +31 -0
  187. package/dist/theme/presets.d.ts +0 -2
  188. package/dist/theme/progress.d.ts +93 -0
  189. package/dist/theme/progress.js +37 -7
  190. package/dist/theme/radio-group.d.ts +24 -0
  191. package/dist/theme/radio-group.js +23 -14
  192. package/dist/theme/scroll-area.d.ts +65 -0
  193. package/dist/theme/scroll-area.js +57 -0
  194. package/dist/theme/scroll-fade.d.ts +35 -0
  195. package/dist/theme/scroll-fade.js +12 -0
  196. package/dist/theme/sidebar.d.ts +167 -0
  197. package/dist/theme/sidebar.js +43 -0
  198. package/dist/theme/signature-pad.d.ts +50 -0
  199. package/dist/theme/signature-pad.js +17 -0
  200. package/dist/theme/slider.d.ts +128 -0
  201. package/dist/theme/slider.js +49 -0
  202. package/dist/theme/sparkline.d.ts +0 -6
  203. package/dist/theme/splitter.d.ts +59 -0
  204. package/dist/theme/splitter.js +25 -0
  205. package/dist/theme/stat.d.ts +0 -3
  206. package/dist/theme/stepper.js +2 -2
  207. package/dist/theme/switch.d.ts +53 -29
  208. package/dist/theme/switch.js +33 -8
  209. package/dist/theme/table.d.ts +51 -3
  210. package/dist/theme/table.js +8 -3
  211. package/dist/theme/tabs.d.ts +0 -3
  212. package/dist/theme/tags-input.d.ts +110 -0
  213. package/dist/theme/tags-input.js +42 -0
  214. package/dist/theme/time-field.d.ts +68 -0
  215. package/dist/theme/time-field.js +21 -0
  216. package/dist/theme/timeline.d.ts +182 -0
  217. package/dist/theme/timeline.js +83 -0
  218. package/dist/theme/toggle.d.ts +145 -0
  219. package/dist/theme/toggle.js +84 -0
  220. package/dist/theme/toolbar.d.ts +56 -0
  221. package/dist/theme/toolbar.js +21 -0
  222. package/dist/theme/tree.d.ts +68 -0
  223. package/dist/theme/tree.js +28 -0
  224. package/package.json +2 -2
  225. package/theme.css +221 -0
@@ -1,14 +1,13 @@
1
1
  import { extent as e, linearScale as t, niceTicks as n } from "./scale.js";
2
- import r from "node:process";
3
2
  //#region src/composables/cartesian.ts
4
- var i = 6.5, a = 8, o = 20, s = 8;
5
- function c(r) {
6
- let a = r.orientation ?? "vertical", o = a === "horizontal", s = e(r.values), c = s ? n(r.includeZero ? Math.min(0, s[0]) : s[0], r.includeZero ? Math.max(0, s[1]) : s[1], r.tickCount) : n(0, 1, r.tickCount), l = Math.ceil(Math.max(...c.ticks.map((e) => r.formatTick(e).length), 1) * i) + 8, u = o ? Math.ceil(r.longestLabel * i) + 8 : r.showAxis ? l : 0, d = o && !r.showAxis ? 0 : 20, f = o && r.showAxis ? Math.ceil(l / 2) : 0, p = {
3
+ var r = 6.5, i = 8, a = 20, o = 8;
4
+ function s(i) {
5
+ let a = i.orientation ?? "vertical", o = a === "horizontal", s = e(i.values), c = s ? n(i.includeZero ? Math.min(0, s[0]) : s[0], i.includeZero ? Math.max(0, s[1]) : s[1], i.tickCount) : n(0, 1, i.tickCount), l = Math.ceil(Math.max(...c.ticks.map((e) => i.formatTick(e).length), 1) * r) + 8, u = o ? Math.ceil(i.longestLabel * r) + 8 : i.showAxis ? l : 0, d = o && !i.showAxis ? 0 : 20, f = o && i.showAxis ? Math.ceil(l / 2) : 0, p = {
7
6
  left: u,
8
7
  top: 8,
9
- width: Math.max(r.width - u - f, 0),
10
- height: Math.max(r.height - 8 - d, 0)
11
- }, m = o ? t([c.min, c.max], [p.left, p.left + p.width]) : t([c.min, c.max], [p.top + p.height, p.top]), h = o ? p.height : p.width, g = r.categories ? h / r.categories : 0, _ = o ? p.top : p.left, v = o ? 16 : r.longestLabel * i + 8, y = g ? Math.max(1, Math.ceil(v / g)) : 1;
8
+ width: Math.max(i.width - u - f, 0),
9
+ height: Math.max(i.height - 8 - d, 0)
10
+ }, m = o ? t([c.min, c.max], [p.left, p.left + p.width]) : t([c.min, c.max], [p.top + p.height, p.top]), h = o ? p.height : p.width, g = i.categories ? h / i.categories : 0, _ = o ? p.top : p.left, v = o ? 16 : i.longestLabel * r + 8, y = g ? Math.max(1, Math.ceil(v / g)) : 1;
12
11
  return {
13
12
  orientation: a,
14
13
  ticks: c.ticks,
@@ -20,24 +19,24 @@ function c(r) {
20
19
  bandCentre: (e) => _ + g * (e + .5)
21
20
  };
22
21
  }
23
- var l = 8;
24
- function u(e) {
22
+ var c = 8;
23
+ function l(e) {
25
24
  return `var(--iryx-chart-${Math.min(Math.max(e, 0), 7) + 1})`;
26
25
  }
27
- function d(e, t) {
26
+ function u(e, t) {
28
27
  return e.slot ?? t;
29
28
  }
30
- var f = !1;
31
- function p(e) {
32
- e <= 8 || f || r.env.NODE_ENV === "production" || (f = !0, console.warn(`[iryx-ui] ${e} chart series exceeds the 8 categorical slots. Colours past the eighth repeat and stop identifying anything — fold the tail into "Other", or use small multiples.`));
29
+ var d = !1;
30
+ function f(e) {
31
+ e <= 8 || d || process.env.NODE_ENV === "production" || (d = !0, console.warn(`[iryx-ui] ${e} chart series exceeds the 8 categorical slots. Colours past the eighth repeat and stop identifying anything — fold the tail into "Other", or use small multiples.`));
33
32
  }
34
- function m(e, t, n) {
35
- let r = g(t);
33
+ function p(e, t, n) {
34
+ let r = h(t);
36
35
  return n <= r * 2 ? n / 2 : Math.min(Math.max(e, r), Math.max(n - r, r));
37
36
  }
38
- var h = 5.6;
39
- function g(e) {
40
- return (e.length * h + 28) / 2;
37
+ var m = 5.6;
38
+ function h(e) {
39
+ return (e.length * m + 28) / 2;
41
40
  }
42
41
  //#endregion
43
- export { a as AXIS_GAP, o as CATEGORY_HEIGHT, i as CHAR_WIDTH, l as SERIES_SLOTS, s as TOP_PAD, c as cartesianLayout, m as clampTooltip, u as seriesColor, d as slotOf, g as tooltipHalfWidth, p as warnOnSlotOverflow };
42
+ export { i as AXIS_GAP, a as CATEGORY_HEIGHT, r as CHAR_WIDTH, c as SERIES_SLOTS, o as TOP_PAD, s as cartesianLayout, p as clampTooltip, l as seriesColor, u as slotOf, h as tooltipHalfWidth, f as warnOnSlotOverflow };
@@ -0,0 +1,42 @@
1
+ import type { IconLike } from './icon';
2
+ export interface CommandItem {
3
+ /** What the reader searches for and reads. */
4
+ label: string;
5
+ icon?: IconLike;
6
+ /**
7
+ * Displayed at the trailing edge, split on spaces into separate keys.
8
+ * Display only — the palette never binds it, because the shortcut belongs
9
+ * to the command itself and works whether or not the palette is open.
10
+ */
11
+ shortcut?: string;
12
+ /**
13
+ * Extra search terms that never appear on screen: synonyms, the old name of
14
+ * a renamed page, the word a reader would guess.
15
+ */
16
+ keywords?: string[];
17
+ /** Renders the row as a link, so middle-click and open-in-new-tab work. */
18
+ href?: string;
19
+ disabled?: boolean;
20
+ onSelect?: () => void;
21
+ }
22
+ export interface CommandGroup {
23
+ label: string;
24
+ items: CommandItem[];
25
+ }
26
+ export type CommandEntry = CommandItem | CommandGroup;
27
+ export declare function isCommandGroup(entry: CommandEntry): entry is CommandGroup;
28
+ /** Normalise to groups, so the template has a single path to render. */
29
+ export declare function toCommandGroups(entries: CommandEntry[] | undefined): CommandGroup[];
30
+ /**
31
+ * Everything a query should match against: the label, the group it sits in,
32
+ * and any keywords. Joined rather than tested separately so a query spanning
33
+ * two of them ("settings members") still matches.
34
+ */
35
+ export declare function commandHaystack(item: CommandItem, group: string): string;
36
+ /**
37
+ * Parse a hotkey like `mod+k` into a matcher.
38
+ *
39
+ * `mod` is Command on Apple platforms and Control everywhere else — the same
40
+ * key in muscle memory, a different key on the wire.
41
+ */
42
+ export declare function matchesHotkey(event: KeyboardEvent, hotkey: string): boolean;
@@ -0,0 +1,32 @@
1
+ import { isApplePlatform as e } from "./kbd.js";
2
+ //#region src/composables/command-palette.ts
3
+ function t(e) {
4
+ return Array.isArray(e.items);
5
+ }
6
+ function n(e) {
7
+ let n = [], r;
8
+ for (let i of e ?? []) {
9
+ if (t(i)) {
10
+ n.push(i), r = void 0;
11
+ continue;
12
+ }
13
+ r || (r = [], n.push({
14
+ label: "",
15
+ items: r
16
+ })), r.push(i);
17
+ }
18
+ return n;
19
+ }
20
+ function r(e, t) {
21
+ return [
22
+ e.label,
23
+ t,
24
+ ...e.keywords ?? []
25
+ ].join(" ");
26
+ }
27
+ function i(t, n) {
28
+ let r = n.toLowerCase().split("+").map((e) => e.trim()), i = r.at(-1) ?? "", a = r.includes("mod"), o = r.includes("ctrl") || r.includes("control"), s = r.includes("meta") || r.includes("cmd"), c = r.includes("shift"), l = r.includes("alt") || r.includes("option"), u = e() ? t.metaKey : t.ctrlKey;
29
+ return a && !u || o && !t.ctrlKey || s && !t.metaKey || c !== t.shiftKey || l !== t.altKey ? !1 : t.key.toLowerCase() === i;
30
+ }
31
+ //#endregion
32
+ export { r as commandHaystack, t as isCommandGroup, i as matchesHotkey, n as toCommandGroups };
@@ -1,5 +1,5 @@
1
1
  import type { DateValue } from '@internationalized/date';
2
- import { CalendarDate } from '@internationalized/date';
2
+ import { CalendarDate, Time } from '@internationalized/date';
3
3
  /**
4
4
  * Parse an ISO date, or `undefined` if it is absent or malformed.
5
5
  *
@@ -17,5 +17,21 @@ export declare function isoToday(): string;
17
17
  * so a caller can fall back to a placeholder.
18
18
  */
19
19
  export declare function formatIsoDate(iso: string | null | undefined, locale?: string, options?: Intl.DateTimeFormatOptions): string;
20
- export { CalendarDate };
20
+ /**
21
+ * Parse a `HH:mm` (or `HH:mm:ss`) string, or `undefined` if it is absent or
22
+ * malformed. Same bargain as {@link toCalendarDate}: bad input means "no
23
+ * selection" rather than a thrown render.
24
+ */
25
+ export declare function toTime(value: string | null | undefined): Time | undefined;
26
+ /**
27
+ * Back to `HH:mm`, or `HH:mm:ss` when there are seconds to keep. Padded, so
28
+ * the result sorts and compares as a string — which is most of the reason to
29
+ * hold a time as one.
30
+ */
31
+ export declare function toIsoTime(time: {
32
+ hour: number;
33
+ minute: number;
34
+ second?: number;
35
+ } | null | undefined): string | null;
36
+ export { CalendarDate, Time };
21
37
  export type { DateValue };
@@ -1,22 +1,33 @@
1
- import { CalendarDate as e, DateFormatter as t, getLocalTimeZone as n, parseDate as r, today as i } from "@internationalized/date";
1
+ import { CalendarDate as e, DateFormatter as t, Time as n, getLocalTimeZone as r, parseDate as i, today as a } from "@internationalized/date";
2
2
  //#region src/composables/date.ts
3
- var a = /^\d{4}-\d{2}-\d{2}$/;
4
- function o(e) {
5
- if (!(!e || !a.test(e))) try {
6
- return r(e);
3
+ var o = /^\d{4}-\d{2}-\d{2}$/;
4
+ function s(e) {
5
+ if (!(!e || !o.test(e))) try {
6
+ return i(e);
7
7
  } catch {
8
8
  return;
9
9
  }
10
10
  }
11
- function s(e) {
11
+ function c(e) {
12
12
  return e ? `${e.year.toString().padStart(4, "0")}-${e.month.toString().padStart(2, "0")}-${e.day.toString().padStart(2, "0")}` : null;
13
13
  }
14
- function c() {
15
- return s(i(n()));
14
+ function l() {
15
+ return c(a(r()));
16
+ }
17
+ function u(e, n, i = { dateStyle: "medium" }) {
18
+ let a = s(e);
19
+ return a ? new t(n ?? "en-US", i).format(a.toDate(r())) : "";
20
+ }
21
+ var d = /^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/;
22
+ function f(e) {
23
+ if (!e || !d.test(e)) return;
24
+ let [t, r, i] = e.split(":").map(Number);
25
+ return new n(t, r, i ?? 0);
16
26
  }
17
- function l(e, r, i = { dateStyle: "medium" }) {
18
- let a = o(e);
19
- return a ? new t(r ?? "en-US", i).format(a.toDate(n())) : "";
27
+ function p(e) {
28
+ if (!e) return null;
29
+ let t = (e) => String(e).padStart(2, "0"), n = `${t(e.hour)}:${t(e.minute)}`;
30
+ return e.second ? `${n}:${t(e.second)}` : n;
20
31
  }
21
32
  //#endregion
22
- export { e as CalendarDate, l as formatIsoDate, c as isoToday, o as toCalendarDate, s as toIsoDate };
33
+ export { e as CalendarDate, n as Time, u as formatIsoDate, l as isoToday, s as toCalendarDate, c as toIsoDate, p as toIsoTime, f as toTime };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Whether the reader is on an Apple platform, resolved **after mount**.
3
+ *
4
+ * It cannot be resolved during render: there is no `navigator` on the server,
5
+ * so server markup would say "Ctrl" and the client would say "⌘" — a
6
+ * hydration mismatch on every page carrying a shortcut. Starting `false` and
7
+ * correcting on mount means the worst case is one frame of the wrong glyph
8
+ * rather than a mismatched tree.
9
+ */
10
+ export declare function useApplePlatform(): import("vue").Ref<boolean, boolean>;
11
+ /** The same check, for code that already runs in the browser. */
12
+ export declare function isApplePlatform(): boolean;
13
+ export interface KbdKey {
14
+ /** What is drawn in the chip. */
15
+ symbol: string;
16
+ /** What a screen reader says instead. */
17
+ spoken: string;
18
+ }
19
+ /**
20
+ * Turn a hotkey into the keys to draw — `mod+k` becomes `⌘` and `K` on a Mac,
21
+ * `Ctrl` and `K` elsewhere.
22
+ *
23
+ * Accepts the same vocabulary as `matchesHotkey`, so the shortcut you bind and
24
+ * the shortcut you show are written the same way.
25
+ */
26
+ export declare function parseHotkey(hotkey: string | string[], apple: boolean): KbdKey[];
@@ -0,0 +1,161 @@
1
+ import { onMounted as e, ref as t } from "vue";
2
+ //#region src/composables/kbd.ts
3
+ function n() {
4
+ let n = t(!1);
5
+ return e(() => {
6
+ n.value = r();
7
+ }), n;
8
+ }
9
+ function r() {
10
+ return typeof navigator > "u" ? !1 : /mac|iphone|ipad|ipod/i.test(navigator.platform || navigator.userAgent);
11
+ }
12
+ var i = {
13
+ mod: {
14
+ apple: "⌘",
15
+ other: "Ctrl",
16
+ spoken: "Command",
17
+ spokenOther: "Control"
18
+ },
19
+ meta: {
20
+ apple: "⌘",
21
+ other: "Win",
22
+ spoken: "Command",
23
+ spokenOther: "Windows"
24
+ },
25
+ cmd: {
26
+ apple: "⌘",
27
+ other: "Ctrl",
28
+ spoken: "Command",
29
+ spokenOther: "Control"
30
+ },
31
+ ctrl: {
32
+ apple: "⌃",
33
+ other: "Ctrl",
34
+ spoken: "Control"
35
+ },
36
+ control: {
37
+ apple: "⌃",
38
+ other: "Ctrl",
39
+ spoken: "Control"
40
+ },
41
+ shift: {
42
+ apple: "⇧",
43
+ other: "Shift",
44
+ spoken: "Shift"
45
+ },
46
+ alt: {
47
+ apple: "⌥",
48
+ other: "Alt",
49
+ spoken: "Option",
50
+ spokenOther: "Alt"
51
+ },
52
+ option: {
53
+ apple: "⌥",
54
+ other: "Alt",
55
+ spoken: "Option",
56
+ spokenOther: "Alt"
57
+ }
58
+ }, a = {
59
+ enter: {
60
+ symbol: "↵",
61
+ spoken: "Enter"
62
+ },
63
+ return: {
64
+ symbol: "↵",
65
+ spoken: "Return"
66
+ },
67
+ escape: {
68
+ symbol: "Esc",
69
+ spoken: "Escape"
70
+ },
71
+ esc: {
72
+ symbol: "Esc",
73
+ spoken: "Escape"
74
+ },
75
+ backspace: {
76
+ symbol: "⌫",
77
+ spoken: "Backspace"
78
+ },
79
+ delete: {
80
+ symbol: "⌦",
81
+ spoken: "Delete"
82
+ },
83
+ tab: {
84
+ symbol: "⇥",
85
+ spoken: "Tab"
86
+ },
87
+ space: {
88
+ symbol: "␣",
89
+ spoken: "Space"
90
+ },
91
+ capslock: {
92
+ symbol: "⇪",
93
+ spoken: "Caps lock"
94
+ },
95
+ win: {
96
+ symbol: "⊞",
97
+ spoken: "Windows"
98
+ },
99
+ pageup: {
100
+ symbol: "⇞",
101
+ spoken: "Page up"
102
+ },
103
+ pagedown: {
104
+ symbol: "⇟",
105
+ spoken: "Page down"
106
+ },
107
+ home: {
108
+ symbol: "↖",
109
+ spoken: "Home"
110
+ },
111
+ end: {
112
+ symbol: "↘",
113
+ spoken: "End"
114
+ },
115
+ up: {
116
+ symbol: "↑",
117
+ spoken: "Up arrow"
118
+ },
119
+ down: {
120
+ symbol: "↓",
121
+ spoken: "Down arrow"
122
+ },
123
+ left: {
124
+ symbol: "←",
125
+ spoken: "Left arrow"
126
+ },
127
+ right: {
128
+ symbol: "→",
129
+ spoken: "Right arrow"
130
+ },
131
+ arrowup: {
132
+ symbol: "↑",
133
+ spoken: "Up arrow"
134
+ },
135
+ arrowdown: {
136
+ symbol: "↓",
137
+ spoken: "Down arrow"
138
+ },
139
+ arrowleft: {
140
+ symbol: "←",
141
+ spoken: "Left arrow"
142
+ },
143
+ arrowright: {
144
+ symbol: "→",
145
+ spoken: "Right arrow"
146
+ }
147
+ };
148
+ function o(e, t) {
149
+ return (Array.isArray(e) ? e : e.split("+").map((e) => e.trim()).filter(Boolean)).map((e) => {
150
+ let n = e.toLowerCase(), r = i[n];
151
+ return r ? {
152
+ symbol: t ? r.apple : r.other,
153
+ spoken: t ? r.spoken : r.spokenOther ?? r.spoken
154
+ } : a[n] || {
155
+ symbol: e.length === 1 ? e.toUpperCase() : e,
156
+ spoken: e.toUpperCase()
157
+ };
158
+ });
159
+ }
160
+ //#endregion
161
+ export { r as isApplePlatform, o as parseHotkey, n as useApplePlatform };
@@ -0,0 +1,29 @@
1
+ import type { IconLike } from './icon';
2
+ export interface NavigationMenuLinkItem {
3
+ label: string;
4
+ /** Renders an `<a>`. Omit to render a `<button>` and handle `onSelect` yourself. */
5
+ href?: string;
6
+ /** `target` on the anchor, e.g. `'_blank'`. Ignored without `href`. */
7
+ target?: string;
8
+ icon?: IconLike;
9
+ /** Secondary line under the label. Only shown inside a panel. */
10
+ description?: string;
11
+ disabled?: boolean;
12
+ /** Marks the current page. Reflected as `data-active` and `aria-current`. */
13
+ active?: boolean;
14
+ /** Handle navigation yourself, e.g. with a router. */
15
+ onSelect?: () => void;
16
+ }
17
+ export interface NavigationMenuGroupItem extends NavigationMenuLinkItem {
18
+ /** Child links. Turns this entry into a panel trigger. */
19
+ items: NavigationMenuLinkItem[];
20
+ /** Columns for this entry's panel. Defaults to the menu's `columns`. */
21
+ columns?: 1 | 2 | 3;
22
+ }
23
+ /**
24
+ * One top-level entry: a link on its own, or a trigger that opens a panel of
25
+ * links. Which one it is comes from the presence of `items`, the same rule
26
+ * `DropdownMenuEntry` uses.
27
+ */
28
+ export type NavigationMenuEntry = NavigationMenuLinkItem | NavigationMenuGroupItem;
29
+ export declare function isNavigationGroup(entry: NavigationMenuEntry): entry is NavigationMenuGroupItem;
@@ -0,0 +1,6 @@
1
+ //#region src/composables/navigation-menu.ts
2
+ function e(e) {
3
+ return Array.isArray(e.items) && e.items.length > 0;
4
+ }
5
+ //#endregion
6
+ export { e as isNavigationGroup };
@@ -0,0 +1,35 @@
1
+ import type { Ref } from 'vue';
2
+ export interface ScrollEdges {
3
+ /** Nothing is scrolled past — the leading edge needs no fade. */
4
+ atStart: Ref<boolean>;
5
+ /** Everything is in view — the trailing edge needs no fade. */
6
+ atEnd: Ref<boolean>;
7
+ /** No overflow at all, so neither edge fades. */
8
+ overflowing: Ref<boolean>;
9
+ measure: () => void;
10
+ }
11
+ /**
12
+ * Track whether a scroll container has content past either edge.
13
+ *
14
+ * Measured rather than assumed: content arrives late, fonts reflow, and a
15
+ * panel that fits on a desktop overflows on a phone. A fade painted on a
16
+ * container that does not actually scroll is a lie about what is there.
17
+ */
18
+ export declare function useScrollEdges(target: Ref<HTMLElement | undefined>, axis: Ref<'vertical' | 'horizontal'>): ScrollEdges;
19
+ /**
20
+ * The mask that fades the edges with something past them.
21
+ *
22
+ * A mask rather than an overlaid gradient: an overlay has to be painted in the
23
+ * container's own background colour, which is a guess — put the component on a
24
+ * card, a muted panel or an image and the guess is visibly wrong. Removing
25
+ * pixels lets whatever is behind show through, so it is correct everywhere.
26
+ *
27
+ * Returns `undefined` when nothing should fade, so the element carries no
28
+ * `mask-image` at all rather than an identity one.
29
+ */
30
+ export declare function scrollFadeMask(options: {
31
+ orientation: 'vertical' | 'horizontal';
32
+ size: string;
33
+ fadeStart: boolean;
34
+ fadeEnd: boolean;
35
+ }): string | undefined;
@@ -0,0 +1,36 @@
1
+ import { onBeforeUnmount as e, ref as t, watch as n } from "vue";
2
+ //#region src/composables/scroll-fade.ts
3
+ function r(r, i) {
4
+ let a = t(!0), o = t(!0), s = t(!1), c, l, u;
5
+ function d() {
6
+ if (!u) return;
7
+ let e = i.value === "vertical", t = e ? u.scrollTop : Math.abs(u.scrollLeft), n = e ? u.clientHeight : u.clientWidth, r = e ? u.scrollHeight : u.scrollWidth;
8
+ s.value = r - n > 1, a.value = t <= 1, o.value = t + n >= r - 1;
9
+ }
10
+ function f() {
11
+ u?.removeEventListener("scroll", d), c?.disconnect(), l?.disconnect(), c = void 0, l = void 0, u = void 0;
12
+ }
13
+ return n(r, (e) => {
14
+ if (f(), u = e, u) {
15
+ if (d(), u.addEventListener("scroll", d, { passive: !0 }), typeof ResizeObserver < "u") {
16
+ c = new ResizeObserver(d), c.observe(u);
17
+ for (let e of u.children) c.observe(e);
18
+ }
19
+ typeof MutationObserver < "u" && (l = new MutationObserver(d), l.observe(u, {
20
+ childList: !0,
21
+ subtree: !0
22
+ }));
23
+ }
24
+ }, { immediate: !0 }), n(i, d), e(f), {
25
+ atStart: a,
26
+ atEnd: o,
27
+ overflowing: s,
28
+ measure: d
29
+ };
30
+ }
31
+ function i(e) {
32
+ let { orientation: t, size: n, fadeStart: r, fadeEnd: i } = e;
33
+ if (!(!r && !i)) return `linear-gradient(${t === "vertical" ? "to bottom" : "to right"}, ${[r ? `transparent 0, black ${n}` : "black 0", i ? `black calc(100% - ${n}), transparent 100%` : "black 100%"].join(", ")})`;
34
+ }
35
+ //#endregion
36
+ export { i as scrollFadeMask, r as useScrollEdges };
@@ -0,0 +1,35 @@
1
+ import type { IconLike } from './icon';
2
+ export interface SidebarLink {
3
+ label: string;
4
+ /** Renders an `<a>`. Omit to render a `<button>` and handle `onSelect` yourself. */
5
+ href?: string;
6
+ icon?: IconLike;
7
+ /** Count or status at the trailing edge, e.g. an unread total. */
8
+ badge?: string | number;
9
+ disabled?: boolean;
10
+ /** Marks the current page. Reflected as `data-active` and `aria-current`. */
11
+ active?: boolean;
12
+ /** Handle navigation yourself, e.g. with a router. */
13
+ onSelect?: () => void;
14
+ /** Child links. Turns this entry into a collapsible group. */
15
+ items?: SidebarLink[];
16
+ /** Start the group open. Ignored without `items`. */
17
+ defaultOpen?: boolean;
18
+ }
19
+ /**
20
+ * A labelled run of links under a small heading.
21
+ *
22
+ * The heading lives under its own `section` key rather than `label`, because a
23
+ * collapsible group link carries `items` too — with one shared key the two
24
+ * would be told apart by guessing at which other fields are present, and an
25
+ * icon-less group would silently become a heading.
26
+ */
27
+ export interface SidebarSection {
28
+ section: string;
29
+ items: SidebarLink[];
30
+ }
31
+ export type SidebarItems = (SidebarLink | SidebarSection)[];
32
+ export declare function isSidebarSection(item: SidebarLink | SidebarSection): item is SidebarSection;
33
+ /** Normalise to sections, so the template has a single path to render. */
34
+ export declare function toSidebarSections(items: SidebarItems | undefined): SidebarSection[];
35
+ export declare function isSidebarGroup(link: SidebarLink): boolean;
@@ -0,0 +1,23 @@
1
+ //#region src/composables/sidebar.ts
2
+ function e(e) {
3
+ return typeof e.section == "string";
4
+ }
5
+ function t(t) {
6
+ let n = [], r;
7
+ for (let i of t ?? []) {
8
+ if (e(i)) {
9
+ n.push(i), r = void 0;
10
+ continue;
11
+ }
12
+ r || (r = [], n.push({
13
+ section: "",
14
+ items: r
15
+ })), r.push(i);
16
+ }
17
+ return n;
18
+ }
19
+ function n(e) {
20
+ return Array.isArray(e.items) && e.items.length > 0;
21
+ }
22
+ //#endregion
23
+ export { n as isSidebarGroup, e as isSidebarSection, t as toSidebarSections };
@@ -0,0 +1,22 @@
1
+ /** One sampled point of a stroke. `t` is what makes the width vary. */
2
+ export interface SignaturePoint {
3
+ x: number;
4
+ y: number;
5
+ /** Milliseconds since the stroke began. */
6
+ t: number;
7
+ /** 0–1 where the hardware reports it; 0.5 is what a mouse sends. */
8
+ pressure: number;
9
+ }
10
+ /** A single continuous mark — one pen-down to pen-up. */
11
+ export type SignatureStroke = SignaturePoint[];
12
+ /**
13
+ * How wide the pen is between two points.
14
+ *
15
+ * A constant width reads as a traced outline rather than handwriting: real
16
+ * ink thins as the hand speeds up. Speed is measured in pixels per
17
+ * millisecond and mapped onto a shrinking multiplier, then blended with
18
+ * pressure where the hardware reports it.
19
+ */
20
+ export declare function strokeWidth(base: number, from: SignaturePoint, to: SignaturePoint): number;
21
+ /** Whether anything has actually been drawn. A stray tap is not a signature. */
22
+ export declare function hasInk(strokes: SignatureStroke[]): boolean;
@@ -0,0 +1,13 @@
1
+ //#region src/composables/signature.ts
2
+ function e(e, n, r) {
3
+ let i = t(1.2 - Math.hypot(r.x - n.x, r.y - n.y) / Math.max(r.t - n.t, 1) * .35, .4, 1.2), a = .7 + r.pressure * .6;
4
+ return e * i * a;
5
+ }
6
+ function t(e, t, n) {
7
+ return Math.min(Math.max(e, t), n);
8
+ }
9
+ function n(e) {
10
+ return e.some((e) => e.length > 1);
11
+ }
12
+ //#endregion
13
+ export { n as hasInk, e as strokeWidth };