iryx-ui 0.25.0 → 0.27.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 (35) hide show
  1. package/dist/components/AppShell.vue.d.ts +12 -11
  2. package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +76 -61
  3. package/dist/components/Breadcrumb.vue_vue_type_script_setup_true_lang.js +2 -1
  4. package/dist/components/CommandPalette.vue.d.ts +12 -0
  5. package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +122 -85
  6. package/dist/components/DateRangePicker.vue.d.ts +14 -2
  7. package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +111 -70
  8. package/dist/components/DropdownMenu.vue_vue_type_script_setup_true_lang.js +19 -18
  9. package/dist/components/DropdownMenuItems.vue_vue_type_script_setup_true_lang.js +12 -8
  10. package/dist/components/Sidebar.vue.d.ts +11 -5
  11. package/dist/components/Sidebar.vue_vue_type_script_setup_true_lang.js +172 -92
  12. package/dist/components/Tabs.vue.d.ts +7 -6
  13. package/dist/components/Tabs.vue_vue_type_script_setup_true_lang.js +65 -30
  14. package/dist/composables/command-palette.d.ts +7 -0
  15. package/dist/composables/command-palette.js +8 -2
  16. package/dist/composables/date.d.ts +25 -0
  17. package/dist/composables/date.js +59 -16
  18. package/dist/composables/dropdown-menu.d.ts +3 -1
  19. package/dist/composables/scroll-fade.d.ts +1 -1
  20. package/dist/composables/sidebar.d.ts +3 -0
  21. package/dist/composables/sidebar.js +7 -6
  22. package/dist/index.js +166 -166
  23. package/dist/theme/app-shell.d.ts +27 -6
  24. package/dist/theme/app-shell.js +26 -9
  25. package/dist/theme/avatar.js +1 -1
  26. package/dist/theme/date-picker.d.ts +9 -0
  27. package/dist/theme/date-picker.js +3 -0
  28. package/dist/theme/presets.d.ts +1 -0
  29. package/dist/theme/presets.js +1 -0
  30. package/dist/theme/sidebar.d.ts +24 -0
  31. package/dist/theme/sidebar.js +9 -2
  32. package/dist/theme/tabs.d.ts +18 -3
  33. package/dist/theme/tabs.js +20 -12
  34. package/package.json +1 -1
  35. package/theme.css +4 -0
@@ -1,14 +1,21 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import t from "./Icon.js";
3
- import { isSidebarGroup as n, toSidebarSections as r } from "../composables/sidebar.js";
4
- import { sidebarTheme as i } from "../theme/sidebar.js";
5
- import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, mergeModels as p, normalizeClass as m, openBlock as h, renderList as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useModel as x, withCtx as S } from "vue";
6
- import { ArrowRight01Icon as C } from "@hugeicons/core-free-icons";
7
- import { CollapsibleContent as w, CollapsibleRoot as T, CollapsibleTrigger as E, Primitive as D } from "reka-ui";
3
+ import { isSidebarGroup as n, sidebarPlacementKey as r, toSidebarSections as i } from "../composables/sidebar.js";
4
+ import a from "./Tooltip.js";
5
+ import o from "./DropdownMenu.js";
6
+ import { sidebarTheme as s } from "../theme/sidebar.js";
7
+ import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, inject as _, mergeModels as v, normalizeClass as y, openBlock as b, ref as x, renderList as S, renderSlot as C, resolveDynamicComponent as w, toDisplayString as T, unref as E, useModel as D, withCtx as O } from "vue";
8
+ import { ArrowRight01Icon as k } from "@hugeicons/core-free-icons";
9
+ import { CollapsibleContent as A, CollapsibleRoot as j, CollapsibleTrigger as M, Primitive as N } from "reka-ui";
8
10
  //#region src/components/Sidebar.vue?vue&type=script&setup=true&lang.ts
