@pure-ds/storybook 0.4.16 → 0.4.19
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/html-preview/Panel.jsx +80 -29
- package/.storybook/addons/html-preview/preview.js +4 -5
- package/.storybook/manager.js +337 -49
- package/.storybook/preview-head.html +2 -2
- package/.storybook/preview.js +2 -2
- package/README.md +2 -2
- package/dist/pds-reference.json +1916 -267
- package/package.json +2 -2
- package/public/assets/css/app.css +2 -2
- package/public/assets/js/app.js +645 -10574
- package/public/assets/js/lit.js +3 -1048
- package/public/assets/js/pds.js +429 -7368
- package/public/assets/pds/components/pds-calendar.js +1 -1
- package/public/assets/pds/components/{pds-jsonform.js → pds-form.js} +536 -45
- package/public/assets/pds/custom-elements.json +271 -26
- package/public/assets/pds/pds-runtime-config.json +1 -1
- package/public/assets/pds/styles/pds-components.css +83 -221
- package/public/assets/pds/styles/pds-components.css.js +166 -442
- package/public/assets/pds/styles/pds-styles.css +240 -437
- package/public/assets/pds/styles/pds-styles.css.js +479 -881
- package/public/assets/pds/styles/pds-utilities.css +151 -214
- package/public/assets/pds/styles/pds-utilities.css.js +302 -428
- package/public/assets/pds/vscode-custom-data.json +63 -63
- package/scripts/build-pds-reference.mjs +112 -38
- package/scripts/generate-stories.js +2 -2
- package/src/js/common/ask.js +48 -21
- package/src/js/pds-configurator/pds-config-form.js +9 -9
- package/src/js/pds-configurator/pds-demo.js +2 -2
- package/src/js/pds-core/pds-config.js +14 -14
- package/src/js/pds-core/pds-generator.js +113 -50
- package/src/js/pds-core/pds-ontology.js +6 -6
- package/src/js/pds.d.ts +2 -2
- package/stories/GettingStarted.stories.js +3 -0
- package/stories/WhatIsPDS.stories.js +3 -0
- package/stories/components/PdsCalendar.stories.js +2 -2
- package/stories/components/PdsDrawer.stories.js +15 -15
- package/stories/components/PdsForm.stories.js +4356 -0
- package/stories/components/{PdsJsonformUiSchema.md → PdsFormUiSchema.md} +2 -2
- package/stories/components/PdsRichtext.stories.js +4 -17
- package/stories/components/PdsScrollrow.stories.js +224 -72
- package/stories/components/PdsSplitpanel.stories.js +63 -28
- package/stories/components/PdsTabstrip.stories.js +7 -7
- package/stories/enhancements/Accordion.stories.js +2 -2
- package/stories/enhancements/Dropdowns.stories.js +13 -10
- package/stories/enhancements/RangeSliders.stories.js +9 -9
- package/stories/enhancements/RequiredFields.stories.js +8 -8
- package/stories/enhancements/Toggles.stories.js +45 -36
- package/stories/enhancements/_enhancement-header.js +2 -2
- package/stories/foundations/Colors.stories.js +13 -13
- package/stories/foundations/HTMLDefaults.stories.js +4 -4
- package/stories/foundations/Icons.stories.js +123 -288
- package/stories/foundations/MeshGradients.stories.js +161 -250
- package/stories/foundations/SmartSurfaces.stories.js +147 -64
- package/stories/foundations/Spacing.stories.js +30 -30
- package/stories/foundations/Typography.stories.js +352 -723
- package/stories/foundations/ZIndex.stories.js +124 -141
- package/stories/layout/LayoutOverview.stories.js +345 -250
- package/stories/layout/LayoutSystem.stories.js +60 -76
- package/stories/patterns/InteractiveStates.stories.js +29 -29
- package/stories/patterns/Utilities.stories.js +17 -5
- package/stories/primitives/Alerts.stories.js +6 -6
- package/stories/primitives/Cards.stories.js +22 -11
- package/stories/primitives/{Forms.stories.js → FormElements.stories.js} +20 -11
- package/stories/primitives/HtmlFormElements.stories.js +128 -0
- package/stories/primitives/{FormGroups.stories.js → HtmlFormGroups.stories.js} +70 -21
- package/stories/primitives/Media.stories.js +23 -20
- package/stories/utilities/Backdrop.stories.js +68 -27
- package/stories/utils/PdsAsk.stories.js +15 -14
- 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
- package/stories/components/PdsJsonform.stories.js +0 -1929
- /package/src/{pds-core → node-api}/pds-api.js +0 -0
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
|
|
3
|
+
// Story-specific styles for backdrop demos
|
|
4
|
+
const backdropStoryStyles = html`
|
|
5
|
+
<style>
|
|
6
|
+
.story-demo-container {
|
|
7
|
+
position: relative;
|
|
8
|
+
height: 200px;
|
|
9
|
+
margin-top: var(--spacing-4);
|
|
10
|
+
border-radius: var(--radius-md);
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
.story-demo-container-sm {
|
|
14
|
+
position: relative;
|
|
15
|
+
height: 150px;
|
|
16
|
+
margin-top: var(--spacing-3);
|
|
17
|
+
border-radius: var(--radius-md);
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
.story-demo-bg {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
object-fit: cover;
|
|
24
|
+
}
|
|
25
|
+
.story-backdrop-positioned {
|
|
26
|
+
position: absolute;
|
|
27
|
+
}
|
|
28
|
+
.story-content-overlay {
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset: 0;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
z-index: 1;
|
|
35
|
+
}
|
|
36
|
+
.story-text-center {
|
|
37
|
+
text-align: center;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
`;
|
|
41
|
+
|
|
3
42
|
export default {
|
|
4
43
|
title: 'Utilities/Backdrop',
|
|
5
44
|
tags: ['layout', 'backdrop', 'modal', 'overlay', 'utilities'],
|
|
@@ -16,6 +55,7 @@ export default {
|
|
|
16
55
|
};
|
|
17
56
|
|
|
18
57
|
export const BackdropVariants = () => html`
|
|
58
|
+
${backdropStoryStyles}
|
|
19
59
|
<header class="card">
|
|
20
60
|
<h2>Backdrop Utilities</h2>
|
|
21
61
|
<p class="text-muted">
|
|
@@ -29,11 +69,11 @@ export const BackdropVariants = () => html`
|
|
|
29
69
|
<h3>Default Backdrop</h3>
|
|
30
70
|
<p>Uses theme backdrop variables with subtle blur and gradient.</p>
|
|
31
71
|
<code>.backdrop.active</code>
|
|
32
|
-
<div
|
|
33
|
-
<img src="https://picsum.photos/400/200?random=1" alt="Background"
|
|
34
|
-
<div class="backdrop active
|
|
35
|
-
<div
|
|
36
|
-
<div class="card surface-overlay
|
|
72
|
+
<div class="story-demo-container">
|
|
73
|
+
<img src="https://picsum.photos/400/200?random=1" alt="Background" class="story-demo-bg" />
|
|
74
|
+
<div class="backdrop active story-backdrop-positioned"></div>
|
|
75
|
+
<div class="story-content-overlay">
|
|
76
|
+
<div class="card surface-overlay story-text-center">
|
|
37
77
|
<p>Modal content</p>
|
|
38
78
|
</div>
|
|
39
79
|
</div>
|
|
@@ -44,11 +84,11 @@ export const BackdropVariants = () => html`
|
|
|
44
84
|
<h3>Light Backdrop</h3>
|
|
45
85
|
<p>For light-themed overlays or subtle dimming.</p>
|
|
46
86
|
<code>.backdrop.backdrop-light.active</code>
|
|
47
|
-
<div
|
|
48
|
-
<img src="https://picsum.photos/400/200?random=2" alt="Background"
|
|
49
|
-
<div class="backdrop backdrop-light active
|
|
50
|
-
<div
|
|
51
|
-
<div class="card
|
|
87
|
+
<div class="story-demo-container">
|
|
88
|
+
<img src="https://picsum.photos/400/200?random=2" alt="Background" class="story-demo-bg" />
|
|
89
|
+
<div class="backdrop backdrop-light active story-backdrop-positioned"></div>
|
|
90
|
+
<div class="story-content-overlay">
|
|
91
|
+
<div class="card story-text-center">
|
|
52
92
|
<p>Light overlay</p>
|
|
53
93
|
</div>
|
|
54
94
|
</div>
|
|
@@ -59,11 +99,11 @@ export const BackdropVariants = () => html`
|
|
|
59
99
|
<h3>Dark Backdrop</h3>
|
|
60
100
|
<p>For dramatic dimming and focus on content.</p>
|
|
61
101
|
<code>.backdrop.backdrop-dark.active</code>
|
|
62
|
-
<div
|
|
63
|
-
<img src="https://picsum.photos/400/200?random=3" alt="Background"
|
|
64
|
-
<div class="backdrop backdrop-dark active
|
|
65
|
-
<div
|
|
66
|
-
<div class="card surface-overlay
|
|
102
|
+
<div class="story-demo-container">
|
|
103
|
+
<img src="https://picsum.photos/400/200?random=3" alt="Background" class="story-demo-bg" />
|
|
104
|
+
<div class="backdrop backdrop-dark active story-backdrop-positioned"></div>
|
|
105
|
+
<div class="story-content-overlay">
|
|
106
|
+
<div class="card surface-overlay story-text-center text-inverse">
|
|
67
107
|
<p>Dark overlay</p>
|
|
68
108
|
</div>
|
|
69
109
|
</div>
|
|
@@ -75,6 +115,7 @@ export const BackdropVariants = () => html`
|
|
|
75
115
|
BackdropVariants.storyName = 'Backdrop Variants';
|
|
76
116
|
|
|
77
117
|
export const BlurLevels = () => html`
|
|
118
|
+
${backdropStoryStyles}
|
|
78
119
|
<header class="card">
|
|
79
120
|
<h2>Backdrop Blur Levels</h2>
|
|
80
121
|
<p class="text-muted">
|
|
@@ -87,10 +128,10 @@ export const BlurLevels = () => html`
|
|
|
87
128
|
<article class="card">
|
|
88
129
|
<h4>Small Blur</h4>
|
|
89
130
|
<code>.backdrop-blur-sm</code>
|
|
90
|
-
<div
|
|
91
|
-
<img src="https://picsum.photos/300/150?random=4" alt="Background"
|
|
92
|
-
<div class="backdrop backdrop-blur-sm active
|
|
93
|
-
<div
|
|
131
|
+
<div class="story-demo-container-sm">
|
|
132
|
+
<img src="https://picsum.photos/300/150?random=4" alt="Background" class="story-demo-bg" />
|
|
133
|
+
<div class="backdrop backdrop-blur-sm active story-backdrop-positioned"></div>
|
|
134
|
+
<div class="story-content-overlay">
|
|
94
135
|
<span class="badge badge-primary">5px blur</span>
|
|
95
136
|
</div>
|
|
96
137
|
</div>
|
|
@@ -99,10 +140,10 @@ export const BlurLevels = () => html`
|
|
|
99
140
|
<article class="card">
|
|
100
141
|
<h4>Medium Blur</h4>
|
|
101
142
|
<code>.backdrop-blur-md</code>
|
|
102
|
-
<div
|
|
103
|
-
<img src="https://picsum.photos/300/150?random=5" alt="Background"
|
|
104
|
-
<div class="backdrop backdrop-blur-md active
|
|
105
|
-
<div
|
|
143
|
+
<div class="story-demo-container-sm">
|
|
144
|
+
<img src="https://picsum.photos/300/150?random=5" alt="Background" class="story-demo-bg" />
|
|
145
|
+
<div class="backdrop backdrop-blur-md active story-backdrop-positioned"></div>
|
|
146
|
+
<div class="story-content-overlay">
|
|
106
147
|
<span class="badge badge-secondary">10px blur</span>
|
|
107
148
|
</div>
|
|
108
149
|
</div>
|
|
@@ -111,10 +152,10 @@ export const BlurLevels = () => html`
|
|
|
111
152
|
<article class="card">
|
|
112
153
|
<h4>Large Blur</h4>
|
|
113
154
|
<code>.backdrop-blur-lg</code>
|
|
114
|
-
<div
|
|
115
|
-
<img src="https://picsum.photos/300/150?random=6" alt="Background"
|
|
116
|
-
<div class="backdrop backdrop-blur-lg active
|
|
117
|
-
<div
|
|
155
|
+
<div class="story-demo-container-sm">
|
|
156
|
+
<img src="https://picsum.photos/300/150?random=6" alt="Background" class="story-demo-bg" />
|
|
157
|
+
<div class="backdrop backdrop-blur-lg active story-backdrop-positioned"></div>
|
|
158
|
+
<div class="story-content-overlay">
|
|
118
159
|
<span class="badge badge-info">20px blur</span>
|
|
119
160
|
</div>
|
|
120
161
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
import { ask as askFallback } from '../../../../src/js/common/ask.js';
|
|
3
3
|
import { toastFormData } from './toast-utils.js';
|
|
4
4
|
|
|
@@ -50,13 +50,13 @@ const marketingSchema = {
|
|
|
50
50
|
|
|
51
51
|
const marketingUiSchema = {
|
|
52
52
|
description: {
|
|
53
|
-
'ui:widget': '
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
'ui:widget': 'richtext'
|
|
54
|
+
},
|
|
55
|
+
emphasis: {
|
|
56
|
+
'ui:class': 'buttons'
|
|
57
57
|
},
|
|
58
58
|
audiences: {
|
|
59
|
-
'ui:
|
|
59
|
+
'ui:class': 'buttons'
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -128,7 +128,7 @@ export const BareConfirm = {
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
export const
|
|
131
|
+
export const MiniForm = {
|
|
132
132
|
name: 'Mini form submission',
|
|
133
133
|
render: () => {
|
|
134
134
|
const handleClick = async (event) => {
|
|
@@ -215,7 +215,7 @@ export const QuickConfirm = {
|
|
|
215
215
|
|
|
216
216
|
const decision = await ask(
|
|
217
217
|
html`
|
|
218
|
-
<div class="
|
|
218
|
+
<div class="stack-sm">
|
|
219
219
|
<p>This dialog comes from <code>PDS.ask()</code> and resolves with a simple boolean.</p>
|
|
220
220
|
<ul class="ask-card-list list-disc">
|
|
221
221
|
<li>Handles focus trapping and ESC cancel automatically.</li>
|
|
@@ -263,8 +263,8 @@ export const QuickConfirm = {
|
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
-
export const
|
|
267
|
-
name: 'Embed a pds-
|
|
266
|
+
export const formSubdialog = {
|
|
267
|
+
name: 'Embed a pds-form subform',
|
|
268
268
|
render: () => {
|
|
269
269
|
const handleClick = async (event) => {
|
|
270
270
|
const ask = ensureAsk();
|
|
@@ -278,19 +278,20 @@ export const JsonformSubdialog = {
|
|
|
278
278
|
const dialogResult = await ask(
|
|
279
279
|
html`
|
|
280
280
|
<form method="dialog" class="stack-md min-w-sm">
|
|
281
|
-
<pds-
|
|
281
|
+
<pds-form
|
|
282
282
|
id="spotlight-form"
|
|
283
283
|
.jsonSchema=${marketingSchema}
|
|
284
284
|
.uiSchema=${marketingUiSchema}
|
|
285
285
|
.values=${marketingInitialValues}
|
|
286
286
|
hide-actions
|
|
287
|
-
></pds-
|
|
287
|
+
></pds-form>
|
|
288
288
|
<input type="hidden" name="spotlight" value="" />
|
|
289
289
|
</form>
|
|
290
290
|
`,
|
|
291
291
|
{
|
|
292
292
|
title: 'Marketing spotlight',
|
|
293
293
|
useForm: true,
|
|
294
|
+
maxHeight: '500px',
|
|
294
295
|
buttons: {
|
|
295
296
|
ok: { name: 'Save changes', primary: true },
|
|
296
297
|
cancel: { name: 'Cancel', cancel: true }
|
|
@@ -329,7 +330,7 @@ export const JsonformSubdialog = {
|
|
|
329
330
|
});
|
|
330
331
|
|
|
331
332
|
if (typeof customElements?.whenDefined === 'function') {
|
|
332
|
-
customElements.whenDefined('pds-
|
|
333
|
+
customElements.whenDefined('pds-form').then(() => syncHidden());
|
|
333
334
|
} else {
|
|
334
335
|
syncHidden();
|
|
335
336
|
}
|
|
@@ -366,7 +367,7 @@ export const JsonformSubdialog = {
|
|
|
366
367
|
>
|
|
367
368
|
<h3>Deep editing workflows</h3>
|
|
368
369
|
<p>
|
|
369
|
-
Use <code>PDS.ask()</code> with <code>useForm: true</code> to mount an entire <code><pds-
|
|
370
|
+
Use <code>PDS.ask()</code> with <code>useForm: true</code> to mount an entire <code><pds-form></code>
|
|
370
371
|
inside the dialog. The promise resolves with the form data, letting you merge the changes into the parent flow.
|
|
371
372
|
</p>
|
|
372
373
|
<button class="btn btn-outline" @click=${handleClick}>Edit spotlight copy</button>
|