@charcoal-ui/react 3.1.2-beta.0 → 3.1.2-beta.2
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/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/index.cjs.js +4 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -6
- package/src/components/DropdownSelector/index.story.tsx +22 -0
- package/src/components/DropdownSelector/index.tsx +2 -1
- package/src/components/FieldLabel/index.tsx +1 -1
- package/src/components/Modal/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "3.1.2-beta.
|
|
3
|
+
"version": "3.1.2-beta.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"typescript": "^4.9.5"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@charcoal-ui/icons": "^3.1.2-beta.
|
|
53
|
-
"@charcoal-ui/styled": "^3.1.2-beta.
|
|
54
|
-
"@charcoal-ui/theme": "^3.1.2-beta.
|
|
55
|
-
"@charcoal-ui/utils": "^3.1.2-beta.
|
|
52
|
+
"@charcoal-ui/icons": "^3.1.2-beta.2",
|
|
53
|
+
"@charcoal-ui/styled": "^3.1.2-beta.2",
|
|
54
|
+
"@charcoal-ui/theme": "^3.1.2-beta.2",
|
|
55
|
+
"@charcoal-ui/utils": "^3.1.2-beta.2",
|
|
56
56
|
"@react-aria/button": "^3.7.0",
|
|
57
57
|
"@react-aria/checkbox": "^3.8.0",
|
|
58
58
|
"@react-aria/dialog": "^3.5.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
89
89
|
"directory": "packages/react"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "8ccbbe05e2e0801488cb031b71a0d311c3307363"
|
|
92
92
|
}
|
|
@@ -72,6 +72,28 @@ export const Basic: Story<DropdownSelectorProps> = (
|
|
|
72
72
|
|
|
73
73
|
Basic.args = { ...baseProps }
|
|
74
74
|
|
|
75
|
+
export const InFormTag: Story<DropdownSelectorProps> = (
|
|
76
|
+
props: DropdownSelectorProps
|
|
77
|
+
) => {
|
|
78
|
+
const [selected, setSelected] = useState('')
|
|
79
|
+
return (
|
|
80
|
+
<form style={{ width: 288 }}>
|
|
81
|
+
<DropdownSelector
|
|
82
|
+
{...props}
|
|
83
|
+
onChange={(value) => {
|
|
84
|
+
setSelected(value)
|
|
85
|
+
}}
|
|
86
|
+
value={selected}
|
|
87
|
+
label="label"
|
|
88
|
+
>
|
|
89
|
+
<DropdownMenuItem value={'10'}>Apple</DropdownMenuItem>
|
|
90
|
+
<DropdownMenuItem value={'20'}>Banana</DropdownMenuItem>
|
|
91
|
+
<DropdownMenuItem value={'30'}>Orange</DropdownMenuItem>
|
|
92
|
+
</DropdownSelector>
|
|
93
|
+
</form>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
75
97
|
export const CustomChildren: Story<DropdownSelectorProps> = (
|
|
76
98
|
props: DropdownSelectorProps
|
|
77
99
|
) => {
|
|
@@ -48,6 +48,7 @@ export default function DropdownSelector(props: DropdownSelectorProps) {
|
|
|
48
48
|
setIsOpen(true)
|
|
49
49
|
}}
|
|
50
50
|
ref={triggerRef}
|
|
51
|
+
type="button"
|
|
51
52
|
>
|
|
52
53
|
<DropdownButtonText>
|
|
53
54
|
{props.placeholder !== undefined && preview === undefined
|
|
@@ -107,6 +108,7 @@ const DropdownButton = styled.button<{ invalid?: boolean }>`
|
|
|
107
108
|
height: 40px;
|
|
108
109
|
width: 100%;
|
|
109
110
|
box-sizing: border-box;
|
|
111
|
+
border: none;
|
|
110
112
|
cursor: pointer;
|
|
111
113
|
|
|
112
114
|
${disabledSelector} {
|
|
@@ -115,7 +117,6 @@ const DropdownButton = styled.button<{ invalid?: boolean }>`
|
|
|
115
117
|
|
|
116
118
|
${({ invalid }) =>
|
|
117
119
|
theme((o) => [
|
|
118
|
-
o.border.default,
|
|
119
120
|
o.padding.horizontal(8),
|
|
120
121
|
o.outline.default.focus,
|
|
121
122
|
o.bg.surface3,
|