@kaizen/components 2.3.7 → 2.5.0

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.
Files changed (202) hide show
  1. package/dist/cjs/index.cjs +2 -0
  2. package/dist/cjs/src/Content/Content.cjs +1 -1
  3. package/dist/cjs/src/Content/{Content.module.scss.cjs → Content.module.css.cjs} +1 -1
  4. package/dist/cjs/src/Divider/Divider.cjs +1 -1
  5. package/dist/cjs/src/Divider/Divider.module.css.cjs +10 -0
  6. package/dist/cjs/src/ErrorPage/ErrorPage.cjs +1 -1
  7. package/dist/cjs/src/ErrorPage/ErrorPage.module.css.cjs +6 -0
  8. package/dist/cjs/src/Heading/Heading.cjs +1 -1
  9. package/dist/cjs/src/Heading/Heading.module.css.cjs +22 -0
  10. package/dist/cjs/src/Illustration/Spot/Spot.cjs +9 -0
  11. package/dist/cjs/src/Label/Label.cjs +1 -1
  12. package/dist/cjs/src/Label/Label.module.css.cjs +16 -0
  13. package/dist/cjs/src/LabelledMessage/LabelledMessage.cjs +1 -1
  14. package/dist/cjs/src/LabelledMessage/LabelledMessage.module.css.cjs +7 -0
  15. package/dist/cjs/src/Notification/InlineNotification/InlineNotification.cjs +1 -1
  16. package/dist/cjs/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs +1 -1
  17. package/dist/cjs/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss.cjs → ToastNotificationsList.module.css.cjs} +1 -1
  18. package/dist/cjs/src/Notification/subcomponents/CancelButton/CancelButton.cjs +1 -1
  19. package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.cjs +1 -1
  20. package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css.cjs +29 -0
  21. package/dist/cjs/src/Notification/subcomponents/NotificationHeading/NotificationHeading.cjs +1 -1
  22. package/dist/cjs/src/Select/Select.cjs +9 -7
  23. package/dist/cjs/src/Tag/Tag.cjs +1 -1
  24. package/dist/cjs/src/Tag/Tag.module.css.cjs +30 -0
  25. package/dist/cjs/src/Text/Text.cjs +1 -1
  26. package/dist/cjs/src/Text/Text.module.css.cjs +16 -0
  27. package/dist/cjs/src/TimeField/TimeField.cjs +6 -1
  28. package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.cjs +1 -1
  29. package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css.cjs +13 -0
  30. package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.cjs +1 -1
  31. package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.css.cjs +9 -0
  32. package/dist/cjs/src/Tooltip/OverlayArrow.cjs +1 -1
  33. package/dist/cjs/src/Tooltip/OverlayArrow.module.css.cjs +7 -0
  34. package/dist/cjs/src/Tooltip/Tooltip.cjs +1 -1
  35. package/dist/cjs/src/Tooltip/Tooltip.module.css.cjs +7 -0
  36. package/dist/cjs/src/VisuallyHidden/VisuallyHidden.cjs +1 -1
  37. package/dist/cjs/src/VisuallyHidden/{VisuallyHidden.module.scss.cjs → VisuallyHidden.module.css.cjs} +1 -1
  38. package/dist/esm/index.mjs +1 -1
  39. package/dist/esm/src/Content/Content.mjs +1 -1
  40. package/dist/esm/src/Content/{Content.module.scss.mjs → Content.module.css.mjs} +1 -1
  41. package/dist/esm/src/Divider/Divider.mjs +1 -1
  42. package/dist/esm/src/Divider/Divider.module.css.mjs +8 -0
  43. package/dist/esm/src/ErrorPage/ErrorPage.mjs +1 -1
  44. package/dist/esm/src/ErrorPage/ErrorPage.module.css.mjs +4 -0
  45. package/dist/esm/src/Heading/Heading.mjs +1 -1
  46. package/dist/esm/src/Heading/Heading.module.css.mjs +20 -0
  47. package/dist/esm/src/Illustration/Spot/Spot.mjs +8 -1
  48. package/dist/esm/src/Label/Label.mjs +1 -1
  49. package/dist/esm/src/Label/Label.module.css.mjs +14 -0
  50. package/dist/esm/src/LabelledMessage/LabelledMessage.mjs +1 -1
  51. package/dist/esm/src/LabelledMessage/LabelledMessage.module.css.mjs +5 -0
  52. package/dist/esm/src/Notification/InlineNotification/InlineNotification.mjs +1 -1
  53. package/dist/esm/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.mjs +1 -1
  54. package/dist/esm/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss.mjs → ToastNotificationsList.module.css.mjs} +1 -1
  55. package/dist/esm/src/Notification/subcomponents/CancelButton/CancelButton.mjs +1 -1
  56. package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.mjs +1 -1
  57. package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css.mjs +27 -0
  58. package/dist/esm/src/Notification/subcomponents/NotificationHeading/NotificationHeading.mjs +1 -1
  59. package/dist/esm/src/Select/Select.mjs +9 -7
  60. package/dist/esm/src/Tag/Tag.mjs +1 -1
  61. package/dist/esm/src/Tag/Tag.module.css.mjs +28 -0
  62. package/dist/esm/src/Text/Text.mjs +1 -1
  63. package/dist/esm/src/Text/Text.module.css.mjs +14 -0
  64. package/dist/esm/src/TimeField/TimeField.mjs +7 -2
  65. package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.mjs +1 -1
  66. package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css.mjs +11 -0
  67. package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.mjs +1 -1
  68. package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.css.mjs +7 -0
  69. package/dist/esm/src/Tooltip/OverlayArrow.mjs +1 -1
  70. package/dist/esm/src/Tooltip/OverlayArrow.module.css.mjs +5 -0
  71. package/dist/esm/src/Tooltip/Tooltip.mjs +1 -1
  72. package/dist/esm/src/Tooltip/Tooltip.module.css.mjs +5 -0
  73. package/dist/esm/src/VisuallyHidden/VisuallyHidden.mjs +1 -1
  74. package/dist/esm/src/VisuallyHidden/VisuallyHidden.module.css.mjs +4 -0
  75. package/dist/styles.css +924 -655
  76. package/dist/types/Illustration/Spot/Spot.d.ts +5 -0
  77. package/locales/ar.json +4 -0
  78. package/locales/bg.json +4 -0
  79. package/locales/cs.json +4 -0
  80. package/locales/cy.json +4 -0
  81. package/locales/da.json +4 -0
  82. package/locales/de.json +4 -0
  83. package/locales/el.json +4 -0
  84. package/locales/en-GB.json +4 -0
  85. package/locales/en.json +4 -0
  86. package/locales/es-419.json +4 -0
  87. package/locales/es.json +4 -0
  88. package/locales/et.json +4 -0
  89. package/locales/fi.json +4 -0
  90. package/locales/fr-CA.json +4 -0
  91. package/locales/fr.json +4 -0
  92. package/locales/he.json +4 -0
  93. package/locales/hi.json +4 -0
  94. package/locales/ht.json +4 -0
  95. package/locales/hu.json +4 -0
  96. package/locales/id.json +4 -0
  97. package/locales/it.json +4 -0
  98. package/locales/ja.json +4 -0
  99. package/locales/km-KH.json +4 -0
  100. package/locales/ko.json +4 -0
  101. package/locales/lt.json +4 -0
  102. package/locales/lv.json +4 -0
  103. package/locales/mi.json +4 -0
  104. package/locales/ms.json +4 -0
  105. package/locales/nb.json +4 -0
  106. package/locales/nl.json +4 -0
  107. package/locales/pl.json +4 -0
  108. package/locales/pt-BR.json +4 -0
  109. package/locales/pt.json +4 -0
  110. package/locales/ro.json +4 -0
  111. package/locales/ru.json +4 -0
  112. package/locales/si-LK.json +4 -0
  113. package/locales/sk.json +4 -0
  114. package/locales/sr.json +4 -0
  115. package/locales/sv.json +4 -0
  116. package/locales/th.json +4 -0
  117. package/locales/tl.json +4 -0
  118. package/locales/tr.json +4 -0
  119. package/locales/uk.json +4 -0
  120. package/locales/vi.json +4 -0
  121. package/locales/zh-TW.json +4 -0
  122. package/locales/zh.json +4 -0
  123. package/package.json +1 -1
  124. package/src/Content/Content.module.css +15 -0
  125. package/src/Content/Content.tsx +1 -1
  126. package/src/Content/_docs/Content.stories.tsx +1 -1
  127. package/src/Content/_variables.css +5 -0
  128. package/src/Divider/Divider.module.css +41 -0
  129. package/src/Divider/Divider.tsx +1 -1
  130. package/src/ErrorPage/ErrorPage.module.css +5 -0
  131. package/src/ErrorPage/ErrorPage.tsx +1 -1
  132. package/src/Heading/Heading.module.css +111 -0
  133. package/src/Heading/Heading.tsx +1 -1
  134. package/src/Illustration/Spot/Spot.tsx +6 -0
  135. package/src/Illustration/Spot/_docs/Spot.stickersheet.stories.tsx +22 -0
  136. package/src/Label/Label.module.css +97 -0
  137. package/src/Label/Label.tsx +1 -1
  138. package/src/Label/_docs/Label.stickersheet.stories.tsx +9 -4
  139. package/src/LabelledMessage/{LabelledMessage.module.scss → LabelledMessage.module.css} +1 -3
  140. package/src/LabelledMessage/LabelledMessage.tsx +1 -1
  141. package/src/Notification/InlineNotification/InlineNotification.tsx +1 -1
  142. package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +1 -1
  143. package/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss → ToastNotificationsList.module.css} +6 -8
  144. package/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.tsx +1 -1
  145. package/src/Notification/subcomponents/CancelButton/CancelButton.tsx +1 -1
  146. package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css +392 -0
  147. package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +1 -1
  148. package/src/Notification/subcomponents/NotificationHeading/NotificationHeading.tsx +1 -1
  149. package/src/Select/Select.tsx +8 -6
  150. package/src/Tag/Tag.module.css +217 -0
  151. package/src/Tag/Tag.tsx +1 -1
  152. package/src/Text/Text.module.css +71 -0
  153. package/src/Text/Text.tsx +1 -1
  154. package/src/TimeField/TimeField.tsx +8 -2
  155. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css +141 -0
  156. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +1 -1
  157. package/src/ToggleSwitch/ToggleSwitchField/{ToggleSwitchField.module.scss → ToggleSwitchField.module.css} +1 -3
  158. package/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.tsx +1 -1
  159. package/src/Tooltip/OverlayArrow.module.css +45 -0
  160. package/src/Tooltip/OverlayArrow.tsx +1 -1
  161. package/src/Tooltip/Tooltip.module.css +62 -0
  162. package/src/Tooltip/Tooltip.tsx +1 -1
  163. package/src/VisuallyHidden/VisuallyHidden.tsx +1 -1
  164. package/dist/cjs/src/Divider/Divider.module.scss.cjs +0 -10
  165. package/dist/cjs/src/ErrorPage/ErrorPage.module.scss.cjs +0 -6
  166. package/dist/cjs/src/Heading/Heading.module.scss.cjs +0 -22
  167. package/dist/cjs/src/Label/Label.module.scss.cjs +0 -15
  168. package/dist/cjs/src/LabelledMessage/LabelledMessage.module.scss.cjs +0 -7
  169. package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.cjs +0 -29
  170. package/dist/cjs/src/Tag/Tag.module.scss.cjs +0 -30
  171. package/dist/cjs/src/Text/Text.module.scss.cjs +0 -16
  172. package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.cjs +0 -13
  173. package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.scss.cjs +0 -9
  174. package/dist/cjs/src/Tooltip/OverlayArrow.module.scss.cjs +0 -7
  175. package/dist/cjs/src/Tooltip/Tooltip.module.scss.cjs +0 -7
  176. package/dist/esm/src/Divider/Divider.module.scss.mjs +0 -8
  177. package/dist/esm/src/ErrorPage/ErrorPage.module.scss.mjs +0 -4
  178. package/dist/esm/src/Heading/Heading.module.scss.mjs +0 -20
  179. package/dist/esm/src/Label/Label.module.scss.mjs +0 -13
  180. package/dist/esm/src/LabelledMessage/LabelledMessage.module.scss.mjs +0 -5
  181. package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs +0 -27
  182. package/dist/esm/src/Tag/Tag.module.scss.mjs +0 -28
  183. package/dist/esm/src/Text/Text.module.scss.mjs +0 -14
  184. package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.mjs +0 -11
  185. package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.scss.mjs +0 -7
  186. package/dist/esm/src/Tooltip/OverlayArrow.module.scss.mjs +0 -5
  187. package/dist/esm/src/Tooltip/Tooltip.module.scss.mjs +0 -5
  188. package/dist/esm/src/VisuallyHidden/VisuallyHidden.module.scss.mjs +0 -4
  189. package/src/Content/Content.module.scss +0 -17
  190. package/src/Content/_variables.scss +0 -3
  191. package/src/Divider/Divider.module.scss +0 -39
  192. package/src/ErrorPage/ErrorPage.module.scss +0 -7
  193. package/src/Heading/Heading.module.scss +0 -115
  194. package/src/Label/Label.module.scss +0 -105
  195. package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +0 -138
  196. package/src/Notification/subcomponents/GenericNotification/_mixins.scss +0 -366
  197. package/src/Tag/Tag.module.scss +0 -215
  198. package/src/Text/Text.module.scss +0 -74
  199. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +0 -139
  200. package/src/Tooltip/OverlayArrow.module.scss +0 -45
  201. package/src/Tooltip/Tooltip.module.scss +0 -68
  202. /package/src/VisuallyHidden/{VisuallyHidden.module.scss → VisuallyHidden.module.css} +0 -0
