@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
package/dist/index.js
CHANGED
|
@@ -176,6 +176,7 @@ __export(src_exports, {
|
|
|
176
176
|
IconVolume: () => IconVolume,
|
|
177
177
|
IconVolumeOff: () => IconVolumeOff,
|
|
178
178
|
Input: () => Input,
|
|
179
|
+
Kbd: () => Kbd,
|
|
179
180
|
Label: () => Label,
|
|
180
181
|
Lead: () => Lead,
|
|
181
182
|
Link: () => Link,
|
|
@@ -207,6 +208,8 @@ __export(src_exports, {
|
|
|
207
208
|
THEME_INIT_SCRIPT: () => THEME_INIT_SCRIPT,
|
|
208
209
|
Table: () => Table,
|
|
209
210
|
Textarea: () => Textarea,
|
|
211
|
+
ThemeDomSync: () => ThemeDomSync,
|
|
212
|
+
ThemeSwitcher: () => ThemeSwitcher,
|
|
210
213
|
Toggle: () => Toggle,
|
|
211
214
|
Tooltip: () => Tooltip,
|
|
212
215
|
TooltipProvider: () => TooltipProvider,
|
|
@@ -1008,7 +1011,12 @@ var Card = (0, import_react7.forwardRef)(function Card2(_a, ref) {
|
|
|
1008
1011
|
className,
|
|
1009
1012
|
bodyClassName,
|
|
1010
1013
|
interactive = false,
|
|
1011
|
-
|
|
1014
|
+
href,
|
|
1015
|
+
onClick,
|
|
1016
|
+
target,
|
|
1017
|
+
rel,
|
|
1018
|
+
type,
|
|
1019
|
+
titleAs: Title3 = "h3"
|
|
1012
1020
|
} = _b, props = __objRest(_b, [
|
|
1013
1021
|
"children",
|
|
1014
1022
|
"title",
|
|
@@ -1020,36 +1028,180 @@ var Card = (0, import_react7.forwardRef)(function Card2(_a, ref) {
|
|
|
1020
1028
|
"className",
|
|
1021
1029
|
"bodyClassName",
|
|
1022
1030
|
"interactive",
|
|
1031
|
+
"href",
|
|
1032
|
+
"onClick",
|
|
1033
|
+
"target",
|
|
1034
|
+
"rel",
|
|
1035
|
+
"type",
|
|
1023
1036
|
"titleAs"
|
|
1024
1037
|
]);
|
|
1025
|
-
|
|
1026
|
-
|
|
1038
|
+
const isLink = href !== void 0;
|
|
1039
|
+
const isButton = onClick !== void 0 && !isLink;
|
|
1040
|
+
const cardClassName = cn(
|
|
1041
|
+
"ph-card",
|
|
1042
|
+
variantMap2[variant],
|
|
1043
|
+
(interactive || isLink || isButton) && "ph-card-interactive",
|
|
1044
|
+
className
|
|
1045
|
+
);
|
|
1046
|
+
const cardContent = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1047
|
+
media && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ph-card-media", children: media }),
|
|
1048
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("ph-card-body", bodyClassName), children: [
|
|
1049
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Title3, { className: "ph-card-title", children: title }),
|
|
1050
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
1051
|
+
children,
|
|
1052
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ph-card-actions", children: actions })
|
|
1053
|
+
] }),
|
|
1054
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "border-t border-ph-border px-6 py-4 text-xs text-ph-subtle", children: footer })
|
|
1055
|
+
] });
|
|
1056
|
+
if (isLink) {
|
|
1057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1058
|
+
"a",
|
|
1059
|
+
__spreadProps(__spreadValues({
|
|
1060
|
+
ref,
|
|
1061
|
+
className: cardClassName,
|
|
1062
|
+
href,
|
|
1063
|
+
target,
|
|
1064
|
+
rel,
|
|
1065
|
+
onClick
|
|
1066
|
+
}, props), {
|
|
1067
|
+
children: cardContent
|
|
1068
|
+
})
|
|
1069
|
+
);
|
|
1070
|
+
}
|
|
1071
|
+
if (isButton) {
|
|
1072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1073
|
+
"button",
|
|
1074
|
+
__spreadProps(__spreadValues({
|
|
1075
|
+
ref,
|
|
1076
|
+
type: type != null ? type : "button",
|
|
1077
|
+
className: cardClassName,
|
|
1078
|
+
onClick
|
|
1079
|
+
}, props), {
|
|
1080
|
+
children: cardContent
|
|
1081
|
+
})
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", __spreadProps(__spreadValues({ ref, className: cardClassName }, props), { children: cardContent }));
|
|
1085
|
+
});
|
|
1086
|
+
Card.displayName = "Card";
|
|
1087
|
+
|
|
1088
|
+
// src/components/ui/Kbd.tsx
|
|
1089
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1090
|
+
var platformLabels = {
|
|
1091
|
+
text: {
|
|
1092
|
+
command: "Command",
|
|
1093
|
+
cmd: "Command",
|
|
1094
|
+
option: "Option",
|
|
1095
|
+
alt: "Alt",
|
|
1096
|
+
control: "Control",
|
|
1097
|
+
ctrl: "Control",
|
|
1098
|
+
shift: "Shift"
|
|
1099
|
+
},
|
|
1100
|
+
mac: {
|
|
1101
|
+
command: "\u2318",
|
|
1102
|
+
cmd: "\u2318",
|
|
1103
|
+
option: "\u2325",
|
|
1104
|
+
alt: "\u2325",
|
|
1105
|
+
control: "\u2303",
|
|
1106
|
+
ctrl: "\u2303",
|
|
1107
|
+
shift: "\u21E7"
|
|
1108
|
+
},
|
|
1109
|
+
windows: {
|
|
1110
|
+
command: "Win",
|
|
1111
|
+
cmd: "Win",
|
|
1112
|
+
option: "Alt",
|
|
1113
|
+
alt: "Alt",
|
|
1114
|
+
control: "Ctrl",
|
|
1115
|
+
ctrl: "Ctrl",
|
|
1116
|
+
shift: "Shift"
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
var spokenLabels = {
|
|
1120
|
+
"\u2318": "Command",
|
|
1121
|
+
"\u2325": "Option",
|
|
1122
|
+
"\u2303": "Control",
|
|
1123
|
+
"\u21E7": "Shift",
|
|
1124
|
+
"\u21B5": "Enter",
|
|
1125
|
+
"\u23CE": "Enter",
|
|
1126
|
+
"\u232B": "Backspace",
|
|
1127
|
+
"\u238B": "Escape"
|
|
1128
|
+
};
|
|
1129
|
+
function Kbd(_a) {
|
|
1130
|
+
var _b = _a, {
|
|
1131
|
+
variant = "shortcut",
|
|
1132
|
+
keys,
|
|
1133
|
+
platform = "text",
|
|
1134
|
+
separator,
|
|
1135
|
+
children,
|
|
1136
|
+
className,
|
|
1137
|
+
"aria-label": ariaLabel
|
|
1138
|
+
} = _b, props = __objRest(_b, [
|
|
1139
|
+
"variant",
|
|
1140
|
+
"keys",
|
|
1141
|
+
"platform",
|
|
1142
|
+
"separator",
|
|
1143
|
+
"children",
|
|
1144
|
+
"className",
|
|
1145
|
+
"aria-label"
|
|
1146
|
+
]);
|
|
1147
|
+
if (variant === "token") {
|
|
1148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1149
|
+
"code",
|
|
1150
|
+
__spreadProps(__spreadValues({
|
|
1151
|
+
className: cn("ph-code-token ph-kbd", className),
|
|
1152
|
+
role: ariaLabel ? "img" : void 0,
|
|
1153
|
+
"aria-label": ariaLabel
|
|
1154
|
+
}, props), {
|
|
1155
|
+
children
|
|
1156
|
+
})
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
const sourceKeys = (keys == null ? void 0 : keys.length) ? keys : children != null ? [children] : [];
|
|
1160
|
+
const displayKeys = sourceKeys.map((key) => formatKey(key, platform));
|
|
1161
|
+
const accessibleLabel = ariaLabel != null ? ariaLabel : getShortcutLabel(displayKeys);
|
|
1162
|
+
if (variant === "key") {
|
|
1163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1164
|
+
"kbd",
|
|
1165
|
+
__spreadProps(__spreadValues({
|
|
1166
|
+
className: cn("ph-keycap", className),
|
|
1167
|
+
role: accessibleLabel ? "img" : void 0,
|
|
1168
|
+
"aria-label": accessibleLabel
|
|
1169
|
+
}, props), {
|
|
1170
|
+
children: displayKeys[0]
|
|
1171
|
+
})
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1175
|
+
"kbd",
|
|
1027
1176
|
__spreadProps(__spreadValues({
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
variantMap2[variant],
|
|
1032
|
-
interactive && "ph-card-interactive",
|
|
1033
|
-
className
|
|
1034
|
-
)
|
|
1177
|
+
className: cn("ph-shortcut-group ph-keycap", className),
|
|
1178
|
+
role: accessibleLabel ? "img" : void 0,
|
|
1179
|
+
"aria-label": accessibleLabel
|
|
1035
1180
|
}, props), {
|
|
1036
|
-
children: [
|
|
1037
|
-
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1039
|
-
|
|
1040
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
1041
|
-
children,
|
|
1042
|
-
actions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ph-card-actions", children: actions })
|
|
1043
|
-
] }),
|
|
1044
|
-
footer && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "border-t border-ph-border px-6 py-4 text-xs text-ph-subtle", children: footer })
|
|
1045
|
-
]
|
|
1181
|
+
children: displayKeys.map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "contents", children: [
|
|
1182
|
+
index > 0 && separator != null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ph-shortcut-separator", "aria-hidden": "true", children: separator }) : null,
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ph-shortcut-key", "aria-hidden": accessibleLabel ? true : void 0, children: key })
|
|
1184
|
+
] }, index))
|
|
1046
1185
|
})
|
|
1047
1186
|
);
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1187
|
+
}
|
|
1188
|
+
function formatKey(key, platform) {
|
|
1189
|
+
var _a;
|
|
1190
|
+
if (typeof key !== "string") return key;
|
|
1191
|
+
return (_a = platformLabels[platform][key.toLowerCase()]) != null ? _a : key;
|
|
1192
|
+
}
|
|
1193
|
+
function getShortcutLabel(keys) {
|
|
1194
|
+
const labels = keys.map((key) => {
|
|
1195
|
+
var _a;
|
|
1196
|
+
if (typeof key !== "string" && typeof key !== "number") return null;
|
|
1197
|
+
const value = String(key);
|
|
1198
|
+
return (_a = spokenLabels[value]) != null ? _a : value;
|
|
1199
|
+
});
|
|
1200
|
+
return labels.every((label) => label != null) ? labels.join(" + ") : void 0;
|
|
1201
|
+
}
|
|
1050
1202
|
|
|
1051
1203
|
// src/components/ui/Loader.tsx
|
|
1052
|
-
var
|
|
1204
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1053
1205
|
var loaderSizeClass = {
|
|
1054
1206
|
sm: "ph-loader-sm",
|
|
1055
1207
|
md: "ph-loader-md",
|
|
@@ -1075,7 +1227,7 @@ function Loader(_a) {
|
|
|
1075
1227
|
"label",
|
|
1076
1228
|
"className"
|
|
1077
1229
|
]);
|
|
1078
|
-
return /* @__PURE__ */ (0,
|
|
1230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1079
1231
|
"span",
|
|
1080
1232
|
__spreadProps(__spreadValues({
|
|
1081
1233
|
role: "status",
|
|
@@ -1083,20 +1235,20 @@ function Loader(_a) {
|
|
|
1083
1235
|
className: cn("ph-loader", loaderSizeClass[size], className)
|
|
1084
1236
|
}, props), {
|
|
1085
1237
|
children: [
|
|
1086
|
-
variant === "spinner" ? /* @__PURE__ */ (0,
|
|
1087
|
-
variant === "dots" ? /* @__PURE__ */ (0,
|
|
1088
|
-
/* @__PURE__ */ (0,
|
|
1089
|
-
/* @__PURE__ */ (0,
|
|
1090
|
-
/* @__PURE__ */ (0,
|
|
1238
|
+
variant === "spinner" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ph-loading", "aria-hidden": true }) : null,
|
|
1239
|
+
variant === "dots" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "ph-loading-dots", "aria-hidden": true, children: [
|
|
1240
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", {}),
|
|
1241
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", {}),
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", {})
|
|
1091
1243
|
] }) : null,
|
|
1092
|
-
variant === "pulse" ? /* @__PURE__ */ (0,
|
|
1244
|
+
variant === "pulse" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ph-loading-pulse", "aria-hidden": true }) : null
|
|
1093
1245
|
]
|
|
1094
1246
|
})
|
|
1095
1247
|
);
|
|
1096
1248
|
}
|
|
1097
1249
|
function Skeleton(_a) {
|
|
1098
1250
|
var _b = _a, { shape = "text", className } = _b, props = __objRest(_b, ["shape", "className"]);
|
|
1099
|
-
return /* @__PURE__ */ (0,
|
|
1251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1100
1252
|
"span",
|
|
1101
1253
|
__spreadValues({
|
|
1102
1254
|
className: cn("ph-skeleton", skeletonShapeClass[shape], className),
|
|
@@ -1120,53 +1272,53 @@ function LoadingState(_a) {
|
|
|
1120
1272
|
"size",
|
|
1121
1273
|
"className"
|
|
1122
1274
|
]);
|
|
1123
|
-
return /* @__PURE__ */ (0,
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1127
|
-
description ? /* @__PURE__ */ (0,
|
|
1275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-loading-state", className), role: "status", "aria-label": label }, props), { children: [
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Loader, { variant, size, label, "aria-hidden": "true" }),
|
|
1277
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ph-loading-state__copy", children: [
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: title }),
|
|
1279
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: description }) : null
|
|
1128
1280
|
] })
|
|
1129
1281
|
] }));
|
|
1130
1282
|
}
|
|
1131
1283
|
|
|
1132
1284
|
// src/components/ui/AuthLayout.tsx
|
|
1133
1285
|
var import_react8 = require("react");
|
|
1134
|
-
var
|
|
1286
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1135
1287
|
function AuthLayout(_a) {
|
|
1136
1288
|
var _b = _a, { brand, footer, aside, children, className } = _b, props = __objRest(_b, ["brand", "footer", "aside", "children", "className"]);
|
|
1137
|
-
return /* @__PURE__ */ (0,
|
|
1138
|
-
aside ? /* @__PURE__ */ (0,
|
|
1139
|
-
/* @__PURE__ */ (0,
|
|
1140
|
-
brand ? /* @__PURE__ */ (0,
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-auth-layout", aside != null && "ph-auth-layout--split", className) }, props), { children: [
|
|
1290
|
+
aside ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("aside", { className: "ph-auth-layout__aside", children: aside }) : null,
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "ph-auth-layout__main", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "ph-auth-layout__column", children: [
|
|
1292
|
+
brand ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "ph-auth-layout__brand", children: brand }) : null,
|
|
1141
1293
|
children,
|
|
1142
|
-
footer ? /* @__PURE__ */ (0,
|
|
1294
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("footer", { className: "ph-auth-layout__footer", children: footer }) : null
|
|
1143
1295
|
] }) })
|
|
1144
1296
|
] }));
|
|
1145
1297
|
}
|
|
1146
1298
|
function AuthCard(_a) {
|
|
1147
1299
|
var _b = _a, { title, description, footer, children, className } = _b, props = __objRest(_b, ["title", "description", "footer", "children", "className"]);
|
|
1148
1300
|
const titleId = (0, import_react8.useId)();
|
|
1149
|
-
return /* @__PURE__ */ (0,
|
|
1150
|
-
/* @__PURE__ */ (0,
|
|
1151
|
-
/* @__PURE__ */ (0,
|
|
1152
|
-
description ? /* @__PURE__ */ (0,
|
|
1301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", __spreadProps(__spreadValues({ className: cn("ph-auth-card", className), "aria-labelledby": titleId }, props), { children: [
|
|
1302
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("header", { className: "ph-auth-card__header", children: [
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h1", { id: titleId, children: title }),
|
|
1304
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: description }) : null
|
|
1153
1305
|
] }),
|
|
1154
|
-
/* @__PURE__ */ (0,
|
|
1155
|
-
footer ? /* @__PURE__ */ (0,
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "ph-auth-card__body", children }),
|
|
1307
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("footer", { className: "ph-auth-card__footer", children: footer }) : null
|
|
1156
1308
|
] }));
|
|
1157
1309
|
}
|
|
1158
1310
|
function AuthDivider(_a) {
|
|
1159
1311
|
var _b = _a, { children = "or continue with", className } = _b, props = __objRest(_b, ["children", "className"]);
|
|
1160
|
-
return /* @__PURE__ */ (0,
|
|
1312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-auth-divider", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children }) }));
|
|
1161
1313
|
}
|
|
1162
1314
|
|
|
1163
1315
|
// src/components/ui/SettingsLayout.tsx
|
|
1164
|
-
var
|
|
1316
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1165
1317
|
function SettingsNav(_a) {
|
|
1166
1318
|
var _b = _a, { groups, className } = _b, props = __objRest(_b, ["groups", "className"]);
|
|
1167
|
-
return /* @__PURE__ */ (0,
|
|
1168
|
-
/* @__PURE__ */ (0,
|
|
1169
|
-
/* @__PURE__ */ (0,
|
|
1319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-settings-nav", className) }, props), { children: groups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "ph-settings-nav__group", children: [
|
|
1320
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "ph-settings-nav__heading", children: group.label }),
|
|
1321
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-settings-nav__items", children: group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1170
1322
|
"a",
|
|
1171
1323
|
{
|
|
1172
1324
|
href: item.href,
|
|
@@ -1178,9 +1330,9 @@ function SettingsNav(_a) {
|
|
|
1178
1330
|
),
|
|
1179
1331
|
"aria-current": item.active ? "page" : void 0,
|
|
1180
1332
|
children: [
|
|
1181
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
1182
|
-
/* @__PURE__ */ (0,
|
|
1183
|
-
item.badge ? /* @__PURE__ */ (0,
|
|
1333
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "ph-settings-nav__icon", children: item.icon }) : null,
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: item.label }),
|
|
1335
|
+
item.badge ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "ph-settings-nav__badge", children: item.badge }) : null
|
|
1184
1336
|
]
|
|
1185
1337
|
},
|
|
1186
1338
|
item.id
|
|
@@ -1205,31 +1357,31 @@ function SettingsLayout(_a) {
|
|
|
1205
1357
|
"children",
|
|
1206
1358
|
"className"
|
|
1207
1359
|
]);
|
|
1208
|
-
return /* @__PURE__ */ (0,
|
|
1209
|
-
/* @__PURE__ */ (0,
|
|
1210
|
-
/* @__PURE__ */ (0,
|
|
1211
|
-
/* @__PURE__ */ (0,
|
|
1212
|
-
description ? /* @__PURE__ */ (0,
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", __spreadProps(__spreadValues({ className: cn("ph-settings-layout", className) }, props), { children: [
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { className: "ph-settings-layout__header", children: [
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
1363
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { children: title }),
|
|
1364
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: description }) : null
|
|
1213
1365
|
] }),
|
|
1214
|
-
actions ? /* @__PURE__ */ (0,
|
|
1366
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-settings-layout__actions", children: actions }) : null
|
|
1215
1367
|
] }),
|
|
1216
|
-
/* @__PURE__ */ (0,
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1218
|
-
/* @__PURE__ */ (0,
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { className: "ph-settings-layout__mobile-nav", children: [
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("summary", { children: [
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconTuning, { className: "h-4 w-4", "aria-hidden": true }),
|
|
1219
1371
|
"Settings menu"
|
|
1220
1372
|
] }),
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("nav", { "aria-label": navigationLabel, children: navigation })
|
|
1222
1374
|
] }),
|
|
1223
|
-
/* @__PURE__ */ (0,
|
|
1224
|
-
/* @__PURE__ */ (0,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "ph-settings-layout__grid", children: [
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("aside", { className: "ph-settings-layout__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("nav", { "aria-label": navigationLabel, children: navigation }) }),
|
|
1377
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ph-settings-layout__content", children })
|
|
1226
1378
|
] })
|
|
1227
1379
|
] }));
|
|
1228
1380
|
}
|
|
1229
1381
|
|
|
1230
1382
|
// src/components/ui/DropdownMenu.tsx
|
|
1231
1383
|
var DropdownPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1232
|
-
var
|
|
1384
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1233
1385
|
var sizeClass2 = {
|
|
1234
1386
|
xs: "ph-btn-xs",
|
|
1235
1387
|
sm: "ph-btn-sm",
|
|
@@ -1251,7 +1403,7 @@ function DropdownContent({
|
|
|
1251
1403
|
avoidCollisions = true,
|
|
1252
1404
|
panelClassName
|
|
1253
1405
|
}) {
|
|
1254
|
-
return /* @__PURE__ */ (0,
|
|
1406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1255
1407
|
DropdownPrimitive.Content,
|
|
1256
1408
|
{
|
|
1257
1409
|
className: cn("ph-dropdown-panel", panelClassName),
|
|
@@ -1264,7 +1416,7 @@ function DropdownContent({
|
|
|
1264
1416
|
sticky: "partial",
|
|
1265
1417
|
children: [
|
|
1266
1418
|
children,
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1419
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1268
1420
|
DropdownPrimitive.Arrow,
|
|
1269
1421
|
{
|
|
1270
1422
|
className: "ph-dropdown-arrow",
|
|
@@ -1316,7 +1468,7 @@ function DropdownMenu(_a) {
|
|
|
1316
1468
|
"modal",
|
|
1317
1469
|
"disabled"
|
|
1318
1470
|
]);
|
|
1319
|
-
return /* @__PURE__ */ (0,
|
|
1471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1320
1472
|
DropdownPrimitive.Root,
|
|
1321
1473
|
{
|
|
1322
1474
|
open,
|
|
@@ -1324,7 +1476,7 @@ function DropdownMenu(_a) {
|
|
|
1324
1476
|
onOpenChange,
|
|
1325
1477
|
modal,
|
|
1326
1478
|
children: [
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1328
1480
|
"button",
|
|
1329
1481
|
{
|
|
1330
1482
|
type: "button",
|
|
@@ -1335,7 +1487,7 @@ function DropdownMenu(_a) {
|
|
|
1335
1487
|
children: trigger
|
|
1336
1488
|
}
|
|
1337
1489
|
) }),
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1339
1491
|
DropdownContent,
|
|
1340
1492
|
{
|
|
1341
1493
|
align,
|
|
@@ -1400,8 +1552,8 @@ function DropdownButton(_a) {
|
|
|
1400
1552
|
"modal",
|
|
1401
1553
|
"disabled"
|
|
1402
1554
|
]);
|
|
1403
|
-
const trailing = sideIcon != null ? sideIcon : /* @__PURE__ */ (0,
|
|
1404
|
-
return /* @__PURE__ */ (0,
|
|
1555
|
+
const trailing = sideIcon != null ? sideIcon : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconChevronDown, { className: "h-4 w-4", "aria-hidden": true });
|
|
1556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadProps(__spreadValues({ className: cn("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1405
1557
|
DropdownPrimitive.Root,
|
|
1406
1558
|
{
|
|
1407
1559
|
open,
|
|
@@ -1409,7 +1561,7 @@ function DropdownButton(_a) {
|
|
|
1409
1561
|
onOpenChange,
|
|
1410
1562
|
modal,
|
|
1411
1563
|
children: [
|
|
1412
|
-
/* @__PURE__ */ (0,
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1413
1565
|
"button",
|
|
1414
1566
|
{
|
|
1415
1567
|
type: "button",
|
|
@@ -1422,7 +1574,7 @@ function DropdownButton(_a) {
|
|
|
1422
1574
|
split && "ph-btn-split"
|
|
1423
1575
|
),
|
|
1424
1576
|
"aria-label": ariaLabel,
|
|
1425
|
-
children: /* @__PURE__ */ (0,
|
|
1577
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1426
1578
|
ButtonChrome,
|
|
1427
1579
|
{
|
|
1428
1580
|
label,
|
|
@@ -1433,7 +1585,7 @@ function DropdownButton(_a) {
|
|
|
1433
1585
|
)
|
|
1434
1586
|
}
|
|
1435
1587
|
) }),
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1588
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1437
1589
|
DropdownContent,
|
|
1438
1590
|
{
|
|
1439
1591
|
align,
|
|
@@ -1460,7 +1612,7 @@ function DropdownItem(_a) {
|
|
|
1460
1612
|
"children",
|
|
1461
1613
|
"disabled"
|
|
1462
1614
|
]);
|
|
1463
|
-
return /* @__PURE__ */ (0,
|
|
1615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownPrimitive.Item, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1464
1616
|
"button",
|
|
1465
1617
|
__spreadProps(__spreadValues({
|
|
1466
1618
|
type: "button",
|
|
@@ -1472,7 +1624,7 @@ function DropdownItem(_a) {
|
|
|
1472
1624
|
) });
|
|
1473
1625
|
}
|
|
1474
1626
|
function DropdownRadioGroup(props) {
|
|
1475
|
-
return /* @__PURE__ */ (0,
|
|
1627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownPrimitive.RadioGroup, __spreadValues({}, props));
|
|
1476
1628
|
}
|
|
1477
1629
|
function DropdownRadioItem(_a) {
|
|
1478
1630
|
var _b = _a, {
|
|
@@ -1482,14 +1634,14 @@ function DropdownRadioItem(_a) {
|
|
|
1482
1634
|
"className",
|
|
1483
1635
|
"children"
|
|
1484
1636
|
]);
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1486
1638
|
DropdownPrimitive.RadioItem,
|
|
1487
1639
|
__spreadProps(__spreadValues({
|
|
1488
1640
|
className: cn("ph-dropdown-item ph-dropdown-radio-item", className)
|
|
1489
1641
|
}, props), {
|
|
1490
1642
|
children: [
|
|
1491
|
-
/* @__PURE__ */ (0,
|
|
1492
|
-
/* @__PURE__ */ (0,
|
|
1643
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ph-dropdown-item-indicator", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconCheck, { className: "h-3.5 w-3.5" }) }) }),
|
|
1644
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children })
|
|
1493
1645
|
]
|
|
1494
1646
|
})
|
|
1495
1647
|
);
|
|
@@ -1497,10 +1649,11 @@ function DropdownRadioItem(_a) {
|
|
|
1497
1649
|
|
|
1498
1650
|
// src/components/ui/Input.tsx
|
|
1499
1651
|
var import_react10 = require("react");
|
|
1652
|
+
var import_iconoir_react = require("iconoir-react");
|
|
1500
1653
|
|
|
1501
1654
|
// src/components/ui/FormField.tsx
|
|
1502
1655
|
var import_react9 = require("react");
|
|
1503
|
-
var
|
|
1656
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1504
1657
|
function FormField(_a) {
|
|
1505
1658
|
var _b = _a, {
|
|
1506
1659
|
controlId,
|
|
@@ -1529,30 +1682,30 @@ function FormField(_a) {
|
|
|
1529
1682
|
const errorId = error ? `${id}-error` : void 0;
|
|
1530
1683
|
const controlProps = {
|
|
1531
1684
|
id,
|
|
1532
|
-
"aria-describedby": descriptionId,
|
|
1685
|
+
"aria-describedby": errorId != null ? errorId : descriptionId,
|
|
1533
1686
|
"aria-errormessage": errorId,
|
|
1534
1687
|
"aria-invalid": error ? true : void 0
|
|
1535
1688
|
};
|
|
1536
|
-
return /* @__PURE__ */ (0,
|
|
1537
|
-
label ? /* @__PURE__ */ (0,
|
|
1689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-field", className) }, props), { children: [
|
|
1690
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1538
1691
|
"label",
|
|
1539
1692
|
{
|
|
1540
1693
|
htmlFor: id,
|
|
1541
1694
|
className: cn("ph-label", hideLabel && "sr-only", disabled && "opacity-50"),
|
|
1542
1695
|
children: [
|
|
1543
1696
|
label,
|
|
1544
|
-
required ? /* @__PURE__ */ (0,
|
|
1697
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "aria-hidden": "true", children: " *" }) : null
|
|
1545
1698
|
]
|
|
1546
1699
|
}
|
|
1547
1700
|
) : null,
|
|
1548
1701
|
typeof children === "function" ? children(controlProps) : children,
|
|
1549
|
-
descriptionId ? /* @__PURE__ */ (0,
|
|
1550
|
-
errorId ? /* @__PURE__ */ (0,
|
|
1702
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { id: descriptionId, className: "mt-1 text-xs text-ph-subtle", children: helperText }) : null,
|
|
1703
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { id: errorId, className: "mt-1 text-xs font-medium text-ph-danger", children: error }) : null
|
|
1551
1704
|
] }));
|
|
1552
1705
|
}
|
|
1553
1706
|
|
|
1554
1707
|
// src/components/ui/Input.tsx
|
|
1555
|
-
var
|
|
1708
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1556
1709
|
var sizeMap2 = {
|
|
1557
1710
|
sm: "ph-input-sm",
|
|
1558
1711
|
md: "",
|
|
@@ -1571,6 +1724,7 @@ var Input = (0, import_react10.forwardRef)(function Input2(_a, ref) {
|
|
|
1571
1724
|
helperText,
|
|
1572
1725
|
size = "md",
|
|
1573
1726
|
variant = "default",
|
|
1727
|
+
type = "text",
|
|
1574
1728
|
className,
|
|
1575
1729
|
wrapperClassName,
|
|
1576
1730
|
disabled,
|
|
@@ -1584,6 +1738,7 @@ var Input = (0, import_react10.forwardRef)(function Input2(_a, ref) {
|
|
|
1584
1738
|
"helperText",
|
|
1585
1739
|
"size",
|
|
1586
1740
|
"variant",
|
|
1741
|
+
"type",
|
|
1587
1742
|
"className",
|
|
1588
1743
|
"wrapperClassName",
|
|
1589
1744
|
"disabled",
|
|
@@ -1593,7 +1748,9 @@ var Input = (0, import_react10.forwardRef)(function Input2(_a, ref) {
|
|
|
1593
1748
|
const autoId = (0, import_react10.useId)();
|
|
1594
1749
|
const id = idProp != null ? idProp : autoId;
|
|
1595
1750
|
const hasError = Boolean(error);
|
|
1596
|
-
|
|
1751
|
+
const isPassword = type === "password";
|
|
1752
|
+
const [revealed, setRevealed] = (0, import_react10.useState)(false);
|
|
1753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1597
1754
|
FormField,
|
|
1598
1755
|
{
|
|
1599
1756
|
controlId: id,
|
|
@@ -1604,23 +1761,39 @@ var Input = (0, import_react10.forwardRef)(function Input2(_a, ref) {
|
|
|
1604
1761
|
required,
|
|
1605
1762
|
disabled,
|
|
1606
1763
|
className: wrapperClassName,
|
|
1607
|
-
children: (fieldProps) => /* @__PURE__ */ (0,
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
"
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1764
|
+
children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative", children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1766
|
+
"input",
|
|
1767
|
+
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1768
|
+
ref,
|
|
1769
|
+
type: isPassword && revealed ? "text" : type,
|
|
1770
|
+
disabled,
|
|
1771
|
+
required,
|
|
1772
|
+
"aria-describedby": joinIds(ariaDescribedBy, fieldProps["aria-describedby"]),
|
|
1773
|
+
className: cn(
|
|
1774
|
+
"ph-input w-full",
|
|
1775
|
+
isPassword && "pr-10",
|
|
1776
|
+
sizeMap2[size],
|
|
1777
|
+
variant === "ghost" && "ph-input-ghost",
|
|
1778
|
+
hasError && "ph-input-error",
|
|
1779
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
1780
|
+
className
|
|
1781
|
+
)
|
|
1782
|
+
}), props)
|
|
1783
|
+
),
|
|
1784
|
+
isPassword ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1785
|
+
"button",
|
|
1786
|
+
{
|
|
1787
|
+
type: "button",
|
|
1788
|
+
onClick: () => setRevealed((current) => !current),
|
|
1789
|
+
"aria-label": revealed ? "Hide password" : "Show password",
|
|
1790
|
+
"aria-pressed": revealed,
|
|
1791
|
+
disabled,
|
|
1792
|
+
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",
|
|
1793
|
+
children: revealed ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_iconoir_react.EyeClosed, { className: "h-4 w-4", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_iconoir_react.Eye, { className: "h-4 w-4", "aria-hidden": true })
|
|
1794
|
+
}
|
|
1795
|
+
) : null
|
|
1796
|
+
] })
|
|
1624
1797
|
}
|
|
1625
1798
|
);
|
|
1626
1799
|
});
|
|
@@ -1656,7 +1829,7 @@ var Select = (0, import_react10.forwardRef)(function Select2(_a, ref) {
|
|
|
1656
1829
|
const autoId = (0, import_react10.useId)();
|
|
1657
1830
|
const id = idProp != null ? idProp : autoId;
|
|
1658
1831
|
const hasError = Boolean(error);
|
|
1659
|
-
return /* @__PURE__ */ (0,
|
|
1832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1660
1833
|
"select",
|
|
1661
1834
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1662
1835
|
ref,
|
|
@@ -1705,7 +1878,7 @@ var Textarea = (0, import_react10.forwardRef)(function Textarea2(_a, ref) {
|
|
|
1705
1878
|
const autoId = (0, import_react10.useId)();
|
|
1706
1879
|
const id = idProp != null ? idProp : autoId;
|
|
1707
1880
|
const hasError = Boolean(error);
|
|
1708
|
-
return /* @__PURE__ */ (0,
|
|
1881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1709
1882
|
"textarea",
|
|
1710
1883
|
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
1711
1884
|
ref,
|
|
@@ -1748,9 +1921,9 @@ var Checkbox = (0, import_react10.forwardRef)(function Checkbox2(_a, ref) {
|
|
|
1748
1921
|
const hasError = Boolean(error);
|
|
1749
1922
|
const descriptionId = helperText && !hasError ? `${id}-description` : void 0;
|
|
1750
1923
|
const errorId = error ? `${id}-error` : void 0;
|
|
1751
|
-
return /* @__PURE__ */ (0,
|
|
1752
|
-
/* @__PURE__ */ (0,
|
|
1753
|
-
/* @__PURE__ */ (0,
|
|
1924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("ph-control-row", wrapperClassName), children: [
|
|
1925
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "ph-checkbox-wrap", children: [
|
|
1926
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1754
1927
|
"input",
|
|
1755
1928
|
__spreadValues({
|
|
1756
1929
|
ref,
|
|
@@ -1758,7 +1931,7 @@ var Checkbox = (0, import_react10.forwardRef)(function Checkbox2(_a, ref) {
|
|
|
1758
1931
|
type: "checkbox",
|
|
1759
1932
|
disabled,
|
|
1760
1933
|
"aria-invalid": hasError || void 0,
|
|
1761
|
-
"aria-describedby": joinIds(ariaDescribedBy, descriptionId),
|
|
1934
|
+
"aria-describedby": joinIds(ariaDescribedBy, descriptionId, errorId),
|
|
1762
1935
|
"aria-errormessage": errorId,
|
|
1763
1936
|
className: cn(
|
|
1764
1937
|
"ph-checkbox",
|
|
@@ -1768,12 +1941,12 @@ var Checkbox = (0, import_react10.forwardRef)(function Checkbox2(_a, ref) {
|
|
|
1768
1941
|
)
|
|
1769
1942
|
}, props)
|
|
1770
1943
|
),
|
|
1771
|
-
/* @__PURE__ */ (0,
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconCheck, { className: "ph-checkbox-icon", "aria-hidden": true })
|
|
1772
1945
|
] }),
|
|
1773
|
-
/* @__PURE__ */ (0,
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
descriptionId ? /* @__PURE__ */ (0,
|
|
1776
|
-
errorId ? /* @__PURE__ */ (0,
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "ph-control-copy", children: [
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label }),
|
|
1948
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { id: descriptionId, className: "text-xs text-ph-subtle", children: helperText }) : null,
|
|
1949
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { id: errorId, className: "text-xs font-medium text-ph-danger", children: error }) : null
|
|
1777
1950
|
] })
|
|
1778
1951
|
] });
|
|
1779
1952
|
});
|
|
@@ -1794,8 +1967,8 @@ var Radio = (0, import_react10.forwardRef)(function Radio2(_a, ref) {
|
|
|
1794
1967
|
]);
|
|
1795
1968
|
const autoId = (0, import_react10.useId)();
|
|
1796
1969
|
const id = idProp != null ? idProp : autoId;
|
|
1797
|
-
return /* @__PURE__ */ (0,
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("ph-control-row", wrapperClassName, disabled && "opacity-60"), children: [
|
|
1971
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1799
1972
|
"input",
|
|
1800
1973
|
__spreadValues({
|
|
1801
1974
|
ref,
|
|
@@ -1805,7 +1978,7 @@ var Radio = (0, import_react10.forwardRef)(function Radio2(_a, ref) {
|
|
|
1805
1978
|
className: cn("ph-radio", disabled && "cursor-not-allowed", className)
|
|
1806
1979
|
}, props)
|
|
1807
1980
|
),
|
|
1808
|
-
/* @__PURE__ */ (0,
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label })
|
|
1809
1982
|
] });
|
|
1810
1983
|
});
|
|
1811
1984
|
Radio.displayName = "Radio";
|
|
@@ -1825,9 +1998,9 @@ var Toggle = (0, import_react10.forwardRef)(function Toggle2(_a, ref) {
|
|
|
1825
1998
|
]);
|
|
1826
1999
|
const autoId = (0, import_react10.useId)();
|
|
1827
2000
|
const id = idProp != null ? idProp : autoId;
|
|
1828
|
-
return /* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
2001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: cn("ph-control-row-between", wrapperClassName, disabled && "opacity-60"), children: [
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: disabled ? "opacity-60" : void 0, children: label }),
|
|
2003
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1831
2004
|
"input",
|
|
1832
2005
|
__spreadValues({
|
|
1833
2006
|
ref,
|
|
@@ -1861,13 +2034,13 @@ var Range = (0, import_react10.forwardRef)(function Range2(_a, ref) {
|
|
|
1861
2034
|
]);
|
|
1862
2035
|
const autoId = (0, import_react10.useId)();
|
|
1863
2036
|
const id = idProp != null ? idProp : autoId;
|
|
1864
|
-
return /* @__PURE__ */ (0,
|
|
1865
|
-
label && /* @__PURE__ */ (0,
|
|
1866
|
-
/* @__PURE__ */ (0,
|
|
1867
|
-
(minLabel || valueLabel || maxLabel) && /* @__PURE__ */ (0,
|
|
1868
|
-
/* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1870
|
-
/* @__PURE__ */ (0,
|
|
2037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2038
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", __spreadValues({ ref, id, type: "range", className: cn("ph-range", className) }, props)),
|
|
2040
|
+
(minLabel || valueLabel || maxLabel) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex justify-between text-xs text-ph-mutedtext", children: [
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: minLabel }),
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: valueLabel }),
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: maxLabel })
|
|
1871
2044
|
] })
|
|
1872
2045
|
] });
|
|
1873
2046
|
});
|
|
@@ -1888,10 +2061,10 @@ var FileUpload = (0, import_react10.forwardRef)(function FileUpload2(_a, ref) {
|
|
|
1888
2061
|
]);
|
|
1889
2062
|
const autoId = (0, import_react10.useId)();
|
|
1890
2063
|
const id = idProp != null ? idProp : autoId;
|
|
1891
|
-
return /* @__PURE__ */ (0,
|
|
1892
|
-
label && /* @__PURE__ */ (0,
|
|
1893
|
-
/* @__PURE__ */ (0,
|
|
1894
|
-
/* @__PURE__ */ (0,
|
|
2064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
|
|
2065
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
2066
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { htmlFor: id, className: "ph-file-upload", children: [
|
|
2067
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", __spreadValues({ ref, id, type: "file", className: cn("sr-only", className) }, props)),
|
|
1895
2068
|
prompt
|
|
1896
2069
|
] })
|
|
1897
2070
|
] });
|
|
@@ -1901,7 +2074,7 @@ FileUpload.displayName = "FileUpload";
|
|
|
1901
2074
|
// src/components/ui/Modal.tsx
|
|
1902
2075
|
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
1903
2076
|
var import_react11 = require("react");
|
|
1904
|
-
var
|
|
2077
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1905
2078
|
var sizeMap3 = {
|
|
1906
2079
|
sm: "max-w-sm",
|
|
1907
2080
|
md: "max-w-lg",
|
|
@@ -1918,6 +2091,7 @@ function Modal({
|
|
|
1918
2091
|
footer,
|
|
1919
2092
|
size = "md",
|
|
1920
2093
|
className,
|
|
2094
|
+
bodyClassName,
|
|
1921
2095
|
customLayout = false,
|
|
1922
2096
|
showCloseButton = true,
|
|
1923
2097
|
closeOnOutsideClick = true,
|
|
@@ -1931,15 +2105,15 @@ function Modal({
|
|
|
1931
2105
|
}) {
|
|
1932
2106
|
const canDismiss = Boolean(onClose);
|
|
1933
2107
|
const restoreFocusRef = (0, import_react11.useRef)(null);
|
|
1934
|
-
return /* @__PURE__ */ (0,
|
|
2108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1935
2109
|
Dialog.Root,
|
|
1936
2110
|
{
|
|
1937
2111
|
open,
|
|
1938
2112
|
onOpenChange: (nextOpen) => {
|
|
1939
2113
|
if (!nextOpen) onClose == null ? void 0 : onClose();
|
|
1940
2114
|
},
|
|
1941
|
-
children: /* @__PURE__ */ (0,
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
2115
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Dialog.Portal, { children: [
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1943
2117
|
Dialog.Overlay,
|
|
1944
2118
|
{
|
|
1945
2119
|
"data-test": dataTest,
|
|
@@ -1947,7 +2121,7 @@ function Modal({
|
|
|
1947
2121
|
style: zIndex ? { zIndex } : void 0
|
|
1948
2122
|
}
|
|
1949
2123
|
),
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1951
2125
|
Dialog.Content,
|
|
1952
2126
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({
|
|
1953
2127
|
id,
|
|
@@ -1970,28 +2144,28 @@ function Modal({
|
|
|
1970
2144
|
onPointerDownOutside: (event) => {
|
|
1971
2145
|
if (!canDismiss || !closeOnOutsideClick) event.preventDefault();
|
|
1972
2146
|
},
|
|
1973
|
-
children: customLayout ? /* @__PURE__ */ (0,
|
|
1974
|
-
/* @__PURE__ */ (0,
|
|
2147
|
+
children: customLayout ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2148
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
1975
2149
|
children
|
|
1976
|
-
] }) : /* @__PURE__ */ (0,
|
|
1977
|
-
title ? null : /* @__PURE__ */ (0,
|
|
1978
|
-
title || description || showCloseButton && canDismiss ? /* @__PURE__ */ (0,
|
|
1979
|
-
/* @__PURE__ */ (0,
|
|
1980
|
-
title ? /* @__PURE__ */ (0,
|
|
1981
|
-
description ? /* @__PURE__ */ (0,
|
|
2150
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2151
|
+
title ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
2152
|
+
title || description || showCloseButton && canDismiss ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("header", { className: "ph-modal-header", children: [
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0", children: [
|
|
2154
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog.Title, { className: "text-lg font-bold text-ph-ink", children: title }) : null,
|
|
2155
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog.Description, { className: "mt-1 text-sm text-ph-subtle", children: description }) : null
|
|
1982
2156
|
] }),
|
|
1983
|
-
showCloseButton && canDismiss ? /* @__PURE__ */ (0,
|
|
2157
|
+
showCloseButton && canDismiss ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1984
2158
|
"button",
|
|
1985
2159
|
{
|
|
1986
2160
|
type: "button",
|
|
1987
2161
|
className: "ph-modal-close",
|
|
1988
2162
|
"aria-label": "Close dialog",
|
|
1989
|
-
children: /* @__PURE__ */ (0,
|
|
2163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconClose, { className: "h-5 w-5", "aria-hidden": true })
|
|
1990
2164
|
}
|
|
1991
2165
|
) }) : null
|
|
1992
2166
|
] }) : null,
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
1994
|
-
footer ? /* @__PURE__ */ (0,
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn("ph-modal-body", bodyClassName), children }),
|
|
2168
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "ph-modal-footer", children: footer }) : null
|
|
1995
2169
|
] })
|
|
1996
2170
|
})
|
|
1997
2171
|
)
|
|
@@ -2001,19 +2175,19 @@ function Modal({
|
|
|
2001
2175
|
}
|
|
2002
2176
|
|
|
2003
2177
|
// src/components/ui/Panel.tsx
|
|
2004
|
-
var
|
|
2178
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2005
2179
|
function Panel(_a) {
|
|
2006
2180
|
var _b = _a, { title, description, children, className } = _b, props = __objRest(_b, ["title", "description", "children", "className"]);
|
|
2007
|
-
return /* @__PURE__ */ (0,
|
|
2008
|
-
title && /* @__PURE__ */ (0,
|
|
2009
|
-
description && /* @__PURE__ */ (0,
|
|
2181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-panel", className) }, props), { children: [
|
|
2182
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h3", { className: "text-sm font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
|
|
2183
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
2010
2184
|
children
|
|
2011
2185
|
] }));
|
|
2012
2186
|
}
|
|
2013
2187
|
|
|
2014
2188
|
// src/components/ui/SearchInput.tsx
|
|
2015
2189
|
var import_react12 = require("react");
|
|
2016
|
-
var
|
|
2190
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2017
2191
|
function SearchInput(_a) {
|
|
2018
2192
|
var _b = _a, {
|
|
2019
2193
|
id: idProp,
|
|
@@ -2036,10 +2210,10 @@ function SearchInput(_a) {
|
|
|
2036
2210
|
]);
|
|
2037
2211
|
const autoId = (0, import_react12.useId)();
|
|
2038
2212
|
const id = idProp != null ? idProp : autoId;
|
|
2039
|
-
return /* @__PURE__ */ (0,
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2041
|
-
/* @__PURE__ */ (0,
|
|
2042
|
-
shortcut != null ? /* @__PURE__ */ (0,
|
|
2213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("relative", wrapperClassName), children: [
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: id, className: hideLabel ? "sr-only" : "ph-label mb-1.5 block", children: label }),
|
|
2215
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative", children: [
|
|
2216
|
+
shortcut != null ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2043
2217
|
"span",
|
|
2044
2218
|
{
|
|
2045
2219
|
className: "ph-shortcut pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-xs",
|
|
@@ -2047,7 +2221,7 @@ function SearchInput(_a) {
|
|
|
2047
2221
|
children: shortcut
|
|
2048
2222
|
}
|
|
2049
2223
|
) : null,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2224
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2051
2225
|
"input",
|
|
2052
2226
|
__spreadValues({
|
|
2053
2227
|
id,
|
|
@@ -2067,7 +2241,7 @@ function SearchInput(_a) {
|
|
|
2067
2241
|
}
|
|
2068
2242
|
|
|
2069
2243
|
// src/components/ui/Table.tsx
|
|
2070
|
-
var
|
|
2244
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2071
2245
|
function Table({
|
|
2072
2246
|
data,
|
|
2073
2247
|
columns,
|
|
@@ -2075,58 +2249,72 @@ function Table({
|
|
|
2075
2249
|
compact = false,
|
|
2076
2250
|
ribbon = false,
|
|
2077
2251
|
getRowStyle,
|
|
2252
|
+
getRowKey,
|
|
2078
2253
|
className,
|
|
2079
2254
|
caption
|
|
2080
2255
|
}) {
|
|
2081
|
-
return /* @__PURE__ */ (0,
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2257
|
+
"div",
|
|
2258
|
+
{
|
|
2259
|
+
className: cn("ph-table-wrap", compact && "ph-table-compact", className),
|
|
2260
|
+
tabIndex: 0,
|
|
2261
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("table", { className: cn("ph-table", zebra && "ph-table-zebra", ribbon && "ph-table--ribbon"), children: [
|
|
2262
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("caption", { className: "sr-only", children: caption }),
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("tr", { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("th", { className: col.className, children: col.header }, col.key)) }) }),
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("tbody", { children: data.map((row, i) => {
|
|
2265
|
+
var _a;
|
|
2266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("tr", { style: getRowStyle == null ? void 0 : getRowStyle(row), children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("td", { className: col.className, children: col.cell(row) }, col.key)) }, (_a = getRowKey == null ? void 0 : getRowKey(row, i)) != null ? _a : i);
|
|
2267
|
+
}) })
|
|
2268
|
+
] })
|
|
2269
|
+
}
|
|
2270
|
+
);
|
|
2086
2271
|
}
|
|
2087
2272
|
|
|
2088
2273
|
// src/components/ui/Stat.tsx
|
|
2089
|
-
var
|
|
2274
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2090
2275
|
var toneMap = {
|
|
2091
2276
|
default: "text-ph-ink",
|
|
2092
2277
|
brand: "text-ph-brand",
|
|
2093
2278
|
blue: "text-ph-blue",
|
|
2094
2279
|
purple: "text-ph-purple",
|
|
2095
|
-
warning: "text-
|
|
2280
|
+
warning: "text-ph-warning"
|
|
2096
2281
|
};
|
|
2097
2282
|
var statMap = {
|
|
2098
2283
|
default: "",
|
|
2099
2284
|
brand: "",
|
|
2100
2285
|
blue: "",
|
|
2101
2286
|
purple: "",
|
|
2102
|
-
warning: "border-
|
|
2287
|
+
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))]"
|
|
2103
2288
|
};
|
|
2104
2289
|
function Stat(_a) {
|
|
2105
2290
|
var _b = _a, { icon, label, value, footer, tone = "default", className } = _b, props = __objRest(_b, ["icon", "label", "value", "footer", "tone", "className"]);
|
|
2106
|
-
return /* @__PURE__ */ (0,
|
|
2107
|
-
icon && /* @__PURE__ */ (0,
|
|
2108
|
-
/* @__PURE__ */ (0,
|
|
2109
|
-
/* @__PURE__ */ (0,
|
|
2110
|
-
footer && /* @__PURE__ */ (0,
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-stat", statMap[tone], className) }, props), { children: [
|
|
2292
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("mb-2 h-7 w-7", toneMap[tone]), children: icon }),
|
|
2293
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("ph-stat-label", tone === "warning" && toneMap[tone]), children: label }),
|
|
2294
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("ph-stat-val", toneMap[tone]), children: value }),
|
|
2295
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-ph-subtle", children: footer })
|
|
2111
2296
|
] }));
|
|
2112
2297
|
}
|
|
2113
2298
|
|
|
2299
|
+
// src/components/ui/ThemeDomSync.tsx
|
|
2300
|
+
var import_react13 = require("react");
|
|
2301
|
+
|
|
2114
2302
|
// src/themes/registry.ts
|
|
2115
2303
|
var DEFAULT_THEME_ID = "hedgehog-light";
|
|
2116
2304
|
var THEMES = [
|
|
2117
2305
|
{
|
|
2118
2306
|
id: "hedgehog-light",
|
|
2119
|
-
name: "
|
|
2307
|
+
name: "Hedgehog Light",
|
|
2120
2308
|
description: "Default Quill warm greys and orange Lemon chrome.",
|
|
2121
2309
|
colorScheme: "light",
|
|
2122
|
-
group: "
|
|
2310
|
+
group: "Hedgehog"
|
|
2123
2311
|
},
|
|
2124
2312
|
{
|
|
2125
2313
|
id: "hedgehog-dark",
|
|
2126
|
-
name: "
|
|
2314
|
+
name: "Hedgehog Dark",
|
|
2127
2315
|
description: "Dark app shell with HedgeHog orange accents.",
|
|
2128
2316
|
colorScheme: "dark",
|
|
2129
|
-
group: "
|
|
2317
|
+
group: "Hedgehog"
|
|
2130
2318
|
},
|
|
2131
2319
|
{
|
|
2132
2320
|
id: "note",
|
|
@@ -2211,6 +2399,20 @@ var THEMES = [
|
|
|
2211
2399
|
description: "Deep plum command deck with hot pink, lime, cyan, and sunset signals.",
|
|
2212
2400
|
colorScheme: "dark",
|
|
2213
2401
|
group: "Malibu"
|
|
2402
|
+
},
|
|
2403
|
+
{
|
|
2404
|
+
id: "microsoft-light",
|
|
2405
|
+
name: "Microsoft Light",
|
|
2406
|
+
description: "Office Fluent light neutrals on white with the signature brand blue.",
|
|
2407
|
+
colorScheme: "light",
|
|
2408
|
+
group: "Microsoft"
|
|
2409
|
+
},
|
|
2410
|
+
{
|
|
2411
|
+
id: "microsoft-dark",
|
|
2412
|
+
name: "Microsoft Dark",
|
|
2413
|
+
description: "Office Fluent dark chrome with a bright brand-blue accent.",
|
|
2414
|
+
colorScheme: "dark",
|
|
2415
|
+
group: "Microsoft"
|
|
2214
2416
|
}
|
|
2215
2417
|
];
|
|
2216
2418
|
var THEME_GROUPS = Array.from(
|
|
@@ -2245,16 +2447,54 @@ function readStoredTheme() {
|
|
|
2245
2447
|
return stored && isThemeId(stored) ? stored : DEFAULT_THEME_ID;
|
|
2246
2448
|
}
|
|
2247
2449
|
|
|
2450
|
+
// src/components/ui/ThemeDomSync.tsx
|
|
2451
|
+
function ThemeDomSync() {
|
|
2452
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
2453
|
+
persistTheme(readStoredTheme());
|
|
2454
|
+
}, []);
|
|
2455
|
+
return null;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
// src/components/ui/ThemeSwitcher.tsx
|
|
2459
|
+
var import_react14 = require("react");
|
|
2460
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2461
|
+
function ThemeSwitcher({ className }) {
|
|
2462
|
+
const [themeId, setThemeId] = (0, import_react14.useState)(DEFAULT_THEME_ID);
|
|
2463
|
+
(0, import_react14.useEffect)(() => {
|
|
2464
|
+
const id = readStoredTheme();
|
|
2465
|
+
persistTheme(id);
|
|
2466
|
+
setThemeId(id);
|
|
2467
|
+
}, []);
|
|
2468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: cn("flex min-w-0 items-center gap-2", className), children: [
|
|
2469
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "shrink-0 text-xs font-medium text-ph-mutedtext sm:text-sm", children: "Theme" }),
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2471
|
+
"select",
|
|
2472
|
+
{
|
|
2473
|
+
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",
|
|
2474
|
+
value: themeId,
|
|
2475
|
+
"aria-label": "Colour theme",
|
|
2476
|
+
onChange: (event) => {
|
|
2477
|
+
const next = event.target.value;
|
|
2478
|
+
persistTheme(next);
|
|
2479
|
+
setThemeId(next);
|
|
2480
|
+
},
|
|
2481
|
+
children: THEME_GROUPS.map((group) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("optgroup", { label: group, children: THEMES.filter((theme) => theme.group === group).map((theme) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: theme.id, children: theme.name }, theme.id)) }, group))
|
|
2482
|
+
}
|
|
2483
|
+
)
|
|
2484
|
+
] });
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2248
2487
|
// src/components/ui/Accordion.tsx
|
|
2249
|
-
var
|
|
2250
|
-
var
|
|
2488
|
+
var import_react15 = require("react");
|
|
2489
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2251
2490
|
function Accordion({
|
|
2252
2491
|
items,
|
|
2253
2492
|
allowMultiple = false,
|
|
2254
2493
|
defaultOpen = [],
|
|
2255
2494
|
className
|
|
2256
2495
|
}) {
|
|
2257
|
-
const [openItems, setOpenItems] = (0,
|
|
2496
|
+
const [openItems, setOpenItems] = (0, import_react15.useState)(new Set(defaultOpen));
|
|
2497
|
+
const idPrefix = (0, import_react15.useId)();
|
|
2258
2498
|
const toggleItem = (id) => {
|
|
2259
2499
|
setOpenItems((prev) => {
|
|
2260
2500
|
const next = new Set(prev);
|
|
@@ -2269,54 +2509,71 @@ function Accordion({
|
|
|
2269
2509
|
return next;
|
|
2270
2510
|
});
|
|
2271
2511
|
};
|
|
2272
|
-
return /* @__PURE__ */ (0,
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
"
|
|
2277
|
-
|
|
2278
|
-
type: "button",
|
|
2279
|
-
onClick: () => toggleItem(item.id),
|
|
2280
|
-
className: "flex w-full items-center justify-between px-5 py-4 text-left transition hover:bg-ph-muted",
|
|
2281
|
-
children: [
|
|
2282
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "font-semibold text-ph-ink", children: item.title }),
|
|
2283
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2284
|
-
IconChevronDown,
|
|
2285
|
-
{
|
|
2286
|
-
className: cn(
|
|
2287
|
-
"h-5 w-5 text-ph-mutedtext transition-transform duration-200",
|
|
2288
|
-
isOpen && "rotate-180"
|
|
2289
|
-
)
|
|
2290
|
-
}
|
|
2291
|
-
)
|
|
2292
|
-
]
|
|
2293
|
-
}
|
|
2512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2513
|
+
"div",
|
|
2514
|
+
{
|
|
2515
|
+
className: cn(
|
|
2516
|
+
"divide-y divide-ph-border rounded-xl border border-ph-border bg-ph-surface",
|
|
2517
|
+
className
|
|
2294
2518
|
),
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
{
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2519
|
+
children: items.map((item) => {
|
|
2520
|
+
const isOpen = openItems.has(item.id);
|
|
2521
|
+
const contentId = `accordion-${idPrefix}-${item.id}-content`;
|
|
2522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "first:rounded-t-xl last:rounded-b-xl", children: [
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2524
|
+
"button",
|
|
2525
|
+
{
|
|
2526
|
+
type: "button",
|
|
2527
|
+
onClick: () => toggleItem(item.id),
|
|
2528
|
+
"aria-expanded": isOpen,
|
|
2529
|
+
"aria-controls": contentId,
|
|
2530
|
+
className: "flex w-full items-center justify-between px-5 py-4 text-left transition hover:bg-ph-muted",
|
|
2531
|
+
children: [
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "font-semibold text-ph-ink", children: item.title }),
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2534
|
+
IconChevronDown,
|
|
2535
|
+
{
|
|
2536
|
+
className: cn(
|
|
2537
|
+
"h-5 w-5 text-ph-mutedtext transition-transform duration-200",
|
|
2538
|
+
isOpen && "rotate-180"
|
|
2539
|
+
)
|
|
2540
|
+
}
|
|
2541
|
+
)
|
|
2542
|
+
]
|
|
2543
|
+
}
|
|
2301
2544
|
),
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2546
|
+
"div",
|
|
2547
|
+
{
|
|
2548
|
+
id: contentId,
|
|
2549
|
+
"aria-hidden": !isOpen,
|
|
2550
|
+
ref: (node) => {
|
|
2551
|
+
if (node) node.toggleAttribute("inert", !isOpen);
|
|
2552
|
+
},
|
|
2553
|
+
className: cn(
|
|
2554
|
+
"grid transition-all duration-200",
|
|
2555
|
+
isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
2556
|
+
),
|
|
2557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "px-5 pb-4 text-ph-subtle", children: item.content }) })
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2560
|
+
] }, item.id);
|
|
2561
|
+
})
|
|
2562
|
+
}
|
|
2563
|
+
);
|
|
2307
2564
|
}
|
|
2308
2565
|
|
|
2309
2566
|
// src/components/ui/SegmentedControl.tsx
|
|
2310
|
-
var
|
|
2567
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2311
2568
|
function SegmentedControl({ options, value, onChange, className }) {
|
|
2312
|
-
return /* @__PURE__ */ (0,
|
|
2569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2313
2570
|
"div",
|
|
2314
2571
|
{
|
|
2315
2572
|
className: cn(
|
|
2316
2573
|
"inline-flex rounded-lg bg-ph-muted p-1",
|
|
2317
2574
|
className
|
|
2318
2575
|
),
|
|
2319
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
2576
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2320
2577
|
"button",
|
|
2321
2578
|
{
|
|
2322
2579
|
type: "button",
|
|
@@ -2327,7 +2584,7 @@ function SegmentedControl({ options, value, onChange, className }) {
|
|
|
2327
2584
|
value === option.value ? "bg-ph-surface text-ph-ink shadow-ph" : "text-ph-subtle hover:text-ph-ink"
|
|
2328
2585
|
),
|
|
2329
2586
|
children: [
|
|
2330
|
-
option.icon && /* @__PURE__ */ (0,
|
|
2587
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "h-4 w-4", children: option.icon }),
|
|
2331
2588
|
option.label
|
|
2332
2589
|
]
|
|
2333
2590
|
},
|
|
@@ -2338,8 +2595,9 @@ function SegmentedControl({ options, value, onChange, className }) {
|
|
|
2338
2595
|
}
|
|
2339
2596
|
|
|
2340
2597
|
// src/components/ui/CommandPalette.tsx
|
|
2341
|
-
var
|
|
2342
|
-
var
|
|
2598
|
+
var import_react16 = require("react");
|
|
2599
|
+
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
2600
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2343
2601
|
function CommandPalette({
|
|
2344
2602
|
items,
|
|
2345
2603
|
isOpen,
|
|
@@ -2351,269 +2609,385 @@ function CommandPalette({
|
|
|
2351
2609
|
inputId,
|
|
2352
2610
|
inputDataTest
|
|
2353
2611
|
}) {
|
|
2354
|
-
const [query, setQuery] = (0,
|
|
2355
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
2356
|
-
const inputRef = (0,
|
|
2357
|
-
const
|
|
2358
|
-
const
|
|
2612
|
+
const [query, setQuery] = (0, import_react16.useState)("");
|
|
2613
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react16.useState)(0);
|
|
2614
|
+
const inputRef = (0, import_react16.useRef)(null);
|
|
2615
|
+
const listboxRef = (0, import_react16.useRef)(null);
|
|
2616
|
+
const restoreFocusRef = (0, import_react16.useRef)(null);
|
|
2617
|
+
const generatedId = (0, import_react16.useId)();
|
|
2618
|
+
const listboxId = `${id != null ? id : `command-palette-${generatedId}`}-listbox`;
|
|
2359
2619
|
const filtered = items.filter(
|
|
2360
2620
|
(item) => item.label.toLowerCase().includes(query.toLowerCase())
|
|
2361
2621
|
);
|
|
2362
|
-
(
|
|
2363
|
-
|
|
2622
|
+
const activeIndex = filtered.length ? Math.min(selectedIndex, filtered.length - 1) : 0;
|
|
2623
|
+
const activeItem = filtered[activeIndex];
|
|
2624
|
+
(0, import_react16.useEffect)(() => {
|
|
2364
2625
|
if (!isOpen) return;
|
|
2365
|
-
previousFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2366
2626
|
setQuery("");
|
|
2367
2627
|
setSelectedIndex(0);
|
|
2368
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2369
|
-
return () => {
|
|
2370
|
-
var _a2;
|
|
2371
|
-
return (_a2 = previousFocusRef.current) == null ? void 0 : _a2.focus();
|
|
2372
|
-
};
|
|
2373
2628
|
}, [isOpen]);
|
|
2374
|
-
(0,
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
e.preventDefault();
|
|
2409
|
-
first.focus();
|
|
2410
|
-
}
|
|
2411
|
-
break;
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
};
|
|
2415
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
2416
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2417
|
-
}, [isOpen, filtered, selectedIndex, onClose]);
|
|
2418
|
-
if (!isOpen) return null;
|
|
2419
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2420
|
-
"div",
|
|
2629
|
+
(0, import_react16.useEffect)(() => {
|
|
2630
|
+
setSelectedIndex((current) => Math.min(current, Math.max(filtered.length - 1, 0)));
|
|
2631
|
+
}, [filtered.length]);
|
|
2632
|
+
(0, import_react16.useEffect)(() => {
|
|
2633
|
+
var _a, _b;
|
|
2634
|
+
if (!isOpen || !activeItem) return;
|
|
2635
|
+
(_b = (_a = listboxRef.current) == null ? void 0 : _a.querySelectorAll('[role="option"]')[activeIndex]) == null ? void 0 : _b.scrollIntoView({ block: "nearest" });
|
|
2636
|
+
}, [activeIndex, activeItem, isOpen]);
|
|
2637
|
+
const handleInputKeyDown = (event) => {
|
|
2638
|
+
switch (event.key) {
|
|
2639
|
+
case "ArrowDown":
|
|
2640
|
+
if (!filtered.length) return;
|
|
2641
|
+
event.preventDefault();
|
|
2642
|
+
setSelectedIndex((current) => (current + 1) % filtered.length);
|
|
2643
|
+
return;
|
|
2644
|
+
case "ArrowUp":
|
|
2645
|
+
if (!filtered.length) return;
|
|
2646
|
+
event.preventDefault();
|
|
2647
|
+
setSelectedIndex(
|
|
2648
|
+
(current) => (current - 1 + filtered.length) % filtered.length
|
|
2649
|
+
);
|
|
2650
|
+
return;
|
|
2651
|
+
case "Enter":
|
|
2652
|
+
if (!activeItem) return;
|
|
2653
|
+
event.preventDefault();
|
|
2654
|
+
activeItem.onSelect();
|
|
2655
|
+
onClose();
|
|
2656
|
+
return;
|
|
2657
|
+
default:
|
|
2658
|
+
return;
|
|
2659
|
+
}
|
|
2660
|
+
};
|
|
2661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2662
|
+
Dialog2.Root,
|
|
2421
2663
|
{
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
onMouseDown: (event) => {
|
|
2426
|
-
if (event.target === event.currentTarget) onClose();
|
|
2664
|
+
open: isOpen,
|
|
2665
|
+
onOpenChange: (nextOpen) => {
|
|
2666
|
+
if (!nextOpen) onClose();
|
|
2427
2667
|
},
|
|
2428
|
-
children: /* @__PURE__ */ (0,
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Dialog2.Portal, { children: [
|
|
2669
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2670
|
+
Dialog2.Overlay,
|
|
2671
|
+
{
|
|
2672
|
+
id,
|
|
2673
|
+
"data-test": dataTest,
|
|
2674
|
+
className: "fixed inset-0 z-50 bg-black/40 backdrop-blur-sm"
|
|
2675
|
+
}
|
|
2676
|
+
),
|
|
2677
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2678
|
+
Dialog2.Content,
|
|
2679
|
+
{
|
|
2680
|
+
className: cn(
|
|
2681
|
+
"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",
|
|
2682
|
+
className
|
|
2683
|
+
),
|
|
2684
|
+
onOpenAutoFocus: (event) => {
|
|
2685
|
+
var _a;
|
|
2686
|
+
restoreFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2687
|
+
event.preventDefault();
|
|
2688
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2689
|
+
},
|
|
2690
|
+
onCloseAutoFocus: (event) => {
|
|
2691
|
+
var _a;
|
|
2692
|
+
event.preventDefault();
|
|
2693
|
+
(_a = restoreFocusRef.current) == null ? void 0 : _a.focus();
|
|
2694
|
+
},
|
|
2695
|
+
children: [
|
|
2696
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2.Title, { className: "sr-only", children: "Command palette" }),
|
|
2697
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-3 border-b border-ph-border px-4 py-3", children: [
|
|
2698
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconSearch, { className: "h-5 w-5 text-ph-mutedtext" }),
|
|
2699
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2700
|
+
"input",
|
|
2701
|
+
{
|
|
2702
|
+
ref: inputRef,
|
|
2703
|
+
id: inputId,
|
|
2704
|
+
"data-test": inputDataTest,
|
|
2705
|
+
type: "text",
|
|
2706
|
+
role: "combobox",
|
|
2707
|
+
"aria-label": "Search commands",
|
|
2708
|
+
"aria-autocomplete": "list",
|
|
2709
|
+
"aria-controls": listboxId,
|
|
2710
|
+
"aria-expanded": "true",
|
|
2711
|
+
"aria-activedescendant": activeItem ? `command-${activeItem.id}` : void 0,
|
|
2712
|
+
value: query,
|
|
2713
|
+
onChange: (event) => {
|
|
2714
|
+
setQuery(event.target.value);
|
|
2715
|
+
setSelectedIndex(0);
|
|
2716
|
+
},
|
|
2717
|
+
onKeyDown: handleInputKeyDown,
|
|
2718
|
+
placeholder,
|
|
2719
|
+
className: "flex-1 bg-transparent text-ph-ink outline-none placeholder:text-ph-mutedtext"
|
|
2720
|
+
}
|
|
2721
|
+
),
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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" })
|
|
2723
|
+
] }),
|
|
2724
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref: listboxRef, id: listboxId, role: "listbox", "aria-label": "Commands", className: "max-h-[50vh] overflow-y-auto py-2", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { role: "status", className: "px-4 py-8 text-center text-sm text-ph-mutedtext", children: "No results found." }) : filtered.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2725
|
+
"div",
|
|
2444
2726
|
{
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
"
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
setQuery(e.target.value);
|
|
2453
|
-
setSelectedIndex(0);
|
|
2727
|
+
id: `command-${item.id}`,
|
|
2728
|
+
"data-test": `command-${item.id}`,
|
|
2729
|
+
role: "option",
|
|
2730
|
+
"aria-selected": index === activeIndex,
|
|
2731
|
+
onClick: () => {
|
|
2732
|
+
item.onSelect();
|
|
2733
|
+
onClose();
|
|
2454
2734
|
},
|
|
2455
|
-
|
|
2456
|
-
className:
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
id: `command-${item.id}`,
|
|
2466
|
-
"data-test": `command-${item.id}`,
|
|
2467
|
-
onClick: () => {
|
|
2468
|
-
item.onSelect();
|
|
2469
|
-
onClose();
|
|
2735
|
+
onMouseEnter: () => setSelectedIndex(index),
|
|
2736
|
+
className: cn(
|
|
2737
|
+
"flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-left text-sm transition-colors",
|
|
2738
|
+
index === activeIndex ? "bg-ph-muted text-ph-ink" : "text-ph-subtle"
|
|
2739
|
+
),
|
|
2740
|
+
children: [
|
|
2741
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { "aria-hidden": "true", className: "h-5 w-5", children: item.icon }),
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex-1", children: item.label }),
|
|
2743
|
+
item.shortcut && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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 })
|
|
2744
|
+
]
|
|
2470
2745
|
},
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
item.icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "h-5 w-5", children: item.icon }),
|
|
2478
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex-1", children: item.label }),
|
|
2479
|
-
item.shortcut && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("kbd", { className: "rounded border border-ph-border bg-ph-surface px-1.5 py-0.5 text-xs text-ph-mutedtext", children: item.shortcut })
|
|
2480
|
-
]
|
|
2481
|
-
},
|
|
2482
|
-
item.id
|
|
2483
|
-
)) })
|
|
2484
|
-
]
|
|
2485
|
-
}
|
|
2486
|
-
)
|
|
2746
|
+
item.id
|
|
2747
|
+
)) })
|
|
2748
|
+
]
|
|
2749
|
+
}
|
|
2750
|
+
)
|
|
2751
|
+
] })
|
|
2487
2752
|
}
|
|
2488
2753
|
);
|
|
2489
2754
|
}
|
|
2490
2755
|
|
|
2491
2756
|
// src/components/ui/Calendar.tsx
|
|
2492
|
-
var
|
|
2493
|
-
var
|
|
2757
|
+
var import_react17 = require("react");
|
|
2758
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2759
|
+
var monthNames = [
|
|
2760
|
+
"January",
|
|
2761
|
+
"February",
|
|
2762
|
+
"March",
|
|
2763
|
+
"April",
|
|
2764
|
+
"May",
|
|
2765
|
+
"June",
|
|
2766
|
+
"July",
|
|
2767
|
+
"August",
|
|
2768
|
+
"September",
|
|
2769
|
+
"October",
|
|
2770
|
+
"November",
|
|
2771
|
+
"December"
|
|
2772
|
+
];
|
|
2773
|
+
var weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2774
|
+
var fullWeekDays = [
|
|
2775
|
+
"Sunday",
|
|
2776
|
+
"Monday",
|
|
2777
|
+
"Tuesday",
|
|
2778
|
+
"Wednesday",
|
|
2779
|
+
"Thursday",
|
|
2780
|
+
"Friday",
|
|
2781
|
+
"Saturday"
|
|
2782
|
+
];
|
|
2783
|
+
function startOfDay(date) {
|
|
2784
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
2785
|
+
}
|
|
2786
|
+
function startOfMonth(date) {
|
|
2787
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
2788
|
+
}
|
|
2789
|
+
function isSameDay(first, second) {
|
|
2790
|
+
return first.getFullYear() === second.getFullYear() && first.getMonth() === second.getMonth() && first.getDate() === second.getDate();
|
|
2791
|
+
}
|
|
2792
|
+
function addDays(date, amount) {
|
|
2793
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
|
|
2794
|
+
}
|
|
2795
|
+
function addMonths(date, amount) {
|
|
2796
|
+
const targetMonth = new Date(date.getFullYear(), date.getMonth() + amount, 1);
|
|
2797
|
+
const lastDay = new Date(
|
|
2798
|
+
targetMonth.getFullYear(),
|
|
2799
|
+
targetMonth.getMonth() + 1,
|
|
2800
|
+
0
|
|
2801
|
+
).getDate();
|
|
2802
|
+
return new Date(
|
|
2803
|
+
targetMonth.getFullYear(),
|
|
2804
|
+
targetMonth.getMonth(),
|
|
2805
|
+
Math.min(date.getDate(), lastDay)
|
|
2806
|
+
);
|
|
2807
|
+
}
|
|
2808
|
+
function dateKey(date) {
|
|
2809
|
+
return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
|
2810
|
+
}
|
|
2811
|
+
function dateLabel(date) {
|
|
2812
|
+
return `${fullWeekDays[date.getDay()]}, ${date.getDate()} ${monthNames[date.getMonth()]} ${date.getFullYear()}`;
|
|
2813
|
+
}
|
|
2494
2814
|
function Calendar({ value, onChange, className }) {
|
|
2495
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
2496
|
-
const
|
|
2815
|
+
const [currentMonth, setCurrentMonth] = (0, import_react17.useState)(() => startOfMonth(value != null ? value : /* @__PURE__ */ new Date()));
|
|
2816
|
+
const [focusedDate, setFocusedDate] = (0, import_react17.useState)(() => startOfDay(value != null ? value : /* @__PURE__ */ new Date()));
|
|
2817
|
+
const gridRef = (0, import_react17.useRef)(null);
|
|
2818
|
+
const shouldFocusDateRef = (0, import_react17.useRef)(false);
|
|
2819
|
+
const monthLabelId = (0, import_react17.useId)();
|
|
2820
|
+
const today = startOfDay(/* @__PURE__ */ new Date());
|
|
2821
|
+
(0, import_react17.useEffect)(() => {
|
|
2822
|
+
if (!value) return;
|
|
2823
|
+
const nextDate = startOfDay(value);
|
|
2824
|
+
setCurrentMonth(startOfMonth(nextDate));
|
|
2825
|
+
setFocusedDate(nextDate);
|
|
2826
|
+
}, [value]);
|
|
2827
|
+
(0, import_react17.useEffect)(() => {
|
|
2828
|
+
var _a, _b;
|
|
2829
|
+
if (!shouldFocusDateRef.current) return;
|
|
2830
|
+
(_b = (_a = gridRef.current) == null ? void 0 : _a.querySelector(`[data-date="${dateKey(focusedDate)}"]`)) == null ? void 0 : _b.focus();
|
|
2831
|
+
shouldFocusDateRef.current = false;
|
|
2832
|
+
}, [currentMonth, focusedDate]);
|
|
2497
2833
|
const year = currentMonth.getFullYear();
|
|
2498
2834
|
const month = currentMonth.getMonth();
|
|
2499
|
-
const
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
const monthNames = [
|
|
2504
|
-
"January",
|
|
2505
|
-
"February",
|
|
2506
|
-
"March",
|
|
2507
|
-
"April",
|
|
2508
|
-
"May",
|
|
2509
|
-
"June",
|
|
2510
|
-
"July",
|
|
2511
|
-
"August",
|
|
2512
|
-
"September",
|
|
2513
|
-
"October",
|
|
2514
|
-
"November",
|
|
2515
|
-
"December"
|
|
2516
|
-
];
|
|
2517
|
-
const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2518
|
-
const isSelected = (day) => {
|
|
2519
|
-
if (!value) return false;
|
|
2520
|
-
return value.getDate() === day && value.getMonth() === month && value.getFullYear() === year;
|
|
2835
|
+
const changeMonth = (amount) => {
|
|
2836
|
+
const nextDate = addMonths(focusedDate, amount);
|
|
2837
|
+
setFocusedDate(nextDate);
|
|
2838
|
+
setCurrentMonth(startOfMonth(nextDate));
|
|
2521
2839
|
};
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2840
|
+
const moveFocus = (nextDate) => {
|
|
2841
|
+
shouldFocusDateRef.current = true;
|
|
2842
|
+
setFocusedDate(nextDate);
|
|
2843
|
+
setCurrentMonth(startOfMonth(nextDate));
|
|
2524
2844
|
};
|
|
2525
|
-
const handleSelect = (
|
|
2526
|
-
|
|
2845
|
+
const handleSelect = (date) => {
|
|
2846
|
+
setFocusedDate(date);
|
|
2847
|
+
onChange == null ? void 0 : onChange(startOfDay(date));
|
|
2527
2848
|
};
|
|
2528
|
-
const
|
|
2529
|
-
|
|
2530
|
-
|
|
2849
|
+
const handleDayKeyDown = (event, date) => {
|
|
2850
|
+
let nextDate;
|
|
2851
|
+
switch (event.key) {
|
|
2852
|
+
case "ArrowLeft":
|
|
2853
|
+
nextDate = addDays(date, -1);
|
|
2854
|
+
break;
|
|
2855
|
+
case "ArrowRight":
|
|
2856
|
+
nextDate = addDays(date, 1);
|
|
2857
|
+
break;
|
|
2858
|
+
case "ArrowUp":
|
|
2859
|
+
nextDate = addDays(date, -7);
|
|
2860
|
+
break;
|
|
2861
|
+
case "ArrowDown":
|
|
2862
|
+
nextDate = addDays(date, 7);
|
|
2863
|
+
break;
|
|
2864
|
+
case "Home":
|
|
2865
|
+
nextDate = addDays(date, -date.getDay());
|
|
2866
|
+
break;
|
|
2867
|
+
case "End":
|
|
2868
|
+
nextDate = addDays(date, 6 - date.getDay());
|
|
2869
|
+
break;
|
|
2870
|
+
case "PageUp":
|
|
2871
|
+
nextDate = addMonths(date, event.shiftKey ? -12 : -1);
|
|
2872
|
+
break;
|
|
2873
|
+
case "PageDown":
|
|
2874
|
+
nextDate = addMonths(date, event.shiftKey ? 12 : 1);
|
|
2875
|
+
break;
|
|
2876
|
+
case "Enter":
|
|
2877
|
+
case " ":
|
|
2878
|
+
event.preventDefault();
|
|
2879
|
+
handleSelect(date);
|
|
2880
|
+
return;
|
|
2881
|
+
default:
|
|
2882
|
+
return;
|
|
2883
|
+
}
|
|
2884
|
+
event.preventDefault();
|
|
2885
|
+
moveFocus(nextDate);
|
|
2886
|
+
};
|
|
2887
|
+
const firstDay = new Date(year, month, 1).getDay();
|
|
2888
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
2889
|
+
const days = Array.from({ length: firstDay }, () => null);
|
|
2890
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
2891
|
+
days.push(new Date(year, month, day));
|
|
2531
2892
|
}
|
|
2532
|
-
|
|
2533
|
-
days.push(
|
|
2893
|
+
while (days.length < 42) {
|
|
2894
|
+
days.push(null);
|
|
2534
2895
|
}
|
|
2535
|
-
return /* @__PURE__ */ (0,
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2537
|
-
/* @__PURE__ */ (0,
|
|
2896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("w-[280px] rounded-xl border border-ph-border bg-ph-surface p-4 shadow-ph", className), children: [
|
|
2897
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
2898
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2538
2899
|
"button",
|
|
2539
2900
|
{
|
|
2540
2901
|
type: "button",
|
|
2541
|
-
onClick:
|
|
2902
|
+
onClick: () => changeMonth(-1),
|
|
2542
2903
|
"aria-label": "Previous month",
|
|
2543
2904
|
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2544
|
-
children: /* @__PURE__ */ (0,
|
|
2905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconChevronLeft, { className: "h-5 w-5", "aria-hidden": true })
|
|
2545
2906
|
}
|
|
2546
2907
|
),
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { id: monthLabelId, "aria-live": "polite", className: "text-sm font-semibold text-ph-ink", children: [
|
|
2548
2909
|
monthNames[month],
|
|
2549
2910
|
" ",
|
|
2550
2911
|
year
|
|
2551
2912
|
] }),
|
|
2552
|
-
/* @__PURE__ */ (0,
|
|
2913
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2553
2914
|
"button",
|
|
2554
2915
|
{
|
|
2555
2916
|
type: "button",
|
|
2556
|
-
onClick:
|
|
2917
|
+
onClick: () => changeMonth(1),
|
|
2557
2918
|
"aria-label": "Next month",
|
|
2558
2919
|
className: "rounded-lg p-1 text-ph-subtle transition hover:bg-ph-muted hover:text-ph-ink",
|
|
2559
|
-
children: /* @__PURE__ */ (0,
|
|
2920
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconChevronRight, { className: "h-5 w-5", "aria-hidden": true })
|
|
2560
2921
|
}
|
|
2561
2922
|
)
|
|
2562
2923
|
] }),
|
|
2563
|
-
/* @__PURE__ */ (0,
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
"button",
|
|
2924
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref: gridRef, role: "grid", "aria-labelledby": monthLabelId, children: [
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { role: "row", className: "grid grid-cols-7 gap-1", children: weekDays.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2926
|
+
"div",
|
|
2567
2927
|
{
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
className:
|
|
2571
|
-
"flex h-full w-full items-center justify-center rounded-lg text-sm transition-colors",
|
|
2572
|
-
isSelected(day) ? "bg-ph-brand font-semibold text-[var(--ph-on-accent)] shadow-ph" : isToday(day) ? "bg-ph-muted font-semibold text-ph-brand ring-1 ring-ph-brand/30" : "text-ph-ink hover:bg-ph-muted"
|
|
2573
|
-
),
|
|
2928
|
+
role: "columnheader",
|
|
2929
|
+
"aria-label": fullWeekDays[index],
|
|
2930
|
+
className: "py-1 text-center text-xs font-medium text-ph-mutedtext",
|
|
2574
2931
|
children: day
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2932
|
+
},
|
|
2933
|
+
day
|
|
2934
|
+
)) }),
|
|
2935
|
+
Array.from({ length: 6 }, (_, week) => {
|
|
2936
|
+
const weekDates = days.slice(week * 7, week * 7 + 7);
|
|
2937
|
+
if (weekDates.length === 0 || weekDates.every((date) => !date)) return null;
|
|
2938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { role: "row", className: "grid grid-cols-7 gap-1", children: weekDates.map(
|
|
2939
|
+
(date, day) => date ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2940
|
+
"div",
|
|
2941
|
+
{
|
|
2942
|
+
role: "gridcell",
|
|
2943
|
+
"aria-selected": value ? isSameDay(value, date) : false,
|
|
2944
|
+
className: "aspect-square",
|
|
2945
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2946
|
+
"button",
|
|
2947
|
+
{
|
|
2948
|
+
type: "button",
|
|
2949
|
+
"data-date": dateKey(date),
|
|
2950
|
+
"aria-label": dateLabel(date),
|
|
2951
|
+
"aria-current": isSameDay(today, date) ? "date" : void 0,
|
|
2952
|
+
tabIndex: isSameDay(focusedDate, date) ? 0 : -1,
|
|
2953
|
+
onClick: () => handleSelect(date),
|
|
2954
|
+
onKeyDown: (event) => handleDayKeyDown(event, date),
|
|
2955
|
+
className: cn(
|
|
2956
|
+
"flex h-full w-full items-center justify-center rounded-lg text-sm transition-colors",
|
|
2957
|
+
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"
|
|
2958
|
+
),
|
|
2959
|
+
children: date.getDate()
|
|
2960
|
+
}
|
|
2961
|
+
)
|
|
2962
|
+
},
|
|
2963
|
+
dateKey(date)
|
|
2964
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { role: "gridcell", "aria-hidden": "true", className: "aspect-square" }, `empty-${week}-${day}`)
|
|
2965
|
+
) }, week);
|
|
2966
|
+
})
|
|
2577
2967
|
] })
|
|
2578
2968
|
] });
|
|
2579
2969
|
}
|
|
2580
2970
|
|
|
2581
2971
|
// src/components/ui/Tooltip.tsx
|
|
2582
|
-
var
|
|
2972
|
+
var import_react18 = require("react");
|
|
2583
2973
|
var import_react_dom = require("react-dom");
|
|
2584
|
-
var
|
|
2585
|
-
var TooltipDelayContext = (0,
|
|
2974
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2975
|
+
var TooltipDelayContext = (0, import_react18.createContext)(0);
|
|
2586
2976
|
function TooltipProvider({
|
|
2587
2977
|
children,
|
|
2588
2978
|
delayDuration = 0
|
|
2589
2979
|
}) {
|
|
2590
|
-
return /* @__PURE__ */ (0,
|
|
2980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipDelayContext.Provider, { value: delayDuration, children });
|
|
2591
2981
|
}
|
|
2592
|
-
function tooltipPosition(trigger, side, align, offset) {
|
|
2982
|
+
function tooltipPosition(trigger, content, side, align, offset, collisionPadding) {
|
|
2593
2983
|
const horizontal = align === "start" ? trigger.left : align === "end" ? trigger.right : trigger.left + trigger.width / 2;
|
|
2594
2984
|
const vertical = align === "start" ? trigger.top : align === "end" ? trigger.bottom : trigger.top + trigger.height / 2;
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
top: trigger.top - offset,
|
|
2599
|
-
transform: "translate(-50%, -100%)"
|
|
2600
|
-
};
|
|
2601
|
-
if (side === "bottom")
|
|
2602
|
-
return {
|
|
2603
|
-
left: horizontal,
|
|
2604
|
-
top: trigger.bottom + offset,
|
|
2605
|
-
transform: "translate(-50%, 0)"
|
|
2606
|
-
};
|
|
2607
|
-
if (side === "left")
|
|
2608
|
-
return {
|
|
2609
|
-
left: trigger.left - offset,
|
|
2610
|
-
top: vertical,
|
|
2611
|
-
transform: "translate(-100%, -50%)"
|
|
2612
|
-
};
|
|
2985
|
+
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 };
|
|
2986
|
+
const maxLeft = Math.max(collisionPadding, window.innerWidth - content.width - collisionPadding);
|
|
2987
|
+
const maxTop = Math.max(collisionPadding, window.innerHeight - content.height - collisionPadding);
|
|
2613
2988
|
return {
|
|
2614
|
-
left:
|
|
2615
|
-
top:
|
|
2616
|
-
transform: "translate(0, -50%)"
|
|
2989
|
+
left: Math.min(Math.max(position.left, collisionPadding), maxLeft),
|
|
2990
|
+
top: Math.min(Math.max(position.top, collisionPadding), maxTop)
|
|
2617
2991
|
};
|
|
2618
2992
|
}
|
|
2619
2993
|
function Tooltip({
|
|
@@ -2622,18 +2996,21 @@ function Tooltip({
|
|
|
2622
2996
|
side = "top",
|
|
2623
2997
|
align = "center",
|
|
2624
2998
|
sideOffset = 7,
|
|
2999
|
+
collisionPadding = 8,
|
|
2625
3000
|
className,
|
|
2626
3001
|
open,
|
|
2627
3002
|
defaultOpen = false,
|
|
2628
3003
|
onOpenChange,
|
|
2629
|
-
delayDuration
|
|
3004
|
+
delayDuration,
|
|
3005
|
+
disableHoverableContent = false
|
|
2630
3006
|
}) {
|
|
2631
|
-
const providerDelay = (0,
|
|
2632
|
-
const generatedId = (0,
|
|
2633
|
-
const triggerRef = (0,
|
|
2634
|
-
const
|
|
2635
|
-
const
|
|
2636
|
-
const [
|
|
3007
|
+
const providerDelay = (0, import_react18.useContext)(TooltipDelayContext);
|
|
3008
|
+
const generatedId = (0, import_react18.useId)().replace(/:/g, "");
|
|
3009
|
+
const triggerRef = (0, import_react18.useRef)(null);
|
|
3010
|
+
const contentRef = (0, import_react18.useRef)(null);
|
|
3011
|
+
const timerRef = (0, import_react18.useRef)(null);
|
|
3012
|
+
const [internalOpen, setInternalOpen] = (0, import_react18.useState)(defaultOpen);
|
|
3013
|
+
const [position, setPosition] = (0, import_react18.useState)(null);
|
|
2637
3014
|
const isOpen = open != null ? open : internalOpen;
|
|
2638
3015
|
const triggerId = children.props.id;
|
|
2639
3016
|
const tooltipId = triggerId ? `${triggerId}-tooltip` : `ph-tooltip-${generatedId}`;
|
|
@@ -2645,17 +3022,19 @@ function Tooltip({
|
|
|
2645
3022
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
2646
3023
|
timerRef.current = null;
|
|
2647
3024
|
}
|
|
2648
|
-
|
|
2649
|
-
if (!triggerRef.current) return;
|
|
3025
|
+
const updatePosition = (0, import_react18.useCallback)(() => {
|
|
3026
|
+
if (!triggerRef.current || !contentRef.current) return;
|
|
2650
3027
|
setPosition(
|
|
2651
3028
|
tooltipPosition(
|
|
2652
3029
|
triggerRef.current.getBoundingClientRect(),
|
|
3030
|
+
contentRef.current.getBoundingClientRect(),
|
|
2653
3031
|
side,
|
|
2654
3032
|
align,
|
|
2655
|
-
sideOffset
|
|
3033
|
+
sideOffset,
|
|
3034
|
+
collisionPadding
|
|
2656
3035
|
)
|
|
2657
3036
|
);
|
|
2658
|
-
}
|
|
3037
|
+
}, [align, collisionPadding, side, sideOffset]);
|
|
2659
3038
|
function show(immediate) {
|
|
2660
3039
|
clearTimer();
|
|
2661
3040
|
updatePosition();
|
|
@@ -2667,7 +3046,18 @@ function Tooltip({
|
|
|
2667
3046
|
clearTimer();
|
|
2668
3047
|
setOpen(false);
|
|
2669
3048
|
}
|
|
2670
|
-
|
|
3049
|
+
function hideFromTrigger() {
|
|
3050
|
+
if (disableHoverableContent) {
|
|
3051
|
+
hide();
|
|
3052
|
+
return;
|
|
3053
|
+
}
|
|
3054
|
+
clearTimer();
|
|
3055
|
+
timerRef.current = setTimeout(() => setOpen(false), 100);
|
|
3056
|
+
}
|
|
3057
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
3058
|
+
if (isOpen) updatePosition();
|
|
3059
|
+
}, [isOpen, updatePosition]);
|
|
3060
|
+
(0, import_react18.useEffect)(() => {
|
|
2671
3061
|
if (!isOpen) return;
|
|
2672
3062
|
const reposition = () => updatePosition();
|
|
2673
3063
|
window.addEventListener("resize", reposition);
|
|
@@ -2676,18 +3066,18 @@ function Tooltip({
|
|
|
2676
3066
|
window.removeEventListener("resize", reposition);
|
|
2677
3067
|
window.removeEventListener("scroll", reposition, true);
|
|
2678
3068
|
};
|
|
2679
|
-
});
|
|
2680
|
-
(0,
|
|
3069
|
+
}, [isOpen, updatePosition]);
|
|
3070
|
+
(0, import_react18.useEffect)(() => () => clearTimer(), []);
|
|
2681
3071
|
const describedBy = [children.props["aria-describedby"], tooltipId].filter(Boolean).join(" ");
|
|
2682
|
-
const trigger = (0,
|
|
2683
|
-
return /* @__PURE__ */ (0,
|
|
2684
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
const trigger = (0, import_react18.cloneElement)(children, { "aria-describedby": describedBy });
|
|
3073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2685
3075
|
"span",
|
|
2686
3076
|
{
|
|
2687
3077
|
ref: triggerRef,
|
|
2688
3078
|
className: "inline-flex",
|
|
2689
3079
|
onMouseEnter: () => show(false),
|
|
2690
|
-
onMouseLeave:
|
|
3080
|
+
onMouseLeave: hideFromTrigger,
|
|
2691
3081
|
onFocusCapture: () => show(true),
|
|
2692
3082
|
onBlurCapture: hide,
|
|
2693
3083
|
onKeyDown: (event) => {
|
|
@@ -2696,19 +3086,26 @@ function Tooltip({
|
|
|
2696
3086
|
children: trigger
|
|
2697
3087
|
}
|
|
2698
3088
|
),
|
|
2699
|
-
isOpen &&
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
3089
|
+
isOpen && typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
|
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2701
3091
|
"span",
|
|
2702
3092
|
{
|
|
2703
|
-
style: __spreadValues({ position: "fixed" }, position),
|
|
3093
|
+
style: __spreadProps(__spreadValues({ position: "fixed" }, position), { visibility: position ? void 0 : "hidden" }),
|
|
2704
3094
|
className: "pointer-events-none z-[200]",
|
|
2705
|
-
children: /* @__PURE__ */ (0,
|
|
3095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2706
3096
|
"span",
|
|
2707
3097
|
{
|
|
3098
|
+
ref: contentRef,
|
|
2708
3099
|
id: tooltipId,
|
|
2709
3100
|
role: "tooltip",
|
|
2710
3101
|
"data-side": side,
|
|
2711
|
-
className: cn(
|
|
3102
|
+
className: cn(
|
|
3103
|
+
"ph-tooltip-content",
|
|
3104
|
+
!disableHoverableContent && "pointer-events-auto",
|
|
3105
|
+
className
|
|
3106
|
+
),
|
|
3107
|
+
onMouseEnter: disableHoverableContent ? void 0 : clearTimer,
|
|
3108
|
+
onMouseLeave: disableHoverableContent ? void 0 : hide,
|
|
2712
3109
|
children: content
|
|
2713
3110
|
}
|
|
2714
3111
|
)
|
|
@@ -2720,9 +3117,9 @@ function Tooltip({
|
|
|
2720
3117
|
}
|
|
2721
3118
|
|
|
2722
3119
|
// src/components/ui/EmptyState.tsx
|
|
2723
|
-
var
|
|
3120
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2724
3121
|
function EmptyState({ icon, title, description, action, className }) {
|
|
2725
|
-
return /* @__PURE__ */ (0,
|
|
3122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2726
3123
|
"div",
|
|
2727
3124
|
{
|
|
2728
3125
|
className: cn(
|
|
@@ -2730,17 +3127,17 @@ function EmptyState({ icon, title, description, action, className }) {
|
|
|
2730
3127
|
className
|
|
2731
3128
|
),
|
|
2732
3129
|
children: [
|
|
2733
|
-
icon && /* @__PURE__ */ (0,
|
|
2734
|
-
/* @__PURE__ */ (0,
|
|
2735
|
-
description && /* @__PURE__ */ (0,
|
|
2736
|
-
action && /* @__PURE__ */ (0,
|
|
3130
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-ph-muted text-ph-mutedtext", children: icon }),
|
|
3131
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { className: "text-base font-semibold text-ph-ink", children: title }),
|
|
3132
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "mt-1 max-w-sm text-sm text-ph-subtle", children: description }),
|
|
3133
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mt-4", children: action })
|
|
2737
3134
|
]
|
|
2738
3135
|
}
|
|
2739
3136
|
);
|
|
2740
3137
|
}
|
|
2741
3138
|
|
|
2742
3139
|
// src/components/ui/FilterChips.tsx
|
|
2743
|
-
var
|
|
3140
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2744
3141
|
function FilterChips({
|
|
2745
3142
|
chips,
|
|
2746
3143
|
onToggle,
|
|
@@ -2748,20 +3145,20 @@ function FilterChips({
|
|
|
2748
3145
|
className,
|
|
2749
3146
|
"aria-label": ariaLabel = "Applied filters"
|
|
2750
3147
|
}) {
|
|
2751
|
-
return /* @__PURE__ */ (0,
|
|
3148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("ph-filter-chips", className), role: "group", "aria-label": ariaLabel, children: chips.map((chip) => {
|
|
2752
3149
|
var _a;
|
|
2753
3150
|
const label = (_a = chip.removeLabel) != null ? _a : getChipText(chip);
|
|
2754
|
-
const content = /* @__PURE__ */ (0,
|
|
2755
|
-
/* @__PURE__ */ (0,
|
|
2756
|
-
chip.value != null ? /* @__PURE__ */ (0,
|
|
3151
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ph-filter-chip__label", children: chip.label }),
|
|
3153
|
+
chip.value != null ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ph-filter-chip__value", children: chip.value }) : null
|
|
2757
3154
|
] });
|
|
2758
|
-
return /* @__PURE__ */ (0,
|
|
3155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2759
3156
|
"span",
|
|
2760
3157
|
{
|
|
2761
3158
|
className: cn("ph-filter-chip", chip.active && "ph-filter-chip--active"),
|
|
2762
3159
|
"data-state": chip.active ? "on" : "off",
|
|
2763
3160
|
children: [
|
|
2764
|
-
onToggle ? /* @__PURE__ */ (0,
|
|
3161
|
+
onToggle ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2765
3162
|
"button",
|
|
2766
3163
|
{
|
|
2767
3164
|
type: "button",
|
|
@@ -2770,15 +3167,15 @@ function FilterChips({
|
|
|
2770
3167
|
onClick: () => onToggle(chip.id),
|
|
2771
3168
|
children: content
|
|
2772
3169
|
}
|
|
2773
|
-
) : /* @__PURE__ */ (0,
|
|
2774
|
-
chip.active && onRemove ? /* @__PURE__ */ (0,
|
|
3170
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ph-filter-chip__main", children: content }),
|
|
3171
|
+
chip.active && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2775
3172
|
"button",
|
|
2776
3173
|
{
|
|
2777
3174
|
type: "button",
|
|
2778
3175
|
className: "ph-filter-chip__remove",
|
|
2779
3176
|
"aria-label": `Remove ${label} filter`,
|
|
2780
3177
|
onClick: () => onRemove(chip.id),
|
|
2781
|
-
children: /* @__PURE__ */ (0,
|
|
3178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(IconClose, { className: "h-3 w-3", "aria-hidden": true })
|
|
2782
3179
|
}
|
|
2783
3180
|
) : null
|
|
2784
3181
|
]
|
|
@@ -2794,7 +3191,7 @@ function getChipText(chip) {
|
|
|
2794
3191
|
}
|
|
2795
3192
|
|
|
2796
3193
|
// src/components/ui/FilterBar.tsx
|
|
2797
|
-
var
|
|
3194
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2798
3195
|
function FilterBar(_a) {
|
|
2799
3196
|
var _b = _a, {
|
|
2800
3197
|
children,
|
|
@@ -2811,12 +3208,12 @@ function FilterBar(_a) {
|
|
|
2811
3208
|
"resultCount",
|
|
2812
3209
|
"className"
|
|
2813
3210
|
]);
|
|
2814
|
-
return /* @__PURE__ */ (0,
|
|
2815
|
-
/* @__PURE__ */ (0,
|
|
3211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-filter-bar", className) }, props), { children: [
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ph-filter-bar__controls", role: "group", "aria-label": label, children: [
|
|
2816
3213
|
children,
|
|
2817
|
-
onClear ? /* @__PURE__ */ (0,
|
|
3214
|
+
onClear ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "ph-filter-bar__clear", onClick: onClear, children: clearLabel }) : null
|
|
2818
3215
|
] }),
|
|
2819
|
-
resultCount != null ? /* @__PURE__ */ (0,
|
|
3216
|
+
resultCount != null ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("output", { className: "ph-filter-bar__results", "aria-live": "polite", children: resultCount }) : null
|
|
2820
3217
|
] }));
|
|
2821
3218
|
}
|
|
2822
3219
|
function FilterMenu({
|
|
@@ -2833,19 +3230,19 @@ function FilterMenu({
|
|
|
2833
3230
|
const selected = options.find((option) => option.value === value);
|
|
2834
3231
|
const displayValue = (_a = selected == null ? void 0 : selected.label) != null ? _a : placeholder;
|
|
2835
3232
|
const accessibleValue = selected ? getOptionText(selected) : String(placeholder);
|
|
2836
|
-
return /* @__PURE__ */ (0,
|
|
3233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2837
3234
|
DropdownMenu,
|
|
2838
3235
|
{
|
|
2839
3236
|
"aria-label": `${label}: ${accessibleValue}`,
|
|
2840
3237
|
align,
|
|
2841
3238
|
disabled,
|
|
2842
3239
|
className,
|
|
2843
|
-
trigger: /* @__PURE__ */ (0,
|
|
2844
|
-
/* @__PURE__ */ (0,
|
|
2845
|
-
/* @__PURE__ */ (0,
|
|
2846
|
-
/* @__PURE__ */ (0,
|
|
3240
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: cn("ph-filter-menu-trigger", selected && "ph-filter-menu-trigger--active"), children: [
|
|
3241
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IconTuning, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
3242
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ph-filter-menu-trigger__value", children: displayValue })
|
|
2847
3244
|
] }),
|
|
2848
|
-
children: /* @__PURE__ */ (0,
|
|
3245
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2849
3246
|
DropdownRadioItem,
|
|
2850
3247
|
{
|
|
2851
3248
|
value: option.value,
|
|
@@ -2869,25 +3266,25 @@ function SortMenu({
|
|
|
2869
3266
|
className
|
|
2870
3267
|
}) {
|
|
2871
3268
|
const selected = options.find((option) => option.value === value);
|
|
2872
|
-
return /* @__PURE__ */ (0,
|
|
3269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2873
3270
|
DropdownMenu,
|
|
2874
3271
|
{
|
|
2875
3272
|
"aria-label": `${label}: ${selected ? getOptionText(selected) : "Choose sort order"}`,
|
|
2876
3273
|
align,
|
|
2877
3274
|
disabled,
|
|
2878
3275
|
className,
|
|
2879
|
-
trigger: /* @__PURE__ */ (0,
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
3276
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "ph-filter-menu-trigger ph-sort-menu-trigger", children: [
|
|
3277
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2881
3278
|
IconArrowDown,
|
|
2882
3279
|
{
|
|
2883
3280
|
className: cn("h-3.5 w-3.5", direction === "ascending" && "rotate-180"),
|
|
2884
3281
|
"aria-hidden": true
|
|
2885
3282
|
}
|
|
2886
3283
|
),
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2888
|
-
selected ? /* @__PURE__ */ (0,
|
|
3284
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ph-filter-menu-trigger__label", children: label }),
|
|
3285
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ph-filter-menu-trigger__value", children: selected.label }) : null
|
|
2889
3286
|
] }),
|
|
2890
|
-
children: /* @__PURE__ */ (0,
|
|
3287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2891
3288
|
DropdownRadioItem,
|
|
2892
3289
|
{
|
|
2893
3290
|
value: option.value,
|
|
@@ -2907,7 +3304,8 @@ function getOptionText(option) {
|
|
|
2907
3304
|
}
|
|
2908
3305
|
|
|
2909
3306
|
// src/components/ui/Typography.tsx
|
|
2910
|
-
var
|
|
3307
|
+
var import_react19 = require("react");
|
|
3308
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2911
3309
|
var toneMap2 = {
|
|
2912
3310
|
default: "text-ph-ink",
|
|
2913
3311
|
muted: "text-ph-mutedtext",
|
|
@@ -2929,57 +3327,65 @@ var weightMap = {
|
|
|
2929
3327
|
function textClass(base, tone, weight, truncate, className) {
|
|
2930
3328
|
return cn(base, toneMap2[tone], weight && weightMap[weight], truncate && "truncate", className);
|
|
2931
3329
|
}
|
|
2932
|
-
|
|
2933
|
-
children,
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
className
|
|
2938
|
-
}) {
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
return /* @__PURE__ */ (0,
|
|
2943
|
-
}
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
}
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
return /* @__PURE__ */ (0,
|
|
2955
|
-
}
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
}
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
return /* @__PURE__ */ (0,
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
}
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
return /* @__PURE__ */ (0,
|
|
2979
|
-
}
|
|
3330
|
+
var Display = (0, import_react19.forwardRef)(function Display2(_a, ref) {
|
|
3331
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h1", __spreadProps(__spreadValues({ ref }, props), { className: textClass("ph-hero-title", tone, weight, truncate, className), children }));
|
|
3333
|
+
});
|
|
3334
|
+
var SectionTitle = (0, import_react19.forwardRef)(function SectionTitle2(_a, ref) {
|
|
3335
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", __spreadProps(__spreadValues({ ref }, props), { className: textClass("ph-section-title", tone, weight, truncate, className), children }));
|
|
3337
|
+
});
|
|
3338
|
+
var H1 = (0, import_react19.forwardRef)(function H12(_a, ref) {
|
|
3339
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h1", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-3xl font-bold tracking-tight md:text-4xl", tone, weight, truncate, className), children }));
|
|
3341
|
+
});
|
|
3342
|
+
var H2 = (0, import_react19.forwardRef)(function H22(_a, ref) {
|
|
3343
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-2xl font-bold tracking-tight", tone, weight, truncate, className), children }));
|
|
3345
|
+
});
|
|
3346
|
+
var H3 = (0, import_react19.forwardRef)(function H32(_a, ref) {
|
|
3347
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h3", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-xl font-semibold", tone, weight, truncate, className), children }));
|
|
3349
|
+
});
|
|
3350
|
+
var H4 = (0, import_react19.forwardRef)(function H42(_a, ref) {
|
|
3351
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-lg font-semibold", tone, weight, truncate, className), children }));
|
|
3353
|
+
});
|
|
3354
|
+
var H5 = (0, import_react19.forwardRef)(function H52(_a, ref) {
|
|
3355
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h5", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-base font-semibold", tone, weight, truncate, className), children }));
|
|
3357
|
+
});
|
|
3358
|
+
var P = (0, import_react19.forwardRef)(function P2(_a, ref) {
|
|
3359
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-base leading-relaxed", tone, weight, truncate, className), children }));
|
|
3361
|
+
});
|
|
3362
|
+
var Small = (0, import_react19.forwardRef)(function Small2(_a, ref) {
|
|
3363
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-sm leading-relaxed", tone, weight, truncate, className), children }));
|
|
3365
|
+
});
|
|
3366
|
+
var Caption = (0, import_react19.forwardRef)(function Caption2(_a, ref) {
|
|
3367
|
+
var _b = _a, { children, tone = "muted", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-[11px] font-medium uppercase tracking-wider", tone, weight, truncate, className), children }));
|
|
3369
|
+
});
|
|
3370
|
+
var Overline = (0, import_react19.forwardRef)(function Overline2(_a, ref) {
|
|
3371
|
+
var _b = _a, { children, tone = "muted", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-[10px] font-bold uppercase tracking-[0.15em]", tone, weight, truncate, className), children }));
|
|
3373
|
+
});
|
|
3374
|
+
var Lead = (0, import_react19.forwardRef)(function Lead2(_a, ref) {
|
|
3375
|
+
var _b = _a, { children, tone = "subtle", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", __spreadProps(__spreadValues({ ref }, props), { className: textClass("ph-lead", tone, weight, truncate, className), children }));
|
|
3377
|
+
});
|
|
3378
|
+
var Mono = (0, import_react19.forwardRef)(function Mono2(_a, ref) {
|
|
3379
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("code", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-sm font-mono leading-relaxed", tone, weight, truncate, className), children }));
|
|
3381
|
+
});
|
|
3382
|
+
var Label = (0, import_react19.forwardRef)(function Label2(_a, ref) {
|
|
3383
|
+
var _b = _a, { children, tone = "default", weight, truncate, className } = _b, props = __objRest(_b, ["children", "tone", "weight", "truncate", "className"]);
|
|
3384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", __spreadProps(__spreadValues({ ref }, props), { className: textClass("text-sm font-medium", tone, weight, truncate, className), children }));
|
|
3385
|
+
});
|
|
2980
3386
|
|
|
2981
3387
|
// src/components/ui/Avatar.tsx
|
|
2982
|
-
var
|
|
3388
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2983
3389
|
var sizeMap4 = {
|
|
2984
3390
|
xs: "h-8 w-8 text-[10px]",
|
|
2985
3391
|
sm: "h-10 w-10 text-xs",
|
|
@@ -2988,9 +3394,9 @@ var sizeMap4 = {
|
|
|
2988
3394
|
xl: "h-24 w-24 text-3xl"
|
|
2989
3395
|
};
|
|
2990
3396
|
var statusMap = {
|
|
2991
|
-
online: "bg-
|
|
3397
|
+
online: "bg-ph-success",
|
|
2992
3398
|
offline: "bg-ph-mutedtext",
|
|
2993
|
-
away: "bg-
|
|
3399
|
+
away: "bg-ph-warning",
|
|
2994
3400
|
busy: "bg-ph-danger"
|
|
2995
3401
|
};
|
|
2996
3402
|
function Avatar(_a) {
|
|
@@ -3011,8 +3417,8 @@ function Avatar(_a) {
|
|
|
3011
3417
|
"badge",
|
|
3012
3418
|
"className"
|
|
3013
3419
|
]);
|
|
3014
|
-
return /* @__PURE__ */ (0,
|
|
3015
|
-
/* @__PURE__ */ (0,
|
|
3420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex shrink-0", className) }, props), { children: [
|
|
3421
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3016
3422
|
"div",
|
|
3017
3423
|
{
|
|
3018
3424
|
className: cn(
|
|
@@ -3023,16 +3429,18 @@ function Avatar(_a) {
|
|
|
3023
3429
|
children: icon || label
|
|
3024
3430
|
}
|
|
3025
3431
|
),
|
|
3026
|
-
status && /* @__PURE__ */ (0,
|
|
3432
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3027
3433
|
"span",
|
|
3028
3434
|
{
|
|
3435
|
+
role: "img",
|
|
3436
|
+
"aria-label": `${status} status`,
|
|
3029
3437
|
className: cn(
|
|
3030
|
-
"absolute bottom-0 right-1 h-2.5 w-2.5 rounded-full border-2 border-
|
|
3438
|
+
"absolute bottom-0 right-1 h-2.5 w-2.5 rounded-full border-2 border-ph-surface",
|
|
3031
3439
|
statusMap[status]
|
|
3032
3440
|
)
|
|
3033
3441
|
}
|
|
3034
3442
|
),
|
|
3035
|
-
badge && /* @__PURE__ */ (0,
|
|
3443
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "absolute -bottom-1 -right-1 flex min-w-[22px] items-center justify-center rounded-full bg-ph-brand px-1.5 py-px text-[10px] font-bold text-white", children: badge })
|
|
3036
3444
|
] }));
|
|
3037
3445
|
}
|
|
3038
3446
|
function AvatarGroup(_a) {
|
|
@@ -3040,9 +3448,9 @@ function AvatarGroup(_a) {
|
|
|
3040
3448
|
const items = Array.isArray(children) ? children : [children];
|
|
3041
3449
|
const visible = max ? items.slice(0, max) : items;
|
|
3042
3450
|
const remaining = max ? items.length - max : 0;
|
|
3043
|
-
return /* @__PURE__ */ (0,
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", __spreadProps(__spreadValues({ className: cn("-space-x-3 flex rtl:space-x-reverse", className) }, props), { children: [
|
|
3044
3452
|
visible,
|
|
3045
|
-
remaining > 0 && /* @__PURE__ */ (0,
|
|
3453
|
+
remaining > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3046
3454
|
Avatar,
|
|
3047
3455
|
{
|
|
3048
3456
|
label: `+${remaining}`,
|
|
@@ -3054,7 +3462,8 @@ function AvatarGroup(_a) {
|
|
|
3054
3462
|
}
|
|
3055
3463
|
|
|
3056
3464
|
// src/components/ui/Progress.tsx
|
|
3057
|
-
var
|
|
3465
|
+
var import_react20 = require("react");
|
|
3466
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3058
3467
|
var sizeMap5 = {
|
|
3059
3468
|
sm: "h-1",
|
|
3060
3469
|
md: "h-2",
|
|
@@ -3068,7 +3477,9 @@ function Progress(_a) {
|
|
|
3068
3477
|
label,
|
|
3069
3478
|
showPercentage = false,
|
|
3070
3479
|
size = "md",
|
|
3071
|
-
className
|
|
3480
|
+
className,
|
|
3481
|
+
"aria-label": ariaLabel,
|
|
3482
|
+
"aria-labelledby": ariaLabelledBy
|
|
3072
3483
|
} = _b, props = __objRest(_b, [
|
|
3073
3484
|
"value",
|
|
3074
3485
|
"max",
|
|
@@ -3076,35 +3487,42 @@ function Progress(_a) {
|
|
|
3076
3487
|
"label",
|
|
3077
3488
|
"showPercentage",
|
|
3078
3489
|
"size",
|
|
3079
|
-
"className"
|
|
3490
|
+
"className",
|
|
3491
|
+
"aria-label",
|
|
3492
|
+
"aria-labelledby"
|
|
3080
3493
|
]);
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3494
|
+
const labelId = (0, import_react20.useId)();
|
|
3495
|
+
const safeMax = Number.isFinite(max) && max > 0 ? max : 100;
|
|
3496
|
+
const safeValue = Number.isFinite(value) ? Math.min(safeMax, Math.max(0, value)) : 0;
|
|
3497
|
+
const percentage = safeValue / safeMax * 100;
|
|
3498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", __spreadProps(__spreadValues({ className: cn("w-full", className) }, props), { children: [
|
|
3499
|
+
(label || showPercentage) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mb-1.5 flex justify-between text-sm text-ph-subtle", children: [
|
|
3500
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { id: labelId, children: label }),
|
|
3501
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "tabular-nums", children: [
|
|
3086
3502
|
Math.round(percentage),
|
|
3087
3503
|
"%"
|
|
3088
3504
|
] })
|
|
3089
3505
|
] }),
|
|
3090
|
-
/* @__PURE__ */ (0,
|
|
3506
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("ph-progress", sizeMap5[size]), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3091
3507
|
"div",
|
|
3092
3508
|
{
|
|
3093
3509
|
className: cn("ph-progress-bar", color),
|
|
3094
3510
|
style: { width: `${percentage}%` },
|
|
3095
3511
|
role: "progressbar",
|
|
3096
|
-
"aria-valuenow":
|
|
3512
|
+
"aria-valuenow": safeValue,
|
|
3097
3513
|
"aria-valuemin": 0,
|
|
3098
|
-
"aria-valuemax":
|
|
3514
|
+
"aria-valuemax": safeMax,
|
|
3515
|
+
"aria-label": label ? void 0 : ariaLabel != null ? ariaLabel : "Progress",
|
|
3516
|
+
"aria-labelledby": label ? ariaLabelledBy != null ? ariaLabelledBy : labelId : ariaLabelledBy
|
|
3099
3517
|
}
|
|
3100
3518
|
) })
|
|
3101
3519
|
] }));
|
|
3102
3520
|
}
|
|
3103
3521
|
|
|
3104
3522
|
// src/components/ui/Link.tsx
|
|
3105
|
-
var
|
|
3106
|
-
var
|
|
3107
|
-
var Link = (0,
|
|
3523
|
+
var import_react21 = require("react");
|
|
3524
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3525
|
+
var Link = (0, import_react21.forwardRef)(function Link2(_a, ref) {
|
|
3108
3526
|
var _b = _a, {
|
|
3109
3527
|
className,
|
|
3110
3528
|
disabled = false,
|
|
@@ -3114,7 +3532,7 @@ var Link = (0, import_react17.forwardRef)(function Link2(_a, ref) {
|
|
|
3114
3532
|
"disabled",
|
|
3115
3533
|
"children"
|
|
3116
3534
|
]);
|
|
3117
|
-
return /* @__PURE__ */ (0,
|
|
3535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3118
3536
|
"a",
|
|
3119
3537
|
__spreadProps(__spreadValues({
|
|
3120
3538
|
ref,
|
|
@@ -3133,10 +3551,10 @@ var Link = (0, import_react17.forwardRef)(function Link2(_a, ref) {
|
|
|
3133
3551
|
Link.displayName = "Link";
|
|
3134
3552
|
|
|
3135
3553
|
// src/components/ui/Spinner.tsx
|
|
3136
|
-
var
|
|
3554
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3137
3555
|
function Spinner(_a) {
|
|
3138
3556
|
var _b = _a, { size = "sm", textColored = false, className } = _b, props = __objRest(_b, ["size", "textColored", "className"]);
|
|
3139
|
-
return /* @__PURE__ */ (0,
|
|
3557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3140
3558
|
"span",
|
|
3141
3559
|
__spreadProps(__spreadValues({
|
|
3142
3560
|
className: cn(
|
|
@@ -3148,9 +3566,9 @@ function Spinner(_a) {
|
|
|
3148
3566
|
role: "status",
|
|
3149
3567
|
"aria-label": "Loading"
|
|
3150
3568
|
}, props), {
|
|
3151
|
-
children: /* @__PURE__ */ (0,
|
|
3152
|
-
/* @__PURE__ */ (0,
|
|
3153
|
-
/* @__PURE__ */ (0,
|
|
3569
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "ph-spinner__svg", children: [
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", opacity: 0.2 }),
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
|
|
3154
3572
|
] })
|
|
3155
3573
|
})
|
|
3156
3574
|
);
|
|
@@ -3158,7 +3576,7 @@ function Spinner(_a) {
|
|
|
3158
3576
|
Spinner.displayName = "Spinner";
|
|
3159
3577
|
|
|
3160
3578
|
// src/components/ui/Dot.tsx
|
|
3161
|
-
var
|
|
3579
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3162
3580
|
var colorMap = {
|
|
3163
3581
|
green: "bg-ph-success",
|
|
3164
3582
|
yellow: "bg-ph-warning",
|
|
@@ -3168,7 +3586,7 @@ var colorMap = {
|
|
|
3168
3586
|
};
|
|
3169
3587
|
function Dot(_a) {
|
|
3170
3588
|
var _b = _a, { color = "gray", size = "md", className } = _b, props = __objRest(_b, ["color", "size", "className"]);
|
|
3171
|
-
return /* @__PURE__ */ (0,
|
|
3589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3172
3590
|
"span",
|
|
3173
3591
|
__spreadValues({
|
|
3174
3592
|
className: cn(
|
|
@@ -3184,9 +3602,9 @@ function Dot(_a) {
|
|
|
3184
3602
|
Dot.displayName = "Dot";
|
|
3185
3603
|
|
|
3186
3604
|
// src/components/ui/Chip.tsx
|
|
3187
|
-
var
|
|
3188
|
-
var
|
|
3189
|
-
var Chip = (0,
|
|
3605
|
+
var import_react22 = require("react");
|
|
3606
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3607
|
+
var Chip = (0, import_react22.forwardRef)(function Chip2(_a, ref) {
|
|
3190
3608
|
var _b = _a, {
|
|
3191
3609
|
selected = false,
|
|
3192
3610
|
onRemove,
|
|
@@ -3205,18 +3623,18 @@ var Chip = (0, import_react18.forwardRef)(function Chip2(_a, ref) {
|
|
|
3205
3623
|
);
|
|
3206
3624
|
if (onRemove) {
|
|
3207
3625
|
const removeLabel = typeof children === "string" ? `Remove ${children}` : "Remove";
|
|
3208
|
-
return /* @__PURE__ */ (0,
|
|
3209
|
-
/* @__PURE__ */ (0,
|
|
3626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: chipClassName, children: [
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3210
3628
|
"button",
|
|
3211
3629
|
__spreadProps(__spreadValues({
|
|
3212
3630
|
ref,
|
|
3213
3631
|
type: "button",
|
|
3214
3632
|
className: "min-w-0 bg-transparent p-0 text-inherit"
|
|
3215
3633
|
}, props), {
|
|
3216
|
-
children: /* @__PURE__ */ (0,
|
|
3634
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-chip__text", children })
|
|
3217
3635
|
})
|
|
3218
3636
|
),
|
|
3219
|
-
/* @__PURE__ */ (0,
|
|
3637
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3220
3638
|
"button",
|
|
3221
3639
|
{
|
|
3222
3640
|
type: "button",
|
|
@@ -3224,19 +3642,19 @@ var Chip = (0, import_react18.forwardRef)(function Chip2(_a, ref) {
|
|
|
3224
3642
|
disabled: props.disabled,
|
|
3225
3643
|
className: "ph-chip__remove",
|
|
3226
3644
|
"aria-label": removeLabel,
|
|
3227
|
-
children: /* @__PURE__ */ (0,
|
|
3645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M2 2l6 6M8 2l-6 6" }) })
|
|
3228
3646
|
}
|
|
3229
3647
|
)
|
|
3230
3648
|
] });
|
|
3231
3649
|
}
|
|
3232
|
-
return /* @__PURE__ */ (0,
|
|
3650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3233
3651
|
"button",
|
|
3234
3652
|
__spreadProps(__spreadValues({
|
|
3235
3653
|
ref,
|
|
3236
3654
|
type: "button",
|
|
3237
3655
|
className: chipClassName
|
|
3238
3656
|
}, props), {
|
|
3239
|
-
children: /* @__PURE__ */ (0,
|
|
3657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ph-chip__text", children })
|
|
3240
3658
|
})
|
|
3241
3659
|
);
|
|
3242
3660
|
});
|
|
@@ -3359,6 +3777,7 @@ Chip.displayName = "Chip";
|
|
|
3359
3777
|
IconVolume,
|
|
3360
3778
|
IconVolumeOff,
|
|
3361
3779
|
Input,
|
|
3780
|
+
Kbd,
|
|
3362
3781
|
Label,
|
|
3363
3782
|
Lead,
|
|
3364
3783
|
Link,
|
|
@@ -3390,6 +3809,8 @@ Chip.displayName = "Chip";
|
|
|
3390
3809
|
THEME_INIT_SCRIPT,
|
|
3391
3810
|
Table,
|
|
3392
3811
|
Textarea,
|
|
3812
|
+
ThemeDomSync,
|
|
3813
|
+
ThemeSwitcher,
|
|
3393
3814
|
Toggle,
|
|
3394
3815
|
Tooltip,
|
|
3395
3816
|
TooltipProvider,
|