@valiify/dashboard-ui 0.1.1 → 0.2.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/CHANGELOG.md +411 -4
- package/CLAUDE.md +809 -768
- package/COMPONENTS.md +520 -520
- package/GETTING_STARTED.md +14 -14
- package/QUICK_REFERENCE.md +22 -22
- package/README.md +28 -6
- package/TROUBLESHOOTING.md +6 -6
- package/class-manifest.json +664 -0
- package/design-methodology/dashboard.md +496 -0
- package/dist/dashboard-ui.css +4897 -0
- package/dist/index.css +502 -502
- package/examples/basic/index.html +8 -8
- package/examples/daisyui-starter/README.md +35 -0
- package/examples/daisyui-starter/check-no-bleed.mjs +81 -0
- package/examples/daisyui-starter/index.html +45 -0
- package/examples/daisyui-starter/package-lock.json +2221 -0
- package/examples/daisyui-starter/package.json +22 -0
- package/examples/daisyui-starter/postcss.config.js +1 -0
- package/examples/daisyui-starter/src/styles.css +20 -0
- package/examples/daisyui-starter/tailwind.config.js +12 -0
- package/examples/postcss-starter/index.html +8 -8
- package/examples/postcss-starter/package.json +1 -1
- package/examples/vite-starter/README.md +4 -4
- package/examples/vite-starter/package.json +1 -1
- package/examples/vite-starter/src/main.js +41 -41
- package/package.json +23 -4
- package/src/build/components.css +29 -0
- package/src/build/utilities.css +42 -0
- package/src/components/ICON-SYSTEM.md +39 -39
- package/src/components/alert.css +26 -26
- package/src/components/avatar.css +9 -9
- package/src/components/breadcrumbs.css +15 -15
- package/src/components/button.css +21 -21
- package/src/components/card.css +10 -10
- package/src/components/checkbox.css +21 -21
- package/src/components/chip.css +43 -43
- package/src/components/data-row.css +19 -19
- package/src/components/divider.css +23 -23
- package/src/components/dropdown-field.css +34 -34
- package/src/components/dropdown-menu.css +12 -12
- package/src/components/field-verification.css +25 -25
- package/src/components/filter-segment.css +20 -20
- package/src/components/icon-button.css +11 -11
- package/src/components/icon.css +18 -18
- package/src/components/input.css +29 -29
- package/src/components/link.css +28 -28
- package/src/components/loading-indicator.css +20 -20
- package/src/components/loading-inline.css +8 -8
- package/src/components/menu-item.css +28 -28
- package/src/components/modal.css +36 -36
- package/src/components/navigation-rail.css +95 -95
- package/src/components/pagination-item.css +22 -22
- package/src/components/pagination.css +24 -24
- package/src/components/pill.css +14 -14
- package/src/components/progress-bar.css +28 -28
- package/src/components/radio-select.css +13 -13
- package/src/components/section-marker.css +12 -12
- package/src/components/segment-selector.css +9 -9
- package/src/components/sensitive-data.css +8 -8
- package/src/components/skeleton.css +29 -29
- package/src/components/step.css +14 -14
- package/src/components/stepper.css +15 -15
- package/src/components/switch.css +12 -12
- package/src/components/tabs.css +40 -40
- package/src/components/tag.css +20 -20
- package/src/components/text-button.css +24 -24
- package/src/components/textarea.css +23 -23
- package/src/components/toast.css +29 -29
- package/src/components/tooltip.css +11 -11
- package/src/icons/README.md +16 -10
- package/src/icons/sprite.svg +1 -1
- package/src/themes/valiify-tokens.css +285 -0
- package/src/themes/valiify-type-prefixed.css +37 -0
- package/src/utilities/index.css +1 -1
- package/src/utility-surface.css +321 -0
- package/types/components.d.ts +235 -236
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
</head>
|
|
38
38
|
<body>
|
|
39
39
|
<!-- Example: Sign-in Form Card -->
|
|
40
|
-
<div class="card" style="max-width: 400px; width: 100%">
|
|
41
|
-
<h1 class="card-title" style="font-size: 24px; margin-bottom: 8px">
|
|
40
|
+
<div class="vd-card" style="max-width: 400px; width: 100%">
|
|
41
|
+
<h1 class="vd-card-title" style="font-size: 24px; margin-bottom: 8px">
|
|
42
42
|
Welcome Back
|
|
43
43
|
</h1>
|
|
44
|
-
<p class="card-body" style="margin-bottom: 24px">
|
|
44
|
+
<p class="vd-card-body" style="margin-bottom: 24px">
|
|
45
45
|
Sign in to your Valiify Dashboard account.
|
|
46
46
|
</p>
|
|
47
47
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</label>
|
|
62
62
|
<input
|
|
63
63
|
type="email"
|
|
64
|
-
class="input"
|
|
64
|
+
class="vd-input"
|
|
65
65
|
placeholder="Enter your email"
|
|
66
66
|
value="user@valiify.com"
|
|
67
67
|
/>
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
</label>
|
|
83
83
|
<input
|
|
84
84
|
type="password"
|
|
85
|
-
class="input"
|
|
85
|
+
class="vd-input"
|
|
86
86
|
placeholder="Enter your password"
|
|
87
87
|
/>
|
|
88
88
|
</div>
|
|
@@ -109,13 +109,13 @@
|
|
|
109
109
|
<!-- Action Buttons -->
|
|
110
110
|
<div style="display: flex; gap: 8px; margin-top: 8px">
|
|
111
111
|
<button
|
|
112
|
-
class="btn btn-primary"
|
|
112
|
+
class="vd-btn vd-btn-primary"
|
|
113
113
|
style="flex: 1"
|
|
114
114
|
onclick="alert('Sign in clicked')"
|
|
115
115
|
>
|
|
116
116
|
Sign In
|
|
117
117
|
</button>
|
|
118
|
-
<button class="btn btn-outline" onclick="alert('Cancel clicked')">
|
|
118
|
+
<button class="vd-btn vd-btn-outline" onclick="alert('Cancel clicked')">
|
|
119
119
|
Cancel
|
|
120
120
|
</button>
|
|
121
121
|
</div>
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
gap: 8px;
|
|
148
148
|
"
|
|
149
149
|
>
|
|
150
|
-
<button class="btn btn-sm btn-outline" onclick="alert('This is a demo!')">
|
|
150
|
+
<button class="vd-btn vd-btn-sm vd-btn-outline" onclick="alert('This is a demo!')">
|
|
151
151
|
View Demo Info
|
|
152
152
|
</button>
|
|
153
153
|
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# dashboard-ui + daisyUI 4
|
|
2
|
+
|
|
3
|
+
The collision test. This is the only example that exercises the reason
|
|
4
|
+
`@valiify/dashboard-ui` is namespaced at all.
|
|
5
|
+
|
|
6
|
+
The host runs **Tailwind 3 + daisyUI 4** — the dashboard app's stack. daisyUI
|
|
7
|
+
defines `.btn`, `.badge`, `.card`, `.input`, `.alert`, `.tab(s)`, `.modal`,
|
|
8
|
+
`.toast`, `.tooltip`, `.avatar`, `.checkbox`, `.skeleton`, `.link`, `.divider`,
|
|
9
|
+
`.step`, `.textarea`, `.dropdown` and `.breadcrumbs`. So do we — under `vd-`.
|
|
10
|
+
|
|
11
|
+
Two things make it safe, and the check proves both:
|
|
12
|
+
|
|
13
|
+
- **Components are namespaced.** `.btn` is daisyUI's, `.vd-btn` is ours. Order
|
|
14
|
+
cannot rescue a shared name here: daisyUI 4 is unlayered and our rules sit in
|
|
15
|
+
`@layer components`, so an unlayered host rule wins before specificity or order
|
|
16
|
+
is consulted. Our `@import` has to come first — CSS discards an `@import` that
|
|
17
|
+
follows other rules — but that does not soften the test: on any shared name
|
|
18
|
+
daisyUI would win from either position.
|
|
19
|
+
- **Utilities are prefixed.** We ship a closed `vd:` set compiled by Tailwind 4;
|
|
20
|
+
the host compiles its own bare utilities with Tailwind 3, where `border` and
|
|
21
|
+
`ring-1` mean different things. Neither can see the other.
|
|
22
|
+
|
|
23
|
+
We import `@valiify/dashboard-ui/styles.css`, not `/source`. That bundle carries
|
|
24
|
+
**no preflight and no `html` rule** — the host owns its reset. Importing `.`
|
|
25
|
+
(`dist/index.css`) here would be wrong: it ships full Preflight and would reset
|
|
26
|
+
every element on the host's page.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install
|
|
30
|
+
npm run check # headless assertion, no bleed either way
|
|
31
|
+
npm run dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`npm run check` fails if a daisyUI control picks up any of our declarations, if
|
|
35
|
+
one of ours picks up daisyUI's, or if our prefixed utilities stop resolving.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* No-bleed assertion: dashboard-ui and daisyUI 4 in one document.
|
|
4
|
+
*
|
|
5
|
+
* npm run check
|
|
6
|
+
*
|
|
7
|
+
* verify:bundle asserts things about the bundle's own text. This renders it beside
|
|
8
|
+
* the library it was namespaced to avoid and measures COMPUTED styles, which is the
|
|
9
|
+
* only way to observe a collision — a shared class name does not error, it silently
|
|
10
|
+
* gives one library's node the other's declarations.
|
|
11
|
+
*
|
|
12
|
+
* Three claims:
|
|
13
|
+
* 1 a daisyUI control keeps daisyUI's look (we do not bleed into the host)
|
|
14
|
+
* 2 one of ours keeps ours (the host does not bleed into us)
|
|
15
|
+
* 3 our prefixed utilities still resolve (the vd: layer survives Tailwind 3)
|
|
16
|
+
*
|
|
17
|
+
* Claim 2 is the load-bearing one. daisyUI 4 is UNLAYERED and our components sit in
|
|
18
|
+
* @layer components, so on any shared name daisyUI wins regardless of import order —
|
|
19
|
+
* which is why src/styles.css loads it first. Only the namespace separates them.
|
|
20
|
+
*/
|
|
21
|
+
import { chromium } from "playwright";
|
|
22
|
+
import { createServer } from "vite";
|
|
23
|
+
|
|
24
|
+
const RED = "\x1b[31m", GRN = "\x1b[32m", DIM = "\x1b[2m", OFF = "\x1b[0m";
|
|
25
|
+
const server = await createServer({ server: { port: 5199 }, logLevel: "silent" });
|
|
26
|
+
await server.listen();
|
|
27
|
+
const browser = await chromium.launch();
|
|
28
|
+
const page = await browser.newPage();
|
|
29
|
+
await page.goto("http://localhost:5199/", { waitUntil: "networkidle" });
|
|
30
|
+
|
|
31
|
+
const style = (sel, prop) =>
|
|
32
|
+
page.evaluate(([s, p]) => {
|
|
33
|
+
const el = document.querySelector(s);
|
|
34
|
+
return el ? getComputedStyle(el).getPropertyValue(p) : null;
|
|
35
|
+
}, [sel, prop]);
|
|
36
|
+
|
|
37
|
+
const results = [];
|
|
38
|
+
const check = async (label, sel, prop, assert, why) => {
|
|
39
|
+
const got = await style(sel, prop);
|
|
40
|
+
const ok = got !== null && assert(got);
|
|
41
|
+
results.push({ label, sel, prop, got, ok, why });
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// 1 — the host's controls are untouched by us. Our .vd-btn sets its own height and
|
|
45
|
+
// radius; if any of it reached `.btn`, these would move.
|
|
46
|
+
await check("daisyUI .btn keeps its own background", "#daisy-btn", "background-color",
|
|
47
|
+
(v) => v !== "rgba(0, 0, 0, 0)", "a transparent daisyUI button means our .vd-btn rules reached it");
|
|
48
|
+
await check("daisyUI .badge is not our 15px circle", "#daisy-badge", "height",
|
|
49
|
+
(v) => parseFloat(v) !== 15, "15px is .vd-badge's height — ours bled into daisyUI's badge");
|
|
50
|
+
await check("daisyUI .input is not our 35px field", "#daisy-input", "height",
|
|
51
|
+
(v) => parseFloat(v) !== 35, "35px is .vd-input-field's lg height");
|
|
52
|
+
await check("daisyUI .alert keeps a fill", "#daisy-alert", "background-color",
|
|
53
|
+
(v) => v !== "rgba(0, 0, 0, 0)", "a bare .vd-alert is transparent — ours reached the host's alert");
|
|
54
|
+
|
|
55
|
+
// 2 — ours are untouched by the host.
|
|
56
|
+
await check("our .vd-btn is 28px (Figma medium)", "#vd-btn", "height",
|
|
57
|
+
(v) => Math.abs(parseFloat(v) - 28) < 1.5, "daisyUI's .btn is 48px; if we read ~48 the host reached us");
|
|
58
|
+
await check("our .vd-badge is a 15px circle", "#vd-badge", "height",
|
|
59
|
+
(v) => Math.abs(parseFloat(v) - 15) < 1.5, "daisyUI's .badge is taller");
|
|
60
|
+
await check("our .vd-card has our radius", "#vd-card", "border-radius",
|
|
61
|
+
(v) => v !== "0px", "");
|
|
62
|
+
await check("our .vd-tooltip is the dark surface", "#vd-tooltip", "background-color",
|
|
63
|
+
(v) => v !== "rgba(0, 0, 0, 0)", "the only dark surface in the library");
|
|
64
|
+
|
|
65
|
+
// 3 — the prefixed utility layer resolves, including the custom ones.
|
|
66
|
+
await check("vd:type-label-l-bold applies uppercase", "#vd-util", "text-transform",
|
|
67
|
+
(v) => v === "uppercase",
|
|
68
|
+
"the methodology uses this utility precisely so nobody writes a bare vd:uppercase");
|
|
69
|
+
await check("host's bare `text-center` still works", "#host-util", "text-align",
|
|
70
|
+
(v) => v === "center", "our prefix must not disturb the host's own utilities");
|
|
71
|
+
|
|
72
|
+
await browser.close();
|
|
73
|
+
await server.close();
|
|
74
|
+
|
|
75
|
+
const failed = results.filter((r) => !r.ok);
|
|
76
|
+
for (const r of results) {
|
|
77
|
+
console.log(` ${r.ok ? GRN + "PASS" : RED + "FAIL"}${OFF} ${r.label} ${DIM}${r.prop}=${r.got}${OFF}`);
|
|
78
|
+
if (!r.ok && r.why) console.log(`${DIM} ${r.why}${OFF}`);
|
|
79
|
+
}
|
|
80
|
+
console.log(`\n ${failed.length ? RED : GRN}${results.length - failed.length}/${results.length} passed${OFF}\n`);
|
|
81
|
+
process.exit(failed.length ? 1 : 0);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>dashboard-ui + daisyUI — collision check</title>
|
|
6
|
+
<link rel="stylesheet" href="/src/styles.css" />
|
|
7
|
+
</head>
|
|
8
|
+
<body class="p-8 space-y-6">
|
|
9
|
+
<!--
|
|
10
|
+
Every pair below is a name both libraries own. daisyUI keeps the bare
|
|
11
|
+
spelling; ours carries vd-. If the namespace works, each pair renders as two
|
|
12
|
+
visibly different controls and neither library's rules touch the other's node.
|
|
13
|
+
-->
|
|
14
|
+
<section class="space-y-2">
|
|
15
|
+
<h2 class="text-lg font-bold">btn</h2>
|
|
16
|
+
<button id="daisy-btn" class="btn btn-primary">daisyUI</button>
|
|
17
|
+
<button id="vd-btn" class="vd-btn vd-btn-primary">dashboard-ui</button>
|
|
18
|
+
</section>
|
|
19
|
+
|
|
20
|
+
<section class="space-y-2">
|
|
21
|
+
<h2 class="text-lg font-bold">badge / card / alert</h2>
|
|
22
|
+
<span id="daisy-badge" class="badge badge-primary">daisyUI</span>
|
|
23
|
+
<span id="vd-badge" class="vd-badge vd-badge-primary">3</span>
|
|
24
|
+
<div id="daisy-card" class="card bg-base-200 p-4">daisyUI card</div>
|
|
25
|
+
<div id="vd-card" class="vd-card">dashboard-ui card</div>
|
|
26
|
+
<div id="daisy-alert" class="alert">daisyUI alert</div>
|
|
27
|
+
<div id="vd-alert" class="vd-alert vd-alert-info">dashboard-ui alert</div>
|
|
28
|
+
</section>
|
|
29
|
+
|
|
30
|
+
<section class="space-y-2">
|
|
31
|
+
<h2 class="text-lg font-bold">input / checkbox / tooltip</h2>
|
|
32
|
+
<input id="daisy-input" class="input input-bordered" value="daisyUI" />
|
|
33
|
+
<div class="vd-input-field"><input id="vd-input" class="vd-input" value="dashboard-ui" /></div>
|
|
34
|
+
<input id="daisy-checkbox" type="checkbox" class="checkbox" />
|
|
35
|
+
<span id="vd-tooltip" class="vd-tooltip"><p class="vd-tooltip-content">ours</p></span>
|
|
36
|
+
</section>
|
|
37
|
+
|
|
38
|
+
<!-- the utility layer: ours is vd:-prefixed, the host's is bare -->
|
|
39
|
+
<section class="space-y-2">
|
|
40
|
+
<h2 class="text-lg font-bold">utilities</h2>
|
|
41
|
+
<p id="host-util" class="text-center">host Tailwind 3 utility</p>
|
|
42
|
+
<p id="vd-util" class="vd:text-content-tertiary vd:type-label-l-bold">ours, prefixed</p>
|
|
43
|
+
</section>
|
|
44
|
+
</body>
|
|
45
|
+
</html>
|