@ctlyst.id/internal-ui 5.6.0 → 5.6.2

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.d.mts CHANGED
@@ -976,6 +976,33 @@ declare const getTheme: (foundations: Record<string, any>) => Record<string, any
976
976
  declare const theme: Record<string, any>;
977
977
  type Theme = typeof theme;
978
978
 
979
+ declare class DragThreshold {
980
+ isDrag: boolean;
981
+ mouseDown: boolean;
982
+ x0: number;
983
+ y0: number;
984
+ /** threshold for dragging behavior in pixel
985
+ * @type {number}
986
+ */
987
+ threshold: number;
988
+ constructor();
989
+ reset(): void;
990
+ start(x: number, y: number): void;
991
+ move(x: number, y: number): void;
992
+ isDragged(): boolean;
993
+ }
994
+
995
+ interface DragOrClickOption {
996
+ onMouseDown?: (e: React.MouseEvent) => void;
997
+ onMouseMove?: (e: React.MouseEvent) => void;
998
+ onMouseUp?: (e: React.MouseEvent) => void;
999
+ onClick?: (e: React.MouseEvent) => void;
1000
+ }
1001
+ declare const useDragOrClick: () => {
1002
+ clickOrDragged: DragThreshold;
1003
+ getDragOrClickProps: ({ onClick, onMouseDown, onMouseMove, onMouseUp, }: DragOrClickOption) => Omit<DragOrClickOption, 'onClick'>;
1004
+ };
1005
+
979
1006
  declare function useFetcher(): {
980
1007
  fetcher: <TResponse = unknown>({ url, data, method, headers, ...config }: AxiosRequestConfig) => Promise<axios.AxiosResponse<TResponse, any>>;
981
1008
  };
@@ -996,4 +1023,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
996
1023
  declare const useInternalUI: () => ProviderContextObject;
997
1024
  declare const Provider: FC<ProviderProps>;
998
1025
 
999
- export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, DEFAULT_EXCEL_MIME_TYPE, DEFAULT_IMAGE_MIME_TYPE, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, DropdownIndicator, EXCEL_EXT, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, IMG_EXT, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, ONE_MEGA_BYTE, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, PopoverContent, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, concatList, createExtendTheme, defaultOnHandleRejections, dimensionValidator, formatValidationMessage, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, messages, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useFetcher, useInternalUI, useSelectTable, useToast };
1026
+ export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, DEFAULT_EXCEL_MIME_TYPE, DEFAULT_IMAGE_MIME_TYPE, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, type DragOrClickOption, DropdownIndicator, EXCEL_EXT, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, IMG_EXT, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, ONE_MEGA_BYTE, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, PopoverContent, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, concatList, createExtendTheme, defaultOnHandleRejections, dimensionValidator, formatValidationMessage, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, messages, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useDragOrClick, useFetcher, useInternalUI, useSelectTable, useToast };
package/dist/index.d.ts CHANGED
@@ -976,6 +976,33 @@ declare const getTheme: (foundations: Record<string, any>) => Record<string, any
976
976
  declare const theme: Record<string, any>;
977
977
  type Theme = typeof theme;
978
978
 
979
+ declare class DragThreshold {
980
+ isDrag: boolean;
981
+ mouseDown: boolean;
982
+ x0: number;
983
+ y0: number;
984
+ /** threshold for dragging behavior in pixel
985
+ * @type {number}
986
+ */
987
+ threshold: number;
988
+ constructor();
989
+ reset(): void;
990
+ start(x: number, y: number): void;
991
+ move(x: number, y: number): void;
992
+ isDragged(): boolean;
993
+ }
994
+
995
+ interface DragOrClickOption {
996
+ onMouseDown?: (e: React.MouseEvent) => void;
997
+ onMouseMove?: (e: React.MouseEvent) => void;
998
+ onMouseUp?: (e: React.MouseEvent) => void;
999
+ onClick?: (e: React.MouseEvent) => void;
1000
+ }
1001
+ declare const useDragOrClick: () => {
1002
+ clickOrDragged: DragThreshold;
1003
+ getDragOrClickProps: ({ onClick, onMouseDown, onMouseMove, onMouseUp, }: DragOrClickOption) => Omit<DragOrClickOption, 'onClick'>;
1004
+ };
1005
+
979
1006
  declare function useFetcher(): {
980
1007
  fetcher: <TResponse = unknown>({ url, data, method, headers, ...config }: AxiosRequestConfig) => Promise<axios.AxiosResponse<TResponse, any>>;
981
1008
  };
@@ -996,4 +1023,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
996
1023
  declare const useInternalUI: () => ProviderContextObject;
997
1024
  declare const Provider: FC<ProviderProps>;
998
1025
 
