@ctlyst.id/internal-ui 2.0.0-canary.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/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/card/__stories__/card.stories.d.ts +11 -0
- package/dist/components/card/components/card.d.ts +8 -0
- package/dist/components/card/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 -2
- package/dist/components/form/__stories__/input.stories.d.ts +14 -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/form/index.d.ts +2 -0
- package/dist/components/form/styles/input-field.d.ts +4 -0
- package/dist/components/index.d.ts +7 -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/card.d.ts +18 -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 +3 -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/themeConfiguration.d.ts +4 -2
- package/dist/internal-ui.cjs.development.js +1088 -316
- 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 +1073 -316
- 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,17 +15,41 @@ 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
25
|
var anatomy = require('@chakra-ui/anatomy');
|
25
26
|
var styledSystem = require('@chakra-ui/styled-system');
|
26
|
-
require('@
|
27
|
+
var themeTools = require('@chakra-ui/theme-tools');
|
27
28
|
var axios = _interopDefault(require('axios'));
|
28
29
|
|
30
|
+
const Badge = props => {
|
31
|
+
const {
|
32
|
+
children,
|
33
|
+
pill,
|
34
|
+
...rest
|
35
|
+
} = props;
|
36
|
+
return /*#__PURE__*/React__default.createElement(react.Badge, Object.assign({
|
37
|
+
borderRadius: pill ? 10 : 4,
|
38
|
+
variant: "solid",
|
39
|
+
color: "white",
|
40
|
+
fontSize: "10px",
|
41
|
+
padding: "0 8px",
|
42
|
+
height: "18px",
|
43
|
+
display: "flex",
|
44
|
+
alignItems: "center",
|
45
|
+
justifyContent: "space-between",
|
46
|
+
textTransform: "none"
|
47
|
+
}, rest), children);
|
48
|
+
};
|
49
|
+
Badge.defaultProps = {
|
50
|
+
pill: false
|
51
|
+
};
|
52
|
+
|
29
53
|
/* eslint-disable react-hooks/rules-of-hooks */
|
30
54
|
const BreadCrumb = props => {
|
31
55
|
const {
|
@@ -121,6 +145,57 @@ BreadCrumb.defaultProps = {
|
|
121
145
|
spacing: 2
|
122
146
|
};
|
123
147
|
|
148
|
+
const Loader = /*#__PURE__*/react.forwardRef((props, ref) => {
|
149
|
+
const styles = react.useStyleConfig('LoaderStyle', props);
|
150
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
151
|
+
ref: ref,
|
152
|
+
__css: styles
|
153
|
+
});
|
154
|
+
});
|
155
|
+
|
156
|
+
const Button = props => {
|
157
|
+
const {
|
158
|
+
children,
|
159
|
+
variant,
|
160
|
+
size,
|
161
|
+
...rest
|
162
|
+
} = props;
|
163
|
+
const getLoaderSize = () => {
|
164
|
+
if (size === 'lg') return 'md';
|
165
|
+
if (size === 'md') return 'sm';
|
166
|
+
return 'xs';
|
167
|
+
};
|
168
|
+
const getLoaderColor = () => {
|
169
|
+
if (variant === 'primary' || variant === 'danger') return 'white';
|
170
|
+
if (variant === 'outline-danger') return 'danger';
|
171
|
+
return 'primary';
|
172
|
+
};
|
173
|
+
return /*#__PURE__*/React__default.createElement(react.Button, Object.assign({
|
174
|
+
size: size,
|
175
|
+
variant: variant,
|
176
|
+
spinner: /*#__PURE__*/React__default.createElement(Loader, {
|
177
|
+
size: getLoaderSize(),
|
178
|
+
color: getLoaderColor()
|
179
|
+
})
|
180
|
+
}, rest), children);
|
181
|
+
};
|
182
|
+
|
183
|
+
const CardCustom = /*#__PURE__*/React.forwardRef(({
|
184
|
+
children,
|
185
|
+
...rest
|
186
|
+
}, ref) => {
|
187
|
+
const styles = react.useStyleConfig('Card', rest);
|
188
|
+
return /*#__PURE__*/React__default.createElement(react.Card, Object.assign({
|
189
|
+
__css: styles,
|
190
|
+
backgroundColor: "white.high",
|
191
|
+
ref: ref
|
192
|
+
}, rest), children);
|
193
|
+
});
|
194
|
+
CardCustom.defaultProps = {
|
195
|
+
withShadow: true,
|
196
|
+
isRounded: true
|
197
|
+
};
|
198
|
+
|
124
199
|
function CheckboxComponent({
|
125
200
|
isError = false,
|
126
201
|
helpText = '',
|
@@ -136,12 +211,10 @@ function CheckboxComponent({
|
|
136
211
|
variant: variant
|
137
212
|
}, rest, {
|
138
213
|
isDisabled: isDisabled
|
139
|
-
})
|
140
|
-
ml: "8px"
|
141
|
-
}, /*#__PURE__*/React__default.createElement(react.Text, {
|
214
|
+
}), children && /*#__PURE__*/React__default.createElement(react.Text, {
|
142
215
|
textStyle: "text.sm",
|
143
216
|
color: isDisabled ? 'black.low' : 'black.high'
|
144
|
-
}, children)))
|
217
|
+
}, children))), /*#__PURE__*/React__default.createElement(react.Box, {
|
145
218
|
mt: "5px",
|
146
219
|
ml: "24px"
|
147
220
|
}, isError ? /*#__PURE__*/React__default.createElement(react.Text, {
|
@@ -149,7 +222,7 @@ function CheckboxComponent({
|
|
149
222
|
color: "danger.500"
|
150
223
|
}, errorText) : /*#__PURE__*/React__default.createElement(react.Text, {
|
151
224
|
textStyle: "text.xs",
|
152
|
-
color:
|
225
|
+
color: "black.medium"
|
153
226
|
}, helpText)));
|
154
227
|
}
|
155
228
|
CheckboxComponent.defaultProps = {
|
@@ -158,6 +231,95 @@ CheckboxComponent.defaultProps = {
|
|
158
231
|
errorText: ''
|
159
232
|
};
|
160
233
|
|
234
|
+
/* eslint-disable no-nested-ternary */
|
235
|
+
const Field = props => {
|
236
|
+
const {
|
237
|
+
label,
|
238
|
+
isError,
|
239
|
+
errorMessage,
|
240
|
+
leftHelperText,
|
241
|
+
rightHelperText,
|
242
|
+
isRequired,
|
243
|
+
children,
|
244
|
+
isSuccess
|
245
|
+
} = props;
|
246
|
+
const getHelperColor = () => {
|
247
|
+
if (isError) return 'danger.500';
|
248
|
+
if (isSuccess) return 'success.500';
|
249
|
+
return 'black.medium';
|
250
|
+
};
|
251
|
+
const getJustifyContentHelper = () => {
|
252
|
+
if (rightHelperText && (!leftHelperText || isError && !errorMessage)) return 'flex-end';
|
253
|
+
return 'space-between';
|
254
|
+
};
|
255
|
+
const helperColor = getHelperColor();
|
256
|
+
const justifyHelper = getJustifyContentHelper();
|
257
|
+
return /*#__PURE__*/React__default.createElement(react.FormControl, {
|
258
|
+
isInvalid: isError
|
259
|
+
}, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(react.FormLabel, {
|
260
|
+
mb: 1,
|
261
|
+
fontSize: "text.sm",
|
262
|
+
requiredIndicator: undefined
|
263
|
+
}, isRequired && /*#__PURE__*/React__default.createElement(react.Box, {
|
264
|
+
as: "span",
|
265
|
+
color: "danger.500",
|
266
|
+
ml: 0,
|
267
|
+
mr: 1
|
268
|
+
}, "*"), label) : label), children, (isError && errorMessage || leftHelperText || rightHelperText) && /*#__PURE__*/React__default.createElement(react.Box, {
|
269
|
+
display: "flex",
|
270
|
+
width: "full",
|
271
|
+
justifyContent: justifyHelper
|
272
|
+
}, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
273
|
+
fontSize: "text.xs",
|
274
|
+
color: helperColor,
|
275
|
+
mt: 1
|
276
|
+
}, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(react.FormErrorMessage, {
|
277
|
+
fontSize: "text.xs",
|
278
|
+
color: "danger.500",
|
279
|
+
mt: 1
|
280
|
+
}, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
281
|
+
fontSize: "text.xs",
|
282
|
+
color: helperColor,
|
283
|
+
mt: 1
|
284
|
+
}, rightHelperText)));
|
285
|
+
};
|
286
|
+
Field.defaultProps = {
|
287
|
+
label: '',
|
288
|
+
isError: false,
|
289
|
+
isSuccess: false,
|
290
|
+
errorMessage: undefined,
|
291
|
+
leftHelperText: undefined,
|
292
|
+
rightHelperText: undefined,
|
293
|
+
isRequired: false
|
294
|
+
};
|
295
|
+
|
296
|
+
function CheckboxGroupComponent(props) {
|
297
|
+
const {
|
298
|
+
children,
|
299
|
+
label,
|
300
|
+
helpText,
|
301
|
+
isError,
|
302
|
+
errorMessage,
|
303
|
+
...rest
|
304
|
+
} = props;
|
305
|
+
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, rest, {
|
306
|
+
label: label,
|
307
|
+
leftHelperText: helpText,
|
308
|
+
isError: isError,
|
309
|
+
errorMessage: errorMessage
|
310
|
+
}), /*#__PURE__*/React__default.createElement(react.Box, {
|
311
|
+
mt: "12px"
|
312
|
+
}, /*#__PURE__*/React__default.createElement(react.CheckboxGroup, Object.assign({}, rest), /*#__PURE__*/React__default.createElement(react.Stack, {
|
313
|
+
spacing: [1, '16px'],
|
314
|
+
direction: ['column', 'row']
|
315
|
+
}, children))));
|
316
|
+
}
|
317
|
+
CheckboxGroupComponent.defaultProps = {
|
318
|
+
helpText: '',
|
319
|
+
isError: false,
|
320
|
+
errorMessage: ''
|
321
|
+
};
|
322
|
+
|
161
323
|
const IndeterminateCheckbox = ({
|
162
324
|
indeterminate = false,
|
163
325
|
...rest
|
@@ -1754,69 +1916,60 @@ MultiDatePickerMonth.defaultProps = {
|
|
1754
1916
|
isError: false
|
1755
1917
|
};
|
1756
1918
|
|
1757
|
-
|
1758
|
-
const Field = props => {
|
1919
|
+
const getProperties = props => {
|
1759
1920
|
const {
|
1760
|
-
label,
|
1761
1921
|
isError,
|
1762
|
-
|
1763
|
-
|
1764
|
-
rightHelperText,
|
1765
|
-
isRequired,
|
1766
|
-
children,
|
1767
|
-
isSuccess,
|
1768
|
-
isDisabled
|
1922
|
+
isDisabled,
|
1923
|
+
isSuccess
|
1769
1924
|
} = props;
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
if (
|
1774
|
-
|
1925
|
+
let outlineColor = 'neutral.400';
|
1926
|
+
let focusColor = 'primary.500';
|
1927
|
+
if (isError || isDisabled || isSuccess) {
|
1928
|
+
if (isError) outlineColor = 'danger.500';else if (isSuccess) outlineColor = 'success.500';
|
1929
|
+
focusColor = outlineColor;
|
1930
|
+
}
|
1931
|
+
return {
|
1932
|
+
outlineColor,
|
1933
|
+
focusColor
|
1775
1934
|
};
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1935
|
+
};
|
1936
|
+
const getWrapperStyle = props => {
|
1937
|
+
const {
|
1938
|
+
outlineColor,
|
1939
|
+
focusColor
|
1940
|
+
} = getProperties(props);
|
1941
|
+
const style = {
|
1942
|
+
border: '1px solid',
|
1943
|
+
borderColor: outlineColor,
|
1944
|
+
borderRadius: 'md',
|
1945
|
+
transition: 'all 0.15s',
|
1946
|
+
boxShadow: 'none',
|
1947
|
+
_focusWithin: {
|
1948
|
+
borderColor: focusColor
|
1949
|
+
}
|
1779
1950
|
};
|
1780
|
-
|
1781
|
-
const justifyHelper = getJustifyContentHelper();
|
1782
|
-
return /*#__PURE__*/React__default.createElement(react.FormControl, {
|
1783
|
-
isInvalid: isError
|
1784
|
-
}, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(react.FormLabel, {
|
1785
|
-
mb: 1,
|
1786
|
-
fontSize: "text.sm",
|
1787
|
-
requiredIndicator: undefined
|
1788
|
-
}, isRequired && /*#__PURE__*/React__default.createElement(react.Box, {
|
1789
|
-
as: "span",
|
1790
|
-
color: "danger.500",
|
1791
|
-
ml: 0,
|
1792
|
-
mr: 1
|
1793
|
-
}, "*"), label) : label), children, (isError && errorMessage || leftHelperText || rightHelperText) && /*#__PURE__*/React__default.createElement(react.Box, {
|
1794
|
-
display: "flex",
|
1795
|
-
width: "full",
|
1796
|
-
justifyContent: justifyHelper
|
1797
|
-
}, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
1798
|
-
fontSize: "text.xs",
|
1799
|
-
color: helperColor,
|
1800
|
-
mt: 1
|
1801
|
-
}, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(react.FormErrorMessage, {
|
1802
|
-
fontSize: "text.xs",
|
1803
|
-
color: "danger.500",
|
1804
|
-
mt: 1
|
1805
|
-
}, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
1806
|
-
fontSize: "text.xs",
|
1807
|
-
color: helperColor,
|
1808
|
-
mt: 1
|
1809
|
-
}, rightHelperText)));
|
1951
|
+
return react.defineStyle(style);
|
1810
1952
|
};
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1953
|
+
|
1954
|
+
const InputAddonLeft = ({
|
1955
|
+
children
|
1956
|
+
}) => {
|
1957
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
1958
|
+
borderLeftRadius: "md",
|
1959
|
+
backgroundColor: "neutral.200",
|
1960
|
+
px: 3,
|
1961
|
+
py: 2.5
|
1962
|
+
}, children);
|
1963
|
+
};
|
1964
|
+
const InputAddonRight = ({
|
1965
|
+
children
|
1966
|
+
}) => {
|
1967
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
1968
|
+
borderRightRadius: "md",
|
1969
|
+
backgroundColor: "neutral.200",
|
1970
|
+
px: 3,
|
1971
|
+
py: 2.5
|
1972
|
+
}, children);
|
1820
1973
|
};
|
1821
1974
|
|
1822
1975
|
const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
@@ -1836,40 +1989,99 @@ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
1836
1989
|
errorMessage,
|
1837
1990
|
leftHelperText,
|
1838
1991
|
rightHelperText,
|
1992
|
+
withClear,
|
1993
|
+
onClear,
|
1994
|
+
isLoading,
|
1839
1995
|
...inputProps
|
1840
1996
|
} = props;
|
1997
|
+
const wrapperStyle = getWrapperStyle(props);
|
1998
|
+
const [isShowPassword, setIsShowPassword] = React.useState(false);
|
1999
|
+
const inputType = React.useMemo(() => {
|
2000
|
+
return type === 'password' && isShowPassword ? 'text' : type;
|
2001
|
+
}, [isShowPassword, type]);
|
2002
|
+
const fontSize = React.useMemo(() => {
|
2003
|
+
if (type === 'password') {
|
2004
|
+
if (!isShowPassword && value) return 'text.xl';
|
2005
|
+
}
|
2006
|
+
return 'text.sm';
|
2007
|
+
}, [isShowPassword, type, value]);
|
2008
|
+
const iconColor = React.useMemo(() => {
|
2009
|
+
return isDisabled ? 'black.low' : 'black.medium';
|
2010
|
+
}, [isDisabled]);
|
1841
2011
|
return /*#__PURE__*/React__default.createElement(Field, {
|
1842
2012
|
label: label,
|
1843
2013
|
isSuccess: isSuccess,
|
1844
|
-
isDisabled: isDisabled,
|
1845
2014
|
isError: isError,
|
1846
2015
|
errorMessage: errorMessage,
|
1847
2016
|
leftHelperText: leftHelperText,
|
1848
2017
|
rightHelperText: rightHelperText,
|
1849
2018
|
isRequired: isRequired
|
2019
|
+
}, /*#__PURE__*/React__default.createElement(react.Box, {
|
2020
|
+
__css: wrapperStyle
|
1850
2021
|
}, /*#__PURE__*/React__default.createElement(react.InputGroup, {
|
1851
|
-
size: size
|
1852
|
-
|
2022
|
+
size: size,
|
2023
|
+
borderRadius: "md",
|
2024
|
+
backgroundColor: isDisabled ? 'neutral.300' : 'white.high',
|
2025
|
+
cursor: isDisabled ? 'not-allowed' : 'default'
|
2026
|
+
}, addOnLeft && /*#__PURE__*/React__default.createElement(InputAddonLeft, null, addOnLeft), /*#__PURE__*/React__default.createElement(react.Input, Object.assign({
|
1853
2027
|
ref: ref,
|
1854
|
-
type:
|
1855
|
-
value: value
|
1856
|
-
|
2028
|
+
type: inputType,
|
2029
|
+
value: value,
|
2030
|
+
isDisabled: isDisabled,
|
2031
|
+
isSuccess: isSuccess
|
2032
|
+
}, inputProps, {
|
2033
|
+
fontSize: fontSize
|
2034
|
+
})), (withClear || isLoading || type === 'password') && /*#__PURE__*/React__default.createElement(react.Box, {
|
2035
|
+
"data-test-id": "Pg7ttgRey7InxE4qzTjW_",
|
2036
|
+
display: "flex",
|
2037
|
+
alignItems: "center",
|
2038
|
+
justifyContent: "center",
|
2039
|
+
width: "16px",
|
2040
|
+
mr: "10px"
|
2041
|
+
}, withClear && !isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
2042
|
+
display: "flex",
|
2043
|
+
justifyContent: "center",
|
2044
|
+
onClick: !isDisabled ? onClear : undefined,
|
2045
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer'
|
2046
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.Close, {
|
2047
|
+
size: 4,
|
2048
|
+
color: iconColor
|
2049
|
+
})), type === 'password' && !isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
2050
|
+
"data-test-id": "q2Bj2G4FlamXyHuRKMZ1Q",
|
2051
|
+
onClick: () => {
|
2052
|
+
if (!isDisabled) setIsShowPassword(true);
|
2053
|
+
},
|
2054
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
2055
|
+
display: "flex",
|
2056
|
+
justifyContent: "center"
|
2057
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.EyeOff, {
|
2058
|
+
size: 4,
|
2059
|
+
color: iconColor
|
2060
|
+
})), type === 'password' && isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
2061
|
+
"data-test-id": "sfc2388bmeXBmdla45Ibk",
|
2062
|
+
onClick: () => {
|
2063
|
+
if (!isDisabled) setIsShowPassword(false);
|
2064
|
+
},
|
2065
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
2066
|
+
display: "flex",
|
2067
|
+
justifyContent: "center"
|
2068
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.Eye, {
|
2069
|
+
size: 4,
|
2070
|
+
color: iconColor
|
2071
|
+
})), isLoading && /*#__PURE__*/React__default.createElement(Loader, {
|
2072
|
+
size: "sm"
|
2073
|
+
})), "(", addOnRight && /*#__PURE__*/React__default.createElement(InputAddonRight, null, addOnRight))));
|
1857
2074
|
});
|
1858
2075
|
InputField.defaultProps = {
|
1859
2076
|
addOnLeft: undefined,
|
1860
2077
|
addOnRight: undefined,
|
1861
2078
|
elementLeft: undefined,
|
1862
|
-
elementRight: undefined
|
2079
|
+
elementRight: undefined,
|
2080
|
+
withClear: undefined,
|
2081
|
+
isLoading: undefined,
|
2082
|
+
onClear: undefined
|
1863
2083
|
};
|
1864
2084
|
|
1865
|
-
const Loader = /*#__PURE__*/react.forwardRef((props, ref) => {
|
1866
|
-
const styles = react.useStyleConfig('LoaderStyle', props);
|
1867
|
-
return /*#__PURE__*/React__default.createElement(react.Box, {
|
1868
|
-
ref: ref,
|
1869
|
-
__css: styles
|
1870
|
-
});
|
1871
|
-
});
|
1872
|
-
|
1873
2085
|
const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
1874
2086
|
const {
|
1875
2087
|
value,
|
@@ -1899,7 +2111,7 @@ const XMSLogo = () => /*#__PURE__*/React__default.createElement(react.Image, {
|
|
1899
2111
|
src: react.useColorModeValue('https://assets.voila.id/xms/logo-xms.jpg', 'https://assets.voila.id/xms/logo-xms-dark.png')
|
1900
2112
|
});
|
1901
2113
|
const VoilaLogo = () => /*#__PURE__*/React__default.createElement(react.Image, {
|
1902
|
-
src: "https://
|
2114
|
+
src: "https://assets.voila.id/xms/logo-voila-black.png?v=1",
|
1903
2115
|
filter: react.useColorModeValue('none', 'invert(1)'),
|
1904
2116
|
maxW: 24
|
1905
2117
|
});
|
@@ -2480,21 +2692,83 @@ PaginationFilter.defaultProps = {
|
|
2480
2692
|
label: undefined
|
2481
2693
|
};
|
2482
2694
|
|
2483
|
-
|
2695
|
+
function RadioComponent({
|
2696
|
+
isError = false,
|
2697
|
+
helpText = '',
|
2698
|
+
errorText = '',
|
2484
2699
|
children,
|
2485
|
-
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2700
|
+
isDisabled,
|
2701
|
+
...rest
|
2702
|
+
}) {
|
2703
|
+
const variant = isError ? 'errors' : 'unstyled';
|
2704
|
+
return /*#__PURE__*/React__default.createElement(react.Box, null, /*#__PURE__*/React__default.createElement(react.Box, {
|
2705
|
+
display: "flex"
|
2706
|
+
}, /*#__PURE__*/React__default.createElement(react.Radio, Object.assign({
|
2707
|
+
variant: variant
|
2708
|
+
}, rest, {
|
2709
|
+
isDisabled: isDisabled
|
2710
|
+
}), children && /*#__PURE__*/React__default.createElement(react.Text, {
|
2711
|
+
textStyle: "text.sm",
|
2712
|
+
color: isDisabled ? 'black.low' : 'black.high'
|
2713
|
+
}, children))), /*#__PURE__*/React__default.createElement(react.Box, {
|
2714
|
+
mt: "5px",
|
2715
|
+
ml: "24px"
|
2716
|
+
}, isError ? /*#__PURE__*/React__default.createElement(react.Text, {
|
2717
|
+
textStyle: "text.xs",
|
2718
|
+
color: "danger.500"
|
2719
|
+
}, errorText) : /*#__PURE__*/React__default.createElement(react.Text, {
|
2720
|
+
textStyle: "text.xs",
|
2721
|
+
color: "black.medium"
|
2722
|
+
}, helpText)));
|
2723
|
+
}
|
2724
|
+
RadioComponent.defaultProps = {
|
2725
|
+
isError: false,
|
2726
|
+
helpText: '',
|
2727
|
+
errorText: ''
|
2728
|
+
};
|
2729
|
+
|
2730
|
+
function RadioGroupComponent(props) {
|
2731
|
+
const {
|
2732
|
+
children,
|
2733
|
+
label,
|
2734
|
+
helpText,
|
2735
|
+
isError,
|
2736
|
+
errorMessage,
|
2737
|
+
...rest
|
2738
|
+
} = props;
|
2739
|
+
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, rest, {
|
2740
|
+
label: label,
|
2741
|
+
leftHelperText: helpText,
|
2742
|
+
isError: isError,
|
2743
|
+
errorMessage: errorMessage
|
2744
|
+
}), /*#__PURE__*/React__default.createElement(react.Box, {
|
2745
|
+
mt: "12px"
|
2746
|
+
}, /*#__PURE__*/React__default.createElement(react.RadioGroup, Object.assign({}, rest), /*#__PURE__*/React__default.createElement(react.Stack, {
|
2747
|
+
spacing: [1, '16px'],
|
2748
|
+
direction: ['column', 'row']
|
2749
|
+
}, children))));
|
2750
|
+
}
|
2751
|
+
RadioGroupComponent.defaultProps = {
|
2752
|
+
helpText: '',
|
2753
|
+
isError: false,
|
2754
|
+
errorMessage: ''
|
2755
|
+
};
|
2756
|
+
|
2757
|
+
const SelectWrapper = ({
|
2758
|
+
children,
|
2759
|
+
isError = false
|
2760
|
+
}) => {
|
2761
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
2762
|
+
css: react$1.css`
|
2763
|
+
.react-select__control {
|
2764
|
+
border-color: ${isError ? colors.danger['500'] : colors.neutral['500']} !important;
|
2765
|
+
}
|
2766
|
+
|
2767
|
+
.react-select__control:hover {
|
2768
|
+
border-color: ${isError ? colors.danger['500'] : colors.primary['500']} !important;
|
2769
|
+
}
|
2770
|
+
`
|
2771
|
+
}, children);
|
2498
2772
|
};
|
2499
2773
|
SelectWrapper.defaultProps = {
|
2500
2774
|
isError: false
|
@@ -2672,6 +2946,95 @@ function SelectCreatable({
|
|
2672
2946
|
})));
|
2673
2947
|
}
|
2674
2948
|
|
2949
|
+
/**
|
2950
|
+
* The `Switch` component is used as an alternative for the checkbox component for switching between "enabled" and "disabled" states.
|
2951
|
+
*
|
2952
|
+
* @see Docs https://chakra-ui.com/docs/components/switch
|
2953
|
+
* @see WAI-ARIA https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
2954
|
+
*/
|
2955
|
+
const Switch = /*#__PURE__*/react.forwardRef(function Switch(props, ref) {
|
2956
|
+
const styles = react.useMultiStyleConfig('Switch', props);
|
2957
|
+
const {
|
2958
|
+
size = 'md'
|
2959
|
+
} = props;
|
2960
|
+
const {
|
2961
|
+
spacing = '0.5rem',
|
2962
|
+
children,
|
2963
|
+
...ownProps
|
2964
|
+
} = react.omitThemingProps(props);
|
2965
|
+
const {
|
2966
|
+
state,
|
2967
|
+
getInputProps,
|
2968
|
+
getCheckboxProps,
|
2969
|
+
getRootProps,
|
2970
|
+
getLabelProps
|
2971
|
+
} = react.useCheckbox(ownProps);
|
2972
|
+
const containerStyles = React.useMemo(() => ({
|
2973
|
+
display: 'inline-block',
|
2974
|
+
position: 'relative',
|
2975
|
+
verticalAlign: 'middle',
|
2976
|
+
lineHeight: 0,
|
2977
|
+
...styles.container
|
2978
|
+
}), [styles.container]);
|
2979
|
+
const trackStyles = React.useMemo(() => ({
|
2980
|
+
display: 'inline-flex',
|
2981
|
+
flexShrink: 0,
|
2982
|
+
justifyContent: 'flex-start',
|
2983
|
+
boxSizing: 'content-box',
|
2984
|
+
cursor: 'pointer',
|
2985
|
+
width: 200,
|
2986
|
+
...styles.track
|
2987
|
+
}), [styles.track]);
|
2988
|
+
const labelStyles = React.useMemo(() => ({
|
2989
|
+
userSelect: 'none',
|
2990
|
+
marginStart: spacing,
|
2991
|
+
...styles.label
|
2992
|
+
}), [spacing, styles.label]);
|
2993
|
+
const getIconSize = value => {
|
2994
|
+
const iconSize = {
|
2995
|
+
sm: 3,
|
2996
|
+
md: 4,
|
2997
|
+
lg: 5
|
2998
|
+
};
|
2999
|
+
return iconSize[value];
|
3000
|
+
};
|
3001
|
+
return /*#__PURE__*/React__default.createElement(react.chakra.label, Object.assign({}, getRootProps(), {
|
3002
|
+
display: "flex",
|
3003
|
+
alignItems: "center",
|
3004
|
+
className: sharedUtils.cx('chakra-switch', props.className),
|
3005
|
+
__css: containerStyles
|
3006
|
+
}), /*#__PURE__*/React__default.createElement("input", Object.assign({
|
3007
|
+
"data-test-id": "",
|
3008
|
+
className: "chakra-switch__input"
|
3009
|
+
}, getInputProps({}, ref))), /*#__PURE__*/React__default.createElement(react.chakra.span, Object.assign({}, getCheckboxProps(), {
|
3010
|
+
className: "chakra-switch__track",
|
3011
|
+
pos: "relative",
|
3012
|
+
__css: trackStyles
|
3013
|
+
}), /*#__PURE__*/React__default.createElement(react.Flex, {
|
3014
|
+
gap: 2,
|
3015
|
+
pos: "absolute",
|
3016
|
+
top: "50%",
|
3017
|
+
left: "50%",
|
3018
|
+
transform: "translate(-50%, -50%)"
|
3019
|
+
}, /*#__PURE__*/React__default.createElement(internalIcon.Check, {
|
3020
|
+
color: "white",
|
3021
|
+
size: getIconSize(size)
|
3022
|
+
}), /*#__PURE__*/React__default.createElement(internalIcon.Close, {
|
3023
|
+
color: state.isDisabled ? 'neutral.600' : 'neutral.900',
|
3024
|
+
size: getIconSize(size)
|
3025
|
+
})), /*#__PURE__*/React__default.createElement(react.chakra.span, {
|
3026
|
+
__css: styles.thumb,
|
3027
|
+
className: "chakra-switch__thumb",
|
3028
|
+
"data-checked": sharedUtils.dataAttr(state.isChecked),
|
3029
|
+
"data-hover": sharedUtils.dataAttr(state.isHovered)
|
3030
|
+
})), children && /*#__PURE__*/React__default.createElement(react.chakra.span, Object.assign({
|
3031
|
+
className: "chakra-switch__label",
|
3032
|
+
color: state.isDisabled ? 'black.low' : 'black.high'
|
3033
|
+
}, getLabelProps(), {
|
3034
|
+
__css: labelStyles
|
3035
|
+
}), children));
|
3036
|
+
});
|
3037
|
+
|
2675
3038
|
const Tab = /*#__PURE__*/react.forwardRef((props, ref) => {
|
2676
3039
|
var _props$leftAddon, _props$rightAddon;
|
2677
3040
|
const tabProps = react.useTab({
|
@@ -2801,115 +3164,391 @@ Uploader.defaultProps = {
|
|
2801
3164
|
selected: false
|
2802
3165
|
};
|
2803
3166
|
|
3167
|
+
const {
|
3168
|
+
definePartsStyle,
|
3169
|
+
defineMultiStyleConfig
|
3170
|
+
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.alertAnatomy.keys);
|
3171
|
+
const $fg = /*#__PURE__*/styledSystem.cssVar('alert-fg');
|
3172
|
+
const $bg = /*#__PURE__*/styledSystem.cssVar('alert-bg');
|
3173
|
+
const baseStyle = /*#__PURE__*/definePartsStyle({
|
3174
|
+
container: {
|
3175
|
+
bg: $bg.reference,
|
3176
|
+
px: '4',
|
3177
|
+
py: '2',
|
3178
|
+
borderRadius: 'md'
|
3179
|
+
},
|
3180
|
+
title: {
|
3181
|
+
fontWeight: '400',
|
3182
|
+
lineHeight: '18px',
|
3183
|
+
marginEnd: '2'
|
3184
|
+
},
|
3185
|
+
description: {
|
3186
|
+
lineHeight: '6'
|
3187
|
+
},
|
3188
|
+
icon: {
|
3189
|
+
color: $fg.reference,
|
3190
|
+
flexShrink: 0,
|
3191
|
+
marginEnd: '3',
|
3192
|
+
w: '4',
|
3193
|
+
h: '4'
|
3194
|
+
},
|
3195
|
+
action: {
|
3196
|
+
'& +.chakra-alert__close': {
|
3197
|
+
ml: '3'
|
3198
|
+
}
|
3199
|
+
},
|
3200
|
+
close: {
|
3201
|
+
color: $fg.reference,
|
3202
|
+
w: '4',
|
3203
|
+
h: '4'
|
3204
|
+
},
|
3205
|
+
spinner: {
|
3206
|
+
color: $fg.reference,
|
3207
|
+
flexShrink: 0,
|
3208
|
+
marginEnd: '3',
|
3209
|
+
w: '5',
|
3210
|
+
h: '5'
|
3211
|
+
}
|
3212
|
+
});
|
3213
|
+
function getBg(props) {
|
3214
|
+
const {
|
3215
|
+
theme,
|
3216
|
+
colorScheme: c
|
3217
|
+
} = props;
|
3218
|
+
const darkBg = themeTools.transparentize(`${c}.200`, 0.16)(theme);
|
3219
|
+
return {
|
3220
|
+
light: `colors.${c}.50`,
|
3221
|
+
dark: darkBg
|
3222
|
+
};
|
3223
|
+
}
|
3224
|
+
const variantSubtle = /*#__PURE__*/definePartsStyle(props => {
|
3225
|
+
const {
|
3226
|
+
colorScheme: c
|
3227
|
+
} = props;
|
3228
|
+
const bg = getBg(props);
|
3229
|
+
return {
|
3230
|
+
container: {
|
3231
|
+
[$fg.variable]: `colors.${c}.700`,
|
3232
|
+
[$bg.variable]: bg.light,
|
3233
|
+
_dark: {
|
3234
|
+
[$fg.variable]: `colors.${c}.200`,
|
3235
|
+
[$bg.variable]: bg.dark
|
3236
|
+
},
|
3237
|
+
color: $fg.reference
|
3238
|
+
}
|
3239
|
+
};
|
3240
|
+
});
|
3241
|
+
const variantSolid = /*#__PURE__*/definePartsStyle(props => {
|
3242
|
+
const {
|
3243
|
+
colorScheme: c
|
3244
|
+
} = props;
|
3245
|
+
return {
|
3246
|
+
container: {
|
3247
|
+
[$fg.variable]: `colors.white.high`,
|
3248
|
+
[$bg.variable]: `colors.${c}.500`,
|
3249
|
+
_dark: {
|
3250
|
+
[$fg.variable]: `colors.gray.900`,
|
3251
|
+
[$bg.variable]: `colors.${c}.200`
|
3252
|
+
},
|
3253
|
+
color: $fg.reference
|
3254
|
+
}
|
3255
|
+
};
|
3256
|
+
});
|
3257
|
+
const variants = {
|
3258
|
+
subtle: variantSubtle,
|
3259
|
+
solid: variantSolid
|
3260
|
+
};
|
3261
|
+
const alertTheme = /*#__PURE__*/defineMultiStyleConfig({
|
3262
|
+
baseStyle,
|
3263
|
+
variants,
|
3264
|
+
defaultProps: {
|
3265
|
+
variant: 'subtle',
|
3266
|
+
colorScheme: 'info'
|
3267
|
+
}
|
3268
|
+
});
|
3269
|
+
|
2804
3270
|
// You can also use the more specific type for
|
2805
3271
|
// a single part component: ComponentSingleStyleConfig
|
2806
|
-
const Button = {
|
3272
|
+
const Button$1 = /*#__PURE__*/styledSystem.defineStyleConfig({
|
2807
3273
|
// The styles all button have in common
|
2808
3274
|
baseStyle: {
|
2809
3275
|
fontSize: 'body.1',
|
2810
3276
|
fontWeight: 'normal',
|
2811
|
-
lineHeight: '1.25',
|
2812
|
-
minW: 24,
|
2813
3277
|
px: 4,
|
2814
|
-
py: 2,
|
3278
|
+
py: 2.5,
|
2815
3279
|
borderRadius: 'md',
|
2816
3280
|
_disabled: {
|
2817
|
-
opacity:
|
3281
|
+
opacity: 1,
|
3282
|
+
bg: 'neutral.300',
|
3283
|
+
color: 'black.low'
|
2818
3284
|
},
|
2819
3285
|
_hover: {
|
2820
3286
|
_disabled: {
|
2821
|
-
|
2822
|
-
|
2823
|
-
},
|
2824
|
-
_active: {
|
2825
|
-
_disabled: {
|
2826
|
-
opacity: 0.3
|
3287
|
+
bg: 'neutral.300',
|
3288
|
+
color: 'black.low'
|
2827
3289
|
}
|
2828
|
-
},
|
2829
|
-
_loading: {
|
2830
|
-
opacity: 0.7
|
2831
3290
|
}
|
2832
3291
|
},
|
2833
3292
|
sizes: {
|
2834
|
-
lg: {
|
2835
|
-
|
2836
|
-
|
3293
|
+
lg: props => {
|
3294
|
+
const {
|
3295
|
+
variant
|
3296
|
+
} = props;
|
3297
|
+
const base = {
|
3298
|
+
fontSize: 'text.xl',
|
3299
|
+
h: 12,
|
3300
|
+
px: 4,
|
3301
|
+
py: 2.5
|
3302
|
+
};
|
3303
|
+
const icon = {
|
3304
|
+
h: 10,
|
3305
|
+
w: 10,
|
3306
|
+
p: 0
|
3307
|
+
};
|
3308
|
+
return variant === 'icon' ? icon : base;
|
2837
3309
|
},
|
2838
|
-
md: {
|
2839
|
-
|
2840
|
-
|
3310
|
+
md: props => {
|
3311
|
+
const {
|
3312
|
+
variant
|
3313
|
+
} = props;
|
3314
|
+
const base = {
|
3315
|
+
fontSize: 'text.md',
|
3316
|
+
h: 9,
|
3317
|
+
px: 3,
|
3318
|
+
py: '7px'
|
3319
|
+
};
|
3320
|
+
const icon = {
|
3321
|
+
h: 9,
|
3322
|
+
w: 9,
|
3323
|
+
p: 0
|
3324
|
+
};
|
3325
|
+
return variant === 'icon' ? icon : base;
|
2841
3326
|
},
|
2842
|
-
sm: {
|
2843
|
-
|
2844
|
-
|
3327
|
+
sm: props => {
|
3328
|
+
const {
|
3329
|
+
variant
|
3330
|
+
} = props;
|
3331
|
+
const base = {
|
3332
|
+
fontSize: 'text.sm',
|
3333
|
+
h: '26px',
|
3334
|
+
lineHeight: 4,
|
3335
|
+
px: 2,
|
3336
|
+
py: '5px'
|
3337
|
+
};
|
3338
|
+
const icon = {
|
3339
|
+
h: '26px',
|
3340
|
+
w: '26px',
|
3341
|
+
p: 0
|
3342
|
+
};
|
3343
|
+
return variant === 'icon' ? icon : base;
|
2845
3344
|
}
|
2846
3345
|
},
|
2847
|
-
// Two variants: outline and solid
|
2848
3346
|
variants: {
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
3347
|
+
primary: props => {
|
3348
|
+
const {
|
3349
|
+
isLoading
|
3350
|
+
} = props;
|
3351
|
+
const basePrimary = {
|
3352
|
+
color: 'white.high',
|
3353
|
+
bg: 'primary.500',
|
3354
|
+
_hover: {
|
3355
|
+
bg: 'primary.600'
|
3356
|
+
},
|
3357
|
+
_active: {
|
3358
|
+
bg: 'primary.700'
|
3359
|
+
}
|
3360
|
+
};
|
3361
|
+
const disabledLoading = {
|
3362
|
+
_disabled: {
|
3363
|
+
bg: 'primary.500'
|
3364
|
+
},
|
3365
|
+
_hover: {
|
3366
|
+
_disabled: {
|
3367
|
+
bg: 'primary.500'
|
3368
|
+
}
|
3369
|
+
}
|
3370
|
+
};
|
3371
|
+
return isLoading ? disabledLoading : basePrimary;
|
3372
|
+
},
|
3373
|
+
secondary: props => {
|
3374
|
+
const {
|
3375
|
+
isLoading
|
3376
|
+
} = props;
|
3377
|
+
const baseSecondary = {
|
3378
|
+
color: 'primary.500',
|
3379
|
+
borderWidth: 1,
|
3380
|
+
borderStyle: 'inside',
|
3381
|
+
bg: 'white.high',
|
3382
|
+
borderColor: 'primary.500',
|
3383
|
+
_hover: {
|
3384
|
+
bg: 'primary.50'
|
3385
|
+
},
|
3386
|
+
_active: {
|
3387
|
+
bg: 'primary.100'
|
3388
|
+
},
|
3389
|
+
_disabled: {
|
3390
|
+
border: 0
|
3391
|
+
}
|
3392
|
+
};
|
3393
|
+
const disabledLoading = {
|
3394
|
+
...baseSecondary,
|
3395
|
+
_disabled: {
|
3396
|
+
bg: 'white.high'
|
3397
|
+
},
|
3398
|
+
_hover: {
|
3399
|
+
_disabled: {
|
3400
|
+
bg: 'white.high'
|
3401
|
+
}
|
3402
|
+
}
|
3403
|
+
};
|
3404
|
+
return isLoading ? disabledLoading : baseSecondary;
|
3405
|
+
},
|
3406
|
+
tertiary: props => {
|
3407
|
+
const {
|
3408
|
+
isLoading
|
3409
|
+
} = props;
|
3410
|
+
const baseTertiary = {
|
3411
|
+
color: 'primary.500',
|
3412
|
+
_hover: {
|
3413
|
+
bg: 'primary.50'
|
3414
|
+
},
|
3415
|
+
_active: {
|
3416
|
+
bg: 'primary.100'
|
3417
|
+
}
|
3418
|
+
};
|
3419
|
+
const disabledLoading = {
|
3420
|
+
...baseTertiary,
|
3421
|
+
_disabled: {
|
3422
|
+
bg: 'transparent'
|
3423
|
+
},
|
3424
|
+
_hover: {
|
3425
|
+
_disabled: {
|
3426
|
+
bg: 'transparent'
|
3427
|
+
}
|
3428
|
+
}
|
3429
|
+
};
|
3430
|
+
return isLoading ? disabledLoading : baseTertiary;
|
3431
|
+
},
|
3432
|
+
danger: props => {
|
3433
|
+
const {
|
3434
|
+
isLoading
|
3435
|
+
} = props;
|
3436
|
+
const baseDanger = {
|
3437
|
+
bg: 'danger.500',
|
3438
|
+
color: 'white.high',
|
3439
|
+
_hover: {
|
3440
|
+
bg: 'danger.600'
|
3441
|
+
},
|
3442
|
+
_active: {
|
3443
|
+
bg: 'danger.700'
|
3444
|
+
}
|
3445
|
+
};
|
3446
|
+
const disabledLoading = {
|
3447
|
+
...baseDanger,
|
3448
|
+
_disabled: {
|
3449
|
+
bg: 'danger.500'
|
3450
|
+
},
|
3451
|
+
_hover: {
|
3452
|
+
_disabled: {
|
3453
|
+
bg: 'danger.500'
|
3454
|
+
}
|
3455
|
+
}
|
3456
|
+
};
|
3457
|
+
return isLoading ? disabledLoading : baseDanger;
|
3458
|
+
},
|
3459
|
+
'outline-danger': props => {
|
3460
|
+
const {
|
3461
|
+
isLoading
|
3462
|
+
} = props;
|
3463
|
+
const baseSecondary = {
|
3464
|
+
color: 'danger.500',
|
3465
|
+
borderWidth: 1,
|
3466
|
+
borderStyle: 'inside',
|
3467
|
+
bg: 'white.high',
|
3468
|
+
borderColor: 'danger.500',
|
3469
|
+
_hover: {
|
3470
|
+
bg: 'danger.50'
|
3471
|
+
},
|
3472
|
+
_active: {
|
3473
|
+
bg: 'danger.100'
|
3474
|
+
},
|
3475
|
+
_disabled: {
|
3476
|
+
border: 0
|
3477
|
+
}
|
3478
|
+
};
|
3479
|
+
const disabledLoading = {
|
3480
|
+
...baseSecondary,
|
3481
|
+
_disabled: {
|
3482
|
+
bg: 'white.high'
|
3483
|
+
},
|
3484
|
+
_hover: {
|
3485
|
+
_disabled: {
|
3486
|
+
bg: 'white.high'
|
3487
|
+
}
|
3488
|
+
}
|
3489
|
+
};
|
3490
|
+
return isLoading ? disabledLoading : baseSecondary;
|
3491
|
+
},
|
3492
|
+
link: {
|
3493
|
+
bg: 'transparent',
|
3494
|
+
color: 'primary.500',
|
2852
3495
|
_disabled: {
|
2853
|
-
|
3496
|
+
opacity: '1',
|
3497
|
+
bg: 'transparent',
|
3498
|
+
color: 'black.medium'
|
2854
3499
|
},
|
2855
3500
|
_hover: {
|
2856
|
-
|
2857
|
-
|
2858
|
-
|
2859
|
-
|
2860
|
-
},
|
2861
|
-
_focus: {
|
2862
|
-
bg: 'primary.700'
|
3501
|
+
_disabled: {
|
3502
|
+
bg: 'transparent',
|
3503
|
+
color: 'black.medium'
|
3504
|
+
}
|
2863
3505
|
}
|
2864
3506
|
},
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
2868
|
-
|
2869
|
-
|
2870
|
-
borderColor: themeTools.mode('primary.500', 'primary.500')(props),
|
2871
|
-
_hover: {
|
2872
|
-
bg: 'primary.50'
|
2873
|
-
},
|
3507
|
+
icon: {
|
3508
|
+
bg: 'neutral.50',
|
3509
|
+
minW: 0,
|
3510
|
+
borderColor: 'neutral.200',
|
3511
|
+
borderWidth: '1px',
|
2874
3512
|
_active: {
|
2875
|
-
bg: '
|
3513
|
+
bg: 'neutral.500',
|
3514
|
+
borderColor: 'neutral.50'
|
2876
3515
|
},
|
2877
|
-
_focus: {
|
2878
|
-
bg: 'primary.100'
|
2879
|
-
}
|
2880
|
-
}),
|
2881
|
-
'outline-danger': {
|
2882
|
-
color: 'danger.500',
|
2883
|
-
bg: 'white',
|
2884
|
-
borderStyle: 'inside',
|
2885
|
-
borderWidth: 1,
|
2886
|
-
borderColor: 'danger.500'
|
2887
|
-
},
|
2888
|
-
ghost: {
|
2889
|
-
color: 'primary.500',
|
2890
3516
|
_disabled: {
|
2891
|
-
bg: '
|
3517
|
+
bg: 'neutral.500',
|
3518
|
+
opacity: 0.3,
|
3519
|
+
borderColor: 'neutral.50'
|
3520
|
+
},
|
3521
|
+
_hover: {
|
3522
|
+
bg: 'neutral.400',
|
3523
|
+
_disabled: {
|
3524
|
+
bg: 'neutral.500',
|
3525
|
+
opacity: 0.3,
|
3526
|
+
borderColor: 'neutral.50'
|
3527
|
+
}
|
2892
3528
|
}
|
2893
|
-
},
|
2894
|
-
link: {
|
2895
|
-
bg: 'transparent',
|
2896
|
-
color: 'primary.500'
|
2897
3529
|
}
|
2898
3530
|
},
|
2899
|
-
// The default size and variant values
|
2900
3531
|
defaultProps: {
|
2901
3532
|
size: 'md',
|
2902
|
-
variant: '
|
2903
|
-
orientation: 'vertical',
|
3533
|
+
variant: 'primary',
|
2904
3534
|
colorScheme: 'primary'
|
2905
3535
|
}
|
2906
|
-
};
|
3536
|
+
});
|
3537
|
+
|
3538
|
+
const CardStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3539
|
+
baseStyle: props => {
|
3540
|
+
return {
|
3541
|
+
shadow: props.withShadow ? 'raised' : 'none',
|
3542
|
+
borderRadius: props.isRounded ? 'lg' : 'none'
|
3543
|
+
};
|
3544
|
+
}
|
3545
|
+
});
|
2907
3546
|
|
2908
3547
|
const {
|
2909
|
-
definePartsStyle,
|
2910
|
-
defineMultiStyleConfig
|
3548
|
+
definePartsStyle: definePartsStyle$1,
|
3549
|
+
defineMultiStyleConfig: defineMultiStyleConfig$1
|
2911
3550
|
} = /*#__PURE__*/react.createMultiStyleConfigHelpers(anatomy.checkboxAnatomy.keys);
|
2912
|
-
const baseStyle = /*#__PURE__*/definePartsStyle({
|
3551
|
+
const baseStyle$1 = /*#__PURE__*/definePartsStyle$1({
|
2913
3552
|
control: {
|
2914
3553
|
borderRadius: '4px',
|
2915
3554
|
width: '16px',
|
@@ -2933,7 +3572,7 @@ const baseStyle = /*#__PURE__*/definePartsStyle({
|
|
2933
3572
|
cursor: 'not-allowed'
|
2934
3573
|
}
|
2935
3574
|
});
|
2936
|
-
const errors = /*#__PURE__*/definePartsStyle({
|
3575
|
+
const errors = /*#__PURE__*/definePartsStyle$1({
|
2937
3576
|
control: {
|
2938
3577
|
borderColor: 'danger.500',
|
2939
3578
|
_checked: {
|
@@ -2953,7 +3592,7 @@ const errors = /*#__PURE__*/definePartsStyle({
|
|
2953
3592
|
fontSize: '12px'
|
2954
3593
|
}
|
2955
3594
|
});
|
2956
|
-
const unstyled = /*#__PURE__*/definePartsStyle({
|
3595
|
+
const unstyled = /*#__PURE__*/definePartsStyle$1({
|
2957
3596
|
control: {
|
2958
3597
|
borderColor: 'neutral.500',
|
2959
3598
|
_checked: {
|
@@ -2969,7 +3608,8 @@ const unstyled = /*#__PURE__*/definePartsStyle({
|
|
2969
3608
|
}
|
2970
3609
|
},
|
2971
3610
|
_disabled: {
|
2972
|
-
backgroundColor: 'neutral.500'
|
3611
|
+
backgroundColor: 'neutral.500',
|
3612
|
+
borderColor: 'neutral.500'
|
2973
3613
|
},
|
2974
3614
|
_indeterminate: {
|
2975
3615
|
borderColor: 'primary.500',
|
@@ -2980,48 +3620,109 @@ const unstyled = /*#__PURE__*/definePartsStyle({
|
|
2980
3620
|
fontSize: '12px'
|
2981
3621
|
}
|
2982
3622
|
});
|
2983
|
-
const variants = {
|
3623
|
+
const variants$1 = {
|
2984
3624
|
errors,
|
2985
3625
|
unstyled
|
2986
3626
|
};
|
2987
|
-
const Checkbox = /*#__PURE__*/defineMultiStyleConfig({
|
2988
|
-
baseStyle,
|
2989
|
-
variants,
|
3627
|
+
const Checkbox = /*#__PURE__*/defineMultiStyleConfig$1({
|
3628
|
+
baseStyle: baseStyle$1,
|
3629
|
+
variants: variants$1,
|
3630
|
+
defaultProps: {
|
3631
|
+
variant: 'unstyled'
|
3632
|
+
}
|
3633
|
+
});
|
3634
|
+
|
3635
|
+
const Chips = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3636
|
+
baseStyle: props => {
|
3637
|
+
const {
|
3638
|
+
isDisabled,
|
3639
|
+
isActive
|
3640
|
+
} = props;
|
3641
|
+
const defaultProps = {
|
3642
|
+
color: 'primary.500',
|
3643
|
+
fontSize: 'text.small',
|
3644
|
+
borderRadius: '24px',
|
3645
|
+
borderWidth: '1px',
|
3646
|
+
borderColor: 'primary.500',
|
3647
|
+
bg: 'white.high',
|
3648
|
+
paddingX: 3,
|
3649
|
+
paddingY: 1,
|
3650
|
+
cursor: 'default'
|
3651
|
+
};
|
3652
|
+
let chipsProps = {
|
3653
|
+
...defaultProps
|
3654
|
+
};
|
3655
|
+
if (isActive) {
|
3656
|
+
const isActiveProps = {
|
3657
|
+
bg: 'primary.500',
|
3658
|
+
color: 'white.high'
|
3659
|
+
};
|
3660
|
+
chipsProps = {
|
3661
|
+
...chipsProps,
|
3662
|
+
...isActiveProps
|
3663
|
+
};
|
3664
|
+
}
|
3665
|
+
if (isDisabled) {
|
3666
|
+
const isDisabledProps = {
|
3667
|
+
bg: 'neutral.200',
|
3668
|
+
color: 'black.low',
|
3669
|
+
borderColor: 'neutral.200',
|
3670
|
+
cursor: 'not-allowed'
|
3671
|
+
};
|
3672
|
+
chipsProps = {
|
3673
|
+
...chipsProps,
|
3674
|
+
...isDisabledProps
|
3675
|
+
};
|
3676
|
+
}
|
3677
|
+
return {
|
3678
|
+
...chipsProps
|
3679
|
+
};
|
3680
|
+
},
|
3681
|
+
sizes: {
|
3682
|
+
sm: {
|
3683
|
+
fontSize: '12px'
|
3684
|
+
},
|
3685
|
+
md: {
|
3686
|
+
fontSize: '14px'
|
3687
|
+
}
|
3688
|
+
},
|
2990
3689
|
defaultProps: {
|
2991
|
-
|
3690
|
+
size: 'sm'
|
2992
3691
|
}
|
2993
3692
|
});
|
2994
3693
|
|
2995
|
-
const baseStyle$
|
3694
|
+
const baseStyle$2 = /*#__PURE__*/styledSystem.defineStyle({
|
2996
3695
|
fontSize: 'field.sm',
|
2997
3696
|
marginEnd: 1,
|
2998
3697
|
mb: 1
|
2999
3698
|
});
|
3000
3699
|
const FormLabel = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3001
|
-
baseStyle: baseStyle$
|
3700
|
+
baseStyle: baseStyle$2
|
3002
3701
|
});
|
3003
3702
|
|
3004
3703
|
const {
|
3005
|
-
definePartsStyle: definePartsStyle$
|
3006
|
-
defineMultiStyleConfig: defineMultiStyleConfig$
|
3704
|
+
definePartsStyle: definePartsStyle$2,
|
3705
|
+
defineMultiStyleConfig: defineMultiStyleConfig$2
|
3007
3706
|
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.inputAnatomy.keys);
|
3008
|
-
const baseStyle$
|
3707
|
+
const baseStyle$3 = /*#__PURE__*/definePartsStyle$2({
|
3009
3708
|
field: {
|
3010
3709
|
width: '100%',
|
3011
3710
|
minWidth: 0,
|
3012
3711
|
outline: 0,
|
3013
|
-
px: 2
|
3014
|
-
py: 2,
|
3712
|
+
px: 2,
|
3713
|
+
py: 2.5,
|
3714
|
+
paddingInlineStart: 2,
|
3715
|
+
paddingInlineEnd: 2,
|
3015
3716
|
position: 'relative',
|
3016
3717
|
appearance: 'none',
|
3017
|
-
transitionProperty: 'common',
|
3018
|
-
transitionDuration: 'normal',
|
3019
3718
|
color: 'black.high',
|
3020
3719
|
_disabled: {
|
3021
3720
|
bg: 'neutral.300',
|
3022
|
-
border:
|
3023
|
-
|
3024
|
-
|
3721
|
+
border: 0,
|
3722
|
+
cursor: 'not-allowed',
|
3723
|
+
opacity: 1,
|
3724
|
+
boxShadow: 'none',
|
3725
|
+
color: 'black.medium'
|
3025
3726
|
},
|
3026
3727
|
_placeholder: {
|
3027
3728
|
color: 'black.low'
|
@@ -3030,88 +3731,54 @@ const baseStyle$2 = /*#__PURE__*/definePartsStyle$1({
|
|
3030
3731
|
});
|
3031
3732
|
const size = {
|
3032
3733
|
lg: /*#__PURE__*/styledSystem.defineStyle({
|
3033
|
-
fontSize: '
|
3734
|
+
fontSize: 'text.lg',
|
3034
3735
|
h: 12,
|
3035
3736
|
borderRadius: 'md'
|
3036
3737
|
}),
|
3037
3738
|
md: /*#__PURE__*/styledSystem.defineStyle({
|
3038
|
-
fontSize: '
|
3739
|
+
fontSize: 'text.md',
|
3039
3740
|
h: 10,
|
3040
3741
|
borderRadius: 'md'
|
3041
3742
|
}),
|
3042
3743
|
sm: /*#__PURE__*/styledSystem.defineStyle({
|
3043
|
-
fontSize: '
|
3744
|
+
fontSize: 'text.sm',
|
3044
3745
|
h: 9.5,
|
3045
3746
|
borderRadius: 'md'
|
3046
3747
|
})
|
3047
3748
|
};
|
3048
3749
|
const sizes$1 = {
|
3049
|
-
lg: /*#__PURE__*/definePartsStyle$
|
3750
|
+
lg: /*#__PURE__*/definePartsStyle$2({
|
3050
3751
|
field: size.lg,
|
3051
3752
|
addon: size.lg
|
3052
3753
|
}),
|
3053
|
-
md: /*#__PURE__*/definePartsStyle$
|
3754
|
+
md: /*#__PURE__*/definePartsStyle$2({
|
3054
3755
|
field: size.md,
|
3055
3756
|
addon: size.md
|
3056
3757
|
}),
|
3057
|
-
sm: /*#__PURE__*/definePartsStyle$
|
3758
|
+
sm: /*#__PURE__*/definePartsStyle$2({
|
3058
3759
|
field: size.sm,
|
3059
3760
|
addon: size.sm
|
3060
3761
|
})
|
3061
3762
|
};
|
3062
|
-
|
3063
|
-
const {
|
3064
|
-
|
3065
|
-
|
3066
|
-
|
3067
|
-
|
3068
|
-
|
3069
|
-
|
3070
|
-
errorBorderColor: errorBorderColor || themeTools.mode('danger.500', 'danger.300')(props),
|
3071
|
-
readOnlyBorderColor: readOnlyBorderColor || themeTools.mode('.500', 'danger.300')(props)
|
3072
|
-
};
|
3073
|
-
}
|
3074
|
-
const outline = /*#__PURE__*/definePartsStyle$1(props => {
|
3075
|
-
const {
|
3076
|
-
theme
|
3077
|
-
} = props;
|
3078
|
-
const {
|
3079
|
-
focusBorderColor: fc,
|
3080
|
-
errorBorderColor: ec,
|
3081
|
-
readOnlyBorderColor: rc
|
3082
|
-
} = getDefaults(props);
|
3083
|
-
return {
|
3084
|
-
field: {
|
3085
|
-
border: '1px solid',
|
3086
|
-
borderColor: themeTools.mode('dark.200', 'inherit')(props),
|
3087
|
-
bg: themeTools.mode('white', 'inherit')(props),
|
3088
|
-
color: themeTools.mode('inherit', 'white')(props),
|
3089
|
-
_hover: {
|
3090
|
-
borderColor: themeTools.mode('gray.300', 'whiteAlpha.400')(props)
|
3091
|
-
},
|
3092
|
-
_readOnly: {
|
3093
|
-
userSelect: 'all',
|
3094
|
-
borderColor: themeTools.getColor(theme, rc),
|
3095
|
-
boxShadow: `0 0 0 0 ${themeTools.getColor(theme, rc)}`
|
3096
|
-
},
|
3097
|
-
_invalid: {
|
3098
|
-
borderColor: themeTools.getColor(theme, ec),
|
3099
|
-
boxShadow: `0 0 0 0 ${themeTools.getColor(theme, ec)}`
|
3100
|
-
},
|
3101
|
-
_focusVisible: {
|
3102
|
-
zIndex: 1,
|
3103
|
-
borderColor: themeTools.getColor(theme, fc),
|
3104
|
-
boxShadow: `0 0 0 0 ${themeTools.getColor(theme, fc)}`
|
3105
|
-
}
|
3763
|
+
const outline = /*#__PURE__*/definePartsStyle$2(props => {
|
3764
|
+
const field = {
|
3765
|
+
border: 0,
|
3766
|
+
outline: 0,
|
3767
|
+
bg: themeTools.mode('white', 'inherit')(props),
|
3768
|
+
color: themeTools.mode('inherit', 'white')(props),
|
3769
|
+
_invalid: {
|
3770
|
+
boxShadow: 'none'
|
3106
3771
|
},
|
3107
|
-
|
3108
|
-
|
3109
|
-
|
3110
|
-
bg: themeTools.mode('gray.100', 'whiteAlpha.300')(props)
|
3772
|
+
_focusVisible: {
|
3773
|
+
zIndex: 1,
|
3774
|
+
boxShadow: 'none'
|
3111
3775
|
}
|
3112
3776
|
};
|
3777
|
+
return {
|
3778
|
+
field
|
3779
|
+
};
|
3113
3780
|
});
|
3114
|
-
const unstyled$1 = /*#__PURE__*/definePartsStyle$
|
3781
|
+
const unstyled$1 = /*#__PURE__*/definePartsStyle$2({
|
3115
3782
|
field: {
|
3116
3783
|
bg: 'transparent',
|
3117
3784
|
px: '0',
|
@@ -3123,14 +3790,14 @@ const unstyled$1 = /*#__PURE__*/definePartsStyle$1({
|
|
3123
3790
|
height: 'auto'
|
3124
3791
|
}
|
3125
3792
|
});
|
3126
|
-
const variants$
|
3793
|
+
const variants$2 = {
|
3127
3794
|
outline,
|
3128
3795
|
unstyled: unstyled$1
|
3129
3796
|
};
|
3130
|
-
const Input = /*#__PURE__*/defineMultiStyleConfig$
|
3131
|
-
baseStyle: baseStyle$
|
3797
|
+
const Input = /*#__PURE__*/defineMultiStyleConfig$2({
|
3798
|
+
baseStyle: baseStyle$3,
|
3132
3799
|
sizes: sizes$1,
|
3133
|
-
variants: variants$
|
3800
|
+
variants: variants$2,
|
3134
3801
|
defaultProps: {
|
3135
3802
|
size: 'sm',
|
3136
3803
|
variant: 'outline'
|
@@ -3145,16 +3812,21 @@ const rotate = /*#__PURE__*/react$1.keyframes({
|
|
3145
3812
|
transform: 'rotate(360deg)'
|
3146
3813
|
}
|
3147
3814
|
});
|
3815
|
+
const getLoaderColor = color => {
|
3816
|
+
if (color === 'primary') return colors.primary[600];
|
3817
|
+
if (color === 'danger') return colors.danger[500];
|
3818
|
+
return colors.white.high;
|
3819
|
+
};
|
3148
3820
|
const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3149
3821
|
baseStyle: props => {
|
3150
|
-
const colors
|
3822
|
+
const colors = getLoaderColor(props.color);
|
3151
3823
|
return {
|
3152
3824
|
borderRadius: '50%',
|
3153
3825
|
display: 'flex',
|
3154
3826
|
justifyContent: 'center',
|
3155
3827
|
alignItems: 'center',
|
3156
3828
|
animation: `${rotate} 1s linear infinite`,
|
3157
|
-
background: `conic-gradient(from 180deg at 50% 50%, ${colors
|
3829
|
+
background: `conic-gradient(from 180deg at 50% 50%, ${colors} 0deg, rgba(217, 217, 217, 0) 360deg);`,
|
3158
3830
|
':before': {
|
3159
3831
|
content: `''`,
|
3160
3832
|
display: 'block',
|
@@ -3163,7 +3835,7 @@ const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
|
3163
3835
|
height: '6px',
|
3164
3836
|
position: 'absolute',
|
3165
3837
|
bottom: 0,
|
3166
|
-
background: colors
|
3838
|
+
background: colors
|
3167
3839
|
}
|
3168
3840
|
};
|
3169
3841
|
},
|
@@ -3229,10 +3901,10 @@ const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
|
3229
3901
|
});
|
3230
3902
|
|
3231
3903
|
const {
|
3232
|
-
definePartsStyle: definePartsStyle$
|
3904
|
+
definePartsStyle: definePartsStyle$3
|
3233
3905
|
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.popoverAnatomy.keys);
|
3234
3906
|
const Popover = {
|
3235
|
-
baseStyle: props => definePartsStyle$
|
3907
|
+
baseStyle: props => definePartsStyle$3({
|
3236
3908
|
popper: {
|
3237
3909
|
background: themeTools.mode('white', 'inherit')(props)
|
3238
3910
|
}
|
@@ -3240,93 +3912,175 @@ const Popover = {
|
|
3240
3912
|
};
|
3241
3913
|
|
3242
3914
|
const {
|
3243
|
-
definePartsStyle: definePartsStyle$
|
3244
|
-
|
3245
|
-
|
3246
|
-
|
3247
|
-
|
3248
|
-
|
3249
|
-
|
3250
|
-
|
3251
|
-
|
3252
|
-
|
3915
|
+
definePartsStyle: definePartsStyle$4,
|
3916
|
+
defineMultiStyleConfig: defineMultiStyleConfig$3
|
3917
|
+
} = /*#__PURE__*/react.createMultiStyleConfigHelpers(anatomy.radioAnatomy.keys);
|
3918
|
+
const baseStyle$4 = /*#__PURE__*/definePartsStyle$4({
|
3919
|
+
control: {
|
3920
|
+
border: '1px solid',
|
3921
|
+
width: '16px',
|
3922
|
+
height: '16px'
|
3923
|
+
},
|
3924
|
+
label: {
|
3925
|
+
marginLeft: '8px',
|
3926
|
+
textStyle: 'text.sm',
|
3927
|
+
color: 'black.high',
|
3928
|
+
_disabled: {
|
3929
|
+
color: 'black.low'
|
3930
|
+
}
|
3931
|
+
}
|
3932
|
+
});
|
3933
|
+
const errors$1 = /*#__PURE__*/definePartsStyle$4({
|
3934
|
+
control: {
|
3935
|
+
borderColor: 'danger.500',
|
3936
|
+
_checked: {
|
3937
|
+
borderColor: 'danger.500',
|
3938
|
+
bg: 'white',
|
3939
|
+
_before: {
|
3940
|
+
h: '10px',
|
3941
|
+
w: '10px',
|
3942
|
+
bg: 'danger.500'
|
3943
|
+
},
|
3944
|
+
_hover: {
|
3945
|
+
borderColor: 'danger.500',
|
3946
|
+
bg: 'gray.200'
|
3947
|
+
},
|
3948
|
+
_disabled: {
|
3949
|
+
borderColor: 'danger.500',
|
3253
3950
|
bg: 'white',
|
3254
3951
|
_before: {
|
3255
|
-
h: '
|
3256
|
-
w: '
|
3257
|
-
bg: '
|
3258
|
-
},
|
3259
|
-
_hover: {
|
3260
|
-
borderColor: 'primary.500',
|
3261
|
-
bg: 'gray.200'
|
3952
|
+
h: '10px',
|
3953
|
+
w: '10px',
|
3954
|
+
bg: 'neutral.500'
|
3262
3955
|
}
|
3263
3956
|
}
|
3957
|
+
},
|
3958
|
+
_disabled: {
|
3959
|
+
borderColor: 'danger.500',
|
3960
|
+
bg: 'neutral.500'
|
3264
3961
|
}
|
3265
|
-
}
|
3266
|
-
|
3267
|
-
|
3268
|
-
|
3269
|
-
|
3270
|
-
|
3271
|
-
|
3272
|
-
|
3273
|
-
|
3274
|
-
|
3275
|
-
|
3276
|
-
|
3277
|
-
|
3278
|
-
|
3279
|
-
|
3280
|
-
h: '4'
|
3962
|
+
},
|
3963
|
+
label: {
|
3964
|
+
fontSize: '12px'
|
3965
|
+
}
|
3966
|
+
});
|
3967
|
+
const unstyled$2 = /*#__PURE__*/definePartsStyle$4({
|
3968
|
+
control: {
|
3969
|
+
borderColor: 'neutral.600',
|
3970
|
+
_checked: {
|
3971
|
+
borderColor: 'primary.500',
|
3972
|
+
bg: 'white',
|
3973
|
+
_before: {
|
3974
|
+
h: '10px',
|
3975
|
+
w: '10px',
|
3976
|
+
bg: 'primary.500'
|
3281
3977
|
},
|
3282
|
-
|
3283
|
-
|
3284
|
-
|
3285
|
-
}),
|
3286
|
-
lg: /*#__PURE__*/definePartsStyle$3({
|
3287
|
-
control: {
|
3288
|
-
w: '5',
|
3289
|
-
h: '5'
|
3978
|
+
_hover: {
|
3979
|
+
borderColor: 'primary.500',
|
3980
|
+
bg: 'gray.200'
|
3290
3981
|
},
|
3291
|
-
|
3292
|
-
|
3982
|
+
_disabled: {
|
3983
|
+
borderColor: 'neutral.500',
|
3984
|
+
bg: 'white',
|
3985
|
+
_before: {
|
3986
|
+
h: '10px',
|
3987
|
+
w: '10px',
|
3988
|
+
bg: 'neutral.500'
|
3989
|
+
}
|
3293
3990
|
}
|
3294
|
-
}
|
3991
|
+
},
|
3992
|
+
_disabled: {
|
3993
|
+
borderColor: 'neutral.500',
|
3994
|
+
bg: 'neutral.500'
|
3995
|
+
}
|
3295
3996
|
},
|
3296
|
-
|
3297
|
-
|
3298
|
-
// The default size and variant values
|
3299
|
-
defaultProps: {
|
3300
|
-
size: 'sm',
|
3301
|
-
variant: 'solid',
|
3302
|
-
orientation: 'vertical',
|
3303
|
-
colorScheme: 'primary'
|
3997
|
+
label: {
|
3998
|
+
fontSize: '12px'
|
3304
3999
|
}
|
4000
|
+
});
|
4001
|
+
const variants$3 = {
|
4002
|
+
errors: errors$1,
|
4003
|
+
unstyled: unstyled$2
|
3305
4004
|
};
|
4005
|
+
const Radio = /*#__PURE__*/defineMultiStyleConfig$3({
|
4006
|
+
baseStyle: baseStyle$4,
|
4007
|
+
variants: variants$3,
|
4008
|
+
defaultProps: {
|
4009
|
+
variant: 'unstyled'
|
4010
|
+
}
|
4011
|
+
});
|
3306
4012
|
|
3307
4013
|
const {
|
3308
|
-
|
3309
|
-
|
3310
|
-
} = /*#__PURE__*/
|
3311
|
-
const
|
3312
|
-
|
4014
|
+
defineMultiStyleConfig: defineMultiStyleConfig$4,
|
4015
|
+
definePartsStyle: definePartsStyle$5
|
4016
|
+
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.switchAnatomy.keys);
|
4017
|
+
const $width = /*#__PURE__*/themeTools.cssVar('switch-track-width');
|
4018
|
+
const $height = /*#__PURE__*/themeTools.cssVar('switch-track-height');
|
4019
|
+
const $diff = /*#__PURE__*/themeTools.cssVar('switch-track-diff');
|
4020
|
+
const diffValue = /*#__PURE__*/themeTools.calc.subtract($width, $height);
|
4021
|
+
const $translateX = /*#__PURE__*/themeTools.cssVar('switch-thumb-x');
|
4022
|
+
const baseStyleThumb = /*#__PURE__*/styledSystem.defineStyle({
|
4023
|
+
bg: 'white',
|
4024
|
+
transitionProperty: 'transform',
|
4025
|
+
transitionDuration: 'normal',
|
4026
|
+
borderRadius: 'inherit',
|
4027
|
+
width: [$height.reference],
|
4028
|
+
height: [$height.reference],
|
4029
|
+
_checked: {
|
4030
|
+
transform: `translateX(${$translateX.reference})`
|
4031
|
+
}
|
4032
|
+
});
|
4033
|
+
const baseStyle$5 = /*#__PURE__*/definePartsStyle$5(() => ({
|
3313
4034
|
container: {
|
3314
|
-
|
3315
|
-
|
3316
|
-
|
3317
|
-
|
4035
|
+
[$diff.variable]: diffValue,
|
4036
|
+
[$translateX.variable]: $diff.reference,
|
4037
|
+
_rtl: {
|
4038
|
+
[$translateX.variable]: themeTools.calc($diff).negate().toString()
|
4039
|
+
}
|
3318
4040
|
},
|
3319
4041
|
track: {
|
3320
4042
|
bg: 'neutral.400',
|
3321
4043
|
p: 1,
|
3322
4044
|
_checked: {
|
3323
|
-
bg: 'primary.500'
|
4045
|
+
bg: 'primary.500',
|
4046
|
+
_disabled: {
|
4047
|
+
bg: 'neutral.600'
|
4048
|
+
}
|
4049
|
+
},
|
4050
|
+
_disabled: {
|
4051
|
+
bg: 'neutral.500',
|
4052
|
+
opacity: '100%'
|
3324
4053
|
}
|
4054
|
+
},
|
4055
|
+
thumb: baseStyleThumb
|
4056
|
+
}));
|
4057
|
+
const sizes$2 = {
|
4058
|
+
sm: /*#__PURE__*/definePartsStyle$5({
|
4059
|
+
container: {
|
4060
|
+
[$width.variable]: '2.125rem',
|
4061
|
+
[$height.variable]: '1.063rem'
|
4062
|
+
}
|
4063
|
+
}),
|
4064
|
+
md: /*#__PURE__*/definePartsStyle$5({
|
4065
|
+
container: {
|
4066
|
+
[$width.variable]: '2.875rem',
|
4067
|
+
[$height.variable]: '1.5rem'
|
4068
|
+
}
|
4069
|
+
}),
|
4070
|
+
lg: /*#__PURE__*/definePartsStyle$5({
|
4071
|
+
container: {
|
4072
|
+
[$width.variable]: '3.625rem',
|
4073
|
+
[$height.variable]: '1.813rem'
|
4074
|
+
}
|
4075
|
+
})
|
4076
|
+
};
|
4077
|
+
const Switch$1 = /*#__PURE__*/defineMultiStyleConfig$4({
|
4078
|
+
baseStyle: baseStyle$5,
|
4079
|
+
sizes: sizes$2,
|
4080
|
+
defaultProps: {
|
4081
|
+
size: 'md'
|
3325
4082
|
}
|
3326
4083
|
});
|
3327
|
-
const Switch = /*#__PURE__*/defineMultiStyleConfig$2({
|
3328
|
-
baseStyle: baseStyle$3
|
3329
|
-
});
|
3330
4084
|
|
3331
4085
|
const getProps = props => {
|
3332
4086
|
const {
|
@@ -3367,7 +4121,7 @@ const outline$1 = /*#__PURE__*/react.defineStyle(props => {
|
|
3367
4121
|
outline: 'none',
|
3368
4122
|
_disabled: {
|
3369
4123
|
opacity: 1,
|
3370
|
-
color: 'black.
|
4124
|
+
color: 'black.medium',
|
3371
4125
|
background: 'neutral.300'
|
3372
4126
|
},
|
3373
4127
|
_placeholder: {
|
@@ -3411,14 +4165,17 @@ const Textarea = /*#__PURE__*/react.defineStyleConfig({
|
|
3411
4165
|
|
3412
4166
|
var components = {
|
3413
4167
|
__proto__: null,
|
3414
|
-
|
4168
|
+
Alert: alertTheme,
|
4169
|
+
Button: Button$1,
|
4170
|
+
Card: CardStyle,
|
3415
4171
|
Checkbox: Checkbox,
|
4172
|
+
Chips: Chips,
|
3416
4173
|
FormLabel: FormLabel,
|
3417
4174
|
Input: Input,
|
3418
4175
|
LoaderStyle: LoaderStyle,
|
3419
4176
|
Popover: Popover,
|
3420
4177
|
Radio: Radio,
|
3421
|
-
Switch: Switch,
|
4178
|
+
Switch: Switch$1,
|
3422
4179
|
Textarea: Textarea
|
3423
4180
|
};
|
3424
4181
|
|
@@ -3714,12 +4471,20 @@ Object.defineProperty(exports, 'useTabsStyles', {
|
|
3714
4471
|
return react.useTabsStyles;
|
3715
4472
|
}
|
3716
4473
|
});
|
4474
|
+
exports.Badge = Badge;
|
4475
|
+
exports.Box = react.Box;
|
3717
4476
|
exports.BreadCrumb = BreadCrumb;
|
4477
|
+
exports.Button = Button;
|
4478
|
+
exports.Card = CardCustom;
|
3718
4479
|
exports.Checkbox = CheckboxComponent;
|
4480
|
+
exports.CheckboxGroup = CheckboxGroupComponent;
|
4481
|
+
exports.Container = react.Container;
|
3719
4482
|
exports.DataTable = DataTable;
|
3720
4483
|
exports.DatePickerMonth = DatePickerMonth;
|
3721
4484
|
exports.Datepicker = Datepicker;
|
3722
4485
|
exports.Field = Field;
|
4486
|
+
exports.Flex = react.Flex;
|
4487
|
+
exports.Grid = react.Grid;
|
3723
4488
|
exports.Header = Header;
|
3724
4489
|
exports.InputField = InputField;
|
3725
4490
|
exports.Loader = Loader;
|
@@ -3734,15 +4499,22 @@ exports.PaginationDetail = PaginationDetail;
|
|
3734
4499
|
exports.PaginationFilter = PaginationFilter;
|
3735
4500
|
exports.Provider = Provider;
|
3736
4501
|
exports.ProviderContext = ProviderContext;
|
4502
|
+
exports.Radio = RadioComponent;
|
4503
|
+
exports.RadioGroup = RadioGroupComponent;
|
3737
4504
|
exports.Select = Select;
|
3738
4505
|
exports.SelectAsync = SelectAsync;
|
3739
4506
|
exports.SelectAsyncCreatable = SelectAsyncCreatable;
|
3740
4507
|
exports.SelectCreatable = SelectCreatable;
|
4508
|
+
exports.Stack = react.Stack;
|
4509
|
+
exports.Switch = Switch;
|
3741
4510
|
exports.Tab = Tab;
|
3742
4511
|
exports.TabList = TabList;
|
3743
4512
|
exports.TabPanel = TabPanel;
|
4513
|
+
exports.Text = react.Text;
|
3744
4514
|
exports.TextareaField = TextareaField;
|
3745
4515
|
exports.Uploader = Uploader;
|
4516
|
+
exports.Wrap = react.Wrap;
|
4517
|
+
exports.foundations = foundations;
|
3746
4518
|
exports.theme = theme;
|
3747
4519
|
exports.useInternalUI = useInternalUI;
|
3748
4520
|
//# sourceMappingURL=internal-ui.cjs.development.js.map
|