@xola/ui-kit 3.5.0 → 3.7.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 (215) hide show
  1. package/README.md +136 -87
  2. package/build/components/Alert.js +18 -13
  3. package/build/components/Animation/FadeIn.js +36 -25
  4. package/build/components/Animation/SlideDown.js +14 -9
  5. package/build/components/Avatar.js +17 -10
  6. package/build/components/Badge.js +33 -24
  7. package/build/components/BottomSheet.js +114 -0
  8. package/build/components/Breadcrumb.js +27 -21
  9. package/build/components/Breakdown.js +66 -74
  10. package/build/components/Buttons/Button.js +53 -47
  11. package/build/components/Buttons/ButtonGroup.js +42 -39
  12. package/build/components/Buttons/SecondaryButton.js +31 -0
  13. package/build/components/Buttons/SubmitButton.js +72 -66
  14. package/build/components/Buttons/ToggleButton.js +15 -16
  15. package/build/components/Counter.js +10 -6
  16. package/build/components/DatePicker/DatePicker.helpers.js +24 -13
  17. package/build/components/DatePicker/DatePicker.js +196 -223
  18. package/build/components/DatePicker/DatePickerPopover.js +75 -66
  19. package/build/components/DatePicker/Day.js +35 -32
  20. package/build/components/DatePicker/LocalizedDayPicker.js +15 -18
  21. package/build/components/DatePicker/MonthGrid.js +35 -48
  22. package/build/components/DatePicker/MonthPicker.js +25 -20
  23. package/build/components/DatePicker/MonthSelector.js +39 -40
  24. package/build/components/DatePicker/MonthYearSelector.js +18 -39
  25. package/build/components/DatePicker/NavbarElement.js +26 -35
  26. package/build/components/DatePicker/RangeDatePicker.js +104 -123
  27. package/build/components/DatePicker/RelativeDateRange.js +153 -143
  28. package/build/components/DatePicker/UpcomingDatePicker.js +29 -25
  29. package/build/components/Dot/Dot.js +13 -8
  30. package/build/components/Dot/DotProgress.js +12 -7
  31. package/build/components/Drawer.js +109 -101
  32. package/build/components/Forms/BaseInput.js +50 -34
  33. package/build/components/Forms/Checkbox.js +33 -30
  34. package/build/components/Forms/ComboBox.js +35 -35
  35. package/build/components/Forms/FormGroup.js +7 -3
  36. package/build/components/Forms/InlineValuePopover.js +33 -39
  37. package/build/components/Forms/Input.js +15 -7
  38. package/build/components/Forms/Label.js +14 -8
  39. package/build/components/Forms/RangeSlider.js +41 -22
  40. package/build/components/Forms/Select.js +5 -6
  41. package/build/components/Forms/Switch.js +46 -38
  42. package/build/components/Forms/Textarea.js +37 -30
  43. package/build/components/Forms/ValuePopoverText.js +5 -8
  44. package/build/components/GooglePlacesAutocomplete.js +112 -0
  45. package/build/components/HeaderToolbar.js +30 -22
  46. package/build/components/ImageUpload.js +76 -79
  47. package/build/components/Key.js +21 -16
  48. package/build/components/Logo.js +12 -5
  49. package/build/components/Modal.js +87 -72
  50. package/build/components/Popover/Popover.js +40 -31
  51. package/build/components/Popover/PopoverList.js +43 -36
  52. package/build/components/Provider.js +7 -8
  53. package/build/components/Screens/Login.js +97 -126
  54. package/build/components/Search.js +114 -144
  55. package/build/components/Sidebar/Sidebar.Account.js +39 -46
  56. package/build/components/Sidebar/Sidebar.Button.js +45 -19
  57. package/build/components/Sidebar/Sidebar.Footer.js +8 -7
  58. package/build/components/Sidebar/Sidebar.Heading.js +11 -8
  59. package/build/components/Sidebar/Sidebar.Link.js +79 -44
  60. package/build/components/Sidebar/Sidebar.Menu.js +52 -28
  61. package/build/components/Sidebar/Sidebar.Notifications.js +107 -0
  62. package/build/components/Sidebar/Sidebar.js +207 -214
  63. package/build/components/Sidebar/SidebarContext.js +15 -0
  64. package/build/components/Sidebar/sidebarWidth.js +41 -0
  65. package/build/components/Sidebar/useSidebarWidthState.js +115 -0
  66. package/build/components/Skeleton.js +19 -20
  67. package/build/components/Spinner.js +18 -10
  68. package/build/components/Table.js +86 -50
  69. package/build/components/Tabs/Tabs.Panel.js +9 -5
  70. package/build/components/Tabs/Tabs.Tab.js +28 -23
  71. package/build/components/Tabs/Tabs.js +23 -23
  72. package/build/components/Tag.js +28 -23
  73. package/build/components/Tooltip.js +19 -5
  74. package/build/components/Utilities/Currency.js +49 -42
  75. package/build/components/Utilities/Number.js +14 -12
  76. package/build/components/Utilities/Phone.js +18 -12
  77. package/build/helpers/environment.js +10 -0
  78. package/build/helpers/flash.js +45 -46
  79. package/build/hooks/useIsMobile.js +8 -0
  80. package/build/hooks/useViewportHeight.js +6 -12
  81. package/build/icons/src/AnnounceIcon.js +3 -4
  82. package/build/icons/src/BellIcon.js +0 -1
  83. package/build/icons/src/CalendarIcon.js +0 -1
  84. package/build/icons/src/CheckIcon.js +0 -1
  85. package/build/icons/src/ChevronDownIcon.js +4 -5
  86. package/build/icons/src/ChevronLeftIcon.js +0 -1
  87. package/build/icons/src/ChevronRightIcon.js +0 -1
  88. package/build/icons/src/CircleNotch.js +0 -1
  89. package/build/icons/src/CloseIcon.js +11 -9
  90. package/build/icons/src/DownArrowIcon.js +0 -1
  91. package/build/icons/src/ImageIcon.js +0 -1
  92. package/build/icons/src/SearchIcon.js +4 -5
  93. package/build/icons/src/TrashIcon.js +0 -1
  94. package/build/icons/src/WarningDiamondIcon.js +0 -1
  95. package/build/icons/src/helpers/icon.js +5 -9
  96. package/build/icons/src/images/XolaLogoSimple.js +2 -3
  97. package/build/index.js +143 -130
  98. package/build/style.css +1 -0
  99. package/build/theme.css +76 -0
  100. package/build/theme.js +2 -0
  101. package/build/utils/currency.js +5 -5
  102. package/build/{helpers → utils}/date.js +17 -20
  103. package/build/utils/numbers.js +12 -12
  104. package/build/utils/phone.js +12 -14
  105. package/build/utils/userLocale.js +6 -0
  106. package/index.css +96 -4
  107. package/index.d.ts +204 -0
  108. package/package.json +87 -77
  109. package/skills/README.md +27 -0
  110. package/skills/migrate-2.6-to-3.7/SKILL.md +110 -0
  111. package/tailwind.config.js +5 -2
  112. package/build/base.css +0 -2
  113. package/build/components/Alert.d.ts +0 -18
  114. package/build/components/Animation/FadeIn.d.ts +0 -13
  115. package/build/components/Animation/SlideDown.d.ts +0 -6
  116. package/build/components/Avatar.d.ts +0 -16
  117. package/build/components/Badge.d.ts +0 -28
  118. package/build/components/Breadcrumb.d.ts +0 -21
  119. package/build/components/Breakdown.d.ts +0 -63
  120. package/build/components/Buttons/Button.d.ts +0 -53
  121. package/build/components/Buttons/ButtonGroup.d.ts +0 -35
  122. package/build/components/Buttons/SubmitButton.d.ts +0 -11
  123. package/build/components/Buttons/ToggleButton.d.ts +0 -21
  124. package/build/components/Charts/BaseChartOptions.d.ts +0 -136
  125. package/build/components/Charts/HistogramOptions.d.ts +0 -192
  126. package/build/components/Charts/PieOptions.d.ts +0 -177
  127. package/build/components/Counter.d.ts +0 -5
  128. package/build/components/DatePicker/DatePicker.d.ts +0 -41
  129. package/build/components/DatePicker/DatePicker.helpers.d.ts +0 -17
  130. package/build/components/DatePicker/DatePickerPopover.d.ts +0 -29
  131. package/build/components/DatePicker/Day.d.ts +0 -13
  132. package/build/components/DatePicker/LocalizedDayPicker.d.ts +0 -6
  133. package/build/components/DatePicker/MonthGrid.d.ts +0 -11
  134. package/build/components/DatePicker/MonthPicker.d.ts +0 -7
  135. package/build/components/DatePicker/MonthSelector.d.ts +0 -8
  136. package/build/components/DatePicker/MonthYearSelector.d.ts +0 -8
  137. package/build/components/DatePicker/NavbarElement.d.ts +0 -15
  138. package/build/components/DatePicker/RangeDatePicker.d.ts +0 -25
  139. package/build/components/DatePicker/RelativeDateRange.d.ts +0 -51
  140. package/build/components/DatePicker/UpcomingDatePicker.d.ts +0 -11
  141. package/build/components/Dot/Dot.d.ts +0 -24
  142. package/build/components/Dot/DotProgress.d.ts +0 -6
  143. package/build/components/Drawer.d.ts +0 -28
  144. package/build/components/Forms/BaseInput.d.ts +0 -20
  145. package/build/components/Forms/Checkbox.d.ts +0 -10
  146. package/build/components/Forms/ComboBox.d.ts +0 -8
  147. package/build/components/Forms/FormGroup.d.ts +0 -5
  148. package/build/components/Forms/InlineValuePopover.d.ts +0 -17
  149. package/build/components/Forms/Input.d.ts +0 -6
  150. package/build/components/Forms/Label.d.ts +0 -7
  151. package/build/components/Forms/RangeSlider.d.ts +0 -33
  152. package/build/components/Forms/Select.d.ts +0 -5
  153. package/build/components/Forms/Switch.d.ts +0 -46
  154. package/build/components/Forms/Textarea.d.ts +0 -6
  155. package/build/components/Forms/ValuePopoverText.d.ts +0 -6
  156. package/build/components/GooglePlacesAutocomplete.d.ts +0 -14
  157. package/build/components/HeaderToolbar.d.ts +0 -21
  158. package/build/components/ImageUpload.d.ts +0 -17
  159. package/build/components/Key.d.ts +0 -6
  160. package/build/components/Logo.d.ts +0 -19
  161. package/build/components/Modal.d.ts +0 -52
  162. package/build/components/Popover/Popover.d.ts +0 -20
  163. package/build/components/Popover/PopoverList.d.ts +0 -25
  164. package/build/components/Provider.d.ts +0 -18
  165. package/build/components/Screens/Login.d.ts +0 -25
  166. package/build/components/Search.d.ts +0 -16
  167. package/build/components/Sidebar/Sidebar.Account.d.ts +0 -13
  168. package/build/components/Sidebar/Sidebar.Button.d.ts +0 -10
  169. package/build/components/Sidebar/Sidebar.Footer.d.ts +0 -8
  170. package/build/components/Sidebar/Sidebar.Heading.d.ts +0 -10
  171. package/build/components/Sidebar/Sidebar.Link.d.ts +0 -24
  172. package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -13
  173. package/build/components/Sidebar/Sidebar.d.ts +0 -58
  174. package/build/components/Sidebar/index.d.ts +0 -8
  175. package/build/components/Skeleton.d.ts +0 -13
  176. package/build/components/Spinner.d.ts +0 -26
  177. package/build/components/Table.d.ts +0 -59
  178. package/build/components/Tabs/Tabs.Panel.d.ts +0 -9
  179. package/build/components/Tabs/Tabs.Tab.d.ts +0 -19
  180. package/build/components/Tabs/Tabs.d.ts +0 -27
  181. package/build/components/Tabs/index.d.ts +0 -4
  182. package/build/components/Tag.d.ts +0 -25
  183. package/build/components/Tooltip.d.ts +0 -8
  184. package/build/components/Utilities/Currency.d.ts +0 -32
  185. package/build/components/Utilities/Number.d.ts +0 -8
  186. package/build/components/Utilities/Phone.d.ts +0 -8
  187. package/build/full.css +0 -2
  188. package/build/helpers/avatar.d.ts +0 -1
  189. package/build/helpers/avatar.js +0 -8
  190. package/build/helpers/browser.d.ts +0 -2
  191. package/build/helpers/children.d.ts +0 -3
  192. package/build/helpers/classnames.d.ts +0 -5
  193. package/build/helpers/currency.d.ts +0 -2
  194. package/build/helpers/currency.js +0 -11
  195. package/build/helpers/date.d.ts +0 -12
  196. package/build/helpers/flash.d.ts +0 -21
  197. package/build/helpers/numbers.d.ts +0 -4
  198. package/build/helpers/numbers.js +0 -23
  199. package/build/helpers/phone.d.ts +0 -11
  200. package/build/helpers/phone.js +0 -25
  201. package/build/hooks/useId.d.ts +0 -1
  202. package/build/hooks/useId.js +0 -9
  203. package/build/hooks/useIsClient.d.ts +0 -1
  204. package/build/hooks/useViewportHeight.d.ts +0 -1
  205. package/build/icons/src/helpers/classnames.js +0 -8
  206. package/build/index.d.ts +0 -66
  207. package/build/theme.d.ts +0 -413
  208. package/build/types/index.d.ts +0 -22
  209. package/build/types/migration.d.ts +0 -2
  210. package/build/ui-kit.css +0 -1
  211. package/build/utils/avatar.d.ts +0 -1
  212. package/build/utils/currency.d.ts +0 -2
  213. package/build/utils/index.d.ts +0 -4
  214. package/build/utils/numbers.d.ts +0 -4
  215. package/build/utils/phone.d.ts +0 -2
