@ctlyst.id/internal-ui 2.0.3 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/field/components/field.d.ts +2 -0
- package/dist/components/form/components/input-element.d.ts +2 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/internal-ui.cjs.development.js +277 -49
- package/dist/internal-ui.cjs.development.js.map +1 -1
- package/dist/internal-ui.cjs.production.min.js +10 -10
- package/dist/internal-ui.cjs.production.min.js.map +1 -1
- package/dist/internal-ui.esm.js +277 -69
- package/dist/internal-ui.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/internal-ui.esm.js
CHANGED
@@ -1,26 +1,256 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
import React__default, { createElement, forwardRef as forwardRef$
|
1
|
+
import { cx, dataAttr } from '@chakra-ui/shared-utils';
|
2
|
+
import { forwardRef, omitThemingProps, useMultiStyleConfig, chakra, useColorMode } from '@chakra-ui/system';
|
3
|
+
import React__default, { createElement, forwardRef as forwardRef$2, useRef, useEffect, useState, useMemo, Fragment, useCallback, createContext as createContext$1, useContext } from 'react';
|
4
|
+
import { createContext } from '@chakra-ui/react-context';
|
5
|
+
import { CheckCircle, Info, AlertTriangle, Close, EyeOff, Eye, Rating as Rating$1, Check } from '@ctlyst.id/internal-icon';
|
6
|
+
import { cx as cx$1 } from '@chakra-ui/utils';
|
7
|
+
import { forwardRef as forwardRef$1, useStyleConfig, Box, Button as Button$2, Badge as Badge$2, useToken, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Card, Checkbox as Checkbox$1, FormControl, FormLabel as FormLabel$1, FormHelperText, FormErrorMessage, CheckboxGroup, Stack, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, defineStyle, InputGroup, Input as Input$1, InputRightAddon, InputRightElement, theme as theme$1, InputLeftAddon, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, 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 as useMultiStyleConfig$1, omitThemingProps as omitThemingProps$1, useCheckbox, chakra as chakra$1, useTab, TabList as TabList$1, TabPanel as TabPanel$1, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, defineStyleConfig as defineStyleConfig$1, extendTheme } from '@chakra-ui/react';
|
8
|
+
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, InputLeftElement as InputElementLeft, InputRightElement as InputElementRight, 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';
|
4
9
|
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
10
|
import { ChevronUpIcon, ChevronDownIcon, UpDownIcon, ArrowLeftIcon, ChevronLeftIcon, ChevronRightIcon, ArrowRightIcon } from '@chakra-ui/icons';
|
6
11
|
import { css, Global, keyframes } from '@emotion/react';
|
7
12
|
import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
|
8
13
|
import classnames from 'classnames';
|
9
14
|
import ReactDatePicker from 'react-datepicker';
|
10
|
-
import { useColorMode } from '@chakra-ui/system';
|
11
15
|
import styled from '@emotion/styled';
|
12
|
-
import { Close, EyeOff, Eye, Check } from '@ctlyst.id/internal-icon';
|
13
16
|
import ReactSelect from 'react-select';
|
14
17
|
import { AsyncPaginate } from 'react-select-async-paginate';
|
15
18
|
import ReactSelectAsyncCreatable from 'react-select/async-creatable';
|
16
19
|
import ReactSelectCreatable from 'react-select/creatable';
|
17
|
-
import { cx, dataAttr } from '@chakra-ui/shared-utils';
|
18
20
|
import { useDropzone } from 'react-dropzone';
|
19
21
|
import { alertAnatomy, checkboxAnatomy, inputAnatomy, popoverAnatomy, radioAnatomy, switchAnatomy } from '@chakra-ui/anatomy';
|
20
22
|
import { createMultiStyleConfigHelpers, cssVar, defineStyleConfig, defineStyle as defineStyle$1 } from '@chakra-ui/styled-system';
|
21
23
|
import { transparentize, mode, calc, cssVar as cssVar$1 } from '@chakra-ui/theme-tools';
|
22
24
|
import axios from 'axios';
|
23
25
|
|
26
|
+
/* eslint-disable react/require-default-props */
|
27
|
+
function CheckIcon() {
|
28
|
+
return /*#__PURE__*/React__default.createElement(CheckCircle, {
|
29
|
+
color: "inherit",
|
30
|
+
size: 4
|
31
|
+
});
|
32
|
+
}
|
33
|
+
function InfoIcon() {
|
34
|
+
return /*#__PURE__*/React__default.createElement(Info, {
|
35
|
+
color: "inherit",
|
36
|
+
size: 4
|
37
|
+
});
|
38
|
+
}
|
39
|
+
function WarningIcon() {
|
40
|
+
return /*#__PURE__*/React__default.createElement(AlertTriangle, {
|
41
|
+
color: "inherit",
|
42
|
+
size: 4
|
43
|
+
});
|
44
|
+
}
|
45
|
+
|
46
|
+
const [AlertProvider, useAlertContext] = /*#__PURE__*/createContext({
|
47
|
+
name: 'AlertContext',
|
48
|
+
hookName: 'useAlertContext',
|
49
|
+
providerName: '<Alert />'
|
50
|
+
});
|
51
|
+
const [AlertStylesProvider, useAlertStyles] = /*#__PURE__*/createContext({
|
52
|
+
name: `AlertStylesContext`,
|
53
|
+
hookName: `useAlertStyles`,
|
54
|
+
providerName: '<Alert />'
|
55
|
+
});
|
56
|
+
const STATUSES = {
|
57
|
+
info: {
|
58
|
+
icon: InfoIcon,
|
59
|
+
colorScheme: 'info'
|
60
|
+
},
|
61
|
+
warning: {
|
62
|
+
icon: InfoIcon,
|
63
|
+
colorScheme: 'warning'
|
64
|
+
},
|
65
|
+
success: {
|
66
|
+
icon: CheckIcon,
|
67
|
+
colorScheme: 'success'
|
68
|
+
},
|
69
|
+
error: {
|
70
|
+
icon: WarningIcon,
|
71
|
+
colorScheme: 'danger'
|
72
|
+
}
|
73
|
+
};
|
74
|
+
function getStatusColorScheme(status) {
|
75
|
+
return STATUSES[status].colorScheme;
|
76
|
+
}
|
77
|
+
function getStatusIcon(status) {
|
78
|
+
return STATUSES[status].icon;
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Alert is used to communicate the state or status of a
|
83
|
+
* page, feature or action
|
84
|
+
*
|
85
|
+
* @see Docs https://chakra-ui.com/docs/components/alert
|
86
|
+
* @see WAI-ARIA https://www.w3.org/WAI/ARIA/apg/patterns/alert/
|
87
|
+
*/
|
88
|
+
const Alert = /*#__PURE__*/forwardRef(function Alert(props, ref) {
|
89
|
+
var _props$colorScheme;
|
90
|
+
const {
|
91
|
+
status = 'info',
|
92
|
+
addRole = true,
|
93
|
+
children,
|
94
|
+
...rest
|
95
|
+
} = omitThemingProps(props);
|
96
|
+
const colorScheme = (_props$colorScheme = props.colorScheme) !== null && _props$colorScheme !== void 0 ? _props$colorScheme : getStatusColorScheme(status);
|
97
|
+
const styles = useMultiStyleConfig('Alert', {
|
98
|
+
...props,
|
99
|
+
colorScheme
|
100
|
+
});
|
101
|
+
const alertStyles = {
|
102
|
+
width: '100%',
|
103
|
+
display: 'grid',
|
104
|
+
gridTemplateColumns: 'auto 1fr auto auto',
|
105
|
+
alignItems: 'center',
|
106
|
+
position: 'relative',
|
107
|
+
overflow: 'hidden',
|
108
|
+
...styles.container
|
109
|
+
};
|
110
|
+
return /*#__PURE__*/React__default.createElement(AlertProvider, {
|
111
|
+
value: {
|
112
|
+
status
|
113
|
+
}
|
114
|
+
}, /*#__PURE__*/React__default.createElement(AlertStylesProvider, {
|
115
|
+
value: styles
|
116
|
+
}, /*#__PURE__*/React__default.createElement(chakra.div, Object.assign({
|
117
|
+
"data-status": status,
|
118
|
+
role: addRole ? 'alert' : undefined,
|
119
|
+
ref: ref
|
120
|
+
}, rest, {
|
121
|
+
className: cx('chakra-alert', props.className),
|
122
|
+
__css: alertStyles
|
123
|
+
}), children)));
|
124
|
+
});
|
125
|
+
Alert.displayName = 'Alert';
|
126
|
+
|
127
|
+
const Loader = /*#__PURE__*/forwardRef$1((props, ref) => {
|
128
|
+
const styles = useStyleConfig('LoaderStyle', props);
|
129
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
130
|
+
ref: ref,
|
131
|
+
__css: styles
|
132
|
+
});
|
133
|
+
});
|
134
|
+
|
135
|
+
const Button = props => {
|
136
|
+
const {
|
137
|
+
children,
|
138
|
+
variant,
|
139
|
+
size,
|
140
|
+
...rest
|
141
|
+
} = props;
|
142
|
+
const getLoaderSize = () => {
|
143
|
+
if (size === 'lg') return 'md';
|
144
|
+
if (size === 'md') return 'sm';
|
145
|
+
return 'xs';
|
146
|
+
};
|
147
|
+
const getLoaderColor = () => {
|
148
|
+
if (variant === 'primary' || variant === 'danger') return 'white';
|
149
|
+
if (variant === 'outline-danger') return 'danger';
|
150
|
+
return 'primary';
|
151
|
+
};
|
152
|
+
return /*#__PURE__*/React__default.createElement(Button$2, Object.assign({
|
153
|
+
size: size,
|
154
|
+
variant: variant,
|
155
|
+
spinner: /*#__PURE__*/React__default.createElement(Loader, {
|
156
|
+
size: getLoaderSize(),
|
157
|
+
color: getLoaderColor()
|
158
|
+
})
|
159
|
+
}, rest), children);
|
160
|
+
};
|
161
|
+
|
162
|
+
function AlertAction({
|
163
|
+
children,
|
164
|
+
className
|
165
|
+
}) {
|
166
|
+
const styles = useAlertStyles();
|
167
|
+
const css = styles.action;
|
168
|
+
return /*#__PURE__*/React__default.createElement(Button, {
|
169
|
+
"data-test-id": "alert-action",
|
170
|
+
className: cx$1('chakra-alert__close', className),
|
171
|
+
variant: "link",
|
172
|
+
color: "inherit",
|
173
|
+
fontWeight: "700",
|
174
|
+
__css: css
|
175
|
+
}, children);
|
176
|
+
}
|
177
|
+
AlertAction.displayName = 'AlertAction';
|
178
|
+
|
179
|
+
function AlertClose({
|
180
|
+
className,
|
181
|
+
children,
|
182
|
+
...rest
|
183
|
+
}) {
|
184
|
+
const styles = useAlertStyles();
|
185
|
+
const css = styles.close;
|
186
|
+
return /*#__PURE__*/React__default.createElement(chakra.span, Object.assign({
|
187
|
+
display: "inherit",
|
188
|
+
"data-status": 'alert-close'
|
189
|
+
}, rest, {
|
190
|
+
className: cx('chakra-alert__close', className),
|
191
|
+
__css: css
|
192
|
+
}), children || /*#__PURE__*/React__default.createElement(Close, {
|
193
|
+
color: "inherit",
|
194
|
+
size: 4
|
195
|
+
}));
|
196
|
+
}
|
197
|
+
AlertClose.displayName = 'AlertClose';
|
198
|
+
|
199
|
+
const AlertDescription = /*#__PURE__*/forwardRef(function AlertDescription(props, ref) {
|
200
|
+
const styles = useAlertStyles();
|
201
|
+
const {
|
202
|
+
status
|
203
|
+
} = useAlertContext();
|
204
|
+
const descriptionStyles = {
|
205
|
+
display: 'inline',
|
206
|
+
...styles.description
|
207
|
+
};
|
208
|
+
return /*#__PURE__*/React__default.createElement(chakra.div, Object.assign({
|
209
|
+
ref: ref,
|
210
|
+
"data-status": status
|
211
|
+
}, props, {
|
212
|
+
className: cx('chakra-alert__desc', props.className),
|
213
|
+
__css: descriptionStyles
|
214
|
+
}));
|
215
|
+
});
|
216
|
+
AlertDescription.displayName = 'AlertDescription';
|
217
|
+
|
218
|
+
function AlertIcon({
|
219
|
+
className,
|
220
|
+
children,
|
221
|
+
...rest
|
222
|
+
}) {
|
223
|
+
const {
|
224
|
+
status
|
225
|
+
} = useAlertContext();
|
226
|
+
const BaseIcon = getStatusIcon(status);
|
227
|
+
const styles = useAlertStyles();
|
228
|
+
const css = styles.icon;
|
229
|
+
return /*#__PURE__*/React__default.createElement(chakra.span, Object.assign({
|
230
|
+
display: "inherit",
|
231
|
+
"data-status": status
|
232
|
+
}, rest, {
|
233
|
+
className: cx('chakra-alert__icon', className),
|
234
|
+
__css: css
|
235
|
+
}), children || /*#__PURE__*/React__default.createElement(BaseIcon, null));
|
236
|
+
}
|
237
|
+
AlertIcon.displayName = 'AlertIcon';
|
238
|
+
|
239
|
+
const AlertTitle = /*#__PURE__*/forwardRef(function AlertTitle(props, ref) {
|
240
|
+
const styles = useAlertStyles();
|
241
|
+
const {
|
242
|
+
status
|
243
|
+
} = useAlertContext();
|
244
|
+
return /*#__PURE__*/React__default.createElement(chakra.div, Object.assign({
|
245
|
+
ref: ref,
|
246
|
+
"data-status": status
|
247
|
+
}, props, {
|
248
|
+
className: cx('chakra-alert__title', props.className),
|
249
|
+
__css: styles.title
|
250
|
+
}));
|
251
|
+
});
|
252
|
+
AlertTitle.displayName = 'AlertTitle';
|
253
|
+
|
24
254
|
const Badge = props => {
|
25
255
|
const {
|
26
256
|
children,
|
@@ -32,7 +262,7 @@ const Badge = props => {
|
|
32
262
|
variant: "primary-solid",
|
33
263
|
padding: "0 8px",
|
34
264
|
height: "18px",
|
35
|
-
display: "flex",
|
265
|
+
display: "inline-flex",
|
36
266
|
alignItems: "center",
|
37
267
|
justifyContent: "space-between",
|
38
268
|
textTransform: "none"
|
@@ -137,42 +367,7 @@ BreadCrumb.defaultProps = {
|
|
137
367
|
spacing: 2
|
138
368
|
};
|
139
369
|
|
140
|
-
const
|
141
|
-
const styles = useStyleConfig('LoaderStyle', props);
|
142
|
-
return /*#__PURE__*/React__default.createElement(Box, {
|
143
|
-
ref: ref,
|
144
|
-
__css: styles
|
145
|
-
});
|
146
|
-
});
|
147
|
-
|
148
|
-
const Button = props => {
|
149
|
-
const {
|
150
|
-
children,
|
151
|
-
variant,
|
152
|
-
size,
|
153
|
-
...rest
|
154
|
-
} = props;
|
155
|
-
const getLoaderSize = () => {
|
156
|
-
if (size === 'lg') return 'md';
|
157
|
-
if (size === 'md') return 'sm';
|
158
|
-
return 'xs';
|
159
|
-
};
|
160
|
-
const getLoaderColor = () => {
|
161
|
-
if (variant === 'primary' || variant === 'danger') return 'white';
|
162
|
-
if (variant === 'outline-danger') return 'danger';
|
163
|
-
return 'primary';
|
164
|
-
};
|
165
|
-
return /*#__PURE__*/React__default.createElement(Button$2, Object.assign({
|
166
|
-
size: size,
|
167
|
-
variant: variant,
|
168
|
-
spinner: /*#__PURE__*/React__default.createElement(Loader, {
|
169
|
-
size: getLoaderSize(),
|
170
|
-
color: getLoaderColor()
|
171
|
-
})
|
172
|
-
}, rest), children);
|
173
|
-
};
|
174
|
-
|
175
|
-
const CardCustom = /*#__PURE__*/forwardRef$1(({
|
370
|
+
const CardCustom = /*#__PURE__*/forwardRef$2(({
|
176
371
|
children,
|
177
372
|
...rest
|
178
373
|
}, ref) => {
|
@@ -223,7 +418,6 @@ CheckboxComponent.defaultProps = {
|
|
223
418
|
errorText: ''
|
224
419
|
};
|
225
420
|
|
226
|
-
/* eslint-disable no-nested-ternary */
|
227
421
|
const Field = props => {
|
228
422
|
const {
|
229
423
|
label,
|
@@ -233,7 +427,8 @@ const Field = props => {
|
|
233
427
|
rightHelperText,
|
234
428
|
isRequired,
|
235
429
|
children,
|
236
|
-
isSuccess
|
430
|
+
isSuccess,
|
431
|
+
boxProps = {}
|
237
432
|
} = props;
|
238
433
|
const getHelperColor = () => {
|
239
434
|
if (isError) return 'danger.500';
|
@@ -246,9 +441,9 @@ const Field = props => {
|
|
246
441
|
};
|
247
442
|
const helperColor = getHelperColor();
|
248
443
|
const justifyHelper = getJustifyContentHelper();
|
249
|
-
return /*#__PURE__*/React__default.createElement(FormControl, {
|
444
|
+
return /*#__PURE__*/React__default.createElement(FormControl, Object.assign({
|
250
445
|
isInvalid: isError
|
251
|
-
}, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
|
446
|
+
}, boxProps), label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
|
252
447
|
mb: 1,
|
253
448
|
fontSize: "text.sm",
|
254
449
|
requiredIndicator: undefined
|
@@ -261,19 +456,19 @@ const Field = props => {
|
|
261
456
|
display: "flex",
|
262
457
|
width: "full",
|
263
458
|
justifyContent: justifyHelper
|
264
|
-
}, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
459
|
+
}, !isError ? leftHelperText && (typeof leftHelperText === 'string' ? /*#__PURE__*/React__default.createElement(FormHelperText, {
|
265
460
|
fontSize: "text.xs",
|
266
461
|
color: helperColor,
|
267
462
|
mt: 1
|
268
|
-
}, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
|
463
|
+
}, leftHelperText) : leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
|
269
464
|
fontSize: "text.xs",
|
270
465
|
color: "danger.500",
|
271
466
|
mt: 1
|
272
|
-
}, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
467
|
+
}, errorMessage) : errorMessage, rightHelperText && (typeof rightHelperText === 'string' ? /*#__PURE__*/React__default.createElement(FormHelperText, {
|
273
468
|
fontSize: "text.xs",
|
274
469
|
color: helperColor,
|
275
470
|
mt: 1
|
276
|
-
}, rightHelperText)));
|
471
|
+
}, rightHelperText) : rightHelperText)));
|
277
472
|
};
|
278
473
|
Field.defaultProps = {
|
279
474
|
label: '',
|
@@ -282,7 +477,8 @@ Field.defaultProps = {
|
|
282
477
|
errorMessage: undefined,
|
283
478
|
leftHelperText: undefined,
|
284
479
|
rightHelperText: undefined,
|
285
|
-
isRequired: false
|
480
|
+
isRequired: false,
|
481
|
+
boxProps: {}
|
286
482
|
};
|
287
483
|
|
288
484
|
function CheckboxGroupComponent(props) {
|
@@ -2289,7 +2485,7 @@ const ModalBody = /*#__PURE__*/React__default.forwardRef(({
|
|
2289
2485
|
}, rest), children);
|
2290
2486
|
});
|
2291
2487
|
|
2292
|
-
const ModalCloseButton = /*#__PURE__*/forwardRef$
|
2488
|
+
const ModalCloseButton = /*#__PURE__*/forwardRef$2((props, ref) => {
|
2293
2489
|
return /*#__PURE__*/React__default.createElement(ModalCloseButton$1, Object.assign({
|
2294
2490
|
ref: ref,
|
2295
2491
|
top: 4,
|
@@ -2299,7 +2495,7 @@ const ModalCloseButton = /*#__PURE__*/forwardRef$1((props, ref) => {
|
|
2299
2495
|
}, props));
|
2300
2496
|
});
|
2301
2497
|
|
2302
|
-
const ModalFooter = /*#__PURE__*/forwardRef$
|
2498
|
+
const ModalFooter = /*#__PURE__*/forwardRef$2(({
|
2303
2499
|
children,
|
2304
2500
|
...rest
|
2305
2501
|
}, ref) => {
|
@@ -2310,7 +2506,7 @@ const ModalFooter = /*#__PURE__*/forwardRef$1(({
|
|
2310
2506
|
}, rest), children);
|
2311
2507
|
});
|
2312
2508
|
|
2313
|
-
const ModalHeader = /*#__PURE__*/forwardRef$
|
2509
|
+
const ModalHeader = /*#__PURE__*/forwardRef$2(({
|
2314
2510
|
children,
|
2315
2511
|
...rest
|
2316
2512
|
}, ref) => {
|
@@ -2461,7 +2657,7 @@ Navigation.defaultProps = {
|
|
2461
2657
|
host: undefined
|
2462
2658
|
};
|
2463
2659
|
|
2464
|
-
const PaginationButton = /*#__PURE__*/forwardRef(({
|
2660
|
+
const PaginationButton = /*#__PURE__*/forwardRef$1(({
|
2465
2661
|
className,
|
2466
2662
|
style,
|
2467
2663
|
isActive,
|
@@ -2743,6 +2939,18 @@ RadioGroupComponent.defaultProps = {
|
|
2743
2939
|
errorMessage: ''
|
2744
2940
|
};
|
2745
2941
|
|
2942
|
+
const Rating = ({
|
2943
|
+
value
|
2944
|
+
}) => {
|
2945
|
+
return /*#__PURE__*/React__default.createElement(Grid, {
|
2946
|
+
gap: '4px',
|
2947
|
+
display: "flex"
|
2948
|
+
}, [...Array(5)].map((_, i) => /*#__PURE__*/React__default.createElement(Rating$1, {
|
2949
|
+
color: i < value ? '#FFA230' : '#E0E0E0',
|
2950
|
+
size: 24
|
2951
|
+
})));
|
2952
|
+
};
|
2953
|
+
|
2746
2954
|
const SelectWrapper = ({
|
2747
2955
|
children,
|
2748
2956
|
isError = false
|
@@ -2941,8 +3149,8 @@ function SelectCreatable({
|
|
2941
3149
|
* @see Docs https://chakra-ui.com/docs/components/switch
|
2942
3150
|
* @see WAI-ARIA https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
2943
3151
|
*/
|
2944
|
-
const Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
2945
|
-
const styles = useMultiStyleConfig('Switch', props);
|
3152
|
+
const Switch = /*#__PURE__*/forwardRef$1(function Switch(props, ref) {
|
3153
|
+
const styles = useMultiStyleConfig$1('Switch', props);
|
2946
3154
|
const {
|
2947
3155
|
size = 'md'
|
2948
3156
|
} = props;
|
@@ -2950,7 +3158,7 @@ const Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
2950
3158
|
spacing = '0.5rem',
|
2951
3159
|
children,
|
2952
3160
|
...ownProps
|
2953
|
-
} = omitThemingProps(props);
|
3161
|
+
} = omitThemingProps$1(props);
|
2954
3162
|
const {
|
2955
3163
|
state,
|
2956
3164
|
getInputProps,
|
@@ -2987,7 +3195,7 @@ const Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
2987
3195
|
};
|
2988
3196
|
return iconSize[value];
|
2989
3197
|
};
|
2990
|
-
return /*#__PURE__*/React__default.createElement(chakra.label, Object.assign({}, getRootProps(), {
|
3198
|
+
return /*#__PURE__*/React__default.createElement(chakra$1.label, Object.assign({}, getRootProps(), {
|
2991
3199
|
display: "flex",
|
2992
3200
|
alignItems: "center",
|
2993
3201
|
className: cx('chakra-switch', props.className),
|
@@ -2995,7 +3203,7 @@ const Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
2995
3203
|
}), /*#__PURE__*/React__default.createElement("input", Object.assign({
|
2996
3204
|
"data-test-id": "",
|
2997
3205
|
className: "chakra-switch__input"
|
2998
|
-
}, getInputProps({}, ref))), /*#__PURE__*/React__default.createElement(chakra.span, Object.assign({}, getCheckboxProps(), {
|
3206
|
+
}, getInputProps({}, ref))), /*#__PURE__*/React__default.createElement(chakra$1.span, Object.assign({}, getCheckboxProps(), {
|
2999
3207
|
className: "chakra-switch__track",
|
3000
3208
|
pos: "relative",
|
3001
3209
|
__css: trackStyles
|
@@ -3011,12 +3219,12 @@ const Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
3011
3219
|
}), /*#__PURE__*/React__default.createElement(Close, {
|
3012
3220
|
color: state.isDisabled ? 'neutral.600' : 'neutral.900',
|
3013
3221
|
size: getIconSize(size)
|
3014
|
-
})), /*#__PURE__*/React__default.createElement(chakra.span, {
|
3222
|
+
})), /*#__PURE__*/React__default.createElement(chakra$1.span, {
|
3015
3223
|
__css: styles.thumb,
|
3016
3224
|
className: "chakra-switch__thumb",
|
3017
3225
|
"data-checked": dataAttr(state.isChecked),
|
3018
3226
|
"data-hover": dataAttr(state.isHovered)
|
3019
|
-
})), children && /*#__PURE__*/React__default.createElement(chakra.span, Object.assign({
|
3227
|
+
})), children && /*#__PURE__*/React__default.createElement(chakra$1.span, Object.assign({
|
3020
3228
|
className: "chakra-switch__label",
|
3021
3229
|
color: state.isDisabled ? 'black.low' : 'black.high'
|
3022
3230
|
}, getLabelProps(), {
|
@@ -3024,14 +3232,14 @@ const Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
3024
3232
|
}), children));
|
3025
3233
|
});
|
3026
3234
|
|
3027
|
-
const Tab = /*#__PURE__*/forwardRef((props, ref) => {
|
3235
|
+
const Tab = /*#__PURE__*/forwardRef$1((props, ref) => {
|
3028
3236
|
var _props$leftAddon, _props$rightAddon;
|
3029
3237
|
const tabProps = useTab({
|
3030
3238
|
...props,
|
3031
3239
|
ref
|
3032
3240
|
});
|
3033
3241
|
const isSelected = !!tabProps['aria-selected'];
|
3034
|
-
const styles = useMultiStyleConfig('Tabs', tabProps);
|
3242
|
+
const styles = useMultiStyleConfig$1('Tabs', tabProps);
|
3035
3243
|
return /*#__PURE__*/createElement(Button$2, Object.assign({
|
3036
3244
|
p: 3,
|
3037
3245
|
fontSize: "text.md",
|
@@ -3052,13 +3260,13 @@ const Tab = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3052
3260
|
})));
|
3053
3261
|
});
|
3054
3262
|
|
3055
|
-
const TabList = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React__default.createElement(TabList$1, {
|
3263
|
+
const TabList = /*#__PURE__*/forwardRef$1((props, ref) => /*#__PURE__*/React__default.createElement(TabList$1, {
|
3056
3264
|
borderBottom: "1px solid",
|
3057
3265
|
borderColor: useColorModeValue('gray.200', 'bright-gray.800'),
|
3058
3266
|
ref: ref
|
3059
3267
|
}, props.children));
|
3060
3268
|
|
3061
|
-
const TabPanel = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React__default.createElement(TabPanel$1, {
|
3269
|
+
const TabPanel = /*#__PURE__*/forwardRef$1((props, ref) => /*#__PURE__*/React__default.createElement(TabPanel$1, {
|
3062
3270
|
px: 0,
|
3063
3271
|
ref: ref
|
3064
3272
|
}, props.children));
|
@@ -4258,7 +4466,7 @@ const theme = /*#__PURE__*/extendTheme({
|
|
4258
4466
|
config
|
4259
4467
|
});
|
4260
4468
|
|
4261
|
-
const ProviderContext = /*#__PURE__*/createContext({
|
4469
|
+
const ProviderContext = /*#__PURE__*/createContext$1({
|
4262
4470
|
instance: undefined
|
4263
4471
|
});
|
4264
4472
|
const useInternalUI = () => {
|
@@ -4293,5 +4501,5 @@ const Provider = ({
|
|
4293
4501
|
};
|
4294
4502
|
Provider.displayName = 'Provider';
|
4295
4503
|
|
4296
|
-
export { Badge, Box, BreadCrumb, Button, CardCustom as Card, CheckboxComponent as Checkbox, CheckboxGroupComponent as CheckboxGroup, Container, DataTable, DatePickerMonth, Datepicker, Field, Flex, Grid, Header, InputAddonLeft, InputAddonRight, 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 };
|
4504
|
+
export { Alert, AlertAction, AlertClose, AlertDescription, AlertIcon, AlertTitle, Badge, Box, BreadCrumb, Button, CardCustom as Card, CheckboxComponent as Checkbox, CheckboxGroupComponent as CheckboxGroup, Container, DataTable, DatePickerMonth, Datepicker, Field, Flex, Grid, Header, InputAddonLeft, InputAddonRight, InputField, Loader, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, MultiDatePickerMonth, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, RadioComponent as Radio, RadioGroupComponent as RadioGroup, Rating, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Stack, Switch, Tab, TabList, TabPanel, Text, TextareaField, Uploader, Wrap, foundations, theme, useAlertStyles, useInternalUI };
|
4297
4505
|
//# sourceMappingURL=internal-ui.esm.js.map
|