@carbon/ibm-products 2.88.0 → 2.89.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 +17 -4
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +106 -33
- 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 +54 -29
- 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 +89 -29
- 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 +104 -32
- 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/AboutModal/AboutModal.d.ts.map +1 -1
- package/es/components/AboutModal/AboutModal.js +2 -2
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +17 -0
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/Coachmark.js +35 -5
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -9
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +48 -47
- package/es/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +4 -1
- package/es/components/Coachmark/next/Coachmark/ContentHeader.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/ContentHeader.js +26 -11
- package/es/components/Coachmark/next/Coachmark/context.d.ts +1 -0
- package/es/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +4 -15
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -15
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -14
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +1 -1
- package/es/components/DelimitedList/DelimitedList.d.ts +1 -0
- package/es/components/DelimitedList/DelimitedList.d.ts.map +1 -1
- package/es/components/DelimitedList/DelimitedList.js +6 -0
- package/es/components/StringFormatter/StringFormatter.d.ts +1 -0
- package/es/components/StringFormatter/StringFormatter.d.ts.map +1 -1
- package/es/components/StringFormatter/StringFormatter.js +6 -0
- package/es/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/es/components/Tearsheet/next/Tearsheet.js +6 -9
- package/es/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetBody.js +5 -2
- package/es/components/Tearsheet/next/TearsheetHeader.d.ts +1 -1
- package/es/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetHeader.js +11 -10
- package/es/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetHeaderContent.js +26 -7
- package/es/components/Tearsheet/next/context.d.ts +4 -2
- package/es/components/Tearsheet/next/context.d.ts.map +1 -1
- package/es/components/Tearsheet/next/context.js +4 -2
- package/es/global/js/hooks/useCollapsible.d.ts.map +1 -1
- package/es/global/js/hooks/useCollapsible.js +7 -5
- package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +1 -1
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/settings.js +8 -2
- package/lib/components/AboutModal/AboutModal.d.ts.map +1 -1
- package/lib/components/AboutModal/AboutModal.js +1 -1
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +17 -0
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/Coachmark.js +35 -5
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -9
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +47 -46
- package/lib/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +4 -1
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +26 -11
- package/lib/components/Coachmark/next/Coachmark/context.d.ts +1 -0
- package/lib/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +3 -14
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -15
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +3 -13
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +1 -1
- package/lib/components/DelimitedList/DelimitedList.d.ts +1 -0
- package/lib/components/DelimitedList/DelimitedList.d.ts.map +1 -1
- package/lib/components/DelimitedList/DelimitedList.js +6 -0
- package/lib/components/StringFormatter/StringFormatter.d.ts +1 -0
- package/lib/components/StringFormatter/StringFormatter.d.ts.map +1 -1
- package/lib/components/StringFormatter/StringFormatter.js +6 -0
- package/lib/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/Tearsheet.js +6 -9
- package/lib/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetBody.js +4 -1
- package/lib/components/Tearsheet/next/TearsheetHeader.d.ts +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeader.js +11 -10
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.js +24 -5
- package/lib/components/Tearsheet/next/context.d.ts +4 -2
- package/lib/components/Tearsheet/next/context.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/context.js +4 -2
- package/lib/global/js/hooks/useCollapsible.d.ts.map +1 -1
- package/lib/global/js/hooks/useCollapsible.js +7 -5
- package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/lib/index.js +2 -2
- package/lib/node_modules/@carbon/icons-react/lib/Icon.js +1 -1
- package/lib/settings.js +8 -1
- package/package.json +15 -15
- package/scss/components/Coachmark/_coachmark.scss +25 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +16 -0
- package/scss/components/PageHeader/_page-header.scss +30 -22
- package/scss/components/Tearsheet/_tearsheet_next.scss +40 -7
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +0 -110
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +0 -32
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -416
- package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -509
- package/es/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -86
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -145
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +0 -111
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +0 -33
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -420
- package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -515
- package/lib/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -92
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -162
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -149
|
@@ -37,7 +37,7 @@ const ConditionGroupBuilder = ({ group, aria, onRemove, onChange, className }) =
|
|
|
37
37
|
"conditionBuilderText"
|
|
38
38
|
]);
|
|
39
39
|
const { statementConfig } = require_useDataConfigs.useDataConfigs();
|
|
40
|
-
const { variant, conditionBuilderRef } = (0, react.useContext)(require_ConditionBuilderProvider.ConditionBuilderContext);
|
|
40
|
+
const { variant, conditionBuilderRef, statementConfigCustom } = (0, react.useContext)(require_ConditionBuilderProvider.ConditionBuilderContext);
|
|
41
41
|
const [showConditionPreview, setShowConditionPreview] = (0, react.useState)(-1);
|
|
42
42
|
const [showConditionSubGroupPreview, setShowConditionSubGroupPreview] = (0, react.useState)(-1);
|
|
43
43
|
(0, react.useState)(false);
|
|
@@ -153,22 +153,12 @@ const ConditionGroupBuilder = ({ group, aria, onRemove, onChange, className }) =
|
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
const addConditionSubGroupHandler = (conditionIndex) => {
|
|
156
|
+
const newSubGroup = require_ConditionBuilderProvider.getEmptyState(statementConfigCustom).groups?.[0];
|
|
156
157
|
onChange({
|
|
157
158
|
...group,
|
|
158
159
|
conditions: [
|
|
159
160
|
...group.conditions ? group.conditions.slice(0, conditionIndex + 1) : [],
|
|
160
|
-
|
|
161
|
-
statement: "ifAll",
|
|
162
|
-
groupOperator: "and",
|
|
163
|
-
conditions: [{
|
|
164
|
-
property: void 0,
|
|
165
|
-
operator: "",
|
|
166
|
-
value: "",
|
|
167
|
-
popoverToOpen: "propertyField",
|
|
168
|
-
id: require_uuidv4.default()
|
|
169
|
-
}],
|
|
170
|
-
id: require_uuidv4.default()
|
|
171
|
-
},
|
|
161
|
+
newSubGroup,
|
|
172
162
|
...group.conditions ? group.conditions.slice(conditionIndex + 1) : []
|
|
173
163
|
]
|
|
174
164
|
});
|
|
@@ -228,7 +228,7 @@ const useFilters = ({ updateMethod, filters = emptyArray, setAllFilters, variati
|
|
|
228
228
|
break;
|
|
229
229
|
case require_constants.MULTISELECT: {
|
|
230
230
|
const isStringArray = components.MultiSelect.items.length && typeof components.MultiSelect.items[0] === "string";
|
|
231
|
-
const selectedFilters = filtersState[column]?.value.filter((i) => i.selected);
|
|
231
|
+
const selectedFilters = Array.isArray(filtersState[column]?.value) ? filtersState[column].value.filter((i) => i.selected) : [];
|
|
232
232
|
const filteredItems = components.MultiSelect.items.map((item) => {
|
|
233
233
|
if (selectedFilters.filter((a) => isStringArray ? a.id === item : a.id === item.id).length) return item;
|
|
234
234
|
return null;
|
|
@@ -26,6 +26,7 @@ export interface DelimitedListProps extends PropsWithChildren {
|
|
|
26
26
|
/**
|
|
27
27
|
* `DelimitedList` converts an array of items into a single line of
|
|
28
28
|
* comma-separated values.
|
|
29
|
+
* @deprecated This component is deprecated and will be removed in the next major version.
|
|
29
30
|
*/
|
|
30
31
|
export declare const DelimitedList: React.ForwardRefExoticComponent<DelimitedListProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
32
|
//# sourceMappingURL=DelimitedList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelimitedList.d.ts","sourceRoot":"","sources":["../../../src/components/DelimitedList/DelimitedList.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAgBjD,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"DelimitedList.d.ts","sourceRoot":"","sources":["../../../src/components/DelimitedList/DelimitedList.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAgBjD,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,2FA8BzB,CAAC"}
|
|
@@ -32,6 +32,7 @@ const defaults = {
|
|
|
32
32
|
/**
|
|
33
33
|
* `DelimitedList` converts an array of items into a single line of
|
|
34
34
|
* comma-separated values.
|
|
35
|
+
* @deprecated This component is deprecated and will be removed in the next major version.
|
|
35
36
|
*/
|
|
36
37
|
const DelimitedList = react.default.forwardRef(({ className, delimiter = defaults.delimiter, items = defaults.items, truncate = defaults.truncate, ...rest }, ref) => {
|
|
37
38
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -41,6 +42,11 @@ const DelimitedList = react.default.forwardRef(({ className, delimiter = default
|
|
|
41
42
|
...require_devtools.getDevtoolsProps(componentName)
|
|
42
43
|
}, items.length > 0 ? items.join(delimiter) : "–");
|
|
43
44
|
});
|
|
45
|
+
/**@ts-ignore*/
|
|
46
|
+
DelimitedList.deprecated = {
|
|
47
|
+
level: "warn",
|
|
48
|
+
details: `${componentName} is deprecated and will be removed in the next major version`
|
|
49
|
+
};
|
|
44
50
|
DelimitedList.displayName = componentName;
|
|
45
51
|
DelimitedList.propTypes = {
|
|
46
52
|
className: prop_types.default.string,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* StringFormatter allows for truncating text while displaying a tooltip
|
|
3
3
|
* overlay on hover or focus with the entirety of the provided copy.
|
|
4
|
+
* @deprecated This component is deprecated and will be removed in the next major version. Please use TruncatedText instead.
|
|
4
5
|
*/
|
|
5
6
|
export let StringFormatter: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
6
7
|
import React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringFormatter.d.ts","sourceRoot":"","sources":["../../../src/components/StringFormatter/StringFormatter.jsx"],"names":[],"mappings":"AAmCA
|
|
1
|
+
{"version":3,"file":"StringFormatter.d.ts","sourceRoot":"","sources":["../../../src/components/StringFormatter/StringFormatter.jsx"],"names":[],"mappings":"AAmCA;;;;GAIG;AACH,sFAuFE;kBAxHsC,OAAO"}
|
|
@@ -38,6 +38,7 @@ const defaults = {
|
|
|
38
38
|
/**
|
|
39
39
|
* StringFormatter allows for truncating text while displaying a tooltip
|
|
40
40
|
* overlay on hover or focus with the entirety of the provided copy.
|
|
41
|
+
* @deprecated This component is deprecated and will be removed in the next major version. Please use TruncatedText instead.
|
|
41
42
|
*/
|
|
42
43
|
let StringFormatter = react.default.forwardRef(({ className, autoAlign = defaults.autoAlign, lines = defaults.lines, tooltipDirection = defaults.tooltipDirection, truncate = defaults.truncate, width = defaults.width, value, ...rest }, ref) => {
|
|
43
44
|
const outerRef = (0, react.useRef)(null);
|
|
@@ -89,6 +90,11 @@ let StringFormatter = react.default.forwardRef(({ className, autoAlign = default
|
|
|
89
90
|
openOnHover: true
|
|
90
91
|
}, stringFormatterContent) : stringFormatterContent);
|
|
91
92
|
});
|
|
93
|
+
/**@ts-ignore*/
|
|
94
|
+
StringFormatter.deprecated = {
|
|
95
|
+
level: "warn",
|
|
96
|
+
details: `Please replace ${componentName} with TruncatedText`
|
|
97
|
+
};
|
|
92
98
|
StringFormatter = require_settings.pkg.checkComponentEnabled(StringFormatter, componentName);
|
|
93
99
|
StringFormatter.displayName = componentName;
|
|
94
100
|
StringFormatter.validateAlignment = () => (props, propName, componentName) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tearsheet.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/Tearsheet.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,EAKZ,SAAS,EAET,EAAE,EAEH,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tearsheet.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/Tearsheet.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,EAKZ,SAAS,EAET,EAAE,EAEH,MAAM,OAAO,CAAC;AAIf,OAAO,EAEL,kBAAkB,EAKnB,MAAM,eAAe,CAAC;AAEvB,OAAwB,EACtB,oBAAoB,EAEpB,2BAA2B,EAE3B,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAA+B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAsB,EAEpB,eAAe,EAEf,gBAAgB,EAEhB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,8BAA8B,EAE9B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAQ1E;;;;GAIG;AAEH,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,yBAAyB,CAClE,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CACrD,GAAG;IACF,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACjC,aAAa,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC;IAC/C,UAAU,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC;IAChC,aAAa,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC;IAC/C,YAAY,EAAE,EAAE,CAAC,0BAA0B,CAAC,CAAC;IAC7C,aAAa,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC;IAC/C,gBAAgB,EAAE,EAAE,CAAC,8BAA8B,CAAC,CAAC;IACrD,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAClC,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACxC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC;IAC7B,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC;CAClC,CAAC;AAkNF;;;GAGG;AACH,eAAO,MAAM,SAAS,EA0BjB,sBAAsB,CAAC"}
|
|
@@ -37,7 +37,7 @@ var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.de
|
|
|
37
37
|
* Internal component that handles the actual tearsheet rendering.
|
|
38
38
|
* This component is always "present" when mounted - the wrapper handles presence logic.
|
|
39
39
|
*/
|
|
40
|
-
const TearsheetInternal = (0, react.forwardRef)(({ children, variant = "wide", selectorsFloatingMenus = [], className, influencerWidth, summaryContentWidth, ariaLabel, onClose, selectorPrimaryFocus, open = false, portalTarget, disablePortal = false, verticalGap, containerClassName, keepMounted = false, isExiting = false, presenceRef, ...rest }, ref) => {
|
|
40
|
+
const TearsheetInternal = (0, react.forwardRef)(({ children, variant = "wide", selectorsFloatingMenus = [], className, influencerWidth, summaryContentWidth, ariaLabel, onClose, selectorPrimaryFocus, open = false, portalTarget, disablePortal = false, verticalGap, containerClassName, keepMounted = false, isExiting = false, presenceRef, decorator, ...rest }, ref) => {
|
|
41
41
|
const carbonPrefix = (0, _carbon_react.usePrefix)();
|
|
42
42
|
const localRef = (0, react.useRef)(null);
|
|
43
43
|
const bodyRef = (0, react.useRef)(null);
|
|
@@ -47,7 +47,6 @@ const TearsheetInternal = (0, react.forwardRef)(({ children, variant = "wide", s
|
|
|
47
47
|
presenceRef
|
|
48
48
|
]);
|
|
49
49
|
const isSm = require_useMatchMedia.useMatchMedia(`(max-width: ${_carbon_layout.breakpoints.md.width})`) || variant === "narrow";
|
|
50
|
-
const [hasCloseIcon, setHasCloseIcon] = (0, react.useState)(true);
|
|
51
50
|
const [fullyCollapsed, setFullyCollapsed] = (0, react.useState)(false);
|
|
52
51
|
const [disableHeaderCollapse, setDisableHeaderCollapse] = (0, react.useState)(false);
|
|
53
52
|
const arr = react.default.Children.toArray(children);
|
|
@@ -70,7 +69,7 @@ const TearsheetInternal = (0, react.forwardRef)(({ children, variant = "wide", s
|
|
|
70
69
|
if (verticalGap) document.documentElement.style.setProperty("--tearsheet-vertical-gap", `${verticalGap}`);
|
|
71
70
|
}, [
|
|
72
71
|
isSm,
|
|
73
|
-
|
|
72
|
+
decorator,
|
|
74
73
|
influencerWidth,
|
|
75
74
|
summaryContentWidth,
|
|
76
75
|
verticalGap
|
|
@@ -92,15 +91,14 @@ const TearsheetInternal = (0, react.forwardRef)(({ children, variant = "wide", s
|
|
|
92
91
|
}
|
|
93
92
|
}, [stack]);
|
|
94
93
|
const content = /* @__PURE__ */ react.default.createElement(require_context.TearsheetContext.Provider, { value: {
|
|
95
|
-
hasCloseIcon,
|
|
96
|
-
setHasCloseIcon,
|
|
97
94
|
fullyCollapsed,
|
|
98
95
|
setFullyCollapsed,
|
|
99
96
|
onClose,
|
|
100
97
|
disableHeaderCollapse,
|
|
101
98
|
setDisableHeaderCollapse,
|
|
102
99
|
variant,
|
|
103
|
-
isSm
|
|
100
|
+
isSm,
|
|
101
|
+
decorator
|
|
104
102
|
} }, /* @__PURE__ */ react.default.createElement(_carbon_react.unstable_FeatureFlags, { enableExperimentalFocusWrapWithoutSentinels: true }, /* @__PURE__ */ react.default.createElement(_carbon_react.ComposedModal, {
|
|
105
103
|
...rest,
|
|
106
104
|
"aria-label": ariaLabel,
|
|
@@ -109,9 +107,8 @@ const TearsheetInternal = (0, react.forwardRef)(({ children, variant = "wide", s
|
|
|
109
107
|
[`${require_context.blockClass}--narrow`]: variant === "narrow",
|
|
110
108
|
[`${require_context.blockClass}--stacked`]: depth > 0,
|
|
111
109
|
[`${require_context.blockClass}--stack-activated`]: stack.length > 1,
|
|
112
|
-
[`${require_context.blockClass}--has-ai-label`]: !!
|
|
113
|
-
[`${require_context.blockClass}--has-decorator`]: !!
|
|
114
|
-
[`${require_context.blockClass}--has-close`]: hasCloseIcon,
|
|
110
|
+
[`${require_context.blockClass}--has-ai-label`]: !!decorator && decorator["type"]?.displayName === "AILabel",
|
|
111
|
+
[`${require_context.blockClass}--has-decorator`]: !!decorator && decorator["type"]?.displayName !== "AILabel",
|
|
115
112
|
["is-visible"]: keepMounted ? open : true,
|
|
116
113
|
[`${require_context.blockClass}--keep-mounted`]: keepMounted
|
|
117
114
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TearsheetBody.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/TearsheetBody.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,EAGZ,SAAS,
|
|
1
|
+
{"version":3,"file":"TearsheetBody.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/TearsheetBody.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,EAGZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAOf;;;;GAIG;AAEH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CAOpB;AAED,QAAA,MAAM,aAAa,2FAQlB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD;;;;GAIG;AACH,eAAO,MAAM,WAAW,yFAuDvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,IAAI,IAAI,CAAC;IAC7B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,cAAc,4FAiC1B,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,sBAAsB,CAAC,IAAI,IAAI,CAAC;IAChC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,UAAU,wFAkCtB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -36,8 +36,11 @@ const TearsheetBody = (0, react.forwardRef)(({ children, className }, ref) => {
|
|
|
36
36
|
const MainContent = (0, react.forwardRef)(({ children, className, isFlush, ...rest }, ref) => {
|
|
37
37
|
const localRef = (0, react.useRef)(null);
|
|
38
38
|
const mainContentRef = ref || localRef;
|
|
39
|
+
const [container, setContainer] = (0, react.useState)(null);
|
|
39
40
|
const { setFullyCollapsed, disableHeaderCollapse } = (0, react.useContext)(require_context.TearsheetContext);
|
|
40
|
-
|
|
41
|
+
(0, react.useEffect)(() => {
|
|
42
|
+
setContainer(typeof mainContentRef === "function" ? null : mainContentRef?.current ?? null);
|
|
43
|
+
}, [mainContentRef]);
|
|
41
44
|
const collapseHeader = (collapse) => {
|
|
42
45
|
if (container) {
|
|
43
46
|
if (collapse) {
|
|
@@ -21,7 +21,7 @@ export interface TearsheetHeaderProps {
|
|
|
21
21
|
* The accessibility title for the close icon (if shown).
|
|
22
22
|
*
|
|
23
23
|
* **Note:** This prop is only required if a close icon is shown, i.e. if
|
|
24
|
-
* there are a no navigation actions and/or
|
|
24
|
+
* there are a no navigation actions and/or hideCloseButton is false.
|
|
25
25
|
*/
|
|
26
26
|
closeIconDescription?: string;
|
|
27
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TearsheetHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/TearsheetHeader.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAc,eAAe,EAAe,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,EAAE,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAMf;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,QAAA,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"TearsheetHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/TearsheetHeader.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAc,eAAe,EAAe,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,EAAE,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAMf;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,QAAA,MAAM,eAAe,6FA2CpB,CAAC;AAEF,eAAe,eAAe,CAAC;AAE/B;;;;GAIG;AAEH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,eAAO,MAAM,sBAAsB,oGAajC,CAAC;AAEH;;;;GAIG;AAEH,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,mGA6ChC,CAAC"}
|
|
@@ -23,27 +23,28 @@ let _carbon_react_icons = require("@carbon/react/icons");
|
|
|
23
23
|
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
|
|
24
24
|
const TearsheetHeader = react.default.forwardRef((props, ref) => {
|
|
25
25
|
const { children, closeIconDescription, hideCloseButton = false, className, disableHeaderCollapse, ...rest } = props;
|
|
26
|
-
const
|
|
26
|
+
const parentContext = (0, react.useContext)(require_context.TearsheetContext);
|
|
27
|
+
const { fullyCollapsed, setDisableHeaderCollapse } = parentContext;
|
|
27
28
|
const localRef = (0, react.useRef)(void 0);
|
|
28
29
|
const headerRef = ref || localRef;
|
|
29
|
-
(0, react.useEffect)(() => {
|
|
30
|
-
setHasCloseIcon?.(!!hideCloseButton);
|
|
31
|
-
}, [hideCloseButton, setHasCloseIcon]);
|
|
32
30
|
(0, react.useEffect)(() => {
|
|
33
31
|
setDisableHeaderCollapse?.(!!disableHeaderCollapse);
|
|
34
32
|
}, [disableHeaderCollapse, setDisableHeaderCollapse]);
|
|
35
|
-
|
|
33
|
+
const enhancedContext = {
|
|
34
|
+
...parentContext,
|
|
35
|
+
closeIconDescription,
|
|
36
|
+
hideCloseButton
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ react.default.createElement(require_context.TearsheetContext.Provider, { value: enhancedContext }, /* @__PURE__ */ react.default.createElement(_carbon_react.ModalHeader, {
|
|
36
39
|
ref: headerRef,
|
|
37
40
|
className: (0, import_classnames.default)(`${require_context.blockClass}__header`, {
|
|
38
41
|
[`${className}`]: true,
|
|
39
|
-
[`${require_context.blockClass}__header--with-close-icon`]:
|
|
42
|
+
[`${require_context.blockClass}__header--with-close-icon`]: !hideCloseButton,
|
|
40
43
|
[`${require_context.blockClass}__header-collapsed`]: fullyCollapsed
|
|
41
44
|
}),
|
|
42
|
-
closeClassName:
|
|
43
|
-
closeModal: onClose,
|
|
44
|
-
iconDescription: closeIconDescription,
|
|
45
|
+
closeClassName: `${require_context.blockClass}__header--no-close-icon`,
|
|
45
46
|
...rest
|
|
46
|
-
}, children);
|
|
47
|
+
}, children));
|
|
47
48
|
});
|
|
48
49
|
const TearsheetNavigationBar = react.default.forwardRef((props, ref) => {
|
|
49
50
|
const { children, scroller, className, ...rest } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TearsheetHeaderContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/TearsheetHeaderContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TearsheetHeaderContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/TearsheetHeaderContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAIZ,SAAS,EAEV,MAAM,OAAO,CAAC;AAOf,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC;AAED,QAAA,MAAM,sBAAsB,oGA4G1B,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -11,6 +11,8 @@ const require_TruncatedText = require('../../TruncatedText/TruncatedText.js');
|
|
|
11
11
|
const require_context = require('./context.js');
|
|
12
12
|
let react = require("react");
|
|
13
13
|
react = require_runtime.__toESM(react);
|
|
14
|
+
let _carbon_react = require("@carbon/react");
|
|
15
|
+
let _carbon_react_icons = require("@carbon/react/icons");
|
|
14
16
|
|
|
15
17
|
//#region src/components/Tearsheet/next/TearsheetHeaderContent.tsx
|
|
16
18
|
/**
|
|
@@ -22,16 +24,33 @@ react = require_runtime.__toESM(react);
|
|
|
22
24
|
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
|
|
23
25
|
const TearsheetHeaderContent = react.default.forwardRef((props, ref) => {
|
|
24
26
|
const { children, label, title, description, headerActions, titleStart, titleEnd, ...rest } = props;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const carbonPrefix = (0, _carbon_react.usePrefix)();
|
|
28
|
+
const { isSm, onClose, decorator, closeIconDescription, hideCloseButton = false } = (0, react.useContext)(require_context.TearsheetContext);
|
|
29
|
+
const normalizedDecorator = (0, react.isValidElement)(decorator) && decorator.type === _carbon_react.AILabel ? (0, react.cloneElement)(decorator, { size: "sm" }) : decorator;
|
|
30
|
+
const headerContent = /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__header-content` }, label ? /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__header-label` }, label) : null, /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__content__title-wrapper` }, /* @__PURE__ */ react.default.createElement("h2", { className: (0, import_classnames.default)(`${require_context.blockClass}__header-title`) }, titleStart ? /* @__PURE__ */ react.default.createElement("span", { className: `${require_context.blockClass}__title-start` }, titleStart) : null, /* @__PURE__ */ react.default.createElement(require_TruncatedText.TruncatedText, {
|
|
29
31
|
id: `${require_context.blockClass}__header-title__truncatedText`,
|
|
30
32
|
className: `${require_context.blockClass}__content__title`,
|
|
31
33
|
align: "bottom",
|
|
32
34
|
autoAlign: true,
|
|
33
35
|
value: title
|
|
34
|
-
}), titleEnd ? /* @__PURE__ */ react.default.createElement("span", { className: `${require_context.blockClass}__title-end` }, titleEnd) : null)), /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__header-description` }, description), children && /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__header-content--extra` }, children))
|
|
36
|
+
}), titleEnd ? /* @__PURE__ */ react.default.createElement("span", { className: `${require_context.blockClass}__title-end` }, titleEnd) : null)), /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__header-description` }, description), children && /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__header-content--extra` }, children));
|
|
37
|
+
const headerActionsElement = headerActions && /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__header-actions` }, headerActions);
|
|
38
|
+
const decoratorElement = decorator && /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__decorator` }, normalizedDecorator);
|
|
39
|
+
const closeButtonElement = !hideCloseButton && /* @__PURE__ */ react.default.createElement("div", { className: `${require_context.blockClass}__close-button ${carbonPrefix}--modal-close-button` }, /* @__PURE__ */ react.default.createElement(_carbon_react.IconButton, {
|
|
40
|
+
className: `${carbonPrefix}--modal-close`,
|
|
41
|
+
label: closeIconDescription || "Close",
|
|
42
|
+
onClick: onClose,
|
|
43
|
+
align: "left"
|
|
44
|
+
}, /* @__PURE__ */ react.default.createElement(_carbon_react_icons.Close, {
|
|
45
|
+
size: 20,
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
tabIndex: "-1",
|
|
48
|
+
className: `${carbonPrefix}--modal-close__icon`
|
|
49
|
+
})));
|
|
50
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
51
|
+
className: `${require_context.blockClass}__header-content-wrapper`,
|
|
52
|
+
ref
|
|
53
|
+
}, !isSm ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, headerActionsElement, decoratorElement, closeButtonElement, headerContent) : /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, decoratorElement, closeButtonElement, headerContent, headerActionsElement));
|
|
35
54
|
});
|
|
36
55
|
|
|
37
56
|
//#endregion
|
|
@@ -4,14 +4,13 @@
|
|
|
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
|
+
import { ReactNode } from 'react';
|
|
7
8
|
/**
|
|
8
9
|
* -------------
|
|
9
10
|
* Context setup
|
|
10
11
|
* -------------
|
|
11
12
|
*/
|
|
12
13
|
interface TearsheetContextType {
|
|
13
|
-
hasCloseIcon: boolean;
|
|
14
|
-
setHasCloseIcon?: (value: boolean) => void;
|
|
15
14
|
fullyCollapsed: boolean;
|
|
16
15
|
setFullyCollapsed?: (value: boolean) => void;
|
|
17
16
|
refs?: any;
|
|
@@ -20,6 +19,9 @@ interface TearsheetContextType {
|
|
|
20
19
|
setDisableHeaderCollapse?: (value: boolean) => void;
|
|
21
20
|
variant: 'wide' | 'narrow';
|
|
22
21
|
isSm: boolean;
|
|
22
|
+
decorator?: ReactNode;
|
|
23
|
+
closeIconDescription?: string;
|
|
24
|
+
hideCloseButton?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export declare const TearsheetContext: import("react").Context<TearsheetContextType>;
|
|
25
27
|
export declare const blockClass: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/components/Tearsheet/next/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAiB,SAAS,EAAyB,MAAM,OAAO,CAAC;AAGxE;;;;GAIG;AAEH,UAAU,oBAAoB;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AACD,eAAO,MAAM,gBAAgB,+CAQ3B,CAAC;AAEH,eAAO,MAAM,UAAU,QAAmC,CAAC"}
|
|
@@ -17,11 +17,13 @@ let react = require("react");
|
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/
|
|
19
19
|
const TearsheetContext = (0, react.createContext)({
|
|
20
|
-
hasCloseIcon: true,
|
|
21
20
|
fullyCollapsed: false,
|
|
22
21
|
disableHeaderCollapse: false,
|
|
23
22
|
variant: "wide",
|
|
24
|
-
isSm: false
|
|
23
|
+
isSm: false,
|
|
24
|
+
decorator: void 0,
|
|
25
|
+
closeIconDescription: void 0,
|
|
26
|
+
hideCloseButton: false
|
|
25
27
|
});
|
|
26
28
|
const blockClass = `${require_settings.pkg.prefix}--tearsheet__next`;
|
|
27
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCollapsible.d.ts","sourceRoot":"","sources":["../../../../src/global/js/hooks/useCollapsible.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"useCollapsible.d.ts","sourceRoot":"","sources":["../../../../src/global/js/hooks/useCollapsible.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,UAAU,2BAA2B;IACnC,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IACjC,eAAe,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAKD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,eAAe,EACf,qBAA6B,GAC9B,EAAE,2BAA2B,QAqD7B"}
|
|
@@ -15,6 +15,7 @@ let react = require("react");
|
|
|
15
15
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
|
+
const DRAG_THRESHOLD = 5;
|
|
18
19
|
/**
|
|
19
20
|
* Custom hook to manage collapsible header behavior based on scroll and drag gestures.
|
|
20
21
|
*
|
|
@@ -26,15 +27,17 @@ function useCollapsible({ container, triggerCollapse, disableHeaderCollapse = fa
|
|
|
26
27
|
if (!container || disableHeaderCollapse) return;
|
|
27
28
|
let startY = null;
|
|
28
29
|
let isDragging = false;
|
|
30
|
+
const evaluateDragDirection = (diffY) => {
|
|
31
|
+
if (diffY > DRAG_THRESHOLD) triggerCollapse(true);
|
|
32
|
+
else if (diffY < -DRAG_THRESHOLD) triggerCollapse(false);
|
|
33
|
+
};
|
|
29
34
|
const onPointerDown = (e) => {
|
|
30
35
|
startY = e.clientY;
|
|
31
36
|
isDragging = true;
|
|
32
37
|
};
|
|
33
38
|
const onPointerMove = (e) => {
|
|
34
39
|
if (!isDragging || startY === null) return;
|
|
35
|
-
|
|
36
|
-
if (diffY > 5) triggerCollapse(true);
|
|
37
|
-
else if (diffY < -5) triggerCollapse(false);
|
|
40
|
+
evaluateDragDirection(startY - e.clientY);
|
|
38
41
|
};
|
|
39
42
|
const onPointerUp = () => {
|
|
40
43
|
isDragging = false;
|
|
@@ -42,8 +45,7 @@ function useCollapsible({ container, triggerCollapse, disableHeaderCollapse = fa
|
|
|
42
45
|
document.body.style.cursor = "default";
|
|
43
46
|
};
|
|
44
47
|
const onWheel = (e) => {
|
|
45
|
-
|
|
46
|
-
else if (e.deltaY < 0) triggerCollapse(false);
|
|
48
|
+
triggerCollapse(e.deltaY > 0);
|
|
47
49
|
};
|
|
48
50
|
container.addEventListener("pointerdown", onPointerDown);
|
|
49
51
|
container.addEventListener("pointermove", onPointerMove);
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const require_runtime = require('
|
|
8
|
+
const require_runtime = require('../../../../_virtual/_rolldown/runtime.js');
|
|
9
9
|
|
|
10
|
-
//#region ../../node_modules/@carbon/
|
|
10
|
+
//#region ../../node_modules/@carbon/icon-helpers/lib/index.js
|
|
11
11
|
var require_lib = /* @__PURE__ */ require_runtime.__commonJSMin(((exports) => {
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
13
13
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const require_runtime = require('../../../../_virtual/_rolldown/runtime.js');
|
|
9
9
|
const require_chunk_CsKB0u1v$1 = require('./chunk-CsKB0u1v.js');
|
|
10
|
-
const require_index = require('
|
|
10
|
+
const require_index = require('../../icon-helpers/lib/index.js');
|
|
11
11
|
|
|
12
12
|
//#region ../../node_modules/@carbon/icons-react/lib/Icon.js
|
|
13
13
|
var require_Icon = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
|
package/lib/settings.js
CHANGED
|
@@ -11,7 +11,7 @@ const require_Canary = require('./components/_Canary/Canary.js');
|
|
|
11
11
|
const require_pconsole = require('./global/js/utils/pconsole.js');
|
|
12
12
|
let react = require("react");
|
|
13
13
|
react = require_runtime.__toESM(react);
|
|
14
|
-
require("@carbon/themes");
|
|
14
|
+
let _carbon_themes = require("@carbon/themes");
|
|
15
15
|
|
|
16
16
|
//#region src/settings.js
|
|
17
17
|
/**
|
|
@@ -20,6 +20,12 @@ require("@carbon/themes");
|
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/
|
|
23
|
+
const carbon = {
|
|
24
|
+
get themes() {
|
|
25
|
+
return _carbon_themes.themes;
|
|
26
|
+
},
|
|
27
|
+
prefix: "cds"
|
|
28
|
+
};
|
|
23
29
|
const componentDeprecatedWarning = (name, details) => `Carbon for IBM Products (WARNING): Component "${name}" is deprecated. ${details}`;
|
|
24
30
|
require_package_settings.default.logDeprecated = (component, name) => {
|
|
25
31
|
if (component?.deprecated) {
|
|
@@ -45,4 +51,5 @@ require_package_settings.default.checkComponentEnabled = (component, name) => {
|
|
|
45
51
|
const pkg = require_package_settings.default;
|
|
46
52
|
|
|
47
53
|
//#endregion
|
|
54
|
+
exports.carbon = carbon;
|
|
48
55
|
exports.pkg = pkg;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/ibm-products",
|
|
3
3
|
"description": "Carbon for IBM Products",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.89.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@babel/preset-env": "^7.26.9",
|
|
67
67
|
"@babel/preset-react": "^7.26.3",
|
|
68
68
|
"@babel/preset-typescript": "^7.26.0",
|
|
69
|
-
"@carbon/styles": "^1.
|
|
69
|
+
"@carbon/styles": "^1.104.0",
|
|
70
70
|
"@figma/code-connect": "^1.4.0",
|
|
71
71
|
"@ibm/telemetry-js-config-generator": "^2.0.1",
|
|
72
72
|
"@storybook/addon-a11y": "^9.1.15",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@types/react-table": "^7.7.20",
|
|
79
79
|
"@vitejs/plugin-react": "^5.0.0",
|
|
80
80
|
"babel-plugin-dev-expression": "^0.2.3",
|
|
81
|
-
"babel-preset-ibm-cloud-cognitive": "^0.
|
|
81
|
+
"babel-preset-ibm-cloud-cognitive": "^0.47.0",
|
|
82
82
|
"change-case": "5.4.4",
|
|
83
83
|
"classnames": "^2.5.1",
|
|
84
84
|
"copyfiles": "^2.4.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"fs-extra": "^11.3.0",
|
|
87
87
|
"glob": "^13.0.0",
|
|
88
88
|
"jest": "^29.7.0",
|
|
89
|
-
"jest-config-ibm-cloud-cognitive": "^1.
|
|
89
|
+
"jest-config-ibm-cloud-cognitive": "^1.48.0",
|
|
90
90
|
"jest-environment-jsdom": "^29.7.0",
|
|
91
91
|
"namor": "^1.1.2",
|
|
92
92
|
"npm-run-all2": "^8.0.0",
|
|
@@ -105,11 +105,11 @@
|
|
|
105
105
|
"dependencies": {
|
|
106
106
|
"@babel/runtime": "^7.26.10",
|
|
107
107
|
"@carbon-labs/react-resizer": "^0.10.0",
|
|
108
|
-
"@carbon/feature-flags": "^1.
|
|
109
|
-
"@carbon/ibm-products-styles": "^2.
|
|
108
|
+
"@carbon/feature-flags": "^1.2.0",
|
|
109
|
+
"@carbon/ibm-products-styles": "^2.85.0",
|
|
110
110
|
"@carbon/telemetry": "^0.1.0",
|
|
111
|
-
"@carbon/utilities": "^0.
|
|
112
|
-
"@carbon/utilities-react": "0.
|
|
111
|
+
"@carbon/utilities": "^0.18.0",
|
|
112
|
+
"@carbon/utilities-react": "0.21.0",
|
|
113
113
|
"@dnd-kit/core": "^6.3.1",
|
|
114
114
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
115
115
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -120,15 +120,15 @@
|
|
|
120
120
|
"react-window": "^1.8.11"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
|
-
"@carbon/grid": "^11.
|
|
124
|
-
"@carbon/layout": "^11.
|
|
125
|
-
"@carbon/motion": "^11.
|
|
126
|
-
"@carbon/react": "^1.
|
|
127
|
-
"@carbon/themes": "^11.
|
|
128
|
-
"@carbon/type": "^11.
|
|
123
|
+
"@carbon/grid": "^11.53.0",
|
|
124
|
+
"@carbon/layout": "^11.51.0",
|
|
125
|
+
"@carbon/motion": "^11.44.0",
|
|
126
|
+
"@carbon/react": "^1.105.0",
|
|
127
|
+
"@carbon/themes": "^11.71.0",
|
|
128
|
+
"@carbon/type": "^11.57.0",
|
|
129
129
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0",
|
|
130
130
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0",
|
|
131
131
|
"react-is": "^16.13.1 || ^17.0.2 || ^18.3.1 || ^19.0.0"
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "df2a8032f4f3947cf289ce8782534f94401bc95e"
|
|
134
134
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright IBM Corp. 2023,
|
|
2
|
+
// Copyright IBM Corp. 2023, 2026
|
|
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.
|
|
@@ -50,4 +50,28 @@ $block-class-next: #{c4p-settings.$pkg-prefix}--coachmark__next;
|
|
|
50
50
|
box-shadow: 0 0 0 $spacing-02 $icon-inverse;
|
|
51
51
|
outline: $spacing-01 solid $background-inverse;
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
.#{$block-class-next}--coachmark-content {
|
|
55
|
+
.#{$block-class-next}--content-header {
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: flex-end;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.#{$block-class-next}--content-header--drag-icon,
|
|
61
|
+
.#{$block-class-next}--content-header .#{carbon-config.$prefix}--btn {
|
|
62
|
+
color: $icon-inverse;
|
|
63
|
+
|
|
64
|
+
.#{carbon-config.$prefix}--btn__icon,
|
|
65
|
+
svg {
|
|
66
|
+
color: $icon-inverse;
|
|
67
|
+
fill: $icon-inverse;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.#{$block-class-next}--content-body {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
padding: $spacing-01 $spacing-05 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
53
77
|
}
|
|
@@ -57,7 +57,9 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
|
57
57
|
.#{$block-class}__item-option__option {
|
|
58
58
|
display: grid;
|
|
59
59
|
cursor: pointer;
|
|
60
|
+
inline-size: 100%;
|
|
60
61
|
min-block-size: 2rem;
|
|
62
|
+
min-inline-size: 0;
|
|
61
63
|
padding-inline: $spacing-05;
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -85,6 +87,8 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
|
85
87
|
display: flex;
|
|
86
88
|
align-items: center;
|
|
87
89
|
block-size: 100%;
|
|
90
|
+
inline-size: 100%;
|
|
91
|
+
min-inline-size: 0;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
.#{$block-class}__item-option__option-label {
|
|
@@ -92,6 +96,18 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
|
92
96
|
overflow: hidden;
|
|
93
97
|
align-items: center;
|
|
94
98
|
column-gap: $spacing-03;
|
|
99
|
+
inline-size: 100%;
|
|
100
|
+
min-inline-size: 0;
|
|
101
|
+
|
|
102
|
+
> svg {
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.#{$block-class}__item-option__option-label-text {
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
flex: 1 1 auto;
|
|
110
|
+
min-inline-size: 0;
|
|
95
111
|
text-overflow: ellipsis;
|
|
96
112
|
white-space: nowrap;
|
|
97
113
|
}
|