@the-portland-company/shell 0.86.0 → 0.88.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 +26 -0
- package/README.md +46 -0
- package/bin/shell-version-check.mjs +117 -0
- package/dist/app-chrome.cjs +98 -4
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +15 -2
- package/dist/app-chrome.d.ts +15 -2
- package/dist/app-chrome.js +41 -8
- package/dist/app-chrome.js.map +1 -1
- package/dist/{chunk-3JOLELB4.js → chunk-2ACN7HQC.js} +23 -5
- package/dist/chunk-2ACN7HQC.js.map +1 -0
- package/dist/{chunk-PRZP2SB6.js → chunk-7WSGW5CC.js} +409 -7
- package/dist/chunk-7WSGW5CC.js.map +1 -0
- package/dist/chunk-GVQKZI5X.js +92 -0
- package/dist/chunk-GVQKZI5X.js.map +1 -0
- package/dist/{index-C31E7M9l.d.ts → index-DEiOABW2.d.ts} +203 -2
- package/dist/{index-bfbWLC7_.d.cts → index-tfcLFAni.d.cts} +203 -2
- package/dist/index.cjs +230 -7
- 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 +432 -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/dist/url-state.js +2 -90
- package/dist/url-state.js.map +1 -1
- package/eslint/index.cjs +159 -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
|
@@ -1,13 +1,227 @@
|
|
|
1
1
|
import { readThemeCookie, THEME_STORAGE_KEY, isThemePreference, applyThemePreference, readPendingThemeChoice, writeThemeCookie, clearPendingThemeChoice, markThemeChoicePending } from './chunk-BHRVZPZ7.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { createContext, useState, useEffect, useRef, useContext, useMemo, useCallback, useSyncExternalStore } from 'react';
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import clsx8 from 'clsx';
|
|
4
|
+
import { forwardRef, useId, createContext, useState, useEffect, useRef, useContext, useMemo, useCallback, useSyncExternalStore } from 'react';
|
|
5
5
|
import { FiUser, FiSettings, FiMessageSquare, FiMail, FiInfo, FiSun, FiMoon, FiHelpCircle, FiLifeBuoy, FiAlertCircle, FiAlertTriangle, FiBell, FiGrid, FiZap, FiBatteryCharging, FiBattery } from 'react-icons/fi';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
7
7
|
|
|
8
|
+
function Card({
|
|
9
|
+
title,
|
|
10
|
+
children,
|
|
11
|
+
minH,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: `rounded-lg border border-slate-200 bg-white p-6 shadow-sm ${className || ""}`,
|
|
20
|
+
style: { minHeight: minH, ...style },
|
|
21
|
+
...props,
|
|
22
|
+
children: [
|
|
23
|
+
title && /* @__PURE__ */ jsx("h3", { className: "mb-4 text-lg font-semibold", children: title }),
|
|
24
|
+
children
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
8
29
|
function FormColumn({ children, className }) {
|
|
9
|
-
return /* @__PURE__ */ jsx("div", { "data-shell-form-column": "", className:
|
|
30
|
+
return /* @__PURE__ */ jsx("div", { "data-shell-form-column": "", className: clsx8("w-full max-w-[960px]", className), children });
|
|
10
31
|
}
|
|
32
|
+
var VARIANT_CLASS = {
|
|
33
|
+
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))]",
|
|
34
|
+
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))]",
|
|
35
|
+
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))]",
|
|
36
|
+
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)]"
|
|
37
|
+
};
|
|
38
|
+
var SIZE_CLASS = {
|
|
39
|
+
md: "h-[44px]",
|
|
40
|
+
sm: "h-[36px]"
|
|
41
|
+
};
|
|
42
|
+
var Button = forwardRef(function Button2({
|
|
43
|
+
variant = "primary",
|
|
44
|
+
size = "md",
|
|
45
|
+
loading = false,
|
|
46
|
+
disabled = false,
|
|
47
|
+
href,
|
|
48
|
+
as,
|
|
49
|
+
type,
|
|
50
|
+
className,
|
|
51
|
+
children,
|
|
52
|
+
onClick,
|
|
53
|
+
...props
|
|
54
|
+
}, ref) {
|
|
55
|
+
const Component = as ?? (href ? "a" : "button");
|
|
56
|
+
const isNativeButton = Component === "button";
|
|
57
|
+
const inactive = disabled || loading;
|
|
58
|
+
const linkProps = isNativeButton ? { type: type ?? "button", disabled: inactive } : {
|
|
59
|
+
href,
|
|
60
|
+
"aria-disabled": inactive || void 0,
|
|
61
|
+
tabIndex: inactive ? -1 : void 0
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
64
|
+
Component,
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
"data-shell-button": "",
|
|
68
|
+
"data-variant": variant,
|
|
69
|
+
"aria-busy": loading || void 0,
|
|
70
|
+
className: clsx8(
|
|
71
|
+
"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",
|
|
72
|
+
SIZE_CLASS[size],
|
|
73
|
+
VARIANT_CLASS[variant],
|
|
74
|
+
inactive && "cursor-not-allowed opacity-50",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
onClick: inactive ? (event) => {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
} : onClick,
|
|
81
|
+
...linkProps,
|
|
82
|
+
...props,
|
|
83
|
+
children: [
|
|
84
|
+
loading ? /* @__PURE__ */ jsx(
|
|
85
|
+
"span",
|
|
86
|
+
{
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
"data-shell-button-spinner": "",
|
|
89
|
+
className: "inline-block h-4 w-4 animate-spin motion-reduce:animate-none rounded-full border-2 border-current border-t-transparent"
|
|
90
|
+
}
|
|
91
|
+
) : null,
|
|
92
|
+
children
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
var Button_default = Button;
|
|
98
|
+
function FormField({
|
|
99
|
+
id,
|
|
100
|
+
label,
|
|
101
|
+
helperText,
|
|
102
|
+
error,
|
|
103
|
+
required,
|
|
104
|
+
className,
|
|
105
|
+
children
|
|
106
|
+
}) {
|
|
107
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx8("flex w-full flex-col gap-1", className), children: [
|
|
108
|
+
label ? /* @__PURE__ */ jsxs("label", { htmlFor: id, className: "text-sm font-semibold text-[color:var(--color-text)]", children: [
|
|
109
|
+
label,
|
|
110
|
+
required ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " *" }) : null
|
|
111
|
+
] }) : null,
|
|
112
|
+
children,
|
|
113
|
+
error ? /* @__PURE__ */ jsx(
|
|
114
|
+
"p",
|
|
115
|
+
{
|
|
116
|
+
id: `${id}-error`,
|
|
117
|
+
role: "alert",
|
|
118
|
+
className: "text-xs text-[color:var(--chrome-danger,var(--color-race-red))]",
|
|
119
|
+
children: error
|
|
120
|
+
}
|
|
121
|
+
) : helperText ? /* @__PURE__ */ jsx("p", { id: `${id}-helper`, className: "text-xs text-[color:var(--color-text-muted)]", children: helperText }) : null
|
|
122
|
+
] });
|
|
123
|
+
}
|
|
124
|
+
function describedBy(id, helperText, error, extra) {
|
|
125
|
+
const generated = error ? `${id}-error` : helperText ? `${id}-helper` : void 0;
|
|
126
|
+
const merged = [generated, extra].filter(Boolean).join(" ");
|
|
127
|
+
return merged || void 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/components/fieldStyles.ts
|
|
131
|
+
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";
|
|
132
|
+
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))]";
|
|
133
|
+
var FIELD_INVALID = "border-[color:var(--chrome-danger,var(--color-race-red))] focus:ring-[color:var(--chrome-danger,var(--color-race-red))]";
|
|
134
|
+
var Input = forwardRef(function Input2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
135
|
+
const autoId = useId();
|
|
136
|
+
const fieldId = id ?? autoId;
|
|
137
|
+
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
138
|
+
return /* @__PURE__ */ jsx(
|
|
139
|
+
FormField,
|
|
140
|
+
{
|
|
141
|
+
id: fieldId,
|
|
142
|
+
label,
|
|
143
|
+
helperText,
|
|
144
|
+
error,
|
|
145
|
+
required,
|
|
146
|
+
className: wrapperClassName,
|
|
147
|
+
children: /* @__PURE__ */ jsx(
|
|
148
|
+
"input",
|
|
149
|
+
{
|
|
150
|
+
ref,
|
|
151
|
+
id: fieldId,
|
|
152
|
+
required,
|
|
153
|
+
"data-shell-field": "",
|
|
154
|
+
"aria-invalid": isInvalid || void 0,
|
|
155
|
+
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
156
|
+
className: clsx8(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
157
|
+
...props
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
var Input_default = Input;
|
|
164
|
+
var Select = forwardRef(function Select2({ label, helperText, error, invalid, className, wrapperClassName, id, required, children, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
165
|
+
const autoId = useId();
|
|
166
|
+
const fieldId = id ?? autoId;
|
|
167
|
+
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
FormField,
|
|
170
|
+
{
|
|
171
|
+
id: fieldId,
|
|
172
|
+
label,
|
|
173
|
+
helperText,
|
|
174
|
+
error,
|
|
175
|
+
required,
|
|
176
|
+
className: wrapperClassName,
|
|
177
|
+
children: /* @__PURE__ */ jsx(
|
|
178
|
+
"select",
|
|
179
|
+
{
|
|
180
|
+
ref,
|
|
181
|
+
id: fieldId,
|
|
182
|
+
required,
|
|
183
|
+
"data-shell-field": "",
|
|
184
|
+
"aria-invalid": isInvalid || void 0,
|
|
185
|
+
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
186
|
+
className: clsx8(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
187
|
+
...props,
|
|
188
|
+
children
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
});
|
|
194
|
+
var Select_default = Select;
|
|
195
|
+
var Textarea = forwardRef(function Textarea2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
196
|
+
const autoId = useId();
|
|
197
|
+
const fieldId = id ?? autoId;
|
|
198
|
+
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
199
|
+
return /* @__PURE__ */ jsx(
|
|
200
|
+
FormField,
|
|
201
|
+
{
|
|
202
|
+
id: fieldId,
|
|
203
|
+
label,
|
|
204
|
+
helperText,
|
|
205
|
+
error,
|
|
206
|
+
required,
|
|
207
|
+
className: wrapperClassName,
|
|
208
|
+
children: /* @__PURE__ */ jsx(
|
|
209
|
+
"textarea",
|
|
210
|
+
{
|
|
211
|
+
ref,
|
|
212
|
+
id: fieldId,
|
|
213
|
+
required,
|
|
214
|
+
"data-shell-field": "",
|
|
215
|
+
"aria-invalid": isInvalid || void 0,
|
|
216
|
+
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
217
|
+
className: clsx8(FIELD_BASE, "min-h-[88px] py-3", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
218
|
+
...props
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
});
|
|
224
|
+
var Textarea_default = Textarea;
|
|
11
225
|
|
|
12
226
|
// src/lib/deprecation.ts
|
|
13
227
|
var warned = /* @__PURE__ */ new Set();
|
|
@@ -1952,6 +2166,72 @@ function useThemePreference() {
|
|
|
1952
2166
|
);
|
|
1953
2167
|
return { value, setValue };
|
|
1954
2168
|
}
|
|
2169
|
+
function HeaderTabBar({
|
|
2170
|
+
items,
|
|
2171
|
+
activeId,
|
|
2172
|
+
onChange,
|
|
2173
|
+
className,
|
|
2174
|
+
ariaLabel = "Tabs"
|
|
2175
|
+
}) {
|
|
2176
|
+
warnDeprecated(
|
|
2177
|
+
"HeaderTabBar",
|
|
2178
|
+
"<HeaderTabBar> is deprecated: use <NavTabStrip> from @the-portland-company/shell/native, the canonical page tab strip."
|
|
2179
|
+
);
|
|
2180
|
+
return /* @__PURE__ */ jsx(
|
|
2181
|
+
"div",
|
|
2182
|
+
{
|
|
2183
|
+
role: "tablist",
|
|
2184
|
+
"aria-label": ariaLabel,
|
|
2185
|
+
className: clsx8(
|
|
2186
|
+
// Header-wide tab strip: background + bottom border only (no outer box).
|
|
2187
|
+
// Left-aligned and fluid: the container spans the full content width,
|
|
2188
|
+
// the tabs keep their natural width packed from the left (Global-Rules
|
|
2189
|
+
// "Tabs & UI Styling": the strip spans the full width of the content
|
|
2190
|
+
// area; tabs keep their natural width, left-aligned. Spencer 2026-10-11:
|
|
2191
|
+
// all apps, all tabs, all screens). No mx-auto / justify-center /
|
|
2192
|
+
// fixed width on the container.
|
|
2193
|
+
"app-header-tab-bar m-0 flex w-full justify-start bg-slate-100 p-0",
|
|
2194
|
+
"border-b border-slate-200",
|
|
2195
|
+
className
|
|
2196
|
+
),
|
|
2197
|
+
children: items.map((item, idx) => {
|
|
2198
|
+
const isActive = item.id === activeId;
|
|
2199
|
+
const isDisabled = Boolean(item.disabled);
|
|
2200
|
+
return /* @__PURE__ */ jsxs(
|
|
2201
|
+
"button",
|
|
2202
|
+
{
|
|
2203
|
+
type: "button",
|
|
2204
|
+
role: "tab",
|
|
2205
|
+
"aria-selected": isActive,
|
|
2206
|
+
"aria-label": item.label,
|
|
2207
|
+
disabled: isDisabled,
|
|
2208
|
+
onClick: () => onChange(item.id),
|
|
2209
|
+
className: clsx8(
|
|
2210
|
+
// `group/tbtip relative` powers the shared <TopBarTooltip>.
|
|
2211
|
+
// Natural width (no flex-1 stretch); 40px square hit area for the
|
|
2212
|
+
// icon-only tab so the strip stays tappable.
|
|
2213
|
+
"group/tbtip app-header-tab-button relative inline-flex h-10 min-w-10 items-center justify-center px-3",
|
|
2214
|
+
"transition-colors",
|
|
2215
|
+
"rounded-none",
|
|
2216
|
+
idx === 0 ? "rounded-tl-lg" : null,
|
|
2217
|
+
idx === items.length - 1 ? "rounded-tr-lg" : null,
|
|
2218
|
+
isActive ? "text-white" : "bg-transparent text-slate-600 hover:bg-white/60 hover:text-slate-900",
|
|
2219
|
+
isDisabled ? "cursor-not-allowed opacity-50" : null
|
|
2220
|
+
),
|
|
2221
|
+
style: {
|
|
2222
|
+
background: isActive ? "var(--mode-primary-color, var(--app-btn-primary-bg))" : void 0
|
|
2223
|
+
},
|
|
2224
|
+
children: [
|
|
2225
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center text-[14px] leading-none", children: item.icon }),
|
|
2226
|
+
isDisabled ? null : /* @__PURE__ */ jsx(TopBarTooltip, { title: item.label })
|
|
2227
|
+
]
|
|
2228
|
+
},
|
|
2229
|
+
item.id
|
|
2230
|
+
);
|
|
2231
|
+
})
|
|
2232
|
+
}
|
|
2233
|
+
);
|
|
2234
|
+
}
|
|
1955
2235
|
|
|
1956
2236
|
// src/speculation/emitRules.ts
|
|
1957
2237
|
function buildSpeculationRules(currentApp, registry) {
|
|
@@ -2050,7 +2330,129 @@ function SpeculationRulesScript({ items }) {
|
|
|
2050
2330
|
}, [items, origin]);
|
|
2051
2331
|
return null;
|
|
2052
2332
|
}
|
|
2333
|
+
var MODE_EYEBROW_LABEL = {
|
|
2334
|
+
relationship: "Relationship mode",
|
|
2335
|
+
campaign: "Campaign mode",
|
|
2336
|
+
petition: "Petition mode"
|
|
2337
|
+
};
|
|
2338
|
+
var resolveMaxWidthClass = (maxW) => {
|
|
2339
|
+
if (maxW === "full") return "max-w-none";
|
|
2340
|
+
if (maxW === "container.lg") return "max-w-6xl";
|
|
2341
|
+
if (maxW === "container.md") return "max-w-5xl";
|
|
2342
|
+
return "max-w-7xl";
|
|
2343
|
+
};
|
|
2344
|
+
function PageHeaderView({
|
|
2345
|
+
renderCrumbLink,
|
|
2346
|
+
title,
|
|
2347
|
+
mode,
|
|
2348
|
+
eyebrow,
|
|
2349
|
+
showEyebrow = true,
|
|
2350
|
+
subtitle,
|
|
2351
|
+
breadcrumbs = [],
|
|
2352
|
+
actions = null,
|
|
2353
|
+
tabBar = null,
|
|
2354
|
+
maxW = "full",
|
|
2355
|
+
hideSidebar = false
|
|
2356
|
+
}) {
|
|
2357
|
+
const maxWClass = resolveMaxWidthClass(maxW);
|
|
2358
|
+
const titleText = typeof title === "string" ? title.trim() : "";
|
|
2359
|
+
const normalizedTitle = titleText.toLowerCase();
|
|
2360
|
+
const breadcrumbsWithoutCurrent = [...breadcrumbs];
|
|
2361
|
+
const last = breadcrumbsWithoutCurrent[breadcrumbsWithoutCurrent.length - 1];
|
|
2362
|
+
if (breadcrumbsWithoutCurrent.length > 1 && normalizedTitle && last && last.label.trim().toLowerCase() === normalizedTitle) {
|
|
2363
|
+
breadcrumbsWithoutCurrent.pop();
|
|
2364
|
+
}
|
|
2365
|
+
const eyebrowText = showEyebrow ? eyebrow ?? (mode ? MODE_EYEBROW_LABEL[mode] : void 0) : void 0;
|
|
2366
|
+
if (!title && !eyebrowText && breadcrumbsWithoutCurrent.length === 0 && !actions && !tabBar) {
|
|
2367
|
+
return null;
|
|
2368
|
+
}
|
|
2369
|
+
return /* @__PURE__ */ jsxs(
|
|
2370
|
+
"div",
|
|
2371
|
+
{
|
|
2372
|
+
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
2373
|
+
className: clsx8("text-slate-100", tabBar ? "pt-3 pb-0" : "py-3 border-b border-gray-200", {
|
|
2374
|
+
"md:ml-60": !hideSidebar
|
|
2375
|
+
}),
|
|
2376
|
+
children: [
|
|
2377
|
+
/* @__PURE__ */ jsx("div", { className: clsx8("w-full px-4", maxWClass), children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
|
|
2378
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
2379
|
+
eyebrowText ? /* @__PURE__ */ jsx(
|
|
2380
|
+
"div",
|
|
2381
|
+
{
|
|
2382
|
+
className: "truncate text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em]",
|
|
2383
|
+
style: { color: "var(--mode-accent, var(--color-accent, #E63946))" },
|
|
2384
|
+
children: eyebrowText
|
|
2385
|
+
}
|
|
2386
|
+
) : null,
|
|
2387
|
+
title ? /* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx(
|
|
2388
|
+
"div",
|
|
2389
|
+
{
|
|
2390
|
+
className: "truncate font-bold text-white",
|
|
2391
|
+
style: {
|
|
2392
|
+
fontFamily: "var(--font-family, ui-sans-serif, system-ui, sans-serif)",
|
|
2393
|
+
fontSize: "var(--type-h2-size, 1.875rem)",
|
|
2394
|
+
lineHeight: "var(--type-h2-line-height, 1.25)"
|
|
2395
|
+
},
|
|
2396
|
+
children: title
|
|
2397
|
+
}
|
|
2398
|
+
) }) : null,
|
|
2399
|
+
subtitle ? /* @__PURE__ */ jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#929599)]", children: subtitle }) : null,
|
|
2400
|
+
breadcrumbsWithoutCurrent.length > 0 ? /* @__PURE__ */ jsx(
|
|
2401
|
+
"nav",
|
|
2402
|
+
{
|
|
2403
|
+
"aria-label": "Breadcrumb",
|
|
2404
|
+
className: clsx8("min-w-0 text-slate-100", title ? "mt-1" : ""),
|
|
2405
|
+
children: /* @__PURE__ */ jsx("ol", { className: "flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600", children: breadcrumbsWithoutCurrent.map((item, index) => /* @__PURE__ */ jsxs(
|
|
2406
|
+
"li",
|
|
2407
|
+
{
|
|
2408
|
+
className: "flex min-w-0 flex-shrink-0 items-center gap-2",
|
|
2409
|
+
children: [
|
|
2410
|
+
index > 0 ? /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
2411
|
+
item.href ? renderCrumbLink(item.href, item.label, "truncate text-slate-100 hover:underline") : /* @__PURE__ */ jsx("span", { className: "truncate text-slate-100", children: item.label })
|
|
2412
|
+
]
|
|
2413
|
+
},
|
|
2414
|
+
`${item.label}-${index}`
|
|
2415
|
+
)) })
|
|
2416
|
+
}
|
|
2417
|
+
) : null
|
|
2418
|
+
] }),
|
|
2419
|
+
actions ? /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: actions }) : null
|
|
2420
|
+
] }) }),
|
|
2421
|
+
tabBar ? /* @__PURE__ */ jsx("div", { className: "m-0 w-full px-0", style: { backgroundColor: "transparent" }, children: tabBar }) : null
|
|
2422
|
+
]
|
|
2423
|
+
}
|
|
2424
|
+
);
|
|
2425
|
+
}
|
|
2426
|
+
function BreadcrumbBarView({
|
|
2427
|
+
renderCrumbLink,
|
|
2428
|
+
breadcrumbs = [],
|
|
2429
|
+
actions = null,
|
|
2430
|
+
maxW = "full"
|
|
2431
|
+
}) {
|
|
2432
|
+
warnDeprecated(
|
|
2433
|
+
"BreadcrumbBar",
|
|
2434
|
+
"<BreadcrumbBar> is deprecated for apps: the breadcrumb trail is retired. Use the page header (mode eyebrow + title) instead."
|
|
2435
|
+
);
|
|
2436
|
+
if ((!breadcrumbs || breadcrumbs.length === 0) && !actions) {
|
|
2437
|
+
return null;
|
|
2438
|
+
}
|
|
2439
|
+
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";
|
|
2440
|
+
return /* @__PURE__ */ jsx(
|
|
2441
|
+
"div",
|
|
2442
|
+
{
|
|
2443
|
+
className: "ml-0 border-b border-gray-200 px-4 py-3 md:ml-60",
|
|
2444
|
+
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
2445
|
+
children: /* @__PURE__ */ jsx("div", { className: clsx8("mx-auto w-full px-0", maxWClass), children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
2446
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "flex items-center gap-2 text-sm text-slate-100", children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
|
|
2447
|
+
index > 0 ? /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
2448
|
+
item.href ? renderCrumbLink(item.href, item.label, "text-slate-100 hover:underline") : /* @__PURE__ */ jsx("span", { className: "text-slate-100", children: item.label })
|
|
2449
|
+
] }, index)) }) }),
|
|
2450
|
+
actions && /* @__PURE__ */ jsx("div", { children: actions })
|
|
2451
|
+
] }) })
|
|
2452
|
+
}
|
|
2453
|
+
);
|
|
2454
|
+
}
|
|
2053
2455
|
|
|
2054
|
-
export { CORE_APP_ORIGIN, CORE_BILLING_PATH, CREDIT_TYPE_LABELS, CREDIT_TYPE_ORDER, CreditsAction, FormColumn, FuelAction, NAV_DISPLAY_OPTIONS, NavChromeProvider, NavDisplayAction, NavThemeControl, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, SpeculationRulesScript, SupportAction, TOPBAR_GLYPH_SIZE, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, creditGaugeRatio, creditStateWord, creditTooltipLine, creditsAriaLabel, creditsIconState, emptyNotificationsFeed, normalizeNotificationsFeed, resolveBrandGlyph, resolveOrgLogoUrl, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference, useTopBarIconSlotGlyph, warnDeprecated };
|
|
2055
|
-
//# sourceMappingURL=chunk-
|
|
2056
|
-
//# sourceMappingURL=chunk-
|
|
2456
|
+
export { BreadcrumbBarView, Button_default, CORE_APP_ORIGIN, CORE_BILLING_PATH, CREDIT_TYPE_LABELS, CREDIT_TYPE_ORDER, Card, CreditsAction, FormColumn, FuelAction, HeaderTabBar, Input_default, NAV_DISPLAY_OPTIONS, NavChromeProvider, NavDisplayAction, NavThemeControl, NotificationsAction, PageHeaderView, SPECS_ORIGIN, Select_default, SpecOverlayAction, SpeculationRulesScript, SupportAction, TOPBAR_GLYPH_SIZE, Textarea_default, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, creditGaugeRatio, creditStateWord, creditTooltipLine, creditsAriaLabel, creditsIconState, emptyNotificationsFeed, normalizeNotificationsFeed, resolveBrandGlyph, resolveOrgLogoUrl, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference, useTopBarIconSlotGlyph, warnDeprecated };
|
|
2457
|
+
//# sourceMappingURL=chunk-7WSGW5CC.js.map
|
|
2458
|
+
//# sourceMappingURL=chunk-7WSGW5CC.js.map
|