@ctlyst.id/internal-ui 4.0.2 → 4.1.0

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
@@ -4731,12 +4731,20 @@ var InputOption = ({
4731
4731
  (data == null ? void 0 : data.selectAllCheckbox) ? /* @__PURE__ */ jsx57(
4732
4732
  Checkbox3,
4733
4733
  {
4734
+ onClick: (e) => e.stopPropagation(),
4734
4735
  isChecked: checkedState === CHECKBOX_STATE.CHECKED,
4735
4736
  isIndeterminate: checkedState === CHECKBOX_STATE.INDETERMINATE,
4736
4737
  isDisabled,
4737
4738
  "data-test-id": "CT_component_select-checkbox_select-all-option"
4738
4739
  }
4739
- ) : /* @__PURE__ */ jsx57(Checkbox3, { isChecked: isSelected, "data-test-id": "CT_component_select-checkbox_option-checkbox" }),
4740
+ ) : /* @__PURE__ */ jsx57(
4741
+ Checkbox3,
4742
+ {
4743
+ onClick: (e) => e.stopPropagation(),
4744
+ isChecked: isSelected,
4745
+ "data-test-id": "CT_component_select-checkbox_option-checkbox"
4746
+ }
4747
+ ),
4740
4748
  /* @__PURE__ */ jsx57(Text14, { textStyle: "text.sm", "data-test-id": `select-checkbox-option-label-${data.value}`, children })
4741
4749
  ]
4742
4750
  }
