@charcoal-ui/react 3.8.0 → 3.9.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/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.story.d.ts +1 -0
- package/dist/components/Modal/index.story.d.ts.map +1 -1
- package/dist/components/Modal/useCustomModalOverlay.d.ts +12 -0
- package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -0
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/TextArea/index.d.ts.map +1 -1
- package/dist/components/TextField/TextField.story.d.ts +1 -0
- package/dist/components/TextField/TextField.story.d.ts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/index.cjs.js +1001 -2226
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +995 -2226
- package/dist/index.esm.js.map +1 -1
- package/package.json +7 -6
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +43 -15
- package/src/components/Checkbox/index.tsx +13 -5
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +3 -0
- package/src/components/IconButton/__snapshots__/index.story.storyshot +5 -0
- package/src/components/IconButton/index.tsx +4 -1
- package/src/components/Modal/__snapshots__/index.story.storyshot +926 -0
- package/src/components/Modal/index.story.tsx +23 -0
- package/src/components/Modal/index.tsx +15 -20
- package/src/components/Modal/useCustomModalOverlay.tsx +47 -0
- package/src/components/Radio/__snapshots__/index.story.storyshot +25 -5
- package/src/components/Radio/index.tsx +5 -1
- package/src/components/TextArea/index.tsx +22 -14
- package/src/components/TextField/TextField.story.tsx +20 -0
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +277 -0
- package/src/components/TextField/index.tsx +22 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"clean": "rimraf dist .tsbuildinfo"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
+
"@charcoal-ui/esbuild-plugin-styled-components": "^3.9.1",
|
|
21
22
|
"@react-types/switch": "^3.1.2",
|
|
22
23
|
"@storybook/addon-actions": "^7.4.1",
|
|
23
24
|
"@storybook/addon-knobs": "^7.0.2",
|
|
@@ -51,10 +52,10 @@
|
|
|
51
52
|
"typescript": "^4.9.5"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
|
-
"@charcoal-ui/icons": "^3.
|
|
55
|
-
"@charcoal-ui/styled": "^3.
|
|
56
|
-
"@charcoal-ui/theme": "^3.
|
|
57
|
-
"@charcoal-ui/utils": "^3.
|
|
55
|
+
"@charcoal-ui/icons": "^3.9.1",
|
|
56
|
+
"@charcoal-ui/styled": "^3.9.1",
|
|
57
|
+
"@charcoal-ui/theme": "^3.9.1",
|
|
58
|
+
"@charcoal-ui/utils": "^3.9.1",
|
|
58
59
|
"@react-aria/button": "^3.9.1",
|
|
59
60
|
"@react-aria/checkbox": "^3.13.0",
|
|
60
61
|
"@react-aria/dialog": "^3.5.10",
|
|
@@ -87,5 +88,5 @@
|
|
|
87
88
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
88
89
|
"directory": "packages/react"
|
|
89
90
|
},
|
|
90
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "baffe25b0a15aae2833ff35c07220a431076c954"
|
|
91
92
|
}
|
|
@@ -11,13 +11,9 @@ exports[`Storybook Tests Checkbox Invalid 1`] = `
|
|
|
11
11
|
gap: 4px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.c0:disabled,
|
|
15
|
-
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
16
|
-
cursor: default;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
14
|
.c0:disabled,
|
|
20
15
|
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
16
|
+
cursor: default;
|
|
21
17
|
opacity: 0.32;
|
|
22
18
|
}
|
|
23
19
|
|
|
@@ -39,6 +35,18 @@ exports[`Storybook Tests Checkbox Invalid 1`] = `
|
|
|
39
35
|
transition: 0.2s box-shadow,0.2s background-color;
|
|
40
36
|
}
|
|
41
37
|
|
|
38
|
+
.c2[type='checkbox']:disabled {
|
|
39
|
+
cursor: default;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.c2[type='checkbox']:-moz-read-only {
|
|
43
|
+
cursor: default;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.c2[type='checkbox']:read-only {
|
|
47
|
+
cursor: default;
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
.c2[type='checkbox']:checked {
|
|
43
51
|
background-color: var(--charcoal-brand);
|
|
44
52
|
}
|
|
@@ -140,6 +148,7 @@ exports[`Storybook Tests Checkbox Invalid 1`] = `
|
|
|
140
148
|
onTouchEnd={[Function]}
|
|
141
149
|
onTouchMove={[Function]}
|
|
142
150
|
onTouchStart={[Function]}
|
|
151
|
+
readOnly={false}
|
|
143
152
|
type="checkbox"
|
|
144
153
|
/>
|
|
145
154
|
<div
|
|
@@ -173,13 +182,9 @@ exports[`Storybook Tests Checkbox Labelled 1`] = `
|
|
|
173
182
|
gap: 4px;
|
|
174
183
|
}
|
|
175
184
|
|
|
176
|
-
.c0:disabled,
|
|
177
|
-
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
178
|
-
cursor: default;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
185
|
.c0:disabled,
|
|
182
186
|
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
187
|
+
cursor: default;
|
|
183
188
|
opacity: 0.32;
|
|
184
189
|
}
|
|
185
190
|
|
|
@@ -201,6 +206,18 @@ exports[`Storybook Tests Checkbox Labelled 1`] = `
|
|
|
201
206
|
transition: 0.2s box-shadow,0.2s background-color;
|
|
202
207
|
}
|
|
203
208
|
|
|
209
|
+
.c2[type='checkbox']:disabled {
|
|
210
|
+
cursor: default;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.c2[type='checkbox']:-moz-read-only {
|
|
214
|
+
cursor: default;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.c2[type='checkbox']:read-only {
|
|
218
|
+
cursor: default;
|
|
219
|
+
}
|
|
220
|
+
|
|
204
221
|
.c2[type='checkbox']:checked {
|
|
205
222
|
background-color: var(--charcoal-brand);
|
|
206
223
|
}
|
|
@@ -309,6 +326,7 @@ exports[`Storybook Tests Checkbox Labelled 1`] = `
|
|
|
309
326
|
onTouchEnd={[Function]}
|
|
310
327
|
onTouchMove={[Function]}
|
|
311
328
|
onTouchStart={[Function]}
|
|
329
|
+
readOnly={false}
|
|
312
330
|
type="checkbox"
|
|
313
331
|
/>
|
|
314
332
|
<div
|
|
@@ -357,6 +375,7 @@ exports[`Storybook Tests Checkbox Labelled 1`] = `
|
|
|
357
375
|
onTouchEnd={[Function]}
|
|
358
376
|
onTouchMove={[Function]}
|
|
359
377
|
onTouchStart={[Function]}
|
|
378
|
+
readOnly={false}
|
|
360
379
|
type="checkbox"
|
|
361
380
|
/>
|
|
362
381
|
<div
|
|
@@ -401,13 +420,9 @@ exports[`Storybook Tests Checkbox Unlabelled 1`] = `
|
|
|
401
420
|
gap: 4px;
|
|
402
421
|
}
|
|
403
422
|
|
|
404
|
-
.c0:disabled,
|
|
405
|
-
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
406
|
-
cursor: default;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
423
|
.c0:disabled,
|
|
410
424
|
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
425
|
+
cursor: default;
|
|
411
426
|
opacity: 0.32;
|
|
412
427
|
}
|
|
413
428
|
|
|
@@ -429,6 +444,18 @@ exports[`Storybook Tests Checkbox Unlabelled 1`] = `
|
|
|
429
444
|
transition: 0.2s box-shadow,0.2s background-color;
|
|
430
445
|
}
|
|
431
446
|
|
|
447
|
+
.c2[type='checkbox']:disabled {
|
|
448
|
+
cursor: default;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.c2[type='checkbox']:-moz-read-only {
|
|
452
|
+
cursor: default;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.c2[type='checkbox']:read-only {
|
|
456
|
+
cursor: default;
|
|
457
|
+
}
|
|
458
|
+
|
|
432
459
|
.c2[type='checkbox']:checked {
|
|
433
460
|
background-color: var(--charcoal-brand);
|
|
434
461
|
}
|
|
@@ -525,6 +552,7 @@ exports[`Storybook Tests Checkbox Unlabelled 1`] = `
|
|
|
525
552
|
onTouchEnd={[Function]}
|
|
526
553
|
onTouchMove={[Function]}
|
|
527
554
|
onTouchStart={[Function]}
|
|
555
|
+
readOnly={false}
|
|
528
556
|
type="checkbox"
|
|
529
557
|
/>
|
|
530
558
|
<div
|
|
@@ -4,7 +4,6 @@ import styled, { css } from 'styled-components'
|
|
|
4
4
|
import { useCheckbox } from '@react-aria/checkbox'
|
|
5
5
|
import { useObjectRef } from '@react-aria/utils'
|
|
6
6
|
import { useToggleState } from 'react-stately'
|
|
7
|
-
import { disabledSelector } from '@charcoal-ui/utils'
|
|
8
7
|
|
|
9
8
|
import type { AriaCheckboxProps } from '@react-types/checkbox'
|
|
10
9
|
import Icon from '../Icon'
|
|
@@ -59,7 +58,11 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
|
|
|
59
58
|
return (
|
|
60
59
|
<InputRoot aria-disabled={isDisabled} className={props.className}>
|
|
61
60
|
<CheckboxRoot>
|
|
62
|
-
<CheckboxInput
|
|
61
|
+
<CheckboxInput
|
|
62
|
+
type="checkbox"
|
|
63
|
+
{...inputProps}
|
|
64
|
+
readOnly={props.readonly}
|
|
65
|
+
/>
|
|
63
66
|
<CheckboxInputOverlay aria-hidden={true} checked={inputProps.checked}>
|
|
64
67
|
<Icon name="24/Check" unsafeNonGuidelineScale={2 / 3} />
|
|
65
68
|
</CheckboxInputOverlay>
|
|
@@ -82,13 +85,11 @@ const InputRoot = styled.label`
|
|
|
82
85
|
display: flex;
|
|
83
86
|
|
|
84
87
|
cursor: pointer;
|
|
85
|
-
${disabledSelector} {
|
|
86
|
-
cursor: default;
|
|
87
|
-
}
|
|
88
88
|
|
|
89
89
|
gap: 4px;
|
|
90
90
|
&:disabled,
|
|
91
91
|
&[aria-disabled]:not([aria-disabled='false']) {
|
|
92
|
+
cursor: default;
|
|
92
93
|
opacity: 0.32;
|
|
93
94
|
}
|
|
94
95
|
`
|
|
@@ -108,6 +109,13 @@ const CheckboxInput = styled.input`
|
|
|
108
109
|
border-radius: 4px;
|
|
109
110
|
transition: 0.2s box-shadow, 0.2s background-color;
|
|
110
111
|
|
|
112
|
+
&:disabled {
|
|
113
|
+
cursor: default;
|
|
114
|
+
}
|
|
115
|
+
&:read-only {
|
|
116
|
+
cursor: default;
|
|
117
|
+
}
|
|
118
|
+
|
|
111
119
|
&:checked {
|
|
112
120
|
background-color: var(--charcoal-brand);
|
|
113
121
|
|
|
@@ -512,11 +512,13 @@ exports[`Storybook Tests DropdownSelector InModal 1`] = `
|
|
|
512
512
|
|
|
513
513
|
.c12:not(:disabled):not([aria-disabled]):hover,
|
|
514
514
|
.c12[aria-disabled='false']:hover {
|
|
515
|
+
color: var(--charcoal-text3-hover);
|
|
515
516
|
background-color: var(--charcoal-transparent-hover);
|
|
516
517
|
}
|
|
517
518
|
|
|
518
519
|
.c12:not(:disabled):not([aria-disabled]):active,
|
|
519
520
|
.c12[aria-disabled='false']:active {
|
|
521
|
+
color: var(--charcoal-text3-press);
|
|
520
522
|
background-color: var(--charcoal-transparent-press);
|
|
521
523
|
}
|
|
522
524
|
|
|
@@ -701,6 +703,7 @@ exports[`Storybook Tests DropdownSelector InModal 1`] = `
|
|
|
701
703
|
</button>
|
|
702
704
|
<div
|
|
703
705
|
className="c0"
|
|
706
|
+
onClick={[Function]}
|
|
704
707
|
onPointerDown={[Function]}
|
|
705
708
|
style={
|
|
706
709
|
Object {
|
|
@@ -67,11 +67,13 @@ exports[`Storybook Tests IconButton DefaultM 1`] = `
|
|
|
67
67
|
|
|
68
68
|
.c1:not(:disabled):not([aria-disabled]):hover,
|
|
69
69
|
.c1[aria-disabled='false']:hover {
|
|
70
|
+
color: var(--charcoal-text3-hover);
|
|
70
71
|
background-color: var(--charcoal-transparent-hover);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
.c1:not(:disabled):not([aria-disabled]):active,
|
|
74
75
|
.c1[aria-disabled='false']:active {
|
|
76
|
+
color: var(--charcoal-text3-press);
|
|
75
77
|
background-color: var(--charcoal-transparent-press);
|
|
76
78
|
}
|
|
77
79
|
|
|
@@ -177,6 +179,7 @@ exports[`Storybook Tests IconButton IsActive 1`] = `
|
|
|
177
179
|
|
|
178
180
|
.c1:not(:disabled):not([aria-disabled]),
|
|
179
181
|
.c1[aria-disabled='false'] {
|
|
182
|
+
color: var(--charcoal-text3-press);
|
|
180
183
|
background-color: var(--charcoal-transparent-press);
|
|
181
184
|
}
|
|
182
185
|
|
|
@@ -282,11 +285,13 @@ exports[`Storybook Tests IconButton OverlayM 1`] = `
|
|
|
282
285
|
|
|
283
286
|
.c1:not(:disabled):not([aria-disabled]):hover,
|
|
284
287
|
.c1[aria-disabled='false']:hover {
|
|
288
|
+
color: var(--charcoal-text5-hover);
|
|
285
289
|
background-color: var(--charcoal-surface4-hover);
|
|
286
290
|
}
|
|
287
291
|
|
|
288
292
|
.c1:not(:disabled):not([aria-disabled]):active,
|
|
289
293
|
.c1[aria-disabled='false']:active {
|
|
294
|
+
color: var(--charcoal-text5-press);
|
|
290
295
|
background-color: var(--charcoal-surface4-press);
|
|
291
296
|
}
|
|
292
297
|
|
|
@@ -69,16 +69,19 @@ const StyledIconButton = styled(Clickable).attrs<
|
|
|
69
69
|
|
|
70
70
|
&:not(:disabled):not([aria-disabled]),
|
|
71
71
|
&[aria-disabled='false'] {
|
|
72
|
-
${({ $isActive, $background }) =>
|
|
72
|
+
${({ $isActive, $background, $font }) =>
|
|
73
73
|
$isActive
|
|
74
74
|
? css`
|
|
75
|
+
color: var(--charcoal-${$font}-press);
|
|
75
76
|
background-color: var(--charcoal-${$background}-press);
|
|
76
77
|
`
|
|
77
78
|
: css`
|
|
78
79
|
&:hover {
|
|
80
|
+
color: var(--charcoal-${$font}-hover);
|
|
79
81
|
background-color: var(--charcoal-${$background}-hover);
|
|
80
82
|
}
|
|
81
83
|
&:active {
|
|
84
|
+
color: var(--charcoal-${$font}-press);
|
|
82
85
|
background-color: var(--charcoal-${$background}-press);
|
|
83
86
|
}
|
|
84
87
|
`}
|