@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
@@ -1,59 +1,5 @@
1
- import { jsxs as w, jsx as n } from "react/jsx-runtime";
2
- import { c as o } from "../chunks/index.js";
3
- import { Button as c } from "./Buttons/Button.js";
4
- const d = ({
5
- onNext: l,
6
- onPrev: m,
7
- nextLabel: p = "",
8
- prevLabel: u = "",
9
- disableNext: t,
10
- disablePrev: a,
11
- className: f,
12
- theme: r = "white",
13
- variant: s = "icon",
14
- iconType: e = "ArrowDefault",
15
- hideDisabled: i = !1
16
- }) => /* @__PURE__ */ w(
17
- "div",
18
- {
19
- role: "navigation",
20
- className: o("flex w-full items-center justify-between", f),
21
- "data-name": "Arrows",
22
- children: [
23
- /* @__PURE__ */ n(
24
- c,
25
- {
26
- variant: s,
27
- theme: r,
28
- icon: `${e}Left`,
29
- className: o("pointer-events-auto me-auto transition-opacity", {
30
- "opacity-0": i && a
31
- }),
32
- onClick: m,
33
- label: u,
34
- disabled: a,
35
- groupName: "arrows"
36
- }
37
- ),
38
- /* @__PURE__ */ n(
39
- c,
40
- {
41
- variant: s,
42
- theme: r,
43
- icon: `${e}Right`,
44
- className: o("pointer-events-auto ms-auto transition-opacity", {
45
- "opacity-0": i && t
46
- }),
47
- onClick: l,
48
- label: p,
49
- disabled: t,
50
- groupName: "arrows"
51
- }
52
- )
53
- ]
54
- }
55
- );
1
+ import { Arrows as e } from "./Arrows/Arrows.js";
56
2
  export {
57
- d as Arrows
3
+ e as Arrows
58
4
  };
59
5
  //# sourceMappingURL=Arrows.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Arrows.js","sources":["../../lib/molecules/Arrows.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { ComponentProps, FunctionComponent } from 'react';\n\nimport { Button } from './Buttons/Button';\n\ninterface ArrowsProps {\n /**\n * onNext handler\n */\n onNext: () => void;\n /**\n * onPrev handler\n */\n onPrev: () => void;\n /**\n * Next label\n */\n nextLabel?: string;\n /**\n * Prev label\n */\n prevLabel?: string;\n /**\n * Disable next button\n */\n disableNext?: boolean;\n /**\n * Disable prev button\n */\n disablePrev?: boolean;\n /**\n * Additional class names\n */\n className?: string;\n /**\n * Theme\n */\n theme?: ComponentProps<typeof Button>['theme'];\n /**\n * Variant\n */\n variant?: ComponentProps<typeof Button>['variant'];\n /**\n * Arrow icon type\n */\n iconType?: 'ArrowDefault' | 'ArrowTail';\n /**\n * Hide disabled arrows\n */\n hideDisabled?: boolean;\n}\n\nexport const Arrows: FunctionComponent<ArrowsProps> = ({\n onNext,\n onPrev,\n nextLabel = '',\n prevLabel = '',\n disableNext,\n disablePrev,\n className,\n theme = 'white',\n variant = 'icon',\n iconType = 'ArrowDefault',\n hideDisabled = false,\n}) => {\n return (\n <div\n role=\"navigation\"\n className={classnames('flex w-full items-center justify-between', className)}\n data-name=\"Arrows\"\n >\n <Button\n variant={variant}\n theme={theme}\n icon={`${iconType}Left`}\n className={classnames('pointer-events-auto me-auto transition-opacity', {\n 'opacity-0': hideDisabled && disablePrev,\n })}\n onClick={onPrev}\n label={prevLabel}\n disabled={disablePrev}\n groupName=\"arrows\"\n />\n <Button\n variant={variant}\n theme={theme}\n icon={`${iconType}Right`}\n className={classnames('pointer-events-auto ms-auto transition-opacity', {\n 'opacity-0': hideDisabled && disableNext,\n })}\n onClick={onNext}\n label={nextLabel}\n disabled={disableNext}\n groupName=\"arrows\"\n />\n </div>\n );\n};\n"],"names":["Arrows","onNext","onPrev","nextLabel","prevLabel","disableNext","disablePrev","className","theme","variant","iconType","hideDisabled","jsxs","classnames","jsx","Button"],"mappings":";;;AAoDO,MAAMA,IAAyC,CAAC;AAAA,EACrD,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC,IAAY;AAAA,EACZ,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AACjB,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,WAAWC,EAAW,4CAA4CN,CAAS;AAAA,IAC3E,aAAU;AAAA,IAEV,UAAA;AAAA,MAAA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,SAAAN;AAAA,UACA,OAAAD;AAAA,UACA,MAAM,GAAGE,CAAQ;AAAA,UACjB,WAAWG,EAAW,kDAAkD;AAAA,YACtE,aAAaF,KAAgBL;AAAA,UAAA,CAC9B;AAAA,UACD,SAASJ;AAAA,UACT,OAAOE;AAAA,UACP,UAAUE;AAAA,UACV,WAAU;AAAA,QAAA;AAAA,MACZ;AAAA,MACA,gBAAAQ;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,SAAAN;AAAA,UACA,OAAAD;AAAA,UACA,MAAM,GAAGE,CAAQ;AAAA,UACjB,WAAWG,EAAW,kDAAkD;AAAA,YACtE,aAAaF,KAAgBN;AAAA,UAAA,CAC9B;AAAA,UACD,SAASJ;AAAA,UACT,OAAOE;AAAA,UACP,UAAUE;AAAA,UACV,WAAU;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA;AAAA,EAAA;AAAA;"}
