@ctlyst.id/internal-ui 1.0.4-canary.1 → 1.0.4-canary.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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
@@ -23,6 +23,7 @@ var reactDropzone = require('react-dropzone');
|
|
23
23
|
var themeTools = require('@chakra-ui/theme-tools');
|
24
24
|
var anatomy = require('@chakra-ui/anatomy');
|
25
25
|
var styledSystem = require('@chakra-ui/styled-system');
|
26
|
+
require('@fontsource/poppins');
|
26
27
|
var axios = _interopDefault(require('axios'));
|
27
28
|
|
28
29
|
/* eslint-disable react-hooks/rules-of-hooks */
|
@@ -35,7 +36,7 @@ const BreadCrumb = props => {
|
|
35
36
|
disableHome,
|
36
37
|
spacing = 2
|
37
38
|
} = props;
|
38
|
-
const [
|
39
|
+
const [neutral6, dark5] = react.useToken('colors', ['neutral.600', 'dark.500']);
|
39
40
|
return /*#__PURE__*/React.createElement(react.Box, {
|
40
41
|
"data-test-id": "CT_component_breadcrumb_breadcrumb",
|
41
42
|
className: className,
|
@@ -48,16 +49,16 @@ const BreadCrumb = props => {
|
|
48
49
|
alignItems: "center"
|
49
50
|
}, /*#__PURE__*/React.createElement(react.Text, {
|
50
51
|
pr: 2,
|
51
|
-
fontWeight:
|
52
|
-
textStyle: "heading.
|
52
|
+
fontWeight: 600,
|
53
|
+
textStyle: "heading.4",
|
53
54
|
color: react.useColorModeValue('neutral.700', 'white')
|
54
55
|
}, title), /*#__PURE__*/React.createElement(react.Box, {
|
55
56
|
h: "22px",
|
56
57
|
borderLeft: "1px solid",
|
57
|
-
borderColor: react.useColorModeValue(
|
58
|
+
borderColor: react.useColorModeValue(neutral6, 'white')
|
58
59
|
}), /*#__PURE__*/React.createElement(react.Breadcrumb, {
|
59
60
|
separator: /*#__PURE__*/React.createElement(fi.FiChevronsRight, {
|
60
|
-
color: react.useColorModeValue(
|
61
|
+
color: react.useColorModeValue(neutral6, dark5),
|
61
62
|
size: 14
|
62
63
|
}),
|
63
64
|
pl: 2.5,
|
@@ -107,7 +108,7 @@ const BreadCrumb = props => {
|
|
107
108
|
cursor: 'default'
|
108
109
|
}
|
109
110
|
}, /*#__PURE__*/React.createElement(react.Text, {
|
110
|
-
color: react.useColorModeValue(
|
111
|
+
color: react.useColorModeValue(neutral6, 'white'),
|
111
112
|
fontSize: "text.sm",
|
112
113
|
fontWeight: 400
|
113
114
|
}, title))))), children && /*#__PURE__*/React.createElement(react.Box, null, children));
|
@@ -120,6 +121,43 @@ BreadCrumb.defaultProps = {
|
|
120
121
|
spacing: 2
|
121
122
|
};
|
122
123
|
|
124
|
+
function CheckboxComponent({
|
125
|
+
isError = false,
|
126
|
+
helpText = '',
|
127
|
+
errorText = '',
|
128
|
+
children,
|
129
|
+
isDisabled,
|
130
|
+
...rest
|
131
|
+
}) {
|
132
|
+
const variant = isError ? 'errors' : 'unstyled';
|
133
|
+
return /*#__PURE__*/React__default.createElement(react.Box, null, /*#__PURE__*/React__default.createElement(react.Box, {
|
134
|
+
display: "flex"
|
135
|
+
}, /*#__PURE__*/React__default.createElement(react.Checkbox, Object.assign({
|
136
|
+
variant: variant
|
137
|
+
}, rest, {
|
138
|
+
isDisabled: isDisabled
|
139
|
+
})), children && /*#__PURE__*/React__default.createElement(react.Box, null, /*#__PURE__*/React__default.createElement(react.Box, {
|
140
|
+
ml: "8px"
|
141
|
+
}, /*#__PURE__*/React__default.createElement(react.Text, {
|
142
|
+
textStyle: "text.sm",
|
143
|
+
color: isDisabled ? 'black.low' : 'black.high'
|
144
|
+
}, children)))), /*#__PURE__*/React__default.createElement(react.Box, {
|
145
|
+
mt: "5px",
|
146
|
+
ml: "24px"
|
147
|
+
}, isError ? /*#__PURE__*/React__default.createElement(react.Text, {
|
148
|
+
textStyle: "text.xs",
|
149
|
+
color: "danger.500"
|
150
|
+
}, errorText) : /*#__PURE__*/React__default.createElement(react.Text, {
|
151
|
+
textStyle: "text.xs",
|
152
|
+
color: isDisabled ? 'black.low' : 'black.medium'
|
153
|
+
}, helpText)));
|
154
|
+
}
|
155
|
+
CheckboxComponent.defaultProps = {
|
156
|
+
isError: false,
|
157
|
+
helpText: '',
|
158
|
+
errorText: ''
|
159
|
+
};
|
160
|
+
|
123
161
|
const IndeterminateCheckbox = ({
|
124
162
|
indeterminate = false,
|
125
163
|
...rest
|
@@ -1308,7 +1346,7 @@ const success = {
|
|
1308
1346
|
'200': '#A9F9B5',
|
1309
1347
|
'300': '#7CEE98',
|
1310
1348
|
'400': '#58DD86',
|
1311
|
-
'500': '#
|
1349
|
+
'500': '#28C76F',
|
1312
1350
|
'600': '#1DAB6A',
|
1313
1351
|
'700': '#148F63',
|
1314
1352
|
'800': '#0C7359',
|
@@ -1436,8 +1474,13 @@ const radius = {
|
|
1436
1474
|
full: '9999px'
|
1437
1475
|
};
|
1438
1476
|
|
1439
|
-
const
|
1440
|
-
...react.theme.
|
1477
|
+
const shadows = {
|
1478
|
+
...react.theme.shadows,
|
1479
|
+
raised: '0px 4px 20px rgba(0, 0, 0, 0.05)'
|
1480
|
+
};
|
1481
|
+
|
1482
|
+
const sizes = {
|
1483
|
+
...react.theme.sizes,
|
1441
1484
|
4.5: '1.125rem',
|
1442
1485
|
9.5: '2.375rem',
|
1443
1486
|
18: '4.5rem',
|
@@ -1446,8 +1489,8 @@ const spacing = {
|
|
1446
1489
|
30: '7.5rem'
|
1447
1490
|
};
|
1448
1491
|
|
1449
|
-
const
|
1450
|
-
...react.theme.
|
1492
|
+
const spacing = {
|
1493
|
+
...react.theme.space,
|
1451
1494
|
4.5: '1.125rem',
|
1452
1495
|
9.5: '2.375rem',
|
1453
1496
|
18: '4.5rem',
|
@@ -1478,6 +1521,11 @@ const lineHeights = {
|
|
1478
1521
|
short: 1.375,
|
1479
1522
|
base: 1.5,
|
1480
1523
|
tall: 1.625,
|
1524
|
+
64: '4rem',
|
1525
|
+
56: '3.5rem',
|
1526
|
+
48: '3rem',
|
1527
|
+
40: '2.5rem',
|
1528
|
+
36: '2.25rem',
|
1481
1529
|
34: '2.125rem',
|
1482
1530
|
32: '2rem',
|
1483
1531
|
30: '1.875rem',
|
@@ -1491,14 +1539,22 @@ const lineHeights = {
|
|
1491
1539
|
14: '0.875rem',
|
1492
1540
|
12: '0.75rem'
|
1493
1541
|
};
|
1542
|
+
const letterSpacings = {
|
1543
|
+
tighter: '-0.05em',
|
1544
|
+
tight: '-0.025em',
|
1545
|
+
normal: '0',
|
1546
|
+
wide: '0.025em',
|
1547
|
+
wider: '0.05em',
|
1548
|
+
widest: '0.1em'
|
1549
|
+
};
|
1494
1550
|
const fontSizes = {
|
1495
1551
|
heading: {
|
1496
|
-
1: '
|
1497
|
-
2: '
|
1498
|
-
3: '1.
|
1499
|
-
4: '1.
|
1500
|
-
5: '
|
1501
|
-
6: '
|
1552
|
+
1: '2.5rem',
|
1553
|
+
2: '2rem',
|
1554
|
+
3: '1.75rem',
|
1555
|
+
4: '1.5rem',
|
1556
|
+
5: '1.375rem',
|
1557
|
+
6: '1.125rem'
|
1502
1558
|
},
|
1503
1559
|
text: {
|
1504
1560
|
xl: '1.125rem',
|
@@ -1524,85 +1580,90 @@ const fontSizes = {
|
|
1524
1580
|
const heading = {
|
1525
1581
|
1: {
|
1526
1582
|
fontSize: fontSizes.heading[1],
|
1527
|
-
fontWeight:
|
1528
|
-
lineHeight:
|
1529
|
-
letterSpacing:
|
1583
|
+
fontWeight: fontWeights.semibold,
|
1584
|
+
lineHeight: lineHeights[64],
|
1585
|
+
letterSpacing: letterSpacings.normal
|
1530
1586
|
},
|
1531
1587
|
2: {
|
1532
1588
|
fontSize: fontSizes.heading[2],
|
1533
|
-
fontWeight:
|
1534
|
-
lineHeight:
|
1535
|
-
letterSpacing:
|
1589
|
+
fontWeight: fontWeights.semibold,
|
1590
|
+
lineHeight: lineHeights[56],
|
1591
|
+
letterSpacing: letterSpacings.normal
|
1536
1592
|
},
|
1537
1593
|
3: {
|
1538
1594
|
fontSize: fontSizes.heading[3],
|
1539
|
-
fontWeight:
|
1540
|
-
lineHeight:
|
1541
|
-
letterSpacing:
|
1595
|
+
fontWeight: fontWeights.semibold,
|
1596
|
+
lineHeight: lineHeights[48],
|
1597
|
+
letterSpacing: letterSpacings.normal
|
1542
1598
|
},
|
1543
1599
|
4: {
|
1544
1600
|
fontSize: fontSizes.heading[4],
|
1545
|
-
fontWeight:
|
1546
|
-
lineHeight:
|
1547
|
-
letterSpacing:
|
1601
|
+
fontWeight: fontWeights.semibold,
|
1602
|
+
lineHeight: lineHeights[40],
|
1603
|
+
letterSpacing: letterSpacings.normal
|
1548
1604
|
},
|
1549
1605
|
5: {
|
1550
1606
|
fontSize: fontSizes.heading[5],
|
1551
|
-
fontWeight:
|
1552
|
-
lineHeight:
|
1553
|
-
letterSpacing:
|
1607
|
+
fontWeight: fontWeights.semibold,
|
1608
|
+
lineHeight: lineHeights[36],
|
1609
|
+
letterSpacing: letterSpacings.normal
|
1554
1610
|
},
|
1555
1611
|
6: {
|
1556
1612
|
fontSize: fontSizes.heading[6],
|
1557
|
-
fontWeight:
|
1558
|
-
lineHeight:
|
1559
|
-
letterSpacing:
|
1613
|
+
fontWeight: fontWeights.semibold,
|
1614
|
+
lineHeight: lineHeights[32],
|
1615
|
+
letterSpacing: letterSpacings.normal
|
1560
1616
|
}
|
1561
1617
|
};
|
1562
1618
|
const text = {
|
1563
1619
|
xl: {
|
1564
1620
|
fontSize: fontSizes.text.xl,
|
1621
|
+
fontWeight: fontWeights.normal,
|
1565
1622
|
lineHeight: lineHeights[28],
|
1566
|
-
letterSpacing:
|
1623
|
+
letterSpacing: letterSpacings.normal
|
1567
1624
|
},
|
1568
1625
|
lg: {
|
1569
1626
|
fontSize: fontSizes.text.lg,
|
1627
|
+
fontWeight: fontWeights.normal,
|
1570
1628
|
lineHeight: lineHeights[24],
|
1571
|
-
letterSpacing:
|
1629
|
+
letterSpacing: letterSpacings.normal
|
1572
1630
|
},
|
1573
1631
|
md: {
|
1574
1632
|
fontSize: fontSizes.text.md,
|
1633
|
+
fontWeight: fontWeights.normal,
|
1575
1634
|
lineHeight: lineHeights[22],
|
1576
|
-
letterSpacing:
|
1635
|
+
letterSpacing: letterSpacings.normal
|
1577
1636
|
},
|
1578
1637
|
sm: {
|
1579
1638
|
fontSize: fontSizes.text.sm,
|
1639
|
+
fontWeight: fontWeights.normal,
|
1580
1640
|
lineHeight: lineHeights[18],
|
1581
|
-
letterSpacing:
|
1641
|
+
letterSpacing: letterSpacings.normal
|
1582
1642
|
},
|
1583
1643
|
xs: {
|
1584
1644
|
fontSize: fontSizes.text.xs,
|
1645
|
+
fontWeight: fontWeights.normal,
|
1585
1646
|
lineHeight: lineHeights[14],
|
1586
|
-
letterSpacing:
|
1647
|
+
letterSpacing: letterSpacings.normal
|
1587
1648
|
}
|
1588
1649
|
};
|
1589
1650
|
const button = {
|
1590
1651
|
lg: {
|
1591
1652
|
fontSize: fontSizes.button.lg,
|
1592
1653
|
lineHeight: lineHeights[28],
|
1593
|
-
letterSpacing:
|
1654
|
+
letterSpacing: letterSpacings.normal,
|
1594
1655
|
fontWeight: fontWeights.normal
|
1595
1656
|
},
|
1596
1657
|
md: {
|
1597
1658
|
fontSize: fontSizes.button.md,
|
1598
1659
|
lineHeight: lineHeights[22],
|
1599
|
-
letterSpacing:
|
1660
|
+
letterSpacing: letterSpacings.normal,
|
1600
1661
|
fontWeight: fontWeights.normal
|
1601
1662
|
},
|
1602
1663
|
sm: {
|
1603
1664
|
fontSize: fontSizes.button.sm,
|
1604
1665
|
lineHeight: lineHeights[14],
|
1605
|
-
letterSpacing:
|
1666
|
+
letterSpacing: letterSpacings.normal,
|
1606
1667
|
fontWeight: fontWeights.normal
|
1607
1668
|
}
|
1608
1669
|
};
|
@@ -1610,19 +1671,19 @@ const field = {
|
|
1610
1671
|
lg: {
|
1611
1672
|
fontSize: fontSizes.field.lg,
|
1612
1673
|
lineHeight: lineHeights[24],
|
1613
|
-
letterSpacing:
|
1674
|
+
letterSpacing: letterSpacings.normal,
|
1614
1675
|
fontWeight: fontWeights.normal
|
1615
1676
|
},
|
1616
1677
|
md: {
|
1617
1678
|
fontSize: fontSizes.field.md,
|
1618
1679
|
lineHeight: lineHeights[22],
|
1619
|
-
letterSpacing:
|
1680
|
+
letterSpacing: letterSpacings.normal,
|
1620
1681
|
fontWeight: fontWeights.normal
|
1621
1682
|
},
|
1622
1683
|
sm: {
|
1623
1684
|
fontSize: fontSizes.field.sm,
|
1624
1685
|
lineHeight: lineHeights[18],
|
1625
|
-
letterSpacing:
|
1686
|
+
letterSpacing: letterSpacings.normal,
|
1626
1687
|
fontWeight: fontWeights.normal
|
1627
1688
|
}
|
1628
1689
|
};
|
@@ -1639,10 +1700,12 @@ var foundations = {
|
|
1639
1700
|
__proto__: null,
|
1640
1701
|
colors: colors,
|
1641
1702
|
radii: radius,
|
1642
|
-
|
1703
|
+
shadows: shadows,
|
1643
1704
|
sizes: sizes,
|
1705
|
+
space: spacing,
|
1644
1706
|
fonts: fonts,
|
1645
1707
|
fontSizes: fontSizes,
|
1708
|
+
letterSpacings: letterSpacings,
|
1646
1709
|
lineHeights: lineHeights,
|
1647
1710
|
textStyles: textStyles
|
1648
1711
|
};
|
@@ -1696,35 +1759,63 @@ const Field = props => {
|
|
1696
1759
|
const {
|
1697
1760
|
label,
|
1698
1761
|
isError,
|
1699
|
-
|
1700
|
-
|
1762
|
+
errorMessage,
|
1763
|
+
leftHelperText,
|
1764
|
+
rightHelperText,
|
1701
1765
|
isRequired,
|
1702
|
-
children
|
1766
|
+
children,
|
1767
|
+
isSuccess,
|
1768
|
+
isDisabled
|
1703
1769
|
} = props;
|
1770
|
+
const getHelperColor = () => {
|
1771
|
+
if (isError) return 'danger.500';
|
1772
|
+
if (isSuccess) return 'success.500';
|
1773
|
+
if (isDisabled) return 'black.low';
|
1774
|
+
return 'black.medium';
|
1775
|
+
};
|
1776
|
+
const getJustifyContentHelper = () => {
|
1777
|
+
if (rightHelperText && (!leftHelperText || isError && !errorMessage)) return 'flex-end';
|
1778
|
+
return 'space-between';
|
1779
|
+
};
|
1780
|
+
const helperColor = getHelperColor();
|
1781
|
+
const justifyHelper = getJustifyContentHelper();
|
1704
1782
|
return /*#__PURE__*/React__default.createElement(react.FormControl, {
|
1705
1783
|
isInvalid: isError
|
1706
1784
|
}, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(react.FormLabel, {
|
1707
|
-
|
1785
|
+
mb: 1,
|
1786
|
+
fontSize: "text.sm",
|
1708
1787
|
requiredIndicator: undefined
|
1709
1788
|
}, isRequired && /*#__PURE__*/React__default.createElement(react.Box, {
|
1710
1789
|
as: "span",
|
1711
|
-
color: "
|
1790
|
+
color: "danger.500",
|
1712
1791
|
ml: 0,
|
1713
1792
|
mr: 1
|
1714
|
-
}, "*"), label) : label), children,
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1793
|
+
}, "*"), label) : label), children, (isError && errorMessage || leftHelperText || rightHelperText) && /*#__PURE__*/React__default.createElement(react.Box, {
|
1794
|
+
display: "flex",
|
1795
|
+
width: "full",
|
1796
|
+
justifyContent: justifyHelper
|
1797
|
+
}, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
1798
|
+
fontSize: "text.xs",
|
1799
|
+
color: helperColor,
|
1800
|
+
mt: 1
|
1801
|
+
}, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(react.FormErrorMessage, {
|
1802
|
+
fontSize: "text.xs",
|
1803
|
+
color: "danger.500",
|
1804
|
+
mt: 1
|
1805
|
+
}, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, {
|
1806
|
+
fontSize: "text.xs",
|
1807
|
+
color: helperColor,
|
1808
|
+
mt: 1
|
1809
|
+
}, rightHelperText)));
|
1722
1810
|
};
|
1723
1811
|
Field.defaultProps = {
|
1724
1812
|
label: '',
|
1725
1813
|
isError: false,
|
1726
|
-
|
1727
|
-
|
1814
|
+
isSuccess: false,
|
1815
|
+
isDisabled: false,
|
1816
|
+
errorMessage: undefined,
|
1817
|
+
leftHelperText: undefined,
|
1818
|
+
rightHelperText: undefined,
|
1728
1819
|
isRequired: false
|
1729
1820
|
};
|
1730
1821
|
|
@@ -1740,15 +1831,21 @@ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
1740
1831
|
isRequired,
|
1741
1832
|
label,
|
1742
1833
|
isError,
|
1743
|
-
|
1744
|
-
|
1834
|
+
isSuccess,
|
1835
|
+
isDisabled,
|
1836
|
+
errorMessage,
|
1837
|
+
leftHelperText,
|
1838
|
+
rightHelperText,
|
1745
1839
|
...inputProps
|
1746
1840
|
} = props;
|
1747
1841
|
return /*#__PURE__*/React__default.createElement(Field, {
|
1748
1842
|
label: label,
|
1843
|
+
isSuccess: isSuccess,
|
1844
|
+
isDisabled: isDisabled,
|
1749
1845
|
isError: isError,
|
1750
|
-
|
1751
|
-
|
1846
|
+
errorMessage: errorMessage,
|
1847
|
+
leftHelperText: leftHelperText,
|
1848
|
+
rightHelperText: rightHelperText,
|
1752
1849
|
isRequired: isRequired
|
1753
1850
|
}, /*#__PURE__*/React__default.createElement(react.InputGroup, {
|
1754
1851
|
size: size
|
@@ -1765,21 +1862,36 @@ InputField.defaultProps = {
|
|
1765
1862
|
elementRight: undefined
|
1766
1863
|
};
|
1767
1864
|
|
1865
|
+
const Loader = /*#__PURE__*/react.forwardRef((props, ref) => {
|
1866
|
+
const styles = react.useStyleConfig('LoaderStyle', props);
|
1867
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
1868
|
+
ref: ref,
|
1869
|
+
__css: styles
|
1870
|
+
});
|
1871
|
+
});
|
1872
|
+
|
1768
1873
|
const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
1769
1874
|
const {
|
1770
1875
|
value,
|
1876
|
+
isLoading,
|
1771
1877
|
...inputProps
|
1772
1878
|
} = props;
|
1773
|
-
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(react.
|
1879
|
+
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(react.Box, {
|
1880
|
+
position: "relative"
|
1881
|
+
}, /*#__PURE__*/React__default.createElement(react.Textarea, Object.assign({
|
1774
1882
|
ref: ref,
|
1775
1883
|
value: value
|
1776
|
-
}, inputProps))
|
1884
|
+
}, inputProps)), isLoading && /*#__PURE__*/React__default.createElement(react.Box, {
|
1885
|
+
zIndex: 999,
|
1886
|
+
top: 2,
|
1887
|
+
right: 2,
|
1888
|
+
position: "absolute"
|
1889
|
+
}, /*#__PURE__*/React__default.createElement(Loader, {
|
1890
|
+
size: "sm"
|
1891
|
+
}))));
|
1777
1892
|
});
|
1778
1893
|
TextareaField.defaultProps = {
|
1779
|
-
|
1780
|
-
addOnRight: undefined,
|
1781
|
-
elementLeft: undefined,
|
1782
|
-
elementRight: undefined
|
1894
|
+
isLoading: undefined
|
1783
1895
|
};
|
1784
1896
|
|
1785
1897
|
const XMSLogo = () => /*#__PURE__*/React__default.createElement(react.Image, {
|
@@ -1934,6 +2046,7 @@ const Header = ({
|
|
1934
2046
|
data,
|
1935
2047
|
onLogout,
|
1936
2048
|
onOpenModalRelease,
|
2049
|
+
hideSwitchMode,
|
1937
2050
|
...props
|
1938
2051
|
}) => /*#__PURE__*/React.createElement(react.Box, Object.assign({
|
1939
2052
|
minH: 14,
|
@@ -1954,14 +2067,15 @@ const Header = ({
|
|
1954
2067
|
onOpenModalRelease: onOpenModalRelease
|
1955
2068
|
})), /*#__PURE__*/React.createElement(react.Flex, {
|
1956
2069
|
alignItems: "center"
|
1957
|
-
}, /*#__PURE__*/React.createElement(SwitchMode, null), /*#__PURE__*/React.createElement(Profile, {
|
2070
|
+
}, !hideSwitchMode && /*#__PURE__*/React.createElement(SwitchMode, null), /*#__PURE__*/React.createElement(Profile, {
|
1958
2071
|
data: data,
|
1959
2072
|
onLogout: onLogout
|
1960
2073
|
}))));
|
1961
2074
|
Header.defaultProps = {
|
1962
2075
|
data: undefined,
|
1963
2076
|
onLogout: undefined,
|
1964
|
-
onOpenModalRelease: undefined
|
2077
|
+
onOpenModalRelease: undefined,
|
2078
|
+
hideSwitchMode: false
|
1965
2079
|
};
|
1966
2080
|
|
1967
2081
|
const ModalBody = /*#__PURE__*/React__default.forwardRef(({
|
@@ -2007,6 +2121,28 @@ const ModalHeader = /*#__PURE__*/React.forwardRef(({
|
|
2007
2121
|
}, rest), children);
|
2008
2122
|
});
|
2009
2123
|
|
2124
|
+
const CustomerIcon = /*#__PURE__*/react.createIcon({
|
2125
|
+
displayName: 'CustomerIcon',
|
2126
|
+
viewBox: '0 0 16 16',
|
2127
|
+
path: [/*#__PURE__*/React__default.createElement("path", {
|
2128
|
+
fill: "currentColor",
|
2129
|
+
fillRule: "inherit",
|
2130
|
+
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",
|
2131
|
+
clipRule: "inherit"
|
2132
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
2133
|
+
fill: "currentColor",
|
2134
|
+
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"
|
2135
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
2136
|
+
fill: "currentColor",
|
2137
|
+
fillRule: "inherit",
|
2138
|
+
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",
|
2139
|
+
clipRule: "inherit"
|
2140
|
+
})]
|
2141
|
+
});
|
2142
|
+
|
2143
|
+
/* eslint-disable import/prefer-default-export */
|
2144
|
+
const mappingIcon = /*#__PURE__*/new Map([['Order', fi.FiShoppingBag], ['Fulfillment', fi.FiShoppingCart], ['Transfer Stock', fi.FiRepeat], ['Stock', fi.FiBox], ['Product Database', fi.FiLayers], ['Purchasing', fi.FiDollarSign], ['Reseller', fi.FiUsers], ['Retur', fi.FiRotateCcw], ['Other', fi.FiSettings], ['Content', fi.FiLayout], ['Voucher', fi.FiGift], ['Customer', CustomerIcon]]);
|
2145
|
+
|
2010
2146
|
/* eslint-disable react-hooks/rules-of-hooks */
|
2011
2147
|
const Navigation = ({
|
2012
2148
|
navigations,
|
@@ -2046,7 +2182,7 @@ const Navigation = ({
|
|
2046
2182
|
color: isActive ? 'white' : 'inherit',
|
2047
2183
|
p: 2
|
2048
2184
|
}, /*#__PURE__*/React.createElement(react.Icon, {
|
2049
|
-
as: navigation.
|
2185
|
+
as: mappingIcon.get(navigation.title),
|
2050
2186
|
mr: 2
|
2051
2187
|
}), /*#__PURE__*/React.createElement(react.Text, {
|
2052
2188
|
whiteSpace: "nowrap",
|
@@ -2066,8 +2202,7 @@ const Navigation = ({
|
|
2066
2202
|
}, navigation.children.map(({
|
2067
2203
|
title,
|
2068
2204
|
navHost,
|
2069
|
-
navLink
|
2070
|
-
icon
|
2205
|
+
navLink
|
2071
2206
|
}) => {
|
2072
2207
|
const link = navHost ? `${navHost}${navLink}` : navLink;
|
2073
2208
|
const isLocalLink = host === navHost;
|
@@ -2076,7 +2211,6 @@ const Navigation = ({
|
|
2076
2211
|
as: isLocalLink ? as : undefined,
|
2077
2212
|
key: title,
|
2078
2213
|
href: link,
|
2079
|
-
cursor: "pointer",
|
2080
2214
|
_hover: {
|
2081
2215
|
textDecoration: 'none'
|
2082
2216
|
}
|
@@ -2084,6 +2218,7 @@ const Navigation = ({
|
|
2084
2218
|
display: "flex",
|
2085
2219
|
position: "relative",
|
2086
2220
|
alignItems: "center",
|
2221
|
+
cursor: "pointer",
|
2087
2222
|
transition: "padding 0.35s ease 0s",
|
2088
2223
|
_hover: {
|
2089
2224
|
backgroundColor: react.useColorModeValue('dove-gray.50', 'mirage.900'),
|
@@ -2104,7 +2239,7 @@ const Navigation = ({
|
|
2104
2239
|
px: 6,
|
2105
2240
|
py: 4
|
2106
2241
|
}, /*#__PURE__*/React.createElement(react.Icon, {
|
2107
|
-
as:
|
2242
|
+
as: mappingIcon.get(navigation.title),
|
2108
2243
|
mr: 3
|
2109
2244
|
}), /*#__PURE__*/React.createElement(react.Text, {
|
2110
2245
|
fontSize: "text.sm"
|
@@ -2345,23 +2480,45 @@ PaginationFilter.defaultProps = {
|
|
2345
2480
|
label: undefined
|
2346
2481
|
};
|
2347
2482
|
|
2483
|
+
const SelectWrapper = ({
|
2484
|
+
children,
|
2485
|
+
isError = false
|
2486
|
+
}) => {
|
2487
|
+
return /*#__PURE__*/React__default.createElement(react.Box, {
|
2488
|
+
css: react$1.css`
|
2489
|
+
.react-select__control {
|
2490
|
+
border-color: ${isError ? colors.danger['500'] : colors.neutral['500']} !important;
|
2491
|
+
}
|
2492
|
+
|
2493
|
+
.react-select__control:hover {
|
2494
|
+
border-color: ${isError ? colors.danger['500'] : colors.primary['500']} !important;
|
2495
|
+
}
|
2496
|
+
`
|
2497
|
+
}, children);
|
2498
|
+
};
|
2499
|
+
SelectWrapper.defaultProps = {
|
2500
|
+
isError: false
|
2501
|
+
};
|
2502
|
+
|
2348
2503
|
const styleMd = textStyles.text.sm;
|
2349
2504
|
const selectStyle = {
|
2350
2505
|
fontSize: styleMd.fontSize,
|
2351
2506
|
lineHeight: styleMd.lineHeight,
|
2352
2507
|
letterSpacing: 0
|
2353
2508
|
};
|
2354
|
-
function selectStyles(colorMode) {
|
2509
|
+
function selectStyles(colorMode, _isError) {
|
2355
2510
|
return {
|
2356
|
-
control: base => colorMode === 'dark' ? {
|
2511
|
+
control: (base, state) => colorMode === 'dark' ? {
|
2357
2512
|
...base,
|
2358
2513
|
...selectStyle,
|
2359
2514
|
background: 'transparent',
|
2360
2515
|
color: colors.primary['300'],
|
2361
|
-
borderColor: colors.secondary['500']
|
2516
|
+
borderColor: colors.secondary['500'],
|
2517
|
+
boxShadow: state.isFocused ? 'none' : `inherit`
|
2362
2518
|
} : {
|
2363
2519
|
...base,
|
2364
|
-
...selectStyle
|
2520
|
+
...selectStyle,
|
2521
|
+
boxShadow: state.isFocused ? 'none' : colors.neutral['500']
|
2365
2522
|
},
|
2366
2523
|
option: (base, {
|
2367
2524
|
isSelected
|
@@ -2431,68 +2588,88 @@ const themeSelect = theme => {
|
|
2431
2588
|
};
|
2432
2589
|
};
|
2433
2590
|
|
2591
|
+
/* eslint-disable react/require-default-props */
|
2434
2592
|
function Select({
|
2435
2593
|
styles,
|
2594
|
+
isError = false,
|
2436
2595
|
...rest
|
2437
2596
|
}) {
|
2438
2597
|
const {
|
2439
2598
|
colorMode
|
2440
2599
|
} = system.useColorMode();
|
2441
|
-
return /*#__PURE__*/React__default.createElement(
|
2600
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2601
|
+
isError: isError
|
2602
|
+
}, /*#__PURE__*/React__default.createElement(ReactSelect, Object.assign({
|
2603
|
+
classNamePrefix: "react-select"
|
2604
|
+
}, rest, {
|
2442
2605
|
styles: {
|
2443
|
-
...selectStyles(colorMode)
|
2444
|
-
...styles
|
2606
|
+
...selectStyles(colorMode)
|
2445
2607
|
},
|
2446
2608
|
theme: themeSelect
|
2447
|
-
}));
|
2609
|
+
})));
|
2448
2610
|
}
|
2449
2611
|
|
2450
2612
|
function SelectAsync({
|
2451
2613
|
styles,
|
2614
|
+
isError = false,
|
2452
2615
|
...rest
|
2453
2616
|
}) {
|
2454
2617
|
const {
|
2455
2618
|
colorMode
|
2456
2619
|
} = system.useColorMode();
|
2457
|
-
return /*#__PURE__*/React__default.createElement(
|
2620
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2621
|
+
isError: isError
|
2622
|
+
}, /*#__PURE__*/React__default.createElement(reactSelectAsyncPaginate.AsyncPaginate, Object.assign({
|
2623
|
+
classNamePrefix: "react-select"
|
2624
|
+
}, rest, {
|
2458
2625
|
styles: {
|
2459
2626
|
...selectStyles(colorMode),
|
2460
2627
|
...styles
|
2461
2628
|
},
|
2462
2629
|
theme: themeSelect
|
2463
|
-
}));
|
2630
|
+
})));
|
2464
2631
|
}
|
2465
2632
|
|
2466
2633
|
function SelectAsyncCreatable({
|
2467
2634
|
styles,
|
2635
|
+
isError = false,
|
2468
2636
|
...rest
|
2469
2637
|
}) {
|
2470
2638
|
const {
|
2471
2639
|
colorMode
|
2472
2640
|
} = system.useColorMode();
|
2473
|
-
return /*#__PURE__*/React__default.createElement(
|
2641
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2642
|
+
isError: isError
|
2643
|
+
}, /*#__PURE__*/React__default.createElement(ReactSelectAsyncCreatable, Object.assign({
|
2644
|
+
classNamePrefix: "react-select"
|
2645
|
+
}, rest, {
|
2474
2646
|
styles: {
|
2475
2647
|
...selectStyles(colorMode),
|
2476
2648
|
...styles
|
2477
2649
|
},
|
2478
2650
|
theme: themeSelect
|
2479
|
-
}));
|
2651
|
+
})));
|
2480
2652
|
}
|
2481
2653
|
|
2482
2654
|
function SelectCreatable({
|
2483
2655
|
styles,
|
2656
|
+
isError = false,
|
2484
2657
|
...rest
|
2485
2658
|
}) {
|
2486
2659
|
const {
|
2487
2660
|
colorMode
|
2488
2661
|
} = system.useColorMode();
|
2489
|
-
return /*#__PURE__*/React__default.createElement(
|
2662
|
+
return /*#__PURE__*/React__default.createElement(SelectWrapper, {
|
2663
|
+
isError: isError
|
2664
|
+
}, /*#__PURE__*/React__default.createElement(ReactSelectCreatable, Object.assign({
|
2665
|
+
classNamePrefix: "react-select"
|
2666
|
+
}, rest, {
|
2490
2667
|
styles: {
|
2491
2668
|
...selectStyles(colorMode),
|
2492
2669
|
...styles
|
2493
2670
|
},
|
2494
2671
|
theme: themeSelect
|
2495
|
-
}));
|
2672
|
+
})));
|
2496
2673
|
}
|
2497
2674
|
|
2498
2675
|
const Tab = /*#__PURE__*/react.forwardRef((props, ref) => {
|
@@ -2729,80 +2906,106 @@ const Button = {
|
|
2729
2906
|
};
|
2730
2907
|
|
2731
2908
|
const {
|
2732
|
-
definePartsStyle
|
2733
|
-
|
2734
|
-
|
2735
|
-
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
|
2909
|
+
definePartsStyle,
|
2910
|
+
defineMultiStyleConfig
|
2911
|
+
} = /*#__PURE__*/react.createMultiStyleConfigHelpers(anatomy.checkboxAnatomy.keys);
|
2912
|
+
const baseStyle = /*#__PURE__*/definePartsStyle({
|
2913
|
+
control: {
|
2914
|
+
borderRadius: '4px',
|
2915
|
+
width: '16px',
|
2916
|
+
height: '16px',
|
2917
|
+
border: '1px solid'
|
2741
2918
|
},
|
2742
|
-
|
2743
|
-
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2760
|
-
|
2761
|
-
|
2762
|
-
|
2763
|
-
|
2764
|
-
|
2765
|
-
|
2919
|
+
icon: {
|
2920
|
+
color: 'neutral.50',
|
2921
|
+
width: '9px'
|
2922
|
+
},
|
2923
|
+
label: {
|
2924
|
+
fontWeight: '400',
|
2925
|
+
lineHeight: '18px',
|
2926
|
+
color: 'black.high',
|
2927
|
+
ml: '8px'
|
2928
|
+
},
|
2929
|
+
_disabled: {
|
2930
|
+
background: 'neutral.500',
|
2931
|
+
border: '1px solid',
|
2932
|
+
borderColor: 'neutral.500',
|
2933
|
+
cursor: 'not-allowed'
|
2934
|
+
}
|
2935
|
+
});
|
2936
|
+
const errors = /*#__PURE__*/definePartsStyle({
|
2937
|
+
control: {
|
2938
|
+
borderColor: 'danger.500',
|
2939
|
+
_checked: {
|
2940
|
+
borderColor: 'danger.500',
|
2941
|
+
backgroundColor: 'danger.500',
|
2942
|
+
_hover: {
|
2943
|
+
borderColor: 'danger.600',
|
2944
|
+
backgroundColor: 'danger.600'
|
2766
2945
|
}
|
2767
|
-
}
|
2768
|
-
|
2769
|
-
|
2770
|
-
|
2771
|
-
|
2772
|
-
|
2773
|
-
|
2774
|
-
|
2946
|
+
},
|
2947
|
+
_indeterminate: {
|
2948
|
+
borderColor: 'danger.500',
|
2949
|
+
backgroundColor: 'danger.500'
|
2950
|
+
}
|
2951
|
+
},
|
2952
|
+
label: {
|
2953
|
+
fontSize: '12px'
|
2954
|
+
}
|
2955
|
+
});
|
2956
|
+
const unstyled = /*#__PURE__*/definePartsStyle({
|
2957
|
+
control: {
|
2958
|
+
borderColor: 'neutral.500',
|
2959
|
+
_checked: {
|
2960
|
+
borderColor: 'primary.500',
|
2961
|
+
backgroundColor: 'primary.500',
|
2962
|
+
_hover: {
|
2963
|
+
borderColor: 'primary.600',
|
2964
|
+
backgroundColor: 'primary.600'
|
2775
2965
|
},
|
2776
|
-
|
2777
|
-
|
2966
|
+
_disabled: {
|
2967
|
+
backgroundColor: 'neutral.500',
|
2968
|
+
borderColor: 'neutral.500'
|
2778
2969
|
}
|
2779
|
-
}
|
2970
|
+
},
|
2971
|
+
_disabled: {
|
2972
|
+
backgroundColor: 'neutral.500'
|
2973
|
+
},
|
2974
|
+
_indeterminate: {
|
2975
|
+
borderColor: 'primary.500',
|
2976
|
+
backgroundColor: 'primary.500'
|
2977
|
+
}
|
2780
2978
|
},
|
2781
|
-
|
2782
|
-
|
2783
|
-
// The default size and variant values
|
2784
|
-
defaultProps: {
|
2785
|
-
size: 'sm',
|
2786
|
-
variant: 'solid',
|
2787
|
-
orientation: 'vertical',
|
2788
|
-
colorScheme: 'primary'
|
2979
|
+
label: {
|
2980
|
+
fontSize: '12px'
|
2789
2981
|
}
|
2982
|
+
});
|
2983
|
+
const variants = {
|
2984
|
+
errors,
|
2985
|
+
unstyled
|
2790
2986
|
};
|
2987
|
+
const Checkbox = /*#__PURE__*/defineMultiStyleConfig({
|
2988
|
+
baseStyle,
|
2989
|
+
variants,
|
2990
|
+
defaultProps: {
|
2991
|
+
variant: 'errors'
|
2992
|
+
}
|
2993
|
+
});
|
2791
2994
|
|
2792
|
-
const baseStyle = /*#__PURE__*/styledSystem.defineStyle({
|
2995
|
+
const baseStyle$1 = /*#__PURE__*/styledSystem.defineStyle({
|
2793
2996
|
fontSize: 'field.sm',
|
2794
2997
|
marginEnd: 1,
|
2795
2998
|
mb: 1
|
2796
2999
|
});
|
2797
3000
|
const FormLabel = /*#__PURE__*/styledSystem.defineStyleConfig({
|
2798
|
-
baseStyle
|
3001
|
+
baseStyle: baseStyle$1
|
2799
3002
|
});
|
2800
3003
|
|
2801
3004
|
const {
|
2802
3005
|
definePartsStyle: definePartsStyle$1,
|
2803
|
-
defineMultiStyleConfig
|
3006
|
+
defineMultiStyleConfig: defineMultiStyleConfig$1
|
2804
3007
|
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.inputAnatomy.keys);
|
2805
|
-
const baseStyle$
|
3008
|
+
const baseStyle$2 = /*#__PURE__*/definePartsStyle$1({
|
2806
3009
|
field: {
|
2807
3010
|
width: '100%',
|
2808
3011
|
minWidth: 0,
|
@@ -2908,7 +3111,7 @@ const outline = /*#__PURE__*/definePartsStyle$1(props => {
|
|
2908
3111
|
}
|
2909
3112
|
};
|
2910
3113
|
});
|
2911
|
-
const unstyled = /*#__PURE__*/definePartsStyle$1({
|
3114
|
+
const unstyled$1 = /*#__PURE__*/definePartsStyle$1({
|
2912
3115
|
field: {
|
2913
3116
|
bg: 'transparent',
|
2914
3117
|
px: '0',
|
@@ -2920,28 +3123,130 @@ const unstyled = /*#__PURE__*/definePartsStyle$1({
|
|
2920
3123
|
height: 'auto'
|
2921
3124
|
}
|
2922
3125
|
});
|
2923
|
-
const variants = {
|
3126
|
+
const variants$1 = {
|
2924
3127
|
outline,
|
2925
|
-
unstyled
|
3128
|
+
unstyled: unstyled$1
|
2926
3129
|
};
|
2927
|
-
const Input = /*#__PURE__*/defineMultiStyleConfig({
|
2928
|
-
baseStyle: baseStyle$
|
3130
|
+
const Input = /*#__PURE__*/defineMultiStyleConfig$1({
|
3131
|
+
baseStyle: baseStyle$2,
|
2929
3132
|
sizes: sizes$1,
|
2930
|
-
variants,
|
3133
|
+
variants: variants$1,
|
2931
3134
|
defaultProps: {
|
2932
3135
|
size: 'sm',
|
2933
3136
|
variant: 'outline'
|
2934
3137
|
}
|
2935
3138
|
});
|
2936
3139
|
|
3140
|
+
const rotate = /*#__PURE__*/react$1.keyframes({
|
3141
|
+
'0%': {
|
3142
|
+
transform: 'rotate(0deg)'
|
3143
|
+
},
|
3144
|
+
'100%': {
|
3145
|
+
transform: 'rotate(360deg)'
|
3146
|
+
}
|
3147
|
+
});
|
3148
|
+
const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
|
3149
|
+
baseStyle: props => {
|
3150
|
+
const colors$1 = props.color === 'white' ? 'white' : colors.primary[600];
|
3151
|
+
return {
|
3152
|
+
borderRadius: '50%',
|
3153
|
+
display: 'flex',
|
3154
|
+
justifyContent: 'center',
|
3155
|
+
alignItems: 'center',
|
3156
|
+
animation: `${rotate} 1s linear infinite`,
|
3157
|
+
background: `conic-gradient(from 180deg at 50% 50%, ${colors$1} 0deg, rgba(217, 217, 217, 0) 360deg);`,
|
3158
|
+
':before': {
|
3159
|
+
content: `''`,
|
3160
|
+
display: 'block',
|
3161
|
+
borderRadius: '50%',
|
3162
|
+
width: '6px',
|
3163
|
+
height: '6px',
|
3164
|
+
position: 'absolute',
|
3165
|
+
bottom: 0,
|
3166
|
+
background: colors$1
|
3167
|
+
}
|
3168
|
+
};
|
3169
|
+
},
|
3170
|
+
sizes: {
|
3171
|
+
xs: {
|
3172
|
+
width: '12px',
|
3173
|
+
height: '12px',
|
3174
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 1.4px),#000 0);',
|
3175
|
+
':before': {
|
3176
|
+
width: '1.4px',
|
3177
|
+
height: '1.4px'
|
3178
|
+
}
|
3179
|
+
},
|
3180
|
+
sm: {
|
3181
|
+
width: '16px',
|
3182
|
+
height: '16px',
|
3183
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 1.87px),#000 0);',
|
3184
|
+
':before': {
|
3185
|
+
width: '1.87px',
|
3186
|
+
height: '1.87px'
|
3187
|
+
}
|
3188
|
+
},
|
3189
|
+
md: {
|
3190
|
+
width: '24px',
|
3191
|
+
height: '24px',
|
3192
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 2.8px),#000 0);',
|
3193
|
+
':before': {
|
3194
|
+
width: '2.8px',
|
3195
|
+
height: '2.8px'
|
3196
|
+
}
|
3197
|
+
},
|
3198
|
+
lg: {
|
3199
|
+
width: '50px',
|
3200
|
+
height: '50px',
|
3201
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 5.83px),#000 0);',
|
3202
|
+
':before': {
|
3203
|
+
width: '5.83px',
|
3204
|
+
height: '5.83px'
|
3205
|
+
}
|
3206
|
+
},
|
3207
|
+
xl: {
|
3208
|
+
width: '75px',
|
3209
|
+
height: '75px',
|
3210
|
+
WebkitMask: 'radial-gradient(farthest-side,#0000 calc(100% - 8.75px),#000 0);',
|
3211
|
+
':before': {
|
3212
|
+
width: '8.75px',
|
3213
|
+
height: '8.75px'
|
3214
|
+
}
|
3215
|
+
},
|
3216
|
+
xxl: {
|
3217
|
+
width: '100px',
|
3218
|
+
height: '100px',
|
3219
|
+
WebkitMask: `radial-gradient(farthest-side,#0000 calc(100% - 11.67px),#000 0);`,
|
3220
|
+
':before': {
|
3221
|
+
width: '11.67px',
|
3222
|
+
height: '11.67px'
|
3223
|
+
}
|
3224
|
+
}
|
3225
|
+
},
|
3226
|
+
defaultProps: {
|
3227
|
+
size: 'lg'
|
3228
|
+
}
|
3229
|
+
});
|
3230
|
+
|
2937
3231
|
const {
|
2938
3232
|
definePartsStyle: definePartsStyle$2
|
3233
|
+
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.popoverAnatomy.keys);
|
3234
|
+
const Popover = {
|
3235
|
+
baseStyle: props => definePartsStyle$2({
|
3236
|
+
popper: {
|
3237
|
+
background: themeTools.mode('white', 'inherit')(props)
|
3238
|
+
}
|
3239
|
+
})
|
3240
|
+
};
|
3241
|
+
|
3242
|
+
const {
|
3243
|
+
definePartsStyle: definePartsStyle$3
|
2939
3244
|
} = /*#__PURE__*/styledSystem.createMultiStyleConfigHelpers(anatomy.radioAnatomy.keys);
|
2940
3245
|
// You can also use the more specific type for
|
2941
3246
|
// a single part component: ComponentSingleStyleConfig
|
2942
3247
|
const Radio = {
|
2943
3248
|
// The styles all checkbox have in common
|
2944
|
-
baseStyle: /*#__PURE__*/definePartsStyle$
|
3249
|
+
baseStyle: /*#__PURE__*/definePartsStyle$3({
|
2945
3250
|
control: {
|
2946
3251
|
_checked: {
|
2947
3252
|
borderColor: 'primary.500',
|
@@ -2960,7 +3265,7 @@ const Radio = {
|
|
2960
3265
|
}),
|
2961
3266
|
// Two sizes: sm and md
|
2962
3267
|
sizes: {
|
2963
|
-
sm: /*#__PURE__*/definePartsStyle$
|
3268
|
+
sm: /*#__PURE__*/definePartsStyle$3({
|
2964
3269
|
control: {
|
2965
3270
|
w: '3',
|
2966
3271
|
h: '3'
|
@@ -2969,7 +3274,7 @@ const Radio = {
|
|
2969
3274
|
fontSize: 'text.sm'
|
2970
3275
|
}
|
2971
3276
|
}),
|
2972
|
-
md: /*#__PURE__*/definePartsStyle$
|
3277
|
+
md: /*#__PURE__*/definePartsStyle$3({
|
2973
3278
|
control: {
|
2974
3279
|
w: '4',
|
2975
3280
|
h: '4'
|
@@ -2978,7 +3283,7 @@ const Radio = {
|
|
2978
3283
|
fontSize: 'text.md'
|
2979
3284
|
}
|
2980
3285
|
}),
|
2981
|
-
lg: /*#__PURE__*/definePartsStyle$
|
3286
|
+
lg: /*#__PURE__*/definePartsStyle$3({
|
2982
3287
|
control: {
|
2983
3288
|
w: '5',
|
2984
3289
|
h: '5'
|
@@ -3000,10 +3305,10 @@ const Radio = {
|
|
3000
3305
|
};
|
3001
3306
|
|
3002
3307
|
const {
|
3003
|
-
definePartsStyle: definePartsStyle$
|
3004
|
-
defineMultiStyleConfig: defineMultiStyleConfig$
|
3308
|
+
definePartsStyle: definePartsStyle$4,
|
3309
|
+
defineMultiStyleConfig: defineMultiStyleConfig$2
|
3005
3310
|
} = /*#__PURE__*/react.createMultiStyleConfigHelpers(anatomy.switchAnatomy.keys);
|
3006
|
-
const baseStyle$
|
3311
|
+
const baseStyle$3 = /*#__PURE__*/definePartsStyle$4({
|
3007
3312
|
// define the part you're going to style
|
3008
3313
|
container: {
|
3009
3314
|
// ...
|
@@ -3019,45 +3324,88 @@ const baseStyle$2 = /*#__PURE__*/definePartsStyle$3({
|
|
3019
3324
|
}
|
3020
3325
|
}
|
3021
3326
|
});
|
3022
|
-
const Switch = /*#__PURE__*/defineMultiStyleConfig$
|
3023
|
-
baseStyle: baseStyle$
|
3327
|
+
const Switch = /*#__PURE__*/defineMultiStyleConfig$2({
|
3328
|
+
baseStyle: baseStyle$3
|
3024
3329
|
});
|
3025
3330
|
|
3026
|
-
const {
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3331
|
+
const getProps = props => {
|
3332
|
+
const {
|
3333
|
+
isError,
|
3334
|
+
isSuccess,
|
3335
|
+
isDisabled
|
3336
|
+
} = props;
|
3337
|
+
let borderColor = 'neutral.400';
|
3338
|
+
let focusBorderColor = 'primary.500';
|
3339
|
+
if (isError) {
|
3340
|
+
borderColor = 'danger.500';
|
3341
|
+
focusBorderColor = 'danger.500';
|
3342
|
+
} else if (isSuccess) {
|
3343
|
+
borderColor = 'success.500';
|
3344
|
+
focusBorderColor = 'success.500';
|
3345
|
+
} else if (isDisabled && !isError && !isSuccess) {
|
3346
|
+
borderColor = 'neutral.400';
|
3347
|
+
focusBorderColor = 'danger.500';
|
3348
|
+
}
|
3349
|
+
return {
|
3350
|
+
focusBorderColor,
|
3351
|
+
borderColor
|
3352
|
+
};
|
3035
3353
|
};
|
3036
|
-
|
3037
|
-
const
|
3038
|
-
|
3354
|
+
const outline$1 = /*#__PURE__*/react.defineStyle(props => {
|
3355
|
+
const {
|
3356
|
+
focusBorderColor,
|
3357
|
+
borderColor
|
3358
|
+
} = getProps(props);
|
3359
|
+
return {
|
3360
|
+
background: 'white.high',
|
3361
|
+
color: 'black.high',
|
3362
|
+
borderColor,
|
3363
|
+
fontSize: 'text.sm',
|
3364
|
+
padding: 2,
|
3365
|
+
borderRadius: 'md',
|
3366
|
+
borderWidth: '1px',
|
3367
|
+
outline: 'none',
|
3368
|
+
_disabled: {
|
3369
|
+
opacity: 1,
|
3370
|
+
color: 'black.low',
|
3371
|
+
background: 'neutral.300'
|
3372
|
+
},
|
3373
|
+
_placeholder: {
|
3374
|
+
color: 'black.low'
|
3375
|
+
},
|
3039
3376
|
_hover: {
|
3040
|
-
borderColor
|
3041
|
-
boxShadow: 'none',
|
3042
|
-
outline: 'none'
|
3377
|
+
borderColor
|
3043
3378
|
},
|
3044
3379
|
_focus: {
|
3045
|
-
|
3046
|
-
|
3047
|
-
|
3380
|
+
outline: 'none',
|
3381
|
+
borderColor: focusBorderColor,
|
3382
|
+
boxShadow: 'none'
|
3048
3383
|
},
|
3049
3384
|
_focusVisible: {
|
3050
|
-
|
3051
|
-
|
3052
|
-
|
3385
|
+
outline: 'none',
|
3386
|
+
borderColor: focusBorderColor,
|
3387
|
+
boxShadow: 'none'
|
3053
3388
|
},
|
3054
3389
|
_focusWithin: {
|
3055
|
-
|
3056
|
-
|
3057
|
-
|
3390
|
+
outline: 'none',
|
3391
|
+
borderColor: focusBorderColor,
|
3392
|
+
boxShadow: 'none'
|
3393
|
+
},
|
3394
|
+
_invalid: {
|
3395
|
+
outline: 'none',
|
3396
|
+
borderColor: 'danger.500',
|
3397
|
+
boxShadow: 'none'
|
3058
3398
|
}
|
3399
|
+
};
|
3400
|
+
});
|
3401
|
+
const Textarea = /*#__PURE__*/react.defineStyleConfig({
|
3402
|
+
variants: {
|
3403
|
+
outline: outline$1
|
3404
|
+
},
|
3405
|
+
defaultProps: {
|
3406
|
+
variant: 'outline'
|
3059
3407
|
}
|
3060
|
-
};
|
3408
|
+
});
|
3061
3409
|
|
3062
3410
|
|
3063
3411
|
|
@@ -3067,9 +3415,10 @@ var components = {
|
|
3067
3415
|
Checkbox: Checkbox,
|
3068
3416
|
FormLabel: FormLabel,
|
3069
3417
|
Input: Input,
|
3418
|
+
LoaderStyle: LoaderStyle,
|
3419
|
+
Popover: Popover,
|
3070
3420
|
Radio: Radio,
|
3071
3421
|
Switch: Switch,
|
3072
|
-
Popover: Popover,
|
3073
3422
|
Textarea: Textarea
|
3074
3423
|
};
|
3075
3424
|
|
@@ -3088,7 +3437,8 @@ const theme = /*#__PURE__*/react.extendTheme({
|
|
3088
3437
|
background: 'neutral.400'
|
3089
3438
|
},
|
3090
3439
|
body: {
|
3091
|
-
fontSize: 'text.sm'
|
3440
|
+
fontSize: 'text.sm',
|
3441
|
+
color: 'black.high'
|
3092
3442
|
}
|
3093
3443
|
}
|
3094
3444
|
},
|
@@ -3365,12 +3715,14 @@ Object.defineProperty(exports, 'useTabsStyles', {
|
|
3365
3715
|
}
|
3366
3716
|
});
|
3367
3717
|
exports.BreadCrumb = BreadCrumb;
|
3718
|
+
exports.Checkbox = CheckboxComponent;
|
3368
3719
|
exports.DataTable = DataTable;
|
3369
3720
|
exports.DatePickerMonth = DatePickerMonth;
|
3370
3721
|
exports.Datepicker = Datepicker;
|
3371
3722
|
exports.Field = Field;
|
3372
3723
|
exports.Header = Header;
|
3373
3724
|
exports.InputField = InputField;
|
3725
|
+
exports.Loader = Loader;
|
3374
3726
|
exports.MainMenu = Navigation;
|
3375
3727
|
exports.ModalBody = ModalBody;
|
3376
3728
|
exports.ModalCloseButton = ModalCloseButton;
|