@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,40 +1,43 @@
1
- import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
- import o from "dayjs";
3
- import m from "../../helpers/classnames.js";
4
- import { Dot as l } from "../Dot/Dot.js";
5
- const v = ({
6
- selectedDate: e,
7
- date: n,
8
- currentMonth: r,
9
- isLoading: s = !1,
10
- disabled: a = !1,
11
- getContent: i
12
- }) => {
13
- const c = o(r).isSame(n, "month");
14
- if (i && c)
15
- return s ? /* @__PURE__ */ t("div", { className: "flex animate-pulse items-center justify-center", children: /* @__PURE__ */ t(l, { className: "ui-day-content pointer-events-none !cursor-not-allowed", color: "secondary" }) }) : /* @__PURE__ */ t(y, { selectedDate: e, date: n, getContent: i });
16
- if (s)
17
- return /* @__PURE__ */ t("div", { className: "flex animate-pulse items-center justify-center", children: /* @__PURE__ */ t(l, { className: "pointer-events-none !cursor-not-allowed", color: "secondary", size: "xlarge" }) });
18
- const u = e && e instanceof Date && o(e).isSame(n, "day");
19
- return /* @__PURE__ */ t(
1
+ import i from "dayjs";
2
+ import n from "prop-types";
3
+ import e from "react";
4
+ import u from "../../helpers/classnames.js";
5
+ import { Dot as m } from "../Dot/Dot.js";
6
+ const d = ({ selectedDate: a, date: t, getContent: r, currentMonth: o, isLoading: c = !1, disabled: s = !1 }) => {
7
+ const l = i(o).isSame(t, "month");
8
+ if (r && l)
9
+ return c ? /* @__PURE__ */ e.createElement("div", { className: "flex animate-pulse items-center justify-center" }, /* @__PURE__ */ e.createElement(m, { className: "ui-day-content pointer-events-none !cursor-not-allowed", color: "secondary" })) : /* @__PURE__ */ e.createElement(f, { selectedDate: a, date: t, getContent: r });
10
+ if (c)
11
+ return /* @__PURE__ */ e.createElement("div", { className: "flex animate-pulse items-center justify-center" }, /* @__PURE__ */ e.createElement(m, { className: "pointer-events-none !cursor-not-allowed", color: "secondary", size: "xlarge" }));
12
+ const y = a && i(a).isSame(t, "day");
13
+ return /* @__PURE__ */ e.createElement(
20
14
  "div",
21
15
  {
22
- className: m(
16
+ className: u(
23
17
  "ui-date-picker-day",
24
18
  "flex items-center justify-center",
25
- u && c && !a ? "selected text-white" : null,
26
- c ? "date" : null
27
- ),
28
- children: n.getDate()
29
- }
19
+ y && l && !s ? "selected text-white" : null,
20
+ l ? "date" : null
21
+ )
22
+ },
23
+ t.getDate()
30
24
  );
31
- }, y = ({ selectedDate: e, date: n, getContent: r }) => {
32
- const s = n.getDate(), a = r(s, n), i = e && e instanceof Date && o(e).isSame(n, "day");
33
- return /* @__PURE__ */ f("div", { className: "ui-day-content align-center flex flex-col justify-center", children: [
34
- /* @__PURE__ */ t("div", { className: m("ui-day-content-value", { "selected text-white": i }), children: s }),
35
- a ? /* @__PURE__ */ t("div", { className: "ui-day-content-custom mt-1", children: a }) : null
36
- ] });
25
+ };
26
+ d.propTypes = {
27
+ selectedDate: n.objectOf(Date),
28
+ date: n.objectOf(Date),
29
+ getContent: n.func,
30
+ currentMonth: n.objectOf(Date)
31
+ };
32
+ const f = ({ selectedDate: a, date: t, getContent: r }) => {
33
+ const o = t.getDate(), c = r(o, t), s = a && i(a).isSame(t, "day");
34
+ return /* @__PURE__ */ e.createElement("div", { className: "ui-day-content align-center flex flex-col justify-center" }, /* @__PURE__ */ e.createElement("div", { className: u("ui-day-content-value", { "selected text-white": s }) }, o), c ? /* @__PURE__ */ e.createElement("div", { className: "ui-day-content-custom mt-1" }, c) : null);
35
+ };
36
+ f.propTypes = {
37
+ selectedDate: n.objectOf(Date),
38
+ date: n.objectOf(Date),
39
+ getContent: n.func.isRequired
37
40
  };
38
41
  export {
39
- v as Day
42
+ d as Day
40
43
  };
@@ -1,20 +1,17 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useContext as s, useState as l, useEffect as n } from "react";
3
- import { DayPicker as p } from "react-day-picker";
4
- import { kebabCase as f } from "lodash-es";
5
- import { enUS as r } from "date-fns/locale";
6
- import u from "../../helpers/classnames.js";
7
- import { Context as P } from "../Provider.js";
8
- import { getLocalizationProps as z } from "./DatePicker.helpers.js";
9
- const C = ({ className: a, ...i }) => {
10
- const { locale: o } = s(P), [c, t] = l({ locale: r });
11
- return n(() => {
12
- t({ locale: r });
13
- const e = f(o).toLowerCase();
14
- !e || e === "en" || e === "en-us" || z(o).then(t);
15
- }, [o]), /* @__PURE__ */ m(p, { className: u(a), ...c, ...i });
16
- };
17
- C.displayName = "LocalizedDayPicker";
1
+ import n, { forwardRef as s, useContext as m, useState as f, useEffect as l } from "react";
2
+ import p from "react-day-picker";
3
+ import { kebabCase as u } from "lodash-es";
4
+ import P from "../../helpers/classnames.js";
5
+ import { Context as z } from "../Provider.js";
6
+ import { getLocalizationProps as C } from "./DatePicker.helpers.js";
7
+ const w = s(function({ className: r, ...a }, c) {
8
+ const { locale: o } = m(z), [i, t] = f({});
9
+ return l(() => {
10
+ t({});
11
+ const e = u(o).toLowerCase();
12
+ !e || e === "en" || e === "en-us" || C(o).then(t);
13
+ }, [o]), /* @__PURE__ */ n.createElement(p, { ref: c, className: P(r), ...i, ...a });
14
+ });
18
15
  export {
19
- C as LocalizedDayPicker
16
+ w as LocalizedDayPicker
20
17
  };
