@carbon/ibm-products 2.25.0 → 2.26.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/css/index-full-carbon.css +42 -10
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +18 -2
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +42 -10
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +42 -10
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Cascade/Cascade.d.ts +19 -2
  18. package/es/components/Cascade/Cascade.js +12 -9
  19. package/es/components/Coachmark/CoachmarkTagline.js +1 -2
  20. package/es/components/CoachmarkStack/CoachmarkStackHome.js +1 -1
  21. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +14 -5
  22. package/es/components/Datagrid/Datagrid/DatagridRow.js +15 -2
  23. package/es/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +2 -0
  24. package/es/components/Datagrid/Datagrid/addons/Slug/{ColumnHeaderSlug.js → DatagridSlug.js} +4 -4
  25. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +2 -2
  26. package/es/components/Datagrid/useSelectAllToggle.js +1 -1
  27. package/es/components/Datagrid/useSortableColumns.js +2 -2
  28. package/es/components/EmptyStates/EmptyStateContent.d.ts +1 -1
  29. package/es/components/FullPageError/FullPageError.js +41 -15
  30. package/es/components/FullPageError/assets/Error403SVG.d.ts +9 -0
  31. package/es/components/FullPageError/assets/Error403SVG.js +714 -0
  32. package/es/components/FullPageError/assets/Error404SVG.d.ts +9 -0
  33. package/es/components/FullPageError/assets/Error404SVG.js +623 -0
  34. package/es/components/HTTPErrors/HTTPErrorContent.d.ts +1 -1
  35. package/es/components/InterstitialScreen/InterstitialScreen.js +1 -1
  36. package/es/components/Tearsheet/TearsheetShell.js +16 -4
  37. package/es/components/UserAvatar/UserAvatar.js +1 -2
  38. package/es/global/js/hooks/index.d.ts +1 -0
  39. package/es/global/js/hooks/useFocus.d.ts +11 -0
  40. package/es/global/js/hooks/useFocus.js +76 -0
  41. package/lib/components/Cascade/Cascade.d.ts +19 -2
  42. package/lib/components/Cascade/Cascade.js +12 -9
  43. package/lib/components/Coachmark/CoachmarkTagline.js +3 -4
  44. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  45. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +13 -4
  46. package/lib/components/Datagrid/Datagrid/DatagridRow.js +14 -1
  47. package/lib/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +2 -0
  48. package/lib/components/Datagrid/Datagrid/addons/Slug/{ColumnHeaderSlug.js → DatagridSlug.js} +4 -4
  49. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +2 -2
  50. package/lib/components/Datagrid/useSelectAllToggle.js +1 -1
  51. package/lib/components/Datagrid/useSortableColumns.js +2 -2
  52. package/lib/components/EmptyStates/EmptyStateContent.d.ts +1 -1
  53. package/lib/components/FullPageError/FullPageError.js +41 -15
  54. package/lib/components/FullPageError/assets/Error403SVG.d.ts +9 -0
  55. package/lib/components/FullPageError/assets/Error403SVG.js +722 -0
  56. package/lib/components/FullPageError/assets/Error404SVG.d.ts +9 -0
  57. package/lib/components/FullPageError/assets/Error404SVG.js +631 -0
  58. package/lib/components/HTTPErrors/HTTPErrorContent.d.ts +1 -1
  59. package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -3
  60. package/lib/components/Tearsheet/TearsheetShell.js +16 -4
  61. package/lib/components/UserAvatar/UserAvatar.js +1 -2
  62. package/lib/global/js/hooks/index.d.ts +1 -0
  63. package/lib/global/js/hooks/useFocus.d.ts +11 -0
  64. package/lib/global/js/hooks/useFocus.js +80 -0
  65. package/package.json +3 -3
  66. package/scss/components/Datagrid/styles/_datagrid.scss +19 -0
  67. package/scss/components/FilterSummary/_filter-summary.scss +1 -1
  68. package/scss/components/FullPageError/_full-page-error.scss +20 -2
  69. package/scss/components/ProductiveCard/_productive-card.scss +1 -1
  70. package/scss/components/UserAvatar/_user-avatar.scss +8 -5
  71. package/es/components/Datagrid/Datagrid/addons/Slug/ColumnHeaderSlug.d.ts +0 -2
  72. package/es/node_modules/@carbon/icon-helpers/es/index.js +0 -140
  73. package/es/node_modules/@carbon/icons-react/es/Icon.js +0 -73
  74. package/es/node_modules/@carbon/icons-react/es/generated/bucket-0.js +0 -2985
  75. package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +0 -2900
  76. package/es/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3004
  77. package/es/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +0 -14
  78. package/lib/components/Datagrid/Datagrid/addons/Slug/ColumnHeaderSlug.d.ts +0 -2
  79. package/lib/node_modules/@carbon/icon-helpers/es/index.js +0 -145
  80. package/lib/node_modules/@carbon/icons-react/es/Icon.js +0 -81
  81. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-0.js +0 -3117
  82. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-3.js +0 -3032
  83. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3136
  84. package/lib/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +0 -18
