@xola/ui-kit 3.0.8 → 3.4.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 (217) hide show
  1. package/README.md +61 -12
  2. package/build/components/Alert.d.ts +18 -0
  3. package/build/components/Alert.js +28 -0
  4. package/build/components/Animation/FadeIn.d.ts +13 -0
  5. package/build/components/Animation/FadeIn.js +29 -0
  6. package/build/components/Animation/SlideDown.d.ts +6 -0
  7. package/build/components/Animation/SlideDown.js +20 -0
  8. package/build/components/Avatar.d.ts +16 -0
  9. package/build/components/Avatar.js +21 -0
  10. package/build/components/Badge.d.ts +27 -0
  11. package/build/components/Badge.js +40 -0
  12. package/build/components/Breadcrumb.d.ts +21 -0
  13. package/build/components/Breadcrumb.js +27 -0
  14. package/build/components/Breakdown.d.ts +63 -0
  15. package/build/components/Breakdown.js +89 -0
  16. package/build/components/Buttons/Button.d.ts +53 -0
  17. package/build/components/Buttons/Button.js +83 -0
  18. package/build/components/Buttons/ButtonGroup.d.ts +35 -0
  19. package/build/components/Buttons/ButtonGroup.js +55 -0
  20. package/build/components/Buttons/SubmitButton.d.ts +11 -0
  21. package/build/components/Buttons/SubmitButton.js +83 -0
  22. package/build/components/Buttons/ToggleButton.d.ts +21 -0
  23. package/build/components/Buttons/ToggleButton.js +34 -0
  24. package/build/components/Charts/BaseChartOptions.d.ts +136 -0
  25. package/build/components/Charts/BaseChartOptions.js +95 -0
  26. package/build/components/Charts/HistogramOptions.d.ts +192 -0
  27. package/build/components/Charts/HistogramOptions.js +69 -0
  28. package/build/components/Charts/PieOptions.d.ts +177 -0
  29. package/build/components/Charts/PieOptions.js +55 -0
  30. package/build/components/Counter.d.ts +5 -0
  31. package/build/components/Counter.js +16 -0
  32. package/build/components/DatePicker/DatePicker.d.ts +41 -0
  33. package/build/components/DatePicker/DatePicker.helpers.d.ts +17 -0
  34. package/build/components/DatePicker/DatePicker.helpers.js +22 -0
  35. package/build/components/DatePicker/DatePicker.js +241 -0
  36. package/build/components/DatePicker/DatePickerPopover.d.ts +29 -0
  37. package/build/components/DatePicker/DatePickerPopover.js +81 -0
  38. package/build/components/DatePicker/Day.d.ts +13 -0
  39. package/build/components/DatePicker/Day.js +40 -0
  40. package/build/components/DatePicker/LocalizedDayPicker.d.ts +6 -0
  41. package/build/components/DatePicker/LocalizedDayPicker.js +20 -0
  42. package/build/components/DatePicker/MonthGrid.d.ts +11 -0
  43. package/build/components/DatePicker/MonthGrid.js +52 -0
  44. package/build/components/DatePicker/MonthPicker.d.ts +7 -0
  45. package/build/components/DatePicker/MonthPicker.js +28 -0
  46. package/build/components/DatePicker/MonthSelector.d.ts +8 -0
  47. package/build/components/DatePicker/MonthSelector.js +47 -0
  48. package/build/components/DatePicker/MonthYearSelector.d.ts +8 -0
  49. package/build/components/DatePicker/MonthYearSelector.js +44 -0
  50. package/build/components/DatePicker/NavbarElement.d.ts +15 -0
  51. package/build/components/DatePicker/NavbarElement.js +43 -0
  52. package/build/components/DatePicker/RangeDatePicker.d.ts +25 -0
  53. package/build/components/DatePicker/RangeDatePicker.js +134 -0
  54. package/build/components/DatePicker/RelativeDateRange.d.ts +51 -0
  55. package/build/components/DatePicker/RelativeDateRange.js +280 -0
  56. package/build/components/DatePicker/UpcomingDatePicker.d.ts +11 -0
  57. package/build/components/DatePicker/UpcomingDatePicker.js +27 -0
  58. package/build/components/Dot/Dot.d.ts +24 -0
  59. package/build/components/Dot/Dot.js +24 -0
  60. package/build/components/Dot/DotProgress.d.ts +6 -0
  61. package/build/components/Dot/DotProgress.js +10 -0
  62. package/build/components/Drawer.d.ts +28 -0
  63. package/build/components/Drawer.js +126 -0
  64. package/build/components/Forms/BaseInput.d.ts +20 -0
  65. package/build/components/Forms/BaseInput.js +41 -0
  66. package/build/components/Forms/Checkbox.d.ts +10 -0
  67. package/build/components/Forms/Checkbox.js +34 -0
  68. package/build/components/Forms/Checkbox.module.css.js +7 -0
  69. package/build/components/Forms/ComboBox.d.ts +8 -0
  70. package/build/components/Forms/ComboBox.js +41 -0
  71. package/build/components/Forms/FormGroup.d.ts +5 -0
  72. package/build/components/Forms/FormGroup.js +6 -0
  73. package/build/components/Forms/InlineValuePopover.d.ts +17 -0
  74. package/build/components/Forms/InlineValuePopover.js +47 -0
  75. package/build/components/Forms/Input.d.ts +6 -0
  76. package/build/components/Forms/Input.js +9 -0
  77. package/build/components/Forms/Label.d.ts +7 -0
  78. package/build/components/Forms/Label.js +17 -0
  79. package/build/components/Forms/RangeSlider.d.ts +33 -0
  80. package/build/components/Forms/RangeSlider.js +39 -0
  81. package/build/components/Forms/Select.d.ts +5 -0
  82. package/build/components/Forms/Select.js +8 -0
  83. package/build/components/Forms/Switch.d.ts +46 -0
  84. package/build/components/Forms/Switch.js +62 -0
  85. package/build/components/Forms/Textarea.d.ts +6 -0
  86. package/build/components/Forms/Textarea.js +35 -0
  87. package/build/components/Forms/ValuePopoverText.d.ts +6 -0
  88. package/build/components/Forms/ValuePopoverText.js +10 -0
  89. package/build/components/GooglePlacesAutocomplete.d.ts +14 -0
  90. package/build/components/HeaderToolbar.d.ts +21 -0
  91. package/build/components/HeaderToolbar.js +33 -0
  92. package/build/components/ImageUpload.d.ts +17 -0
  93. package/build/components/ImageUpload.js +86 -0
  94. package/build/components/Key.d.ts +6 -0
  95. package/build/components/Key.js +28 -0
  96. package/build/components/Logo.d.ts +19 -0
  97. package/build/components/Logo.js +10 -0
  98. package/build/components/Modal.d.ts +52 -0
  99. package/build/components/Modal.js +126 -0
  100. package/build/components/Popover/Popover.d.ts +20 -0
  101. package/build/components/Popover/Popover.js +50 -0
  102. package/build/components/Popover/Popover.module.css.js +7 -0
  103. package/build/components/Popover/PopoverList.d.ts +25 -0
  104. package/build/components/Popover/PopoverList.js +59 -0
  105. package/build/components/Popover/PopoverScroll.module.css.js +4 -0
  106. package/build/components/Provider.d.ts +18 -0
  107. package/build/components/Provider.js +17 -0
  108. package/build/components/Screens/Login.d.ts +25 -0
  109. package/build/components/Screens/Login.js +144 -0
  110. package/build/components/Search.d.ts +16 -0
  111. package/build/components/Search.js +174 -0
  112. package/build/components/Sidebar/Sidebar.Account.d.ts +13 -0
  113. package/build/components/Sidebar/Sidebar.Account.js +56 -0
  114. package/build/components/Sidebar/Sidebar.Button.d.ts +10 -0
  115. package/build/components/Sidebar/Sidebar.Button.js +21 -0
  116. package/build/components/Sidebar/Sidebar.Footer.d.ts +8 -0
  117. package/build/components/Sidebar/Sidebar.Footer.js +9 -0
  118. package/build/components/Sidebar/Sidebar.Heading.d.ts +10 -0
  119. package/build/components/Sidebar/Sidebar.Heading.js +10 -0
  120. package/build/components/Sidebar/Sidebar.Link.d.ts +24 -0
  121. package/build/components/Sidebar/Sidebar.Link.js +56 -0
  122. package/build/components/Sidebar/Sidebar.Menu.d.ts +10 -0
  123. package/build/components/Sidebar/Sidebar.Menu.js +28 -0
  124. package/build/components/Sidebar/Sidebar.Menu.module.css.js +7 -0
  125. package/build/components/Sidebar/Sidebar.d.ts +58 -0
  126. package/build/components/Sidebar/Sidebar.js +218 -0
  127. package/build/components/Sidebar/SidebarScroll.module.css.js +4 -0
  128. package/build/components/Sidebar/index.d.ts +8 -0
  129. package/build/components/Skeleton.d.ts +13 -0
  130. package/build/components/Skeleton.js +29 -0
  131. package/build/components/Skeleton.module.css.js +7 -0
  132. package/build/components/Spinner.d.ts +26 -0
  133. package/build/components/Spinner.js +27 -0
  134. package/build/components/Table.d.ts +59 -0
  135. package/build/components/Table.js +71 -0
  136. package/build/components/Tabs/Tabs.Panel.d.ts +9 -0
  137. package/build/components/Tabs/Tabs.Panel.js +7 -0
  138. package/build/components/Tabs/Tabs.Tab.d.ts +19 -0
  139. package/build/components/Tabs/Tabs.Tab.js +37 -0
  140. package/build/components/Tabs/Tabs.d.ts +27 -0
  141. package/build/components/Tabs/Tabs.js +28 -0
  142. package/build/components/Tabs/index.d.ts +4 -0
  143. package/build/components/Tag.d.ts +25 -0
  144. package/build/components/Tag.js +36 -0
  145. package/build/components/Tooltip.d.ts +8 -0
  146. package/build/components/Tooltip.js +8 -0
  147. package/build/components/Utilities/Currency.d.ts +32 -0
  148. package/build/components/Utilities/Currency.js +49 -0
  149. package/build/components/Utilities/Number.d.ts +8 -0
  150. package/build/components/Utilities/Number.js +15 -0
  151. package/build/components/Utilities/Phone.d.ts +8 -0
  152. package/build/components/Utilities/Phone.js +19 -0
  153. package/build/helpers/avatar.d.ts +1 -0
  154. package/build/helpers/avatar.js +8 -0
  155. package/build/helpers/browser.d.ts +2 -0
  156. package/build/helpers/browser.js +9 -0
  157. package/build/helpers/children.d.ts +3 -0
  158. package/build/helpers/children.js +6 -0
  159. package/build/helpers/classnames.d.ts +5 -0
  160. package/build/helpers/currency.d.ts +2 -0
  161. package/build/helpers/currency.js +11 -0
  162. package/build/helpers/date.d.ts +12 -0
  163. package/build/helpers/date.js +44 -0
  164. package/build/helpers/flash.d.ts +21 -0
  165. package/build/helpers/flash.js +87 -0
  166. package/build/helpers/numbers.d.ts +4 -0
  167. package/build/helpers/numbers.js +23 -0
  168. package/build/helpers/phone.d.ts +11 -0
  169. package/build/helpers/phone.js +25 -0
  170. package/build/hooks/useId.d.ts +1 -0
  171. package/build/hooks/useId.js +9 -0
  172. package/build/hooks/useIsClient.d.ts +1 -0
  173. package/build/hooks/useIsClient.js +10 -0
  174. package/build/hooks/useViewportHeight.d.ts +1 -0
  175. package/build/hooks/useViewportHeight.js +15 -0
  176. package/build/icons/build/AnnounceIcon.js +6 -0
  177. package/build/icons/build/BellIcon.js +23 -0
  178. package/build/icons/build/CalendarIcon.js +15 -0
  179. package/build/icons/build/CheckIcon.js +7 -0
  180. package/build/icons/build/ChevronDownIcon.js +7 -0
  181. package/build/icons/build/ChevronLeftIcon.js +7 -0
  182. package/build/icons/build/ChevronRightIcon.js +7 -0
  183. package/build/icons/build/CircleNotch.js +5 -0
  184. package/build/icons/build/CloseIcon.js +7 -0
  185. package/build/icons/build/DownArrowIcon.js +15 -0
  186. package/build/icons/build/ImageIcon.js +23 -0
  187. package/build/icons/build/SearchIcon.js +15 -0
  188. package/build/icons/build/TrashIcon.js +16 -0
  189. package/build/icons/build/WarningDiamondIcon.js +23 -0
  190. package/build/icons/build/helpers/classnames.js +8 -0
  191. package/build/icons/build/helpers/icon.js +10 -0
  192. package/build/icons/build/helpers/iconSizes.js +13 -0
  193. package/build/icons/build/images/XolaLogoSimple.js +13 -0
  194. package/build/index.d.ts +66 -0
  195. package/build/index.js +142 -0
  196. package/build/theme.d.ts +413 -0
  197. package/build/theme.js +372 -0
  198. package/build/types/index.d.ts +22 -0
  199. package/build/types/migration.d.ts +2 -0
  200. package/build/ui-kit.css +1 -0
  201. package/build/utils/avatar.d.ts +1 -0
  202. package/build/utils/avatar.js +8 -0
  203. package/build/utils/currency.d.ts +2 -0
  204. package/build/utils/currency.js +11 -0
  205. package/build/utils/date.d.ts +12 -0
  206. package/build/utils/date.js +23 -0
  207. package/build/utils/index.d.ts +5 -0
  208. package/build/utils/numbers.d.ts +4 -0
  209. package/build/utils/numbers.js +19 -0
  210. package/build/utils/phone.d.ts +2 -0
  211. package/build/utils/phone.js +17 -0
  212. package/package.json +76 -49
  213. package/postcss.config.js +1 -1
  214. package/tailwind.config.js +28 -8
  215. package/build/style.css +0 -1
  216. package/build/ui-kit.es.js +0 -12173
  217. package/index.d.ts +0 -72
