@the-portland-company/shell 0.87.1 → 0.89.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 +22 -0
- package/README.md +51 -0
- package/bin/shell-version-check.mjs +117 -0
- 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 +20 -0
- package/dist/{chunk-PRZP2SB6.js → chunk-J23MTK56.js} +562 -5
- package/dist/chunk-J23MTK56.js.map +1 -0
- package/dist/{chunk-3JOLELB4.js → chunk-SJDFAK5R.js} +23 -5
- package/dist/chunk-SJDFAK5R.js.map +1 -0
- package/dist/{index-bfbWLC7_.d.cts → index-CZylXAP4.d.cts} +278 -2
- package/dist/{index-C31E7M9l.d.ts → index-DwkSyAip.d.ts} +278 -2
- package/dist/index.cjs +400 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -79
- package/dist/index.d.ts +6 -79
- package/dist/index.js +21 -204
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +589 -4
- 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/eslint/index.cjs +172 -0
- package/eslint/index.d.ts +6 -0
- package/eslint/index.mjs +5 -0
- package/package.json +17 -2
- package/dist/chunk-3JOLELB4.js.map +0 -1
- package/dist/chunk-PRZP2SB6.js.map +0 -1
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 clsx5 = 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 clsx5__default = /*#__PURE__*/_interopDefault(clsx5);
|
|
14
14
|
|
|
15
15
|
// src/native/index.tsx
|
|
16
16
|
function useTopBarIconSlotGlyph(slot) {
|
|
@@ -2210,8 +2210,583 @@ 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: clsx5__default.default("w-full max-w-[960px]", className), children });
|
|
2214
2214
|
}
|
|
2215
|
+
var MODE_EYEBROW_LABEL = {
|
|
2216
|
+
relationship: "Relationship mode",
|
|
2217
|
+
campaign: "Campaign mode",
|
|
2218
|
+
petition: "Petition mode"
|
|
2219
|
+
};
|
|
2220
|
+
var resolveMaxWidthClass = (maxW) => {
|
|
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
|
+
};
|
|
2226
|
+
function PageHeaderView({
|
|
2227
|
+
renderCrumbLink,
|
|
2228
|
+
title,
|
|
2229
|
+
mode,
|
|
2230
|
+
eyebrow,
|
|
2231
|
+
showEyebrow = true,
|
|
2232
|
+
subtitle,
|
|
2233
|
+
breadcrumbs = [],
|
|
2234
|
+
actions = null,
|
|
2235
|
+
tabBar = null,
|
|
2236
|
+
maxW = "full",
|
|
2237
|
+
hideSidebar = false
|
|
2238
|
+
}) {
|
|
2239
|
+
const maxWClass = resolveMaxWidthClass(maxW);
|
|
2240
|
+
const titleText = typeof title === "string" ? title.trim() : "";
|
|
2241
|
+
const normalizedTitle = titleText.toLowerCase();
|
|
2242
|
+
const breadcrumbsWithoutCurrent = [...breadcrumbs];
|
|
2243
|
+
const last = breadcrumbsWithoutCurrent[breadcrumbsWithoutCurrent.length - 1];
|
|
2244
|
+
if (breadcrumbsWithoutCurrent.length > 1 && normalizedTitle && last && last.label.trim().toLowerCase() === normalizedTitle) {
|
|
2245
|
+
breadcrumbsWithoutCurrent.pop();
|
|
2246
|
+
}
|
|
2247
|
+
const eyebrowText = showEyebrow ? eyebrow ?? (mode ? MODE_EYEBROW_LABEL[mode] : void 0) : void 0;
|
|
2248
|
+
if (!title && !eyebrowText && breadcrumbsWithoutCurrent.length === 0 && !actions && !tabBar) {
|
|
2249
|
+
return null;
|
|
2250
|
+
}
|
|
2251
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2252
|
+
"div",
|
|
2253
|
+
{
|
|
2254
|
+
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
2255
|
+
className: clsx5__default.default("text-slate-100", tabBar ? "pt-3 pb-0" : "py-3 border-b border-gray-200", {
|
|
2256
|
+
"md:ml-60": !hideSidebar
|
|
2257
|
+
}),
|
|
2258
|
+
children: [
|
|
2259
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx5__default.default("w-full px-4", maxWClass), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
|
|
2260
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
2261
|
+
eyebrowText ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2262
|
+
"div",
|
|
2263
|
+
{
|
|
2264
|
+
className: "truncate text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em]",
|
|
2265
|
+
style: { color: "var(--mode-accent, var(--color-accent, #E63946))" },
|
|
2266
|
+
children: eyebrowText
|
|
2267
|
+
}
|
|
2268
|
+
) : null,
|
|
2269
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2270
|
+
"div",
|
|
2271
|
+
{
|
|
2272
|
+
className: "truncate font-bold text-white",
|
|
2273
|
+
style: {
|
|
2274
|
+
fontFamily: "var(--font-family, ui-sans-serif, system-ui, sans-serif)",
|
|
2275
|
+
fontSize: "var(--type-h2-size, 1.875rem)",
|
|
2276
|
+
lineHeight: "var(--type-h2-line-height, 1.25)"
|
|
2277
|
+
},
|
|
2278
|
+
children: title
|
|
2279
|
+
}
|
|
2280
|
+
) }) : null,
|
|
2281
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#929599)]", children: subtitle }) : null,
|
|
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
|
|
2300
|
+
] }),
|
|
2301
|
+
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: actions }) : null
|
|
2302
|
+
] }) }),
|
|
2303
|
+
tabBar ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "m-0 w-full px-0", style: { backgroundColor: "transparent" }, children: tabBar }) : null
|
|
2304
|
+
]
|
|
2305
|
+
}
|
|
2306
|
+
);
|
|
2307
|
+
}
|
|
2308
|
+
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
|
+
);
|
|
2316
|
+
}
|
|
2317
|
+
function BreadcrumbBarView({
|
|
2318
|
+
renderCrumbLink,
|
|
2319
|
+
breadcrumbs = [],
|
|
2320
|
+
actions = null,
|
|
2321
|
+
maxW = "full"
|
|
2322
|
+
}) {
|
|
2323
|
+
warnDeprecated(
|
|
2324
|
+
"BreadcrumbBar",
|
|
2325
|
+
"<BreadcrumbBar> is deprecated for apps: the breadcrumb trail is retired. Use the page header (mode eyebrow + title) instead."
|
|
2326
|
+
);
|
|
2327
|
+
if ((!breadcrumbs || breadcrumbs.length === 0) && !actions) {
|
|
2328
|
+
return null;
|
|
2329
|
+
}
|
|
2330
|
+
const maxWClass = maxW === "full" ? "max-w-none" : maxW === "container.xl" ? "max-w-7xl" : maxW === "container.lg" ? "max-w-6xl" : maxW === "container.md" ? "max-w-5xl" : "max-w-7xl";
|
|
2331
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2332
|
+
"div",
|
|
2333
|
+
{
|
|
2334
|
+
className: "ml-0 border-b border-gray-200 px-4 py-3 md:ml-60",
|
|
2335
|
+
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
2336
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx5__default.default("mx-auto w-full px-0", maxWClass), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
2337
|
+
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
|
+
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
2339
|
+
item.href ? renderCrumbLink(item.href, item.label, "text-slate-100 hover:underline") : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-100", children: item.label })
|
|
2340
|
+
] }, index)) }) }),
|
|
2341
|
+
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { children: actions })
|
|
2342
|
+
] }) })
|
|
2343
|
+
}
|
|
2344
|
+
);
|
|
2345
|
+
}
|
|
2346
|
+
function BreadcrumbBar(props) {
|
|
2347
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2348
|
+
BreadcrumbBarView,
|
|
2349
|
+
{
|
|
2350
|
+
...props,
|
|
2351
|
+
renderCrumbLink: (href, label, className) => /* @__PURE__ */ jsxRuntime.jsx("a", { href, className, children: label })
|
|
2352
|
+
}
|
|
2353
|
+
);
|
|
2354
|
+
}
|
|
2355
|
+
function HeaderTabBar({
|
|
2356
|
+
items,
|
|
2357
|
+
activeId,
|
|
2358
|
+
onChange,
|
|
2359
|
+
className,
|
|
2360
|
+
ariaLabel = "Tabs"
|
|
2361
|
+
}) {
|
|
2362
|
+
warnDeprecated(
|
|
2363
|
+
"HeaderTabBar",
|
|
2364
|
+
"<HeaderTabBar> is deprecated: use <NavTabStrip> from @the-portland-company/shell/native, the canonical page tab strip."
|
|
2365
|
+
);
|
|
2366
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2367
|
+
"div",
|
|
2368
|
+
{
|
|
2369
|
+
role: "tablist",
|
|
2370
|
+
"aria-label": ariaLabel,
|
|
2371
|
+
className: clsx5__default.default(
|
|
2372
|
+
// Header-wide tab strip: background + bottom border only (no outer box).
|
|
2373
|
+
// Left-aligned and fluid: the container spans the full content width,
|
|
2374
|
+
// the tabs keep their natural width packed from the left (Global-Rules
|
|
2375
|
+
// "Tabs & UI Styling": the strip spans the full width of the content
|
|
2376
|
+
// area; tabs keep their natural width, left-aligned. Spencer 2026-10-11:
|
|
2377
|
+
// all apps, all tabs, all screens). No mx-auto / justify-center /
|
|
2378
|
+
// fixed width on the container.
|
|
2379
|
+
"app-header-tab-bar m-0 flex w-full justify-start bg-slate-100 p-0",
|
|
2380
|
+
"border-b border-slate-200",
|
|
2381
|
+
className
|
|
2382
|
+
),
|
|
2383
|
+
children: items.map((item, idx) => {
|
|
2384
|
+
const isActive = item.id === activeId;
|
|
2385
|
+
const isDisabled = Boolean(item.disabled);
|
|
2386
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2387
|
+
"button",
|
|
2388
|
+
{
|
|
2389
|
+
type: "button",
|
|
2390
|
+
role: "tab",
|
|
2391
|
+
"aria-selected": isActive,
|
|
2392
|
+
"aria-label": item.label,
|
|
2393
|
+
disabled: isDisabled,
|
|
2394
|
+
onClick: () => onChange(item.id),
|
|
2395
|
+
className: clsx5__default.default(
|
|
2396
|
+
// `group/tbtip relative` powers the shared <TopBarTooltip>.
|
|
2397
|
+
// Natural width (no flex-1 stretch); 40px square hit area for the
|
|
2398
|
+
// icon-only tab so the strip stays tappable.
|
|
2399
|
+
"group/tbtip app-header-tab-button relative inline-flex h-10 min-w-10 items-center justify-center px-3",
|
|
2400
|
+
"transition-colors",
|
|
2401
|
+
"rounded-none",
|
|
2402
|
+
idx === 0 ? "rounded-tl-lg" : null,
|
|
2403
|
+
idx === items.length - 1 ? "rounded-tr-lg" : null,
|
|
2404
|
+
isActive ? "text-white" : "bg-transparent text-slate-600 hover:bg-white/60 hover:text-slate-900",
|
|
2405
|
+
isDisabled ? "cursor-not-allowed opacity-50" : null
|
|
2406
|
+
),
|
|
2407
|
+
style: {
|
|
2408
|
+
background: isActive ? "var(--mode-primary-color, var(--app-btn-primary-bg))" : void 0
|
|
2409
|
+
},
|
|
2410
|
+
children: [
|
|
2411
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center text-[14px] leading-none", children: item.icon }),
|
|
2412
|
+
isDisabled ? null : /* @__PURE__ */ jsxRuntime.jsx(TopBarTooltip, { title: item.label })
|
|
2413
|
+
]
|
|
2414
|
+
},
|
|
2415
|
+
item.id
|
|
2416
|
+
);
|
|
2417
|
+
})
|
|
2418
|
+
}
|
|
2419
|
+
);
|
|
2420
|
+
}
|
|
2421
|
+
var PADDING = {
|
|
2422
|
+
none: "p-0",
|
|
2423
|
+
sm: "p-4",
|
|
2424
|
+
md: "p-6",
|
|
2425
|
+
lg: "p-8"
|
|
2426
|
+
};
|
|
2427
|
+
function Card({
|
|
2428
|
+
title,
|
|
2429
|
+
subtitle,
|
|
2430
|
+
aside,
|
|
2431
|
+
actions,
|
|
2432
|
+
footer,
|
|
2433
|
+
children,
|
|
2434
|
+
padding = "md",
|
|
2435
|
+
bodyClassName,
|
|
2436
|
+
minH,
|
|
2437
|
+
className,
|
|
2438
|
+
style,
|
|
2439
|
+
...props
|
|
2440
|
+
}) {
|
|
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
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2461
|
+
"div",
|
|
2462
|
+
{
|
|
2463
|
+
"data-shell-card": "",
|
|
2464
|
+
"data-shell-card-structured": "",
|
|
2465
|
+
className: clsx5__default.default(surface, "overflow-hidden", className),
|
|
2466
|
+
style: { minHeight: minH, ...style },
|
|
2467
|
+
...props,
|
|
2468
|
+
children: [
|
|
2469
|
+
hasHeader ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("flex flex-wrap items-start justify-between gap-3 border-b px-5 py-4", divider), children: [
|
|
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,
|
|
2545
|
+
children
|
|
2546
|
+
]
|
|
2547
|
+
}
|
|
2548
|
+
);
|
|
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
|
+
}
|
|
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;
|
|
2215
2790
|
var standardNavIcons = {
|
|
2216
2791
|
home: lu.LuHouse,
|
|
2217
2792
|
users: lu.LuUsers,
|
|
@@ -2761,7 +3336,7 @@ function NavSidebar({
|
|
|
2761
3336
|
role: open ? "dialog" : void 0,
|
|
2762
3337
|
"aria-modal": open ? "true" : void 0,
|
|
2763
3338
|
"aria-label": open ? "Navigation" : void 0,
|
|
2764
|
-
className:
|
|
3339
|
+
className: clsx5__default.default(
|
|
2765
3340
|
"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))]",
|
|
2766
3341
|
// Never hidden: the 64px icon rail below `md`, the full rail from
|
|
2767
3342
|
// `md` up, and the full rail as a drawer when expanded below `md`.
|
|
@@ -4156,14 +4731,21 @@ function NavAppShell({
|
|
|
4156
4731
|
}
|
|
4157
4732
|
|
|
4158
4733
|
exports.BETA_BANNER_DISMISS_KEY = BETA_BANNER_DISMISS_KEY;
|
|
4734
|
+
exports.BreadcrumbBar = BreadcrumbBar;
|
|
4735
|
+
exports.Button = Button_default;
|
|
4159
4736
|
exports.CAMPAIGN_FEATURE_AVAILABILITY = CAMPAIGN_FEATURE_AVAILABILITY;
|
|
4160
4737
|
exports.CORE_APP_ORIGIN = CORE_APP_ORIGIN;
|
|
4161
4738
|
exports.CORE_BILLING_PATH = CORE_BILLING_PATH;
|
|
4162
4739
|
exports.CREDIT_TYPE_LABELS = CREDIT_TYPE_LABELS;
|
|
4163
4740
|
exports.CREDIT_TYPE_ORDER = CREDIT_TYPE_ORDER;
|
|
4741
|
+
exports.Card = Card;
|
|
4742
|
+
exports.Checkbox = Checkbox_default;
|
|
4164
4743
|
exports.CreditsAction = CreditsAction;
|
|
4744
|
+
exports.FileInput = FileInput_default;
|
|
4165
4745
|
exports.FormColumn = FormColumn;
|
|
4166
4746
|
exports.FuelAction = FuelAction;
|
|
4747
|
+
exports.HeaderTabBar = HeaderTabBar;
|
|
4748
|
+
exports.Input = Input_default;
|
|
4167
4749
|
exports.NavAppShell = NavAppShell;
|
|
4168
4750
|
exports.NavBetaBanner = NavBetaBanner;
|
|
4169
4751
|
exports.NavChromeProvider = NavChromeProvider;
|
|
@@ -4173,9 +4755,12 @@ exports.NavTabStrip = NavTabStrip;
|
|
|
4173
4755
|
exports.NavThemeControl = NavThemeControl;
|
|
4174
4756
|
exports.NavTopBar = NavTopBar;
|
|
4175
4757
|
exports.NotificationsAction = NotificationsAction;
|
|
4758
|
+
exports.PageHeader = PageHeader;
|
|
4176
4759
|
exports.SPECS_ORIGIN = SPECS_ORIGIN;
|
|
4760
|
+
exports.Select = Select_default;
|
|
4177
4761
|
exports.SpecOverlayAction = SpecOverlayAction;
|
|
4178
4762
|
exports.SupportAction = SupportAction;
|
|
4763
|
+
exports.Textarea = Textarea_default;
|
|
4179
4764
|
exports.TopBarCountBadge = TopBarCountBadge;
|
|
4180
4765
|
exports.TopBarPanelArrow = TopBarPanelArrow;
|
|
4181
4766
|
exports.TopBarPopover = TopBarPopover;
|