@@ -118,7 +118,7 @@ export namespace HTTPErrorContent {
118
118
  "aria-posinset"?: React.Validator<number | null | undefined> | undefined;
119
119
  "aria-pressed"?: React.Validator<boolean | "true" | "false" | "mixed" | null | undefined> | undefined;
120
120
  "aria-readonly"?: React.Validator<(boolean | "true" | "false") | null | undefined> | undefined;
121
- "aria-relevant"?: React.Validator<"text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | null | undefined> | undefined;
121
+ "aria-relevant"?: React.Validator<"all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | null | undefined> | undefined;
122
122
  "aria-required"?: React.Validator<(boolean | "true" | "false") | null | undefined> | undefined;
123
123
  "aria-roledescription"?: React.Validator<string | null | undefined> | undefined;
124
124
  "aria-rowcount"?: React.Validator<number | null | undefined> | undefined;
@@ -16,10 +16,10 @@ var index$1 = require('../../node_modules/classnames/index.js');
16
16
  var devtools = require('../../global/js/utils/devtools.js');
17
17
  var settings = require('../../settings.js');
18
18
  var lodash = require('lodash');
19
+ var icons = require('@carbon/react/icons');
19
20
  var react = require('@carbon/react');
20
21
  var Carousel = require('../Carousel/Carousel.js');
21
22
  var SteppedAnimatedMedia = require('../SteppedAnimatedMedia/SteppedAnimatedMedia.js');
22
- var bucket0 = require('../../node_modules/@carbon/icons-react/es/generated/bucket-0.js');
23
23
 
24
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
25
 
@@ -301,7 +301,7 @@ exports.InterstitialScreen = /*#__PURE__*/React__default["default"].forwardRef(f
301
301
  onClick: handleClickPrev
302
302
  }, previousButtonLabel), isMultiStep && progStep < progStepCeil && /*#__PURE__*/React__default["default"].createElement(react.Button, {
303
303
  className: "".concat(blockClass, "--next-btn"),
304
- renderIcon: bucket0.ArrowRight,
304
+ renderIcon: icons.ArrowRight,
305
305
  ref: nextButtonRef,
306
306
  size: "lg",
307
307
  title: nextButtonLabel,
@@ -309,7 +309,7 @@ exports.InterstitialScreen = /*#__PURE__*/React__default["default"].forwardRef(f
309
309
  }, nextButtonLabel), isMultiStep && progStep === progStepCeil && /*#__PURE__*/React__default["default"].createElement(react.Button, {
310
310
  className: "".concat(blockClass, "--start-btn"),
311
311
  ref: startButtonRef,
312
- renderIcon: bucket0.ArrowRight,
312
+ renderIcon: icons.ArrowRight,
313
313
  size: "lg",
314
314
  title: startButtonLabel,
315
315
  onClick: handleClose
@@ -20,6 +20,7 @@ var getNodeTextContent = require('../../global/js/utils/getNodeTextContent.js');
20
20
  var react = require('@carbon/react');
21
21
  var Wrap = require('../../global/js/utils/Wrap.js');
22
22
  var usePortalTarget = require('../../global/js/hooks/usePortalTarget.js');
23
+ var useFocus = require('../../global/js/hooks/useFocus.js');
23
24
  var ActionSet = require('../ActionSet/ActionSet.js');
24
25
 
25
26
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -89,9 +90,13 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
89
90
  var renderPortalUse = usePortalTarget.usePortalTarget(portalTargetIn);
90
91
  var localRef = React.useRef();
91
92
  var resizer = React.useRef(null);
93
+ var modalBodyRef = React.useRef(null);
92
94
  var modalRef = ref || localRef;
93
95
  var _useResizeObserver = useResizeObserver.useResizeObserver(resizer),
94
96
  width = _useResizeObserver.width;
97
+ var _useFocus = useFocus.useFocus(modalRef),
98
+ firstElement = _useFocus.firstElement,
99
+ keyDownListener = _useFocus.keyDownListener;
95
100
  var wide = size === 'wide';
96
101
 
97
102
  // Keep track of the stack depth and our position in it (1-based, 0=closed)
@@ -129,11 +134,16 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
129
134
 
130
135
  // Callback to give the tearsheet the opportunity to claim focus
131
136
  handleStackChange.claimFocus = function () {
132
- var element = selectorPrimaryFocus ? modalRef.current.querySelector(selectorPrimaryFocus) : modalRef.current;
133
- setTimeout(function () {
134
- return element.focus();
135
- }, 1);
137
+ firstElement === null || firstElement === void 0 || firstElement.focus();
136
138
  };
139
+ React.useEffect(function () {
140
+ if (open) {
141
+ // Focusing the first element
142
+ setTimeout(function () {
143
+ firstElement === null || firstElement === void 0 || firstElement.focus();
144
+ }, 0);
145
+ }
146
+ }, [open, firstElement]);
137
147
  React.useEffect(function () {
138
148
  var notify = function notify() {
139
149
  return stack.all.forEach(function (handler) {
@@ -197,6 +207,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
197
207
  open: open,
198
208
  selectorPrimaryFocus: selectorPrimaryFocus,
199
209
  onFocus: handleFocus,
210
+ onKeyDown: keyDownListener,
200
211
  preventCloseOnClickOutside: !isPassive,
201
212
  ref: modalRef,
202
213
  selectorsFloatingMenus: [".".concat(carbonPrefix, "--overflow-menu-options"), ".".concat(carbonPrefix, "--tooltip"), '.flatpickr-calendar', ".".concat(bc, "__container")],
@@ -224,6 +235,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
224
235
  }, headerActions)), /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
225
236
  className: "".concat(bc, "__header-navigation")
226
237
  }, navigation)), /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
238
+ ref: modalBodyRef,
227
239
  element: react.ModalBody,
228
240
  className: "".concat(bc, "__body")
229
241
  }, /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
@@ -97,7 +97,6 @@ exports.UserAvatar = /*#__PURE__*/React__default["default"].forwardRef(function
97
97
  var SetItem = getItem(renderIcon);
98
98
  var renderUserAvatar = function renderUserAvatar() {
99
99
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
100
- tabIndex: 0,
101
100
  className: index$1["default"](blockClass,
102
101
  // Apply the block class to the main HTML element
103
102
  className, // Apply any supplied class names to the main HTML element.
@@ -108,7 +107,7 @@ exports.UserAvatar = /*#__PURE__*/React__default["default"].forwardRef(function
108
107
  // example: [`${blockClass}__here-if-small`]: size === 'sm',
109
108
  }),
110
109
  ref: ref,
111
- role: "button"
110
+ role: "img"
112
111
  }, devtools.getDevtoolsProps(componentName)), _SetItem || (_SetItem = /*#__PURE__*/React__default["default"].createElement(SetItem, null)));