@@ -0,0 +1,83 @@
1
+ import { jsxs as u, jsx as n } from "react/jsx-runtime";
2
+ import h from "clsx";
3
+ const m = {
4
+ standard: {
5
+ common: "border-transparent text-white",
6
+ // Common classes for each style
7
+ primary: "bg-primary hover:bg-primary-darker disabled:bg-primary active:bg-primary",
8
+ secondary: "bg-secondary text-white hover:bg-secondary-dark disabled:bg-secondary border-transparent active:bg-secondary",
9
+ success: "bg-success hover:bg-success-dark disabled:bg-success active:bg-success",
10
+ warning: "bg-warning hover:bg-warning-dark disabled:bg-warning active:bg-warning",
11
+ caution: "bg-caution hover:bg-caution-dark disabled:bg-caution active:bg-caution",
12
+ danger: "bg-danger hover:bg-danger-dark disabled:bg-danger active:bg-danger"
13
+ },
14
+ outline: {
15
+ common: "bg-white border hover:bg-white active:text-white",
16
+ // Common classes for each style
17
+ default: "border-gray-light hover:border-gray-dark active:bg-primary-lighter active:text-black active:border-primary",
18
+ primary: "text-primary border-primary hover:text-primary-dark hover:border-primary-dark active:bg-primary-light",
19
+ secondary: "border-gray-light hover:border-gray-dark active:bg-primary-lighter active:text-black active:border-primary",
20
+ success: "text-success border-success hover:text-success-dark hover:border-success-dark active:bg-success-light",
21
+ warning: "text-warning border-warning hover:text-warning-dark hover:border-warning-dark active:bg-warning-light",
22
+ caution: "text-caution border-caution hover:text-caution-dark hover:border-caution-dark active:bg-caution-light",
23
+ danger: "text-danger border-danger hover:text-danger-dark hover:border-danger-dark active:bg-danger-light"
24
+ },
25
+ link: {
26
+ common: "border-transparent hover:underline",
27
+ primary: "text-primary",
28
+ secondary: "text-secondary",
29
+ success: "text-success",
30
+ warning: "text-warning",
31
+ caution: "text-caution",
32
+ danger: "text-danger"
33
+ }
34
+ }, y = {
35
+ tiny: "px-2 py-0.5 text-xs leading-xs",
36
+ // 20px
37
+ small: "px-3 py-2 h-7.5 text-sm leading-sm",
38
+ // 30px
39
+ medium: "px-4.5 py-3 h-10 text-base leading-base",
40
+ // 40px
41
+ large: "px-6 py-4 h-[50px] text-md leading-md"
42
+ // 50px
43
+ }, x = ({
44
+ as: s,
45
+ variant: o = "standard",
46
+ color: a = "primary",
47
+ size: d = "medium",
48
+ icon: r,
49
+ iconPlacement: t = "left",
50
+ children: i,
51
+ className: c,
52
+ ...g
53
+ }) => {
54
+ const b = s ?? "button";
55
+ process.env.NODE_ENV !== "production" && r && !i && console.error(
56
+ "UI Kit: You are using an icon without specifying children. If you want to use an icon only specify it as a child instead of prop"
57
+ );
58
+ const e = m[o], l = a in e ? e[a] : e.primary;
59
+ return /* @__PURE__ */ u(
60
+ b,
61
+ {
62
+ className: h(
63
+ "ui-button",
64
+ "inline-flex rounded border transition-colors focus:ring disabled:cursor-default disabled:bg-gray-lighter disabled:text-gray-dark",
65
+ "items-center justify-center font-semibold",
66
+ e.common,
67
+ l,
68
+ y[d],
69
+ c
70
+ ),
71
+ ...g,
72
+ children: [
73
+ r && t === "left" ? /* @__PURE__ */ n("span", { className: "mr-2 flex-shrink-0", children: r }) : null,
74
+ i,
75
+ r && t === "right" ? /* @__PURE__ */ n("span", { className: "ml-2 flex-shrink-0", children: r }) : null
76
+ ]
77
+ }
78
+ );
79
+ };
80
+ export {
81
+ x as Button,
82
+ m as colors
83
+ };
@@ -0,0 +1,35 @@
1
+ import { default as React, ElementType } from 'react';
2
+ declare const sizes: {
3
+ readonly small: "px-2 py-1.5 text-sm";
4
+ readonly medium: "py-3 px-2.5 text-base";
5
+ readonly large: "px-4 py-3.5 text-lg";
6
+ };
7
+ type ButtonGroupSize = keyof typeof sizes;
8
+ type IconPlacement = "left" | "right";
9
+ export interface ButtonGroupProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "onChange"> {
10
+ size: ButtonGroupSize;
11
+ value: number;
12
+ isCollapsed?: boolean;
13
+ children: React.ReactNode;
14
+ className?: string;
15
+ onChange: (index: number) => void;
16
+ }
17
+ export interface ButtonGroupButtonProps {
18
+ as?: ElementType;
19
+ isActive?: boolean;
20
+ shouldShowText?: boolean;
21
+ isHidden?: boolean;
22
+ size?: ButtonGroupSize;
23
+ icon?: React.ReactElement;
24
+ iconPlacement?: IconPlacement;
25
+ children: React.ReactNode;
26
+ className?: string;
27
+ onClick?: () => void;
28
+ }
29
+ export declare const ButtonGroup: (({ size, value, isCollapsed, children, className, onChange, ...rest }: ButtonGroupProps) => React.JSX.Element) & {
30
+ Button: {
31
+ ({ as, isActive, shouldShowText, isHidden, size, icon, iconPlacement, children, className, ...rest }: ButtonGroupButtonProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonGroupButtonProps>): React.JSX.Element;
32
+ displayName: string;
33
+ };
34
+ };
35
+ export {};
@@ -0,0 +1,55 @@
1
+ import { jsx as d, jsxs as g } from "react/jsx-runtime";
2
+ import m from "clsx";
3
+ import x, { Children as h, cloneElement as y } from "react";
4
+ const B = {
5
+ small: "px-2 py-1.5 text-sm",
6
+ medium: "py-3 px-2.5 text-base",
7
+ large: "px-4 py-3.5 text-lg"
8
+ }, k = ({
9
+ size: i,
10
+ value: e,
11
+ isCollapsed: u = !1,
12
+ children: p,
13
+ className: a,
14
+ onChange: t,
15
+ ...n
16
+ }) => /* @__PURE__ */ d("span", { className: m("ui-button-group", "inline-flex whitespace-nowrap", a), ...n, children: h.map(p, (r, o) => {
17
+ if (!x.isValidElement(r) || r.props.isHidden)
18
+ return null;
19
+ const s = { size: i };
20
+ return e !== void 0 && (s.isActive = e === o), u && e >= 0 && e !== o && (s.shouldShowText = !1), t && (s.onClick = () => t(o)), y(r, s);
21
+ }) }), f = ({
22
+ as: i,
23
+ isActive: e,
24
+ shouldShowText: u = !0,
25
+ /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
26
+ isHidden: p = !1,
27
+ size: a = "medium",
28
+ icon: t,
29
+ iconPlacement: n = "left",
30
+ children: r,
31
+ className: o,
32
+ ...s
33
+ }) => {
34
+ const c = i ?? "button", l = { ...s };
35
+ delete l.isActive, delete l.shouldShowText, delete l.isHidden;
36
+ const b = m(
37
+ "ui-button-group-button",
38
+ "inline-flex border-t border-l border-b last:border-r first:rounded-l-md last:rounded-r-md transition-colors focus:ring disabled:opacity-60 focus:z-10 leading-none",
39
+ B[a],
40
+ e ? "bg-primary border-primary text-white hover:bg-primary-dark" : "border-gray-light hover:bg-gray-lighter text-gray-darker",
41
+ o
42
+ );
43
+ return /* @__PURE__ */ g(c, { className: b, ...l, children: [
44
+ t && n === "left" ? /* @__PURE__ */ d("span", { className: "mr-2 flex-shrink-0", children: t }) : null,
45
+ u ? r : t ? null : r,
46
+ t && n === "right" ? /* @__PURE__ */ d("span", { className: "ml-2 flex-shrink-0", children: t }) : null
47
+ ] });
48
+ };
49
+ f.displayName = "ButtonGroup.Button";
50
+ const j = Object.assign(k, {
51
+ Button: f
52
+ });
53
+ export {
54
+ j as ButtonGroup
55
+ };
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { colors, ButtonProps } from './Button';
3
+ type ButtonVariant = keyof typeof colors;
4
+ export interface SubmitButtonProps extends Omit<ButtonProps, "icon" | "iconPlacement">, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonProps> {
5
+ isLoading?: boolean;
6
+ isSuccess?: boolean;
7
+ disabled?: boolean;
8
+ variant?: ButtonVariant;
9
+ }
10
+ export declare const SubmitButton: ({ color, variant, isLoading, isSuccess, disabled, children, className, ...rest }: SubmitButtonProps) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1,83 @@
1
+ import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
+ import { Transition as g } from "@headlessui/react";
3
+ import o from "clsx";
4
+ import { useState as y, useEffect as b } from "react";
5
+ import { CheckIcon as d } from "../../icons/build/CheckIcon.js";
6
+ import { Spinner as x } from "../Spinner.js";
7
+ import { Button as w } from "./Button.js";
8
+ const N = {
9
+ primary: "!bg-primary-light",
10
+ secondary: "!bg-secondary-light",
11
+ success: "!bg-success-light",
12
+ warning: "!bg-warning-light",
13
+ caution: "!bg-caution-light",
14
+ danger: "!bg-danger-light"
15
+ }, C = ({
16
+ color: i = "primary",
17
+ variant: n = "standard",
18
+ isLoading: e,
19
+ isSuccess: c,
20
+ disabled: m = !1,
21
+ children: p,
22
+ className: u,
23
+ ...f
24
+ }) => {
25
+ const [r, a] = y(!1);
26
+ b(() => {
27
+ if (c && !e) {
28
+ a(!0);
29
+ const h = setTimeout(() => a(!1), 3e3);
30
+ return () => clearTimeout(h);
31
+ }
32
+ e && r && a(!1);
33
+ }, [c, e]);
34
+ const t = !!e || r;
35
+ return /* @__PURE__ */ l(
36
+ w,
37
+ {
38
+ color: i,
39
+ variant: n,
40
+ disabled: t || m,
41
+ className: o(u, "relative", t && N[i]),
42
+ ...f,
43
+ children: [
44
+ /* @__PURE__ */ s(
45
+ "span",
46
+ {
47
+ className: o(
48
+ "absolute inset-0 flex items-center justify-center",
49
+ t ? "opacity-100" : "opacity-0"
50
+ ),
51
+ children: t && /* @__PURE__ */ l(
52
+ g,
53
+ {
54
+ appear: !0,
55
+ as: "span",
56
+ show: t,
57
+ enter: "transition-all duration-700",
58
+ enterFrom: "opacity-0",
59
+ enterTo: "opacity-100",
60
+ children: [
61
+ r && /* @__PURE__ */ s(
62
+ d,
63
+ {
64
+ size: "medium",
65
+ className: o("relative -top-0.25 text-white", {
66
+ "text-black": n === "outline"
67
+ })
68
+ }
69
+ ),
70
+ e && !r && /* @__PURE__ */ s(x, { size: "current", color: "current", className: "relative -top-0.25 text-white" })
71
+ ]
72
+ }
73
+ )
74
+ }
75
+ ),
76
+ /* @__PURE__ */ s("span", { className: o(t ? "flex-shrink flex-grow opacity-0" : "opacity-100"), children: p })
77
+ ]
78
+ }
79
+ );
80
+ };
81
+ export {
82
+ C as SubmitButton
83
+ };
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ import { ButtonProps } from './Button';
3
+ declare const colors: {
4
+ readonly outline: {
5
+ readonly primary: "bg-primary-lighter border border-primary hover:bg-primary-light hover:border-primary-dark";
6
+ readonly secondary: "bg-secondary-light border border-secondary-light hover:bg-secondary-light hover:border-secondary";
7
+ readonly success: "bg-success-lightish border border-success hover:bg-success-light hover:border-success-dark";
8
+ readonly warning: "bg-warning-lightish border border-warning hover:bg-warning-light hover:border-warning-dark";
9
+ readonly caution: "bg-caution-lightish border border-caution hover:bg-caution-light hover:border-caution-dark";
10
+ readonly danger: "bg-danger-lightish border border-danger hover:bg-danger-light hover:border-danger-dark";
11
+ };
12
+ };
13
+ type ToggleVariant = keyof typeof colors;
14
+ type ToggleColor = keyof typeof colors.outline;
15
+ export interface ToggleButtonProps extends Omit<ButtonProps, "variant" | "color"> {
16
+ color?: ToggleColor;
17
+ variant?: ToggleVariant;
18
+ isActive: boolean;
19
+ }
20
+ export declare const ToggleButton: ({ color, variant, isActive, className, ...rest }: ToggleButtonProps) => React.JSX.Element;
21
+ export {};
@@ -0,0 +1,34 @@
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import d from "clsx";
3
+ import { Button as t } from "./Button.js";
4
+ const h = {
5
+ outline: {
6
+ primary: "bg-primary-lighter border border-primary hover:bg-primary-light hover:border-primary-dark",
7
+ secondary: "bg-secondary-light border border-secondary-light hover:bg-secondary-light hover:border-secondary",
8
+ success: "bg-success-lightish border border-success hover:bg-success-light hover:border-success-dark",
9
+ warning: "bg-warning-lightish border border-warning hover:bg-warning-light hover:border-warning-dark",
10
+ caution: "bg-caution-lightish border border-caution hover:bg-caution-light hover:border-caution-dark",
11
+ danger: "bg-danger-lightish border border-danger hover:bg-danger-light hover:border-danger-dark"
12
+ }
13
+ }, c = ({
14
+ color: r = "primary",
15
+ variant: e = "outline",
16
+ isActive: o,
17
+ className: g,
18
+ ...i
19
+ }) => /* @__PURE__ */ b(
20
+ t,
21
+ {
22
+ color: r,
23
+ variant: e,
24
+ className: d(
25
+ "text-black",
26
+ g,
27
+ o ? h[e][r] : `bg-white hover:bg-${r}-lighter hover:border-${r}`
28
+ ),
29
+ ...i
30
+ }
31
+ );
32
+ export {
33
+ c as ToggleButton
34
+ };
@@ -0,0 +1,136 @@
1
+ /**
2
+ * This view sets up a Chart. A 'Chart' is anything Highcharts can render (graphs, pies, donuts etc)
3
+ * This is the master file of defaults for Xola's charts. Colors, sizes, dimensions etc.
4
+ */
5
+ export declare const BaseChartOptions: {
6
+ global: {
7
+ useUTC: boolean;
8
+ };
9
+ chart: {
10
+ spacingLeft: number;
11
+ };
12
+ colors: (string | {
13
+ lighter: string;
14
+ light: string;
15
+ DEFAULT: string;
16
+ dark: string;
17
+ darker: string;
18
+ })[];
19
+ xAxis: {
20
+ title: {
21
+ style: {
22
+ color: string;
23
+ fontSize: string;
24
+ fontWeight: number;
25
+ cursor: string;
26
+ textOverflow: string;
27
+ fontFamily: string[];
28
+ } & {
29
+ color: string;
30
+ };
31
+ };
32
+ labels: {
33
+ style: {
34
+ color: string;
35
+ fontSize: string;
36
+ fontWeight: number;
37
+ cursor: string;
38
+ textOverflow: string;
39
+ fontFamily: string[];
40
+ };
41
+ };
42
+ };
43
+ yAxis: {
44
+ title: {
45
+ style: {
46
+ color: string;
47
+ fontSize: string;
48
+ fontWeight: number;
49
+ cursor: string;
50
+ textOverflow: string;
51
+ fontFamily: string[];
52
+ } & {
53
+ color: string;
54
+ };
55
+ };
56
+ labels: {
57
+ style: {
58
+ color: string;
59
+ fontSize: string;
60
+ fontWeight: number;
61
+ cursor: string;
62
+ textOverflow: string;
63
+ fontFamily: string[];
64
+ };
65
+ };
66
+ };
67
+ tooltip: {
68
+ enabled: boolean;
69
+ backgroundColor: string;
70
+ borderColor: string;
71
+ borderRadius: number;
72
+ borderWidth: number;
73
+ valueDecimals: number;
74
+ crosshairs: boolean[];
75
+ shadow: boolean;
76
+ useHTML: boolean;
77
+ style: {
78
+ color: string;
79
+ fontSize: string;
80
+ fontWeight: number;
81
+ cursor: string;
82
+ textOverflow: string;
83
+ fontFamily: string[];
84
+ } & {
85
+ opacity: number;
86
+ color: string;
87
+ };
88
+ };
89
+ title: {
90
+ text: string;
91
+ style: {
92
+ color: string;
93
+ fontSize: string;
94
+ fontWeight: number;
95
+ cursor: string;
96
+ textOverflow: string;
97
+ fontFamily: string[];
98
+ } & {
99
+ color: string;
100
+ fontSize: string;
101
+ fontWeight: number;
102
+ };
103
+ };
104
+ plotOptions: {
105
+ series: {
106
+ marker: {
107
+ enabled: boolean;
108
+ states: {
109
+ hover: {
110
+ enabled: boolean;
111
+ lineWidth: number;
112
+ radius: number;
113
+ };
114
+ };
115
+ };
116
+ };
117
+ };
118
+ legend: {
119
+ enabled: boolean;
120
+ itemStyle: {
121
+ color: string;
122
+ fontSize: string;
123
+ fontWeight: number;
124
+ cursor: string;
125
+ textOverflow: string;
126
+ fontFamily: string[];
127
+ };
128
+ itemMarginBottom: number;
129
+ align: string;
130
+ layout: string;
131
+ borderWidth: number;
132
+ };
133
+ credits: {
134
+ enabled: boolean;
135
+ };
136
+ };
@@ -0,0 +1,95 @@
1
+ import { merge as t } from "lodash-es";
2
+ import { theme as o } from "../../theme.js";
3
+ const { colors: e } = o, r = {
4
+ color: e.gray.darker,
5
+ fontSize: o.fontSize.sm,
6
+ // 12px
7
+ fontWeight: 400,
8
+ cursor: "pointer",
9
+ textOverflow: "ellipsis",
10
+ fontFamily: o.extend.fontFamily.sans
11
+ }, s = {
12
+ global: {
13
+ useUTC: !1
14
+ },
15
+ chart: {
16
+ spacingLeft: 0
17
+ },
18
+ colors: [
19
+ e.primary,
20
+ e.success,
21
+ e.warning,
22
+ e.caution,
23
+ e.danger,
24
+ e.blue.darker,
25
+ e.green.darker,
26
+ e.red.darker,
27
+ e.yellow.darker,
28
+ e.orange.darker
29
+ ],
30
+ xAxis: {
31
+ title: { style: t({}, r, { color: e.black }) },
32
+ labels: { style: r }
33
+ },
34
+ yAxis: {
35
+ title: { style: t({}, r, { color: e.black }) },
36
+ labels: { style: r }
37
+ },
38
+ tooltip: {
39
+ enabled: !0,
40
+ backgroundColor: e.black,
41
+ borderColor: e.black,
42
+ borderRadius: 4,
43
+ borderWidth: 1,
44
+ valueDecimals: 2,
45
+ crosshairs: [!0, !0],
46
+ // Show crosshairs when you browse over the toolips
47
+ shadow: !1,
48
+ useHTML: !0,
49
+ // This is used to insert spans with classes for custom css
50
+ style: t({}, r, {
51
+ opacity: 0.9,
52
+ color: "#cccccc"
53
+ })
54
+ },
55
+ title: {
56
+ text: "",
57
+ // No title by default
58
+ style: t({}, r, { color: e.black, fontSize: "18px", fontWeight: 600 })
59
+ },
60
+ plotOptions: {
61
+ series: {
62
+ // Markers are not shown by default, except when you hover
63
+ marker: {
64
+ enabled: !0,
65
+ states: {
66
+ hover: {
67
+ enabled: !0,
68
+ // Width and radius of the marker when you hover
69
+ lineWidth: 1,
70
+ radius: 4
71
+ }
72
+ }
73
+ }
74
+ }
75
+ },
76
+ legend: {
77
+ enabled: !1,
78
+ // By default legend is disabled
79
+ // The style applied to each item in the legend
80
+ itemStyle: r,
81
+ itemMarginBottom: 5,
82
+ align: "center",
83
+ // Center it in the chart canvas
84
+ layout: "vertical",
85
+ // Legend items are shown as a list
86
+ borderWidth: 0
87
+ },
88
+ credits: {
89
+ // Don't show the 'Powered by Highcharts' text
90
+ enabled: !1
91
+ }
92
+ };
93
+ export {
94
+ s as BaseChartOptions
95
+ };