@carbon/ibm-products 1.4.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +527 -90
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +9 -3
- package/css/index-full-carbon.min.css.map +1 -0
- package/css/index-without-carbon-released-only.css +157 -67
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +3 -3
- package/css/index-without-carbon-released-only.min.css.map +1 -0
- package/css/index-without-carbon.css +468 -84
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +9 -3
- package/css/index-without-carbon.min.css.map +1 -0
- package/css/index.css +470 -86
- package/css/index.css.map +1 -1
- package/css/index.min.css +9 -3
- package/css/index.min.css.map +1 -0
- package/es/components/ActionSet/ActionSet.js +23 -11
- package/es/components/ActionSet/actions.js +25 -17
- package/es/components/AddSelect/AddSelect.js +115 -67
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +56 -0
- package/es/components/AddSelect/AddSelectList.js +94 -0
- package/es/components/AddSelect/AddSelectSidebar.js +110 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -2
- package/es/components/ButtonMenu/ButtonMenu.js +1 -1
- package/es/components/CancelableTextEdit/CancelableTextEdit.js +2 -2
- package/es/components/Card/Card.js +6 -4
- package/es/components/CreateFullPage/CreateFullPage.js +30 -5
- package/es/components/CreateFullPage/CreateFullPageStep.js +40 -32
- package/es/components/CreateInfluencer/CreateInfluencer.js +25 -3
- package/es/components/CreateTearsheet/CreateTearsheet.js +32 -6
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +45 -38
- package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +24 -4
- package/es/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +8 -6
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +154 -0
- package/es/components/DataSpreadsheet/generateData.js +47 -0
- package/es/components/DataSpreadsheet/index.js +7 -0
- package/es/components/EmptyStates/EmptyState.js +1 -1
- package/es/components/EmptyStates/EmptyStateContent.js +2 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
- package/es/components/ExportModal/ExportModal.js +39 -12
- package/es/components/InlineEdit/InlineEdit.js +250 -80
- package/es/components/NotificationsPanel/NotificationsPanel.js +16 -3
- package/es/components/PageHeader/PageHeader.js +9 -6
- package/es/components/PageHeader/PageHeaderTitle.js +10 -6
- package/es/components/SidePanel/SidePanel.js +33 -16
- package/es/components/Tearsheet/Tearsheet.js +1 -1
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -1
- package/es/components/Tearsheet/TearsheetShell.js +4 -5
- package/es/components/WebTerminal/WebTerminal.js +1 -1
- package/es/components/index.js +2 -1
- package/es/global/js/hooks/index.js +1 -0
- package/es/global/js/hooks/useCreateComponentStepChange.js +31 -11
- package/es/global/js/hooks/useResetCreateComponent.js +7 -4
- package/es/global/js/hooks/useRetrieveStepData.js +51 -0
- package/es/global/js/package-settings.js +2 -1
- package/es/global/js/utils/getScrollbarWidth.js +14 -0
- package/es/global/js/utils/lastIndexInArray.js +26 -0
- package/es/settings.js +0 -5
- package/lib/components/ActionSet/ActionSet.js +23 -11
- package/lib/components/ActionSet/actions.js +25 -17
- package/lib/components/AddSelect/AddSelect.js +119 -67
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +71 -0
- package/lib/components/AddSelect/AddSelectList.js +112 -0
- package/lib/components/AddSelect/AddSelectSidebar.js +122 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -2
- package/lib/components/ButtonMenu/ButtonMenu.js +1 -1
- package/lib/components/CancelableTextEdit/CancelableTextEdit.js +1 -1
- package/lib/components/Card/Card.js +6 -4
- package/lib/components/CreateFullPage/CreateFullPage.js +29 -4
- package/lib/components/CreateFullPage/CreateFullPageStep.js +38 -30
- package/lib/components/CreateInfluencer/CreateInfluencer.js +25 -3
- package/lib/components/CreateTearsheet/CreateTearsheet.js +31 -5
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +43 -36
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +22 -2
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +8 -6
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +171 -0
- package/lib/components/DataSpreadsheet/generateData.js +58 -0
- package/lib/components/DataSpreadsheet/index.js +13 -0
- package/lib/components/EmptyStates/EmptyState.js +1 -1
- package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
- package/lib/components/ExportModal/ExportModal.js +36 -11
- package/lib/components/InlineEdit/InlineEdit.js +247 -79
- package/lib/components/NotificationsPanel/NotificationsPanel.js +13 -1
- package/lib/components/PageHeader/PageHeader.js +9 -6
- package/lib/components/PageHeader/PageHeaderTitle.js +10 -6
- package/lib/components/SidePanel/SidePanel.js +33 -16
- package/lib/components/Tearsheet/Tearsheet.js +1 -1
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -1
- package/lib/components/Tearsheet/TearsheetShell.js +3 -4
- package/lib/components/WebTerminal/WebTerminal.js +1 -1
- package/lib/components/index.js +9 -1
- package/lib/global/js/hooks/index.js +8 -0
- package/lib/global/js/hooks/useCreateComponentStepChange.js +31 -11
- package/lib/global/js/hooks/useResetCreateComponent.js +7 -4
- package/lib/global/js/hooks/useRetrieveStepData.js +62 -0
- package/lib/global/js/package-settings.js +2 -1
- package/lib/global/js/utils/getScrollbarWidth.js +23 -0
- package/lib/global/js/utils/lastIndexInArray.js +35 -0
- package/lib/settings.js +0 -6
- package/package.json +27 -25
- package/scss/components/AddSelect/_add-select.scss +59 -5
- package/scss/components/BreadcrumbWithOverflow/_index.scss +1 -1
- package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +1 -0
- package/scss/components/CancelableTextEdit/_storybook-styles.scss +0 -7
- package/scss/components/CreateInfluencer/_create-influencer.scss +4 -4
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -2
- package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +0 -6
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +79 -0
- package/scss/components/DataSpreadsheet/_index.scss +8 -0
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
- package/scss/components/EditSidePanel/_storybook-styles.scss +0 -8
- package/scss/components/InlineEdit/_inline-edit.scss +288 -10
- package/scss/components/InlineEdit/_storybook-styles.scss +12 -6
- package/scss/components/LoadingBar/_storybook-styles.scss +0 -5
- package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -2
- package/scss/components/OptionsTile/_storybook-styles.scss +0 -7
- package/scss/components/PageHeader/_index.scss +1 -1
- package/scss/components/PageHeader/_page-header.scss +4 -1
- package/scss/components/ProductiveCard/_productive-card.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +15 -6
- package/scss/components/StatusIcon/_index.scss +1 -1
- package/scss/components/StatusIcon/_status-icon.scss +6 -4
- package/scss/components/TagSet/_index.scss +1 -1
- package/scss/components/UserProfileImage/_index.scss +1 -1
- package/scss/components/UserProfileImage/_user-profile-image.scss +2 -2
- package/scss/components/WebTerminal/_web-terminal.scss +2 -2
- package/scss/components/_index.scss +1 -0
- package/scss/global/styles/_project-settings.scss +5 -1
- package/es/generated/feature-flags/feature-flags.js +0 -15
- package/lib/generated/feature-flags/feature-flags.js +0 -22
- package/scss/generated/feature-flags/_feature-flags.scss +0 -19
@@ -37,28 +37,58 @@
|
|
37
37
|
|
38
38
|
.#{$block-class}__selections {
|
39
39
|
border-top: 1px solid $ui-03;
|
40
|
+
|
41
|
+
&-wrapper {
|
42
|
+
display: block;
|
43
|
+
}
|
44
|
+
|
45
|
+
&-cell-wrapper {
|
46
|
+
display: flex;
|
47
|
+
align-items: center;
|
48
|
+
justify-content: space-between;
|
49
|
+
}
|
40
50
|
}
|
41
51
|
|
42
|
-
//
|
52
|
+
// sidebar
|
43
53
|
|
44
|
-
.#{$block-class}
|
54
|
+
.#{$block-class}__sidebar-header {
|
45
55
|
display: flex;
|
46
56
|
padding: $spacing-06 $spacing-05 $spacing-03 $spacing-05;
|
47
57
|
border-bottom: 1px solid $ui-03;
|
48
58
|
|
49
|
-
.#{$block-class}
|
59
|
+
.#{$block-class}__sidebar-title {
|
50
60
|
@include carbon--type-style('productive-heading-02');
|
51
61
|
}
|
52
62
|
}
|
53
63
|
|
54
|
-
.#{$block-class}
|
64
|
+
.#{$block-class}__sidebar-title {
|
55
65
|
margin-right: $spacing-03;
|
56
66
|
}
|
57
67
|
|
58
|
-
.#{$block-class}
|
68
|
+
.#{$block-class}__sidebar-body {
|
59
69
|
padding: $spacing-05;
|
60
70
|
}
|
61
71
|
|
72
|
+
.#{$block-class} .#{$block-class}__sidebar-item-header {
|
73
|
+
@include carbon--type-style('label-01');
|
74
|
+
}
|
75
|
+
|
76
|
+
.#{$block-class} .#{$block-class}__sidebar-item-body {
|
77
|
+
@include carbon--type-style('body-long-01');
|
78
|
+
|
79
|
+
margin-bottom: $spacing-03;
|
80
|
+
}
|
81
|
+
|
82
|
+
.#{$block-class} .#{$block-class}__sidebar-item-remove-button:hover {
|
83
|
+
background: $disabled-02;
|
84
|
+
}
|
85
|
+
|
86
|
+
.#{$block-class} .#{$block-class}__sidebar-accordion-title {
|
87
|
+
display: flex;
|
88
|
+
align-items: center;
|
89
|
+
justify-content: space-between;
|
90
|
+
}
|
91
|
+
|
62
92
|
// overrides
|
63
93
|
|
64
94
|
// the influencer sidebar needs to be even with the buttons
|
@@ -77,6 +107,30 @@
|
|
77
107
|
p {
|
78
108
|
padding-right: 0;
|
79
109
|
}
|
110
|
+
|
111
|
+
.#{$block-class} .#{$carbon-prefix}--structured-list-td {
|
112
|
+
padding-bottom: $spacing-05;
|
113
|
+
}
|
114
|
+
|
115
|
+
.#{$block-class}
|
116
|
+
.#{$carbon-prefix}--radio-button-wrapper
|
117
|
+
.#{$carbon-prefix}--radio-button__label {
|
118
|
+
justify-content: left;
|
119
|
+
}
|
120
|
+
|
121
|
+
.#{$block-class} .#{$carbon-prefix}--breadcrumb .#{$carbon-prefix}--link {
|
122
|
+
cursor: pointer;
|
123
|
+
}
|
124
|
+
|
125
|
+
.#{$carbon-prefix}--accordion__item {
|
126
|
+
&:hover .#{$block-class}__sidebar-accordion-title button {
|
127
|
+
opacity: 1;
|
128
|
+
}
|
129
|
+
|
130
|
+
.#{$block-class}__sidebar-accordion-title button {
|
131
|
+
opacity: 0;
|
132
|
+
}
|
133
|
+
}
|
80
134
|
}
|
81
135
|
|
82
136
|
@include exports('add-select') {
|
@@ -5,11 +5,4 @@
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
6
6
|
//
|
7
7
|
|
8
|
-
@import './index';
|
9
|
-
|
10
8
|
// TODO: add any additional styles used by CancelableTextEdit.stories.js
|
11
|
-
|
12
|
-
// Uncomment next line (which must appear last) to test in storybook
|
13
|
-
// that the SCSS styles for this component are sufficiently specific
|
14
|
-
// to override Carbon whichever order the styles get loaded in.
|
15
|
-
//@import 'carbon-components/css/carbon-components.min';
|
@@ -13,7 +13,7 @@
|
|
13
13
|
$block-class: #{$pkg-prefix}--create-influencer;
|
14
14
|
$create-tearsheet-block-class: #{$pkg-prefix}--tearsheet-create;
|
15
15
|
$influencerAnimationStart: calc(-1 * #{$spacing-05});
|
16
|
-
@keyframes
|
16
|
+
@keyframes influencer-menu-entrance {
|
17
17
|
0% {
|
18
18
|
opacity: 0;
|
19
19
|
// stylelint-disable-next-line carbon/layout-token-use
|
@@ -24,7 +24,7 @@
|
|
24
24
|
transform: translateX(0);
|
25
25
|
}
|
26
26
|
}
|
27
|
-
@keyframes
|
27
|
+
@keyframes influencer-menu-exit {
|
28
28
|
0% {
|
29
29
|
opacity: 1;
|
30
30
|
transform: translateX(0);
|
@@ -60,7 +60,7 @@
|
|
60
60
|
.#{$block-class}__side-nav-opening,
|
61
61
|
.#{$block-class}__progress-indicator-opening {
|
62
62
|
// stylelint-disable-next-line carbon/motion-token-use
|
63
|
-
animation:
|
63
|
+
animation: influencer-menu-entrance $duration--moderate-02 1;
|
64
64
|
animation-fill-mode: forwards;
|
65
65
|
@include carbon--motion(entrance, productive);
|
66
66
|
}
|
@@ -68,7 +68,7 @@
|
|
68
68
|
.#{$block-class}__side-nav-closing,
|
69
69
|
.#{$block-class}__progress-indicator-closing {
|
70
70
|
// stylelint-disable-next-line carbon/motion-token-use
|
71
|
-
animation:
|
71
|
+
animation: influencer-menu-exit $duration--moderate-02 1;
|
72
72
|
animation-fill-mode: forwards;
|
73
73
|
@include carbon--motion(exit, productive);
|
74
74
|
}
|
@@ -23,7 +23,7 @@
|
|
23
23
|
@import '../CreateInfluencer/index';
|
24
24
|
|
25
25
|
@mixin create-tearsheet {
|
26
|
-
@keyframes
|
26
|
+
@keyframes step-content-entrance {
|
27
27
|
0% {
|
28
28
|
opacity: 0;
|
29
29
|
// stylelint-disable-next-line carbon/layout-token-use
|
@@ -50,7 +50,7 @@
|
|
50
50
|
}
|
51
51
|
|
52
52
|
.#{$block-class} .#{$step-block-class}__step--visible-step {
|
53
|
-
animation: $duration--slow-01
|
53
|
+
animation: $duration--slow-01 step-content-entrance;
|
54
54
|
animation-fill-mode: forwards;
|
55
55
|
animation-timing-function: $carbon--standard-easing;
|
56
56
|
opacity: 0;
|
@@ -5,14 +5,8 @@
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
6
6
|
//
|
7
7
|
|
8
|
-
@import './index';
|
9
8
|
@import '../../global/styles/project-settings';
|
10
9
|
|
11
|
-
// Uncomment next line (which must appear last) to test in storybook
|
12
|
-
// that the SCSS styles for this component are sufficiently specific
|
13
|
-
// to override Carbon whichever order the styles get loaded in.
|
14
|
-
//@import 'carbon-components/css/carbon-components.min';
|
15
|
-
|
16
10
|
$story-class: #{$pkg-prefix}--create-tearsheet-narrow--story;
|
17
11
|
|
18
12
|
.#{$story-class}__flex-container {
|
@@ -0,0 +1,79 @@
|
|
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
|
+
@import '../../global/styles/project-settings';
|
10
|
+
@import '../../global/styles/mixins';
|
11
|
+
|
12
|
+
// Define all component styles in a mixin which is then exported using
|
13
|
+
// the Carbon import-once mechanism.
|
14
|
+
@mixin set-header-borders {
|
15
|
+
border-right: 1px solid $text-03;
|
16
|
+
border-bottom: 1px solid $text-03;
|
17
|
+
}
|
18
|
+
@mixin set-body-borders {
|
19
|
+
border-right: 1px solid $ui-03;
|
20
|
+
border-bottom: 1px solid $ui-03;
|
21
|
+
}
|
22
|
+
@mixin data-spreadsheet {
|
23
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
24
|
+
$block-class: #{$pkg-prefix}--data-spreadsheet;
|
25
|
+
|
26
|
+
.#{$block-class} {
|
27
|
+
display: inline-block;
|
28
|
+
border-spacing: 0;
|
29
|
+
// border: 1px solid black;
|
30
|
+
|
31
|
+
button.#{$block-class}__td {
|
32
|
+
margin: 0;
|
33
|
+
background-color: transparent;
|
34
|
+
}
|
35
|
+
.#{$block-class}__tr {
|
36
|
+
:last-child {
|
37
|
+
.td {
|
38
|
+
border-bottom: 0;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
.#{$block-class}__th,
|
44
|
+
.#{$block-class}__td {
|
45
|
+
height: 2.25rem; // update to be controlled by cellSize prop later
|
46
|
+
padding: 0 $spacing-03;
|
47
|
+
border: 0;
|
48
|
+
margin: 0;
|
49
|
+
color: $text-01;
|
50
|
+
}
|
51
|
+
.#{$block-class}__th:last-child,
|
52
|
+
.#{$block-class}__td:last-child {
|
53
|
+
border-right: 1px solid $text-03;
|
54
|
+
}
|
55
|
+
.#{$block-class}__th,
|
56
|
+
button.#{$block-class}__td-th {
|
57
|
+
@include set-header-borders();
|
58
|
+
|
59
|
+
background-color: $ui-01;
|
60
|
+
cursor: pointer;
|
61
|
+
}
|
62
|
+
.#{$block-class}__td {
|
63
|
+
@include set-body-borders();
|
64
|
+
|
65
|
+
cursor: cell;
|
66
|
+
text-align: left;
|
67
|
+
}
|
68
|
+
.#{$block-class}__th {
|
69
|
+
@include carbon--type-style('productive-heading-01');
|
70
|
+
|
71
|
+
color: $text-01;
|
72
|
+
text-align: left;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
@include exports('data-spreadsheet') {
|
78
|
+
@include data-spreadsheet;
|
79
|
+
}
|
@@ -5,9 +5,6 @@
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
6
6
|
//
|
7
7
|
|
8
|
-
@import './index';
|
9
|
-
|
10
|
-
// TODO: add any additional styles used by EditSidePanel.stories.js
|
11
8
|
@import '../../global/styles/project-settings';
|
12
9
|
|
13
10
|
$block-class: #{$pkg-prefix}--edit-side-panel;
|
@@ -28,8 +25,3 @@ $story-prefix: edit-side-panel-stories__;
|
|
28
25
|
.#{$block-class} .#{$carbon-prefix}--number__control-btn::after {
|
29
26
|
background-color: $field-02;
|
30
27
|
}
|
31
|
-
|
32
|
-
// Uncomment next line (which must appear last) to test in storybook
|
33
|
-
// that the SCSS styles for this component are sufficiently specific
|
34
|
-
// to override Carbon whichever order the styles get loaded in.
|
35
|
-
//@import 'carbon-components/css/carbon-components.min';
|
@@ -18,24 +18,302 @@
|
|
18
18
|
// InlineEdit uses the following Carbon for IBM Products components:
|
19
19
|
// TODO: @import(s) of IBM Products component styles used by InlineEdit
|
20
20
|
|
21
|
+
// cut down version borrowed from 'carbon-components/scss/globals/scss/vendor/@carbon/styles/scss/utilities/focus-outline';
|
22
|
+
@mixin input-outline($color: $focus) {
|
23
|
+
outline: $spacing-01 solid $color;
|
24
|
+
outline-offset: calc(-1 * $spacing-01);
|
25
|
+
|
26
|
+
@media screen and (prefers-contrast) {
|
27
|
+
outline-style: dotted;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
@function --tooltip-top-bottom-safe-clip() {
|
32
|
+
@return polygon(
|
33
|
+
0 0,
|
34
|
+
-100vw 0,
|
35
|
+
-100vw -100vh,
|
36
|
+
100vw -100vh,
|
37
|
+
100vw 0,
|
38
|
+
100% 0,
|
39
|
+
100% 100%,
|
40
|
+
100vw 100%,
|
41
|
+
100vw 100vh,
|
42
|
+
-100vw 100vh,
|
43
|
+
-100vw 100%,
|
44
|
+
0 100%
|
45
|
+
);
|
46
|
+
}
|
47
|
+
|
48
|
+
@mixin input-button-defaults($block-class) {
|
49
|
+
display: inline-flex;
|
50
|
+
width: var(--#{$block-class}--size);
|
51
|
+
height: 100%;
|
52
|
+
min-height: initial;
|
53
|
+
max-height: var(--#{$block-class}--size);
|
54
|
+
|
55
|
+
// stylelint-disable-next-line carbon/layout-token-use
|
56
|
+
padding: calc(
|
57
|
+
0.5 * (var(--#{$block-class}--size) - var(--#{$block-class}--icon-size)) - #{$spacing-01}
|
58
|
+
);
|
59
|
+
border: 2px solid transparent;
|
60
|
+
}
|
61
|
+
|
21
62
|
// Define all component styles in a mixin which is then exported using
|
22
63
|
// the Carbon import-once mechanism.
|
23
64
|
@mixin inline-edit {
|
24
65
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
25
66
|
$block-class: #{$pkg-prefix}--inline-edit;
|
26
67
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
68
|
+
@include block-wrap($block-class) {
|
69
|
+
--#{$block-class}--size: #{$spacing-08};
|
70
|
+
--#{$block-class}--icon-size: #{$spacing-05};
|
71
|
+
--#{$block-class}--background-color: #{$ui-01};
|
31
72
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
73
|
+
&.#{$block-class}--light {
|
74
|
+
--#{$block-class}--background-color: transparent;
|
75
|
+
}
|
76
|
+
|
77
|
+
&:hover {
|
78
|
+
--#{$block-class}--background-color: #{$hover-field};
|
79
|
+
// background-color: $background-color;
|
80
|
+
}
|
81
|
+
|
82
|
+
position: relative;
|
83
|
+
display: inline-block;
|
84
|
+
// min-width: 250px; // similar to min input box with room for toolbar
|
85
|
+
max-width: 100%;
|
86
|
+
height: var(--#{$block-class}--size);
|
87
|
+
background-color: var(--#{$block-class}--background-color);
|
88
|
+
cursor: text; // appear to be part of the text box
|
89
|
+
transition: background-color $duration--fast-01 motion(entrance, productive),
|
90
|
+
box-shadow $duration--fast-01 motion(entrance, productive),
|
91
|
+
border-color $duration--fast-01 motion(entrance, productive);
|
92
|
+
vertical-align: middle; // mis-aligned items cause height to grow beyond setting.
|
93
|
+
|
94
|
+
white-space: nowrap;
|
95
|
+
|
96
|
+
&.#{$block-class}--sm {
|
97
|
+
--#{$block-class}--size: #{$spacing-07};
|
98
|
+
--#{$block-class}--icon-size: #{$spacing-05};
|
99
|
+
}
|
100
|
+
|
101
|
+
&.#{$block-class}--lg {
|
102
|
+
--#{$block-class}--size: #{$spacing-09};
|
103
|
+
--#{$block-class}--icon-size: #{$spacing-05};
|
104
|
+
}
|
105
|
+
|
106
|
+
&.#{$block-class}--invalid {
|
107
|
+
// editing takes precedence over invalid
|
108
|
+
@include input-outline($support-01);
|
109
|
+
}
|
110
|
+
|
111
|
+
&.#{$block-class}--editing {
|
112
|
+
@include input-outline($focus);
|
113
|
+
|
114
|
+
background-color: $ui-01;
|
115
|
+
}
|
116
|
+
|
117
|
+
.#{$block-class}__input {
|
118
|
+
display: inline-block;
|
119
|
+
overflow: hidden;
|
120
|
+
// positions text and placeholder including when showing placeholder
|
121
|
+
// NOTE: Using flex does strange things to a caret in content editable
|
122
|
+
min-width: calc(100% - 3 * var(--#{$block-class}--size) - $spacing-05);
|
123
|
+
max-width: calc(100% - 3 * var(--#{$block-class}--size) - $spacing-05);
|
124
|
+
min-height: var(--#{$block-class}--size);
|
125
|
+
// stylelint-disable-next-line carbon/layout-token-use
|
126
|
+
margin-right: calc(3 * var(--#{$block-class}--size));
|
127
|
+
// room for toolbar
|
128
|
+
margin-left: $spacing-05;
|
129
|
+
// stylelint-disable-next-line carbon/type-token-use
|
130
|
+
line-height: var(--#{$block-class}--size);
|
131
|
+
|
132
|
+
&:focus {
|
133
|
+
outline: none;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
.#{$block-class}__input::after {
|
138
|
+
position: absolute;
|
139
|
+
top: 0;
|
140
|
+
left: 0;
|
141
|
+
display: block;
|
142
|
+
margin-left: $spacing-05;
|
143
|
+
color: $text-05;
|
144
|
+
content: attr(data-placeholder);
|
145
|
+
opacity: 0;
|
146
|
+
}
|
147
|
+
|
148
|
+
.#{$block-class}__ellipsis {
|
149
|
+
display: inline-block;
|
150
|
+
overflow: hidden;
|
151
|
+
width: 0;
|
152
|
+
height: var(--#{$block-class}--size);
|
153
|
+
// stylelint-disable-next-line carbon/type-token-use
|
154
|
+
line-height: var(--#{$block-class}--size);
|
155
|
+
opacity: 0;
|
156
|
+
pointer-events: none;
|
157
|
+
|
158
|
+
// only transition fade in
|
159
|
+
transition: opacity $duration--moderate-02 motion(standard, productive);
|
160
|
+
}
|
161
|
+
|
162
|
+
&.#{$block-class}--overflows:not(.#{$block-class}--editing)
|
163
|
+
.#{$block-class}__ellipsis {
|
164
|
+
width: initial;
|
165
|
+
opacity: 1;
|
166
|
+
}
|
167
|
+
|
168
|
+
.#{$block-class}__disabled-cover {
|
169
|
+
position: absolute;
|
170
|
+
top: 0;
|
171
|
+
left: 0;
|
172
|
+
width: 100%;
|
173
|
+
height: 100%;
|
174
|
+
pointer-events: none; // act as if not there
|
175
|
+
}
|
176
|
+
|
177
|
+
&.#{$block-class}--disabled .#{$block-class}__disabled-cover {
|
178
|
+
// when disabled prevent pointer events going through to the input
|
179
|
+
cursor: not-allowed;
|
180
|
+
pointer-events: all;
|
181
|
+
}
|
182
|
+
|
183
|
+
.#{$block-class}__input--empty::after {
|
184
|
+
opacity: 1;
|
185
|
+
// only transition fade in
|
186
|
+
transition: opacity $duration--moderate-02 motion(standard, productive);
|
187
|
+
}
|
188
|
+
|
189
|
+
.#{$block-class}__after-input-elements {
|
190
|
+
// not simply flexed in as this causes flexbox to mis-measure the size of the input
|
191
|
+
position: absolute;
|
192
|
+
top: 0;
|
193
|
+
right: 0;
|
194
|
+
display: flex;
|
195
|
+
// width: room for validation, and two buttons
|
196
|
+
width: calc(3 * var(--#{$block-class}--size));
|
197
|
+
height: 100%;
|
198
|
+
justify-content: space-between;
|
199
|
+
cursor: text;
|
200
|
+
}
|
201
|
+
|
202
|
+
.#{$block-class}__toolbar--animation {
|
203
|
+
// makes room for the top clip text but hides the side overflow
|
204
|
+
clip-path: --tooltip-top-bottom-safe-clip();
|
205
|
+
// NOTE: The above allows the tooltip to show through when overflowX: hidden would not when at right edge.
|
206
|
+
// It is used with margin animation of contained buttons
|
207
|
+
}
|
208
|
+
|
209
|
+
&.#{$block-class}--editing .#{$block-class}__toolbar::after {
|
210
|
+
// cover top and bottom when focus within block
|
211
|
+
// doing the same on the buttons is problematic when animating
|
212
|
+
// and causes visual artifacts when the button is hovered without focus
|
213
|
+
// as the buttons leave a 45% join between sides with transparent borders and top/bottom with $focus
|
214
|
+
position: absolute;
|
215
|
+
top: 0;
|
216
|
+
left: 0;
|
217
|
+
display: block;
|
218
|
+
width: 100%;
|
219
|
+
height: 100%;
|
220
|
+
box-sizing: border-box;
|
221
|
+
border: 2px solid $focus;
|
222
|
+
border-left: 0;
|
223
|
+
content: '';
|
224
|
+
pointer-events: none;
|
225
|
+
}
|
226
|
+
|
227
|
+
&.#{$block-class}.#{$block-class} .#{$block-class}__save,
|
228
|
+
&.#{$block-class}.#{$block-class} .#{$block-class}__cancel {
|
229
|
+
@include input-button-defaults($block-class);
|
230
|
+
|
231
|
+
// input does not have focus
|
232
|
+
&:hover {
|
233
|
+
outline: initial;
|
234
|
+
}
|
235
|
+
|
236
|
+
&:focus:active,
|
237
|
+
&:focus {
|
238
|
+
// border focus input does NOT have focus
|
239
|
+
border-color: $focus;
|
240
|
+
box-shadow: initial;
|
241
|
+
outline: initial;
|
242
|
+
}
|
243
|
+
|
244
|
+
&:focus:active:hover {
|
245
|
+
box-shadow: inset 0 0 0 1px $field-01;
|
246
|
+
}
|
247
|
+
|
248
|
+
&::before {
|
249
|
+
background-color: transparent;
|
250
|
+
}
|
251
|
+
|
252
|
+
&[disabled] {
|
253
|
+
border-color: transparent;
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
&.#{$block-class}--editing
|
258
|
+
.#{$block-class}__toolbar--animation
|
259
|
+
.#{$block-class}__save {
|
260
|
+
// stylelint-disable-next-line carbon/layout-token-use
|
261
|
+
margin-right: calc(-1 * var(--#{$block-class}--size));
|
262
|
+
transition: margin-right $duration--moderate-02
|
263
|
+
motion(standard, productive);
|
264
|
+
}
|
265
|
+
|
266
|
+
&.#{$block-class}--editing
|
267
|
+
.#{$block-class}__toolbar--saveable
|
268
|
+
.#{$block-class}__save {
|
269
|
+
margin-right: 0;
|
270
|
+
}
|
271
|
+
|
272
|
+
&.#{$block-class}.#{$block-class} .#{$block-class}__edit {
|
273
|
+
@include input-button-defaults($block-class);
|
274
|
+
|
275
|
+
// pointer-events: none;
|
276
|
+
|
277
|
+
&:hover,
|
278
|
+
&:active,
|
279
|
+
&:focus {
|
280
|
+
border-color: transparent;
|
281
|
+
background-color: transparent;
|
282
|
+
box-shadow: initial;
|
283
|
+
outline: initial;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
|
287
|
+
.#{$block-class}__edit--hover-visible {
|
288
|
+
opacity: 0;
|
289
|
+
transition: opacity $duration--fast-01 motion(entrance, productive);
|
290
|
+
}
|
291
|
+
|
292
|
+
&:hover .#{$block-class}__edit--hover-visible {
|
293
|
+
opacity: 1;
|
294
|
+
}
|
295
|
+
|
296
|
+
.#{$block-class}__validation-icon {
|
297
|
+
@include input-button-defaults($block-class);
|
298
|
+
}
|
299
|
+
|
300
|
+
&.#{$block-class}--warn .#{$block-class}__validation-icon {
|
301
|
+
color: $support-warning;
|
302
|
+
}
|
303
|
+
|
304
|
+
&.#{$block-class}--invalid .#{$block-class}__validation-icon {
|
305
|
+
color: $support-error;
|
306
|
+
}
|
307
|
+
|
308
|
+
.#{$block-class}__validation-text {
|
309
|
+
display: block;
|
310
|
+
overflow: visible;
|
311
|
+
margin-left: $spacing-05;
|
312
|
+
}
|
36
313
|
|
37
|
-
|
38
|
-
|
314
|
+
&.#{$block-class}--invalid .#{$block-class}__validation-text {
|
315
|
+
color: $support-error;
|
316
|
+
}
|
39
317
|
}
|
40
318
|
}
|
41
319
|
|
@@ -5,11 +5,17 @@
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
6
6
|
//
|
7
7
|
|
8
|
-
@import '
|
8
|
+
@import '../../global/styles/project-settings';
|
9
9
|
|
10
|
-
|
10
|
+
.inline-edit-stories__viewport {
|
11
|
+
// width: 300px; // larger than standard size needed by text input at standard font size (html input attribute size)
|
12
|
+
// stylelint-disable-next-line carbon/layout-token-use
|
13
|
+
margin: 100px;
|
14
|
+
}
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
$block-class: #{$pkg-prefix}--inline-edit;
|
17
|
+
.component-full-width {
|
18
|
+
.#{$block-class} {
|
19
|
+
width: 100%;
|
20
|
+
}
|
21
|
+
}
|
@@ -12,8 +12,3 @@
|
|
12
12
|
width: 24rem;
|
13
13
|
margin: $spacing-07 $spacing-05 $spacing-05 $spacing-05;
|
14
14
|
}
|
15
|
-
|
16
|
-
// Uncomment next line (which must appear last) to test in storybook
|
17
|
-
// that the SCSS styles for this component are sufficiently specific
|
18
|
-
// to override Carbon whichever order the styles get loaded in.
|
19
|
-
// @import 'carbon-components/css/carbon-components.min';
|
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
@mixin notifications-panel {
|
22
22
|
$block-class: #{$pkg-prefix}--notifications-panel;
|
23
|
-
@keyframes
|
23
|
+
@keyframes fade-in {
|
24
24
|
0% {
|
25
25
|
opacity: 0;
|
26
26
|
// stylelint-disable-next-line carbon/layout-token-use
|
@@ -32,7 +32,7 @@
|
|
32
32
|
}
|
33
33
|
}
|
34
34
|
|
35
|
-
@keyframes
|
35
|
+
@keyframes fade-out {
|
36
36
|
0% {
|
37
37
|
opacity: 1;
|
38
38
|
transform: translateY(0);
|
@@ -5,8 +5,6 @@
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
6
6
|
//
|
7
7
|
|
8
|
-
@import './index';
|
9
|
-
|
10
8
|
@import '../../global/styles/project-settings';
|
11
9
|
|
12
10
|
$block-class: #{$pkg-prefix}--options-tile;
|
@@ -26,8 +24,3 @@ $block-class: #{$pkg-prefix}--options-tile;
|
|
26
24
|
.#{$block-class}__content .#{$carbon-prefix}--dropdown__wrapper:first-of-type {
|
27
25
|
margin-bottom: $spacing-06;
|
28
26
|
}
|
29
|
-
|
30
|
-
// Uncomment next line (which must appear last) to test in storybook
|
31
|
-
// that the SCSS styles for this component are sufficiently specific
|
32
|
-
// to override Carbon whichever order the styles get loaded in.
|
33
|
-
//@import 'carbon-components/css/carbon-components.min';
|