113
112
  };
114
113
  return SetItem && (tooltipText ? /*#__PURE__*/React__default["default"].createElement(react.Tooltip, {
@@ -9,4 +9,5 @@ export { useRetrieveStepData } from "./useRetrieveStepData";
9
9
  export { useValidCreateStepCount } from "./useValidCreateStepCount";
10
10
  export { useControllableState } from "./useControllableState";
11
11
  export { usePrefix } from "./usePrefix";
12
+ export { useFocus } from "./useFocus";
12
13
  export { useNearestScroll, useWindowScroll } from "./useWindowScroll";
@@ -0,0 +1,11 @@
1
+ export function useFocus(modalRef: any): {
2
+ firstElement: any;
3
+ lastElement: any;
4
+ allElements: any;
5
+ keyDownListener: (event: any) => void;
6
+ getFocusable: () => {
7
+ first: any;
8
+ last: any;
9
+ all: any;
10
+ };
11
+ };
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var react = require('@carbon/react');
13
+ var settings = require('../../../settings.js');
14
+ var React = require('react');
15
+
16
+ var useFocus = function useFocus(modalRef) {
17
+ var carbonPrefix = react.usePrefix();
18
+ var tearsheetBaseClass = "".concat(settings.pkg.prefix, "--tearsheet");
19
+ // Querying focusable element in the modal
20
+ // Query to exclude hidden elements in the modal from querySelectorAll() method
21
+ // feel free to include more if needed :)
22
+ var notQuery = ":not(.".concat(carbonPrefix, "--visually-hidden,.").concat(tearsheetBaseClass, "__header--no-close-icon,.").concat(carbonPrefix, "--btn--disabled,[aria-hidden=\"true\"],[tabindex=\"-1\"])");
23
+ // Queries to include element types button, input, select, textarea
24
+ var queryButton = "button".concat(notQuery);
25
+ var queryInput = "input".concat(notQuery);
26
+ var querySelect = "select".concat(notQuery);
27
+ var queryTextarea = "textarea".concat(notQuery);
28
+ var queryLink = "[href]".concat(notQuery);
29
+ // Final query
30
+ var query = "".concat(queryButton, ",").concat(queryLink, ",").concat(queryInput, ",").concat(querySelect, ",").concat(queryTextarea);
31
+ var modalEl = modalRef === null || modalRef === void 0 ? void 0 : modalRef.current;
32
+ var getFocusable = React.useCallback(function () {
33
+ // Selecting all focusable elements based on the above conditions
34
+ var focusableElements = modalEl === null || modalEl === void 0 ? void 0 : modalEl.querySelectorAll("".concat(query));
35
+ var first = focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements[0];
36
+ var last = focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements[(focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements.length) - 1];
37
+ var all = focusableElements;
38
+ return {
39
+ first: first,
40
+ last: last,
41
+ all: all
42
+ };
43
+ }, [modalEl, query]);
44
+ React.useEffect(function () {
45
+ getFocusable();
46
+ }, [getFocusable]);
47
+ var handleKeyDown = function handleKeyDown(event) {
48
+ // Checking whether the key is tab or not
49
+ if (event.key === 'Tab') {
50
+ // updating the focusable elements list
51
+ var _getFocusable = getFocusable(),
52
+ first = _getFocusable.first,
53
+ last = _getFocusable.last,
54
+ all = _getFocusable.all;
55
+ setTimeout(function () {
56
+ var _document, _document2;
57
+ if (event.shiftKey && !Array.prototype.includes.call(all, (_document = document) === null || _document === void 0 ? void 0 : _document.activeElement)) {
58
+ // Prevents the default "Tab" behavior
59
+ event.preventDefault();
60
+ // if the user press shift+tab and the current element not in focusable items
61
+ last === null || last === void 0 || last.focus();
62
+ } else if (!Array.prototype.includes.call(all, (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.activeElement)) {
63
+ event.preventDefault();
64
+ // user pressing tab key only then
65
+ // focusing the first element if the current element is not in focusable items
66
+ first === null || first === void 0 || first.focus();
67
+ }
68
+ }, 0);
69
+ }
70
+ };
71
+ return {
72
+ firstElement: getFocusable().first,
73
+ lastElement: getFocusable().last,
74
+ allElements: getFocusable().all,
75
+ keyDownListener: handleKeyDown,
76
+ getFocusable: getFocusable
77
+ };
78
+ };
79
+
80
+ exports.useFocus = useFocus;
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.25.0",
4
+ "version": "2.26.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -89,7 +89,7 @@
89
89
  },
90
90
  "dependencies": {
91
91
  "@babel/runtime": "^7.23.9",
92
- "@carbon/ibm-products-styles": "^2.24.0",
92
+ "@carbon/ibm-products-styles": "^2.25.0",
93
93
  "@carbon/telemetry": "^0.1.0",
94
94
  "@dnd-kit/core": "^6.0.8",
95
95
  "@dnd-kit/sortable": "^8.0.0",
@@ -112,5 +112,5 @@
112
112
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
113
113
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
114
114
  },
115
- "gitHead": "81d80c8227765937cee54e2068800de818ebefb6"
115
+ "gitHead": "ee89db345a5a5004e6d18e0a36df85ea8e7c9f8f"
116
116
  }
@@ -162,6 +162,15 @@
162
162
  @include ai-gradient('top', 100%);
163
163
  }
164
164
 
165
+ .#{$block-class}
166
+ .#{c4p-settings.$carbon-prefix}--data-table
167
+ tbody
168
+ tr:has(> .#{$block-class}__table-row-ai-enabled) {
169
+ @include ai-gradient('left', 50%);
170
+
171
+ background-attachment: fixed;
172
+ }
173
+
165
174
  .#{$block-class}
166
175
  th.#{$block-class}__with-slug
167
176
  .#{c4p-settings.$carbon-prefix}--slug {
@@ -791,3 +800,13 @@
791
800
  .#{$block-class} .#{$block-class}__col-resizer-range::-moz-range-thumb {
792
801
  visibility: hidden;
793
802
  }