@@ -5334,6 +5342,12 @@ var useTimescape = (options = {}) => {
5334
5342
 
5335
5343
  // src/components/time-input/components/index.tsx
5336
5344
  import { Fragment as Fragment10, jsx as jsx63, jsxs as jsxs29 } from "react/jsx-runtime";
5345
+ var timeDigitFormat = (number) => {
5346
+ if (number.toString().length === 1) {
5347
+ return `0${number}`;
5348
+ }
5349
+ return number;
5350
+ };
5337
5351
  var Time = class {
5338
5352
  constructor(hours, minutes, seconds) {
5339
5353
  __publicField(this, "hours");
@@ -5344,9 +5358,13 @@ var Time = class {
5344
5358
  this.seconds = seconds != null ? seconds : 0;
5345
5359
  }
5346
5360
  toString() {
5347
- return `${this.hours}:${this.minutes}:${this.seconds}`;
5361
+ return `${timeDigitFormat(this.hours)}:${timeDigitFormat(this.minutes)}:${timeDigitFormat(this.seconds)}`;
5348
5362
  }
5349
5363
  };
5364
+ var timeFromString = (timeString) => {
5365
+ const [hours, minutes, seconds] = timeString.split(":");
5366
+ return new Time(Number(hours), Number(minutes), Number(seconds));
5367
+ };
5350
5368
  var InputTimeArea = forwardRef12((props, ref) => {
5351
5369
  return /* @__PURE__ */ jsx63(
5352
5370
  Input3,
@@ -5475,7 +5493,8 @@ var TimeInput2 = forwardRef12(
5475
5493
  );
5476
5494
 
5477
5495
  // src/components/toast/components/toast.tsx
5478
- import { chakra as chakra7, Flex as Flex18, Link as Link6, useToken } from "@chakra-ui/react";
5496
+ import { Box as Box30, chakra as chakra7, Flex as Flex18, Link as Link6, useToken } from "@chakra-ui/react";
5497
+ import { Close as Close6 } from "@ctlyst.id/internal-icon";
5479
5498
  import { Bounce, toast } from "react-toastify";
5480
5499
 
5481
5500
  // src/components/toast/components/styles.tsx
@@ -5515,6 +5534,10 @@ var styles_default2 = Styles2;
5515
5534
 
5516
5535
  // src/components/toast/components/toast.tsx
5517
5536
  import { Fragment as Fragment11, jsx as jsx65, jsxs as jsxs30 } from "react/jsx-runtime";
5537
+ var CustomCloseButton = (props) => {
5538
+ const { closeToast } = props;
5539
+ return /* @__PURE__ */ jsx65(Box30, { p: 2, alignItems: "center", display: "flex", "data-test-id": "", cursor: "pointer", onClick: closeToast, children: /* @__PURE__ */ jsx65(Close6, { size: 4, color: "white" }) });
5540
+ };
5518
5541
  var DEFAULT_OPTIONS = {
5519
5542
  position: "top-right",
5520
5543
  autoClose: 5e3,
@@ -5524,7 +5547,7 @@ var DEFAULT_OPTIONS = {
5524
5547
  draggable: true,
5525
5548
  icon: false,
5526
5549
  theme: "colored",
5527
- closeButton: true,
5550
+ closeButton: CustomCloseButton,
5528
5551
  className: "container-toast",
5529
5552
  transition: Bounce
5530
5553
  };
@@ -5633,7 +5656,7 @@ import { ToastContainer } from "react-toastify";
5633
5656
 
5634
5657
  // src/components/uploader/components/uploader.tsx
5635
5658
  import {
5636
- Box as Box30,
5659
+ Box as Box31,
5637
5660
  Button as Button7,
5638
5661
  Flex as Flex19,
5639
5662
  FormControl as FormControl4,
@@ -5828,7 +5851,7 @@ var Uploader = ({
5828
5851
  }
5829
5852
  return helperText;
5830
5853
  };
5831
- const renderErrorText = (text2) => /* @__PURE__ */ jsx66(Box30, { mb: 2, children: /* @__PURE__ */ jsx66(Text18, { textStyle: "text.xs", color: "danger.500", children: text2 }) });
5854
+ const renderErrorText = (text2) => /* @__PURE__ */ jsx66(Box31, { mb: 2, children: /* @__PURE__ */ jsx66(Text18, { textStyle: "text.xs", color: "danger.500", children: text2 }) });
5832
5855
  const handleRemove = (e) => {
5833
5856
  e.stopPropagation();
5834
5857
  setFilePreview(void 0);
@@ -5877,7 +5900,7 @@ var Uploader = ({
5877
5900
  ...props,
5878
5901
  ...getRootProps(),
5879
5902
  children: [
5880
- filePreview && isShowCloseButton && /* @__PURE__ */ jsx66(Box30, { position: "absolute", top: 1, right: 1, children: /* @__PURE__ */ jsx66(
5903
+ filePreview && isShowCloseButton && /* @__PURE__ */ jsx66(Box31, { position: "absolute", top: 1, right: 1, children: /* @__PURE__ */ jsx66(
5881
5904
  Button7,
5882
5905
  {
5883
5906
  "data-test-id": `CT_component_base-image-uploader_remove-image${testId ? `_${testId}` : ""}`,
@@ -5895,7 +5918,7 @@ var Uploader = ({
5895
5918
  children: /* @__PURE__ */ jsx66(X, { size: 3, color: "white" })
5896
5919
  }
5897
5920
  ) }),
5898
- filePreview && /* @__PURE__ */ jsx66(Box30, { w: "full", children: /* @__PURE__ */ jsx66(
5921
+ filePreview && /* @__PURE__ */ jsx66(Box31, { w: "full", children: /* @__PURE__ */ jsx66(
5899
5922
  Flex19,
5900
5923
  {
5901
5924
  position: "relative",
@@ -5915,7 +5938,7 @@ var Uploader = ({
5915
5938
  ) }),
5916
5939
  !filePreview && /* @__PURE__ */ jsx66(Fragment12, { children: isDragActive ? /* @__PURE__ */ jsx66(Text18, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ jsxs31(Flex19, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
5917
5940
  size2 === "sm" && /* @__PURE__ */ jsx66(Plus, { size: 6, color }),
5918
- /* @__PURE__ */ jsxs31(Box30, { children: [
5941
+ /* @__PURE__ */ jsxs31(Box31, { children: [
5919
5942
  !filePreview && /* @__PURE__ */ jsx66(
5920
5943
  Heading2,
5921
5944
  {
@@ -8078,6 +8101,7 @@ export {
8078
8101
  selectStyles,
8079
8102
  theme4 as theme,
8080
8103
  themeSelect,
8104
+ timeFromString,
8081
8105
  useAccordion,
8082
8106
  useAccordionContext,
8083
8107
  useAccordionItem,