@ctlyst.id/internal-ui 1.1.0-canary.0 → 1.1.0-canary.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/components/alert/__stories__/alert.stories.d.ts +14 -0
- package/dist/components/alert/components/alert-action.d.ts +6 -0
- package/dist/components/alert/components/alert-close.d.ts +6 -0
- package/dist/components/alert/components/alert-context.d.ts +29 -0
- package/dist/components/alert/components/alert-description.d.ts +3 -0
- package/dist/components/alert/components/alert-icon.d.ts +6 -0
- package/dist/components/alert/components/alert-title.d.ts +3 -0
- package/dist/components/alert/components/alert.d.ts +25 -0
- package/dist/components/alert/components/icons.d.ts +3 -0
- package/dist/components/alert/components/index.d.ts +14 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/{base/__stories__/button.stories.d.ts → badge/__stories__/badge.stories.d.ts} +1 -1
- package/dist/components/badge/components/badge.d.ts +11 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/button/__stories__/button.stories.d.ts +14 -0
- package/dist/components/button/components/button.d.ts +4 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/checkbox/__stories__/checkbox-group.stories.d.ts +13 -0
- package/dist/components/checkbox/components/checkbox-group.d.ts +18 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/chips/__stories__/chips.stories.d.ts +12 -0
- package/dist/components/chips/components/chips.d.ts +19 -0
- package/dist/components/chips/index.d.ts +2 -0
- package/dist/components/field/components/field.d.ts +0 -1
- package/dist/components/field/index.d.ts +0 -4
- package/dist/components/form/__stories__/input.stories.d.ts +14 -0
- package/dist/components/form/__stories__/textarea.stories.d.ts +10 -0
- package/dist/components/form/components/input-addon.d.ts +7 -0
- package/dist/components/{field → form}/components/input-field.d.ts +4 -1
- package/dist/components/{field/components/textarea-field.d.ts → form/components/textarea.d.ts} +2 -6
- package/dist/components/form/index.d.ts +4 -0
- package/dist/components/form/styles/input-field.d.ts +4 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/layouting/components/box.d.ts +4 -0
- package/dist/components/layouting/components/container.d.ts +4 -0
- package/dist/components/layouting/components/flex.d.ts +4 -0
- package/dist/components/layouting/components/grid.d.ts +4 -0
- package/dist/components/layouting/components/stack.d.ts +4 -0
- package/dist/components/layouting/components/wrap.d.ts +4 -0
- package/dist/components/layouting/index.d.ts +12 -0
- package/dist/components/radio/__stories__/radio-group.stories.d.ts +13 -0
- package/dist/components/radio/__stories__/radio.stories.d.ts +12 -0
- package/dist/components/radio/components/radio-group.d.ts +17 -0
- package/dist/components/radio/components/radio.d.ts +16 -0
- package/dist/components/radio/index.d.ts +4 -0
- package/dist/components/rating/__stories__/rating.stories.d.ts +10 -0
- package/dist/components/rating/components/rating.d.ts +6 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/switch/__stories__/switch.stories.d.ts +13 -0
- package/dist/components/switch/components/switch.d.ts +18 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/text/components/text.d.ts +4 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/config/theme/components/alert.d.ts +79 -0
- package/dist/config/theme/components/checkbox.d.ts +2 -1
- package/dist/config/theme/components/chips.d.ts +30 -0
- package/dist/config/theme/components/index.d.ts +2 -0
- package/dist/config/theme/components/input.d.ts +8 -21
- package/dist/config/theme/components/radio.d.ts +98 -2
- package/dist/config/theme/components/switch.d.ts +43 -9
- package/dist/config/theme/components/textarea.d.ts +54 -2
- package/dist/config/theme/themeConfiguration.d.ts +4 -2
- package/dist/internal-ui.cjs.development.js +1117 -335
- package/dist/internal-ui.cjs.development.js.map +1 -1
- package/dist/internal-ui.cjs.production.min.js +9 -9
- package/dist/internal-ui.cjs.production.min.js.map +1 -1
- package/dist/internal-ui.esm.js +1112 -343
- package/dist/internal-ui.esm.js.map +1 -1
- package/dist/provider/components/provider.d.ts +0 -1
- package/package.json +12 -11
- package/dist/components/base/__stories__/input.stories.d.ts +0 -16
- package/dist/components/base/__stories__/radio.stories.d.ts +0 -15
@@ -15,15 +15,16 @@ var classnames = _interopDefault(require('classnames'));
|
|
15
15
|
var ReactDatePicker = _interopDefault(require('react-datepicker'));
|
16
16
|
var system = require('@chakra-ui/system');
|
17
17
|
var styled = _interopDefault(require('@emotion/styled'));
|
18
|
+
var internalIcon = require('@ctlyst.id/internal-icon');
|
18
19
|
var ReactSelect = _interopDefault(require('react-select'));
|
19
20
|
var reactSelectAsyncPaginate = require('react-select-async-paginate');
|
20
21
|
var ReactSelectAsyncCreatable = _interopDefault(require('react-select/async-creatable'));
|
21
22
|
var ReactSelectCreatable = _interopDefault(require('react-select/creatable'));
|
23
|
+
var sharedUtils = require('@chakra-ui/shared-utils');
|
22
24
|
var reactDropzone = require('react-dropzone');
|
23
|
-
var themeTools = require('@chakra-ui/theme-tools');
|
24
|
-
var styledSystem = require('@chakra-ui/styled-system');
|
25
25
|
var anatomy = require('@chakra-ui/anatomy');
|
26
|
-
require('@
|
26
|
+
var styledSystem = require('@chakra-ui/styled-system');
|
27
|
+
var themeTools = require('@chakra-ui/theme-tools');
|
27
28
|
var axios = _interopDefault(require('axios'));
|
28
29
|
|
29
30
|
/* eslint-disable react-hooks/rules-of-hooks */
|
@@ -121,6 +122,41 @@ BreadCrumb.defaultProps = {
|
|
121
122
|
spacing: 2
|
122
123
|
};
|
123
124
|
|
125
|
+
const Loader = /*#__PURE__*/react.forwardRef((props, ref) => {
|
126
|
+
const styles = react.useStyleConfig('LoaderStyle', props);
|
127
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
128
|
+
ref: ref,
|
129
|
+
__css: styles
|
130
|
+
});
|
131
|
+
});
|
132
|
+
|
133
|
+
const Button = props => {
|
134
|
+
const {
|
135
|
+
children,
|
136
|
+
variant,
|
137
|
+
size,
|
138
|
+
...rest
|
139
|
+
} = props;
|
140
|
+
const getLoaderSize = () => {
|
141
|
+
if (size === 'lg') return 'md';
|
142
|
+
if (size === 'md') return 'sm';
|
143
|
+
return 'xs';
|
144
|
+
};
|
145
|
+
const getLoaderColor = () => {
|
146
|
+
if (variant === 'primary' || variant === 'danger') return 'white';
|
147
|
+
if (variant === 'outline-danger') return 'danger';
|
148
|
+
return 'primary';
|
149
|
+
};
|
150
|
+
return /*#__PURE__*/React__default.createElement(react.Button, Object.assign({
|
151
|
+
size: size,
|
152
|
+
variant: variant,
|
153
|
+
spinner: /*#__PURE__*/React__default.createElement(Loader, {
|
154
|
+
size: getLoaderSize(),
|
155
|
+
color: getLoaderColor()
|
156
|
+
})
|
157
|
+
}, rest), children);
|
158
|
+
};
|
159
|
+
|
124
160
|
const CardCustom = /*#__PURE__*/React.forwardRef(({
|
125
161
|
children,
|
126
162
|
...rest
|
@@ -152,12 +188,10 @@ function CheckboxComponent({
|
|
152
188
|
variant: variant
|
153
189
|
}, rest, {
|
154
190
|
isDisabled: isDisabled
|
155
|
-
})
|
156
|
-
ml: "8px"
|
157
|
-
}, /*#__PURE__*/React__default.createElement(react.Text, {
|
191
|
+
}), children && /*#__PURE__*/React__default.createElement(react.Text, {
|
158
192
|
textStyle: "text.sm",
|
159
193
|
color: isDisabled ? 'black.low' : 'black.high'
|
160
|
-
}, children)))
|
194
|
+
}, children))), /*#__PURE__*/React__default.createElement(react.Box, {
|
161
195
|
mt: "5px",
|
162
196
|
ml: "24px"
|
163
197
|
}, isError ? /*#__PURE__*/React__default.createElement(react.Text, {
|
@@ -165,7 +199,7 @@ function CheckboxComponent({
|
|
165
199
|
color: "danger.500"
|
166
200
|
}, errorText) : /*#__PURE__*/React__default.createElement(react.Text, {
|
167
201
|
textStyle: "text.xs",
|
168
|
-
color:
|
202
|
+
color: "black.medium"
|
169
203
|
}, helpText)));
|
170
204
|
}
|
171
205
|
CheckboxComponent.defaultProps = {
|
@@ -174,6 +208,95 @@ CheckboxComponent.defaultProps = {
|
|
174
208
|
errorText: ''
|
175
209
|
};
|
176
210
|
|
211
|
+
/* eslint-disable no-nested-ternary */
|
212
|
+
const Field = props => {
|
213
|
+
const {
|
214
|
+
label,
|
215
|
+
isError,
|
216
|
+
errorMessage,
|
217
|
+
leftHelperText,
|
218
|
+
rightHelperText,
|
219
|
+
isRequired,
|
220
|
+
children,
|
221
|
+
isSuccess
|
222
|
+
} = props;
|
223
|
+
const getHelperColor = () => {
|
224
|
+
if (isError) return 'danger.500';
|
225
|
+
if (isSuccess) return 'success.500';
|
226
|
+
return 'black.medium';
|
227
|
+
};
|
228
|
+
const getJustifyContentHelper = () => {
|
229
|
+
if (rightHelperText && (!leftHelperText || isError && !errorMessage)) return 'flex-end';
|
230
|
+
return 'space-between';
|
231
|
+
};
|
232
|
+
const helperColor = getHelperColor();
|
233
|
+
const justifyHelper = getJustifyContentHelper();
|
234
|
+
return /*#__PURE__*/React__default.createElement(react.FormControl, {
|
235
|
+
isInvalid: isError
|
236
|
+
}, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(react.FormLabel, {
|
237
|
+
mb: 1,
|
238
|
+
fontSize: "text.sm",
|
239
|
+
requiredIndicator: undefined
|
240
|
+
}, isRequired && /*#__PURE__*/React__default.createElement(react.Box, {
|
241
|
+
as: "span",
|
242
|
+
color: "danger.500",
|
243
|
+
ml: 0,
|
244
|
+
mr: 1
|
245
|
+
}, "*"), label) : label), children, (isError && errorMessage || leftHelperText || rightHelperText) && /*#__PURE__*/React__default.createElement(react.Box, {
|
246
|
+
display: "flex",
|
247
|
+
width: "full",
|
248
|
+
justifyContent: justifyHelper
|
249
|
+
}, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
250
|
+
fontSize: "text.xs",
|
251
|
+
color: helperColor,
|
252
|
+
mt: 1
|
253
|
+
}, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(react.FormErrorMessage, {
|
254
|
+
fontSize: "text.xs",
|
255
|
+
color: "danger.500",
|
256
|
+
mt: 1
|
257
|
+
}, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
258
|
+
fontSize: "text.xs",
|
259
|
+
color: helperColor,
|
260
|
+
mt: 1
|
261
|
+
}, rightHelperText)));
|
262
|
+
};
|
263
|
+
Field.defaultProps = {
|
264
|
+
label: '',
|
265
|
+
isError: false,
|
266
|
+
isSuccess: false,
|
267
|
+
errorMessage: undefined,
|
268
|
+
leftHelperText: undefined,
|
269
|
+
rightHelperText: undefined,
|
270
|
+
isRequired: false
|
271
|
+
};
|
272
|
+
|
273
|
+
function CheckboxGroupComponent(props) {
|
274
|
+
const {
|
275
|
+
children,
|
276
|
+
label,
|
277
|
+
helpText,
|
278
|
+
isError,
|
279
|
+
errorMessage,
|
280
|
+
...rest
|
281
|
+
} = props;
|
282
|
+
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, rest, {
|
283
|
+
label: label,
|
284
|
+
leftHelperText: helpText,
|
285
|
+
isError: isError,
|
286
|
+
errorMessage: errorMessage
|
287
|
+
}), /*#__PURE__*/React__default.createElement(react.Box, {
|
288
|
+
mt: "12px"
|
289
|
+
}, /*#__PURE__*/React__default.createElement(react.CheckboxGroup, Object.assign({}, rest), /*#__PURE__*/React__default.createElement(react.Stack, {
|
290
|
+
spacing: [1, '16px'],
|
291
|
+
direction: ['column', 'row']
|
292
|
+
}, children))));
|
293
|
+
}
|
294
|
+
CheckboxGroupComponent.defaultProps = {
|
295
|
+
helpText: '',
|
296
|
+
isError: false,
|
297
|
+
errorMessage: ''
|
298
|
+
};
|
299
|
+
|
177
300
|
const IndeterminateCheckbox = ({
|
178
301
|
indeterminate = false,
|
179
302
|
...rest
|
@@ -1770,68 +1893,60 @@ MultiDatePickerMonth.defaultProps = {
|
|
1770
1893
|
isError: false
|
1771
1894
|
};
|
1772
1895
|
|
1773
|
-
|
1774
|
-
const Field = props => {
|
1896
|
+
const getProperties = props => {
|
1775
1897
|
const {
|
1776
|
-
label,
|
1777
1898
|
isError,
|
1778
|
-
|
1779
|
-
|
1780
|
-
rightHelperText,
|
1781
|
-
isRequired,
|
1782
|
-
children,
|
1783
|
-
isSuccess,
|
1784
|
-
isDisabled
|
1899
|
+
isDisabled,
|
1900
|
+
isSuccess
|
1785
1901
|
} = props;
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
if (
|
1790
|
-
|
1902
|
+
let outlineColor = 'neutral.400';
|
1903
|
+
let focusColor = 'primary.500';
|
1904
|
+
if (isError || isDisabled || isSuccess) {
|
1905
|
+
if (isError) outlineColor = 'danger.500';else if (isSuccess) outlineColor = 'success.500';
|
1906
|
+
focusColor = outlineColor;
|
1907
|
+
}
|
1908
|
+
return {
|
1909
|
+
outlineColor,
|
1910
|
+
focusColor
|
1791
1911
|
};
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1912
|
+
};
|
1913
|
+
const getWrapperStyle = props => {
|
1914
|
+
const {
|
1915
|
+
outlineColor,
|
1916
|
+
focusColor
|
1917
|
+
} = getProperties(props);
|
1918
|
+
const style = {
|
1919
|
+
border: '1px solid',
|
1920
|
+
borderColor: outlineColor,
|
1921
|
+
borderRadius: 'md',
|
1922
|
+
transition: 'all 0.15s',
|
1923
|
+
boxShadow: 'none',
|
1924
|
+
_focusWithin: {
|
1925
|
+
borderColor: focusColor
|
1926
|
+
}
|
1795
1927
|
};
|
1796
|
-
|
1797
|
-
const justifyHelper = getJustifyContentHelper();
|
1798
|
-
return /*#__PURE__*/React__default.createElement(react.FormControl, {
|
1799
|
-
isInvalid: isError
|
1800
|
-
}, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(react.FormLabel, {
|
1801
|
-
fontSize: "text.sm",
|
1802
|
-
requiredIndicator: undefined
|
1803
|
-
}, isRequired && /*#__PURE__*/React__default.createElement(react.Box, {
|
1804
|
-
as: "span",
|
1805
|
-
color: "danger.500",
|
1806
|
-
ml: 0,
|
1807
|
-
mr: 1
|
1808
|
-
}, "*"), label) : label), children, (isError && errorMessage || leftHelperText || rightHelperText) && /*#__PURE__*/React__default.createElement(react.Box, {
|
1809
|
-
display: "flex",
|
1810
|
-
width: "full",
|
1811
|
-
justifyContent: justifyHelper
|
1812
|
-
}, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
1813
|
-
fontSize: "text.xs",
|
1814
|
-
color: helperColor,
|
1815
|
-
mt: 1
|
1816
|
-
}, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(react.FormErrorMessage, {
|
1817
|
-
fontSize: "text.xs",
|
1818
|
-
color: "danger.500",
|
1819
|
-
mt: 1
|
1820
|
-
}, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
1821
|
-
fontSize: "text.xs",
|
1822
|
-
color: helperColor,
|
1823
|
-
mt: 1
|
1824
|
-
}, rightHelperText)));
|
1928
|
+
return react.defineStyle(style);
|
1825
1929
|
};
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1930
|
+
|
1931
|
+
const InputAddonLeft = ({
|
1932
|
+
children
|
1933
|
+
}) => {
|
1934
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
1935
|
+
borderLeftRadius: "md",
|
1936
|
+
backgroundColor: "neutral.200",
|
1937
|
+
px: 3,
|
1938
|
+
py: 2.5
|
1939
|
+
}, children);
|
1940
|
+
};
|
1941
|
+
const InputAddonRight = ({
|
1942
|
+
children
|
1943
|
+
}) => {
|
1944
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
1945
|
+
borderRightRadius: "md",
|
1946
|
+
backgroundColor: "neutral.200",
|
1947
|
+
px: 3,
|
1948
|
+
py: 2.5
|
1949
|
+
}, children);
|
1835
1950
|
};
|
1836
1951
|
|
1837
1952
|
const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
@@ -1851,47 +1966,121 @@ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
1851
1966
|
errorMessage,
|
1852
1967
|
leftHelperText,
|
1853
1968
|
rightHelperText,
|
1969
|
+
withClear,
|
1970
|
+
onClear,
|
1971
|
+
isLoading,
|
1854
1972
|
...inputProps
|
1855
1973
|
} = props;
|
1974
|
+
const wrapperStyle = getWrapperStyle(props);
|
1975
|
+
const [isShowPassword, setIsShowPassword] = React.useState(false);
|
1976
|
+
const inputType = React.useMemo(() => {
|
1977
|
+
return type === 'password' && isShowPassword ? 'text' : type;
|
1978
|
+
}, [isShowPassword, type]);
|
1979
|
+
const fontSize = React.useMemo(() => {
|
1980
|
+
if (type === 'password') {
|
1981
|
+
if (!isShowPassword && value) return 'text.xl';
|
1982
|
+
}
|
1983
|
+
return 'text.sm';
|
1984
|
+
}, [isShowPassword, type, value]);
|
1985
|
+
const iconColor = React.useMemo(() => {
|
1986
|
+
return isDisabled ? 'black.low' : 'black.medium';
|
1987
|
+
}, [isDisabled]);
|
1856
1988
|
return /*#__PURE__*/React__default.createElement(Field, {
|
1857
1989
|
label: label,
|
1858
1990
|
isSuccess: isSuccess,
|
1859
|
-
isDisabled: isDisabled,
|
1860
1991
|
isError: isError,
|
1861
1992
|
errorMessage: errorMessage,
|
1862
1993
|
leftHelperText: leftHelperText,
|
1863
1994
|
rightHelperText: rightHelperText,
|
1864
1995
|
isRequired: isRequired
|
1996
|
+
}, /*#__PURE__*/React__default.createElement(react.Box, {
|
1997
|
+
__css: wrapperStyle
|
1865
1998
|
}, /*#__PURE__*/React__default.createElement(react.InputGroup, {
|
1866
|
-
size: size
|
1867
|
-
|
1999
|
+
size: size,
|
2000
|
+
borderRadius: "md",
|
2001
|
+
backgroundColor: isDisabled ? 'neutral.300' : 'white.high',
|
2002
|
+
cursor: isDisabled ? 'not-allowed' : 'default'
|
2003
|
+
}, addOnLeft && /*#__PURE__*/React__default.createElement(InputAddonLeft, null, addOnLeft), /*#__PURE__*/React__default.createElement(react.Input, Object.assign({
|
1868
2004
|
ref: ref,
|
1869
|
-
type:
|
1870
|
-
value: value
|
1871
|
-
|
2005
|
+
type: inputType,
|
2006
|
+
value: value,
|
2007
|
+
isDisabled: isDisabled,
|
2008
|
+
isSuccess: isSuccess
|
2009
|
+
}, inputProps, {
|
2010
|
+
fontSize: fontSize
|
2011
|
+
})), (withClear || isLoading || type === 'password') && /*#__PURE__*/React__default.createElement(react.Box, {
|
2012
|
+
"data-test-id": "Pg7ttgRey7InxE4qzTjW_",
|
2013
|
+
display: "flex",
|
2014
|
+
alignItems: "center",
|
2015
|
+
justifyContent: "center",
|
2016
|
+
width: "16px",
|
2017
|
+
mr: "10px"
|
2018
|
+
}, withClear && !isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
2019
|
+
display: "flex",
|
2020
|
+
justifyContent: "center",
|
2021
|
+
onClick: !isDisabled ? onClear : undefined,
|
2022
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer'
|
2023
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.Close, {
|
2024
|
+
size: 4,
|
2025
|
+
color: iconColor
|
2026
|
+
})), type === 'password' && !isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
2027
|
+
"data-test-id": "q2Bj2G4FlamXyHuRKMZ1Q",
|
2028
|
+
onClick: () => {
|
2029
|
+
if (!isDisabled) setIsShowPassword(true);
|
2030
|
+
},
|
2031
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
2032
|
+
display: "flex",
|
2033
|
+
justifyContent: "center"
|
2034
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.EyeOff, {
|
2035
|
+
size: 4,
|
2036
|
+
color: iconColor
|
2037
|
+
})), type === 'password' && isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
2038
|
+
"data-test-id": "sfc2388bmeXBmdla45Ibk",
|
2039
|
+
onClick: () => {
|
2040
|
+
if (!isDisabled) setIsShowPassword(false);
|
2041
|
+
},
|
2042
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
2043
|
+
display: "flex",
|
2044
|
+
justifyContent: "center"
|
2045
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.Eye, {
|
2046
|
+
size: 4,
|
2047
|
+
color: iconColor
|
2048
|
+
})), isLoading && /*#__PURE__*/React__default.createElement(Loader, {
|
2049
|
+
size: "sm"
|
2050
|
+
})), "(", addOnRight && /*#__PURE__*/React__default.createElement(InputAddonRight, null, addOnRight))));
|
1872
2051
|
});
|
1873
2052
|
InputField.defaultProps = {
|
1874
2053
|
addOnLeft: undefined,
|
1875
2054
|
addOnRight: undefined,
|
1876
2055
|
elementLeft: undefined,
|
1877
|
-
elementRight: undefined
|
2056
|
+
elementRight: undefined,
|
2057
|
+
withClear: undefined,
|
2058
|
+
isLoading: undefined,
|
2059
|
+
onClear: undefined
|
1878
2060
|
};
|
1879
2061
|
|
1880
2062
|
const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
1881
2063
|
const {
|
1882
2064
|
value,
|
2065
|
+
isLoading,
|
1883
2066
|
...inputProps
|
1884
2067
|
} = props;
|
1885
|
-
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(react.
|
2068
|
+
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(react.Box, {
|
2069
|
+
position: "relative"
|
2070
|
+
}, /*#__PURE__*/React__default.createElement(react.Textarea, Object.assign({
|
1886
2071
|
ref: ref,
|
1887
2072
|
value: value
|
1888
|
-
}, inputProps))
|
2073
|
+
}, inputProps)), isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
2074
|
+
zIndex: 999,
|
2075
|
+
top: 2,
|
2076
|
+
right: 2,
|
2077
|
+
position: "absolute"
|
2078
|
+
}, /*#__PURE__*/React__default.createElement(Loader, {
|
2079
|
+
size: "sm"
|
2080
|
+
}))));
|
1889
2081
|
});
|
1890
2082
|
TextareaField.defaultProps = {
|
1891
|
-
|
1892
|
-
addOnRight: undefined,
|
1893
|
-
elementLeft: undefined,
|
1894
|
-
elementRight: undefined
|
2083
|
+
isLoading: undefined
|
1895
2084
|
};
|
1896
2085
|
|
1897
2086
|
const XMSLogo = () => /*#__PURE__*/React__default.createElement(react.Image, {
|
@@ -2078,14 +2267,6 @@ Header.defaultProps = {
|
|
2078
2267
|
hideSwitchMode: false
|
2079
2268
|
};
|
2080
2269
|
|
2081
|
-
const Loader = /*#__PURE__*/react.forwardRef((props, ref) => {
|
2082
|
-
const styles = react.useStyleConfig('LoaderStyle', props);
|
2083
|
-
return /*#__PURE__*/React__default.createElement(react.Box, {
|
2084
|
-
ref: ref,
|
2085
|
-
__css: styles
|
2086
|
-
});
|
2087
|
-
});
|
2088
|
-
|
2089
2270
|
const ModalBody = /*#__PURE__*/React__default.forwardRef(({
|
2090
2271
|
children,
|
2091
2272
|
...rest
|
@@ -2488,6 +2669,68 @@ PaginationFilter.defaultProps = {
|
|
2488
2669
|
label: undefined
|
2489
2670
|
};
|
2490
2671
|
|
2672
|
+
function RadioComponent({
|
2673
|
+
isError = false,
|
2674
|
+
helpText = '',
|
2675
|
+
errorText = '',
|
2676
|
+
children,
|
2677
|
+
isDisabled,
|
2678
|
+
...rest
|
2679
|
+
}) {
|
2680
|
+
const variant = isError ? 'errors' : 'unstyled';
|
2681
|
+
return /*#__PURE__*/React__default.createElement(react.Box, null, /*#__PURE__*/React__default.createElement(react.Box, {
|
2682
|
+
display: "flex"
|
2683
|
+
}, /*#__PURE__*/React__default.createElement(react.Radio, Object.assign({
|
2684
|
+
variant: variant
|
2685
|
+
}, rest, {
|
2686
|
+
isDisabled: isDisabled
|
2687
|
+
}), children && /*#__PURE__*/React__default.createElement(react.Text, {
|
2688
|
+
textStyle: "text.sm",
|
2689
|
+
color: isDisabled ? 'black.low' : 'black.high'
|
2690
|
+
}, children))), /*#__PURE__*/React__default.createElement(react.Box, {
|
2691
|
+
mt: "5px",
|
2692
|
+
ml: "24px"
|
2693
|
+
}, isError ? /*#__PURE__*/React__default.createElement(react.Text, {
|
2694
|
+
textStyle: "text.xs",
|
2695
|
+
color: "danger.500"
|
2696
|
+
}, errorText) : /*#__PURE__*/React__default.createElement(react.Text, {
|
2697
|
+
textStyle: "text.xs",
|
2698
|
+
color: "black.medium"
|
2699
|
+
}, helpText)));
|
2700
|
+
}
|
2701
|
+
RadioComponent.defaultProps = {
|
2702
|
+
isError: false,
|
2703
|
+
helpText: '',
|
2704
|
+
errorText: ''
|
2705
|
+
};
|
2706
|
+
|
2707
|
+
function RadioGroupComponent(props) {
|
2708
|
+
const {
|
2709
|
+
children,
|
2710
|
+
label,
|
2711
|
+
helpText,
|
2712
|
+
isError,
|
2713
|
+
errorMessage,
|
2714
|
+
...rest
|
2715
|
+
} = props;
|
2716
|
+
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, rest, {
|
2717
|
+
label: label,
|
2718
|
+
leftHelperText: helpText,
|
2719
|
+
isError: isError,
|
2720
|
+
errorMessage: errorMessage
|
2721
|
+
}), /*#__PURE__*/React__default.createElement(react.Box, {
|
2722
|
+
mt: "12px"
|
2723
|
+
}, /*#__PURE__*/React__default.createElement(react.RadioGroup, Object.assign({}, rest), /*#__PURE__*/React__default.createElement(react.Stack, {
|
2724
|
+
spacing: [1, '16px'],
|
2725
|
+
direction: ['column', 'row']
|
2726
|
+
}, children))));
|
2727
|
+
}
|
2728
|
+
RadioGroupComponent.defaultProps = {
|
2729
|
+
helpText: '',
|
2730
|
+
isError: false,
|
2731
|
+
errorMessage: ''
|
2732
|
+
};
|
2733
|
+
|
2491
2734
|
const SelectWrapper = ({
|
2492
2735
|
children,
|
2493
2736
|
isError = false
|
@@ -2680,20 +2923,109 @@ function SelectCreatable({
|
|
2680
2923
|
})));
|
2681
2924
|
}
|
2682
2925
|
|
2683
|
-
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
const styles = react.useMultiStyleConfig('
|
2691
|
-
|
2692
|
-
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
|
2926
|
+
/**
|
2927
|
+
* The `Switch` component is used as an alternative for the checkbox component for switching between "enabled" and "disabled" states.
|
2928
|
+
*
|
2929
|
+
* @see Docs https://chakra-ui.com/docs/components/switch
|
2930
|
+
* @see WAI-ARIA https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
2931
|
+
*/
|
2932
|
+
const Switch = /*#__PURE__*/react.forwardRef(function Switch(props, ref) {
|
2933
|
+
const styles = react.useMultiStyleConfig('Switch', props);
|
2934
|
+
const {
|
2935
|
+
size = 'md'
|
2936
|
+
} = props;
|
2937
|
+
const {
|
2938
|
+
spacing = '0.5rem',
|
2939
|
+
children,
|
2940
|
+
...ownProps
|
2941
|
+
} = react.omitThemingProps(props);
|
2942
|
+
const {
|
2943
|
+
state,
|
2944
|
+
getInputProps,
|
2945
|
+
getCheckboxProps,
|
2946
|
+
getRootProps,
|
2947
|
+
getLabelProps
|
2948
|
+
} = react.useCheckbox(ownProps);
|
2949
|
+
const containerStyles = React.useMemo(() => ({
|
2950
|
+
display: 'inline-block',
|
2951
|
+
position: 'relative',
|
2952
|
+
verticalAlign: 'middle',
|
2953
|
+
lineHeight: 0,
|
2954
|
+
...styles.container
|
2955
|
+
}), [styles.container]);
|
2956
|
+
const trackStyles = React.useMemo(() => ({
|
2957
|
+
display: 'inline-flex',
|
2958
|
+
flexShrink: 0,
|
2959
|
+
justifyContent: 'flex-start',
|
2960
|
+
boxSizing: 'content-box',
|
2961
|
+
cursor: 'pointer',
|
2962
|
+
width: 200,
|
2963
|
+
...styles.track
|
2964
|
+
}), [styles.track]);
|
2965
|
+
const labelStyles = React.useMemo(() => ({
|
2966
|
+
userSelect: 'none',
|
2967
|
+
marginStart: spacing,
|
2968
|
+
...styles.label
|
2969
|
+
}), [spacing, styles.label]);
|
2970
|
+
const getIconSize = value => {
|
2971
|
+
const iconSize = {
|
2972
|
+
sm: 3,
|
2973
|
+
md: 4,
|
2974
|
+
lg: 5
|
2975
|
+
};
|
2976
|
+
return iconSize[value];
|
2977
|
+
};
|
2978
|
+
return /*#__PURE__*/React__default.createElement(react.chakra.label, Object.assign({}, getRootProps(), {
|
2979
|
+
display: "flex",
|
2980
|
+
alignItems: "center",
|
2981
|
+
className: sharedUtils.cx('chakra-switch', props.className),
|
2982
|
+
__css: containerStyles
|
2983
|
+
}), /*#__PURE__*/React__default.createElement("input", Object.assign({
|
2984
|
+
"data-test-id": "",
|
2985
|
+
className: "chakra-switch__input"
|
2986
|
+
}, getInputProps({}, ref))), /*#__PURE__*/React__default.createElement(react.chakra.span, Object.assign({}, getCheckboxProps(), {
|
2987
|
+
className: "chakra-switch__track",
|
2988
|
+
pos: "relative",
|
2989
|
+
__css: trackStyles
|
2990
|
+
}), /*#__PURE__*/React__default.createElement(react.Flex, {
|
2991
|
+
gap: 2,
|
2992
|
+
pos: "absolute",
|
2993
|
+
top: "50%",
|
2994
|
+
left: "50%",
|
2995
|
+
transform: "translate(-50%, -50%)"
|
2996
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.Check, {
|
2997
|
+
color: "white",
|
2998
|
+
size: getIconSize(size)
|
2999
|
+
}), /*#__PURE__*/React__default.createElement(internalIcon.Close, {
|
3000
|
+
color: state.isDisabled ? 'neutral.600' : 'neutral.900',
|
3001
|
+
size: getIconSize(size)
|
3002
|
+
})), /*#__PURE__*/React__default.createElement(react.chakra.span, {
|
3003
|
+
__css: styles.thumb,
|
3004
|
+
className: "chakra-switch__thumb",
|
3005
|
+
"data-checked": sharedUtils.dataAttr(state.isChecked),
|
3006
|
+
"data-hover": sharedUtils.dataAttr(state.isHovered)
|
3007
|
+
})), children && /*#__PURE__*/React__default.createElement(react.chakra.span, Object.assign({
|
3008
|
+
className: "chakra-switch__label",
|
3009
|
+
color: state.isDisabled ? 'black.low' : 'black.high'
|
3010
|
+
}, getLabelProps(), {
|
3011
|
+
__css: labelStyles
|
3012
|
+
}), children));
|
3013
|
+
});
|
3014
|
+
|
3015
|
+
const Tab = /*#__PURE__*/react.forwardRef((props, ref) => {
|
3016
|
+
var _props$leftAddon, _props$rightAddon;
|
3017
|
+
const tabProps = react.useTab({
|
3018
|
+
...props,
|
3019
|
+
ref
|
3020
|
+
});
|
3021
|
+
const isSelected = !!tabProps['aria-selected'];
|
3022
|
+
const styles = react.useMultiStyleConfig('Tabs', tabProps);
|
3023
|
+
return /*#__PURE__*/React.createElement(react.Button, Object.assign({
|
3024
|
+
p: 3,
|
3025
|
+
fontSize: "text.md",
|
3026
|
+
_selected: {
|
3027
|
+
borderColor: react.useColorModeValue('primary.400', 'primary.300'),
|
3028
|
+
color: react.useColorModeValue('primary.500', 'primary.300'),
|
2697
3029
|
transform: 'translateY(-2px)'
|
2698
3030
|
},
|
2699
3031
|
color: react.useColorModeValue('black.high', 'primary.300'),
|
@@ -2809,109 +3141,375 @@ Uploader.defaultProps = {
|
|
2809
3141
|
selected: false
|
2810
3142
|
};
|
2811
3143
|
|
3144
|
+
const {
|
3145
|
+
definePartsStyle,
|
3146
|
+
defineMultiStyleConfig
|
3147
|
+
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.alertAnatomy.keys);
|
3148
|
+
const $fg = /*#__PURE__*/styledSystem.cssVar('alert-fg');
|
3149
|
+
const $bg = /*#__PURE__*/styledSystem.cssVar('alert-bg');
|
3150
|
+
const baseStyle = /*#__PURE__*/definePartsStyle({
|
3151
|
+
container: {
|
3152
|
+
bg: $bg.reference,
|
3153
|
+
px: '4',
|
3154
|
+
py: '2',
|
3155
|
+
borderRadius: 'md'
|
3156
|
+
},
|
3157
|
+
title: {
|
3158
|
+
fontWeight: '400',
|
3159
|
+
lineHeight: '18px',
|
3160
|
+
marginEnd: '2'
|
3161
|
+
},
|
3162
|
+
description: {
|
3163
|
+
lineHeight: '6'
|
3164
|
+
},
|
3165
|
+
icon: {
|
3166
|
+
color: $fg.reference,
|
3167
|
+
flexShrink: 0,
|
3168
|
+
marginEnd: '3',
|
3169
|
+
w: '4',
|
3170
|
+
h: '4'
|
3171
|
+
},
|
3172
|
+
action: {
|
3173
|
+
'& +.chakra-alert__close': {
|
3174
|
+
ml: '3'
|
3175
|
+
}
|
3176
|
+
},
|
3177
|
+
close: {
|
3178
|
+
color: $fg.reference,
|
3179
|
+
w: '4',
|
3180
|
+
h: '4'
|
3181
|
+
},
|
3182
|
+
spinner: {
|
3183
|
+
color: $fg.reference,
|
3184
|
+
flexShrink: 0,
|
3185
|
+
marginEnd: '3',
|
3186
|
+
w: '5',
|
3187
|
+
h: '5'
|
3188
|
+
}
|
3189
|
+
});
|
3190
|
+
function getBg(props) {
|
3191
|
+
const {
|
3192
|
+
theme,
|
3193
|
+
colorScheme: c
|
3194
|
+
} = props;
|
3195
|
+
const darkBg = themeTools.transparentize(`${c}.200`, 0.16)(theme);
|
3196
|
+
return {
|
3197
|
+
light: `colors.${c}.50`,
|
3198
|
+
dark: darkBg
|
3199
|
+
};
|
3200
|
+
}
|
3201
|
+
const variantSubtle = /*#__PURE__*/definePartsStyle(props => {
|
3202
|
+
const {
|
3203
|
+
colorScheme: c
|
3204
|
+
} = props;
|
3205
|
+
const bg = getBg(props);
|
3206
|
+
return {
|
3207
|
+
container: {
|
3208
|
+
[$fg.variable]: `colors.${c}.700`,
|
3209
|
+
[$bg.variable]: bg.light,
|
3210
|
+
_dark: {
|
3211
|
+
[$fg.variable]: `colors.${c}.200`,
|
3212
|
+
[$bg.variable]: bg.dark
|
3213
|
+
},
|
3214
|
+
color: $fg.reference
|
3215
|
+
}
|
3216
|
+
};
|
3217
|
+
});
|
3218
|
+
const variantSolid = /*#__PURE__*/definePartsStyle(props => {
|
3219
|
+
const {
|
3220
|
+
colorScheme: c
|
3221
|
+
} = props;
|
3222
|
+
return {
|
3223
|
+
container: {
|
3224
|
+
[$fg.variable]: `colors.white.high`,
|
3225
|
+
[$bg.variable]: `colors.${c}.500`,
|
3226
|
+
_dark: {
|
3227
|
+
[$fg.variable]: `colors.gray.900`,
|
3228
|
+
[$bg.variable]: `colors.${c}.200`
|
3229
|
+
},
|
3230
|
+
color: $fg.reference
|
3231
|
+
}
|
3232
|
+
};
|
3233
|
+
});
|
3234
|
+
const variants = {
|
3235
|
+
subtle: variantSubtle,
|
3236
|
+
solid: variantSolid
|
3237
|
+
};
|
3238
|
+
const alertTheme = /*#__PURE__*/defineMultiStyleConfig({
|
3239
|
+
baseStyle,
|
3240
|
+
variants,
|
3241
|
+
defaultProps: {
|
3242
|
+
variant: 'subtle',
|
3243
|
+
colorScheme: 'info'
|
3244
|
+
}
|
3245
|
+
});
|
3246
|
+
|
2812
3247
|
// You can also use the more specific type for
|
2813
3248
|
// a single part component: ComponentSingleStyleConfig
|
2814
|
-
const Button = {
|
3249
|
+
const Button$1 = /*#__PURE__*/styledSystem.defineStyleConfig({
|
2815
3250
|
// The styles all button have in common
|
2816
3251
|
baseStyle: {
|
2817
3252
|
fontSize: 'body.1',
|
2818
3253
|
fontWeight: 'normal',
|
2819
|
-
lineHeight: '1.25',
|
2820
|
-
minW: 24,
|
2821
3254
|
px: 4,
|
2822
|
-
py: 2,
|
3255
|
+
py: 2.5,
|
2823
3256
|
borderRadius: 'md',
|
2824
3257
|
_disabled: {
|
2825
|
-
opacity:
|
3258
|
+
opacity: 1,
|
3259
|
+
bg: 'neutral.300',
|
3260
|
+
color: 'black.low'
|
2826
3261
|
},
|
2827
3262
|
_hover: {
|
2828
3263
|
_disabled: {
|
2829
|
-
|
2830
|
-
|
2831
|
-
},
|
2832
|
-
_active: {
|
2833
|
-
_disabled: {
|
2834
|
-
opacity: 0.3
|
3264
|
+
bg: 'neutral.300',
|
3265
|
+
color: 'black.low'
|
2835
3266
|
}
|
2836
|
-
},
|
2837
|
-
_loading: {
|
2838
|
-
opacity: 0.7
|
2839
3267
|
}
|
2840
3268
|
},
|
2841
3269
|
sizes: {
|
2842
|
-
lg: {
|
2843
|
-
|
2844
|
-
|
3270
|
+
lg: props => {
|
3271
|
+
const {
|
3272
|
+
variant
|
3273
|
+
} = props;
|
3274
|
+
const base = {
|
3275
|
+
fontSize: 'text.xl',
|
3276
|
+
h: 12,
|
3277
|
+
px: 4,
|
3278
|
+
py: 2.5
|
3279
|
+
};
|
3280
|
+
const icon = {
|
3281
|
+
h: 10,
|
3282
|
+
w: 10,
|
3283
|
+
p: 0
|
3284
|
+
};
|
3285
|
+
return variant === 'icon' ? icon : base;
|
2845
3286
|
},
|
2846
|
-
md: {
|
2847
|
-
|
2848
|
-
|
3287
|
+
md: props => {
|
3288
|
+
const {
|
3289
|
+
variant
|
3290
|
+
} = props;
|
3291
|
+
const base = {
|
3292
|
+
fontSize: 'text.md',
|
3293
|
+
h: 9,
|
3294
|
+
px: 3,
|
3295
|
+
py: '7px'
|
3296
|
+
};
|
3297
|
+
const icon = {
|
3298
|
+
h: 9,
|
3299
|
+
w: 9,
|
3300
|
+
p: 0
|
3301
|
+
};
|
3302
|
+
return variant === 'icon' ? icon : base;
|
2849
3303
|
},
|
2850
|
-
sm: {
|
2851
|
-
|
2852
|
-
|
3304
|
+
sm: props => {
|
3305
|
+
const {
|
3306
|
+
variant
|
3307
|
+
} = props;
|
3308
|
+
const base = {
|
3309
|
+
fontSize: 'text.xs',
|
3310
|
+
h: 6,
|
3311
|
+
px: 2,
|
3312
|
+
py: '5px'
|
3313
|
+
};
|
3314
|
+
const icon = {
|
3315
|
+
h: 6,
|
3316
|
+
w: 6,
|
3317
|
+
p: 0
|
3318
|
+
};
|
3319
|
+
return variant === 'icon' ? icon : base;
|
2853
3320
|
}
|
2854
3321
|
},
|
2855
|
-
// Two variants: outline and solid
|
2856
3322
|
variants: {
|
2857
|
-
|
2858
|
-
|
2859
|
-
|
3323
|
+
primary: props => {
|
3324
|
+
const {
|
3325
|
+
isLoading
|
3326
|
+
} = props;
|
3327
|
+
const basePrimary = {
|
3328
|
+
color: 'white.high',
|
3329
|
+
bg: 'primary.500',
|
3330
|
+
_hover: {
|
3331
|
+
bg: 'primary.600'
|
3332
|
+
},
|
3333
|
+
_active: {
|
3334
|
+
bg: 'primary.700'
|
3335
|
+
}
|
3336
|
+
};
|
3337
|
+
const disabledLoading = {
|
3338
|
+
_disabled: {
|
3339
|
+
bg: 'primary.500'
|
3340
|
+
},
|
3341
|
+
_hover: {
|
3342
|
+
_disabled: {
|
3343
|
+
bg: 'primary.500'
|
3344
|
+
}
|
3345
|
+
}
|
3346
|
+
};
|
3347
|
+
return isLoading ? disabledLoading : basePrimary;
|
3348
|
+
},
|
3349
|
+
secondary: props => {
|
3350
|
+
const {
|
3351
|
+
isLoading
|
3352
|
+
} = props;
|
3353
|
+
const baseSecondary = {
|
3354
|
+
color: 'primary.500',
|
3355
|
+
borderWidth: 1,
|
3356
|
+
borderStyle: 'inside',
|
3357
|
+
bg: 'white.high',
|
3358
|
+
borderColor: 'primary.500',
|
3359
|
+
_hover: {
|
3360
|
+
bg: 'primary.50'
|
3361
|
+
},
|
3362
|
+
_active: {
|
3363
|
+
bg: 'primary.100'
|
3364
|
+
},
|
3365
|
+
_disabled: {
|
3366
|
+
border: 0
|
3367
|
+
}
|
3368
|
+
};
|
3369
|
+
const disabledLoading = {
|
3370
|
+
...baseSecondary,
|
3371
|
+
_disabled: {
|
3372
|
+
bg: 'white.high'
|
3373
|
+
},
|
3374
|
+
_hover: {
|
3375
|
+
_disabled: {
|
3376
|
+
bg: 'white.high'
|
3377
|
+
}
|
3378
|
+
}
|
3379
|
+
};
|
3380
|
+
return isLoading ? disabledLoading : baseSecondary;
|
3381
|
+
},
|
3382
|
+
tertiary: props => {
|
3383
|
+
const {
|
3384
|
+
isLoading
|
3385
|
+
} = props;
|
3386
|
+
const baseTertiary = {
|
3387
|
+
color: 'primary.500',
|
3388
|
+
_hover: {
|
3389
|
+
bg: 'primary.50'
|
3390
|
+
},
|
3391
|
+
_active: {
|
3392
|
+
bg: 'primary.100'
|
3393
|
+
}
|
3394
|
+
};
|
3395
|
+
const disabledLoading = {
|
3396
|
+
...baseTertiary,
|
3397
|
+
_disabled: {
|
3398
|
+
bg: 'transparent'
|
3399
|
+
},
|
3400
|
+
_hover: {
|
3401
|
+
_disabled: {
|
3402
|
+
bg: 'transparent'
|
3403
|
+
}
|
3404
|
+
}
|
3405
|
+
};
|
3406
|
+
return isLoading ? disabledLoading : baseTertiary;
|
3407
|
+
},
|
3408
|
+
danger: props => {
|
3409
|
+
const {
|
3410
|
+
isLoading
|
3411
|
+
} = props;
|
3412
|
+
const baseDanger = {
|
3413
|
+
bg: 'danger.500',
|
3414
|
+
color: 'white.high',
|
3415
|
+
_hover: {
|
3416
|
+
bg: 'danger.600'
|
3417
|
+
},
|
3418
|
+
_active: {
|
3419
|
+
bg: 'danger.700'
|
3420
|
+
}
|
3421
|
+
};
|
3422
|
+
const disabledLoading = {
|
3423
|
+
...baseDanger,
|
3424
|
+
_disabled: {
|
3425
|
+
bg: 'danger.500'
|
3426
|
+
},
|
3427
|
+
_hover: {
|
3428
|
+
_disabled: {
|
3429
|
+
bg: 'danger.500'
|
3430
|
+
}
|
3431
|
+
}
|
3432
|
+
};
|
3433
|
+
return isLoading ? disabledLoading : baseDanger;
|
3434
|
+
},
|
3435
|
+
'outline-danger': props => {
|
3436
|
+
const {
|
3437
|
+
isLoading
|
3438
|
+
} = props;
|
3439
|
+
const baseSecondary = {
|
3440
|
+
color: 'danger.500',
|
3441
|
+
borderWidth: 1,
|
3442
|
+
borderStyle: 'inside',
|
3443
|
+
bg: 'white.high',
|
3444
|
+
borderColor: 'danger.500',
|
3445
|
+
_hover: {
|
3446
|
+
bg: 'danger.50'
|
3447
|
+
},
|
3448
|
+
_active: {
|
3449
|
+
bg: 'danger.100'
|
3450
|
+
},
|
3451
|
+
_disabled: {
|
3452
|
+
border: 0
|
3453
|
+
}
|
3454
|
+
};
|
3455
|
+
const disabledLoading = {
|
3456
|
+
...baseSecondary,
|
3457
|
+
_disabled: {
|
3458
|
+
bg: 'white.high'
|
3459
|
+
},
|
3460
|
+
_hover: {
|
3461
|
+
_disabled: {
|
3462
|
+
bg: 'white.high'
|
3463
|
+
}
|
3464
|
+
}
|
3465
|
+
};
|
3466
|
+
return isLoading ? disabledLoading : baseSecondary;
|
3467
|
+
},
|
3468
|
+
link: {
|
3469
|
+
bg: 'transparent',
|
3470
|
+
color: 'primary.500',
|
2860
3471
|
_disabled: {
|
2861
|
-
|
3472
|
+
opacity: '1',
|
3473
|
+
bg: 'transparent',
|
3474
|
+
color: 'black.medium'
|
2862
3475
|
},
|
2863
3476
|
_hover: {
|
2864
|
-
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
2868
|
-
},
|
2869
|
-
_focus: {
|
2870
|
-
bg: 'primary.700'
|
3477
|
+
_disabled: {
|
3478
|
+
bg: 'transparent',
|
3479
|
+
color: 'black.medium'
|
3480
|
+
}
|
2871
3481
|
}
|
2872
3482
|
},
|
2873
|
-
|
2874
|
-
|
2875
|
-
|
2876
|
-
|
2877
|
-
|
2878
|
-
borderColor: themeTools.mode('primary.500', 'primary.500')(props),
|
2879
|
-
_hover: {
|
2880
|
-
bg: 'primary.50'
|
2881
|
-
},
|
3483
|
+
icon: {
|
3484
|
+
bg: 'neutral.50',
|
3485
|
+
minW: 0,
|
3486
|
+
borderColor: 'neutral.200',
|
3487
|
+
borderWidth: '1px',
|
2882
3488
|
_active: {
|
2883
|
-
bg: '
|
3489
|
+
bg: 'neutral.500',
|
3490
|
+
borderColor: 'neutral.50'
|
2884
3491
|
},
|
2885
|
-
_focus: {
|
2886
|
-
bg: 'primary.100'
|
2887
|
-
}
|
2888
|
-
}),
|
2889
|
-
'outline-danger': {
|
2890
|
-
color: 'danger.500',
|
2891
|
-
bg: 'white',
|
2892
|
-
borderStyle: 'inside',
|
2893
|
-
borderWidth: 1,
|
2894
|
-
borderColor: 'danger.500'
|
2895
|
-
},
|
2896
|
-
ghost: {
|
2897
|
-
color: 'primary.500',
|
2898
3492
|
_disabled: {
|
2899
|
-
bg: '
|
3493
|
+
bg: 'neutral.500',
|
3494
|
+
opacity: 0.3,
|
3495
|
+
borderColor: 'neutral.50'
|
3496
|
+
},
|
3497
|
+
_hover: {
|
3498
|
+
bg: 'neutral.400',
|
3499
|
+
_disabled: {
|
3500
|
+
bg: 'neutral.500',
|
3501
|
+
opacity: 0.3,
|
3502
|
+
borderColor: 'neutral.50'
|
3503
|
+
}
|
2900
3504
|
}
|
2901
|
-
},
|
2902
|
-
link: {
|
2903
|
-
bg: 'transparent',
|
2904
|
-
color: 'primary.500'
|
2905
3505
|
}
|
2906
3506
|
},
|
2907
|
-
// The default size and variant values
|
2908
3507
|
defaultProps: {
|
2909
3508
|
size: 'md',
|
2910
|
-
variant: '
|
2911
|
-
orientation: 'vertical',
|
3509
|
+
variant: 'primary',
|
2912
3510
|
colorScheme: 'primary'
|
2913
3511
|
}
|
2914
|
-
};
|
3512
|
+
});
|
2915
3513
|
|
2916
3514
|
const CardStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
2917
3515
|
baseStyle: props => {
|
@@ -2923,10 +3521,10 @@ const CardStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
|
2923
3521
|
});
|
2924
3522
|
|
2925
3523
|
const {
|
2926
|
-
definePartsStyle,
|
2927
|
-
defineMultiStyleConfig
|
3524
|
+
definePartsStyle: definePartsStyle$1,
|
3525
|
+
defineMultiStyleConfig: defineMultiStyleConfig$1
|
2928
3526
|
} = /*#__PURE__*/react.createMultiStyleConfigHelpers(anatomy.checkboxAnatomy.keys);
|
2929
|
-
const baseStyle = /*#__PURE__*/definePartsStyle({
|
3527
|
+
const baseStyle$1 = /*#__PURE__*/definePartsStyle$1({
|
2930
3528
|
control: {
|
2931
3529
|
borderRadius: '4px',
|
2932
3530
|
width: '16px',
|
@@ -2950,7 +3548,7 @@ const baseStyle = /*#__PURE__*/definePartsStyle({
|
|
2950
3548
|
cursor: 'not-allowed'
|
2951
3549
|
}
|
2952
3550
|
});
|
2953
|
-
const errors = /*#__PURE__*/definePartsStyle({
|
3551
|
+
const errors = /*#__PURE__*/definePartsStyle$1({
|
2954
3552
|
control: {
|
2955
3553
|
borderColor: 'danger.500',
|
2956
3554
|
_checked: {
|
@@ -2970,7 +3568,7 @@ const errors = /*#__PURE__*/definePartsStyle({
|
|
2970
3568
|
fontSize: '12px'
|
2971
3569
|
}
|
2972
3570
|
});
|
2973
|
-
const unstyled = /*#__PURE__*/definePartsStyle({
|
3571
|
+
const unstyled = /*#__PURE__*/definePartsStyle$1({
|
2974
3572
|
control: {
|
2975
3573
|
borderColor: 'neutral.500',
|
2976
3574
|
_checked: {
|
@@ -2986,7 +3584,8 @@ const unstyled = /*#__PURE__*/definePartsStyle({
|
|
2986
3584
|
}
|
2987
3585
|
},
|
2988
3586
|
_disabled: {
|
2989
|
-
backgroundColor: 'neutral.500'
|
3587
|
+
backgroundColor: 'neutral.500',
|
3588
|
+
borderColor: 'neutral.500'
|
2990
3589
|
},
|
2991
3590
|
_indeterminate: {
|
2992
3591
|
borderColor: 'primary.500',
|
@@ -2997,48 +3596,109 @@ const unstyled = /*#__PURE__*/definePartsStyle({
|
|
2997
3596
|
fontSize: '12px'
|
2998
3597
|
}
|
2999
3598
|
});
|
3000
|
-
const variants = {
|
3599
|
+
const variants$1 = {
|
3001
3600
|
errors,
|
3002
3601
|
unstyled
|
3003
3602
|
};
|
3004
|
-
const Checkbox = /*#__PURE__*/defineMultiStyleConfig({
|
3005
|
-
baseStyle,
|
3006
|
-
variants,
|
3603
|
+
const Checkbox = /*#__PURE__*/defineMultiStyleConfig$1({
|
3604
|
+
baseStyle: baseStyle$1,
|
3605
|
+
variants: variants$1,
|
3007
3606
|
defaultProps: {
|
3008
|
-
variant: '
|
3607
|
+
variant: 'unstyled'
|
3009
3608
|
}
|
3010
3609
|
});
|
3011
3610
|
|
3012
|
-
const
|
3611
|
+
const Chips = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3612
|
+
baseStyle: props => {
|
3613
|
+
const {
|
3614
|
+
isDisabled,
|
3615
|
+
isActive
|
3616
|
+
} = props;
|
3617
|
+
const defaultProps = {
|
3618
|
+
color: 'primary.500',
|
3619
|
+
fontSize: 'text.small',
|
3620
|
+
borderRadius: '24px',
|
3621
|
+
borderWidth: '1px',
|
3622
|
+
borderColor: 'primary.500',
|
3623
|
+
bg: 'white.high',
|
3624
|
+
paddingX: 3,
|
3625
|
+
paddingY: 1,
|
3626
|
+
cursor: 'default'
|
3627
|
+
};
|
3628
|
+
let chipsProps = {
|
3629
|
+
...defaultProps
|
3630
|
+
};
|
3631
|
+
if (isActive) {
|
3632
|
+
const isActiveProps = {
|
3633
|
+
bg: 'primary.500',
|
3634
|
+
color: 'white.high'
|
3635
|
+
};
|
3636
|
+
chipsProps = {
|
3637
|
+
...chipsProps,
|
3638
|
+
...isActiveProps
|
3639
|
+
};
|
3640
|
+
}
|
3641
|
+
if (isDisabled) {
|
3642
|
+
const isDisabledProps = {
|
3643
|
+
bg: 'neutral.200',
|
3644
|
+
color: 'black.low',
|
3645
|
+
borderColor: 'neutral.200',
|
3646
|
+
cursor: 'not-allowed'
|
3647
|
+
};
|
3648
|
+
chipsProps = {
|
3649
|
+
...chipsProps,
|
3650
|
+
...isDisabledProps
|
3651
|
+
};
|
3652
|
+
}
|
3653
|
+
return {
|
3654
|
+
...chipsProps
|
3655
|
+
};
|
3656
|
+
},
|
3657
|
+
sizes: {
|
3658
|
+
sm: {
|
3659
|
+
fontSize: '12px'
|
3660
|
+
},
|
3661
|
+
md: {
|
3662
|
+
fontSize: '14px'
|
3663
|
+
}
|
3664
|
+
},
|
3665
|
+
defaultProps: {
|
3666
|
+
size: 'sm'
|
3667
|
+
}
|
3668
|
+
});
|
3669
|
+
|
3670
|
+
const baseStyle$2 = /*#__PURE__*/styledSystem.defineStyle({
|
3013
3671
|
fontSize: 'field.sm',
|
3014
3672
|
marginEnd: 1,
|
3015
3673
|
mb: 1
|
3016
3674
|
});
|
3017
3675
|
const FormLabel = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3018
|
-
baseStyle: baseStyle$
|
3676
|
+
baseStyle: baseStyle$2
|
3019
3677
|
});
|
3020
3678
|
|
3021
3679
|
const {
|
3022
|
-
definePartsStyle: definePartsStyle$
|
3023
|
-
defineMultiStyleConfig: defineMultiStyleConfig$
|
3680
|
+
definePartsStyle: definePartsStyle$2,
|
3681
|
+
defineMultiStyleConfig: defineMultiStyleConfig$2
|
3024
3682
|
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.inputAnatomy.keys);
|
3025
|
-
const baseStyle$
|
3683
|
+
const baseStyle$3 = /*#__PURE__*/definePartsStyle$2({
|
3026
3684
|
field: {
|
3027
3685
|
width: '100%',
|
3028
3686
|
minWidth: 0,
|
3029
3687
|
outline: 0,
|
3030
|
-
px: 2
|
3031
|
-
py: 2,
|
3688
|
+
px: 2,
|
3689
|
+
py: 2.5,
|
3690
|
+
paddingInlineStart: 2,
|
3691
|
+
paddingInlineEnd: 2,
|
3032
3692
|
position: 'relative',
|
3033
3693
|
appearance: 'none',
|
3034
|
-
transitionProperty: 'common',
|
3035
|
-
transitionDuration: 'normal',
|
3036
3694
|
color: 'black.high',
|
3037
3695
|
_disabled: {
|
3038
3696
|
bg: 'neutral.300',
|
3039
|
-
border:
|
3040
|
-
|
3041
|
-
|
3697
|
+
border: 0,
|
3698
|
+
cursor: 'not-allowed',
|
3699
|
+
opacity: 1,
|
3700
|
+
boxShadow: 'none',
|
3701
|
+
color: 'black.medium'
|
3042
3702
|
},
|
3043
3703
|
_placeholder: {
|
3044
3704
|
color: 'black.low'
|
@@ -3047,88 +3707,54 @@ const baseStyle$2 = /*#__PURE__*/definePartsStyle$1({
|
|
3047
3707
|
});
|
3048
3708
|
const size = {
|
3049
3709
|
lg: /*#__PURE__*/styledSystem.defineStyle({
|
3050
|
-
fontSize: '
|
3710
|
+
fontSize: 'text.lg',
|
3051
3711
|
h: 12,
|
3052
3712
|
borderRadius: 'md'
|
3053
3713
|
}),
|
3054
3714
|
md: /*#__PURE__*/styledSystem.defineStyle({
|
3055
|
-
fontSize: '
|
3715
|
+
fontSize: 'text.md',
|
3056
3716
|
h: 10,
|
3057
3717
|
borderRadius: 'md'
|
3058
3718
|
}),
|
3059
3719
|
sm: /*#__PURE__*/styledSystem.defineStyle({
|
3060
|
-
fontSize: '
|
3720
|
+
fontSize: 'text.sm',
|
3061
3721
|
h: 9.5,
|
3062
3722
|
borderRadius: 'md'
|
3063
3723
|
})
|
3064
3724
|
};
|
3065
3725
|
const sizes$1 = {
|
3066
|
-
lg: /*#__PURE__*/definePartsStyle$
|
3726
|
+
lg: /*#__PURE__*/definePartsStyle$2({
|
3067
3727
|
field: size.lg,
|
3068
3728
|
addon: size.lg
|
3069
3729
|
}),
|
3070
|
-
md: /*#__PURE__*/definePartsStyle$
|
3730
|
+
md: /*#__PURE__*/definePartsStyle$2({
|
3071
3731
|
field: size.md,
|
3072
3732
|
addon: size.md
|
3073
3733
|
}),
|
3074
|
-
sm: /*#__PURE__*/definePartsStyle$
|
3734
|
+
sm: /*#__PURE__*/definePartsStyle$2({
|
3075
3735
|
field: size.sm,
|
3076
3736
|
addon: size.sm
|
3077
3737
|
})
|
3078
3738
|
};
|
3079
|
-
|
3080
|
-
const {
|
3081
|
-
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
errorBorderColor: errorBorderColor || themeTools.mode('danger.500', 'danger.300')(props),
|
3088
|
-
readOnlyBorderColor: readOnlyBorderColor || themeTools.mode('.500', 'danger.300')(props)
|
3089
|
-
};
|
3090
|
-
}
|
3091
|
-
const outline = /*#__PURE__*/definePartsStyle$1(props => {
|
3092
|
-
const {
|
3093
|
-
theme
|
3094
|
-
} = props;
|
3095
|
-
const {
|
3096
|
-
focusBorderColor: fc,
|
3097
|
-
errorBorderColor: ec,
|
3098
|
-
readOnlyBorderColor: rc
|
3099
|
-
} = getDefaults(props);
|
3100
|
-
return {
|
3101
|
-
field: {
|
3102
|
-
border: '1px solid',
|
3103
|
-
borderColor: themeTools.mode('dark.200', 'inherit')(props),
|
3104
|
-
bg: themeTools.mode('white', 'inherit')(props),
|
3105
|
-
color: themeTools.mode('inherit', 'white')(props),
|
3106
|
-
_hover: {
|
3107
|
-
borderColor: themeTools.mode('gray.300', 'whiteAlpha.400')(props)
|
3108
|
-
},
|
3109
|
-
_readOnly: {
|
3110
|
-
userSelect: 'all',
|
3111
|
-
borderColor: themeTools.getColor(theme, rc),
|
3112
|
-
boxShadow: `0 0 0 0 ${themeTools.getColor(theme, rc)}`
|
3113
|
-
},
|
3114
|
-
_invalid: {
|
3115
|
-
borderColor: themeTools.getColor(theme, ec),
|
3116
|
-
boxShadow: `0 0 0 0 ${themeTools.getColor(theme, ec)}`
|
3117
|
-
},
|
3118
|
-
_focusVisible: {
|
3119
|
-
zIndex: 1,
|
3120
|
-
borderColor: themeTools.getColor(theme, fc),
|
3121
|
-
boxShadow: `0 0 0 0 ${themeTools.getColor(theme, fc)}`
|
3122
|
-
}
|
3739
|
+
const outline = /*#__PURE__*/definePartsStyle$2(props => {
|
3740
|
+
const field = {
|
3741
|
+
border: 0,
|
3742
|
+
outline: 0,
|
3743
|
+
bg: themeTools.mode('white', 'inherit')(props),
|
3744
|
+
color: themeTools.mode('inherit', 'white')(props),
|
3745
|
+
_invalid: {
|
3746
|
+
boxShadow: 'none'
|
3123
3747
|
},
|
3124
|
-
|
3125
|
-
|
3126
|
-
|
3127
|
-
bg: themeTools.mode('gray.100', 'whiteAlpha.300')(props)
|
3748
|
+
_focusVisible: {
|
3749
|
+
zIndex: 1,
|
3750
|
+
boxShadow: 'none'
|
3128
3751
|
}
|
3129
3752
|
};
|
3753
|
+
return {
|
3754
|
+
field
|
3755
|
+
};
|
3130
3756
|
});
|
3131
|
-
const unstyled$1 = /*#__PURE__*/definePartsStyle$
|
3757
|
+
const unstyled$1 = /*#__PURE__*/definePartsStyle$2({
|
3132
3758
|
field: {
|
3133
3759
|
bg: 'transparent',
|
3134
3760
|
px: '0',
|
@@ -3140,14 +3766,14 @@ const unstyled$1 = /*#__PURE__*/definePartsStyle$1({
|
|
3140
3766
|
height: 'auto'
|
3141
3767
|
}
|
3142
3768
|
});
|
3143
|
-
const variants$
|
3769
|
+
const variants$2 = {
|
3144
3770
|
outline,
|
3145
3771
|
unstyled: unstyled$1
|
3146
3772
|
};
|
3147
|
-
const Input = /*#__PURE__*/defineMultiStyleConfig$
|
3148
|
-
baseStyle: baseStyle$
|
3773
|
+
const Input = /*#__PURE__*/defineMultiStyleConfig$2({
|
3774
|
+
baseStyle: baseStyle$3,
|
3149
3775
|
sizes: sizes$1,
|
3150
|
-
variants: variants$
|
3776
|
+
variants: variants$2,
|
3151
3777
|
defaultProps: {
|
3152
3778
|
size: 'sm',
|
3153
3779
|
variant: 'outline'
|
@@ -3162,16 +3788,21 @@ const rotate = /*#__PURE__*/react$1.keyframes({
|
|
3162
3788
|
transform: 'rotate(360deg)'
|
3163
3789
|
}
|
3164
3790
|
});
|
3791
|
+
const getLoaderColor = color => {
|
3792
|
+
if (color === 'primary') return colors.primary[600];
|
3793
|
+
if (color === 'danger') return colors.danger[500];
|
3794
|
+
return colors.white.high;
|
3795
|
+
};
|
3165
3796
|
const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3166
3797
|
baseStyle: props => {
|
3167
|
-
const colors
|
3798
|
+
const colors = getLoaderColor(props.color);
|
3168
3799
|
return {
|
3169
3800
|
borderRadius: '50%',
|
3170
3801
|
display: 'flex',
|
3171
3802
|
justifyContent: 'center',
|
3172
3803
|
alignItems: 'center',
|
3173
3804
|
animation: `${rotate} 1s linear infinite`,
|
3174
|
-
background: `conic-gradient(from 180deg at 50% 50%, ${colors
|
3805
|
+
background: `conic-gradient(from 180deg at 50% 50%, ${colors} 0deg, rgba(217, 217, 217, 0) 360deg);`,
|
3175
3806
|
':before': {
|
3176
3807
|
content: `''`,
|
3177
3808
|
display: 'block',
|
@@ -3180,7 +3811,7 @@ const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
|
3180
3811
|
height: '6px',
|
3181
3812
|
position: 'absolute',
|
3182
3813
|
bottom: 0,
|
3183
|
-
background: colors
|
3814
|
+
background: colors
|
3184
3815
|
}
|
3185
3816
|
};
|
3186
3817
|
},
|
@@ -3246,10 +3877,10 @@ const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
|
3246
3877
|
});
|
3247
3878
|
|
3248
3879
|
const {
|
3249
|
-
definePartsStyle: definePartsStyle$
|
3880
|
+
definePartsStyle: definePartsStyle$3
|
3250
3881
|
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.popoverAnatomy.keys);
|
3251
3882
|
const Popover = {
|
3252
|
-
baseStyle: props => definePartsStyle$
|
3883
|
+
baseStyle: props => definePartsStyle$3({
|
3253
3884
|
popper: {
|
3254
3885
|
background: themeTools.mode('white', 'inherit')(props)
|
3255
3886
|
}
|
@@ -3257,132 +3888,270 @@ const Popover = {
|
|
3257
3888
|
};
|
3258
3889
|
|
3259
3890
|
const {
|
3260
|
-
definePartsStyle: definePartsStyle$
|
3261
|
-
|
3262
|
-
|
3263
|
-
|
3264
|
-
|
3265
|
-
|
3266
|
-
|
3267
|
-
|
3268
|
-
|
3269
|
-
|
3891
|
+
definePartsStyle: definePartsStyle$4,
|
3892
|
+
defineMultiStyleConfig: defineMultiStyleConfig$3
|
3893
|
+
} = /*#__PURE__*/react.createMultiStyleConfigHelpers(anatomy.radioAnatomy.keys);
|
3894
|
+
const baseStyle$4 = /*#__PURE__*/definePartsStyle$4({
|
3895
|
+
control: {
|
3896
|
+
border: '1px solid',
|
3897
|
+
width: '16px',
|
3898
|
+
height: '16px'
|
3899
|
+
},
|
3900
|
+
label: {
|
3901
|
+
marginLeft: '8px',
|
3902
|
+
textStyle: 'text.sm',
|
3903
|
+
color: 'black.high',
|
3904
|
+
_disabled: {
|
3905
|
+
color: 'black.low'
|
3906
|
+
}
|
3907
|
+
}
|
3908
|
+
});
|
3909
|
+
const errors$1 = /*#__PURE__*/definePartsStyle$4({
|
3910
|
+
control: {
|
3911
|
+
borderColor: 'danger.500',
|
3912
|
+
_checked: {
|
3913
|
+
borderColor: 'danger.500',
|
3914
|
+
bg: 'white',
|
3915
|
+
_before: {
|
3916
|
+
h: '10px',
|
3917
|
+
w: '10px',
|
3918
|
+
bg: 'danger.500'
|
3919
|
+
},
|
3920
|
+
_hover: {
|
3921
|
+
borderColor: 'danger.500',
|
3922
|
+
bg: 'gray.200'
|
3923
|
+
},
|
3924
|
+
_disabled: {
|
3925
|
+
borderColor: 'danger.500',
|
3270
3926
|
bg: 'white',
|
3271
3927
|
_before: {
|
3272
|
-
h: '
|
3273
|
-
w: '
|
3274
|
-
bg: '
|
3275
|
-
},
|
3276
|
-
_hover: {
|
3277
|
-
borderColor: 'primary.500',
|
3278
|
-
bg: 'gray.200'
|
3928
|
+
h: '10px',
|
3929
|
+
w: '10px',
|
3930
|
+
bg: 'neutral.500'
|
3279
3931
|
}
|
3280
3932
|
}
|
3933
|
+
},
|
3934
|
+
_disabled: {
|
3935
|
+
borderColor: 'danger.500',
|
3936
|
+
bg: 'neutral.500'
|
3281
3937
|
}
|
3282
|
-
}
|
3283
|
-
|
3284
|
-
|
3285
|
-
|
3286
|
-
|
3287
|
-
|
3288
|
-
|
3289
|
-
|
3290
|
-
|
3291
|
-
|
3292
|
-
|
3293
|
-
|
3294
|
-
|
3295
|
-
|
3296
|
-
|
3297
|
-
h: '4'
|
3938
|
+
},
|
3939
|
+
label: {
|
3940
|
+
fontSize: '12px'
|
3941
|
+
}
|
3942
|
+
});
|
3943
|
+
const unstyled$2 = /*#__PURE__*/definePartsStyle$4({
|
3944
|
+
control: {
|
3945
|
+
borderColor: 'neutral.600',
|
3946
|
+
_checked: {
|
3947
|
+
borderColor: 'primary.500',
|
3948
|
+
bg: 'white',
|
3949
|
+
_before: {
|
3950
|
+
h: '10px',
|
3951
|
+
w: '10px',
|
3952
|
+
bg: 'primary.500'
|
3298
3953
|
},
|
3299
|
-
|
3300
|
-
|
3301
|
-
|
3302
|
-
}),
|
3303
|
-
lg: /*#__PURE__*/definePartsStyle$3({
|
3304
|
-
control: {
|
3305
|
-
w: '5',
|
3306
|
-
h: '5'
|
3954
|
+
_hover: {
|
3955
|
+
borderColor: 'primary.500',
|
3956
|
+
bg: 'gray.200'
|
3307
3957
|
},
|
3308
|
-
|
3309
|
-
|
3958
|
+
_disabled: {
|
3959
|
+
borderColor: 'neutral.500',
|
3960
|
+
bg: 'white',
|
3961
|
+
_before: {
|
3962
|
+
h: '10px',
|
3963
|
+
w: '10px',
|
3964
|
+
bg: 'neutral.500'
|
3965
|
+
}
|
3310
3966
|
}
|
3311
|
-
}
|
3967
|
+
},
|
3968
|
+
_disabled: {
|
3969
|
+
borderColor: 'neutral.500',
|
3970
|
+
bg: 'neutral.500'
|
3971
|
+
}
|
3312
3972
|
},
|
3313
|
-
|
3314
|
-
|
3315
|
-
// The default size and variant values
|
3316
|
-
defaultProps: {
|
3317
|
-
size: 'sm',
|
3318
|
-
variant: 'solid',
|
3319
|
-
orientation: 'vertical',
|
3320
|
-
colorScheme: 'primary'
|
3973
|
+
label: {
|
3974
|
+
fontSize: '12px'
|
3321
3975
|
}
|
3976
|
+
});
|
3977
|
+
const variants$3 = {
|
3978
|
+
errors: errors$1,
|
3979
|
+
unstyled: unstyled$2
|
3322
3980
|
};
|
3981
|
+
const Radio = /*#__PURE__*/defineMultiStyleConfig$3({
|
3982
|
+
baseStyle: baseStyle$4,
|
3983
|
+
variants: variants$3,
|
3984
|
+
defaultProps: {
|
3985
|
+
variant: 'unstyled'
|
3986
|
+
}
|
3987
|
+
});
|
3323
3988
|
|
3324
3989
|
const {
|
3325
|
-
|
3326
|
-
|
3327
|
-
} = /*#__PURE__*/
|
3328
|
-
const
|
3329
|
-
|
3990
|
+
defineMultiStyleConfig: defineMultiStyleConfig$4,
|
3991
|
+
definePartsStyle: definePartsStyle$5
|
3992
|
+
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.switchAnatomy.keys);
|
3993
|
+
const $width = /*#__PURE__*/themeTools.cssVar('switch-track-width');
|
3994
|
+
const $height = /*#__PURE__*/themeTools.cssVar('switch-track-height');
|
3995
|
+
const $diff = /*#__PURE__*/themeTools.cssVar('switch-track-diff');
|
3996
|
+
const diffValue = /*#__PURE__*/themeTools.calc.subtract($width, $height);
|
3997
|
+
const $translateX = /*#__PURE__*/themeTools.cssVar('switch-thumb-x');
|
3998
|
+
const baseStyleThumb = /*#__PURE__*/styledSystem.defineStyle({
|
3999
|
+
bg: 'white',
|
4000
|
+
transitionProperty: 'transform',
|
4001
|
+
transitionDuration: 'normal',
|
4002
|
+
borderRadius: 'inherit',
|
4003
|
+
width: [$height.reference],
|
4004
|
+
height: [$height.reference],
|
4005
|
+
_checked: {
|
4006
|
+
transform: `translateX(${$translateX.reference})`
|
4007
|
+
}
|
4008
|
+
});
|
4009
|
+
const baseStyle$5 = /*#__PURE__*/definePartsStyle$5(() => ({
|
3330
4010
|
container: {
|
3331
|
-
|
3332
|
-
|
3333
|
-
|
3334
|
-
|
4011
|
+
[$diff.variable]: diffValue,
|
4012
|
+
[$translateX.variable]: $diff.reference,
|
4013
|
+
_rtl: {
|
4014
|
+
[$translateX.variable]: themeTools.calc($diff).negate().toString()
|
4015
|
+
}
|
3335
4016
|
},
|
3336
4017
|
track: {
|
3337
4018
|
bg: 'neutral.400',
|
3338
4019
|
p: 1,
|
3339
4020
|
_checked: {
|
3340
|
-
bg: 'primary.500'
|
4021
|
+
bg: 'primary.500',
|
4022
|
+
_disabled: {
|
4023
|
+
bg: 'neutral.600'
|
4024
|
+
}
|
4025
|
+
},
|
4026
|
+
_disabled: {
|
4027
|
+
bg: 'neutral.500',
|
4028
|
+
opacity: '100%'
|
3341
4029
|
}
|
4030
|
+
},
|
4031
|
+
thumb: baseStyleThumb
|
4032
|
+
}));
|
4033
|
+
const sizes$2 = {
|
4034
|
+
sm: /*#__PURE__*/definePartsStyle$5({
|
4035
|
+
container: {
|
4036
|
+
[$width.variable]: '2.125rem',
|
4037
|
+
[$height.variable]: '1.063rem'
|
4038
|
+
}
|
4039
|
+
}),
|
4040
|
+
md: /*#__PURE__*/definePartsStyle$5({
|
4041
|
+
container: {
|
4042
|
+
[$width.variable]: '2.875rem',
|
4043
|
+
[$height.variable]: '1.5rem'
|
4044
|
+
}
|
4045
|
+
}),
|
4046
|
+
lg: /*#__PURE__*/definePartsStyle$5({
|
4047
|
+
container: {
|
4048
|
+
[$width.variable]: '3.625rem',
|
4049
|
+
[$height.variable]: '1.813rem'
|
4050
|
+
}
|
4051
|
+
})
|
4052
|
+
};
|
4053
|
+
const Switch$1 = /*#__PURE__*/defineMultiStyleConfig$4({
|
4054
|
+
baseStyle: baseStyle$5,
|
4055
|
+
sizes: sizes$2,
|
4056
|
+
defaultProps: {
|
4057
|
+
size: 'md'
|
3342
4058
|
}
|
3343
4059
|
});
|
3344
|
-
const Switch = /*#__PURE__*/defineMultiStyleConfig$2({
|
3345
|
-
baseStyle: baseStyle$3
|
3346
|
-
});
|
3347
4060
|
|
3348
|
-
const
|
3349
|
-
|
4061
|
+
const getProps = props => {
|
4062
|
+
const {
|
4063
|
+
isError,
|
4064
|
+
isSuccess,
|
4065
|
+
isDisabled
|
4066
|
+
} = props;
|
4067
|
+
let borderColor = 'neutral.400';
|
4068
|
+
let focusBorderColor = 'primary.500';
|
4069
|
+
if (isError) {
|
4070
|
+
borderColor = 'danger.500';
|
4071
|
+
focusBorderColor = 'danger.500';
|
4072
|
+
} else if (isSuccess) {
|
4073
|
+
borderColor = 'success.500';
|
4074
|
+
focusBorderColor = 'success.500';
|
4075
|
+
} else if (isDisabled && !isError && !isSuccess) {
|
4076
|
+
borderColor = 'neutral.400';
|
4077
|
+
focusBorderColor = 'danger.500';
|
4078
|
+
}
|
4079
|
+
return {
|
4080
|
+
focusBorderColor,
|
4081
|
+
borderColor
|
4082
|
+
};
|
4083
|
+
};
|
4084
|
+
const outline$1 = /*#__PURE__*/react.defineStyle(props => {
|
4085
|
+
const {
|
4086
|
+
focusBorderColor,
|
4087
|
+
borderColor
|
4088
|
+
} = getProps(props);
|
4089
|
+
return {
|
4090
|
+
background: 'white.high',
|
4091
|
+
color: 'black.high',
|
4092
|
+
borderColor,
|
4093
|
+
fontSize: 'text.sm',
|
4094
|
+
padding: 2,
|
4095
|
+
borderRadius: 'md',
|
4096
|
+
borderWidth: '1px',
|
4097
|
+
outline: 'none',
|
4098
|
+
_disabled: {
|
4099
|
+
opacity: 1,
|
4100
|
+
color: 'black.medium',
|
4101
|
+
background: 'neutral.300'
|
4102
|
+
},
|
4103
|
+
_placeholder: {
|
4104
|
+
color: 'black.low'
|
4105
|
+
},
|
3350
4106
|
_hover: {
|
3351
|
-
borderColor
|
3352
|
-
boxShadow: 'none',
|
3353
|
-
outline: 'none'
|
4107
|
+
borderColor
|
3354
4108
|
},
|
3355
4109
|
_focus: {
|
3356
|
-
|
3357
|
-
|
3358
|
-
|
4110
|
+
outline: 'none',
|
4111
|
+
borderColor: focusBorderColor,
|
4112
|
+
boxShadow: 'none'
|
3359
4113
|
},
|
3360
4114
|
_focusVisible: {
|
3361
|
-
|
3362
|
-
|
3363
|
-
|
4115
|
+
outline: 'none',
|
4116
|
+
borderColor: focusBorderColor,
|
4117
|
+
boxShadow: 'none'
|
3364
4118
|
},
|
3365
4119
|
_focusWithin: {
|
3366
|
-
|
3367
|
-
|
3368
|
-
|
4120
|
+
outline: 'none',
|
4121
|
+
borderColor: focusBorderColor,
|
4122
|
+
boxShadow: 'none'
|
4123
|
+
},
|
4124
|
+
_invalid: {
|
4125
|
+
outline: 'none',
|
4126
|
+
borderColor: 'danger.500',
|
4127
|
+
boxShadow: 'none'
|
3369
4128
|
}
|
4129
|
+
};
|
4130
|
+
});
|
4131
|
+
const Textarea = /*#__PURE__*/react.defineStyleConfig({
|
4132
|
+
variants: {
|
4133
|
+
outline: outline$1
|
4134
|
+
},
|
4135
|
+
defaultProps: {
|
4136
|
+
variant: 'outline'
|
3370
4137
|
}
|
3371
|
-
};
|
4138
|
+
});
|
3372
4139
|
|
3373
4140
|
|
3374
4141
|
|
3375
4142
|
var components = {
|
3376
4143
|
__proto__: null,
|
3377
|
-
|
4144
|
+
Alert: alertTheme,
|
4145
|
+
Button: Button$1,
|
3378
4146
|
Card: CardStyle,
|
3379
4147
|
Checkbox: Checkbox,
|
4148
|
+
Chips: Chips,
|
3380
4149
|
FormLabel: FormLabel,
|
3381
4150
|
Input: Input,
|
3382
4151
|
LoaderStyle: LoaderStyle,
|
3383
4152
|
Popover: Popover,
|
3384
4153
|
Radio: Radio,
|
3385
|
-
Switch: Switch,
|
4154
|
+
Switch: Switch$1,
|
3386
4155
|
Textarea: Textarea
|
3387
4156
|
};
|
3388
4157
|
|
@@ -3678,13 +4447,19 @@ Object.defineProperty(exports, 'useTabsStyles', {
|
|
3678
4447
|
return react.useTabsStyles;
|
3679
4448
|
}
|
3680
4449
|
});
|
4450
|
+
exports.Box = react.Box;
|
3681
4451
|
exports.BreadCrumb = BreadCrumb;
|
4452
|
+
exports.Button = Button;
|
3682
4453
|
exports.Card = CardCustom;
|
3683
4454
|
exports.Checkbox = CheckboxComponent;
|
4455
|
+
exports.CheckboxGroup = CheckboxGroupComponent;
|
4456
|
+
exports.Container = react.Container;
|
3684
4457
|
exports.DataTable = DataTable;
|
3685
4458
|
exports.DatePickerMonth = DatePickerMonth;
|
3686
4459
|
exports.Datepicker = Datepicker;
|
3687
4460
|
exports.Field = Field;
|
4461
|
+
exports.Flex = react.Flex;
|
4462
|
+
exports.Grid = react.Grid;
|
3688
4463
|
exports.Header = Header;
|
3689
4464
|
exports.InputField = InputField;
|
3690
4465
|
exports.Loader = Loader;
|
@@ -3699,15 +4474,22 @@ exports.PaginationDetail = PaginationDetail;
|
|
3699
4474
|
exports.PaginationFilter = PaginationFilter;
|
3700
4475
|
exports.Provider = Provider;
|
3701
4476
|
exports.ProviderContext = ProviderContext;
|
4477
|
+
exports.Radio = RadioComponent;
|
4478
|
+
exports.RadioGroup = RadioGroupComponent;
|
3702
4479
|
exports.Select = Select;
|
3703
4480
|
exports.SelectAsync = SelectAsync;
|
3704
4481
|
exports.SelectAsyncCreatable = SelectAsyncCreatable;
|
3705
4482
|
exports.SelectCreatable = SelectCreatable;
|
4483
|
+
exports.Stack = react.Stack;
|
4484
|
+
exports.Switch = Switch;
|
3706
4485
|
exports.Tab = Tab;
|
3707
4486
|
exports.TabList = TabList;
|
3708
4487
|
exports.TabPanel = TabPanel;
|
4488
|
+
exports.Text = react.Text;
|
3709
4489
|
exports.TextareaField = TextareaField;
|
3710
4490
|
exports.Uploader = Uploader;
|
4491
|
+
exports.Wrap = react.Wrap;
|
4492
|
+
exports.foundations = foundations;
|
3711
4493
|
exports.theme = theme;
|
3712
4494
|
exports.useInternalUI = useInternalUI;
|
3713
4495
|
//# sourceMappingURL=internal-ui.cjs.development.js.map
|