@xola/ui-kit 3.0.8 → 3.4.1

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 (217) hide show
  1. package/README.md +61 -12
  2. package/build/components/Alert.d.ts +18 -0
  3. package/build/components/Alert.js +28 -0
  4. package/build/components/Animation/FadeIn.d.ts +13 -0
  5. package/build/components/Animation/FadeIn.js +29 -0
  6. package/build/components/Animation/SlideDown.d.ts +6 -0
  7. package/build/components/Animation/SlideDown.js +20 -0
  8. package/build/components/Avatar.d.ts +16 -0
  9. package/build/components/Avatar.js +21 -0
  10. package/build/components/Badge.d.ts +27 -0
  11. package/build/components/Badge.js +40 -0
  12. package/build/components/Breadcrumb.d.ts +21 -0
  13. package/build/components/Breadcrumb.js +27 -0
  14. package/build/components/Breakdown.d.ts +63 -0
  15. package/build/components/Breakdown.js +89 -0
  16. package/build/components/Buttons/Button.d.ts +53 -0
  17. package/build/components/Buttons/Button.js +83 -0
  18. package/build/components/Buttons/ButtonGroup.d.ts +35 -0
  19. package/build/components/Buttons/ButtonGroup.js +55 -0
  20. package/build/components/Buttons/SubmitButton.d.ts +11 -0
  21. package/build/components/Buttons/SubmitButton.js +83 -0
  22. package/build/components/Buttons/ToggleButton.d.ts +21 -0
  23. package/build/components/Buttons/ToggleButton.js +34 -0
  24. package/build/components/Charts/BaseChartOptions.d.ts +136 -0
  25. package/build/components/Charts/BaseChartOptions.js +95 -0
  26. package/build/components/Charts/HistogramOptions.d.ts +192 -0
  27. package/build/components/Charts/HistogramOptions.js +69 -0
  28. package/build/components/Charts/PieOptions.d.ts +177 -0
  29. package/build/components/Charts/PieOptions.js +55 -0
  30. package/build/components/Counter.d.ts +5 -0
  31. package/build/components/Counter.js +16 -0
  32. package/build/components/DatePicker/DatePicker.d.ts +41 -0
  33. package/build/components/DatePicker/DatePicker.helpers.d.ts +17 -0
  34. package/build/components/DatePicker/DatePicker.helpers.js +22 -0
  35. package/build/components/DatePicker/DatePicker.js +241 -0
  36. package/build/components/DatePicker/DatePickerPopover.d.ts +29 -0
  37. package/build/components/DatePicker/DatePickerPopover.js +81 -0
  38. package/build/components/DatePicker/Day.d.ts +13 -0
  39. package/build/components/DatePicker/Day.js +40 -0
  40. package/build/components/DatePicker/LocalizedDayPicker.d.ts +6 -0
  41. package/build/components/DatePicker/LocalizedDayPicker.js +20 -0
  42. package/build/components/DatePicker/MonthGrid.d.ts +11 -0
  43. package/build/components/DatePicker/MonthGrid.js +52 -0
  44. package/build/components/DatePicker/MonthPicker.d.ts +7 -0
  45. package/build/components/DatePicker/MonthPicker.js +28 -0
  46. package/build/components/DatePicker/MonthSelector.d.ts +8 -0
  47. package/build/components/DatePicker/MonthSelector.js +47 -0
  48. package/build/components/DatePicker/MonthYearSelector.d.ts +8 -0
  49. package/build/components/DatePicker/MonthYearSelector.js +44 -0
  50. package/build/components/DatePicker/NavbarElement.d.ts +15 -0
  51. package/build/components/DatePicker/NavbarElement.js +43 -0
  52. package/build/components/DatePicker/RangeDatePicker.d.ts +25 -0
  53. package/build/components/DatePicker/RangeDatePicker.js +134 -0
  54. package/build/components/DatePicker/RelativeDateRange.d.ts +51 -0
  55. package/build/components/DatePicker/RelativeDateRange.js +280 -0
  56. package/build/components/DatePicker/UpcomingDatePicker.d.ts +11 -0
  57. package/build/components/DatePicker/UpcomingDatePicker.js +27 -0
  58. package/build/components/Dot/Dot.d.ts +24 -0
  59. package/build/components/Dot/Dot.js +24 -0
  60. package/build/components/Dot/DotProgress.d.ts +6 -0
  61. package/build/components/Dot/DotProgress.js +10 -0
  62. package/build/components/Drawer.d.ts +28 -0
  63. package/build/components/Drawer.js +126 -0
  64. package/build/components/Forms/BaseInput.d.ts +20 -0
  65. package/build/components/Forms/BaseInput.js +41 -0
  66. package/build/components/Forms/Checkbox.d.ts +10 -0
  67. package/build/components/Forms/Checkbox.js +34 -0
  68. package/build/components/Forms/Checkbox.module.css.js +7 -0
  69. package/build/components/Forms/ComboBox.d.ts +8 -0
  70. package/build/components/Forms/ComboBox.js +41 -0
  71. package/build/components/Forms/FormGroup.d.ts +5 -0
  72. package/build/components/Forms/FormGroup.js +6 -0
  73. package/build/components/Forms/InlineValuePopover.d.ts +17 -0
  74. package/build/components/Forms/InlineValuePopover.js +47 -0
  75. package/build/components/Forms/Input.d.ts +6 -0
  76. package/build/components/Forms/Input.js +9 -0
  77. package/build/components/Forms/Label.d.ts +7 -0
  78. package/build/components/Forms/Label.js +17 -0
  79. package/build/components/Forms/RangeSlider.d.ts +33 -0
  80. package/build/components/Forms/RangeSlider.js +39 -0
  81. package/build/components/Forms/Select.d.ts +5 -0
  82. package/build/components/Forms/Select.js +8 -0
  83. package/build/components/Forms/Switch.d.ts +46 -0
  84. package/build/components/Forms/Switch.js +62 -0
  85. package/build/components/Forms/Textarea.d.ts +6 -0
  86. package/build/components/Forms/Textarea.js +35 -0
  87. package/build/components/Forms/ValuePopoverText.d.ts +6 -0
  88. package/build/components/Forms/ValuePopoverText.js +10 -0
  89. package/build/components/GooglePlacesAutocomplete.d.ts +14 -0
  90. package/build/components/HeaderToolbar.d.ts +21 -0
  91. package/build/components/HeaderToolbar.js +33 -0
  92. package/build/components/ImageUpload.d.ts +17 -0
  93. package/build/components/ImageUpload.js +86 -0
  94. package/build/components/Key.d.ts +6 -0
  95. package/build/components/Key.js +28 -0
  96. package/build/components/Logo.d.ts +19 -0
  97. package/build/components/Logo.js +10 -0
  98. package/build/components/Modal.d.ts +52 -0
  99. package/build/components/Modal.js +126 -0
  100. package/build/components/Popover/Popover.d.ts +20 -0
  101. package/build/components/Popover/Popover.js +50 -0
  102. package/build/components/Popover/Popover.module.css.js +7 -0
  103. package/build/components/Popover/PopoverList.d.ts +25 -0
  104. package/build/components/Popover/PopoverList.js +59 -0
  105. package/build/components/Popover/PopoverScroll.module.css.js +4 -0
  106. package/build/components/Provider.d.ts +18 -0
  107. package/build/components/Provider.js +17 -0
  108. package/build/components/Screens/Login.d.ts +25 -0
  109. package/build/components/Screens/Login.js +144 -0
  110. package/build/components/Search.d.ts +16 -0
  111. package/build/components/Search.js +174 -0
  112. package/build/components/Sidebar/Sidebar.Account.d.ts +13 -0
  113. package/build/components/Sidebar/Sidebar.Account.js +56 -0
  114. package/build/components/Sidebar/Sidebar.Button.d.ts +10 -0
  115. package/build/components/Sidebar/Sidebar.Button.js +21 -0
  116. package/build/components/Sidebar/Sidebar.Footer.d.ts +8 -0
  117. package/build/components/Sidebar/Sidebar.Footer.js +9 -0
  118. package/build/components/Sidebar/Sidebar.Heading.d.ts +10 -0
  119. package/build/components/Sidebar/Sidebar.Heading.js +10 -0
  120. package/build/components/Sidebar/Sidebar.Link.d.ts +24 -0
  121. package/build/components/Sidebar/Sidebar.Link.js +56 -0
  122. package/build/components/Sidebar/Sidebar.Menu.d.ts +10 -0
  123. package/build/components/Sidebar/Sidebar.Menu.js +28 -0
  124. package/build/components/Sidebar/Sidebar.Menu.module.css.js +7 -0
  125. package/build/components/Sidebar/Sidebar.d.ts +58 -0
  126. package/build/components/Sidebar/Sidebar.js +218 -0
  127. package/build/components/Sidebar/SidebarScroll.module.css.js +4 -0
  128. package/build/components/Sidebar/index.d.ts +8 -0
  129. package/build/components/Skeleton.d.ts +13 -0
  130. package/build/components/Skeleton.js +29 -0
  131. package/build/components/Skeleton.module.css.js +7 -0
  132. package/build/components/Spinner.d.ts +26 -0
  133. package/build/components/Spinner.js +27 -0
  134. package/build/components/Table.d.ts +59 -0
  135. package/build/components/Table.js +71 -0
  136. package/build/components/Tabs/Tabs.Panel.d.ts +9 -0
  137. package/build/components/Tabs/Tabs.Panel.js +7 -0
  138. package/build/components/Tabs/Tabs.Tab.d.ts +19 -0
  139. package/build/components/Tabs/Tabs.Tab.js +37 -0
  140. package/build/components/Tabs/Tabs.d.ts +27 -0
  141. package/build/components/Tabs/Tabs.js +28 -0
  142. package/build/components/Tabs/index.d.ts +4 -0
  143. package/build/components/Tag.d.ts +25 -0
  144. package/build/components/Tag.js +36 -0
  145. package/build/components/Tooltip.d.ts +8 -0
  146. package/build/components/Tooltip.js +8 -0
  147. package/build/components/Utilities/Currency.d.ts +32 -0
  148. package/build/components/Utilities/Currency.js +49 -0
  149. package/build/components/Utilities/Number.d.ts +8 -0
  150. package/build/components/Utilities/Number.js +15 -0
  151. package/build/components/Utilities/Phone.d.ts +8 -0
  152. package/build/components/Utilities/Phone.js +19 -0
  153. package/build/helpers/avatar.d.ts +1 -0
  154. package/build/helpers/avatar.js +8 -0
  155. package/build/helpers/browser.d.ts +2 -0
  156. package/build/helpers/browser.js +9 -0
  157. package/build/helpers/children.d.ts +3 -0
  158. package/build/helpers/children.js +6 -0
  159. package/build/helpers/classnames.d.ts +5 -0
  160. package/build/helpers/currency.d.ts +2 -0
  161. package/build/helpers/currency.js +11 -0
  162. package/build/helpers/date.d.ts +12 -0
  163. package/build/helpers/date.js +44 -0
  164. package/build/helpers/flash.d.ts +21 -0
  165. package/build/helpers/flash.js +87 -0
  166. package/build/helpers/numbers.d.ts +4 -0
  167. package/build/helpers/numbers.js +23 -0
  168. package/build/helpers/phone.d.ts +11 -0
  169. package/build/helpers/phone.js +25 -0
  170. package/build/hooks/useId.d.ts +1 -0
  171. package/build/hooks/useId.js +9 -0
  172. package/build/hooks/useIsClient.d.ts +1 -0
  173. package/build/hooks/useIsClient.js +10 -0
  174. package/build/hooks/useViewportHeight.d.ts +1 -0
  175. package/build/hooks/useViewportHeight.js +15 -0
  176. package/build/icons/build/AnnounceIcon.js +6 -0
  177. package/build/icons/build/BellIcon.js +23 -0
  178. package/build/icons/build/CalendarIcon.js +15 -0
  179. package/build/icons/build/CheckIcon.js +7 -0
  180. package/build/icons/build/ChevronDownIcon.js +7 -0
  181. package/build/icons/build/ChevronLeftIcon.js +7 -0
  182. package/build/icons/build/ChevronRightIcon.js +7 -0
  183. package/build/icons/build/CircleNotch.js +5 -0
  184. package/build/icons/build/CloseIcon.js +7 -0
  185. package/build/icons/build/DownArrowIcon.js +15 -0
  186. package/build/icons/build/ImageIcon.js +23 -0
  187. package/build/icons/build/SearchIcon.js +15 -0
  188. package/build/icons/build/TrashIcon.js +16 -0
  189. package/build/icons/build/WarningDiamondIcon.js +23 -0
  190. package/build/icons/build/helpers/classnames.js +8 -0
  191. package/build/icons/build/helpers/icon.js +10 -0
  192. package/build/icons/build/helpers/iconSizes.js +13 -0
  193. package/build/icons/build/images/XolaLogoSimple.js +13 -0
  194. package/build/index.d.ts +66 -0
  195. package/build/index.js +142 -0
  196. package/build/theme.d.ts +413 -0
  197. package/build/theme.js +372 -0
  198. package/build/types/index.d.ts +22 -0
  199. package/build/types/migration.d.ts +2 -0
  200. package/build/ui-kit.css +1 -0
  201. package/build/utils/avatar.d.ts +1 -0
  202. package/build/utils/avatar.js +8 -0
  203. package/build/utils/currency.d.ts +2 -0
  204. package/build/utils/currency.js +11 -0
  205. package/build/utils/date.d.ts +12 -0
  206. package/build/utils/date.js +23 -0
  207. package/build/utils/index.d.ts +5 -0
  208. package/build/utils/numbers.d.ts +4 -0
  209. package/build/utils/numbers.js +19 -0
  210. package/build/utils/phone.d.ts +2 -0
  211. package/build/utils/phone.js +17 -0
  212. package/package.json +76 -49
  213. package/postcss.config.js +1 -1
  214. package/tailwind.config.js +28 -8
  215. package/build/style.css +0 -1
  216. package/build/ui-kit.es.js +0 -12173
  217. package/index.d.ts +0 -72
