iryx-ui 0.26.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.
@@ -25,6 +25,7 @@ export interface AppShellProps {
25
25
  header?: string;
26
26
  body?: string;
27
27
  sidebar?: string;
28
+ panel?: string;
28
29
  headerRow?: string;
29
30
  headerContent?: string;
30
31
  navTrigger?: string;
@@ -34,24 +35,24 @@ export interface AppShellProps {
34
35
  footer?: string;
35
36
  };
36
37
  }
37
- declare var __VLS_13: {
38
- navOpen: boolean;
39
- toggleNav: () => boolean;
40
- }, __VLS_21: {
38
+ declare var __VLS_20: {
41
39
  inDrawer: boolean;
42
- }, __VLS_23: {
40
+ }, __VLS_28: {
43
41
  inDrawer: boolean;
44
- }, __VLS_25: {}, __VLS_27: {};
42
+ }, __VLS_35: {
43
+ navOpen: boolean;
44
+ toggleNav: () => boolean;
45
+ }, __VLS_37: {}, __VLS_39: {};
45
46
  type __VLS_Slots = {} & {
46
- header?: (props: typeof __VLS_13) => any;
47
+ sidebar?: (props: typeof __VLS_20) => any;
47
48
  } & {
48
- sidebar?: (props: typeof __VLS_21) => any;
49
+ sidebar?: (props: typeof __VLS_28) => any;
49
50
  } & {
50
- sidebar?: (props: typeof __VLS_23) => any;
51
+ header?: (props: typeof __VLS_35) => any;
51
52
  } & {
52
- default?: (props: typeof __VLS_25) => any;
53
+ default?: (props: typeof __VLS_37) => any;
53
54
  } & {
54
- footer?: (props: typeof __VLS_27) => any;
55
+ footer?: (props: typeof __VLS_39) => any;
55
56
  };
56
57
  declare const __VLS_base: import("vue").DefineComponent<AppShellProps, {
57
58
  /** Open or close the mobile navigation drawer from the outside. */
@@ -1,13 +1,14 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import t from "./Icon.js";
3
3
  import { useElementSize as n } from "../composables/element-size.js";
4
- import { appShellTheme as r } from "../theme/app-shell.js";
5
- import i from "./Drawer.js";
6
- import { computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, openBlock as m, ref as h, renderSlot as g, unref as _, useSlots as v, withCtx as y } from "vue";
7
- import { Menu01Icon as b } from "@hugeicons/core-free-icons";
8
- import { Primitive as x } from "reka-ui";
4
+ import { sidebarPlacementKey as r } from "../composables/sidebar.js";
5
+ import { appShellTheme as i } from "../theme/app-shell.js";
6
+ import a from "./Drawer.js";
7
+ import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, normalizeStyle as m, openBlock as h, provide as g, ref as _, renderSlot as v, unref as y, useSlots as b, withCtx as x } from "vue";
8
+ import { Menu01Icon as S } from "@hugeicons/core-free-icons";
9
+ import { Primitive as C } from "reka-ui";
9
10
  //#region src/components/AppShell.vue?vue&type=script&setup=true&lang.ts
