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