@the-portland-company/shell 0.89.0 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +6 -48
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +1 -1
- package/dist/app-chrome.d.ts +1 -1
- package/dist/app-chrome.js +3 -3
- package/dist/chrome.css +0 -20
- package/dist/{chunk-SJDFAK5R.js → chunk-WDVQBUWF.js} +4 -10
- package/dist/chunk-WDVQBUWF.js.map +1 -0
- package/dist/{chunk-J23MTK56.js → chunk-ZS7MQXDQ.js} +41 -402
- package/dist/chunk-ZS7MQXDQ.js.map +1 -0
- package/dist/{index-CZylXAP4.d.cts → index-Cg5aEImm.d.cts} +8 -201
- package/dist/{index-DwkSyAip.d.ts → index-DG32i0jC.d.ts} +8 -201
- package/dist/index.cjs +58 -437
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -19
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +39 -412
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +1 -1
- package/dist/native.d.ts +1 -1
- package/dist/native.js +2 -2
- package/package.json +2 -13
- package/dist/chunk-J23MTK56.js.map +0 -1
- package/dist/chunk-SJDFAK5R.js.map +0 -1
- package/eslint/index.cjs +0 -172
- package/eslint/index.d.ts +0 -6
- package/eslint/index.mjs +0 -5
package/dist/native.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var react = require('react');
|
|
5
|
-
var
|
|
5
|
+
var clsx4 = require('clsx');
|
|
6
6
|
var fi = require('react-icons/fi');
|
|
7
7
|
var reactDom = require('react-dom');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -10,7 +10,7 @@ var lu = require('react-icons/lu');
|
|
|
10
10
|
|
|
11
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var clsx4__default = /*#__PURE__*/_interopDefault(clsx4);
|
|
14
14
|
|
|
15
15
|
// src/native/index.tsx
|
|
16
16
|
function useTopBarIconSlotGlyph(slot) {
|
|
@@ -2210,67 +2210,72 @@ function useThemePreference() {
|
|
|
2210
2210
|
return { value, setValue };
|
|
2211
2211
|
}
|
|
2212
2212
|
function FormColumn({ children, className }) {
|
|
2213
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-form-column": "", className:
|
|
2213
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-form-column": "", className: clsx4__default.default("w-full max-w-[960px]", className), children });
|
|
2214
2214
|
}
|
|
2215
2215
|
var MODE_EYEBROW_LABEL = {
|
|
2216
2216
|
relationship: "Relationship mode",
|
|
2217
2217
|
campaign: "Campaign mode",
|
|
2218
2218
|
petition: "Petition mode"
|
|
2219
2219
|
};
|
|
2220
|
-
var
|
|
2221
|
-
if (maxW === "full") return "max-w-none";
|
|
2222
|
-
if (maxW === "container.lg") return "max-w-6xl";
|
|
2223
|
-
if (maxW === "container.md") return "max-w-5xl";
|
|
2224
|
-
return "max-w-7xl";
|
|
2225
|
-
};
|
|
2220
|
+
var EMAIL_PATTERN = /[^\s@]+@[^\s@]+\.[^\s@]+/;
|
|
2226
2221
|
function PageHeaderView({
|
|
2227
|
-
renderCrumbLink,
|
|
2228
2222
|
title,
|
|
2229
2223
|
mode,
|
|
2230
2224
|
eyebrow,
|
|
2231
2225
|
showEyebrow = true,
|
|
2232
2226
|
subtitle,
|
|
2233
|
-
breadcrumbs
|
|
2227
|
+
breadcrumbs,
|
|
2234
2228
|
actions = null,
|
|
2235
2229
|
tabBar = null,
|
|
2236
|
-
maxW
|
|
2230
|
+
maxW,
|
|
2237
2231
|
hideSidebar = false
|
|
2238
2232
|
}) {
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2233
|
+
if (breadcrumbs !== void 0) {
|
|
2234
|
+
warnDeprecated(
|
|
2235
|
+
"PageHeader.breadcrumbs",
|
|
2236
|
+
'<PageHeader breadcrumbs> is deprecated and renders nothing: the breadcrumb trail is retired (Reference/UI-Platform \u2192 "Page header"). Remove the prop.'
|
|
2237
|
+
);
|
|
2238
|
+
}
|
|
2239
|
+
if (maxW !== void 0) {
|
|
2240
|
+
warnDeprecated(
|
|
2241
|
+
"PageHeader.maxW",
|
|
2242
|
+
"<PageHeader maxW> is deprecated and ignored: the header spans its container. Use <FormColumn> (960px) or the fluid frame for page width."
|
|
2243
|
+
);
|
|
2244
|
+
}
|
|
2245
|
+
if (typeof title === "string" && EMAIL_PATTERN.test(title) || typeof subtitle === "string" && EMAIL_PATTERN.test(subtitle)) {
|
|
2246
|
+
warnDeprecated(
|
|
2247
|
+
"PageHeader.email",
|
|
2248
|
+
`<PageHeader> title/subtitle contains an email address. The user's email never appears in the page header (Reference/UI-Platform \u2192 "Page header"); identity lives in the left bar footer.`
|
|
2249
|
+
);
|
|
2246
2250
|
}
|
|
2247
2251
|
const eyebrowText = showEyebrow ? eyebrow ?? (mode ? MODE_EYEBROW_LABEL[mode] : void 0) : void 0;
|
|
2248
|
-
if (!title && !eyebrowText &&
|
|
2252
|
+
if (!title && !eyebrowText && !actions && !tabBar) {
|
|
2249
2253
|
return null;
|
|
2250
2254
|
}
|
|
2251
2255
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2252
2256
|
"div",
|
|
2253
2257
|
{
|
|
2254
|
-
|
|
2255
|
-
className:
|
|
2258
|
+
"data-shell-page-header": "",
|
|
2259
|
+
className: clsx4__default.default("pt-[22px] text-[color:var(--color-text,#2F3136)]", tabBar ? "pb-0" : "pb-4", {
|
|
2256
2260
|
"md:ml-60": !hideSidebar
|
|
2257
2261
|
}),
|
|
2258
2262
|
children: [
|
|
2259
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2263
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full px-4 md:px-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
|
|
2260
2264
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
2261
2265
|
eyebrowText ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2262
2266
|
"div",
|
|
2263
2267
|
{
|
|
2264
2268
|
className: "truncate text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em]",
|
|
2265
|
-
style: { color: "var(--mode-accent, var(--color-accent, #E63946))" },
|
|
2269
|
+
style: { color: "var(--color-accent-fg, var(--mode-accent, var(--color-accent, #E63946)))" },
|
|
2266
2270
|
children: eyebrowText
|
|
2267
2271
|
}
|
|
2268
2272
|
) : null,
|
|
2269
2273
|
title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2270
|
-
"
|
|
2274
|
+
"h1",
|
|
2271
2275
|
{
|
|
2272
|
-
className: "truncate font-bold
|
|
2276
|
+
className: "m-0 truncate font-bold",
|
|
2273
2277
|
style: {
|
|
2278
|
+
color: "var(--color-text, #2F3136)",
|
|
2274
2279
|
fontFamily: "var(--font-family, ui-sans-serif, system-ui, sans-serif)",
|
|
2275
2280
|
fontSize: "var(--type-h2-size, 1.875rem)",
|
|
2276
2281
|
lineHeight: "var(--type-h2-line-height, 1.25)"
|
|
@@ -2278,25 +2283,7 @@ function PageHeaderView({
|
|
|
2278
2283
|
children: title
|
|
2279
2284
|
}
|
|
2280
2285
|
) }) : null,
|
|
2281
|
-
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#
|
|
2282
|
-
breadcrumbsWithoutCurrent.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2283
|
-
"nav",
|
|
2284
|
-
{
|
|
2285
|
-
"aria-label": "Breadcrumb",
|
|
2286
|
-
className: clsx5__default.default("min-w-0 text-slate-100", title ? "mt-1" : ""),
|
|
2287
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600", children: breadcrumbsWithoutCurrent.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2288
|
-
"li",
|
|
2289
|
-
{
|
|
2290
|
-
className: "flex min-w-0 flex-shrink-0 items-center gap-2",
|
|
2291
|
-
children: [
|
|
2292
|
-
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
2293
|
-
item.href ? renderCrumbLink(item.href, item.label, "truncate text-slate-100 hover:underline") : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-slate-100", children: item.label })
|
|
2294
|
-
]
|
|
2295
|
-
},
|
|
2296
|
-
`${item.label}-${index}`
|
|
2297
|
-
)) })
|
|
2298
|
-
}
|
|
2299
|
-
) : null
|
|
2286
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#58657A)]", children: subtitle }) : null
|
|
2300
2287
|
] }),
|
|
2301
2288
|
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: actions }) : null
|
|
2302
2289
|
] }) }),
|
|
@@ -2306,13 +2293,7 @@ function PageHeaderView({
|
|
|
2306
2293
|
);
|
|
2307
2294
|
}
|
|
2308
2295
|
function PageHeader(props) {
|
|
2309
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2310
|
-
PageHeaderView,
|
|
2311
|
-
{
|
|
2312
|
-
...props,
|
|
2313
|
-
renderCrumbLink: (href, label, className) => /* @__PURE__ */ jsxRuntime.jsx("a", { href, className, children: label })
|
|
2314
|
-
}
|
|
2315
|
-
);
|
|
2296
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageHeaderView, { ...props });
|
|
2316
2297
|
}
|
|
2317
2298
|
function BreadcrumbBarView({
|
|
2318
2299
|
renderCrumbLink,
|
|
@@ -2333,7 +2314,7 @@ function BreadcrumbBarView({
|
|
|
2333
2314
|
{
|
|
2334
2315
|
className: "ml-0 border-b border-gray-200 px-4 py-3 md:ml-60",
|
|
2335
2316
|
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
2336
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2317
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx4__default.default("mx-auto w-full px-0", maxWClass), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
2337
2318
|
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex items-center gap-2 text-sm text-slate-100", children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2", children: [
|
|
2338
2319
|
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
2339
2320
|
item.href ? renderCrumbLink(item.href, item.label, "text-slate-100 hover:underline") : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-100", children: item.label })
|
|
@@ -2368,7 +2349,7 @@ function HeaderTabBar({
|
|
|
2368
2349
|
{
|
|
2369
2350
|
role: "tablist",
|
|
2370
2351
|
"aria-label": ariaLabel,
|
|
2371
|
-
className:
|
|
2352
|
+
className: clsx4__default.default(
|
|
2372
2353
|
// Header-wide tab strip: background + bottom border only (no outer box).
|
|
2373
2354
|
// Left-aligned and fluid: the container spans the full content width,
|
|
2374
2355
|
// the tabs keep their natural width packed from the left (Global-Rules
|
|
@@ -2392,7 +2373,7 @@ function HeaderTabBar({
|
|
|
2392
2373
|
"aria-label": item.label,
|
|
2393
2374
|
disabled: isDisabled,
|
|
2394
2375
|
onClick: () => onChange(item.id),
|
|
2395
|
-
className:
|
|
2376
|
+
className: clsx4__default.default(
|
|
2396
2377
|
// `group/tbtip relative` powers the shared <TopBarTooltip>.
|
|
2397
2378
|
// Natural width (no flex-1 stretch); 40px square hit area for the
|
|
2398
2379
|
// icon-only tab so the strip stays tappable.
|
|
@@ -2418,375 +2399,27 @@ function HeaderTabBar({
|
|
|
2418
2399
|
}
|
|
2419
2400
|
);
|
|
2420
2401
|
}
|
|
2421
|
-
var PADDING = {
|
|
2422
|
-
none: "p-0",
|
|
2423
|
-
sm: "p-4",
|
|
2424
|
-
md: "p-6",
|
|
2425
|
-
lg: "p-8"
|
|
2426
|
-
};
|
|
2427
2402
|
function Card({
|
|
2428
2403
|
title,
|
|
2429
|
-
subtitle,
|
|
2430
|
-
aside,
|
|
2431
|
-
actions,
|
|
2432
|
-
footer,
|
|
2433
2404
|
children,
|
|
2434
|
-
padding = "md",
|
|
2435
|
-
bodyClassName,
|
|
2436
2405
|
minH,
|
|
2437
2406
|
className,
|
|
2438
2407
|
style,
|
|
2439
2408
|
...props
|
|
2440
2409
|
}) {
|
|
2441
|
-
const structured = Boolean(subtitle || aside || actions || footer || bodyClassName);
|
|
2442
|
-
const surface = "rounded-lg border border-[color:var(--app-card-border,var(--color-border))] bg-[color:var(--app-card-bg,var(--color-panel))] text-[color:var(--app-card-fg,var(--color-text))] shadow-sm";
|
|
2443
|
-
if (!structured) {
|
|
2444
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2445
|
-
"div",
|
|
2446
|
-
{
|
|
2447
|
-
"data-shell-card": "",
|
|
2448
|
-
className: clsx5__default.default(surface, PADDING[padding], className),
|
|
2449
|
-
style: { minHeight: minH, ...style },
|
|
2450
|
-
...props,
|
|
2451
|
-
children: [
|
|
2452
|
-
title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-4 text-lg font-semibold", children: title }) : null,
|
|
2453
|
-
children
|
|
2454
|
-
]
|
|
2455
|
-
}
|
|
2456
|
-
);
|
|
2457
|
-
}
|
|
2458
|
-
const hasHeader = Boolean(title || subtitle || aside || actions);
|
|
2459
|
-
const divider = "border-[color:var(--app-card-border,var(--color-border))]";
|
|
2460
2410
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2461
2411
|
"div",
|
|
2462
2412
|
{
|
|
2463
|
-
|
|
2464
|
-
"data-shell-card-structured": "",
|
|
2465
|
-
className: clsx5__default.default(surface, "overflow-hidden", className),
|
|
2413
|
+
className: `rounded-lg border border-slate-200 bg-white p-6 shadow-sm ${className || ""}`,
|
|
2466
2414
|
style: { minHeight: minH, ...style },
|
|
2467
2415
|
...props,
|
|
2468
2416
|
children: [
|
|
2469
|
-
|
|
2470
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
2471
|
-
title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold", children: title }) : null,
|
|
2472
|
-
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-sm text-[color:var(--app-card-fg-muted,var(--color-text-muted))]", children: subtitle }) : null
|
|
2473
|
-
] }),
|
|
2474
|
-
aside || actions ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
2475
|
-
aside,
|
|
2476
|
-
actions
|
|
2477
|
-
] }) : null
|
|
2478
|
-
] }) : null,
|
|
2479
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: bodyClassName ?? PADDING[padding], children }),
|
|
2480
|
-
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx5__default.default("border-t px-5 py-3", divider), children: footer }) : null
|
|
2481
|
-
]
|
|
2482
|
-
}
|
|
2483
|
-
);
|
|
2484
|
-
}
|
|
2485
|
-
var VARIANT_CLASS = {
|
|
2486
|
-
primary: "border border-transparent bg-[color:var(--app-btn-primary-bg,var(--color-accent))] text-[color:var(--app-btn-primary-fg,var(--color-white))] hover:bg-[color:var(--app-btn-primary-bg-hover,var(--color-accent-hover))]",
|
|
2487
|
-
secondary: "border border-[color:var(--app-btn-secondary-border,var(--color-border))] bg-[color:var(--app-btn-secondary-bg,var(--color-white))] text-[color:var(--app-btn-secondary-fg,var(--color-text))] hover:bg-[color:var(--app-btn-secondary-bg-hover,var(--color-bg))]",
|
|
2488
|
-
ghost: "border border-transparent bg-transparent text-[color:var(--app-btn-secondary-fg,var(--color-text))] hover:bg-[color:var(--app-btn-secondary-bg-hover,var(--color-bg))]",
|
|
2489
|
-
danger: "border border-transparent bg-[color:var(--chrome-danger,var(--color-race-red))] text-[color:var(--color-white)] hover:bg-[color:var(--color-race-red-600)]"
|
|
2490
|
-
};
|
|
2491
|
-
var SIZE_CLASS = {
|
|
2492
|
-
md: "h-[44px]",
|
|
2493
|
-
sm: "h-[36px]"
|
|
2494
|
-
};
|
|
2495
|
-
var Button = react.forwardRef(function Button2({
|
|
2496
|
-
variant = "primary",
|
|
2497
|
-
size = "md",
|
|
2498
|
-
loading = false,
|
|
2499
|
-
disabled = false,
|
|
2500
|
-
href,
|
|
2501
|
-
as,
|
|
2502
|
-
type,
|
|
2503
|
-
className,
|
|
2504
|
-
children,
|
|
2505
|
-
onClick,
|
|
2506
|
-
...props
|
|
2507
|
-
}, ref) {
|
|
2508
|
-
const Component = as ?? (href ? "a" : "button");
|
|
2509
|
-
const isNativeButton = Component === "button";
|
|
2510
|
-
const inactive = disabled || loading;
|
|
2511
|
-
const linkProps = isNativeButton ? { type: type ?? "button", disabled: inactive } : {
|
|
2512
|
-
href,
|
|
2513
|
-
"aria-disabled": inactive || void 0,
|
|
2514
|
-
tabIndex: inactive ? -1 : void 0
|
|
2515
|
-
};
|
|
2516
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2517
|
-
Component,
|
|
2518
|
-
{
|
|
2519
|
-
ref,
|
|
2520
|
-
"data-shell-button": "",
|
|
2521
|
-
"data-variant": variant,
|
|
2522
|
-
"aria-busy": loading || void 0,
|
|
2523
|
-
className: clsx5__default.default(
|
|
2524
|
-
"inline-flex items-center justify-center gap-2 rounded-[5px] px-3 text-sm font-semibold no-underline transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--app-field-focus,var(--color-accent))] focus-visible:ring-offset-2",
|
|
2525
|
-
SIZE_CLASS[size],
|
|
2526
|
-
VARIANT_CLASS[variant],
|
|
2527
|
-
inactive && "cursor-not-allowed opacity-50",
|
|
2528
|
-
className
|
|
2529
|
-
),
|
|
2530
|
-
onClick: inactive ? (event) => {
|
|
2531
|
-
event.preventDefault();
|
|
2532
|
-
event.stopPropagation();
|
|
2533
|
-
} : onClick,
|
|
2534
|
-
...linkProps,
|
|
2535
|
-
...props,
|
|
2536
|
-
children: [
|
|
2537
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2538
|
-
"span",
|
|
2539
|
-
{
|
|
2540
|
-
"aria-hidden": "true",
|
|
2541
|
-
"data-shell-button-spinner": "",
|
|
2542
|
-
className: "inline-block h-4 w-4 animate-spin motion-reduce:animate-none rounded-full border-2 border-current border-t-transparent"
|
|
2543
|
-
}
|
|
2544
|
-
) : null,
|
|
2417
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-4 text-lg font-semibold", children: title }),
|
|
2545
2418
|
children
|
|
2546
2419
|
]
|
|
2547
2420
|
}
|
|
2548
2421
|
);
|
|
2549
|
-
});
|
|
2550
|
-
var Button_default = Button;
|
|
2551
|
-
function FormField({
|
|
2552
|
-
id,
|
|
2553
|
-
label,
|
|
2554
|
-
helperText,
|
|
2555
|
-
error,
|
|
2556
|
-
required,
|
|
2557
|
-
className,
|
|
2558
|
-
children
|
|
2559
|
-
}) {
|
|
2560
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("flex w-full flex-col gap-1", className), children: [
|
|
2561
|
-
label ? /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: id, className: "text-sm font-semibold text-[color:var(--color-text)]", children: [
|
|
2562
|
-
label,
|
|
2563
|
-
required ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: " *" }) : null
|
|
2564
|
-
] }) : null,
|
|
2565
|
-
children,
|
|
2566
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2567
|
-
"p",
|
|
2568
|
-
{
|
|
2569
|
-
id: `${id}-error`,
|
|
2570
|
-
role: "alert",
|
|
2571
|
-
className: "text-xs text-[color:var(--chrome-danger,var(--color-race-red))]",
|
|
2572
|
-
children: error
|
|
2573
|
-
}
|
|
2574
|
-
) : helperText ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-helper`, className: "text-xs text-[color:var(--color-text-muted)]", children: helperText }) : null
|
|
2575
|
-
] });
|
|
2576
2422
|
}
|
|
2577
|
-
function describedBy(id, helperText, error, extra) {
|
|
2578
|
-
const generated = error ? `${id}-error` : helperText ? `${id}-helper` : void 0;
|
|
2579
|
-
const merged = [generated, extra].filter(Boolean).join(" ");
|
|
2580
|
-
return merged || void 0;
|
|
2581
|
-
}
|
|
2582
|
-
|
|
2583
|
-
// src/components/fieldStyles.ts
|
|
2584
|
-
var FIELD_BASE = "w-full rounded-[5px] border bg-[color:var(--app-field-bg,var(--color-white))] px-3 text-sm text-[color:var(--color-text)] placeholder:text-[color:var(--color-text-muted)] focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-50";
|
|
2585
|
-
var FIELD_VALID = "border-[color:var(--app-field-border,var(--color-border))] hover:border-[color:var(--app-field-border-hover,var(--color-g4))] focus:border-[color:var(--app-field-focus,var(--color-accent))] focus:ring-[color:var(--app-field-focus,var(--color-accent))]";
|
|
2586
|
-
var FIELD_INVALID = "border-[color:var(--chrome-danger,var(--color-race-red))] focus:ring-[color:var(--chrome-danger,var(--color-race-red))]";
|
|
2587
|
-
var Input = react.forwardRef(function Input2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
2588
|
-
const autoId = react.useId();
|
|
2589
|
-
const fieldId = id ?? autoId;
|
|
2590
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
2591
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2592
|
-
FormField,
|
|
2593
|
-
{
|
|
2594
|
-
id: fieldId,
|
|
2595
|
-
label,
|
|
2596
|
-
helperText,
|
|
2597
|
-
error,
|
|
2598
|
-
required,
|
|
2599
|
-
className: wrapperClassName,
|
|
2600
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2601
|
-
"input",
|
|
2602
|
-
{
|
|
2603
|
-
ref,
|
|
2604
|
-
id: fieldId,
|
|
2605
|
-
required,
|
|
2606
|
-
"data-shell-field": "",
|
|
2607
|
-
"aria-invalid": isInvalid || void 0,
|
|
2608
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
2609
|
-
className: clsx5__default.default(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
2610
|
-
...props
|
|
2611
|
-
}
|
|
2612
|
-
)
|
|
2613
|
-
}
|
|
2614
|
-
);
|
|
2615
|
-
});
|
|
2616
|
-
var Input_default = Input;
|
|
2617
|
-
var Select = react.forwardRef(function Select2({ label, helperText, error, invalid, className, wrapperClassName, id, required, children, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
2618
|
-
const autoId = react.useId();
|
|
2619
|
-
const fieldId = id ?? autoId;
|
|
2620
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
2621
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2622
|
-
FormField,
|
|
2623
|
-
{
|
|
2624
|
-
id: fieldId,
|
|
2625
|
-
label,
|
|
2626
|
-
helperText,
|
|
2627
|
-
error,
|
|
2628
|
-
required,
|
|
2629
|
-
className: wrapperClassName,
|
|
2630
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2631
|
-
"select",
|
|
2632
|
-
{
|
|
2633
|
-
ref,
|
|
2634
|
-
id: fieldId,
|
|
2635
|
-
required,
|
|
2636
|
-
"data-shell-field": "",
|
|
2637
|
-
"aria-invalid": isInvalid || void 0,
|
|
2638
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
2639
|
-
className: clsx5__default.default(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
2640
|
-
...props,
|
|
2641
|
-
children
|
|
2642
|
-
}
|
|
2643
|
-
)
|
|
2644
|
-
}
|
|
2645
|
-
);
|
|
2646
|
-
});
|
|
2647
|
-
var Select_default = Select;
|
|
2648
|
-
var Textarea = react.forwardRef(function Textarea2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
2649
|
-
const autoId = react.useId();
|
|
2650
|
-
const fieldId = id ?? autoId;
|
|
2651
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
2652
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2653
|
-
FormField,
|
|
2654
|
-
{
|
|
2655
|
-
id: fieldId,
|
|
2656
|
-
label,
|
|
2657
|
-
helperText,
|
|
2658
|
-
error,
|
|
2659
|
-
required,
|
|
2660
|
-
className: wrapperClassName,
|
|
2661
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2662
|
-
"textarea",
|
|
2663
|
-
{
|
|
2664
|
-
ref,
|
|
2665
|
-
id: fieldId,
|
|
2666
|
-
required,
|
|
2667
|
-
"data-shell-field": "",
|
|
2668
|
-
"aria-invalid": isInvalid || void 0,
|
|
2669
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
2670
|
-
className: clsx5__default.default(FIELD_BASE, "min-h-[88px] py-3", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
2671
|
-
...props
|
|
2672
|
-
}
|
|
2673
|
-
)
|
|
2674
|
-
}
|
|
2675
|
-
);
|
|
2676
|
-
});
|
|
2677
|
-
var Textarea_default = Textarea;
|
|
2678
|
-
var Checkbox = react.forwardRef(function Checkbox2({
|
|
2679
|
-
label,
|
|
2680
|
-
description,
|
|
2681
|
-
indeterminate,
|
|
2682
|
-
invalid,
|
|
2683
|
-
className,
|
|
2684
|
-
wrapperClassName,
|
|
2685
|
-
id,
|
|
2686
|
-
disabled,
|
|
2687
|
-
"aria-describedby": ariaDescribedBy,
|
|
2688
|
-
...props
|
|
2689
|
-
}, ref) {
|
|
2690
|
-
const autoId = react.useId();
|
|
2691
|
-
const fieldId = id ?? autoId;
|
|
2692
|
-
const descId = description ? `${fieldId}-description` : void 0;
|
|
2693
|
-
const inner = react.useRef(null);
|
|
2694
|
-
const setRef = react.useCallback(
|
|
2695
|
-
(node) => {
|
|
2696
|
-
inner.current = node;
|
|
2697
|
-
if (typeof ref === "function") ref(node);
|
|
2698
|
-
else if (ref) ref.current = node;
|
|
2699
|
-
},
|
|
2700
|
-
[ref]
|
|
2701
|
-
);
|
|
2702
|
-
react.useEffect(() => {
|
|
2703
|
-
if (inner.current) inner.current.indeterminate = Boolean(indeterminate);
|
|
2704
|
-
}, [indeterminate]);
|
|
2705
|
-
const describedBy2 = [descId, ariaDescribedBy].filter(Boolean).join(" ") || void 0;
|
|
2706
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2707
|
-
"label",
|
|
2708
|
-
{
|
|
2709
|
-
htmlFor: fieldId,
|
|
2710
|
-
"data-shell-checkbox": "",
|
|
2711
|
-
className: clsx5__default.default(
|
|
2712
|
-
"flex min-h-[44px] items-start gap-3 py-[10px] text-sm text-[color:var(--app-card-fg,var(--color-text))]",
|
|
2713
|
-
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
2714
|
-
wrapperClassName
|
|
2715
|
-
),
|
|
2716
|
-
children: [
|
|
2717
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2718
|
-
"input",
|
|
2719
|
-
{
|
|
2720
|
-
...props,
|
|
2721
|
-
ref: setRef,
|
|
2722
|
-
id: fieldId,
|
|
2723
|
-
type: "checkbox",
|
|
2724
|
-
disabled,
|
|
2725
|
-
"data-shell-field": "",
|
|
2726
|
-
"aria-invalid": invalid || void 0,
|
|
2727
|
-
"aria-describedby": describedBy2,
|
|
2728
|
-
className: clsx5__default.default(
|
|
2729
|
-
"mt-[2px] h-5 w-5 shrink-0 rounded-[5px] border focus:outline-none focus-visible:ring-2",
|
|
2730
|
-
"accent-[color:var(--color-accent-bg-safe,var(--color-accent))]",
|
|
2731
|
-
"focus-visible:ring-[color:var(--app-field-focus,var(--color-accent))]",
|
|
2732
|
-
invalid ? "border-[color:var(--chrome-danger,var(--color-race-red))] outline outline-2 outline-[color:var(--chrome-danger,var(--color-race-red))]" : "border-[color:var(--app-field-border,var(--color-border))]",
|
|
2733
|
-
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
2734
|
-
className
|
|
2735
|
-
)
|
|
2736
|
-
}
|
|
2737
|
-
),
|
|
2738
|
-
label || description ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
|
|
2739
|
-
label ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block font-medium", children: label }) : null,
|
|
2740
|
-
description ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2741
|
-
"span",
|
|
2742
|
-
{
|
|
2743
|
-
id: descId,
|
|
2744
|
-
className: "block text-xs text-[color:var(--app-card-fg-muted,var(--color-text-muted))]",
|
|
2745
|
-
children: description
|
|
2746
|
-
}
|
|
2747
|
-
) : null
|
|
2748
|
-
] }) : null
|
|
2749
|
-
]
|
|
2750
|
-
}
|
|
2751
|
-
);
|
|
2752
|
-
});
|
|
2753
|
-
var Checkbox_default = Checkbox;
|
|
2754
|
-
var FileInput = react.forwardRef(function FileInput2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
2755
|
-
const autoId = react.useId();
|
|
2756
|
-
const fieldId = id ?? autoId;
|
|
2757
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
2758
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2759
|
-
FormField,
|
|
2760
|
-
{
|
|
2761
|
-
id: fieldId,
|
|
2762
|
-
label,
|
|
2763
|
-
helperText,
|
|
2764
|
-
error,
|
|
2765
|
-
required,
|
|
2766
|
-
className: wrapperClassName,
|
|
2767
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2768
|
-
"input",
|
|
2769
|
-
{
|
|
2770
|
-
...props,
|
|
2771
|
-
ref,
|
|
2772
|
-
id: fieldId,
|
|
2773
|
-
type: "file",
|
|
2774
|
-
required,
|
|
2775
|
-
"data-shell-field": "",
|
|
2776
|
-
"aria-invalid": isInvalid || void 0,
|
|
2777
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
2778
|
-
className: clsx5__default.default(
|
|
2779
|
-
FIELD_BASE,
|
|
2780
|
-
"h-[44px] cursor-pointer py-[5px] file:mr-3 file:h-[32px] file:cursor-pointer file:rounded-[5px] file:border file:border-[color:var(--app-btn-secondary-border,var(--color-border))] file:bg-[color:var(--app-btn-secondary-bg,var(--color-white))] file:px-3 file:text-sm file:font-medium file:text-[color:var(--app-btn-secondary-fg,var(--color-text))]",
|
|
2781
|
-
isInvalid ? FIELD_INVALID : FIELD_VALID,
|
|
2782
|
-
className
|
|
2783
|
-
)
|
|
2784
|
-
}
|
|
2785
|
-
)
|
|
2786
|
-
}
|
|
2787
|
-
);
|
|
2788
|
-
});
|
|
2789
|
-
var FileInput_default = FileInput;
|
|
2790
2423
|
var standardNavIcons = {
|
|
2791
2424
|
home: lu.LuHouse,
|
|
2792
2425
|
users: lu.LuUsers,
|
|
@@ -3336,7 +2969,7 @@ function NavSidebar({
|
|
|
3336
2969
|
role: open ? "dialog" : void 0,
|
|
3337
2970
|
"aria-modal": open ? "true" : void 0,
|
|
3338
2971
|
"aria-label": open ? "Navigation" : void 0,
|
|
3339
|
-
className:
|
|
2972
|
+
className: clsx4__default.default(
|
|
3340
2973
|
"fixed inset-y-0 left-0 flex flex-col border-r border-[color:var(--sidebar-line,var(--line))] bg-[color:var(--sidebar-bg,var(--nav-surface))]",
|
|
3341
2974
|
// Never hidden: the 64px icon rail below `md`, the full rail from
|
|
3342
2975
|
// `md` up, and the full rail as a drawer when expanded below `md`.
|
|
@@ -4732,20 +4365,16 @@ function NavAppShell({
|
|
|
4732
4365
|
|
|
4733
4366
|
exports.BETA_BANNER_DISMISS_KEY = BETA_BANNER_DISMISS_KEY;
|
|
4734
4367
|
exports.BreadcrumbBar = BreadcrumbBar;
|
|
4735
|
-
exports.Button = Button_default;
|
|
4736
4368
|
exports.CAMPAIGN_FEATURE_AVAILABILITY = CAMPAIGN_FEATURE_AVAILABILITY;
|
|
4737
4369
|
exports.CORE_APP_ORIGIN = CORE_APP_ORIGIN;
|
|
4738
4370
|
exports.CORE_BILLING_PATH = CORE_BILLING_PATH;
|
|
4739
4371
|
exports.CREDIT_TYPE_LABELS = CREDIT_TYPE_LABELS;
|
|
4740
4372
|
exports.CREDIT_TYPE_ORDER = CREDIT_TYPE_ORDER;
|
|
4741
4373
|
exports.Card = Card;
|
|
4742
|
-
exports.Checkbox = Checkbox_default;
|
|
4743
4374
|
exports.CreditsAction = CreditsAction;
|
|
4744
|
-
exports.FileInput = FileInput_default;
|
|
4745
4375
|
exports.FormColumn = FormColumn;
|
|
4746
4376
|
exports.FuelAction = FuelAction;
|
|
4747
4377
|
exports.HeaderTabBar = HeaderTabBar;
|
|
4748
|
-
exports.Input = Input_default;
|
|
4749
4378
|
exports.NavAppShell = NavAppShell;
|
|
4750
4379
|
exports.NavBetaBanner = NavBetaBanner;
|
|
4751
4380
|
exports.NavChromeProvider = NavChromeProvider;
|
|
@@ -4757,10 +4386,8 @@ exports.NavTopBar = NavTopBar;
|
|
|
4757
4386
|
exports.NotificationsAction = NotificationsAction;
|
|
4758
4387
|
exports.PageHeader = PageHeader;
|
|
4759
4388
|
exports.SPECS_ORIGIN = SPECS_ORIGIN;
|
|
4760
|
-
exports.Select = Select_default;
|
|
4761
4389
|
exports.SpecOverlayAction = SpecOverlayAction;
|
|
4762
4390
|
exports.SupportAction = SupportAction;
|
|
4763
|
-
exports.Textarea = Textarea_default;
|
|
4764
4391
|
exports.TopBarCountBadge = TopBarCountBadge;
|
|
4765
4392
|
exports.TopBarPanelArrow = TopBarPanelArrow;
|
|
4766
4393
|
exports.TopBarPopover = TopBarPopover;
|