@xqmsg/ui-core 0.14.4 → 0.15.0
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/input/StackedCheckbox/StackedCheckbox.d.ts +10 -0
- package/dist/components/input/StackedMultiSelect/index.d.ts +0 -1
- package/dist/components/input/StackedPilledInput/index.d.ts +0 -1
- package/dist/components/input/components/dropdown/index.d.ts +3 -1
- package/dist/theme/components/button.d.ts +10 -8
- package/dist/theme/components/input.d.ts +2 -0
- package/dist/theme/components/select.d.ts +2 -0
- package/dist/theme/components/table.d.ts +1 -0
- package/dist/theme/components/textarea.d.ts +3 -1
- package/dist/ui-core.cjs.development.js +336 -186
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +337 -187
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/banner/index.tsx +7 -15
- package/src/components/button/Button.stories.tsx +15 -5
- package/src/components/button/index.tsx +2 -2
- package/src/components/input/Input.stories.tsx +95 -47
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +27 -0
- package/src/components/input/StackedMultiSelect/index.tsx +187 -144
- package/src/components/input/StackedPilledInput/index.tsx +217 -225
- package/src/components/input/StackedSelect/StackedSelect.tsx +34 -2
- package/src/components/input/StackedSwitch/index.tsx +9 -1
- package/src/components/input/StackedTextarea/StackedTextarea.tsx +1 -1
- package/src/components/input/components/dropdown/index.tsx +23 -6
- package/src/components/input/components/token/index.tsx +11 -6
- package/src/components/input/index.tsx +5 -4
- package/src/components/table/index.tsx +2 -7
- package/src/theme/components/button.ts +10 -10
- package/src/theme/components/input.ts +1 -0
- package/src/theme/components/table.ts +1 -0
- package/src/theme/components/textarea.ts +4 -1
- package/dist/components/input/StackedCheckbox/StackedCheckboxGroup.d.ts +0 -10
- package/dist/components/input/StackedMultiSelect/components/MultiValue/index.d.ts +0 -10
- package/src/components/input/StackedCheckbox/StackedCheckboxGroup.tsx +0 -29
- package/src/components/input/StackedMultiSelect/components/MultiValue/index.tsx +0 -21
|
@@ -19,21 +19,26 @@ const Token: React.FC<TokenProps> = ({ label, onDelete }) => {
|
|
|
19
19
|
alignItems="center"
|
|
20
20
|
width="fit-content"
|
|
21
21
|
w="auto"
|
|
22
|
-
h="
|
|
23
|
-
pl="
|
|
24
|
-
pr="
|
|
22
|
+
h="16px"
|
|
23
|
+
pl="6px"
|
|
24
|
+
pr="2px"
|
|
25
25
|
py="2px"
|
|
26
26
|
position="relative"
|
|
27
27
|
>
|
|
28
|
-
<Text
|
|
28
|
+
<Text
|
|
29
|
+
whiteSpace="nowrap"
|
|
30
|
+
color={colors.label.primary.light}
|
|
31
|
+
fontSize="13px"
|
|
32
|
+
pr="4px"
|
|
33
|
+
>
|
|
29
34
|
{truncate(label.trim(), {
|
|
30
35
|
length: 15,
|
|
31
36
|
omission: '...',
|
|
32
37
|
})}
|
|
33
38
|
</Text>
|
|
34
39
|
<CloseIcon
|
|
35
|
-
width="
|
|
36
|
-
height="
|
|
40
|
+
width="11px"
|
|
41
|
+
height="11px"
|
|
37
42
|
onClick={onDelete}
|
|
38
43
|
cursor="pointer"
|
|
39
44
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import StackedCheckBox from './StackedCheckbox/StackedCheckbox';
|
|
3
3
|
import StackedInput from './StackedInput/StackedInput';
|
|
4
4
|
import StackedRadioGroup from './StackedRadio/StackedRadioGroup';
|
|
5
5
|
import StackedSelect from './StackedSelect/StackedSelect';
|
|
@@ -147,17 +147,18 @@ export function Input<T extends FieldValues>({
|
|
|
147
147
|
);
|
|
148
148
|
case 'checkbox':
|
|
149
149
|
return (
|
|
150
|
-
<
|
|
150
|
+
<StackedCheckBox
|
|
151
151
|
className={`input-${inputType} ${className ?? ''}`}
|
|
152
152
|
name={name}
|
|
153
153
|
id={name}
|
|
154
154
|
isInvalid={isInvalid}
|
|
155
|
-
options={options as FieldOptions}
|
|
156
155
|
onChange={onChange}
|
|
157
156
|
onBlur={onBlur}
|
|
158
157
|
ref={ref}
|
|
159
158
|
disabled={disabled}
|
|
160
159
|
value={value}
|
|
160
|
+
defaultValue={defaultValue}
|
|
161
|
+
label={label as string}
|
|
161
162
|
/>
|
|
162
163
|
);
|
|
163
164
|
case 'multi-select':
|
|
@@ -178,7 +179,6 @@ export function Input<T extends FieldValues>({
|
|
|
178
179
|
setError={setError as UseFormSetError<FieldValues>}
|
|
179
180
|
clearErrors={clearErrors as UseFormClearErrors<FieldValues>}
|
|
180
181
|
placeholder={placeholder}
|
|
181
|
-
maxLength={maxLength}
|
|
182
182
|
/>
|
|
183
183
|
);
|
|
184
184
|
case 'pilled-text':
|
|
@@ -212,6 +212,7 @@ export function Input<T extends FieldValues>({
|
|
|
212
212
|
onBlur={onBlur}
|
|
213
213
|
ref={ref}
|
|
214
214
|
value={value}
|
|
215
|
+
defaultValue={defaultValue}
|
|
215
216
|
/>
|
|
216
217
|
);
|
|
217
218
|
default:
|
|
@@ -44,15 +44,10 @@ export function Table<T extends ReadonlyTableColumns>({
|
|
|
44
44
|
const columnsAsConst = generateTableColumnsAsConst(columns);
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<TableContainer
|
|
48
|
-
border="none"
|
|
49
|
-
overflowX="auto"
|
|
50
|
-
bg="white"
|
|
51
|
-
width="fit-content"
|
|
52
|
-
>
|
|
47
|
+
<TableContainer border="none" overflowX="auto" bg="white" width="100%">
|
|
53
48
|
<ChakraTable
|
|
54
49
|
variant="unstyled"
|
|
55
|
-
width="
|
|
50
|
+
width="100%"
|
|
56
51
|
style={{
|
|
57
52
|
borderCollapse: 'separate',
|
|
58
53
|
borderSpacing: '0px',
|
|
@@ -3,13 +3,14 @@ import colors from '../foundations/colors';
|
|
|
3
3
|
|
|
4
4
|
const baseStyle = defineStyle({
|
|
5
5
|
borderRadius: '4px',
|
|
6
|
-
fontSize: '
|
|
6
|
+
fontSize: '13px',
|
|
7
7
|
bg: colors.fill.action,
|
|
8
8
|
color: colors.label.primary.dark,
|
|
9
|
+
border: 'none',
|
|
9
10
|
px: '8px',
|
|
10
11
|
py: '4px',
|
|
11
12
|
bgGradient: 'linear-gradient(#FFFFFF29, #FFFFFF00)',
|
|
12
|
-
shadow: '
|
|
13
|
+
shadow: '0.5px 0.5px 1px 1px #0000001A',
|
|
13
14
|
_disabled: {
|
|
14
15
|
backgroundColor: 'gray.100',
|
|
15
16
|
borderColor: 'gray.100',
|
|
@@ -25,21 +26,20 @@ const baseStyle = defineStyle({
|
|
|
25
26
|
bgGradient: colors.fill.light.quaternary,
|
|
26
27
|
},
|
|
27
28
|
_focus: {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
outline: `2px solid ${colors.border.focus}`,
|
|
30
|
+
outlineOffset: '0px',
|
|
30
31
|
},
|
|
31
32
|
});
|
|
32
33
|
|
|
33
|
-
const
|
|
34
|
+
const variantPrimary = () => {
|
|
34
35
|
return { ...baseStyle };
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
const
|
|
38
|
+
const variantSecondary = () => {
|
|
38
39
|
return {
|
|
39
40
|
...baseStyle,
|
|
40
41
|
color: colors.fill.action,
|
|
41
42
|
bg: colors.label.primary.dark,
|
|
42
|
-
border: 'none',
|
|
43
43
|
_hover: {
|
|
44
44
|
bg: colors.label.primary.dark,
|
|
45
45
|
},
|
|
@@ -55,12 +55,12 @@ const variantOutline = () => {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
const variants = {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
primary: variantPrimary(),
|
|
59
|
+
secondary: variantSecondary(),
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const defaultProps = {
|
|
63
|
-
|
|
63
|
+
variant: 'primary',
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
export default {
|
|
@@ -2,9 +2,12 @@ import Input from './input';
|
|
|
2
2
|
|
|
3
3
|
const baseStyle = {
|
|
4
4
|
...Input.baseStyle.field,
|
|
5
|
+
fontSize: '13px',
|
|
6
|
+
|
|
5
7
|
display: 'block', // Removes gap below textarea because it defaults to inline.
|
|
6
8
|
paddingY: '8px',
|
|
7
|
-
|
|
9
|
+
paddingX: '5px',
|
|
10
|
+
height: '78px',
|
|
8
11
|
lineHeight: 'short',
|
|
9
12
|
};
|
|
10
13
|
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldOptions, SelectFieldProps } from '../InputTypes';
|
|
3
|
-
export interface StackedCheckboxGroupProps extends SelectFieldProps {
|
|
4
|
-
options: FieldOptions;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* A functional React component utilized to render the `StackedCheckbox` component.
|
|
8
|
-
*/
|
|
9
|
-
declare const StackedCheckboxGroup: React.ForwardRefExoticComponent<StackedCheckboxGroupProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
-
export default StackedCheckboxGroup;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
interface MultiValueProps extends PropsWithChildren {
|
|
3
|
-
clearValue: () => void;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* A functional React Component utilized to render the custom `MultiValue` component for
|
|
7
|
-
* the `StackedMultiSelect` custom component.
|
|
8
|
-
*/
|
|
9
|
-
declare const MultiValue: React.FC<MultiValueProps>;
|
|
10
|
-
export default MultiValue;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Flex, InputGroup, Checkbox } from '@chakra-ui/react';
|
|
3
|
-
import { FieldOptions, SelectFieldProps } from '../InputTypes';
|
|
4
|
-
|
|
5
|
-
export interface StackedCheckboxGroupProps extends SelectFieldProps {
|
|
6
|
-
options: FieldOptions;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A functional React component utilized to render the `StackedCheckbox` component.
|
|
11
|
-
*/
|
|
12
|
-
const StackedCheckboxGroup = React.forwardRef<
|
|
13
|
-
HTMLInputElement,
|
|
14
|
-
StackedCheckboxGroupProps
|
|
15
|
-
>(({ options }, _ref) => {
|
|
16
|
-
return (
|
|
17
|
-
<InputGroup>
|
|
18
|
-
{options.map(option => (
|
|
19
|
-
<Flex mr="30px" alignItems="center" key={option.value}>
|
|
20
|
-
<Checkbox ref={_ref} value={option.value}>
|
|
21
|
-
{option.label}
|
|
22
|
-
</Checkbox>
|
|
23
|
-
</Flex>
|
|
24
|
-
))}
|
|
25
|
-
</InputGroup>
|
|
26
|
-
);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export default StackedCheckboxGroup;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Box } from '@chakra-ui/react';
|
|
2
|
-
import React, { PropsWithChildren } from 'react';
|
|
3
|
-
import InputTag from '../../../components/token';
|
|
4
|
-
|
|
5
|
-
interface MultiValueProps extends PropsWithChildren {
|
|
6
|
-
clearValue: () => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A functional React Component utilized to render the custom `MultiValue` component for
|
|
11
|
-
* the `StackedMultiSelect` custom component.
|
|
12
|
-
*/
|
|
13
|
-
const MultiValue: React.FC<MultiValueProps> = ({ children, clearValue }) => {
|
|
14
|
-
return (
|
|
15
|
-
<Box marginRight="5px">
|
|
16
|
-
<InputTag label={children} onDelete={clearValue} />
|
|
17
|
-
</Box>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default MultiValue;
|