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