@valiify/dashboard-ui 0.1.2 → 0.2.1
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 +493 -4
- package/CLAUDE.md +884 -768
- package/COMPONENTS.md +520 -520
- package/GETTING_STARTED.md +63 -14
- package/QUICK_REFERENCE.md +22 -22
- package/README.md +45 -6
- package/TROUBLESHOOTING.md +46 -6
- package/class-manifest.json +664 -0
- package/design-methodology/dashboard.md +496 -0
- package/dist/dashboard-ui.css +4891 -0
- package/dist/index.css +502 -502
- package/examples/README.md +42 -0
- package/examples/basic/index.html +8 -8
- package/examples/daisyui-starter/README.md +58 -0
- package/examples/daisyui-starter/check-no-bleed.mjs +249 -0
- package/examples/daisyui-starter/index.html +72 -0
- package/examples/daisyui-starter/linked.html +74 -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/host.css +14 -0
- package/examples/daisyui-starter/src/only-import.css +4 -0
- package/examples/daisyui-starter/src/styles.css +36 -0
- package/examples/daisyui-starter/tailwind.config.js +13 -0
- package/examples/postcss-starter/index.html +8 -8
- package/examples/postcss-starter/package.json +1 -1
- package/examples/sveltekit-starter/README.md +32 -0
- package/examples/sveltekit-starter/check-scoped-styles.mjs +103 -0
- package/examples/sveltekit-starter/package-lock.json +1300 -0
- package/examples/sveltekit-starter/package.json +24 -0
- package/examples/sveltekit-starter/src/app.css +17 -0
- package/examples/sveltekit-starter/src/app.html +11 -0
- package/examples/sveltekit-starter/src/lib/GlobalReset.svelte +20 -0
- package/examples/sveltekit-starter/src/lib/ScopedRemedy.svelte +27 -0
- package/examples/sveltekit-starter/src/lib/ScopedReset.svelte +22 -0
- package/examples/sveltekit-starter/src/routes/+layout.svelte +6 -0
- package/examples/sveltekit-starter/src/routes/+page.svelte +10 -0
- package/examples/sveltekit-starter/svelte.config.js +4 -0
- package/examples/sveltekit-starter/vite.config.js +6 -0
- 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 +21 -4
- package/src/build/components.css +35 -0
- package/src/build/utilities.css +46 -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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "valiify-dashboard-ui-sveltekit-starter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite dev",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
11
|
+
"check": "node check-scoped-styles.mjs"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
15
|
+
"@sveltejs/kit": "^2.63.0",
|
|
16
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
17
|
+
"playwright": "1.62.1",
|
|
18
|
+
"svelte": "^5.56.1",
|
|
19
|
+
"vite": "^8.0.16"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@valiify/dashboard-ui": "^0.2.1"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The app shell's load path — the prebuilt entry, standalone.
|
|
3
|
+
*
|
|
4
|
+
* Only the bundle. dashboard-ui ships no reset.css and no document default: the
|
|
5
|
+
* `./styles.css` entry carries no preflight and no `html` rule, so the host paints
|
|
6
|
+
* its own page (below) and owns its own reset. Import ONE of the library's three
|
|
7
|
+
* style entries, never two — `@valiify/dashboard-ui` (dist/index.css) would bring
|
|
8
|
+
* Tailwind 4's preflight into a host that did not ask for it.
|
|
9
|
+
*/
|
|
10
|
+
@import "@valiify/dashboard-ui/styles.css";
|
|
11
|
+
|
|
12
|
+
body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 32px;
|
|
15
|
+
color: var(--color-content-primary);
|
|
16
|
+
background: var(--color-surface-frame);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
%sveltekit.head%
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div style="display: contents">%sveltekit.body%</div>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Case 1 — a :global element reset from a Svelte component.
|
|
3
|
+
Compiles to a bare, UNLAYERED `button { border: 0 }` (0,0,1). This is the shape
|
|
4
|
+
of a house reset written inside a component, and it is the case the unlayered
|
|
5
|
+
bundle defends against: our class (0,1,0) beats it on specificity.
|
|
6
|
+
-->
|
|
7
|
+
<div class="row">
|
|
8
|
+
<button id="global-reset-trigger" class="vd-dropdown-field" type="button" aria-haspopup="listbox" aria-expanded="false">
|
|
9
|
+
<span class="vd-dropdown-field-placeholder">:global(button) reset in scope</span>
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
:global(button) {
|
|
15
|
+
border: 0;
|
|
16
|
+
}
|
|
17
|
+
.row {
|
|
18
|
+
margin-bottom: 24px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Case 3 — the remedy for case 2. Exclude library controls from the scoped element
|
|
3
|
+
selector: `button:not([class*="vd-"])`. The dev's own plain button still gets the
|
|
4
|
+
reset; ours is never matched, so specificity never enters into it. (Scoping the
|
|
5
|
+
reset by class — `.plain { }` — works the same way and reads better; this form
|
|
6
|
+
is shown because it is the mechanical edit to an existing element reset.)
|
|
7
|
+
-->
|
|
8
|
+
<div class="row">
|
|
9
|
+
<button id="remedy-trigger" class="vd-dropdown-field" type="button" aria-haspopup="listbox" aria-expanded="false">
|
|
10
|
+
<span class="vd-dropdown-field-placeholder">scoped reset that excludes [class*="vd-"]</span>
|
|
11
|
+
</button>
|
|
12
|
+
<button id="remedy-plain" type="button">the component's own plain button</button>
|
|
13
|
+
<button id="remedy-primary" class="vd-btn vd-btn-primary" type="button">Continue</button>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
button:not([class*="vd-"]) {
|
|
18
|
+
border: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
}
|
|
21
|
+
.row {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
gap: 12px;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Case 2 — a SCOPED element selector. THE CASE THE BUNDLE CANNOT DEFEND AGAINST.
|
|
3
|
+
Svelte scopes `button { }` to `button.svelte-<hash>` — specificity 0,1,1, which
|
|
4
|
+
outranks our single-class rule (0,1,0) whether or not the bundle is layered.
|
|
5
|
+
check-scoped-styles.mjs asserts that our border is LOST here on purpose: this
|
|
6
|
+
pins the contract's second clause (a host rule at higher specificity wins) to a
|
|
7
|
+
measurement, so the README / GETTING_STARTED text cannot drift from what is true.
|
|
8
|
+
-->
|
|
9
|
+
<div class="row">
|
|
10
|
+
<button id="scoped-trigger" class="vd-dropdown-field" type="button" aria-haspopup="listbox" aria-expanded="false">
|
|
11
|
+
<span class="vd-dropdown-field-placeholder">scoped element reset — wins over us</span>
|
|
12
|
+
</button>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
button {
|
|
17
|
+
border: 0;
|
|
18
|
+
}
|
|
19
|
+
.row {
|
|
20
|
+
margin-bottom: 24px;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import GlobalReset from "$lib/GlobalReset.svelte";
|
|
3
|
+
import ScopedReset from "$lib/ScopedReset.svelte";
|
|
4
|
+
import ScopedRemedy from "$lib/ScopedRemedy.svelte";
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<h1>dashboard-ui inside SvelteKit — scoped styles vs component rules</h1>
|
|
8
|
+
<GlobalReset />
|
|
9
|
+
<ScopedReset />
|
|
10
|
+
<ScopedRemedy />
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { sveltekit } from "@sveltejs/kit/vite";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
|
|
4
|
+
// No Tailwind in this host at all. The library's prebuilt bundle is a plain
|
|
5
|
+
// stylesheet, and the thing under test is what SvelteKit itself does to CSS.
|
|
6
|
+
export default defineConfig({ plugins: [sveltekit()] });
|
|
@@ -77,7 +77,7 @@ See `src/main.js` for a minimal dropdown implementation.
|
|
|
77
77
|
import "./styles.css";
|
|
78
78
|
|
|
79
79
|
function App() {
|
|
80
|
-
return <button className="btn btn-primary">Click me</button>;
|
|
80
|
+
return <button className="vd-btn vd-btn-primary">Click me</button>;
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
83
|
|
|
@@ -88,7 +88,7 @@ import "./styles.css";
|
|
|
88
88
|
</script>
|
|
89
89
|
|
|
90
90
|
<template>
|
|
91
|
-
<button class="btn btn-primary">Click me</button>
|
|
91
|
+
<button class="vd-btn vd-btn-primary">Click me</button>
|
|
92
92
|
</template>
|
|
93
93
|
```
|
|
94
94
|
|
|
@@ -98,7 +98,7 @@ import "./styles.css";
|
|
|
98
98
|
import "./styles.css";
|
|
99
99
|
</script>
|
|
100
100
|
|
|
101
|
-
<button class="btn btn-primary">Click me</button>
|
|
101
|
+
<button class="vd-btn vd-btn-primary">Click me</button>
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
## Troubleshooting
|
|
@@ -115,7 +115,7 @@ import "./styles.css";
|
|
|
115
115
|
|
|
116
116
|
### Components look broken
|
|
117
117
|
- Check that you're using the full markup structure (see CLAUDE.md in the repo)
|
|
118
|
-
- Many components need wrapper elements (e.g., `.input-container` > `.input-field` > `.input`)
|
|
118
|
+
- Many components need wrapper elements (e.g., `.vd-input-container` > `.vd-input-field` > `.vd-input`)
|
|
119
119
|
- Verify you're using the correct variant/size classes
|
|
120
120
|
|
|
121
121
|
## Learn More
|
|
@@ -29,10 +29,10 @@ app.innerHTML = `
|
|
|
29
29
|
Buttons
|
|
30
30
|
</h2>
|
|
31
31
|
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
|
32
|
-
<button class="btn btn-primary">Primary</button>
|
|
33
|
-
<button class="btn btn-outline">Outline</button>
|
|
34
|
-
<button class="btn btn-empty">Empty</button>
|
|
35
|
-
<button class="btn btn-primary" disabled>Disabled</button>
|
|
32
|
+
<button class="vd-btn vd-btn-primary">Primary</button>
|
|
33
|
+
<button class="vd-btn vd-btn-outline">Outline</button>
|
|
34
|
+
<button class="vd-btn vd-btn-empty">Empty</button>
|
|
35
|
+
<button class="vd-btn vd-btn-primary" disabled>Disabled</button>
|
|
36
36
|
</div>
|
|
37
37
|
</section>
|
|
38
38
|
|
|
@@ -41,15 +41,15 @@ app.innerHTML = `
|
|
|
41
41
|
<h2 style="font-size: 18px; font-weight: 500; margin-bottom: 12px; color: var(--color-content-primary);">
|
|
42
42
|
Input
|
|
43
43
|
</h2>
|
|
44
|
-
<div class="input-container" style="max-width: 400px;">
|
|
45
|
-
<div class="input-label">
|
|
44
|
+
<div class="vd-input-container" style="max-width: 400px;">
|
|
45
|
+
<div class="vd-input-label">
|
|
46
46
|
<span>Email Address</span>
|
|
47
47
|
</div>
|
|
48
|
-
<div class="input-field input-lg">
|
|
49
|
-
<svg class="input-icon-left icon icon-size-14" aria-hidden="true">
|
|
48
|
+
<div class="vd-input-field vd-input-lg">
|
|
49
|
+
<svg class="vd-input-icon-left vd-icon vd-icon-size-14" aria-hidden="true">
|
|
50
50
|
<use href="#mail" />
|
|
51
51
|
</svg>
|
|
52
|
-
<input type="email" class="input" placeholder="you@example.com" />
|
|
52
|
+
<input type="email" class="vd-input" placeholder="you@example.com" />
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
</section>
|
|
@@ -59,14 +59,14 @@ app.innerHTML = `
|
|
|
59
59
|
<h2 style="font-size: 18px; font-weight: 500; margin-bottom: 12px; color: var(--color-content-primary);">
|
|
60
60
|
Alert
|
|
61
61
|
</h2>
|
|
62
|
-
<div class="alert alert-warning" role="alert">
|
|
63
|
-
<div class="alert-body">
|
|
64
|
-
<svg class="alert-icon icon icon-size-18" aria-hidden="true">
|
|
62
|
+
<div class="vd-alert vd-alert-warning" role="alert">
|
|
63
|
+
<div class="vd-alert-body">
|
|
64
|
+
<svg class="vd-alert-icon vd-icon vd-icon-size-18" aria-hidden="true">
|
|
65
65
|
<use href="#info" />
|
|
66
66
|
</svg>
|
|
67
|
-
<div class="alert-content">
|
|
68
|
-
<p class="alert-title">Setup Complete</p>
|
|
69
|
-
<p class="alert-message">
|
|
67
|
+
<div class="vd-alert-content">
|
|
68
|
+
<p class="vd-alert-title">Setup Complete</p>
|
|
69
|
+
<p class="vd-alert-message">
|
|
70
70
|
If you can see this alert with proper styling and icons,
|
|
71
71
|
your installation is working correctly!
|
|
72
72
|
</p>
|
|
@@ -81,16 +81,16 @@ app.innerHTML = `
|
|
|
81
81
|
Status Indicators
|
|
82
82
|
</h2>
|
|
83
83
|
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
|
84
|
-
<span class="chip chip-success">
|
|
85
|
-
<span class="chip-dot"></span>
|
|
84
|
+
<span class="vd-chip vd-chip-success">
|
|
85
|
+
<span class="vd-chip-dot"></span>
|
|
86
86
|
<span>Approved</span>
|
|
87
87
|
</span>
|
|
88
|
-
<span class="chip chip-warning">
|
|
89
|
-
<span class="chip-dot"></span>
|
|
88
|
+
<span class="vd-chip vd-chip-warning">
|
|
89
|
+
<span class="vd-chip-dot"></span>
|
|
90
90
|
<span>Pending</span>
|
|
91
91
|
</span>
|
|
92
|
-
<span class="chip chip-critical">
|
|
93
|
-
<span class="chip-dot"></span>
|
|
92
|
+
<span class="vd-chip vd-chip-critical">
|
|
93
|
+
<span class="vd-chip-dot"></span>
|
|
94
94
|
<span>Rejected</span>
|
|
95
95
|
</span>
|
|
96
96
|
</div>
|
|
@@ -113,37 +113,37 @@ app.innerHTML = `
|
|
|
113
113
|
// Example of minimal dropdown behavior
|
|
114
114
|
const dropdownExample = document.getElementById("dropdown-example");
|
|
115
115
|
dropdownExample.innerHTML = `
|
|
116
|
-
<div class="dropdown-field-container" style="max-width: 300px;">
|
|
117
|
-
<div class="dropdown-field-label">
|
|
116
|
+
<div class="vd-dropdown-field-container" style="max-width: 300px;">
|
|
117
|
+
<div class="vd-dropdown-field-label">
|
|
118
118
|
<span>Select an option</span>
|
|
119
119
|
</div>
|
|
120
|
-
<div class="dropdown">
|
|
120
|
+
<div class="vd-dropdown">
|
|
121
121
|
<button
|
|
122
122
|
id="dropdown-trigger"
|
|
123
|
-
class="dropdown-field"
|
|
123
|
+
class="vd-dropdown-field"
|
|
124
124
|
aria-haspopup="listbox"
|
|
125
125
|
aria-expanded="false"
|
|
126
126
|
>
|
|
127
|
-
<span class="dropdown-field-placeholder">Choose one...</span>
|
|
128
|
-
<svg class="dropdown-field-chevron icon icon-size-14" aria-hidden="true">
|
|
127
|
+
<span class="vd-dropdown-field-placeholder">Choose one...</span>
|
|
128
|
+
<svg class="vd-dropdown-field-chevron vd-icon vd-icon-size-14" aria-hidden="true">
|
|
129
129
|
<use href="#chevron-down" />
|
|
130
130
|
</svg>
|
|
131
131
|
</button>
|
|
132
|
-
<div id="dropdown-panel" class="dropdown-panel" hidden>
|
|
133
|
-
<div class="dropdown-menu" role="listbox">
|
|
134
|
-
<button class="menu-item" role="option" data-value="weekly">
|
|
135
|
-
<span class="menu-item-text">
|
|
136
|
-
<span class="menu-item-title">Weekly</span>
|
|
132
|
+
<div id="dropdown-panel" class="vd-dropdown-panel" hidden>
|
|
133
|
+
<div class="vd-dropdown-menu" role="listbox">
|
|
134
|
+
<button class="vd-menu-item" role="option" data-value="weekly">
|
|
135
|
+
<span class="vd-menu-item-text">
|
|
136
|
+
<span class="vd-menu-item-title">Weekly</span>
|
|
137
137
|
</span>
|
|
138
138
|
</button>
|
|
139
|
-
<button class="menu-item" role="option" data-value="monthly">
|
|
140
|
-
<span class="menu-item-text">
|
|
141
|
-
<span class="menu-item-title">Monthly</span>
|
|
139
|
+
<button class="vd-menu-item" role="option" data-value="monthly">
|
|
140
|
+
<span class="vd-menu-item-text">
|
|
141
|
+
<span class="vd-menu-item-title">Monthly</span>
|
|
142
142
|
</span>
|
|
143
143
|
</button>
|
|
144
|
-
<button class="menu-item" role="option" data-value="yearly">
|
|
145
|
-
<span class="menu-item-text">
|
|
146
|
-
<span class="menu-item-title">Yearly</span>
|
|
144
|
+
<button class="vd-menu-item" role="option" data-value="yearly">
|
|
145
|
+
<span class="vd-menu-item-text">
|
|
146
|
+
<span class="vd-menu-item-title">Yearly</span>
|
|
147
147
|
</span>
|
|
148
148
|
</button>
|
|
149
149
|
</div>
|
|
@@ -156,7 +156,7 @@ dropdownExample.innerHTML = `
|
|
|
156
156
|
const trigger = document.getElementById("dropdown-trigger");
|
|
157
157
|
const panel = document.getElementById("dropdown-panel");
|
|
158
158
|
const options = panel.querySelectorAll('[role="option"]');
|
|
159
|
-
const placeholder = trigger.querySelector(".dropdown-field-placeholder");
|
|
159
|
+
const placeholder = trigger.querySelector(".vd-dropdown-field-placeholder");
|
|
160
160
|
|
|
161
161
|
trigger.addEventListener("click", () => {
|
|
162
162
|
const isOpen = trigger.getAttribute("aria-expanded") === "true";
|
|
@@ -167,11 +167,11 @@ trigger.addEventListener("click", () => {
|
|
|
167
167
|
options.forEach((option) => {
|
|
168
168
|
option.addEventListener("click", () => {
|
|
169
169
|
const value = option.getAttribute("data-value");
|
|
170
|
-
const title = option.querySelector(".menu-item-title").textContent;
|
|
170
|
+
const title = option.querySelector(".vd-menu-item-title").textContent;
|
|
171
171
|
|
|
172
172
|
// Update the trigger
|
|
173
173
|
placeholder.textContent = title;
|
|
174
|
-
placeholder.className = "dropdown-field-value";
|
|
174
|
+
placeholder.className = "vd-dropdown-field-value";
|
|
175
175
|
|
|
176
176
|
// Close the dropdown
|
|
177
177
|
trigger.setAttribute("aria-expanded", "false");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valiify/dashboard-ui",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Tailwind CSS component library for Valiify Dashboard applications",
|
|
5
5
|
"style": "dist/index.css",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -10,16 +10,20 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./dist/index.css",
|
|
12
12
|
"./index.css": "./dist/index.css",
|
|
13
|
+
"./styles.css": "./dist/dashboard-ui.css",
|
|
13
14
|
"./fonts": "./src/fonts.css",
|
|
14
15
|
"./source": "./src/library.css",
|
|
15
16
|
"./icons/sprite.svg": "./src/icons/sprite.svg",
|
|
17
|
+
"./manifest": "./class-manifest.json",
|
|
16
18
|
"./types": "./types/index.d.ts"
|
|
17
19
|
},
|
|
18
20
|
"files": [
|
|
19
21
|
"dist",
|
|
22
|
+
"class-manifest.json",
|
|
20
23
|
"src",
|
|
21
24
|
"types",
|
|
22
25
|
"examples",
|
|
26
|
+
"design-methodology",
|
|
23
27
|
"README.md",
|
|
24
28
|
"GETTING_STARTED.md",
|
|
25
29
|
"COMPONENTS.md",
|
|
@@ -29,24 +33,36 @@
|
|
|
29
33
|
"CLAUDE.md"
|
|
30
34
|
],
|
|
31
35
|
"scripts": {
|
|
32
|
-
"build": "npm run build:theme && npm run build:icons && postcss src/index.css -o dist/index.css",
|
|
36
|
+
"build": "npm run build:theme && npm run build:icons && npm run build:utility-surface && postcss src/index.css -o dist/index.css && npm run build:styles && npm run build:manifest",
|
|
33
37
|
"prepack": "npm run build && npm run fix-examples",
|
|
34
38
|
"fix-examples": "node scripts/fix-example-deps.mjs",
|
|
35
39
|
"restore-examples": "node scripts/restore-example-deps.mjs",
|
|
36
40
|
"build:theme": "node scripts/build-theme.mjs",
|
|
37
41
|
"build:icons": "node scripts/build-sprite.mjs",
|
|
42
|
+
"build:manifest": "node scripts/build-manifest.mjs",
|
|
43
|
+
"build:styles": "node scripts/build-styles.mjs",
|
|
44
|
+
"build:utility-surface": "node scripts/build-utility-surface.mjs",
|
|
45
|
+
"build:theme:check": "node scripts/build-theme.mjs --check",
|
|
38
46
|
"dev": "postcss src/index.css -o dist/index.css --watch",
|
|
39
47
|
"typecheck": "tsc --noEmit",
|
|
40
48
|
"format": "prettier --write .",
|
|
41
49
|
"new:component": "node scripts/new-component.mjs",
|
|
42
50
|
"verify:component": "node scripts/verify-component.mjs",
|
|
43
51
|
"verify:layers": "node scripts/verify-layers.mjs",
|
|
52
|
+
"verify:layer-defeat": "node scripts/verify-layer-defeat.mjs",
|
|
53
|
+
"verify:utility-precedence": "node scripts/verify-utility-precedence.mjs",
|
|
54
|
+
"verify:vocabulary": "node scripts/verify-vocabulary.mjs",
|
|
55
|
+
"verify:bundle": "node scripts/verify-bundle.mjs",
|
|
56
|
+
"verify:markup": "node scripts/verify-markup.mjs",
|
|
57
|
+
"verify:package": "node scripts/verify-package.mjs",
|
|
44
58
|
"storybook": "storybook dev -p 6006",
|
|
45
59
|
"build-storybook": "storybook build",
|
|
46
60
|
"verify:visual": "node scripts/visual-verify.mjs",
|
|
47
61
|
"verify:a11y": "node scripts/a11y-scan.mjs",
|
|
48
62
|
"audit": "node scripts/audit-components.mjs",
|
|
49
|
-
"chromatic": "chromatic"
|
|
63
|
+
"chromatic": "chromatic",
|
|
64
|
+
"val:check": "val-init --check",
|
|
65
|
+
"val:init": "val-init"
|
|
50
66
|
},
|
|
51
67
|
"keywords": [
|
|
52
68
|
"tailwind",
|
|
@@ -75,7 +91,8 @@
|
|
|
75
91
|
"@storybook/addon-themes": "^10.5.10",
|
|
76
92
|
"@storybook/html-vite": "^10.5.10",
|
|
77
93
|
"@tailwindcss/postcss": "^4.3.3",
|
|
78
|
-
"
|
|
94
|
+
"@valiify/val-core": "^0.6.0",
|
|
95
|
+
"chromatic": "^18.7.2",
|
|
79
96
|
"lucide-static": "^1.33.0",
|
|
80
97
|
"pixelmatch": "^7.2.0",
|
|
81
98
|
"playwright": "^1.62.1",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prebuilt bundle — PASS A: tokens, base and component classes. No preflight.
|
|
3
|
+
*
|
|
4
|
+
* Compiled by scripts/build-styles.mjs and concatenated with pass B into
|
|
5
|
+
* dist/dashboard-ui.css.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately NOT `@import "tailwindcss"`: that entry pulls preflight, and the host
|
|
8
|
+
* app already has a reset. The dashboard app runs Tailwind 3 + daisyUI 4, whose base
|
|
9
|
+
* layer ours would fight — dist/index.css ships the full Preflight plus a bare
|
|
10
|
+
* `html { color; background-color }`, which is exactly what makes it unsafe to drop
|
|
11
|
+
* into a host. theme.css alone gives the default tokens our @apply payloads resolve
|
|
12
|
+
* against; unused ones still tree-shake.
|
|
13
|
+
*
|
|
14
|
+
* ../base/index.css is NOT imported either, and that is the second half of "no
|
|
15
|
+
* preflight". It sets `html { color; background-color: var(--color-surface-frame) }`,
|
|
16
|
+
* which is app chrome: correct for Storybook and for a consumer building from ./source,
|
|
17
|
+
* wrong for a stylesheet dropped into a host that already paints its own page. The
|
|
18
|
+
* bundle therefore contains zero `html` rules, where dist/index.css has one.
|
|
19
|
+
*
|
|
20
|
+
* No utilities.css import either, so this pass emits ZERO utility classes — the
|
|
21
|
+
* prefixed ones come from pass B. theme.css does not declare the layer order, so it
|
|
22
|
+
* is declared here.
|
|
23
|
+
*
|
|
24
|
+
* The components then land in `@layer components`, which scripts/build-styles.mjs
|
|
25
|
+
* UNWRAPS — see there for why a layer is the bug in a bundle shipped into a foreign
|
|
26
|
+
* app. Source, ./source and dist/index.css keep their layers. Because ../base is not
|
|
27
|
+
* imported, there is no `@layer base` block to deal with; build-styles.mjs fails the
|
|
28
|
+
* build if one ever appears.
|
|
29
|
+
*/
|
|
30
|
+
@layer theme, base, components, utilities;
|
|
31
|
+
|
|
32
|
+
@import "tailwindcss/theme.css";
|
|
33
|
+
@import "../themes/valiify.css";
|
|
34
|
+
@import "../components/index.css";
|
|
35
|
+
@import "../utilities/index.css";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prebuilt bundle — PASS B: the `vd:`-prefixed utility layer.
|
|
3
|
+
*
|
|
4
|
+
* Why a second pass at all: Tailwind's prefix is global to a compile and renames theme
|
|
5
|
+
* variables too (--color-primary -> --vd-color-primary). Prefixing the whole library
|
|
6
|
+
* would break the public token API and force `vd:` onto every @apply payload in
|
|
7
|
+
* src/components. Compiling utilities separately keeps components and tokens as authored.
|
|
8
|
+
*
|
|
9
|
+
* Why prefix the utilities at all: the host runs Tailwind 3, where `border`, `ring-1`
|
|
10
|
+
* and `space-x-*` mean different things than they do here. `vd:` makes our utilities
|
|
11
|
+
* unable to collide with the host's.
|
|
12
|
+
*
|
|
13
|
+
* Why valiify-tokens.css and valiify-type-prefixed.css rather than valiify.css:
|
|
14
|
+
* that file carries the @theme block AND `@utility type-label-* { @apply text-label-* }`.
|
|
15
|
+
* `@apply` resolves at compile time, so under prefix(vd) the payload is a HARD failure —
|
|
16
|
+
* "Cannot apply unprefixed utility class `text-label-l`". The generated theme is split
|
|
17
|
+
* so the tokens can take the prefix while the type utilities import without it, their
|
|
18
|
+
* payloads already spelled `vd:`. scripts/build-theme.mjs asserts the two spellings
|
|
19
|
+
* are the same utility.
|
|
20
|
+
*
|
|
21
|
+
* ../utilities/index.css imports UNCHANGED. `@utility focus-ring` has no @apply, and
|
|
22
|
+
* its var(--ring-focus-width) resolves against pass A's definitions once the two passes
|
|
23
|
+
* are concatenated — so it needs no prefixed twin. Only @utility blocks whose bodies
|
|
24
|
+
* use @apply do.
|
|
25
|
+
*
|
|
26
|
+
* The utilities land UNLAYERED, and that is deliberate. `tailwindcss/utilities.css` is
|
|
27
|
+
* a bare `@tailwind utilities;` — unlike `tailwindcss/index.css`, which wraps it in
|
|
28
|
+
* `@layer utilities`. Unlayered is the safer shape for a layer shipped INTO a foreign
|
|
29
|
+
* app: unlayered rules beat layered ones before specificity is consulted, so a layered
|
|
30
|
+
* `vd:flex` would silently lose to any unlayered host rule touching the same property
|
|
31
|
+
* (daisyUI 4 is entirely unlayered). The SAME sentence governs pass A: build-styles.mjs
|
|
32
|
+
* unwraps the component classes too, because inside @layer components they lost to
|
|
33
|
+
* the host's preflight and to daisyUI (the 0.2.0 bug, scripts/verify-layer-defeat.mjs).
|
|
34
|
+
* With both passes unlayered, a vd: utility beats a component rule of equal specificity
|
|
35
|
+
* by source order (pass B follows pass A) and loses to a compound component selector —
|
|
36
|
+
* scripts/verify-utility-precedence.mjs asserts no generated markup relies on the latter.
|
|
37
|
+
*/
|
|
38
|
+
@layer theme, base, components, utilities;
|
|
39
|
+
|
|
40
|
+
@import "tailwindcss/theme.css" prefix(vd);
|
|
41
|
+
@import "../themes/valiify-tokens.css" prefix(vd);
|
|
42
|
+
@import "../themes/valiify-type-prefixed.css";
|
|
43
|
+
@import "../utilities/index.css";
|
|
44
|
+
@import "../utility-surface.css";
|
|
45
|
+
|
|
46
|
+
@import "tailwindcss/utilities.css" source(none);
|