@@ -1,52 +1,39 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
- import u from "dayjs";
3
- import { useContext as x } from "react";
4
- import g from "../../helpers/classnames.js";
5
- import { Context as C } from "../Provider.js";
6
- import { Button as i } from "../Buttons/Button.js";
7
- import { ChevronButton as s } from "./NavbarElement.js";
8
- import { ChevronLeftIcon as k } from "../../icons/src/ChevronLeftIcon.js";
9
- import { ChevronRightIcon as y } from "../../icons/src/ChevronRightIcon.js";
10
- const v = u(), A = ({
11
- year: r,
12
- value: n,
13
- locale: m,
14
- onChange: a,
15
- handleYearChange: c,
16
- handleClear: d,
17
- handleToday: h
18
- }) => {
19
- const { locale: p } = x(C), f = [...Array.from({ length: 12 }).keys()].map(
20
- (e) => v.locale(m ?? p).month(e).format("MMM")
21
- ), b = (e) => {
22
- const o = new Date(r, e);
23
- a(o);
1
+ import e, { useContext as h } from "react";
2
+ import g from "dayjs";
3
+ import r from "prop-types";
4
+ import y from "clsx";
5
+ import { Context as E } from "../Provider.js";
6
+ import { Button as c } from "../Buttons/Button.js";
7
+ import { ChevronButton as m } from "./NavbarElement.js";
8
+ import { ChevronLeftIcon as x } from "../../icons/src/ChevronLeftIcon.js";
9
+ import { ChevronRightIcon as C } from "../../icons/src/ChevronRightIcon.js";
10
+ const k = g(), v = ({ year: n, value: l, onChange: s, handleYearChange: a, locale: i, handleClear: p, handleToday: d }) => {
11
+ const { locale: f } = h(E), u = [...Array.from({ length: 12 }).keys()].map(
12
+ (t) => k.locale(i ?? f).month(t).format("MMM")
13
+ ), b = (t) => {
14
+ const o = new Date(n, t);
15
+ s(o);
24
16
  };
25
- return /* @__PURE__ */ l("span", { className: "min-w-72", children: [
26
- /* @__PURE__ */ l("div", { className: "mb-4 flex items-center justify-between", children: [
27
- /* @__PURE__ */ t(s, { onClick: () => c(-1), children: /* @__PURE__ */ t(k, {}) }),
28
- /* @__PURE__ */ t("span", { className: "text-lg font-bold", children: r }),
29
- /* @__PURE__ */ t(s, { onClick: () => c(1), children: /* @__PURE__ */ t(y, {}) })
30
- ] }),
31
- /* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-2", children: f.map((e, o) => /* @__PURE__ */ t(
32
- "button",
33
- {
34
- type: "button",
35
- className: g(
36
- n && n.getMonth() === o && n.getFullYear() === r ? "bg-blue-dark text-white" : "text-black",
37
- "rounded-md p-4 text-center hover:bg-blue-dark hover:text-white"
38
- ),
39
- onClick: () => b(o),
40
- children: e
41
- },
42
- e
43
- )) }),
44
- /* @__PURE__ */ l("div", { className: "mt-2 flex justify-between border-t border-gray-lighter pt-2", children: [
45
- /* @__PURE__ */ t(i, { size: "small", color: "secondary", variant: "outline", onClick: d, children: "Clear" }),
46
- /* @__PURE__ */ t(i, { size: "small", color: "secondary", variant: "outline", onClick: h, children: "Today" })
47
- ] })
48
- ] });
17
+ return /* @__PURE__ */ e.createElement("span", { className: "min-w-72" }, /* @__PURE__ */ e.createElement("div", { className: "mb-4 flex items-center justify-between" }, /* @__PURE__ */ e.createElement(m, { onClick: () => a(-1) }, /* @__PURE__ */ e.createElement(x, null)), /* @__PURE__ */ e.createElement("span", { className: "text-lg font-bold" }, n), /* @__PURE__ */ e.createElement(m, { onClick: () => a(1) }, /* @__PURE__ */ e.createElement(C, null))), /* @__PURE__ */ e.createElement("div", { className: "grid grid-cols-4 gap-2" }, u.map((t, o) => /* @__PURE__ */ e.createElement(
18
+ "button",
19
+ {
20
+ key: t,
21
+ type: "button",
22
+ className: y(
23
+ l && l.getMonth() === o && l.getFullYear() === n ? "bg-blue-dark text-white" : "text-black",
24
+ "rounded-md p-4 text-center hover:bg-blue-dark hover:text-white"
25
+ ),
26
+ onClick: () => b(o)
27
+ },
28
+ t
29
+ ))), /* @__PURE__ */ e.createElement("div", { className: "mt-2 flex justify-between border-t border-gray-lighter pt-2" }, /* @__PURE__ */ e.createElement(c, { size: "small", color: "secondary", variant: "outline", onClick: p }, "Clear"), /* @__PURE__ */ e.createElement(c, { size: "small", color: "secondary", variant: "outline", onClick: d }, "Today")));
30
+ };
31
+ v.propTypes = {
32
+ year: r.number.isRequired,
33
+ value: r.objectOf(Date),
34
+ onChange: r.func.isRequired,
35
+ locale: r.string
49
36
  };