@@ -1,27 +1,31 @@
1
- import { jsxs as b, jsx as t } from "react/jsx-runtime";
2
- import l from "dayjs";
3
- import c from "../../helpers/classnames.js";
4
- const x = ({ value: o, upcomingDates: r, onChange: d, onMonthChange: i }) => /* @__PURE__ */ b("div", { className: "rounded-l-lg border-r border-gray pt-8", children: [
5
- /* @__PURE__ */ t("p", { className: "mb-2 px-6 text-lg font-bold", children: "Upcoming" }),
6
- (r == null ? void 0 : r.length) > 0 ? /* @__PURE__ */ t("div", { className: "mt-5", children: r == null ? void 0 : r.map((e) => {
7
- const m = l(e).isSame(l(o), "day"), n = l(e).format();
8
- return /* @__PURE__ */ t(
9
- "div",
10
- {
11
- className: c(
12
- "mx-6 mt-3 flex min-w-40 cursor-pointer items-center justify-center",
13
- "rounded border border-gray py-3 hover:border-blue hover:bg-blue hover:text-white",
14
- { "border-blue bg-blue text-white": m }
15
- ),
16
- onClick: (s) => {
17
- d(e, {}, s), i(e);
18
- },
19
- children: l(e).format("ddd DD MMMM")
20
- },
21
- n
22
- );
23
- }) }) : /* @__PURE__ */ t("div", { className: "mx-6 mt-7 max-w-40 items-center justify-center rounded bg-yellow-lighter p-3", children: "There is no future availability for this product." })
24
- ] });
1
+ import o from "dayjs";
2
+ import l from "prop-types";
3
+ import t from "react";
4
+ import s from "../../helpers/classnames.js";
5
+ const b = ({ value: m, upcomingDates: e, onChange: a, onMonthChange: i }) => /* @__PURE__ */ t.createElement("div", { className: "rounded-l-lg border-r border-gray pt-8" }, /* @__PURE__ */ t.createElement("p", { className: "mb-2 px-6 text-lg font-bold" }, "Upcoming"), (e == null ? void 0 : e.length) > 0 ? /* @__PURE__ */ t.createElement("div", { className: "mt-5" }, e == null ? void 0 : e.map((r) => {
6
+ const n = o(r).isSame(o(m), "day"), d = o(r).format();
7
+ return /* @__PURE__ */ t.createElement(
8
+ "div",
9
+ {
10
+ key: d,
11
+ className: s(
12
+ "mx-6 mt-3 flex min-w-40 cursor-pointer items-center justify-center",
13
+ "rounded border border-gray py-3 hover:border-blue hover:bg-blue hover:text-white",
14
+ { "border-blue bg-blue text-white": n }
15
+ ),
16
+ onClick: (c) => {
17
+ a(r, {}, c), i(r);
18
+ }
19
+ },
20
+ o(r).format("ddd DD MMMM")
21
+ );
22
+ })) : /* @__PURE__ */ t.createElement("div", { className: "mx-6 mt-7 max-w-40 items-center justify-center rounded bg-yellow-lighter p-3" }, "There is no future availability for this product."));
23
+ b.propTypes = {
24
+ value: l.objectOf(Date),
25
+ upcomingDates: l.arrayOf(Date).isRequired,
26
+ onChange: l.func.isRequired,
27
+ onMonthChange: l.func.isRequired
28
+ };
25
29
  export {
26
- x as UpcomingDatePicker
30
+ b as UpcomingDatePicker
27
31
  };
