@clubmed/trident-ui 1.2.0 → 1.3.0-beta.10

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 (227) hide show
  1. package/CHANGELOG.md +961 -860
  2. package/README.md +11 -1
  3. package/assets/style.css +1 -1
  4. package/atoms/Clickable/Clickable.d.ts +5 -0
  5. package/atoms/Clickable/Clickable.js +25 -0
  6. package/atoms/Clickable/Clickable.js.map +1 -0
  7. package/atoms/Heading/Heading.d.ts +6 -0
  8. package/atoms/Heading/Heading.js +14 -0
  9. package/atoms/Heading/Heading.js.map +1 -0
  10. package/atoms/Heading/HeadingGroup.d.ts +7 -0
  11. package/atoms/Heading/HeadingGroup.js +15 -0
  12. package/atoms/Heading/HeadingGroup.js.map +1 -0
  13. package/atoms/Image/Image.d.ts +7 -0
  14. package/atoms/Image/Image.js +18 -0
  15. package/atoms/Image/Image.js.map +1 -0
  16. package/atoms/Prose/Prose.d.ts +5 -0
  17. package/atoms/Prose/Prose.js +18 -0
  18. package/atoms/Prose/Prose.js.map +1 -0
  19. package/chunks/ResizeObserver.js +287 -0
  20. package/chunks/ResizeObserver.js.map +1 -0
  21. package/chunks/_commonjsHelpers.js +24 -4
  22. package/chunks/_commonjsHelpers.js.map +1 -1
  23. package/chunks/index.js.map +1 -1
  24. package/chunks/plugin.js +53 -0
  25. package/chunks/plugin.js.map +1 -0
  26. package/contexts/Device.d.ts +2 -22
  27. package/contexts/Device.js +5 -59
  28. package/contexts/Device.js.map +1 -1
  29. package/contexts/Devices/Device.d.ts +11 -0
  30. package/contexts/Devices/Device.js +23 -0
  31. package/contexts/Devices/Device.js.map +1 -0
  32. package/contexts/Devices/hooks/useQueries.d.ts +6 -0
  33. package/contexts/Devices/hooks/useQueries.js +24 -0
  34. package/contexts/Devices/hooks/useQueries.js.map +1 -0
  35. package/contexts/Devices/reducers/reducer.d.ts +25 -0
  36. package/contexts/Devices/reducers/reducer.js +50 -0
  37. package/contexts/Devices/reducers/reducer.js.map +1 -0
  38. package/contexts/TridentUIConfig.js +228 -228
  39. package/contexts/TridentUIConfig.js.map +1 -1
  40. package/helpers/colors/colors.d.ts +108 -0
  41. package/helpers/colors/colors.js +132 -0
  42. package/helpers/colors/colors.js.map +1 -0
  43. package/hooks/keyboard.constants.js.map +1 -1
  44. package/hooks/useInternalStatus.js.map +1 -1
  45. package/hooks/useKeyboardControls.js.map +1 -1
  46. package/hooks/useResizeObserver.d.ts +2 -0
  47. package/hooks/useResizeObserver.js +84 -0
  48. package/hooks/useResizeObserver.js.map +1 -0
  49. package/hooks/useSafeBoop.js.map +1 -1
  50. package/hooks/useValue.js.map +1 -1
  51. package/molecules/Arrows/Arrows.d.ts +16 -0
  52. package/molecules/Arrows/Arrows.js +66 -0
  53. package/molecules/Arrows/Arrows.js.map +1 -0
  54. package/molecules/Arrows/ArrowsLabels.d.js +2 -0
  55. package/molecules/Arrows/ArrowsLabels.d.js.map +1 -0
  56. package/molecules/Arrows.d.ts +1 -50
  57. package/molecules/Arrows.js +2 -56
  58. package/molecules/Arrows.js.map +1 -1
  59. package/molecules/Avatar.js.map +1 -1
  60. package/molecules/Backdrop.js.map +1 -1
  61. package/molecules/Breadcrumb.js +8 -9
  62. package/molecules/Breadcrumb.js.map +1 -1
  63. package/molecules/Buttons/ArrowButton.d.ts +7 -0
  64. package/molecules/Buttons/ArrowButton.js +14 -0
  65. package/molecules/Buttons/ArrowButton.js.map +1 -0
  66. package/molecules/Buttons/Button.d.ts +15 -32
  67. package/molecules/Buttons/Button.js +52 -42
  68. package/molecules/Buttons/Button.js.map +1 -1
  69. package/molecules/Buttons/ButtonAnchor.d.ts +7 -3
  70. package/molecules/Buttons/ButtonAnchor.js +17 -36
  71. package/molecules/Buttons/ButtonAnchor.js.map +1 -1
  72. package/molecules/Buttons/ButtonContent.d.ts +12 -4
  73. package/molecules/Buttons/ButtonContent.js +14 -8
  74. package/molecules/Buttons/ButtonContent.js.map +1 -1
  75. package/molecules/Buttons/FakeButton.d.ts +8 -0
  76. package/molecules/Buttons/FakeButton.js +8 -0
  77. package/molecules/Buttons/FakeButton.js.map +1 -0
  78. package/molecules/Buttons/InertButton.d.ts +4 -0
  79. package/molecules/Buttons/InertButton.js +15 -31
  80. package/molecules/Buttons/InertButton.js.map +1 -1
  81. package/molecules/Buttons/v2/Button.d.ts +2289 -0
  82. package/molecules/Buttons/v2/Button.js +57 -0
  83. package/molecules/Buttons/v2/Button.js.map +1 -0
  84. package/molecules/Buttons/v2/Button.type.d.ts +57 -0
  85. package/molecules/Buttons/v2/Button.type.js +45 -0
  86. package/molecules/Buttons/v2/Button.type.js.map +1 -0
  87. package/molecules/Card.d.ts +1 -11
  88. package/molecules/Card.js +2 -35
  89. package/molecules/Card.js.map +1 -1
  90. package/molecules/Cards/Card.d.ts +13 -0
  91. package/molecules/Cards/Card.js +22 -0
  92. package/molecules/Cards/Card.js.map +1 -0
  93. package/molecules/Cards/CardAspectRatios.d.ts +6 -0
  94. package/molecules/Cards/CardAspectRatios.js +10 -0
  95. package/molecules/Cards/CardAspectRatios.js.map +1 -0
  96. package/molecules/Cards/CardBackground.d.ts +4 -0
  97. package/molecules/Cards/CardBackground.js +30 -0
  98. package/molecules/Cards/CardBackground.js.map +1 -0
  99. package/molecules/Cards/CardBackgroundContext.d.ts +6 -0
  100. package/molecules/Cards/CardBackgroundContext.js +10 -0
  101. package/molecules/Cards/CardBackgroundContext.js.map +1 -0
  102. package/molecules/Cards/CardClickable.d.ts +6 -0
  103. package/molecules/Cards/CardClickable.js +37 -0
  104. package/molecules/Cards/CardClickable.js.map +1 -0
  105. package/molecules/Cards/ExpandableCard.d.ts +14 -0
  106. package/molecules/Cards/ExpandableCard.js +80 -0
  107. package/molecules/Cards/ExpandableCard.js.map +1 -0
  108. package/molecules/Cards/v2/Card.d.ts +15 -0
  109. package/molecules/Cards/v2/Card.js +34 -0
  110. package/molecules/Cards/v2/Card.js.map +1 -0
  111. package/molecules/Chip.d.ts +9 -0
  112. package/molecules/Chip.js +31 -0
  113. package/molecules/Chip.js.map +1 -0
  114. package/molecules/Chip.themes.d.ts +12 -0
  115. package/molecules/Chip.themes.js +24 -0
  116. package/molecules/Chip.themes.js.map +1 -0
  117. package/molecules/ElasticHeight.d.ts +6 -27
  118. package/molecules/ElasticHeight.js +28 -33
  119. package/molecules/ElasticHeight.js.map +1 -1
  120. package/molecules/Forms/Checkboxes/Checkbox.js +12 -13
  121. package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
  122. package/molecules/Forms/Checkboxes/Checkboxes.js.map +1 -1
  123. package/molecules/Forms/DateField.d.ts +1 -1
  124. package/molecules/Forms/DateField.js +142 -116
  125. package/molecules/Forms/DateField.js.map +1 -1
  126. package/molecules/Forms/Filter.js +12 -13
  127. package/molecules/Forms/Filter.js.map +1 -1
  128. package/molecules/Forms/FormControl.js +15 -16
  129. package/molecules/Forms/FormControl.js.map +1 -1
  130. package/molecules/Forms/FormLabel.js.map +1 -1
  131. package/molecules/Forms/NumberField.d.ts +29 -29
  132. package/molecules/Forms/NumberField.js +68 -68
  133. package/molecules/Forms/NumberField.js.map +1 -1
  134. package/molecules/Forms/Password/Password.js +10 -11
  135. package/molecules/Forms/Password/Password.js.map +1 -1
  136. package/molecules/Forms/Password/ValidationMessage.js +8 -9
  137. package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
  138. package/molecules/Forms/Radios/Radio.js.map +1 -1
  139. package/molecules/Forms/Radios/RadioGroup.js +2 -2
  140. package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
  141. package/molecules/Forms/Range.js +124 -406
  142. package/molecules/Forms/Range.js.map +1 -1
  143. package/molecules/Forms/Select.d.ts +1 -1
  144. package/molecules/Forms/Select.js +3 -4
  145. package/molecules/Forms/Select.js.map +1 -1
  146. package/molecules/Forms/Switch.js.map +1 -1
  147. package/molecules/Forms/TextField.d.ts +1 -1
  148. package/molecules/Forms/TextField.js +7 -8
  149. package/molecules/Forms/TextField.js.map +1 -1
  150. package/molecules/HamburgerIcon.js.map +1 -1
  151. package/molecules/Link.d.ts +1 -1
  152. package/molecules/Link.js +8 -9
  153. package/molecules/Link.js.map +1 -1
  154. package/molecules/Loader.js.map +1 -1
  155. package/molecules/Pagination.d.ts +38 -0
  156. package/molecules/Pagination.helper.d.ts +48 -0
  157. package/molecules/Pagination.helper.js +30 -0
  158. package/molecules/Pagination.helper.js.map +1 -0
  159. package/molecules/Pagination.js +154 -0
  160. package/molecules/Pagination.js.map +1 -0
  161. package/molecules/Popin.js +16 -16
  162. package/molecules/Popin.js.map +1 -1
  163. package/molecules/Spinner.js.map +1 -1
  164. package/molecules/Tabs/Tab.d.ts +1 -1
  165. package/molecules/Tabs/Tab.js +51 -49
  166. package/molecules/Tabs/Tab.js.map +1 -1
  167. package/molecules/Tabs/TabList.js.map +1 -1
  168. package/molecules/Tabs/TabPanel.js +31 -29
  169. package/molecules/Tabs/TabPanel.js.map +1 -1
  170. package/molecules/Tabs/Tabs.js +7 -9
  171. package/molecules/Tabs/Tabs.js.map +1 -1
  172. package/molecules/Tabs/TabsBody.js.map +1 -1
  173. package/molecules/Tabs/context/TabControl.d.ts +29 -27
  174. package/molecules/Tabs/context/TabControl.js +67 -66
  175. package/molecules/Tabs/context/TabControl.js.map +1 -1
  176. package/molecules/Tabs/hooks/tabControl.d.ts +25 -14
  177. package/molecules/Tabs/hooks/tabControl.js +26 -23
  178. package/molecules/Tabs/hooks/tabControl.js.map +1 -1
  179. package/molecules/Tabs/theme.js.map +1 -1
  180. package/molecules/Tag.d.ts +43 -0
  181. package/molecules/Tag.js +73 -0
  182. package/molecules/Tag.js.map +1 -0
  183. package/package.json +29 -5
  184. package/styles/globals.css +16 -15
  185. package/tailwind/colors.d.ts +38 -0
  186. package/tailwind/colors.js +44 -0
  187. package/tailwind/colors.js.map +1 -0
  188. package/tailwind/plugins/animationDelay.d.ts +4 -0
  189. package/tailwind/plugins/animationDelay.js +15 -0
  190. package/tailwind/plugins/animationDelay.js.map +1 -0
  191. package/tailwind/plugins/hocus.d.ts +4 -0
  192. package/tailwind/plugins/hocus.js +11 -0
  193. package/tailwind/plugins/hocus.js.map +1 -0
  194. package/tailwind/plugins/lineClampFix.d.ts +4 -0
  195. package/tailwind/plugins/lineClampFix.js +13 -0
  196. package/tailwind/plugins/lineClampFix.js.map +1 -0
  197. package/tailwind/plugins/popover.d.ts +4 -0
  198. package/tailwind/plugins/popover.js +8 -0
  199. package/tailwind/plugins/popover.js.map +1 -0
  200. package/tailwind/plugins/startingStyle.d.ts +4 -0
  201. package/tailwind/plugins/startingStyle.js +8 -0
  202. package/tailwind/plugins/startingStyle.js.map +1 -0
  203. package/tailwind/plugins/transitionBehavior.d.ts +4 -0
  204. package/tailwind/plugins/transitionBehavior.js +11 -0
  205. package/tailwind/plugins/transitionBehavior.js.map +1 -0
  206. package/tailwind/tailwind.preset.d.ts +733 -510
  207. package/tailwind/tailwind.preset.js +706 -629
  208. package/tailwind/tailwind.preset.js.map +1 -1
  209. package/types/Colors.d.js +2 -0
  210. package/types/Colors.d.js.map +1 -0
  211. package/types/Devices.d.ts +8 -0
  212. package/types/Devices.js +11 -0
  213. package/types/Devices.js.map +1 -0
  214. package/types/Direction.d.js +2 -0
  215. package/types/Direction.d.js.map +1 -0
  216. package/types/LiteralUnion.d.js +2 -0
  217. package/types/LiteralUnion.d.js.map +1 -0
  218. package/types/ScrollerLabels.d.js +2 -0
  219. package/types/ScrollerLabels.d.js.map +1 -0
  220. package/types/Theme.d.js +2 -0
  221. package/types/Theme.d.js.map +1 -0
  222. package/molecules/Buttons/Button.helpers.d.ts +0 -7
  223. package/molecules/Buttons/Button.helpers.js +0 -11
  224. package/molecules/Buttons/Button.helpers.js.map +0 -1
  225. package/molecules/Buttons/Button.themes.d.ts +0 -1
  226. package/molecules/Buttons/Button.themes.js +0 -25
  227. package/molecules/Buttons/Button.themes.js.map +0 -1
