@carbon/ibm-products 2.0.0-rc.27 → 2.0.0-rc.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. package/css/config.css +3 -0
  2. package/css/config.css.map +1 -0
  3. package/css/index-full-carbon.css +126 -355
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +6 -6
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +196 -252
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +4 -4
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +126 -355
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +6 -6
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +126 -355
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +6 -6
  18. package/css/index.min.css.map +1 -1
  19. package/es/components/AboutModal/AboutModal.js +44 -66
  20. package/es/components/ActionBar/ActionBar.js +13 -29
  21. package/es/components/AddSelect/AddSelectBody.js +4 -2
  22. package/es/components/AddSelect/AddSelectColumn.js +11 -5
  23. package/es/components/AddSelect/AddSelectFilter.js +5 -4
  24. package/es/components/AddSelect/AddSelectRow.js +3 -3
  25. package/es/components/AddSelect/AddSelectSort.js +2 -1
  26. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +15 -21
  27. package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
  28. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +7 -8
  29. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
  30. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
  31. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
  32. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
  33. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
  34. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
  35. package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +19 -1
  36. package/es/components/Datagrid/index.js +1 -0
  37. package/es/components/Datagrid/useEditableCell.js +13 -0
  38. package/es/components/Datagrid/useFiltering.js +4 -2
  39. package/es/components/Datagrid/useInlineEdit.js +16 -11
  40. package/es/components/Datagrid/useOnRowClick.js +11 -1
  41. package/es/components/Datagrid/useSelectRows.js +2 -0
  42. package/es/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +92 -30
  43. package/es/components/{InlineEdit → EditInPlace}/index.js +1 -1
  44. package/es/components/ExampleComponent/ExampleDeprecatedComponent.js +24 -0
  45. package/es/components/PageHeader/PageHeader.js +36 -35
  46. package/es/components/PageHeader/PageHeaderTitle.js +18 -18
  47. package/es/components/SidePanel/SidePanel.js +25 -26
  48. package/es/components/TagSet/TagSet.js +5 -7
  49. package/es/components/Tearsheet/Tearsheet.js +5 -0
  50. package/es/components/Tearsheet/TearsheetShell.js +4 -6
  51. package/es/components/index.js +1 -2
  52. package/es/global/js/hooks/useResizeObserver.js +79 -0
  53. package/es/global/js/hooks/useWindowResize.js +6 -0
  54. package/es/global/js/hooks/useWindowScroll.js +7 -0
  55. package/es/global/js/package-settings.js +4 -6
  56. package/es/settings.js +40 -20
  57. package/lib/components/AboutModal/AboutModal.js +43 -66
  58. package/lib/components/ActionBar/ActionBar.js +13 -29
  59. package/lib/components/AddSelect/AddSelectBody.js +4 -2
  60. package/lib/components/AddSelect/AddSelectColumn.js +11 -5
  61. package/lib/components/AddSelect/AddSelectFilter.js +4 -3
  62. package/lib/components/AddSelect/AddSelectRow.js +2 -2
  63. package/lib/components/AddSelect/AddSelectSort.js +2 -1
  64. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +13 -19
  65. package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
  66. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +2 -1
  67. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +5 -4
  68. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
  69. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
  70. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
  71. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
  72. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
  73. package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +18 -1
  74. package/lib/components/Datagrid/index.js +8 -0
  75. package/lib/components/Datagrid/useEditableCell.js +23 -0
  76. package/lib/components/Datagrid/useFiltering.js +4 -2
  77. package/lib/components/Datagrid/useInlineEdit.js +22 -11
  78. package/lib/components/Datagrid/useOnRowClick.js +11 -1
  79. package/lib/components/Datagrid/useSelectRows.js +2 -0
  80. package/lib/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +100 -34
  81. package/lib/components/{InlineEdit → EditInPlace}/index.js +3 -3
  82. package/lib/components/ExampleComponent/ExampleDeprecatedComponent.js +38 -0
  83. package/lib/components/PageHeader/PageHeader.js +36 -35
  84. package/lib/components/PageHeader/PageHeaderTitle.js +19 -19
  85. package/lib/components/SidePanel/SidePanel.js +25 -26
  86. package/lib/components/TagSet/TagSet.js +5 -7
  87. package/lib/components/Tearsheet/Tearsheet.js +5 -0
  88. package/lib/components/Tearsheet/TearsheetShell.js +4 -6
  89. package/lib/components/index.js +7 -15
  90. package/lib/global/js/hooks/useResizeObserver.js +91 -0
  91. package/lib/global/js/hooks/useWindowScroll.js +6 -0
  92. package/lib/global/js/package-settings.js +4 -6
  93. package/lib/settings.js +43 -21
  94. package/package.json +3 -4
  95. package/scss/components/AboutModal/_about-modal.scss +34 -53
  96. package/scss/components/AboutModal/_storybook-styles.scss +10 -4
  97. package/scss/components/AddSelect/_add-select.scss +7 -3
  98. package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +10 -1
  99. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +1 -1
  100. package/scss/components/Datagrid/styles/_useSelectAllToggle.scss +11 -7
  101. package/scss/components/{InlineEditV2/_inline-edit-v2.scss → EditInPlace/_edit-in-place.scss} +56 -14
  102. package/scss/components/{InlineEditV1 → EditInPlace}/_index-with-carbon.scss +1 -1
  103. package/scss/components/{InlineEditV2 → EditInPlace}/_index.scss +1 -1
  104. package/scss/components/{InlineEditV1 → EditInPlace}/_storybook-styles.scss +3 -15
  105. package/scss/components/PageHeader/_page-header.scss +1 -7
  106. package/scss/components/_index-released-only-with-carbon.scss +1 -1
  107. package/scss/components/_index-released-only.scss +1 -1
  108. package/scss/components/_index-with-carbon.scss +1 -3
  109. package/scss/components/_index.scss +1 -3
  110. package/scss/config.scss +1 -0
  111. package/es/components/InlineEdit/InlineEdit.js +0 -47
  112. package/es/components/InlineEditV1/InlineEditV1.js +0 -442
  113. package/es/components/InlineEditV1/index.js +0 -7
  114. package/es/components/InlineEditV2/index.js +0 -7
  115. package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -34
  116. package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -47
  117. package/es/components/ModifiedTabs/ModifiedTabs.js +0 -141
  118. package/es/components/ModifiedTabs/index.js +0 -1
  119. package/lib/components/InlineEdit/InlineEdit.js +0 -63
  120. package/lib/components/InlineEditV1/InlineEditV1.js +0 -459
  121. package/lib/components/InlineEditV1/index.js +0 -13
  122. package/lib/components/InlineEditV2/index.js +0 -13
  123. package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -50
  124. package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -63
  125. package/lib/components/ModifiedTabs/ModifiedTabs.js +0 -164
  126. package/lib/components/ModifiedTabs/index.js +0 -13
  127. package/scss/components/InlineEditV1/_carbon-imports.scss +0 -6
  128. package/scss/components/InlineEditV1/_index.scss +0 -8
  129. package/scss/components/InlineEditV1/_inline-edit-v1.scss +0 -269
  130. package/scss/components/InlineEditV2/_index-with-carbon.scss +0 -9
  131. package/scss/components/InlineEditV2/_storybook-styles.scss +0 -9
  132. package/scss/components/ModifiedTabs/_carbon-imports.scss +0 -10
  133. package/scss/components/ModifiedTabs/_index-with-carbon.scss +0 -9
  134. package/scss/components/ModifiedTabs/_index.scss +0 -8
  135. package/scss/components/ModifiedTabs/_modified-tabs.scss +0 -89
  136. package/scss/components/ModifiedTabs/_storybook-styles.scss +0 -6
  137. /package/scss/components/{InlineEditV2 → EditInPlace}/_carbon-imports.scss +0 -0
