@xola/ui-kit 3.0.8 → 3.4.1

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
package/README.md CHANGED
@@ -11,8 +11,9 @@ It's storybook is publicly published at [ui.xola.io](https://ui.xola.io). The ic
11
11
 
12
12
  ### Requirements
13
13
 
14
- - Node.js v16
14
+ - Node.js v20 or higher
15
15
  - NPM v7 or higher
16
+ - **ESM-only package** - This package uses ES modules exclusively and does not support CommonJS
16
17
 
17
18
  ### Usage
18
19
 
@@ -25,31 +26,79 @@ npm install @xola/ui-kit
25
26
  Install peer dependencies:
26
27
 
27
28
  ```bash
28
- npm install autoprefixer postcss tailwindcss lodash
29
+ npm install autoprefixer postcss tailwindcss vite
29
30
  ```
30
31
 
31
- Create PostCSS and Tailwind config files:
32
+ #### Option 1: Use configs directly (Recommended)
32
33
 
33
- ```bash
34
- echo 'module.exports = require("@xola/ui-kit/tailwind.config");' > tailwind.config.js
35
- echo 'module.exports = require("@xola/ui-kit/postcss.config");' > postcss.config.js
34
+ Import and extend the configs in your project:
35
+
36
+ **tailwind.config.js:**
37
+ ```js
38
+ import uiKitConfig from "@xola/ui-kit/tailwind.config.js";
39
+
40
+ export default {
41
+ ...uiKitConfig,
42
+ content: [
43
+ ...uiKitConfig.content,
44
+ "./src/**/*.{js,jsx,ts,tsx}",
45
+ ],
46
+ };
47
+ ```
48
+
49
+ **postcss.config.js:**
50
+ ```js
51
+ export default {
52
+ plugins: {
53
+ tailwindcss: {},
54
+ autoprefixer: {},
55
+ },
56
+ };
57
+ ```
58
+
59
+ #### Option 2: Re-export configs (Simple)
60
+
61
+ If you want to use the UI Kit configs as-is:
62
+
63
+ **tailwind.config.js:**
64
+ ```js
65
+ export { default } from "@xola/ui-kit/tailwind.config.js";
66
+ ```
67
+
68
+ **postcss.config.js:**
69
+ ```js
70
+ export { default } from "@xola/ui-kit/postcss.config.js";
36
71
  ```
37
72
 
73
+ #### Import Styles and Components
74
+
38
75
  Import main CSS files in your project:
39
76
 
40
77
  ```js
41
78
  import "@xola/ui-kit/index.css";
42
- import "@xola/ui-kit/build/style.css";
79
+ import "@xola/ui-kit/build/ui-kit.css";
43
80
  ```
44
81
 
45
- UI kit expects you already have a working React dev environment with PostCSS support.
82
+ UI kit expects you already have a working React 18+ dev environment with PostCSS support.
46
83
 
47
- Import and use the components:
84
+ Import and use the components (with full TypeScript support):
48
85
 
49
- ```js
50
- import { Button } from "@xola/ui-kit";
86
+ ```tsx
87
+ import { Button, Modal, Input } from "@xola/ui-kit";
88
+
89
+ // TypeScript types are automatically included
90
+ function MyComponent() {
91
+ return (
92
+ <>
93
+ <Button variant="primary">Click me</Button>
94
+ <Input type="text" placeholder="Enter text" />
95
+ </>
96
+ );
97
+ }
51
98
  ```
52
99
 
100
+ > **Note:** This package is ESM-only. Ensure your project has `"type": "module"` in package.json or use `.mjs` file extensions for configuration files.
101
+
53
102
  ## Development
54
103
 
55
104
  ### Installation
@@ -57,7 +106,7 @@ import { Button } from "@xola/ui-kit";
57
106
  Install all required dependencies:
58
107
 
59
108
  ```bash
60
- $ nvm use # Project needs Node.js v16 with NPM v7
109
+ $ nvm use # Project needs Node.js v20+ with NPM v7+
61
110
  $ npm install
62
111
  ```
