@xola/ui-kit 3.5.0 → 3.7.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 (215) hide show
  1. package/README.md +136 -87
  2. package/build/components/Alert.js +18 -13
  3. package/build/components/Animation/FadeIn.js +36 -25
  4. package/build/components/Animation/SlideDown.js +14 -9
  5. package/build/components/Avatar.js +17 -10
  6. package/build/components/Badge.js +33 -24
  7. package/build/components/BottomSheet.js +114 -0
  8. package/build/components/Breadcrumb.js +27 -21
  9. package/build/components/Breakdown.js +66 -74
  10. package/build/components/Buttons/Button.js +53 -47
  11. package/build/components/Buttons/ButtonGroup.js +42 -39
  12. package/build/components/Buttons/SecondaryButton.js +31 -0
  13. package/build/components/Buttons/SubmitButton.js +72 -66
  14. package/build/components/Buttons/ToggleButton.js +15 -16
  15. package/build/components/Counter.js +10 -6
  16. package/build/components/DatePicker/DatePicker.helpers.js +24 -13
  17. package/build/components/DatePicker/DatePicker.js +196 -223
  18. package/build/components/DatePicker/DatePickerPopover.js +75 -66
  19. package/build/components/DatePicker/Day.js +35 -32
  20. package/build/components/DatePicker/LocalizedDayPicker.js +15 -18
  21. package/build/components/DatePicker/MonthGrid.js +35 -48
  22. package/build/components/DatePicker/MonthPicker.js +25 -20
  23. package/build/components/DatePicker/MonthSelector.js +39 -40
  24. package/build/components/DatePicker/MonthYearSelector.js +18 -39
  25. package/build/components/DatePicker/NavbarElement.js +26 -35
  26. package/build/components/DatePicker/RangeDatePicker.js +104 -123
  27. package/build/components/DatePicker/RelativeDateRange.js +153 -143
  28. package/build/components/DatePicker/UpcomingDatePicker.js +29 -25
  29. package/build/components/Dot/Dot.js +13 -8
  30. package/build/components/Dot/DotProgress.js +12 -7
  31. package/build/components/Drawer.js +109 -101
  32. package/build/components/Forms/BaseInput.js +50 -34
  33. package/build/components/Forms/Checkbox.js +33 -30
  34. package/build/components/Forms/ComboBox.js +35 -35
  35. package/build/components/Forms/FormGroup.js +7 -3
  36. package/build/components/Forms/InlineValuePopover.js +33 -39
  37. package/build/components/Forms/Input.js +15 -7
  38. package/build/components/Forms/Label.js +14 -8
  39. package/build/components/Forms/RangeSlider.js +41 -22
  40. package/build/components/Forms/Select.js +5 -6
  41. package/build/components/Forms/Switch.js +46 -38
  42. package/build/components/Forms/Textarea.js +37 -30
  43. package/build/components/Forms/ValuePopoverText.js +5 -8
  44. package/build/components/GooglePlacesAutocomplete.js +112 -0
  45. package/build/components/HeaderToolbar.js +30 -22
  46. package/build/components/ImageUpload.js +76 -79
  47. package/build/components/Key.js +21 -16
  48. package/build/components/Logo.js +12 -5
  49. package/build/components/Modal.js +87 -72
  50. package/build/components/Popover/Popover.js +40 -31
  51. package/build/components/Popover/PopoverList.js +43 -36
  52. package/build/components/Provider.js +7 -8
  53. package/build/components/Screens/Login.js +97 -126
  54. package/build/components/Search.js +114 -144
  55. package/build/components/Sidebar/Sidebar.Account.js +39 -46
  56. package/build/components/Sidebar/Sidebar.Button.js +45 -19
  57. package/build/components/Sidebar/Sidebar.Footer.js +8 -7
  58. package/build/components/Sidebar/Sidebar.Heading.js +11 -8
  59. package/build/components/Sidebar/Sidebar.Link.js +79 -44
  60. package/build/components/Sidebar/Sidebar.Menu.js +52 -28
  61. package/build/components/Sidebar/Sidebar.Notifications.js +107 -0
  62. package/build/components/Sidebar/Sidebar.js +207 -214
  63. package/build/components/Sidebar/SidebarContext.js +15 -0
  64. package/build/components/Sidebar/sidebarWidth.js +41 -0
  65. package/build/components/Sidebar/useSidebarWidthState.js +115 -0
  66. package/build/components/Skeleton.js +19 -20
  67. package/build/components/Spinner.js +18 -10
  68. package/build/components/Table.js +86 -50
  69. package/build/components/Tabs/Tabs.Panel.js +9 -5
  70. package/build/components/Tabs/Tabs.Tab.js +28 -23
  71. package/build/components/Tabs/Tabs.js +23 -23
  72. package/build/components/Tag.js +28 -23
  73. package/build/components/Tooltip.js +19 -5
  74. package/build/components/Utilities/Currency.js +49 -42
  75. package/build/components/Utilities/Number.js +14 -12
  76. package/build/components/Utilities/Phone.js +18 -12
  77. package/build/helpers/environment.js +10 -0
  78. package/build/helpers/flash.js +45 -46
  79. package/build/hooks/useIsMobile.js +8 -0
  80. package/build/hooks/useViewportHeight.js +6 -12
  81. package/build/icons/src/AnnounceIcon.js +3 -4
  82. package/build/icons/src/BellIcon.js +0 -1
  83. package/build/icons/src/CalendarIcon.js +0 -1
  84. package/build/icons/src/CheckIcon.js +0 -1
  85. package/build/icons/src/ChevronDownIcon.js +4 -5
  86. package/build/icons/src/ChevronLeftIcon.js +0 -1
  87. package/build/icons/src/ChevronRightIcon.js +0 -1
  88. package/build/icons/src/CircleNotch.js +0 -1
  89. package/build/icons/src/CloseIcon.js +11 -9
  90. package/build/icons/src/DownArrowIcon.js +0 -1
  91. package/build/icons/src/ImageIcon.js +0 -1
  92. package/build/icons/src/SearchIcon.js +4 -5
  93. package/build/icons/src/TrashIcon.js +0 -1
  94. package/build/icons/src/WarningDiamondIcon.js +0 -1
  95. package/build/icons/src/helpers/icon.js +5 -9
  96. package/build/icons/src/images/XolaLogoSimple.js +2 -3
  97. package/build/index.js +143 -130
  98. package/build/style.css +1 -0
  99. package/build/theme.css +76 -0
  100. package/build/theme.js +2 -0
  101. package/build/utils/currency.js +5 -5
  102. package/build/{helpers → utils}/date.js +17 -20
  103. package/build/utils/numbers.js +12 -12
  104. package/build/utils/phone.js +12 -14
  105. package/build/utils/userLocale.js +6 -0
  106. package/index.css +96 -4
  107. package/index.d.ts +204 -0
  108. package/package.json +87 -77
  109. package/skills/README.md +27 -0
  110. package/skills/migrate-2.6-to-3.7/SKILL.md +110 -0
  111. package/tailwind.config.js +5 -2
  112. package/build/base.css +0 -2
  113. package/build/components/Alert.d.ts +0 -18
  114. package/build/components/Animation/FadeIn.d.ts +0 -13
  115. package/build/components/Animation/SlideDown.d.ts +0 -6
  116. package/build/components/Avatar.d.ts +0 -16
  117. package/build/components/Badge.d.ts +0 -28
  118. package/build/components/Breadcrumb.d.ts +0 -21
  119. package/build/components/Breakdown.d.ts +0 -63
  120. package/build/components/Buttons/Button.d.ts +0 -53
  121. package/build/components/Buttons/ButtonGroup.d.ts +0 -35
  122. package/build/components/Buttons/SubmitButton.d.ts +0 -11
  123. package/build/components/Buttons/ToggleButton.d.ts +0 -21
  124. package/build/components/Charts/BaseChartOptions.d.ts +0 -136
  125. package/build/components/Charts/HistogramOptions.d.ts +0 -192
  126. package/build/components/Charts/PieOptions.d.ts +0 -177
  127. package/build/components/Counter.d.ts +0 -5
  128. package/build/components/DatePicker/DatePicker.d.ts +0 -41
  129. package/build/components/DatePicker/DatePicker.helpers.d.ts +0 -17
  130. package/build/components/DatePicker/DatePickerPopover.d.ts +0 -29
  131. package/build/components/DatePicker/Day.d.ts +0 -13
  132. package/build/components/DatePicker/LocalizedDayPicker.d.ts +0 -6
  133. package/build/components/DatePicker/MonthGrid.d.ts +0 -11
  134. package/build/components/DatePicker/MonthPicker.d.ts +0 -7
  135. package/build/components/DatePicker/MonthSelector.d.ts +0 -8
  136. package/build/components/DatePicker/MonthYearSelector.d.ts +0 -8
  137. package/build/components/DatePicker/NavbarElement.d.ts +0 -15
  138. package/build/components/DatePicker/RangeDatePicker.d.ts +0 -25
  139. package/build/components/DatePicker/RelativeDateRange.d.ts +0 -51
  140. package/build/components/DatePicker/UpcomingDatePicker.d.ts +0 -11
  141. package/build/components/Dot/Dot.d.ts +0 -24
  142. package/build/components/Dot/DotProgress.d.ts +0 -6
  143. package/build/components/Drawer.d.ts +0 -28
  144. package/build/components/Forms/BaseInput.d.ts +0 -20
  145. package/build/components/Forms/Checkbox.d.ts +0 -10
  146. package/build/components/Forms/ComboBox.d.ts +0 -8
  147. package/build/components/Forms/FormGroup.d.ts +0 -5
  148. package/build/components/Forms/InlineValuePopover.d.ts +0 -17
  149. package/build/components/Forms/Input.d.ts +0 -6
  150. package/build/components/Forms/Label.d.ts +0 -7
  151. package/build/components/Forms/RangeSlider.d.ts +0 -33
  152. package/build/components/Forms/Select.d.ts +0 -5
  153. package/build/components/Forms/Switch.d.ts +0 -46
  154. package/build/components/Forms/Textarea.d.ts +0 -6
  155. package/build/components/Forms/ValuePopoverText.d.ts +0 -6
  156. package/build/components/GooglePlacesAutocomplete.d.ts +0 -14
  157. package/build/components/HeaderToolbar.d.ts +0 -21
  158. package/build/components/ImageUpload.d.ts +0 -17
  159. package/build/components/Key.d.ts +0 -6
  160. package/build/components/Logo.d.ts +0 -19
  161. package/build/components/Modal.d.ts +0 -52
  162. package/build/components/Popover/Popover.d.ts +0 -20
  163. package/build/components/Popover/PopoverList.d.ts +0 -25
  164. package/build/components/Provider.d.ts +0 -18
  165. package/build/components/Screens/Login.d.ts +0 -25
  166. package/build/components/Search.d.ts +0 -16
  167. package/build/components/Sidebar/Sidebar.Account.d.ts +0 -13
  168. package/build/components/Sidebar/Sidebar.Button.d.ts +0 -10
  169. package/build/components/Sidebar/Sidebar.Footer.d.ts +0 -8
  170. package/build/components/Sidebar/Sidebar.Heading.d.ts +0 -10
  171. package/build/components/Sidebar/Sidebar.Link.d.ts +0 -24
  172. package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -13
  173. package/build/components/Sidebar/Sidebar.d.ts +0 -58
  174. package/build/components/Sidebar/index.d.ts +0 -8
  175. package/build/components/Skeleton.d.ts +0 -13
  176. package/build/components/Spinner.d.ts +0 -26
  177. package/build/components/Table.d.ts +0 -59
  178. package/build/components/Tabs/Tabs.Panel.d.ts +0 -9
  179. package/build/components/Tabs/Tabs.Tab.d.ts +0 -19
  180. package/build/components/Tabs/Tabs.d.ts +0 -27
  181. package/build/components/Tabs/index.d.ts +0 -4
  182. package/build/components/Tag.d.ts +0 -25
  183. package/build/components/Tooltip.d.ts +0 -8
  184. package/build/components/Utilities/Currency.d.ts +0 -32
  185. package/build/components/Utilities/Number.d.ts +0 -8
  186. package/build/components/Utilities/Phone.d.ts +0 -8
  187. package/build/full.css +0 -2
  188. package/build/helpers/avatar.d.ts +0 -1
  189. package/build/helpers/avatar.js +0 -8
  190. package/build/helpers/browser.d.ts +0 -2
  191. package/build/helpers/children.d.ts +0 -3
  192. package/build/helpers/classnames.d.ts +0 -5
  193. package/build/helpers/currency.d.ts +0 -2
  194. package/build/helpers/currency.js +0 -11
  195. package/build/helpers/date.d.ts +0 -12
  196. package/build/helpers/flash.d.ts +0 -21
  197. package/build/helpers/numbers.d.ts +0 -4
  198. package/build/helpers/numbers.js +0 -23
  199. package/build/helpers/phone.d.ts +0 -11
  200. package/build/helpers/phone.js +0 -25
  201. package/build/hooks/useId.d.ts +0 -1
  202. package/build/hooks/useId.js +0 -9
  203. package/build/hooks/useIsClient.d.ts +0 -1
  204. package/build/hooks/useViewportHeight.d.ts +0 -1
  205. package/build/icons/src/helpers/classnames.js +0 -8
  206. package/build/index.d.ts +0 -66
  207. package/build/theme.d.ts +0 -413
  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/currency.d.ts +0 -2
  213. package/build/utils/index.d.ts +0 -4
  214. package/build/utils/numbers.d.ts +0 -4
  215. package/build/utils/phone.d.ts +0 -2