1
+ {"version":3,"file":"Arrows.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../lib/molecules/Avatar.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport classnames from 'classnames';\n\nconst initial = (text = '') => {\n return text\n .split(' ')\n .map((text) => text.slice(0, 1))\n .join('');\n};\n\ninterface AvatarProps extends HTMLAttributes<HTMLDivElement> {\n alt?: string;\n src?: string | undefined;\n srcSet?: string | undefined;\n}\n\nexport function Avatar({\n alt,\n src,\n srcSet,\n style,\n children,\n className,\n ...props\n}: PropsWithChildren<AvatarProps>) {\n return (\n <div\n {...props}\n {...(src || srcSet ? { role: 'figure', 'aria-label': alt } : {})}\n className={classnames(\n 'flex items-center justify-center relative overflow-hidden',\n {\n 'rounded-full': !className?.includes('rounded-'),\n 'text-black': !className?.includes('text-'),\n 'bg-saffron': !className?.includes('bg-'),\n },\n className,\n )}\n style={{\n width: '48px',\n height: '48px',\n ...style,\n }}\n >\n <span className=\"flex items-center justify-center font-bold uppercase text-h6 h-full\">\n {src || srcSet ? (\n <img\n srcSet={srcSet}\n src={src}\n alt={alt}\n className={'w-full h-full object-cover transparent indent-[1000px]'}\n />\n ) : (\n initial(alt)\n )}\n {children}\n </span>\n </div>\n );\n}\n"],"names":["initial","text","Avatar","alt","src","srcSet","style","children","className","props","jsx","classnames","jsxs"],"mappings":";;AAGA,MAAMA,IAAU,CAACC,IAAO,OACfA,EACJ,MAAM,GAAG,EACT,IAAI,CAACA,MAASA,EAAK,MAAM,GAAG,CAAC,CAAC,EAC9B,KAAK,EAAE;AASL,SAASC,EAAO;AAAA,EACrB,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAmC;AAE/B,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACH,GAAIL,KAAOC,IAAS,EAAE,MAAM,UAAU,cAAcF,EAAI,IAAI,CAAC;AAAA,MAC9D,WAAWQ;AAAA,QACT;AAAA,QACA;AAAA,UACE,gBAAgB,EAACH,KAAA,QAAAA,EAAW,SAAS;AAAA,UACrC,cAAc,EAACA,KAAA,QAAAA,EAAW,SAAS;AAAA,UACnC,cAAc,EAACA,KAAA,QAAAA,EAAW,SAAS;AAAA,QACrC;AAAA,QACAA;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,GAAGF;AAAA,MACL;AAAA,MAEA,UAAA,gBAAAM,EAAC,QAAK,EAAA,WAAU,uEACb,UAAA;AAAA,QAAAR,KAAOC,IACN,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,QAAAL;AAAA,YACA,KAAAD;AAAA,YACA,KAAAD;AAAA,YACA,WAAW;AAAA,UAAA;AAAA,QAAA,IAGbH,EAAQG,CAAG;AAAA,QAEZI;AAAA,MAAA,GACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../lib/molecules/Avatar.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport classnames from 'classnames';\n\nconst initial = (text = '') => {\n return text\n .split(' ')\n .map((text) => text.slice(0, 1))\n .join('');\n};\n\ninterface AvatarProps extends HTMLAttributes<HTMLDivElement> {\n alt?: string;\n src?: string | undefined;\n srcSet?: string | undefined;\n}\n\nexport function Avatar({\n alt,\n src,\n srcSet,\n style,\n children,\n className,\n ...props\n}: PropsWithChildren<AvatarProps>) {\n return (\n <div\n {...props}\n {...(src || srcSet ? { role: 'figure', 'aria-label': alt } : {})}\n className={classnames(\n 'flex items-center justify-center relative overflow-hidden',\n {\n 'rounded-full': !className?.includes('rounded-'),\n 'text-black': !className?.includes('text-'),\n 'bg-saffron': !className?.includes('bg-'),\n },\n className,\n )}\n style={{\n width: '48px',\n height: '48px',\n ...style,\n }}\n >\n <span className=\"flex items-center justify-center font-bold uppercase text-h6 h-full\">\n {src || srcSet ? (\n <img\n srcSet={srcSet}\n src={src}\n alt={alt}\n className={'w-full h-full object-cover transparent indent-[1000px]'}\n />\n ) : (\n initial(alt)\n )}\n {children}\n </span>\n </div>\n );\n}\n"],"names":["initial","text","Avatar","alt","src","srcSet","style","children","className","props","jsx","classnames","jsxs"],"mappings":";;AAGA,MAAMA,IAAU,CAACC,IAAO,OACfA,EACJ,MAAM,GAAG,EACT,IAAI,CAACA,MAASA,EAAK,MAAM,GAAG,CAAC,CAAC,EAC9B,KAAK,EAAE;AASL,SAASC,EAAO;AAAA,EACrB,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACH,GAAIL,KAAOC,IAAS,EAAE,MAAM,UAAU,cAAcF,EAAA,IAAQ,CAAA;AAAA,MAC7D,WAAWQ;AAAA,QACT;AAAA,QACA;AAAA,UACE,gBAAgB,EAACH,KAAA,QAAAA,EAAW,SAAS;AAAA,UACrC,cAAc,EAACA,KAAA,QAAAA,EAAW,SAAS;AAAA,UACnC,cAAc,EAACA,KAAA,QAAAA,EAAW,SAAS;AAAA,QAAK;AAAA,QAE1CA;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,GAAGF;AAAA,MAAA;AAAA,MAGL,UAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,uEACb,UAAA;AAAA,QAAAR,KAAOC,IACN,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,QAAAL;AAAA,YACA,KAAAD;AAAA,YACA,KAAAD;AAAA,YACA,WAAW;AAAA,UAAA;AAAA,QAAA,IAGbH,EAAQG,CAAG;AAAA,QAEZI;AAAA,MAAA,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Backdrop.js","sources":["../../lib/molecules/Backdrop.tsx"],"sourcesContent":["import { animated, config, useTransition } from '@react-spring/web';\nimport classnames from 'classnames';\nimport type { FunctionComponent, MouseEvent, PropsWithChildren } from 'react';\n\ninterface BackdropProps {\n /**\n * On close\n * @param event\n */\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Is visible\n */\n isVisible?: boolean;\n /**\n * Sweep Mode™\n * (makes it appear from the sides instead of from everywhere)\n */\n sweep?: boolean;\n}\n\nexport const Backdrop: FunctionComponent<PropsWithChildren<BackdropProps>> = ({\n children,\n onClose,\n isVisible,\n sweep,\n}) => {\n const transitions = useTransition(isVisible, {\n from: {\n WebkitBackdropFilter: 'blur(0px)',\n backdropFilter: 'blur(0px)',\n '--tw-bg-opacity': 0,\n x: sweep ? '-100%' : '0%',\n },\n enter: {\n WebkitBackdropFilter: 'blur(10px)',\n backdropFilter: 'blur(10px)',\n '--tw-bg-opacity': 0.8,\n x: '0%',\n },\n leave: {\n WebkitBackdropFilter: 'blur(0px)',\n backdropFilter: 'blur(0px)',\n '--tw-bg-opacity': 0,\n x: sweep ? '100%' : '0%',\n },\n config: sweep ? { tension: 200, friction: 40 } : config.gentle,\n });\n\n return transitions(\n (style, item) =>\n item && (\n <div\n role=\"presentation\"\n className=\"z-1 pointer-events-none fixed inset-0 flex items-center justify-center\"\n >\n <animated.button\n type=\"button\"\n className={classnames('-z-1 absolute inset-0 bg-white', {\n 'pointer-events-auto': isVisible,\n })}\n style={style}\n onClick={onClose}\n />\n {children}\n </div>\n ),\n );\n};\n"],"names":["Backdrop","children","onClose","isVisible","sweep","useTransition","config","style","item","jsxs","jsx","animated","classnames"],"mappings":";;;AAqBO,MAAMA,IAAgE,CAAC;AAAA,EAC5E,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AACF,MACsBC,EAAcF,GAAW;AAAA,EAC3C,MAAM;AAAA,IACJ,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAGC,IAAQ,UAAU;AAAA,EACvB;AAAA,EACA,OAAO;AAAA,IACL,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAG;AAAA,EACL;AAAA,EACA,OAAO;AAAA,IACL,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAGA,IAAQ,SAAS;AAAA,EACtB;AAAA,EACA,QAAQA,IAAQ,EAAE,SAAS,KAAK,UAAU,GAAA,IAAOE,EAAO;AAAA,CACzD;AAAA,EAGC,CAACC,GAAOC,MACNA,KACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACC,EAAS;AAAA,UAAT;AAAA,YACC,MAAK;AAAA,YACL,WAAWC,EAAW,kCAAkC;AAAA,cACtD,uBAAuBT;AAAA,YAAA,CACxB;AAAA,YACD,OAAAI;AAAA,YACA,SAASL;AAAA,UAAA;AAAA,QACX;AAAA,QACCD;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAAA;"}
1
+ {"version":3,"file":"Backdrop.js","sources":["../../lib/molecules/Backdrop.tsx"],"sourcesContent":["import { animated, config, useTransition } from '@react-spring/web';\nimport classnames from 'classnames';\nimport type { FunctionComponent, MouseEvent, PropsWithChildren } from 'react';\n\ninterface BackdropProps {\n /**\n * On close\n * @param event\n */\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Is visible\n */\n isVisible?: boolean;\n /**\n * Sweep Mode™\n * (makes it appear from the sides instead of from everywhere)\n */\n sweep?: boolean;\n}\n\nexport const Backdrop: FunctionComponent<PropsWithChildren<BackdropProps>> = ({\n children,\n onClose,\n isVisible,\n sweep,\n}) => {\n const transitions = useTransition(isVisible, {\n from: {\n WebkitBackdropFilter: 'blur(0px)',\n backdropFilter: 'blur(0px)',\n '--tw-bg-opacity': 0,\n x: sweep ? '-100%' : '0%',\n },\n enter: {\n WebkitBackdropFilter: 'blur(10px)',\n backdropFilter: 'blur(10px)',\n '--tw-bg-opacity': 0.8,\n x: '0%',\n },\n leave: {\n WebkitBackdropFilter: 'blur(0px)',\n backdropFilter: 'blur(0px)',\n '--tw-bg-opacity': 0,\n x: sweep ? '100%' : '0%',\n },\n config: sweep ? { tension: 200, friction: 40 } : config.gentle,\n });\n\n return transitions(\n (style, item) =>\n item && (\n <div\n role=\"presentation\"\n className=\"z-1 pointer-events-none fixed inset-0 flex items-center justify-center\"\n >\n <animated.button\n type=\"button\"\n className={classnames('-z-1 absolute inset-0 bg-white', {\n 'pointer-events-auto': isVisible,\n })}\n style={style}\n onClick={onClose}\n />\n {children}\n </div>\n ),\n );\n};\n"],"names":["Backdrop","children","onClose","isVisible","sweep","useTransition","config","style","item","jsxs","jsx","animated","classnames"],"mappings":";;;AAqBO,MAAMA,IAAgE,CAAC;AAAA,EAC5E,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AACF,MACsBC,EAAcF,GAAW;AAAA,EAC3C,MAAM;AAAA,IACJ,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAGC,IAAQ,UAAU;AAAA,EAAA;AAAA,EAEvB,OAAO;AAAA,IACL,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAG;AAAA,EAAA;AAAA,EAEL,OAAO;AAAA,IACL,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAGA,IAAQ,SAAS;AAAA,EAAA;AAAA,EAEtB,QAAQA,IAAQ,EAAE,SAAS,KAAK,UAAU,GAAA,IAAOE,EAAO;AAAA,CACzD;AAAA,EAGC,CAACC,GAAOC,MACNA,KACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACC,EAAS;AAAA,UAAT;AAAA,YACC,MAAK;AAAA,YACL,WAAWC,EAAW,kCAAkC;AAAA,cACtD,uBAAuBT;AAAA,YAAA,CACxB;AAAA,YACD,OAAAI;AAAA,YACA,SAASL;AAAA,UAAA;AAAA,QAAA;AAAA,QAEVD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AACH;"}
@@ -1,7 +1,6 @@
1
1
  import { jsx as e, jsxs as k } from "react/jsx-runtime";
