@xqmsg/ui-core 0.9.3 → 0.11.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.
Files changed (67) hide show
  1. package/dist/components/button/index.d.ts +3 -7
  2. package/dist/components/input/Input.stories.d.ts +4 -0
  3. package/dist/components/input/InputTypes.d.ts +5 -3
  4. package/dist/components/input/StackedInput/StackedInput.d.ts +0 -3
  5. package/dist/components/input/StackedMultiSelect/index.d.ts +1 -1
  6. package/dist/components/input/StackedSelect/StackedSelect.d.ts +7 -3
  7. package/dist/components/input/components/dropdown/index.d.ts +10 -0
  8. package/dist/components/input/components/label/index.d.ts +9 -0
  9. package/dist/components/input/components/token/Token.stories.d.ts +5 -0
  10. package/dist/components/input/components/token/index.d.ts +7 -0
  11. package/dist/components/input/index.d.ts +1 -3
  12. package/dist/theme/components/button.d.ts +68 -207
  13. package/dist/theme/components/form-error.d.ts +3 -3
  14. package/dist/theme/components/form-label.d.ts +4 -6
  15. package/dist/theme/components/form.d.ts +3 -3
  16. package/dist/theme/components/input.d.ts +32 -161
  17. package/dist/theme/components/select.d.ts +27 -153
  18. package/dist/theme/components/textarea.d.ts +10 -117
  19. package/dist/theme/foundations/colors.d.ts +68 -16
  20. package/dist/ui-core.cjs.development.js +594 -860
  21. package/dist/ui-core.cjs.development.js.map +1 -1
  22. package/dist/ui-core.cjs.production.min.js +1 -1
  23. package/dist/ui-core.cjs.production.min.js.map +1 -1
  24. package/dist/ui-core.esm.js +598 -864
  25. package/dist/ui-core.esm.js.map +1 -1
  26. package/package.json +1 -2
  27. package/src/components/banner/index.tsx +7 -1
  28. package/src/components/button/Button.stories.tsx +19 -7
  29. package/src/components/button/index.tsx +7 -19
  30. package/src/components/button/spinner/index.tsx +2 -7
  31. package/src/components/input/Input.stories.tsx +60 -58
  32. package/src/components/input/InputTypes.ts +7 -1
  33. package/src/components/input/StackedInput/StackedInput.tsx +3 -15
  34. package/src/components/input/StackedMultiSelect/components/MultiValue/index.tsx +2 -2
  35. package/src/components/input/StackedMultiSelect/index.tsx +88 -92
  36. package/src/components/input/StackedPilledInput/index.tsx +139 -56
  37. package/src/components/input/StackedSelect/StackedSelect.tsx +63 -20
  38. package/src/components/input/StackedSelect/assets/svg/subtract.svg +3 -0
  39. package/src/components/input/components/dropdown/index.tsx +80 -0
  40. package/src/components/input/components/label/index.tsx +24 -0
  41. package/src/components/input/components/token/Token.stories.tsx +22 -0
  42. package/src/components/input/components/token/assets/svg/close.svg +3 -0
  43. package/src/components/input/components/token/index.tsx +37 -0
  44. package/src/components/input/index.tsx +7 -20
  45. package/src/components/loading/index.tsx +1 -1
  46. package/src/components/table/Table.stories.tsx +9 -1
  47. package/src/components/table/index.tsx +1 -1
  48. package/src/components/table/loading/index.tsx +2 -2
  49. package/src/components/tabs/index.tsx +1 -1
  50. package/src/components/text/index.tsx +1 -1
  51. package/src/theme/components/alert.ts +4 -4
  52. package/src/theme/components/button.ts +45 -186
  53. package/src/theme/components/form-error.ts +11 -14
  54. package/src/theme/components/form-label.ts +8 -8
  55. package/src/theme/components/form.ts +10 -13
  56. package/src/theme/components/input.ts +17 -191
  57. package/src/theme/components/link.ts +2 -1
  58. package/src/theme/components/select.ts +5 -10
  59. package/src/theme/components/tabs.ts +3 -3
  60. package/src/theme/components/textarea.ts +2 -38
  61. package/src/theme/customXQChakraTheme.ts +0 -2
  62. package/src/theme/foundations/colors.ts +31 -10
  63. package/src/theme/foundations/shadows.ts +3 -3
  64. package/dist/components/input/components/InputTag/index.d.ts +0 -7
  65. package/dist/theme/components/menu.d.ts +0 -48
  66. package/src/components/input/components/InputTag/index.tsx +0 -24
  67. package/src/theme/components/menu.ts +0 -70
