@charcoal-ui/react 3.7.0 → 3.9.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/components/Button/StyledButton.d.ts +1 -0
- package/dist/components/Button/StyledButton.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +1 -0
- 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/Checkbox/index.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 -12
- 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.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/Modal/useCustomModalOverlay.d.ts +12 -0
- package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -0
- 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/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/TextArea/index.d.ts.map +1 -1
- package/dist/components/TextField/TextField.story.d.ts +14 -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 +1006 -2240
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1001 -2241
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +4 -4
- package/package.json +7 -6
- package/src/components/Button/StyledButton.tsx +19 -14
- 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 +3 -0
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +55 -42
- package/src/components/Checkbox/index.tsx +15 -17
- package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
- 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 +148 -47
- package/src/components/DropdownSelector/index.story.tsx +207 -204
- package/src/components/DropdownSelector/index.tsx +17 -10
- 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 +135 -13
- package/src/components/IconButton/index.story.tsx +30 -23
- package/src/components/IconButton/index.tsx +35 -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 +224 -171
- package/src/components/Modal/index.story.tsx +139 -133
- package/src/components/Modal/index.tsx +15 -20
- package/src/components/Modal/useCustomModalOverlay.tsx +42 -0
- 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 +1001 -121
- package/src/components/Radio/index.story.tsx +128 -63
- package/src/components/Radio/index.tsx +15 -17
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
- package/src/components/SegmentedControl/index.story.tsx +24 -29
- 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 +127 -73
- package/src/components/TextArea/index.tsx +22 -14
- package/src/components/TextField/TextField.story.tsx +85 -64
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +479 -167
- package/src/components/TextField/index.tsx +22 -21
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.9.0",
|
|
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.0",
|
|
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.0",
|
|
56
|
+
"@charcoal-ui/styled": "^3.9.0",
|
|
57
|
+
"@charcoal-ui/theme": "^3.9.0",
|
|
58
|
+
"@charcoal-ui/utils": "^3.9.0",
|
|
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": "fe760d136886d2227013d73067544c5a42ff075b"
|
|
91
92
|
}
|
|
@@ -3,6 +3,7 @@ import Clickable from '../Clickable'
|
|
|
3
3
|
import { variantToFont } from './lib/variantToFont'
|
|
4
4
|
import { variantToBackground } from './lib/variantToBackground'
|
|
5
5
|
import type { Size } from '.'
|
|
6
|
+
import { focusVisibleFocusRingCss } from '@charcoal-ui/styled'
|
|
6
7
|
|
|
7
8
|
const horizontalPaddingSmall = css`
|
|
8
9
|
padding-right: 16px;
|
|
@@ -19,6 +20,7 @@ type StyledButtonProps = {
|
|
|
19
20
|
$size: Size
|
|
20
21
|
$background: ReturnType<typeof variantToBackground>
|
|
21
22
|
$color: ReturnType<typeof variantToFont>
|
|
23
|
+
$isActive: boolean
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export const StyledButton = styled(Clickable)<StyledButtonProps>`
|
|
@@ -41,21 +43,24 @@ export const StyledButton = styled(Clickable)<StyledButtonProps>`
|
|
|
41
43
|
|
|
42
44
|
&:not(:disabled):not([aria-disabled]),
|
|
43
45
|
&[aria-disabled='false'] {
|
|
44
|
-
|
|
45
|
-
&:focus,
|
|
46
|
-
&:focus-visible {
|
|
47
|
-
outline: none;
|
|
48
|
-
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
49
|
-
}
|
|
46
|
+
${focusVisibleFocusRingCss}
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
`}
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
&:disabled,
|