2
2
  import { c as w } from "../chunks/index.js";
3
- import { Icon as B } from "../atoms/Icons/Icon.js";
4
- import "@clubmed/trident-icons";
3
+ import { Icon as B } from "@clubmed/trident-icons";
5
4
  const E = {
6
5
  light: {
7
6
  thStart: "text-middleGrey",
@@ -11,14 +10,14 @@ const E = {
11
10
  thStart: "text-white",
12
11
  thEnd: "text-white font-bold"
13
12
  }
14
- }, L = ({
15
- className: o,
13
+ }, I = ({
14
+ className: l,
16
15
  items: n,
17
- theme: l = "light",
18
- component: i = "a"
16
+ theme: o = "light",
17
+ component: h = "a"
19
18
  }) => {
20
- const [m, h, , ...r] = n, d = r.length ? r[r.length - 1] : n[n.length - 1], x = { label: "...", href: "" }, s = r.length ? [m, h, x, d] : n, { thStart: p, thEnd: f } = E[l], g = i;
21
- return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", className: o, children: /* @__PURE__ */ e("ul", { className: "flex items-center", children: s.map(({ label: a, href: c }, b) => {
19
+ const [i, m, , ...r] = n, d = r.length ? r[r.length - 1] : n[n.length - 1], x = { label: "...", href: "" }, s = r.length ? [i, m, x, d] : n, { thStart: p, thEnd: f } = E[o], g = h;
20
+ return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", className: l, children: /* @__PURE__ */ e("ul", { className: "flex items-center", children: s.map(({ label: a, href: c }, b) => {
22
21
  const t = b === s.length - 1, u = c && !t;
23
22
  return /* @__PURE__ */ k(
24
23
  "li",
@@ -38,6 +37,6 @@ const E = {
38
37
  }) }) });
39
38
  };
40
39
  export {
41
- L as Breadcrumb
40
+ I as Breadcrumb
42
41
  };
