@xenide-io/the-old-ui-theme 0.2.9 → 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-SHF57J7U.mjs → chunk-FDMD3IIN.mjs} +1573 -652
- package/dist/index-D1RTT2Ap.d.mts +1044 -0
- package/dist/index-D1RTT2Ap.d.ts +1044 -0
- package/dist/index.d.mts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.js +1705 -744
- package/dist/index.mjs +61 -1
- package/dist/tailwind-preset.js +7 -0
- package/dist/tailwind-preset.mjs +7 -0
- package/dist/ui.d.mts +3 -2
- package/dist/ui.d.ts +3 -2
- package/dist/ui.js +1584 -666
- package/dist/ui.mjs +31 -1
- package/package.json +18 -4
- package/src/app/globals.css +1005 -227
- package/src/components/icons/IconBase.tsx +20 -12
- package/src/components/icons/createIconBase.tsx +12 -7
- package/src/components/icons/icons.tsx +208 -18
- package/src/components/sections/AlertShowcase.tsx +2 -1
- package/src/components/sections/BadgeShowcase.tsx +1 -1
- package/src/components/sections/ButtonShowcase.tsx +6 -10
- package/src/components/sections/CardShowcase.tsx +22 -6
- package/src/components/sections/DropdownShowcase.tsx +4 -6
- package/src/components/sections/FilterChipsShowcase.tsx +74 -26
- package/src/components/sections/FormShowcase.tsx +2 -1
- package/src/components/sections/IconShowcase.tsx +86 -206
- package/src/components/sections/KbdShowcase.tsx +47 -21
- package/src/components/sections/ModalShowcase.tsx +7 -6
- package/src/components/sections/ProductLayoutsShowcase.tsx +138 -0
- package/src/components/sections/ProgressShowcase.tsx +50 -53
- package/src/components/sections/SwapShowcase.tsx +13 -5
- package/src/components/ui/Alert.tsx +28 -19
- package/src/components/ui/AuthLayout.tsx +58 -0
- package/src/components/ui/Badge.tsx +10 -5
- package/src/components/ui/Button.tsx +22 -12
- package/src/components/ui/ButtonChrome.tsx +1 -1
- package/src/components/ui/Calendar.tsx +6 -7
- package/src/components/ui/Card.tsx +21 -11
- package/src/components/ui/CollapsibleSection.tsx +11 -11
- package/src/components/ui/DropdownMenu.tsx +189 -65
- package/src/components/ui/FilterBar.tsx +165 -0
- package/src/components/ui/FilterChips.tsx +65 -35
- package/src/components/ui/FilterControls.tsx +30 -0
- package/src/components/ui/FormField.tsx +69 -0
- package/src/components/ui/Input.tsx +166 -140
- package/src/components/ui/Kbd.tsx +88 -13
- package/src/components/ui/Loader.tsx +96 -0
- package/src/components/ui/Modal.tsx +66 -36
- package/src/components/ui/SettingsLayout.tsx +94 -0
- package/src/components/ui/ShowcaseWrapper.tsx +4 -16
- package/src/components/ui/Stepper.tsx +5 -6
- package/src/components/ui/first-slice.test.tsx +98 -0
- package/src/components/ui/index.ts +62 -3
- 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 +411 -1
- package/tailwind-preset.ts +7 -0
- package/dist/index-CmS6hcUk.d.mts +0 -753
- package/dist/index-CmS6hcUk.d.ts +0 -753
package/dist/ui.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/components/ui/index.ts
|
|
@@ -51,6 +61,9 @@ var ui_exports = {};
|
|
|
51
61
|
__export(ui_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,
|
|
@@ -71,9 +84,15 @@ __export(ui_exports, {
|
|
|
71
84
|
DropdownButton: () => DropdownButton,
|
|
72
85
|
DropdownItem: () => DropdownItem,
|
|
73
86
|
DropdownMenu: () => DropdownMenu,
|
|
87
|
+
DropdownRadioGroup: () => DropdownRadioGroup,
|
|
88
|
+
DropdownRadioItem: () => DropdownRadioItem,
|
|
74
89
|
EmptyState: () => EmptyState,
|
|
75
90
|
FileUpload: () => FileUpload,
|
|
91
|
+
FilterBar: () => FilterBar,
|
|
76
92
|
FilterChips: () => FilterChips,
|
|
93
|
+
FilterControls: () => FilterControls,
|
|
94
|
+
FilterMenu: () => FilterMenu,
|
|
95
|
+
FormField: () => FormField,
|
|
77
96
|
H1: () => H1,
|
|
78
97
|
H2: () => H2,
|
|
79
98
|
H3: () => H3,
|
|
@@ -87,6 +106,8 @@ __export(ui_exports, {
|
|
|
87
106
|
Kbd: () => Kbd,
|
|
88
107
|
Label: () => Label,
|
|
89
108
|
Lead: () => Lead,
|
|
109
|
+
Loader: () => Loader,
|
|
110
|
+
LoadingState: () => LoadingState,
|
|
90
111
|
Modal: () => Modal,
|
|
91
112
|
Mono: () => Mono,
|
|
92
113
|
Overline: () => Overline,
|
|
@@ -101,8 +122,12 @@ __export(ui_exports, {
|
|
|
101
122
|
SearchInput: () => SearchInput,
|
|
102
123
|
SegmentedControl: () => SegmentedControl,
|
|
103
124
|
Select: () => Select,
|
|
125
|
+
SettingsLayout: () => SettingsLayout,
|
|
126
|
+
SettingsNav: () => SettingsNav,
|
|
104
127
|
ShowcaseWrapper: () => ShowcaseWrapper,
|
|
128
|
+
Skeleton: () => Skeleton,
|
|
105
129
|
Small: () => Small,
|
|
130
|
+
SortMenu: () => SortMenu,
|
|
106
131
|
Stat: () => Stat,
|
|
107
132
|
Stepper: () => Stepper,
|
|
108
133
|
Table: () => Table,
|
|
@@ -119,6 +144,9 @@ __export(ui_exports, {
|
|
|
119
144
|
});
|
|
120
145
|
module.exports = __toCommonJS(ui_exports);
|
|
121
146
|
|
|
147
|
+
// src/components/ui/Button.tsx
|
|
148
|
+
var import_react = require("react");
|
|
149
|
+
|
|
122
150
|
// src/components/ui/ButtonChrome.tsx
|
|
123
151
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
124
152
|
function ButtonChrome({ label, icon, sideIcon, split }) {
|
|
@@ -163,7 +191,7 @@ var shapeClass = {
|
|
|
163
191
|
square: "ph-btn-square",
|
|
164
192
|
wide: "ph-btn-wide"
|
|
165
193
|
};
|
|
166
|
-
|
|
194
|
+
var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
167
195
|
var _b = _a, {
|
|
168
196
|
variant = "secondary",
|
|
169
197
|
size = "md",
|
|
@@ -172,9 +200,12 @@ function Button(_a) {
|
|
|
172
200
|
split = false,
|
|
173
201
|
icon,
|
|
174
202
|
sideIcon,
|
|
203
|
+
loading = false,
|
|
204
|
+
loadingLabel,
|
|
175
205
|
className,
|
|
176
206
|
children,
|
|
177
|
-
type = "button"
|
|
207
|
+
type = "button",
|
|
208
|
+
disabled
|
|
178
209
|
} = _b, props = __objRest(_b, [
|
|
179
210
|
"variant",
|
|
180
211
|
"size",
|
|
@@ -183,23 +214,32 @@ function Button(_a) {
|
|
|
183
214
|
"split",
|
|
184
215
|
"icon",
|
|
185
216
|
"sideIcon",
|
|
217
|
+
"loading",
|
|
218
|
+
"loadingLabel",
|
|
186
219
|
"className",
|
|
187
220
|
"children",
|
|
188
|
-
"type"
|
|
221
|
+
"type",
|
|
222
|
+
"disabled"
|
|
189
223
|
]);
|
|
190
|
-
const usesLemonChrome =
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
224
|
+
const usesLemonChrome = !["tertiary", "ghost", "link"].includes(variant);
|
|
225
|
+
const label = loadingLabel != null ? loadingLabel : children;
|
|
226
|
+
const leadingIcon = loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-spinner", "aria-hidden": true }) : icon;
|
|
227
|
+
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: [
|
|
228
|
+
leadingIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-icon", children: leadingIcon }) : null,
|
|
229
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-label", children: label }) : null,
|
|
194
230
|
split ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-split-divider", "aria-hidden": true }) : null,
|
|
195
231
|
sideIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-side-icon", children: sideIcon }) : null
|
|
196
232
|
] });
|
|
197
233
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
198
234
|
"button",
|
|
199
235
|
__spreadProps(__spreadValues({
|
|
236
|
+
ref,
|
|
200
237
|
type,
|
|
238
|
+
disabled: disabled || loading,
|
|
239
|
+
"aria-busy": loading || void 0,
|
|
201
240
|
className: cn(
|
|
202
241
|
"ph-btn",
|
|
242
|
+
usesLemonChrome && "ph-btn-raised",
|
|
203
243
|
outline && "ph-btn-outline",
|
|
204
244
|
variantClass[variant],
|
|
205
245
|
sizeClass[size],
|
|
@@ -211,11 +251,16 @@ function Button(_a) {
|
|
|
211
251
|
children: content
|
|
212
252
|
})
|
|
213
253
|
);
|
|
214
|
-
}
|
|
254
|
+
});
|
|
255
|
+
Button.displayName = "Button";
|
|
256
|
+
|
|
257
|
+
// src/components/ui/Alert.tsx
|
|
258
|
+
var import_react5 = require("react");
|
|
215
259
|
|
|
216
260
|
// src/components/icons/IconBase.tsx
|
|
261
|
+
var import_react2 = require("react");
|
|
217
262
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
218
|
-
|
|
263
|
+
var IconBase = (0, import_react2.forwardRef)(function IconBase2(_a, ref) {
|
|
219
264
|
var _b = _a, {
|
|
220
265
|
className,
|
|
221
266
|
size,
|
|
@@ -223,7 +268,12 @@ function IconBase(_a) {
|
|
|
223
268
|
viewBox = "0 0 24 24",
|
|
224
269
|
fill: fill2 = "none",
|
|
225
270
|
xmlns = "http://www.w3.org/2000/svg",
|
|
226
|
-
focusable = "false"
|
|
271
|
+
focusable = "false",
|
|
272
|
+
style,
|
|
273
|
+
role,
|
|
274
|
+
"aria-hidden": ariaHidden,
|
|
275
|
+
"aria-label": ariaLabel,
|
|
276
|
+
"aria-labelledby": ariaLabelledBy
|
|
227
277
|
} = _b, props = __objRest(_b, [
|
|
228
278
|
"className",
|
|
229
279
|
"size",
|
|
@@ -231,41 +281,55 @@ function IconBase(_a) {
|
|
|
231
281
|
"viewBox",
|
|
232
282
|
"fill",
|
|
233
283
|
"xmlns",
|
|
234
|
-
"focusable"
|
|
284
|
+
"focusable",
|
|
285
|
+
"style",
|
|
286
|
+
"role",
|
|
287
|
+
"aria-hidden",
|
|
288
|
+
"aria-label",
|
|
289
|
+
"aria-labelledby"
|
|
235
290
|
]);
|
|
236
|
-
|
|
237
|
-
const dimensionProps = size != null ? { width: size, height: size } : {};
|
|
291
|
+
const hasAccessibleName = Boolean(ariaLabel || ariaLabelledBy);
|
|
238
292
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
239
293
|
"svg",
|
|
240
|
-
__spreadProps(__spreadValues(
|
|
241
|
-
|
|
242
|
-
|
|
294
|
+
__spreadProps(__spreadValues({
|
|
295
|
+
ref,
|
|
296
|
+
className: cn("ph-icon", className),
|
|
243
297
|
viewBox,
|
|
244
298
|
fill: fill2,
|
|
245
299
|
xmlns,
|
|
246
300
|
focusable,
|
|
247
|
-
|
|
248
|
-
|
|
301
|
+
role: role != null ? role : hasAccessibleName ? "img" : void 0,
|
|
302
|
+
"aria-hidden": ariaHidden != null ? ariaHidden : hasAccessibleName ? void 0 : true,
|
|
303
|
+
"aria-label": ariaLabel,
|
|
304
|
+
"aria-labelledby": ariaLabelledBy,
|
|
305
|
+
style: __spreadValues({ width: size, height: size }, style)
|
|
306
|
+
}, props), {
|
|
249
307
|
children
|
|
250
308
|
})
|
|
251
309
|
);
|
|
252
|
-
}
|
|
310
|
+
});
|
|
311
|
+
IconBase.displayName = "IconBase";
|
|
253
312
|
|
|
254
313
|
// src/components/icons/createIconBase.tsx
|
|
314
|
+
var import_react3 = require("react");
|
|
255
315
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
256
|
-
function createIconBase({ viewBox = "0 0 24 24", paths }) {
|
|
257
|
-
|
|
258
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconBase, __spreadProps(__spreadValues({ viewBox }, props), { children: paths }));
|
|
259
|
-
};
|
|
316
|
+
function createIconBase({ name = "IconGlyph", viewBox = "0 0 24 24", paths }) {
|
|
317
|
+
const IconGlyph = (0, import_react3.forwardRef)(function IconGlyph2(props, ref) {
|
|
318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconBase, __spreadProps(__spreadValues({ ref, viewBox }, props), { children: paths }));
|
|
319
|
+
});
|
|
320
|
+
IconGlyph.displayName = name;
|
|
321
|
+
return IconGlyph;
|
|
260
322
|
}
|
|
261
|
-
function createIconBasePath(d, viewBox = "0 0 24 24") {
|
|
323
|
+
function createIconBasePath(d, viewBox = "0 0 24 24", name) {
|
|
262
324
|
return createIconBase({
|
|
325
|
+
name,
|
|
263
326
|
viewBox,
|
|
264
327
|
paths: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d, fill: "currentColor" })
|
|
265
328
|
});
|
|
266
329
|
}
|
|
267
330
|
|
|
268
331
|
// src/components/icons/icons.tsx
|
|
332
|
+
var import_react4 = require("react");
|
|
269
333
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
270
334
|
var fill = (d) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d, fill: "currentColor" });
|
|
271
335
|
var IconAreaChart = createIconBase({
|
|
@@ -374,6 +438,12 @@ var IconErrorOutline = createIconBase({
|
|
|
374
438
|
"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"
|
|
375
439
|
)
|
|
376
440
|
});
|
|
441
|
+
var IconInfo = createIconBase({
|
|
442
|
+
name: "IconInfo",
|
|
443
|
+
paths: fill(
|
|
444
|
+
"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"
|
|
445
|
+
)
|
|
446
|
+
});
|
|
377
447
|
var IconCancel = createIconBase({
|
|
378
448
|
paths: fill(
|
|
379
449
|
"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"
|
|
@@ -471,18 +541,145 @@ var IconToggle = createIconBasePath(
|
|
|
471
541
|
var IconRocket = createIconBasePath(
|
|
472
542
|
"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"
|
|
473
543
|
);
|
|
474
|
-
var IconTerminal =
|
|
544
|
+
var IconTerminal = createIconBase({
|
|
545
|
+
name: "IconTerminal",
|
|
546
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
547
|
+
"path",
|
|
548
|
+
{
|
|
549
|
+
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",
|
|
550
|
+
fill: "currentColor",
|
|
551
|
+
fillRule: "evenodd",
|
|
552
|
+
clipRule: "evenodd"
|
|
553
|
+
}
|
|
554
|
+
)
|
|
555
|
+
});
|
|
556
|
+
var IconOldWindow = createIconBase({
|
|
557
|
+
name: "IconOldWindow",
|
|
558
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
559
|
+
"path",
|
|
560
|
+
{
|
|
561
|
+
d: "M3 3v18h18V3H3zm2 7v9h14v-9H5zm1-4h2v1H6V6zm3 0h2v1H9V6z",
|
|
562
|
+
fill: "currentColor",
|
|
563
|
+
fillRule: "evenodd",
|
|
564
|
+
clipRule: "evenodd"
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
|
+
});
|
|
568
|
+
var IconCommandCursor = createIconBase({
|
|
569
|
+
name: "IconCommandCursor",
|
|
570
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
571
|
+
"path",
|
|
572
|
+
{
|
|
573
|
+
d: "M4 3v18h16V3H4zm2 2h12v14H6V5zm1.5 3.5L11 12l-3.5 3.5L9 17l5-5-5-5-1.5 1.5zM13 17h4v-2h-4v2z",
|
|
574
|
+
fill: "currentColor",
|
|
575
|
+
fillRule: "evenodd",
|
|
576
|
+
clipRule: "evenodd"
|
|
577
|
+
}
|
|
578
|
+
)
|
|
579
|
+
});
|
|
580
|
+
var IconDataReel = createIconBase({
|
|
581
|
+
name: "IconDataReel",
|
|
582
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
583
|
+
"path",
|
|
584
|
+
{
|
|
585
|
+
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",
|
|
586
|
+
fill: "currentColor",
|
|
587
|
+
fillRule: "evenodd",
|
|
588
|
+
clipRule: "evenodd"
|
|
589
|
+
}
|
|
590
|
+
)
|
|
591
|
+
});
|
|
592
|
+
var IconCodePreview = createIconBase({
|
|
593
|
+
name: "IconCodePreview",
|
|
594
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
595
|
+
"path",
|
|
596
|
+
{
|
|
597
|
+
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",
|
|
598
|
+
fill: "currentColor",
|
|
599
|
+
fillRule: "evenodd",
|
|
600
|
+
clipRule: "evenodd"
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
});
|
|
604
|
+
var IconInsightBoard = createIconBase({
|
|
605
|
+
name: "IconInsightBoard",
|
|
606
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
607
|
+
"path",
|
|
608
|
+
{
|
|
609
|
+
d: "M3 3v18h18V3H3zm2 2h14v3H5V5zm0 5h6v9H5v-9zm8 0h6v4h-6v-4zm0 6h6v3h-6v-3zM6 6h2v1H6V6zm3 0h2v1H9V6z",
|
|
610
|
+
fill: "currentColor",
|
|
611
|
+
fillRule: "evenodd",
|
|
612
|
+
clipRule: "evenodd"
|
|
613
|
+
}
|
|
614
|
+
)
|
|
615
|
+
});
|
|
616
|
+
var IconEventStream = createIconBase({
|
|
617
|
+
name: "IconEventStream",
|
|
618
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M5 4h2v16H5V4z", fill: "currentColor", opacity: "0.45" }),
|
|
620
|
+
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")
|
|
621
|
+
] })
|
|
622
|
+
});
|
|
623
|
+
var IconFeatureGate = createIconBase({
|
|
624
|
+
name: "IconFeatureGate",
|
|
625
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
626
|
+
"path",
|
|
627
|
+
{
|
|
628
|
+
d: "M4 3h2v18H4V3zm3 2h12l-3 4 3 4H7V5zm4 1-2.2 4H12l-1 4 4.2-5H12l1-3h-2z",
|
|
629
|
+
fill: "currentColor",
|
|
630
|
+
fillRule: "evenodd",
|
|
631
|
+
clipRule: "evenodd"
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
});
|
|
635
|
+
var IconReplayFrame = createIconBase({
|
|
636
|
+
name: "IconReplayFrame",
|
|
637
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
638
|
+
"path",
|
|
639
|
+
{
|
|
640
|
+
d: "M3 3v18h18V3H3zm2 2h14v11H5V5zm5 2v7l6-3.5L10 7zm-5 11h9v1H5v-1zm11 0h3v1h-3v-1z",
|
|
641
|
+
fill: "currentColor",
|
|
642
|
+
fillRule: "evenodd",
|
|
643
|
+
clipRule: "evenodd"
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
});
|
|
647
|
+
var IconQueryStack = createIconBase({
|
|
648
|
+
name: "IconQueryStack",
|
|
649
|
+
paths: fill(
|
|
650
|
+
"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"
|
|
651
|
+
)
|
|
652
|
+
});
|
|
653
|
+
var IconExperimentSplit = createIconBase({
|
|
654
|
+
name: "IconExperimentSplit",
|
|
655
|
+
paths: fill(
|
|
656
|
+
"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"
|
|
657
|
+
)
|
|
658
|
+
});
|
|
659
|
+
var IconSurveyCard = createIconBase({
|
|
660
|
+
name: "IconSurveyCard",
|
|
661
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
662
|
+
"path",
|
|
663
|
+
{
|
|
664
|
+
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",
|
|
665
|
+
fill: "currentColor",
|
|
666
|
+
fillRule: "evenodd",
|
|
667
|
+
clipRule: "evenodd"
|
|
668
|
+
}
|
|
669
|
+
)
|
|
670
|
+
});
|
|
475
671
|
var IconActivity = createIconBasePath(
|
|
476
672
|
"M22 12h-4l-3 9L9 3l-3 9H2v2h6.76l2.24-6.72L15 15l2.24-6.72L19 14h3v-2z"
|
|
477
673
|
);
|
|
478
674
|
var IconFlask = createIconBasePath(
|
|
479
675
|
"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"
|
|
480
676
|
);
|
|
481
|
-
|
|
677
|
+
var IconSpinner = (0, import_react4.forwardRef)(function IconSpinner2(_a, ref) {
|
|
482
678
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
483
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconSync, __spreadValues({ className: cn("ph-icon-spin", className) }, props));
|
|
484
|
-
}
|
|
485
|
-
|
|
679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconSync, __spreadValues({ ref, className: cn("ph-icon-spin", className) }, props));
|
|
680
|
+
});
|
|
681
|
+
IconSpinner.displayName = "IconSpinner";
|
|
682
|
+
var CANONICAL_ICONS = {
|
|
486
683
|
activity: IconActivity,
|
|
487
684
|
areaChart: IconAreaChart,
|
|
488
685
|
arrowDown: IconArrowDown,
|
|
@@ -497,74 +694,100 @@ var PH_ICONS = {
|
|
|
497
694
|
chevronDown: IconChevronDown,
|
|
498
695
|
chevronLeft: IconChevronLeft,
|
|
499
696
|
chevronRight: IconChevronRight,
|
|
500
|
-
|
|
697
|
+
clipboardEdit: IconClipboardEdit,
|
|
501
698
|
close: IconClose,
|
|
699
|
+
codePreview: IconCodePreview,
|
|
502
700
|
cohort: IconCohort,
|
|
701
|
+
commandCursor: IconCommandCursor,
|
|
503
702
|
copy: IconCopy,
|
|
504
703
|
cumulativeChart: IconCumulativeChart,
|
|
704
|
+
dataReel: IconDataReel,
|
|
505
705
|
database: IconDatabase,
|
|
506
706
|
download: IconDownload,
|
|
507
707
|
edit: IconEdit,
|
|
508
708
|
errorOutline: IconErrorOutline,
|
|
709
|
+
eventStream: IconEventStream,
|
|
509
710
|
exclamation: IconExclamation,
|
|
711
|
+
experimentSplit: IconExperimentSplit,
|
|
712
|
+
featureGate: IconFeatureGate,
|
|
510
713
|
flag: IconFlag,
|
|
511
714
|
flare: IconFlare,
|
|
512
715
|
flask: IconFlask,
|
|
513
716
|
gift: IconGift,
|
|
514
|
-
|
|
717
|
+
gridView: IconGridView,
|
|
515
718
|
handClick: IconHandClick,
|
|
516
719
|
home: IconHome,
|
|
517
|
-
info:
|
|
720
|
+
info: IconInfo,
|
|
721
|
+
insightBoard: IconInsightBoard,
|
|
518
722
|
layers: IconLayers,
|
|
519
|
-
|
|
723
|
+
listView: IconListView,
|
|
520
724
|
logout: IconLogout,
|
|
521
725
|
mail: IconMail,
|
|
522
726
|
moon: IconMoon,
|
|
727
|
+
oldWindow: IconOldWindow,
|
|
523
728
|
panelRight: IconPanelRight,
|
|
524
729
|
person: IconPerson,
|
|
525
|
-
|
|
730
|
+
playCircle: IconPlayCircle,
|
|
526
731
|
plus: IconPlus,
|
|
527
732
|
premium: IconPremium,
|
|
528
733
|
queryEditor: IconQueryEditor,
|
|
734
|
+
queryStack: IconQueryStack,
|
|
529
735
|
radar: IconRadar,
|
|
530
736
|
recording: IconRecording,
|
|
737
|
+
replayFrame: IconReplayFrame,
|
|
531
738
|
robot: IconRobot,
|
|
532
739
|
rocket: IconRocket,
|
|
533
740
|
save: IconSave,
|
|
534
741
|
search: IconSearch,
|
|
535
742
|
selectEvents: IconSelectEvents,
|
|
536
|
-
settings: IconTuning,
|
|
537
743
|
shoppingCart: IconShoppingCart,
|
|
538
744
|
spinner: IconSpinner,
|
|
539
745
|
star: IconStar,
|
|
540
746
|
subArrowRight: IconSubArrowRight,
|
|
541
747
|
sun: IconSun,
|
|
748
|
+
surveyCard: IconSurveyCard,
|
|
542
749
|
surveys: IconSurveys,
|
|
543
750
|
sync: IconSync,
|
|
544
751
|
tableChart: IconTableChart,
|
|
545
752
|
terminal: IconTerminal,
|
|
546
753
|
toggle: IconToggle,
|
|
547
754
|
trash: IconTrash,
|
|
548
|
-
|
|
755
|
+
tuning: IconTuning,
|
|
549
756
|
upload: IconUpload,
|
|
550
757
|
volume: IconVolume,
|
|
551
|
-
volumeOff: IconVolumeOff
|
|
758
|
+
volumeOff: IconVolumeOff
|
|
759
|
+
};
|
|
760
|
+
var PH_ICON_ALIASES = {
|
|
761
|
+
clipboard: IconClipboardEdit,
|
|
762
|
+
grid: IconGridView,
|
|
763
|
+
list: IconListView,
|
|
764
|
+
play: IconPlayCircle,
|
|
765
|
+
settings: IconTuning,
|
|
766
|
+
trendingUp: IconArrowUp,
|
|
552
767
|
warning: IconExclamation,
|
|
553
768
|
xCircle: IconCancel
|
|
554
769
|
};
|
|
555
|
-
|
|
770
|
+
var PH_ICONS = __spreadValues(__spreadValues({}, CANONICAL_ICONS), PH_ICON_ALIASES);
|
|
771
|
+
for (const [name, Icon] of Object.entries(CANONICAL_ICONS)) {
|
|
772
|
+
const namedIcon = Icon;
|
|
773
|
+
if (!namedIcon.displayName || namedIcon.displayName === "IconGlyph") {
|
|
774
|
+
namedIcon.displayName = `Icon${name[0].toUpperCase()}${name.slice(1)}`;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
var IconByName = (0, import_react4.forwardRef)(function IconByName2(_a, ref) {
|
|
556
778
|
var _b = _a, { name } = _b, props = __objRest(_b, ["name"]);
|
|
557
779
|
const Icon = PH_ICONS[name];
|
|
558
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, __spreadValues({}, props));
|
|
559
|
-
}
|
|
780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, __spreadValues({ ref }, props));
|
|
781
|
+
});
|
|
782
|
+
IconByName.displayName = "IconByName";
|
|
560
783
|
|
|
561
784
|
// src/components/ui/Alert.tsx
|
|
562
785
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
563
786
|
var statusConfig = {
|
|
564
|
-
info: { icon:
|
|
565
|
-
success: { icon: IconCheckCircle
|
|
566
|
-
warning: { icon: IconExclamation
|
|
567
|
-
danger: { icon: IconCancel
|
|
787
|
+
info: { icon: IconInfo },
|
|
788
|
+
success: { icon: IconCheckCircle },
|
|
789
|
+
warning: { icon: IconExclamation },
|
|
790
|
+
danger: { icon: IconCancel }
|
|
568
791
|
};
|
|
569
792
|
var statusClassMap = {
|
|
570
793
|
info: "ph-alert-info",
|
|
@@ -572,25 +795,43 @@ var statusClassMap = {
|
|
|
572
795
|
warning: "ph-alert-warning",
|
|
573
796
|
danger: "ph-alert-danger"
|
|
574
797
|
};
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
798
|
+
var Alert = (0, import_react5.forwardRef)(function Alert2(_a, ref) {
|
|
799
|
+
var _b = _a, {
|
|
800
|
+
status = "info",
|
|
801
|
+
title,
|
|
802
|
+
description,
|
|
803
|
+
icon,
|
|
804
|
+
children,
|
|
805
|
+
className,
|
|
806
|
+
onDismiss,
|
|
807
|
+
live,
|
|
808
|
+
dismissLabel = "Dismiss notification",
|
|
809
|
+
role
|
|
810
|
+
} = _b, props = __objRest(_b, [
|
|
811
|
+
"status",
|
|
812
|
+
"title",
|
|
813
|
+
"description",
|
|
814
|
+
"icon",
|
|
815
|
+
"children",
|
|
816
|
+
"className",
|
|
817
|
+
"onDismiss",
|
|
818
|
+
"live",
|
|
819
|
+
"dismissLabel",
|
|
820
|
+
"role"
|
|
821
|
+
]);
|
|
584
822
|
const config = statusConfig[status];
|
|
585
823
|
const Icon = config.icon;
|
|
586
824
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
587
825
|
"div",
|
|
588
|
-
{
|
|
589
|
-
|
|
590
|
-
|
|
826
|
+
__spreadProps(__spreadValues({
|
|
827
|
+
ref,
|
|
828
|
+
role: role != null ? role : live === "assertive" ? "alert" : live === "polite" ? "status" : void 0,
|
|
829
|
+
"aria-live": live,
|
|
830
|
+
className: cn("ph-alert", statusClassMap[status], className)
|
|
831
|
+
}, props), {
|
|
591
832
|
children: [
|
|
592
|
-
icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className:
|
|
593
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1", children: [
|
|
833
|
+
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 }),
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
594
835
|
title && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "font-semibold", children: title }),
|
|
595
836
|
description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mt-1 text-sm text-ph-subtle", children: description }),
|
|
596
837
|
children
|
|
@@ -600,17 +841,19 @@ function Alert({
|
|
|
600
841
|
{
|
|
601
842
|
type: "button",
|
|
602
843
|
onClick: onDismiss,
|
|
603
|
-
className: "
|
|
604
|
-
"aria-label":
|
|
605
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
844
|
+
className: "ph-alert-dismiss",
|
|
845
|
+
"aria-label": dismissLabel,
|
|
846
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconClose, { className: "h-4 w-4", "aria-hidden": true })
|
|
606
847
|
}
|
|
607
848
|
)
|
|
608
849
|
]
|
|
609
|
-
}
|
|
850
|
+
})
|
|
610
851
|
);
|
|
611
|
-
}
|
|
852
|
+
});
|
|
853
|
+
Alert.displayName = "Alert";
|
|
612
854
|
|
|
613
855
|
// src/components/ui/Badge.tsx
|
|
856
|
+
var import_react6 = require("react");
|
|
614
857
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
615
858
|
var variantMap = {
|
|
616
859
|
brand: "ph-badge-brand",
|
|
@@ -625,66 +868,95 @@ var sizeMap = {
|
|
|
625
868
|
sm: "text-[10px] px-1.5 py-0.5",
|
|
626
869
|
md: ""
|
|
627
870
|
};
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
871
|
+
var Badge = (0, import_react6.forwardRef)(function Badge2(_a, ref) {
|
|
872
|
+
var _b = _a, {
|
|
873
|
+
variant = "neutral",
|
|
874
|
+
size = "md",
|
|
875
|
+
children,
|
|
876
|
+
className
|
|
877
|
+
} = _b, props = __objRest(_b, [
|
|
878
|
+
"variant",
|
|
879
|
+
"size",
|
|
880
|
+
"children",
|
|
881
|
+
"className"
|
|
882
|
+
]);
|
|
634
883
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
635
884
|
"span",
|
|
636
|
-
{
|
|
885
|
+
__spreadProps(__spreadValues({
|
|
886
|
+
ref,
|
|
637
887
|
className: cn(
|
|
638
888
|
"ph-badge",
|
|
639
889
|
variantMap[variant],
|
|
640
890
|
sizeMap[size],
|
|
641
891
|
className
|
|
642
|
-
)
|
|
892
|
+
)
|
|
893
|
+
}, props), {
|
|
643
894
|
children
|
|
644
|
-
}
|
|
895
|
+
})
|
|
645
896
|
);
|
|
646
|
-
}
|
|
897
|
+
});
|
|
898
|
+
Badge.displayName = "Badge";
|
|
647
899
|
|
|
648
900
|
// src/components/ui/Card.tsx
|
|
901
|
+
var import_react7 = require("react");
|
|
649
902
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
650
903
|
var variantMap2 = {
|
|
651
|
-
default: "
|
|
652
|
-
outlined: "border-2 border-ph-border
|
|
653
|
-
elevated: "
|
|
654
|
-
highlighted: "
|
|
904
|
+
default: "",
|
|
905
|
+
outlined: "border-2 border-ph-border",
|
|
906
|
+
elevated: "ph-card-elevated",
|
|
907
|
+
highlighted: "ph-card-highlighted"
|
|
655
908
|
};
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
909
|
+
var Card = (0, import_react7.forwardRef)(function Card2(_a, ref) {
|
|
910
|
+
var _b = _a, {
|
|
911
|
+
children,
|
|
912
|
+
title,
|
|
913
|
+
description,
|
|
914
|
+
actions,
|
|
915
|
+
footer,
|
|
916
|
+
media,
|
|
917
|
+
variant = "default",
|
|
918
|
+
className,
|
|
919
|
+
bodyClassName,
|
|
920
|
+
interactive = false,
|
|
921
|
+
titleAs: Title2 = "h3"
|
|
922
|
+
} = _b, props = __objRest(_b, [
|
|
923
|
+
"children",
|
|
924
|
+
"title",
|
|
925
|
+
"description",
|
|
926
|
+
"actions",
|
|
927
|
+
"footer",
|
|
928
|
+
"media",
|
|
929
|
+
"variant",
|
|
930
|
+
"className",
|
|
931
|
+
"bodyClassName",
|
|
932
|
+
"interactive",
|
|
933
|
+
"titleAs"
|
|
934
|
+
]);
|
|
667
935
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
668
936
|
"div",
|
|
669
|
-
{
|
|
937
|
+
__spreadProps(__spreadValues({
|
|
938
|
+
ref,
|
|
670
939
|
className: cn(
|
|
671
940
|
"ph-card",
|
|
672
941
|
variantMap2[variant],
|
|
942
|
+
interactive && "ph-card-interactive",
|
|
673
943
|
className
|
|
674
|
-
)
|
|
944
|
+
)
|
|
945
|
+
}, props), {
|
|
675
946
|
children: [
|
|
676
|
-
media && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "-
|
|
947
|
+
media && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ph-card-media", children: media }),
|
|
677
948
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("ph-card-body", bodyClassName), children: [
|
|
678
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
949
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Title2, { className: "ph-card-title", children: title }),
|
|
679
950
|
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
680
951
|
children,
|
|
681
952
|
actions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ph-card-actions", children: actions })
|
|
682
953
|
] }),
|
|
683
954
|
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 })
|
|
684
955
|
]
|
|
685
|
-
}
|
|
956
|
+
})
|
|
686
957
|
);
|
|
687
|
-
}
|
|
958
|
+
});
|
|
959
|
+
Card.displayName = "Card";
|
|
688
960
|
|
|
689
961
|
// src/components/ui/Drawer.tsx
|
|
690
962
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
@@ -735,21 +1007,269 @@ function Drawer({
|
|
|
735
1007
|
|
|
736
1008
|
// src/components/ui/Kbd.tsx
|
|
737
1009
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1010
|
+
var platformLabels = {
|
|
1011
|
+
text: {
|
|
1012
|
+
command: "Command",
|
|
1013
|
+
cmd: "Command",
|
|
1014
|
+
option: "Option",
|
|
1015
|
+
alt: "Alt",
|
|
1016
|
+
control: "Control",
|
|
1017
|
+
ctrl: "Control",
|
|
1018
|
+
shift: "Shift"
|
|
1019
|
+
},
|
|
1020
|
+
mac: {
|
|
1021
|
+
command: "\u2318",
|
|
1022
|
+
cmd: "\u2318",
|
|
1023
|
+
option: "\u2325",
|
|
1024
|
+
alt: "\u2325",
|
|
1025
|
+
control: "\u2303",
|
|
1026
|
+
ctrl: "\u2303",
|
|
1027
|
+
shift: "\u21E7"
|
|
1028
|
+
},
|
|
1029
|
+
windows: {
|
|
1030
|
+
command: "Win",
|
|
1031
|
+
cmd: "Win",
|
|
1032
|
+
option: "Alt",
|
|
1033
|
+
alt: "Alt",
|
|
1034
|
+
control: "Ctrl",
|
|
1035
|
+
ctrl: "Ctrl",
|
|
1036
|
+
shift: "Shift"
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
var spokenLabels = {
|
|
1040
|
+
"\u2318": "Command",
|
|
1041
|
+
"\u2325": "Option",
|
|
1042
|
+
"\u2303": "Control",
|
|
1043
|
+
"\u21E7": "Shift",
|
|
1044
|
+
"\u21B5": "Enter",
|
|
1045
|
+
"\u23CE": "Enter",
|
|
1046
|
+
"\u232B": "Backspace",
|
|
1047
|
+
"\u238B": "Escape"
|
|
1048
|
+
};
|
|
738
1049
|
function Kbd(_a) {
|
|
739
|
-
var _b = _a, {
|
|
1050
|
+
var _b = _a, {
|
|
1051
|
+
variant = "shortcut",
|
|
1052
|
+
keys,
|
|
1053
|
+
platform = "text",
|
|
1054
|
+
separator,
|
|
1055
|
+
children,
|
|
1056
|
+
className,
|
|
1057
|
+
"aria-label": ariaLabel
|
|
1058
|
+
} = _b, props = __objRest(_b, [
|
|
1059
|
+
"variant",
|
|
1060
|
+
"keys",
|
|
1061
|
+
"platform",
|
|
1062
|
+
"separator",
|
|
1063
|
+
"children",
|
|
1064
|
+
"className",
|
|
1065
|
+
"aria-label"
|
|
1066
|
+
]);
|
|
740
1067
|
if (variant === "token") {
|
|
741
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", __spreadProps(__spreadValues({ className: cn("ph-
|
|
1068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", __spreadProps(__spreadValues({ className: cn("ph-code-token ph-kbd", className), "aria-label": ariaLabel }, props), { children }));
|
|
1069
|
+
}
|
|
1070
|
+
const sourceKeys = (keys == null ? void 0 : keys.length) ? keys : children != null ? [children] : [];
|
|
1071
|
+
const displayKeys = sourceKeys.map((key) => formatKey(key, platform));
|
|
1072
|
+
const accessibleLabel = ariaLabel != null ? ariaLabel : getShortcutLabel(displayKeys);
|
|
1073
|
+
if (variant === "key") {
|
|
1074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("kbd", __spreadProps(__spreadValues({ className: cn("ph-keycap", className), "aria-label": accessibleLabel }, props), { children: displayKeys[0] }));
|
|
742
1075
|
}
|
|
743
|
-
|
|
744
|
-
|
|
1076
|
+
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: [
|
|
1077
|
+
index > 0 && separator != null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ph-shortcut-separator", "aria-hidden": "true", children: separator }) : null,
|
|
1078
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ph-shortcut-key", "aria-hidden": accessibleLabel ? true : void 0, children: key })
|
|
1079
|
+
] }, index)) }));
|
|
745
1080
|
}
|
|
746
|
-
function
|
|
747
|
-
|
|
748
|
-
|
|
1081
|
+
function formatKey(key, platform) {
|
|
1082
|
+
var _a;
|
|
1083
|
+
if (typeof key !== "string") return key;
|
|
1084
|
+
return (_a = platformLabels[platform][key.toLowerCase()]) != null ? _a : key;
|
|
1085
|
+
}
|
|
1086
|
+
function getShortcutLabel(keys) {
|
|
1087
|
+
const labels = keys.map((key) => {
|
|
1088
|
+
var _a;
|
|
1089
|
+
if (typeof key !== "string" && typeof key !== "number") return null;
|
|
1090
|
+
const value = String(key);
|
|
1091
|
+
return (_a = spokenLabels[value]) != null ? _a : value;
|
|
1092
|
+
});
|
|
1093
|
+
return labels.every((label) => label != null) ? labels.join(" + ") : void 0;
|
|
749
1094
|
}
|
|
750
1095
|
|
|
751
|
-
// src/components/ui/
|
|
1096
|
+
// src/components/ui/Loader.tsx
|
|
752
1097
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1098
|
+
var loaderSizeClass = {
|
|
1099
|
+
sm: "ph-loader-sm",
|
|
1100
|
+
md: "ph-loader-md",
|
|
1101
|
+
lg: "ph-loader-lg"
|
|
1102
|
+
};
|
|
1103
|
+
var skeletonShapeClass = {
|
|
1104
|
+
title: "ph-skeleton-title",
|
|
1105
|
+
text: "ph-skeleton-text",
|
|
1106
|
+
"short-text": "ph-skeleton-text-short",
|
|
1107
|
+
avatar: "ph-skeleton-avatar",
|
|
1108
|
+
button: "ph-skeleton-button",
|
|
1109
|
+
block: "ph-skeleton-block"
|
|
1110
|
+
};
|
|
1111
|
+
function Loader(_a) {
|
|
1112
|
+
var _b = _a, {
|
|
1113
|
+
variant = "spinner",
|
|
1114
|
+
size = "md",
|
|
1115
|
+
label = "Loading",
|
|
1116
|
+
className
|
|
1117
|
+
} = _b, props = __objRest(_b, [
|
|
1118
|
+
"variant",
|
|
1119
|
+
"size",
|
|
1120
|
+
"label",
|
|
1121
|
+
"className"
|
|
1122
|
+
]);
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1124
|
+
"span",
|
|
1125
|
+
__spreadProps(__spreadValues({
|
|
1126
|
+
role: "status",
|
|
1127
|
+
"aria-label": label,
|
|
1128
|
+
className: cn("ph-loader", loaderSizeClass[size], className)
|
|
1129
|
+
}, props), {
|
|
1130
|
+
children: [
|
|
1131
|
+
variant === "spinner" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ph-loading", "aria-hidden": true }) : null,
|
|
1132
|
+
variant === "dots" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "ph-loading-dots", "aria-hidden": true, children: [
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {}),
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {}),
|
|
1135
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {})
|
|
1136
|
+
] }) : null,
|
|
1137
|
+
variant === "pulse" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ph-loading-pulse", "aria-hidden": true }) : null
|
|
1138
|
+
]
|
|
1139
|
+
})
|
|
1140
|
+
);
|
|
1141
|
+
}
|
|
1142
|
+
function Skeleton(_a) {
|
|
1143
|
+
var _b = _a, { shape = "text", className } = _b, props = __objRest(_b, ["shape", "className"]);
|
|
1144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1145
|
+
"span",
|
|
1146
|
+
__spreadValues({
|
|
1147
|
+
className: cn("ph-skeleton", skeletonShapeClass[shape], className),
|
|
1148
|
+
"aria-hidden": "true"
|
|
1149
|
+
}, props)
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
function LoadingState(_a) {
|
|
1153
|
+
var _b = _a, {
|
|
1154
|
+
label = "Loading",
|
|
1155
|
+
title = "Loading",
|
|
1156
|
+
description,
|
|
1157
|
+
variant = "spinner",
|
|
1158
|
+
size = "lg",
|
|
1159
|
+
className
|
|
1160
|
+
} = _b, props = __objRest(_b, [
|
|
1161
|
+
"label",
|
|
1162
|
+
"title",
|
|
1163
|
+
"description",
|
|
1164
|
+
"variant",
|
|
1165
|
+
"size",
|
|
1166
|
+
"className"
|
|
1167
|
+
]);
|
|
1168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-loading-state", className), role: "status", "aria-label": label }, props), { children: [
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Loader, { variant, size, label, "aria-hidden": "true" }),
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "ph-loading-state__copy", children: [
|
|
1171
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: title }),
|
|
1172
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: description }) : null
|
|
1173
|
+
] })
|
|
1174
|
+
] }));
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
// src/components/ui/AuthLayout.tsx
|
|
1178
|
+
var import_react8 = require("react");
|
|
1179
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1180
|
+
function AuthLayout(_a) {
|
|
1181
|
+
var _b = _a, { brand, footer, aside, children, className } = _b, props = __objRest(_b, ["brand", "footer", "aside", "children", "className"]);
|
|
1182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-auth-layout", aside != null && "ph-auth-layout--split", className) }, props), { children: [
|
|
1183
|
+
aside ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("aside", { className: "ph-auth-layout__aside", children: aside }) : null,
|
|
1184
|
+
/* @__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: [
|
|
1185
|
+
brand ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-auth-layout__brand", children: brand }) : null,
|
|
1186
|
+
children,
|
|
1187
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("footer", { className: "ph-auth-layout__footer", children: footer }) : null
|
|
1188
|
+
] }) })
|
|
1189
|
+
] }));
|
|
1190
|
+
}
|
|
1191
|
+
function AuthCard(_a) {
|
|
1192
|
+
var _b = _a, { title, description, footer, children, className } = _b, props = __objRest(_b, ["title", "description", "footer", "children", "className"]);
|
|
1193
|
+
const titleId = (0, import_react8.useId)();
|
|
1194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", __spreadProps(__spreadValues({ className: cn("ph-auth-card", className), "aria-labelledby": titleId }, props), { children: [
|
|
1195
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { className: "ph-auth-card__header", children: [
|
|
1196
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h1", { id: titleId, children: title }),
|
|
1197
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: description }) : null
|
|
1198
|
+
] }),
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-auth-card__body", children }),
|
|
1200
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("footer", { className: "ph-auth-card__footer", children: footer }) : null
|
|
1201
|
+
] }));
|
|
1202
|
+
}
|
|
1203
|
+
function AuthDivider(_a) {
|
|
1204
|
+
var _b = _a, { children = "or continue with", className } = _b, props = __objRest(_b, ["children", "className"]);
|
|
1205
|
+
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 }) }));
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
// src/components/ui/SettingsLayout.tsx
|
|
1209
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1210
|
+
function SettingsNav(_a) {
|
|
1211
|
+
var _b = _a, { groups, className } = _b, props = __objRest(_b, ["groups", "className"]);
|
|
1212
|
+
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: [
|
|
1213
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { children: group.label }),
|
|
1214
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ph-settings-nav__items", children: group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1215
|
+
"a",
|
|
1216
|
+
{
|
|
1217
|
+
href: item.href,
|
|
1218
|
+
className: cn("ph-settings-nav__item", item.active && "ph-settings-nav__item--active"),
|
|
1219
|
+
"aria-current": item.active ? "page" : void 0,
|
|
1220
|
+
children: [
|
|
1221
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ph-settings-nav__icon", children: item.icon }) : null,
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: item.label }),
|
|
1223
|
+
item.badge ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ph-settings-nav__badge", children: item.badge }) : null
|
|
1224
|
+
]
|
|
1225
|
+
},
|
|
1226
|
+
item.id
|
|
1227
|
+
)) })
|
|
1228
|
+
] }, index)) }));
|
|
1229
|
+
}
|
|
1230
|
+
function SettingsLayout(_a) {
|
|
1231
|
+
var _b = _a, {
|
|
1232
|
+
title,
|
|
1233
|
+
description,
|
|
1234
|
+
actions,
|
|
1235
|
+
navigation,
|
|
1236
|
+
navigationLabel = "Settings",
|
|
1237
|
+
children,
|
|
1238
|
+
className
|
|
1239
|
+
} = _b, props = __objRest(_b, [
|
|
1240
|
+
"title",
|
|
1241
|
+
"description",
|
|
1242
|
+
"actions",
|
|
1243
|
+
"navigation",
|
|
1244
|
+
"navigationLabel",
|
|
1245
|
+
"children",
|
|
1246
|
+
"className"
|
|
1247
|
+
]);
|
|
1248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", __spreadProps(__spreadValues({ className: cn("ph-settings-layout", className) }, props), { children: [
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: "ph-settings-layout__header", children: [
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { children: title }),
|
|
1252
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: description }) : null
|
|
1253
|
+
] }),
|
|
1254
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ph-settings-layout__actions", children: actions }) : null
|
|
1255
|
+
] }),
|
|
1256
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("details", { className: "ph-settings-layout__mobile-nav", children: [
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("summary", { children: [
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconTuning, { className: "h-4 w-4", "aria-hidden": true }),
|
|
1259
|
+
"Settings menu"
|
|
1260
|
+
] }),
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { "aria-label": navigationLabel, children: navigation })
|
|
1262
|
+
] }),
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ph-settings-layout__grid", children: [
|
|
1264
|
+
/* @__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 }) }),
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ph-settings-layout__content", children })
|
|
1266
|
+
] })
|
|
1267
|
+
] }));
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// src/components/ui/DropdownMenu.tsx
|
|
1271
|
+
var DropdownPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1272
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
753
1273
|
var sizeClass2 = {
|
|
754
1274
|
xs: "ph-btn-xs",
|
|
755
1275
|
sm: "ph-btn-sm",
|
|
@@ -761,40 +1281,95 @@ var variantClass2 = {
|
|
|
761
1281
|
secondary: "ph-btn-secondary",
|
|
762
1282
|
accent: "ph-btn-accent"
|
|
763
1283
|
};
|
|
764
|
-
function
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
1284
|
+
function DropdownContent({
|
|
1285
|
+
children,
|
|
1286
|
+
align = "start",
|
|
1287
|
+
side = "bottom",
|
|
1288
|
+
sideOffset = 7,
|
|
1289
|
+
alignOffset = 0,
|
|
1290
|
+
collisionPadding = 8,
|
|
1291
|
+
avoidCollisions = true,
|
|
1292
|
+
panelClassName
|
|
1293
|
+
}) {
|
|
1294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1295
|
+
DropdownPrimitive.Content,
|
|
1296
|
+
{
|
|
1297
|
+
className: cn("ph-dropdown-panel", panelClassName),
|
|
1298
|
+
align,
|
|
1299
|
+
side,
|
|
1300
|
+
sideOffset,
|
|
1301
|
+
alignOffset,
|
|
1302
|
+
collisionPadding,
|
|
1303
|
+
avoidCollisions,
|
|
1304
|
+
sticky: "partial",
|
|
1305
|
+
children: [
|
|
1306
|
+
children,
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Arrow, { className: "ph-dropdown-arrow", width: 12, height: 6 })
|
|
1308
|
+
]
|
|
1309
|
+
}
|
|
1310
|
+
) });
|
|
770
1311
|
}
|
|
771
1312
|
function DropdownMenu(_a) {
|
|
772
1313
|
var _b = _a, {
|
|
773
1314
|
trigger,
|
|
774
1315
|
children,
|
|
775
|
-
align
|
|
1316
|
+
align,
|
|
1317
|
+
side,
|
|
1318
|
+
sideOffset,
|
|
1319
|
+
alignOffset,
|
|
1320
|
+
collisionPadding,
|
|
1321
|
+
avoidCollisions,
|
|
776
1322
|
className,
|
|
777
1323
|
panelClassName,
|
|
778
|
-
"aria-label": ariaLabel
|
|
1324
|
+
"aria-label": ariaLabel,
|
|
1325
|
+
open,
|
|
1326
|
+
defaultOpen,
|
|
1327
|
+
onOpenChange,
|
|
1328
|
+
modal = false,
|
|
1329
|
+
disabled
|
|
779
1330
|
} = _b, props = __objRest(_b, [
|
|
780
1331
|
"trigger",
|
|
781
1332
|
"children",
|
|
782
1333
|
"align",
|
|
1334
|
+
"side",
|
|
1335
|
+
"sideOffset",
|
|
1336
|
+
"alignOffset",
|
|
1337
|
+
"collisionPadding",
|
|
1338
|
+
"avoidCollisions",
|
|
783
1339
|
"className",
|
|
784
1340
|
"panelClassName",
|
|
785
|
-
"aria-label"
|
|
1341
|
+
"aria-label",
|
|
1342
|
+
"open",
|
|
1343
|
+
"defaultOpen",
|
|
1344
|
+
"onOpenChange",
|
|
1345
|
+
"modal",
|
|
1346
|
+
"disabled"
|
|
786
1347
|
]);
|
|
787
|
-
return /* @__PURE__ */ (0,
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
1348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1349
|
+
DropdownPrimitive.Root,
|
|
1350
|
+
{
|
|
1351
|
+
open,
|
|
1352
|
+
defaultOpen,
|
|
1353
|
+
onOpenChange,
|
|
1354
|
+
modal,
|
|
1355
|
+
children: [
|
|
1356
|
+
/* @__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 }) }),
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1358
|
+
DropdownContent,
|
|
1359
|
+
{
|
|
1360
|
+
align,
|
|
1361
|
+
side,
|
|
1362
|
+
sideOffset,
|
|
1363
|
+
alignOffset,
|
|
1364
|
+
collisionPadding,
|
|
1365
|
+
avoidCollisions,
|
|
1366
|
+
panelClassName,
|
|
1367
|
+
children
|
|
1368
|
+
}
|
|
1369
|
+
)
|
|
1370
|
+
]
|
|
1371
|
+
}
|
|
1372
|
+
) }));
|
|
798
1373
|
}
|
|
799
1374
|
function DropdownButton(_a) {
|
|
800
1375
|
var _b = _a, {
|
|
@@ -806,10 +1381,20 @@ function DropdownButton(_a) {
|
|
|
806
1381
|
icon,
|
|
807
1382
|
sideIcon,
|
|
808
1383
|
children,
|
|
809
|
-
align
|
|
1384
|
+
align,
|
|
1385
|
+
side,
|
|
1386
|
+
sideOffset,
|
|
1387
|
+
alignOffset,
|
|
1388
|
+
collisionPadding,
|
|
1389
|
+
avoidCollisions,
|
|
810
1390
|
className,
|
|
811
1391
|
panelClassName,
|
|
812
|
-
"aria-label": ariaLabel
|
|
1392
|
+
"aria-label": ariaLabel,
|
|
1393
|
+
open,
|
|
1394
|
+
defaultOpen,
|
|
1395
|
+
onOpenChange,
|
|
1396
|
+
modal = false,
|
|
1397
|
+
disabled
|
|
813
1398
|
} = _b, props = __objRest(_b, [
|
|
814
1399
|
"label",
|
|
815
1400
|
"variant",
|
|
@@ -820,55 +1405,154 @@ function DropdownButton(_a) {
|
|
|
820
1405
|
"sideIcon",
|
|
821
1406
|
"children",
|
|
822
1407
|
"align",
|
|
1408
|
+
"side",
|
|
1409
|
+
"sideOffset",
|
|
1410
|
+
"alignOffset",
|
|
1411
|
+
"collisionPadding",
|
|
1412
|
+
"avoidCollisions",
|
|
823
1413
|
"className",
|
|
824
1414
|
"panelClassName",
|
|
825
|
-
"aria-label"
|
|
1415
|
+
"aria-label",
|
|
1416
|
+
"open",
|
|
1417
|
+
"defaultOpen",
|
|
1418
|
+
"onOpenChange",
|
|
1419
|
+
"modal",
|
|
1420
|
+
"disabled"
|
|
826
1421
|
]);
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1422
|
+
const trailing = sideIcon != null ? sideIcon : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconChevronDown, { className: "h-4 w-4", "aria-hidden": true });
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1424
|
+
DropdownPrimitive.Root,
|
|
1425
|
+
{
|
|
1426
|
+
open,
|
|
1427
|
+
defaultOpen,
|
|
1428
|
+
onOpenChange,
|
|
1429
|
+
modal,
|
|
1430
|
+
children: [
|
|
1431
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1432
|
+
"button",
|
|
1433
|
+
{
|
|
1434
|
+
type: "button",
|
|
1435
|
+
disabled,
|
|
1436
|
+
className: cn(
|
|
1437
|
+
"ph-btn ph-btn-raised ph-dropdown-button",
|
|
1438
|
+
variantClass2[variant],
|
|
1439
|
+
outline && "ph-btn-outline",
|
|
1440
|
+
sizeClass2[size],
|
|
1441
|
+
split && "ph-btn-split"
|
|
1442
|
+
),
|
|
1443
|
+
"aria-label": ariaLabel,
|
|
1444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ButtonChrome, { label, icon, sideIcon: trailing, split })
|
|
1445
|
+
}
|
|
1446
|
+
) }),
|
|
1447
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1448
|
+
DropdownContent,
|
|
1449
|
+
{
|
|
1450
|
+
align,
|
|
1451
|
+
side,
|
|
1452
|
+
sideOffset,
|
|
1453
|
+
alignOffset,
|
|
1454
|
+
collisionPadding,
|
|
1455
|
+
avoidCollisions,
|
|
1456
|
+
panelClassName,
|
|
1457
|
+
children
|
|
1458
|
+
}
|
|
1459
|
+
)
|
|
1460
|
+
]
|
|
1461
|
+
}
|
|
1462
|
+
) }));
|
|
851
1463
|
}
|
|
852
1464
|
function DropdownItem(_a) {
|
|
1465
|
+
var _b = _a, { className, children, disabled } = _b, props = __objRest(_b, ["className", "children", "disabled"]);
|
|
1466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Item, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1467
|
+
"button",
|
|
1468
|
+
__spreadProps(__spreadValues({
|
|
1469
|
+
type: "button",
|
|
1470
|
+
disabled,
|
|
1471
|
+
className: cn("ph-dropdown-item w-full text-left", className)
|
|
1472
|
+
}, props), {
|
|
1473
|
+
children
|
|
1474
|
+
})
|
|
1475
|
+
) });
|
|
1476
|
+
}
|
|
1477
|
+
function DropdownRadioGroup(props) {
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.RadioGroup, __spreadValues({}, props));
|
|
1479
|
+
}
|
|
1480
|
+
function DropdownRadioItem(_a) {
|
|
1481
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(DropdownPrimitive.RadioItem, __spreadProps(__spreadValues({ className: cn("ph-dropdown-item ph-dropdown-radio-item", className) }, props), { children: [
|
|
1483
|
+
/* @__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" }) }) }),
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children })
|
|
1485
|
+
] }));
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
// src/components/ui/Input.tsx
|
|
1489
|
+
var import_react10 = require("react");
|
|
1490
|
+
|
|
1491
|
+
// src/components/ui/FormField.tsx
|
|
1492
|
+
var import_react9 = require("react");
|
|
1493
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1494
|
+
function FormField(_a) {
|
|
853
1495
|
var _b = _a, {
|
|
854
|
-
|
|
855
|
-
|
|
1496
|
+
controlId,
|
|
1497
|
+
label,
|
|
1498
|
+
hideLabel = false,
|
|
1499
|
+
helperText,
|
|
1500
|
+
error,
|
|
1501
|
+
required = false,
|
|
1502
|
+
disabled = false,
|
|
1503
|
+
children,
|
|
1504
|
+
className
|
|
856
1505
|
} = _b, props = __objRest(_b, [
|
|
857
|
-
"
|
|
858
|
-
"
|
|
1506
|
+
"controlId",
|
|
1507
|
+
"label",
|
|
1508
|
+
"hideLabel",
|
|
1509
|
+
"helperText",
|
|
1510
|
+
"error",
|
|
1511
|
+
"required",
|
|
1512
|
+
"disabled",
|
|
1513
|
+
"children",
|
|
1514
|
+
"className"
|
|
859
1515
|
]);
|
|
860
|
-
|
|
1516
|
+
const generatedId = (0, import_react9.useId)();
|
|
1517
|
+
const id = controlId != null ? controlId : generatedId;
|
|
1518
|
+
const descriptionId = helperText && !error ? `${id}-description` : void 0;
|
|
1519
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
1520
|
+
const controlProps = {
|
|
1521
|
+
id,
|
|
1522
|
+
"aria-describedby": descriptionId,
|
|
1523
|
+
"aria-errormessage": errorId,
|
|
1524
|
+
"aria-invalid": error ? true : void 0
|
|
1525
|
+
};
|
|
1526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-field", className) }, props), { children: [
|
|
1527
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1528
|
+
"label",
|
|
1529
|
+
{
|
|
1530
|
+
htmlFor: id,
|
|
1531
|
+
className: cn("ph-label", hideLabel && "sr-only", disabled && "opacity-50"),
|
|
1532
|
+
children: [
|
|
1533
|
+
label,
|
|
1534
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: " *" }) : null
|
|
1535
|
+
]
|
|
1536
|
+
}
|
|
1537
|
+
) : null,
|
|
1538
|
+
typeof children === "function" ? children(controlProps) : children,
|
|
1539
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { id: descriptionId, className: "mt-1 text-xs text-ph-subtle", children: helperText }) : null,
|
|
1540
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { id: errorId, className: "mt-1 text-xs font-medium text-ph-danger", children: error }) : null
|
|
1541
|
+
] }));
|
|
861
1542
|
}
|
|
862
1543
|
|
|
863
1544
|
// src/components/ui/Input.tsx
|
|
864
|
-
var
|
|
865
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1545
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
866
1546
|
var sizeMap3 = {
|
|
867
1547
|
sm: "ph-input-sm",
|
|
868
1548
|
md: "",
|
|
869
1549
|
lg: "ph-input-lg"
|
|
870
1550
|
};
|
|
871
|
-
function
|
|
1551
|
+
function joinIds(...ids) {
|
|
1552
|
+
const value = ids.filter(Boolean).join(" ");
|
|
1553
|
+
return value || void 0;
|
|
1554
|
+
}
|
|
1555
|
+
var Input = (0, import_react10.forwardRef)(function Input2(_a, ref) {
|
|
872
1556
|
var _b = _a, {
|
|
873
1557
|
id: idProp,
|
|
874
1558
|
label,
|
|
@@ -879,7 +1563,9 @@ function Input(_a) {
|
|
|
879
1563
|
variant = "default",
|
|
880
1564
|
className,
|
|
881
1565
|
wrapperClassName,
|
|
882
|
-
disabled
|
|
1566
|
+
disabled,
|
|
1567
|
+
required,
|
|
1568
|
+
"aria-describedby": ariaDescribedBy
|
|
883
1569
|
} = _b, props = __objRest(_b, [
|
|
884
1570
|
"id",
|
|
885
1571
|
"label",
|
|
@@ -890,45 +1576,46 @@ function Input(_a) {
|
|
|
890
1576
|
"variant",
|
|
891
1577
|
"className",
|
|
892
1578
|
"wrapperClassName",
|
|
893
|
-
"disabled"
|
|
1579
|
+
"disabled",
|
|
1580
|
+
"required",
|
|
1581
|
+
"aria-describedby"
|
|
894
1582
|
]);
|
|
895
|
-
const autoId = (0,
|
|
1583
|
+
const autoId = (0, import_react10.useId)();
|
|
896
1584
|
const id = idProp != null ? idProp : autoId;
|
|
897
1585
|
const hasError = Boolean(error);
|
|
898
|
-
return /* @__PURE__ */ (0,
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
)
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
function Select(_a) {
|
|
1586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1587
|
+
FormField,
|
|
1588
|
+
{
|
|
1589
|
+
controlId: id,
|
|
1590
|
+
label,
|
|
1591
|
+
hideLabel,
|
|
1592
|
+
helperText,
|
|
1593
|
+
error,
|
|
1594
|
+
required,
|
|
1595
|
+
disabled,
|
|
1596
|
+
className: wrapperClassName,
|
|
1597
|
+
children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1598
|
+
"input",
|
|
1599
|
+
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1600
|
+
ref,
|
|
1601
|
+
disabled,
|
|
1602
|
+
required,
|
|
1603
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1604
|
+
className: cn(
|
|
1605
|
+
"ph-input w-full",
|
|
1606
|
+
sizeMap3[size],
|
|
1607
|
+
variant === "ghost" && "ph-input-ghost",
|
|
1608
|
+
hasError && "ph-input-error",
|
|
1609
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1610
|
+
className
|
|
1611
|
+
)
|
|
1612
|
+
}), props)
|
|
1613
|
+
)
|
|
1614
|
+
}
|
|
1615
|
+
);
|
|
1616
|
+
});
|
|
1617
|
+
Input.displayName = "Input";
|
|
1618
|
+
var Select = (0, import_react10.forwardRef)(function Select2(_a, ref) {
|
|
932
1619
|
var _b = _a, {
|
|
933
1620
|
id: idProp,
|
|
934
1621
|
label,
|
|
@@ -939,7 +1626,9 @@ function Select(_a) {
|
|
|
939
1626
|
className,
|
|
940
1627
|
wrapperClassName,
|
|
941
1628
|
disabled,
|
|
942
|
-
children
|
|
1629
|
+
children,
|
|
1630
|
+
required,
|
|
1631
|
+
"aria-describedby": ariaDescribedBy
|
|
943
1632
|
} = _b, props = __objRest(_b, [
|
|
944
1633
|
"id",
|
|
945
1634
|
"label",
|
|
@@ -950,42 +1639,34 @@ function Select(_a) {
|
|
|
950
1639
|
"className",
|
|
951
1640
|
"wrapperClassName",
|
|
952
1641
|
"disabled",
|
|
953
|
-
"children"
|
|
1642
|
+
"children",
|
|
1643
|
+
"required",
|
|
1644
|
+
"aria-describedby"
|
|
954
1645
|
]);
|
|
955
|
-
const autoId = (0,
|
|
1646
|
+
const autoId = (0, import_react10.useId)();
|
|
956
1647
|
const id = idProp != null ? idProp : autoId;
|
|
957
1648
|
const hasError = Boolean(error);
|
|
958
|
-
return /* @__PURE__ */ (0,
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
)
|
|
980
|
-
}, props), {
|
|
981
|
-
children
|
|
982
|
-
})
|
|
983
|
-
),
|
|
984
|
-
helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: helperText }),
|
|
985
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs font-medium text-ph-danger", children: error })
|
|
986
|
-
] });
|
|
987
|
-
}
|
|
988
|
-
function Textarea(_a) {
|
|
1649
|
+
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)(
|
|
1650
|
+
"select",
|
|
1651
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1652
|
+
ref,
|
|
1653
|
+
disabled,
|
|
1654
|
+
required,
|
|
1655
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1656
|
+
className: cn(
|
|
1657
|
+
"ph-select w-full",
|
|
1658
|
+
sizeMap3[size],
|
|
1659
|
+
hasError && "ph-input-error",
|
|
1660
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1661
|
+
className
|
|
1662
|
+
)
|
|
1663
|
+
}), props), {
|
|
1664
|
+
children
|
|
1665
|
+
})
|
|
1666
|
+
) });
|
|
1667
|
+
});
|
|
1668
|
+
Select.displayName = "Select";
|
|
1669
|
+
var Textarea = (0, import_react10.forwardRef)(function Textarea2(_a, ref) {
|
|
989
1670
|
var _b = _a, {
|
|
990
1671
|
id: idProp,
|
|
991
1672
|
label,
|
|
@@ -995,50 +1676,44 @@ function Textarea(_a) {
|
|
|
995
1676
|
size = "md",
|
|
996
1677
|
className,
|
|
997
1678
|
wrapperClassName,
|
|
998
|
-
disabled
|
|
1679
|
+
disabled,
|
|
1680
|
+
required,
|
|
1681
|
+
"aria-describedby": ariaDescribedBy
|
|
999
1682
|
} = _b, props = __objRest(_b, [
|
|
1000
1683
|
"id",
|
|
1001
1684
|
"label",
|
|
1002
1685
|
"hideLabel",
|
|
1003
1686
|
"error",
|
|
1004
|
-
"helperText",
|
|
1005
|
-
"size",
|
|
1006
|
-
"className",
|
|
1007
|
-
"wrapperClassName",
|
|
1008
|
-
"disabled"
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
disabled,
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
)
|
|
1035
|
-
}, props)
|
|
1036
|
-
),
|
|
1037
|
-
helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: helperText }),
|
|
1038
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs font-medium text-ph-danger", children: error })
|
|
1039
|
-
] });
|
|
1040
|
-
}
|
|
1041
|
-
function Checkbox(_a) {
|
|
1687
|
+
"helperText",
|
|
1688
|
+
"size",
|
|
1689
|
+
"className",
|
|
1690
|
+
"wrapperClassName",
|
|
1691
|
+
"disabled",
|
|
1692
|
+
"required",
|
|
1693
|
+
"aria-describedby"
|
|
1694
|
+
]);
|
|
1695
|
+
const autoId = (0, import_react10.useId)();
|
|
1696
|
+
const id = idProp != null ? idProp : autoId;
|
|
1697
|
+
const hasError = Boolean(error);
|
|
1698
|
+
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)(
|
|
1699
|
+
"textarea",
|
|
1700
|
+
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1701
|
+
ref,
|
|
1702
|
+
disabled,
|
|
1703
|
+
required,
|
|
1704
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1705
|
+
className: cn(
|
|
1706
|
+
"ph-textarea w-full",
|
|
1707
|
+
sizeMap3[size],
|
|
1708
|
+
hasError && "ph-input-error",
|
|
1709
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1710
|
+
className
|
|
1711
|
+
)
|
|
1712
|
+
}), props)
|
|
1713
|
+
) });
|
|
1714
|
+
});
|
|
1715
|
+
Textarea.displayName = "Textarea";
|
|
1716
|
+
var Checkbox = (0, import_react10.forwardRef)(function Checkbox2(_a, ref) {
|
|
1042
1717
|
var _b = _a, {
|
|
1043
1718
|
id: idProp,
|
|
1044
1719
|
label,
|
|
@@ -1046,7 +1721,8 @@ function Checkbox(_a) {
|
|
|
1046
1721
|
helperText,
|
|
1047
1722
|
className,
|
|
1048
1723
|
wrapperClassName,
|
|
1049
|
-
disabled
|
|
1724
|
+
disabled,
|
|
1725
|
+
"aria-describedby": ariaDescribedBy
|
|
1050
1726
|
} = _b, props = __objRest(_b, [
|
|
1051
1727
|
"id",
|
|
1052
1728
|
"label",
|
|
@@ -1054,33 +1730,45 @@ function Checkbox(_a) {
|
|
|
1054
1730
|
"helperText",
|
|
1055
1731
|
"className",
|
|
1056
1732
|
"wrapperClassName",
|
|
1057
|
-
"disabled"
|
|
1733
|
+
"disabled",
|
|
1734
|
+
"aria-describedby"
|
|
1058
1735
|
]);
|
|
1059
|
-
const autoId = (0,
|
|
1736
|
+
const autoId = (0, import_react10.useId)();
|
|
1060
1737
|
const id = idProp != null ? idProp : autoId;
|
|
1061
1738
|
const hasError = Boolean(error);
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
"
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1739
|
+
const descriptionId = helperText && !hasError ? `${id}-description` : void 0;
|
|
1740
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
1741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-control-row", wrapperClassName), children: [
|
|
1742
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "ph-checkbox-wrap", children: [
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1744
|
+
"input",
|
|
1745
|
+
__spreadValues({
|
|
1746
|
+
ref,
|
|
1747
|
+
id,
|
|
1748
|
+
type: "checkbox",
|
|
1749
|
+
disabled,
|
|
1750
|
+
"aria-invalid": hasError || void 0,
|
|
1751
|
+
"aria-describedby": joinIds(ariaDescribedBy, descriptionId),
|
|
1752
|
+
"aria-errormessage": errorId,
|
|
1753
|
+
className: cn(
|
|
1754
|
+
"ph-checkbox",
|
|
1755
|
+
hasError && "border-ph-danger",
|
|
1756
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1757
|
+
className
|
|
1758
|
+
)
|
|
1759
|
+
}, props)
|
|
1760
|
+
),
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconCheck, { className: "ph-checkbox-icon", "aria-hidden": true })
|
|
1762
|
+
] }),
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "ph-control-copy", children: [
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label }),
|
|
1765
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { id: descriptionId, className: "text-xs text-ph-subtle", children: helperText }) : null,
|
|
1766
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { id: errorId, className: "text-xs font-medium text-ph-danger", children: error }) : null
|
|
1767
|
+
] })
|
|
1081
1768
|
] });
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1769
|
+
});
|
|
1770
|
+
Checkbox.displayName = "Checkbox";
|
|
1771
|
+
var Radio = (0, import_react10.forwardRef)(function Radio2(_a, ref) {
|
|
1084
1772
|
var _b = _a, {
|
|
1085
1773
|
id: idProp,
|
|
1086
1774
|
label,
|
|
@@ -1094,22 +1782,24 @@ function Radio(_a) {
|
|
|
1094
1782
|
"wrapperClassName",
|
|
1095
1783
|
"disabled"
|
|
1096
1784
|
]);
|
|
1097
|
-
const autoId = (0,
|
|
1785
|
+
const autoId = (0, import_react10.useId)();
|
|
1098
1786
|
const id = idProp != null ? idProp : autoId;
|
|
1099
|
-
return /* @__PURE__ */ (0,
|
|
1100
|
-
/* @__PURE__ */ (0,
|
|
1787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-control-row", wrapperClassName, disabled && "opacity-60"), children: [
|
|
1788
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1101
1789
|
"input",
|
|
1102
1790
|
__spreadValues({
|
|
1791
|
+
ref,
|
|
1103
1792
|
id,
|
|
1104
1793
|
type: "radio",
|
|
1105
1794
|
disabled,
|
|
1106
1795
|
className: cn("ph-radio", disabled && "cursor-not-allowed", className)
|
|
1107
1796
|
}, props)
|
|
1108
1797
|
),
|
|
1109
|
-
/* @__PURE__ */ (0,
|
|
1798
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label })
|
|
1110
1799
|
] });
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1800
|
+
});
|
|
1801
|
+
Radio.displayName = "Radio";
|
|
1802
|
+
var Toggle = (0, import_react10.forwardRef)(function Toggle2(_a, ref) {
|
|
1113
1803
|
var _b = _a, {
|
|
1114
1804
|
id: idProp,
|
|
1115
1805
|
label,
|
|
@@ -1123,13 +1813,14 @@ function Toggle(_a) {
|
|
|
1123
1813
|
"wrapperClassName",
|
|
1124
1814
|
"disabled"
|
|
1125
1815
|
]);
|
|
1126
|
-
const autoId = (0,
|
|
1816
|
+
const autoId = (0, import_react10.useId)();
|
|
1127
1817
|
const id = idProp != null ? idProp : autoId;
|
|
1128
|
-
return /* @__PURE__ */ (0,
|
|
1129
|
-
/* @__PURE__ */ (0,
|
|
1130
|
-
/* @__PURE__ */ (0,
|
|
1818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: cn("ph-control-row-between", wrapperClassName, disabled && "opacity-60"), children: [
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: disabled ? "opacity-60" : void 0, children: label }),
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1131
1821
|
"input",
|
|
1132
1822
|
__spreadValues({
|
|
1823
|
+
ref,
|
|
1133
1824
|
id,
|
|
1134
1825
|
type: "checkbox",
|
|
1135
1826
|
role: "switch",
|
|
@@ -1138,9 +1829,11 @@ function Toggle(_a) {
|
|
|
1138
1829
|
}, props)
|
|
1139
1830
|
)
|
|
1140
1831
|
] });
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1832
|
+
});
|
|
1833
|
+
Toggle.displayName = "Toggle";
|
|
1834
|
+
var Range = (0, import_react10.forwardRef)(function Range2(_a, ref) {
|
|
1143
1835
|
var _b = _a, {
|
|
1836
|
+
id: idProp,
|
|
1144
1837
|
label,
|
|
1145
1838
|
minLabel,
|
|
1146
1839
|
maxLabel,
|
|
@@ -1148,6 +1841,7 @@ function Range(_a) {
|
|
|
1148
1841
|
wrapperClassName,
|
|
1149
1842
|
className
|
|
1150
1843
|
} = _b, props = __objRest(_b, [
|
|
1844
|
+
"id",
|
|
1151
1845
|
"label",
|
|
1152
1846
|
"minLabel",
|
|
1153
1847
|
"maxLabel",
|
|
@@ -1155,35 +1849,55 @@ function Range(_a) {
|
|
|
1155
1849
|
"wrapperClassName",
|
|
1156
1850
|
"className"
|
|
1157
1851
|
]);
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
/* @__PURE__ */ (0,
|
|
1852
|
+
const autoId = (0, import_react10.useId)();
|
|
1853
|
+
const id = idProp != null ? idProp : autoId;
|
|
1854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
1855
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
1856
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", __spreadValues({ ref, id, type: "range", className: cn("ph-range", className) }, props)),
|
|
1857
|
+
(minLabel || valueLabel || maxLabel) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex justify-between text-xs text-ph-mutedtext", children: [
|
|
1858
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: minLabel }),
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: valueLabel }),
|
|
1860
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: maxLabel })
|
|
1165
1861
|
] })
|
|
1166
1862
|
] });
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1863
|
+
});
|
|
1864
|
+
Range.displayName = "Range";
|
|
1865
|
+
var FileUpload = (0, import_react10.forwardRef)(function FileUpload2(_a, ref) {
|
|
1866
|
+
var _b = _a, {
|
|
1867
|
+
id: idProp,
|
|
1868
|
+
label,
|
|
1869
|
+
prompt = "Drop file or browse",
|
|
1870
|
+
wrapperClassName,
|
|
1871
|
+
className
|
|
1872
|
+
} = _b, props = __objRest(_b, [
|
|
1873
|
+
"id",
|
|
1874
|
+
"label",
|
|
1875
|
+
"prompt",
|
|
1876
|
+
"wrapperClassName",
|
|
1877
|
+
"className"
|
|
1878
|
+
]);
|
|
1879
|
+
const autoId = (0, import_react10.useId)();
|
|
1880
|
+
const id = idProp != null ? idProp : autoId;
|
|
1881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
1882
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
1883
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { htmlFor: id, className: "ph-file-upload", children: [
|
|
1884
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", __spreadValues({ ref, id, type: "file", className: cn("sr-only", className) }, props)),
|
|
1174
1885
|
prompt
|
|
1175
1886
|
] })
|
|
1176
1887
|
] });
|
|
1177
|
-
}
|
|
1888
|
+
});
|
|
1889
|
+
FileUpload.displayName = "FileUpload";
|
|
1178
1890
|
|
|
1179
1891
|
// src/components/ui/Modal.tsx
|
|
1180
|
-
var
|
|
1892
|
+
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
1893
|
+
var import_react11 = require("react");
|
|
1894
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1181
1895
|
var sizeMap4 = {
|
|
1182
1896
|
sm: "max-w-sm",
|
|
1183
1897
|
md: "max-w-lg",
|
|
1184
1898
|
lg: "max-w-2xl",
|
|
1185
1899
|
xl: "max-w-4xl",
|
|
1186
|
-
full: "max-w-
|
|
1900
|
+
full: "max-w-none"
|
|
1187
1901
|
};
|
|
1188
1902
|
function Modal({
|
|
1189
1903
|
open = false,
|
|
@@ -1194,50 +1908,67 @@ function Modal({
|
|
|
1194
1908
|
footer,
|
|
1195
1909
|
size = "md",
|
|
1196
1910
|
className,
|
|
1197
|
-
showCloseButton = true
|
|
1911
|
+
showCloseButton = true,
|
|
1912
|
+
closeOnOutsideClick = true,
|
|
1913
|
+
closeOnEscape = true,
|
|
1914
|
+
"aria-label": ariaLabel
|
|
1198
1915
|
}) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1916
|
+
const canDismiss = Boolean(onClose);
|
|
1917
|
+
const restoreFocusRef = (0, import_react11.useRef)(null);
|
|
1918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1919
|
+
Dialog.Root,
|
|
1202
1920
|
{
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
className
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1921
|
+
open,
|
|
1922
|
+
onOpenChange: (nextOpen) => {
|
|
1923
|
+
if (!nextOpen) onClose == null ? void 0 : onClose();
|
|
1924
|
+
},
|
|
1925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Dialog.Portal, { children: [
|
|
1926
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Overlay, { className: "ph-modal-overlay" }),
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1928
|
+
Dialog.Content,
|
|
1929
|
+
__spreadProps(__spreadValues({
|
|
1930
|
+
className: cn("ph-modal-panel", sizeMap4[size], className),
|
|
1931
|
+
"aria-label": ariaLabel
|
|
1932
|
+
}, description ? {} : { "aria-describedby": void 0 }), {
|
|
1933
|
+
onOpenAutoFocus: () => {
|
|
1934
|
+
restoreFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
1935
|
+
},
|
|
1936
|
+
onCloseAutoFocus: (event) => {
|
|
1937
|
+
var _a;
|
|
1938
|
+
event.preventDefault();
|
|
1939
|
+
(_a = restoreFocusRef.current) == null ? void 0 : _a.focus();
|
|
1940
|
+
},
|
|
1941
|
+
onEscapeKeyDown: (event) => {
|
|
1942
|
+
if (!canDismiss || !closeOnEscape) event.preventDefault();
|
|
1943
|
+
},
|
|
1944
|
+
onPointerDownOutside: (event) => {
|
|
1945
|
+
if (!canDismiss || !closeOnOutsideClick) event.preventDefault();
|
|
1946
|
+
},
|
|
1947
|
+
children: [
|
|
1948
|
+
title ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
1949
|
+
title || description || showCloseButton && canDismiss ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "ph-modal-header", children: [
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0", children: [
|
|
1951
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Title, { className: "text-lg font-bold text-ph-ink", children: title }) : null,
|
|
1952
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Description, { className: "mt-1 text-sm text-ph-subtle", children: description }) : null
|
|
1953
|
+
] }),
|
|
1954
|
+
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
|
|
1955
|
+
] }) : null,
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "ph-modal-body", children }),
|
|
1957
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "ph-modal-footer", children: footer }) : null
|
|
1958
|
+
]
|
|
1959
|
+
})
|
|
1960
|
+
)
|
|
1961
|
+
] })
|
|
1231
1962
|
}
|
|
1232
|
-
)
|
|
1963
|
+
);
|
|
1233
1964
|
}
|
|
1234
1965
|
|
|
1235
1966
|
// src/components/ui/Navigation.tsx
|
|
1236
|
-
var
|
|
1967
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1237
1968
|
function Breadcrumbs({ items, label = "Breadcrumb", className }) {
|
|
1238
|
-
return /* @__PURE__ */ (0,
|
|
1239
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
1240
|
-
item.current || !item.href ? /* @__PURE__ */ (0,
|
|
1969
|
+
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: [
|
|
1970
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ph-breadcrumb-sep", "aria-hidden": "true", children: "/" }) : null,
|
|
1971
|
+
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 })
|
|
1241
1972
|
] }, `${item.label}-${index}`)) });
|
|
1242
1973
|
}
|
|
1243
1974
|
function Pagination({
|
|
@@ -1250,8 +1981,8 @@ function Pagination({
|
|
|
1250
1981
|
}) {
|
|
1251
1982
|
const pages = compact ? [Math.max(1, page - 1), page, Math.min(totalPages, page + 1)] : [1, 2, 3, totalPages];
|
|
1252
1983
|
const uniquePages = Array.from(new Set(pages)).filter((n) => n >= 1 && n <= totalPages);
|
|
1253
|
-
return /* @__PURE__ */ (0,
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("nav", { "aria-label": label, className: cn("ph-pagination", className), children: [
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1255
1986
|
"button",
|
|
1256
1987
|
{
|
|
1257
1988
|
type: "button",
|
|
@@ -1259,12 +1990,12 @@ function Pagination({
|
|
|
1259
1990
|
disabled: page <= 1,
|
|
1260
1991
|
"aria-label": "Previous page",
|
|
1261
1992
|
onClick: () => onPageChange == null ? void 0 : onPageChange(page - 1),
|
|
1262
|
-
children: /* @__PURE__ */ (0,
|
|
1993
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconChevronLeft, { className: "mx-auto h-4 w-4", "aria-hidden": true })
|
|
1263
1994
|
}
|
|
1264
1995
|
),
|
|
1265
|
-
uniquePages.map((pageNumber, index) => /* @__PURE__ */ (0,
|
|
1266
|
-
!compact && index === uniquePages.length - 1 && pageNumber > 4 ? /* @__PURE__ */ (0,
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1996
|
+
uniquePages.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "contents", children: [
|
|
1997
|
+
!compact && index === uniquePages.length - 1 && pageNumber > 4 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ph-pagination-ellipsis", "aria-hidden": "true", children: "..." }) : null,
|
|
1998
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1268
1999
|
"button",
|
|
1269
2000
|
{
|
|
1270
2001
|
type: "button",
|
|
@@ -1275,7 +2006,7 @@ function Pagination({
|
|
|
1275
2006
|
}
|
|
1276
2007
|
)
|
|
1277
2008
|
] }, pageNumber)),
|
|
1278
|
-
/* @__PURE__ */ (0,
|
|
2009
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1279
2010
|
"button",
|
|
1280
2011
|
{
|
|
1281
2012
|
type: "button",
|
|
@@ -1283,25 +2014,25 @@ function Pagination({
|
|
|
1283
2014
|
disabled: page >= totalPages,
|
|
1284
2015
|
"aria-label": "Next page",
|
|
1285
2016
|
onClick: () => onPageChange == null ? void 0 : onPageChange(page + 1),
|
|
1286
|
-
children: /* @__PURE__ */ (0,
|
|
2017
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconChevronRight, { className: "mx-auto h-4 w-4", "aria-hidden": true })
|
|
1287
2018
|
}
|
|
1288
2019
|
)
|
|
1289
2020
|
] });
|
|
1290
2021
|
}
|
|
1291
2022
|
|
|
1292
2023
|
// src/components/ui/Panel.tsx
|
|
1293
|
-
var
|
|
2024
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1294
2025
|
function Panel(_a) {
|
|
1295
2026
|
var _b = _a, { title, description, children, className } = _b, props = __objRest(_b, ["title", "description", "children", "className"]);
|
|
1296
|
-
return /* @__PURE__ */ (0,
|
|
1297
|
-
title && /* @__PURE__ */ (0,
|
|
1298
|
-
description && /* @__PURE__ */ (0,
|
|
2027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-panel", className) }, props), { children: [
|
|
2028
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h3", { className: "text-sm font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
|
|
2029
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
1299
2030
|
children
|
|
1300
2031
|
] }));
|
|
1301
2032
|
}
|
|
1302
2033
|
|
|
1303
2034
|
// src/components/ui/Rating.tsx
|
|
1304
|
-
var
|
|
2035
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1305
2036
|
function Rating(_a) {
|
|
1306
2037
|
var _b = _a, {
|
|
1307
2038
|
label,
|
|
@@ -1321,9 +2052,9 @@ function Rating(_a) {
|
|
|
1321
2052
|
"wrapperClassName"
|
|
1322
2053
|
]);
|
|
1323
2054
|
const stars = Array.from({ length: max }, (_, index) => index + 1);
|
|
1324
|
-
return /* @__PURE__ */ (0,
|
|
1325
|
-
label && /* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
2055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2056
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ph-label", children: label }),
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1327
2058
|
"div",
|
|
1328
2059
|
__spreadProps(__spreadValues({
|
|
1329
2060
|
className: cn("ph-rating flex", className),
|
|
@@ -1333,7 +2064,7 @@ function Rating(_a) {
|
|
|
1333
2064
|
children: stars.map((star) => {
|
|
1334
2065
|
const active = star <= value;
|
|
1335
2066
|
if (readOnly) {
|
|
1336
|
-
return /* @__PURE__ */ (0,
|
|
2067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1337
2068
|
IconStar,
|
|
1338
2069
|
{
|
|
1339
2070
|
className: cn("h-6 w-6", active ? "text-amber-500" : "text-ph-border"),
|
|
@@ -1342,7 +2073,7 @@ function Rating(_a) {
|
|
|
1342
2073
|
star
|
|
1343
2074
|
);
|
|
1344
2075
|
}
|
|
1345
|
-
return /* @__PURE__ */ (0,
|
|
2076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1346
2077
|
"button",
|
|
1347
2078
|
{
|
|
1348
2079
|
type: "button",
|
|
@@ -1351,7 +2082,7 @@ function Rating(_a) {
|
|
|
1351
2082
|
"aria-checked": active,
|
|
1352
2083
|
"aria-label": `${star} out of ${max}`,
|
|
1353
2084
|
onClick: () => onChange == null ? void 0 : onChange(star),
|
|
1354
|
-
children: /* @__PURE__ */ (0,
|
|
2085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconStar, { className: cn("h-6 w-6", active ? "text-amber-500" : "text-ph-border") })
|
|
1355
2086
|
},
|
|
1356
2087
|
star
|
|
1357
2088
|
);
|
|
@@ -1362,8 +2093,8 @@ function Rating(_a) {
|
|
|
1362
2093
|
}
|
|
1363
2094
|
|
|
1364
2095
|
// src/components/ui/SearchInput.tsx
|
|
1365
|
-
var
|
|
1366
|
-
var
|
|
2096
|
+
var import_react12 = require("react");
|
|
2097
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1367
2098
|
function SearchInput(_a) {
|
|
1368
2099
|
var _b = _a, {
|
|
1369
2100
|
id: idProp,
|
|
@@ -1384,12 +2115,12 @@ function SearchInput(_a) {
|
|
|
1384
2115
|
"wrapperClassName",
|
|
1385
2116
|
"placeholder"
|
|
1386
2117
|
]);
|
|
1387
|
-
const autoId = (0,
|
|
2118
|
+
const autoId = (0, import_react12.useId)();
|
|
1388
2119
|
const id = idProp != null ? idProp : autoId;
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1392
|
-
shortcut != null ? /* @__PURE__ */ (0,
|
|
2120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("relative", wrapperClassName), children: [
|
|
2121
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: id, className: hideLabel ? "sr-only" : "ph-label mb-1.5 block", children: label }),
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", children: [
|
|
2123
|
+
shortcut != null ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1393
2124
|
"span",
|
|
1394
2125
|
{
|
|
1395
2126
|
className: "ph-shortcut pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-xs",
|
|
@@ -1397,7 +2128,7 @@ function SearchInput(_a) {
|
|
|
1397
2128
|
children: shortcut
|
|
1398
2129
|
}
|
|
1399
2130
|
) : null,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1401
2132
|
"input",
|
|
1402
2133
|
__spreadValues({
|
|
1403
2134
|
id,
|
|
@@ -1431,12 +2162,12 @@ function SearchGroup(_a) {
|
|
|
1431
2162
|
"wrapperClassName",
|
|
1432
2163
|
"className"
|
|
1433
2164
|
]);
|
|
1434
|
-
const autoId = (0,
|
|
2165
|
+
const autoId = (0, import_react12.useId)();
|
|
1435
2166
|
const id = idProp != null ? idProp : autoId;
|
|
1436
|
-
return /* @__PURE__ */ (0,
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1439
|
-
/* @__PURE__ */ (0,
|
|
2167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2168
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
2169
|
+
/* @__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: [
|
|
2170
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1440
2171
|
"input",
|
|
1441
2172
|
__spreadValues({
|
|
1442
2173
|
id,
|
|
@@ -1445,12 +2176,12 @@ function SearchGroup(_a) {
|
|
|
1445
2176
|
className: cn("ph-input ph-input-group-field min-w-0 flex-1", className)
|
|
1446
2177
|
}, props)
|
|
1447
2178
|
),
|
|
1448
|
-
/* @__PURE__ */ (0,
|
|
2179
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1449
2180
|
Button,
|
|
1450
2181
|
{
|
|
1451
2182
|
type: "submit",
|
|
1452
2183
|
variant: "primary",
|
|
1453
|
-
icon: /* @__PURE__ */ (0,
|
|
2184
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(IconSearch, { className: "h-4 w-4", "aria-hidden": true }),
|
|
1454
2185
|
className: "ph-search-group__submit",
|
|
1455
2186
|
"aria-label": submitLabel
|
|
1456
2187
|
}
|
|
@@ -1460,7 +2191,7 @@ function SearchGroup(_a) {
|
|
|
1460
2191
|
}
|
|
1461
2192
|
|
|
1462
2193
|
// src/components/ui/Table.tsx
|
|
1463
|
-
var
|
|
2194
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1464
2195
|
function Table({
|
|
1465
2196
|
data,
|
|
1466
2197
|
columns,
|
|
@@ -1471,15 +2202,15 @@ function Table({
|
|
|
1471
2202
|
className,
|
|
1472
2203
|
caption
|
|
1473
2204
|
}) {
|
|
1474
|
-
return /* @__PURE__ */ (0,
|
|
1475
|
-
caption && /* @__PURE__ */ (0,
|
|
1476
|
-
/* @__PURE__ */ (0,
|
|
1477
|
-
/* @__PURE__ */ (0,
|
|
2205
|
+
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: [
|
|
2206
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("caption", { className: "sr-only", children: caption }),
|
|
2207
|
+
/* @__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)) }) }),
|
|
2208
|
+
/* @__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)) })
|
|
1478
2209
|
] }) });
|
|
1479
2210
|
}
|
|
1480
2211
|
|
|
1481
2212
|
// src/components/ui/Stat.tsx
|
|
1482
|
-
var
|
|
2213
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1483
2214
|
var toneMap = {
|
|
1484
2215
|
default: "text-ph-ink",
|
|
1485
2216
|
brand: "text-ph-brand",
|
|
@@ -1496,16 +2227,16 @@ var statMap = {
|
|
|
1496
2227
|
};
|
|
1497
2228
|
function Stat(_a) {
|
|
1498
2229
|
var _b = _a, { icon, label, value, footer, tone = "default", className } = _b, props = __objRest(_b, ["icon", "label", "value", "footer", "tone", "className"]);
|
|
1499
|
-
return /* @__PURE__ */ (0,
|
|
1500
|
-
icon && /* @__PURE__ */ (0,
|
|
1501
|
-
/* @__PURE__ */ (0,
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1503
|
-
footer && /* @__PURE__ */ (0,
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-stat", statMap[tone], className) }, props), { children: [
|
|
2231
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("mb-2 h-7 w-7", toneMap[tone]), children: icon }),
|
|
2232
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("ph-stat-label", tone === "warning" && toneMap[tone]), children: label }),
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("ph-stat-val", toneMap[tone]), children: value }),
|
|
2234
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-ph-subtle", children: footer })
|
|
1504
2235
|
] }));
|
|
1505
2236
|
}
|
|
1506
2237
|
|
|
1507
2238
|
// src/components/ui/Toast.tsx
|
|
1508
|
-
var
|
|
2239
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1509
2240
|
var statusConfig2 = {
|
|
1510
2241
|
info: { icon: IconErrorOutline, color: "text-ph-info", bg: "ph-toast-info" },
|
|
1511
2242
|
success: { icon: IconCheckCircle, color: "text-ph-success", bg: "ph-toast-success" },
|
|
@@ -1521,33 +2252,33 @@ function Toast({
|
|
|
1521
2252
|
}) {
|
|
1522
2253
|
const config = statusConfig2[status];
|
|
1523
2254
|
const Icon = config.icon;
|
|
1524
|
-
return /* @__PURE__ */ (0,
|
|
1525
|
-
/* @__PURE__ */ (0,
|
|
1526
|
-
/* @__PURE__ */ (0,
|
|
1527
|
-
/* @__PURE__ */ (0,
|
|
1528
|
-
description && /* @__PURE__ */ (0,
|
|
2255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("ph-toast", config.bg, className), children: [
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { className: cn("mt-0.5 h-5 w-5 shrink-0", config.color), "aria-hidden": true }),
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "pr-8", children: [
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "font-semibold", children: title }),
|
|
2259
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: description })
|
|
1529
2260
|
] }),
|
|
1530
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
2261
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1531
2262
|
"button",
|
|
1532
2263
|
{
|
|
1533
2264
|
type: "button",
|
|
1534
2265
|
"aria-label": `Dismiss ${title}`,
|
|
1535
2266
|
className: "absolute right-2 top-2 ph-btn ph-btn-ghost ph-btn-xs ph-btn-circle",
|
|
1536
2267
|
onClick: onDismiss,
|
|
1537
|
-
children: /* @__PURE__ */ (0,
|
|
2268
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconClose, { className: "h-4 w-4" })
|
|
1538
2269
|
}
|
|
1539
2270
|
)
|
|
1540
2271
|
] });
|
|
1541
2272
|
}
|
|
1542
2273
|
function ToastStack({ children, className }) {
|
|
1543
|
-
return /* @__PURE__ */ (0,
|
|
2274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("ph-toast-stack", className), children });
|
|
1544
2275
|
}
|
|
1545
2276
|
|
|
1546
2277
|
// src/components/ui/Tabs.tsx
|
|
1547
|
-
var
|
|
2278
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1548
2279
|
function Tabs({ items, value, onChange, variant = "pill", className }) {
|
|
1549
2280
|
if (variant === "underline") {
|
|
1550
|
-
return /* @__PURE__ */ (0,
|
|
2281
|
+
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)(
|
|
1551
2282
|
"button",
|
|
1552
2283
|
{
|
|
1553
2284
|
type: "button",
|
|
@@ -1561,7 +2292,7 @@ function Tabs({ items, value, onChange, variant = "pill", className }) {
|
|
|
1561
2292
|
item.value
|
|
1562
2293
|
)) });
|
|
1563
2294
|
}
|
|
1564
|
-
return /* @__PURE__ */ (0,
|
|
2295
|
+
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)(
|
|
1565
2296
|
"button",
|
|
1566
2297
|
{
|
|
1567
2298
|
type: "button",
|
|
@@ -1574,7 +2305,7 @@ function Tabs({ items, value, onChange, variant = "pill", className }) {
|
|
|
1574
2305
|
}
|
|
1575
2306
|
|
|
1576
2307
|
// src/components/ui/ThemeDomSync.tsx
|
|
1577
|
-
var
|
|
2308
|
+
var import_react13 = require("react");
|
|
1578
2309
|
|
|
1579
2310
|
// src/themes/registry.ts
|
|
1580
2311
|
var DEFAULT_THEME_ID = "hedgehog-light";
|
|
@@ -1760,6 +2491,34 @@ var THEMES = [
|
|
|
1760
2491
|
description: "Notion dark mode \u2014 dark charcoal canvas with blue accent and clean typography.",
|
|
1761
2492
|
colorScheme: "dark",
|
|
1762
2493
|
group: "Productivity"
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
id: "deepsea-light",
|
|
2497
|
+
name: "Tokyo Night Day",
|
|
2498
|
+
description: "Tokyo Night Day \u2014 soft bluish greys with vivid blue and purple accents.",
|
|
2499
|
+
colorScheme: "light",
|
|
2500
|
+
group: "Tokyo Night"
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
id: "deepsea-dark",
|
|
2504
|
+
name: "Tokyo Night",
|
|
2505
|
+
description: "Tokyo Night \u2014 #1a1b26 base with signature blue, cyan, and purple.",
|
|
2506
|
+
colorScheme: "dark",
|
|
2507
|
+
group: "Tokyo Night"
|
|
2508
|
+
},
|
|
2509
|
+
{
|
|
2510
|
+
id: "kraken-light",
|
|
2511
|
+
name: "Kraken Light",
|
|
2512
|
+
description: "Medium-inspired warm paper, editorial black actions, and classic publication yellow.",
|
|
2513
|
+
colorScheme: "light",
|
|
2514
|
+
group: "Kraken"
|
|
2515
|
+
},
|
|
2516
|
+
{
|
|
2517
|
+
id: "kraken-dark",
|
|
2518
|
+
name: "Kraken Dark",
|
|
2519
|
+
description: "Medium-inspired night reading canvas with white actions and classic publication yellow.",
|
|
2520
|
+
colorScheme: "dark",
|
|
2521
|
+
group: "Kraken"
|
|
1763
2522
|
}
|
|
1764
2523
|
];
|
|
1765
2524
|
var THEME_GROUPS = Array.from(new Set(THEMES.map((theme) => theme.group)));
|
|
@@ -1794,35 +2553,35 @@ function readStoredTheme() {
|
|
|
1794
2553
|
|
|
1795
2554
|
// src/components/ui/ThemeDomSync.tsx
|
|
1796
2555
|
function ThemeDomSync() {
|
|
1797
|
-
(0,
|
|
2556
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
1798
2557
|
persistTheme(readStoredTheme());
|
|
1799
2558
|
}, []);
|
|
1800
2559
|
return null;
|
|
1801
2560
|
}
|
|
1802
2561
|
|
|
1803
2562
|
// src/components/ui/ThemeManager.tsx
|
|
1804
|
-
var
|
|
1805
|
-
var
|
|
2563
|
+
var import_react14 = require("react");
|
|
2564
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1806
2565
|
function ThemeManager({ children }) {
|
|
1807
|
-
(0,
|
|
2566
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
1808
2567
|
persistTheme(readStoredTheme());
|
|
1809
2568
|
}, []);
|
|
1810
|
-
return /* @__PURE__ */ (0,
|
|
2569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children });
|
|
1811
2570
|
}
|
|
1812
2571
|
|
|
1813
2572
|
// src/components/ui/ThemeSwitcher.tsx
|
|
1814
|
-
var
|
|
1815
|
-
var
|
|
2573
|
+
var import_react15 = require("react");
|
|
2574
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1816
2575
|
function ThemeSwitcher({ className }) {
|
|
1817
|
-
const [themeId, setThemeId] = (0,
|
|
1818
|
-
(0,
|
|
2576
|
+
const [themeId, setThemeId] = (0, import_react15.useState)("hedgehog-light");
|
|
2577
|
+
(0, import_react15.useEffect)(() => {
|
|
1819
2578
|
const id = readStoredTheme();
|
|
1820
2579
|
persistTheme(id);
|
|
1821
2580
|
setThemeId(id);
|
|
1822
2581
|
}, []);
|
|
1823
|
-
return /* @__PURE__ */ (0,
|
|
1824
|
-
/* @__PURE__ */ (0,
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
2582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: cn("flex min-w-0 items-center gap-2", className), children: [
|
|
2583
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "shrink-0 text-xs font-medium text-ph-mutedtext sm:text-sm", children: "Theme" }),
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1826
2585
|
"select",
|
|
1827
2586
|
{
|
|
1828
2587
|
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",
|
|
@@ -1833,22 +2592,22 @@ function ThemeSwitcher({ className }) {
|
|
|
1833
2592
|
persistTheme(next);
|
|
1834
2593
|
setThemeId(next);
|
|
1835
2594
|
},
|
|
1836
|
-
children: THEME_GROUPS.map((group) => /* @__PURE__ */ (0,
|
|
2595
|
+
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))
|
|
1837
2596
|
}
|
|
1838
2597
|
)
|
|
1839
2598
|
] });
|
|
1840
2599
|
}
|
|
1841
2600
|
|
|
1842
2601
|
// src/components/ui/Accordion.tsx
|
|
1843
|
-
var
|
|
1844
|
-
var
|
|
2602
|
+
var import_react16 = require("react");
|
|
2603
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1845
2604
|
function Accordion({
|
|
1846
2605
|
items,
|
|
1847
2606
|
allowMultiple = false,
|
|
1848
2607
|
defaultOpen = [],
|
|
1849
2608
|
className
|
|
1850
2609
|
}) {
|
|
1851
|
-
const [openItems, setOpenItems] = (0,
|
|
2610
|
+
const [openItems, setOpenItems] = (0, import_react16.useState)(new Set(defaultOpen));
|
|
1852
2611
|
const toggleItem = (id) => {
|
|
1853
2612
|
setOpenItems((prev) => {
|
|
1854
2613
|
const next = new Set(prev);
|
|
@@ -1863,18 +2622,18 @@ function Accordion({
|
|
|
1863
2622
|
return next;
|
|
1864
2623
|
});
|
|
1865
2624
|
};
|
|
1866
|
-
return /* @__PURE__ */ (0,
|
|
2625
|
+
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) => {
|
|
1867
2626
|
const isOpen = openItems.has(item.id);
|
|
1868
|
-
return /* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
2627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "first:rounded-t-xl last:rounded-b-xl", children: [
|
|
2628
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1870
2629
|
"button",
|
|
1871
2630
|
{
|
|
1872
2631
|
type: "button",
|
|
1873
2632
|
onClick: () => toggleItem(item.id),
|
|
1874
2633
|
className: "flex w-full items-center justify-between px-5 py-4 text-left transition hover:bg-ph-muted",
|
|
1875
2634
|
children: [
|
|
1876
|
-
/* @__PURE__ */ (0,
|
|
1877
|
-
/* @__PURE__ */ (0,
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-semibold text-ph-ink", children: item.title }),
|
|
2636
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1878
2637
|
IconChevronDown,
|
|
1879
2638
|
{
|
|
1880
2639
|
className: cn(
|
|
@@ -1886,14 +2645,14 @@ function Accordion({
|
|
|
1886
2645
|
]
|
|
1887
2646
|
}
|
|
1888
2647
|
),
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
2648
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1890
2649
|
"div",
|
|
1891
2650
|
{
|
|
1892
2651
|
className: cn(
|
|
1893
2652
|
"grid transition-all duration-200",
|
|
1894
2653
|
isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
1895
2654
|
),
|
|
1896
|
-
children: /* @__PURE__ */ (0,
|
|
2655
|
+
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 }) })
|
|
1897
2656
|
}
|
|
1898
2657
|
)
|
|
1899
2658
|
] }, item.id);
|
|
@@ -1901,30 +2660,30 @@ function Accordion({
|
|
|
1901
2660
|
}
|
|
1902
2661
|
|
|
1903
2662
|
// src/components/ui/Stepper.tsx
|
|
1904
|
-
var
|
|
2663
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1905
2664
|
function Stepper({ steps, currentStep, className }) {
|
|
1906
|
-
return /* @__PURE__ */ (0,
|
|
2665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("flex items-start gap-2", className), children: steps.map((step, index) => {
|
|
1907
2666
|
const isCompleted = index < currentStep;
|
|
1908
2667
|
const isCurrent = index === currentStep;
|
|
1909
2668
|
const isPending = index > currentStep;
|
|
1910
2669
|
const isError = step.status === "error";
|
|
1911
|
-
return /* @__PURE__ */ (0,
|
|
1912
|
-
/* @__PURE__ */ (0,
|
|
1913
|
-
/* @__PURE__ */ (0,
|
|
2670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
2671
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-1 flex-col items-center", children: [
|
|
2672
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1914
2673
|
"div",
|
|
1915
2674
|
{
|
|
1916
2675
|
className: cn(
|
|
1917
2676
|
"flex h-9 w-9 items-center justify-center rounded-full text-sm font-bold transition-colors",
|
|
1918
|
-
isCompleted && "bg-ph-success text-
|
|
1919
|
-
isCurrent && !isError && "bg-ph-brand text-
|
|
1920
|
-
isCurrent && isError && "bg-ph-danger text-
|
|
2677
|
+
isCompleted && "bg-ph-success text-[var(--ph-on-success)]",
|
|
2678
|
+
isCurrent && !isError && "bg-ph-brand text-[var(--ph-on-accent)] ring-4 ring-ph-brand/20",
|
|
2679
|
+
isCurrent && isError && "bg-ph-danger text-[var(--ph-on-danger)]",
|
|
1921
2680
|
isPending && "bg-ph-muted text-ph-mutedtext"
|
|
1922
2681
|
),
|
|
1923
|
-
children: isCompleted ? /* @__PURE__ */ (0,
|
|
2682
|
+
children: isCompleted ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IconCheck, { className: "h-5 w-5", "aria-hidden": true }) : index + 1
|
|
1924
2683
|
}
|
|
1925
2684
|
),
|
|
1926
|
-
/* @__PURE__ */ (0,
|
|
1927
|
-
/* @__PURE__ */ (0,
|
|
2685
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "mt-2 text-center", children: [
|
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1928
2687
|
"p",
|
|
1929
2688
|
{
|
|
1930
2689
|
className: cn(
|
|
@@ -1935,10 +2694,10 @@ function Stepper({ steps, currentStep, className }) {
|
|
|
1935
2694
|
children: step.label
|
|
1936
2695
|
}
|
|
1937
2696
|
),
|
|
1938
|
-
step.description && /* @__PURE__ */ (0,
|
|
2697
|
+
step.description && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "mt-0.5 text-xs text-ph-mutedtext", children: step.description })
|
|
1939
2698
|
] })
|
|
1940
2699
|
] }),
|
|
1941
|
-
index < steps.length - 1 && /* @__PURE__ */ (0,
|
|
2700
|
+
index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1942
2701
|
"div",
|
|
1943
2702
|
{
|
|
1944
2703
|
className: cn(
|
|
@@ -1952,16 +2711,16 @@ function Stepper({ steps, currentStep, className }) {
|
|
|
1952
2711
|
}
|
|
1953
2712
|
|
|
1954
2713
|
// src/components/ui/SegmentedControl.tsx
|
|
1955
|
-
var
|
|
2714
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1956
2715
|
function SegmentedControl({ options, value, onChange, className }) {
|
|
1957
|
-
return /* @__PURE__ */ (0,
|
|
2716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1958
2717
|
"div",
|
|
1959
2718
|
{
|
|
1960
2719
|
className: cn(
|
|
1961
2720
|
"inline-flex rounded-lg bg-ph-muted p-1",
|
|
1962
2721
|
className
|
|
1963
2722
|
),
|
|
1964
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
2723
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1965
2724
|
"button",
|
|
1966
2725
|
{
|
|
1967
2726
|
type: "button",
|
|
@@ -1971,7 +2730,7 @@ function SegmentedControl({ options, value, onChange, className }) {
|
|
|
1971
2730
|
value === option.value ? "bg-ph-surface text-ph-ink shadow-ph" : "text-ph-subtle hover:text-ph-ink"
|
|
1972
2731
|
),
|
|
1973
2732
|
children: [
|
|
1974
|
-
option.icon && /* @__PURE__ */ (0,
|
|
2733
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "h-4 w-4", children: option.icon }),
|
|
1975
2734
|
option.label
|
|
1976
2735
|
]
|
|
1977
2736
|
},
|
|
@@ -1982,8 +2741,8 @@ function SegmentedControl({ options, value, onChange, className }) {
|
|
|
1982
2741
|
}
|
|
1983
2742
|
|
|
1984
2743
|
// src/components/ui/CommandPalette.tsx
|
|
1985
|
-
var
|
|
1986
|
-
var
|
|
2744
|
+
var import_react17 = require("react");
|
|
2745
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1987
2746
|
function CommandPalette({
|
|
1988
2747
|
items,
|
|
1989
2748
|
isOpen,
|
|
@@ -1991,13 +2750,13 @@ function CommandPalette({
|
|
|
1991
2750
|
placeholder = "Type a command or search...",
|
|
1992
2751
|
className
|
|
1993
2752
|
}) {
|
|
1994
|
-
const [query, setQuery] = (0,
|
|
1995
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
1996
|
-
const inputRef = (0,
|
|
2753
|
+
const [query, setQuery] = (0, import_react17.useState)("");
|
|
2754
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
2755
|
+
const inputRef = (0, import_react17.useRef)(null);
|
|
1997
2756
|
const filtered = items.filter(
|
|
1998
2757
|
(item) => item.label.toLowerCase().includes(query.toLowerCase())
|
|
1999
2758
|
);
|
|
2000
|
-
(0,
|
|
2759
|
+
(0, import_react17.useEffect)(() => {
|
|
2001
2760
|
var _a;
|
|
2002
2761
|
if (isOpen) {
|
|
2003
2762
|
setQuery("");
|
|
@@ -2005,7 +2764,7 @@ function CommandPalette({
|
|
|
2005
2764
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2006
2765
|
}
|
|
2007
2766
|
}, [isOpen]);
|
|
2008
|
-
(0,
|
|
2767
|
+
(0, import_react17.useEffect)(() => {
|
|
2009
2768
|
const handleKeyDown = (e) => {
|
|
2010
2769
|
var _a;
|
|
2011
2770
|
if (!isOpen) return;
|
|
@@ -2032,7 +2791,7 @@ function CommandPalette({
|
|
|
2032
2791
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2033
2792
|
}, [isOpen, filtered, selectedIndex, onClose]);
|
|
2034
2793
|
if (!isOpen) return null;
|
|
2035
|
-
return /* @__PURE__ */ (0,
|
|
2794
|
+
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)(
|
|
2036
2795
|
"div",
|
|
2037
2796
|
{
|
|
2038
2797
|
className: cn(
|
|
@@ -2040,9 +2799,9 @@ function CommandPalette({
|
|
|
2040
2799
|
className
|
|
2041
2800
|
),
|
|
2042
2801
|
children: [
|
|
2043
|
-
/* @__PURE__ */ (0,
|
|
2044
|
-
/* @__PURE__ */ (0,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-3 border-b border-ph-border px-4 py-3", children: [
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconSearch, { className: "h-5 w-5 text-ph-mutedtext" }),
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2046
2805
|
"input",
|
|
2047
2806
|
{
|
|
2048
2807
|
ref: inputRef,
|
|
@@ -2056,9 +2815,9 @@ function CommandPalette({
|
|
|
2056
2815
|
className: "flex-1 bg-transparent text-ph-ink outline-none placeholder:text-ph-mutedtext"
|
|
2057
2816
|
}
|
|
2058
2817
|
),
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2818
|
+
/* @__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" })
|
|
2060
2819
|
] }),
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2820
|
+
/* @__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)(
|
|
2062
2821
|
"button",
|
|
2063
2822
|
{
|
|
2064
2823
|
type: "button",
|
|
@@ -2072,9 +2831,9 @@ function CommandPalette({
|
|
|
2072
2831
|
index === selectedIndex ? "bg-ph-muted text-ph-ink" : "text-ph-subtle"
|
|
2073
2832
|
),
|
|
2074
2833
|
children: [
|
|
2075
|
-
item.icon && /* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2077
|
-
item.shortcut && /* @__PURE__ */ (0,
|
|
2834
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "h-5 w-5", children: item.icon }),
|
|
2835
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex-1", children: item.label }),
|
|
2836
|
+
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 })
|
|
2078
2837
|
]
|
|
2079
2838
|
},
|
|
2080
2839
|
item.id
|
|
@@ -2085,10 +2844,10 @@ function CommandPalette({
|
|
|
2085
2844
|
}
|
|
2086
2845
|
|
|
2087
2846
|
// src/components/ui/Calendar.tsx
|
|
2088
|
-
var
|
|
2089
|
-
var
|
|
2847
|
+
var import_react18 = require("react");
|
|
2848
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2090
2849
|
function Calendar({ value, onChange, className }) {
|
|
2091
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
2850
|
+
const [currentMonth, setCurrentMonth] = (0, import_react18.useState)(value || /* @__PURE__ */ new Date());
|
|
2092
2851
|
const today = /* @__PURE__ */ new Date();
|
|
2093
2852
|
const year = currentMonth.getFullYear();
|
|
2094
2853
|
const month = currentMonth.getMonth();
|
|
@@ -2128,42 +2887,44 @@ function Calendar({ value, onChange, className }) {
|
|
|
2128
2887
|
for (let i = 1; i <= daysInMonth; i++) {
|
|
2129
2888
|
days.push(i);
|
|
2130
2889
|
}
|
|
2131
|
-
return /* @__PURE__ */ (0,
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
2890
|
+
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: [
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2134
2893
|
"button",
|
|
2135
2894
|
{
|
|
2136
2895
|
type: "button",
|
|
2137
2896
|
onClick: prevMonth,
|
|
2897
|
+
"aria-label": "Previous month",
|
|
2138
2898
|
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2139
|
-
children: /* @__PURE__ */ (0,
|
|
2899
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(IconChevronLeft, { className: "h-5 w-5", "aria-hidden": true })
|
|
2140
2900
|
}
|
|
2141
2901
|
),
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
2902
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-sm font-semibold text-ph-ink", children: [
|
|
2143
2903
|
monthNames[month],
|
|
2144
2904
|
" ",
|
|
2145
2905
|
year
|
|
2146
2906
|
] }),
|
|
2147
|
-
/* @__PURE__ */ (0,
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2148
2908
|
"button",
|
|
2149
2909
|
{
|
|
2150
2910
|
type: "button",
|
|
2151
2911
|
onClick: nextMonth,
|
|
2912
|
+
"aria-label": "Next month",
|
|
2152
2913
|
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2153
|
-
children: /* @__PURE__ */ (0,
|
|
2914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(IconChevronRight, { className: "h-5 w-5", "aria-hidden": true })
|
|
2154
2915
|
}
|
|
2155
2916
|
)
|
|
2156
2917
|
] }),
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
weekDays.map((day) => /* @__PURE__ */ (0,
|
|
2159
|
-
days.map((day, index) => /* @__PURE__ */ (0,
|
|
2918
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "grid grid-cols-7 gap-1", children: [
|
|
2919
|
+
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)),
|
|
2920
|
+
days.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "aspect-square", children: day && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2160
2921
|
"button",
|
|
2161
2922
|
{
|
|
2162
2923
|
type: "button",
|
|
2163
2924
|
onClick: () => handleSelect(day),
|
|
2164
2925
|
className: cn(
|
|
2165
2926
|
"flex h-full w-full items-center justify-center rounded-lg text-sm transition-colors",
|
|
2166
|
-
isSelected(day) ? "bg-ph-brand font-semibold text-
|
|
2927
|
+
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"
|
|
2167
2928
|
),
|
|
2168
2929
|
children: day
|
|
2169
2930
|
}
|
|
@@ -2173,11 +2934,11 @@ function Calendar({ value, onChange, className }) {
|
|
|
2173
2934
|
}
|
|
2174
2935
|
|
|
2175
2936
|
// src/components/ui/HoverCard.tsx
|
|
2176
|
-
var
|
|
2177
|
-
var
|
|
2937
|
+
var import_react19 = require("react");
|
|
2938
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2178
2939
|
function HoverCard({ trigger, children, className }) {
|
|
2179
|
-
const [isVisible, setIsVisible] = (0,
|
|
2180
|
-
return /* @__PURE__ */ (0,
|
|
2940
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
2941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2181
2942
|
"div",
|
|
2182
2943
|
{
|
|
2183
2944
|
className: "relative inline-block",
|
|
@@ -2185,7 +2946,7 @@ function HoverCard({ trigger, children, className }) {
|
|
|
2185
2946
|
onMouseLeave: () => setIsVisible(false),
|
|
2186
2947
|
children: [
|
|
2187
2948
|
trigger,
|
|
2188
|
-
/* @__PURE__ */ (0,
|
|
2949
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2189
2950
|
"div",
|
|
2190
2951
|
{
|
|
2191
2952
|
className: cn(
|
|
@@ -2194,8 +2955,8 @@ function HoverCard({ trigger, children, className }) {
|
|
|
2194
2955
|
className
|
|
2195
2956
|
),
|
|
2196
2957
|
children: [
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2958
|
+
/* @__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" }),
|
|
2959
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "relative", children })
|
|
2199
2960
|
]
|
|
2200
2961
|
}
|
|
2201
2962
|
)
|
|
@@ -2205,9 +2966,9 @@ function HoverCard({ trigger, children, className }) {
|
|
|
2205
2966
|
}
|
|
2206
2967
|
|
|
2207
2968
|
// src/components/ui/EmptyState.tsx
|
|
2208
|
-
var
|
|
2969
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2209
2970
|
function EmptyState({ icon, title, description, action, className }) {
|
|
2210
|
-
return /* @__PURE__ */ (0,
|
|
2971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2211
2972
|
"div",
|
|
2212
2973
|
{
|
|
2213
2974
|
className: cn(
|
|
@@ -2215,67 +2976,226 @@ function EmptyState({ icon, title, description, action, className }) {
|
|
|
2215
2976
|
className
|
|
2216
2977
|
),
|
|
2217
2978
|
children: [
|
|
2218
|
-
icon && /* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
description && /* @__PURE__ */ (0,
|
|
2221
|
-
action && /* @__PURE__ */ (0,
|
|
2979
|
+
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 }),
|
|
2980
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "text-base font-semibold text-ph-ink", children: title }),
|
|
2981
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "mt-1 max-w-sm text-sm text-ph-subtle", children: description }),
|
|
2982
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mt-4", children: action })
|
|
2222
2983
|
]
|
|
2223
2984
|
}
|
|
2224
2985
|
);
|
|
2225
2986
|
}
|
|
2226
2987
|
|
|
2227
2988
|
// src/components/ui/FilterChips.tsx
|
|
2228
|
-
var
|
|
2229
|
-
function FilterChips({
|
|
2230
|
-
|
|
2231
|
-
|
|
2989
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2990
|
+
function FilterChips({
|
|
2991
|
+
chips,
|
|
2992
|
+
onToggle,
|
|
2993
|
+
onRemove,
|
|
2994
|
+
className,
|
|
2995
|
+
"aria-label": ariaLabel = "Applied filters"
|
|
2996
|
+
}) {
|
|
2997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn("ph-filter-chips", className), role: "group", "aria-label": ariaLabel, children: chips.map((chip) => {
|
|
2998
|
+
var _a;
|
|
2999
|
+
const label = (_a = chip.removeLabel) != null ? _a : getChipText(chip);
|
|
3000
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3001
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ph-filter-chip__label", children: chip.label }),
|
|
3002
|
+
chip.value != null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ph-filter-chip__value", children: chip.value }) : null
|
|
3003
|
+
] });
|
|
3004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3005
|
+
"span",
|
|
3006
|
+
{
|
|
3007
|
+
className: cn("ph-filter-chip", chip.active && "ph-filter-chip--active"),
|
|
3008
|
+
"data-state": chip.active ? "on" : "off",
|
|
3009
|
+
children: [
|
|
3010
|
+
onToggle ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3011
|
+
"button",
|
|
3012
|
+
{
|
|
3013
|
+
type: "button",
|
|
3014
|
+
className: "ph-filter-chip__main",
|
|
3015
|
+
"aria-pressed": Boolean(chip.active),
|
|
3016
|
+
onClick: () => onToggle(chip.id),
|
|
3017
|
+
children: content
|
|
3018
|
+
}
|
|
3019
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ph-filter-chip__main", children: content }),
|
|
3020
|
+
chip.active && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3021
|
+
"button",
|
|
3022
|
+
{
|
|
3023
|
+
type: "button",
|
|
3024
|
+
className: "ph-filter-chip__remove",
|
|
3025
|
+
"aria-label": `Remove ${label} filter`,
|
|
3026
|
+
onClick: () => onRemove(chip.id),
|
|
3027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(IconClose, { className: "h-3 w-3", "aria-hidden": true })
|
|
3028
|
+
}
|
|
3029
|
+
) : null
|
|
3030
|
+
]
|
|
3031
|
+
},
|
|
3032
|
+
chip.id
|
|
3033
|
+
);
|
|
3034
|
+
}) });
|
|
3035
|
+
}
|
|
3036
|
+
function getChipText(chip) {
|
|
3037
|
+
const label = typeof chip.label === "string" || typeof chip.label === "number" ? String(chip.label) : chip.id;
|
|
3038
|
+
const value = typeof chip.value === "string" || typeof chip.value === "number" ? String(chip.value) : null;
|
|
3039
|
+
return value ? `${label}: ${value}` : label;
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
// src/components/ui/FilterBar.tsx
|
|
3043
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3044
|
+
function FilterBar(_a) {
|
|
3045
|
+
var _b = _a, {
|
|
3046
|
+
children,
|
|
3047
|
+
label = "Filters and sorting",
|
|
3048
|
+
onClear,
|
|
3049
|
+
clearLabel = "Clear all",
|
|
3050
|
+
resultCount,
|
|
3051
|
+
className
|
|
3052
|
+
} = _b, props = __objRest(_b, [
|
|
3053
|
+
"children",
|
|
3054
|
+
"label",
|
|
3055
|
+
"onClear",
|
|
3056
|
+
"clearLabel",
|
|
3057
|
+
"resultCount",
|
|
3058
|
+
"className"
|
|
3059
|
+
]);
|
|
3060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-filter-bar", className) }, props), { children: [
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ph-filter-bar__controls", role: "group", "aria-label": label, children: [
|
|
3062
|
+
children,
|
|
3063
|
+
onClear ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", className: "ph-filter-bar__clear", onClick: onClear, children: clearLabel }) : null
|
|
3064
|
+
] }),
|
|
3065
|
+
resultCount != null ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("output", { className: "ph-filter-bar__results", "aria-live": "polite", children: resultCount }) : null
|
|
3066
|
+
] }));
|
|
3067
|
+
}
|
|
3068
|
+
function FilterMenu({
|
|
3069
|
+
label,
|
|
3070
|
+
value,
|
|
3071
|
+
options,
|
|
3072
|
+
onValueChange,
|
|
3073
|
+
placeholder = "Any",
|
|
3074
|
+
align = "start",
|
|
3075
|
+
disabled,
|
|
3076
|
+
className
|
|
3077
|
+
}) {
|
|
3078
|
+
var _a;
|
|
3079
|
+
const selected = options.find((option) => option.value === value);
|
|
3080
|
+
const displayValue = (_a = selected == null ? void 0 : selected.label) != null ? _a : placeholder;
|
|
3081
|
+
const accessibleValue = selected ? getOptionText(selected) : String(placeholder);
|
|
3082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3083
|
+
DropdownMenu,
|
|
2232
3084
|
{
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
3085
|
+
"aria-label": `${label}: ${accessibleValue}`,
|
|
3086
|
+
align,
|
|
3087
|
+
disabled,
|
|
3088
|
+
className,
|
|
3089
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: cn("ph-filter-menu-trigger", selected && "ph-filter-menu-trigger--active"), children: [
|
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(IconTuning, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__value", children: displayValue })
|
|
3093
|
+
] }),
|
|
3094
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3095
|
+
DropdownRadioItem,
|
|
3096
|
+
{
|
|
3097
|
+
value: option.value,
|
|
3098
|
+
textValue: getOptionText(option),
|
|
3099
|
+
disabled: option.disabled,
|
|
3100
|
+
children: option.label
|
|
3101
|
+
},
|
|
3102
|
+
option.value
|
|
3103
|
+
)) })
|
|
3104
|
+
}
|
|
3105
|
+
);
|
|
3106
|
+
}
|
|
3107
|
+
function SortMenu({
|
|
3108
|
+
label,
|
|
3109
|
+
value,
|
|
3110
|
+
options,
|
|
3111
|
+
onValueChange,
|
|
3112
|
+
direction = "descending",
|
|
3113
|
+
align = "end",
|
|
3114
|
+
disabled,
|
|
3115
|
+
className
|
|
3116
|
+
}) {
|
|
3117
|
+
const selected = options.find((option) => option.value === value);
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3119
|
+
DropdownMenu,
|
|
3120
|
+
{
|
|
3121
|
+
"aria-label": `${label}: ${selected ? getOptionText(selected) : "Choose sort order"}`,
|
|
3122
|
+
align,
|
|
3123
|
+
disabled,
|
|
3124
|
+
className,
|
|
3125
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "ph-filter-menu-trigger ph-sort-menu-trigger", children: [
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3127
|
+
IconArrowDown,
|
|
2243
3128
|
{
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
onRemove(chip.id);
|
|
2247
|
-
},
|
|
2248
|
-
className: "ml-0.5 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full hover:bg-white/20",
|
|
2249
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconClose, { className: "h-3 w-3" })
|
|
3129
|
+
className: cn("h-3.5 w-3.5", direction === "ascending" && "rotate-180"),
|
|
3130
|
+
"aria-hidden": true
|
|
2250
3131
|
}
|
|
2251
|
-
)
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
3132
|
+
),
|
|
3133
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3134
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-filter-menu-trigger__value", children: selected.label }) : null
|
|
3135
|
+
] }),
|
|
3136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3137
|
+
DropdownRadioItem,
|
|
3138
|
+
{
|
|
3139
|
+
value: option.value,
|
|
3140
|
+
textValue: getOptionText(option),
|
|
3141
|
+
disabled: option.disabled,
|
|
3142
|
+
children: option.label
|
|
3143
|
+
},
|
|
3144
|
+
option.value
|
|
3145
|
+
)) })
|
|
3146
|
+
}
|
|
3147
|
+
);
|
|
3148
|
+
}
|
|
3149
|
+
function getOptionText(option) {
|
|
3150
|
+
if (option.textValue) return option.textValue;
|
|
3151
|
+
if (typeof option.label === "string" || typeof option.label === "number") return String(option.label);
|
|
3152
|
+
return option.value;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
// src/components/ui/FilterControls.tsx
|
|
3156
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3157
|
+
function FilterControls(_a) {
|
|
3158
|
+
var _b = _a, {
|
|
3159
|
+
children,
|
|
3160
|
+
barProps,
|
|
3161
|
+
chipsProps,
|
|
3162
|
+
emptyState,
|
|
3163
|
+
className
|
|
3164
|
+
} = _b, props = __objRest(_b, [
|
|
3165
|
+
"children",
|
|
3166
|
+
"barProps",
|
|
3167
|
+
"chipsProps",
|
|
3168
|
+
"emptyState",
|
|
3169
|
+
"className"
|
|
3170
|
+
]);
|
|
3171
|
+
const hasChips = Boolean(chipsProps == null ? void 0 : chipsProps.chips.length);
|
|
3172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-filter-controls", className) }, props), { children: [
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterBar, __spreadProps(__spreadValues({}, barProps), { children })),
|
|
3174
|
+
hasChips && chipsProps ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterChips, __spreadValues({}, chipsProps)) : emptyState != null ? emptyState : null
|
|
3175
|
+
] }));
|
|
2256
3176
|
}
|
|
2257
3177
|
|
|
2258
3178
|
// src/components/ui/CodeBlock.tsx
|
|
2259
|
-
var
|
|
2260
|
-
var
|
|
3179
|
+
var import_react20 = require("react");
|
|
3180
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2261
3181
|
function CodeBlock({ code, language = "tsx", filename, className }) {
|
|
2262
|
-
const [copied, setCopied] = (0,
|
|
3182
|
+
const [copied, setCopied] = (0, import_react20.useState)(false);
|
|
2263
3183
|
const handleCopy = async () => {
|
|
2264
3184
|
await navigator.clipboard.writeText(code);
|
|
2265
3185
|
setCopied(true);
|
|
2266
3186
|
setTimeout(() => setCopied(false), 2e3);
|
|
2267
3187
|
};
|
|
2268
|
-
return /* @__PURE__ */ (0,
|
|
2269
|
-
(filename || language) && /* @__PURE__ */ (0,
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2272
|
-
/* @__PURE__ */ (0,
|
|
2273
|
-
/* @__PURE__ */ (0,
|
|
2274
|
-
/* @__PURE__ */ (0,
|
|
3188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("overflow-hidden rounded-lg border border-ph-border bg-[#1a1a2e]", className), children: [
|
|
3189
|
+
(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: [
|
|
3190
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3191
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex gap-1.5", children: [
|
|
3192
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-3 w-3 rounded-full bg-red-400" }),
|
|
3193
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-3 w-3 rounded-full bg-amber-400" }),
|
|
3194
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-3 w-3 rounded-full bg-emerald-400" })
|
|
2275
3195
|
] }),
|
|
2276
|
-
filename && /* @__PURE__ */ (0,
|
|
3196
|
+
filename && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ml-2 text-xs text-white/60", children: filename })
|
|
2277
3197
|
] }),
|
|
2278
|
-
/* @__PURE__ */ (0,
|
|
3198
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2279
3199
|
"button",
|
|
2280
3200
|
{
|
|
2281
3201
|
type: "button",
|
|
@@ -2285,35 +3205,35 @@ function CodeBlock({ code, language = "tsx", filename, className }) {
|
|
|
2285
3205
|
}
|
|
2286
3206
|
)
|
|
2287
3207
|
] }),
|
|
2288
|
-
/* @__PURE__ */ (0,
|
|
3208
|
+
/* @__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 }) })
|
|
2289
3209
|
] });
|
|
2290
3210
|
}
|
|
2291
3211
|
|
|
2292
3212
|
// src/components/ui/ComponentDocs.tsx
|
|
2293
|
-
var
|
|
3213
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2294
3214
|
function ComponentDocs({ title = "Props & variants", rows, defaultOpen = false, className }) {
|
|
2295
|
-
return /* @__PURE__ */ (0,
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2297
|
-
/* @__PURE__ */ (0,
|
|
2298
|
-
/* @__PURE__ */ (0,
|
|
2299
|
-
/* @__PURE__ */ (0,
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
3215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("details", { className: cn("ph-panel group overflow-hidden p-0", className), open: defaultOpen, children: [
|
|
3216
|
+
/* @__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: [
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "text-xs font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
|
|
3218
|
+
/* @__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: [
|
|
3219
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "group-open:hidden", children: "Show" }),
|
|
3220
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "hidden group-open:inline", children: "Hide" })
|
|
2301
3221
|
] })
|
|
2302
3222
|
] }),
|
|
2303
|
-
/* @__PURE__ */ (0,
|
|
2304
|
-
/* @__PURE__ */ (0,
|
|
2305
|
-
/* @__PURE__ */ (0,
|
|
2306
|
-
/* @__PURE__ */ (0,
|
|
2307
|
-
/* @__PURE__ */ (0,
|
|
2308
|
-
/* @__PURE__ */ (0,
|
|
3223
|
+
/* @__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: [
|
|
3224
|
+
/* @__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: [
|
|
3225
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Prop" }),
|
|
3226
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Type" }),
|
|
3227
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Default" }),
|
|
3228
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Use" })
|
|
2309
3229
|
] }) }),
|
|
2310
|
-
/* @__PURE__ */ (0,
|
|
3230
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("tbody", { className: "divide-y divide-ph-border", children: rows.map((row) => {
|
|
2311
3231
|
var _a;
|
|
2312
|
-
return /* @__PURE__ */ (0,
|
|
2313
|
-
/* @__PURE__ */ (0,
|
|
2314
|
-
/* @__PURE__ */ (0,
|
|
2315
|
-
/* @__PURE__ */ (0,
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
3232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("tr", { children: [
|
|
3233
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-ink", children: row.name }),
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: row.type }),
|
|
3235
|
+
/* @__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 : "-" }),
|
|
3236
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("td", { className: "px-4 py-3 align-top text-ph-subtle", children: row.description })
|
|
2317
3237
|
] }, row.name);
|
|
2318
3238
|
}) })
|
|
2319
3239
|
] }) })
|
|
@@ -2321,8 +3241,8 @@ function ComponentDocs({ title = "Props & variants", rows, defaultOpen = false,
|
|
|
2321
3241
|
}
|
|
2322
3242
|
|
|
2323
3243
|
// src/components/ui/ShowcaseWrapper.tsx
|
|
2324
|
-
var
|
|
2325
|
-
var
|
|
3244
|
+
var import_react21 = require("react");
|
|
3245
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2326
3246
|
function ShowcaseWrapper({
|
|
2327
3247
|
id,
|
|
2328
3248
|
title,
|
|
@@ -2334,49 +3254,32 @@ function ShowcaseWrapper({
|
|
|
2334
3254
|
className
|
|
2335
3255
|
}) {
|
|
2336
3256
|
var _a;
|
|
2337
|
-
const [showCode, setShowCode] = (0,
|
|
3257
|
+
const [showCode, setShowCode] = (0, import_react21.useState)(false);
|
|
2338
3258
|
const fallbackId = (_a = titleIdMap[title]) != null ? _a : title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
2339
|
-
return /* @__PURE__ */ (0,
|
|
2340
|
-
/* @__PURE__ */ (0,
|
|
2341
|
-
/* @__PURE__ */ (0,
|
|
2342
|
-
/* @__PURE__ */ (0,
|
|
2343
|
-
/* @__PURE__ */ (0,
|
|
3259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { id: id != null ? id : fallbackId, className: cn("scroll-mt-20", className), children: [
|
|
3260
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ph-h2-rule mb-8", children: [
|
|
3261
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
3262
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { children: title }),
|
|
3263
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2344
3264
|
"button",
|
|
2345
3265
|
{
|
|
2346
3266
|
type: "button",
|
|
2347
3267
|
onClick: () => setShowCode(!showCode),
|
|
2348
3268
|
className: cn(
|
|
2349
3269
|
"flex h-10 w-10 items-center justify-center rounded-full border transition-all",
|
|
2350
|
-
showCode ? "border-ph-brand bg-ph-brand text-
|
|
3270
|
+
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"
|
|
2351
3271
|
),
|
|
2352
3272
|
title: showCode ? "Hide code" : "Show code",
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
{
|
|
2356
|
-
className: "h-5 w-5",
|
|
2357
|
-
viewBox: "0 0 24 24",
|
|
2358
|
-
fill: "none",
|
|
2359
|
-
stroke: "currentColor",
|
|
2360
|
-
strokeWidth: "2",
|
|
2361
|
-
strokeLinecap: "round",
|
|
2362
|
-
strokeLinejoin: "round",
|
|
2363
|
-
children: [
|
|
2364
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2", ry: "2" }),
|
|
2365
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2366
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "12", y1: "17", x2: "12", y2: "21" }),
|
|
2367
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "6", y1: "8", x2: "6", y2: "8" }),
|
|
2368
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("line", { x1: "10", y1: "8", x2: "10", y2: "8" })
|
|
2369
|
-
]
|
|
2370
|
-
}
|
|
2371
|
-
)
|
|
3273
|
+
"aria-label": showCode ? "Hide code" : "Show code",
|
|
3274
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconCodePreview, { className: "h-5 w-5", "aria-hidden": true })
|
|
2372
3275
|
}
|
|
2373
3276
|
)
|
|
2374
3277
|
] }),
|
|
2375
|
-
/* @__PURE__ */ (0,
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("hr", {})
|
|
2376
3279
|
] }),
|
|
2377
|
-
description && /* @__PURE__ */ (0,
|
|
2378
|
-
docs && /* @__PURE__ */ (0,
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
3280
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "mb-6 text-sm text-ph-subtle", children: description }),
|
|
3281
|
+
docs && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mb-6", children: docs }),
|
|
3282
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2380
3283
|
"div",
|
|
2381
3284
|
{
|
|
2382
3285
|
className: cn(
|
|
@@ -2384,15 +3287,15 @@ function ShowcaseWrapper({
|
|
|
2384
3287
|
showCode ? "lg:grid lg:grid-cols-[1fr,minmax(360px,420px)]" : "block"
|
|
2385
3288
|
),
|
|
2386
3289
|
children: [
|
|
2387
|
-
/* @__PURE__ */ (0,
|
|
2388
|
-
/* @__PURE__ */ (0,
|
|
3290
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("min-w-0", showCode && "lg:pr-2"), children }),
|
|
3291
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2389
3292
|
"div",
|
|
2390
3293
|
{
|
|
2391
3294
|
className: cn(
|
|
2392
3295
|
"transition-all duration-300",
|
|
2393
3296
|
showCode ? "block opacity-100" : "hidden opacity-0 lg:hidden"
|
|
2394
3297
|
),
|
|
2395
|
-
children: /* @__PURE__ */ (0,
|
|
3298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "sticky top-20", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CodeBlock, { code, filename }) })
|
|
2396
3299
|
}
|
|
2397
3300
|
)
|
|
2398
3301
|
]
|
|
@@ -2441,41 +3344,41 @@ var titleIdMap = {
|
|
|
2441
3344
|
};
|
|
2442
3345
|
|
|
2443
3346
|
// src/components/ui/CollapsibleSection.tsx
|
|
2444
|
-
var
|
|
2445
|
-
var
|
|
3347
|
+
var import_react22 = require("react");
|
|
3348
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2446
3349
|
function CollapsibleSection({ title, children, defaultOpen = true, id }) {
|
|
2447
|
-
const [isOpen, setIsOpen] = (0,
|
|
2448
|
-
|
|
2449
|
-
|
|
3350
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(defaultOpen);
|
|
3351
|
+
const generatedId = (0, import_react22.useId)();
|
|
3352
|
+
const contentId = `${id != null ? id : generatedId}-content`;
|
|
3353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { id, className: "scroll-mt-20", children: [
|
|
3354
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2450
3355
|
"button",
|
|
2451
3356
|
{
|
|
2452
3357
|
type: "button",
|
|
2453
3358
|
onClick: () => setIsOpen(!isOpen),
|
|
3359
|
+
"aria-expanded": isOpen,
|
|
3360
|
+
"aria-controls": contentId,
|
|
2454
3361
|
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",
|
|
2455
3362
|
children: [
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
2457
|
-
/* @__PURE__ */ (0,
|
|
2458
|
-
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-lg font-bold text-ph-ink", children: title }),
|
|
3364
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3365
|
+
IconChevronDown,
|
|
2459
3366
|
{
|
|
2460
3367
|
className: cn(
|
|
2461
3368
|
"h-5 w-5 text-ph-subtle transition-transform duration-200",
|
|
2462
3369
|
isOpen && "rotate-180"
|
|
2463
3370
|
),
|
|
2464
|
-
|
|
2465
|
-
fill: "none",
|
|
2466
|
-
stroke: "currentColor",
|
|
2467
|
-
strokeWidth: "2",
|
|
2468
|
-
strokeLinecap: "round",
|
|
2469
|
-
strokeLinejoin: "round",
|
|
2470
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
3371
|
+
"aria-hidden": true
|
|
2471
3372
|
}
|
|
2472
3373
|
)
|
|
2473
3374
|
]
|
|
2474
3375
|
}
|
|
2475
3376
|
),
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2477
3378
|
"div",
|
|
2478
3379
|
{
|
|
3380
|
+
id: contentId,
|
|
3381
|
+
"aria-hidden": !isOpen,
|
|
2479
3382
|
className: cn(
|
|
2480
3383
|
"overflow-hidden transition-all duration-300",
|
|
2481
3384
|
isOpen ? "max-h-[50000px] opacity-100" : "max-h-0 opacity-0"
|
|
@@ -2487,7 +3390,7 @@ function CollapsibleSection({ title, children, defaultOpen = true, id }) {
|
|
|
2487
3390
|
}
|
|
2488
3391
|
|
|
2489
3392
|
// src/components/ui/Typography.tsx
|
|
2490
|
-
var
|
|
3393
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2491
3394
|
var toneMap2 = {
|
|
2492
3395
|
default: "text-ph-ink",
|
|
2493
3396
|
muted: "text-ph-mutedtext",
|
|
@@ -2516,47 +3419,47 @@ function Display({
|
|
|
2516
3419
|
truncate,
|
|
2517
3420
|
className
|
|
2518
3421
|
}) {
|
|
2519
|
-
return /* @__PURE__ */ (0,
|
|
3422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h1", { className: textClass("text-4xl font-extrabold tracking-tight md:text-5xl", tone, weight, truncate, className), children });
|
|
2520
3423
|
}
|
|
2521
3424
|
function H1({ children, tone = "default", weight, truncate, className }) {
|
|
2522
|
-
return /* @__PURE__ */ (0,
|
|
3425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h1", { className: textClass("text-3xl font-bold tracking-tight md:text-4xl", tone, weight, truncate, className), children });
|
|
2523
3426
|
}
|
|
2524
3427
|
function H2({ children, tone = "default", weight, truncate, className }) {
|
|
2525
|
-
return /* @__PURE__ */ (0,
|
|
3428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { className: textClass("text-2xl font-bold tracking-tight", tone, weight, truncate, className), children });
|
|
2526
3429
|
}
|
|
2527
3430
|
function H3({ children, tone = "default", weight, truncate, className }) {
|
|
2528
|
-
return /* @__PURE__ */ (0,
|
|
3431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h3", { className: textClass("text-xl font-semibold", tone, weight, truncate, className), children });
|
|
2529
3432
|
}
|
|
2530
3433
|
function H4({ children, tone = "default", weight, truncate, className }) {
|
|
2531
|
-
return /* @__PURE__ */ (0,
|
|
3434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h4", { className: textClass("text-lg font-semibold", tone, weight, truncate, className), children });
|
|
2532
3435
|
}
|
|
2533
3436
|
function H5({ children, tone = "default", weight, truncate, className }) {
|
|
2534
|
-
return /* @__PURE__ */ (0,
|
|
3437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h5", { className: textClass("text-base font-semibold", tone, weight, truncate, className), children });
|
|
2535
3438
|
}
|
|
2536
3439
|
function P({ children, tone = "default", weight, truncate, className }) {
|
|
2537
|
-
return /* @__PURE__ */ (0,
|
|
3440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: textClass("text-base leading-relaxed", tone, weight, truncate, className), children });
|
|
2538
3441
|
}
|
|
2539
3442
|
function Small({ children, tone = "default", weight, truncate, className }) {
|
|
2540
|
-
return /* @__PURE__ */ (0,
|
|
3443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: textClass("text-sm leading-relaxed", tone, weight, truncate, className), children });
|
|
2541
3444
|
}
|
|
2542
3445
|
function Caption({ children, tone = "muted", weight, truncate, className }) {
|
|
2543
|
-
return /* @__PURE__ */ (0,
|
|
3446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: textClass("text-[11px] font-medium uppercase tracking-wider", tone, weight, truncate, className), children });
|
|
2544
3447
|
}
|
|
2545
3448
|
function Overline({ children, tone = "muted", weight, truncate, className }) {
|
|
2546
|
-
return /* @__PURE__ */ (0,
|
|
3449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: textClass("text-[10px] font-bold uppercase tracking-[0.15em]", tone, weight, truncate, className), children });
|
|
2547
3450
|
}
|
|
2548
3451
|
function Lead({ children, tone = "subtle", weight, truncate, className }) {
|
|
2549
|
-
return /* @__PURE__ */ (0,
|
|
3452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: textClass("text-lg leading-relaxed", tone, weight, truncate, className), children });
|
|
2550
3453
|
}
|
|
2551
3454
|
function Mono({ children, tone = "default", weight, truncate, className }) {
|
|
2552
|
-
return /* @__PURE__ */ (0,
|
|
3455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("code", { className: textClass("text-sm font-mono leading-relaxed", tone, weight, truncate, className), children });
|
|
2553
3456
|
}
|
|
2554
3457
|
function Label({ children, tone = "default", weight, truncate, className }) {
|
|
2555
|
-
return /* @__PURE__ */ (0,
|
|
3458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("label", { className: textClass("text-sm font-medium", tone, weight, truncate, className), children });
|
|
2556
3459
|
}
|
|
2557
3460
|
|
|
2558
3461
|
// src/components/ui/Avatar.tsx
|
|
2559
|
-
var
|
|
3462
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2560
3463
|
var sizeMap5 = {
|
|
2561
3464
|
xs: "h-8 w-8 text-[10px]",
|
|
2562
3465
|
sm: "h-10 w-10 text-xs",
|
|
@@ -2588,8 +3491,8 @@ function Avatar(_a) {
|
|
|
2588
3491
|
"badge",
|
|
2589
3492
|
"className"
|
|
2590
3493
|
]);
|
|
2591
|
-
return /* @__PURE__ */ (0,
|
|
2592
|
-
/* @__PURE__ */ (0,
|
|
3494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex shrink-0", className) }, props), { children: [
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2593
3496
|
"div",
|
|
2594
3497
|
{
|
|
2595
3498
|
className: cn(
|
|
@@ -2600,7 +3503,7 @@ function Avatar(_a) {
|
|
|
2600
3503
|
children: icon || label
|
|
2601
3504
|
}
|
|
2602
3505
|
),
|
|
2603
|
-
status && /* @__PURE__ */ (0,
|
|
3506
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2604
3507
|
"span",
|
|
2605
3508
|
{
|
|
2606
3509
|
className: cn(
|
|
@@ -2609,7 +3512,7 @@ function Avatar(_a) {
|
|
|
2609
3512
|
)
|
|
2610
3513
|
}
|
|
2611
3514
|
),
|
|
2612
|
-
badge && /* @__PURE__ */ (0,
|
|
3515
|
+
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 })
|
|
2613
3516
|
] }));
|
|
2614
3517
|
}
|
|
2615
3518
|
function AvatarGroup(_a) {
|
|
@@ -2617,9 +3520,9 @@ function AvatarGroup(_a) {
|
|
|
2617
3520
|
const items = Array.isArray(children) ? children : [children];
|
|
2618
3521
|
const visible = max ? items.slice(0, max) : items;
|
|
2619
3522
|
const remaining = max ? items.length - max : 0;
|
|
2620
|
-
return /* @__PURE__ */ (0,
|
|
3523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", __spreadProps(__spreadValues({ className: cn("-space-x-3 flex rtl:space-x-reverse", className) }, props), { children: [
|
|
2621
3524
|
visible,
|
|
2622
|
-
remaining > 0 && /* @__PURE__ */ (0,
|
|
3525
|
+
remaining > 0 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2623
3526
|
Avatar,
|
|
2624
3527
|
{
|
|
2625
3528
|
label: `+${remaining}`,
|
|
@@ -2631,7 +3534,7 @@ function AvatarGroup(_a) {
|
|
|
2631
3534
|
}
|
|
2632
3535
|
|
|
2633
3536
|
// src/components/ui/Progress.tsx
|
|
2634
|
-
var
|
|
3537
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2635
3538
|
var sizeMap6 = {
|
|
2636
3539
|
sm: "h-1",
|
|
2637
3540
|
md: "h-2",
|
|
@@ -2656,15 +3559,15 @@ function Progress(_a) {
|
|
|
2656
3559
|
"className"
|
|
2657
3560
|
]);
|
|
2658
3561
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2660
|
-
(label || showPercentage) && /* @__PURE__ */ (0,
|
|
2661
|
-
label && /* @__PURE__ */ (0,
|
|
2662
|
-
showPercentage && /* @__PURE__ */ (0,
|
|
3562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", __spreadProps(__spreadValues({ className: cn("w-full", className) }, props), { children: [
|
|
3563
|
+
(label || showPercentage) && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "mb-1.5 flex justify-between text-sm text-ph-subtle", children: [
|
|
3564
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: label }),
|
|
3565
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "tabular-nums", children: [
|
|
2663
3566
|
Math.round(percentage),
|
|
2664
3567
|
"%"
|
|
2665
3568
|
] })
|
|
2666
3569
|
] }),
|
|
2667
|
-
/* @__PURE__ */ (0,
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cn("ph-progress", sizeMap6[size]), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2668
3571
|
"div",
|
|
2669
3572
|
{
|
|
2670
3573
|
className: cn("ph-progress-bar", color),
|
|
@@ -2679,7 +3582,7 @@ function Progress(_a) {
|
|
|
2679
3582
|
}
|
|
2680
3583
|
|
|
2681
3584
|
// src/components/ui/ChatBubble.tsx
|
|
2682
|
-
var
|
|
3585
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2683
3586
|
function ChatBubble(_a) {
|
|
2684
3587
|
var _b = _a, {
|
|
2685
3588
|
children,
|
|
@@ -2699,7 +3602,7 @@ function ChatBubble(_a) {
|
|
|
2699
3602
|
"className"
|
|
2700
3603
|
]);
|
|
2701
3604
|
const isSelf = variant === "self";
|
|
2702
|
-
return /* @__PURE__ */ (0,
|
|
3605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2703
3606
|
"div",
|
|
2704
3607
|
__spreadProps(__spreadValues({
|
|
2705
3608
|
className: cn(
|
|
@@ -2709,9 +3612,9 @@ function ChatBubble(_a) {
|
|
|
2709
3612
|
)
|
|
2710
3613
|
}, props), {
|
|
2711
3614
|
children: [
|
|
2712
|
-
avatar && /* @__PURE__ */ (0,
|
|
2713
|
-
/* @__PURE__ */ (0,
|
|
2714
|
-
(name || time) && /* @__PURE__ */ (0,
|
|
3615
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "shrink-0", children: avatar }),
|
|
3616
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("min-w-0 flex-1", isSelf && "text-right"), children: [
|
|
3617
|
+
(name || time) && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2715
3618
|
"header",
|
|
2716
3619
|
{
|
|
2717
3620
|
className: cn(
|
|
@@ -2719,12 +3622,12 @@ function ChatBubble(_a) {
|
|
|
2719
3622
|
isSelf && "flex-row-reverse justify-end"
|
|
2720
3623
|
),
|
|
2721
3624
|
children: [
|
|
2722
|
-
name && /* @__PURE__ */ (0,
|
|
2723
|
-
time && /* @__PURE__ */ (0,
|
|
3625
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-semibold text-ph-ink", children: name }),
|
|
3626
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: time })
|
|
2724
3627
|
]
|
|
2725
3628
|
}
|
|
2726
3629
|
),
|
|
2727
|
-
/* @__PURE__ */ (0,
|
|
3630
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2728
3631
|
"div",
|
|
2729
3632
|
{
|
|
2730
3633
|
className: cn(
|
|
@@ -2734,7 +3637,7 @@ function ChatBubble(_a) {
|
|
|
2734
3637
|
children
|
|
2735
3638
|
}
|
|
2736
3639
|
),
|
|
2737
|
-
footer && /* @__PURE__ */ (0,
|
|
3640
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("footer", { className: "mt-2 text-[11px] text-ph-mutedtext", children: footer })
|
|
2738
3641
|
] })
|
|
2739
3642
|
]
|
|
2740
3643
|
})
|
|
@@ -2742,7 +3645,7 @@ function ChatBubble(_a) {
|
|
|
2742
3645
|
}
|
|
2743
3646
|
|
|
2744
3647
|
// src/components/ui/Terminal.tsx
|
|
2745
|
-
var
|
|
3648
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2746
3649
|
function Terminal(_a) {
|
|
2747
3650
|
var _b = _a, {
|
|
2748
3651
|
title = "sandbox",
|
|
@@ -2755,7 +3658,7 @@ function Terminal(_a) {
|
|
|
2755
3658
|
"children",
|
|
2756
3659
|
"className"
|
|
2757
3660
|
]);
|
|
2758
|
-
return /* @__PURE__ */ (0,
|
|
3661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2759
3662
|
"div",
|
|
2760
3663
|
__spreadProps(__spreadValues({
|
|
2761
3664
|
className: cn(
|
|
@@ -2764,18 +3667,18 @@ function Terminal(_a) {
|
|
|
2764
3667
|
)
|
|
2765
3668
|
}, props), {
|
|
2766
3669
|
children: [
|
|
2767
|
-
/* @__PURE__ */ (0,
|
|
2768
|
-
/* @__PURE__ */ (0,
|
|
2769
|
-
/* @__PURE__ */ (0,
|
|
2770
|
-
/* @__PURE__ */ (0,
|
|
2771
|
-
title && /* @__PURE__ */ (0,
|
|
3670
|
+
/* @__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: [
|
|
3671
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-3 rounded-full bg-red-400" }),
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-3 rounded-full bg-amber-400" }),
|
|
3673
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-3 rounded-full bg-emerald-400" }),
|
|
3674
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs font-medium text-ph-mutedtext", children: title })
|
|
2772
3675
|
] }),
|
|
2773
|
-
/* @__PURE__ */ (0,
|
|
3676
|
+
/* @__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) => {
|
|
2774
3677
|
const text = typeof line === "string" ? line : line.text;
|
|
2775
3678
|
const color = typeof line === "string" ? void 0 : line.color;
|
|
2776
|
-
return /* @__PURE__ */ (0,
|
|
2777
|
-
/* @__PURE__ */ (0,
|
|
2778
|
-
i < lines.length - 1 && /* @__PURE__ */ (0,
|
|
3679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: color || "text-neutral-600", children: text }),
|
|
3681
|
+
i < lines.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("br", {})
|
|
2779
3682
|
] }, i);
|
|
2780
3683
|
}) }) })
|
|
2781
3684
|
]
|
|
@@ -2784,7 +3687,7 @@ function Terminal(_a) {
|
|
|
2784
3687
|
}
|
|
2785
3688
|
|
|
2786
3689
|
// src/components/ui/Indicator.tsx
|
|
2787
|
-
var
|
|
3690
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2788
3691
|
var positionMap = {
|
|
2789
3692
|
"top-right": "-right-[2px] -top-[2px]",
|
|
2790
3693
|
"top-left": "-left-[2px] -top-[2px]",
|
|
@@ -2807,8 +3710,8 @@ function Indicator(_a) {
|
|
|
2807
3710
|
"dot",
|
|
2808
3711
|
"className"
|
|
2809
3712
|
]);
|
|
2810
|
-
return /* @__PURE__ */ (0,
|
|
2811
|
-
dot ? /* @__PURE__ */ (0,
|
|
3713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex items-center justify-center", className) }, props), { children: [
|
|
3714
|
+
dot ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2812
3715
|
"span",
|
|
2813
3716
|
{
|
|
2814
3717
|
className: cn(
|
|
@@ -2817,7 +3720,7 @@ function Indicator(_a) {
|
|
|
2817
3720
|
positionMap[position]
|
|
2818
3721
|
)
|
|
2819
3722
|
}
|
|
2820
|
-
) : badge != null ? /* @__PURE__ */ (0,
|
|
3723
|
+
) : badge != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2821
3724
|
"span",
|
|
2822
3725
|
{
|
|
2823
3726
|
className: cn(
|
|
@@ -2833,7 +3736,7 @@ function Indicator(_a) {
|
|
|
2833
3736
|
}
|
|
2834
3737
|
|
|
2835
3738
|
// src/components/ui/Timeline.tsx
|
|
2836
|
-
var
|
|
3739
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2837
3740
|
function Timeline(_a) {
|
|
2838
3741
|
var _b = _a, {
|
|
2839
3742
|
events,
|
|
@@ -2844,15 +3747,15 @@ function Timeline(_a) {
|
|
|
2844
3747
|
"alternate",
|
|
2845
3748
|
"className"
|
|
2846
3749
|
]);
|
|
2847
|
-
return /* @__PURE__ */ (0,
|
|
3750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2848
3751
|
"ol",
|
|
2849
3752
|
__spreadProps(__spreadValues({
|
|
2850
3753
|
className: cn("relative space-y-8", className)
|
|
2851
3754
|
}, props), {
|
|
2852
3755
|
children: events.map((event, idx) => {
|
|
2853
3756
|
const align = alternate && idx % 2 !== 0 ? "lg:flex-row-reverse" : "";
|
|
2854
|
-
return /* @__PURE__ */ (0,
|
|
2855
|
-
/* @__PURE__ */ (0,
|
|
3757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("li", { className: cn("relative flex gap-6", align), children: [
|
|
3758
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2856
3759
|
"div",
|
|
2857
3760
|
{
|
|
2858
3761
|
className: cn(
|
|
@@ -2862,12 +3765,12 @@ function Timeline(_a) {
|
|
|
2862
3765
|
children: event.icon
|
|
2863
3766
|
}
|
|
2864
3767
|
),
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2868
|
-
event.time && /* @__PURE__ */ (0,
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("article", { className: "flex-1 rounded-xl border border-ph-border bg-ph-surface p-4 shadow-ph", children: [
|
|
3769
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-wrap items-baseline gap-3", children: [
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h4", { className: "text-base font-semibold text-ph-ink", children: event.title }),
|
|
3771
|
+
event.time && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("time", { className: "text-[11px] font-semibold uppercase tracking-wide text-ph-mutedtext", children: event.time })
|
|
2869
3772
|
] }),
|
|
2870
|
-
event.description && /* @__PURE__ */ (0,
|
|
3773
|
+
event.description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-2 text-sm text-ph-subtle", children: event.description })
|
|
2871
3774
|
] })
|
|
2872
3775
|
] }, event.id);
|
|
2873
3776
|
})
|
|
@@ -2878,6 +3781,9 @@ function Timeline(_a) {
|
|
|
2878
3781
|
0 && (module.exports = {
|
|
2879
3782
|
Accordion,
|
|
2880
3783
|
Alert,
|
|
3784
|
+
AuthCard,
|
|
3785
|
+
AuthDivider,
|
|
3786
|
+
AuthLayout,
|
|
2881
3787
|
Avatar,
|
|
2882
3788
|
AvatarGroup,
|
|
2883
3789
|
Badge,
|
|
@@ -2898,9 +3804,15 @@ function Timeline(_a) {
|
|
|
2898
3804
|
DropdownButton,
|
|
2899
3805
|
DropdownItem,
|
|
2900
3806
|
DropdownMenu,
|
|
3807
|
+
DropdownRadioGroup,
|
|
3808
|
+
DropdownRadioItem,
|
|
2901
3809
|
EmptyState,
|
|
2902
3810
|
FileUpload,
|
|
3811
|
+
FilterBar,
|
|
2903
3812
|
FilterChips,
|
|
3813
|
+
FilterControls,
|
|
3814
|
+
FilterMenu,
|
|
3815
|
+
FormField,
|
|
2904
3816
|
H1,
|
|
2905
3817
|
H2,
|
|
2906
3818
|
H3,
|
|
@@ -2914,6 +3826,8 @@ function Timeline(_a) {
|
|
|
2914
3826
|
Kbd,
|
|
2915
3827
|
Label,
|
|
2916
3828
|
Lead,
|
|
3829
|
+
Loader,
|
|
3830
|
+
LoadingState,
|
|
2917
3831
|
Modal,
|
|
2918
3832
|
Mono,
|
|
2919
3833
|
Overline,
|
|
@@ -2928,8 +3842,12 @@ function Timeline(_a) {
|
|
|
2928
3842
|
SearchInput,
|
|
2929
3843
|
SegmentedControl,
|
|
2930
3844
|
Select,
|
|
3845
|
+
SettingsLayout,
|
|
3846
|
+
SettingsNav,
|
|
2931
3847
|
ShowcaseWrapper,
|
|
3848
|
+
Skeleton,
|
|
2932
3849
|
Small,
|
|
3850
|
+
SortMenu,
|
|
2933
3851
|
Stat,
|
|
2934
3852
|
Stepper,
|
|
2935
3853
|
Table,
|