@@ -1,14 +1,10 @@
1
- import { mode } from '@chakra-ui/theme-tools';
2
1
  import Input from './input';
3
2
 
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- type Dict = Record<string, any>;
6
-
7
- const { sizes, defaultProps, variants } = Input;
3
+ const { defaultProps, variants } = Input;
8
4
 
9
5
  const parts = ['field', 'icon'];
10
6
 
11
- function baseStyleField(props: Dict) {
7
+ function baseStyleField() {
12
8
  return {
13
9
  ...Input.baseStyle.field,
14
10
  appearance: 'none',
@@ -16,7 +12,7 @@ function baseStyleField(props: Dict) {
16
12
  lineHeight: 'normal',
17
13
  bg: 'white',
18
14
  '> option': {
19
- bg: mode('white', 'gray.700')(props),
15
+ // bg: mode('white', 'gray.700')(props),
20
16
  },
21
17
  };
22
18
  }
@@ -27,15 +23,14 @@ const baseStyleInput = {
27
23
  _disabled: { opacity: 0.5 },
28
24
  };
29
25
 
30
- const baseStyle = (props: Dict) => ({
31
- field: baseStyleField(props),
26
+ const baseStyle = () => ({
27
+ field: baseStyleField(),
32
28
  icon: baseStyleInput,
33
29
  });
34
30
 
35
31
  export default {
36
32
  parts,
37
33
  baseStyle,
38
- sizes,
39
34
  variants,
40
35
  defaultProps,
41
36
  };
@@ -206,12 +206,12 @@ const variantSimple = {
206
206
  position: 'relative',
207
207
  borderColor: 'transparent',
208
208
  '&.active': {
209
- color: colors.blue[500],
209
+ color: colors.fill.action,
210
210
  bg: 'transparent',
211
- borderBottom: '1px solid blue.500',
211
+ borderBottom: `1px solid ${colors.fill.action}`,
212
212
  },
213
213
  _selected: {
214
- color: colors.blue[500],
214
+ color: colors.fill.action,
215
215
  bg: 'transparent',
216
216
  _after: {
217
217
  content: '""',
@@ -1,54 +1,18 @@
1
1
  import Input from './input';
2
2
 
3
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
- type Dict = Record<string, any>;
5
-
6
3
  const baseStyle = {
7
4
  ...Input.baseStyle.field,
8
5
  display: 'block', // Removes gap below textarea because it defaults to inline.
9
6
  paddingY: '8px',
10
- minHeight: '80px',
7
+ height: '80px',
11
8
  lineHeight: 'short',
12
9
  };
13
10
 
14
- const codeVariant = (props: Dict) => {
15
- const { _focus } = Input.variants.outline(props).field;
16
- return {
17
- bg: 'blue.900',
18
- color: 'white',
19
- fontFamily: 'mono',
20
- fontSize: 'sm',
21
- border: '1px',
22
- borderColor: 'blue.900',
23
- borderRadius: 'lg',
24
- p: 6,
25
- wordBreak: 'break-all',
26
- _focus,
27
- };
28
- };
29
-
30
- const variants = {
31
- outline: (props: Dict) => Input.variants.outline(props).field,
32
- flushed: (props: Dict) => Input.variants.flushed(props).field,
33
- filled: (props: Dict) => Input.variants.filled(props).field,
34
- code: (props: Dict) => codeVariant(props),
35
- unstyled: Input.variants.unstyled.field,
36
- };
37
-
38
- const sizes = {
39
- sm: Input.sizes.sm.field,
40
- md: Input.sizes.md.field,
41
- lg: Input.sizes.lg.field,
42
- };
43
-
44
11
  const defaultProps = {
45
- size: 'lg',
46
- variant: 'outline',
12
+ variant: 'default',
47
13
  };
48
14
 
49
15
  export default {
50
16
  baseStyle,
51
- sizes,
52
- variants,
53
17
  defaultProps,
54
18
  };
@@ -12,7 +12,6 @@ import FormError from './components/form-error';
12
12
  import FormLabel from './components/form-label';
13
13
  import Input from './components/input';
14
14
  import Link from './components/link';
15
- import Menu from './components/menu';
16
15
  import Modal from './components/modal';
17
16
  import Select from './components/select';
18
17
  import Switch from './components/switch';
@@ -36,7 +35,6 @@ const customXQChakraTheme = extendTheme({
36
35
  FormLabel,
37
36
  Input,
38
37
  Link,
39
- Menu,
40
38
  Modal,
41
39
  Select,
42
40
  Switch,
@@ -63,18 +63,42 @@ const green: ColorHues = {
63
63
  900: 'hsl(138, 42%, 6%)',
64
64
  };
65
65
 
66
- const aliases: Record<string, ColorHues> = {
67
- primary: blue,
68
- success: green,
69
- warning: orange,
70
- danger: red,
71
- };
72
-
73
66
  const label = {
74
67
  primary: { light: '#000000', dark: '#FFFFFF' },
68
+ secondary: { light: '#3C3C4399' },
69
+ error: '#FF0000',
70
+ };
71
+
72
+ const border = {
73
+ focus: '#3A6CD980',
74
+ default: '#9999991A',
75
+ };
76
+
77
+ const fill = {
78
+ light: {
79
+ primary: '#74748033',
80
+ secondary: '#74748029',
81
+ tertiary: '#7474801F',
82
+ quaternary: ':#7474800D',
83
+ },
84
+ success: '#d8f1b8',
85
+ error: '#ffbdb9',
86
+ warning: '#ffefb4',
87
+ action: '#0082ff',
88
+ };
89
+
90
+ const semantic = {
91
+ action: '#488ef7',
92
+ success: '#5fcf65',
93
+ warning: '#f8c352',
94
+ error: '#f96057',
75
95
  };
76
96
 
77
97
  const colors = {
98
+ label,
99
+ border,
100
+ fill,
101
+ semantic,
78
102
  transparent: 'transparent',
79
103
  current: 'currentColor',
80
104
  black: '#000000',
@@ -83,9 +107,6 @@ const colors = {
83
107
  coolGray: '#F6F7FB',
84
108
  darkBlue: '#292f4c',
85
109
  backdrop: '#fbfcff',
86
- ...aliases,
87
- label,
88
-
89
110
  whiteAlpha: {
90
111
  50: 'rgba(255, 255, 255, 0.04)',
91
112
  100: 'rgba(255, 255, 255, 0.06)',
@@ -9,9 +9,9 @@ const shadows = {
9
9
  xl:
10
10
  '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
11
11
  '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
12
- insetOutline: `inset 0 0 0 2px ${colors.blue[200]}`,
13
- outline: `0 0 0 2px ${colors.blue[200]}`,
14
- outlineDanger600: `0 0 0 2px ${colors.red[600]}`,
12
+ insetOutline: `inset 0 0 0 2px ${colors.fill.action}`,
13
+ outline: `0 0 0 2px ${colors.fill.action}`,
14
+ outlineDanger600: `0 0 0 2px ${colors.fill.error}`,
15
15
  inner: 'inset 0 2px 4px 0 rgba(0,0,0,0.06)',
16
16
  none: 'none',
17
17
  'dark-lg':
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface InputTagProps {
3
- value: any;
4
- onDelete?: any;
5
- }
6
- declare const InputTag: React.FC<InputTagProps>;
7
- export default InputTag;
@@ -1,48 +0,0 @@
1
- declare const _default: {
2
- parts: string[];
3
- baseStyle: (props: Record<string, any>) => {
4
- list: {
5
- bg: string;
6
- boxShadow: string;
7
- color: string;
8
- minW: string;
9
- py: number;
10
- zIndex: string;
11
- borderRadius: string;
12
- borderWidth: number;
13
- overflow: string;
14
- };
15
- item: {
16
- fontSize: string;
17
- py: number;
18
- px: number;
19
- transition: string;
20
- _focus: {
21
- bg: string;
22
- };
23
- _hover: {
24
- bg: string;
25
- };
26
- _active: {
27
- bg: string;
28
- };
29
- _expanded: {
30
- bg: string;
31
- };
32
- _disabled: {
33
- opacity: number;
34
- cursor: string;
35
- };
36
- };
37
- groupTitle: {
38
- mx: number;
39
- my: number;
40
- fontWeight: string;
41
- fontSize: string;
42
- };
43
- command: {
44
- opacity: number;
45
- };
46
- };
47
- };
48
- export default _default;
@@ -1,24 +0,0 @@
1
- import { Tag, TagCloseButton, TagLabel } from '@chakra-ui/react';
2
- import React from 'react';
3
-
4
- interface InputTagProps {
5
- value: any;
6
- onDelete?: any;
7
- }
8
-
9
- const InputTag: React.FC<InputTagProps> = ({ value, onDelete }) => {
10
- return (
11
- <Tag
12
- size={'md'}
13
- key={value}
14
- borderRadius="full"
15
- variant="solid"
16
- backgroundColor="#eeeeee"
17
- >
18
- <TagLabel color={'gray.700'}>{value}</TagLabel>
19
- {onDelete && <TagCloseButton color={'gray.700'} onClick={onDelete} />}
20
- </Tag>
21
- );
22
- };
23
-
24
- export default InputTag;
@@ -1,70 +0,0 @@
1
- import { mode } from '@chakra-ui/theme-tools';
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
- type Dict = Record<string, any>;
5
-
6
- const parts = ['item', 'command', 'list', 'button', 'groupTitle'];
7
-
8
- function baseStyleList(props: Dict) {
9
- return {
10
- bg: mode(`#fff`, `gray.700`)(props),
11
- boxShadow: mode(`2xl`, `dark-lg`)(props),
12
- color: 'inherit',
13
- minW: '3xs',
14
- py: 2,
15
- zIndex: 'docked',
16
- borderRadius: 'md',
17
- borderWidth: 0,
18
- overflow: 'hidden',
19
- };
20
- }
21
-
22
- function baseStyleItem(props: Dict) {
23
- return {
24
- fontSize: 'sm',
25
- py: 2,
26
- px: 4,
27
- transition: 'background 50ms ease-in 0s',
28
- _focus: {
29
- bg: mode(`blue.50`, `whiteAlpha.200`)(props),
30
- },
31
- _hover: {
32
- bg: mode(`blue.50`, `whiteAlpha.200`)(props),
33
- },
34
- _active: {
35
- bg: mode(`gray.200`, `whiteAlpha.200`)(props),
36
- },
37
- _expanded: {
38
- bg: mode(`gray.100`, `whiteAlpha.100`)(props),
39
- },
40
- _disabled: {
41
- opacity: 0.4,
42
- cursor: 'not-allowed',
43
- },
44
- };
45
- }
46
-
47
- const baseStyleGroupTitle = {
48
- mx: 4,
49
- my: 2,
50
- fontWeight: 'semibold',
51
- fontSize: 'sm',
52
- };
53
-
54
- const baseStyleCommand = {
55
- opacity: 0.6,
56
- };
57
-
58
- const baseStyle = (props: Dict) => {
59
- return {
60
- list: baseStyleList(props),
61
- item: baseStyleItem(props),
62
- groupTitle: baseStyleGroupTitle,
63
- command: baseStyleCommand,
64
- };
65
- };
66
-
67
- export default {
68
- parts,
69
- baseStyle,
70
- };