43
42
  //# sourceMappingURL=Breadcrumb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport type { FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon } from '@/atoms/Icons';\n\nexport interface BreadcrumbProps {\n className?: string;\n items: {\n label: string;\n href: string;\n }[];\n theme?: 'dark' | 'light';\n /**\n * Allow giving a custom component\n */\n component?: FunctionComponent<PropsWithChildren<any>> | string;\n}\n\nconst themes = {\n light: {\n thStart: 'text-middleGrey',\n thEnd: 'text-black font-bold',\n },\n dark: {\n thStart: 'text-white',\n thEnd: 'text-white font-bold',\n },\n};\n\nexport const Breadcrumb: FunctionComponent<BreadcrumbProps> = ({\n className,\n items,\n theme = 'light',\n component = 'a',\n}) => {\n const [first, second, , ...rest] = items;\n const lastItem = rest.length ? rest[rest.length - 1] : items[items.length - 1];\n const spacer = { label: '...', href: '' };\n const itemsToRender = !rest.length ? items : [first, second, spacer, lastItem];\n const { thStart, thEnd } = themes[theme];\n const Cmp = component as FunctionComponent<PropsWithChildren<{ href: string }>>;\n\n return (\n <nav data-name=\"Breadcrumb\" aria-label=\"Breadcrumb\" className={className}>\n <ul className=\"flex items-center\">\n {itemsToRender.map(({ label, href }, index) => {\n const isLast = index === itemsToRender.length - 1;\n const isLink = href && !isLast;\n return (\n <li\n key={label}\n className={classnames('text-b4 flex items-center', {\n [thStart]: !isLast,\n [thEnd]: isLast,\n })}\n {...(isLast && { 'aria-current': 'page' })}\n >\n <span>{isLink ? <Cmp href={href}>{label}</Cmp> : label}</span>\n {!isLast && <Icon name=\"Diamond\" width=\"14px\" className=\"mx-4\" />}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n};\n"],"names":["themes","Breadcrumb","className","items","theme","component","first","second","rest","lastItem","spacer","itemsToRender","thStart","thEnd","Cmp","jsx","label","href","index","isLast","isLink","jsxs","classnames","Icon"],"mappings":";;;;AAmBA,MAAMA,IAAS;AAAA,EACb,OAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AACF,GAEaC,IAAiD,CAAC;AAAA,EAC7D,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAC,IAAY;AACd,MAAM;AACJ,QAAM,CAACC,GAAOC,GAAU,EAAA,GAAGC,CAAI,IAAIL,GAC7BM,IAAWD,EAAK,SAASA,EAAKA,EAAK,SAAS,CAAC,IAAIL,EAAMA,EAAM,SAAS,CAAC,GACvEO,IAAS,EAAE,OAAO,OAAO,MAAM,GAAG,GAClCC,IAAiBH,EAAK,SAAiB,CAACF,GAAOC,GAAQG,GAAQD,CAAQ,IAAxCN,GAC/B,EAAE,SAAAS,GAAS,OAAAC,EAAM,IAAIb,EAAOI,CAAK,GACjCU,IAAMT;AAEZ,2BACG,OAAI,EAAA,aAAU,cAAa,cAAW,cAAa,WAAAH,GAClD,UAAC,gBAAAa,EAAA,MAAA,EAAG,WAAU,qBACX,YAAc,IAAI,CAAC,EAAE,OAAAC,GAAO,MAAAC,KAAQC,MAAU;AACvC,UAAAC,IAASD,MAAUP,EAAc,SAAS,GAC1CS,IAASH,KAAQ,CAACE;AAEtB,WAAA,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWC,EAAW,6BAA6B;AAAA,UACjD,CAACV,CAAO,GAAG,CAACO;AAAA,UACZ,CAACN,CAAK,GAAGM;AAAA,QAAA,CACV;AAAA,QACA,GAAIA,KAAU,EAAE,gBAAgB,OAAO;AAAA,QAExC,UAAA;AAAA,UAAA,gBAAAJ,EAAC,UAAM,UAASK,IAAA,gBAAAL,EAACD,KAAI,MAAAG,GAAa,UAAAD,GAAM,IAASA,EAAM,CAAA;AAAA,UACtD,CAACG,KAAW,gBAAAJ,EAAAQ,GAAA,EAAK,MAAK,WAAU,OAAM,QAAO,WAAU,QAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAR1DP;AAAA,IAAA;AAAA,EASP,CAEH,GACH,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport type { FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon } from '@clubmed/trident-icons';\n\nexport interface BreadcrumbProps {\n className?: string;\n items: {\n label: string;\n href: string;\n }[];\n theme?: 'dark' | 'light';\n /**\n * Allow giving a custom component\n */\n component?: FunctionComponent<PropsWithChildren<any>> | string;\n}\n\nconst themes = {\n light: {\n thStart: 'text-middleGrey',\n thEnd: 'text-black font-bold',\n },\n dark: {\n thStart: 'text-white',\n thEnd: 'text-white font-bold',\n },\n};\n\nexport const Breadcrumb: FunctionComponent<BreadcrumbProps> = ({\n className,\n items,\n theme = 'light',\n component = 'a',\n}) => {\n const [first, second, , ...rest] = items;\n const lastItem = rest.length ? rest[rest.length - 1] : items[items.length - 1];\n const spacer = { label: '...', href: '' };\n const itemsToRender = !rest.length ? items : [first, second, spacer, lastItem];\n const { thStart, thEnd } = themes[theme];\n const Cmp = component as FunctionComponent<PropsWithChildren<{ href: string }>>;\n\n return (\n <nav data-name=\"Breadcrumb\" aria-label=\"Breadcrumb\" className={className}>\n <ul className=\"flex items-center\">\n {itemsToRender.map(({ label, href }, index) => {\n const isLast = index === itemsToRender.length - 1;\n const isLink = href && !isLast;\n return (\n <li\n key={label}\n className={classnames('text-b4 flex items-center', {\n [thStart]: !isLast,\n [thEnd]: isLast,\n })}\n {...(isLast && { 'aria-current': 'page' })}\n >\n <span>{isLink ? <Cmp href={href}>{label}</Cmp> : label}</span>\n {!isLast && <Icon name=\"Diamond\" width=\"14px\" className=\"mx-4\" />}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n};\n"],"names":["themes","Breadcrumb","className","items","theme","component","first","second","rest","lastItem","spacer","itemsToRender","thStart","thEnd","Cmp","jsx","label","href","index","isLast","isLink","jsxs","classnames","Icon"],"mappings":";;;AAmBA,MAAMA,IAAS;AAAA,EACb,OAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAAA,EAET,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAEX,GAEaC,IAAiD,CAAC;AAAA,EAC7D,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAC,IAAY;AACd,MAAM;AACJ,QAAM,CAACC,GAAOC,KAAU,GAAGC,CAAI,IAAIL,GAC7BM,IAAWD,EAAK,SAASA,EAAKA,EAAK,SAAS,CAAC,IAAIL,EAAMA,EAAM,SAAS,CAAC,GACvEO,IAAS,EAAE,OAAO,OAAO,MAAM,GAAA,GAC/BC,IAAiBH,EAAK,SAAiB,CAACF,GAAOC,GAAQG,GAAQD,CAAQ,IAAxCN,GAC/B,EAAE,SAAAS,GAAS,OAAAC,MAAUb,EAAOI,CAAK,GACjCU,IAAMT;AAEZ,2BACG,OAAA,EAAI,aAAU,cAAa,cAAW,cAAa,WAAAH,GAClD,UAAA,gBAAAa,EAAC,MAAA,EAAG,WAAU,qBACX,YAAc,IAAI,CAAC,EAAE,OAAAC,GAAO,MAAAC,EAAA,GAAQC,MAAU;AAC7C,UAAMC,IAASD,MAAUP,EAAc,SAAS,GAC1CS,IAASH,KAAQ,CAACE;AACxB,WACE,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWC,EAAW,6BAA6B;AAAA,UACjD,CAACV,CAAO,GAAG,CAACO;AAAA,UACZ,CAACN,CAAK,GAAGM;AAAA,QAAA,CACV;AAAA,QACA,GAAIA,KAAU,EAAE,gBAAgB,OAAA;AAAA,QAEjC,UAAA;AAAA,UAAA,gBAAAJ,EAAC,UAAM,UAAAK,IAAS,gBAAAL,EAACD,KAAI,MAAAG,GAAa,UAAAD,GAAM,IAASA,EAAA,CAAM;AAAA,UACtD,CAACG,KAAU,gBAAAJ,EAACQ,GAAA,EAAK,MAAK,WAAU,OAAM,QAAO,WAAU,OAAA,CAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAR1DP;AAAA,IAAA;AAAA,EAWX,CAAC,GACH,GACF;AAEJ;"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentProps, FunctionComponent } from 'react';