803
+
804
+ .#{$block-class} .#{$block-class}__table-row-ai-enabled {
805
+ display: flex;
806
+ align-items: center;
807
+ }
808
+
809
+ .#{$block-class} .#{$block-class}__table-row-ai-spacer,
810
+ .#{$block-class} .#{$block-class}__table-row-ai-enabled {
811
+ width: $spacing-05;
812
+ }
@@ -17,7 +17,7 @@ $block-class: #{$pkg-prefix}--filter-summary;
17
17
  width: 100%;
18
18
  /* stylelint-disable-next-line -- to-rem carbon replacement for rem */
19
19
  height: to-rem(48px);
20
- align-items: start;
20
+ align-items: flex-start;
21
21
  padding: $spacing-03;
22
22
  border-top: 1px solid $border-subtle-01;
23
23
  background: $layer-01;
@@ -43,8 +43,14 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
43
43
  padding: 0 $spacing-07 0 0;
44
44
  }
45
45
  }
46
- .#{$block-class}__error-svg {
47
- margin: auto $spacing-03 $spacing-11 $spacing-03;
46
+
47
+ .#{$block-class}__error-svg-container {
48
+ display: flex;
49
+ height: 100%;
50
+ margin: $spacing-03 $spacing-03 $spacing-11 $spacing-03;
51
+ @include breakpoint(md) {
52
+ margin: auto $spacing-03 $spacing-11 $spacing-03;
53
+ }
48
54
  }
