draft-components 3.1.0 → 3.2.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.
- package/css/draft-components-utilities.css +32 -8
- package/css/draft-components.css +3 -31
- package/dist/components/alert/alert.css +0 -1
- package/dist/components/button/button.css +0 -5
- package/dist/components/checkbox/checkbox.css +0 -1
- package/dist/components/color-picker/color-picker.css +0 -1
- package/dist/components/date-picker/date-picker.css +0 -4
- package/dist/components/filter-buttons/filter-buttons.css +0 -1
- package/dist/components/filtered-search/filter-token.css +0 -1
- package/dist/components/filtered-search/filtered-search.css +0 -2
- package/dist/components/menu/menu.css +0 -4
- package/dist/components/password-input/password-input.css +0 -1
- package/dist/components/radio/radio.css +0 -1
- package/dist/components/segmented-control/segmented-control.css +1 -2
- package/dist/components/select/select.css +1 -2
- package/dist/components/switch/switch.css +0 -1
- package/dist/components/table/table.css +0 -1
- package/dist/components/tabs/tabs.css +0 -1
- package/dist/components/text-input/text-input.css +1 -1
- package/dist/components/text-input/text-input.js +17 -3
- package/dist/components/toast/toast.css +0 -2
- package/package.json +1 -1
|
@@ -252,12 +252,36 @@
|
|
|
252
252
|
flex-wrap: wrap-reverse !important;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
.justify-items-start {
|
|
256
|
+
justify-items: start !important;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.justify-items-end {
|
|
260
|
+
justify-items: end !important;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.justify-items-center {
|
|
264
|
+
justify-items: center !important;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.justify-items-between {
|
|
268
|
+
justify-items: space-between !important;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.justify-items-around {
|
|
272
|
+
justify-items: space-around !important;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.justify-items-evenly {
|
|
276
|
+
justify-items: space-evenly !important;
|
|
277
|
+
}
|
|
278
|
+
|
|
255
279
|
.justify-content-start {
|
|
256
|
-
justify-content:
|
|
280
|
+
justify-content: start !important;
|
|
257
281
|
}
|
|
258
282
|
|
|
259
283
|
.justify-content-end {
|
|
260
|
-
justify-content:
|
|
284
|
+
justify-content: end !important;
|
|
261
285
|
}
|
|
262
286
|
|
|
263
287
|
.justify-content-center {
|
|
@@ -277,11 +301,11 @@
|
|
|
277
301
|
}
|
|
278
302
|
|
|
279
303
|
.align-items-start {
|
|
280
|
-
align-items:
|
|
304
|
+
align-items: start !important;
|
|
281
305
|
}
|
|
282
306
|
|
|
283
307
|
.align-items-end {
|
|
284
|
-
align-items:
|
|
308
|
+
align-items: end !important;
|
|
285
309
|
}
|
|
286
310
|
|
|
287
311
|
.align-items-center {
|
|
@@ -297,11 +321,11 @@
|
|
|
297
321
|
}
|
|
298
322
|
|
|
299
323
|
.align-content-start {
|
|
300
|
-
align-content:
|
|
324
|
+
align-content: start !important;
|
|
301
325
|
}
|
|
302
326
|
|
|
303
327
|
.align-content-end {
|
|
304
|
-
align-content:
|
|
328
|
+
align-content: end !important;
|
|
305
329
|
}
|
|
306
330
|
|
|
307
331
|
.align-content-center {
|
|
@@ -325,11 +349,11 @@
|
|
|
325
349
|
}
|
|
326
350
|
|
|
327
351
|
.align-self-start {
|
|
328
|
-
align-self:
|
|
352
|
+
align-self: start !important;
|
|
329
353
|
}
|
|
330
354
|
|
|
331
355
|
.align-self-end {
|
|
332
|
-
align-self:
|
|
356
|
+
align-self: end !important;
|
|
333
357
|
}
|
|
334
358
|
|
|
335
359
|
.align-self-center {
|
package/css/draft-components.css
CHANGED
|
@@ -1025,7 +1025,6 @@
|
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
1027
|
.dc-button:hover:not(:disabled) {
|
|
1028
|
-
cursor: pointer;
|
|
1029
1028
|
background: var(--dc-button-bg-hover);
|
|
1030
1029
|
}
|
|
1031
1030
|
|
|
@@ -1035,10 +1034,6 @@
|
|
|
1035
1034
|
grid-template-columns: repeat(2, auto);
|
|
1036
1035
|
}
|
|
1037
1036
|
|
|
1038
|
-
.dc-button_loading {
|
|
1039
|
-
cursor: default;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
1037
|
.dc-button_loading:disabled {
|
|
1043
1038
|
opacity: initial;
|
|
1044
1039
|
}
|
|
@@ -1702,7 +1697,7 @@
|
|
|
1702
1697
|
border-bottom-right-radius: calc(var(--dc-input-border-radius) - 1px);
|
|
1703
1698
|
}
|
|
1704
1699
|
|
|
1705
|
-
.dc-text-
|
|
1700
|
+
.dc-text-input_focused {
|
|
1706
1701
|
border-color: var(--dc-input-focus-ring-color);
|
|
1707
1702
|
box-shadow: 0 0 0 1px var(--dc-input-focus-ring-color);
|
|
1708
1703
|
}
|
|
@@ -1843,7 +1838,6 @@
|
|
|
1843
1838
|
.dc-password-input__toggle-button:not(:disabled):focus,
|
|
1844
1839
|
.dc-password-input__toggle-button:not(:disabled):hover {
|
|
1845
1840
|
color: var(--dc-password-input-toggle-color-hover);
|
|
1846
|
-
cursor: pointer;
|
|
1847
1841
|
background: var(--dc-password-input-toggle-bg-hover);
|
|
1848
1842
|
outline: none;
|
|
1849
1843
|
}
|
|
@@ -2008,6 +2002,7 @@
|
|
|
2008
2002
|
}
|
|
2009
2003
|
|
|
2010
2004
|
.dc-select__native {
|
|
2005
|
+
flex-grow: 1;
|
|
2011
2006
|
max-width: 100%;
|
|
2012
2007
|
padding-right: calc(var(--dc-select-height) + 0.5em);
|
|
2013
2008
|
padding-left: var(--dc-select-padding-x);
|
|
@@ -2017,7 +2012,6 @@
|
|
|
2017
2012
|
-webkit-appearance: none;
|
|
2018
2013
|
-moz-appearance: none;
|
|
2019
2014
|
appearance: none;
|
|
2020
|
-
cursor: pointer;
|
|
2021
2015
|
background: none;
|
|
2022
2016
|
border: none;
|
|
2023
2017
|
}
|
|
@@ -2027,7 +2021,6 @@
|
|
|
2027
2021
|
}
|
|
2028
2022
|
|
|
2029
2023
|
.dc-select__native:disabled {
|
|
2030
|
-
cursor: default;
|
|
2031
2024
|
opacity: 1;
|
|
2032
2025
|
}
|
|
2033
2026
|
|
|
@@ -2110,7 +2103,6 @@
|
|
|
2110
2103
|
width: 100%;
|
|
2111
2104
|
height: 100%;
|
|
2112
2105
|
vertical-align: middle;
|
|
2113
|
-
cursor: pointer;
|
|
2114
2106
|
background: var(--dc-switch-track-bg);
|
|
2115
2107
|
border-radius: var(--dc-switch-radius);
|
|
2116
2108
|
transition-duration: 0.2s;
|
|
@@ -2228,7 +2220,6 @@
|
|
|
2228
2220
|
width: 100%;
|
|
2229
2221
|
height: 100%;
|
|
2230
2222
|
vertical-align: middle;
|
|
2231
|
-
cursor: pointer;
|
|
2232
2223
|
background: var(--dc-checkbox-bg);
|
|
2233
2224
|
border: 1px solid var(--dc-checkbox-border-color);
|
|
2234
2225
|
border-radius: var(--dc-checkbox-radius);
|
|
@@ -2317,7 +2308,6 @@
|
|
|
2317
2308
|
width: var(--dc-radio-size);
|
|
2318
2309
|
height: var(--dc-radio-size);
|
|
2319
2310
|
vertical-align: middle;
|
|
2320
|
-
cursor: pointer;
|
|
2321
2311
|
background: var(--dc-radio-color-bg);
|
|
2322
2312
|
border: 1px solid var(--dc-radio-color-border);
|
|
2323
2313
|
border-radius: 50%;
|
|
@@ -2806,10 +2796,6 @@
|
|
|
2806
2796
|
background: var(--dc-day-bg-selected);
|
|
2807
2797
|
}
|
|
2808
2798
|
|
|
2809
|
-
.dc-calendar-day:hover {
|
|
2810
|
-
cursor: pointer;
|
|
2811
|
-
}
|
|
2812
|
-
|
|
2813
2799
|
.dc-calendar-day:hover > .dc-calendar-day__body {
|
|
2814
2800
|
box-shadow: inset 0 0 0 2px var(--dc-day-border-color-hover);
|
|
2815
2801
|
}
|
|
@@ -2957,7 +2943,7 @@
|
|
|
2957
2943
|
}
|
|
2958
2944
|
|
|
2959
2945
|
.dc-segmented__item + .dc-segmented__item::before {
|
|
2960
|
-
display:
|
|
2946
|
+
display: block;
|
|
2961
2947
|
float: left;
|
|
2962
2948
|
width: 1px;
|
|
2963
2949
|
height: calc(var(--dc-segmented-button-height) - var(--dc-segmented-button-radius) * 2);
|
|
@@ -2986,7 +2972,6 @@
|
|
|
2986
2972
|
-webkit-appearance: none;
|
|
2987
2973
|
-moz-appearance: none;
|
|
2988
2974
|
appearance: none;
|
|
2989
|
-
cursor: pointer;
|
|
2990
2975
|
-webkit-user-select: none;
|
|
2991
2976
|
-moz-user-select: none;
|
|
2992
2977
|
user-select: none;
|
|
@@ -3174,7 +3159,6 @@
|
|
|
3174
3159
|
height: var(--dc-color-picker-btn-size);
|
|
3175
3160
|
font-size: 0;
|
|
3176
3161
|
color: transparent;
|
|
3177
|
-
cursor: pointer;
|
|
3178
3162
|
background: var(--dc-color-picker-btn-color);
|
|
3179
3163
|
border-radius: 50%;
|
|
3180
3164
|
box-shadow: inset 0 0 0 1px var(--dc-color-picker-btn-inner-border-color);
|
|
@@ -3420,7 +3404,6 @@
|
|
|
3420
3404
|
-webkit-appearance: none;
|
|
3421
3405
|
-moz-appearance: none;
|
|
3422
3406
|
appearance: none;
|
|
3423
|
-
cursor: pointer;
|
|
3424
3407
|
background: transparent;
|
|
3425
3408
|
border: none;
|
|
3426
3409
|
}
|
|
@@ -3551,7 +3534,6 @@
|
|
|
3551
3534
|
-webkit-appearance: none;
|
|
3552
3535
|
-moz-appearance: none;
|
|
3553
3536
|
appearance: none;
|
|
3554
|
-
cursor: pointer;
|
|
3555
3537
|
background: none;
|
|
3556
3538
|
border: none;
|
|
3557
3539
|
border-radius: 4px;
|
|
@@ -3698,7 +3680,6 @@
|
|
|
3698
3680
|
-moz-appearance: none;
|
|
3699
3681
|
appearance: none;
|
|
3700
3682
|
pointer-events: none;
|
|
3701
|
-
cursor: pointer;
|
|
3702
3683
|
background: var(--dc-toast-close-btn-bg);
|
|
3703
3684
|
border: none;
|
|
3704
3685
|
border-radius: 50%;
|
|
@@ -3722,7 +3703,6 @@
|
|
|
3722
3703
|
-webkit-appearance: none;
|
|
3723
3704
|
-moz-appearance: none;
|
|
3724
3705
|
appearance: none;
|
|
3725
|
-
cursor: pointer;
|
|
3726
3706
|
background: var(--dc-toast-btn-bg);
|
|
3727
3707
|
border: none;
|
|
3728
3708
|
border-radius: 6px;
|
|
@@ -3983,7 +3963,6 @@
|
|
|
3983
3963
|
-webkit-appearance: none;
|
|
3984
3964
|
-moz-appearance: none;
|
|
3985
3965
|
appearance: none;
|
|
3986
|
-
cursor: pointer;
|
|
3987
3966
|
background: none;
|
|
3988
3967
|
border: none;
|
|
3989
3968
|
}
|
|
@@ -4107,10 +4086,6 @@
|
|
|
4107
4086
|
border-radius: 6px;
|
|
4108
4087
|
}
|
|
4109
4088
|
|
|
4110
|
-
.dc-menu-btn:hover {
|
|
4111
|
-
cursor: pointer;
|
|
4112
|
-
}
|
|
4113
|
-
|
|
4114
4089
|
.dc-menu-btn:focus {
|
|
4115
4090
|
background: var(--dc-menu-item-bg);
|
|
4116
4091
|
outline: none;
|
|
@@ -4339,7 +4314,6 @@
|
|
|
4339
4314
|
font: var(--dc-text-sm);
|
|
4340
4315
|
color: var(--dc-filter-button-text-color);
|
|
4341
4316
|
white-space: nowrap;
|
|
4342
|
-
cursor: pointer;
|
|
4343
4317
|
-webkit-user-select: none;
|
|
4344
4318
|
-moz-user-select: none;
|
|
4345
4319
|
user-select: none;
|
|
@@ -4393,7 +4367,6 @@
|
|
|
4393
4367
|
padding: 0;
|
|
4394
4368
|
font-size: 14px;
|
|
4395
4369
|
color: inherit;
|
|
4396
|
-
cursor: pointer;
|
|
4397
4370
|
background: none;
|
|
4398
4371
|
border: none;
|
|
4399
4372
|
}
|
|
@@ -4636,7 +4609,6 @@
|
|
|
4636
4609
|
box-sizing: border-box;
|
|
4637
4610
|
padding: 6px 8px;
|
|
4638
4611
|
color: var(--dc-filtered-search-option-color);
|
|
4639
|
-
cursor: pointer;
|
|
4640
4612
|
border-radius: 5px;
|
|
4641
4613
|
}
|
|
4642
4614
|
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.dc-button:hover:not(:disabled) {
|
|
76
|
-
cursor: pointer;
|
|
77
76
|
background: var(--dc-button-bg-hover);
|
|
78
77
|
}
|
|
79
78
|
|
|
@@ -83,10 +82,6 @@
|
|
|
83
82
|
grid-template-columns: repeat(2, auto);
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
.dc-button_loading {
|
|
87
|
-
cursor: default;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
85
|
.dc-button_loading:disabled {
|
|
91
86
|
opacity: initial;
|
|
92
87
|
}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
padding: 0;
|
|
20
20
|
font-size: 14px;
|
|
21
21
|
color: inherit;
|
|
22
|
-
cursor: pointer;
|
|
23
22
|
background: none;
|
|
24
23
|
border: none;
|
|
25
24
|
}
|
|
@@ -262,7 +261,6 @@
|
|
|
262
261
|
box-sizing: border-box;
|
|
263
262
|
padding: 6px 8px;
|
|
264
263
|
color: var(--dc-filtered-search-option-color);
|
|
265
|
-
cursor: pointer;
|
|
266
264
|
border-radius: 5px;
|
|
267
265
|
}
|
|
268
266
|
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
.dc-password-input__toggle-button:not(:disabled):focus,
|
|
34
34
|
.dc-password-input__toggle-button:not(:disabled):hover {
|
|
35
35
|
color: var(--dc-password-input-toggle-color-hover);
|
|
36
|
-
cursor: pointer;
|
|
37
36
|
background: var(--dc-password-input-toggle-bg-hover);
|
|
38
37
|
outline: none;
|
|
39
38
|
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.dc-segmented__item + .dc-segmented__item::before {
|
|
50
|
-
display:
|
|
50
|
+
display: block;
|
|
51
51
|
float: left;
|
|
52
52
|
width: 1px;
|
|
53
53
|
height: calc(var(--dc-segmented-button-height) - var(--dc-segmented-button-radius) * 2);
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
-webkit-appearance: none;
|
|
77
77
|
-moz-appearance: none;
|
|
78
78
|
appearance: none;
|
|
79
|
-
cursor: pointer;
|
|
80
79
|
-webkit-user-select: none;
|
|
81
80
|
-moz-user-select: none;
|
|
82
81
|
user-select: none;
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.dc-select__native {
|
|
68
|
+
flex-grow: 1;
|
|
68
69
|
max-width: 100%;
|
|
69
70
|
padding-right: calc(var(--dc-select-height) + 0.5em);
|
|
70
71
|
padding-left: var(--dc-select-padding-x);
|
|
@@ -74,7 +75,6 @@
|
|
|
74
75
|
-webkit-appearance: none;
|
|
75
76
|
-moz-appearance: none;
|
|
76
77
|
appearance: none;
|
|
77
|
-
cursor: pointer;
|
|
78
78
|
background: none;
|
|
79
79
|
border: none;
|
|
80
80
|
}
|
|
@@ -84,7 +84,6 @@
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
.dc-select__native:disabled {
|
|
87
|
-
cursor: default;
|
|
88
87
|
opacity: 1;
|
|
89
88
|
}
|
|
90
89
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useState } from 'react';
|
|
3
3
|
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
export const TextInput = forwardRef(function TextInput({ style, className, fullWidth, size = 'md', sizeInChars, slotStyle = 'plain', slotLeft, slotRight, type = 'text', invalid, disabled, onChange, onChangeValue, ...props }, ref) {
|
|
4
|
+
export const TextInput = forwardRef(function TextInput({ style, className, fullWidth, size = 'md', sizeInChars, slotStyle = 'plain', slotLeft, slotRight, type = 'text', invalid, disabled, onChange, onFocus, onBlur, onChangeValue, ...props }, ref) {
|
|
5
|
+
const [focused, setFocused] = useState(false);
|
|
5
6
|
let elementBeforeInput;
|
|
6
7
|
if (slotLeft) {
|
|
7
8
|
const className = 'dc-text-input__slot-left';
|
|
@@ -30,13 +31,26 @@ export const TextInput = forwardRef(function TextInput({ style, className, fullW
|
|
|
30
31
|
onChangeValue(event.target.value);
|
|
31
32
|
}
|
|
32
33
|
};
|
|
34
|
+
const handleFocus = (event) => {
|
|
35
|
+
setFocused(true);
|
|
36
|
+
if (typeof onFocus === 'function') {
|
|
37
|
+
onFocus(event);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const handleBlur = (event) => {
|
|
41
|
+
setFocused(false);
|
|
42
|
+
if (typeof onBlur === 'function') {
|
|
43
|
+
onBlur(event);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
33
46
|
return (_jsxs("div", { style: style, className: classNames(className, 'dc-text-input', {
|
|
34
47
|
[`dc-text-input_${size}`]: size,
|
|
35
48
|
[`dc-text-input_slot_${slotStyle}`]: slotStyle,
|
|
36
49
|
'dc-text-input_full-width': fullWidth,
|
|
37
50
|
'dc-text-input_invalid': invalid,
|
|
51
|
+
'dc-text-input_focused': focused,
|
|
38
52
|
'dc-text-input_disabled': disabled,
|
|
39
53
|
'dc-text-input_has_slot-left': elementBeforeInput,
|
|
40
54
|
'dc-text-input_has_slot-right': elementAfterInput,
|
|
41
|
-
}), children: [elementBeforeInput, _jsx("input", { ...props, className: "dc-text-input__native", ref: ref, type: type, size: sizeInChars, disabled: disabled, "aria-invalid": props['aria-invalid'] ?? invalid, onChange: handleChange }), elementAfterInput] }));
|
|
55
|
+
}), children: [elementBeforeInput, _jsx("input", { ...props, className: "dc-text-input__native", ref: ref, type: type, size: sizeInChars, disabled: disabled, "aria-invalid": props['aria-invalid'] ?? invalid, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur }), elementAfterInput] }));
|
|
42
56
|
});
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
-moz-appearance: none;
|
|
40
40
|
appearance: none;
|
|
41
41
|
pointer-events: none;
|
|
42
|
-
cursor: pointer;
|
|
43
42
|
background: var(--dc-toast-close-btn-bg);
|
|
44
43
|
border: none;
|
|
45
44
|
border-radius: 50%;
|
|
@@ -63,7 +62,6 @@
|
|
|
63
62
|
-webkit-appearance: none;
|
|
64
63
|
-moz-appearance: none;
|
|
65
64
|
appearance: none;
|
|
66
|
-
cursor: pointer;
|
|
67
65
|
background: var(--dc-toast-btn-bg);
|
|
68
66
|
border: none;
|
|
69
67
|
border-radius: 6px;
|