@godxjp/ui 33.19.0 → 33.21.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/README.md +4 -4
- package/agent/START-HERE.md +7 -7
- package/agent/components/AppSettingPicker.json +0 -1
- package/agent/components/AppShell.json +11 -1
- package/agent/components/CardShowcase.json +44 -0
- package/agent/components/CatalogCard.json +83 -0
- package/agent/components/CatalogDetail.json +76 -0
- package/agent/components/CatalogDetailSection.json +52 -0
- package/agent/components/CatalogDetailTag.json +27 -0
- package/agent/components/Descriptions.json +6 -0
- package/agent/components/EditorialArticle.json +53 -0
- package/agent/components/EditorialAuth.json +53 -0
- package/agent/components/EditorialAuthCard.json +52 -0
- package/agent/components/EditorialBanner.json +53 -0
- package/agent/components/EditorialBreadcrumb.json +38 -0
- package/agent/components/EditorialCard.json +70 -0
- package/agent/components/EditorialEmptyPanel.json +57 -0
- package/agent/components/EditorialFilterBar.json +51 -0
- package/agent/components/EditorialFilterField.json +39 -0
- package/agent/components/EditorialFilterPanel.json +46 -0
- package/agent/components/EditorialFooter.json +54 -0
- package/agent/components/EditorialFootnote.json +36 -0
- package/agent/components/EditorialHero.json +52 -0
- package/agent/components/EditorialInlineSearch.json +54 -0
- package/agent/components/EditorialMasthead.json +52 -0
- package/agent/components/EditorialMetaBar.json +37 -0
- package/agent/components/EditorialPageHeader.json +73 -0
- package/agent/components/EditorialPanel.json +48 -0
- package/agent/components/EditorialPillNav.json +41 -0
- package/agent/components/EditorialPrompt.json +54 -0
- package/agent/components/EditorialSearch.json +112 -0
- package/agent/components/EditorialSection.json +68 -0
- package/agent/components/EditorialSectionHead.json +62 -0
- package/agent/components/EditorialStats.json +32 -0
- package/agent/components/EditorialTextButton.json +47 -0
- package/agent/components/EditorialToggleGroup.json +52 -0
- package/agent/components/EditorialToolbar.json +45 -0
- package/agent/components/Eyebrow.json +39 -0
- package/agent/components/HoldingCard.json +69 -0
- package/agent/components/HoldingCardAction.json +51 -0
- package/agent/components/HoldingGrid.json +37 -0
- package/agent/components/NumberInput.json +5 -0
- package/agent/components/PriceSummary.json +32 -0
- package/agent/components/SettingsLayout.json +31 -0
- package/agent/components/SettingsPanel.json +53 -0
- package/agent/components/Tabs.json +2 -2
- package/agent/components/ThemePicker.json +54 -0
- package/agent/components/TopbarItem.json +5 -0
- package/agent/components-index.json +292 -98
- package/agent/components.json +2054 -4
- package/agent/index.json +7 -7
- package/agent/llms.txt +8 -8
- package/agent/tokens.json +5646 -126
- package/dist/components/data-display/badge.js +4 -2
- package/dist/components/data-display/descriptions.d.ts +5 -1
- package/dist/components/data-display/descriptions.js +21 -9
- package/dist/components/data-entry/form-field.js +2 -2
- package/dist/components/data-entry/number-input.d.ts +1 -0
- package/dist/components/data-entry/number-input.js +8 -0
- package/dist/components/data-entry/select.js +24 -2
- package/dist/components/data-entry/toggle.d.ts +2 -1
- package/dist/components/data-entry/toggle.js +12 -2
- package/dist/components/general/button.js +7 -0
- package/dist/components/general/typography.d.ts +1 -1
- package/dist/components/layout/app-shell.d.ts +1 -1
- package/dist/components/layout/app-shell.js +28 -2
- package/dist/components/layout/centered-shell.js +4 -0
- package/dist/components/layout/editorial-account.d.ts +51 -0
- package/dist/components/layout/editorial-account.js +466 -0
- package/dist/components/layout/editorial-catalog.d.ts +18 -0
- package/dist/components/layout/editorial-catalog.js +164 -0
- package/dist/components/layout/editorial.d.ts +56 -0
- package/dist/components/layout/editorial.js +867 -0
- package/dist/components/layout/index.d.ts +6 -0
- package/dist/components/layout/index.js +98 -0
- package/dist/components/layout/mobile-shell.d.ts +2 -0
- package/dist/components/layout/mobile-shell.js +18 -11
- package/dist/components/layout/responsive-grid.js +9 -1
- package/dist/components/layout/topbar-item.d.ts +1 -0
- package/dist/components/layout/topbar-item.js +2 -0
- package/dist/components/navigation/tabs.d.ts +1 -1
- package/dist/components/navigation/tabs.js +17 -5
- package/dist/contracts/measurement.json +1 -1
- package/dist/lib/toast-clearance.js +1 -1
- package/dist/props/components/data-display.prop.d.ts +3 -1
- package/dist/props/components/data-entry.prop.d.ts +9 -0
- package/dist/props/components/editorial-account.prop.d.ts +249 -0
- package/dist/props/components/editorial-account.prop.js +0 -0
- package/dist/props/components/general.prop.d.ts +6 -2
- package/dist/props/components/layout.prop.d.ts +602 -2
- package/dist/props/components/navigation.prop.d.ts +2 -0
- package/dist/props/registry.d.ts +1140 -8
- package/dist/props/registry.js +805 -1
- package/dist/styles/badge-layout.css +2 -0
- package/dist/styles/control.css +58 -12
- package/dist/styles/core.css +1 -0
- package/dist/styles/data-display-layout.css +39 -3
- package/dist/styles/editorial-account-layout.css +1130 -0
- package/dist/styles/focus-ring.css +33 -10
- package/dist/styles/form-layout.css +8 -1
- package/dist/styles/index.css +1 -0
- package/dist/styles/layers.json +248 -1
- package/dist/styles/layout.css +2022 -0
- package/dist/styles/navigation-layout.css +5 -0
- package/dist/styles/shell-layout.css +100 -2
- package/dist/styles/table-layout.css +25 -13
- package/dist/styles/text-layout.css +6 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/base.css +2 -0
- package/dist/tokens/components/badge.css +3 -0
- package/dist/tokens/components/control.css +9 -0
- package/dist/tokens/components/descriptions.css +2 -0
- package/dist/tokens/components/editorial-account.css +393 -0
- package/dist/tokens/components/editorial.css +721 -0
- package/dist/tokens/components/form.css +4 -0
- package/dist/tokens/components/navigation.css +2 -0
- package/dist/tokens/components/shell.css +23 -0
- package/dist/tokens/components/table.css +1 -1
- package/docs/TOKENS.md +26 -0
- package/package.json +2 -2
- package/scripts/ui-audit.mjs +3 -2
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { useLayoutEffect } from "@react-aria/utils";
|
|
6
|
+
import { ArrowRight, Bookmark, Search } from "lucide-react";
|
|
7
|
+
import { isImeComposing } from "../../lib/ime.js";
|
|
8
|
+
import { useOverlayPortalContainer } from "../../lib/overlay-portal.js";
|
|
9
|
+
import { Slot } from "../../lib/slot.js";
|
|
10
|
+
import { Breadcrumb } from "./breadcrumb.js";
|
|
11
|
+
import { EditorialSearchInline } from "./editorial-account.js";
|
|
12
|
+
import { cn } from "../../lib/utils.js";
|
|
13
|
+
function intoElement(element, className, content, extra) {
|
|
14
|
+
const props = element.props;
|
|
15
|
+
return React.cloneElement(
|
|
16
|
+
element,
|
|
17
|
+
{ ...extra, className: cn(className, props.className) },
|
|
18
|
+
content
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function EditorialSection({
|
|
22
|
+
children,
|
|
23
|
+
tone = "default",
|
|
24
|
+
divider = "none",
|
|
25
|
+
spacing = "none",
|
|
26
|
+
as: Tag = "section",
|
|
27
|
+
className,
|
|
28
|
+
...rest
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
Tag,
|
|
32
|
+
{
|
|
33
|
+
...rest,
|
|
34
|
+
"data-slot": "editorial-section",
|
|
35
|
+
"data-tone": tone === "default" ? void 0 : tone,
|
|
36
|
+
"data-divider": divider === "none" ? void 0 : divider,
|
|
37
|
+
"data-spacing": spacing === "none" ? void 0 : spacing,
|
|
38
|
+
className: cn("ui-editorial-section", className),
|
|
39
|
+
children: /* @__PURE__ */ jsx("div", { className: "ui-editorial-section-content", children })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function EditorialHero({
|
|
44
|
+
eyebrow,
|
|
45
|
+
title,
|
|
46
|
+
description,
|
|
47
|
+
search,
|
|
48
|
+
footer,
|
|
49
|
+
media,
|
|
50
|
+
className
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "editorial-hero", className: cn("ui-editorial-hero", className), children: [
|
|
53
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-editorial-hero-copy", children: [
|
|
54
|
+
eyebrow,
|
|
55
|
+
/* @__PURE__ */ jsx("h1", { className: "ui-editorial-hero-title", children: title }),
|
|
56
|
+
description != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-hero-description", children: description }),
|
|
57
|
+
search != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-hero-search", children: search }),
|
|
58
|
+
footer != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-hero-footer", children: footer })
|
|
59
|
+
] }),
|
|
60
|
+
media != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-hero-media", children: media })
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
function Eyebrow({ children, variant = "ruled", as: Tag = "p", className }) {
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
Tag,
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "eyebrow",
|
|
68
|
+
"data-variant": variant,
|
|
69
|
+
className: cn("ui-editorial-eyebrow", className),
|
|
70
|
+
children
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function EditorialSectionHead({
|
|
75
|
+
eyebrow,
|
|
76
|
+
title,
|
|
77
|
+
description,
|
|
78
|
+
action,
|
|
79
|
+
level = 2,
|
|
80
|
+
scale = "section",
|
|
81
|
+
titleId,
|
|
82
|
+
className
|
|
83
|
+
}) {
|
|
84
|
+
const Heading = level === 3 ? "h3" : "h2";
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "editorial-section-head",
|
|
89
|
+
"data-scale": scale === "module" ? "module" : void 0,
|
|
90
|
+
className: cn("ui-editorial-section-head", className),
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-editorial-section-head-copy", children: [
|
|
93
|
+
eyebrow,
|
|
94
|
+
/* @__PURE__ */ jsx(Heading, { id: titleId, className: "ui-editorial-section-head-title", children: title }),
|
|
95
|
+
description != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-section-head-description", children: description })
|
|
96
|
+
] }),
|
|
97
|
+
action != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-section-head-action", children: action })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function EditorialBreadcrumb({
|
|
103
|
+
items,
|
|
104
|
+
linkComponent,
|
|
105
|
+
ariaLabel,
|
|
106
|
+
className
|
|
107
|
+
}) {
|
|
108
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "editorial-breadcrumb", className: cn("ui-editorial-breadcrumb", className), children: /* @__PURE__ */ jsx(Breadcrumb, { items, linkComponent, ariaLabel }) });
|
|
109
|
+
}
|
|
110
|
+
function EditorialPageHeader({
|
|
111
|
+
breadcrumb,
|
|
112
|
+
linkComponent,
|
|
113
|
+
breadcrumbLabel,
|
|
114
|
+
eyebrow,
|
|
115
|
+
title,
|
|
116
|
+
description,
|
|
117
|
+
actions,
|
|
118
|
+
search,
|
|
119
|
+
titleId,
|
|
120
|
+
eyebrowTone = "page",
|
|
121
|
+
className
|
|
122
|
+
}) {
|
|
123
|
+
return /* @__PURE__ */ jsxs(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
"data-slot": "editorial-page-header",
|
|
127
|
+
"data-eyebrow-tone": eyebrowTone === "page" ? void 0 : eyebrowTone,
|
|
128
|
+
className: cn("ui-editorial-page-header", className),
|
|
129
|
+
children: [
|
|
130
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx(
|
|
131
|
+
EditorialBreadcrumb,
|
|
132
|
+
{
|
|
133
|
+
items: breadcrumb,
|
|
134
|
+
linkComponent,
|
|
135
|
+
ariaLabel: breadcrumbLabel
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsxs("header", { className: "ui-editorial-page-header-row", children: [
|
|
139
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-editorial-page-header-copy", children: [
|
|
140
|
+
eyebrow,
|
|
141
|
+
/* @__PURE__ */ jsx("h1", { id: titleId, className: "ui-editorial-page-header-title", children: title }),
|
|
142
|
+
description != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-page-header-description", children: description }),
|
|
143
|
+
search != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-page-header-search", children: search })
|
|
144
|
+
] }),
|
|
145
|
+
actions != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-page-header-actions", children: actions })
|
|
146
|
+
] })
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function EditorialArticle({
|
|
152
|
+
eyebrow,
|
|
153
|
+
title,
|
|
154
|
+
intro,
|
|
155
|
+
children,
|
|
156
|
+
titleId,
|
|
157
|
+
className
|
|
158
|
+
}) {
|
|
159
|
+
return /* @__PURE__ */ jsxs("article", { "data-slot": "editorial-article", className: cn("ui-editorial-article", className), children: [
|
|
160
|
+
eyebrow,
|
|
161
|
+
/* @__PURE__ */ jsx("h1", { id: titleId, className: "ui-editorial-article-title", children: title }),
|
|
162
|
+
intro != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-article-intro", children: intro }),
|
|
163
|
+
children
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
166
|
+
function EditorialArticleSection({
|
|
167
|
+
title,
|
|
168
|
+
paragraphs,
|
|
169
|
+
children,
|
|
170
|
+
titleId,
|
|
171
|
+
className
|
|
172
|
+
}) {
|
|
173
|
+
return /* @__PURE__ */ jsxs(
|
|
174
|
+
"section",
|
|
175
|
+
{
|
|
176
|
+
"data-slot": "editorial-article-section",
|
|
177
|
+
"aria-labelledby": titleId,
|
|
178
|
+
className: cn("ui-editorial-article-section", className),
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsx("h2", { id: titleId, className: "ui-editorial-article-heading", children: title }),
|
|
181
|
+
paragraphs?.map((paragraph, index) => /* @__PURE__ */ jsx("p", { className: "ui-editorial-article-paragraph", children: paragraph }, index)),
|
|
182
|
+
children
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
function EditorialNote({ children, className }) {
|
|
188
|
+
return /* @__PURE__ */ jsx("div", { role: "note", "data-slot": "editorial-note", className: cn("ui-editorial-note", className), children });
|
|
189
|
+
}
|
|
190
|
+
function EditorialPanel({
|
|
191
|
+
tag,
|
|
192
|
+
title,
|
|
193
|
+
items,
|
|
194
|
+
children,
|
|
195
|
+
level = 2,
|
|
196
|
+
className
|
|
197
|
+
}) {
|
|
198
|
+
const Heading = level === 3 ? "h3" : "h2";
|
|
199
|
+
return /* @__PURE__ */ jsxs("article", { "data-slot": "editorial-panel", className: cn("ui-editorial-panel", className), children: [
|
|
200
|
+
tag != null && /* @__PURE__ */ jsx("span", { className: "ui-editorial-panel-tag", children: tag }),
|
|
201
|
+
/* @__PURE__ */ jsx(Heading, { className: "ui-editorial-panel-title", children: title }),
|
|
202
|
+
items && items.length > 0 && /* @__PURE__ */ jsx("ul", { className: "ui-editorial-panel-list", children: items.map((item, index) => /* @__PURE__ */ jsx("li", { children: item }, index)) }),
|
|
203
|
+
children
|
|
204
|
+
] });
|
|
205
|
+
}
|
|
206
|
+
function EditorialTextLink({
|
|
207
|
+
children,
|
|
208
|
+
asChild,
|
|
209
|
+
className,
|
|
210
|
+
...rest
|
|
211
|
+
}) {
|
|
212
|
+
const icon = /* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": true, className: "ui-editorial-text-link-icon" });
|
|
213
|
+
if (asChild && React.isValidElement(children)) {
|
|
214
|
+
const child = children;
|
|
215
|
+
return intoElement(
|
|
216
|
+
child,
|
|
217
|
+
cn("ui-editorial-text-link", className),
|
|
218
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
219
|
+
child.props.children,
|
|
220
|
+
icon
|
|
221
|
+
] }),
|
|
222
|
+
{ ...rest, "data-slot": "editorial-text-link" }
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
return /* @__PURE__ */ jsxs(
|
|
226
|
+
"a",
|
|
227
|
+
{
|
|
228
|
+
...rest,
|
|
229
|
+
"data-slot": "editorial-text-link",
|
|
230
|
+
className: cn("ui-editorial-text-link", className),
|
|
231
|
+
children: [
|
|
232
|
+
children,
|
|
233
|
+
icon
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
function EditorialSearch(props) {
|
|
239
|
+
if (props.variant === "inline") {
|
|
240
|
+
const { label, id, placeholder, defaultValue, onSearch, debounce, count, className } = props;
|
|
241
|
+
return /* @__PURE__ */ jsx(
|
|
242
|
+
EditorialSearchInline,
|
|
243
|
+
{
|
|
244
|
+
label,
|
|
245
|
+
id,
|
|
246
|
+
placeholder,
|
|
247
|
+
defaultValue,
|
|
248
|
+
onSearch: onSearch ? (query) => onSearch(query) : void 0,
|
|
249
|
+
debounce,
|
|
250
|
+
count,
|
|
251
|
+
className
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
return /* @__PURE__ */ jsx(EditorialSearchInset, { ...props });
|
|
256
|
+
}
|
|
257
|
+
function EditorialSearchInset({
|
|
258
|
+
label,
|
|
259
|
+
placeholder,
|
|
260
|
+
submitLabel,
|
|
261
|
+
name = "q",
|
|
262
|
+
defaultValue,
|
|
263
|
+
action,
|
|
264
|
+
onSearch,
|
|
265
|
+
scope,
|
|
266
|
+
suggestions,
|
|
267
|
+
suggestionsFooter,
|
|
268
|
+
suggestionsLabel,
|
|
269
|
+
onQueryChange,
|
|
270
|
+
linkComponent: LinkComponent = "a",
|
|
271
|
+
id,
|
|
272
|
+
className
|
|
273
|
+
}) {
|
|
274
|
+
const reactId = React.useId();
|
|
275
|
+
const inputId = id ?? `editorial-search-${reactId}`;
|
|
276
|
+
const listboxId = `${inputId}-suggestions`;
|
|
277
|
+
const combobox = suggestions !== void 0 || suggestionsFooter !== void 0;
|
|
278
|
+
const composing = React.useRef(false);
|
|
279
|
+
const [focused, setFocused] = React.useState(false);
|
|
280
|
+
const [dismissed, setDismissed] = React.useState(false);
|
|
281
|
+
const [hasQuery, setHasQuery] = React.useState(Boolean(defaultValue?.trim()));
|
|
282
|
+
const [active, setActive] = React.useState(-1);
|
|
283
|
+
const groups = (suggestions ?? []).filter((group) => group.items.length > 0);
|
|
284
|
+
const rowKeys = [
|
|
285
|
+
...groups.flatMap((group) => group.items.map((item) => `${group.id}:${item.id}`)),
|
|
286
|
+
...suggestionsFooter ? ["footer"] : []
|
|
287
|
+
];
|
|
288
|
+
const rowsKey = rowKeys.join("|");
|
|
289
|
+
const open = combobox && focused && !dismissed && hasQuery && rowKeys.length > 0;
|
|
290
|
+
const formRef = React.useRef(null);
|
|
291
|
+
const portalContainer = useOverlayPortalContainer();
|
|
292
|
+
const anchor = usePopupAnchor(formRef, open);
|
|
293
|
+
const optionId = React.useCallback(
|
|
294
|
+
(index) => `${listboxId}-option-${index}`,
|
|
295
|
+
[listboxId]
|
|
296
|
+
);
|
|
297
|
+
React.useEffect(() => setActive(-1), [rowsKey]);
|
|
298
|
+
React.useEffect(() => {
|
|
299
|
+
if (open && active >= 0) {
|
|
300
|
+
document.getElementById(optionId(active))?.scrollIntoView?.({ block: "nearest" });
|
|
301
|
+
}
|
|
302
|
+
}, [open, active, optionId]);
|
|
303
|
+
const report = (value) => {
|
|
304
|
+
setHasQuery(value.trim() !== "");
|
|
305
|
+
setDismissed(false);
|
|
306
|
+
onQueryChange?.(value);
|
|
307
|
+
};
|
|
308
|
+
const onKeyDown = (event) => {
|
|
309
|
+
if (isImeComposing(event)) return;
|
|
310
|
+
if (!open) {
|
|
311
|
+
if (event.key === "ArrowDown" && hasQuery && rowKeys.length > 0) {
|
|
312
|
+
event.preventDefault();
|
|
313
|
+
setDismissed(false);
|
|
314
|
+
}
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const count = rowKeys.length;
|
|
318
|
+
if (event.key === "ArrowDown") {
|
|
319
|
+
event.preventDefault();
|
|
320
|
+
setActive((index) => (index + 1) % count);
|
|
321
|
+
} else if (event.key === "ArrowUp") {
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
setActive((index) => index <= 0 ? count - 1 : index - 1);
|
|
324
|
+
} else if (event.key === "Escape") {
|
|
325
|
+
event.preventDefault();
|
|
326
|
+
setDismissed(true);
|
|
327
|
+
setActive(-1);
|
|
328
|
+
} else if (event.key === "Enter" && active >= 0) {
|
|
329
|
+
event.preventDefault();
|
|
330
|
+
document.getElementById(optionId(active))?.click();
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
let rowIndex = -1;
|
|
334
|
+
const option = (key, href, rowClass, children) => {
|
|
335
|
+
rowIndex += 1;
|
|
336
|
+
const index = rowIndex;
|
|
337
|
+
return /* @__PURE__ */ jsx(
|
|
338
|
+
LinkComponent,
|
|
339
|
+
{
|
|
340
|
+
id: optionId(index),
|
|
341
|
+
href,
|
|
342
|
+
role: "option",
|
|
343
|
+
"aria-selected": index === active,
|
|
344
|
+
tabIndex: -1,
|
|
345
|
+
className: rowClass,
|
|
346
|
+
onClick: () => {
|
|
347
|
+
setDismissed(true);
|
|
348
|
+
setActive(-1);
|
|
349
|
+
},
|
|
350
|
+
children
|
|
351
|
+
},
|
|
352
|
+
key
|
|
353
|
+
);
|
|
354
|
+
};
|
|
355
|
+
const comboboxProps = combobox ? {
|
|
356
|
+
role: "combobox",
|
|
357
|
+
"aria-autocomplete": "list",
|
|
358
|
+
"aria-expanded": open,
|
|
359
|
+
"aria-controls": listboxId,
|
|
360
|
+
"aria-activedescendant": open && active >= 0 ? optionId(active) : void 0,
|
|
361
|
+
onChange: (event) => {
|
|
362
|
+
if (!composing.current) report(event.currentTarget.value);
|
|
363
|
+
},
|
|
364
|
+
onCompositionStart: () => {
|
|
365
|
+
composing.current = true;
|
|
366
|
+
},
|
|
367
|
+
onCompositionEnd: (event) => {
|
|
368
|
+
composing.current = false;
|
|
369
|
+
report(event.currentTarget.value);
|
|
370
|
+
},
|
|
371
|
+
onFocus: () => setFocused(true),
|
|
372
|
+
onBlur: () => {
|
|
373
|
+
setFocused(false);
|
|
374
|
+
setActive(-1);
|
|
375
|
+
},
|
|
376
|
+
onKeyDown
|
|
377
|
+
} : {};
|
|
378
|
+
return /* @__PURE__ */ jsxs(
|
|
379
|
+
"form",
|
|
380
|
+
{
|
|
381
|
+
ref: formRef,
|
|
382
|
+
role: "search",
|
|
383
|
+
"aria-label": label,
|
|
384
|
+
action,
|
|
385
|
+
"data-slot": "editorial-search",
|
|
386
|
+
className: cn("ui-editorial-search", className),
|
|
387
|
+
onSubmit: (event) => {
|
|
388
|
+
setDismissed(true);
|
|
389
|
+
if (!onSearch) return;
|
|
390
|
+
event.preventDefault();
|
|
391
|
+
const value = new FormData(event.currentTarget).get(name);
|
|
392
|
+
onSearch(typeof value === "string" ? value.trim() : "");
|
|
393
|
+
},
|
|
394
|
+
children: [
|
|
395
|
+
scope != null && /* @__PURE__ */ jsx("span", { "data-slot": "editorial-search-scope", className: "ui-editorial-search-scope", children: scope }),
|
|
396
|
+
/* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "sr-only", children: label }),
|
|
397
|
+
/* @__PURE__ */ jsx(Search, { "aria-hidden": true, className: "ui-editorial-search-icon" }),
|
|
398
|
+
/* @__PURE__ */ jsx(
|
|
399
|
+
"input",
|
|
400
|
+
{
|
|
401
|
+
id: inputId,
|
|
402
|
+
name,
|
|
403
|
+
type: "search",
|
|
404
|
+
placeholder,
|
|
405
|
+
defaultValue,
|
|
406
|
+
autoComplete: "off",
|
|
407
|
+
className: "ui-editorial-search-input",
|
|
408
|
+
...comboboxProps
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
/* @__PURE__ */ jsxs("button", { type: "submit", className: "ui-editorial-search-button ui-focus-ring", children: [
|
|
412
|
+
submitLabel,
|
|
413
|
+
/* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": true, className: "ui-editorial-search-button-icon" })
|
|
414
|
+
] }),
|
|
415
|
+
combobox && anchor.mounted && createPortal(
|
|
416
|
+
/* @__PURE__ */ jsx(
|
|
417
|
+
"div",
|
|
418
|
+
{
|
|
419
|
+
"data-slot": "editorial-search-popup",
|
|
420
|
+
className: "ui-editorial-search-popup",
|
|
421
|
+
hidden: !open,
|
|
422
|
+
style: anchor.style,
|
|
423
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
424
|
+
children: /* @__PURE__ */ jsxs("div", { role: "listbox", id: listboxId, "aria-label": suggestionsLabel ?? label, children: [
|
|
425
|
+
groups.map((group) => /* @__PURE__ */ jsxs(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
role: "group",
|
|
429
|
+
"aria-labelledby": `${listboxId}-group-${group.id}`,
|
|
430
|
+
className: "ui-editorial-search-group",
|
|
431
|
+
children: [
|
|
432
|
+
/* @__PURE__ */ jsx(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
role: "presentation",
|
|
436
|
+
id: `${listboxId}-group-${group.id}`,
|
|
437
|
+
className: "ui-editorial-search-group-label",
|
|
438
|
+
children: group.label
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
group.items.map(
|
|
442
|
+
(item) => option(
|
|
443
|
+
`${group.id}:${item.id}`,
|
|
444
|
+
item.href,
|
|
445
|
+
"ui-editorial-search-suggestion",
|
|
446
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
447
|
+
item.media != null && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-editorial-search-suggestion-media", children: item.media }),
|
|
448
|
+
/* @__PURE__ */ jsxs("span", { className: "ui-editorial-search-suggestion-text", children: [
|
|
449
|
+
/* @__PURE__ */ jsx("span", { className: "ui-editorial-search-suggestion-label", children: item.label }),
|
|
450
|
+
item.description != null && /* @__PURE__ */ jsx("span", { className: "ui-editorial-search-suggestion-description", children: item.description })
|
|
451
|
+
] }),
|
|
452
|
+
item.meta != null && /* @__PURE__ */ jsx("span", { className: "ui-editorial-search-suggestion-meta", children: item.meta })
|
|
453
|
+
] })
|
|
454
|
+
)
|
|
455
|
+
)
|
|
456
|
+
]
|
|
457
|
+
},
|
|
458
|
+
group.id
|
|
459
|
+
)),
|
|
460
|
+
suggestionsFooter && option(
|
|
461
|
+
"footer",
|
|
462
|
+
suggestionsFooter.href,
|
|
463
|
+
"ui-editorial-search-suggestions-footer",
|
|
464
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
465
|
+
/* @__PURE__ */ jsx("span", { className: "ui-editorial-search-suggestion-label", children: suggestionsFooter.label }),
|
|
466
|
+
/* @__PURE__ */ jsx(
|
|
467
|
+
ArrowRight,
|
|
468
|
+
{
|
|
469
|
+
"aria-hidden": true,
|
|
470
|
+
className: "ui-editorial-search-suggestions-footer-icon"
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
] })
|
|
474
|
+
)
|
|
475
|
+
] })
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
portalContainer ?? document.body
|
|
479
|
+
)
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
function usePopupAnchor(formRef, open) {
|
|
485
|
+
const [mounted, setMounted] = React.useState(false);
|
|
486
|
+
const [style, setStyle] = React.useState();
|
|
487
|
+
React.useEffect(() => setMounted(true), []);
|
|
488
|
+
useLayoutEffect(() => {
|
|
489
|
+
const form = formRef.current;
|
|
490
|
+
if (!open || !form) return;
|
|
491
|
+
const update = () => {
|
|
492
|
+
const rect = form.getBoundingClientRect();
|
|
493
|
+
setStyle({
|
|
494
|
+
top: rect.bottom,
|
|
495
|
+
left: rect.left,
|
|
496
|
+
width: rect.width,
|
|
497
|
+
["--editorial-search-popup-room"]: `${Math.max(0, window.innerHeight - rect.bottom)}px`
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
update();
|
|
501
|
+
window.addEventListener("scroll", update, true);
|
|
502
|
+
window.addEventListener("resize", update);
|
|
503
|
+
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(update);
|
|
504
|
+
observer?.observe(form);
|
|
505
|
+
return () => {
|
|
506
|
+
window.removeEventListener("scroll", update, true);
|
|
507
|
+
window.removeEventListener("resize", update);
|
|
508
|
+
observer?.disconnect();
|
|
509
|
+
};
|
|
510
|
+
}, [formRef, open]);
|
|
511
|
+
return { mounted, style };
|
|
512
|
+
}
|
|
513
|
+
function EditorialPillNav({ label, children, className, ...rest }) {
|
|
514
|
+
return /* @__PURE__ */ jsxs(
|
|
515
|
+
"nav",
|
|
516
|
+
{
|
|
517
|
+
...rest,
|
|
518
|
+
"data-slot": "editorial-pill-nav",
|
|
519
|
+
className: cn("ui-editorial-pill-nav", className),
|
|
520
|
+
children: [
|
|
521
|
+
label != null && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-editorial-pill-nav-label", children: label }),
|
|
522
|
+
children
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
function EditorialPillNavItem({
|
|
528
|
+
children,
|
|
529
|
+
asChild,
|
|
530
|
+
icon,
|
|
531
|
+
className,
|
|
532
|
+
...rest
|
|
533
|
+
}) {
|
|
534
|
+
const marker = icon === "dot" ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-editorial-pill-dot" }) : icon != null ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-editorial-pill-icon", children: icon }) : null;
|
|
535
|
+
if (asChild && React.isValidElement(children)) {
|
|
536
|
+
const child = children;
|
|
537
|
+
return intoElement(
|
|
538
|
+
child,
|
|
539
|
+
cn("ui-editorial-pill ui-focus-ring", className),
|
|
540
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
541
|
+
marker,
|
|
542
|
+
child.props.children
|
|
543
|
+
] }),
|
|
544
|
+
{ ...rest, "data-slot": "editorial-pill" }
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
return /* @__PURE__ */ jsxs(
|
|
548
|
+
"a",
|
|
549
|
+
{
|
|
550
|
+
...rest,
|
|
551
|
+
"data-slot": "editorial-pill",
|
|
552
|
+
className: cn("ui-editorial-pill ui-focus-ring", className),
|
|
553
|
+
children: [
|
|
554
|
+
marker,
|
|
555
|
+
children
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
const FAN_POSITIONS = ["start", "center", "end"];
|
|
561
|
+
function CardShowcase({ preset, items, label, caption, className }) {
|
|
562
|
+
if (preset === "binder") {
|
|
563
|
+
return /* @__PURE__ */ jsx(
|
|
564
|
+
"div",
|
|
565
|
+
{
|
|
566
|
+
"data-slot": "card-showcase",
|
|
567
|
+
"data-preset": "binder",
|
|
568
|
+
className: cn("ui-card-showcase", className),
|
|
569
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx("span", { className: "ui-card-showcase-pocket", children: item }, index))
|
|
570
|
+
}
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
const placed = FAN_POSITIONS.map((position, index) => ({ position, item: items[index] })).filter(
|
|
574
|
+
(entry) => entry.item != null
|
|
575
|
+
);
|
|
576
|
+
const painted = [
|
|
577
|
+
...placed.filter((entry) => entry.position !== "center"),
|
|
578
|
+
...placed.filter((entry) => entry.position === "center")
|
|
579
|
+
];
|
|
580
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "card-showcase", "data-preset": "fan", className: cn("ui-card-showcase", className), children: [
|
|
581
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-orbit", "data-orbit": "1" }),
|
|
582
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-orbit", "data-orbit": "2" }),
|
|
583
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-orbit", "data-orbit": "3" }),
|
|
584
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-glow" }),
|
|
585
|
+
label != null && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-label", children: label }),
|
|
586
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-star", children: "\u2726" }),
|
|
587
|
+
painted.map(({ position, item }) => /* @__PURE__ */ jsx("div", { className: "ui-card-showcase-card", "data-position": position, children: item }, position)),
|
|
588
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-star", "data-size": "small", children: "\u2726" }),
|
|
589
|
+
caption && /* @__PURE__ */ jsxs("div", { className: "ui-card-showcase-caption", children: [
|
|
590
|
+
caption.icon != null && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-card-showcase-caption-icon", children: caption.icon }),
|
|
591
|
+
/* @__PURE__ */ jsxs("span", { className: "ui-card-showcase-caption-copy", children: [
|
|
592
|
+
caption.overline != null && /* @__PURE__ */ jsx("small", { className: "ui-card-showcase-caption-overline", children: caption.overline }),
|
|
593
|
+
/* @__PURE__ */ jsx("strong", { className: "ui-card-showcase-caption-title", children: caption.title })
|
|
594
|
+
] })
|
|
595
|
+
] })
|
|
596
|
+
] });
|
|
597
|
+
}
|
|
598
|
+
function EditorialBanner({
|
|
599
|
+
eyebrow,
|
|
600
|
+
title,
|
|
601
|
+
description,
|
|
602
|
+
action,
|
|
603
|
+
media,
|
|
604
|
+
level = 2,
|
|
605
|
+
className
|
|
606
|
+
}) {
|
|
607
|
+
const Heading = level === 3 ? "h3" : "h2";
|
|
608
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "editorial-banner", className: cn("ui-editorial-banner", className), children: [
|
|
609
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-editorial-banner-copy", children: [
|
|
610
|
+
eyebrow,
|
|
611
|
+
/* @__PURE__ */ jsx(Heading, { className: "ui-editorial-banner-title", children: title }),
|
|
612
|
+
description != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-banner-description", children: description }),
|
|
613
|
+
action != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-banner-action", children: action })
|
|
614
|
+
] }),
|
|
615
|
+
media != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-banner-media", children: media })
|
|
616
|
+
] });
|
|
617
|
+
}
|
|
618
|
+
function CatalogCard({
|
|
619
|
+
variant = "card",
|
|
620
|
+
media,
|
|
621
|
+
favorite,
|
|
622
|
+
overline,
|
|
623
|
+
title,
|
|
624
|
+
level = 3,
|
|
625
|
+
meta,
|
|
626
|
+
priceLabel,
|
|
627
|
+
price,
|
|
628
|
+
change,
|
|
629
|
+
footer,
|
|
630
|
+
className
|
|
631
|
+
}) {
|
|
632
|
+
const Heading = level === 2 ? "h2" : level === 4 ? "h4" : "h3";
|
|
633
|
+
return /* @__PURE__ */ jsxs(
|
|
634
|
+
"article",
|
|
635
|
+
{
|
|
636
|
+
"data-slot": "catalog-card",
|
|
637
|
+
"data-variant": variant,
|
|
638
|
+
className: cn("ui-catalog-card", className),
|
|
639
|
+
children: [
|
|
640
|
+
favorite && /* @__PURE__ */ jsx(
|
|
641
|
+
"button",
|
|
642
|
+
{
|
|
643
|
+
type: "button",
|
|
644
|
+
"aria-pressed": favorite.pressed,
|
|
645
|
+
"aria-label": favorite.label,
|
|
646
|
+
disabled: favorite.disabled,
|
|
647
|
+
className: "ui-catalog-card-favorite ui-focus-ring",
|
|
648
|
+
onClick: () => favorite.onPressedChange(!favorite.pressed),
|
|
649
|
+
children: /* @__PURE__ */ jsx(Bookmark, { "aria-hidden": true, className: "ui-catalog-card-favorite-icon" })
|
|
650
|
+
}
|
|
651
|
+
),
|
|
652
|
+
/* @__PURE__ */ jsx("div", { className: "ui-catalog-card-media", children: media }),
|
|
653
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-catalog-card-body", children: [
|
|
654
|
+
overline != null && /* @__PURE__ */ jsx("p", { className: "ui-catalog-card-overline", children: overline }),
|
|
655
|
+
/* @__PURE__ */ jsx(Heading, { className: "ui-catalog-card-title", children: title }),
|
|
656
|
+
meta != null && /* @__PURE__ */ jsx("div", { className: "ui-catalog-card-meta", children: meta }),
|
|
657
|
+
priceLabel != null && /* @__PURE__ */ jsx("p", { className: "ui-catalog-card-price-label", children: priceLabel }),
|
|
658
|
+
(price != null || change != null) && /* @__PURE__ */ jsxs("div", { className: "ui-catalog-card-price-line", children: [
|
|
659
|
+
price != null && /* @__PURE__ */ jsx("span", { className: "ui-catalog-card-price", children: price }),
|
|
660
|
+
change != null && /* @__PURE__ */ jsx("span", { className: "ui-catalog-card-change", children: change })
|
|
661
|
+
] }),
|
|
662
|
+
footer != null && /* @__PURE__ */ jsx("div", { className: "ui-catalog-card-footer", children: footer })
|
|
663
|
+
] })
|
|
664
|
+
]
|
|
665
|
+
}
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
function CatalogCardTag({ children, className }) {
|
|
669
|
+
return /* @__PURE__ */ jsx("span", { className: cn("ui-catalog-card-tag", className), children });
|
|
670
|
+
}
|
|
671
|
+
function EditorialCard({
|
|
672
|
+
variant,
|
|
673
|
+
link,
|
|
674
|
+
media,
|
|
675
|
+
overline,
|
|
676
|
+
title,
|
|
677
|
+
description,
|
|
678
|
+
action,
|
|
679
|
+
level = 3,
|
|
680
|
+
titleId,
|
|
681
|
+
className
|
|
682
|
+
}) {
|
|
683
|
+
const reactId = React.useId();
|
|
684
|
+
const Heading = level === 2 ? "h2" : level === 4 ? "h4" : "h3";
|
|
685
|
+
if (variant === "spotlight") {
|
|
686
|
+
return intoElement(
|
|
687
|
+
link,
|
|
688
|
+
cn("ui-editorial-card", className),
|
|
689
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
690
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-editorial-card-copy", children: [
|
|
691
|
+
overline != null && /* @__PURE__ */ jsx("span", { className: "ui-editorial-card-overline", children: overline }),
|
|
692
|
+
/* @__PURE__ */ jsx(Heading, { className: "ui-editorial-card-title", children: title }),
|
|
693
|
+
description != null && /* @__PURE__ */ jsxs("p", { className: "ui-editorial-card-description", children: [
|
|
694
|
+
description,
|
|
695
|
+
/* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": true, className: "ui-editorial-card-description-icon" })
|
|
696
|
+
] })
|
|
697
|
+
] }),
|
|
698
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "ui-editorial-card-media", children: media })
|
|
699
|
+
] }),
|
|
700
|
+
{ "data-slot": "editorial-card", "data-variant": "spotlight" }
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
const headingId = titleId ?? `editorial-card-${reactId}`;
|
|
704
|
+
return /* @__PURE__ */ jsx(
|
|
705
|
+
"article",
|
|
706
|
+
{
|
|
707
|
+
"data-slot": "editorial-card",
|
|
708
|
+
"data-variant": "journal",
|
|
709
|
+
className: cn("ui-editorial-card", className),
|
|
710
|
+
children: intoElement(
|
|
711
|
+
link,
|
|
712
|
+
"ui-editorial-card-link ui-focus-ring",
|
|
713
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
714
|
+
media != null && /* @__PURE__ */ jsx("div", { className: "ui-editorial-card-media", children: media }),
|
|
715
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-editorial-card-copy", children: [
|
|
716
|
+
overline != null && /* @__PURE__ */ jsx("span", { className: "ui-editorial-card-overline", children: overline }),
|
|
717
|
+
/* @__PURE__ */ jsx(Heading, { id: headingId, className: "ui-editorial-card-title", children: title }),
|
|
718
|
+
description != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-card-description", children: description }),
|
|
719
|
+
/* @__PURE__ */ jsxs("span", { className: "ui-editorial-card-footer", children: [
|
|
720
|
+
/* @__PURE__ */ jsx("span", { children: action }),
|
|
721
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ui-editorial-card-arrow", children: /* @__PURE__ */ jsx(ArrowRight, { className: "ui-editorial-card-arrow-icon" }) })
|
|
722
|
+
] })
|
|
723
|
+
] })
|
|
724
|
+
] }),
|
|
725
|
+
{ "aria-labelledby": headingId }
|
|
726
|
+
)
|
|
727
|
+
}
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
function EditorialMasthead({
|
|
731
|
+
brand,
|
|
732
|
+
nav,
|
|
733
|
+
navLabel,
|
|
734
|
+
actions,
|
|
735
|
+
menu,
|
|
736
|
+
className
|
|
737
|
+
}) {
|
|
738
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "editorial-masthead", className: cn("ui-editorial-masthead", className), children: [
|
|
739
|
+
/* @__PURE__ */ jsx("div", { className: "ui-editorial-masthead-brand", children: brand }),
|
|
740
|
+
nav != null && /* @__PURE__ */ jsx(
|
|
741
|
+
"nav",
|
|
742
|
+
{
|
|
743
|
+
"aria-label": navLabel,
|
|
744
|
+
"data-slot": "editorial-masthead-nav",
|
|
745
|
+
className: "ui-editorial-masthead-nav",
|
|
746
|
+
children: nav
|
|
747
|
+
}
|
|
748
|
+
),
|
|
749
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "editorial-masthead-actions", className: "ui-editorial-masthead-actions", children: [
|
|
750
|
+
actions,
|
|
751
|
+
menu != null && /* @__PURE__ */ jsx("span", { className: "ui-editorial-masthead-menu", children: menu })
|
|
752
|
+
] })
|
|
753
|
+
] });
|
|
754
|
+
}
|
|
755
|
+
function EditorialMastheadLink({
|
|
756
|
+
children,
|
|
757
|
+
asChild,
|
|
758
|
+
className,
|
|
759
|
+
...rest
|
|
760
|
+
}) {
|
|
761
|
+
if (asChild && React.isValidElement(children)) {
|
|
762
|
+
const child = children;
|
|
763
|
+
return intoElement(
|
|
764
|
+
child,
|
|
765
|
+
cn("ui-editorial-masthead-link ui-focus-ring", className),
|
|
766
|
+
child.props.children,
|
|
767
|
+
{ ...rest, "data-slot": "editorial-masthead-link" }
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
return /* @__PURE__ */ jsx(
|
|
771
|
+
"a",
|
|
772
|
+
{
|
|
773
|
+
...rest,
|
|
774
|
+
"data-slot": "editorial-masthead-link",
|
|
775
|
+
className: cn("ui-editorial-masthead-link ui-focus-ring", className),
|
|
776
|
+
children
|
|
777
|
+
}
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
const EditorialMastheadAction = React.forwardRef(function EditorialMastheadAction2({ children, asChild, variant = "ghost", collapse = false, className, type, ...rest }, ref) {
|
|
781
|
+
const shared = {
|
|
782
|
+
"data-slot": "editorial-masthead-action",
|
|
783
|
+
"data-variant": variant,
|
|
784
|
+
"data-collapse": collapse ? "" : void 0,
|
|
785
|
+
className: cn("ui-editorial-masthead-action ui-focus-ring", className)
|
|
786
|
+
};
|
|
787
|
+
if (asChild) {
|
|
788
|
+
return /* @__PURE__ */ jsx(Slot, { ...rest, ...shared, ref, children });
|
|
789
|
+
}
|
|
790
|
+
return /* @__PURE__ */ jsx("button", { ...rest, ...shared, ref, type: type ?? "button", children });
|
|
791
|
+
});
|
|
792
|
+
function EditorialFooter({
|
|
793
|
+
brand,
|
|
794
|
+
tagline,
|
|
795
|
+
groups,
|
|
796
|
+
level = 2,
|
|
797
|
+
legal,
|
|
798
|
+
note,
|
|
799
|
+
className
|
|
800
|
+
}) {
|
|
801
|
+
const Heading = level === 3 ? "h3" : "h2";
|
|
802
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "editorial-footer", className: cn("ui-editorial-footer", className), children: [
|
|
803
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "editorial-footer-top", className: "ui-editorial-footer-top", children: [
|
|
804
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "editorial-footer-brand", className: "ui-editorial-footer-brand", children: [
|
|
805
|
+
brand,
|
|
806
|
+
tagline != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-footer-tagline", children: tagline })
|
|
807
|
+
] }),
|
|
808
|
+
groups.map((group, index) => /* @__PURE__ */ jsxs("div", { "data-slot": "editorial-footer-group", className: "ui-editorial-footer-group", children: [
|
|
809
|
+
/* @__PURE__ */ jsx(Heading, { className: "ui-editorial-footer-heading", children: group.title }),
|
|
810
|
+
group.links.map((link, linkIndex) => /* @__PURE__ */ jsx(React.Fragment, { children: link }, linkIndex))
|
|
811
|
+
] }, index))
|
|
812
|
+
] }),
|
|
813
|
+
(legal != null || note != null) && /* @__PURE__ */ jsxs("div", { "data-slot": "editorial-footer-bottom", className: "ui-editorial-footer-bottom", children: [
|
|
814
|
+
legal != null && /* @__PURE__ */ jsx("span", { children: legal }),
|
|
815
|
+
note != null && /* @__PURE__ */ jsx("p", { className: "ui-editorial-footer-note", children: note })
|
|
816
|
+
] })
|
|
817
|
+
] });
|
|
818
|
+
}
|
|
819
|
+
function EditorialFilterBar({
|
|
820
|
+
options,
|
|
821
|
+
value,
|
|
822
|
+
onValueChange,
|
|
823
|
+
extra,
|
|
824
|
+
className,
|
|
825
|
+
...rest
|
|
826
|
+
}) {
|
|
827
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "editorial-filter-bar", className: cn("ui-editorial-filter-bar", className), children: [
|
|
828
|
+
/* @__PURE__ */ jsx("div", { role: "group", "aria-label": rest["aria-label"], className: "ui-editorial-filter-bar-group", children: options.map((option) => /* @__PURE__ */ jsx(
|
|
829
|
+
"button",
|
|
830
|
+
{
|
|
831
|
+
type: "button",
|
|
832
|
+
"aria-pressed": option.value === value,
|
|
833
|
+
className: "ui-editorial-filter-bar-option ui-focus-ring",
|
|
834
|
+
onClick: () => onValueChange(option.value),
|
|
835
|
+
children: option.label
|
|
836
|
+
},
|
|
837
|
+
option.value
|
|
838
|
+
)) }),
|
|
839
|
+
extra != null && /* @__PURE__ */ jsx("span", { className: "ui-editorial-filter-bar-extra", children: extra })
|
|
840
|
+
] });
|
|
841
|
+
}
|
|
842
|
+
export {
|
|
843
|
+
CardShowcase,
|
|
844
|
+
CatalogCard,
|
|
845
|
+
CatalogCardTag,
|
|
846
|
+
EditorialArticle,
|
|
847
|
+
EditorialArticleSection,
|
|
848
|
+
EditorialBanner,
|
|
849
|
+
EditorialBreadcrumb,
|
|
850
|
+
EditorialCard,
|
|
851
|
+
EditorialFilterBar,
|
|
852
|
+
EditorialFooter,
|
|
853
|
+
EditorialHero,
|
|
854
|
+
EditorialMasthead,
|
|
855
|
+
EditorialMastheadAction,
|
|
856
|
+
EditorialMastheadLink,
|
|
857
|
+
EditorialNote,
|
|
858
|
+
EditorialPageHeader,
|
|
859
|
+
EditorialPanel,
|
|
860
|
+
EditorialPillNav,
|
|
861
|
+
EditorialPillNavItem,
|
|
862
|
+
EditorialSearch,
|
|
863
|
+
EditorialSection,
|
|
864
|
+
EditorialSectionHead,
|
|
865
|
+
EditorialTextLink,
|
|
866
|
+
Eyebrow
|
|
867
|
+
};
|