@@ -1,24 +1,29 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import a from "../../helpers/classnames.js";
3
- const i = {
1
+ import r from "prop-types";
2
+ import c from "react";
3
+ import t from "../../helpers/classnames.js";
4
+ const e = {
4
5
  primary: "bg-primary",
5
6
  secondary: "bg-secondary",
6
7
  success: "bg-success",
7
8
  warning: "bg-warning",
8
9
  danger: "bg-danger",
9
10
  caution: "bg-caution"
10
- }, c = {
11
+ }, i = {
11
12
  small: "h-1 w-1",
12
13
  medium: "h-1.5 w-1.5",
13
14
  large: "h-2 w-2",
14
15
  xlarge: "h-8 w-8"
15
- }, g = ({ color: r = "primary", size: n = "medium", className: s, ...e }) => /* @__PURE__ */ o(
16
+ }, m = ({ color: o = "primary", size: s = "medium", className: n, ...a }) => /* @__PURE__ */ c.createElement(
16
17
  "span",
17
18
  {
18
- className: a("ui-dot", "inline-block rounded-full text-white", i[r], c[n], s),
19
- ...e
19
+ className: t("ui-dot", "inline-block rounded-full text-white", e[o], i[s], n),
20
+ ...a
20
21
  }
21
22
  );
23
+ m.propTypes = {
24
+ className: r.string,
25
+ color: r.oneOf(Object.keys(e))
26
+ };
22
27
  export {
23
- g as Dot
28
+ m as Dot
24
29
  };
@@ -1,10 +1,15 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { range as t } from "lodash-es";
3
- import { Dot as c } from "./Dot.js";
4
- const a = ({ current: r, total: o }) => o <= 1 ? null : /* @__PURE__ */ m("div", { className: "w-full space-x-2 text-center", children: t(0, o).map((e) => {
5
- const s = r <= 0 ? 0 : r >= o ? r - 1 : r;
6
- return /* @__PURE__ */ m(c, { color: e === s ? "primary" : "secondary", size: "medium" }, e);
7
- }) });
1
+ import { range as i } from "lodash-es";
2
+ import t from "prop-types";
3
+ import m from "react";
4
+ import { Dot as n } from "./Dot.js";
5
+ const a = ({ current: e, total: r }) => r <= 1 ? null : /* @__PURE__ */ m.createElement("div", { className: "w-full space-x-2 text-center" }, i(0, r).map((o) => {
6
+ const s = e <= 0 ? 0 : e >= r ? e - 1 : e, p = o === s ? "primary" : "secondary";
7
+ return /* @__PURE__ */ m.createElement(n, { key: o, color: p, size: "medium" });
8
+ }));
9
+ a.propTypes = {
10
+ total: t.number.isRequired,
11
+ current: t.number.isRequired
12
+ };
8
13
  export {
9
14
  a as DotProgress
10
15
  };
@@ -1,126 +1,134 @@
1
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
1
  import { Transition as o, Dialog as s } from "@headlessui/react";
3
- import { forwardRef as v, Fragment as m } from "react";
4
- import { isIosBrowser as g } from "../helpers/browser.js";
5
- import l from "../helpers/classnames.js";
6
- import { useViewportHeight as y } from "../hooks/useViewportHeight.js";
2
+ import t from "prop-types";
3
+ import e, { forwardRef as g, Fragment as m } from "react";
4
+ import { isIosBrowser as v } from "../helpers/browser.js";
5
+ import r from "../helpers/classnames.js";
6
+ import { useViewportHeight as E } from "../hooks/useViewportHeight.js";
7
7
  import { Button as b } from "./Buttons/Button.js";
8
- import { CloseIcon as N } from "../icons/src/CloseIcon.js";
9
- const T = {
8
+ import { CloseIcon as T } from "../icons/src/CloseIcon.js";
9
+ const N = {
10
10
  small: "w-72",
11
11
  medium: "w-85",
12
12
  large: "w-110",
13
13
  xl: "w-200",
14
14
  "2xl": "w-screen md:max-w-screen-md 2xl:max-w-screen-lg"
15
15
  // This was the old size
16
- }, F = v(
16
+ }, c = g(
17
17
  ({
18
- isOpen: i = !1,
19
- title: f,
20
- size: u = "medium",
21
- content: h,
22
- sideIndent: x = 0,
23
- position: r = "right",
24
- classNames: t = {},
25
- onClose: a
26
- }, w) => {
27
- const d = y(), p = g();
28
- return /* @__PURE__ */ e(o.Root, { show: i, as: m, children: /* @__PURE__ */ e(
18
+ isOpen: n = !1,
19
+ title: u,
20
+ size: x = "medium",
21
+ content: p,
22
+ sideIndent: w = 0,
23
+ onClose: i,
24
+ classNames: a = {},
25
+ position: l = "right"
26
+ }, h) => {
27
+ const d = E(), y = v();
28
+ return /* @__PURE__ */ e.createElement(o.Root, { ref: h, show: n, as: m }, /* @__PURE__ */ e.createElement(
29
29
  s,
30
30
  {
31
- ref: w,
32
31
  as: "div",
33
- className: l("ui-drawer fixed inset-0 z-10 overflow-hidden", t.dialog),
34
- open: i,
35
- onClose: a,
36
- children: /* @__PURE__ */ n(
37
- "div",
32
+ className: r("ui-drawer fixed inset-0 z-10 overflow-hidden", a.dialog),
33
+ onClose: i
34
+ },
35
+ /* @__PURE__ */ e.createElement(
36
+ "div",
37
+ {
38
+ className: r(
39
+ "flex",
40
+ y ? `h-[${d}px] max-h-[${d}px] w-full` : "h-screen w-full"
41
+ )
42
+ },
43
+ /* @__PURE__ */ e.createElement(
44
+ o.Child,
38
45
  {
39
- className: l(
40
- "flex",
41
- p ? `h-[${d}px] max-h-[${d}px] w-full` : "h-screen w-full"
42
- ),
43
- children: [
44
- /* @__PURE__ */ e(
45
- o.Child,
46
- {
47
- as: m,
48
- enter: "ease-in-out duration-500",
49
- enterFrom: "opacity-0",
50
- enterTo: "opacity-100",
51
- leave: "ease-in-out duration-500",
52
- leaveFrom: "opacity-100",
53
- leaveTo: "opacity-0",
54
- children: /* @__PURE__ */ e(
55
- s.Overlay,
56
- {
57
- className: l(
58
- "absolute inset-0 bg-black bg-opacity-80 transition-opacity",
59
- t.overlay
60
- )
61
- }
62
- )
63
- }
64
- ),
65
- /* @__PURE__ */ e(
66
- "div",
67
- {
68
- style: {
69
- [r === "right" ? "right" : "left"]: `${x ?? 0}px`
70
- },
71
- className: l("fixed inset-y-0 flex max-w-full", t.dialogContent),
72
- children: /* @__PURE__ */ e(
73
- o.Child,
74
- {
75
- as: m,
76
- enter: "transform transition ease-in-out duration-500 sm:duration-700",
77
- enterFrom: r === "right" ? "translate-x-full" : "-translate-x-full",
78
- enterTo: "translate-x-0",
79
- leave: "transform transition ease-out-in duration-500 sm:duration-700",
80
- leaveFrom: "translate-x-0",
81
- leaveTo: r === "right" ? "translate-x-full" : "-translate-x-full",
82
- children: /* @__PURE__ */ n("div", { className: "flex", children: [
83
- r === "right" ? /* @__PURE__ */ e(c, { onClose: a }) : null,
84
- /* @__PURE__ */ n(
85
- "div",
86
- {
87
- className: l(
88
- "flex h-full w-full flex-col overflow-y-auto bg-white px-4 py-8 shadow-xl sm:px-6",
89
- T[u],
90
- t.children
91
- ),
92
- children: [
93
- /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ e(s.Title, { children: f }) }),
94
- /* @__PURE__ */ e("div", { className: l("relative mt-3 flex-1", t.content), children: h })
95
- ]
96
- }
97
- ),
98
- r === "left" ? /* @__PURE__ */ e(c, { onClose: a }) : null
99
- ] })
100
- }
101
- )
102
- }
46
+ as: m,
47
+ enter: "ease-out duration-500",
48
+ enterFrom: "opacity-0",
49
+ enterTo: "opacity-100",
50
+ leave: "ease-in duration-200",
51
+ leaveFrom: "opacity-100",
52
+ leaveTo: "opacity-0"
53
+ },
54
+ /* @__PURE__ */ e.createElement(
55
+ s.Overlay,
56
+ {
57
+ className: r(
58
+ "ui-drawer-overlay fixed inset-0 bg-black bg-opacity-80 transition-opacity",
59
+ a.overlay
103
60
  )
104
- ]
105
- }
61
+ }
62
+ )
63
+ ),
64
+ /* @__PURE__ */ e.createElement(
65
+ "div",
66
+ {
67
+ style: {
68
+ [l === "right" ? "right" : "left"]: `${w ?? 0}px`
69
+ },
70
+ className: r(
71
+ "ui-drawer-container",
72
+ "fixed inset-y-0 flex max-w-full",
73
+ a.dialogContent
74
+ )
75
+ },
76
+ /* @__PURE__ */ e.createElement(
77
+ o.Child,
78
+ {
79
+ as: m,
80
+ enter: "ease-out duration-500",
81
+ enterFrom: l === "right" ? "translate-x-full" : "-translate-x-full",
82
+ enterTo: "translate-x-0",
83
+ leave: "transform transition ease-out-in duration-500",
84
+ leaveFrom: l === "right" ? "-translate-x-full" : "translate-x-full",
85
+ leaveTo: l === "right" ? "translate-x-full" : "-translate-x-full"
86
+ },
87
+ /* @__PURE__ */ e.createElement("div", { className: "flex" }, l === "right" ? /* @__PURE__ */ e.createElement(f, { onClose: i }) : null, /* @__PURE__ */ e.createElement(
88
+ "div",
89
+ {
90
+ className: r(
91
+ "flex h-full w-full flex-col overflow-y-auto bg-white px-4 py-8 shadow-xl sm:px-6",
92
+ N[x],
93
+ a.children
94
+ )
95
+ },
96
+ /* @__PURE__ */ e.createElement("div", { className: "ui-drawer-header w-full" }, /* @__PURE__ */ e.createElement(s.Title, null, u)),
97
+ /* @__PURE__ */ e.createElement("div", { className: r("ui-drawer-body relative mt-3 flex-1", a.content) }, p)
98
+ ), l === "left" ? /* @__PURE__ */ e.createElement(f, { onClose: i }) : null)
99
+ )
106
100
  )
107
- }
108
- ) });
101
+ )
102
+ ));
109
103
  }
