@ctlyst.id/internal-ui 5.7.5 → 5.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4852,7 +4852,7 @@ var themeSelect = (theme5) => {
4852
4852
  };
4853
4853
 
4854
4854
  // src/components/select/components/select.tsx
4855
- import { jsx as jsx55 } from "react/jsx-runtime";
4855
+ import { jsx as jsx55, jsxs as jsxs24 } from "react/jsx-runtime";
4856
4856
  function DropdownIndicator(props) {
4857
4857
  return /* @__PURE__ */ jsx55(componentRS.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsx55(Icon7.ChevronDown, { size: 4, color: "neutral.400" }) });
4858
4858
  }
@@ -4866,6 +4866,12 @@ function MultiValue(props) {
4866
4866
  function MultiValueRemove(props) {
4867
4867
  return /* @__PURE__ */ jsx55(componentRS.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsx55(Flex11, { align: "center", justify: "center", children: /* @__PURE__ */ jsx55(Icon7.Close, { size: 2.5, color: "inherit" }) }) });
4868
4868
  }
4869
+ function LoadingMessage(props) {
4870
+ return /* @__PURE__ */ jsxs24(Flex11, { justify: "center", align: "center", flexDir: "column", gap: 4, py: 10, children: [
4871
+ /* @__PURE__ */ jsx55(loader_default, { size: "lg", color: "primary" }),
4872
+ /* @__PURE__ */ jsx55(Center2, { textStyle: "text.sm", fontWeight: "semibold", color: "black.high", children: "Memuat data ..." })
4873
+ ] });
4874
+ }
4869
4875
  function NoOptionsMessage(props) {
4870
4876
  return /* @__PURE__ */ jsx55(Center2, { textStyle: "text.xs", py: "1.5", color: "black.medium", children: (props == null ? void 0 : props.options.length) === 0 ? "Opsi tidak tersedia" : "Hasil tidak ditemukan" });
4871
4877
  }
