@perawallet/react-ui-toolkit 2.0.0-beta.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 (116) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -0
  3. package/dist/Button.js +1 -0
  4. package/dist/Checkbox.js +1 -0
  5. package/dist/DateTimer-DIYsxSVY.js +1 -0
  6. package/dist/DateTimer.js +1 -0
  7. package/dist/FileInput.js +1 -0
  8. package/dist/FileUploadButton.js +1 -0
  9. package/dist/FormField.js +1 -0
  10. package/dist/Input.js +1 -0
  11. package/dist/List.js +1 -0
  12. package/dist/ListItem.js +1 -0
  13. package/dist/NumberInput.js +1 -0
  14. package/dist/PasswordInput.js +1 -0
  15. package/dist/ProgressBar.js +1 -0
  16. package/dist/Radio.js +1 -0
  17. package/dist/RadioGroup.js +1 -0
  18. package/dist/Select-CMiQfdu3.js +1 -0
  19. package/dist/Select.js +1 -0
  20. package/dist/Spinner.js +1 -0
  21. package/dist/Switch.js +1 -0
  22. package/dist/Textarea.js +1 -0
  23. package/dist/TimeInput.js +1 -0
  24. package/dist/Toast-9FKOjJle.js +1 -0
  25. package/dist/Toast.js +1 -0
  26. package/dist/Toggle.js +1 -0
  27. package/dist/TypeaheadInput.js +1 -0
  28. package/dist/TypeaheadSelect.js +1 -0
  29. package/dist/arrayUtils-BZ-V_2c9.js +1 -0
  30. package/dist/button/Button.d.ts +25 -0
  31. package/dist/button/file-upload/FileUploadButton.d.ts +9 -0
  32. package/dist/check-BSS-LBT3.js +1 -0
  33. package/dist/core/utils/array/arrayUtils.d.ts +13 -0
  34. package/dist/core/utils/device/deviceUtils.d.ts +2 -0
  35. package/dist/core/utils/dom/domUtils.d.ts +2 -0
  36. package/dist/core/utils/function/functionUtils.d.ts +7 -0
  37. package/dist/core/utils/hooks/useDateTimer.d.ts +17 -0
  38. package/dist/core/utils/hooks/useDebounce.d.ts +2 -0
  39. package/dist/core/utils/hooks/useOnClickOutside.d.ts +2 -0
  40. package/dist/core/utils/keyboard/keyboardEventConstants.d.ts +16 -0
  41. package/dist/core/utils/number/numberConstants.d.ts +5 -0
  42. package/dist/core/utils/number/numberTypes.d.ts +7 -0
  43. package/dist/core/utils/number/numberUtils.d.ts +44 -0
  44. package/dist/core/utils/string/stringConstants.d.ts +2 -0
  45. package/dist/core/utils/string/stringUtils.d.ts +5 -0
  46. package/dist/core/utils/test/testUtils.d.ts +19 -0
  47. package/dist/core/utils/time/timeConstants.d.ts +13 -0
  48. package/dist/core/utils/time/timeTypes.d.ts +13 -0
  49. package/dist/core/utils/time/timeUtils.d.ts +42 -0
  50. package/dist/date-timer/DateTimer.d.ts +4 -0
  51. package/dist/date-timer/util/dateTimerTypes.d.ts +18 -0
  52. package/dist/date-timer/util/dateTimerUtils.d.ts +7 -0
  53. package/dist/form/field/FormField.d.ts +14 -0
  54. package/dist/form/field/message/FormFieldMessage.d.ts +9 -0
  55. package/dist/form/input/Input.d.ts +14 -0
  56. package/dist/form/input/checkbox/CheckboxInput.d.ts +14 -0
  57. package/dist/form/input/file/FileInput.d.ts +19 -0
  58. package/dist/form/input/number/NumberInput.d.ts +6 -0
  59. package/dist/form/input/number/util/numberInputTypes.d.ts +14 -0
  60. package/dist/form/input/number/util/numberInputUtils.d.ts +42 -0
  61. package/dist/form/input/radio/RadioInput.d.ts +24 -0
  62. package/dist/form/input/radio/group/RadioGroup.d.ts +12 -0
  63. package/dist/form/input/typeahead/TypeaheadInput.d.ts +27 -0
  64. package/dist/form/input/util/inputTypes.d.ts +12 -0
  65. package/dist/form/password-input/PasswordInput.d.ts +9 -0
  66. package/dist/form/textarea/Textarea.d.ts +22 -0
  67. package/dist/form/time-input/TimeInput.d.ts +10 -0
  68. package/dist/index.d.ts +93 -0
  69. package/dist/index.js +1 -0
  70. package/dist/keyboardEventConstants-BL5de2V9.js +1 -0
  71. package/dist/list/List.d.ts +26 -0
  72. package/dist/list/description-term/DescriptionTerm.d.ts +16 -0
  73. package/dist/list/item/ListItem.d.ts +17 -0
  74. package/dist/list/util/listUtils.d.ts +7 -0
  75. package/dist/main.css +703 -0
  76. package/dist/numberUtils-CMCFc8Kh.js +1 -0
  77. package/dist/progress-bar/ProgressBar.d.ts +20 -0
  78. package/dist/select/Select.d.ts +19 -0
  79. package/dist/select/content/SelectContent.d.ts +9 -0
  80. package/dist/select/group/SelectGroup.d.ts +8 -0
  81. package/dist/select/item/SelectItem.d.ts +17 -0
  82. package/dist/select/item-list/SelectItemList.d.ts +13 -0
  83. package/dist/select/trigger/SelectTrigger.d.ts +6 -0
  84. package/dist/select/typeahead/TypeaheadSelect.d.ts +26 -0
  85. package/dist/select/typeahead/trigger/TypeheadSelectTrigger.d.ts +20 -0
  86. package/dist/select/typeahead/util/typeaheadSelectUtils.d.ts +3 -0
  87. package/dist/select/util/context/SelectContext.d.ts +7 -0
  88. package/dist/select/util/context/SelectContext.reducer.d.ts +3 -0
  89. package/dist/select/util/hook/useMultiSelect.d.ts +14 -0
  90. package/dist/select/util/hook/useSelectClassName.d.ts +12 -0
  91. package/dist/select/util/hook/useSelectKeyDown.d.ts +18 -0
  92. package/dist/select/util/hook/useSingleSelect.d.ts +13 -0
  93. package/dist/select/util/selectTypes.d.ts +40 -0
  94. package/dist/select/util/selectUtils.d.ts +9 -0
  95. package/dist/spinner/Spinner.d.ts +7 -0
  96. package/dist/switch/Switch.d.ts +10 -0
  97. package/dist/tab/Tab.d.ts +27 -0
  98. package/dist/tab/header/item/TabHeaderItem.d.ts +11 -0
  99. package/dist/tag/Tag.d.ts +15 -0
  100. package/dist/tag/util/tagUtils.d.ts +4 -0
  101. package/dist/timeUtils-BvuzU1KM.js +1 -0
  102. package/dist/toast/Toast.d.ts +11 -0
  103. package/dist/toast/ToastItemContext.d.ts +5 -0
  104. package/dist/toast/ToastProvider.d.ts +17 -0
  105. package/dist/toast/close-button/ToastCloseButton.d.ts +8 -0
  106. package/dist/toast/stack/ToastStack.d.ts +6 -0
  107. package/dist/toast/util/toastConstants.d.ts +4 -0
  108. package/dist/toast/util/toastHooks.d.ts +28 -0
  109. package/dist/toast/util/toastReducer.d.ts +5 -0
  110. package/dist/toast/util/toastTypes.d.ts +39 -0
  111. package/dist/toast/util/toastUtils.d.ts +3 -0
  112. package/dist/toggle/Toggle.d.ts +18 -0
  113. package/dist/toggle/item/ToggleItem.d.ts +11 -0
  114. package/dist/toggle/util/ToggleContext.d.ts +8 -0
  115. package/dist/useDebounce-CP74COv3.js +1 -0
  116. package/package.json +110 -0
