@carbon/ibm-products 2.71.1 → 2.72.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/css/carbon.css +50 -0
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +560 -185
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +132 -1
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +570 -245
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +358 -33
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
- package/es/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +12 -12
- package/es/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
- package/es/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +16 -16
- package/es/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
- package/es/components/{BigNumbers → BigNumber}/constants.js +6 -6
- package/es/components/{BigNumbers → BigNumber}/index.d.ts +2 -2
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
- package/es/components/Coachmark/next/Coachmark/Coachmark.js +185 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +125 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +25 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +118 -0
- package/es/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
- package/es/components/Coachmark/next/Coachmark/ContentBody.js +37 -0
- package/es/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
- package/es/components/Coachmark/next/Coachmark/ContentHeader.js +89 -0
- package/{lib/components/BigNumbers → es/components/Coachmark/next/Coachmark}/index.d.ts +2 -2
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -5
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +42 -3
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
- package/es/components/ConditionBuilder/utils/useTranslations.js +1 -1
- package/es/components/EditInPlace/EditInPlace.js +0 -3
- package/es/components/EmptyStates/EmptyState.d.ts +2 -2
- package/es/components/EmptyStates/EmptyState.js +2 -8
- package/es/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
- package/es/components/InterstitialScreen/InterstitialScreen.js +3 -19
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +1 -1
- package/es/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
- package/es/components/InterstitialScreen/context.d.ts +31 -0
- package/es/components/InterstitialScreen/context.js +18 -0
- package/es/components/InterstitialScreen/index.d.ts +3 -2
- package/es/components/NotificationsPanel/NotificationsPanel.js +36 -13
- package/es/components/PageHeader/PageHeader.d.ts +2 -1
- package/es/components/PageHeader/PageHeader.js +2 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +18 -3
- package/es/components/PageHeader/next/PageHeader.js +260 -12
- package/es/components/PageHeader/next/context.d.ts +25 -0
- package/es/components/PageHeader/next/context.js +30 -0
- package/es/components/PageHeader/next/index.d.ts +3 -3
- package/es/components/PageHeader/next/overflowHandler.d.ts +95 -0
- package/es/components/PageHeader/next/overflowHandler.js +162 -0
- package/es/components/PageHeader/next/utils.d.ts +19 -0
- package/es/components/PageHeader/next/utils.js +68 -0
- package/es/components/ProductiveCard/ProductiveCard.js +2 -1
- package/es/components/ScrollGradient/ScrollGradient.js +1 -2
- package/es/components/SidePanel/SidePanel.d.ts +4 -0
- package/es/components/SidePanel/SidePanel.js +8 -2
- package/es/components/Tearsheet/TearsheetShell.js +8 -5
- package/es/components/TruncatedText/TruncatedText.d.ts +48 -0
- package/es/components/TruncatedText/TruncatedText.js +86 -0
- package/es/components/TruncatedText/index.d.ts +7 -0
- package/es/components/TruncatedText/useTruncatedText.d.ts +16 -0
- package/es/components/TruncatedText/useTruncatedText.js +41 -0
- package/es/components/index.d.ts +3 -1
- package/es/global/js/hooks/useOverflowString.d.ts +2 -2
- package/es/global/js/hooks/useResizeObserver.d.ts +1 -1
- package/es/global/js/package-settings.d.ts +2 -1
- package/es/global/js/package-settings.js +3 -2
- package/es/global/js/utils/checkForOverflow.js +21 -0
- package/es/global/js/utils/makeDraggable/index.d.ts +1 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.js +91 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
- package/es/index.js +3 -1
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.js +592 -0
- package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +713 -0
- package/es/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +95 -0
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +142 -0
- package/es/settings.d.ts +2 -1
- package/lib/components/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
- package/lib/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +11 -11
- package/lib/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
- package/lib/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +15 -15
- package/lib/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
- package/lib/components/{BigNumbers → BigNumber}/constants.js +6 -6
- package/lib/components/BigNumber/index.d.ts +7 -0
- package/lib/components/Coachmark/Coachmark.js +2 -2
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
- package/lib/components/Coachmark/next/Coachmark/Coachmark.js +189 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +127 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +27 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +122 -0
- package/lib/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
- package/lib/components/Coachmark/next/Coachmark/ContentBody.js +41 -0
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +93 -0
- package/lib/components/Coachmark/next/Coachmark/index.d.ts +7 -0
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +2 -2
- package/lib/components/CoachmarkStack/CoachmarkStack.js +2 -2
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -5
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +41 -2
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
- package/lib/components/ConditionBuilder/utils/useTranslations.js +1 -1
- package/lib/components/EditInPlace/EditInPlace.js +0 -3
- package/lib/components/EmptyStates/EmptyState.d.ts +2 -2
- package/lib/components/EmptyStates/EmptyState.js +2 -8
- package/lib/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
- package/lib/components/InterstitialScreen/InterstitialScreen.js +6 -25
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +6 -6
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +9 -9
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +5 -5
- package/lib/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
- package/lib/components/InterstitialScreen/context.d.ts +31 -0
- package/lib/components/InterstitialScreen/context.js +21 -0
- package/lib/components/InterstitialScreen/index.d.ts +3 -2
- package/lib/components/NotificationsPanel/NotificationsPanel.js +36 -13
- package/lib/components/PageHeader/PageHeader.d.ts +2 -1
- package/lib/components/PageHeader/PageHeader.js +2 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +18 -3
- package/lib/components/PageHeader/next/PageHeader.js +261 -7
- package/lib/components/PageHeader/next/context.d.ts +25 -0
- package/lib/components/PageHeader/next/context.js +33 -0
- package/lib/components/PageHeader/next/index.d.ts +3 -3
- package/lib/components/PageHeader/next/overflowHandler.d.ts +95 -0
- package/lib/components/PageHeader/next/overflowHandler.js +166 -0
- package/lib/components/PageHeader/next/utils.d.ts +19 -0
- package/lib/components/PageHeader/next/utils.js +71 -0
- package/lib/components/ProductiveCard/ProductiveCard.js +2 -1
- package/lib/components/ScrollGradient/ScrollGradient.js +1 -2
- package/lib/components/SidePanel/SidePanel.d.ts +4 -0
- package/lib/components/SidePanel/SidePanel.js +8 -2
- package/lib/components/Tearsheet/TearsheetShell.js +8 -5
- package/lib/components/TruncatedText/TruncatedText.d.ts +48 -0
- package/lib/components/TruncatedText/TruncatedText.js +86 -0
- package/lib/components/TruncatedText/index.d.ts +7 -0
- package/lib/components/TruncatedText/useTruncatedText.d.ts +16 -0
- package/lib/components/TruncatedText/useTruncatedText.js +45 -0
- package/lib/components/index.d.ts +3 -1
- package/lib/global/js/hooks/useOverflowString.d.ts +2 -2
- package/lib/global/js/hooks/usePortalTarget.js +2 -2
- package/lib/global/js/hooks/useResizeObserver.d.ts +1 -1
- package/lib/global/js/package-settings.d.ts +2 -1
- package/lib/global/js/package-settings.js +3 -2
- package/lib/global/js/utils/checkForOverflow.js +23 -0
- package/lib/global/js/utils/makeDraggable/index.d.ts +1 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.js +93 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
- package/lib/index.js +10 -3
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.js +600 -0
- package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +722 -0
- package/lib/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +102 -0
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +182 -0
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +164 -0
- package/lib/settings.d.ts +2 -1
- package/package.json +9 -10
- package/scss/components/{BigNumbers/_big-numbers.scss → BigNumber/_big-number.scss} +5 -5
- package/scss/components/{BigNumbers → BigNumber}/_carbon-imports.scss +3 -3
- package/scss/components/{BigNumbers → BigNumber}/_index-with-carbon.scss +2 -2
- package/scss/components/{BigNumbers → BigNumber}/_index.scss +2 -2
- package/scss/components/Card/_card.scss +2 -0
- package/scss/components/Coachmark/_bubble.scss +62 -0
- package/scss/components/Coachmark/_coachmark-beacon.scss +164 -0
- package/scss/components/Coachmark/_coachmark.scss +15 -0
- package/scss/components/ConditionBuilder/_condition-builder.scss +8 -0
- package/scss/components/PageHeader/_page-header.scss +144 -1
- package/scss/components/Tearsheet/_tearsheet.scss +6 -0
- package/scss/components/TruncatedText/_carbon-imports.scss +6 -0
- package/scss/components/TruncatedText/_index-with-carbon.scss +9 -0
- package/scss/components/TruncatedText/_index.scss +8 -0
- package/scss/components/TruncatedText/_truncated-text.scss +26 -0
- package/scss/components/_index-with-carbon.scss +3 -2
- package/scss/components/_index.scss +3 -2
- package/telemetry.yml +24 -5
- package/es/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
- package/lib/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
@@ -5,8 +5,8 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { ReactNode } from 'react';
|
8
|
-
import {
|
9
|
-
export interface
|
8
|
+
import { BigNumberSizeValues } from './constants';
|
9
|
+
export interface BigNumberProps {
|
10
10
|
className?: string;
|
11
11
|
forceShowTotal?: boolean;
|
12
12
|
fractionDigits?: number;
|
@@ -15,7 +15,7 @@ export interface BigNumbersProps {
|
|
15
15
|
label: string;
|
16
16
|
locale?: string;
|
17
17
|
percentage?: boolean;
|
18
|
-
size?:
|
18
|
+
size?: BigNumberSizeValues;
|
19
19
|
tooltipDescription?: string;
|
20
20
|
total?: number;
|
21
21
|
trending?: boolean;
|
@@ -23,7 +23,7 @@ export interface BigNumbersProps {
|
|
23
23
|
value?: number;
|
24
24
|
}
|
25
25
|
/**
|
26
|
-
*
|
26
|
+
* BigNumber is used to display large values in a small area. The display of
|
27
27
|
* values can be the value itself, or grouped in a `numerator/denominator` fashion.
|
28
28
|
* Control over the total fraction decimals displayed as well as how the
|
29
29
|
* values/totals are displayed are done via a locale prop. Other optional props
|
@@ -31,4 +31,4 @@ export interface BigNumbersProps {
|
|
31
31
|
* of a button as well as tool tip functionality.
|
32
32
|
* The default locale is English (`en-US`) if one is not provided or if the provided one is not supported.
|
33
33
|
*/
|
34
|
-
export declare let
|
34
|
+
export declare let BigNumber: React.ForwardRefExoticComponent<BigNumberProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -14,18 +14,18 @@ import { getSupportedLocale } from '../../global/js/utils/getSupportedLocale.js'
|
|
14
14
|
import { pkg } from '../../settings.js';
|
15
15
|
import { Information, ArrowUp } from '@carbon/react/icons';
|
16
16
|
import { Tooltip } from '@carbon/react';
|
17
|
-
import {
|
17
|
+
import { BigNumberSkeleton } from './BigNumberSkeleton.js';
|
18
18
|
import { DefaultLocale, formatValue, Characters, getIconSize } from './constants.js';
|
19
19
|
import { TooltipTrigger } from '../TooltipTrigger/TooltipTrigger.js';
|
20
20
|
|
21
21
|
var _Information;
|
22
|
-
const blockClass = `${pkg.prefix}--big-
|
23
|
-
const componentName = '
|
22
|
+
const blockClass = `${pkg.prefix}--big-number`;
|
23
|
+
const componentName = 'BigNumber';
|
24
24
|
|
25
25
|
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
26
26
|
|
27
27
|
/**
|
28
|
-
*
|
28
|
+
* BigNumber is used to display large values in a small area. The display of
|
29
29
|
* values can be the value itself, or grouped in a `numerator/denominator` fashion.
|
30
30
|
* Control over the total fraction decimals displayed as well as how the
|
31
31
|
* values/totals are displayed are done via a locale prop. Other optional props
|
@@ -33,7 +33,7 @@ const componentName = 'BigNumbers';
|
|
33
33
|
* of a button as well as tool tip functionality.
|
34
34
|
* The default locale is English (`en-US`) if one is not provided or if the provided one is not supported.
|
35
35
|
*/
|
36
|
-
let
|
36
|
+
let BigNumber = /*#__PURE__*/forwardRef((_ref, ref) => {
|
37
37
|
let {
|
38
38
|
// The component props, in alphabetical order (for consistency).
|
39
39
|
className,
|
@@ -53,7 +53,7 @@ let BigNumbers = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
53
53
|
// Collect any other property values passed in.
|
54
54
|
...rest
|
55
55
|
} = _ref;
|
56
|
-
const
|
56
|
+
const bigNumberClasses = cx(className, {
|
57
57
|
[`${blockClass}--lg`]: size === 'lg',
|
58
58
|
[`${blockClass}--xl`]: size === 'xl'
|
59
59
|
});
|
@@ -62,14 +62,14 @@ let BigNumbers = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
62
62
|
const truncatedTotal = formatValue(supportedLocale, total, fractionDigits, truncate) ?? 'Unknown';
|
63
63
|
const shouldDisplayDenominator = forceShowTotal || !percentage && total && value && total > value && truncatedValue !== truncatedTotal;
|
64
64
|
if (loading) {
|
65
|
-
return /*#__PURE__*/React__default.createElement(
|
65
|
+
return /*#__PURE__*/React__default.createElement(BigNumberSkeleton, _extends({}, rest, {
|
66
66
|
ref: ref,
|
67
67
|
className: className,
|
68
68
|
size: size
|
69
69
|
}, getDevtoolsProps(componentName)));
|
70
70
|
}
|
71
71
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
72
|
-
className: cx(blockClass,
|
72
|
+
className: cx(blockClass, bigNumberClasses, className),
|
73
73
|
ref: ref
|
74
74
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("span", {
|
75
75
|
className: `${blockClass}__row`
|
@@ -103,16 +103,16 @@ let BigNumbers = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
103
103
|
});
|
104
104
|
|
105
105
|
// Return a placeholder if not released and not enabled by feature flag
|
106
|
-
|
106
|
+
BigNumber = pkg.checkComponentEnabled(BigNumber, componentName);
|
107
107
|
|
108
108
|
// The display name of the component, used by React. Note that displayName
|
109
109
|
// is used in preference to relying on function.name.
|
110
|
-
|
110
|
+
BigNumber.displayName = componentName;
|
111
111
|
|
112
112
|
// The types and DocGen commentary for the component props,
|
113
113
|
// in alphabetical order (for consistency).
|
114
114
|
// See https://www.npmjs.com/package/prop-types#usage.
|
115
|
-
|
115
|
+
BigNumber.propTypes = {
|
116
116
|
/**
|
117
117
|
* Provide an optional class to be applied to the containing node.
|
118
118
|
*/
|
@@ -177,4 +177,4 @@ BigNumbers.propTypes = {
|
|
177
177
|
value: PropTypes.number
|
178
178
|
};
|
179
179
|
|
180
|
-
export {
|
180
|
+
export { BigNumber };
|
@@ -0,0 +1,17 @@
|
|
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
|
+
import React from 'react';
|
8
|
+
import { BigNumberProps } from './BigNumber';
|
9
|
+
/**
|
10
|
+
* SkeletonBigNumber is used to display a skeleton version while
|
11
|
+
* content is loading (handled by the BigNumber prop `loading').
|
12
|
+
*
|
13
|
+
* Note: This component is only used within BigNumber.
|
14
|
+
*/
|
15
|
+
type BigNumberSkeletonProps = Pick<BigNumberProps, 'className' | 'size'>;
|
16
|
+
export declare const BigNumberSkeleton: React.ForwardRefExoticComponent<BigNumberSkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
17
|
+
export {};
|
@@ -12,33 +12,33 @@ import cx from 'classnames';
|
|
12
12
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
13
13
|
import { pkg } from '../../settings.js';
|
14
14
|
import { SkeletonText } from '@carbon/react';
|
15
|
-
import {
|
15
|
+
import { BigNumberSize } from './constants.js';
|
16
16
|
|
17
17
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
18
|
-
const blockClass = `${pkg.prefix}--big-
|
19
|
-
const componentName = '
|
18
|
+
const blockClass = `${pkg.prefix}--big-number-skeleton`;
|
19
|
+
const componentName = 'BigNumberSkeleton';
|
20
20
|
|
21
21
|
/**
|
22
|
-
*
|
23
|
-
* content is loading (handled by the
|
22
|
+
* SkeletonBigNumber is used to display a skeleton version while
|
23
|
+
* content is loading (handled by the BigNumber prop `loading').
|
24
24
|
*
|
25
|
-
* Note: This component is only used within
|
25
|
+
* Note: This component is only used within BigNumber.
|
26
26
|
*/
|
27
27
|
|
28
|
-
// Use the same properties and values as parent
|
28
|
+
// Use the same properties and values as parent BigNumberProps
|
29
29
|
|
30
|
-
const
|
30
|
+
const BigNumberSkeleton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
31
31
|
let {
|
32
32
|
className,
|
33
33
|
size,
|
34
34
|
...rest
|
35
35
|
} = _ref;
|
36
|
-
const
|
37
|
-
[`${blockClass}--lg`]: size ===
|
38
|
-
[`${blockClass}--xl`]: size ===
|
36
|
+
const bigNumberSkeletonClasses = cx(className, blockClass, {
|
37
|
+
[`${blockClass}--lg`]: size === BigNumberSize.Large,
|
38
|
+
[`${blockClass}--xl`]: size === BigNumberSize.XLarge
|
39
39
|
});
|
40
40
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
41
|
-
className:
|
41
|
+
className: bigNumberSkeletonClasses,
|
42
42
|
ref: ref
|
43
43
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(SkeletonText, {
|
44
44
|
className: `${blockClass}__label`
|
@@ -51,8 +51,8 @@ const BigNumbersSkeleton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
51
51
|
|
52
52
|
// The display name of the component, used by React. Note that displayName
|
53
53
|
// is used in preference to relying on function.name.
|
54
|
-
|
55
|
-
|
54
|
+
BigNumberSkeleton.displayName = componentName;
|
55
|
+
BigNumberSkeleton.propTypes = {
|
56
56
|
/**
|
57
57
|
* Provide an optional class to be applied to the containing node.
|
58
58
|
*/
|
@@ -60,7 +60,7 @@ BigNumbersSkeleton.propTypes = {
|
|
60
60
|
/**
|
61
61
|
*
|
62
62
|
*/
|
63
|
-
size: PropTypes.oneOf([
|
63
|
+
size: PropTypes.oneOf([BigNumberSize.Default, BigNumberSize.Large, BigNumberSize.XLarge])
|
64
64
|
};
|
65
65
|
|
66
|
-
export {
|
66
|
+
export { BigNumberSkeleton };
|
@@ -4,16 +4,16 @@
|
|
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 declare enum
|
7
|
+
export declare enum BigNumberSize {
|
8
8
|
Default = "default",
|
9
9
|
Large = "lg",
|
10
10
|
XLarge = "xl"
|
11
11
|
}
|
12
|
-
export type
|
12
|
+
export type BigNumberSizeValues = `${BigNumberSize}`;
|
13
13
|
export declare enum Characters {
|
14
14
|
Dash = "\u2013",
|
15
15
|
Slash = "/"
|
16
16
|
}
|
17
17
|
export declare const DefaultLocale = "en-US";
|
18
18
|
export declare const formatValue: (locale: Intl.LocalesArgument, value: number | null | undefined, fractionDigits: number, truncate: boolean) => string | null | undefined;
|
19
|
-
export declare const getIconSize: (size:
|
19
|
+
export declare const getIconSize: (size: BigNumberSizeValues) => number;
|
@@ -5,11 +5,11 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
let
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
return
|
8
|
+
let BigNumberSize = /*#__PURE__*/function (BigNumberSize) {
|
9
|
+
BigNumberSize["Default"] = "default";
|
10
|
+
BigNumberSize["Large"] = "lg";
|
11
|
+
BigNumberSize["XLarge"] = "xl";
|
12
|
+
return BigNumberSize;
|
13
13
|
}({});
|
14
14
|
|
15
15
|
// = 'default' | 'lg' | 'xl'
|
@@ -41,4 +41,4 @@ const getIconSize = size => {
|
|
41
41
|
}
|
42
42
|
};
|
43
43
|
|
44
|
-
export {
|
44
|
+
export { BigNumberSize, Characters, DefaultLocale, formatValue, getIconSize };
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright IBM Corp. 2024,
|
2
|
+
* Copyright IBM Corp. 2024, 2025
|
3
3
|
*
|
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 { BigNumber } from './BigNumber';
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 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
|
+
import React, { FC, ForwardRefExoticComponent, ReactNode, RefAttributes, RefObject } from 'react';
|
8
|
+
import { CoachmarkContentProps } from './CoachmarkContent';
|
9
|
+
import { NewPopoverAlignment } from '@carbon/react';
|
10
|
+
export declare const blockClass: string;
|
11
|
+
export interface CoachmarkProps {
|
12
|
+
/**
|
13
|
+
* Provide the contents of the Coachmark.
|
14
|
+
*/
|
15
|
+
children: ReactNode;
|
16
|
+
/**
|
17
|
+
* Provide an optional class to be applied to the containing node.
|
18
|
+
*/
|
19
|
+
className?: string;
|
20
|
+
/**
|
21
|
+
* The aria label applied to the Coachmark component
|
22
|
+
*/
|
23
|
+
ariaLabel?: string;
|
24
|
+
/**
|
25
|
+
* Specifies whether the component is currently open.
|
26
|
+
*/
|
27
|
+
open?: boolean;
|
28
|
+
/**
|
29
|
+
* Function to call when the close button is clicked.
|
30
|
+
*/
|
31
|
+
onClose?: () => void;
|
32
|
+
/**
|
33
|
+
* Where to render the Coachmark relative to its target.
|
34
|
+
*/
|
35
|
+
align?: NewPopoverAlignment;
|
36
|
+
/**
|
37
|
+
* Fine tune the position of the target in pixels.
|
38
|
+
*/
|
39
|
+
position?: {
|
40
|
+
x: number;
|
41
|
+
y: number;
|
42
|
+
};
|
43
|
+
/**
|
44
|
+
* Specifies whether the component is floating or not.
|
45
|
+
*/
|
46
|
+
floating?: boolean;
|
47
|
+
}
|
48
|
+
export type CoachmarkComponent = ForwardRefExoticComponent<CoachmarkProps & RefAttributes<HTMLDivElement>> & {
|
49
|
+
Content: FC<CoachmarkContentProps>;
|
50
|
+
};
|
51
|
+
interface CoachmarkContextType {
|
52
|
+
onClose?: () => void;
|
53
|
+
open?: boolean;
|
54
|
+
setOpen: (value: boolean) => void;
|
55
|
+
align?: NewPopoverAlignment;
|
56
|
+
triggerRef: RefObject<HTMLElement | null>;
|
57
|
+
position: {
|
58
|
+
x: number;
|
59
|
+
y: number;
|
60
|
+
};
|
61
|
+
contentRef: HTMLElement | null;
|
62
|
+
setContentRef: (value: any) => void;
|
63
|
+
floating?: boolean;
|
64
|
+
}
|
65
|
+
export declare const CoachmarkContext: React.Context<CoachmarkContextType>;
|
66
|
+
/**
|
67
|
+
* Coachmarks are used to call out specific functionality or concepts
|
68
|
+
* within the UI that may not be intuitive but are important for the
|
69
|
+
* user to gain understanding of the product's main value and discover new use cases.
|
70
|
+
*/
|
71
|
+
export declare const Coachmark: CoachmarkComponent;
|
72
|
+
export {};
|
@@ -0,0 +1,185 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 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
|
+
import { extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { createContext, forwardRef, useRef, useState, useEffect } from 'react';
|
10
|
+
import PropTypes from '../../../../_virtual/index.js';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import { getDevtoolsProps } from '../../../../global/js/utils/devtools.js';
|
13
|
+
import { pkg } from '../../../../settings.js';
|
14
|
+
import CoachmarkContent from './CoachmarkContent.js';
|
15
|
+
import { useIsomorphicEffect } from '../../../../global/js/hooks/useIsomorphicEffect.js';
|
16
|
+
|
17
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
18
|
+
const blockClass = `${pkg.prefix}--coachmark__next`;
|
19
|
+
const componentName = 'Coachmark';
|
20
|
+
|
21
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
22
|
+
|
23
|
+
// Default values can be included here and then assigned to the prop params,
|
24
|
+
// e.g. prop = defaults.prop,
|
25
|
+
// This gathers default values together neatly and ensures non-primitive
|
26
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
27
|
+
// Note that default values are not required for props that are 'required',
|
28
|
+
// nor for props where the component can apply undefined values reasonably.
|
29
|
+
// Default values should be provided when the component needs to make a choice
|
30
|
+
// or assumption when a prop is not supplied.
|
31
|
+
|
32
|
+
// Define the type for Coachmark, extending it to include Trigger and Content
|
33
|
+
|
34
|
+
const CoachmarkContext = /*#__PURE__*/createContext({
|
35
|
+
open: false,
|
36
|
+
setOpen: () => {},
|
37
|
+
align: 'bottom',
|
38
|
+
triggerRef: {
|
39
|
+
current: null
|
40
|
+
},
|
41
|
+
position: {
|
42
|
+
x: 0,
|
43
|
+
y: 0
|
44
|
+
},
|
45
|
+
contentRef: null,
|
46
|
+
setContentRef: value => {},
|
47
|
+
floating: false
|
48
|
+
});
|
49
|
+
/**
|
50
|
+
* Coachmarks are used to call out specific functionality or concepts
|
51
|
+
* within the UI that may not be intuitive but are important for the
|
52
|
+
* user to gain understanding of the product's main value and discover new use cases.
|
53
|
+
*/
|
54
|
+
const Coachmark = /*#__PURE__*/forwardRef((props, ref) => {
|
55
|
+
const {
|
56
|
+
children,
|
57
|
+
className,
|
58
|
+
ariaLabel,
|
59
|
+
onClose,
|
60
|
+
align = 'bottom',
|
61
|
+
open,
|
62
|
+
position = {
|
63
|
+
x: 0,
|
64
|
+
y: 0
|
65
|
+
},
|
66
|
+
floating,
|
67
|
+
...rest
|
68
|
+
} = props;
|
69
|
+
const triggerRef = useRef(null);
|
70
|
+
const internalRef = useRef(null);
|
71
|
+
const [contentRef, setContentRef] = useState(null);
|
72
|
+
const [openState, setOpenState] = useState(false);
|
73
|
+
const setOpen = value => {
|
74
|
+
if (!value) {
|
75
|
+
onClose?.();
|
76
|
+
}
|
77
|
+
if (open === undefined) {
|
78
|
+
setOpenState(value);
|
79
|
+
}
|
80
|
+
};
|
81
|
+
const currentOpen = open ?? openState;
|
82
|
+
useEffect(() => {
|
83
|
+
const container = internalRef.current;
|
84
|
+
if (!container) {
|
85
|
+
return;
|
86
|
+
}
|
87
|
+
const focusableElements = Array.from(container.querySelectorAll('*'));
|
88
|
+
const firstFocusable = focusableElements.find(el => el.tabIndex >= 0 && !el.hasAttribute('disabled'));
|
89
|
+
if (firstFocusable) {
|
90
|
+
triggerRef.current = firstFocusable;
|
91
|
+
}
|
92
|
+
}, [children]);
|
93
|
+
useIsomorphicEffect(() => {
|
94
|
+
const {
|
95
|
+
x = 0,
|
96
|
+
y = 0
|
97
|
+
} = position ?? {};
|
98
|
+
const el = internalRef.current;
|
99
|
+
if (el && (x !== 0 || y !== 0)) {
|
100
|
+
el.style.transform = `translate(${x}px, ${y}px)`;
|
101
|
+
}
|
102
|
+
}, [position]);
|
103
|
+
const setRef = node => {
|
104
|
+
internalRef.current = node;
|
105
|
+
if (typeof ref === 'function') {
|
106
|
+
ref(node);
|
107
|
+
} else if (ref) {
|
108
|
+
ref.current = node;
|
109
|
+
}
|
110
|
+
};
|
111
|
+
return /*#__PURE__*/React__default.createElement(CoachmarkContext.Provider, {
|
112
|
+
value: {
|
113
|
+
onClose,
|
114
|
+
open: currentOpen,
|
115
|
+
setOpen,
|
116
|
+
align,
|
117
|
+
triggerRef,
|
118
|
+
position,
|
119
|
+
contentRef,
|
120
|
+
setContentRef,
|
121
|
+
floating
|
122
|
+
}
|
123
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
124
|
+
className: cx(blockClass,
|
125
|
+
// Apply the block class to the main HTML element
|
126
|
+
className,
|
127
|
+
// Apply any supplied class names to the main HTML element.
|
128
|
+
{
|
129
|
+
[`${blockClass}--floating`]: floating
|
130
|
+
}),
|
131
|
+
"aria-label": ariaLabel,
|
132
|
+
ref: setRef
|
133
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("div", {
|
134
|
+
className: `${blockClass}--container`
|
135
|
+
}, children)));
|
136
|
+
});
|
137
|
+
Coachmark.Content = CoachmarkContent;
|
138
|
+
|
139
|
+
// The display name of the component, used by React. Note that displayName
|
140
|
+
// is used in preference to relying on function.name.
|
141
|
+
Coachmark.displayName = componentName;
|
142
|
+
|
143
|
+
// The types and DocGen commentary for the component props,
|
144
|
+
// in alphabetical order (for consistency).
|
145
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
146
|
+
Coachmark.propTypes = {
|
147
|
+
/**
|
148
|
+
* Where to render the Coachmark relative to its target.
|
149
|
+
*/
|
150
|
+
align: PropTypes.string,
|
151
|
+
/**
|
152
|
+
* The aria label applied to the Coachmark component
|
153
|
+
*/
|
154
|
+
ariaLabel: PropTypes.string,
|
155
|
+
/**
|
156
|
+
* Provide the contents of the CoachmarkV2.
|
157
|
+
*/
|
158
|
+
children: PropTypes.node.isRequired,
|
159
|
+
/**
|
160
|
+
* Provide an optional class to be applied to the containing node.
|
161
|
+
*/
|
162
|
+
className: PropTypes.string,
|
163
|
+
/**
|
164
|
+
* Specifies whether the component is currently open.
|
165
|
+
*/
|
166
|
+
defaultOpen: PropTypes.bool,
|
167
|
+
/**
|
168
|
+
* Specifies whether the component is floating or not.
|
169
|
+
*/
|
170
|
+
floating: PropTypes.bool,
|
171
|
+
/**
|
172
|
+
* Function to call when the close button is clicked.
|
173
|
+
*/
|
174
|
+
onClose: PropTypes.func,
|
175
|
+
/**
|
176
|
+
* Fine tune the position of the target in pixels. Applies only to Beacons.
|
177
|
+
*/
|
178
|
+
// @ts-ignore
|
179
|
+
position: PropTypes.shape({
|
180
|
+
x: PropTypes.number,
|
181
|
+
y: PropTypes.number
|
182
|
+
})
|
183
|
+
};
|
184
|
+
|
185
|
+
export { Coachmark, CoachmarkContext, blockClass };
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 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
|
+
import React, { ElementType } from 'react';
|
8
|
+
import { ButtonProps } from '@carbon/react';
|
9
|
+
/**
|
10
|
+
* Reserved for future expansion, i.e. "RING".
|
11
|
+
*/
|
12
|
+
export declare enum BEACON_KIND {
|
13
|
+
DEFAULT = "default"
|
14
|
+
}
|
15
|
+
export interface CoachmarkButtonProps extends ButtonProps<ElementType> {
|
16
|
+
onClick?(): void;
|
17
|
+
onDoubleClick?(): void;
|
18
|
+
tabIndex?: number;
|
19
|
+
['aria-expanded']?: boolean;
|
20
|
+
}
|
21
|
+
export interface CoachmarkBeaconProps {
|
22
|
+
/**
|
23
|
+
* Optional class name for this component.
|
24
|
+
*/
|
25
|
+
className?: string;
|
26
|
+
/**
|
27
|
+
* What style of beacon.
|
28
|
+
* BEACON_KIND is an enum from the Coachmark and can be used for this value.
|
29
|
+
* @see {@link BEACON_KIND}
|
30
|
+
*/
|
31
|
+
kind?: BEACON_KIND;
|
32
|
+
/**
|
33
|
+
* The aria label.
|
34
|
+
*/
|
35
|
+
label: string;
|
36
|
+
/**
|
37
|
+
* button props
|
38
|
+
*/
|
39
|
+
buttonProps?: CoachmarkButtonProps;
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Use beacon for the target prop of a Coachmark component.
|
43
|
+
*/
|
44
|
+
export declare const CoachmarkBeacon: React.ForwardRefExoticComponent<CoachmarkBeaconProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 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 { CoachmarkBeacon } from './CoachmarkBeacon';
|
8
|
+
export type { CoachmarkBeaconProps } from './CoachmarkBeacon';
|
@@ -0,0 +1,38 @@
|
|
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 { NewPopoverAlignment } from '@carbon/react';
|
10
|
+
import React, { HTMLProps, RefObject } from 'react';
|
11
|
+
interface BubbleProps extends Omit<HTMLProps<HTMLDivElement>, 'target'> {
|
12
|
+
/**
|
13
|
+
* 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start';
|
14
|
+
**/
|
15
|
+
align?: NewPopoverAlignment;
|
16
|
+
/**
|
17
|
+
* Values can range from an Element, a ref of an Element, a string which will use query selector to select an Element.
|
18
|
+
**/
|
19
|
+
target: Element | RefObject<Element> | string | null | undefined;
|
20
|
+
/**
|
21
|
+
* Specify whether the component should be rendered on high-contrast.
|
22
|
+
*/
|
23
|
+
highContrast?: boolean;
|
24
|
+
/**
|
25
|
+
* Specify whether a drop shadow should be rendered on the popover.
|
26
|
+
*/
|
27
|
+
dropShadow?: boolean;
|
28
|
+
/**
|
29
|
+
* Specifies whether the component is currently open.
|
30
|
+
*/
|
31
|
+
open: boolean;
|
32
|
+
/**
|
33
|
+
* Specify whether a caret should be rendered.
|
34
|
+
*/
|
35
|
+
caret?: boolean;
|
36
|
+
}
|
37
|
+
declare const CoachmarkBubble: React.ForwardRefExoticComponent<Omit<BubbleProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
38
|
+
export { CoachmarkBubble };
|