@ledgerhq/lumen-ui-react 0.1.15 → 0.1.16

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 (59) hide show
  1. package/ai-rules/RULES.md +1 -1
  2. package/dist/i18n/i18n.d.ts.map +1 -1
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +126 -128
  6. package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  7. package/dist/lib/Components/Avatar/Avatar.js +24 -24
  8. package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
  9. package/dist/lib/Components/BaseInput/BaseInput.js +58 -58
  10. package/dist/lib/Components/CardButton/CardButton.js +10 -10
  11. package/dist/lib/Components/Dialog/Dialog.js +39 -39
  12. package/dist/lib/Components/Dialog/types.d.ts +3 -3
  13. package/dist/lib/Components/Icon/Icon.js +5 -5
  14. package/dist/lib/Components/Icon/createIcon.d.ts.map +1 -1
  15. package/dist/lib/Components/Link/Link.d.ts.map +1 -1
  16. package/dist/lib/Components/Link/Link.js +25 -32
  17. package/dist/lib/Components/ListItem/ListItem.d.ts +17 -28
  18. package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  19. package/dist/lib/Components/ListItem/ListItem.js +81 -93
  20. package/dist/lib/Components/ListItem/types.d.ts +13 -32
  21. package/dist/lib/Components/ListItem/types.d.ts.map +1 -1
  22. package/dist/lib/Components/Menu/Menu.d.ts +4 -4
  23. package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
  24. package/dist/lib/Components/NavBar/NavBar.d.ts +0 -1
  25. package/dist/lib/Components/NavBar/NavBar.d.ts.map +1 -1
  26. package/dist/lib/Components/Popover/Popover.js +7 -7
  27. package/dist/lib/Components/Popover/types.d.ts +3 -3
  28. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  29. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  30. package/dist/lib/Components/SegmentedControl/SegmentedControl.js +97 -81
  31. package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -0
  32. package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  33. package/dist/lib/Components/SegmentedControl/types.d.ts +7 -0
  34. package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  35. package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.d.ts +5 -6
  36. package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.d.ts.map +1 -1
  37. package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.js +30 -25
  38. package/dist/lib/Components/Select/Select.js +9 -9
  39. package/dist/lib/Components/SideBar/SideBar.d.ts +1 -1
  40. package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
  41. package/dist/lib/Components/SideBar/SideBar.js +93 -89
  42. package/dist/lib/Components/SideBar/types.d.ts +7 -1
  43. package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
  44. package/dist/lib/Components/Stepper/Stepper.d.ts +5 -6
  45. package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -1
  46. package/dist/lib/Components/Stepper/Stepper.js +100 -102
  47. package/dist/lib/Components/Stepper/types.d.ts +2 -2
  48. package/dist/lib/Components/Stepper/types.d.ts.map +1 -1
  49. package/dist/lib/Components/Tag/Tag.d.ts.map +1 -1
  50. package/dist/lib/Components/Tag/Tag.js +1 -1
  51. package/dist/lib/Components/Tooltip/Tooltip.d.ts +2 -2
  52. package/dist/lib/Components/Tooltip/Tooltip.d.ts.map +1 -1
  53. package/dist/lib/Components/TriggerButton/TriggerButton.js +8 -8
  54. package/dist/node_modules/i18next/dist/esm/i18next.js +45 -47
  55. package/dist/package.json +1 -1
  56. package/dist/utils/icon-template.d.ts.map +1 -1
  57. package/package.json +1 -1
  58. package/dist/lib/Patterns/index.d.ts +0 -3
  59. package/dist/lib/Patterns/index.d.ts.map +0 -1