9
- var O = /*@__PURE__*/ f({
11
+ var P = [
12
+ "aria-label",
13
+ "disabled",
14
+ "data-active",
15
+ "data-disabled"
16
+ ], F = /*@__PURE__*/ g({
10
17
  __name: "Sidebar",
11
- props: /*@__PURE__*/ p({
18
+ props: /*@__PURE__*/ v({
12
19
  items: {},
13
20
  side: { default: "left" },
14
21
  label: { default: "Sidebar" },
@@ -31,61 +38,113 @@ var O = /*@__PURE__*/ f({
31
38
  collapsedModifiers: {}
32
39
  }),
33
40
  emits: ["update:collapsed"],
34
- setup(f) {
35
- let p = f, O = x(f, "collapsed"), k = e(), A = o(() => p.unstyled ?? k.unstyled), j = o(() => r(p.items)), M = o(() => i({
36
- side: p.side,
37
- collapsed: O.value
41
+ setup(g) {
42
+ let v = g, F = D(g, "collapsed"), I = _(r, void 0), L = l(() => F.value && I !== "drawer"), R = e(), z = l(() => v.unstyled ?? R.unstyled), B = l(() => i(v.items)), V = l(() => s({
43
+ side: v.side,
44
+ collapsed: L.value,
45
+ inShell: I !== void 0
38
46
  }));
39
- function N(e) {
40
- let t = p.ui?.[e];
41
- return A.value ? t : M.value[e]({ class: t });
47
+ function H(e) {
48
+ let t = v.ui?.[e];
49
+ return z.value ? t : V.value[e]({ class: t });
42
50
  }
43
- let P = (e) => e.href ? "a" : "button";
44
- function F(e, t) {
51
+ let U = l(() => v.side === "right" ? "left" : "right"), W = x({}), G = (e, t) => `${e}:${t.label}`, K = (e) => e.href ? "a" : "button", q = (e) => [...e.label][0], J = (e) => e.badge === void 0 ? e.label : `${e.label} (${e.badge})`;
52
+ function Y(e) {
53
+ return (e.items ?? []).map((e) => ({
54
+ label: e.label,
55
+ icon: e.icon,
56
+ disabled: e.disabled,
57
+ href: e.href,
58
+ onSelect: e.onSelect
59
+ }));
60
+ }
61
+ function X(e, t) {
45
62
  if (e.disabled) {
46
63
  t.preventDefault();
47
64
  return;
48
65
  }
49
66
  e.onSelect?.();
50
67
  }
51
- let I = (e) => e.label;
52
- return (e, r) => (h(), s(b(D), {
68
+ let Z = (e) => e.label;
69
+ return (e, r) => (b(), u(E(N), {
53
70
  as: "nav",
54
- "aria-label": p.label,
55
- "data-collapsed": O.value ? "" : void 0,
56
- class: m(A.value ? [p.ui?.root, p.class] : M.value.root({ class: [p.ui?.root, p.class] }))
71
+ "aria-label": v.label,
72
+ "data-collapsed": L.value ? "" : void 0,
73
+ class: y(z.value ? [v.ui?.root, v.class] : V.value.root({ class: [v.ui?.root, v.class] }))
57
74
  }, {
58
- default: S(() => [
59
- e.$slots.header ? (h(), l("div", {
75
+ default: O(() => [
76
+ e.$slots.header ? (b(), f("div", {
60
77
  key: 0,
61
- class: m(N("header"))
62
- }, [_(e.$slots, "header", { collapsed: O.value })], 2)) : c("", !0),
63
- u("div", { class: m(N("nav")) }, [_(e.$slots, "default", { collapsed: O.value }, () => [(h(!0), l(a, null, g(j.value, (r, i) => (h(), l("div", {
78
+ class: y(H("header"))
79
+ }, [C(e.$slots, "header", { collapsed: L.value })], 2)) : d("", !0),
80
+ p("div", { class: y(H("nav")) }, [C(e.$slots, "default", { collapsed: L.value }, () => [(b(!0), f(c, null, S(B.value, (r, i) => (b(), f("div", {
64
81
  key: r.section || i,
65
- class: m(N("section"))
66
- }, [r.section ? (h(), l("p", {
82
+ class: y(H("section"))
83
+ }, [r.section ? (b(), f("p", {
67
84
  key: 0,
68
- class: m(N("sectionLabel"))
69
- }, y(r.section), 3)) : c("", !0), (h(!0), l(a, null, g(r.items, (r) => (h(), l(a, { key: r.label }, [b(n)(r) ? (h(), s(b(T), {
85
+ class: y(H("sectionLabel"))
86
+ }, T(r.section), 3)) : d("", !0), (b(!0), f(c, null, S(r.items, (r) => (b(), f(c, { key: r.label }, [E(n)(r) && L.value ? (b(), u(a, {
70
87
  key: 0,
71
- "default-open": r.defaultOpen,
72
- disabled: r.disabled
88
+ text: J(r),
89
+ side: U.value,
90
+ unstyled: z.value
91
+ }, {
92
+ trigger: O(() => [h(o, {
93
+ items: Y(r),
94
+ side: U.value,
95
+ unstyled: z.value
96
+ }, {
97
+ trigger: O(() => [p("button", {
98
+ type: "button",
99
+ "aria-label": Z(r),
100
+ disabled: r.disabled,
101
+ "data-active": r.active ? "" : void 0,
102
+ "data-disabled": r.disabled ? "" : void 0,
103
+ class: y(H("link"))
104
+ }, [C(e.$slots, "link", {
105
+ link: r,
106
+ collapsed: L.value
107
+ }, () => [r.icon ? (b(), u(t, {
108
+ key: 0,
109
+ icon: r.icon
110
+ }, null, 8, ["icon"])) : (b(), f("span", {
111
+ key: 1,
112
+ "aria-hidden": "true",
113
+ class: y(H("linkInitial"))
114
+ }, T(q(r)), 3))])], 10, P)]),
115
+ header: O(() => [m(T(r.label), 1)]),
116
+ _: 2
117
+ }, 1032, [
118
+ "items",
119
+ "side",
120
+ "unstyled"
121
+ ])]),
122
+ _: 2
123
+ }, 1032, [
124
+ "text",
125
+ "side",
126
+ "unstyled"
127
+ ])) : E(n)(r) ? (b(), u(E(j), {
128
+ key: 1,
129
+ open: W.value[G(i, r)] ?? r.defaultOpen ?? !1,
130
+ disabled: r.disabled,
131
+ "onUpdate:open": (e) => W.value[G(i, r)] = e
73
132
  }, {
74
- default: S(() => [d(b(E), {
75
- "aria-label": I(r),
133
+ default: O(() => [h(E(M), {
134
+ "aria-label": Z(r),
76
135
  "data-active": r.active ? "" : void 0,
77
136
  "data-disabled": r.disabled ? "" : void 0,
78
- class: m(N("link"))
137
+ class: y(H("link"))
79
138
  }, {
80
- default: S(() => [
81
- r.icon ? (h(), s(t, {
139
+ default: O(() => [
140
+ r.icon ? (b(), u(t, {
82
141
  key: 0,
83
142
  icon: r.icon
84
- }, null, 8, ["icon"])) : c("", !0),
85
- u("span", { class: m(N("linkLabel")) }, y(r.label), 3),
86
- d(t, {
87
- icon: b(C),
88
- class: m(N("groupIcon"))
143
+ }, null, 8, ["icon"])) : d("", !0),
144
+ p("span", { class: y(H("linkLabel")) }, T(r.label), 3),
145
+ h(t, {
146
+ icon: E(k),
147
+ class: y(H("groupIcon"))
89
148
  }, null, 8, ["icon", "class"])
90
149
  ]),
91
150
  _: 2
@@ -94,29 +153,29 @@ var O = /*@__PURE__*/ f({
94
153
  "data-active",
95
154
  "data-disabled",
96
155
  "class"
97
- ]), d(b(w), { class: m(N("groupContent")) }, {
98
- default: S(() => [u("div", { class: m(N("groupInner")) }, [(h(!0), l(a, null, g(r.items, (e) => (h(), s(v(P(e)), {
156
+ ]), h(E(A), { class: y(H("groupContent")) }, {
157
+ default: O(() => [p("div", { class: y(H("groupInner")) }, [(b(!0), f(c, null, S(r.items, (e) => (b(), u(w(K(e)), {
99
158
  key: e.label,
100
159
  href: e.href,
101
160
  type: e.href ? void 0 : "button",
102
- "aria-label": I(e),
161
+ "aria-label": Z(e),
103
162
  "aria-current": e.active ? "page" : void 0,
104
163
  "aria-disabled": e.disabled || void 0,
105
164
  "data-active": e.active ? "" : void 0,
106
165
  "data-disabled": e.disabled ? "" : void 0,
107
- class: m(N("link")),
108
- onClick: (t) => F(e, t)
166
+ class: y(H("link")),
167
+ onClick: (t) => X(e, t)
109
168
  }, {
110
- default: S(() => [
111
- e.icon ? (h(), s(t, {
169
+ default: O(() => [
170
+ e.icon ? (b(), u(t, {
112
171
  key: 0,
113
172
  icon: e.icon
114
- }, null, 8, ["icon"])) : c("", !0),
115
- u("span", { class: m(N("linkLabel")) }, y(e.label), 3),
116
- e.badge === void 0 ? c("", !0) : (h(), l("span", {
173
+ }, null, 8, ["icon"])) : d("", !0),
174
+ p("span", { class: y(H("linkLabel")) }, T(e.label), 3),
175
+ e.badge === void 0 ? d("", !0) : (b(), f("span", {
117
176
  key: 1,
118
- class: m(N("linkBadge"))
119
- }, y(e.badge), 3))
177
+ class: y(H("linkBadge"))
178
+ }, T(e.badge), 3))
120
179
  ]),
121
180
  _: 2
122
181
  }, 1032, [
@@ -133,48 +192,69 @@ var O = /*@__PURE__*/ f({
133
192
  _: 2
134
193
  }, 1032, ["class"])]),
135
194
  _: 2
136
- }, 1032, ["default-open", "disabled"])) : (h(), s(v(P(r)), {
137
- key: 1,
138
- href: r.href,
139
- type: r.href ? void 0 : "button",
140
- "aria-label": I(r),
141
- "aria-current": r.active ? "page" : void 0,
142
- "aria-disabled": r.disabled || void 0,
143
- "data-active": r.active ? "" : void 0,
144
- "data-disabled": r.disabled ? "" : void 0,
145
- class: m(N("link")),
146
- onClick: (e) => F(r, e)
195
+ }, 1032, [
196
+ "open",
197
+ "disabled",
198
+ "onUpdate:open"
199
+ ])) : (b(), u(a, {
200
+ key: 2,
201
+ text: J(r),
202
+ side: U.value,
203
+ disabled: !L.value,
204
+ unstyled: z.value
147
205
  }, {
148
- default: S(() => [_(e.$slots, "link", {
149
- link: r,
150
- collapsed: O.value
151
- }, () => [
152
- r.icon ? (h(), s(t, {
153
- key: 0,
154
- icon: r.icon
155
- }, null, 8, ["icon"])) : c("", !0),
156
- u("span", { class: m(N("linkLabel")) }, y(r.label), 3),
157
- r.badge === void 0 ? c("", !0) : (h(), l("span", {
158
- key: 1,
159
- class: m(N("linkBadge"))
160
- }, y(r.badge), 3))
161
- ])]),
206
+ trigger: O(() => [(b(), u(w(K(r)), {
207
+ href: r.href,
208
+ type: r.href ? void 0 : "button",
209
+ "aria-label": Z(r),
210
+ "aria-current": r.active ? "page" : void 0,
211
+ "aria-disabled": r.disabled || void 0,
212
+ "data-active": r.active ? "" : void 0,
213
+ "data-disabled": r.disabled ? "" : void 0,
214
+ class: y(H("link")),
215
+ onClick: (e) => X(r, e)
216
+ }, {
217
+ default: O(() => [C(e.$slots, "link", {
218
+ link: r,
219
+ collapsed: L.value
220
+ }, () => [
221
+ r.icon ? (b(), u(t, {
222
+ key: 0,
223
+ icon: r.icon
224
+ }, null, 8, ["icon"])) : L.value ? (b(), f("span", {
225
+ key: 1,
226
+ "aria-hidden": "true",
227
+ class: y(H("linkInitial"))
228
+ }, T(q(r)), 3)) : d("", !0),
229
+ p("span", { class: y(H("linkLabel")) }, T(r.label), 3),
230
+ r.badge === void 0 ? d("", !0) : (b(), f("span", {
231
+ key: 2,
232
+ class: y(H("linkBadge"))
233
+ }, T(r.badge), 3))
234
+ ])]),
235
+ _: 2
236
+ }, 1032, [
237
+ "href",
238
+ "type",
239
+ "aria-label",
240
+ "aria-current",
241
+ "aria-disabled",
242
+ "data-active",
243
+ "data-disabled",
244
+ "class",
245
+ "onClick"
246
+ ]))]),
162
247
  _: 2
163
248
  }, 1032, [
164
- "href",
165
- "type",
166
- "aria-label",
167
- "aria-current",
168
- "aria-disabled",
169
- "data-active",
170
- "data-disabled",
171
- "class",
172
- "onClick"
249
+ "text",
250
+ "side",
251
+ "disabled",
252
+ "unstyled"
173
253
  ]))], 64))), 128))], 2))), 128))])], 2),
174
- e.$slots.footer ? (h(), l("div", {
254
+ e.$slots.footer ? (b(), f("div", {
175
255
  key: 1,
176
- class: m(N("footer"))
177
- }, [_(e.$slots, "footer", { collapsed: O.value })], 2)) : c("", !0)
256
+ class: y(H("footer"))
257
+ }, [C(e.$slots, "footer", { collapsed: L.value })], 2)) : d("", !0)
178
258
  ]),
179
259
  _: 3
180
260
  }, 8, [
@@ -185,4 +265,4 @@ var O = /*@__PURE__*/ f({
185
265
  }
186
266
  });
187
267
  //#endregion
188
- export { O as default };
268
+ export { F as default };
@@ -22,6 +22,7 @@ export interface TabsProps {
22
22
  /** Override classes per element, e.g. `{ list: 'w-full' }`. */
23
23
  ui?: {
24
24
  root?: string;
25
+ frame?: string;
25
26
  list?: string;
26
27
  indicator?: string;
27
28
  trigger?: string;
@@ -33,19 +34,19 @@ type __VLS_ModelProps = {
33
34
  modelValue?: string | undefined;
34
35
  };
35
36
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
36
- declare var __VLS_19: {}, __VLS_27: {
37
+ declare var __VLS_21: {}, __VLS_29: {
37
38
  item: TabsItem;
38
- }, __VLS_34: {}, __VLS_43: string, __VLS_44: {
39
+ }, __VLS_36: {}, __VLS_45: string, __VLS_46: {
39
40
  item: TabsItem;
40
41
  };
41
42
  type __VLS_Slots = {} & {
42
- [K in NonNullable<typeof __VLS_43>]?: (props: typeof __VLS_44) => any;
43
+ [K in NonNullable<typeof __VLS_45>]?: (props: typeof __VLS_46) => any;
43
44
  } & {
44
- list?: (props: typeof __VLS_19) => any;
45
+ list?: (props: typeof __VLS_21) => any;
45
46
  } & {
46
- trigger?: (props: typeof __VLS_27) => any;
47
+ trigger?: (props: typeof __VLS_29) => any;
47
48
  } & {
48
- default?: (props: typeof __VLS_34) => any;
49
+ default?: (props: typeof __VLS_36) => any;
49
50
  };
50
51
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
51
52
  "update:modelValue": (value: string | undefined) => any;
@@ -1,12 +1,13 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import t from "./Icon.js";
3
- import { tabsTheme as n } from "../theme/tabs.js";
4
- import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeModels as d, normalizeClass as f, openBlock as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _, useModel as v, withCtx as y } from "vue";
5
- import { TabsContent as b, TabsIndicator as x, TabsList as S, TabsRoot as C, TabsTrigger as w } from "reka-ui";
3
+ import { scrollFadeMask as n, useScrollEdges as r } from "../composables/scroll-fade.js";
4
+ import { tabsTheme as i } from "../theme/tabs.js";
5
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onMounted as v, openBlock as y, ref as b, renderList as x, renderSlot as S, toDisplayString as C, unref as w, useModel as T, watch as E, withCtx as D } from "vue";
6
+ import { TabsContent as O, TabsIndicator as k, TabsList as A, TabsRoot as j, TabsTrigger as M } from "reka-ui";
6
7
  //#region src/components/Tabs.vue?vue&type=script&setup=true&lang.ts
7
- var T = /*@__PURE__*/ u({
8
+ var N = 24, P = /*@__PURE__*/ p({
8
9
  __name: "Tabs",
9
- props: /*@__PURE__*/ d({
10
+ props: /*@__PURE__*/ m({
10
11
  items: {},
11
12
  variant: {},
12
13
  orientation: {},
@@ -27,29 +28,57 @@ var T = /*@__PURE__*/ u({
27
28
  modelModifiers: {}
28
29
  }),
29
30
  emits: ["update:modelValue"],
30
- setup(u) {
31
- let d = u, T = i(() => (d.items ?? []).map((e) => typeof e == "string" ? { label: e } : e)), E = (e) => e.value ?? e.label, D = v(u, "modelValue"), O = e(), k = i(() => d.unstyled ?? O.unstyled), A = i(() => n({
32
- variant: d.variant,
33
- orientation: d.orientation
34
- })), j = i(() => k.value ? [d.ui?.root, d.class] : A.value.root({ class: [d.ui?.root, d.class] })), M = i(() => k.value ? d.ui?.list : A.value.list({ class: d.ui?.list })), N = i(() => k.value ? d.ui?.indicator : A.value.indicator({ class: d.ui?.indicator })), P = i(() => k.value ? d.ui?.trigger : A.value.trigger({ class: d.ui?.trigger })), F = i(() => k.value ? d.ui?.content : A.value.content({ class: d.ui?.content }));
35
- return (e, n) => (p(), a(_(C), {
36
- modelValue: D.value,
37
- "onUpdate:modelValue": n[0] ||= (e) => D.value = e,
38
- "default-value": T.value[0] ? E(T.value[0]) : void 0,
39
- orientation: d.orientation,
40
- class: f(j.value)
31
+ setup(p) {
32
+ let m = p, P = o(() => (m.items ?? []).map((e) => typeof e == "string" ? { label: e } : e)), F = (e) => e.value ?? e.label, I = T(p, "modelValue"), L = b(), R = o(() => L.value?.$el), z = o(() => m.orientation === "vertical" ? "vertical" : "horizontal"), { atStart: B, atEnd: V, overflowing: H } = r(R, z), U = o(() => {
33
+ if (!H.value) return;
34
+ let e = n({
35
+ orientation: z.value,
36
+ size: `${N}px`,
37
+ fadeStart: !B.value,
38
+ fadeEnd: !V.value
39
+ });
40
+ return e ? {
41
+ maskImage: e,
42
+ WebkitMaskImage: e
43
+ } : void 0;
44
+ });
45
+ function W() {
46
+ let e = R.value, t = e?.querySelector("[role=\"tab\"][data-state=\"active\"]");
47
+ if (!e || !t) return;
48
+ let n = z.value === "vertical", r = n ? t.offsetTop : t.offsetLeft, i = r + (n ? t.offsetHeight : t.offsetWidth), a = n ? e.scrollTop : e.scrollLeft, o = n ? e.clientHeight : e.clientWidth, s = a;
49
+ r < a + N ? s = r - N : i > a + o - N && (s = i - o + N), s !== a && (n ? e.scrollTop = Math.max(0, s) : e.scrollLeft = Math.max(0, s));
50
+ }
51
+ v(() => void h(W)), E(I, () => void h(W));
52
+ let G = e(), K = o(() => m.unstyled ?? G.unstyled), q = o(() => i({
53
+ variant: m.variant,
54
+ orientation: m.orientation
55
+ })), J = o(() => K.value ? [m.ui?.root, m.class] : q.value.root({ class: [m.ui?.root, m.class] })), Y = o(() => K.value ? m.ui?.frame : q.value.frame({ class: m.ui?.frame })), X = o(() => K.value ? m.ui?.list : q.value.list({ class: m.ui?.list })), Z = o(() => K.value ? m.ui?.indicator : q.value.indicator({ class: m.ui?.indicator })), Q = o(() => K.value ? m.ui?.trigger : q.value.trigger({ class: m.ui?.trigger })), $ = o(() => K.value ? m.ui?.content : q.value.content({ class: m.ui?.content }));
56
+ return (e, n) => (y(), s(w(j), {
57
+ modelValue: I.value,
58
+ "onUpdate:modelValue": n[0] ||= (e) => I.value = e,
59
+ "default-value": P.value[0] ? F(P.value[0]) : void 0,
60
+ orientation: m.orientation,
61
+ class: g(J.value)
41
62
  }, {
42
- default: y(() => [l(_(S), { class: f(M.value) }, {
43
- default: y(() => [l(_(x), { class: f(N.value) }, null, 8, ["class"]), h(e.$slots, "list", {}, () => [(p(!0), s(r, null, m(T.value, (n) => (p(), a(_(w), {
44
- key: E(n),
45
- value: E(n),
63
+ default: D(() => [u("div", { class: g(Y.value) }, [f(w(A), {
64
+ ref_key: "list",
65
+ ref: L,
66
+ class: g(X.value),
67
+ style: _(U.value),
68
+ "data-overflowing": w(H) ? "" : void 0,
69
+ "data-at-start": w(B) ? "" : void 0,
70
+ "data-at-end": w(V) ? "" : void 0
71
+ }, {
72
+ default: D(() => [f(w(k), { class: g(Z.value) }, null, 8, ["class"]), S(e.$slots, "list", {}, () => [(y(!0), l(a, null, x(P.value, (n) => (y(), s(w(M), {
73
+ key: F(n),
74
+ value: F(n),
46
75
  disabled: n.disabled,
47
- class: f(P.value)
76
+ class: g(Q.value)
48
77
  }, {
49
- default: y(() => [h(e.$slots, "trigger", { item: n }, () => [n.icon ? (p(), a(t, {
78
+ default: D(() => [S(e.$slots, "trigger", { item: n }, () => [n.icon ? (y(), s(t, {
50
79
  key: 0,
51
80
  icon: n.icon
52
- }, null, 8, ["icon"])) : o("", !0), c(" " + g(n.label), 1)])]),
81
+ }, null, 8, ["icon"])) : c("", !0), d(" " + C(n.label), 1)])]),
53
82
  _: 2
54
83
  }, 1032, [
55
84
  "value",
@@ -57,13 +86,19 @@ var T = /*@__PURE__*/ u({
57
86
  "class"
58
87
  ]))), 128))])]),
59
88
  _: 3
60
- }, 8, ["class"]), h(e.$slots, "default", {}, () => [(p(!0), s(r, null, m(T.value, (t) => (p(), a(_(b), {
61
- key: E(t),
62
- value: E(t),
63
- "force-mount": d.keepMounted || void 0,
64
- class: f(F.value)
89
+ }, 8, [
90
+ "class",
91
+ "style",
92
+ "data-overflowing",
93
+ "data-at-start",
94
+ "data-at-end"
95
+ ])], 2), S(e.$slots, "default", {}, () => [(y(!0), l(a, null, x(P.value, (t) => (y(), s(w(O), {
96
+ key: F(t),
97
+ value: F(t),
98
+ "force-mount": m.keepMounted || void 0,
99
+ class: g($.value)
65
100
  }, {
66
- default: y(() => [h(e.$slots, E(t), { item: t })]),
101
+ default: D(() => [S(e.$slots, F(t), { item: t })]),
67
102
  _: 2
68
103
  }, 1032, [
69
104
  "value",
@@ -80,4 +115,4 @@ var T = /*@__PURE__*/ u({
80
115
  }
81
116
  });
82
117
  //#endregion
83
- export { T as default };
118
+ export { P as default };
@@ -2,6 +2,11 @@ import type { IconLike } from './icon';
2
2
  export interface CommandItem {
3
3
  /** What the reader searches for and reads. */
4
4
  label: string;
5
+ /**
6
+ * Stable identity for the recent list. Falls back to the group and label,
7
+ * so set it when a label can change (a translated app, a renamed page).
8
+ */
9
+ id?: string;
5
10
  icon?: IconLike;
6
11
  /**
7
12
  * Displayed at the trailing edge, split on spaces into separate keys.
@@ -27,6 +32,8 @@ export type CommandEntry = CommandItem | CommandGroup;
27
32
  export declare function isCommandGroup(entry: CommandEntry): entry is CommandGroup;
28
33
  /** Normalise to groups, so the template has a single path to render. */
29
34
  export declare function toCommandGroups(entries: CommandEntry[] | undefined): CommandGroup[];
35
+ export declare function commandId(item: CommandItem, group: string): string;
36
+ export declare function pushRecent(recent: string[], id: string, limit: number): string[];
30
37
  /**
31
38
  * Everything a query should match against: the label, the group it sits in,
32
39
  * and any keywords. Joined rather than tested separately so a query spanning
@@ -18,15 +18,21 @@ function n(e) {
18
18
  return n;
19
19
  }
20
20
  function r(e, t) {
21
+ return e.id ?? `${t}/${e.label}`;
22
+ }
23
+ function i(e, t, n) {
24
+ return [t, ...e.filter((e) => e !== t)].slice(0, Math.max(0, n));
25
+ }
26
+ function a(e, t) {
21
27
  return [
22
28
  e.label,
23
29
  t,
24
30
  ...e.keywords ?? []
25
31
  ].join(" ");
26
32
  }
27
- function i(t, n) {
33
+ function o(t, n) {
28
34
  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
35
  return a && !u || o && !t.ctrlKey || s && !t.metaKey || c !== t.shiftKey || l !== t.altKey ? !1 : t.key.toLowerCase() === i;
30
36
  }
31
37
  //#endregion
32
- export { r as commandHaystack, t as isCommandGroup, i as matchesHotkey, n as toCommandGroups };
38
+ export { a as commandHaystack, r as commandId, t as isCommandGroup, o as matchesHotkey, i as pushRecent, n as toCommandGroups };
@@ -12,6 +12,31 @@ export declare function toCalendarDate(iso: string | null | undefined): Calendar
12
12
  export declare function toIsoDate(date: DateValue | null | undefined): string | null;
13
13
  /** Today in the viewer's own zone, as an ISO date string. */
14
14
  export declare function isoToday(): string;
15
+ /** One shortcut in `IDateRangePicker`'s preset list. */
16
+ export interface DateRangePreset {
17
+ label: string;
18
+ /** A function is re-run each time the picker opens, so "Today" stays today. */
19
+ range: {
20
+ start: string | null;
21
+ end: string | null;
22
+ } | (() => {
23
+ start: string | null;
24
+ end: string | null;
25
+ });
26
+ }
27
+ export interface CommonDateRangePresetLabels {
28
+ today: string;
29
+ yesterday: string;
30
+ last7Days: string;
31
+ last30Days: string;
32
+ thisMonth: string;
33
+ lastMonth: string;
34
+ }
35
+ /**
36
+ * The usual dashboard shortcuts, relative to today in the viewer's zone.
37
+ * Pass `labels` to translate them.
38
+ */
39
+ export declare function commonDateRangePresets(labels?: Partial<CommonDateRangePresetLabels>): DateRangePreset[];
15
40
  /**
16
41
  * Render an ISO date for display. Returns `''` for absent or malformed input
17
42
  * so a caller can fall back to a placeholder.