@xenide-io/the-old-ui-theme 0.7.0 → 0.9.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 +9 -10
- package/dist/{Chip-Cq3AiAji.d.mts → Chip-BzuNgJIa.d.mts} +81 -23
- package/dist/{Chip-Cq3AiAji.d.ts → Chip-BzuNgJIa.d.ts} +81 -23
- package/dist/{ai-message-blocknote-WABTHFY7.mjs → ai-message-blocknote-D4Z6DUCJ.mjs} +9 -3
- package/dist/chunk-2EO5VCXP.mjs +3912 -0
- package/dist/chunk-APKRZQRO.mjs +251 -0
- package/dist/chunk-BS7BZI5W.mjs +19 -0
- package/dist/chunk-IULORI3A.mjs +8 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +997 -576
- package/dist/index.mjs +49 -45
- package/dist/suite.d.mts +157 -55
- package/dist/suite.d.ts +157 -55
- package/dist/suite.js +4249 -801
- package/dist/suite.mjs +2578 -594
- package/dist/theme-boot-P-oqKVZF.d.mts +74 -0
- package/dist/theme-boot-P-oqKVZF.d.ts +74 -0
- package/dist/theme-boot.d.mts +2 -0
- package/dist/theme-boot.d.ts +2 -0
- package/dist/theme-boot.js +44 -0
- package/dist/theme-boot.mjs +8 -0
- package/dist/ui.d.mts +5 -29
- package/dist/ui.d.ts +5 -29
- package/dist/ui.js +647 -352
- package/dist/ui.mjs +10 -12
- package/docs/README.md +34 -0
- package/docs/ai-quick-reference.md +56 -0
- package/docs/component-library-improvement-plan.md +751 -0
- package/docs/component-reference.md +81 -0
- package/docs/components.md +48 -0
- package/docs/demos.md +19 -0
- package/docs/installation.md +117 -0
- package/docs/suite-audit.md +34 -0
- package/docs/theme-token-reference.md +67 -0
- package/docs/themes.md +164 -0
- package/package.json +22 -21
- package/public/fonts/OpenRunde-Bold.woff2 +0 -0
- package/public/fonts/OpenRunde-Medium.woff2 +0 -0
- package/public/fonts/OpenRunde-Regular.woff2 +0 -0
- package/public/fonts/OpenRunde-Semibold.woff2 +0 -0
- package/scripts/package-smoke.mjs +43 -0
- package/src/app/globals.css +2 -1
- package/src/components/ui/Accordion.tsx +20 -6
- package/src/components/ui/Avatar.tsx +5 -3
- package/src/components/ui/Calendar.tsx +187 -63
- package/src/components/ui/Card.test.tsx +38 -0
- package/src/components/ui/Card.tsx +77 -14
- package/src/components/ui/CollapsibleSection.tsx +12 -4
- package/src/components/ui/CommandPalette.test.tsx +91 -4
- package/src/components/ui/CommandPalette.tsx +138 -128
- package/src/components/ui/EmptyState.tsx +2 -2
- package/src/components/ui/FormField.tsx +1 -1
- package/src/components/ui/Input.tsx +42 -18
- package/src/components/ui/Kbd.tsx +18 -3
- package/src/components/ui/Modal.tsx +3 -1
- package/src/components/ui/Progress.tsx +14 -5
- package/src/components/ui/SegmentedControl.tsx +2 -2
- package/src/components/ui/SettingsLayout.tsx +1 -1
- package/src/components/ui/Stat.tsx +3 -2
- package/src/components/ui/Table.tsx +8 -3
- package/src/components/ui/Tooltip.test.tsx +70 -1
- package/src/components/ui/Tooltip.tsx +53 -29
- package/src/components/ui/Typography.tsx +103 -49
- package/src/components/ui/avatar-stat.test.tsx +23 -0
- package/src/components/ui/calendar.test.tsx +88 -0
- package/src/components/ui/disclosure.test.tsx +39 -0
- package/src/components/ui/index.ts +44 -6
- package/src/components/ui/progress.test.tsx +15 -0
- package/src/components/ui/typography.test.tsx +26 -1
- package/src/styles/suite-skin.css +8 -2
- package/src/styles/themes.css +184 -68
- package/src/suite/components/ai-message-blocknote.tsx +13 -2
- package/src/suite/components/ai-panel.tsx +41 -10
- package/src/suite/components/app-switcher.test.tsx +21 -6
- package/src/suite/components/app-switcher.tsx +7 -11
- package/src/suite/components/suite-app-layout.tsx +12 -3
- package/src/suite/components/suite-bottom-nav.tsx +0 -1
- package/src/suite/components/suite-clients-projects-directory.test.tsx +71 -0
- package/src/suite/components/suite-clients-projects-directory.tsx +943 -0
- package/src/suite/components/suite-integration-picker.test.tsx +224 -0
- package/src/suite/components/suite-integration-picker.tsx +939 -0
- package/src/suite/components/suite-integration-rules.test.tsx +157 -0
- package/src/suite/components/suite-integration-rules.tsx +471 -0
- package/src/suite/components/suite-mobile-drawer.test.tsx +18 -2
- package/src/suite/components/suite-mobile-drawer.tsx +65 -98
- package/src/suite/components/suite-notification-bell.tsx +29 -4
- package/src/suite/components/suite-sidebar.tsx +25 -25
- package/src/suite/components/suite-skeleton.tsx +2 -2
- package/src/suite/components/suite-user-menu.tsx +9 -8
- package/src/suite/components/theme-provider.test.tsx +87 -3
- package/src/suite/components/theme-provider.tsx +144 -23
- package/src/suite/components/today-ui.tsx +79 -68
- package/src/suite/components/workspace-switcher.test.tsx +56 -0
- package/src/suite/components/workspace-switcher.tsx +3 -3
- package/src/suite/icons/app-accents.ts +12 -12
- package/src/suite/icons/glyphs.ts +6 -12
- package/src/suite/index.ts +27 -0
- package/src/suite/lib/apps.test.ts +9 -1
- package/src/suite/lib/apps.ts +14 -8
- package/src/suite/lib/cookies.ts +53 -0
- package/src/suite/lib/theme-boot.ts +32 -0
- package/src/suite/lib/theme-cookie.ts +7 -0
- package/src/suite/lib/use-sidebar-width.ts +5 -51
- package/dist/chunk-KDR6HI6F.mjs +0 -1075
- package/dist/chunk-NOI42JNZ.mjs +0 -151
- package/dist/chunk-VXISSXTB.mjs +0 -2564
- package/src/suite/lib/use-lock-mobile-page-zoom.test.tsx +0 -65
- package/src/suite/lib/use-lock-mobile-page-zoom.ts +0 -51
|
@@ -0,0 +1,3912 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FWCSY2DS.mjs";
|
|
6
|
+
|
|
7
|
+
// src/components/ui/Button.tsx
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
|
|
10
|
+
// src/components/ui/ButtonChrome.tsx
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function ButtonChrome({ label, icon, sideIcon, split }) {
|
|
13
|
+
return /* @__PURE__ */ jsxs("span", { className: "ph-btn-chrome", children: [
|
|
14
|
+
icon != null ? /* @__PURE__ */ jsx("span", { className: "ph-btn-icon", children: icon }) : null,
|
|
15
|
+
label != null ? /* @__PURE__ */ jsx("span", { className: "ph-btn-label", children: label }) : null,
|
|
16
|
+
split ? /* @__PURE__ */ jsx("span", { className: "ph-btn-split-divider", "aria-hidden": true }) : null,
|
|
17
|
+
sideIcon != null ? /* @__PURE__ */ jsx("span", { className: "ph-btn-side-icon", children: sideIcon }) : null
|
|
18
|
+
] });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/lib/cn.ts
|
|
22
|
+
function cn(...parts) {
|
|
23
|
+
return parts.filter(Boolean).join(" ");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/components/ui/Button.tsx
|
|
27
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
28
|
+
var variantClass = {
|
|
29
|
+
primary: "ph-btn-primary",
|
|
30
|
+
secondary: "ph-btn-secondary",
|
|
31
|
+
tertiary: "ph-btn-tertiary",
|
|
32
|
+
signal: "ph-btn-signal",
|
|
33
|
+
accent: "ph-btn-accent",
|
|
34
|
+
neutral: "ph-btn-neutral",
|
|
35
|
+
info: "ph-btn-info",
|
|
36
|
+
success: "ph-btn-success",
|
|
37
|
+
warning: "ph-btn-warning",
|
|
38
|
+
danger: "ph-btn-danger",
|
|
39
|
+
ghost: "ph-btn-ghost",
|
|
40
|
+
link: "ph-btn-link"
|
|
41
|
+
};
|
|
42
|
+
var sizeClass = {
|
|
43
|
+
xs: "ph-btn-xs",
|
|
44
|
+
sm: "ph-btn-sm",
|
|
45
|
+
md: "",
|
|
46
|
+
lg: "ph-btn-lg"
|
|
47
|
+
};
|
|
48
|
+
var shapeClass = {
|
|
49
|
+
default: "",
|
|
50
|
+
circle: "ph-btn-circle",
|
|
51
|
+
square: "ph-btn-square",
|
|
52
|
+
wide: "ph-btn-wide"
|
|
53
|
+
};
|
|
54
|
+
var Button = forwardRef(function Button2(_a, ref) {
|
|
55
|
+
var _b = _a, {
|
|
56
|
+
variant = "secondary",
|
|
57
|
+
size = "md",
|
|
58
|
+
shape = "default",
|
|
59
|
+
outline = false,
|
|
60
|
+
split = false,
|
|
61
|
+
icon,
|
|
62
|
+
sideIcon,
|
|
63
|
+
loading = false,
|
|
64
|
+
loadingLabel,
|
|
65
|
+
className,
|
|
66
|
+
children,
|
|
67
|
+
type = "button",
|
|
68
|
+
disabled
|
|
69
|
+
} = _b, props = __objRest(_b, [
|
|
70
|
+
"variant",
|
|
71
|
+
"size",
|
|
72
|
+
"shape",
|
|
73
|
+
"outline",
|
|
74
|
+
"split",
|
|
75
|
+
"icon",
|
|
76
|
+
"sideIcon",
|
|
77
|
+
"loading",
|
|
78
|
+
"loadingLabel",
|
|
79
|
+
"className",
|
|
80
|
+
"children",
|
|
81
|
+
"type",
|
|
82
|
+
"disabled"
|
|
83
|
+
]);
|
|
84
|
+
const usesLemonChrome = !["tertiary", "ghost", "link"].includes(variant);
|
|
85
|
+
const label = loadingLabel != null ? loadingLabel : children;
|
|
86
|
+
const leadingIcon = loading ? /* @__PURE__ */ jsx2("span", { className: "ph-btn-spinner", "aria-hidden": true }) : icon;
|
|
87
|
+
const content = usesLemonChrome ? /* @__PURE__ */ jsx2(ButtonChrome, { label, icon: leadingIcon, sideIcon, split }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
88
|
+
leadingIcon != null ? /* @__PURE__ */ jsx2("span", { className: "ph-btn-icon", children: leadingIcon }) : null,
|
|
89
|
+
label != null ? /* @__PURE__ */ jsx2("span", { className: "ph-btn-label", children: label }) : null,
|
|
90
|
+
split ? /* @__PURE__ */ jsx2("span", { className: "ph-btn-split-divider", "aria-hidden": true }) : null,
|
|
91
|
+
sideIcon != null ? /* @__PURE__ */ jsx2("span", { className: "ph-btn-side-icon", children: sideIcon }) : null
|
|
92
|
+
] });
|
|
93
|
+
return /* @__PURE__ */ jsx2(
|
|
94
|
+
"button",
|
|
95
|
+
__spreadProps(__spreadValues({
|
|
96
|
+
ref,
|
|
97
|
+
type,
|
|
98
|
+
disabled: disabled || loading,
|
|
99
|
+
"aria-busy": loading || void 0,
|
|
100
|
+
className: cn(
|
|
101
|
+
"ph-btn",
|
|
102
|
+
usesLemonChrome && "ph-btn-raised",
|
|
103
|
+
outline && "ph-btn-outline",
|
|
104
|
+
variantClass[variant],
|
|
105
|
+
sizeClass[size],
|
|
106
|
+
shapeClass[shape],
|
|
107
|
+
split && "ph-btn-split",
|
|
108
|
+
className
|
|
109
|
+
)
|
|
110
|
+
}, props), {
|
|
111
|
+
children: content
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
Button.displayName = "Button";
|
|
116
|
+
|
|
117
|
+
// src/components/ui/Alert.tsx
|
|
118
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
119
|
+
|
|
120
|
+
// src/components/icons/IconBase.tsx
|
|
121
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
122
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
123
|
+
var IconBase = forwardRef2(function IconBase2(_a, ref) {
|
|
124
|
+
var _b = _a, {
|
|
125
|
+
className,
|
|
126
|
+
size,
|
|
127
|
+
children,
|
|
128
|
+
viewBox = "0 0 24 24",
|
|
129
|
+
fill: fill2 = "none",
|
|
130
|
+
xmlns = "http://www.w3.org/2000/svg",
|
|
131
|
+
focusable = "false",
|
|
132
|
+
style,
|
|
133
|
+
role,
|
|
134
|
+
"aria-hidden": ariaHidden,
|
|
135
|
+
"aria-label": ariaLabel,
|
|
136
|
+
"aria-labelledby": ariaLabelledBy
|
|
137
|
+
} = _b, props = __objRest(_b, [
|
|
138
|
+
"className",
|
|
139
|
+
"size",
|
|
140
|
+
"children",
|
|
141
|
+
"viewBox",
|
|
142
|
+
"fill",
|
|
143
|
+
"xmlns",
|
|
144
|
+
"focusable",
|
|
145
|
+
"style",
|
|
146
|
+
"role",
|
|
147
|
+
"aria-hidden",
|
|
148
|
+
"aria-label",
|
|
149
|
+
"aria-labelledby"
|
|
150
|
+
]);
|
|
151
|
+
const hasAccessibleName = Boolean(ariaLabel || ariaLabelledBy);
|
|
152
|
+
return /* @__PURE__ */ jsx3(
|
|
153
|
+
"svg",
|
|
154
|
+
__spreadProps(__spreadValues({
|
|
155
|
+
ref,
|
|
156
|
+
className: cn("ph-icon", className),
|
|
157
|
+
viewBox,
|
|
158
|
+
fill: fill2,
|
|
159
|
+
xmlns,
|
|
160
|
+
focusable,
|
|
161
|
+
role: role != null ? role : hasAccessibleName ? "img" : void 0,
|
|
162
|
+
"aria-hidden": ariaHidden != null ? ariaHidden : hasAccessibleName ? void 0 : true,
|
|
163
|
+
"aria-label": ariaLabel,
|
|
164
|
+
"aria-labelledby": ariaLabelledBy,
|
|
165
|
+
style: __spreadValues({ width: size, height: size }, style)
|
|
166
|
+
}, props), {
|
|
167
|
+
children
|
|
168
|
+
})
|
|
169
|
+
);
|
|
170
|
+
});
|
|
171
|
+
IconBase.displayName = "IconBase";
|
|
172
|
+
|
|
173
|
+
// src/components/icons/createIconBase.tsx
|
|
174
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
175
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
176
|
+
function createIconBase({ name = "IconGlyph", viewBox = "0 0 24 24", paths }) {
|
|
177
|
+
const IconGlyph = forwardRef3(function IconGlyph2(props, ref) {
|
|
178
|
+
return /* @__PURE__ */ jsx4(IconBase, __spreadProps(__spreadValues({ ref, viewBox }, props), { children: paths }));
|
|
179
|
+
});
|
|
180
|
+
IconGlyph.displayName = name;
|
|
181
|
+
return IconGlyph;
|
|
182
|
+
}
|
|
183
|
+
function createIconBasePath(d, viewBox = "0 0 24 24", name) {
|
|
184
|
+
return createIconBase({
|
|
185
|
+
name,
|
|
186
|
+
viewBox,
|
|
187
|
+
paths: /* @__PURE__ */ jsx4("path", { d, fill: "currentColor" })
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// src/components/icons/icons.tsx
|
|
192
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
193
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
194
|
+
var fill = (d) => /* @__PURE__ */ jsx5("path", { d, fill: "currentColor" });
|
|
195
|
+
var IconAreaChart = createIconBase({
|
|
196
|
+
paths: fill("M3 20V7l4 3 5-7 5 4h4v13Zm5-3 4-5.5 7 5.45V9h-2.7l-3.9-3.125-4.95 6.95L5 11v3.6Z")
|
|
197
|
+
});
|
|
198
|
+
var IconCumulativeChart = createIconBase({
|
|
199
|
+
paths: fill(
|
|
200
|
+
"M20.8805 7.97408C15.0614 18.7809 6.51281 19.5979 2.71265 18.4578L3.28734 16.5422C6.15384 17.4021 13.7386 17.0191 19.1195 7.02588L20.8805 7.97408Z"
|
|
201
|
+
)
|
|
202
|
+
});
|
|
203
|
+
var IconTableChart = createIconBase({
|
|
204
|
+
paths: fill(
|
|
205
|
+
"M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h15zm-5 14h-5v-9h5v9zM5 10h3v9H5v-9zm12 9v-9h3v9h-3z"
|
|
206
|
+
)
|
|
207
|
+
});
|
|
208
|
+
var IconHandClick = createIconBase({
|
|
209
|
+
viewBox: "0 0 18 18",
|
|
210
|
+
paths: fill(
|
|
211
|
+
"M14.9942 7.90164C14.9942 7.82992 14.9583 7.46993 14.6342 7.10993C14.2925 6.71407 13.7524 6.49822 13.05 6.44407C12.9783 6.33579 12.8883 6.22822 12.7442 6.11993C12.3483 5.81407 11.7359 5.65164 10.9442 5.63407C10.8724 5.54407 10.7459 5.43578 10.6024 5.32822C10.2425 5.0765 9.79245 4.93236 9.23416 4.87822V3.41993C9.23416 3.27579 9.25244 2.66407 8.83831 2.23164C8.65831 2.03335 8.31659 1.79993 7.74002 1.79993C7.14587 1.79993 6.80416 2.03407 6.60587 2.23164C6.22759 2.64578 6.22759 3.18578 6.22759 3.31164V8.46C5.88587 8.1 5.50759 7.70414 5.29173 7.56C4.84173 7.21829 3.99587 7.39828 3.51002 7.75829C3.04173 8.1 2.88002 8.62243 3.06002 9.12658C3.38416 10.0266 4.19416 10.9266 4.39173 11.1424C4.57173 11.4841 5.38173 12.9782 6.10173 13.5182C6.48002 13.8065 6.76759 14.9941 6.84002 15.7499L6.87588 16.1457H13.6801V14.364C13.7701 14.1123 13.9859 13.5723 14.2201 13.3199C14.7783 12.7616 14.9583 11.3582 14.9583 10.9257V7.91986L14.9942 7.90164ZM14.1117 10.89C14.1117 11.4117 13.8959 12.4017 13.6259 12.6717C13.1576 13.14 12.87 14.04 12.8517 14.13L12.8335 14.1841V15.2283H7.68583C7.64997 15.03 7.61411 14.7783 7.54169 14.5083C7.32583 13.6441 7.03754 13.0866 6.65998 12.7983C6.13826 12.4024 5.39998 11.1241 5.16583 10.6566L5.09411 10.5484C5.09411 10.5301 4.2124 9.63008 3.90582 8.80251C3.86996 8.69423 3.86996 8.60422 3.99582 8.47836C4.22997 8.26251 4.67997 8.20836 4.78754 8.24422C5.05754 8.46008 5.88582 9.34251 6.35339 9.86422L7.12754 10.7284L7.12824 3.29418V3.25762C7.12824 3.1859 7.14652 2.95176 7.27238 2.82591C7.36238 2.71763 7.52409 2.66419 7.75824 2.66419C7.95652 2.66419 8.09995 2.71833 8.20824 2.80833C8.35238 2.97005 8.36996 3.25833 8.36996 3.36662V8.02826H9.25167V5.7599C10.0617 5.8499 10.2958 6.19161 10.3317 6.24575L10.3675 6.33575V8.02747H11.2492V6.53332C12.0051 6.60504 12.2934 6.83918 12.3651 6.94747V8.65747H13.2468V7.34332C14.021 7.4516 14.1468 7.86504 14.1651 7.95504L14.1658 10.8899L14.1117 10.89Z"
|
|
212
|
+
)
|
|
213
|
+
});
|
|
214
|
+
var IconSurveys = createIconBase({
|
|
215
|
+
paths: fill(
|
|
216
|
+
"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47l5.89-5.87z"
|
|
217
|
+
)
|
|
218
|
+
});
|
|
219
|
+
var IconCohort = createIconBase({
|
|
220
|
+
paths: fill(
|
|
221
|
+
"m4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58-.74.32-1.22 1.04-1.22 1.85v1.57h4.5v-1.61c0-.83.23-1.61.63-2.29zm14.87-1.1c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29v1.61h4.5zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9s-3.07.39-4.24.9c-1.08.48-1.76 1.56-1.76 2.74v1.61h12v-1.61c0-1.18-.68-2.26-1.76-2.74zm-8.17 2.35c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69zm3.93-8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
|
|
222
|
+
)
|
|
223
|
+
});
|
|
224
|
+
var IconRecording = createIconBase({
|
|
225
|
+
paths: fill(
|
|
226
|
+
"m10 8v8l5-4zm9-5h-14c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2zm0 16h-14v-14h14z"
|
|
227
|
+
)
|
|
228
|
+
});
|
|
229
|
+
var IconFlare = createIconBase({
|
|
230
|
+
paths: fill(
|
|
231
|
+
"m7 11h-6v2h6zm2.17-3.24-2.12-2.12-1.41 1.41 2.12 2.12zm3.83-6.76h-2v6h2zm5.36 6.05-1.41-1.41-2.12 2.12 1.41 1.41zm-1.36 3.95v2h6v-2zm-5-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zm2.83 7.24 2.12 2.12 1.41-1.41-2.12-2.12zm-9.19.71 1.41 1.41 2.12-2.12-1.41-1.41zm5.36 6.05h2v-6h-2z"
|
|
232
|
+
)
|
|
233
|
+
});
|
|
234
|
+
var IconSelectEvents = createIconBase({
|
|
235
|
+
paths: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
236
|
+
fill("M17.5 9L16.56 6.94L14.5 6L16.56 5.06L17.5 3L18.44 5.06L20.5 6L18.44 6.94L17.5 9Z"),
|
|
237
|
+
fill("M6 12.5L6.94 14.56L9 15.5L6.94 16.44L6 18.5L5.06 16.44L3 15.5L5.06 14.56L6 12.5Z"),
|
|
238
|
+
fill("M6 9L5.06 6.94L3 6L5.06 5.06L6 3L6.94 5.06L9 6L6.94 6.94L6 9Z"),
|
|
239
|
+
fill("M16.23 14.26L20 13L10 10L13 20L14.26 16.23L18.53 20.5L20.51 18.52L16.23 14.26Z")
|
|
240
|
+
] })
|
|
241
|
+
});
|
|
242
|
+
var IconClipboardEdit = createIconBase({
|
|
243
|
+
paths: fill(
|
|
244
|
+
"M21.04 12.13C21.18 12.13 21.31 12.19 21.42 12.3L22.7 13.58C22.92 13.79 22.92 14.14 22.7 14.35L21.7 15.35L19.65 13.3L20.65 12.3C20.76 12.19 20.9 12.13 21.04 12.13M19.07 13.88L21.12 15.93L15.06 22H13V19.94L19.07 13.88M11 19L9 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H9.18C9.6 1.84 10.7 1 12 1C13.3 1 14.4 1.84 14.82 3H19C20.1 3 21 3.9 21 5V9L19 11V5H17V7H7V5H5V19H11M12 3C11.45 3 11 3.45 11 4C11 4.55 11.45 5 12 5C12.55 5 13 4.55 13 4C13 3.45 12.55 3 12 3Z"
|
|
245
|
+
)
|
|
246
|
+
});
|
|
247
|
+
var IconQueryEditor = createIconBase({
|
|
248
|
+
paths: fill(
|
|
249
|
+
"M4,14V17C4,19 7.05,20.72 11,21V18.11L11.13,18C7.12,17.76 4,16.06 4,14M12,13C7.58,13 4,11.21 4,9V12C4,14.21 7.58,16 12,16C12.39,16 12.77,16 13.16,16L17,12.12C15.4,12.72 13.71,13 12,13M12,3C7.58,3 4,4.79 4,7C4,9.21 7.58,11 12,11C16.42,11 20,9.21 20,7C20,4.79 16.42,3 12,3M21,11.13C20.85,11.13 20.71,11.19 20.61,11.3L19.61,12.3L21.66,14.3L22.66,13.3C22.87,13.1 22.88,12.76 22.66,12.53L21.42,11.3C21.32,11.19 21.18,11.13 21.04,11.13M19.04,12.88L13,18.94V21H15.06L21.12,14.93L19.04,12.88Z"
|
|
250
|
+
)
|
|
251
|
+
});
|
|
252
|
+
var IconTuning = createIconBase({
|
|
253
|
+
paths: fill(
|
|
254
|
+
"M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z"
|
|
255
|
+
)
|
|
256
|
+
});
|
|
257
|
+
var IconSync = createIconBase({
|
|
258
|
+
paths: fill(
|
|
259
|
+
"m12.5 4v-3l-4 4 4 4v-3c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46c.78-1.23 1.24-2.69 1.24-4.26 0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8l-1.46-1.46c-.78 1.23-1.24 2.69-1.24 4.26 0 4.42 3.58 8 8 8v3l4-4-4-4z"
|
|
260
|
+
)
|
|
261
|
+
});
|
|
262
|
+
var IconPlayCircle = createIconBase({
|
|
263
|
+
paths: fill(
|
|
264
|
+
"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM9.5 16.5L16.5 12L9.5 7.5V16.5Z"
|
|
265
|
+
)
|
|
266
|
+
});
|
|
267
|
+
var IconGridView = createIconBase({
|
|
268
|
+
paths: fill(
|
|
269
|
+
"M3,3v8h8V3H3z M9,9H5V5h4V9z M3,13v8h8v-8H3z M9,19H5v-4h4V19z M13,3v8h8V3H13z M19,9h-4V5h4V9z M13,13v8h8v-8H13z M19,19h-4v-4h4V19z"
|
|
270
|
+
)
|
|
271
|
+
});
|
|
272
|
+
var IconListView = createIconBase({
|
|
273
|
+
paths: fill(
|
|
274
|
+
"M3,5v14h18V5H3z M7,7v2H5V7H7z M5,13v-2h2v2H5z M5,15h2v2H5V15z M19,17H9v-2h10V17z M19,13H9v-2h10V13z M19,9H9V7h10V9z"
|
|
275
|
+
)
|
|
276
|
+
});
|
|
277
|
+
var IconPremium = createIconBase({
|
|
278
|
+
paths: fill(
|
|
279
|
+
"m9.68 13.69 2.32-1.76 2.31 1.76-.88-2.85 2.32-1.84h-2.84l-.91-2.81-.91 2.81h-2.84l2.31 1.84zm10.32-3.69c0-4.42-3.58-8-8-8s-8 3.58-8 8c0 2.03.76 3.87 2 5.28v7.72l6-2 6 2v-7.72c1.24-1.41 2-3.25 2-5.28zm-8-6c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6 2.69-6 6-6zm0 15-4 1.02v-3.1c1.18.68 2.54 1.08 4 1.08s2.82-.4 4-1.08v3.1z"
|
|
280
|
+
)
|
|
281
|
+
});
|
|
282
|
+
var IconGift = createIconBase({
|
|
283
|
+
paths: fill(
|
|
284
|
+
"M14.4495 4.55495C15.264 4.31223 15.8631 4.48426 16.1 4.80007C16.4013 5.20182 16.4765 5.57305 16.4336 5.91424C16.3888 6.27088 16.2084 6.63998 15.9211 7.00139C15.3397 7.73275 14.4193 8.30877 13.8244 8.53186C13.598 8.61674 13.4648 8.85138 13.508 9.08924C13.5511 9.32709 13.7582 9.50002 13.9999 9.50002L19.4999 9.50002V12.5H17.9999C17.7237 12.5 17.4999 12.7239 17.4999 13V20.5H6.49988V14.5C6.49988 14.2239 6.27602 14 5.99988 14C5.72374 14 5.49988 14.2239 5.49988 14.5V21C5.49988 21.2762 5.72374 21.5 5.99988 21.5H17.9999C18.276 21.5 18.4999 21.2762 18.4999 21V13.5H19.9999C20.276 13.5 20.4999 13.2762 20.4999 13V9.00002C20.4999 8.86741 20.4472 8.74023 20.3534 8.64646C20.2597 8.5527 20.1325 8.50002 19.9999 8.50002L15.8202 8.50002C16.1407 8.24235 16.4465 7.94742 16.7039 7.62365C17.0625 7.17257 17.3508 6.63541 17.4258 6.03894C17.5027 5.42702 17.3487 4.79826 16.8999 4.20003C16.2882 3.3845 15.1373 3.30652 14.1639 3.5966C13.3806 3.83005 12.5842 4.3279 12.0008 5.07014C11.4285 4.33982 10.6586 3.86464 9.88727 3.64427C8.91382 3.36616 7.82238 3.47045 7.14633 4.14645C6.65753 4.63523 6.41235 5.18234 6.41347 5.75925C6.41457 6.32144 6.64952 6.84016 6.97799 7.28883C7.30058 7.72946 7.7389 8.13769 8.22434 8.50002L3.99988 8.50002C3.86727 8.50002 3.74009 8.5527 3.64632 8.64646C3.55256 8.74023 3.49988 8.86741 3.49988 9.00002V13C3.49988 13.2762 3.72374 13.5 3.99988 13.5H15.4999C15.776 13.5 15.9999 13.2762 15.9999 13C15.9999 12.7239 15.776 12.5 15.4999 12.5H4.49988V9.50002L9.99995 9.50002C10.2318 9.50002 10.4333 9.34058 10.4866 9.1149C10.5398 8.88921 10.431 8.65651 10.2236 8.55281C9.25206 8.06706 8.29723 7.39797 7.78487 6.69811C7.53216 6.35292 7.41402 6.03722 7.41347 5.7573C7.41295 5.49209 7.51758 5.1894 7.85342 4.85358C8.17738 4.52964 8.83597 4.38393 9.61256 4.6058C10.3657 4.82096 11.1212 5.36045 11.5528 6.22359C11.6375 6.39298 11.8106 6.49997 12 6.49997C12.1894 6.49997 12.3625 6.39297 12.4472 6.22358C12.8783 5.36141 13.672 4.78667 14.4495 4.55495Z"
|
|
285
|
+
)
|
|
286
|
+
});
|
|
287
|
+
var IconRobot = createIconBase({
|
|
288
|
+
paths: fill(
|
|
289
|
+
"M17.5 15.5C17.5 16.61 16.61 17.5 15.5 17.5S13.5 16.61 13.5 15.5 14.4 13.5 15.5 13.5 17.5 14.4 17.5 15.5M8.5 13.5C7.4 13.5 6.5 14.4 6.5 15.5S7.4 17.5 8.5 17.5 10.5 16.61 10.5 15.5 9.61 13.5 8.5 13.5M23 15V18C23 18.55 22.55 19 22 19H21V20C21 21.11 20.11 22 19 22H5C3.9 22 3 21.11 3 20V19H2C1.45 19 1 18.55 1 18V15C1 14.45 1.45 14 2 14H3C3 10.13 6.13 7 10 7H11V5.73C10.4 5.39 10 4.74 10 4C10 2.9 10.9 2 12 2S14 2.9 14 4C14 4.74 13.6 5.39 13 5.73V7H14C17.87 7 21 10.13 21 14H22C22.55 14 23 14.45 23 15M21 16H19V14C19 11.24 16.76 9 14 9H10C7.24 9 5 11.24 5 14V16H3V17H5V20H19V17H21V16Z"
|
|
290
|
+
)
|
|
291
|
+
});
|
|
292
|
+
var IconExclamation = createIconBase({
|
|
293
|
+
paths: /* @__PURE__ */ jsxs3("g", { fill: "currentColor", children: [
|
|
294
|
+
/* @__PURE__ */ jsx5("path", { d: "m12 21c1.1046 0 2-.8954 2-2s-.8954-2-2-2-2 .8954-2 2 .8954 2 2 2z" }),
|
|
295
|
+
/* @__PURE__ */ jsx5("path", { d: "m10 3h4v12h-4z" })
|
|
296
|
+
] })
|
|
297
|
+
});
|
|
298
|
+
var IconErrorOutline = createIconBase({
|
|
299
|
+
paths: fill(
|
|
300
|
+
"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"
|
|
301
|
+
)
|
|
302
|
+
});
|
|
303
|
+
var IconInfo = createIconBase({
|
|
304
|
+
name: "IconInfo",
|
|
305
|
+
paths: fill(
|
|
306
|
+
"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"
|
|
307
|
+
)
|
|
308
|
+
});
|
|
309
|
+
var IconCancel = createIconBase({
|
|
310
|
+
paths: fill(
|
|
311
|
+
"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"
|
|
312
|
+
)
|
|
313
|
+
});
|
|
314
|
+
var IconCheckCircle = createIconBase({
|
|
315
|
+
paths: fill(
|
|
316
|
+
"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
317
|
+
)
|
|
318
|
+
});
|
|
319
|
+
var IconArrowUp = createIconBase({
|
|
320
|
+
paths: fill("M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z")
|
|
321
|
+
});
|
|
322
|
+
var IconArrowDown = createIconBase({
|
|
323
|
+
paths: fill("M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z")
|
|
324
|
+
});
|
|
325
|
+
var IconChevronLeft = createIconBasePath("M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z");
|
|
326
|
+
var IconChevronRight = createIconBasePath("M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z");
|
|
327
|
+
var IconChevronDown = createIconBasePath("M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z");
|
|
328
|
+
var IconSubArrowRight = createIconBase({
|
|
329
|
+
paths: /* @__PURE__ */ jsx5("g", { transform: "translate(4 5.5)", children: fill("M2 0H0V10H12.01V13L16 9L12.01 5V8H2V0Z") })
|
|
330
|
+
});
|
|
331
|
+
var IconSearch = createIconBasePath(
|
|
332
|
+
"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"
|
|
333
|
+
);
|
|
334
|
+
var IconBell = createIconBasePath(
|
|
335
|
+
"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2m6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1z"
|
|
336
|
+
);
|
|
337
|
+
var IconBellOff = createIconBasePath(
|
|
338
|
+
"M20 18.69 7.84 6.14 5.27 3.49 4 4.76l2.8 2.8v.01c-.52.99-.8 2.16-.8 3.42v5l-2 2v1h13.73l2 2L21 19.72zM12 22c1.11 0 2-.89 2-2h-4c0 1.11.89 2 2 2m6-7.32V11c0-3.08-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68c-.15.03-.29.08-.42.12-.1.03-.2.07-.3.11h-.01c-.01 0-.01 0-.02.01-.23.09-.46.2-.68.31 0 0-.01 0-.01.01z"
|
|
339
|
+
);
|
|
340
|
+
var IconPerson = createIconBasePath(
|
|
341
|
+
"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
342
|
+
);
|
|
343
|
+
var IconHome = createIconBasePath("M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z");
|
|
344
|
+
var IconPanelRight = createIconBasePath(
|
|
345
|
+
"M3 5v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2zm12 4h-5v10h5V9zm-7 0H5v10h3V9z"
|
|
346
|
+
);
|
|
347
|
+
var IconPlus = createIconBasePath("M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z");
|
|
348
|
+
var IconCheck = createIconBasePath("M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z");
|
|
349
|
+
var IconClose = createIconBasePath("M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z");
|
|
350
|
+
var IconTrash = createIconBasePath("M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z");
|
|
351
|
+
var IconDownload = createIconBasePath("M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z");
|
|
352
|
+
var IconUpload = createIconBasePath("M9 16h6v-6h4l-7-7-7 7h4v6zm-4 2h14v2H5v-2z");
|
|
353
|
+
var IconSave = createIconBasePath(
|
|
354
|
+
"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"
|
|
355
|
+
);
|
|
356
|
+
var IconCopy = createIconBasePath(
|
|
357
|
+
"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"
|
|
358
|
+
);
|
|
359
|
+
var IconEdit = createIconBasePath(
|
|
360
|
+
"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"
|
|
361
|
+
);
|
|
362
|
+
var IconLogout = createIconBasePath(
|
|
363
|
+
"M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.59L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"
|
|
364
|
+
);
|
|
365
|
+
var IconStar = createIconBasePath(
|
|
366
|
+
"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
|
|
367
|
+
);
|
|
368
|
+
var IconMail = createIconBasePath(
|
|
369
|
+
"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"
|
|
370
|
+
);
|
|
371
|
+
var IconShoppingCart = createIconBasePath(
|
|
372
|
+
"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"
|
|
373
|
+
);
|
|
374
|
+
var IconMoon = createIconBasePath(
|
|
375
|
+
"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"
|
|
376
|
+
);
|
|
377
|
+
var IconSun = createIconBasePath(
|
|
378
|
+
"M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"
|
|
379
|
+
);
|
|
380
|
+
var IconVolume = createIconBasePath(
|
|
381
|
+
"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"
|
|
382
|
+
);
|
|
383
|
+
var IconVolumeOff = createIconBasePath(
|
|
384
|
+
"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"
|
|
385
|
+
);
|
|
386
|
+
var IconFlag = createIconBasePath("M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6h-5.6z");
|
|
387
|
+
var IconDatabase = createIconBasePath(
|
|
388
|
+
"M12 3C7.58 3 4 4.79 4 7s3.58 4 8 4 8-1.79 8-4-3.58-4-8-4zM4 9v3c0 2.21 3.58 4 8 4s8-1.79 8-4V9c0 2.21-3.58 4-8 4s-8-1.79-8-4zm0 5v3c0 2.21 3.58 4 8 4s8-1.79 8-4v-3c0 2.21-3.58 4-8 4s-8-1.79-8-4z"
|
|
389
|
+
);
|
|
390
|
+
var IconLayers = createIconBasePath("M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z");
|
|
391
|
+
var IconBox = createIconBasePath(
|
|
392
|
+
"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"
|
|
393
|
+
);
|
|
394
|
+
var IconBolt = createIconBasePath(
|
|
395
|
+
"M11 21h-1l1-7H7.5c-.58 0-.57-.32-.38-.66-.19-.34-.04-.12-.07-.12C8.48 10.94 10.42 7.54 11 7V3h1v4c.58 0 .57.32.38.66-.19-.34-.04-.12-.07-.12-.95 2.28-2.96 5.66-3.31 6.22H13l-1 7h-1z"
|
|
396
|
+
);
|
|
397
|
+
var IconRadar = createIconBasePath(
|
|
398
|
+
"M12 2C6.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 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
|
|
399
|
+
);
|
|
400
|
+
var IconToggle = createIconBasePath(
|
|
401
|
+
"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5zm0 8H7c-1.66 0-3-1.34-3-3s1.34-3 3-3h10c1.66 0 3 1.34 3 3s-1.34 3-3 3zM7 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
|
|
402
|
+
);
|
|
403
|
+
var IconRocket = createIconBasePath(
|
|
404
|
+
"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"
|
|
405
|
+
);
|
|
406
|
+
var IconTerminal = createIconBase({
|
|
407
|
+
name: "IconTerminal",
|
|
408
|
+
paths: /* @__PURE__ */ jsx5(
|
|
409
|
+
"path",
|
|
410
|
+
{
|
|
411
|
+
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",
|
|
412
|
+
fill: "currentColor",
|
|
413
|
+
fillRule: "evenodd",
|
|
414
|
+
clipRule: "evenodd"
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
});
|
|
418
|
+
var IconOldWindow = createIconBase({
|
|
419
|
+
name: "IconOldWindow",
|
|
420
|
+
paths: /* @__PURE__ */ jsx5(
|
|
421
|
+
"path",
|
|
422
|
+
{
|
|
423
|
+
d: "M3 3v18h18V3H3zm2 7v9h14v-9H5zm1-4h2v1H6V6zm3 0h2v1H9V6z",
|
|
424
|
+
fill: "currentColor",
|
|
425
|
+
fillRule: "evenodd",
|
|
426
|
+
clipRule: "evenodd"
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
});
|
|
430
|
+
var IconCommandCursor = createIconBase({
|
|
431
|
+
name: "IconCommandCursor",
|
|
432
|
+
paths: /* @__PURE__ */ jsx5(
|
|
433
|
+
"path",
|
|
434
|
+
{
|
|
435
|
+
d: "M4 3v18h16V3H4zm2 2h12v14H6V5zm1.5 3.5L11 12l-3.5 3.5L9 17l5-5-5-5-1.5 1.5zM13 17h4v-2h-4v2z",
|
|
436
|
+
fill: "currentColor",
|
|
437
|
+
fillRule: "evenodd",
|
|
438
|
+
clipRule: "evenodd"
|
|
439
|
+
}
|
|
440
|
+
)
|
|
441
|
+
});
|
|
442
|
+
var IconDataReel = createIconBase({
|
|
443
|
+
name: "IconDataReel",
|
|
444
|
+
paths: /* @__PURE__ */ jsx5(
|
|
445
|
+
"path",
|
|
446
|
+
{
|
|
447
|
+
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",
|
|
448
|
+
fill: "currentColor",
|
|
449
|
+
fillRule: "evenodd",
|
|
450
|
+
clipRule: "evenodd"
|
|
451
|
+
}
|
|
452
|
+
)
|
|
453
|
+
});
|
|
454
|
+
var IconCodePreview = createIconBase({
|
|
455
|
+
name: "IconCodePreview",
|
|
456
|
+
paths: /* @__PURE__ */ jsx5(
|
|
457
|
+
"path",
|
|
458
|
+
{
|
|
459
|
+
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",
|
|
460
|
+
fill: "currentColor",
|
|
461
|
+
fillRule: "evenodd",
|
|
462
|
+
clipRule: "evenodd"
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
});
|
|
466
|
+
var IconInsightBoard = createIconBase({
|
|
467
|
+
name: "IconInsightBoard",
|
|
468
|
+
paths: /* @__PURE__ */ jsx5(
|
|
469
|
+
"path",
|
|
470
|
+
{
|
|
471
|
+
d: "M3 3v18h18V3H3zm2 2h14v3H5V5zm0 5h6v9H5v-9zm8 0h6v4h-6v-4zm0 6h6v3h-6v-3zM6 6h2v1H6V6zm3 0h2v1H9V6z",
|
|
472
|
+
fill: "currentColor",
|
|
473
|
+
fillRule: "evenodd",
|
|
474
|
+
clipRule: "evenodd"
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
});
|
|
478
|
+
var IconEventStream = createIconBase({
|
|
479
|
+
name: "IconEventStream",
|
|
480
|
+
paths: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
481
|
+
/* @__PURE__ */ jsx5("path", { d: "M5 4h2v16H5V4z", fill: "currentColor", opacity: "0.45" }),
|
|
482
|
+
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")
|
|
483
|
+
] })
|
|
484
|
+
});
|
|
485
|
+
var IconFeatureGate = createIconBase({
|
|
486
|
+
name: "IconFeatureGate",
|
|
487
|
+
paths: /* @__PURE__ */ jsx5(
|
|
488
|
+
"path",
|
|
489
|
+
{
|
|
490
|
+
d: "M4 3h2v18H4V3zm3 2h12l-3 4 3 4H7V5zm4 1-2.2 4H12l-1 4 4.2-5H12l1-3h-2z",
|
|
491
|
+
fill: "currentColor",
|
|
492
|
+
fillRule: "evenodd",
|
|
493
|
+
clipRule: "evenodd"
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
});
|
|
497
|
+
var IconReplayFrame = createIconBase({
|
|
498
|
+
name: "IconReplayFrame",
|
|
499
|
+
paths: /* @__PURE__ */ jsx5(
|
|
500
|
+
"path",
|
|
501
|
+
{
|
|
502
|
+
d: "M3 3v18h18V3H3zm2 2h14v11H5V5zm5 2v7l6-3.5L10 7zm-5 11h9v1H5v-1zm11 0h3v1h-3v-1z",
|
|
503
|
+
fill: "currentColor",
|
|
504
|
+
fillRule: "evenodd",
|
|
505
|
+
clipRule: "evenodd"
|
|
506
|
+
}
|
|
507
|
+
)
|
|
508
|
+
});
|
|
509
|
+
var IconQueryStack = createIconBase({
|
|
510
|
+
name: "IconQueryStack",
|
|
511
|
+
paths: fill(
|
|
512
|
+
"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"
|
|
513
|
+
)
|
|
514
|
+
});
|
|
515
|
+
var IconExperimentSplit = createIconBase({
|
|
516
|
+
name: "IconExperimentSplit",
|
|
517
|
+
paths: fill(
|
|
518
|
+
"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"
|
|
519
|
+
)
|
|
520
|
+
});
|
|
521
|
+
var IconSurveyCard = createIconBase({
|
|
522
|
+
name: "IconSurveyCard",
|
|
523
|
+
paths: /* @__PURE__ */ jsx5(
|
|
524
|
+
"path",
|
|
525
|
+
{
|
|
526
|
+
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",
|
|
527
|
+
fill: "currentColor",
|
|
528
|
+
fillRule: "evenodd",
|
|
529
|
+
clipRule: "evenodd"
|
|
530
|
+
}
|
|
531
|
+
)
|
|
532
|
+
});
|
|
533
|
+
var OLD_UI_ICONS = {
|
|
534
|
+
oldWindow: IconOldWindow,
|
|
535
|
+
commandCursor: IconCommandCursor,
|
|
536
|
+
dataReel: IconDataReel,
|
|
537
|
+
codePreview: IconCodePreview,
|
|
538
|
+
insightBoard: IconInsightBoard,
|
|
539
|
+
eventStream: IconEventStream,
|
|
540
|
+
featureGate: IconFeatureGate,
|
|
541
|
+
replayFrame: IconReplayFrame,
|
|
542
|
+
queryStack: IconQueryStack,
|
|
543
|
+
experimentSplit: IconExperimentSplit,
|
|
544
|
+
surveyCard: IconSurveyCard
|
|
545
|
+
};
|
|
546
|
+
var IconActivity = createIconBasePath(
|
|
547
|
+
"M22 12h-4l-3 9L9 3l-3 9H2v2h6.76l2.24-6.72L15 15l2.24-6.72L19 14h3v-2z"
|
|
548
|
+
);
|
|
549
|
+
var IconFlask = createIconBasePath(
|
|
550
|
+
"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"
|
|
551
|
+
);
|
|
552
|
+
var IconSpinner = forwardRef4(function IconSpinner2(_a, ref) {
|
|
553
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
554
|
+
return /* @__PURE__ */ jsx5(IconSync, __spreadValues({ ref, className: cn("ph-icon-spin", className) }, props));
|
|
555
|
+
});
|
|
556
|
+
IconSpinner.displayName = "IconSpinner";
|
|
557
|
+
var CANONICAL_ICONS = {
|
|
558
|
+
activity: IconActivity,
|
|
559
|
+
areaChart: IconAreaChart,
|
|
560
|
+
arrowDown: IconArrowDown,
|
|
561
|
+
arrowUp: IconArrowUp,
|
|
562
|
+
bell: IconBell,
|
|
563
|
+
bellOff: IconBellOff,
|
|
564
|
+
bolt: IconBolt,
|
|
565
|
+
box: IconBox,
|
|
566
|
+
cancel: IconCancel,
|
|
567
|
+
check: IconCheck,
|
|
568
|
+
checkCircle: IconCheckCircle,
|
|
569
|
+
chevronDown: IconChevronDown,
|
|
570
|
+
chevronLeft: IconChevronLeft,
|
|
571
|
+
chevronRight: IconChevronRight,
|
|
572
|
+
clipboardEdit: IconClipboardEdit,
|
|
573
|
+
close: IconClose,
|
|
574
|
+
codePreview: IconCodePreview,
|
|
575
|
+
cohort: IconCohort,
|
|
576
|
+
commandCursor: IconCommandCursor,
|
|
577
|
+
copy: IconCopy,
|
|
578
|
+
cumulativeChart: IconCumulativeChart,
|
|
579
|
+
dataReel: IconDataReel,
|
|
580
|
+
database: IconDatabase,
|
|
581
|
+
download: IconDownload,
|
|
582
|
+
edit: IconEdit,
|
|
583
|
+
errorOutline: IconErrorOutline,
|
|
584
|
+
eventStream: IconEventStream,
|
|
585
|
+
exclamation: IconExclamation,
|
|
586
|
+
experimentSplit: IconExperimentSplit,
|
|
587
|
+
featureGate: IconFeatureGate,
|
|
588
|
+
flag: IconFlag,
|
|
589
|
+
flare: IconFlare,
|
|
590
|
+
flask: IconFlask,
|
|
591
|
+
gift: IconGift,
|
|
592
|
+
gridView: IconGridView,
|
|
593
|
+
handClick: IconHandClick,
|
|
594
|
+
home: IconHome,
|
|
595
|
+
info: IconInfo,
|
|
596
|
+
insightBoard: IconInsightBoard,
|
|
597
|
+
layers: IconLayers,
|
|
598
|
+
listView: IconListView,
|
|
599
|
+
logout: IconLogout,
|
|
600
|
+
mail: IconMail,
|
|
601
|
+
moon: IconMoon,
|
|
602
|
+
oldWindow: IconOldWindow,
|
|
603
|
+
panelRight: IconPanelRight,
|
|
604
|
+
person: IconPerson,
|
|
605
|
+
playCircle: IconPlayCircle,
|
|
606
|
+
plus: IconPlus,
|
|
607
|
+
premium: IconPremium,
|
|
608
|
+
queryEditor: IconQueryEditor,
|
|
609
|
+
queryStack: IconQueryStack,
|
|
610
|
+
radar: IconRadar,
|
|
611
|
+
recording: IconRecording,
|
|
612
|
+
replayFrame: IconReplayFrame,
|
|
613
|
+
robot: IconRobot,
|
|
614
|
+
rocket: IconRocket,
|
|
615
|
+
save: IconSave,
|
|
616
|
+
search: IconSearch,
|
|
617
|
+
selectEvents: IconSelectEvents,
|
|
618
|
+
shoppingCart: IconShoppingCart,
|
|
619
|
+
spinner: IconSpinner,
|
|
620
|
+
star: IconStar,
|
|
621
|
+
subArrowRight: IconSubArrowRight,
|
|
622
|
+
sun: IconSun,
|
|
623
|
+
surveyCard: IconSurveyCard,
|
|
624
|
+
surveys: IconSurveys,
|
|
625
|
+
sync: IconSync,
|
|
626
|
+
tableChart: IconTableChart,
|
|
627
|
+
terminal: IconTerminal,
|
|
628
|
+
toggle: IconToggle,
|
|
629
|
+
trash: IconTrash,
|
|
630
|
+
tuning: IconTuning,
|
|
631
|
+
upload: IconUpload,
|
|
632
|
+
volume: IconVolume,
|
|
633
|
+
volumeOff: IconVolumeOff
|
|
634
|
+
};
|
|
635
|
+
var PH_ICON_ALIASES = {
|
|
636
|
+
clipboard: IconClipboardEdit,
|
|
637
|
+
grid: IconGridView,
|
|
638
|
+
list: IconListView,
|
|
639
|
+
play: IconPlayCircle,
|
|
640
|
+
settings: IconTuning,
|
|
641
|
+
trendingUp: IconArrowUp,
|
|
642
|
+
warning: IconExclamation,
|
|
643
|
+
xCircle: IconCancel
|
|
644
|
+
};
|
|
645
|
+
var PH_ICONS = __spreadValues(__spreadValues({}, CANONICAL_ICONS), PH_ICON_ALIASES);
|
|
646
|
+
for (const [name, Icon] of Object.entries(CANONICAL_ICONS)) {
|
|
647
|
+
const namedIcon = Icon;
|
|
648
|
+
if (!namedIcon.displayName || namedIcon.displayName === "IconGlyph") {
|
|
649
|
+
namedIcon.displayName = `Icon${name[0].toUpperCase()}${name.slice(1)}`;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
var IconByName = forwardRef4(function IconByName2(_a, ref) {
|
|
653
|
+
var _b = _a, { name } = _b, props = __objRest(_b, ["name"]);
|
|
654
|
+
const Icon = PH_ICONS[name];
|
|
655
|
+
return /* @__PURE__ */ jsx5(Icon, __spreadValues({ ref }, props));
|
|
656
|
+
});
|
|
657
|
+
IconByName.displayName = "IconByName";
|
|
658
|
+
|
|
659
|
+
// src/components/ui/Alert.tsx
|
|
660
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
661
|
+
var statusConfig = {
|
|
662
|
+
info: { icon: IconInfo },
|
|
663
|
+
success: { icon: IconCheckCircle },
|
|
664
|
+
warning: { icon: IconExclamation },
|
|
665
|
+
danger: { icon: IconCancel }
|
|
666
|
+
};
|
|
667
|
+
var statusClassMap = {
|
|
668
|
+
info: "ph-alert-info",
|
|
669
|
+
success: "ph-alert-success",
|
|
670
|
+
warning: "ph-alert-warning",
|
|
671
|
+
danger: "ph-alert-danger"
|
|
672
|
+
};
|
|
673
|
+
var Alert = forwardRef5(function Alert2(_a, ref) {
|
|
674
|
+
var _b = _a, {
|
|
675
|
+
status = "info",
|
|
676
|
+
title,
|
|
677
|
+
description,
|
|
678
|
+
icon,
|
|
679
|
+
children,
|
|
680
|
+
className,
|
|
681
|
+
onDismiss,
|
|
682
|
+
live,
|
|
683
|
+
dismissLabel = "Dismiss notification",
|
|
684
|
+
role
|
|
685
|
+
} = _b, props = __objRest(_b, [
|
|
686
|
+
"status",
|
|
687
|
+
"title",
|
|
688
|
+
"description",
|
|
689
|
+
"icon",
|
|
690
|
+
"children",
|
|
691
|
+
"className",
|
|
692
|
+
"onDismiss",
|
|
693
|
+
"live",
|
|
694
|
+
"dismissLabel",
|
|
695
|
+
"role"
|
|
696
|
+
]);
|
|
697
|
+
const config = statusConfig[status];
|
|
698
|
+
const Icon = config.icon;
|
|
699
|
+
return /* @__PURE__ */ jsxs4(
|
|
700
|
+
"div",
|
|
701
|
+
__spreadProps(__spreadValues({
|
|
702
|
+
ref,
|
|
703
|
+
role: role != null ? role : live === "assertive" ? "alert" : live === "polite" ? "status" : void 0,
|
|
704
|
+
"aria-live": live,
|
|
705
|
+
className: cn("ph-alert", statusClassMap[status], className)
|
|
706
|
+
}, props), {
|
|
707
|
+
children: [
|
|
708
|
+
icon != null ? icon : /* @__PURE__ */ jsx6(Icon, { className: "ph-alert-icon mt-0.5 h-5 w-5 shrink-0", "aria-hidden": true }),
|
|
709
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
710
|
+
title && /* @__PURE__ */ jsx6("p", { className: "font-semibold", children: title }),
|
|
711
|
+
description && /* @__PURE__ */ jsx6("p", { className: "mt-1 text-sm text-ph-subtle", children: description }),
|
|
712
|
+
children
|
|
713
|
+
] }),
|
|
714
|
+
onDismiss && /* @__PURE__ */ jsx6(
|
|
715
|
+
"button",
|
|
716
|
+
{
|
|
717
|
+
type: "button",
|
|
718
|
+
onClick: onDismiss,
|
|
719
|
+
className: "ph-alert-dismiss",
|
|
720
|
+
"aria-label": dismissLabel,
|
|
721
|
+
children: /* @__PURE__ */ jsx6(IconClose, { className: "h-4 w-4", "aria-hidden": true })
|
|
722
|
+
}
|
|
723
|
+
)
|
|
724
|
+
]
|
|
725
|
+
})
|
|
726
|
+
);
|
|
727
|
+
});
|
|
728
|
+
Alert.displayName = "Alert";
|
|
729
|
+
|
|
730
|
+
// src/components/ui/Badge.tsx
|
|
731
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
732
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
733
|
+
var variantMap = {
|
|
734
|
+
brand: "ph-badge-brand",
|
|
735
|
+
neutral: "ph-badge-neutral",
|
|
736
|
+
success: "ph-badge-success",
|
|
737
|
+
warning: "ph-badge-warning",
|
|
738
|
+
danger: "ph-badge-danger",
|
|
739
|
+
info: "ph-badge-info",
|
|
740
|
+
outline: "ph-badge-outline"
|
|
741
|
+
};
|
|
742
|
+
var sizeMap = {
|
|
743
|
+
sm: "text-[10px] px-1.5 py-0.5",
|
|
744
|
+
md: ""
|
|
745
|
+
};
|
|
746
|
+
var Badge = forwardRef6(function Badge2(_a, ref) {
|
|
747
|
+
var _b = _a, {
|
|
748
|
+
variant = "neutral",
|
|
749
|
+
size = "md",
|
|
750
|
+
children,
|
|
751
|
+
className
|
|
752
|
+
} = _b, props = __objRest(_b, [
|
|
753
|
+
"variant",
|
|
754
|
+
"size",
|
|
755
|
+
"children",
|
|
756
|
+
"className"
|
|
757
|
+
]);
|
|
758
|
+
return /* @__PURE__ */ jsx7(
|
|
759
|
+
"span",
|
|
760
|
+
__spreadProps(__spreadValues({
|
|
761
|
+
ref,
|
|
762
|
+
className: cn(
|
|
763
|
+
"ph-badge",
|
|
764
|
+
variantMap[variant],
|
|
765
|
+
sizeMap[size],
|
|
766
|
+
className
|
|
767
|
+
)
|
|
768
|
+
}, props), {
|
|
769
|
+
children
|
|
770
|
+
})
|
|
771
|
+
);
|
|
772
|
+
});
|
|
773
|
+
Badge.displayName = "Badge";
|
|
774
|
+
|
|
775
|
+
// src/components/ui/Card.tsx
|
|
776
|
+
import {
|
|
777
|
+
forwardRef as forwardRef7
|
|
778
|
+
} from "react";
|
|
779
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
780
|
+
var variantMap2 = {
|
|
781
|
+
default: "",
|
|
782
|
+
outlined: "border-2 border-ph-border",
|
|
783
|
+
elevated: "ph-card-elevated",
|
|
784
|
+
highlighted: "ph-card-highlighted"
|
|
785
|
+
};
|
|
786
|
+
var Card = forwardRef7(function Card2(_a, ref) {
|
|
787
|
+
var _b = _a, {
|
|
788
|
+
children,
|
|
789
|
+
title,
|
|
790
|
+
description,
|
|
791
|
+
actions,
|
|
792
|
+
footer,
|
|
793
|
+
media,
|
|
794
|
+
variant = "default",
|
|
795
|
+
className,
|
|
796
|
+
bodyClassName,
|
|
797
|
+
interactive = false,
|
|
798
|
+
href,
|
|
799
|
+
onClick,
|
|
800
|
+
target,
|
|
801
|
+
rel,
|
|
802
|
+
type,
|
|
803
|
+
titleAs: Title3 = "h3"
|
|
804
|
+
} = _b, props = __objRest(_b, [
|
|
805
|
+
"children",
|
|
806
|
+
"title",
|
|
807
|
+
"description",
|
|
808
|
+
"actions",
|
|
809
|
+
"footer",
|
|
810
|
+
"media",
|
|
811
|
+
"variant",
|
|
812
|
+
"className",
|
|
813
|
+
"bodyClassName",
|
|
814
|
+
"interactive",
|
|
815
|
+
"href",
|
|
816
|
+
"onClick",
|
|
817
|
+
"target",
|
|
818
|
+
"rel",
|
|
819
|
+
"type",
|
|
820
|
+
"titleAs"
|
|
821
|
+
]);
|
|
822
|
+
const isLink = href !== void 0;
|
|
823
|
+
const isButton = onClick !== void 0 && !isLink;
|
|
824
|
+
const cardClassName = cn(
|
|
825
|
+
"ph-card",
|
|
826
|
+
variantMap2[variant],
|
|
827
|
+
(interactive || isLink || isButton) && "ph-card-interactive",
|
|
828
|
+
className
|
|
829
|
+
);
|
|
830
|
+
const cardContent = /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
831
|
+
media && /* @__PURE__ */ jsx8("div", { className: "ph-card-media", children: media }),
|
|
832
|
+
/* @__PURE__ */ jsxs5("div", { className: cn("ph-card-body", bodyClassName), children: [
|
|
833
|
+
title && /* @__PURE__ */ jsx8(Title3, { className: "ph-card-title", children: title }),
|
|
834
|
+
description && /* @__PURE__ */ jsx8("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
835
|
+
children,
|
|
836
|
+
actions && /* @__PURE__ */ jsx8("div", { className: "ph-card-actions", children: actions })
|
|
837
|
+
] }),
|
|
838
|
+
footer && /* @__PURE__ */ jsx8("div", { className: "border-t border-ph-border px-6 py-4 text-xs text-ph-subtle", children: footer })
|
|
839
|
+
] });
|
|
840
|
+
if (isLink) {
|
|
841
|
+
return /* @__PURE__ */ jsx8(
|
|
842
|
+
"a",
|
|
843
|
+
__spreadProps(__spreadValues({
|
|
844
|
+
ref,
|
|
845
|
+
className: cardClassName,
|
|
846
|
+
href,
|
|
847
|
+
target,
|
|
848
|
+
rel,
|
|
849
|
+
onClick
|
|
850
|
+
}, props), {
|
|
851
|
+
children: cardContent
|
|
852
|
+
})
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
if (isButton) {
|
|
856
|
+
return /* @__PURE__ */ jsx8(
|
|
857
|
+
"button",
|
|
858
|
+
__spreadProps(__spreadValues({
|
|
859
|
+
ref,
|
|
860
|
+
type: type != null ? type : "button",
|
|
861
|
+
className: cardClassName,
|
|
862
|
+
onClick
|
|
863
|
+
}, props), {
|
|
864
|
+
children: cardContent
|
|
865
|
+
})
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
return /* @__PURE__ */ jsx8("div", __spreadProps(__spreadValues({ ref, className: cardClassName }, props), { children: cardContent }));
|
|
869
|
+
});
|
|
870
|
+
Card.displayName = "Card";
|
|
871
|
+
|
|
872
|
+
// src/components/ui/Kbd.tsx
|
|
873
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
874
|
+
var platformLabels = {
|
|
875
|
+
text: {
|
|
876
|
+
command: "Command",
|
|
877
|
+
cmd: "Command",
|
|
878
|
+
option: "Option",
|
|
879
|
+
alt: "Alt",
|
|
880
|
+
control: "Control",
|
|
881
|
+
ctrl: "Control",
|
|
882
|
+
shift: "Shift"
|
|
883
|
+
},
|
|
884
|
+
mac: {
|
|
885
|
+
command: "\u2318",
|
|
886
|
+
cmd: "\u2318",
|
|
887
|
+
option: "\u2325",
|
|
888
|
+
alt: "\u2325",
|
|
889
|
+
control: "\u2303",
|
|
890
|
+
ctrl: "\u2303",
|
|
891
|
+
shift: "\u21E7"
|
|
892
|
+
},
|
|
893
|
+
windows: {
|
|
894
|
+
command: "Win",
|
|
895
|
+
cmd: "Win",
|
|
896
|
+
option: "Alt",
|
|
897
|
+
alt: "Alt",
|
|
898
|
+
control: "Ctrl",
|
|
899
|
+
ctrl: "Ctrl",
|
|
900
|
+
shift: "Shift"
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
var spokenLabels = {
|
|
904
|
+
"\u2318": "Command",
|
|
905
|
+
"\u2325": "Option",
|
|
906
|
+
"\u2303": "Control",
|
|
907
|
+
"\u21E7": "Shift",
|
|
908
|
+
"\u21B5": "Enter",
|
|
909
|
+
"\u23CE": "Enter",
|
|
910
|
+
"\u232B": "Backspace",
|
|
911
|
+
"\u238B": "Escape"
|
|
912
|
+
};
|
|
913
|
+
function Kbd(_a) {
|
|
914
|
+
var _b = _a, {
|
|
915
|
+
variant = "shortcut",
|
|
916
|
+
keys,
|
|
917
|
+
platform = "text",
|
|
918
|
+
separator,
|
|
919
|
+
children,
|
|
920
|
+
className,
|
|
921
|
+
"aria-label": ariaLabel
|
|
922
|
+
} = _b, props = __objRest(_b, [
|
|
923
|
+
"variant",
|
|
924
|
+
"keys",
|
|
925
|
+
"platform",
|
|
926
|
+
"separator",
|
|
927
|
+
"children",
|
|
928
|
+
"className",
|
|
929
|
+
"aria-label"
|
|
930
|
+
]);
|
|
931
|
+
if (variant === "token") {
|
|
932
|
+
return /* @__PURE__ */ jsx9(
|
|
933
|
+
"code",
|
|
934
|
+
__spreadProps(__spreadValues({
|
|
935
|
+
className: cn("ph-code-token ph-kbd", className),
|
|
936
|
+
role: ariaLabel ? "img" : void 0,
|
|
937
|
+
"aria-label": ariaLabel
|
|
938
|
+
}, props), {
|
|
939
|
+
children
|
|
940
|
+
})
|
|
941
|
+
);
|
|
942
|
+
}
|
|
943
|
+
const sourceKeys = (keys == null ? void 0 : keys.length) ? keys : children != null ? [children] : [];
|
|
944
|
+
const displayKeys = sourceKeys.map((key) => formatKey(key, platform));
|
|
945
|
+
const accessibleLabel = ariaLabel != null ? ariaLabel : getShortcutLabel(displayKeys);
|
|
946
|
+
if (variant === "key") {
|
|
947
|
+
return /* @__PURE__ */ jsx9(
|
|
948
|
+
"kbd",
|
|
949
|
+
__spreadProps(__spreadValues({
|
|
950
|
+
className: cn("ph-keycap", className),
|
|
951
|
+
role: accessibleLabel ? "img" : void 0,
|
|
952
|
+
"aria-label": accessibleLabel
|
|
953
|
+
}, props), {
|
|
954
|
+
children: displayKeys[0]
|
|
955
|
+
})
|
|
956
|
+
);
|
|
957
|
+
}
|
|
958
|
+
return /* @__PURE__ */ jsx9(
|
|
959
|
+
"kbd",
|
|
960
|
+
__spreadProps(__spreadValues({
|
|
961
|
+
className: cn("ph-shortcut-group ph-keycap", className),
|
|
962
|
+
role: accessibleLabel ? "img" : void 0,
|
|
963
|
+
"aria-label": accessibleLabel
|
|
964
|
+
}, props), {
|
|
965
|
+
children: displayKeys.map((key, index) => /* @__PURE__ */ jsxs6("span", { className: "contents", children: [
|
|
966
|
+
index > 0 && separator != null ? /* @__PURE__ */ jsx9("span", { className: "ph-shortcut-separator", "aria-hidden": "true", children: separator }) : null,
|
|
967
|
+
/* @__PURE__ */ jsx9("span", { className: "ph-shortcut-key", "aria-hidden": accessibleLabel ? true : void 0, children: key })
|
|
968
|
+
] }, index))
|
|
969
|
+
})
|
|
970
|
+
);
|
|
971
|
+
}
|
|
972
|
+
function formatKey(key, platform) {
|
|
973
|
+
var _a;
|
|
974
|
+
if (typeof key !== "string") return key;
|
|
975
|
+
return (_a = platformLabels[platform][key.toLowerCase()]) != null ? _a : key;
|
|
976
|
+
}
|
|
977
|
+
function getShortcutLabel(keys) {
|
|
978
|
+
const labels = keys.map((key) => {
|
|
979
|
+
var _a;
|
|
980
|
+
if (typeof key !== "string" && typeof key !== "number") return null;
|
|
981
|
+
const value = String(key);
|
|
982
|
+
return (_a = spokenLabels[value]) != null ? _a : value;
|
|
983
|
+
});
|
|
984
|
+
return labels.every((label) => label != null) ? labels.join(" + ") : void 0;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// src/components/ui/Loader.tsx
|
|
988
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
989
|
+
var loaderSizeClass = {
|
|
990
|
+
sm: "ph-loader-sm",
|
|
991
|
+
md: "ph-loader-md",
|
|
992
|
+
lg: "ph-loader-lg"
|
|
993
|
+
};
|
|
994
|
+
var skeletonShapeClass = {
|
|
995
|
+
title: "ph-skeleton-title",
|
|
996
|
+
text: "ph-skeleton-text",
|
|
997
|
+
"short-text": "ph-skeleton-text-short",
|
|
998
|
+
avatar: "ph-skeleton-avatar",
|
|
999
|
+
button: "ph-skeleton-button",
|
|
1000
|
+
block: "ph-skeleton-block"
|
|
1001
|
+
};
|
|
1002
|
+
function Loader(_a) {
|
|
1003
|
+
var _b = _a, {
|
|
1004
|
+
variant = "spinner",
|
|
1005
|
+
size = "md",
|
|
1006
|
+
label = "Loading",
|
|
1007
|
+
className
|
|
1008
|
+
} = _b, props = __objRest(_b, [
|
|
1009
|
+
"variant",
|
|
1010
|
+
"size",
|
|
1011
|
+
"label",
|
|
1012
|
+
"className"
|
|
1013
|
+
]);
|
|
1014
|
+
return /* @__PURE__ */ jsxs7(
|
|
1015
|
+
"span",
|
|
1016
|
+
__spreadProps(__spreadValues({
|
|
1017
|
+
role: "status",
|
|
1018
|
+
"aria-label": label,
|
|
1019
|
+
className: cn("ph-loader", loaderSizeClass[size], className)
|
|
1020
|
+
}, props), {
|
|
1021
|
+
children: [
|
|
1022
|
+
variant === "spinner" ? /* @__PURE__ */ jsx10("span", { className: "ph-loading", "aria-hidden": true }) : null,
|
|
1023
|
+
variant === "dots" ? /* @__PURE__ */ jsxs7("span", { className: "ph-loading-dots", "aria-hidden": true, children: [
|
|
1024
|
+
/* @__PURE__ */ jsx10("span", {}),
|
|
1025
|
+
/* @__PURE__ */ jsx10("span", {}),
|
|
1026
|
+
/* @__PURE__ */ jsx10("span", {})
|
|
1027
|
+
] }) : null,
|
|
1028
|
+
variant === "pulse" ? /* @__PURE__ */ jsx10("span", { className: "ph-loading-pulse", "aria-hidden": true }) : null
|
|
1029
|
+
]
|
|
1030
|
+
})
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
function Skeleton(_a) {
|
|
1034
|
+
var _b = _a, { shape = "text", className } = _b, props = __objRest(_b, ["shape", "className"]);
|
|
1035
|
+
return /* @__PURE__ */ jsx10(
|
|
1036
|
+
"span",
|
|
1037
|
+
__spreadValues({
|
|
1038
|
+
className: cn("ph-skeleton", skeletonShapeClass[shape], className),
|
|
1039
|
+
"aria-hidden": "true"
|
|
1040
|
+
}, props)
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
function LoadingState(_a) {
|
|
1044
|
+
var _b = _a, {
|
|
1045
|
+
label = "Loading",
|
|
1046
|
+
title = "Loading",
|
|
1047
|
+
description,
|
|
1048
|
+
variant = "spinner",
|
|
1049
|
+
size = "lg",
|
|
1050
|
+
className
|
|
1051
|
+
} = _b, props = __objRest(_b, [
|
|
1052
|
+
"label",
|
|
1053
|
+
"title",
|
|
1054
|
+
"description",
|
|
1055
|
+
"variant",
|
|
1056
|
+
"size",
|
|
1057
|
+
"className"
|
|
1058
|
+
]);
|
|
1059
|
+
return /* @__PURE__ */ jsxs7("div", __spreadProps(__spreadValues({ className: cn("ph-loading-state", className), role: "status", "aria-label": label }, props), { children: [
|
|
1060
|
+
/* @__PURE__ */ jsx10(Loader, { variant, size, label, "aria-hidden": "true" }),
|
|
1061
|
+
/* @__PURE__ */ jsxs7("div", { className: "ph-loading-state__copy", children: [
|
|
1062
|
+
/* @__PURE__ */ jsx10("strong", { children: title }),
|
|
1063
|
+
description ? /* @__PURE__ */ jsx10("span", { children: description }) : null
|
|
1064
|
+
] })
|
|
1065
|
+
] }));
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
// src/components/ui/AuthLayout.tsx
|
|
1069
|
+
import { useId } from "react";
|
|
1070
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1071
|
+
function AuthLayout(_a) {
|
|
1072
|
+
var _b = _a, { brand, footer, aside, children, className } = _b, props = __objRest(_b, ["brand", "footer", "aside", "children", "className"]);
|
|
1073
|
+
return /* @__PURE__ */ jsxs8("div", __spreadProps(__spreadValues({ className: cn("ph-auth-layout", aside != null && "ph-auth-layout--split", className) }, props), { children: [
|
|
1074
|
+
aside ? /* @__PURE__ */ jsx11("aside", { className: "ph-auth-layout__aside", children: aside }) : null,
|
|
1075
|
+
/* @__PURE__ */ jsx11("div", { className: "ph-auth-layout__main", children: /* @__PURE__ */ jsxs8("div", { className: "ph-auth-layout__column", children: [
|
|
1076
|
+
brand ? /* @__PURE__ */ jsx11("div", { className: "ph-auth-layout__brand", children: brand }) : null,
|
|
1077
|
+
children,
|
|
1078
|
+
footer ? /* @__PURE__ */ jsx11("footer", { className: "ph-auth-layout__footer", children: footer }) : null
|
|
1079
|
+
] }) })
|
|
1080
|
+
] }));
|
|
1081
|
+
}
|
|
1082
|
+
function AuthCard(_a) {
|
|
1083
|
+
var _b = _a, { title, description, footer, children, className } = _b, props = __objRest(_b, ["title", "description", "footer", "children", "className"]);
|
|
1084
|
+
const titleId = useId();
|
|
1085
|
+
return /* @__PURE__ */ jsxs8("section", __spreadProps(__spreadValues({ className: cn("ph-auth-card", className), "aria-labelledby": titleId }, props), { children: [
|
|
1086
|
+
/* @__PURE__ */ jsxs8("header", { className: "ph-auth-card__header", children: [
|
|
1087
|
+
/* @__PURE__ */ jsx11("h1", { id: titleId, children: title }),
|
|
1088
|
+
description ? /* @__PURE__ */ jsx11("p", { children: description }) : null
|
|
1089
|
+
] }),
|
|
1090
|
+
/* @__PURE__ */ jsx11("div", { className: "ph-auth-card__body", children }),
|
|
1091
|
+
footer ? /* @__PURE__ */ jsx11("footer", { className: "ph-auth-card__footer", children: footer }) : null
|
|
1092
|
+
] }));
|
|
1093
|
+
}
|
|
1094
|
+
function AuthDivider(_a) {
|
|
1095
|
+
var _b = _a, { children = "or continue with", className } = _b, props = __objRest(_b, ["children", "className"]);
|
|
1096
|
+
return /* @__PURE__ */ jsx11("div", __spreadProps(__spreadValues({ className: cn("ph-auth-divider", className) }, props), { children: /* @__PURE__ */ jsx11("span", { children }) }));
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// src/components/ui/SettingsLayout.tsx
|
|
1100
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1101
|
+
function SettingsNav(_a) {
|
|
1102
|
+
var _b = _a, { groups, className } = _b, props = __objRest(_b, ["groups", "className"]);
|
|
1103
|
+
return /* @__PURE__ */ jsx12("div", __spreadProps(__spreadValues({ className: cn("ph-settings-nav", className) }, props), { children: groups.map((group, index) => /* @__PURE__ */ jsxs9("div", { className: "ph-settings-nav__group", children: [
|
|
1104
|
+
/* @__PURE__ */ jsx12("p", { className: "ph-settings-nav__heading", children: group.label }),
|
|
1105
|
+
/* @__PURE__ */ jsx12("div", { className: "ph-settings-nav__items", children: group.items.map((item) => /* @__PURE__ */ jsxs9(
|
|
1106
|
+
"a",
|
|
1107
|
+
{
|
|
1108
|
+
href: item.href,
|
|
1109
|
+
id: `settings-nav-${item.id}`,
|
|
1110
|
+
"data-test": `settings-nav-${item.id}`,
|
|
1111
|
+
className: cn(
|
|
1112
|
+
"ph-settings-nav__item",
|
|
1113
|
+
item.active && "ph-settings-nav__item--active"
|
|
1114
|
+
),
|
|
1115
|
+
"aria-current": item.active ? "page" : void 0,
|
|
1116
|
+
children: [
|
|
1117
|
+
item.icon ? /* @__PURE__ */ jsx12("span", { className: "ph-settings-nav__icon", children: item.icon }) : null,
|
|
1118
|
+
/* @__PURE__ */ jsx12("span", { children: item.label }),
|
|
1119
|
+
item.badge ? /* @__PURE__ */ jsx12("span", { className: "ph-settings-nav__badge", children: item.badge }) : null
|
|
1120
|
+
]
|
|
1121
|
+
},
|
|
1122
|
+
item.id
|
|
1123
|
+
)) })
|
|
1124
|
+
] }, index)) }));
|
|
1125
|
+
}
|
|
1126
|
+
function SettingsLayout(_a) {
|
|
1127
|
+
var _b = _a, {
|
|
1128
|
+
title,
|
|
1129
|
+
description,
|
|
1130
|
+
actions,
|
|
1131
|
+
navigation,
|
|
1132
|
+
navigationLabel = "Settings",
|
|
1133
|
+
children,
|
|
1134
|
+
className
|
|
1135
|
+
} = _b, props = __objRest(_b, [
|
|
1136
|
+
"title",
|
|
1137
|
+
"description",
|
|
1138
|
+
"actions",
|
|
1139
|
+
"navigation",
|
|
1140
|
+
"navigationLabel",
|
|
1141
|
+
"children",
|
|
1142
|
+
"className"
|
|
1143
|
+
]);
|
|
1144
|
+
return /* @__PURE__ */ jsxs9("section", __spreadProps(__spreadValues({ className: cn("ph-settings-layout", className) }, props), { children: [
|
|
1145
|
+
/* @__PURE__ */ jsxs9("header", { className: "ph-settings-layout__header", children: [
|
|
1146
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
1147
|
+
/* @__PURE__ */ jsx12("h2", { children: title }),
|
|
1148
|
+
description ? /* @__PURE__ */ jsx12("p", { children: description }) : null
|
|
1149
|
+
] }),
|
|
1150
|
+
actions ? /* @__PURE__ */ jsx12("div", { className: "ph-settings-layout__actions", children: actions }) : null
|
|
1151
|
+
] }),
|
|
1152
|
+
/* @__PURE__ */ jsxs9("details", { className: "ph-settings-layout__mobile-nav", children: [
|
|
1153
|
+
/* @__PURE__ */ jsxs9("summary", { children: [
|
|
1154
|
+
/* @__PURE__ */ jsx12(IconTuning, { className: "h-4 w-4", "aria-hidden": true }),
|
|
1155
|
+
"Settings menu"
|
|
1156
|
+
] }),
|
|
1157
|
+
/* @__PURE__ */ jsx12("nav", { "aria-label": navigationLabel, children: navigation })
|
|
1158
|
+
] }),
|
|
1159
|
+
/* @__PURE__ */ jsxs9("div", { className: "ph-settings-layout__grid", children: [
|
|
1160
|
+
/* @__PURE__ */ jsx12("aside", { className: "ph-settings-layout__sidebar", children: /* @__PURE__ */ jsx12("nav", { "aria-label": navigationLabel, children: navigation }) }),
|
|
1161
|
+
/* @__PURE__ */ jsx12("div", { className: "ph-settings-layout__content", children })
|
|
1162
|
+
] })
|
|
1163
|
+
] }));
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
// src/components/ui/DropdownMenu.tsx
|
|
1167
|
+
import * as DropdownPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1168
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1169
|
+
var sizeClass2 = {
|
|
1170
|
+
xs: "ph-btn-xs",
|
|
1171
|
+
sm: "ph-btn-sm",
|
|
1172
|
+
md: "",
|
|
1173
|
+
lg: "ph-btn-lg"
|
|
1174
|
+
};
|
|
1175
|
+
var variantClass2 = {
|
|
1176
|
+
primary: "ph-btn-primary",
|
|
1177
|
+
secondary: "ph-btn-secondary",
|
|
1178
|
+
accent: "ph-btn-accent"
|
|
1179
|
+
};
|
|
1180
|
+
function DropdownContent({
|
|
1181
|
+
children,
|
|
1182
|
+
align = "start",
|
|
1183
|
+
side = "bottom",
|
|
1184
|
+
sideOffset = 7,
|
|
1185
|
+
alignOffset = 0,
|
|
1186
|
+
collisionPadding = 8,
|
|
1187
|
+
avoidCollisions = true,
|
|
1188
|
+
panelClassName
|
|
1189
|
+
}) {
|
|
1190
|
+
return /* @__PURE__ */ jsx13(DropdownPrimitive.Portal, { children: /* @__PURE__ */ jsxs10(
|
|
1191
|
+
DropdownPrimitive.Content,
|
|
1192
|
+
{
|
|
1193
|
+
className: cn("ph-dropdown-panel", panelClassName),
|
|
1194
|
+
align,
|
|
1195
|
+
side,
|
|
1196
|
+
sideOffset,
|
|
1197
|
+
alignOffset,
|
|
1198
|
+
collisionPadding,
|
|
1199
|
+
avoidCollisions,
|
|
1200
|
+
sticky: "partial",
|
|
1201
|
+
children: [
|
|
1202
|
+
children,
|
|
1203
|
+
/* @__PURE__ */ jsx13(
|
|
1204
|
+
DropdownPrimitive.Arrow,
|
|
1205
|
+
{
|
|
1206
|
+
className: "ph-dropdown-arrow",
|
|
1207
|
+
width: 12,
|
|
1208
|
+
height: 6
|
|
1209
|
+
}
|
|
1210
|
+
)
|
|
1211
|
+
]
|
|
1212
|
+
}
|
|
1213
|
+
) });
|
|
1214
|
+
}
|
|
1215
|
+
function DropdownMenu(_a) {
|
|
1216
|
+
var _b = _a, {
|
|
1217
|
+
trigger,
|
|
1218
|
+
triggerId,
|
|
1219
|
+
triggerDataTest,
|
|
1220
|
+
children,
|
|
1221
|
+
align,
|
|
1222
|
+
side,
|
|
1223
|
+
sideOffset,
|
|
1224
|
+
alignOffset,
|
|
1225
|
+
collisionPadding,
|
|
1226
|
+
avoidCollisions,
|
|
1227
|
+
className,
|
|
1228
|
+
panelClassName,
|
|
1229
|
+
"aria-label": ariaLabel,
|
|
1230
|
+
open,
|
|
1231
|
+
defaultOpen,
|
|
1232
|
+
onOpenChange,
|
|
1233
|
+
modal = false,
|
|
1234
|
+
disabled
|
|
1235
|
+
} = _b, props = __objRest(_b, [
|
|
1236
|
+
"trigger",
|
|
1237
|
+
"triggerId",
|
|
1238
|
+
"triggerDataTest",
|
|
1239
|
+
"children",
|
|
1240
|
+
"align",
|
|
1241
|
+
"side",
|
|
1242
|
+
"sideOffset",
|
|
1243
|
+
"alignOffset",
|
|
1244
|
+
"collisionPadding",
|
|
1245
|
+
"avoidCollisions",
|
|
1246
|
+
"className",
|
|
1247
|
+
"panelClassName",
|
|
1248
|
+
"aria-label",
|
|
1249
|
+
"open",
|
|
1250
|
+
"defaultOpen",
|
|
1251
|
+
"onOpenChange",
|
|
1252
|
+
"modal",
|
|
1253
|
+
"disabled"
|
|
1254
|
+
]);
|
|
1255
|
+
return /* @__PURE__ */ jsx13("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ jsxs10(
|
|
1256
|
+
DropdownPrimitive.Root,
|
|
1257
|
+
{
|
|
1258
|
+
open,
|
|
1259
|
+
defaultOpen,
|
|
1260
|
+
onOpenChange,
|
|
1261
|
+
modal,
|
|
1262
|
+
children: [
|
|
1263
|
+
/* @__PURE__ */ jsx13(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ jsx13(
|
|
1264
|
+
"button",
|
|
1265
|
+
{
|
|
1266
|
+
type: "button",
|
|
1267
|
+
id: triggerId,
|
|
1268
|
+
"data-test": triggerDataTest,
|
|
1269
|
+
className: "ph-dropdown-trigger",
|
|
1270
|
+
"aria-label": ariaLabel,
|
|
1271
|
+
children: trigger
|
|
1272
|
+
}
|
|
1273
|
+
) }),
|
|
1274
|
+
/* @__PURE__ */ jsx13(
|
|
1275
|
+
DropdownContent,
|
|
1276
|
+
{
|
|
1277
|
+
align,
|
|
1278
|
+
side,
|
|
1279
|
+
sideOffset,
|
|
1280
|
+
alignOffset,
|
|
1281
|
+
collisionPadding,
|
|
1282
|
+
avoidCollisions,
|
|
1283
|
+
panelClassName,
|
|
1284
|
+
children
|
|
1285
|
+
}
|
|
1286
|
+
)
|
|
1287
|
+
]
|
|
1288
|
+
}
|
|
1289
|
+
) }));
|
|
1290
|
+
}
|
|
1291
|
+
function DropdownButton(_a) {
|
|
1292
|
+
var _b = _a, {
|
|
1293
|
+
label,
|
|
1294
|
+
variant = "secondary",
|
|
1295
|
+
outline = false,
|
|
1296
|
+
size = "md",
|
|
1297
|
+
split = false,
|
|
1298
|
+
icon,
|
|
1299
|
+
sideIcon,
|
|
1300
|
+
children,
|
|
1301
|
+
align,
|
|
1302
|
+
side,
|
|
1303
|
+
sideOffset,
|
|
1304
|
+
alignOffset,
|
|
1305
|
+
collisionPadding,
|
|
1306
|
+
avoidCollisions,
|
|
1307
|
+
className,
|
|
1308
|
+
panelClassName,
|
|
1309
|
+
"aria-label": ariaLabel,
|
|
1310
|
+
open,
|
|
1311
|
+
defaultOpen,
|
|
1312
|
+
onOpenChange,
|
|
1313
|
+
modal = false,
|
|
1314
|
+
disabled
|
|
1315
|
+
} = _b, props = __objRest(_b, [
|
|
1316
|
+
"label",
|
|
1317
|
+
"variant",
|
|
1318
|
+
"outline",
|
|
1319
|
+
"size",
|
|
1320
|
+
"split",
|
|
1321
|
+
"icon",
|
|
1322
|
+
"sideIcon",
|
|
1323
|
+
"children",
|
|
1324
|
+
"align",
|
|
1325
|
+
"side",
|
|
1326
|
+
"sideOffset",
|
|
1327
|
+
"alignOffset",
|
|
1328
|
+
"collisionPadding",
|
|
1329
|
+
"avoidCollisions",
|
|
1330
|
+
"className",
|
|
1331
|
+
"panelClassName",
|
|
1332
|
+
"aria-label",
|
|
1333
|
+
"open",
|
|
1334
|
+
"defaultOpen",
|
|
1335
|
+
"onOpenChange",
|
|
1336
|
+
"modal",
|
|
1337
|
+
"disabled"
|
|
1338
|
+
]);
|
|
1339
|
+
const trailing = sideIcon != null ? sideIcon : /* @__PURE__ */ jsx13(IconChevronDown, { className: "h-4 w-4", "aria-hidden": true });
|
|
1340
|
+
return /* @__PURE__ */ jsx13("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ jsxs10(
|
|
1341
|
+
DropdownPrimitive.Root,
|
|
1342
|
+
{
|
|
1343
|
+
open,
|
|
1344
|
+
defaultOpen,
|
|
1345
|
+
onOpenChange,
|
|
1346
|
+
modal,
|
|
1347
|
+
children: [
|
|
1348
|
+
/* @__PURE__ */ jsx13(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ jsx13(
|
|
1349
|
+
"button",
|
|
1350
|
+
{
|
|
1351
|
+
type: "button",
|
|
1352
|
+
disabled,
|
|
1353
|
+
className: cn(
|
|
1354
|
+
"ph-btn ph-btn-raised ph-dropdown-button",
|
|
1355
|
+
variantClass2[variant],
|
|
1356
|
+
outline && "ph-btn-outline",
|
|
1357
|
+
sizeClass2[size],
|
|
1358
|
+
split && "ph-btn-split"
|
|
1359
|
+
),
|
|
1360
|
+
"aria-label": ariaLabel,
|
|
1361
|
+
children: /* @__PURE__ */ jsx13(
|
|
1362
|
+
ButtonChrome,
|
|
1363
|
+
{
|
|
1364
|
+
label,
|
|
1365
|
+
icon,
|
|
1366
|
+
sideIcon: trailing,
|
|
1367
|
+
split
|
|
1368
|
+
}
|
|
1369
|
+
)
|
|
1370
|
+
}
|
|
1371
|
+
) }),
|
|
1372
|
+
/* @__PURE__ */ jsx13(
|
|
1373
|
+
DropdownContent,
|
|
1374
|
+
{
|
|
1375
|
+
align,
|
|
1376
|
+
side,
|
|
1377
|
+
sideOffset,
|
|
1378
|
+
alignOffset,
|
|
1379
|
+
collisionPadding,
|
|
1380
|
+
avoidCollisions,
|
|
1381
|
+
panelClassName,
|
|
1382
|
+
children
|
|
1383
|
+
}
|
|
1384
|
+
)
|
|
1385
|
+
]
|
|
1386
|
+
}
|
|
1387
|
+
) }));
|
|
1388
|
+
}
|
|
1389
|
+
function DropdownItem(_a) {
|
|
1390
|
+
var _b = _a, {
|
|
1391
|
+
className,
|
|
1392
|
+
children,
|
|
1393
|
+
disabled
|
|
1394
|
+
} = _b, props = __objRest(_b, [
|
|
1395
|
+
"className",
|
|
1396
|
+
"children",
|
|
1397
|
+
"disabled"
|
|
1398
|
+
]);
|
|
1399
|
+
return /* @__PURE__ */ jsx13(DropdownPrimitive.Item, { asChild: true, disabled, children: /* @__PURE__ */ jsx13(
|
|
1400
|
+
"button",
|
|
1401
|
+
__spreadProps(__spreadValues({
|
|
1402
|
+
type: "button",
|
|
1403
|
+
disabled,
|
|
1404
|
+
className: cn("ph-dropdown-item w-full text-left", className)
|
|
1405
|
+
}, props), {
|
|
1406
|
+
children
|
|
1407
|
+
})
|
|
1408
|
+
) });
|
|
1409
|
+
}
|
|
1410
|
+
function DropdownRadioGroup(props) {
|
|
1411
|
+
return /* @__PURE__ */ jsx13(DropdownPrimitive.RadioGroup, __spreadValues({}, props));
|
|
1412
|
+
}
|
|
1413
|
+
function DropdownRadioItem(_a) {
|
|
1414
|
+
var _b = _a, {
|
|
1415
|
+
className,
|
|
1416
|
+
children
|
|
1417
|
+
} = _b, props = __objRest(_b, [
|
|
1418
|
+
"className",
|
|
1419
|
+
"children"
|
|
1420
|
+
]);
|
|
1421
|
+
return /* @__PURE__ */ jsxs10(
|
|
1422
|
+
DropdownPrimitive.RadioItem,
|
|
1423
|
+
__spreadProps(__spreadValues({
|
|
1424
|
+
className: cn("ph-dropdown-item ph-dropdown-radio-item", className)
|
|
1425
|
+
}, props), {
|
|
1426
|
+
children: [
|
|
1427
|
+
/* @__PURE__ */ jsx13("span", { className: "ph-dropdown-item-indicator", "aria-hidden": true, children: /* @__PURE__ */ jsx13(DropdownPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx13(IconCheck, { className: "h-3.5 w-3.5" }) }) }),
|
|
1428
|
+
/* @__PURE__ */ jsx13("span", { children })
|
|
1429
|
+
]
|
|
1430
|
+
})
|
|
1431
|
+
);
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
// src/components/ui/Input.tsx
|
|
1435
|
+
import { forwardRef as forwardRef8, useId as useId3, useState } from "react";
|
|
1436
|
+
import { Eye, EyeClosed } from "iconoir-react";
|
|
1437
|
+
|
|
1438
|
+
// src/components/ui/FormField.tsx
|
|
1439
|
+
import { useId as useId2 } from "react";
|
|
1440
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1441
|
+
function FormField(_a) {
|
|
1442
|
+
var _b = _a, {
|
|
1443
|
+
controlId,
|
|
1444
|
+
label,
|
|
1445
|
+
hideLabel = false,
|
|
1446
|
+
helperText,
|
|
1447
|
+
error,
|
|
1448
|
+
required = false,
|
|
1449
|
+
disabled = false,
|
|
1450
|
+
children,
|
|
1451
|
+
className
|
|
1452
|
+
} = _b, props = __objRest(_b, [
|
|
1453
|
+
"controlId",
|
|
1454
|
+
"label",
|
|
1455
|
+
"hideLabel",
|
|
1456
|
+
"helperText",
|
|
1457
|
+
"error",
|
|
1458
|
+
"required",
|
|
1459
|
+
"disabled",
|
|
1460
|
+
"children",
|
|
1461
|
+
"className"
|
|
1462
|
+
]);
|
|
1463
|
+
const generatedId = useId2();
|
|
1464
|
+
const id = controlId != null ? controlId : generatedId;
|
|
1465
|
+
const descriptionId = helperText && !error ? `${id}-description` : void 0;
|
|
1466
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
1467
|
+
const controlProps = {
|
|
1468
|
+
id,
|
|
1469
|
+
"aria-describedby": errorId != null ? errorId : descriptionId,
|
|
1470
|
+
"aria-errormessage": errorId,
|
|
1471
|
+
"aria-invalid": error ? true : void 0
|
|
1472
|
+
};
|
|
1473
|
+
return /* @__PURE__ */ jsxs11("div", __spreadProps(__spreadValues({ className: cn("ph-field", className) }, props), { children: [
|
|
1474
|
+
label ? /* @__PURE__ */ jsxs11(
|
|
1475
|
+
"label",
|
|
1476
|
+
{
|
|
1477
|
+
htmlFor: id,
|
|
1478
|
+
className: cn("ph-label", hideLabel && "sr-only", disabled && "opacity-50"),
|
|
1479
|
+
children: [
|
|
1480
|
+
label,
|
|
1481
|
+
required ? /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: " *" }) : null
|
|
1482
|
+
]
|
|
1483
|
+
}
|
|
1484
|
+
) : null,
|
|
1485
|
+
typeof children === "function" ? children(controlProps) : children,
|
|
1486
|
+
descriptionId ? /* @__PURE__ */ jsx14("p", { id: descriptionId, className: "mt-1 text-xs text-ph-subtle", children: helperText }) : null,
|
|
1487
|
+
errorId ? /* @__PURE__ */ jsx14("p", { id: errorId, className: "mt-1 text-xs font-medium text-ph-danger", children: error }) : null
|
|
1488
|
+
] }));
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
// src/components/ui/Input.tsx
|
|
1492
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1493
|
+
var sizeMap2 = {
|
|
1494
|
+
sm: "ph-input-sm",
|
|
1495
|
+
md: "",
|
|
1496
|
+
lg: "ph-input-lg"
|
|
1497
|
+
};
|
|
1498
|
+
function joinIds(...ids) {
|
|
1499
|
+
const value = ids.filter(Boolean).join(" ");
|
|
1500
|
+
return value || void 0;
|
|
1501
|
+
}
|
|
1502
|
+
var Input = forwardRef8(function Input2(_a, ref) {
|
|
1503
|
+
var _b = _a, {
|
|
1504
|
+
id: idProp,
|
|
1505
|
+
label,
|
|
1506
|
+
hideLabel = false,
|
|
1507
|
+
error,
|
|
1508
|
+
helperText,
|
|
1509
|
+
size = "md",
|
|
1510
|
+
variant = "default",
|
|
1511
|
+
type = "text",
|
|
1512
|
+
className,
|
|
1513
|
+
wrapperClassName,
|
|
1514
|
+
disabled,
|
|
1515
|
+
required,
|
|
1516
|
+
"aria-describedby": ariaDescribedBy
|
|
1517
|
+
} = _b, props = __objRest(_b, [
|
|
1518
|
+
"id",
|
|
1519
|
+
"label",
|
|
1520
|
+
"hideLabel",
|
|
1521
|
+
"error",
|
|
1522
|
+
"helperText",
|
|
1523
|
+
"size",
|
|
1524
|
+
"variant",
|
|
1525
|
+
"type",
|
|
1526
|
+
"className",
|
|
1527
|
+
"wrapperClassName",
|
|
1528
|
+
"disabled",
|
|
1529
|
+
"required",
|
|
1530
|
+
"aria-describedby"
|
|
1531
|
+
]);
|
|
1532
|
+
const autoId = useId3();
|
|
1533
|
+
const id = idProp != null ? idProp : autoId;
|
|
1534
|
+
const hasError = Boolean(error);
|
|
1535
|
+
const isPassword = type === "password";
|
|
1536
|
+
const [revealed, setRevealed] = useState(false);
|
|
1537
|
+
return /* @__PURE__ */ jsx15(
|
|
1538
|
+
FormField,
|
|
1539
|
+
{
|
|
1540
|
+
controlId: id,
|
|
1541
|
+
label,
|
|
1542
|
+
hideLabel,
|
|
1543
|
+
helperText,
|
|
1544
|
+
error,
|
|
1545
|
+
required,
|
|
1546
|
+
disabled,
|
|
1547
|
+
className: wrapperClassName,
|
|
1548
|
+
children: (fieldProps) => /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
|
|
1549
|
+
/* @__PURE__ */ jsx15(
|
|
1550
|
+
"input",
|
|
1551
|
+
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1552
|
+
ref,
|
|
1553
|
+
type: isPassword && revealed ? "text" : type,
|
|
1554
|
+
disabled,
|
|
1555
|
+
required,
|
|
1556
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1557
|
+
className: cn(
|
|
1558
|
+
"ph-input w-full",
|
|
1559
|
+
isPassword && "pr-10",
|
|
1560
|
+
sizeMap2[size],
|
|
1561
|
+
variant === "ghost" && "ph-input-ghost",
|
|
1562
|
+
hasError && "ph-input-error",
|
|
1563
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1564
|
+
className
|
|
1565
|
+
)
|
|
1566
|
+
}), props)
|
|
1567
|
+
),
|
|
1568
|
+
isPassword ? /* @__PURE__ */ jsx15(
|
|
1569
|
+
"button",
|
|
1570
|
+
{
|
|
1571
|
+
type: "button",
|
|
1572
|
+
onClick: () => setRevealed((current) => !current),
|
|
1573
|
+
"aria-label": revealed ? "Hide password" : "Show password",
|
|
1574
|
+
"aria-pressed": revealed,
|
|
1575
|
+
disabled,
|
|
1576
|
+
className: "absolute inset-y-0 right-0 flex w-10 items-center justify-center rounded-r-[var(--ph-radius-control)] text-ph-mutedtext transition-colors hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus disabled:opacity-40",
|
|
1577
|
+
children: revealed ? /* @__PURE__ */ jsx15(EyeClosed, { className: "h-4 w-4", "aria-hidden": true }) : /* @__PURE__ */ jsx15(Eye, { className: "h-4 w-4", "aria-hidden": true })
|
|
1578
|
+
}
|
|
1579
|
+
) : null
|
|
1580
|
+
] })
|
|
1581
|
+
}
|
|
1582
|
+
);
|
|
1583
|
+
});
|
|
1584
|
+
Input.displayName = "Input";
|
|
1585
|
+
var Select = forwardRef8(function Select2(_a, ref) {
|
|
1586
|
+
var _b = _a, {
|
|
1587
|
+
id: idProp,
|
|
1588
|
+
label,
|
|
1589
|
+
hideLabel = false,
|
|
1590
|
+
error,
|
|
1591
|
+
helperText,
|
|
1592
|
+
size = "md",
|
|
1593
|
+
className,
|
|
1594
|
+
wrapperClassName,
|
|
1595
|
+
disabled,
|
|
1596
|
+
children,
|
|
1597
|
+
required,
|
|
1598
|
+
"aria-describedby": ariaDescribedBy
|
|
1599
|
+
} = _b, props = __objRest(_b, [
|
|
1600
|
+
"id",
|
|
1601
|
+
"label",
|
|
1602
|
+
"hideLabel",
|
|
1603
|
+
"error",
|
|
1604
|
+
"helperText",
|
|
1605
|
+
"size",
|
|
1606
|
+
"className",
|
|
1607
|
+
"wrapperClassName",
|
|
1608
|
+
"disabled",
|
|
1609
|
+
"children",
|
|
1610
|
+
"required",
|
|
1611
|
+
"aria-describedby"
|
|
1612
|
+
]);
|
|
1613
|
+
const autoId = useId3();
|
|
1614
|
+
const id = idProp != null ? idProp : autoId;
|
|
1615
|
+
const hasError = Boolean(error);
|
|
1616
|
+
return /* @__PURE__ */ jsx15(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ jsx15(
|
|
1617
|
+
"select",
|
|
1618
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1619
|
+
ref,
|
|
1620
|
+
disabled,
|
|
1621
|
+
required,
|
|
1622
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1623
|
+
className: cn(
|
|
1624
|
+
"ph-select w-full",
|
|
1625
|
+
sizeMap2[size],
|
|
1626
|
+
hasError && "ph-input-error",
|
|
1627
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1628
|
+
className
|
|
1629
|
+
)
|
|
1630
|
+
}), props), {
|
|
1631
|
+
children
|
|
1632
|
+
})
|
|
1633
|
+
) });
|
|
1634
|
+
});
|
|
1635
|
+
Select.displayName = "Select";
|
|
1636
|
+
var Textarea = forwardRef8(function Textarea2(_a, ref) {
|
|
1637
|
+
var _b = _a, {
|
|
1638
|
+
id: idProp,
|
|
1639
|
+
label,
|
|
1640
|
+
hideLabel = false,
|
|
1641
|
+
error,
|
|
1642
|
+
helperText,
|
|
1643
|
+
size = "md",
|
|
1644
|
+
className,
|
|
1645
|
+
wrapperClassName,
|
|
1646
|
+
disabled,
|
|
1647
|
+
required,
|
|
1648
|
+
"aria-describedby": ariaDescribedBy
|
|
1649
|
+
} = _b, props = __objRest(_b, [
|
|
1650
|
+
"id",
|
|
1651
|
+
"label",
|
|
1652
|
+
"hideLabel",
|
|
1653
|
+
"error",
|
|
1654
|
+
"helperText",
|
|
1655
|
+
"size",
|
|
1656
|
+
"className",
|
|
1657
|
+
"wrapperClassName",
|
|
1658
|
+
"disabled",
|
|
1659
|
+
"required",
|
|
1660
|
+
"aria-describedby"
|
|
1661
|
+
]);
|
|
1662
|
+
const autoId = useId3();
|
|
1663
|
+
const id = idProp != null ? idProp : autoId;
|
|
1664
|
+
const hasError = Boolean(error);
|
|
1665
|
+
return /* @__PURE__ */ jsx15(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ jsx15(
|
|
1666
|
+
"textarea",
|
|
1667
|
+
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1668
|
+
ref,
|
|
1669
|
+
disabled,
|
|
1670
|
+
required,
|
|
1671
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1672
|
+
className: cn(
|
|
1673
|
+
"ph-textarea w-full",
|
|
1674
|
+
sizeMap2[size],
|
|
1675
|
+
hasError && "ph-input-error",
|
|
1676
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1677
|
+
className
|
|
1678
|
+
)
|
|
1679
|
+
}), props)
|
|
1680
|
+
) });
|
|
1681
|
+
});
|
|
1682
|
+
Textarea.displayName = "Textarea";
|
|
1683
|
+
var Checkbox = forwardRef8(function Checkbox2(_a, ref) {
|
|
1684
|
+
var _b = _a, {
|
|
1685
|
+
id: idProp,
|
|
1686
|
+
label,
|
|
1687
|
+
error,
|
|
1688
|
+
helperText,
|
|
1689
|
+
className,
|
|
1690
|
+
wrapperClassName,
|
|
1691
|
+
disabled,
|
|
1692
|
+
"aria-describedby": ariaDescribedBy
|
|
1693
|
+
} = _b, props = __objRest(_b, [
|
|
1694
|
+
"id",
|
|
1695
|
+
"label",
|
|
1696
|
+
"error",
|
|
1697
|
+
"helperText",
|
|
1698
|
+
"className",
|
|
1699
|
+
"wrapperClassName",
|
|
1700
|
+
"disabled",
|
|
1701
|
+
"aria-describedby"
|
|
1702
|
+
]);
|
|
1703
|
+
const autoId = useId3();
|
|
1704
|
+
const id = idProp != null ? idProp : autoId;
|
|
1705
|
+
const hasError = Boolean(error);
|
|
1706
|
+
const descriptionId = helperText && !hasError ? `${id}-description` : void 0;
|
|
1707
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
1708
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn("ph-control-row", wrapperClassName), children: [
|
|
1709
|
+
/* @__PURE__ */ jsxs12("span", { className: "ph-checkbox-wrap", children: [
|
|
1710
|
+
/* @__PURE__ */ jsx15(
|
|
1711
|
+
"input",
|
|
1712
|
+
__spreadValues({
|
|
1713
|
+
ref,
|
|
1714
|
+
id,
|
|
1715
|
+
type: "checkbox",
|
|
1716
|
+
disabled,
|
|
1717
|
+
"aria-invalid": hasError || void 0,
|
|
1718
|
+
"aria-describedby": joinIds(ariaDescribedBy, descriptionId, errorId),
|
|
1719
|
+
"aria-errormessage": errorId,
|
|
1720
|
+
className: cn(
|
|
1721
|
+
"ph-checkbox",
|
|
1722
|
+
hasError && "border-ph-danger",
|
|
1723
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1724
|
+
className
|
|
1725
|
+
)
|
|
1726
|
+
}, props)
|
|
1727
|
+
),
|
|
1728
|
+
/* @__PURE__ */ jsx15(IconCheck, { className: "ph-checkbox-icon", "aria-hidden": true })
|
|
1729
|
+
] }),
|
|
1730
|
+
/* @__PURE__ */ jsxs12("div", { className: "ph-control-copy", children: [
|
|
1731
|
+
/* @__PURE__ */ jsx15("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label }),
|
|
1732
|
+
descriptionId ? /* @__PURE__ */ jsx15("p", { id: descriptionId, className: "text-xs text-ph-subtle", children: helperText }) : null,
|
|
1733
|
+
errorId ? /* @__PURE__ */ jsx15("p", { id: errorId, className: "text-xs font-medium text-ph-danger", children: error }) : null
|
|
1734
|
+
] })
|
|
1735
|
+
] });
|
|
1736
|
+
});
|
|
1737
|
+
Checkbox.displayName = "Checkbox";
|
|
1738
|
+
var Radio = forwardRef8(function Radio2(_a, ref) {
|
|
1739
|
+
var _b = _a, {
|
|
1740
|
+
id: idProp,
|
|
1741
|
+
label,
|
|
1742
|
+
className,
|
|
1743
|
+
wrapperClassName,
|
|
1744
|
+
disabled
|
|
1745
|
+
} = _b, props = __objRest(_b, [
|
|
1746
|
+
"id",
|
|
1747
|
+
"label",
|
|
1748
|
+
"className",
|
|
1749
|
+
"wrapperClassName",
|
|
1750
|
+
"disabled"
|
|
1751
|
+
]);
|
|
1752
|
+
const autoId = useId3();
|
|
1753
|
+
const id = idProp != null ? idProp : autoId;
|
|
1754
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn("ph-control-row", wrapperClassName, disabled && "opacity-60"), children: [
|
|
1755
|
+
/* @__PURE__ */ jsx15(
|
|
1756
|
+
"input",
|
|
1757
|
+
__spreadValues({
|
|
1758
|
+
ref,
|
|
1759
|
+
id,
|
|
1760
|
+
type: "radio",
|
|
1761
|
+
disabled,
|
|
1762
|
+
className: cn("ph-radio", disabled && "cursor-not-allowed", className)
|
|
1763
|
+
}, props)
|
|
1764
|
+
),
|
|
1765
|
+
/* @__PURE__ */ jsx15("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label })
|
|
1766
|
+
] });
|
|
1767
|
+
});
|
|
1768
|
+
Radio.displayName = "Radio";
|
|
1769
|
+
var Toggle = forwardRef8(function Toggle2(_a, ref) {
|
|
1770
|
+
var _b = _a, {
|
|
1771
|
+
id: idProp,
|
|
1772
|
+
label,
|
|
1773
|
+
className,
|
|
1774
|
+
wrapperClassName,
|
|
1775
|
+
disabled
|
|
1776
|
+
} = _b, props = __objRest(_b, [
|
|
1777
|
+
"id",
|
|
1778
|
+
"label",
|
|
1779
|
+
"className",
|
|
1780
|
+
"wrapperClassName",
|
|
1781
|
+
"disabled"
|
|
1782
|
+
]);
|
|
1783
|
+
const autoId = useId3();
|
|
1784
|
+
const id = idProp != null ? idProp : autoId;
|
|
1785
|
+
return /* @__PURE__ */ jsxs12("label", { className: cn("ph-control-row-between", wrapperClassName, disabled && "opacity-60"), children: [
|
|
1786
|
+
/* @__PURE__ */ jsx15("span", { className: disabled ? "opacity-60" : void 0, children: label }),
|
|
1787
|
+
/* @__PURE__ */ jsx15(
|
|
1788
|
+
"input",
|
|
1789
|
+
__spreadValues({
|
|
1790
|
+
ref,
|
|
1791
|
+
id,
|
|
1792
|
+
type: "checkbox",
|
|
1793
|
+
role: "switch",
|
|
1794
|
+
disabled,
|
|
1795
|
+
className: cn("ph-toggle", disabled && "cursor-not-allowed", className)
|
|
1796
|
+
}, props)
|
|
1797
|
+
)
|
|
1798
|
+
] });
|
|
1799
|
+
});
|
|
1800
|
+
Toggle.displayName = "Toggle";
|
|
1801
|
+
var Range = forwardRef8(function Range2(_a, ref) {
|
|
1802
|
+
var _b = _a, {
|
|
1803
|
+
id: idProp,
|
|
1804
|
+
label,
|
|
1805
|
+
minLabel,
|
|
1806
|
+
maxLabel,
|
|
1807
|
+
valueLabel,
|
|
1808
|
+
wrapperClassName,
|
|
1809
|
+
className
|
|
1810
|
+
} = _b, props = __objRest(_b, [
|
|
1811
|
+
"id",
|
|
1812
|
+
"label",
|
|
1813
|
+
"minLabel",
|
|
1814
|
+
"maxLabel",
|
|
1815
|
+
"valueLabel",
|
|
1816
|
+
"wrapperClassName",
|
|
1817
|
+
"className"
|
|
1818
|
+
]);
|
|
1819
|
+
const autoId = useId3();
|
|
1820
|
+
const id = idProp != null ? idProp : autoId;
|
|
1821
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
1822
|
+
label && /* @__PURE__ */ jsx15("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
1823
|
+
/* @__PURE__ */ jsx15("input", __spreadValues({ ref, id, type: "range", className: cn("ph-range", className) }, props)),
|
|
1824
|
+
(minLabel || valueLabel || maxLabel) && /* @__PURE__ */ jsxs12("div", { className: "flex justify-between text-xs text-ph-mutedtext", children: [
|
|
1825
|
+
/* @__PURE__ */ jsx15("span", { children: minLabel }),
|
|
1826
|
+
/* @__PURE__ */ jsx15("span", { children: valueLabel }),
|
|
1827
|
+
/* @__PURE__ */ jsx15("span", { children: maxLabel })
|
|
1828
|
+
] })
|
|
1829
|
+
] });
|
|
1830
|
+
});
|
|
1831
|
+
Range.displayName = "Range";
|
|
1832
|
+
var FileUpload = forwardRef8(function FileUpload2(_a, ref) {
|
|
1833
|
+
var _b = _a, {
|
|
1834
|
+
id: idProp,
|
|
1835
|
+
label,
|
|
1836
|
+
prompt = "Drop file or browse",
|
|
1837
|
+
wrapperClassName,
|
|
1838
|
+
className
|
|
1839
|
+
} = _b, props = __objRest(_b, [
|
|
1840
|
+
"id",
|
|
1841
|
+
"label",
|
|
1842
|
+
"prompt",
|
|
1843
|
+
"wrapperClassName",
|
|
1844
|
+
"className"
|
|
1845
|
+
]);
|
|
1846
|
+
const autoId = useId3();
|
|
1847
|
+
const id = idProp != null ? idProp : autoId;
|
|
1848
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
1849
|
+
label && /* @__PURE__ */ jsx15("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
1850
|
+
/* @__PURE__ */ jsxs12("label", { htmlFor: id, className: "ph-file-upload", children: [
|
|
1851
|
+
/* @__PURE__ */ jsx15("input", __spreadValues({ ref, id, type: "file", className: cn("sr-only", className) }, props)),
|
|
1852
|
+
prompt
|
|
1853
|
+
] })
|
|
1854
|
+
] });
|
|
1855
|
+
});
|
|
1856
|
+
FileUpload.displayName = "FileUpload";
|
|
1857
|
+
|
|
1858
|
+
// src/components/ui/Modal.tsx
|
|
1859
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
1860
|
+
import { useRef } from "react";
|
|
1861
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1862
|
+
var sizeMap3 = {
|
|
1863
|
+
sm: "max-w-sm",
|
|
1864
|
+
md: "max-w-lg",
|
|
1865
|
+
lg: "max-w-2xl",
|
|
1866
|
+
xl: "max-w-4xl",
|
|
1867
|
+
full: "max-w-none"
|
|
1868
|
+
};
|
|
1869
|
+
function Modal({
|
|
1870
|
+
open = false,
|
|
1871
|
+
onClose,
|
|
1872
|
+
title,
|
|
1873
|
+
description,
|
|
1874
|
+
children,
|
|
1875
|
+
footer,
|
|
1876
|
+
size = "md",
|
|
1877
|
+
className,
|
|
1878
|
+
bodyClassName,
|
|
1879
|
+
customLayout = false,
|
|
1880
|
+
showCloseButton = true,
|
|
1881
|
+
closeOnOutsideClick = true,
|
|
1882
|
+
closeOnEscape = true,
|
|
1883
|
+
dataTest,
|
|
1884
|
+
panelDataTest,
|
|
1885
|
+
zIndex,
|
|
1886
|
+
id,
|
|
1887
|
+
"aria-label": ariaLabel,
|
|
1888
|
+
"aria-labelledby": ariaLabelledBy
|
|
1889
|
+
}) {
|
|
1890
|
+
const canDismiss = Boolean(onClose);
|
|
1891
|
+
const restoreFocusRef = useRef(null);
|
|
1892
|
+
return /* @__PURE__ */ jsx16(
|
|
1893
|
+
Dialog.Root,
|
|
1894
|
+
{
|
|
1895
|
+
open,
|
|
1896
|
+
onOpenChange: (nextOpen) => {
|
|
1897
|
+
if (!nextOpen) onClose == null ? void 0 : onClose();
|
|
1898
|
+
},
|
|
1899
|
+
children: /* @__PURE__ */ jsxs13(Dialog.Portal, { children: [
|
|
1900
|
+
/* @__PURE__ */ jsx16(
|
|
1901
|
+
Dialog.Overlay,
|
|
1902
|
+
{
|
|
1903
|
+
"data-test": dataTest,
|
|
1904
|
+
className: "ph-modal-overlay",
|
|
1905
|
+
style: zIndex ? { zIndex } : void 0
|
|
1906
|
+
}
|
|
1907
|
+
),
|
|
1908
|
+
/* @__PURE__ */ jsx16(
|
|
1909
|
+
Dialog.Content,
|
|
1910
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({
|
|
1911
|
+
id,
|
|
1912
|
+
"data-test": panelDataTest,
|
|
1913
|
+
className: cn("ph-modal-panel", sizeMap3[size], className)
|
|
1914
|
+
}, ariaLabel ? { "aria-label": ariaLabel } : {}), ariaLabelledBy ? { "aria-labelledby": ariaLabelledBy } : {}), {
|
|
1915
|
+
style: zIndex ? { zIndex } : void 0
|
|
1916
|
+
}), description ? {} : { "aria-describedby": void 0 }), {
|
|
1917
|
+
onOpenAutoFocus: () => {
|
|
1918
|
+
restoreFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
1919
|
+
},
|
|
1920
|
+
onCloseAutoFocus: (event) => {
|
|
1921
|
+
var _a;
|
|
1922
|
+
event.preventDefault();
|
|
1923
|
+
(_a = restoreFocusRef.current) == null ? void 0 : _a.focus();
|
|
1924
|
+
},
|
|
1925
|
+
onEscapeKeyDown: (event) => {
|
|
1926
|
+
if (!canDismiss || !closeOnEscape) event.preventDefault();
|
|
1927
|
+
},
|
|
1928
|
+
onPointerDownOutside: (event) => {
|
|
1929
|
+
if (!canDismiss || !closeOnOutsideClick) event.preventDefault();
|
|
1930
|
+
},
|
|
1931
|
+
children: customLayout ? /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1932
|
+
/* @__PURE__ */ jsx16(Dialog.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
1933
|
+
children
|
|
1934
|
+
] }) : /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1935
|
+
title ? null : /* @__PURE__ */ jsx16(Dialog.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
1936
|
+
title || description || showCloseButton && canDismiss ? /* @__PURE__ */ jsxs13("header", { className: "ph-modal-header", children: [
|
|
1937
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
|
|
1938
|
+
title ? /* @__PURE__ */ jsx16(Dialog.Title, { className: "text-lg font-bold text-ph-ink", children: title }) : null,
|
|
1939
|
+
description ? /* @__PURE__ */ jsx16(Dialog.Description, { className: "mt-1 text-sm text-ph-subtle", children: description }) : null
|
|
1940
|
+
] }),
|
|
1941
|
+
showCloseButton && canDismiss ? /* @__PURE__ */ jsx16(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
1942
|
+
"button",
|
|
1943
|
+
{
|
|
1944
|
+
type: "button",
|
|
1945
|
+
className: "ph-modal-close",
|
|
1946
|
+
"aria-label": "Close dialog",
|
|
1947
|
+
children: /* @__PURE__ */ jsx16(IconClose, { className: "h-5 w-5", "aria-hidden": true })
|
|
1948
|
+
}
|
|
1949
|
+
) }) : null
|
|
1950
|
+
] }) : null,
|
|
1951
|
+
/* @__PURE__ */ jsx16("div", { className: cn("ph-modal-body", bodyClassName), children }),
|
|
1952
|
+
footer ? /* @__PURE__ */ jsx16("div", { className: "ph-modal-footer", children: footer }) : null
|
|
1953
|
+
] })
|
|
1954
|
+
})
|
|
1955
|
+
)
|
|
1956
|
+
] })
|
|
1957
|
+
}
|
|
1958
|
+
);
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
// src/components/ui/Panel.tsx
|
|
1962
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1963
|
+
function Panel(_a) {
|
|
1964
|
+
var _b = _a, { title, description, children, className } = _b, props = __objRest(_b, ["title", "description", "children", "className"]);
|
|
1965
|
+
return /* @__PURE__ */ jsxs14("div", __spreadProps(__spreadValues({ className: cn("ph-panel", className) }, props), { children: [
|
|
1966
|
+
title && /* @__PURE__ */ jsx17("h3", { className: "text-sm font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
|
|
1967
|
+
description && /* @__PURE__ */ jsx17("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
1968
|
+
children
|
|
1969
|
+
] }));
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
// src/components/ui/SearchInput.tsx
|
|
1973
|
+
import { useId as useId4 } from "react";
|
|
1974
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1975
|
+
function SearchInput(_a) {
|
|
1976
|
+
var _b = _a, {
|
|
1977
|
+
id: idProp,
|
|
1978
|
+
label = "Search",
|
|
1979
|
+
hideLabel = false,
|
|
1980
|
+
shortcut,
|
|
1981
|
+
density = "default",
|
|
1982
|
+
className,
|
|
1983
|
+
wrapperClassName,
|
|
1984
|
+
placeholder
|
|
1985
|
+
} = _b, props = __objRest(_b, [
|
|
1986
|
+
"id",
|
|
1987
|
+
"label",
|
|
1988
|
+
"hideLabel",
|
|
1989
|
+
"shortcut",
|
|
1990
|
+
"density",
|
|
1991
|
+
"className",
|
|
1992
|
+
"wrapperClassName",
|
|
1993
|
+
"placeholder"
|
|
1994
|
+
]);
|
|
1995
|
+
const autoId = useId4();
|
|
1996
|
+
const id = idProp != null ? idProp : autoId;
|
|
1997
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn("relative", wrapperClassName), children: [
|
|
1998
|
+
/* @__PURE__ */ jsx18("label", { htmlFor: id, className: hideLabel ? "sr-only" : "ph-label mb-1.5 block", children: label }),
|
|
1999
|
+
/* @__PURE__ */ jsxs15("div", { className: "relative", children: [
|
|
2000
|
+
shortcut != null ? /* @__PURE__ */ jsx18(
|
|
2001
|
+
"span",
|
|
2002
|
+
{
|
|
2003
|
+
className: "ph-shortcut pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-xs",
|
|
2004
|
+
"aria-hidden": true,
|
|
2005
|
+
children: shortcut
|
|
2006
|
+
}
|
|
2007
|
+
) : null,
|
|
2008
|
+
/* @__PURE__ */ jsx18(
|
|
2009
|
+
"input",
|
|
2010
|
+
__spreadValues({
|
|
2011
|
+
id,
|
|
2012
|
+
type: "search",
|
|
2013
|
+
placeholder,
|
|
2014
|
+
"aria-label": hideLabel ? label : void 0,
|
|
2015
|
+
className: cn(
|
|
2016
|
+
"ph-input w-full",
|
|
2017
|
+
density === "compact" && "max-w-xs !min-h-[2rem] py-1.5 text-sm",
|
|
2018
|
+
shortcut != null && "pl-[3.25rem]",
|
|
2019
|
+
className
|
|
2020
|
+
)
|
|
2021
|
+
}, props)
|
|
2022
|
+
)
|
|
2023
|
+
] })
|
|
2024
|
+
] });
|
|
2025
|
+
}
|
|
2026
|
+
function SearchGroup(_a) {
|
|
2027
|
+
var _b = _a, {
|
|
2028
|
+
id: idProp,
|
|
2029
|
+
label = "Search records",
|
|
2030
|
+
submitLabel = "Search",
|
|
2031
|
+
placeholder = "Persons, actions, flags\u2026",
|
|
2032
|
+
wrapperClassName,
|
|
2033
|
+
className
|
|
2034
|
+
} = _b, props = __objRest(_b, [
|
|
2035
|
+
"id",
|
|
2036
|
+
"label",
|
|
2037
|
+
"submitLabel",
|
|
2038
|
+
"placeholder",
|
|
2039
|
+
"wrapperClassName",
|
|
2040
|
+
"className"
|
|
2041
|
+
]);
|
|
2042
|
+
const autoId = useId4();
|
|
2043
|
+
const id = idProp != null ? idProp : autoId;
|
|
2044
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2045
|
+
/* @__PURE__ */ jsx18("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
2046
|
+
/* @__PURE__ */ jsxs15("div", { className: "ph-search-group flex w-full max-w-lg min-h-[2.3125rem] items-stretch divide-x divide-ph-border", children: [
|
|
2047
|
+
/* @__PURE__ */ jsx18(
|
|
2048
|
+
"input",
|
|
2049
|
+
__spreadValues({
|
|
2050
|
+
id,
|
|
2051
|
+
type: "search",
|
|
2052
|
+
placeholder,
|
|
2053
|
+
className: cn("ph-input ph-input-group-field min-w-0 flex-1", className)
|
|
2054
|
+
}, props)
|
|
2055
|
+
),
|
|
2056
|
+
/* @__PURE__ */ jsx18(
|
|
2057
|
+
Button,
|
|
2058
|
+
{
|
|
2059
|
+
type: "submit",
|
|
2060
|
+
variant: "primary",
|
|
2061
|
+
icon: /* @__PURE__ */ jsx18(IconSearch, { className: "h-4 w-4", "aria-hidden": true }),
|
|
2062
|
+
className: "ph-search-group__submit",
|
|
2063
|
+
"aria-label": submitLabel
|
|
2064
|
+
}
|
|
2065
|
+
)
|
|
2066
|
+
] })
|
|
2067
|
+
] });
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
// src/components/ui/Table.tsx
|
|
2071
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2072
|
+
function Table({
|
|
2073
|
+
data,
|
|
2074
|
+
columns,
|
|
2075
|
+
zebra = false,
|
|
2076
|
+
compact = false,
|
|
2077
|
+
ribbon = false,
|
|
2078
|
+
getRowStyle,
|
|
2079
|
+
getRowKey,
|
|
2080
|
+
className,
|
|
2081
|
+
caption
|
|
2082
|
+
}) {
|
|
2083
|
+
return /* @__PURE__ */ jsx19(
|
|
2084
|
+
"div",
|
|
2085
|
+
{
|
|
2086
|
+
className: cn("ph-table-wrap", compact && "ph-table-compact", className),
|
|
2087
|
+
tabIndex: 0,
|
|
2088
|
+
children: /* @__PURE__ */ jsxs16("table", { className: cn("ph-table", zebra && "ph-table-zebra", ribbon && "ph-table--ribbon"), children: [
|
|
2089
|
+
caption && /* @__PURE__ */ jsx19("caption", { className: "sr-only", children: caption }),
|
|
2090
|
+
/* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsx19("tr", { children: columns.map((col) => /* @__PURE__ */ jsx19("th", { className: col.className, children: col.header }, col.key)) }) }),
|
|
2091
|
+
/* @__PURE__ */ jsx19("tbody", { children: data.map((row, i) => {
|
|
2092
|
+
var _a;
|
|
2093
|
+
return /* @__PURE__ */ jsx19("tr", { style: getRowStyle == null ? void 0 : getRowStyle(row), children: columns.map((col) => /* @__PURE__ */ jsx19("td", { className: col.className, children: col.cell(row) }, col.key)) }, (_a = getRowKey == null ? void 0 : getRowKey(row, i)) != null ? _a : i);
|
|
2094
|
+
}) })
|
|
2095
|
+
] })
|
|
2096
|
+
}
|
|
2097
|
+
);
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
// src/components/ui/Stat.tsx
|
|
2101
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2102
|
+
var toneMap = {
|
|
2103
|
+
default: "text-ph-ink",
|
|
2104
|
+
brand: "text-ph-brand",
|
|
2105
|
+
blue: "text-ph-blue",
|
|
2106
|
+
purple: "text-ph-purple",
|
|
2107
|
+
warning: "text-ph-warning"
|
|
2108
|
+
};
|
|
2109
|
+
var statMap = {
|
|
2110
|
+
default: "",
|
|
2111
|
+
brand: "",
|
|
2112
|
+
blue: "",
|
|
2113
|
+
purple: "",
|
|
2114
|
+
warning: "border-[color:color-mix(in_srgb,var(--ph-warning)_30%,var(--ph-border))] bg-[color:color-mix(in_srgb,var(--ph-warning)_10%,var(--ph-surface))]"
|
|
2115
|
+
};
|
|
2116
|
+
function Stat(_a) {
|
|
2117
|
+
var _b = _a, { icon, label, value, footer, tone = "default", className } = _b, props = __objRest(_b, ["icon", "label", "value", "footer", "tone", "className"]);
|
|
2118
|
+
return /* @__PURE__ */ jsxs17("article", __spreadProps(__spreadValues({ className: cn("ph-stat", statMap[tone], className) }, props), { children: [
|
|
2119
|
+
icon && /* @__PURE__ */ jsx20("div", { className: cn("mb-2 h-7 w-7", toneMap[tone]), children: icon }),
|
|
2120
|
+
/* @__PURE__ */ jsx20("div", { className: cn("ph-stat-label", tone === "warning" && toneMap[tone]), children: label }),
|
|
2121
|
+
/* @__PURE__ */ jsx20("div", { className: cn("ph-stat-val", toneMap[tone]), children: value }),
|
|
2122
|
+
footer && /* @__PURE__ */ jsx20("p", { className: "text-xs text-ph-subtle", children: footer })
|
|
2123
|
+
] }));
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
// src/components/ui/ThemeDomSync.tsx
|
|
2127
|
+
import { useLayoutEffect } from "react";
|
|
2128
|
+
|
|
2129
|
+
// src/themes/registry.ts
|
|
2130
|
+
var DEFAULT_THEME_ID = "hedgehog-light";
|
|
2131
|
+
var THEMES = [
|
|
2132
|
+
{
|
|
2133
|
+
id: "hedgehog-light",
|
|
2134
|
+
name: "Hedgehog Light",
|
|
2135
|
+
description: "Default Quill warm greys and orange Lemon chrome.",
|
|
2136
|
+
colorScheme: "light",
|
|
2137
|
+
group: "Hedgehog"
|
|
2138
|
+
},
|
|
2139
|
+
{
|
|
2140
|
+
id: "hedgehog-dark",
|
|
2141
|
+
name: "Hedgehog Dark",
|
|
2142
|
+
description: "Dark app shell with HedgeHog orange accents.",
|
|
2143
|
+
colorScheme: "dark",
|
|
2144
|
+
group: "Hedgehog"
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
id: "note",
|
|
2148
|
+
name: "Note Light",
|
|
2149
|
+
description: "OneNote purple on lavender-white chrome.",
|
|
2150
|
+
colorScheme: "light",
|
|
2151
|
+
group: "Note"
|
|
2152
|
+
},
|
|
2153
|
+
{
|
|
2154
|
+
id: "note-dark",
|
|
2155
|
+
name: "Note Dark",
|
|
2156
|
+
description: "Office-dark chrome with OneNote purple accents.",
|
|
2157
|
+
colorScheme: "dark",
|
|
2158
|
+
group: "Note"
|
|
2159
|
+
},
|
|
2160
|
+
{
|
|
2161
|
+
id: "turtletime",
|
|
2162
|
+
name: "TurtleTime Light",
|
|
2163
|
+
description: "Turtle mascot palette \u2014 shell orange, leaf green, and warm cream.",
|
|
2164
|
+
colorScheme: "light",
|
|
2165
|
+
group: "TurtleTime"
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
id: "turtletime-dark",
|
|
2169
|
+
name: "TurtleTime Dark",
|
|
2170
|
+
description: "TurtleTime after dusk \u2014 dark olive shell with bright orange clock accents.",
|
|
2171
|
+
colorScheme: "dark",
|
|
2172
|
+
group: "TurtleTime"
|
|
2173
|
+
},
|
|
2174
|
+
{
|
|
2175
|
+
id: "rosepine-light",
|
|
2176
|
+
name: "Ros\xE9 Pine Light",
|
|
2177
|
+
description: "Ros\xE9 Pine Dawn \u2014 warm paper base with muted iris accents.",
|
|
2178
|
+
colorScheme: "light",
|
|
2179
|
+
group: "Ros\xE9 Pine"
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
id: "rosepine-dark",
|
|
2183
|
+
name: "Ros\xE9 Pine Dark",
|
|
2184
|
+
description: "Ros\xE9 Pine Main \u2014 moonlit base with iris and love accents.",
|
|
2185
|
+
colorScheme: "dark",
|
|
2186
|
+
group: "Ros\xE9 Pine"
|
|
2187
|
+
},
|
|
2188
|
+
{
|
|
2189
|
+
id: "kraken-light",
|
|
2190
|
+
name: "Kraken Light",
|
|
2191
|
+
description: "Medium-inspired warm paper, editorial black actions, and publication yellow.",
|
|
2192
|
+
colorScheme: "light",
|
|
2193
|
+
group: "Kraken"
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
id: "kraken-dark",
|
|
2197
|
+
name: "Kraken Dark",
|
|
2198
|
+
description: "Medium-inspired night reading canvas with white actions and publication yellow.",
|
|
2199
|
+
colorScheme: "dark",
|
|
2200
|
+
group: "Kraken"
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
id: "deepsea-light",
|
|
2204
|
+
name: "Tokyo Day",
|
|
2205
|
+
description: "Tokyo Night Day \u2014 soft bluish greys with vivid blue and purple accents.",
|
|
2206
|
+
colorScheme: "light",
|
|
2207
|
+
group: "Tokyo Night"
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
id: "deepsea-dark",
|
|
2211
|
+
name: "Tokyo Night",
|
|
2212
|
+
description: "Tokyo Night \u2014 #1a1b26 base with signature blue, cyan, and purple.",
|
|
2213
|
+
colorScheme: "dark",
|
|
2214
|
+
group: "Tokyo Night"
|
|
2215
|
+
},
|
|
2216
|
+
{
|
|
2217
|
+
id: "malibu-light",
|
|
2218
|
+
name: "Malibu Light",
|
|
2219
|
+
description: "Sun-bleached GTA San Andreas palette with hot pink, sunset orange, and lime signals.",
|
|
2220
|
+
colorScheme: "light",
|
|
2221
|
+
group: "Malibu"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
id: "malibu-dark",
|
|
2225
|
+
name: "Malibu Dark",
|
|
2226
|
+
description: "Deep plum command deck with hot pink, lime, cyan, and sunset signals.",
|
|
2227
|
+
colorScheme: "dark",
|
|
2228
|
+
group: "Malibu"
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
id: "microsoft-light",
|
|
2232
|
+
name: "Microsoft Light",
|
|
2233
|
+
description: "Office Fluent light neutrals on white with the signature brand blue.",
|
|
2234
|
+
colorScheme: "light",
|
|
2235
|
+
group: "Microsoft"
|
|
2236
|
+
},
|
|
2237
|
+
{
|
|
2238
|
+
id: "microsoft-dark",
|
|
2239
|
+
name: "Microsoft Dark",
|
|
2240
|
+
description: "Office Fluent dark chrome with a bright brand-blue accent.",
|
|
2241
|
+
colorScheme: "dark",
|
|
2242
|
+
group: "Microsoft"
|
|
2243
|
+
}
|
|
2244
|
+
];
|
|
2245
|
+
var THEME_GROUPS = Array.from(
|
|
2246
|
+
new Set(THEMES.map((theme) => theme.group))
|
|
2247
|
+
);
|
|
2248
|
+
function isThemeId(value) {
|
|
2249
|
+
return THEMES.some((theme) => theme.id === value);
|
|
2250
|
+
}
|
|
2251
|
+
function getTheme(id) {
|
|
2252
|
+
return THEMES.find((theme) => theme.id === id);
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
// src/themes/init-theme.ts
|
|
2256
|
+
var STORAGE_KEY = "ph-theme";
|
|
2257
|
+
var VALID_THEMES = THEMES.map((theme) => theme.id);
|
|
2258
|
+
var THEME_INIT_SCRIPT = `(function(){try{var k="${STORAGE_KEY}",d="${DEFAULT_THEME_ID}",v=${JSON.stringify(VALID_THEMES)},t=localStorage.getItem(k);if(!t||v.indexOf(t)<0)t=d;document.documentElement.setAttribute("data-theme",t)}catch(e){document.documentElement.setAttribute("data-theme","${DEFAULT_THEME_ID}")}})();`;
|
|
2259
|
+
function persistTheme(themeId) {
|
|
2260
|
+
if (typeof window === "undefined") {
|
|
2261
|
+
return;
|
|
2262
|
+
}
|
|
2263
|
+
if (!isThemeId(themeId)) {
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
document.documentElement.setAttribute("data-theme", themeId);
|
|
2267
|
+
localStorage.setItem(STORAGE_KEY, themeId);
|
|
2268
|
+
}
|
|
2269
|
+
function readStoredTheme() {
|
|
2270
|
+
if (typeof window === "undefined") {
|
|
2271
|
+
return DEFAULT_THEME_ID;
|
|
2272
|
+
}
|
|
2273
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
2274
|
+
return stored && isThemeId(stored) ? stored : DEFAULT_THEME_ID;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
// src/components/ui/ThemeDomSync.tsx
|
|
2278
|
+
function ThemeDomSync() {
|
|
2279
|
+
useLayoutEffect(() => {
|
|
2280
|
+
persistTheme(readStoredTheme());
|
|
2281
|
+
}, []);
|
|
2282
|
+
return null;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
// src/components/ui/ThemeSwitcher.tsx
|
|
2286
|
+
import { useEffect, useState as useState2 } from "react";
|
|
2287
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2288
|
+
function ThemeSwitcher({ className }) {
|
|
2289
|
+
const [themeId, setThemeId] = useState2(DEFAULT_THEME_ID);
|
|
2290
|
+
useEffect(() => {
|
|
2291
|
+
const id = readStoredTheme();
|
|
2292
|
+
persistTheme(id);
|
|
2293
|
+
setThemeId(id);
|
|
2294
|
+
}, []);
|
|
2295
|
+
return /* @__PURE__ */ jsxs18("label", { className: cn("flex min-w-0 items-center gap-2", className), children: [
|
|
2296
|
+
/* @__PURE__ */ jsx21("span", { className: "shrink-0 text-xs font-medium text-ph-mutedtext sm:text-sm", children: "Theme" }),
|
|
2297
|
+
/* @__PURE__ */ jsx21(
|
|
2298
|
+
"select",
|
|
2299
|
+
{
|
|
2300
|
+
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",
|
|
2301
|
+
value: themeId,
|
|
2302
|
+
"aria-label": "Colour theme",
|
|
2303
|
+
onChange: (event) => {
|
|
2304
|
+
const next = event.target.value;
|
|
2305
|
+
persistTheme(next);
|
|
2306
|
+
setThemeId(next);
|
|
2307
|
+
},
|
|
2308
|
+
children: THEME_GROUPS.map((group) => /* @__PURE__ */ jsx21("optgroup", { label: group, children: THEMES.filter((theme) => theme.group === group).map((theme) => /* @__PURE__ */ jsx21("option", { value: theme.id, children: theme.name }, theme.id)) }, group))
|
|
2309
|
+
}
|
|
2310
|
+
)
|
|
2311
|
+
] });
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
// src/components/ui/Accordion.tsx
|
|
2315
|
+
import { useId as useId5, useState as useState3 } from "react";
|
|
2316
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2317
|
+
function Accordion({
|
|
2318
|
+
items,
|
|
2319
|
+
allowMultiple = false,
|
|
2320
|
+
defaultOpen = [],
|
|
2321
|
+
className
|
|
2322
|
+
}) {
|
|
2323
|
+
const [openItems, setOpenItems] = useState3(new Set(defaultOpen));
|
|
2324
|
+
const idPrefix = useId5();
|
|
2325
|
+
const toggleItem = (id) => {
|
|
2326
|
+
setOpenItems((prev) => {
|
|
2327
|
+
const next = new Set(prev);
|
|
2328
|
+
if (next.has(id)) {
|
|
2329
|
+
next.delete(id);
|
|
2330
|
+
} else {
|
|
2331
|
+
if (!allowMultiple) {
|
|
2332
|
+
next.clear();
|
|
2333
|
+
}
|
|
2334
|
+
next.add(id);
|
|
2335
|
+
}
|
|
2336
|
+
return next;
|
|
2337
|
+
});
|
|
2338
|
+
};
|
|
2339
|
+
return /* @__PURE__ */ jsx22(
|
|
2340
|
+
"div",
|
|
2341
|
+
{
|
|
2342
|
+
className: cn(
|
|
2343
|
+
"divide-y divide-ph-border rounded-xl border border-ph-border bg-ph-surface",
|
|
2344
|
+
className
|
|
2345
|
+
),
|
|
2346
|
+
children: items.map((item) => {
|
|
2347
|
+
const isOpen = openItems.has(item.id);
|
|
2348
|
+
const contentId = `accordion-${idPrefix}-${item.id}-content`;
|
|
2349
|
+
return /* @__PURE__ */ jsxs19("div", { className: "first:rounded-t-xl last:rounded-b-xl", children: [
|
|
2350
|
+
/* @__PURE__ */ jsxs19(
|
|
2351
|
+
"button",
|
|
2352
|
+
{
|
|
2353
|
+
type: "button",
|
|
2354
|
+
onClick: () => toggleItem(item.id),
|
|
2355
|
+
"aria-expanded": isOpen,
|
|
2356
|
+
"aria-controls": contentId,
|
|
2357
|
+
className: "flex w-full items-center justify-between px-5 py-4 text-left transition hover:bg-ph-muted",
|
|
2358
|
+
children: [
|
|
2359
|
+
/* @__PURE__ */ jsx22("span", { className: "font-semibold text-ph-ink", children: item.title }),
|
|
2360
|
+
/* @__PURE__ */ jsx22(
|
|
2361
|
+
IconChevronDown,
|
|
2362
|
+
{
|
|
2363
|
+
className: cn(
|
|
2364
|
+
"h-5 w-5 text-ph-mutedtext transition-transform duration-200",
|
|
2365
|
+
isOpen && "rotate-180"
|
|
2366
|
+
)
|
|
2367
|
+
}
|
|
2368
|
+
)
|
|
2369
|
+
]
|
|
2370
|
+
}
|
|
2371
|
+
),
|
|
2372
|
+
/* @__PURE__ */ jsx22(
|
|
2373
|
+
"div",
|
|
2374
|
+
{
|
|
2375
|
+
id: contentId,
|
|
2376
|
+
"aria-hidden": !isOpen,
|
|
2377
|
+
ref: (node) => {
|
|
2378
|
+
if (node) node.toggleAttribute("inert", !isOpen);
|
|
2379
|
+
},
|
|
2380
|
+
className: cn(
|
|
2381
|
+
"grid transition-all duration-200",
|
|
2382
|
+
isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
2383
|
+
),
|
|
2384
|
+
children: /* @__PURE__ */ jsx22("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx22("div", { className: "px-5 pb-4 text-ph-subtle", children: item.content }) })
|
|
2385
|
+
}
|
|
2386
|
+
)
|
|
2387
|
+
] }, item.id);
|
|
2388
|
+
})
|
|
2389
|
+
}
|
|
2390
|
+
);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
// src/components/ui/SegmentedControl.tsx
|
|
2394
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2395
|
+
function SegmentedControl({ options, value, onChange, className }) {
|
|
2396
|
+
return /* @__PURE__ */ jsx23(
|
|
2397
|
+
"div",
|
|
2398
|
+
{
|
|
2399
|
+
className: cn(
|
|
2400
|
+
"inline-flex rounded-lg bg-ph-muted p-1",
|
|
2401
|
+
className
|
|
2402
|
+
),
|
|
2403
|
+
children: options.map((option) => /* @__PURE__ */ jsxs20(
|
|
2404
|
+
"button",
|
|
2405
|
+
{
|
|
2406
|
+
type: "button",
|
|
2407
|
+
"aria-pressed": value === option.value,
|
|
2408
|
+
onClick: () => onChange(option.value),
|
|
2409
|
+
className: cn(
|
|
2410
|
+
"relative flex min-h-11 items-center gap-1.5 rounded-md px-3.5 py-1.5 text-sm font-medium transition-all sm:min-h-9",
|
|
2411
|
+
value === option.value ? "bg-ph-surface text-ph-ink shadow-ph" : "text-ph-subtle hover:text-ph-ink"
|
|
2412
|
+
),
|
|
2413
|
+
children: [
|
|
2414
|
+
option.icon && /* @__PURE__ */ jsx23("span", { className: "h-4 w-4", children: option.icon }),
|
|
2415
|
+
option.label
|
|
2416
|
+
]
|
|
2417
|
+
},
|
|
2418
|
+
option.value
|
|
2419
|
+
))
|
|
2420
|
+
}
|
|
2421
|
+
);
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
// src/components/ui/CommandPalette.tsx
|
|
2425
|
+
import { useEffect as useEffect2, useId as useId6, useRef as useRef2, useState as useState4 } from "react";
|
|
2426
|
+
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
2427
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2428
|
+
function CommandPalette({
|
|
2429
|
+
items,
|
|
2430
|
+
isOpen,
|
|
2431
|
+
onClose,
|
|
2432
|
+
placeholder = "Type a command or search...",
|
|
2433
|
+
className,
|
|
2434
|
+
id,
|
|
2435
|
+
dataTest,
|
|
2436
|
+
inputId,
|
|
2437
|
+
inputDataTest
|
|
2438
|
+
}) {
|
|
2439
|
+
const [query, setQuery] = useState4("");
|
|
2440
|
+
const [selectedIndex, setSelectedIndex] = useState4(0);
|
|
2441
|
+
const inputRef = useRef2(null);
|
|
2442
|
+
const listboxRef = useRef2(null);
|
|
2443
|
+
const restoreFocusRef = useRef2(null);
|
|
2444
|
+
const generatedId = useId6();
|
|
2445
|
+
const listboxId = `${id != null ? id : `command-palette-${generatedId}`}-listbox`;
|
|
2446
|
+
const filtered = items.filter(
|
|
2447
|
+
(item) => item.label.toLowerCase().includes(query.toLowerCase())
|
|
2448
|
+
);
|
|
2449
|
+
const activeIndex = filtered.length ? Math.min(selectedIndex, filtered.length - 1) : 0;
|
|
2450
|
+
const activeItem = filtered[activeIndex];
|
|
2451
|
+
useEffect2(() => {
|
|
2452
|
+
if (!isOpen) return;
|
|
2453
|
+
setQuery("");
|
|
2454
|
+
setSelectedIndex(0);
|
|
2455
|
+
}, [isOpen]);
|
|
2456
|
+
useEffect2(() => {
|
|
2457
|
+
setSelectedIndex((current) => Math.min(current, Math.max(filtered.length - 1, 0)));
|
|
2458
|
+
}, [filtered.length]);
|
|
2459
|
+
useEffect2(() => {
|
|
2460
|
+
var _a, _b;
|
|
2461
|
+
if (!isOpen || !activeItem) return;
|
|
2462
|
+
(_b = (_a = listboxRef.current) == null ? void 0 : _a.querySelectorAll('[role="option"]')[activeIndex]) == null ? void 0 : _b.scrollIntoView({ block: "nearest" });
|
|
2463
|
+
}, [activeIndex, activeItem, isOpen]);
|
|
2464
|
+
const handleInputKeyDown = (event) => {
|
|
2465
|
+
switch (event.key) {
|
|
2466
|
+
case "ArrowDown":
|
|
2467
|
+
if (!filtered.length) return;
|
|
2468
|
+
event.preventDefault();
|
|
2469
|
+
setSelectedIndex((current) => (current + 1) % filtered.length);
|
|
2470
|
+
return;
|
|
2471
|
+
case "ArrowUp":
|
|
2472
|
+
if (!filtered.length) return;
|
|
2473
|
+
event.preventDefault();
|
|
2474
|
+
setSelectedIndex(
|
|
2475
|
+
(current) => (current - 1 + filtered.length) % filtered.length
|
|
2476
|
+
);
|
|
2477
|
+
return;
|
|
2478
|
+
case "Enter":
|
|
2479
|
+
if (!activeItem) return;
|
|
2480
|
+
event.preventDefault();
|
|
2481
|
+
activeItem.onSelect();
|
|
2482
|
+
onClose();
|
|
2483
|
+
return;
|
|
2484
|
+
default:
|
|
2485
|
+
return;
|
|
2486
|
+
}
|
|
2487
|
+
};
|
|
2488
|
+
return /* @__PURE__ */ jsx24(
|
|
2489
|
+
Dialog2.Root,
|
|
2490
|
+
{
|
|
2491
|
+
open: isOpen,
|
|
2492
|
+
onOpenChange: (nextOpen) => {
|
|
2493
|
+
if (!nextOpen) onClose();
|
|
2494
|
+
},
|
|
2495
|
+
children: /* @__PURE__ */ jsxs21(Dialog2.Portal, { children: [
|
|
2496
|
+
/* @__PURE__ */ jsx24(
|
|
2497
|
+
Dialog2.Overlay,
|
|
2498
|
+
{
|
|
2499
|
+
id,
|
|
2500
|
+
"data-test": dataTest,
|
|
2501
|
+
className: "fixed inset-0 z-50 bg-black/40 backdrop-blur-sm"
|
|
2502
|
+
}
|
|
2503
|
+
),
|
|
2504
|
+
/* @__PURE__ */ jsxs21(
|
|
2505
|
+
Dialog2.Content,
|
|
2506
|
+
{
|
|
2507
|
+
className: cn(
|
|
2508
|
+
"fixed left-1/2 top-[20vh] z-50 w-full max-w-xl -translate-x-1/2 overflow-hidden rounded-xl border border-ph-border bg-ph-surface shadow-ph-md",
|
|
2509
|
+
className
|
|
2510
|
+
),
|
|
2511
|
+
onOpenAutoFocus: (event) => {
|
|
2512
|
+
var _a;
|
|
2513
|
+
restoreFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2514
|
+
event.preventDefault();
|
|
2515
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2516
|
+
},
|
|
2517
|
+
onCloseAutoFocus: (event) => {
|
|
2518
|
+
var _a;
|
|
2519
|
+
event.preventDefault();
|
|
2520
|
+
(_a = restoreFocusRef.current) == null ? void 0 : _a.focus();
|
|
2521
|
+
},
|
|
2522
|
+
children: [
|
|
2523
|
+
/* @__PURE__ */ jsx24(Dialog2.Title, { className: "sr-only", children: "Command palette" }),
|
|
2524
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-3 border-b border-ph-border px-4 py-3", children: [
|
|
2525
|
+
/* @__PURE__ */ jsx24(IconSearch, { className: "h-5 w-5 text-ph-mutedtext" }),
|
|
2526
|
+
/* @__PURE__ */ jsx24(
|
|
2527
|
+
"input",
|
|
2528
|
+
{
|
|
2529
|
+
ref: inputRef,
|
|
2530
|
+
id: inputId,
|
|
2531
|
+
"data-test": inputDataTest,
|
|
2532
|
+
type: "text",
|
|
2533
|
+
role: "combobox",
|
|
2534
|
+
"aria-label": "Search commands",
|
|
2535
|
+
"aria-autocomplete": "list",
|
|
2536
|
+
"aria-controls": listboxId,
|
|
2537
|
+
"aria-expanded": "true",
|
|
2538
|
+
"aria-activedescendant": activeItem ? `command-${activeItem.id}` : void 0,
|
|
2539
|
+
value: query,
|
|
2540
|
+
onChange: (event) => {
|
|
2541
|
+
setQuery(event.target.value);
|
|
2542
|
+
setSelectedIndex(0);
|
|
2543
|
+
},
|
|
2544
|
+
onKeyDown: handleInputKeyDown,
|
|
2545
|
+
placeholder,
|
|
2546
|
+
className: "flex-1 bg-transparent text-ph-ink outline-none placeholder:text-ph-mutedtext"
|
|
2547
|
+
}
|
|
2548
|
+
),
|
|
2549
|
+
/* @__PURE__ */ jsx24("kbd", { "aria-hidden": "true", className: "rounded border border-ph-border bg-ph-muted px-1.5 py-0.5 text-xs text-ph-mutedtext", children: "ESC" })
|
|
2550
|
+
] }),
|
|
2551
|
+
/* @__PURE__ */ jsx24("div", { ref: listboxRef, id: listboxId, role: "listbox", "aria-label": "Commands", className: "max-h-[50vh] overflow-y-auto py-2", children: filtered.length === 0 ? /* @__PURE__ */ jsx24("div", { role: "status", className: "px-4 py-8 text-center text-sm text-ph-mutedtext", children: "No results found." }) : filtered.map((item, index) => /* @__PURE__ */ jsxs21(
|
|
2552
|
+
"div",
|
|
2553
|
+
{
|
|
2554
|
+
id: `command-${item.id}`,
|
|
2555
|
+
"data-test": `command-${item.id}`,
|
|
2556
|
+
role: "option",
|
|
2557
|
+
"aria-selected": index === activeIndex,
|
|
2558
|
+
onClick: () => {
|
|
2559
|
+
item.onSelect();
|
|
2560
|
+
onClose();
|
|
2561
|
+
},
|
|
2562
|
+
onMouseEnter: () => setSelectedIndex(index),
|
|
2563
|
+
className: cn(
|
|
2564
|
+
"flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-left text-sm transition-colors",
|
|
2565
|
+
index === activeIndex ? "bg-ph-muted text-ph-ink" : "text-ph-subtle"
|
|
2566
|
+
),
|
|
2567
|
+
children: [
|
|
2568
|
+
item.icon && /* @__PURE__ */ jsx24("span", { "aria-hidden": "true", className: "h-5 w-5", children: item.icon }),
|
|
2569
|
+
/* @__PURE__ */ jsx24("span", { className: "flex-1", children: item.label }),
|
|
2570
|
+
item.shortcut && /* @__PURE__ */ jsx24("kbd", { "aria-hidden": "true", className: "rounded border border-ph-border bg-ph-surface px-1.5 py-0.5 text-xs text-ph-mutedtext", children: item.shortcut })
|
|
2571
|
+
]
|
|
2572
|
+
},
|
|
2573
|
+
item.id
|
|
2574
|
+
)) })
|
|
2575
|
+
]
|
|
2576
|
+
}
|
|
2577
|
+
)
|
|
2578
|
+
] })
|
|
2579
|
+
}
|
|
2580
|
+
);
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
// src/components/ui/Calendar.tsx
|
|
2584
|
+
import { useEffect as useEffect3, useId as useId7, useRef as useRef3, useState as useState5 } from "react";
|
|
2585
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2586
|
+
var monthNames = [
|
|
2587
|
+
"January",
|
|
2588
|
+
"February",
|
|
2589
|
+
"March",
|
|
2590
|
+
"April",
|
|
2591
|
+
"May",
|
|
2592
|
+
"June",
|
|
2593
|
+
"July",
|
|
2594
|
+
"August",
|
|
2595
|
+
"September",
|
|
2596
|
+
"October",
|
|
2597
|
+
"November",
|
|
2598
|
+
"December"
|
|
2599
|
+
];
|
|
2600
|
+
var weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2601
|
+
var fullWeekDays = [
|
|
2602
|
+
"Sunday",
|
|
2603
|
+
"Monday",
|
|
2604
|
+
"Tuesday",
|
|
2605
|
+
"Wednesday",
|
|
2606
|
+
"Thursday",
|
|
2607
|
+
"Friday",
|
|
2608
|
+
"Saturday"
|
|
2609
|
+
];
|
|
2610
|
+
function startOfDay(date) {
|
|
2611
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
2612
|
+
}
|
|
2613
|
+
function startOfMonth(date) {
|
|
2614
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
2615
|
+
}
|
|
2616
|
+
function isSameDay(first, second) {
|
|
2617
|
+
return first.getFullYear() === second.getFullYear() && first.getMonth() === second.getMonth() && first.getDate() === second.getDate();
|
|
2618
|
+
}
|
|
2619
|
+
function addDays(date, amount) {
|
|
2620
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
|
|
2621
|
+
}
|
|
2622
|
+
function addMonths(date, amount) {
|
|
2623
|
+
const targetMonth = new Date(date.getFullYear(), date.getMonth() + amount, 1);
|
|
2624
|
+
const lastDay = new Date(
|
|
2625
|
+
targetMonth.getFullYear(),
|
|
2626
|
+
targetMonth.getMonth() + 1,
|
|
2627
|
+
0
|
|
2628
|
+
).getDate();
|
|
2629
|
+
return new Date(
|
|
2630
|
+
targetMonth.getFullYear(),
|
|
2631
|
+
targetMonth.getMonth(),
|
|
2632
|
+
Math.min(date.getDate(), lastDay)
|
|
2633
|
+
);
|
|
2634
|
+
}
|
|
2635
|
+
function dateKey(date) {
|
|
2636
|
+
return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
|
2637
|
+
}
|
|
2638
|
+
function dateLabel(date) {
|
|
2639
|
+
return `${fullWeekDays[date.getDay()]}, ${date.getDate()} ${monthNames[date.getMonth()]} ${date.getFullYear()}`;
|
|
2640
|
+
}
|
|
2641
|
+
function Calendar({ value, onChange, className }) {
|
|
2642
|
+
const [currentMonth, setCurrentMonth] = useState5(() => startOfMonth(value != null ? value : /* @__PURE__ */ new Date()));
|
|
2643
|
+
const [focusedDate, setFocusedDate] = useState5(() => startOfDay(value != null ? value : /* @__PURE__ */ new Date()));
|
|
2644
|
+
const gridRef = useRef3(null);
|
|
2645
|
+
const shouldFocusDateRef = useRef3(false);
|
|
2646
|
+
const monthLabelId = useId7();
|
|
2647
|
+
const today = startOfDay(/* @__PURE__ */ new Date());
|
|
2648
|
+
useEffect3(() => {
|
|
2649
|
+
if (!value) return;
|
|
2650
|
+
const nextDate = startOfDay(value);
|
|
2651
|
+
setCurrentMonth(startOfMonth(nextDate));
|
|
2652
|
+
setFocusedDate(nextDate);
|
|
2653
|
+
}, [value]);
|
|
2654
|
+
useEffect3(() => {
|
|
2655
|
+
var _a, _b;
|
|
2656
|
+
if (!shouldFocusDateRef.current) return;
|
|
2657
|
+
(_b = (_a = gridRef.current) == null ? void 0 : _a.querySelector(`[data-date="${dateKey(focusedDate)}"]`)) == null ? void 0 : _b.focus();
|
|
2658
|
+
shouldFocusDateRef.current = false;
|
|
2659
|
+
}, [currentMonth, focusedDate]);
|
|
2660
|
+
const year = currentMonth.getFullYear();
|
|
2661
|
+
const month = currentMonth.getMonth();
|
|
2662
|
+
const changeMonth = (amount) => {
|
|
2663
|
+
const nextDate = addMonths(focusedDate, amount);
|
|
2664
|
+
setFocusedDate(nextDate);
|
|
2665
|
+
setCurrentMonth(startOfMonth(nextDate));
|
|
2666
|
+
};
|
|
2667
|
+
const moveFocus = (nextDate) => {
|
|
2668
|
+
shouldFocusDateRef.current = true;
|
|
2669
|
+
setFocusedDate(nextDate);
|
|
2670
|
+
setCurrentMonth(startOfMonth(nextDate));
|
|
2671
|
+
};
|
|
2672
|
+
const handleSelect = (date) => {
|
|
2673
|
+
setFocusedDate(date);
|
|
2674
|
+
onChange == null ? void 0 : onChange(startOfDay(date));
|
|
2675
|
+
};
|
|
2676
|
+
const handleDayKeyDown = (event, date) => {
|
|
2677
|
+
let nextDate;
|
|
2678
|
+
switch (event.key) {
|
|
2679
|
+
case "ArrowLeft":
|
|
2680
|
+
nextDate = addDays(date, -1);
|
|
2681
|
+
break;
|
|
2682
|
+
case "ArrowRight":
|
|
2683
|
+
nextDate = addDays(date, 1);
|
|
2684
|
+
break;
|
|
2685
|
+
case "ArrowUp":
|
|
2686
|
+
nextDate = addDays(date, -7);
|
|
2687
|
+
break;
|
|
2688
|
+
case "ArrowDown":
|
|
2689
|
+
nextDate = addDays(date, 7);
|
|
2690
|
+
break;
|
|
2691
|
+
case "Home":
|
|
2692
|
+
nextDate = addDays(date, -date.getDay());
|
|
2693
|
+
break;
|
|
2694
|
+
case "End":
|
|
2695
|
+
nextDate = addDays(date, 6 - date.getDay());
|
|
2696
|
+
break;
|
|
2697
|
+
case "PageUp":
|
|
2698
|
+
nextDate = addMonths(date, event.shiftKey ? -12 : -1);
|
|
2699
|
+
break;
|
|
2700
|
+
case "PageDown":
|
|
2701
|
+
nextDate = addMonths(date, event.shiftKey ? 12 : 1);
|
|
2702
|
+
break;
|
|
2703
|
+
case "Enter":
|
|
2704
|
+
case " ":
|
|
2705
|
+
event.preventDefault();
|
|
2706
|
+
handleSelect(date);
|
|
2707
|
+
return;
|
|
2708
|
+
default:
|
|
2709
|
+
return;
|
|
2710
|
+
}
|
|
2711
|
+
event.preventDefault();
|
|
2712
|
+
moveFocus(nextDate);
|
|
2713
|
+
};
|
|
2714
|
+
const firstDay = new Date(year, month, 1).getDay();
|
|
2715
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
2716
|
+
const days = Array.from({ length: firstDay }, () => null);
|
|
2717
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
2718
|
+
days.push(new Date(year, month, day));
|
|
2719
|
+
}
|
|
2720
|
+
while (days.length < 42) {
|
|
2721
|
+
days.push(null);
|
|
2722
|
+
}
|
|
2723
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn("w-[280px] rounded-xl border border-ph-border bg-ph-surface p-4 shadow-ph", className), children: [
|
|
2724
|
+
/* @__PURE__ */ jsxs22("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
2725
|
+
/* @__PURE__ */ jsx25(
|
|
2726
|
+
"button",
|
|
2727
|
+
{
|
|
2728
|
+
type: "button",
|
|
2729
|
+
onClick: () => changeMonth(-1),
|
|
2730
|
+
"aria-label": "Previous month",
|
|
2731
|
+
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2732
|
+
children: /* @__PURE__ */ jsx25(IconChevronLeft, { className: "h-5 w-5", "aria-hidden": true })
|
|
2733
|
+
}
|
|
2734
|
+
),
|
|
2735
|
+
/* @__PURE__ */ jsxs22("span", { id: monthLabelId, "aria-live": "polite", className: "text-sm font-semibold text-ph-ink", children: [
|
|
2736
|
+
monthNames[month],
|
|
2737
|
+
" ",
|
|
2738
|
+
year
|
|
2739
|
+
] }),
|
|
2740
|
+
/* @__PURE__ */ jsx25(
|
|
2741
|
+
"button",
|
|
2742
|
+
{
|
|
2743
|
+
type: "button",
|
|
2744
|
+
onClick: () => changeMonth(1),
|
|
2745
|
+
"aria-label": "Next month",
|
|
2746
|
+
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2747
|
+
children: /* @__PURE__ */ jsx25(IconChevronRight, { className: "h-5 w-5", "aria-hidden": true })
|
|
2748
|
+
}
|
|
2749
|
+
)
|
|
2750
|
+
] }),
|
|
2751
|
+
/* @__PURE__ */ jsxs22("div", { ref: gridRef, role: "grid", "aria-labelledby": monthLabelId, children: [
|
|
2752
|
+
/* @__PURE__ */ jsx25("div", { role: "row", className: "grid grid-cols-7 gap-1", children: weekDays.map((day, index) => /* @__PURE__ */ jsx25(
|
|
2753
|
+
"div",
|
|
2754
|
+
{
|
|
2755
|
+
role: "columnheader",
|
|
2756
|
+
"aria-label": fullWeekDays[index],
|
|
2757
|
+
className: "py-1 text-center text-xs font-medium text-ph-mutedtext",
|
|
2758
|
+
children: day
|
|
2759
|
+
},
|
|
2760
|
+
day
|
|
2761
|
+
)) }),
|
|
2762
|
+
Array.from({ length: 6 }, (_, week) => {
|
|
2763
|
+
const weekDates = days.slice(week * 7, week * 7 + 7);
|
|
2764
|
+
if (weekDates.length === 0 || weekDates.every((date) => !date)) return null;
|
|
2765
|
+
return /* @__PURE__ */ jsx25("div", { role: "row", className: "grid grid-cols-7 gap-1", children: weekDates.map(
|
|
2766
|
+
(date, day) => date ? /* @__PURE__ */ jsx25(
|
|
2767
|
+
"div",
|
|
2768
|
+
{
|
|
2769
|
+
role: "gridcell",
|
|
2770
|
+
"aria-selected": value ? isSameDay(value, date) : false,
|
|
2771
|
+
className: "aspect-square",
|
|
2772
|
+
children: /* @__PURE__ */ jsx25(
|
|
2773
|
+
"button",
|
|
2774
|
+
{
|
|
2775
|
+
type: "button",
|
|
2776
|
+
"data-date": dateKey(date),
|
|
2777
|
+
"aria-label": dateLabel(date),
|
|
2778
|
+
"aria-current": isSameDay(today, date) ? "date" : void 0,
|
|
2779
|
+
tabIndex: isSameDay(focusedDate, date) ? 0 : -1,
|
|
2780
|
+
onClick: () => handleSelect(date),
|
|
2781
|
+
onKeyDown: (event) => handleDayKeyDown(event, date),
|
|
2782
|
+
className: cn(
|
|
2783
|
+
"flex h-full w-full items-center justify-center rounded-lg text-sm transition-colors",
|
|
2784
|
+
value && isSameDay(value, date) ? "bg-ph-brand font-semibold text-[var(--ph-on-accent)] shadow-ph" : isSameDay(today, date) ? "bg-ph-muted font-semibold text-ph-brand ring-1 ring-ph-brand/30" : "text-ph-ink hover:bg-ph-muted"
|
|
2785
|
+
),
|
|
2786
|
+
children: date.getDate()
|
|
2787
|
+
}
|
|
2788
|
+
)
|
|
2789
|
+
},
|
|
2790
|
+
dateKey(date)
|
|
2791
|
+
) : /* @__PURE__ */ jsx25("div", { role: "gridcell", "aria-hidden": "true", className: "aspect-square" }, `empty-${week}-${day}`)
|
|
2792
|
+
) }, week);
|
|
2793
|
+
})
|
|
2794
|
+
] })
|
|
2795
|
+
] });
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
// src/components/ui/Tooltip.tsx
|
|
2799
|
+
import {
|
|
2800
|
+
cloneElement,
|
|
2801
|
+
createContext,
|
|
2802
|
+
useCallback,
|
|
2803
|
+
useContext,
|
|
2804
|
+
useEffect as useEffect4,
|
|
2805
|
+
useId as useId8,
|
|
2806
|
+
useLayoutEffect as useLayoutEffect2,
|
|
2807
|
+
useRef as useRef4,
|
|
2808
|
+
useState as useState6
|
|
2809
|
+
} from "react";
|
|
2810
|
+
import { createPortal } from "react-dom";
|
|
2811
|
+
import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2812
|
+
var TooltipDelayContext = createContext(0);
|
|
2813
|
+
function TooltipProvider({
|
|
2814
|
+
children,
|
|
2815
|
+
delayDuration = 0
|
|
2816
|
+
}) {
|
|
2817
|
+
return /* @__PURE__ */ jsx26(TooltipDelayContext.Provider, { value: delayDuration, children });
|
|
2818
|
+
}
|
|
2819
|
+
function tooltipPosition(trigger, content, side, align, offset, collisionPadding) {
|
|
2820
|
+
const horizontal = align === "start" ? trigger.left : align === "end" ? trigger.right : trigger.left + trigger.width / 2;
|
|
2821
|
+
const vertical = align === "start" ? trigger.top : align === "end" ? trigger.bottom : trigger.top + trigger.height / 2;
|
|
2822
|
+
const position = side === "top" ? { left: horizontal - content.width / 2, top: trigger.top - offset - content.height } : side === "bottom" ? { left: horizontal - content.width / 2, top: trigger.bottom + offset } : side === "left" ? { left: trigger.left - offset - content.width, top: vertical - content.height / 2 } : { left: trigger.right + offset, top: vertical - content.height / 2 };
|
|
2823
|
+
const maxLeft = Math.max(collisionPadding, window.innerWidth - content.width - collisionPadding);
|
|
2824
|
+
const maxTop = Math.max(collisionPadding, window.innerHeight - content.height - collisionPadding);
|
|
2825
|
+
return {
|
|
2826
|
+
left: Math.min(Math.max(position.left, collisionPadding), maxLeft),
|
|
2827
|
+
top: Math.min(Math.max(position.top, collisionPadding), maxTop)
|
|
2828
|
+
};
|
|
2829
|
+
}
|
|
2830
|
+
function Tooltip({
|
|
2831
|
+
content,
|
|
2832
|
+
children,
|
|
2833
|
+
side = "top",
|
|
2834
|
+
align = "center",
|
|
2835
|
+
sideOffset = 7,
|
|
2836
|
+
collisionPadding = 8,
|
|
2837
|
+
className,
|
|
2838
|
+
open,
|
|
2839
|
+
defaultOpen = false,
|
|
2840
|
+
onOpenChange,
|
|
2841
|
+
delayDuration,
|
|
2842
|
+
disableHoverableContent = false
|
|
2843
|
+
}) {
|
|
2844
|
+
const providerDelay = useContext(TooltipDelayContext);
|
|
2845
|
+
const generatedId = useId8().replace(/:/g, "");
|
|
2846
|
+
const triggerRef = useRef4(null);
|
|
2847
|
+
const contentRef = useRef4(null);
|
|
2848
|
+
const timerRef = useRef4(null);
|
|
2849
|
+
const [internalOpen, setInternalOpen] = useState6(defaultOpen);
|
|
2850
|
+
const [position, setPosition] = useState6(null);
|
|
2851
|
+
const isOpen = open != null ? open : internalOpen;
|
|
2852
|
+
const triggerId = children.props.id;
|
|
2853
|
+
const tooltipId = triggerId ? `${triggerId}-tooltip` : `ph-tooltip-${generatedId}`;
|
|
2854
|
+
function setOpen(next) {
|
|
2855
|
+
if (open === void 0) setInternalOpen(next);
|
|
2856
|
+
onOpenChange == null ? void 0 : onOpenChange(next);
|
|
2857
|
+
}
|
|
2858
|
+
function clearTimer() {
|
|
2859
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
2860
|
+
timerRef.current = null;
|
|
2861
|
+
}
|
|
2862
|
+
const updatePosition = useCallback(() => {
|
|
2863
|
+
if (!triggerRef.current || !contentRef.current) return;
|
|
2864
|
+
setPosition(
|
|
2865
|
+
tooltipPosition(
|
|
2866
|
+
triggerRef.current.getBoundingClientRect(),
|
|
2867
|
+
contentRef.current.getBoundingClientRect(),
|
|
2868
|
+
side,
|
|
2869
|
+
align,
|
|
2870
|
+
sideOffset,
|
|
2871
|
+
collisionPadding
|
|
2872
|
+
)
|
|
2873
|
+
);
|
|
2874
|
+
}, [align, collisionPadding, side, sideOffset]);
|
|
2875
|
+
function show(immediate) {
|
|
2876
|
+
clearTimer();
|
|
2877
|
+
updatePosition();
|
|
2878
|
+
const delay = immediate ? 0 : delayDuration != null ? delayDuration : providerDelay;
|
|
2879
|
+
if (!delay) setOpen(true);
|
|
2880
|
+
else timerRef.current = setTimeout(() => setOpen(true), delay);
|
|
2881
|
+
}
|
|
2882
|
+
function hide() {
|
|
2883
|
+
clearTimer();
|
|
2884
|
+
setOpen(false);
|
|
2885
|
+
}
|
|
2886
|
+
function hideFromTrigger() {
|
|
2887
|
+
if (disableHoverableContent) {
|
|
2888
|
+
hide();
|
|
2889
|
+
return;
|
|
2890
|
+
}
|
|
2891
|
+
clearTimer();
|
|
2892
|
+
timerRef.current = setTimeout(() => setOpen(false), 100);
|
|
2893
|
+
}
|
|
2894
|
+
useLayoutEffect2(() => {
|
|
2895
|
+
if (isOpen) updatePosition();
|
|
2896
|
+
}, [isOpen, updatePosition]);
|
|
2897
|
+
useEffect4(() => {
|
|
2898
|
+
if (!isOpen) return;
|
|
2899
|
+
const reposition = () => updatePosition();
|
|
2900
|
+
window.addEventListener("resize", reposition);
|
|
2901
|
+
window.addEventListener("scroll", reposition, true);
|
|
2902
|
+
return () => {
|
|
2903
|
+
window.removeEventListener("resize", reposition);
|
|
2904
|
+
window.removeEventListener("scroll", reposition, true);
|
|
2905
|
+
};
|
|
2906
|
+
}, [isOpen, updatePosition]);
|
|
2907
|
+
useEffect4(() => () => clearTimer(), []);
|
|
2908
|
+
const describedBy = [children.props["aria-describedby"], tooltipId].filter(Boolean).join(" ");
|
|
2909
|
+
const trigger = cloneElement(children, { "aria-describedby": describedBy });
|
|
2910
|
+
return /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
2911
|
+
/* @__PURE__ */ jsx26(
|
|
2912
|
+
"span",
|
|
2913
|
+
{
|
|
2914
|
+
ref: triggerRef,
|
|
2915
|
+
className: "inline-flex",
|
|
2916
|
+
onMouseEnter: () => show(false),
|
|
2917
|
+
onMouseLeave: hideFromTrigger,
|
|
2918
|
+
onFocusCapture: () => show(true),
|
|
2919
|
+
onBlurCapture: hide,
|
|
2920
|
+
onKeyDown: (event) => {
|
|
2921
|
+
if (event.key === "Escape") hide();
|
|
2922
|
+
},
|
|
2923
|
+
children: trigger
|
|
2924
|
+
}
|
|
2925
|
+
),
|
|
2926
|
+
isOpen && typeof document !== "undefined" ? createPortal(
|
|
2927
|
+
/* @__PURE__ */ jsx26(
|
|
2928
|
+
"span",
|
|
2929
|
+
{
|
|
2930
|
+
style: __spreadProps(__spreadValues({ position: "fixed" }, position), { visibility: position ? void 0 : "hidden" }),
|
|
2931
|
+
className: "pointer-events-none z-[200]",
|
|
2932
|
+
children: /* @__PURE__ */ jsx26(
|
|
2933
|
+
"span",
|
|
2934
|
+
{
|
|
2935
|
+
ref: contentRef,
|
|
2936
|
+
id: tooltipId,
|
|
2937
|
+
role: "tooltip",
|
|
2938
|
+
"data-side": side,
|
|
2939
|
+
className: cn(
|
|
2940
|
+
"ph-tooltip-content",
|
|
2941
|
+
!disableHoverableContent && "pointer-events-auto",
|
|
2942
|
+
className
|
|
2943
|
+
),
|
|
2944
|
+
onMouseEnter: disableHoverableContent ? void 0 : clearTimer,
|
|
2945
|
+
onMouseLeave: disableHoverableContent ? void 0 : hide,
|
|
2946
|
+
children: content
|
|
2947
|
+
}
|
|
2948
|
+
)
|
|
2949
|
+
}
|
|
2950
|
+
),
|
|
2951
|
+
document.body
|
|
2952
|
+
) : null
|
|
2953
|
+
] });
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
// src/components/ui/EmptyState.tsx
|
|
2957
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2958
|
+
function EmptyState({ icon, title, description, action, className }) {
|
|
2959
|
+
return /* @__PURE__ */ jsxs24(
|
|
2960
|
+
"div",
|
|
2961
|
+
{
|
|
2962
|
+
className: cn(
|
|
2963
|
+
"flex flex-col items-center justify-center rounded-xl border border-dashed border-ph-border bg-ph-muted/50 px-8 py-16 text-center",
|
|
2964
|
+
className
|
|
2965
|
+
),
|
|
2966
|
+
children: [
|
|
2967
|
+
icon && /* @__PURE__ */ jsx27("div", { className: "mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-ph-muted text-ph-mutedtext", children: icon }),
|
|
2968
|
+
/* @__PURE__ */ jsx27("h2", { className: "text-base font-semibold text-ph-ink", children: title }),
|
|
2969
|
+
description && /* @__PURE__ */ jsx27("p", { className: "mt-1 max-w-sm text-sm text-ph-subtle", children: description }),
|
|
2970
|
+
action && /* @__PURE__ */ jsx27("div", { className: "mt-4", children: action })
|
|
2971
|
+
]
|
|
2972
|
+
}
|
|
2973
|
+
);
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
// src/components/ui/FilterChips.tsx
|
|
2977
|
+
import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2978
|
+
function FilterChips({
|
|
2979
|
+
chips,
|
|
2980
|
+
onToggle,
|
|
2981
|
+
onRemove,
|
|
2982
|
+
className,
|
|
2983
|
+
"aria-label": ariaLabel = "Applied filters"
|
|
2984
|
+
}) {
|
|
2985
|
+
return /* @__PURE__ */ jsx28("div", { className: cn("ph-filter-chips", className), role: "group", "aria-label": ariaLabel, children: chips.map((chip) => {
|
|
2986
|
+
var _a;
|
|
2987
|
+
const label = (_a = chip.removeLabel) != null ? _a : getChipText(chip);
|
|
2988
|
+
const content = /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
2989
|
+
/* @__PURE__ */ jsx28("span", { className: "ph-filter-chip__label", children: chip.label }),
|
|
2990
|
+
chip.value != null ? /* @__PURE__ */ jsx28("span", { className: "ph-filter-chip__value", children: chip.value }) : null
|
|
2991
|
+
] });
|
|
2992
|
+
return /* @__PURE__ */ jsxs25(
|
|
2993
|
+
"span",
|
|
2994
|
+
{
|
|
2995
|
+
className: cn("ph-filter-chip", chip.active && "ph-filter-chip--active"),
|
|
2996
|
+
"data-state": chip.active ? "on" : "off",
|
|
2997
|
+
children: [
|
|
2998
|
+
onToggle ? /* @__PURE__ */ jsx28(
|
|
2999
|
+
"button",
|
|
3000
|
+
{
|
|
3001
|
+
type: "button",
|
|
3002
|
+
className: "ph-filter-chip__main",
|
|
3003
|
+
"aria-pressed": Boolean(chip.active),
|
|
3004
|
+
onClick: () => onToggle(chip.id),
|
|
3005
|
+
children: content
|
|
3006
|
+
}
|
|
3007
|
+
) : /* @__PURE__ */ jsx28("span", { className: "ph-filter-chip__main", children: content }),
|
|
3008
|
+
chip.active && onRemove ? /* @__PURE__ */ jsx28(
|
|
3009
|
+
"button",
|
|
3010
|
+
{
|
|
3011
|
+
type: "button",
|
|
3012
|
+
className: "ph-filter-chip__remove",
|
|
3013
|
+
"aria-label": `Remove ${label} filter`,
|
|
3014
|
+
onClick: () => onRemove(chip.id),
|
|
3015
|
+
children: /* @__PURE__ */ jsx28(IconClose, { className: "h-3 w-3", "aria-hidden": true })
|
|
3016
|
+
}
|
|
3017
|
+
) : null
|
|
3018
|
+
]
|
|
3019
|
+
},
|
|
3020
|
+
chip.id
|
|
3021
|
+
);
|
|
3022
|
+
}) });
|
|
3023
|
+
}
|
|
3024
|
+
function getChipText(chip) {
|
|
3025
|
+
const label = typeof chip.label === "string" || typeof chip.label === "number" ? String(chip.label) : chip.id;
|
|
3026
|
+
const value = typeof chip.value === "string" || typeof chip.value === "number" ? String(chip.value) : null;
|
|
3027
|
+
return value ? `${label}: ${value}` : label;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
// src/components/ui/FilterBar.tsx
|
|
3031
|
+
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3032
|
+
function FilterBar(_a) {
|
|
3033
|
+
var _b = _a, {
|
|
3034
|
+
children,
|
|
3035
|
+
label = "Filters and sorting",
|
|
3036
|
+
onClear,
|
|
3037
|
+
clearLabel = "Clear all",
|
|
3038
|
+
resultCount,
|
|
3039
|
+
className
|
|
3040
|
+
} = _b, props = __objRest(_b, [
|
|
3041
|
+
"children",
|
|
3042
|
+
"label",
|
|
3043
|
+
"onClear",
|
|
3044
|
+
"clearLabel",
|
|
3045
|
+
"resultCount",
|
|
3046
|
+
"className"
|
|
3047
|
+
]);
|
|
3048
|
+
return /* @__PURE__ */ jsxs26("div", __spreadProps(__spreadValues({ className: cn("ph-filter-bar", className) }, props), { children: [
|
|
3049
|
+
/* @__PURE__ */ jsxs26("div", { className: "ph-filter-bar__controls", role: "group", "aria-label": label, children: [
|
|
3050
|
+
children,
|
|
3051
|
+
onClear ? /* @__PURE__ */ jsx29("button", { type: "button", className: "ph-filter-bar__clear", onClick: onClear, children: clearLabel }) : null
|
|
3052
|
+
] }),
|
|
3053
|
+
resultCount != null ? /* @__PURE__ */ jsx29("output", { className: "ph-filter-bar__results", "aria-live": "polite", children: resultCount }) : null
|
|
3054
|
+
] }));
|
|
3055
|
+
}
|
|
3056
|
+
function FilterMenu({
|
|
3057
|
+
label,
|
|
3058
|
+
value,
|
|
3059
|
+
options,
|
|
3060
|
+
onValueChange,
|
|
3061
|
+
placeholder = "Any",
|
|
3062
|
+
align = "start",
|
|
3063
|
+
disabled,
|
|
3064
|
+
className
|
|
3065
|
+
}) {
|
|
3066
|
+
var _a;
|
|
3067
|
+
const selected = options.find((option) => option.value === value);
|
|
3068
|
+
const displayValue = (_a = selected == null ? void 0 : selected.label) != null ? _a : placeholder;
|
|
3069
|
+
const accessibleValue = selected ? getOptionText(selected) : String(placeholder);
|
|
3070
|
+
return /* @__PURE__ */ jsx29(
|
|
3071
|
+
DropdownMenu,
|
|
3072
|
+
{
|
|
3073
|
+
"aria-label": `${label}: ${accessibleValue}`,
|
|
3074
|
+
align,
|
|
3075
|
+
disabled,
|
|
3076
|
+
className,
|
|
3077
|
+
trigger: /* @__PURE__ */ jsxs26("span", { className: cn("ph-filter-menu-trigger", selected && "ph-filter-menu-trigger--active"), children: [
|
|
3078
|
+
/* @__PURE__ */ jsx29(IconTuning, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
3079
|
+
/* @__PURE__ */ jsx29("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3080
|
+
/* @__PURE__ */ jsx29("span", { className: "ph-filter-menu-trigger__value", children: displayValue })
|
|
3081
|
+
] }),
|
|
3082
|
+
children: /* @__PURE__ */ jsx29(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ jsx29(
|
|
3083
|
+
DropdownRadioItem,
|
|
3084
|
+
{
|
|
3085
|
+
value: option.value,
|
|
3086
|
+
textValue: getOptionText(option),
|
|
3087
|
+
disabled: option.disabled,
|
|
3088
|
+
children: option.label
|
|
3089
|
+
},
|
|
3090
|
+
option.value
|
|
3091
|
+
)) })
|
|
3092
|
+
}
|
|
3093
|
+
);
|
|
3094
|
+
}
|
|
3095
|
+
function SortMenu({
|
|
3096
|
+
label,
|
|
3097
|
+
value,
|
|
3098
|
+
options,
|
|
3099
|
+
onValueChange,
|
|
3100
|
+
direction = "descending",
|
|
3101
|
+
align = "end",
|
|
3102
|
+
disabled,
|
|
3103
|
+
className
|
|
3104
|
+
}) {
|
|
3105
|
+
const selected = options.find((option) => option.value === value);
|
|
3106
|
+
return /* @__PURE__ */ jsx29(
|
|
3107
|
+
DropdownMenu,
|
|
3108
|
+
{
|
|
3109
|
+
"aria-label": `${label}: ${selected ? getOptionText(selected) : "Choose sort order"}`,
|
|
3110
|
+
align,
|
|
3111
|
+
disabled,
|
|
3112
|
+
className,
|
|
3113
|
+
trigger: /* @__PURE__ */ jsxs26("span", { className: "ph-filter-menu-trigger ph-sort-menu-trigger", children: [
|
|
3114
|
+
/* @__PURE__ */ jsx29(
|
|
3115
|
+
IconArrowDown,
|
|
3116
|
+
{
|
|
3117
|
+
className: cn("h-3.5 w-3.5", direction === "ascending" && "rotate-180"),
|
|
3118
|
+
"aria-hidden": true
|
|
3119
|
+
}
|
|
3120
|
+
),
|
|
3121
|
+
/* @__PURE__ */ jsx29("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3122
|
+
selected ? /* @__PURE__ */ jsx29("span", { className: "ph-filter-menu-trigger__value", children: selected.label }) : null
|
|
3123
|
+
] }),
|
|
3124
|
+
children: /* @__PURE__ */ jsx29(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ jsx29(
|
|
3125
|
+
DropdownRadioItem,
|
|
3126
|
+
{
|
|
3127
|
+
value: option.value,
|
|
3128
|
+
textValue: getOptionText(option),
|
|
3129
|
+
disabled: option.disabled,
|
|
3130
|
+
children: option.label
|
|
3131
|
+
},
|
|
3132
|
+
option.value
|
|
3133
|
+
)) })
|
|
3134
|
+
}
|
|
3135
|
+
);
|
|
3136
|
+
}
|
|
3137
|
+
function getOptionText(option) {
|
|
3138
|
+
if (option.textValue) return option.textValue;
|
|
3139
|
+
if (typeof option.label === "string" || typeof option.label === "number") return String(option.label);
|
|
3140
|
+
return option.value;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
// src/components/ui/FilterControls.tsx
|
|
3144
|
+
import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3145
|
+
function FilterControls(_a) {
|
|
3146
|
+
var _b = _a, {
|
|
3147
|
+
children,
|
|
3148
|
+
barProps,
|
|
3149
|
+
chipsProps,
|
|
3150
|
+
emptyState,
|
|
3151
|
+
className
|
|
3152
|
+
} = _b, props = __objRest(_b, [
|
|
3153
|
+
"children",
|
|
3154
|
+
"barProps",
|
|
3155
|
+
"chipsProps",
|
|
3156
|
+
"emptyState",
|
|
3157
|
+
"className"
|
|
3158
|
+
]);
|
|
3159
|
+
const hasChips = Boolean(chipsProps == null ? void 0 : chipsProps.chips.length);
|
|
3160
|
+
return /* @__PURE__ */ jsxs27("div", __spreadProps(__spreadValues({ className: cn("ph-filter-controls", className) }, props), { children: [
|
|
3161
|
+
/* @__PURE__ */ jsx30(FilterBar, __spreadProps(__spreadValues({}, barProps), { children })),
|
|
3162
|
+
hasChips && chipsProps ? /* @__PURE__ */ jsx30(FilterChips, __spreadValues({}, chipsProps)) : emptyState != null ? emptyState : null
|
|
3163
|
+
] }));
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
// src/components/ui/CodeBlock.tsx
|
|
3167
|
+
import { useState as useState7 } from "react";
|
|
3168
|
+
import { jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3169
|
+
function CodeBlock({ code, language = "tsx", filename, className }) {
|
|
3170
|
+
const [copied, setCopied] = useState7(false);
|
|
3171
|
+
const handleCopy = async () => {
|
|
3172
|
+
await navigator.clipboard.writeText(code);
|
|
3173
|
+
setCopied(true);
|
|
3174
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
3175
|
+
};
|
|
3176
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn("overflow-hidden rounded-lg border border-ph-border bg-[#1a1a2e]", className), children: [
|
|
3177
|
+
(filename || language) && /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between border-b border-white/10 px-4 py-2", children: [
|
|
3178
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
|
|
3179
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex gap-1.5", children: [
|
|
3180
|
+
/* @__PURE__ */ jsx31("div", { className: "h-3 w-3 rounded-full bg-red-400" }),
|
|
3181
|
+
/* @__PURE__ */ jsx31("div", { className: "h-3 w-3 rounded-full bg-amber-400" }),
|
|
3182
|
+
/* @__PURE__ */ jsx31("div", { className: "h-3 w-3 rounded-full bg-emerald-400" })
|
|
3183
|
+
] }),
|
|
3184
|
+
filename && /* @__PURE__ */ jsx31("span", { className: "ml-2 text-xs text-white/60", children: filename })
|
|
3185
|
+
] }),
|
|
3186
|
+
/* @__PURE__ */ jsx31(
|
|
3187
|
+
"button",
|
|
3188
|
+
{
|
|
3189
|
+
type: "button",
|
|
3190
|
+
onClick: handleCopy,
|
|
3191
|
+
className: "text-xs text-white/60 transition hover:text-white",
|
|
3192
|
+
children: copied ? "Copied!" : "Copy"
|
|
3193
|
+
}
|
|
3194
|
+
)
|
|
3195
|
+
] }),
|
|
3196
|
+
/* @__PURE__ */ jsx31("pre", { className: "overflow-x-auto p-4 text-sm leading-relaxed", children: /* @__PURE__ */ jsx31("code", { className: "font-mono text-[#e4e4e7]", children: code }) })
|
|
3197
|
+
] });
|
|
3198
|
+
}
|
|
3199
|
+
|
|
3200
|
+
// src/components/ui/ComponentDocs.tsx
|
|
3201
|
+
import { jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3202
|
+
function ComponentDocs({ title = "Props & variants", rows, defaultOpen = false, className }) {
|
|
3203
|
+
return /* @__PURE__ */ jsxs29("details", { className: cn("ph-panel group overflow-hidden p-0", className), open: defaultOpen, children: [
|
|
3204
|
+
/* @__PURE__ */ jsxs29("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: [
|
|
3205
|
+
/* @__PURE__ */ jsx32("h3", { className: "text-xs font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
|
|
3206
|
+
/* @__PURE__ */ jsxs29("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: [
|
|
3207
|
+
/* @__PURE__ */ jsx32("span", { className: "group-open:hidden", children: "Show" }),
|
|
3208
|
+
/* @__PURE__ */ jsx32("span", { className: "hidden group-open:inline", children: "Hide" })
|
|
3209
|
+
] })
|
|
3210
|
+
] }),
|
|
3211
|
+
/* @__PURE__ */ jsx32("div", { className: "overflow-x-auto border-t border-ph-border", children: /* @__PURE__ */ jsxs29("table", { className: "w-full text-left text-sm", children: [
|
|
3212
|
+
/* @__PURE__ */ jsx32("thead", { className: "bg-ph-muted text-xs uppercase tracking-wider text-ph-mutedtext", children: /* @__PURE__ */ jsxs29("tr", { children: [
|
|
3213
|
+
/* @__PURE__ */ jsx32("th", { className: "px-4 py-2 font-semibold", children: "Prop" }),
|
|
3214
|
+
/* @__PURE__ */ jsx32("th", { className: "px-4 py-2 font-semibold", children: "Type" }),
|
|
3215
|
+
/* @__PURE__ */ jsx32("th", { className: "px-4 py-2 font-semibold", children: "Default" }),
|
|
3216
|
+
/* @__PURE__ */ jsx32("th", { className: "px-4 py-2 font-semibold", children: "Use" })
|
|
3217
|
+
] }) }),
|
|
3218
|
+
/* @__PURE__ */ jsx32("tbody", { className: "divide-y divide-ph-border", children: rows.map((row) => {
|
|
3219
|
+
var _a, _b;
|
|
3220
|
+
return /* @__PURE__ */ jsxs29("tr", { children: [
|
|
3221
|
+
/* @__PURE__ */ jsx32("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-ink", children: row.name }),
|
|
3222
|
+
/* @__PURE__ */ jsx32("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: row.type }),
|
|
3223
|
+
/* @__PURE__ */ jsx32("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: (_a = row.defaultValue) != null ? _a : "-" }),
|
|
3224
|
+
/* @__PURE__ */ jsx32("td", { className: "px-4 py-3 align-top text-ph-subtle", children: (_b = row.description) != null ? _b : /* @__PURE__ */ jsx32("span", { className: "text-ph-mutedtext", children: "\u2014" }) })
|
|
3225
|
+
] }, row.name);
|
|
3226
|
+
}) })
|
|
3227
|
+
] }) })
|
|
3228
|
+
] });
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
// src/components/ui/ShowcaseWrapper.tsx
|
|
3232
|
+
import { useState as useState8 } from "react";
|
|
3233
|
+
import { jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3234
|
+
function ShowcaseWrapper({
|
|
3235
|
+
id,
|
|
3236
|
+
title,
|
|
3237
|
+
description,
|
|
3238
|
+
docs,
|
|
3239
|
+
code,
|
|
3240
|
+
filename = "Example.tsx",
|
|
3241
|
+
children,
|
|
3242
|
+
className
|
|
3243
|
+
}) {
|
|
3244
|
+
var _a;
|
|
3245
|
+
const [showCode, setShowCode] = useState8(false);
|
|
3246
|
+
const fallbackId = (_a = titleIdMap[title]) != null ? _a : title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
3247
|
+
return /* @__PURE__ */ jsxs30("section", { id: id != null ? id : fallbackId, className: cn("scroll-mt-20", className), children: [
|
|
3248
|
+
/* @__PURE__ */ jsxs30("div", { className: "ph-h2-rule mb-8", children: [
|
|
3249
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1.5", children: [
|
|
3250
|
+
/* @__PURE__ */ jsx33("h2", { children: title }),
|
|
3251
|
+
/* @__PURE__ */ jsx33(
|
|
3252
|
+
"button",
|
|
3253
|
+
{
|
|
3254
|
+
type: "button",
|
|
3255
|
+
onClick: () => setShowCode(!showCode),
|
|
3256
|
+
className: cn(
|
|
3257
|
+
"flex h-10 w-10 items-center justify-center rounded-full border transition-all",
|
|
3258
|
+
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"
|
|
3259
|
+
),
|
|
3260
|
+
title: showCode ? "Hide code" : "Show code",
|
|
3261
|
+
"aria-label": showCode ? "Hide code" : "Show code",
|
|
3262
|
+
children: /* @__PURE__ */ jsx33(IconCodePreview, { className: "h-5 w-5", "aria-hidden": true })
|
|
3263
|
+
}
|
|
3264
|
+
)
|
|
3265
|
+
] }),
|
|
3266
|
+
/* @__PURE__ */ jsx33("hr", {})
|
|
3267
|
+
] }),
|
|
3268
|
+
description && /* @__PURE__ */ jsx33("p", { className: "mb-6 text-sm text-ph-subtle", children: description }),
|
|
3269
|
+
docs && /* @__PURE__ */ jsx33("div", { className: "mb-6", children: docs }),
|
|
3270
|
+
/* @__PURE__ */ jsxs30(
|
|
3271
|
+
"div",
|
|
3272
|
+
{
|
|
3273
|
+
className: cn(
|
|
3274
|
+
"gap-6",
|
|
3275
|
+
showCode ? "lg:grid lg:grid-cols-[1fr,minmax(360px,420px)]" : "block"
|
|
3276
|
+
),
|
|
3277
|
+
children: [
|
|
3278
|
+
/* @__PURE__ */ jsx33("div", { className: cn("min-w-0", showCode && "lg:pr-2"), children }),
|
|
3279
|
+
/* @__PURE__ */ jsx33(
|
|
3280
|
+
"div",
|
|
3281
|
+
{
|
|
3282
|
+
className: cn(
|
|
3283
|
+
"transition-all duration-300",
|
|
3284
|
+
showCode ? "block opacity-100" : "hidden opacity-0 lg:hidden"
|
|
3285
|
+
),
|
|
3286
|
+
children: /* @__PURE__ */ jsx33("div", { className: "sticky top-20", children: /* @__PURE__ */ jsx33(CodeBlock, { code, filename }) })
|
|
3287
|
+
}
|
|
3288
|
+
)
|
|
3289
|
+
]
|
|
3290
|
+
}
|
|
3291
|
+
)
|
|
3292
|
+
] });
|
|
3293
|
+
}
|
|
3294
|
+
var titleIdMap = {
|
|
3295
|
+
"Icons": "icons",
|
|
3296
|
+
"Colour tokens": "colors",
|
|
3297
|
+
"Buttons": "buttons",
|
|
3298
|
+
"Badges": "badges",
|
|
3299
|
+
"Alerts": "alerts",
|
|
3300
|
+
"Toasts": "toasts",
|
|
3301
|
+
"Cards": "cards",
|
|
3302
|
+
"Forms": "forms",
|
|
3303
|
+
"Inputs & Forms": "forms",
|
|
3304
|
+
"Tables": "tables",
|
|
3305
|
+
"Accordion": "accordion",
|
|
3306
|
+
"Calendar": "calendar",
|
|
3307
|
+
"Hover Card": "hovercard",
|
|
3308
|
+
"Modals": "modals",
|
|
3309
|
+
"Drawers": "drawers",
|
|
3310
|
+
"Navigation chrome": "navigation",
|
|
3311
|
+
"Navigation utilities": "utilities",
|
|
3312
|
+
"Stepper": "stepper",
|
|
3313
|
+
"Command Palette": "command",
|
|
3314
|
+
"Filter Chips": "filters",
|
|
3315
|
+
"Empty State": "emptystate",
|
|
3316
|
+
"Charts (PostHog-style)": "charts",
|
|
3317
|
+
"Dashboard shells": "dashboard",
|
|
3318
|
+
"Tabs": "tabs",
|
|
3319
|
+
"Dropdowns": "dropdowns",
|
|
3320
|
+
"Progress & loading": "progress",
|
|
3321
|
+
"Tooltip": "tooltip",
|
|
3322
|
+
"Avatars": "avatars",
|
|
3323
|
+
"Stats & conversational UI": "stats",
|
|
3324
|
+
"Timeline": "timeline",
|
|
3325
|
+
"Countdown motif": "countdown",
|
|
3326
|
+
"Keyboard glyphs": "kbd",
|
|
3327
|
+
"Icon swap": "swap",
|
|
3328
|
+
"Stacked surfaces": "stack",
|
|
3329
|
+
"Diff slider": "diff",
|
|
3330
|
+
"Badge hotspots": "indicator",
|
|
3331
|
+
"Terminal capture": "code-mockup"
|
|
3332
|
+
};
|
|
3333
|
+
|
|
3334
|
+
// src/components/ui/CollapsibleSection.tsx
|
|
3335
|
+
import { useId as useId9, useState as useState9 } from "react";
|
|
3336
|
+
import { jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3337
|
+
function CollapsibleSection({
|
|
3338
|
+
title,
|
|
3339
|
+
children,
|
|
3340
|
+
defaultOpen = true,
|
|
3341
|
+
id
|
|
3342
|
+
}) {
|
|
3343
|
+
const [isOpen, setIsOpen] = useState9(defaultOpen);
|
|
3344
|
+
const generatedId = useId9();
|
|
3345
|
+
const contentId = `${id != null ? id : generatedId}-content`;
|
|
3346
|
+
return /* @__PURE__ */ jsxs31("section", { id, className: "scroll-mt-20", children: [
|
|
3347
|
+
/* @__PURE__ */ jsxs31(
|
|
3348
|
+
"button",
|
|
3349
|
+
{
|
|
3350
|
+
type: "button",
|
|
3351
|
+
onClick: () => setIsOpen(!isOpen),
|
|
3352
|
+
"aria-expanded": isOpen,
|
|
3353
|
+
"aria-controls": contentId,
|
|
3354
|
+
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",
|
|
3355
|
+
children: [
|
|
3356
|
+
/* @__PURE__ */ jsx34("span", { className: "text-lg font-bold text-ph-ink", children: title }),
|
|
3357
|
+
/* @__PURE__ */ jsx34(
|
|
3358
|
+
IconChevronDown,
|
|
3359
|
+
{
|
|
3360
|
+
className: cn(
|
|
3361
|
+
"h-5 w-5 text-ph-subtle transition-transform duration-200",
|
|
3362
|
+
isOpen && "rotate-180"
|
|
3363
|
+
),
|
|
3364
|
+
"aria-hidden": true
|
|
3365
|
+
}
|
|
3366
|
+
)
|
|
3367
|
+
]
|
|
3368
|
+
}
|
|
3369
|
+
),
|
|
3370
|
+
/* @__PURE__ */ jsx34(
|
|
3371
|
+
"div",
|
|
3372
|
+
{
|
|
3373
|
+
id: contentId,
|
|
3374
|
+
"aria-hidden": !isOpen,
|
|
3375
|
+
ref: (node) => {
|
|
3376
|
+
if (node) node.toggleAttribute("inert", !isOpen);
|
|
3377
|
+
},
|
|
3378
|
+
className: cn(
|
|
3379
|
+
"overflow-hidden transition-all duration-300",
|
|
3380
|
+
isOpen ? "max-h-[50000px] opacity-100" : "max-h-0 opacity-0"
|
|
3381
|
+
),
|
|
3382
|
+
children
|
|
3383
|
+
}
|
|
3384
|
+
)
|
|
3385
|
+
] });
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
// src/components/ui/Typography.tsx
|
|
3389
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
3390
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3391
|
+
var toneMap2 = {
|
|
3392
|
+
default: "text-ph-ink",
|
|
3393
|
+
muted: "text-ph-mutedtext",
|
|
3394
|
+
subtle: "text-ph-subtle",
|
|
3395
|
+
brand: "text-ph-brand",
|
|
3396
|
+
danger: "text-ph-danger",
|
|
3397
|
+
success: "text-ph-success",
|
|
3398
|
+
warning: "text-ph-warning",
|
|
3399
|
+
info: "text-ph-info",
|
|
3400
|
+
inherit: ""
|
|
3401
|
+
};
|
|
3402
|
+
var weightMap = {
|
|
3403
|
+
normal: "font-normal",
|
|
3404
|
+
medium: "font-medium",
|
|
3405
|
+
semibold: "font-semibold",
|
|
3406
|
+
bold: "font-bold",
|
|
3407
|
+
extrabold: "font-extrabold"
|
|
3408
|
+
};
|
|
3409
|
+
function textClass(base, tone, weight, truncate, className) {
|
|
3410
|
+
return cn(base, toneMap2[tone], weight && weightMap[weight], truncate && "truncate", className);
|
|
3411
|
+
}
|
|
3412
|
+
var Display = forwardRef9(function Display2(_a, ref) {
|
|
3413
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3414
|
+
return /* @__PURE__ */ jsx35("h1", __spreadProps(__spreadValues({ ref }, props), { className: textClass("ph-hero-title", tone, weight, truncate, className), children }));
|
|
3415
|
+
});
|
|
3416
|
+
var SectionTitle = forwardRef9(function SectionTitle2(_a, ref) {
|
|
3417
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3418
|
+
return /* @__PURE__ */ jsx35("h2", __spreadProps(__spreadValues({ ref }, props), { className: textClass("ph-section-title", tone, weight, truncate, className), children }));
|
|
3419
|
+
});
|
|
3420
|
+
var H1 = forwardRef9(function H12(_a, ref) {
|
|
3421
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3422
|
+
return /* @__PURE__ */ jsx35("h1", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-3xl font-bold tracking-tight md:text-4xl", tone, weight, truncate, className), children }));
|
|
3423
|
+
});
|
|
3424
|
+
var H2 = forwardRef9(function H22(_a, ref) {
|
|
3425
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3426
|
+
return /* @__PURE__ */ jsx35("h2", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-2xl font-bold tracking-tight", tone, weight, truncate, className), children }));
|
|
3427
|
+
});
|
|
3428
|
+
var H3 = forwardRef9(function H32(_a, ref) {
|
|
3429
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3430
|
+
return /* @__PURE__ */ jsx35("h3", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-xl font-semibold", tone, weight, truncate, className), children }));
|
|
3431
|
+
});
|
|
3432
|
+
var H4 = forwardRef9(function H42(_a, ref) {
|
|
3433
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3434
|
+
return /* @__PURE__ */ jsx35("h4", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-lg font-semibold", tone, weight, truncate, className), children }));
|
|
3435
|
+
});
|
|
3436
|
+
var H5 = forwardRef9(function H52(_a, ref) {
|
|
3437
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3438
|
+
return /* @__PURE__ */ jsx35("h5", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-base font-semibold", tone, weight, truncate, className), children }));
|
|
3439
|
+
});
|
|
3440
|
+
var P = forwardRef9(function P2(_a, ref) {
|
|
3441
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3442
|
+
return /* @__PURE__ */ jsx35("p", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-base leading-relaxed", tone, weight, truncate, className), children }));
|
|
3443
|
+
});
|
|
3444
|
+
var Small = forwardRef9(function Small2(_a, ref) {
|
|
3445
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3446
|
+
return /* @__PURE__ */ jsx35("span", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-sm leading-relaxed", tone, weight, truncate, className), children }));
|
|
3447
|
+
});
|
|
3448
|
+
var Caption = forwardRef9(function Caption2(_a, ref) {
|
|
3449
|
+
var _b = _a, { children, tone = "muted", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3450
|
+
return /* @__PURE__ */ jsx35("span", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-[11px] font-medium uppercase tracking-wider", tone, weight, truncate, className), children }));
|
|
3451
|
+
});
|
|
3452
|
+
var Overline = forwardRef9(function Overline2(_a, ref) {
|
|
3453
|
+
var _b = _a, { children, tone = "muted", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3454
|
+
return /* @__PURE__ */ jsx35("span", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-[10px] font-bold uppercase tracking-[0.15em]", tone, weight, truncate, className), children }));
|
|
3455
|
+
});
|
|
3456
|
+
var Lead = forwardRef9(function Lead2(_a, ref) {
|
|
3457
|
+
var _b = _a, { children, tone = "subtle", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3458
|
+
return /* @__PURE__ */ jsx35("p", __spreadProps(__spreadValues({ ref }, props), { className: textClass("ph-lead", tone, weight, truncate, className), children }));
|
|
3459
|
+
});
|
|
3460
|
+
var Mono = forwardRef9(function Mono2(_a, ref) {
|
|
3461
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3462
|
+
return /* @__PURE__ */ jsx35("code", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-sm font-mono leading-relaxed", tone, weight, truncate, className), children }));
|
|
3463
|
+
});
|
|
3464
|
+
var Label = forwardRef9(function Label2(_a, ref) {
|
|
3465
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3466
|
+
return /* @__PURE__ */ jsx35("label", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-sm font-medium", tone, weight, truncate, className), children }));
|
|
3467
|
+
});
|
|
3468
|
+
|
|
3469
|
+
// src/components/ui/Avatar.tsx
|
|
3470
|
+
import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3471
|
+
var sizeMap4 = {
|
|
3472
|
+
xs: "h-8 w-8 text-[10px]",
|
|
3473
|
+
sm: "h-10 w-10 text-xs",
|
|
3474
|
+
md: "h-12 w-12 text-base",
|
|
3475
|
+
lg: "h-16 w-16 text-xl",
|
|
3476
|
+
xl: "h-24 w-24 text-3xl"
|
|
3477
|
+
};
|
|
3478
|
+
var statusMap = {
|
|
3479
|
+
online: "bg-ph-success",
|
|
3480
|
+
offline: "bg-ph-mutedtext",
|
|
3481
|
+
away: "bg-ph-warning",
|
|
3482
|
+
busy: "bg-ph-danger"
|
|
3483
|
+
};
|
|
3484
|
+
function Avatar(_a) {
|
|
3485
|
+
var _b = _a, {
|
|
3486
|
+
label,
|
|
3487
|
+
icon,
|
|
3488
|
+
size = "md",
|
|
3489
|
+
color = "bg-ph-brand text-white",
|
|
3490
|
+
status,
|
|
3491
|
+
badge,
|
|
3492
|
+
className
|
|
3493
|
+
} = _b, props = __objRest(_b, [
|
|
3494
|
+
"label",
|
|
3495
|
+
"icon",
|
|
3496
|
+
"size",
|
|
3497
|
+
"color",
|
|
3498
|
+
"status",
|
|
3499
|
+
"badge",
|
|
3500
|
+
"className"
|
|
3501
|
+
]);
|
|
3502
|
+
return /* @__PURE__ */ jsxs32("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex shrink-0", className) }, props), { children: [
|
|
3503
|
+
/* @__PURE__ */ jsx36(
|
|
3504
|
+
"div",
|
|
3505
|
+
{
|
|
3506
|
+
className: cn(
|
|
3507
|
+
"flex items-center justify-center rounded-full border border-ph-border font-bold shadow-ph",
|
|
3508
|
+
sizeMap4[size],
|
|
3509
|
+
color
|
|
3510
|
+
),
|
|
3511
|
+
children: icon || label
|
|
3512
|
+
}
|
|
3513
|
+
),
|
|
3514
|
+
status && /* @__PURE__ */ jsx36(
|
|
3515
|
+
"span",
|
|
3516
|
+
{
|
|
3517
|
+
role: "img",
|
|
3518
|
+
"aria-label": `${status} status`,
|
|
3519
|
+
className: cn(
|
|
3520
|
+
"absolute bottom-0 right-1 h-2.5 w-2.5 rounded-full border-2 border-ph-surface",
|
|
3521
|
+
statusMap[status]
|
|
3522
|
+
)
|
|
3523
|
+
}
|
|
3524
|
+
),
|
|
3525
|
+
badge && /* @__PURE__ */ jsx36("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 })
|
|
3526
|
+
] }));
|
|
3527
|
+
}
|
|
3528
|
+
function AvatarGroup(_a) {
|
|
3529
|
+
var _b = _a, { children, max, className } = _b, props = __objRest(_b, ["children", "max", "className"]);
|
|
3530
|
+
const items = Array.isArray(children) ? children : [children];
|
|
3531
|
+
const visible = max ? items.slice(0, max) : items;
|
|
3532
|
+
const remaining = max ? items.length - max : 0;
|
|
3533
|
+
return /* @__PURE__ */ jsxs32("div", __spreadProps(__spreadValues({ className: cn("-space-x-3 flex rtl:space-x-reverse", className) }, props), { children: [
|
|
3534
|
+
visible,
|
|
3535
|
+
remaining > 0 && /* @__PURE__ */ jsx36(
|
|
3536
|
+
Avatar,
|
|
3537
|
+
{
|
|
3538
|
+
label: `+${remaining}`,
|
|
3539
|
+
size: "md",
|
|
3540
|
+
color: "bg-ph-toolbar text-ph-subtle"
|
|
3541
|
+
}
|
|
3542
|
+
)
|
|
3543
|
+
] }));
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
// src/components/ui/Progress.tsx
|
|
3547
|
+
import { useId as useId10 } from "react";
|
|
3548
|
+
import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3549
|
+
var sizeMap5 = {
|
|
3550
|
+
sm: "h-1",
|
|
3551
|
+
md: "h-2",
|
|
3552
|
+
lg: "h-3"
|
|
3553
|
+
};
|
|
3554
|
+
function Progress(_a) {
|
|
3555
|
+
var _b = _a, {
|
|
3556
|
+
value,
|
|
3557
|
+
max = 100,
|
|
3558
|
+
color = "bg-ph-brand",
|
|
3559
|
+
label,
|
|
3560
|
+
showPercentage = false,
|
|
3561
|
+
size = "md",
|
|
3562
|
+
className,
|
|
3563
|
+
"aria-label": ariaLabel,
|
|
3564
|
+
"aria-labelledby": ariaLabelledBy
|
|
3565
|
+
} = _b, props = __objRest(_b, [
|
|
3566
|
+
"value",
|
|
3567
|
+
"max",
|
|
3568
|
+
"color",
|
|
3569
|
+
"label",
|
|
3570
|
+
"showPercentage",
|
|
3571
|
+
"size",
|
|
3572
|
+
"className",
|
|
3573
|
+
"aria-label",
|
|
3574
|
+
"aria-labelledby"
|
|
3575
|
+
]);
|
|
3576
|
+
const labelId = useId10();
|
|
3577
|
+
const safeMax = Number.isFinite(max) && max > 0 ? max : 100;
|
|
3578
|
+
const safeValue = Number.isFinite(value) ? Math.min(safeMax, Math.max(0, value)) : 0;
|
|
3579
|
+
const percentage = safeValue / safeMax * 100;
|
|
3580
|
+
return /* @__PURE__ */ jsxs33("div", __spreadProps(__spreadValues({ className: cn("w-full", className) }, props), { children: [
|
|
3581
|
+
(label || showPercentage) && /* @__PURE__ */ jsxs33("div", { className: "mb-1.5 flex justify-between text-sm text-ph-subtle", children: [
|
|
3582
|
+
label && /* @__PURE__ */ jsx37("span", { id: labelId, children: label }),
|
|
3583
|
+
showPercentage && /* @__PURE__ */ jsxs33("span", { className: "tabular-nums", children: [
|
|
3584
|
+
Math.round(percentage),
|
|
3585
|
+
"%"
|
|
3586
|
+
] })
|
|
3587
|
+
] }),
|
|
3588
|
+
/* @__PURE__ */ jsx37("div", { className: cn("ph-progress", sizeMap5[size]), children: /* @__PURE__ */ jsx37(
|
|
3589
|
+
"div",
|
|
3590
|
+
{
|
|
3591
|
+
className: cn("ph-progress-bar", color),
|
|
3592
|
+
style: { width: `${percentage}%` },
|
|
3593
|
+
role: "progressbar",
|
|
3594
|
+
"aria-valuenow": safeValue,
|
|
3595
|
+
"aria-valuemin": 0,
|
|
3596
|
+
"aria-valuemax": safeMax,
|
|
3597
|
+
"aria-label": label ? void 0 : ariaLabel != null ? ariaLabel : "Progress",
|
|
3598
|
+
"aria-labelledby": label ? ariaLabelledBy != null ? ariaLabelledBy : labelId : ariaLabelledBy
|
|
3599
|
+
}
|
|
3600
|
+
) })
|
|
3601
|
+
] }));
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3604
|
+
// src/components/ui/Link.tsx
|
|
3605
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
3606
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3607
|
+
var Link = forwardRef10(function Link2(_a, ref) {
|
|
3608
|
+
var _b = _a, {
|
|
3609
|
+
className,
|
|
3610
|
+
disabled = false,
|
|
3611
|
+
children
|
|
3612
|
+
} = _b, props = __objRest(_b, [
|
|
3613
|
+
"className",
|
|
3614
|
+
"disabled",
|
|
3615
|
+
"children"
|
|
3616
|
+
]);
|
|
3617
|
+
return /* @__PURE__ */ jsx38(
|
|
3618
|
+
"a",
|
|
3619
|
+
__spreadProps(__spreadValues({
|
|
3620
|
+
ref,
|
|
3621
|
+
className: cn(
|
|
3622
|
+
"ph-link",
|
|
3623
|
+
disabled && "ph-link--disabled pointer-events-none opacity-50",
|
|
3624
|
+
className
|
|
3625
|
+
),
|
|
3626
|
+
tabIndex: disabled ? -1 : void 0,
|
|
3627
|
+
"aria-disabled": disabled || void 0
|
|
3628
|
+
}, props), {
|
|
3629
|
+
children
|
|
3630
|
+
})
|
|
3631
|
+
);
|
|
3632
|
+
});
|
|
3633
|
+
Link.displayName = "Link";
|
|
3634
|
+
|
|
3635
|
+
// src/components/ui/Spinner.tsx
|
|
3636
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3637
|
+
function Spinner(_a) {
|
|
3638
|
+
var _b = _a, { size = "sm", textColored = false, className } = _b, props = __objRest(_b, ["size", "textColored", "className"]);
|
|
3639
|
+
return /* @__PURE__ */ jsx39(
|
|
3640
|
+
"span",
|
|
3641
|
+
__spreadProps(__spreadValues({
|
|
3642
|
+
className: cn(
|
|
3643
|
+
"ph-spinner",
|
|
3644
|
+
`ph-spinner--${size}`,
|
|
3645
|
+
textColored && "ph-spinner--text-colored",
|
|
3646
|
+
className
|
|
3647
|
+
),
|
|
3648
|
+
role: "status",
|
|
3649
|
+
"aria-label": "Loading"
|
|
3650
|
+
}, props), {
|
|
3651
|
+
children: /* @__PURE__ */ jsxs34("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "ph-spinner__svg", children: [
|
|
3652
|
+
/* @__PURE__ */ jsx39("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", opacity: 0.2 }),
|
|
3653
|
+
/* @__PURE__ */ jsx39("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
|
|
3654
|
+
] })
|
|
3655
|
+
})
|
|
3656
|
+
);
|
|
3657
|
+
}
|
|
3658
|
+
Spinner.displayName = "Spinner";
|
|
3659
|
+
|
|
3660
|
+
// src/components/ui/Dot.tsx
|
|
3661
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3662
|
+
var colorMap = {
|
|
3663
|
+
green: "bg-ph-success",
|
|
3664
|
+
yellow: "bg-ph-warning",
|
|
3665
|
+
red: "bg-ph-danger",
|
|
3666
|
+
blue: "bg-ph-info",
|
|
3667
|
+
gray: "bg-ph-mutedtext"
|
|
3668
|
+
};
|
|
3669
|
+
function Dot(_a) {
|
|
3670
|
+
var _b = _a, { color = "gray", size = "md", className } = _b, props = __objRest(_b, ["color", "size", "className"]);
|
|
3671
|
+
return /* @__PURE__ */ jsx40(
|
|
3672
|
+
"span",
|
|
3673
|
+
__spreadValues({
|
|
3674
|
+
className: cn(
|
|
3675
|
+
"ph-dot inline-block shrink-0 rounded-full",
|
|
3676
|
+
size === "sm" ? "h-1.5 w-1.5" : "h-2.5 w-2.5",
|
|
3677
|
+
colorMap[color],
|
|
3678
|
+
className
|
|
3679
|
+
),
|
|
3680
|
+
"aria-hidden": "true"
|
|
3681
|
+
}, props)
|
|
3682
|
+
);
|
|
3683
|
+
}
|
|
3684
|
+
Dot.displayName = "Dot";
|
|
3685
|
+
|
|
3686
|
+
// src/components/ui/Chip.tsx
|
|
3687
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
3688
|
+
import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3689
|
+
var Chip = forwardRef11(function Chip2(_a, ref) {
|
|
3690
|
+
var _b = _a, {
|
|
3691
|
+
selected = false,
|
|
3692
|
+
onRemove,
|
|
3693
|
+
children,
|
|
3694
|
+
className
|
|
3695
|
+
} = _b, props = __objRest(_b, [
|
|
3696
|
+
"selected",
|
|
3697
|
+
"onRemove",
|
|
3698
|
+
"children",
|
|
3699
|
+
"className"
|
|
3700
|
+
]);
|
|
3701
|
+
const chipClassName = cn(
|
|
3702
|
+
"ph-chip",
|
|
3703
|
+
selected && "ph-chip--selected",
|
|
3704
|
+
className
|
|
3705
|
+
);
|
|
3706
|
+
if (onRemove) {
|
|
3707
|
+
const removeLabel = typeof children === "string" ? `Remove ${children}` : "Remove";
|
|
3708
|
+
return /* @__PURE__ */ jsxs35("span", { className: chipClassName, children: [
|
|
3709
|
+
/* @__PURE__ */ jsx41(
|
|
3710
|
+
"button",
|
|
3711
|
+
__spreadProps(__spreadValues({
|
|
3712
|
+
ref,
|
|
3713
|
+
type: "button",
|
|
3714
|
+
className: "min-w-0 bg-transparent p-0 text-inherit"
|
|
3715
|
+
}, props), {
|
|
3716
|
+
children: /* @__PURE__ */ jsx41("span", { className: "ph-chip__text", children })
|
|
3717
|
+
})
|
|
3718
|
+
),
|
|
3719
|
+
/* @__PURE__ */ jsx41(
|
|
3720
|
+
"button",
|
|
3721
|
+
{
|
|
3722
|
+
type: "button",
|
|
3723
|
+
onClick: onRemove,
|
|
3724
|
+
disabled: props.disabled,
|
|
3725
|
+
className: "ph-chip__remove",
|
|
3726
|
+
"aria-label": removeLabel,
|
|
3727
|
+
children: /* @__PURE__ */ jsx41("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx41("path", { d: "M2 2l6 6M8 2l-6 6" }) })
|
|
3728
|
+
}
|
|
3729
|
+
)
|
|
3730
|
+
] });
|
|
3731
|
+
}
|
|
3732
|
+
return /* @__PURE__ */ jsx41(
|
|
3733
|
+
"button",
|
|
3734
|
+
__spreadProps(__spreadValues({
|
|
3735
|
+
ref,
|
|
3736
|
+
type: "button",
|
|
3737
|
+
className: chipClassName
|
|
3738
|
+
}, props), {
|
|
3739
|
+
children: /* @__PURE__ */ jsx41("span", { className: "ph-chip__text", children })
|
|
3740
|
+
})
|
|
3741
|
+
);
|
|
3742
|
+
});
|
|
3743
|
+
Chip.displayName = "Chip";
|
|
3744
|
+
|
|
3745
|
+
export {
|
|
3746
|
+
ButtonChrome,
|
|
3747
|
+
cn,
|
|
3748
|
+
Button,
|
|
3749
|
+
IconBase,
|
|
3750
|
+
createIconBase,
|
|
3751
|
+
createIconBasePath,
|
|
3752
|
+
IconAreaChart,
|
|
3753
|
+
IconCumulativeChart,
|
|
3754
|
+
IconTableChart,
|
|
3755
|
+
IconHandClick,
|
|
3756
|
+
IconSurveys,
|
|
3757
|
+
IconCohort,
|
|
3758
|
+
IconRecording,
|
|
3759
|
+
IconFlare,
|
|
3760
|
+
IconSelectEvents,
|
|
3761
|
+
IconClipboardEdit,
|
|
3762
|
+
IconQueryEditor,
|
|
3763
|
+
IconTuning,
|
|
3764
|
+
IconSync,
|
|
3765
|
+
IconPlayCircle,
|
|
3766
|
+
IconGridView,
|
|
3767
|
+
IconListView,
|
|
3768
|
+
IconPremium,
|
|
3769
|
+
IconGift,
|
|
3770
|
+
IconRobot,
|
|
3771
|
+
IconExclamation,
|
|
3772
|
+
IconErrorOutline,
|
|
3773
|
+
IconInfo,
|
|
3774
|
+
IconCancel,
|
|
3775
|
+
IconCheckCircle,
|
|
3776
|
+
IconArrowUp,
|
|
3777
|
+
IconArrowDown,
|
|
3778
|
+
IconChevronLeft,
|
|
3779
|
+
IconChevronRight,
|
|
3780
|
+
IconChevronDown,
|
|
3781
|
+
IconSubArrowRight,
|
|
3782
|
+
IconSearch,
|
|
3783
|
+
IconBell,
|
|
3784
|
+
IconBellOff,
|
|
3785
|
+
IconPerson,
|
|
3786
|
+
IconHome,
|
|
3787
|
+
IconPanelRight,
|
|
3788
|
+
IconPlus,
|
|
3789
|
+
IconCheck,
|
|
3790
|
+
IconClose,
|
|
3791
|
+
IconTrash,
|
|
3792
|
+
IconDownload,
|
|
3793
|
+
IconUpload,
|
|
3794
|
+
IconSave,
|
|
3795
|
+
IconCopy,
|
|
3796
|
+
IconEdit,
|
|
3797
|
+
IconLogout,
|
|
3798
|
+
IconStar,
|
|
3799
|
+
IconMail,
|
|
3800
|
+
IconShoppingCart,
|
|
3801
|
+
IconMoon,
|
|
3802
|
+
IconSun,
|
|
3803
|
+
IconVolume,
|
|
3804
|
+
IconVolumeOff,
|
|
3805
|
+
IconFlag,
|
|
3806
|
+
IconDatabase,
|
|
3807
|
+
IconLayers,
|
|
3808
|
+
IconBox,
|
|
3809
|
+
IconBolt,
|
|
3810
|
+
IconRadar,
|
|
3811
|
+
IconToggle,
|
|
3812
|
+
IconRocket,
|
|
3813
|
+
IconTerminal,
|
|
3814
|
+
IconOldWindow,
|
|
3815
|
+
IconCommandCursor,
|
|
3816
|
+
IconDataReel,
|
|
3817
|
+
IconCodePreview,
|
|
3818
|
+
IconInsightBoard,
|
|
3819
|
+
IconEventStream,
|
|
3820
|
+
IconFeatureGate,
|
|
3821
|
+
IconReplayFrame,
|
|
3822
|
+
IconQueryStack,
|
|
3823
|
+
IconExperimentSplit,
|
|
3824
|
+
IconSurveyCard,
|
|
3825
|
+
OLD_UI_ICONS,
|
|
3826
|
+
IconActivity,
|
|
3827
|
+
IconFlask,
|
|
3828
|
+
IconSpinner,
|
|
3829
|
+
CANONICAL_ICONS,
|
|
3830
|
+
PH_ICON_ALIASES,
|
|
3831
|
+
PH_ICONS,
|
|
3832
|
+
IconByName,
|
|
3833
|
+
Alert,
|
|
3834
|
+
Badge,
|
|
3835
|
+
Card,
|
|
3836
|
+
Kbd,
|
|
3837
|
+
Loader,
|
|
3838
|
+
Skeleton,
|
|
3839
|
+
LoadingState,
|
|
3840
|
+
AuthLayout,
|
|
3841
|
+
AuthCard,
|
|
3842
|
+
AuthDivider,
|
|
3843
|
+
SettingsNav,
|
|
3844
|
+
SettingsLayout,
|
|
3845
|
+
DropdownMenu,
|
|
3846
|
+
DropdownButton,
|
|
3847
|
+
DropdownItem,
|
|
3848
|
+
DropdownRadioGroup,
|
|
3849
|
+
DropdownRadioItem,
|
|
3850
|
+
FormField,
|
|
3851
|
+
Input,
|
|
3852
|
+
Select,
|
|
3853
|
+
Textarea,
|
|
3854
|
+
Checkbox,
|
|
3855
|
+
Radio,
|
|
3856
|
+
Toggle,
|
|
3857
|
+
Range,
|
|
3858
|
+
FileUpload,
|
|
3859
|
+
Modal,
|
|
3860
|
+
Panel,
|
|
3861
|
+
SearchInput,
|
|
3862
|
+
SearchGroup,
|
|
3863
|
+
Table,
|
|
3864
|
+
Stat,
|
|
3865
|
+
DEFAULT_THEME_ID,
|
|
3866
|
+
THEMES,
|
|
3867
|
+
THEME_GROUPS,
|
|
3868
|
+
isThemeId,
|
|
3869
|
+
getTheme,
|
|
3870
|
+
THEME_INIT_SCRIPT,
|
|
3871
|
+
persistTheme,
|
|
3872
|
+
readStoredTheme,
|
|
3873
|
+
ThemeDomSync,
|
|
3874
|
+
ThemeSwitcher,
|
|
3875
|
+
Accordion,
|
|
3876
|
+
SegmentedControl,
|
|
3877
|
+
CommandPalette,
|
|
3878
|
+
Calendar,
|
|
3879
|
+
TooltipProvider,
|
|
3880
|
+
Tooltip,
|
|
3881
|
+
EmptyState,
|
|
3882
|
+
FilterChips,
|
|
3883
|
+
FilterBar,
|
|
3884
|
+
FilterMenu,
|
|
3885
|
+
SortMenu,
|
|
3886
|
+
FilterControls,
|
|
3887
|
+
CodeBlock,
|
|
3888
|
+
ComponentDocs,
|
|
3889
|
+
ShowcaseWrapper,
|
|
3890
|
+
CollapsibleSection,
|
|
3891
|
+
Display,
|
|
3892
|
+
SectionTitle,
|
|
3893
|
+
H1,
|
|
3894
|
+
H2,
|
|
3895
|
+
H3,
|
|
3896
|
+
H4,
|
|
3897
|
+
H5,
|
|
3898
|
+
P,
|
|
3899
|
+
Small,
|
|
3900
|
+
Caption,
|
|
3901
|
+
Overline,
|
|
3902
|
+
Lead,
|
|
3903
|
+
Mono,
|
|
3904
|
+
Label,
|
|
3905
|
+
Avatar,
|
|
3906
|
+
AvatarGroup,
|
|
3907
|
+
Progress,
|
|
3908
|
+
Link,
|
|
3909
|
+
Spinner,
|
|
3910
|
+
Dot,
|
|
3911
|
+
Chip
|
|
3912
|
+
};
|