@ndlib/component-library 0.0.38 → 0.0.39
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/elements/Fields/Select/Select.stories.js +1 -1
- package/dist/components/elements/Fields/Select/index.js +4 -11
- package/dist/components/elements/Fields/TextInput/TextInput.stories.js +1 -1
- package/dist/components/elements/Fields/TextInput/index.js +1 -1
- package/package.json +1 -1
|
@@ -35,5 +35,5 @@ export const WithLabel = {
|
|
|
35
35
|
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(StatefulSelect, { size: size.size, leftIcon: AppleIcon, sx: { mt: 2 }, label: "Fruit" })] }))) })),
|
|
36
36
|
};
|
|
37
37
|
export const InvertedColors = {
|
|
38
|
-
render: () => (_jsx(Column, Object.assign({ sx: { backgroundColor: COLOR.BLACK, p: 4 } }, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD, sx: { color: COLOR.WHITE } }, { children: size.label })), _jsx(StatefulSelect, { size: size.size, leftIcon: AppleIcon, sx: { mt: 2 },
|
|
38
|
+
render: () => (_jsx(Column, Object.assign({ sx: { backgroundColor: COLOR.BLACK, p: 4 } }, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD, sx: { color: COLOR.WHITE } }, { children: size.label })), _jsx(StatefulSelect, { inverted: true, size: size.size, leftIcon: AppleIcon, sx: { mt: 2 }, label: "Fruit" })] }))) }))),
|
|
39
39
|
};
|
|
@@ -120,17 +120,10 @@ export function Select({ size: sizeParam, placeholder, leftIcon, value, label, o
|
|
|
120
120
|
const focusStyles = {
|
|
121
121
|
boxShadow: inverted ? theme.boxShadow.INVERTED : theme.boxShadow.NORMAL,
|
|
122
122
|
};
|
|
123
|
-
return (_jsxs(Box, Object.assign({ sx: {
|
|
124
|
-
width: DEFAULT_WIDTH,
|
|
125
|
-
position: 'relative',
|
|
126
|
-
borderRadius: '4px',
|
|
127
|
-
backgroundColor: inverted ? COLOR.DARK_GRAY : COLOR.WHITE,
|
|
128
|
-
':hover fieldset': focusStyles,
|
|
129
|
-
':focus fieldset': focusStyles,
|
|
130
|
-
} }, { children: [_jsx("fieldset", Object.assign({ sx: {
|
|
123
|
+
return (_jsxs(Box, Object.assign({ sx: Object.assign({ width: DEFAULT_WIDTH, position: 'relative', borderRadius: '4px', backgroundColor: inverted ? COLOR.DARK_GRAY : COLOR.WHITE, ':hover fieldset': focusStyles, ':focus fieldset': focusStyles }, sx) }, { children: [_jsx("fieldset", Object.assign({ sx: {
|
|
131
124
|
textAlign: 'left',
|
|
132
125
|
position: 'absolute',
|
|
133
|
-
inset: '-
|
|
126
|
+
inset: '-4px 0px 0px 0px',
|
|
134
127
|
margin: '0px',
|
|
135
128
|
padding: '0px 0.5rem',
|
|
136
129
|
pointerEvents: 'none',
|
|
@@ -179,10 +172,10 @@ export function Select({ size: sizeParam, placeholder, leftIcon, value, label, o
|
|
|
179
172
|
else {
|
|
180
173
|
close();
|
|
181
174
|
}
|
|
182
|
-
}, color: inverted ? COLOR.EXTRA_LIGHT_GRAY : COLOR.TEXT, sx: Object.assign(
|
|
175
|
+
}, color: inverted ? COLOR.EXTRA_LIGHT_GRAY : COLOR.TEXT, sx: Object.assign({ height, width: '100%', border: 'solid 0px',
|
|
183
176
|
// borderColor: COLOR.GRAY,
|
|
184
177
|
// borderRadius: '4px',
|
|
185
|
-
flexDirection: 'row', alignItems: 'center', position: 'relative', zIndex: theme.zIndex.NORMAL, background: 'none' }, typographyStyles),
|
|
178
|
+
flexDirection: 'row', alignItems: 'center', position: 'relative', zIndex: theme.zIndex.NORMAL, background: 'none' }, typographyStyles), leftIcon: leftIcon, rightIcon: ArrowDropDownIcon }, { children: currentOption ? renderOptionLabel(currentOption) : placeholder })), isOpen && (_jsx(ListBox, { id: listboxId, options: options, selected: value, focused: stagedOptionValue, selectOption: (option) => {
|
|
186
179
|
onSelectOption && onSelectOption(option.value);
|
|
187
180
|
close();
|
|
188
181
|
}, ref: refs.setFloating, renderOption: renderOption, sx: {
|
|
@@ -28,5 +28,5 @@ export const WithLabel = {
|
|
|
28
28
|
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(StatefulInput, { size: size.size, leftIcon: SearchIcon, label: "Search", placeholder: "Placeholder", sx: { mt: 2 } })] }))) })),
|
|
29
29
|
};
|
|
30
30
|
export const Inverted = {
|
|
31
|
-
render: () => (_jsx(Column, Object.assign({ sx: { backgroundColor: COLOR.BLACK, p: 2 } }, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD, sx: { color: COLOR.WHITE } }, { children: size.label })), _jsx(StatefulInput, { size: size.size, leftIcon: SearchIcon, placeholder: "Placeholder", label: "Search",
|
|
31
|
+
render: () => (_jsx(Column, Object.assign({ sx: { backgroundColor: COLOR.BLACK, p: 2 } }, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD, sx: { color: COLOR.WHITE } }, { children: size.label })), _jsx(StatefulInput, { inverted: true, size: size.size, leftIcon: SearchIcon, placeholder: "Placeholder", label: "Search", sx: { mt: 2 } })] }))) }))),
|
|
32
32
|
};
|
|
@@ -66,7 +66,7 @@ export const TextInput = React.forwardRef((_a, ref) => {
|
|
|
66
66
|
display, px: paddingX, backgroundColor: inverted ? COLOR.DARK_GRAY : COLOR.WHITE, borderRadius: '4px', flexDirection: 'row', position: 'relative', alignItems: 'center', ':hover': focusStyles, ':focus': focusStyles }, typographyStyles), sx) }, { children: [_jsx("fieldset", Object.assign({ sx: {
|
|
67
67
|
textAlign: 'left',
|
|
68
68
|
position: 'absolute',
|
|
69
|
-
inset: '-
|
|
69
|
+
inset: '-4px 0px 0px 0px',
|
|
70
70
|
margin: '0px',
|
|
71
71
|
padding: '0px 0.5rem',
|
|
72
72
|
pointerEvents: 'none',
|