@xola/ui-kit 3.4.6 → 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 (219) 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 -28
  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 -134
  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 -50
  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 -59
  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 -56
  131. package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -10
  132. package/build/components/Sidebar/Sidebar.Menu.js +0 -28
  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/currency.d.ts +0 -2
  171. package/build/helpers/currency.js +0 -11
  172. package/build/helpers/date.d.ts +0 -12
  173. package/build/helpers/date.js +0 -49
  174. package/build/helpers/flash.d.ts +0 -21
  175. package/build/helpers/flash.js +0 -87
  176. package/build/helpers/numbers.d.ts +0 -4
  177. package/build/helpers/numbers.js +0 -23
  178. package/build/helpers/phone.d.ts +0 -11
  179. package/build/helpers/phone.js +0 -25
  180. package/build/hooks/useId.d.ts +0 -1
  181. package/build/hooks/useId.js +0 -9
  182. package/build/hooks/useIsClient.d.ts +0 -1
  183. package/build/hooks/useIsClient.js +0 -10
  184. package/build/hooks/useViewportHeight.d.ts +0 -1
  185. package/build/hooks/useViewportHeight.js +0 -15
  186. package/build/icons/src/AnnounceIcon.js +0 -13
  187. package/build/icons/src/BellIcon.js +0 -27
  188. package/build/icons/src/CalendarIcon.js +0 -16
  189. package/build/icons/src/CheckIcon.js +0 -8
  190. package/build/icons/src/ChevronDownIcon.js +0 -8
  191. package/build/icons/src/ChevronLeftIcon.js +0 -8
  192. package/build/icons/src/ChevronRightIcon.js +0 -8
  193. package/build/icons/src/CircleNotch.js +0 -6
  194. package/build/icons/src/CloseIcon.js +0 -11
  195. package/build/icons/src/DownArrowIcon.js +0 -16
  196. package/build/icons/src/ImageIcon.js +0 -27
  197. package/build/icons/src/SearchIcon.js +0 -16
  198. package/build/icons/src/TrashIcon.js +0 -20
  199. package/build/icons/src/WarningDiamondIcon.js +0 -27
  200. package/build/icons/src/helpers/classnames.js +0 -8
  201. package/build/icons/src/helpers/icon.js +0 -11
  202. package/build/icons/src/helpers/iconSizes.js +0 -13
  203. package/build/icons/src/images/XolaLogoSimple.js +0 -14
  204. package/build/index.d.ts +0 -66
  205. package/build/index.js +0 -142
  206. package/build/theme.d.ts +0 -413
  207. package/build/theme.js +0 -372
  208. package/build/types/index.d.ts +0 -22
  209. package/build/types/migration.d.ts +0 -2
  210. package/build/ui-kit.css +0 -1
  211. package/build/utils/avatar.d.ts +0 -1
  212. package/build/utils/avatar.js +0 -8
  213. package/build/utils/currency.d.ts +0 -2
  214. package/build/utils/currency.js +0 -11
  215. package/build/utils/index.d.ts +0 -4
  216. package/build/utils/numbers.d.ts +0 -4
  217. package/build/utils/numbers.js +0 -19
  218. package/build/utils/phone.d.ts +0 -2
  219. package/build/utils/phone.js +0 -17