@@ -1,126 +1,142 @@
1
- import { jsx as s, jsxs as b } from "react/jsx-runtime";
2
- import { cn as p, useDisabledContext as g } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as c } from "class-variance-authority";
4
- import { useRef as x } from "react";
5
- import { useSegmentedControlContext as h, SegmentedControlContextProvider as v } from "./SegmentedControlContext.js";
6
- import { useSegmentedControlSelectedIndex as C, usePillElementLayoutEffect as y } from "./usePillElementLayoutEffect.js";
7
- const f = {
8
- root: c("relative flex w-full flex-row items-center rounded-sm", {
1
+ import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
+ import { cn as x, useDisabledContext as h } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as f } from "class-variance-authority";
4
+ import { useRef as v } from "react";
5
+ import { useSegmentedControlContext as y, SegmentedControlContextProvider as C } from "./SegmentedControlContext.js";
6
+ import { useSegmentedControlSelectedIndex as N, usePillElementLayoutEffect as S } from "./usePillElementLayoutEffect.js";
7
+ const b = {
8
+ root: f("relative flex flex-row items-center rounded-sm", {
9
9
  variants: {
10
10
  appearance: {
11
11
  background: "bg-surface",
12
12
  "no-background": "bg-transparent"
13
+ },
14
+ tabLayout: {
15
+ fit: "inline-flex",
16
+ fixed: "w-full"
13
17
  }
14
18
  }
15
19
  }),
16
- pill: c(
17
- "pointer-events-none absolute top-0 left-0 z-0 rounded-sm transition-transform duration-250 ease-in-out",
18
- {
19
- variants: {
20
- disabled: {
21
- true: "bg-base-transparent-pressed",
22
- false: "bg-muted-transparent"
23
- }
20
+ pill: f("pointer-events-none absolute top-0 left-0 z-0 rounded-sm", {
21
+ variants: {
22
+ disabled: {
23
+ true: "bg-base-transparent-pressed",
24
+ false: "bg-muted-transparent"
25
+ },
26
+ isReady: {
27
+ true: "transition-[transform,width] duration-250 ease-in-out",
28
+ false: "transition-none"
24
29
  }
25
30
  }
26
- ),
27
- item: c(
28
- "z-10 flex min-w-0 flex-1 cursor-pointer flex-row items-center justify-center rounded-sm px-16 py-8 select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed",
31
+ }),
32
+ item: f(
33
+ "z-10 flex cursor-pointer flex-row items-center justify-center rounded-sm px-16 py-8 select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed",
29
34
  {
30
35
  variants: {
31
36
  selected: {
32
- true: "body-2-semi-bold text-base",
33
- false: "body-2 text-muted hover:body-2-semi-bold hover:text-muted-hover"
37
+ true: "body-2-semi-bold",
38
+ false: "body-2"
39
+ },
40
+ disabled: {
41
+ true: "text-muted",
42
+ false: ""
34
43
  }
35
- }
44
+ },
45
+ compoundVariants: [
46
+ { selected: !0, disabled: !1, className: "text-base" },
47
+ {
48
+ selected: !1,
49
+ disabled: !1,
50
+ className: "text-muted hover:text-muted-hover"
51
+ }
52
+ ]
36
53
  }
37
54
  )
38
55
  };
39
- function S({
40
- value: o,
41
- children: a,
42
- icon: e,
43
- onClick: l,
44
- className: d,
45
- ...m
56
+ function w({
57
+ value: s,
58
+ children: l,
59
+ icon: t,
60
+ onClick: d,
61
+ className: m,
62
+ ...c
46
63
  }) {
47
- const { selectedValue: u, onSelectedChange: n, disabled: t } = h(), i = u === o;
48
- return /* @__PURE__ */ s(
64
+ const { selectedValue: a, onSelectedChange: u, disabled: e, tabLayout: r } = y(), i = a === s;
65
+ return /* @__PURE__ */ o(
49
66
  "button",
50
67
  {
51
68
  type: "button",
52
69
  role: "radio",
53
70
  "aria-checked": i,
54
- "aria-disabled": t,
55
- disabled: t,
56
- onClick: (r) => {
57
- t || (n(o), l?.(r));
71
+ "aria-disabled": e,
72
+ disabled: e,
73
+ onClick: (n) => {
74
+ e || (u(s), d?.(n));
58
75
  },
59
- className: p(
60
- f.item({
61
- selected: i
62
- }),
63
- d
76
+ className: x(
77
+ b.item({ selected: i, disabled: !!e }),
78
+ r === "fixed" && "min-w-0 flex-1",
79
+ m
64
80
  ),
65
- ...m,
66
- children: /* @__PURE__ */ b("span", { className: "inline-flex shrink-0 items-center justify-center gap-8", children: [
67
- e && /* @__PURE__ */ s(e, { size: 16 }),
68
- /* @__PURE__ */ s("span", { children: a })
81
+ ...c,
82
+ children: /* @__PURE__ */ p("span", { className: "inline-flex min-w-0 items-center justify-center gap-8", children: [
83
+ t && /* @__PURE__ */ o(t, { size: 16, className: "shrink-0" }),
84
+ /* @__PURE__ */ o("span", { className: "truncate", children: l })
69
85
  ] })
70
86
  }
71
87
  );
72
88
  }
73
- S.displayName = "SegmentedControlButton";
74
- function w({
75
- selectedValue: o,
76
- onSelectedChange: a,
77
- children: e,
78
- className: l,
79
- disabled: d,
80
- appearance: m = "background",
89
+ w.displayName = "SegmentedControlButton";
90
+ function k({
91
+ selectedValue: s,
92
+ onSelectedChange: l,
93
+ children: t,
94
+ className: d,
95
+ disabled: m,
96
+ appearance: c = "background",
97
+ tabLayout: a = "fixed",
81
98
  ...u
82
99
  }) {
83
- const n = g({
100
+ const e = h({
84
101
  consumerName: "SegmentedControl",
85
- mergeWith: { disabled: d }
86
- }), t = x(null), i = C(
87
- o,
88
- e
89
- ), { pill: r } = y({
90
- ref: t,
102
+ mergeWith: { disabled: m }
103
+ }), r = v(null), i = N(
104
+ s,
105
+ t
106
+ ), { pill: n, isReady: g } = S({
107
+ ref: r,
91
108
  selectedIndex: i,
92
- children: e
109
+ children: t
93
110
  });
94
- return /* @__PURE__ */ s(
95
- v,
111
+ return /* @__PURE__ */ o(
112
+ C,
96
113
  {
97
- value: { selectedValue: o, onSelectedChange: a, disabled: n },
98
- children: /* @__PURE__ */ b(
114
+ value: { selectedValue: s, onSelectedChange: l, disabled: e, tabLayout: a },
115
+ children: /* @__PURE__ */ p(
99
116
  "div",
100
117
  {
101
118
  ...u,
102
- ref: t,
119
+ ref: r,
103
120
  role: "radiogroup",
104
- "aria-disabled": n,
105
- className: p(
106
- f.root({
107
- appearance: m
121
+ "aria-disabled": e,
122
+ className: x(
123
+ b.root({
124
+ appearance: c,
125
+ tabLayout: a
108
126
  }),
109
- l
127
+ d
110
128
  ),
111
129
  children: [
112
- e,
113
- /* @__PURE__ */ s(
130
+ t,
131
+ /* @__PURE__ */ o(
114
132
  "div",
115
133
  {
116
134
  "aria-hidden": !0,
117
- className: f.pill({
118
- disabled: n
119
- }),
135
+ className: b.pill({ disabled: e, isReady: g }),
120
136
  style: {
121
- width: r.width,
122
- height: r.height,
123
- transform: `translateX(${r.x}px)`
137
+ width: n.width,
138
+ height: n.height,
139
+ transform: `translateX(${n.x}px)`
124
140
  }
125
141
  }
126
142
  )
@@ -130,8 +146,8 @@ function w({
130
146
  }
131
147
  );
132
148
  }
133
- w.displayName = "SegmentedControl";
149
+ k.displayName = "SegmentedControl";
134
150
  export {
135
- w as SegmentedControl,
136
- S as SegmentedControlButton
151
+ k as SegmentedControl,
152
+ w as SegmentedControlButton
137
153
  };
@@ -2,6 +2,7 @@ export type SegmentedControlContextValue = {
2
2
  selectedValue: string;
3
3
  onSelectedChange: (value: string) => void;
4
4
  disabled: boolean;
5
+ tabLayout: 'fit' | 'fixed';
5
6
  };
6
7
  declare const SegmentedControlContextProvider: import('react').FC<{
7
8
  children: import('react').ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlContext.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/SegmentedControlContext.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,QAAA,MAAO,+BAA+B;;;EAC+B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,oCAInC,CAAC;AAEL,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
1
+ {"version":3,"file":"SegmentedControlContext.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/SegmentedControlContext.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,KAAK,GAAG,OAAO,CAAC;CAC5B,CAAC;AAEF,QAAA,MAAO,+BAA+B;;;EAC+B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,oCAInC,CAAC;AAEL,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
@@ -18,6 +18,13 @@ export type SegmentedControlProps = {
18
18
  * @default 'background'
19
19
  */
20
20
  appearance?: 'background' | 'no-background';
21
+ /**
22
+ * Controls how tab widths are calculated.
23
+ * - "fit": each tab sizes to its content
24
+ * - "fixed": all tabs share equal width, filling the container
25
+ * @default 'fixed'
26
+ */
27
+ tabLayout?: 'fit' | 'fixed';
21
28
  /**
22
29
  * Segment buttons (SegmentedControlButton).
23
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC;IAC5C;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAEtD,KAAK,aAAa,GAAG,aAAa,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB,GAAG,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC;IAC5C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAEtD,KAAK,aAAa,GAAG,aAAa,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB,GAAG,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC"}
@@ -1,17 +1,16 @@
1
- import { default as React } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export type PillLayout = {
3
3
  width: number;
4
4
  height: number;
5
5
  x: number;
6
6
  };
7
- type UsePillElementLayoutEffectParams = {
7
+ export declare function usePillElementLayoutEffect({ ref, selectedIndex, children, }: {
8
8
  ref: React.RefObject<HTMLDivElement | null>;
9
9
  selectedIndex: number;
10
10
  children: React.ReactNode;
11
- };
12
- export declare function usePillElementLayoutEffect({ ref, selectedIndex, children, }: UsePillElementLayoutEffectParams): {
11
+ }): {
13
12
  pill: PillLayout;
13
+ isReady: boolean;
14
14
  };
15
- export declare function useSegmentedControlSelectedIndex(selectedValue: string, children: React.ReactNode): number;
16
- export {};
15
+ export declare function useSegmentedControlSelectedIndex(selectedValue: string, children: ReactNode): number;
17
16
  //# sourceMappingURL=usePillElementLayoutEffect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePillElementLayoutEffect.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/usePillElementLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,gCAAgC,GAAG;IACtC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,aAAa,EACb,QAAQ,GACT,EAAE,gCAAgC,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CA0BzD;AAED,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,GACxB,MAAM,CAUR"}
1
+ {"version":3,"file":"usePillElementLayoutEffect.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/usePillElementLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAKV,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,aAAa,EACb,QAAQ,GACT,EAAE;IACD,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAkCzC;AAED,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,SAAS,GAClB,MAAM,CAUR"}
@@ -1,35 +1,40 @@
1
- import r, { useMemo as a, useState as m, useLayoutEffect as p } from "react";
2
- function y({
3
- ref: e,
4
- selectedIndex: t,
5
- children: n
1
+ import { useMemo as h, Children as y, isValidElement as g, useState as u, useLayoutEffect as p, useEffect as v } from "react";
2
+ function R({
3
+ ref: n,
4
+ selectedIndex: e,
5
+ children: r
6
6
  }) {
7
- const [f, l] = m({ width: 0, height: 0, x: 0 });
7
+ const [f, c] = u({ width: 0, height: 0, x: 0 }), [a, l] = u(!1);
8
8
  return p(() => {
9
- const o = e.current;
10
- if (!o) return;
11
- const i = () => {
12
- const { width: d, height: h } = o.getBoundingClientRect(), u = r.Children.count(n), c = u > 0 ? d / u : 0;
13
- l({
14
- width: c,
15
- height: h,
16
- x: t >= 0 ? t * c : 0
9
+ const t = n.current;
10
+ if (!t) return;
11
+ const o = () => {
12
+ const { height: d } = t.getBoundingClientRect(), m = Array.from(t.children).slice(0, -1), i = e >= 0 ? m[e] : void 0;
13
+ c({
14
+ width: i?.offsetWidth ?? 0,
15
+ height: d,
16
+ x: i?.offsetLeft ?? 0
17
17
  });
18
18
  };
19
- if (i(), typeof ResizeObserver > "u") return;
20
- const s = new ResizeObserver(i);
21
- return s.observe(o), () => s.disconnect();
22
- }, [n, t, e]), { pill: f };
19
+ if (o(), typeof ResizeObserver > "u") return;
20
+ const s = new ResizeObserver(o);
21
+ return s.observe(t), () => s.disconnect();
22
+ }, [r, e, n]), v(() => {
23
+ const t = requestAnimationFrame(() => {
24
+ l(!0);
25
+ });
26
+ return () => cancelAnimationFrame(t);
27
+ }, []), { pill: f, isReady: a };
23
28
  }
24
- function v(e, t) {
25
- return a(
26
- () => r.Children.toArray(t).findIndex(
27
- (n) => r.isValidElement(n) && n.props.value === e
29
+ function b(n, e) {
30
+ return h(
31
+ () => y.toArray(e).findIndex(
32
+ (r) => g(r) && r.props.value === n
28
33
  ),
29
- [e, t]
34
+ [n, e]
30
35
  );
31
36
  }
32
37
  export {
33
- y as usePillElementLayoutEffect,
34
- v as useSegmentedControlSelectedIndex
38
+ R as usePillElementLayoutEffect,
39
+ b as useSegmentedControlSelectedIndex
35
40
  };
@@ -81,7 +81,7 @@ const v = o(
81
81
  u,
82
82
  {
83
83
  size: 20,
84
- className: "shrink-0 text-muted group-data-disabled:text-disabled"
84
+ className: "text-muted group-data-disabled:text-disabled"
85
85
  }
86
86
  ) })
87
87
  ]
@@ -156,9 +156,9 @@ const I = m(
156
156
  position: s,
157
157
  ...i,
158
158
  children: [
159
- /* @__PURE__ */ e(L, {}),
159
+ /* @__PURE__ */ e(U, {}),
160
160
  /* @__PURE__ */ e(l.Viewport, { className: V({ position: s }), children: r }),
161
- /* @__PURE__ */ e(U, {})
161
+ /* @__PURE__ */ e(G, {})
162
162
  ]
163
163
  }
164
164
  ) });
@@ -196,7 +196,7 @@ const B = o(
196
196
  ...s,
197
197
  children: [
198
198
  r,
199
- /* @__PURE__ */ e("span", { className: "absolute right-8 flex size-24 items-center justify-center", children: /* @__PURE__ */ e(l.ItemIndicator, { children: /* @__PURE__ */ e(x, { size: 24, className: "ms-8 shrink-0 text-active" }) }) })
199
+ /* @__PURE__ */ e("span", { className: "absolute right-8 flex size-24 items-center justify-center", children: /* @__PURE__ */ e(l.ItemIndicator, { children: /* @__PURE__ */ e(x, { size: 24, className: "ms-8 text-active" }) }) })
200
200
  ]
201
201
  }
202
202
  );
@@ -207,7 +207,7 @@ const P = ({
207
207
  ...r
208
208
  }) => /* @__PURE__ */ e(y, { ref: t, className: o("mx-8 my-4 w-auto", a), ...r });
209
209
  P.displayName = "SelectSeparator";
210
- const k = ({ ref: t, className: a, ...r }) => /* @__PURE__ */ e(
210
+ const L = ({ ref: t, className: a, ...r }) => /* @__PURE__ */ e(
211
211
  l.ItemText,
212
212
  {
213
213
  ref: t,
@@ -216,8 +216,8 @@ const k = ({ ref: t, className: a, ...r }) => /* @__PURE__ */ e(
216
216
  ...r
217
217
  }
218
218
  );
219
- k.displayName = l.ItemText.displayName;
220
- function L({
219
+ L.displayName = l.ItemText.displayName;
220
+ function U({
221
221
  className: t,
222
222
  ...a
223
223
  }) {
@@ -234,7 +234,7 @@ function L({
234
234
  }
235
235
  );
236
236
  }
237
- function U({
237
+ function G({
238
238
  className: t,
239
239
  ...a
240
240
  }) {
@@ -262,7 +262,7 @@ export {
262
262
  z as SelectContent,
263
263
  O as SelectGroup,
264
264
  D as SelectItem,
265
- k as SelectItemText,
265
+ L as SelectItemText,
266
266
  j as SelectLabel,
267
267
  P as SelectSeparator,
268
268
  T as SelectTrigger,
@@ -76,7 +76,7 @@ export declare const SideBarItem: {
76
76
  * </SideBarTrailing>
77
77
  */
78
78
  export declare const SideBarCollapseToggle: {
79
- ({ className, ...props }: SideBarCollapseToggleProps): import("react/jsx-runtime").JSX.Element;
79
+ ({ className, tooltipContent: tooltipContentProp, ...props }: SideBarCollapseToggleProps): import("react/jsx-runtime").JSX.Element;
80
80
  displayName: string;
81
81
  };
82
82
  //# sourceMappingURL=SideBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideBar.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SideBar/SideBar.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAmDjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO;2KAWjB,YAAY;;CA2Bd,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,cAAc;6CAKxB,mBAAmB;;CAUrB,CAAC;AAGF;;;;GAIG;AACH,eAAO,MAAM,eAAe;6CAKzB,oBAAoB;;CAUtB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW;0JAWrB,gBAAgB;;CAuDlB,CAAC;AAGF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;8BAG/B,0BAA0B;;CAgC5B,CAAC"}
1
+ {"version":3,"file":"SideBar.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SideBar/SideBar.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAmDjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO;2KAWjB,YAAY;;CA4Bd,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,cAAc;6CAKxB,mBAAmB;;CAUrB,CAAC;AAGF;;;;GAIG;AACH,eAAO,MAAM,eAAe;6CAKzB,oBAAoB;;CAUtB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW;0JAWrB,gBAAgB;;CAuDlB,CAAC;AAGF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;kEAI/B,0BAA0B;;CA2C5B,CAAC"}