@ctlyst.id/internal-ui 1.0.3 → 1.0.4-canary.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
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, 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, forwardRef as forwardRef$1, Button as Button$1, VisuallyHidden, Select as Select$1, theme as theme$1, useTab, useMultiStyleConfig, TabList as TabList$1, TabPanel as TabPanel$1, Stack, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, extendTheme } from '@chakra-ui/react';
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, forwardRef as forwardRef$1, Button as Button$1, VisuallyHidden, Select as Select$1, useTab, useMultiStyleConfig, TabList as TabList$1, TabPanel as TabPanel$1, Stack, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$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
3
  import React__default, { createElement, useRef, useEffect, useState, useMemo, Fragment, forwardRef, useCallback, createContext, useContext } from 'react';
4
4
  import { FiChevronsRight, FiHome, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiChevronDown } from 'react-icons/fi';
@@ -8,6 +8,7 @@ import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@
8
8
  import classnames from 'classnames';
9
9
  import ReactDatePicker from 'react-datepicker';
10
10
  import { useColorMode } from '@chakra-ui/system';
11
+ import styled from '@emotion/styled';
11
12
  import ReactSelect from 'react-select';
12
13
  import { AsyncPaginate } from 'react-select-async-paginate';
13
14
  import ReactSelectAsyncCreatable from 'react-select/async-creatable';
@@ -1197,1042 +1198,1144 @@ Datepicker.defaultProps = {
1197
1198
  showMonth: false
1198
1199
  };
1199
1200
 
1200
- /* eslint-disable no-nested-ternary */
1201
- const Field = props => {
1202
- const {
1203
- label,
1204
- isError,
1205
- error,
1206
- helperText,
1207
- isRequired,
1208
- children
1209
- } = props;
1210
- return /*#__PURE__*/React__default.createElement(FormControl, {
1211
- isInvalid: isError
1212
- }, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
1213
- fontSize: "field.sm",
1214
- requiredIndicator: undefined
1215
- }, isRequired && /*#__PURE__*/React__default.createElement(Box, {
1216
- as: "span",
1217
- color: "red.500",
1218
- ml: 0,
1219
- mr: 1
1220
- }, "*"), label) : label), children, !isError ? helperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
1221
- fontSize: "field.sm"
1222
- }, helperText) : typeof error === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
1223
- textStyle: "field.sm",
1224
- fontSize: "field.sm",
1225
- mt: 1,
1226
- marginStart: 1
1227
- }, error) : error);
1201
+ const DatePickerMonth = ({
1202
+ onChange,
1203
+ min,
1204
+ max,
1205
+ ...props
1206
+ }) => {
1207
+ const [date, setDate] = React__default.useState(null);
1208
+ return /*#__PURE__*/React__default.createElement(Box, {
1209
+ fontSize: '12px',
1210
+ lineHeight: '18px',
1211
+ css: css`
1212
+ input[type='date']::-webkit-inner-spin-button,
1213
+ input[type='date']::-webkit-calendar-picker-indicator {
1214
+ display: none;
1215
+ -webkit-appearance: none;
1216
+ }
1217
+ input[value=''] {
1218
+ width: 58px;
1219
+ }
1220
+ `
1221
+ }, /*#__PURE__*/React__default.createElement(Input$1, {
1222
+ "data-test-id": props['data-test-id'],
1223
+ type: "date",
1224
+ width: date ? '51px' : '58px',
1225
+ onChange: e => {
1226
+ onChange(e.target.value);
1227
+ setDate(e.target.value);
1228
+ },
1229
+ p: '8px',
1230
+ min: min,
1231
+ max: max,
1232
+ required: true,
1233
+ css: css`
1234
+ border: 1px solid transparent;
1235
+
1236
+ &:focus,
1237
+ &:hover {
1238
+ border: 1px solid transparent;
1239
+ }
1240
+
1241
+ &::placeholder {
1242
+ color: #111111;
1243
+ }
1244
+ `,
1245
+ value: date !== null && date !== void 0 ? date : ''
1246
+ }));
1228
1247
  };