2
+ import { Button } from './Button';
3
+ interface Props extends ComponentProps<typeof Button> {
4
+ icon: 'ArrowDefaultLeft' | 'ArrowDefaultRight' | 'ArrowTailLeft' | 'ArrowTailRight';
5
+ }
6
+ export declare const ArrowButton: FunctionComponent<Props>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { BUTTON_VARIANT_LEGACY as a, BUTTON_THEME_LEGACY as e, Button as m } from "./Button.js";
3
+ const c = ({ children: r, ...t }) => {
4
+ const n = {
5
+ ...t,
6
+ ...e[t.theme] || {},
7
+ ...a[t.variant] || {}
8
+ };
9
+ return /* @__PURE__ */ o(m, { ...n, variant: "circle", children: r && /* @__PURE__ */ o("span", { className: "sr-only", children: r }) });
10
+ };
11
+ export {
12
+ c as ArrowButton
13
+ };
14
+ //# sourceMappingURL=ArrowButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowButton.js","sources":["../../../lib/molecules/Buttons/ArrowButton.tsx"],"sourcesContent":["import type { ComponentProps, FunctionComponent } from 'react';\n\nimport { Button } from './Button';\nimport { BUTTON_THEME_LEGACY, BUTTON_VARIANT_LEGACY } from '@/molecules/Buttons/Button';\n\ninterface Props extends ComponentProps<typeof Button> {\n icon: 'ArrowDefaultLeft' | 'ArrowDefaultRight' | 'ArrowTailLeft' | 'ArrowTailRight';\n}\n\nexport const ArrowButton: FunctionComponent<Props> = ({ children, ...props }) => {\n const opts = {\n ...props,\n ...(BUTTON_THEME_LEGACY[props.theme!] || {}),\n ...(BUTTON_VARIANT_LEGACY[props.variant!] || {}),\n };\n\n return (\n <Button {...opts} variant=\"circle\">\n {children && <span className=\"sr-only\">{children}</span>}\n </Button>\n );\n};\n"],"names":["ArrowButton","children","props","opts","BUTTON_THEME_LEGACY","BUTTON_VARIANT_LEGACY","jsx","Button"],"mappings":";;AASO,MAAMA,IAAwC,CAAC,EAAE,UAAAC,GAAU,GAAGC,QAAY;AAC/E,QAAMC,IAAO;AAAA,IACX,GAAGD;AAAA,IACH,GAAIE,EAAoBF,EAAM,KAAM,KAAK,CAAA;AAAA,IACzC,GAAIG,EAAsBH,EAAM,OAAQ,KAAK,CAAA;AAAA,EAAC;AAGhD,SACE,gBAAAI,EAACC,GAAA,EAAQ,GAAGJ,GAAM,SAAQ,UACvB,UAAAF,KAAY,gBAAAK,EAAC,QAAA,EAAK,WAAU,WAAW,UAAAL,EAAA,CAAS,GACnD;AAEJ;"}
@@ -1,30 +1,26 @@
1
- import { type ButtonHTMLAttributes, type FunctionComponent, type MouseEventHandler, type ReactNode } from 'react';
2
- import './button.css';
3
- import type { IconicNames, IconicTypes } from '../../atoms/Icons/index.js';
4
- export interface CommonButtonProps {
1
+ import { type ButtonHTMLAttributes, type FunctionComponent, type ReactNode } from 'react';
2
+ import { type ButtonProps as ButtonPropsV2 } from './v2/Button.js';
3
+ import type { IconicNames, IconicTypes } from '@clubmed/trident-icons';
4
+ export declare const BUTTON_THEME_LEGACY: any;
5
+ export declare const BUTTON_VARIANT_LEGACY: any;
6
+ export type ButtonPropsLegacy = {
5
7
  /**
6
8
  * Button themes defining background color and text/icon color
7
9
  */
8
- theme?: 'yellow' | 'white' | 'black' | 'whiteStroke' | 'blackStroke';
10
+ theme?: 'yellow' | 'white' | 'black' | 'whiteStroke' | 'blackStroke' | ButtonPropsV2['theme'];
9
11
  /**
10
12
  * Is it a text button? An icon button? An arrow button?
11
13
  */
12
- variant?: 'text' | 'textSmall' | 'icon' | 'arrow';
14
+ variant?: 'text' | 'textSmall' | 'icon' | 'arrow' | 'monogram' | ButtonPropsV2['variant'];
13
15
  /**
14
16
  * Background Color override
15
17
  * Ideally please use ONLY for the "white" and "black" themes
18
+ * @deprecated
16
19
  */
17
20
  backgroundOverride?: string;
18
- /**
19
- * Additional class names
20
- */
21
- className?: string;
22
- /**
23
- * Button title
24
- */
25
- title?: string;
26
21
  /**
27
22
  * Button contents
23
+ * @deprecated
28
24
  */
29
25
  label?: string;
30
26
  /**
@@ -39,31 +35,18 @@ export interface CommonButtonProps {
39
35
  * Force the icon type to be svg, font or default
40
36
  */
41
37
  iconType?: IconicTypes;
42
- /**
43
- * Data test id
44
- */
45
- dataTestId?: string;
46
38
  /**
47
39
  * Group name
48
40
  * Used to group buttons together (you might not need this)
41
+ * @deprecated
49
42
  */
50
43
  groupName?: string;
51
- }
52
- interface ButtonProps extends CommonButtonProps, ButtonHTMLAttributes<HTMLButtonElement> {
53
- /**
54
- * Optional click handler
55
- */
56
- onClick?: MouseEventHandler<HTMLButtonElement>;
57
- /**
58
- * Button tabIndex
59
- *
60
- * @default 0
61
- */
62
- tabIndex?: number;
63
44
  /**
64
- * Data test id
45
+ * @deprecated use `data-testid` instead
65
46
  */
66
47
  dataTestId?: string;
67
- }
48
+ };
49
+ export type CommonButtonProps = Omit<ButtonPropsV2, 'theme' | 'variant'> & ButtonPropsLegacy;
50
+ type ButtonProps = CommonButtonProps & ButtonHTMLAttributes<HTMLButtonElement>;
68
51
  export declare const Button: FunctionComponent<ButtonProps>;
69
52
  export {};
@@ -1,47 +1,57 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { c as C } from "../../chunks/index.js";
1
+ import { jsxs as l } from "react/jsx-runtime";
3
2
  import "react";