package/dist/main.css ADDED
@@ -0,0 +1,703 @@
1
+ /* stylelint-disable color-no-hex */
2
+ :root {
3
+ --text-color: black;
4
+ --invalid-text-color: #a43030;
5
+ --placeholder-text-color: #757575;
6
+ --disabled-text-color: #6c6e76;
7
+ --default-border-color: #ebebeb;
8
+ --default-box-shadow: 0 0 5px #ebebeb;
9
+ }
10
+
11
+ /* stylelint-enable color-no-hex */
12
+ :root {
13
+ --small-radius-size: 2px;
14
+ }
15
+ .spinner {
16
+ animation: spinner 1.7s linear infinite;
17
+ }
18
+
19
+ @keyframes spinner {
20
+ from {
21
+ transform: rotate(0deg);
22
+ }
23
+ to {
24
+ transform: rotate(360deg);
25
+ }
26
+ }
27
+ .button {
28
+ --button-width: max-content;
29
+ --button-height: 35px;
30
+ --button-bg: black;
31
+ --button-color: white;
32
+ position: relative;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ width: var(--button-width);
37
+ height: var(--button-height);
38
+ color: var(--button-color);
39
+ background-color: var(--button-bg);
40
+ border: none;
41
+ border-radius: var(--small-radius-size);
42
+ outline: none;
43
+ cursor: pointer;
44
+ }
45
+ .button:focus {
46
+ box-shadow: var(--default-box-shadow);
47
+ }
48
+
49
+ .button--is-inactive {
50
+ opacity: 0.5;
51
+ cursor: not-allowed;
52
+ }
53
+
54
+ .button__spinner-container {
55
+ position: absolute;
56
+ width: 100%;
57
+ background-color: var(--button-bg);
58
+ }
59
+
60
+ .button__spinner .spinner__background {
61
+ background: var(--button-bg);
62
+ }
63
+ .file-input__container {
64
+ position: relative;
65
+ }
66
+
67
+ .file-input {
68
+ position: absolute;
69
+ z-index: -1;
70
+ width: 0.1px;
71
+ height: 0.1px;
72
+ overflow: hidden;
73
+ opacity: 0;
74
+ }
75
+ .file-input:focus + .file-input__label {
76
+ box-shadow: var(--default-box-shadow);
77
+ }
78
+ .file-input + .file-input__label--is-disabled {
79
+ opacity: 0.5;
80
+ cursor: not-allowed;
81
+ }
82
+
83
+ .file-input__label {
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ padding: 0 8px;
88
+ cursor: pointer;
89
+ }
90
+
91
+ .file-input__spinner {
92
+ margin: 0 0 0 16px;
93
+ }
94
+ .file-input__spinner .spinner__background {
95
+ background-color: var(--button-bg);
96
+ }
97
+ .date-timer {
98
+ display: grid;
99
+ grid-template-columns: repeat(auto-fit, 60px);
100
+ width: 100%;
101
+ }
102
+
103
+ .date-timer-box {
104
+ display: flex;
105
+ flex-direction: column;
106
+ align-items: center;
107
+ }
108
+ .date-timer-box__title {
109
+ margin-top: 8px;
110
+ }
111
+ .date-timer-box__count {
112
+ font-variant-numeric: tabular-nums;
113
+ }
114
+ .list-item__click-wrapper {
115
+ cursor: pointer;
116
+ }
117
+ .list {
118
+ padding: 0;
119
+ list-style-type: none;
120
+ }
121
+ .form-field {
122
+ margin-bottom: 25px;
123
+ }
124
+
125
+ .form-field__label {
126
+ display: block;
127
+ }
128
+
129
+ .form-field__title {
130
+ display: block;
131
+ margin-bottom: 8px;
132
+ }
133
+ .form-field-message-row {
134
+ margin: 8px 0;
135
+ font-size: 12px;
136
+ font-weight: 500;
137
+ line-height: 15px;
138
+ }
139
+
140
+ .form-field-message--is-error {
141
+ color: var(--invalid-text-color);
142
+ }
143
+ .checkbox-input-label {
144
+ --checkbox-border-color: black;
145
+ --checkbox-focus-border-color: black;
146
+ --checkbox-focus-bg: black;
147
+ --checkbox-icon-color: white;
148
+ position: relative;
149
+ display: inline-flex;
150
+ align-items: center;
151
+ cursor: pointer;
152
+ user-select: none;
153
+ font-size: 16px;
154
+ }
155
+
156
+ .checkbox-input-label--is-selected .checkbox-input-label__icon {
157
+ background-color: var(--checkbox-focus-bg);
158
+ border-color: var(--checkbox-focus-border-color);
159
+ }
160
+ .checkbox-input-label--is-selected .checkbox-input-label__icon svg {
161
+ display: block;
162
+ }
163
+ .checkbox-input-label--is-selected .checkbox-input-label__icon svg path {
164
+ fill: var(--checkbox-icon-color);
165
+ }
166
+
167
+ .checkbox-input-label--is-disabled {
168
+ opacity: 0.5;
169
+ cursor: not-allowed;
170
+ }
171
+
172
+ .checkbox-input {
173
+ position: absolute;
174
+ width: 0;
175
+ height: 0;
176
+ opacity: 0;
177
+ cursor: pointer;
178
+ }
179
+ .checkbox-input:focus ~ .checkbox-input-label__icon {
180
+ border-color: var(--checkbox-focus-border-color);
181
+ }
182
+ .checkbox-input:disabled ~ .checkbox-input-label__icon {
183
+ pointer-events: none;
184
+ }
185
+
186
+ .checkbox-input-label__icon {
187
+ position: relative;
188
+ display: inline-flex;
189
+ align-items: center;
190
+ justify-content: center;
191
+ width: 20px;
192
+ height: 20px;
193
+ flex-shrink: 0;
194
+ margin-right: 10px;
195
+ border: 1px solid var(--checkbox-border-color);
196
+ border-radius: var(--small-radius-size);
197
+ transition: border-color 0.4s ease-in-out;
198
+ }
199
+ .input-container {
200
+ --input-height: 48px;
201
+ display: flex;
202
+ align-items: center;
203
+ width: 100%;
204
+ }
205
+
206
+ .input-container__icon {
207
+ display: flex;
208
+ align-items: center;
209
+ justify-content: center;
210
+ width: 40px;
211
+ height: var(--input-height);
212
+ }
213
+
214
+ .input {
215
+ height: var(--input-height);
216
+ flex: 1;
217
+ padding: 0 14px;
218
+ color: var(--text-color);
219
+ border: 1px solid var(--default-border-color);
220
+ border-radius: var(--small-radius-size);
221
+ }
222
+ .input::placeholder {
223
+ color: var(--placeholder-text-color);
224
+ }
225
+ .input:focus {
226
+ outline: none;
227
+ }
228
+
229
+ .input-container--has-error {
230
+ border: 1px solid var(--invalid-text-color);
231
+ }
232
+ .radio-group {
233
+ list-style-type: none;
234
+ padding: 0;
235
+ }
236
+ .radio-input-label {
237
+ --radio-border-color: darkgrey;
238
+ --radio-focus-icon-color: black;
239
+ position: relative;
240
+ display: grid;
241
+ grid-template-columns: 30px 1fr;
242
+ margin-bottom: 10px;
243
+ color: var(--text-color);
244
+ cursor: pointer;
245
+ user-select: none;
246
+ font-size: 16px;
247
+ }
248
+
249
+ .radio-input-label--is-selected .radio-input-label__icon {
250
+ background-color: var(--radio-focus-icon-color);
251
+ border-color: transparent;
252
+ }
253
+
254
+ .radio-input-label--is-disabled {
255
+ opacity: 0.5;
256
+ cursor: not-allowed;
257
+ }
258
+
259
+ .radio-input {
260
+ position: absolute;
261
+ width: 0;
262
+ height: 0;
263
+ opacity: 0;
264
+ cursor: pointer;
265
+ }
266
+ .radio-input:focus ~ .radio-input-label__icon {
267
+ background-color: var(--radio-focus-icon-color);
268
+ }
269
+ .radio-input:checked ~ .radio-input-label__icon::after {
270
+ display: block;
271
+ background-color: white;
272
+ }
273
+
274
+ .radio-input-label__icon {
275
+ position: relative;
276
+ display: block;
277
+ width: 20px;
278
+ height: 20px;
279
+ flex: 0 0 20px;
280
+ box-sizing: border-box;
281
+ border: 1px solid var(--radio-border-color);
282
+ border-radius: 50%;
283
+ transition: background-color 0.2s ease-in-out;
284
+ }
285
+ .radio-input-label__icon::after {
286
+ position: absolute;
287
+ top: 50%;
288
+ left: 50%;
289
+ display: none;
290
+ width: 6px;
291
+ height: 6px;
292
+ background-color: var(--radio-focus-icon-color);
293
+ border-radius: 50%;
294
+ content: "";
295
+ transform: translate(-50%, -50%);
296
+ }
297
+ .password-input {
298
+ position: relative;
299
+ }
300
+ .password-input .input-container__right-icon {
301
+ position: absolute;
302
+ top: 0;
303
+ right: 0;
304
+ height: 48px;
305
+ }
306
+
307
+ .password-input__icon--is-visible {
308
+ display: inline-block;
309
+ }
310
+ .textarea-container {
311
+ --textarea-height: 72px;
312
+ display: flex;
313
+ align-items: center;
314
+ width: 100%;
315
+ }
316
+
317
+ .textarea {
318
+ min-height: var(--textarea-height);
319
+ flex: 1;
320
+ padding: 0 14px;
321
+ color: var(--text-color);
322
+ border: 1px solid var(--default-border-color);
323
+ border-radius: var(--small-radius-size);
324
+ resize: none;
325
+ line-height: 24px;
326
+ }
327
+ .textarea::placeholder {
328
+ color: var(--text-color);
329
+ }
330
+ .textarea:focus {
331
+ background-color: transparent;
332
+ outline: none;
333
+ }
334
+ .textarea--has-error {
335
+ color: var(--invalid-text-color);
336
+ border: 1px solid var(--invalid-text-color);
337
+ }
338
+ .description-term__title {
339
+ font-weight: 600;
340
+ }
341
+
342
+ .description-term__description {
343
+ margin: 0;
344
+ padding: 4px 0 8px;
345
+ }
346
+ .progress-bar {
347
+ position: relative;
348
+ width: 100%;
349
+ min-height: 4px;
350
+ overflow: hidden;
351
+ border-radius: 8px;
352
+ }
353
+ .progress-bar__track {
354
+ position: absolute;
355
+ left: 0;
356
+ height: 100%;
357
+ }
358
+ .progress-bar__content {
359
+ position: relative;
360
+ width: max-content;
361
+ height: 100%;
362
+ margin: auto;
363
+ color: black;
364
+ }
365
+ .select {
366
+ position: relative;
367
+ width: max-content;
368
+ }
369
+ .select--is-open .select-trigger {
370
+ border-color: var(--disabled-text-color);
371
+ }
372
+ .select-content {
373
+ position: absolute;
374
+ z-index: 1;
375
+ width: max-content;
376
+ min-width: 100%;
377
+ margin-top: 15px;
378
+ padding: 6px 0;
379
+ background-color: white;
380
+ /* stylelint-disable-next-line color-no-hex */
381
+ border: 1px solid #dfe3ef;
382
+ border-radius: 6px;
383
+ opacity: 0;
384
+ transition: opacity 0.25s ease;
385
+ }
386
+ .select-content--is-visible {
387
+ opacity: 1;
388
+ }
389
+ .select-content .list {
390
+ margin: unset;
391
+ }
392
+ .select-item {
393
+ display: flex;
394
+ align-items: center;
395
+ justify-content: space-between;
396
+ padding: 8px 16px;
397
+ outline: none;
398
+ cursor: pointer;
399
+ }
400
+ .select-item--is-focused, .select-item:hover {
401
+ color: white;
402
+ /* stylelint-disable-next-line color-no-hex */
403
+ background-color: #3687ff;
404
+ }
405
+ .select-item--is-selected.select-item--is-focused, .select-item--is-selected:hover {
406
+ color: black;
407
+ background-color: white;
408
+ }
409
+ .select-item--is-selected .check-icon path {
410
+ fill: black;
411
+ }
412
+ .select-item--is-disabled {
413
+ color: var(--disabled-text-color);
414
+ cursor: not-allowed;
415
+ }
416
+ .select-item--is-disabled.select-item--is-focused, .select-item--is-disabled:hover {
417
+ color: var(--disabled-text-color);
418
+ background-color: white;
419
+ }
420
+ .select-trigger {
421
+ --select-trigger-height: 48px;
422
+ --select-trigger-bg: white;
423
+ --select-trigger-color: black;
424
+ --select-trigger-border-radius: 6px;
425
+ --button-bg: var(--select-trigger-bg);
426
+ --button-height: auto;
427
+ --button-color: var(--select-trigger-color);
428
+ display: flex;
429
+ align-items: center;
430
+ justify-content: flex-start;
431
+ min-height: var(--select-trigger-height);
432
+ padding: 16px;
433
+ /* stylelint-disable-next-line color-no-hex */
434
+ border: 1px solid #dfe3ef;
435
+ border-radius: var(--select-trigger-border-radius);
436
+ }
437
+ .select-trigger:focus, .select-trigger:focus-within {
438
+ /* stylelint-disable-next-line color-no-hex */
439
+ border: 1px solid #6c6e76;
440
+ }
441
+ .typeahead-select-trigger {
442
+ display: flex;
443
+ flex-wrap: wrap;
444
+ align-items: center;
445
+ justify-content: flex-start;
446
+ width: 100%;
447
+ padding: 0;
448
+ border: 1px solid var(--default-border-color);
449
+ border-radius: var(--small-border-radius);
450
+ }
451
+
452
+ .typeahead-select-trigger__tag-list {
453
+ list-style-type: none;
454
+ position: relative;
455
+ display: flex;
456
+ flex-wrap: wrap;
457
+ width: 100%;
458
+ margin: 8px;
459
+ padding: 0;
460
+ }
461
+
462
+ .typeahead-select-trigger__tag-list__item {
463
+ margin: 8px 0 0 8px;
464
+ }
465
+ .tag {
466
+ /* stylelint-disable color-no-hex */
467
+ --tag-bg: #ebebeb;
468
+ /* stylelint-enable color-no-hex */
469
+ display: flex;
470
+ align-items: center;
471
+ width: auto;
472
+ min-width: 0;
473
+ height: 100%;
474
+ padding: 3px 10px;
475
+ color: var(--text-color);
476
+ background-color: var(--tag-bg);
477
+ border: none;
478
+ border-radius: var(--small-border-radius);
479
+ }
480
+
481
+ .tag--is-removable {
482
+ cursor: pointer;
483
+ }
484
+ .tag--is-removable:hover path {
485
+ stroke: var(--text-color);
486
+ }
487
+
488
+ .tag__close-icon {
489
+ width: 16px;
490
+ height: 16px;
491
+ flex: 0 0 16px;
492
+ margin-left: 10px;
493
+ }
494
+ .tag__close-icon path {
495
+ transition: stroke 0.4s ease-in-out;
496
+ }
497
+
498
+ .tag__body {
499
+ display: inline-block;
500
+ max-width: calc(100% - 16px);
501
+ overflow: hidden;
502
+ vertical-align: top;
503
+ white-space: nowrap;
504
+ text-overflow: ellipsis;
505
+ overflow: hidden;
506
+ }
507
+ .typeahead-select {
508
+ width: 100%;
509
+ }
510
+
511
+ .typeahead-select__header-container {
512
+ display: flex;
513
+ flex-wrap: wrap;
514
+ align-items: center;
515
+ justify-content: flex-start;
516
+ border: 1px solid var(--default-border-color);
517
+ border-radius: var(--small-border-radius);
518
+ }
519
+
520
+ .typeahead-select--can-select-multiple .input {
521
+ height: auto;
522
+ min-height: 45px;
523
+ flex: 1;
524
+ border: none;
525
+ }
526
+ .typeahead-select--can-select-multiple .input:focus {
527
+ border: none;
528
+ }
529
+
530
+ .typeahead-select.select--is-open .typeahead-select__input {
531
+ position: relative;
532
+ }
533
+
534
+ .typeahead-select__input {
535
+ width: unset;
536
+ flex: auto;
537
+ }
538
+ .typeahead-select__input .input {
539
+ padding-left: 8px;
540
+ }
541
+ .switch {
542
+ --switch-controller-bg: lightgreen;
543
+ --switch-active-slider-bg: white;
544
+ --switch-inactive-slider-bg: darkgrey;
545
+ position: relative;
546
+ display: inline-block;
547
+ width: 60px;
548
+ height: 34px;
549
+ }
550
+ .switch--is-disabled {
551
+ cursor: not-allowed;
552
+ }
553
+ .switch--is-disabled .switch__slider {
554
+ pointer-events: none;
555
+ }
556
+
557
+ .switch__controller {
558
+ width: 0;
559
+ height: 0;
560
+ opacity: 0;
561
+ }
562
+ .switch__controller:checked + .switch__slider {
563
+ background-color: var(--switch-controller-bg);
564
+ }
565
+ .switch__controller:focus + .switch__slider {
566
+ box-shadow: 0 0 1px var(--switch-controller-bg);
567
+ }
568
+ .switch__controller:checked + .switch__slider::before {
569
+ transform: translateX(26px);
570
+ }
571
+
572
+ .switch__slider {
573
+ position: absolute;
574
+ top: 0;
575
+ bottom: 0;
576
+ left: 0;
577
+ right: 0;
578
+ background-color: var(--switch-inactive-slider-bg);
579
+ border-radius: 34px;
580
+ cursor: pointer;
581
+ transition: 0.4s;
582
+ }
583
+ .switch__slider::before {
584
+ position: absolute;
585
+ bottom: 4px;
586
+ left: 4px;
587
+ width: 26px;
588
+ height: 26px;
589
+ background-color: var(--switch-active-slider-bg);
590
+ border-radius: 50%;
591
+ content: "";
592
+ transition: 0.4s;
593
+ }
594
+ .tab__header {
595
+ display: flex;
596
+ }
597
+ .tab-header-item {
598
+ --active-color: 50, 50, 211;
599
+ --disabled-color: 150, 150, 150;
600
+ }
601
+ .tab-header-item:not(:first-of-type) {
602
+ margin-left: 48px;
603
+ }
604
+ .tab-header-item .list-item__click-wrapper {
605
+ outline: none;
606
+ }
607
+ .tab-header-item .list-item__click-wrapper:focus {
608
+ color: rgba(var(--active-color), 0.7);
609
+ }
610
+
611
+ .tab-header-item--is-active {
612
+ color: rgba(var(--active-color), 1);
613
+ }
614
+ .tab-header-item--is-active .list-item__click-wrapper:focus {
615
+ color: rgba(var(--active-color), 1);
616
+ }
617
+
618
+ .tab-header-item--is-disabled {
619
+ color: rgba(var(--disabled-color), 1);
620
+ }
621
+ .tab-header-item--is-disabled .list-item__click-wrapper:hover {
622
+ cursor: not-allowed;
623
+ }
624
+ .tab-header-item--is-disabled .list-item__click-wrapper:focus {
625
+ color: rgba(var(--disabled-color), 1);
626
+ }
627
+ .toast-close-button {
628
+ position: relative;
629
+ z-index: 1;
630
+ }
631
+ #toast-root {
632
+ position: fixed;
633
+ bottom: 0;
634
+ right: 0;
635
+ z-index: 2;
636
+ }
637
+
638
+ .toast-stack {
639
+ width: 300px;
640
+ max-height: 100vh;
641
+ overflow: auto;
642
+ padding: 24px;
643
+ }
644
+ .toggle {
645
+ --toggle-border-color: gray;
646
+ display: grid;
647
+ overflow: hidden;
648
+ padding: 0;
649
+ border: 1px solid var(--toggle-border-color);
650
+ border-radius: 8px;
651
+ }
652
+ .toggle--is-vertical {
653
+ grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
654
+ width: max-content;
655
+ }
656
+ .toggle--is-horizontal {
657
+ grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
658
+ min-height: 32px;
659
+ }
660
+ .toggle--is-disabled {
661
+ cursor: not-allowed;
662
+ }
663
+ .toggle--is-disabled .toggle-item {
664
+ pointer-events: none;
665
+ }
666
+ .toggle-item {
667
+ --toggle-active-bg: white;
668
+ --toggle-active-color: darkgray;
669
+ --toggle-inactive-bg: black;
670
+ --toggle-inactive-color: white;
671
+ --toggle-disabled-bg: gray;
672
+ --toggle-disabled-color: white;
673
+ list-style-type: none;
674
+ color: var(--toggle-inactive-color);
675
+ background-color: var(--toggle-inactive-bg);
676
+ }
677
+ .toggle-item--is-selected {
678
+ color: var(--toggle-active-color);
679
+ background-color: var(--toggle-active-bg);
680
+ }
681
+ .toggle-item--is-disabled {
682
+ display: flex;
683
+ align-items: center;
684
+ justify-content: center;
685
+ color: var(--toggle-disabled-color);
686
+ background-color: var(--toggle-disabled-bg);
687
+ cursor: not-allowed;
688
+ }
689
+ .toggle-item--is-disabled * {
690
+ pointer-events: none;
691
+ }
692
+ .toggle-item__label {
693
+ display: flex;
694
+ align-items: center;
695
+ justify-content: center;
696
+ width: 100%;
697
+ height: 100%;
698
+ cursor: pointer;
699
+ }
700
+
701
+ .toggle-input {
702
+ display: none;
703
+ }
@@ -0,0 +1 @@
1
+ "use strict";const e=["0","1","2","3","4","5","6","7","8","9"],t="undefined"!=typeof navigator?navigator.language:"en-GB";function n(){return void 0!==new Intl.NumberFormat&&void 0!==(new Intl.NumberFormat).formatToParts}function r(e){const{locale:n,...r}=e,o={style:"decimal",...r};let a;try{a=new Intl.NumberFormat(n||[t,"en-GB"],o)}catch{a={format:e=>e.toLocaleString(n)}}return e=>{let t="";return Object.is(e,NaN)||(t=a.format(e)),t}}function o(e=t){let r=",",o=".",a="-";if(n()){const t=new Intl.NumberFormat(e).formatToParts(-12345.6);r=t.find(e=>"group"===e.type).value,o=t.find(e=>"decimal"===e.type).value,a=t.find(e=>"minusSign"===e.type).value}return{THOUSANDTHS_SEPARATOR:r,DECIMAL_NUMBER_SEPARATOR:o,MINUS_SIGN:a}}function a(r=t){let o=e;return n()&&(o=new Intl.NumberFormat(r,{useGrouping:!1}).format(9876543210).split("").reverse()),o}function i(e=t){const n=a(e)[0],r=o(e).MINUS_SIGN;return{LOCALE_NEGATIVE_ZERO:`${r}${n}`,LOCALE_NEGATIVE_DOUBLE_ZERO:`${r}${n}${n}`,DEFAULT_NEGATIVE_ZERO:"-0",DEFAULT_NEGATIVE_DOUBLE_ZERO:"-00"}}exports.formatNumber=r,exports.getNegativeZero=i,exports.getNumberSeparators=o,exports.getThousandthSeparatorCount=function(e){return r({locale:"en"})(parseFloat(e)).match(/,/g)?.length||0},exports.isIntlAPISupported=n,exports.isNonNegativeNumber=function(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0},exports.mapDigitsToLocalVersion=function({locale:e=t},n){return n.split("").map(function({locale:e=t}){const n=a(e),r=new Map(n.map((e,t)=>[t,e]));return e=>r.get(parseInt(e))}({locale:e})).join("")},exports.parseNumber=function(e,n){const{locale:r=t,maximumFractionDigits:i=0}=e,{THOUSANDTHS_SEPARATOR:l,DECIMAL_NUMBER_SEPARATOR:u}=o(r),s=a(r),E=new RegExp(`[${s.join("")}]`,"g"),p=(c=new Map(s.map((e,t)=>[e,t])),e=>{const t=c.get(e);return"number"==typeof t?String(t):""});var c;let m=n.replace(" ","").replace(new RegExp(`[${l}]`,"g"),"").replace(new RegExp(`[${u}]`),".").replace(E,p);if("number"==typeof i){const[e,t]=m.split(".");if(0===i)m=e;else if(t&&t.length===i+1)return m.slice(0,m.length-1)}else m=String(m);return m},exports.removeLeadingZeros=function(e=t,n){const{LOCALE_NEGATIVE_ZERO:r,LOCALE_NEGATIVE_DOUBLE_ZERO:a,DEFAULT_NEGATIVE_ZERO:l,DEFAULT_NEGATIVE_DOUBLE_ZERO:u}=i(e),s=o(e).MINUS_SIGN,E=n.split(".")[1];let p,c=n.split(".")[0];return c!==a&&c!==u||(c=l),c&&c.length!==String(parseInt(c)).length&&c!==s&&c!==r&&c!==l&&(c=String(parseInt(c))),p=n.match(/\.$/)?.length||E?`${c}.${E}`:c,p};
@@ -0,0 +1,20 @@
1
+ import "./_progress-bar.scss";
2
+ import type React from "react";
3
+ export interface ProgressBarProps {
4
+ percentage: number;
5
+ style?: {
6
+ trackColor?: string;
7
+ backgroundColor?: string;
8
+ completedColor?: string;
9
+ };
10
+ ariaLabelledBy?: string;
11
+ ariaLabel?: string;
12
+ ariaValueText?: string;
13
+ ariaDescribedBy?: string;
14
+ title?: string;
15
+ children?: React.ReactNode;
16
+ customClassName?: string;
17
+ testid?: string;
18
+ }
19
+ declare function ProgressBar(props: ProgressBarProps): React.JSX.Element;
20
+ export default ProgressBar;