@xenide-io/the-old-ui-theme 0.5.3 → 0.5.4
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/dist/{index-Od4pIP4F.d.mts → Chip-C5hRFAhe.d.mts} +10 -606
- package/dist/{index-Od4pIP4F.d.ts → Chip-C5hRFAhe.d.ts} +10 -606
- package/dist/{chunk-G53YLHVE.mjs → chunk-E5ZBQYEX.mjs} +59 -9
- package/dist/{chunk-VFTZXPXM.mjs → chunk-SBBKXV35.mjs} +144 -79
- package/dist/index.d.mts +3 -79
- package/dist/index.d.ts +3 -79
- package/dist/index.js +524 -3595
- package/dist/index.mjs +3 -765
- package/dist/suite.d.mts +38 -12
- package/dist/suite.d.ts +38 -12
- package/dist/suite.js +84 -15
- package/dist/suite.mjs +53 -13
- package/dist/ui.d.mts +608 -2
- package/dist/ui.d.ts +608 -2
- package/dist/ui.js +202 -87
- package/dist/ui.mjs +2 -2
- package/package.json +2 -6
- package/scripts/install-theme-dev.sh +60 -0
- package/scripts/sync-posthog-icons.mjs +75 -0
- package/src/components/ui/Chip.tsx +36 -18
- package/src/components/ui/CommandPalette.test.tsx +41 -0
- package/src/components/ui/CommandPalette.tsx +58 -9
- package/src/components/ui/DropdownMenu.tsx +50 -11
- package/src/components/ui/SegmentedControl.tsx +2 -1
- package/src/components/ui/SettingsLayout.tsx +19 -5
- package/src/components/ui/interaction-primitives.test.tsx +52 -0
- package/src/styles/suite-skin.css +17 -35
- package/src/suite/components/app-switcher.tsx +32 -25
- package/src/suite/components/command-palette-host.tsx +20 -8
- package/src/suite/components/suite-app-layout.tsx +1 -1
- package/src/suite/components/suite-bottom-nav.tsx +23 -18
- package/src/suite/components/suite-layout.test.tsx +44 -0
- package/src/suite/components/suite-layout.tsx +3 -3
- package/src/suite/components/suite-mobile-drawer.tsx +12 -0
- package/src/suite/components/suite-mobile-header.tsx +15 -9
- package/src/suite/components/suite-notification-bell.tsx +23 -11
- package/src/suite/components/suite-settings-mobile-nav.tsx +2 -0
- package/src/suite/components/suite-sidebar.tsx +6 -3
- package/src/suite/components/suite-user-menu.tsx +6 -0
- package/src/suite/lib/injected.ts +12 -11
- package/src/components/charts/index.ts +0 -9
- package/src/components/charts/quill/BarChart.tsx +0 -85
- package/src/components/charts/quill/FunnelChart.tsx +0 -49
- package/src/components/charts/quill/InsightShell.tsx +0 -27
- package/src/components/charts/quill/MetricCard.tsx +0 -44
- package/src/components/charts/quill/PieChart.tsx +0 -81
- package/src/components/charts/quill/Sparkline.tsx +0 -57
- package/src/components/charts/quill/TimeSeriesLineChart.tsx +0 -62
- package/src/components/charts/quill/index.ts +0 -9
package/dist/ui.js
CHANGED
|
@@ -1252,7 +1252,12 @@ function SettingsNav(_a) {
|
|
|
1252
1252
|
"a",
|
|
1253
1253
|
{
|
|
1254
1254
|
href: item.href,
|
|
1255
|
-
|
|
1255
|
+
id: `settings-nav-${item.id}`,
|
|
1256
|
+
"data-test": `settings-nav-${item.id}`,
|
|
1257
|
+
className: cn(
|
|
1258
|
+
"ph-settings-nav__item",
|
|
1259
|
+
item.active && "ph-settings-nav__item--active"
|
|
1260
|
+
),
|
|
1256
1261
|
"aria-current": item.active ? "page" : void 0,
|
|
1257
1262
|
children: [
|
|
1258
1263
|
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ph-settings-nav__icon", children: item.icon }) : null,
|
|
@@ -1341,7 +1346,14 @@ function DropdownContent({
|
|
|
1341
1346
|
sticky: "partial",
|
|
1342
1347
|
children: [
|
|
1343
1348
|
children,
|
|
1344
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1349
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1350
|
+
DropdownPrimitive.Arrow,
|
|
1351
|
+
{
|
|
1352
|
+
className: "ph-dropdown-arrow",
|
|
1353
|
+
width: 12,
|
|
1354
|
+
height: 6
|
|
1355
|
+
}
|
|
1356
|
+
)
|
|
1345
1357
|
]
|
|
1346
1358
|
}
|
|
1347
1359
|
) });
|
|
@@ -1349,6 +1361,8 @@ function DropdownContent({
|
|
|
1349
1361
|
function DropdownMenu(_a) {
|
|
1350
1362
|
var _b = _a, {
|
|
1351
1363
|
trigger,
|
|
1364
|
+
triggerId,
|
|
1365
|
+
triggerDataTest,
|
|
1352
1366
|
children,
|
|
1353
1367
|
align,
|
|
1354
1368
|
side,
|
|
@@ -1366,6 +1380,8 @@ function DropdownMenu(_a) {
|
|
|
1366
1380
|
disabled
|
|
1367
1381
|
} = _b, props = __objRest(_b, [
|
|
1368
1382
|
"trigger",
|
|
1383
|
+
"triggerId",
|
|
1384
|
+
"triggerDataTest",
|
|
1369
1385
|
"children",
|
|
1370
1386
|
"align",
|
|
1371
1387
|
"side",
|
|
@@ -1390,7 +1406,17 @@ function DropdownMenu(_a) {
|
|
|
1390
1406
|
onOpenChange,
|
|
1391
1407
|
modal,
|
|
1392
1408
|
children: [
|
|
1393
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1409
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1410
|
+
"button",
|
|
1411
|
+
{
|
|
1412
|
+
type: "button",
|
|
1413
|
+
id: triggerId,
|
|
1414
|
+
"data-test": triggerDataTest,
|
|
1415
|
+
className: "ph-dropdown-trigger",
|
|
1416
|
+
"aria-label": ariaLabel,
|
|
1417
|
+
children: trigger
|
|
1418
|
+
}
|
|
1419
|
+
) }),
|
|
1394
1420
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1395
1421
|
DropdownContent,
|
|
1396
1422
|
{
|
|
@@ -1478,7 +1504,15 @@ function DropdownButton(_a) {
|
|
|
1478
1504
|
split && "ph-btn-split"
|
|
1479
1505
|
),
|
|
1480
1506
|
"aria-label": ariaLabel,
|
|
1481
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1507
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1508
|
+
ButtonChrome,
|
|
1509
|
+
{
|
|
1510
|
+
label,
|
|
1511
|
+
icon,
|
|
1512
|
+
sideIcon: trailing,
|
|
1513
|
+
split
|
|
1514
|
+
}
|
|
1515
|
+
)
|
|
1482
1516
|
}
|
|
1483
1517
|
) }),
|
|
1484
1518
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
@@ -1499,7 +1533,15 @@ function DropdownButton(_a) {
|
|
|
1499
1533
|
) }));
|
|
1500
1534
|
}
|
|
1501
1535
|
function DropdownItem(_a) {
|
|
1502
|
-
var _b = _a, {
|
|
1536
|
+
var _b = _a, {
|
|
1537
|
+
className,
|
|
1538
|
+
children,
|
|
1539
|
+
disabled
|
|
1540
|
+
} = _b, props = __objRest(_b, [
|
|
1541
|
+
"className",
|
|
1542
|
+
"children",
|
|
1543
|
+
"disabled"
|
|
1544
|
+
]);
|
|
1503
1545
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.Item, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1504
1546
|
"button",
|
|
1505
1547
|
__spreadProps(__spreadValues({
|
|
@@ -1515,11 +1557,24 @@ function DropdownRadioGroup(props) {
|
|
|
1515
1557
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.RadioGroup, __spreadValues({}, props));
|
|
1516
1558
|
}
|
|
1517
1559
|
function DropdownRadioItem(_a) {
|
|
1518
|
-
var _b = _a, {
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1560
|
+
var _b = _a, {
|
|
1561
|
+
className,
|
|
1562
|
+
children
|
|
1563
|
+
} = _b, props = __objRest(_b, [
|
|
1564
|
+
"className",
|
|
1565
|
+
"children"
|
|
1566
|
+
]);
|
|
1567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1568
|
+
DropdownPrimitive.RadioItem,
|
|
1569
|
+
__spreadProps(__spreadValues({
|
|
1570
|
+
className: cn("ph-dropdown-item ph-dropdown-radio-item", className)
|
|
1571
|
+
}, props), {
|
|
1572
|
+
children: [
|
|
1573
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ph-dropdown-item-indicator", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconCheck, { className: "h-3.5 w-3.5" }) }) }),
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children })
|
|
1575
|
+
]
|
|
1576
|
+
})
|
|
1577
|
+
);
|
|
1523
1578
|
}
|
|
1524
1579
|
|
|
1525
1580
|
// src/components/ui/Input.tsx
|
|
@@ -2675,9 +2730,10 @@ function SegmentedControl({ options, value, onChange, className }) {
|
|
|
2675
2730
|
"button",
|
|
2676
2731
|
{
|
|
2677
2732
|
type: "button",
|
|
2733
|
+
"aria-pressed": value === option.value,
|
|
2678
2734
|
onClick: () => onChange(option.value),
|
|
2679
2735
|
className: cn(
|
|
2680
|
-
"relative flex items-center gap-1.5 rounded-md px-3.5 py-1.5 text-sm font-medium transition-all",
|
|
2736
|
+
"relative flex min-h-11 items-center gap-1.5 rounded-md px-3.5 py-1.5 text-sm font-medium transition-all sm:min-h-9",
|
|
2681
2737
|
value === option.value ? "bg-ph-surface text-ph-ink shadow-ph" : "text-ph-subtle hover:text-ph-ink"
|
|
2682
2738
|
),
|
|
2683
2739
|
children: [
|
|
@@ -2699,32 +2755,44 @@ function CommandPalette({
|
|
|
2699
2755
|
isOpen,
|
|
2700
2756
|
onClose,
|
|
2701
2757
|
placeholder = "Type a command or search...",
|
|
2702
|
-
className
|
|
2758
|
+
className,
|
|
2759
|
+
id,
|
|
2760
|
+
dataTest,
|
|
2761
|
+
inputId,
|
|
2762
|
+
inputDataTest
|
|
2703
2763
|
}) {
|
|
2704
2764
|
const [query, setQuery] = (0, import_react17.useState)("");
|
|
2705
2765
|
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
2706
2766
|
const inputRef = (0, import_react17.useRef)(null);
|
|
2767
|
+
const panelRef = (0, import_react17.useRef)(null);
|
|
2768
|
+
const previousFocusRef = (0, import_react17.useRef)(null);
|
|
2707
2769
|
const filtered = items.filter(
|
|
2708
2770
|
(item) => item.label.toLowerCase().includes(query.toLowerCase())
|
|
2709
2771
|
);
|
|
2710
2772
|
(0, import_react17.useEffect)(() => {
|
|
2711
2773
|
var _a;
|
|
2712
|
-
if (isOpen)
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2774
|
+
if (!isOpen) return;
|
|
2775
|
+
previousFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2776
|
+
setQuery("");
|
|
2777
|
+
setSelectedIndex(0);
|
|
2778
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2779
|
+
return () => {
|
|
2780
|
+
var _a2;
|
|
2781
|
+
return (_a2 = previousFocusRef.current) == null ? void 0 : _a2.focus();
|
|
2782
|
+
};
|
|
2717
2783
|
}, [isOpen]);
|
|
2718
2784
|
(0, import_react17.useEffect)(() => {
|
|
2719
2785
|
const handleKeyDown = (e) => {
|
|
2720
|
-
var _a;
|
|
2786
|
+
var _a, _b;
|
|
2721
2787
|
if (!isOpen) return;
|
|
2722
2788
|
switch (e.key) {
|
|
2723
2789
|
case "ArrowDown":
|
|
2790
|
+
if (!filtered.length) break;
|
|
2724
2791
|
e.preventDefault();
|
|
2725
2792
|
setSelectedIndex((i) => (i + 1) % filtered.length);
|
|
2726
2793
|
break;
|
|
2727
2794
|
case "ArrowUp":
|
|
2795
|
+
if (!filtered.length) break;
|
|
2728
2796
|
e.preventDefault();
|
|
2729
2797
|
setSelectedIndex((i) => (i - 1 + filtered.length) % filtered.length);
|
|
2730
2798
|
break;
|
|
@@ -2736,62 +2804,98 @@ function CommandPalette({
|
|
|
2736
2804
|
case "Escape":
|
|
2737
2805
|
onClose();
|
|
2738
2806
|
break;
|
|
2807
|
+
case "Tab": {
|
|
2808
|
+
const focusable = (_b = panelRef.current) == null ? void 0 : _b.querySelectorAll(
|
|
2809
|
+
'input, button, [href], [tabindex]:not([tabindex="-1"])'
|
|
2810
|
+
);
|
|
2811
|
+
if (!(focusable == null ? void 0 : focusable.length)) break;
|
|
2812
|
+
const first = focusable[0];
|
|
2813
|
+
const last = focusable[focusable.length - 1];
|
|
2814
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
2815
|
+
e.preventDefault();
|
|
2816
|
+
last.focus();
|
|
2817
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
2818
|
+
e.preventDefault();
|
|
2819
|
+
first.focus();
|
|
2820
|
+
}
|
|
2821
|
+
break;
|
|
2822
|
+
}
|
|
2739
2823
|
}
|
|
2740
2824
|
};
|
|
2741
2825
|
window.addEventListener("keydown", handleKeyDown);
|
|
2742
2826
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2743
2827
|
}, [isOpen, filtered, selectedIndex, onClose]);
|
|
2744
2828
|
if (!isOpen) return null;
|
|
2745
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2746
2830
|
"div",
|
|
2747
2831
|
{
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
)
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
},
|
|
2765
|
-
placeholder,
|
|
2766
|
-
className: "flex-1 bg-transparent text-ph-ink outline-none placeholder:text-ph-mutedtext"
|
|
2767
|
-
}
|
|
2832
|
+
id,
|
|
2833
|
+
"data-test": dataTest,
|
|
2834
|
+
className: "fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-[20vh] backdrop-blur-sm",
|
|
2835
|
+
onMouseDown: (event) => {
|
|
2836
|
+
if (event.target === event.currentTarget) onClose();
|
|
2837
|
+
},
|
|
2838
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2839
|
+
"div",
|
|
2840
|
+
{
|
|
2841
|
+
ref: panelRef,
|
|
2842
|
+
role: "dialog",
|
|
2843
|
+
"aria-modal": "true",
|
|
2844
|
+
"aria-label": "Command palette",
|
|
2845
|
+
className: cn(
|
|
2846
|
+
"w-full max-w-xl overflow-hidden rounded-xl border border-ph-border bg-ph-surface shadow-ph-md",
|
|
2847
|
+
className
|
|
2768
2848
|
),
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2849
|
+
children: [
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-3 border-b border-ph-border px-4 py-3", children: [
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconSearch, { className: "h-5 w-5 text-ph-mutedtext" }),
|
|
2852
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2853
|
+
"input",
|
|
2854
|
+
{
|
|
2855
|
+
ref: inputRef,
|
|
2856
|
+
id: inputId,
|
|
2857
|
+
"data-test": inputDataTest,
|
|
2858
|
+
type: "text",
|
|
2859
|
+
"aria-label": "Search commands",
|
|
2860
|
+
value: query,
|
|
2861
|
+
onChange: (e) => {
|
|
2862
|
+
setQuery(e.target.value);
|
|
2863
|
+
setSelectedIndex(0);
|
|
2864
|
+
},
|
|
2865
|
+
placeholder,
|
|
2866
|
+
className: "flex-1 bg-transparent text-ph-ink outline-none placeholder:text-ph-mutedtext"
|
|
2867
|
+
}
|
|
2868
|
+
),
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("kbd", { className: "rounded border border-ph-border bg-ph-muted px-1.5 py-0.5 text-xs text-ph-mutedtext", children: "ESC" })
|
|
2870
|
+
] }),
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "max-h-[50vh] overflow-y-auto py-2", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "px-4 py-8 text-center text-sm text-ph-mutedtext", children: "No results found." }) : filtered.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2872
|
+
"button",
|
|
2873
|
+
{
|
|
2874
|
+
type: "button",
|
|
2875
|
+
id: `command-${item.id}`,
|
|
2876
|
+
"data-test": `command-${item.id}`,
|
|
2877
|
+
onClick: () => {
|
|
2878
|
+
item.onSelect();
|
|
2879
|
+
onClose();
|
|
2880
|
+
},
|
|
2881
|
+
onMouseEnter: () => setSelectedIndex(index),
|
|
2882
|
+
className: cn(
|
|
2883
|
+
"flex w-full items-center gap-3 px-4 py-2.5 text-left text-sm transition-colors",
|
|
2884
|
+
index === selectedIndex ? "bg-ph-muted text-ph-ink" : "text-ph-subtle"
|
|
2885
|
+
),
|
|
2886
|
+
children: [
|
|
2887
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "h-5 w-5", children: item.icon }),
|
|
2888
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex-1", children: item.label }),
|
|
2889
|
+
item.shortcut && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("kbd", { className: "rounded border border-ph-border bg-ph-surface px-1.5 py-0.5 text-xs text-ph-mutedtext", children: item.shortcut })
|
|
2890
|
+
]
|
|
2891
|
+
},
|
|
2892
|
+
item.id
|
|
2893
|
+
)) })
|
|
2894
|
+
]
|
|
2895
|
+
}
|
|
2896
|
+
)
|
|
2793
2897
|
}
|
|
2794
|
-
)
|
|
2898
|
+
);
|
|
2795
2899
|
}
|
|
2796
2900
|
|
|
2797
2901
|
// src/components/ui/Calendar.tsx
|
|
@@ -5230,34 +5334,45 @@ var Chip = (0, import_react42.forwardRef)(function Chip2(_a, ref) {
|
|
|
5230
5334
|
"children",
|
|
5231
5335
|
"className"
|
|
5232
5336
|
]);
|
|
5233
|
-
|
|
5337
|
+
const chipClassName = cn(
|
|
5338
|
+
"ph-chip",
|
|
5339
|
+
selected && "ph-chip--selected",
|
|
5340
|
+
className
|
|
5341
|
+
);
|
|
5342
|
+
if (onRemove) {
|
|
5343
|
+
const removeLabel = typeof children === "string" ? `Remove ${children}` : "Remove";
|
|
5344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { className: chipClassName, children: [
|
|
5345
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5346
|
+
"button",
|
|
5347
|
+
__spreadProps(__spreadValues({
|
|
5348
|
+
ref,
|
|
5349
|
+
type: "button",
|
|
5350
|
+
className: "min-w-0 bg-transparent p-0 text-inherit"
|
|
5351
|
+
}, props), {
|
|
5352
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ph-chip__text", children })
|
|
5353
|
+
})
|
|
5354
|
+
),
|
|
5355
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5356
|
+
"button",
|
|
5357
|
+
{
|
|
5358
|
+
type: "button",
|
|
5359
|
+
onClick: onRemove,
|
|
5360
|
+
disabled: props.disabled,
|
|
5361
|
+
className: "ph-chip__remove",
|
|
5362
|
+
"aria-label": removeLabel,
|
|
5363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.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_runtime78.jsx)("path", { d: "M2 2l6 6M8 2l-6 6" }) })
|
|
5364
|
+
}
|
|
5365
|
+
)
|
|
5366
|
+
] });
|
|
5367
|
+
}
|
|
5368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5234
5369
|
"button",
|
|
5235
5370
|
__spreadProps(__spreadValues({
|
|
5236
5371
|
ref,
|
|
5237
5372
|
type: "button",
|
|
5238
|
-
className:
|
|
5239
|
-
"ph-chip",
|
|
5240
|
-
selected && "ph-chip--selected",
|
|
5241
|
-
className
|
|
5242
|
-
)
|
|
5373
|
+
className: chipClassName
|
|
5243
5374
|
}, props), {
|
|
5244
|
-
children:
|
|
5245
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ph-chip__text", children }),
|
|
5246
|
-
onRemove && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5247
|
-
"span",
|
|
5248
|
-
{
|
|
5249
|
-
role: "button",
|
|
5250
|
-
tabIndex: -1,
|
|
5251
|
-
onClick: (e) => {
|
|
5252
|
-
e.stopPropagation();
|
|
5253
|
-
onRemove();
|
|
5254
|
-
},
|
|
5255
|
-
className: "ph-chip__remove",
|
|
5256
|
-
"aria-label": "Remove",
|
|
5257
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("path", { d: "M2 2l6 6M8 2l-6 6" }) })
|
|
5258
|
-
}
|
|
5259
|
-
)
|
|
5260
|
-
]
|
|
5375
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ph-chip__text", children })
|
|
5261
5376
|
})
|
|
5262
5377
|
);
|
|
5263
5378
|
});
|
package/dist/ui.mjs
CHANGED
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
ToggleButton,
|
|
109
109
|
ToggleGroup,
|
|
110
110
|
Widget
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-SBBKXV35.mjs";
|
|
112
112
|
import {
|
|
113
113
|
ButtonChrome,
|
|
114
114
|
DropdownButton,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
IconByName,
|
|
121
121
|
Tooltip,
|
|
122
122
|
TooltipProvider
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-E5ZBQYEX.mjs";
|
|
124
124
|
import "./chunk-FWCSY2DS.mjs";
|
|
125
125
|
export {
|
|
126
126
|
Accordion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenide-io/the-old-ui-theme",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Props-driven React components and theme tokens inspired by classic interface design \u2014 optimized for Next.js apps and internal tools.",
|
|
5
5
|
"author": "Xenide",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
59
|
"dist",
|
|
60
|
+
"scripts",
|
|
60
61
|
"src/app/globals.css",
|
|
61
62
|
"src/components/ui",
|
|
62
|
-
"src/components/charts",
|
|
63
63
|
"src/components/icons",
|
|
64
64
|
"src/suite",
|
|
65
65
|
"src/styles/themes.css",
|
|
@@ -87,14 +87,10 @@
|
|
|
87
87
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
88
88
|
"next": ">=16.2.7",
|
|
89
89
|
"tailwindcss": "^3.4.0",
|
|
90
|
-
"d3-scale": "^4.0.2",
|
|
91
90
|
"iconoir-react": ">=7.11.1",
|
|
92
91
|
"motion": ">=12"
|
|
93
92
|
},
|
|
94
93
|
"peerDependenciesMeta": {
|
|
95
|
-
"d3-scale": {
|
|
96
|
-
"optional": true
|
|
97
|
-
},
|
|
98
94
|
"iconoir-react": {
|
|
99
95
|
"optional": true
|
|
100
96
|
},
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Dev-only: copy this package tree into an app's node_modules so Next.js
|
|
3
|
+
# Turbopack resolves CSS/exports from real files (not a broken file: link).
|
|
4
|
+
#
|
|
5
|
+
# Host must have built dist first: `bun run build:lib` in this repo.
|
|
6
|
+
# Safe to skip when THEME_DIR is missing (production images).
|
|
7
|
+
#
|
|
8
|
+
# Usage (from an app directory, Docker or local):
|
|
9
|
+
# THEME_DIR=/the-old-ui TARGET=/app/node_modules/@xenide-io/the-old-ui-theme \
|
|
10
|
+
# sh /the-old-ui/scripts/install-theme-dev.sh
|
|
11
|
+
# Or via each app's thin wrapper under scripts/install-theme-dev.sh.
|
|
12
|
+
|
|
13
|
+
set -e
|
|
14
|
+
|
|
15
|
+
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
|
16
|
+
THEME_DIR=${THEME_DIR:-$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)}
|
|
17
|
+
|
|
18
|
+
if [ -z "${TARGET:-}" ]; then
|
|
19
|
+
if [ -d /app/node_modules ]; then
|
|
20
|
+
TARGET=/app/node_modules/@xenide-io/the-old-ui-theme
|
|
21
|
+
elif [ -d ./node_modules ]; then
|
|
22
|
+
TARGET=$(pwd)/node_modules/@xenide-io/the-old-ui-theme
|
|
23
|
+
else
|
|
24
|
+
echo "install-theme-dev: set TARGET=.../node_modules/@xenide-io/the-old-ui-theme" >&2
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if [ ! -d "$THEME_DIR" ]; then
|
|
30
|
+
echo "install-theme-dev: $THEME_DIR not found, skipping"
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ ! -d "$THEME_DIR/dist" ]; then
|
|
35
|
+
echo "install-theme-dev: $THEME_DIR/dist is missing."
|
|
36
|
+
echo "Run: cd \"$THEME_DIR\" && bun run build:lib"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
echo "install-theme-dev: copying $THEME_DIR -> $TARGET"
|
|
41
|
+
|
|
42
|
+
rm -rf "$TARGET"
|
|
43
|
+
mkdir -p "$TARGET"
|
|
44
|
+
|
|
45
|
+
# tar preserves structure and is faster than cp for many small files.
|
|
46
|
+
tar -C "$THEME_DIR" -cf - \
|
|
47
|
+
--exclude='.git' \
|
|
48
|
+
--exclude='.next' \
|
|
49
|
+
--exclude='node_modules' \
|
|
50
|
+
--exclude='test-results' \
|
|
51
|
+
--exclude='playwright-report' \
|
|
52
|
+
--exclude='coverage' \
|
|
53
|
+
--exclude='out' \
|
|
54
|
+
--exclude='*.log' \
|
|
55
|
+
--exclude='.DS_Store' \
|
|
56
|
+
--exclude='.turbo' \
|
|
57
|
+
--exclude='*.tsbuildinfo' \
|
|
58
|
+
. | tar -C "$TARGET" -xf -
|
|
59
|
+
|
|
60
|
+
echo "install-theme-dev: done"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Compare local Lemon glyphs with PostHog open-source icons.tsx.
|
|
4
|
+
* Usage: node scripts/sync-posthog-icons.mjs
|
|
5
|
+
*
|
|
6
|
+
* Downloads: frontend/src/lib/lemon-ui/icons/icons.tsx
|
|
7
|
+
* Reports path mismatches — Material-only icons (bell, volume, …) are expected.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { resolve } from "node:path";
|
|
12
|
+
|
|
13
|
+
const POSTHOG_URL =
|
|
14
|
+
"https://raw.githubusercontent.com/PostHog/posthog/master/frontend/src/lib/lemon-ui/icons/icons.tsx";
|
|
15
|
+
const LOCAL = resolve("src/components/icons/icons.tsx");
|
|
16
|
+
const CACHE = resolve("scripts/.posthog-icons.tsx");
|
|
17
|
+
|
|
18
|
+
function extractPhBlock(source, name) {
|
|
19
|
+
const start = source.indexOf(`export function ${name}(`);
|
|
20
|
+
if (start < 0) return null;
|
|
21
|
+
const next = source.indexOf("\nexport function Icon", start + 10);
|
|
22
|
+
return source.slice(start, next > 0 ? next : start + 4000);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function extractOurBlock(source, name) {
|
|
26
|
+
const start = source.indexOf(`export const ${name} =`);
|
|
27
|
+
if (start < 0) return null;
|
|
28
|
+
const next = source.indexOf("\nexport const Icon", start + 10);
|
|
29
|
+
const nextFn = source.indexOf("\nexport function Icon", start + 10);
|
|
30
|
+
const end = [next, nextFn].filter((x) => x > 0).sort((a, b) => a - b)[0] || start + 4000;
|
|
31
|
+
return source.slice(start, end);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function normPaths(block) {
|
|
35
|
+
if (!block) return "";
|
|
36
|
+
const fills = [...block.matchAll(/fill\(\s*\n?\s*"([^"]+)"/g)].map((m) => m[1]);
|
|
37
|
+
const ds = [...block.matchAll(/<path d="([^"]+)"/g)].map((m) => m[1]);
|
|
38
|
+
const attrs = [...block.matchAll(/\sd="([^"]+)"/g)].map((m) => m[1]);
|
|
39
|
+
return [...fills, ...ds, ...attrs].join("|").replace(/\s/g, "");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function main() {
|
|
43
|
+
const response = await fetch(POSTHOG_URL);
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
throw new Error(`Failed to fetch PostHog icons: ${response.status}`);
|
|
46
|
+
}
|
|
47
|
+
const ph = await response.text();
|
|
48
|
+
writeFileSync(CACHE, ph);
|
|
49
|
+
|
|
50
|
+
const local = readFileSync(LOCAL, "utf8");
|
|
51
|
+
const phNames = new Set([...ph.matchAll(/export function (Icon\w+)/g)].map((m) => m[1]));
|
|
52
|
+
const ourNames = [...local.matchAll(/export const (Icon\w+)/g)]
|
|
53
|
+
.map((m) => m[1])
|
|
54
|
+
.filter((n) => n !== "IconSpinner");
|
|
55
|
+
|
|
56
|
+
const shared = ourNames.filter((n) => phNames.has(n));
|
|
57
|
+
const materialOnly = ourNames.filter((n) => !phNames.has(n));
|
|
58
|
+
const mismatches = shared.filter(
|
|
59
|
+
(n) => normPaths(extractPhBlock(ph, n)) !== normPaths(extractOurBlock(local, n)),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
console.log(`Compared ${shared.length} shared icons with PostHog master.`);
|
|
63
|
+
if (mismatches.length) {
|
|
64
|
+
console.log("\nPath mismatches (update src/components/icons/icons.tsx):");
|
|
65
|
+
mismatches.forEach((n) => console.log(` - ${n}`));
|
|
66
|
+
} else {
|
|
67
|
+
console.log("All shared PostHog icons match.");
|
|
68
|
+
}
|
|
69
|
+
console.log(`\nMaterial-only icons (${materialOnly.length}): ${materialOnly.join(", ")}`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
main().catch((error) => {
|
|
73
|
+
console.error(error.message);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
});
|
|
@@ -14,31 +14,49 @@ export const Chip = forwardRef<HTMLButtonElement, ChipProps>(function Chip({
|
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
16
|
}, ref) {
|
|
17
|
+
const chipClassName = cn(
|
|
18
|
+
"ph-chip",
|
|
19
|
+
selected && "ph-chip--selected",
|
|
20
|
+
className
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
if (onRemove) {
|
|
24
|
+
const removeLabel =
|
|
25
|
+
typeof children === "string" ? `Remove ${children}` : "Remove";
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<span className={chipClassName}>
|
|
29
|
+
<button
|
|
30
|
+
ref={ref}
|
|
31
|
+
type="button"
|
|
32
|
+
className="min-w-0 bg-transparent p-0 text-inherit"
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
<span className="ph-chip__text">{children}</span>
|
|
36
|
+
</button>
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
onClick={onRemove}
|
|
40
|
+
disabled={props.disabled}
|
|
41
|
+
className="ph-chip__remove"
|
|
42
|
+
aria-label={removeLabel}
|
|
43
|
+
>
|
|
44
|
+
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true">
|
|
45
|
+
<path d="M2 2l6 6M8 2l-6 6" />
|
|
46
|
+
</svg>
|
|
47
|
+
</button>
|
|
48
|
+
</span>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
17
52
|
return (
|
|
18
53
|
<button
|
|
19
54
|
ref={ref}
|
|
20
55
|
type="button"
|
|
21
|
-
className={
|
|
22
|
-
"ph-chip",
|
|
23
|
-
selected && "ph-chip--selected",
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
56
|
+
className={chipClassName}
|
|
26
57
|
{...props}
|
|
27
58
|
>
|
|
28
59
|
<span className="ph-chip__text">{children}</span>
|
|
29
|
-
{onRemove && (
|
|
30
|
-
<span
|
|
31
|
-
role="button"
|
|
32
|
-
tabIndex={-1}
|
|
33
|
-
onClick={(e) => { e.stopPropagation(); onRemove(); }}
|
|
34
|
-
className="ph-chip__remove"
|
|
35
|
-
aria-label="Remove"
|
|
36
|
-
>
|
|
37
|
-
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
|
38
|
-
<path d="M2 2l6 6M8 2l-6 6" />
|
|
39
|
-
</svg>
|
|
40
|
-
</span>
|
|
41
|
-
)}
|
|
42
60
|
</button>
|
|
43
61
|
);
|
|
44
62
|
});
|