@pure-ds/storybook 0.1.5 → 0.1.7
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/.storybook/addons/pds-configurator/preview.js +2 -2
- package/dist/pds-reference.json +1 -1
- package/package.json +3 -3
- package/scripts/package-build.js +2 -4
- package/stories/GettingStarted.md +96 -96
- package/stories/components/PdsDrawer.stories.js +602 -19
- package/stories/components/PdsIcon.stories.js +22 -6
- package/stories/components/PdsTabstrip.stories.js +434 -26
- package/stories/foundations/Colors.stories.js +240 -75
- package/stories/foundations/Icons.stories.js +287 -177
- package/stories/foundations/Spacing.stories.js +161 -57
- package/stories/foundations/Typography.stories.js +945 -68
- package/stories/primitives/Alerts.stories.js +25 -31
- package/stories/primitives/Badges.stories.js +146 -35
- package/stories/primitives/Buttons.stories.js +213 -85
- package/stories/primitives/Cards.stories.js +330 -53
- package/stories/primitives/Forms.stories.js +92 -161
|
@@ -77,7 +77,7 @@ async function loadConfigForm() {
|
|
|
77
77
|
configFormLoaded = true;
|
|
78
78
|
|
|
79
79
|
// Listen for design updates from the form
|
|
80
|
-
const PDS = (await import('
|
|
80
|
+
const PDS = (await import('@pds-src/js/pds.js')).PDS;
|
|
81
81
|
PDS.addEventListener('pds:design:updated', async (e) => {
|
|
82
82
|
console.log('Design updated in configurator:', e.detail);
|
|
83
83
|
|
|
@@ -135,7 +135,7 @@ if (typeof window !== 'undefined') {
|
|
|
135
135
|
|
|
136
136
|
channel.on(EVENTS.QUERY_EXECUTED, async ({ query }) => {
|
|
137
137
|
try {
|
|
138
|
-
const PDS = (await import('
|
|
138
|
+
const PDS = (await import('@pds-src/js/pds.js')).PDS;
|
|
139
139
|
const results = await PDS.query(query);
|
|
140
140
|
|
|
141
141
|
// Send results back to manager
|
package/dist/pds-reference.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pure-ds/storybook",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Storybook showcase for Pure Design System with live configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"package-build": "node scripts/package-build.js",
|
|
25
25
|
"storybook": "npm run build-reference && storybook dev -p 6006",
|
|
26
26
|
"build-storybook": "npm run build-reference && storybook build --output-dir storybook-static",
|
|
27
|
-
"storybook:dev": "npm run
|
|
28
|
-
"storybook:build": "npm run
|
|
27
|
+
"storybook:dev": "npm run storybook",
|
|
28
|
+
"storybook:build": "npm run build-storybook"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@pure-ds/core": "^0.3.0"
|
package/scripts/package-build.js
CHANGED
|
@@ -44,10 +44,8 @@ console.log('Copying custom-elements.json...');
|
|
|
44
44
|
cpSync(join(monorepoRoot, 'custom-elements.json'), join(packageRoot, 'custom-elements.json'));
|
|
45
45
|
|
|
46
46
|
// 3. Run Generation Scripts
|
|
47
|
-
console.log('Generating stories...');
|
|
48
|
-
//
|
|
49
|
-
// These scripts use `../../../src` to READ data. That is fine as long as we are in the monorepo during build.
|
|
50
|
-
execSync('node scripts/generate-stories.js', { cwd: packageRoot, stdio: 'inherit' });
|
|
47
|
+
// console.log('Generating stories...');
|
|
48
|
+
// execSync('node scripts/generate-stories.js', { cwd: packageRoot, stdio: 'inherit' });
|
|
51
49
|
|
|
52
50
|
console.log('Building reference...');
|
|
53
51
|
execSync('node scripts/build-pds-reference.mjs', { cwd: packageRoot, stdio: 'inherit' });
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
# Getting Started with PDS Storybook
|
|
2
|
-
|
|
3
|
-
Welcome to the **Pure Design System** Storybook! This is a comprehensive showcase of the configuration-driven design system that generates complete design systems from JavaScript configuration.
|
|
4
|
-
|
|
5
|
-
## 🎨 What You're Looking At
|
|
6
|
-
|
|
7
|
-
This Storybook instance demonstrates:
|
|
8
|
-
|
|
9
|
-
- **Live Configuration** - Use the PDS Configurator button in the toolbar to change the design in real-time
|
|
10
|
-
- **Multiple Presets** - Switch between design presets using the toolbar
|
|
11
|
-
- **Theme Switching** - Toggle between light and dark themes
|
|
12
|
-
- **Quick Search** - Use the search icon to query tokens and components
|
|
13
|
-
|
|
14
|
-
## 🚀 Quick Start
|
|
15
|
-
|
|
16
|
-
### 1. Try the Configurator
|
|
17
|
-
|
|
18
|
-
Click the **PDS Configurator** button in the toolbar (circle icon) to open the configuration panel at the bottom of the screen. From there you can:
|
|
19
|
-
|
|
20
|
-
- Change colors, typography, spacing
|
|
21
|
-
- Toggle effects like liquid glass
|
|
22
|
-
- Export your configuration
|
|
23
|
-
- See changes applied instantly across all stories
|
|
24
|
-
|
|
25
|
-
### 2. Browse Stories
|
|
26
|
-
|
|
27
|
-
Stories are organized by best practices:
|
|
28
|
-
|
|
29
|
-
- **Foundations** - Design tokens (colors, typography, spacing, icons)
|
|
30
|
-
- **Primitives** - Basic UI elements (buttons, forms, cards, badges)
|
|
31
|
-
- **Components** - Web Components (pds-icon, pds-drawer, pds-tabstrip, etc.)
|
|
32
|
-
- **Patterns** - Layout patterns and utilities
|
|
33
|
-
- **Enhancements** - Progressive enhancements for semantic HTML
|
|
34
|
-
|
|
35
|
-
### 3. Use Quick Search
|
|
36
|
-
|
|
37
|
-
Click the search icon in the toolbar to query the design system:
|
|
38
|
-
|
|
39
|
-
- "what is the focus border color on inputs?"
|
|
40
|
-
- "button hover color"
|
|
41
|
-
- "how do I create a card?"
|
|
42
|
-
|
|
43
|
-
## 📚 Story Features
|
|
44
|
-
|
|
45
|
-
Each story includes:
|
|
46
|
-
|
|
47
|
-
- **Interactive controls** - Use the Controls panel to customize
|
|
48
|
-
- **Preset selection** - Try different design presets
|
|
49
|
-
- **Color overrides** - Override primary/secondary colors per story
|
|
50
|
-
- **Live updates** - Changes apply immediately
|
|
51
|
-
|
|
52
|
-
## 🎯 Key Features
|
|
53
|
-
|
|
54
|
-
### Configuration-Driven
|
|
55
|
-
|
|
56
|
-
```javascript
|
|
57
|
-
await PDS.start({
|
|
58
|
-
design: {
|
|
59
|
-
colors: { primary: '#007acc', secondary: '#5c2d91' },
|
|
60
|
-
typography: { baseFontSize: 16, fontScale: 1.25 },
|
|
61
|
-
spatialRhythm: { baseUnit: 8, scaleRatio: 1.5 }
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Live Mode
|
|
67
|
-
|
|
68
|
-
This Storybook runs PDS in **live mode**, meaning:
|
|
69
|
-
- Styles are generated at runtime
|
|
70
|
-
- Configuration changes apply instantly
|
|
71
|
-
- Full access to `PDS.compiled` object model
|
|
72
|
-
- Automatic font loading from Google Fonts
|
|
73
|
-
|
|
74
|
-
### Framework Agnostic
|
|
75
|
-
|
|
76
|
-
While this Storybook uses Vite + Web Components, PDS works with:
|
|
77
|
-
- Vanilla JavaScript
|
|
78
|
-
- Lit
|
|
79
|
-
- React
|
|
80
|
-
- Vue
|
|
81
|
-
- Svelte
|
|
82
|
-
- Next.js
|
|
83
|
-
|
|
84
|
-
## 🔗 Resources
|
|
85
|
-
|
|
86
|
-
- [GitHub](https://github.com/mvneerven/pure-ds)
|
|
87
|
-
- [NPM Package](https://www.npmjs.com/package
|
|
88
|
-
- [Documentation](https://puredesignsystem.z6.web.core.windows.net/)
|
|
89
|
-
|
|
90
|
-
## 💡 Tips
|
|
91
|
-
|
|
92
|
-
1. **Start with Foundations** - Understand the token system first
|
|
93
|
-
2. **Experiment with Presets** - See how different designs look
|
|
94
|
-
3. **Open the Configurator** - Try changing values live
|
|
95
|
-
4. **Use Quick Search** - Find tokens and components quickly
|
|
96
|
-
5. **Check Controls** - Each story has customizable parameters
|
|
1
|
+
# Getting Started with PDS Storybook
|
|
2
|
+
|
|
3
|
+
Welcome to the **Pure Design System** Storybook! This is a comprehensive showcase of the configuration-driven design system that generates complete design systems from JavaScript configuration.
|
|
4
|
+
|
|
5
|
+
## 🎨 What You're Looking At
|
|
6
|
+
|
|
7
|
+
This Storybook instance demonstrates:
|
|
8
|
+
|
|
9
|
+
- **Live Configuration** - Use the PDS Configurator button in the toolbar to change the design in real-time
|
|
10
|
+
- **Multiple Presets** - Switch between design presets using the toolbar
|
|
11
|
+
- **Theme Switching** - Toggle between light and dark themes
|
|
12
|
+
- **Quick Search** - Use the search icon to query tokens and components
|
|
13
|
+
|
|
14
|
+
## 🚀 Quick Start
|
|
15
|
+
|
|
16
|
+
### 1. Try the Configurator
|
|
17
|
+
|
|
18
|
+
Click the **PDS Configurator** button in the toolbar (circle icon) to open the configuration panel at the bottom of the screen. From there you can:
|
|
19
|
+
|
|
20
|
+
- Change colors, typography, spacing
|
|
21
|
+
- Toggle effects like liquid glass
|
|
22
|
+
- Export your configuration
|
|
23
|
+
- See changes applied instantly across all stories
|
|
24
|
+
|
|
25
|
+
### 2. Browse Stories
|
|
26
|
+
|
|
27
|
+
Stories are organized by best practices:
|
|
28
|
+
|
|
29
|
+
- **Foundations** - Design tokens (colors, typography, spacing, icons)
|
|
30
|
+
- **Primitives** - Basic UI elements (buttons, forms, cards, badges)
|
|
31
|
+
- **Components** - Web Components (pds-icon, pds-drawer, pds-tabstrip, etc.)
|
|
32
|
+
- **Patterns** - Layout patterns and utilities
|
|
33
|
+
- **Enhancements** - Progressive enhancements for semantic HTML
|
|
34
|
+
|
|
35
|
+
### 3. Use Quick Search
|
|
36
|
+
|
|
37
|
+
Click the search icon in the toolbar to query the design system:
|
|
38
|
+
|
|
39
|
+
- "what is the focus border color on inputs?"
|
|
40
|
+
- "button hover color"
|
|
41
|
+
- "how do I create a card?"
|
|
42
|
+
|
|
43
|
+
## 📚 Story Features
|
|
44
|
+
|
|
45
|
+
Each story includes:
|
|
46
|
+
|
|
47
|
+
- **Interactive controls** - Use the Controls panel to customize
|
|
48
|
+
- **Preset selection** - Try different design presets
|
|
49
|
+
- **Color overrides** - Override primary/secondary colors per story
|
|
50
|
+
- **Live updates** - Changes apply immediately
|
|
51
|
+
|
|
52
|
+
## 🎯 Key Features
|
|
53
|
+
|
|
54
|
+
### Configuration-Driven
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
await PDS.start({
|
|
58
|
+
design: {
|
|
59
|
+
colors: { primary: '#007acc', secondary: '#5c2d91' },
|
|
60
|
+
typography: { baseFontSize: 16, fontScale: 1.25 },
|
|
61
|
+
spatialRhythm: { baseUnit: 8, scaleRatio: 1.5 }
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Live Mode
|
|
67
|
+
|
|
68
|
+
This Storybook runs PDS in **live mode**, meaning:
|
|
69
|
+
- Styles are generated at runtime
|
|
70
|
+
- Configuration changes apply instantly
|
|
71
|
+
- Full access to `PDS.compiled` object model
|
|
72
|
+
- Automatic font loading from Google Fonts
|
|
73
|
+
|
|
74
|
+
### Framework Agnostic
|
|
75
|
+
|
|
76
|
+
While this Storybook uses Vite + Web Components, PDS works with:
|
|
77
|
+
- Vanilla JavaScript
|
|
78
|
+
- Lit
|
|
79
|
+
- React
|
|
80
|
+
- Vue
|
|
81
|
+
- Svelte
|
|
82
|
+
- Next.js
|
|
83
|
+
|
|
84
|
+
## 🔗 Resources
|
|
85
|
+
|
|
86
|
+
- [GitHub](https://github.com/mvneerven/pure-ds)
|
|
87
|
+
- [NPM Package](https://www.npmjs.com/package/pure-ds)
|
|
88
|
+
- [Documentation](https://puredesignsystem.z6.web.core.windows.net/)
|
|
89
|
+
|
|
90
|
+
## 💡 Tips
|
|
91
|
+
|
|
92
|
+
1. **Start with Foundations** - Understand the token system first
|
|
93
|
+
2. **Experiment with Presets** - See how different designs look
|
|
94
|
+
3. **Open the Configurator** - Try changing values live
|
|
95
|
+
4. **Use Quick Search** - Find tokens and components quickly
|
|
96
|
+
5. **Check Controls** - Each story has customizable parameters
|