999
- export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, DEFAULT_EXCEL_MIME_TYPE, DEFAULT_IMAGE_MIME_TYPE, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, DropdownIndicator, EXCEL_EXT, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, IMG_EXT, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, ONE_MEGA_BYTE, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, PopoverContent, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, concatList, createExtendTheme, defaultOnHandleRejections, dimensionValidator, formatValidationMessage, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, messages, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useFetcher, useInternalUI, useSelectTable, useToast };
1026
+ export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, DEFAULT_EXCEL_MIME_TYPE, DEFAULT_IMAGE_MIME_TYPE, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, type DragOrClickOption, DropdownIndicator, EXCEL_EXT, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, IMG_EXT, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, ONE_MEGA_BYTE, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, PopoverContent, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, concatList, createExtendTheme, defaultOnHandleRejections, dimensionValidator, formatValidationMessage, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, messages, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useDragOrClick, useFetcher, useInternalUI, useSelectTable, useToast };
package/dist/index.js CHANGED
@@ -378,6 +378,7 @@ __export(src_exports, {
378
378
  useDataTable: () => useDataTable,
379
379
  useDimensions: () => import_react110.useDimensions,
380
380
  useDisclosure: () => import_react110.useDisclosure,
381
+ useDragOrClick: () => useDragOrClick,
381
382
  useDrawerContext: () => import_react58.useDrawerContext,
382
383
  useFetcher: () => useFetcher,
383
384
  useImage: () => import_react98.useImage,
@@ -1684,16 +1685,7 @@ var DataTable = React5.forwardRef((props, ref) => {
1684
1685
  _first: { paddingLeft: `${paddingRowX + 8}px` },
1685
1686
  _last: { paddingRight: `${paddingRowX + 8}px` },
1686
1687
  ...styles == null ? void 0 : styles.tableColumnHeader,
1687
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1688
- import_react30.Flex,
1689
- {
1690
- "data-test-id": "CT_component_data-table_loader",
1691
- textTransform: "capitalize",
1692
- align: "center",
1693
- gap: 2,
1694
- children: (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext())
1695
- }
1696
- )
1688
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react30.Flex, { "data-test-id": "CT_component_data-table_loader", align: "center", gap: 2, children: (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()) })
1697
1689
  },
1698
1690
  header.id
1699
1691
  )) }, headerGroup.id)) }),
@@ -1733,23 +1725,22 @@ var DataTable = React5.forwardRef((props, ref) => {
1733
1725
  backgroundColor: "white",
1734
1726
  height: "100%",
1735
1727
  "data-test-id": `CT_Container_TableHeader_${header.id}`,
1736
- textTransform: "capitalize",
1737
1728
  userSelect: "none",
1738
1729
  align: "center",
1739
1730
  gap: 2,
1740
1731
  children: [
1741
1732
  (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()),
1742
- (_b2 = header.column.getCanSort() && {
1743
- asc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronUpIcon, { h: 4, w: 4, color: "neutral.500" }),
1744
- desc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronDownIcon, { h: 4, w: 4, color: "neutral.500" })
1745
- }[header.column.getIsSorted()]) != null ? _b2 : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1733
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1746
1734
  import_react30.Box,
1747
1735
  {
1748
1736
  as: "span",
1749
1737
  cursor: header.column.getCanSort() ? "pointer" : "default",
1750
1738
  "data-test-id": `CT_Container_SortingIcon_${header.id}`,
1751
1739
  onClick: header.column.getToggleSortingHandler(),
1752
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react30.Box, { display: "flex", justifyContent: "center", alignItems: "center", boxSize: 4, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.UpDownIcon, { color: "neutral.500" }) })
1740
+ children: (_b2 = header.column.getCanSort() && {
1741
+ asc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronUpIcon, { h: 4, w: 4, color: "neutral.500" }),
1742
+ desc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronDownIcon, { h: 4, w: 4, color: "neutral.500" })
1743
+ }[header.column.getIsSorted()]) != null ? _b2 : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react30.Box, { display: "flex", justifyContent: "center", alignItems: "center", boxSize: 4, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.UpDownIcon, { color: "neutral.500" }) })
1753
1744
  }
1754
1745
  )
1755
1746
  ]
@@ -7823,7 +7814,7 @@ var baseStyle11 = definePartsStyle10({
7823
7814
  th: {
7824
7815
  fontFamily: "heading",
7825
7816
  fontWeight: "semibold",
7826
- textTransform: "uppercase",
7817
+ textTransform: "capitalize",
7827
7818
  letterSpacing: "normal",
7828
7819
  textAlign: "start",
7829
7820
  height: "50px",
@@ -8589,6 +8580,7 @@ var import_react111 = require("@chakra-ui/react");
8589
8580
  useDataTable,
8590
8581
  useDimensions,
8591
8582
  useDisclosure,
8583
+ useDragOrClick,
8592
8584
  useDrawerContext,
8593
8585
  useFetcher,
8594
8586
  useImage,