@@ -1,7 +1,8 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import c from "../helpers/classnames.js";
3
- import { CircleNotch as i } from "../icons/src/CircleNotch.js";
4
- const o = {
1
+ import r from "prop-types";
2
+ import i from "react";
3
+ import o from "../helpers/classnames.js";
4
+ import { CircleNotch as c } from "../icons/src/CircleNotch.js";
5
+ const a = {
5
6
  primary: "text-primary",
6
7
  secondary: "text-secondary",
7
8
  warning: "text-warning",
@@ -9,19 +10,26 @@ const o = {
9
10
  danger: "text-danger",
10
11
  caution: "text-caution",
11
12
  current: null
12
- }, a = {
13
+ // TODO: Consider setting this as the default value.
14
+ }, m = {
13
15
  tiny: "w-4 h-4",
14
16
  small: "w-7 h-7",
15
17
  medium: "w-10 h-10",
16
18
  large: "w-14 h-14",
17
19
  current: "w-[1em] h-[1em]"
18
- }, p = ({ size: r = "small", color: e = "secondary", className: n, ...t }) => /* @__PURE__ */ s(
19
- i,
20
+ // TODO: Consider setting this as the default value.
21
+ }, l = ({ className: e, size: t = "small", color: n = "secondary", ...s }) => /* @__PURE__ */ i.createElement(
22
+ c,
20
23
  {
21
- className: c("ui-spinner", n, a[r], o[e], "inline-block animate-spin"),
22
- ...t
24
+ className: o("ui-spinner", e, m[t], a[n], "inline-block animate-spin"),
25
+ ...s
23
26
  }
24
27
  );
28
+ l.propTypes = {
29
+ className: r.string,
30
+ size: r.string,
31
+ color: r.string
32
+ };
25
33
  export {
26
- p as Spinner
34
+ l as Spinner
27
35
  };
@@ -1,71 +1,107 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import T, { Children as k, cloneElement as B, useState as u, useRef as h, useEffect as A } from "react";
3
- import s from "../helpers/classnames.js";
4
- const n = ({ className: e, ...l }) => /* @__PURE__ */ a("div", { className: "ui-table flex flex-col", children: /* @__PURE__ */ a("div", { className: "-my-2 overflow-x-auto", children: /* @__PURE__ */ a("div", { className: "inline-block min-w-full py-2 align-middle", children: /* @__PURE__ */ a("div", { className: "overflow-hidden border-b border-gray-lighter sm:rounded-lg", children: /* @__PURE__ */ a("table", { className: s(e, "min-w-full divide-y border border-gray-lighter"), ...l }) }) }) }) }), g = ({ className: e, ...l }) => /* @__PURE__ */ a("thead", { className: s("ui-table-head", "bg-gray-lighter", e), ...l });
5
- g.displayName = "Table.Head";
6
- const f = ({ className: e, ...l }) => /* @__PURE__ */ a("th", { className: s("ui-table-header", "px-4 py-2 text-left text-base font-bold", e), ...l });
7
- f.displayName = "Table.Header";
8
- const y = ({ isStriped: e = !1, children: l, className: i, ...d }) => /* @__PURE__ */ a("tbody", { className: s("ui-table-body", "border-none", i), ...d, children: k.map(l, (t) => !t || !T.isValidElement(t) ? t : B(t, { isStriped: e })) });
9
- y.displayName = "Table.Body";
10
- const p = ({ isStriped: e = !1, className: l, ...i }) => /* @__PURE__ */ a("tr", { className: s("ui-table-row", e && "even:bg-gray-lighter", l), ...i });
11
- p.displayName = "Table.Row";
12
- const x = ({ className: e, ...l }) => /* @__PURE__ */ a(
1
+ import r from "prop-types";
2
+ import t, { useState as p, useRef as b, useEffect as w } from "react";
3
+ import i from "../helpers/classnames.js";
4
+ const e = ({ className: l, ...a }) => /* @__PURE__ */ t.createElement("div", { className: "ui-table flex flex-col" }, /* @__PURE__ */ t.createElement("div", { className: "-my-2 overflow-x-auto" }, /* @__PURE__ */ t.createElement("div", { className: "inline-block min-w-full py-2 align-middle" }, /* @__PURE__ */ t.createElement("div", { className: "overflow-hidden border-b border-gray-lighter sm:rounded-lg" }, /* @__PURE__ */ t.createElement("table", { className: i(l, "min-w-full divide-y border border-gray-lighter"), ...a })))));
5
+ e.propTypes = {
6
+ className: r.string
7
+ };
8
+ e.Head = ({ className: l, ...a }) => /* @__PURE__ */ t.createElement("thead", { className: i("ui-table-head", "bg-gray-lighter", l), ...a });
9
+ e.Head.displayName = "Table.Head";
10
+ e.Head.propTypes = {
11
+ className: r.string
12
+ };
13
+ e.Header = ({ className: l, ...a }) => /* @__PURE__ */ t.createElement("th", { className: i("ui-table-header", "px-4 py-2 text-left text-base font-bold", l), ...a });
14
+ e.Header.displayName = "Table.Header";
15
+ e.Header.propTypes = {
16
+ className: r.string
17
+ };
18
+ e.Body = ({ className: l, isStriped: a = !1, children: n, ...d }) => /* @__PURE__ */ t.createElement(
19
+ "tbody",
20
+ {
21
+ className: i(
22
+ "ui-table-body",
23
+ "border-none",
24
+ // Stripe via CSS instead of cloning isStriped onto every child; a non-Row child
25
+ // would otherwise spread it to the DOM and warn under React.
26
+ a && "[&>tr:nth-child(even)]:bg-gray-lighter",
27
+ l
28
+ ),
29
+ ...d
30
+ },
31
+ n
32
+ );
33
+ e.Body.displayName = "Table.Body";
34
+ e.Body.propTypes = {
35
+ className: r.string,
36
+ children: r.node.isRequired,
37
+ isStriped: r.bool
38
+ };
39
+ e.Row = ({ isStriped: l = !1, className: a, ...n }) => /* @__PURE__ */ t.createElement("tr", { className: i("ui-table-row", l && "even:bg-gray-lighter", a), ...n });
40
+ e.Row.displayName = "Table.Row";
41
+ e.Row.propTypes = {
42
+ isStriped: r.bool,
43
+ className: r.string
44
+ };
45
+ e.Cell = ({ className: l, ...a }) => /* @__PURE__ */ t.createElement(
13
46
  "td",
14
47
  {
15
- className: s("ui-table-cell", "whitespace-nowrap px-4 py-2 text-base text-gray-darker", e),
16
- ...l
48
+ className: i("ui-table-cell", "whitespace-nowrap px-4 py-2 text-base text-gray-darker", l),
49
+ ...a
17
50
  }
18
51
  );
19
- x.displayName = "Table.Cell";
20
- const N = ({ value: e, className: l, onSave: i, ...d }) => {
21
- const [t, b] = u(!1), [o, w] = u(e), c = h(null), m = h(null), [v, C] = u("auto"), H = async () => {
22
- b(!1), o !== e && i(o);
52
+ e.Cell.displayName = "Table.Cell";
53
+ e.Cell.propTypes = {
54
+ className: r.string
55
+ };
56
+ const v = ({ className: l, value: a, onSave: n, ...d }) => {
57
+ const [o, u] = p(!1), [c, y] = p(a), m = b(null), g = b(null), [h, f] = p("auto"), N = async () => {
58
+ u(!1), c !== a && n(c);
23
59
  }, E = () => {
24
- t || b(!0);
25
- }, R = (r) => {
26
- w(r.target.value), r.target.style.height = "auto", r.target.style.height = `${r.target.scrollHeight}px`;
60
+ o || u(!0);
61
+ }, x = (s) => {
62
+ y(s.target.value), s.target.style.height = "auto", s.target.style.height = `${s.target.scrollHeight}px`;
27
63
  };
28
- return A(() => {
29
- if (t) {
64
+ return w(() => {
65
+ if (o) {
30
66
  requestAnimationFrame(() => {
31
- var r;
32
- (r = m.current) == null || r.focus();
67
+ var s;
68
+ (s = g.current) == null || s.focus();
33
69
  });
34
70
  return;
35
71
  }
36
- c.current && C(`${c.current.scrollHeight * 1.07}px`);
37
- }, [t]), /* @__PURE__ */ a(
72
+ m.current && f(`${m.current.scrollHeight * 1.07}px`);
73
+ }, [o]), /* @__PURE__ */ t.createElement(
38
74
  "td",
39
75
  {
40
- className: s(
76
+ className: i(
41
77
  "ui-table-cell",
42
78
  "whitespace-nowrap px-4 py-2 text-base text-gray-darker",
43
- { "bg-gray-hover": t },
79
+ { "bg-gray-hover": o },
44
80
  l
45
81
  ),
46
82
  onClick: E,
47
- ...d,
48
- children: t ? /* @__PURE__ */ a(
49
- "textarea",
50
- {
51
- ref: m,
52
- value: o,
53
- style: { height: v },
54
- className: "h-auto w-full rounded border-none p-1 focus:outline-0 focus:!ring-gray-light",
55
- onChange: R,
56
- onBlur: H
57
- }
58
- ) : /* @__PURE__ */ a("div", { ref: c, className: "cursor-text whitespace-pre-wrap", children: o || /* @__PURE__ */ a("span", { className: "text-gray", children: "Not Available" }) })
59
- }
83
+ ...d
84
+ },
85
+ o ? /* @__PURE__ */ t.createElement(
86
+ "textarea",
87
+ {
88
+ ref: g,
89
+ value: c,
90
+ style: { height: h },
91
+ className: "h-auto w-full rounded border-none p-1 focus:outline-0 focus:!ring-gray-light",
92
+ onChange: x,
93
+ onBlur: N
94
+ }
95
+ ) : /* @__PURE__ */ t.createElement("div", { ref: m, className: "cursor-text whitespace-pre-wrap" }, c || /* @__PURE__ */ t.createElement("span", { className: "text-gray" }, "Not Available"))
60
96
  );
61
97
  };
62
- N.displayName = "Table.EditableCell";
63
- n.Head = g;
64
- n.Header = f;
65
- n.Body = y;
66
- n.Row = p;
67
- n.Cell = x;
68
- n.EditableCell = N;
98
+ e.EditableCell = v;
99
+ e.EditableCell.displayName = "Table.EditableCell";
100
+ e.EditableCell.propTypes = {
101
+ className: r.string,
102
+ value: r.string.isRequired,
103
+ onSave: r.func.isRequired
104
+ };
69
105
  export {
70
- n as Table
106
+ e as Table
71
107
  };
@@ -1,7 +1,11 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import s from "../../helpers/classnames.js";
3
- const m = ({ className: a, ...e }) => /* @__PURE__ */ r("div", { className: s("ui-tabs-panel", a), ...e });
4
- m.displayName = "Tabs.Panel";
1
+ import p from "prop-types";
2
+ import s from "react";
3
+ import t from "../../helpers/classnames.js";
4
+ const e = ({ className: a, ...r }) => /* @__PURE__ */ s.createElement("div", { className: t("ui-tabs-panel", a), ...r });
5
+ e.propTypes = {
6
+ className: p.string
7
+ };
8
+ e.displayName = "Tabs.Panel";
5
9
  export {
6
- m as Panel
10
+ e as Panel
7
11
  };
@@ -1,6 +1,7 @@
1
- import { jsx as l } from "react/jsx-runtime";
1
+ import e from "prop-types";
2
+ import p from "react";
2
3
  import t from "../../helpers/classnames.js";
3
- const n = {
4
+ const a = {
4
5
  default: (r) => t(
5
6
  "border-b border-gray-light",
6
7
  r ? "text-primary border-l border-r border-b-transparent" : "hover:text-gray-darker"
@@ -9,29 +10,33 @@ const n = {
9
10
  "flex-1 text-lg transition-colors",
10
11
  r ? "bg-white text-black" : "text-gray-dark hover:text-black hover:bg-gray-light"
11
12
  )
12
- }, c = ({
13
+ }, o = ({
13
14
  variant: r = "default",
14
- as: e,
15
- isActive: a = !1,
16
- isHidden: o = !1,
17
- className: s,
15
+ as: s = "button",
16
+ className: i,
17
+ isActive: n = !1,
18
+ isHidden: l = !1,
18
19
  ...b
19
- }) => {
20
- const i = e ?? "button";
21
- return o ? null : /* @__PURE__ */ l(
22
- i,
23
- {
24
- className: t(
25
- "ui-tabs-tab",
26
- s,
27
- "cursor-pointer whitespace-nowrap px-8 py-4 text-center font-semibold focus-visible:ring",
28
- n[r](a)
29
- ),
30
- ...b
31
- }
32
- );
20
+ }) => l ? null : /* @__PURE__ */ p.createElement(
21
+ s,
22
+ {
23
+ className: t(
24
+ "ui-tabs-tab",
25
+ i,
26
+ "cursor-pointer whitespace-nowrap py-4 px-8 text-center font-semibold focus-visible:ring",
27
+ a[r](n)
28
+ ),
29
+ ...b
30
+ }
31
+ );
32
+ o.propTypes = {
33
+ variant: e.oneOf(Object.keys(a)),
34
+ as: e.oneOfType([e.string, e.elementType]),
35
+ className: e.string,
36
+ isActive: e.bool,
37
+ isHidden: e.bool
33
38
  };
34
- c.displayName = "Tabs.Tab";
39
+ o.displayName = "Tabs.Tab";
35
40
  export {
36
- c as Tab
41
+ o as Tab
37
42
  };
@@ -1,28 +1,28 @@
1
- import { jsxs as a, Fragment as y, jsx as n } from "react/jsx-runtime";
2
- import i, { Children as h, cloneElement as x } from "react";
3
- import w from "../../helpers/classnames.js";
4
- import { Panel as s } from "./Tabs.Panel.js";
5
- import { Tab as m } from "./Tabs.Tab.js";
6
- const A = {
1
+ import r from "prop-types";
2
+ import t, { Children as u, cloneElement as y } from "react";
3
+ import g from "../../helpers/classnames.js";
4
+ import { Panel as T } from "./Tabs.Panel.js";
5
+ import { Tab as h } from "./Tabs.Tab.js";
6
+ const m = {
7
7
  default: "border-t border-gray-light",
8
8
  simple: "bg-gray-lighter"
9
- }, d = ({ variant: e = "default", value: t, children: f, className: b, onChange: c, ...g }) => {
10
- const l = h.toArray(f), p = l.filter((r) => i.isValidElement(r) && r.type === m), u = l.filter((r) => i.isValidElement(r) && r.type === s);
11
- return /* @__PURE__ */ a(y, { children: [
12
- /* @__PURE__ */ a("nav", { className: w("ui-tabs", "flex overflow-x-auto", A[e], b), ...g, children: [
13
- e === "default" ? /* @__PURE__ */ n("div", { className: "min-w-10 flex-shrink-0 border-b border-gray-light" }) : null,
14
- p.map((r, o) => x(r, {
15
- variant: e,
16
- isActive: o === t,
17
- onClick: () => c(o)
18
- })),
19
- e === "default" ? /* @__PURE__ */ n("div", { className: "min-w-10 flex-grow border-b border-gray-light" }) : null
20
- ] }),
21
- u[t]
22
- ] });
9
+ }, l = ({ className: c, variant: a = "default", value: i, onChange: o, children: d, ...b }) => {
10
+ const s = u.toArray(d), f = s.filter((e) => e.type === l.Tab), p = s.filter((e) => e.type === l.Panel);
11
+ return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("nav", { className: g("ui-tabs", "flex overflow-x-auto", m[a], c), ...b }, a === "default" ? /* @__PURE__ */ t.createElement("div", { className: "min-w-10 flex-shrink-0 border-b border-gray-light" }) : null, f.map((e, n) => y(e, {
12
+ variant: a,
13
+ isActive: n === i,
14
+ onClick: () => o == null ? void 0 : o(n)
15
+ })), a === "default" ? /* @__PURE__ */ t.createElement("div", { className: "min-w-10 flex-grow border-b border-gray-light" }) : null), p[i]);
23
16
  };
24
- d.Tab = m;
25
- d.Panel = s;
17
+ l.propTypes = {
18
+ variant: r.oneOf(Object.keys(m)),
19
+ className: r.string,
20
+ value: r.number.isRequired,
21
+ onChange: r.func.isRequired,
22
+ children: r.node.isRequired
23
+ };
24
+ l.Tab = h;
25
+ l.Panel = T;
26
26
  export {
27
- d as Tabs
27
+ l as Tabs
28
28
  };
@@ -1,36 +1,41 @@
1
- import { jsxs as c, jsx as g } from "react/jsx-runtime";
2
- import a from "../helpers/classnames.js";
3
- import { CloseIcon as d } from "../icons/src/CloseIcon.js";
4
- const b = {
1
+ import e from "prop-types";
2
+ import a from "react";
3
+ import o from "../helpers/classnames.js";
4
+ import { CloseIcon as m } from "../icons/src/CloseIcon.js";
5
+ const s = {
5
6
  primary: "bg-primary-lighter text-black border border-primary",
6
7
  secondary: "bg-secondary-light text-gray-darker border border-secondary",
7
8
  success: "bg-success-lighter text-black border border-success",
8
9
  warning: "bg-warning-lighter text-black border border-warning",
9
10
  danger: "bg-danger-lighter text-black border border-danger",
10
11
  caution: "bg-caution-lighter text-black border border-caution"
11
- }, m = {
12
+ }, n = {
12
13
  small: "px-1 py-0.75 text-sm leading-3.5",
13
14
  medium: "px-2 py-1 text-base leading-3.5",
14
15
  large: "px-2 py-1.5 text-base leading-4"
15
- }, y = ({ color: t = "primary", size: e = "small", children: i, className: o, onClose: r, ...s }) => {
16
- const l = (n) => {
17
- n.stopPropagation(), r == null || r();
16
+ }, p = ({ color: c = "primary", size: t = "small", onClose: r, className: i, children: l, ...d }) => {
17
+ const g = (b) => {
18
+ b.stopPropagation(), r == null || r();
18
19
  };
19
- return /* @__PURE__ */ c("span", { className: a("ui-tag", "inline-flex rounded", b[t], m[e], o), ...s, children: [
20
- i,
21
- r ? /* @__PURE__ */ g(
22
- d,
23
- {
24
- size: "small",
25
- className: a(
26
- "ui-tag-close ml-2 cursor-pointer leading-4 hover:text-gray-darker",
27
- e === "large" ? "mt-0.5" : "mt-0.25"
28
- ),
29
- onClick: l
30
- }
31
- ) : null
32
- ] });
20
+ return /* @__PURE__ */ a.createElement("span", { className: o("ui-tag", "inline-flex rounded", s[c], n[t], i), ...d }, l, r ? /* @__PURE__ */ a.createElement(
21
+ m,
22
+ {
23
+ size: "small",
24
+ className: o(
25
+ "ui-tag-close ml-2 cursor-pointer leading-4 hover:text-gray-darker",
26
+ t === "large" ? "mt-0.5" : "mt-0.25"
27
+ ),
28
+ onClick: g
29
+ }
30
+ ) : null);
31
+ };
32
+ p.propTypes = {
33
+ color: e.oneOf(Object.keys(s)),
34
+ size: e.oneOf(Object.keys(n)),
35
+ onClose: e.func,
36
+ className: e.string,
37
+ children: e.node.isRequired
33
38
  };
34
39
  export {
35
- y as Tag
40
+ p as Tag
36
41
  };
@@ -1,8 +1,22 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import m from "@tippyjs/react";
1
+ import s from "@tippyjs/react";
2
+ import t from "prop-types";
3
+ import o from "react";
3
4
  import { followCursor as l } from "tippy.js";
4
- import "tippy.js/dist/tippy.css";
5
- const u = ({ content: r, children: t, className: i, ...p }) => /* @__PURE__ */ o(m, { content: r, ...p, className: "ui-tooltip text-white", plugins: [l], children: /* @__PURE__ */ o("span", { className: i, children: t }) });
5
+ /* empty css */
6
+ /* empty css */
7
+ /* empty css */
8
+ /* empty css */
9
+ /* empty css */
10
+ const a = ({ children: p, className: i, contentClassName: e, content: r, ...m }) => {
11
+ const n = e ? /* @__PURE__ */ o.createElement("span", { className: e }, r) : r;
12
+ return /* @__PURE__ */ o.createElement(s, { content: n, ...m, className: "ui-tooltip text-white", plugins: [l] }, /* @__PURE__ */ o.createElement("span", { className: i }, p));
13
+ };
14
+ a.propTypes = {
15
+ content: t.node.isRequired,
16
+ // string, an element, or an array of elements
17
+ children: t.node.isRequired,
18
+ className: t.string
19
+ };
6
20
  export {
7
- u as Tooltip
21
+ a as Tooltip
8
22
  };
@@ -1,49 +1,56 @@
1
- import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
- import { getUserLocale as b } from "get-user-locale";
3
- import { isZeroDecimal as d, getSymbol as x } from "../../helpers/currency.js";
4
- import { numberFormat as f, almostZero as N, roundNumber as h } from "../../helpers/numbers.js";
5
- const y = b(), S = ({
6
- currency: e = "USD",
7
- locale: s = y,
8
- shouldRemoveTrailingZeroes: i = !0,
9
- maximumFractionDigits: l = 2,
1
+ import e from "prop-types";
2
+ import i from "react";
3
+ import { isZeroDecimal as y, getSymbol as S } from "../../utils/currency.js";
4
+ import { numberFormat as f, almostZero as g, roundNumber as N } from "../../utils/numbers.js";
5
+ import { getDefaultLocale as R } from "../../utils/userLocale.js";
6
+ const a = ({
7
+ currency: r = "USD",
8
+ locale: s = R(),
9
+ shouldRemoveTrailingZeroes: l = !0,
10
+ maximumFractionDigits: u = 2,
10
11
  compact: n = !1,
11
- isNarrowSymbolForm: a,
12
- children: u
12
+ isNarrowSymbolForm: m,
13
+ children: c
13
14
  }) => {
14
- let t = u;
15
- N(t) && (t = 0);
16
- const c = d(e) ? 0 : l;
17
- let r = f(t, e, s, c, n, a);
18
- const m = t < 0;
19
- return m && (r = r.replace("-", "")), n ? /* @__PURE__ */ p("span", { className: "ui-currency", children: [
20
- m && "-",
21
- x(e, s, 0, a),
22
- r
23
- ] }) : (r = i ? r.replace(".00", "") : r, /* @__PURE__ */ p("span", { className: "ui-currency", children: [
24
- m && "-",
25
- r
26
- ] }));
27
- }, g = ({ currency: e = "USD", children: s }) => {
28
- const i = h(e, s);
29
- return /* @__PURE__ */ o("span", { className: "ui-currency-round", children: i });
15
+ let t = c;
16
+ g(t) && (t = 0);
17
+ const p = y(r) ? 0 : u;
18
+ let o = f(t, r, s, p, n);
19
+ const d = t < 0;
20
+ return d && (o = o.replace("-", "")), n ? /* @__PURE__ */ i.createElement("span", { className: "ui-currency" }, d && "-", S(r, s, m), o) : (o = l ? o.replace(".00", "") : o, /* @__PURE__ */ i.createElement("span", { className: "ui-currency" }, d && "-", o));
30
21
  };
31
- g.displayName = "Currency.Round";
32
- const D = ({ currency: e = "USD", locale: s = y, isNarrowSymbolForm: i, children: l }) => {
33
- let n = l;
34
- N(n) && (n = 0);
35
- const a = h(e, n).toString().split("."), u = a[0];
36
- let t = a[1] || "0";
22
+ a.propTypes = {
23
+ currency: e.string,
24
+ locale: e.string,
25
+ shouldRemoveTrailingZeroes: e.bool,
26
+ maximumFractionDigits: e.number,
27
+ children: e.node.isRequired
28
+ };
29
+ a.Round = ({ currency: r, children: s }) => {
30
+ const l = N(r, s);
31
+ return /* @__PURE__ */ i.createElement("span", { className: "ui-currency-round" }, l);
32
+ };
33
+ a.Round.displayName = "Currency.Round";
34
+ a.Round.propTypes = {
35
+ currency: e.string,
36
+ children: e.node.isRequired
37
+ };
38
+ a.Split = ({ currency: r = "USD", locale: s = R(), isNarrowSymbolForm: l, children: u }) => {
39
+ let n = u;
40
+ g(n) && (n = 0);
41
+ const m = N(r, n).toString().split("."), c = m[0];
42
+ let t = m[1] || "0";
37
43
  t.length === 1 && (t += "0");
38
- const c = f(Number(u), e, s, 0, !1, i);
39
- return /* @__PURE__ */ p("span", { title: n.toString(), className: "ui-currency-split", children: [
40
- /* @__PURE__ */ o("span", { className: "ui-currency-split-int", children: c }),
41
- !d(e) && /* @__PURE__ */ o("span", { className: "ui-currency-split-decimal pl-1", children: /* @__PURE__ */ o("sup", { children: t }) })
42
- ] });
44
+ const p = f(c, r, s, 0, l);
45
+ return /* @__PURE__ */ i.createElement("span", { title: n, className: "ui-currency-split" }, /* @__PURE__ */ i.createElement("span", { className: "ui-currency-split-int" }, p), !y(r) && /* @__PURE__ */ i.createElement("span", { className: "ui-currency-split-decimal pl-1" }, /* @__PURE__ */ i.createElement("sup", null, t)));
46
+ };
47
+ a.Split.displayName = "Currency.Split";
48
+ a.Split.propTypes = {
49
+ currency: e.string,
50
+ locale: e.string,
51
+ children: e.node.isRequired,
52
+ isNarrowSymbolForm: e.bool
43
53
  };
44
- D.displayName = "Currency.Split";
45
- S.Round = g;
46
- S.Split = D;
47
54
  export {
48
- S as Currency
55
+ a as Currency
49
56
  };
@@ -1,15 +1,17 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { getUserLocale as n } from "get-user-locale";
3
- import { numberFormat as a } from "../../helpers/numbers.js";
4
- const u = n(), i = ({
5
- locale: r = u,
6
- maximumFractionDigits: e = 2,
7
- isCompact: o = !1,
8
- children: m
9
- }) => {
10
- const t = a(m, null, r, e, o);
11
- return /* @__PURE__ */ s("span", { className: "ui-number", children: t });
1
+ import e from "prop-types";
2
+ import i from "react";
3
+ import { numberFormat as n } from "../../utils/numbers.js";
4
+ import { getDefaultLocale as p } from "../../utils/userLocale.js";
5
+ const s = ({ locale: r = p(), maximumFractionDigits: o = 2, isCompact: m = !1, children: t }) => {
6
+ const a = n(t, null, r, o, m);
7
+ return /* @__PURE__ */ i.createElement("span", { className: "ui-number" }, a);
8
+ };
9
+ s.propTypes = {
10
+ locale: e.string,
11
+ maximumFractionDigits: e.number,
12
+ isCompact: e.bool,
13
+ children: e.node.isRequired
12
14
  };
13
15
  export {
14
- i as Number
16
+ s as Number
15
17
  };
@@ -1,19 +1,25 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import r from "prop-types";
2
+ import s from "react";
2
3
  import a from "../../helpers/classnames.js";
3
- import { formatPhoneNumber as c, getRegionCode as s } from "../../helpers/phone.js";
4
- const g = ({ countryCode: o = "US", children: t, className: r }) => {
5
- const e = t.toString(), n = c(e, o), m = s(e, o);
6
- return /* @__PURE__ */ i(
4
+ import { formatPhoneNumber as c, getRegionCode as p } from "../../utils/phone.js";
5
+ const d = ({ countryCode: e = "US", className: t, children: n }) => {
6
+ const o = n, m = c(o, e), i = p(o, e);
7
+ return /* @__PURE__ */ s.createElement(
7
8
  "span",
8
9
  {
9
- className: a("ui-phone", r),
10
- "data-region-code": m ?? "N/A",
11
- "data-country-code": o,
12
- title: e,
13
- children: n
14
- }
10
+ className: a("ui-phone", t),
11
+ "data-region-code": i || "N/A",
12
+ "data-country-code": e,
13
+ title: o
14
+ },
15
+ m
15
16
  );
16
17
  };
18
+ d.propTypes = {
19
+ countryCode: r.string,
20
+ className: r.string,
21
+ children: r.node.isRequired
22
+ };
17
23
  export {
18
- g as Phone
24
+ d as Phone
19
25
  };
@@ -0,0 +1,10 @@
1
+ const e = () => {
2
+ try {
3
+ return process.env.NODE_ENV !== "production";
4
+ } catch {
5
+ return !0;
6
+ }
7
+ }, t = e();
8
+ export {
9
+ t as isDevelopment
10
+ };