@tecsinapse/cortex-react 2.3.0-beta.0 → 2.3.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.
Files changed (109) hide show
  1. package/dist/cjs/components/Accordion/Root.js +6 -0
  2. package/dist/cjs/components/Accordion/Trigger.js +33 -13
  3. package/dist/cjs/components/Autocomplete/GroupedOptions.js +42 -0
  4. package/dist/cjs/components/Autocomplete/Option.js +40 -0
  5. package/dist/cjs/components/Autocomplete/Options.js +36 -0
  6. package/dist/cjs/components/Autocomplete/Popover.js +34 -0
  7. package/dist/cjs/components/Autocomplete/Root.js +40 -0
  8. package/dist/cjs/components/Autocomplete/Trigger.js +47 -0
  9. package/dist/cjs/components/Autocomplete/context.js +7 -0
  10. package/dist/cjs/components/Autocomplete/index.js +19 -0
  11. package/dist/cjs/components/Avatar.js +1 -1
  12. package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js +1 -1
  13. package/dist/cjs/components/Calendar/CalendarGrid.js +1 -1
  14. package/dist/cjs/components/ColorPicker.js +9 -18
  15. package/dist/cjs/components/Kanban.js +1 -1
  16. package/dist/cjs/components/PhoneInput/Option.js +2 -2
  17. package/dist/cjs/components/PhoneInput/Options.js +3 -0
  18. package/dist/cjs/components/PhoneInput/Popover.js +1 -1
  19. package/dist/cjs/components/PhoneInput/Trigger.js +3 -0
  20. package/dist/cjs/components/Popover/Content.js +1 -1
  21. package/dist/cjs/components/ScrollableDigitSelector.js +1 -1
  22. package/dist/cjs/components/Select/Popover.js +1 -1
  23. package/dist/cjs/components/Skeleton.js +1 -1
  24. package/dist/cjs/components/Stepper/Root.js +1 -1
  25. package/dist/cjs/components/TimePicker/TimePickerInput.js +1 -1
  26. package/dist/cjs/components/TimePicker/TimePickerSelector.js +2 -2
  27. package/dist/cjs/components/Uploader/Dropzone.js +3 -3
  28. package/dist/cjs/components/Uploader/Files.js +2 -2
  29. package/dist/cjs/components/Uploader/Manager.js +2 -2
  30. package/dist/cjs/components/Uploader/Modal.js +1 -1
  31. package/dist/cjs/components/Uploader/Upload.js +2 -2
  32. package/dist/cjs/hooks/useAutocompleteGroupedOptions.js +35 -0
  33. package/dist/cjs/hooks/useAutocompleteOptions.js +35 -0
  34. package/dist/cjs/hooks/useFileUpload.js +3 -3
  35. package/dist/cjs/index.js +4 -2
  36. package/dist/cjs/provider/ManagerContext.js +3 -0
  37. package/dist/cjs/styles/calendar-cell.js +5 -5
  38. package/dist/cjs/styles/date-picker-input-base.js +1 -1
  39. package/dist/cjs/styles/date-segment.js +2 -2
  40. package/dist/cjs/styles/groupButton.js +3 -3
  41. package/dist/cjs/styles/menubar.js +8 -8
  42. package/dist/cjs/styles/progressBar.js +1 -1
  43. package/dist/cjs/styles/stepNodeVariants.js +2 -2
  44. package/dist/cjs/styles/time-field-input.js +1 -1
  45. package/dist/esm/components/Accordion/Root.js +6 -0
  46. package/dist/esm/components/Accordion/Trigger.js +33 -13
  47. package/dist/esm/components/Autocomplete/GroupedOptions.js +40 -0
  48. package/dist/esm/components/Autocomplete/Option.js +38 -0
  49. package/dist/esm/components/Autocomplete/Options.js +34 -0
  50. package/dist/esm/components/Autocomplete/Popover.js +32 -0
  51. package/dist/esm/components/Autocomplete/Root.js +38 -0
  52. package/dist/esm/components/Autocomplete/Trigger.js +45 -0
  53. package/dist/esm/components/Autocomplete/context.js +5 -0
  54. package/dist/esm/components/Autocomplete/index.js +17 -0
  55. package/dist/esm/components/Avatar.js +1 -1
  56. package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js +1 -1
  57. package/dist/esm/components/Calendar/CalendarGrid.js +1 -1
  58. package/dist/esm/components/ColorPicker.js +9 -18
  59. package/dist/esm/components/Kanban.js +1 -1
  60. package/dist/esm/components/PhoneInput/Option.js +2 -2
  61. package/dist/esm/components/PhoneInput/Options.js +3 -0
  62. package/dist/esm/components/PhoneInput/Popover.js +1 -1
  63. package/dist/esm/components/PhoneInput/Trigger.js +3 -0
  64. package/dist/esm/components/Popover/Content.js +1 -1
  65. package/dist/esm/components/ScrollableDigitSelector.js +1 -1
  66. package/dist/esm/components/Select/Popover.js +1 -1
  67. package/dist/esm/components/Skeleton.js +1 -1
  68. package/dist/esm/components/Stepper/Root.js +1 -1
  69. package/dist/esm/components/TimePicker/TimePickerInput.js +1 -1
  70. package/dist/esm/components/TimePicker/TimePickerSelector.js +2 -2
  71. package/dist/esm/components/Uploader/Dropzone.js +3 -3
  72. package/dist/esm/components/Uploader/Files.js +2 -2
  73. package/dist/esm/components/Uploader/Manager.js +2 -2
  74. package/dist/esm/components/Uploader/Modal.js +1 -1
  75. package/dist/esm/components/Uploader/Upload.js +2 -2
  76. package/dist/esm/hooks/useAutocompleteGroupedOptions.js +33 -0
  77. package/dist/esm/hooks/useAutocompleteOptions.js +33 -0
  78. package/dist/esm/hooks/useFileUpload.js +3 -3
  79. package/dist/esm/index.js +1 -0
  80. package/dist/esm/provider/ManagerContext.js +3 -0
  81. package/dist/esm/styles/calendar-cell.js +5 -5
  82. package/dist/esm/styles/date-picker-input-base.js +1 -1
  83. package/dist/esm/styles/date-segment.js +2 -2
  84. package/dist/esm/styles/groupButton.js +3 -3
  85. package/dist/esm/styles/menubar.js +8 -8
  86. package/dist/esm/styles/progressBar.js +1 -1
  87. package/dist/esm/styles/stepNodeVariants.js +2 -2
  88. package/dist/esm/styles/time-field-input.js +1 -1
  89. package/dist/types/components/Accordion/Root.d.ts +1 -1
  90. package/dist/types/components/Accordion/Trigger.d.ts +1 -1
  91. package/dist/types/components/Accordion/index.d.ts +2 -2
  92. package/dist/types/components/Accordion/types.d.ts +3 -0
  93. package/dist/types/components/Autocomplete/GroupedOptions.d.ts +2 -0
  94. package/dist/types/components/Autocomplete/Option.d.ts +2 -0
  95. package/dist/types/components/Autocomplete/Options.d.ts +2 -0
  96. package/dist/types/components/Autocomplete/Popover.d.ts +2 -0
  97. package/dist/types/components/Autocomplete/Root.d.ts +2 -0
  98. package/dist/types/components/Autocomplete/Trigger.d.ts +2 -0
  99. package/dist/types/components/Autocomplete/context.d.ts +10 -0
  100. package/dist/types/components/Autocomplete/index.d.ts +9 -0
  101. package/dist/types/components/Autocomplete/types.d.ts +50 -0
  102. package/dist/types/components/Uploader/Manager.d.ts +1 -1
  103. package/dist/types/components/Uploader/index.d.ts +1 -1
  104. package/dist/types/components/Uploader/types.d.ts +1 -1
  105. package/dist/types/components/index.d.ts +1 -0
  106. package/dist/types/hooks/useAutocompleteGroupedOptions.d.ts +9 -0
  107. package/dist/types/hooks/useAutocompleteOptions.d.ts +9 -0
  108. package/dist/types/hooks/useFileUpload.d.ts +2 -2
  109. package/package.json +3 -3
