@selectwin/kit 0.1.257 → 0.1.259

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 (67) hide show
  1. package/README.md +75 -0
  2. package/dist/SelectActionBar.d.ts +29 -0
  3. package/dist/SelectActionBar.js +101 -0
  4. package/dist/SelectActionList.d.ts +5 -0
  5. package/dist/SelectActionList.js +55 -39
  6. package/dist/SelectAppFrame.d.ts +8 -2
  7. package/dist/SelectAppFrame.js +124 -119
  8. package/dist/SelectAvatarGroup.d.ts +31 -0
  9. package/dist/SelectAvatarGroup.js +39 -0
  10. package/dist/SelectBadge.d.ts +10 -1
  11. package/dist/SelectBadge.js +26 -12
  12. package/dist/SelectBulkBar.d.ts +21 -0
  13. package/dist/SelectBulkBar.js +40 -0
  14. package/dist/SelectChannelPreview.d.ts +35 -5
  15. package/dist/SelectChannelPreview.js +127 -60
  16. package/dist/SelectColorField.d.ts +1 -5
  17. package/dist/SelectColorField.js +83 -101
  18. package/dist/SelectCombobox.d.ts +5 -0
  19. package/dist/SelectCombobox.js +52 -49
  20. package/dist/SelectDataTable.d.ts +17 -1
  21. package/dist/SelectDataTable.js +100 -90
  22. package/dist/SelectDeadlineBadge.d.ts +32 -0
  23. package/dist/SelectDeadlineBadge.js +73 -0
  24. package/dist/SelectFieldset.d.ts +14 -0
  25. package/dist/SelectFieldset.js +27 -0
  26. package/dist/SelectFilterBar.d.ts +6 -1
  27. package/dist/SelectFilterBar.js +155 -125
  28. package/dist/SelectImageUploadField.d.ts +5 -3
  29. package/dist/SelectImageUploadField.js +26 -26
  30. package/dist/SelectKanban.d.ts +13 -1
  31. package/dist/SelectKanban.js +72 -50
  32. package/dist/SelectListCard.d.ts +27 -1
  33. package/dist/SelectListCard.js +47 -22
  34. package/dist/SelectLocale.d.ts +96 -0
  35. package/dist/SelectLocale.js +733 -521
  36. package/dist/SelectMail.d.ts +9 -1
  37. package/dist/SelectMail.js +234 -207
  38. package/dist/SelectModal.d.ts +10 -4
  39. package/dist/SelectModal.js +158 -137
  40. package/dist/SelectSection.d.ts +4 -4
  41. package/dist/SelectSection.js +77 -8
  42. package/dist/SelectSegmented.d.ts +7 -0
  43. package/dist/SelectSegmented.js +51 -43
  44. package/dist/SelectSideNav.d.ts +2 -1
  45. package/dist/SelectSideNav.js +156 -135
  46. package/dist/SelectSortable.d.ts +47 -1
  47. package/dist/SelectSortable.js +138 -19
  48. package/dist/SelectSteps.d.ts +3 -0
  49. package/dist/SelectSteps.js +42 -31
  50. package/dist/SelectTable.d.ts +13 -1
  51. package/dist/SelectTable.js +88 -79
  52. package/dist/SelectTabs.d.ts +10 -0
  53. package/dist/SelectTabs.js +68 -30
  54. package/dist/SelectTimeline.d.ts +4 -0
  55. package/dist/SelectTimeline.js +20 -9
  56. package/dist/SelectWeekHours.d.ts +64 -0
  57. package/dist/SelectWeekHours.js +338 -0
  58. package/dist/index.d.ts +19 -2
  59. package/dist/index.js +191 -184
  60. package/dist/internal/color.d.ts +15 -0
  61. package/dist/internal/color.js +40 -0
  62. package/dist/internal/navCount.d.ts +21 -0
  63. package/dist/internal/navCount.js +27 -0
  64. package/dist/internal/safeHref.d.ts +7 -0
  65. package/dist/internal/safeHref.js +12 -1
  66. package/dist/style.css +1 -1
  67. package/package.json +1 -1