@@ -1,41 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import i from "clsx";
3
- import { useRef as c, useState as s, useEffect as m } from "react";
4
- import u, { components as f } from "react-select";
5
- import d from "react-select/creatable";
6
- import { Tooltip as b } from "../Tooltip.js";
7
- /* empty css */
8
- const R = ({ isCreatable: e = !1, isError: t, className: l, ...n }) => /* @__PURE__ */ o(
9
- e ? d : u,
10
- {
11
- className: i("ui-combo-box", t && "border-danger", l),
12
- classNamePrefix: "ui-combo-box",
13
- components: e ? {
14
- IndicatorsContainer: () => null,
15
- Menu: () => null,
16
- MultiValueLabel: x
17
- } : void 0,
18
- ...n
19
- }
20
- ), { MultiValueLabel: p } = f, x = (e) => {
21
- const t = c(null), [l, n] = s(!0);
22
- return m(() => {
23
- var r;
24
- if ((r = t.current) != null && r.offsetParent) {
25
- const a = t.current.offsetWidth > t.current.offsetParent.clientWidth;
26
- n(!a);
27
- }
28
- }, [e.data.label]), /* @__PURE__ */ o(p, { ...e, children: /* @__PURE__ */ o(
29
- b,
30
- {
31
- disabled: l,
32
- maxWidth: "none",
33
- content: /* @__PURE__ */ o("span", { children: e.data.label }),
34
- className: "",
35
- children: /* @__PURE__ */ o("span", { ref: t, children: e.data.label })
36
- }
37
- ) });
38
- };
39
- export {
40
- R as ComboBox
41
- };
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface FormGroupProps extends React.HTMLAttributes<HTMLDivElement> {
3
- className?: string;
4
- }
5
- export declare const FormGroup: ({ className, ...rest }: FormGroupProps) => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import p from "clsx";
3
- const i = ({ className: r, ...o }) => /* @__PURE__ */ m("div", { className: p("ui-form-group", r, "mb-4"), ...o });
4
- export {
5
- i as FormGroup
6
- };
@@ -1,17 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface InlineValuePopoverProps {
3
- text?: React.ReactNode;
4
- isOpen?: boolean;
5
- showArrow?: boolean;
6
- autoSelectOnClick?: boolean;
7
- children?: React.ReactNode;
8
- error?: React.ReactNode | null;
9
- classNames?: {
10
- text?: string;
11
- textField?: string;
12
- children?: string;
13
- };
14
- onClick?: (e: React.MouseEvent) => void;
15
- onClickOutside?: () => void;
16
- }
17
- export declare const InlineValuePopover: ({ text, isOpen, showArrow, autoSelectOnClick, children, error, classNames, onClick, onClickOutside, ...rest }: InlineValuePopoverProps) => React.JSX.Element;
@@ -1,47 +0,0 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import i from "clsx";
3
- import { useRef as P } from "react";
4
- import { Popover as l } from "../Popover/Popover.js";
5
- import { ValuePopoverText as g } from "./ValuePopoverText.js";
6
- import { DownArrowIcon as j } from "../../icons/src/DownArrowIcon.js";
7
- const D = ({
8
- text: f,
9
- isOpen: x = !1,
10
- showArrow: b = !0,
11
- autoSelectOnClick: c = !1,
12
- children: h,
13
- error: p = null,
14
- classNames: r,
15
- onClick: o,
16
- onClickOutside: v,
17
- ...m
18
- }) => {
19
- const t = P(null), w = (I) => {
20
- setTimeout(() => {
21
- var u;
22
- const n = (u = t == null ? void 0 : t.current) == null ? void 0 : u.querySelector("select,textarea,input");
23
- n && (n.focus(), c && n.select());
24
- }, 0), o == null || o(I);
25
- };
26
- return /* @__PURE__ */ d(l, { visible: x, className: "", onClickOutside: v, ...m, children: [
27
- /* @__PURE__ */ d(
28
- "span",
29
- {
30
- className: i(
31
- "cursor-pointer whitespace-nowrap",
32
- p && "!border-danger !text-danger",
33
- r == null ? void 0 : r.text
34
- ),
35
- onClick: w,
36
- children: [
37
- /* @__PURE__ */ e("span", { className: i("border-b border-b-black font-bold text-black", r == null ? void 0 : r.textField), children: /* @__PURE__ */ e(g, { value: f, error: p }) }),
38
- b && /* @__PURE__ */ e(j, { size: "medium" })
39
- ]
40
- }
41
- ),
42
- /* @__PURE__ */ e(l.Content, { children: /* @__PURE__ */ e("div", { ref: t, className: i("p-2", r == null ? void 0 : r.children), children: h }) })
43
- ] });
44
- };
45
- export {
46
- D as InlineValuePopover
47
- };
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- import { BaseInputProps } from './BaseInput';
3
- export interface InputProps extends BaseInputProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof BaseInputProps> {
4
- type?: string;
5
- }
6
- export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,9 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import s from "clsx";
3
- import { forwardRef as a } from "react";
4
- import { BaseInput as e } from "./BaseInput.js";
5
- const n = a(({ className: t, type: r = "text", value: o, ...p }, m) => /* @__PURE__ */ i(e, { ref: m, as: "input", className: s("ui-input", t), type: r, value: o, ...p }));
6
- n.displayName = "Input";
7
- export {
8
- n as Input
9
- };
@@ -1,7 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
3
- isDisabled?: boolean;
4
- isError?: boolean;
5
- className?: string;
6
- }
7
- export declare const Label: ({ isDisabled, isError, className, ...rest }: LabelProps) => React.JSX.Element;
@@ -1,17 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import r from "clsx";
3
- const m = ({ isDisabled: t = !1, isError: e = !1, className: l, ...a }) => /* @__PURE__ */ o(
4
- "label",
5
- {
6
- className: r(
7
- "ui-label",
8
- l,
9
- "mb-1 block text-sm font-bold",
10
- e ? "text-danger" : t ? "text-gray" : "text-black"
11
- ),
12
- ...a
13
- }
14
- );
15
- export {
16
- m as Label
17
- };
@@ -1,33 +0,0 @@
1
- import { default as React } from 'react';
2
- interface TooltipFormatter {
3
- from: (value: number) => number;
4
- to: (value: number) => string;
5
- }
6
- export interface RangeSliderProps {
7
- values: number[];
8
- min: number;
9
- max: number;
10
- isDisabled?: boolean;
11
- shouldConnectHandles?: boolean;
12
- step?: number;
13
- isTooltipEnabled?: boolean;
14
- tooltipCustomFormatter?: TooltipFormatter[] | null;
15
- tooltipSuffix?: string;
16
- className?: string;
17
- onChange?: (values: number[], handle: number) => void;
18
- }
19
- /**
20
- * @param {string?} props.className Class name to apply to the Range slider input.
21
- * @param {number[]} props.values Initial values to be display on the slider input.
22
- * @param {number} props.min Slider Minimum value.
23
- * @param {number} props.max Slider Maximum value.
24
- * @param {boolean?} props.isDisabled To disabled the range slider.
25
- * @param {boolean?} props.shouldConnectHandles To Display colored bars between handles.
26
- * @param {number?} props.step Increament / decrement slider input by this Step count.
27
- * @param {boolean?} props.isTooltipEnabled Show tooltip on slider.
28
- * @param {object[]?} props.tooltipCustomFormatter Custom tooltip formatter.
29
- * @param {string?} props.tooltipSuffix Suffix to be added to the tooltip.
30
- * @param {Function?} props.onChange Debounced callback when range slider is changed.
31
- */
32
- export declare const RangeSlider: ({ values, min, max, isDisabled, shouldConnectHandles, step, isTooltipEnabled, tooltipCustomFormatter, tooltipSuffix, className, onChange, }: RangeSliderProps) => React.JSX.Element;
33
- export {};
@@ -1,39 +0,0 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import u from "clsx";
3
- import g from "nouislider-react";
4
- /* empty css */
5
- /* empty css */
6
- const j = ({
7
- values: t,
8
- min: o,
9
- max: e,
10
- isDisabled: i = !1,
11
- shouldConnectHandles: s = !1,
12
- step: a = 1,
13
- isTooltipEnabled: l = !0,
14
- tooltipCustomFormatter: m = null,
15
- tooltipSuffix: n,
16
- className: p,
17
- onChange: f
18
- }) => {
19
- const c = m ?? t.map(() => ({
20
- from: (r) => r,
21
- to: (r) => `${Math.round(r)}${n ?? ""}`
22
- }));
23
- return /* @__PURE__ */ d(
24
- g,
25
- {
26
- className: u("ui-range-slider", p),
27
- connect: s,
28
- disabled: i,
29
- start: t,
30
- range: { min: o, max: e },
31
- step: a,
32
- tooltips: l ? c : !1,
33
- onChange: f
34
- }
35
- );
36
- };
37
- export {
38
- j as RangeSlider
39
- };
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { BaseInputProps } from './BaseInput';
3
- export interface SelectProps extends BaseInputProps, Omit<React.SelectHTMLAttributes<HTMLSelectElement>, keyof BaseInputProps> {
4
- }
5
- export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,8 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as o } from "react";
3
- import { BaseInput as m } from "./BaseInput.js";
4
- const p = o((e, r) => /* @__PURE__ */ t(m, { ref: r, as: "select", ...e }));
5
- p.displayName = "Select";
6
- export {
7
- p as Select
8
- };
@@ -1,46 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const sizes: {
3
- readonly large: {
4
- readonly parent: "h-6 w-11";
5
- readonly inner: "h-5 w-5";
6
- readonly translate: "translate-x-5";
7
- };
8
- readonly medium: {
9
- readonly parent: "h-5 w-8";
10
- readonly inner: "h-4 w-4";
11
- readonly translate: "translate-x-3";
12
- };
13
- readonly small: {
14
- readonly parent: "h-3 w-5";
15
- readonly inner: "h-2 w-2";
16
- readonly translate: "translate-x-2";
17
- };
18
- };
19
- type SwitchSize = keyof typeof sizes;
20
- export interface SwitchProps {
21
- isChecked?: boolean;
22
- size?: SwitchSize;
23
- disabled?: boolean;
24
- className?: string;
25
- onChange?: (checked: boolean) => void;
26
- }
27
- export interface SwitchGroupProps {
28
- className?: string;
29
- children: React.ReactNode;
30
- }
31
- export interface SwitchLabelProps {
32
- direction?: "left" | "right";
33
- className?: string;
34
- children: React.ReactNode;
35
- }
36
- export declare const Switch: (({ isChecked, size, disabled, className, onChange }: SwitchProps) => React.JSX.Element) & {
37
- Group: {
38
- ({ children, className }: SwitchGroupProps): React.JSX.Element;
39
- displayName: string;
40
- };
41
- Label: {
42
- ({ direction, children, className }: SwitchLabelProps): React.JSX.Element;
43
- displayName: string;
44
- };
45
- };
46
- export {};
@@ -1,62 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Switch as s } from "@headlessui/react";
3
- import n from "clsx";
4
- import { noop as m } from "lodash-es";
5
- const i = {
6
- large: {
7
- parent: "h-6 w-11",
8
- inner: "h-5 w-5",
9
- translate: "translate-x-5"
10
- },
11
- medium: {
12
- parent: "h-5 w-8",
13
- inner: "h-4 w-4",
14
- translate: "translate-x-3"
15
- },
16
- small: {
17
- parent: "h-3 w-5",
18
- inner: "h-2 w-2",
19
- translate: "translate-x-2"
20
- }
21
- }, p = ({ isChecked: r = !1, size: t = "medium", disabled: a, className: c, onChange: u }) => /* @__PURE__ */ e(
22
- s,
23
- {
24
- checked: r,
25
- disabled: a,
26
- className: n(
27
- "ui-switch",
28
- r ? "bg-primary disabled:bg-gray-light" : "bg-gray disabled:bg-gray-light",
29
- "relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none",
30
- i[t].parent,
31
- c
32
- ),
33
- onChange: u ?? m,
34
- children: /* @__PURE__ */ e(
35
- "span",
36
- {
37
- className: n(
38
- r ? i[t].translate : "translate-x-0",
39
- "ui-switch-inner pointer-events-none inline-block transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",
40
- i[t].inner
41
- )
42
- }
43
- )
44
- }
45
- ), o = ({ children: r, className: t }) => /* @__PURE__ */ e(s.Group, { as: "div", className: n("ui-switch-group", "inline-flex items-center", t), children: r });
46
- o.displayName = "Switch.Group";
47
- const l = ({ direction: r = "left", children: t, className: a }) => /* @__PURE__ */ e(
48
- s.Label,
49
- {
50
- as: "span",
51
- className: n("ui-switch-label", "cursor-pointer", r === "left" ? "mr-2" : "ml-2", a),
52
- children: t
53
- }
54
- );
55
- l.displayName = "Switch.Label";
56
- const g = Object.assign(p, {
57
- Group: o,
58
- Label: l
59
- });
60
- export {
61
- g as Switch
62
- };
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- import { BaseInputProps } from './BaseInput';
3
- export interface TextareaProps extends BaseInputProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof BaseInputProps> {
4
- shouldAutoSize?: boolean;
5
- }
6
- export declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,35 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import i from "clsx";
3
- import { forwardRef as p } from "react";
4
- import f from "react-textarea-autosize";
5
- import { BaseInput as s } from "./BaseInput.js";
6
- const n = p(
7
- ({ className: a, value: r, shouldAutoSize: x = !1, rows: t = 2, ...e }, o) => x ? (
8
- // TextareaAutosize has a few special props like minRows and maxRows instead of rows field so using rows field to feed the minRows prop. See full list here https://github.com/Andarist/react-textarea-autosize?tab=readme-ov-file#props
9
- /* @__PURE__ */ m(
10
- s,
11
- {
12
- ref: o,
13
- as: f,
14
- value: r,
15
- minRows: t,
16
- className: i("ui-textarea", a),
17
- ...e
18
- }
19
- )
20
- ) : /* @__PURE__ */ m(
21
- s,
22
- {
23
- ref: o,
24
- as: "textarea",
25
- value: r,
26
- rows: t,
27
- className: i("ui-textarea", a),
28
- ...e
29
- }
30
- )
31
- );
32
- n.displayName = "Textarea";
33
- export {
34
- n as Textarea
35
- };
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface ValuePopoverTextProps {
3
- value?: React.ReactNode;
4
- error?: React.ReactNode | null;
5
- }
6
- export declare const ValuePopoverText: ({ value, error }: ValuePopoverTextProps) => React.JSX.Element;
@@ -1,10 +0,0 @@
1
- import { jsxs as e, jsx as n } from "react/jsx-runtime";
2
- import { Tooltip as t } from "../Tooltip.js";
3
- import { WarningDiamondIcon as a } from "../../icons/src/WarningDiamondIcon.js";
4
- const l = ({ value: r, error: o }) => /* @__PURE__ */ e("span", { children: [
5
- o ? /* @__PURE__ */ n(t, { content: o, className: "", children: /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(a, { className: "mr-1 text-danger" }) }) }) : null,
6
- r
7
- ] });
8
- export {
9
- l as ValuePopoverText
10
- };
@@ -1,14 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface GooglePlaceSuggestion {
3
- place_id: string;
4
- description?: string;
5
- name?: string;
6
- formatted_address?: string;
7
- types?: string[];
8
- }
9
- export interface GooglePlacesAutocompleteProps {
10
- initialValue?: string;
11
- onSelect?: (suggestion: GooglePlaceSuggestion) => void;
12
- apiBaseUrl: string;
13
- }
14
- export declare const GooglePlacesAutocomplete: ({ initialValue, onSelect, apiBaseUrl, }: GooglePlacesAutocompleteProps) => React.JSX.Element;
@@ -1,21 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface HeaderToolbarProps {
3
- classNames?: string;
4
- children: React.ReactNode;
5
- }
6
- export declare const HeaderToolbar: {
7
- ({ classNames, children }: HeaderToolbarProps): React.JSX.Element;
8
- Breadcrumb: {
9
- ({ children, className }: HeaderToolbarBreadcrumbProps): React.JSX.Element;
10
- displayName: string;
11
- };
12
- Search: {
13
- (props: any): React.JSX.Element;
14
- displayName: string;
15
- };
16
- };
17
- interface HeaderToolbarBreadcrumbProps {
18
- children: React.ReactNode;
19
- className?: string;
20
- }
21
- export type { HeaderToolbarBreadcrumbProps };
@@ -1,33 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import o from "clsx";
3
- import { Search as c } from "./Search.js";
4
- import { Breadcrumb as d } from "./Breadcrumb.js";
5
- const l = ({ classNames: r, children: e }) => /* @__PURE__ */ a(
6
- "div",
7
- {
8
- className: o(
9
- "ui-header-toolbar",
10
- "flex w-full items-center space-x-2 border-b border-gray-light px-5 py-3 pr-3 xl:space-x-6 xl:px-10 xl:py-5",
11
- r
12
- ),
13
- children: e
14
- }
15
- ), m = ({ children: r, className: e }) => /* @__PURE__ */ a(
16
- d,
17
- {
18
- className: o(
19
- "ui-header-toolbar-breadcrumb",
20
- "border-r border-gray-light text-xl md:pr-4 xl:pr-6",
21
- e
22
- ),
23
- children: r
24
- }
25
- );
26
- m.displayName = "HeaderToolbar.Breadcrumb";
27
- const t = (r) => /* @__PURE__ */ a(c, { className: "ui-header-toolbar-search w-full flex-grow pr-1", ...r });
28
- t.displayName = "HeaderToolbar.Search";
29
- l.Breadcrumb = m;
30
- l.Search = t;
31
- export {
32
- l as HeaderToolbar
33
- };
@@ -1,17 +0,0 @@
1
- import { default as React } from 'react';
2
- type LogoSize = "small" | "medium" | "large";
3
- export interface ImageUploadProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size" | "onError"> {
4
- src?: string;
5
- size?: LogoSize;
6
- isLoading?: boolean;
7
- maxSize?: number;
8
- hasDelete?: boolean;
9
- requirements?: React.ReactNode | string | null;
10
- caption?: string | null;
11
- csvAcceptFormats?: string;
12
- onChange: (file: File) => void;
13
- onDelete: () => void;
14
- onError: (message: string) => void;
15
- }
16
- export declare const ImageUpload: ({ src, size, isLoading, maxSize, hasDelete, requirements, caption, csvAcceptFormats, onChange, onDelete, onError, ...props }: ImageUploadProps) => React.JSX.Element;
17
- export {};
@@ -1,86 +0,0 @@
1
- import { jsxs as c, jsx as e, Fragment as B } from "react/jsx-runtime";
2
- import g from "clsx";
3
- import { useRef as R, useState as U } from "react";
4
- import { Button as w } from "./Buttons/Button.js";
5
- import { SubmitButton as u } from "./Buttons/SubmitButton.js";
6
- import { Logo as x } from "./Logo.js";
7
- import { ImageIcon as G } from "../icons/src/ImageIcon.js";
8
- import { TrashIcon as K } from "../icons/src/TrashIcon.js";
9
- const H = ({
10
- src: a,
11
- size: s = "large",
12
- isLoading: l = !1,
13
- maxSize: o = 5,
14
- hasDelete: d = !0,
15
- requirements: t = null,
16
- caption: r = null,
17
- csvAcceptFormats: y = "image/png,image/jpeg",
18
- onChange: N,
19
- onDelete: v,
20
- onError: C,
21
- ...b
22
- }) => {
23
- const h = R(null), [m, k] = U(0), p = () => {
24
- var n;
25
- (n = h.current) == null || n.click();
26
- }, I = (n) => {
27
- const [i] = n.target.files ?? [];
28
- if (i) {
29
- if (o && 1048576 * o < i.size) {
30
- C(`Image size shouldn't exceed ${o}MB`);
31
- return;
32
- }
33
- N(i);
34
- }
35
- }, P = () => {
36
- k(m + 1), v();
37
- }, j = typeof t == "string" ? (t == null ? void 0 : t.trim().length) > 0 : !!t, f = r ? r.trim().length > 0 : !1;
38
- return /* @__PURE__ */ c("div", { className: g("flex items-center rounded bg-gray-lighter p-4", d ? "space-x-2" : "space-x-3"), children: [
39
- /* @__PURE__ */ e("div", { children: a ? /* @__PURE__ */ e(x, { src: a, size: s }) : /* @__PURE__ */ e(
40
- "div",
41
- {
42
- className: g(
43
- x.sizes[s],
44
- "flex items-center justify-center rounded border border-gray-light"
45
- ),
46
- children: /* @__PURE__ */ e(G, { size: "large", className: "text-gray" })
47
- }
48
- ) }),
49
- /* @__PURE__ */ c("div", { className: "flex flex-col space-y-2", children: [
50
- /* @__PURE__ */ e("div", { className: "space-x-2", children: d ? /* @__PURE__ */ c(B, { children: [
51
- /* @__PURE__ */ e(
52
- w,
53
- {
54
- variant: "outline",
55
- color: "secondary",
56
- icon: /* @__PURE__ */ e(K, {}),
57
- disabled: l,
58
- onClick: P,
59
- children: "Delete"
60
- }
61
- ),
62
- /* @__PURE__ */ e(u, { disabled: l, isLoading: l, onClick: p, children: f ? r.trim() : "Upload New Photo" })
63
- ] }) : /* @__PURE__ */ e(u, { disabled: l, isLoading: l, onClick: p, children: f ? r.trim() : a ? "Replace Photo" : "Upload New Photo" }) }),
64
- /* @__PURE__ */ e(
65
- "input",
66
- {
67
- ref: h,
68
- className: "hidden",
69
- type: "file",
70
- multiple: !1,
71
- accept: y,
72
- onChange: I,
73
- ...b
74
- },
75
- m
76
- ),
77
- /* @__PURE__ */ e("div", { className: "text-xs text-gray-darker", children: j ? t : /* @__PURE__ */ c("div", { children: [
78
- "Check that the image is in PNG or JPG format",
79
- o ? ` and does not exceed ${o}MB` : ""
80
- ] }) })
81
- ] })
82
- ] });
83
- };
84
- export {
85
- H as ImageUpload
86
- };
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface KeyProps extends React.HTMLAttributes<HTMLDivElement> {
3
- char: string;
4
- className?: string;
5
- }
6
- export declare const Key: ({ char, className, ...rest }: KeyProps) => React.JSX.Element;
@@ -1,28 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import l from "clsx";
3
- import { isOSX as t } from "../helpers/browser.js";
4
- const s = {
5
- cmd: t ? "⌘" : "ctrl",
6
- option: t ? "⌥" : "win",
7
- ctrl: "ctrl",
8
- up: "↑",
9
- down: "↓"
10
- }, x = ({ char: e, className: n, ...o }) => {
11
- const r = s[e] ?? e;
12
- return /* @__PURE__ */ i(
13
- "div",
14
- {
15
- className: l(
16
- "ui-key",
17
- "no-translate inline-flex h-5 items-center justify-center rounded bg-gray-lighter px-2 py-1 text-xs font-semibold text-gray",
18
- r.length === 1 && "w-5",
19
- n
20
- ),
21
- ...o,
22
- children: r
23
- }
24
- );
25
- };
26
- export {
27
- x as Key
28
- };
@@ -1,19 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const sizes: {
3
- readonly small: "w-10 h-10";
4
- readonly medium: "w-16 h-16";
5
- readonly large: "w-20 h-20";
6
- };
7
- type LogoSize = keyof typeof sizes;
8
- export interface LogoProps extends React.ImgHTMLAttributes<HTMLImageElement> {
9
- size?: LogoSize;
10
- className?: string;
11
- }
12
- export declare const Logo: (({ size, className, ...rest }: LogoProps) => React.JSX.Element) & {
13
- sizes: {
14
- readonly small: "w-10 h-10";
15
- readonly medium: "w-16 h-16";
16
- readonly large: "w-20 h-20";
17
- };
18
- };
19
- export {};