@@ -0,0 +1,45 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useContext, useRef, useEffect } from 'react';
3
+ import { Popover } from '../Popover/index.js';
4
+ import { Input } from '../Input/index.js';
5
+ import { AutocompleteContext } from './context.js';
6
+
7
+ const AutocompleteTrigger = ({
8
+ inputValue,
9
+ onChange,
10
+ label,
11
+ disabled,
12
+ placeholder
13
+ }) => {
14
+ const context = useContext(AutocompleteContext);
15
+ if (!context)
16
+ throw new Error("AutocompleteTrigger must be used within AutocompleteRoot");
17
+ const { setTriggerWidth, setOpen } = context;
18
+ const triggerRef = useRef(null);
19
+ useEffect(() => {
20
+ if (triggerRef.current && setTriggerWidth) {
21
+ const width = triggerRef.current.getBoundingClientRect().width;
22
+ setTriggerWidth(width);
23
+ }
24
+ }, [triggerRef.current, setTriggerWidth]);
25
+ const handleChange = (event) => {
26
+ onChange(event);
27
+ if (event.target.value.length > 0) {
28
+ setOpen(true);
29
+ } else {
30
+ setOpen(false);
31
+ }
32
+ };
33
+ return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx("div", { ref: triggerRef, children: /* @__PURE__ */ jsx(
34
+ Input.Root,
35
+ {
36
+ label: label ?? "Selecione uma op\xE7\xE3o",
37
+ value: inputValue,
38
+ onChange: handleChange,
39
+ disabled,
40
+ placeholder
41
+ }
42
+ ) }) });
43
+ };
44
+
45
+ export { AutocompleteTrigger };
@@ -0,0 +1,5 @@
1
+ import { createContext } from 'react';
2
+
3
+ const AutocompleteContext = createContext(void 0);
4
+
5
+ export { AutocompleteContext };
@@ -0,0 +1,17 @@
1
+ import { AutocompleteRoot } from './Root.js';
2
+ import { AutocompleteTrigger } from './Trigger.js';
3
+ import { AutocompletePopover } from './Popover.js';
4
+ import { AutocompleteOptions } from './Options.js';
5
+ import { AutocompleteOption } from './Option.js';
6
+ import { AutocompleteGroupedOptions } from './GroupedOptions.js';
7
+
8
+ const Autocomplete = {
9
+ Root: AutocompleteRoot,
10
+ Trigger: AutocompleteTrigger,
11
+ Popover: AutocompletePopover,
12
+ Options: AutocompleteOptions,
13
+ Option: AutocompleteOption,
14
+ GroupedOptions: AutocompleteGroupedOptions
15
+ };
16
+
17
+ export { Autocomplete };
@@ -14,7 +14,7 @@ const Avatar = ({ src, name, className, ...rest }) => {
14
14
  {
15
15
  ...rest,
16
16
  className: clsx(
17
- "rounded-pill bg-content-medium h-mega flex items-center justify-center cursor-pointer aspect-square",
17
+ "rounded-pill bg-secondary-dark h-mega flex items-center justify-center cursor-pointer aspect-square",
18
18
  className
19
19
  ),
20
20
  children: src && !hasError ? /* @__PURE__ */ jsx(
@@ -15,7 +15,7 @@ const BreadcrumbItem = ({
15
15
  {
16
16
  className: clsx(
17
17
  "no-underline",
18
- isLast ? "text-content-low cursor-default" : "text-content-medium cursor-pointer"
18
+ isLast ? "text-secondary-medium cursor-default" : "text-secondary-xdark cursor-pointer"
19
19
  ),
20
20
  children: title
21
21
  }
@@ -21,7 +21,7 @@ const CalendarGrid = ({ state }) => {
21
21
  return /* @__PURE__ */ jsx(
22
22
  "div",
23
23
  {
24
- className: "bg-surface-overlay rounded-micro px-deca py-mili",
24
+ className: "bg-white rounded-micro px-deca py-mili",
25
25
  "data-testid": "calendar-grid",
26
26
  children: /* @__PURE__ */ jsxs("table", { ...gridProps, className: "border-separate border-spacing-y-nano", children: [
27
27
  /* @__PURE__ */ jsx("thead", { ...headerProps, children: /* @__PURE__ */ jsx(CalendarGridHeaderRow, { weekDays }) }),
@@ -4,28 +4,19 @@ import { forwardRef } from 'react';
4
4
 
5
5
  const Box = forwardRef((props, ref) => {
6
6
  const { id, className, ...rest } = props;
7
- return /* @__PURE__ */ jsx(
8
- "div",
7
+ return /* @__PURE__ */ jsx("div", { className: clsx("w-tera h-kilo border overflow-hidden relative", className), children: /* @__PURE__ */ jsx(
8
+ "input",
9
9
  {
10
- className: clsx(
11
- "w-tera h-kilo border overflow-hidden relative",
12
- className
13
- ),
14
- children: /* @__PURE__ */ jsx(
15
- "input",
16
- {
17
- ...rest,
18
- id,
19
- type: "color",
20
- className: "bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default absolute -top-1.5 -right-1 w-peta h-giga",
21
- ref
22
- }
23
- )
10
+ ...rest,
11
+ id,
12
+ type: "color",
13
+ className: "bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default absolute -top-1.5 -right-1 w-peta h-giga",
14
+ ref
24
15
  }
25
- );
16
+ ) });
26
17
  });
27
18
  const Face = ({ children }) => {
28
- return /* @__PURE__ */ jsx("div", { className: "rounded-mili p-mili shadow-default bg-default flex flex-row items-center gap-2", children });
19
+ return /* @__PURE__ */ jsx("div", { className: "rounded-mili p-mili shadow-default bg-white flex flex-row items-center gap-2", children });
29
20
  };
30
21
  const Label = ({
31
22
  children,
@@ -7,7 +7,7 @@ const Root = ({ children, className, ...rest }) => {
7
7
  {
8
8
  ...rest,
9
9
  className: clsx(
10
- "border border-dashed border-content-low rounded-mili bg-content-inverse overflow-hidden",
10
+ "border border-dashed border-secondary-medium rounded-mili bg-secondary-xlight overflow-hidden",
11
11
  className
12
12
  ),
13
13
  children
@@ -8,14 +8,14 @@ const PhoneInputOption = ({
8
8
  return /* @__PURE__ */ jsxs(
9
9
  "button",
10
10
  {
11
- className: "flex w-full h-[2rem] items-center justify-between p-centi cursor-pointer hover:bg-content-inverse bg-inherit",
11
+ className: "flex w-full h-[2rem] items-center justify-between p-centi cursor-pointer hover:bg-secondary-xlight bg-inherit",
12
12
  onClick: () => {
13
13
  handleSelectCountry(country);
14
14
  },
15
15
  disabled: disableClick,
16
16
  children: [
17
17
  /* @__PURE__ */ jsx("span", { children: country?.name }),
18
- /* @__PURE__ */ jsxs("span", { className: "text-content-minimal text-sm", children: [
18
+ /* @__PURE__ */ jsxs("span", { className: "text-secondary-light text-sm", children: [
19
19
  "+",
20
20
  country?.dialCode
21
21
  ] })
@@ -61,6 +61,9 @@ import 'react-icons/hi2';
61
61
  import 'react-icons/fa6';
62
62
  import 'react-dom';
63
63
  import 'react-icons/io5';
64
+ import '../Autocomplete/context.js';
65
+ import '../Autocomplete/Options.js';
66
+ import '../Autocomplete/GroupedOptions.js';
64
67
  import { defaultCountries, parseCountry } from 'react-international-phone';
65
68
  import 'country-flag-icons/react/3x2';
66
69
 
@@ -8,7 +8,7 @@ const PhoneInputPopover = ({ children }) => {
8
8
  return /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(
9
9
  Popover.Content,
10
10
  {
11
- className: "bg-surface-overlay shadow-md rounded-md overflow-hidden h-full max-h-[30vh] outline-none z-9999",
11
+ className: "bg-white shadow-md rounded-md overflow-hidden h-full max-h-[30vh] outline-none z-9999",
12
12
  style: {
13
13
  width: triggerWidth ? `${triggerWidth}px` : "auto"
14
14
  },
@@ -59,6 +59,9 @@ import '../Tooltip.js';
59
59
  import 'react-icons/hi2';
60
60
  import 'react-icons/fa6';
61
61
  import 'react-dom';
62
+ import '../Autocomplete/context.js';
63
+ import '../Autocomplete/Options.js';
64
+ import '../Autocomplete/GroupedOptions.js';
62
65
  import './Options.js';
63
66
  import { usePhoneContext } from './context.js';
64
67
  import 'react-international-phone';
@@ -26,7 +26,7 @@ const PopoverContent = ({
26
26
  ref: refs.setFloating,
27
27
  ...getFloatingProps(),
28
28
  className: clsx(
29
- "border border-gray-200 bg-surface-inverse p-0 rounded-md shadow-default z-popover",
29
+ "border border-gray-200 bg-black p-[0px] rounded-md shadow-default z-popover",
30
30
  className
31
31
  ),
32
32
  style: {
@@ -44,7 +44,7 @@ const ScrollableDigitSelector = ({
44
44
  {
45
45
  className: clsx(
46
46
  "p-micro rounded-micro border-1 border-transparent hover:bg-primary-light hover:border-primary cursor-pointer",
47
- value === val && "bg-primary-medium text-white"
47
+ value === val && "bg-primary-medium text-on-primary"
48
48
  ),
49
49
  children: formatValue(val)
50
50
  }
@@ -9,7 +9,7 @@ const SelectPopover = ({ children }) => {
9
9
  return /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(
10
10
  Popover.Content,
11
11
  {
12
- className: "bg-surface-overlay max-h-[30vh] overflow-y-auto gap-y-mili flex flex-col p-0",
12
+ className: "bg-white max-h-[30vh] overflow-y-auto gap-y-mili flex flex-col p-0",
13
13
  style: {
14
14
  width: triggerWidth ? `${triggerWidth}px` : "auto",
15
15
  zIndex: 9999
@@ -7,7 +7,7 @@ const Skeleton = ({ className, children, ...rest }) => {
7
7
  {
8
8
  ...rest,
9
9
  "data-testid": "skeleton",
10
- className: clsx("animate-pulse bg-content-minimal", className),
10
+ className: clsx("animate-pulse bg-secondary-light", className),
11
11
  children
12
12
  }
13
13
  );
@@ -60,7 +60,7 @@ const Root = ({
60
60
  "div",
61
61
  {
62
62
  className: clsx(
63
- "flex w-full space-x-2 bg-surface-overlay p-4 pb-2 rounded-mili",
63
+ "flex w-full space-x-2 bg-white p-4 pb-2 rounded-mili",
64
64
  className
65
65
  ),
66
66
  children: React.Children.map(children, renderNode)
@@ -60,7 +60,7 @@ const TimePickerInputWithPopover = (props) => {
60
60
  /* @__PURE__ */ jsx(
61
61
  Popover.Content,
62
62
  {
63
- className: "bg-surface-overlay shadow-default border-none p-deca flex flex-col",
63
+ className: "bg-white shadow-default border-none p-deca flex flex-col",
64
64
  initialFocus: -1,
65
65
  children: /* @__PURE__ */ jsx(
66
66
  TimePickerSelector,
@@ -103,7 +103,7 @@ const TimePickerSelector = ({
103
103
  {
104
104
  className: clsx(
105
105
  dayPeriodStyle,
106
- !isPM && "bg-primary-medium text-white"
106
+ !isPM && "bg-primary-medium text-on-primary"
107
107
  ),
108
108
  children: "AM"
109
109
  }
@@ -120,7 +120,7 @@ const TimePickerSelector = ({
120
120
  {
121
121
  className: clsx(
122
122
  dayPeriodStyle,
123
- isPM && "bg-primary-medium text-white"
123
+ isPM && "bg-primary-medium text-on-primary"
124
124
  ),
125
125
  children: "PM"
126
126
  }
@@ -17,7 +17,7 @@ const Dropzone = ({
17
17
  {
18
18
  ...getRootProps(),
19
19
  className: clsx(
20
- "bg-surface-overlay w-full border-dashed border-2 p-deca flex flex-col justify-center rounded-mili overflow-auto h-[18rem]",
20
+ "bg-white w-full border-dashed border-2 p-deca flex flex-col justify-center rounded-mili overflow-auto h-[18rem]",
21
21
  {
22
22
  "border-success-medium bg-gray-100": isDragActive
23
23
  }
@@ -25,7 +25,7 @@ const Dropzone = ({
25
25
  children: [
26
26
  /* @__PURE__ */ jsx("input", { ...getInputProps() }),
27
27
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center text-center items-center", children: [
28
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
28
+ /* @__PURE__ */ jsxs("div", { children: [
29
29
  /* @__PURE__ */ jsx(
30
30
  HiOutlineCloudArrowUp,
31
31
  {
@@ -36,7 +36,7 @@ const Dropzone = ({
36
36
  /* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", "data-testid": "select-dropzone", children: selectFileText })
37
37
  ] }),
38
38
  hasButton ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-centi", children: [
39
- /* @__PURE__ */ jsx("p", { className: "text-sm text-content-low", children: dropText }),
39
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-secondary-medium", children: dropText }),
40
40
  isFileLimitReached ? /* @__PURE__ */ jsx(Tooltip, { text: "Voc\xEA s\xF3 pode selecionar um \xFAnico arquivo.", children: /* @__PURE__ */ jsx(
41
41
  "button",
42
42
  {
@@ -6,9 +6,9 @@ const Files = ({
6
6
  onDelete,
7
7
  uploadProgressText = "Upload(s) in progress"
8
8
  }) => {
9
- return /* @__PURE__ */ jsxs("div", { className: "bg-surface-overlay w-full border-2 p-deca flex flex-col overflow-y-auto rounded-mili h-[18rem]", children: [
9
+ return /* @__PURE__ */ jsxs("div", { className: "bg-white w-full border-2 p-deca flex flex-col overflow-y-auto rounded-mili h-[18rem]", children: [
10
10
  /* @__PURE__ */ jsxs("div", { className: "flex gap-mili items-center mb-deca", children: [
11
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-deca h-deca bg-primary-medium rounded-full text-micro text-white", children: `${files.length}` }),
11
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-deca h-deca bg-primary-medium rounded-full text-micro text-on-primary", children: `${files.length}` }),
12
12
  /* @__PURE__ */ jsx("h2", { className: "text-md font-semibold", "data-testid": "upload-progress", children: uploadProgressText })
13
13
  ] }),
14
14
  files.map((file, index) => /* @__PURE__ */ jsx(File, { file, index, onDelete }, file.uid))
@@ -13,7 +13,7 @@ const Manager = ({
13
13
  files,
14
14
  onDelete,
15
15
  uploadProgressText = "Upload(s) in progress",
16
- uploadSuccessText = "Upload(s) completed",
16
+ uploadResultText = "Upload(s) completed",
17
17
  onClose
18
18
  }) => {
19
19
  const {
@@ -45,7 +45,7 @@ const Manager = ({
45
45
  children: min ? /* @__PURE__ */ jsx(IoChevronUp, {}) : /* @__PURE__ */ jsx(IoChevronDown, {})
46
46
  }
47
47
  ),
48
- /* @__PURE__ */ jsx("h3", { "data-testid": "upload-progress", className: "font-bold text-h4", children: isLoading ? uploadProgressText : uploadSuccessText }),
48
+ /* @__PURE__ */ jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText : uploadResultText }),
49
49
  /* @__PURE__ */ jsx(
50
50
  Button,
51
51
  {
@@ -16,7 +16,7 @@ const Modal = ({
16
16
  {
17
17
  open,
18
18
  onClose,
19
- className: "flex flex-col bg-surface-base rounded-mili min-w-[70vw] max-w-[95vh] max-h-[95vh] overflow-auto text-default",
19
+ className: "flex flex-col bg-secondary-xlight rounded-mili min-w-[70vw] max-w-[95vh] max-h-[95vh] overflow-auto",
20
20
  children: [
21
21
  /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between mb-deca", children: [
22
22
  /* @__PURE__ */ jsx("h2", { className: "text-deca font-semibold ml-tera flex-1 text-center", children: title }),
@@ -103,8 +103,8 @@ const Folder = ({ name, subItems }) => {
103
103
  );
104
104
  const intent = useMemo(() => {
105
105
  if (loading) return "info";
106
- if ((subItems ?? []).some((item) => item.status === "error") && (subItems ?? []).some((item) => item.status === "success")) {
107
- return "warning";
106
+ if ((subItems ?? []).some((item) => item.status === "error")) {
107
+ return "error";
108
108
  }
109
109
  return "success";
110
110
  }, [subItems]);
@@ -0,0 +1,33 @@
1
+ import { useState, useEffect } from 'react';
2
+
3
+ const useAutocompleteGroupedOptions = ({
4
+ options: _options
5
+ }) => {
6
+ const [options, setOptions] = useState();
7
+ const [isLoading, setIsLoading] = useState();
8
+ const [error, setError] = useState();
9
+ const initData = async (fetch) => {
10
+ setIsLoading(true);
11
+ try {
12
+ const result = await fetch();
13
+ if (result) {
14
+ setOptions(result ?? []);
15
+ }
16
+ } catch (e) {
17
+ setError(String(e));
18
+ } finally {
19
+ setIsLoading(false);
20
+ }
21
+ };
22
+ useEffect(() => {
23
+ if (typeof _options === "function") initData(_options);
24
+ else setOptions(_options);
25
+ }, [_options]);
26
+ return {
27
+ isLoading,
28
+ options,
29
+ error
30
+ };
31
+ };
32
+
33
+ export { useAutocompleteGroupedOptions };
@@ -0,0 +1,33 @@
1
+ import { useState, useCallback, useEffect } from 'react';
2
+
3
+ const useAutocompleteOptions = ({
4
+ options: _options
5
+ }) => {
6
+ const [options, setOptions] = useState();
7
+ const [isLoading, setIsLoading] = useState();
8
+ const [error, setError] = useState();
9
+ const initData = useCallback(async (fetch) => {
10
+ setIsLoading(true);
11
+ try {
12
+ const result = await fetch();
13
+ if (result) {
14
+ setOptions(result ?? []);
15
+ }
16
+ } catch (e) {
17
+ setError(String(e));
18
+ } finally {
19
+ setIsLoading(false);
20
+ }
21
+ }, []);
22
+ useEffect(() => {
23
+ if (typeof _options === "function") initData(_options);
24
+ else setOptions(_options);
25
+ }, [_options]);
26
+ return {
27
+ isLoading,
28
+ options,
29
+ error
30
+ };
31
+ };
32
+
33
+ export { useAutocompleteOptions };
@@ -28,7 +28,7 @@ const useFileUpload = ({
28
28
  noClick = false,
29
29
  ignoreRejections = false,
30
30
  uploadProgressText,
31
- uploadSuccessText
31
+ uploadResultText
32
32
  }) => {
33
33
  const {
34
34
  showManager,
@@ -98,10 +98,10 @@ const useFileUpload = ({
98
98
  onClose: closeManager,
99
99
  onDelete: handleRemoveFile,
100
100
  uploadProgressText,
101
- uploadSuccessText
101
+ uploadResultText
102
102
  });
103
103
  }
104
- }, [handleRemoveFile, closeManager]);
104
+ }, [handleRemoveFile, closeManager, uploadResultText]);
105
105
  const addMimeTypes = (key, acc) => {
106
106
  AcceptSpecificMap[key].forEach((mimeType) => {
107
107
  acc[mimeType] = [];
package/dist/esm/index.js CHANGED
@@ -42,6 +42,7 @@ export { TimeFieldInput } from './components/TimePicker/TimeFieldInput.js';
42
42
  export { Toggle } from './components/Toggle.js';
43
43
  export { Tooltip } from './components/Tooltip.js';
44
44
  export { Uploader } from './components/Uploader/index.js';
45
+ export { Autocomplete } from './components/Autocomplete/index.js';
45
46
  export { PhoneInput } from './components/PhoneInput/index.js';
46
47
  export { useCalendar } from './hooks/useCalendar.js';
47
48
  export { useCalendarCell } from './hooks/useCalendarCell.js';
@@ -64,6 +64,9 @@ import '../components/Tooltip.js';
64
64
  import 'react-icons/hi2';
65
65
  import 'react-icons/fa6';
66
66
  import 'react-dom';
67
+ import '../components/Autocomplete/context.js';
68
+ import '../components/Autocomplete/Options.js';
69
+ import '../components/Autocomplete/GroupedOptions.js';
67
70
  import '../components/PhoneInput/Options.js';
68
71
  import '../components/PhoneInput/context.js';
69
72
  import 'react-international-phone';
@@ -2,7 +2,7 @@ import { tv } from 'tailwind-variants';
2
2
 
3
3
  const calendarCell = tv({
4
4
  slots: {
5
- cell: "text-center rounded-mili hover:bg-primary-light",
5
+ cell: "text-center rounded-mili text-black hover:bg-primary-light",
6
6
  button: "flex aspect-square items-center justify-center"
7
7
  },
8
8
  variants: {
@@ -13,17 +13,17 @@ const calendarCell = tv({
13
13
  },
14
14
  isSelected: {
15
15
  true: {
16
- cell: "bg-primary-medium border-2 border-primary-medium text-white hover:bg-primary-medium"
16
+ cell: "bg-primary-medium border-2 border-primary-medium text-on-primary hover:bg-primary-medium"
17
17
  }
18
18
  },
19
19
  isSelectionStart: {
20
20
  true: {
21
- cell: "bg-primary-medium border-2 border-primary-medium rounded-r-none text-white"
21
+ cell: "bg-primary-medium border-2 border-primary-medium rounded-r-none text-on-primary"
22
22
  }
23
23
  },
24
24
  isSelectionEnd: {
25
25
  true: {
26
- cell: "bg-primary-medium border-2 border-primary-medium rounded-l-none text-white"
26
+ cell: "bg-primary-medium border-2 border-primary-medium rounded-l-none text-on-primary"
27
27
  }
28
28
  },
29
29
  inRange: {
@@ -33,7 +33,7 @@ const calendarCell = tv({
33
33
  },
34
34
  isDisabled: {
35
35
  true: {
36
- cell: "text-content-minimal cursor-default hover:bg-surface-overlay",
36
+ cell: "text-secondary-light cursor-default hover:bg-white-500",
37
37
  button: "cursor-default"
38
38
  }
39
39
  }
@@ -7,7 +7,7 @@ const datePickerInputBase = tv({
7
7
  variants: {
8
8
  disabled: {
9
9
  true: {
10
- icon: "text-content-minimal cursor-default"
10
+ icon: "text-secondary-light cursor-default"
11
11
  }
12
12
  }
13
13
  }
@@ -2,12 +2,12 @@ import { tv } from 'tailwind-variants';
2
2
 
3
3
  const dateSegment = tv({
4
4
  slots: {
5
- base: "focus:outline-none focus:bg-content-minimal"
5
+ base: "focus:outline-none focus:bg-secondary-light"
6
6
  },
7
7
  variants: {
8
8
  disabled: {
9
9
  true: {
10
- base: "text-content-minimal"
10
+ base: "text-secondary-light"
11
11
  }
12
12
  }
13
13
  }
@@ -2,12 +2,12 @@ import { tv } from 'tailwind-variants';
2
2
 
3
3
  const groupButton = tv({
4
4
  slots: {
5
- button: "border-[1px] border-content-low px-centi py-mili items-center flex text-sub font-bold",
6
- inactive: "bg-surface-overlay text-content-low disabled:bg-content-minimal",
5
+ button: "border-[1px] border-secondary-medium px-centi py-mili items-center flex text-sub font-bold",
6
+ inactive: "bg-white text-secondary-medium disabled:bg-secondary-light",
7
7
  firstButton: "first:rounded-l-mili first:border-r-0",
8
8
  lastButton: "last:rounded-r-mili last:border-l-0",
9
9
  container: "flex flex-row h-[2rem]",
10
- active: "text-white bg-content-low"
10
+ active: "text-white bg-secondary-medium"
11
11
  }
12
12
  });
13
13
 
@@ -2,10 +2,10 @@ import { tv } from 'tailwind-variants';
2
2
 
3
3
  const menubar = tv({
4
4
  slots: {
5
- header: "relative w-screen px-kilo py-deca flex flex-row md:justify-between bg-surface-overlay z-header sm:justify-start",
5
+ header: "relative w-screen px-kilo py-deca flex flex-row md:justify-between bg-white z-header sm:justify-start",
6
6
  left: "flex items-center w-fit",
7
7
  right: "flex items-center gap-x-deca hidden sm:flex",
8
- dropdown: "w-full bg-surface-overlay flex-1 shadow-default z-popover px-[8vw] absolute"
8
+ dropdown: "w-full bg-white flex-1 shadow-default z-popover px-[8vw] absolute"
9
9
  },
10
10
  variants: {
11
11
  show: {
@@ -19,7 +19,7 @@ const menubar = tv({
19
19
  const mostUsed = tv({
20
20
  slots: {
21
21
  container: "mb-kilo",
22
- label: "font-bold mb-centi text-default",
22
+ label: "font-bold mb-centi",
23
23
  containerList: "gap-x-kilo flex flex-row"
24
24
  }
25
25
  });
@@ -27,26 +27,26 @@ const mostUsedItem = tv({
27
27
  slots: {
28
28
  container: "flex-1 py-mili",
29
29
  title: "text-primary-medium font-bold text-base",
30
- category: "text-content-low text-label"
30
+ category: "text-secondary-medium text-label"
31
31
  }
32
32
  });
33
33
  const item = tv({
34
34
  slots: {
35
- container: "flex flex-row gap-x-deca items-center text-content-medium hover:cursor-pointer text-base",
35
+ container: "flex flex-row gap-x-deca items-center text-secondary-dark hover:cursor-pointer text-base",
36
36
  textBehavior: "hover:text-primary-medium",
37
37
  icon: "text-primary-medium hover:cursor-pointer"
38
38
  }
39
39
  });
40
40
  const category = tv({
41
41
  slots: {
42
- text: "mb-mili font-bold text-default",
43
- hr: "mb-mili border-0 h-px bg-content-high",
42
+ text: "mb-mili font-bold",
43
+ hr: "mb-mili border-0 h-px bg-secondary-light",
44
44
  container: "flex flex-col gap-y-mili"
45
45
  }
46
46
  });
47
47
  const subItem = tv({
48
48
  slots: {
49
- container: "pl-deca text-sub border-l-[1px] border-primary-medium text-content-medium hover:text-primary-medium cursor-pointer"
49
+ container: "pl-deca text-sub border-l-[1px] border-primary-medium text-secondary-dark hover:text-primary-medium cursor-pointer"
50
50
  }
51
51
  });
52
52
  const animate = tv({
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants';
3
3
  const ProgressVariants = tv({
4
4
  slots: {
5
5
  container: "relative",
6
- bar: "h-1.5 w-full overflow-hidden bg-content-inverse",
6
+ bar: "h-1.5 w-full overflow-hidden bg-secondary-xlight",
7
7
  progress: "w-full h-full rounded-mili"
8
8
  },
9
9
  variants: {
@@ -28,8 +28,8 @@ const StepNodeVariants = tv({
28
28
  content: "font-bold"
29
29
  },
30
30
  false: {
31
- content: "text-content-low",
32
- separator: "bg-content-minimal"
31
+ content: "text-secondary-medium",
32
+ separator: "bg-secondary-light"
33
33
  }
34
34
  },
35
35
  selected: {
@@ -7,7 +7,7 @@ const timePickerInputBase = tv({
7
7
  variants: {
8
8
  disabled: {
9
9
  true: {
10
- icon: "text-content-minimal cursor-default"
10
+ icon: "text-secondary-light cursor-default"
11
11
  }
12
12
  }
13
13
  }