@xenide-io/the-old-ui-theme 0.2.6 → 0.3.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 +1 -1
- package/dist/chunk-FDMD3IIN.mjs +3831 -0
- package/dist/index-D1RTT2Ap.d.mts +1044 -0
- package/dist/index-D1RTT2Ap.d.ts +1044 -0
- package/dist/index.d.mts +11 -758
- package/dist/index.d.ts +11 -758
- package/dist/index.js +1749 -768
- package/dist/index.mjs +312 -2846
- package/dist/tailwind-preset.js +7 -0
- package/dist/tailwind-preset.mjs +7 -0
- package/dist/ui.d.mts +4 -0
- package/dist/ui.d.ts +4 -0
- package/dist/ui.js +3864 -0
- package/dist/ui.mjs +169 -0
- package/package.json +28 -6
- package/src/app/globals.css +1005 -227
- package/src/components/charts/index.ts +8 -0
- package/src/components/charts/ph-insight-charts.tsx +162 -0
- package/src/components/dashboard/DashboardFiltersBar.tsx +19 -0
- package/src/components/dashboard/DashboardGrid.tsx +23 -0
- package/src/components/dashboard/DashboardInsightPlaceholder.tsx +37 -0
- package/src/components/dashboard/DashboardKpiCard.tsx +25 -0
- package/src/components/dashboard/DashboardToolbar.tsx +23 -0
- package/src/components/dashboard/DashboardWell.tsx +10 -0
- package/src/components/dashboard/InsightMiniCard.tsx +26 -0
- package/src/components/dashboard/InsightShell.tsx +37 -0
- package/src/components/dashboard/InsightShellHeader.tsx +22 -0
- package/src/components/dashboard/MiniTrendBars.tsx +51 -0
- package/src/components/dashboard/index.ts +31 -0
- package/src/components/dashboard/types.ts +9 -0
- package/src/components/icons/IconBase.tsx +47 -0
- package/src/components/icons/createIconBase.tsx +32 -0
- package/src/components/icons/icons.tsx +557 -0
- package/src/components/icons/index.ts +3 -0
- package/src/components/sections/AccordionShowcase.tsx +45 -0
- package/src/components/sections/AlertShowcase.tsx +40 -0
- package/src/components/sections/AvatarShowcase.tsx +80 -0
- package/src/components/sections/BadgeShowcase.tsx +65 -0
- package/src/components/sections/ButtonShowcase.tsx +308 -0
- package/src/components/sections/CalendarShowcase.tsx +35 -0
- package/src/components/sections/CardShowcase.tsx +159 -0
- package/src/components/sections/ChartShowcase.tsx +190 -0
- package/src/components/sections/CodeMockupShowcase.tsx +56 -0
- package/src/components/sections/ColorPalette.tsx +117 -0
- package/src/components/sections/CommandPaletteShowcase.tsx +48 -0
- package/src/components/sections/CountdownShowcase.tsx +43 -0
- package/src/components/sections/DashboardShowcase.tsx +191 -0
- package/src/components/sections/DiffShowcase.tsx +70 -0
- package/src/components/sections/DrawerShowcase.tsx +97 -0
- package/src/components/sections/DropdownShowcase.tsx +98 -0
- package/src/components/sections/EmptyStateShowcase.tsx +50 -0
- package/src/components/sections/FilterChipsShowcase.tsx +98 -0
- package/src/components/sections/FormShowcase.tsx +127 -0
- package/src/components/sections/HoverCardShowcase.tsx +50 -0
- package/src/components/sections/IconShowcase.tsx +127 -0
- package/src/components/sections/IndicatorShowcase.tsx +52 -0
- package/src/components/sections/KbdShowcase.tsx +57 -0
- package/src/components/sections/ModalShowcase.tsx +211 -0
- package/src/components/sections/NavigationShowcase.tsx +199 -0
- package/src/components/sections/ProductLayoutsShowcase.tsx +138 -0
- package/src/components/sections/ProgressShowcase.tsx +82 -0
- package/src/components/sections/SegmentedControlShowcase.tsx +49 -0
- package/src/components/sections/SetupThemeShowcase.tsx +262 -0
- package/src/components/sections/StackShowcase.tsx +33 -0
- package/src/components/sections/StatShowcase.tsx +129 -0
- package/src/components/sections/StepperShowcase.tsx +37 -0
- package/src/components/sections/SwapShowcase.tsx +99 -0
- package/src/components/sections/TabShowcase.tsx +84 -0
- package/src/components/sections/TableShowcase.tsx +140 -0
- package/src/components/sections/TimelineShowcase.tsx +83 -0
- package/src/components/sections/ToastShowcase.tsx +108 -0
- package/src/components/sections/TooltipShowcase.tsx +44 -0
- package/src/components/sections/UtilityShowcase.tsx +81 -0
- package/src/components/ui/Accordion.tsx +77 -0
- package/src/components/ui/Alert.tsx +77 -0
- package/src/components/ui/AuthLayout.tsx +58 -0
- package/src/components/ui/Avatar.tsx +97 -0
- package/src/components/ui/Badge.tsx +60 -0
- package/src/components/ui/Button.tsx +120 -0
- package/src/components/ui/ButtonChrome.tsx +20 -0
- package/src/components/ui/Calendar.tsx +115 -0
- package/src/components/ui/Card.tsx +70 -0
- package/src/components/ui/ChatBubble.tsx +71 -0
- package/src/components/ui/CodeBlock.tsx +48 -0
- package/src/components/ui/CollapsibleSection.tsx +49 -0
- package/src/components/ui/CommandPalette.tsx +137 -0
- package/src/components/ui/ComponentDocs.tsx +52 -0
- package/src/components/ui/Drawer.tsx +71 -0
- package/src/components/ui/DropdownMenu.tsx +262 -0
- package/src/components/ui/EmptyState.tsx +33 -0
- package/src/components/ui/FilterBar.tsx +165 -0
- package/src/components/ui/FilterChips.tsx +80 -0
- package/src/components/ui/FilterControls.tsx +30 -0
- package/src/components/ui/FormField.tsx +69 -0
- package/src/components/ui/HoverCard.tsx +36 -0
- package/src/components/ui/Indicator.tsx +61 -0
- package/src/components/ui/Input.tsx +385 -0
- package/src/components/ui/Kbd.tsx +113 -0
- package/src/components/ui/Loader.tsx +96 -0
- package/src/components/ui/Modal.tsx +105 -0
- package/src/components/ui/Navigation.tsx +94 -0
- package/src/components/ui/Panel.tsx +18 -0
- package/src/components/ui/Progress.tsx +59 -0
- package/src/components/ui/Rating.tsx +65 -0
- package/src/components/ui/SearchInput.tsx +106 -0
- package/src/components/ui/SegmentedControl.tsx +44 -0
- package/src/components/ui/SettingsLayout.tsx +94 -0
- package/src/components/ui/ShowcaseWrapper.tsx +124 -0
- package/src/components/ui/Stat.tsx +39 -0
- package/src/components/ui/Stepper.tsx +74 -0
- package/src/components/ui/Table.tsx +55 -0
- package/src/components/ui/Tabs.tsx +53 -0
- package/src/components/ui/Terminal.tsx +54 -0
- package/src/components/ui/ThemeDomSync.tsx +17 -0
- package/src/components/ui/ThemeManager.tsx +18 -0
- package/src/components/ui/ThemeSwitcher.tsx +46 -0
- package/src/components/ui/Timeline.tsx +60 -0
- package/src/components/ui/Toast.tsx +70 -0
- package/src/components/ui/Typography.tsx +129 -0
- package/src/components/ui/first-slice.test.tsx +98 -0
- package/src/components/ui/index.ts +151 -0
- package/src/components/ui/interaction-primitives.test.tsx +77 -0
- package/src/components/ui/kbd-icons.test.tsx +90 -0
- package/src/components/ui/product-patterns.test.tsx +77 -0
- package/src/styles/themes.css +528 -0
- package/tailwind-preset.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
11
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
12
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -44,6 +46,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
44
46
|
}
|
|
45
47
|
return to;
|
|
46
48
|
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
47
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
58
|
|
|
49
59
|
// src/index.ts
|
|
@@ -51,12 +61,16 @@ var src_exports = {};
|
|
|
51
61
|
__export(src_exports, {
|
|
52
62
|
Accordion: () => Accordion,
|
|
53
63
|
Alert: () => Alert,
|
|
64
|
+
AuthCard: () => AuthCard,
|
|
65
|
+
AuthDivider: () => AuthDivider,
|
|
66
|
+
AuthLayout: () => AuthLayout,
|
|
54
67
|
Avatar: () => Avatar,
|
|
55
68
|
AvatarGroup: () => AvatarGroup,
|
|
56
69
|
Badge: () => Badge,
|
|
57
70
|
Breadcrumbs: () => Breadcrumbs,
|
|
58
71
|
Button: () => Button,
|
|
59
72
|
ButtonChrome: () => ButtonChrome,
|
|
73
|
+
CANONICAL_ICONS: () => CANONICAL_ICONS,
|
|
60
74
|
Calendar: () => Calendar,
|
|
61
75
|
Caption: () => Caption,
|
|
62
76
|
Card: () => Card,
|
|
@@ -78,9 +92,15 @@ __export(src_exports, {
|
|
|
78
92
|
DropdownButton: () => DropdownButton,
|
|
79
93
|
DropdownItem: () => DropdownItem,
|
|
80
94
|
DropdownMenu: () => DropdownMenu,
|
|
95
|
+
DropdownRadioGroup: () => DropdownRadioGroup,
|
|
96
|
+
DropdownRadioItem: () => DropdownRadioItem,
|
|
81
97
|
EmptyState: () => EmptyState,
|
|
82
98
|
FileUpload: () => FileUpload,
|
|
99
|
+
FilterBar: () => FilterBar,
|
|
83
100
|
FilterChips: () => FilterChips,
|
|
101
|
+
FilterControls: () => FilterControls,
|
|
102
|
+
FilterMenu: () => FilterMenu,
|
|
103
|
+
FormField: () => FormField,
|
|
84
104
|
H1: () => H1,
|
|
85
105
|
H2: () => H2,
|
|
86
106
|
H3: () => H3,
|
|
@@ -107,14 +127,20 @@ __export(src_exports, {
|
|
|
107
127
|
IconChevronRight: () => IconChevronRight,
|
|
108
128
|
IconClipboardEdit: () => IconClipboardEdit,
|
|
109
129
|
IconClose: () => IconClose,
|
|
130
|
+
IconCodePreview: () => IconCodePreview,
|
|
110
131
|
IconCohort: () => IconCohort,
|
|
132
|
+
IconCommandCursor: () => IconCommandCursor,
|
|
111
133
|
IconCopy: () => IconCopy,
|
|
112
134
|
IconCumulativeChart: () => IconCumulativeChart,
|
|
135
|
+
IconDataReel: () => IconDataReel,
|
|
113
136
|
IconDatabase: () => IconDatabase,
|
|
114
137
|
IconDownload: () => IconDownload,
|
|
115
138
|
IconEdit: () => IconEdit,
|
|
116
139
|
IconErrorOutline: () => IconErrorOutline,
|
|
140
|
+
IconEventStream: () => IconEventStream,
|
|
117
141
|
IconExclamation: () => IconExclamation,
|
|
142
|
+
IconExperimentSplit: () => IconExperimentSplit,
|
|
143
|
+
IconFeatureGate: () => IconFeatureGate,
|
|
118
144
|
IconFlag: () => IconFlag,
|
|
119
145
|
IconFlare: () => IconFlare,
|
|
120
146
|
IconFlask: () => IconFlask,
|
|
@@ -122,19 +148,24 @@ __export(src_exports, {
|
|
|
122
148
|
IconGridView: () => IconGridView,
|
|
123
149
|
IconHandClick: () => IconHandClick,
|
|
124
150
|
IconHome: () => IconHome,
|
|
151
|
+
IconInfo: () => IconInfo,
|
|
152
|
+
IconInsightBoard: () => IconInsightBoard,
|
|
125
153
|
IconLayers: () => IconLayers,
|
|
126
154
|
IconListView: () => IconListView,
|
|
127
155
|
IconLogout: () => IconLogout,
|
|
128
156
|
IconMail: () => IconMail,
|
|
129
157
|
IconMoon: () => IconMoon,
|
|
158
|
+
IconOldWindow: () => IconOldWindow,
|
|
130
159
|
IconPanelRight: () => IconPanelRight,
|
|
131
160
|
IconPerson: () => IconPerson,
|
|
132
161
|
IconPlayCircle: () => IconPlayCircle,
|
|
133
162
|
IconPlus: () => IconPlus,
|
|
134
163
|
IconPremium: () => IconPremium,
|
|
135
164
|
IconQueryEditor: () => IconQueryEditor,
|
|
165
|
+
IconQueryStack: () => IconQueryStack,
|
|
136
166
|
IconRadar: () => IconRadar,
|
|
137
167
|
IconRecording: () => IconRecording,
|
|
168
|
+
IconReplayFrame: () => IconReplayFrame,
|
|
138
169
|
IconRobot: () => IconRobot,
|
|
139
170
|
IconRocket: () => IconRocket,
|
|
140
171
|
IconSave: () => IconSave,
|
|
@@ -145,6 +176,7 @@ __export(src_exports, {
|
|
|
145
176
|
IconStar: () => IconStar,
|
|
146
177
|
IconSubArrowRight: () => IconSubArrowRight,
|
|
147
178
|
IconSun: () => IconSun,
|
|
179
|
+
IconSurveyCard: () => IconSurveyCard,
|
|
148
180
|
IconSurveys: () => IconSurveys,
|
|
149
181
|
IconSync: () => IconSync,
|
|
150
182
|
IconTableChart: () => IconTableChart,
|
|
@@ -168,12 +200,16 @@ __export(src_exports, {
|
|
|
168
200
|
Kbd: () => Kbd,
|
|
169
201
|
Label: () => Label,
|
|
170
202
|
Lead: () => Lead,
|
|
203
|
+
Loader: () => Loader,
|
|
204
|
+
LoadingState: () => LoadingState,
|
|
171
205
|
MiniTrendBars: () => MiniTrendBars,
|
|
172
206
|
Modal: () => Modal,
|
|
173
207
|
Mono: () => Mono,
|
|
208
|
+
OLD_UI_ICONS: () => OLD_UI_ICONS,
|
|
174
209
|
Overline: () => Overline,
|
|
175
210
|
P: () => P,
|
|
176
211
|
PH_ICONS: () => PH_ICONS,
|
|
212
|
+
PH_ICON_ALIASES: () => PH_ICON_ALIASES,
|
|
177
213
|
Pagination: () => Pagination,
|
|
178
214
|
Panel: () => Panel,
|
|
179
215
|
Progress: () => Progress,
|
|
@@ -184,8 +220,12 @@ __export(src_exports, {
|
|
|
184
220
|
SearchInput: () => SearchInput,
|
|
185
221
|
SegmentedControl: () => SegmentedControl,
|
|
186
222
|
Select: () => Select,
|
|
223
|
+
SettingsLayout: () => SettingsLayout,
|
|
224
|
+
SettingsNav: () => SettingsNav,
|
|
187
225
|
ShowcaseWrapper: () => ShowcaseWrapper,
|
|
226
|
+
Skeleton: () => Skeleton,
|
|
188
227
|
Small: () => Small,
|
|
228
|
+
SortMenu: () => SortMenu,
|
|
189
229
|
Stat: () => Stat,
|
|
190
230
|
Stepper: () => Stepper,
|
|
191
231
|
THEMES: () => THEMES,
|
|
@@ -211,6 +251,9 @@ __export(src_exports, {
|
|
|
211
251
|
});
|
|
212
252
|
module.exports = __toCommonJS(src_exports);
|
|
213
253
|
|
|
254
|
+
// src/components/ui/Button.tsx
|
|
255
|
+
var import_react = require("react");
|
|
256
|
+
|
|
214
257
|
// src/components/ui/ButtonChrome.tsx
|
|
215
258
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
216
259
|
function ButtonChrome({ label, icon, sideIcon, split }) {
|
|
@@ -255,7 +298,7 @@ var shapeClass = {
|
|
|
255
298
|
square: "ph-btn-square",
|
|
256
299
|
wide: "ph-btn-wide"
|
|
257
300
|
};
|
|
258
|
-
|
|
301
|
+
var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
259
302
|
var _b = _a, {
|
|
260
303
|
variant = "secondary",
|
|
261
304
|
size = "md",
|
|
@@ -264,9 +307,12 @@ function Button(_a) {
|
|
|
264
307
|
split = false,
|
|
265
308
|
icon,
|
|
266
309
|
sideIcon,
|
|
310
|
+
loading = false,
|
|
311
|
+
loadingLabel,
|
|
267
312
|
className,
|
|
268
313
|
children,
|
|
269
|
-
type = "button"
|
|
314
|
+
type = "button",
|
|
315
|
+
disabled
|
|
270
316
|
} = _b, props = __objRest(_b, [
|
|
271
317
|
"variant",
|
|
272
318
|
"size",
|
|
@@ -275,23 +321,32 @@ function Button(_a) {
|
|
|
275
321
|
"split",
|
|
276
322
|
"icon",
|
|
277
323
|
"sideIcon",
|
|
324
|
+
"loading",
|
|
325
|
+
"loadingLabel",
|
|
278
326
|
"className",
|
|
279
327
|
"children",
|
|
280
|
-
"type"
|
|
328
|
+
"type",
|
|
329
|
+
"disabled"
|
|
281
330
|
]);
|
|
282
|
-
const usesLemonChrome =
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
331
|
+
const usesLemonChrome = !["tertiary", "ghost", "link"].includes(variant);
|
|
332
|
+
const label = loadingLabel != null ? loadingLabel : children;
|
|
333
|
+
const leadingIcon = loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-spinner", "aria-hidden": true }) : icon;
|
|
334
|
+
const content = usesLemonChrome ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ButtonChrome, { label, icon: leadingIcon, sideIcon, split }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
335
|
+
leadingIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-icon", children: leadingIcon }) : null,
|
|
336
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-label", children: label }) : null,
|
|
286
337
|
split ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-split-divider", "aria-hidden": true }) : null,
|
|
287
338
|
sideIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-side-icon", children: sideIcon }) : null
|
|
288
339
|
] });
|
|
289
340
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
290
341
|
"button",
|
|
291
342
|
__spreadProps(__spreadValues({
|
|
343
|
+
ref,
|
|
292
344
|
type,
|
|
345
|
+
disabled: disabled || loading,
|
|
346
|
+
"aria-busy": loading || void 0,
|
|
293
347
|
className: cn(
|
|
294
348
|
"ph-btn",
|
|
349
|
+
usesLemonChrome && "ph-btn-raised",
|
|
295
350
|
outline && "ph-btn-outline",
|
|
296
351
|
variantClass[variant],
|
|
297
352
|
sizeClass[size],
|
|
@@ -303,11 +358,16 @@ function Button(_a) {
|
|
|
303
358
|
children: content
|
|
304
359
|
})
|
|
305
360
|
);
|
|
306
|
-
}
|
|
361
|
+
});
|
|
362
|
+
Button.displayName = "Button";
|
|
363
|
+
|
|
364
|
+
// src/components/ui/Alert.tsx
|
|
365
|
+
var import_react5 = require("react");
|
|
307
366
|
|
|
308
367
|
// src/components/icons/IconBase.tsx
|
|
368
|
+
var import_react2 = require("react");
|
|
309
369
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
310
|
-
|
|
370
|
+
var IconBase = (0, import_react2.forwardRef)(function IconBase2(_a, ref) {
|
|
311
371
|
var _b = _a, {
|
|
312
372
|
className,
|
|
313
373
|
size,
|
|
@@ -315,7 +375,12 @@ function IconBase(_a) {
|
|
|
315
375
|
viewBox = "0 0 24 24",
|
|
316
376
|
fill: fill2 = "none",
|
|
317
377
|
xmlns = "http://www.w3.org/2000/svg",
|
|
318
|
-
focusable = "false"
|
|
378
|
+
focusable = "false",
|
|
379
|
+
style,
|
|
380
|
+
role,
|
|
381
|
+
"aria-hidden": ariaHidden,
|
|
382
|
+
"aria-label": ariaLabel,
|
|
383
|
+
"aria-labelledby": ariaLabelledBy
|
|
319
384
|
} = _b, props = __objRest(_b, [
|
|
320
385
|
"className",
|
|
321
386
|
"size",
|
|
@@ -323,41 +388,55 @@ function IconBase(_a) {
|
|
|
323
388
|
"viewBox",
|
|
324
389
|
"fill",
|
|
325
390
|
"xmlns",
|
|
326
|
-
"focusable"
|
|
391
|
+
"focusable",
|
|
392
|
+
"style",
|
|
393
|
+
"role",
|
|
394
|
+
"aria-hidden",
|
|
395
|
+
"aria-label",
|
|
396
|
+
"aria-labelledby"
|
|
327
397
|
]);
|
|
328
|
-
|
|
329
|
-
const dimensionProps = size != null ? { width: size, height: size } : {};
|
|
398
|
+
const hasAccessibleName = Boolean(ariaLabel || ariaLabelledBy);
|
|
330
399
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
331
400
|
"svg",
|
|
332
|
-
__spreadProps(__spreadValues(
|
|
333
|
-
|
|
334
|
-
|
|
401
|
+
__spreadProps(__spreadValues({
|
|
402
|
+
ref,
|
|
403
|
+
className: cn("ph-icon", className),
|
|
335
404
|
viewBox,
|
|
336
405
|
fill: fill2,
|
|
337
406
|
xmlns,
|
|
338
407
|
focusable,
|
|
339
|
-
|
|
340
|
-
|
|
408
|
+
role: role != null ? role : hasAccessibleName ? "img" : void 0,
|
|
409
|
+
"aria-hidden": ariaHidden != null ? ariaHidden : hasAccessibleName ? void 0 : true,
|
|
410
|
+
"aria-label": ariaLabel,
|
|
411
|
+
"aria-labelledby": ariaLabelledBy,
|
|
412
|
+
style: __spreadValues({ width: size, height: size }, style)
|
|
413
|
+
}, props), {
|
|
341
414
|
children
|
|
342
415
|
})
|
|
343
416
|
);
|
|
344
|
-
}
|
|
417
|
+
});
|
|
418
|
+
IconBase.displayName = "IconBase";
|
|
345
419
|
|
|
346
420
|
// src/components/icons/createIconBase.tsx
|
|
421
|
+
var import_react3 = require("react");
|
|
347
422
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
348
|
-
function createIconBase({ viewBox = "0 0 24 24", paths }) {
|
|
349
|
-
|
|
350
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconBase, __spreadProps(__spreadValues({ viewBox }, props), { children: paths }));
|
|
351
|
-
};
|
|
423
|
+
function createIconBase({ name = "IconGlyph", viewBox = "0 0 24 24", paths }) {
|
|
424
|
+
const IconGlyph = (0, import_react3.forwardRef)(function IconGlyph2(props, ref) {
|
|
425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconBase, __spreadProps(__spreadValues({ ref, viewBox }, props), { children: paths }));
|
|
426
|
+
});
|
|
427
|
+
IconGlyph.displayName = name;
|
|
428
|
+
return IconGlyph;
|
|
352
429
|
}
|
|
353
|
-
function createIconBasePath(d, viewBox = "0 0 24 24") {
|
|
430
|
+
function createIconBasePath(d, viewBox = "0 0 24 24", name) {
|
|
354
431
|
return createIconBase({
|
|
432
|
+
name,
|
|
355
433
|
viewBox,
|
|
356
434
|
paths: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d, fill: "currentColor" })
|
|
357
435
|
});
|
|
358
436
|
}
|
|
359
437
|
|
|
360
438
|
// src/components/icons/icons.tsx
|
|
439
|
+
var import_react4 = require("react");
|
|
361
440
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
362
441
|
var fill = (d) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d, fill: "currentColor" });
|
|
363
442
|
var IconAreaChart = createIconBase({
|
|
@@ -466,6 +545,12 @@ var IconErrorOutline = createIconBase({
|
|
|
466
545
|
"m11 15h2v2h-2zm0-8h2v6h-2zm.99-5c-5.52 0-9.99 4.48-9.99 10s4.47 10 9.99 10c5.53 0 10.01-4.48 10.01-10s-4.48-10-10.01-10zm.01 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
467
546
|
)
|
|
468
547
|
});
|
|
548
|
+
var IconInfo = createIconBase({
|
|
549
|
+
name: "IconInfo",
|
|
550
|
+
paths: fill(
|
|
551
|
+
"M11 10h2v7h-2v-7zm0-3h2v2h-2V7zm1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
552
|
+
)
|
|
553
|
+
});
|
|
469
554
|
var IconCancel = createIconBase({
|
|
470
555
|
paths: fill(
|
|
471
556
|
"m12 2c-5.53 0-10 4.47-10 10s4.47 10 10 10 10-4.47 10-10-4.47-10-10-10zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13-3.59 3.59-3.59-3.59-1.41 1.41 3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59z"
|
|
@@ -563,18 +648,158 @@ var IconToggle = createIconBasePath(
|
|
|
563
648
|
var IconRocket = createIconBasePath(
|
|
564
649
|
"M9.19 6.35c-2.04 2.29-3.44 5.58-3.57 5.89L2 10.69l4.05-4.05c.47-.47 1.15-.68 1.81-.55l1.33 1.26zm5.45 8.67l-1.33-1.26c-.66-.13-1.34.08-1.81.55L2 18.31l3.62 3.57c.31-.13 3.6-1.53 5.89-3.57 1.53-1.72 2.52-3.76 2.87-5.02zM12 2c-1.1 0-2 .9-2 2v1.09c2.84.48 5 2.94 5 5.91 0 2.97-2.16 5.43-5 5.91V20c0 1.1.9 2 2 2s2-.9 2-2v-1.09c-2.84-.48-5-2.94-5-5.91 0-2.97 2.16-5.43 5-5.91V4c0-1.1-.9-2-2-2z"
|
|
565
650
|
);
|
|
566
|
-
var IconTerminal =
|
|
651
|
+
var IconTerminal = createIconBase({
|
|
652
|
+
name: "IconTerminal",
|
|
653
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
654
|
+
"path",
|
|
655
|
+
{
|
|
656
|
+
d: "M3 4v16h18V4H3zm2 2h14v12H5V6zm2 2.2L10.8 12 7 15.8 8.4 17.2l5.2-5.2-5.2-5.2L7 8.2zM13 17h5v-2h-5v2z",
|
|
657
|
+
fill: "currentColor",
|
|
658
|
+
fillRule: "evenodd",
|
|
659
|
+
clipRule: "evenodd"
|
|
660
|
+
}
|
|
661
|
+
)
|
|
662
|
+
});
|
|
663
|
+
var IconOldWindow = createIconBase({
|
|
664
|
+
name: "IconOldWindow",
|
|
665
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
666
|
+
"path",
|
|
667
|
+
{
|
|
668
|
+
d: "M3 3v18h18V3H3zm2 7v9h14v-9H5zm1-4h2v1H6V6zm3 0h2v1H9V6z",
|
|
669
|
+
fill: "currentColor",
|
|
670
|
+
fillRule: "evenodd",
|
|
671
|
+
clipRule: "evenodd"
|
|
672
|
+
}
|
|
673
|
+
)
|
|
674
|
+
});
|
|
675
|
+
var IconCommandCursor = createIconBase({
|
|
676
|
+
name: "IconCommandCursor",
|
|
677
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
678
|
+
"path",
|
|
679
|
+
{
|
|
680
|
+
d: "M4 3v18h16V3H4zm2 2h12v14H6V5zm1.5 3.5L11 12l-3.5 3.5L9 17l5-5-5-5-1.5 1.5zM13 17h4v-2h-4v2z",
|
|
681
|
+
fill: "currentColor",
|
|
682
|
+
fillRule: "evenodd",
|
|
683
|
+
clipRule: "evenodd"
|
|
684
|
+
}
|
|
685
|
+
)
|
|
686
|
+
});
|
|
687
|
+
var IconDataReel = createIconBase({
|
|
688
|
+
name: "IconDataReel",
|
|
689
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
690
|
+
"path",
|
|
691
|
+
{
|
|
692
|
+
d: "M3 5v14h18V5H3zm2 2h14v10H5V7zm3 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm8 0a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM10 11h4v1.5h-4V11z",
|
|
693
|
+
fill: "currentColor",
|
|
694
|
+
fillRule: "evenodd",
|
|
695
|
+
clipRule: "evenodd"
|
|
696
|
+
}
|
|
697
|
+
)
|
|
698
|
+
});
|
|
699
|
+
var IconCodePreview = createIconBase({
|
|
700
|
+
name: "IconCodePreview",
|
|
701
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
702
|
+
"path",
|
|
703
|
+
{
|
|
704
|
+
d: "M3 3v15h18V3H3zm2 2h14v11H5V5zm3.5 2L5 10.5 8.5 14l1.4-1.4-2.1-2.1 2.1-2.1L8.5 7zm7 0-1.4 1.4 2.1 2.1-2.1 2.1 1.4 1.4 3.5-3.5L15.5 7zM9 20h6v2H9v-2z",
|
|
705
|
+
fill: "currentColor",
|
|
706
|
+
fillRule: "evenodd",
|
|
707
|
+
clipRule: "evenodd"
|
|
708
|
+
}
|
|
709
|
+
)
|
|
710
|
+
});
|
|
711
|
+
var IconInsightBoard = createIconBase({
|
|
712
|
+
name: "IconInsightBoard",
|
|
713
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
714
|
+
"path",
|
|
715
|
+
{
|
|
716
|
+
d: "M3 3v18h18V3H3zm2 2h14v3H5V5zm0 5h6v9H5v-9zm8 0h6v4h-6v-4zm0 6h6v3h-6v-3zM6 6h2v1H6V6zm3 0h2v1H9V6z",
|
|
717
|
+
fill: "currentColor",
|
|
718
|
+
fillRule: "evenodd",
|
|
719
|
+
clipRule: "evenodd"
|
|
720
|
+
}
|
|
721
|
+
)
|
|
722
|
+
});
|
|
723
|
+
var IconEventStream = createIconBase({
|
|
724
|
+
name: "IconEventStream",
|
|
725
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
726
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M5 4h2v16H5V4z", fill: "currentColor", opacity: "0.45" }),
|
|
727
|
+
fill("M6 3a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm0 8a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm5-6h10v2H11V5zm0 8h7v2h-7v-2zm0 5h10v2H11v-2z")
|
|
728
|
+
] })
|
|
729
|
+
});
|
|
730
|
+
var IconFeatureGate = createIconBase({
|
|
731
|
+
name: "IconFeatureGate",
|
|
732
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
733
|
+
"path",
|
|
734
|
+
{
|
|
735
|
+
d: "M4 3h2v18H4V3zm3 2h12l-3 4 3 4H7V5zm4 1-2.2 4H12l-1 4 4.2-5H12l1-3h-2z",
|
|
736
|
+
fill: "currentColor",
|
|
737
|
+
fillRule: "evenodd",
|
|
738
|
+
clipRule: "evenodd"
|
|
739
|
+
}
|
|
740
|
+
)
|
|
741
|
+
});
|
|
742
|
+
var IconReplayFrame = createIconBase({
|
|
743
|
+
name: "IconReplayFrame",
|
|
744
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
745
|
+
"path",
|
|
746
|
+
{
|
|
747
|
+
d: "M3 3v18h18V3H3zm2 2h14v11H5V5zm5 2v7l6-3.5L10 7zm-5 11h9v1H5v-1zm11 0h3v1h-3v-1z",
|
|
748
|
+
fill: "currentColor",
|
|
749
|
+
fillRule: "evenodd",
|
|
750
|
+
clipRule: "evenodd"
|
|
751
|
+
}
|
|
752
|
+
)
|
|
753
|
+
});
|
|
754
|
+
var IconQueryStack = createIconBase({
|
|
755
|
+
name: "IconQueryStack",
|
|
756
|
+
paths: fill(
|
|
757
|
+
"M4 5c0-1.66 3.58-3 8-3s8 1.34 8 3-3.58 3-8 3-8-1.34-8-3zm0 3v3c0 1.66 3.58 3 8 3 .7 0 1.38-.04 2-.12V11.8c-.64.13-1.31.2-2 .2-4.42 0-8-1.34-8-3zm0 6v3c0 1.66 3.58 3 8 3 .7 0 1.38-.04 2-.12v-2.08c-.64.13-1.31.2-2 .2-4.42 0-8-1.34-8-3zm12-1 5 4-5 4v-3h-4v-2h4v-3z"
|
|
758
|
+
)
|
|
759
|
+
});
|
|
760
|
+
var IconExperimentSplit = createIconBase({
|
|
761
|
+
name: "IconExperimentSplit",
|
|
762
|
+
paths: fill(
|
|
763
|
+
"M5 3a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm14 0a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM5 15a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm1-6h2c0 2.2 1.8 4 4 4h2.17A3 3 0 0 1 19 11v2a3 3 0 0 1-4.83-2H12a6 6 0 0 1-6-6v4zm0 4a6 6 0 0 0 6-6h2a8 8 0 0 1-8 8v-2z"
|
|
764
|
+
)
|
|
765
|
+
});
|
|
766
|
+
var IconSurveyCard = createIconBase({
|
|
767
|
+
name: "IconSurveyCard",
|
|
768
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
769
|
+
"path",
|
|
770
|
+
{
|
|
771
|
+
d: "M3 3v18h18V3H3zm2 2h14v14H5V5zm2 2h7v2H7V7zm0 4h4v2H7v-2zm7-.4-2.5 2.5-1-1-1.4 1.4 2.4 2.4 3.9-3.9-1.4-1.4zM7 16h10v1H7v-1z",
|
|
772
|
+
fill: "currentColor",
|
|
773
|
+
fillRule: "evenodd",
|
|
774
|
+
clipRule: "evenodd"
|
|
775
|
+
}
|
|
776
|
+
)
|
|
777
|
+
});
|
|
778
|
+
var OLD_UI_ICONS = {
|
|
779
|
+
oldWindow: IconOldWindow,
|
|
780
|
+
commandCursor: IconCommandCursor,
|
|
781
|
+
dataReel: IconDataReel,
|
|
782
|
+
codePreview: IconCodePreview,
|
|
783
|
+
insightBoard: IconInsightBoard,
|
|
784
|
+
eventStream: IconEventStream,
|
|
785
|
+
featureGate: IconFeatureGate,
|
|
786
|
+
replayFrame: IconReplayFrame,
|
|
787
|
+
queryStack: IconQueryStack,
|
|
788
|
+
experimentSplit: IconExperimentSplit,
|
|
789
|
+
surveyCard: IconSurveyCard
|
|
790
|
+
};
|
|
567
791
|
var IconActivity = createIconBasePath(
|
|
568
792
|
"M22 12h-4l-3 9L9 3l-3 9H2v2h6.76l2.24-6.72L15 15l2.24-6.72L19 14h3v-2z"
|
|
569
793
|
);
|
|
570
794
|
var IconFlask = createIconBasePath(
|
|
571
795
|
"M19.8 18.4L14 10.67V6.5l1.35-1.35c.39-.39.39-1.02 0-1.41L14.65 2.7a.9959.9959 0 0 0-1.41 0L9.35 6.54c-.39.39-.39 1.02 0 1.41L10.7 9.3v4.17L4.2 18.4C3.53 19.07 4.04 20.25 5 20.25h14c.96 0 1.47-1.18.8-1.85zM6.91 18.25l5.09-5.09 5.09 5.09H6.91z"
|
|
572
796
|
);
|
|
573
|
-
|
|
797
|
+
var IconSpinner = (0, import_react4.forwardRef)(function IconSpinner2(_a, ref) {
|
|
574
798
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconSync, __spreadValues({ className: cn("ph-icon-spin", className) }, props));
|
|
576
|
-
}
|
|
577
|
-
|
|
799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconSync, __spreadValues({ ref, className: cn("ph-icon-spin", className) }, props));
|
|
800
|
+
});
|
|
801
|
+
IconSpinner.displayName = "IconSpinner";
|
|
802
|
+
var CANONICAL_ICONS = {
|
|
578
803
|
activity: IconActivity,
|
|
579
804
|
areaChart: IconAreaChart,
|
|
580
805
|
arrowDown: IconArrowDown,
|
|
@@ -589,74 +814,100 @@ var PH_ICONS = {
|
|
|
589
814
|
chevronDown: IconChevronDown,
|
|
590
815
|
chevronLeft: IconChevronLeft,
|
|
591
816
|
chevronRight: IconChevronRight,
|
|
592
|
-
|
|
817
|
+
clipboardEdit: IconClipboardEdit,
|
|
593
818
|
close: IconClose,
|
|
819
|
+
codePreview: IconCodePreview,
|
|
594
820
|
cohort: IconCohort,
|
|
821
|
+
commandCursor: IconCommandCursor,
|
|
595
822
|
copy: IconCopy,
|
|
596
823
|
cumulativeChart: IconCumulativeChart,
|
|
824
|
+
dataReel: IconDataReel,
|
|
597
825
|
database: IconDatabase,
|
|
598
826
|
download: IconDownload,
|
|
599
827
|
edit: IconEdit,
|
|
600
828
|
errorOutline: IconErrorOutline,
|
|
829
|
+
eventStream: IconEventStream,
|
|
601
830
|
exclamation: IconExclamation,
|
|
831
|
+
experimentSplit: IconExperimentSplit,
|
|
832
|
+
featureGate: IconFeatureGate,
|
|
602
833
|
flag: IconFlag,
|
|
603
834
|
flare: IconFlare,
|
|
604
835
|
flask: IconFlask,
|
|
605
836
|
gift: IconGift,
|
|
606
|
-
|
|
837
|
+
gridView: IconGridView,
|
|
607
838
|
handClick: IconHandClick,
|
|
608
839
|
home: IconHome,
|
|
609
|
-
info:
|
|
840
|
+
info: IconInfo,
|
|
841
|
+
insightBoard: IconInsightBoard,
|
|
610
842
|
layers: IconLayers,
|
|
611
|
-
|
|
843
|
+
listView: IconListView,
|
|
612
844
|
logout: IconLogout,
|
|
613
845
|
mail: IconMail,
|
|
614
846
|
moon: IconMoon,
|
|
847
|
+
oldWindow: IconOldWindow,
|
|
615
848
|
panelRight: IconPanelRight,
|
|
616
849
|
person: IconPerson,
|
|
617
|
-
|
|
850
|
+
playCircle: IconPlayCircle,
|
|
618
851
|
plus: IconPlus,
|
|
619
852
|
premium: IconPremium,
|
|
620
853
|
queryEditor: IconQueryEditor,
|
|
854
|
+
queryStack: IconQueryStack,
|
|
621
855
|
radar: IconRadar,
|
|
622
856
|
recording: IconRecording,
|
|
857
|
+
replayFrame: IconReplayFrame,
|
|
623
858
|
robot: IconRobot,
|
|
624
859
|
rocket: IconRocket,
|
|
625
860
|
save: IconSave,
|
|
626
861
|
search: IconSearch,
|
|
627
862
|
selectEvents: IconSelectEvents,
|
|
628
|
-
settings: IconTuning,
|
|
629
863
|
shoppingCart: IconShoppingCart,
|
|
630
864
|
spinner: IconSpinner,
|
|
631
865
|
star: IconStar,
|
|
632
866
|
subArrowRight: IconSubArrowRight,
|
|
633
867
|
sun: IconSun,
|
|
868
|
+
surveyCard: IconSurveyCard,
|
|
634
869
|
surveys: IconSurveys,
|
|
635
870
|
sync: IconSync,
|
|
636
871
|
tableChart: IconTableChart,
|
|
637
872
|
terminal: IconTerminal,
|
|
638
873
|
toggle: IconToggle,
|
|
639
874
|
trash: IconTrash,
|
|
640
|
-
|
|
875
|
+
tuning: IconTuning,
|
|
641
876
|
upload: IconUpload,
|
|
642
877
|
volume: IconVolume,
|
|
643
|
-
volumeOff: IconVolumeOff
|
|
878
|
+
volumeOff: IconVolumeOff
|
|
879
|
+
};
|
|
880
|
+
var PH_ICON_ALIASES = {
|
|
881
|
+
clipboard: IconClipboardEdit,
|
|
882
|
+
grid: IconGridView,
|
|
883
|
+
list: IconListView,
|
|
884
|
+
play: IconPlayCircle,
|
|
885
|
+
settings: IconTuning,
|
|
886
|
+
trendingUp: IconArrowUp,
|
|
644
887
|
warning: IconExclamation,
|
|
645
888
|
xCircle: IconCancel
|
|
646
889
|
};
|
|
647
|
-
|
|
890
|
+
var PH_ICONS = __spreadValues(__spreadValues({}, CANONICAL_ICONS), PH_ICON_ALIASES);
|
|
891
|
+
for (const [name, Icon] of Object.entries(CANONICAL_ICONS)) {
|
|
892
|
+
const namedIcon = Icon;
|
|
893
|
+
if (!namedIcon.displayName || namedIcon.displayName === "IconGlyph") {
|
|
894
|
+
namedIcon.displayName = `Icon${name[0].toUpperCase()}${name.slice(1)}`;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
var IconByName = (0, import_react4.forwardRef)(function IconByName2(_a, ref) {
|
|
648
898
|
var _b = _a, { name } = _b, props = __objRest(_b, ["name"]);
|
|
649
899
|
const Icon = PH_ICONS[name];
|
|
650
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, __spreadValues({}, props));
|
|
651
|
-
}
|
|
900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, __spreadValues({ ref }, props));
|
|
901
|
+
});
|
|
902
|
+
IconByName.displayName = "IconByName";
|
|
652
903
|
|
|
653
904
|
// src/components/ui/Alert.tsx
|
|
654
905
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
655
906
|
var statusConfig = {
|
|
656
|
-
info: { icon:
|
|
657
|
-
success: { icon: IconCheckCircle
|
|
658
|
-
warning: { icon: IconExclamation
|
|
659
|
-
danger: { icon: IconCancel
|
|
907
|
+
info: { icon: IconInfo },
|
|
908
|
+
success: { icon: IconCheckCircle },
|
|
909
|
+
warning: { icon: IconExclamation },
|
|
910
|
+
danger: { icon: IconCancel }
|
|
660
911
|
};
|
|
661
912
|
var statusClassMap = {
|
|
662
913
|
info: "ph-alert-info",
|
|
@@ -664,25 +915,43 @@ var statusClassMap = {
|
|
|
664
915
|
warning: "ph-alert-warning",
|
|
665
916
|
danger: "ph-alert-danger"
|
|
666
917
|
};
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
918
|
+
var Alert = (0, import_react5.forwardRef)(function Alert2(_a, ref) {
|
|
919
|
+
var _b = _a, {
|
|
920
|
+
status = "info",
|
|
921
|
+
title,
|
|
922
|
+
description,
|
|
923
|
+
icon,
|
|
924
|
+
children,
|
|
925
|
+
className,
|
|
926
|
+
onDismiss,
|
|
927
|
+
live,
|
|
928
|
+
dismissLabel = "Dismiss notification",
|
|
929
|
+
role
|
|
930
|
+
} = _b, props = __objRest(_b, [
|
|
931
|
+
"status",
|
|
932
|
+
"title",
|
|
933
|
+
"description",
|
|
934
|
+
"icon",
|
|
935
|
+
"children",
|
|
936
|
+
"className",
|
|
937
|
+
"onDismiss",
|
|
938
|
+
"live",
|
|
939
|
+
"dismissLabel",
|
|
940
|
+
"role"
|
|
941
|
+
]);
|
|
676
942
|
const config = statusConfig[status];
|
|
677
943
|
const Icon = config.icon;
|
|
678
944
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
679
945
|
"div",
|
|
680
|
-
{
|
|
681
|
-
|
|
682
|
-
|
|
946
|
+
__spreadProps(__spreadValues({
|
|
947
|
+
ref,
|
|
948
|
+
role: role != null ? role : live === "assertive" ? "alert" : live === "polite" ? "status" : void 0,
|
|
949
|
+
"aria-live": live,
|
|
950
|
+
className: cn("ph-alert", statusClassMap[status], className)
|
|
951
|
+
}, props), {
|
|
683
952
|
children: [
|
|
684
|
-
icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className:
|
|
685
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1", children: [
|
|
953
|
+
icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "ph-alert-icon mt-0.5 h-5 w-5 shrink-0", "aria-hidden": true }),
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
686
955
|
title && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "font-semibold", children: title }),
|
|
687
956
|
description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mt-1 text-sm text-ph-subtle", children: description }),
|
|
688
957
|
children
|
|
@@ -692,17 +961,19 @@ function Alert({
|
|
|
692
961
|
{
|
|
693
962
|
type: "button",
|
|
694
963
|
onClick: onDismiss,
|
|
695
|
-
className: "
|
|
696
|
-
"aria-label":
|
|
697
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
964
|
+
className: "ph-alert-dismiss",
|
|
965
|
+
"aria-label": dismissLabel,
|
|
966
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconClose, { className: "h-4 w-4", "aria-hidden": true })
|
|
698
967
|
}
|
|
699
968
|
)
|
|
700
969
|
]
|
|
701
|
-
}
|
|
970
|
+
})
|
|
702
971
|
);
|
|
703
|
-
}
|
|
972
|
+
});
|
|
973
|
+
Alert.displayName = "Alert";
|
|
704
974
|
|
|
705
975
|
// src/components/ui/Badge.tsx
|
|
976
|
+
var import_react6 = require("react");
|
|
706
977
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
707
978
|
var variantMap = {
|
|
708
979
|
brand: "ph-badge-brand",
|
|
@@ -717,66 +988,95 @@ var sizeMap = {
|
|
|
717
988
|
sm: "text-[10px] px-1.5 py-0.5",
|
|
718
989
|
md: ""
|
|
719
990
|
};
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
991
|
+
var Badge = (0, import_react6.forwardRef)(function Badge2(_a, ref) {
|
|
992
|
+
var _b = _a, {
|
|
993
|
+
variant = "neutral",
|
|
994
|
+
size = "md",
|
|
995
|
+
children,
|
|
996
|
+
className
|
|
997
|
+
} = _b, props = __objRest(_b, [
|
|
998
|
+
"variant",
|
|
999
|
+
"size",
|
|
1000
|
+
"children",
|
|
1001
|
+
"className"
|
|
1002
|
+
]);
|
|
726
1003
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
727
1004
|
"span",
|
|
728
|
-
{
|
|
1005
|
+
__spreadProps(__spreadValues({
|
|
1006
|
+
ref,
|
|
729
1007
|
className: cn(
|
|
730
1008
|
"ph-badge",
|
|
731
1009
|
variantMap[variant],
|
|
732
1010
|
sizeMap[size],
|
|
733
1011
|
className
|
|
734
|
-
)
|
|
1012
|
+
)
|
|
1013
|
+
}, props), {
|
|
735
1014
|
children
|
|
736
|
-
}
|
|
1015
|
+
})
|
|
737
1016
|
);
|
|
738
|
-
}
|
|
1017
|
+
});
|
|
1018
|
+
Badge.displayName = "Badge";
|
|
739
1019
|
|
|
740
1020
|
// src/components/ui/Card.tsx
|
|
1021
|
+
var import_react7 = require("react");
|
|
741
1022
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
742
1023
|
var variantMap2 = {
|
|
743
|
-
default: "
|
|
744
|
-
outlined: "border-2 border-ph-border
|
|
745
|
-
elevated: "
|
|
746
|
-
highlighted: "
|
|
1024
|
+
default: "",
|
|
1025
|
+
outlined: "border-2 border-ph-border",
|
|
1026
|
+
elevated: "ph-card-elevated",
|
|
1027
|
+
highlighted: "ph-card-highlighted"
|
|
747
1028
|
};
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
1029
|
+
var Card = (0, import_react7.forwardRef)(function Card2(_a, ref) {
|
|
1030
|
+
var _b = _a, {
|
|
1031
|
+
children,
|
|
1032
|
+
title,
|
|
1033
|
+
description,
|
|
1034
|
+
actions,
|
|
1035
|
+
footer,
|
|
1036
|
+
media,
|
|
1037
|
+
variant = "default",
|
|
1038
|
+
className,
|
|
1039
|
+
bodyClassName,
|
|
1040
|
+
interactive = false,
|
|
1041
|
+
titleAs: Title3 = "h3"
|
|
1042
|
+
} = _b, props = __objRest(_b, [
|
|
1043
|
+
"children",
|
|
1044
|
+
"title",
|
|
1045
|
+
"description",
|
|
1046
|
+
"actions",
|
|
1047
|
+
"footer",
|
|
1048
|
+
"media",
|
|
1049
|
+
"variant",
|
|
1050
|
+
"className",
|
|
1051
|
+
"bodyClassName",
|
|
1052
|
+
"interactive",
|
|
1053
|
+
"titleAs"
|
|
1054
|
+
]);
|
|
759
1055
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
760
1056
|
"div",
|
|
761
|
-
{
|
|
1057
|
+
__spreadProps(__spreadValues({
|
|
1058
|
+
ref,
|
|
762
1059
|
className: cn(
|
|
763
1060
|
"ph-card",
|
|
764
1061
|
variantMap2[variant],
|
|
1062
|
+
interactive && "ph-card-interactive",
|
|
765
1063
|
className
|
|
766
|
-
)
|
|
1064
|
+
)
|
|
1065
|
+
}, props), {
|
|
767
1066
|
children: [
|
|
768
|
-
media && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "-
|
|
1067
|
+
media && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ph-card-media", children: media }),
|
|
769
1068
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("ph-card-body", bodyClassName), children: [
|
|
770
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1069
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Title3, { className: "ph-card-title", children: title }),
|
|
771
1070
|
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
772
1071
|
children,
|
|
773
1072
|
actions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ph-card-actions", children: actions })
|
|
774
1073
|
] }),
|
|
775
1074
|
footer && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "border-t border-ph-border px-6 py-4 text-xs text-ph-subtle", children: footer })
|
|
776
1075
|
]
|
|
777
|
-
}
|
|
1076
|
+
})
|
|
778
1077
|
);
|
|
779
|
-
}
|
|
1078
|
+
});
|
|
1079
|
+
Card.displayName = "Card";
|
|
780
1080
|
|
|
781
1081
|
// src/components/ui/Drawer.tsx
|
|
782
1082
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
@@ -827,21 +1127,269 @@ function Drawer({
|
|
|
827
1127
|
|
|
828
1128
|
// src/components/ui/Kbd.tsx
|
|
829
1129
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1130
|
+
var platformLabels = {
|
|
1131
|
+
text: {
|
|
1132
|
+
command: "Command",
|
|
1133
|
+
cmd: "Command",
|
|
1134
|
+
option: "Option",
|
|
1135
|
+
alt: "Alt",
|
|
1136
|
+
control: "Control",
|
|
1137
|
+
ctrl: "Control",
|
|
1138
|
+
shift: "Shift"
|
|
1139
|
+
},
|
|
1140
|
+
mac: {
|
|
1141
|
+
command: "\u2318",
|
|
1142
|
+
cmd: "\u2318",
|
|
1143
|
+
option: "\u2325",
|
|
1144
|
+
alt: "\u2325",
|
|
1145
|
+
control: "\u2303",
|
|
1146
|
+
ctrl: "\u2303",
|
|
1147
|
+
shift: "\u21E7"
|
|
1148
|
+
},
|
|
1149
|
+
windows: {
|
|
1150
|
+
command: "Win",
|
|
1151
|
+
cmd: "Win",
|
|
1152
|
+
option: "Alt",
|
|
1153
|
+
alt: "Alt",
|
|
1154
|
+
control: "Ctrl",
|
|
1155
|
+
ctrl: "Ctrl",
|
|
1156
|
+
shift: "Shift"
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
var spokenLabels = {
|
|
1160
|
+
"\u2318": "Command",
|
|
1161
|
+
"\u2325": "Option",
|
|
1162
|
+
"\u2303": "Control",
|
|
1163
|
+
"\u21E7": "Shift",
|
|
1164
|
+
"\u21B5": "Enter",
|
|
1165
|
+
"\u23CE": "Enter",
|
|
1166
|
+
"\u232B": "Backspace",
|
|
1167
|
+
"\u238B": "Escape"
|
|
1168
|
+
};
|
|
830
1169
|
function Kbd(_a) {
|
|
831
|
-
var _b = _a, {
|
|
1170
|
+
var _b = _a, {
|
|
1171
|
+
variant = "shortcut",
|
|
1172
|
+
keys,
|
|
1173
|
+
platform = "text",
|
|
1174
|
+
separator,
|
|
1175
|
+
children,
|
|
1176
|
+
className,
|
|
1177
|
+
"aria-label": ariaLabel
|
|
1178
|
+
} = _b, props = __objRest(_b, [
|
|
1179
|
+
"variant",
|
|
1180
|
+
"keys",
|
|
1181
|
+
"platform",
|
|
1182
|
+
"separator",
|
|
1183
|
+
"children",
|
|
1184
|
+
"className",
|
|
1185
|
+
"aria-label"
|
|
1186
|
+
]);
|
|
832
1187
|
if (variant === "token") {
|
|
833
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", __spreadProps(__spreadValues({ className: cn("ph-
|
|
1188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", __spreadProps(__spreadValues({ className: cn("ph-code-token ph-kbd", className), "aria-label": ariaLabel }, props), { children }));
|
|
834
1189
|
}
|
|
835
|
-
const
|
|
836
|
-
|
|
1190
|
+
const sourceKeys = (keys == null ? void 0 : keys.length) ? keys : children != null ? [children] : [];
|
|
1191
|
+
const displayKeys = sourceKeys.map((key) => formatKey(key, platform));
|
|
1192
|
+
const accessibleLabel = ariaLabel != null ? ariaLabel : getShortcutLabel(displayKeys);
|
|
1193
|
+
if (variant === "key") {
|
|
1194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("kbd", __spreadProps(__spreadValues({ className: cn("ph-keycap", className), "aria-label": accessibleLabel }, props), { children: displayKeys[0] }));
|
|
1195
|
+
}
|
|
1196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("kbd", __spreadProps(__spreadValues({ className: cn("ph-shortcut-group ph-keycap", className), "aria-label": accessibleLabel }, props), { children: displayKeys.map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "contents", children: [
|
|
1197
|
+
index > 0 && separator != null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ph-shortcut-separator", "aria-hidden": "true", children: separator }) : null,
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ph-shortcut-key", "aria-hidden": accessibleLabel ? true : void 0, children: key })
|
|
1199
|
+
] }, index)) }));
|
|
1200
|
+
}
|
|
1201
|
+
function formatKey(key, platform) {
|
|
1202
|
+
var _a;
|
|
1203
|
+
if (typeof key !== "string") return key;
|
|
1204
|
+
return (_a = platformLabels[platform][key.toLowerCase()]) != null ? _a : key;
|
|
837
1205
|
}
|
|
838
|
-
function
|
|
839
|
-
|
|
840
|
-
|
|
1206
|
+
function getShortcutLabel(keys) {
|
|
1207
|
+
const labels = keys.map((key) => {
|
|
1208
|
+
var _a;
|
|
1209
|
+
if (typeof key !== "string" && typeof key !== "number") return null;
|
|
1210
|
+
const value = String(key);
|
|
1211
|
+
return (_a = spokenLabels[value]) != null ? _a : value;
|
|
1212
|
+
});
|
|
1213
|
+
return labels.every((label) => label != null) ? labels.join(" + ") : void 0;
|
|
841
1214
|
}
|
|
842
1215
|
|
|
843
|
-
// src/components/ui/
|
|
1216
|
+
// src/components/ui/Loader.tsx
|
|
844
1217
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1218
|
+
var loaderSizeClass = {
|
|
1219
|
+
sm: "ph-loader-sm",
|
|
1220
|
+
md: "ph-loader-md",
|
|
1221
|
+
lg: "ph-loader-lg"
|
|
1222
|
+
};
|
|
1223
|
+
var skeletonShapeClass = {
|
|
1224
|
+
title: "ph-skeleton-title",
|
|
1225
|
+
text: "ph-skeleton-text",
|
|
1226
|
+
"short-text": "ph-skeleton-text-short",
|
|
1227
|
+
avatar: "ph-skeleton-avatar",
|
|
1228
|
+
button: "ph-skeleton-button",
|
|
1229
|
+
block: "ph-skeleton-block"
|
|
1230
|
+
};
|
|
1231
|
+
function Loader(_a) {
|
|
1232
|
+
var _b = _a, {
|
|
1233
|
+
variant = "spinner",
|
|
1234
|
+
size = "md",
|
|
1235
|
+
label = "Loading",
|
|
1236
|
+
className
|
|
1237
|
+
} = _b, props = __objRest(_b, [
|
|
1238
|
+
"variant",
|
|
1239
|
+
"size",
|
|
1240
|
+
"label",
|
|
1241
|
+
"className"
|
|
1242
|
+
]);
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1244
|
+
"span",
|
|
1245
|
+
__spreadProps(__spreadValues({
|
|
1246
|
+
role: "status",
|
|
1247
|
+
"aria-label": label,
|
|
1248
|
+
className: cn("ph-loader", loaderSizeClass[size], className)
|
|
1249
|
+
}, props), {
|
|
1250
|
+
children: [
|
|
1251
|
+
variant === "spinner" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ph-loading", "aria-hidden": true }) : null,
|
|
1252
|
+
variant === "dots" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "ph-loading-dots", "aria-hidden": true, children: [
|
|
1253
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {}),
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {}),
|
|
1255
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {})
|
|
1256
|
+
] }) : null,
|
|
1257
|
+
variant === "pulse" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ph-loading-pulse", "aria-hidden": true }) : null
|
|
1258
|
+
]
|
|
1259
|
+
})
|
|
1260
|
+
);
|
|
1261
|
+
}
|
|
1262
|
+
function Skeleton(_a) {
|
|
1263
|
+
var _b = _a, { shape = "text", className } = _b, props = __objRest(_b, ["shape", "className"]);
|
|
1264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1265
|
+
"span",
|
|
1266
|
+
__spreadValues({
|
|
1267
|
+
className: cn("ph-skeleton", skeletonShapeClass[shape], className),
|
|
1268
|
+
"aria-hidden": "true"
|
|
1269
|
+
}, props)
|
|
1270
|
+
);
|
|
1271
|
+
}
|
|
1272
|
+
function LoadingState(_a) {
|
|
1273
|
+
var _b = _a, {
|
|
1274
|
+
label = "Loading",
|
|
1275
|
+
title = "Loading",
|
|
1276
|
+
description,
|
|
1277
|
+
variant = "spinner",
|
|
1278
|
+
size = "lg",
|
|
1279
|
+
className
|
|
1280
|
+
} = _b, props = __objRest(_b, [
|
|
1281
|
+
"label",
|
|
1282
|
+
"title",
|
|
1283
|
+
"description",
|
|
1284
|
+
"variant",
|
|
1285
|
+
"size",
|
|
1286
|
+
"className"
|
|
1287
|
+
]);
|
|
1288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-loading-state", className), role: "status", "aria-label": label }, props), { children: [
|
|
1289
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Loader, { variant, size, label, "aria-hidden": "true" }),
|
|
1290
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "ph-loading-state__copy", children: [
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: title }),
|
|
1292
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: description }) : null
|
|
1293
|
+
] })
|
|
1294
|
+
] }));
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// src/components/ui/AuthLayout.tsx
|
|
1298
|
+
var import_react8 = require("react");
|
|
1299
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1300
|
+
function AuthLayout(_a) {
|
|
1301
|
+
var _b = _a, { brand, footer, aside, children, className } = _b, props = __objRest(_b, ["brand", "footer", "aside", "children", "className"]);
|
|
1302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-auth-layout", aside != null && "ph-auth-layout--split", className) }, props), { children: [
|
|
1303
|
+
aside ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("aside", { className: "ph-auth-layout__aside", children: aside }) : null,
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-auth-layout__main", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "ph-auth-layout__column", children: [
|
|
1305
|
+
brand ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-auth-layout__brand", children: brand }) : null,
|
|
1306
|
+
children,
|
|
1307
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("footer", { className: "ph-auth-layout__footer", children: footer }) : null
|
|
1308
|
+
] }) })
|
|
1309
|
+
] }));
|
|
1310
|
+
}
|
|
1311
|
+
function AuthCard(_a) {
|
|
1312
|
+
var _b = _a, { title, description, footer, children, className } = _b, props = __objRest(_b, ["title", "description", "footer", "children", "className"]);
|
|
1313
|
+
const titleId = (0, import_react8.useId)();
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", __spreadProps(__spreadValues({ className: cn("ph-auth-card", className), "aria-labelledby": titleId }, props), { children: [
|
|
1315
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { className: "ph-auth-card__header", children: [
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h1", { id: titleId, children: title }),
|
|
1317
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: description }) : null
|
|
1318
|
+
] }),
|
|
1319
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-auth-card__body", children }),
|
|
1320
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("footer", { className: "ph-auth-card__footer", children: footer }) : null
|
|
1321
|
+
] }));
|
|
1322
|
+
}
|
|
1323
|
+
function AuthDivider(_a) {
|
|
1324
|
+
var _b = _a, { children = "or continue with", className } = _b, props = __objRest(_b, ["children", "className"]);
|
|
1325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-auth-divider", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children }) }));
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
// src/components/ui/SettingsLayout.tsx
|
|
1329
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1330
|
+
function SettingsNav(_a) {
|
|
1331
|
+
var _b = _a, { groups, className } = _b, props = __objRest(_b, ["groups", "className"]);
|
|
1332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-settings-nav", className) }, props), { children: groups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ph-settings-nav__group", children: [
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { children: group.label }),
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ph-settings-nav__items", children: group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1335
|
+
"a",
|
|
1336
|
+
{
|
|
1337
|
+
href: item.href,
|
|
1338
|
+
className: cn("ph-settings-nav__item", item.active && "ph-settings-nav__item--active"),
|
|
1339
|
+
"aria-current": item.active ? "page" : void 0,
|
|
1340
|
+
children: [
|
|
1341
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ph-settings-nav__icon", children: item.icon }) : null,
|
|
1342
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: item.label }),
|
|
1343
|
+
item.badge ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ph-settings-nav__badge", children: item.badge }) : null
|
|
1344
|
+
]
|
|
1345
|
+
},
|
|
1346
|
+
item.id
|
|
1347
|
+
)) })
|
|
1348
|
+
] }, index)) }));
|
|
1349
|
+
}
|
|
1350
|
+
function SettingsLayout(_a) {
|
|
1351
|
+
var _b = _a, {
|
|
1352
|
+
title,
|
|
1353
|
+
description,
|
|
1354
|
+
actions,
|
|
1355
|
+
navigation,
|
|
1356
|
+
navigationLabel = "Settings",
|
|
1357
|
+
children,
|
|
1358
|
+
className
|
|
1359
|
+
} = _b, props = __objRest(_b, [
|
|
1360
|
+
"title",
|
|
1361
|
+
"description",
|
|
1362
|
+
"actions",
|
|
1363
|
+
"navigation",
|
|
1364
|
+
"navigationLabel",
|
|
1365
|
+
"children",
|
|
1366
|
+
"className"
|
|
1367
|
+
]);
|
|
1368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", __spreadProps(__spreadValues({ className: cn("ph-settings-layout", className) }, props), { children: [
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: "ph-settings-layout__header", children: [
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { children: title }),
|
|
1372
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: description }) : null
|
|
1373
|
+
] }),
|
|
1374
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ph-settings-layout__actions", children: actions }) : null
|
|
1375
|
+
] }),
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("details", { className: "ph-settings-layout__mobile-nav", children: [
|
|
1377
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("summary", { children: [
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconTuning, { className: "h-4 w-4", "aria-hidden": true }),
|
|
1379
|
+
"Settings menu"
|
|
1380
|
+
] }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { "aria-label": navigationLabel, children: navigation })
|
|
1382
|
+
] }),
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ph-settings-layout__grid", children: [
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("aside", { className: "ph-settings-layout__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { "aria-label": navigationLabel, children: navigation }) }),
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ph-settings-layout__content", children })
|
|
1386
|
+
] })
|
|
1387
|
+
] }));
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
// src/components/ui/DropdownMenu.tsx
|
|
1391
|
+
var DropdownPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1392
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
845
1393
|
var sizeClass2 = {
|
|
846
1394
|
xs: "ph-btn-xs",
|
|
847
1395
|
sm: "ph-btn-sm",
|
|
@@ -853,40 +1401,95 @@ var variantClass2 = {
|
|
|
853
1401
|
secondary: "ph-btn-secondary",
|
|
854
1402
|
accent: "ph-btn-accent"
|
|
855
1403
|
};
|
|
856
|
-
function
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
1404
|
+
function DropdownContent({
|
|
1405
|
+
children,
|
|
1406
|
+
align = "start",
|
|
1407
|
+
side = "bottom",
|
|
1408
|
+
sideOffset = 7,
|
|
1409
|
+
alignOffset = 0,
|
|
1410
|
+
collisionPadding = 8,
|
|
1411
|
+
avoidCollisions = true,
|
|
1412
|
+
panelClassName
|
|
1413
|
+
}) {
|
|
1414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1415
|
+
DropdownPrimitive.Content,
|
|
1416
|
+
{
|
|
1417
|
+
className: cn("ph-dropdown-panel", panelClassName),
|
|
1418
|
+
align,
|
|
1419
|
+
side,
|
|
1420
|
+
sideOffset,
|
|
1421
|
+
alignOffset,
|
|
1422
|
+
collisionPadding,
|
|
1423
|
+
avoidCollisions,
|
|
1424
|
+
sticky: "partial",
|
|
1425
|
+
children: [
|
|
1426
|
+
children,
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Arrow, { className: "ph-dropdown-arrow", width: 12, height: 6 })
|
|
1428
|
+
]
|
|
1429
|
+
}
|
|
1430
|
+
) });
|
|
862
1431
|
}
|
|
863
1432
|
function DropdownMenu(_a) {
|
|
864
1433
|
var _b = _a, {
|
|
865
1434
|
trigger,
|
|
866
1435
|
children,
|
|
867
|
-
align
|
|
1436
|
+
align,
|
|
1437
|
+
side,
|
|
1438
|
+
sideOffset,
|
|
1439
|
+
alignOffset,
|
|
1440
|
+
collisionPadding,
|
|
1441
|
+
avoidCollisions,
|
|
868
1442
|
className,
|
|
869
1443
|
panelClassName,
|
|
870
|
-
"aria-label": ariaLabel
|
|
1444
|
+
"aria-label": ariaLabel,
|
|
1445
|
+
open,
|
|
1446
|
+
defaultOpen,
|
|
1447
|
+
onOpenChange,
|
|
1448
|
+
modal = false,
|
|
1449
|
+
disabled
|
|
871
1450
|
} = _b, props = __objRest(_b, [
|
|
872
1451
|
"trigger",
|
|
873
1452
|
"children",
|
|
874
1453
|
"align",
|
|
1454
|
+
"side",
|
|
1455
|
+
"sideOffset",
|
|
1456
|
+
"alignOffset",
|
|
1457
|
+
"collisionPadding",
|
|
1458
|
+
"avoidCollisions",
|
|
875
1459
|
"className",
|
|
876
1460
|
"panelClassName",
|
|
877
|
-
"aria-label"
|
|
1461
|
+
"aria-label",
|
|
1462
|
+
"open",
|
|
1463
|
+
"defaultOpen",
|
|
1464
|
+
"onOpenChange",
|
|
1465
|
+
"modal",
|
|
1466
|
+
"disabled"
|
|
878
1467
|
]);
|
|
879
|
-
return /* @__PURE__ */ (0,
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1469
|
+
DropdownPrimitive.Root,
|
|
1470
|
+
{
|
|
1471
|
+
open,
|
|
1472
|
+
defaultOpen,
|
|
1473
|
+
onOpenChange,
|
|
1474
|
+
modal,
|
|
1475
|
+
children: [
|
|
1476
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "ph-dropdown-trigger", "aria-label": ariaLabel, children: trigger }) }),
|
|
1477
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1478
|
+
DropdownContent,
|
|
1479
|
+
{
|
|
1480
|
+
align,
|
|
1481
|
+
side,
|
|
1482
|
+
sideOffset,
|
|
1483
|
+
alignOffset,
|
|
1484
|
+
collisionPadding,
|
|
1485
|
+
avoidCollisions,
|
|
1486
|
+
panelClassName,
|
|
1487
|
+
children
|
|
1488
|
+
}
|
|
1489
|
+
)
|
|
1490
|
+
]
|
|
1491
|
+
}
|
|
1492
|
+
) }));
|
|
890
1493
|
}
|
|
891
1494
|
function DropdownButton(_a) {
|
|
892
1495
|
var _b = _a, {
|
|
@@ -898,10 +1501,20 @@ function DropdownButton(_a) {
|
|
|
898
1501
|
icon,
|
|
899
1502
|
sideIcon,
|
|
900
1503
|
children,
|
|
901
|
-
align
|
|
1504
|
+
align,
|
|
1505
|
+
side,
|
|
1506
|
+
sideOffset,
|
|
1507
|
+
alignOffset,
|
|
1508
|
+
collisionPadding,
|
|
1509
|
+
avoidCollisions,
|
|
902
1510
|
className,
|
|
903
1511
|
panelClassName,
|
|
904
|
-
"aria-label": ariaLabel
|
|
1512
|
+
"aria-label": ariaLabel,
|
|
1513
|
+
open,
|
|
1514
|
+
defaultOpen,
|
|
1515
|
+
onOpenChange,
|
|
1516
|
+
modal = false,
|
|
1517
|
+
disabled
|
|
905
1518
|
} = _b, props = __objRest(_b, [
|
|
906
1519
|
"label",
|
|
907
1520
|
"variant",
|
|
@@ -912,55 +1525,154 @@ function DropdownButton(_a) {
|
|
|
912
1525
|
"sideIcon",
|
|
913
1526
|
"children",
|
|
914
1527
|
"align",
|
|
1528
|
+
"side",
|
|
1529
|
+
"sideOffset",
|
|
1530
|
+
"alignOffset",
|
|
1531
|
+
"collisionPadding",
|
|
1532
|
+
"avoidCollisions",
|
|
915
1533
|
"className",
|
|
916
1534
|
"panelClassName",
|
|
917
|
-
"aria-label"
|
|
1535
|
+
"aria-label",
|
|
1536
|
+
"open",
|
|
1537
|
+
"defaultOpen",
|
|
1538
|
+
"onOpenChange",
|
|
1539
|
+
"modal",
|
|
1540
|
+
"disabled"
|
|
918
1541
|
]);
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1542
|
+
const trailing = sideIcon != null ? sideIcon : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconChevronDown, { className: "h-4 w-4", "aria-hidden": true });
|
|
1543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1544
|
+
DropdownPrimitive.Root,
|
|
1545
|
+
{
|
|
1546
|
+
open,
|
|
1547
|
+
defaultOpen,
|
|
1548
|
+
onOpenChange,
|
|
1549
|
+
modal,
|
|
1550
|
+
children: [
|
|
1551
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1552
|
+
"button",
|
|
1553
|
+
{
|
|
1554
|
+
type: "button",
|
|
1555
|
+
disabled,
|
|
1556
|
+
className: cn(
|
|
1557
|
+
"ph-btn ph-btn-raised ph-dropdown-button",
|
|
1558
|
+
variantClass2[variant],
|
|
1559
|
+
outline && "ph-btn-outline",
|
|
1560
|
+
sizeClass2[size],
|
|
1561
|
+
split && "ph-btn-split"
|
|
1562
|
+
),
|
|
1563
|
+
"aria-label": ariaLabel,
|
|
1564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ButtonChrome, { label, icon, sideIcon: trailing, split })
|
|
1565
|
+
}
|
|
1566
|
+
) }),
|
|
1567
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1568
|
+
DropdownContent,
|
|
1569
|
+
{
|
|
1570
|
+
align,
|
|
1571
|
+
side,
|
|
1572
|
+
sideOffset,
|
|
1573
|
+
alignOffset,
|
|
1574
|
+
collisionPadding,
|
|
1575
|
+
avoidCollisions,
|
|
1576
|
+
panelClassName,
|
|
1577
|
+
children
|
|
1578
|
+
}
|
|
1579
|
+
)
|
|
1580
|
+
]
|
|
1581
|
+
}
|
|
1582
|
+
) }));
|
|
943
1583
|
}
|
|
944
1584
|
function DropdownItem(_a) {
|
|
1585
|
+
var _b = _a, { className, children, disabled } = _b, props = __objRest(_b, ["className", "children", "disabled"]);
|
|
1586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Item, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1587
|
+
"button",
|
|
1588
|
+
__spreadProps(__spreadValues({
|
|
1589
|
+
type: "button",
|
|
1590
|
+
disabled,
|
|
1591
|
+
className: cn("ph-dropdown-item w-full text-left", className)
|
|
1592
|
+
}, props), {
|
|
1593
|
+
children
|
|
1594
|
+
})
|
|
1595
|
+
) });
|
|
1596
|
+
}
|
|
1597
|
+
function DropdownRadioGroup(props) {
|
|
1598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.RadioGroup, __spreadValues({}, props));
|
|
1599
|
+
}
|
|
1600
|
+
function DropdownRadioItem(_a) {
|
|
1601
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(DropdownPrimitive.RadioItem, __spreadProps(__spreadValues({ className: cn("ph-dropdown-item ph-dropdown-radio-item", className) }, props), { children: [
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ph-dropdown-item-indicator", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconCheck, { className: "h-3.5 w-3.5" }) }) }),
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children })
|
|
1605
|
+
] }));
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
// src/components/ui/Input.tsx
|
|
1609
|
+
var import_react10 = require("react");
|
|
1610
|
+
|
|
1611
|
+
// src/components/ui/FormField.tsx
|
|
1612
|
+
var import_react9 = require("react");
|
|
1613
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1614
|
+
function FormField(_a) {
|
|
945
1615
|
var _b = _a, {
|
|
946
|
-
|
|
947
|
-
|
|
1616
|
+
controlId,
|
|
1617
|
+
label,
|
|
1618
|
+
hideLabel = false,
|
|
1619
|
+
helperText,
|
|
1620
|
+
error,
|
|
1621
|
+
required = false,
|
|
1622
|
+
disabled = false,
|
|
1623
|
+
children,
|
|
1624
|
+
className
|
|
948
1625
|
} = _b, props = __objRest(_b, [
|
|
949
|
-
"
|
|
950
|
-
"
|
|
1626
|
+
"controlId",
|
|
1627
|
+
"label",
|
|
1628
|
+
"hideLabel",
|
|
1629
|
+
"helperText",
|
|
1630
|
+
"error",
|
|
1631
|
+
"required",
|
|
1632
|
+
"disabled",
|
|
1633
|
+
"children",
|
|
1634
|
+
"className"
|
|
951
1635
|
]);
|
|
952
|
-
|
|
1636
|
+
const generatedId = (0, import_react9.useId)();
|
|
1637
|
+
const id = controlId != null ? controlId : generatedId;
|
|
1638
|
+
const descriptionId = helperText && !error ? `${id}-description` : void 0;
|
|
1639
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
1640
|
+
const controlProps = {
|
|
1641
|
+
id,
|
|
1642
|
+
"aria-describedby": descriptionId,
|
|
1643
|
+
"aria-errormessage": errorId,
|
|
1644
|
+
"aria-invalid": error ? true : void 0
|
|
1645
|
+
};
|
|
1646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-field", className) }, props), { children: [
|
|
1647
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1648
|
+
"label",
|
|
1649
|
+
{
|
|
1650
|
+
htmlFor: id,
|
|
1651
|
+
className: cn("ph-label", hideLabel && "sr-only", disabled && "opacity-50"),
|
|
1652
|
+
children: [
|
|
1653
|
+
label,
|
|
1654
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: " *" }) : null
|
|
1655
|
+
]
|
|
1656
|
+
}
|
|
1657
|
+
) : null,
|
|
1658
|
+
typeof children === "function" ? children(controlProps) : children,
|
|
1659
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { id: descriptionId, className: "mt-1 text-xs text-ph-subtle", children: helperText }) : null,
|
|
1660
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { id: errorId, className: "mt-1 text-xs font-medium text-ph-danger", children: error }) : null
|
|
1661
|
+
] }));
|
|
953
1662
|
}
|
|
954
1663
|
|
|
955
1664
|
// src/components/ui/Input.tsx
|
|
956
|
-
var
|
|
957
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1665
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
958
1666
|
var sizeMap3 = {
|
|
959
1667
|
sm: "ph-input-sm",
|
|
960
1668
|
md: "",
|
|
961
1669
|
lg: "ph-input-lg"
|
|
962
1670
|
};
|
|
963
|
-
function
|
|
1671
|
+
function joinIds(...ids) {
|
|
1672
|
+
const value = ids.filter(Boolean).join(" ");
|
|
1673
|
+
return value || void 0;
|
|
1674
|
+
}
|
|
1675
|
+
var Input = (0, import_react10.forwardRef)(function Input2(_a, ref) {
|
|
964
1676
|
var _b = _a, {
|
|
965
1677
|
id: idProp,
|
|
966
1678
|
label,
|
|
@@ -971,7 +1683,9 @@ function Input(_a) {
|
|
|
971
1683
|
variant = "default",
|
|
972
1684
|
className,
|
|
973
1685
|
wrapperClassName,
|
|
974
|
-
disabled
|
|
1686
|
+
disabled,
|
|
1687
|
+
required,
|
|
1688
|
+
"aria-describedby": ariaDescribedBy
|
|
975
1689
|
} = _b, props = __objRest(_b, [
|
|
976
1690
|
"id",
|
|
977
1691
|
"label",
|
|
@@ -982,45 +1696,46 @@ function Input(_a) {
|
|
|
982
1696
|
"variant",
|
|
983
1697
|
"className",
|
|
984
1698
|
"wrapperClassName",
|
|
985
|
-
"disabled"
|
|
1699
|
+
"disabled",
|
|
1700
|
+
"required",
|
|
1701
|
+
"aria-describedby"
|
|
986
1702
|
]);
|
|
987
|
-
const autoId = (0,
|
|
1703
|
+
const autoId = (0, import_react10.useId)();
|
|
988
1704
|
const id = idProp != null ? idProp : autoId;
|
|
989
1705
|
const hasError = Boolean(error);
|
|
990
|
-
return /* @__PURE__ */ (0,
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
)
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
function Select(_a) {
|
|
1706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1707
|
+
FormField,
|
|
1708
|
+
{
|
|
1709
|
+
controlId: id,
|
|
1710
|
+
label,
|
|
1711
|
+
hideLabel,
|
|
1712
|
+
helperText,
|
|
1713
|
+
error,
|
|
1714
|
+
required,
|
|
1715
|
+
disabled,
|
|
1716
|
+
className: wrapperClassName,
|
|
1717
|
+
children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1718
|
+
"input",
|
|
1719
|
+
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1720
|
+
ref,
|
|
1721
|
+
disabled,
|
|
1722
|
+
required,
|
|
1723
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1724
|
+
className: cn(
|
|
1725
|
+
"ph-input w-full",
|
|
1726
|
+
sizeMap3[size],
|
|
1727
|
+
variant === "ghost" && "ph-input-ghost",
|
|
1728
|
+
hasError && "ph-input-error",
|
|
1729
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1730
|
+
className
|
|
1731
|
+
)
|
|
1732
|
+
}), props)
|
|
1733
|
+
)
|
|
1734
|
+
}
|
|
1735
|
+
);
|
|
1736
|
+
});
|
|
1737
|
+
Input.displayName = "Input";
|
|
1738
|
+
var Select = (0, import_react10.forwardRef)(function Select2(_a, ref) {
|
|
1024
1739
|
var _b = _a, {
|
|
1025
1740
|
id: idProp,
|
|
1026
1741
|
label,
|
|
@@ -1031,7 +1746,9 @@ function Select(_a) {
|
|
|
1031
1746
|
className,
|
|
1032
1747
|
wrapperClassName,
|
|
1033
1748
|
disabled,
|
|
1034
|
-
children
|
|
1749
|
+
children,
|
|
1750
|
+
required,
|
|
1751
|
+
"aria-describedby": ariaDescribedBy
|
|
1035
1752
|
} = _b, props = __objRest(_b, [
|
|
1036
1753
|
"id",
|
|
1037
1754
|
"label",
|
|
@@ -1042,42 +1759,34 @@ function Select(_a) {
|
|
|
1042
1759
|
"className",
|
|
1043
1760
|
"wrapperClassName",
|
|
1044
1761
|
"disabled",
|
|
1045
|
-
"children"
|
|
1762
|
+
"children",
|
|
1763
|
+
"required",
|
|
1764
|
+
"aria-describedby"
|
|
1046
1765
|
]);
|
|
1047
|
-
const autoId = (0,
|
|
1766
|
+
const autoId = (0, import_react10.useId)();
|
|
1048
1767
|
const id = idProp != null ? idProp : autoId;
|
|
1049
1768
|
const hasError = Boolean(error);
|
|
1050
|
-
return /* @__PURE__ */ (0,
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
)
|
|
1072
|
-
}, props), {
|
|
1073
|
-
children
|
|
1074
|
-
})
|
|
1075
|
-
),
|
|
1076
|
-
helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: helperText }),
|
|
1077
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs font-medium text-ph-danger", children: error })
|
|
1078
|
-
] });
|
|
1079
|
-
}
|
|
1080
|
-
function Textarea(_a) {
|
|
1769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1770
|
+
"select",
|
|
1771
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1772
|
+
ref,
|
|
1773
|
+
disabled,
|
|
1774
|
+
required,
|
|
1775
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1776
|
+
className: cn(
|
|
1777
|
+
"ph-select w-full",
|
|
1778
|
+
sizeMap3[size],
|
|
1779
|
+
hasError && "ph-input-error",
|
|
1780
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1781
|
+
className
|
|
1782
|
+
)
|
|
1783
|
+
}), props), {
|
|
1784
|
+
children
|
|
1785
|
+
})
|
|
1786
|
+
) });
|
|
1787
|
+
});
|
|
1788
|
+
Select.displayName = "Select";
|
|
1789
|
+
var Textarea = (0, import_react10.forwardRef)(function Textarea2(_a, ref) {
|
|
1081
1790
|
var _b = _a, {
|
|
1082
1791
|
id: idProp,
|
|
1083
1792
|
label,
|
|
@@ -1087,7 +1796,9 @@ function Textarea(_a) {
|
|
|
1087
1796
|
size = "md",
|
|
1088
1797
|
className,
|
|
1089
1798
|
wrapperClassName,
|
|
1090
|
-
disabled
|
|
1799
|
+
disabled,
|
|
1800
|
+
required,
|
|
1801
|
+
"aria-describedby": ariaDescribedBy
|
|
1091
1802
|
} = _b, props = __objRest(_b, [
|
|
1092
1803
|
"id",
|
|
1093
1804
|
"label",
|
|
@@ -1097,40 +1808,32 @@ function Textarea(_a) {
|
|
|
1097
1808
|
"size",
|
|
1098
1809
|
"className",
|
|
1099
1810
|
"wrapperClassName",
|
|
1100
|
-
"disabled"
|
|
1811
|
+
"disabled",
|
|
1812
|
+
"required",
|
|
1813
|
+
"aria-describedby"
|
|
1101
1814
|
]);
|
|
1102
|
-
const autoId = (0,
|
|
1815
|
+
const autoId = (0, import_react10.useId)();
|
|
1103
1816
|
const id = idProp != null ? idProp : autoId;
|
|
1104
1817
|
const hasError = Boolean(error);
|
|
1105
|
-
return /* @__PURE__ */ (0,
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
disabled && "cursor-not-allowed opacity-60",
|
|
1125
|
-
className
|
|
1126
|
-
)
|
|
1127
|
-
}, props)
|
|
1128
|
-
),
|
|
1129
|
-
helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: helperText }),
|
|
1130
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs font-medium text-ph-danger", children: error })
|
|
1131
|
-
] });
|
|
1132
|
-
}
|
|
1133
|
-
function Checkbox(_a) {
|
|
1818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1819
|
+
"textarea",
|
|
1820
|
+
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1821
|
+
ref,
|
|
1822
|
+
disabled,
|
|
1823
|
+
required,
|
|
1824
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1825
|
+
className: cn(
|
|
1826
|
+
"ph-textarea w-full",
|
|
1827
|
+
sizeMap3[size],
|
|
1828
|
+
hasError && "ph-input-error",
|
|
1829
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1830
|
+
className
|
|
1831
|
+
)
|
|
1832
|
+
}), props)
|
|
1833
|
+
) });
|
|
1834
|
+
});
|
|
1835
|
+
Textarea.displayName = "Textarea";
|
|
1836
|
+
var Checkbox = (0, import_react10.forwardRef)(function Checkbox2(_a, ref) {
|
|
1134
1837
|
var _b = _a, {
|
|
1135
1838
|
id: idProp,
|
|
1136
1839
|
label,
|
|
@@ -1138,7 +1841,8 @@ function Checkbox(_a) {
|
|
|
1138
1841
|
helperText,
|
|
1139
1842
|
className,
|
|
1140
1843
|
wrapperClassName,
|
|
1141
|
-
disabled
|
|
1844
|
+
disabled,
|
|
1845
|
+
"aria-describedby": ariaDescribedBy
|
|
1142
1846
|
} = _b, props = __objRest(_b, [
|
|
1143
1847
|
"id",
|
|
1144
1848
|
"label",
|
|
@@ -1146,33 +1850,45 @@ function Checkbox(_a) {
|
|
|
1146
1850
|
"helperText",
|
|
1147
1851
|
"className",
|
|
1148
1852
|
"wrapperClassName",
|
|
1149
|
-
"disabled"
|
|
1853
|
+
"disabled",
|
|
1854
|
+
"aria-describedby"
|
|
1150
1855
|
]);
|
|
1151
|
-
const autoId = (0,
|
|
1856
|
+
const autoId = (0, import_react10.useId)();
|
|
1152
1857
|
const id = idProp != null ? idProp : autoId;
|
|
1153
1858
|
const hasError = Boolean(error);
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
"
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1859
|
+
const descriptionId = helperText && !hasError ? `${id}-description` : void 0;
|
|
1860
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
1861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-control-row", wrapperClassName), children: [
|
|
1862
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "ph-checkbox-wrap", children: [
|
|
1863
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1864
|
+
"input",
|
|
1865
|
+
__spreadValues({
|
|
1866
|
+
ref,
|
|
1867
|
+
id,
|
|
1868
|
+
type: "checkbox",
|
|
1869
|
+
disabled,
|
|
1870
|
+
"aria-invalid": hasError || void 0,
|
|
1871
|
+
"aria-describedby": joinIds(ariaDescribedBy, descriptionId),
|
|
1872
|
+
"aria-errormessage": errorId,
|
|
1873
|
+
className: cn(
|
|
1874
|
+
"ph-checkbox",
|
|
1875
|
+
hasError && "border-ph-danger",
|
|
1876
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1877
|
+
className
|
|
1878
|
+
)
|
|
1879
|
+
}, props)
|
|
1880
|
+
),
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconCheck, { className: "ph-checkbox-icon", "aria-hidden": true })
|
|
1882
|
+
] }),
|
|
1883
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "ph-control-copy", children: [
|
|
1884
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label }),
|
|
1885
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { id: descriptionId, className: "text-xs text-ph-subtle", children: helperText }) : null,
|
|
1886
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { id: errorId, className: "text-xs font-medium text-ph-danger", children: error }) : null
|
|
1887
|
+
] })
|
|
1173
1888
|
] });
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1889
|
+
});
|
|
1890
|
+
Checkbox.displayName = "Checkbox";
|
|
1891
|
+
var Radio = (0, import_react10.forwardRef)(function Radio2(_a, ref) {
|
|
1176
1892
|
var _b = _a, {
|
|
1177
1893
|
id: idProp,
|
|
1178
1894
|
label,
|
|
@@ -1186,22 +1902,24 @@ function Radio(_a) {
|
|
|
1186
1902
|
"wrapperClassName",
|
|
1187
1903
|
"disabled"
|
|
1188
1904
|
]);
|
|
1189
|
-
const autoId = (0,
|
|
1905
|
+
const autoId = (0, import_react10.useId)();
|
|
1190
1906
|
const id = idProp != null ? idProp : autoId;
|
|
1191
|
-
return /* @__PURE__ */ (0,
|
|
1192
|
-
/* @__PURE__ */ (0,
|
|
1907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-control-row", wrapperClassName, disabled && "opacity-60"), children: [
|
|
1908
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1193
1909
|
"input",
|
|
1194
1910
|
__spreadValues({
|
|
1911
|
+
ref,
|
|
1195
1912
|
id,
|
|
1196
1913
|
type: "radio",
|
|
1197
1914
|
disabled,
|
|
1198
1915
|
className: cn("ph-radio", disabled && "cursor-not-allowed", className)
|
|
1199
1916
|
}, props)
|
|
1200
1917
|
),
|
|
1201
|
-
/* @__PURE__ */ (0,
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label })
|
|
1202
1919
|
] });
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1920
|
+
});
|
|
1921
|
+
Radio.displayName = "Radio";
|
|
1922
|
+
var Toggle = (0, import_react10.forwardRef)(function Toggle2(_a, ref) {
|
|
1205
1923
|
var _b = _a, {
|
|
1206
1924
|
id: idProp,
|
|
1207
1925
|
label,
|
|
@@ -1215,13 +1933,14 @@ function Toggle(_a) {
|
|
|
1215
1933
|
"wrapperClassName",
|
|
1216
1934
|
"disabled"
|
|
1217
1935
|
]);
|
|
1218
|
-
const autoId = (0,
|
|
1936
|
+
const autoId = (0, import_react10.useId)();
|
|
1219
1937
|
const id = idProp != null ? idProp : autoId;
|
|
1220
|
-
return /* @__PURE__ */ (0,
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: cn("ph-control-row-between", wrapperClassName, disabled && "opacity-60"), children: [
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: disabled ? "opacity-60" : void 0, children: label }),
|
|
1940
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1223
1941
|
"input",
|
|
1224
1942
|
__spreadValues({
|
|
1943
|
+
ref,
|
|
1225
1944
|
id,
|
|
1226
1945
|
type: "checkbox",
|
|
1227
1946
|
role: "switch",
|
|
@@ -1230,9 +1949,11 @@ function Toggle(_a) {
|
|
|
1230
1949
|
}, props)
|
|
1231
1950
|
)
|
|
1232
1951
|
] });
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1952
|
+
});
|
|
1953
|
+
Toggle.displayName = "Toggle";
|
|
1954
|
+
var Range = (0, import_react10.forwardRef)(function Range2(_a, ref) {
|
|
1235
1955
|
var _b = _a, {
|
|
1956
|
+
id: idProp,
|
|
1236
1957
|
label,
|
|
1237
1958
|
minLabel,
|
|
1238
1959
|
maxLabel,
|
|
@@ -1240,6 +1961,7 @@ function Range(_a) {
|
|
|
1240
1961
|
wrapperClassName,
|
|
1241
1962
|
className
|
|
1242
1963
|
} = _b, props = __objRest(_b, [
|
|
1964
|
+
"id",
|
|
1243
1965
|
"label",
|
|
1244
1966
|
"minLabel",
|
|
1245
1967
|
"maxLabel",
|
|
@@ -1247,35 +1969,55 @@ function Range(_a) {
|
|
|
1247
1969
|
"wrapperClassName",
|
|
1248
1970
|
"className"
|
|
1249
1971
|
]);
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
/* @__PURE__ */ (0,
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1972
|
+
const autoId = (0, import_react10.useId)();
|
|
1973
|
+
const id = idProp != null ? idProp : autoId;
|
|
1974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
1975
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", __spreadValues({ ref, id, type: "range", className: cn("ph-range", className) }, props)),
|
|
1977
|
+
(minLabel || valueLabel || maxLabel) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex justify-between text-xs text-ph-mutedtext", children: [
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: minLabel }),
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: valueLabel }),
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: maxLabel })
|
|
1981
|
+
] })
|
|
1982
|
+
] });
|
|
1983
|
+
});
|
|
1984
|
+
Range.displayName = "Range";
|
|
1985
|
+
var FileUpload = (0, import_react10.forwardRef)(function FileUpload2(_a, ref) {
|
|
1986
|
+
var _b = _a, {
|
|
1987
|
+
id: idProp,
|
|
1988
|
+
label,
|
|
1989
|
+
prompt = "Drop file or browse",
|
|
1990
|
+
wrapperClassName,
|
|
1991
|
+
className
|
|
1992
|
+
} = _b, props = __objRest(_b, [
|
|
1993
|
+
"id",
|
|
1994
|
+
"label",
|
|
1995
|
+
"prompt",
|
|
1996
|
+
"wrapperClassName",
|
|
1997
|
+
"className"
|
|
1998
|
+
]);
|
|
1999
|
+
const autoId = (0, import_react10.useId)();
|
|
2000
|
+
const id = idProp != null ? idProp : autoId;
|
|
2001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2002
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
2003
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { htmlFor: id, className: "ph-file-upload", children: [
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", __spreadValues({ ref, id, type: "file", className: cn("sr-only", className) }, props)),
|
|
1266
2005
|
prompt
|
|
1267
2006
|
] })
|
|
1268
2007
|
] });
|
|
1269
|
-
}
|
|
2008
|
+
});
|
|
2009
|
+
FileUpload.displayName = "FileUpload";
|
|
1270
2010
|
|
|
1271
2011
|
// src/components/ui/Modal.tsx
|
|
1272
|
-
var
|
|
2012
|
+
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
2013
|
+
var import_react11 = require("react");
|
|
2014
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1273
2015
|
var sizeMap4 = {
|
|
1274
2016
|
sm: "max-w-sm",
|
|
1275
2017
|
md: "max-w-lg",
|
|
1276
2018
|
lg: "max-w-2xl",
|
|
1277
2019
|
xl: "max-w-4xl",
|
|
1278
|
-
full: "max-w-
|
|
2020
|
+
full: "max-w-none"
|
|
1279
2021
|
};
|
|
1280
2022
|
function Modal({
|
|
1281
2023
|
open = false,
|
|
@@ -1286,50 +2028,67 @@ function Modal({
|
|
|
1286
2028
|
footer,
|
|
1287
2029
|
size = "md",
|
|
1288
2030
|
className,
|
|
1289
|
-
showCloseButton = true
|
|
2031
|
+
showCloseButton = true,
|
|
2032
|
+
closeOnOutsideClick = true,
|
|
2033
|
+
closeOnEscape = true,
|
|
2034
|
+
"aria-label": ariaLabel
|
|
1290
2035
|
}) {
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
2036
|
+
const canDismiss = Boolean(onClose);
|
|
2037
|
+
const restoreFocusRef = (0, import_react11.useRef)(null);
|
|
2038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2039
|
+
Dialog.Root,
|
|
1294
2040
|
{
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
className
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
2041
|
+
open,
|
|
2042
|
+
onOpenChange: (nextOpen) => {
|
|
2043
|
+
if (!nextOpen) onClose == null ? void 0 : onClose();
|
|
2044
|
+
},
|
|
2045
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Dialog.Portal, { children: [
|
|
2046
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Overlay, { className: "ph-modal-overlay" }),
|
|
2047
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2048
|
+
Dialog.Content,
|
|
2049
|
+
__spreadProps(__spreadValues({
|
|
2050
|
+
className: cn("ph-modal-panel", sizeMap4[size], className),
|
|
2051
|
+
"aria-label": ariaLabel
|
|
2052
|
+
}, description ? {} : { "aria-describedby": void 0 }), {
|
|
2053
|
+
onOpenAutoFocus: () => {
|
|
2054
|
+
restoreFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2055
|
+
},
|
|
2056
|
+
onCloseAutoFocus: (event) => {
|
|
2057
|
+
var _a;
|
|
2058
|
+
event.preventDefault();
|
|
2059
|
+
(_a = restoreFocusRef.current) == null ? void 0 : _a.focus();
|
|
2060
|
+
},
|
|
2061
|
+
onEscapeKeyDown: (event) => {
|
|
2062
|
+
if (!canDismiss || !closeOnEscape) event.preventDefault();
|
|
2063
|
+
},
|
|
2064
|
+
onPointerDownOutside: (event) => {
|
|
2065
|
+
if (!canDismiss || !closeOnOutsideClick) event.preventDefault();
|
|
2066
|
+
},
|
|
2067
|
+
children: [
|
|
2068
|
+
title ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
2069
|
+
title || description || showCloseButton && canDismiss ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "ph-modal-header", children: [
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0", children: [
|
|
2071
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Title, { className: "text-lg font-bold text-ph-ink", children: title }) : null,
|
|
2072
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Description, { className: "mt-1 text-sm text-ph-subtle", children: description }) : null
|
|
2073
|
+
] }),
|
|
2074
|
+
showCloseButton && canDismiss ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "ph-modal-close", "aria-label": "Close dialog", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconClose, { className: "h-5 w-5", "aria-hidden": true }) }) }) : null
|
|
2075
|
+
] }) : null,
|
|
2076
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "ph-modal-body", children }),
|
|
2077
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "ph-modal-footer", children: footer }) : null
|
|
2078
|
+
]
|
|
2079
|
+
})
|
|
2080
|
+
)
|
|
2081
|
+
] })
|
|
1323
2082
|
}
|
|
1324
|
-
)
|
|
2083
|
+
);
|
|
1325
2084
|
}
|
|
1326
2085
|
|
|
1327
2086
|
// src/components/ui/Navigation.tsx
|
|
1328
|
-
var
|
|
2087
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1329
2088
|
function Breadcrumbs({ items, label = "Breadcrumb", className }) {
|
|
1330
|
-
return /* @__PURE__ */ (0,
|
|
1331
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
1332
|
-
item.current || !item.href ? /* @__PURE__ */ (0,
|
|
2089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("nav", { "aria-label": label, className: cn("ph-breadcrumbs", className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "contents", children: [
|
|
2090
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ph-breadcrumb-sep", "aria-hidden": "true", children: "/" }) : null,
|
|
2091
|
+
item.current || !item.href ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ph-breadcrumb-current", "aria-current": item.current ? "page" : void 0, children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", { href: item.href, className: "ph-breadcrumb-link", children: item.label })
|
|
1333
2092
|
] }, `${item.label}-${index}`)) });
|
|
1334
2093
|
}
|
|
1335
2094
|
function Pagination({
|
|
@@ -1342,8 +2101,8 @@ function Pagination({
|
|
|
1342
2101
|
}) {
|
|
1343
2102
|
const pages = compact ? [Math.max(1, page - 1), page, Math.min(totalPages, page + 1)] : [1, 2, 3, totalPages];
|
|
1344
2103
|
const uniquePages = Array.from(new Set(pages)).filter((n) => n >= 1 && n <= totalPages);
|
|
1345
|
-
return /* @__PURE__ */ (0,
|
|
1346
|
-
/* @__PURE__ */ (0,
|
|
2104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("nav", { "aria-label": label, className: cn("ph-pagination", className), children: [
|
|
2105
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1347
2106
|
"button",
|
|
1348
2107
|
{
|
|
1349
2108
|
type: "button",
|
|
@@ -1351,12 +2110,12 @@ function Pagination({
|
|
|
1351
2110
|
disabled: page <= 1,
|
|
1352
2111
|
"aria-label": "Previous page",
|
|
1353
2112
|
onClick: () => onPageChange == null ? void 0 : onPageChange(page - 1),
|
|
1354
|
-
children: /* @__PURE__ */ (0,
|
|
2113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconChevronLeft, { className: "mx-auto h-4 w-4", "aria-hidden": true })
|
|
1355
2114
|
}
|
|
1356
2115
|
),
|
|
1357
|
-
uniquePages.map((pageNumber, index) => /* @__PURE__ */ (0,
|
|
1358
|
-
!compact && index === uniquePages.length - 1 && pageNumber > 4 ? /* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
2116
|
+
uniquePages.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "contents", children: [
|
|
2117
|
+
!compact && index === uniquePages.length - 1 && pageNumber > 4 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ph-pagination-ellipsis", "aria-hidden": "true", children: "..." }) : null,
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1360
2119
|
"button",
|
|
1361
2120
|
{
|
|
1362
2121
|
type: "button",
|
|
@@ -1367,7 +2126,7 @@ function Pagination({
|
|
|
1367
2126
|
}
|
|
1368
2127
|
)
|
|
1369
2128
|
] }, pageNumber)),
|
|
1370
|
-
/* @__PURE__ */ (0,
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1371
2130
|
"button",
|
|
1372
2131
|
{
|
|
1373
2132
|
type: "button",
|
|
@@ -1375,25 +2134,25 @@ function Pagination({
|
|
|
1375
2134
|
disabled: page >= totalPages,
|
|
1376
2135
|
"aria-label": "Next page",
|
|
1377
2136
|
onClick: () => onPageChange == null ? void 0 : onPageChange(page + 1),
|
|
1378
|
-
children: /* @__PURE__ */ (0,
|
|
2137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconChevronRight, { className: "mx-auto h-4 w-4", "aria-hidden": true })
|
|
1379
2138
|
}
|
|
1380
2139
|
)
|
|
1381
2140
|
] });
|
|
1382
2141
|
}
|
|
1383
2142
|
|
|
1384
2143
|
// src/components/ui/Panel.tsx
|
|
1385
|
-
var
|
|
2144
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1386
2145
|
function Panel(_a) {
|
|
1387
2146
|
var _b = _a, { title, description, children, className } = _b, props = __objRest(_b, ["title", "description", "children", "className"]);
|
|
1388
|
-
return /* @__PURE__ */ (0,
|
|
1389
|
-
title && /* @__PURE__ */ (0,
|
|
1390
|
-
description && /* @__PURE__ */ (0,
|
|
2147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-panel", className) }, props), { children: [
|
|
2148
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h3", { className: "text-sm font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
|
|
2149
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
1391
2150
|
children
|
|
1392
2151
|
] }));
|
|
1393
2152
|
}
|
|
1394
2153
|
|
|
1395
2154
|
// src/components/ui/Rating.tsx
|
|
1396
|
-
var
|
|
2155
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1397
2156
|
function Rating(_a) {
|
|
1398
2157
|
var _b = _a, {
|
|
1399
2158
|
label,
|
|
@@ -1413,9 +2172,9 @@ function Rating(_a) {
|
|
|
1413
2172
|
"wrapperClassName"
|
|
1414
2173
|
]);
|
|
1415
2174
|
const stars = Array.from({ length: max }, (_, index) => index + 1);
|
|
1416
|
-
return /* @__PURE__ */ (0,
|
|
1417
|
-
label && /* @__PURE__ */ (0,
|
|
1418
|
-
/* @__PURE__ */ (0,
|
|
2175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2176
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ph-label", children: label }),
|
|
2177
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1419
2178
|
"div",
|
|
1420
2179
|
__spreadProps(__spreadValues({
|
|
1421
2180
|
className: cn("ph-rating flex", className),
|
|
@@ -1425,7 +2184,7 @@ function Rating(_a) {
|
|
|
1425
2184
|
children: stars.map((star) => {
|
|
1426
2185
|
const active = star <= value;
|
|
1427
2186
|
if (readOnly) {
|
|
1428
|
-
return /* @__PURE__ */ (0,
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1429
2188
|
IconStar,
|
|
1430
2189
|
{
|
|
1431
2190
|
className: cn("h-6 w-6", active ? "text-amber-500" : "text-ph-border"),
|
|
@@ -1434,7 +2193,7 @@ function Rating(_a) {
|
|
|
1434
2193
|
star
|
|
1435
2194
|
);
|
|
1436
2195
|
}
|
|
1437
|
-
return /* @__PURE__ */ (0,
|
|
2196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1438
2197
|
"button",
|
|
1439
2198
|
{
|
|
1440
2199
|
type: "button",
|
|
@@ -1443,7 +2202,7 @@ function Rating(_a) {
|
|
|
1443
2202
|
"aria-checked": active,
|
|
1444
2203
|
"aria-label": `${star} out of ${max}`,
|
|
1445
2204
|
onClick: () => onChange == null ? void 0 : onChange(star),
|
|
1446
|
-
children: /* @__PURE__ */ (0,
|
|
2205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconStar, { className: cn("h-6 w-6", active ? "text-amber-500" : "text-ph-border") })
|
|
1447
2206
|
},
|
|
1448
2207
|
star
|
|
1449
2208
|
);
|
|
@@ -1454,8 +2213,8 @@ function Rating(_a) {
|
|
|
1454
2213
|
}
|
|
1455
2214
|
|
|
1456
2215
|
// src/components/ui/SearchInput.tsx
|
|
1457
|
-
var
|
|
1458
|
-
var
|
|
2216
|
+
var import_react12 = require("react");
|
|
2217
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1459
2218
|
function SearchInput(_a) {
|
|
1460
2219
|
var _b = _a, {
|
|
1461
2220
|
id: idProp,
|
|
@@ -1476,12 +2235,12 @@ function SearchInput(_a) {
|
|
|
1476
2235
|
"wrapperClassName",
|
|
1477
2236
|
"placeholder"
|
|
1478
2237
|
]);
|
|
1479
|
-
const autoId = (0,
|
|
2238
|
+
const autoId = (0, import_react12.useId)();
|
|
1480
2239
|
const id = idProp != null ? idProp : autoId;
|
|
1481
|
-
return /* @__PURE__ */ (0,
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1483
|
-
/* @__PURE__ */ (0,
|
|
1484
|
-
shortcut != null ? /* @__PURE__ */ (0,
|
|
2240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("relative", wrapperClassName), children: [
|
|
2241
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: id, className: hideLabel ? "sr-only" : "ph-label mb-1.5 block", children: label }),
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", children: [
|
|
2243
|
+
shortcut != null ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1485
2244
|
"span",
|
|
1486
2245
|
{
|
|
1487
2246
|
className: "ph-shortcut pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-xs",
|
|
@@ -1489,7 +2248,7 @@ function SearchInput(_a) {
|
|
|
1489
2248
|
children: shortcut
|
|
1490
2249
|
}
|
|
1491
2250
|
) : null,
|
|
1492
|
-
/* @__PURE__ */ (0,
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1493
2252
|
"input",
|
|
1494
2253
|
__spreadValues({
|
|
1495
2254
|
id,
|
|
@@ -1523,12 +2282,12 @@ function SearchGroup(_a) {
|
|
|
1523
2282
|
"wrapperClassName",
|
|
1524
2283
|
"className"
|
|
1525
2284
|
]);
|
|
1526
|
-
const autoId = (0,
|
|
2285
|
+
const autoId = (0, import_react12.useId)();
|
|
1527
2286
|
const id = idProp != null ? idProp : autoId;
|
|
1528
|
-
return /* @__PURE__ */ (0,
|
|
1529
|
-
/* @__PURE__ */ (0,
|
|
1530
|
-
/* @__PURE__ */ (0,
|
|
1531
|
-
/* @__PURE__ */ (0,
|
|
2287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
2289
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "ph-search-group flex w-full max-w-lg min-h-[2.3125rem] items-stretch divide-x divide-ph-border", children: [
|
|
2290
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1532
2291
|
"input",
|
|
1533
2292
|
__spreadValues({
|
|
1534
2293
|
id,
|
|
@@ -1537,12 +2296,12 @@ function SearchGroup(_a) {
|
|
|
1537
2296
|
className: cn("ph-input ph-input-group-field min-w-0 flex-1", className)
|
|
1538
2297
|
}, props)
|
|
1539
2298
|
),
|
|
1540
|
-
/* @__PURE__ */ (0,
|
|
2299
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1541
2300
|
Button,
|
|
1542
2301
|
{
|
|
1543
2302
|
type: "submit",
|
|
1544
2303
|
variant: "primary",
|
|
1545
|
-
icon: /* @__PURE__ */ (0,
|
|
2304
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(IconSearch, { className: "h-4 w-4", "aria-hidden": true }),
|
|
1546
2305
|
className: "ph-search-group__submit",
|
|
1547
2306
|
"aria-label": submitLabel
|
|
1548
2307
|
}
|
|
@@ -1552,7 +2311,7 @@ function SearchGroup(_a) {
|
|
|
1552
2311
|
}
|
|
1553
2312
|
|
|
1554
2313
|
// src/components/ui/Table.tsx
|
|
1555
|
-
var
|
|
2314
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1556
2315
|
function Table({
|
|
1557
2316
|
data,
|
|
1558
2317
|
columns,
|
|
@@ -1563,15 +2322,15 @@ function Table({
|
|
|
1563
2322
|
className,
|
|
1564
2323
|
caption
|
|
1565
2324
|
}) {
|
|
1566
|
-
return /* @__PURE__ */ (0,
|
|
1567
|
-
caption && /* @__PURE__ */ (0,
|
|
1568
|
-
/* @__PURE__ */ (0,
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
2325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn("ph-table-wrap", compact && "ph-table-compact", className), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("table", { className: cn("ph-table", zebra && "ph-table-zebra", ribbon && "ph-table--ribbon"), children: [
|
|
2326
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("caption", { className: "sr-only", children: caption }),
|
|
2327
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: col.className, children: col.header }, col.key)) }) }),
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", { children: data.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { style: getRowStyle == null ? void 0 : getRowStyle(row), children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: col.className, children: col.cell(row) }, col.key)) }, i)) })
|
|
1570
2329
|
] }) });
|
|
1571
2330
|
}
|
|
1572
2331
|
|
|
1573
2332
|
// src/components/ui/Stat.tsx
|
|
1574
|
-
var
|
|
2333
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1575
2334
|
var toneMap = {
|
|
1576
2335
|
default: "text-ph-ink",
|
|
1577
2336
|
brand: "text-ph-brand",
|
|
@@ -1588,16 +2347,16 @@ var statMap = {
|
|
|
1588
2347
|
};
|
|
1589
2348
|
function Stat(_a) {
|
|
1590
2349
|
var _b = _a, { icon, label, value, footer, tone = "default", className } = _b, props = __objRest(_b, ["icon", "label", "value", "footer", "tone", "className"]);
|
|
1591
|
-
return /* @__PURE__ */ (0,
|
|
1592
|
-
icon && /* @__PURE__ */ (0,
|
|
1593
|
-
/* @__PURE__ */ (0,
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
footer && /* @__PURE__ */ (0,
|
|
2350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-stat", statMap[tone], className) }, props), { children: [
|
|
2351
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("mb-2 h-7 w-7", toneMap[tone]), children: icon }),
|
|
2352
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("ph-stat-label", tone === "warning" && toneMap[tone]), children: label }),
|
|
2353
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("ph-stat-val", toneMap[tone]), children: value }),
|
|
2354
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-ph-subtle", children: footer })
|
|
1596
2355
|
] }));
|
|
1597
2356
|
}
|
|
1598
2357
|
|
|
1599
2358
|
// src/components/ui/Toast.tsx
|
|
1600
|
-
var
|
|
2359
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1601
2360
|
var statusConfig2 = {
|
|
1602
2361
|
info: { icon: IconErrorOutline, color: "text-ph-info", bg: "ph-toast-info" },
|
|
1603
2362
|
success: { icon: IconCheckCircle, color: "text-ph-success", bg: "ph-toast-success" },
|
|
@@ -1613,33 +2372,33 @@ function Toast({
|
|
|
1613
2372
|
}) {
|
|
1614
2373
|
const config = statusConfig2[status];
|
|
1615
2374
|
const Icon = config.icon;
|
|
1616
|
-
return /* @__PURE__ */ (0,
|
|
1617
|
-
/* @__PURE__ */ (0,
|
|
1618
|
-
/* @__PURE__ */ (0,
|
|
1619
|
-
/* @__PURE__ */ (0,
|
|
1620
|
-
description && /* @__PURE__ */ (0,
|
|
2375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("ph-toast", config.bg, className), children: [
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { className: cn("mt-0.5 h-5 w-5 shrink-0", config.color), "aria-hidden": true }),
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "pr-8", children: [
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "font-semibold", children: title }),
|
|
2379
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: description })
|
|
1621
2380
|
] }),
|
|
1622
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
2381
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1623
2382
|
"button",
|
|
1624
2383
|
{
|
|
1625
2384
|
type: "button",
|
|
1626
2385
|
"aria-label": `Dismiss ${title}`,
|
|
1627
2386
|
className: "absolute right-2 top-2 ph-btn ph-btn-ghost ph-btn-xs ph-btn-circle",
|
|
1628
2387
|
onClick: onDismiss,
|
|
1629
|
-
children: /* @__PURE__ */ (0,
|
|
2388
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconClose, { className: "h-4 w-4" })
|
|
1630
2389
|
}
|
|
1631
2390
|
)
|
|
1632
2391
|
] });
|
|
1633
2392
|
}
|
|
1634
2393
|
function ToastStack({ children, className }) {
|
|
1635
|
-
return /* @__PURE__ */ (0,
|
|
2394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("ph-toast-stack", className), children });
|
|
1636
2395
|
}
|
|
1637
2396
|
|
|
1638
2397
|
// src/components/ui/Tabs.tsx
|
|
1639
|
-
var
|
|
2398
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1640
2399
|
function Tabs({ items, value, onChange, variant = "pill", className }) {
|
|
1641
2400
|
if (variant === "underline") {
|
|
1642
|
-
return /* @__PURE__ */ (0,
|
|
2401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cn("flex gap-6 border-b border-ph-border", className), children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1643
2402
|
"button",
|
|
1644
2403
|
{
|
|
1645
2404
|
type: "button",
|
|
@@ -1653,7 +2412,7 @@ function Tabs({ items, value, onChange, variant = "pill", className }) {
|
|
|
1653
2412
|
item.value
|
|
1654
2413
|
)) });
|
|
1655
2414
|
}
|
|
1656
|
-
return /* @__PURE__ */ (0,
|
|
2415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cn("ph-tabs-row inline-flex", className), children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1657
2416
|
"button",
|
|
1658
2417
|
{
|
|
1659
2418
|
type: "button",
|
|
@@ -1666,7 +2425,7 @@ function Tabs({ items, value, onChange, variant = "pill", className }) {
|
|
|
1666
2425
|
}
|
|
1667
2426
|
|
|
1668
2427
|
// src/components/ui/ThemeDomSync.tsx
|
|
1669
|
-
var
|
|
2428
|
+
var import_react13 = require("react");
|
|
1670
2429
|
|
|
1671
2430
|
// src/themes/registry.ts
|
|
1672
2431
|
var DEFAULT_THEME_ID = "hedgehog-light";
|
|
@@ -1838,6 +2597,48 @@ var THEMES = [
|
|
|
1838
2597
|
description: "Ros\xE9 Pine Main \u2014 moonlit base with iris and love accents.",
|
|
1839
2598
|
colorScheme: "dark",
|
|
1840
2599
|
group: "Ros\xE9 Pine"
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
id: "notion",
|
|
2603
|
+
name: "Notion",
|
|
2604
|
+
description: "Notion light \u2014 warm off-white canvas, Notion blue accent, signature dark text.",
|
|
2605
|
+
colorScheme: "light",
|
|
2606
|
+
group: "Productivity"
|
|
2607
|
+
},
|
|
2608
|
+
{
|
|
2609
|
+
id: "notion-dark",
|
|
2610
|
+
name: "Notion Dark",
|
|
2611
|
+
description: "Notion dark mode \u2014 dark charcoal canvas with blue accent and clean typography.",
|
|
2612
|
+
colorScheme: "dark",
|
|
2613
|
+
group: "Productivity"
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
id: "deepsea-light",
|
|
2617
|
+
name: "Tokyo Night Day",
|
|
2618
|
+
description: "Tokyo Night Day \u2014 soft bluish greys with vivid blue and purple accents.",
|
|
2619
|
+
colorScheme: "light",
|
|
2620
|
+
group: "Tokyo Night"
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
id: "deepsea-dark",
|
|
2624
|
+
name: "Tokyo Night",
|
|
2625
|
+
description: "Tokyo Night \u2014 #1a1b26 base with signature blue, cyan, and purple.",
|
|
2626
|
+
colorScheme: "dark",
|
|
2627
|
+
group: "Tokyo Night"
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
id: "kraken-light",
|
|
2631
|
+
name: "Kraken Light",
|
|
2632
|
+
description: "Medium-inspired warm paper, editorial black actions, and classic publication yellow.",
|
|
2633
|
+
colorScheme: "light",
|
|
2634
|
+
group: "Kraken"
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
id: "kraken-dark",
|
|
2638
|
+
name: "Kraken Dark",
|
|
2639
|
+
description: "Medium-inspired night reading canvas with white actions and classic publication yellow.",
|
|
2640
|
+
colorScheme: "dark",
|
|
2641
|
+
group: "Kraken"
|
|
1841
2642
|
}
|
|
1842
2643
|
];
|
|
1843
2644
|
var THEME_GROUPS = Array.from(new Set(THEMES.map((theme) => theme.group)));
|
|
@@ -1875,35 +2676,35 @@ function readStoredTheme() {
|
|
|
1875
2676
|
|
|
1876
2677
|
// src/components/ui/ThemeDomSync.tsx
|
|
1877
2678
|
function ThemeDomSync() {
|
|
1878
|
-
(0,
|
|
2679
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
1879
2680
|
persistTheme(readStoredTheme());
|
|
1880
2681
|
}, []);
|
|
1881
2682
|
return null;
|
|
1882
2683
|
}
|
|
1883
2684
|
|
|
1884
2685
|
// src/components/ui/ThemeManager.tsx
|
|
1885
|
-
var
|
|
1886
|
-
var
|
|
2686
|
+
var import_react14 = require("react");
|
|
2687
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1887
2688
|
function ThemeManager({ children }) {
|
|
1888
|
-
(0,
|
|
2689
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
1889
2690
|
persistTheme(readStoredTheme());
|
|
1890
2691
|
}, []);
|
|
1891
|
-
return /* @__PURE__ */ (0,
|
|
2692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children });
|
|
1892
2693
|
}
|
|
1893
2694
|
|
|
1894
2695
|
// src/components/ui/ThemeSwitcher.tsx
|
|
1895
|
-
var
|
|
1896
|
-
var
|
|
2696
|
+
var import_react15 = require("react");
|
|
2697
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1897
2698
|
function ThemeSwitcher({ className }) {
|
|
1898
|
-
const [themeId, setThemeId] = (0,
|
|
1899
|
-
(0,
|
|
2699
|
+
const [themeId, setThemeId] = (0, import_react15.useState)("hedgehog-light");
|
|
2700
|
+
(0, import_react15.useEffect)(() => {
|
|
1900
2701
|
const id = readStoredTheme();
|
|
1901
2702
|
persistTheme(id);
|
|
1902
2703
|
setThemeId(id);
|
|
1903
2704
|
}, []);
|
|
1904
|
-
return /* @__PURE__ */ (0,
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
2705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: cn("flex min-w-0 items-center gap-2", className), children: [
|
|
2706
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "shrink-0 text-xs font-medium text-ph-mutedtext sm:text-sm", children: "Theme" }),
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1907
2708
|
"select",
|
|
1908
2709
|
{
|
|
1909
2710
|
className: "ph-select max-w-[11rem] !min-h-[2rem] py-1 pl-2.5 pr-8 text-xs sm:max-w-[14rem] sm:text-sm",
|
|
@@ -1914,22 +2715,22 @@ function ThemeSwitcher({ className }) {
|
|
|
1914
2715
|
persistTheme(next);
|
|
1915
2716
|
setThemeId(next);
|
|
1916
2717
|
},
|
|
1917
|
-
children: THEME_GROUPS.map((group) => /* @__PURE__ */ (0,
|
|
2718
|
+
children: THEME_GROUPS.map((group) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("optgroup", { label: group, children: THEMES.filter((theme) => theme.group === group).map((theme) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("option", { value: theme.id, children: theme.name }, theme.id)) }, group))
|
|
1918
2719
|
}
|
|
1919
2720
|
)
|
|
1920
2721
|
] });
|
|
1921
2722
|
}
|
|
1922
2723
|
|
|
1923
2724
|
// src/components/ui/Accordion.tsx
|
|
1924
|
-
var
|
|
1925
|
-
var
|
|
2725
|
+
var import_react16 = require("react");
|
|
2726
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1926
2727
|
function Accordion({
|
|
1927
2728
|
items,
|
|
1928
2729
|
allowMultiple = false,
|
|
1929
2730
|
defaultOpen = [],
|
|
1930
2731
|
className
|
|
1931
2732
|
}) {
|
|
1932
|
-
const [openItems, setOpenItems] = (0,
|
|
2733
|
+
const [openItems, setOpenItems] = (0, import_react16.useState)(new Set(defaultOpen));
|
|
1933
2734
|
const toggleItem = (id) => {
|
|
1934
2735
|
setOpenItems((prev) => {
|
|
1935
2736
|
const next = new Set(prev);
|
|
@@ -1944,18 +2745,18 @@ function Accordion({
|
|
|
1944
2745
|
return next;
|
|
1945
2746
|
});
|
|
1946
2747
|
};
|
|
1947
|
-
return /* @__PURE__ */ (0,
|
|
2748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("divide-y divide-ph-border rounded-xl border border-ph-border bg-ph-surface", className), children: items.map((item) => {
|
|
1948
2749
|
const isOpen = openItems.has(item.id);
|
|
1949
|
-
return /* @__PURE__ */ (0,
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "first:rounded-t-xl last:rounded-b-xl", children: [
|
|
2751
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1951
2752
|
"button",
|
|
1952
2753
|
{
|
|
1953
2754
|
type: "button",
|
|
1954
2755
|
onClick: () => toggleItem(item.id),
|
|
1955
2756
|
className: "flex w-full items-center justify-between px-5 py-4 text-left transition hover:bg-ph-muted",
|
|
1956
2757
|
children: [
|
|
1957
|
-
/* @__PURE__ */ (0,
|
|
1958
|
-
/* @__PURE__ */ (0,
|
|
2758
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-semibold text-ph-ink", children: item.title }),
|
|
2759
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1959
2760
|
IconChevronDown,
|
|
1960
2761
|
{
|
|
1961
2762
|
className: cn(
|
|
@@ -1967,14 +2768,14 @@ function Accordion({
|
|
|
1967
2768
|
]
|
|
1968
2769
|
}
|
|
1969
2770
|
),
|
|
1970
|
-
/* @__PURE__ */ (0,
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1971
2772
|
"div",
|
|
1972
2773
|
{
|
|
1973
2774
|
className: cn(
|
|
1974
2775
|
"grid transition-all duration-200",
|
|
1975
2776
|
isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
1976
2777
|
),
|
|
1977
|
-
children: /* @__PURE__ */ (0,
|
|
2778
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "px-5 pb-4 text-ph-subtle", children: item.content }) })
|
|
1978
2779
|
}
|
|
1979
2780
|
)
|
|
1980
2781
|
] }, item.id);
|
|
@@ -1982,30 +2783,30 @@ function Accordion({
|
|
|
1982
2783
|
}
|
|
1983
2784
|
|
|
1984
2785
|
// src/components/ui/Stepper.tsx
|
|
1985
|
-
var
|
|
2786
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1986
2787
|
function Stepper({ steps, currentStep, className }) {
|
|
1987
|
-
return /* @__PURE__ */ (0,
|
|
2788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("flex items-start gap-2", className), children: steps.map((step, index) => {
|
|
1988
2789
|
const isCompleted = index < currentStep;
|
|
1989
2790
|
const isCurrent = index === currentStep;
|
|
1990
2791
|
const isPending = index > currentStep;
|
|
1991
2792
|
const isError = step.status === "error";
|
|
1992
|
-
return /* @__PURE__ */ (0,
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
1994
|
-
/* @__PURE__ */ (0,
|
|
2793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-1 flex-col items-center", children: [
|
|
2795
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1995
2796
|
"div",
|
|
1996
2797
|
{
|
|
1997
2798
|
className: cn(
|
|
1998
2799
|
"flex h-9 w-9 items-center justify-center rounded-full text-sm font-bold transition-colors",
|
|
1999
|
-
isCompleted && "bg-ph-success text-
|
|
2000
|
-
isCurrent && !isError && "bg-ph-brand text-
|
|
2001
|
-
isCurrent && isError && "bg-ph-danger text-
|
|
2800
|
+
isCompleted && "bg-ph-success text-[var(--ph-on-success)]",
|
|
2801
|
+
isCurrent && !isError && "bg-ph-brand text-[var(--ph-on-accent)] ring-4 ring-ph-brand/20",
|
|
2802
|
+
isCurrent && isError && "bg-ph-danger text-[var(--ph-on-danger)]",
|
|
2002
2803
|
isPending && "bg-ph-muted text-ph-mutedtext"
|
|
2003
2804
|
),
|
|
2004
|
-
children: isCompleted ? /* @__PURE__ */ (0,
|
|
2805
|
+
children: isCompleted ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IconCheck, { className: "h-5 w-5", "aria-hidden": true }) : index + 1
|
|
2005
2806
|
}
|
|
2006
2807
|
),
|
|
2007
|
-
/* @__PURE__ */ (0,
|
|
2008
|
-
/* @__PURE__ */ (0,
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "mt-2 text-center", children: [
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2009
2810
|
"p",
|
|
2010
2811
|
{
|
|
2011
2812
|
className: cn(
|
|
@@ -2016,10 +2817,10 @@ function Stepper({ steps, currentStep, className }) {
|
|
|
2016
2817
|
children: step.label
|
|
2017
2818
|
}
|
|
2018
2819
|
),
|
|
2019
|
-
step.description && /* @__PURE__ */ (0,
|
|
2820
|
+
step.description && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "mt-0.5 text-xs text-ph-mutedtext", children: step.description })
|
|
2020
2821
|
] })
|
|
2021
2822
|
] }),
|
|
2022
|
-
index < steps.length - 1 && /* @__PURE__ */ (0,
|
|
2823
|
+
index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2023
2824
|
"div",
|
|
2024
2825
|
{
|
|
2025
2826
|
className: cn(
|
|
@@ -2033,16 +2834,16 @@ function Stepper({ steps, currentStep, className }) {
|
|
|
2033
2834
|
}
|
|
2034
2835
|
|
|
2035
2836
|
// src/components/ui/SegmentedControl.tsx
|
|
2036
|
-
var
|
|
2837
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2037
2838
|
function SegmentedControl({ options, value, onChange, className }) {
|
|
2038
|
-
return /* @__PURE__ */ (0,
|
|
2839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2039
2840
|
"div",
|
|
2040
2841
|
{
|
|
2041
2842
|
className: cn(
|
|
2042
2843
|
"inline-flex rounded-lg bg-ph-muted p-1",
|
|
2043
2844
|
className
|
|
2044
2845
|
),
|
|
2045
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
2846
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2046
2847
|
"button",
|
|
2047
2848
|
{
|
|
2048
2849
|
type: "button",
|
|
@@ -2052,7 +2853,7 @@ function SegmentedControl({ options, value, onChange, className }) {
|
|
|
2052
2853
|
value === option.value ? "bg-ph-surface text-ph-ink shadow-ph" : "text-ph-subtle hover:text-ph-ink"
|
|
2053
2854
|
),
|
|
2054
2855
|
children: [
|
|
2055
|
-
option.icon && /* @__PURE__ */ (0,
|
|
2856
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "h-4 w-4", children: option.icon }),
|
|
2056
2857
|
option.label
|
|
2057
2858
|
]
|
|
2058
2859
|
},
|
|
@@ -2063,8 +2864,8 @@ function SegmentedControl({ options, value, onChange, className }) {
|
|
|
2063
2864
|
}
|
|
2064
2865
|
|
|
2065
2866
|
// src/components/ui/CommandPalette.tsx
|
|
2066
|
-
var
|
|
2067
|
-
var
|
|
2867
|
+
var import_react17 = require("react");
|
|
2868
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2068
2869
|
function CommandPalette({
|
|
2069
2870
|
items,
|
|
2070
2871
|
isOpen,
|
|
@@ -2072,13 +2873,13 @@ function CommandPalette({
|
|
|
2072
2873
|
placeholder = "Type a command or search...",
|
|
2073
2874
|
className
|
|
2074
2875
|
}) {
|
|
2075
|
-
const [query, setQuery] = (0,
|
|
2076
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
2077
|
-
const inputRef = (0,
|
|
2876
|
+
const [query, setQuery] = (0, import_react17.useState)("");
|
|
2877
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
2878
|
+
const inputRef = (0, import_react17.useRef)(null);
|
|
2078
2879
|
const filtered = items.filter(
|
|
2079
2880
|
(item) => item.label.toLowerCase().includes(query.toLowerCase())
|
|
2080
2881
|
);
|
|
2081
|
-
(0,
|
|
2882
|
+
(0, import_react17.useEffect)(() => {
|
|
2082
2883
|
var _a;
|
|
2083
2884
|
if (isOpen) {
|
|
2084
2885
|
setQuery("");
|
|
@@ -2086,7 +2887,7 @@ function CommandPalette({
|
|
|
2086
2887
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2087
2888
|
}
|
|
2088
2889
|
}, [isOpen]);
|
|
2089
|
-
(0,
|
|
2890
|
+
(0, import_react17.useEffect)(() => {
|
|
2090
2891
|
const handleKeyDown = (e) => {
|
|
2091
2892
|
var _a;
|
|
2092
2893
|
if (!isOpen) return;
|
|
@@ -2113,7 +2914,7 @@ function CommandPalette({
|
|
|
2113
2914
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2114
2915
|
}, [isOpen, filtered, selectedIndex, onClose]);
|
|
2115
2916
|
if (!isOpen) return null;
|
|
2116
|
-
return /* @__PURE__ */ (0,
|
|
2917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-[20vh] backdrop-blur-sm", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2117
2918
|
"div",
|
|
2118
2919
|
{
|
|
2119
2920
|
className: cn(
|
|
@@ -2121,9 +2922,9 @@ function CommandPalette({
|
|
|
2121
2922
|
className
|
|
2122
2923
|
),
|
|
2123
2924
|
children: [
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2126
|
-
/* @__PURE__ */ (0,
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-3 border-b border-ph-border px-4 py-3", children: [
|
|
2926
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconSearch, { className: "h-5 w-5 text-ph-mutedtext" }),
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2127
2928
|
"input",
|
|
2128
2929
|
{
|
|
2129
2930
|
ref: inputRef,
|
|
@@ -2137,9 +2938,9 @@ function CommandPalette({
|
|
|
2137
2938
|
className: "flex-1 bg-transparent text-ph-ink outline-none placeholder:text-ph-mutedtext"
|
|
2138
2939
|
}
|
|
2139
2940
|
),
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2941
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("kbd", { className: "rounded border border-ph-border bg-ph-muted px-1.5 py-0.5 text-xs text-ph-mutedtext", children: "ESC" })
|
|
2141
2942
|
] }),
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "max-h-[50vh] overflow-y-auto py-2", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "px-4 py-8 text-center text-sm text-ph-mutedtext", children: "No results found." }) : filtered.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2143
2944
|
"button",
|
|
2144
2945
|
{
|
|
2145
2946
|
type: "button",
|
|
@@ -2153,9 +2954,9 @@ function CommandPalette({
|
|
|
2153
2954
|
index === selectedIndex ? "bg-ph-muted text-ph-ink" : "text-ph-subtle"
|
|
2154
2955
|
),
|
|
2155
2956
|
children: [
|
|
2156
|
-
item.icon && /* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
item.shortcut && /* @__PURE__ */ (0,
|
|
2957
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "h-5 w-5", children: item.icon }),
|
|
2958
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex-1", children: item.label }),
|
|
2959
|
+
item.shortcut && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("kbd", { className: "rounded border border-ph-border bg-ph-surface px-1.5 py-0.5 text-xs text-ph-mutedtext", children: item.shortcut })
|
|
2159
2960
|
]
|
|
2160
2961
|
},
|
|
2161
2962
|
item.id
|
|
@@ -2166,10 +2967,10 @@ function CommandPalette({
|
|
|
2166
2967
|
}
|
|
2167
2968
|
|
|
2168
2969
|
// src/components/ui/Calendar.tsx
|
|
2169
|
-
var
|
|
2170
|
-
var
|
|
2970
|
+
var import_react18 = require("react");
|
|
2971
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2171
2972
|
function Calendar({ value, onChange, className }) {
|
|
2172
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
2973
|
+
const [currentMonth, setCurrentMonth] = (0, import_react18.useState)(value || /* @__PURE__ */ new Date());
|
|
2173
2974
|
const today = /* @__PURE__ */ new Date();
|
|
2174
2975
|
const year = currentMonth.getFullYear();
|
|
2175
2976
|
const month = currentMonth.getMonth();
|
|
@@ -2209,42 +3010,44 @@ function Calendar({ value, onChange, className }) {
|
|
|
2209
3010
|
for (let i = 1; i <= daysInMonth; i++) {
|
|
2210
3011
|
days.push(i);
|
|
2211
3012
|
}
|
|
2212
|
-
return /* @__PURE__ */ (0,
|
|
2213
|
-
/* @__PURE__ */ (0,
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
3013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("w-[280px] rounded-xl border border-ph-border bg-ph-surface p-4 shadow-ph", className), children: [
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
3015
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2215
3016
|
"button",
|
|
2216
3017
|
{
|
|
2217
3018
|
type: "button",
|
|
2218
3019
|
onClick: prevMonth,
|
|
3020
|
+
"aria-label": "Previous month",
|
|
2219
3021
|
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2220
|
-
children: /* @__PURE__ */ (0,
|
|
3022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(IconChevronLeft, { className: "h-5 w-5", "aria-hidden": true })
|
|
2221
3023
|
}
|
|
2222
3024
|
),
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
3025
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-sm font-semibold text-ph-ink", children: [
|
|
2224
3026
|
monthNames[month],
|
|
2225
3027
|
" ",
|
|
2226
3028
|
year
|
|
2227
3029
|
] }),
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
3030
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2229
3031
|
"button",
|
|
2230
3032
|
{
|
|
2231
3033
|
type: "button",
|
|
2232
3034
|
onClick: nextMonth,
|
|
3035
|
+
"aria-label": "Next month",
|
|
2233
3036
|
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2234
|
-
children: /* @__PURE__ */ (0,
|
|
3037
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(IconChevronRight, { className: "h-5 w-5", "aria-hidden": true })
|
|
2235
3038
|
}
|
|
2236
3039
|
)
|
|
2237
3040
|
] }),
|
|
2238
|
-
/* @__PURE__ */ (0,
|
|
2239
|
-
weekDays.map((day) => /* @__PURE__ */ (0,
|
|
2240
|
-
days.map((day, index) => /* @__PURE__ */ (0,
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "grid grid-cols-7 gap-1", children: [
|
|
3042
|
+
weekDays.map((day) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "py-1 text-center text-xs font-medium text-ph-mutedtext", children: day }, day)),
|
|
3043
|
+
days.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "aspect-square", children: day && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2241
3044
|
"button",
|
|
2242
3045
|
{
|
|
2243
3046
|
type: "button",
|
|
2244
3047
|
onClick: () => handleSelect(day),
|
|
2245
3048
|
className: cn(
|
|
2246
3049
|
"flex h-full w-full items-center justify-center rounded-lg text-sm transition-colors",
|
|
2247
|
-
isSelected(day) ? "bg-ph-brand font-semibold text-
|
|
3050
|
+
isSelected(day) ? "bg-ph-brand font-semibold text-[var(--ph-on-accent)] shadow-ph" : isToday(day) ? "bg-ph-muted font-semibold text-ph-brand ring-1 ring-ph-brand/30" : "text-ph-ink hover:bg-ph-muted"
|
|
2248
3051
|
),
|
|
2249
3052
|
children: day
|
|
2250
3053
|
}
|
|
@@ -2254,11 +3057,11 @@ function Calendar({ value, onChange, className }) {
|
|
|
2254
3057
|
}
|
|
2255
3058
|
|
|
2256
3059
|
// src/components/ui/HoverCard.tsx
|
|
2257
|
-
var
|
|
2258
|
-
var
|
|
3060
|
+
var import_react19 = require("react");
|
|
3061
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2259
3062
|
function HoverCard({ trigger, children, className }) {
|
|
2260
|
-
const [isVisible, setIsVisible] = (0,
|
|
2261
|
-
return /* @__PURE__ */ (0,
|
|
3063
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
3064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2262
3065
|
"div",
|
|
2263
3066
|
{
|
|
2264
3067
|
className: "relative inline-block",
|
|
@@ -2266,7 +3069,7 @@ function HoverCard({ trigger, children, className }) {
|
|
|
2266
3069
|
onMouseLeave: () => setIsVisible(false),
|
|
2267
3070
|
children: [
|
|
2268
3071
|
trigger,
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2270
3073
|
"div",
|
|
2271
3074
|
{
|
|
2272
3075
|
className: cn(
|
|
@@ -2275,8 +3078,8 @@ function HoverCard({ trigger, children, className }) {
|
|
|
2275
3078
|
className
|
|
2276
3079
|
),
|
|
2277
3080
|
children: [
|
|
2278
|
-
/* @__PURE__ */ (0,
|
|
2279
|
-
/* @__PURE__ */ (0,
|
|
3081
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "absolute -top-1.5 left-1/2 h-3 w-3 -translate-x-1/2 rotate-45 border-l border-t border-ph-border bg-ph-surface" }),
|
|
3082
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "relative", children })
|
|
2280
3083
|
]
|
|
2281
3084
|
}
|
|
2282
3085
|
)
|
|
@@ -2286,9 +3089,9 @@ function HoverCard({ trigger, children, className }) {
|
|
|
2286
3089
|
}
|
|
2287
3090
|
|
|
2288
3091
|
// src/components/ui/EmptyState.tsx
|
|
2289
|
-
var
|
|
3092
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2290
3093
|
function EmptyState({ icon, title, description, action, className }) {
|
|
2291
|
-
return /* @__PURE__ */ (0,
|
|
3094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2292
3095
|
"div",
|
|
2293
3096
|
{
|
|
2294
3097
|
className: cn(
|
|
@@ -2296,67 +3099,226 @@ function EmptyState({ icon, title, description, action, className }) {
|
|
|
2296
3099
|
className
|
|
2297
3100
|
),
|
|
2298
3101
|
children: [
|
|
2299
|
-
icon && /* @__PURE__ */ (0,
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2301
|
-
description && /* @__PURE__ */ (0,
|
|
2302
|
-
action && /* @__PURE__ */ (0,
|
|
3102
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-ph-muted text-ph-mutedtext", children: icon }),
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "text-base font-semibold text-ph-ink", children: title }),
|
|
3104
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "mt-1 max-w-sm text-sm text-ph-subtle", children: description }),
|
|
3105
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mt-4", children: action })
|
|
2303
3106
|
]
|
|
2304
3107
|
}
|
|
2305
3108
|
);
|
|
2306
3109
|
}
|
|
2307
3110
|
|
|
2308
3111
|
// src/components/ui/FilterChips.tsx
|
|
2309
|
-
var
|
|
2310
|
-
function FilterChips({
|
|
2311
|
-
|
|
2312
|
-
|
|
3112
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3113
|
+
function FilterChips({
|
|
3114
|
+
chips,
|
|
3115
|
+
onToggle,
|
|
3116
|
+
onRemove,
|
|
3117
|
+
className,
|
|
3118
|
+
"aria-label": ariaLabel = "Applied filters"
|
|
3119
|
+
}) {
|
|
3120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn("ph-filter-chips", className), role: "group", "aria-label": ariaLabel, children: chips.map((chip) => {
|
|
3121
|
+
var _a;
|
|
3122
|
+
const label = (_a = chip.removeLabel) != null ? _a : getChipText(chip);
|
|
3123
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ph-filter-chip__label", children: chip.label }),
|
|
3125
|
+
chip.value != null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ph-filter-chip__value", children: chip.value }) : null
|
|
3126
|
+
] });
|
|
3127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3128
|
+
"span",
|
|
3129
|
+
{
|
|
3130
|
+
className: cn("ph-filter-chip", chip.active && "ph-filter-chip--active"),
|
|
3131
|
+
"data-state": chip.active ? "on" : "off",
|
|
3132
|
+
children: [
|
|
3133
|
+
onToggle ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3134
|
+
"button",
|
|
3135
|
+
{
|
|
3136
|
+
type: "button",
|
|
3137
|
+
className: "ph-filter-chip__main",
|
|
3138
|
+
"aria-pressed": Boolean(chip.active),
|
|
3139
|
+
onClick: () => onToggle(chip.id),
|
|
3140
|
+
children: content
|
|
3141
|
+
}
|
|
3142
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ph-filter-chip__main", children: content }),
|
|
3143
|
+
chip.active && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3144
|
+
"button",
|
|
3145
|
+
{
|
|
3146
|
+
type: "button",
|
|
3147
|
+
className: "ph-filter-chip__remove",
|
|
3148
|
+
"aria-label": `Remove ${label} filter`,
|
|
3149
|
+
onClick: () => onRemove(chip.id),
|
|
3150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(IconClose, { className: "h-3 w-3", "aria-hidden": true })
|
|
3151
|
+
}
|
|
3152
|
+
) : null
|
|
3153
|
+
]
|
|
3154
|
+
},
|
|
3155
|
+
chip.id
|
|
3156
|
+
);
|
|
3157
|
+
}) });
|
|
3158
|
+
}
|
|
3159
|
+
function getChipText(chip) {
|
|
3160
|
+
const label = typeof chip.label === "string" || typeof chip.label === "number" ? String(chip.label) : chip.id;
|
|
3161
|
+
const value = typeof chip.value === "string" || typeof chip.value === "number" ? String(chip.value) : null;
|
|
3162
|
+
return value ? `${label}: ${value}` : label;
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
// src/components/ui/FilterBar.tsx
|
|
3166
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3167
|
+
function FilterBar(_a) {
|
|
3168
|
+
var _b = _a, {
|
|
3169
|
+
children,
|
|
3170
|
+
label = "Filters and sorting",
|
|
3171
|
+
onClear,
|
|
3172
|
+
clearLabel = "Clear all",
|
|
3173
|
+
resultCount,
|
|
3174
|
+
className
|
|
3175
|
+
} = _b, props = __objRest(_b, [
|
|
3176
|
+
"children",
|
|
3177
|
+
"label",
|
|
3178
|
+
"onClear",
|
|
3179
|
+
"clearLabel",
|
|
3180
|
+
"resultCount",
|
|
3181
|
+
"className"
|
|
3182
|
+
]);
|
|
3183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-filter-bar", className) }, props), { children: [
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ph-filter-bar__controls", role: "group", "aria-label": label, children: [
|
|
3185
|
+
children,
|
|
3186
|
+
onClear ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", className: "ph-filter-bar__clear", onClick: onClear, children: clearLabel }) : null
|
|
3187
|
+
] }),
|
|
3188
|
+
resultCount != null ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("output", { className: "ph-filter-bar__results", "aria-live": "polite", children: resultCount }) : null
|
|
3189
|
+
] }));
|
|
3190
|
+
}
|
|
3191
|
+
function FilterMenu({
|
|
3192
|
+
label,
|
|
3193
|
+
value,
|
|
3194
|
+
options,
|
|
3195
|
+
onValueChange,
|
|
3196
|
+
placeholder = "Any",
|
|
3197
|
+
align = "start",
|
|
3198
|
+
disabled,
|
|
3199
|
+
className
|
|
3200
|
+
}) {
|
|
3201
|
+
var _a;
|
|
3202
|
+
const selected = options.find((option) => option.value === value);
|
|
3203
|
+
const displayValue = (_a = selected == null ? void 0 : selected.label) != null ? _a : placeholder;
|
|
3204
|
+
const accessibleValue = selected ? getOptionText(selected) : String(placeholder);
|
|
3205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3206
|
+
DropdownMenu,
|
|
2313
3207
|
{
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
3208
|
+
"aria-label": `${label}: ${accessibleValue}`,
|
|
3209
|
+
align,
|
|
3210
|
+
disabled,
|
|
3211
|
+
className,
|
|
3212
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: cn("ph-filter-menu-trigger", selected && "ph-filter-menu-trigger--active"), children: [
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(IconTuning, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
3214
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__value", children: displayValue })
|
|
3216
|
+
] }),
|
|
3217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3218
|
+
DropdownRadioItem,
|
|
3219
|
+
{
|
|
3220
|
+
value: option.value,
|
|
3221
|
+
textValue: getOptionText(option),
|
|
3222
|
+
disabled: option.disabled,
|
|
3223
|
+
children: option.label
|
|
3224
|
+
},
|
|
3225
|
+
option.value
|
|
3226
|
+
)) })
|
|
3227
|
+
}
|
|
3228
|
+
);
|
|
3229
|
+
}
|
|
3230
|
+
function SortMenu({
|
|
3231
|
+
label,
|
|
3232
|
+
value,
|
|
3233
|
+
options,
|
|
3234
|
+
onValueChange,
|
|
3235
|
+
direction = "descending",
|
|
3236
|
+
align = "end",
|
|
3237
|
+
disabled,
|
|
3238
|
+
className
|
|
3239
|
+
}) {
|
|
3240
|
+
const selected = options.find((option) => option.value === value);
|
|
3241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3242
|
+
DropdownMenu,
|
|
3243
|
+
{
|
|
3244
|
+
"aria-label": `${label}: ${selected ? getOptionText(selected) : "Choose sort order"}`,
|
|
3245
|
+
align,
|
|
3246
|
+
disabled,
|
|
3247
|
+
className,
|
|
3248
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "ph-filter-menu-trigger ph-sort-menu-trigger", children: [
|
|
3249
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3250
|
+
IconArrowDown,
|
|
2324
3251
|
{
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
onRemove(chip.id);
|
|
2328
|
-
},
|
|
2329
|
-
className: "ml-0.5 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full hover:bg-white/20",
|
|
2330
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconClose, { className: "h-3 w-3" })
|
|
3252
|
+
className: cn("h-3.5 w-3.5", direction === "ascending" && "rotate-180"),
|
|
3253
|
+
"aria-hidden": true
|
|
2331
3254
|
}
|
|
2332
|
-
)
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
3255
|
+
),
|
|
3256
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3257
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__value", children: selected.label }) : null
|
|
3258
|
+
] }),
|
|
3259
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3260
|
+
DropdownRadioItem,
|
|
3261
|
+
{
|
|
3262
|
+
value: option.value,
|
|
3263
|
+
textValue: getOptionText(option),
|
|
3264
|
+
disabled: option.disabled,
|
|
3265
|
+
children: option.label
|
|
3266
|
+
},
|
|
3267
|
+
option.value
|
|
3268
|
+
)) })
|
|
3269
|
+
}
|
|
3270
|
+
);
|
|
3271
|
+
}
|
|
3272
|
+
function getOptionText(option) {
|
|
3273
|
+
if (option.textValue) return option.textValue;
|
|
3274
|
+
if (typeof option.label === "string" || typeof option.label === "number") return String(option.label);
|
|
3275
|
+
return option.value;
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3278
|
+
// src/components/ui/FilterControls.tsx
|
|
3279
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3280
|
+
function FilterControls(_a) {
|
|
3281
|
+
var _b = _a, {
|
|
3282
|
+
children,
|
|
3283
|
+
barProps,
|
|
3284
|
+
chipsProps,
|
|
3285
|
+
emptyState,
|
|
3286
|
+
className
|
|
3287
|
+
} = _b, props = __objRest(_b, [
|
|
3288
|
+
"children",
|
|
3289
|
+
"barProps",
|
|
3290
|
+
"chipsProps",
|
|
3291
|
+
"emptyState",
|
|
3292
|
+
"className"
|
|
3293
|
+
]);
|
|
3294
|
+
const hasChips = Boolean(chipsProps == null ? void 0 : chipsProps.chips.length);
|
|
3295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-filter-controls", className) }, props), { children: [
|
|
3296
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterBar, __spreadProps(__spreadValues({}, barProps), { children })),
|
|
3297
|
+
hasChips && chipsProps ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterChips, __spreadValues({}, chipsProps)) : emptyState != null ? emptyState : null
|
|
3298
|
+
] }));
|
|
2337
3299
|
}
|
|
2338
3300
|
|
|
2339
3301
|
// src/components/ui/CodeBlock.tsx
|
|
2340
|
-
var
|
|
2341
|
-
var
|
|
3302
|
+
var import_react20 = require("react");
|
|
3303
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2342
3304
|
function CodeBlock({ code, language = "tsx", filename, className }) {
|
|
2343
|
-
const [copied, setCopied] = (0,
|
|
3305
|
+
const [copied, setCopied] = (0, import_react20.useState)(false);
|
|
2344
3306
|
const handleCopy = async () => {
|
|
2345
3307
|
await navigator.clipboard.writeText(code);
|
|
2346
3308
|
setCopied(true);
|
|
2347
3309
|
setTimeout(() => setCopied(false), 2e3);
|
|
2348
3310
|
};
|
|
2349
|
-
return /* @__PURE__ */ (0,
|
|
2350
|
-
(filename || language) && /* @__PURE__ */ (0,
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
2352
|
-
/* @__PURE__ */ (0,
|
|
2353
|
-
/* @__PURE__ */ (0,
|
|
2354
|
-
/* @__PURE__ */ (0,
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
3311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("overflow-hidden rounded-lg border border-ph-border bg-[#1a1a2e]", className), children: [
|
|
3312
|
+
(filename || language) && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between border-b border-white/10 px-4 py-2", children: [
|
|
3313
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex gap-1.5", children: [
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-3 w-3 rounded-full bg-red-400" }),
|
|
3316
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-3 w-3 rounded-full bg-amber-400" }),
|
|
3317
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-3 w-3 rounded-full bg-emerald-400" })
|
|
2356
3318
|
] }),
|
|
2357
|
-
filename && /* @__PURE__ */ (0,
|
|
3319
|
+
filename && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ml-2 text-xs text-white/60", children: filename })
|
|
2358
3320
|
] }),
|
|
2359
|
-
/* @__PURE__ */ (0,
|
|
3321
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2360
3322
|
"button",
|
|
2361
3323
|
{
|
|
2362
3324
|
type: "button",
|
|
@@ -2366,35 +3328,35 @@ function CodeBlock({ code, language = "tsx", filename, className }) {
|
|
|
2366
3328
|
}
|
|
2367
3329
|
)
|
|
2368
3330
|
] }),
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
3331
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("pre", { className: "overflow-x-auto p-4 text-sm leading-relaxed", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("code", { className: "font-mono text-[#e4e4e7]", children: code }) })
|
|
2370
3332
|
] });
|
|
2371
3333
|
}
|
|
2372
3334
|
|
|
2373
3335
|
// src/components/ui/ComponentDocs.tsx
|
|
2374
|
-
var
|
|
3336
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2375
3337
|
function ComponentDocs({ title = "Props & variants", rows, defaultOpen = false, className }) {
|
|
2376
|
-
return /* @__PURE__ */ (0,
|
|
2377
|
-
/* @__PURE__ */ (0,
|
|
2378
|
-
/* @__PURE__ */ (0,
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
2380
|
-
/* @__PURE__ */ (0,
|
|
2381
|
-
/* @__PURE__ */ (0,
|
|
3338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("details", { className: cn("ph-panel group overflow-hidden p-0", className), open: defaultOpen, children: [
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 border-b border-ph-border px-4 py-3 transition hover:bg-ph-muted/60 [&::-webkit-details-marker]:hidden", children: [
|
|
3340
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "text-xs font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
|
|
3341
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "rounded-full border border-ph-border bg-ph-surface px-2 py-1 text-[10px] font-semibold uppercase tracking-wider text-ph-mutedtext transition group-open:bg-ph-brand group-open:text-white", children: [
|
|
3342
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "group-open:hidden", children: "Show" }),
|
|
3343
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "hidden group-open:inline", children: "Hide" })
|
|
2382
3344
|
] })
|
|
2383
3345
|
] }),
|
|
2384
|
-
/* @__PURE__ */ (0,
|
|
2385
|
-
/* @__PURE__ */ (0,
|
|
2386
|
-
/* @__PURE__ */ (0,
|
|
2387
|
-
/* @__PURE__ */ (0,
|
|
2388
|
-
/* @__PURE__ */ (0,
|
|
2389
|
-
/* @__PURE__ */ (0,
|
|
3346
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "overflow-x-auto border-t border-ph-border", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("table", { className: "w-full text-left text-sm", children: [
|
|
3347
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("thead", { className: "bg-ph-muted text-xs uppercase tracking-wider text-ph-mutedtext", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("tr", { children: [
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Prop" }),
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Type" }),
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Default" }),
|
|
3351
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Use" })
|
|
2390
3352
|
] }) }),
|
|
2391
|
-
/* @__PURE__ */ (0,
|
|
3353
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("tbody", { className: "divide-y divide-ph-border", children: rows.map((row) => {
|
|
2392
3354
|
var _a;
|
|
2393
|
-
return /* @__PURE__ */ (0,
|
|
2394
|
-
/* @__PURE__ */ (0,
|
|
2395
|
-
/* @__PURE__ */ (0,
|
|
2396
|
-
/* @__PURE__ */ (0,
|
|
2397
|
-
/* @__PURE__ */ (0,
|
|
3355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("tr", { children: [
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-ink", children: row.name }),
|
|
3357
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: row.type }),
|
|
3358
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: (_a = row.defaultValue) != null ? _a : "-" }),
|
|
3359
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("td", { className: "px-4 py-3 align-top text-ph-subtle", children: row.description })
|
|
2398
3360
|
] }, row.name);
|
|
2399
3361
|
}) })
|
|
2400
3362
|
] }) })
|
|
@@ -2402,8 +3364,8 @@ function ComponentDocs({ title = "Props & variants", rows, defaultOpen = false,
|
|
|
2402
3364
|
}
|
|
2403
3365
|
|
|
2404
3366
|
// src/components/ui/ShowcaseWrapper.tsx
|
|
2405
|
-
var
|
|
2406
|
-
var
|
|
3367
|
+
var import_react21 = require("react");
|
|
3368
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2407
3369
|
function ShowcaseWrapper({
|
|
2408
3370
|
id,
|
|
2409
3371
|
title,
|
|
@@ -2415,49 +3377,32 @@ function ShowcaseWrapper({
|
|
|
2415
3377
|
className
|
|
2416
3378
|
}) {
|
|
2417
3379
|
var _a;
|
|
2418
|
-
const [showCode, setShowCode] = (0,
|
|
3380
|
+
const [showCode, setShowCode] = (0, import_react21.useState)(false);
|
|
2419
3381
|
const fallbackId = (_a = titleIdMap[title]) != null ? _a : title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
2420
|
-
return /* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
3382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { id: id != null ? id : fallbackId, className: cn("scroll-mt-20", className), children: [
|
|
3383
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ph-h2-rule mb-8", children: [
|
|
3384
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
3385
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { children: title }),
|
|
3386
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2425
3387
|
"button",
|
|
2426
3388
|
{
|
|
2427
3389
|
type: "button",
|
|
2428
3390
|
onClick: () => setShowCode(!showCode),
|
|
2429
3391
|
className: cn(
|
|
2430
3392
|
"flex h-10 w-10 items-center justify-center rounded-full border transition-all",
|
|
2431
|
-
showCode ? "border-ph-brand bg-ph-brand text-
|
|
3393
|
+
showCode ? "border-ph-brand bg-ph-brand text-[var(--ph-on-accent)] shadow-lg shadow-ph-brand/25" : "border-ph-border bg-ph-surface text-ph-subtle hover:border-ph-brand hover:text-ph-brand"
|
|
2432
3394
|
),
|
|
2433
3395
|
title: showCode ? "Hide code" : "Show code",
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
{
|
|
2437
|
-
className: "h-5 w-5",
|
|
2438
|
-
viewBox: "0 0 24 24",
|
|
2439
|
-
fill: "none",
|
|
2440
|
-
stroke: "currentColor",
|
|
2441
|
-
strokeWidth: "2",
|
|
2442
|
-
strokeLinecap: "round",
|
|
2443
|
-
strokeLinejoin: "round",
|
|
2444
|
-
children: [
|
|
2445
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2", ry: "2" }),
|
|
2446
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2447
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "12", y1: "17", x2: "12", y2: "21" }),
|
|
2448
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "6", y1: "8", x2: "6", y2: "8" }),
|
|
2449
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "10", y1: "8", x2: "10", y2: "8" })
|
|
2450
|
-
]
|
|
2451
|
-
}
|
|
2452
|
-
)
|
|
3396
|
+
"aria-label": showCode ? "Hide code" : "Show code",
|
|
3397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconCodePreview, { className: "h-5 w-5", "aria-hidden": true })
|
|
2453
3398
|
}
|
|
2454
3399
|
)
|
|
2455
3400
|
] }),
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
3401
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("hr", {})
|
|
2457
3402
|
] }),
|
|
2458
|
-
description && /* @__PURE__ */ (0,
|
|
2459
|
-
docs && /* @__PURE__ */ (0,
|
|
2460
|
-
/* @__PURE__ */ (0,
|
|
3403
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "mb-6 text-sm text-ph-subtle", children: description }),
|
|
3404
|
+
docs && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mb-6", children: docs }),
|
|
3405
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2461
3406
|
"div",
|
|
2462
3407
|
{
|
|
2463
3408
|
className: cn(
|
|
@@ -2465,15 +3410,15 @@ function ShowcaseWrapper({
|
|
|
2465
3410
|
showCode ? "lg:grid lg:grid-cols-[1fr,minmax(360px,420px)]" : "block"
|
|
2466
3411
|
),
|
|
2467
3412
|
children: [
|
|
2468
|
-
/* @__PURE__ */ (0,
|
|
2469
|
-
/* @__PURE__ */ (0,
|
|
3413
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("min-w-0", showCode && "lg:pr-2"), children }),
|
|
3414
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2470
3415
|
"div",
|
|
2471
3416
|
{
|
|
2472
3417
|
className: cn(
|
|
2473
3418
|
"transition-all duration-300",
|
|
2474
3419
|
showCode ? "block opacity-100" : "hidden opacity-0 lg:hidden"
|
|
2475
3420
|
),
|
|
2476
|
-
children: /* @__PURE__ */ (0,
|
|
3421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "sticky top-20", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CodeBlock, { code, filename }) })
|
|
2477
3422
|
}
|
|
2478
3423
|
)
|
|
2479
3424
|
]
|
|
@@ -2522,41 +3467,41 @@ var titleIdMap = {
|
|
|
2522
3467
|
};
|
|
2523
3468
|
|
|
2524
3469
|
// src/components/ui/CollapsibleSection.tsx
|
|
2525
|
-
var
|
|
2526
|
-
var
|
|
3470
|
+
var import_react22 = require("react");
|
|
3471
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2527
3472
|
function CollapsibleSection({ title, children, defaultOpen = true, id }) {
|
|
2528
|
-
const [isOpen, setIsOpen] = (0,
|
|
2529
|
-
|
|
2530
|
-
|
|
3473
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(defaultOpen);
|
|
3474
|
+
const generatedId = (0, import_react22.useId)();
|
|
3475
|
+
const contentId = `${id != null ? id : generatedId}-content`;
|
|
3476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { id, className: "scroll-mt-20", children: [
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2531
3478
|
"button",
|
|
2532
3479
|
{
|
|
2533
3480
|
type: "button",
|
|
2534
3481
|
onClick: () => setIsOpen(!isOpen),
|
|
3482
|
+
"aria-expanded": isOpen,
|
|
3483
|
+
"aria-controls": contentId,
|
|
2535
3484
|
className: "mb-6 flex w-full items-center justify-between rounded-lg border border-ph-border bg-ph-muted px-5 py-4 text-left transition hover:bg-ph-muted/80",
|
|
2536
3485
|
children: [
|
|
2537
|
-
/* @__PURE__ */ (0,
|
|
2538
|
-
/* @__PURE__ */ (0,
|
|
2539
|
-
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-lg font-bold text-ph-ink", children: title }),
|
|
3487
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3488
|
+
IconChevronDown,
|
|
2540
3489
|
{
|
|
2541
3490
|
className: cn(
|
|
2542
3491
|
"h-5 w-5 text-ph-subtle transition-transform duration-200",
|
|
2543
3492
|
isOpen && "rotate-180"
|
|
2544
3493
|
),
|
|
2545
|
-
|
|
2546
|
-
fill: "none",
|
|
2547
|
-
stroke: "currentColor",
|
|
2548
|
-
strokeWidth: "2",
|
|
2549
|
-
strokeLinecap: "round",
|
|
2550
|
-
strokeLinejoin: "round",
|
|
2551
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
3494
|
+
"aria-hidden": true
|
|
2552
3495
|
}
|
|
2553
3496
|
)
|
|
2554
3497
|
]
|
|
2555
3498
|
}
|
|
2556
3499
|
),
|
|
2557
|
-
/* @__PURE__ */ (0,
|
|
3500
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2558
3501
|
"div",
|
|
2559
3502
|
{
|
|
3503
|
+
id: contentId,
|
|
3504
|
+
"aria-hidden": !isOpen,
|
|
2560
3505
|
className: cn(
|
|
2561
3506
|
"overflow-hidden transition-all duration-300",
|
|
2562
3507
|
isOpen ? "max-h-[50000px] opacity-100" : "max-h-0 opacity-0"
|
|
@@ -2568,7 +3513,7 @@ function CollapsibleSection({ title, children, defaultOpen = true, id }) {
|
|
|
2568
3513
|
}
|
|
2569
3514
|
|
|
2570
3515
|
// src/components/ui/Typography.tsx
|
|
2571
|
-
var
|
|
3516
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2572
3517
|
var toneMap2 = {
|
|
2573
3518
|
default: "text-ph-ink",
|
|
2574
3519
|
muted: "text-ph-mutedtext",
|
|
@@ -2597,47 +3542,47 @@ function Display({
|
|
|
2597
3542
|
truncate,
|
|
2598
3543
|
className
|
|
2599
3544
|
}) {
|
|
2600
|
-
return /* @__PURE__ */ (0,
|
|
3545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h1", { className: textClass("text-4xl font-extrabold tracking-tight md:text-5xl", tone, weight, truncate, className), children });
|
|
2601
3546
|
}
|
|
2602
3547
|
function H1({ children, tone = "default", weight, truncate, className }) {
|
|
2603
|
-
return /* @__PURE__ */ (0,
|
|
3548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h1", { className: textClass("text-3xl font-bold tracking-tight md:text-4xl", tone, weight, truncate, className), children });
|
|
2604
3549
|
}
|
|
2605
3550
|
function H2({ children, tone = "default", weight, truncate, className }) {
|
|
2606
|
-
return /* @__PURE__ */ (0,
|
|
3551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { className: textClass("text-2xl font-bold tracking-tight", tone, weight, truncate, className), children });
|
|
2607
3552
|
}
|
|
2608
3553
|
function H3({ children, tone = "default", weight, truncate, className }) {
|
|
2609
|
-
return /* @__PURE__ */ (0,
|
|
3554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h3", { className: textClass("text-xl font-semibold", tone, weight, truncate, className), children });
|
|
2610
3555
|
}
|
|
2611
3556
|
function H4({ children, tone = "default", weight, truncate, className }) {
|
|
2612
|
-
return /* @__PURE__ */ (0,
|
|
3557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h4", { className: textClass("text-lg font-semibold", tone, weight, truncate, className), children });
|
|
2613
3558
|
}
|
|
2614
3559
|
function H5({ children, tone = "default", weight, truncate, className }) {
|
|
2615
|
-
return /* @__PURE__ */ (0,
|
|
3560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h5", { className: textClass("text-base font-semibold", tone, weight, truncate, className), children });
|
|
2616
3561
|
}
|
|
2617
3562
|
function P({ children, tone = "default", weight, truncate, className }) {
|
|
2618
|
-
return /* @__PURE__ */ (0,
|
|
3563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: textClass("text-base leading-relaxed", tone, weight, truncate, className), children });
|
|
2619
3564
|
}
|
|
2620
3565
|
function Small({ children, tone = "default", weight, truncate, className }) {
|
|
2621
|
-
return /* @__PURE__ */ (0,
|
|
3566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: textClass("text-sm leading-relaxed", tone, weight, truncate, className), children });
|
|
2622
3567
|
}
|
|
2623
3568
|
function Caption({ children, tone = "muted", weight, truncate, className }) {
|
|
2624
|
-
return /* @__PURE__ */ (0,
|
|
3569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: textClass("text-[11px] font-medium uppercase tracking-wider", tone, weight, truncate, className), children });
|
|
2625
3570
|
}
|
|
2626
3571
|
function Overline({ children, tone = "muted", weight, truncate, className }) {
|
|
2627
|
-
return /* @__PURE__ */ (0,
|
|
3572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: textClass("text-[10px] font-bold uppercase tracking-[0.15em]", tone, weight, truncate, className), children });
|
|
2628
3573
|
}
|
|
2629
3574
|
function Lead({ children, tone = "subtle", weight, truncate, className }) {
|
|
2630
|
-
return /* @__PURE__ */ (0,
|
|
3575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: textClass("text-lg leading-relaxed", tone, weight, truncate, className), children });
|
|
2631
3576
|
}
|
|
2632
3577
|
function Mono({ children, tone = "default", weight, truncate, className }) {
|
|
2633
|
-
return /* @__PURE__ */ (0,
|
|
3578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("code", { className: textClass("text-sm font-mono leading-relaxed", tone, weight, truncate, className), children });
|
|
2634
3579
|
}
|
|
2635
3580
|
function Label({ children, tone = "default", weight, truncate, className }) {
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
3581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("label", { className: textClass("text-sm font-medium", tone, weight, truncate, className), children });
|
|
2637
3582
|
}
|
|
2638
3583
|
|
|
2639
3584
|
// src/components/ui/Avatar.tsx
|
|
2640
|
-
var
|
|
3585
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2641
3586
|
var sizeMap5 = {
|
|
2642
3587
|
xs: "h-8 w-8 text-[10px]",
|
|
2643
3588
|
sm: "h-10 w-10 text-xs",
|
|
@@ -2669,8 +3614,8 @@ function Avatar(_a) {
|
|
|
2669
3614
|
"badge",
|
|
2670
3615
|
"className"
|
|
2671
3616
|
]);
|
|
2672
|
-
return /* @__PURE__ */ (0,
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
3617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex shrink-0", className) }, props), { children: [
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2674
3619
|
"div",
|
|
2675
3620
|
{
|
|
2676
3621
|
className: cn(
|
|
@@ -2681,7 +3626,7 @@ function Avatar(_a) {
|
|
|
2681
3626
|
children: icon || label
|
|
2682
3627
|
}
|
|
2683
3628
|
),
|
|
2684
|
-
status && /* @__PURE__ */ (0,
|
|
3629
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2685
3630
|
"span",
|
|
2686
3631
|
{
|
|
2687
3632
|
className: cn(
|
|
@@ -2690,7 +3635,7 @@ function Avatar(_a) {
|
|
|
2690
3635
|
)
|
|
2691
3636
|
}
|
|
2692
3637
|
),
|
|
2693
|
-
badge && /* @__PURE__ */ (0,
|
|
3638
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "absolute -bottom-1 -right-1 flex min-w-[22px] items-center justify-center rounded-full bg-ph-brand px-1.5 py-px text-[10px] font-bold text-white", children: badge })
|
|
2694
3639
|
] }));
|
|
2695
3640
|
}
|
|
2696
3641
|
function AvatarGroup(_a) {
|
|
@@ -2698,9 +3643,9 @@ function AvatarGroup(_a) {
|
|
|
2698
3643
|
const items = Array.isArray(children) ? children : [children];
|
|
2699
3644
|
const visible = max ? items.slice(0, max) : items;
|
|
2700
3645
|
const remaining = max ? items.length - max : 0;
|
|
2701
|
-
return /* @__PURE__ */ (0,
|
|
3646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", __spreadProps(__spreadValues({ className: cn("-space-x-3 flex rtl:space-x-reverse", className) }, props), { children: [
|
|
2702
3647
|
visible,
|
|
2703
|
-
remaining > 0 && /* @__PURE__ */ (0,
|
|
3648
|
+
remaining > 0 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2704
3649
|
Avatar,
|
|
2705
3650
|
{
|
|
2706
3651
|
label: `+${remaining}`,
|
|
@@ -2712,7 +3657,7 @@ function AvatarGroup(_a) {
|
|
|
2712
3657
|
}
|
|
2713
3658
|
|
|
2714
3659
|
// src/components/ui/Progress.tsx
|
|
2715
|
-
var
|
|
3660
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2716
3661
|
var sizeMap6 = {
|
|
2717
3662
|
sm: "h-1",
|
|
2718
3663
|
md: "h-2",
|
|
@@ -2737,15 +3682,15 @@ function Progress(_a) {
|
|
|
2737
3682
|
"className"
|
|
2738
3683
|
]);
|
|
2739
3684
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
2740
|
-
return /* @__PURE__ */ (0,
|
|
2741
|
-
(label || showPercentage) && /* @__PURE__ */ (0,
|
|
2742
|
-
label && /* @__PURE__ */ (0,
|
|
2743
|
-
showPercentage && /* @__PURE__ */ (0,
|
|
3685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", __spreadProps(__spreadValues({ className: cn("w-full", className) }, props), { children: [
|
|
3686
|
+
(label || showPercentage) && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "mb-1.5 flex justify-between text-sm text-ph-subtle", children: [
|
|
3687
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: label }),
|
|
3688
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "tabular-nums", children: [
|
|
2744
3689
|
Math.round(percentage),
|
|
2745
3690
|
"%"
|
|
2746
3691
|
] })
|
|
2747
3692
|
] }),
|
|
2748
|
-
/* @__PURE__ */ (0,
|
|
3693
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cn("ph-progress", sizeMap6[size]), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2749
3694
|
"div",
|
|
2750
3695
|
{
|
|
2751
3696
|
className: cn("ph-progress-bar", color),
|
|
@@ -2760,7 +3705,7 @@ function Progress(_a) {
|
|
|
2760
3705
|
}
|
|
2761
3706
|
|
|
2762
3707
|
// src/components/ui/ChatBubble.tsx
|
|
2763
|
-
var
|
|
3708
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2764
3709
|
function ChatBubble(_a) {
|
|
2765
3710
|
var _b = _a, {
|
|
2766
3711
|
children,
|
|
@@ -2780,7 +3725,7 @@ function ChatBubble(_a) {
|
|
|
2780
3725
|
"className"
|
|
2781
3726
|
]);
|
|
2782
3727
|
const isSelf = variant === "self";
|
|
2783
|
-
return /* @__PURE__ */ (0,
|
|
3728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2784
3729
|
"div",
|
|
2785
3730
|
__spreadProps(__spreadValues({
|
|
2786
3731
|
className: cn(
|
|
@@ -2790,9 +3735,9 @@ function ChatBubble(_a) {
|
|
|
2790
3735
|
)
|
|
2791
3736
|
}, props), {
|
|
2792
3737
|
children: [
|
|
2793
|
-
avatar && /* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
(name || time) && /* @__PURE__ */ (0,
|
|
3738
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "shrink-0", children: avatar }),
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("min-w-0 flex-1", isSelf && "text-right"), children: [
|
|
3740
|
+
(name || time) && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2796
3741
|
"header",
|
|
2797
3742
|
{
|
|
2798
3743
|
className: cn(
|
|
@@ -2800,12 +3745,12 @@ function ChatBubble(_a) {
|
|
|
2800
3745
|
isSelf && "flex-row-reverse justify-end"
|
|
2801
3746
|
),
|
|
2802
3747
|
children: [
|
|
2803
|
-
name && /* @__PURE__ */ (0,
|
|
2804
|
-
time && /* @__PURE__ */ (0,
|
|
3748
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-semibold text-ph-ink", children: name }),
|
|
3749
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: time })
|
|
2805
3750
|
]
|
|
2806
3751
|
}
|
|
2807
3752
|
),
|
|
2808
|
-
/* @__PURE__ */ (0,
|
|
3753
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2809
3754
|
"div",
|
|
2810
3755
|
{
|
|
2811
3756
|
className: cn(
|
|
@@ -2815,7 +3760,7 @@ function ChatBubble(_a) {
|
|
|
2815
3760
|
children
|
|
2816
3761
|
}
|
|
2817
3762
|
),
|
|
2818
|
-
footer && /* @__PURE__ */ (0,
|
|
3763
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("footer", { className: "mt-2 text-[11px] text-ph-mutedtext", children: footer })
|
|
2819
3764
|
] })
|
|
2820
3765
|
]
|
|
2821
3766
|
})
|
|
@@ -2823,7 +3768,7 @@ function ChatBubble(_a) {
|
|
|
2823
3768
|
}
|
|
2824
3769
|
|
|
2825
3770
|
// src/components/ui/Terminal.tsx
|
|
2826
|
-
var
|
|
3771
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2827
3772
|
function Terminal(_a) {
|
|
2828
3773
|
var _b = _a, {
|
|
2829
3774
|
title = "sandbox",
|
|
@@ -2836,7 +3781,7 @@ function Terminal(_a) {
|
|
|
2836
3781
|
"children",
|
|
2837
3782
|
"className"
|
|
2838
3783
|
]);
|
|
2839
|
-
return /* @__PURE__ */ (0,
|
|
3784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2840
3785
|
"div",
|
|
2841
3786
|
__spreadProps(__spreadValues({
|
|
2842
3787
|
className: cn(
|
|
@@ -2845,18 +3790,18 @@ function Terminal(_a) {
|
|
|
2845
3790
|
)
|
|
2846
3791
|
}, props), {
|
|
2847
3792
|
children: [
|
|
2848
|
-
/* @__PURE__ */ (0,
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
2852
|
-
title && /* @__PURE__ */ (0,
|
|
3793
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "flex items-center gap-2 border-b border-ph-border bg-ph-muted px-4 py-3", children: [
|
|
3794
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-3 rounded-full bg-red-400" }),
|
|
3795
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-3 rounded-full bg-amber-400" }),
|
|
3796
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-3 rounded-full bg-emerald-400" }),
|
|
3797
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs font-medium text-ph-mutedtext", children: title })
|
|
2853
3798
|
] }),
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
3799
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "ph-code rounded-none border-x-0 border-b-0 text-[13px] leading-relaxed", children: children || /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: lines == null ? void 0 : lines.map((line, i) => {
|
|
2855
3800
|
const text = typeof line === "string" ? line : line.text;
|
|
2856
3801
|
const color = typeof line === "string" ? void 0 : line.color;
|
|
2857
|
-
return /* @__PURE__ */ (0,
|
|
2858
|
-
/* @__PURE__ */ (0,
|
|
2859
|
-
i < lines.length - 1 && /* @__PURE__ */ (0,
|
|
3802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
3803
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: color || "text-neutral-600", children: text }),
|
|
3804
|
+
i < lines.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("br", {})
|
|
2860
3805
|
] }, i);
|
|
2861
3806
|
}) }) })
|
|
2862
3807
|
]
|
|
@@ -2865,7 +3810,7 @@ function Terminal(_a) {
|
|
|
2865
3810
|
}
|
|
2866
3811
|
|
|
2867
3812
|
// src/components/ui/Indicator.tsx
|
|
2868
|
-
var
|
|
3813
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2869
3814
|
var positionMap = {
|
|
2870
3815
|
"top-right": "-right-[2px] -top-[2px]",
|
|
2871
3816
|
"top-left": "-left-[2px] -top-[2px]",
|
|
@@ -2888,8 +3833,8 @@ function Indicator(_a) {
|
|
|
2888
3833
|
"dot",
|
|
2889
3834
|
"className"
|
|
2890
3835
|
]);
|
|
2891
|
-
return /* @__PURE__ */ (0,
|
|
2892
|
-
dot ? /* @__PURE__ */ (0,
|
|
3836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex items-center justify-center", className) }, props), { children: [
|
|
3837
|
+
dot ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2893
3838
|
"span",
|
|
2894
3839
|
{
|
|
2895
3840
|
className: cn(
|
|
@@ -2898,7 +3843,7 @@ function Indicator(_a) {
|
|
|
2898
3843
|
positionMap[position]
|
|
2899
3844
|
)
|
|
2900
3845
|
}
|
|
2901
|
-
) : badge != null ? /* @__PURE__ */ (0,
|
|
3846
|
+
) : badge != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2902
3847
|
"span",
|
|
2903
3848
|
{
|
|
2904
3849
|
className: cn(
|
|
@@ -2914,7 +3859,7 @@ function Indicator(_a) {
|
|
|
2914
3859
|
}
|
|
2915
3860
|
|
|
2916
3861
|
// src/components/ui/Timeline.tsx
|
|
2917
|
-
var
|
|
3862
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2918
3863
|
function Timeline(_a) {
|
|
2919
3864
|
var _b = _a, {
|
|
2920
3865
|
events,
|
|
@@ -2925,15 +3870,15 @@ function Timeline(_a) {
|
|
|
2925
3870
|
"alternate",
|
|
2926
3871
|
"className"
|
|
2927
3872
|
]);
|
|
2928
|
-
return /* @__PURE__ */ (0,
|
|
3873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2929
3874
|
"ol",
|
|
2930
3875
|
__spreadProps(__spreadValues({
|
|
2931
3876
|
className: cn("relative space-y-8", className)
|
|
2932
3877
|
}, props), {
|
|
2933
3878
|
children: events.map((event, idx) => {
|
|
2934
3879
|
const align = alternate && idx % 2 !== 0 ? "lg:flex-row-reverse" : "";
|
|
2935
|
-
return /* @__PURE__ */ (0,
|
|
2936
|
-
/* @__PURE__ */ (0,
|
|
3880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("li", { className: cn("relative flex gap-6", align), children: [
|
|
3881
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2937
3882
|
"div",
|
|
2938
3883
|
{
|
|
2939
3884
|
className: cn(
|
|
@@ -2943,12 +3888,12 @@ function Timeline(_a) {
|
|
|
2943
3888
|
children: event.icon
|
|
2944
3889
|
}
|
|
2945
3890
|
),
|
|
2946
|
-
/* @__PURE__ */ (0,
|
|
2947
|
-
/* @__PURE__ */ (0,
|
|
2948
|
-
/* @__PURE__ */ (0,
|
|
2949
|
-
event.time && /* @__PURE__ */ (0,
|
|
3891
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("article", { className: "flex-1 rounded-xl border border-ph-border bg-ph-surface p-4 shadow-ph", children: [
|
|
3892
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-wrap items-baseline gap-3", children: [
|
|
3893
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h4", { className: "text-base font-semibold text-ph-ink", children: event.title }),
|
|
3894
|
+
event.time && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("time", { className: "text-[11px] font-semibold uppercase tracking-wide text-ph-mutedtext", children: event.time })
|
|
2950
3895
|
] }),
|
|
2951
|
-
event.description && /* @__PURE__ */ (0,
|
|
3896
|
+
event.description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-2 text-sm text-ph-subtle", children: event.description })
|
|
2952
3897
|
] })
|
|
2953
3898
|
] }, event.id);
|
|
2954
3899
|
})
|
|
@@ -2957,8 +3902,36 @@ function Timeline(_a) {
|
|
|
2957
3902
|
}
|
|
2958
3903
|
|
|
2959
3904
|
// src/components/charts/ph-insight-charts.tsx
|
|
2960
|
-
var
|
|
3905
|
+
var import_react25 = require("react");
|
|
3906
|
+
|
|
3907
|
+
// src/lib/chart/register-chartjs.ts
|
|
2961
3908
|
var import_chart = require("chart.js");
|
|
3909
|
+
function synchroniseChartJsFontFamily() {
|
|
3910
|
+
if (typeof document === "undefined") {
|
|
3911
|
+
return;
|
|
3912
|
+
}
|
|
3913
|
+
const family = window.getComputedStyle(document.body).fontFamily;
|
|
3914
|
+
const trimmed = family == null ? void 0 : family.trim();
|
|
3915
|
+
if (trimmed) {
|
|
3916
|
+
import_chart.Chart.defaults.font.family = trimmed;
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
import_chart.Chart.register(
|
|
3920
|
+
import_chart.CategoryScale,
|
|
3921
|
+
import_chart.LinearScale,
|
|
3922
|
+
import_chart.RadialLinearScale,
|
|
3923
|
+
import_chart.BarController,
|
|
3924
|
+
import_chart.BarElement,
|
|
3925
|
+
import_chart.DoughnutController,
|
|
3926
|
+
import_chart.PolarAreaController,
|
|
3927
|
+
import_chart.ArcElement,
|
|
3928
|
+
import_chart.Title,
|
|
3929
|
+
import_chart.Tooltip,
|
|
3930
|
+
import_chart.Legend
|
|
3931
|
+
);
|
|
3932
|
+
synchroniseChartJsFontFamily();
|
|
3933
|
+
|
|
3934
|
+
// src/components/charts/ph-insight-charts.tsx
|
|
2962
3935
|
var import_react_chartjs_2 = require("react-chartjs-2");
|
|
2963
3936
|
|
|
2964
3937
|
// src/lib/chart/with-alpha.ts
|
|
@@ -3294,7 +4267,7 @@ function buildPolarAreaDemo(tokens) {
|
|
|
3294
4267
|
}
|
|
3295
4268
|
|
|
3296
4269
|
// src/lib/chart/use-ph-chart-tokens.ts
|
|
3297
|
-
var
|
|
4270
|
+
var import_react23 = require("react");
|
|
3298
4271
|
|
|
3299
4272
|
// src/lib/chart/ph-chart-tokens.ts
|
|
3300
4273
|
var FALLBACK_CHART_TOKENS = {
|
|
@@ -3336,9 +4309,9 @@ function tokensEqual(a, b) {
|
|
|
3336
4309
|
return a.grid === b.grid && a.text === b.text && a.textMuted === b.textMuted && a.surface === b.surface && a.borderStrong === b.borderStrong && a.accent === b.accent;
|
|
3337
4310
|
}
|
|
3338
4311
|
function useChartTokens() {
|
|
3339
|
-
const [tokens, setTokens] = (0,
|
|
3340
|
-
const tokensRef = (0,
|
|
3341
|
-
(0,
|
|
4312
|
+
const [tokens, setTokens] = (0, import_react23.useState)(FALLBACK_CHART_TOKENS);
|
|
4313
|
+
const tokensRef = (0, import_react23.useRef)(FALLBACK_CHART_TOKENS);
|
|
4314
|
+
(0, import_react23.useEffect)(() => {
|
|
3342
4315
|
const root = document.documentElement;
|
|
3343
4316
|
const refresh = () => {
|
|
3344
4317
|
const next = readChartTokens(root);
|
|
@@ -3368,8 +4341,8 @@ function buildHogChartTheme(tokens) {
|
|
|
3368
4341
|
|
|
3369
4342
|
// src/lib/hog-charts-lite/CanvasTrendLineChart.tsx
|
|
3370
4343
|
var import_d3_scale = require("d3-scale");
|
|
3371
|
-
var
|
|
3372
|
-
var
|
|
4344
|
+
var import_react24 = require("react");
|
|
4345
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3373
4346
|
var HOG_LITE_DEFAULT_MARGINS = { top: 16, right: 16, bottom: 32, left: 48 };
|
|
3374
4347
|
function resolveDisplayedSeries(series, palette) {
|
|
3375
4348
|
const visible = series.filter((s) => {
|
|
@@ -3423,11 +4396,11 @@ function CanvasTrendLineChart({
|
|
|
3423
4396
|
showCrosshair = true,
|
|
3424
4397
|
className = ""
|
|
3425
4398
|
}) {
|
|
3426
|
-
const containerRef = (0,
|
|
3427
|
-
const canvasRef = (0,
|
|
3428
|
-
const [size, setSize] = (0,
|
|
3429
|
-
const [hoverIndex, setHoverIndex] = (0,
|
|
3430
|
-
(0,
|
|
4399
|
+
const containerRef = (0, import_react24.useRef)(null);
|
|
4400
|
+
const canvasRef = (0, import_react24.useRef)(null);
|
|
4401
|
+
const [size, setSize] = (0, import_react24.useState)({ width: 0, height: 0 });
|
|
4402
|
+
const [hoverIndex, setHoverIndex] = (0, import_react24.useState)(null);
|
|
4403
|
+
(0, import_react24.useEffect)(() => {
|
|
3431
4404
|
const el = containerRef.current;
|
|
3432
4405
|
if (!el) {
|
|
3433
4406
|
return;
|
|
@@ -3440,8 +4413,8 @@ function CanvasTrendLineChart({
|
|
|
3440
4413
|
ro.observe(el);
|
|
3441
4414
|
return () => ro.disconnect();
|
|
3442
4415
|
}, []);
|
|
3443
|
-
const resolved = (0,
|
|
3444
|
-
const draw = (0,
|
|
4416
|
+
const resolved = (0, import_react24.useMemo)(() => resolveDisplayedSeries(series, theme.colors), [series, theme.colors]);
|
|
4417
|
+
const draw = (0, import_react24.useCallback)(() => {
|
|
3445
4418
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
3446
4419
|
const canvas = canvasRef.current;
|
|
3447
4420
|
const container = containerRef.current;
|
|
@@ -3614,7 +4587,7 @@ function CanvasTrendLineChart({
|
|
|
3614
4587
|
}
|
|
3615
4588
|
}
|
|
3616
4589
|
}, [hoverIndex, labels, resolved, showCrosshair, showGrid, size.height, size.width, theme]);
|
|
3617
|
-
(0,
|
|
4590
|
+
(0, import_react24.useEffect)(() => {
|
|
3618
4591
|
draw();
|
|
3619
4592
|
}, [draw]);
|
|
3620
4593
|
const onMouseMove = (event) => {
|
|
@@ -3649,7 +4622,7 @@ function CanvasTrendLineChart({
|
|
|
3649
4622
|
const onMouseLeave = () => {
|
|
3650
4623
|
setHoverIndex(null);
|
|
3651
4624
|
};
|
|
3652
|
-
const tooltipRows = (0,
|
|
4625
|
+
const tooltipRows = (0, import_react24.useMemo)(() => {
|
|
3653
4626
|
if (hoverIndex == null) {
|
|
3654
4627
|
return null;
|
|
3655
4628
|
}
|
|
@@ -3666,8 +4639,8 @@ function CanvasTrendLineChart({
|
|
|
3666
4639
|
value: s.data[hoverIndex]
|
|
3667
4640
|
})).filter((row) => typeof row.value === "number" && Number.isFinite(row.value));
|
|
3668
4641
|
}, [hoverIndex, labels, resolved]);
|
|
3669
|
-
return /* @__PURE__ */ (0,
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
4642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { ref: containerRef, className: `relative w-full ${className}`.trim(), children: [
|
|
4643
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3671
4644
|
"canvas",
|
|
3672
4645
|
{
|
|
3673
4646
|
ref: canvasRef,
|
|
@@ -3677,7 +4650,7 @@ function CanvasTrendLineChart({
|
|
|
3677
4650
|
onMouseLeave
|
|
3678
4651
|
}
|
|
3679
4652
|
),
|
|
3680
|
-
tooltipRows != null && tooltipRows.length > 0 && hoverIndex != null ? /* @__PURE__ */ (0,
|
|
4653
|
+
tooltipRows != null && tooltipRows.length > 0 && hoverIndex != null ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3681
4654
|
"div",
|
|
3682
4655
|
{
|
|
3683
4656
|
className: "pointer-events-none absolute z-20 max-w-xs rounded-[var(--ph-radius-app)] border border-ph-border-strong bg-ph-surface px-3 py-2 text-xs shadow-ph-md",
|
|
@@ -3686,11 +4659,11 @@ function CanvasTrendLineChart({
|
|
|
3686
4659
|
top: 8
|
|
3687
4660
|
},
|
|
3688
4661
|
children: [
|
|
3689
|
-
/* @__PURE__ */ (0,
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
3691
|
-
/* @__PURE__ */ (0,
|
|
3692
|
-
/* @__PURE__ */ (0,
|
|
3693
|
-
/* @__PURE__ */ (0,
|
|
4662
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "font-semibold text-ph-ink", children: labels[hoverIndex] }),
|
|
4663
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ul", { className: "mt-1 space-y-0.5 text-ph-mutedtext", children: tooltipRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { className: "flex items-center gap-2", children: [
|
|
4664
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "h-2 w-2 shrink-0 rounded-full", style: { background: row.color } }),
|
|
4665
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "min-w-0 truncate", children: row.label }),
|
|
4666
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "ml-auto tabular-nums text-ph-ink", children: row.value })
|
|
3694
4667
|
] }, row.label)) })
|
|
3695
4668
|
]
|
|
3696
4669
|
}
|
|
@@ -3699,37 +4672,15 @@ function CanvasTrendLineChart({
|
|
|
3699
4672
|
}
|
|
3700
4673
|
|
|
3701
4674
|
// src/components/charts/ph-insight-charts.tsx
|
|
3702
|
-
var
|
|
4675
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3703
4676
|
var DEMO_LABELS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
3704
|
-
var chartJsRegistered = false;
|
|
3705
|
-
function registerChartJs() {
|
|
3706
|
-
if (chartJsRegistered) return;
|
|
3707
|
-
if (typeof window === "undefined") return;
|
|
3708
|
-
import_chart.Chart.register(
|
|
3709
|
-
import_chart.CategoryScale,
|
|
3710
|
-
import_chart.LinearScale,
|
|
3711
|
-
import_chart.RadialLinearScale,
|
|
3712
|
-
import_chart.BarController,
|
|
3713
|
-
import_chart.BarElement,
|
|
3714
|
-
import_chart.DoughnutController,
|
|
3715
|
-
import_chart.PolarAreaController,
|
|
3716
|
-
import_chart.ArcElement,
|
|
3717
|
-
import_chart.Title,
|
|
3718
|
-
import_chart.Tooltip,
|
|
3719
|
-
import_chart.Legend
|
|
3720
|
-
);
|
|
3721
|
-
chartJsRegistered = true;
|
|
3722
|
-
}
|
|
3723
4677
|
function useClientMounted() {
|
|
3724
|
-
const [mounted, setMounted] = (0,
|
|
3725
|
-
(0,
|
|
3726
|
-
setMounted(true);
|
|
3727
|
-
registerChartJs();
|
|
3728
|
-
}, []);
|
|
4678
|
+
const [mounted, setMounted] = (0, import_react25.useState)(false);
|
|
4679
|
+
(0, import_react25.useEffect)(() => setMounted(true), []);
|
|
3729
4680
|
return mounted;
|
|
3730
4681
|
}
|
|
3731
4682
|
function ChartSkeleton({ className = "h-[280px]" }) {
|
|
3732
|
-
return /* @__PURE__ */ (0,
|
|
4683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3733
4684
|
"div",
|
|
3734
4685
|
{
|
|
3735
4686
|
className: `w-full animate-pulse rounded-lemon bg-ph-muted ${className}`,
|
|
@@ -3740,8 +4691,8 @@ function ChartSkeleton({ className = "h-[280px]" }) {
|
|
|
3740
4691
|
function HogTrendLineChart() {
|
|
3741
4692
|
const mounted = useClientMounted();
|
|
3742
4693
|
const tokens = useChartTokens();
|
|
3743
|
-
const theme = (0,
|
|
3744
|
-
const series = (0,
|
|
4694
|
+
const theme = (0, import_react25.useMemo)(() => buildHogChartTheme(tokens), [tokens]);
|
|
4695
|
+
const series = (0, import_react25.useMemo)(
|
|
3745
4696
|
() => [
|
|
3746
4697
|
{
|
|
3747
4698
|
key: "pageview",
|
|
@@ -3761,9 +4712,9 @@ function HogTrendLineChart() {
|
|
|
3761
4712
|
[tokens.series]
|
|
3762
4713
|
);
|
|
3763
4714
|
if (!mounted) {
|
|
3764
|
-
return /* @__PURE__ */ (0,
|
|
4715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChartSkeleton, {});
|
|
3765
4716
|
}
|
|
3766
|
-
return /* @__PURE__ */ (0,
|
|
4717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative h-[280px] w-full min-h-[220px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3767
4718
|
CanvasTrendLineChart,
|
|
3768
4719
|
{
|
|
3769
4720
|
labels: DEMO_LABELS,
|
|
@@ -3778,70 +4729,70 @@ function HogTrendLineChart() {
|
|
|
3778
4729
|
function InsightVerticalBarChart() {
|
|
3779
4730
|
const mounted = useClientMounted();
|
|
3780
4731
|
const tokens = useChartTokens();
|
|
3781
|
-
const config = (0,
|
|
4732
|
+
const config = (0, import_react25.useMemo)(() => buildVerticalBarDemo(tokens), [tokens]);
|
|
3782
4733
|
if (!mounted) {
|
|
3783
|
-
return /* @__PURE__ */ (0,
|
|
4734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChartSkeleton, {});
|
|
3784
4735
|
}
|
|
3785
|
-
return /* @__PURE__ */ (0,
|
|
4736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative h-[280px] w-full min-h-[220px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options, redraw: false }) });
|
|
3786
4737
|
}
|
|
3787
4738
|
function InsightHorizontalBarChart() {
|
|
3788
4739
|
const mounted = useClientMounted();
|
|
3789
4740
|
const tokens = useChartTokens();
|
|
3790
|
-
const config = (0,
|
|
4741
|
+
const config = (0, import_react25.useMemo)(() => buildHorizontalBarDemo(tokens), [tokens]);
|
|
3791
4742
|
if (!mounted) {
|
|
3792
|
-
return /* @__PURE__ */ (0,
|
|
4743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChartSkeleton, { className: "h-[320px]" });
|
|
3793
4744
|
}
|
|
3794
|
-
return /* @__PURE__ */ (0,
|
|
4745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative h-[320px] w-full min-h-[260px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options, redraw: false }) });
|
|
3795
4746
|
}
|
|
3796
4747
|
function InsightStackedBarChart() {
|
|
3797
4748
|
const mounted = useClientMounted();
|
|
3798
4749
|
const tokens = useChartTokens();
|
|
3799
|
-
const config = (0,
|
|
4750
|
+
const config = (0, import_react25.useMemo)(() => buildStackedBarDemo(tokens), [tokens]);
|
|
3800
4751
|
if (!mounted) {
|
|
3801
|
-
return /* @__PURE__ */ (0,
|
|
4752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChartSkeleton, { className: "h-[300px]" });
|
|
3802
4753
|
}
|
|
3803
|
-
return /* @__PURE__ */ (0,
|
|
4754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative h-[300px] w-full min-h-[240px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options, redraw: false }) });
|
|
3804
4755
|
}
|
|
3805
4756
|
function InsightDoughnutChart() {
|
|
3806
4757
|
const mounted = useClientMounted();
|
|
3807
4758
|
const tokens = useChartTokens();
|
|
3808
|
-
const config = (0,
|
|
4759
|
+
const config = (0, import_react25.useMemo)(() => buildDoughnutDemo(tokens), [tokens]);
|
|
3809
4760
|
if (!mounted) {
|
|
3810
|
-
return /* @__PURE__ */ (0,
|
|
4761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChartSkeleton, { className: "h-[260px]" });
|
|
3811
4762
|
}
|
|
3812
|
-
return /* @__PURE__ */ (0,
|
|
4763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative mx-auto h-[260px] w-full max-w-[280px] min-h-[220px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_chartjs_2.Doughnut, { data: config.data, options: config.options, redraw: false }) });
|
|
3813
4764
|
}
|
|
3814
4765
|
function InsightPolarAreaChart() {
|
|
3815
4766
|
const mounted = useClientMounted();
|
|
3816
4767
|
const tokens = useChartTokens();
|
|
3817
|
-
const config = (0,
|
|
4768
|
+
const config = (0, import_react25.useMemo)(() => buildPolarAreaDemo(tokens), [tokens]);
|
|
3818
4769
|
if (!mounted) {
|
|
3819
|
-
return /* @__PURE__ */ (0,
|
|
4770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChartSkeleton, { className: "h-[280px]" });
|
|
3820
4771
|
}
|
|
3821
|
-
return /* @__PURE__ */ (0,
|
|
4772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative mx-auto h-[280px] w-full max-w-[320px] min-h-[240px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_chartjs_2.PolarArea, { data: config.data, options: config.options, redraw: false }) });
|
|
3822
4773
|
}
|
|
3823
4774
|
|
|
3824
4775
|
// src/components/dashboard/DashboardWell.tsx
|
|
3825
|
-
var
|
|
4776
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3826
4777
|
function DashboardWell(_a) {
|
|
3827
4778
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3828
|
-
return /* @__PURE__ */ (0,
|
|
4779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", __spreadValues({ className: cn("ph-dashboard-well", className) }, props));
|
|
3829
4780
|
}
|
|
3830
4781
|
|
|
3831
4782
|
// src/components/dashboard/DashboardToolbar.tsx
|
|
3832
|
-
var
|
|
4783
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3833
4784
|
function DashboardToolbar({ title, description, actions, className }) {
|
|
3834
|
-
return /* @__PURE__ */ (0,
|
|
3835
|
-
/* @__PURE__ */ (0,
|
|
3836
|
-
/* @__PURE__ */ (0,
|
|
3837
|
-
description ? /* @__PURE__ */ (0,
|
|
4785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("flex flex-wrap items-baseline justify-between gap-4", className), children: [
|
|
4786
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "min-w-0", children: [
|
|
4787
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "text-lg font-bold text-ph-ink", children: title }),
|
|
4788
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "mt-0.5 text-sm text-ph-mutedtext", children: description }) : null
|
|
3838
4789
|
] }),
|
|
3839
|
-
actions != null ? /* @__PURE__ */ (0,
|
|
4790
|
+
actions != null ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex shrink-0 flex-wrap items-center gap-2", children: actions }) : null
|
|
3840
4791
|
] });
|
|
3841
4792
|
}
|
|
3842
4793
|
|
|
3843
4794
|
// src/components/dashboard/DashboardGrid.tsx
|
|
3844
|
-
var
|
|
4795
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3845
4796
|
var presetClass = {
|
|
3846
4797
|
insights: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
|
|
3847
4798
|
dense: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
|
|
@@ -3854,14 +4805,14 @@ function DashboardGrid(_a) {
|
|
|
3854
4805
|
"preset",
|
|
3855
4806
|
"className"
|
|
3856
4807
|
]);
|
|
3857
|
-
return /* @__PURE__ */ (0,
|
|
4808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", __spreadValues({ className: cn(presetClass[preset], className) }, props));
|
|
3858
4809
|
}
|
|
3859
4810
|
|
|
3860
4811
|
// src/components/dashboard/DashboardFiltersBar.tsx
|
|
3861
|
-
var
|
|
4812
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3862
4813
|
function DashboardFiltersBar(_a) {
|
|
3863
4814
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3864
|
-
return /* @__PURE__ */ (0,
|
|
4815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3865
4816
|
"div",
|
|
3866
4817
|
__spreadValues({
|
|
3867
4818
|
className: cn(
|
|
@@ -3874,20 +4825,20 @@ function DashboardFiltersBar(_a) {
|
|
|
3874
4825
|
}
|
|
3875
4826
|
|
|
3876
4827
|
// src/components/dashboard/DashboardKpiCard.tsx
|
|
3877
|
-
var
|
|
4828
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3878
4829
|
function DashboardKpiCard(_a) {
|
|
3879
4830
|
var _b = _a, { label, value, footer, icon, className, children } = _b, props = __objRest(_b, ["label", "value", "footer", "icon", "className", "children"]);
|
|
3880
|
-
return /* @__PURE__ */ (0,
|
|
3881
|
-
icon != null ? /* @__PURE__ */ (0,
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
3883
|
-
/* @__PURE__ */ (0,
|
|
3884
|
-
footer != null ? /* @__PURE__ */ (0,
|
|
4831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-stat", className) }, props), { children: [
|
|
4832
|
+
icon != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mb-2 [&>svg]:h-7 [&>svg]:w-7", children: icon }) : null,
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ph-stat-label", children: label }),
|
|
4834
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ph-stat-val", children: value }),
|
|
4835
|
+
footer != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: footer }) : null,
|
|
3885
4836
|
children
|
|
3886
4837
|
] }));
|
|
3887
4838
|
}
|
|
3888
4839
|
|
|
3889
4840
|
// src/components/dashboard/DashboardInsightPlaceholder.tsx
|
|
3890
|
-
var
|
|
4841
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3891
4842
|
function DashboardInsightPlaceholder(_a) {
|
|
3892
4843
|
var _b = _a, {
|
|
3893
4844
|
label = "Add insight",
|
|
@@ -3900,7 +4851,7 @@ function DashboardInsightPlaceholder(_a) {
|
|
|
3900
4851
|
"children",
|
|
3901
4852
|
"type"
|
|
3902
4853
|
]);
|
|
3903
|
-
return /* @__PURE__ */ (0,
|
|
4854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3904
4855
|
"button",
|
|
3905
4856
|
__spreadProps(__spreadValues({
|
|
3906
4857
|
type,
|
|
@@ -3911,13 +4862,13 @@ function DashboardInsightPlaceholder(_a) {
|
|
|
3911
4862
|
className
|
|
3912
4863
|
)
|
|
3913
4864
|
}, props), {
|
|
3914
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
4865
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "font-medium text-ph-subtle group-hover:text-ph-ink", children: label })
|
|
3915
4866
|
})
|
|
3916
4867
|
);
|
|
3917
4868
|
}
|
|
3918
4869
|
|
|
3919
4870
|
// src/components/dashboard/InsightShell.tsx
|
|
3920
|
-
var
|
|
4871
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3921
4872
|
function InsightShell(_a) {
|
|
3922
4873
|
var _b = _a, {
|
|
3923
4874
|
ribbonColour,
|
|
@@ -3931,8 +4882,8 @@ function InsightShell(_a) {
|
|
|
3931
4882
|
"children"
|
|
3932
4883
|
]);
|
|
3933
4884
|
const ribbon = ribbonColour != null && String(ribbonColour).trim() !== "" ? String(ribbonColour).trim() : null;
|
|
3934
|
-
return /* @__PURE__ */ (0,
|
|
3935
|
-
ribbon != null ? /* @__PURE__ */ (0,
|
|
4885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-insight-shell flex-row", className) }, props), { children: [
|
|
4886
|
+
ribbon != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3936
4887
|
"div",
|
|
3937
4888
|
{
|
|
3938
4889
|
className: "ph-insight-shell__ribbon min-h-[7rem] shrink-0 self-stretch",
|
|
@@ -3940,24 +4891,24 @@ function InsightShell(_a) {
|
|
|
3940
4891
|
"aria-hidden": true
|
|
3941
4892
|
}
|
|
3942
4893
|
) : null,
|
|
3943
|
-
/* @__PURE__ */ (0,
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: cn("flex min-w-0 flex-1 flex-col gap-3 p-4", bodyClassName), children })
|
|
3944
4895
|
] }));
|
|
3945
4896
|
}
|
|
3946
4897
|
|
|
3947
4898
|
// src/components/dashboard/InsightShellHeader.tsx
|
|
3948
|
-
var
|
|
4899
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3949
4900
|
function InsightShellHeader({ title, subtitle, actions, className }) {
|
|
3950
|
-
return /* @__PURE__ */ (0,
|
|
3951
|
-
/* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
3953
|
-
subtitle != null ? /* @__PURE__ */ (0,
|
|
4901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("header", { className: cn("flex gap-3", actions != null ? "items-start justify-between" : "", className), children: [
|
|
4902
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
4903
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h4", { className: "font-semibold leading-snug text-ph-ink", children: title }),
|
|
4904
|
+
subtitle != null ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "mt-0.5 text-xs text-ph-mutedtext", children: subtitle }) : null
|
|
3954
4905
|
] }),
|
|
3955
|
-
actions != null ? /* @__PURE__ */ (0,
|
|
4906
|
+
actions != null ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: actions }) : null
|
|
3956
4907
|
] });
|
|
3957
4908
|
}
|
|
3958
4909
|
|
|
3959
4910
|
// src/components/dashboard/MiniTrendBars.tsx
|
|
3960
|
-
var
|
|
4911
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3961
4912
|
var DEFAULT_SERIES_CYCLE = [1, 2, 3, 4, 5, 6, 7];
|
|
3962
4913
|
function clampPct(n) {
|
|
3963
4914
|
if (!Number.isFinite(n)) {
|
|
@@ -3975,7 +4926,7 @@ function MiniTrendBars({
|
|
|
3975
4926
|
var _a;
|
|
3976
4927
|
return (_a = DEFAULT_SERIES_CYCLE[i % DEFAULT_SERIES_CYCLE.length]) != null ? _a : 1;
|
|
3977
4928
|
});
|
|
3978
|
-
return /* @__PURE__ */ (0,
|
|
4929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: cn("flex items-end gap-0.5", rowClassName, className), children: heights.map((raw, i) => {
|
|
3979
4930
|
const pct = clampPct(raw);
|
|
3980
4931
|
const series = resolveSeries(i, pct);
|
|
3981
4932
|
const style = {
|
|
@@ -3983,12 +4934,12 @@ function MiniTrendBars({
|
|
|
3983
4934
|
background: `var(--ph-data-${String(series)})`,
|
|
3984
4935
|
minHeight: pct > 0 ? 4 : 0
|
|
3985
4936
|
};
|
|
3986
|
-
return /* @__PURE__ */ (0,
|
|
4937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "min-h-0 flex-1 rounded-t-[3px]", style }, `bar-${String(i)}`);
|
|
3987
4938
|
}) });
|
|
3988
4939
|
}
|
|
3989
4940
|
|
|
3990
4941
|
// src/components/dashboard/InsightMiniCard.tsx
|
|
3991
|
-
var
|
|
4942
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3992
4943
|
function InsightMiniCard(_a) {
|
|
3993
4944
|
var _b = _a, {
|
|
3994
4945
|
title,
|
|
@@ -4001,21 +4952,25 @@ function InsightMiniCard(_a) {
|
|
|
4001
4952
|
"heights",
|
|
4002
4953
|
"ribbonColour"
|
|
4003
4954
|
]);
|
|
4004
|
-
return /* @__PURE__ */ (0,
|
|
4005
|
-
/* @__PURE__ */ (0,
|
|
4006
|
-
/* @__PURE__ */ (0,
|
|
4955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(InsightShell, __spreadProps(__spreadValues({ ribbonColour }, shellProps), { children: [
|
|
4956
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(InsightShellHeader, { title, subtitle }),
|
|
4957
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(MiniTrendBars, { heights })
|
|
4007
4958
|
] }));
|
|
4008
4959
|
}
|
|
4009
4960
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4010
4961
|
0 && (module.exports = {
|
|
4011
4962
|
Accordion,
|
|
4012
4963
|
Alert,
|
|
4964
|
+
AuthCard,
|
|
4965
|
+
AuthDivider,
|
|
4966
|
+
AuthLayout,
|
|
4013
4967
|
Avatar,
|
|
4014
4968
|
AvatarGroup,
|
|
4015
4969
|
Badge,
|
|
4016
4970
|
Breadcrumbs,
|
|
4017
4971
|
Button,
|
|
4018
4972
|
ButtonChrome,
|
|
4973
|
+
CANONICAL_ICONS,
|
|
4019
4974
|
Calendar,
|
|
4020
4975
|
Caption,
|
|
4021
4976
|
Card,
|
|
@@ -4037,9 +4992,15 @@ function InsightMiniCard(_a) {
|
|
|
4037
4992
|
DropdownButton,
|
|
4038
4993
|
DropdownItem,
|
|
4039
4994
|
DropdownMenu,
|
|
4995
|
+
DropdownRadioGroup,
|
|
4996
|
+
DropdownRadioItem,
|
|
4040
4997
|
EmptyState,
|
|
4041
4998
|
FileUpload,
|
|
4999
|
+
FilterBar,
|
|
4042
5000
|
FilterChips,
|
|
5001
|
+
FilterControls,
|
|
5002
|
+
FilterMenu,
|
|
5003
|
+
FormField,
|
|
4043
5004
|
H1,
|
|
4044
5005
|
H2,
|
|
4045
5006
|
H3,
|
|
@@ -4066,14 +5027,20 @@ function InsightMiniCard(_a) {
|
|
|
4066
5027
|
IconChevronRight,
|
|
4067
5028
|
IconClipboardEdit,
|
|
4068
5029
|
IconClose,
|
|
5030
|
+
IconCodePreview,
|
|
4069
5031
|
IconCohort,
|
|
5032
|
+
IconCommandCursor,
|
|
4070
5033
|
IconCopy,
|
|
4071
5034
|
IconCumulativeChart,
|
|
5035
|
+
IconDataReel,
|
|
4072
5036
|
IconDatabase,
|
|
4073
5037
|
IconDownload,
|
|
4074
5038
|
IconEdit,
|
|
4075
5039
|
IconErrorOutline,
|
|
5040
|
+
IconEventStream,
|
|
4076
5041
|
IconExclamation,
|
|
5042
|
+
IconExperimentSplit,
|
|
5043
|
+
IconFeatureGate,
|
|
4077
5044
|
IconFlag,
|
|
4078
5045
|
IconFlare,
|
|
4079
5046
|
IconFlask,
|
|
@@ -4081,19 +5048,24 @@ function InsightMiniCard(_a) {
|
|
|
4081
5048
|
IconGridView,
|
|
4082
5049
|
IconHandClick,
|
|
4083
5050
|
IconHome,
|
|
5051
|
+
IconInfo,
|
|
5052
|
+
IconInsightBoard,
|
|
4084
5053
|
IconLayers,
|
|
4085
5054
|
IconListView,
|
|
4086
5055
|
IconLogout,
|
|
4087
5056
|
IconMail,
|
|
4088
5057
|
IconMoon,
|
|
5058
|
+
IconOldWindow,
|
|
4089
5059
|
IconPanelRight,
|
|
4090
5060
|
IconPerson,
|
|
4091
5061
|
IconPlayCircle,
|
|
4092
5062
|
IconPlus,
|
|
4093
5063
|
IconPremium,
|
|
4094
5064
|
IconQueryEditor,
|
|
5065
|
+
IconQueryStack,
|
|
4095
5066
|
IconRadar,
|
|
4096
5067
|
IconRecording,
|
|
5068
|
+
IconReplayFrame,
|
|
4097
5069
|
IconRobot,
|
|
4098
5070
|
IconRocket,
|
|
4099
5071
|
IconSave,
|
|
@@ -4104,6 +5076,7 @@ function InsightMiniCard(_a) {
|
|
|
4104
5076
|
IconStar,
|
|
4105
5077
|
IconSubArrowRight,
|
|
4106
5078
|
IconSun,
|
|
5079
|
+
IconSurveyCard,
|
|
4107
5080
|
IconSurveys,
|
|
4108
5081
|
IconSync,
|
|
4109
5082
|
IconTableChart,
|
|
@@ -4127,12 +5100,16 @@ function InsightMiniCard(_a) {
|
|
|
4127
5100
|
Kbd,
|
|
4128
5101
|
Label,
|
|
4129
5102
|
Lead,
|
|
5103
|
+
Loader,
|
|
5104
|
+
LoadingState,
|
|
4130
5105
|
MiniTrendBars,
|
|
4131
5106
|
Modal,
|
|
4132
5107
|
Mono,
|
|
5108
|
+
OLD_UI_ICONS,
|
|
4133
5109
|
Overline,
|
|
4134
5110
|
P,
|
|
4135
5111
|
PH_ICONS,
|
|
5112
|
+
PH_ICON_ALIASES,
|
|
4136
5113
|
Pagination,
|
|
4137
5114
|
Panel,
|
|
4138
5115
|
Progress,
|
|
@@ -4143,8 +5120,12 @@ function InsightMiniCard(_a) {
|
|
|
4143
5120
|
SearchInput,
|
|
4144
5121
|
SegmentedControl,
|
|
4145
5122
|
Select,
|
|
5123
|
+
SettingsLayout,
|
|
5124
|
+
SettingsNav,
|
|
4146
5125
|
ShowcaseWrapper,
|
|
5126
|
+
Skeleton,
|
|
4147
5127
|
Small,
|
|
5128
|
+
SortMenu,
|
|
4148
5129
|
Stat,
|
|
4149
5130
|
Stepper,
|
|
4150
5131
|
THEMES,
|