@@ -4888,6 +4894,7 @@ function Select2({
4888
4894
  MultiValue,
4889
4895
  MultiValueRemove,
4890
4896
  NoOptionsMessage,
4897
+ LoadingMessage,
4891
4898
  ...virtualized ? {
4892
4899
  MenuList: renderMenuListVirtualized
4893
4900
  } : {},
@@ -4984,7 +4991,7 @@ function SelectCreatable({ styles, isError = false, ...rest }) {
4984
4991
  import { Checkbox as Checkbox2, Flex as Flex12, Text as Text14 } from "@chakra-ui/react";
4985
4992
  import { useColorMode as useColorMode6 } from "@chakra-ui/system";
4986
4993
  import ReactSelect2, { components as ComponentRS } from "react-select";
4987
- import { Fragment as Fragment8, jsx as jsx59, jsxs as jsxs24 } from "react/jsx-runtime";
4994
+ import { Fragment as Fragment8, jsx as jsx59, jsxs as jsxs25 } from "react/jsx-runtime";
4988
4995
  var CHECKBOX_STATE = {
4989
4996
  UNCHECKED: 0,
4990
4997
  INDETERMINATE: 1,
@@ -5031,7 +5038,7 @@ var InputOption = ({
5031
5038
  onClick: isDisabled ? void 0 : innerProps.onClick,
5032
5039
  style
5033
5040
  };
5034
- return /* @__PURE__ */ jsxs24(Fragment8, { children: [
5041
+ return /* @__PURE__ */ jsxs25(Fragment8, { children: [
5035
5042
  /* @__PURE__ */ jsx59(
5036
5043
  ComponentRS.Option,
5037
5044
  {
@@ -5043,7 +5050,7 @@ var InputOption = ({
5043
5050
  getStyles,
5044
5051
  innerProps: props,
5045
5052
  ...rest,
5046
- children: /* @__PURE__ */ jsxs24(
5053
+ children: /* @__PURE__ */ jsxs25(
5047
5054
  Flex12,
5048
5055
  {
5049
5056
  alignItems: "center",
@@ -5176,7 +5183,7 @@ Sidebar.displayName = "Sidebar";
5176
5183
  import { Box as Box27, Flex as Flex14, Text as Text15 } from "@chakra-ui/react";
5177
5184
  import { ArrowRight } from "@ctlyst.id/internal-icon";
5178
5185
  import { AnimatePresence, motion as motion2 } from "framer-motion";
5179
- import { jsx as jsx61, jsxs as jsxs25 } from "react/jsx-runtime";
5186
+ import { jsx as jsx61, jsxs as jsxs26 } from "react/jsx-runtime";
5180
5187
  var SidebarHeader = ({ isCollapse, setCollapse, title }) => {
5181
5188
  return /* @__PURE__ */ jsx61(
5182
5189
  Box27,
@@ -5188,7 +5195,7 @@ var SidebarHeader = ({ isCollapse, setCollapse, title }) => {
5188
5195
  _hover: {
5189
5196
  color: "primary.500"
5190
5197
  },
5191
- children: /* @__PURE__ */ jsxs25(
5198
+ children: /* @__PURE__ */ jsxs26(
5192
5199
  Flex14,
5193
5200
  {
5194
5201
  "data-test-id": "nLkz69YipW818FioeAxVI",
@@ -5254,7 +5261,7 @@ import {
5254
5261
  } from "@chakra-ui/react";
5255
5262
  import * as Icon8 from "@ctlyst.id/internal-icon";
5256
5263
  import { motion as motion3 } from "framer-motion";
5257
- import { Fragment as Fragment9, jsx as jsx62, jsxs as jsxs26 } from "react/jsx-runtime";
5264
+ import { Fragment as Fragment9, jsx as jsx62, jsxs as jsxs27 } from "react/jsx-runtime";
5258
5265
  var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, setActive, active }) => {
5259
5266
  return /* @__PURE__ */ jsx62(
5260
5267
  Box28,
@@ -5269,20 +5276,20 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5269
5276
  const isOpenOptions = isCollapse || !isCollapse && !isExpanded;
5270
5277
  const noChild = !item.children.length;
5271
5278
  const offsetStyle = isCollapse ? noChild ? [-5, 16] : [-1, 16] : [-1, 8];
5272
- return /* @__PURE__ */ jsxs26(Fragment9, { children: [
5279
+ return /* @__PURE__ */ jsxs27(Fragment9, { children: [
5273
5280
  /* @__PURE__ */ jsx62(Popover6, { trigger: "hover", placement: "right-start", offset: offsetStyle, children: ({ isOpen, onClose }) => {
5274
5281
  var _a, _b;
5275
5282
  const activeOption = isOpen ? "primary.50" : "white";
5276
5283
  const backgroundColor = isOpen && !isActive ? "primary.50" : "primary.100";
5277
5284
  const activeParent = isActive ? backgroundColor : activeOption;
5278
- return /* @__PURE__ */ jsxs26(Fragment9, { children: [
5285
+ return /* @__PURE__ */ jsxs27(Fragment9, { children: [
5279
5286
  /* @__PURE__ */ jsx62(PopoverTrigger6, { children: /* @__PURE__ */ jsx62(
5280
5287
  AccordionButton2,
5281
5288
  {
5282
5289
  "data-test-id": `CTA_button-accordion-${item.title}`,
5283
5290
  p: "0",
5284
5291
  h: "fit-content",
5285
- children: /* @__PURE__ */ jsxs26(
5292
+ children: /* @__PURE__ */ jsxs27(
5286
5293
  NavItem,
5287
5294
  {
5288
5295
  as: motion3.div,
@@ -5297,7 +5304,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5297
5304
  ...itemStyles,
5298
5305
  children: [
5299
5306
  mappingIcon2 && /* @__PURE__ */ jsx62(Box28, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
5300
- !isCollapse && /* @__PURE__ */ jsxs26(
5307
+ !isCollapse && /* @__PURE__ */ jsxs27(
5301
5308
  Box28,
5302
5309
  {
5303
5310
  display: "flex",
@@ -5334,8 +5341,8 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5334
5341
  },
5335
5342
  item.id
5336
5343
  ) }, item.id),
5337
- isOpenOptions && /* @__PURE__ */ jsx62(Portal4, { children: item.children.length > 0 ? /* @__PURE__ */ jsxs26(PopoverContent6, { w: "176px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: [
5338
- /* @__PURE__ */ jsx62(PopoverHeader2, { borderColor: "neutral.300", textStyle: "text.xs", p: "2", children: mappingIcon2 && /* @__PURE__ */ jsxs26(Box28, { display: "flex", alignItems: "center", children: [
5344
+ isOpenOptions && /* @__PURE__ */ jsx62(Portal4, { children: item.children.length > 0 ? /* @__PURE__ */ jsxs27(PopoverContent6, { w: "176px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: [
5345
+ /* @__PURE__ */ jsx62(PopoverHeader2, { borderColor: "neutral.300", textStyle: "text.xs", p: "2", children: mappingIcon2 && /* @__PURE__ */ jsxs27(Box28, { display: "flex", alignItems: "center", children: [
5339
5346
  mappingIcon2.get(item.icon || ""),
5340
5347
  /* @__PURE__ */ jsx62(Box28, { as: "span", ml: "2", children: item.title })
5341
5348
  ] }) }),
@@ -5359,7 +5366,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5359
5366
  submenu.id
5360
5367
  );
5361
5368
  }) })
5362
- ] }) : isCollapse && /* @__PURE__ */ jsx62(PopoverContent6, { w: "174px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: /* @__PURE__ */ jsx62(PopoverBody4, { py: "1", px: "0", children: /* @__PURE__ */ jsxs26(
5369
+ ] }) : isCollapse && /* @__PURE__ */ jsx62(PopoverContent6, { w: "174px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: /* @__PURE__ */ jsx62(PopoverBody4, { py: "1", px: "0", children: /* @__PURE__ */ jsxs27(
5363
5370
  NavItem,
5364
5371
  {
5365
5372
  "data-test-id": `CTA_Sidebar-popover-item-${item.id}`,
@@ -5424,7 +5431,7 @@ import { chakra as chakra6, Flex as Flex15, forwardRef as forwardRef11, omitThem
5424
5431
  import { cx as cx10, dataAttr } from "@chakra-ui/shared-utils";
5425
5432
  import { Check as Check2, Close as Close5 } from "@ctlyst.id/internal-icon";
5426
5433
  import { useMemo as useMemo3 } from "react";
5427
- import { jsx as jsx63, jsxs as jsxs27 } from "react/jsx-runtime";
5434
+ import { jsx as jsx63, jsxs as jsxs28 } from "react/jsx-runtime";
5428
5435
  var Switch = forwardRef11(function Switch2(props, ref) {
5429
5436
  const styles = useMultiStyleConfig2("Switch", props);
5430
5437
  const { spacing: spacing2 = "0.5rem", children, ...ownProps } = omitThemingProps2(props);
@@ -5467,7 +5474,7 @@ var Switch = forwardRef11(function Switch2(props, ref) {
5467
5474
  };
5468
5475
  return iconSize[value];
5469
5476
  };
5470
- return /* @__PURE__ */ jsxs27(
5477
+ return /* @__PURE__ */ jsxs28(
5471
5478
  chakra6.label,
5472
5479
  {
5473
5480
  ...getRootProps(),
@@ -5477,8 +5484,8 @@ var Switch = forwardRef11(function Switch2(props, ref) {
5477
5484
  __css: containerStyles,
5478
5485
  children: [
5479
5486
  /* @__PURE__ */ jsx63("input", { "data-test-id": "", className: "chakra-switch__input", ...getInputProps({}, ref) }),
5480
- /* @__PURE__ */ jsxs27(chakra6.span, { ...getCheckboxProps(), className: "chakra-switch__track", pos: "relative", __css: trackStyles, children: [
5481
- /* @__PURE__ */ jsxs27(Flex15, { gap: 1, pos: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)", children: [
5487
+ /* @__PURE__ */ jsxs28(chakra6.span, { ...getCheckboxProps(), className: "chakra-switch__track", pos: "relative", __css: trackStyles, children: [
5488
+ /* @__PURE__ */ jsxs28(Flex15, { gap: 1, pos: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)", children: [
5482
5489
  /* @__PURE__ */ jsx63(Check2, { color: "white", size: getIconSize(props.size) }),
5483
5490
  /* @__PURE__ */ jsx63(Close5, { color: state.isDisabled ? "neutral.600" : "neutral.900", size: getIconSize(props.size) })
5484
5491
  ] }),
@@ -5530,7 +5537,7 @@ import {
5530
5537
 
5531
5538
  // src/components/tabs/components/tab.tsx
5532
5539
  import { Button as Button6, Flex as Flex16, forwardRef as forwardRef12, useMultiStyleConfig as useMultiStyleConfig3, useTab } from "@chakra-ui/react";
5533
- import { jsx as jsx64, jsxs as jsxs28 } from "react/jsx-runtime";
5540
+ import { jsx as jsx64, jsxs as jsxs29 } from "react/jsx-runtime";
5534
5541
  var Tab = forwardRef12((props, ref) => {
5535
5542
  var _a, _b;
5536
5543
  const tabProps = useTab({ ...props, ref });
@@ -5562,7 +5569,7 @@ var Tab = forwardRef12((props, ref) => {
5562
5569
  },
5563
5570
  __css: styles.tab,
5564
5571
  ...tabProps,
5565
- children: /* @__PURE__ */ jsxs28(Flex16, { alignItems: "center", children: [
5572
+ children: /* @__PURE__ */ jsxs29(Flex16, { alignItems: "center", children: [
5566
5573
  (_a = props.leftAddon) == null ? void 0 : _a.call(props, { isSelected }),
5567
5574
  tabProps.children,
5568
5575
  (_b = props.rightAddon) == null ? void 0 : _b.call(props, { isSelected })
@@ -5692,7 +5699,7 @@ var useTimescape = (options = {}) => {
5692
5699
  };
5693
5700
 
5694
5701
  // src/components/time-input/components/index.tsx
5695
- import { Fragment as Fragment10, jsx as jsx65, jsxs as jsxs29 } from "react/jsx-runtime";
5702
+ import { Fragment as Fragment10, jsx as jsx65, jsxs as jsxs30 } from "react/jsx-runtime";
5696
5703
  var timeDigitFormat = (number) => {
5697
5704
  if (number.toString().length === 1) {
5698
5705
  return `0${number}`;
@@ -5813,7 +5820,7 @@ var TimeInput2 = forwardRef13(
5813
5820
  _focusWithin: {
5814
5821
  borderColor: focusColor
5815
5822
  },
5816
- children: /* @__PURE__ */ jsxs29(
5823
+ children: /* @__PURE__ */ jsxs30(
5817
5824
  InputGroup4,
5818
5825
  {
5819
5826
  borderRadius: "sm",
@@ -5823,11 +5830,11 @@ var TimeInput2 = forwardRef13(
5823
5830
  gap: 3,
5824
5831
  "data-test-id": `CT_Component_TimeInput${name ? `_${name}` : ""}`,
5825
5832
  children: [
5826
- /* @__PURE__ */ jsxs29(Flex17, { gap: "1px", width: "100%", alignItems: "center", pl: 2, children: [
5833
+ /* @__PURE__ */ jsxs30(Flex17, { gap: "1px", width: "100%", alignItems: "center", pl: 2, children: [
5827
5834
  /* @__PURE__ */ jsx65(InputTimeArea, { "data-test-id": "start-time", ...hoursProps }),
5828
5835
  /* @__PURE__ */ jsx65("span", { children: ":" }),
5829
5836
  /* @__PURE__ */ jsx65(InputTimeArea, { "data-test-id": "end-time", ...getInputProps("minutes") }),
5830
- seconds && /* @__PURE__ */ jsxs29(Fragment10, { children: [
5837
+ seconds && /* @__PURE__ */ jsxs30(Fragment10, { children: [
5831
5838
  /* @__PURE__ */ jsx65("span", { children: ":" }),
5832
5839
  /* @__PURE__ */ jsx65(InputTimeArea, { ...getInputProps("seconds") })
5833
5840
  ] }),
@@ -5889,7 +5896,7 @@ var Styles2 = () => {
5889
5896
  var styles_default2 = Styles2;
5890
5897
 
5891
5898
  // src/components/toast/components/toast.tsx
5892
- import { Fragment as Fragment11, jsx as jsx67, jsxs as jsxs30 } from "react/jsx-runtime";
5899
+ import { Fragment as Fragment11, jsx as jsx67, jsxs as jsxs31 } from "react/jsx-runtime";
5893
5900
  var CustomCloseButton = (props) => {
5894
5901
  const { closeToast } = props;
5895
5902
  return /* @__PURE__ */ jsx67(Box30, { p: 2, mb: 1, alignItems: "center", display: "flex", "data-test-id": "", cursor: "pointer", onClick: () => closeToast(), children: /* @__PURE__ */ jsx67(Close6, { size: 4, color: "white" }) });
@@ -5924,10 +5931,10 @@ var useToast = () => {
5924
5931
  "success.500"
5925
5932
  ]);
5926
5933
  const content = (icon, message, link) => {
5927
- return /* @__PURE__ */ jsxs30(Fragment11, { children: [
5934
+ return /* @__PURE__ */ jsxs31(Fragment11, { children: [
5928
5935
  /* @__PURE__ */ jsx67(styles_default2, {}),
5929
- /* @__PURE__ */ jsxs30(Flex18, { justifyContent: "space-between", alignItems: "center", gap: 4, mb: 1, flex: 1, children: [
5930
- /* @__PURE__ */ jsxs30(Flex18, { alignItems: "center", children: [
5936
+ /* @__PURE__ */ jsxs31(Flex18, { justifyContent: "space-between", alignItems: "center", gap: 4, mb: 1, flex: 1, children: [
5937
+ /* @__PURE__ */ jsxs31(Flex18, { alignItems: "center", children: [
5931
5938
  icon && /* @__PURE__ */ jsx67(chakra7.span, { mr: 2, w: 4, h: 4, children: renderIcon(icon, "default") }),
5932
5939
  /* @__PURE__ */ jsx67(chakra7.span, { noOfLines: 2, children: message })
5933
5940
  ] }),
@@ -6113,7 +6120,7 @@ var defaultOnHandleRejections = (fileRejection, config2, handleRejection) => {
6113
6120
  };
6114
6121
 
6115
6122
  // src/components/uploader/components/uploader.tsx
6116
- import { Fragment as Fragment12, jsx as jsx68, jsxs as jsxs31 } from "react/jsx-runtime";
6123
+ import { Fragment as Fragment12, jsx as jsx68, jsxs as jsxs32 } from "react/jsx-runtime";
6117
6124
  var Uploader = ({
6118
6125
  onHandleUploadFile,
6119
6126
  onHandleRejections,
@@ -6294,15 +6301,15 @@ var Uploader = ({
6294
6301
  const color = isDisabled ? "neutral.500" : "primary.500";
6295
6302
  const containerHeight = !isSmall ? "160px" : "120px";
6296
6303
  const cursorType = filePreview ? "initial" : "pointer";
6297
- return /* @__PURE__ */ jsxs31(FormControl4, { isRequired, children: [
6304
+ return /* @__PURE__ */ jsxs32(FormControl4, { isRequired, children: [
6298
6305
  label && typeof label === "string" ? (
6299
6306
  // eslint-disable-next-line react/jsx-no-useless-fragment
6300
- /* @__PURE__ */ jsxs31(FormLabel3, { requiredIndicator: /* @__PURE__ */ jsx68(Fragment12, {}), fontSize: "text.sm", children: [
6307
+ /* @__PURE__ */ jsxs32(FormLabel3, { requiredIndicator: /* @__PURE__ */ jsx68(Fragment12, {}), fontSize: "text.sm", children: [
6301
6308
  isRequired && /* @__PURE__ */ jsx68(RequiredIndicator2, { mr: 1, ml: 0 }),
6302
6309
  label
6303
6310
  ] })
6304
6311
  ) : label,
6305
- /* @__PURE__ */ jsxs31(
6312
+ /* @__PURE__ */ jsxs32(
6306
6313
  Flex19,
6307
6314
  {
6308
6315
  minH: containerHeight,
@@ -6356,9 +6363,9 @@ var Uploader = ({
6356
6363
  ) : /* @__PURE__ */ jsx68(Text18, { noOfLines: 3, mx: 2, textAlign: "center", children: filePreview })
6357
6364
  }
6358
6365
  ) }),
6359
- !filePreview && /* @__PURE__ */ jsx68(Fragment12, { children: isDragActive ? /* @__PURE__ */ jsx68(Text18, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ jsxs31(Flex19, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
6366
+ !filePreview && /* @__PURE__ */ jsx68(Fragment12, { children: isDragActive ? /* @__PURE__ */ jsx68(Text18, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ jsxs32(Flex19, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
6360
6367
  size2 === "sm" && /* @__PURE__ */ jsx68(Plus, { size: 6, color }),
6361
- /* @__PURE__ */ jsxs31(Box31, { children: [
6368
+ /* @__PURE__ */ jsxs32(Box31, { children: [
6362
6369
  !filePreview && /* @__PURE__ */ jsx68(
6363
6370
  Heading2,
6364
6371
  {
@@ -8125,7 +8132,7 @@ import { useMemo as useMemo5 } from "react";
8125
8132
  import axios from "axios";
8126
8133
  import { createContext as createContext2, useContext, useEffect as useEffect6, useMemo as useMemo4, useRef as useRef5 } from "react";
8127
8134
  import { ToastContainer as ToastContainer2 } from "react-toastify";
8128
- import { jsx as jsx69, jsxs as jsxs32 } from "react/jsx-runtime";
8135
+ import { jsx as jsx69, jsxs as jsxs33 } from "react/jsx-runtime";
8129
8136
  var ProviderContext = createContext2({
8130
8137
  instance: void 0
8131
8138
  });
@@ -8144,7 +8151,7 @@ var Provider = ({ children, config: config2, requestInterceptors, responseInterc
8144
8151
  });
8145
8152
  }, [requestInterceptors, responseInterceptors]);
8146
8153
  const provider = useMemo4(() => ({ instance: instanceRef.current }), []);
8147
- return /* @__PURE__ */ jsxs32(ProviderContext.Provider, { value: provider, children: [
8154
+ return /* @__PURE__ */ jsxs33(ProviderContext.Provider, { value: provider, children: [
8148
8155
  /* @__PURE__ */ jsx69(ToastContainer2, {}),
8149
8156
  children
8150
8157
  ] });
@@ -8342,6 +8349,7 @@ export {
8342
8349
  ListItemProps,
8343
8350
  ListProps,
8344
8351
  loader_default as Loader,
8352
+ LoadingMessage,
8345
8353
  Logo,
8346
8354
  navigation_default as MainMenu,
8347
8355
  Modal2 as Modal,