wimui 0.66.0 → 0.68.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 (83) hide show
  1. package/dist/components/_internal/ChoiceLabel.cjs +2 -0
  2. package/dist/components/_internal/ChoiceLabel.d.ts +31 -0
  3. package/dist/components/_internal/ChoiceLabel.js +22 -0
  4. package/dist/components/_internal/InlineDisclosure.cjs +2 -0
  5. package/dist/components/_internal/InlineDisclosure.d.ts +22 -0
  6. package/dist/components/_internal/InlineDisclosure.js +47 -0
  7. package/dist/components/_internal/choice-label.module.cjs +2 -0
  8. package/dist/components/_internal/choice-label.module.js +11 -0
  9. package/dist/components/_internal/inline-disclosure.module.cjs +2 -0
  10. package/dist/components/_internal/inline-disclosure.module.js +9 -0
  11. package/dist/components/_internal/rovingIndex.cjs +2 -0
  12. package/dist/components/_internal/rovingIndex.d.ts +38 -0
  13. package/dist/components/_internal/rovingIndex.js +16 -0
  14. package/dist/components/data-display/AvatarGroup/AvatarGroup.cjs +1 -1
  15. package/dist/components/data-display/AvatarGroup/AvatarGroup.d.ts +10 -3
  16. package/dist/components/data-display/AvatarGroup/AvatarGroup.js +55 -27
  17. package/dist/components/data-display/AvatarGroup/avatar-group.module.cjs +1 -1
  18. package/dist/components/data-display/AvatarGroup/avatar-group.module.js +8 -6
  19. package/dist/components/data-display/Card/Card.cjs +1 -1
  20. package/dist/components/data-display/Card/Card.d.ts +21 -0
  21. package/dist/components/data-display/Card/Card.js +7 -3
  22. package/dist/components/data-display/Card/card.module.cjs +1 -1
  23. package/dist/components/data-display/Card/card.module.js +17 -16
  24. package/dist/components/form/CheckboxGroup/CheckboxGroup.cjs +1 -1
  25. package/dist/components/form/CheckboxGroup/CheckboxGroup.d.ts +9 -0
  26. package/dist/components/form/CheckboxGroup/CheckboxGroup.js +42 -30
  27. package/dist/components/form/CheckboxGroup/checkbox-group.module.cjs +1 -1
  28. package/dist/components/form/CheckboxGroup/checkbox-group.module.js +4 -3
  29. package/dist/components/form/RadioGroup/RadioGroup.cjs +1 -1
  30. package/dist/components/form/RadioGroup/RadioGroup.d.ts +9 -0
  31. package/dist/components/form/RadioGroup/RadioGroup.js +46 -34
  32. package/dist/components/form/RadioGroup/radio-group.module.cjs +1 -1
  33. package/dist/components/form/RadioGroup/radio-group.module.js +4 -3
  34. package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
  35. package/dist/components/form/SegmentedControl/SegmentedControl.js +56 -68
  36. package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
  37. package/dist/components/form/ToggleGroup/ToggleGroup.js +80 -88
  38. package/dist/components/layout/OverflowList/OverflowList.cjs +2 -0
  39. package/dist/components/layout/OverflowList/OverflowList.d.ts +81 -0
  40. package/dist/components/layout/OverflowList/OverflowList.js +85 -0
  41. package/dist/components/layout/OverflowList/getVisibleCount.cjs +2 -0
  42. package/dist/components/layout/OverflowList/getVisibleCount.d.ts +30 -0
  43. package/dist/components/layout/OverflowList/getVisibleCount.js +26 -0
  44. package/dist/components/layout/OverflowList/overflow-list.module.cjs +2 -0
  45. package/dist/components/layout/OverflowList/overflow-list.module.js +10 -0
  46. package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
  47. package/dist/components/layout/Toolbar/Toolbar.js +52 -51
  48. package/dist/components/navigation/Breadcrumb/Breadcrumb.cjs +1 -1
  49. package/dist/components/navigation/Breadcrumb/Breadcrumb.d.ts +12 -0
  50. package/dist/components/navigation/Breadcrumb/Breadcrumb.js +88 -53
  51. package/dist/components/navigation/Stepper/Stepper.cjs +1 -1
  52. package/dist/components/navigation/Stepper/Stepper.js +51 -53
  53. package/dist/components/navigation/TabNavigation/TabNavigation.cjs +1 -1
  54. package/dist/components/navigation/TabNavigation/TabNavigation.js +47 -49
  55. package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
  56. package/dist/components/navigation/Tabs/Tabs.js +80 -73
  57. package/dist/data-display.cjs +1 -1
  58. package/dist/data-display.js +40 -40
  59. package/dist/i18n/generated/components.d.ts +1 -1
  60. package/dist/i18n/generated/data-display.cjs +1 -1
  61. package/dist/i18n/generated/data-display.d.ts +1 -1
  62. package/dist/i18n/generated/data-display.js +12 -3
  63. package/dist/i18n/generated/keys.d.ts +2 -1
  64. package/dist/i18n/generated/navigation.cjs +2 -0
  65. package/dist/i18n/generated/navigation.d.ts +3 -0
  66. package/dist/i18n/generated/navigation.js +12 -0
  67. package/dist/index.cjs +1 -1
  68. package/dist/index.js +175 -174
  69. package/dist/layout.cjs +1 -1
  70. package/dist/layout.d.ts +1 -0
  71. package/dist/layout.js +2 -1
  72. package/dist/llms-full.txt +45 -3
  73. package/dist/llms.txt +2 -1
  74. package/dist/locales/en/components.json +2 -1
  75. package/dist/locales/en/data-display.json +3 -0
  76. package/dist/locales/ja/components.json +2 -1
  77. package/dist/locales/ja/data-display.json +3 -0
  78. package/dist/locales/pt/components.json +2 -1
  79. package/dist/locales/pt/data-display.json +3 -0
  80. package/dist/styles.css +1 -1
  81. package/dist/wimui.umd.css +1 -1
  82. package/dist/wimui.umd.js +5 -5
  83. package/package.json +30 -30
@@ -2,121 +2,113 @@
2
2
  import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
