@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,55 +0,0 @@
1
- import { merge as t } from "lodash-es";
2
- import { theme as e } from "../../theme.js";
3
- import { BaseChartOptions as o } from "./BaseChartOptions.js";
4
- const a = t({}, o, {
5
- chart: {
6
- type: "pie"
7
- },
8
- tooltip: {
9
- pointFormat: "<b>{point.percentage:.1f}%</b>"
10
- },
11
- plotOptions: {
12
- pie: {
13
- size: 180,
14
- center: [80, 90],
15
- allowPointSelect: !0,
16
- cursor: "pointer",
17
- dataLabels: {
18
- enabled: !1
19
- },
20
- showInLegend: !0,
21
- innerSize: 110
22
- // Donuts. Krispy Kreme 4tw
23
- }
24
- },
25
- legend: {
26
- enabled: !0,
27
- maxHeight: 120,
28
- width: 220,
29
- navigation: {
30
- // This is the navigation for the legend. A scrollable list
31
- activeColor: e.colors.gray.darker,
32
- animation: "true",
33
- style: e.extend.fontFamily.sans
34
- },
35
- padding: 5,
36
- backgroundColor: e.colors.white,
37
- // For debugging
38
- itemMarginTop: 1,
39
- itemMarginBottom: 3,
40
- itemStyle: e.extend.fontFamily.sans,
41
- style: { overflow: "hidden" },
42
- align: "left",
43
- layout: "horizontal",
44
- verticalAlign: "proximate",
45
- y: 240
46
- // To get the legend to show right below the pie
47
- },
48
- credits: {
49
- // Don't show the 'Powered by Highcharts' text
50
- enabled: !1
51
- }
52
- });
53
- export {
54
- a as PieOptions
55
- };
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface CounterProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- className?: string;
4
- }
5
- export declare const Counter: ({ className, ...rest }: CounterProps) => React.JSX.Element;
@@ -1,16 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import r from "../helpers/classnames.js";
3
- const s = ({ className: e, ...n }) => /* @__PURE__ */ t(
4
- "span",
5
- {
6
- className: r(
7
- "ui-counter",
8
- "inline-flex items-center justify-center rounded-full bg-danger-dark px-2 py-1 font-semibold leading-none text-white",
9
- e
10
- ),
11
- ...n
12
- }
13
- );
14
- export {
15
- s as Counter
16
- };
@@ -1,41 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const variants: {
3
- readonly single: "single";
4
- readonly range: "range";
5
- };
6
- type DatePickerVariant = keyof typeof variants;
7
- type DateValue = Date | {
8
- from?: Date;
9
- to?: Date;
10
- };
11
- type RangeKey = "day" | "week" | "month" | "quarter" | "year";
12
- export interface DatePickerProps {
13
- [key: string]: any;
14
- variant?: DatePickerVariant;
15
- value?: DateValue;
16
- selectedDays?: DateValue;
17
- upcomingDates?: Date[];
18
- disabledDays?: ((date: Date) => boolean) | Date[];
19
- loadingDays?: ((date: Date) => boolean) | Date[];
20
- shouldShowYearPicker?: boolean;
21
- shouldShowMonthSelector?: boolean;
22
- shouldShowRelativeRanges?: boolean;
23
- isFutureDatesAllowed?: boolean;
24
- modifiers?: Record<string, any>;
25
- ranges?: RangeKey[];
26
- components?: {
27
- Footer?: React.ComponentType;
28
- };
29
- locale?: string;
30
- timezoneName?: string;
31
- getDayContent?: (day: number, date: Date) => React.ReactNode;
32
- getTooltip?: (date: Date) => React.ReactNode;
33
- onChange: (value: any, options?: any, event?: any) => void;
34
- onMonthChange?: (month: Date) => void;
35
- onSubmitDateRange?: () => void;
36
- }
37
- /**
38
- * Figma Design link: https://www.figma.com/file/tL2vrxuBIzujkDfYvVjUhs/%F0%9F%9B%A0-Xola-DS-Desktop-Master-%F0%9F%9B%A0?node-id=2689%3A101580
39
- */
40
- export declare const DatePicker: ({ variant, value, selectedDays, upcomingDates, disabledDays, loadingDays, shouldShowYearPicker, shouldShowMonthSelector, shouldShowRelativeRanges, isFutureDatesAllowed, modifiers, ranges, components, locale, timezoneName, getDayContent, getTooltip, onChange, onMonthChange, onSubmitDateRange, month: externalMonth, ...rest }: DatePickerProps) => React.JSX.Element;
41
- export {};
@@ -1,17 +0,0 @@
1
- import { Locale } from 'date-fns/locale';
2
- export type LocaleCode = keyof typeof locales;
3
- export type LocalizationProps = {
4
- locale: Locale;
5
- };
6
- declare const locales: {
7
- en: Locale;
8
- "en-US": Locale;
9
- "en-GB": Locale;
10
- es: Locale;
11
- "es-ES": Locale;
12
- "es-MX": Locale;
13
- fr: Locale;
14
- de: Locale;
15
- };
16
- export declare const getLocalizationProps: (localeCode: LocaleCode) => Promise<Partial<LocalizationProps>>;
17
- export {};
@@ -1,22 +0,0 @@
1
- import { de as n, fr as t, es as e, enGB as a, enUS as o } from "date-fns/locale";
2
- const l = {
3
- en: o,
4
- "en-US": o,
5
- "en-GB": a,
6
- es: e,
7
- "es-ES": e,
8
- "es-MX": e,
9
- fr: t,
10
- de: n
11
- }, i = async (c) => {
12
- try {
13
- return {
14
- locale: l[c]
15
- };
16
- } catch (r) {
17
- throw console.error("Error: React Day Picker localization error", r), r;
18
- }
19
- };
20
- export {
21
- i as getLocalizationProps
22
- };
@@ -1,241 +0,0 @@
1
- import { jsx as s, jsxs as X, Fragment as kt } from "react/jsx-runtime";
2
- import Y from "dayjs";
3
- import { isArray as h, isFunction as M } from "lodash-es";
4
- import { useContext as Dt, useState as N, useEffect as yt, useCallback as V, useMemo as jt } from "react";
5
- import { isBefore as C, startOfDay as b, endOfDay as v, isAfter as tt, isSameDay as Rt } from "date-fns";
6
- import { Tooltip as Nt } from "../Tooltip.js";
7
- import { RelativeDateRange as Vt } from "./RelativeDateRange.js";
8
- import { MonthSelector as Lt } from "./MonthSelector.js";
9
- import { UpcomingDatePicker as Ot } from "./UpcomingDatePicker.js";
10
- import { now as f, isSame as L, isValidTimeZoneName as St, toDate as l } from "../../helpers/date.js";
11
- import { Context as Et } from "../Provider.js";
12
- import Ft from "../../helpers/classnames.js";
13
- import { Day as rt } from "./Day.js";
14
- import { LocalizedDayPicker as _t } from "./LocalizedDayPicker.js";
15
- import { MonthYearSelector as Tt } from "./MonthYearSelector.js";
16
- import { NavbarElement as At } from "./NavbarElement.js";
17
- import Bt from "./RangeDatePicker.js";
18
- const P = {
19
- single: "single",
20
- range: "range"
21
- }, Ct = ({
22
- variant: U = P.single,
23
- value: r,
24
- selectedDays: c,
25
- upcomingDates: W,
26
- disabledDays: x = [],
27
- loadingDays: k = [],
28
- shouldShowYearPicker: O = !1,
29
- shouldShowMonthSelector: S = !1,
30
- shouldShowRelativeRanges: et = !1,
31
- isFutureDatesAllowed: ot = !1,
32
- modifiers: E = {},
33
- ranges: nt,
34
- components: z = {},
35
- locale: D,
36
- timezoneName: u,
37
- getDayContent: F,
38
- getTooltip: y,
39
- onChange: a,
40
- onMonthChange: i,
41
- onSubmitDateRange: ft,
42
- month: it,
43
- // Deprecated v7 props are spread into rest and ignored
44
- ...H
45
- }) => {
46
- var K, Q;
47
- const { locale: j } = Dt(Et), o = u ?? void 0, st = r ? U === P.single ? r : r.from : null, [d, _] = N(it ?? st ?? f(void 0, o).toDate()), [mt, Z] = N(() => !r || typeof r != "object" || !("from" in r) || !r.from ? /* @__PURE__ */ new Date() : r.from), [lt, $] = N(() => !r || typeof r != "object" || !("from" in r) || !("to" in r) || !r.to || !r.from ? f(void 0, o).add(1, "month").toDate() : L(f(r.to, o), f(r.from, o), "month") ? f(r.from, o).add(1, "month").toDate() : r.to), [ct, at] = N(""), p = U === P.range, R = r && typeof r == "object" && "from" in r && "to" in r && r.from && r.to, dt = c && typeof c == "object" && "from" in c && "to" in c && c.from && c.to;
48
- yt(() => {
49
- u && !St(u) && (console.log(`${u} is not a valid timezone. Using default timezone now`), Y.tz.setDefault());
50
- }, [u]);
51
- const q = (t, e, m) => {
52
- if (p)
53
- return;
54
- const n = u ? l(f(t, u)) : /* @__PURE__ */ new Date();
55
- e.disabled || T(n) ? (_(n), i == null || i(n)) : a(n, e, m);
56
- }, T = (t) => h(x) ? x.some((e) => {
57
- if (e.daysOfWeek)
58
- return e.daysOfWeek.includes(t.getDay());
59
- if (e.after || e.before) {
60
- const m = e.after ? tt(b(t), b(e.after)) : !0, n = e.before ? C(b(t), b(e.before)) : !0;
61
- return m && n;
62
- }
63
- return e instanceof Date ? L(f(e, o), t, "day") : !1;
64
- }) : M(x) ? x(t) : !1, bt = (t) => h(k) ? k.some((e) => L(f(e, o), t, "day")) : M(k) ? k(t) : !1, ut = (t, e) => {
65
- _(e.from), Z(e.from), $(e.to), a({ ...e, rangeName: t }, E, null);
66
- }, g = V(
67
- (t) => {
68
- _(t), i == null || i(t);
69
- },
70
- [i]
71
- ), G = V(
72
- (t) => {
73
- Z(t), i == null || i(t);
74
- },
75
- [i]
76
- ), pt = V(
77
- (t) => {
78
- $(t), i == null || i(t);
79
- },
80
- [i]
81
- ), A = V(
82
- (t, e, m) => {
83
- if (!(!t || e.disabled))
84
- if (r && typeof r == "object" && "from" in r && r.from && L(f(r.from, o), f(t, o), "month") && G(t), at(""), p) {
85
- const n = r;
86
- if (R)
87
- a({ from: l(f(t, o)), to: null }, e, m);
88
- else if (n && (n.from || n.to) && (n.from || n.to).getTime() === t.getTime()) {
89
- const w = l(f(t, o)), B = l(f(t, o).endOf("day"), !1);
90
- a({ from: w, to: B }, e, m);
91
- } else if (n.from && C(b(n.from), b(l(f(t, o))))) {
92
- const w = n.from, B = v(l(f(t, o), !1));
93
- a({ from: w, to: B }, e, m);
94
- } else if (n.from && (tt(b(n.from), b(l(f(t, o)))) || Rt(n.from, l(f(t, o)))))
95
- a(
96
- {
97
- from: l(f(t, o)),
98
- to: l(f(n.from).endOf("day"), !1)
99
- },
100
- e,
101
- m
102
- );
103
- else {
104
- const w = v(l(f(t, o), !1));
105
- a({ from: n.from, to: w }, e, m);
106
- }
107
- } else
108
- a(l(f(t, o)), e, m);
109
- },
110
- // eslint-disable-next-line react-hooks/exhaustive-deps
111
- [p, R, a, o, r]
112
- ), I = jt(() => (O || S) && d ? (t) => S ? /* @__PURE__ */ s(
113
- Lt,
114
- {
115
- date: t.date || d,
116
- currentMonth: d,
117
- locale: D ?? j,
118
- onChange: g
119
- }
120
- ) : /* @__PURE__ */ s(
121
- Tt,
122
- {
123
- date: t.date || d,
124
- currentMonth: d,
125
- locale: D ?? j,
126
- onChange: g
127
- }
128
- ) : void 0, [O, S, d, g, D, j]), xt = (t) => {
129
- const e = y == null ? void 0 : y(t), m = T(t), n = bt(t);
130
- return e ? /* @__PURE__ */ s(Nt, { placement: "top", content: e, children: /* @__PURE__ */ s(
131
- rt,
132
- {
133
- disabled: m,
134
- isLoading: n,
135
- selectedDate: r,
136
- date: t,
137
- getContent: F,
138
- currentMonth: d
139
- }
140
- ) }) : /* @__PURE__ */ s(
141
- rt,
142
- {
143
- disabled: m,
144
- isLoading: n,
145
- selectedDate: r,
146
- date: t,
147
- getContent: F,
148
- currentMonth: d
149
- }
150
- );
151
- }, J = p && R ? { start: r.from, end: r.to } : dt ? { start: c.from, end: c.to } : null, gt = p && R && ((K = r.from) == null ? void 0 : K.getTime()) !== ((Q = r.to) == null ? void 0 : Q.getTime()), wt = c ?? (r && (Y.isDayjs(r) || p ? r : f(r, o).toDate()));
152
- return /* @__PURE__ */ X(kt, { children: [
153
- /* @__PURE__ */ X("div", { className: "flex", children: [
154
- W ? /* @__PURE__ */ s(
155
- Ot,
156
- {
157
- upcomingDates: W,
158
- value: r,
159
- onChange: A,
160
- onMonthChange: g
161
- }
162
- ) : null,
163
- p ? /* @__PURE__ */ s(
164
- Bt,
165
- {
166
- isDateRangeStyle: gt,
167
- shouldShowYearPicker: O,
168
- startMonth: mt,
169
- endMonth: lt,
170
- modifiers: { ...E, ...J },
171
- getTooltip: y,
172
- disabledDays: x,
173
- getDayContent: F,
174
- value: r,
175
- handleDayClick: A,
176
- handleStartMonthChange: G,
177
- handleEndMonthChange: pt,
178
- handleTodayClick: q,
179
- selectedDays: wt,
180
- locale: D ?? j,
181
- timezoneName: o,
182
- ...H
183
- }
184
- ) : /* @__PURE__ */ s(
185
- _t,
186
- {
187
- className: Ft("pt-6 tracking-tightest rounded-lg ring-0 focus:outline-none focus:ring-0"),
188
- mode: "single",
189
- selected: r,
190
- month: d,
191
- modifiers: { ...E, ...J },
192
- disabled: T,
193
- onSelect: A,
194
- onMonthChange: g,
195
- classNames: {
196
- months: "flex flex-col relative",
197
- month_caption: "relative flex h-8 mb-4 pl-4",
198
- caption_label: "text-lg font-semibold",
199
- nav: "h-8 right-4 absolute items-center",
200
- weekdays: "flex flex-row",
201
- weekday: "w-full m-0 p-0 text-base font-semibold text-black",
202
- month: "w-full min-w-[400px]",
203
- month_grid: "w-full mt-4",
204
- week: "mt-0.5 flex w-full justify-between",
205
- day: "w-[calc(100%/7)] mr-0.5 rounded",
206
- 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",
207
- selected: "[&>button]:border [&>button]:border-blue [&>button]:bg-blue [&>button]:text-white [&>button:hover]:border-blue-darker [&>button:hover]:bg-blue-darker",
208
- today: "[&>button]:border [&>button]:border-gray-light",
209
- outside: "opacity-0",
210
- disabled: "text-gray-light cursor-not-allowed [&>button]:cursor-not-allowed",
211
- hidden: "invisible"
212
- },
213
- modifiersClassNames: {
214
- 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"
215
- },
216
- components: {
217
- ...I ? { CaptionLabel: I } : {},
218
- DayButton: ({ day: t, ...e }) => /* @__PURE__ */ s("button", { ...e, children: xt(t.date) }),
219
- Nav: (t) => /* @__PURE__ */ s(At, { ...t, onTodayClick: (e) => q(/* @__PURE__ */ new Date(), {}, e) })
220
- },
221
- ...H
222
- }
223
- )
224
- ] }),
225
- z.Footer ? /* @__PURE__ */ s(z.Footer, {}) : null,
226
- et && /* @__PURE__ */ s("div", { className: "max-w-200 ", children: /* @__PURE__ */ s("div", { className: "ml-auto w-5/12", children: /* @__PURE__ */ s(
227
- Vt,
228
- {
229
- value: ct,
230
- ranges: nt,
231
- timezoneName: o,
232
- isFutureDatesAllowed: ot,
233
- onChange: ut,
234
- onSubmit: ft
235
- }
236
- ) }) })
237
- ] });
238
- };
239
- export {
240
- Ct as DatePicker
241
- };
@@ -1,29 +0,0 @@
1
- import { default as React } from 'react';
2
- import { PopoverProps } from '../Popover/Popover';
3
- type DateValue = Date | {
4
- from?: Date;
5
- to?: Date;
6
- };
7
- type PickerType = "day" | "month";
8
- type PickerVariant = "single" | "range";
9
- export interface DatePickerPopoverProps {
10
- [key: string]: any;
11
- value?: DateValue;
12
- variant?: PickerVariant;
13
- dateFormat?: string;
14
- placeholder?: string;
15
- pickerType?: PickerType;
16
- classNames?: {
17
- popover?: string;
18
- input?: string;
19
- };
20
- components?: {
21
- Footer?: React.ComponentType;
22
- };
23
- popoverProps?: Partial<PopoverProps>;
24
- children?: React.ReactElement;
25
- getDayContent?: (day: number, date: Date) => React.ReactNode;
26
- onChange?: (...arguments_: any[]) => void;
27
- }
28
- export declare const DatePickerPopover: ({ value, variant, dateFormat, placeholder, pickerType, classNames, components, popoverProps, children, getDayContent, onChange, ...rest }: DatePickerPopoverProps) => React.JSX.Element;
29
- export {};
@@ -1,81 +0,0 @@
1
- import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
- import { useState as m, useEffect as E, cloneElement as L, forwardRef as A } from "react";
3
- import { formatDate as M } from "../../helpers/date.js";
4
- import y from "../../helpers/classnames.js";
5
- import { Input as W } from "../Forms/Input.js";
6
- import { Popover as D } from "../Popover/Popover.js";
7
- import { DatePicker as q } from "./DatePicker.js";
8
- import { MonthPicker as B } from "./MonthPicker.js";
9
- import { CalendarIcon as F } from "../../icons/src/CalendarIcon.js";
10
- import { DownArrowIcon as G } from "../../icons/src/DownArrowIcon.js";
11
- const $ = ({
12
- value: t,
13
- variant: r = "single",
14
- dateFormat: l = "ddd, LL",
15
- placeholder: V = "Select Date",
16
- pickerType: N = "day",
17
- classNames: o = {},
18
- components: P = {},
19
- popoverProps: O,
20
- children: n,
21
- getDayContent: S,
22
- onChange: i,
23
- ...p
24
- }) => {
25
- const [j] = m(t), [w, f] = m(t), [c, d] = m(!1), s = () => {
26
- d(!c);
27
- }, a = (b, u, k) => {
28
- r === "single" ? (i == null || i(b, u, k), s()) : i == null || i(b, w, u, k);
29
- }, R = () => {
30
- f(t), i == null || i(t), d(!1);
31
- }, z = () => {
32
- r === "range" && t && typeof t == "object" && "to" in t && !t.to && (i == null || i(j)), s();
33
- };
34
- return E(() => {
35
- f(t);
36
- }, [t]), /* @__PURE__ */ x(
37
- D,
38
- {
39
- visible: c,
40
- maxWidth: 900,
41
- distance: 18,
42
- placement: "bottom",
43
- className: y("ui-date-picker-input", o.popover),
44
- onClickOutside: z,
45
- ...O,
46
- children: [
47
- n ? L(n, { onClick: s }) : /* @__PURE__ */ e(
48
- I,
49
- {
50
- readOnly: !0,
51
- size: "medium",
52
- value: t ? M(t, l) : "",
53
- placeholder: V,
54
- className: o == null ? void 0 : o.input,
55
- onClick: s
56
- }
57
- ),
58
- /* @__PURE__ */ e(D.Content, { className: "pr-1", children: c && (N === "month" ? /* @__PURE__ */ e(B, { value: t, onChange: a, ...p }) : /* @__PURE__ */ e(
59
- q,
60
- {
61
- variant: r,
62
- getDayContent: S,
63
- value: t,
64
- components: P,
65
- onChange: a,
66
- onSubmitDateRange: R,
67
- ...p
68
- }
69
- )) })
70
- ]
71
- }
72
- );
73
- }, I = A(({ className: t, ...r }, l) => /* @__PURE__ */ x("div", { ref: l, className: "relative flex bg-gray-lighter", children: [
74
- /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-0 flex items-center pl-3", children: /* @__PURE__ */ e(F, { className: "z-10 inline-block" }) }),
75
- /* @__PURE__ */ e(W, { className: y("no-translate cursor-pointer px-8", t), ...r }),
76
- /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", children: /* @__PURE__ */ e(G, { className: "inline-block" }) })
77
- ] }));
78
- I.displayName = "DefaultInput";
79
- export {
80
- $ as DatePickerPopover
81
- };
@@ -1,13 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface DayProps {
3
- selectedDate?: Date | {
4
- from?: Date;
5
- to?: Date;
6
- } | null;
7
- date: Date;
8
- currentMonth: Date;
9
- isLoading?: boolean;
10
- disabled?: boolean;
11
- getContent?: (day: number, date: Date) => React.ReactNode;
12
- }
13
- export declare const Day: ({ selectedDate, date, currentMonth, isLoading, disabled, getContent, }: DayProps) => React.JSX.Element;
@@ -1,40 +0,0 @@
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(
20
- "div",
21
- {
22
- className: m(
23
- "ui-date-picker-day",
24
- "flex items-center justify-center",
25
- u && c && !a ? "selected text-white" : null,
26
- c ? "date" : null
27
- ),
28
- children: n.getDate()
29
- }
30
- );
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
- ] });
37
- };
38
- export {
39
- v as Day
40
- };
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- import { DayPickerProps } from 'react-day-picker';
3
- export declare const LocalizedDayPicker: {
4
- ({ className, ...rest }: DayPickerProps): React.JSX.Element;
5
- displayName: string;
6
- };
@@ -1,20 +0,0 @@
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";
18
- export {
19
- C as LocalizedDayPicker
20
- };
@@ -1,11 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface MonthGridProps {
3
- year: number;
4
- value?: Date;
5
- locale?: string;
6
- onChange: (newDate: Date) => void;
7
- handleYearChange: (offset: number) => void;
8
- handleClear: () => void;
9
- handleToday: () => void;
10
- }
11
- export declare const MonthGrid: ({ year, value, locale, onChange, handleYearChange, handleClear, handleToday, }: MonthGridProps) => React.JSX.Element;
@@ -1,52 +0,0 @@
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);
24
- };
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
- ] });
49
- };
50
- export {
51
- A as MonthGrid
52
- };
@@ -1,7 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface MonthPickerProps {
3
- value: Date;
4
- locale?: string;
5
- onChange: (date: Date) => void;
6
- }
7
- export declare const MonthPicker: ({ value, locale, onChange }: MonthPickerProps) => React.JSX.Element;