@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,20 +1,16 @@
1
1
  import React from 'react';
2
- import { ButtonProps as ChakraButtonProps } from '@chakra-ui/react';
3
2
  import buttonTheme from '../../theme/components/button';
4
3
  export interface ButtonProps {
5
4
  text: string;
6
5
  onClick?: () => void;
6
+ width: 'variable' | 'fixed';
7
7
  variant?: keyof typeof buttonTheme.variants;
8
- colorScheme?: string;
9
- type: 'button' | 'submit' | 'reset' | undefined;
8
+ type?: 'button' | 'submit' | 'reset';
10
9
  ariaLabel: string;
11
- size?: 'sm' | 'md' | 'lg' | 'xs';
12
10
  disabled?: boolean;
13
11
  className?: string;
14
- style?: React.CSSProperties;
15
- width?: string | number;
16
12
  }
17
13
  /**
18
14
  * A functional React component utilized to render the `Button` component
19
15
  */
20
- export declare const Button: React.FC<ButtonProps & ChakraButtonProps>;
16
+ export declare const Button: React.FC<ButtonProps>;
@@ -3,6 +3,10 @@ import { InputProps } from '.';
3
3
  declare const meta: Meta<InputProps<StoryFormSchema>>;
4
4
  interface StoryFormSchema {
5
5
  prop?: string;
6
+ prop2?: string;
7
+ prop3?: string;
8
+ prop4?: string;
9
+ prop5?: string;
6
10
  }
7
11
  export default meta;
8
12
  export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, InputProps<StoryFormSchema>>;
@@ -8,10 +8,12 @@ export declare type FieldProps = {
8
8
  errorText?: string;
9
9
  };
10
10
  export declare type InputType = 'text' | 'select' | 'multi-select' | 'pilled-text' | 'textarea' | 'radio' | 'checkbox' | 'switch';