4
- /* empty css */
5
- import { variants as N, rootClassName as b } from "./Button.helpers.js";
6
- import { themes as d } from "./Button.themes.js";
7
- import { ButtonContent as j } from "./ButtonContent.js";
8
- const A = ({
9
- type: r = "button",
10
- theme: s = "yellow",
11
- backgroundOverride: a,
12
- variant: t = "text",
13
- className: p,
14
- label: o,
15
- children: c,
16
- title: m,
17
- icon: i,
18
- iconType: l,
19
- tabIndex: u = 0,
20
- disabled: e = !1,
21
- dataTestId: f,
22
- groupName: x = "",
23
- ...h
24
- }) => {
25
- const B = t === "text" || t === "textSmall", w = N[t], y = d(s, a, x);
26
- return /* @__PURE__ */ n(
27
- "button",
28
- {
29
- ...h,
30
- "data-name": "Button",
31
- "data-testid": f,
32
- type: r,
33
- className: C(b, y, w, t, p, {
34
- "pointer-events-none": e
35
- }),
36
- disabled: e,
37
- tabIndex: e ? -1 : u,
38
- title: m || o,
39
- "aria-label": m || o,
40
- children: /* @__PURE__ */ n(j, { showLabel: B, label: o, icon: i, iconType: l, children: c })
41
- }
42
- );
3
+ import { Button as i } from "./v2/Button.js";
4
+ const a = {
5
+ white: {
6
+ color: "white",
7
+ theme: "solid"
8
+ },
9
+ black: {
10
+ color: "black",
11
+ theme: "solid"
12
+ },
13
+ yellow: {
14
+ color: "saffron",
15
+ theme: "solid"
16
+ },
17
+ whiteStroke: {
18
+ color: "white",
19
+ theme: "outline"
20
+ },
21
+ blackStroke: {
22
+ color: "black",
23
+ theme: "outline"
24
+ }
25
+ }, r = {
26
+ textSmall: {
27
+ size: "small",
28
+ variant: void 0
29
+ },
30
+ icon: {
31
+ variant: "circle",
32
+ label: void 0
33
+ },
34
+ arrow: {
35
+ variant: "circle",
36
+ label: void 0,
37
+ size: "large"
38
+ }
39
+ }, c = ({ dataTestId: o, ...t }) => {
40
+ const e = {
41
+ "data-testid": o,
42
+ ...t,
43
+ ...a[t.theme] || {},
44
+ ...r[t.variant] || {}
45
+ };
46
+ return /* @__PURE__ */ l(i, { ...e, children: [
47
+ e.label,
48
+ t.children
49
+ ] });
43
50
  };
51
+ c.displayName = "Button";
44
52
  export {
45
- A as Button
53
+ a as BUTTON_THEME_LEGACY,
54
+ r as BUTTON_VARIANT_LEGACY,
55
+ c as Button
46
56
  };
47
57
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../lib/molecules/Buttons/Button.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport {\n type ButtonHTMLAttributes,\n type FunctionComponent,\n type MouseEventHandler,\n type ReactNode,\n} from 'react';\nimport './button.css';\nimport { rootClassName, variants } from './Button.helpers';\nimport { themes } from './Button.themes';\nimport { ButtonContent } from './ButtonContent';\nimport type { IconicNames, IconicTypes } from '@/atoms/Icons/index.js';\n\nexport interface CommonButtonProps {\n /**\n * Button themes defining background color and text/icon color\n */\n theme?: 'yellow' | 'white' | 'black' | 'whiteStroke' | 'blackStroke';\n /**\n * Is it a text button? An icon button? An arrow button?\n */\n variant?: 'text' | 'textSmall' | 'icon' | 'arrow';\n /**\n * Background Color override\n * Ideally please use ONLY for the \"white\" and \"black\" themes\n */\n backgroundOverride?: string;\n /**\n * Additional class names\n */\n className?: string;\n /**\n * Button title\n */\n title?: string;\n /**\n * Button contents\n */\n label?: string;\n /**\n * Optional children (you might never use this, please actually try to avoid it)\n */\n children?: ReactNode;\n /**\n * Optional icon name\n */\n icon?: IconicNames;\n /**\n * Force the icon type to be svg, font or default\n */\n iconType?: IconicTypes;\n /**\n * Data test id\n */\n dataTestId?: string;\n /**\n * Group name\n * Used to group buttons together (you might not need this)\n */\n groupName?: string;\n}\n\ninterface ButtonProps extends CommonButtonProps, ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Optional click handler\n */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /**\n * Button tabIndex\n *\n * @default 0\n */\n tabIndex?: number;\n /**\n * Data test id\n */\n dataTestId?: string;\n}\n\nexport const Button: FunctionComponent<ButtonProps> = ({\n type = 'button',\n theme: themeName = 'yellow',\n backgroundOverride,\n variant = 'text',\n className,\n label,\n children,\n title,\n icon,\n iconType,\n tabIndex = 0,\n disabled = false,\n dataTestId,\n groupName = '',\n ...rest\n}) => {\n const showLabel = variant === 'text' || variant === 'textSmall';\n const layout = variants[variant];\n const theme = themes(themeName, backgroundOverride, groupName);\n\n return (\n <button\n {...rest}\n data-name=\"Button\"\n data-testid={dataTestId}\n type={type}\n className={classNames(rootClassName, theme, layout, variant, className, {\n 'pointer-events-none': disabled,\n })}\n disabled={disabled}\n tabIndex={disabled ? -1 : tabIndex}\n title={title || label}\n aria-label={title || label}\n >\n <ButtonContent showLabel={showLabel} label={label} icon={icon} iconType={iconType}>\n {children}\n </ButtonContent>\n </button>\n );\n};\n"],"names":["Button","type","themeName","backgroundOverride","variant","className","label","children","title","icon","iconType","tabIndex","disabled","dataTestId","groupName","rest","showLabel","layout","variants","theme","themes","jsx","classNames","rootClassName","ButtonContent"],"mappings":";;;;;;;AA+EO,MAAMA,IAAyC,CAAC;AAAA,EACrD,MAAAC,IAAO;AAAA,EACP,OAAOC,IAAY;AAAA,EACnB,oBAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACE,QAAAC,IAAYZ,MAAY,UAAUA,MAAY,aAC9Ca,IAASC,EAASd,CAAO,GACzBe,IAAQC,EAAOlB,GAAWC,GAAoBW,CAAS;AAG3D,SAAA,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGN;AAAA,MACJ,aAAU;AAAA,MACV,eAAaF;AAAA,MACb,MAAAZ;AAAA,MACA,WAAWqB,EAAWC,GAAeJ,GAAOF,GAAQb,GAASC,GAAW;AAAA,QACtE,uBAAuBO;AAAA,MAAA,CACxB;AAAA,MACD,UAAAA;AAAA,MACA,UAAUA,IAAW,KAAKD;AAAA,MAC1B,OAAOH,KAASF;AAAA,MAChB,cAAYE,KAASF;AAAA,MAErB,4BAACkB,GAAc,EAAA,WAAAR,GAAsB,OAAAV,GAAc,MAAAG,GAAY,UAAAC,GAC5D,UAAAH,GACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../lib/molecules/Buttons/Button.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, type FunctionComponent, type ReactNode } from 'react';\nimport { Button as ButtonV2, type ButtonProps as ButtonPropsV2 } from './v2/Button.js';\nimport type { IconicNames, IconicTypes } from '@clubmed/trident-icons';\n\nexport const BUTTON_THEME_LEGACY: any = {\n white: {\n color: 'white',\n theme: 'solid',\n },\n black: {\n color: 'black',\n theme: 'solid',\n },\n yellow: {\n color: 'saffron',\n theme: 'solid',\n },\n whiteStroke: {\n color: 'white',\n theme: 'outline',\n },\n blackStroke: {\n color: 'black',\n theme: 'outline',\n },\n};\n\nexport const BUTTON_VARIANT_LEGACY: any = {\n textSmall: {\n size: 'small',\n variant: undefined,\n },\n icon: {\n variant: 'circle',\n label: undefined,\n },\n arrow: {\n variant: 'circle',\n label: undefined,\n size: 'large',\n },\n};\n\nexport type ButtonPropsLegacy = {\n /**\n * Button themes defining background color and text/icon color\n */\n theme?: 'yellow' | 'white' | 'black' | 'whiteStroke' | 'blackStroke' | ButtonPropsV2['theme'];\n /**\n * Is it a text button? An icon button? An arrow button?\n */\n variant?: 'text' | 'textSmall' | 'icon' | 'arrow' | 'monogram' | ButtonPropsV2['variant'];\n /**\n * Background Color override\n * Ideally please use ONLY for the \"white\" and \"black\" themes\n * @deprecated\n */\n backgroundOverride?: string;\n /**\n * Button contents\n * @deprecated\n */\n label?: string;\n /**\n * Optional children (you might never use this, please actually try to avoid it)\n */\n children?: ReactNode;\n /**\n * Optional icon name\n */\n icon?: IconicNames;\n /**\n * Force the icon type to be svg, font or default\n */\n iconType?: IconicTypes;\n /**\n * Group name\n * Used to group buttons together (you might not need this)\n * @deprecated\n */\n groupName?: string;\n /**\n * @deprecated use `data-testid` instead\n */\n dataTestId?: string;\n};\n\nexport type CommonButtonProps = Omit<ButtonPropsV2, 'theme' | 'variant'> & ButtonPropsLegacy;\n\ntype ButtonProps = CommonButtonProps & ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Button: FunctionComponent<ButtonProps> = ({ dataTestId, ...props }) => {\n const opts = {\n 'data-testid': dataTestId,\n ...props,\n ...(BUTTON_THEME_LEGACY[props.theme!] || {}),\n ...(BUTTON_VARIANT_LEGACY[props.variant!] || {}),\n };\n\n return (\n <ButtonV2 {...opts}>\n {opts.label}\n {props.children}\n </ButtonV2>\n );\n};\n\nButton.displayName = 'Button';\n"],"names":["BUTTON_THEME_LEGACY","BUTTON_VARIANT_LEGACY","Button","dataTestId","props","opts","jsxs","ButtonV2"],"mappings":";;;AAIO,MAAMA,IAA2B;AAAA,EACtC,OAAO;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,OAAO;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,aAAa;AAAA,IACX,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,aAAa;AAAA,IACX,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX,GAEaC,IAA6B;AAAA,EACxC,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAAA,EAET,OAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAEV,GAkDaC,IAAyC,CAAC,EAAE,YAAAC,GAAY,GAAGC,QAAY;AAClF,QAAMC,IAAO;AAAA,IACX,eAAeF;AAAA,IACf,GAAGC;AAAA,IACH,GAAIJ,EAAoBI,EAAM,KAAM,KAAK,CAAA;AAAA,IACzC,GAAIH,EAAsBG,EAAM,OAAQ,KAAK,CAAA;AAAA,EAAC;AAGhD,SACE,gBAAAE,EAACC,GAAA,EAAU,GAAGF,GACX,UAAA;AAAA,IAAAA,EAAK;AAAA,IACLD,EAAM;AAAA,EAAA,GACT;AAEJ;AAEAF,EAAO,cAAc;"}
@@ -1,8 +1,12 @@
1
1
  import type { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';
2
- import './button.css';
3
2
  import { type CommonButtonProps } from './Button';
4
- interface ButtonAnchorProps extends CommonButtonProps, AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ type ButtonAnchorProps = CommonButtonProps & {
5
4
  component?: FunctionComponent<PropsWithChildren<any>> | string;
6
- }
5
+ } & AnchorHTMLAttributes<HTMLAnchorElement>;
6
+ /**
7
+ * @deprecated use Button with `component="a"` instead
8
+ * @param dataTestId
9
+ * @param props
10
+ */
7
11
  export declare const ButtonAnchor: FunctionComponent<ButtonAnchorProps>;
