@benchlabs/ui 0.0.0-stage → 1.1.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/LICENSE +48 -0
- package/README.md +42 -2
- package/dist/bench/filter.d.ts +15 -0
- package/dist/bench/filter.js +161 -0
- package/dist/bench/page-tabs.d.ts +4 -0
- package/dist/bench/page-tabs.js +18 -0
- package/dist/bench/plot-figure.d.ts +19 -0
- package/dist/bench/plot-figure.js +78 -0
- package/dist/bench/toolbar.d.ts +9 -0
- package/dist/bench/toolbar.js +16 -0
- package/dist/components/alert-dialog.d.ts +18 -0
- package/dist/components/alert-dialog.js +41 -0
- package/dist/components/alert.d.ts +9 -0
- package/dist/components/alert.js +24 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +22 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +28 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.js +27 -0
- package/dist/components/button-group.d.ts +11 -0
- package/dist/components/button-group.js +27 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +35 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/calendar.js +76 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.js +24 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +12 -0
- package/dist/components/command.d.ts +18 -0
- package/dist/components/command.js +34 -0
- package/dist/components/dialog.d.ts +17 -0
- package/dist/components/dialog.js +41 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.js +50 -0
- package/dist/components/empty.d.ts +11 -0
- package/dist/components/empty.js +33 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.js +14 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +6 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +7 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.js +26 -0
- package/dist/components/resizable.d.ts +7 -0
- package/dist/components/resizable.js +15 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +13 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +38 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/sheet.d.ts +15 -0
- package/dist/components/sheet.js +48 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.js +14 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.js +7 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +27 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +29 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +6 -0
- package/dist/components/toggle-group.d.ts +9 -0
- package/dist/components/toggle-group.js +22 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.js +26 -0
- package/dist/components/tooltip.d.ts +8 -0
- package/dist/components/tooltip.js +17 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +40 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +9 -0
- package/package.json +69 -4
- package/src/theme.css +143 -0
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benchlabs/ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Bench's look for apps: components, the theme, and four pieces that read bench.json (PageTabs, Toolbar, Filter, PlotFigure).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/benchlabs-inc/bench-api.git",
|
|
9
|
+
"directory": "app-platform/ui"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"*.css"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./theme.css": "./src/theme.css",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"src/theme.css",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc -p tsconfig.build.json",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"test": "vitest run"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@benchlabs/sdk": "1.1.0",
|
|
39
|
+
"@fontsource-variable/inter": "5.3.0",
|
|
40
|
+
"@observablehq/plot": "0.6.19",
|
|
41
|
+
"cmdk": "1.1.1",
|
|
42
|
+
"date-fns": "4.4.0",
|
|
43
|
+
"lucide-react": "1.73.0",
|
|
44
|
+
"react": "^19.0.0",
|
|
45
|
+
"react-day-picker": "10.0.2",
|
|
46
|
+
"react-dom": "^19.0.0",
|
|
47
|
+
"react-resizable-panels": "4.24.0"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"class-variance-authority": "0.7.1",
|
|
51
|
+
"clsx": "2.1.1",
|
|
52
|
+
"radix-ui": "1.6.7",
|
|
53
|
+
"tailwind-merge": "3.7.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@benchlabs/sdk": "file:../sdk",
|
|
57
|
+
"@fontsource-variable/inter": "5.3.0",
|
|
58
|
+
"@observablehq/plot": "0.6.19",
|
|
59
|
+
"@types/react": "19.3.0",
|
|
60
|
+
"@types/react-dom": "19.3.0",
|
|
61
|
+
"cmdk": "1.1.1",
|
|
62
|
+
"date-fns": "4.4.0",
|
|
63
|
+
"lucide-react": "1.73.0",
|
|
64
|
+
"react": "19.3.1",
|
|
65
|
+
"react-day-picker": "10.0.2",
|
|
66
|
+
"react-dom": "19.3.1",
|
|
67
|
+
"react-resizable-panels": "4.24.0",
|
|
68
|
+
"typescript": "6.0.3",
|
|
69
|
+
"vitest": "4.1.9"
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/theme.css
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* @benchlabs/ui's theme. Bench compiles Tailwind once per app build over this file only, with the classes found in the
|
|
2
|
+
app's source and the kit; an app's own CSS never goes through Tailwind. */
|
|
3
|
+
@import "tailwindcss";
|
|
4
|
+
@import "tw-animate-css";
|
|
5
|
+
|
|
6
|
+
/* For a Tailwind build outside Bench, over the published package; Bench's build scans the kit's source itself. */
|
|
7
|
+
@source "../dist/**/*.js";
|
|
8
|
+
|
|
9
|
+
/* ⚠ Keyed on the attribute the build and the host set from bench.json's "theme"; Tailwind's default follows the OS. */
|
|
10
|
+
@custom-variant dark (&:is([data-theme=dark] *));
|
|
11
|
+
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'Inter';
|
|
14
|
+
font-style: normal;
|
|
15
|
+
font-weight: 100 900;
|
|
16
|
+
font-display: block;
|
|
17
|
+
src: url('@fontsource-variable/inter/files/inter-latin-wght-normal.woff2') format('woff2-variations');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@theme {
|
|
21
|
+
--font-sans: 'Inter', system-ui, sans-serif;
|
|
22
|
+
--font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
|
|
23
|
+
|
|
24
|
+
--color-border: hsl(var(--border));
|
|
25
|
+
--color-input: hsl(var(--input));
|
|
26
|
+
--color-ring: hsl(var(--ring));
|
|
27
|
+
--color-background: hsl(var(--background));
|
|
28
|
+
--color-foreground: hsl(var(--foreground));
|
|
29
|
+
--color-primary: hsl(var(--primary));
|
|
30
|
+
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
31
|
+
--color-secondary: hsl(var(--secondary));
|
|
32
|
+
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
33
|
+
--color-destructive: hsl(var(--destructive));
|
|
34
|
+
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
35
|
+
--color-muted: hsl(var(--muted));
|
|
36
|
+
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
37
|
+
--color-accent: hsl(var(--accent));
|
|
38
|
+
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
39
|
+
--color-popover: hsl(var(--popover));
|
|
40
|
+
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
41
|
+
--color-card: hsl(var(--card));
|
|
42
|
+
--color-card-foreground: hsl(var(--card-foreground));
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ⚠ `static`: Tailwind drops theme variables no class uses, and Plot and app CSS read these by name. */
|
|
47
|
+
@theme static {
|
|
48
|
+
--color-chart-1: #2a78d6;
|
|
49
|
+
--color-chart-2: #eb6834;
|
|
50
|
+
--color-chart-3: #1baf7a;
|
|
51
|
+
--color-chart-4: #eda100;
|
|
52
|
+
--color-chart-5: #e87ba4;
|
|
53
|
+
--color-chart-6: #008300;
|
|
54
|
+
--color-chart-7: #6250d6;
|
|
55
|
+
--color-chart-8: #e34948;
|
|
56
|
+
--color-chart-other: hsl(40 6% 84%);
|
|
57
|
+
--color-good: hsl(var(--good));
|
|
58
|
+
--color-bad: hsl(var(--bad));
|
|
59
|
+
--color-warning: hsl(var(--warning));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@theme {
|
|
63
|
+
|
|
64
|
+
/* Seven sizes: an app needs no others. `cn()` knows them (lib/utils.ts). */
|
|
65
|
+
--text-title: 19px;
|
|
66
|
+
--text-title--line-height: 1.3;
|
|
67
|
+
--text-heading: 15px;
|
|
68
|
+
--text-heading--line-height: 1.4;
|
|
69
|
+
--text-body: 13px;
|
|
70
|
+
--text-body--line-height: 1.5;
|
|
71
|
+
--text-small: 12px;
|
|
72
|
+
--text-small--line-height: 1.45;
|
|
73
|
+
--text-caption: 11px;
|
|
74
|
+
--text-caption--line-height: 1.4;
|
|
75
|
+
--text-hero: 40px;
|
|
76
|
+
--text-hero--line-height: 1;
|
|
77
|
+
--text-figure: 26px;
|
|
78
|
+
--text-figure--line-height: 1.1;
|
|
79
|
+
|
|
80
|
+
--radius-lg: var(--radius);
|
|
81
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
82
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@layer base {
|
|
86
|
+
:root {
|
|
87
|
+
--background: 0 0% 100%;
|
|
88
|
+
--foreground: 30 10% 10%;
|
|
89
|
+
--card: 0 0% 100%;
|
|
90
|
+
--card-foreground: 30 10% 10%;
|
|
91
|
+
--popover: 40 20% 99%;
|
|
92
|
+
--popover-foreground: 30 10% 10%;
|
|
93
|
+
--primary: 30 8% 12%;
|
|
94
|
+
--primary-foreground: 40 20% 98%;
|
|
95
|
+
--secondary: 152 45% 28%;
|
|
96
|
+
--secondary-foreground: 0 0% 100%;
|
|
97
|
+
--muted: 40 12% 96%;
|
|
98
|
+
--muted-foreground: 30 5% 45%;
|
|
99
|
+
--accent: 145 30% 94%;
|
|
100
|
+
--accent-foreground: 152 40% 22%;
|
|
101
|
+
--warning: 32 80% 40%;
|
|
102
|
+
--destructive: 0 72% 50%;
|
|
103
|
+
--destructive-foreground: 0 0% 100%;
|
|
104
|
+
--good: 152 45% 30%;
|
|
105
|
+
--bad: 0 68% 47%;
|
|
106
|
+
--border: 40 9% 91%;
|
|
107
|
+
--input: 40 10% 90%;
|
|
108
|
+
--ring: 30 8% 12%;
|
|
109
|
+
--radius: 0.5rem;
|
|
110
|
+
}
|
|
111
|
+
/* Dark: declared in bench.json for a map, replay or simulation; on <html>, so portalled popovers and sheets follow. */
|
|
112
|
+
[data-theme=dark] {
|
|
113
|
+
--background: 40 12% 7%;
|
|
114
|
+
--foreground: 40 15% 95%;
|
|
115
|
+
--card: 40 10% 10%;
|
|
116
|
+
--card-foreground: 40 15% 95%;
|
|
117
|
+
--popover: 40 10% 11%;
|
|
118
|
+
--popover-foreground: 40 15% 95%;
|
|
119
|
+
--primary: 40 15% 90%;
|
|
120
|
+
--primary-foreground: 40 15% 7%;
|
|
121
|
+
--secondary: 152 45% 35%;
|
|
122
|
+
--secondary-foreground: 40 15% 95%;
|
|
123
|
+
--muted: 40 8% 15%;
|
|
124
|
+
--muted-foreground: 40 5% 60%;
|
|
125
|
+
--accent: 40 8% 17%;
|
|
126
|
+
--accent-foreground: 40 15% 95%;
|
|
127
|
+
--warning: 38 85% 55%;
|
|
128
|
+
--destructive: 0 63% 52%;
|
|
129
|
+
--good: 140 55% 50%;
|
|
130
|
+
--bad: 0 75% 65%;
|
|
131
|
+
--border: 40 8% 19%;
|
|
132
|
+
--input: 40 8% 19%;
|
|
133
|
+
--ring: 40 15% 85%;
|
|
134
|
+
--color-chart-1: #3987e5; --color-chart-2: #d95926; --color-chart-3: #199e70; --color-chart-4: #c98500;
|
|
135
|
+
--color-chart-5: #d55181; --color-chart-6: #0ca30c; --color-chart-7: #9085e9; --color-chart-8: #e66767;
|
|
136
|
+
--color-chart-other: hsl(40 5% 32%);
|
|
137
|
+
color-scheme: dark;
|
|
138
|
+
}
|
|
139
|
+
* { @apply border-border; }
|
|
140
|
+
html, body, #root { height: 100%; }
|
|
141
|
+
body { @apply bg-background text-foreground font-sans text-body antialiased; }
|
|
142
|
+
button:not(:disabled), [role='button']:not([aria-disabled='true']) { cursor: pointer; }
|
|
143
|
+
}
|