@basic-ui/material 0.1.15 → 0.1.16
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 +58 -43
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Combobox/Combobox.js +1 -0
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/FloatingLabel/FloatingLabel.d.ts +0 -1
- package/build/esm/FloatingLabel/FloatingLabel.js +1 -3
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Menu/Menu.js +1 -0
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/NotchedOutline/styledComponents.js +2 -2
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Select/Select.d.ts +3 -3
- package/build/esm/Select/Select.js +3 -12
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/Select/SelectIcon.js +3 -1
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/styledComponents.js +9 -5
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.js +11 -5
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/IconContainer.d.ts +2 -2
- package/build/esm/TextField/IconContainer.js +4 -2
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/Input.js +17 -9
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/OutlinedContainer.js +7 -4
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/TextField/consts.d.ts +5 -0
- package/build/esm/TextField/consts.js +6 -0
- package/build/esm/TextField/consts.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Combobox/Combobox.tsx +1 -0
- package/src/FloatingLabel/FloatingLabel.tsx +0 -3
- package/src/Menu/Menu.tsx +1 -0
- package/src/NotchedOutline/styledComponents.ts +1 -1
- package/src/Select/PaymentMethodSelect.story.tsx +321 -0
- package/src/Select/Select.story.tsx +26 -1
- package/src/Select/Select.tsx +12 -34
- package/src/Select/SelectIcon.tsx +2 -1
- package/src/Select/styledComponents.tsx +8 -4
- package/src/TextField/FilledContainer.tsx +22 -5
- package/src/TextField/IconContainer.tsx +5 -4
- package/src/TextField/Input.tsx +29 -9
- package/src/TextField/OutlinedContainer.tsx +18 -4
- package/src/TextField/TextField.story.tsx +14 -1
- package/src/TextField/consts.ts +7 -0
|
@@ -10,6 +10,11 @@ import { NotchedOutline } from '../NotchedOutline';
|
|
|
10
10
|
import { Box, BoxProps } from '../Box';
|
|
11
11
|
import { FloatingLabel } from '../FloatingLabel';
|
|
12
12
|
import { Theme } from '../theme';
|
|
13
|
+
import {
|
|
14
|
+
ICON_WIDTH,
|
|
15
|
+
PADDING_LEFT_WITHOUT_ICON,
|
|
16
|
+
PADDING_LEFT_WITH_ICON,
|
|
17
|
+
} from './consts';
|
|
13
18
|
|
|
14
19
|
const useEnhancedEffect =
|
|
15
20
|
typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
@@ -61,9 +66,10 @@ export const OutlinedContainer = forwardRef<
|
|
|
61
66
|
}, [label]);
|
|
62
67
|
|
|
63
68
|
const color = error ? 'error' : colorProp;
|
|
69
|
+
const inputHeight = 56;
|
|
64
70
|
|
|
65
71
|
return (
|
|
66
|
-
<Box position="relative" {...otherProps}>
|
|
72
|
+
<Box position="relative" lineHeight={0} {...otherProps}>
|
|
67
73
|
<NotchedOutline
|
|
68
74
|
ref={forwardedRef}
|
|
69
75
|
borderRadius={4}
|
|
@@ -76,9 +82,17 @@ export const OutlinedContainer = forwardRef<
|
|
|
76
82
|
label={
|
|
77
83
|
label && (
|
|
78
84
|
<FloatingLabel
|
|
79
|
-
height={
|
|
80
|
-
offsetX={
|
|
81
|
-
|
|
85
|
+
height={inputHeight}
|
|
86
|
+
offsetX={
|
|
87
|
+
leadingIcon
|
|
88
|
+
? PADDING_LEFT_WITH_ICON +
|
|
89
|
+
ICON_WIDTH +
|
|
90
|
+
PADDING_LEFT_WITHOUT_ICON
|
|
91
|
+
: PADDING_LEFT_WITHOUT_ICON
|
|
92
|
+
}
|
|
93
|
+
translateX={
|
|
94
|
+
leadingIcon ? -(PADDING_LEFT_WITH_ICON + ICON_WIDTH) : 0
|
|
95
|
+
}
|
|
82
96
|
active={forceActive || labelIsFloating}
|
|
83
97
|
ref={labelRef}
|
|
84
98
|
htmlFor={inputId}
|
|
@@ -10,6 +10,19 @@ export default {
|
|
|
10
10
|
title: 'components/TextField',
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
const SearchIcon = (props) => (
|
|
14
|
+
<svg
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
height={24}
|
|
17
|
+
width={24}
|
|
18
|
+
viewBox="0 0 48 48"
|
|
19
|
+
fill="currentColor"
|
|
20
|
+
{...props}
|
|
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
|
+
|
|
13
26
|
const Example = ({ variant }) => {
|
|
14
27
|
const [error, setError] = useState<boolean | string>(false);
|
|
15
28
|
const [color, setColor] = useState<'primary' | 'secondary'>('primary');
|
|
@@ -159,7 +172,7 @@ const Example = ({ variant }) => {
|
|
|
159
172
|
label="With icon"
|
|
160
173
|
error={error}
|
|
161
174
|
color={color}
|
|
162
|
-
leadingIcon={
|
|
175
|
+
leadingIcon={<SearchIcon />}
|
|
163
176
|
/>
|
|
164
177
|
</Box>
|
|
165
178
|
<Box m={2} width={230} display="inline-block">
|