@@ -0,0 +1,31 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { c as m } from "../chunks/index.js";
3
+ import { getTheme as c } from "./Chip.themes.js";
4
+ const f = ({
5
+ className: e,
6
+ color: s = "sienna",
7
+ size: r = "size-32",
8
+ theme: o = "solid",
9
+ children: t,
10
+ ...n
11
+ }) => {
12
+ const { thRoot: i } = c(o, { color: s });
13
+ return /* @__PURE__ */ a(
14
+ "span",
15
+ {
16
+ ...n,
17
+ className: m(
18
+ "inline-flex aspect-square shrink-0 items-center justify-center overflow-hidden rounded-full border",
19
+ r,
20
+ i,
21
+ e
22
+ ),
23
+ "data-name": "Chip",
24
+ children: t
25
+ }
26
+ );
27
+ };
28
+ export {
29
+ f as Chip
30
+ };
31
+ //# sourceMappingURL=Chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chip.js","sources":["../../lib/molecules/Chip.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { getTheme, type Theme } from './Chip.themes';\n\nimport type { Colors } from '@/types/Colors';\n\nexport interface ChipProps extends ComponentPropsWithoutRef<'span'> {\n color?: Colors;\n size?: string;\n theme?: Theme;\n}\n\nexport const Chip = ({\n className,\n color = 'sienna',\n size = 'size-32',\n theme = 'solid',\n children,\n ...attrs\n}: ChipProps) => {\n const { thRoot } = getTheme(theme, { color });\n\n return (\n <span\n {...attrs}\n className={classNames(\n 'inline-flex aspect-square shrink-0 items-center justify-center overflow-hidden rounded-full border',\n size,\n thRoot,\n className,\n )}\n data-name=\"Chip\"\n >\n {children}\n </span>\n );\n};\n"],"names":["Chip","className","color","size","theme","children","attrs","thRoot","getTheme","jsx","classNames"],"mappings":";;;AAaO,MAAMA,IAAO,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,GAAGC;AACL,MAAiB;AACf,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAASJ,GAAO,EAAE,OAAAF,GAAO;AAE5C,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGH;AAAA,MACJ,WAAWI;AAAAA,QACT;AAAA,QACAP;AAAA,QACAI;AAAA,QACAN;AAAA,MAAA;AAAA,MAEF,aAAU;AAAA,MAET,UAAAI;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -0,0 +1,12 @@
1
+ import type { Colors } from '../types/Colors';
2
+ export type Theme = 'solid' | 'outline' | 'light' | 'dark';
3
+ type Options = {
4
+ color: Colors;
5
+ };
6
+ export declare const themes: (color: Colors) => Record<Theme, {
7
+ thRoot: string;
8
+ }>;
9
+ export declare const getTheme: (theme: Theme, { color }: Options) => {
10
+ thRoot: string;
11
+ };
12
+ export {};
@@ -0,0 +1,24 @@
1
+ import { c as e } from "../chunks/index.js";
2
+ import { getBorderColor as r, getTextColor as n, getBgColor as g, getComplementaryTextColor as i } from "../helpers/colors/colors.js";
3
+ const l = (t) => ({
4
+ solid: {
5
+ thRoot: e(g(t), r(t), i(t))
6
+ },
7
+ outline: {
8
+ thRoot: e("bg-transparent", r(t), n(t))
9
+ },
10
+ light: {
11
+ thRoot: e("bg-lightSand text-black border-lightSand")
12
+ },
13
+ dark: {
14
+ thRoot: e("bg-ultramarine text-white border-ultramarine")
15
+ }
16
+ }), h = (t, { color: a }) => {
17
+ const o = l(a);
18
+ return o[t] || o.solid;
19
+ };
20
+ export {
21
+ h as getTheme,
22
+ l as themes
23
+ };
24
+ //# sourceMappingURL=Chip.themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chip.themes.js","sources":["../../lib/molecules/Chip.themes.ts"],"sourcesContent":["import classnames from 'classnames';\nimport type { Colors } from '@/types/Colors';\nimport {\n getBgColor,\n getBorderColor,\n getComplementaryTextColor,\n getTextColor,\n} from '@/helpers/colors/colors';\n\nexport type Theme = 'solid' | 'outline' | 'light' | 'dark';\n\ntype Options = { color: Colors };\n\nexport const themes = (color: Colors): Record<Theme, { thRoot: string }> => ({\n solid: {\n thRoot: classnames(getBgColor(color), getBorderColor(color), getComplementaryTextColor(color)),\n },\n outline: {\n thRoot: classnames('bg-transparent', getBorderColor(color), getTextColor(color)),\n },\n light: {\n thRoot: classnames('bg-lightSand text-black border-lightSand'),\n },\n dark: {\n thRoot: classnames('bg-ultramarine text-white border-ultramarine'),\n },\n});\n\nexport const getTheme = (theme: Theme, { color }: Options) => {\n const THEMES = themes(color);\n\n return THEMES[theme] || THEMES.solid;\n};\n"],"names":["themes","color","classnames","getBgColor","getBorderColor","getComplementaryTextColor","getTextColor","getTheme","theme","THEMES"],"mappings":";;AAaO,MAAMA,IAAS,CAACC,OAAsD;AAAA,EAC3E,OAAO;AAAA,IACL,QAAQC,EAAWC,EAAWF,CAAK,GAAGG,EAAeH,CAAK,GAAGI,EAA0BJ,CAAK,CAAC;AAAA,EAAA;AAAA,EAE/F,SAAS;AAAA,IACP,QAAQC,EAAW,kBAAkBE,EAAeH,CAAK,GAAGK,EAAaL,CAAK,CAAC;AAAA,EAAA;AAAA,EAEjF,OAAO;AAAA,IACL,QAAQC,EAAW,0CAA0C;AAAA,EAAA;AAAA,EAE/D,MAAM;AAAA,IACJ,QAAQA,EAAW,8CAA8C;AAAA,EAAA;AAErE,IAEaK,IAAW,CAACC,GAAc,EAAE,OAAAP,QAAqB;AAC5D,QAAMQ,IAAST,EAAOC,CAAK;AAE3B,SAAOQ,EAAOD,CAAK,KAAKC,EAAO;AACjC;"}
@@ -1,29 +1,8 @@
1
- import { type FunctionComponent, type PropsWithChildren } from 'react';
2
- /**
3
- * This is not a Collapse component, it's a component that animates *to* the height of its children.
4
- * It does the *absolute* same but you Bring Your Own Height™ by applying a class to the children.
5
- * e.g.: <ElasticHeight className={isOpen ? "" : "h-0"}><div>...</div></ElasticHeight>
6
- * ID is there for accessibility purposes.
7
- *
8
- * This is in no way affiliated with Amazon ElasticSearch.
9
- */
10
- interface ElasticHeightProps {
11
- /**
12
- * Id of the element
13
- */
14
- id?: string;
15
- /**
16
- * Class of the element (please provide something that sets the height)
17
- */
18
- className?: string;
19
- /**
20
- * Class of the container (to avoid CLS, mainly)
21
- */
22
- containerClassName?: string;
23
- /**
24
- * Role of the element
25
- */
26
- role?: string;
1
+ import { type ComponentPropsWithoutRef, type FunctionComponent } from 'react';
2
+ interface ElasticHeightProps extends ComponentPropsWithoutRef<'div'> {
3
+ innerClassName?: string;
4
+ isExpanded?: boolean;
5
+ min?: number;
27
6
  }
28
- export declare const ElasticHeight: FunctionComponent<PropsWithChildren<ElasticHeightProps>>;
7
+ export declare const ElasticHeight: FunctionComponent<ElasticHeightProps>;
29
8
  export {};
@@ -1,38 +1,33 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { useResize as l, useSpring as h, animated as p } from "@react-spring/web";
3
- import { c as d } from "../chunks/index.js";
4
- import { useRef as u, useEffect as g } from "react";
5
- const r = (t) => t, R = ({
6
- children: t,
7
- id: n,
8
- className: a,
9
- role: c,
10
- containerClassName: m
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { c as l } from "../chunks/index.js";
4
+ import { useRef as m, useState as d, useLayoutEffect as h } from "react";
5
+ import p from "../hooks/useResizeObserver.js";
6
+ const R = ({
7
+ className: o,
8
+ children: a,
9
+ innerClassName: n,
10
+ isExpanded: t = !1,
11
+ min: f = 0,
12
+ ...c
11
13
  }) => {
12
- const i = u(null), { height: e } = l({ container: i }), [f, o] = h(() => ({
13
- from: {
14
- height: e.to(r)
15
- },
16
- immediate: !0
17
- }));
18
- return g(() => {
19
- o.start({
20
- to: {
21
- height: e.to(r)
22
- },
23
- config: {
24
- tension: 170,
25
- friction: 26
26
- }
27
- });
28
- }, [o, e]), /* @__PURE__ */ s(
29
- p.div,
14
+ const e = m(null), [u, r] = d(0);
15
+ return p({
16
+ ref: e,
17
+ onResize: () => {
18
+ var s;
19
+ e.current && r((s = e.current) == null ? void 0 : s.offsetHeight);
20
+ }
21
+ }), h(() => {
22
+ e.current && r(e.current.offsetHeight);
23
+ }, [e]), /* @__PURE__ */ i(
24
+ "div",
30
25
  {
31
- role: c,
32
- className: d("overflow-hidden", m),
33
- style: { ...f },
34
- id: n,
35
- children: /* @__PURE__ */ s("div", { className: a, ref: i, children: t })
26
+ ...c,
27
+ className: l("overflow-hidden transition-all duration-500", o),
28
+ "data-expanded": t,
29
+ style: { height: t ? u : f },
30
+ children: /* @__PURE__ */ i("div", { className: n, ref: e, children: a })
36
31
  }
37
32
  );
38
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ElasticHeight.js","sources":["../../lib/molecules/ElasticHeight.tsx"],"sourcesContent":["import { useSpring, animated, useResize } from '@react-spring/web';\nimport classnames from 'classnames';\nimport {\n type FunctionComponent,\n type MutableRefObject,\n type PropsWithChildren,\n useEffect,\n useRef,\n} from 'react';\n\n/**\n * This is not a Collapse component, it's a component that animates *to* the height of its children.\n * It does the *absolute* same but you Bring Your Own Height™ by applying a class to the children.\n * e.g.: <ElasticHeight className={isOpen ? \"\" : \"h-0\"}><div>...</div></ElasticHeight>\n * ID is there for accessibility purposes.\n *\n * This is in no way affiliated with Amazon ElasticSearch.\n */\n\ninterface ElasticHeightProps {\n /**\n * Id of the element\n */\n id?: string;\n /**\n * Class of the element (please provide something that sets the height)\n */\n className?: string;\n /**\n * Class of the container (to avoid CLS, mainly)\n */\n containerClassName?: string;\n /**\n * Role of the element\n */\n role?: string;\n}\n\nconst linearInterpolation = (x: number) => x;\n\nexport const ElasticHeight: FunctionComponent<PropsWithChildren<ElasticHeightProps>> = ({\n children,\n id,\n className,\n role,\n containerClassName,\n}) => {\n const ref = useRef<HTMLDivElement>(null) as MutableRefObject<HTMLDivElement>;\n const { height } = useResize({ container: ref });\n\n const [styles, api] = useSpring(() => ({\n from: {\n height: height.to(linearInterpolation),\n },\n immediate: true,\n }));\n\n useEffect(() => {\n api.start({\n to: {\n height: height.to(linearInterpolation),\n },\n config: {\n tension: 170,\n friction: 26,\n },\n });\n }, [api, height]);\n\n return (\n <animated.div\n role={role}\n className={classnames('overflow-hidden', containerClassName)}\n style={{ ...styles }}\n id={id}\n >\n <div className={className} ref={ref}>\n {children}\n </div>\n </animated.div>\n );\n};\n"],"names":["linearInterpolation","x","ElasticHeight","children","id","className","role","containerClassName","ref","useRef","height","useResize","styles","api","useSpring","useEffect","jsx","animated","classnames"],"mappings":";;;;AAsCA,MAAMA,IAAsB,CAACC,MAAcA,GAE9BC,IAA0E,CAAC;AAAA,EACtF,UAAAC;AAAA,EACA,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,oBAAAC;AACF,MAAM;AACE,QAAAC,IAAMC,EAAuB,IAAI,GACjC,EAAE,QAAAC,EAAO,IAAIC,EAAU,EAAE,WAAWH,GAAK,GAEzC,CAACI,GAAQC,CAAG,IAAIC,EAAU,OAAO;AAAA,IACrC,MAAM;AAAA,MACJ,QAAQJ,EAAO,GAAGV,CAAmB;AAAA,IACvC;AAAA,IACA,WAAW;AAAA,EACX,EAAA;AAEF,SAAAe,EAAU,MAAM;AACd,IAAAF,EAAI,MAAM;AAAA,MACR,IAAI;AAAA,QACF,QAAQH,EAAO,GAAGV,CAAmB;AAAA,MACvC;AAAA,MACA,QAAQ;AAAA,QACN,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IAAA,CACD;AAAA,EAAA,GACA,CAACa,GAAKH,CAAM,CAAC,GAGd,gBAAAM;AAAA,IAACC,EAAS;AAAA,IAAT;AAAA,MACC,MAAAX;AAAA,MACA,WAAWY,EAAW,mBAAmBX,CAAkB;AAAA,MAC3D,OAAO,EAAE,GAAGK,EAAO;AAAA,MACnB,IAAAR;AAAA,MAEA,UAAC,gBAAAY,EAAA,OAAA,EAAI,WAAAX,GAAsB,KAAAG,GACxB,UAAAL,GACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ElasticHeight.js","sources":["../../lib/molecules/ElasticHeight.tsx"],"sourcesContent":["'use client';\n\nimport classnames from 'classnames';\nimport {\n type ComponentPropsWithoutRef,\n type FunctionComponent,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport useResizeObserver from '@/hooks/useResizeObserver';\n\ninterface ElasticHeightProps extends ComponentPropsWithoutRef<'div'> {\n innerClassName?: string;\n isExpanded?: boolean;\n min?: number;\n}\n\nexport const ElasticHeight: FunctionComponent<ElasticHeightProps> = ({\n className,\n children,\n innerClassName,\n isExpanded = false,\n min = 0,\n ...attrs\n}) => {\n const ref = useRef<HTMLDivElement>(null as any);\n const [max, setMax] = useState(0);\n\n useResizeObserver<HTMLDivElement>({\n ref: ref,\n onResize: () => {\n if (ref.current) {\n setMax(ref.current?.offsetHeight);\n }\n },\n });\n\n useLayoutEffect(() => {\n if (!ref.current) {\n return;\n }\n setMax(ref.current.offsetHeight);\n }, [ref]);\n\n return (\n <div\n {...attrs}\n className={classnames('overflow-hidden transition-all duration-500', className)}\n data-expanded={isExpanded}\n style={{ height: isExpanded ? max : min }}\n >\n <div className={innerClassName} ref={ref}>\n {children}\n </div>\n </div>\n );\n};\n"],"names":["ElasticHeight","className","children","innerClassName","isExpanded","min","attrs","ref","useRef","max","setMax","useState","useResizeObserver","_a","useLayoutEffect","jsx","classnames"],"mappings":";;;;;AAkBO,MAAMA,IAAuD,CAAC;AAAA,EACnE,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,KAAAC,IAAM;AAAA,EACN,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAMC,EAAuB,IAAW,GACxC,CAACC,GAAKC,CAAM,IAAIC,EAAS,CAAC;AAEhC,SAAAC,EAAkC;AAAA,IAChC,KAAAL;AAAA,IACA,UAAU,MAAM;;AACd,MAAIA,EAAI,WACNG,GAAOG,IAAAN,EAAI,YAAJ,gBAAAM,EAAa,YAAY;AAAA,IAEpC;AAAA,EAAA,CACD,GAEDC,EAAgB,MAAM;AACpB,IAAKP,EAAI,WAGTG,EAAOH,EAAI,QAAQ,YAAY;AAAA,EACjC,GAAG,CAACA,CAAG,CAAC,GAGN,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGT;AAAA,MACJ,WAAWU,EAAW,+CAA+Cf,CAAS;AAAA,MAC9E,iBAAeG;AAAA,MACf,OAAO,EAAE,QAAQA,IAAaK,IAAMJ,EAAA;AAAA,MAEpC,UAAA,gBAAAU,EAAC,OAAA,EAAI,WAAWZ,GAAgB,KAAAI,GAC7B,UAAAL,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,12 +1,11 @@
1
1
  import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
- import { c } from "../../../chunks/index.js";
2
+ import { c as o } from "../../../chunks/index.js";
3
3
  import { useId as D } from "react";
4
- import { Icon as h } from "../../../atoms/Icons/Icon.js";
5
- import "@clubmed/trident-icons";
6
4
  import { useValue as S } from "../../../hooks/useValue.js";
7
5
  /* empty css */
8
6
  import { useInternalStatus as V } from "../../../hooks/useInternalStatus.js";
9
- function B(u) {
7
+ import { Icon as p } from "@clubmed/trident-icons";
8
+ function A(u) {
10
9
  const x = D(), {
11
10
  id: s = x,
12
11
  name: n = s,
@@ -20,13 +19,13 @@ function B(u) {
20
19
  validationStatus: N = "default",
21
20
  errorMessage: d,
22
21
  children: g,
23
- onChange: o,
22
+ onChange: c,
24
23
  ...y
25
24
  } = u, { value: m, setValue: I } = S({
26
25
  name: n,
27
26
  initialValue: k,
28
- onChange(w, p) {
29
- o == null || o(w, p ? l !== void 0 ? l : p : null);
27
+ onChange(w, h) {
28
+ c == null || c(w, h ? l !== void 0 ? l : h : null);
30
29
  }
31
30
  }), e = V({
32
31
  isDisabled: r,
@@ -35,13 +34,13 @@ function B(u) {
35
34
  return /* @__PURE__ */ t(
36
35
  "div",
37
36
  {
38
- className: c("flex flex-col space-y-2", f),
37
+ className: o("flex flex-col space-y-2", f),
39
38
  "data-testid": `checkbox-container-${s}`,
40
39
  children: [
41
40
  /* @__PURE__ */ t(
42
41
  "label",
43
42
  {
44
- className: c("cursor-pointer relative flex text-b3 items-center", {
43
+ className: o("cursor-pointer relative flex text-b3 items-center", {
45
44
  "text-grey": e === "disabled",
46
45
  "text-black": e !== "default"
47
46
  }),
@@ -68,10 +67,10 @@ function B(u) {
68
67
  "span",
69
68
  {
70
69
  style: { height: i, width: i },
71
- className: c({ "!border-red": e === "error" }),
70
+ className: o({ "!border-red": e === "error" }),
72
71
  "data-testid": `check-container-${s}`,
73
72
  children: /* @__PURE__ */ a(
74
- h,
73
+ p,
75
74
  {
76
75
  name: "CheckDefault",
77
76
  type: "svg",
@@ -88,7 +87,7 @@ function B(u) {
88
87
  }
89
88
  ),
90
89
  C && /* @__PURE__ */ t("span", { className: "text-red text-b4 flex items-start space-x-4 ps-20", role: "alert", children: [
91
- /* @__PURE__ */ a(h, { name: "Error", width: "20px" }),
90
+ /* @__PURE__ */ a(p, { name: "Error", width: "20px" }),
92
91
  d
93
92
  ] })
94
93
  ]
@@ -96,6 +95,6 @@ function B(u) {
96
95
  );
97
96
  }
98
97
  export {
99
- B as Checkbox
98
+ A as Checkbox
100
99
  };
101
100
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../../lib/molecules/Forms/Checkboxes/Checkbox.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useId } from 'react';\nimport { Icon } from '@/atoms/Icons/index.js';\nimport { useValue } from '@/hooks/useValue.js';\nimport '../controls.css';\nimport type { FormControlProps } from '@/molecules/Forms/FormControl';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\n\nexport interface CheckboxProps<Value = string> extends FormControlProps<Value> {\n size?: number;\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Checkbox<Value = string>(props: CheckboxProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled = false,\n checked: initialChecked = false,\n value,\n size = 24,\n tabIndex = 0,\n validationStatus = 'default',\n errorMessage,\n children,\n onChange,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col space-y-2', className)}\n data-testid={`checkbox-container-${id}`}\n >\n <label\n className={classnames('cursor-pointer relative flex text-b3 items-center', {\n 'text-grey': internalStatus === 'disabled',\n 'text-black': internalStatus !== 'default',\n })}\n >\n <span className=\"relative self-start me-8\">\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Checkbox\"\n disabled={disabled}\n value={value as any}\n />\n\n <span\n style={{ height: size, width: size }}\n className={classnames({ '!border-red': internalStatus === 'error' })}\n data-testid={`check-container-${id}`}\n >\n <Icon\n name=\"CheckDefault\"\n type=\"svg\"\n width={`${size}px`}\n color=\"black\"\n className=\"absolute\"\n />\n </span>\n </span>\n\n {children}\n </label>\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start space-x-4 ps-20\" role=\"alert\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n}\n"],"names":["Checkbox","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","size","tabIndex","validationStatus","errorMessage","children","onChange","rest","checked","setValue","useValue","internalStatus","useInternalStatus","shouldDisplayErrorMessage","jsxs","classnames","jsx","Icon"],"mappings":";;;;;;;;AAaO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAhB,GAEE,EAAE,OAAOiB,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAf;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMa,GAAS;AACtB,MAAAF,KAAA,QAAAA,EAAWX,GAAMa,IAAYR,MAAU,SAAYA,IAAQQ,IAAqB;AAAA,IAClF;AAAA,EAAA,CACD,GACKG,IAAiBC,EAAkB;AAAA,IACvC,YAAYd;AAAA,IACZ,kBAAAK;AAAA,EAAA,CACD,GAEKU,IAA4BF,MAAmB,WAAWP;AAG9D,SAAA,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,2BAA2BnB,CAAS;AAAA,MAC1D,eAAa,sBAAsBF,CAAE;AAAA,MAErC,UAAA;AAAA,QAAA,gBAAAoB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC,EAAW,qDAAqD;AAAA,cACzE,aAAaJ,MAAmB;AAAA,cAChC,cAAcA,MAAmB;AAAA,YAAA,CAClC;AAAA,YAED,UAAA;AAAA,cAAC,gBAAAG,EAAA,QAAA,EAAK,WAAU,4BACd,UAAA;AAAA,gBAAA,gBAAAE;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACE,GAAGT;AAAA,oBACJ,MAAAZ;AAAA,oBACA,eAAaE;AAAA,oBACb,MAAK;AAAA,oBACL,UAAAK;AAAA,oBACA,UAAU,MAAM;AACb,uBAAAJ,KAAYW,EAAS,CAACD,CAAO;AAAA,oBAChC;AAAA,oBACA,SAAAA;AAAA,oBACA,aAAU;AAAA,oBACV,UAAAV;AAAA,oBACA,OAAAE;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAEA,gBAAAgB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,OAAO,EAAE,QAAQf,GAAM,OAAOA,EAAK;AAAA,oBACnC,WAAWc,EAAW,EAAE,eAAeJ,MAAmB,SAAS;AAAA,oBACnE,eAAa,mBAAmBjB,CAAE;AAAA,oBAElC,UAAA,gBAAAsB;AAAA,sBAACC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,MAAK;AAAA,wBACL,OAAO,GAAGhB,CAAI;AAAA,wBACd,OAAM;AAAA,wBACN,WAAU;AAAA,sBAAA;AAAA,oBACZ;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA,GACF;AAAA,cAECI;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,QAECQ,KACE,gBAAAC,EAAA,QAAA,EAAK,WAAU,qDAAoD,MAAK,SACvE,UAAA;AAAA,UAAA,gBAAAE,EAACC,GAAK,EAAA,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/Bb;AAAA,QAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../../lib/molecules/Forms/Checkboxes/Checkbox.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useId } from 'react';\nimport { useValue } from '@/hooks/useValue.js';\nimport '../controls.css';\nimport type { FormControlProps } from '@/molecules/Forms/FormControl';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { Icon } from '@clubmed/trident-icons';\n\nexport interface CheckboxProps<Value = string> extends FormControlProps<Value> {\n size?: number;\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Checkbox<Value = string>(props: CheckboxProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled = false,\n checked: initialChecked = false,\n value,\n size = 24,\n tabIndex = 0,\n validationStatus = 'default',\n errorMessage,\n children,\n onChange,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col space-y-2', className)}\n data-testid={`checkbox-container-${id}`}\n >\n <label\n className={classnames('cursor-pointer relative flex text-b3 items-center', {\n 'text-grey': internalStatus === 'disabled',\n 'text-black': internalStatus !== 'default',\n })}\n >\n <span className=\"relative self-start me-8\">\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Checkbox\"\n disabled={disabled}\n value={value as any}\n />\n\n <span\n style={{ height: size, width: size }}\n className={classnames({ '!border-red': internalStatus === 'error' })}\n data-testid={`check-container-${id}`}\n >\n <Icon\n name=\"CheckDefault\"\n type=\"svg\"\n width={`${size}px`}\n color=\"black\"\n className=\"absolute\"\n />\n </span>\n </span>\n\n {children}\n </label>\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start space-x-4 ps-20\" role=\"alert\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n}\n"],"names":["Checkbox","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","size","tabIndex","validationStatus","errorMessage","children","onChange","rest","checked","setValue","useValue","internalStatus","useInternalStatus","shouldDisplayErrorMessage","jsxs","classnames","jsx","Icon"],"mappings":";;;;;;;AAaO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDhB,GAEE,EAAE,OAAOiB,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAf;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMa,GAAS;AACtB,MAAAF,KAAA,QAAAA,EAAWX,GAAMa,IAAYR,MAAU,SAAYA,IAAQQ,IAAqB;AAAA,IAClF;AAAA,EAAA,CACD,GACKG,IAAiBC,EAAkB;AAAA,IACvC,YAAYd;AAAA,IACZ,kBAAAK;AAAA,EAAA,CACD,GAEKU,IAA4BF,MAAmB,WAAWP;AAEhE,SACE,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,2BAA2BnB,CAAS;AAAA,MAC1D,eAAa,sBAAsBF,CAAE;AAAA,MAErC,UAAA;AAAA,QAAA,gBAAAoB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC,EAAW,qDAAqD;AAAA,cACzE,aAAaJ,MAAmB;AAAA,cAChC,cAAcA,MAAmB;AAAA,YAAA,CAClC;AAAA,YAED,UAAA;AAAA,cAAA,gBAAAG,EAAC,QAAA,EAAK,WAAU,4BACd,UAAA;AAAA,gBAAA,gBAAAE;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACE,GAAGT;AAAA,oBACJ,MAAAZ;AAAA,oBACA,eAAaE;AAAA,oBACb,MAAK;AAAA,oBACL,UAAAK;AAAA,oBACA,UAAU,MAAM;AACd,uBAACJ,KAAYW,EAAS,CAACD,CAAO;AAAA,oBAChC;AAAA,oBACA,SAAAA;AAAA,oBACA,aAAU;AAAA,oBACV,UAAAV;AAAA,oBACA,OAAAE;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGF,gBAAAgB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,OAAO,EAAE,QAAQf,GAAM,OAAOA,EAAA;AAAA,oBAC9B,WAAWc,EAAW,EAAE,eAAeJ,MAAmB,SAAS;AAAA,oBACnE,eAAa,mBAAmBjB,CAAE;AAAA,oBAElC,UAAA,gBAAAsB;AAAA,sBAACC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,MAAK;AAAA,wBACL,OAAO,GAAGhB,CAAI;AAAA,wBACd,OAAM;AAAA,wBACN,WAAU;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACZ;AAAA,gBAAA;AAAA,cACF,GACF;AAAA,cAECI;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGFQ,KACC,gBAAAC,EAAC,QAAA,EAAK,WAAU,qDAAoD,MAAK,SACvE,UAAA;AAAA,UAAA,gBAAAE,EAACC,GAAA,EAAK,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/Bb;AAAA,QAAA,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkboxes.js","sources":["../../../../lib/molecules/Forms/Checkboxes/Checkboxes.tsx"],"sourcesContent":["import { Children, cloneElement, type HTMLAttributes, isValidElement, useId } from 'react';\nimport type { FormControlProps } from '@/molecules/Forms/FormControl.js';\nimport { useValue } from '@/hooks/useValue.js';\nimport type { CheckboxProps } from './Checkbox.js';\nimport classnames from 'classnames';\n\nexport interface CheckboxesProps<Value = string>\n extends Pick<\n FormControlProps<Value[]>,\n | 'id'\n | 'name'\n | 'value'\n | 'onChange'\n | 'disabled'\n | 'readOnly'\n | 'tabIndex'\n | 'description'\n | 'validationStatus'\n | 'errorMessage'\n >,\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {}\n\nexport function Checkboxes<Value = string>(props: CheckboxesProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n children,\n value: initialValue,\n defaultValue,\n onChange,\n disabled,\n readOnly,\n tabIndex = 0,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value[]>({\n name,\n initialValue,\n formatter(value) {\n return value !== undefined ? ([].concat(value as never) as Value[]) : value;\n },\n defaultValue: (defaultValue as Value[]) || ([] as Value[]),\n onChange,\n });\n\n return (\n <div {...rest} className={rest.className} role=\"listbox\">\n {Children.map(children, (child, index) => {\n if (isValidElement(child)) {\n const propValue: Value = (child.props as CheckboxProps<Value>).value as Value;\n\n return cloneElement(child, {\n ...child.props,\n name,\n id: `${id}-${index}`,\n disabled,\n readOnly,\n tabIndex: tabIndex + index + 1,\n className: classnames(child.props.className || 'mt-8 first:mt-0'),\n checked: value.includes(propValue),\n onChange(_: string, item: Value | null) {\n if (item === null) {\n setValue(value.filter((v) => v !== propValue));\n } else {\n setValue(value.concat(propValue));\n }\n },\n } as CheckboxProps<Value>);\n }\n\n return child;\n })}\n </div>\n );\n}\n"],"names":["Checkboxes","props","internalId","useId","id","name","children","initialValue","defaultValue","onChange","disabled","readOnly","tabIndex","rest","value","setValue","useValue","jsx","Children","child","index","isValidElement","propValue","cloneElement","classnames","_","item","v"],"mappings":";;;;AAsBO,SAASA,EAA2BC,GAA+B;AACxE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,UAAAE;AAAA,IACA,OAAOC;AAAA,IACP,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,GAAGC;AAAA,EACD,IAAAZ,GAEE,EAAE,OAAAa,GAAO,UAAAC,EAAS,IAAIC,EAAkB;AAAA,IAC5C,MAAAX;AAAA,IACA,cAAAE;AAAA,IACA,UAAUO,GAAO;AACf,aAAOA,MAAU,SAAa,CAAA,EAAG,OAAOA,CAAc,IAAgBA;AAAAA,IACxE;AAAA,IACA,cAAeN,KAA6B,CAAC;AAAA,IAC7C,UAAAC;AAAA,EAAA,CACD;AAED,SACG,gBAAAQ,EAAA,OAAA,EAAK,GAAGJ,GAAM,WAAWA,EAAK,WAAW,MAAK,WAC5C,UAASK,EAAA,IAAIZ,GAAU,CAACa,GAAOC,MAAU;AACpC,QAAAC,EAAeF,CAAK,GAAG;AACnB,YAAAG,IAAoBH,EAAM,MAA+B;AAE/D,aAAOI,EAAaJ,GAAO;AAAA,QACzB,GAAGA,EAAM;AAAA,QACT,MAAAd;AAAA,QACA,IAAI,GAAGD,CAAE,IAAIgB,CAAK;AAAA,QAClB,UAAAV;AAAA,QACA,UAAAC;AAAA,QACA,UAAUC,IAAWQ,IAAQ;AAAA,QAC7B,WAAWI,EAAWL,EAAM,MAAM,aAAa,iBAAiB;AAAA,QAChE,SAASL,EAAM,SAASQ,CAAS;AAAA,QACjC,SAASG,GAAWC,GAAoB;AACtC,UACEX,EADEW,MAAS,OACFZ,EAAM,OAAO,CAACa,MAAMA,MAAML,CAAS,IAEnCR,EAAM,OAAOQ,CAAS,CAFc;AAAA,QAIjD;AAAA,MAAA,CACuB;AAAA,IAC3B;AAEO,WAAAH;AAAA,EACR,CAAA,EACH,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Checkboxes.js","sources":["../../../../lib/molecules/Forms/Checkboxes/Checkboxes.tsx"],"sourcesContent":["import { Children, cloneElement, type HTMLAttributes, isValidElement, useId } from 'react';\nimport type { FormControlProps } from '@/molecules/Forms/FormControl.js';\nimport { useValue } from '@/hooks/useValue.js';\nimport type { CheckboxProps } from './Checkbox.js';\nimport classnames from 'classnames';\n\nexport interface CheckboxesProps<Value = string>\n extends Pick<\n FormControlProps<Value[]>,\n | 'id'\n | 'name'\n | 'value'\n | 'onChange'\n | 'disabled'\n | 'readOnly'\n | 'tabIndex'\n | 'description'\n | 'validationStatus'\n | 'errorMessage'\n >,\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {}\n\nexport function Checkboxes<Value = string>(props: CheckboxesProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n children,\n value: initialValue,\n defaultValue,\n onChange,\n disabled,\n readOnly,\n tabIndex = 0,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value[]>({\n name,\n initialValue,\n formatter(value) {\n return value !== undefined ? ([].concat(value as never) as Value[]) : value;\n },\n defaultValue: (defaultValue as Value[]) || ([] as Value[]),\n onChange,\n });\n\n return (\n <div {...rest} className={rest.className} role=\"listbox\">\n {Children.map(children, (child, index) => {\n if (isValidElement(child)) {\n const propValue: Value = (child.props as CheckboxProps<Value>).value as Value;\n\n return cloneElement(child, {\n ...child.props,\n name,\n id: `${id}-${index}`,\n disabled,\n readOnly,\n tabIndex: tabIndex + index + 1,\n className: classnames(child.props.className || 'mt-8 first:mt-0'),\n checked: value.includes(propValue),\n onChange(_: string, item: Value | null) {\n if (item === null) {\n setValue(value.filter((v) => v !== propValue));\n } else {\n setValue(value.concat(propValue));\n }\n },\n } as CheckboxProps<Value>);\n }\n\n return child;\n })}\n </div>\n );\n}\n"],"names":["Checkboxes","props","internalId","useId","id","name","children","initialValue","defaultValue","onChange","disabled","readOnly","tabIndex","rest","value","setValue","useValue","jsx","Children","child","index","isValidElement","propValue","cloneElement","classnames","_","item","v"],"mappings":";;;;AAsBO,SAASA,EAA2BC,GAA+B;AACxE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,UAAAE;AAAA,IACA,OAAOC;AAAA,IACP,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,GAAGC;AAAA,EAAA,IACDZ,GAEE,EAAE,OAAAa,GAAO,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IAC5C,MAAAX;AAAA,IACA,cAAAE;AAAA,IACA,UAAUO,GAAO;AACf,aAAOA,MAAU,SAAa,CAAA,EAAG,OAAOA,CAAc,IAAgBA;AAAAA,IACxE;AAAA,IACA,cAAeN,KAA6B,CAAA;AAAA,IAC5C,UAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAQ,EAAC,OAAA,EAAK,GAAGJ,GAAM,WAAWA,EAAK,WAAW,MAAK,WAC5C,UAAAK,EAAS,IAAIZ,GAAU,CAACa,GAAOC,MAAU;AACxC,QAAIC,EAAeF,CAAK,GAAG;AACzB,YAAMG,IAAoBH,EAAM,MAA+B;AAE/D,aAAOI,EAAaJ,GAAO;AAAA,QACzB,GAAGA,EAAM;AAAA,QACT,MAAAd;AAAA,QACA,IAAI,GAAGD,CAAE,IAAIgB,CAAK;AAAA,QAClB,UAAAV;AAAA,QACA,UAAAC;AAAA,QACA,UAAUC,IAAWQ,IAAQ;AAAA,QAC7B,WAAWI,EAAWL,EAAM,MAAM,aAAa,iBAAiB;AAAA,QAChE,SAASL,EAAM,SAASQ,CAAS;AAAA,QACjC,SAASG,GAAWC,GAAoB;AACtC,UACEX,EADEW,MAAS,OACFZ,EAAM,OAAO,CAACa,MAAMA,MAAML,CAAS,IAEnCR,EAAM,OAAOQ,CAAS,CAFc;AAAA,QAIjD;AAAA,MAAA,CACuB;AAAA,IAC3B;AAEA,WAAOH;AAAA,EACT,CAAC,EAAA,CACH;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import { type IconicNames, type IconicTypes } from '../../atoms/Icons';
1
+ import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
2
2
  import { type FormControlProps } from './FormControl.js';
3
3
  interface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {
4
4
  description?: string;