@carbon/ibm-products-web-components 0.31.0-rc.0 → 0.32.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/custom-elements.json +414 -5
- package/es/components/about-modal/about-modal.scss.js +1 -1
- package/es/components/big-number/big-number-skeleton.d.ts +22 -0
- package/es/components/big-number/big-number-skeleton.js +56 -0
- package/es/components/big-number/big-number-skeleton.js.map +1 -0
- package/es/components/big-number/big-number-skeleton.scss.js +13 -0
- package/es/components/big-number/big-number-skeleton.scss.js.map +1 -0
- package/es/components/big-number/big-number.d.ts +37 -0
- package/es/components/big-number/big-number.js +184 -0
- package/es/components/big-number/big-number.js.map +1 -0
- package/es/components/big-number/big-number.scss.js +13 -0
- package/es/components/big-number/big-number.scss.js.map +1 -0
- package/es/{utilities/carousel/index.d.ts → components/big-number/big-number.test.d.ts} +1 -2
- package/es/components/big-number/big-number.test.js +113 -0
- package/es/components/big-number/big-number.test.js.map +1 -0
- package/es/components/big-number/constants.d.ts +19 -0
- package/es/components/big-number/constants.js +30 -0
- package/es/components/big-number/constants.js.map +1 -0
- package/es/components/big-number/index.d.ts +10 -0
- package/es/{node_modules/@carbon/utilities/es/dateTimeFormat → components/big-number}/index.js +2 -5
- package/es/components/big-number/index.js.map +1 -0
- package/es/components/checklist/checklist.scss.js +1 -1
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts +422 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.js +135 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.js.map +1 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js +13 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js.map +1 -0
- package/es/{utilities/carousel/types.js → components/coachmark/coachmark-tagline/coachmark-tagline.test.d.ts} +4 -3
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.test.js +126 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.test.js.map +1 -0
- package/es/components/coachmark/coachmark-tagline/index.d.ts +9 -0
- package/{es-custom/utilities/carousel → es/components/coachmark/coachmark-tagline}/index.js +1 -1
- package/es/components/coachmark/coachmark-tagline/index.js.map +1 -0
- package/es/components/guide-banner/guide-banner-element.d.ts +7 -0
- package/es/components/guide-banner/guide-banner-element.js +14 -0
- package/es/components/guide-banner/guide-banner-element.js.map +1 -1
- package/es/components/guide-banner/guide-banner-element.scss.js +13 -0
- package/es/components/guide-banner/guide-banner-element.scss.js.map +1 -0
- package/es/components/guide-banner/guide-banner-element.test.d.ts +7 -0
- package/es/components/guide-banner/guide-banner-element.test.js +58 -0
- package/es/components/guide-banner/guide-banner-element.test.js.map +1 -0
- package/es/components/guide-banner/guide-banner.d.ts +4 -4
- package/es/components/guide-banner/guide-banner.js +4 -4
- package/es/components/guide-banner/guide-banner.js.map +1 -1
- package/es/components/guide-banner/guide-banner.scss.js +1 -1
- package/es/components/guide-banner/guide-banner.test.d.ts +6 -0
- package/es/components/guide-banner/guide-banner.test.js +3 -3
- package/es/components/guide-banner/guide-banner.test.js.map +1 -1
- package/es/components/interstitial-screen/interstitial-screen-body-item.scss.js +1 -1
- package/es/components/interstitial-screen/interstitial-screen-body.d.ts +1 -0
- package/es/components/interstitial-screen/interstitial-screen-body.js +16 -4
- package/es/components/interstitial-screen/interstitial-screen-body.js.map +1 -1
- package/es/components/interstitial-screen/interstitial-screen-body.scss.js +1 -1
- package/es/components/interstitial-screen/interstitial-screen-context.d.ts +1 -0
- package/es/components/interstitial-screen/interstitial-screen-context.js +5 -0
- package/es/components/interstitial-screen/interstitial-screen-context.js.map +1 -1
- package/es/components/interstitial-screen/interstitial-screen.js +15 -0
- package/es/components/interstitial-screen/interstitial-screen.js.map +1 -1
- package/es/components/interstitial-screen/interstitial-screen.test.js +11 -0
- package/es/components/interstitial-screen/interstitial-screen.test.js.map +1 -1
- package/es/components/interstitial-screen/interstitial.figma.js +288 -0
- package/es/components/interstitial-screen/interstitial.figma.js.map +1 -0
- package/es/components/notification-panel/notification.js +2 -3
- package/es/components/notification-panel/notification.js.map +1 -1
- package/es/components/notification-panel/notification.test.js +2 -3
- package/es/components/notification-panel/notification.test.js.map +1 -1
- package/es/components/page-header/_story-assets/set-of-breadcrumbs.scss.js +1 -1
- package/es/components/page-header/_story-assets/set-of-tags/set-of-tags.js +2 -3
- package/es/components/page-header/_story-assets/set-of-tags/set-of-tags.js.map +1 -1
- package/es/components/page-header/_story-assets/set-of-tags/set-of-tags.scss.js +1 -1
- package/es/components/page-header/utils.js +17 -5
- package/es/components/page-header/utils.js.map +1 -1
- package/es/components/side-panel/side-panel.figma.js +229 -0
- package/es/components/side-panel/side-panel.figma.js.map +1 -0
- package/es/components/tearsheet/tearsheet.d.ts +33 -14
- package/es/components/tearsheet/tearsheet.js +65 -98
- package/es/components/tearsheet/tearsheet.js.map +1 -1
- package/es/components/tearsheet/tearsheet.scss.js +1 -1
- package/es/index.d.ts +4 -1
- package/es/index.js +3 -0
- package/es/index.js.map +1 -1
- package/es/packages/ibm-products-web-components/package.json.js +1 -1
- package/es/utilities/snapscroll/index.d.ts +7 -0
- package/es/utilities/snapscroll/index.js +9 -0
- package/es/utilities/snapscroll/index.js.map +1 -0
- package/es/utilities/snapscroll/snapscroll.d.ts +29 -0
- package/es/utilities/snapscroll/snapscroll.js +134 -0
- package/es/utilities/snapscroll/snapscroll.js.map +1 -0
- package/es/utilities/snapscroll/snapscroll.test.d.ts +1 -0
- package/es/utilities/snapscroll/snapscroll.test.js +41 -0
- package/es/utilities/snapscroll/snapscroll.test.js.map +1 -0
- package/es-custom/components/about-modal/about-modal.scss.js +1 -1
- package/es-custom/components/big-number/big-number-skeleton.d.ts +22 -0
- package/es-custom/components/big-number/big-number-skeleton.js +56 -0
- package/es-custom/components/big-number/big-number-skeleton.js.map +1 -0
- package/es-custom/components/big-number/big-number-skeleton.scss.js +13 -0
- package/es-custom/components/big-number/big-number-skeleton.scss.js.map +1 -0
- package/es-custom/components/big-number/big-number.d.ts +37 -0
- package/es-custom/components/big-number/big-number.js +184 -0
- package/es-custom/components/big-number/big-number.js.map +1 -0
- package/es-custom/components/big-number/big-number.scss.js +13 -0
- package/es-custom/components/big-number/big-number.scss.js.map +1 -0
- package/{lib/utilities/carousel/index.d.ts → es-custom/components/big-number/big-number.test.d.ts} +1 -2
- package/es-custom/components/big-number/big-number.test.js +113 -0
- package/es-custom/components/big-number/big-number.test.js.map +1 -0
- package/es-custom/components/big-number/constants.d.ts +19 -0
- package/es-custom/components/big-number/constants.js +30 -0
- package/es-custom/components/big-number/constants.js.map +1 -0
- package/es-custom/components/big-number/index.d.ts +10 -0
- package/es-custom/{node_modules/@carbon/utilities/es/dateTimeFormat → components/big-number}/index.js +2 -5
- package/es-custom/components/big-number/index.js.map +1 -0
- package/es-custom/components/checklist/checklist.scss.js +1 -1
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts +422 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.js +135 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js +13 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js.map +1 -0
- package/es-custom/{utilities/carousel/types.js → components/coachmark/coachmark-tagline/coachmark-tagline.test.d.ts} +4 -3
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.test.js +126 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.test.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-tagline/index.d.ts +9 -0
- package/{es/utilities/carousel → es-custom/components/coachmark/coachmark-tagline}/index.js +1 -1
- package/es-custom/components/guide-banner/guide-banner-element.d.ts +7 -0
- package/es-custom/components/guide-banner/guide-banner-element.js +14 -0
- package/es-custom/components/guide-banner/guide-banner-element.js.map +1 -1
- package/es-custom/components/guide-banner/guide-banner-element.scss.js +13 -0
- package/es-custom/components/guide-banner/guide-banner-element.scss.js.map +1 -0
- package/es-custom/{utilities/carousel/index.d.ts → components/guide-banner/guide-banner-element.test.d.ts} +1 -2
- package/es-custom/components/guide-banner/guide-banner-element.test.js +58 -0
- package/es-custom/components/guide-banner/guide-banner-element.test.js.map +1 -0
- package/es-custom/components/guide-banner/guide-banner.d.ts +4 -4
- package/es-custom/components/guide-banner/guide-banner.js +4 -4
- package/es-custom/components/guide-banner/guide-banner.js.map +1 -1
- package/es-custom/components/guide-banner/guide-banner.scss.js +1 -1
- package/es-custom/components/guide-banner/guide-banner.test.d.ts +6 -0
- package/es-custom/components/guide-banner/guide-banner.test.js +3 -3
- package/es-custom/components/guide-banner/guide-banner.test.js.map +1 -1
- package/es-custom/components/interstitial-screen/interstitial-screen-body-item.scss.js +1 -1
- package/es-custom/components/interstitial-screen/interstitial-screen-body.d.ts +1 -0
- package/es-custom/components/interstitial-screen/interstitial-screen-body.js +16 -4
- package/es-custom/components/interstitial-screen/interstitial-screen-body.js.map +1 -1
- package/es-custom/components/interstitial-screen/interstitial-screen-body.scss.js +1 -1
- package/es-custom/components/interstitial-screen/interstitial-screen-context.d.ts +1 -0
- package/es-custom/components/interstitial-screen/interstitial-screen-context.js +5 -0
- package/es-custom/components/interstitial-screen/interstitial-screen-context.js.map +1 -1
- package/es-custom/components/interstitial-screen/interstitial-screen.js +15 -0
- package/es-custom/components/interstitial-screen/interstitial-screen.js.map +1 -1
- package/es-custom/components/interstitial-screen/interstitial-screen.test.js +11 -0
- package/es-custom/components/interstitial-screen/interstitial-screen.test.js.map +1 -1
- package/es-custom/components/interstitial-screen/interstitial.figma.js +288 -0
- package/es-custom/components/interstitial-screen/interstitial.figma.js.map +1 -0
- package/es-custom/components/notification-panel/notification.js +2 -3
- package/es-custom/components/notification-panel/notification.js.map +1 -1
- package/es-custom/components/notification-panel/notification.test.js +2 -3
- package/es-custom/components/notification-panel/notification.test.js.map +1 -1
- package/es-custom/components/page-header/_story-assets/set-of-breadcrumbs.scss.js +1 -1
- package/es-custom/components/page-header/_story-assets/set-of-tags/set-of-tags.js +2 -3
- package/es-custom/components/page-header/_story-assets/set-of-tags/set-of-tags.js.map +1 -1
- package/es-custom/components/page-header/_story-assets/set-of-tags/set-of-tags.scss.js +1 -1
- package/es-custom/components/page-header/utils.js +17 -5
- package/es-custom/components/page-header/utils.js.map +1 -1
- package/es-custom/components/side-panel/side-panel.figma.js +229 -0
- package/es-custom/components/side-panel/side-panel.figma.js.map +1 -0
- package/es-custom/components/tearsheet/tearsheet.d.ts +33 -14
- package/es-custom/components/tearsheet/tearsheet.js +65 -98
- package/es-custom/components/tearsheet/tearsheet.js.map +1 -1
- package/es-custom/components/tearsheet/tearsheet.scss.js +1 -1
- package/es-custom/index.d.ts +4 -1
- package/es-custom/index.js +3 -0
- package/es-custom/index.js.map +1 -1
- package/es-custom/packages/ibm-products-web-components/package.json.js +1 -1
- package/{es/utilities/carousel/swipeEvents.d.ts → es-custom/utilities/snapscroll/index.d.ts} +1 -1
- package/es-custom/utilities/snapscroll/index.js +9 -0
- package/es-custom/utilities/snapscroll/snapscroll.d.ts +29 -0
- package/es-custom/utilities/snapscroll/snapscroll.js +134 -0
- package/es-custom/utilities/snapscroll/snapscroll.js.map +1 -0
- package/es-custom/utilities/snapscroll/snapscroll.test.d.ts +1 -0
- package/es-custom/utilities/snapscroll/snapscroll.test.js +41 -0
- package/es-custom/utilities/snapscroll/snapscroll.test.js.map +1 -0
- package/lib/components/big-number/big-number-skeleton.d.ts +22 -0
- package/lib/components/big-number/big-number.d.ts +37 -0
- package/lib/components/big-number/big-number.test.d.ts +7 -0
- package/lib/components/big-number/constants.d.ts +19 -0
- package/lib/components/big-number/index.d.ts +10 -0
- package/lib/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts +422 -0
- package/lib/components/coachmark/coachmark-tagline/coachmark-tagline.test.d.ts +9 -0
- package/lib/components/coachmark/coachmark-tagline/index.d.ts +9 -0
- package/lib/components/guide-banner/guide-banner-element.d.ts +7 -0
- package/lib/components/guide-banner/guide-banner-element.test.d.ts +7 -0
- package/lib/components/guide-banner/guide-banner.d.ts +4 -4
- package/lib/components/guide-banner/guide-banner.test.d.ts +6 -0
- package/lib/components/interstitial-screen/interstitial-screen-body.d.ts +1 -0
- package/lib/components/interstitial-screen/interstitial-screen-context.d.ts +1 -0
- package/lib/components/tearsheet/tearsheet.d.ts +33 -14
- package/lib/index.d.ts +4 -1
- package/lib/utilities/snapscroll/index.d.ts +7 -0
- package/lib/utilities/snapscroll/snapscroll.d.ts +29 -0
- package/lib/utilities/snapscroll/snapscroll.test.d.ts +1 -0
- package/package.json +6 -3
- package/scss/components/big-number/big-number-skeleton.scss +59 -0
- package/scss/components/big-number/big-number.scss +27 -0
- package/scss/components/coachmark/coachmark-tagline/coachmark-tagline.scss +22 -0
- package/scss/components/guide-banner/guide-banner-element.scss +31 -0
- package/scss/components/guide-banner/guide-banner.scss +2 -0
- package/scss/components/interstitial-screen/interstitial-screen-body-item.scss +1 -1
- package/scss/components/interstitial-screen/interstitial-screen-body.scss +1 -1
- package/scss/components/page-header/_story-assets/_storybook-styles.scss +6 -4
- package/telemetry.yml +12 -3
- package/es/node_modules/@carbon/utilities/es/dateTimeFormat/index.js.map +0 -1
- package/es/node_modules/@carbon/utilities/es/dateTimeFormat/relative.js +0 -11
- package/es/node_modules/@carbon/utilities/es/dateTimeFormat/relative.js.map +0 -1
- package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js +0 -9
- package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +0 -1
- package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +0 -11
- package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +0 -1
- package/es/utilities/carousel/carousel.d.ts +0 -14
- package/es/utilities/carousel/carousel.js +0 -341
- package/es/utilities/carousel/carousel.js.map +0 -1
- package/es/utilities/carousel/swipeEvents.js +0 -109
- package/es/utilities/carousel/swipeEvents.js.map +0 -1
- package/es/utilities/carousel/types.d.ts +0 -37
- package/es/utilities/carousel/types.js.map +0 -1
- package/es-custom/node_modules/@carbon/utilities/es/dateTimeFormat/index.js.map +0 -1
- package/es-custom/node_modules/@carbon/utilities/es/dateTimeFormat/relative.js +0 -11
- package/es-custom/node_modules/@carbon/utilities/es/dateTimeFormat/relative.js.map +0 -1
- package/es-custom/node_modules/@carbon/utilities/es/documentLang/documentLang.js +0 -9
- package/es-custom/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +0 -1
- package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +0 -11
- package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +0 -1
- package/es-custom/utilities/carousel/carousel.d.ts +0 -14
- package/es-custom/utilities/carousel/carousel.js +0 -341
- package/es-custom/utilities/carousel/carousel.js.map +0 -1
- package/es-custom/utilities/carousel/swipeEvents.d.ts +0 -7
- package/es-custom/utilities/carousel/swipeEvents.js +0 -109
- package/es-custom/utilities/carousel/swipeEvents.js.map +0 -1
- package/es-custom/utilities/carousel/types.d.ts +0 -37
- package/es-custom/utilities/carousel/types.js.map +0 -1
- package/lib/utilities/carousel/carousel.d.ts +0 -14
- package/lib/utilities/carousel/swipeEvents.d.ts +0 -7
- package/lib/utilities/carousel/types.d.ts +0 -37
- /package/es-custom/{utilities/carousel → components/coachmark/coachmark-tagline}/index.js.map +0 -0
- /package/{es/utilities/carousel → es-custom/utilities/snapscroll}/index.js.map +0 -0
package/es-custom/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*
|
|
4
|
-
* Copyright IBM Corp. 2024,
|
|
4
|
+
* Copyright IBM Corp. 2024, 2026
|
|
5
5
|
*
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -23,3 +23,6 @@ export { default as CDSGuideBanner } from './components/guide-banner/guide-banne
|
|
|
23
23
|
export { default as CDSGuideBannerElement } from './components/guide-banner/guide-banner-element';
|
|
24
24
|
export { default as CDSCoachmark } from './components/coachmark/coachmark';
|
|
25
25
|
export { default as CDSCoachmarkBeacon } from './components/coachmark/coachmark-beacon/coachmark-beacon';
|
|
26
|
+
export { default as CDSCoachmarkTagline } from './components/coachmark/coachmark-tagline/coachmark-tagline';
|
|
27
|
+
export { default as CDSBigNumber } from './components/big-number/big-number';
|
|
28
|
+
export { default as CDSBigNumberSkeleton } from './components/big-number/big-number-skeleton';
|
package/es-custom/index.js
CHANGED
|
@@ -22,4 +22,7 @@ export { default as CDSGuideBanner } from './components/guide-banner/guide-banne
|
|
|
22
22
|
export { default as CDSGuideBannerElement } from './components/guide-banner/guide-banner-element.js';
|
|
23
23
|
export { default as CDSCoachmark } from './components/coachmark/coachmark.js';
|
|
24
24
|
export { default as CDSCoachmarkBeacon } from './components/coachmark/coachmark-beacon/coachmark-beacon.js';
|
|
25
|
+
export { default as CDSCoachmarkTagline } from './components/coachmark/coachmark-tagline/coachmark-tagline.js';
|
|
26
|
+
export { default as CDSBigNumber } from './components/big-number/big-number.js';
|
|
27
|
+
export { default as CDSBigNumberSkeleton } from './components/big-number/big-number-skeleton.js';
|
|
25
28
|
//# sourceMappingURL=index.js.map
|
package/es-custom/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/{es/utilities/carousel/swipeEvents.d.ts → es-custom/utilities/snapscroll/index.d.ts}
RENAMED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export { snapScroll, scrollNext, scrollPrevious, blockClass, getNextSibling, getPreviousSibling, } from './snapscroll';
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
export { blockClass, getNextSibling, getPreviousSibling, scrollNext, scrollPrevious, snapScroll } from './snapscroll.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
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
|
+
* Initiates the snapScroll functionality
|
|
9
|
+
* @param body selector for element that contains the items
|
|
10
|
+
* @param child selector for the item elements
|
|
11
|
+
* @returns void
|
|
12
|
+
*/
|
|
13
|
+
export declare const blockClass = "c4p--snappy";
|
|
14
|
+
export declare function snapScroll(body: string, child: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Retreives the currently focused element
|
|
17
|
+
* @returns currently focused element
|
|
18
|
+
*/
|
|
19
|
+
export declare function getFocusedItem(): Element | null;
|
|
20
|
+
/**
|
|
21
|
+
* Scrolls to the next sibling element of the currently focused element
|
|
22
|
+
*/
|
|
23
|
+
export declare function scrollNext(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Scrolls to the previous sibling element of the currently focused element
|
|
26
|
+
*/
|
|
27
|
+
export declare function scrollPrevious(): void;
|
|
28
|
+
export declare function getNextSibling(): Element | null | undefined;
|
|
29
|
+
export declare function getPreviousSibling(): Element | null | undefined;
|
|
@@ -0,0 +1,134 @@
|
|
|
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 { prefix } from '../../globals/settings.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Copyright IBM Corp. 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Initiates the snapScroll functionality
|
|
18
|
+
* @param body selector for element that contains the items
|
|
19
|
+
* @param child selector for the item elements
|
|
20
|
+
* @returns void
|
|
21
|
+
*/
|
|
22
|
+
const blockClass = `${prefix}--snappy`;
|
|
23
|
+
const elmClass = `${blockClass}__elm`;
|
|
24
|
+
const selectionClass = `${blockClass}__selection`;
|
|
25
|
+
function snapScroll(body, child) {
|
|
26
|
+
const bodyEl = document.querySelector(body);
|
|
27
|
+
if (!bodyEl) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const styleElement = document.createElement('style');
|
|
31
|
+
styleElement.textContent = `
|
|
32
|
+
.${blockClass} {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex: none;
|
|
35
|
+
overflow: scroll;
|
|
36
|
+
scroll-snap-type: x mandatory;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.${blockClass}::-webkit-scrollbar {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.${blockClass}__elm {
|
|
45
|
+
scroll-snap-align: start;
|
|
46
|
+
flex: none;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
document.head.appendChild(styleElement);
|
|
51
|
+
bodyEl.classList.add(blockClass);
|
|
52
|
+
const scrollsnapSupported = 'onscrollsnapchange' in bodyEl;
|
|
53
|
+
const children = bodyEl.querySelectorAll(child);
|
|
54
|
+
if (children.length > 0) {
|
|
55
|
+
children.forEach((el) => {
|
|
56
|
+
el.classList.add(elmClass);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (scrollsnapSupported) {
|
|
60
|
+
bodyEl.addEventListener('scrollsnapchange', (event) => {
|
|
61
|
+
const snapevent = event;
|
|
62
|
+
const currentlySnapped = document.querySelector(`.${selectionClass}`);
|
|
63
|
+
if (currentlySnapped) {
|
|
64
|
+
currentlySnapped.classList.remove(selectionClass);
|
|
65
|
+
}
|
|
66
|
+
snapevent.snapTargetInline.classList.add(selectionClass);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const handler = (entries) => {
|
|
71
|
+
entries.forEach((entry) => {
|
|
72
|
+
entry.target.classList.toggle(selectionClass, entry.isIntersecting);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
let observer;
|
|
76
|
+
const createObserver = () => {
|
|
77
|
+
if (observer) {
|
|
78
|
+
observer.disconnect();
|
|
79
|
+
}
|
|
80
|
+
observer = new IntersectionObserver(handler, {
|
|
81
|
+
root: bodyEl,
|
|
82
|
+
threshold: 1,
|
|
83
|
+
});
|
|
84
|
+
children.forEach((child) => {
|
|
85
|
+
observer.observe(child);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
createObserver();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Retreives the currently focused element
|
|
93
|
+
* @returns currently focused element
|
|
94
|
+
*/
|
|
95
|
+
function getFocusedItem() {
|
|
96
|
+
return document.querySelector(`.${selectionClass}`);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Scrolls to the next sibling element of the currently focused element
|
|
100
|
+
*/
|
|
101
|
+
function scrollNext() {
|
|
102
|
+
const sibling = getNextSibling();
|
|
103
|
+
sibling === null || sibling === void 0 ? void 0 : sibling.scrollIntoView({
|
|
104
|
+
behavior: 'smooth',
|
|
105
|
+
inline: 'start',
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Scrolls to the previous sibling element of the currently focused element
|
|
110
|
+
*/
|
|
111
|
+
function scrollPrevious() {
|
|
112
|
+
const sibling = getPreviousSibling();
|
|
113
|
+
sibling === null || sibling === void 0 ? void 0 : sibling.scrollIntoView({
|
|
114
|
+
behavior: 'smooth',
|
|
115
|
+
inline: 'start',
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function getNextSibling() {
|
|
119
|
+
const item = getFocusedItem();
|
|
120
|
+
if (!item) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
return item.nextElementSibling;
|
|
124
|
+
}
|
|
125
|
+
function getPreviousSibling() {
|
|
126
|
+
const item = getFocusedItem();
|
|
127
|
+
if (!item) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
return item.previousElementSibling;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { blockClass, getFocusedItem, getNextSibling, getPreviousSibling, scrollNext, scrollPrevious, snapScroll };
|
|
134
|
+
//# sourceMappingURL=snapscroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapscroll.js","sources":["../../../src/utilities/snapscroll/snapscroll.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAYH;;;;;AAKG;AAEU,MAAA,UAAU,GAAG,CAAG,EAAA,MAAM;AACnC,MAAM,QAAQ,GAAG,CAAG,EAAA,UAAU,OAAO;AACrC,MAAM,cAAc,GAAG,CAAG,EAAA,UAAU,aAAa;AAEjC,SAAA,UAAU,CAAC,IAAY,EAAE,KAAa,EAAA;IACpD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC;IAE3C,IAAI,CAAC,MAAM,EAAE;QACX;;IAGF,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;IACpD,YAAY,CAAC,WAAW,GAAG;KACxB,UAAU,CAAA;;;;;;;;KAQV,UAAU,CAAA;;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
|
|
|
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 { describe, it, expect } from 'vitest';
|
|
9
|
+
import { fixture, html } from '@open-wc/testing';
|
|
10
|
+
import { snapScroll } from './snapscroll.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Copyright IBM Corp. 2025
|
|
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
|
+
const template = () => {
|
|
19
|
+
return html `
|
|
20
|
+
<div class="app">
|
|
21
|
+
<div class="body">
|
|
22
|
+
<div class="child">child element</div>
|
|
23
|
+
<div class="child">child element</div>
|
|
24
|
+
<div class="child">child element</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
28
|
+
};
|
|
29
|
+
describe('snapscroll', () => {
|
|
30
|
+
it('snaps', async () => {
|
|
31
|
+
const el = await fixture(template());
|
|
32
|
+
snapScroll('.body', '.child');
|
|
33
|
+
const body = el.querySelector('.body');
|
|
34
|
+
expect(body === null || body === void 0 ? void 0 : body.classList.contains('c4p--snappy')).toBe(true);
|
|
35
|
+
const child = el.querySelector('.child');
|
|
36
|
+
expect(child === null || child === void 0 ? void 0 : child.classList.contains('c4p--snappy__elm')).toBe(true);
|
|
37
|
+
const children = el.querySelectorAll('.c4p--snappy__elm');
|
|
38
|
+
expect(children.length).toBe(3);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=snapscroll.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapscroll.test.js","sources":["../../../src/utilities/snapscroll/snapscroll.test.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;AAKG;AAKH,MAAM,QAAQ,GAAG,MAAK;AACpB,IAAA,OAAO,IAAI,CAAA;;;;;;;;GAQV;AACH,CAAC;AAED,QAAQ,CAAC,YAAY,EAAE,MAAK;AAC1B,IAAA,EAAE,CAAC,OAAO,EAAE,YAAW;QACrB,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;AACpC,QAAA,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC7B,MAAM,IAAI,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;AACtC,QAAA,MAAM,CAAC,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAJ,MAAA,GAAA,MAAA,GAAA,IAAI,CAAE,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1D,MAAM,KAAK,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC;AACxC,QAAA,MAAM,CAAC,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAChE,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,mBAAmB,CAAC;QACzD,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACjC,KAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
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
|
+
import { LitElement } from 'lit';
|
|
10
|
+
import '@carbon/web-components/es/components/skeleton-text/index.js';
|
|
11
|
+
import '@carbon/web-components/es/components/skeleton-placeholder/index.js';
|
|
12
|
+
import { BigNumberSizeValues } from './constants';
|
|
13
|
+
/**
|
|
14
|
+
* @element c4p-big-number-skeleton
|
|
15
|
+
* Note: This component is only used within c4p-big-number. It displays a skeleton version while content is loading (handled by the c4p-big-number prop `loading').
|
|
16
|
+
*/
|
|
17
|
+
declare class CDSBigNumberSkeleton extends LitElement {
|
|
18
|
+
size?: BigNumberSizeValues;
|
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
20
|
+
static styles: any;
|
|
21
|
+
}
|
|
22
|
+
export default CDSBigNumberSkeleton;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
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
|
+
import { LitElement } from 'lit';
|
|
10
|
+
import './big-number-skeleton';
|
|
11
|
+
import { BigNumberSizeValues } from './constants';
|
|
12
|
+
/**
|
|
13
|
+
* @element c4p-big-number
|
|
14
|
+
* @slot label - Header area that displays the label above the value. This slot can be customized to include an info icon and a tooltip for additional context.
|
|
15
|
+
* @slot trending-icon - Displays an icon indicating trend direction. Can be customized to show a downward arrow when the trend is not upward.
|
|
16
|
+
* @slot icon-button - Displays an icon button next to `value`.
|
|
17
|
+
*/
|
|
18
|
+
declare class CDSBigNumber extends LitElement {
|
|
19
|
+
fractionDigits: number;
|
|
20
|
+
label: string | undefined;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
locale: string;
|
|
23
|
+
percentage: boolean;
|
|
24
|
+
size: BigNumberSizeValues;
|
|
25
|
+
total?: number;
|
|
26
|
+
trending: boolean;
|
|
27
|
+
truncate: boolean;
|
|
28
|
+
value?: number;
|
|
29
|
+
private _getSupportedLocale;
|
|
30
|
+
private _formatValue;
|
|
31
|
+
private _getTruncatedValue;
|
|
32
|
+
private _shouldDisplayDenominator;
|
|
33
|
+
private _getTrendingIcon;
|
|
34
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
35
|
+
static styles: any;
|
|
36
|
+
}
|
|
37
|
+
export default CDSBigNumber;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
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
|
+
export declare enum BigNumberSize {
|
|
8
|
+
Default = "default",
|
|
9
|
+
Large = "lg",
|
|
10
|
+
XLarge = "xl"
|
|
11
|
+
}
|
|
12
|
+
export type BigNumberSizeValues = `${BigNumberSize}`;
|
|
13
|
+
export declare enum Characters {
|
|
14
|
+
Dash = "\u2013",
|
|
15
|
+
Slash = "/",
|
|
16
|
+
Percentage = "%"
|
|
17
|
+
}
|
|
18
|
+
export declare const DefaultLocale = "en-US";
|
|
19
|
+
export declare const UNKNOWN = "Unknown";
|