49
55
 
50
56
  .#{$block-class}__error-label,
@@ -53,6 +59,7 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
53
59
  }
54
60
 
55
61
  .#{$block-class}__error-label {
62
+ display: block;
56
63
  color: $text-error;
57
64
  }
58
65
  .#{$block-class}__error-title {
@@ -64,3 +71,14 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
64
71
 
65
72
  margin-bottom: $spacing-07;
66
73
  }
74
+
75
+ // safari rendering fix
76
+ .#{$block-class}__error-svg-container svg.#{$block-class}__error-svg {
77
+ width: 100%;
78
+ }
79
+
80
+ // svg theme styles
81
+ .#{$block-class}__error-svg-container svg.#{$block-class}__error-svg path {
82
+ fill: $background;
83
+ stroke: $border-inverse;
84
+ }
@@ -99,6 +99,6 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
99
99
  }
100
100
 
101
101
  .#{$block-class}__header-container {
102
- align-items: start;
102
+ align-items: flex-start;
103
103
  }
104
104
  }
@@ -24,6 +24,7 @@
24
24
  $block-class: #{$pkg-prefix}--user-avatar;
25
25
 
26
26
  .#{$block-class} {
27
+ position: relative;
27
28
  display: flex;
28
29
  width: 4rem;
29
30
  height: 4rem;
@@ -35,16 +36,18 @@ $block-class: #{$pkg-prefix}--user-avatar;
35
36
  outline-offset: 3px;
36
37
  }
37
38
 
