@pure-ds/storybook 0.1.2 → 0.1.4
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/default-pds.config.js +1 -0
- package/dist/pds-reference.json +1 -1
- package/package.json +3 -2
- package/public/assets/js/app.js +486 -9855
- package/public/assets/js/lit.js +3 -1048
- package/public/assets/js/pds.js +309 -6687
- package/stories/components/PdsDrawer.stories.js +19 -602
- package/stories/components/PdsIcon.stories.js +6 -22
- package/stories/components/PdsTabstrip.stories.js +26 -434
- package/stories/foundations/Colors.stories.js +75 -240
- package/stories/foundations/Icons.stories.js +177 -287
- package/stories/foundations/Spacing.stories.js +57 -161
- package/stories/foundations/Typography.stories.js +68 -945
- package/stories/primitives/Alerts.stories.js +31 -25
- package/stories/primitives/Badges.stories.js +35 -146
- package/stories/primitives/Buttons.stories.js +85 -213
- package/stories/primitives/Cards.stories.js +53 -330
- package/stories/primitives/Forms.stories.js +161 -92
- package/public/assets/js/app.js.map +0 -7
- package/public/assets/js/lit.js.map +0 -7
- package/public/assets/js/pds.js.map +0 -7
|
@@ -1,305 +1,195 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
-
import { presets } from '../../../../src/js/pds-core/pds-config.js';
|
|
3
|
-
|
|
4
|
-
const iconStoryStyles = html`
|
|
5
|
-
<style>
|
|
6
|
-
.icon-story-section {
|
|
7
|
-
padding: var(--spacing-4);
|
|
8
|
-
display: grid;
|
|
9
|
-
gap: var(--spacing-4);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.icon-story-description {
|
|
13
|
-
margin-bottom: var(--spacing-4);
|
|
14
|
-
opacity: 0.8;
|
|
15
|
-
max-width: 60ch;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.icon-story-grid {
|
|
19
|
-
display: flex;
|
|
20
|
-
gap: var(--spacing-3);
|
|
21
|
-
flex-wrap: wrap;
|
|
22
|
-
align-items: center;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.icon-story-size-grid {
|
|
26
|
-
display: grid;
|
|
27
|
-
gap: var(--spacing-4);
|
|
28
|
-
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.icon-story-size-item {
|
|
32
|
-
display: grid;
|
|
33
|
-
gap: var(--spacing-2);
|
|
34
|
-
text-align: center;
|
|
35
|
-
justify-items: center;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.icon-story-filter {
|
|
39
|
-
display: grid;
|
|
40
|
-
justify-items: center;
|
|
41
|
-
gap: var(--spacing-2);
|
|
42
|
-
margin-bottom: var(--spacing-6);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.icon-story-filter__label {
|
|
46
|
-
font-weight: 600;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.icon-story-filter__input {
|
|
50
|
-
width: 100%;
|
|
51
|
-
max-width: 400px;
|
|
52
|
-
padding: var(--spacing-3);
|
|
53
|
-
border: 1px solid var(--color-border);
|
|
54
|
-
border-radius: var(--radius-md);
|
|
55
|
-
font-size: 1rem;
|
|
56
|
-
text-align: center;
|
|
57
|
-
background: var(--color-surface);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.icon-category {
|
|
61
|
-
display: grid;
|
|
62
|
-
gap: var(--spacing-4);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.icon-category__title {
|
|
66
|
-
text-transform: capitalize;
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: baseline;
|
|
69
|
-
gap: var(--spacing-2);
|
|
70
|
-
flex-wrap: wrap;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.icon-category__count {
|
|
74
|
-
font-size: 0.85rem;
|
|
75
|
-
font-weight: normal;
|
|
76
|
-
opacity: 0.6;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.icon-category__grid {
|
|
80
|
-
display: grid;
|
|
81
|
-
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
82
|
-
gap: var(--spacing-3);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.icon-item {
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
align-items: center;
|
|
89
|
-
gap: var(--spacing-2);
|
|
90
|
-
padding: var(--spacing-3);
|
|
91
|
-
border-radius: var(--radius-sm);
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
transition: background-color 0.2s ease, color 0.2s ease;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.icon-item:hover {
|
|
97
|
-
background: var(--surface-elevated);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.icon-item--copied {
|
|
101
|
-
animation: iconItemCopied 0.4s ease;
|
|
102
|
-
background: var(--color-primary);
|
|
103
|
-
color: var(--color-surface);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.icon-item__label {
|
|
107
|
-
font-size: 0.75rem;
|
|
108
|
-
text-align: center;
|
|
109
|
-
word-break: break-word;
|
|
110
|
-
opacity: 0.8;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.icon-story-usage {
|
|
114
|
-
margin-top: var(--spacing-6);
|
|
115
|
-
display: grid;
|
|
116
|
-
gap: var(--spacing-3);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.icon-story-usage__code {
|
|
120
|
-
margin: 0;
|
|
121
|
-
padding: var(--spacing-3);
|
|
122
|
-
background: var(--surface-bg);
|
|
123
|
-
border-radius: var(--radius-sm);
|
|
124
|
-
overflow-x: auto;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@keyframes iconItemCopied {
|
|
128
|
-
0% {
|
|
129
|
-
transform: scale(1);
|
|
130
|
-
}
|
|
131
|
-
50% {
|
|
132
|
-
transform: scale(0.98);
|
|
133
|
-
}
|
|
134
|
-
100% {
|
|
135
|
-
transform: scale(1);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
</style>
|
|
139
|
-
`;
|
|
140
2
|
|
|
141
3
|
export default {
|
|
142
4
|
title: 'Foundations/Icons',
|
|
143
5
|
parameters: {
|
|
144
6
|
docs: {
|
|
145
7
|
description: {
|
|
146
|
-
component: '
|
|
8
|
+
component: 'Design tokens - colors, typography, spacing, icons'
|
|
147
9
|
}
|
|
148
10
|
}
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
preset: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['default', 'ocean-breeze', 'midnight-steel', 'sunset-vibes', 'forest-calm', 'lavender-dream'],
|
|
16
|
+
description: 'Choose a design preset'
|
|
17
|
+
},
|
|
18
|
+
primaryColor: {
|
|
19
|
+
control: 'color',
|
|
20
|
+
description: 'Override primary color'
|
|
21
|
+
},
|
|
22
|
+
secondaryColor: {
|
|
23
|
+
control: 'color',
|
|
24
|
+
description: 'Override secondary color'
|
|
25
|
+
}
|
|
149
26
|
}
|
|
150
27
|
};
|
|
151
28
|
|
|
152
|
-
export const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
<pds-icon icon="heart" size="sm"></pds-icon>
|
|
194
|
-
<small class="text-muted">sm (20px)</small>
|
|
195
|
-
</div>
|
|
196
|
-
<div class="icon-story-size-item">
|
|
197
|
-
<pds-icon icon="heart" size="md"></pds-icon>
|
|
198
|
-
<small class="text-muted">md (24px)</small>
|
|
199
|
-
</div>
|
|
200
|
-
<div class="icon-story-size-item">
|
|
201
|
-
<pds-icon icon="heart" size="lg"></pds-icon>
|
|
202
|
-
<small class="text-muted">lg (32px)</small>
|
|
203
|
-
</div>
|
|
204
|
-
<div class="icon-story-size-item">
|
|
205
|
-
<pds-icon icon="heart" size="xl"></pds-icon>
|
|
206
|
-
<small class="text-muted">xl (48px)</small>
|
|
207
|
-
</div>
|
|
208
|
-
<div class="icon-story-size-item">
|
|
209
|
-
<pds-icon icon="heart" size="2xl"></pds-icon>
|
|
210
|
-
<small class="text-muted">2xl (64px)</small>
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
</section>
|
|
214
|
-
`;
|
|
215
|
-
|
|
216
|
-
IconSizes.storyName = 'Icon Sizes';
|
|
217
|
-
|
|
218
|
-
export const AllIcons = () => {
|
|
219
|
-
const iconConfig = presets.default.icons.include;
|
|
220
|
-
|
|
221
|
-
return html`
|
|
222
|
-
${iconStoryStyles}
|
|
223
|
-
<section class="icon-story-section">
|
|
224
|
-
<div>
|
|
225
|
-
<h2>All Available Icons</h2>
|
|
226
|
-
<p class="icon-story-description">
|
|
227
|
-
Complete icon set from Phosphor Icons, organized by category. Click any icon name to copy it to clipboard.
|
|
228
|
-
</p>
|
|
229
|
-
</div>
|
|
230
|
-
|
|
231
|
-
<div class="icon-story-filter">
|
|
232
|
-
<span class="icon-story-filter__label" data-label>Filter icons</span>
|
|
233
|
-
<input
|
|
234
|
-
class="icon-story-filter__input"
|
|
235
|
-
type="search"
|
|
236
|
-
placeholder="Type to filter..."
|
|
237
|
-
@input="${(event) => {
|
|
238
|
-
const searchTerm = event.target.value.toLowerCase();
|
|
239
|
-
const storyRoot = event.target.closest('.icon-story-section');
|
|
240
|
-
const categories = storyRoot?.querySelectorAll('.icon-category');
|
|
241
|
-
|
|
242
|
-
categories?.forEach((category) => {
|
|
243
|
-
const items = category.querySelectorAll('.icon-item');
|
|
244
|
-
let visibleCount = 0;
|
|
245
|
-
|
|
246
|
-
items.forEach((item) => {
|
|
247
|
-
const iconName = item.dataset.iconName ?? '';
|
|
248
|
-
if (iconName.includes(searchTerm)) {
|
|
249
|
-
item.style.display = 'flex';
|
|
250
|
-
visibleCount += 1;
|
|
251
|
-
} else {
|
|
252
|
-
item.style.display = 'none';
|
|
253
|
-
}
|
|
254
|
-
});
|
|
29
|
+
export const Default = {
|
|
30
|
+
render: (args) => {
|
|
31
|
+
// Apply preset if changed
|
|
32
|
+
if (args.preset) {
|
|
33
|
+
import('../../../src/js/pds.js').then(({ PDS }) => {
|
|
34
|
+
PDS.applyDesign({ preset: args.preset });
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Apply color overrides
|
|
39
|
+
if (args.primaryColor || args.secondaryColor) {
|
|
40
|
+
import('../../../src/js/pds.js').then(({ PDS }) => {
|
|
41
|
+
PDS.applyDesign({
|
|
42
|
+
design: {
|
|
43
|
+
colors: {
|
|
44
|
+
primary: args.primaryColor,
|
|
45
|
+
secondary: args.secondaryColor
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
return html`
|
|
55
|
+
<div class="story-container" style="padding: 2rem;">
|
|
56
|
+
<h2>
|
|
57
|
+
<pds-icon icon="star" size="lg" class="icon-accent"></pds-icon>
|
|
58
|
+
Icon System
|
|
59
|
+
</h2>
|
|
60
|
+
|
|
61
|
+
<h3>Sizes</h3>
|
|
62
|
+
<div class="icon-sizes surface-translucent">
|
|
63
|
+
<pds-icon icon="heart" size="xs"></pds-icon>
|
|
64
|
+
<pds-icon icon="heart" size="sm"></pds-icon>
|
|
65
|
+
<pds-icon icon="heart" size="md"></pds-icon>
|
|
66
|
+
<pds-icon icon="heart" size="lg"></pds-icon>
|
|
67
|
+
<pds-icon icon="heart" size="xl"></pds-icon>
|
|
68
|
+
<pds-icon icon="heart" size="2xl"></pds-icon>
|
|
69
|
+
</div>
|
|
255
70
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
71
|
+
<h3>Semantic Colors</h3>
|
|
72
|
+
<div class="icon-colors surface-translucent">
|
|
73
|
+
<pds-icon
|
|
74
|
+
icon="check-circle"
|
|
75
|
+
class="icon-primary"
|
|
76
|
+
size="lg"
|
|
77
|
+
></pds-icon>
|
|
78
|
+
<pds-icon
|
|
79
|
+
icon="check-circle"
|
|
80
|
+
class="icon-secondary"
|
|
81
|
+
size="lg"
|
|
82
|
+
></pds-icon>
|
|
83
|
+
<pds-icon
|
|
84
|
+
icon="check-circle"
|
|
85
|
+
class="icon-accent"
|
|
86
|
+
size="lg"
|
|
87
|
+
></pds-icon>
|
|
88
|
+
<pds-icon
|
|
89
|
+
icon="check-circle"
|
|
90
|
+
class="icon-success"
|
|
91
|
+
size="lg"
|
|
92
|
+
></pds-icon>
|
|
93
|
+
<pds-icon
|
|
94
|
+
icon="warning"
|
|
95
|
+
class="icon-warning"
|
|
96
|
+
size="lg"
|
|
97
|
+
></pds-icon>
|
|
98
|
+
<pds-icon
|
|
99
|
+
icon="x-circle"
|
|
100
|
+
class="icon-danger"
|
|
101
|
+
size="lg"
|
|
102
|
+
></pds-icon>
|
|
103
|
+
<pds-icon icon="info" class="icon-info" size="lg"></pds-icon>
|
|
104
|
+
</div>
|
|
261
105
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
106
|
+
<h3>Icon with Text</h3>
|
|
107
|
+
<div class="icon-text-demo">
|
|
108
|
+
<div class="icon-text">
|
|
109
|
+
<pds-icon icon="envelope"></pds-icon>
|
|
110
|
+
<span>Email</span>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="icon-text">
|
|
113
|
+
<pds-icon icon="phone"></pds-icon>
|
|
114
|
+
<span>Phone</span>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="icon-text">
|
|
117
|
+
<pds-icon icon="user"></pds-icon>
|
|
118
|
+
<span>Profile</span>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="icon-text">
|
|
121
|
+
<pds-icon icon="calendar"></pds-icon>
|
|
122
|
+
<span>Schedule</span>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
269
125
|
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
setTimeout(() => {
|
|
281
|
-
target.classList.remove('icon-item--copied');
|
|
282
|
-
}, 200);
|
|
283
|
-
}}"
|
|
284
|
-
>
|
|
285
|
-
<pds-icon icon="${icon}" size="lg"></pds-icon>
|
|
286
|
-
<span class="icon-item__label">${icon}</span>
|
|
287
|
-
</div>
|
|
288
|
-
`
|
|
289
|
-
)}
|
|
126
|
+
<h3>Inputs with Icons</h3>
|
|
127
|
+
<div class="input-icon-demo">
|
|
128
|
+
<div class="input-icon">
|
|
129
|
+
<pds-icon icon="magnifying-glass"></pds-icon>
|
|
130
|
+
<input type="search" placeholder="Search..." />
|
|
131
|
+
</div>
|
|
132
|
+
<div class="input-icon input-icon-end">
|
|
133
|
+
<input type="text" placeholder="Username" />
|
|
134
|
+
<pds-icon icon="user"></pds-icon>
|
|
135
|
+
</div>
|
|
290
136
|
</div>
|
|
291
|
-
</article>
|
|
292
|
-
`
|
|
293
|
-
)}
|
|
294
137
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
138
|
+
<h3>Common Icons</h3>
|
|
139
|
+
<div class="icon-grid surface-translucent">
|
|
140
|
+
<div class="icon-grid-item">
|
|
141
|
+
<pds-icon icon="house" size="lg"></pds-icon>
|
|
142
|
+
<span class="icon-grid-label">house</span>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="icon-grid-item">
|
|
145
|
+
<pds-icon icon="gear" size="lg"></pds-icon>
|
|
146
|
+
<span class="icon-grid-label">gear</span>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="icon-grid-item">
|
|
149
|
+
<pds-icon icon="bell" size="lg"></pds-icon>
|
|
150
|
+
<span class="icon-grid-label">bell</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="icon-grid-item">
|
|
153
|
+
<pds-icon icon="heart" size="lg"></pds-icon>
|
|
154
|
+
<span class="icon-grid-label">heart</span>
|
|
155
|
+
</div>
|
|
156
|
+
<div class="icon-grid-item">
|
|
157
|
+
<pds-icon icon="star" size="lg"></pds-icon>
|
|
158
|
+
<span class="icon-grid-label">star</span>
|
|
159
|
+
</div>
|
|
160
|
+
<div class="icon-grid-item">
|
|
161
|
+
<pds-icon icon="trash" size="lg"></pds-icon>
|
|
162
|
+
<span class="icon-grid-label">trash</span>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="icon-grid-item">
|
|
165
|
+
<pds-icon icon="pencil" size="lg"></pds-icon>
|
|
166
|
+
<span class="icon-grid-label">pencil</span>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="icon-grid-item">
|
|
169
|
+
<pds-icon icon="check" size="lg"></pds-icon>
|
|
170
|
+
<span class="icon-grid-label">check</span>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="icon-grid-item">
|
|
173
|
+
<pds-icon icon="x" size="lg"></pds-icon>
|
|
174
|
+
<span class="icon-grid-label">x</span>
|
|
175
|
+
</div>
|
|
176
|
+
<div class="icon-grid-item">
|
|
177
|
+
<pds-icon icon="plus" size="lg"></pds-icon>
|
|
178
|
+
<span class="icon-grid-label">plus</span>
|
|
179
|
+
</div>
|
|
180
|
+
<div class="icon-grid-item">
|
|
181
|
+
<pds-icon icon="minus" size="lg"></pds-icon>
|
|
182
|
+
<span class="icon-grid-label">minus</span>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="icon-grid-item">
|
|
185
|
+
<pds-icon icon="download" size="lg"></pds-icon>
|
|
186
|
+
<span class="icon-grid-label">download</span>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
`;
|
|
191
|
+
},
|
|
192
|
+
args: {
|
|
193
|
+
preset: 'default'
|
|
194
|
+
}
|
|
303
195
|
};
|
|
304
|
-
|
|
305
|
-
AllIcons.storyName = 'All Icons';
|