@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.
- package/CHANGELOG.md +961 -860
- package/README.md +11 -1
- package/assets/style.css +1 -1
- package/atoms/Clickable/Clickable.d.ts +5 -0
- package/atoms/Clickable/Clickable.js +25 -0
- package/atoms/Clickable/Clickable.js.map +1 -0
- package/atoms/Heading/Heading.d.ts +6 -0
- package/atoms/Heading/Heading.js +14 -0
- package/atoms/Heading/Heading.js.map +1 -0
- package/atoms/Heading/HeadingGroup.d.ts +7 -0
- package/atoms/Heading/HeadingGroup.js +15 -0
- package/atoms/Heading/HeadingGroup.js.map +1 -0
- package/atoms/Image/Image.d.ts +7 -0
- package/atoms/Image/Image.js +18 -0
- package/atoms/Image/Image.js.map +1 -0
- package/atoms/Prose/Prose.d.ts +5 -0
- package/atoms/Prose/Prose.js +18 -0
- package/atoms/Prose/Prose.js.map +1 -0
- package/chunks/ResizeObserver.js +287 -0
- package/chunks/ResizeObserver.js.map +1 -0
- package/chunks/_commonjsHelpers.js +24 -4
- package/chunks/_commonjsHelpers.js.map +1 -1
- package/chunks/index.js.map +1 -1
- package/chunks/plugin.js +53 -0
- package/chunks/plugin.js.map +1 -0
- package/contexts/Device.d.ts +2 -22
- package/contexts/Device.js +5 -59
- package/contexts/Device.js.map +1 -1
- package/contexts/Devices/Device.d.ts +11 -0
- package/contexts/Devices/Device.js +23 -0
- package/contexts/Devices/Device.js.map +1 -0
- package/contexts/Devices/hooks/useQueries.d.ts +6 -0
- package/contexts/Devices/hooks/useQueries.js +24 -0
- package/contexts/Devices/hooks/useQueries.js.map +1 -0
- package/contexts/Devices/reducers/reducer.d.ts +25 -0
- package/contexts/Devices/reducers/reducer.js +50 -0
- package/contexts/Devices/reducers/reducer.js.map +1 -0
- package/contexts/TridentUIConfig.js +228 -228
- package/contexts/TridentUIConfig.js.map +1 -1
- package/helpers/colors/colors.d.ts +108 -0
- package/helpers/colors/colors.js +132 -0
- package/helpers/colors/colors.js.map +1 -0
- package/hooks/keyboard.constants.js.map +1 -1
- package/hooks/useInternalStatus.js.map +1 -1
- package/hooks/useKeyboardControls.js.map +1 -1
- package/hooks/useResizeObserver.d.ts +2 -0
- package/hooks/useResizeObserver.js +84 -0
- package/hooks/useResizeObserver.js.map +1 -0
- package/hooks/useSafeBoop.js.map +1 -1
- package/hooks/useValue.js.map +1 -1
- package/molecules/Arrows/Arrows.d.ts +16 -0
- package/molecules/Arrows/Arrows.js +66 -0
- package/molecules/Arrows/Arrows.js.map +1 -0
- package/molecules/Arrows/ArrowsLabels.d.js +2 -0
- package/molecules/Arrows/ArrowsLabels.d.js.map +1 -0
- package/molecules/Arrows.d.ts +1 -50
- package/molecules/Arrows.js +2 -56
- package/molecules/Arrows.js.map +1 -1
- package/molecules/Avatar.js.map +1 -1
- package/molecules/Backdrop.js.map +1 -1
- package/molecules/Breadcrumb.js +8 -9
- package/molecules/Breadcrumb.js.map +1 -1
- package/molecules/Buttons/ArrowButton.d.ts +7 -0
- package/molecules/Buttons/ArrowButton.js +14 -0
- package/molecules/Buttons/ArrowButton.js.map +1 -0
- package/molecules/Buttons/Button.d.ts +15 -32
- package/molecules/Buttons/Button.js +52 -42
- package/molecules/Buttons/Button.js.map +1 -1
- package/molecules/Buttons/ButtonAnchor.d.ts +7 -3
- package/molecules/Buttons/ButtonAnchor.js +17 -36
- package/molecules/Buttons/ButtonAnchor.js.map +1 -1
- package/molecules/Buttons/ButtonContent.d.ts +12 -4
- package/molecules/Buttons/ButtonContent.js +14 -8
- package/molecules/Buttons/ButtonContent.js.map +1 -1
- package/molecules/Buttons/FakeButton.d.ts +8 -0
- package/molecules/Buttons/FakeButton.js +8 -0
- package/molecules/Buttons/FakeButton.js.map +1 -0
- package/molecules/Buttons/InertButton.d.ts +4 -0
- package/molecules/Buttons/InertButton.js +15 -31
- package/molecules/Buttons/InertButton.js.map +1 -1
- package/molecules/Buttons/v2/Button.d.ts +2289 -0
- package/molecules/Buttons/v2/Button.js +57 -0
- package/molecules/Buttons/v2/Button.js.map +1 -0
- package/molecules/Buttons/v2/Button.type.d.ts +57 -0
- package/molecules/Buttons/v2/Button.type.js +45 -0
- package/molecules/Buttons/v2/Button.type.js.map +1 -0
- package/molecules/Card.d.ts +1 -11
- package/molecules/Card.js +2 -35
- package/molecules/Card.js.map +1 -1
- package/molecules/Cards/Card.d.ts +13 -0
- package/molecules/Cards/Card.js +22 -0
- package/molecules/Cards/Card.js.map +1 -0
- package/molecules/Cards/CardAspectRatios.d.ts +6 -0
- package/molecules/Cards/CardAspectRatios.js +10 -0
- package/molecules/Cards/CardAspectRatios.js.map +1 -0
- package/molecules/Cards/CardBackground.d.ts +4 -0
- package/molecules/Cards/CardBackground.js +30 -0
- package/molecules/Cards/CardBackground.js.map +1 -0
- package/molecules/Cards/CardBackgroundContext.d.ts +6 -0
- package/molecules/Cards/CardBackgroundContext.js +10 -0
- package/molecules/Cards/CardBackgroundContext.js.map +1 -0
- package/molecules/Cards/CardClickable.d.ts +6 -0
- package/molecules/Cards/CardClickable.js +37 -0
- package/molecules/Cards/CardClickable.js.map +1 -0
- package/molecules/Cards/ExpandableCard.d.ts +14 -0
- package/molecules/Cards/ExpandableCard.js +80 -0
- package/molecules/Cards/ExpandableCard.js.map +1 -0
- package/molecules/Cards/v2/Card.d.ts +15 -0
- package/molecules/Cards/v2/Card.js +34 -0
- package/molecules/Cards/v2/Card.js.map +1 -0
- package/molecules/Chip.d.ts +9 -0
- package/molecules/Chip.js +31 -0
- package/molecules/Chip.js.map +1 -0
- package/molecules/Chip.themes.d.ts +12 -0
- package/molecules/Chip.themes.js +24 -0
- package/molecules/Chip.themes.js.map +1 -0
- package/molecules/ElasticHeight.d.ts +6 -27
- package/molecules/ElasticHeight.js +28 -33
- package/molecules/ElasticHeight.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.js +12 -13
- package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkboxes.js.map +1 -1
- package/molecules/Forms/DateField.d.ts +1 -1
- package/molecules/Forms/DateField.js +142 -116
- package/molecules/Forms/DateField.js.map +1 -1
- package/molecules/Forms/Filter.js +12 -13
- package/molecules/Forms/Filter.js.map +1 -1
- package/molecules/Forms/FormControl.js +15 -16
- package/molecules/Forms/FormControl.js.map +1 -1
- package/molecules/Forms/FormLabel.js.map +1 -1
- package/molecules/Forms/NumberField.d.ts +29 -29
- package/molecules/Forms/NumberField.js +68 -68
- package/molecules/Forms/NumberField.js.map +1 -1
- package/molecules/Forms/Password/Password.js +10 -11
- package/molecules/Forms/Password/Password.js.map +1 -1
- package/molecules/Forms/Password/ValidationMessage.js +8 -9
- package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
- package/molecules/Forms/Radios/Radio.js.map +1 -1
- package/molecules/Forms/Radios/RadioGroup.js +2 -2
- package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
- package/molecules/Forms/Range.js +124 -406
- package/molecules/Forms/Range.js.map +1 -1
- package/molecules/Forms/Select.d.ts +1 -1
- package/molecules/Forms/Select.js +3 -4
- package/molecules/Forms/Select.js.map +1 -1
- package/molecules/Forms/Switch.js.map +1 -1
- package/molecules/Forms/TextField.d.ts +1 -1
- package/molecules/Forms/TextField.js +7 -8
- package/molecules/Forms/TextField.js.map +1 -1
- package/molecules/HamburgerIcon.js.map +1 -1
- package/molecules/Link.d.ts +1 -1
- package/molecules/Link.js +8 -9
- package/molecules/Link.js.map +1 -1
- package/molecules/Loader.js.map +1 -1
- package/molecules/Pagination.d.ts +38 -0
- package/molecules/Pagination.helper.d.ts +48 -0
- package/molecules/Pagination.helper.js +30 -0
- package/molecules/Pagination.helper.js.map +1 -0
- package/molecules/Pagination.js +154 -0
- package/molecules/Pagination.js.map +1 -0
- package/molecules/Popin.js +16 -16
- package/molecules/Popin.js.map +1 -1
- package/molecules/Spinner.js.map +1 -1
- package/molecules/Tabs/Tab.d.ts +1 -1
- package/molecules/Tabs/Tab.js +51 -49
- package/molecules/Tabs/Tab.js.map +1 -1
- package/molecules/Tabs/TabList.js.map +1 -1
- package/molecules/Tabs/TabPanel.js +31 -29
- package/molecules/Tabs/TabPanel.js.map +1 -1
- package/molecules/Tabs/Tabs.js +7 -9
- package/molecules/Tabs/Tabs.js.map +1 -1
- package/molecules/Tabs/TabsBody.js.map +1 -1
- package/molecules/Tabs/context/TabControl.d.ts +29 -27
- package/molecules/Tabs/context/TabControl.js +67 -66
- package/molecules/Tabs/context/TabControl.js.map +1 -1
- package/molecules/Tabs/hooks/tabControl.d.ts +25 -14
- package/molecules/Tabs/hooks/tabControl.js +26 -23
- package/molecules/Tabs/hooks/tabControl.js.map +1 -1
- package/molecules/Tabs/theme.js.map +1 -1
- package/molecules/Tag.d.ts +43 -0
- package/molecules/Tag.js +73 -0
- package/molecules/Tag.js.map +1 -0
- package/package.json +29 -5
- package/styles/globals.css +16 -15
- package/tailwind/colors.d.ts +38 -0
- package/tailwind/colors.js +44 -0
- package/tailwind/colors.js.map +1 -0
- package/tailwind/plugins/animationDelay.d.ts +4 -0
- package/tailwind/plugins/animationDelay.js +15 -0
- package/tailwind/plugins/animationDelay.js.map +1 -0
- package/tailwind/plugins/hocus.d.ts +4 -0
- package/tailwind/plugins/hocus.js +11 -0
- package/tailwind/plugins/hocus.js.map +1 -0
- package/tailwind/plugins/lineClampFix.d.ts +4 -0
- package/tailwind/plugins/lineClampFix.js +13 -0
- package/tailwind/plugins/lineClampFix.js.map +1 -0
- package/tailwind/plugins/popover.d.ts +4 -0
- package/tailwind/plugins/popover.js +8 -0
- package/tailwind/plugins/popover.js.map +1 -0
- package/tailwind/plugins/startingStyle.d.ts +4 -0
- package/tailwind/plugins/startingStyle.js +8 -0
- package/tailwind/plugins/startingStyle.js.map +1 -0
- package/tailwind/plugins/transitionBehavior.d.ts +4 -0
- package/tailwind/plugins/transitionBehavior.js +11 -0
- package/tailwind/plugins/transitionBehavior.js.map +1 -0
- package/tailwind/tailwind.preset.d.ts +733 -510
- package/tailwind/tailwind.preset.js +706 -629
- package/tailwind/tailwind.preset.js.map +1 -1
- package/types/Colors.d.js +2 -0
- package/types/Colors.d.js.map +1 -0
- package/types/Devices.d.ts +8 -0
- package/types/Devices.js +11 -0
- package/types/Devices.js.map +1 -0
- package/types/Direction.d.js +2 -0
- package/types/Direction.d.js.map +1 -0
- package/types/LiteralUnion.d.js +2 -0
- package/types/LiteralUnion.d.js.map +1 -0
- package/types/ScrollerLabels.d.js +2 -0
- package/types/ScrollerLabels.d.js.map +1 -0
- package/types/Theme.d.js +2 -0
- package/types/Theme.d.js.map +1 -0
- package/molecules/Buttons/Button.helpers.d.ts +0 -7
- package/molecules/Buttons/Button.helpers.js +0 -11
- package/molecules/Buttons/Button.helpers.js.map +0 -1
- package/molecules/Buttons/Button.themes.d.ts +0 -1
- package/molecules/Buttons/Button.themes.js +0 -25
- package/molecules/Buttons/Button.themes.js.map +0 -1
package/molecules/Arrows.js
CHANGED
|
@@ -1,59 +1,5 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
3
|
+
e as Arrows
|
|
58
4
|
};
|
|
59
5
|
//# sourceMappingURL=Arrows.js.map
|
package/molecules/Arrows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arrows.js","sources":[
|
|
1
|
+
{"version":3,"file":"Arrows.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/molecules/Avatar.js.map
CHANGED
|
@@ -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;
|
|
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,
|
|
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;"}
|
package/molecules/Breadcrumb.js
CHANGED
|
@@ -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 "
|
|
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
|
-
},
|
|
15
|
-
className:
|
|
13
|
+
}, I = ({
|
|
14
|
+
className: l,
|
|
16
15
|
items: n,
|
|
17
|
-
theme:
|
|
18
|
-
component:
|
|
16
|
+
theme: o = "light",
|
|
17
|
+
component: h = "a"
|
|
19
18
|
}) => {
|
|
20
|
-
const [
|
|
21
|
-
return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", className:
|
|
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
|
-
|
|
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 '
|
|
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
|
|
2
|
-
import './
|
|
3
|
-
import type { IconicNames, IconicTypes } from '
|
|
4
|
-
export
|
|
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
|
-
*
|
|
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 {
|
|
2
|
-
import { c as C } from "../../chunks/index.js";
|
|
1
|
+
import { jsxs as l } from "react/jsx-runtime";
|
|
3
2
|
import "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
|
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 '
|
|
3
|
-
export
|
|
4
|
-
|
|
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
|
|
2
|
-
import { Icon as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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 '
|
|
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;"}
|