@@ -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.scss'
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.scss'
3
+ import styles from '../GenericNotification/GenericNotification.module.css'
4
4
 
5
5
  type NotificationHeadingProps = {
6
6
  titleProp?: HeadingProps['children']
@@ -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: undefined,
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
- <components.ClearIndicator {...props} className={styles.clearIndicator}>
240
- <Icon name="cancel" isPresentational isFilled />
241
- </components.ClearIndicator>
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,217 @@
1
+ @layer kz-components {
2
+ .root {
3
+ --medium: calc(var(--spacing-md) * 1.25);
4
+ --small: var(--spacing-md);
5
+
6
+ margin-inline-end: calc(var(--spacing-md) * 0.5);
7
+ font-size: var(--typography-paragraph-small-font-size);
8
+ font-weight: var(--typography-paragraph-small-font-weight);
9
+ letter-spacing: var(--typography-paragraph-small-letter-spacing);
10
+ color: var(--color-purple-800);
11
+ display: inline-block;
12
+ border: var(--border-borderless-border-width) var(--border-borderless-border-style)
13
+ var(--border-borderless-border-color);
14
+ border-radius: calc(var(--spacing-md) * 0.75);
15
+ padding: 0 calc(var(--spacing-md) * 0.4);
16
+ box-sizing: border-box;
17
+
18
+ &.profile {
19
+ padding-left: calc(var(--spacing-md) * 0.2);
20
+ }
21
+ }
22
+
23
+ .layoutContainer {
24
+ height: 100%;
25
+ display: flex;
26
+ align-items: center;
27
+ }
28
+
29
+ .validationIcon {
30
+ align-items: center;
31
+ display: flex;
32
+ color: var(--color-white);
33
+ margin-inline: calc(var(--spacing-md) * -0.15) var(--spacing-xs);
34
+ }
35
+
36
+ .profile {
37
+ margin-inline: calc(var(--spacing-md) * -0.15) var(--spacing-xs);
38
+ display: inline-flex;
39
+ align-items: center;
40
+ }
41
+
42
+ .textContent {
43
+ margin-top: -1px;
44
+ font-family: var(--typography-paragraph-small-font-family);
45
+ font-weight: var(--typography-paragraph-small-font-weight);
46
+ font-size: var(--typography-paragraph-small-font-size);
47
+ line-height: var(--typography-paragraph-small-line-height);
48
+ letter-spacing: var(--typography-paragraph-small-letter-spacing);
49
+ white-space: nowrap;
50
+ }
51
+
52
+ .iconWrapper {
53
+ --icon-size: 16;
54
+
55
+ position: relative;
56
+ height: 16px;
57
+ width: 16px;
58
+ }
59
+
60
+ .dismissButton {
61
+ /* Replace @include button-reset to reset button's style */
62
+ appearance: none;
63
+ background: transparent;
64
+ font: inherit;
65
+ margin: 0;
66
+ border: none;
67
+
68
+ /* Original style */
69
+ position: relative;
70
+ display: flex;
71
+ height: 100%;
72
+ align-items: center;
73
+ padding: 0 var(--spacing-xs);
74
+ margin-inline: -0.225rem -0.6625rem;
75
+ color: rgb(var(--color-purple-800-rgb), 0.7);
76
+ cursor: pointer;
77
+
78
+ &:hover {
79
+ color: var(--color-purple-800);
80
+ }
81
+
82
+ &:active {
83
+ color: var(--color-purple-800);
84
+ }
85
+
86
+ svg {
87
+ position: relative;
88
+ }
89
+
90
+ &:focus {
91
+ outline: none;
92
+ }
93
+
94
+ &:focus-visible .iconWrapper {
95
+ color: var(--color-purple-800);
96
+
97
+ &::after {
98
+ --focus-ring-offset: calc((var(--border-focus-ring-border-width)));
99
+
100
+ content: '';
101
+ position: absolute;
102
+ background: transparent;
103
+ border-radius: 50%;
104
+ border-width: var(--border-focus-ring-border-width);
105
+ border-style: var(--border-focus-ring-border-style);
106
+ border-color: var(--color-blue-500);
107
+ inset: calc(-1 * var(--focus-ring-offset));
108
+ }
109
+ }
110
+ }
111
+
112
+ .background {
113
+ /*
114
+ As our icons are only one-tone, this span places
115
+ a white background under the dismissible icon to
116
+ give the illusion of a background colour that is
117
+ different to the rest of the tag
118
+ */
119
+ position: absolute;
120
+ display: inline-block;
121
+ width: calc(var(--spacing-xs) + 0.125rem); /* optical adjustment */
122
+ height: calc(var(--spacing-xs) + 0.125rem); /* optical adjustment */
123
+ background-color: white;
124
+ left: 10px;
125
+ top: 10px;
126
+ }
127
+
128
+ .truncate {
129
+ text-overflow: ellipsis;
130
+ overflow-x: hidden;
131
+ white-space: nowrap;
132
+ }
133
+
134
+ .inline {
135
+ margin: 0;
136
+ }
137
+
138
+ .medium {
139
+ height: var(--medium);
140
+ }
141
+
142
+ .small {
143
+ height: var(--small);
144
+ }
145
+
146
+ .default {
147
+ background-color: var(--color-gray-300);
148
+ }
149
+
150
+ .sentimentPositive {
151
+ background-color: var(--color-green-100);
152
+ }
153
+
154
+ .sentimentNeutral {
155
+ background-color: var(--color-gray-300);
156
+ }
157
+
158
+ .sentimentNegative {
159
+ background-color: var(--color-red-100);
160
+ }
161
+
162
+ .sentimentNone {
163
+ background-color: var(--color-white);
164
+ border-color: var(--color-gray-300);
165
+ }
166
+
167
+ .validationPositive {
168
+ background-color: var(--color-green-100);
169
+
170
+ .validationIcon {
171
+ color: var(--color-green-500);
172
+ }
173
+ }
174
+
175
+ .validationInformative {
176
+ background-color: var(--color-blue-100);
177
+
178
+ .validationIcon {
179
+ color: var(--color-blue-500);
180
+ }
181
+ }
182
+
183
+ .validationNegative {
184
+ background-color: var(--color-red-100);
185
+
186
+ .validationIcon {
187
+ color: var(--color-red-500);
188
+ }
189
+ }
190
+
191
+ .validationCautionary {
192
+ background-color: var(--color-yellow-100);
193
+
194
+ .validationIcon {
195
+ color: var(--color-yellow-700);
196
+ }
197
+ }
198
+
199
+ .statusLive {
200
+ background-color: var(--color-green-100);
201
+ color: var(--color-purple-800);
202
+ }
203
+
204
+ .statusAction {
205
+ background-color: var(--color-orange-100);
206
+ color: var(--color-purple-800);
207
+ }
208
+
209
+ .statusClosed {
210
+ background-color: var(--color-red-100);
211
+ }
212
+
213
+ .statusDraft {
214
+ background-color: var(--color-blue-100);
215
+ color: var(--color-purple-800);
216
+ }
217
+ }
package/src/Tag/Tag.tsx CHANGED
@@ -4,7 +4,7 @@ import { Avatar, type AvatarProps } from '~components/Avatar'
4
4
  import { Icon } from '~components/Icon'
5
5
  import { LiveIcon } from './subcomponents/LiveIcon/LiveIcon'
6
6
  import { type TagVariants } from './types'
7
- import styles from './Tag.module.scss'
7
+ import styles from './Tag.module.css'
8
8
 
9
9
  export type TagWithAvatarProps = Omit<DefaultTagProps, 'variant'> & {
10
10
  variant: 'profile'