@@ -2,6 +2,8 @@ import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
2
  export interface SegmentedOption {
3
3
  value: string;
4
4
  label: ReactNode;
5
+ /** 0.1.258: o ícone antes do rótulo (fora da leitura: o rótulo diz a opção). */
6
+ icon?: ReactNode;
5
7
  /** Nome acessível quando o `label` é só um ícone — vira `aria-label` + `title`.
6
8
  * Sem ele um segmento icon-only não tem nome nenhum para leitor de tela. */
7
9
  title?: string;
@@ -29,6 +31,11 @@ type SelectSegmentedOwnProps = {
29
31
  semantics?: 'tabs' | 'radio';
30
32
  /** `sm` (0.1.209): o tier pequeno (28px) fora de um `.select-dense` — a linha de um menu, o cabeçalho de um cartão. */
31
33
  size?: 'md' | 'sm';
34
+ /**
35
+ * 0.1.258: `track` (o padrão) é a trilha com a pílula que desliza; `chips`, as fichas soltas com ícone e rótulo, que
36
+ * quebram a linha — e, sem `semantics`, a escolha única de um grupo de rádio.
37
+ */
38
+ variant?: 'track' | 'chips';
32
39
  };
33
40
  export type SelectSegmentedProps = SelectSegmentedOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSegmentedOwnProps>;
34
41
  export declare const SelectSegmented: import('react').ForwardRefExoticComponent<SelectSegmentedOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectSegmentedOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,95 +1,103 @@
1
1
  import { forwardRef as e, useId as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
2
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
3
  //#region src/SelectSegmented.tsx
4
- var s = e(function({ value: e, onChange: s, options: c, ariaLabel: l, fullWidth: u = !1, label: d, hint: f, disabled: p = !1, error: m, semantics: h = "tabs", size: g = "md", className: _, ...v }, y) {
5
- let b = t(), x = Math.max(0, c.findIndex((t) => t.value === e)), S = r([]), [C, w] = i(null), T = h === "radio", E = c.map((e) => e.count ?? "").join(",");
4
+ var s = e(function({ value: e, onChange: s, options: c, ariaLabel: l, fullWidth: u = !1, label: d, hint: f, disabled: p = !1, error: m, variant: h = "track", semantics: g = h === "chips" ? "radio" : "tabs", size: _ = "md", className: v, ...y }, b) {
5
+ let x = t(), S = Math.max(0, c.findIndex((t) => t.value === e)), C = r([]), [w, T] = i(null), E = g === "radio", D = c.map((e) => e.count ?? "").join(",");
6
6
  n(() => {
7
7
  let e = () => {
8
- let e = S.current[x];
8
+ let e = C.current[S];
9
9
  if (!e) return;
10
10
  let t = {
11
11
  left: e.offsetLeft,
12
12
  width: e.offsetWidth
13
13
  };
14
- w((e) => e && e.left === t.left && e.width === t.width ? e : t);
14
+ T((e) => e && e.left === t.left && e.width === t.width ? e : t);
15
15
  };
16
16
  e();
17
17
  let t = typeof ResizeObserver < "u" ? new ResizeObserver(e) : null;
18
- return S.current.forEach((e) => e && (t == null ? void 0 : t.observe(e))), () => t == null ? void 0 : t.disconnect();
18
+ return C.current.forEach((e) => e && (t == null ? void 0 : t.observe(e))), () => t == null ? void 0 : t.disconnect();
19
19
  }, [
20
- x,
20
+ S,
21
21
  c.length,
22
- E
22
+ D
23
23
  ]);
24
- let D = C ? {
25
- left: C.left,
26
- width: C.width,
24
+ let O = w ? {
25
+ left: w.left,
26
+ width: w.width,
27
27
  opacity: 1
28
- } : { opacity: 0 }, O = d == null ? v : {}, k = (t) => {
28
+ } : { opacity: 0 }, k = d == null ? y : {}, A = (t) => {
29
29
  var n, r;
30
- if ((n = O.onKeyDown) == null || n.call(O, t), t.defaultPrevented || p || !c.length) return;
31
- let i = S.current.findIndex((e) => e === t.target);
30
+ if ((n = k.onKeyDown) == null || n.call(k, t), t.defaultPrevented || p || !c.length) return;
31
+ let i = C.current.findIndex((e) => e === t.target);
32
32
  if (i < 0) return;
33
- let a = t.key === "ArrowRight" || T && t.key === "ArrowDown", o = t.key === "ArrowLeft" || T && t.key === "ArrowUp", l = a ? (i + 1) % c.length : o ? (i - 1 + c.length) % c.length : t.key === "Home" ? 0 : t.key === "End" ? c.length - 1 : -1;
34
- l < 0 || (t.preventDefault(), (r = S.current[l]) == null || r.focus(), c[l].value !== e && s(c[l].value));
35
- }, A = /* @__PURE__ */ o("div", {
36
- ref: d == null ? y : void 0,
37
- ...O,
38
- className: `select-segmented${u ? " select-segmented--full" : ""}${g === "sm" ? " select-segmented--sm" : ""}${p ? " select-segmented--disabled" : ""}${m != null && m !== !1 ? " select-segmented--error" : ""}${d == null && _ ? " " + _ : ""}`,
39
- role: T ? "radiogroup" : "tablist",
33
+ let a = t.key === "ArrowRight" || E && t.key === "ArrowDown", o = t.key === "ArrowLeft" || E && t.key === "ArrowUp", l = a ? (i + 1) % c.length : o ? (i - 1 + c.length) % c.length : t.key === "Home" ? 0 : t.key === "End" ? c.length - 1 : -1;
34
+ l < 0 || (t.preventDefault(), (r = C.current[l]) == null || r.focus(), c[l].value !== e && s(c[l].value));
35
+ }, j = /* @__PURE__ */ o("div", {
36
+ ref: d == null ? b : void 0,
37
+ ...k,
38
+ className: `select-segmented${h === "chips" ? " select-segmented--chips" : ""}${u ? " select-segmented--full" : ""}${_ === "sm" ? " select-segmented--sm" : ""}${p ? " select-segmented--disabled" : ""}${m != null && m !== !1 ? " select-segmented--error" : ""}${d == null && v ? " " + v : ""}`,
39
+ role: E ? "radiogroup" : "tablist",
40
40
  "aria-label": l,
41
- "aria-labelledby": d != null && !l ? b : void 0,
41
+ "aria-labelledby": d != null && !l ? x : void 0,
42
42
  "aria-disabled": p || void 0,
43
- onKeyDown: k,
44
- children: [/* @__PURE__ */ a("span", {
43
+ onKeyDown: A,
44
+ children: [h === "chips" ? null : /* @__PURE__ */ a("span", {
45
45
  className: "select-segmented__pill",
46
46
  "aria-hidden": "true",
47
- style: D
47
+ style: O
48
48
  }), c.map((t, n) => {
49
49
  let r = t.value === e, i = !!t.count && t.count > 0, c = t.title && i ? `${t.title}, ${t.countLabel ?? t.count}` : t.title;
50
50
  return /* @__PURE__ */ o("button", {
51
51
  ref: (e) => {
52
- S.current[n] = e;
52
+ C.current[n] = e;
53
53
  },
54
54
  type: "button",
55
- role: T ? "radio" : "tab",
56
- "aria-selected": T ? void 0 : r,
57
- "aria-checked": T ? r : void 0,
58
- tabIndex: n === x ? 0 : -1,
55
+ role: E ? "radio" : "tab",
56
+ "aria-selected": E ? void 0 : r,
57
+ "aria-checked": E ? r : void 0,
58
+ tabIndex: n === S ? 0 : -1,
59
59
  className: `select-segmented__item${r ? " select-segmented__item--active" : ""}`,
60
60
  title: t.title,
61
61
  "aria-label": c,
62
62
  disabled: p,
63
63
  onClick: () => s(t.value),
64
- children: [t.label, i ? /* @__PURE__ */ a("span", {
65
- className: "select-segmented__count",
66
- "aria-hidden": t.title ? !0 : void 0,
67
- children: t.count
68
- }) : null]
64
+ children: [
65
+ t.icon != null && t.icon !== !1 ? /* @__PURE__ */ a("span", {
66
+ className: "select-segmented__icon",
67
+ "aria-hidden": "true",
68
+ children: t.icon
69
+ }) : null,
70
+ t.label,
71
+ i ? /* @__PURE__ */ a("span", {
72
+ className: "select-segmented__count",
73
+ "aria-hidden": t.title ? !0 : void 0,
74
+ children: t.count
75
+ }) : null
76
+ ]
69
77
  }, t.value);
70
78
  })]
71
- }), j = m != null && m !== !1 && m !== "";
72
- return d == null && !j ? A : d == null ? /* @__PURE__ */ o("div", {
79
+ }), M = m != null && m !== !1 && m !== "";
80
+ return d == null && !M ? j : d == null ? /* @__PURE__ */ o("div", {
73
81
  className: "select-field",
74
- children: [A, /* @__PURE__ */ a("p", {
82
+ children: [j, /* @__PURE__ */ a("p", {
75
83
  className: "select-field__error",
76
84
  children: m
77
85
  })]
78
86
  }) : /* @__PURE__ */ o("div", {
79
- ref: y,
80
- ...v,
81
- className: `select-field${_ ? " " + _ : ""}`,
87
+ ref: b,
88
+ ...y,
89
+ className: `select-field${v ? " " + v : ""}`,
82
90
  children: [
83
91
  /* @__PURE__ */ a("div", {
84
92
  className: "select-field__labelrow",
85
93
  children: /* @__PURE__ */ a("span", {
86
94
  className: "select-field__label",
87
- id: b,
95
+ id: x,
88
96
  children: d
89
97
  })
90
98
  }),
91
- A,
92
- j ? /* @__PURE__ */ a("p", {
99
+ j,
100
+ M ? /* @__PURE__ */ a("p", {
93
101
  className: "select-field__error",
94
102
  children: m
95
103
  }) : f != null && /* @__PURE__ */ a("p", {
@@ -1,5 +1,6 @@
1
1
  import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
- export interface SideNavItem {
2
+ import { SelectNavCount } from './internal/navCount';
3
+ export interface SideNavItem extends SelectNavCount {
3
4
  id: string;
4
5
  label: ReactNode;
5
6
  icon?: ReactNode;
@@ -3,12 +3,13 @@ import { ChevronDownIcon as t } from "./icons.js";
3
3
  import { SelectTooltip as n } from "./SelectTooltip.js";
4
4
  import { useSelectMessages as r } from "./SelectLocale.js";
5
5
  import { SelectPopover as i } from "./SelectPopover.js";
6
- import { SelectMenu as a, SelectMenuHeading as o, SelectMenuItem as s } from "./SelectMenu.js";
7
- import { Fragment as c, forwardRef as l, useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { Link as g } from "react-router-dom";
6
+ import { NavCount as a, hasNavCount as o, useNavCountName as s } from "./internal/navCount.js";
7
+ import { SelectMenu as c, SelectMenuHeading as l, SelectMenuItem as u } from "./SelectMenu.js";
8
+ import { Fragment as d, forwardRef as f, useEffect as p, useLayoutEffect as m, useRef as h, useState as g } from "react";
9
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
10
+ import { Link as y } from "react-router-dom";
10
11
  //#region src/SelectSideNav.tsx
11
- function _({ item: t, className: n, active: r, onSelect: i, tabIndex: a, label: o, children: s }) {
12
+ function b({ item: t, className: n, active: r, onSelect: i, tabIndex: a, label: o, children: s }) {
12
13
  let c = t.to != null || t.href != null ? e(t.to ?? t.href) : void 0, l = {
13
14
  className: n,
14
15
  tabIndex: a,
@@ -16,224 +17,240 @@ function _({ item: t, className: n, active: r, onSelect: i, tabIndex: a, label:
16
17
  "aria-label": o,
17
18
  onClick: () => i(t.id)
18
19
  };
19
- return c !== void 0 && t.to != null ? /* @__PURE__ */ m(g, {
20
+ return c !== void 0 && t.to != null ? /* @__PURE__ */ _(y, {
20
21
  ...l,
21
22
  to: c,
22
23
  "aria-current": r ? "page" : void 0,
23
24
  children: s
24
- }) : c === void 0 ? /* @__PURE__ */ m("button", {
25
+ }) : c === void 0 ? /* @__PURE__ */ _("button", {
25
26
  type: "button",
26
27
  ...l,
27
28
  children: s
28
- }) : /* @__PURE__ */ m("a", {
29
+ }) : /* @__PURE__ */ _("a", {
29
30
  ...l,
30
31
  href: c,
31
32
  "aria-current": r ? "page" : void 0,
32
33
  children: s
33
34
  });
34
35
  }
35
- function v(e, t) {
36
+ function x(e, t) {
36
37
  var n;
37
- return ((n = e.children) == null ? void 0 : n.some((e) => e.id === t || v(e, t))) ?? !1;
38
+ return ((n = e.children) == null ? void 0 : n.some((e) => e.id === t || x(e, t))) ?? !1;
38
39
  }
39
- function y({ item: e, active: n, onSelect: r }) {
40
- let i = e.alwaysOpen === !0, a = v(e, n), [o, s] = p(a);
41
- u(() => {
42
- s(a);
43
- }, [a]);
44
- let c = i || o, l = f(null), [g, y] = p(null), [S, C] = p(0);
45
- return d(() => {
40
+ function S({ item: e, active: n, onSelect: r }) {
41
+ let i = e.alwaysOpen === !0, o = x(e, n), [s, c] = g(o);
42
+ p(() => {
43
+ c(o);
44
+ }, [o]);
45
+ let l = i || s, u = h(null), [d, f] = g(null), [y, S] = g(0);
46
+ return m(() => {
46
47
  var e;
47
- let t = l.current, n = (t == null ? void 0 : t.querySelector(".select-sidenav__item--child.is-active")) ?? null, r = n == null ? void 0 : n.closest(".select-sidenav__subgroup .select-sidenav__collapse[data-open=\"false\"]");
48
- n && r && (n = ((e = r.parentElement) == null ? void 0 : e.querySelector(":scope > .select-sidenav__item")) ?? null), y(n && c ? b(n, t) : null);
48
+ let t = u.current, n = (t == null ? void 0 : t.querySelector(".select-sidenav__item--child.is-active")) ?? null, r = n == null ? void 0 : n.closest(".select-sidenav__subgroup .select-sidenav__collapse[data-open=\"false\"]");
49
+ n && r && (n = ((e = r.parentElement) == null ? void 0 : e.querySelector(":scope > .select-sidenav__item")) ?? null), f(n && l ? C(n, t) : null);
49
50
  }, [
50
51
  n,
51
- c,
52
- S
53
- ]), u(() => {
54
- let e = l.current;
52
+ l,
53
+ y
54
+ ]), p(() => {
55
+ let e = u.current;
55
56
  if (!e || typeof ResizeObserver > "u") return;
56
- let t = new ResizeObserver(() => C((e) => e + 1));
57
+ let t = new ResizeObserver(() => S((e) => e + 1));
57
58
  return t.observe(e), () => t.disconnect();
58
- }, []), /* @__PURE__ */ h("div", {
59
+ }, []), /* @__PURE__ */ v("div", {
59
60
  className: "select-sidenav__group",
60
- children: [/* @__PURE__ */ h("button", {
61
+ children: [/* @__PURE__ */ v("button", {
61
62
  type: "button",
62
- className: i ? `select-sidenav__item${e.id === n ? " is-active" : ""}` : `select-sidenav__item select-sidenav__item--parent${o ? " is-open" : ""}`,
63
- onClick: () => i ? r(e.id) : s((e) => !e),
63
+ className: i ? `select-sidenav__item${e.id === n ? " is-active" : ""}` : `select-sidenav__item select-sidenav__item--parent${s ? " is-open" : ""}`,
64
+ onClick: () => i ? r(e.id) : c((e) => !e),
64
65
  "data-nav-id": e.id,
65
- "aria-expanded": i ? void 0 : o,
66
+ "aria-expanded": i ? void 0 : s,
66
67
  children: [
67
- e.icon && /* @__PURE__ */ m("span", {
68
+ e.icon && /* @__PURE__ */ _("span", {
68
69
  className: "select-sidenav__icon",
69
70
  children: e.icon
70
71
  }),
71
- /* @__PURE__ */ m("span", {
72
+ /* @__PURE__ */ _("span", {
72
73
  className: "select-sidenav__label",
73
74
  children: e.label
74
75
  }),
75
- !i && /* @__PURE__ */ m("span", {
76
+ /* @__PURE__ */ _(a, { item: e }),
77
+ !i && /* @__PURE__ */ _("span", {
76
78
  className: "select-sidenav__chevron",
77
79
  "aria-hidden": "true",
78
- children: /* @__PURE__ */ m(t, {})
80
+ children: /* @__PURE__ */ _(t, {})
79
81
  })
80
82
  ]
81
- }), /* @__PURE__ */ m("div", {
83
+ }), /* @__PURE__ */ _("div", {
82
84
  className: "select-sidenav__collapse",
83
- "data-open": c,
84
- "aria-hidden": !c,
85
- children: /* @__PURE__ */ h("div", {
85
+ "data-open": l,
86
+ "aria-hidden": !l,
87
+ children: /* @__PURE__ */ v("div", {
86
88
  className: "select-sidenav__children",
87
- ref: l,
89
+ ref: u,
88
90
  onTransitionEnd: (e) => {
89
- e.propertyName === "grid-template-rows" && C((e) => e + 1);
91
+ e.propertyName === "grid-template-rows" && S((e) => e + 1);
90
92
  },
91
- children: [/* @__PURE__ */ m("span", {
93
+ children: [/* @__PURE__ */ _("span", {
92
94
  className: "select-sidenav__rail-active",
93
95
  "aria-hidden": "true",
94
96
  style: {
95
- top: g ?? 0,
96
- opacity: g == null ? 0 : 1
97
+ top: d ?? 0,
98
+ opacity: d == null ? 0 : 1
97
99
  }
98
100
  }), e.children.map((e) => {
99
101
  var t;
100
- return (t = e.children) != null && t.length ? /* @__PURE__ */ m(x, {
102
+ return (t = e.children) != null && t.length ? /* @__PURE__ */ _(w, {
101
103
  item: e,
102
104
  active: n,
103
105
  onSelect: r,
104
- tabbable: c
105
- }, e.id) : /* @__PURE__ */ h(_, {
106
+ tabbable: l
107
+ }, e.id) : /* @__PURE__ */ v(b, {
106
108
  item: e,
107
109
  active: e.id === n,
108
110
  onSelect: r,
109
111
  className: `select-sidenav__item select-sidenav__item--child${e.id === n ? " is-active" : ""}`,
110
- tabIndex: c ? void 0 : -1,
111
- children: [e.icon && /* @__PURE__ */ m("span", {
112
- className: "select-sidenav__icon",
113
- children: e.icon
114
- }), /* @__PURE__ */ m("span", {
115
- className: "select-sidenav__label",
116
- children: e.label
117
- })]
112
+ tabIndex: l ? void 0 : -1,
113
+ children: [
114
+ e.icon && /* @__PURE__ */ _("span", {
115
+ className: "select-sidenav__icon",
116
+ children: e.icon
117
+ }),
118
+ /* @__PURE__ */ _("span", {
119
+ className: "select-sidenav__label",
120
+ children: e.label
121
+ }),
122
+ /* @__PURE__ */ _(a, { item: e })
123
+ ]
118
124
  }, e.id);
119
125
  })]
120
126
  })
121
127
  })]
122
128
  });
123
129
  }
124
- function b(e, t) {
130
+ function C(e, t) {
125
131
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
126
132
  return n.top - r.top + t.scrollTop + n.height / 2;
127
133
  }
128
- function x({ item: e, active: n, onSelect: r, tabbable: i }) {
129
- let a = v(e, n), [o, s] = p(a);
130
- return u(() => {
131
- a && s(!0);
132
- }, [a]), /* @__PURE__ */ h("div", {
134
+ function w({ item: e, active: n, onSelect: r, tabbable: i }) {
135
+ let o = x(e, n), [s, c] = g(o);
136
+ return p(() => {
137
+ o && c(!0);
138
+ }, [o]), /* @__PURE__ */ v("div", {
133
139
  className: "select-sidenav__subgroup",
134
- children: [/* @__PURE__ */ h("button", {
140
+ children: [/* @__PURE__ */ v("button", {
135
141
  type: "button",
136
- className: `select-sidenav__item select-sidenav__item--child select-sidenav__item--subparent${o ? " is-open" : ""}${a && !o ? " is-active" : ""}`,
137
- onClick: () => s((e) => !e),
138
- "aria-expanded": o,
142
+ className: `select-sidenav__item select-sidenav__item--child select-sidenav__item--subparent${s ? " is-open" : ""}${o && !s ? " is-active" : ""}`,
143
+ onClick: () => c((e) => !e),
144
+ "aria-expanded": s,
139
145
  tabIndex: i ? void 0 : -1,
140
146
  "data-nav-id": e.id,
141
147
  children: [
142
- e.icon && /* @__PURE__ */ m("span", {
148
+ e.icon && /* @__PURE__ */ _("span", {
143
149
  className: "select-sidenav__icon",
144
150
  children: e.icon
145
151
  }),
146
- /* @__PURE__ */ m("span", {
152
+ /* @__PURE__ */ _("span", {
147
153
  className: "select-sidenav__label",
148
154
  children: e.label
149
155
  }),
150
- /* @__PURE__ */ m("span", {
156
+ /* @__PURE__ */ _(a, { item: e }),
157
+ /* @__PURE__ */ _("span", {
151
158
  className: "select-sidenav__chevron",
152
159
  "aria-hidden": "true",
153
- children: /* @__PURE__ */ m(t, {})
160
+ children: /* @__PURE__ */ _(t, {})
154
161
  })
155
162
  ]
156
- }), /* @__PURE__ */ m("div", {
163
+ }), /* @__PURE__ */ _("div", {
157
164
  className: "select-sidenav__collapse",
158
- "data-open": o,
159
- "aria-hidden": !o,
160
- children: /* @__PURE__ */ m("div", {
165
+ "data-open": s,
166
+ "aria-hidden": !s,
167
+ children: /* @__PURE__ */ _("div", {
161
168
  className: "select-sidenav__subchildren",
162
- children: e.children.map((e) => /* @__PURE__ */ h(_, {
169
+ children: e.children.map((e) => /* @__PURE__ */ v(b, {
163
170
  item: e,
164
171
  active: e.id === n,
165
172
  onSelect: r,
166
173
  className: `select-sidenav__item select-sidenav__item--child select-sidenav__item--grandchild${e.id === n ? " is-active" : ""}`,
167
- tabIndex: i && o ? void 0 : -1,
168
- children: [e.icon && /* @__PURE__ */ m("span", {
169
- className: "select-sidenav__icon",
170
- children: e.icon
171
- }), /* @__PURE__ */ m("span", {
172
- className: "select-sidenav__label",
173
- children: e.label
174
- })]
174
+ tabIndex: i && s ? void 0 : -1,
175
+ children: [
176
+ e.icon && /* @__PURE__ */ _("span", {
177
+ className: "select-sidenav__icon",
178
+ children: e.icon
179
+ }),
180
+ /* @__PURE__ */ _("span", {
181
+ className: "select-sidenav__label",
182
+ children: e.label
183
+ }),
184
+ /* @__PURE__ */ _(a, { item: e })
185
+ ]
175
186
  }, e.id))
176
187
  })
177
188
  })]
178
189
  });
179
190
  }
180
- function S(e) {
191
+ function T(e) {
181
192
  return e.hint ?? (typeof e.label == "string" ? e.label : e.id);
182
193
  }
183
- function C({ item: e, active: t, onSelect: l }) {
184
- var u;
185
- let [d, f] = p(!1), g = r().sideNav.pending, _ = S(e), y = !!((u = e.children) != null && u.length), b = e.id === t || v(e, t), x = /* @__PURE__ */ h("button", {
194
+ function E({ item: e, active: t, onSelect: f }) {
195
+ var p;
196
+ let [m, h] = g(!1), y = r().sideNav.pending, b = s(), S = T(e), C = !!((p = e.children) != null && p.length), w = e.id === t || x(e, t), E = o(e), D = /* @__PURE__ */ v("button", {
186
197
  type: "button",
187
- className: `select-sidenav__railitem${b ? " is-active" : ""}${d ? " is-open" : ""}`,
188
- "aria-label": e.indicator ? g(_) : _,
189
- "aria-haspopup": y ? "menu" : void 0,
190
- "aria-expanded": y ? d : void 0,
191
- "aria-current": !y && e.id === t ? "page" : void 0,
198
+ className: `select-sidenav__railitem${w ? " is-active" : ""}${m ? " is-open" : ""}`,
199
+ "aria-label": b(e.indicator ? y(S) : S, e),
200
+ "aria-haspopup": C ? "menu" : void 0,
201
+ "aria-expanded": C ? m : void 0,
202
+ "aria-current": !C && e.id === t ? "page" : void 0,
192
203
  "data-nav-id": e.id,
193
- onClick: () => y ? f((e) => !e) : l(e.id),
194
- children: [e.icon ? /* @__PURE__ */ m("span", {
204
+ onClick: () => C ? h((e) => !e) : f(e.id),
205
+ children: [e.icon ? /* @__PURE__ */ _("span", {
195
206
  className: "select-sidenav__icon",
196
207
  children: e.icon
197
- }) : /* @__PURE__ */ m("span", {
208
+ }) : /* @__PURE__ */ _("span", {
198
209
  className: "select-sidenav__railinitial",
199
- children: _.charAt(0)
200
- }), e.indicator ? /* @__PURE__ */ m("span", {
210
+ children: S.charAt(0)
211
+ }), E ? /* @__PURE__ */ _(a, {
212
+ item: e,
213
+ corner: !0,
214
+ spoken: !1
215
+ }) : e.indicator ? /* @__PURE__ */ _("span", {
201
216
  className: "select-sidenav__raildot",
202
217
  "aria-hidden": "true"
203
218
  }) : null]
204
219
  });
205
- if (!y) return /* @__PURE__ */ m(n, {
206
- content: _,
220
+ if (!C) return /* @__PURE__ */ _(n, {
221
+ content: S,
207
222
  placement: "right",
208
- children: x
223
+ children: D
209
224
  });
210
- let C = (e) => {
211
- f(!1), l(e);
225
+ let O = (e) => {
226
+ h(!1), f(e);
212
227
  };
213
- return /* @__PURE__ */ m(i, {
214
- active: d,
215
- onClose: () => f(!1),
216
- activator: x,
228
+ return /* @__PURE__ */ _(i, {
229
+ active: m,
230
+ onClose: () => h(!1),
231
+ activator: D,
217
232
  placement: "right",
218
233
  role: "menu",
219
- children: /* @__PURE__ */ h(a, {
234
+ children: /* @__PURE__ */ v(c, {
220
235
  className: "select-sidenav__railmenu",
221
236
  children: [
222
- /* @__PURE__ */ m(o, { children: _ }),
223
- e.alwaysOpen ? /* @__PURE__ */ m(s, {
237
+ /* @__PURE__ */ _(l, { children: S }),
238
+ e.alwaysOpen ? /* @__PURE__ */ _(u, {
224
239
  active: e.id === t,
225
- onClick: () => C(e.id),
240
+ onClick: () => O(e.id),
226
241
  children: e.label
227
242
  }) : null,
228
243
  e.children.map((e) => {
229
244
  var n;
230
- return (n = e.children) != null && n.length ? /* @__PURE__ */ h(c, { children: [/* @__PURE__ */ m(o, { children: S(e) }), e.children.map((e) => /* @__PURE__ */ m(s, {
245
+ return (n = e.children) != null && n.length ? /* @__PURE__ */ v(d, { children: [/* @__PURE__ */ _(l, { children: T(e) }), e.children.map((e) => /* @__PURE__ */ _(u, {
231
246
  active: e.id === t,
232
- onClick: () => C(e.id),
247
+ onClick: () => O(e.id),
248
+ trailing: o(e) ? /* @__PURE__ */ _(a, { item: e }) : void 0,
233
249
  children: e.label
234
- }, e.id))] }, e.id) : /* @__PURE__ */ m(s, {
250
+ }, e.id))] }, e.id) : /* @__PURE__ */ _(u, {
235
251
  active: e.id === t,
236
- onClick: () => C(e.id),
252
+ onClick: () => O(e.id),
253
+ trailing: o(e) ? /* @__PURE__ */ _(a, { item: e }) : void 0,
237
254
  children: e.label
238
255
  }, e.id);
239
256
  })
@@ -241,54 +258,58 @@ function C({ item: e, active: t, onSelect: l }) {
241
258
  })
242
259
  });
243
260
  }
244
- var w = l(function({ sections: e, active: t, onSelect: n, header: r, collapsed: i = !1, className: a, ...o }, s) {
245
- return i ? /* @__PURE__ */ m("nav", {
246
- ref: s,
247
- ...o,
248
- className: `select-sidenav select-sidenav--rail${a ? " " + a : ""}`,
249
- children: e.map((e, r) => /* @__PURE__ */ m("div", {
261
+ var D = f(function({ sections: e, active: t, onSelect: n, header: r, collapsed: i = !1, className: o, ...s }, c) {
262
+ return i ? /* @__PURE__ */ _("nav", {
263
+ ref: c,
264
+ ...s,
265
+ className: `select-sidenav select-sidenav--rail${o ? " " + o : ""}`,
266
+ children: e.map((e, r) => /* @__PURE__ */ _("div", {
250
267
  className: "select-sidenav__section",
251
268
  role: "group",
252
269
  "aria-label": e.label,
253
- children: e.items.map((e) => /* @__PURE__ */ m(C, {
270
+ children: e.items.map((e) => /* @__PURE__ */ _(E, {
254
271
  item: e,
255
272
  active: t,
256
273
  onSelect: n
257
274
  }, e.id))
258
275
  }, r))
259
- }) : /* @__PURE__ */ h("nav", {
260
- ref: s,
261
- ...o,
262
- className: `select-sidenav${a ? " " + a : ""}`,
263
- children: [r && /* @__PURE__ */ m("div", {
276
+ }) : /* @__PURE__ */ v("nav", {
277
+ ref: c,
278
+ ...s,
279
+ className: `select-sidenav${o ? " " + o : ""}`,
280
+ children: [r && /* @__PURE__ */ _("div", {
264
281
  className: "select-sidenav__header",
265
282
  children: r
266
- }), e.map((e, r) => /* @__PURE__ */ h("div", {
283
+ }), e.map((e, r) => /* @__PURE__ */ v("div", {
267
284
  className: "select-sidenav__section",
268
- children: [e.label && /* @__PURE__ */ m("div", {
285
+ children: [e.label && /* @__PURE__ */ _("div", {
269
286
  className: "select-sidenav__sectionlabel",
270
287
  children: e.label
271
- }), e.items.map((e) => e.children ? /* @__PURE__ */ m(y, {
288
+ }), e.items.map((e) => e.children ? /* @__PURE__ */ _(S, {
272
289
  item: e,
273
290
  active: t,
274
291
  onSelect: n
275
- }, e.id) : /* @__PURE__ */ h(_, {
292
+ }, e.id) : /* @__PURE__ */ v(b, {
276
293
  item: e,
277
294
  active: e.id === t,
278
295
  onSelect: n,
279
296
  className: `select-sidenav__item${e.id === t ? " is-active" : ""}`,
280
- children: [e.icon && /* @__PURE__ */ m("span", {
281
- className: "select-sidenav__icon",
282
- children: e.icon
283
- }), /* @__PURE__ */ m("span", {
284
- className: "select-sidenav__label",
285
- children: e.label
286
- })]
297
+ children: [
298
+ e.icon && /* @__PURE__ */ _("span", {
299
+ className: "select-sidenav__icon",
300
+ children: e.icon
301
+ }),
302
+ /* @__PURE__ */ _("span", {
303
+ className: "select-sidenav__label",
304
+ children: e.label
305
+ }),
306
+ /* @__PURE__ */ _(a, { item: e })
307
+ ]
287
308
  }, e.id))]
288
309
  }, r))]
289
310
  });
290
311
  });
291
312
  //#endregion
292
- export { w as SelectSideNav };
313
+ export { D as SelectSideNav };
293
314
 
294
315
  //# sourceMappingURL=SelectSideNav.js.map