@@ -1,164 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.ModifiedTabs = void 0;
11
-
12
- var _react = _interopRequireWildcard(require("react"));
13
-
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
- var _classnames = _interopRequireDefault(require("classnames"));
17
-
18
- var _react2 = require("@carbon/react");
19
-
20
- var _ModifiedTabLabelWithClose = require("./ModifiedTabLabelWithClose");
21
-
22
- var _ModifiedTabLabelNew = require("./ModifiedTabLabelNew");
23
-
24
- var _settings = require("../../settings");
25
-
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
-
30
- //
31
- // Copyright IBM Corp. 2020, 2020
32
- //
33
- // This source code is licensed under the Apache-2.0 license found in the
34
- // LICENSE file in the root directory of this source tree.
35
- //
36
- var blockClass = "".concat(_settings.pkg.prefix, "--modified-tabs");
37
- var componentName = 'ModifiedTabs'; // Default values for props
38
-
39
- var defaults = {
40
- newTabLabel: 'New tab',
41
- newTabContent: 'Your new tab will be here soon',
42
- onNewTab: undefined,
43
- onCloseTab: undefined,
44
- tabs: []
45
- };
46
- var ModifiedTabs = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
47
- var className = _ref.className,
48
- _ref$tabs = _ref.tabs,
49
- tabs = _ref$tabs === void 0 ? defaults.tabs : _ref$tabs,
50
- _ref$newTabLabel = _ref.newTabLabel,
51
- newTabLabel = _ref$newTabLabel === void 0 ? defaults.newTabLabel : _ref$newTabLabel,
52
- _ref$newTabContent = _ref.newTabContent,
53
- newTabContent = _ref$newTabContent === void 0 ? defaults.newTabContent : _ref$newTabContent,
54
- _ref$onNewTab = _ref.onNewTab,
55
- onNewTab = _ref$onNewTab === void 0 ? defaults.onNewTab : _ref$onNewTab,
56
- _ref$onCloseTab = _ref.onCloseTab,
57
- onCloseTab = _ref$onCloseTab === void 0 ? defaults.onCloseTab : _ref$onCloseTab,
58
- tabListAriaLabel = _ref.tabListAriaLabel;
59
- var tabsRef = (0, _react.useRef)();
60
- var localRef = ref || tabsRef;
61
-
62
- var handleNewTab = function handleNewTab() {
63
- if (onNewTab) {
64
- onNewTab();
65
- setTimeout(function () {
66
- // set focus to the new tab
67
- var addNewTabButton = localRef.current.querySelector(".".concat(blockClass, "__tab-new"));
68
- var tab = addNewTabButton === null || addNewTabButton === void 0 ? void 0 : addNewTabButton.previousSibling;
69
- tab === null || tab === void 0 ? void 0 : tab.focus();
70
- });
71
- }
72
- };
73
-
74
- var handleClose = function handleClose(id) {
75
- if (onCloseTab) {
76
- onCloseTab(id);
77
- }
78
- };
79
-
80
- return /*#__PURE__*/_react.default.createElement("div", {
81
- className: (0, _classnames.default)(blockClass, className),
82
- ref: localRef
83
- }, /*#__PURE__*/_react.default.createElement(_react2.Tabs, {
84
- className: "modified-tabs"
85
- }, /*#__PURE__*/_react.default.createElement(_react2.TabList, {
86
- "aria-label": tabListAriaLabel
87
- }, tabs.map(function (tab) {
88
- return /*#__PURE__*/_react.default.createElement(_react2.Tab, {
89
- key: tab.id
90
- }, /*#__PURE__*/_react.default.createElement(_ModifiedTabLabelWithClose.ModifiedTabLabelWithClose, {
91
- label: tab.label,
92
- onClose: function onClose() {
93
- return handleClose(tab.id);
94
- },
95
- unsavedContent: tab.unsavedContent
96
- }));
97
- }), /*#__PURE__*/_react.default.createElement(_react2.Tab, {
98
- id: "modified-tabs__tab-new",
99
- onClick: handleNewTab,
100
- onKeyUp: function onKeyUp(ev) {
101
- return ev.keyCode === 32 && handleNewTab();
102
- },
103
- role: "button",
104
- className: "".concat(blockClass, "__tab-new")
105
- }, /*#__PURE__*/_react.default.createElement(_ModifiedTabLabelNew.ModifiedTabLabelNew, {
106
- label: newTabLabel
107
- }))), /*#__PURE__*/_react.default.createElement(_react2.TabPanels, null, tabs.map(function (tab) {
108
- var _tab$content;
109
-
110
- return /*#__PURE__*/_react.default.createElement(_react2.TabPanel, {
111
- key: tab.id,
112
- id: tab.id
113
- }, /*#__PURE__*/_react.default.createElement("div", {
114
- className: "".concat(blockClass, "__tab-content")
115
- }, (_tab$content = tab.content) === null || _tab$content === void 0 ? void 0 : _tab$content.call(tab)));
116
- }), /*#__PURE__*/_react.default.createElement(_react2.TabPanel, null, /*#__PURE__*/_react.default.createElement("div", {
117
- className: "".concat(blockClass, "__tab-content")
118
- }, newTabContent)))));
119
- }); // Return a placeholder if not released and not enabled by feature flag
120
-
121
- exports.ModifiedTabs = ModifiedTabs;
122
- exports.ModifiedTabs = ModifiedTabs = _settings.pkg.checkComponentEnabled(ModifiedTabs, componentName);
123
- ModifiedTabs.propTypes = {
124
- /**
125
- * Provide an optional class to be applied to the containing node.
126
- */
127
- className: _propTypes.default.string,
128
-
129
- /**
130
- * New tab content
131
- */
132
- newTabContent: _propTypes.default.object,
133
-
134
- /**
135
- * New tab label
136
- */
137
- newTabLabel: _propTypes.default.string,
138
-
139
- /**
140
- * Optional onCloseTab handler
141
- */
142
- onCloseTab: _propTypes.default.func,
143
-
144
- /**
145
- * New tab content
146
- */
147
- onNewTab: _propTypes.default.func,
148
-
149
- /**
150
- * Tab list aria label, passed to Carbon TabList
151
- */
152
- tabListAriaLabel: _propTypes.default.string.isRequired,
153
-
154
- /**
155
- * Tabs array containing tab object { id, label, content }
156
- */
157
- tabs: _propTypes.default.arrayOf(_propTypes.default.shape({
158
- id: _propTypes.default.string,
159
- label: _propTypes.default.node,
160
- content: _propTypes.default.func,
161
- unsavedContent: _propTypes.default.bool
162
- })).isRequired
163
- };
164
- ModifiedTabs.displayName = componentName;
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ModifiedTabs", {
7
- enumerable: true,
8
- get: function get() {
9
- return _ModifiedTabs.ModifiedTabs;
10
- }
11
- });
12
-
13
- var _ModifiedTabs = require("./ModifiedTabs");
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2022, 2022
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
- //
@@ -1,8 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2022, 2022
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 './inline-edit-v1';
@@ -1,269 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2022, 2022
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
- // Standard imports.
9
- @use '@carbon/styles/scss/theme' as *;
10
- @use '@carbon/styles/scss/spacing' as *;
11
- @use '@carbon/styles/scss/motion' as *;
12
- @use '../../global/styles/project-settings' as c4p-settings;
13
- @use '../../global/styles/mixins' as *;
14
-
15
- // Other Carbon settings.
16
- // TODO: @use '@carbon/react/scss/grid'; if needed
17
-
18
- // InlineEdit uses the following Carbon components:
19
- // TODO: @use(s) of Carbon component styles used by InlineEdit
20
-
21
- // InlineEdit uses the following Carbon for IBM Products components:
22
- // TODO: @use(s) of IBM Products component styles used by InlineEdit
23
-
24
- // cut down version borrowed from 'carbon-components/scss/globals/scss/vendor/@carbon/styles/scss/utilities/focus-outline';
25
- @mixin input-outline($color: $focus) {
26
- /* stylelint-disable-next-line carbon/theme-token-use */
27
- outline: $spacing-01 solid $color;
28
- outline-offset: calc(-1 * #{$spacing-01});
29
-
30
- @media screen and (prefers-contrast) {
31
- outline-style: dotted;
32
- }
33
- }
34
-
35
- // The block part of our conventional BEM class names (blockClass__E--M).
36
- $block-class: #{c4p-settings.$pkg-prefix}--inline-edit;
37
-
38
- @include block-wrap($block-class) {
39
- --#{$block-class}--size: #{$spacing-08};
40
- --#{$block-class}--icon-size: #{$spacing-05};
41
- --#{$block-class}--background-color: #{$layer-01};
42
- --#{$block-class}--toolbar-width: calc(2 * var(--#{$block-class}--size));
43
-
44
- &.#{$block-class}--light {
45
- --#{$block-class}--background-color: transparent;
46
- }
47
-
48
- &:hover {
49
- --#{$block-class}--background-color: #{$background-hover};
50
- }
51
-
52
- position: relative;
53
- display: inline-block;
54
- // A standard input box is based on size (often around 150px)
55
- // In our case there are potentially 2 * size buttons which we double
56
- min-width: calc(4 * var(--#{$block-class}--size));
57
- max-width: 100%;
58
- height: var(--#{$block-class}--size);
59
- background-color: var(--#{$block-class}--background-color);
60
- cursor: text; // appear to be part of the text box
61
- transition: background-color $duration-fast-01 motion(entrance, productive),
62
- box-shadow $duration-fast-01 motion(entrance, productive),
63
- border-color $duration-fast-01 motion(entrance, productive);
64
- vertical-align: middle; // mis-aligned items cause height to grow beyond setting.
65
-
66
- white-space: nowrap;
67
-
68
- &.#{$block-class}--sm {
69
- --#{$block-class}--size: #{$spacing-07};
70
- --#{$block-class}--icon-size: #{$spacing-05};
71
- }
72
-
73
- &.#{$block-class}--lg {
74
- --#{$block-class}--size: #{$spacing-09};
75
- --#{$block-class}--icon-size: #{$spacing-05};
76
- }
77
-
78
- &.#{$block-class}--invalid {
79
- // editing takes precedence over invalid
80
- @include input-outline($support-error);
81
- }
82
-
83
- &.#{$block-class}--editing {
84
- @include input-outline($focus);
85
-
86
- background-color: $layer-01;
87
- }
88
-
89
- .#{$block-class}__input {
90
- display: inline-block;
91
- overflow: hidden;
92
- // positions text and placeholder including when showing placeholder
93
- // NOTE: Using flex does strange things to a caret in content editable
94
- width: calc(100% - var(--#{$block-class}--toolbar-width) - #{$spacing-05});
95
- max-width: calc(
96
- 100% - var(--#{$block-class}--toolbar-width) - #{$spacing-05}
97
- );
98
- min-height: var(--#{$block-class}--size);
99
- /* stylelint-disable-next-line carbon/layout-token-use */
100
- margin-right: var(--#{$block-class}--toolbar-width);
101
- // room for toolbar
102
- margin-left: $spacing-05;
103
- color: $text-primary;
104
- font-family: inherit;
105
- // stylelint-disable-next-line carbon/type-token-use
106
- line-height: var(--#{$block-class}--size);
107
-
108
- &:focus {
109
- outline: none;
110
- }
111
- }
112
-
113
- &.#{$block-class}--invalid .#{$block-class}__input {
114
- // add space for validation
115
- --#{$block-class}--toolbar-width: calc(3 * var(--#{$block-class}--size));
116
- }
117
-
118
- .#{$block-class}__input::after {
119
- position: absolute;
120
- top: 0;
121
- left: 0;
122
- display: block;
123
- overflow: hidden;
124
- width: 0;
125
- margin-left: $spacing-05;
126
- color: $text-helper;
127
- content: attr(data-placeholder);
128
- opacity: 0;
129
- visibility: hidden;
130
- }
131
-
132
- .#{$block-class}__ellipsis {
133
- display: inline-block;
134
- overflow: hidden;
135
- width: 0;
136
- height: var(--#{$block-class}--size);
137
- // stylelint-disable-next-line carbon/type-token-use
138
- line-height: var(--#{$block-class}--size);
139
- opacity: 0;
140
- pointer-events: none;
141
-
142
- // only transition fade in
143
- transition: opacity $duration-moderate-02 motion(standard, productive);
144
- }
145
-
146
- &.#{$block-class}--overflows:not(.#{$block-class}--editing)
147
- .#{$block-class}__ellipsis {
148
- width: initial;
149
- opacity: 1;
150
- }
151
-
152
- .#{$block-class}__disabled-cover {
153
- position: absolute;
154
- top: 0;
155
- left: 0;
156
- width: 100%;
157
- height: 100%;
158
- pointer-events: none; // act as if not there
159
- }
160
-
161
- &.#{$block-class}--disabled .#{$block-class}__disabled-cover {
162
- // when disabled prevent pointer events going through to the input
163
- cursor: not-allowed;
164
- pointer-events: all;
165
- }
166
-
167
- .#{$block-class}__input--empty::after {
168
- width: initial;
169
- opacity: 1;
170
- // only transition fade in
171
- transition: opacity $duration-moderate-02 motion(standard, productive);
172
- visibility: visible;
173
- }
174
-
175
- .#{$block-class}__after-input-elements {
176
- --#{$block-class}--toolbar-width: calc(2 * var(--#{$block-class}--size));
177
-
178
- // not simply flexed in as this causes flexbox to mis-measure the size of the input
179
- position: absolute;
180
- top: 0;
181
- right: 0;
182
- display: flex;
183
- // width: room for validation, and two buttons
184
- // width: var(--#{$block-class}--toolbar-width);
185
- height: 100%;
186
- justify-content: space-between;
187
- cursor: text;
188
- }
189
-
190
- &.#{$block-class}--invalid .#{$block-class}__after-input-elements {
191
- // width: room for validation, and two buttons
192
- --#{$block-class}--toolbar-width: calc(3 * var(--#{$block-class}--size));
193
- }
194
-
195
- .#{$block-class}__toolbar {
196
- display: flex;
197
- align-items: center;
198
- }
199
-
200
- &.#{$block-class}--editing .#{$block-class}__toolbar::after {
201
- // cover top and bottom when focus within block
202
- // doing the same on the buttons is problematic when animating
203
- // and causes visual artifacts when the button is hovered without focus
204
- // as the buttons leave a 45% join between sides with transparent borders and top/bottom with $focus
205
- position: absolute;
206
- top: 0;
207
- left: 0;
208
- display: block;
209
- width: 100%;
210
- height: 100%;
211
- box-sizing: border-box;
212
- border: 2px solid $focus;
213
- border-left: 0;
214
- content: '';
215
- pointer-events: none;
216
- }
217
-
218
- &.#{$block-class}.#{$block-class} .#{$block-class}__save,
219
- &.#{$block-class}.#{$block-class} .#{$block-class}__cancel {
220
- display: inline-flex;
221
- }
222
-
223
- &.#{$block-class}--editing
224
- .#{$block-class}__toolbar--animation
225
- .#{$block-class}__save {
226
- width: var(--#{$block-class}--edit-size);
227
- transition: all $duration-moderate-02 motion(standard, productive);
228
- transition-property: margin, padding;
229
- }
230
-
231
- &.#{$block-class}--editing
232
- .#{$block-class}__toolbar--animation:not(.#{$block-class}__toolbar--saveable)
233
- .#{$block-class}__save {
234
- width: 0;
235
- padding: 0;
236
- border-right: 0;
237
- border-left: 0;
238
- }
239
-
240
- @media (hover: hover) {
241
- // if hover is the primary input mechanism hide edit button
242
- .#{$block-class}__edit {
243
- opacity: 0;
244
- transition: opacity $duration-fast-01 motion(entrance, productive);
245
- }
246
-
247
- &:hover .#{$block-class}__edit {
248
- opacity: 1;
249
- }
250
- }
251
-
252
- .#{$block-class}__edit--always-visible {
253
- opacity: 1;
254
- }
255
-
256
- &.#{$block-class}--invalid .#{$block-class}__validation-icon {
257
- color: $support-error;
258
- }
259
-
260
- .#{$block-class}__validation-text {
261
- display: block;
262
- overflow: visible;
263
- margin-left: $spacing-05;
264
- }
265
-
266
- &.#{$block-class}--invalid .#{$block-class}__validation-text {
267
- color: $support-error;
268
- }
269
- }
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2022, 2022
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 './carbon-imports';
9
- @use './inline-edit-v2';
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2022, 2022
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
- .inline-edit-v2-example {
8
- width: 15rem;
9
- }
@@ -1,10 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2020, 2022
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
- // ModifiedTabs uses the following Carbon components:
9
- // Tabs, Tab
10
- @use '@carbon/react/scss/components/tabs';
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2020, 2022
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 './carbon-imports';
9
- @use './modified-tabs';
@@ -1,8 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2020, 2022
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 './modified-tabs';
@@ -1,89 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2020, 2022
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
- // Standard imports.
9
- @use '@carbon/styles/scss/theme' as *;
10
- @use '@carbon/react/scss/components/button/tokens' as *;
11
- @use '@carbon/styles/scss/motion' as *;
12
- @use '@carbon/styles/scss/spacing' as *;
13
- @use '../../global/styles/project-settings' as c4p-settings;
14
-
15
- // The block part of our conventional BEM class names (blockClass__E--M).
16
- $block-class: #{c4p-settings.$pkg-prefix}--modified-tabs;
17
-
18
- .#{$block-class} .#{$block-class}__tab-label {
19
- display: flex;
20
- width: 100%;
21
- // height: 100%;
22
- align-items: flex-end;
23
- justify-content: space-between;
24
- }
25
-
26
- .#{$block-class}__tab-new,
27
- .#{$block-class}__tab {
28
- position: relative;
29
- display: inline-block;
30
- width: 100%;
31
- height: 100%;
32
- }
33
-
34
- .#{$block-class}__tab-new-img,
35
- .#{$block-class}__tab-close {
36
- // similar to modal dialog close
37
- position: absolute;
38
- top: -$spacing-04;
39
- right: -$spacing-05;
40
- overflow: hidden;
41
- width: 2.5rem;
42
- height: 2.5rem;
43
- padding: $spacing-04;
44
- border: $spacing-01 solid transparent;
45
- background-color: transparent;
46
- border-radius: 0;
47
- cursor: pointer;
48
- transition: background-color $duration-fast-02 motion(standard, productive);
49
- // stylelint-disable-next-line max-nesting-depth
50
- @media (prefers-reduced-motion: reduce) {
51
- transition: none;
52
- }
53
- }
54
-
55
- .#{$block-class}__tab-new-icon {
56
- display: flex;
57
- align-items: center;
58
- justify-content: center;
59
- padding: 0;
60
- margin-top: $spacing-01;
61
- }
62
-
63
- .#{$block-class}__tab-close:focus {
64
- border-color: $button-primary;
65
- outline: none;
66
- }
67
-
68
- .#{$block-class}__tab-close:hover {
69
- background-color: $background-hover;
70
- }
71
-
72
- .#{$block-class}__tab-new-img {
73
- display: flex;
74
- align-items: center;
75
- justify-content: center;
76
- padding: 0;
77
- }
78
-
79
- .#{$block-class}
80
- .#{c4p-settings.$carbon-prefix}--tabs__nav-item.#{c4p-settings.$carbon-prefix}--tabs__nav-link {
81
- width: 10rem;
82
- }
83
-
84
- .#{$block-class}
85
- .#{c4p-settings.$carbon-prefix}--tab--overflow-nav-button--previous,
86
- .#{$block-class}
87
- .#{c4p-settings.$carbon-prefix}--tab--overflow-nav-button--next {
88
- z-index: 2;
89
- }
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2020, 2020
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
- //