1229
- Field.defaultProps = {
1230
- label: '',
1231
- isError: false,
1232
- error: undefined,
1233
- helperText: undefined,
1234
- isRequired: false
1248
+ DatePickerMonth.defaultProps = {
1249
+ 'data-test-id': ''
1235
1250
  };
1236
1251
 
1237
- const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
1238
- const {
1239
- value,
1240
- type,
1241
- addOnLeft,
1242
- addOnRight,
1243
- elementLeft,
1244
- elementRight,
1245
- size,
1246
- isRequired,
1247
- label,
1248
- isError,
1249
- error,
1250
- helperText,
1251
- ...inputProps
1252
- } = props;
1253
- return /*#__PURE__*/React__default.createElement(Field, {
1254
- label: label,
1255
- isError: isError,
1256
- error: error,
1257
- helperText: helperText,
1258
- isRequired: isRequired
1259
- }, /*#__PURE__*/React__default.createElement(InputGroup, {
1260
- size: size
1261
- }, addOnLeft && /*#__PURE__*/React__default.createElement(InputLeftAddon, null, addOnLeft), elementLeft && /*#__PURE__*/React__default.createElement(InputLeftElement, null, elementLeft), /*#__PURE__*/React__default.createElement(Input$1, Object.assign({
1262
- ref: ref,
1263
- type: type,
1264
- value: value
1265
- }, inputProps)), addOnRight && /*#__PURE__*/React__default.createElement(InputRightAddon, null, addOnRight), elementRight && /*#__PURE__*/React__default.createElement(InputRightElement, null, elementRight)));
1266
- });
1267
- InputField.defaultProps = {
1268
- addOnLeft: undefined,
1269
- addOnRight: undefined,
1270
- elementLeft: undefined,
1271
- elementRight: undefined
1252
+ const transparent = 'transparent';
1253
+ const black = {
1254
+ high: '#111111',
1255
+ medium: '#707070',
1256
+ low: '#B8B8B8'
1272
1257
  };
1273
-
1274
- const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
1275
- const {
1276
- value,
1277
- ...inputProps
1278
- } = props;
1279
- return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(Textarea$1, Object.assign({
1280
- ref: ref,
1281
- value: value
1282
- }, inputProps)));
1283
- });
1284
- TextareaField.defaultProps = {
1285
- addOnLeft: undefined,
1286
- addOnRight: undefined,
1287
- elementLeft: undefined,
1288
- elementRight: undefined
1258
+ const white = {
1259
+ high: '#FFFFFF',
1260
+ medium: '#F1F1F1',
1261
+ low: '#CCCCCC'
1289
1262
  };
1290
-
1291
- const XMSLogo = () => /*#__PURE__*/React__default.createElement(Image, {
1292
- height: 8,
1293
- src: useColorModeValue('https://assets.voila.id/xms/logo-xms.jpg', 'https://assets.voila.id/xms/logo-xms-dark.png')
1294
- });
1295
- const VoilaLogo = () => /*#__PURE__*/React__default.createElement(Image, {
1296
- src: "https://s3.ap-southeast-1.amazonaws.com/assets.voila.id/xms/logo-voila-black.png?v=1",
1297
- filter: useColorModeValue('none', 'invert(1)'),
1298
- maxW: 24
1299
- });
1300
-
1301
- const Profile = ({
1302
- data,
1303
- onLogout
1304
- }) => {
1305
- var _data$name;
1306
- const {
1307
- isOpen,
1308
- onToggle,
1309
- onClose
1310
- } = useDisclosure();
1311
- return /*#__PURE__*/createElement(Popover$1, {
1312
- placement: "bottom-end",
1313
- isOpen: isOpen,
1314
- onClose: onClose
1315
- }, /*#__PURE__*/createElement(Box, {
1316
- "data-test-id": "WE0UYbA93LOZy6S09IhDO",
1317
- as: "button",
1318
- cursor: 'pointer',
1319
- minW: 0,
1320
- _hover: {
1321
- textDecor: 'none'
1322
- },
1323
- m: 0,
1324
- onClick: onToggle
1325
- }, /*#__PURE__*/createElement(HStack, null, /*#__PURE__*/createElement(VStack, {
1326
- alignItems: "flex-end",
1327
- spacing: -0.5,
1328
- ml: "2"
1329
- }, /*#__PURE__*/createElement(Text, {
1330
- fontSize: "text.xs",
1331
- mb: 1,
1332
- fontWeight: 400,
1333
- lineHeight: "14px",
1334
- color: useColorModeValue('neutral.800', 'white')
1335
- }, data === null || data === void 0 ? void 0 : data.email), /*#__PURE__*/createElement(Text, {
1336
- fontSize: "text.xs",
1337
- fontWeight: 400,
1338
- lineHeight: "14px",
1339
- color: useColorModeValue('primary.500', 'success.400')
1340
- }, (data === null || data === void 0 ? void 0 : data.office) && /*#__PURE__*/createElement(Text, {
1341
- color: "neutral.700",
1342
- display: "inline-block",
1343
- mr: 0.5
1344
- }, data.office, " |", ' '), data === null || data === void 0 ? void 0 : data.userRole)), /*#__PURE__*/createElement(PopoverTrigger, null, /*#__PURE__*/createElement(Avatar, {
1345
- size: 'sm',
1346
- bg: "primary.500",
1347
- color: "white",
1348
- name: (_data$name = data === null || data === void 0 ? void 0 : data.name) !== null && _data$name !== void 0 ? _data$name : data === null || data === void 0 ? void 0 : data.email
1349
- })))), /*#__PURE__*/createElement(PopoverContent, {
1350
- bg: useColorModeValue('white', 'mirage.900'),
1351
- maxW: 200
1352
- }, /*#__PURE__*/createElement(PopoverArrow, {
1353
- bg: useColorModeValue('white', 'mirage.900')
1354
- }), /*#__PURE__*/createElement(PopoverBody, {
1355
- p: 1
1356
- }, /*#__PURE__*/createElement(Flex, {
1357
- "data-test-id": "gA7F9pucPX_Q3_dkgXIYZ",
1358
- alignItems: "center",
1359
- px: 3,
1360
- py: 2,
1361
- borderRadius: "sm",
1362
- cursor: "pointer",
1363
- _hover: {
1364
- bg: useColorModeValue('primary.500', 'mirage.900'),
1365
- color: 'white'
1366
- },
1367
- onClick: onLogout,
1368
- fontSize: "text.xs"
1369
- }, /*#__PURE__*/createElement(FiPower, null), /*#__PURE__*/createElement(Text, {
1370
- ml: 2
1371
- }, "Logout")))));
1263
+ const neutral = {
1264
+ '50': '#FFFFFF',
1265
+ '100': '#FAFAFA',
1266
+ '200': '#F5F5F5',
1267
+ '300': '#EEEEEE',
1268
+ '400': '#E0E0E0',
1269
+ '500': '#BDBDBD',
1270
+ '600': '#999999',
1271
+ '700': '#242424',
1272
+ '800': '#181818',
1273
+ '900': '#111111'
1372
1274
  };
1373
- Profile.defaultProps = {
1374
- data: undefined,
1375
- onLogout: undefined
1275
+ const primary = {
1276
+ '50': '#DFFFF1',
1277
+ '100': '#ACF5D5',
1278
+ '200': '#5EE5A9',
1279
+ '300': '#05CB72',
1280
+ '400': '#08A45E',
1281
+ '500': '#12784A',
1282
+ '600': '#0B603A',
1283
+ '700': '#075331',
1284
+ '800': '#064126',
1285
+ '900': '#042E1B'
1376
1286
  };
1377
-
1378
- const SwitchMode = () => {
1379
- const {
1380
- colorMode,
1381
- toggleColorMode
1382
- } = useColorMode$1();
1383
- return /*#__PURE__*/createElement(Box, {
1384
- "data-test-id": "rhYuTDCiWkFqr96upiEEh",
1385
- mx: 5,
1386
- onClick: toggleColorMode,
1387
- cursor: "pointer"
1388
- }, colorMode === 'light' ? /*#__PURE__*/createElement(FiMoon, {
1389
- size: 20
1390
- }) : /*#__PURE__*/createElement(FiSun, {
1391
- size: 20
1392
- }));
1287
+ const secondary = {
1288
+ '50': '#F2F2F3',
1289
+ '100': '#DADBDD',
1290
+ '200': '#C2C4C7',
1291
+ '300': '#AAADB0',
1292
+ '400': '#93969A',
1293
+ '500': '#7B7F84',
1294
+ '600': '#62666A',
1295
+ '700': '#4A4C4F',
1296
+ '800': '#313335',
1297
+ '900': '#19191A'
1393
1298
  };
1394
-
1395
- // eslint-disable-next-line import/prefer-default-export
1396
- function environmentName(env) {
1397
- switch (env) {
1398
- case 'DEVELOPMENT':
1399
- return 'Dev';
1400
- case 'STAGING':
1401
- return 'Staging';
1402
- default:
1403
- return null;
1404
- }
1405
- }
1406
-
1407
- /* eslint-disable react-hooks/rules-of-hooks */
1408
- const Version = ({
1409
- version,
1410
- environment,
1411
- onOpenModalRelease
1412
- }) => /*#__PURE__*/createElement(Fragment, null, version && /*#__PURE__*/createElement(Badge, {
1413
- "data-test-id": "dzl3esjhCphobaaIXpiUE",
1414
- bg: useColorModeValue('primary.500', 'rgba(124, 124, 124, 0.12)'),
1415
- color: useColorModeValue('white', 'secondary.400'),
1416
- fontSize: "text.xs",
1417
- py: 1,
1418
- px: 2.5,
1419
- fontWeight: "bold",
1420
- textTransform: "lowercase",
1421
- borderRadius: "md",
1422
- onClick: onOpenModalRelease,
1423
- cursor: onOpenModalRelease ? 'pointer' : 'auto'
1424
- }, version), /*#__PURE__*/createElement(Box, {
1425
- background: "primary.50",
1426
- color: "primary.500",
1427
- fontSize: "text.xs",
1428
- py: 1,
1429
- px: 2.5,
1430
- fontWeight: "bold",
1431
- borderRadius: "md"
1432
- }, environmentName(environment)));
1433
- Version.defaultProps = {
1434
- environment: undefined,
1435
- version: undefined,
1436
- onOpenModalRelease: undefined
1299
+ const success = {
1300
+ '50': '#ECFFED',
1301
+ '100': '#D3FCD5',
1302
+ '200': '#A9F9B5',
1303
+ '300': '#7CEE98',
1304
+ '400': '#58DD86',
1305
+ '500': '#28c76f',
1306
+ '600': '#1DAB6A',
1307
+ '700': '#148F63',
1308
+ '800': '#0C7359',
1309
+ '900': '#075F51'
1437
1310
  };
1438
-
1439
- const Header = ({
1440
- data,
1441
- onLogout,
1442
- onOpenModalRelease,
1443
- ...props
1444
- }) => /*#__PURE__*/createElement(Box, Object.assign({
1445
- minH: 14,
1446
- bg: useColorModeValue('white', 'ebony-clay.800'),
1447
- boxShadow: "0 4px 20px 0 rgb(0 0 0 / 5%)",
1448
- px: 4,
1449
- py: 1
1450
- }, props), /*#__PURE__*/createElement(Flex, {
1451
- h: 14,
1452
- alignItems: "center",
1453
- justifyContent: "space-between"
1454
- }, /*#__PURE__*/createElement(XMSLogo, null), /*#__PURE__*/createElement(HStack, {
1455
- spacing: 2,
1456
- alignItems: "center"
1457
- }, /*#__PURE__*/createElement(VoilaLogo, null), /*#__PURE__*/createElement(Version, {
1458
- version: data === null || data === void 0 ? void 0 : data.version,
1459
- environment: data === null || data === void 0 ? void 0 : data.environment,
1460
- onOpenModalRelease: onOpenModalRelease
1461
- })), /*#__PURE__*/createElement(Flex, {
1462
- alignItems: "center"
1463
- }, /*#__PURE__*/createElement(SwitchMode, null), /*#__PURE__*/createElement(Profile, {
1464
- data: data,
1465
- onLogout: onLogout
1466
- }))));
1467
- Header.defaultProps = {
1468
- data: undefined,
1469
- onLogout: undefined,
1470
- onOpenModalRelease: undefined
1311
+ const danger = {
1312
+ '50': '#FFEDEC',
1313
+ '100': '#FFC7C2',
1314
+ '200': '#FF8279',
1315
+ '300': '#FF5B4F',
1316
+ '400': '#F44336',
1317
+ '500': '#D82F23',
1318
+ '600': '#B71C1C',
1319
+ '700': '#930B0B',
1320
+ '800': '#660909',
1321
+ '900': '#3E0707'
1322
+ };
1323
+ const warning = {
1324
+ '50': '#FFF9EC',
1325
+ '100': '#FFEFCC',
1326
+ '200': '#FFD591',
1327
+ '300': '#FFC069',
1328
+ '400': '#FFA230',
1329
+ '500': '#F68522',
1330
+ '600': '#EF6C00',
1331
+ '700': '#C65B03',
1332
+ '800': '#9F4901',
1333
+ '900': '#652E00'
1334
+ };
1335
+ const info = {
1336
+ '50': '#EBFFFB',
1337
+ '100': '#CBFDF2',
1338
+ '200': '#97FCEF',
1339
+ '300': '#63F8F0',
1340
+ '400': '#3CECF1',
1341
+ '500': '#00CFE8',
1342
+ '600': '#00A1C7',
1343
+ '700': '#007AA7',
1344
+ '800': '#005786',
1345
+ '900': '#003F6F'
1346
+ };
1347
+ const dark = {
1348
+ '50': '#F2F2F2',
1349
+ '100': '#DBDBDB',
1350
+ '200': '#C4C4C4',
1351
+ '300': '#ADADAD',
1352
+ '400': '#969696',
1353
+ '500': '#808080',
1354
+ '600': '#666666',
1355
+ '700': '#4D4D4D',
1356
+ '800': '#333333',
1357
+ '900': '#1A1A1A'
1358
+ };
1359
+ const mirage = {
1360
+ '50': '#EDF0F7',
1361
+ '100': '#CED5E9',
1362
+ '200': '#AEBADB',
1363
+ '300': '#8E9ECC',
1364
+ '400': '#6F83BE',
1365
+ '500': '#4F68B0',
1366
+ '600': '#3F538D',
1367
+ '700': '#2F3E6A',
1368
+ '800': '#202A46',
1369
+ '900': '#101523'
1370
+ };
1371
+ const ebonyClay = {
1372
+ '50': '#EFF1F6',
1373
+ '100': '#D2D7E5',
1374
+ '200': '#B4BDD4',
1375
+ '300': '#97A3C4',
1376
+ '400': '#7A89B3',
1377
+ '500': '#5D6FA2',
1378
+ '600': '#4A5982',
1379
+ '700': '#384361',
1380
+ '800': '#252D41',
1381
+ '900': '#131620'
1382
+ };
1383
+ const brightGray = {
1384
+ '50': '#F0F1F4',
1385
+ '100': '#D5D9E1',
1386
+ '200': '#BAC0CE',
1387
+ '300': '#A0A8BB',
1388
+ '400': '#858FA8',
1389
+ '500': '#6A7795',
1390
+ '600': '#555F77',
1391
+ '700': '#404759',
1392
+ '800': '#2A2F3C',
1393
+ '900': '#15181E'
1394
+ };
1395
+ const doveGray = {
1396
+ '50': '#F2F2F2',
1397
+ '100': '#DBDBDB',
1398
+ '200': '#C4C4C4',
1399
+ '300': '#ADADAD',
1400
+ '400': '#969696',
1401
+ '500': '#808080',
1402
+ '600': '#666666',
1403
+ '700': '#4D4D4D',
1404
+ '800': '#333333',
1405
+ '900': '#1A1A1A'
1406
+ };
1407
+ const colors = {
1408
+ transparent,
1409
+ black,
1410
+ white,
1411
+ neutral,
1412
+ primary,
1413
+ secondary,
1414
+ success,
1415
+ danger,
1416
+ warning,
1417
+ info,
1418
+ dark,
1419
+ mirage,
1420
+ 'ebony-clay': ebonyClay,
1421
+ 'bright-gray': brightGray,
1422
+ 'dove-gray': doveGray
1471
1423
  };
1472
1424
 
1473
- const ModalBody = /*#__PURE__*/React__default.forwardRef(({
1474
- children,
1475
- ...rest
1476
- }, ref) => {
1477
- return /*#__PURE__*/React__default.createElement(ModalBody$1, Object.assign({
1478
- ref: ref,
1479
- background: useColorModeValue('white', 'mirage.900')
1480
- }, rest), children);
1481
- });
1482
-
1483
- const ModalCloseButton = /*#__PURE__*/forwardRef((props, ref) => {
1484
- return /*#__PURE__*/React__default.createElement(ModalCloseButton$1, Object.assign({
1485
- ref: ref,
1486
- top: 4,
1487
- right: 4,
1488
- size: "sm",
1489
- background: useColorModeValue('neutral.50', 'mirage.900')
1490
- }, props));
1491
- });
1425
+ const radius = {
1426
+ none: 0,
1427
+ sm: '2px',
1428
+ md: '4px',
1429
+ lg: '8px',
1430
+ full: '9999px'
1431
+ };
1492
1432
 
1493
- const ModalFooter = /*#__PURE__*/forwardRef(({
1494
- children,
1495
- ...rest
1496
- }, ref) => {
1497
- return /*#__PURE__*/React__default.createElement(ModalFooter$1, Object.assign({
1498
- ref: ref,
1499
- background: useColorModeValue('neutral.200', 'mirage.900'),
1500
- borderBottomRadius: "md"
1501
- }, rest), children);
1502
- });
1433
+ const spacing = {
1434
+ ...theme$1.space,
1435
+ 4.5: '1.125rem',
1436
+ 9.5: '2.375rem',
1437
+ 18: '4.5rem',
1438
+ 22: '5.5rem',
1439
+ 26: '6.5rem',
1440
+ 30: '7.5rem'
1441
+ };
1503
1442
 
1504
- const ModalHeader = /*#__PURE__*/forwardRef(({
1505
- children,
1506
- ...rest
1507
- }, ref) => {
1508
- return /*#__PURE__*/React__default.createElement(ModalHeader$1, Object.assign({
1509
- ref: ref,
1510
- background: useColorModeValue('neutral.200', 'mirage.900'),
1511
- borderTopRadius: 'md',
1512
- fontSize: 'lg'
1513
- }, rest), children);
1514
- });
1443
+ const sizes = {
1444
+ ...theme$1.sizes,
1445
+ 4.5: '1.125rem',
1446
+ 9.5: '2.375rem',
1447
+ 18: '4.5rem',
1448
+ 22: '5.5rem',
1449
+ 26: '6.5rem',
1450
+ 30: '7.5rem'
1451
+ };
1515
1452
 
1516
- /* eslint-disable react-hooks/rules-of-hooks */
1517
- const Navigation = ({
1518
- navigations,
1519
- activePath,
1520
- as,
1521
- ...props
1522
- }) => {
1523
- return /*#__PURE__*/createElement(Box, Object.assign({
1524
- bg: useColorModeValue('white', 'ebony-clay.800'),
1525
- boxShadow: "0 4px 20px 0 rgb(0 0 0 / 5%)",
1526
- borderRadius: "md",
1527
- overflowX: "auto"
1528
- }, props), /*#__PURE__*/createElement(Flex, {
1529
- alignItems: "center",
1530
- p: 2
1531
- }, /*#__PURE__*/createElement(HStack, {
1532
- spacing: 2
1533
- }, navigations === null || navigations === void 0 ? void 0 : navigations.map(navigation => {
1534
- const isActive = activePath.startsWith(navigation.navLink || '');
1535
- const activeBg = isActive ? 'primary.500' : undefined;
1536
- return /*#__PURE__*/createElement(Popover$1, {
1537
- key: navigation.title,
1538
- trigger: "hover",
1539
- placement: "bottom-start"
1540
- }, ({
1541
- isOpen
1542
- }) => /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(PopoverTrigger, null, /*#__PURE__*/createElement(Box, {
1543
- display: "flex",
1544
- alignItems: "center",
1545
- borderRadius: "md",
1546
- cursor: "pointer",
1547
- _hover: {
1548
- backgroundColor: !isActive ? useColorModeValue('dove-gray.50', 'transparent') : activeBg
1549
- },
1550
- backgroundColor: isOpen && !isActive ? useColorModeValue('dove-gray.50', 'transparent') : activeBg,
1551
- color: isActive ? 'white' : 'inherit',
1552
- p: 2
1553
- }, /*#__PURE__*/createElement(Icon, {
1554
- as: navigation.icon,
1555
- mr: 2
1556
- }), /*#__PURE__*/createElement(Text, {
1557
- whiteSpace: "nowrap",
1558
- fontSize: "text.sm",
1559
- fontWeight: 400
1560
- }, navigation.title), /*#__PURE__*/createElement(ChevronDownIcon, {
1561
- ml: 2
1562
- }))), navigation.children && /*#__PURE__*/createElement(Portal, null, /*#__PURE__*/createElement(Box, {
1563
- zIndex: "popover"
1564
- }, /*#__PURE__*/createElement(PopoverContent, {
1565
- key: navigation.title,
1566
- bg: useColorModeValue('white', 'ebony-clay.800'),
1567
- maxW: 250,
1568
- border: "none",
1569
- borderRadius: "md",
1570
- boxShadow: "0 5px 25px rgb(0 0 0 / 10%)"
1571
- }, navigation.children.map(({
1572
- title,
1573
- navHost,
1574
- navLink,
1575
- icon
1576
- }) => {
1577
- const link = navHost ? `${navHost}${navLink}` : navLink;
1578
- const isActiveSub = activePath === navLink;
1579
- return /*#__PURE__*/createElement(Link, {
1580
- as: as,
1581
- key: title,
1582
- display: "flex",
1583
- position: "relative",
1584
- alignItems: "center",
1585
- transition: "padding 0.35s ease 0s",
1586
- _hover: {
1587
- backgroundColor: useColorModeValue('dove-gray.50', 'mirage.900'),
1588
- color: useColorModeValue('primary.500', 'dove-gray.600'),
1589
- px: 5,
1590
- py: 4,
1591
- _first: {
1592
- borderTopRadius: 'md'
1593
- },
1594
- _last: {
1595
- borderBottomRadius: 'md'
1596
- }
1597
- },
1598
- px: 6,
1599
- py: 4,
1600
- href: link,
1601
- color: isActiveSub ? 'primary.500' : 'inherit',
1602
- css: css`
1603
- border-spacing: 4px;
1604
- `
1605
- }, /*#__PURE__*/createElement(Icon, {
1606
- as: icon,
1607
- mr: 3
1608
- }), /*#__PURE__*/createElement(Text, {
1609
- fontSize: "text.sm"
1610
- }, title), isActiveSub && /*#__PURE__*/createElement(Box, {
1611
- width: 0.5,
1612
- height: 8,
1613
- position: "absolute",
1614
- bg: "primary.500",
1615
- right: 0,
1616
- zIndex: "popover"
1617
- }));
1618
- }))))));
1619
- }))));
1453
+ const fonts = {
1454
+ heading: `'Poppins', sans-serif`,
1455
+ body: `'Poppins', sans-serif`
1620
1456
  };
1621
- Navigation.defaultProps = {
1622
- navigations: undefined,
1623
- as: 'a'
1457
+ const fontWeights = {
1458
+ hairline: 100,
1459
+ thin: 200,
1460
+ light: 300,
1461
+ normal: 400,
1462
+ medium: 500,
1463
+ semibold: 600,
1464
+ bold: 700,
1465
+ extrabold: 800,
1466
+ black: 900
1624
1467
  };
1625
-
1626
- const PaginationButton = /*#__PURE__*/forwardRef$1(({
1627
- className,
1628
- style,
1629
- isActive,
1630
- children,
1631
- ...rest
1632
- }, ref) => {
1633
- const btnBg = useColorModeValue('neutral.300', 'mirage.900');
1634
- const btnColor = useColorModeValue('black.high', 'primary.300');
1635
- const btnNotActiveBg = useColorModeValue('secondary.50', 'primary.500');
1636
- const btnNotActiveColor = useColorModeValue('primary.500', 'white');
1637
- return /*#__PURE__*/React__default.createElement(Button$1, Object.assign({
1638
- "data-test-id": "Pagination-Button",
1639
- ref: ref,
1640
- className: className,
1641
- style: style,
1642
- borderRadius: 50,
1643
- fontWeight: 700,
1644
- m: 0,
1645
- px: 3,
1646
- py: 2,
1647
- h: 8,
1648
- minW: "auto",
1649
- background: isActive ? 'primary.500' : btnBg,
1650
- color: isActive ? 'white' : btnColor,
1651
- _hover: !isActive ? {
1652
- background: btnNotActiveBg,
1653
- color: btnNotActiveColor
1654
- } : {},
1655
- _disabled: {
1656
- background: useColorModeValue('neutral.300', 'mirage.900'),
1657
- color: 'neutral.600',
1658
- pointerEvents: 'none'
1659
- }
1660
- }, rest), children);
1661
- });
1662
- PaginationButton.displayName = 'PaginationButton';
1663
- PaginationButton.defaultProps = {
1664
- isActive: undefined
1468
+ const lineHeights = {
1469
+ normal: 'normal',
1470
+ none: 1,
1471
+ shorter: 1.25,
1472
+ short: 1.375,
1473
+ base: 1.5,
1474
+ tall: 1.625,
1475
+ 34: '2.125rem',
1476
+ 32: '2rem',
1477
+ 30: '1.875rem',
1478
+ 28: '1.75',
1479
+ 26: '1.625rem',
1480
+ 24: '1.5rem',
1481
+ 22: '1.375rem',
1482
+ 20: '1.25rem',
1483
+ 18: '1.125rem',
1484
+ 16: '1rem',
1485
+ 14: '0.875rem',
1486
+ 12: '0.75rem'
1665
1487
  };
1666
-
1667
- const PaginationButtonTrigger = ({
1668
- color,
1669
- isDisabled,
1670
- onClick,
1671
- visuallyHidden,
1672
- icon
1673
- }) => /*#__PURE__*/createElement(PaginationButton, {
1674
- "data-test-id": "DLVCc_fBK35spHm5WxjcJ",
1675
- color: color,
1676
- isDisabled: isDisabled,
1677
- onClick: onClick
1678
- }, /*#__PURE__*/createElement(VisuallyHidden, null, visuallyHidden), icon);
1679
- PaginationButtonTrigger.defaultProps = {
1680
- color: undefined,
1681
- isDisabled: undefined,
1682
- onClick: undefined,
1683
- visuallyHidden: undefined,
1684
- icon: undefined
1488
+ const fontSizes = {
1489
+ heading: {
1490
+ 1: '1.75rem',
1491
+ 2: '1.5rem',
1492
+ 3: '1.25rem',
1493
+ 4: '1.125rem',
1494
+ 5: '1rem',
1495
+ 6: '0.875rem'
1496
+ },
1497
+ text: {
1498
+ xl: '1.125rem',
1499
+ lg: '1rem',
1500
+ md: '0.875rem',
1501
+ sm: '0.75rem',
1502
+ xs: '0.625rem'
1503
+ },
1504
+ button: {
1505
+ lg: '1.125rem',
1506
+ md: '0.875rem',
1507
+ sm: '0.625rem'
1508
+ },
1509
+ field: {
1510
+ lg: '1rem',
1511
+ md: '0.875rem',
1512
+ sm: '0.75rem'
1513
+ },
1514
+ table: {
1515
+ header: '0.75rem'
1516
+ }
1685
1517
  };
1686
-
1687
- const Pagination = ({
1688
- className,
1689
- current,
1690
- total,
1691
- onSelect
1692
- }) => {
1693
- const btnColorDisabled = useColorModeValue('secondary.100', 'primary.500');
1694
- const btnColor = useColorModeValue('primary.500', 'secondary.100');
1695
- const disabledPrevious = current === 1;
1696
- const previousButtonColor = disabledPrevious ? btnColorDisabled : btnColor;
1697
- const disabledNext = current === total;
1698
- const nextButtonColor = disabledNext ? btnColorDisabled : btnColor;
1699
- const handleSelectPage = page => {
1700
- if (onSelect) {
1701
- onSelect(page);
1702
- }
1703
- };
1704
- const generatePages = () => {
1705
- const maxButtons = 5;
1706
- const pageButtons = [];
1707
- let startPage;
1708
- let endPage;
1709
- if ( maxButtons < total) {
1710
- startPage = Math.max(Math.min(current - Math.floor(maxButtons / 2), total - maxButtons + 1), 1);
1711
- endPage = startPage + maxButtons - 1;
1712
- } else {
1713
- startPage = 1;
1714
- endPage = total;
1715
- }
1716
- // eslint-disable-next-line no-plusplus
1717
- for (let page = startPage; page <= endPage; ++page) {
1718
- pageButtons.push(page);
1719
- }
1720
- return pageButtons;
1721
- };
1722
- return /*#__PURE__*/createElement(Box, {
1723
- className: className,
1724
- display: "inline-flex",
1725
- alignItems: "center"
1726
- }, /*#__PURE__*/createElement(Box, {
1727
- mr: 1
1728
- }, /*#__PURE__*/createElement(PaginationButtonTrigger, {
1729
- "data-test-id": "Pagination-Button",
1730
- color: previousButtonColor,
1731
- isDisabled: disabledPrevious,
1732
- onClick: () => handleSelectPage(1),
1733
- visuallyHidden: "First Page",
1734
- icon: /*#__PURE__*/createElement(ArrowLeftIcon, {
1735
- width: 2
1736
- })
1737
- })), /*#__PURE__*/createElement(Box, {
1738
- backgroundColor: useColorModeValue('neutral.300', 'mirage.900'),
1739
- borderRadius: 50
1740
- }, /*#__PURE__*/createElement(PaginationButtonTrigger, {
1741
- "data-test-id": "Pagination-Button",
1742
- color: previousButtonColor,
1743
- isDisabled: disabledPrevious,
1744
- onClick: () => handleSelectPage(current - 1),
1745
- visuallyHidden: "Previous Page",
1746
- icon: /*#__PURE__*/createElement(ChevronLeftIcon, null)
1747
- }), generatePages().map(page => {
1748
- return /*#__PURE__*/createElement(PaginationButton, {
1749
- "data-test-id": "Pagination-Button",
1750
- key: page,
1751
- isActive: page === current,
1752
- onClick: () => typeof page === 'number' ? handleSelectPage(page) : null
1753
- }, /*#__PURE__*/createElement(Text, {
1754
- scale: 300,
1755
- fontSize: "text.sm",
1756
- lineHeight: 18,
1757
- fontWeight: 500
1758
- }, page));
1759
- }), /*#__PURE__*/createElement(PaginationButtonTrigger, {
1760
- "data-test-id": "Pagination-Button",
1761
- color: nextButtonColor,
1762
- isDisabled: disabledNext,
1763
- onClick: () => handleSelectPage(current + 1),
1764
- visuallyHidden: "Next Page",
1765
- icon: /*#__PURE__*/createElement(ChevronRightIcon, null)
1766
- })), /*#__PURE__*/createElement(Box, {
1767
- ml: 1
1768
- }, /*#__PURE__*/createElement(PaginationButtonTrigger, {
1769
- "data-test-id": "Pagination-Button",
1770
- color: nextButtonColor,
1771
- isDisabled: disabledNext,
1772
- onClick: () => handleSelectPage(total),
1773
- visuallyHidden: "Last Page",
1774
- icon: /*#__PURE__*/createElement(ArrowRightIcon, {
1775
- width: 2
1776
- })
1777
- })));
1518
+ const heading = {
1519
+ 1: {
1520
+ fontSize: fontSizes.heading[1],
1521
+ fontWeight: 'bold',
1522
+ lineHeight: '3.5rem',
1523
+ letterSpacing: '0'
1524
+ },
1525
+ 2: {
1526
+ fontSize: fontSizes.heading[2],
1527
+ fontWeight: 'bold',
1528
+ lineHeight: '2.875rem',
1529
+ letterSpacing: '0'
1530
+ },
1531
+ 3: {
1532
+ fontSize: fontSizes.heading[3],
1533
+ fontWeight: 'bold',
1534
+ lineHeight: '2.5rem',
1535
+ letterSpacing: '0'
1536
+ },
1537
+ 4: {
1538
+ fontSize: fontSizes.heading[4],
1539
+ fontWeight: 'bold',
1540
+ lineHeight: '2rem',
1541
+ letterSpacing: '0'
1542
+ },
1543
+ 5: {
1544
+ fontSize: fontSizes.heading[5],
1545
+ fontWeight: 'bold',
1546
+ lineHeight: '1.5rem',
1547
+ letterSpacing: '0'
1548
+ },
1549
+ 6: {
1550
+ fontSize: fontSizes.heading[6],
1551
+ fontWeight: 'bold',
1552
+ lineHeight: '1.375rem',
1553
+ letterSpacing: '0'
1554
+ }
1778
1555
  };
1779
- Pagination.defaultProps = {
1780
- className: undefined,
1781
- onSelect: undefined
1556
+ const text = {
1557
+ xl: {
1558
+ fontSize: fontSizes.text.xl,
1559
+ lineHeight: lineHeights[28],
1560
+ letterSpacing: '0'
1561
+ },
1562
+ lg: {
1563
+ fontSize: fontSizes.text.lg,
1564
+ lineHeight: lineHeights[24],
1565
+ letterSpacing: '0'
1566
+ },
1567
+ md: {
1568
+ fontSize: fontSizes.text.md,
1569
+ lineHeight: lineHeights[22],
1570
+ letterSpacing: '0'
1571
+ },
1572
+ sm: {
1573
+ fontSize: fontSizes.text.sm,
1574
+ lineHeight: lineHeights[18],
1575
+ letterSpacing: '0'
1576
+ },
1577
+ xs: {
1578
+ fontSize: fontSizes.text.xs,
1579
+ lineHeight: lineHeights[14],
1580
+ letterSpacing: '0'
1581
+ }
1582
+ };
1583
+ const button = {
1584
+ lg: {
1585
+ fontSize: fontSizes.button.lg,
1586
+ lineHeight: lineHeights[28],
1587
+ letterSpacing: '0',
1588
+ fontWeight: fontWeights.normal
1589
+ },
1590
+ md: {
1591
+ fontSize: fontSizes.button.md,
1592
+ lineHeight: lineHeights[22],
1593
+ letterSpacing: '0',
1594
+ fontWeight: fontWeights.normal
1595
+ },
1596
+ sm: {
1597
+ fontSize: fontSizes.button.sm,
1598
+ lineHeight: lineHeights[14],
1599
+ letterSpacing: '0',
1600
+ fontWeight: fontWeights.normal
1601
+ }
1602
+ };
1603
+ const field = {
1604
+ lg: {
1605
+ fontSize: fontSizes.field.lg,
1606
+ lineHeight: lineHeights[24],
1607
+ letterSpacing: '0',
1608
+ fontWeight: fontWeights.normal
1609
+ },
1610
+ md: {
1611
+ fontSize: fontSizes.field.md,
1612
+ lineHeight: lineHeights[22],
1613
+ letterSpacing: '0',
1614
+ fontWeight: fontWeights.normal
1615
+ },
1616
+ sm: {
1617
+ fontSize: fontSizes.field.sm,
1618
+ lineHeight: lineHeights[18],
1619
+ letterSpacing: '0',
1620
+ fontWeight: fontWeights.normal
1621
+ }
1622
+ };
1623
+ const textStyles = {
1624
+ heading,
1625
+ text,
1626
+ button,
1627
+ field
1782
1628
  };
1783
- Pagination.displayName = 'Pagination';
1784
1629
 
1785
- const PaginationDetail = ({
1786
- page,
1787
- limit,
1788
- length,
1789
- scale = 300,
1790
- fontSize = 'xs',
1791
- lineHeight = 18,
1792
- ...rest
1793
- }) => {
1794
- return /*#__PURE__*/createElement(Text, Object.assign({
1795
- scale: scale,
1796
- fontSize: fontSize,
1797
- lineHeight: lineHeight
1798
- }, rest), `${(page - 1) * limit + 1}-${limit * page < length ? limit * page : length} dari ${length} item`);
1630
+
1631
+
1632
+ var foundations = {
1633
+ __proto__: null,
1634
+ colors: colors,
1635
+ radii: radius,
1636
+ space: spacing,
1637
+ sizes: sizes,
1638
+ fonts: fonts,
1639
+ fontSizes: fontSizes,
1640
+ lineHeights: lineHeights,
1641
+ textStyles: textStyles
1799
1642
  };
1800
1643
 
1801
- const PaginationFilter = ({
1802
- limit,
1803
- label = 'Baris per halaman:',
1804
- items,
1644
+ const MultiDateWrapper = /*#__PURE__*/styled(Box)`
1645
+ display: flex;
1646
+ align-items: center;
1647
+ width: fit-content;
1648
+ border: 1px solid;
1649
+ box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
1650
+ border-radius: 4px;
1651
+ border-color: ${({
1652
+ isError
1653
+ }) => isError ? `${colors.danger[500]}` : `${colors.primary[500]}`};
1654
+ `;
1655
+ const MultiDatePickerMonth = ({
1805
1656
  onChange,
1806
- ...rest
1657
+ isError = false,
1658
+ min = '2020-01-01',
1659
+ max = '2020-12-31'
1807
1660
  }) => {
1808
- const [value, setValue] = useState(limit);
1809
- return /*#__PURE__*/createElement(Box, {
1810
- display: "flex",
1811
- flexDirection: "row",
1812
- alignItems: "center"
1813
- }, /*#__PURE__*/createElement(Text, Object.assign({
1814
- fontSize: "text.sm",
1815
- lineHeight: 18,
1816
- color: useColorModeValue('neutral.900', 'white')
1817
- }, rest), label), /*#__PURE__*/createElement(Select$1, {
1818
- textAlign: "center",
1819
- size: "xs",
1820
- outline: "none",
1821
- border: "none",
1822
- boxShadow: "none",
1823
- width: 18,
1824
- icon: /*#__PURE__*/createElement(FiChevronDown, null),
1825
- _focusVisible: {
1826
- boxShadow: 'none'
1661
+ const [date, setDate] = React__default.useState([null, null]);
1662
+ return /*#__PURE__*/React__default.createElement(MultiDateWrapper, {
1663
+ isError: isError
1664
+ }, /*#__PURE__*/React__default.createElement(DatePickerMonth, {
1665
+ "data-test-id": "CT_DatePickerMonth_StartDate",
1666
+ onChange: val => {
1667
+ onChange(val, date[1]);
1668
+ setDate([val, date[1]]);
1827
1669
  },
1828
- onChange: e => {
1829
- const numberValue = Number(e.target.value);
1830
- onChange(numberValue);
1831
- setValue(numberValue);
1670
+ min: min,
1671
+ max: max
1672
+ }), /*#__PURE__*/React__default.createElement(Box, null, "-"), /*#__PURE__*/React__default.createElement(DatePickerMonth, {
1673
+ "data-test-id": "CT_DatePickerMonth_EndDate",
1674
+ onChange: val => {
1675
+ onChange(date[0], val);
1676
+ setDate([date[0], val]);
1832
1677
  },
1833
- value: value
1834
- }, items.map(item => {
1835
- return /*#__PURE__*/createElement("option", {
1836
- key: item,
1837
- value: item
1838
- }, item);
1839
- })));
1678
+ min: min,
1679
+ max: max
1680
+ }));
1840
1681
  };
1841
- PaginationFilter.defaultProps = {
1842
- limit: 10,
1843
- label: undefined
1682
+ MultiDatePickerMonth.defaultProps = {
1683
+ min: '2020-01-01',
1684
+ max: '2020-12-31',
1685
+ isError: false
1844
1686
  };
1845
1687
 
1846
- const transparent = 'transparent';
1847
- const black = {
1848
- high: '#111111',
1849
- medium: '#707070',
1850
- low: '#B8B8B8'
1851
- };
1852
- const white = {
1853
- high: '#FFFFFF',
1854
- medium: '#F1F1F1',
1855
- low: '#CCCCCC'
1856
- };
1857
- const neutral = {
1858
- '50': '#FFFFFF',
1859
- '100': '#FAFAFA',
1860
- '200': '#F5F5F5',
1861
- '300': '#EEEEEE',
1862
- '400': '#E0E0E0',
1863
- '500': '#BDBDBD',
1864
- '600': '#999999',
1865
- '700': '#242424',
1866
- '800': '#181818',
1867
- '900': '#111111'
1868
- };
1869
- const primary = {
1870
- '50': '#DFFFF1',
1871
- '100': '#ACF5D5',
1872
- '200': '#5EE5A9',
1873
- '300': '#05CB72',
1874
- '400': '#08A45E',
1875
- '500': '#12784A',
1876
- '600': '#0B603A',
1877
- '700': '#075331',
1878
- '800': '#064126',
1879
- '900': '#042E1B'
1880
- };
1881
- const secondary = {
1882
- '50': '#F2F2F3',
1883
- '100': '#DADBDD',
1884
- '200': '#C2C4C7',
1885
- '300': '#AAADB0',
1886
- '400': '#93969A',
1887
- '500': '#7B7F84',
1888
- '600': '#62666A',
1889
- '700': '#4A4C4F',
1890
- '800': '#313335',
1891
- '900': '#19191A'
1892
- };
1893
- const success = {
1894
- '50': '#ECFFED',
1895
- '100': '#D3FCD5',
1896
- '200': '#A9F9B5',
1897
- '300': '#7CEE98',
1898
- '400': '#58DD86',
1899
- '500': '#28c76f',
1900
- '600': '#1DAB6A',
1901
- '700': '#148F63',
1902
- '800': '#0C7359',
1903
- '900': '#075F51'
1904
- };
1905
- const danger = {
1906
- '50': '#FFEDEC',
1907
- '100': '#FFC7C2',
1908
- '200': '#FF8279',
1909
- '300': '#FF5B4F',
1910
- '400': '#F44336',
1911
- '500': '#D82F23',
1912
- '600': '#B71C1C',
1913
- '700': '#930B0B',
1914
- '800': '#660909',
1915
- '900': '#3E0707'
1916
- };
1917
- const warning = {
1918
- '50': '#FFF9EC',
1919
- '100': '#FFEFCC',
1920
- '200': '#FFD591',
1921
- '300': '#FFC069',
1922
- '400': '#FFA230',
1923
- '500': '#F68522',
1924
- '600': '#EF6C00',
1925
- '700': '#C65B03',
1926
- '800': '#9F4901',
1927
- '900': '#652E00'
1928
- };
1929
- const info = {
1930
- '50': '#EBFFFB',
1931
- '100': '#CBFDF2',
1932
- '200': '#97FCEF',
1933
- '300': '#63F8F0',
1934
- '400': '#3CECF1',
1935
- '500': '#00CFE8',
1936
- '600': '#00A1C7',
1937
- '700': '#007AA7',
1938
- '800': '#005786',
1939
- '900': '#003F6F'
1940
- };
1941
- const dark = {
1942
- '50': '#F2F2F2',
1943
- '100': '#DBDBDB',
1944
- '200': '#C4C4C4',
1945
- '300': '#ADADAD',
1946
- '400': '#969696',
1947
- '500': '#808080',
1948
- '600': '#666666',
1949
- '700': '#4D4D4D',
1950
- '800': '#333333',
1951
- '900': '#1A1A1A'
1952
- };
1953
- const mirage = {
1954
- '50': '#EDF0F7',
1955
- '100': '#CED5E9',
1956
- '200': '#AEBADB',
1957
- '300': '#8E9ECC',
1958
- '400': '#6F83BE',
1959
- '500': '#4F68B0',
1960
- '600': '#3F538D',
1961
- '700': '#2F3E6A',
1962
- '800': '#202A46',
1963
- '900': '#101523'
1964
- };
1965
- const ebonyClay = {
1966
- '50': '#EFF1F6',
1967
- '100': '#D2D7E5',
1968
- '200': '#B4BDD4',
1969
- '300': '#97A3C4',
1970
- '400': '#7A89B3',
1971
- '500': '#5D6FA2',
1972
- '600': '#4A5982',
1973
- '700': '#384361',
1974
- '800': '#252D41',
1975
- '900': '#131620'
1976
- };
1977
- const brightGray = {
1978
- '50': '#F0F1F4',
1979
- '100': '#D5D9E1',
1980
- '200': '#BAC0CE',
1981
- '300': '#A0A8BB',
1982
- '400': '#858FA8',
1983
- '500': '#6A7795',
1984
- '600': '#555F77',
1985
- '700': '#404759',
1986
- '800': '#2A2F3C',
1987
- '900': '#15181E'
1988
- };
1989
- const doveGray = {
1990
- '50': '#F2F2F2',
1991
- '100': '#DBDBDB',
1992
- '200': '#C4C4C4',
1993
- '300': '#ADADAD',
1994
- '400': '#969696',
1995
- '500': '#808080',
1996
- '600': '#666666',
1997
- '700': '#4D4D4D',
1998
- '800': '#333333',
1999
- '900': '#1A1A1A'
2000
- };
2001
- const colors = {
2002
- transparent,
2003
- black,
2004
- white,
2005
- neutral,
2006
- primary,
2007
- secondary,
2008
- success,
2009
- danger,
2010
- warning,
2011
- info,
2012
- dark,
2013
- mirage,
2014
- 'ebony-clay': ebonyClay,
2015
- 'bright-gray': brightGray,
2016
- 'dove-gray': doveGray
1688
+ /* eslint-disable no-nested-ternary */
1689
+ const Field = props => {
1690
+ const {
1691
+ label,
1692
+ isError,
1693
+ error,
1694
+ helperText,
1695
+ isRequired,
1696
+ children
1697
+ } = props;
1698
+ return /*#__PURE__*/React__default.createElement(FormControl, {
1699
+ isInvalid: isError
1700
+ }, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
1701
+ fontSize: "field.sm",
1702
+ requiredIndicator: undefined
1703
+ }, isRequired && /*#__PURE__*/React__default.createElement(Box, {
1704
+ as: "span",
1705
+ color: "red.500",
1706
+ ml: 0,
1707
+ mr: 1
1708
+ }, "*"), label) : label), children, !isError ? helperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
1709
+ fontSize: "field.sm"
1710
+ }, helperText) : typeof error === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
1711
+ textStyle: "field.sm",
1712
+ fontSize: "field.sm",
1713
+ mt: 1,
1714
+ marginStart: 1
1715
+ }, error) : error);
2017
1716
  };
2018
-
2019
- const radius = {
2020
- none: 0,
2021
- sm: '2px',
2022
- md: '4px',
2023
- lg: '8px',
2024
- full: '9999px'
1717
+ Field.defaultProps = {
1718
+ label: '',
1719
+ isError: false,
1720
+ error: undefined,
1721
+ helperText: undefined,
1722
+ isRequired: false
2025
1723
  };
2026
1724
 
2027
- const spacing = {
2028
- ...theme$1.space,
2029
- 4.5: '1.125rem',
2030
- 9.5: '2.375rem',
2031
- 18: '4.5rem',
2032
- 22: '5.5rem',
2033
- 26: '6.5rem',
2034
- 30: '7.5rem'
1725
+ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
1726
+ const {
1727
+ value,
1728
+ type,
1729
+ addOnLeft,
1730
+ addOnRight,
1731
+ elementLeft,
1732
+ elementRight,
1733
+ size,
1734
+ isRequired,
1735
+ label,
1736
+ isError,
1737
+ error,
1738
+ helperText,
1739
+ ...inputProps
1740
+ } = props;
1741
+ return /*#__PURE__*/React__default.createElement(Field, {
1742
+ label: label,
1743
+ isError: isError,
1744
+ error: error,
1745
+ helperText: helperText,
1746
+ isRequired: isRequired
1747
+ }, /*#__PURE__*/React__default.createElement(InputGroup, {
1748
+ size: size
1749
+ }, addOnLeft && /*#__PURE__*/React__default.createElement(InputLeftAddon, null, addOnLeft), elementLeft && /*#__PURE__*/React__default.createElement(InputLeftElement, null, elementLeft), /*#__PURE__*/React__default.createElement(Input$1, Object.assign({
1750
+ ref: ref,
1751
+ type: type,
1752
+ value: value
1753
+ }, inputProps)), addOnRight && /*#__PURE__*/React__default.createElement(InputRightAddon, null, addOnRight), elementRight && /*#__PURE__*/React__default.createElement(InputRightElement, null, elementRight)));
1754
+ });
1755
+ InputField.defaultProps = {
1756
+ addOnLeft: undefined,
1757
+ addOnRight: undefined,
1758
+ elementLeft: undefined,
1759
+ elementRight: undefined
2035
1760
  };
2036
1761
 
2037
- const sizes = {
2038
- ...theme$1.sizes,
2039
- 4.5: '1.125rem',
2040
- 9.5: '2.375rem',
2041
- 18: '4.5rem',
2042
- 22: '5.5rem',
2043
- 26: '6.5rem',
2044
- 30: '7.5rem'
1762
+ const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
1763
+ const {
1764
+ value,
1765
+ ...inputProps
1766
+ } = props;
1767
+ return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(Textarea$1, Object.assign({
1768
+ ref: ref,
1769
+ value: value
1770
+ }, inputProps)));
1771
+ });
1772
+ TextareaField.defaultProps = {
1773
+ addOnLeft: undefined,
1774
+ addOnRight: undefined,
1775
+ elementLeft: undefined,
1776
+ elementRight: undefined
2045
1777
  };
2046
1778
 
2047
- const fonts = {
2048
- heading: `'Poppins', sans-serif`,
2049
- body: `'Poppins', sans-serif`
2050
- };
2051
- const fontWeights = {
2052
- hairline: 100,
2053
- thin: 200,
2054
- light: 300,
2055
- normal: 400,
2056
- medium: 500,
2057
- semibold: 600,
2058
- bold: 700,
2059
- extrabold: 800,
2060
- black: 900
1779
+ const XMSLogo = () => /*#__PURE__*/React__default.createElement(Image, {
1780
+ height: 8,
1781
+ src: useColorModeValue('https://assets.voila.id/xms/logo-xms.jpg', 'https://assets.voila.id/xms/logo-xms-dark.png')
1782
+ });
1783
+ const VoilaLogo = () => /*#__PURE__*/React__default.createElement(Image, {
1784
+ src: "https://s3.ap-southeast-1.amazonaws.com/assets.voila.id/xms/logo-voila-black.png?v=1",
1785
+ filter: useColorModeValue('none', 'invert(1)'),
1786
+ maxW: 24
1787
+ });
1788
+
1789
+ const Profile = ({
1790
+ data,
1791
+ onLogout
1792
+ }) => {
1793
+ var _data$name;
1794
+ const {
1795
+ isOpen,
1796
+ onToggle,
1797
+ onClose
1798
+ } = useDisclosure();
1799
+ return /*#__PURE__*/createElement(Popover$1, {
1800
+ placement: "bottom-end",
1801
+ isOpen: isOpen,
1802
+ onClose: onClose
1803
+ }, /*#__PURE__*/createElement(Box, {
1804
+ "data-test-id": "WE0UYbA93LOZy6S09IhDO",
1805
+ as: "button",
1806
+ cursor: 'pointer',
1807
+ minW: 0,
1808
+ _hover: {
1809
+ textDecor: 'none'
1810
+ },
1811
+ m: 0,
1812
+ onClick: onToggle
1813
+ }, /*#__PURE__*/createElement(HStack, null, /*#__PURE__*/createElement(VStack, {
1814
+ alignItems: "flex-end",
1815
+ spacing: -0.5,
1816
+ ml: "2"
1817
+ }, /*#__PURE__*/createElement(Text, {
1818
+ fontSize: "text.xs",
1819
+ mb: 1,
1820
+ fontWeight: 400,
1821
+ lineHeight: "14px",
1822
+ color: useColorModeValue('neutral.800', 'white')
1823
+ }, data === null || data === void 0 ? void 0 : data.email), /*#__PURE__*/createElement(Text, {
1824
+ fontSize: "text.xs",
1825
+ fontWeight: 400,
1826
+ lineHeight: "14px",
1827
+ color: useColorModeValue('primary.500', 'success.400')
1828
+ }, (data === null || data === void 0 ? void 0 : data.office) && /*#__PURE__*/createElement(Text, {
1829
+ color: "neutral.700",
1830
+ display: "inline-block",
1831
+ mr: 0.5
1832
+ }, data.office, " |", ' '), data === null || data === void 0 ? void 0 : data.userRole)), /*#__PURE__*/createElement(PopoverTrigger, null, /*#__PURE__*/createElement(Avatar, {
1833
+ size: 'sm',
1834
+ bg: "primary.500",
1835
+ color: "white",
1836
+ name: (_data$name = data === null || data === void 0 ? void 0 : data.name) !== null && _data$name !== void 0 ? _data$name : data === null || data === void 0 ? void 0 : data.email
1837
+ })))), /*#__PURE__*/createElement(PopoverContent, {
1838
+ bg: useColorModeValue('white', 'mirage.900'),
1839
+ maxW: 200
1840
+ }, /*#__PURE__*/createElement(PopoverArrow, {
1841
+ bg: useColorModeValue('white', 'mirage.900')
1842
+ }), /*#__PURE__*/createElement(PopoverBody, {
1843
+ p: 1
1844
+ }, /*#__PURE__*/createElement(Flex, {
1845
+ "data-test-id": "gA7F9pucPX_Q3_dkgXIYZ",
1846
+ alignItems: "center",
1847
+ px: 3,
1848
+ py: 2,
1849
+ borderRadius: "sm",
1850
+ cursor: "pointer",
1851
+ _hover: {
1852
+ bg: useColorModeValue('primary.500', 'mirage.900'),
1853
+ color: 'white'
1854
+ },
1855
+ onClick: onLogout,
1856
+ fontSize: "text.xs"
1857
+ }, /*#__PURE__*/createElement(FiPower, null), /*#__PURE__*/createElement(Text, {
1858
+ ml: 2
1859
+ }, "Logout")))));
2061
1860
  };
2062
- const lineHeights = {
2063
- normal: 'normal',
2064
- none: 1,
2065
- shorter: 1.25,
2066
- short: 1.375,
2067
- base: 1.5,
2068
- tall: 1.625,
2069
- 34: '2.125rem',
2070
- 32: '2rem',
2071
- 30: '1.875rem',
2072
- 28: '1.75',
2073
- 26: '1.625rem',
2074
- 24: '1.5rem',
2075
- 22: '1.375rem',
2076
- 20: '1.25rem',
2077
- 18: '1.125rem',
2078
- 16: '1rem',
2079
- 14: '0.875rem',
2080
- 12: '0.75rem'
1861
+ Profile.defaultProps = {
1862
+ data: undefined,
1863
+ onLogout: undefined
2081
1864
  };
2082
- const fontSizes = {
2083
- heading: {
2084
- 1: '1.75rem',
2085
- 2: '1.5rem',
2086
- 3: '1.25rem',
2087
- 4: '1.125rem',
2088
- 5: '1rem',
2089
- 6: '0.875rem'
2090
- },
2091
- text: {
2092
- xl: '1.125rem',
2093
- lg: '1rem',
2094
- md: '0.875rem',
2095
- sm: '0.75rem',
2096
- xs: '0.625rem'
2097
- },
2098
- button: {
2099
- lg: '1.125rem',
2100
- md: '0.875rem',
2101
- sm: '0.625rem'
2102
- },
2103
- field: {
2104
- lg: '1rem',
2105
- md: '0.875rem',
2106
- sm: '0.75rem'
2107
- },
2108
- table: {
2109
- header: '0.75rem'
2110
- }
1865
+
1866
+ const SwitchMode = () => {
1867
+ const {
1868
+ colorMode,
1869
+ toggleColorMode
1870
+ } = useColorMode$1();
1871
+ return /*#__PURE__*/createElement(Box, {
1872
+ "data-test-id": "rhYuTDCiWkFqr96upiEEh",
1873
+ mx: 5,
1874
+ onClick: toggleColorMode,
1875
+ cursor: "pointer"
1876
+ }, colorMode === 'light' ? /*#__PURE__*/createElement(FiMoon, {
1877
+ size: 20
1878
+ }) : /*#__PURE__*/createElement(FiSun, {
1879
+ size: 20
1880
+ }));
2111
1881
  };
2112
- const heading = {
2113
- 1: {
2114
- fontSize: fontSizes.heading[1],
2115
- fontWeight: 'bold',
2116
- lineHeight: '3.5rem',
2117
- letterSpacing: '0'
2118
- },
2119
- 2: {
2120
- fontSize: fontSizes.heading[2],
2121
- fontWeight: 'bold',
2122
- lineHeight: '2.875rem',
2123
- letterSpacing: '0'
2124
- },
2125
- 3: {
2126
- fontSize: fontSizes.heading[3],
2127
- fontWeight: 'bold',
2128
- lineHeight: '2.5rem',
2129
- letterSpacing: '0'
2130
- },
2131
- 4: {
2132
- fontSize: fontSizes.heading[4],
2133
- fontWeight: 'bold',
2134
- lineHeight: '2rem',
2135
- letterSpacing: '0'
2136
- },
2137
- 5: {
2138
- fontSize: fontSizes.heading[5],
2139
- fontWeight: 'bold',
2140
- lineHeight: '1.5rem',
2141
- letterSpacing: '0'
2142
- },
2143
- 6: {
2144
- fontSize: fontSizes.heading[6],
2145
- fontWeight: 'bold',
2146
- lineHeight: '1.375rem',
2147
- letterSpacing: '0'
1882
+
1883
+ // eslint-disable-next-line import/prefer-default-export
1884
+ function environmentName(env) {
1885
+ switch (env) {
1886
+ case 'DEVELOPMENT':
1887
+ return 'Dev';
1888
+ case 'STAGING':
1889
+ return 'Staging';
1890
+ default:
1891
+ return null;
2148
1892
  }
1893
+ }
1894
+
1895
+ /* eslint-disable react-hooks/rules-of-hooks */
1896
+ const Version = ({
1897
+ version,
1898
+ environment,
1899
+ onOpenModalRelease
1900
+ }) => /*#__PURE__*/createElement(Fragment, null, version && /*#__PURE__*/createElement(Badge, {
1901
+ "data-test-id": "dzl3esjhCphobaaIXpiUE",
1902
+ bg: useColorModeValue('primary.500', 'rgba(124, 124, 124, 0.12)'),
1903
+ color: useColorModeValue('white', 'secondary.400'),
1904
+ fontSize: "text.xs",
1905
+ py: 1,
1906
+ px: 2.5,
1907
+ fontWeight: "bold",
1908
+ textTransform: "lowercase",
1909
+ borderRadius: "md",
1910
+ onClick: onOpenModalRelease,
1911
+ cursor: onOpenModalRelease ? 'pointer' : 'auto'
1912
+ }, version), environmentName(environment) !== null && version && /*#__PURE__*/createElement(Box, {
1913
+ background: "primary.50",
1914
+ color: "primary.500",
1915
+ fontSize: "text.xs",
1916
+ py: 1,
1917
+ px: 2.5,
1918
+ fontWeight: "bold",
1919
+ borderRadius: "md"
1920
+ }, environmentName(environment)));
1921
+ Version.defaultProps = {
1922
+ environment: undefined,
1923
+ version: undefined,
1924
+ onOpenModalRelease: undefined
2149
1925
  };
2150
- const text = {
2151
- xl: {
2152
- fontSize: fontSizes.text.xl,
2153
- lineHeight: lineHeights[28],
2154
- letterSpacing: '0'
2155
- },
2156
- lg: {
2157
- fontSize: fontSizes.text.lg,
2158
- lineHeight: lineHeights[24],
2159
- letterSpacing: '0'
2160
- },
2161
- md: {
2162
- fontSize: fontSizes.text.md,
2163
- lineHeight: lineHeights[22],
2164
- letterSpacing: '0'
2165
- },
2166
- sm: {
2167
- fontSize: fontSizes.text.sm,
2168
- lineHeight: lineHeights[18],
2169
- letterSpacing: '0'
2170
- },
2171
- xs: {
2172
- fontSize: fontSizes.text.xs,
2173
- lineHeight: lineHeights[14],
2174
- letterSpacing: '0'
2175
- }
1926
+
1927
+ const Header = ({
1928
+ data,
1929
+ onLogout,
1930
+ onOpenModalRelease,
1931
+ ...props
1932
+ }) => /*#__PURE__*/createElement(Box, Object.assign({
1933
+ minH: 14,
1934
+ bg: useColorModeValue('white', 'ebony-clay.800'),
1935
+ boxShadow: "0 4px 20px 0 rgb(0 0 0 / 5%)",
1936
+ px: 4,
1937
+ py: 1
1938
+ }, props), /*#__PURE__*/createElement(Flex, {
1939
+ h: 14,
1940
+ alignItems: "center",
1941
+ justifyContent: "space-between"
1942
+ }, /*#__PURE__*/createElement(XMSLogo, null), /*#__PURE__*/createElement(HStack, {
1943
+ spacing: 2,
1944
+ alignItems: "center"
1945
+ }, /*#__PURE__*/createElement(VoilaLogo, null), /*#__PURE__*/createElement(Version, {
1946
+ version: data === null || data === void 0 ? void 0 : data.version,
1947
+ environment: data === null || data === void 0 ? void 0 : data.environment,
1948
+ onOpenModalRelease: onOpenModalRelease
1949
+ })), /*#__PURE__*/createElement(Flex, {
1950
+ alignItems: "center"
1951
+ }, /*#__PURE__*/createElement(SwitchMode, null), /*#__PURE__*/createElement(Profile, {
1952
+ data: data,
1953
+ onLogout: onLogout
1954
+ }))));
1955
+ Header.defaultProps = {
1956
+ data: undefined,
1957
+ onLogout: undefined,
1958
+ onOpenModalRelease: undefined
2176
1959
  };
2177
- const button = {
2178
- lg: {
2179
- fontSize: fontSizes.button.lg,
2180
- lineHeight: lineHeights[28],
2181
- letterSpacing: '0',
2182
- fontWeight: fontWeights.normal
2183
- },
2184
- md: {
2185
- fontSize: fontSizes.button.md,
2186
- lineHeight: lineHeights[22],
2187
- letterSpacing: '0',
2188
- fontWeight: fontWeights.normal
2189
- },
2190
- sm: {
2191
- fontSize: fontSizes.button.sm,
2192
- lineHeight: lineHeights[14],
2193
- letterSpacing: '0',
2194
- fontWeight: fontWeights.normal
2195
- }
1960
+
1961
+ const ModalBody = /*#__PURE__*/React__default.forwardRef(({
1962
+ children,
1963
+ ...rest
1964
+ }, ref) => {
1965
+ return /*#__PURE__*/React__default.createElement(ModalBody$1, Object.assign({
1966
+ ref: ref,
1967
+ background: useColorModeValue('white', 'mirage.900')
1968
+ }, rest), children);
1969
+ });
1970
+
1971
+ const ModalCloseButton = /*#__PURE__*/forwardRef((props, ref) => {
1972
+ return /*#__PURE__*/React__default.createElement(ModalCloseButton$1, Object.assign({
1973
+ ref: ref,
1974
+ top: 4,
1975
+ right: 4,
1976
+ size: "sm",
1977
+ background: useColorModeValue('neutral.50', 'mirage.900')
1978
+ }, props));
1979
+ });
1980
+
1981
+ const ModalFooter = /*#__PURE__*/forwardRef(({
1982
+ children,
1983
+ ...rest
1984
+ }, ref) => {
1985
+ return /*#__PURE__*/React__default.createElement(ModalFooter$1, Object.assign({
1986
+ ref: ref,
1987
+ background: useColorModeValue('neutral.200', 'mirage.900'),
1988
+ borderBottomRadius: "md"
1989
+ }, rest), children);
1990
+ });
1991
+
1992
+ const ModalHeader = /*#__PURE__*/forwardRef(({
1993
+ children,
1994
+ ...rest
1995
+ }, ref) => {
1996
+ return /*#__PURE__*/React__default.createElement(ModalHeader$1, Object.assign({
1997
+ ref: ref,
1998
+ background: useColorModeValue('neutral.200', 'mirage.900'),
1999
+ borderTopRadius: 'md',
2000
+ fontSize: 'lg'
2001
+ }, rest), children);
2002
+ });
2003
+
2004
+ /* eslint-disable react-hooks/rules-of-hooks */
2005
+ const Navigation = ({
2006
+ navigations,
2007
+ activePath,
2008
+ as,
2009
+ host,
2010
+ ...props
2011
+ }) => {
2012
+ return /*#__PURE__*/createElement(Box, Object.assign({
2013
+ bg: useColorModeValue('white', 'ebony-clay.800'),
2014
+ boxShadow: "0 4px 20px 0 rgb(0 0 0 / 5%)",
2015
+ borderRadius: "md",
2016
+ overflowX: "auto"
2017
+ }, props), /*#__PURE__*/createElement(Flex, {
2018
+ alignItems: "center",
2019
+ p: 2
2020
+ }, /*#__PURE__*/createElement(HStack, {
2021
+ spacing: 2
2022
+ }, navigations === null || navigations === void 0 ? void 0 : navigations.map(navigation => {
2023
+ const isActive = activePath.startsWith(navigation.navLink || '');
2024
+ const activeBg = isActive ? 'primary.500' : undefined;
2025
+ return /*#__PURE__*/createElement(Popover$1, {
2026
+ key: navigation.title,
2027
+ trigger: "hover",
2028
+ placement: "bottom-start"
2029
+ }, ({
2030
+ isOpen
2031
+ }) => /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(PopoverTrigger, null, /*#__PURE__*/createElement(Box, {
2032
+ display: "flex",
2033
+ alignItems: "center",
2034
+ borderRadius: "md",
2035
+ cursor: "pointer",
2036
+ _hover: {
2037
+ backgroundColor: !isActive ? useColorModeValue('dove-gray.50', 'transparent') : activeBg
2038
+ },
2039
+ backgroundColor: isOpen && !isActive ? useColorModeValue('dove-gray.50', 'transparent') : activeBg,
2040
+ color: isActive ? 'white' : 'inherit',
2041
+ p: 2
2042
+ }, /*#__PURE__*/createElement(Icon, {
2043
+ as: navigation.icon,
2044
+ mr: 2
2045
+ }), /*#__PURE__*/createElement(Text, {
2046
+ whiteSpace: "nowrap",
2047
+ fontSize: "text.sm",
2048
+ fontWeight: 400
2049
+ }, navigation.title), /*#__PURE__*/createElement(ChevronDownIcon, {
2050
+ ml: 2
2051
+ }))), navigation.children && /*#__PURE__*/createElement(Portal, null, /*#__PURE__*/createElement(Box, {
2052
+ zIndex: "popover"
2053
+ }, /*#__PURE__*/createElement(PopoverContent, {
2054
+ key: navigation.title,
2055
+ bg: useColorModeValue('white', 'ebony-clay.800'),
2056
+ maxW: 250,
2057
+ border: "none",
2058
+ borderRadius: "md",
2059
+ boxShadow: "0 5px 25px rgb(0 0 0 / 10%)"
2060
+ }, navigation.children.map(({
2061
+ title,
2062
+ navHost,
2063
+ navLink,
2064
+ icon
2065
+ }) => {
2066
+ const link = navHost ? `${navHost}${navLink}` : navLink;
2067
+ const isLocalLink = host === navHost;
2068
+ const isActiveSub = activePath === navLink;
2069
+ return /*#__PURE__*/createElement(Link, {
2070
+ as: isLocalLink ? as : undefined,
2071
+ key: title,
2072
+ href: link,
2073
+ _hover: {
2074
+ textDecoration: 'none'
2075
+ }
2076
+ }, /*#__PURE__*/createElement(Box, {
2077
+ display: "flex",
2078
+ position: "relative",
2079
+ alignItems: "center",
2080
+ transition: "padding 0.35s ease 0s",
2081
+ _hover: {
2082
+ backgroundColor: useColorModeValue('dove-gray.50', 'mirage.900'),
2083
+ color: useColorModeValue('primary.500', 'dove-gray.600'),
2084
+ px: 5,
2085
+ py: 4,
2086
+ _first: {
2087
+ borderTopRadius: 'md'
2088
+ },
2089
+ _last: {
2090
+ borderBottomRadius: 'md'
2091
+ }
2092
+ },
2093
+ color: isActiveSub ? 'primary.500' : 'inherit',
2094
+ css: css`
2095
+ border-spacing: 4px;
2096
+ `,
2097
+ px: 6,
2098
+ py: 4
2099
+ }, /*#__PURE__*/createElement(Icon, {
2100
+ as: icon,
2101
+ mr: 3
2102
+ }), /*#__PURE__*/createElement(Text, {
2103
+ fontSize: "text.sm"
2104
+ }, title), isActiveSub && /*#__PURE__*/createElement(Box, {
2105
+ width: 0.5,
2106
+ height: 8,
2107
+ position: "absolute",
2108
+ bg: "primary.500",
2109
+ right: 0,
2110
+ zIndex: "popover"
2111
+ })));
2112
+ }))))));
2113
+ }))));
2196
2114
  };
2197
- const field = {
2198
- lg: {
2199
- fontSize: fontSizes.field.lg,
2200
- lineHeight: lineHeights[24],
2201
- letterSpacing: '0',
2202
- fontWeight: fontWeights.normal
2203
- },
2204
- md: {
2205
- fontSize: fontSizes.field.md,
2206
- lineHeight: lineHeights[22],
2207
- letterSpacing: '0',
2208
- fontWeight: fontWeights.normal
2209
- },
2210
- sm: {
2211
- fontSize: fontSizes.field.sm,
2212
- lineHeight: lineHeights[18],
2213
- letterSpacing: '0',
2214
- fontWeight: fontWeights.normal
2215
- }
2115
+ Navigation.defaultProps = {
2116
+ navigations: undefined,
2117
+ as: 'a',
2118
+ host: undefined
2216
2119
  };
2217
- const textStyles = {
2218
- heading,
2219
- text,
2220
- button,
2221
- field
2120
+
2121
+ const PaginationButton = /*#__PURE__*/forwardRef$1(({
2122
+ className,
2123
+ style,
2124
+ isActive,
2125
+ children,
2126
+ ...rest
2127
+ }, ref) => {
2128
+ const btnBg = useColorModeValue('neutral.300', 'mirage.900');
2129
+ const btnColor = useColorModeValue('black.high', 'primary.300');
2130
+ const btnNotActiveBg = useColorModeValue('secondary.50', 'primary.500');
2131
+ const btnNotActiveColor = useColorModeValue('primary.500', 'white');
2132
+ return /*#__PURE__*/React__default.createElement(Button$1, Object.assign({
2133
+ "data-test-id": "Pagination-Button",
2134
+ ref: ref,
2135
+ className: className,
2136
+ style: style,
2137
+ borderRadius: 50,
2138
+ fontWeight: 700,
2139
+ m: 0,
2140
+ px: 3,
2141
+ py: 2,
2142
+ h: 8,
2143
+ minW: "auto",
2144
+ background: isActive ? 'primary.500' : btnBg,
2145
+ color: isActive ? 'white' : btnColor,
2146
+ _hover: !isActive ? {
2147
+ background: btnNotActiveBg,
2148
+ color: btnNotActiveColor
2149
+ } : {},
2150
+ _disabled: {
2151
+ background: useColorModeValue('neutral.300', 'mirage.900'),
2152
+ color: 'neutral.600',
2153
+ pointerEvents: 'none'
2154
+ }
2155
+ }, rest), children);
2156
+ });
2157
+ PaginationButton.displayName = 'PaginationButton';
2158
+ PaginationButton.defaultProps = {
2159
+ isActive: undefined
2160
+ };
2161
+
2162
+ const PaginationButtonTrigger = ({
2163
+ color,
2164
+ isDisabled,
2165
+ onClick,
2166
+ visuallyHidden,
2167
+ icon
2168
+ }) => /*#__PURE__*/createElement(PaginationButton, {
2169
+ "data-test-id": "DLVCc_fBK35spHm5WxjcJ",
2170
+ color: color,
2171
+ isDisabled: isDisabled,
2172
+ onClick: onClick
2173
+ }, /*#__PURE__*/createElement(VisuallyHidden, null, visuallyHidden), icon);
2174
+ PaginationButtonTrigger.defaultProps = {
2175
+ color: undefined,
2176
+ isDisabled: undefined,
2177
+ onClick: undefined,
2178
+ visuallyHidden: undefined,
2179
+ icon: undefined
2222
2180
  };
2223
2181
 
2182
+ const Pagination = ({
2183
+ className,
2184
+ current,
2185
+ total,
2186
+ onSelect
2187
+ }) => {
2188
+ const btnColorDisabled = useColorModeValue('secondary.100', 'primary.500');
2189
+ const btnColor = useColorModeValue('primary.500', 'secondary.100');
2190
+ const disabledPrevious = current === 1;
2191
+ const previousButtonColor = disabledPrevious ? btnColorDisabled : btnColor;
2192
+ const disabledNext = current === total;
2193
+ const nextButtonColor = disabledNext ? btnColorDisabled : btnColor;
2194
+ const handleSelectPage = page => {
2195
+ if (onSelect) {
2196
+ onSelect(page);
2197
+ }
2198
+ };
2199
+ const generatePages = () => {
2200
+ const maxButtons = 5;
2201
+ const pageButtons = [];
2202
+ let startPage;
2203
+ let endPage;
2204
+ if ( maxButtons < total) {
2205
+ startPage = Math.max(Math.min(current - Math.floor(maxButtons / 2), total - maxButtons + 1), 1);
2206
+ endPage = startPage + maxButtons - 1;
2207
+ } else {
2208
+ startPage = 1;
2209
+ endPage = total;
2210
+ }
2211
+ // eslint-disable-next-line no-plusplus
2212
+ for (let page = startPage; page <= endPage; ++page) {
2213
+ pageButtons.push(page);
2214
+ }
2215
+ return pageButtons;
2216
+ };
2217
+ return /*#__PURE__*/createElement(Box, {
2218
+ className: className,
2219
+ display: "inline-flex",
2220
+ alignItems: "center"
2221
+ }, /*#__PURE__*/createElement(Box, {
2222
+ mr: 1
2223
+ }, /*#__PURE__*/createElement(PaginationButtonTrigger, {
2224
+ "data-test-id": "Pagination-Button",
2225
+ color: previousButtonColor,
2226
+ isDisabled: disabledPrevious,
2227
+ onClick: () => handleSelectPage(1),
2228
+ visuallyHidden: "First Page",
2229
+ icon: /*#__PURE__*/createElement(ArrowLeftIcon, {
2230
+ width: 2
2231
+ })
2232
+ })), /*#__PURE__*/createElement(Box, {
2233
+ backgroundColor: useColorModeValue('neutral.300', 'mirage.900'),
2234
+ borderRadius: 50
2235
+ }, /*#__PURE__*/createElement(PaginationButtonTrigger, {
2236
+ "data-test-id": "Pagination-Button",
2237
+ color: previousButtonColor,
2238
+ isDisabled: disabledPrevious,
2239
+ onClick: () => handleSelectPage(current - 1),
2240
+ visuallyHidden: "Previous Page",
2241
+ icon: /*#__PURE__*/createElement(ChevronLeftIcon, null)
2242
+ }), generatePages().map(page => {
2243
+ return /*#__PURE__*/createElement(PaginationButton, {
2244
+ "data-test-id": "Pagination-Button",
2245
+ key: page,
2246
+ isActive: page === current,
2247
+ onClick: () => typeof page === 'number' ? handleSelectPage(page) : null
2248
+ }, /*#__PURE__*/createElement(Text, {
2249
+ scale: 300,
2250
+ fontSize: "text.sm",
2251
+ lineHeight: 18,
2252
+ fontWeight: 500
2253
+ }, page));
2254
+ }), /*#__PURE__*/createElement(PaginationButtonTrigger, {
2255
+ "data-test-id": "Pagination-Button",
2256
+ color: nextButtonColor,
2257
+ isDisabled: disabledNext,
2258
+ onClick: () => handleSelectPage(current + 1),
2259
+ visuallyHidden: "Next Page",
2260
+ icon: /*#__PURE__*/createElement(ChevronRightIcon, null)
2261
+ })), /*#__PURE__*/createElement(Box, {
2262
+ ml: 1
2263
+ }, /*#__PURE__*/createElement(PaginationButtonTrigger, {
2264
+ "data-test-id": "Pagination-Button",
2265
+ color: nextButtonColor,
2266
+ isDisabled: disabledNext,
2267
+ onClick: () => handleSelectPage(total),
2268
+ visuallyHidden: "Last Page",
2269
+ icon: /*#__PURE__*/createElement(ArrowRightIcon, {
2270
+ width: 2
2271
+ })
2272
+ })));
2273
+ };
2274
+ Pagination.defaultProps = {
2275
+ className: undefined,
2276
+ onSelect: undefined
2277
+ };
2278
+ Pagination.displayName = 'Pagination';
2224
2279
 
2280
+ const PaginationDetail = ({
2281
+ page,
2282
+ limit,
2283
+ length,
2284
+ scale = 300,
2285
+ fontSize = 'xs',
2286
+ lineHeight = 18,
2287
+ ...rest
2288
+ }) => {
2289
+ return /*#__PURE__*/createElement(Text, Object.assign({
2290
+ scale: scale,
2291
+ fontSize: fontSize,
2292
+ lineHeight: lineHeight
2293
+ }, rest), `${(page - 1) * limit + 1}-${limit * page < length ? limit * page : length} dari ${length} item`);
2294
+ };
2225
2295
 
2226
- var foundations = {
2227
- __proto__: null,
2228
- colors: colors,
2229
- radii: radius,
2230
- space: spacing,
2231
- sizes: sizes,
2232
- fonts: fonts,
2233
- fontSizes: fontSizes,
2234
- lineHeights: lineHeights,
2235
- textStyles: textStyles
2296
+ const PaginationFilter = ({
2297
+ limit,
2298
+ label = 'Baris per halaman:',
2299
+ items,
2300
+ onChange,
2301
+ ...rest
2302
+ }) => {
2303
+ const [value, setValue] = useState(limit);
2304
+ return /*#__PURE__*/createElement(Box, {
2305
+ display: "flex",
2306
+ flexDirection: "row",
2307
+ alignItems: "center"
2308
+ }, /*#__PURE__*/createElement(Text, Object.assign({
2309
+ fontSize: "text.sm",
2310
+ lineHeight: 18,
2311
+ color: useColorModeValue('neutral.900', 'white')
2312
+ }, rest), label), /*#__PURE__*/createElement(Select$1, {
2313
+ textAlign: "center",
2314
+ size: "xs",
2315
+ outline: "none",
2316
+ border: "none",
2317
+ boxShadow: "none",
2318
+ width: 18,
2319
+ icon: /*#__PURE__*/createElement(FiChevronDown, null),
2320
+ _focusVisible: {
2321
+ boxShadow: 'none'
2322
+ },
2323
+ onChange: e => {
2324
+ const numberValue = Number(e.target.value);
2325
+ onChange(numberValue);
2326
+ setValue(numberValue);
2327
+ },
2328
+ value: value
2329
+ }, items.map(item => {
2330
+ return /*#__PURE__*/createElement("option", {
2331
+ key: item,
2332
+ value: item
2333
+ }, item);
2334
+ })));
2335
+ };
2336
+ PaginationFilter.defaultProps = {
2337
+ limit: 10,
2338
+ label: undefined
2236
2339
  };
2237
2340
 
2238
2341
  const styleMd = textStyles.text.sm;
@@ -3020,5 +3123,5 @@ const Provider = ({
3020
3123
  };
3021
3124
  Provider.displayName = 'Provider';
3022
3125
 
3023
- export { BreadCrumb, DataTable, Datepicker, Field, Header, InputField, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Tab, TabList, TabPanel, TextareaField, Uploader, theme, useInternalUI };
3126
+ 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 };
3024
3127
  //# sourceMappingURL=internal-ui.esm.js.map