@charcoal-ui/react 3.6.0 → 3.8.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 +13 -0
- package/dist/components/Button/StyledButton.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +3 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.story.d.ts +16 -32
- package/dist/components/Button/index.story.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 -16
- 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/ListItem/index.story.d.ts +7 -7
- package/dist/components/DropdownSelector/ListItem/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/MenuList/index.story.d.ts +6 -9
- package/dist/components/DropdownSelector/MenuList/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.story.d.ts +3 -7
- package/dist/components/DropdownSelector/Popover/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.story.d.ts +9 -11
- package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
- package/dist/components/Icon/index.story.d.ts +4 -26
- package/dist/components/Icon/index.story.d.ts.map +1 -1
- package/dist/components/IconButton/index.d.ts +1 -0
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/IconButton/index.story.d.ts +6 -25
- package/dist/components/IconButton/index.story.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts +8 -0
- package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts.map +1 -0
- package/dist/components/LoadingSpinner/index.d.ts +2 -2
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/index.story.d.ts +4 -7
- package/dist/components/LoadingSpinner/index.story.d.ts.map +1 -1
- package/dist/components/Modal/index.story.d.ts +16 -41
- package/dist/components/Modal/index.story.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts +0 -2
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Radio/index.story.d.ts +12 -23
- package/dist/components/Radio/index.story.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.story.d.ts +5 -8
- package/dist/components/SegmentedControl/index.story.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.story.d.ts +7 -12
- package/dist/components/Switch/index.story.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TagItem/index.story.d.ts +14 -24
- package/dist/components/TagItem/index.story.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.story.d.ts +7 -25
- package/dist/components/TextArea/TextArea.story.d.ts.map +1 -1
- package/dist/components/TextField/TextField.story.d.ts +13 -20
- 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 +418 -206
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +387 -175
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +4 -4
- package/package.json +17 -20
- package/src/_lib/compat.ts +8 -0
- package/src/components/Button/StyledButton.tsx +71 -0
- package/src/components/Button/__snapshots__/index.story.storyshot +314 -118
- package/src/components/Button/index.story.tsx +141 -138
- package/src/components/Button/index.tsx +15 -104
- 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 +12 -27
- package/src/components/Checkbox/index.story.tsx +82 -88
- package/src/components/Checkbox/index.tsx +2 -12
- package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
- package/src/components/Clickable/index.story.tsx +12 -9
- package/src/components/DropdownSelector/DropdownMenuItem.tsx +1 -14
- package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +42 -37
- package/src/components/DropdownSelector/ListItem/index.story.tsx +8 -4
- package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +38 -38
- package/src/components/DropdownSelector/MenuList/index.story.tsx +33 -27
- package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +11 -5
- package/src/components/DropdownSelector/Popover/index.story.tsx +6 -6
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +313 -151
- package/src/components/DropdownSelector/index.story.tsx +207 -171
- package/src/components/DropdownSelector/index.tsx +22 -22
- package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
- package/src/components/Icon/index.story.tsx +8 -12
- package/src/components/IconButton/__snapshots__/index.story.storyshot +130 -13
- package/src/components/IconButton/index.story.tsx +30 -23
- package/src/components/IconButton/index.tsx +32 -20
- package/src/components/LoadingSpinner/LoadingSpinnerIcon.story.tsx +12 -0
- package/src/components/LoadingSpinner/__snapshots__/LoadingSpinnerIcon.story.storyshot +28 -0
- package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +1 -35
- package/src/components/LoadingSpinner/index.story.tsx +11 -54
- package/src/components/LoadingSpinner/index.tsx +1 -1
- package/src/components/Modal/__snapshots__/index.story.storyshot +231 -194
- package/src/components/Modal/index.story.tsx +139 -133
- package/src/components/MultiSelect/__snapshots__/index.story.storyshot +56 -4
- package/src/components/MultiSelect/index.tsx +3 -0
- package/src/components/Radio/__snapshots__/index.story.storyshot +981 -121
- package/src/components/Radio/index.story.tsx +128 -63
- package/src/components/Radio/index.tsx +10 -16
- package/src/components/SegmentedControl/RadioGroupContext.tsx +1 -1
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +11 -11
- package/src/components/SegmentedControl/index.story.tsx +24 -29
- package/src/components/SegmentedControl/index.tsx +1 -1
- package/src/components/Switch/__snapshots__/index.story.storyshot +184 -26
- package/src/components/Switch/index.story.tsx +72 -48
- package/src/components/Switch/index.tsx +2 -7
- package/src/components/TagItem/__snapshots__/index.story.storyshot +72 -33
- package/src/components/TagItem/index.story.tsx +154 -159
- package/src/components/TagItem/index.tsx +2 -6
- package/src/components/TextArea/TextArea.story.tsx +29 -32
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +139 -83
- package/src/components/TextField/TextField.story.tsx +67 -66
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +198 -162
- package/src/components/TextField/index.tsx +0 -7
- 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 -1093
- 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 |
|
|
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 |
|
|
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 | 40 | 8 | 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 | 40 | 8 | 16 | 24 | 64 | 104 | 168 | 272 | 440]>;
|
|
66
66
|
} & {
|
|
67
67
|
readonly height: Readonly<{
|
|
68
|
-
px: (size: 0 | "auto" | 4 |
|
|
68
|
+
px: (size: 0 | "auto" | 4 | 40 | 8 | 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 |
|
|
74
|
+
px: (size: 0 | "auto" | 4 | 40 | 8 | 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.8.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -51,24 +51,21 @@
|
|
|
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.8.0",
|
|
55
|
+
"@charcoal-ui/styled": "^3.8.0",
|
|
56
|
+
"@charcoal-ui/theme": "^3.8.0",
|
|
57
|
+
"@charcoal-ui/utils": "^3.8.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
71
|
"react-stately": "^3.26.0",
|
|
@@ -90,5 +87,5 @@
|
|
|
90
87
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
91
88
|
"directory": "packages/react"
|
|
92
89
|
},
|
|
93
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "939ab20e11455ff9cba840c38c7dfd33cd739b59"
|
|
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,71 @@
|
|
|
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
|
+
import { focusVisibleFocusRingCss } from '@charcoal-ui/styled'
|
|
7
|
+
|
|
8
|
+
const horizontalPaddingSmall = css`
|
|
9
|
+
padding-right: 16px;
|
|
10
|
+
padding-left: 16px;
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
const horizontalPaddingMedium = css`
|
|
14
|
+
padding-right: 24px;
|
|
15
|
+
padding-left: 24px;
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
type StyledButtonProps = {
|
|
19
|
+
$fullWidth: boolean
|
|
20
|
+
$size: Size
|
|
21
|
+
$background: ReturnType<typeof variantToBackground>
|
|
22
|
+
$color: ReturnType<typeof variantToFont>
|
|
23
|
+
$isActive: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const StyledButton = styled(Clickable)<StyledButtonProps>`
|
|
27
|
+
width: ${(p) => (p.$fullWidth ? 'stretch' : 'min-content')};
|
|
28
|
+
display: inline-grid;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
user-select: none;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
border-radius: 999999px;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 22px;
|
|
37
|
+
font-weight: bold;
|
|
38
|
+
|
|
39
|
+
${(p) => (p.$size === 'M' ? horizontalPaddingMedium : horizontalPaddingSmall)}
|
|
40
|
+
color: var(--charcoal-${(p) => p.$color});
|
|
41
|
+
background-color: var(--charcoal-${(p) => p.$background});
|
|
42
|
+
transition: 0.2s color, 0.2s background-color, 0.2s box-shadow;
|
|
43
|
+
|
|
44
|
+
&:not(:disabled):not([aria-disabled]),
|
|
45
|
+
&[aria-disabled='false'] {
|
|
46
|
+
${focusVisibleFocusRingCss}
|
|
47
|
+
|
|
48
|
+
${({ $isActive: $active, $color, $background }) =>
|
|
49
|
+
$active
|
|
50
|
+
? css`
|
|
51
|
+
color: var(--charcoal-${$color}-press);
|
|
52
|
+
background-color: var(--charcoal-${$background}-press);
|
|
53
|
+
`
|
|
54
|
+
: css`
|
|
55
|
+
&:hover {
|
|
56
|
+
color: var(--charcoal-${$color}-hover);
|
|
57
|
+
background-color: var(--charcoal-${$background}-hover);
|
|
58
|
+
}
|
|
59
|
+
&:active {
|
|
60
|
+
color: var(--charcoal-${$color}-press);
|
|
61
|
+
background-color: var(--charcoal-${$background}-press);
|
|
62
|
+
}
|
|
63
|
+
`}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:disabled,
|
|
67
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
68
|
+
opacity: 0.32;
|
|
69
|
+
}
|
|
70
|
+
height: ${(p) => (p.$size === 'M' ? 40 : 32)}px;
|
|
71
|
+
`
|