50
37
  export {
51
- A as MonthGrid
38
+ v as MonthGrid
52
39
  };
@@ -1,28 +1,33 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useState as l } from "react";
3
- import { MonthGrid as s } from "./MonthGrid.js";
4
- const Y = ({ value: t, locale: d, onChange: r }) => {
5
- const [a, n] = l(new Date(t).getFullYear());
6
- return /* @__PURE__ */ o("div", { className: "ui-month-picker min-w-72 max-w-xs rounded-lg bg-white", children: /* @__PURE__ */ o(
7
- s,
1
+ import c, { useState as p } from "react";
2
+ import o from "prop-types";
3
+ import { MonthGrid as d } from "./MonthGrid.js";
4
+ const h = ({ value: t, onChange: r, locale: s }) => {
5
+ const [a, n] = p(new Date(t).getFullYear()), l = (e) => {
6
+ n(a + e);
7
+ }, m = () => {
8
+ const e = /* @__PURE__ */ new Date();
9
+ n(e.getFullYear()), r(e);
10
+ }, i = () => {
11
+ r(t);
12
+ };
13
+ return /* @__PURE__ */ c.createElement("div", { className: "ui-month-picker min-w-72 max-w-xs rounded-lg bg-white" }, /* @__PURE__ */ c.createElement(
14
+ d,
8
15
  {
9
16
  year: a,
10
17
  value: t,
11
- locale: d,
12
- handleClear: () => {
13
- r(t);
14
- },
15
- handleToday: () => {
16
- const e = /* @__PURE__ */ new Date();
17
- n(e.getFullYear()), r(e);
18
- },
19
- handleYearChange: (e) => {
20
- n(a + e);
21
- },
18
+ locale: s,
19
+ handleClear: i,
20
+ handleToday: m,
21
+ handleYearChange: l,
22
22
  onChange: r
23
23
  }
24
- ) });
24
+ ));
25
+ };
26
+ h.propTypes = {
27
+ value: o.objectOf(Date),
28
+ onChange: o.func,
29
+ locale: o.string
25
30
  };
26
31
  export {
27
- Y as MonthPicker
32
+ h as MonthPicker
28
33
  };
@@ -1,47 +1,46 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import M from "dayjs";
3
- import { useState as m } from "react";
4
- import { Popover as d } from "../Popover/Popover.js";
5
- import { MonthGrid as Y } from "./MonthGrid.js";
1
+ import c from "prop-types";
2
+ import e, { useState as m } from "react";
3
+ import C from "dayjs";
4
+ import { Popover as p } from "../Popover/Popover.js";
5
+ import { MonthGrid as E } from "./MonthGrid.js";
6
6
  import { ChevronDownIcon as g } from "../../icons/src/ChevronDownIcon.js";
7
- const j = ({ date: o, currentMonth: p, locale: s, onChange: i }) => {
8
- const [l, t] = m(!1), [a, h] = m(new Date(p).getFullYear()), f = () => {
9
- t(!l);
7
+ const M = ({ date: a, locale: o, onChange: s, currentMonth: f }) => {
8
+ const [r, t] = m(!1), [l, d] = m(new Date(f).getFullYear()), u = () => {
9
+ t(!r);
10
+ }, h = (n) => {
11
+ s(n), t(!1);
10
12
  }, b = (n) => {
11
- i(n), t(!1);
12
- }, u = (n) => {
13
- h(a + n);
14
- }, r = () => {
13
+ d(l + n);
14
+ }, i = () => {
15
15
  t(!1);
16
- }, C = () => {
17
- i(/* @__PURE__ */ new Date()), t(!1);
16
+ }, y = () => {
17
+ s(/* @__PURE__ */ new Date()), t(!1);
18
18
  };
19
- return /* @__PURE__ */ e("span", { className: "DayPicker-Caption", children: /* @__PURE__ */ e("span", { className: "inline-block", children: /* @__PURE__ */ c(d, { visible: l, distance: 5, skidding: 60, placement: "bottom", onClickOutside: r, children: [
20
- /* @__PURE__ */ c(
21
- "div",
22
- {
23
- className: "mt-2 min-w-40 cursor-pointer items-center justify-between text-left font-bold",
24
- onClick: f,
25
- children: [
26
- /* @__PURE__ */ e("span", { className: "pr-1 text-lg", children: M(o).locale(s ?? "en").format("MMMM YYYY") }),
27
- /* @__PURE__ */ e(g, {})
28
- ]
29
- }
30
- ),
31
- /* @__PURE__ */ e(d.Content, { className: "p-2", children: /* @__PURE__ */ e(
32
- Y,
33
- {
34
- year: a,
35
- value: o,
36
- locale: s,
37
- handleClear: r,
38
- handleToday: C,
39
- handleYearChange: u,
40
- onChange: b
41
- }
42
- ) })
43
- ] }) }) });
19
+ return /* @__PURE__ */ e.createElement("span", { className: "DayPicker-Caption" }, /* @__PURE__ */ e.createElement("span", { className: "inline-block" }, /* @__PURE__ */ e.createElement(p, { visible: r, distance: 5, skidding: 60, placement: "bottom", onClickOutside: i }, /* @__PURE__ */ e.createElement(
20
+ "div",
21
+ {
22
+ className: "mt-2 min-w-40 cursor-pointer items-center justify-between text-left font-bold",
23
+ onClick: u
24
+ },
25
+ /* @__PURE__ */ e.createElement("span", { className: "pr-1 text-lg" }, C(a).locale(o).format("MMMM YYYY")),
26
+ /* @__PURE__ */ e.createElement(g, null)
27
+ ), /* @__PURE__ */ e.createElement(p.Content, { className: "p-2" }, /* @__PURE__ */ e.createElement(
28
+ E,
29
+ {
30
+ year: l,
31
+ value: a,
32
+ locale: o,
33
+ handleClear: i,
34
+ handleToday: y,
35
+ handleYearChange: b,
36
+ onChange: h
37
+ }
38
+ )))));
39
+ };
40
+ M.propTypes = {
41
+ date: c.objectOf(Date).isRequired,
42
+ onChange: c.func.isRequired
44
43
  };
45
44
  export {
46
- j as MonthSelector
45
+ M as MonthSelector
47
46
  };
@@ -1,44 +1,23 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import M from "dayjs";
3
- import { useRef as m } from "react";
4
- import { Select as h } from "../Forms/Select.js";
5
- const l = M(), N = (n, t) => 12 * (n.getFullYear() - t.getFullYear()) + (n.getMonth() - t.getMonth()), C = ({ date: n, currentMonth: t, locale: s, onChange: c }) => {
6
- const u = m(null), o = m(null), i = [...Array.from({ length: 12 }).keys()].map(
7
- (e) => l.locale(s ?? "en").month(e).format("MMM")
8
- ), g = [...Array.from({ length: l.year() - 2012 + 5 + 1 }).keys()].map(
9
- (e) => l.locale(s ?? "en").year(2012 + e).format("YYYY")
10
- ), f = N(n, t), p = (e) => {
11
- const r = Number(e.target.value), Y = o.current ? Number(o.current.value) : n.getFullYear();
12
- c(new Date(Y, r - f));
1
+ import f from "dayjs";
2
+ import s from "prop-types";
3
+ import t from "react";
4
+ import { Select as c } from "../Forms/Select.js";
5
+ const r = f(), M = (a, n) => 12 * (a.getFullYear() - n.getFullYear()) + (a.getMonth() - n.getMonth()), Y = ({ date: a, locale: n, onChange: l, currentMonth: m }) => {
6
+ const p = [...Array.from({ length: 12 }).keys()].map((e) => r.locale(n).month(e).format("MMM")), h = [...Array.from({ length: r.year() - 2012 + 5 + 1 }).keys()].map(
7
+ (e) => r.locale(n).year(2012 + e).format("YYYY")
8
+ ), i = M(a, m), g = (e) => {
9
+ const { year: o, month: u } = e.target.form;
10
+ l(new Date(o.value, Number(u.value) - i));
13
11
  }, y = (e) => {
14
- const r = Number(e.target.value);
15
- c(new Date(r, t.getMonth()));
12
+ const { year: o } = e.target.form;
13
+ l(new Date(o.value, m.getMonth()));
16
14
  };
17
- return /* @__PURE__ */ d("form", { className: "DayPicker-Caption space-x-2", children: [
18
- /* @__PURE__ */ a("span", { className: "inline-block", children: /* @__PURE__ */ a(
19
- h,
20
- {
21
- ref: u,
22
- name: "month",
23
- value: n.getMonth(),
24
- className: "month-selector",
25
- onChange: p,
26
- children: i.map((e, r) => /* @__PURE__ */ a("option", { value: r, children: e }, e))
27
- }
28
- ) }),
29
- /* @__PURE__ */ a("span", { className: "inline-block", children: /* @__PURE__ */ a(
30
- h,
31
- {
32
- ref: o,
33
- name: "year",
34
- value: n.getFullYear(),
35
- className: "year-selector",
36
- onChange: y,
37
- children: g.map((e) => /* @__PURE__ */ a("option", { value: e, children: e }, e))
38
- }
39
- ) })
40
- ] });
15
+ return /* @__PURE__ */ t.createElement("form", { className: "DayPicker-Caption space-x-2" }, /* @__PURE__ */ t.createElement("span", { className: "inline-block" }, /* @__PURE__ */ t.createElement(c, { name: "month", value: a.getMonth(), className: "month-selector", onChange: g }, p.map((e, o) => /* @__PURE__ */ t.createElement("option", { key: e, value: o }, e)))), /* @__PURE__ */ t.createElement("span", { className: "inline-block" }, /* @__PURE__ */ t.createElement(c, { name: "year", value: a.getFullYear(), className: "year-selector", onChange: y }, h.map((e) => /* @__PURE__ */ t.createElement("option", { key: e, value: e }, e)))));
16
+ };
17
+ Y.propTypes = {
18
+ date: s.objectOf(Date).isRequired,
19
+ onChange: s.func.isRequired
41
20
  };
42
21
  export {
43
- C as MonthYearSelector
22
+ Y as MonthYearSelector
44
23
  };
@@ -1,43 +1,34 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { useCallback as l } from "react";
3
- import { useDayPicker as m } from "react-day-picker";
4
- import a from "../../helpers/classnames.js";
5
- import { ChevronLeftIcon as p } from "../../icons/src/ChevronLeftIcon.js";
6
- import { ChevronRightIcon as f } from "../../icons/src/ChevronRightIcon.js";
7
- const C = ({ className: i, onTodayClick: t }) => {
8
- const { nextMonth: e, previousMonth: o, goToMonth: n } = m(), b = !e, h = !o, d = l(() => {
9
- o && n(o);
10
- }, [o, n]), u = l(() => {
11
- e && n(e);
12
- }, [n, e]);
13
- return /* @__PURE__ */ s("nav", { className: a("h-8 right-0 absolute items-center flex space-x-4 z-10", i), children: [
14
- t && /* @__PURE__ */ r(
15
- "button",
16
- {
17
- type: "button",
18
- className: "h-8 px-3 py-1.5 text-sm rounded border border-solid border-gray bg-white font-semibold tracking-tightest text-black hover:border-blue hover:bg-blue-lighter",
19
- onClick: t,
20
- children: "Today"
21
- }
22
- ),
23
- /* @__PURE__ */ s("span", { className: "flex space-x-2", children: [
24
- /* @__PURE__ */ r(c, { isVisible: !h, onClick: d, children: /* @__PURE__ */ r(p, {}) }),
25
- /* @__PURE__ */ r(c, { isVisible: !b, onClick: u, children: /* @__PURE__ */ r(f, {}) })
26
- ] })
27
- ] });
28
- }, c = ({ isVisible: i = !0, children: t, onClick: e }) => /* @__PURE__ */ r(
1
+ import e from "prop-types";
2
+ import t from "react";
3
+ import l from "../../helpers/classnames.js";
4
+ import { ChevronLeftIcon as m } from "../../icons/src/ChevronLeftIcon.js";
5
+ import { ChevronRightIcon as a } from "../../icons/src/ChevronRightIcon.js";
6
+ const u = ({ onPreviousClick: o, onNextClick: n, className: r, showNextButton: c, showPreviousButton: s }) => /* @__PURE__ */ t.createElement("div", { className: l("absolute right-1 top-1.5 z-50", r) }, /* @__PURE__ */ t.createElement(i, { isVisible: s, onClick: o }, /* @__PURE__ */ t.createElement(m, null)), /* @__PURE__ */ t.createElement(i, { isVisible: c, onClick: n }, /* @__PURE__ */ t.createElement(a, null)));
7
+ u.propTypes = {
8
+ onPreviousClick: e.func,
9
+ onNextClick: e.func,
10
+ className: e.string,
11
+ showNextButton: e.bool,
12
+ showPreviousButton: e.bool
13
+ };
14
+ const i = ({ isVisible: o = !0, onClick: n, children: r }) => /* @__PURE__ */ t.createElement(
29
15
  "button",
30
16
  {
31
17
  type: "button",
32
- className: a(
33
- i ? "inline-block" : "invisible",
18
+ className: l(
19
+ o ? "inline-block" : "invisible",
34
20
  "inline-flex h-7 w-7 items-center justify-center rounded-full border border-transparent leading-none text-black hover:border-black"
35
21
  ),
36
- onClick: () => e == null ? void 0 : e(),
37
- children: t
38
- }
22
+ onClick: () => n()
23
+ },
24
+ r
39
25
  );
26
+ i.propTypes = {
27
+ isVisible: e.bool,
28
+ onClick: e.func.isRequired,
29
+ children: e.element.isRequired
30
+ };
40
31
  export {
41
- c as ChevronButton,
42
- C as NavbarElement
32
+ i as ChevronButton,
33
+ u as NavbarElement
43
34
  };