@ctlyst.id/internal-ui 1.0.4-canary.1 → 1.0.4-canary.10
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/breadcrumb/index.d.ts +2 -2
- package/dist/components/checkbox/__stories__/checkbox.stories.d.ts +12 -0
- package/dist/components/checkbox/components/checkbox.d.ts +16 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/field/components/field.d.ts +5 -2
- package/dist/components/field/index.d.ts +0 -2
- package/dist/components/form/__stories__/textarea.stories.d.ts +10 -0
- package/dist/components/{field/components/textarea-field.d.ts → form/components/textarea.d.ts} +2 -6
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/header/components/header.d.ts +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/{base/stories/checkbox.stories.d.ts → loader/__stories__/loader.stories.d.ts} +3 -2
- package/dist/components/loader/components/loader.d.ts +9 -0
- package/dist/components/loader/index.d.ts +2 -0
- package/dist/components/navigation/components/customer-icon.d.ts +2 -0
- package/dist/components/navigation/components/mapping-icon.d.ts +2 -0
- package/dist/components/navigation/types.d.ts +1 -1
- package/dist/components/select/components/select-async-creatable.d.ts +3 -2
- package/dist/components/select/components/select-async.d.ts +3 -2
- package/dist/components/select/components/select-creatable.d.ts +3 -2
- package/dist/components/select/components/select-wrapper.d.ts +6 -0
- package/dist/components/select/components/select.d.ts +3 -2
- package/dist/components/select/components/types/select.types.d.ts +3 -0
- package/dist/components/select/components/utils.d.ts +1 -1
- package/dist/config/{foundations.stories.d.ts → __stories__/foundations.stories.d.ts} +1 -0
- package/dist/config/theme/components/checkbox.d.ts +86 -2
- package/dist/config/theme/components/index.d.ts +2 -1
- package/dist/config/theme/components/loader.d.ts +85 -0
- package/dist/config/theme/components/textarea.d.ts +54 -2
- package/dist/config/theme/foundations/index.d.ts +3 -2
- package/dist/config/theme/foundations/shadows.d.ts +15 -0
- package/dist/config/theme/foundations/typography.d.ts +25 -7
- package/dist/internal-ui.cjs.development.js +543 -191
- package/dist/internal-ui.cjs.development.js.map +1 -1
- package/dist/internal-ui.cjs.production.min.js +15 -7
- package/dist/internal-ui.cjs.production.min.js.map +1 -1
- package/dist/internal-ui.esm.js +557 -207
- package/dist/internal-ui.esm.js.map +1 -1
- package/dist/provider/{provider.d.ts → components/provider.d.ts} +2 -1
- package/dist/provider/index.d.ts +2 -2
- package/package.json +3 -3
- /package/dist/components/base/{stories → __stories__}/button.stories.d.ts +0 -0
- /package/dist/components/base/{stories → __stories__}/input.stories.d.ts +0 -0
- /package/dist/components/base/{stories → __stories__}/radio.stories.d.ts +0 -0
- /package/dist/components/base/{stories → __stories__}/switch.stories.d.ts +0 -0
- /package/dist/components/breadcrumb/{components/BreadCrumb.stories.d.ts → __stories__/breadcrumb.stories.d.ts} +0 -0
- /package/dist/components/breadcrumb/components/{BreadCrumb.d.ts → bread-crumb.d.ts} +0 -0
- /package/dist/components/data-table/{stories/data-table.stories.d.ts → __stories__/datatable.stories.d.ts} +0 -0
- /package/dist/components/datepicker/{components → __stories__}/datepicker.stories.d.ts +0 -0
- /package/dist/components/header/{stories → __stories__}/header.stories.d.ts +0 -0
- /package/dist/components/modal/{stories → __stories__}/modal.stories.d.ts +0 -0
- /package/dist/components/navigation/{stories → __stories__}/navigation.stories.d.ts +0 -0
- /package/dist/components/pagination/{stories → __stories__}/pagination.stories.d.ts +0 -0
- /package/dist/components/select/{stories → __stories__}/select.stories.d.ts +0 -0
- /package/dist/components/tabs/{stories → __stories__}/tabs.stories.d.ts +0 -0
- /package/dist/components/uploader/{stories → __stories__}/uploader.stories.d.ts +0 -0
- /package/dist/provider/{provider.stories.d.ts → __stories__/provider.stories.d.ts} +0 -0
package/dist/internal-ui.esm.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { useToken, Box, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, InputGroup, Input as Input$1, InputRightAddon, FormControl, FormLabel as FormLabel$1, InputRightElement, FormHelperText, FormErrorMessage, theme as theme$1, InputLeftAddon, InputLeftElement, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, Badge, ModalBody as ModalBody$1, ModalCloseButton as ModalCloseButton$1, ModalFooter as ModalFooter$1, ModalHeader as ModalHeader$1, Icon, Portal, Link,
|
1
|
+
import { useToken, Box, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Checkbox as Checkbox$1, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, InputGroup, Input as Input$1, InputRightAddon, FormControl, FormLabel as FormLabel$1, InputRightElement, FormHelperText, FormErrorMessage, theme as theme$1, InputLeftAddon, InputLeftElement, forwardRef, useStyleConfig, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, Badge, ModalBody as ModalBody$1, ModalCloseButton as ModalCloseButton$1, ModalFooter as ModalFooter$1, ModalHeader as ModalHeader$1, createIcon, Icon, Portal, Link, Button as Button$1, VisuallyHidden, Select as Select$1, useTab, useMultiStyleConfig, TabList as TabList$1, TabPanel as TabPanel$1, Stack, Heading, createMultiStyleConfigHelpers, defineStyleConfig as defineStyleConfig$1, defineStyle as defineStyle$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, useRef, useEffect, useState, useMemo, Fragment, forwardRef, useCallback, createContext, useContext } from 'react';
|
4
|
-
import { FiChevronsRight, FiHome, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiChevronDown } from 'react-icons/fi';
|
3
|
+
import React__default, { createElement, useRef, useEffect, useState, useMemo, Fragment, forwardRef as forwardRef$1, useCallback, createContext, useContext } from 'react';
|
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
|
-
import { css, Global } from '@emotion/react';
|
6
|
+
import { css, Global, keyframes } from '@emotion/react';
|
7
7
|
import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
|
8
8
|
import classnames from 'classnames';
|
9
9
|
import ReactDatePicker from 'react-datepicker';
|
@@ -15,8 +15,9 @@ import ReactSelectAsyncCreatable from 'react-select/async-creatable';
|
|
15
15
|
import ReactSelectCreatable from 'react-select/creatable';
|
16
16
|
import { useDropzone } from 'react-dropzone';
|
17
17
|
import { mode, getColor } from '@chakra-ui/theme-tools';
|
18
|
-
import { checkboxAnatomy, inputAnatomy, radioAnatomy, switchAnatomy
|
19
|
-
import {
|
18
|
+
import { checkboxAnatomy, inputAnatomy, popoverAnatomy, radioAnatomy, switchAnatomy } from '@chakra-ui/anatomy';
|
19
|
+
import { defineStyleConfig, defineStyle, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1 } from '@chakra-ui/styled-system';
|
20
|
+
import '@fontsource/poppins';
|
20
21
|
import axios from 'axios';
|
21
22
|
|
22
23
|
/* eslint-disable react-hooks/rules-of-hooks */
|
@@ -29,7 +30,7 @@ const BreadCrumb = props => {
|
|
29
30
|
disableHome,
|
30
31
|
spacing = 2
|
31
32
|
} = props;
|
32
|
-
const [
|
33
|
+
const [neutral6, dark5] = useToken('colors', ['neutral.600', 'dark.500']);
|
33
34
|
return /*#__PURE__*/createElement(Box, {
|
34
35
|
"data-test-id": "CT_component_breadcrumb_breadcrumb",
|
35
36
|
className: className,
|
@@ -42,16 +43,16 @@ const BreadCrumb = props => {
|
|
42
43
|
alignItems: "center"
|
43
44
|
}, /*#__PURE__*/createElement(Text, {
|
44
45
|
pr: 2,
|
45
|
-
fontWeight:
|
46
|
-
textStyle: "heading.
|
46
|
+
fontWeight: 600,
|
47
|
+
textStyle: "heading.4",
|
47
48
|
color: useColorModeValue('neutral.700', 'white')
|
48
49
|
}, title), /*#__PURE__*/createElement(Box, {
|
49
50
|
h: "22px",
|
50
51
|
borderLeft: "1px solid",
|
51
|
-
borderColor: useColorModeValue(
|
52
|
+
borderColor: useColorModeValue(neutral6, 'white')
|
52
53
|
}), /*#__PURE__*/createElement(Breadcrumb, {
|
53
54
|
separator: /*#__PURE__*/createElement(FiChevronsRight, {
|
54
|
-
color: useColorModeValue(
|
55
|
+
color: useColorModeValue(neutral6, dark5),
|
55
56
|
size: 14
|
56
57
|
}),
|
57
58
|
pl: 2.5,
|
@@ -101,7 +102,7 @@ const BreadCrumb = props => {
|
|
101
102
|
cursor: 'default'
|
102
103
|
}
|
103
104
|
}, /*#__PURE__*/createElement(Text, {
|
104
|
-
color: useColorModeValue(
|
105
|
+
color: useColorModeValue(neutral6, 'white'),
|
105
106
|
fontSize: "text.sm",
|
106
107
|
fontWeight: 400
|
107
108
|
}, title))))), children && /*#__PURE__*/createElement(Box, null, children));
|
@@ -114,6 +115,43 @@ BreadCrumb.defaultProps = {
|
|
114
115
|
spacing: 2
|
115
116
|
};
|
116
117
|
|
118
|
+
function CheckboxComponent({
|
119
|
+
isError = false,
|
120
|
+
helpText = '',
|
121
|
+
errorText = '',
|
122
|
+
children,
|
123
|
+
isDisabled,
|
124
|
+
...rest
|
125
|
+
}) {
|
126
|
+
const variant = isError ? 'errors' : 'unstyled';
|
127
|
+
return /*#__PURE__*/React__default.createElement(Box, null, /*#__PURE__*/React__default.createElement(Box, {
|
128
|
+
display: "flex"
|
129
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox$1, Object.assign({
|
130
|
+
variant: variant
|
131
|
+
}, rest, {
|
132
|
+
isDisabled: isDisabled
|
133
|
+
})), children && /*#__PURE__*/React__default.createElement(Box, null, /*#__PURE__*/React__default.createElement(Box, {
|
134
|
+
ml: "8px"
|
135
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
136
|
+
textStyle: "text.sm",
|
137
|
+
color: isDisabled ? 'black.low' : 'black.high'
|
138
|
+
}, children)))), /*#__PURE__*/React__default.createElement(Box, {
|
139
|
+
mt: "5px",
|
140
|
+
ml: "24px"
|
141
|
+
}, isError ? /*#__PURE__*/React__default.createElement(Text, {
|
142
|
+
textStyle: "text.xs",
|
143
|
+
color: "danger.500"
|
144
|
+
}, errorText) : /*#__PURE__*/React__default.createElement(Text, {
|
145
|
+
textStyle: "text.xs",
|
146
|
+
color: isDisabled ? 'black.low' : 'black.medium'
|
147
|
+
}, helpText)));
|
148
|
+
}
|
149
|
+
CheckboxComponent.defaultProps = {
|
150
|
+
isError: false,
|
151
|
+
helpText: '',
|
152
|
+
errorText: ''
|
153
|
+
};
|
154
|
+
|
117
155
|
const IndeterminateCheckbox = ({
|
118
156
|
indeterminate = false,
|
119
157
|
...rest
|
@@ -1302,7 +1340,7 @@ const success = {
|
|
1302
1340
|
'200': '#A9F9B5',
|
1303
1341
|
'300': '#7CEE98',
|
1304
1342
|
'400': '#58DD86',
|
1305
|
-
'500': '#
|
1343
|
+
'500': '#28C76F',
|
1306
1344
|
'600': '#1DAB6A',
|
1307
1345
|
'700': '#148F63',
|
1308
1346
|
'800': '#0C7359',
|
@@ -1430,8 +1468,13 @@ const radius = {
|
|
1430
1468
|
full: '9999px'
|
1431
1469
|
};
|
1432
1470
|
|
1433
|
-
const
|
1434
|
-
...theme$1.
|
1471
|
+
const shadows = {
|
1472
|
+
...theme$1.shadows,
|
1473
|
+
raised: '0px 4px 20px rgba(0, 0, 0, 0.05)'
|
1474
|
+
};
|
1475
|
+
|
1476
|
+
const sizes = {
|
1477
|
+
...theme$1.sizes,
|
1435
1478
|
4.5: '1.125rem',
|
1436
1479
|
9.5: '2.375rem',
|
1437
1480
|
18: '4.5rem',
|
@@ -1440,8 +1483,8 @@ const spacing = {
|
|
1440
1483
|
30: '7.5rem'
|
1441
1484
|
};
|
1442
1485
|
|
1443
|
-
const
|
1444
|
-
...theme$1.
|
1486
|
+
const spacing = {
|
1487
|
+
...theme$1.space,
|
1445
1488
|
4.5: '1.125rem',
|
1446
1489
|
9.5: '2.375rem',
|
1447
1490
|
18: '4.5rem',
|
@@ -1472,6 +1515,11 @@ const lineHeights = {
|
|
1472
1515
|
short: 1.375,
|
1473
1516
|
base: 1.5,
|
1474
1517
|
tall: 1.625,
|
1518
|
+
64: '4rem',
|
1519
|
+
56: '3.5rem',
|
1520
|
+
48: '3rem',
|
1521
|
+
40: '2.5rem',
|
1522
|
+
36: '2.25rem',
|
1475
1523
|
34: '2.125rem',
|
1476
1524
|
32: '2rem',
|
1477
1525
|
30: '1.875rem',
|
@@ -1485,14 +1533,22 @@ const lineHeights = {
|
|
1485
1533
|
14: '0.875rem',
|
1486
1534
|
12: '0.75rem'
|
1487
1535
|
};
|
1536
|
+
const letterSpacings = {
|
1537
|
+
tighter: '-0.05em',
|
1538
|
+
tight: '-0.025em',
|
1539
|
+
normal: '0',
|
1540
|
+
wide: '0.025em',
|
1541
|
+
wider: '0.05em',
|
1542
|
+
widest: '0.1em'
|
1543
|
+
};
|
1488
1544
|
const fontSizes = {
|
1489
1545
|
heading: {
|
1490
|
-
1: '
|
1491
|
-
2: '
|
1492
|
-
3: '1.
|
1493
|
-
4: '1.
|
1494
|
-
5: '
|
1495
|
-
6: '
|
1546
|
+
1: '2.5rem',
|
1547
|
+
2: '2rem',
|
1548
|
+
3: '1.75rem',
|
1549
|
+
4: '1.5rem',
|
1550
|
+
5: '1.375rem',
|
1551
|
+
6: '1.125rem'
|
1496
1552
|
},
|
1497
1553
|
text: {
|
1498
1554
|
xl: '1.125rem',
|
@@ -1518,85 +1574,90 @@ const fontSizes = {
|
|
1518
1574
|
const heading = {
|
1519
1575
|
1: {
|
1520
1576
|
fontSize: fontSizes.heading[1],
|
1521
|
-
fontWeight:
|
1522
|
-
lineHeight:
|
1523
|
-
letterSpacing:
|
1577
|
+
fontWeight: fontWeights.semibold,
|
1578
|
+
lineHeight: lineHeights[64],
|
1579
|
+
letterSpacing: letterSpacings.normal
|
1524
1580
|
},
|
1525
1581
|
2: {
|
1526
1582
|
fontSize: fontSizes.heading[2],
|
1527
|
-
fontWeight:
|
1528
|
-
lineHeight:
|
1529
|
-
letterSpacing:
|
1583
|
+
fontWeight: fontWeights.semibold,
|
1584
|
+
lineHeight: lineHeights[56],
|
1585
|
+
letterSpacing: letterSpacings.normal
|
1530
1586
|
},
|
1531
1587
|
3: {
|
1532
1588
|
fontSize: fontSizes.heading[3],
|
1533
|
-
fontWeight:
|
1534
|
-
lineHeight:
|
1535
|
-
letterSpacing:
|
1589
|
+
fontWeight: fontWeights.semibold,
|
1590
|
+
lineHeight: lineHeights[48],
|
1591
|
+
letterSpacing: letterSpacings.normal
|
1536
1592
|
},
|
1537
1593
|
4: {
|
1538
1594
|
fontSize: fontSizes.heading[4],
|
1539
|
-
fontWeight:
|
1540
|
-
lineHeight:
|
1541
|
-
letterSpacing:
|
1595
|
+
fontWeight: fontWeights.semibold,
|
1596
|
+
lineHeight: lineHeights[40],
|
1597
|
+
letterSpacing: letterSpacings.normal
|
1542
1598
|
},
|
1543
1599
|
5: {
|
1544
1600
|
fontSize: fontSizes.heading[5],
|
1545
|
-
fontWeight:
|
1546
|
-
lineHeight:
|
1547
|
-
letterSpacing:
|
1601
|
+
fontWeight: fontWeights.semibold,
|
1602
|
+
lineHeight: lineHeights[36],
|
1603
|
+
letterSpacing: letterSpacings.normal
|
1548
1604
|
},
|
1549
1605
|
6: {
|
1550
1606
|
fontSize: fontSizes.heading[6],
|
1551
|
-
fontWeight:
|
1552
|
-
lineHeight:
|
1553
|
-
letterSpacing:
|
1607
|
+
fontWeight: fontWeights.semibold,
|
1608
|
+
lineHeight: lineHeights[32],
|
1609
|
+
letterSpacing: letterSpacings.normal
|
1554
1610
|
}
|
1555
1611
|
};
|
1556
1612
|
const text = {
|
1557
1613
|
xl: {
|
1558
1614
|
fontSize: fontSizes.text.xl,
|
1615
|
+
fontWeight: fontWeights.normal,
|
1559
1616
|
lineHeight: lineHeights[28],
|
1560
|
-
letterSpacing:
|
1617
|
+
letterSpacing: letterSpacings.normal
|
1561
1618
|
},
|
1562
1619
|
lg: {
|
1563
1620
|
fontSize: fontSizes.text.lg,
|
1621
|
+
fontWeight: fontWeights.normal,
|
1564
1622
|
lineHeight: lineHeights[24],
|
1565
|
-
letterSpacing:
|
1623
|
+
letterSpacing: letterSpacings.normal
|
1566
1624
|
},
|
1567
1625
|
md: {
|
1568
1626
|
fontSize: fontSizes.text.md,
|
1627
|
+
fontWeight: fontWeights.normal,
|
1569
1628
|
lineHeight: lineHeights[22],
|
1570
|
-
letterSpacing:
|
1629
|
+
letterSpacing: letterSpacings.normal
|
1571
1630
|
},
|
1572
1631
|
sm: {
|
1573
1632
|
fontSize: fontSizes.text.sm,
|
1633
|
+
fontWeight: fontWeights.normal,
|
1574
1634
|
lineHeight: lineHeights[18],
|
1575
|
-
letterSpacing:
|
1635
|
+
letterSpacing: letterSpacings.normal
|
1576
1636
|
},
|
1577
1637
|
xs: {
|
1578
1638
|
fontSize: fontSizes.text.xs,
|
1639
|
+
fontWeight: fontWeights.normal,
|
1579
1640
|
lineHeight: lineHeights[14],
|
1580
|
-
letterSpacing:
|
1641
|
+
letterSpacing: letterSpacings.normal
|
1581
1642
|
}
|
1582
1643
|
};
|
1583
1644
|
const button = {
|
1584
1645
|
lg: {
|
1585
1646
|
fontSize: fontSizes.button.lg,
|
1586
1647
|
lineHeight: lineHeights[28],
|
1587
|
-
letterSpacing:
|
1648
|
+
letterSpacing: letterSpacings.normal,
|
1588
1649
|
fontWeight: fontWeights.normal
|
1589
1650
|
},
|
1590
1651
|
md: {
|
1591
1652
|
fontSize: fontSizes.button.md,
|
1592
1653
|
lineHeight: lineHeights[22],
|
1593
|
-
letterSpacing:
|
1654
|
+
letterSpacing: letterSpacings.normal,
|
1594
1655
|
fontWeight: fontWeights.normal
|
1595
1656
|
},
|
1596
1657
|
sm: {
|
1597
1658
|
fontSize: fontSizes.button.sm,
|
1598
1659
|
lineHeight: lineHeights[14],
|
1599
|
-
letterSpacing:
|
1660
|
+
letterSpacing: letterSpacings.normal,
|
1600
1661
|
fontWeight: fontWeights.normal
|
1601
1662
|
}
|
1602
1663
|
};
|
@@ -1604,19 +1665,19 @@ const field = {
|
|
1604
1665
|
lg: {
|
1605
1666
|
fontSize: fontSizes.field.lg,
|
1606
1667
|
lineHeight: lineHeights[24],
|
1607
|
-
letterSpacing:
|
1668
|
+
letterSpacing: letterSpacings.normal,
|
1608
1669
|
fontWeight: fontWeights.normal
|
1609
1670
|
},
|
1610
1671
|
md: {
|
1611
1672
|
fontSize: fontSizes.field.md,
|
1612
1673
|
lineHeight: lineHeights[22],
|
1613
|
-
letterSpacing:
|
1674
|
+
letterSpacing: letterSpacings.normal,
|
1614
1675
|
fontWeight: fontWeights.normal
|
1615
1676
|
},
|
1616
1677
|
sm: {
|
1617
1678
|
fontSize: fontSizes.field.sm,
|
1618
1679
|
lineHeight: lineHeights[18],
|
1619
|
-
letterSpacing:
|
1680
|
+
letterSpacing: letterSpacings.normal,
|
1620
1681
|
fontWeight: fontWeights.normal
|
1621
1682
|
}
|
1622
1683
|
};
|
@@ -1633,10 +1694,12 @@ var foundations = {
|
|
1633
1694
|
__proto__: null,
|
1634
1695
|
colors: colors,
|
1635
1696
|
radii: radius,
|
1636
|
-
|
1697
|
+
shadows: shadows,
|
1637
1698
|
sizes: sizes,
|
1699
|
+
space: spacing,
|
1638
1700
|
fonts: fonts,
|
1639
1701
|
fontSizes: fontSizes,
|
1702
|
+
letterSpacings: letterSpacings,
|
1640
1703
|
lineHeights: lineHeights,
|
1641
1704
|
textStyles: textStyles
|
1642
1705
|
};
|
@@ -1690,35 +1753,63 @@ const Field = props => {
|
|
1690
1753
|
const {
|
1691
1754
|
label,
|
1692
1755
|
isError,
|
1693
|
-
|
1694
|
-
|
1756
|
+
errorMessage,
|
1757
|
+
leftHelperText,
|
1758
|
+
rightHelperText,
|
1695
1759
|
isRequired,
|
1696
|
-
children
|
1760
|
+
children,
|
1761
|
+
isSuccess,
|
1762
|
+
isDisabled
|
1697
1763
|
} = props;
|
1764
|
+
const getHelperColor = () => {
|
1765
|
+
if (isError) return 'danger.500';
|
1766
|
+
if (isSuccess) return 'success.500';
|
1767
|
+
if (isDisabled) return 'black.low';
|
1768
|
+
return 'black.medium';
|
1769
|
+
};
|
1770
|
+
const getJustifyContentHelper = () => {
|
1771
|
+
if (rightHelperText && (!leftHelperText || isError && !errorMessage)) return 'flex-end';
|
1772
|
+
return 'space-between';
|
1773
|
+
};
|
1774
|
+
const helperColor = getHelperColor();
|
1775
|
+
const justifyHelper = getJustifyContentHelper();
|
1698
1776
|
return /*#__PURE__*/React__default.createElement(FormControl, {
|
1699
1777
|
isInvalid: isError
|
1700
1778
|
}, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
|
1701
|
-
|
1779
|
+
mb: 1,
|
1780
|
+
fontSize: "text.sm",
|
1702
1781
|
requiredIndicator: undefined
|
1703
1782
|
}, isRequired && /*#__PURE__*/React__default.createElement(Box, {
|
1704
1783
|
as: "span",
|
1705
|
-
color: "
|
1784
|
+
color: "danger.500",
|
1706
1785
|
ml: 0,
|
1707
1786
|
mr: 1
|
1708
|
-
}, "*"), label) : label), children,
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1787
|
+
}, "*"), label) : label), children, (isError && errorMessage || leftHelperText || rightHelperText) && /*#__PURE__*/React__default.createElement(Box, {
|
1788
|
+
display: "flex",
|
1789
|
+
width: "full",
|
1790
|
+
justifyContent: justifyHelper
|
1791
|
+
}, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
1792
|
+
fontSize: "text.xs",
|
1793
|
+
color: helperColor,
|
1794
|
+
mt: 1
|
1795
|
+
}, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
|
1796
|
+
fontSize: "text.xs",
|
1797
|
+
color: "danger.500",
|
1798
|
+
mt: 1
|
1799
|
+
}, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
1800
|
+
fontSize: "text.xs",
|
1801
|
+
color: helperColor,
|
1802
|
+
mt: 1
|
1803
|
+
}, rightHelperText)));
|
1716
1804
|
};
|
1717
1805
|
Field.defaultProps = {
|
1718
1806
|
label: '',
|
1719
1807
|
isError: false,
|
1720
|
-
|
1721
|
-
|
1808
|
+
isSuccess: false,
|
1809
|
+
isDisabled: false,
|
1810
|
+
errorMessage: undefined,
|
1811
|
+
leftHelperText: undefined,
|
1812
|
+
rightHelperText: undefined,
|
1722
1813
|
isRequired: false
|
1723
1814
|
};
|
1724
1815
|
|
@@ -1734,15 +1825,21 @@ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
1734
1825
|
isRequired,
|
1735
1826
|
label,
|
1736
1827
|
isError,
|
1737
|
-
|
1738
|
-
|
1828
|
+
isSuccess,
|
1829
|
+
isDisabled,
|
1830
|
+
errorMessage,
|
1831
|
+
leftHelperText,
|
1832
|
+
rightHelperText,
|
1739
1833
|
...inputProps
|
1740
1834
|
} = props;
|
1741
1835
|
return /*#__PURE__*/React__default.createElement(Field, {
|
1742
1836
|
label: label,
|
1837
|
+
isSuccess: isSuccess,
|
1838
|
+
isDisabled: isDisabled,
|
1743
1839
|
isError: isError,
|
1744
|
-
|
1745
|
-
|
1840
|
+
errorMessage: errorMessage,
|
1841
|
+
leftHelperText: leftHelperText,
|
1842
|
+
rightHelperText: rightHelperText,
|
1746
1843
|
isRequired: isRequired
|
1747
1844
|
}, /*#__PURE__*/React__default.createElement(InputGroup, {
|
1748
1845
|
size: size
|
@@ -1759,21 +1856,36 @@ InputField.defaultProps = {
|
|
1759
1856
|
elementRight: undefined
|
1760
1857
|
};
|
1761
1858
|
|
1859
|
+
const Loader = /*#__PURE__*/forwardRef((props, ref) => {
|
1860
|
+
const styles = useStyleConfig('LoaderStyle', props);
|
1861
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
1862
|
+
ref: ref,
|
1863
|
+
__css: styles
|
1864
|
+
});
|
1865
|
+
});
|
1866
|
+
|
1762
1867
|
const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
1763
1868
|
const {
|
1764
1869
|
value,
|
1870
|
+
isLoading,
|
1765
1871
|
...inputProps
|
1766
1872
|
} = props;
|
1767
|
-
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(
|
1873
|
+
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(Box, {
|
1874
|
+
position: "relative"
|
1875
|
+
}, /*#__PURE__*/React__default.createElement(Textarea$1, Object.assign({
|
1768
1876
|
ref: ref,
|
1769
1877
|
value: value
|
1770
|
-
}, inputProps))
|
1878
|
+
}, inputProps)), isLoading && /*#__PURE__*/React__default.createElement(Box, {
|
1879
|
+
zIndex: 999,
|
1880
|
+
top: 2,
|
1881
|
+
right: 2,
|
1882
|
+
position: "absolute"
|
1883
|
+
}, /*#__PURE__*/React__default.createElement(Loader, {
|
1884
|
+
size: "sm"
|
1885
|
+
}))));
|
1771
1886
|
});
|
1772
1887
|
TextareaField.defaultProps = {
|
1773
|
-
|
1774
|
-
addOnRight: undefined,
|
1775
|
-
elementLeft: undefined,
|
1776
|
-
elementRight: undefined
|
1888
|
+
isLoading: undefined
|
1777
1889
|
};
|
1778
1890
|
|
1779
1891
|
const XMSLogo = () => /*#__PURE__*/React__default.createElement(Image, {
|
@@ -1928,6 +2040,7 @@ const Header = ({
|
|
1928
2040
|
data,
|
1929
2041
|
onLogout,
|
1930
2042
|
onOpenModalRelease,
|
2043
|
+
hideSwitchMode,
|
1931
2044
|
...props
|
1932
2045
|
}) => /*#__PURE__*/createElement(Box, Object.assign({
|
1933
2046
|
minH: 14,
|
@@ -1948,14 +2061,15 @@ const Header = ({
|
|
1948
2061
|
onOpenModalRelease: onOpenModalRelease
|
1949
2062
|
})), /*#__PURE__*/createElement(Flex, {
|
1950
2063
|
alignItems: "center"
|
1951
|
-
}, /*#__PURE__*/createElement(SwitchMode, null), /*#__PURE__*/createElement(Profile, {
|
2064
|
+
}, !hideSwitchMode && /*#__PURE__*/createElement(SwitchMode, null), /*#__PURE__*/createElement(Profile, {
|
1952
2065
|
data: data,
|
1953
2066
|
onLogout: onLogout
|
1954
2067
|
}))));
|
1955
2068
|
Header.defaultProps = {
|
1956
2069
|
data: undefined,
|
1957
2070
|
onLogout: undefined,
|
1958
|
-
onOpenModalRelease: undefined
|
2071
|
+
onOpenModalRelease: undefined,
|
2072
|
+
hideSwitchMode: false
|
1959
2073
|
};
|
1960
2074
|
|
1961
2075
|
const ModalBody = /*#__PURE__*/React__default.forwardRef(({
|
@@ -1968,7 +2082,7 @@ const ModalBody = /*#__PURE__*/React__default.forwardRef(({
|
|
1968
2082
|
}, rest), children);
|
1969
2083
|
});
|
1970
2084
|
|
1971
|
-
const ModalCloseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
2085
|
+
const ModalCloseButton = /*#__PURE__*/forwardRef$1((props, ref) => {
|
1972
2086
|
return /*#__PURE__*/React__default.createElement(ModalCloseButton$1, Object.assign({
|
1973
2087
|
ref: ref,
|
1974
2088
|
top: 4,
|
@@ -1978,7 +2092,7 @@ const ModalCloseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1978
2092
|
}, props));
|
1979
2093
|
});
|
1980
2094
|
|
1981
|
-
const ModalFooter = /*#__PURE__*/forwardRef(({
|
2095
|
+
const ModalFooter = /*#__PURE__*/forwardRef$1(({
|
1982
2096
|
children,
|
1983
2097
|
...rest
|
1984
2098
|
}, ref) => {
|
@@ -1989,7 +2103,7 @@ const ModalFooter = /*#__PURE__*/forwardRef(({
|
|
1989
2103
|
}, rest), children);
|
1990
2104
|
});
|
1991
2105
|
|
1992
|
-
const ModalHeader = /*#__PURE__*/forwardRef(({
|
2106
|
+
const ModalHeader = /*#__PURE__*/forwardRef$1(({
|
1993
2107
|
children,
|
1994
2108
|
...rest
|
1995
2109
|
}, ref) => {
|
@@ -2001,6 +2115,28 @@ const ModalHeader = /*#__PURE__*/forwardRef(({
|
|
2001
2115
|
}, rest), children);
|
2002
2116
|
});
|
2003
2117
|
|
2118
|
+
const CustomerIcon = /*#__PURE__*/createIcon({
|
2119
|
+
displayName: 'CustomerIcon',
|
2120
|
+
viewBox: '0 0 16 16',
|
2121
|
+
path: [/*#__PURE__*/React__default.createElement("path", {
|
2122
|
+
fill: "currentColor",
|
2123
|
+
fillRule: "inherit",
|
2124
|
+
d: "M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM.667 8a7.333 7.333 0 1 1 14.666 0A7.333 7.333 0 0 1 .667 8Z",
|
2125
|
+
clipRule: "inherit"
|
2126
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
2127
|
+
fill: "currentColor",
|
2128
|
+
d: "M12.416 12.698a1.997 1.997 0 0 0-1.75-1.031H5.334a2 2 0 0 0-1.864 1.277 7.722 7.722 0 0 1-.943-1.074 3.329 3.329 0 0 1 2.807-1.537h5.334a3.333 3.333 0 0 1 2.703 1.384c-.275.325-.594.66-.954.98Z"
|
2129
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
2130
|
+
fill: "currentColor",
|
2131
|
+
fillRule: "inherit",
|
2132
|
+
d: "M8 5.333A1.333 1.333 0 1 0 8 8a1.333 1.333 0 0 0 0-2.667ZM5.333 6.667a2.667 2.667 0 1 1 5.334 0 2.667 2.667 0 0 1-5.334 0Z",
|
2133
|
+
clipRule: "inherit"
|
2134
|
+
})]
|
2135
|
+
});
|
2136
|
+
|
2137
|
+
/* eslint-disable import/prefer-default-export */
|
2138
|
+
const mappingIcon = /*#__PURE__*/new Map([['Order', FiShoppingBag], ['Fulfillment', FiShoppingCart], ['Transfer Stock', FiRepeat], ['Stock', FiBox], ['Product Database', FiLayers], ['Purchasing', FiDollarSign], ['Reseller', FiUsers], ['Retur', FiRotateCcw], ['Other', FiSettings], ['Content', FiLayout], ['Voucher', FiGift], ['Customer', CustomerIcon]]);
|
2139
|
+
|
2004
2140
|
/* eslint-disable react-hooks/rules-of-hooks */
|
2005
2141
|
const Navigation = ({
|
2006
2142
|
navigations,
|
@@ -2040,7 +2176,7 @@ const Navigation = ({
|
|
2040
2176
|
color: isActive ? 'white' : 'inherit',
|
2041
2177
|
p: 2
|
2042
2178
|
}, /*#__PURE__*/createElement(Icon, {
|
2043
|
-
as: navigation.
|
2179
|
+
as: mappingIcon.get(navigation.title),
|
2044
2180
|
mr: 2
|
2045
2181
|
}), /*#__PURE__*/createElement(Text, {
|
2046
2182
|
whiteSpace: "nowrap",
|
@@ -2060,8 +2196,7 @@ const Navigation = ({
|
|
2060
2196
|
}, navigation.children.map(({
|
2061
2197
|
title,
|
2062
2198
|
navHost,
|
2063
|
-
navLink
|
2064
|
-
icon
|
2199
|
+
navLink
|
2065
2200
|
}) => {
|
2066
2201
|
const link = navHost ? `${navHost}${navLink}` : navLink;
|
2067
2202
|
const isLocalLink = host === navHost;
|
@@ -2070,7 +2205,6 @@ const Navigation = ({
|
|
2070
2205
|
as: isLocalLink ? as : undefined,
|
2071
2206
|
key: title,
|
2072
2207
|
href: link,
|
2073
|
-
cursor: "pointer",
|
2074
2208
|
_hover: {
|
2075
2209
|
textDecoration: 'none'
|
2076
2210
|
}
|
@@ -2078,6 +2212,7 @@ const Navigation = ({
|
|
2078
2212
|
display: "flex",
|
2079
2213
|
position: "relative",
|
2080
2214
|
alignItems: "center",
|
2215
|
+
cursor: "pointer",
|
2081
2216
|
transition: "padding 0.35s ease 0s",
|
2082
2217
|
_hover: {
|
2083
2218
|
backgroundColor: useColorModeValue('dove-gray.50', 'mirage.900'),
|
@@ -2098,7 +2233,7 @@ const Navigation = ({
|
|
2098
2233
|
px: 6,
|
2099
2234
|
py: 4
|
2100
2235
|
}, /*#__PURE__*/createElement(Icon, {
|
2101
|
-
as:
|
2236
|
+
as: mappingIcon.get(navigation.title),
|
2102
2237
|
mr: 3
|
2103
2238
|
}), /*#__PURE__*/createElement(Text, {
|
2104
2239
|
fontSize: "text.sm"
|
@@ -2119,7 +2254,7 @@ Navigation.defaultProps = {
|
|
2119
2254
|
host: undefined
|
2120
2255
|
};
|
2121
2256
|
|
2122
|
-
const PaginationButton = /*#__PURE__*/forwardRef
|
2257
|
+
const PaginationButton = /*#__PURE__*/forwardRef(({
|
2123
2258
|
className,
|
2124
2259
|
style,
|
2125
2260
|
isActive,
|
@@ -2339,23 +2474,45 @@ PaginationFilter.defaultProps = {
|
|
2339
2474
|
label: undefined
|
2340
2475
|
};
|
2341
2476
|
|
2477
|
+
const SelectWrapper = ({
|
2478
|
+
children,
|
2479
|
+
isError = false
|
2480
|
+
}) => {
|
2481
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
2482
|
+
css: css`
|
2483
|
+
.react-select__control {
|
2484
|
+
border-color: ${isError ? colors.danger['500'] : colors.neutral['500']} !important;
|
2485
|
+
}
|
2486
|
+
|
2487
|
+
.react-select__control:hover {
|
2488
|
+
border-color: ${isError ? colors.danger['500'] : colors.primary['500']} !important;
|
2489
|
+
}
|
2490
|
+
`
|
2491
|
+
}, children);
|
2492
|
+
};
|
2493
|
+
SelectWrapper.defaultProps = {
|
2494
|
+
isError: false
|
2495
|
+
};
|
2496
|
+
|
2342
2497
|
const styleMd = textStyles.text.sm;
|
2343
2498
|
const selectStyle = {
|
2344
2499
|
fontSize: styleMd.fontSize,
|
2345
2500
|
lineHeight: styleMd.lineHeight,
|
2346
2501
|
letterSpacing: 0
|
2347
2502
|
};
|
2348
|
-
function selectStyles(colorMode) {
|
2503
|
+
function selectStyles(colorMode, _isError) {
|
2349
2504
|
return {
|
2350
|
-
control: base => colorMode === 'dark' ? {
|
2505
|
+
control: (base, state) => colorMode === 'dark' ? {
|
2351
2506
|
...base,
|
2352
2507
|
...selectStyle,
|
2353
2508
|
background: 'transparent',
|
2354
2509
|
color: colors.primary['300'],
|
2355
|
-
borderColor: colors.secondary['500']
|
2510
|
+
borderColor: colors.secondary['500'],
|
2511
|
+
boxShadow: state.isFocused ? 'none' : `inherit`
|
2356
2512
|
} : {
|
2357
2513
|
...base,
|
2358
|
-
...selectStyle
|
2514
|
+
...selectStyle,
|
2515
|
+
boxShadow: state.isFocused ? 'none' : colors.neutral['500']
|
2359
2516
|
},
|
2360
2517
|
option: (base, {
|
2361
2518
|
isSelected
|
@@ -2425,71 +2582,91 @@ const themeSelect = theme => {
|
|
2425
2582
|
};
|
2426
2583
|
};
|
2427
2584
|
|
2585
|
+
/* eslint-disable react/require-default-props */
|
2428
2586
|
function Select({
|
2429
2587
|
styles,
|
2588
|
+
isError = false,
|
2430
2589
|
...rest
|
2431
2590
|
}) {
|
2432
2591
|
const {
|
2433
2592
|
colorMode
|
2434
2593
|
} = useColorMode();
|
2435
|
-
return /*#__PURE__*/React__default.createElement(
|
2594
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2595
|
+
isError: isError
|
2596
|
+
}, /*#__PURE__*/React__default.createElement(ReactSelect, Object.assign({
|
2597
|
+
classNamePrefix: "react-select"
|
2598
|
+
}, rest, {
|
2436
2599
|
styles: {
|
2437
|
-
...selectStyles(colorMode)
|
2438
|
-
...styles
|
2600
|
+
...selectStyles(colorMode)
|
2439
2601
|
},
|
2440
2602
|
theme: themeSelect
|
2441
|
-
}));
|
2603
|
+
})));
|
2442
2604
|
}
|
2443
2605
|
|
2444
2606
|
function SelectAsync({
|
2445
2607
|
styles,
|
2608
|
+
isError = false,
|
2446
2609
|
...rest
|
2447
2610
|
}) {
|
2448
2611
|
const {
|
2449
2612
|
colorMode
|
2450
2613
|
} = useColorMode();
|
2451
|
-
return /*#__PURE__*/React__default.createElement(
|
2614
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2615
|
+
isError: isError
|
2616
|
+
}, /*#__PURE__*/React__default.createElement(AsyncPaginate, Object.assign({
|
2617
|
+
classNamePrefix: "react-select"
|
2618
|
+
}, rest, {
|
2452
2619
|
styles: {
|
2453
2620
|
...selectStyles(colorMode),
|
2454
2621
|
...styles
|
2455
2622
|
},
|
2456
2623
|
theme: themeSelect
|
2457
|
-
}));
|
2624
|
+
})));
|
2458
2625
|
}
|
2459
2626
|
|
2460
2627
|
function SelectAsyncCreatable({
|
2461
2628
|
styles,
|
2629
|
+
isError = false,
|
2462
2630
|
...rest
|
2463
2631
|
}) {
|
2464
2632
|
const {
|
2465
2633
|
colorMode
|
2466
2634
|
} = useColorMode();
|
2467
|
-
return /*#__PURE__*/React__default.createElement(
|
2635
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2636
|
+
isError: isError
|
2637
|
+
}, /*#__PURE__*/React__default.createElement(ReactSelectAsyncCreatable, Object.assign({
|
2638
|
+
classNamePrefix: "react-select"
|
2639
|
+
}, rest, {
|
2468
2640
|
styles: {
|
2469
2641
|
...selectStyles(colorMode),
|
2470
2642
|
...styles
|
2471
2643
|
},
|
2472
2644
|
theme: themeSelect
|
2473
|
-
}));
|
2645
|
+
})));
|
2474
2646
|
}
|
2475
2647
|
|
2476
2648
|
function SelectCreatable({
|
2477
2649
|
styles,
|
2650
|
+
isError = false,
|
2478
2651
|
...rest
|
2479
2652
|
}) {
|
2480
2653
|
const {
|
2481
2654
|
colorMode
|
2482
2655
|
} = useColorMode();
|
2483
|
-
return /*#__PURE__*/React__default.createElement(
|
2656
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2657
|
+
isError: isError
|
2658
|
+
}, /*#__PURE__*/React__default.createElement(ReactSelectCreatable, Object.assign({
|
2659
|
+
classNamePrefix: "react-select"
|
2660
|
+
}, rest, {
|
2484
2661
|
styles: {
|
2485
2662
|
...selectStyles(colorMode),
|
2486
2663
|
...styles
|
2487
2664
|
},
|
2488
2665
|
theme: themeSelect
|
2489
|
-
}));
|
2666
|
+
})));
|
2490
2667
|
}
|
2491
2668
|
|
2492
|
-
const Tab = /*#__PURE__*/forwardRef
|
2669
|
+
const Tab = /*#__PURE__*/forwardRef((props, ref) => {
|
2493
2670
|
var _props$leftAddon, _props$rightAddon;
|
2494
2671
|
const tabProps = useTab({
|
2495
2672
|
...props,
|
@@ -2517,13 +2694,13 @@ const Tab = /*#__PURE__*/forwardRef$1((props, ref) => {
|
|
2517
2694
|
})));
|
2518
2695
|
});
|
2519
2696
|
|
2520
|
-
const TabList = /*#__PURE__*/forwardRef
|
2697
|
+
const TabList = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React__default.createElement(TabList$1, {
|
2521
2698
|
borderBottom: "1px solid",
|
2522
2699
|
borderColor: useColorModeValue('gray.200', 'bright-gray.800'),
|
2523
2700
|
ref: ref
|
2524
2701
|
}, props.children));
|
2525
2702
|
|
2526
|
-
const TabPanel = /*#__PURE__*/forwardRef
|
2703
|
+
const TabPanel = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React__default.createElement(TabPanel$1, {
|
2527
2704
|
px: 0,
|
2528
2705
|
ref: ref
|
2529
2706
|
}, props.children));
|
@@ -2723,80 +2900,106 @@ const Button = {
|
|
2723
2900
|
};
|
2724
2901
|
|
2725
2902
|
const {
|
2726
|
-
definePartsStyle
|
2903
|
+
definePartsStyle,
|
2904
|
+
defineMultiStyleConfig
|
2727
2905
|
} = /*#__PURE__*/createMultiStyleConfigHelpers(checkboxAnatomy.keys);
|
2728
|
-
const
|
2729
|
-
|
2730
|
-
|
2731
|
-
|
2732
|
-
|
2733
|
-
|
2734
|
-
borderRadius: 'sm'
|
2906
|
+
const baseStyle = /*#__PURE__*/definePartsStyle({
|
2907
|
+
control: {
|
2908
|
+
borderRadius: '4px',
|
2909
|
+
width: '16px',
|
2910
|
+
height: '16px',
|
2911
|
+
border: '1px solid'
|
2735
2912
|
},
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
|
2741
|
-
|
2742
|
-
|
2743
|
-
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2913
|
+
icon: {
|
2914
|
+
color: 'neutral.50',
|
2915
|
+
width: '9px'
|
2916
|
+
},
|
2917
|
+
label: {
|
2918
|
+
fontWeight: '400',
|
2919
|
+
lineHeight: '18px',
|
2920
|
+
color: 'black.high',
|
2921
|
+
ml: '8px'
|
2922
|
+
},
|
2923
|
+
_disabled: {
|
2924
|
+
background: 'neutral.500',
|
2925
|
+
border: '1px solid',
|
2926
|
+
borderColor: 'neutral.500',
|
2927
|
+
cursor: 'not-allowed'
|
2928
|
+
}
|
2929
|
+
});
|
2930
|
+
const errors = /*#__PURE__*/definePartsStyle({
|
2931
|
+
control: {
|
2932
|
+
borderColor: 'danger.500',
|
2933
|
+
_checked: {
|
2934
|
+
borderColor: 'danger.500',
|
2935
|
+
backgroundColor: 'danger.500',
|
2936
|
+
_hover: {
|
2937
|
+
borderColor: 'danger.600',
|
2938
|
+
backgroundColor: 'danger.600'
|
2760
2939
|
}
|
2761
|
-
}
|
2762
|
-
|
2763
|
-
|
2764
|
-
|
2765
|
-
|
2766
|
-
|
2767
|
-
|
2768
|
-
|
2940
|
+
},
|
2941
|
+
_indeterminate: {
|
2942
|
+
borderColor: 'danger.500',
|
2943
|
+
backgroundColor: 'danger.500'
|
2944
|
+
}
|
2945
|
+
},
|
2946
|
+
label: {
|
2947
|
+
fontSize: '12px'
|
2948
|
+
}
|
2949
|
+
});
|
2950
|
+
const unstyled = /*#__PURE__*/definePartsStyle({
|
2951
|
+
control: {
|
2952
|
+
borderColor: 'neutral.500',
|
2953
|
+
_checked: {
|
2954
|
+
borderColor: 'primary.500',
|
2955
|
+
backgroundColor: 'primary.500',
|
2956
|
+
_hover: {
|
2957
|
+
borderColor: 'primary.600',
|
2958
|
+
backgroundColor: 'primary.600'
|
2769
2959
|
},
|
2770
|
-
|
2771
|
-
|
2960
|
+
_disabled: {
|
2961
|
+
backgroundColor: 'neutral.500',
|
2962
|
+
borderColor: 'neutral.500'
|
2772
2963
|
}
|
2773
|
-
}
|
2964
|
+
},
|
2965
|
+
_disabled: {
|
2966
|
+
backgroundColor: 'neutral.500'
|
2967
|
+
},
|
2968
|
+
_indeterminate: {
|
2969
|
+
borderColor: 'primary.500',
|
2970
|
+
backgroundColor: 'primary.500'
|
2971
|
+
}
|
2774
2972
|
},
|
2775
|
-
|
2776
|
-
|
2777
|
-
// The default size and variant values
|
2778
|
-
defaultProps: {
|
2779
|
-
size: 'sm',
|
2780
|
-
variant: 'solid',
|
2781
|
-
orientation: 'vertical',
|
2782
|
-
colorScheme: 'primary'
|
2973
|
+
label: {
|
2974
|
+
fontSize: '12px'
|
2783
2975
|
}
|
2976
|
+
});
|
2977
|
+
const variants = {
|
2978
|
+
errors,
|
2979
|
+
unstyled
|
2784
2980
|
};
|
2981
|
+
const Checkbox = /*#__PURE__*/defineMultiStyleConfig({
|
2982
|
+
baseStyle,
|
2983
|
+
variants,
|
2984
|
+
defaultProps: {
|
2985
|
+
variant: 'errors'
|
2986
|
+
}
|
2987
|
+
});
|
2785
2988
|
|
2786
|
-
const baseStyle = /*#__PURE__*/defineStyle({
|
2989
|
+
const baseStyle$1 = /*#__PURE__*/defineStyle({
|
2787
2990
|
fontSize: 'field.sm',
|
2788
2991
|
marginEnd: 1,
|
2789
2992
|
mb: 1
|
2790
2993
|
});
|
2791
2994
|
const FormLabel = /*#__PURE__*/defineStyleConfig({
|
2792
|
-
baseStyle
|
2995
|
+
baseStyle: baseStyle$1
|
2793
2996
|
});
|
2794
2997
|
|
2795
2998
|
const {
|
2796
2999
|
definePartsStyle: definePartsStyle$1,
|
2797
|
-
defineMultiStyleConfig
|
2798
|
-
} = /*#__PURE__*/createMultiStyleConfigHelpers(inputAnatomy.keys);
|
2799
|
-
const baseStyle$
|
3000
|
+
defineMultiStyleConfig: defineMultiStyleConfig$1
|
3001
|
+
} = /*#__PURE__*/createMultiStyleConfigHelpers$1(inputAnatomy.keys);
|
3002
|
+
const baseStyle$2 = /*#__PURE__*/definePartsStyle$1({
|
2800
3003
|
field: {
|
2801
3004
|
width: '100%',
|
2802
3005
|
minWidth: 0,
|
@@ -2902,7 +3105,7 @@ const outline = /*#__PURE__*/definePartsStyle$1(props => {
|
|
2902
3105
|
}
|
2903
3106
|
};
|
2904
3107
|
});
|
2905
|
-
const unstyled = /*#__PURE__*/definePartsStyle$1({
|
3108
|
+
const unstyled$1 = /*#__PURE__*/definePartsStyle$1({
|
2906
3109
|
field: {
|
2907
3110
|
bg: 'transparent',
|
2908
3111
|
px: '0',
|
@@ -2914,28 +3117,130 @@ const unstyled = /*#__PURE__*/definePartsStyle$1({
|
|
2914
3117
|
height: 'auto'
|
2915
3118
|
}
|
2916
3119
|
});
|
2917
|
-
const variants = {
|
3120
|
+
const variants$1 = {
|
2918
3121
|
outline,
|
2919
|
-
unstyled
|
3122
|
+
unstyled: unstyled$1
|
2920
3123
|
};
|
2921
|
-
const Input = /*#__PURE__*/defineMultiStyleConfig({
|
2922
|
-
baseStyle: baseStyle$
|
3124
|
+
const Input = /*#__PURE__*/defineMultiStyleConfig$1({
|
3125
|
+
baseStyle: baseStyle$2,
|
2923
3126
|
sizes: sizes$1,
|
2924
|
-
variants,
|
3127
|
+
variants: variants$1,
|
2925
3128
|
defaultProps: {
|
2926
3129
|
size: 'sm',
|
2927
3130
|
variant: 'outline'
|
2928
3131
|
}
|
2929
3132
|
});
|
2930
3133
|
|
3134
|
+
const rotate = /*#__PURE__*/keyframes({
|
3135
|
+
'0%': {
|
3136
|
+
transform: 'rotate(0deg)'
|
3137
|
+
},
|
3138
|
+
'100%': {
|
3139
|
+
transform: 'rotate(360deg)'
|
3140
|
+
}
|
3141
|
+
});
|
3142
|
+
const LoaderStyle = /*#__PURE__*/defineStyleConfig({
|
3143
|
+
baseStyle: props => {
|
3144
|
+
const colors$1 = props.color === 'white' ? 'white' : colors.primary[600];
|
3145
|
+
return {
|
3146
|
+
borderRadius: '50%',
|
3147
|
+
display: 'flex',
|
3148
|
+
justifyContent: 'center',
|
3149
|
+
alignItems: 'center',
|
3150
|
+
animation: `${rotate} 1s linear infinite`,
|
3151
|
+
background: `conic-gradient(from 180deg at 50% 50%, ${colors$1} 0deg, rgba(217, 217, 217, 0) 360deg);`,
|
3152
|
+
':before': {
|
3153
|
+
content: `''`,
|
3154
|
+
display: 'block',
|
3155
|
+
borderRadius: '50%',
|
3156
|
+
width: '6px',
|
3157
|
+
height: '6px',
|
3158
|
+
position: 'absolute',
|
3159
|
+
bottom: 0,
|
3160
|
+
background: colors$1
|
3161
|
+
}
|
3162
|
+
};
|
3163
|
+
},
|
3164
|
+
sizes: {
|
3165
|
+
xs: {
|
3166
|
+
width: '12px',
|
3167
|
+
height: '12px',
|
3168
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 1.4px),#000 0);',
|
3169
|
+
':before': {
|
3170
|
+
width: '1.4px',
|
3171
|
+
height: '1.4px'
|
3172
|
+
}
|
3173
|
+
},
|
3174
|
+
sm: {
|
3175
|
+
width: '16px',
|
3176
|
+
height: '16px',
|
3177
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 1.87px),#000 0);',
|
3178
|
+
':before': {
|
3179
|
+
width: '1.87px',
|
3180
|
+
height: '1.87px'
|
3181
|
+
}
|
3182
|
+
},
|
3183
|
+
md: {
|
3184
|
+
width: '24px',
|
3185
|
+
height: '24px',
|
3186
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 2.8px),#000 0);',
|
3187
|
+
':before': {
|
3188
|
+
width: '2.8px',
|
3189
|
+
height: '2.8px'
|
3190
|
+
}
|
3191
|
+
},
|
3192
|
+
lg: {
|
3193
|
+
width: '50px',
|
3194
|
+
height: '50px',
|
3195
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 5.83px),#000 0);',
|
3196
|
+
':before': {
|
3197
|
+
width: '5.83px',
|
3198
|
+
height: '5.83px'
|
3199
|
+
}
|
3200
|
+
},
|
3201
|
+
xl: {
|
3202
|
+
width: '75px',
|
3203
|
+
height: '75px',
|
3204
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 8.75px),#000 0);',
|
3205
|
+
':before': {
|
3206
|
+
width: '8.75px',
|
3207
|
+
height: '8.75px'
|
3208
|
+
}
|
3209
|
+
},
|
3210
|
+
xxl: {
|
3211
|
+
width: '100px',
|
3212
|
+
height: '100px',
|
3213
|
+
WebkitMask: `radial-gradient(farthest-side,#0000 calc(100% - 11.67px),#000 0);`,
|
3214
|
+
':before': {
|
3215
|
+
width: '11.67px',
|
3216
|
+
height: '11.67px'
|
3217
|
+
}
|
3218
|
+
}
|
3219
|
+
},
|
3220
|
+
defaultProps: {
|
3221
|
+
size: 'lg'
|
3222
|
+
}
|
3223
|
+
});
|
3224
|
+
|
2931
3225
|
const {
|
2932
3226
|
definePartsStyle: definePartsStyle$2
|
2933
|
-
} = /*#__PURE__*/createMultiStyleConfigHelpers(
|
3227
|
+
} = /*#__PURE__*/createMultiStyleConfigHelpers$1(popoverAnatomy.keys);
|
3228
|
+
const Popover = {
|
3229
|
+
baseStyle: props => definePartsStyle$2({
|
3230
|
+
popper: {
|
3231
|
+
background: mode('white', 'inherit')(props)
|
3232
|
+
}
|
3233
|
+
})
|
3234
|
+
};
|
3235
|
+
|
3236
|
+
const {
|
3237
|
+
definePartsStyle: definePartsStyle$3
|
3238
|
+
} = /*#__PURE__*/createMultiStyleConfigHelpers$1(radioAnatomy.keys);
|
2934
3239
|
// You can also use the more specific type for
|
2935
3240
|
// a single part component: ComponentSingleStyleConfig
|
2936
3241
|
const Radio = {
|
2937
3242
|
// The styles all checkbox have in common
|
2938
|
-
baseStyle: /*#__PURE__*/definePartsStyle$
|
3243
|
+
baseStyle: /*#__PURE__*/definePartsStyle$3({
|
2939
3244
|
control: {
|
2940
3245
|
_checked: {
|
2941
3246
|
borderColor: 'primary.500',
|
@@ -2954,7 +3259,7 @@ const Radio = {
|
|
2954
3259
|
}),
|
2955
3260
|
// Two sizes: sm and md
|
2956
3261
|
sizes: {
|
2957
|
-
sm: /*#__PURE__*/definePartsStyle$
|
3262
|
+
sm: /*#__PURE__*/definePartsStyle$3({
|
2958
3263
|
control: {
|
2959
3264
|
w: '3',
|
2960
3265
|
h: '3'
|
@@ -2963,7 +3268,7 @@ const Radio = {
|
|
2963
3268
|
fontSize: 'text.sm'
|
2964
3269
|
}
|
2965
3270
|
}),
|
2966
|
-
md: /*#__PURE__*/definePartsStyle$
|
3271
|
+
md: /*#__PURE__*/definePartsStyle$3({
|
2967
3272
|
control: {
|
2968
3273
|
w: '4',
|
2969
3274
|
h: '4'
|
@@ -2972,7 +3277,7 @@ const Radio = {
|
|
2972
3277
|
fontSize: 'text.md'
|
2973
3278
|
}
|
2974
3279
|
}),
|
2975
|
-
lg: /*#__PURE__*/definePartsStyle$
|
3280
|
+
lg: /*#__PURE__*/definePartsStyle$3({
|
2976
3281
|
control: {
|
2977
3282
|
w: '5',
|
2978
3283
|
h: '5'
|
@@ -2994,10 +3299,10 @@ const Radio = {
|
|
2994
3299
|
};
|
2995
3300
|
|
2996
3301
|
const {
|
2997
|
-
definePartsStyle: definePartsStyle$
|
2998
|
-
defineMultiStyleConfig: defineMultiStyleConfig$
|
2999
|
-
} = /*#__PURE__*/createMultiStyleConfigHelpers
|
3000
|
-
const baseStyle$
|
3302
|
+
definePartsStyle: definePartsStyle$4,
|
3303
|
+
defineMultiStyleConfig: defineMultiStyleConfig$2
|
3304
|
+
} = /*#__PURE__*/createMultiStyleConfigHelpers(switchAnatomy.keys);
|
3305
|
+
const baseStyle$3 = /*#__PURE__*/definePartsStyle$4({
|
3001
3306
|
// define the part you're going to style
|
3002
3307
|
container: {
|
3003
3308
|
// ...
|
@@ -3013,45 +3318,88 @@ const baseStyle$2 = /*#__PURE__*/definePartsStyle$3({
|
|
3013
3318
|
}
|
3014
3319
|
}
|
3015
3320
|
});
|
3016
|
-
const Switch = /*#__PURE__*/defineMultiStyleConfig$
|
3017
|
-
baseStyle: baseStyle$
|
3321
|
+
const Switch = /*#__PURE__*/defineMultiStyleConfig$2({
|
3322
|
+
baseStyle: baseStyle$3
|
3018
3323
|
});
|
3019
3324
|
|
3020
|
-
const {
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3325
|
+
const getProps = props => {
|
3326
|
+
const {
|
3327
|
+
isError,
|
3328
|
+
isSuccess,
|
3329
|
+
isDisabled
|
3330
|
+
} = props;
|
3331
|
+
let borderColor = 'neutral.400';
|
3332
|
+
let focusBorderColor = 'primary.500';
|
3333
|
+
if (isError) {
|
3334
|
+
borderColor = 'danger.500';
|
3335
|
+
focusBorderColor = 'danger.500';
|
3336
|
+
} else if (isSuccess) {
|
3337
|
+
borderColor = 'success.500';
|
3338
|
+
focusBorderColor = 'success.500';
|
3339
|
+
} else if (isDisabled && !isError && !isSuccess) {
|
3340
|
+
borderColor = 'neutral.400';
|
3341
|
+
focusBorderColor = 'danger.500';
|
3342
|
+
}
|
3343
|
+
return {
|
3344
|
+
focusBorderColor,
|
3345
|
+
borderColor
|
3346
|
+
};
|
3029
3347
|
};
|
3030
|
-
|
3031
|
-
const
|
3032
|
-
|
3348
|
+
const outline$1 = /*#__PURE__*/defineStyle$1(props => {
|
3349
|
+
const {
|
3350
|
+
focusBorderColor,
|
3351
|
+
borderColor
|
3352
|
+
} = getProps(props);
|
3353
|
+
return {
|
3354
|
+
background: 'white.high',
|
3355
|
+
color: 'black.high',
|
3356
|
+
borderColor,
|
3357
|
+
fontSize: 'text.sm',
|
3358
|
+
padding: 2,
|
3359
|
+
borderRadius: 'md',
|
3360
|
+
borderWidth: '1px',
|
3361
|
+
outline: 'none',
|
3362
|
+
_disabled: {
|
3363
|
+
opacity: 1,
|
3364
|
+
color: 'black.low',
|
3365
|
+
background: 'neutral.300'
|
3366
|
+
},
|
3367
|
+
_placeholder: {
|
3368
|
+
color: 'black.low'
|
3369
|
+
},
|
3033
3370
|
_hover: {
|
3034
|
-
borderColor
|
3035
|
-
boxShadow: 'none',
|
3036
|
-
outline: 'none'
|
3371
|
+
borderColor
|
3037
3372
|
},
|
3038
3373
|
_focus: {
|
3039
|
-
|
3040
|
-
|
3041
|
-
|
3374
|
+
outline: 'none',
|
3375
|
+
borderColor: focusBorderColor,
|
3376
|
+
boxShadow: 'none'
|
3042
3377
|
},
|
3043
3378
|
_focusVisible: {
|
3044
|
-
|
3045
|
-
|
3046
|
-
|
3379
|
+
outline: 'none',
|
3380
|
+
borderColor: focusBorderColor,
|
3381
|
+
boxShadow: 'none'
|
3047
3382
|
},
|
3048
3383
|
_focusWithin: {
|
3049
|
-
|
3050
|
-
|
3051
|
-
|
3384
|
+
outline: 'none',
|
3385
|
+
borderColor: focusBorderColor,
|
3386
|
+
boxShadow: 'none'
|
3387
|
+
},
|
3388
|
+
_invalid: {
|
3389
|
+
outline: 'none',
|
3390
|
+
borderColor: 'danger.500',
|
3391
|
+
boxShadow: 'none'
|
3052
3392
|
}
|
3393
|
+
};
|
3394
|
+
});
|
3395
|
+
const Textarea = /*#__PURE__*/defineStyleConfig$1({
|
3396
|
+
variants: {
|
3397
|
+
outline: outline$1
|
3398
|
+
},
|
3399
|
+
defaultProps: {
|
3400
|
+
variant: 'outline'
|
3053
3401
|
}
|
3054
|
-
};
|
3402
|
+
});
|
3055
3403
|
|
3056
3404
|
|
3057
3405
|
|
@@ -3061,9 +3409,10 @@ var components = {
|
|
3061
3409
|
Checkbox: Checkbox,
|
3062
3410
|
FormLabel: FormLabel,
|
3063
3411
|
Input: Input,
|
3412
|
+
LoaderStyle: LoaderStyle,
|
3413
|
+
Popover: Popover,
|
3064
3414
|
Radio: Radio,
|
3065
3415
|
Switch: Switch,
|
3066
|
-
Popover: Popover,
|
3067
3416
|
Textarea: Textarea
|
3068
3417
|
};
|
3069
3418
|
|
@@ -3082,7 +3431,8 @@ const theme = /*#__PURE__*/extendTheme({
|
|
3082
3431
|
background: 'neutral.400'
|
3083
3432
|
},
|
3084
3433
|
body: {
|
3085
|
-
fontSize: 'text.sm'
|
3434
|
+
fontSize: 'text.sm',
|
3435
|
+
color: 'black.high'
|
3086
3436
|
}
|
3087
3437
|
}
|
3088
3438
|
},
|
@@ -3124,5 +3474,5 @@ const Provider = ({
|
|
3124
3474
|
};
|
3125
3475
|
Provider.displayName = 'Provider';
|
3126
3476
|
|
3127
|
-
export { BreadCrumb, DataTable, DatePickerMonth, Datepicker, Field, Header, InputField, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, MultiDatePickerMonth, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Tab, TabList, TabPanel, TextareaField, Uploader, theme, useInternalUI };
|
3477
|
+
export { BreadCrumb, 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 };
|
3128
3478
|
//# sourceMappingURL=internal-ui.esm.js.map
|