@pure-ds/storybook 0.5.48 → 0.5.50
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/description/register.js +60 -61
- package/.storybook/addons/html-preview/preview.js +418 -426
- package/.storybook/addons/html-preview/register.js +16 -41
- package/.storybook/addons/pds-configurator/SearchTool.js +12 -14
- package/.storybook/addons/pds-configurator/Tool.js +11 -15
- package/.storybook/addons/pds-configurator/register.js +4 -3
- package/.storybook/main.js +4 -35
- package/.storybook/manager.js +866 -874
- package/.storybook/preview.js +22 -2
- package/bin/index.js +135 -135
- package/dist/pds-reference.json +70 -41
- package/package.json +2 -2
- package/public/assets/js/app.js +12 -12
- package/public/assets/js/lit.js +3 -3
- package/public/assets/js/pds-manager.js +4 -4
- package/public/assets/js/pds.js +6 -6
- package/public/assets/pds/core/pds-manager.js +4 -4
- package/public/assets/pds/external/lit.js +3 -3
- package/src/js/common/common.js +112 -123
- package/src/js/lit.js +93 -40
- package/src/js/pds.js +0 -22
- package/stories/components/PdsFab.stories.js +625 -617
- package/stories/getting-started.md +194 -196
- package/stories/reference/reference-helpers.js +278 -278
- package/stories/utilities/Backdrop.stories.js +238 -238
- package/stories/utils/PdsAsk.stories.js +5 -18
- package/stories/utils/PdsParse.stories.js +1 -1
- package/stories/utils/PdsToast.stories.js +1 -1
- package/.storybook/addons/description/register.cjs +0 -61
- package/.storybook/addons/html-preview/constants.cjs +0 -12
- package/.storybook/addons/html-preview/register.cjs +0 -41
- package/.storybook/addons/package.json +0 -3
- package/.storybook/addons/pds-configurator/SearchTool.cjs +0 -47
- package/.storybook/addons/pds-configurator/Tool.cjs +0 -36
- package/.storybook/addons/pds-configurator/constants.cjs +0 -16
- package/.storybook/addons/pds-configurator/register.cjs +0 -12
- package/public/assets/pds/external/lit-lazy-props.js +0 -47
- package/public/assets/pds/external/lit-msg.js +0 -1
- package/src/js/lit-lazy-props.js +0 -54
- package/src/js/lit-msg.js +0 -1
- package/stories/utils/PdsRuntime.stories.js +0 -312
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const ADDON_ID = 'pds-description';
|
|
7
|
-
const PANEL_ID = `${ADDON_ID}/panel`;
|
|
8
|
-
|
|
9
|
-
const DescriptionPanel = () => {
|
|
10
|
-
const [description, setDescription] =
|
|
11
|
-
const [title, setTitle] =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const channel = addons.getChannel();
|
|
15
|
-
|
|
16
|
-
const updateDescription = (data) => {
|
|
17
|
-
setTitle(data.title || '');
|
|
18
|
-
setDescription(data.description || 'No description available.');
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
channel.on('pds-description/update', updateDescription);
|
|
22
|
-
|
|
23
|
-
return () => {
|
|
24
|
-
channel.removeListener('pds-description/update', updateDescription);
|
|
25
|
-
};
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
return React.createElement(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
React.createElement(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
),
|
|
46
|
-
React.createElement(Markdown, null, description)
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
addons.register(ADDON_ID, () => {
|
|
51
|
-
addons.add(PANEL_ID, {
|
|
52
|
-
type: types.PANEL,
|
|
53
|
-
title: 'Description',
|
|
54
|
-
render: ({ active }) =>
|
|
55
|
-
React.createElement(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
1
|
+
import { addons, types } from '@storybook/manager-api';
|
|
2
|
+
import { AddonPanel } from '@storybook/components';
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import { Markdown } from '@storybook/blocks';
|
|
5
|
+
|
|
6
|
+
const ADDON_ID = 'pds-description';
|
|
7
|
+
const PANEL_ID = `${ADDON_ID}/panel`;
|
|
8
|
+
|
|
9
|
+
const DescriptionPanel = () => {
|
|
10
|
+
const [description, setDescription] = useState('');
|
|
11
|
+
const [title, setTitle] = useState('');
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const channel = addons.getChannel();
|
|
15
|
+
|
|
16
|
+
const updateDescription = (data) => {
|
|
17
|
+
setTitle(data.title || '');
|
|
18
|
+
setDescription(data.description || 'No description available.');
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
channel.on('pds-description/update', updateDescription);
|
|
22
|
+
|
|
23
|
+
return () => {
|
|
24
|
+
channel.removeListener('pds-description/update', updateDescription);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
return React.createElement('div', {
|
|
29
|
+
style: {
|
|
30
|
+
padding: '1rem',
|
|
31
|
+
height: '100%',
|
|
32
|
+
overflow: 'auto'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
React.createElement('div', {
|
|
36
|
+
style: {
|
|
37
|
+
marginBottom: '0.5rem'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
React.createElement('strong', {
|
|
41
|
+
style: {
|
|
42
|
+
fontSize: '1rem'
|
|
43
|
+
}
|
|
44
|
+
}, title)
|
|
45
|
+
),
|
|
46
|
+
React.createElement(Markdown, null, description)
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
addons.register(ADDON_ID, () => {
|
|
51
|
+
addons.add(PANEL_ID, {
|
|
52
|
+
type: types.PANEL,
|
|
53
|
+
title: 'Description',
|
|
54
|
+
render: ({ active }) => {
|
|
55
|
+
return React.createElement(AddonPanel, { active },
|
|
56
|
+
React.createElement(DescriptionPanel)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|