63
112
 
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ declare const colors: {
3
+ readonly primary: "bg-primary-lighter text-black";
4
+ readonly secondary: "bg-secondary-lighter text-black";
5
+ readonly success: "bg-success-lighter text-black";
6
+ readonly warning: "bg-warning-lighter text-black";
7
+ readonly danger: "bg-danger-lighter text-black";
8
+ readonly caution: "bg-caution-lighter text-black";
9
+ };
10
+ type AlertColor = keyof typeof colors;
11
+ export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
12
+ color?: AlertColor;
13
+ children: React.ReactNode;
14
+ className?: string;
15
+ onClose?: () => void;
16
+ }
17
+ export declare const Alert: ({ color, children, className, onClose, ...rest }: AlertProps) => React.JSX.Element;
18
+ export {};
@@ -0,0 +1,28 @@
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import i from "clsx";
3
+ import { CloseIcon as n } from "../icons/build/CloseIcon.js";
4
+ const o = {
5
+ primary: "bg-primary-lighter text-black",
6
+ secondary: "bg-secondary-lighter text-black",
7
+ success: "bg-success-lighter text-black",
8
+ warning: "bg-warning-lighter text-black",
9
+ danger: "bg-danger-lighter text-black",
10
+ caution: "bg-caution-lighter text-black"
11
+ }, u = ({ color: r = "primary", children: a, className: l, onClose: e, ...c }) => /* @__PURE__ */ s(
12
+ "div",
13
+ {
14
+ className: i(
15
+ "ui-alert flex items-start rounded px-3 py-3 text-base leading-4",
16
+ o[r],
17
+ l
18
+ ),
19
+ ...c,
20
+ children: [
21
+ /* @__PURE__ */ t("span", { className: "ui-alert-content w-full leading-p1", children: a }),
22
+ e ? /* @__PURE__ */ t("button", { type: "button", className: "ui-alert-close ml-3 cursor-pointer hover:text-gray-dark", children: /* @__PURE__ */ t(n, { onClick: e }) }) : null
23
+ ]
24
+ }
25
+ );
26
+ export {
27
+ u as Alert
28
+ };
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface FadeInProps {
3
+ [key: string]: any;
4
+ shouldShow?: boolean;
5
+ shouldAppear?: boolean;
6
+ tag?: React.ElementType;
7
+ enter?: string;
8
+ enterFrom?: string;
9
+ enterTo?: string;
10
+ children?: React.ReactNode;
11
+ className?: string;
12
+ }
13
+ export declare const FadeIn: ({ shouldShow, shouldAppear, tag, enter, enterFrom, enterTo, children, className, ...rest }: FadeInProps) => React.JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { Transition as m } from "@headlessui/react";
3
+ const y = ({
4
+ shouldShow: t = !0,
5
+ shouldAppear: o = !0,
6
+ tag: r = "div",
7
+ enter: i = "transition-opacity duration-700",
8
+ enterFrom: a = "opacity-0",
9
+ enterTo: n = "opacity-100",
10
+ children: p,
11
+ className: e,
12
+ ...s
13
+ }) => /* @__PURE__ */ c(
14
+ m,
15
+ {
16
+ show: t,
17
+ appear: o,
18
+ as: r,
19
+ className: e,
20
+ enter: i,
21
+ enterFrom: a,
22
+ enterTo: n,
23
+ ...s,
24
+ children: p
25
+ }
26
+ );
27
+ export {
28
+ y as FadeIn
29
+ };
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface SlideDownProps {
3
+ isOpen?: boolean;
4
+ children?: React.ReactNode;
5
+ }
6
+ export declare const SlideDown: ({ isOpen, children }: SlideDownProps) => React.JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Transition as o } from "@headlessui/react";
3
+ const i = ({ isOpen: r, children: a }) => /* @__PURE__ */ t("div", { className: "overflow-hidden", children: /* @__PURE__ */ t(
4
+ o,
5
+ {
6
+ show: r,
7
+ appear: r,
8
+ as: "div",
9
+ enter: "transition-all duration-500",
10
+ enterFrom: "transform -translate-y-full opacity-0",
11
+ enterTo: "transform translate-y-0 opacity-100",
12
+ leave: "transition duration-500",
13
+ leaveFrom: "transform translate-y-0 opacity-100",
14
+ leaveTo: "transform -translate-y-full opacity-0",
15
+ children: a
16
+ }
17
+ ) });
18
+ export {
19
+ i as SlideDown
20
+ };
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ declare const sizes: {
3
+ readonly tiny: "h-7 w-7 text-base";
4
+ readonly small: "h-10 w-10 text-base";
5
+ readonly medium: "h-12 w-12 text-md";
6
+ readonly large: "h-15 w-15 text-xl";
7
+ };
8
+ type AvatarSize = keyof typeof sizes;
9
+ export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ name?: string;
11
+ color?: string;
12
+ size?: AvatarSize;
13
+ className?: string;
14
+ }
15
+ export declare const Avatar: ({ name, color, size, className, ...rest }: AvatarProps) => React.JSX.Element;
16
+ export {};
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,27 @@
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 small: "px-2 py-0.75 h-5 text-sm leading-sm";
14
+ readonly medium: "px-3 py-1.5 h-7.5 text-base leading-base";
15
+ readonly large: "px-3.5 py-0.75 h-10 text-lg leading-lg";
16
+ };
17
+ type BadgeColor = keyof typeof colors;
18
+ type BadgeSize = keyof typeof sizes;
19
+ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
20
+ color?: BadgeColor;
21
+ size?: BadgeSize;
22
+ icon?: React.ReactElement;
23
+ children: React.ReactNode;
24
+ className?: string;
25
+ }
26
+ export declare const Badge: ({ color, size, icon, children, className, ...rest }: BadgeProps) => React.JSX.Element;
27
+ export {};
@@ -0,0 +1,40 @@
1
+ import { jsxs as n } from "react/jsx-runtime";
2
+ import t 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
+ small: "px-2 py-0.75 h-5 text-sm leading-sm",
15
+ medium: "px-3 py-1.5 h-7.5 text-base leading-base",
16
+ large: "px-3.5 py-0.75 h-10 text-lg leading-lg"
17
+ }, o = {
18
+ small: "w-3 h-3",
19
+ medium: "w-4 h-4",
20
+ large: "w-5 h-5 mr-1.5"
21
+ }, x = ({ color: a = "primary", size: e = "small", icon: r, children: i, className: s, ...l }) => /* @__PURE__ */ n(
22
+ "span",
23
+ {
24
+ className: t(
25
+ "ui-badge",
26
+ "inline-flex items-center whitespace-nowrap rounded-full",
27
+ c[a],
28
+ m[e],
29
+ s
30
+ ),
31
+ ...l,
32
+ children: [
33
+ r ? g(r, { className: t("mr-1", o[e]) }) : null,
34
+ i
35
+ ]
36
+ }
37
+ );
38
+ export {
39
+ x as Badge
40
+ };
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,27 @@
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
+ };
@@ -0,0 +1,63 @@
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 {};
@@ -0,0 +1,89 @@
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
+ };
@@ -0,0 +1,53 @@
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 {};