@xola/ui-kit 3.5.0 → 3.6.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 (220) hide show
  1. package/README.md +48 -78
  2. package/build/style.css +1 -0
  3. package/build/theme.css +76 -0
  4. package/build/ui-kit.es.js +16771 -0
  5. package/index.css +96 -4
  6. package/index.d.ts +151 -0
  7. package/package.json +68 -89
  8. package/postcss.config.js +1 -1
  9. package/tailwind.config.js +10 -11
  10. package/build/base.css +0 -2
  11. package/build/components/Alert.d.ts +0 -18
  12. package/build/components/Alert.js +0 -24
  13. package/build/components/Animation/FadeIn.d.ts +0 -13
  14. package/build/components/Animation/FadeIn.js +0 -29
  15. package/build/components/Animation/SlideDown.d.ts +0 -6
  16. package/build/components/Animation/SlideDown.js +0 -20
  17. package/build/components/Avatar.d.ts +0 -16
  18. package/build/components/Avatar.js +0 -21
  19. package/build/components/Badge.d.ts +0 -28
  20. package/build/components/Badge.js +0 -42
  21. package/build/components/Breadcrumb.d.ts +0 -21
  22. package/build/components/Breadcrumb.js +0 -27
  23. package/build/components/Breakdown.d.ts +0 -63
  24. package/build/components/Breakdown.js +0 -89
  25. package/build/components/Buttons/Button.d.ts +0 -53
  26. package/build/components/Buttons/Button.js +0 -83
  27. package/build/components/Buttons/ButtonGroup.d.ts +0 -35
  28. package/build/components/Buttons/ButtonGroup.js +0 -55
  29. package/build/components/Buttons/SubmitButton.d.ts +0 -11
  30. package/build/components/Buttons/SubmitButton.js +0 -83
  31. package/build/components/Buttons/ToggleButton.d.ts +0 -21
  32. package/build/components/Buttons/ToggleButton.js +0 -34
  33. package/build/components/Charts/BaseChartOptions.d.ts +0 -136
  34. package/build/components/Charts/BaseChartOptions.js +0 -95
  35. package/build/components/Charts/HistogramOptions.d.ts +0 -192
  36. package/build/components/Charts/HistogramOptions.js +0 -69
  37. package/build/components/Charts/PieOptions.d.ts +0 -177
  38. package/build/components/Charts/PieOptions.js +0 -55
  39. package/build/components/Counter.d.ts +0 -5
  40. package/build/components/Counter.js +0 -16
  41. package/build/components/DatePicker/DatePicker.d.ts +0 -41
  42. package/build/components/DatePicker/DatePicker.helpers.d.ts +0 -17
  43. package/build/components/DatePicker/DatePicker.helpers.js +0 -22
  44. package/build/components/DatePicker/DatePicker.js +0 -241
  45. package/build/components/DatePicker/DatePickerPopover.d.ts +0 -29
  46. package/build/components/DatePicker/DatePickerPopover.js +0 -81
  47. package/build/components/DatePicker/Day.d.ts +0 -13
  48. package/build/components/DatePicker/Day.js +0 -40
  49. package/build/components/DatePicker/LocalizedDayPicker.d.ts +0 -6
  50. package/build/components/DatePicker/LocalizedDayPicker.js +0 -20
  51. package/build/components/DatePicker/MonthGrid.d.ts +0 -11
  52. package/build/components/DatePicker/MonthGrid.js +0 -52
  53. package/build/components/DatePicker/MonthPicker.d.ts +0 -7
  54. package/build/components/DatePicker/MonthPicker.js +0 -28
  55. package/build/components/DatePicker/MonthSelector.d.ts +0 -8
  56. package/build/components/DatePicker/MonthSelector.js +0 -47
  57. package/build/components/DatePicker/MonthYearSelector.d.ts +0 -8
  58. package/build/components/DatePicker/MonthYearSelector.js +0 -44
  59. package/build/components/DatePicker/NavbarElement.d.ts +0 -15
  60. package/build/components/DatePicker/NavbarElement.js +0 -43
  61. package/build/components/DatePicker/RangeDatePicker.d.ts +0 -25
  62. package/build/components/DatePicker/RangeDatePicker.js +0 -130
  63. package/build/components/DatePicker/RelativeDateRange.d.ts +0 -51
  64. package/build/components/DatePicker/RelativeDateRange.js +0 -280
  65. package/build/components/DatePicker/UpcomingDatePicker.d.ts +0 -11
  66. package/build/components/DatePicker/UpcomingDatePicker.js +0 -27
  67. package/build/components/Dot/Dot.d.ts +0 -24
  68. package/build/components/Dot/Dot.js +0 -24
  69. package/build/components/Dot/DotProgress.d.ts +0 -6
  70. package/build/components/Dot/DotProgress.js +0 -10
  71. package/build/components/Drawer.d.ts +0 -28
  72. package/build/components/Drawer.js +0 -126
  73. package/build/components/Forms/BaseInput.d.ts +0 -20
  74. package/build/components/Forms/BaseInput.js +0 -41
  75. package/build/components/Forms/Checkbox.d.ts +0 -10
  76. package/build/components/Forms/Checkbox.js +0 -34
  77. package/build/components/Forms/Checkbox.module.css.js +0 -7
  78. package/build/components/Forms/ComboBox.d.ts +0 -8
  79. package/build/components/Forms/ComboBox.js +0 -41
  80. package/build/components/Forms/FormGroup.d.ts +0 -5
  81. package/build/components/Forms/FormGroup.js +0 -6
  82. package/build/components/Forms/InlineValuePopover.d.ts +0 -17
  83. package/build/components/Forms/InlineValuePopover.js +0 -47
  84. package/build/components/Forms/Input.d.ts +0 -6
  85. package/build/components/Forms/Input.js +0 -9
  86. package/build/components/Forms/Label.d.ts +0 -7
  87. package/build/components/Forms/Label.js +0 -17
  88. package/build/components/Forms/RangeSlider.d.ts +0 -33
  89. package/build/components/Forms/RangeSlider.js +0 -39
  90. package/build/components/Forms/Select.d.ts +0 -5
  91. package/build/components/Forms/Select.js +0 -8
  92. package/build/components/Forms/Switch.d.ts +0 -46
  93. package/build/components/Forms/Switch.js +0 -62
  94. package/build/components/Forms/Textarea.d.ts +0 -6
  95. package/build/components/Forms/Textarea.js +0 -35
  96. package/build/components/Forms/ValuePopoverText.d.ts +0 -6
  97. package/build/components/Forms/ValuePopoverText.js +0 -10
  98. package/build/components/GooglePlacesAutocomplete.d.ts +0 -14
  99. package/build/components/HeaderToolbar.d.ts +0 -21
  100. package/build/components/HeaderToolbar.js +0 -33
  101. package/build/components/ImageUpload.d.ts +0 -17
  102. package/build/components/ImageUpload.js +0 -86
  103. package/build/components/Key.d.ts +0 -6
  104. package/build/components/Key.js +0 -28
  105. package/build/components/Logo.d.ts +0 -19
  106. package/build/components/Logo.js +0 -10
  107. package/build/components/Modal.d.ts +0 -52
  108. package/build/components/Modal.js +0 -126
  109. package/build/components/Popover/Popover.d.ts +0 -20
  110. package/build/components/Popover/Popover.js +0 -44
  111. package/build/components/Popover/Popover.module.css.js +0 -7
  112. package/build/components/Popover/PopoverList.d.ts +0 -25
  113. package/build/components/Popover/PopoverList.js +0 -50
  114. package/build/components/Popover/PopoverScroll.module.css.js +0 -4
  115. package/build/components/Provider.d.ts +0 -18
  116. package/build/components/Provider.js +0 -17
  117. package/build/components/Screens/Login.d.ts +0 -25
  118. package/build/components/Screens/Login.js +0 -144
  119. package/build/components/Search.d.ts +0 -16
  120. package/build/components/Search.js +0 -174
  121. package/build/components/Sidebar/Sidebar.Account.d.ts +0 -13
  122. package/build/components/Sidebar/Sidebar.Account.js +0 -56
  123. package/build/components/Sidebar/Sidebar.Button.d.ts +0 -10
  124. package/build/components/Sidebar/Sidebar.Button.js +0 -21
  125. package/build/components/Sidebar/Sidebar.Footer.d.ts +0 -8
  126. package/build/components/Sidebar/Sidebar.Footer.js +0 -9
  127. package/build/components/Sidebar/Sidebar.Heading.d.ts +0 -10
  128. package/build/components/Sidebar/Sidebar.Heading.js +0 -10
  129. package/build/components/Sidebar/Sidebar.Link.d.ts +0 -24
  130. package/build/components/Sidebar/Sidebar.Link.js +0 -57
  131. package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -13
  132. package/build/components/Sidebar/Sidebar.Menu.js +0 -30
  133. package/build/components/Sidebar/Sidebar.Menu.module.css.js +0 -7
  134. package/build/components/Sidebar/Sidebar.d.ts +0 -58
  135. package/build/components/Sidebar/Sidebar.js +0 -219
  136. package/build/components/Sidebar/SidebarScroll.module.css.js +0 -4
  137. package/build/components/Sidebar/index.d.ts +0 -8
  138. package/build/components/Skeleton.d.ts +0 -13
  139. package/build/components/Skeleton.js +0 -29
  140. package/build/components/Skeleton.module.css.js +0 -7
  141. package/build/components/Spinner.d.ts +0 -26
  142. package/build/components/Spinner.js +0 -27
  143. package/build/components/Table.d.ts +0 -59
  144. package/build/components/Table.js +0 -71
  145. package/build/components/Tabs/Tabs.Panel.d.ts +0 -9
  146. package/build/components/Tabs/Tabs.Panel.js +0 -7
  147. package/build/components/Tabs/Tabs.Tab.d.ts +0 -19
  148. package/build/components/Tabs/Tabs.Tab.js +0 -37
  149. package/build/components/Tabs/Tabs.d.ts +0 -27
  150. package/build/components/Tabs/Tabs.js +0 -28
  151. package/build/components/Tabs/index.d.ts +0 -4
  152. package/build/components/Tag.d.ts +0 -25
  153. package/build/components/Tag.js +0 -36
  154. package/build/components/Tooltip.d.ts +0 -8
  155. package/build/components/Tooltip.js +0 -8
  156. package/build/components/Utilities/Currency.d.ts +0 -32
  157. package/build/components/Utilities/Currency.js +0 -49
  158. package/build/components/Utilities/Number.d.ts +0 -8
  159. package/build/components/Utilities/Number.js +0 -15
  160. package/build/components/Utilities/Phone.d.ts +0 -8
  161. package/build/components/Utilities/Phone.js +0 -19
  162. package/build/full.css +0 -2
  163. package/build/helpers/avatar.d.ts +0 -1
  164. package/build/helpers/avatar.js +0 -8
  165. package/build/helpers/browser.d.ts +0 -2
  166. package/build/helpers/browser.js +0 -9
  167. package/build/helpers/children.d.ts +0 -3
  168. package/build/helpers/children.js +0 -6
  169. package/build/helpers/classnames.d.ts +0 -5
  170. package/build/helpers/classnames.js +0 -8
  171. package/build/helpers/currency.d.ts +0 -2
  172. package/build/helpers/currency.js +0 -11
  173. package/build/helpers/date.d.ts +0 -12
  174. package/build/helpers/date.js +0 -49
  175. package/build/helpers/flash.d.ts +0 -21
  176. package/build/helpers/flash.js +0 -87
  177. package/build/helpers/numbers.d.ts +0 -4
  178. package/build/helpers/numbers.js +0 -23
  179. package/build/helpers/phone.d.ts +0 -11
  180. package/build/helpers/phone.js +0 -25
  181. package/build/hooks/useId.d.ts +0 -1
  182. package/build/hooks/useId.js +0 -9
  183. package/build/hooks/useIsClient.d.ts +0 -1
  184. package/build/hooks/useIsClient.js +0 -10
  185. package/build/hooks/useViewportHeight.d.ts +0 -1
  186. package/build/hooks/useViewportHeight.js +0 -15
  187. package/build/icons/src/AnnounceIcon.js +0 -13
  188. package/build/icons/src/BellIcon.js +0 -27
  189. package/build/icons/src/CalendarIcon.js +0 -16
  190. package/build/icons/src/CheckIcon.js +0 -8
  191. package/build/icons/src/ChevronDownIcon.js +0 -8
  192. package/build/icons/src/ChevronLeftIcon.js +0 -8
  193. package/build/icons/src/ChevronRightIcon.js +0 -8
  194. package/build/icons/src/CircleNotch.js +0 -6
  195. package/build/icons/src/CloseIcon.js +0 -11
  196. package/build/icons/src/DownArrowIcon.js +0 -16
  197. package/build/icons/src/ImageIcon.js +0 -27
  198. package/build/icons/src/SearchIcon.js +0 -16
  199. package/build/icons/src/TrashIcon.js +0 -20
  200. package/build/icons/src/WarningDiamondIcon.js +0 -27
  201. package/build/icons/src/helpers/classnames.js +0 -8
  202. package/build/icons/src/helpers/icon.js +0 -11
  203. package/build/icons/src/helpers/iconSizes.js +0 -13
  204. package/build/icons/src/images/XolaLogoSimple.js +0 -14
  205. package/build/index.d.ts +0 -66
  206. package/build/index.js +0 -142
  207. package/build/theme.d.ts +0 -413
  208. package/build/theme.js +0 -372
  209. package/build/types/index.d.ts +0 -22
  210. package/build/types/migration.d.ts +0 -2
  211. package/build/ui-kit.css +0 -1
  212. package/build/utils/avatar.d.ts +0 -1
  213. package/build/utils/avatar.js +0 -8
  214. package/build/utils/currency.d.ts +0 -2
  215. package/build/utils/currency.js +0 -11
  216. package/build/utils/index.d.ts +0 -4
  217. package/build/utils/numbers.d.ts +0 -4
  218. package/build/utils/numbers.js +0 -19
  219. package/build/utils/phone.d.ts +0 -2
  220. package/build/utils/phone.js +0 -17
