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