@kaizen/components 2.4.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/Heading/Heading.cjs +1 -1
- package/dist/cjs/src/Heading/Heading.module.css.cjs +22 -0
- package/dist/cjs/src/Label/Label.cjs +1 -1
- package/dist/cjs/src/Label/Label.module.css.cjs +16 -0
- package/dist/cjs/src/LabelledMessage/LabelledMessage.cjs +1 -1
- package/dist/cjs/src/LabelledMessage/LabelledMessage.module.css.cjs +7 -0
- package/dist/cjs/src/Notification/InlineNotification/InlineNotification.cjs +1 -1
- package/dist/cjs/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs +1 -1
- package/dist/cjs/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss.cjs → ToastNotificationsList.module.css.cjs} +1 -1
- package/dist/cjs/src/Notification/subcomponents/CancelButton/CancelButton.cjs +1 -1
- package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.cjs +1 -1
- package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css.cjs +29 -0
- package/dist/cjs/src/Notification/subcomponents/NotificationHeading/NotificationHeading.cjs +1 -1
- package/dist/cjs/src/Select/Select.cjs +9 -7
- package/dist/cjs/src/Text/Text.cjs +1 -1
- package/dist/cjs/src/Text/Text.module.css.cjs +16 -0
- package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.cjs +1 -1
- package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css.cjs +13 -0
- package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.cjs +1 -1
- package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.css.cjs +9 -0
- package/dist/cjs/src/Tooltip/OverlayArrow.cjs +1 -1
- package/dist/cjs/src/Tooltip/OverlayArrow.module.css.cjs +7 -0
- package/dist/cjs/src/Tooltip/Tooltip.cjs +1 -1
- package/dist/cjs/src/Tooltip/Tooltip.module.css.cjs +7 -0
- package/dist/esm/src/Heading/Heading.mjs +1 -1
- package/dist/esm/src/Heading/Heading.module.css.mjs +20 -0
- package/dist/esm/src/Label/Label.mjs +1 -1
- package/dist/esm/src/Label/Label.module.css.mjs +14 -0
- package/dist/esm/src/LabelledMessage/LabelledMessage.mjs +1 -1
- package/dist/esm/src/LabelledMessage/LabelledMessage.module.css.mjs +5 -0
- package/dist/esm/src/Notification/InlineNotification/InlineNotification.mjs +1 -1
- package/dist/esm/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.mjs +1 -1
- package/dist/esm/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss.mjs → ToastNotificationsList.module.css.mjs} +1 -1
- package/dist/esm/src/Notification/subcomponents/CancelButton/CancelButton.mjs +1 -1
- package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.mjs +1 -1
- package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css.mjs +27 -0
- package/dist/esm/src/Notification/subcomponents/NotificationHeading/NotificationHeading.mjs +1 -1
- package/dist/esm/src/Select/Select.mjs +9 -7
- package/dist/esm/src/Text/Text.mjs +1 -1
- package/dist/esm/src/Text/Text.module.css.mjs +14 -0
- package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.mjs +1 -1
- package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css.mjs +11 -0
- package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.mjs +1 -1
- package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.css.mjs +7 -0
- package/dist/esm/src/Tooltip/OverlayArrow.mjs +1 -1
- package/dist/esm/src/Tooltip/OverlayArrow.module.css.mjs +5 -0
- package/dist/esm/src/Tooltip/Tooltip.mjs +1 -1
- package/dist/esm/src/Tooltip/Tooltip.module.css.mjs +5 -0
- package/dist/styles.css +726 -520
- package/locales/ar.json +4 -0
- package/locales/bg.json +4 -0
- package/locales/cs.json +4 -0
- package/locales/cy.json +4 -0
- package/locales/da.json +4 -0
- package/locales/de.json +4 -0
- package/locales/el.json +4 -0
- package/locales/en-GB.json +4 -0
- package/locales/en.json +4 -0
- package/locales/es-419.json +4 -0
- package/locales/es.json +4 -0
- package/locales/et.json +4 -0
- package/locales/fi.json +4 -0
- package/locales/fr-CA.json +4 -0
- package/locales/fr.json +4 -0
- package/locales/he.json +4 -0
- package/locales/hi.json +4 -0
- package/locales/ht.json +4 -0
- package/locales/hu.json +4 -0
- package/locales/id.json +4 -0
- package/locales/it.json +4 -0
- package/locales/ja.json +4 -0
- package/locales/km-KH.json +4 -0
- package/locales/ko.json +4 -0
- package/locales/lt.json +4 -0
- package/locales/lv.json +4 -0
- package/locales/mi.json +4 -0
- package/locales/ms.json +4 -0
- package/locales/nb.json +4 -0
- package/locales/nl.json +4 -0
- package/locales/pl.json +4 -0
- package/locales/pt-BR.json +4 -0
- package/locales/pt.json +4 -0
- package/locales/ro.json +4 -0
- package/locales/ru.json +4 -0
- package/locales/si-LK.json +4 -0
- package/locales/sk.json +4 -0
- package/locales/sr.json +4 -0
- package/locales/sv.json +4 -0
- package/locales/th.json +4 -0
- package/locales/tl.json +4 -0
- package/locales/tr.json +4 -0
- package/locales/uk.json +4 -0
- package/locales/vi.json +4 -0
- package/locales/zh-TW.json +4 -0
- package/locales/zh.json +4 -0
- package/package.json +1 -1
- package/src/Content/Content.module.css +1 -1
- package/src/Heading/Heading.module.css +111 -0
- package/src/Heading/Heading.tsx +1 -1
- package/src/Label/Label.module.css +97 -0
- package/src/Label/Label.tsx +1 -1
- package/src/Label/_docs/Label.stickersheet.stories.tsx +9 -4
- package/src/LabelledMessage/{LabelledMessage.module.scss → LabelledMessage.module.css} +1 -3
- package/src/LabelledMessage/LabelledMessage.tsx +1 -1
- package/src/Notification/InlineNotification/InlineNotification.tsx +1 -1
- package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +1 -1
- package/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss → ToastNotificationsList.module.css} +6 -8
- package/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.tsx +1 -1
- package/src/Notification/subcomponents/CancelButton/CancelButton.tsx +1 -1
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css +392 -0
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +1 -1
- package/src/Notification/subcomponents/NotificationHeading/NotificationHeading.tsx +1 -1
- package/src/Select/Select.tsx +8 -6
- package/src/Text/Text.module.css +71 -0
- package/src/Text/Text.tsx +1 -1
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css +141 -0
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +1 -1
- package/src/ToggleSwitch/ToggleSwitchField/{ToggleSwitchField.module.scss → ToggleSwitchField.module.css} +1 -3
- package/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.tsx +1 -1
- package/src/Tooltip/OverlayArrow.module.css +45 -0
- package/src/Tooltip/OverlayArrow.tsx +1 -1
- package/src/Tooltip/Tooltip.module.css +62 -0
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/dist/cjs/src/Heading/Heading.module.scss.cjs +0 -22
- package/dist/cjs/src/Label/Label.module.scss.cjs +0 -15
- package/dist/cjs/src/LabelledMessage/LabelledMessage.module.scss.cjs +0 -7
- package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.cjs +0 -29
- package/dist/cjs/src/Text/Text.module.scss.cjs +0 -16
- package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.cjs +0 -13
- package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.scss.cjs +0 -9
- package/dist/cjs/src/Tooltip/OverlayArrow.module.scss.cjs +0 -7
- package/dist/cjs/src/Tooltip/Tooltip.module.scss.cjs +0 -7
- package/dist/esm/src/Heading/Heading.module.scss.mjs +0 -20
- package/dist/esm/src/Label/Label.module.scss.mjs +0 -13
- package/dist/esm/src/LabelledMessage/LabelledMessage.module.scss.mjs +0 -5
- package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs +0 -27
- package/dist/esm/src/Text/Text.module.scss.mjs +0 -14
- package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.mjs +0 -11
- package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.scss.mjs +0 -7
- package/dist/esm/src/Tooltip/OverlayArrow.module.scss.mjs +0 -5
- package/dist/esm/src/Tooltip/Tooltip.module.scss.mjs +0 -5
- package/src/Content/_variables.css +0 -5
- package/src/Heading/Heading.module.scss +0 -115
- package/src/Label/Label.module.scss +0 -105
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +0 -138
- package/src/Notification/subcomponents/GenericNotification/_mixins.scss +0 -366
- package/src/Text/Text.module.scss +0 -74
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +0 -139
- package/src/Tooltip/OverlayArrow.module.scss +0 -45
- package/src/Tooltip/Tooltip.module.scss +0 -68
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--border-width: var(--border-width-1);
|
|
3
|
+
--notification-vertical-padding: calc(var(--spacing-6) - var(--border-width));
|
|
4
|
+
--notification-fade-out: opacity 200ms ease;
|
|
5
|
+
--notification-collapse-height: margin-top 200ms ease, margin-bottom 200ms ease;
|
|
6
|
+
--notification-collapse-height-delayed: margin-top 200ms ease 200ms, margin-bottom 200ms ease;
|
|
7
|
+
--notification-pop-up: transform 200ms ease-out;
|
|
8
|
+
--notification-slide-right: transform 300ms ease-out;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@layer kz-components {
|
|
12
|
+
/* Replace @extend %ca-notification from _mixin.scss */
|
|
13
|
+
.notification {
|
|
14
|
+
display: flex;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
pointer-events: all;
|
|
17
|
+
|
|
18
|
+
&:focus {
|
|
19
|
+
outline-offset: 1px;
|
|
20
|
+
outline: 2px solid var(--color-blue-500);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Variants */
|
|
25
|
+
.inline,
|
|
26
|
+
.toast {
|
|
27
|
+
margin-bottom: var(--spacing-24);
|
|
28
|
+
border-width: var(--border-width);
|
|
29
|
+
border-style: solid;
|
|
30
|
+
border-radius: var(--border-solid-border-radius);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.inline {
|
|
34
|
+
width: auto;
|
|
35
|
+
min-height: 46px;
|
|
36
|
+
padding: var(--notification-vertical-padding) var(--spacing-12);
|
|
37
|
+
transition:
|
|
38
|
+
var(--notification-fade-out), var(--notification-pop-up), var(--notification-collapse-height);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.toast {
|
|
42
|
+
container-type: inline-size;
|
|
43
|
+
width: 25rem;
|
|
44
|
+
box-shadow: var(--shadow-small-box-shadow);
|
|
45
|
+
max-width: 100%;
|
|
46
|
+
padding: var(--notification-vertical-padding) 10px;
|
|
47
|
+
transition:
|
|
48
|
+
var(--notification-fade-out), var(--notification-slide-right),
|
|
49
|
+
var(--notification-collapse-height-delayed);
|
|
50
|
+
will-change: transform;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.global {
|
|
54
|
+
width: 100%;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
border-width: 0;
|
|
58
|
+
border-radius: 0;
|
|
59
|
+
margin-bottom: 0;
|
|
60
|
+
padding-top: var(--spacing-16);
|
|
61
|
+
padding-bottom: var(--spacing-16);
|
|
62
|
+
padding-inline-start: var(--spacing-8);
|
|
63
|
+
transition: var(--notification-collapse-height);
|
|
64
|
+
position: relative;
|
|
65
|
+
z-index: 1030;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Types (colors) */
|
|
69
|
+
.success {
|
|
70
|
+
background: var(--color-green-100);
|
|
71
|
+
border-color: var(--color-green-500);
|
|
72
|
+
color: var(--color-purple-800);
|
|
73
|
+
|
|
74
|
+
--icon-color: var(--color-green-500);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.informative {
|
|
78
|
+
background: var(--color-blue-100);
|
|
79
|
+
border-color: var(--color-blue-500);
|
|
80
|
+
color: var(--color-purple-800);
|
|
81
|
+
|
|
82
|
+
--icon-color: var(--color-blue-500);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.cautionary,
|
|
86
|
+
.security {
|
|
87
|
+
background: var(--color-yellow-100);
|
|
88
|
+
border-color: var(--color-yellow-700);
|
|
89
|
+
color: var(--color-purple-800);
|
|
90
|
+
|
|
91
|
+
--icon-color: var(--color-yellow-700);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.warning {
|
|
95
|
+
background: var(--color-red-100);
|
|
96
|
+
border-color: var(--color-red-500);
|
|
97
|
+
color: var(--color-purple-800);
|
|
98
|
+
|
|
99
|
+
--icon-color: var(--color-red-500);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Hidden state */
|
|
103
|
+
.hidden {
|
|
104
|
+
opacity: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.hidden.inline,
|
|
108
|
+
.hidden.global {
|
|
109
|
+
margin-bottom: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.hidden.inline {
|
|
113
|
+
/*
|
|
114
|
+
When entering we use "ease-out", but when transitioning to hidden we want to use "ease-in".
|
|
115
|
+
We want it moving the fastest when it is the furthest off screen.
|
|
116
|
+
*/
|
|
117
|
+
transition-timing-function: ease-in;
|
|
118
|
+
transform: translateY(-50%);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.hidden.toast {
|
|
122
|
+
/*
|
|
123
|
+
When entering we use "ease-out", but when transitioning to hidden we want to use "ease-in".
|
|
124
|
+
We want it moving the fastest when it is the furthest off screen.
|
|
125
|
+
*/
|
|
126
|
+
transition-timing-function: ease-in;
|
|
127
|
+
transform: translateX(50%);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.hidden.global {
|
|
131
|
+
z-index: 1029;
|
|
132
|
+
opacity: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Structure: .icon (from %ca-notification__icon) */
|
|
136
|
+
.icon {
|
|
137
|
+
align-items: flex-start;
|
|
138
|
+
box-sizing: content-box;
|
|
139
|
+
color: var(--icon-color);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.inline .icon,
|
|
143
|
+
.toast .icon {
|
|
144
|
+
width: 22px;
|
|
145
|
+
height: 22px;
|
|
146
|
+
font-size: 22px;
|
|
147
|
+
margin-top: var(--spacing-6);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.global .icon {
|
|
151
|
+
width: 24px;
|
|
152
|
+
height: 24px;
|
|
153
|
+
font-size: 24px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Structure: .textContainer from %ca-notification__text-container */
|
|
157
|
+
.textContainer {
|
|
158
|
+
box-sizing: content-box;
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-flow: row wrap;
|
|
161
|
+
flex: 1 0 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.inline .textContainer,
|
|
165
|
+
.toast .textContainer {
|
|
166
|
+
margin-inline-start: var(--spacing-6);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.toast .textContainer {
|
|
170
|
+
max-width: calc(100% - var(--spacing-48));
|
|
171
|
+
overflow-wrap: break-word;
|
|
172
|
+
hyphens: auto;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.global .textContainer {
|
|
176
|
+
margin-inline-start: var(--spacing-8);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.inline .textContainer {
|
|
180
|
+
/*
|
|
181
|
+
Inline notifications often fade onto a white background.
|
|
182
|
+
Fading the higher-contrast text out at, as well as the whole container, makes for a smoother animation.
|
|
183
|
+
*/
|
|
184
|
+
transition: var(--notification-fade-out);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.forceMultiline {
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Structure: .title from %ca-notification__title */
|
|
192
|
+
.title {
|
|
193
|
+
position: relative;
|
|
194
|
+
font-family: var(--typography-heading-6-font-family);
|
|
195
|
+
font-weight: var(--typography-heading-6-font-weight);
|
|
196
|
+
font-size: var(--typography-heading-6-font-size);
|
|
197
|
+
line-height: var(--typography-heading-6-line-height);
|
|
198
|
+
letter-spacing: var(--typography-heading-6-letter-spacing);
|
|
199
|
+
margin: 0;
|
|
200
|
+
padding-right: 6px;
|
|
201
|
+
|
|
202
|
+
/* overriding Bootstrap style that changes h6s to text-transform: uppercase */
|
|
203
|
+
text-transform: none;
|
|
204
|
+
color: inherit;
|
|
205
|
+
top: 0.37em;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.notificationTitle {
|
|
209
|
+
top: 0.42em;
|
|
210
|
+
position: relative;
|
|
211
|
+
margin-inline-end: var(--spacing-6);
|
|
212
|
+
line-height: var(--typography-heading-6-line-height);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@container (max-width: 25rem) {
|
|
216
|
+
.notificationTitle {
|
|
217
|
+
width: 100%;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* Structure: .text from %ca-notification__text */
|
|
222
|
+
.text {
|
|
223
|
+
position: relative;
|
|
224
|
+
font-family: var(--typography-paragraph-small-font-family);
|
|
225
|
+
font-weight: var(--typography-paragraph-small-font-weight);
|
|
226
|
+
font-size: var(--typography-paragraph-small-font-size);
|
|
227
|
+
line-height: var(--typography-paragraph-small-line-height);
|
|
228
|
+
letter-spacing: var(--typography-paragraph-small-letter-spacing);
|
|
229
|
+
margin: 0;
|
|
230
|
+
color: inherit;
|
|
231
|
+
|
|
232
|
+
a[href]:not([data-rac]) {
|
|
233
|
+
border-bottom: var(--spacing-1) solid var(--color-blue-500);
|
|
234
|
+
text-decoration: none;
|
|
235
|
+
color: var(--color-blue-500);
|
|
236
|
+
|
|
237
|
+
&:hover {
|
|
238
|
+
text-decoration: none;
|
|
239
|
+
color: var(--color-blue-600);
|
|
240
|
+
border-bottom: var(--spacing-1) solid var(--color-blue-600);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
strong {
|
|
245
|
+
font-weight: var(--typography-button-secondary-font-weight);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
p {
|
|
249
|
+
font-weight: inherit;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.inline .text,
|
|
254
|
+
.toast .text {
|
|
255
|
+
position: relative;
|
|
256
|
+
font-family: var(--typography-paragraph-small-font-family);
|
|
257
|
+
font-weight: var(--typography-paragraph-small-font-weight);
|
|
258
|
+
font-size: var(--typography-paragraph-small-font-size);
|
|
259
|
+
line-height: var(--typography-paragraph-small-line-height);
|
|
260
|
+
letter-spacing: var(--typography-paragraph-small-letter-spacing);
|
|
261
|
+
|
|
262
|
+
/*
|
|
263
|
+
When the title and text are on different lines this ensures the baselines of the first lines are exactly 1 grid unit apart.
|
|
264
|
+
When they are both on a single line it ensures both are 1 grid unit tall.
|
|
265
|
+
*/
|
|
266
|
+
margin-top: var(--spacing-6);
|
|
267
|
+
flex: 0 1 auto;
|
|
268
|
+
padding-bottom: var(--spacing-12);
|
|
269
|
+
top: 0.21em;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.toast .text {
|
|
273
|
+
width: 100%;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.global .text {
|
|
277
|
+
position: static;
|
|
278
|
+
font-weight: var(--typography-paragraph-body-font-weight);
|
|
279
|
+
font-size: var(--typography-paragraph-body-font-size);
|
|
280
|
+
line-height: var(--typography-paragraph-body-line-height);
|
|
281
|
+
letter-spacing: var(--typography-paragraph-body-letter-spacing);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Structure: .cancel from %ca-notification__cancel */
|
|
285
|
+
.cancel {
|
|
286
|
+
cursor: pointer;
|
|
287
|
+
appearance: none;
|
|
288
|
+
transition: none;
|
|
289
|
+
transform: none;
|
|
290
|
+
margin: 0;
|
|
291
|
+
padding: 0;
|
|
292
|
+
border: none;
|
|
293
|
+
background: transparent;
|
|
294
|
+
font: inherit;
|
|
295
|
+
color: var(--color-purple-800);
|
|
296
|
+
position: relative;
|
|
297
|
+
display: flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
border-radius: var(--border-solid-border-radius);
|
|
301
|
+
|
|
302
|
+
.icon {
|
|
303
|
+
opacity: 0.7;
|
|
304
|
+
transition: var(--animation-duration-fast) opacity;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
&:disabled,
|
|
308
|
+
&.disabled {
|
|
309
|
+
.icon {
|
|
310
|
+
opacity: 0.3;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
&:not(:disabled, .disabled) {
|
|
315
|
+
&:hover,
|
|
316
|
+
&:focus,
|
|
317
|
+
&.hover {
|
|
318
|
+
.icon {
|
|
319
|
+
opacity: 1;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&:active,
|
|
324
|
+
&.active {
|
|
325
|
+
.icon {
|
|
326
|
+
opacity: 1;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&:active {
|
|
332
|
+
transform: translateY(1px);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
&:focus-visible {
|
|
336
|
+
outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
|
|
337
|
+
var(--color-blue-500);
|
|
338
|
+
outline-offset: -4px;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.inline .cancel,
|
|
343
|
+
.toast .cancel {
|
|
344
|
+
width: var(--spacing-48);
|
|
345
|
+
height: var(--spacing-48);
|
|
346
|
+
margin-top: calc(-1 * var(--spacing-6));
|
|
347
|
+
margin-bottom: calc(-1 * var(--spacing-6));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.inline .cancel {
|
|
351
|
+
margin-inline-end: calc(-1 * var(--spacing-12));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.toast .cancel {
|
|
355
|
+
margin-inline-end: -10px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.global .cancel {
|
|
359
|
+
width: var(--spacing-48);
|
|
360
|
+
height: var(--spacing-48);
|
|
361
|
+
margin-top: calc(-1 * var(--spacing-24));
|
|
362
|
+
margin-bottom: calc(-1 * var(--spacing-24));
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* Structure: .cancelLabel from %ca-notification__cancel__label */
|
|
366
|
+
.cancelLabel {
|
|
367
|
+
position: absolute;
|
|
368
|
+
width: 1px;
|
|
369
|
+
height: 1px;
|
|
370
|
+
padding: 0;
|
|
371
|
+
margin: -1px;
|
|
372
|
+
overflow: hidden;
|
|
373
|
+
clip-path: rect(0 0 0 0);
|
|
374
|
+
border: 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* Modifiers */
|
|
378
|
+
.noBottomMargin {
|
|
379
|
+
margin-bottom: 0;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.persistent {
|
|
383
|
+
transition: none;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* This is only for inline notifications */
|
|
387
|
+
.subtle {
|
|
388
|
+
background: none;
|
|
389
|
+
border: none;
|
|
390
|
+
padding: 0;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
@@ -7,7 +7,7 @@ import { isRefObject } from '~components/utils/isRefObject'
|
|
|
7
7
|
import { CancelButton } from '../CancelButton'
|
|
8
8
|
import { NotificationHeading } from '../NotificationHeading'
|
|
9
9
|
import { NotificationIconVariant } from '../NotificationIcon'
|
|
10
|
-
import styles from './GenericNotification.module.
|
|
10
|
+
import styles from './GenericNotification.module.css'
|
|
11
11
|
|
|
12
12
|
type GenericNotificationBase = {
|
|
13
13
|
style: 'global' | 'inline' | 'toast'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Heading, type HeadingProps } from '~components/Heading'
|
|
3
|
-
import styles from '../GenericNotification/GenericNotification.module.
|
|
3
|
+
import styles from '../GenericNotification/GenericNotification.module.css'
|
|
4
4
|
|
|
5
5
|
type NotificationHeadingProps = {
|
|
6
6
|
titleProp?: HeadingProps['children']
|
package/src/Select/Select.tsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { useId, useState } from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
|
+
import { useButton } from 'react-aria'
|
|
3
4
|
import ReactSelect, {
|
|
4
5
|
components,
|
|
5
6
|
type NoticeProps,
|
|
6
7
|
type Props as ReactSelectProps,
|
|
7
8
|
} from 'react-select'
|
|
8
9
|
import Async, { type AsyncProps as ReactAsyncSelectProps } from 'react-select/async'
|
|
10
|
+
import { ClearButton } from '~components/ClearButton'
|
|
9
11
|
import { FieldMessage } from '~components/FieldMessage'
|
|
10
12
|
import { Icon } from '~components/Icon'
|
|
11
13
|
import { Label } from '~components/Label'
|
|
@@ -140,7 +142,7 @@ export const AsyncSelect = React.forwardRef(
|
|
|
140
142
|
MultiValue,
|
|
141
143
|
IndicatorsContainer,
|
|
142
144
|
ValueContainer,
|
|
143
|
-
ClearIndicator
|
|
145
|
+
ClearIndicator,
|
|
144
146
|
IndicatorSeparator: null,
|
|
145
147
|
LoadingMessage,
|
|
146
148
|
}}
|
|
@@ -235,8 +237,8 @@ const Input: typeof components.Input = (props) => (
|
|
|
235
237
|
const ValueContainer: typeof components.ValueContainer = (props) => (
|
|
236
238
|
<components.ValueContainer {...props} className={styles.valueContainer} />
|
|
237
239
|
)
|
|
238
|
-
const ClearIndicator: typeof components.ClearIndicator = (props) =>
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
const ClearIndicator: typeof components.ClearIndicator = (props) => {
|
|
241
|
+
const buttonRef = React.useRef<HTMLButtonElement>(null)
|
|
242
|
+
const { buttonProps } = useButton({ ...props, onClick: props.clearValue }, buttonRef)
|
|
243
|
+
return <ClearButton {...buttonProps} classNameOverride={styles.clearIndicator} />
|
|
244
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
.text {
|
|
3
|
+
--icon-vertical-align: text-bottom;
|
|
4
|
+
|
|
5
|
+
margin: 0;
|
|
6
|
+
|
|
7
|
+
strong {
|
|
8
|
+
font-weight: var(--typography-paragraph-bold-font-weight);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.intro-lede {
|
|
13
|
+
font-family: var(--typography-paragraph-intro-lede-font-family);
|
|
14
|
+
font-weight: var(--typography-paragraph-intro-lede-font-weight);
|
|
15
|
+
font-size: var(--typography-paragraph-intro-lede-font-size);
|
|
16
|
+
line-height: var(--typography-paragraph-intro-lede-line-height);
|
|
17
|
+
letter-spacing: var(--typography-paragraph-intro-lede-letter-spacing);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.body {
|
|
21
|
+
font-family: var(--typography-paragraph-body-font-family);
|
|
22
|
+
font-weight: var(--typography-paragraph-body-font-weight);
|
|
23
|
+
font-size: var(--typography-paragraph-body-font-size);
|
|
24
|
+
line-height: var(--typography-paragraph-body-line-height);
|
|
25
|
+
letter-spacing: var(--typography-paragraph-body-letter-spacing);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.small {
|
|
29
|
+
font-family: var(--typography-paragraph-small-font-family);
|
|
30
|
+
font-weight: var(--typography-paragraph-small-font-weight);
|
|
31
|
+
font-size: var(--typography-paragraph-small-font-size);
|
|
32
|
+
line-height: var(--typography-paragraph-small-line-height);
|
|
33
|
+
letter-spacing: var(--typography-paragraph-small-letter-spacing);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.extra-small {
|
|
37
|
+
font-family: var(--typography-paragraph-extra-small-font-family);
|
|
38
|
+
font-weight: var(--typography-paragraph-extra-small-font-weight);
|
|
39
|
+
font-size: var(--typography-paragraph-extra-small-font-size);
|
|
40
|
+
line-height: var(--typography-paragraph-extra-small-line-height);
|
|
41
|
+
letter-spacing: var(--typography-paragraph-extra-small-letter-spacing);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dark {
|
|
45
|
+
color: var(--color-purple-800);
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dark-reduced-opacity {
|
|
50
|
+
color: var(--color-purple-800);
|
|
51
|
+
opacity: 0.7;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.white {
|
|
55
|
+
color: var(--color-white);
|
|
56
|
+
opacity: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.white-reduced-opacity {
|
|
60
|
+
color: var(--color-white);
|
|
61
|
+
opacity: 0.8;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.positive {
|
|
65
|
+
color: var(--color-green-600);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.negative {
|
|
69
|
+
color: var(--color-red-600);
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/Text/Text.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement, type HTMLAttributes } from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
3
|
import { type OverrideClassName } from '~components/types/OverrideClassName'
|
|
4
|
-
import styles from './Text.module.
|
|
4
|
+
import styles from './Text.module.css'
|
|
5
5
|
|
|
6
6
|
export type TextVariants = 'intro-lede' | 'body' | 'small' | 'extra-small'
|
|
7
7
|
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
:root {
|
|
3
|
+
--animation-timing: var(--animation-duration-immediate) var(--animation-easing-function-linear);
|
|
4
|
+
--focus-ring-offset: 1px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.checkbox {
|
|
8
|
+
/* Reset checkbox */
|
|
9
|
+
opacity: 0;
|
|
10
|
+
position: absolute;
|
|
11
|
+
|
|
12
|
+
:global(.ideal-sans) & {
|
|
13
|
+
/* This is to override bootstrap styles. Remove when appropriate */
|
|
14
|
+
position: absolute;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.track {
|
|
19
|
+
position: relative;
|
|
20
|
+
background-color: var(--color-gray-500);
|
|
21
|
+
border: var(--border-borderless-border-width) var(--border-borderless-border-style)
|
|
22
|
+
var(--border-borderless-border-color);
|
|
23
|
+
border-radius: var(--spacing-md);
|
|
24
|
+
box-sizing: content-box;
|
|
25
|
+
width: calc((var(--spacing-md) * 1.05) * 2);
|
|
26
|
+
height: calc(var(--spacing-md) * 1.25);
|
|
27
|
+
padding: 0 calc(var(--spacing-md) * 0.15);
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
transition: background-color var(--animation-timing);
|
|
31
|
+
|
|
32
|
+
/* TODO: Fix */
|
|
33
|
+
/* stylelint-disable no-descending-specificity */
|
|
34
|
+
.checkbox:not(.disabled):focus + &,
|
|
35
|
+
.checkbox:not(.disabled):hover:focus + & {
|
|
36
|
+
border-color: transparent;
|
|
37
|
+
outline: 2px solid var(--color-blue-500);
|
|
38
|
+
outline-offset: var(--focus-ring-offset);
|
|
39
|
+
background-color: var(--color-gray-600);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.checkbox:not(.disabled) + &:hover,
|
|
43
|
+
label:hover .checkbox:not(.disabled) + & {
|
|
44
|
+
background-color: var(--color-gray-600);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* stylelint-enable no-descending-specificity */
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.thumb {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
background-color: var(--color-white);
|
|
55
|
+
border: var(--border-borderless-border-width) var(--border-borderless-border-style)
|
|
56
|
+
var(--border-borderless-border-color);
|
|
57
|
+
border-radius: var(--spacing-md);
|
|
58
|
+
transition:
|
|
59
|
+
left var(--animation-timing),
|
|
60
|
+
right var(--animation-timing);
|
|
61
|
+
cursor: default;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.checkIcon {
|
|
65
|
+
color: var(--color-green-500);
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transition-duration: var(--animation-duration-rapid);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* stylelint-disable no-descending-specificity */
|
|
71
|
+
.on {
|
|
72
|
+
.checkbox + .track {
|
|
73
|
+
border-color: var(--border-borderless-border-color);
|
|
74
|
+
background-color: var(--color-green-500);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.checkbox:focus + .track {
|
|
78
|
+
border-color: transparent;
|
|
79
|
+
background-color: var(--color-green-600);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.thumb {
|
|
83
|
+
position: relative;
|
|
84
|
+
right: auto;
|
|
85
|
+
inset-inline-start: calc(var(--spacing-md) * 1.1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.checkIcon {
|
|
89
|
+
opacity: 1;
|
|
90
|
+
transition-delay: var(--animation-duration-immediate);
|
|
91
|
+
transition-duration: var(--animation-duration-fast);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.checkbox:not(.disabled) + .track:hover,
|
|
95
|
+
label:hover & .checkbox:not(.disabled) + .track {
|
|
96
|
+
background-color: var(--color-green-600);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.off {
|
|
101
|
+
.thumb {
|
|
102
|
+
position: relative;
|
|
103
|
+
right: auto;
|
|
104
|
+
inset-inline-start: calc(var(--spacing-md) * -0.05);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.reversed {
|
|
109
|
+
.checkbox:focus + .track,
|
|
110
|
+
.checkbox:hover:focus + .track {
|
|
111
|
+
outline-color: var(--color-blue-300);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.off {
|
|
115
|
+
.track {
|
|
116
|
+
background-color: rgb(var(--color-white-rgb), 0.2);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.checkbox:focus + .track,
|
|
120
|
+
.checkbox:hover:focus + .track {
|
|
121
|
+
background-color: rgb(var(--color-white-rgb), 0.65);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.checkbox:not(.disabled) + .track:hover,
|
|
125
|
+
label:hover & .checkbox:not(.disabled) + .track {
|
|
126
|
+
background-color: rgb(var(--color-white-rgb), 0.65);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* When the ToggleSwitch is used as part of the ToggleSwitchField, the disabled state opacity is set on the Label component */
|
|
132
|
+
label .disabled.track {
|
|
133
|
+
opacity: 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.disabled.track {
|
|
137
|
+
opacity: 0.3;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* stylelint-enable no-descending-specificity */
|
|
141
|
+
}
|
|
@@ -2,7 +2,7 @@ import React, { type InputHTMLAttributes } from 'react'
|
|
|
2
2
|
import classnames from 'classnames'
|
|
3
3
|
import { Icon } from '~components/Icon'
|
|
4
4
|
import { type OverrideClassName } from '~components/types/OverrideClassName'
|
|
5
|
-
import styles from './ToggleSwitch.module.
|
|
5
|
+
import styles from './ToggleSwitch.module.css'
|
|
6
6
|
|
|
7
7
|
export type ToggledStatus = 'on' | 'off'
|
|
8
8
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@import '~@kaizen/design-tokens/sass/typography';
|
|
2
|
-
|
|
3
1
|
@layer kz-components {
|
|
4
2
|
.container {
|
|
5
3
|
display: flex;
|
|
@@ -12,6 +10,6 @@
|
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
.on label {
|
|
15
|
-
font-weight:
|
|
13
|
+
font-weight: var(--typography-paragraph-bold-font-weight);
|
|
16
14
|
}
|
|
17
15
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type ToggleSwitchProps,
|
|
8
8
|
type ToggledStatus,
|
|
9
9
|
} from '../ToggleSwitch/ToggleSwitch'
|
|
10
|
-
import styles from './ToggleSwitchField.module.
|
|
10
|
+
import styles from './ToggleSwitchField.module.css'
|
|
11
11
|
|
|
12
12
|
export type ToggleSwitchFieldProps = {
|
|
13
13
|
labelText: React.ReactNode
|