110
- );
111
- F.displayName = "Drawer";
112
- const c = ({ onClose: i }) => /* @__PURE__ */ e(
104
+ ), f = ({ onClose: n }) => /* @__PURE__ */ e.createElement(
113
105
  b,
114
106
  {
115
107
  size: "small",
116
108
  variant: "link",
117
- className: l(
109
+ className: r(
118
110
  "m-2.5 inline-flex !h-10 !w-10 items-center justify-center !rounded-full bg-white !px-1.5 !text-black"
119
111
  ),
120
- onClick: () => i(!1),
121
- children: /* @__PURE__ */ e(N, { size: "medium" })
122
- }
112
+ onClick: n
113
+ },
114
+ /* @__PURE__ */ e.createElement(T, { size: "medium" })
123
115
  );
116
+ c.displayName = "Drawer";
117
+ c.propTypes = {
118
+ isOpen: t.bool.isRequired,
119
+ title: t.oneOfType([t.arrayOf(t.node), t.node]),
120
+ content: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired,
121
+ onClose: t.func.isRequired,
122
+ classNames: t.object,
123
+ position: t.string,
124
+ sideIndent: t.number
125
+ };
126
+ c.defaultProps = {
127
+ title: "",
128
+ classNames: {},
129
+ position: "right",
130
+ sideIndent: 0
131
+ };
124
132
  export {
125
- F as Drawer
133
+ c as Drawer
126
134
  };