3
3
  import { useMergedRef as n } from "../../../hooks/useMergedRef.js";
4
4
  import { Icon as r } from "../../media/Icon/Icon.js";
5
- import { FieldTemplate as i } from "../FieldTemplate/FieldTemplate.js";
6
- import { useIndicator as a } from "../../_internal/useIndicator.js";
7
- import o from "./toggle-group.module.js";
8
- import s, { forwardRef as c, useEffect as l, useRef as u, useState as d } from "react";
9
- import f from "classnames";
10
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { getRovingIndex as i, isRovingKey as a } from "../../_internal/rovingIndex.js";
6
+ import { FieldTemplate as o } from "../FieldTemplate/FieldTemplate.js";
7
+ import { useIndicator as s } from "../../_internal/useIndicator.js";
8
+ import c from "./toggle-group.module.js";
9
+ import l, { forwardRef as u, useEffect as d, useRef as f, useState as p } from "react";
10
+ import m from "classnames";
11
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
12
  //#region src/components/form/ToggleGroup/ToggleGroup.tsx
12
- var h = c(({ options: c, value: h, defaultValue: g, onChange: _, selectionMode: v = "single", size: y = "md", fullWidth: b = !1, className: x, "aria-label": S, "aria-labelledby": C, "aria-describedby": w, disabled: T = !1, label: E, error: D, required: O, layout: k = "vertical", id: A, asChild: j = !1, children: M }, N) => {
13
- let P = s.useId(), F = A || `wim-toggle-group-${P}`, I = `${F}-label`, L = `${F}-error`, R = h !== void 0, [z, B] = d(g ?? (v === "multiple" ? [] : "")), V = R ? h : z, { containerRef: H, sliderStyle: U, isReady: W } = a({
14
- activeSelector: `.${o.active}`,
15
- dependence: c.length
16
- }), G = u([]), K = c.findIndex((e) => !e.disabled), [q, J] = d(() => {
17
- if (v === "single") {
18
- let e = R ? h : g;
13
+ var _ = u(({ options: u, value: _, defaultValue: v, onChange: y, selectionMode: b = "single", size: x = "md", fullWidth: S = !1, className: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, disabled: D = !1, label: O, error: k, required: A, layout: j = "vertical", id: M, asChild: N = !1, children: P }, F) => {
14
+ let I = l.useId(), L = M || `wim-toggle-group-${I}`, R = `${L}-label`, z = `${L}-error`, B = _ !== void 0, [V, H] = p(v ?? (b === "multiple" ? [] : "")), U = B ? _ : V, { containerRef: W, sliderStyle: G, isReady: K } = s({
15
+ activeSelector: `.${c.active}`,
16
+ dependence: u.length
17
+ }), q = f([]), J = u.findIndex((e) => !e.disabled), [Y, X] = p(() => {
18
+ if (b === "single") {
19
+ let e = B ? _ : v;
19
20
  if (typeof e == "string") {
20
- let t = c.findIndex((t) => !t.disabled && t.value === e);
21
+ let t = u.findIndex((t) => !t.disabled && t.value === e);
21
22
  if (t >= 0) return t;
22
23
  }
23
24
  }
24
- return K >= 0 ? K : 0;
25
+ return J >= 0 ? J : 0;
25
26
  });
26
- l(() => {
27
- if (v === "single" && R && typeof h == "string") {
28
- let e = c.findIndex((e) => !e.disabled && e.value === h);
29
- e >= 0 && J(e);
27
+ d(() => {
28
+ if (b === "single" && B && typeof _ == "string") {
29
+ let e = u.findIndex((e) => !e.disabled && e.value === _);
30
+ e >= 0 && X(e);
30
31
  }
31
32
  }, [
32
- h,
33
- v,
34
- R,
35
- c
33
+ _,
34
+ b,
35
+ B,
36
+ u
36
37
  ]);
37
- let Y = (e) => {
38
+ let Z = (e) => {
38
39
  let t;
39
- if (v === "multiple") {
40
- let n = Array.isArray(V) ? V : [];
40
+ if (b === "multiple") {
41
+ let n = Array.isArray(U) ? U : [];
41
42
  t = n.includes(e) ? n.filter((t) => t !== e) : [...n, e];
42
- } else t = V === e ? "" : e;
43
- R || B(t), _?.(t);
44
- }, X = (e) => v === "multiple" ? (Array.isArray(V) ? V : []).includes(e) : V === e, Z = (e, t) => {
45
- for (let n = 1; n <= c.length; n++) {
46
- let r = (e + t * n + c.length) % c.length;
47
- if (!c[r].disabled) return r;
48
- }
49
- return e;
50
- }, Q = (e, t) => {
51
- let n = null;
52
- if (t.key === "ArrowRight" || t.key === "ArrowDown") t.preventDefault(), n = Z(e, 1);
53
- else if (t.key === "ArrowLeft" || t.key === "ArrowUp") t.preventDefault(), n = Z(e, -1);
54
- else if (t.key === "Home") t.preventDefault(), n = K >= 0 ? K : null;
55
- else if (t.key === "End") {
56
- t.preventDefault();
57
- for (let e = c.length - 1; e >= 0; e--) if (!c[e].disabled) {
58
- n = e;
59
- break;
60
- }
61
- }
62
- n !== null && n !== e && (J(n), G.current[n]?.focus(), v === "single" && Y(c[n].value));
63
- }, $ = v === "single" ? "radiogroup" : "toolbar", ee = `${F}-item-0`;
64
- return /* @__PURE__ */ p(i, {
65
- label: E,
66
- error: D,
67
- required: O,
68
- layout: k,
69
- labelId: I,
70
- htmlFor: ee,
71
- errorId: L,
72
- className: x,
73
- children: /* @__PURE__ */ m(j ? e : "div", {
74
- ref: n(H, N),
75
- id: F,
76
- className: f("wim-toggle-group", o.root, o[y], o[v], b && o.fullWidth, W && o.ready, D && o.danger),
77
- role: $,
78
- "aria-label": S,
79
- "aria-labelledby": E ? I : C,
43
+ } else t = U === e ? "" : e;
44
+ B || H(t), y?.(t);
45
+ }, Q = (e) => b === "multiple" ? (Array.isArray(U) ? U : []).includes(e) : U === e, $ = (e, t) => {
46
+ if (!a(t.key)) return;
47
+ t.preventDefault();
48
+ let n = i({
49
+ key: t.key,
50
+ current: e,
51
+ count: u.length,
52
+ isDisabled: (e) => !!u[e].disabled
53
+ });
54
+ n !== null && n !== e && (X(n), q.current[n]?.focus(), b === "single" && Z(u[n].value));
55
+ }, ee = b === "single" ? "radiogroup" : "toolbar", te = `${L}-item-0`;
56
+ return /* @__PURE__ */ h(o, {
57
+ label: O,
58
+ error: k,
59
+ required: A,
60
+ layout: j,
61
+ labelId: R,
62
+ htmlFor: te,
63
+ errorId: z,
64
+ className: C,
65
+ children: /* @__PURE__ */ g(N ? e : "div", {
66
+ ref: n(W, F),
67
+ id: L,
68
+ className: m("wim-toggle-group", c.root, c[x], c[b], S && c.fullWidth, K && c.ready, k && c.danger),
69
+ role: ee,
70
+ "aria-label": w,
71
+ "aria-labelledby": O ? R : T,
80
72
  "aria-orientation": "horizontal",
81
- "aria-invalid": D ? !0 : void 0,
82
- "aria-describedby": [w, D ? L : void 0].filter(Boolean).join(" ") || void 0,
73
+ "aria-invalid": k ? !0 : void 0,
74
+ "aria-describedby": [E, k ? z : void 0].filter(Boolean).join(" ") || void 0,
83
75
  children: [
84
- /* @__PURE__ */ p("div", {
85
- className: f(o.slider, o[v], W && o.ready),
86
- style: U,
76
+ /* @__PURE__ */ h("div", {
77
+ className: m(c.slider, c[b], K && c.ready),
78
+ style: G,
87
79
  "aria-hidden": "true"
88
80
  }),
89
- c.map((e, t) => {
90
- let n = `${F}-item-${t}`;
91
- return /* @__PURE__ */ m("button", {
81
+ u.map((e, t) => {
82
+ let n = `${L}-item-${t}`;
83
+ return /* @__PURE__ */ g("button", {
92
84
  id: n,
93
85
  ref: (e) => {
94
- G.current[t] = e;
86
+ q.current[t] = e;
95
87
  },
96
88
  type: "button",
97
- className: f(o.item, o[v], X(e.value) && o.active, !e.label && e.iconName && o.iconOnly),
89
+ className: m(c.item, c[b], Q(e.value) && c.active, !e.label && e.iconName && c.iconOnly),
98
90
  onClick: () => {
99
- J(t), Y(e.value);
91
+ X(t), Z(e.value);
100
92
  },
101
- onKeyDown: (e) => Q(t, e),
102
- disabled: T || e.disabled,
103
- role: v === "single" ? "radio" : "button",
104
- "aria-checked": v === "single" ? X(e.value) : void 0,
105
- "aria-pressed": v === "multiple" ? X(e.value) : void 0,
93
+ onKeyDown: (e) => $(t, e),
94
+ disabled: D || e.disabled,
95
+ role: b === "single" ? "radio" : "button",
96
+ "aria-checked": b === "single" ? Q(e.value) : void 0,
97
+ "aria-pressed": b === "multiple" ? Q(e.value) : void 0,
106
98
  "aria-label": e.label ? void 0 : e.value,
107
- tabIndex: !e.disabled && t === q ? 0 : -1,
108
- children: [e.iconName && /* @__PURE__ */ p(r, {
99
+ tabIndex: !e.disabled && t === Y ? 0 : -1,
100
+ children: [e.iconName && /* @__PURE__ */ h(r, {
109
101
  name: e.iconName,
110
- size: y,
111
- className: o.icon
112
- }), e.label && /* @__PURE__ */ p("span", { children: e.label })]
102
+ size: x,
103
+ className: c.icon
104
+ }), e.label && /* @__PURE__ */ h("span", { children: e.label })]
113
105
  }, e.value);
114
106
  }),
115
- /* @__PURE__ */ p(t, { children: M })
107
+ /* @__PURE__ */ h(t, { children: P })
116
108
  ]
117
109
  })
118
110
  });
119
111
  });
120
- h.displayName = "ToggleGroup";
112
+ _.displayName = "ToggleGroup";
121
113
  //#endregion
122
- export { h as ToggleGroup };
114
+ export { _ as ToggleGroup };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/style-utils.cjs"),r=require("../../../hooks/useMergedRef.cjs"),i=require("./getVisibleCount.cjs"),a=require("./overflow-list.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=o.default.forwardRef(({items:e,renderItem:l,renderOverflow:u,collapseFrom:d=`end`,minVisibleItems:f=0,alwaysRenderOverflow:p=!1,onOverflow:m,gap:h=`sm`,listElement:g,asChild:_=!1,className:v,style:y,children:b,...x},S)=>{let C=(0,o.useRef)(null),w=(0,o.useRef)(null),T=r.useMergedRef(S,C),[E,D]=(0,o.useState)(e.length),O=(0,o.useCallback)(()=>{let t=C.current,n=w.current;if(!t||!n)return;let r=getComputedStyle(t),a=t.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0),o=parseFloat(getComputedStyle(n).columnGap)||0,s=e=>{let t=getComputedStyle(e);return e.getBoundingClientRect().width+(parseFloat(t.marginLeft)||0)+(parseFloat(t.marginRight)||0)},c=Array.from(n.children),l=c.slice(0,e.length).map(s),u=c[e.length]?s(c[e.length]):0,m=i.pinnedCount(d,l.length),h=l.slice(0,m).reduce((e,t)=>e+t+o,0),g=l.slice(m),_=m+i.getVisibleCount({itemWidths:d===`end`?g:[...g].reverse(),overflowWidth:u,available:a-h,gap:o,minVisibleItems:Math.max(f-m,0),alwaysRenderOverflow:p});D(e=>e===_?e:_)},[e.length,d,f,p]);(0,o.useLayoutEffect)(O),(0,o.useEffect)(()=>{let e=C.current,t=w.current;if(!e||!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>O());return n.observe(e),n.observe(t),()=>n.disconnect()},[O]);let{visible:k,hidden:A,overflowAt:j}=i.splitItems(d,e.length,E),M=A.length,N=A.map(t=>e[t]),P=M>0||p,F=(0,o.useRef)(m);(0,o.useLayoutEffect)(()=>{F.current=m});let I=(0,o.useRef)(null);(0,o.useEffect)(()=>{let t=I.current;t&&t.items===e&&t.count===M&&t.from===d||(I.current={items:e,count:M,from:d},(t||M!==0)&&F.current?.(i.splitItems(d,e.length,e.length-M).hidden.map(t=>e[t])))},[e,M,d]);let L=P?(0,c.jsx)(o.default.Fragment,{children:u(N)},`overflow`):null,R=g??`div`,z=k.map(t=>(0,c.jsx)(o.default.Fragment,{children:l(e[t],t)},t)),B=k.filter(e=>e<j).length;z.splice(B,0,L);let V=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(R,{className:a.default.row,children:z}),(0,c.jsx)(`div`,{className:a.default.measure,"aria-hidden":`true`,inert:!0,children:(0,c.jsxs)(R,{ref:w,className:a.default.measureRow,children:[e.map((e,t)=>(0,c.jsx)(o.default.Fragment,{children:l(e,t)},t)),u(e)]})})]});return(0,c.jsxs)(_?t.Root:`div`,{ref:T,className:(0,s.default)(`wim-overflow-list`,a.default.root,v),"data-collapse-from":d,"data-hidden-count":M,...x,style:{...y,"--wim-overflow-list-gap":n.getSpacingValue(h)},children:[V,_?(0,c.jsx)(t.Slottable,{children:b}):null]})});l.displayName=`OverflowList`,exports.OverflowList=l;
@@ -0,0 +1,81 @@
1
+ import { default as React } from 'react';
2
+ import { WimSpacing } from '../../../types/tokens';
3
+ import { CollapseFrom } from './getVisibleCount';
4
+ export type OverflowListProps<T> = Omit<React.ComponentPropsWithoutRef<"div">, "children"> & {
5
+ /**
6
+ * Items to lay out in a single row, in reading order.
7
+ */
8
+ items: T[];
9
+ /**
10
+ * Renders one item. Return a single element: each top-level element is measured as one item.
11
+ */
12
+ renderItem: (item: T, index: number) => React.ReactNode;
13
+ /**
14
+ * Renders the overflow indicator from the items that did not fit (for example a "+N" button
15
+ * that opens a Popover listing them). Return a single element. Not rendered while every item
16
+ * fits, unless `alwaysRenderOverflow` is set. The hidden items are not in the DOM, so the
17
+ * indicator is how users — including keyboard and screen reader users — reach them.
18
+ */
19
+ renderOverflow: (hiddenItems: T[]) => React.ReactNode;
20
+ /**
21
+ * The side items are collapsed from. `"end"` keeps the first items (tags, toolbars);
22
+ * `"start"` keeps the last ones (a path keeps the current folder); `"middle"` keeps the first
23
+ * item and collapses from the second one, with the indicator right after the first item
24
+ * (a breadcrumb keeps its root and the current page).
25
+ * @default "end"
26
+ */
27
+ collapseFrom?: CollapseFrom;
28
+ /**
29
+ * Renders the row as a list. `renderItem` and `renderOverflow` must then return `<li>`
30
+ * elements. Without it, the row is a `div`, which a list may not contain.
31
+ */
32
+ listElement?: "ul" | "ol";
33
+ /**
34
+ * Items that stay visible however narrow the row gets. They may then overflow the row.
35
+ * @default 0
36
+ */
37
+ minVisibleItems?: number;
38
+ /**
39
+ * Renders the overflow indicator even when every item fits (it receives an empty array).
40
+ * @default false
41
+ */
42
+ alwaysRenderOverflow?: boolean;
43
+ /**
44
+ * Called with the hidden items whenever the set of hidden items changes.
45
+ */
46
+ onOverflow?: (hiddenItems: T[]) => void;
47
+ /**
48
+ * Gap between items: a spacing token name (`"sm"`, `"md"`, …).
49
+ * @default "sm"
50
+ */
51
+ gap?: WimSpacing;
52
+ /**
53
+ * If true, the list will be rendered as its child, merging its props onto that child.
54
+ */
55
+ asChild?: boolean;
56
+ /**
57
+ * The element that becomes the root (in place of `div`) when `asChild` is set. The items are
58
+ * rendered inside it. Ignored without `asChild`.
59
+ */
60
+ children?: React.ReactNode;
61
+ };
62
+ /**
63
+ * Lays out items in a single row and collapses the ones that do not fit into an overflow
64
+ * indicator ("+N"), recomputed whenever the row or an item changes width. It measures and
65
+ * collapses; what the indicator shows (a count, a Popover, a Menu) is up to `renderOverflow`.
66
+ *
67
+ * The list fills its container. Its own minimum width is 0 and its preferred width is every item
68
+ * in one row, whatever is folded at the moment, so it also folds inside a table cell or an
69
+ * inline-block and grows back when there is room.
70
+ *
71
+ * Composition Contract:
72
+ * - Managed by: App consumption
73
+ * - Scroll lock: No
74
+ * - Does not own the hidden items' disclosure — compose Popover / Menu in `renderOverflow`
75
+ * - Renders each item twice: once visible, once in an invisible, inert measuring layer
76
+ */
77
+ export declare const OverflowList: (<T>(props: OverflowListProps<T> & {
78
+ ref?: React.ForwardedRef<HTMLDivElement>;
79
+ }) => React.ReactElement) & {
80
+ displayName?: string;
81
+ };
@@ -0,0 +1,85 @@
1
+ "use client";
2
+ import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
3
+ import { getSpacingValue as n } from "../../../utilities/style-utils.js";
4
+ import { useMergedRef as r } from "../../../hooks/useMergedRef.js";
5
+ import { getVisibleCount as i, pinnedCount as a, splitItems as o } from "./getVisibleCount.js";
6
+ import s from "./overflow-list.module.js";
7
+ import c, { useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
8
+ import m from "classnames";
9
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
10
+ var v = c.forwardRef(({ items: v, renderItem: y, renderOverflow: b, collapseFrom: x = "end", minVisibleItems: S = 0, alwaysRenderOverflow: C = !1, onOverflow: w, gap: T = "sm", listElement: E, asChild: D = !1, className: O, style: k, children: A, ...j }, M) => {
11
+ let N = f(null), P = f(null), F = r(M, N), [I, L] = p(v.length), R = l(() => {
12
+ let e = N.current, t = P.current;
13
+ if (!e || !t) return;
14
+ let n = getComputedStyle(e), r = e.clientWidth - (parseFloat(n.paddingLeft) || 0) - (parseFloat(n.paddingRight) || 0), o = parseFloat(getComputedStyle(t).columnGap) || 0, s = (e) => {
15
+ let t = getComputedStyle(e);
16
+ return e.getBoundingClientRect().width + (parseFloat(t.marginLeft) || 0) + (parseFloat(t.marginRight) || 0);
17
+ }, c = Array.from(t.children), l = c.slice(0, v.length).map(s), u = c[v.length] ? s(c[v.length]) : 0, d = a(x, l.length), f = l.slice(0, d).reduce((e, t) => e + t + o, 0), p = l.slice(d), m = d + i({
18
+ itemWidths: x === "end" ? p : [...p].reverse(),
19
+ overflowWidth: u,
20
+ available: r - f,
21
+ gap: o,
22
+ minVisibleItems: Math.max(S - d, 0),
23
+ alwaysRenderOverflow: C
24
+ });
25
+ L((e) => e === m ? e : m);
26
+ }, [
27
+ v.length,
28
+ x,
29
+ S,
30
+ C
31
+ ]);
32
+ d(R), u(() => {
33
+ let e = N.current, t = P.current;
34
+ if (!e || !t || typeof ResizeObserver > "u") return;
35
+ let n = new ResizeObserver(() => R());
36
+ return n.observe(e), n.observe(t), () => n.disconnect();
37
+ }, [R]);
38
+ let { visible: z, hidden: B, overflowAt: V } = o(x, v.length, I), H = B.length, U = B.map((e) => v[e]), W = H > 0 || C, G = f(w);
39
+ d(() => {
40
+ G.current = w;
41
+ });
42
+ let K = f(null);
43
+ u(() => {
44
+ let e = K.current;
45
+ e && e.items === v && e.count === H && e.from === x || (K.current = {
46
+ items: v,
47
+ count: H,
48
+ from: x
49
+ }, (e || H !== 0) && G.current?.(o(x, v.length, v.length - H).hidden.map((e) => v[e])));
50
+ }, [
51
+ v,
52
+ H,
53
+ x
54
+ ]);
55
+ let q = W ? /* @__PURE__ */ g(c.Fragment, { children: b(U) }, "overflow") : null, J = E ?? "div", Y = z.map((e) => /* @__PURE__ */ g(c.Fragment, { children: y(v[e], e) }, e)), X = z.filter((e) => e < V).length;
56
+ Y.splice(X, 0, q);
57
+ let Z = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(J, {
58
+ className: s.row,
59
+ children: Y
60
+ }), /* @__PURE__ */ g("div", {
61
+ className: s.measure,
62
+ "aria-hidden": "true",
63
+ inert: !0,
64
+ children: /* @__PURE__ */ _(J, {
65
+ ref: P,
66
+ className: s.measureRow,
67
+ children: [v.map((e, t) => /* @__PURE__ */ g(c.Fragment, { children: y(e, t) }, t)), b(v)]
68
+ })
69
+ })] });
70
+ return /* @__PURE__ */ _(D ? e : "div", {
71
+ ref: F,
72
+ className: m("wim-overflow-list", s.root, O),
73
+ "data-collapse-from": x,
74
+ "data-hidden-count": H,
75
+ ...j,
76
+ style: {
77
+ ...k,
78
+ "--wim-overflow-list-gap": n(T)
79
+ },
80
+ children: [Z, D ? /* @__PURE__ */ g(t, { children: A }) : null]
81
+ });
82
+ });
83
+ v.displayName = "OverflowList";
84
+ //#endregion
85
+ export { v as OverflowList };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var e=.5,t=(e,t)=>e===`middle`?Math.min(1,t):0,n=(e,n,r)=>{let i=t(e,n),a=Math.min(Math.max(r,i),n),o=n-a,s=(e,t)=>Array.from({length:Math.max(t-e,0)},(t,n)=>e+n);return e===`end`?{visible:s(0,a),hidden:s(a,n),overflowAt:a}:{visible:[...s(0,i),...s(i+o,n)],hidden:s(i,i+o),overflowAt:i}},r=({itemWidths:t,overflowWidth:n,available:r,gap:i,minVisibleItems:a,alwaysRenderOverflow:o})=>{let s=t.length,c=Math.min(Math.max(a,0),s);if(!o&&(e=>e.reduce((e,t,n)=>e+t+(n>0?i:0),0))(t)<=r+e)return s;let l=n,u=0;for(let n of t){let t=l+i+n;if(t>r+e)break;l=t,u+=1}return Math.max(u,c)};exports.getVisibleCount=r,exports.pinnedCount=t,exports.splitItems=n;
@@ -0,0 +1,30 @@
1
+ type VisibleCountInput = {
2
+ /** 各項目の幅。残す側の端から並べる(`collapseFrom="end"` なら先頭から) */
3
+ itemWidths: number[];
4
+ /** 「+N」の幅 */
5
+ overflowWidth: number;
6
+ /** 並びに使える幅 */
7
+ available: number;
8
+ gap: number;
9
+ minVisibleItems: number;
10
+ alwaysRenderOverflow: boolean;
11
+ };
12
+ export type CollapseFrom = "start" | "end" | "middle";
13
+ /** `"middle"` のとき、畳まずに残す先頭の項目の数 */
14
+ export declare const pinnedCount: (collapseFrom: CollapseFrom, total: number) => number;
15
+ /**
16
+ * 見えている項目の数(`shown`)から、並べる順(項目の添字と「+N」の位置)と、畳んだ項目の添字を出す。
17
+ * - `"end"`: 先頭から見せ、「+N」は末尾
18
+ * - `"start"`: 末尾から見せ、「+N」は先頭
19
+ * - `"middle"`: 先頭の 1 つを残し、2 つ目から畳む。「+N」は先頭のすぐ後ろ
20
+ */
21
+ export declare const splitItems: (collapseFrom: CollapseFrom, total: number, shown: number) => {
22
+ visible: number[];
23
+ hidden: number[];
24
+ overflowAt: number;
25
+ };
26
+ /**
27
+ * 収まる項目の数。バレルには載せない(OverflowList の中だけで使う計算)。
28
+ */
29
+ export declare const getVisibleCount: ({ itemWidths, overflowWidth, available, gap, minVisibleItems, alwaysRenderOverflow, }: VisibleCountInput) => number;
30
+ export {};
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ //#region src/components/layout/OverflowList/getVisibleCount.ts
3
+ var e = .5, t = (e, t) => e === "middle" ? Math.min(1, t) : 0, n = (e, n, r) => {
4
+ let i = t(e, n), a = Math.min(Math.max(r, i), n), o = n - a, s = (e, t) => Array.from({ length: Math.max(t - e, 0) }, (t, n) => e + n);
5
+ return e === "end" ? {
6
+ visible: s(0, a),
7
+ hidden: s(a, n),
8
+ overflowAt: a
9
+ } : {
10
+ visible: [...s(0, i), ...s(i + o, n)],
11
+ hidden: s(i, i + o),
12
+ overflowAt: i
13
+ };
14
+ }, r = ({ itemWidths: t, overflowWidth: n, available: r, gap: i, minVisibleItems: a, alwaysRenderOverflow: o }) => {
15
+ let s = t.length, c = Math.min(Math.max(a, 0), s);
16
+ if (!o && ((e) => e.reduce((e, t, n) => e + t + (n > 0 ? i : 0), 0))(t) <= r + e) return s;
17
+ let l = n, u = 0;
18
+ for (let n of t) {
19
+ let t = l + i + n;
20
+ if (t > r + e) break;
21
+ l = t, u += 1;
22
+ }
23
+ return Math.max(u, c);
24
+ };
25
+ //#endregion
26
+ export { r as getVisibleCount, t as pinnedCount, n as splitItems };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var e=`_root_sh3ee_2`,t=`_row_sh3ee_10`,n=`_measureRow_sh3ee_11`,r=`_measure_sh3ee_11`,i={root:e,row:t,measureRow:n,measure:r};exports.default=i,exports.measure=r,exports.measureRow=n,exports.root=e,exports.row=t;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ //#region src/components/layout/OverflowList/overflow-list.module.scss
3
+ var e = "_root_sh3ee_2", t = "_row_sh3ee_10", n = "_measureRow_sh3ee_11", r = "_measure_sh3ee_11", i = {
4
+ root: e,
5
+ row: t,
6
+ measureRow: n,
7
+ measure: r
8
+ };
9
+ //#endregion
10
+ export { i as default, r as measure, n as measureRow, e as root, t as row };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("./toolbar.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]`,c=`data-wim-toolbar-roving`,l=/^(button|checkbox|radio|submit|reset|image|file|color)$/,u=e=>e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.isContentEditable||e.tagName===`INPUT`&&!l.test(e.type),d=e=>Array.from(e.querySelectorAll(s)).filter(e=>!u(e)&&!e.closest(`[aria-hidden="true"]`)&&(e.getAttribute(`tabindex`)!==`-1`||e.hasAttribute(c))),f=i.default.forwardRef(({asChild:e=!1,size:s=`md`,orientation:l=`horizontal`,className:u,children:f,onKeyDownCapture:p,onFocus:m,...h},g)=>{let _=(0,i.useRef)(null),v=n.useMergedRef(g,_),y=(0,i.useRef)(null),b=(0,i.useRef)(null),x=(0,i.useCallback)(()=>{let e=_.current;if(!e)return;let t=d(e),n=document.activeElement,r=n&&t.includes(n)?n:y.current&&t.includes(y.current)?y.current:t[0];y.current=r??null;for(let e of t)e===r?e.hasAttribute(c)&&(e.removeAttribute(c),e.setAttribute(`tabindex`,`0`)):e.getAttribute(`tabindex`)!==`-1`&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(c,``));b.current?.takeRecords()},[]);return(0,i.useLayoutEffect)(x),(0,i.useEffect)(()=>{let e=_.current;if(!e)return;let t=new MutationObserver(()=>x());return t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`disabled`,`tabindex`,`aria-hidden`]}),b.current=t,()=>{t.disconnect(),b.current=null}},[x]),(0,o.jsx)(e?t.Root:`div`,{ref:v,role:`toolbar`,"aria-orientation":l,"data-size":s,"data-orientation":l,className:(0,a.default)(`wim-toolbar`,r.default.root,r.default[`size-${s}`],r.default[l],u),onKeyDownCapture:e=>{if(p?.(e),e.defaultPrevented)return;let t=_.current;if(!t)return;let n=d(t);if(n.length===0)return;let r=n.indexOf(document.activeElement);if(r<0)return;let i=l===`horizontal`,a=i?`ArrowRight`:`ArrowDown`,o=i?`ArrowLeft`:`ArrowUp`,s=r;if(e.key===a)e.preventDefault(),s=(r+1)%n.length;else if(e.key===o)e.preventDefault(),s=(r-1+n.length)%n.length;else if(e.key===`Home`)e.preventDefault(),s=0;else if(e.key===`End`)e.preventDefault(),s=n.length-1;else return;e.stopPropagation(),n[s]?.focus()},onFocus:e=>{m?.(e);let t=_.current,n=e.target;t&&n!==y.current&&d(t).includes(n)&&(y.current=n,x())},...h,children:f})});f.displayName=`Toolbar`;var p=i.default.forwardRef(({asChild:e=!1,className:n,children:i,...s},c)=>(0,o.jsx)(e?t.Root:`div`,{ref:c,role:`group`,className:(0,a.default)(r.default.group,n),...s,children:i}));p.displayName=`Toolbar.Group`;var m=i.default.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,role:`separator`,"aria-hidden":`true`,className:(0,a.default)(r.default.separator,e),...t}));m.displayName=`Toolbar.Separator`;var h=f;h.Group=p,h.Separator=m,exports.Toolbar=h,exports.default=h,exports.ToolbarGroup=p,exports.ToolbarSeparator=m;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../_internal/rovingIndex.cjs"),i=require("./toolbar.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]`,l=`data-wim-toolbar-roving`,u=/^(button|checkbox|radio|submit|reset|image|file|color)$/,d=e=>e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.isContentEditable||e.tagName===`INPUT`&&!u.test(e.type),f=e=>Array.from(e.querySelectorAll(c)).filter(e=>!d(e)&&!e.closest(`[aria-hidden="true"]`)&&(e.getAttribute(`tabindex`)!==`-1`||e.hasAttribute(l))),p=a.default.forwardRef(({asChild:e=!1,size:c=`md`,orientation:u=`horizontal`,className:d,children:p,onKeyDownCapture:m,onFocus:h,...g},_)=>{let v=(0,a.useRef)(null),y=n.useMergedRef(_,v),b=(0,a.useRef)(null),x=(0,a.useRef)(null),S=(0,a.useCallback)(()=>{let e=v.current;if(!e)return;let t=f(e),n=document.activeElement,r=n&&t.includes(n)?n:b.current&&t.includes(b.current)?b.current:t[0];b.current=r??null;for(let e of t)e===r?e.hasAttribute(l)&&(e.removeAttribute(l),e.setAttribute(`tabindex`,`0`)):e.getAttribute(`tabindex`)!==`-1`&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(l,``));x.current?.takeRecords()},[]);return(0,a.useLayoutEffect)(S),(0,a.useEffect)(()=>{let e=v.current;if(!e)return;let t=new MutationObserver(()=>S());return t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`disabled`,`tabindex`,`aria-hidden`]}),x.current=t,()=>{t.disconnect(),x.current=null}},[S]),(0,s.jsx)(e?t.Root:`div`,{ref:y,role:`toolbar`,"aria-orientation":u,"data-size":c,"data-orientation":u,className:(0,o.default)(`wim-toolbar`,i.default.root,i.default[`size-${c}`],i.default[u],d),onKeyDownCapture:e=>{if(m?.(e),e.defaultPrevented)return;let t=v.current;if(!t)return;let n=f(t);if(n.length===0)return;let i=n.indexOf(document.activeElement);if(i<0)return;let a=r.getRovingIndex({key:e.key,current:i,count:n.length,orientation:u});a!==null&&(e.preventDefault(),e.stopPropagation(),n[a]?.focus())},onFocus:e=>{h?.(e);let t=v.current,n=e.target;t&&n!==b.current&&f(t).includes(n)&&(b.current=n,S())},...g,children:p})});p.displayName=`Toolbar`;var m=a.default.forwardRef(({asChild:e=!1,className:n,children:r,...a},c)=>(0,s.jsx)(e?t.Root:`div`,{ref:c,role:`group`,className:(0,o.default)(i.default.group,n),...a,children:r}));m.displayName=`Toolbar.Group`;var h=a.default.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`div`,{ref:n,role:`separator`,"aria-hidden":`true`,className:(0,o.default)(i.default.separator,e),...t}));h.displayName=`Toolbar.Separator`;var g=p;g.Group=m,g.Separator=h,exports.Toolbar=g,exports.default=g,exports.ToolbarGroup=m,exports.ToolbarSeparator=h;
@@ -1,24 +1,25 @@
1
1
  "use client";
2
2
  import { Root as e } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
3
3
  import { useMergedRef as t } from "../../../hooks/useMergedRef.js";
4
- import n from "./toolbar.module.js";
5
- import r, { useCallback as i, useEffect as a, useLayoutEffect as o, useRef as s } from "react";
6
- import c from "classnames";
7
- import { jsx as l } from "react/jsx-runtime";
4
+ import { getRovingIndex as n } from "../../_internal/rovingIndex.js";
5
+ import r from "./toolbar.module.js";
6
+ import i, { useCallback as a, useEffect as o, useLayoutEffect as s, useRef as c } from "react";
7
+ import l from "classnames";
8
+ import { jsx as u } from "react/jsx-runtime";
8
9
  //#region src/components/layout/Toolbar/Toolbar.tsx
9
- var u = "button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]", d = "data-wim-toolbar-roving", f = /^(button|checkbox|radio|submit|reset|image|file|color)$/, p = (e) => e.tagName === "TEXTAREA" || e.tagName === "SELECT" || e.isContentEditable || e.tagName === "INPUT" && !f.test(e.type), m = (e) => Array.from(e.querySelectorAll(u)).filter((e) => !p(e) && !e.closest("[aria-hidden=\"true\"]") && (e.getAttribute("tabindex") !== "-1" || e.hasAttribute(d))), h = r.forwardRef(({ asChild: r = !1, size: u = "md", orientation: f = "horizontal", className: p, children: h, onKeyDownCapture: g, onFocus: _, ...v }, y) => {
10
- let b = s(null), x = t(y, b), S = s(null), C = s(null), w = i(() => {
11
- let e = b.current;
10
+ var d = "button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]", f = "data-wim-toolbar-roving", p = /^(button|checkbox|radio|submit|reset|image|file|color)$/, m = (e) => e.tagName === "TEXTAREA" || e.tagName === "SELECT" || e.isContentEditable || e.tagName === "INPUT" && !p.test(e.type), h = (e) => Array.from(e.querySelectorAll(d)).filter((e) => !m(e) && !e.closest("[aria-hidden=\"true\"]") && (e.getAttribute("tabindex") !== "-1" || e.hasAttribute(f))), g = i.forwardRef(({ asChild: i = !1, size: d = "md", orientation: p = "horizontal", className: m, children: g, onKeyDownCapture: _, onFocus: v, ...y }, b) => {
11
+ let x = c(null), S = t(b, x), C = c(null), w = c(null), T = a(() => {
12
+ let e = x.current;
12
13
  if (!e) return;
13
- let t = m(e), n = document.activeElement, r = n && t.includes(n) ? n : S.current && t.includes(S.current) ? S.current : t[0];
14
- S.current = r ?? null;
15
- for (let e of t) e === r ? e.hasAttribute(d) && (e.removeAttribute(d), e.setAttribute("tabindex", "0")) : e.getAttribute("tabindex") !== "-1" && (e.setAttribute("tabindex", "-1"), e.setAttribute(d, ""));
16
- C.current?.takeRecords();
14
+ let t = h(e), n = document.activeElement, r = n && t.includes(n) ? n : C.current && t.includes(C.current) ? C.current : t[0];
15
+ C.current = r ?? null;
16
+ for (let e of t) e === r ? e.hasAttribute(f) && (e.removeAttribute(f), e.setAttribute("tabindex", "0")) : e.getAttribute("tabindex") !== "-1" && (e.setAttribute("tabindex", "-1"), e.setAttribute(f, ""));
17
+ w.current?.takeRecords();
17
18
  }, []);
18
- return o(w), a(() => {
19
- let e = b.current;
19
+ return s(T), o(() => {
20
+ let e = x.current;
20
21
  if (!e) return;
21
- let t = new MutationObserver(() => w());
22
+ let t = new MutationObserver(() => T());
22
23
  return t.observe(e, {
23
24
  subtree: !0,
24
25
  childList: !0,
@@ -28,59 +29,59 @@ var u = "button:not([disabled]), [href], input:not([disabled]), select:not([disa
28
29
  "tabindex",
29
30
  "aria-hidden"
30
31
  ]
31
- }), C.current = t, () => {
32
- t.disconnect(), C.current = null;
32
+ }), w.current = t, () => {
33
+ t.disconnect(), w.current = null;
33
34
  };
34
- }, [w]), /* @__PURE__ */ l(r ? e : "div", {
35
- ref: x,
35
+ }, [T]), /* @__PURE__ */ u(i ? e : "div", {
36
+ ref: S,
36
37
  role: "toolbar",
37
- "aria-orientation": f,
38
- "data-size": u,
39
- "data-orientation": f,
40
- className: c("wim-toolbar", n.root, n[`size-${u}`], n[f], p),
38
+ "aria-orientation": p,
39
+ "data-size": d,
40
+ "data-orientation": p,
41
+ className: l("wim-toolbar", r.root, r[`size-${d}`], r[p], m),
41
42
  onKeyDownCapture: (e) => {
42
- if (g?.(e), e.defaultPrevented) return;
43
- let t = b.current;
43
+ if (_?.(e), e.defaultPrevented) return;
44
+ let t = x.current;
44
45
  if (!t) return;
45
- let n = m(t);
46
- if (n.length === 0) return;
47
- let r = n.indexOf(document.activeElement);
48
- if (r < 0) return;
49
- let i = f === "horizontal", a = i ? "ArrowRight" : "ArrowDown", o = i ? "ArrowLeft" : "ArrowUp", s = r;
50
- if (e.key === a) e.preventDefault(), s = (r + 1) % n.length;
51
- else if (e.key === o) e.preventDefault(), s = (r - 1 + n.length) % n.length;
52
- else if (e.key === "Home") e.preventDefault(), s = 0;
53
- else if (e.key === "End") e.preventDefault(), s = n.length - 1;
54
- else return;
55
- e.stopPropagation(), n[s]?.focus();
46
+ let r = h(t);
47
+ if (r.length === 0) return;
48
+ let i = r.indexOf(document.activeElement);
49
+ if (i < 0) return;
50
+ let a = n({
51
+ key: e.key,
52
+ current: i,
53
+ count: r.length,
54
+ orientation: p
55
+ });
56
+ a !== null && (e.preventDefault(), e.stopPropagation(), r[a]?.focus());
56
57
  },
57
58
  onFocus: (e) => {
58
- _?.(e);
59
- let t = b.current, n = e.target;
60
- t && n !== S.current && m(t).includes(n) && (S.current = n, w());
59
+ v?.(e);
60
+ let t = x.current, n = e.target;
61
+ t && n !== C.current && h(t).includes(n) && (C.current = n, T());
61
62
  },
62
- ...v,
63
- children: h
63
+ ...y,
64
+ children: g
64
65
  });
65
66
  });
66
- h.displayName = "Toolbar";
67
- var g = r.forwardRef(({ asChild: t = !1, className: r, children: i, ...a }, o) => /* @__PURE__ */ l(t ? e : "div", {
67
+ g.displayName = "Toolbar";
68
+ var _ = i.forwardRef(({ asChild: t = !1, className: n, children: i, ...a }, o) => /* @__PURE__ */ u(t ? e : "div", {
68
69
  ref: o,
69
70
  role: "group",
70
- className: c(n.group, r),
71
+ className: l(r.group, n),
71
72
  ...a,
72
73
  children: i
73
74
  }));
74
- g.displayName = "Toolbar.Group";
75
- var _ = r.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l("div", {
76
- ref: r,
75
+ _.displayName = "Toolbar.Group";
76
+ var v = i.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u("div", {
77
+ ref: n,
77
78
  role: "separator",
78
79
  "aria-hidden": "true",
79
- className: c(n.separator, e),
80
+ className: l(r.separator, e),
80
81
  ...t
81
82
  }));
82
- _.displayName = "Toolbar.Separator";
83
- var v = h;
84
- v.Group = g, v.Separator = _;
83
+ v.displayName = "Toolbar.Separator";
84
+ var y = g;
85
+ y.Group = _, y.Separator = v;
85
86
  //#endregion
86
- export { v as Toolbar, v as default, g as ToolbarGroup, _ as ToolbarSeparator };
87
+ export { y as Toolbar, y as default, _ as ToolbarGroup, v as ToolbarSeparator };