@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,21 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import n from "clsx";
3
- import { getInitials as m } from "../helpers/avatar.js";
4
- const o = {
5
- tiny: "h-7 w-7 text-base",
6
- small: "h-10 w-10 text-base",
7
- medium: "h-12 w-12 text-md",
8
- large: "h-15 w-15 text-xl"
9
- }, f = ({ name: t, color: e = "bg-primary-lighter", size: r = "large", className: i, ...l }) => {
10
- const s = n(
11
- "ui-avatar",
12
- "inline-flex items-center justify-center rounded-full text-black leading-none",
13
- o[r],
14
- e,
15
- i
16
- );
17
- return /* @__PURE__ */ a("div", { title: t, className: s, ...l, children: m(t) });
18
- };
19
- export {
20
- f as Avatar
21
- };
@@ -1,28 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const colors: {
3
- readonly primary: "bg-primary-lighter text-primary-dark";
4
- readonly secondary: "bg-secondary-lighter text-black";
5
- readonly success: "bg-success-lightish text-success-darker";
6
- readonly warning: "bg-warning-lightish text-warning-darker";
7
- readonly caution: "bg-caution-lighter text-caution-dark";
8
- readonly danger: "bg-danger-lightish text-danger-dark";
9
- readonly problem: "bg-warning text-white";
10
- readonly critical: "bg-danger text-white";
11
- };
12
- declare const sizes: {
13
- readonly xs: "px-1 py-0.5 h-3 text-xs";
14
- readonly small: "px-2 py-0.75 h-5 text-sm leading-sm";
15
- readonly medium: "px-3 py-1.5 h-7.5 text-base leading-base";
16
- readonly large: "px-3.5 py-0.75 h-10 text-lg leading-lg";
17
- };
18
- type BadgeColor = keyof typeof colors;
19
- type BadgeSize = keyof typeof sizes;
20
- export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
21
- color?: BadgeColor;
22
- size?: BadgeSize;
23
- icon?: React.ReactElement;
24
- children: React.ReactNode;
25
- className?: string;
26
- }
27
- export declare const Badge: ({ color, size, icon, children, className, ...rest }: BadgeProps) => React.JSX.Element;
28
- export {};
@@ -1,42 +0,0 @@
1
- import { jsxs as n } from "react/jsx-runtime";
2
- import r from "clsx";
3
- import { cloneElement as g } from "react";
4
- const c = {
5
- primary: "bg-primary-lighter text-primary-dark",
6
- secondary: "bg-secondary-lighter text-black",
7
- success: "bg-success-lightish text-success-darker",
8
- warning: "bg-warning-lightish text-warning-darker",
9
- caution: "bg-caution-lighter text-caution-dark",
10
- danger: "bg-danger-lightish text-danger-dark",
11
- problem: "bg-warning text-white",
12
- critical: "bg-danger text-white"
13
- }, m = {
14
- xs: "px-1 py-0.5 h-3 text-xs",
15
- small: "px-2 py-0.75 h-5 text-sm leading-sm",
16
- medium: "px-3 py-1.5 h-7.5 text-base leading-base",
17
- large: "px-3.5 py-0.75 h-10 text-lg leading-lg"
18
- }, x = {
19
- xs: "w-2.5 h-2.5",
20
- small: "w-3 h-3",
21
- medium: "w-4 h-4",
22
- large: "w-5 h-5 mr-1.5"
23
- }, p = ({ color: a = "primary", size: e = "small", icon: t, children: s, className: i, ...l }) => /* @__PURE__ */ n(
24
- "span",
25
- {
26
- className: r(
27
- "ui-badge",
28
- "inline-flex items-center whitespace-nowrap rounded-full",
29
- c[a],
30
- m[e],
31
- i
32
- ),
33
- ...l,
34
- children: [
35
- t ? g(t, { className: r("mr-1", x[e]) }) : null,
36
- s
37
- ]
38
- }
39
- );
40
- export {
41
- p as Badge
42
- };
@@ -1,21 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface BreadcrumbProps extends React.HTMLAttributes<HTMLDivElement> {
3
- separator?: string;
4
- children?: React.ReactNode;
5
- classNames?: {
6
- item?: string;
7
- separator?: string;
8
- };
9
- className?: string;
10
- }
11
- export interface BreadcrumbItemProps extends React.HTMLAttributes<HTMLDivElement> {
12
- className?: string;
13
- onClick?: () => void;
14
- children: React.ReactNode;
15
- }
16
- export declare const Breadcrumb: (({ separator, children, classNames, className, ...rest }: BreadcrumbProps) => React.JSX.Element) & {
17
- Item: {
18
- ({ className, onClick, children }: BreadcrumbItemProps): React.JSX.Element;
19
- displayName: string;
20
- };
21
- };
@@ -1,27 +0,0 @@
1
- import { jsx as t, jsxs as p, Fragment as b } from "react/jsx-runtime";
2
- import a from "clsx";
3
- import { Children as s } from "react";
4
- const x = ({ separator: n = "/", children: r, classNames: e = {}, className: o, ...i }) => {
5
- const d = s.count(r) - 1;
6
- return /* @__PURE__ */ t("div", { className: a("ui-breadcrumb", "whitespace-nowrap text-2xl font-semibold", o), ...i, children: s.map(r, (u, l) => {
7
- const m = l >= d;
8
- return /* @__PURE__ */ p(b, { children: [
9
- /* @__PURE__ */ t("span", { className: a(e.item, m ? "text-black" : "text-gray-dark"), children: u }),
10
- m ? null : /* @__PURE__ */ t("span", { className: a(e.separator, "mx-2 text-gray-dark"), children: n })
11
- ] });
12
- }) });
13
- }, c = ({ className: n, onClick: r, children: e }) => /* @__PURE__ */ t(
14
- "div",
15
- {
16
- className: a("ui-breadcrumb-item inline", r && "cursor-pointer hover:underline", n),
17
- onClick: r,
18
- children: e
19
- }
20
- );
21
- c.displayName = "Breadcrumb.Item";
22
- const B = Object.assign(x, {
23
- Item: c
24
- });
25
- export {
26
- B as Breadcrumb
27
- };
@@ -1,63 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const colors: {
3
- readonly default: "text-gray-darker";
4
- readonly black: "text-black";
5
- readonly primary: "text-primary";
6
- readonly secondary: "text-secondary";
7
- readonly warning: "text-warning";
8
- readonly success: "text-success";
9
- readonly danger: "text-danger";
10
- readonly caution: "text-caution";
11
- };
12
- type BreakdownColor = keyof typeof colors;
13
- export interface BreakdownProps extends React.TableHTMLAttributes<HTMLTableElement> {
14
- currency: string;
15
- locale?: string;
16
- children?: React.ReactNode;
17
- className?: string;
18
- }
19
- export interface BreakdownItemProps extends React.HTMLAttributes<HTMLTableRowElement> {
20
- info?: React.ReactNode;
21
- methodIcon?: React.ReactNode;
22
- secondary?: React.ReactNode;
23
- value?: React.ReactNode;
24
- color?: BreakdownColor;
25
- children?: React.ReactNode;
26
- classNames?: {
27
- key?: string;
28
- children?: string;
29
- info?: string;
30
- value?: string;
31
- };
32
- className?: string;
33
- }
34
- export interface BreakdownSubtotalItemProps extends React.HTMLAttributes<HTMLTableRowElement> {
35
- info?: React.ReactNode;
36
- value?: number;
37
- color?: BreakdownColor;
38
- children?: React.ReactNode;
39
- classNames?: {
40
- children?: string;
41
- info?: string;
42
- value?: string;
43
- };
44
- className?: string;
45
- }
46
- export interface BreakdownSeparatorProps extends React.HTMLAttributes<HTMLTableRowElement> {
47
- className?: string;
48
- }
49
- export declare const Breakdown: (({ currency, locale, children, className, ...rest }: BreakdownProps) => React.JSX.Element) & {
50
- Item: {
51
- ({ info, methodIcon, secondary, value, color, children, classNames, className, ...rest }: BreakdownItemProps): React.JSX.Element;
52
- displayName: string;
53
- };
54
- SubtotalItem: {
55
- ({ info, value, color, children, classNames, className, ...rest }: BreakdownSubtotalItemProps): React.JSX.Element;
56
- displayName: string;
57
- };
58
- Separator: {
59
- ({ className, ...rest }: BreakdownSeparatorProps): React.JSX.Element;
60
- displayName: string;
61
- };
62
- };
63
- export {};
@@ -1,89 +0,0 @@
1
- import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
- import r from "clsx";
3
- import { isNumber as f } from "lodash-es";
4
- import { useMemo as S, createContext as v, useContext as h } from "react";
5
- import { Currency as b } from "./Utilities/Currency.js";
6
- const w = {
7
- default: "text-gray-darker",
8
- black: "text-black",
9
- primary: "text-primary",
10
- secondary: "text-secondary",
11
- warning: "text-warning",
12
- success: "text-success",
13
- danger: "text-danger",
14
- caution: "text-caution"
15
- }, u = v(void 0), B = ({ currency: a, locale: t, children: s, className: l, ...c }) => {
16
- const i = S(() => ({ currency: a, locale: t }), [a, t]);
17
- return /* @__PURE__ */ e(u.Provider, { value: i, children: /* @__PURE__ */ e("table", { className: r("ui-breakdown", "w-full", l), ...c, children: /* @__PURE__ */ e("tbody", { children: s }) }) });
18
- }, k = ({
19
- info: a,
20
- methodIcon: t,
21
- secondary: s,
22
- value: l,
23
- color: c = "default",
24
- children: i,
25
- classNames: d = {},
26
- className: o,
27
- ...p
28
- }) => {
29
- const n = h(u), N = n == null ? void 0 : n.currency, g = n == null ? void 0 : n.locale;
30
- return /* @__PURE__ */ m("tr", { className: r("ui-breakdown-item", w[c], o), ...p, children: [
31
- /* @__PURE__ */ m("td", { colSpan: 2, className: r("break-words text-left leading-none", d.key), children: [
32
- /* @__PURE__ */ e("span", { className: "mr-0.5", children: t }),
33
- /* @__PURE__ */ e("span", { className: r("mr-1 break-normal md:break-all", d.children), children: i ?? "" }),
34
- /* @__PURE__ */ m("span", { className: r("text-sm", d.info), children: [
35
- a && /* @__PURE__ */ e("span", { className: "mr-2 rounded bg-white p-1 uppercase text-black empty:hidden", children: a }),
36
- s && /* @__PURE__ */ e("span", { className: "empty:hidden", children: s })
37
- ] })
38
- ] }),
39
- /* @__PURE__ */ e("td", { className: r("w-[1%] whitespace-nowrap pl-4 text-right", d.value), children: f(l) ? /* @__PURE__ */ e(
40
- b,
41
- {
42
- shouldRemoveTrailingZeroes: !1,
43
- currency: N,
44
- locale: g,
45
- compact: void 0,
46
- isNarrowSymbolForm: void 0,
47
- children: l
48
- }
49
- ) : /* @__PURE__ */ e("span", { children: l }) })
50
- ] });
51
- };
52
- k.displayName = "Breakdown.Item";
53
- const y = ({
54
- info: a,
55
- value: t,
56
- color: s = "black",
57
- children: l,
58
- classNames: c = {},
59
- className: i,
60
- ...d
61
- }) => {
62
- const o = h(u), p = o == null ? void 0 : o.currency, n = o == null ? void 0 : o.locale;
63
- return /* @__PURE__ */ m("tr", { className: r("ui-breakdown-subtotal-item", "font-bold", w[s], i), ...d, children: [
64
- /* @__PURE__ */ e("td", { className: r("pb-4 pt-1 text-left", c.children), children: l }),
65
- /* @__PURE__ */ e("td", { className: r("whitespace-nowrap pb-4 pt-1 text-right", c.info), children: a }),
66
- /* @__PURE__ */ e("td", { className: r("w-[1%] whitespace-nowrap pb-4 pl-4 pt-1 text-right", c.value), children: /* @__PURE__ */ e(
67
- b,
68
- {
69
- shouldRemoveTrailingZeroes: !1,
70
- currency: p,
71
- locale: n,
72
- compact: void 0,
73
- isNarrowSymbolForm: void 0,
74
- children: t ?? 0
75
- }
76
- ) })
77
- ] });
78
- };
79
- y.displayName = "Breakdown.SubtotalItem";
80
- const x = ({ className: a, ...t }) => /* @__PURE__ */ e("tr", { className: r("ui-breakdown-separator", a), ...t, children: /* @__PURE__ */ e("td", { colSpan: 3, className: "border-b border-gray-light pb-1" }) });
81
- x.displayName = "Breakdown.Separator";
82
- const T = Object.assign(B, {
83
- Item: k,
84
- SubtotalItem: y,
85
- Separator: x
86
- });
87
- export {
88
- T as Breakdown
89
- };
@@ -1,53 +0,0 @@
1
- import { default as React, ElementType } from 'react';
2
- export declare const colors: {
3
- readonly standard: {
4
- readonly common: "border-transparent text-white";
5
- readonly primary: "bg-primary hover:bg-primary-darker disabled:bg-primary active:bg-primary";
6
- readonly secondary: "bg-secondary text-white hover:bg-secondary-dark disabled:bg-secondary border-transparent active:bg-secondary";
7
- readonly success: "bg-success hover:bg-success-dark disabled:bg-success active:bg-success";
8
- readonly warning: "bg-warning hover:bg-warning-dark disabled:bg-warning active:bg-warning";
9
- readonly caution: "bg-caution hover:bg-caution-dark disabled:bg-caution active:bg-caution";
10
- readonly danger: "bg-danger hover:bg-danger-dark disabled:bg-danger active:bg-danger";
11
- };
12
- readonly outline: {
13
- readonly common: "bg-white border hover:bg-white active:text-white";
14
- readonly default: "border-gray-light hover:border-gray-dark active:bg-primary-lighter active:text-black active:border-primary";
15
- readonly primary: "text-primary border-primary hover:text-primary-dark hover:border-primary-dark active:bg-primary-light";
16
- readonly secondary: "border-gray-light hover:border-gray-dark active:bg-primary-lighter active:text-black active:border-primary";
17
- readonly success: "text-success border-success hover:text-success-dark hover:border-success-dark active:bg-success-light";
18
- readonly warning: "text-warning border-warning hover:text-warning-dark hover:border-warning-dark active:bg-warning-light";
19
- readonly caution: "text-caution border-caution hover:text-caution-dark hover:border-caution-dark active:bg-caution-light";
20
- readonly danger: "text-danger border-danger hover:text-danger-dark hover:border-danger-dark active:bg-danger-light";
21
- };
22
- readonly link: {
23
- readonly common: "border-transparent hover:underline";
24
- readonly primary: "text-primary";
25
- readonly secondary: "text-secondary";
26
- readonly success: "text-success";
27
- readonly warning: "text-warning";
28
- readonly caution: "text-caution";
29
- readonly danger: "text-danger";
30
- };
31
- };
32
- declare const sizes: {
33
- readonly tiny: "px-2 py-0.5 text-xs leading-xs";
34
- readonly small: "px-3 py-2 h-7.5 text-sm leading-sm";
35
- readonly medium: "px-4.5 py-3 h-10 text-base leading-base";
36
- readonly large: "px-6 py-4 h-[50px] text-md leading-md";
37
- };
38
- type ButtonVariant = keyof typeof colors;
39
- type ButtonColor = keyof typeof colors.outline;
40
- type ButtonSize = keyof typeof sizes;
41
- type IconPlacement = "left" | "right";
42
- export interface ButtonProps<T extends ElementType = "button"> {
43
- as?: T;
44
- variant?: ButtonVariant;
45
- color?: ButtonColor;
46
- size?: ButtonSize;
47
- icon?: React.ReactElement;
48
- iconPlacement?: IconPlacement;
49
- children: React.ReactNode;
50
- className?: string;
51
- }
52
- export declare const Button: <T extends ElementType = "button">({ as, variant, color, size, icon, iconPlacement, children, className, ...rest }: ButtonProps<T> & Omit<React.ComponentPropsWithoutRef<T>, keyof ButtonProps<T>>) => React.JSX.Element;
53
- export {};
@@ -1,83 +0,0 @@
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
- };
@@ -1,35 +0,0 @@
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 {};
@@ -1,55 +0,0 @@
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: a = !1,
12
- children: p,
13
- className: u,
14
- onChange: t,
15
- ...n
16
- }) => /* @__PURE__ */ d("span", { className: m("ui-button-group", "inline-flex whitespace-nowrap", u), ...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), a && e >= 0 && e !== o && (s.shouldShowText = !1), t && (s.onClick = () => t(o)), y(r, s);
21
- }) }), c = ({
22
- as: i,
23
- isActive: e,
24
- shouldShowText: a = !0,
25
- /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
26
- isHidden: p = !1,
27
- size: u = "medium",
28
- icon: t,
29
- iconPlacement: n = "left",
30
- children: r,
31
- className: o,
32
- ...s
33
- }) => {
34
- const f = 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[u],
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(f, { className: b, ...l, children: [
44
- t && n === "left" ? /* @__PURE__ */ d("span", { className: "mr-2 flex-shrink-0", children: t }) : null,
45
- a ? r : t ? null : r,
46
- t && n === "right" ? /* @__PURE__ */ d("span", { className: "ml-2 flex-shrink-0", children: t }) : null
47
- ] });
48
- };
49
- c.displayName = "ButtonGroup.Button";
50
- const j = Object.assign(k, {
51
- Button: c
52
- });
53
- export {
54
- j as ButtonGroup
55
- };
@@ -1,11 +0,0 @@
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 {};
@@ -1,83 +0,0 @@
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 { Spinner as d } from "../Spinner.js";
6
- import { Button as x } from "./Button.js";
7
- import { CheckIcon as w } from "../../icons/src/CheckIcon.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
- x,
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
- w,
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(d, { 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
- };
@@ -1,21 +0,0 @@
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 {};