@clubmed/trident-ui 1.3.0-beta.8 → 1.3.0-rc.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 (184) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/README.md +8 -0
  3. package/assets/icons/ResortFill/PHUC_Fill.svg +287 -10
  4. package/assets/icons/ResortFill/TOMC_Fill.svg +199 -14
  5. package/assets/icons/ResortFill-EC/KIPC_EC_Fill.svg +499 -0
  6. package/assets/icons/ResortOutline/PHUC_Outline.svg +156 -6
  7. package/assets/icons/ResortOutline/TOMC_Outline.svg +99 -6
  8. package/assets/icons/ResortOutline-EC/KIPC_EC_Outline.svg +380 -0
  9. package/assets/icons/Transports/Taxi.svg +5 -0
  10. package/assets/icons/Utilities/Doorhanger.svg +5 -0
  11. package/assets/{style.css → trident-ui.css} +1 -1
  12. package/atoms/Clickable/Clickable.d.ts +5 -0
  13. package/atoms/Clickable/Clickable.js +25 -0
  14. package/atoms/Clickable/Clickable.js.map +1 -0
  15. package/atoms/Heading/Heading.d.ts +6 -0
  16. package/atoms/Heading/Heading.js +14 -0
  17. package/atoms/Heading/Heading.js.map +1 -0
  18. package/atoms/Heading/HeadingGroup.d.ts +7 -0
  19. package/atoms/Heading/HeadingGroup.js +15 -0
  20. package/atoms/Heading/HeadingGroup.js.map +1 -0
  21. package/atoms/Icons/Iconics.d.ts +1 -1
  22. package/atoms/Icons/IconsResolver.d.ts +1 -1
  23. package/atoms/Icons/contexts/IconsContext.d.ts +1 -1
  24. package/atoms/Icons/svg/SvgIcon.d.ts +1 -1
  25. package/atoms/Icons/svg-use/SvgUseIcon.d.ts +1 -1
  26. package/atoms/Image/Image.d.ts +7 -0
  27. package/atoms/Image/Image.js +18 -0
  28. package/atoms/Image/Image.js.map +1 -0
  29. package/atoms/Prose/Prose.d.ts +5 -0
  30. package/atoms/Prose/Prose.js +18 -0
  31. package/atoms/Prose/Prose.js.map +1 -0
  32. package/chunks/ResizeObserver.js +287 -0
  33. package/chunks/ResizeObserver.js.map +1 -0
  34. package/chunks/_commonjsHelpers.js +19 -14
  35. package/chunks/_commonjsHelpers.js.map +1 -1
  36. package/chunks/index.js +36 -33
  37. package/chunks/index.js.map +1 -1
  38. package/chunks/plugin.js +57 -46
  39. package/chunks/plugin.js.map +1 -1
  40. package/contexts/Devices/Device.d.ts +3 -3
  41. package/contexts/Devices/hooks/useQueries.d.ts +2 -2
  42. package/contexts/Devices/reducers/reducer.d.ts +2 -2
  43. package/contexts/TridentUIConfig.d.ts +1 -1
  44. package/contexts/TridentUIConfig.js +1265 -653
  45. package/contexts/TridentUIConfig.js.map +1 -1
  46. package/helpers/colors/colors.d.ts +108 -0
  47. package/helpers/colors/colors.js +132 -0
  48. package/helpers/colors/colors.js.map +1 -0
  49. package/hooks/useKeyboardControls.d.ts +1 -1
  50. package/hooks/useResizeObserver.d.ts +2 -0
  51. package/hooks/useResizeObserver.js +84 -0
  52. package/hooks/useResizeObserver.js.map +1 -0
  53. package/hooks/useSafeBoop.d.ts +2 -2
  54. package/molecules/Arrows/Arrows.d.ts +2 -2
  55. package/molecules/Avatar.d.ts +1 -1
  56. package/molecules/Avatar.js +24 -24
  57. package/molecules/Avatar.js.map +1 -1
  58. package/molecules/Backdrop.d.ts +1 -1
  59. package/molecules/Breadcrumb.d.ts +7 -11
  60. package/molecules/Breadcrumb.js +44 -36
  61. package/molecules/Breadcrumb.js.map +1 -1
  62. package/molecules/Breadcrumb.themes.d.ts +8 -0
  63. package/molecules/Breadcrumb.themes.js +15 -0
  64. package/molecules/Breadcrumb.themes.js.map +1 -0
  65. package/molecules/Buttons/ArrowButton.d.ts +1 -1
  66. package/molecules/Buttons/Button.d.ts +7 -3
  67. package/molecules/Buttons/Button.js +12 -10
  68. package/molecules/Buttons/Button.js.map +1 -1
  69. package/molecules/Buttons/ButtonAnchor.d.ts +7 -2
  70. package/molecules/Buttons/ButtonAnchor.js +13 -10
  71. package/molecules/Buttons/ButtonAnchor.js.map +1 -1
  72. package/molecules/Buttons/ButtonContent.d.ts +2 -2
  73. package/molecules/Buttons/FakeButton.d.ts +7 -7
  74. package/molecules/Buttons/FakeButton.js +5 -24
  75. package/molecules/Buttons/FakeButton.js.map +1 -1
  76. package/molecules/Buttons/InertButton.d.ts +3 -3
  77. package/molecules/Buttons/InertButton.js +9 -8
  78. package/molecules/Buttons/InertButton.js.map +1 -1
  79. package/molecules/Buttons/v2/Button.d.ts +2286 -8
  80. package/molecules/Buttons/v2/Button.js +51 -26
  81. package/molecules/Buttons/v2/Button.js.map +1 -1
  82. package/molecules/Buttons/v2/Button.type.d.ts +5 -2
  83. package/molecules/Buttons/v2/Button.type.js +8 -5
  84. package/molecules/Buttons/v2/Button.type.js.map +1 -1
  85. package/molecules/Card.d.ts +1 -11
  86. package/molecules/Card.js +2 -34
  87. package/molecules/Card.js.map +1 -1
  88. package/molecules/Cards/Card.d.ts +13 -0
  89. package/molecules/Cards/Card.js +22 -0
  90. package/molecules/Cards/Card.js.map +1 -0
  91. package/molecules/Cards/CardAspectRatios.d.ts +6 -0
  92. package/molecules/Cards/CardAspectRatios.js +10 -0
  93. package/molecules/Cards/CardAspectRatios.js.map +1 -0
  94. package/molecules/Cards/CardBackground.d.ts +4 -0
  95. package/molecules/Cards/CardBackground.js +30 -0
  96. package/molecules/Cards/CardBackground.js.map +1 -0
  97. package/molecules/Cards/CardBackgroundContext.d.ts +6 -0
  98. package/molecules/Cards/CardBackgroundContext.js +10 -0
  99. package/molecules/Cards/CardBackgroundContext.js.map +1 -0
  100. package/molecules/Cards/CardClickable.d.ts +6 -0
  101. package/molecules/Cards/CardClickable.js +37 -0
  102. package/molecules/Cards/CardClickable.js.map +1 -0
  103. package/molecules/Cards/ExpandableCard.d.ts +14 -0
  104. package/molecules/Cards/ExpandableCard.js +80 -0
  105. package/molecules/Cards/ExpandableCard.js.map +1 -0
  106. package/molecules/Cards/v2/Card.d.ts +15 -0
  107. package/molecules/Cards/v2/Card.js +34 -0
  108. package/molecules/Cards/v2/Card.js.map +1 -0
  109. package/molecules/Chip.d.ts +9 -0
  110. package/molecules/Chip.js +31 -0
  111. package/molecules/Chip.js.map +1 -0
  112. package/molecules/Chip.themes.d.ts +12 -0
  113. package/molecules/Chip.themes.js +24 -0
  114. package/molecules/Chip.themes.js.map +1 -0
  115. package/molecules/ElasticHeight.d.ts +6 -27
  116. package/molecules/ElasticHeight.js +27 -33
  117. package/molecules/ElasticHeight.js.map +1 -1
  118. package/molecules/Forms/Checkboxes/Checkbox.d.ts +1 -1
  119. package/molecules/Forms/Checkboxes/Checkbox.js +43 -43
  120. package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
  121. package/molecules/Forms/Checkboxes/Checkboxes.d.ts +2 -2
  122. package/molecules/Forms/DateField.d.ts +2 -2
  123. package/molecules/Forms/DateField.js +60 -61
  124. package/molecules/Forms/DateField.js.map +1 -1
  125. package/molecules/Forms/Filter.d.ts +1 -2
  126. package/molecules/Forms/Filter.js +29 -29
  127. package/molecules/Forms/Filter.js.map +1 -1
  128. package/molecules/Forms/FormControl.d.ts +4 -4
  129. package/molecules/Forms/FormLabel.d.ts +1 -1
  130. package/molecules/Forms/NumberField.d.ts +280 -280
  131. package/molecules/Forms/Password/Password.d.ts +1 -1
  132. package/molecules/Forms/Password/ValidationMessage.d.ts +1 -1
  133. package/molecules/Forms/Radios/Radio.d.ts +4 -2
  134. package/molecules/Forms/Radios/Radio.js +29 -28
  135. package/molecules/Forms/Radios/Radio.js.map +1 -1
  136. package/molecules/Forms/Radios/RadioGroup.d.ts +2 -2
  137. package/molecules/Forms/Radios/RadioGroup.js +70 -33
  138. package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
  139. package/molecules/Forms/Range.d.ts +1 -2
  140. package/molecules/Forms/Range.js +144 -421
  141. package/molecules/Forms/Range.js.map +1 -1
  142. package/molecules/Forms/Select.d.ts +3 -3
  143. package/molecules/Forms/Switch.d.ts +1 -1
  144. package/molecules/Forms/TextField.d.ts +3 -3
  145. package/molecules/HamburgerIcon.d.ts +1 -1
  146. package/molecules/Link.d.ts +2 -2
  147. package/molecules/Loader.d.ts +1 -1
  148. package/molecules/Pagination.d.ts +2 -2
  149. package/molecules/Popin.d.ts +1 -1
  150. package/molecules/Spinner.d.ts +1 -1
  151. package/molecules/Tabs/Tab.d.ts +2 -3
  152. package/molecules/Tabs/Tab.js +41 -42
  153. package/molecules/Tabs/Tab.js.map +1 -1
  154. package/molecules/Tabs/TabList.d.ts +1 -1
  155. package/molecules/Tabs/TabList.js +21 -21
  156. package/molecules/Tabs/TabList.js.map +1 -1
  157. package/molecules/Tabs/TabPanel.d.ts +1 -1
  158. package/molecules/Tabs/TabPanel.js +13 -13
  159. package/molecules/Tabs/TabPanel.js.map +1 -1
  160. package/molecules/Tabs/Tabs.d.ts +1 -1
  161. package/molecules/Tabs/TabsBody.d.ts +1 -1
  162. package/molecules/Tabs/context/TabControl.d.ts +2 -2
  163. package/molecules/Tabs/hooks/tabControl.d.ts +5 -5
  164. package/molecules/Tag.d.ts +43 -0
  165. package/molecules/Tag.js +73 -0
  166. package/molecules/Tag.js.map +1 -0
  167. package/package.json +48 -45
  168. package/styles/index.css +1 -1
  169. package/tailwind/plugins/animationDelay.d.ts +2 -2
  170. package/tailwind/plugins/hocus.d.ts +2 -2
  171. package/tailwind/plugins/lineClampFix.d.ts +2 -2
  172. package/tailwind/plugins/popover.d.ts +2 -2
  173. package/tailwind/plugins/startingStyle.d.ts +2 -2
  174. package/tailwind/plugins/transitionBehavior.d.ts +2 -2
  175. package/tailwind/tailwind.preset.d.ts +50 -50
  176. package/types/LiteralUnion.d.js +2 -0
  177. package/types/LiteralUnion.d.js.map +1 -0
  178. package/types/Theme.d.js +2 -0
  179. package/types/Theme.d.js.map +1 -0
  180. package/assets/icons/ResortFill/KIPC_Fill.svg +0 -12
  181. package/assets/icons/ResortOutline/KIPC_Outline.svg +0 -7
  182. package/molecules/Buttons/v2/ButtonAnchor.d.ts +0 -12
  183. package/molecules/Buttons/v2/ButtonAnchor.js +0 -32
  184. package/molecules/Buttons/v2/ButtonAnchor.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 { 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 { ComponentPropsWithoutRef, 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,42 +1,36 @@
1
+ "use client";
1
2
  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
3
+ import { c as u } from "../chunks/index.js";
4
+ import { useRef as l, useState as m, useLayoutEffect as d } from "react";
5
+ import h from "../hooks/useResizeObserver.js";
6
+ const H = ({
7
+ className: i,
8
+ children: o,
9
+ innerClassName: a,
10
+ isExpanded: t = !1,
11
+ min: n = 0,
12
+ ...f
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 = l(null), [c, r] = m(0);
15
+ return h({
16
+ ref: e,
17
+ onResize: () => {
18
+ e.current && r(e.current?.offsetHeight);
19
+ }
20
+ }), d(() => {
21
+ e.current && r(e.current.offsetHeight);
22
+ }, [e]), /* @__PURE__ */ s(
23
+ "div",
30
24
  {
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 })
25
+ ...f,
26
+ className: u("overflow-hidden transition-all duration-500", i),
27
+ "data-expanded": t,
28
+ style: { height: t ? c : n },
29
+ children: /* @__PURE__ */ s("div", { className: a, ref: e, children: o })
36
30
  }
37
31
  );
38
32
  };
39
33
  export {
40
- R as ElasticHeight
34
+ H as ElasticHeight
41
35
  };
42
36
  //# sourceMappingURL=ElasticHeight.js.map
@@ -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;AACJ,QAAMC,IAAMC,EAAuB,IAAI,GACjC,EAAE,QAAAC,EAAA,IAAWC,EAAU,EAAE,WAAWH,GAAK,GAEzC,CAACI,GAAQC,CAAG,IAAIC,EAAU,OAAO;AAAA,IACrC,MAAM;AAAA,MACJ,QAAQJ,EAAO,GAAGV,CAAmB;AAAA,IAAA;AAAA,IAEvC,WAAW;AAAA,EAAA,EACX;AAEF,SAAAe,EAAU,MAAM;AACd,IAAAF,EAAI,MAAM;AAAA,MACR,IAAI;AAAA,QACF,QAAQH,EAAO,GAAGV,CAAmB;AAAA,MAAA;AAAA,MAEvC,QAAQ;AAAA,QACN,SAAS;AAAA,QACT,UAAU;AAAA,MAAA;AAAA,IACZ,CACD;AAAA,EACH,GAAG,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,EAAA;AAAA,MACZ,IAAAR;AAAA,MAEA,UAAA,gBAAAY,EAAC,OAAA,EAAI,WAAAX,GAAsB,KAAAG,GACxB,UAAAL,EAAA,CACH;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","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,EAAOH,EAAI,SAAS,YAAY;AAAA,IAEpC;AAAA,EAAA,CACD,GAEDM,EAAgB,MAAM;AACpB,IAAKN,EAAI,WAGTG,EAAOH,EAAI,QAAQ,YAAY;AAAA,EACjC,GAAG,CAACA,CAAG,CAAC,GAGN,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGR;AAAA,MACJ,WAAWS,EAAW,+CAA+Cd,CAAS;AAAA,MAC9E,iBAAeG;AAAA,MACf,OAAO,EAAE,QAAQA,IAAaK,IAAMJ,EAAA;AAAA,MAEpC,UAAA,gBAAAS,EAAC,OAAA,EAAI,WAAWX,GAAgB,KAAAI,GAC7B,UAAAL,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,4 +1,4 @@
1
- import type { FormControlProps } from '../FormControl';
1
+ import { FormControlProps } from '../FormControl';
2
2
  export interface CheckboxProps<Value = string> extends FormControlProps<Value> {
3
3
  size?: number;
4
4
  onChange?: (name: string, value: Value | null) => void;
@@ -1,76 +1,76 @@
1
- import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
- import { c as o } from "../../../chunks/index.js";
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import { c as n } from "../../../chunks/index.js";
3
3
  import { useId as D } from "react";
4
4
  import { useValue as S } from "../../../hooks/useValue.js";
5
5
  /* empty css */
6
6
  import { useInternalStatus as V } from "../../../hooks/useInternalStatus.js";
7
- import { Icon as p } from "@clubmed/trident-icons";
8
- function A(u) {
9
- const x = D(), {
10
- id: s = x,
11
- name: n = s,
12
- className: f,
13
- dataTestId: b,
7
+ import { Icon as h } from "@clubmed/trident-icons";
8
+ function A(p) {
9
+ const u = D(), {
10
+ id: s = u,
11
+ name: o = s,
12
+ className: x,
13
+ dataTestId: f,
14
14
  disabled: r = !1,
15
- checked: k = !1,
15
+ checked: b = !1,
16
16
  value: l,
17
17
  size: i = 24,
18
- tabIndex: v = 0,
19
- validationStatus: N = "default",
20
- errorMessage: d,
21
- children: g,
22
- onChange: c,
23
- ...y
24
- } = u, { value: m, setValue: I } = S({
25
- name: n,
26
- initialValue: k,
27
- onChange(w, h) {
28
- c == null || c(w, h ? l !== void 0 ? l : h : null);
18
+ tabIndex: k = 0,
19
+ validationStatus: g = "default",
20
+ errorMessage: c,
21
+ children: v,
22
+ onChange: C,
23
+ ...N
24
+ } = p, { value: d, setValue: y } = S({
25
+ name: o,
26
+ initialValue: b,
27
+ onChange(w, m) {
28
+ C?.(w, m ? l !== void 0 ? l : m : null);
29
29
  }
30
30
  }), e = V({
31
31
  isDisabled: r,
32
- validationStatus: N
33
- }), C = e === "error" && d;
34
- return /* @__PURE__ */ t(
32
+ validationStatus: g
33
+ }), I = e === "error" && c;
34
+ return /* @__PURE__ */ a(
35
35
  "div",
36
36
  {
37
- className: o("flex flex-col space-y-2", f),
37
+ className: n("flex flex-col space-y-2", x),
38
38
  "data-testid": `checkbox-container-${s}`,
39
39
  children: [
40
- /* @__PURE__ */ t(
40
+ /* @__PURE__ */ a(
41
41
  "label",
42
42
  {
43
- className: o("cursor-pointer relative flex text-b3 items-center", {
43
+ className: n("cursor-pointer relative flex text-b3 items-center", {
44
44
  "text-grey": e === "disabled",
45
45
  "text-black": e !== "default"
46
46
  }),
47
47
  children: [
48
- /* @__PURE__ */ t("span", { className: "relative self-start me-8", children: [
49
- /* @__PURE__ */ a(
48
+ /* @__PURE__ */ a("span", { className: "relative self-start me-8", children: [
49
+ /* @__PURE__ */ t(
50
50
  "input",
51
51
  {
52
- ...y,
53
- name: n,
54
- "data-testid": b,
52
+ ...N,
53
+ name: o,
54
+ "data-testid": f,
55
55
  type: "checkbox",
56
- tabIndex: v,
56
+ tabIndex: k,
57
57
  onChange: () => {
58
- !r && I(!m);
58
+ !r && y(!d);
59
59
  },
60
- checked: m,
60
+ checked: d,
61
61
  "data-name": "Checkbox",
62
62
  disabled: r,
63
63
  value: l
64
64
  }
65
65
  ),
66
- /* @__PURE__ */ a(
66
+ /* @__PURE__ */ t(
67
67
  "span",
68
68
  {
69
69
  style: { height: i, width: i },
70
- className: o({ "!border-red": e === "error" }),
70
+ className: n({ "!border-red": e === "error" }),
71
71
  "data-testid": `check-container-${s}`,
72
- children: /* @__PURE__ */ a(
73
- p,
72
+ children: /* @__PURE__ */ t(
73
+ h,
74
74
  {
75
75
  name: "CheckDefault",
76
76
  type: "svg",
@@ -82,13 +82,13 @@ function A(u) {
82
82
  }
83
83
  )
84
84
  ] }),
85
- g
85
+ v
86
86
  ]
87
87
  }
88
88
  ),
89
- C && /* @__PURE__ */ t("span", { className: "text-red text-b4 flex items-start space-x-4 ps-20", role: "alert", children: [
90
- /* @__PURE__ */ a(p, { name: "Error", width: "20px" }),
91
- d
89
+ I && /* @__PURE__ */ a("span", { className: "text-red text-b4 flex items-start space-x-4 ps-20", role: "alert", children: [
90
+ /* @__PURE__ */ t(h, { name: "Error", width: "20px" }),
91
+ c
92
92
  ] })
93
93
  ]
94
94
  }
@@ -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 { 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
+ {"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,IAAWX,GAAMa,IAAYR,MAAU,SAAYA,IAAQQ,IAAqB,IAAI;AAAA,IACtF;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,5 +1,5 @@
1
- import { type HTMLAttributes } from 'react';
2
- import type { FormControlProps } from '../FormControl.js';
1
+ import { HTMLAttributes } from 'react';
2
+ import { FormControlProps } from '../FormControl.js';
3
3
  export interface CheckboxesProps<Value = string> extends Pick<FormControlProps<Value[]>, 'id' | 'name' | 'value' | 'onChange' | 'disabled' | 'readOnly' | 'tabIndex' | 'description' | 'validationStatus' | 'errorMessage'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
4
  }
5
5
  export declare function Checkboxes<Value = string>(props: CheckboxesProps<Value>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
2
- import { type FormControlProps } from './FormControl.js';
1
+ import { IconicNames, IconicTypes } from '@clubmed/trident-icons';
2
+ import { FormControlProps } from './FormControl.js';
3
3
  interface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {
4
4
  description?: string;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { jsx as p, jsxs as T } from "react/jsx-runtime";
1
+ import { jsx as p, jsxs as C } from "react/jsx-runtime";
2
2
  import { c as q } from "../../chunks/index.js";
3
3
  import { useId as A, useRef as B, useState as H, useCallback as L, useEffect as J } from "react";
4
4
  import { Icon as E } from "@clubmed/trident-icons";
@@ -25,7 +25,7 @@ function z(t) {
25
25
  function G(t, e) {
26
26
  return P(2, arguments), z(t).getTime() - z(e).getTime();
27
27
  }
28
- function m(t, e) {
28
+ function f(t, e) {
29
29
  for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; )
30
30
  r = "0" + r;
31
31
  return n + r;
@@ -36,98 +36,97 @@ function W(t, e) {
36
36
  var a = z(t);
37
37
  if (isNaN(a.getTime()))
38
38
  throw new RangeError("Invalid time value");
39
- var l = String((n = e == null ? void 0 : e.format) !== null && n !== void 0 ? n : "extended"), i = String((r = e == null ? void 0 : e.representation) !== null && r !== void 0 ? r : "complete");
40
- if (l !== "extended" && l !== "basic")
39
+ var c = String((n = e?.format) !== null && n !== void 0 ? n : "extended"), i = String((r = e?.representation) !== null && r !== void 0 ? r : "complete");
40
+ if (c !== "extended" && c !== "basic")
41
41
  throw new RangeError("format must be 'extended' or 'basic'");
42
42
  if (i !== "date" && i !== "time" && i !== "complete")
43
43
  throw new RangeError("representation must be 'date', 'time', or 'complete'");
44
- var f = "", g = "", y = l === "extended" ? "-" : "", j = l === "extended" ? ":" : "";
44
+ var d = "", g = "", D = c === "extended" ? "-" : "", I = c === "extended" ? ":" : "";
45
45
  if (i !== "time") {
46
- var o = m(a.getDate(), 2), w = m(a.getMonth() + 1, 2), C = m(a.getFullYear(), 4);
47
- f = "".concat(C).concat(y).concat(w).concat(y).concat(o);
46
+ var o = f(a.getDate(), 2), y = f(a.getMonth() + 1, 2), T = f(a.getFullYear(), 4);
47
+ d = "".concat(T).concat(D).concat(y).concat(D).concat(o);
48
48
  }
49
49
  if (i !== "date") {
50
50
  var b = a.getTimezoneOffset();
51
51
  if (b !== 0) {
52
- var x = Math.abs(b), u = m(Math.floor(x / 60), 2), d = m(x % 60, 2), v = b < 0 ? "+" : "-";
53
- g = "".concat(v).concat(u, ":").concat(d);
52
+ var w = Math.abs(b), l = f(Math.floor(w / 60), 2), u = f(w % 60, 2), j = b < 0 ? "+" : "-";
53
+ g = "".concat(j).concat(l, ":").concat(u);
54
54
  } else
55
55
  g = "Z";
56
- var F = m(a.getHours(), 2), S = m(a.getMinutes(), 2), M = m(a.getSeconds(), 2), N = f === "" ? "" : "T", s = [F, S, M].join(j);
57
- f = "".concat(f).concat(N).concat(s).concat(g);
56
+ var F = f(a.getHours(), 2), x = f(a.getMinutes(), 2), S = f(a.getSeconds(), 2), M = d === "" ? "" : "T", s = [F, x, S].join(I);
57
+ d = "".concat(d).concat(M).concat(s).concat(g);
58
58
  }
59
- return f;
59
+ return d;
60
60
  }
61
61
  const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e, n) => {
62
62
  if (!t)
63
63
  return !0;
64
- const r = (i) => new Date(i.getFullYear(), i.getMonth(), i.getDate()), a = new Date(t), l = r(a);
65
- return !(e && l < r(e) || n && l > r(n));
64
+ const r = (i) => new Date(i.getFullYear(), i.getMonth(), i.getDate()), a = new Date(t), c = r(a);
65
+ return !(e && c < r(e) || n && c > r(n));
66
66
  }, se = (t) => {
67
67
  const e = A(), {
68
68
  id: n = e,
69
69
  name: r = n,
70
70
  label: a,
71
- description: l,
71
+ description: c,
72
72
  openDatepicker: i,
73
- validationStatus: f = "default",
73
+ validationStatus: d = "default",
74
74
  icon: g = "CalendarDefault",
75
- iconType: y,
76
- errorMessage: j,
75
+ iconType: D,
76
+ errorMessage: I,
77
77
  disabled: o = !1,
78
- required: w = !1,
79
- hideRequiredStar: C,
78
+ required: y = !1,
79
+ hideRequiredStar: T,
80
80
  dataTestId: b = "DateField",
81
- value: x,
82
- min: u,
83
- max: d,
84
- onChange: v,
81
+ value: w,
82
+ min: l,
83
+ max: u,
84
+ onChange: j,
85
85
  ...F
86
- } = t, S = B(null), [M, N] = H(!1), s = Q({
86
+ } = t, x = B(null), [S, M] = H(!1), s = Q({
87
87
  isDisabled: o,
88
- validationStatus: f
89
- }), { setValue: h, value: D } = K({
88
+ validationStatus: d
89
+ }), { setValue: v, value: h } = K({
90
90
  name: r,
91
91
  formatter: O,
92
- initialValue: x,
93
- onChange: (c, R) => v == null ? void 0 : v(c, new Date(R))
94
- }), k = O(u), I = O(d), Y = (c) => {
95
- h(c.target.value);
92
+ initialValue: w,
93
+ onChange: (m, R) => j?.(m, new Date(R))
94
+ }), N = O(l), k = O(u), Y = (m) => {
95
+ v(m.target.value);
96
96
  }, Z = () => {
97
- var c;
98
- (c = S.current) == null || c.showPicker();
97
+ x.current?.showPicker();
99
98
  }, _ = L(() => {
100
- const c = new Date(D);
101
- if (u && d) {
102
- const R = Math.abs(G(c, u)), $ = Math.abs(G(c, d));
103
- h(R <= $ ? k : I);
99
+ const m = new Date(h);
100
+ if (l && u) {
101
+ const R = Math.abs(G(m, l)), $ = Math.abs(G(m, u));
102
+ v(R <= $ ? N : k);
104
103
  return;
105
104
  }
106
- if (u) {
107
- h(k);
105
+ if (l) {
106
+ v(N);
108
107
  return;
109
108
  }
110
- if (d) {
111
- h(I);
109
+ if (u) {
110
+ v(k);
112
111
  return;
113
112
  }
114
- }, [d, u, I, k, h, D]);
113
+ }, [u, l, k, N, v, h]);
115
114
  return J(() => {
116
- !X(D, u, d) && !M && _();
117
- }, [_, d, u, M, D]), /* @__PURE__ */ p(
115
+ !X(h, l, u) && !S && _();
116
+ }, [_, u, l, S, h]), /* @__PURE__ */ p(
118
117
  U,
119
118
  {
120
119
  id: n,
121
120
  label: a,
122
- description: l,
121
+ description: c,
123
122
  dataName: "DateField",
124
123
  dataTestId: b,
125
124
  disabled: o,
126
- required: w,
127
- hideRequiredStar: C,
128
- validationStatus: f,
129
- errorMessage: j,
130
- children: /* @__PURE__ */ T("div", { className: "relative", children: [
125
+ required: y,
126
+ hideRequiredStar: T,
127
+ validationStatus: d,
128
+ errorMessage: I,
129
+ children: /* @__PURE__ */ C("div", { className: "relative", children: [
131
130
  /* @__PURE__ */ p(
132
131
  "input",
133
132
  {
@@ -146,17 +145,17 @@ const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e,
146
145
  ),
147
146
  id: n,
148
147
  disabled: o,
149
- required: w,
150
- ref: S,
151
- value: D,
152
- min: k,
153
- max: I,
148
+ required: y,
149
+ ref: x,
150
+ value: h,
151
+ min: N,
152
+ max: k,
154
153
  onChange: Y,
155
- onFocus: () => N(!0),
156
- onBlur: () => N(!1)
154
+ onFocus: () => M(!0),
155
+ onBlur: () => M(!1)
157
156
  }
158
157
  ),
159
- /* @__PURE__ */ T(
158
+ /* @__PURE__ */ C(
160
159
  "div",
161
160
  {
162
161
  className: q(
@@ -168,11 +167,11 @@ const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e,
168
167
  }
169
168
  ),
170
169
  children: [
171
- /* @__PURE__ */ T("button", { className: "pointer-events-auto leading-none", onClick: Z, children: [
172
- /* @__PURE__ */ p(E, { name: g, iconType: y, width: "24px" }),
170
+ /* @__PURE__ */ C("button", { className: "pointer-events-auto leading-none", onClick: Z, children: [
171
+ /* @__PURE__ */ p(E, { name: g, iconType: D, width: "24px" }),
173
172
  /* @__PURE__ */ p("span", { className: "sr-only", children: i })
174
173
  ] }),
175
- /* @__PURE__ */ T("span", { className: "ms-auto flex gap-x-8", children: [
174
+ /* @__PURE__ */ C("span", { className: "ms-auto flex gap-x-8", children: [
176
175
  s === "error" && /* @__PURE__ */ p(E, { name: "CrossDefault", width: "24px" }),
177
176
  s === "success" && /* @__PURE__ */ p(E, { name: "CheckDefault", width: "24px" })
178
177
  ] })