@pure-ds/storybook 0.4.14 → 0.4.16
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 +4 -3
- package/.storybook/addons/html-preview/preview.js +27 -1
- package/.storybook/docs.css +7 -0
- package/.storybook/htmlPreview.css +6 -6
- package/.storybook/htmlPreview.js +27 -1
- package/.storybook/manager-head.html +13 -0
- package/.storybook/preview-head.html +5 -0
- package/.storybook/preview.js +1 -1
- package/dist/pds-reference.json +1 -1
- package/package.json +2 -2
- package/public/assets/js/app.js +10430 -434
- package/public/assets/js/app.js.map +7 -0
- package/public/assets/js/lit.js +1048 -3
- package/public/assets/js/lit.js.map +7 -0
- package/public/assets/js/pds.js +7315 -309
- package/public/assets/js/pds.js.map +7 -0
- package/src/js/pds-configurator/pds-demo.js +11 -1
- package/src/js/pds-core/pds-generator.js +1 -1
|
@@ -16,9 +16,9 @@ const CodeBlock = styled.pre`
|
|
|
16
16
|
margin: 0;
|
|
17
17
|
padding: 16px;
|
|
18
18
|
padding-bottom: ${props => (props.$compact ? '24px' : '60px')}; /* Space for fixed button */
|
|
19
|
-
font-family:
|
|
20
|
-
font-size:
|
|
21
|
-
line-height:
|
|
19
|
+
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
|
|
20
|
+
font-size: 13.6px;
|
|
21
|
+
line-height: 24px;
|
|
22
22
|
color: ${props => props.theme.color.defaultText};
|
|
23
23
|
background: transparent;
|
|
24
24
|
tab-size: 2;
|
|
@@ -32,6 +32,7 @@ const CodeBlock = styled.pre`
|
|
|
32
32
|
|
|
33
33
|
.shiki code {
|
|
34
34
|
background: transparent;
|
|
35
|
+
font-family: inherit !important;
|
|
35
36
|
}
|
|
36
37
|
`;
|
|
37
38
|
|
|
@@ -59,6 +59,29 @@ function extractHTML(element) {
|
|
|
59
59
|
return clone.innerHTML || '';
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Strip Lit template comments from rendered HTML
|
|
64
|
+
* Removes markers like <!--?lit$641514976$-->, <!---->, etc.
|
|
65
|
+
*/
|
|
66
|
+
function stripLitComments(html) {
|
|
67
|
+
if (!html) return '';
|
|
68
|
+
|
|
69
|
+
// Remove Lit binding markers: <!--?lit$...$-->
|
|
70
|
+
html = html.replace(/<!--\?lit\$[^$]+\$-->/g, '');
|
|
71
|
+
|
|
72
|
+
// Remove empty Lit comments: <!---->
|
|
73
|
+
html = html.replace(/<!---->/g, '');
|
|
74
|
+
|
|
75
|
+
// Remove Lit template marker comments: <!--lit-part...-->
|
|
76
|
+
html = html.replace(/<!--lit-part[^>]*-->/g, '');
|
|
77
|
+
html = html.replace(/<!--\/lit-part-->/g, '');
|
|
78
|
+
|
|
79
|
+
// Clean up any resulting multiple whitespace/newlines
|
|
80
|
+
html = html.replace(/\n\s*\n\s*\n/g, '\n\n');
|
|
81
|
+
|
|
82
|
+
return html;
|
|
83
|
+
}
|
|
84
|
+
|
|
62
85
|
/**
|
|
63
86
|
* Transform Lit template result to HTML string
|
|
64
87
|
*/
|
|
@@ -72,7 +95,10 @@ async function litToHTML(templateResult) {
|
|
|
72
95
|
|
|
73
96
|
await new Promise(resolve => setTimeout(resolve, 50));
|
|
74
97
|
|
|
75
|
-
|
|
98
|
+
// Strip Lit comments before formatting
|
|
99
|
+
const cleanedHTML = stripLitComments(temp.innerHTML);
|
|
100
|
+
|
|
101
|
+
return formatHTML(cleanedHTML);
|
|
76
102
|
}
|
|
77
103
|
|
|
78
104
|
function serializeForDisplay(value) {
|
package/.storybook/docs.css
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/* Custom Docs page styling - hide all examples, show only description */
|
|
2
2
|
|
|
3
|
+
/* Override Storybook's default mono font for code panels */
|
|
4
|
+
pre, code, .docblock-source pre, .docblock-source code {
|
|
5
|
+
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
|
|
6
|
+
font-size: 13.6px;
|
|
7
|
+
line-height: 24px;
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
/* Hide ALL story previews and interactive elements in Docs */
|
|
4
11
|
.docs-story,
|
|
5
12
|
.sbdocs-preview,
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
padding: var(--spacing-4, 1rem);
|
|
40
40
|
border-radius: var(--radius-md, 4px);
|
|
41
41
|
overflow-x: auto;
|
|
42
|
-
font-size:
|
|
43
|
-
line-height:
|
|
42
|
+
font-size: 13.6px;
|
|
43
|
+
line-height: 24px;
|
|
44
44
|
tab-size: 2;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.html-source-content pre code {
|
|
48
|
-
font-family: '
|
|
48
|
+
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/* Fallback pre styling (before Shiki loads) */
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
padding: var(--spacing-4, 1rem);
|
|
55
55
|
border-radius: var(--radius-md, 4px);
|
|
56
56
|
overflow-x: auto;
|
|
57
|
-
font-family: '
|
|
58
|
-
font-size:
|
|
59
|
-
line-height:
|
|
57
|
+
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
58
|
+
font-size: 13.6px;
|
|
59
|
+
line-height: 24px;
|
|
60
60
|
tab-size: 2;
|
|
61
61
|
background: var(--color-surface-raised, #282c34);
|
|
62
62
|
color: var(--color-text-primary, #abb2bf);
|
|
@@ -67,6 +67,29 @@ export function extractHTML(element) {
|
|
|
67
67
|
return clone.innerHTML || '';
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Strip Lit template comments from rendered HTML
|
|
72
|
+
* Removes markers like <!--?lit$641514976$-->, <!---->, etc.
|
|
73
|
+
*/
|
|
74
|
+
export function stripLitComments(html) {
|
|
75
|
+
if (!html) return '';
|
|
76
|
+
|
|
77
|
+
// Remove Lit binding markers: <!--?lit$...$-->
|
|
78
|
+
html = html.replace(/<!--\?lit\$[^$]+\$-->/g, '');
|
|
79
|
+
|
|
80
|
+
// Remove empty Lit comments: <!---->
|
|
81
|
+
html = html.replace(/<!---->/g, '');
|
|
82
|
+
|
|
83
|
+
// Remove Lit template marker comments: <!--lit-part...-->
|
|
84
|
+
html = html.replace(/<!--lit-part[^>]*-->/g, '');
|
|
85
|
+
html = html.replace(/<!--\/lit-part-->/g, '');
|
|
86
|
+
|
|
87
|
+
// Clean up any resulting multiple whitespace/newlines
|
|
88
|
+
html = html.replace(/\n\s*\n\s*\n/g, '\n\n');
|
|
89
|
+
|
|
90
|
+
return html;
|
|
91
|
+
}
|
|
92
|
+
|
|
70
93
|
/**
|
|
71
94
|
* Transform Lit template result to HTML string
|
|
72
95
|
*/
|
|
@@ -81,7 +104,10 @@ export async function litToHTML(templateResult) {
|
|
|
81
104
|
// Wait for any custom elements to upgrade
|
|
82
105
|
await new Promise(resolve => setTimeout(resolve, 50));
|
|
83
106
|
|
|
84
|
-
|
|
107
|
+
// Strip Lit comments before formatting
|
|
108
|
+
const cleanedHTML = stripLitComments(temp.innerHTML);
|
|
109
|
+
|
|
110
|
+
return formatHTML(cleanedHTML);
|
|
85
111
|
}
|
|
86
112
|
|
|
87
113
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Source Code Pro font for code panel readability (like React.dev) -->
|
|
2
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
3
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
4
|
+
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap" rel="stylesheet">
|
|
5
|
+
|
|
6
|
+
<!-- Override Storybook's default monospace font in the manager frame -->
|
|
7
|
+
<style>
|
|
8
|
+
pre, code, .docblock-source pre, .docblock-source code {
|
|
9
|
+
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
|
|
10
|
+
font-size: 13.6px;
|
|
11
|
+
line-height: 24px;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<!-- PDS runs in LIVE mode - styles are generated dynamically by Generator.applyStyles() -->
|
|
2
2
|
|
|
3
|
+
<!-- Source Code Pro font for code readability (like React.dev) -->
|
|
4
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
5
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
6
|
+
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap" rel="stylesheet">
|
|
7
|
+
|
|
3
8
|
<!-- Import map for pds-jsonform and other components that use #pds/lit -->
|
|
4
9
|
<script type="importmap">
|
|
5
10
|
{
|
package/.storybook/preview.js
CHANGED
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.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "Storybook showcase for Pure Design System with live configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"pds:build-icons": "pds-build-icons"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@pure-ds/core": "^0.4.
|
|
40
|
+
"@pure-ds/core": "^0.4.16"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|