8
12
  export {};
@@ -1,40 +1,21 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { c as C } from "../../chunks/index.js";
3
- /* empty css */
4
- import "react";
5
- import { variants as y, rootClassName as B } from "./Button.helpers.js";
6
- import { themes as w } from "./Button.themes.js";
7
- import { ButtonContent as A } from "./ButtonContent.js";
8
- const D = ({
9
- theme: s = "yellow",
10
- component: r = "a",
11
- backgroundOverride: e,
12
- variant: t = "text",
13
- className: n,
14
- label: o,
15
- children: a,
16
- title: c,
17
- icon: p,
18
- dataTestId: i,
19
- href: l,
20
- groupName: f = "",
21
- ...h
22
- }) => {
23
- const u = t === "text", d = y[t], x = w(s, e, f);
24
- return /* @__PURE__ */ m(
25
- r,
26
- {
27
- "data-name": "ButtonAnchor",
28
- "data-testid": i,
29
- className: C(B, x, d, t, n),
30
- title: c || o,
31
- href: l,
32
- ...h,
33
- children: /* @__PURE__ */ m(A, { showLabel: u, label: o, icon: p, children: a })
34
- }
35
- );
1
+ import { jsxs as e } from "react/jsx-runtime";
2
+ import { BUTTON_VARIANT_LEGACY as m, BUTTON_THEME_LEGACY as r } from "./Button.js";
3
+ import { Button as a } from "./v2/Button.js";
4
+ const c = ({ dataTestId: o, ...t }) => {
5
+ const n = {
6
+ "data-testid": o,
7
+ ...t,
8
+ component: t.component || "a",
9
+ ...r[t.theme] || {},
10
+ ...m[t.variant] || {}
11
+ };
12
+ return /* @__PURE__ */ e(a, { ...n, children: [
13
+ n.label,
14
+ t.children
15
+ ] });
36
16
  };
17
+ c.displayName = "ButtonAnchor";
37
18
  export {
38
- D as ButtonAnchor
19
+ c as ButtonAnchor
39
20
  };
40
21
  //# sourceMappingURL=ButtonAnchor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonAnchor.js","sources":["../../../lib/molecules/Buttons/ButtonAnchor.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';\nimport './button.css';\nimport { type CommonButtonProps } from './Button';\nimport { rootClassName, variants } from './Button.helpers';\nimport { themes } from './Button.themes';\nimport { ButtonContent } from './ButtonContent';\n\ninterface ButtonAnchorProps extends CommonButtonProps, AnchorHTMLAttributes<HTMLAnchorElement> {\n component?: FunctionComponent<PropsWithChildren<any>> | string;\n}\n\nexport const ButtonAnchor: FunctionComponent<ButtonAnchorProps> = ({\n theme = 'yellow',\n component = 'a',\n backgroundOverride,\n variant = 'text',\n className,\n label,\n children,\n title,\n icon,\n dataTestId,\n href,\n groupName = '',\n ...rest\n}) => {\n const showLabel = variant === 'text';\n const layout = variants[variant];\n const style = themes(theme, backgroundOverride, groupName);\n const Cmp = component as FunctionComponent<PropsWithChildren<ButtonAnchorProps>>;\n\n return (\n <Cmp\n data-name=\"ButtonAnchor\"\n data-testid={dataTestId}\n className={classNames(rootClassName, style, layout, variant, className)}\n title={title || label}\n href={href}\n {...rest}\n >\n <ButtonContent showLabel={showLabel} label={label} icon={icon}>\n {children}\n </ButtonContent>\n </Cmp>\n );\n};\n"],"names":["ButtonAnchor","theme","component","backgroundOverride","variant","className","label","children","title","icon","dataTestId","href","groupName","rest","showLabel","layout","variants","style","themes","jsx","classNames","rootClassName","ButtonContent"],"mappings":";;;;;;;AAYO,MAAMA,IAAqD,CAAC;AAAA,EACjE,OAAAC,IAAQ;AAAA,EACR,WAAAC,IAAY;AAAA,EACZ,oBAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAYV,MAAY,QACxBW,IAASC,EAASZ,CAAO,GACzBa,IAAQC,EAAOjB,GAAOE,GAAoBS,CAAS;AAIvD,SAAA,gBAAAO;AAAA,IAHUjB;AAAA,IAGT;AAAA,MACC,aAAU;AAAA,MACV,eAAaQ;AAAA,MACb,WAAWU,EAAWC,GAAeJ,GAAOF,GAAQX,GAASC,CAAS;AAAA,MACtE,OAAOG,KAASF;AAAA,MAChB,MAAAK;AAAA,MACC,GAAGE;AAAA,MAEJ,UAAC,gBAAAM,EAAAG,GAAA,EAAc,WAAAR,GAAsB,OAAAR,GAAc,MAAAG,GAChD,UAAAF,GACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ButtonAnchor.js","sources":["../../../lib/molecules/Buttons/ButtonAnchor.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';\nimport { BUTTON_THEME_LEGACY, BUTTON_VARIANT_LEGACY, type CommonButtonProps } from './Button';\nimport { Button } from '@/molecules/Buttons/v2/Button';\n\ntype ButtonAnchorProps = CommonButtonProps & {\n component?: FunctionComponent<PropsWithChildren<any>> | string;\n} & AnchorHTMLAttributes<HTMLAnchorElement>;\n\n/**\n * @deprecated use Button with `component=\"a\"` instead\n * @param dataTestId\n * @param props\n */\nexport const ButtonAnchor: FunctionComponent<ButtonAnchorProps> = ({ dataTestId, ...props }) => {\n const opts = {\n 'data-testid': dataTestId,\n ...props,\n component: props.component || 'a',\n ...(BUTTON_THEME_LEGACY[props.theme!] || {}),\n ...(BUTTON_VARIANT_LEGACY[props.variant!] || {}),\n };\n\n return (\n <Button {...opts}>\n {opts.label}\n {props.children}\n </Button>\n );\n};\n\nButtonAnchor.displayName = 'ButtonAnchor';\n"],"names":["ButtonAnchor","dataTestId","props","opts","BUTTON_THEME_LEGACY","BUTTON_VARIANT_LEGACY","jsxs","Button"],"mappings":";;;AAaO,MAAMA,IAAqD,CAAC,EAAE,YAAAC,GAAY,GAAGC,QAAY;AAC9F,QAAMC,IAAO;AAAA,IACX,eAAeF;AAAA,IACf,GAAGC;AAAA,IACH,WAAWA,EAAM,aAAa;AAAA,IAC9B,GAAIE,EAAoBF,EAAM,KAAM,KAAK,CAAA;AAAA,IACzC,GAAIG,EAAsBH,EAAM,OAAQ,KAAK,CAAA;AAAA,EAAC;AAGhD,SACE,gBAAAI,EAACC,GAAA,EAAQ,GAAGJ,GACT,UAAA;AAAA,IAAAA,EAAK;AAAA,IACLD,EAAM;AAAA,EAAA,GACT;AAEJ;AAEAF,EAAa,cAAc;"}
@@ -1,9 +1,17 @@
1
1
  import type { FunctionComponent, ReactNode } from 'react';
2
- import { type IconicNames, type IconicTypes } from '../../atoms/Icons';
3
- export declare const ButtonContent: FunctionComponent<{
4
- showLabel: boolean;
2
+ import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
3
+ export type ButtonContentProps = {
4
+ /**
5
+ * @deprecated
6
+ */
7
+ showLabel?: boolean;
8
+ /**
9
+ * @deprecated
10
+ */
5
11
  label?: string;
6
12
  children?: ReactNode;
7
13
  icon?: IconicNames;
8
14
  iconType?: IconicTypes;
9
- }>;
15
+ iconWidth?: string;
16
+ };
17
+ export declare const ButtonContent: FunctionComponent<ButtonContentProps>;
@@ -1,12 +1,18 @@
1
- import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import { Icon as p } from "../../atoms/Icons/Icon.js";
3
- import "@clubmed/trident-icons";
4
- const l = ({ showLabel: r, label: t, children: s, icon: e, iconType: o }) => /* @__PURE__ */ m("span", { className: "flex items-center justify-center gap-x-8 w-full", children: [
5
- r ? t : /* @__PURE__ */ n("span", { className: "sr-only", children: t }),
6
- s,
7
- e && /* @__PURE__ */ n(p, { width: "24px", name: e, type: o })
1
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
2
+ import { Icon as c } from "@clubmed/trident-icons";
3
+ const x = ({
4
+ showLabel: s,
5
+ label: t,
6
+ children: r,
7
+ icon: e,
8
+ iconType: o,
9
+ iconWidth: m
10
+ }) => /* @__PURE__ */ p("span", { className: "flex items-center justify-center gap-x-8 w-full", children: [
11
+ s ? t : t && /* @__PURE__ */ n("span", { className: "sr-only", children: t }),
12
+ r,
13
+ e && /* @__PURE__ */ n(c, { name: e, width: m ?? "24px", type: o })
8
14
  ] });
9
15
  export {
10
- l as ButtonContent
16
+ x as ButtonContent
11
17
  };
12
18
  //# sourceMappingURL=ButtonContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonContent.js","sources":["../../../lib/molecules/Buttons/ButtonContent.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\n\nexport const ButtonContent: FunctionComponent<{\n showLabel: boolean;\n label?: string;\n children?: ReactNode;\n icon?: IconicNames;\n iconType?: IconicTypes;\n}> = ({ showLabel, label, children, icon, iconType }) => {\n return (\n <span className=\"flex items-center justify-center gap-x-8 w-full\">\n {showLabel ? label : <span className=\"sr-only\">{label}</span>}\n {children}\n {icon && <Icon width=\"24px\" name={icon} type={iconType} />}\n </span>\n );\n};\n"],"names":["ButtonContent","showLabel","label","children","icon","iconType","jsxs","jsx","Icon"],"mappings":";;;AAIa,MAAAA,IAMR,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,MAAAC,GAAM,UAAAC,QAEtC,gBAAAC,EAAC,QAAK,EAAA,WAAU,mDACb,UAAA;AAAA,EAAAL,IAAYC,IAAQ,gBAAAK,EAAC,QAAK,EAAA,WAAU,WAAW,UAAML,GAAA;AAAA,EACrDC;AAAA,EACAC,uBAASI,GAAK,EAAA,OAAM,QAAO,MAAMJ,GAAM,MAAMC,GAAU;AAC1D,EAAA,CAAA;"}
1
+ {"version":3,"file":"ButtonContent.js","sources":["../../../lib/molecules/Buttons/ButtonContent.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\n\nexport type ButtonContentProps = {\n /**\n * @deprecated\n */\n showLabel?: boolean;\n /**\n * @deprecated\n */\n label?: string;\n children?: ReactNode;\n icon?: IconicNames;\n iconType?: IconicTypes;\n iconWidth?: string;\n};\n\nexport const ButtonContent: FunctionComponent<ButtonContentProps> = ({\n showLabel,\n label,\n children,\n icon,\n iconType,\n iconWidth,\n}) => {\n return (\n <span className=\"flex items-center justify-center gap-x-8 w-full\">\n {showLabel ? label : label && <span className=\"sr-only\">{label}</span>}\n {children}\n {icon && <Icon name={icon} width={iconWidth ?? '24px'} type={iconType} />}\n </span>\n );\n};\n"],"names":["ButtonContent","showLabel","label","children","icon","iconType","iconWidth","jsxs","jsx","Icon"],"mappings":";;AAmBO,MAAMA,IAAuD,CAAC;AAAA,EACnE,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,MAEI,gBAAAC,EAAC,QAAA,EAAK,WAAU,mDACb,UAAA;AAAA,EAAAN,IAAYC,IAAQA,KAAS,gBAAAM,EAAC,QAAA,EAAK,WAAU,WAAW,UAAAN,GAAM;AAAA,EAC9DC;AAAA,EACAC,uBAASK,GAAA,EAAK,MAAML,GAAM,OAAOE,KAAa,QAAQ,MAAMD,EAAA,CAAU;AAAA,GACzE;"}
@@ -0,0 +1,8 @@
1
+ import type { FunctionComponent } from 'react';
2
+ import './v2/Button.css';
3
+ import { type FakeButtonProps } from './v2/Button';
4
+ /**
5
+ * @deprecated use Button with `component="span"` instead
6
+ * @param props
7
+ */
8
+ export declare const FakeButton: FunctionComponent<Omit<FakeButtonProps, 'component'>>;
@@ -0,0 +1,8 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { Button as o } from "./v2/Button.js";
3
+ const e = (t) => /* @__PURE__ */ n(o, { component: "span", ...t, children: t.children });
4
+ e.displayName = "FakeButton";
5
+ export {
6
+ e as FakeButton
7
+ };
8
+ //# sourceMappingURL=FakeButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeButton.js","sources":["../../../lib/molecules/Buttons/FakeButton.tsx"],"sourcesContent":["import type { FunctionComponent } from 'react';\n\nimport './v2/Button.css';\nimport { Button, type FakeButtonProps } from '@/molecules/Buttons/v2/Button';\n\n/**\n * @deprecated use Button with `component=\"span\"` instead\n * @param props\n */\nexport const FakeButton: FunctionComponent<Omit<FakeButtonProps, 'component'>> = (props) => {\n return (\n <Button component={'span'} {...props}>\n {props.children}\n </Button>\n );\n};\n\nFakeButton.displayName = 'FakeButton';\n"],"names":["FakeButton","props","Button"],"mappings":";;AASO,MAAMA,IAAoE,CAACC,wBAE7EC,GAAA,EAAO,WAAW,QAAS,GAAGD,GAC5B,YAAM,UACT;AAIJD,EAAW,cAAc;"}
@@ -1,3 +1,7 @@
1
1
  import type { FunctionComponent } from 'react';
2
2
  import { type CommonButtonProps } from './Button';
3
+ /**
4
+ * @deprecated use Button with `component="span"` instead
5
+ * @param props
6
+ */
3
7
  export declare const InertButton: FunctionComponent<CommonButtonProps>;