@charcoal-ui/react 3.5.0 → 3.7.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/dist/_lib/compat.d.ts +1 -0
- package/dist/_lib/compat.d.ts.map +1 -1
- package/dist/components/Button/StyledButton.d.ts +12 -0
- package/dist/components/Button/StyledButton.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/lib/variantToBackground.d.ts +3 -0
- package/dist/components/Button/lib/variantToBackground.d.ts.map +1 -0
- package/dist/components/Button/lib/variantToFont.d.ts +3 -0
- package/dist/components/Button/lib/variantToFont.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.story.d.ts +6 -15
- package/dist/components/Checkbox/index.story.d.ts.map +1 -1
- package/dist/components/Clickable/index.story.d.ts +4 -6
- package/dist/components/Clickable/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/DropdownMenuItem.d.ts.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.story.d.ts +1 -0
- package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
- package/dist/components/FieldLabel/index.d.ts.map +1 -1
- package/dist/components/Icon/index.story.d.ts +1 -1
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
- package/dist/components/Modal/ModalPlumbing.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/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.story.d.ts +2 -0
- package/dist/components/MultiSelect/index.story.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts.map +1 -1
- 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 +1026 -384
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +991 -349
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +4 -4
- package/package.json +18 -21
- package/src/_lib/compat.ts +8 -0
- package/src/components/Button/StyledButton.tsx +66 -0
- package/src/components/Button/__snapshots__/index.story.storyshot +312 -592
- package/src/components/Button/index.tsx +14 -70
- package/src/components/Button/lib/variantToBackground.tsx +19 -0
- package/src/components/Button/lib/variantToFont.tsx +19 -0
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +209 -40
- package/src/components/Checkbox/index.story.tsx +82 -64
- package/src/components/Checkbox/index.tsx +47 -17
- package/src/components/Clickable/__snapshots__/index.story.storyshot +4 -0
- package/src/components/Clickable/index.story.tsx +12 -9
- package/src/components/Clickable/index.tsx +1 -0
- package/src/components/DropdownSelector/DropdownMenuItem.tsx +6 -3
- package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +3 -10
- package/src/components/DropdownSelector/ListItem/index.tsx +6 -4
- package/src/components/DropdownSelector/MenuItemGroup/index.tsx +1 -1
- package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +4 -13
- package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +20 -37
- package/src/components/DropdownSelector/Popover/index.tsx +5 -8
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +227 -294
- package/src/components/DropdownSelector/index.story.tsx +33 -0
- package/src/components/DropdownSelector/index.tsx +63 -20
- package/src/components/FieldLabel/index.tsx +77 -12
- package/src/components/IconButton/__snapshots__/index.story.storyshot +30 -54
- package/src/components/IconButton/index.tsx +51 -26
- package/src/components/LoadingSpinner/index.tsx +3 -6
- package/src/components/Modal/Dialog/index.tsx +1 -1
- package/src/components/Modal/ModalPlumbing.tsx +26 -5
- package/src/components/Modal/__snapshots__/index.story.storyshot +2450 -108
- package/src/components/Modal/index.story.tsx +27 -0
- package/src/components/Modal/index.tsx +19 -4
- package/src/components/MultiSelect/__snapshots__/index.story.storyshot +528 -25
- package/src/components/MultiSelect/index.story.tsx +60 -0
- package/src/components/MultiSelect/index.tsx +82 -22
- package/src/components/Radio/__snapshots__/index.story.storyshot +32 -49
- package/src/components/Radio/index.tsx +71 -23
- package/src/components/SegmentedControl/RadioGroupContext.tsx +1 -1
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +9 -10
- package/src/components/SegmentedControl/index.tsx +36 -16
- package/src/components/Switch/__snapshots__/index.story.storyshot +6 -18
- package/src/components/Switch/index.tsx +10 -15
- package/src/components/TagItem/__snapshots__/index.story.storyshot +39 -158
- package/src/components/TagItem/index.tsx +84 -19
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +55 -91
- package/src/components/TextField/TextField.story.tsx +35 -18
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +92 -148
- package/src/components/TextField/index.tsx +0 -1
- package/dist/components/Checkbox/performance.test.d.ts +0 -4
- package/dist/components/Checkbox/performance.test.d.ts.map +0 -1
- package/dist/components/Checkbox/snapshot.test.d.ts +0 -2
- package/dist/components/Checkbox/snapshot.test.d.ts.map +0 -1
- package/src/components/Checkbox/__snapshots__/snapshot.test.tsx.snap +0 -763
- package/src/components/Checkbox/performance.test.tsx +0 -30
- package/src/components/Checkbox/snapshot.test.tsx +0 -66
package/dist/styled.d.ts
CHANGED
|
@@ -61,17 +61,17 @@ export declare const theme: (specFn: (o: Record<string, unknown> & Readonly<{
|
|
|
61
61
|
}> & {
|
|
62
62
|
readonly typography: (size: keyof import("@charcoal-ui/theme").Typography) => import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "bold" | "monospace" | "preserveHalfLeading">;
|
|
63
63
|
} & {
|
|
64
|
-
readonly margin: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 |
|
|
65
|
-
readonly padding: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 |
|
|
64
|
+
readonly margin: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440]>;
|
|
65
|
+
readonly padding: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440]>;
|
|
66
66
|
} & {
|
|
67
67
|
readonly height: Readonly<{
|
|
68
|
-
px: (size: 0 | "auto" | 4 | 8 |
|
|
68
|
+
px: (size: 0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
|
|
69
69
|
column: (span: number) => import("@charcoal-ui/styled/dist/internals").Internal;
|
|
70
70
|
auto: import("@charcoal-ui/styled/dist/internals").Internal;
|
|
71
71
|
full: import("@charcoal-ui/styled/dist/internals").Internal;
|
|
72
72
|
}>;
|
|
73
73
|
readonly width: Readonly<{
|
|
74
|
-
px: (size: 0 | "auto" | 4 | 8 |
|
|
74
|
+
px: (size: 0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
|
|
75
75
|
column: (span: number) => import("@charcoal-ui/styled/dist/internals").Internal;
|
|
76
76
|
auto: import("@charcoal-ui/styled/dist/internals").Internal;
|
|
77
77
|
full: import("@charcoal-ui/styled/dist/internals").Internal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -51,27 +51,24 @@
|
|
|
51
51
|
"typescript": "^4.9.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@charcoal-ui/icons": "^3.
|
|
55
|
-
"@charcoal-ui/styled": "^3.
|
|
56
|
-
"@charcoal-ui/theme": "^3.
|
|
57
|
-
"@charcoal-ui/utils": "^3.
|
|
58
|
-
"@react-aria/button": "^3.
|
|
59
|
-
"@react-aria/checkbox": "^3.
|
|
60
|
-
"@react-aria/dialog": "^3.5.
|
|
61
|
-
"@react-aria/focus": "^3.
|
|
62
|
-
"@react-aria/
|
|
63
|
-
"@react-aria/
|
|
64
|
-
"@react-aria/
|
|
65
|
-
"@react-aria/
|
|
66
|
-
"@react-aria/
|
|
67
|
-
"@react-aria/
|
|
68
|
-
"@react-aria/
|
|
69
|
-
"@react-aria/textfield": "^3.9.0",
|
|
70
|
-
"@react-aria/utils": "^3.15.0",
|
|
71
|
-
"@react-aria/visually-hidden": "^3.7.0",
|
|
54
|
+
"@charcoal-ui/icons": "^3.7.0",
|
|
55
|
+
"@charcoal-ui/styled": "^3.7.0",
|
|
56
|
+
"@charcoal-ui/theme": "^3.7.0",
|
|
57
|
+
"@charcoal-ui/utils": "^3.7.0",
|
|
58
|
+
"@react-aria/button": "^3.9.1",
|
|
59
|
+
"@react-aria/checkbox": "^3.13.0",
|
|
60
|
+
"@react-aria/dialog": "^3.5.10",
|
|
61
|
+
"@react-aria/focus": "^3.16.0",
|
|
62
|
+
"@react-aria/overlays": "^3.20.0",
|
|
63
|
+
"@react-aria/radio": "^3.10.0",
|
|
64
|
+
"@react-aria/ssr": "^3.9.1",
|
|
65
|
+
"@react-aria/switch": "^3.6.0",
|
|
66
|
+
"@react-aria/textfield": "^3.14.1",
|
|
67
|
+
"@react-aria/utils": "^3.23.0",
|
|
68
|
+
"@react-aria/visually-hidden": "^3.8.8",
|
|
72
69
|
"polished": "^4.1.4",
|
|
73
70
|
"react-spring": "^9.0.0",
|
|
74
|
-
"react-stately": "^3.
|
|
71
|
+
"react-stately": "^3.26.0",
|
|
75
72
|
"warning": "^4.0.3"
|
|
76
73
|
},
|
|
77
74
|
"peerDependencies": {
|
|
@@ -90,5 +87,5 @@
|
|
|
90
87
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
91
88
|
"directory": "packages/react"
|
|
92
89
|
},
|
|
93
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "ebb9480045faf2418cb5a2f95f69848f946e14ed"
|
|
94
91
|
}
|
package/src/_lib/compat.ts
CHANGED
|
@@ -28,4 +28,12 @@ export interface ReactAreaUseTextFieldCompat<E = Element> {
|
|
|
28
28
|
readonly onSelect?: React.ReactEventHandler<E>
|
|
29
29
|
readonly onBeforeInput?: React.FormEventHandler<E>
|
|
30
30
|
readonly onInput?: React.FormEventHandler<E>
|
|
31
|
+
readonly autoCapitalize?:
|
|
32
|
+
| 'none'
|
|
33
|
+
| 'on'
|
|
34
|
+
| 'off'
|
|
35
|
+
| 'sentences'
|
|
36
|
+
| 'words'
|
|
37
|
+
| 'characters'
|
|
38
|
+
| undefined
|
|
31
39
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
import Clickable from '../Clickable'
|
|
3
|
+
import { variantToFont } from './lib/variantToFont'
|
|
4
|
+
import { variantToBackground } from './lib/variantToBackground'
|
|
5
|
+
import type { Size } from '.'
|
|
6
|
+
|
|
7
|
+
const horizontalPaddingSmall = css`
|
|
8
|
+
padding-right: 16px;
|
|
9
|
+
padding-left: 16px;
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
const horizontalPaddingMedium = css`
|
|
13
|
+
padding-right: 24px;
|
|
14
|
+
padding-left: 24px;
|
|
15
|
+
`
|
|
16
|
+
|
|
17
|
+
type StyledButtonProps = {
|
|
18
|
+
$fullWidth: boolean
|
|
19
|
+
$size: Size
|
|
20
|
+
$background: ReturnType<typeof variantToBackground>
|
|
21
|
+
$color: ReturnType<typeof variantToFont>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const StyledButton = styled(Clickable)<StyledButtonProps>`
|
|
25
|
+
width: ${(p) => (p.$fullWidth ? 'stretch' : 'min-content')};
|
|
26
|
+
display: inline-grid;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
user-select: none;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
border-radius: 999999px;
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
line-height: 22px;
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
|
|
37
|
+
${(p) => (p.$size === 'M' ? horizontalPaddingMedium : horizontalPaddingSmall)}
|
|
38
|
+
color: var(--charcoal-${(p) => p.$color});
|
|
39
|
+
background-color: var(--charcoal-${(p) => p.$background});
|
|
40
|
+
transition: 0.2s color, 0.2s background-color, 0.2s box-shadow;
|
|
41
|
+
|
|
42
|
+
&:not(:disabled):not([aria-disabled]),
|
|
43
|
+
&[aria-disabled='false'] {
|
|
44
|
+
&:active,
|
|
45
|
+
&:focus,
|
|
46
|
+
&:focus-visible {
|
|
47
|
+
outline: none;
|
|
48
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
color: var(--charcoal-${(p) => p.$color}-hover);
|
|
53
|
+
background-color: var(--charcoal-${(p) => p.$background}-hover);
|
|
54
|
+
}
|
|
55
|
+
&:active {
|
|
56
|
+
color: var(--charcoal-${(p) => p.$color}-press);
|
|
57
|
+
background-color: var(--charcoal-${(p) => p.$background}-press);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:disabled,
|
|
62
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
63
|
+
opacity: 0.32;
|
|
64
|
+
}
|
|
65
|
+
height: ${(p) => (p.$size === 'M' ? 40 : 32)}px;
|
|
66
|
+
`
|