@carbon/ibm-products-web-components 0.3.0-canary.6 → 0.3.0-canary.60
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 +51 -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 +20 -19
- package/scss/components/side-panel/side-panel.scss +1 -1
- package/scss/components/side-panel/story-styles.scss +4 -3
- package/scss/components/tearsheet/story-styles.scss +0 -2
- package/scss/components/tearsheet/tearsheet.scss +9 -1
- package/src/components/side-panel/side-panel.mdx +1 -10
- package/src/components/side-panel/side-panel.scss +1 -1
- package/src/components/side-panel/side-panel.stories.ts +19 -19
- package/src/components/side-panel/side-panel.ts +5 -5
- package/src/components/side-panel/story-styles.scss +4 -3
- package/src/components/tearsheet/story-styles.scss +0 -2
- package/src/components/tearsheet/tearsheet.mdx +1 -9
- package/src/components/tearsheet/tearsheet.scss +9 -1
- 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,80 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import packageJson from '../../packages/ibm-products-web-components/package.json.js';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* @license
|
12
|
+
*
|
13
|
+
* Copyright IBM Corp. 2021, 2024
|
14
|
+
*
|
15
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
/* eslint-disable max-len */
|
21
|
+
|
22
|
+
/**
|
23
|
+
*
|
24
|
+
*/
|
25
|
+
/**
|
26
|
+
* Renders the component(s) script tag content and returns back the string
|
27
|
+
*
|
28
|
+
* @param {Array} components array of component names
|
29
|
+
* @param {string} tag tag folder
|
30
|
+
*/
|
31
|
+
function _renderScript(components, tag) {
|
32
|
+
let scripts = '';
|
33
|
+
components.forEach((component) => {
|
34
|
+
scripts += `<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/${tag}/${component}.min.js"></script>\n`;
|
35
|
+
});
|
36
|
+
return scripts;
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* This is the markdown block for JS via CDN
|
41
|
+
*
|
42
|
+
* @param {Array} components array of components to render
|
43
|
+
* @param components.components components to render
|
44
|
+
*/
|
45
|
+
const cdnJs = ({ components }) => {
|
46
|
+
return `
|
47
|
+
### JS (via CDN)
|
48
|
+
|
49
|
+
> NOTE: Only one version of artifacts should be used. Mixing versions will cause rendering issues.
|
50
|
+
|
51
|
+
\`\`\`html
|
52
|
+
// SPECIFIC VERSION (available starting v2.0.0)
|
53
|
+
${_renderScript(components, `version/v${packageJson.version}`)}
|
54
|
+
\`\`\`
|
55
|
+
|
56
|
+
#### Right-to-left (RTL) versions
|
57
|
+
|
58
|
+
\`\`\`html
|
59
|
+
// SPECIFIC VERSION (available starting v2.0.0)
|
60
|
+
${_renderScript(components, `version/v${packageJson.version}`)}
|
61
|
+
\`\`\`
|
62
|
+
`;
|
63
|
+
};
|
64
|
+
|
65
|
+
/**
|
66
|
+
* This is the markdown block for CSS via CDN
|
67
|
+
*/
|
68
|
+
const cdnCss = () => {
|
69
|
+
return `
|
70
|
+
### Carbon CDN style helpers (optional)
|
71
|
+
|
72
|
+
There are optional CDN artifacts available that can assist with global Carbon
|
73
|
+
styles in lieu of including into your specific application bundle.
|
74
|
+
|
75
|
+
[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
|
76
|
+
`;
|
77
|
+
};
|
78
|
+
|
79
|
+
export { cdnCss, cdnJs };
|
80
|
+
//# sourceMappingURL=storybook-cdn.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"storybook-cdn.js","sources":["../../../src/globals/internal/storybook-cdn.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2021, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport packageJson from '../../../package.json';\n\n/* eslint-disable max-len */\n\n/**\n *\n */\n/**\n * Renders the component(s) script tag content and returns back the string\n *\n * @param {Array} components array of component names\n * @param {string} tag tag folder\n */\nfunction _renderScript(components, tag) {\n let scripts = '';\n components.forEach((component) => {\n scripts += `<script type=\"module\" src=\"https://1.www.s81c.com/common/carbon/web-components/${tag}/${component}.min.js\"></script>\\n`;\n });\n return scripts;\n}\n\n/**\n * This is the markdown block for JS via CDN\n *\n * @param {Array} components array of components to render\n * @param components.components components to render\n */\nexport const cdnJs = ({ components }) => {\n return `\n### JS (via CDN)\n\n > NOTE: Only one version of artifacts should be used. Mixing versions will cause rendering issues.\n\n \\`\\`\\`html\n // SPECIFIC VERSION (available starting v2.0.0)\n ${_renderScript(components, `version/v${packageJson.version}`)}\n \\`\\`\\`\n\n #### Right-to-left (RTL) versions\n\n \\`\\`\\`html\n // SPECIFIC VERSION (available starting v2.0.0)\n ${_renderScript(components, `version/v${packageJson.version}`)}\n \\`\\`\\`\n `;\n};\n\n/**\n * This is the markdown block for CSS via CDN\n */\nexport const cdnCss = () => {\n return `\n### Carbon CDN style helpers (optional)\n\nThere are optional CDN artifacts available that can assist with global Carbon\nstyles in lieu of including into your specific application bundle.\n\n[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\n `;\n};\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE;AACxC,EAAE,IAAI,OAAO,GAAG,EAAE;AAClB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK;AACpC,IAAI,OAAO,IAAI,CAAC,+EAA+E,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,oBAAoB,CAAC;AACvI,GAAG,CAAC;AACJ,EAAE,OAAO,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,KAAK,GAAG,CAAC,EAAE,UAAU,EAAE,KAAK;AACzC,EAAE,OAAO;AACT;;AAEA;;AAEA;AACA;AACA,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/D;;AAEA;;AAEA;AACA;AACA,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/D;AACA,GAAG,CAAC;AACJ;;AAEA;AACA;AACA;AACY,MAAC,MAAM,GAAG,MAAM;AAC5B,EAAE,OAAO;AACT;;AAEA;AACA;;AAEA;AACA,EAAE,CAAC;AACH;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.js","sources":["../../src/globals/settings.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;AAMG;AAEG,MAAA,MAAM,GAAG
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../src/globals/settings.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;AAMG;AAEG,MAAA,MAAM,GAAG;AACT,MAAA,YAAY,GAAG;AAErB;;;AAGG;AACH,MAAM,gBAAgB,GAAG;IACrB,MAAM,CAAA;IACN,MAAM,CAAA;IACN,MAAM,CAAA;;;;;"}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
var name = "@carbon/ibm-products-web-components";
|
9
|
+
var description = "Carbon for IBM Products Web Components";
|
10
|
+
var version = "0.4.0";
|
11
|
+
var license = "Apache-2.0";
|
12
|
+
var main = "es/index.js";
|
13
|
+
var module = "es/index.js";
|
14
|
+
var type = "module";
|
15
|
+
var bugs = "https://github.com/carbon-design-system/ibm-products/issues";
|
16
|
+
var repository = {
|
17
|
+
type: "git",
|
18
|
+
url: "https://github.com/carbon-design-system/ibm-products.git",
|
19
|
+
directory: "packages/ibm-products-web-components"
|
20
|
+
};
|
21
|
+
var publishConfig = {
|
22
|
+
access: "public",
|
23
|
+
provenance: true
|
24
|
+
};
|
25
|
+
var exports = {
|
26
|
+
"./es/components/*": {
|
27
|
+
node: "./lib/components/*",
|
28
|
+
"default": "./es/components/*"
|
29
|
+
},
|
30
|
+
"./es/globals/*": {
|
31
|
+
node: "./lib/globals/*",
|
32
|
+
"default": "./es/globals/*"
|
33
|
+
},
|
34
|
+
"./es/*": "./es/*",
|
35
|
+
"./lib/*": "./lib/*",
|
36
|
+
"./custom-elements.json": "./custom-elements.json",
|
37
|
+
"./package.json": "./package.json"
|
38
|
+
};
|
39
|
+
var keywords = [
|
40
|
+
"carbon",
|
41
|
+
"carbon design system",
|
42
|
+
"carbon community",
|
43
|
+
"carbon for ibm products",
|
44
|
+
"carbon for ibm products web components",
|
45
|
+
"web components"
|
46
|
+
];
|
47
|
+
var scripts = {
|
48
|
+
build: "node tasks/build.js && yarn wca",
|
49
|
+
"build:storybook": "storybook build",
|
50
|
+
clean: "rimraf es lib scss dist storybook-static",
|
51
|
+
preview: "vite preview",
|
52
|
+
storybook: "storybook dev -p 3000",
|
53
|
+
test: "vitest run",
|
54
|
+
"test:ui": "vitest --ui",
|
55
|
+
wca: "web-component-analyzer analyze src --outFile custom-elements.json"
|
56
|
+
};
|
57
|
+
var dependencies = {
|
58
|
+
"@carbon/ibm-products-styles": "^2.51.0",
|
59
|
+
"@carbon/styles": "1.70.0",
|
60
|
+
"@carbon/web-components": "2.18.0",
|
61
|
+
lit: "^3.1.0"
|
62
|
+
};
|
63
|
+
var devDependencies = {
|
64
|
+
"@carbon/icons": "^11.53.0",
|
65
|
+
"@carbon/motion": "^11.24.0",
|
66
|
+
"@mordech/vite-lit-loader": "^0.35.0",
|
67
|
+
"@rollup/plugin-alias": "^5.1.1",
|
68
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
69
|
+
"@rollup/plugin-json": "^6.1.0",
|
70
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
71
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
72
|
+
"@storybook/addon-essentials": "^8.4.5",
|
73
|
+
"@storybook/addon-links": "^8.4.5",
|
74
|
+
"@storybook/addon-storysource": "^8.4.5",
|
75
|
+
"@storybook/addon-toolbars": "^8.4.5",
|
76
|
+
"@storybook/blocks": "^8.4.5",
|
77
|
+
"@storybook/theming": "^8.4.5",
|
78
|
+
"@storybook/web-components": "^8.4.5",
|
79
|
+
"@storybook/web-components-vite": "^8.4.5",
|
80
|
+
"@types/jest": "^29.5.13",
|
81
|
+
"@vitest/browser": "latest",
|
82
|
+
"@vitest/ui": "latest",
|
83
|
+
autoprefixer: "^10.4.20",
|
84
|
+
cssnano: "^7.0.6",
|
85
|
+
eslint: "^9.11.1",
|
86
|
+
"eslint-config-carbon": "3.17.1",
|
87
|
+
globby: "^14.0.2",
|
88
|
+
"happy-dom": "^15.11.6",
|
89
|
+
postcss: "^8.4.47",
|
90
|
+
"remark-gfm": "^4.0.0",
|
91
|
+
rimraf: "^5.0.5",
|
92
|
+
rollup: "^4.27.3",
|
93
|
+
"rollup-plugin-copy": "^3.5.0",
|
94
|
+
sass: "^1.80.6",
|
95
|
+
storybook: "^8.4.5",
|
96
|
+
"storybook-addon-accessibility-checker": "^3.1.61-rc.3",
|
97
|
+
typescript: "^5.5.3",
|
98
|
+
vite: "^5.4.1",
|
99
|
+
vitest: "^2.1.2",
|
100
|
+
"web-component-analyzer": "2.0.0"
|
101
|
+
};
|
102
|
+
var packageJson = {
|
103
|
+
name: name,
|
104
|
+
description: description,
|
105
|
+
version: version,
|
106
|
+
license: license,
|
107
|
+
main: main,
|
108
|
+
module: module,
|
109
|
+
type: type,
|
110
|
+
bugs: bugs,
|
111
|
+
repository: repository,
|
112
|
+
publishConfig: publishConfig,
|
113
|
+
exports: exports,
|
114
|
+
keywords: keywords,
|
115
|
+
scripts: scripts,
|
116
|
+
dependencies: dependencies,
|
117
|
+
devDependencies: devDependencies
|
118
|
+
};
|
119
|
+
|
120
|
+
export { bugs, packageJson as default, dependencies, description, devDependencies, exports, keywords, license, main, module, name, publishConfig, repository, scripts, type, version };
|
121
|
+
//# sourceMappingURL=package.json.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"defs.js","sources":["../../../src/components/side-panel/defs.ts"],"sourcesContent":[null],"names":["SIDE_PANEL_SIZE","SIDE_PANEL_PLACEMENT"],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;AAEH;;AAEG;AACSA
|
1
|
+
{"version":3,"file":"defs.js","sources":["../../../src/components/side-panel/defs.ts"],"sourcesContent":[null],"names":["SIDE_PANEL_SIZE","SIDE_PANEL_PLACEMENT"],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;AAEH;;AAEG;AACSA;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB;;AAEG;AACH,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,IAAkB;AAElB;;AAEG;AACH,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,IAAY;AAEZ;;AAEG;AACH,IAAA,eAAA,CAAA,QAAA,CAAA,GAAA,IAAa;AAEb;;AAEG;AACH,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,IAAY;AAEZ;;AAEG;AACH,IAAA,eAAA,CAAA,mBAAA,CAAA,GAAA,KAAyB;AAC3B,CAAC,EAzBWA,uBAAe,KAAfA,uBAAe,GAyB1B,EAAA,CAAA,CAAA;AAEWC;AAAZ,CAAA,UAAY,oBAAoB,EAAA;;AAE9B,IAAA,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;;AAGf,IAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EANWA,4BAAoB,KAApBA,4BAAoB,GAM/B,EAAA,CAAA,CAAA;;"}
|
@@ -338,13 +338,13 @@ declare const CDSSidePanel_base: {
|
|
338
338
|
/**
|
339
339
|
* SidePanel.
|
340
340
|
*
|
341
|
-
* @element
|
341
|
+
* @element c4p-side-panel
|
342
342
|
* @csspart dialog The dialog.
|
343
|
-
* @fires
|
343
|
+
* @fires c4p-side-panel-beingclosed
|
344
344
|
* The custom event fired before this side-panel is being closed upon a user gesture.
|
345
345
|
* Cancellation of this event stops the user-initiated action of closing this side-panel.
|
346
|
-
* @fires
|
347
|
-
* @fires
|
346
|
+
* @fires c4p-side-panel-closed - The custom event fired after this side-panel is closed upon a user gesture.
|
347
|
+
* @fires c4p-side-panel-navigate-back - custom event fired when clicking navigate back (available when step > 0)
|
348
348
|
*/
|
349
349
|
declare class CDSSidePanel extends CDSSidePanel_base {
|
350
350
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"defs.js","sources":["../../../src/components/tearsheet/defs.ts"],"sourcesContent":[null],"names":["TEARSHEET_INFLUENCER_PLACEMENT","TEARSHEET_INFLUENCER_WIDTH","TEARSHEET_WIDTH"],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;AAESA
|
1
|
+
{"version":3,"file":"defs.js","sources":["../../../src/components/tearsheet/defs.ts"],"sourcesContent":[null],"names":["TEARSHEET_INFLUENCER_PLACEMENT","TEARSHEET_INFLUENCER_WIDTH","TEARSHEET_WIDTH"],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;AAESA;AAAZ,CAAA,UAAY,8BAA8B,EAAA;;AAExC,IAAA,8BAAA,CAAA,OAAA,CAAA,GAAA,OAAe;;AAGf,IAAA,8BAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EANWA,sCAA8B,KAA9BA,sCAA8B,GAMzC,EAAA,CAAA,CAAA;AAEWC;AAAZ,CAAA,UAAY,0BAA0B,EAAA;;AAEpC,IAAA,0BAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,0BAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EALWA,kCAA0B,KAA1BA,kCAA0B,GAKrC,EAAA,CAAA,CAAA;AAEWC;AAAZ,CAAA,UAAY,eAAe,EAAA;;AAEzB,IAAA,eAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EALWA,uBAAe,KAAfA,uBAAe,GAK1B,EAAA,CAAA,CAAA;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.js","sources":["../../src/globals/settings.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;AAMG;AAEG,MAAA,MAAM,GAAG
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../src/globals/settings.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;AAMG;AAEG,MAAA,MAAM,GAAG;AACT,MAAA,YAAY,GAAG;AAErB;;;AAGG;AACH,MAAM,gBAAgB,GAAG;IACrB,MAAM,CAAA;IACN,MAAM,CAAA;IACN,MAAM,CAAA;;;;;;;"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products-web-components",
|
3
3
|
"description": "Carbon for IBM Products Web Components",
|
4
|
-
"version": "0.3.0-canary.
|
4
|
+
"version": "0.3.0-canary.60+bea9003e1",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "es/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -49,27 +49,28 @@
|
|
49
49
|
"wca": "web-component-analyzer analyze src --outFile custom-elements.json"
|
50
50
|
},
|
51
51
|
"dependencies": {
|
52
|
-
"@carbon/ibm-products-styles": "^2.50.0-canary.
|
53
|
-
"@carbon/styles": "1.
|
54
|
-
"@carbon/web-components": "2.
|
52
|
+
"@carbon/ibm-products-styles": "^2.50.0-canary.60+bea9003e1",
|
53
|
+
"@carbon/styles": "1.70.0",
|
54
|
+
"@carbon/web-components": "2.18.0",
|
55
55
|
"lit": "^3.1.0"
|
56
56
|
},
|
57
57
|
"devDependencies": {
|
58
|
-
"@carbon/icons": "^11.
|
58
|
+
"@carbon/icons": "^11.53.0",
|
59
59
|
"@carbon/motion": "^11.24.0",
|
60
60
|
"@mordech/vite-lit-loader": "^0.35.0",
|
61
61
|
"@rollup/plugin-alias": "^5.1.1",
|
62
|
-
"@rollup/plugin-commonjs": "^28.0.
|
62
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
63
|
+
"@rollup/plugin-json": "^6.1.0",
|
63
64
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
64
|
-
"@rollup/plugin-typescript": "^12.1.
|
65
|
-
"@storybook/addon-essentials": "^8.
|
66
|
-
"@storybook/addon-links": "^8.
|
67
|
-
"@storybook/addon-storysource": "^8.
|
68
|
-
"@storybook/addon-toolbars": "^8.
|
69
|
-
"@storybook/blocks": "^8.
|
70
|
-
"@storybook/theming": "^8.
|
71
|
-
"@storybook/web-components": "^8.
|
72
|
-
"@storybook/web-components-vite": "^8.
|
65
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
66
|
+
"@storybook/addon-essentials": "^8.4.5",
|
67
|
+
"@storybook/addon-links": "^8.4.5",
|
68
|
+
"@storybook/addon-storysource": "^8.4.5",
|
69
|
+
"@storybook/addon-toolbars": "^8.4.5",
|
70
|
+
"@storybook/blocks": "^8.4.5",
|
71
|
+
"@storybook/theming": "^8.4.5",
|
72
|
+
"@storybook/web-components": "^8.4.5",
|
73
|
+
"@storybook/web-components-vite": "^8.4.5",
|
73
74
|
"@types/jest": "^29.5.13",
|
74
75
|
"@vitest/browser": "latest",
|
75
76
|
"@vitest/ui": "latest",
|
@@ -78,19 +79,19 @@
|
|
78
79
|
"eslint": "^9.11.1",
|
79
80
|
"eslint-config-carbon": "3.17.1",
|
80
81
|
"globby": "^14.0.2",
|
81
|
-
"happy-dom": "^15.
|
82
|
+
"happy-dom": "^15.11.6",
|
82
83
|
"postcss": "^8.4.47",
|
83
84
|
"remark-gfm": "^4.0.0",
|
84
85
|
"rimraf": "^5.0.5",
|
85
|
-
"rollup": "^
|
86
|
+
"rollup": "^4.27.3",
|
86
87
|
"rollup-plugin-copy": "^3.5.0",
|
87
88
|
"sass": "^1.80.6",
|
88
|
-
"storybook": "^8.
|
89
|
+
"storybook": "^8.4.5",
|
89
90
|
"storybook-addon-accessibility-checker": "^3.1.61-rc.3",
|
90
91
|
"typescript": "^5.5.3",
|
91
92
|
"vite": "^5.4.1",
|
92
93
|
"vitest": "^2.1.2",
|
93
94
|
"web-component-analyzer": "2.0.0"
|
94
95
|
},
|
95
|
-
"gitHead": "
|
96
|
+
"gitHead": "bea9003e1c1dcf2f1c19ecaccd6a4096bc313d8d"
|
96
97
|
}
|
@@ -6,6 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
$css--plex: true !default;
|
9
|
+
@use 'sass:map';
|
9
10
|
|
10
11
|
/* Other Carbon settings. */
|
11
12
|
@use '@carbon/styles/scss/reset';
|
@@ -15,7 +16,6 @@ $css--plex: true !default;
|
|
15
16
|
@use '@carbon/styles/scss/theme' as *;
|
16
17
|
@use '@carbon/styles/scss/utilities/ai-gradient' as *;
|
17
18
|
@use '@carbon/styles/scss/utilities/convert' as *;
|
18
|
-
@use 'sass:map';
|
19
19
|
|
20
20
|
$prefix: 'c4p';
|
21
21
|
$carbon-prefix: 'cds';
|
@@ -5,19 +5,20 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
@use '@carbon/styles/scss/theme' as *;
|
8
|
+
@use '@carbon/styles/scss/spacing' as *;
|
8
9
|
|
9
10
|
$story-prefix: 'side-panel-stories__';
|
10
11
|
|
11
12
|
.#{$story-prefix}body-content {
|
12
13
|
display: flex;
|
13
14
|
flex-direction: column;
|
14
|
-
padding:
|
15
|
-
gap:
|
15
|
+
padding: $spacing-05;
|
16
|
+
gap: $spacing-05;
|
16
17
|
}
|
17
18
|
|
18
19
|
.#{$story-prefix}text-inputs {
|
19
20
|
display: flex;
|
20
|
-
gap:
|
21
|
+
gap: $spacing-05;
|
21
22
|
|
22
23
|
> * {
|
23
24
|
flex-basis: 50%;
|
@@ -102,6 +102,13 @@ $motion-duration: $duration-moderate-02;
|
|
102
102
|
.#{$block-class}__influencer[wide] {
|
103
103
|
@extend .#{$block-class}__influencer--wide;
|
104
104
|
}
|
105
|
+
::slotted(#{$carbon-prefix}-slug) {
|
106
|
+
display: flex;
|
107
|
+
inset-inline-end: 0;
|
108
|
+
/* stylelint-disable-next-line carbon/layout-use */
|
109
|
+
margin-block: 6px;
|
110
|
+
margin-inline-end: $spacing-05;
|
111
|
+
}
|
105
112
|
}
|
106
113
|
|
107
114
|
:host(#{$prefix}-tearsheet[open]) {
|
@@ -112,7 +119,7 @@ $motion-duration: $duration-moderate-02;
|
|
112
119
|
align-items: flex-end;
|
113
120
|
background: initial;
|
114
121
|
opacity: 1;
|
115
|
-
|
122
|
+
/* stylelint-disable-next-line */
|
116
123
|
transition: visibility 0s linear;
|
117
124
|
visibility: inherit;
|
118
125
|
|
@@ -253,6 +260,7 @@ $motion-duration: $duration-moderate-02;
|
|
253
260
|
}
|
254
261
|
|
255
262
|
.#{$block-class}__header[has-close-icon][has-slug] {
|
263
|
+
/* stylelint-disable-next-line carbon/layout-use */
|
256
264
|
padding-inline-end: calc(#{$spacing-11 + $spacing-09});
|
257
265
|
}
|
258
266
|
|
@@ -6,12 +6,6 @@ import * as SidePanelStories from './side-panel.stories';
|
|
6
6
|
|
7
7
|
# SidePanel
|
8
8
|
|
9
|
-
> 💡 Check our
|
10
|
-
> [CodeSandbox](https://codesandbox.io/s/github/carbon-design-system/carbon/tree/main/packages/web-components/examples/components/side-panel)
|
11
|
-
> example implementation.
|
12
|
-
|
13
|
-
[](https://codesandbox.io/s/github/carbon-design-system/carbon/tree/main/packages/web-components/examples/components/side-panel)
|
14
|
-
|
15
9
|
Side panels keep users in-context of a page while performing tasks like
|
16
10
|
navigating, editing, viewing details, or configuring something new.
|
17
11
|
|
@@ -22,16 +16,13 @@ Here's a quick example to get you started.
|
|
22
16
|
### JS (via import)
|
23
17
|
|
24
18
|
```javascript
|
25
|
-
import '@carbon/web-components/es/components/side-panel/index.js';
|
19
|
+
import '@carbon/ibm-products-web-components/es/components/side-panel/index.js';
|
26
20
|
// The following are used for slotted fields
|
27
21
|
import '@carbon/web-components/es/components/text-input/index.js';
|
28
22
|
import '@carbon/web-components/es/components/textarea/index.js';
|
29
23
|
import '@carbon/web-components/es/components/button/index.js';
|
30
24
|
```
|
31
25
|
|
32
|
-
<Markdown>{`${cdnJs({ components: ['side-panel'] })}`}</Markdown>
|
33
|
-
<Markdown>{`${cdnCss()}`}</Markdown>
|
34
|
-
|
35
26
|
### HTML
|
36
27
|
|
37
28
|
```html
|
@@ -6,6 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
$css--plex: true !default;
|
9
|
+
@use 'sass:map';
|
9
10
|
|
10
11
|
/* Other Carbon settings. */
|
11
12
|
@use '@carbon/styles/scss/reset';
|
@@ -15,7 +16,6 @@ $css--plex: true !default;
|
|
15
16
|
@use '@carbon/styles/scss/theme' as *;
|
16
17
|
@use '@carbon/styles/scss/utilities/ai-gradient' as *;
|
17
18
|
@use '@carbon/styles/scss/utilities/convert' as *;
|
18
|
-
@use 'sass:map';
|
19
19
|
|
20
20
|
$prefix: 'c4p';
|
21
21
|
$carbon-prefix: 'cds';
|
@@ -303,15 +303,15 @@ const getSlug = (index) => {
|
|
303
303
|
|
304
304
|
const defaultTemplate = {
|
305
305
|
args: {
|
306
|
-
actionItems:
|
307
|
-
actionToolbarItems:
|
306
|
+
actionItems: 1,
|
307
|
+
actionToolbarItems: 0,
|
308
308
|
animateTitle: true,
|
309
309
|
class: 'a-user-class',
|
310
310
|
closeIconDescription: 'Close panel',
|
311
311
|
condensedActions: false,
|
312
|
-
content:
|
312
|
+
content: 2,
|
313
313
|
includeOverlay: true,
|
314
|
-
label:
|
314
|
+
label: 2,
|
315
315
|
open: false,
|
316
316
|
placement: SIDE_PANEL_PLACEMENT.RIGHT,
|
317
317
|
preventCloseOnClickOutside: false,
|
@@ -319,8 +319,8 @@ const defaultTemplate = {
|
|
319
319
|
selectorInitialFocus: '#side-panel-story-text-input-a',
|
320
320
|
size: SIDE_PANEL_SIZE.MEDIUM,
|
321
321
|
slideIn: false,
|
322
|
-
slug:
|
323
|
-
subtitle:
|
322
|
+
slug: 0,
|
323
|
+
subtitle: 1,
|
324
324
|
title:
|
325
325
|
'This title is testing a very long title to see how this behaves with a longer title. It needs to be long enough to trigger overflow when collapsed.',
|
326
326
|
},
|
@@ -424,7 +424,7 @@ const defaultTemplate = {
|
|
424
424
|
current-step="0"
|
425
425
|
?include-overlay=${args.includeOverlay && !args.slideIn}
|
426
426
|
selector-initial-focus=${args.selectorInitialFocus}
|
427
|
-
label-text="${args.label}"
|
427
|
+
label-text="${getLabel(args.label)}"
|
428
428
|
?open=${args.open}
|
429
429
|
placement=${args.placement}
|
430
430
|
?prevent-close-on-click-outside=${args.preventCloseOnClickOutside}
|
@@ -432,23 +432,23 @@ const defaultTemplate = {
|
|
432
432
|
size=${args.size}
|
433
433
|
?slide-in=${args.slideIn}
|
434
434
|
.title=${args.title}
|
435
|
-
@
|
435
|
+
@c4p-side-panel-navigate-back=${prevStep}
|
436
436
|
>
|
437
437
|
<!-- default slotted content -->
|
438
|
-
${args.content}
|
438
|
+
${getContent(args.content)}
|
439
439
|
<cds-button @click="${nextStep}">Step two</cds-button>
|
440
440
|
|
441
441
|
<!-- slotted subtitle slotted content -->
|
442
|
-
${args.subtitle}
|
442
|
+
${getSubTitle(args.subtitle)}
|
443
443
|
|
444
444
|
<!-- slotted action toolbar cds-buttons -->
|
445
|
-
${args.actionToolbarItems}
|
445
|
+
${getActionToolbarItems(args.actionToolbarItems)}
|
446
446
|
|
447
447
|
<!-- slotted action items cds-buttons -->
|
448
|
-
${args.actionItems}
|
448
|
+
${getActionItems(args.actionItems)}
|
449
449
|
|
450
450
|
<!-- slotted slug -->
|
451
|
-
${args.slug}
|
451
|
+
${getSlug(args.slug)}
|
452
452
|
</c4p-side-panel>
|
453
453
|
`;
|
454
454
|
},
|
@@ -470,7 +470,7 @@ export const WithActionToolbar = {
|
|
470
470
|
...defaultTemplate,
|
471
471
|
args: {
|
472
472
|
...defaultTemplate.args,
|
473
|
-
actionToolbarItems:
|
473
|
+
actionToolbarItems: 1,
|
474
474
|
},
|
475
475
|
};
|
476
476
|
|
@@ -479,7 +479,7 @@ export const SpecifyElementToHaveFocus = {
|
|
479
479
|
args: {
|
480
480
|
...defaultTemplate.args,
|
481
481
|
focusSelector: '#side-panel-story-text-input-a',
|
482
|
-
label:
|
482
|
+
label: 0,
|
483
483
|
},
|
484
484
|
argTypes: {
|
485
485
|
...defaultTemplate.argTypes,
|
@@ -495,7 +495,7 @@ export const WithStaticTitle = {
|
|
495
495
|
args: {
|
496
496
|
...defaultTemplate.args,
|
497
497
|
animateTitle: false,
|
498
|
-
label:
|
498
|
+
label: 0,
|
499
499
|
},
|
500
500
|
};
|
501
501
|
|
@@ -503,9 +503,9 @@ export const WithStaticTitleAndActionToolbar = {
|
|
503
503
|
...defaultTemplate,
|
504
504
|
args: {
|
505
505
|
...defaultTemplate.args,
|
506
|
-
actionToolbarItems:
|
506
|
+
actionToolbarItems: 1,
|
507
507
|
animateTitle: false,
|
508
|
-
label:
|
508
|
+
label: 0,
|
509
509
|
},
|
510
510
|
};
|
511
511
|
|
@@ -513,7 +513,7 @@ export const WithoutTitle = {
|
|
513
513
|
...defaultTemplate,
|
514
514
|
args: {
|
515
515
|
...defaultTemplate.args,
|
516
|
-
label:
|
516
|
+
label: 0,
|
517
517
|
title: '',
|
518
518
|
},
|
519
519
|
};
|
@@ -85,13 +85,13 @@ function tryFocusElements(elements: NodeListOf<HTMLElement>, reverse: boolean) {
|
|
85
85
|
/**
|
86
86
|
* SidePanel.
|
87
87
|
*
|
88
|
-
* @element
|
88
|
+
* @element c4p-side-panel
|
89
89
|
* @csspart dialog The dialog.
|
90
|
-
* @fires
|
90
|
+
* @fires c4p-side-panel-beingclosed
|
91
91
|
* The custom event fired before this side-panel is being closed upon a user gesture.
|
92
92
|
* Cancellation of this event stops the user-initiated action of closing this side-panel.
|
93
|
-
* @fires
|
94
|
-
* @fires
|
93
|
+
* @fires c4p-side-panel-closed - The custom event fired after this side-panel is closed upon a user gesture.
|
94
|
+
* @fires c4p-side-panel-navigate-back - custom event fired when clicking navigate back (available when step > 0)
|
95
95
|
*/
|
96
96
|
@customElement(`${prefix}-side-panel`)
|
97
97
|
class CDSSidePanel extends HostListenerMixin(LitElement) {
|
@@ -913,7 +913,7 @@ class CDSSidePanel extends HostListenerMixin(LitElement) {
|
|
913
913
|
await (this.constructor as typeof CDSSidePanel)._delay();
|
914
914
|
if (focusNode) {
|
915
915
|
// For cases where a `carbon-web-components` component (e.g. `<cds-button>`) being `primaryFocusNode`,
|
916
|
-
// where its first update/render cycle that makes it focusable happens after `<
|
916
|
+
// where its first update/render cycle that makes it focusable happens after `<c4p-side-panel>`'s first update/render cycle
|
917
917
|
(focusNode as HTMLElement).focus();
|
918
918
|
} else if (
|
919
919
|
!tryFocusElements(
|
@@ -5,19 +5,20 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
@use '@carbon/styles/scss/theme' as *;
|
8
|
+
@use '@carbon/styles/scss/spacing' as *;
|
8
9
|
|
9
10
|
$story-prefix: 'side-panel-stories__';
|
10
11
|
|
11
12
|
.#{$story-prefix}body-content {
|
12
13
|
display: flex;
|
13
14
|
flex-direction: column;
|
14
|
-
padding:
|
15
|
-
gap:
|
15
|
+
padding: $spacing-05;
|
16
|
+
gap: $spacing-05;
|
16
17
|
}
|
17
18
|
|
18
19
|
.#{$story-prefix}text-inputs {
|
19
20
|
display: flex;
|
20
|
-
gap:
|
21
|
+
gap: $spacing-05;
|
21
22
|
|
22
23
|
> * {
|
23
24
|
flex-basis: 50%;
|