38
- @mixin setBgColor($color) {
39
- // stylelint-disable-next-line carbon/theme-token-use
40
- background-color: $color;
41
-
42
- &:focus {
39
+ .#{$block-class}__tooltip {
40
+ &:focus-within .#{$block-class} {
43
41
  // stylelint-disable-next-line carbon/theme-token-use
44
42
  outline: 2px solid $focus;
45
43
  }
46
44
  }
47
45
 
46
+ @mixin setBgColor($color) {
47
+ // stylelint-disable-next-line carbon/theme-token-use
48
+ background-color: $color;
49
+ }
50
+
48
51
  .#{$block-class}--light-cyan {
49
52
  @include setBgColor($cyan-50);
50
53
  }
@@ -1,2 +0,0 @@
1
- export const ColumnHeaderSlug: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- import React from 'react';
@@ -1,140 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 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 { typeof as _typeof } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
9
-
10
- function ownKeys(object, enumerableOnly) {
11
- var keys = Object.keys(object);
12
- if (Object.getOwnPropertySymbols) {
13
- var symbols = Object.getOwnPropertySymbols(object);
14
- enumerableOnly && (symbols = symbols.filter(function (sym) {
15
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
16
- })), keys.push.apply(keys, symbols);
17
- }
18
- return keys;
19
- }
20
- function _objectSpread2(target) {
21
- for (var i = 1; i < arguments.length; i++) {
22
- var source = null != arguments[i] ? arguments[i] : {};
23
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
24
- _defineProperty(target, key, source[key]);
25
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
26
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
27
- });
28
- }
29
- return target;
30
- }
31
- function _defineProperty(obj, key, value) {
32
- key = _toPropertyKey(key);
33
- if (key in obj) {
34
- Object.defineProperty(obj, key, {
35
- value: value,
36
- enumerable: true,
37
- configurable: true,
38
- writable: true
39
- });
40
- } else {
41
- obj[key] = value;
42
- }
43
- return obj;
44
- }
45
- function _objectWithoutPropertiesLoose(source, excluded) {
46
- if (source == null) return {};
47
- var target = {};
48
- var sourceKeys = Object.keys(source);
49
- var key, i;
50
- for (i = 0; i < sourceKeys.length; i++) {
51
- key = sourceKeys[i];
52
- if (excluded.indexOf(key) >= 0) continue;
53
- target[key] = source[key];
54
- }
55
- return target;
56
- }
57
- function _objectWithoutProperties(source, excluded) {
58
- if (source == null) return {};
59
- var target = _objectWithoutPropertiesLoose(source, excluded);
60
- var key, i;
61
- if (Object.getOwnPropertySymbols) {
62
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
63
- for (i = 0; i < sourceSymbolKeys.length; i++) {
64
- key = sourceSymbolKeys[i];
65
- if (excluded.indexOf(key) >= 0) continue;
66
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
67
- target[key] = source[key];
68
- }
69
- }
70
- return target;
71
- }
72
- function _toPrimitive(input, hint) {
73
- if (_typeof(input) !== "object" || input === null) return input;
74
- var prim = input[Symbol.toPrimitive];
75
- if (prim !== undefined) {
76
- var res = prim.call(input, hint || "default");
77
- if (_typeof(res) !== "object") return res;
78
- throw new TypeError("@@toPrimitive must return a primitive value.");
79
- }
80
- return (hint === "string" ? String : Number)(input);
81
- }
82
- function _toPropertyKey(arg) {
83
- var key = _toPrimitive(arg, "string");
84
- return _typeof(key) === "symbol" ? key : String(key);
85
- }
86
- var _excluded = ["width", "height", "viewBox"],
87
- _excluded2 = ["tabindex"];
88
- /**
89
- * Copyright IBM Corp. 2018, 2024
90
- *
91
- * This source code is licensed under the Apache-2.0 license found in the
92
- * LICENSE file in the root directory of this source tree.
93
- */
94
-
95
- var defaultAttributes = {
96
- // Reference:
97
- // https://github.com/IBM/carbon-components-react/issues/1392
98
- // https://github.com/PolymerElements/iron-iconset-svg/pull/47
99
- // `focusable` is a string attribute which is why we do not use a boolean here
100
- focusable: 'false',
101
- preserveAspectRatio: 'xMidYMid meet'
102
- };
103
-
104
- /**
105
- * Get supplementary HTML attributes for a given <svg> element based on existing
106
- * attributes.
107
- */
108
- function getAttributes() {
109
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
110
- width = _ref.width,
111
- height = _ref.height,
112
- _ref$viewBox = _ref.viewBox,
113
- viewBox = _ref$viewBox === void 0 ? "0 0 ".concat(width, " ").concat(height) : _ref$viewBox,
114
- attributes = _objectWithoutProperties(_ref, _excluded);
115
- var tabindex = attributes.tabindex,
116
- rest = _objectWithoutProperties(attributes, _excluded2);
117
- var iconAttributes = _objectSpread2(_objectSpread2(_objectSpread2({}, defaultAttributes), rest), {}, {
118
- width: width,
119
- height: height,
120
- viewBox: viewBox
121
- });
122
-
123
- // TODO: attributes.title assumes that the consumer will implement <title> and
124
- // correctly set `aria-labelledby`.
125
- if (iconAttributes['aria-label'] || iconAttributes['aria-labelledby'] || iconAttributes.title) {
126
- iconAttributes.role = 'img';
127
-
128
- // Reference:
129
- // https://allyjs.io/tutorials/focusing-in-svg.html
130
- if (tabindex !== undefined && tabindex !== null) {
131
- iconAttributes.focusable = 'true';
132
- iconAttributes.tabindex = tabindex;
133
- }
134
- } else {
135
- iconAttributes['aria-hidden'] = true;
136
- }
137
- return iconAttributes;
138
- }
139
-
140
- export { defaultAttributes, getAttributes };
@@ -1,73 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 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 { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
9
- import { getAttributes } from '../../icon-helpers/es/index.js';
10
- import PropTypes from '../../../prop-types/index.js';
11
- import React__default from 'react';
12
-
13
- var _excluded = ["className", "children", "tabIndex", "xmlns", "preserveAspectRatio"],
14
- _excluded2 = ["tabindex"];
15
-
16
- /**
17
- * Copyright IBM Corp. 2019, 2023
18
- *
19
- * This source code is licensed under the Apache-2.0 license found in the
20
- * LICENSE file in the root directory of this source tree.
21
- */
22
- var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(_ref, ref) {
23
- var className = _ref.className,
24
- children = _ref.children,
25
- tabIndex = _ref.tabIndex,
26
- _ref$xmlns = _ref.xmlns,
27
- xmlns = _ref$xmlns === void 0 ? 'http://www.w3.org/2000/svg' : _ref$xmlns,
28
- _ref$preserveAspectRa = _ref.preserveAspectRatio,
29
- preserveAspectRatio = _ref$preserveAspectRa === void 0 ? 'xMidYMid meet' : _ref$preserveAspectRa,
30
- rest = _objectWithoutProperties(_ref, _excluded);
31
- var _getAttributes = getAttributes(_objectSpread2(_objectSpread2({}, rest), {}, {
32
- tabindex: tabIndex
33
- })),
34
- tabindex = _getAttributes.tabindex,
35
- attrs = _objectWithoutProperties(_getAttributes, _excluded2);
36
- var props = attrs;
37
- if (className) {
38
- props.className = className;
39
- }
40
- if (tabindex !== undefined && tabindex !== null) {
41
- if (typeof tabindex === 'number') {
42
- props.tabIndex = tabindex;
43
- } else {
44
- props.tabIndex = Number(tabIndex);
45
- }
46
- }
47
- if (ref) {
48
- props.ref = ref;
49
- }
50
- if (xmlns) {
51
- props.xmlns = xmlns;
52
- }
53
- if (preserveAspectRatio) {
54
- props.preserveAspectRatio = preserveAspectRatio;
55
- }
56
- return /*#__PURE__*/React__default.createElement('svg', props, children);
57
- });
58
- Icon.displayName = 'Icon';
59
- Icon.propTypes = {
60
- 'aria-hidden': PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['true', 'false'])]),
61
- 'aria-label': PropTypes.string,
62
- 'aria-labelledby': PropTypes.string,
63
- children: PropTypes.node,
64
- className: PropTypes.string,
65
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
66
- preserveAspectRatio: PropTypes.string,
67
- tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
68
- viewBox: PropTypes.string,
69
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
70
- xmlns: PropTypes.string
71
- };
72
-
73
- export { Icon as default };