@@ -1,28 +0,0 @@
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,
8
- {
9
- year: a,
10
- 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
- },
22
- onChange: r
23
- }
24
- ) });
25
- };
26
- export {
27
- Y as MonthPicker
28
- };
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface MonthSelectorProps {
3
- date: Date;
4
- currentMonth: Date;
5
- locale?: string;
6
- onChange: (newDate: Date) => void;
7
- }
8
- export declare const MonthSelector: ({ date, currentMonth, locale, onChange }: MonthSelectorProps) => React.JSX.Element;
@@ -1,47 +0,0 @@
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";
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);
10
- }, b = (n) => {
11
- i(n), t(!1);
12
- }, u = (n) => {
13
- h(a + n);
14
- }, r = () => {
15
- t(!1);
16
- }, C = () => {
17
- i(/* @__PURE__ */ new Date()), t(!1);
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
- ] }) }) });
44
- };
45
- export {
46
- j as MonthSelector
47
- };
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface MonthYearSelectorProps {
3
- date: Date;
4
- currentMonth: Date;
5
- locale?: string;
6
- onChange: (newDate: Date) => void;
7
- }
8
- export declare const MonthYearSelector: ({ date, currentMonth, locale, onChange }: MonthYearSelectorProps) => React.JSX.Element;
@@ -1,44 +0,0 @@
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));
13
- }, y = (e) => {
14
- const r = Number(e.target.value);
15
- c(new Date(r, t.getMonth()));
16
- };
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
- ] });
41
- };
42
- export {
43
- C as MonthYearSelector
44
- };
@@ -1,15 +0,0 @@
1
- import { default as React } from 'react';
2
- import { NavProps } from 'react-day-picker';
3
- export interface NavbarElementProps extends NavProps {
4
- onTodayClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
5
- }
6
- /**
7
- * Render the custom left & right arrows to change the current month.
8
- */
9
- export declare const NavbarElement: ({ className, onTodayClick }: NavbarElementProps) => React.JSX.Element;
10
- export interface ChevronButtonProps {
11
- isVisible?: boolean;
12
- children: React.ReactElement;
13
- onClick?: () => void;
14
- }
15
- export declare const ChevronButton: ({ isVisible, children, onClick }: ChevronButtonProps) => React.JSX.Element;
@@ -1,43 +0,0 @@
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(
29
- "button",
30
- {
31
- type: "button",
32
- className: a(
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
- c as ChevronButton,
42
- C as NavbarElement
43
- };
@@ -1,25 +0,0 @@
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;
@@ -1,130 +0,0 @@
1
- import { jsxs as K, jsx as n } from "react/jsx-runtime";
2
- import { isFunction as Q, isArray as U } from "lodash-es";
3
- import { now as d } from "../../helpers/date.js";
4
- import a from "../../helpers/classnames.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("pt-6 tracking-tightest max-w-[400px] rounded-lg ring-0 focus:outline-none focus:ring-0"),
88
- mode: "single",
89
- selected: b == null ? void 0 : b.from,
90
- month: c,
91
- modifiers: { ...h, start: o == null ? void 0 : o.from },
92
- disabled: E,
93
- onSelect: (t, e, r, s) => p(t, r, s, !0),
94
- onMonthChange: x,
95
- classNames: P,
96
- modifiersClassNames: j,
97
- components: {
98
- ..._ ? { CaptionLabel: _ } : {},
99
- DayButton: ({ day: t, ...e }) => /* @__PURE__ */ n("button", { ...e, children: G(t.date) }),
100
- Nav: (t) => /* @__PURE__ */ n(A, { ...t, onTodayClick: (e) => q(/* @__PURE__ */ new Date(), {}, e) })
101
- },
102
- ...k
103
- }
104
- ),
105
- /* @__PURE__ */ n(
106
- F,
107
- {
108
- className: a("pt-6 tracking-tightest max-w-[400px] rounded-lg ring-0 focus:outline-none focus:ring-0"),
109
- mode: "single",
110
- selected: y || b == null ? void 0 : b.to,
111
- month: m,
112
- modifiers: y ? {} : { ...h, end: o == null ? void 0 : o.to },
113
- disabled: N,
114
- onSelect: (t, e, r, s) => p(t, r, s, !1),
115
- onMonthChange: w,
116
- classNames: P,
117
- modifiersClassNames: j,
118
- components: {
119
- ...S ? { CaptionLabel: S } : {},
120
- DayButton: ({ day: t, ...e }) => /* @__PURE__ */ n("button", { ...e, children: H(t.date) }),
121
- Nav: (t) => /* @__PURE__ */ n(A, { ...t })
122
- },
123
- ...k
124
- }
125
- )
126
- ] });
127
- };
128
- export {
129
- et as default
130
- };
@@ -1,51 +0,0 @@
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 {};