@basic-ui/material 1.0.0-alpha.49 → 1.0.0-alpha.50
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/build/cjs/index.js +70 -0
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/SearchBar/SearchBar.d.ts +15 -0
- package/build/esm/SearchBar/SearchBar.js +90 -0
- package/build/esm/SearchBar/SearchBar.js.map +1 -0
- package/build/esm/SearchBar/index.d.ts +1 -0
- package/build/esm/SearchBar/index.js +2 -0
- package/build/esm/SearchBar/index.js.map +1 -0
- package/build/esm/Select/CustomContainerExample.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/src/Combobox/Combobox.story.tsx +157 -157
- package/src/SearchBar/SearchBar.story.tsx +98 -0
- package/src/SearchBar/SearchBar.tsx +105 -0
- package/src/SearchBar/index.ts +1 -0
- package/src/TextField/IconContainer.tsx +33 -33
- package/src/TextField/TextField.story.tsx +240 -241
- package/src/index.ts +42 -41
|
@@ -1,241 +1,240 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Box } from '../Box';
|
|
4
|
-
import { CheckBox } from '../CheckBox';
|
|
5
|
-
import { Select, SelectItem } from '../';
|
|
6
|
-
import { Button } from '../Button';
|
|
7
|
-
import { alpha } from '../color';
|
|
8
|
-
import { TextField } from './';
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
title: 'components/TextField',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const SearchIcon = (
|
|
15
|
-
<svg
|
|
16
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
-
height={24}
|
|
18
|
-
width={24}
|
|
19
|
-
viewBox="0 0 48 48"
|
|
20
|
-
fill="currentColor"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
const [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<SelectItem value="
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
export const
|
|
241
|
-
export const Outlined = () => <Example variant="outlined" />;
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Box } from '../Box';
|
|
4
|
+
import { CheckBox } from '../CheckBox';
|
|
5
|
+
import { Select, SelectItem } from '../';
|
|
6
|
+
import { Button } from '../Button';
|
|
7
|
+
import { alpha } from '../color';
|
|
8
|
+
import { TextField } from './';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'components/TextField',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const SearchIcon = () => (
|
|
15
|
+
<svg
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
height={24}
|
|
18
|
+
width={24}
|
|
19
|
+
viewBox="0 0 48 48"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
>
|
|
22
|
+
<path d="M39.8 41.95 26.65 28.8q-1.5 1.3-3.5 2.025-2 .725-4.25.725-5.4 0-9.15-3.75T6 18.75q0-5.3 3.75-9.05 3.75-3.75 9.1-3.75 5.3 0 9.025 3.75 3.725 3.75 3.725 9.05 0 2.15-.7 4.15-.7 2-2.1 3.75L42 39.75Zm-20.95-13.4q4.05 0 6.9-2.875Q28.6 22.8 28.6 18.75t-2.85-6.925Q22.9 8.95 18.85 8.95q-4.1 0-6.975 2.875T9 18.75q0 4.05 2.875 6.925t6.975 2.875Z" />
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const Example = ({ variant }: { variant: 'filled' | 'outlined' }) => {
|
|
27
|
+
const [error, setError] = useState<boolean | string>(false);
|
|
28
|
+
const [color, setColor] = useState<'primary' | 'secondary'>('primary');
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Box p={3}>
|
|
32
|
+
<CheckBox
|
|
33
|
+
checked={Boolean(error)}
|
|
34
|
+
onChange={(e) =>
|
|
35
|
+
setError(e.target.checked ? 'This field is required' : false)
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
Has Error
|
|
39
|
+
</CheckBox>
|
|
40
|
+
<Box width={230} display="inline-block">
|
|
41
|
+
<Select
|
|
42
|
+
value={color}
|
|
43
|
+
onChange={(e, value: 'primary' | 'secondary') => setColor(value)}
|
|
44
|
+
label="Color"
|
|
45
|
+
>
|
|
46
|
+
<SelectItem value="primary">Primary</SelectItem>
|
|
47
|
+
<SelectItem value="secondary">Secondary</SelectItem>
|
|
48
|
+
</Select>
|
|
49
|
+
</Box>
|
|
50
|
+
<Box
|
|
51
|
+
py={3}
|
|
52
|
+
backgroundColor="surface"
|
|
53
|
+
display="inline-flex"
|
|
54
|
+
flexWrap="wrap"
|
|
55
|
+
>
|
|
56
|
+
<Box m={2} width={230} display="inline-block">
|
|
57
|
+
<TextField
|
|
58
|
+
variant={variant}
|
|
59
|
+
label="Standard"
|
|
60
|
+
error={error}
|
|
61
|
+
color={color}
|
|
62
|
+
/>
|
|
63
|
+
</Box>
|
|
64
|
+
<Box m={2} width={230} display="inline-block">
|
|
65
|
+
<TextField
|
|
66
|
+
variant={variant}
|
|
67
|
+
label="Standard"
|
|
68
|
+
helperText="Helper text"
|
|
69
|
+
error={error}
|
|
70
|
+
color={color}
|
|
71
|
+
/>
|
|
72
|
+
</Box>
|
|
73
|
+
<Box m={2} width={230} display="inline-block">
|
|
74
|
+
<TextField
|
|
75
|
+
variant={variant}
|
|
76
|
+
label="Standard"
|
|
77
|
+
defaultValue="Hello world"
|
|
78
|
+
helperText="Helper text"
|
|
79
|
+
error={error}
|
|
80
|
+
color={color}
|
|
81
|
+
/>
|
|
82
|
+
</Box>
|
|
83
|
+
<Box m={2} width={230} display="inline-block">
|
|
84
|
+
<TextField
|
|
85
|
+
variant={variant}
|
|
86
|
+
label="Standard with placeholder"
|
|
87
|
+
placeholder="Placeholder"
|
|
88
|
+
helperText="Helper text"
|
|
89
|
+
error={error}
|
|
90
|
+
color={color}
|
|
91
|
+
/>
|
|
92
|
+
</Box>
|
|
93
|
+
<Box m={2} width={230} display="inline-block">
|
|
94
|
+
<TextField
|
|
95
|
+
variant={variant}
|
|
96
|
+
label="Disabled"
|
|
97
|
+
helperText="Helper text"
|
|
98
|
+
error={error}
|
|
99
|
+
color={color}
|
|
100
|
+
disabled
|
|
101
|
+
/>
|
|
102
|
+
</Box>
|
|
103
|
+
<Box m={2} width={230} display="inline-block">
|
|
104
|
+
<TextField
|
|
105
|
+
variant={variant}
|
|
106
|
+
label=""
|
|
107
|
+
helperText="Helper text"
|
|
108
|
+
error={error}
|
|
109
|
+
color={color}
|
|
110
|
+
/>
|
|
111
|
+
</Box>
|
|
112
|
+
<Box m={2} width={230} display="inline-block">
|
|
113
|
+
<TextField
|
|
114
|
+
variant={variant}
|
|
115
|
+
label="Standard"
|
|
116
|
+
maxLength={20}
|
|
117
|
+
error={error}
|
|
118
|
+
color={color}
|
|
119
|
+
/>
|
|
120
|
+
</Box>
|
|
121
|
+
<Box m={2} width={230} display="inline-block">
|
|
122
|
+
<TextField
|
|
123
|
+
variant={variant}
|
|
124
|
+
label="Standard"
|
|
125
|
+
helperText="Helper text"
|
|
126
|
+
multiline
|
|
127
|
+
error={error}
|
|
128
|
+
color={color}
|
|
129
|
+
/>
|
|
130
|
+
</Box>
|
|
131
|
+
<Box m={2} width={230} display="inline-block">
|
|
132
|
+
<TextField
|
|
133
|
+
variant={variant}
|
|
134
|
+
label="Standard"
|
|
135
|
+
helperText="Helper text"
|
|
136
|
+
multiline
|
|
137
|
+
maxLength={512}
|
|
138
|
+
error={error}
|
|
139
|
+
color={color}
|
|
140
|
+
/>
|
|
141
|
+
</Box>
|
|
142
|
+
<Box m={2} width={230} display="inline-block">
|
|
143
|
+
<TextField
|
|
144
|
+
variant={variant}
|
|
145
|
+
helperText="Helper text"
|
|
146
|
+
multiline
|
|
147
|
+
error={error}
|
|
148
|
+
color={color}
|
|
149
|
+
/>
|
|
150
|
+
</Box>
|
|
151
|
+
<Box m={2} width={230} display="inline-block">
|
|
152
|
+
<TextField
|
|
153
|
+
variant={variant}
|
|
154
|
+
helperText="Helper text"
|
|
155
|
+
multiline
|
|
156
|
+
maxLength={512}
|
|
157
|
+
error={error}
|
|
158
|
+
color={color}
|
|
159
|
+
/>
|
|
160
|
+
</Box>
|
|
161
|
+
<Box m={2} width={'100%'} display="inline-block">
|
|
162
|
+
<TextField
|
|
163
|
+
variant={variant}
|
|
164
|
+
label="Standard"
|
|
165
|
+
error={error}
|
|
166
|
+
color={color}
|
|
167
|
+
/>
|
|
168
|
+
</Box>
|
|
169
|
+
<Box m={2} width={230} display="inline-block">
|
|
170
|
+
<TextField
|
|
171
|
+
variant={variant}
|
|
172
|
+
label="With icon"
|
|
173
|
+
error={error}
|
|
174
|
+
color={color}
|
|
175
|
+
leadingIcon={<SearchIcon />}
|
|
176
|
+
/>
|
|
177
|
+
</Box>
|
|
178
|
+
<Box m={2} width={230} display="inline-block">
|
|
179
|
+
<TextField
|
|
180
|
+
variant={variant}
|
|
181
|
+
label="With icon"
|
|
182
|
+
error={error}
|
|
183
|
+
color={color}
|
|
184
|
+
trailingIcon={
|
|
185
|
+
<Button
|
|
186
|
+
variant="icon"
|
|
187
|
+
sx={{
|
|
188
|
+
pointerEvents: 'all',
|
|
189
|
+
mr: '-8px',
|
|
190
|
+
width: 40,
|
|
191
|
+
height: 40,
|
|
192
|
+
}}
|
|
193
|
+
>
|
|
194
|
+
<Box
|
|
195
|
+
as="svg"
|
|
196
|
+
sx={{ color: alpha('on.surface', 0.54) }}
|
|
197
|
+
viewBox="0 0 24 24"
|
|
198
|
+
minWidth="24px"
|
|
199
|
+
minHeight="24px"
|
|
200
|
+
>
|
|
201
|
+
<path fill="currentColor" d="M7 10l5 5 5-5z" />
|
|
202
|
+
</Box>
|
|
203
|
+
</Button>
|
|
204
|
+
}
|
|
205
|
+
/>
|
|
206
|
+
</Box>
|
|
207
|
+
<Box m={2} width={230} display="inline-block">
|
|
208
|
+
<TextField
|
|
209
|
+
variant={variant}
|
|
210
|
+
label="Numeric"
|
|
211
|
+
error={error}
|
|
212
|
+
color={color}
|
|
213
|
+
type="number"
|
|
214
|
+
/>
|
|
215
|
+
</Box>
|
|
216
|
+
<Box m={2} width={230} display="inline-block">
|
|
217
|
+
<TextField
|
|
218
|
+
variant={variant}
|
|
219
|
+
label="Numeric with hidden arrows"
|
|
220
|
+
error={error}
|
|
221
|
+
color={color}
|
|
222
|
+
type="number"
|
|
223
|
+
sx={{
|
|
224
|
+
'&::-webkit-outer-spin-button,&::-webkit-inner-spin-button': {
|
|
225
|
+
WebkitAppearance: 'none',
|
|
226
|
+
margin: 0,
|
|
227
|
+
},
|
|
228
|
+
'&[type=number]': {
|
|
229
|
+
'-moz-appearance': 'textfield',
|
|
230
|
+
},
|
|
231
|
+
}}
|
|
232
|
+
/>
|
|
233
|
+
</Box>
|
|
234
|
+
</Box>
|
|
235
|
+
</Box>
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const Filled = () => <Example variant="filled" />;
|
|
240
|
+
export const Outlined = () => <Example variant="outlined" />;
|
package/src/index.ts
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
export * from './AppBar';
|
|
2
|
-
export * from './Alert';
|
|
3
|
-
export * from './Badge';
|
|
4
|
-
export * from './BaseLine';
|
|
5
|
-
export * from './BottomSheet';
|
|
6
|
-
export * from './Box';
|
|
7
|
-
export * from './Button';
|
|
8
|
-
export * from './Combobox';
|
|
9
|
-
export * from './CheckBox';
|
|
10
|
-
export * from './Chip';
|
|
11
|
-
export * from './Divider';
|
|
12
|
-
export * from './Dialog';
|
|
13
|
-
export * from './FloatingLabel';
|
|
14
|
-
export * from './LineRipple';
|
|
15
|
-
export * from './Link';
|
|
16
|
-
export * from './List';
|
|
17
|
-
export * from './ListItem';
|
|
18
|
-
export * from './Menu';
|
|
19
|
-
export * from './NavRail';
|
|
20
|
-
export * from './NotchedOutline';
|
|
21
|
-
export * from './Paper';
|
|
22
|
-
export * from './Popover';
|
|
23
|
-
export * from './ProgressSpinner';
|
|
24
|
-
export * from './RadioButton';
|
|
25
|
-
export * from './Ripple';
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
34
|
-
export * from './
|
|
35
|
-
export * from './
|
|
36
|
-
export * from './
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './
|
|
41
|
-
export * from './
|
|
1
|
+
export * from './AppBar';
|
|
2
|
+
export * from './Alert';
|
|
3
|
+
export * from './Badge';
|
|
4
|
+
export * from './BaseLine';
|
|
5
|
+
export * from './BottomSheet';
|
|
6
|
+
export * from './Box';
|
|
7
|
+
export * from './Button';
|
|
8
|
+
export * from './Combobox';
|
|
9
|
+
export * from './CheckBox';
|
|
10
|
+
export * from './Chip';
|
|
11
|
+
export * from './Divider';
|
|
12
|
+
export * from './Dialog';
|
|
13
|
+
export * from './FloatingLabel';
|
|
14
|
+
export * from './LineRipple';
|
|
15
|
+
export * from './Link';
|
|
16
|
+
export * from './List';
|
|
17
|
+
export * from './ListItem';
|
|
18
|
+
export * from './Menu';
|
|
19
|
+
export * from './NavRail';
|
|
20
|
+
export * from './NotchedOutline';
|
|
21
|
+
export * from './Paper';
|
|
22
|
+
export * from './Popover';
|
|
23
|
+
export * from './ProgressSpinner';
|
|
24
|
+
export * from './RadioButton';
|
|
25
|
+
export * from './Ripple';
|
|
26
|
+
export * from './SearchBar';
|
|
27
|
+
export * from './Select';
|
|
28
|
+
export * from './SelectItem';
|
|
29
|
+
export * from './Skeleton';
|
|
30
|
+
export * from './Slider';
|
|
31
|
+
export * from './Snackbar';
|
|
32
|
+
export * from './Switch';
|
|
33
|
+
export * from './Tab';
|
|
34
|
+
export * from './TabIndicator';
|
|
35
|
+
export * from './Table';
|
|
36
|
+
export * from './Text';
|
|
37
|
+
export * from './TextField';
|
|
38
|
+
export * from './Tooltip';
|
|
39
|
+
export * from './motion';
|
|
40
|
+
export * from './theme';
|
|
41
|
+
export * from './color';
|
|
42
|
+
export * from './hooks/useAnimation';
|