@carbon/ibm-products-web-components 0.3.0 → 0.4.0-rc.0
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/main.ts +13 -5
- package/CHANGELOG.md +13 -0
- package/es/components/side-panel/defs.js.map +1 -1
- package/es/components/side-panel/side-panel.d.ts +4 -4
- package/es/components/side-panel/side-panel.js +9 -18
- package/es/components/side-panel/side-panel.js.map +1 -1
- package/es/components/side-panel/side-panel.scss.js +1 -1
- package/es/components/side-panel/side-panel.test.js.map +1 -1
- package/es/components/tearsheet/defs.js.map +1 -1
- package/es/components/tearsheet/tearsheet.js +5 -14
- package/es/components/tearsheet/tearsheet.js.map +1 -1
- package/es/components/tearsheet/tearsheet.scss.js +1 -1
- package/es/components/tearsheet/tearsheet.test.js.map +1 -1
- package/es/globals/internal/storybook-cdn.js +80 -0
- package/es/globals/internal/storybook-cdn.js.map +1 -0
- package/es/globals/settings.js.map +1 -1
- package/es/packages/ibm-products-web-components/package.json.js +121 -0
- package/es/packages/ibm-products-web-components/package.json.js.map +1 -0
- package/lib/components/side-panel/defs.js.map +1 -1
- package/lib/components/side-panel/side-panel.d.ts +4 -4
- package/lib/components/tearsheet/defs.js.map +1 -1
- package/lib/globals/settings.js.map +1 -1
- package/package.json +11 -10
- package/scss/components/tearsheet/tearsheet.scss +6 -0
- package/src/components/side-panel/side-panel.mdx +1 -10
- package/src/components/side-panel/side-panel.stories.ts +1 -1
- package/src/components/side-panel/side-panel.ts +5 -5
- package/src/components/tearsheet/tearsheet.mdx +1 -9
- package/src/components/tearsheet/tearsheet.scss +6 -0
- package/src/components/tearsheet/tearsheet.stories.ts +52 -41
- package/src/components/tearsheet/tearsheet.ts +1 -1
- package/src/globals/internal/storybook-cdn.ts +69 -0
- package/tasks/build.js +2 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
*
|
4
|
+
* Copyright IBM Corp. 2021, 2024
|
5
|
+
*
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
8
|
+
*/
|
9
|
+
|
10
|
+
import packageJson from '../../../package.json';
|
11
|
+
|
12
|
+
/* eslint-disable max-len */
|
13
|
+
|
14
|
+
/**
|
15
|
+
*
|
16
|
+
*/
|
17
|
+
/**
|
18
|
+
* Renders the component(s) script tag content and returns back the string
|
19
|
+
*
|
20
|
+
* @param {Array} components array of component names
|
21
|
+
* @param {string} tag tag folder
|
22
|
+
*/
|
23
|
+
function _renderScript(components, tag) {
|
24
|
+
let scripts = '';
|
25
|
+
components.forEach((component) => {
|
26
|
+
scripts += `<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/${tag}/${component}.min.js"></script>\n`;
|
27
|
+
});
|
28
|
+
return scripts;
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* This is the markdown block for JS via CDN
|
33
|
+
*
|
34
|
+
* @param {Array} components array of components to render
|
35
|
+
* @param components.components components to render
|
36
|
+
*/
|
37
|
+
export const cdnJs = ({ components }) => {
|
38
|
+
return `
|
39
|
+
### JS (via CDN)
|
40
|
+
|
41
|
+
> NOTE: Only one version of artifacts should be used. Mixing versions will cause rendering issues.
|
42
|
+
|
43
|
+
\`\`\`html
|
44
|
+
// SPECIFIC VERSION (available starting v2.0.0)
|
45
|
+
${_renderScript(components, `version/v${packageJson.version}`)}
|
46
|
+
\`\`\`
|
47
|
+
|
48
|
+
#### Right-to-left (RTL) versions
|
49
|
+
|
50
|
+
\`\`\`html
|
51
|
+
// SPECIFIC VERSION (available starting v2.0.0)
|
52
|
+
${_renderScript(components, `version/v${packageJson.version}`)}
|
53
|
+
\`\`\`
|
54
|
+
`;
|
55
|
+
};
|
56
|
+
|
57
|
+
/**
|
58
|
+
* This is the markdown block for CSS via CDN
|
59
|
+
*/
|
60
|
+
export const cdnCss = () => {
|
61
|
+
return `
|
62
|
+
### Carbon CDN style helpers (optional)
|
63
|
+
|
64
|
+
There are optional CDN artifacts available that can assist with global Carbon
|
65
|
+
styles in lieu of including into your specific application bundle.
|
66
|
+
|
67
|
+
[Click here to learn more](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/main/packages/web-components/docs/carbon-cdn-style-helpers.md)\n\n
|
68
|
+
`;
|
69
|
+
};
|
package/tasks/build.js
CHANGED
@@ -22,6 +22,7 @@ import nodeResolve from '@rollup/plugin-node-resolve';
|
|
22
22
|
import path from 'path';
|
23
23
|
import postcss from 'postcss';
|
24
24
|
import typescript from '@rollup/plugin-typescript';
|
25
|
+
import json from '@rollup/plugin-json';
|
25
26
|
|
26
27
|
import * as packageJson from '../package.json' assert { type: 'json' };
|
27
28
|
|
@@ -125,6 +126,7 @@ function getRollupConfig(input, rootDir, outDir, iconInput) {
|
|
125
126
|
targets: [{ src: 'src/components/**/*.scss', dest: 'scss' }],
|
126
127
|
flatten: false,
|
127
128
|
}),
|
129
|
+
[json()],
|
128
130
|
nodeResolve({
|
129
131
|
browser: true,
|
130
132
|
mainFields: ['jsnext', 'module', 'main'],
|