@profpowell/vb-design-system 0.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 +21 -0
- package/README.md +122 -0
- package/dist/vb-design-system.css +993 -0
- package/dist/vb-design-system.js +4482 -0
- package/dist/vb-design-system.min.css +1 -0
- package/dist/vb-design-system.min.js +513 -0
- package/package.json +78 -0
- package/src/index.css +21 -0
- package/src/index.js +24 -0
- package/src/lib/bundle-registry.js +156 -0
- package/src/lib/vb-element.js +96 -0
- package/src/patterns/do-dont.css +86 -0
- package/src/patterns/token-table.css +67 -0
- package/src/utils/copy-init.js +287 -0
- package/src/web-components/accessibility-specimen/api.json +51 -0
- package/src/web-components/accessibility-specimen/logic.js +232 -0
- package/src/web-components/accessibility-specimen/static.html +41 -0
- package/src/web-components/accessibility-specimen/styles.css +156 -0
- package/src/web-components/brand-specimen/api.json +37 -0
- package/src/web-components/brand-specimen/logic.js +61 -0
- package/src/web-components/brand-specimen/static.html +77 -0
- package/src/web-components/brand-specimen/styles.css +10 -0
- package/src/web-components/breakpoint-specimen/api.json +44 -0
- package/src/web-components/breakpoint-specimen/logic.js +186 -0
- package/src/web-components/breakpoint-specimen/static.html +38 -0
- package/src/web-components/breakpoint-specimen/styles.css +180 -0
- package/src/web-components/color-palette/api.json +73 -0
- package/src/web-components/color-palette/logic.js +280 -0
- package/src/web-components/color-palette/static.html +54 -0
- package/src/web-components/color-palette/styles.css +113 -0
- package/src/web-components/color-picker/_color-utils.js +210 -0
- package/src/web-components/component-sampler/api.json +15 -0
- package/src/web-components/component-sampler/logic.js +120 -0
- package/src/web-components/component-sampler/static.html +47 -0
- package/src/web-components/component-sampler/styles.css +9 -0
- package/src/web-components/font-pairer/_font-data.js +95 -0
- package/src/web-components/font-pairer/api.json +56 -0
- package/src/web-components/font-pairer/logic.js +401 -0
- package/src/web-components/font-pairer/static.html +9 -0
- package/src/web-components/font-pairer/styles.css +10 -0
- package/src/web-components/gradient-builder/_gradient-utils.js +54 -0
- package/src/web-components/gradient-builder/api.json +63 -0
- package/src/web-components/gradient-builder/logic.js +261 -0
- package/src/web-components/gradient-builder/static.html +9 -0
- package/src/web-components/gradient-builder/styles.css +10 -0
- package/src/web-components/icon-set/api.json +39 -0
- package/src/web-components/icon-set/logic.js +133 -0
- package/src/web-components/icon-set/static.html +36 -0
- package/src/web-components/icon-set/styles.css +82 -0
- package/src/web-components/icon-specimen/api.json +46 -0
- package/src/web-components/icon-specimen/logic.js +67 -0
- package/src/web-components/icon-specimen/static.html +39 -0
- package/src/web-components/icon-specimen/styles.css +38 -0
- package/src/web-components/layout-specimen/api.json +12 -0
- package/src/web-components/layout-specimen/logic.js +219 -0
- package/src/web-components/layout-specimen/static.html +22 -0
- package/src/web-components/layout-specimen/styles.css +95 -0
- package/src/web-components/motion-specimen/api.json +54 -0
- package/src/web-components/motion-specimen/logic.js +146 -0
- package/src/web-components/motion-specimen/static.html +13 -0
- package/src/web-components/motion-specimen/styles.css +29 -0
- package/src/web-components/palette-generator/_palette-utils.js +133 -0
- package/src/web-components/palette-generator/api.json +79 -0
- package/src/web-components/palette-generator/logic.js +288 -0
- package/src/web-components/palette-generator/static.html +47 -0
- package/src/web-components/palette-generator/styles.css +36 -0
- package/src/web-components/semantic-palette/_color-math.js +149 -0
- package/src/web-components/semantic-palette/api.json +41 -0
- package/src/web-components/semantic-palette/logic.js +400 -0
- package/src/web-components/semantic-palette/static.html +42 -0
- package/src/web-components/semantic-palette/styles.css +20 -0
- package/src/web-components/spacing-specimen/api.json +63 -0
- package/src/web-components/spacing-specimen/logic.js +132 -0
- package/src/web-components/spacing-specimen/static.html +71 -0
- package/src/web-components/spacing-specimen/styles.css +58 -0
- package/src/web-components/theme-catalog/api.json +14 -0
- package/src/web-components/theme-catalog/logic.js +228 -0
- package/src/web-components/theme-catalog/static.html +15 -0
- package/src/web-components/theme-export/api.json +18 -0
- package/src/web-components/theme-export/dtcg-serialize.js +417 -0
- package/src/web-components/theme-export/logic.js +201 -0
- package/src/web-components/theme-export/static.html +12 -0
- package/src/web-components/theme-export/theme-css-parse.js +93 -0
- package/src/web-components/theme-import/api.json +14 -0
- package/src/web-components/theme-import/catalog/atlassian.tokens.json +303 -0
- package/src/web-components/theme-import/catalog/bootstrap.tokens.json +304 -0
- package/src/web-components/theme-import/catalog/carbon.tokens.json +301 -0
- package/src/web-components/theme-import/catalog/catppuccin-mocha.tokens.json +301 -0
- package/src/web-components/theme-import/catalog/govuk.tokens.json +301 -0
- package/src/web-components/theme-import/catalog/manifest.json +132 -0
- package/src/web-components/theme-import/catalog/material.tokens.json +289 -0
- package/src/web-components/theme-import/catalog/salesforce.tokens.json +301 -0
- package/src/web-components/theme-import/catalog/tailwind.tokens.json +302 -0
- package/src/web-components/theme-import/dtcg-deserialize.js +322 -0
- package/src/web-components/theme-import/logic.js +263 -0
- package/src/web-components/theme-import/static.html +15 -0
- package/src/web-components/token-specimen/api.json +24 -0
- package/src/web-components/token-specimen/logic.js +256 -0
- package/src/web-components/token-specimen/static.html +47 -0
- package/src/web-components/token-specimen/styles.css +10 -0
- package/src/web-components/type-specimen/api.json +91 -0
- package/src/web-components/type-specimen/logic.js +156 -0
- package/src/web-components/type-specimen/static.html +84 -0
- package/src/web-components/type-specimen/styles.css +131 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Prof Thomas Powell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# @profpowell/vb-design-system
|
|
2
|
+
|
|
3
|
+
Design-system documentation components for [Vanilla Breeze](https://github.com/ProfPowell/vanilla-breeze) — the building blocks for documenting brand guidelines, design tokens, and visual standards.
|
|
4
|
+
|
|
5
|
+
These are standalone Web Components extracted from Vanilla Breeze core. They render against Vanilla Breeze **design tokens** (CSS custom properties) but carry their own logic, so you can drop them into any page that loads VB tokens/themes.
|
|
6
|
+
|
|
7
|
+
**Docs & live demos:** <https://profpowell.github.io/vb-design-system/>
|
|
8
|
+
|
|
9
|
+
## Components
|
|
10
|
+
|
|
11
|
+
Nineteen documentation components, grouped by role.
|
|
12
|
+
|
|
13
|
+
**Specimens & samplers**
|
|
14
|
+
|
|
15
|
+
| Tag | Purpose |
|
|
16
|
+
|-----|---------|
|
|
17
|
+
| `<type-specimen>` | Typography specimen: character grid, weight/type scales, editable text |
|
|
18
|
+
| `<spacing-specimen>` | Spacing scale as a bar chart from tokens |
|
|
19
|
+
| `<token-specimen>` | Token scale display (shadows, radii, borders, colors, sizes) |
|
|
20
|
+
| `<motion-specimen>` | Easing curves + durations from motion tokens |
|
|
21
|
+
| `<layout-specimen>` | VB layout primitives with labeled mini-examples + snippets |
|
|
22
|
+
| `<breakpoint-specimen>` | Responsive breakpoint ruler with live width readout |
|
|
23
|
+
| `<accessibility-specimen>` | WCAG contrast table with AA/AAA badges from color pairs |
|
|
24
|
+
| `<component-sampler>` | Themed grid of native UI elements in the active theme |
|
|
25
|
+
|
|
26
|
+
**Color & palette**
|
|
27
|
+
|
|
28
|
+
| Tag | Purpose |
|
|
29
|
+
|-----|---------|
|
|
30
|
+
| `<color-palette>` | Color swatches with click-to-copy and layout modes |
|
|
31
|
+
| `<semantic-palette>` | Preview a palette as VB semantic roles with WCAG chips |
|
|
32
|
+
| `<palette-generator>` | Generate harmonious palettes from a seed color |
|
|
33
|
+
| `<gradient-builder>` | CSS gradient builder with stops, angle, interpolation, export |
|
|
34
|
+
| `<font-pairer>` | Font-pairing tool with live preview + CSS export |
|
|
35
|
+
|
|
36
|
+
**Icons & brand**
|
|
37
|
+
|
|
38
|
+
| Tag | Purpose |
|
|
39
|
+
|-----|---------|
|
|
40
|
+
| `<icon-set>` | Searchable icon-set grid with click-to-copy names |
|
|
41
|
+
| `<icon-specimen>` | Curated icon specimen across the sizing scale |
|
|
42
|
+
| `<brand-specimen>` | Brand-mark specimen: light/dark surfaces, size scale, clear-space |
|
|
43
|
+
|
|
44
|
+
**Theming**
|
|
45
|
+
|
|
46
|
+
| Tag | Purpose |
|
|
47
|
+
|-----|---------|
|
|
48
|
+
| `<theme-catalog>` | Browse + apply curated public token sets (Material, Carbon, Tailwind, …) |
|
|
49
|
+
| `<theme-export>` | Export theme overrides as CSS or DTCG JSON |
|
|
50
|
+
| `<theme-import>` | Apply a DTCG `tokens.json` to a preview scope |
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm install @profpowell/vb-design-system
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Or load from a CDN (after publish):
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<script type="module" src="https://unpkg.com/@profpowell/vb-design-system/dist/vb-design-system.min.js"></script>
|
|
62
|
+
<link rel="stylesheet" href="https://unpkg.com/@profpowell/vb-design-system/dist/vb-design-system.min.css">
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
Register everything via the barrel, and load the component styles:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
import '@profpowell/vb-design-system'; // registers all elements
|
|
71
|
+
import '@profpowell/vb-design-system/css'; // light-DOM component styles
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or pull a single component (tree-shake friendly):
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
import '@profpowell/vb-design-system/color-palette';
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<color-palette ramp="--color-accent"></color-palette>
|
|
82
|
+
<theme-export format="dtcg"></theme-export>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Design-token contract
|
|
86
|
+
|
|
87
|
+
These components are **token-driven**: they read Vanilla Breeze CSS custom properties (`--color-*`, `--font-*`, `--size-*`, `--ease-*`, …) from the host page and inherit the active theme automatically. There is no build-time coupling — load VB's token/theme CSS (or your own compatible tokens) on the page and the components adopt it.
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<!-- Provide tokens + theme via Vanilla Breeze, then use the components -->
|
|
91
|
+
<link rel="stylesheet" href="https://unpkg.com/vanilla-breeze/dist/cdn/vanilla-breeze.css">
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`vanilla-breeze` is declared as an **optional peer dependency**: required only if you want VB to supply the tokens/themes (most consumers do). The components degrade to their hardcoded fallbacks without it.
|
|
95
|
+
|
|
96
|
+
## Relationship to Vanilla Breeze
|
|
97
|
+
|
|
98
|
+
This package was decomposed out of `vanilla-breeze` core so the framework stays focused on general site-building primitives while design-system tooling versions independently. General components that used to ship here (e.g. `icon-wc`, `brand-mark`) remain in VB core.
|
|
99
|
+
|
|
100
|
+
## Runtime peers
|
|
101
|
+
|
|
102
|
+
The following components are provided by **Vanilla Breeze** (VB core) and are used at runtime by DS components but are NOT bundled with this package:
|
|
103
|
+
|
|
104
|
+
- `<color-picker>` — Used by color-tool components (`semantic-palette`, `palette-generator`, `gradient-builder`). These tools degrade gracefully without it.
|
|
105
|
+
- `<drag-surface>` — Interactive drag patterns.
|
|
106
|
+
- `<icon-wc>` — Icon system.
|
|
107
|
+
- `<brand-mark>` — Brand mark component.
|
|
108
|
+
- `<theme-picker>` — Theme switcher.
|
|
109
|
+
|
|
110
|
+
These are declared as optional peer dependencies in `package.json`. Load `vanilla-breeze` and its token/theme CSS on the page for full functionality.
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm run build # bundle dist/ (esm + minified, js + css) via esbuild
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
A GitHub Pages demo site can depend on `vanilla-breeze` for tokens/themes and import this package directly.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
MIT © Patrick Powell
|