@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.
- package/ai-rules/RULES.md +1 -1
- package/dist/i18n/i18n.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +126 -128
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/Avatar.js +24 -24
- package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +58 -58
- package/dist/lib/Components/CardButton/CardButton.js +10 -10
- package/dist/lib/Components/Dialog/Dialog.js +39 -39
- package/dist/lib/Components/Dialog/types.d.ts +3 -3
- package/dist/lib/Components/Icon/Icon.js +5 -5
- package/dist/lib/Components/Icon/createIcon.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.js +25 -32
- package/dist/lib/Components/ListItem/ListItem.d.ts +17 -28
- package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/lib/Components/ListItem/ListItem.js +81 -93
- package/dist/lib/Components/ListItem/types.d.ts +13 -32
- package/dist/lib/Components/ListItem/types.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.d.ts +4 -4
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/NavBar.d.ts +0 -1
- package/dist/lib/Components/NavBar/NavBar.d.ts.map +1 -1
- package/dist/lib/Components/Popover/Popover.js +7 -7
- package/dist/lib/Components/Popover/types.d.ts +3 -3
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +97 -81
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -0
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/types.d.ts +7 -0
- package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.d.ts +5 -6
- package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.js +30 -25
- package/dist/lib/Components/Select/Select.js +9 -9
- package/dist/lib/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +93 -89
- package/dist/lib/Components/SideBar/types.d.ts +7 -1
- package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Stepper/Stepper.d.ts +5 -6
- package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/Stepper/Stepper.js +100 -102
- package/dist/lib/Components/Stepper/types.d.ts +2 -2
- package/dist/lib/Components/Stepper/types.d.ts.map +1 -1
- package/dist/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/lib/Components/Tag/Tag.js +1 -1
- package/dist/lib/Components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/lib/Components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/lib/Components/TriggerButton/TriggerButton.js +8 -8
- package/dist/node_modules/i18next/dist/esm/i18next.js +45 -47
- package/dist/package.json +1 -1
- package/dist/utils/icon-template.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/lib/Patterns/index.d.ts +0 -3
- package/dist/lib/Patterns/index.d.ts.map +0 -1
|
@@ -1,126 +1,142 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useSegmentedControlContext as
|
|
6
|
-
import { useSegmentedControlSelectedIndex as
|
|
7
|
-
const
|
|
8
|
-
root:
|
|
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:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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:
|
|
28
|
-
"z-10 flex
|
|
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
|
|
33
|
-
false: "body-2
|
|
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
|
|
40
|
-
value:
|
|
41
|
-
children:
|
|
42
|
-
icon:
|
|
43
|
-
onClick:
|
|
44
|
-
className:
|
|
45
|
-
...
|
|
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:
|
|
48
|
-
return /* @__PURE__ */
|
|
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":
|
|
55
|
-
disabled:
|
|
56
|
-
onClick: (
|
|
57
|
-
|
|
71
|
+
"aria-disabled": e,
|
|
72
|
+
disabled: e,
|
|
73
|
+
onClick: (n) => {
|
|
74
|
+
e || (u(s), d?.(n));
|
|
58
75
|
},
|
|
59
|
-
className:
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
...
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
74
|
-
function
|
|
75
|
-
selectedValue:
|
|
76
|
-
onSelectedChange:
|
|
77
|
-
children:
|
|
78
|
-
className:
|
|
79
|
-
disabled:
|
|
80
|
-
appearance:
|
|
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
|
|
100
|
+
const e = h({
|
|
84
101
|
consumerName: "SegmentedControl",
|
|
85
|
-
mergeWith: { disabled:
|
|
86
|
-
}),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
), { pill:
|
|
90
|
-
ref:
|
|
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:
|
|
109
|
+
children: t
|
|
93
110
|
});
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
|
|
111
|
+
return /* @__PURE__ */ o(
|
|
112
|
+
C,
|
|
96
113
|
{
|
|
97
|
-
value: { selectedValue:
|
|
98
|
-
children: /* @__PURE__ */
|
|
114
|
+
value: { selectedValue: s, onSelectedChange: l, disabled: e, tabLayout: a },
|
|
115
|
+
children: /* @__PURE__ */ p(
|
|
99
116
|
"div",
|
|
100
117
|
{
|
|
101
118
|
...u,
|
|
102
|
-
ref:
|
|
119
|
+
ref: r,
|
|
103
120
|
role: "radiogroup",
|
|
104
|
-
"aria-disabled":
|
|
105
|
-
className:
|
|
106
|
-
|
|
107
|
-
appearance:
|
|
121
|
+
"aria-disabled": e,
|
|
122
|
+
className: x(
|
|
123
|
+
b.root({
|
|
124
|
+
appearance: c,
|
|
125
|
+
tabLayout: a
|
|
108
126
|
}),
|
|
109
|
-
|
|
127
|
+
d
|
|
110
128
|
),
|
|
111
129
|
children: [
|
|
112
|
-
|
|
113
|
-
/* @__PURE__ */
|
|
130
|
+
t,
|
|
131
|
+
/* @__PURE__ */ o(
|
|
114
132
|
"div",
|
|
115
133
|
{
|
|
116
134
|
"aria-hidden": !0,
|
|
117
|
-
className:
|
|
118
|
-
disabled: n
|
|
119
|
-
}),
|
|
135
|
+
className: b.pill({ disabled: e, isReady: g }),
|
|
120
136
|
style: {
|
|
121
|
-
width:
|
|
122
|
-
height:
|
|
123
|
-
transform: `translateX(${
|
|
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
|
-
|
|
149
|
+
k.displayName = "SegmentedControl";
|
|
134
150
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
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;
|
|
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 {
|
|
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
|
-
|
|
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:
|
|
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,
|
|
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
|
|
2
|
-
function
|
|
3
|
-
ref:
|
|
4
|
-
selectedIndex:
|
|
5
|
-
children:
|
|
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,
|
|
7
|
+
const [f, c] = u({ width: 0, height: 0, x: 0 }), [a, l] = u(!1);
|
|
8
8
|
return p(() => {
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
11
|
-
const
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
width:
|
|
15
|
-
height:
|
|
16
|
-
x:
|
|
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 (
|
|
20
|
-
const s = new ResizeObserver(
|
|
21
|
-
return s.observe(
|
|
22
|
-
}, [
|
|
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
|
|
25
|
-
return
|
|
26
|
-
() =>
|
|
27
|
-
(
|
|
29
|
+
function b(n, e) {
|
|
30
|
+
return h(
|
|
31
|
+
() => y.toArray(e).findIndex(
|
|
32
|
+
(r) => g(r) && r.props.value === n
|
|
28
33
|
),
|
|
29
|
-
[
|
|
34
|
+
[n, e]
|
|
30
35
|
);
|
|
31
36
|
}
|
|
32
37
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
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: "
|
|
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(
|
|
159
|
+
/* @__PURE__ */ e(U, {}),
|
|
160
160
|
/* @__PURE__ */ e(l.Viewport, { className: V({ position: s }), children: r }),
|
|
161
|
-
/* @__PURE__ */ e(
|
|
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
|
|
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
|
|
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
|
-
|
|
220
|
-
function
|
|
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
|
|
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
|
-
|
|
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;;
|
|
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"}
|