@luxfi/ui 7.4.0 → 7.4.3
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/dist/avatar.cjs +7 -6
- package/dist/avatar.js +7 -5
- package/dist/badge.cjs +33 -35
- package/dist/badge.js +33 -35
- package/dist/bank.d.cts +3 -3
- package/dist/bank.d.ts +3 -3
- package/dist/checkbox.cjs +4 -4
- package/dist/checkbox.d.cts +3 -2
- package/dist/checkbox.d.ts +3 -2
- package/dist/checkbox.js +5 -4
- package/dist/chrome.cjs +960 -0
- package/dist/chrome.d.cts +93 -0
- package/dist/chrome.d.ts +93 -0
- package/dist/chrome.js +931 -0
- package/dist/drawer.cjs +86 -20
- package/dist/drawer.js +85 -19
- package/dist/expiration-selector.cjs +3 -2
- package/dist/expiration-selector.js +3 -2
- package/dist/greeks-display.cjs +6 -6
- package/dist/greeks-display.js +6 -6
- package/dist/gui.cjs +13 -0
- package/dist/gui.d.cts +2 -0
- package/dist/gui.d.ts +2 -0
- package/dist/gui.js +2 -0
- package/dist/heading.cjs +4 -2
- package/dist/heading.js +4 -2
- package/dist/iam.cjs +216 -0
- package/dist/iam.d.cts +65 -0
- package/dist/iam.d.ts +65 -0
- package/dist/iam.js +211 -0
- package/dist/icons.cjs +13 -0
- package/dist/icons.d.cts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/identity.cjs +430 -0
- package/dist/identity.d.cts +64 -0
- package/dist/identity.d.ts +64 -0
- package/dist/identity.js +408 -0
- package/dist/index.cjs +1610 -836
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +1587 -831
- package/dist/input.cjs +3 -1
- package/dist/input.d.cts +3 -5
- package/dist/input.d.ts +3 -5
- package/dist/input.js +3 -1
- package/dist/lux.config.cjs +23 -2
- package/dist/lux.config.d.cts +28 -10
- package/dist/lux.config.d.ts +28 -10
- package/dist/lux.config.js +23 -2
- package/dist/menu.cjs +4 -4
- package/dist/menu.js +4 -4
- package/dist/next.cjs +132 -0
- package/dist/next.d.cts +32 -0
- package/dist/next.d.ts +32 -0
- package/dist/next.js +129 -0
- package/dist/option-chain.cjs +1 -1
- package/dist/option-chain.js +1 -1
- package/dist/option-position.cjs +2 -1
- package/dist/option-position.js +2 -1
- package/dist/pnl-diagram.cjs +8 -6
- package/dist/pnl-diagram.js +8 -6
- package/dist/progress.cjs +7 -6
- package/dist/progress.js +7 -5
- package/dist/provider.cjs +146 -4
- package/dist/provider.d.cts +15 -3
- package/dist/provider.d.ts +15 -3
- package/dist/provider.js +146 -5
- package/dist/radio.cjs +9 -7
- package/dist/radio.js +10 -7
- package/dist/separator.cjs +3 -1
- package/dist/separator.js +3 -1
- package/dist/slider.cjs +28 -16
- package/dist/slider.js +28 -15
- package/dist/strategy-builder.cjs +2 -1
- package/dist/strategy-builder.js +2 -1
- package/dist/switch.cjs +11 -12
- package/dist/switch.js +12 -12
- package/dist/tag.cjs +34 -36
- package/dist/tag.js +33 -35
- package/dist/textarea.cjs +3 -1
- package/dist/textarea.js +3 -1
- package/dist/tooltip.cjs +28 -30
- package/dist/tooltip.js +27 -29
- package/dist/use-narrow.cjs +46 -0
- package/dist/use-narrow.d.cts +12 -0
- package/dist/use-narrow.d.ts +12 -0
- package/dist/use-narrow.js +20 -0
- package/dist/vite.cjs +109 -0
- package/dist/vite.d.cts +29 -0
- package/dist/vite.d.ts +29 -0
- package/dist/vite.js +107 -0
- package/dist/white-label.cjs +142 -0
- package/dist/white-label.d.cts +59 -0
- package/dist/white-label.d.ts +59 -0
- package/dist/white-label.js +134 -0
- package/package.json +85 -19
- package/src/avatar.tsx +22 -16
- package/src/checkbox.tsx +15 -10
- package/src/chrome.tsx +459 -0
- package/src/drawer.tsx +83 -10
- package/src/engine.ts +130 -0
- package/src/expiration-selector.tsx +3 -2
- package/src/greeks-display.tsx +9 -6
- package/src/gui.ts +17 -0
- package/src/heading.tsx +12 -8
- package/src/iam.ts +170 -0
- package/src/icons.ts +18 -0
- package/src/identity.tsx +318 -0
- package/src/index.ts +44 -1
- package/src/input.tsx +13 -9
- package/src/lux.config.ts +16 -15
- package/src/menu.tsx +4 -4
- package/src/next.ts +89 -0
- package/src/option-chain.tsx +1 -1
- package/src/option-position.tsx +2 -1
- package/src/pnl-diagram.tsx +11 -6
- package/src/progress.tsx +15 -8
- package/src/provider.tsx +48 -7
- package/src/radio.tsx +15 -11
- package/src/separator.tsx +8 -3
- package/src/slider.tsx +35 -19
- package/src/strategy-builder.tsx +3 -2
- package/src/switch.tsx +17 -16
- package/src/textarea.tsx +8 -4
- package/src/tooltip.tsx +15 -24
- package/src/use-narrow.ts +40 -0
- package/src/vite.ts +80 -0
- package/src/white-label.ts +254 -0
- package/tokens.css +613 -319
- package/src/tokens.css +0 -438
package/dist/index.cjs
CHANGED
|
@@ -3,26 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
var gui = require('@hanzo/gui');
|
|
5
5
|
var reactQuery = require('@tanstack/react-query');
|
|
6
|
-
var
|
|
6
|
+
var React33 = require('react');
|
|
7
7
|
var v5 = require('@hanzogui/config/v5');
|
|
8
|
+
var v5Css = require('@hanzogui/config/v5-css');
|
|
8
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
10
|
var clsx = require('clsx');
|
|
10
11
|
var tailwindMerge = require('tailwind-merge');
|
|
12
|
+
var lucideReact = require('lucide-react');
|
|
13
|
+
var RadixDialog = require('@radix-ui/react-dialog');
|
|
14
|
+
var DropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
11
15
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
12
|
-
var RadixAvatar = require('@radix-ui/react-avatar');
|
|
13
16
|
var usehooks = require('@uidotdev/usehooks');
|
|
14
|
-
var RadixCheckbox = require('@radix-ui/react-checkbox');
|
|
15
17
|
var Collapsible = require('@radix-ui/react-collapsible');
|
|
16
|
-
var RadixDialog = require('@radix-ui/react-dialog');
|
|
17
18
|
var LabelPrimitive = require('@radix-ui/react-label');
|
|
18
19
|
var esToolkit = require('es-toolkit');
|
|
19
|
-
var DropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
20
|
-
var lu = require('react-icons/lu');
|
|
21
|
-
var RadixProgress = require('@radix-ui/react-progress');
|
|
22
|
-
var RadixRadioGroup = require('@radix-ui/react-radio-group');
|
|
23
20
|
var RadixSelect = require('@radix-ui/react-select');
|
|
24
|
-
var RadixSlider = require('@radix-ui/react-slider');
|
|
25
|
-
var RadixSwitch = require('@radix-ui/react-switch');
|
|
26
21
|
var RadixTabs = require('@radix-ui/react-tabs');
|
|
27
22
|
var sonner = require('sonner');
|
|
28
23
|
|
|
@@ -44,29 +39,151 @@ function _interopNamespace(e) {
|
|
|
44
39
|
return Object.freeze(n);
|
|
45
40
|
}
|
|
46
41
|
|
|
47
|
-
var
|
|
42
|
+
var React33__namespace = /*#__PURE__*/_interopNamespace(React33);
|
|
43
|
+
var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
44
|
+
var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
|
|
48
45
|
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
49
|
-
var RadixAvatar__namespace = /*#__PURE__*/_interopNamespace(RadixAvatar);
|
|
50
|
-
var RadixCheckbox__namespace = /*#__PURE__*/_interopNamespace(RadixCheckbox);
|
|
51
46
|
var Collapsible__namespace = /*#__PURE__*/_interopNamespace(Collapsible);
|
|
52
|
-
var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
53
47
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
54
|
-
var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
|
|
55
|
-
var RadixProgress__namespace = /*#__PURE__*/_interopNamespace(RadixProgress);
|
|
56
|
-
var RadixRadioGroup__namespace = /*#__PURE__*/_interopNamespace(RadixRadioGroup);
|
|
57
48
|
var RadixSelect__namespace = /*#__PURE__*/_interopNamespace(RadixSelect);
|
|
58
|
-
var RadixSlider__namespace = /*#__PURE__*/_interopNamespace(RadixSlider);
|
|
59
|
-
var RadixSwitch__namespace = /*#__PURE__*/_interopNamespace(RadixSwitch);
|
|
60
49
|
var RadixTabs__namespace = /*#__PURE__*/_interopNamespace(RadixTabs);
|
|
61
50
|
|
|
62
51
|
// src/provider.tsx
|
|
52
|
+
|
|
53
|
+
// src/white-label.ts
|
|
63
54
|
var LUX_BRAND = {
|
|
64
55
|
lux: "#7000FF",
|
|
65
56
|
zoo: "#6C5EFB",
|
|
66
57
|
hanzo: "#EA580C",
|
|
67
|
-
pars: "#1C3879"
|
|
58
|
+
pars: "#1C3879",
|
|
59
|
+
// bootno.de is its own white label with its own IdP (id.bootno.de) — accent
|
|
60
|
+
// taken from the bootnode console's own brand default, not invented here.
|
|
61
|
+
bootnode: "#3B82F6"
|
|
68
62
|
};
|
|
69
63
|
var PARS_GOLD = "#C8A45C";
|
|
64
|
+
var ORGS = {
|
|
65
|
+
lux: {
|
|
66
|
+
org: "lux",
|
|
67
|
+
name: "Lux",
|
|
68
|
+
domain: "lux.network",
|
|
69
|
+
iamDomain: "lux.id",
|
|
70
|
+
accent: LUX_BRAND.lux,
|
|
71
|
+
accentForeground: "#FFFFFF"
|
|
72
|
+
},
|
|
73
|
+
zoo: {
|
|
74
|
+
org: "zoo",
|
|
75
|
+
name: "Zoo",
|
|
76
|
+
domain: "zoo.ngo",
|
|
77
|
+
// Zoo's issuer is `zoolabs.id` — the one row where it is not `<org>.id`,
|
|
78
|
+
// and the one every hand-rolled branding map gets wrong. `id.zoo.network`
|
|
79
|
+
// ANSWERS, which is why it keeps being copied around, but it is an alias:
|
|
80
|
+
// its own discovery document advertises
|
|
81
|
+
// issuer https://zoolabs.id
|
|
82
|
+
// authorization_endpoint https://zoolabs.id/v1/iam/oauth/authorize
|
|
83
|
+
// jwks_uri https://zoolabs.id/v1/iam/.well-known/jwks
|
|
84
|
+
// so a client configured on the alias validates `iss` against a string the
|
|
85
|
+
// IdP never emits and rejects every token it is given — the exact shape of
|
|
86
|
+
// the lux.id outage. `zoo.id` is not an IdP at all (no discovery document).
|
|
87
|
+
iamDomain: "zoolabs.id",
|
|
88
|
+
accent: LUX_BRAND.zoo,
|
|
89
|
+
accentForeground: "#FFFFFF"
|
|
90
|
+
},
|
|
91
|
+
bootnode: {
|
|
92
|
+
org: "bootnode",
|
|
93
|
+
name: "Bootnode",
|
|
94
|
+
domain: "bootno.de",
|
|
95
|
+
iamDomain: "id.bootno.de",
|
|
96
|
+
accent: LUX_BRAND.lux,
|
|
97
|
+
accentForeground: "#FFFFFF"
|
|
98
|
+
},
|
|
99
|
+
hanzo: {
|
|
100
|
+
org: "hanzo",
|
|
101
|
+
name: "Hanzo",
|
|
102
|
+
domain: "hanzo.ai",
|
|
103
|
+
iamDomain: "hanzo.id",
|
|
104
|
+
accent: LUX_BRAND.hanzo,
|
|
105
|
+
accentForeground: "#FFFFFF"
|
|
106
|
+
},
|
|
107
|
+
pars: {
|
|
108
|
+
org: "pars",
|
|
109
|
+
name: "Pars",
|
|
110
|
+
domain: "pars.id",
|
|
111
|
+
iamDomain: "pars.id",
|
|
112
|
+
accent: LUX_BRAND.pars,
|
|
113
|
+
accentForeground: PARS_GOLD
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var DOMAIN_ORG = [
|
|
117
|
+
["lux.network", "lux"],
|
|
118
|
+
["lux.cloud", "lux"],
|
|
119
|
+
["lux.id", "lux"],
|
|
120
|
+
["lux.finance", "lux"],
|
|
121
|
+
["lux.market", "lux"],
|
|
122
|
+
["lux.exchange", "lux"],
|
|
123
|
+
["zoo.ngo", "zoo"],
|
|
124
|
+
["zoo.network", "zoo"],
|
|
125
|
+
["zoo.cloud", "zoo"],
|
|
126
|
+
["zoolabs.id", "zoo"],
|
|
127
|
+
["hanzo.ai", "hanzo"],
|
|
128
|
+
["hanzo.cloud", "hanzo"],
|
|
129
|
+
["hanzo.id", "hanzo"],
|
|
130
|
+
["pars.id", "pars", "app"],
|
|
131
|
+
["pars.network", "pars", "app"],
|
|
132
|
+
["parsdao.org", "pars", "app"],
|
|
133
|
+
["bootno.de", "bootnode", "platform"]
|
|
134
|
+
];
|
|
135
|
+
var DEFAULT_ORG = "lux";
|
|
136
|
+
function normalizeHost(host) {
|
|
137
|
+
const noPort = host.trim().toLowerCase().split(":")[0] ?? "";
|
|
138
|
+
return noPort.replace(/\.$/, "");
|
|
139
|
+
}
|
|
140
|
+
function isUnder(host, domain) {
|
|
141
|
+
return host === domain || host.endsWith(`.${domain}`);
|
|
142
|
+
}
|
|
143
|
+
function matchDomain(host) {
|
|
144
|
+
let best;
|
|
145
|
+
for (const entry of DOMAIN_ORG) {
|
|
146
|
+
if (isUnder(host, entry[0]) && (!best || entry[0].length > best[0].length)) {
|
|
147
|
+
best = entry;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return best;
|
|
151
|
+
}
|
|
152
|
+
function appSlug(host, domain, pinned) {
|
|
153
|
+
if (pinned) return pinned;
|
|
154
|
+
const sub = host === domain ? "" : host.slice(0, -(domain.length + 1));
|
|
155
|
+
const leftmost = sub.split(".")[0] ?? "";
|
|
156
|
+
if (leftmost && leftmost !== "www") return leftmost;
|
|
157
|
+
const label = domain.split(".")[0] ?? "";
|
|
158
|
+
const tld = domain.split(".").slice(1).join(".");
|
|
159
|
+
return tld.split(".")[0] || label;
|
|
160
|
+
}
|
|
161
|
+
function isLocal(host) {
|
|
162
|
+
return host === "localhost" || host.endsWith(".localhost") || host === "127.0.0.1" || host === "0.0.0.0" || host === "[::1]" || host.endsWith(".local");
|
|
163
|
+
}
|
|
164
|
+
function resolveWhiteLabel(host) {
|
|
165
|
+
const h = normalizeHost(host ?? "");
|
|
166
|
+
const match = h ? matchDomain(h) : void 0;
|
|
167
|
+
const org = match ? match[1] : DEFAULT_ORG;
|
|
168
|
+
const identity = ORGS[org];
|
|
169
|
+
const app = match ? appSlug(h, match[0], match[2]) : h && isLocal(h) ? "local" : "app";
|
|
170
|
+
return {
|
|
171
|
+
...identity,
|
|
172
|
+
host: h,
|
|
173
|
+
app,
|
|
174
|
+
theme: `dark_${org}`,
|
|
175
|
+
issuer: `https://${identity.iamDomain}`,
|
|
176
|
+
clientId: `${org}-${app}`
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function currentHost() {
|
|
180
|
+
return typeof window === "undefined" ? "" : window.location.host;
|
|
181
|
+
}
|
|
182
|
+
function orgIdentity(org) {
|
|
183
|
+
return ORGS[org];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// src/lux.config.ts
|
|
70
187
|
var TRUE_BLACK = "#000000";
|
|
71
188
|
var darkBase = {
|
|
72
189
|
...v5.defaultConfig.themes.dark,
|
|
@@ -88,48 +205,1107 @@ var luxThemes = {
|
|
|
88
205
|
dark_lux: brandTheme(LUX_BRAND.lux),
|
|
89
206
|
dark_zoo: brandTheme(LUX_BRAND.zoo),
|
|
90
207
|
dark_hanzo: brandTheme(LUX_BRAND.hanzo),
|
|
91
|
-
dark_pars: brandTheme(LUX_BRAND.pars, { accentColor: PARS_GOLD })
|
|
208
|
+
dark_pars: brandTheme(LUX_BRAND.pars, { accentColor: PARS_GOLD }),
|
|
209
|
+
dark_bootnode: brandTheme(LUX_BRAND.bootnode)
|
|
210
|
+
};
|
|
211
|
+
var config = gui.createGui({
|
|
212
|
+
...v5.defaultConfig,
|
|
213
|
+
animations: v5Css.animations,
|
|
214
|
+
settings: {
|
|
215
|
+
...v5.defaultConfig.settings,
|
|
216
|
+
onlyAllowShorthands: false
|
|
217
|
+
},
|
|
218
|
+
themes: {
|
|
219
|
+
...v5.defaultConfig.themes,
|
|
220
|
+
...luxThemes
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
var lux_config_default = config;
|
|
224
|
+
var defaultQueryClient = new reactQuery.QueryClient({
|
|
225
|
+
defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 3e4 } }
|
|
226
|
+
});
|
|
227
|
+
var FONT_BODY_RESET_ID = "lux-ui-font-body-reset";
|
|
228
|
+
var FONT_BODY_RESET_CSS = "body .font_body{line-height:1.5}";
|
|
229
|
+
var useFontBodyReset = () => {
|
|
230
|
+
React33__namespace.default.useInsertionEffect(() => {
|
|
231
|
+
if (typeof document === "undefined") return;
|
|
232
|
+
if (document.getElementById(FONT_BODY_RESET_ID)) return;
|
|
233
|
+
const style = document.createElement("style");
|
|
234
|
+
style.id = FONT_BODY_RESET_ID;
|
|
235
|
+
style.textContent = FONT_BODY_RESET_CSS;
|
|
236
|
+
document.head.appendChild(style);
|
|
237
|
+
}, []);
|
|
238
|
+
};
|
|
239
|
+
var WhiteLabelContext = React33__namespace.default.createContext(resolveWhiteLabel(""));
|
|
240
|
+
var useWhiteLabel = () => React33__namespace.default.useContext(WhiteLabelContext);
|
|
241
|
+
var useHostWhiteLabel = (host) => {
|
|
242
|
+
const [resolvedHost, setResolvedHost] = React33__namespace.default.useState(host ?? "");
|
|
243
|
+
React33__namespace.default.useEffect(() => {
|
|
244
|
+
if (host !== void 0) return;
|
|
245
|
+
const browserHost = currentHost();
|
|
246
|
+
if (browserHost) setResolvedHost(browserHost);
|
|
247
|
+
}, [host]);
|
|
248
|
+
return React33__namespace.default.useMemo(() => resolveWhiteLabel(resolvedHost), [resolvedHost]);
|
|
249
|
+
};
|
|
250
|
+
var AppProvider = ({
|
|
251
|
+
children,
|
|
252
|
+
queryClient,
|
|
253
|
+
host,
|
|
254
|
+
defaultTheme
|
|
255
|
+
}) => {
|
|
256
|
+
useFontBodyReset();
|
|
257
|
+
const whiteLabel = useHostWhiteLabel(host);
|
|
258
|
+
const theme = defaultTheme ?? whiteLabel.theme;
|
|
259
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WhiteLabelContext.Provider, { value: whiteLabel, children: /* @__PURE__ */ jsxRuntime.jsx(gui.GuiProvider, { config: lux_config_default, defaultTheme: theme, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient ?? defaultQueryClient, children }) }) });
|
|
260
|
+
};
|
|
261
|
+
function cn(...inputs) {
|
|
262
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
263
|
+
}
|
|
264
|
+
var NARROW_PX = 640;
|
|
265
|
+
var TOUCH_PX = 1024;
|
|
266
|
+
function useBelow(px) {
|
|
267
|
+
const [below, setBelow] = React33__namespace.useState(false);
|
|
268
|
+
React33__namespace.useEffect(() => {
|
|
269
|
+
const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
|
|
270
|
+
const apply = () => setBelow(mql.matches);
|
|
271
|
+
apply();
|
|
272
|
+
mql.addEventListener("change", apply);
|
|
273
|
+
return () => mql.removeEventListener("change", apply);
|
|
274
|
+
}, [px]);
|
|
275
|
+
return below;
|
|
276
|
+
}
|
|
277
|
+
var useIsNarrow = () => useBelow(NARROW_PX);
|
|
278
|
+
var useIsTouch = () => useBelow(TOUCH_PX);
|
|
279
|
+
|
|
280
|
+
// src/iam.ts
|
|
281
|
+
var IamError = class extends Error {
|
|
282
|
+
constructor(message, status, unauthenticated) {
|
|
283
|
+
super(message);
|
|
284
|
+
this.name = "IamError";
|
|
285
|
+
this.status = status;
|
|
286
|
+
this.unauthenticated = unauthenticated;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
|
|
290
|
+
function isSignedOut(status, msg) {
|
|
291
|
+
return status === 401 || status === 403 || SIGNED_OUT.test(msg);
|
|
292
|
+
}
|
|
293
|
+
function iamBase(host) {
|
|
294
|
+
const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
|
|
295
|
+
return `${wl.issuer}/v1/iam`;
|
|
296
|
+
}
|
|
297
|
+
async function read(call, verb, params) {
|
|
298
|
+
const url = new URL(`${call.base}/${verb}`);
|
|
299
|
+
for (const [k, v] of Object.entries(params)) url.searchParams.set(k, String(v));
|
|
300
|
+
let res;
|
|
301
|
+
try {
|
|
302
|
+
res = await fetch(url.toString(), {
|
|
303
|
+
method: "GET",
|
|
304
|
+
// The bearer is the whole credential. IAM does not allow credentialed
|
|
305
|
+
// CORS, so sending cookies would only get the response blocked.
|
|
306
|
+
headers: call.token ? { Authorization: `Bearer ${call.token}` } : {},
|
|
307
|
+
signal: call.signal
|
|
308
|
+
});
|
|
309
|
+
} catch (e) {
|
|
310
|
+
throw new IamError(e instanceof Error ? e.message : "IAM unreachable", 0, false);
|
|
311
|
+
}
|
|
312
|
+
const body = await res.json().catch(() => ({}));
|
|
313
|
+
const msg = typeof body.msg === "string" ? body.msg : "";
|
|
314
|
+
if (!res.ok || body.status === "error") {
|
|
315
|
+
throw new IamError(msg || `IAM ${verb} failed (${res.status})`, res.status, isSignedOut(res.status, msg));
|
|
316
|
+
}
|
|
317
|
+
return body.data;
|
|
318
|
+
}
|
|
319
|
+
var IAM_PAGE_SIZE = 20;
|
|
320
|
+
var iam = {
|
|
321
|
+
/** The signed-in principal, or null when there is no session. */
|
|
322
|
+
async account(call) {
|
|
323
|
+
try {
|
|
324
|
+
const data = await read(call, "get-account", {});
|
|
325
|
+
return data && data.name ? data : null;
|
|
326
|
+
} catch (e) {
|
|
327
|
+
if (e instanceof IamError && e.unauthenticated) return null;
|
|
328
|
+
throw e;
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
/**
|
|
332
|
+
* One page of the orgs the principal can see. IAM scopes the read to the
|
|
333
|
+
* caller's authority, so a normal member gets their own org and a super
|
|
334
|
+
* admin gets the tenant list — the page never has to decide.
|
|
335
|
+
*/
|
|
336
|
+
async organizations(call, page = 0, query = "", pageSize = IAM_PAGE_SIZE) {
|
|
337
|
+
const params = {
|
|
338
|
+
owner: "admin",
|
|
339
|
+
// IAM orgs live under the reserved `admin` owner
|
|
340
|
+
p: page + 1,
|
|
341
|
+
// the backend page is 1-based
|
|
342
|
+
pageSize,
|
|
343
|
+
sortField: "name",
|
|
344
|
+
sortOrder: "ascending"
|
|
345
|
+
};
|
|
346
|
+
const q = query.trim();
|
|
347
|
+
if (q) {
|
|
348
|
+
params.field = "name";
|
|
349
|
+
params.value = q;
|
|
350
|
+
}
|
|
351
|
+
return await read(call, "get-organizations", params) ?? [];
|
|
352
|
+
},
|
|
353
|
+
/** One organization by name. */
|
|
354
|
+
async organization(call, name) {
|
|
355
|
+
return await read(call, "get-organization", { id: `admin/${name}` }) ?? null;
|
|
356
|
+
},
|
|
357
|
+
/** Members of an organization. */
|
|
358
|
+
async users(call, org) {
|
|
359
|
+
return await read(call, "get-users", { owner: org }) ?? [];
|
|
360
|
+
},
|
|
361
|
+
/** The organization's projects — IAM keys this read by `organization`. */
|
|
362
|
+
async projects(call, org) {
|
|
363
|
+
return await read(call, "get-organization-projects", { organization: org }) ?? [];
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
var IAM_TOKEN_KEY = "hanzo_iam_access_token";
|
|
367
|
+
function storedToken() {
|
|
368
|
+
if (typeof window === "undefined") return null;
|
|
369
|
+
for (const store of [window.sessionStorage, window.localStorage]) {
|
|
370
|
+
try {
|
|
371
|
+
const t = store.getItem(IAM_TOKEN_KEY);
|
|
372
|
+
if (t) return t;
|
|
373
|
+
} catch {
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
function clearStoredTokens() {
|
|
379
|
+
if (typeof window === "undefined") return;
|
|
380
|
+
for (const store of [window.sessionStorage, window.localStorage]) {
|
|
381
|
+
try {
|
|
382
|
+
for (const k of ["access_token", "refresh_token", "id_token", "expires_at"]) {
|
|
383
|
+
store.removeItem(`hanzo_iam_${k}`);
|
|
384
|
+
}
|
|
385
|
+
} catch {
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
var defaultAuth = {};
|
|
390
|
+
var scopeKey = (host, kind) => `lux-ui:${kind}:${host}`;
|
|
391
|
+
function readScope(host, kind) {
|
|
392
|
+
if (typeof window === "undefined") return null;
|
|
393
|
+
try {
|
|
394
|
+
return window.localStorage.getItem(scopeKey(host, kind));
|
|
395
|
+
} catch {
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function writeScope(host, kind, value) {
|
|
400
|
+
if (typeof window === "undefined") return;
|
|
401
|
+
try {
|
|
402
|
+
window.localStorage.setItem(scopeKey(host, kind), value);
|
|
403
|
+
} catch {
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
var IdentityContext = React33__namespace.createContext(null);
|
|
407
|
+
var IdentityProvider = ({
|
|
408
|
+
children,
|
|
409
|
+
auth = defaultAuth,
|
|
410
|
+
loginPath = "/login"
|
|
411
|
+
}) => {
|
|
412
|
+
const whiteLabel = useWhiteLabel();
|
|
413
|
+
const base = React33__namespace.useMemo(() => iamBase(whiteLabel), [whiteLabel]);
|
|
414
|
+
const [status, setStatus] = React33__namespace.useState("loading");
|
|
415
|
+
const [account, setAccount] = React33__namespace.useState(null);
|
|
416
|
+
const [orgs, setOrgs] = React33__namespace.useState([]);
|
|
417
|
+
const [projects, setProjects] = React33__namespace.useState([]);
|
|
418
|
+
const [error, setError] = React33__namespace.useState(null);
|
|
419
|
+
const [orgName, setOrgName] = React33__namespace.useState(null);
|
|
420
|
+
const [projectName, setProjectName] = React33__namespace.useState(null);
|
|
421
|
+
const [epoch, setEpoch] = React33__namespace.useState(0);
|
|
422
|
+
React33__namespace.useEffect(() => {
|
|
423
|
+
const ac = new AbortController();
|
|
424
|
+
let live = true;
|
|
425
|
+
void (async () => {
|
|
426
|
+
const token = await (auth.token ?? storedToken)();
|
|
427
|
+
if (!live) return;
|
|
428
|
+
if (!token) {
|
|
429
|
+
setStatus("anonymous");
|
|
430
|
+
setAccount(null);
|
|
431
|
+
setOrgs([]);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
const call = { base, token, signal: ac.signal };
|
|
435
|
+
try {
|
|
436
|
+
const me = await iam.account(call);
|
|
437
|
+
if (!live) return;
|
|
438
|
+
if (!me) {
|
|
439
|
+
setStatus("anonymous");
|
|
440
|
+
setAccount(null);
|
|
441
|
+
setOrgs([]);
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
setAccount(me);
|
|
445
|
+
const rows = await iam.organizations(call).catch((e) => {
|
|
446
|
+
if (e instanceof IamError && !e.unauthenticated) return [{ owner: "admin", name: me.owner }];
|
|
447
|
+
throw e;
|
|
448
|
+
});
|
|
449
|
+
if (!live) return;
|
|
450
|
+
setOrgs(rows);
|
|
451
|
+
setStatus("ready");
|
|
452
|
+
setError(null);
|
|
453
|
+
} catch (e) {
|
|
454
|
+
if (!live || ac.signal.aborted) return;
|
|
455
|
+
if (e instanceof IamError && e.unauthenticated) {
|
|
456
|
+
setStatus("anonymous");
|
|
457
|
+
setAccount(null);
|
|
458
|
+
setOrgs([]);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
setStatus("error");
|
|
462
|
+
setError(e instanceof Error ? e.message : "Could not reach IAM.");
|
|
463
|
+
}
|
|
464
|
+
})();
|
|
465
|
+
return () => {
|
|
466
|
+
live = false;
|
|
467
|
+
ac.abort();
|
|
468
|
+
};
|
|
469
|
+
}, [base, auth, epoch]);
|
|
470
|
+
const org = React33__namespace.useMemo(() => {
|
|
471
|
+
if (orgs.length === 0) return null;
|
|
472
|
+
const saved = orgName ?? readScope(whiteLabel.host, "org");
|
|
473
|
+
return orgs.find((o) => o.name === saved) ?? orgs.find((o) => o.name === account?.owner) ?? orgs[0];
|
|
474
|
+
}, [orgs, orgName, account, whiteLabel.host]);
|
|
475
|
+
React33__namespace.useEffect(() => {
|
|
476
|
+
if (!org) {
|
|
477
|
+
setProjects([]);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
const ac = new AbortController();
|
|
481
|
+
let live = true;
|
|
482
|
+
void (async () => {
|
|
483
|
+
const token = await (auth.token ?? storedToken)();
|
|
484
|
+
if (!live || !token) return;
|
|
485
|
+
const rows = await iam.projects({ base, token, signal: ac.signal }, org.name).catch(() => []);
|
|
486
|
+
if (live) setProjects(rows);
|
|
487
|
+
})();
|
|
488
|
+
return () => {
|
|
489
|
+
live = false;
|
|
490
|
+
ac.abort();
|
|
491
|
+
};
|
|
492
|
+
}, [base, auth, org, epoch]);
|
|
493
|
+
const project = React33__namespace.useMemo(() => {
|
|
494
|
+
if (projects.length === 0) return null;
|
|
495
|
+
const saved = projectName ?? readScope(whiteLabel.host, "project");
|
|
496
|
+
return projects.find((p) => p.name === saved) ?? projects.find((p) => p.isDefault) ?? projects[0];
|
|
497
|
+
}, [projects, projectName, whiteLabel.host]);
|
|
498
|
+
const value = React33__namespace.useMemo(() => ({
|
|
499
|
+
status,
|
|
500
|
+
account,
|
|
501
|
+
orgs,
|
|
502
|
+
org,
|
|
503
|
+
projects,
|
|
504
|
+
project,
|
|
505
|
+
error,
|
|
506
|
+
whiteLabel,
|
|
507
|
+
setOrg: (name) => {
|
|
508
|
+
writeScope(whiteLabel.host, "org", name);
|
|
509
|
+
setOrgName(name);
|
|
510
|
+
setProjectName(null);
|
|
511
|
+
},
|
|
512
|
+
setProject: (name) => {
|
|
513
|
+
writeScope(whiteLabel.host, "project", name);
|
|
514
|
+
setProjectName(name);
|
|
515
|
+
},
|
|
516
|
+
signIn: () => {
|
|
517
|
+
if (auth.signIn) return auth.signIn();
|
|
518
|
+
if (typeof window !== "undefined") window.location.assign(loginPath);
|
|
519
|
+
},
|
|
520
|
+
signOut: () => {
|
|
521
|
+
if (auth.signOut) return auth.signOut();
|
|
522
|
+
clearStoredTokens();
|
|
523
|
+
if (typeof window !== "undefined") window.location.assign(loginPath);
|
|
524
|
+
},
|
|
525
|
+
reload: () => setEpoch((n) => n + 1)
|
|
526
|
+
}), [status, account, orgs, org, projects, project, error, whiteLabel, auth, loginPath]);
|
|
527
|
+
return /* @__PURE__ */ jsxRuntime.jsx(IdentityContext.Provider, { value, children });
|
|
528
|
+
};
|
|
529
|
+
function useIdentity() {
|
|
530
|
+
const ctx = React33__namespace.useContext(IdentityContext);
|
|
531
|
+
const whiteLabel = useWhiteLabel();
|
|
532
|
+
const fallback = React33__namespace.useMemo(() => ({
|
|
533
|
+
status: "anonymous",
|
|
534
|
+
account: null,
|
|
535
|
+
orgs: [],
|
|
536
|
+
org: null,
|
|
537
|
+
projects: [],
|
|
538
|
+
project: null,
|
|
539
|
+
error: null,
|
|
540
|
+
whiteLabel,
|
|
541
|
+
setOrg: () => void 0,
|
|
542
|
+
setProject: () => void 0,
|
|
543
|
+
signIn: () => {
|
|
544
|
+
if (typeof window !== "undefined") window.location.assign("/login");
|
|
545
|
+
},
|
|
546
|
+
signOut: () => void 0,
|
|
547
|
+
reload: () => void 0
|
|
548
|
+
}), [whiteLabel]);
|
|
549
|
+
return ctx ?? fallback;
|
|
550
|
+
}
|
|
551
|
+
var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
|
|
552
|
+
var CloseButtonFrame = gui.styled(gui.View, {
|
|
553
|
+
name: "LuxCloseButton",
|
|
554
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
|
|
555
|
+
role: "button",
|
|
556
|
+
cursor: "pointer",
|
|
557
|
+
display: "inline-flex",
|
|
558
|
+
alignItems: "center",
|
|
559
|
+
justifyContent: "center",
|
|
560
|
+
width: 20,
|
|
561
|
+
height: 20,
|
|
562
|
+
minWidth: 0,
|
|
563
|
+
flexShrink: 1,
|
|
564
|
+
padding: 0,
|
|
565
|
+
borderRadius: 4,
|
|
566
|
+
borderWidth: 0,
|
|
567
|
+
overflow: "hidden",
|
|
568
|
+
backgroundColor: "transparent",
|
|
569
|
+
hoverStyle: {
|
|
570
|
+
backgroundColor: "transparent"
|
|
571
|
+
},
|
|
572
|
+
variants: {
|
|
573
|
+
disabled: {
|
|
574
|
+
true: {
|
|
575
|
+
opacity: 0.4,
|
|
576
|
+
pointerEvents: "none"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
var CLOSE_BUTTON_CLASSES = [
|
|
582
|
+
"text-[var(--closeButton-fg,currentColor)]",
|
|
583
|
+
"hover:text-[var(--hover-color,currentColor)]",
|
|
584
|
+
"disabled:opacity-40"
|
|
585
|
+
].join(" ");
|
|
586
|
+
var CloseButton = React33__namespace.forwardRef(function CloseButton2(props, ref) {
|
|
587
|
+
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
588
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
589
|
+
CloseButtonFrame,
|
|
590
|
+
{
|
|
591
|
+
ref,
|
|
592
|
+
className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
|
|
593
|
+
...rest,
|
|
594
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
595
|
+
"svg",
|
|
596
|
+
{
|
|
597
|
+
className: "size-5",
|
|
598
|
+
viewBox: "0 0 20 20",
|
|
599
|
+
fill: "none",
|
|
600
|
+
"aria-hidden": "true",
|
|
601
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
602
|
+
"path",
|
|
603
|
+
{
|
|
604
|
+
d: CLOSE_ICON_PATH,
|
|
605
|
+
fill: "currentColor"
|
|
606
|
+
}
|
|
607
|
+
)
|
|
608
|
+
}
|
|
609
|
+
)
|
|
610
|
+
}
|
|
611
|
+
);
|
|
612
|
+
});
|
|
613
|
+
var DrawerPlacementContext = React33__namespace.createContext("right");
|
|
614
|
+
var DrawerSizeContext = React33__namespace.createContext("md");
|
|
615
|
+
var DrawerStateContext = React33__namespace.createContext({
|
|
616
|
+
open: false,
|
|
617
|
+
setOpen: () => {
|
|
618
|
+
},
|
|
619
|
+
modal: true
|
|
620
|
+
});
|
|
621
|
+
var DrawerRoot = (props) => {
|
|
622
|
+
const {
|
|
623
|
+
children,
|
|
624
|
+
open,
|
|
625
|
+
defaultOpen,
|
|
626
|
+
onOpenChange,
|
|
627
|
+
placement = "right",
|
|
628
|
+
modal = true,
|
|
629
|
+
size = "md"
|
|
630
|
+
} = props;
|
|
631
|
+
const [uncontrolled, setUncontrolled] = React33__namespace.useState(defaultOpen ?? false);
|
|
632
|
+
const isControlled = open !== void 0;
|
|
633
|
+
const isOpen = isControlled ? open : uncontrolled;
|
|
634
|
+
const setOpen = React33__namespace.useCallback((nextOpen) => {
|
|
635
|
+
if (!isControlled) setUncontrolled(nextOpen);
|
|
636
|
+
onOpenChange?.({ open: nextOpen });
|
|
637
|
+
}, [isControlled, onOpenChange]);
|
|
638
|
+
const state = React33__namespace.useMemo(
|
|
639
|
+
() => ({ open: isOpen, setOpen, modal }),
|
|
640
|
+
[isOpen, setOpen, modal]
|
|
641
|
+
);
|
|
642
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
643
|
+
RadixDialog__namespace.Root,
|
|
644
|
+
{
|
|
645
|
+
open: isOpen,
|
|
646
|
+
onOpenChange: setOpen,
|
|
647
|
+
modal,
|
|
648
|
+
children
|
|
649
|
+
}
|
|
650
|
+
) }) }) });
|
|
651
|
+
};
|
|
652
|
+
var PLACEMENT_CLASSES = {
|
|
653
|
+
right: [
|
|
654
|
+
"inset-y-0 right-0",
|
|
655
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
|
|
656
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
|
|
657
|
+
].join(" "),
|
|
658
|
+
left: [
|
|
659
|
+
"inset-y-0 left-0",
|
|
660
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
|
|
661
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
|
|
662
|
+
].join(" "),
|
|
663
|
+
top: [
|
|
664
|
+
"inset-x-0 top-0",
|
|
665
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
|
|
666
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
|
|
667
|
+
].join(" "),
|
|
668
|
+
bottom: [
|
|
669
|
+
"inset-x-0 bottom-0",
|
|
670
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
|
|
671
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
|
|
672
|
+
].join(" ")
|
|
673
|
+
};
|
|
674
|
+
var SIZE_CLASSES = {
|
|
675
|
+
right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
676
|
+
left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
677
|
+
top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
|
|
678
|
+
bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
|
|
679
|
+
};
|
|
680
|
+
var DrawerContent = React33__namespace.forwardRef(
|
|
681
|
+
function DrawerContent2(props, ref) {
|
|
682
|
+
const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
|
|
683
|
+
const placement = React33__namespace.useContext(DrawerPlacementContext);
|
|
684
|
+
const size = React33__namespace.useContext(DrawerSizeContext);
|
|
685
|
+
const { open, setOpen, modal } = React33__namespace.useContext(DrawerStateContext);
|
|
686
|
+
const isNarrow = useIsNarrow();
|
|
687
|
+
if (isNarrow) {
|
|
688
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
689
|
+
gui.Sheet,
|
|
690
|
+
{
|
|
691
|
+
open,
|
|
692
|
+
onOpenChange: setOpen,
|
|
693
|
+
modal,
|
|
694
|
+
dismissOnSnapToBottom: true,
|
|
695
|
+
snapPointsMode: "percent",
|
|
696
|
+
snapPoints: [88],
|
|
697
|
+
transition: "medium",
|
|
698
|
+
children: [
|
|
699
|
+
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
700
|
+
gui.Sheet.Overlay,
|
|
701
|
+
{
|
|
702
|
+
transition: "lazy",
|
|
703
|
+
enterStyle: { opacity: 0 },
|
|
704
|
+
exitStyle: { opacity: 0 },
|
|
705
|
+
className: "bg-black/50"
|
|
706
|
+
}
|
|
707
|
+
),
|
|
708
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Sheet.Handle, {}),
|
|
709
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
710
|
+
gui.Sheet.Frame,
|
|
711
|
+
{
|
|
712
|
+
unstyled: true,
|
|
713
|
+
className: cn(
|
|
714
|
+
"flex flex-col rounded-t-2xl bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)]",
|
|
715
|
+
className
|
|
716
|
+
),
|
|
717
|
+
...rest,
|
|
718
|
+
children
|
|
719
|
+
}
|
|
720
|
+
)
|
|
721
|
+
]
|
|
722
|
+
}
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
726
|
+
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
727
|
+
RadixDialog__namespace.Overlay,
|
|
728
|
+
{
|
|
729
|
+
className: cn(
|
|
730
|
+
"fixed inset-0 z-50 bg-black/50",
|
|
731
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
732
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
|
|
733
|
+
)
|
|
734
|
+
}
|
|
735
|
+
),
|
|
736
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
737
|
+
RadixDialog__namespace.Content,
|
|
738
|
+
{
|
|
739
|
+
ref,
|
|
740
|
+
className: cn(
|
|
741
|
+
"fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
|
|
742
|
+
PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
|
|
743
|
+
SIZE_CLASSES[placement]?.[size] ?? SIZE_CLASSES.right?.md,
|
|
744
|
+
className
|
|
745
|
+
),
|
|
746
|
+
...rest,
|
|
747
|
+
children
|
|
748
|
+
}
|
|
749
|
+
)
|
|
750
|
+
] });
|
|
751
|
+
if (portalled) {
|
|
752
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
753
|
+
}
|
|
754
|
+
return content;
|
|
755
|
+
}
|
|
756
|
+
);
|
|
757
|
+
var DrawerCloseTrigger = React33__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
758
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
759
|
+
CloseButton,
|
|
760
|
+
{
|
|
761
|
+
ref,
|
|
762
|
+
className: cn("absolute top-7 right-5", props.className),
|
|
763
|
+
...props
|
|
764
|
+
}
|
|
765
|
+
) });
|
|
766
|
+
});
|
|
767
|
+
var DrawerTrigger = (props) => {
|
|
768
|
+
const { asChild = true, ...rest } = props;
|
|
769
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Trigger, { asChild, ...rest });
|
|
770
|
+
};
|
|
771
|
+
var DrawerHeader = React33__namespace.forwardRef(
|
|
772
|
+
function DrawerHeader2({ className, ...props }, ref) {
|
|
773
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
|
|
774
|
+
}
|
|
775
|
+
);
|
|
776
|
+
var DrawerBody = React33__namespace.forwardRef(
|
|
777
|
+
function DrawerBody2({ className, ...props }, ref) {
|
|
778
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
|
|
779
|
+
}
|
|
780
|
+
);
|
|
781
|
+
var DrawerFooter = React33__namespace.forwardRef(
|
|
782
|
+
function DrawerFooter2({ className, ...props }, ref) {
|
|
783
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
|
|
784
|
+
}
|
|
785
|
+
);
|
|
786
|
+
var DrawerTitle = RadixDialog__namespace.Title;
|
|
787
|
+
var DrawerDescription = RadixDialog__namespace.Description;
|
|
788
|
+
var DrawerActionTrigger = RadixDialog__namespace.Close;
|
|
789
|
+
function parsePlacement(placement) {
|
|
790
|
+
if (!placement) {
|
|
791
|
+
return { side: "bottom", align: "start" };
|
|
792
|
+
}
|
|
793
|
+
const parts = placement.split("-");
|
|
794
|
+
const side = parts[0] ?? "bottom";
|
|
795
|
+
const alignPart = parts[1];
|
|
796
|
+
let align = "center";
|
|
797
|
+
if (alignPart === "start") {
|
|
798
|
+
align = "start";
|
|
799
|
+
} else if (alignPart === "end") {
|
|
800
|
+
align = "end";
|
|
801
|
+
}
|
|
802
|
+
return { side, align };
|
|
803
|
+
}
|
|
804
|
+
var PositioningContext = React33__namespace.createContext({
|
|
805
|
+
side: "bottom",
|
|
806
|
+
align: "start",
|
|
807
|
+
sideOffset: 4,
|
|
808
|
+
alignOffset: 0
|
|
809
|
+
});
|
|
810
|
+
var MenuRoot = (props) => {
|
|
811
|
+
const {
|
|
812
|
+
children,
|
|
813
|
+
open,
|
|
814
|
+
defaultOpen,
|
|
815
|
+
onOpenChange,
|
|
816
|
+
positioning,
|
|
817
|
+
modal = true,
|
|
818
|
+
// lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
|
|
819
|
+
// mount/unmount automatically.
|
|
820
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
821
|
+
lazyMount: _lazyMount,
|
|
822
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
823
|
+
unmountOnExit: _unmountOnExit
|
|
824
|
+
} = props;
|
|
825
|
+
const mergedPositioning = {
|
|
826
|
+
placement: "bottom-start",
|
|
827
|
+
...positioning,
|
|
828
|
+
offset: {
|
|
829
|
+
mainAxis: 4,
|
|
830
|
+
...positioning?.offset
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
const { side, align } = parsePlacement(mergedPositioning.placement);
|
|
834
|
+
const positioningValue = React33__namespace.useMemo(() => ({
|
|
835
|
+
side,
|
|
836
|
+
align,
|
|
837
|
+
sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
|
|
838
|
+
alignOffset: mergedPositioning.offset?.crossAxis ?? 0
|
|
839
|
+
}), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
|
|
840
|
+
const handleOpenChange = React33__namespace.useCallback((isOpen) => {
|
|
841
|
+
onOpenChange?.({ open: isOpen });
|
|
842
|
+
}, [onOpenChange]);
|
|
843
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
844
|
+
DropdownMenu__namespace.Root,
|
|
845
|
+
{
|
|
846
|
+
open,
|
|
847
|
+
defaultOpen,
|
|
848
|
+
onOpenChange: handleOpenChange,
|
|
849
|
+
modal,
|
|
850
|
+
children
|
|
851
|
+
}
|
|
852
|
+
) });
|
|
853
|
+
};
|
|
854
|
+
var MenuTrigger = React33__namespace.forwardRef(function MenuTrigger2(props, ref) {
|
|
855
|
+
const { asChild = false, ...rest } = props;
|
|
856
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild, ref, ...rest });
|
|
857
|
+
});
|
|
858
|
+
var MenuContent = React33__namespace.forwardRef(function MenuContent2(props, ref) {
|
|
859
|
+
const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
|
|
860
|
+
const positioning = React33__namespace.useContext(PositioningContext);
|
|
861
|
+
const mergedStyle = {
|
|
862
|
+
...style,
|
|
863
|
+
...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
|
|
864
|
+
...minW !== void 0 ? { minWidth: minW } : {}
|
|
865
|
+
};
|
|
866
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
867
|
+
DropdownMenu__namespace.Content,
|
|
868
|
+
{
|
|
869
|
+
ref,
|
|
870
|
+
side: positioning.side,
|
|
871
|
+
align: positioning.align,
|
|
872
|
+
sideOffset: positioning.sideOffset,
|
|
873
|
+
alignOffset: positioning.alignOffset,
|
|
874
|
+
className: cn(
|
|
875
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
|
|
876
|
+
"border border-[var(--color-popover-border,var(--color-border-divider))]",
|
|
877
|
+
"bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
|
|
878
|
+
"shadow-[0_4px_12px_var(--color-popover-shadow)]",
|
|
879
|
+
"outline-none",
|
|
880
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
881
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
882
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
883
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
884
|
+
className
|
|
885
|
+
),
|
|
886
|
+
style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
|
|
887
|
+
...rest
|
|
888
|
+
}
|
|
889
|
+
);
|
|
890
|
+
if (!portalled) {
|
|
891
|
+
return content;
|
|
892
|
+
}
|
|
893
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
894
|
+
});
|
|
895
|
+
var MenuItem = React33__namespace.forwardRef(function MenuItem2(props, ref) {
|
|
896
|
+
const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
|
|
897
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
898
|
+
DropdownMenu__namespace.Item,
|
|
899
|
+
{
|
|
900
|
+
ref,
|
|
901
|
+
asChild,
|
|
902
|
+
disabled,
|
|
903
|
+
onClick,
|
|
904
|
+
className: cn(
|
|
905
|
+
"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
|
|
906
|
+
"outline-none transition-colors",
|
|
907
|
+
"text-[var(--color-text-primary,inherit)]",
|
|
908
|
+
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
909
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
910
|
+
className
|
|
911
|
+
),
|
|
912
|
+
...rest,
|
|
913
|
+
children
|
|
914
|
+
}
|
|
915
|
+
);
|
|
916
|
+
});
|
|
917
|
+
var MenuItemText = React33__namespace.forwardRef(function MenuItemText2(props, ref) {
|
|
918
|
+
const { className, ...rest } = props;
|
|
919
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn("flex-1", className), ...rest });
|
|
920
|
+
});
|
|
921
|
+
React33__namespace.forwardRef(function MenuItemCommand2(props, ref) {
|
|
922
|
+
const { className, ...rest } = props;
|
|
923
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
924
|
+
"span",
|
|
925
|
+
{
|
|
926
|
+
ref,
|
|
927
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
928
|
+
...rest
|
|
929
|
+
}
|
|
930
|
+
);
|
|
931
|
+
});
|
|
932
|
+
var MenuSeparator = React33__namespace.forwardRef(function MenuSeparator2(props, ref) {
|
|
933
|
+
const { className, ...rest } = props;
|
|
934
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
935
|
+
DropdownMenu__namespace.Separator,
|
|
936
|
+
{
|
|
937
|
+
ref,
|
|
938
|
+
className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
|
|
939
|
+
...rest
|
|
940
|
+
}
|
|
941
|
+
);
|
|
942
|
+
});
|
|
943
|
+
var MenuItemGroup = React33__namespace.forwardRef(function MenuItemGroup2(props, ref) {
|
|
944
|
+
const { title, children, className, ...rest } = props;
|
|
945
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Group, { ref, className, ...rest, children: [
|
|
946
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
|
|
947
|
+
children
|
|
948
|
+
] });
|
|
949
|
+
});
|
|
950
|
+
var MenuArrow = React33__namespace.forwardRef(function MenuArrow2(props, ref) {
|
|
951
|
+
const { className, ...rest } = props;
|
|
952
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
953
|
+
DropdownMenu__namespace.Arrow,
|
|
954
|
+
{
|
|
955
|
+
ref,
|
|
956
|
+
className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
|
|
957
|
+
...rest
|
|
958
|
+
}
|
|
959
|
+
);
|
|
960
|
+
});
|
|
961
|
+
var MenuCheckboxItem = React33__namespace.forwardRef(function MenuCheckboxItem2(props, ref) {
|
|
962
|
+
const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
|
|
963
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
964
|
+
DropdownMenu__namespace.CheckboxItem,
|
|
965
|
+
{
|
|
966
|
+
ref,
|
|
967
|
+
checked,
|
|
968
|
+
onCheckedChange,
|
|
969
|
+
onClick,
|
|
970
|
+
className: cn(
|
|
971
|
+
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
|
|
972
|
+
"outline-none transition-colors",
|
|
973
|
+
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
974
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
975
|
+
className
|
|
976
|
+
),
|
|
977
|
+
...rest,
|
|
978
|
+
children: [
|
|
979
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
980
|
+
children
|
|
981
|
+
]
|
|
982
|
+
}
|
|
983
|
+
);
|
|
984
|
+
});
|
|
985
|
+
var MenuRadioItemGroup = React33__namespace.forwardRef(function MenuRadioItemGroup2(props, ref) {
|
|
986
|
+
const { value, onValueChange, ...rest } = props;
|
|
987
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
988
|
+
DropdownMenu__namespace.RadioGroup,
|
|
989
|
+
{
|
|
990
|
+
ref,
|
|
991
|
+
value,
|
|
992
|
+
onValueChange,
|
|
993
|
+
...rest
|
|
994
|
+
}
|
|
995
|
+
);
|
|
996
|
+
});
|
|
997
|
+
var MenuRadioItem = React33__namespace.forwardRef(function MenuRadioItem2(props, ref) {
|
|
998
|
+
const { className, children, value, onClick, ...rest } = props;
|
|
999
|
+
const { value: _v, ...radixRest } = rest;
|
|
1000
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1001
|
+
DropdownMenu__namespace.RadioItem,
|
|
1002
|
+
{
|
|
1003
|
+
ref,
|
|
1004
|
+
value,
|
|
1005
|
+
onClick,
|
|
1006
|
+
className: cn(
|
|
1007
|
+
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
|
|
1008
|
+
"outline-none transition-colors",
|
|
1009
|
+
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
1010
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1011
|
+
className
|
|
1012
|
+
),
|
|
1013
|
+
children: [
|
|
1014
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
1015
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
);
|
|
1019
|
+
});
|
|
1020
|
+
React33__namespace.forwardRef(function MenuContextTrigger2(props, ref) {
|
|
1021
|
+
const { asChild: _asChild, ...rest } = props;
|
|
1022
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, ...rest });
|
|
1023
|
+
});
|
|
1024
|
+
var MenuTriggerItem = React33__namespace.forwardRef(function MenuTriggerItem2(props, ref) {
|
|
1025
|
+
const { startIcon, children, className, ...rest } = props;
|
|
1026
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1027
|
+
DropdownMenu__namespace.SubTrigger,
|
|
1028
|
+
{
|
|
1029
|
+
ref,
|
|
1030
|
+
className: cn(
|
|
1031
|
+
"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
|
|
1032
|
+
"outline-none transition-colors",
|
|
1033
|
+
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
1034
|
+
className
|
|
1035
|
+
),
|
|
1036
|
+
...rest,
|
|
1037
|
+
children: [
|
|
1038
|
+
startIcon,
|
|
1039
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children }),
|
|
1040
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
1041
|
+
]
|
|
1042
|
+
}
|
|
1043
|
+
) });
|
|
1044
|
+
});
|
|
1045
|
+
function initials(label) {
|
|
1046
|
+
return label.split(/[\s._-]+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2).toUpperCase();
|
|
1047
|
+
}
|
|
1048
|
+
var Monogram = ({ label, logo }) => logo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: "", className: "h-5 w-5 shrink-0 rounded object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1049
|
+
"span",
|
|
1050
|
+
{
|
|
1051
|
+
"aria-hidden": "true",
|
|
1052
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-[rgba(127,127,127,0.22)] text-[10px] font-bold",
|
|
1053
|
+
children: initials(label)
|
|
1054
|
+
}
|
|
1055
|
+
);
|
|
1056
|
+
var Row = ({ item, onDone, menu }) => {
|
|
1057
|
+
const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1058
|
+
item.icon,
|
|
1059
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: item.label }),
|
|
1060
|
+
item.hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs opacity-60", children: item.hint }) : null,
|
|
1061
|
+
item.selected ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" }) : null
|
|
1062
|
+
] });
|
|
1063
|
+
const className = cn(
|
|
1064
|
+
"flex w-full cursor-pointer select-none items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm",
|
|
1065
|
+
"hover:bg-[rgba(127,127,127,0.14)]",
|
|
1066
|
+
item.danger && "text-[var(--color-text-error,#e5484d)]"
|
|
1067
|
+
);
|
|
1068
|
+
const activate = () => {
|
|
1069
|
+
onDone();
|
|
1070
|
+
item.onSelect?.();
|
|
1071
|
+
};
|
|
1072
|
+
const shared = {
|
|
1073
|
+
"data-testid": `chrome-item-${item.id}`,
|
|
1074
|
+
"aria-current": item.selected ? "true" : void 0,
|
|
1075
|
+
className
|
|
1076
|
+
};
|
|
1077
|
+
const control = item.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, ...shared, onClick: onDone, children: body }) : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", ...shared, onClick: activate, children: body });
|
|
1078
|
+
return menu ? /* @__PURE__ */ jsxRuntime.jsx(MenuItem, { value: item.id, asChild: true, children: control }) : control;
|
|
1079
|
+
};
|
|
1080
|
+
var Switcher = ({
|
|
1081
|
+
title,
|
|
1082
|
+
label,
|
|
1083
|
+
icon,
|
|
1084
|
+
items,
|
|
1085
|
+
footer = [],
|
|
1086
|
+
status = "ready",
|
|
1087
|
+
empty = "Nothing here yet.",
|
|
1088
|
+
onSignIn,
|
|
1089
|
+
signInLabel = "Sign in",
|
|
1090
|
+
error,
|
|
1091
|
+
align = "start",
|
|
1092
|
+
testId
|
|
1093
|
+
}) => {
|
|
1094
|
+
const [open, setOpen] = React33__namespace.useState(false);
|
|
1095
|
+
const narrow = useIsNarrow();
|
|
1096
|
+
const close = React33__namespace.useCallback(() => setOpen(false), []);
|
|
1097
|
+
const message = status === "loading" ? "Loading\u2026" : status === "error" ? error ?? "Could not reach IAM." : status === "anonymous" ? null : items.length === 0 ? empty : null;
|
|
1098
|
+
const rows = status === "anonymous" && onSignIn ? [{ id: "sign-in", label: signInLabel, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { "aria-hidden": "true", className: "h-4 w-4" }), onSelect: onSignIn }] : status === "ready" ? items : [];
|
|
1099
|
+
const panel = (menu) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1100
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide opacity-55", children: title }),
|
|
1101
|
+
message ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "chrome-message", className: "px-2 py-2 text-sm opacity-70", children: message }) : null,
|
|
1102
|
+
rows.map((item) => /* @__PURE__ */ jsxRuntime.jsx(Row, { item, onDone: close, menu }, item.id)),
|
|
1103
|
+
footer.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1104
|
+
menu ? /* @__PURE__ */ jsxRuntime.jsx(MenuSeparator, { className: "my-1 h-px bg-[var(--color-border-divider,rgba(127,127,127,0.25))]" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-[var(--color-border-divider,rgba(127,127,127,0.25))]" }),
|
|
1105
|
+
footer.map((item) => /* @__PURE__ */ jsxRuntime.jsx(Row, { item, onDone: close, menu }, item.id))
|
|
1106
|
+
] }) : null
|
|
1107
|
+
] });
|
|
1108
|
+
const trigger = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1109
|
+
"button",
|
|
1110
|
+
{
|
|
1111
|
+
type: "button",
|
|
1112
|
+
"data-testid": testId,
|
|
1113
|
+
"aria-label": title,
|
|
1114
|
+
"aria-haspopup": "menu",
|
|
1115
|
+
"aria-expanded": open,
|
|
1116
|
+
className: cn(
|
|
1117
|
+
"flex max-w-[14rem] items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium",
|
|
1118
|
+
"hover:bg-[rgba(127,127,127,0.14)]"
|
|
1119
|
+
),
|
|
1120
|
+
children: [
|
|
1121
|
+
icon,
|
|
1122
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label }),
|
|
1123
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { "aria-hidden": "true", className: "h-3.5 w-3.5 shrink-0 opacity-60" })
|
|
1124
|
+
]
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
if (narrow) {
|
|
1128
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DrawerRoot, { open, onOpenChange: (d) => setOpen(d.open), placement: "bottom", size: "md", children: [
|
|
1129
|
+
React33__namespace.cloneElement(trigger, { onClick: () => setOpen(true) }),
|
|
1130
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DrawerContent, { "data-testid": testId ? `${testId}-panel` : void 0, children: [
|
|
1131
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: title }) }),
|
|
1132
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerBody, { children: panel(false) })
|
|
1133
|
+
] })
|
|
1134
|
+
] });
|
|
1135
|
+
}
|
|
1136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1137
|
+
MenuRoot,
|
|
1138
|
+
{
|
|
1139
|
+
open,
|
|
1140
|
+
onOpenChange: (d) => setOpen(d.open),
|
|
1141
|
+
positioning: { placement: align === "end" ? "bottom-end" : "bottom-start" },
|
|
1142
|
+
children: [
|
|
1143
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuTrigger, { asChild: true, children: trigger }),
|
|
1144
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuContent, { minW: "16rem", "data-testid": testId ? `${testId}-panel` : void 0, children: panel(true) })
|
|
1145
|
+
]
|
|
1146
|
+
}
|
|
1147
|
+
);
|
|
1148
|
+
};
|
|
1149
|
+
var OrgSwitcher = () => {
|
|
1150
|
+
const id = useIdentity();
|
|
1151
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1152
|
+
Switcher,
|
|
1153
|
+
{
|
|
1154
|
+
testId: "org-switcher",
|
|
1155
|
+
title: "Organization",
|
|
1156
|
+
label: id.org?.displayName || id.org?.name || id.whiteLabel.name,
|
|
1157
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Monogram, { label: id.org?.displayName || id.org?.name || id.whiteLabel.name, logo: id.org?.logo }),
|
|
1158
|
+
status: id.status,
|
|
1159
|
+
error: id.error,
|
|
1160
|
+
empty: "No organizations for this account.",
|
|
1161
|
+
onSignIn: id.signIn,
|
|
1162
|
+
signInLabel: `Sign in with ${id.whiteLabel.iamDomain}`,
|
|
1163
|
+
items: id.orgs.map((o) => ({
|
|
1164
|
+
id: o.name,
|
|
1165
|
+
label: o.displayName || o.name,
|
|
1166
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Monogram, { label: o.displayName || o.name, logo: o.logo }),
|
|
1167
|
+
selected: o.name === id.org?.name,
|
|
1168
|
+
onSelect: () => id.setOrg(o.name)
|
|
1169
|
+
}))
|
|
1170
|
+
}
|
|
1171
|
+
);
|
|
1172
|
+
};
|
|
1173
|
+
var ProjectSwitcher = () => {
|
|
1174
|
+
const id = useIdentity();
|
|
1175
|
+
if (id.status === "ready" && id.projects.length === 0) return null;
|
|
1176
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1177
|
+
Switcher,
|
|
1178
|
+
{
|
|
1179
|
+
testId: "project-switcher",
|
|
1180
|
+
title: "Project",
|
|
1181
|
+
label: id.project?.displayName || id.project?.name || "Project",
|
|
1182
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Folder, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
|
|
1183
|
+
status: id.status,
|
|
1184
|
+
error: id.error,
|
|
1185
|
+
empty: "No projects in this organization.",
|
|
1186
|
+
onSignIn: id.signIn,
|
|
1187
|
+
items: id.projects.map((p) => ({
|
|
1188
|
+
id: p.name,
|
|
1189
|
+
label: p.displayName || p.name,
|
|
1190
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Folder, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
|
|
1191
|
+
selected: p.name === id.project?.name,
|
|
1192
|
+
onSelect: () => id.setProject(p.name)
|
|
1193
|
+
}))
|
|
1194
|
+
}
|
|
1195
|
+
);
|
|
92
1196
|
};
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
style.id = FONT_BODY_RESET_ID;
|
|
116
|
-
style.textContent = FONT_BODY_RESET_CSS;
|
|
117
|
-
document.head.appendChild(style);
|
|
118
|
-
}, []);
|
|
1197
|
+
var UserMenu = ({ items = [] }) => {
|
|
1198
|
+
const id = useIdentity();
|
|
1199
|
+
const who = id.account?.displayName || id.account?.email || id.account?.name || "Account";
|
|
1200
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1201
|
+
Switcher,
|
|
1202
|
+
{
|
|
1203
|
+
testId: "user-menu",
|
|
1204
|
+
align: "end",
|
|
1205
|
+
title: id.status === "ready" ? who : "Account",
|
|
1206
|
+
label: id.status === "ready" ? who : "Sign in",
|
|
1207
|
+
icon: id.status === "ready" ? /* @__PURE__ */ jsxRuntime.jsx(Monogram, { label: who, logo: id.account?.avatar }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
|
|
1208
|
+
status: id.status,
|
|
1209
|
+
error: id.error,
|
|
1210
|
+
onSignIn: id.signIn,
|
|
1211
|
+
signInLabel: `Sign in with ${id.whiteLabel.iamDomain}`,
|
|
1212
|
+
items: [
|
|
1213
|
+
{ id: "account", label: id.account?.email || who, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }) },
|
|
1214
|
+
...items
|
|
1215
|
+
],
|
|
1216
|
+
footer: id.status === "ready" ? [{ id: "sign-out", label: "Sign out", danger: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { "aria-hidden": "true", className: "h-4 w-4" }), onSelect: id.signOut }] : []
|
|
1217
|
+
}
|
|
1218
|
+
);
|
|
119
1219
|
};
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1220
|
+
var SettingsMenu = ({ items = [], href = "/settings" }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1221
|
+
Switcher,
|
|
1222
|
+
{
|
|
1223
|
+
testId: "settings-menu",
|
|
1224
|
+
align: "end",
|
|
1225
|
+
title: "Settings",
|
|
1226
|
+
label: "Settings",
|
|
1227
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
|
|
1228
|
+
items,
|
|
1229
|
+
empty: "No settings on this surface.",
|
|
1230
|
+
footer: [{ id: "all-settings", label: "All settings", href, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }) }]
|
|
1231
|
+
}
|
|
1232
|
+
);
|
|
1233
|
+
var AppNav = ({
|
|
1234
|
+
brand,
|
|
1235
|
+
home = "/",
|
|
1236
|
+
links = [],
|
|
1237
|
+
org = true,
|
|
1238
|
+
project = false,
|
|
1239
|
+
settings,
|
|
1240
|
+
userItems,
|
|
1241
|
+
children
|
|
124
1242
|
}) => {
|
|
125
|
-
|
|
126
|
-
|
|
1243
|
+
const id = useIdentity();
|
|
1244
|
+
const narrow = useIsNarrow();
|
|
1245
|
+
const [menu, setMenu] = React33__namespace.useState(false);
|
|
1246
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1247
|
+
"header",
|
|
1248
|
+
{
|
|
1249
|
+
"data-testid": "app-nav",
|
|
1250
|
+
className: "sticky top-0 z-50 border-b border-[var(--color-border-divider,rgba(127,127,127,0.25))] bg-[var(--color-bg-body,inherit)]",
|
|
1251
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex h-14 max-w-7xl items-center gap-2 px-4", children: [
|
|
1252
|
+
narrow && links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(DrawerRoot, { open: menu, onOpenChange: (d) => setMenu(d.open), placement: "bottom", size: "md", children: [
|
|
1253
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1254
|
+
"button",
|
|
1255
|
+
{
|
|
1256
|
+
type: "button",
|
|
1257
|
+
"aria-label": "Menu",
|
|
1258
|
+
"data-testid": "nav-menu",
|
|
1259
|
+
className: "rounded-md p-2 hover:bg-[rgba(127,127,127,0.14)]",
|
|
1260
|
+
onClick: () => setMenu(true),
|
|
1261
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { "aria-hidden": "true", className: "h-5 w-5" })
|
|
1262
|
+
}
|
|
1263
|
+
),
|
|
1264
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DrawerContent, { "data-testid": "nav-menu-panel", children: [
|
|
1265
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: "Menu" }) }),
|
|
1266
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerBody, { children: links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1267
|
+
"a",
|
|
1268
|
+
{
|
|
1269
|
+
href: l.href,
|
|
1270
|
+
onClick: () => setMenu(false),
|
|
1271
|
+
"aria-current": l.active ? "page" : void 0,
|
|
1272
|
+
className: "block rounded-md px-2 py-2.5 text-sm hover:bg-[rgba(127,127,127,0.14)]",
|
|
1273
|
+
children: l.label
|
|
1274
|
+
},
|
|
1275
|
+
l.href
|
|
1276
|
+
)) })
|
|
1277
|
+
] })
|
|
1278
|
+
] }) : null,
|
|
1279
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: home, className: "flex items-center gap-2 font-semibold tracking-tight", children: brand ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1280
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
|
|
1281
|
+
id.whiteLabel.name
|
|
1282
|
+
] }) }),
|
|
1283
|
+
org ? /* @__PURE__ */ jsxRuntime.jsx(OrgSwitcher, {}) : null,
|
|
1284
|
+
project ? /* @__PURE__ */ jsxRuntime.jsx(ProjectSwitcher, {}) : null,
|
|
1285
|
+
!narrow && links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "flex items-center gap-1", children: links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1286
|
+
"a",
|
|
1287
|
+
{
|
|
1288
|
+
href: l.href,
|
|
1289
|
+
"aria-current": l.active ? "page" : void 0,
|
|
1290
|
+
className: cn(
|
|
1291
|
+
"rounded-md px-3 py-1.5 text-sm font-medium",
|
|
1292
|
+
l.active ? "bg-[rgba(127,127,127,0.14)]" : "opacity-75 hover:opacity-100"
|
|
1293
|
+
),
|
|
1294
|
+
children: l.label
|
|
1295
|
+
},
|
|
1296
|
+
l.href
|
|
1297
|
+
)) }) : null,
|
|
1298
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center justify-end gap-1", children: [
|
|
1299
|
+
children,
|
|
1300
|
+
settings ? /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { items: settings }) : null,
|
|
1301
|
+
/* @__PURE__ */ jsxRuntime.jsx(UserMenu, { items: userItems })
|
|
1302
|
+
] })
|
|
1303
|
+
] })
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
127
1306
|
};
|
|
128
|
-
function cn(...inputs) {
|
|
129
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
130
|
-
}
|
|
131
1307
|
var IndicatorIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
132
|
-
var AccordionRoot =
|
|
1308
|
+
var AccordionRoot = React33__namespace.forwardRef(
|
|
133
1309
|
function AccordionRoot2(props, ref) {
|
|
134
1310
|
const {
|
|
135
1311
|
multiple: _multiple,
|
|
@@ -148,7 +1324,7 @@ var AccordionRoot = React30__namespace.forwardRef(
|
|
|
148
1324
|
borderRadius: _borderRadius,
|
|
149
1325
|
...rest
|
|
150
1326
|
} = props;
|
|
151
|
-
const handleValueChange =
|
|
1327
|
+
const handleValueChange = React33__namespace.useCallback(
|
|
152
1328
|
(next) => {
|
|
153
1329
|
onValueChange?.({ value: next });
|
|
154
1330
|
},
|
|
@@ -176,7 +1352,7 @@ var AccordionRoot = React30__namespace.forwardRef(
|
|
|
176
1352
|
);
|
|
177
1353
|
}
|
|
178
1354
|
);
|
|
179
|
-
var AccordionItem =
|
|
1355
|
+
var AccordionItem = React33__namespace.forwardRef(
|
|
180
1356
|
function AccordionItem2(props, ref) {
|
|
181
1357
|
const { className, as: _as, _first, _last, display: _display, ...rest } = props;
|
|
182
1358
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -192,7 +1368,7 @@ var AccordionItem = React30__namespace.forwardRef(
|
|
|
192
1368
|
);
|
|
193
1369
|
}
|
|
194
1370
|
);
|
|
195
|
-
var AccordionItemTrigger =
|
|
1371
|
+
var AccordionItemTrigger = React33__namespace.forwardRef(function AccordionItemTrigger2(props, ref) {
|
|
196
1372
|
const {
|
|
197
1373
|
children,
|
|
198
1374
|
indicatorPlacement: indicatorPlacementProp,
|
|
@@ -257,7 +1433,7 @@ var AccordionItemTrigger = React30__namespace.forwardRef(function AccordionItemT
|
|
|
257
1433
|
}
|
|
258
1434
|
) }) });
|
|
259
1435
|
});
|
|
260
|
-
var AccordionItemContent =
|
|
1436
|
+
var AccordionItemContent = React33__namespace.forwardRef(function AccordionItemContent2(props, ref) {
|
|
261
1437
|
const { className, children, pb: _pb, pr: _pr, pl: _pl, w: _w, display: _display, flexDir: _flexDir, rowGap: _rowGap, ...rest } = props;
|
|
262
1438
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
263
1439
|
AccordionPrimitive__namespace.Content,
|
|
@@ -275,11 +1451,11 @@ var AccordionItemContent = React30__namespace.forwardRef(function AccordionItemC
|
|
|
275
1451
|
);
|
|
276
1452
|
});
|
|
277
1453
|
function useAccordion(items) {
|
|
278
|
-
const [value, setValue] =
|
|
279
|
-
const onValueChange =
|
|
1454
|
+
const [value, setValue] = React33__namespace.useState([]);
|
|
1455
|
+
const onValueChange = React33__namespace.useCallback(({ value: value2 }) => {
|
|
280
1456
|
setValue(value2);
|
|
281
1457
|
}, []);
|
|
282
|
-
const scrollToItemFromUrl =
|
|
1458
|
+
const scrollToItemFromUrl = React33__namespace.useCallback(() => {
|
|
283
1459
|
const hash = window.location.hash.replace("#", "");
|
|
284
1460
|
if (!hash) {
|
|
285
1461
|
return;
|
|
@@ -293,7 +1469,7 @@ function useAccordion(items) {
|
|
|
293
1469
|
setValue([itemToScroll.id]);
|
|
294
1470
|
}
|
|
295
1471
|
}, [items]);
|
|
296
|
-
return
|
|
1472
|
+
return React33__namespace.useMemo(() => {
|
|
297
1473
|
return {
|
|
298
1474
|
value,
|
|
299
1475
|
onValueChange,
|
|
@@ -301,68 +1477,6 @@ function useAccordion(items) {
|
|
|
301
1477
|
};
|
|
302
1478
|
}, [value, onValueChange, scrollToItemFromUrl]);
|
|
303
1479
|
}
|
|
304
|
-
var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
|
|
305
|
-
var CloseButtonFrame = gui.styled(gui.View, {
|
|
306
|
-
name: "LuxCloseButton",
|
|
307
|
-
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
|
|
308
|
-
role: "button",
|
|
309
|
-
cursor: "pointer",
|
|
310
|
-
display: "inline-flex",
|
|
311
|
-
alignItems: "center",
|
|
312
|
-
justifyContent: "center",
|
|
313
|
-
width: 20,
|
|
314
|
-
height: 20,
|
|
315
|
-
minWidth: 0,
|
|
316
|
-
flexShrink: 1,
|
|
317
|
-
padding: 0,
|
|
318
|
-
borderRadius: 4,
|
|
319
|
-
borderWidth: 0,
|
|
320
|
-
overflow: "hidden",
|
|
321
|
-
backgroundColor: "transparent",
|
|
322
|
-
hoverStyle: {
|
|
323
|
-
backgroundColor: "transparent"
|
|
324
|
-
},
|
|
325
|
-
variants: {
|
|
326
|
-
disabled: {
|
|
327
|
-
true: {
|
|
328
|
-
opacity: 0.4,
|
|
329
|
-
pointerEvents: "none"
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
var CLOSE_BUTTON_CLASSES = [
|
|
335
|
-
"text-[var(--closeButton-fg,currentColor)]",
|
|
336
|
-
"hover:text-[var(--hover-color,currentColor)]",
|
|
337
|
-
"disabled:opacity-40"
|
|
338
|
-
].join(" ");
|
|
339
|
-
var CloseButton = React30__namespace.forwardRef(function CloseButton2(props, ref) {
|
|
340
|
-
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
341
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
-
CloseButtonFrame,
|
|
343
|
-
{
|
|
344
|
-
ref,
|
|
345
|
-
className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
|
|
346
|
-
...rest,
|
|
347
|
-
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
348
|
-
"svg",
|
|
349
|
-
{
|
|
350
|
-
className: "size-5",
|
|
351
|
-
viewBox: "0 0 20 20",
|
|
352
|
-
fill: "none",
|
|
353
|
-
"aria-hidden": "true",
|
|
354
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
355
|
-
"path",
|
|
356
|
-
{
|
|
357
|
-
d: CLOSE_ICON_PATH,
|
|
358
|
-
fill: "currentColor"
|
|
359
|
-
}
|
|
360
|
-
)
|
|
361
|
-
}
|
|
362
|
-
)
|
|
363
|
-
}
|
|
364
|
-
);
|
|
365
|
-
});
|
|
366
1480
|
var SHIM_PROPS = [
|
|
367
1481
|
"w",
|
|
368
1482
|
"h",
|
|
@@ -483,7 +1597,7 @@ var SKELETON_CLASSES = [
|
|
|
483
1597
|
"bg-[length:200%_100%]"
|
|
484
1598
|
].join(" ");
|
|
485
1599
|
var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
|
|
486
|
-
var Skeleton =
|
|
1600
|
+
var Skeleton = React33__namespace.forwardRef(
|
|
487
1601
|
function Skeleton2(props, ref) {
|
|
488
1602
|
const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
|
|
489
1603
|
const shimStyle = shimToStyle(props);
|
|
@@ -492,10 +1606,10 @@ var Skeleton = React30__namespace.forwardRef(
|
|
|
492
1606
|
const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
|
|
493
1607
|
const htmlRest = stripShims(allRest);
|
|
494
1608
|
if (!loading) {
|
|
495
|
-
if (asChild &&
|
|
1609
|
+
if (asChild && React33__namespace.isValidElement(children)) return children;
|
|
496
1610
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
|
|
497
1611
|
}
|
|
498
|
-
if (asChild &&
|
|
1612
|
+
if (asChild && React33__namespace.isValidElement(children)) {
|
|
499
1613
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
500
1614
|
Component,
|
|
501
1615
|
{
|
|
@@ -521,7 +1635,7 @@ var Skeleton = React30__namespace.forwardRef(
|
|
|
521
1635
|
);
|
|
522
1636
|
}
|
|
523
1637
|
);
|
|
524
|
-
var SkeletonCircle =
|
|
1638
|
+
var SkeletonCircle = React33__namespace.forwardRef(
|
|
525
1639
|
function SkeletonCircle2(props, ref) {
|
|
526
1640
|
const { size = 40, loading = true, className, ...rest } = props;
|
|
527
1641
|
const dimension = typeof size === "number" ? `${size}px` : size;
|
|
@@ -537,7 +1651,7 @@ var SkeletonCircle = React30__namespace.forwardRef(
|
|
|
537
1651
|
);
|
|
538
1652
|
}
|
|
539
1653
|
);
|
|
540
|
-
var SkeletonText =
|
|
1654
|
+
var SkeletonText = React33__namespace.forwardRef(
|
|
541
1655
|
function SkeletonText2(props, ref) {
|
|
542
1656
|
const { noOfLines = 3, loading = true, className, ...rest } = props;
|
|
543
1657
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -559,7 +1673,7 @@ var STATUS_CLASSES = {
|
|
|
559
1673
|
success: "bg-[var(--color-alert-bg-success)]",
|
|
560
1674
|
error: "bg-[var(--color-alert-bg-error)]"
|
|
561
1675
|
};
|
|
562
|
-
var
|
|
1676
|
+
var SIZE_CLASSES2 = {
|
|
563
1677
|
sm: "gap-2 px-2 py-2 text-xs",
|
|
564
1678
|
md: "gap-2 px-3 py-2 text-base"
|
|
565
1679
|
};
|
|
@@ -567,7 +1681,7 @@ var INDICATOR_SIZE_CLASSES = {
|
|
|
567
1681
|
sm: "w-5 h-5 my-0",
|
|
568
1682
|
md: "w-5 h-5 my-[2px]"
|
|
569
1683
|
};
|
|
570
|
-
var Alert =
|
|
1684
|
+
var Alert = React33__namespace.forwardRef(
|
|
571
1685
|
function Alert2(props, ref) {
|
|
572
1686
|
const {
|
|
573
1687
|
title,
|
|
@@ -592,7 +1706,7 @@ var Alert = React30__namespace.forwardRef(
|
|
|
592
1706
|
if (_mb !== void 0) shimStyle.marginBottom = typeof _mb === "number" ? `${_mb * 4}px` : _mb;
|
|
593
1707
|
if (_mt !== void 0) shimStyle.marginTop = typeof _mt === "number" ? `${_mt * 4}px` : _mt;
|
|
594
1708
|
const alertStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
595
|
-
const [isOpen, setIsOpen] =
|
|
1709
|
+
const [isOpen, setIsOpen] = React33__namespace.useState(true);
|
|
596
1710
|
const resolvedSize = size ?? "md";
|
|
597
1711
|
const defaultIcon = /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon2, { className: "w-5 h-5" });
|
|
598
1712
|
const iconElement = (() => {
|
|
@@ -607,7 +1721,7 @@ var Alert = React30__namespace.forwardRef(
|
|
|
607
1721
|
INDICATOR_SIZE_CLASSES[resolvedSize]
|
|
608
1722
|
), children: icon || defaultIcon });
|
|
609
1723
|
})();
|
|
610
|
-
const handleClose =
|
|
1724
|
+
const handleClose = React33__namespace.useCallback(() => {
|
|
611
1725
|
setIsOpen(false);
|
|
612
1726
|
onClose?.();
|
|
613
1727
|
}, [onClose]);
|
|
@@ -638,7 +1752,7 @@ var Alert = React30__namespace.forwardRef(
|
|
|
638
1752
|
"div",
|
|
639
1753
|
{
|
|
640
1754
|
ref,
|
|
641
|
-
className: cn(ALERT_BASE, STATUS_CLASSES[status],
|
|
1755
|
+
className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES2[resolvedSize], className),
|
|
642
1756
|
style: alertStyle,
|
|
643
1757
|
...alertRest,
|
|
644
1758
|
children: [
|
|
@@ -668,7 +1782,7 @@ var Alert = React30__namespace.forwardRef(
|
|
|
668
1782
|
) });
|
|
669
1783
|
}
|
|
670
1784
|
);
|
|
671
|
-
var
|
|
1785
|
+
var SIZE_CLASSES3 = {
|
|
672
1786
|
xs: "h-6 w-6 text-[10px]",
|
|
673
1787
|
sm: "h-8 w-8 text-xs",
|
|
674
1788
|
md: "h-10 w-10 text-sm",
|
|
@@ -683,11 +1797,11 @@ var VARIANT_CLASSES = {
|
|
|
683
1797
|
};
|
|
684
1798
|
var DEFAULT_SIZE = "md";
|
|
685
1799
|
var DEFAULT_VARIANT = "subtle";
|
|
686
|
-
var AvatarGroupContext =
|
|
1800
|
+
var AvatarGroupContext = React33__namespace.createContext({});
|
|
687
1801
|
function useAvatarGroupContext() {
|
|
688
|
-
return
|
|
1802
|
+
return React33__namespace.useContext(AvatarGroupContext);
|
|
689
1803
|
}
|
|
690
|
-
var Avatar =
|
|
1804
|
+
var Avatar = React33__namespace.forwardRef(
|
|
691
1805
|
function Avatar2(props, ref) {
|
|
692
1806
|
const group = useAvatarGroupContext();
|
|
693
1807
|
const {
|
|
@@ -708,12 +1822,13 @@ var Avatar = React30__namespace.forwardRef(
|
|
|
708
1822
|
const variant = variantProp ?? group.variant ?? DEFAULT_VARIANT;
|
|
709
1823
|
const isBorderless = borderless ?? group.borderless ?? false;
|
|
710
1824
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
711
|
-
|
|
1825
|
+
gui.Avatar,
|
|
712
1826
|
{
|
|
713
1827
|
ref,
|
|
1828
|
+
unstyled: true,
|
|
714
1829
|
className: cn(
|
|
715
1830
|
"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full align-middle",
|
|
716
|
-
|
|
1831
|
+
SIZE_CLASSES3[size],
|
|
717
1832
|
VARIANT_CLASSES[variant],
|
|
718
1833
|
!isBorderless && "ring-2 ring-white dark:ring-gray-900",
|
|
719
1834
|
className
|
|
@@ -721,8 +1836,8 @@ var Avatar = React30__namespace.forwardRef(
|
|
|
721
1836
|
...rest,
|
|
722
1837
|
children: [
|
|
723
1838
|
/* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { name, icon, children: fallback }),
|
|
724
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
725
|
-
|
|
1839
|
+
src != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1840
|
+
gui.Avatar.Image,
|
|
726
1841
|
{
|
|
727
1842
|
className: "h-full w-full rounded-[inherit] object-cover",
|
|
728
1843
|
src,
|
|
@@ -737,13 +1852,14 @@ var Avatar = React30__namespace.forwardRef(
|
|
|
737
1852
|
);
|
|
738
1853
|
}
|
|
739
1854
|
);
|
|
740
|
-
var AvatarFallback =
|
|
1855
|
+
var AvatarFallback = React33__namespace.forwardRef(
|
|
741
1856
|
function AvatarFallback2(props, ref) {
|
|
742
1857
|
const { name, icon, children, className, ...rest } = props;
|
|
743
1858
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
744
|
-
|
|
1859
|
+
gui.Avatar.Fallback,
|
|
745
1860
|
{
|
|
746
1861
|
ref,
|
|
1862
|
+
unstyled: true,
|
|
747
1863
|
className: cn(
|
|
748
1864
|
"flex h-full w-full items-center justify-center font-medium",
|
|
749
1865
|
className
|
|
@@ -764,10 +1880,10 @@ function getInitials(name) {
|
|
|
764
1880
|
const lastName = names.length > 1 ? names[names.length - 1] : "";
|
|
765
1881
|
return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
|
|
766
1882
|
}
|
|
767
|
-
var AvatarGroup =
|
|
1883
|
+
var AvatarGroup = React33__namespace.forwardRef(
|
|
768
1884
|
function AvatarGroup2(props, ref) {
|
|
769
1885
|
const { size, variant, borderless, className, ...rest } = props;
|
|
770
|
-
const contextValue =
|
|
1886
|
+
const contextValue = React33__namespace.useMemo(
|
|
771
1887
|
() => ({ size, variant, borderless }),
|
|
772
1888
|
[size, variant, borderless]
|
|
773
1889
|
);
|
|
@@ -781,26 +1897,11 @@ var AvatarGroup = React30__namespace.forwardRef(
|
|
|
781
1897
|
) });
|
|
782
1898
|
}
|
|
783
1899
|
);
|
|
784
|
-
var LG_BREAKPOINT = 1024;
|
|
785
|
-
function useIsMobile() {
|
|
786
|
-
const [isMobile, setIsMobile] = React30__namespace.useState(() => {
|
|
787
|
-
if (typeof window === "undefined") return false;
|
|
788
|
-
return window.innerWidth < LG_BREAKPOINT;
|
|
789
|
-
});
|
|
790
|
-
React30__namespace.useEffect(() => {
|
|
791
|
-
const mql = window.matchMedia(`(max-width: ${LG_BREAKPOINT - 1}px)`);
|
|
792
|
-
const handler = (e) => setIsMobile(e.matches);
|
|
793
|
-
setIsMobile(mql.matches);
|
|
794
|
-
mql.addEventListener("change", handler);
|
|
795
|
-
return () => mql.removeEventListener("change", handler);
|
|
796
|
-
}, []);
|
|
797
|
-
return isMobile;
|
|
798
|
-
}
|
|
799
1900
|
function mapPlacement(p) {
|
|
800
1901
|
if (!p) return void 0;
|
|
801
1902
|
return p;
|
|
802
1903
|
}
|
|
803
|
-
var Tooltip =
|
|
1904
|
+
var Tooltip = React33__namespace.forwardRef(
|
|
804
1905
|
function Tooltip2(props, ref) {
|
|
805
1906
|
const {
|
|
806
1907
|
showArrow: showArrowProp,
|
|
@@ -819,28 +1920,28 @@ var Tooltip = React30__namespace.forwardRef(
|
|
|
819
1920
|
interactive,
|
|
820
1921
|
positioning
|
|
821
1922
|
} = props;
|
|
822
|
-
const [open, setOpen] =
|
|
823
|
-
const timeoutRef =
|
|
824
|
-
const isMobile =
|
|
825
|
-
const handleOpenChange =
|
|
1923
|
+
const [open, setOpen] = React33__namespace.useState(defaultOpen);
|
|
1924
|
+
const timeoutRef = React33__namespace.useRef(null);
|
|
1925
|
+
const isMobile = useIsTouch();
|
|
1926
|
+
const handleOpenChange = React33__namespace.useCallback((nextOpen) => {
|
|
826
1927
|
setOpen(nextOpen);
|
|
827
1928
|
onOpenChange?.({ open: nextOpen });
|
|
828
1929
|
}, [onOpenChange]);
|
|
829
|
-
const handleOpenChangeManual =
|
|
1930
|
+
const handleOpenChangeManual = React33__namespace.useCallback((nextOpen) => {
|
|
830
1931
|
timeoutRef.current && window.clearTimeout(timeoutRef.current);
|
|
831
1932
|
timeoutRef.current = window.setTimeout(() => {
|
|
832
1933
|
setOpen(nextOpen);
|
|
833
1934
|
onOpenChange?.({ open: nextOpen });
|
|
834
1935
|
}, nextOpen ? openDelay : closeDelay);
|
|
835
1936
|
}, [closeDelay, openDelay, onOpenChange]);
|
|
836
|
-
const handleClickAway =
|
|
837
|
-
handleOpenChangeManual(false);
|
|
838
|
-
}, [handleOpenChangeManual]);
|
|
1937
|
+
const handleClickAway = React33__namespace.useCallback(() => {
|
|
1938
|
+
if (open) handleOpenChangeManual(false);
|
|
1939
|
+
}, [open, handleOpenChangeManual]);
|
|
839
1940
|
const triggerRef = usehooks.useClickAway(handleClickAway);
|
|
840
|
-
const handleTriggerClick =
|
|
1941
|
+
const handleTriggerClick = React33__namespace.useCallback(() => {
|
|
841
1942
|
handleOpenChangeManual(!open);
|
|
842
1943
|
}, [handleOpenChangeManual, open]);
|
|
843
|
-
const handleContentClick =
|
|
1944
|
+
const handleContentClick = React33__namespace.useCallback((event) => {
|
|
844
1945
|
event.stopPropagation();
|
|
845
1946
|
if (interactive) {
|
|
846
1947
|
const closestLink = event.target?.closest("a");
|
|
@@ -849,7 +1950,7 @@ var Tooltip = React30__namespace.forwardRef(
|
|
|
849
1950
|
}
|
|
850
1951
|
}
|
|
851
1952
|
}, [interactive, handleOpenChangeManual]);
|
|
852
|
-
|
|
1953
|
+
React33__namespace.useEffect(() => {
|
|
853
1954
|
return () => {
|
|
854
1955
|
if (timeoutRef.current) {
|
|
855
1956
|
clearTimeout(timeoutRef.current);
|
|
@@ -875,7 +1976,7 @@ var Tooltip = React30__namespace.forwardRef(
|
|
|
875
1976
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
876
1977
|
gui.Tooltip.Trigger,
|
|
877
1978
|
{
|
|
878
|
-
ref:
|
|
1979
|
+
ref: triggerRef,
|
|
879
1980
|
asChild: true,
|
|
880
1981
|
...isMobile ? { onPress: handleTriggerClick } : {},
|
|
881
1982
|
...triggerProps,
|
|
@@ -921,7 +2022,7 @@ function TruncatedTextTooltip({ label, children }) {
|
|
|
921
2022
|
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
922
2023
|
}
|
|
923
2024
|
var BASE_CLASSES = "inline-flex items-center rounded-sm gap-1 font-medium w-fit max-w-full whitespace-nowrap select-text";
|
|
924
|
-
var
|
|
2025
|
+
var SIZE_CLASSES4 = {
|
|
925
2026
|
sm: "text-xs p-1 h-[18px] min-h-[18px]",
|
|
926
2027
|
md: "text-sm px-1 py-0.5 min-h-6",
|
|
927
2028
|
lg: "text-sm px-2 py-1 min-h-7 font-semibold"
|
|
@@ -951,7 +2052,7 @@ var COLOR_PALETTE_CLASSES = {
|
|
|
951
2052
|
bright_pink: "bg-badge-bright-pink-bg text-badge-bright-pink-fg"
|
|
952
2053
|
};
|
|
953
2054
|
var S2 = 4;
|
|
954
|
-
var Badge =
|
|
2055
|
+
var Badge = React33__namespace.default.forwardRef(
|
|
955
2056
|
function Badge2(props, ref) {
|
|
956
2057
|
const {
|
|
957
2058
|
loading,
|
|
@@ -991,7 +2092,7 @@ var Badge = React30__namespace.default.forwardRef(
|
|
|
991
2092
|
ref,
|
|
992
2093
|
className: cn(
|
|
993
2094
|
BASE_CLASSES,
|
|
994
|
-
|
|
2095
|
+
SIZE_CLASSES4[size],
|
|
995
2096
|
COLOR_PALETTE_CLASSES[colorPalette],
|
|
996
2097
|
className
|
|
997
2098
|
),
|
|
@@ -1200,7 +2301,7 @@ function buildShimStyle(props) {
|
|
|
1200
2301
|
if (props.borderTopRightRadius !== void 0) s.borderTopRightRadius = typeof props.borderTopRightRadius === "number" ? `${props.borderTopRightRadius}px` : props.borderTopRightRadius;
|
|
1201
2302
|
return Object.keys(s).length > 0 ? s : void 0;
|
|
1202
2303
|
}
|
|
1203
|
-
var Button =
|
|
2304
|
+
var Button = React33__namespace.forwardRef(
|
|
1204
2305
|
function Button2(props, ref) {
|
|
1205
2306
|
const {
|
|
1206
2307
|
className,
|
|
@@ -1291,7 +2392,7 @@ var Button = React30__namespace.forwardRef(
|
|
|
1291
2392
|
return button;
|
|
1292
2393
|
}
|
|
1293
2394
|
);
|
|
1294
|
-
var
|
|
2395
|
+
var SIZE_CLASSES5 = {
|
|
1295
2396
|
"2xs": "px-2 h-5 min-w-5 text-xs rounded-sm gap-1",
|
|
1296
2397
|
xs: "px-2 h-6 min-w-6 text-sm rounded-sm gap-1",
|
|
1297
2398
|
sm: "px-3 h-8 min-w-8 text-sm rounded-md gap-1",
|
|
@@ -1300,9 +2401,9 @@ var SIZE_CLASSES4 = {
|
|
|
1300
2401
|
function buttonVariants(opts) {
|
|
1301
2402
|
const v = opts?.variant ?? "solid";
|
|
1302
2403
|
const s = opts?.size ?? "md";
|
|
1303
|
-
return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "",
|
|
2404
|
+
return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES5[s] ?? ""].filter(Boolean).join(" ");
|
|
1304
2405
|
}
|
|
1305
|
-
var ButtonGroup =
|
|
2406
|
+
var ButtonGroup = React33__namespace.forwardRef(
|
|
1306
2407
|
function ButtonGroup2(props, ref) {
|
|
1307
2408
|
const { className, ...rest } = props;
|
|
1308
2409
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1316,7 +2417,7 @@ var ButtonGroup = React30__namespace.forwardRef(
|
|
|
1316
2417
|
);
|
|
1317
2418
|
}
|
|
1318
2419
|
);
|
|
1319
|
-
var ButtonGroupRadio =
|
|
2420
|
+
var ButtonGroupRadio = React33__namespace.forwardRef(
|
|
1320
2421
|
function ButtonGroupRadio2(props, ref) {
|
|
1321
2422
|
const {
|
|
1322
2423
|
children,
|
|
@@ -1328,24 +2429,24 @@ var ButtonGroupRadio = React30__namespace.forwardRef(
|
|
|
1328
2429
|
className,
|
|
1329
2430
|
...rest
|
|
1330
2431
|
} = props;
|
|
1331
|
-
const firstChildValue =
|
|
2432
|
+
const firstChildValue = React33__namespace.useMemo(() => {
|
|
1332
2433
|
const firstChild = Array.isArray(children) ? children[0] : void 0;
|
|
1333
2434
|
return typeof firstChild?.props.value === "string" ? firstChild.props.value : void 0;
|
|
1334
2435
|
}, [children]);
|
|
1335
|
-
const [value, setValue] =
|
|
1336
|
-
const handleItemClick =
|
|
2436
|
+
const [value, setValue] = React33__namespace.useState(defaultValue ?? firstChildValue);
|
|
2437
|
+
const handleItemClick = React33__namespace.useCallback((event) => {
|
|
1337
2438
|
const v = event.currentTarget.value;
|
|
1338
2439
|
setValue(v);
|
|
1339
2440
|
onChange?.(v);
|
|
1340
2441
|
}, [onChange]);
|
|
1341
|
-
const clonedChildren =
|
|
1342
|
-
return
|
|
2442
|
+
const clonedChildren = React33__namespace.Children.map(children, (child) => {
|
|
2443
|
+
return React33__namespace.cloneElement(child, {
|
|
1343
2444
|
onClick: handleItemClick,
|
|
1344
2445
|
selected: value === child.props.value,
|
|
1345
2446
|
variant
|
|
1346
2447
|
});
|
|
1347
2448
|
});
|
|
1348
|
-
const childrenLength =
|
|
2449
|
+
const childrenLength = React33__namespace.Children.count(children);
|
|
1349
2450
|
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1350
2451
|
"div",
|
|
1351
2452
|
{
|
|
@@ -1365,11 +2466,11 @@ var ButtonGroupRadio = React30__namespace.forwardRef(
|
|
|
1365
2466
|
);
|
|
1366
2467
|
var NOOP = () => {
|
|
1367
2468
|
};
|
|
1368
|
-
var CheckboxGroupContext =
|
|
2469
|
+
var CheckboxGroupContext = React33__namespace.createContext(null);
|
|
1369
2470
|
function useCheckboxGroupContext() {
|
|
1370
|
-
return
|
|
2471
|
+
return React33__namespace.useContext(CheckboxGroupContext);
|
|
1371
2472
|
}
|
|
1372
|
-
var CheckboxGroupBase =
|
|
2473
|
+
var CheckboxGroupBase = React33__namespace.forwardRef(
|
|
1373
2474
|
function CheckboxGroup(props, ref) {
|
|
1374
2475
|
const {
|
|
1375
2476
|
children,
|
|
@@ -1381,10 +2482,10 @@ var CheckboxGroupBase = React30__namespace.forwardRef(
|
|
|
1381
2482
|
className,
|
|
1382
2483
|
...rest
|
|
1383
2484
|
} = props;
|
|
1384
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
2485
|
+
const [uncontrolledValue, setUncontrolledValue] = React33__namespace.useState(defaultValue ?? []);
|
|
1385
2486
|
const isControlled = controlledValue !== void 0;
|
|
1386
2487
|
const value = isControlled ? controlledValue : uncontrolledValue;
|
|
1387
|
-
const toggle =
|
|
2488
|
+
const toggle = React33__namespace.useCallback(
|
|
1388
2489
|
(itemValue) => {
|
|
1389
2490
|
const next = value.includes(itemValue) ? value.filter((v) => v !== itemValue) : [...value, itemValue];
|
|
1390
2491
|
if (!isControlled) {
|
|
@@ -1394,12 +2495,12 @@ var CheckboxGroupBase = React30__namespace.forwardRef(
|
|
|
1394
2495
|
},
|
|
1395
2496
|
[value, isControlled, onValueChange]
|
|
1396
2497
|
);
|
|
1397
|
-
|
|
2498
|
+
React33__namespace.useEffect(() => {
|
|
1398
2499
|
if (isControlled) {
|
|
1399
2500
|
setUncontrolledValue(controlledValue);
|
|
1400
2501
|
}
|
|
1401
2502
|
}, [isControlled, controlledValue]);
|
|
1402
|
-
const ctx =
|
|
2503
|
+
const ctx = React33__namespace.useMemo(() => ({ value, toggle }), [value, toggle]);
|
|
1403
2504
|
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1404
2505
|
"div",
|
|
1405
2506
|
{
|
|
@@ -1417,7 +2518,7 @@ var CheckboxGroupBase = React30__namespace.forwardRef(
|
|
|
1417
2518
|
}
|
|
1418
2519
|
);
|
|
1419
2520
|
var CheckboxGroup2 = CheckboxGroupBase;
|
|
1420
|
-
var
|
|
2521
|
+
var SIZE_CLASSES6 = {
|
|
1421
2522
|
sm: {
|
|
1422
2523
|
root: "gap-1.5",
|
|
1423
2524
|
control: "h-3.5 w-3.5 rounded-sm",
|
|
@@ -1457,7 +2558,7 @@ var IndeterminateIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1457
2558
|
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0H12V2H0V0Z", fill: "currentColor" })
|
|
1458
2559
|
}
|
|
1459
2560
|
);
|
|
1460
|
-
var CheckboxBase =
|
|
2561
|
+
var CheckboxBase = React33__namespace.forwardRef(
|
|
1461
2562
|
function Checkbox(props, ref) {
|
|
1462
2563
|
const {
|
|
1463
2564
|
icon,
|
|
@@ -1478,8 +2579,8 @@ var CheckboxBase = React30__namespace.forwardRef(
|
|
|
1478
2579
|
...rest
|
|
1479
2580
|
} = props;
|
|
1480
2581
|
const group = useCheckboxGroupContext();
|
|
1481
|
-
const hiddenInputRef =
|
|
1482
|
-
const setHiddenInputRef =
|
|
2582
|
+
const hiddenInputRef = React33__namespace.useRef(null);
|
|
2583
|
+
const setHiddenInputRef = React33__namespace.useCallback(
|
|
1483
2584
|
(node) => {
|
|
1484
2585
|
hiddenInputRef.current = node;
|
|
1485
2586
|
if (typeof ref === "function") {
|
|
@@ -1492,7 +2593,7 @@ var CheckboxBase = React30__namespace.forwardRef(
|
|
|
1492
2593
|
);
|
|
1493
2594
|
const isInGroup = group !== null && value !== void 0;
|
|
1494
2595
|
const groupChecked = isInGroup ? group.value.includes(value) : void 0;
|
|
1495
|
-
const [internalChecked, setInternalChecked] =
|
|
2596
|
+
const [internalChecked, setInternalChecked] = React33__namespace.useState(
|
|
1496
2597
|
defaultChecked ?? false
|
|
1497
2598
|
);
|
|
1498
2599
|
const isControlled = checkedProp !== void 0 || isInGroup;
|
|
@@ -1504,7 +2605,7 @@ var CheckboxBase = React30__namespace.forwardRef(
|
|
|
1504
2605
|
} else {
|
|
1505
2606
|
checkedState = internalChecked;
|
|
1506
2607
|
}
|
|
1507
|
-
const handleCheckedChange =
|
|
2608
|
+
const handleCheckedChange = React33__namespace.useCallback(
|
|
1508
2609
|
(nextChecked) => {
|
|
1509
2610
|
if (readOnly) return;
|
|
1510
2611
|
if (!isControlled) {
|
|
@@ -1527,7 +2628,7 @@ var CheckboxBase = React30__namespace.forwardRef(
|
|
|
1527
2628
|
},
|
|
1528
2629
|
[readOnly, isControlled, isInGroup, group, value, onCheckedChange, onChange]
|
|
1529
2630
|
);
|
|
1530
|
-
const sizeClasses2 =
|
|
2631
|
+
const sizeClasses2 = SIZE_CLASSES6[size];
|
|
1531
2632
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1532
2633
|
"label",
|
|
1533
2634
|
{
|
|
@@ -1545,8 +2646,9 @@ var CheckboxBase = React30__namespace.forwardRef(
|
|
|
1545
2646
|
...rest,
|
|
1546
2647
|
children: [
|
|
1547
2648
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1548
|
-
|
|
2649
|
+
gui.Checkbox,
|
|
1549
2650
|
{
|
|
2651
|
+
unstyled: true,
|
|
1550
2652
|
checked: checkedState,
|
|
1551
2653
|
onCheckedChange: handleCheckedChange,
|
|
1552
2654
|
disabled: disabled || readOnly,
|
|
@@ -1564,7 +2666,7 @@ var CheckboxBase = React30__namespace.forwardRef(
|
|
|
1564
2666
|
"transition-colors duration-150",
|
|
1565
2667
|
sizeClasses2.control
|
|
1566
2668
|
),
|
|
1567
|
-
children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2669
|
+
children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(gui.Checkbox.Indicator, { className: cn("flex items-center justify-center", sizeClasses2.icon), children: checkedState === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateIcon, { className: sizeClasses2.icon }) : /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: sizeClasses2.icon }) })
|
|
1568
2670
|
}
|
|
1569
2671
|
),
|
|
1570
2672
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1668,7 +2770,7 @@ function resolveSpacing(v) {
|
|
|
1668
2770
|
}
|
|
1669
2771
|
return void 0;
|
|
1670
2772
|
}
|
|
1671
|
-
var Link =
|
|
2773
|
+
var Link = React33__namespace.default.forwardRef(
|
|
1672
2774
|
function Link2(props, ref) {
|
|
1673
2775
|
const {
|
|
1674
2776
|
external,
|
|
@@ -1757,7 +2859,7 @@ var Link = React30__namespace.default.forwardRef(
|
|
|
1757
2859
|
) });
|
|
1758
2860
|
}
|
|
1759
2861
|
);
|
|
1760
|
-
var LinkBox =
|
|
2862
|
+
var LinkBox = React33__namespace.default.forwardRef(
|
|
1761
2863
|
function LinkBox2(props, ref) {
|
|
1762
2864
|
const { className, ...rest } = props;
|
|
1763
2865
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1770,7 +2872,7 @@ var LinkBox = React30__namespace.default.forwardRef(
|
|
|
1770
2872
|
);
|
|
1771
2873
|
}
|
|
1772
2874
|
);
|
|
1773
|
-
var LinkOverlay =
|
|
2875
|
+
var LinkOverlay = React33__namespace.default.forwardRef(
|
|
1774
2876
|
function LinkOverlay2(props, ref) {
|
|
1775
2877
|
const {
|
|
1776
2878
|
children,
|
|
@@ -1851,8 +2953,8 @@ var LinkOverlay = React30__namespace.default.forwardRef(
|
|
|
1851
2953
|
}
|
|
1852
2954
|
);
|
|
1853
2955
|
function useUpdateEffect(effect, deps) {
|
|
1854
|
-
const isFirstMount =
|
|
1855
|
-
|
|
2956
|
+
const isFirstMount = React33__namespace.default.useRef(true);
|
|
2957
|
+
React33__namespace.default.useEffect(() => {
|
|
1856
2958
|
if (isFirstMount.current) {
|
|
1857
2959
|
isFirstMount.current = false;
|
|
1858
2960
|
return;
|
|
@@ -1869,8 +2971,8 @@ function scrollToElement(id) {
|
|
|
1869
2971
|
var CUT_ID = "CollapsibleDetails";
|
|
1870
2972
|
var CollapsibleDetails = (props) => {
|
|
1871
2973
|
const { children, id = CUT_ID, onClick, isExpanded: isExpandedProp = false, text: textProp, loading, noScroll, ...rest } = props;
|
|
1872
|
-
const [isExpanded, setIsExpanded] =
|
|
1873
|
-
const handleClick =
|
|
2974
|
+
const [isExpanded, setIsExpanded] = React33__namespace.default.useState(isExpandedProp);
|
|
2975
|
+
const handleClick = React33__namespace.default.useCallback((event) => {
|
|
1874
2976
|
setIsExpanded((flag) => !flag);
|
|
1875
2977
|
if (!noScroll) {
|
|
1876
2978
|
scrollToElement(id);
|
|
@@ -1901,11 +3003,11 @@ var CollapsibleDetails = (props) => {
|
|
|
1901
3003
|
var CollapsibleList = (props) => {
|
|
1902
3004
|
const CUT_LENGTH = 3;
|
|
1903
3005
|
const { items, renderItem, triggerProps, cutLength = CUT_LENGTH, text: textProp, defaultExpanded = false, className, ...rest } = props;
|
|
1904
|
-
const [isExpanded, setIsExpanded] =
|
|
1905
|
-
|
|
3006
|
+
const [isExpanded, setIsExpanded] = React33__namespace.default.useState(defaultExpanded);
|
|
3007
|
+
React33__namespace.default.useEffect(() => {
|
|
1906
3008
|
setIsExpanded(defaultExpanded);
|
|
1907
3009
|
}, [defaultExpanded]);
|
|
1908
|
-
const handleToggle =
|
|
3010
|
+
const handleToggle = React33__namespace.default.useCallback(() => {
|
|
1909
3011
|
setIsExpanded((flag) => !flag);
|
|
1910
3012
|
}, []);
|
|
1911
3013
|
const text = isExpanded ? textProp?.[1] ?? "Hide" : textProp?.[0] ?? "Show all";
|
|
@@ -1922,10 +3024,10 @@ var CollapsibleList = (props) => {
|
|
|
1922
3024
|
) })
|
|
1923
3025
|
] }) });
|
|
1924
3026
|
};
|
|
1925
|
-
var ColorModeContext =
|
|
3027
|
+
var ColorModeContext = React33__namespace.createContext(void 0);
|
|
1926
3028
|
function ColorModeProvider(props) {
|
|
1927
3029
|
const { children, defaultTheme = "light", value: controlledValue, onValueChange } = props;
|
|
1928
|
-
const [internalMode, setInternalMode] =
|
|
3030
|
+
const [internalMode, setInternalMode] = React33__namespace.useState(() => {
|
|
1929
3031
|
if (controlledValue === "dark" || controlledValue === "light") {
|
|
1930
3032
|
return controlledValue;
|
|
1931
3033
|
}
|
|
@@ -1935,7 +3037,7 @@ function ColorModeProvider(props) {
|
|
|
1935
3037
|
return defaultTheme === "dark" ? "dark" : "light";
|
|
1936
3038
|
});
|
|
1937
3039
|
const colorMode = controlledValue === "dark" || controlledValue === "light" ? controlledValue : internalMode;
|
|
1938
|
-
const setColorMode =
|
|
3040
|
+
const setColorMode = React33__namespace.useCallback((mode) => {
|
|
1939
3041
|
const resolved = mode === "dark" ? "dark" : "light";
|
|
1940
3042
|
setInternalMode(resolved);
|
|
1941
3043
|
onValueChange?.(resolved);
|
|
@@ -1944,19 +3046,19 @@ function ColorModeProvider(props) {
|
|
|
1944
3046
|
document.documentElement.classList.toggle("light", resolved === "light");
|
|
1945
3047
|
}
|
|
1946
3048
|
}, [onValueChange]);
|
|
1947
|
-
const toggleColorMode =
|
|
3049
|
+
const toggleColorMode = React33__namespace.useCallback(() => {
|
|
1948
3050
|
setColorMode(colorMode === "dark" ? "light" : "dark");
|
|
1949
3051
|
}, [colorMode, setColorMode]);
|
|
1950
|
-
const ctx =
|
|
3052
|
+
const ctx = React33__namespace.useMemo(
|
|
1951
3053
|
() => ({ colorMode, setColorMode, toggleColorMode }),
|
|
1952
3054
|
[colorMode, setColorMode, toggleColorMode]
|
|
1953
3055
|
);
|
|
1954
3056
|
return /* @__PURE__ */ jsxRuntime.jsx(ColorModeContext.Provider, { value: ctx, children });
|
|
1955
3057
|
}
|
|
1956
3058
|
function useColorMode() {
|
|
1957
|
-
const ctx =
|
|
3059
|
+
const ctx = React33__namespace.useContext(ColorModeContext);
|
|
1958
3060
|
if (!ctx) {
|
|
1959
|
-
const [mode, setMode] =
|
|
3061
|
+
const [mode, setMode] = React33__namespace.useState(() => {
|
|
1960
3062
|
if (typeof document !== "undefined" && document.documentElement.classList.contains("dark")) {
|
|
1961
3063
|
return "dark";
|
|
1962
3064
|
}
|
|
@@ -2000,9 +3102,9 @@ function BackToButton({ onClick }) {
|
|
|
2000
3102
|
}
|
|
2001
3103
|
);
|
|
2002
3104
|
}
|
|
2003
|
-
var DialogSizeContext =
|
|
3105
|
+
var DialogSizeContext = React33__namespace.createContext({ size: "md" });
|
|
2004
3106
|
function useDialogSizeContext() {
|
|
2005
|
-
return
|
|
3107
|
+
return React33__namespace.useContext(DialogSizeContext);
|
|
2006
3108
|
}
|
|
2007
3109
|
var CONTENT_SIZE_MAP = {
|
|
2008
3110
|
sm: "max-w-[400px]",
|
|
@@ -2034,13 +3136,13 @@ var DialogRoot = ({
|
|
|
2034
3136
|
modal = true
|
|
2035
3137
|
// motionPreset is intentionally unused -- kept for API compat
|
|
2036
3138
|
}) => {
|
|
2037
|
-
const handleOpenChange =
|
|
3139
|
+
const handleOpenChange = React33__namespace.useCallback(
|
|
2038
3140
|
(nextOpen) => {
|
|
2039
3141
|
onOpenChange?.({ open: nextOpen });
|
|
2040
3142
|
},
|
|
2041
3143
|
[onOpenChange]
|
|
2042
3144
|
);
|
|
2043
|
-
const ctx =
|
|
3145
|
+
const ctx = React33__namespace.useMemo(() => ({ size }), [size]);
|
|
2044
3146
|
return /* @__PURE__ */ jsxRuntime.jsx(DialogSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2045
3147
|
gui.Dialog,
|
|
2046
3148
|
{
|
|
@@ -2052,7 +3154,7 @@ var DialogRoot = ({
|
|
|
2052
3154
|
}
|
|
2053
3155
|
) });
|
|
2054
3156
|
};
|
|
2055
|
-
var DialogContent =
|
|
3157
|
+
var DialogContent = React33__namespace.forwardRef(function DialogContent2(props, ref) {
|
|
2056
3158
|
const {
|
|
2057
3159
|
children,
|
|
2058
3160
|
portalled: _portalled = true,
|
|
@@ -2109,11 +3211,11 @@ var DialogContent = React30__namespace.forwardRef(function DialogContent2(props,
|
|
|
2109
3211
|
)
|
|
2110
3212
|
] });
|
|
2111
3213
|
});
|
|
2112
|
-
var DialogCloseTrigger =
|
|
3214
|
+
var DialogCloseTrigger = React33__namespace.forwardRef(function DialogCloseTrigger2(props, ref) {
|
|
2113
3215
|
const { className, ...rest } = props;
|
|
2114
3216
|
return /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { ref, className, ...rest, children: props.children }) });
|
|
2115
3217
|
});
|
|
2116
|
-
var DialogHeader =
|
|
3218
|
+
var DialogHeader = React33__namespace.forwardRef(function DialogHeader2(props, ref) {
|
|
2117
3219
|
const { startElement: startElementProp, onBackToClick, className, children, ...rest } = props;
|
|
2118
3220
|
const startElement = startElementProp ?? (onBackToClick ? /* @__PURE__ */ jsxRuntime.jsx(BackToButton, { onClick: onBackToClick }) : void 0);
|
|
2119
3221
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2143,7 +3245,7 @@ var DialogHeader = React30__namespace.forwardRef(function DialogHeader2(props, r
|
|
|
2143
3245
|
}
|
|
2144
3246
|
);
|
|
2145
3247
|
});
|
|
2146
|
-
var DialogBody =
|
|
3248
|
+
var DialogBody = React33__namespace.forwardRef(function DialogBody2({ className, pt, display, flexDir, style: styleProp, ...props }, ref) {
|
|
2147
3249
|
const bodyStyle = {
|
|
2148
3250
|
...styleProp,
|
|
2149
3251
|
...pt !== void 0 ? { paddingTop: typeof pt === "number" ? `${pt * 4}px` : pt } : {},
|
|
@@ -2160,7 +3262,7 @@ var DialogBody = React30__namespace.forwardRef(function DialogBody2({ className,
|
|
|
2160
3262
|
}
|
|
2161
3263
|
);
|
|
2162
3264
|
});
|
|
2163
|
-
var DialogFooter =
|
|
3265
|
+
var DialogFooter = React33__namespace.forwardRef(function DialogFooter2({ className, ...props }, ref) {
|
|
2164
3266
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2165
3267
|
"div",
|
|
2166
3268
|
{
|
|
@@ -2172,138 +3274,15 @@ var DialogFooter = React30__namespace.forwardRef(function DialogFooter2({ classN
|
|
|
2172
3274
|
});
|
|
2173
3275
|
var DialogBackdrop = gui.Dialog.Overlay;
|
|
2174
3276
|
var DialogTitle = gui.Dialog.Title;
|
|
2175
|
-
var DialogDescription = gui.Dialog.Description;
|
|
2176
|
-
var DialogTrigger = gui.Dialog.Trigger;
|
|
2177
|
-
var DialogActionTrigger = gui.Dialog.Close;
|
|
2178
|
-
var DrawerPlacementContext = React30__namespace.createContext("right");
|
|
2179
|
-
var DrawerSizeContext = React30__namespace.createContext("md");
|
|
2180
|
-
var DrawerRoot = (props) => {
|
|
2181
|
-
const {
|
|
2182
|
-
children,
|
|
2183
|
-
open,
|
|
2184
|
-
defaultOpen,
|
|
2185
|
-
onOpenChange,
|
|
2186
|
-
placement = "right",
|
|
2187
|
-
modal = true,
|
|
2188
|
-
size = "md"
|
|
2189
|
-
} = props;
|
|
2190
|
-
const handleOpenChange = React30__namespace.useCallback((nextOpen) => {
|
|
2191
|
-
onOpenChange?.({ open: nextOpen });
|
|
2192
|
-
}, [onOpenChange]);
|
|
2193
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2194
|
-
RadixDialog__namespace.Root,
|
|
2195
|
-
{
|
|
2196
|
-
open,
|
|
2197
|
-
defaultOpen,
|
|
2198
|
-
onOpenChange: handleOpenChange,
|
|
2199
|
-
modal,
|
|
2200
|
-
children
|
|
2201
|
-
}
|
|
2202
|
-
) }) });
|
|
2203
|
-
};
|
|
2204
|
-
var PLACEMENT_CLASSES = {
|
|
2205
|
-
right: [
|
|
2206
|
-
"inset-y-0 right-0",
|
|
2207
|
-
"data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
|
|
2208
|
-
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
|
|
2209
|
-
].join(" "),
|
|
2210
|
-
left: [
|
|
2211
|
-
"inset-y-0 left-0",
|
|
2212
|
-
"data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
|
|
2213
|
-
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
|
|
2214
|
-
].join(" "),
|
|
2215
|
-
top: [
|
|
2216
|
-
"inset-x-0 top-0",
|
|
2217
|
-
"data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
|
|
2218
|
-
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
|
|
2219
|
-
].join(" "),
|
|
2220
|
-
bottom: [
|
|
2221
|
-
"inset-x-0 bottom-0",
|
|
2222
|
-
"data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
|
|
2223
|
-
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
|
|
2224
|
-
].join(" ")
|
|
2225
|
-
};
|
|
2226
|
-
var SIZE_CLASSES6 = {
|
|
2227
|
-
right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
2228
|
-
left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
2229
|
-
top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
|
|
2230
|
-
bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
|
|
2231
|
-
};
|
|
2232
|
-
var DrawerContent = React30__namespace.forwardRef(
|
|
2233
|
-
function DrawerContent2(props, ref) {
|
|
2234
|
-
const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
|
|
2235
|
-
const placement = React30__namespace.useContext(DrawerPlacementContext);
|
|
2236
|
-
const size = React30__namespace.useContext(DrawerSizeContext);
|
|
2237
|
-
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2238
|
-
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2239
|
-
RadixDialog__namespace.Overlay,
|
|
2240
|
-
{
|
|
2241
|
-
className: cn(
|
|
2242
|
-
"fixed inset-0 z-50 bg-black/50",
|
|
2243
|
-
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
2244
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
|
|
2245
|
-
)
|
|
2246
|
-
}
|
|
2247
|
-
),
|
|
2248
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2249
|
-
RadixDialog__namespace.Content,
|
|
2250
|
-
{
|
|
2251
|
-
ref,
|
|
2252
|
-
className: cn(
|
|
2253
|
-
"fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
|
|
2254
|
-
PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
|
|
2255
|
-
SIZE_CLASSES6[placement]?.[size] ?? SIZE_CLASSES6.right?.md,
|
|
2256
|
-
className
|
|
2257
|
-
),
|
|
2258
|
-
...rest,
|
|
2259
|
-
children
|
|
2260
|
-
}
|
|
2261
|
-
)
|
|
2262
|
-
] });
|
|
2263
|
-
if (portalled) {
|
|
2264
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
2265
|
-
}
|
|
2266
|
-
return content;
|
|
2267
|
-
}
|
|
2268
|
-
);
|
|
2269
|
-
var DrawerCloseTrigger = React30__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
2270
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2271
|
-
CloseButton,
|
|
2272
|
-
{
|
|
2273
|
-
ref,
|
|
2274
|
-
className: cn("absolute top-7 right-5", props.className),
|
|
2275
|
-
...props
|
|
2276
|
-
}
|
|
2277
|
-
) });
|
|
2278
|
-
});
|
|
2279
|
-
var DrawerTrigger = (props) => {
|
|
2280
|
-
const { asChild = true, ...rest } = props;
|
|
2281
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Trigger, { asChild, ...rest });
|
|
2282
|
-
};
|
|
2283
|
-
var DrawerHeader = React30__namespace.forwardRef(
|
|
2284
|
-
function DrawerHeader2({ className, ...props }, ref) {
|
|
2285
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
|
|
2286
|
-
}
|
|
2287
|
-
);
|
|
2288
|
-
var DrawerBody = React30__namespace.forwardRef(
|
|
2289
|
-
function DrawerBody2({ className, ...props }, ref) {
|
|
2290
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
|
|
2291
|
-
}
|
|
2292
|
-
);
|
|
2293
|
-
var DrawerFooter = React30__namespace.forwardRef(
|
|
2294
|
-
function DrawerFooter2({ className, ...props }, ref) {
|
|
2295
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
|
|
2296
|
-
}
|
|
2297
|
-
);
|
|
2298
|
-
var DrawerTitle = RadixDialog__namespace.Title;
|
|
2299
|
-
var DrawerDescription = RadixDialog__namespace.Description;
|
|
2300
|
-
var DrawerActionTrigger = RadixDialog__namespace.Close;
|
|
3277
|
+
var DialogDescription = gui.Dialog.Description;
|
|
3278
|
+
var DialogTrigger = gui.Dialog.Trigger;
|
|
3279
|
+
var DialogActionTrigger = gui.Dialog.Close;
|
|
2301
3280
|
var apos = "\u2019";
|
|
2302
3281
|
function upperFirst(str) {
|
|
2303
3282
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
2304
3283
|
}
|
|
2305
3284
|
var ICONS = {};
|
|
2306
|
-
var EmptyState =
|
|
3285
|
+
var EmptyState = React33__namespace.forwardRef(
|
|
2307
3286
|
function EmptyState2(props, ref) {
|
|
2308
3287
|
const { title, description, term, type = "query", icon, children, className, ...rest } = props;
|
|
2309
3288
|
const titleContent = (() => {
|
|
@@ -2363,7 +3342,7 @@ function getComponentDisplayName(type) {
|
|
|
2363
3342
|
if ("displayName" in type) return type.displayName;
|
|
2364
3343
|
return void 0;
|
|
2365
3344
|
}
|
|
2366
|
-
var Field =
|
|
3345
|
+
var Field = React33__namespace.forwardRef(
|
|
2367
3346
|
function Field2(props, ref) {
|
|
2368
3347
|
const {
|
|
2369
3348
|
label,
|
|
@@ -2415,14 +3394,14 @@ var Field = React30__namespace.forwardRef(
|
|
|
2415
3394
|
}
|
|
2416
3395
|
);
|
|
2417
3396
|
const helperTextElement = helperText ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-xs text-[var(--color-text-secondary,theme(colors.gray.400))]", children: helperText }) : null;
|
|
2418
|
-
const child2 =
|
|
3397
|
+
const child2 = React33__namespace.Children.only(children);
|
|
2419
3398
|
const isInputGroup = getComponentDisplayName(child2.type) === "InputGroup";
|
|
2420
3399
|
if (isInputGroup) {
|
|
2421
|
-
const inputElement2 =
|
|
2422
|
-
|
|
3400
|
+
const inputElement2 = React33__namespace.cloneElement(
|
|
3401
|
+
React33__namespace.Children.only(child2.props.children),
|
|
2423
3402
|
injectedProps2
|
|
2424
3403
|
);
|
|
2425
|
-
const groupInputElement =
|
|
3404
|
+
const groupInputElement = React33__namespace.cloneElement(
|
|
2426
3405
|
child2,
|
|
2427
3406
|
{},
|
|
2428
3407
|
inputElement2,
|
|
@@ -2445,7 +3424,7 @@ var Field = React30__namespace.forwardRef(
|
|
|
2445
3424
|
}
|
|
2446
3425
|
);
|
|
2447
3426
|
}
|
|
2448
|
-
const inputElement =
|
|
3427
|
+
const inputElement = React33__namespace.cloneElement(child2, injectedProps2);
|
|
2449
3428
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2450
3429
|
"div",
|
|
2451
3430
|
{
|
|
@@ -2467,8 +3446,8 @@ var Field = React30__namespace.forwardRef(
|
|
|
2467
3446
|
const injectedProps = {
|
|
2468
3447
|
size
|
|
2469
3448
|
};
|
|
2470
|
-
const child =
|
|
2471
|
-
const clonedChild =
|
|
3449
|
+
const child = React33__namespace.Children.only(children);
|
|
3450
|
+
const clonedChild = React33__namespace.cloneElement(child, injectedProps);
|
|
2472
3451
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2473
3452
|
"div",
|
|
2474
3453
|
{
|
|
@@ -2504,22 +3483,23 @@ var Field = React30__namespace.forwardRef(
|
|
|
2504
3483
|
);
|
|
2505
3484
|
}
|
|
2506
3485
|
);
|
|
2507
|
-
var LEVEL_TAG = { "1":
|
|
3486
|
+
var LEVEL_TAG = { "1": gui.H1, "2": gui.H2, "3": gui.H3 };
|
|
2508
3487
|
var LEVEL_CLASSES = {
|
|
2509
3488
|
"1": "text-[18px] leading-[24px] font-medium lg:text-[32px] lg:leading-[40px] lg:tracking-[-0.5px]",
|
|
2510
3489
|
"2": "text-[16px] leading-[24px] font-medium lg:text-[24px] lg:leading-[32px]",
|
|
2511
3490
|
"3": "text-[14px] leading-[20px] font-semibold lg:text-[18px] lg:leading-[24px] lg:font-medium"
|
|
2512
3491
|
};
|
|
2513
3492
|
var BASE_CLASSES4 = "font-heading text-heading";
|
|
2514
|
-
var Heading =
|
|
3493
|
+
var Heading = React33__namespace.default.forwardRef(
|
|
2515
3494
|
function Heading2({ level, className, mb, size: _size, style: styleProp, ...rest }, ref) {
|
|
2516
|
-
const Tag3 = level ? LEVEL_TAG[level] :
|
|
3495
|
+
const Tag3 = level ? LEVEL_TAG[level] : gui.H2;
|
|
2517
3496
|
const levelClasses = level ? LEVEL_CLASSES[level] : void 0;
|
|
2518
3497
|
const mergedStyle = mb !== void 0 ? { ...styleProp, marginBottom: typeof mb === "number" ? `${mb * 4}px` : mb } : styleProp;
|
|
2519
3498
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2520
3499
|
Tag3,
|
|
2521
3500
|
{
|
|
2522
3501
|
ref,
|
|
3502
|
+
unstyled: true,
|
|
2523
3503
|
className: cn(BASE_CLASSES4, levelClasses, className),
|
|
2524
3504
|
style: mergedStyle,
|
|
2525
3505
|
...rest
|
|
@@ -2597,7 +3577,7 @@ var ICON_SIZE_CLASSES = {
|
|
|
2597
3577
|
md: "[&_svg]:size-5"
|
|
2598
3578
|
};
|
|
2599
3579
|
var SP2 = 4;
|
|
2600
|
-
var IconButton =
|
|
3580
|
+
var IconButton = React33__namespace.forwardRef(
|
|
2601
3581
|
function IconButton2(props, ref) {
|
|
2602
3582
|
const {
|
|
2603
3583
|
size,
|
|
@@ -2648,7 +3628,7 @@ var IconButton = React30__namespace.forwardRef(
|
|
|
2648
3628
|
ref,
|
|
2649
3629
|
size,
|
|
2650
3630
|
disabled: !loadingSkeleton && (loading || disabled) || void 0,
|
|
2651
|
-
render: _as ?
|
|
3631
|
+
render: _as ? React33__namespace.createElement(_as) : void 0,
|
|
2652
3632
|
className: combinedClassName,
|
|
2653
3633
|
style: mergedStyle,
|
|
2654
3634
|
...expanded ? { "data-expanded": true } : {},
|
|
@@ -2819,31 +3799,31 @@ function extractStyleProps(props) {
|
|
|
2819
3799
|
}
|
|
2820
3800
|
return { styleProps, rest };
|
|
2821
3801
|
}
|
|
2822
|
-
var
|
|
2823
|
-
function
|
|
3802
|
+
var Image = React33__namespace.default.forwardRef(
|
|
3803
|
+
function Image2(props, ref) {
|
|
2824
3804
|
const { fallback, src, onLoad, onError, skeletonWidth, skeletonHeight, alt, className, style: styleProp, ...allRest } = props;
|
|
2825
3805
|
const { styleProps, rest: extraProps } = extractStyleProps(allRest);
|
|
2826
|
-
const [loading, setLoading] =
|
|
2827
|
-
const [error, setError] =
|
|
2828
|
-
const handleLoadError =
|
|
3806
|
+
const [loading, setLoading] = React33__namespace.default.useState(true);
|
|
3807
|
+
const [error, setError] = React33__namespace.default.useState(false);
|
|
3808
|
+
const handleLoadError = React33__namespace.default.useCallback((event) => {
|
|
2829
3809
|
setError(true);
|
|
2830
3810
|
setLoading(false);
|
|
2831
3811
|
onError?.(event);
|
|
2832
3812
|
}, [onError]);
|
|
2833
|
-
const handleLoadSuccess =
|
|
3813
|
+
const handleLoadSuccess = React33__namespace.default.useCallback((event) => {
|
|
2834
3814
|
setLoading(false);
|
|
2835
3815
|
onLoad?.(event);
|
|
2836
3816
|
}, [onLoad]);
|
|
2837
3817
|
const passthroughProps = allRest;
|
|
2838
3818
|
if (!src && fallback) {
|
|
2839
|
-
if (
|
|
2840
|
-
return
|
|
3819
|
+
if (React33__namespace.default.isValidElement(fallback)) {
|
|
3820
|
+
return React33__namespace.default.cloneElement(fallback, passthroughProps);
|
|
2841
3821
|
}
|
|
2842
3822
|
return fallback;
|
|
2843
3823
|
}
|
|
2844
3824
|
if (error) {
|
|
2845
|
-
if (
|
|
2846
|
-
return
|
|
3825
|
+
if (React33__namespace.default.isValidElement(fallback)) {
|
|
3826
|
+
return React33__namespace.default.cloneElement(fallback, passthroughProps);
|
|
2847
3827
|
}
|
|
2848
3828
|
return fallback;
|
|
2849
3829
|
}
|
|
@@ -2899,9 +3879,9 @@ var INPUT_VARIANT_CLASSES = {
|
|
|
2899
3879
|
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
2900
3880
|
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
2901
3881
|
};
|
|
2902
|
-
var Input =
|
|
3882
|
+
var Input = React33__namespace.default.forwardRef(
|
|
2903
3883
|
({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
|
|
2904
|
-
const handleChange =
|
|
3884
|
+
const handleChange = React33__namespace.default.useCallback(
|
|
2905
3885
|
(event) => {
|
|
2906
3886
|
onChange?.(event);
|
|
2907
3887
|
onChangeText?.(event.target.value);
|
|
@@ -2909,9 +3889,10 @@ var Input = React30__namespace.default.forwardRef(
|
|
|
2909
3889
|
[onChange, onChangeText]
|
|
2910
3890
|
);
|
|
2911
3891
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2912
|
-
|
|
3892
|
+
gui.Input,
|
|
2913
3893
|
{
|
|
2914
3894
|
ref,
|
|
3895
|
+
unstyled: true,
|
|
2915
3896
|
className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
|
|
2916
3897
|
...rest,
|
|
2917
3898
|
onChange: handleChange
|
|
@@ -2925,7 +3906,7 @@ function getComponentDisplayName2(type) {
|
|
|
2925
3906
|
if ("displayName" in type) return type.displayName;
|
|
2926
3907
|
return void 0;
|
|
2927
3908
|
}
|
|
2928
|
-
var InputGroup =
|
|
3909
|
+
var InputGroup = React33__namespace.forwardRef(
|
|
2929
3910
|
function InputGroup2(props, ref) {
|
|
2930
3911
|
const {
|
|
2931
3912
|
startElement,
|
|
@@ -2938,11 +3919,11 @@ var InputGroup = React30__namespace.forwardRef(
|
|
|
2938
3919
|
className,
|
|
2939
3920
|
...rest
|
|
2940
3921
|
} = props;
|
|
2941
|
-
const startElementRef =
|
|
2942
|
-
const endElementRef =
|
|
2943
|
-
const groupRef =
|
|
2944
|
-
const [inlinePaddings, setInlinePaddings] =
|
|
2945
|
-
const calculateInlinePaddings =
|
|
3922
|
+
const startElementRef = React33__namespace.useRef(null);
|
|
3923
|
+
const endElementRef = React33__namespace.useRef(null);
|
|
3924
|
+
const groupRef = React33__namespace.useRef(null);
|
|
3925
|
+
const [inlinePaddings, setInlinePaddings] = React33__namespace.useState();
|
|
3926
|
+
const calculateInlinePaddings = React33__namespace.useCallback(() => {
|
|
2946
3927
|
const startWidth = startElementRef.current?.getBoundingClientRect().width ?? 0;
|
|
2947
3928
|
const endWidth = endElementRef.current?.getBoundingClientRect().width ?? 0;
|
|
2948
3929
|
setInlinePaddings({
|
|
@@ -2950,7 +3931,7 @@ var InputGroup = React30__namespace.forwardRef(
|
|
|
2950
3931
|
end: endWidth
|
|
2951
3932
|
});
|
|
2952
3933
|
}, []);
|
|
2953
|
-
|
|
3934
|
+
React33__namespace.useEffect(() => {
|
|
2954
3935
|
if (!groupRef.current) return;
|
|
2955
3936
|
let timeoutId;
|
|
2956
3937
|
const intersectionObserver = new IntersectionObserver(
|
|
@@ -2970,7 +3951,7 @@ var InputGroup = React30__namespace.forwardRef(
|
|
|
2970
3951
|
}
|
|
2971
3952
|
};
|
|
2972
3953
|
}, [calculateInlinePaddings]);
|
|
2973
|
-
|
|
3954
|
+
React33__namespace.useEffect(() => {
|
|
2974
3955
|
calculateInlinePaddings();
|
|
2975
3956
|
const resizeHandler = esToolkit.debounce(calculateInlinePaddings, 300);
|
|
2976
3957
|
const resizeObserver = new ResizeObserver(resizeHandler);
|
|
@@ -2981,7 +3962,7 @@ var InputGroup = React30__namespace.forwardRef(
|
|
|
2981
3962
|
resizeObserver.disconnect();
|
|
2982
3963
|
};
|
|
2983
3964
|
}, [calculateInlinePaddings]);
|
|
2984
|
-
const combinedRef =
|
|
3965
|
+
const combinedRef = React33__namespace.useCallback((node) => {
|
|
2985
3966
|
groupRef.current = node;
|
|
2986
3967
|
if (typeof ref === "function") {
|
|
2987
3968
|
ref(node);
|
|
@@ -3010,11 +3991,11 @@ var InputGroup = React30__namespace.forwardRef(
|
|
|
3010
3991
|
children: startElement
|
|
3011
3992
|
}
|
|
3012
3993
|
),
|
|
3013
|
-
|
|
3994
|
+
React33__namespace.Children.map(children, (child) => {
|
|
3014
3995
|
if (getComponentDisplayName2(child.type) !== "FieldInput") {
|
|
3015
3996
|
return child;
|
|
3016
3997
|
}
|
|
3017
|
-
return
|
|
3998
|
+
return React33__namespace.cloneElement(child, {
|
|
3018
3999
|
...startElement && { ps: startOffset ?? (inlinePaddings?.start ? `${inlinePaddings.start}px` : void 0) },
|
|
3019
4000
|
...endElement && { pe: endOffset ?? (inlinePaddings?.end ? `${inlinePaddings.end}px` : void 0) },
|
|
3020
4001
|
// hide input value and placeholder for the first render
|
|
@@ -3040,262 +4021,6 @@ var InputGroup = React30__namespace.forwardRef(
|
|
|
3040
4021
|
}
|
|
3041
4022
|
);
|
|
3042
4023
|
InputGroup.displayName = "InputGroup";
|
|
3043
|
-
function parsePlacement(placement) {
|
|
3044
|
-
if (!placement) {
|
|
3045
|
-
return { side: "bottom", align: "start" };
|
|
3046
|
-
}
|
|
3047
|
-
const parts = placement.split("-");
|
|
3048
|
-
const side = parts[0] ?? "bottom";
|
|
3049
|
-
const alignPart = parts[1];
|
|
3050
|
-
let align = "center";
|
|
3051
|
-
if (alignPart === "start") {
|
|
3052
|
-
align = "start";
|
|
3053
|
-
} else if (alignPart === "end") {
|
|
3054
|
-
align = "end";
|
|
3055
|
-
}
|
|
3056
|
-
return { side, align };
|
|
3057
|
-
}
|
|
3058
|
-
var PositioningContext = React30__namespace.createContext({
|
|
3059
|
-
side: "bottom",
|
|
3060
|
-
align: "start",
|
|
3061
|
-
sideOffset: 4,
|
|
3062
|
-
alignOffset: 0
|
|
3063
|
-
});
|
|
3064
|
-
var MenuRoot = (props) => {
|
|
3065
|
-
const {
|
|
3066
|
-
children,
|
|
3067
|
-
open,
|
|
3068
|
-
defaultOpen,
|
|
3069
|
-
onOpenChange,
|
|
3070
|
-
positioning,
|
|
3071
|
-
modal = true,
|
|
3072
|
-
// lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
|
|
3073
|
-
// mount/unmount automatically.
|
|
3074
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3075
|
-
lazyMount: _lazyMount,
|
|
3076
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3077
|
-
unmountOnExit: _unmountOnExit
|
|
3078
|
-
} = props;
|
|
3079
|
-
const mergedPositioning = {
|
|
3080
|
-
placement: "bottom-start",
|
|
3081
|
-
...positioning,
|
|
3082
|
-
offset: {
|
|
3083
|
-
mainAxis: 4,
|
|
3084
|
-
...positioning?.offset
|
|
3085
|
-
}
|
|
3086
|
-
};
|
|
3087
|
-
const { side, align } = parsePlacement(mergedPositioning.placement);
|
|
3088
|
-
const positioningValue = React30__namespace.useMemo(() => ({
|
|
3089
|
-
side,
|
|
3090
|
-
align,
|
|
3091
|
-
sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
|
|
3092
|
-
alignOffset: mergedPositioning.offset?.crossAxis ?? 0
|
|
3093
|
-
}), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
|
|
3094
|
-
const handleOpenChange = React30__namespace.useCallback((isOpen) => {
|
|
3095
|
-
onOpenChange?.({ open: isOpen });
|
|
3096
|
-
}, [onOpenChange]);
|
|
3097
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3098
|
-
DropdownMenu__namespace.Root,
|
|
3099
|
-
{
|
|
3100
|
-
open,
|
|
3101
|
-
defaultOpen,
|
|
3102
|
-
onOpenChange: handleOpenChange,
|
|
3103
|
-
modal,
|
|
3104
|
-
children
|
|
3105
|
-
}
|
|
3106
|
-
) });
|
|
3107
|
-
};
|
|
3108
|
-
var MenuTrigger = React30__namespace.forwardRef(function MenuTrigger2(props, ref) {
|
|
3109
|
-
const { asChild = false, ...rest } = props;
|
|
3110
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild, ref, ...rest });
|
|
3111
|
-
});
|
|
3112
|
-
var MenuContent = React30__namespace.forwardRef(function MenuContent2(props, ref) {
|
|
3113
|
-
const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
|
|
3114
|
-
const positioning = React30__namespace.useContext(PositioningContext);
|
|
3115
|
-
const mergedStyle = {
|
|
3116
|
-
...style,
|
|
3117
|
-
...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
|
|
3118
|
-
...minW !== void 0 ? { minWidth: minW } : {}
|
|
3119
|
-
};
|
|
3120
|
-
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3121
|
-
DropdownMenu__namespace.Content,
|
|
3122
|
-
{
|
|
3123
|
-
ref,
|
|
3124
|
-
side: positioning.side,
|
|
3125
|
-
align: positioning.align,
|
|
3126
|
-
sideOffset: positioning.sideOffset,
|
|
3127
|
-
alignOffset: positioning.alignOffset,
|
|
3128
|
-
className: cn(
|
|
3129
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
|
|
3130
|
-
"border border-[var(--color-popover-border,var(--color-border-divider))]",
|
|
3131
|
-
"bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
|
|
3132
|
-
"shadow-[0_4px_12px_var(--color-popover-shadow)]",
|
|
3133
|
-
"outline-none",
|
|
3134
|
-
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
3135
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3136
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
3137
|
-
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
3138
|
-
className
|
|
3139
|
-
),
|
|
3140
|
-
style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
|
|
3141
|
-
...rest
|
|
3142
|
-
}
|
|
3143
|
-
);
|
|
3144
|
-
if (!portalled) {
|
|
3145
|
-
return content;
|
|
3146
|
-
}
|
|
3147
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
3148
|
-
});
|
|
3149
|
-
var MenuItem = React30__namespace.forwardRef(function MenuItem2(props, ref) {
|
|
3150
|
-
const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
|
|
3151
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3152
|
-
DropdownMenu__namespace.Item,
|
|
3153
|
-
{
|
|
3154
|
-
ref,
|
|
3155
|
-
asChild,
|
|
3156
|
-
disabled,
|
|
3157
|
-
onClick,
|
|
3158
|
-
className: cn(
|
|
3159
|
-
"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
|
|
3160
|
-
"outline-none transition-colors",
|
|
3161
|
-
"text-[var(--color-text-primary,inherit)]",
|
|
3162
|
-
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
3163
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3164
|
-
className
|
|
3165
|
-
),
|
|
3166
|
-
...rest,
|
|
3167
|
-
children
|
|
3168
|
-
}
|
|
3169
|
-
);
|
|
3170
|
-
});
|
|
3171
|
-
var MenuItemText = React30__namespace.forwardRef(function MenuItemText2(props, ref) {
|
|
3172
|
-
const { className, ...rest } = props;
|
|
3173
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn("flex-1", className), ...rest });
|
|
3174
|
-
});
|
|
3175
|
-
React30__namespace.forwardRef(function MenuItemCommand2(props, ref) {
|
|
3176
|
-
const { className, ...rest } = props;
|
|
3177
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3178
|
-
"span",
|
|
3179
|
-
{
|
|
3180
|
-
ref,
|
|
3181
|
-
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
3182
|
-
...rest
|
|
3183
|
-
}
|
|
3184
|
-
);
|
|
3185
|
-
});
|
|
3186
|
-
var MenuSeparator = React30__namespace.forwardRef(function MenuSeparator2(props, ref) {
|
|
3187
|
-
const { className, ...rest } = props;
|
|
3188
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3189
|
-
DropdownMenu__namespace.Separator,
|
|
3190
|
-
{
|
|
3191
|
-
ref,
|
|
3192
|
-
className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
|
|
3193
|
-
...rest
|
|
3194
|
-
}
|
|
3195
|
-
);
|
|
3196
|
-
});
|
|
3197
|
-
var MenuItemGroup = React30__namespace.forwardRef(function MenuItemGroup2(props, ref) {
|
|
3198
|
-
const { title, children, className, ...rest } = props;
|
|
3199
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Group, { ref, className, ...rest, children: [
|
|
3200
|
-
title && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
|
|
3201
|
-
children
|
|
3202
|
-
] });
|
|
3203
|
-
});
|
|
3204
|
-
var MenuArrow = React30__namespace.forwardRef(function MenuArrow2(props, ref) {
|
|
3205
|
-
const { className, ...rest } = props;
|
|
3206
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3207
|
-
DropdownMenu__namespace.Arrow,
|
|
3208
|
-
{
|
|
3209
|
-
ref,
|
|
3210
|
-
className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
|
|
3211
|
-
...rest
|
|
3212
|
-
}
|
|
3213
|
-
);
|
|
3214
|
-
});
|
|
3215
|
-
var MenuCheckboxItem = React30__namespace.forwardRef(function MenuCheckboxItem2(props, ref) {
|
|
3216
|
-
const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
|
|
3217
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3218
|
-
DropdownMenu__namespace.CheckboxItem,
|
|
3219
|
-
{
|
|
3220
|
-
ref,
|
|
3221
|
-
checked,
|
|
3222
|
-
onCheckedChange,
|
|
3223
|
-
onClick,
|
|
3224
|
-
className: cn(
|
|
3225
|
-
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
|
|
3226
|
-
"outline-none transition-colors",
|
|
3227
|
-
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
3228
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3229
|
-
className
|
|
3230
|
-
),
|
|
3231
|
-
...rest,
|
|
3232
|
-
children: [
|
|
3233
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuCheck, { className: "h-4 w-4" }) }) }),
|
|
3234
|
-
children
|
|
3235
|
-
]
|
|
3236
|
-
}
|
|
3237
|
-
);
|
|
3238
|
-
});
|
|
3239
|
-
var MenuRadioItemGroup = React30__namespace.forwardRef(function MenuRadioItemGroup2(props, ref) {
|
|
3240
|
-
const { value, onValueChange, ...rest } = props;
|
|
3241
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3242
|
-
DropdownMenu__namespace.RadioGroup,
|
|
3243
|
-
{
|
|
3244
|
-
ref,
|
|
3245
|
-
value,
|
|
3246
|
-
onValueChange,
|
|
3247
|
-
...rest
|
|
3248
|
-
}
|
|
3249
|
-
);
|
|
3250
|
-
});
|
|
3251
|
-
var MenuRadioItem = React30__namespace.forwardRef(function MenuRadioItem2(props, ref) {
|
|
3252
|
-
const { className, children, value, onClick, ...rest } = props;
|
|
3253
|
-
const { value: _v, ...radixRest } = rest;
|
|
3254
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3255
|
-
DropdownMenu__namespace.RadioItem,
|
|
3256
|
-
{
|
|
3257
|
-
ref,
|
|
3258
|
-
value,
|
|
3259
|
-
onClick,
|
|
3260
|
-
className: cn(
|
|
3261
|
-
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
|
|
3262
|
-
"outline-none transition-colors",
|
|
3263
|
-
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
3264
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3265
|
-
className
|
|
3266
|
-
),
|
|
3267
|
-
children: [
|
|
3268
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuCheck, { className: "h-4 w-4" }) }) }),
|
|
3269
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
3270
|
-
]
|
|
3271
|
-
}
|
|
3272
|
-
);
|
|
3273
|
-
});
|
|
3274
|
-
React30__namespace.forwardRef(function MenuContextTrigger2(props, ref) {
|
|
3275
|
-
const { asChild: _asChild, ...rest } = props;
|
|
3276
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, ...rest });
|
|
3277
|
-
});
|
|
3278
|
-
var MenuTriggerItem = React30__namespace.forwardRef(function MenuTriggerItem2(props, ref) {
|
|
3279
|
-
const { startIcon, children, className, ...rest } = props;
|
|
3280
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3281
|
-
DropdownMenu__namespace.SubTrigger,
|
|
3282
|
-
{
|
|
3283
|
-
ref,
|
|
3284
|
-
className: cn(
|
|
3285
|
-
"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
|
|
3286
|
-
"outline-none transition-colors",
|
|
3287
|
-
"data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
|
|
3288
|
-
className
|
|
3289
|
-
),
|
|
3290
|
-
...rest,
|
|
3291
|
-
children: [
|
|
3292
|
-
startIcon,
|
|
3293
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children }),
|
|
3294
|
-
/* @__PURE__ */ jsxRuntime.jsx(lu.LuChevronRight, { className: "h-4 w-4" })
|
|
3295
|
-
]
|
|
3296
|
-
}
|
|
3297
|
-
) });
|
|
3298
|
-
});
|
|
3299
4024
|
var INPUT_BASE2 = [
|
|
3300
4025
|
"w-10 h-10",
|
|
3301
4026
|
"text-center text-sm font-medium",
|
|
@@ -3310,7 +4035,7 @@ var INPUT_BASE2 = [
|
|
|
3310
4035
|
].join(" ");
|
|
3311
4036
|
var INPUT_FILLED = "border-[var(--color-input-border)]";
|
|
3312
4037
|
var INPUT_INVALID = "border-[var(--color-border-error)] hover:border-[var(--color-border-error)]";
|
|
3313
|
-
var PinInput =
|
|
4038
|
+
var PinInput = React33__namespace.forwardRef(
|
|
3314
4039
|
function PinInput2(props, ref) {
|
|
3315
4040
|
const {
|
|
3316
4041
|
count = 6,
|
|
@@ -3328,12 +4053,12 @@ var PinInput = React30__namespace.forwardRef(
|
|
|
3328
4053
|
bgColor,
|
|
3329
4054
|
className
|
|
3330
4055
|
} = props;
|
|
3331
|
-
const inputRefs =
|
|
3332
|
-
const values =
|
|
4056
|
+
const inputRefs = React33__namespace.useRef([]);
|
|
4057
|
+
const values = React33__namespace.useMemo(
|
|
3333
4058
|
() => controlledValue ?? Array.from({ length: count }).fill(""),
|
|
3334
4059
|
[controlledValue, count]
|
|
3335
4060
|
);
|
|
3336
|
-
const updateValue =
|
|
4061
|
+
const updateValue = React33__namespace.useCallback((index, char) => {
|
|
3337
4062
|
const next = [...values];
|
|
3338
4063
|
next[index] = char;
|
|
3339
4064
|
onValueChange?.({ value: next });
|
|
@@ -3341,11 +4066,11 @@ var PinInput = React30__namespace.forwardRef(
|
|
|
3341
4066
|
onValueComplete?.({ value: next });
|
|
3342
4067
|
}
|
|
3343
4068
|
}, [values, onValueChange, onValueComplete]);
|
|
3344
|
-
const focusInput =
|
|
4069
|
+
const focusInput = React33__namespace.useCallback((index) => {
|
|
3345
4070
|
const clamped = Math.max(0, Math.min(index, count - 1));
|
|
3346
4071
|
inputRefs.current[clamped]?.focus();
|
|
3347
4072
|
}, [count]);
|
|
3348
|
-
const handleInput =
|
|
4073
|
+
const handleInput = React33__namespace.useCallback((index, e) => {
|
|
3349
4074
|
const target = e.currentTarget;
|
|
3350
4075
|
const char = target.value.slice(-1);
|
|
3351
4076
|
updateValue(index, char);
|
|
@@ -3353,7 +4078,7 @@ var PinInput = React30__namespace.forwardRef(
|
|
|
3353
4078
|
focusInput(index + 1);
|
|
3354
4079
|
}
|
|
3355
4080
|
}, [count, updateValue, focusInput]);
|
|
3356
|
-
const handleKeyDown =
|
|
4081
|
+
const handleKeyDown = React33__namespace.useCallback((index, e) => {
|
|
3357
4082
|
if (e.key === "Backspace") {
|
|
3358
4083
|
if (values[index]) {
|
|
3359
4084
|
updateValue(index, "");
|
|
@@ -3370,7 +4095,7 @@ var PinInput = React30__namespace.forwardRef(
|
|
|
3370
4095
|
e.preventDefault();
|
|
3371
4096
|
}
|
|
3372
4097
|
}, [count, values, updateValue, focusInput]);
|
|
3373
|
-
const handlePaste =
|
|
4098
|
+
const handlePaste = React33__namespace.useCallback((e) => {
|
|
3374
4099
|
e.preventDefault();
|
|
3375
4100
|
const pasted = e.clipboardData.getData("text/plain").trim();
|
|
3376
4101
|
if (!pasted) {
|
|
@@ -3387,18 +4112,18 @@ var PinInput = React30__namespace.forwardRef(
|
|
|
3387
4112
|
}
|
|
3388
4113
|
focusInput(Math.min(chars.length, count - 1));
|
|
3389
4114
|
}, [count, values, onValueChange, onValueComplete, focusInput]);
|
|
3390
|
-
const handleFocus =
|
|
4115
|
+
const handleFocus = React33__namespace.useCallback((e) => {
|
|
3391
4116
|
e.currentTarget.select();
|
|
3392
4117
|
}, []);
|
|
3393
|
-
const handleNoop =
|
|
4118
|
+
const handleNoop = React33__namespace.useCallback(() => {
|
|
3394
4119
|
}, []);
|
|
3395
|
-
const setInputRef =
|
|
4120
|
+
const setInputRef = React33__namespace.useCallback((index) => (el) => {
|
|
3396
4121
|
inputRefs.current[index] = el;
|
|
3397
4122
|
}, []);
|
|
3398
|
-
const onInputAtIndex =
|
|
4123
|
+
const onInputAtIndex = React33__namespace.useCallback((index) => (e) => {
|
|
3399
4124
|
handleInput(index, e);
|
|
3400
4125
|
}, [handleInput]);
|
|
3401
|
-
const onKeyDownAtIndex =
|
|
4126
|
+
const onKeyDownAtIndex = React33__namespace.useCallback((index) => (e) => {
|
|
3402
4127
|
handleKeyDown(index, e);
|
|
3403
4128
|
}, [handleKeyDown]);
|
|
3404
4129
|
const bgStyle = bgColor ? { backgroundColor: `var(--color-${bgColor.replace(/\./g, "-")})` } : void 0;
|
|
@@ -3459,7 +4184,7 @@ function parsePlacement2(placement) {
|
|
|
3459
4184
|
}
|
|
3460
4185
|
return { side, align };
|
|
3461
4186
|
}
|
|
3462
|
-
var PositioningContext2 =
|
|
4187
|
+
var PositioningContext2 = React33__namespace.createContext({
|
|
3463
4188
|
side: "bottom",
|
|
3464
4189
|
align: "start",
|
|
3465
4190
|
sideOffset: 4,
|
|
@@ -3493,7 +4218,7 @@ var PopoverRoot = (props) => {
|
|
|
3493
4218
|
}
|
|
3494
4219
|
};
|
|
3495
4220
|
const { side, align } = parsePlacement2(mergedPositioning.placement);
|
|
3496
|
-
const positioningValue =
|
|
4221
|
+
const positioningValue = React33__namespace.useMemo(() => ({
|
|
3497
4222
|
side,
|
|
3498
4223
|
align,
|
|
3499
4224
|
sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
|
|
@@ -3510,7 +4235,7 @@ var PopoverRoot = (props) => {
|
|
|
3510
4235
|
autoFocus,
|
|
3511
4236
|
closeOnInteractOutside
|
|
3512
4237
|
]);
|
|
3513
|
-
const handleOpenChange =
|
|
4238
|
+
const handleOpenChange = React33__namespace.useCallback((isOpen) => {
|
|
3514
4239
|
onOpenChange?.({ open: isOpen });
|
|
3515
4240
|
}, [onOpenChange]);
|
|
3516
4241
|
const placement = mergedPositioning.placement ?? "bottom-start";
|
|
@@ -3528,11 +4253,11 @@ var PopoverRoot = (props) => {
|
|
|
3528
4253
|
}
|
|
3529
4254
|
) });
|
|
3530
4255
|
};
|
|
3531
|
-
var PopoverTrigger =
|
|
4256
|
+
var PopoverTrigger = React33__namespace.forwardRef(function PopoverTrigger2(props, ref) {
|
|
3532
4257
|
const { asChild = true, ...rest } = props;
|
|
3533
4258
|
return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Trigger, { asChild: asChild ? "except-style" : void 0, ref, ...rest });
|
|
3534
4259
|
});
|
|
3535
|
-
var PopoverContent =
|
|
4260
|
+
var PopoverContent = React33__namespace.forwardRef(function PopoverContent2(props, ref) {
|
|
3536
4261
|
const { portalled = true, portalRef: _portalRef, className, w, minW, maxW, paddingTop, style: styleProp, ...rest } = props;
|
|
3537
4262
|
const resolvedW = typeof w === "object" ? w.base ?? w.lg : w;
|
|
3538
4263
|
const contentStyle = {
|
|
@@ -3563,7 +4288,7 @@ var PopoverContent = React30__namespace.forwardRef(function PopoverContent2(prop
|
|
|
3563
4288
|
}
|
|
3564
4289
|
);
|
|
3565
4290
|
});
|
|
3566
|
-
var PopoverArrow =
|
|
4291
|
+
var PopoverArrow = React33__namespace.forwardRef(function PopoverArrow2(props, ref) {
|
|
3567
4292
|
const { className, ...rest } = props;
|
|
3568
4293
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3569
4294
|
gui.Popover.Arrow,
|
|
@@ -3575,7 +4300,7 @@ var PopoverArrow = React30__namespace.forwardRef(function PopoverArrow2(props, r
|
|
|
3575
4300
|
}
|
|
3576
4301
|
);
|
|
3577
4302
|
});
|
|
3578
|
-
var PopoverCloseTrigger =
|
|
4303
|
+
var PopoverCloseTrigger = React33__namespace.forwardRef(function PopoverCloseTrigger2(props, ref) {
|
|
3579
4304
|
const { className, ...rest } = props;
|
|
3580
4305
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3581
4306
|
gui.Popover.Close,
|
|
@@ -3589,14 +4314,14 @@ var PopoverCloseTrigger = React30__namespace.forwardRef(function PopoverCloseTri
|
|
|
3589
4314
|
}
|
|
3590
4315
|
);
|
|
3591
4316
|
});
|
|
3592
|
-
var PopoverCloseTriggerWrapper =
|
|
4317
|
+
var PopoverCloseTriggerWrapper = React33__namespace.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
|
|
3593
4318
|
const { disabled, children, ...rest } = props;
|
|
3594
4319
|
if (disabled) {
|
|
3595
4320
|
return children;
|
|
3596
4321
|
}
|
|
3597
4322
|
return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Close, { ref, ...rest, asChild: true, children });
|
|
3598
4323
|
});
|
|
3599
|
-
var PopoverBody =
|
|
4324
|
+
var PopoverBody = React33__namespace.forwardRef(function PopoverBody2(props, ref) {
|
|
3600
4325
|
const {
|
|
3601
4326
|
className,
|
|
3602
4327
|
style: styleProp,
|
|
@@ -3634,7 +4359,7 @@ var PopoverBody = React30__namespace.forwardRef(function PopoverBody2(props, ref
|
|
|
3634
4359
|
}
|
|
3635
4360
|
);
|
|
3636
4361
|
});
|
|
3637
|
-
var PopoverHeader =
|
|
4362
|
+
var PopoverHeader = React33__namespace.forwardRef(function PopoverHeader2(props, ref) {
|
|
3638
4363
|
const { className, ...rest } = props;
|
|
3639
4364
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3640
4365
|
"div",
|
|
@@ -3645,7 +4370,7 @@ var PopoverHeader = React30__namespace.forwardRef(function PopoverHeader2(props,
|
|
|
3645
4370
|
}
|
|
3646
4371
|
);
|
|
3647
4372
|
});
|
|
3648
|
-
var PopoverFooter =
|
|
4373
|
+
var PopoverFooter = React33__namespace.forwardRef(function PopoverFooter2(props, ref) {
|
|
3649
4374
|
const { className, ...rest } = props;
|
|
3650
4375
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3651
4376
|
"div",
|
|
@@ -3656,7 +4381,7 @@ var PopoverFooter = React30__namespace.forwardRef(function PopoverFooter2(props,
|
|
|
3656
4381
|
}
|
|
3657
4382
|
);
|
|
3658
4383
|
});
|
|
3659
|
-
var PopoverTitle =
|
|
4384
|
+
var PopoverTitle = React33__namespace.forwardRef(function PopoverTitle2(props, ref) {
|
|
3660
4385
|
const { className, ...rest } = props;
|
|
3661
4386
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3662
4387
|
"h3",
|
|
@@ -3667,7 +4392,7 @@ var PopoverTitle = React30__namespace.forwardRef(function PopoverTitle2(props, r
|
|
|
3667
4392
|
}
|
|
3668
4393
|
);
|
|
3669
4394
|
});
|
|
3670
|
-
var PopoverDescription =
|
|
4395
|
+
var PopoverDescription = React33__namespace.forwardRef(function PopoverDescription2(props, ref) {
|
|
3671
4396
|
const { className, ...rest } = props;
|
|
3672
4397
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3673
4398
|
"p",
|
|
@@ -3689,7 +4414,7 @@ function normalizeValue(value, min, max) {
|
|
|
3689
4414
|
if (max <= min) return 0;
|
|
3690
4415
|
return Math.round((value - min) / (max - min) * 100);
|
|
3691
4416
|
}
|
|
3692
|
-
var Progress =
|
|
4417
|
+
var Progress = React33__namespace.forwardRef(
|
|
3693
4418
|
function Progress2(props, ref) {
|
|
3694
4419
|
const {
|
|
3695
4420
|
value,
|
|
@@ -3729,10 +4454,11 @@ var Progress = React30__namespace.forwardRef(
|
|
|
3729
4454
|
style: rootStyle,
|
|
3730
4455
|
...rest,
|
|
3731
4456
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3732
|
-
|
|
4457
|
+
gui.Progress,
|
|
3733
4458
|
{
|
|
3734
4459
|
value: percent,
|
|
3735
4460
|
max: 100,
|
|
4461
|
+
unstyled: true,
|
|
3736
4462
|
className: cn(
|
|
3737
4463
|
"w-full overflow-hidden rounded-full",
|
|
3738
4464
|
"bg-[var(--color-progress-track)]",
|
|
@@ -3741,14 +4467,15 @@ var Progress = React30__namespace.forwardRef(
|
|
|
3741
4467
|
),
|
|
3742
4468
|
style: trackStyle,
|
|
3743
4469
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3744
|
-
|
|
4470
|
+
gui.Progress.Indicator,
|
|
3745
4471
|
{
|
|
4472
|
+
unstyled: true,
|
|
4473
|
+
transition: "slow",
|
|
3746
4474
|
className: cn(
|
|
3747
|
-
"h-full rounded-full
|
|
4475
|
+
"h-full rounded-full",
|
|
3748
4476
|
!color && "bg-[var(--color-progress-indicator)]"
|
|
3749
4477
|
),
|
|
3750
4478
|
style: {
|
|
3751
|
-
width: `${percent}%`,
|
|
3752
4479
|
...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
|
|
3753
4480
|
}
|
|
3754
4481
|
}
|
|
@@ -3766,12 +4493,12 @@ var SIZE_MAP = {
|
|
|
3766
4493
|
lg: { size: 48, thickness: 7, textClass: "text-sm" },
|
|
3767
4494
|
xl: { size: 64, thickness: 8, textClass: "text-sm" }
|
|
3768
4495
|
};
|
|
3769
|
-
var Ctx =
|
|
4496
|
+
var Ctx = React33__namespace.createContext({
|
|
3770
4497
|
value: 0,
|
|
3771
4498
|
size: "md",
|
|
3772
4499
|
colorPalette: "blue"
|
|
3773
4500
|
});
|
|
3774
|
-
var ProgressCircleRoot =
|
|
4501
|
+
var ProgressCircleRoot = React33__namespace.forwardRef(function ProgressCircleRoot2(props, ref) {
|
|
3775
4502
|
const {
|
|
3776
4503
|
value = 0,
|
|
3777
4504
|
size = "md",
|
|
@@ -3780,7 +4507,7 @@ var ProgressCircleRoot = React30__namespace.forwardRef(function ProgressCircleRo
|
|
|
3780
4507
|
children,
|
|
3781
4508
|
...rest
|
|
3782
4509
|
} = props;
|
|
3783
|
-
const ctx =
|
|
4510
|
+
const ctx = React33__namespace.useMemo(
|
|
3784
4511
|
() => ({ value: value ?? null, size, colorPalette }),
|
|
3785
4512
|
[value, size, colorPalette]
|
|
3786
4513
|
);
|
|
@@ -3798,9 +4525,9 @@ var ProgressCircleRoot = React30__namespace.forwardRef(function ProgressCircleRo
|
|
|
3798
4525
|
}
|
|
3799
4526
|
) });
|
|
3800
4527
|
});
|
|
3801
|
-
var ProgressCircleRing =
|
|
4528
|
+
var ProgressCircleRing = React33__namespace.forwardRef(function ProgressCircleRing2(props, ref) {
|
|
3802
4529
|
const { trackColor, cap, color, className, ...rest } = props;
|
|
3803
|
-
const { value, size: sizeKey } =
|
|
4530
|
+
const { value, size: sizeKey } = React33__namespace.useContext(Ctx);
|
|
3804
4531
|
const { size, thickness } = SIZE_MAP[sizeKey];
|
|
3805
4532
|
const radius = size / 2 - thickness / 2;
|
|
3806
4533
|
const circumference = 2 * Math.PI * radius;
|
|
@@ -3855,9 +4582,9 @@ var ProgressCircleRing = React30__namespace.forwardRef(function ProgressCircleRi
|
|
|
3855
4582
|
}
|
|
3856
4583
|
);
|
|
3857
4584
|
});
|
|
3858
|
-
var ProgressCircleValueText =
|
|
4585
|
+
var ProgressCircleValueText = React33__namespace.forwardRef(function ProgressCircleValueText2(props, ref) {
|
|
3859
4586
|
const { className, children, ...rest } = props;
|
|
3860
|
-
const { value, size: sizeKey } =
|
|
4587
|
+
const { value, size: sizeKey } = React33__namespace.useContext(Ctx);
|
|
3861
4588
|
const { textClass } = SIZE_MAP[sizeKey];
|
|
3862
4589
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3863
4590
|
"div",
|
|
@@ -3901,8 +4628,8 @@ var SIZE_CLASSES8 = {
|
|
|
3901
4628
|
label: "text-base"
|
|
3902
4629
|
}
|
|
3903
4630
|
};
|
|
3904
|
-
var RadioSizeContext =
|
|
3905
|
-
var RadioGroupBase =
|
|
4631
|
+
var RadioSizeContext = React33__namespace.createContext("md");
|
|
4632
|
+
var RadioGroupBase = React33__namespace.forwardRef(
|
|
3906
4633
|
function RadioGroup2(props, ref) {
|
|
3907
4634
|
const {
|
|
3908
4635
|
children,
|
|
@@ -3911,7 +4638,8 @@ var RadioGroupBase = React30__namespace.forwardRef(
|
|
|
3911
4638
|
disabled = false,
|
|
3912
4639
|
readOnly = false,
|
|
3913
4640
|
orientation = "vertical",
|
|
3914
|
-
loop
|
|
4641
|
+
// `loop` was a Radix-only knob; gui's roving focus always wraps.
|
|
4642
|
+
loop: _loop = true,
|
|
3915
4643
|
defaultValue,
|
|
3916
4644
|
value,
|
|
3917
4645
|
onValueChange,
|
|
@@ -3919,7 +4647,7 @@ var RadioGroupBase = React30__namespace.forwardRef(
|
|
|
3919
4647
|
className,
|
|
3920
4648
|
...rest
|
|
3921
4649
|
} = props;
|
|
3922
|
-
const handleValueChange =
|
|
4650
|
+
const handleValueChange = React33__namespace.useCallback(
|
|
3923
4651
|
(nextValue) => {
|
|
3924
4652
|
if (readOnly) return;
|
|
3925
4653
|
onValueChange?.({ value: nextValue });
|
|
@@ -3927,14 +4655,14 @@ var RadioGroupBase = React30__namespace.forwardRef(
|
|
|
3927
4655
|
[readOnly, onValueChange]
|
|
3928
4656
|
);
|
|
3929
4657
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3930
|
-
|
|
4658
|
+
gui.RadioGroup,
|
|
3931
4659
|
{
|
|
3932
4660
|
ref,
|
|
4661
|
+
unstyled: true,
|
|
3933
4662
|
name,
|
|
3934
4663
|
required,
|
|
3935
4664
|
disabled: disabled || readOnly,
|
|
3936
4665
|
orientation,
|
|
3937
|
-
loop,
|
|
3938
4666
|
defaultValue,
|
|
3939
4667
|
value: value ?? void 0,
|
|
3940
4668
|
onValueChange: handleValueChange,
|
|
@@ -3952,10 +4680,10 @@ var RadioGroupBase = React30__namespace.forwardRef(
|
|
|
3952
4680
|
var RadioGroup3 = RadioGroupBase;
|
|
3953
4681
|
var NOOP2 = () => {
|
|
3954
4682
|
};
|
|
3955
|
-
var RadioBase =
|
|
4683
|
+
var RadioBase = React33__namespace.forwardRef(
|
|
3956
4684
|
function Radio(props, ref) {
|
|
3957
4685
|
const { children, inputProps, rootRef, value, disabled, className, ...rest } = props;
|
|
3958
|
-
const size =
|
|
4686
|
+
const size = React33__namespace.useContext(RadioSizeContext);
|
|
3959
4687
|
const sizeClasses2 = SIZE_CLASSES8[size];
|
|
3960
4688
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3961
4689
|
"label",
|
|
@@ -3971,8 +4699,9 @@ var RadioBase = React30__namespace.forwardRef(
|
|
|
3971
4699
|
...rest,
|
|
3972
4700
|
children: [
|
|
3973
4701
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3974
|
-
|
|
4702
|
+
gui.RadioGroup.Item,
|
|
3975
4703
|
{
|
|
4704
|
+
unstyled: true,
|
|
3976
4705
|
value,
|
|
3977
4706
|
disabled,
|
|
3978
4707
|
className: cn(
|
|
@@ -3984,8 +4713,9 @@ var RadioBase = React30__namespace.forwardRef(
|
|
|
3984
4713
|
sizeClasses2.control
|
|
3985
4714
|
),
|
|
3986
4715
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3987
|
-
|
|
4716
|
+
gui.RadioGroup.Indicator,
|
|
3988
4717
|
{
|
|
4718
|
+
unstyled: true,
|
|
3989
4719
|
className: cn(
|
|
3990
4720
|
"block rounded-full bg-gray-800 dark:bg-white",
|
|
3991
4721
|
sizeClasses2.indicator
|
|
@@ -4017,23 +4747,23 @@ var RadioBase = React30__namespace.forwardRef(
|
|
|
4017
4747
|
var Radio2 = RadioBase;
|
|
4018
4748
|
var StarFilledIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) });
|
|
4019
4749
|
var StarOutlineIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z", strokeWidth: "1.5" }) });
|
|
4020
|
-
var Rating =
|
|
4750
|
+
var Rating = React33__namespace.forwardRef(
|
|
4021
4751
|
function Rating2(props, ref) {
|
|
4022
4752
|
const { count = 5, label: labelProp, defaultValue = 0, onValueChange, readOnly, className, ...rest } = props;
|
|
4023
|
-
const [value, setValue] =
|
|
4024
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
4753
|
+
const [value, setValue] = React33__namespace.useState(defaultValue);
|
|
4754
|
+
const [hoveredIndex, setHoveredIndex] = React33__namespace.useState(-1);
|
|
4025
4755
|
const highlightedIndex = hoveredIndex >= 0 && !readOnly ? hoveredIndex + 1 : value;
|
|
4026
4756
|
const label = Array.isArray(labelProp) ? labelProp[highlightedIndex - 1] : labelProp;
|
|
4027
|
-
const handleClick =
|
|
4757
|
+
const handleClick = React33__namespace.useCallback((index) => () => {
|
|
4028
4758
|
if (readOnly) return;
|
|
4029
4759
|
setValue(index);
|
|
4030
4760
|
onValueChange?.({ value: index });
|
|
4031
4761
|
}, [readOnly, onValueChange]);
|
|
4032
|
-
const handleMouseEnter =
|
|
4762
|
+
const handleMouseEnter = React33__namespace.useCallback((index) => () => {
|
|
4033
4763
|
if (readOnly) return;
|
|
4034
4764
|
setHoveredIndex(index);
|
|
4035
4765
|
}, [readOnly]);
|
|
4036
|
-
const handleMouseLeave =
|
|
4766
|
+
const handleMouseLeave = React33__namespace.useCallback(() => {
|
|
4037
4767
|
setHoveredIndex(-1);
|
|
4038
4768
|
}, []);
|
|
4039
4769
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("inline-flex items-center gap-1", className), ...rest, children: [
|
|
@@ -4067,8 +4797,8 @@ function createListCollection(config2) {
|
|
|
4067
4797
|
var ArrowIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
4068
4798
|
var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.667 5L7.5 14.167 3.333 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
4069
4799
|
function FilterInput({ placeholder, initialValue = "", onChange }) {
|
|
4070
|
-
const [value, setValue] =
|
|
4071
|
-
const handleChange =
|
|
4800
|
+
const [value, setValue] = React33__namespace.useState(initialValue);
|
|
4801
|
+
const handleChange = React33__namespace.useCallback((e) => {
|
|
4072
4802
|
setValue(e.target.value);
|
|
4073
4803
|
onChange?.(e.target.value);
|
|
4074
4804
|
}, [onChange]);
|
|
@@ -4087,15 +4817,15 @@ function FilterInput({ placeholder, initialValue = "", onChange }) {
|
|
|
4087
4817
|
}
|
|
4088
4818
|
);
|
|
4089
4819
|
}
|
|
4090
|
-
var SelectInternalContext =
|
|
4820
|
+
var SelectInternalContext = React33__namespace.createContext(null);
|
|
4091
4821
|
function useSelectInternalContext() {
|
|
4092
|
-
const ctx =
|
|
4822
|
+
const ctx = React33__namespace.useContext(SelectInternalContext);
|
|
4093
4823
|
if (!ctx) {
|
|
4094
4824
|
throw new Error("Select compound components must be rendered inside <SelectRoot>");
|
|
4095
4825
|
}
|
|
4096
4826
|
return ctx;
|
|
4097
4827
|
}
|
|
4098
|
-
var SelectRoot =
|
|
4828
|
+
var SelectRoot = React33__namespace.forwardRef(
|
|
4099
4829
|
function SelectRoot2(props, ref) {
|
|
4100
4830
|
const {
|
|
4101
4831
|
children,
|
|
@@ -4126,21 +4856,21 @@ var SelectRoot = React30__namespace.forwardRef(
|
|
|
4126
4856
|
hideFrom: _hideFrom
|
|
4127
4857
|
} = props;
|
|
4128
4858
|
const collection = collectionProp ?? createListCollection({ items: [] });
|
|
4129
|
-
const [internalValue, setInternalValue] =
|
|
4859
|
+
const [internalValue, setInternalValue] = React33__namespace.useState(defaultValueArr ?? []);
|
|
4130
4860
|
const currentValue = valueProp ?? internalValue;
|
|
4131
|
-
const selectedItems =
|
|
4861
|
+
const selectedItems = React33__namespace.useMemo(() => {
|
|
4132
4862
|
return currentValue.map((v) => collection.items.find((item) => item.value === v)).filter(Boolean);
|
|
4133
4863
|
}, [currentValue, collection.items]);
|
|
4134
|
-
const [open, setOpen] =
|
|
4864
|
+
const [open, setOpen] = React33__namespace.useState(defaultOpen ?? false);
|
|
4135
4865
|
const isOpen = openProp ?? open;
|
|
4136
|
-
const handleOpenChange =
|
|
4866
|
+
const handleOpenChange = React33__namespace.useCallback((nextOpen) => {
|
|
4137
4867
|
setOpen(nextOpen);
|
|
4138
4868
|
onOpenChange?.(nextOpen);
|
|
4139
4869
|
if (!nextOpen) {
|
|
4140
4870
|
onInteractOutside?.();
|
|
4141
4871
|
}
|
|
4142
4872
|
}, [onOpenChange, onInteractOutside]);
|
|
4143
|
-
const handleRadixValueChange =
|
|
4873
|
+
const handleRadixValueChange = React33__namespace.useCallback((radixValue) => {
|
|
4144
4874
|
const nextArr = [radixValue];
|
|
4145
4875
|
if (!valueProp) {
|
|
4146
4876
|
setInternalValue(nextArr);
|
|
@@ -4148,7 +4878,7 @@ var SelectRoot = React30__namespace.forwardRef(
|
|
|
4148
4878
|
const items = collection.items.filter((item) => nextArr.includes(item.value));
|
|
4149
4879
|
onValueChangeProp?.({ value: nextArr, items });
|
|
4150
4880
|
}, [valueProp, collection.items, onValueChangeProp]);
|
|
4151
|
-
const ctxValue =
|
|
4881
|
+
const ctxValue = React33__namespace.useMemo(() => ({
|
|
4152
4882
|
value: currentValue,
|
|
4153
4883
|
selectedItems,
|
|
4154
4884
|
collection,
|
|
@@ -4168,7 +4898,7 @@ var SelectRoot = React30__namespace.forwardRef(
|
|
|
4168
4898
|
if (typeof v === "string") return v;
|
|
4169
4899
|
return v.base ?? v.lg ?? Object.values(v)[0];
|
|
4170
4900
|
};
|
|
4171
|
-
const inlineStyle =
|
|
4901
|
+
const inlineStyle = React33__namespace.useMemo(() => {
|
|
4172
4902
|
const s = { ...style };
|
|
4173
4903
|
const rw = resolveVal(w);
|
|
4174
4904
|
if (rw) s.width = rw;
|
|
@@ -4206,7 +4936,7 @@ var SelectRoot = React30__namespace.forwardRef(
|
|
|
4206
4936
|
) });
|
|
4207
4937
|
}
|
|
4208
4938
|
);
|
|
4209
|
-
var SelectControl =
|
|
4939
|
+
var SelectControl = React33__namespace.forwardRef(
|
|
4210
4940
|
function SelectControl2(props, ref) {
|
|
4211
4941
|
const { children, noIndicator, triggerProps, loading, defaultValue } = props;
|
|
4212
4942
|
const ctx = useSelectInternalContext();
|
|
@@ -4243,11 +4973,11 @@ var SelectControl = React30__namespace.forwardRef(
|
|
|
4243
4973
|
return trigger;
|
|
4244
4974
|
}
|
|
4245
4975
|
);
|
|
4246
|
-
var SelectClearTrigger =
|
|
4976
|
+
var SelectClearTrigger = React33__namespace.forwardRef(
|
|
4247
4977
|
function SelectClearTrigger2(props, ref) {
|
|
4248
4978
|
const { className, ...rest } = props;
|
|
4249
4979
|
const ctx = useSelectInternalContext();
|
|
4250
|
-
const handleClick =
|
|
4980
|
+
const handleClick = React33__namespace.useCallback(() => {
|
|
4251
4981
|
ctx.onValueChange({ value: [], items: [] });
|
|
4252
4982
|
}, [ctx]);
|
|
4253
4983
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4264,7 +4994,7 @@ var SelectClearTrigger = React30__namespace.forwardRef(
|
|
|
4264
4994
|
);
|
|
4265
4995
|
}
|
|
4266
4996
|
);
|
|
4267
|
-
var SelectContent =
|
|
4997
|
+
var SelectContent = React33__namespace.forwardRef(
|
|
4268
4998
|
function SelectContent2(props, ref) {
|
|
4269
4999
|
const { portalled = true, portalRef, children, className, ...rest } = props;
|
|
4270
5000
|
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4291,7 +5021,7 @@ var SelectContent = React30__namespace.forwardRef(
|
|
|
4291
5021
|
return content;
|
|
4292
5022
|
}
|
|
4293
5023
|
);
|
|
4294
|
-
var SelectItem =
|
|
5024
|
+
var SelectItem = React33__namespace.forwardRef(
|
|
4295
5025
|
function SelectItem2(props, ref) {
|
|
4296
5026
|
const { item, children, className, ...rest } = props;
|
|
4297
5027
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4319,7 +5049,7 @@ var SelectItem = React30__namespace.forwardRef(
|
|
|
4319
5049
|
);
|
|
4320
5050
|
}
|
|
4321
5051
|
);
|
|
4322
|
-
var SelectValueText =
|
|
5052
|
+
var SelectValueText = React33__namespace.forwardRef(
|
|
4323
5053
|
function SelectValueText2(props, ref) {
|
|
4324
5054
|
const { children, size, required, invalid, errorText, mode, className, style, placeholder: placeholderProp, ...rest } = props;
|
|
4325
5055
|
const ctx = useSelectInternalContext();
|
|
@@ -4375,7 +5105,7 @@ var SelectValueText = React30__namespace.forwardRef(
|
|
|
4375
5105
|
);
|
|
4376
5106
|
}
|
|
4377
5107
|
);
|
|
4378
|
-
var SelectItemGroup =
|
|
5108
|
+
var SelectItemGroup = React33__namespace.forwardRef(
|
|
4379
5109
|
function SelectItemGroup2(props, ref) {
|
|
4380
5110
|
const { children, label, className, ...rest } = props;
|
|
4381
5111
|
return /* @__PURE__ */ jsxRuntime.jsxs(RadixSelect__namespace.Group, { ref, className: cn("py-1", className), ...rest, children: [
|
|
@@ -4386,7 +5116,7 @@ var SelectItemGroup = React30__namespace.forwardRef(
|
|
|
4386
5116
|
);
|
|
4387
5117
|
var SelectLabel = RadixSelect__namespace.Label;
|
|
4388
5118
|
var SelectItemText = RadixSelect__namespace.ItemText;
|
|
4389
|
-
var Select =
|
|
5119
|
+
var Select = React33__namespace.forwardRef((props, ref) => {
|
|
4390
5120
|
const { collection, placeholder, portalled = true, loading, errorText, contentProps, contentHeader, itemFilter, mode, ...rest } = props;
|
|
4391
5121
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4392
5122
|
SelectRoot,
|
|
@@ -4408,7 +5138,7 @@ var Select = React30__namespace.forwardRef((props, ref) => {
|
|
|
4408
5138
|
) }),
|
|
4409
5139
|
/* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { portalled, ...contentProps, children: [
|
|
4410
5140
|
contentHeader,
|
|
4411
|
-
collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5141
|
+
collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React33__namespace.Fragment, { children: [
|
|
4412
5142
|
/* @__PURE__ */ jsxRuntime.jsx(SelectItem, { item, children: item.renderLabel ? item.renderLabel("item") : item.label }),
|
|
4413
5143
|
item.afterElement
|
|
4414
5144
|
] }, item.value))
|
|
@@ -4417,19 +5147,19 @@ var Select = React30__namespace.forwardRef((props, ref) => {
|
|
|
4417
5147
|
}
|
|
4418
5148
|
);
|
|
4419
5149
|
});
|
|
4420
|
-
var SelectAsync =
|
|
5150
|
+
var SelectAsync = React33__namespace.forwardRef((props, ref) => {
|
|
4421
5151
|
const { placeholder, portalled = true, loading, loadOptions, extraControls, onValueChange, errorText, mode, contentHeader, ...rest } = props;
|
|
4422
|
-
const [collection, setCollection] =
|
|
4423
|
-
const [inputValue, setInputValue] =
|
|
4424
|
-
const [value, setValue] =
|
|
5152
|
+
const [collection, setCollection] = React33__namespace.useState(createListCollection({ items: [] }));
|
|
5153
|
+
const [inputValue, setInputValue] = React33__namespace.useState("");
|
|
5154
|
+
const [value, setValue] = React33__namespace.useState([]);
|
|
4425
5155
|
const debouncedInputValue = usehooks.useDebounce(inputValue, 300);
|
|
4426
|
-
|
|
5156
|
+
React33__namespace.useEffect(() => {
|
|
4427
5157
|
loadOptions(debouncedInputValue, value).then(setCollection);
|
|
4428
5158
|
}, [debouncedInputValue, loadOptions, value]);
|
|
4429
|
-
const handleFilterChange =
|
|
5159
|
+
const handleFilterChange = React33__namespace.useCallback((val) => {
|
|
4430
5160
|
setInputValue(val);
|
|
4431
5161
|
}, []);
|
|
4432
|
-
const handleValueChange =
|
|
5162
|
+
const handleValueChange = React33__namespace.useCallback(({ value: v, items }) => {
|
|
4433
5163
|
setValue(v);
|
|
4434
5164
|
onValueChange?.({ value: v, items });
|
|
4435
5165
|
}, [onValueChange]);
|
|
@@ -4488,13 +5218,14 @@ var VERTICAL_SIZE_CLASSES = {
|
|
|
4488
5218
|
md: "border-l-2",
|
|
4489
5219
|
lg: "border-l-[3px]"
|
|
4490
5220
|
};
|
|
4491
|
-
var Separator2 =
|
|
5221
|
+
var Separator2 = React33__namespace.default.forwardRef(
|
|
4492
5222
|
function Separator3({ orientation = "horizontal", variant = "solid", size = "sm", className, ...rest }, ref) {
|
|
4493
5223
|
const isVertical = orientation === "vertical";
|
|
4494
5224
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4495
|
-
|
|
5225
|
+
gui.Separator,
|
|
4496
5226
|
{
|
|
4497
5227
|
ref,
|
|
5228
|
+
vertical: isVertical,
|
|
4498
5229
|
role: "separator",
|
|
4499
5230
|
"aria-orientation": orientation,
|
|
4500
5231
|
className: cn(
|
|
@@ -4510,9 +5241,7 @@ var Separator2 = React30__namespace.default.forwardRef(
|
|
|
4510
5241
|
);
|
|
4511
5242
|
}
|
|
4512
5243
|
);
|
|
4513
|
-
var
|
|
4514
|
-
var TRACK_HEIGHT = 6;
|
|
4515
|
-
var Slider = React30__namespace.forwardRef(
|
|
5244
|
+
var Slider = React33__namespace.forwardRef(
|
|
4516
5245
|
function Slider2(props, ref) {
|
|
4517
5246
|
const {
|
|
4518
5247
|
marks: marksProp,
|
|
@@ -4524,7 +5253,7 @@ var Slider = React30__namespace.forwardRef(
|
|
|
4524
5253
|
max = 100,
|
|
4525
5254
|
step,
|
|
4526
5255
|
disabled,
|
|
4527
|
-
orientation,
|
|
5256
|
+
orientation = "horizontal",
|
|
4528
5257
|
name,
|
|
4529
5258
|
onValueChange,
|
|
4530
5259
|
onValueCommit,
|
|
@@ -4536,6 +5265,14 @@ var Slider = React30__namespace.forwardRef(
|
|
|
4536
5265
|
return mark;
|
|
4537
5266
|
});
|
|
4538
5267
|
const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
|
|
5268
|
+
const latest = React33__namespace.useRef(value ?? defaultValue ?? []);
|
|
5269
|
+
const handleValueChange = React33__namespace.useCallback((next) => {
|
|
5270
|
+
latest.current = next;
|
|
5271
|
+
onValueChange?.(next);
|
|
5272
|
+
}, [onValueChange]);
|
|
5273
|
+
const handleSlideEnd = React33__namespace.useCallback(() => {
|
|
5274
|
+
onValueCommit?.(latest.current);
|
|
5275
|
+
}, [onValueCommit]);
|
|
4539
5276
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
4540
5277
|
label && !showValue && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-text-secondary", children: label }),
|
|
4541
5278
|
label && showValue && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4543,9 +5280,10 @@ var Slider = React30__namespace.forwardRef(
|
|
|
4543
5280
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-text-secondary", children: (value ?? defaultValue ?? [])?.join(", ") })
|
|
4544
5281
|
] }),
|
|
4545
5282
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4546
|
-
|
|
5283
|
+
gui.Slider,
|
|
4547
5284
|
{
|
|
4548
5285
|
ref,
|
|
5286
|
+
unstyled: true,
|
|
4549
5287
|
className: cn(
|
|
4550
5288
|
"relative flex w-full touch-none select-none items-center",
|
|
4551
5289
|
hasMarkLabel && "mb-6"
|
|
@@ -4558,24 +5296,30 @@ var Slider = React30__namespace.forwardRef(
|
|
|
4558
5296
|
disabled,
|
|
4559
5297
|
orientation,
|
|
4560
5298
|
name,
|
|
4561
|
-
onValueChange,
|
|
4562
|
-
|
|
5299
|
+
onValueChange: handleValueChange,
|
|
5300
|
+
onSlideEnd: handleSlideEnd,
|
|
4563
5301
|
children: [
|
|
4564
5302
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4565
|
-
|
|
5303
|
+
gui.Slider.Track,
|
|
4566
5304
|
{
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
5305
|
+
unstyled: true,
|
|
5306
|
+
className: "relative grow h-1.5 rounded-full bg-border-divider",
|
|
5307
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5308
|
+
gui.Slider.TrackActive,
|
|
5309
|
+
{
|
|
5310
|
+
unstyled: true,
|
|
5311
|
+
className: "absolute h-full rounded-full bg-link-primary"
|
|
5312
|
+
}
|
|
5313
|
+
)
|
|
4572
5314
|
}
|
|
4573
5315
|
),
|
|
4574
5316
|
resolvedValue?.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4575
|
-
|
|
5317
|
+
gui.Slider.Thumb,
|
|
4576
5318
|
{
|
|
5319
|
+
index,
|
|
5320
|
+
unstyled: true,
|
|
4577
5321
|
className: cn(
|
|
4578
|
-
|
|
5322
|
+
"block h-5 w-5",
|
|
4579
5323
|
"rounded-full border-2 border-link-primary bg-white",
|
|
4580
5324
|
"shadow-sm transition-colors",
|
|
4581
5325
|
"hover:border-link-primary-hover",
|
|
@@ -4617,21 +5361,21 @@ var NOOP3 = () => {
|
|
|
4617
5361
|
var SIZE_CLASSES9 = {
|
|
4618
5362
|
sm: {
|
|
4619
5363
|
root: "h-4 w-7",
|
|
4620
|
-
thumb: "h-3 w-3
|
|
5364
|
+
thumb: "h-3 w-3",
|
|
4621
5365
|
label: "text-xs"
|
|
4622
5366
|
},
|
|
4623
5367
|
md: {
|
|
4624
5368
|
root: "h-5 w-9",
|
|
4625
|
-
thumb: "h-4 w-4
|
|
5369
|
+
thumb: "h-4 w-4",
|
|
4626
5370
|
label: "text-sm"
|
|
4627
5371
|
},
|
|
4628
5372
|
lg: {
|
|
4629
5373
|
root: "h-6 w-11",
|
|
4630
|
-
thumb: "h-5 w-5
|
|
5374
|
+
thumb: "h-5 w-5",
|
|
4631
5375
|
label: "text-base"
|
|
4632
5376
|
}
|
|
4633
5377
|
};
|
|
4634
|
-
var SwitchBase =
|
|
5378
|
+
var SwitchBase = React33__namespace.forwardRef(
|
|
4635
5379
|
function Switch(props, ref) {
|
|
4636
5380
|
const {
|
|
4637
5381
|
inputProps,
|
|
@@ -4650,17 +5394,15 @@ var SwitchBase = React30__namespace.forwardRef(
|
|
|
4650
5394
|
className,
|
|
4651
5395
|
...rest
|
|
4652
5396
|
} = props;
|
|
4653
|
-
const [internalChecked, setInternalChecked] =
|
|
5397
|
+
const [internalChecked, setInternalChecked] = React33__namespace.useState(defaultChecked ?? false);
|
|
4654
5398
|
const isControlled = checkedProp !== void 0;
|
|
4655
5399
|
const checkedState = isControlled ? checkedProp : internalChecked;
|
|
4656
|
-
const handleCheckedChange =
|
|
5400
|
+
const handleCheckedChange = React33__namespace.useCallback(
|
|
4657
5401
|
(nextChecked) => {
|
|
4658
5402
|
if (!isControlled) {
|
|
4659
5403
|
setInternalChecked(nextChecked);
|
|
4660
5404
|
}
|
|
4661
|
-
|
|
4662
|
-
onCheckedChange({ checked: nextChecked });
|
|
4663
|
-
}
|
|
5405
|
+
onCheckedChange?.({ checked: nextChecked });
|
|
4664
5406
|
},
|
|
4665
5407
|
[isControlled, onCheckedChange]
|
|
4666
5408
|
);
|
|
@@ -4681,8 +5423,9 @@ var SwitchBase = React30__namespace.forwardRef(
|
|
|
4681
5423
|
...rest,
|
|
4682
5424
|
children: [
|
|
4683
5425
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4684
|
-
|
|
5426
|
+
gui.Switch,
|
|
4685
5427
|
{
|
|
5428
|
+
unstyled: true,
|
|
4686
5429
|
checked: checkedState,
|
|
4687
5430
|
onCheckedChange: handleCheckedChange,
|
|
4688
5431
|
disabled,
|
|
@@ -4697,12 +5440,13 @@ var SwitchBase = React30__namespace.forwardRef(
|
|
|
4697
5440
|
children: [
|
|
4698
5441
|
trackLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-0 flex items-center justify-center text-[8px] font-bold text-white pointer-events-none", children: checkedState ? trackLabel.on : trackLabel.off }),
|
|
4699
5442
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4700
|
-
|
|
5443
|
+
gui.Switch.Thumb,
|
|
4701
5444
|
{
|
|
5445
|
+
unstyled: true,
|
|
5446
|
+
"data-thumb": true,
|
|
5447
|
+
transition: "quicker",
|
|
4702
5448
|
className: cn(
|
|
4703
5449
|
"block rounded-full bg-white shadow-sm",
|
|
4704
|
-
"transition-transform duration-200",
|
|
4705
|
-
"translate-x-0.5",
|
|
4706
5450
|
sizeClasses2.thumb
|
|
4707
5451
|
),
|
|
4708
5452
|
children: thumbLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center h-full w-full text-[8px]", children: checkedState ? thumbLabel.on : thumbLabel.off })
|
|
@@ -4918,7 +5662,7 @@ function resolveResponsive(value) {
|
|
|
4918
5662
|
}
|
|
4919
5663
|
return void 0;
|
|
4920
5664
|
}
|
|
4921
|
-
var TableRoot =
|
|
5665
|
+
var TableRoot = React33__namespace.forwardRef(
|
|
4922
5666
|
function TableRoot2(props, ref) {
|
|
4923
5667
|
const { className, style: styleProp, children, ...other } = props;
|
|
4924
5668
|
const rawMinW = other.minWidth ?? other.minW;
|
|
@@ -4941,7 +5685,7 @@ var TableRoot = React30__namespace.forwardRef(
|
|
|
4941
5685
|
);
|
|
4942
5686
|
}
|
|
4943
5687
|
);
|
|
4944
|
-
var TableHeader =
|
|
5688
|
+
var TableHeader = React33__namespace.forwardRef(
|
|
4945
5689
|
function TableHeader2(props, ref) {
|
|
4946
5690
|
const { className, style: styleProp, children, ...other } = props;
|
|
4947
5691
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -4958,7 +5702,7 @@ var TableHeader = React30__namespace.forwardRef(
|
|
|
4958
5702
|
);
|
|
4959
5703
|
}
|
|
4960
5704
|
);
|
|
4961
|
-
var TableBody =
|
|
5705
|
+
var TableBody = React33__namespace.forwardRef(
|
|
4962
5706
|
function TableBody2(props, ref) {
|
|
4963
5707
|
const { className, style: styleProp, children, ...other } = props;
|
|
4964
5708
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -4975,7 +5719,7 @@ var TableBody = React30__namespace.forwardRef(
|
|
|
4975
5719
|
);
|
|
4976
5720
|
}
|
|
4977
5721
|
);
|
|
4978
|
-
var TableRow =
|
|
5722
|
+
var TableRow = React33__namespace.forwardRef(
|
|
4979
5723
|
function TableRow2(props, ref) {
|
|
4980
5724
|
const { className, style: styleProp, children, ...other } = props;
|
|
4981
5725
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -4992,7 +5736,7 @@ var TableRow = React30__namespace.forwardRef(
|
|
|
4992
5736
|
);
|
|
4993
5737
|
}
|
|
4994
5738
|
);
|
|
4995
|
-
var TableCell =
|
|
5739
|
+
var TableCell = React33__namespace.forwardRef(
|
|
4996
5740
|
function TableCell2(props, ref) {
|
|
4997
5741
|
const { isNumeric, className, style: styleProp, children, ...other } = props;
|
|
4998
5742
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -5013,7 +5757,7 @@ var TableCell = React30__namespace.forwardRef(
|
|
|
5013
5757
|
);
|
|
5014
5758
|
}
|
|
5015
5759
|
);
|
|
5016
|
-
var TableColumnHeader =
|
|
5760
|
+
var TableColumnHeader = React33__namespace.forwardRef(
|
|
5017
5761
|
function TableColumnHeader2(props, ref) {
|
|
5018
5762
|
const { isNumeric, className, style: styleProp, children, ...other } = props;
|
|
5019
5763
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -5040,7 +5784,7 @@ var TableColumnHeader = React30__namespace.forwardRef(
|
|
|
5040
5784
|
);
|
|
5041
5785
|
var TableColumnHeaderSortable = (props) => {
|
|
5042
5786
|
const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = "left", contentAfter, ...rest } = props;
|
|
5043
|
-
const handleSortToggle =
|
|
5787
|
+
const handleSortToggle = React33__namespace.useCallback(() => {
|
|
5044
5788
|
onSortToggle(sortField);
|
|
5045
5789
|
}, [onSortToggle, sortField]);
|
|
5046
5790
|
const isActive = sortValue.includes(sortField);
|
|
@@ -5066,16 +5810,16 @@ var TableColumnHeaderSortable = (props) => {
|
|
|
5066
5810
|
var ACTION_BAR_SHADOW = "0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)";
|
|
5067
5811
|
var TableHeaderSticky = (props) => {
|
|
5068
5812
|
const { top, children, className, style: styleProp, ...rest } = props;
|
|
5069
|
-
const ref =
|
|
5070
|
-
const [isStuck, setIsStuck] =
|
|
5071
|
-
const handleScroll =
|
|
5813
|
+
const ref = React33__namespace.useRef(null);
|
|
5814
|
+
const [isStuck, setIsStuck] = React33__namespace.useState(false);
|
|
5815
|
+
const handleScroll = React33__namespace.useCallback(() => {
|
|
5072
5816
|
if (Number(ref.current?.getBoundingClientRect().y) <= (Number(top) || 0)) {
|
|
5073
5817
|
setIsStuck(true);
|
|
5074
5818
|
} else {
|
|
5075
5819
|
setIsStuck(false);
|
|
5076
5820
|
}
|
|
5077
5821
|
}, [top]);
|
|
5078
|
-
|
|
5822
|
+
React33__namespace.useEffect(() => {
|
|
5079
5823
|
const throttledHandleScroll = esToolkit.throttle(handleScroll, 300);
|
|
5080
5824
|
window.addEventListener("scroll", throttledHandleScroll);
|
|
5081
5825
|
return () => {
|
|
@@ -5097,7 +5841,7 @@ var TableHeaderSticky = (props) => {
|
|
|
5097
5841
|
}
|
|
5098
5842
|
);
|
|
5099
5843
|
};
|
|
5100
|
-
var TableCaption =
|
|
5844
|
+
var TableCaption = React33__namespace.forwardRef(
|
|
5101
5845
|
function TableCaption2(props, ref) {
|
|
5102
5846
|
const { className, style: styleProp, children, ...other } = props;
|
|
5103
5847
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -5114,7 +5858,7 @@ var TableCaption = React30__namespace.forwardRef(
|
|
|
5114
5858
|
);
|
|
5115
5859
|
}
|
|
5116
5860
|
);
|
|
5117
|
-
var TableFooter =
|
|
5861
|
+
var TableFooter = React33__namespace.forwardRef(
|
|
5118
5862
|
function TableFooter2(props, ref) {
|
|
5119
5863
|
const { className, style: styleProp, children, ...other } = props;
|
|
5120
5864
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -5131,7 +5875,7 @@ var TableFooter = React30__namespace.forwardRef(
|
|
|
5131
5875
|
);
|
|
5132
5876
|
}
|
|
5133
5877
|
);
|
|
5134
|
-
var TableScrollWrapper =
|
|
5878
|
+
var TableScrollWrapper = React33__namespace.forwardRef(
|
|
5135
5879
|
function TableScrollWrapper2(props, ref) {
|
|
5136
5880
|
const { className, children, ...rest } = props;
|
|
5137
5881
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5150,7 +5894,7 @@ var ROOT_SIZE_CLASSES = {
|
|
|
5150
5894
|
md: "[--tabs-height:2.5rem] [--tabs-content-padding:1.5rem]",
|
|
5151
5895
|
free: ""
|
|
5152
5896
|
};
|
|
5153
|
-
var TabsRoot =
|
|
5897
|
+
var TabsRoot = React33__namespace.forwardRef(
|
|
5154
5898
|
function TabsRoot2(props, ref) {
|
|
5155
5899
|
const {
|
|
5156
5900
|
variant = "solid",
|
|
@@ -5162,7 +5906,7 @@ var TabsRoot = React30__namespace.forwardRef(
|
|
|
5162
5906
|
className,
|
|
5163
5907
|
...rest
|
|
5164
5908
|
} = props;
|
|
5165
|
-
const handleValueChange =
|
|
5909
|
+
const handleValueChange = React33__namespace.useCallback(
|
|
5166
5910
|
(value) => {
|
|
5167
5911
|
if (!onValueChange) return;
|
|
5168
5912
|
onValueChange({ value });
|
|
@@ -5187,7 +5931,7 @@ var TabsRoot = React30__namespace.forwardRef(
|
|
|
5187
5931
|
);
|
|
5188
5932
|
}
|
|
5189
5933
|
);
|
|
5190
|
-
var TabsList =
|
|
5934
|
+
var TabsList = React33__namespace.forwardRef(
|
|
5191
5935
|
function TabsList2(props, ref) {
|
|
5192
5936
|
const {
|
|
5193
5937
|
className,
|
|
@@ -5241,7 +5985,7 @@ var TRIGGER_VARIANT_CLASSES = {
|
|
|
5241
5985
|
segmented: "bg-transparent text-text-primary border-2 border-solid border-selected-control-bg hover:text-hover data-[state=active]:text-selected-control-text data-[state=active]:bg-selected-control-bg data-[state=active]:border-selected-control-bg data-[state=active]:hover:text-selected-control-text",
|
|
5242
5986
|
unstyled: ""
|
|
5243
5987
|
};
|
|
5244
|
-
var TabsTrigger =
|
|
5988
|
+
var TabsTrigger = React33__namespace.forwardRef(
|
|
5245
5989
|
function TabsTrigger2(props, ref) {
|
|
5246
5990
|
const {
|
|
5247
5991
|
className,
|
|
@@ -5261,7 +6005,7 @@ var TabsTrigger = React30__namespace.forwardRef(
|
|
|
5261
6005
|
visibility: _visibility,
|
|
5262
6006
|
...rest
|
|
5263
6007
|
} = props;
|
|
5264
|
-
const internalRef =
|
|
6008
|
+
const internalRef = React33__namespace.useRef(null);
|
|
5265
6009
|
const mergedRef = useMergedRef(ref, internalRef);
|
|
5266
6010
|
const { variant, size, fitted } = useTabsContext(internalRef);
|
|
5267
6011
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5281,7 +6025,7 @@ var TabsTrigger = React30__namespace.forwardRef(
|
|
|
5281
6025
|
);
|
|
5282
6026
|
}
|
|
5283
6027
|
);
|
|
5284
|
-
var TabsContent =
|
|
6028
|
+
var TabsContent = React33__namespace.forwardRef(
|
|
5285
6029
|
function TabsContent2(props, ref) {
|
|
5286
6030
|
const { className, padding: _padding, ...rest } = props;
|
|
5287
6031
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5315,8 +6059,8 @@ var TabsCounter = ({ count }) => {
|
|
|
5315
6059
|
);
|
|
5316
6060
|
};
|
|
5317
6061
|
function useTabsContext(triggerRef) {
|
|
5318
|
-
const [ctx, setCtx] =
|
|
5319
|
-
|
|
6062
|
+
const [ctx, setCtx] = React33__namespace.useState({ variant: "solid", size: "md", fitted: false });
|
|
6063
|
+
React33__namespace.useEffect(() => {
|
|
5320
6064
|
const el = triggerRef.current;
|
|
5321
6065
|
if (!el) return;
|
|
5322
6066
|
const root = el.closest("[data-variant]");
|
|
@@ -5330,7 +6074,7 @@ function useTabsContext(triggerRef) {
|
|
|
5330
6074
|
return ctx;
|
|
5331
6075
|
}
|
|
5332
6076
|
function useMergedRef(...refs) {
|
|
5333
|
-
return
|
|
6077
|
+
return React33__namespace.useCallback(
|
|
5334
6078
|
(instance) => {
|
|
5335
6079
|
for (const ref of refs) {
|
|
5336
6080
|
if (!ref) continue;
|
|
@@ -5368,7 +6112,7 @@ var TAG_SELECTED_CLASSES = [
|
|
|
5368
6112
|
"hover:opacity-76"
|
|
5369
6113
|
].join(" ");
|
|
5370
6114
|
var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
|
|
5371
|
-
var Tag =
|
|
6115
|
+
var Tag = React33__namespace.forwardRef(
|
|
5372
6116
|
function Tag2(props, ref) {
|
|
5373
6117
|
const {
|
|
5374
6118
|
variant,
|
|
@@ -5455,9 +6199,9 @@ var TEXTAREA_VARIANT_CLASSES = {
|
|
|
5455
6199
|
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
5456
6200
|
unstyled: "border-0 bg-transparent p-0"
|
|
5457
6201
|
};
|
|
5458
|
-
var Textarea =
|
|
6202
|
+
var Textarea = React33__namespace.default.forwardRef(
|
|
5459
6203
|
({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
|
|
5460
|
-
const handleChange =
|
|
6204
|
+
const handleChange = React33__namespace.default.useCallback(
|
|
5461
6205
|
(event) => {
|
|
5462
6206
|
onChange?.(event);
|
|
5463
6207
|
onChangeText?.(event.target.value);
|
|
@@ -5465,9 +6209,10 @@ var Textarea = React30__namespace.default.forwardRef(
|
|
|
5465
6209
|
[onChange, onChangeText]
|
|
5466
6210
|
);
|
|
5467
6211
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5468
|
-
|
|
6212
|
+
gui.TextArea,
|
|
5469
6213
|
{
|
|
5470
6214
|
ref,
|
|
6215
|
+
unstyled: true,
|
|
5471
6216
|
className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
|
|
5472
6217
|
...rest,
|
|
5473
6218
|
onChange: handleChange
|
|
@@ -5599,7 +6344,7 @@ function QuoteCell({ value, highlight, align = "right", onClick, className }) {
|
|
|
5599
6344
|
}
|
|
5600
6345
|
var CALL_HEADERS = ["Bid", "Ask", "Last", "Vol", "OI", "IV", "Delta"];
|
|
5601
6346
|
var PUT_HEADERS = ["Delta", "IV", "OI", "Vol", "Last", "Ask", "Bid"];
|
|
5602
|
-
var OptionChain =
|
|
6347
|
+
var OptionChain = React33__namespace.forwardRef(
|
|
5603
6348
|
function OptionChain2(props, ref) {
|
|
5604
6349
|
const {
|
|
5605
6350
|
symbol: _symbol,
|
|
@@ -5610,7 +6355,7 @@ var OptionChain = React30__namespace.forwardRef(
|
|
|
5610
6355
|
className,
|
|
5611
6356
|
...rest
|
|
5612
6357
|
} = props;
|
|
5613
|
-
const handleClick =
|
|
6358
|
+
const handleClick = React33__namespace.useCallback(
|
|
5614
6359
|
(quote, type, strike) => {
|
|
5615
6360
|
if (!quote || !onSelectContract) return;
|
|
5616
6361
|
onSelectContract({
|
|
@@ -5716,7 +6461,7 @@ var OptionChain = React30__namespace.forwardRef(
|
|
|
5716
6461
|
{
|
|
5717
6462
|
className: cn(
|
|
5718
6463
|
"px-2 py-1 text-center font-mono tabular-nums text-xs font-semibold",
|
|
5719
|
-
isATM ? "text-
|
|
6464
|
+
isATM ? "text-[var(--foreground)] bg-[var(--secondary)]" : "text-[var(--muted-foreground)]"
|
|
5720
6465
|
),
|
|
5721
6466
|
children: fmt(row.strike)
|
|
5722
6467
|
}
|
|
@@ -5755,12 +6500,12 @@ var OptionChain = React30__namespace.forwardRef(
|
|
|
5755
6500
|
}
|
|
5756
6501
|
);
|
|
5757
6502
|
var GREEKS = [
|
|
5758
|
-
{ key: "delta", label: "Delta", symbol: "\u0394", color: "text-
|
|
5759
|
-
{ key: "gamma", label: "Gamma", symbol: "\u0393", color: "text-
|
|
5760
|
-
{ key: "theta", label: "Theta", symbol: "\u0398", color: "text-
|
|
5761
|
-
{ key: "vega", label: "Vega", symbol: "\u03BD", color: "text-
|
|
5762
|
-
{ key: "rho", label: "Rho", symbol: "\u03C1", color: "text-
|
|
5763
|
-
{ key: "iv", label: "IV", symbol: "\u03C3", color: "text-
|
|
6503
|
+
{ key: "delta", label: "Delta", symbol: "\u0394", color: "text-[var(--foreground)]", barColor: "bg-[var(--foreground)]", decimals: 4, maxMagnitude: 1 },
|
|
6504
|
+
{ key: "gamma", label: "Gamma", symbol: "\u0393", color: "text-[var(--chart-1)]", barColor: "bg-[var(--chart-1)]", decimals: 4, maxMagnitude: 0.1 },
|
|
6505
|
+
{ key: "theta", label: "Theta", symbol: "\u0398", color: "text-[var(--chart-4)]", barColor: "bg-[var(--chart-4)]", decimals: 4, maxMagnitude: 1 },
|
|
6506
|
+
{ key: "vega", label: "Vega", symbol: "\u03BD", color: "text-[var(--chart-2)]", barColor: "bg-[var(--chart-2)]", decimals: 4, maxMagnitude: 1 },
|
|
6507
|
+
{ key: "rho", label: "Rho", symbol: "\u03C1", color: "text-[var(--chart-3)]", barColor: "bg-[var(--chart-3)]", decimals: 4, maxMagnitude: 1 },
|
|
6508
|
+
{ key: "iv", label: "IV", symbol: "\u03C3", color: "text-[var(--chart-5)]", barColor: "bg-[var(--chart-5)]", decimals: 1, maxMagnitude: 100 }
|
|
5764
6509
|
];
|
|
5765
6510
|
function GreekItem({ def, value, compact }) {
|
|
5766
6511
|
const magnitude = Math.min(Math.abs(value) / def.maxMagnitude, 1);
|
|
@@ -5790,7 +6535,7 @@ function GreekItem({ def, value, compact }) {
|
|
|
5790
6535
|
}
|
|
5791
6536
|
);
|
|
5792
6537
|
}
|
|
5793
|
-
var GreeksDisplay =
|
|
6538
|
+
var GreeksDisplay = React33__namespace.forwardRef(
|
|
5794
6539
|
function GreeksDisplay2(props, ref) {
|
|
5795
6540
|
const {
|
|
5796
6541
|
delta,
|
|
@@ -5967,7 +6712,8 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
|
|
|
5967
6712
|
type: "button",
|
|
5968
6713
|
className: cn(
|
|
5969
6714
|
"px-2 py-0.5 rounded text-xs font-medium transition-colors",
|
|
5970
|
-
|
|
6715
|
+
// Call vs put is a rank difference, not a hue difference.
|
|
6716
|
+
leg.type === "call" ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
|
|
5971
6717
|
),
|
|
5972
6718
|
onClick: () => update2({ type: leg.type === "call" ? "put" : "call" }),
|
|
5973
6719
|
children: leg.type === "call" ? "CALL" : "PUT"
|
|
@@ -6021,7 +6767,7 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
|
|
|
6021
6767
|
)
|
|
6022
6768
|
] });
|
|
6023
6769
|
}
|
|
6024
|
-
var StrategyBuilder =
|
|
6770
|
+
var StrategyBuilder = React33__namespace.forwardRef(
|
|
6025
6771
|
function StrategyBuilder2(props, ref) {
|
|
6026
6772
|
const {
|
|
6027
6773
|
underlying,
|
|
@@ -6033,12 +6779,12 @@ var StrategyBuilder = React30__namespace.forwardRef(
|
|
|
6033
6779
|
...rest
|
|
6034
6780
|
} = props;
|
|
6035
6781
|
const defaultExp = expirations[0] ?? "";
|
|
6036
|
-
const [strategyType, setStrategyType] =
|
|
6037
|
-
const [legs, setLegs] =
|
|
6782
|
+
const [strategyType, setStrategyType] = React33__namespace.useState("bull_call_spread");
|
|
6783
|
+
const [legs, setLegs] = React33__namespace.useState(() => {
|
|
6038
6784
|
const preset = STRATEGY_PRESETS.find((p) => p.value === "bull_call_spread");
|
|
6039
6785
|
return preset ? preset.buildLegs(strikes, spotPrice, defaultExp) : [];
|
|
6040
6786
|
});
|
|
6041
|
-
const handleStrategyChange =
|
|
6787
|
+
const handleStrategyChange = React33__namespace.useCallback(
|
|
6042
6788
|
(e) => {
|
|
6043
6789
|
const type = e.target.value;
|
|
6044
6790
|
setStrategyType(type);
|
|
@@ -6049,7 +6795,7 @@ var StrategyBuilder = React30__namespace.forwardRef(
|
|
|
6049
6795
|
},
|
|
6050
6796
|
[strikes, spotPrice, defaultExp]
|
|
6051
6797
|
);
|
|
6052
|
-
const handleLegChange =
|
|
6798
|
+
const handleLegChange = React33__namespace.useCallback(
|
|
6053
6799
|
(index, leg) => {
|
|
6054
6800
|
setLegs((prev) => {
|
|
6055
6801
|
const next = [...prev];
|
|
@@ -6059,13 +6805,13 @@ var StrategyBuilder = React30__namespace.forwardRef(
|
|
|
6059
6805
|
},
|
|
6060
6806
|
[]
|
|
6061
6807
|
);
|
|
6062
|
-
const handleLegRemove =
|
|
6808
|
+
const handleLegRemove = React33__namespace.useCallback(
|
|
6063
6809
|
(index) => {
|
|
6064
6810
|
setLegs((prev) => prev.filter((_, i) => i !== index));
|
|
6065
6811
|
},
|
|
6066
6812
|
[]
|
|
6067
6813
|
);
|
|
6068
|
-
const handleAddLeg =
|
|
6814
|
+
const handleAddLeg = React33__namespace.useCallback(() => {
|
|
6069
6815
|
if (legs.length >= 4) return;
|
|
6070
6816
|
const atm = findATM(strikes, spotPrice);
|
|
6071
6817
|
setLegs((prev) => [
|
|
@@ -6073,14 +6819,14 @@ var StrategyBuilder = React30__namespace.forwardRef(
|
|
|
6073
6819
|
{ action: "buy", type: "call", strike: atm, expiration: defaultExp, quantity: 1 }
|
|
6074
6820
|
]);
|
|
6075
6821
|
}, [legs.length, strikes, spotPrice, defaultExp]);
|
|
6076
|
-
const netPremium =
|
|
6822
|
+
const netPremium = React33__namespace.useMemo(() => {
|
|
6077
6823
|
return legs.reduce((sum, leg) => {
|
|
6078
6824
|
if (leg.premium === void 0) return sum;
|
|
6079
6825
|
const sign = leg.action === "buy" ? -1 : 1;
|
|
6080
6826
|
return sum + sign * leg.premium * leg.quantity;
|
|
6081
6827
|
}, 0);
|
|
6082
6828
|
}, [legs]);
|
|
6083
|
-
const handleSubmit =
|
|
6829
|
+
const handleSubmit = React33__namespace.useCallback(() => {
|
|
6084
6830
|
if (!onSubmit || legs.length === 0) return;
|
|
6085
6831
|
onSubmit({
|
|
6086
6832
|
type: strategyType,
|
|
@@ -6200,8 +6946,10 @@ function buildPath(points, vb, width, height) {
|
|
|
6200
6946
|
});
|
|
6201
6947
|
return parts.join(" ");
|
|
6202
6948
|
}
|
|
6203
|
-
var LEG_COLORS = ["
|
|
6204
|
-
var
|
|
6949
|
+
var LEG_COLORS = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)"];
|
|
6950
|
+
var BREAKEVEN_COLOR = "var(--chart-1)";
|
|
6951
|
+
var BREAKEVEN_RING = "var(--background)";
|
|
6952
|
+
var PnlDiagram = React33__namespace.forwardRef(
|
|
6205
6953
|
function PnlDiagram2(props, ref) {
|
|
6206
6954
|
const {
|
|
6207
6955
|
legs,
|
|
@@ -6210,10 +6958,10 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6210
6958
|
className,
|
|
6211
6959
|
...rest
|
|
6212
6960
|
} = props;
|
|
6213
|
-
const containerRef =
|
|
6214
|
-
const [hoverX, setHoverX] =
|
|
6215
|
-
const [dims, setDims] =
|
|
6216
|
-
|
|
6961
|
+
const containerRef = React33__namespace.useRef(null);
|
|
6962
|
+
const [hoverX, setHoverX] = React33__namespace.useState(null);
|
|
6963
|
+
const [dims, setDims] = React33__namespace.useState({ width: 600, height: 240 });
|
|
6964
|
+
React33__namespace.useEffect(() => {
|
|
6217
6965
|
const el = containerRef.current;
|
|
6218
6966
|
if (!el) return;
|
|
6219
6967
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -6236,7 +6984,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6236
6984
|
const xMax = maxStrike + range * 0.3;
|
|
6237
6985
|
const SAMPLES = 200;
|
|
6238
6986
|
const step = (xMax - xMin) / SAMPLES;
|
|
6239
|
-
const combinedPoints =
|
|
6987
|
+
const combinedPoints = React33__namespace.useMemo(() => {
|
|
6240
6988
|
const pts = [];
|
|
6241
6989
|
for (let i = 0; i <= SAMPLES; i++) {
|
|
6242
6990
|
const price = xMin + i * step;
|
|
@@ -6244,7 +6992,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6244
6992
|
}
|
|
6245
6993
|
return pts;
|
|
6246
6994
|
}, [legs, multiplier, xMin, step]);
|
|
6247
|
-
const legPointSets =
|
|
6995
|
+
const legPointSets = React33__namespace.useMemo(() => {
|
|
6248
6996
|
return legs.map((leg) => {
|
|
6249
6997
|
const pts = [];
|
|
6250
6998
|
for (let i = 0; i <= SAMPLES; i++) {
|
|
@@ -6265,7 +7013,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6265
7013
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6266
7014
|
const scaleX = (x) => PADDING.left + (x - vb.xMin) / (vb.xMax - vb.xMin) * chartW;
|
|
6267
7015
|
const scaleY = (y) => PADDING.top + chartH - (y - vb.yMin) / (vb.yMax - vb.yMin) * chartH;
|
|
6268
|
-
const breakevens =
|
|
7016
|
+
const breakevens = React33__namespace.useMemo(() => {
|
|
6269
7017
|
const pts = [];
|
|
6270
7018
|
for (let i = 1; i < combinedPoints.length; i++) {
|
|
6271
7019
|
const prev = combinedPoints[i - 1];
|
|
@@ -6282,7 +7030,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6282
7030
|
const maxGainPoint = combinedPoints.find((p) => p.y === maxGain);
|
|
6283
7031
|
const maxLossPoint = combinedPoints.find((p) => p.y === maxLoss);
|
|
6284
7032
|
const zeroY = scaleY(0);
|
|
6285
|
-
const handleMouseMove =
|
|
7033
|
+
const handleMouseMove = React33__namespace.useCallback(
|
|
6286
7034
|
(e) => {
|
|
6287
7035
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
6288
7036
|
const mouseX = e.clientX - rect.left;
|
|
@@ -6295,7 +7043,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6295
7043
|
},
|
|
6296
7044
|
[vb.xMin, vb.xMax, chartW]
|
|
6297
7045
|
);
|
|
6298
|
-
const handleMouseLeave =
|
|
7046
|
+
const handleMouseLeave = React33__namespace.useCallback(() => setHoverX(null), []);
|
|
6299
7047
|
const hoverPnl = hoverX !== null ? calcTotalPnl(legs, hoverX, multiplier) : null;
|
|
6300
7048
|
buildPath(
|
|
6301
7049
|
combinedPoints.map((p) => ({ x: scaleX(p.x), y: scaleY(p.y) })).map((p) => ({ x: p.x - PADDING.left, y: p.y - PADDING.top })),
|
|
@@ -6442,13 +7190,13 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6442
7190
|
}
|
|
6443
7191
|
),
|
|
6444
7192
|
breakevens.map((be, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
6445
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill:
|
|
7193
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: BREAKEVEN_COLOR, stroke: BREAKEVEN_RING, strokeWidth: "1" }),
|
|
6446
7194
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6447
7195
|
"text",
|
|
6448
7196
|
{
|
|
6449
7197
|
x: scaleX(be),
|
|
6450
7198
|
y: PADDING.top + chartH + 14,
|
|
6451
|
-
fill:
|
|
7199
|
+
fill: BREAKEVEN_COLOR,
|
|
6452
7200
|
fontSize: "8",
|
|
6453
7201
|
fontFamily: "monospace",
|
|
6454
7202
|
textAnchor: "middle",
|
|
@@ -6489,7 +7237,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6489
7237
|
cy: scaleY(hoverPnl),
|
|
6490
7238
|
r: "3",
|
|
6491
7239
|
fill: hoverPnl >= 0 ? "#22c55e" : "#ef4444",
|
|
6492
|
-
stroke:
|
|
7240
|
+
stroke: BREAKEVEN_RING,
|
|
6493
7241
|
strokeWidth: "1"
|
|
6494
7242
|
}
|
|
6495
7243
|
),
|
|
@@ -6501,7 +7249,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6501
7249
|
width: "90",
|
|
6502
7250
|
height: "28",
|
|
6503
7251
|
rx: "3",
|
|
6504
|
-
fill:
|
|
7252
|
+
fill: BREAKEVEN_RING,
|
|
6505
7253
|
stroke: "#3f3f46",
|
|
6506
7254
|
strokeWidth: "1"
|
|
6507
7255
|
}
|
|
@@ -6583,7 +7331,7 @@ var PnlDiagram = React30__namespace.forwardRef(
|
|
|
6583
7331
|
] })
|
|
6584
7332
|
] }, i)),
|
|
6585
7333
|
breakevens.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
6586
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-1.5 rounded-full
|
|
7334
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-1.5 rounded-full", style: { background: BREAKEVEN_COLOR } }),
|
|
6587
7335
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-zinc-500", children: [
|
|
6588
7336
|
"BE: ",
|
|
6589
7337
|
breakevens.map((b) => b.toFixed(1)).join(", ")
|
|
@@ -6599,7 +7347,7 @@ function formatDate(date) {
|
|
|
6599
7347
|
const d = new Date(date);
|
|
6600
7348
|
return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
6601
7349
|
}
|
|
6602
|
-
var OptionPositionCard =
|
|
7350
|
+
var OptionPositionCard = React33__namespace.forwardRef(
|
|
6603
7351
|
function OptionPositionCard2(props, ref) {
|
|
6604
7352
|
const {
|
|
6605
7353
|
position,
|
|
@@ -6625,7 +7373,8 @@ var OptionPositionCard = React30__namespace.forwardRef(
|
|
|
6625
7373
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
6626
7374
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
|
|
6627
7375
|
"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-semibold",
|
|
6628
|
-
|
|
7376
|
+
// Call vs put is a rank difference, not a hue difference.
|
|
7377
|
+
isCall ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
|
|
6629
7378
|
), children: [
|
|
6630
7379
|
position.underlying,
|
|
6631
7380
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono tabular-nums", children: position.strike }),
|
|
@@ -6751,8 +7500,9 @@ function ExpirationPill({ exp, isSelected, onClick }) {
|
|
|
6751
7500
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium whitespace-nowrap", children: formatExpDate(exp.date) }),
|
|
6752
7501
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
|
|
6753
7502
|
"font-mono tabular-nums text-[10px]",
|
|
6754
|
-
isSelected ? "text-
|
|
6755
|
-
|
|
7503
|
+
isSelected ? "text-[var(--foreground)]" : "text-[var(--muted-foreground)]",
|
|
7504
|
+
// Near expiry is a notice, and a notice in Lux is the loudest neutral.
|
|
7505
|
+
exp.dte <= 7 && !isSelected && "text-[var(--color-status-warn)]"
|
|
6756
7506
|
), children: [
|
|
6757
7507
|
exp.dte,
|
|
6758
7508
|
"d"
|
|
@@ -6761,7 +7511,7 @@ function ExpirationPill({ exp, isSelected, onClick }) {
|
|
|
6761
7511
|
}
|
|
6762
7512
|
);
|
|
6763
7513
|
}
|
|
6764
|
-
var ExpirationSelector =
|
|
7514
|
+
var ExpirationSelector = React33__namespace.forwardRef(
|
|
6765
7515
|
function ExpirationSelector2(props, ref) {
|
|
6766
7516
|
const {
|
|
6767
7517
|
expirations,
|
|
@@ -6771,8 +7521,8 @@ var ExpirationSelector = React30__namespace.forwardRef(
|
|
|
6771
7521
|
className,
|
|
6772
7522
|
...rest
|
|
6773
7523
|
} = props;
|
|
6774
|
-
const scrollRef =
|
|
6775
|
-
|
|
7524
|
+
const scrollRef = React33__namespace.useRef(null);
|
|
7525
|
+
React33__namespace.useEffect(() => {
|
|
6776
7526
|
const container = scrollRef.current;
|
|
6777
7527
|
if (!container) return;
|
|
6778
7528
|
const selectedEl = container.querySelector('[data-selected="true"]');
|
|
@@ -7089,6 +7839,7 @@ exports.AccordionItemContent = AccordionItemContent;
|
|
|
7089
7839
|
exports.AccordionItemTrigger = AccordionItemTrigger;
|
|
7090
7840
|
exports.AccordionRoot = AccordionRoot;
|
|
7091
7841
|
exports.Alert = Alert;
|
|
7842
|
+
exports.AppNav = AppNav;
|
|
7092
7843
|
exports.AppProvider = AppProvider;
|
|
7093
7844
|
exports.Avatar = Avatar;
|
|
7094
7845
|
exports.AvatarGroup = AvatarGroup;
|
|
@@ -7114,6 +7865,7 @@ exports.CloseButton = CloseButton;
|
|
|
7114
7865
|
exports.CollapsibleDetails = CollapsibleDetails;
|
|
7115
7866
|
exports.CollapsibleList = CollapsibleList;
|
|
7116
7867
|
exports.ColorModeProvider = ColorModeProvider;
|
|
7868
|
+
exports.DEFAULT_ORG = DEFAULT_ORG;
|
|
7117
7869
|
exports.DialogActionTrigger = DialogActionTrigger;
|
|
7118
7870
|
exports.DialogBackdrop = DialogBackdrop;
|
|
7119
7871
|
exports.DialogBody = DialogBody;
|
|
@@ -7140,8 +7892,11 @@ exports.ExpirationSelector = ExpirationSelector;
|
|
|
7140
7892
|
exports.Field = Field;
|
|
7141
7893
|
exports.GreeksDisplay = GreeksDisplay;
|
|
7142
7894
|
exports.Heading = Heading;
|
|
7895
|
+
exports.IAM_PAGE_SIZE = IAM_PAGE_SIZE;
|
|
7896
|
+
exports.IamError = IamError;
|
|
7143
7897
|
exports.IconButton = IconButton;
|
|
7144
|
-
exports.
|
|
7898
|
+
exports.IdentityProvider = IdentityProvider;
|
|
7899
|
+
exports.Image = Image;
|
|
7145
7900
|
exports.Input = Input;
|
|
7146
7901
|
exports.InputGroup = InputGroup;
|
|
7147
7902
|
exports.LUX_BRAND = LUX_BRAND;
|
|
@@ -7161,8 +7916,10 @@ exports.MenuRoot = MenuRoot;
|
|
|
7161
7916
|
exports.MenuSeparator = MenuSeparator;
|
|
7162
7917
|
exports.MenuTrigger = MenuTrigger;
|
|
7163
7918
|
exports.MenuTriggerItem = MenuTriggerItem;
|
|
7919
|
+
exports.NARROW_PX = NARROW_PX;
|
|
7164
7920
|
exports.OptionChain = OptionChain;
|
|
7165
7921
|
exports.OptionPositionCard = OptionPositionCard;
|
|
7922
|
+
exports.OrgSwitcher = OrgSwitcher;
|
|
7166
7923
|
exports.PARS_GOLD = PARS_GOLD;
|
|
7167
7924
|
exports.PinInput = PinInput;
|
|
7168
7925
|
exports.PnlDiagram = PnlDiagram;
|
|
@@ -7181,6 +7938,7 @@ exports.Progress = Progress;
|
|
|
7181
7938
|
exports.ProgressCircleRing = ProgressCircleRing;
|
|
7182
7939
|
exports.ProgressCircleRoot = ProgressCircleRoot;
|
|
7183
7940
|
exports.ProgressCircleValueText = ProgressCircleValueText;
|
|
7941
|
+
exports.ProjectSwitcher = ProjectSwitcher;
|
|
7184
7942
|
exports.Radio = Radio2;
|
|
7185
7943
|
exports.RadioGroup = RadioGroup3;
|
|
7186
7944
|
exports.Rating = Rating;
|
|
@@ -7196,12 +7954,15 @@ exports.SelectLabel = SelectLabel;
|
|
|
7196
7954
|
exports.SelectRoot = SelectRoot;
|
|
7197
7955
|
exports.SelectValueText = SelectValueText;
|
|
7198
7956
|
exports.Separator = Separator2;
|
|
7957
|
+
exports.SettingsMenu = SettingsMenu;
|
|
7199
7958
|
exports.Skeleton = Skeleton;
|
|
7200
7959
|
exports.SkeletonCircle = SkeletonCircle;
|
|
7201
7960
|
exports.SkeletonText = SkeletonText;
|
|
7202
7961
|
exports.Slider = Slider;
|
|
7203
7962
|
exports.StrategyBuilder = StrategyBuilder;
|
|
7204
7963
|
exports.Switch = Switch2;
|
|
7964
|
+
exports.Switcher = Switcher;
|
|
7965
|
+
exports.TOUCH_PX = TOUCH_PX;
|
|
7205
7966
|
exports.TableBody = TableBody;
|
|
7206
7967
|
exports.TableCaption = TableCaption;
|
|
7207
7968
|
exports.TableCell = TableCell;
|
|
@@ -7222,14 +7983,27 @@ exports.Tag = Tag;
|
|
|
7222
7983
|
exports.Textarea = Textarea;
|
|
7223
7984
|
exports.Toaster = Toaster;
|
|
7224
7985
|
exports.Tooltip = Tooltip;
|
|
7986
|
+
exports.UserMenu = UserMenu;
|
|
7225
7987
|
exports.bankColors = bankColors;
|
|
7226
7988
|
exports.buttonVariants = buttonVariants;
|
|
7227
7989
|
exports.cn = cn;
|
|
7228
7990
|
exports.config = config;
|
|
7229
7991
|
exports.createListCollection = createListCollection;
|
|
7992
|
+
exports.currentHost = currentHost;
|
|
7230
7993
|
exports.guiConfig = lux_config_default;
|
|
7994
|
+
exports.iam = iam;
|
|
7995
|
+
exports.iamBase = iamBase;
|
|
7996
|
+
exports.initials = initials;
|
|
7231
7997
|
exports.luxThemes = luxThemes;
|
|
7998
|
+
exports.orgIdentity = orgIdentity;
|
|
7999
|
+
exports.orgs = ORGS;
|
|
8000
|
+
exports.resolveWhiteLabel = resolveWhiteLabel;
|
|
7232
8001
|
exports.toaster = toaster;
|
|
7233
8002
|
exports.useAccordion = useAccordion;
|
|
8003
|
+
exports.useBelow = useBelow;
|
|
7234
8004
|
exports.useColorMode = useColorMode;
|
|
7235
8005
|
exports.useColorModeValue = useColorModeValue;
|
|
8006
|
+
exports.useIdentity = useIdentity;
|
|
8007
|
+
exports.useIsNarrow = useIsNarrow;
|
|
8008
|
+
exports.useIsTouch = useIsTouch;
|
|
8009
|
+
exports.useWhiteLabel = useWhiteLabel;
|