10
- var S = ["aria-label", "aria-expanded"], C = /*@__PURE__*/ d({
11
+ var w = ["aria-label", "aria-expanded"], T = /*@__PURE__*/ f({
11
12
  __name: "AppShell",
12
13
  props: {
13
14
  as: { default: "div" },
@@ -30,68 +31,82 @@ var S = ["aria-label", "aria-expanded"], C = /*@__PURE__*/ d({
30
31
  ] },
31
32
  ui: {}
32
33
  },
33
- setup(d, { expose: C }) {
34
- let w = d, T = v(), E = e(), D = a(() => w.unstyled ?? E.unstyled), O = h(), { height: k } = n(O), A = a(() => w.scroll === "page" && T.header ? { "--iryx-shell-header-height": `${k.value}px` } : void 0), j = h(!1), M = a(() => w.mobileNav && !!T.sidebar), N = a(() => r({
35
- scroll: w.scroll,
36
- sidebarPosition: w.sidebarPosition,
37
- mobileNav: M.value
34
+ setup(T, { expose: E }) {
35
+ let D = T, O = b(), k = e(), A = o(() => D.unstyled ?? k.unstyled), j = _(), { height: M } = n(j), N = o(() => D.scroll === "page" && O.header ? { "--iryx-shell-header-height": `${M.value}px` } : void 0), P = _(!1), F = f({
36
+ props: { placement: {
37
+ type: String,
38
+ required: !0
39
+ } },
40
+ setup(e, { slots: t }) {
41
+ return g(r, e.placement), () => t.default?.();
42
+ }
43
+ }), I = o(() => D.mobileNav && !!O.sidebar), L = o(() => i({
44
+ scroll: D.scroll,
45
+ sidebarPosition: D.sidebarPosition,
46
+ mobileNav: I.value,
47
+ hasSidebar: !!O.sidebar
38
48
  }));
39
- C({ navOpen: j });
40
- function P(e) {
41
- let t = w.ui?.[e];
42
- return D.value ? t : N.value[e]({ class: t });
49
+ E({ navOpen: P });
50
+ function R(e) {
51
+ let t = D.ui?.[e];
52
+ return A.value ? t : L.value[e]({ class: t });
43
53
  }
44
- return (e, n) => (m(), o(_(x), {
45
- as: w.as,
46
- style: p(A.value),
47
- class: f(D.value ? [w.ui?.root, w.class] : N.value.root({ class: [w.ui?.root, w.class] }))
54
+ return (e, n) => (h(), s(y(C), {
55
+ as: D.as,
56
+ style: m(N.value),
57
+ class: p(A.value ? [D.ui?.root, D.class] : L.value.root({ class: [D.ui?.root, D.class] }))
48
58
  }, {
49
- default: y(() => [
50
- e.$slots.header ? (m(), c("div", {
59
+ default: x(() => [I.value ? (h(), s(a, {
60
+ key: 0,
61
+ open: P.value,
62
+ "onUpdate:open": n[0] ||= (e) => P.value = e,
63
+ side: "left",
64
+ size: "sm",
65
+ class: p(R("navDrawer")),
66
+ ui: {
67
+ body: R("navDrawerBody"),
68
+ overlay: "md:hidden",
69
+ content: "md:hidden"
70
+ }
71
+ }, {
72
+ default: x(() => [d(y(F), { placement: "drawer" }, {
73
+ default: x(() => [v(e.$slots, "sidebar", { inDrawer: !0 })]),
74
+ _: 3
75
+ })]),
76
+ _: 3
77
+ }, 8, [
78
+ "open",
79
+ "class",
80
+ "ui"
81
+ ])) : c("", !0), u("div", { class: p(R("body")) }, [e.$slots.sidebar ? (h(), l("div", {
82
+ key: 0,
83
+ class: p(R("sidebar"))
84
+ }, [d(y(F), { placement: "column" }, {
85
+ default: x(() => [v(e.$slots, "sidebar", { inDrawer: !1 })]),
86
+ _: 3
87
+ })], 2)) : c("", !0), u("div", { class: p(R("panel")) }, [
88
+ e.$slots.header ? (h(), l("div", {
51
89
  key: 0,
52
90
  ref_key: "header",
53
- ref: O,
54
- class: f(P("header"))
55
- }, [l("div", { class: f(P("headerRow")) }, [M.value ? (m(), c("button", {
91
+ ref: j,
92
+ class: p(R("header"))
93
+ }, [u("div", { class: p(R("headerRow")) }, [I.value ? (h(), l("button", {
56
94
  key: 0,
57
95
  type: "button",
58
- "aria-label": w.navLabel,
59
- "aria-expanded": j.value,
60
- class: f(P("navTrigger")),
61
- onClick: n[0] ||= (e) => j.value = !0
62
- }, [u(t, { icon: _(b) }, null, 8, ["icon"])], 10, S)) : s("", !0), l("div", { class: f(P("headerContent")) }, [g(e.$slots, "header", {
63
- navOpen: j.value,
64
- toggleNav: () => j.value = !j.value
65
- })], 2)], 2)], 2)) : s("", !0),
66
- M.value ? (m(), o(i, {
96
+ "aria-label": D.navLabel,
97
+ "aria-expanded": P.value,
98
+ class: p(R("navTrigger")),
99
+ onClick: n[1] ||= (e) => P.value = !0
100
+ }, [d(t, { icon: y(S) }, null, 8, ["icon"])], 10, w)) : c("", !0), u("div", { class: p(R("headerContent")) }, [v(e.$slots, "header", {
101
+ navOpen: P.value,
102
+ toggleNav: () => P.value = !P.value
103
+ })], 2)], 2)], 2)) : c("", !0),
104
+ u("main", { class: p(R("main")) }, [v(e.$slots, "default")], 2),
105
+ e.$slots.footer ? (h(), l("div", {
67
106
  key: 1,
68
- open: j.value,
69
- "onUpdate:open": n[1] ||= (e) => j.value = e,
70
- side: "left",
71
- size: "sm",
72
- class: f(P("navDrawer")),
73
- ui: {
74
- body: P("navDrawerBody"),
75
- overlay: "md:hidden",
76
- content: "md:hidden"
77
- }
78
- }, {
79
- default: y(() => [g(e.$slots, "sidebar", { inDrawer: !0 })]),
80
- _: 3
81
- }, 8, [
82
- "open",
83
- "class",
84
- "ui"
85
- ])) : s("", !0),
86
- l("div", { class: f(P("body")) }, [e.$slots.sidebar ? (m(), c("div", {
87
- key: 0,
88
- class: f(P("sidebar"))
89
- }, [g(e.$slots, "sidebar", { inDrawer: !1 })], 2)) : s("", !0), l("main", { class: f(P("main")) }, [g(e.$slots, "default")], 2)], 2),
90
- e.$slots.footer ? (m(), c("div", {
91
- key: 2,
92
- class: f(P("footer"))
93
- }, [g(e.$slots, "footer")], 2)) : s("", !0)
94
- ]),
107
+ class: p(R("footer"))
108
+ }, [v(e.$slots, "footer")], 2)) : c("", !0)
109
+ ], 2)], 2)]),
95
110
  _: 3
96
111
  }, 8, [
97
112
  "as",
@@ -101,4 +116,4 @@ var S = ["aria-label", "aria-expanded"], C = /*@__PURE__*/ d({
101
116
  }
102
117
  });
103
118
  //#endregion
104
- export { C as default };
119
+ export { T as default };
@@ -43,7 +43,8 @@ var w = ["aria-label"], T = /*@__PURE__*/ f({
43
43
  }), M = a(() => O.value.slice(1, 1 + A.value).map((e) => ({
44
44
  label: e.label,
45
45
  icon: e.icon,
46
- onSelect: e.onSelect ?? (e.href ? () => window.location.assign(e.href) : void 0)
46
+ href: e.href,
47
+ onSelect: e.onSelect
47
48
  }))), N = a(() => n());
48
49
  function P(e) {
49
50
  let t = T.ui?.[e];
@@ -1,10 +1,11 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import { dropdownMenuTheme as t } from "../theme/dropdown-menu.js";
3
3
  import n from "./DropdownMenuItems.js";
4
- import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, openBlock as d, renderSlot as f, unref as p, useModel as m, withCtx as h } from "vue";
5
- import { DropdownMenuContent as g, DropdownMenuPortal as _, DropdownMenuRoot as v, DropdownMenuTrigger as y } from "reka-ui";
4
+ import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, openBlock as f, renderSlot as p, unref as m, useModel as h, withCtx as g } from "vue";
5
+ import { DropdownMenuContent as _, DropdownMenuPortal as v, DropdownMenuRoot as y, DropdownMenuTrigger as b } from "reka-ui";
6
6
  //#region src/components/DropdownMenu.vue?vue&type=script&setup=true&lang.ts
7
- var b = /*@__PURE__*/ c({
7
+ var x = /*@__PURE__*/ c({
8
+ inheritAttrs: !1,
8
9
  __name: "DropdownMenu",
9
10
  props: /*@__PURE__*/ l({
10
11
  items: {},
@@ -32,28 +33,28 @@ var b = /*@__PURE__*/ c({
32
33
  }),
33
34
  emits: ["update:open"],
34
35
  setup(c) {
35
- let l = c, b = m(c, "open"), x = e(), S = r(() => l.unstyled ?? x.unstyled), C = r(() => l.items ?? []), w = r(() => S.value ? l.ui?.header : t().header({ class: l.ui?.header })), T = r(() => S.value ? [l.ui?.content, l.class] : t().content({ class: [l.ui?.content, l.class] }));
36
- return (e, t) => (d(), i(p(v), {
37
- open: b.value,
38
- "onUpdate:open": t[0] ||= (e) => b.value = e
36
+ let l = c, x = h(c, "open"), S = e(), C = r(() => l.unstyled ?? S.unstyled), w = r(() => l.items ?? []), T = r(() => C.value ? l.ui?.header : t().header({ class: l.ui?.header })), E = r(() => C.value ? [l.ui?.content, l.class] : t().content({ class: [l.ui?.content, l.class] }));
37
+ return (e, t) => (f(), i(m(y), {
38
+ open: x.value,
39
+ "onUpdate:open": t[0] ||= (e) => x.value = e
39
40
  }, {
40
- default: h(() => [s(p(y), { "as-child": "" }, {
41
- default: h(() => [f(e.$slots, "trigger")]),
41
+ default: g(() => [s(m(b), u({ "as-child": "" }, e.$attrs), {
42
+ default: g(() => [p(e.$slots, "trigger")]),
42
43
  _: 3
43
- }), s(p(_), null, {
44
- default: h(() => [s(p(g), {
44
+ }, 16), s(m(v), null, {
45
+ default: g(() => [s(m(_), {
45
46
  align: l.align,
46
47
  "align-offset": l.alignOffset,
47
48
  side: l.side,
48
49
  "side-offset": l.sideOffset,
49
- class: u(T.value)
50
+ class: d(E.value)
50
51
  }, {
51
- default: h(() => [e.$slots.header ? (d(), o("div", {
52
+ default: g(() => [e.$slots.header ? (f(), o("div", {
52
53
  key: 0,
53
- class: u(w.value)
54
- }, [f(e.$slots, "header")], 2)) : a("", !0), f(e.$slots, "default", {}, () => [s(n, {
55
- entries: C.value,
56
- unstyled: S.value,
54
+ class: d(T.value)
55
+ }, [p(e.$slots, "header")], 2)) : a("", !0), p(e.$slots, "default", {}, () => [s(n, {
56
+ entries: w.value,
57
+ unstyled: C.value,
57
58
  ui: l.ui
58
59
  }, null, 8, [
59
60
  "entries",
@@ -75,4 +76,4 @@ var b = /*@__PURE__*/ c({
75
76
  }
76
77
  });
77
78
  //#endregion
78
- export { b as default };
79
+ export { x as default };
@@ -63,8 +63,16 @@ var E = /*@__PURE__*/ u({
63
63
  _: 2
64
64
  }, 1024)]),
65
65
  _: 2
66
- }, 1024)) : t.onSelect ? (f(), a(g(y), {
66
+ }, 1024)) : !t.onSelect && !t.href ? (f(), a(g(b), {
67
+ key: 2,
68
+ class: d(D("label"))
69
+ }, {
70
+ default: _(() => [c(h(t.label), 1)]),
71
+ _: 2
72
+ }, 1032, ["class"])) : (f(), a(g(y), {
67
73
  key: 3,
74
+ as: t.href ? "a" : void 0,
75
+ href: t.href,
68
76
  disabled: t.disabled,
69
77
  class: d(D("item", t.danger)),
70
78
  onSelect: t.onSelect
@@ -75,16 +83,12 @@ var E = /*@__PURE__*/ u({
75
83
  }, null, 8, ["icon"])) : o("", !0), c(" " + h(t.label), 1)]),
76
84
  _: 2
77
85
  }, 1032, [
86
+ "as",
87
+ "href",
78
88
  "disabled",
79
89
  "class",
80
90
  "onSelect"
81
- ])) : (f(), a(g(b), {
82
- key: 2,
83
- class: d(D("label"))
84
- }, {
85
- default: _(() => [c(h(t.label), 1)]),
86
- _: 2
87
- }, 1032, ["class"]))], 64))), 128);
91
+ ]))], 64))), 128);
88
92
  };
89
93
  }
90
94
  });
@@ -3,7 +3,7 @@ import type { SidebarItems, SidebarLink } from '../composables/sidebar';
3
3
  export interface SidebarProps {
4
4
  /** Links, optionally grouped into labelled sections. */
5
5
  items?: SidebarItems;
6
- /** Which edge it sits on. Only decides where the border goes. */
6
+ /** Which edge it sits on: where the border goes and which way tooltips and group menus open. */
7
7
  side?: 'left' | 'right';
8
8
  /**
9
9
  * Accessible name for the navigation landmark — override for non-English
@@ -23,6 +23,7 @@ export interface SidebarProps {
23
23
  sectionLabel?: string;
24
24
  link?: string;
25
25
  linkLabel?: string;
26
+ linkInitial?: string;
26
27
  linkBadge?: string;
27
28
  groupIcon?: string;
28
29
  groupContent?: string;
@@ -39,10 +40,13 @@ declare var __VLS_8: {
39
40
  collapsed: boolean;
40
41
  }, __VLS_10: {
41
42
  collapsed: boolean;
42
- }, __VLS_61: {
43
+ }, __VLS_26: {
44
+ link: SidebarLink;
45
+ collapsed: true;
46
+ }, __VLS_92: {
43
47
  link: SidebarLink;
44
48
  collapsed: boolean;
45
- }, __VLS_68: {
49
+ }, __VLS_99: {
46
50
  collapsed: boolean;
47
51
  };
48
52
  type __VLS_Slots = {} & {
@@ -50,9 +54,11 @@ type __VLS_Slots = {} & {
50
54
  } & {
51
55
  default?: (props: typeof __VLS_10) => any;
52
56
  } & {
53
- link?: (props: typeof __VLS_61) => any;
57
+ link?: (props: typeof __VLS_26) => any;
58
+ } & {
59
+ link?: (props: typeof __VLS_92) => any;
54
60
  } & {
55
- footer?: (props: typeof __VLS_68) => any;
61
+ footer?: (props: typeof __VLS_99) => any;
56
62
  };
57
63
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
58
64
  "update:collapsed": (value: boolean) => any;