@ctlyst.id/internal-ui 3.1.20 → 3.1.22

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
@@ -3553,7 +3553,7 @@ var Rating = ({ value }) => {
3553
3553
  var rating_default = Rating;
3554
3554
 
3555
3555
  // src/components/select/components/select.tsx
3556
- import { Badge as Badge2, Flex as Flex11 } from "@chakra-ui/react";
3556
+ import { Badge as Badge2, Center as Center2, Flex as Flex11 } from "@chakra-ui/react";
3557
3557
  import { useColorMode as useColorMode3 } from "@chakra-ui/system";
3558
3558
  import * as Icon7 from "@ctlyst.id/internal-icon";
3559
3559
  import ReactSelect, { components as componentRS } from "react-select";
@@ -3945,6 +3945,9 @@ function MultiValue(props) {
3945
3945
  function MultiValueRemove(props) {
3946
3946
  return /* @__PURE__ */ jsx53(componentRS.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsx53(Flex11, { align: "center", justify: "center", children: /* @__PURE__ */ jsx53(Icon7.Close, { size: 2.5, color: "inherit" }) }) });
3947
3947
  }
3948
+ function NoOptionsMessage(props) {
3949
+ return /* @__PURE__ */ jsx53(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" });
3950
+ }
3948
3951
  function Select2({
3949
3952
  styles,
3950
3953
  isError = false,
@@ -3962,6 +3965,7 @@ function Select2({
3962
3965
  ClearIndicator,
3963
3966
  MultiValue,
3964
3967
  MultiValueRemove,
3968
+ NoOptionsMessage,
3965
3969
  ...components
3966
3970
  },
3967
3971
  value,
@@ -3992,7 +3996,8 @@ function SelectAsync({
3992
3996
  maxMenuHeight: 320,
3993
3997
  components: {
3994
3998
  DropdownIndicator,
3995
- ClearIndicator
3999
+ ClearIndicator,
4000
+ NoOptionsMessage
3996
4001
  },
3997
4002
  ...rest,
3998
4003
  styles: { ...selectStyles(colorMode, isError), ...styles },
@@ -4015,7 +4020,8 @@ function SelectAsyncCreatable({ styles, isError = false, ...rest }) {
4015
4020
  maxMenuHeight: 320,
4016
4021
  components: {
4017
4022
  DropdownIndicator,
4018
- ClearIndicator
4023
+ ClearIndicator,
4024
+ NoOptionsMessage
4019
4025
  },
4020
4026
  ...rest,
4021
4027
  styles: { ...selectStyles(colorMode, isError), ...styles },
@@ -4037,7 +4043,8 @@ function SelectCreatable({ styles, isError = false, ...rest }) {
4037
4043
  maxMenuHeight: 320,
4038
4044
  components: {
4039
4045
  DropdownIndicator,
4040
- ClearIndicator
4046
+ ClearIndicator,
4047
+ NoOptionsMessage
4041
4048
  },
4042
4049
  ...rest,
4043
4050
  styles: { ...selectStyles(colorMode, isError), ...styles },
@@ -4172,6 +4179,7 @@ var SelectCheckbox = (props) => {
4172
4179
  ClearIndicator,
4173
4180
  MultiValue,
4174
4181
  MultiValueRemove,
4182
+ NoOptionsMessage,
4175
4183
  Option: (optionProps) => {
4176
4184
  const { isSelected, data } = optionProps;
4177
4185
  const optionLength = (options == null ? void 0 : options.length) ? options.length - 1 : 0;
@@ -4214,8 +4222,8 @@ var Sidebar = ({ isCollapse, children, ...props }) => {
4214
4222
  flexDirection: "column",
4215
4223
  overflow: "hidden",
4216
4224
  shadow: "raised",
4225
+ initial: { width: isCollapse ? "62px" : width },
4217
4226
  animate: { width: isCollapse ? "62px" : width },
4218
- transition: "10ms linear",
4219
4227
  ...props,
4220
4228
  children
4221
4229
  }
@@ -4254,9 +4262,9 @@ var SidebarHeader = ({ isCollapse, setCollapse, title }) => {
4254
4262
  {
4255
4263
  as: motion2.div,
4256
4264
  boxSize: "4",
4265
+ initial: { rotate: 0, x: 8 },
4257
4266
  animate: { rotate: isCollapse ? 0 : -180, x: isCollapse ? 8 : 0 },
4258
- transition: "ease-in-out",
4259
- transitionDuration: "1ms",
4267
+ transitionTimingFunction: "linear",
4260
4268
  "aria-label": "toggle sidebar",
4261
4269
  children: /* @__PURE__ */ jsx59(ArrowRight, { size: 4, color: "inherit" })
4262
4270
  }
@@ -4306,130 +4314,142 @@ import * as Icon8 from "@ctlyst.id/internal-icon";
4306
4314
  import { motion as motion3 } from "framer-motion";
4307
4315
  import { Fragment as Fragment9, jsx as jsx60, jsxs as jsxs26 } from "react/jsx-runtime";
4308
4316
  var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, setActive, active }) => {
4309
- return /* @__PURE__ */ jsx60(Box28, { as: motion3.div, animate: { padding: isCollapse ? "8px 16px" : "8px" }, children: /* @__PURE__ */ jsx60(Accordion2, { index: menu.findIndex((item) => item.children.some((child) => child.navLink === active)), children: menu.map((item) => {
4310
- const isActive = active == null ? void 0 : active.includes(item.navLink);
4311
- return /* @__PURE__ */ jsx60(AccordionItem2, { mt: "4", children: ({ isExpanded }) => {
4312
- const isOpenOptions = isCollapse || !isCollapse && !isExpanded;
4313
- const noChild = !item.children.length;
4314
- const offsetStyle = isCollapse ? noChild ? [-5, 16] : [-1, 16] : [-1, 8];
4315
- return /* @__PURE__ */ jsxs26(Fragment9, { children: [
4316
- /* @__PURE__ */ jsx60(Popover6, { trigger: "hover", placement: "right-start", offset: offsetStyle, children: ({ isOpen, onClose }) => {
4317
- const activeOption = isOpen ? "primary.50" : "white";
4318
- const backgroundColor = isOpen && !isActive ? "primary.50" : "primary.100";
4319
- const activeParent = isActive ? backgroundColor : activeOption;
4317
+ return /* @__PURE__ */ jsx60(
4318
+ Box28,
4319
+ {
4320
+ as: motion3.div,
4321
+ transitionTimingFunction: "linear",
4322
+ initial: { padding: "8px" },
4323
+ animate: { padding: isCollapse ? "8px 16px" : "8px" },
4324
+ children: /* @__PURE__ */ jsx60(Accordion2, { index: menu.findIndex((item) => item.children.some((child) => child.navLink === active)), children: menu.map((item) => {
4325
+ const isActive = active == null ? void 0 : active.includes(item.navLink);
4326
+ return /* @__PURE__ */ jsx60(AccordionItem2, { mt: "4", children: ({ isExpanded }) => {
4327
+ const isOpenOptions = isCollapse || !isCollapse && !isExpanded;
4328
+ const noChild = !item.children.length;
4329
+ const offsetStyle = isCollapse ? noChild ? [-5, 16] : [-1, 16] : [-1, 8];
4320
4330
  return /* @__PURE__ */ jsxs26(Fragment9, { children: [
4321
- /* @__PURE__ */ jsx60(PopoverTrigger6, { children: /* @__PURE__ */ jsx60(
4322
- AccordionButton2,
4323
- {
4324
- "data-test-id": `CTA_button-accordion-${item.title}`,
4325
- p: "0",
4326
- h: "fit-content",
4327
- children: /* @__PURE__ */ jsxs26(
4331
+ /* @__PURE__ */ jsx60(Popover6, { trigger: "hover", placement: "right-start", offset: offsetStyle, children: ({ isOpen, onClose }) => {
4332
+ const activeOption = isOpen ? "primary.50" : "white";
4333
+ const backgroundColor = isOpen && !isActive ? "primary.50" : "primary.100";
4334
+ const activeParent = isActive ? backgroundColor : activeOption;
4335
+ return /* @__PURE__ */ jsxs26(Fragment9, { children: [
4336
+ /* @__PURE__ */ jsx60(PopoverTrigger6, { children: /* @__PURE__ */ jsx60(
4337
+ AccordionButton2,
4338
+ {
4339
+ "data-test-id": `CTA_button-accordion-${item.title}`,
4340
+ p: "0",
4341
+ h: "fit-content",
4342
+ children: /* @__PURE__ */ jsxs26(
4343
+ NavItem,
4344
+ {
4345
+ as: motion3.div,
4346
+ transitionTimingFunction: "linear",
4347
+ justifyContent: isCollapse ? "center" : "space-between",
4348
+ isActive,
4349
+ bg: activeParent,
4350
+ "data-test-id": `CTA_nav-item-${item.title}`,
4351
+ onClick: () => setActive(item.children.length > 0 ? item.children[0].navLink : item.navLink),
4352
+ position: "relative",
4353
+ ...itemStyles,
4354
+ children: [
4355
+ mappingIcon2 && /* @__PURE__ */ jsx60(Box28, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
4356
+ !isCollapse && /* @__PURE__ */ jsxs26(
4357
+ Box28,
4358
+ {
4359
+ display: "flex",
4360
+ w: "full",
4361
+ alignItems: "center",
4362
+ justifyContent: "space-between",
4363
+ ml: "2",
4364
+ as: motion3.div,
4365
+ transition: "20ms linear",
4366
+ transitionTimingFunction: "linear",
4367
+ initial: { opacity: 0, x: 24 },
4368
+ animate: { opacity: 1, x: 0 },
4369
+ exit: { opacity: 0, x: 16 },
4370
+ children: [
4371
+ /* @__PURE__ */ jsx60(Box28, { h: "3.5", position: "relative", children: /* @__PURE__ */ jsx60(Text16, { textStyle: "text.xs", w: "max-content", position: "absolute", children: item.title }) }),
4372
+ !!item.children.length && /* @__PURE__ */ jsx60(
4373
+ Box28,
4374
+ {
4375
+ display: "flex",
4376
+ boxSize: "3",
4377
+ as: motion3.div,
4378
+ transitionTimingFunction: "linear",
4379
+ animate: { transform: isExpanded ? "rotate(-180deg)" : "rotate(0)" },
4380
+ children: /* @__PURE__ */ jsx60(Icon8.ChevronDown, { size: 3 })
4381
+ }
4382
+ )
4383
+ ]
4384
+ }
4385
+ )
4386
+ ]
4387
+ },
4388
+ item.id
4389
+ )
4390
+ },
4391
+ item.id
4392
+ ) }, item.id),
4393
+ isOpenOptions && /* @__PURE__ */ jsx60(Portal4, { children: item.children.length > 0 ? /* @__PURE__ */ jsxs26(PopoverContent6, { w: "176px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: [
4394
+ /* @__PURE__ */ jsx60(PopoverHeader2, { borderColor: "neutral.300", textStyle: "text.xs", p: "2", children: mappingIcon2 && /* @__PURE__ */ jsxs26(Box28, { display: "flex", alignItems: "center", children: [
4395
+ mappingIcon2.get(item.icon || ""),
4396
+ /* @__PURE__ */ jsx60(Box28, { as: "span", ml: "2", children: item.title })
4397
+ ] }) }),
4398
+ !!item.children.length && /* @__PURE__ */ jsx60(PopoverBody4, { pb: "1", px: "0", pt: "0", children: item.children.map((submenu) => /* @__PURE__ */ jsx60(
4399
+ NavItem,
4400
+ {
4401
+ "data-test-id": `CTA_Sidebar-popover-item-${submenu.id}`,
4402
+ isChild: true,
4403
+ isActive: active === submenu.navLink,
4404
+ onClick: () => {
4405
+ setActive(submenu.navLink);
4406
+ onClose();
4407
+ },
4408
+ rounded: "none",
4409
+ ...itemStyles,
4410
+ children: submenu.title
4411
+ },
4412
+ submenu.id
4413
+ )) })
4414
+ ] }) : isCollapse && /* @__PURE__ */ jsx60(PopoverContent6, { w: "174px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: /* @__PURE__ */ jsx60(PopoverBody4, { py: "1", px: "0", children: /* @__PURE__ */ jsxs26(
4328
4415
  NavItem,
4329
4416
  {
4330
- as: motion3.div,
4331
- justifyContent: isCollapse ? "center" : "space-between",
4332
- isActive,
4333
- bg: activeParent,
4334
- "data-test-id": `CTA_nav-item-${item.title}`,
4335
- onClick: () => setActive(item.children.length > 0 ? item.children[0].navLink : item.navLink),
4336
- position: "relative",
4417
+ "data-test-id": `CTA_Sidebar-popover-item-${item.id}`,
4418
+ justifyContent: "flex-start",
4419
+ isActive: active === item.navLink,
4420
+ onClick: () => {
4421
+ setActive(item.navLink);
4422
+ onClose();
4423
+ },
4424
+ rounded: "none",
4337
4425
  ...itemStyles,
4338
4426
  children: [
4339
4427
  mappingIcon2 && /* @__PURE__ */ jsx60(Box28, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
4340
- !isCollapse && /* @__PURE__ */ jsxs26(
4341
- Box28,
4342
- {
4343
- display: "flex",
4344
- w: "full",
4345
- alignItems: "center",
4346
- justifyContent: "space-between",
4347
- ml: "2",
4348
- as: motion3.div,
4349
- transition: "20ms ease-in",
4350
- initial: { opacity: 0, x: 24 },
4351
- animate: { opacity: 1, x: 0 },
4352
- exit: { opacity: 0, x: 16 },
4353
- children: [
4354
- /* @__PURE__ */ jsx60(Box28, { h: "3.5", position: "relative", children: /* @__PURE__ */ jsx60(Text16, { textStyle: "text.xs", w: "max-content", position: "absolute", children: item.title }) }),
4355
- !!item.children.length && /* @__PURE__ */ jsx60(
4356
- Box28,
4357
- {
4358
- display: "flex",
4359
- boxSize: "3",
4360
- as: motion3.div,
4361
- animate: { transform: isExpanded ? "rotate(-180deg)" : "rotate(0)" },
4362
- children: /* @__PURE__ */ jsx60(Icon8.ChevronDown, { size: 3 })
4363
- }
4364
- )
4365
- ]
4366
- }
4367
- )
4428
+ /* @__PURE__ */ jsx60(Box28, { h: "3.5", position: "relative", ml: "2", children: /* @__PURE__ */ jsx60(Text16, { textStyle: "text.xs", w: "max-content", position: "absolute", children: item.title }) })
4368
4429
  ]
4369
4430
  },
4370
4431
  item.id
4371
- )
4372
- },
4373
- item.id
4374
- ) }, item.id),
4375
- isOpenOptions && /* @__PURE__ */ jsx60(Portal4, { children: item.children.length > 0 ? /* @__PURE__ */ jsxs26(PopoverContent6, { w: "176px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: [
4376
- /* @__PURE__ */ jsx60(PopoverHeader2, { borderColor: "neutral.300", textStyle: "text.xs", p: "2", children: mappingIcon2 && /* @__PURE__ */ jsxs26(Box28, { display: "flex", alignItems: "center", children: [
4377
- mappingIcon2.get(item.icon || ""),
4378
- /* @__PURE__ */ jsx60(Box28, { as: "span", ml: "2", children: item.title })
4379
- ] }) }),
4380
- !!item.children.length && /* @__PURE__ */ jsx60(PopoverBody4, { pb: "1", px: "0", pt: "0", children: item.children.map((submenu) => /* @__PURE__ */ jsx60(
4381
- NavItem,
4382
- {
4383
- "data-test-id": `CTA_Sidebar-popover-item-${submenu.id}`,
4384
- isChild: true,
4385
- isActive: active === submenu.navLink,
4386
- onClick: () => {
4387
- setActive(submenu.navLink);
4388
- onClose();
4389
- },
4390
- rounded: "none",
4391
- ...itemStyles,
4392
- children: submenu.title
4393
- },
4394
- submenu.id
4395
- )) })
4396
- ] }) : isCollapse && /* @__PURE__ */ jsx60(PopoverContent6, { w: "174px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: /* @__PURE__ */ jsx60(PopoverBody4, { py: "1", px: "0", children: /* @__PURE__ */ jsxs26(
4432
+ ) }) }) })
4433
+ ] });
4434
+ } }, item.id),
4435
+ !isCollapse && /* @__PURE__ */ jsx60(AccordionPanel2, { mt: "1", p: "0", children: item.children.map((submenu) => /* @__PURE__ */ jsx60(
4397
4436
  NavItem,
4398
4437
  {
4399
- "data-test-id": `CTA_Sidebar-popover-item-${item.id}`,
4400
- justifyContent: "flex-start",
4401
- isActive: active === item.navLink,
4402
- onClick: () => {
4403
- setActive(item.navLink);
4404
- onClose();
4405
- },
4406
- rounded: "none",
4438
+ mt: "1",
4439
+ "data-test-id": `CTA_Sidebar-accordion-item-${submenu.id}`,
4440
+ isActive: active === submenu.navLink,
4441
+ isChild: true,
4407
4442
  ...itemStyles,
4408
- children: [
4409
- mappingIcon2 && /* @__PURE__ */ jsx60(Box28, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
4410
- /* @__PURE__ */ jsx60(Box28, { h: "3.5", position: "relative", ml: "2", children: /* @__PURE__ */ jsx60(Text16, { textStyle: "text.xs", w: "max-content", position: "absolute", children: item.title }) })
4411
- ]
4443
+ onClick: () => setActive(submenu.navLink),
4444
+ children: submenu.title
4412
4445
  },
4413
- item.id
4414
- ) }) }) })
4446
+ submenu.id
4447
+ )) })
4415
4448
  ] });
4416
- } }, item.id),
4417
- !isCollapse && /* @__PURE__ */ jsx60(AccordionPanel2, { mt: "1", p: "0", children: item.children.map((submenu) => /* @__PURE__ */ jsx60(
4418
- NavItem,
4419
- {
4420
- mt: "1",
4421
- "data-test-id": `CTA_Sidebar-accordion-item-${submenu.id}`,
4422
- isActive: active === submenu.navLink,
4423
- isChild: true,
4424
- ...itemStyles,
4425
- onClick: () => setActive(submenu.navLink),
4426
- children: submenu.title
4427
- },
4428
- submenu.id
4429
- )) })
4430
- ] });
4431
- } }, item.id);
4432
- }) }) });
4449
+ } }, item.id);
4450
+ }) })
4451
+ }
4452
+ );
4433
4453
  };
4434
4454
  SidebarMenu.displayName = "SidebarMenu";
4435
4455
  SidebarMenu.defaultProps = {
@@ -6979,6 +6999,7 @@ export {
6979
6999
  NavItem,
6980
7000
  Navbar,
6981
7001
  navigation_bar_default as NavigationBar,
7002
+ NoOptionsMessage,
6982
7003
  OrderedList,
6983
7004
  pagination_default as Pagination,
6984
7005
  pagination_detail_default as PaginationDetail,