@@ -1,41 +1,57 @@
1
- import { jsxs as y, jsx as s } from "react/jsx-runtime";
2
- import { isString as i, isEmpty as l } from "lodash-es";
3
- import { forwardRef as u } from "react";
4
- import x from "../../helpers/classnames.js";
5
- import { Dot as h } from "../Dot/Dot.js";
6
- const k = {
1
+ import { isString as l, isEmpty as n } from "lodash-es";
2
+ import e from "prop-types";
3
+ import s, { forwardRef as h } from "react";
4
+ import E from "../../helpers/classnames.js";
5
+ import { Dot as k } from "../Dot/Dot.js";
6
+ const p = {
7
7
  small: "px-3 py-1.5 text-sm leading-sm",
8
+ // 30px
8
9
  medium: "px-3 py-2.5 text-base leading-base",
10
+ // 40px
9
11
  large: "px-5 py-3.5 text-md leading-md"
10
- }, w = u(
11
- ({ as: t = "input", size: d = "medium", isError: c, isRequired: g, value: r, prefix: a, suffix: o, className: n, ...p }, m) => {
12
- const f = () => {
13
- if (!i(r)) return;
14
- let e = r;
15
- return a && (e = e.replace(new RegExp(`^${a}`), "")), o && (e = e.replace(new RegExp(`${o}$`), "")), e.replaceAll(/[^.\S]+/g, "").replace(/[\p{Sc}]/u, "");
16
- }, b = i(r) ? l(f()) : l(r == null ? void 0 : r.toString());
17
- return /* @__PURE__ */ y("div", { className: "relative flex w-full items-center", children: [
18
- /* @__PURE__ */ s(
19
- t,
20
- {
21
- ref: m,
22
- className: x(
23
- "w-full rounded text-gray-darker placeholder-gray-dark hover:placeholder-gray-darker disabled:text-gray",
24
- "border hover:border-black hover:bg-gray-lighter focus:text-black active:text-black disabled:bg-gray-lighter",
25
- k[d],
26
- t === "select" && "pr-8",
27
- c ? "!focus:border-danger !border-danger focus:ring-0 focus:ring-danger" : "border-gray-light focus:border-primary focus:ring-0 focus:ring-primary",
28
- n
29
- ),
30
- value: r,
31
- ...p
32
- }
33
- ),
34
- g && b && /* @__PURE__ */ s(h, { className: "absolute right-3", color: "danger" })
35
- ] });
12
+ // 50px
13
+ }, a = h(
14
+ ({ as: m, size: d = "medium", isError: g, className: c, isRequired: f, value: r, prefix: i, suffix: o, ...u }, y) => {
15
+ const b = () => {
16
+ if (!l(r)) return;
17
+ let t = r;
18
+ return i && (t = t.replace(new RegExp(`^${i}`), "")), o && (t = t.replace(new RegExp(`${o}$`), "")), t.replaceAll(/[^.\S]+/g, "").replace(/[\p{Sc}]/u, "");
19
+ }, x = l(r) ? n(b()) : n(r == null ? void 0 : r.toString());
20
+ return /* @__PURE__ */ s.createElement("div", { className: "relative flex w-full items-center" }, /* @__PURE__ */ s.createElement(
21
+ m,
22
+ {
23
+ ref: y,
24
+ className: E(
25
+ "w-full rounded text-gray-darker placeholder-gray-dark hover:placeholder-gray-darker disabled:text-gray",
26
+ "border hover:border-black hover:bg-gray-lighter focus:text-black active:text-black disabled:bg-gray-lighter",
27
+ p[d],
28
+ g ? "!focus:border-danger !border-danger focus:ring-0 focus:ring-danger" : "border-gray-light focus:border-primary focus:ring-0 focus:ring-primary",
29
+ c
30
+ ),
31
+ value: r,
32
+ ...u
33
+ }
34
+ ), f && x && /* @__PURE__ */ s.createElement(k, { className: "absolute right-3", color: "danger" }));
36
35
  }
37
36
  );
38
- w.displayName = "BaseInput";
37
+ a.displayName = "BaseInput";
38
+ a.propTypes = {
39
+ as: e.oneOfType([e.string, e.elementType]),
40
+ size: e.oneOf(Object.keys(p)),
41
+ className: e.string,
42
+ isError: e.bool,
43
+ isRequired: e.bool,
44
+ value: e.oneOfType([e.string, e.number]),
45
+ prefix: e.string,
46
+ suffix: e.string
47
+ };
48
+ a.defaultProps = {
49
+ as: "input",
50
+ size: "medium",
51
+ className: "",
52
+ isError: !1,
53
+ isRequired: !1
54
+ };
39
55
  export {
40
- w as BaseInput
56
+ a as BaseInput
41
57
  };
@@ -1,34 +1,37 @@
1
- import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
- import e from "../../helpers/classnames.js";
3
- import { useId as d } from "../../hooks/useId.js";
1
+ import e from "prop-types";
2
+ import r, { useId as n } from "react";
3
+ import t from "../../helpers/classnames.js";
4
4
  import s from "./Checkbox.module.css.js";
5
- const m = ({ label: r, classNames: o = {}, className: i, ...l }) => {
6
- const t = d("checkbox");
7
- return /* @__PURE__ */ n("div", { className: e("ui-checkbox", i, "flex items-center"), children: [
8
- /* @__PURE__ */ c(
9
- "input",
10
- {
11
- type: "checkbox",
12
- className: e(
13
- "ui-checkbox-input",
14
- o.checkbox,
15
- s.checkbox,
16
- "h-4 w-4 rounded !border-primary text-white transition-colors disabled:border-none disabled:bg-gray-light disabled:text-gray-light"
17
- ),
18
- ...l,
19
- id: t
20
- }
21
- ),
22
- r ? /* @__PURE__ */ c(
23
- "label",
24
- {
25
- htmlFor: t,
26
- className: e("ui-checkbox-label", o.label, "ml-2 leading-none text-gray-darker"),
27
- children: r
28
- }
29
- ) : null
30
- ] });
5
+ const b = ({ label: o, className: l, classNames: c = {}, ...i }) => {
6
+ const a = n("checkbox");
7
+ return /* @__PURE__ */ r.createElement("div", { className: t("ui-checkbox", l, "flex items-center") }, /* @__PURE__ */ r.createElement(
8
+ "input",
9
+ {
10
+ type: "checkbox",
11
+ className: t(
12
+ "ui-checkbox-input",
13
+ c.checkbox,
14
+ s.checkbox,
15
+ "h-4 w-4 rounded !border-primary text-white transition-colors disabled:border-none disabled:bg-gray-light disabled:text-gray-light"
16
+ ),
17
+ ...i,
18
+ id: a
19
+ }
20
+ ), o ? /* @__PURE__ */ r.createElement(
21
+ "label",
22
+ {
23
+ htmlFor: a,
24
+ className: t("ui-checkbox-label", c.label, "ml-2 leading-none text-gray-darker")
25
+ },
26
+ o
27
+ ) : null);
28
+ };
29
+ b.propTypes = {
30
+ label: e.node.isRequired,
31
+ className: e.string,
32
+ classNames: e.shape({ checkbox: e.string, label: e.string }),
33
+ onChange: e.func
31
34
  };
32
35
  export {
33
- m as Checkbox
36
+ b as Checkbox
34
37
  };
@@ -1,41 +1,41 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useRef as i, useState as c, useEffect as s } from "react";
3
- import m, { components as u } from "react-select";
4
- import f from "react-select/creatable";
5
- import d from "../../helpers/classnames.js";
6
- import { Tooltip as b } from "../Tooltip.js";
1
+ import n from "prop-types";
2
+ import o, { forwardRef as i, useRef as m, useState as f, useEffect as u } from "react";
3
+ import b, { components as p } from "react-select";
4
+ import d from "react-select/creatable";
5
+ import x from "../../helpers/classnames.js";
6
+ import { Tooltip as E } from "../Tooltip.js";
7
7
  /* empty css */
8
- const R = ({ isCreatable: e = !1, isError: t, className: l, ...n }) => /* @__PURE__ */ o(
9
- e ? f : m,
10
- {
11
- className: d("ui-combo-box", t && "border-danger", l),
12
- classNamePrefix: "ui-combo-box",
13
- components: e ? {
14
- IndicatorsContainer: () => null,
15
- Menu: () => null,
16
- MultiValueLabel: h
17
- } : void 0,
18
- ...n
19
- }
20
- ), { MultiValueLabel: p } = u, h = (e) => {
21
- const t = i(null), [l, n] = c(!0);
22
- return s(() => {
23
- var r;
24
- if ((r = t.current) != null && r.offsetParent) {
25
- const a = t.current.offsetWidth > t.current.offsetParent.clientWidth;
26
- n(!a);
27
- }
28
- }, [e.data.label]), /* @__PURE__ */ o(p, { ...e, children: /* @__PURE__ */ o(
29
- b,
8
+ const s = i(({ isCreatable: e = !1, className: t = "", isError: l = !1, ...r }, a) => {
9
+ const c = e ? d : b;
10
+ return /* @__PURE__ */ o.createElement(
11
+ c,
30
12
  {
31
- disabled: l,
32
- maxWidth: "none",
33
- content: /* @__PURE__ */ o("span", { children: e.data.label }),
34
- className: "",
35
- children: /* @__PURE__ */ o("span", { ref: t, children: e.data.label })
13
+ ref: a,
14
+ className: x("ui-combo-box", l && "border-danger", t),
15
+ classNamePrefix: "ui-combo-box",
16
+ components: e ? {
17
+ IndicatorsContainer: () => null,
18
+ Menu: () => null,
19
+ MultiValueLabel: y
20
+ } : null,
21
+ ...r
22
+ }
23
+ );
24
+ });
25
+ s.displayName = "ComboBox";
26
+ const { MultiValueLabel: T } = p, y = (e) => {
27
+ const t = m(null), [l, r] = f(!0);
28
+ return u(() => {
29
+ if (t.current) {
30
+ const a = t.current.offsetWidth > t.current.offsetParent.offsetWidth;
31
+ r(!a);
36
32
  }
37
- ) });
33
+ }, [e.data.label]), /* @__PURE__ */ o.createElement(T, { ...e }, /* @__PURE__ */ o.createElement(E, { disabled: l, maxWidth: "none", content: /* @__PURE__ */ o.createElement("span", null, e.data.label) }, /* @__PURE__ */ o.createElement("span", { ref: t }, e.data.label)));
34
+ };
35
+ s.propTypes = {
36
+ className: n.string,
37
+ isError: n.bool
38
38
  };
39
39
  export {
40
- R as ComboBox
40
+ s as ComboBox
41
41
  };
@@ -1,6 +1,10 @@
1
- import { jsx as m } from "react/jsx-runtime";
1
+ import m from "prop-types";
2
+ import e from "react";
2
3
  import p from "../../helpers/classnames.js";
3
- const s = ({ className: r, ...o }) => /* @__PURE__ */ m("div", { className: p("ui-form-group", r, "mb-4"), ...o });
4
+ const t = ({ className: r, ...o }) => /* @__PURE__ */ e.createElement("div", { className: p("ui-form-group", "mb-4", r), ...o });
5
+ t.propTypes = {
6
+ className: m.string
7
+ };
4
8
  export {
5
- s as FormGroup
9
+ t as FormGroup
6
10
  };