11
- export declare type FieldOptions = {
11
+ export declare type FieldOption = {
12
12
  label: string;
13
- value: string;
14
- }[];
13
+ value: string | 'section_header';
14
+ sortValue: number;
15
+ };
16
+ export declare type FieldOptions = FieldOption[];
15
17
  export interface ValidationProps {
16
18
  isRequired: boolean;
17
19
  isInvalid?: boolean;
@@ -1,10 +1,7 @@
1
1
  import React from 'react';
2
2
  import { InputFieldProps } from '../InputTypes';
3
3
  export interface StackedInputProps extends InputFieldProps {
4
- label?: string;
5
4
  isRequired?: boolean;
6
- leftElement?: React.ReactNode;
7
- rightElement?: React.ReactNode;
8
5
  }
9
6
  /**
10
7
  * A functional React component utilized to render the `StackedInput` component.
@@ -9,5 +9,5 @@ export interface StackedMultiSelectProps extends ReactSelectFieldProps {
9
9
  /**
10
10
  * A functional React component utilized to render the `StackedMultiSelect` component.
11
11
  */
12
- declare const StackedMultiSelect: React.ForwardRefExoticComponent<StackedMultiSelectProps & React.RefAttributes<HTMLSelectElement>>;
12
+ declare const StackedMultiSelect: React.ForwardRefExoticComponent<StackedMultiSelectProps & React.RefAttributes<HTMLInputElement>>;
13
13
  export default StackedMultiSelect;
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
- import { FieldOptions, SelectFieldProps } from '../InputTypes';
3
- export interface StackedSelectProps extends SelectFieldProps {
2
+ import { FieldOptions } from '../InputTypes';
3
+ import { StackedInputProps } from '../StackedInput/StackedInput';
4
+ import { UseFormSetValue, FieldValues, Control } from 'react-hook-form';
5
+ export interface StackedSelectProps extends StackedInputProps {
4
6
  options: FieldOptions;
7
+ setValue: UseFormSetValue<FieldValues>;
8
+ control: Control<FieldValues, any>;
5
9
  }
6
10
  /**
7
11
  * A functional React component utilized to render the `StackedSelect` component.
8
12
  */
9
- declare const StackedSelect: React.ForwardRefExoticComponent<StackedSelectProps & React.RefAttributes<HTMLSelectElement>>;
13
+ declare const StackedSelect: React.ForwardRefExoticComponent<StackedSelectProps & React.RefAttributes<HTMLInputElement>>;
10
14
  export default StackedSelect;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { FieldOption, FieldOptions } from '../../InputTypes';
3
+ export interface DropdownProps {
4
+ onSelectItem: (option: FieldOption) => void;
5
+ options: FieldOptions;
6
+ }
7
+ /**
8
+ * A functional React component utilized to render the `Dropdown` component
9
+ */
10
+ export declare const Dropdown: React.FC<DropdownProps>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface LabelProps {
3
+ label: string;
4
+ isRequired?: boolean;
5
+ }
6
+ /**
7
+ * A functional React component utilized to render the `Label` component
8
+ */
9
+ export declare const Label: React.FC<LabelProps>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { TokenProps } from '.';
3
+ declare const meta: Meta<TokenProps>;
4
+ export default meta;
5
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, TokenProps>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface TokenProps {
3
+ label: any;
4
+ onDelete: any;
5
+ }
6
+ declare const Token: React.FC<TokenProps>;
7
+ export default Token;
@@ -12,8 +12,6 @@ export interface InputProps<T extends FieldValues> extends ValidationProps {
12
12
  options?: FieldOptions;
13
13
  maxLength?: number;
14
14
  helperText?: React.ReactNode;
15
- leftElement?: React.ReactNode;
16
- rightElement?: React.ReactNode;
17
15
  control?: Control<T, any>;
18
16
  onChange?: (args?: any) => void;
19
17
  disabled?: boolean;
@@ -23,4 +21,4 @@ export interface InputProps<T extends FieldValues> extends ValidationProps {
23
21
  * A functional React component utilized to render the `Input` component. Utilizes a switch statement
24
22
  * to render the correct input based on the `inputType`.
25
23
  */
26
- export declare function Input<T extends FieldValues>({ inputType, label, ariaLabel, className, placeholder, name, helperText, leftElement, rightElement, options, isInvalid, errorText, isRequired, maxLength, defaultValue, control, disabled, onChange, setValue, }: InputProps<T>): JSX.Element;
24
+ export declare function Input<T extends FieldValues>({ inputType, label, ariaLabel, className, placeholder, name, helperText, options, isInvalid, errorText, isRequired, maxLength, defaultValue, control, disabled, onChange, setValue, }: InputProps<T>): JSX.Element;
@@ -1,231 +1,92 @@
1
- declare type Dict = Record<string, any>;
2
- declare function variantGhost(props: Dict): {
3
- color: string;
4
- _hover: {
5
- bg: string;
6
- };
7
- _active: {
8
- bg: string;
9
- };
10
- _focus: {
11
- boxShadow: string;
12
- };
13
- bg?: undefined;
14
- } | {
15
- color: string;
16
- bg: string;
17
- _hover: {
18
- bg: string;
19
- };
20
- _active: {
21
- bg: string;
22
- };
23
- _focus: {
24
- boxShadow: string;
25
- };
26
- };
27
- declare function variantOutline(props: Dict): {
28
- color: string;
29
- _hover: {
30
- bg: string;
31
- };
32
- _active: {
33
- bg: string;
34
- };
35
- _focus: {
36
- boxShadow: string;
37
- };
38
- bg?: undefined;
39
- border: string;
40
- borderColor: string;
41
- } | {
42
- color: string;
43
- bg: string;
44
- _hover: {
45
- bg: string;
46
- };
47
- _active: {
48
- bg: string;
49
- };
50
- _focus: {
51
- boxShadow: string;
52
- };
53
- border: string;
54
- borderColor: string;
55
- };
56
- declare function variantSolid(props: Dict): {
57
- color: string;
58
- bg: string;
59
- _hover: {
60
- bg: string;
61
- };
62
- _active: {
63
- bg: string;
64
- };
65
- _focus?: undefined;
66
- } | {
67
- bg: string;
68
- color: string;
69
- _hover: {
70
- bg: string;
71
- };
72
- _active: {
1
+ declare const _default: {
2
+ baseStyle: {
3
+ borderRadius: string;
4
+ fontSize: string;
73
5
  bg: string;
74
- };
75
- _focus: {
76
- boxShadow: string;
77
- };
78
- };
79
- /**
80
- * A variant that displays a solid variant when an active CSS class is
81
- * detected, otherwise display a ghost variant. This is useful for pill nav filters.
82
- */
83
- declare function variantActiveSolid(props: Dict): {
84
- '&.active': {
85
6
  color: string;
86
- bg: string;
87
- _hover: {
88
- bg: string;
89
- };
90
- _active: {
91
- bg: string;
7
+ px: string;
8
+ py: string;
9
+ bgGradient: string;
10
+ shadow: string;
11
+ _disabled: {
12
+ backgroundColor: string;
13
+ borderColor: string;
14
+ color: string;
15
+ pointerEvents: string;
92
16
  };
93
- _focus?: undefined;
94
- } | {
95
- bg: string;
96
- color: string;
97
17
  _hover: {
98
18
  bg: string;
99
19
  };
100
20
  _active: {
21
+ color: string;
101
22
  bg: string;
23
+ bgGradient: string;
102
24
  };
103
25
  _focus: {
104
- boxShadow: string;
105
- };
106
- };
107
- color: string;
108
- _hover: {
109
- bg: string;
110
- };
111
- _active: {
112
- bg: string;
113
- };
114
- _focus: {
115
- boxShadow: string;
116
- };
117
- bg?: undefined;
118
- } | {
119
- '&.active': {
120
- color: string;
121
- bg: string;
122
- _hover: {
123
- bg: string;
124
- };
125
- _active: {
126
26
  bg: string;
127
- };
128
- _focus?: undefined;
129
- } | {
130
- bg: string;
131
- color: string;
132
- _hover: {
133
- bg: string;
134
- };
135
- _active: {
136
- bg: string;
137
- };
138
- _focus: {
139
- boxShadow: string;
140
- };
141
- };
142
- color: string;
143
- bg: string;
144
- _hover: {
145
- bg: string;
146
- };
147
- _active: {
148
- bg: string;
149
- };
150
- _focus: {
151
- boxShadow: string;
152
- };
153
- };
154
- declare function variantLink(props: Dict): {
155
- padding: number;
156
- height: string;
157
- lineHeight: string;
158
- color: string;
159
- _hover: {
160
- textDecoration: string;
161
- };
162
- _active: {
163
- color: string;
164
- };
165
- };
166
- declare const _default: {
167
- baseStyle: {
168
- lineHeight: number;
169
- borderRadius: string;
170
- fontWeight: string;
171
- _focus: {
172
- boxShadow: string;
173
- };
174
- _disabled: {
175
- opacity: number;
176
- cursor: string;
177
- boxShadow: string;
27
+ border: string;
178
28
  };
179
29
  };
180
30
  variants: {
181
- ghost: typeof variantGhost;
182
- outline: typeof variantOutline;
183
- solid: typeof variantSolid;
184
- activeSolid: typeof variantActiveSolid;
185
- link: typeof variantLink;
186
- unstyled: {
187
- bg: string;
188
- color: string;
189
- display: string;
190
- lineHeight: string;
191
- m: number;
192
- p: number;
193
- };
194
- };
195
- sizes: {
196
- lg: {
197
- borderRadius: string;
198
- h: number;
199
- minW: number;
200
- fontSize: string;
201
- px: number;
202
- };
203
- md: {
204
- borderRadius: string;
205
- h: number;
206
- minW: number;
207
- fontSize: string;
208
- px: number;
209
- };
210
- sm: {
31
+ solid: {
211
32
  borderRadius: string;
212
- h: number;
213
- minW: number;
214
33
  fontSize: string;
215
- px: number;
216
- };
217
- xs: {
34
+ bg: string;
35
+ color: string;
36
+ px: string;
37
+ py: string;
38
+ bgGradient: string;
39
+ shadow: string;
40
+ _disabled: {
41
+ backgroundColor: string;
42
+ borderColor: string;
43
+ color: string;
44
+ pointerEvents: string;
45
+ };
46
+ _hover: {
47
+ bg: string;
48
+ };
49
+ _active: {
50
+ color: string;
51
+ bg: string;
52
+ bgGradient: string;
53
+ };
54
+ _focus: {
55
+ bg: string;
56
+ border: string;
57
+ };
58
+ };
59
+ outline: {
60
+ color: string;
61
+ bg: string;
62
+ border: string;
63
+ _hover: {
64
+ bg: string;
65
+ };
66
+ _active: {
67
+ color: string;
68
+ bg: string;
69
+ bgGradient: string;
70
+ };
71
+ _focus: {
72
+ bg: string;
73
+ };
218
74
  borderRadius: string;
219
- h: number;
220
- minW: number;
221
75
  fontSize: string;
222
- px: number;
76
+ px: string;
77
+ py: string;
78
+ bgGradient: string;
79
+ shadow: string;
80
+ _disabled: {
81
+ backgroundColor: string;
82
+ borderColor: string;
83
+ color: string;
84
+ pointerEvents: string;
85
+ };
223
86
  };
224
87
  };
225
88
  defaultProps: {
226
- variant: string;
227
- size: string;
228
- colorScheme: string;
89
+ solid: string;
229
90
  };
230
91
  };
231
92
  export default _default;
@@ -1,14 +1,14 @@
1
1
  declare const _default: {
2
2
  parts: string[];
3
- baseStyle: (props: Record<string, any>) => {
3
+ baseStyle: () => {
4
4
  text: {
5
5
  color: string;
6
6
  mt: number;
7
- lineHeight: string;
7
+ ml: number;
8
8
  fontSize: string;
9
9
  };
10
10
  icon: {
11
- mr: string;
11
+ ml: number;
12
12
  color: string;
13
13
  };
14
14
  };
@@ -1,15 +1,13 @@
1
1
  declare const _default: {
2
2
  baseStyle: {
3
3
  fontSize: string;
4
- mr: number;
4
+ position: string;
5
+ top: number;
6
+ display: string;
7
+ ml: number;
5
8
  mb: number;
6
- fontWeight: string;
7
9
  color: string;
8
- transition: string;
9
10
  opacity: number;
10
- _disabled: {
11
- opacity: number;
12
- };
13
11
  };
14
12
  };
15
13
  export default _default;
@@ -1,14 +1,14 @@
1
1
  declare const _default: {
2
2
  parts: string[];
3
- baseStyle: (props: Record<string, any>) => {
3
+ baseStyle: () => {
4
4
  requiredIndicator: {
5
5
  ml: number;
6
6
  color: string;
7
7
  };
8
8
  helperText: {
9
- mt: number;
10
9
  color: string;
11
- lineHeight: string;
10
+ mt: number;
11
+ ml: number;
12
12
  fontSize: string;
13
13
  };
14
14
  };