@charcoal-ui/react 2.1.0 → 2.2.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/LoadingSpinner/index.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/index.cjs +37 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/DropdownSelector/Listbox.tsx +2 -1
- package/src/components/DropdownSelector/index.tsx +6 -2
- package/src/components/LoadingSpinner/index.tsx +7 -6
- package/src/components/MultiSelect/index.tsx +1 -1
- package/src/components/Radio/index.tsx +4 -3
- package/src/components/Switch/index.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"typescript": "^4.5.5"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@charcoal-ui/icons": "^2.1
|
|
54
|
-
"@charcoal-ui/styled": "^2.1
|
|
55
|
-
"@charcoal-ui/theme": "^2.1
|
|
56
|
-
"@charcoal-ui/utils": "^2.1
|
|
53
|
+
"@charcoal-ui/icons": "^2.2.1",
|
|
54
|
+
"@charcoal-ui/styled": "^2.2.1",
|
|
55
|
+
"@charcoal-ui/theme": "^2.2.1",
|
|
56
|
+
"@charcoal-ui/utils": "^2.2.1",
|
|
57
57
|
"@react-aria/button": "^3.6.3",
|
|
58
58
|
"@react-aria/checkbox": "^3.2.3",
|
|
59
59
|
"@react-aria/dialog": "^3.2.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
87
87
|
"directory": "packages/react"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "3da489924e6e4c67f66c13bac76bed95366934d1"
|
|
90
90
|
}
|
|
@@ -114,6 +114,7 @@ const OptionRoot = styled.li<{ mode?: ListMode }>`
|
|
|
114
114
|
`
|
|
115
115
|
const OptionCheckIcon = styled(Icon)<{ isSelected: boolean }>`
|
|
116
116
|
visibility: hidden;
|
|
117
|
+
${theme((o) => [o.font.text2])}
|
|
117
118
|
|
|
118
119
|
${({ isSelected }) =>
|
|
119
120
|
isSelected &&
|
|
@@ -123,5 +124,5 @@ const OptionCheckIcon = styled(Icon)<{ isSelected: boolean }>`
|
|
|
123
124
|
`
|
|
124
125
|
const OptionText = styled.span`
|
|
125
126
|
display: block;
|
|
126
|
-
${theme((o) => [o.typography(14)])}
|
|
127
|
+
${theme((o) => [o.typography(14), o.font.text2])}
|
|
127
128
|
`
|
|
@@ -121,7 +121,7 @@ const DropdownSelector = <T extends Record<string, unknown>>({
|
|
|
121
121
|
: props.placeholder}
|
|
122
122
|
</DropdownButtonText>
|
|
123
123
|
|
|
124
|
-
<
|
|
124
|
+
<DropdownButtonIcon name="16/Menu" />
|
|
125
125
|
</DropdownButton>
|
|
126
126
|
{state.isOpen && (
|
|
127
127
|
<DropdownPopover open={state.isOpen} onClose={() => state.close()}>
|
|
@@ -196,12 +196,16 @@ const DropdownButtonText = styled.span`
|
|
|
196
196
|
${theme((o) => [o.typography(14), o.font.text2])}
|
|
197
197
|
`
|
|
198
198
|
|
|
199
|
+
const DropdownButtonIcon = styled(Icon)`
|
|
200
|
+
${theme((o) => [o.font.text2])}
|
|
201
|
+
`
|
|
202
|
+
|
|
199
203
|
const AssertiveText = styled.div<{ invalid: boolean }>`
|
|
200
204
|
${({ invalid }) =>
|
|
201
205
|
theme((o) => [
|
|
202
206
|
o.typography(14),
|
|
203
207
|
o.margin.top(8),
|
|
204
|
-
invalid
|
|
208
|
+
invalid ? o.font.assertive : o.font.text2,
|
|
205
209
|
])}
|
|
206
210
|
`
|
|
207
211
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { transparentize } from 'polished'
|
|
2
1
|
import React, { useImperativeHandle, useRef } from 'react'
|
|
3
2
|
import styled, { keyframes } from 'styled-components'
|
|
3
|
+
import { theme } from '../../styled'
|
|
4
4
|
|
|
5
5
|
export default function LoadingSpinner({
|
|
6
6
|
size = 48,
|
|
@@ -25,11 +25,12 @@ const LoadingSpinnerRoot = styled.div.attrs({ role: 'progressbar' })<{
|
|
|
25
25
|
font-size: ${(props) => props.size}px;
|
|
26
26
|
width: ${(props) => props.size}px;
|
|
27
27
|
height: ${(props) => props.size}px;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
opacity: 0.84;
|
|
29
|
+
${({ transparent }) =>
|
|
30
|
+
theme((o) => [
|
|
31
|
+
o.font.text4,
|
|
32
|
+
transparent ? o.bg.transparent : o.bg.background1,
|
|
33
|
+
])}
|
|
33
34
|
`
|
|
34
35
|
|
|
35
36
|
const scaleout = keyframes`
|
|
@@ -93,7 +93,7 @@ const MultiSelectRoot = styled.label`
|
|
|
93
93
|
const MultiSelectLabel = styled.div`
|
|
94
94
|
display: flex;
|
|
95
95
|
align-items: center;
|
|
96
|
-
${theme((o) => [o.typography(14), o.font.
|
|
96
|
+
${theme((o) => [o.typography(14), o.font.text2])}
|
|
97
97
|
`
|
|
98
98
|
|
|
99
99
|
const MultiSelectInput = styled.input.attrs({ type: 'checkbox' })<{
|
|
@@ -76,6 +76,7 @@ export const RadioInput = styled.input.attrs({ type: 'radio' })<{
|
|
|
76
76
|
display: block;
|
|
77
77
|
box-sizing: border-box;
|
|
78
78
|
|
|
79
|
+
margin: 0;
|
|
79
80
|
padding: 6px;
|
|
80
81
|
|
|
81
82
|
width: 20px;
|
|
@@ -84,14 +85,14 @@ export const RadioInput = styled.input.attrs({ type: 'radio' })<{
|
|
|
84
85
|
${({ hasError = false }) =>
|
|
85
86
|
theme((o) => [
|
|
86
87
|
o.borderRadius('oval'),
|
|
87
|
-
o.bg.
|
|
88
|
+
o.bg.surface1.hover.press,
|
|
88
89
|
hasError && o.outline.assertive,
|
|
89
90
|
])};
|
|
90
91
|
|
|
91
92
|
&:not(:checked) {
|
|
92
93
|
border-width: 2px;
|
|
93
94
|
border-style: solid;
|
|
94
|
-
border-color: ${({ theme }) => theme.color.
|
|
95
|
+
border-color: ${({ theme }) => theme.color.text3};
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
&:checked {
|
|
@@ -113,7 +114,7 @@ export const RadioInput = styled.input.attrs({ type: 'radio' })<{
|
|
|
113
114
|
`
|
|
114
115
|
|
|
115
116
|
const RadioLabel = styled.div`
|
|
116
|
-
${theme((o) => [o.typography(14)])}
|
|
117
|
+
${theme((o) => [o.typography(14), o.font.text2])}
|
|
117
118
|
`
|
|
118
119
|
|
|
119
120
|
export type RadioGroupProps = React.PropsWithChildren<{
|
|
@@ -58,6 +58,7 @@ export default function SwitchCheckbox(props: SwitchProps) {
|
|
|
58
58
|
const Label = styled.label`
|
|
59
59
|
display: inline-grid;
|
|
60
60
|
grid-template-columns: auto 1fr;
|
|
61
|
+
align-items: center;
|
|
61
62
|
gap: ${({ theme }) => px(theme.spacing[4])};
|
|
62
63
|
cursor: pointer;
|
|
63
64
|
outline: 0;
|
|
@@ -70,7 +71,7 @@ const Label = styled.label`
|
|
|
70
71
|
`
|
|
71
72
|
|
|
72
73
|
const LabelInner = styled.div`
|
|
73
|
-
${theme((o) => o.typography(14))}
|
|
74
|
+
${theme((o) => [o.typography(14), o.font.text2])}
|
|
74
75
|
`
|
|
75
76
|
|
|
76
77
|
const SwitchInput = styled.input.attrs({
|