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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/css/index-full-carbon.css +71 -221
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +3 -5
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +142 -189
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -3
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +71 -221
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +3 -5
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +71 -221
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +3 -5
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/AboutModal/AboutModal.js +3 -4
  18. package/es/components/ActionBar/ActionBar.js +13 -29
  19. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +15 -21
  20. package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
  21. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +7 -8
  22. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
  23. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
  24. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
  25. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
  26. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
  27. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
  28. package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +19 -1
  29. package/es/components/Datagrid/useFiltering.js +4 -2
  30. package/es/components/Datagrid/useOnRowClick.js +11 -1
  31. package/es/components/Datagrid/useSelectRows.js +2 -0
  32. package/es/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +92 -30
  33. package/es/components/{InlineEdit → EditInPlace}/index.js +1 -1
  34. package/es/components/PageHeader/PageHeader.js +36 -35
  35. package/es/components/PageHeader/PageHeaderTitle.js +18 -18
  36. package/es/components/SidePanel/SidePanel.js +25 -26
  37. package/es/components/TagSet/TagSet.js +5 -7
  38. package/es/components/Tearsheet/TearsheetShell.js +4 -6
  39. package/es/components/index.js +1 -1
  40. package/es/global/js/hooks/useResizeObserver.js +79 -0
  41. package/es/global/js/hooks/useWindowResize.js +6 -0
  42. package/es/global/js/hooks/useWindowScroll.js +7 -0
  43. package/es/global/js/package-settings.js +2 -4
  44. package/lib/components/AboutModal/AboutModal.js +3 -4
  45. package/lib/components/ActionBar/ActionBar.js +13 -29
  46. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +13 -19
  47. package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
  48. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +2 -1
  49. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +5 -4
  50. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
  51. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
  52. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
  53. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
  54. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
  55. package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +18 -1
  56. package/lib/components/Datagrid/useFiltering.js +4 -2
  57. package/lib/components/Datagrid/useOnRowClick.js +11 -1
  58. package/lib/components/Datagrid/useSelectRows.js +2 -0
  59. package/lib/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +100 -34
  60. package/lib/components/{InlineEdit → EditInPlace}/index.js +3 -3
  61. package/lib/components/PageHeader/PageHeader.js +36 -35
  62. package/lib/components/PageHeader/PageHeaderTitle.js +19 -19
  63. package/lib/components/SidePanel/SidePanel.js +25 -26
  64. package/lib/components/TagSet/TagSet.js +5 -7
  65. package/lib/components/Tearsheet/TearsheetShell.js +4 -6
  66. package/lib/components/index.js +7 -7
  67. package/lib/global/js/hooks/useResizeObserver.js +91 -0
  68. package/lib/global/js/hooks/useWindowScroll.js +6 -0
  69. package/lib/global/js/package-settings.js +2 -4
  70. package/package.json +3 -4
  71. package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +10 -1
  72. package/scss/components/Datagrid/styles/_useSelectAllToggle.scss +11 -7
  73. package/scss/components/{InlineEditV2/_inline-edit-v2.scss → EditInPlace/_edit-in-place.scss} +56 -14
  74. package/scss/components/{InlineEditV1 → EditInPlace}/_index-with-carbon.scss +1 -1
  75. package/scss/components/{InlineEditV2 → EditInPlace}/_index.scss +1 -1
  76. package/scss/components/{InlineEditV1 → EditInPlace}/_storybook-styles.scss +3 -15
  77. package/scss/components/PageHeader/_page-header.scss +1 -7
  78. package/scss/components/_index-released-only-with-carbon.scss +1 -1
  79. package/scss/components/_index-released-only.scss +1 -1
  80. package/scss/components/_index-with-carbon.scss +1 -2
  81. package/scss/components/_index.scss +1 -2
  82. package/es/components/InlineEdit/InlineEdit.js +0 -47
  83. package/es/components/InlineEditV1/InlineEditV1.js +0 -442
  84. package/es/components/InlineEditV1/index.js +0 -7
  85. package/es/components/InlineEditV2/index.js +0 -7
  86. package/lib/components/InlineEdit/InlineEdit.js +0 -63
  87. package/lib/components/InlineEditV1/InlineEditV1.js +0 -459
  88. package/lib/components/InlineEditV1/index.js +0 -13
  89. package/lib/components/InlineEditV2/index.js +0 -13
  90. package/scss/components/InlineEditV1/_carbon-imports.scss +0 -6
  91. package/scss/components/InlineEditV1/_index.scss +0 -8
  92. package/scss/components/InlineEditV1/_inline-edit-v1.scss +0 -269
  93. package/scss/components/InlineEditV2/_index-with-carbon.scss +0 -9
  94. package/scss/components/InlineEditV2/_storybook-styles.scss +0 -9
  95. /package/scss/components/{InlineEditV2 → EditInPlace}/_carbon-imports.scss +0 -0
@@ -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
- }