@@ -0,0 +1,43 @@
1
+ import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
+ import c from "clsx";
3
+ import { useCallback as l } from "react";
4
+ import { useDayPicker as m } from "react-day-picker";
5
+ import { ChevronLeftIcon as p } from "../../icons/build/ChevronLeftIcon.js";
6
+ import { ChevronRightIcon as x } from "../../icons/build/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: c("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(a, { isVisible: !h, onClick: d, children: /* @__PURE__ */ r(p, {}) }),
25
+ /* @__PURE__ */ r(a, { isVisible: !b, onClick: u, children: /* @__PURE__ */ r(x, {}) })
26
+ ] })
27
+ ] });
28
+ }, a = ({ isVisible: i = !0, children: t, onClick: e }) => /* @__PURE__ */ r(
29
+ "button",
30
+ {
31
+ type: "button",
32
+ className: c(
33
+ i ? "inline-block" : "invisible",
34
+ "inline-flex h-7 w-7 items-center justify-center rounded-full border border-transparent leading-none text-black hover:border-black"
35
+ ),
36
+ onClick: () => e == null ? void 0 : e(),
37
+ children: t
38
+ }
39
+ );
40
+ export {
41
+ a as ChevronButton,
42
+ C as NavbarElement
43
+ };
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ interface DateRange {
3
+ from?: Date;
4
+ to?: Date;
5
+ }
6
+ export interface RangeDatePickerProps {
7
+ value?: DateRange;
8
+ selectedDays?: DateRange;
9
+ startMonth: Date;
10
+ endMonth: Date;
11
+ isDateRangeStyle?: boolean;
12
+ shouldShowYearPicker?: boolean;
13
+ disabledDays?: ((date: Date) => boolean) | Date[];
14
+ modifiers?: Record<string, any>;
15
+ locale?: string;
16
+ timezoneName?: string;
17
+ getDayContent?: (day: number, date: Date) => React.ReactNode;
18
+ getTooltip?: (date: Date) => React.ReactNode;
19
+ handleDayClick: (day: Date | undefined, options: Record<string, any>, event: React.MouseEvent | React.KeyboardEvent, isStart?: boolean) => void;
20
+ handleStartMonthChange: (month: Date) => void;
21
+ handleEndMonthChange: (month: Date) => void;
22
+ handleTodayClick: (day: Date, options: Record<string, any>, event: React.MouseEvent) => void;
23
+ }
24
+ declare const RangeDatePicker: ({ value, selectedDays, startMonth, endMonth, isDateRangeStyle, shouldShowYearPicker, disabledDays, modifiers, locale, timezoneName, getDayContent, getTooltip, handleDayClick, handleStartMonthChange, handleEndMonthChange, handleTodayClick, ...rest }: RangeDatePickerProps) => React.JSX.Element;
25
+ export default RangeDatePicker;
@@ -0,0 +1,134 @@
1
+ import { jsxs as K, jsx as n } from "react/jsx-runtime";
2
+ import a from "clsx";
3
+ import { isFunction as Q, isArray as U } from "lodash-es";
4
+ import { now as d } from "../../helpers/date.js";
5
+ import { Tooltip as V } from "../Tooltip.js";
6
+ import { Day as W } from "./Day.js";
7
+ import { LocalizedDayPicker as F } from "./LocalizedDayPicker.js";
8
+ import { MonthYearSelector as X } from "./MonthYearSelector.js";
9
+ import { NavbarElement as A } from "./NavbarElement.js";
10
+ const et = ({
11
+ value: o,
12
+ selectedDays: b,
13
+ startMonth: c,
14
+ endMonth: m,
15
+ isDateRangeStyle: f,
16
+ shouldShowYearPicker: I,
17
+ disabledDays: u,
18
+ modifiers: h = {},
19
+ locale: O,
20
+ timezoneName: i,
21
+ getDayContent: Y,
22
+ getTooltip: g,
23
+ handleDayClick: p,
24
+ handleStartMonthChange: x,
25
+ handleEndMonthChange: w,
26
+ handleTodayClick: q,
27
+ ...k
28
+ }) => {
29
+ const y = d(o == null ? void 0 : o.from, i).isSame(d(o == null ? void 0 : o.to, i), "month"), l = d(o == null ? void 0 : o.from, i).isSame(d(o == null ? void 0 : o.to, i), "day"), C = (t, e) => I && t ? (r) => /* @__PURE__ */ n(
30
+ X,
31
+ {
32
+ date: r.date || t,
33
+ currentMonth: t,
34
+ locale: O,
35
+ onChange: e
36
+ }
37
+ ) : void 0, _ = C(c, x), S = C(m, w), D = (t) => Q(u) ? u(t) : U(u) ? u.some((e) => d(e, i).isSame(t, "day")) : !1, E = (t) => D(t), N = (t) => {
38
+ const e = d(t, i).isBefore(o == null ? void 0 : o.from, "day");
39
+ return D(t) || e && !l;
40
+ }, B = (t, e, r) => {
41
+ const s = g == null ? void 0 : g(t), J = e(t), L = /* @__PURE__ */ n(
42
+ W,
43
+ {
44
+ disabled: J,
45
+ selectedDate: o,
46
+ date: t,
47
+ getContent: Y,
48
+ currentMonth: r
49
+ }
50
+ );
51
+ return s ? /* @__PURE__ */ n(V, { placement: "top", content: s, children: L }) : L;
52
+ }, G = (t) => B(t, E, c), H = (t) => B(t, N, m), P = {
53
+ months: "flex flex-col relative",
54
+ month_caption: "relative flex h-8 mb-4 pl-4",
55
+ caption_label: "text-lg font-semibold",
56
+ nav: "h-8 right-4 absolute items-center",
57
+ weekdays: "flex flex-row",
58
+ weekday: "w-full m-0 p-0 text-base font-semibold text-black",
59
+ month: "w-full min-w-[400px]",
60
+ month_grid: "w-full mt-4",
61
+ week: "mt-0.5 flex w-full justify-between",
62
+ day: "w-[calc(100%/7)] mr-0.5 rounded",
63
+ day_button: "h-12 w-full cursor-pointer rounded bg-transparent hover:border hover:border-blue hover:bg-blue-lighter hover:text-black disabled:cursor-not-allowed disabled:text-gray-light disabled:hover:border-none disabled:hover:bg-transparent",
64
+ selected: a(
65
+ f ? "[&>button]:bg-transparent [&>button]:text-black [&>button:hover]:bg-blue-lighter [&>button:hover]:text-black" : "[&>button]:border [&>button]:border-blue [&>button]:bg-blue [&>button]:text-white [&>button:hover]:border-blue-darker [&>button:hover]:bg-blue-darker"
66
+ ),
67
+ today: "[&>button]:border [&>button]:border-gray-light",
68
+ outside: "opacity-0",
69
+ disabled: "text-gray-light cursor-not-allowed [&>button]:cursor-not-allowed",
70
+ hidden: "invisible"
71
+ }, j = {
72
+ start: a(
73
+ f && !l ? "rounded-none [background:linear-gradient(90deg,#ffffff_40%,#d1e1ff_25%)] [&>button]:!bg-blue [&>button]:!text-white [&>button]:rounded-full" : "[&>button]:!bg-blue [&>button]:!text-white",
74
+ l ? "[&>button]:outline [&>button]:outline-offset-1 [&>button]:outline-blue-lighter" : null
75
+ ),
76
+ end: a(
77
+ f && !l ? "rounded-none [background:linear-gradient(90deg,#d1e1ff_40%,#ffffff_25%)] [&>button]:!bg-blue [&>button]:!text-white [&>button]:rounded-full" : "[&>button]:!bg-blue [&>button]:!text-white",
78
+ l ? "[&>button]:outline [&>button]:outline-offset-1 [&>button]:outline-blue-lighter" : null
79
+ ),
80
+ selected: f ? "rounded-none bg-blue-lighter text-black" : "",
81
+ waitlist: "[&>button]:relative [&>button]:after:content-[''] [&>button]:after:absolute [&>button]:after:bottom-1 [&>button]:after:left-1/2 [&>button]:after:-translate-x-1/2 [&>button]:after:h-2 [&>button]:after:w-2 [&>button]:after:rounded-full [&>button]:after:bg-yellow"
82
+ };
83
+ return /* @__PURE__ */ K("div", { className: "flex gap-4", children: [
84
+ /* @__PURE__ */ n(
85
+ F,
86
+ {
87
+ className: a(
88
+ "pt-6 tracking-tightest max-w-[400px] rounded-lg ring-0 focus:outline-none focus:ring-0"
89
+ ),
90
+ mode: "single",
91
+ selected: b == null ? void 0 : b.from,
92
+ month: c,
93
+ modifiers: { ...h, start: o == null ? void 0 : o.from },
94
+ disabled: E,
95
+ onSelect: (t, e, r, s) => p(t, r, s, !0),
96
+ onMonthChange: x,
97
+ classNames: P,
98
+ modifiersClassNames: j,
99
+ components: {
100
+ ..._ ? { CaptionLabel: _ } : {},
101
+ DayButton: ({ day: t, ...e }) => /* @__PURE__ */ n("button", { ...e, children: G(t.date) }),
102
+ Nav: (t) => /* @__PURE__ */ n(A, { ...t, onTodayClick: (e) => q(/* @__PURE__ */ new Date(), {}, e) })
103
+ },
104
+ ...k
105
+ }
106
+ ),
107
+ /* @__PURE__ */ n(
108
+ F,
109
+ {
110
+ className: a(
111
+ "pt-6 tracking-tightest max-w-[400px] rounded-lg ring-0 focus:outline-none focus:ring-0"
112
+ ),
113
+ mode: "single",
114
+ selected: y || b == null ? void 0 : b.to,
115
+ month: m,
116
+ modifiers: y ? {} : { ...h, end: o == null ? void 0 : o.to },
117
+ disabled: N,
118
+ onSelect: (t, e, r, s) => p(t, r, s, !1),
119
+ onMonthChange: w,
120
+ classNames: P,
121
+ modifiersClassNames: j,
122
+ components: {
123
+ ...S ? { CaptionLabel: S } : {},
124
+ DayButton: ({ day: t, ...e }) => /* @__PURE__ */ n("button", { ...e, children: H(t.date) }),
125
+ Nav: (t) => /* @__PURE__ */ n(A, { ...t })
126
+ },
127
+ ...k
128
+ }
129
+ )
130
+ ] });
131
+ };
132
+ export {
133
+ et as default
134
+ };
@@ -0,0 +1,51 @@
1
+ import { default as React } from 'react';
2
+ export declare const rangeOptions: {
3
+ readonly YESTERDAY: "P1D,yesterday";
4
+ readonly TODAY: "P1D,today";
5
+ readonly NEXT_DAY: "P1D,next day";
6
+ readonly LAST_WEEK: "P1W,last week";
7
+ readonly TRAILING_WEEK: "P1W,-1 week";
8
+ readonly THIS_WEEK: "P1W,this week";
9
+ readonly NEXT_WEEK: "P1W,next week";
10
+ readonly LEADING_WEEK: "P1W,+1 week";
11
+ readonly LAST_MONTH: "P1M,first day of last month";
12
+ readonly TRAILING_MONTH: "P1M,-1 month";
13
+ readonly THIS_MONTH: "P1M,first day of this month";
14
+ readonly NEXT_MONTH: "P1M,next month";
15
+ readonly LEADING_MONTH: "P1M,+1 month";
16
+ readonly LAST_QUARTER: "P3M,first day of last quarter";
17
+ readonly TRAILING_QUARTER: "P3M,-3 months";
18
+ readonly THIS_QUARTER: "P3M,first day of this quarter";
19
+ readonly NEXT_QUARTER: "P3M,next quarter";
20
+ readonly LEADING_QUARTER: "P3M,+3 months";
21
+ readonly LAST_YEAR: "P1Y,first day of January last year";
22
+ readonly TRAILING_YEAR: "P1Y,-1 year";
23
+ readonly THIS_YEAR: "P1Y,first day of this year";
24
+ readonly NEXT_YEAR: "P1Y,next year";
25
+ readonly LEADING_YEAR: "P1Y,+1 year";
26
+ };
27
+ export declare const rangeLabels: Record<string, string>;
28
+ interface RangeOption {
29
+ value: string;
30
+ label: string;
31
+ }
32
+ export declare const dateRanges: Record<string, {
33
+ label: string;
34
+ rangeOptions: RangeOption[];
35
+ }>;
36
+ interface DateRange {
37
+ from: Date;
38
+ to: Date;
39
+ }
40
+ type RangeKey = "day" | "week" | "month" | "quarter" | "year";
41
+ export interface RelativeDateRangeProps {
42
+ ranges?: RangeKey[];
43
+ value?: string;
44
+ showApply?: boolean;
45
+ isFutureDatesAllowed?: boolean;
46
+ timezoneName?: string;
47
+ onChange: (rangeName: string, range: DateRange) => void;
48
+ onSubmit?: () => void;
49
+ }
50
+ export declare const RelativeDateRange: ({ ranges, value, showApply, isFutureDatesAllowed, timezoneName, onChange, onSubmit, }: RelativeDateRangeProps) => React.JSX.Element;
51
+ export {};
@@ -0,0 +1,280 @@
1
+ import { jsxs as f, jsx as d } from "react/jsx-runtime";
2
+ import { Button as u } from "../Buttons/Button.js";
3
+ import { Select as O } from "../Forms/Select.js";
4
+ import { toDate as t, now as E } from "../../helpers/date.js";
5
+ const a = {
6
+ // Day
7
+ YESTERDAY: "P1D,yesterday",
8
+ TODAY: "P1D,today",
9
+ NEXT_DAY: "P1D,next day",
10
+ // Week
11
+ LAST_WEEK: "P1W,last week",
12
+ TRAILING_WEEK: "P1W,-1 week",
13
+ THIS_WEEK: "P1W,this week",
14
+ NEXT_WEEK: "P1W,next week",
15
+ LEADING_WEEK: "P1W,+1 week",
16
+ // Month
17
+ LAST_MONTH: "P1M,first day of last month",
18
+ TRAILING_MONTH: "P1M,-1 month",
19
+ THIS_MONTH: "P1M,first day of this month",
20
+ NEXT_MONTH: "P1M,next month",
21
+ LEADING_MONTH: "P1M,+1 month",
22
+ // Quarter
23
+ LAST_QUARTER: "P3M,first day of last quarter",
24
+ TRAILING_QUARTER: "P3M,-3 months",
25
+ THIS_QUARTER: "P3M,first day of this quarter",
26
+ NEXT_QUARTER: "P3M,next quarter",
27
+ LEADING_QUARTER: "P3M,+3 months",
28
+ // Year
29
+ LAST_YEAR: "P1Y,first day of January last year",
30
+ TRAILING_YEAR: "P1Y,-1 year",
31
+ THIS_YEAR: "P1Y,first day of this year",
32
+ NEXT_YEAR: "P1Y,next year",
33
+ LEADING_YEAR: "P1Y,+1 year"
34
+ }, T = {
35
+ // Day
36
+ [a.YESTERDAY]: "Yesterday",
37
+ [a.TODAY]: "Today",
38
+ [a.NEXT_DAY]: "Next Day",
39
+ // Week
40
+ [a.LAST_WEEK]: "Last Week",
41
+ [a.TRAILING_WEEK]: "Trailing Week",
42
+ [a.THIS_WEEK]: "This Week",
43
+ [a.NEXT_WEEK]: "Next Week",
44
+ [a.LEADING_WEEK]: "Leading Week",
45
+ // Month
46
+ [a.LAST_MONTH]: "Last Month",
47
+ [a.TRAILING_MONTH]: "Trailing Month",
48
+ [a.THIS_MONTH]: "This Month",
49
+ [a.NEXT_MONTH]: "Next Month",
50
+ [a.LEADING_MONTH]: "Leading Month",
51
+ // Quarter
52
+ [a.LAST_QUARTER]: "Last Quarter",
53
+ [a.TRAILING_QUARTER]: "Trailing Quarter",
54
+ [a.THIS_QUARTER]: "This Quarter",
55
+ [a.NEXT_QUARTER]: "Next Quarter",
56
+ [a.LEADING_QUARTER]: "Leading Quarter",
57
+ // Year
58
+ [a.LAST_YEAR]: "Last Year",
59
+ [a.TRAILING_YEAR]: "Trailing Year",
60
+ [a.THIS_YEAR]: "This Year",
61
+ [a.NEXT_YEAR]: "Next Year",
62
+ [a.LEADING_YEAR]: "Leading Year"
63
+ }, I = {
64
+ day: {
65
+ label: "Day",
66
+ rangeOptions: [
67
+ { value: a.YESTERDAY, label: T[a.YESTERDAY] },
68
+ { value: a.TODAY, label: T[a.TODAY] },
69
+ { value: a.NEXT_DAY, label: T[a.NEXT_DAY] }
70
+ ]
71
+ },
72
+ week: {
73
+ label: "Week",
74
+ rangeOptions: [
75
+ { value: a.LAST_WEEK, label: T[a.LAST_WEEK] },
76
+ { value: a.TRAILING_WEEK, label: T[a.TRAILING_WEEK] },
77
+ { value: a.THIS_WEEK, label: T[a.THIS_WEEK] },
78
+ { value: a.NEXT_WEEK, label: T[a.NEXT_WEEK] },
79
+ { value: a.LEADING_WEEK, label: T[a.LEADING_WEEK] }
80
+ ]
81
+ },
82
+ month: {
83
+ label: "Month",
84
+ rangeOptions: [
85
+ { value: a.LAST_MONTH, label: T[a.LAST_MONTH] },
86
+ { value: a.TRAILING_MONTH, label: T[a.TRAILING_MONTH] },
87
+ { value: a.THIS_MONTH, label: T[a.THIS_MONTH] },
88
+ { value: a.NEXT_MONTH, label: T[a.NEXT_MONTH] },
89
+ { value: a.LEADING_MONTH, label: T[a.LEADING_MONTH] }
90
+ ]
91
+ },
92
+ quarter: {
93
+ label: "Quarter",
94
+ rangeOptions: [
95
+ { value: a.LAST_QUARTER, label: T[a.LAST_QUARTER] },
96
+ { value: a.TRAILING_QUARTER, label: T[a.TRAILING_QUARTER] },
97
+ { value: a.THIS_QUARTER, label: T[a.THIS_QUARTER] },
98
+ { value: a.NEXT_QUARTER, label: T[a.NEXT_QUARTER] },
99
+ { value: a.LEADING_QUARTER, label: T[a.LEADING_QUARTER] }
100
+ ]
101
+ },
102
+ year: {
103
+ label: "Year",
104
+ rangeOptions: [
105
+ { value: a.LAST_YEAR, label: T[a.LAST_YEAR] },
106
+ { value: a.TRAILING_YEAR, label: T[a.TRAILING_YEAR] },
107
+ { value: a.THIS_YEAR, label: T[a.THIS_YEAR] },
108
+ { value: a.NEXT_YEAR, label: T[a.NEXT_YEAR] },
109
+ { value: a.LEADING_YEAR, label: T[a.LEADING_YEAR] }
110
+ ]
111
+ }
112
+ }, i = (e, r, s) => r ? e : e.filter((A) => !s.has(A.value)), y = /* @__PURE__ */ new Set([
113
+ a.NEXT_DAY,
114
+ a.NEXT_WEEK,
115
+ a.NEXT_MONTH,
116
+ a.NEXT_QUARTER,
117
+ a.NEXT_YEAR,
118
+ a.LEADING_WEEK,
119
+ a.LEADING_MONTH,
120
+ a.LEADING_QUARTER,
121
+ a.LEADING_YEAR
122
+ ]), L = {
123
+ [a.YESTERDAY]: (e) => {
124
+ const r = E(void 0, e).subtract(1, "day");
125
+ return {
126
+ from: t(r.startOf("day")),
127
+ to: t(r.endOf("day"), !1)
128
+ };
129
+ },
130
+ [a.TODAY]: (e) => ({
131
+ from: t(E(void 0, e).startOf("day")),
132
+ to: t(E(void 0, e).endOf("day"), !1)
133
+ }),
134
+ [a.NEXT_DAY]: (e) => {
135
+ const r = E(void 0, e).add(1, "day");
136
+ return {
137
+ from: t(r.startOf("day")),
138
+ to: t(r.endOf("day"), !1)
139
+ };
140
+ },
141
+ [a.LAST_WEEK]: (e) => {
142
+ const r = E(void 0, e).subtract(7, "day");
143
+ return {
144
+ from: t(r.startOf("week")),
145
+ to: t(r.endOf("week"), !1)
146
+ };
147
+ },
148
+ [a.TRAILING_WEEK]: (e) => ({
149
+ from: t(E(void 0, e).subtract(7, "day").startOf("day")),
150
+ to: t(E(void 0, e).subtract(1, "day").endOf("day"), !1)
151
+ }),
152
+ [a.THIS_WEEK]: (e) => ({
153
+ from: t(E(void 0, e).startOf("week")),
154
+ to: t(E(void 0, e).endOf("week"), !1)
155
+ }),
156
+ [a.NEXT_WEEK]: (e) => {
157
+ const r = E(void 0, e).add(1, "week");
158
+ return {
159
+ from: t(r.startOf("week")),
160
+ to: t(r.endOf("week"), !1)
161
+ };
162
+ },
163
+ [a.LEADING_WEEK]: (e) => {
164
+ const r = E(void 0, e);
165
+ return {
166
+ from: t(r.startOf("day")),
167
+ to: t(r.add(1, "week").subtract(1, "day").endOf("day"), !1)
168
+ };
169
+ },
170
+ [a.LAST_MONTH]: (e) => {
171
+ const r = E(void 0, e).subtract(1, "month");
172
+ return {
173
+ from: t(r.startOf("month")),
174
+ to: t(r.endOf("month"), !1)
175
+ };
176
+ },
177
+ [a.TRAILING_MONTH]: (e) => ({
178
+ from: t(E(void 0, e).subtract(1, "month").startOf("day")),
179
+ to: t(E(void 0, e).subtract(1, "day").endOf("day"), !1)
180
+ }),
181
+ [a.THIS_MONTH]: (e) => ({
182
+ from: t(E(void 0, e).startOf("month")),
183
+ to: t(E(void 0, e).endOf("month"), !1)
184
+ }),
185
+ [a.NEXT_MONTH]: (e) => {
186
+ const r = E(void 0, e).add(1, "month");
187
+ return {
188
+ from: t(r.startOf("month")),
189
+ to: t(r.endOf("month"), !1)
190
+ };
191
+ },
192
+ [a.LEADING_MONTH]: (e) => {
193
+ const r = E(void 0, e);
194
+ return {
195
+ from: t(r.startOf("day")),
196
+ to: t(r.add(1, "month").subtract(1, "day").endOf("day"), !1)
197
+ };
198
+ },
199
+ [a.LAST_QUARTER]: (e) => ({
200
+ from: t(E(void 0, e).startOf("quarter").subtract(3, "month").startOf("month")),
201
+ to: t(E(void 0, e).endOf("quarter").subtract(3, "month").endOf("month"), !1)
202
+ }),
203
+ [a.TRAILING_QUARTER]: (e) => ({
204
+ from: t(E(void 0, e).subtract(3, "month").startOf("day")),
205
+ to: t(E(void 0, e).subtract(1, "day").endOf("day"), !1)
206
+ }),
207
+ [a.THIS_QUARTER]: (e) => ({
208
+ from: t(E(void 0, e).startOf("Q")),
209
+ to: t(E(void 0, e).endOf("Q"), !1)
210
+ }),
211
+ [a.NEXT_QUARTER]: (e) => {
212
+ const r = E(void 0, e).add(1, "quarter");
213
+ return {
214
+ from: t(r.startOf("quarter")),
215
+ to: t(r.endOf("quarter"), !1)
216
+ };
217
+ },
218
+ [a.LEADING_QUARTER]: (e) => {
219
+ const r = E(void 0, e);
220
+ return {
221
+ from: t(r.startOf("day")),
222
+ to: t(r.add(3, "month").subtract(1, "day").endOf("day"), !1)
223
+ };
224
+ },
225
+ [a.LAST_YEAR]: (e) => {
226
+ const r = E(void 0, e).subtract(1, "year");
227
+ return {
228
+ from: t(r.startOf("year")),
229
+ to: t(r.endOf("year"), !1)
230
+ };
231
+ },
232
+ [a.TRAILING_YEAR]: (e) => ({
233
+ from: t(E(void 0, e).subtract(1, "year").startOf("day")),
234
+ to: t(E(void 0, e).subtract(1, "day").endOf("day"), !1)
235
+ }),
236
+ [a.THIS_YEAR]: (e) => ({
237
+ from: t(E(void 0, e).startOf("year")),
238
+ to: t(E(void 0, e).endOf("year"), !1)
239
+ }),
240
+ [a.NEXT_YEAR]: (e) => {
241
+ const r = E(void 0, e).add(1, "year");
242
+ return {
243
+ from: t(r.startOf("year")),
244
+ to: t(r.endOf("year"), !1)
245
+ };
246
+ },
247
+ [a.LEADING_YEAR]: (e) => {
248
+ const r = E(void 0, e);
249
+ return {
250
+ from: t(r.startOf("day")),
251
+ to: t(r.add(1, "year").subtract(1, "day").endOf("day"), !1)
252
+ };
253
+ }
254
+ }, D = ({
255
+ ranges: e = ["day", "week", "month", "quarter", "year"],
256
+ value: r,
257
+ showApply: s = !0,
258
+ isFutureDatesAllowed: A = !1,
259
+ timezoneName: _,
260
+ onChange: R,
261
+ onSubmit: N
262
+ }) => /* @__PURE__ */ f("div", { className: "flex space-x-2", children: [
263
+ /* @__PURE__ */ f(O, { size: "medium", value: r, className: "pr-8 leading-5", onChange: (l) => {
264
+ const o = l.target.value, n = L[o](_);
265
+ R(o, n);
266
+ }, children: [
267
+ /* @__PURE__ */ d("option", { value: "", children: "Relative Date Range" }),
268
+ e.map((l) => {
269
+ const o = I[l];
270
+ return /* @__PURE__ */ d("optgroup", { label: o.label, children: i(o.rangeOptions, A, y).map((n) => /* @__PURE__ */ d("option", { value: n.value, children: n.label }, n.value)) }, l);
271
+ })
272
+ ] }),
273
+ s && /* @__PURE__ */ d(u, { onClick: N, children: "Apply" })
274
+ ] });
275
+ export {
276
+ D as RelativeDateRange,
277
+ I as dateRanges,
278
+ T as rangeLabels,
279
+ a as rangeOptions
280
+ };
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ export interface UpcomingDatePickerProps {
3
+ value?: Date | {
4
+ from?: Date;
5
+ to?: Date;
6
+ } | null;
7
+ upcomingDates: Date[];
8
+ onChange: (day: Date, options: Record<string, any>, event: React.MouseEvent) => void;
9
+ onMonthChange: (month: Date) => void;
10
+ }
11
+ export declare const UpcomingDatePicker: ({ value, upcomingDates, onChange, onMonthChange }: UpcomingDatePickerProps) => React.JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
+ import c from "clsx";
3
+ import t from "dayjs";
4
+ const f = ({ value: o, upcomingDates: r, onChange: d, onMonthChange: i }) => /* @__PURE__ */ n("div", { className: "rounded-l-lg border-r border-gray pt-8", children: [
5
+ /* @__PURE__ */ l("p", { className: "mb-2 px-6 text-lg font-bold", children: "Upcoming" }),
6
+ (r == null ? void 0 : r.length) > 0 ? /* @__PURE__ */ l("div", { className: "mt-5", children: r == null ? void 0 : r.map((e) => {
7
+ const m = t(e).isSame(t(o), "day"), s = t(e).format();
8
+ return /* @__PURE__ */ l(
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: (b) => {
17
+ d(e, {}, b), i(e);
18
+ },
19
+ children: t(e).format("ddd DD MMMM")
20
+ },
21
+ s
22
+ );
23
+ }) }) : /* @__PURE__ */ l("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
+ ] });
25
+ export {
26
+ f as UpcomingDatePicker
27
+ };
@@ -0,0 +1,24 @@
1
+ import { default as React } from 'react';
2
+ declare const colors: {
3
+ readonly primary: "bg-primary";
4
+ readonly secondary: "bg-secondary";
5
+ readonly success: "bg-success";
6
+ readonly warning: "bg-warning";
7
+ readonly danger: "bg-danger";
8
+ readonly caution: "bg-caution";
9
+ };
10
+ declare const sizes: {
11
+ readonly small: "h-1 w-1";
12
+ readonly medium: "h-1.5 w-1.5";
13
+ readonly large: "h-2 w-2";
14
+ readonly xlarge: "h-8 w-8";
15
+ };
16
+ type DotColor = keyof typeof colors;
17
+ type DotSize = keyof typeof sizes;
18
+ export interface DotProps extends React.HTMLAttributes<HTMLSpanElement> {
19
+ color?: DotColor;
20
+ size?: DotSize;
21
+ className?: string;
22
+ }
23
+ export declare const Dot: ({ color, size, className, ...rest }: DotProps) => React.JSX.Element;
24
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import a from "clsx";
3
+ const i = {
4
+ primary: "bg-primary",
5
+ secondary: "bg-secondary",
6
+ success: "bg-success",
7
+ warning: "bg-warning",
8
+ danger: "bg-danger",
9
+ caution: "bg-caution"
10
+ }, c = {
11
+ small: "h-1 w-1",
12
+ medium: "h-1.5 w-1.5",
13
+ large: "h-2 w-2",
14
+ xlarge: "h-8 w-8"
15
+ }, g = ({ color: r = "primary", size: s = "medium", className: e, ...n }) => /* @__PURE__ */ o(
16
+ "span",
17
+ {
18
+ className: a("ui-dot", "inline-block rounded-full text-white", i[r], c[s], e),
19
+ ...n
20
+ }
21
+ );
22
+ export {
23
+ g as Dot
24
+ };
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface DotProgressProps {
3
+ total: number;
4
+ current: number;
5
+ }
6
+ export declare const DotProgress: ({ current, total }: DotProgressProps) => React.JSX.Element | null;
@@ -0,0 +1,10 @@
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
+ }) });
8
+ export {
9
+ a as DotProgress
10
+ };
@@ -0,0 +1,28 @@
1
+ import { default as React } from 'react';
2
+ declare const sizes: {
3
+ readonly small: "w-72";
4
+ readonly medium: "w-85";
5
+ readonly large: "w-110";
6
+ readonly xl: "w-200";
7
+ readonly "2xl": "w-screen md:max-w-screen-md 2xl:max-w-screen-lg";
8
+ };
9
+ type DrawerSize = keyof typeof sizes;
10
+ type DrawerPosition = "left" | "right";
11
+ export interface DrawerProps {
12
+ isOpen: boolean;
13
+ title?: React.ReactNode;
14
+ size?: DrawerSize;
15
+ content: React.ReactNode;
16
+ sideIndent?: number;
17
+ position?: DrawerPosition;
18
+ classNames?: {
19
+ dialog?: string;
20
+ overlay?: string;
21
+ dialogContent?: string;
22
+ children?: string;
23
+ content?: string;
24
+ };
25
+ onClose: (value: boolean) => void;
26
+ }
27
+ export declare const Drawer: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
28
+ export {};