@clubmed/trident-ui 1.5.0 → 1.5.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/atoms/Prose/Prose.js +4 -4
- package/atoms/Prose/Prose.js.map +1 -1
- package/chunks/clsx.js +17 -0
- package/chunks/clsx.js.map +1 -0
- package/molecules/Arrows/Arrows.js +16 -16
- package/molecules/Arrows/Arrows.js.map +1 -1
- package/molecules/Avatar.js +7 -7
- package/molecules/Avatar.js.map +1 -1
- package/molecules/Backdrop.js +12 -12
- package/molecules/Backdrop.js.map +1 -1
- package/molecules/Breadcrumb.js +5 -5
- package/molecules/Breadcrumb.js.map +1 -1
- package/molecules/Buttons/v2/Button.js +5 -12
- package/molecules/Buttons/v2/Button.js.map +1 -1
- package/molecules/Buttons/v2/Button.type.js +5 -5
- package/molecules/Buttons/v2/Button.type.js.map +1 -1
- package/molecules/Cards/CardBackground.js +7 -7
- package/molecules/Cards/CardBackground.js.map +1 -1
- package/molecules/Cards/CardClickable.js +7 -7
- package/molecules/Cards/CardClickable.js.map +1 -1
- package/molecules/Cards/ExpandableCard.js +8 -8
- package/molecules/Cards/ExpandableCard.js.map +1 -1
- package/molecules/Cards/v2/Card.js +10 -10
- package/molecules/Cards/v2/Card.js.map +1 -1
- package/molecules/Chip.js +9 -9
- package/molecules/Chip.js.map +1 -1
- package/molecules/Chip.themes.js +6 -6
- package/molecules/Chip.themes.js.map +1 -1
- package/molecules/ElasticHeight.js +5 -5
- package/molecules/ElasticHeight.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.js +10 -10
- package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkboxes.js +11 -11
- package/molecules/Forms/Checkboxes/Checkboxes.js.map +1 -1
- package/molecules/Forms/DateField.js +8 -8
- package/molecules/Forms/DateField.js.map +1 -1
- package/molecules/Forms/Filter.js +8 -8
- package/molecules/Forms/Filter.js.map +1 -1
- package/molecules/Forms/FormControl.js +9 -9
- package/molecules/Forms/FormControl.js.map +1 -1
- package/molecules/Forms/FormLabel.js +14 -14
- package/molecules/Forms/FormLabel.js.map +1 -1
- package/molecules/Forms/NumberField.js +9 -9
- package/molecules/Forms/NumberField.js.map +1 -1
- package/molecules/Forms/Password/Password.js +1 -1
- package/molecules/Forms/Password/Password.js.map +1 -1
- package/molecules/Forms/Password/ValidationMessage.js +10 -10
- package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
- package/molecules/Forms/Radios/Radio.js +19 -19
- package/molecules/Forms/Radios/Radio.js.map +1 -1
- package/molecules/Forms/Radios/RadioGroup.js +11 -11
- package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
- package/molecules/Forms/Range.js +1 -1
- package/molecules/Forms/Range.js.map +1 -1
- package/molecules/Forms/Select.js +5 -5
- package/molecules/Forms/Select.js.map +1 -1
- package/molecules/Forms/Switch.js +12 -12
- package/molecules/Forms/Switch.js.map +1 -1
- package/molecules/Forms/TextField.js +1 -1
- package/molecules/Forms/TextField.js.map +1 -1
- package/molecules/HamburgerIcon.js +1 -1
- package/molecules/HamburgerIcon.js.map +1 -1
- package/molecules/Link.js +8 -8
- package/molecules/Link.js.map +1 -1
- package/molecules/Loader.js +3 -3
- package/molecules/Loader.js.map +1 -1
- package/molecules/Pagination.js +1 -1
- package/molecules/Pagination.js.map +1 -1
- package/molecules/Popin.js +5 -5
- package/molecules/Popin.js.map +1 -1
- package/molecules/Tabs/Tab.js +21 -21
- package/molecules/Tabs/Tab.js.map +1 -1
- package/molecules/Tabs/TabList.js +1 -1
- package/molecules/Tabs/TabList.js.map +1 -1
- package/molecules/Tabs/TabPanel.js +8 -8
- package/molecules/Tabs/TabPanel.js.map +1 -1
- package/molecules/Tabs/Tabs.js +9 -9
- package/molecules/Tabs/Tabs.js.map +1 -1
- package/molecules/Tabs/TabsBody.js +3 -3
- package/molecules/Tabs/TabsBody.js.map +1 -1
- package/molecules/Tag.js +5 -5
- package/molecules/Tag.js.map +1 -1
- package/package.json +7 -7
- package/chunks/index.js +0 -46
- package/chunks/index.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# ClubMed React UI components changelog
|
|
2
2
|
|
|
3
|
+
## [1.5.1-beta.1](https://scm.clubmed.com/clubmed/ui/trident-ui/compare/v1.5.0...v1.5.1-beta.1) (2025-12-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* migrate from `classnames` to `clsx` across codebase for improved utility handling ([52a022b](https://scm.clubmed.com/clubmed/ui/trident-ui/-/commit/52a022b7acf58e6570346ff7b05204473d080571))
|
|
9
|
+
|
|
3
10
|
# [1.5.0](https://scm.clubmed.com/clubmed/ui/trident-ui/compare/v1.4.0...v1.5.0) (2025-11-28)
|
|
4
11
|
|
|
5
12
|
|
package/atoms/Prose/Prose.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { c as m } from "../../chunks/
|
|
2
|
+
import { c as m } from "../../chunks/clsx.js";
|
|
3
3
|
import { forwardRef as t } from "react";
|
|
4
|
-
const c = t(function({ className: o, text: r, ...
|
|
4
|
+
const c = t(function({ className: o, text: r, ...e }, s) {
|
|
5
5
|
return r ? /* @__PURE__ */ n(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
|
-
...
|
|
8
|
+
...e,
|
|
9
9
|
className: m(o, "prose"),
|
|
10
10
|
dangerouslySetInnerHTML: { __html: r },
|
|
11
|
-
ref:
|
|
11
|
+
ref: s
|
|
12
12
|
}
|
|
13
13
|
) : null;
|
|
14
14
|
});
|
package/atoms/Prose/Prose.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Prose.js","sources":["../../../lib/atoms/Prose/Prose.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Prose.js","sources":["../../../lib/atoms/Prose/Prose.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { type ComponentPropsWithoutRef, forwardRef } from 'react';\n\nexport interface ProseProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n text: string;\n}\n\nexport const Prose = forwardRef<HTMLDivElement, ProseProps>(function Prose(\n { className, text, ...attrs },\n ref,\n) {\n if (!text) {\n return null;\n }\n\n return (\n <div\n {...attrs}\n className={clsx(className, 'prose')}\n dangerouslySetInnerHTML={{ __html: text }}\n ref={ref}\n />\n );\n});\n"],"names":["Prose","forwardRef","className","text","attrs","ref","jsx","clsx"],"mappings":";;;AAOO,MAAMA,IAAQC,EAAuC,SAC1D,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GACtBC,GACA;AACA,SAAKF,IAKH,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,WAAWG,EAAKL,GAAW,OAAO;AAAA,MAClC,yBAAyB,EAAE,QAAQC,EAAA;AAAA,MACnC,KAAAE;AAAA,IAAA;AAAA,EAAA,IARK;AAWX,CAAC;"}
|
package/chunks/clsx.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function a(r) {
|
|
2
|
+
var f, n, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
|
|
7
|
+
} else for (n in r) r[n] && (t && (t += " "), t += n);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as c
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=clsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clsx.js","sources":["../../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":["r","e","t","f","n","clsx"],"mappings":"AAAA,SAASA,EAAEC,GAAE;AAAC,MAAIC,GAAEC,GAAEC,IAAE;AAAG,MAAa,OAAOH,KAAjB,YAA8B,OAAOA,KAAjB,SAAmB,CAAAG,KAAGH;AAAA,WAAoB,OAAOA,KAAjB,SAAmB,KAAG,MAAM,QAAQA,CAAC,GAAE;AAAC,QAAI,IAAEA,EAAE;AAAO,SAAIC,IAAE,GAAEA,IAAE,GAAEA,IAAI,CAAAD,EAAEC,CAAC,MAAIC,IAAEH,EAAEC,EAAEC,CAAC,CAAC,OAAKE,MAAIA,KAAG,MAAKA,KAAGD;AAAA,EAAE,MAAM,MAAIA,KAAKF,EAAE,CAAAA,EAAEE,CAAC,MAAIC,MAAIA,KAAG,MAAKA,KAAGD;AAAG,SAAOC;AAAC;AAAQ,SAASC,IAAM;AAAC,WAAQJ,GAAEC,GAAEC,IAAE,GAAEC,IAAE,IAAG,IAAE,UAAU,QAAOD,IAAE,GAAEA,IAAI,EAACF,IAAE,UAAUE,CAAC,OAAKD,IAAEF,EAAEC,CAAC,OAAKG,MAAIA,KAAG,MAAKA,KAAGF;AAAG,SAAOE;AAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as t } from "../../chunks/
|
|
1
|
+
import { jsxs as w, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as t } from "../../chunks/clsx.js";
|
|
3
3
|
import { ArrowButton as l } from "../Buttons/ArrowButton.js";
|
|
4
4
|
const A = ({
|
|
5
5
|
className: f,
|
|
6
6
|
color: o,
|
|
7
7
|
iconType: e = "ArrowDefault",
|
|
8
|
-
isDisabledHidden:
|
|
9
|
-
isNextDisabled:
|
|
8
|
+
isDisabledHidden: r = !1,
|
|
9
|
+
isNextDisabled: n = !1,
|
|
10
10
|
isPrevDisabled: a = !1,
|
|
11
|
-
labels:
|
|
11
|
+
labels: i = {
|
|
12
12
|
next: "",
|
|
13
13
|
previous: ""
|
|
14
14
|
},
|
|
15
15
|
onNext: m,
|
|
16
16
|
onPrev: u,
|
|
17
|
-
size:
|
|
17
|
+
size: s,
|
|
18
18
|
theme: c,
|
|
19
|
-
...
|
|
20
|
-
}) => /* @__PURE__ */
|
|
19
|
+
...x
|
|
20
|
+
}) => /* @__PURE__ */ w(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
...
|
|
23
|
+
...x,
|
|
24
24
|
className: t(
|
|
25
25
|
"pointer-events-none flex w-full items-center justify-between gap-x-20",
|
|
26
26
|
f
|
|
@@ -31,30 +31,30 @@ const A = ({
|
|
|
31
31
|
l,
|
|
32
32
|
{
|
|
33
33
|
className: t("pointer-events-auto transition-opacity", {
|
|
34
|
-
"opacity-0":
|
|
34
|
+
"opacity-0": r && a
|
|
35
35
|
}),
|
|
36
36
|
color: o,
|
|
37
37
|
disabled: a,
|
|
38
38
|
icon: `${e}Left`,
|
|
39
39
|
onClick: u,
|
|
40
|
-
size:
|
|
40
|
+
size: s,
|
|
41
41
|
theme: c,
|
|
42
|
-
children:
|
|
42
|
+
children: i.previous
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
45
|
/* @__PURE__ */ p(
|
|
46
46
|
l,
|
|
47
47
|
{
|
|
48
48
|
className: t("pointer-events-auto transition-opacity", {
|
|
49
|
-
"opacity-0":
|
|
49
|
+
"opacity-0": r && n
|
|
50
50
|
}),
|
|
51
51
|
color: o,
|
|
52
|
-
disabled:
|
|
52
|
+
disabled: n,
|
|
53
53
|
icon: `${e}Right`,
|
|
54
54
|
onClick: m,
|
|
55
|
-
size:
|
|
55
|
+
size: s,
|
|
56
56
|
theme: c,
|
|
57
|
-
children:
|
|
57
|
+
children: i.next
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arrows.js","sources":["../../../lib/molecules/Arrows/Arrows.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Arrows.js","sources":["../../../lib/molecules/Arrows/Arrows.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport type { ComponentProps, ComponentPropsWithoutRef, FunctionComponent } from 'react';\n\nimport type { ArrowsLabels } from './ArrowsLabels';\n\nimport { ArrowButton } from '../Buttons/ArrowButton';\n\nexport interface ArrowsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n color?: ComponentProps<typeof ArrowButton>['color'];\n iconType?: 'ArrowDefault' | 'ArrowTail';\n isDisabledHidden?: boolean;\n isNextDisabled?: boolean;\n isPrevDisabled?: boolean;\n labels?: ArrowsLabels;\n onNext: ComponentProps<typeof ArrowButton>['onClick'];\n onPrev: ComponentProps<typeof ArrowButton>['onClick'];\n size?: ComponentProps<typeof ArrowButton>['size'];\n theme?: ComponentProps<typeof ArrowButton>['theme'];\n}\n\nexport const Arrows: FunctionComponent<ArrowsProps> = ({\n className,\n color,\n iconType = 'ArrowDefault',\n isDisabledHidden = false,\n isNextDisabled = false,\n isPrevDisabled = false,\n labels = {\n next: '',\n previous: '',\n },\n onNext,\n onPrev,\n size,\n theme,\n ...attrs\n}) => {\n return (\n <div\n {...attrs}\n className={clsx(\n 'pointer-events-none flex w-full items-center justify-between gap-x-20',\n className,\n )}\n data-name=\"Arrows\"\n >\n <ArrowButton\n className={clsx('pointer-events-auto transition-opacity', {\n 'opacity-0': isDisabledHidden && isPrevDisabled,\n })}\n color={color}\n disabled={isPrevDisabled}\n icon={`${iconType}Left`}\n onClick={onPrev}\n size={size}\n theme={theme}\n >\n {labels.previous}\n </ArrowButton>\n <ArrowButton\n className={clsx('pointer-events-auto transition-opacity', {\n 'opacity-0': isDisabledHidden && isNextDisabled,\n })}\n color={color}\n disabled={isNextDisabled}\n icon={`${iconType}Right`}\n onClick={onNext}\n size={size}\n theme={theme}\n >\n {labels.next}\n </ArrowButton>\n </div>\n );\n};\n"],"names":["Arrows","className","color","iconType","isDisabledHidden","isNextDisabled","isPrevDisabled","labels","onNext","onPrev","size","theme","attrs","jsxs","clsx","jsx","ArrowButton"],"mappings":";;;AAoBO,MAAMA,IAAyC,CAAC;AAAA,EACrD,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,gBAAAC,IAAiB;AAAA,EACjB,gBAAAC,IAAiB;AAAA,EACjB,QAAAC,IAAS;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,EAAA;AAAA,EAEZ,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACE,GAAGD;AAAA,IACJ,WAAWE;AAAA,MACT;AAAA,MACAb;AAAA,IAAA;AAAA,IAEF,aAAU;AAAA,IAEV,UAAA;AAAA,MAAA,gBAAAc;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAK,0CAA0C;AAAA,YACxD,aAAaV,KAAoBE;AAAA,UAAA,CAClC;AAAA,UACD,OAAAJ;AAAA,UACA,UAAUI;AAAA,UACV,MAAM,GAAGH,CAAQ;AAAA,UACjB,SAASM;AAAA,UACT,MAAAC;AAAA,UACA,OAAAC;AAAA,UAEC,UAAAJ,EAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAEV,gBAAAQ;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAK,0CAA0C;AAAA,YACxD,aAAaV,KAAoBC;AAAA,UAAA,CAClC;AAAA,UACD,OAAAH;AAAA,UACA,UAAUG;AAAA,UACV,MAAM,GAAGF,CAAQ;AAAA,UACjB,SAASK;AAAA,UACT,MAAAE;AAAA,UACA,OAAAC;AAAA,UAEC,UAAAJ,EAAO;AAAA,QAAA;AAAA,MAAA;AAAA,IACV;AAAA,EAAA;AAAA;"}
|
package/molecules/Avatar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { c as u } from "../chunks/
|
|
3
|
-
const
|
|
1
|
+
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as u } from "../chunks/clsx.js";
|
|
3
|
+
const d = (e = "") => e.split(" ").map((t) => t.slice(0, 1)).join("");
|
|
4
4
|
function p({
|
|
5
5
|
alt: e,
|
|
6
6
|
src: t,
|
|
@@ -8,12 +8,12 @@ function p({
|
|
|
8
8
|
style: r,
|
|
9
9
|
children: o,
|
|
10
10
|
className: i,
|
|
11
|
-
...
|
|
11
|
+
...f
|
|
12
12
|
}) {
|
|
13
13
|
return /* @__PURE__ */ l(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
|
-
...
|
|
16
|
+
...f,
|
|
17
17
|
...t || n ? { role: "figure", "aria-label": e } : {},
|
|
18
18
|
className: u(
|
|
19
19
|
"flex items-center justify-center relative overflow-hidden",
|
|
@@ -29,7 +29,7 @@ function p({
|
|
|
29
29
|
height: "48px",
|
|
30
30
|
...r
|
|
31
31
|
},
|
|
32
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ s("span", { className: "flex items-center justify-center font-bold uppercase text-h6 h-full", children: [
|
|
33
33
|
t || n ? /* @__PURE__ */ l(
|
|
34
34
|
"img",
|
|
35
35
|
{
|
|
@@ -38,7 +38,7 @@ function p({
|
|
|
38
38
|
alt: e,
|
|
39
39
|
className: "w-full h-full object-cover transparent indent-[1000px]"
|
|
40
40
|
}
|
|
41
|
-
) :
|
|
41
|
+
) : d(e),
|
|
42
42
|
o
|
|
43
43
|
] })
|
|
44
44
|
}
|
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
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../lib/molecules/Avatar.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport clsx from 'clsx';\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={clsx(\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","clsx","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,CAACH,GAAW,SAAS,UAAU;AAAA,UAC/C,cAAc,CAACA,GAAW,SAAS,OAAO;AAAA,UAC1C,cAAc,CAACA,GAAW,SAAS,KAAK;AAAA,QAAA;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;"}
|
package/molecules/Backdrop.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as p, jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { c as l } from "../chunks/
|
|
4
|
-
const
|
|
5
|
-
children:
|
|
1
|
+
import { jsxs as p, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useState as k, useEffect as x } from "react";
|
|
3
|
+
import { c as l } from "../chunks/clsx.js";
|
|
4
|
+
const g = ({
|
|
5
|
+
children: e,
|
|
6
6
|
onClose: c,
|
|
7
7
|
isVisible: t,
|
|
8
8
|
sweep: n
|
|
9
9
|
}) => {
|
|
10
|
-
const
|
|
10
|
+
const o = m(!!t), u = o.current, a = !t && u, [d, r] = k(!!t);
|
|
11
11
|
return x(() => {
|
|
12
|
-
t &&
|
|
13
|
-
}, [t]),
|
|
12
|
+
t && r(!0);
|
|
13
|
+
}, [t]), o.current = !!t, d ? /* @__PURE__ */ p(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
role: "presentation",
|
|
17
17
|
className: "z-1 pointer-events-none fixed inset-0 items-center justify-center flex",
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ f(
|
|
20
20
|
"button",
|
|
21
21
|
{
|
|
22
22
|
type: "button",
|
|
@@ -36,16 +36,16 @@ const s = ({
|
|
|
36
36
|
),
|
|
37
37
|
onClick: c,
|
|
38
38
|
onAnimationEnd: () => {
|
|
39
|
-
t ||
|
|
39
|
+
t || r(!1);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
|
|
43
|
+
e
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
) : null;
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
g as Backdrop
|
|
50
50
|
};
|
|
51
51
|
//# sourceMappingURL=Backdrop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Backdrop.js","sources":["../../lib/molecules/Backdrop.tsx"],"sourcesContent":["import {\n type FunctionComponent,\n type MouseEvent,\n type PropsWithChildren,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"Backdrop.js","sources":["../../lib/molecules/Backdrop.tsx"],"sourcesContent":["import {\n type FunctionComponent,\n type MouseEvent,\n type PropsWithChildren,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport clsx from 'clsx';\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 // Prevent initial mount animation flash when closed\n const wasVisibleRef = useRef(!!isVisible);\n const wasVisible = wasVisibleRef.current;\n const isLeaving = !isVisible && wasVisible;\n\n // Mount only when visible or when we need to play leave animation\n const [mounted, setMounted] = useState<boolean>(!!isVisible);\n\n // When becoming visible, ensure we are mounted\n useEffect(() => {\n if (isVisible) setMounted(true);\n }, [isVisible]);\n\n // update ref for next render\n wasVisibleRef.current = !!isVisible;\n\n if (!mounted) {\n return null;\n }\n\n return (\n <div\n role=\"presentation\"\n className=\"z-1 pointer-events-none fixed inset-0 items-center justify-center flex\"\n >\n <button\n type=\"button\"\n aria-hidden=\"true\"\n className={clsx(\n '-z-1 absolute inset-0 bg-white backdrop will-change-[opacity,transform,backdrop-filter]',\n {\n 'pointer-events-auto': isVisible || isLeaving,\n 'pointer-events-none': !isVisible && !isLeaving,\n 'animate-backdropFadeIn': !sweep && isVisible,\n 'animate-backdropFadeOut': !sweep && !isVisible && isLeaving,\n 'backdrop-blur-0 opacity-0': !sweep && isVisible && !isLeaving,\n 'animate-backdropSweepIn': sweep && isVisible,\n 'animate-backdropSweepOut': sweep && !isVisible && isLeaving,\n 'backdrop-blur-0 opacity-0 translate-x-[-100%]': sweep && isVisible && !isLeaving,\n },\n )}\n onClick={onClose}\n onAnimationEnd={() => {\n // When leave animation finishes and still not visible, unmount\n if (!isVisible) {\n setMounted(false);\n }\n }}\n />\n {children}\n </div>\n );\n};\n"],"names":["Backdrop","children","onClose","isVisible","sweep","wasVisibleRef","useRef","wasVisible","isLeaving","mounted","setMounted","useState","useEffect","jsxs","jsx","clsx"],"mappings":";;;AA2BO,MAAMA,IAAgE,CAAC;AAAA,EAC5E,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AACF,MAAM;AAEJ,QAAMC,IAAgBC,EAAO,CAAC,CAACH,CAAS,GAClCI,IAAaF,EAAc,SAC3BG,IAAY,CAACL,KAAaI,GAG1B,CAACE,GAASC,CAAU,IAAIC,EAAkB,CAAC,CAACR,CAAS;AAU3D,SAPAS,EAAU,MAAM;AACd,IAAIT,OAAsB,EAAI;AAAA,EAChC,GAAG,CAACA,CAAS,CAAC,GAGdE,EAAc,UAAU,CAAC,CAACF,GAErBM,IAKH,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,eAAY;AAAA,YACZ,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,uBAAuBZ,KAAaK;AAAA,gBACpC,uBAAuB,CAACL,KAAa,CAACK;AAAA,gBACtC,0BAA0B,CAACJ,KAASD;AAAA,gBACpC,2BAA2B,CAACC,KAAS,CAACD,KAAaK;AAAA,gBACnD,6BAA6B,CAACJ,KAASD,KAAa,CAACK;AAAA,gBACrD,2BAA2BJ,KAASD;AAAA,gBACpC,4BAA4BC,KAAS,CAACD,KAAaK;AAAA,gBACnD,iDAAiDJ,KAASD,KAAa,CAACK;AAAA,cAAA;AAAA,YAC1E;AAAA,YAEF,SAASN;AAAA,YACT,gBAAgB,MAAM;AAEpB,cAAKC,KACHO,EAAW,EAAK;AAAA,YAEpB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDT;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAhCI;AAmCX;"}
|
package/molecules/Breadcrumb.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as k } from "react";
|
|
3
|
-
import { c as l } from "../chunks/
|
|
3
|
+
import { c as l } from "../chunks/clsx.js";
|
|
4
4
|
import { getTheme as w } from "./Breadcrumb.themes.js";
|
|
5
5
|
import { Icon as B } from "@clubmed/trident-icons";
|
|
6
6
|
const j = ({
|
|
@@ -11,7 +11,7 @@ const j = ({
|
|
|
11
11
|
}) => {
|
|
12
12
|
if (e.length == 0)
|
|
13
13
|
return null;
|
|
14
|
-
const [d, f, , ...t] = e, p = t.length ? t[t.length - 1] : e[e.length - 1], g = { label: "", href: "", className: "breadcrumb-spacer" }, s = t.length ? [d, f, g, p] : e, { thStart: u, thEnd:
|
|
14
|
+
const [d, f, , ...t] = e, p = t.length ? t[t.length - 1] : e[e.length - 1], g = { label: "", href: "", className: "breadcrumb-spacer" }, s = t.length ? [d, f, g, p] : e, { thStart: u, thEnd: x } = w(i);
|
|
15
15
|
return /* @__PURE__ */ a(
|
|
16
16
|
"nav",
|
|
17
17
|
{
|
|
@@ -20,7 +20,7 @@ const j = ({
|
|
|
20
20
|
...h,
|
|
21
21
|
className: l(m, "overflow-hidden"),
|
|
22
22
|
"data-name": "Breadcrumb",
|
|
23
|
-
children: /* @__PURE__ */ a("ol", { className: "scrollbar-hidden flex items-center overflow-x-auto font-sans text-b4", children: s.map(({ label: n, href: o, className:
|
|
23
|
+
children: /* @__PURE__ */ a("ol", { className: "scrollbar-hidden flex items-center overflow-x-auto font-sans text-b4", children: s.map(({ label: n, href: o, className: b, ...N }, c) => {
|
|
24
24
|
const r = c === s.length - 1, v = o && !r;
|
|
25
25
|
return /* @__PURE__ */ k(
|
|
26
26
|
"li",
|
|
@@ -31,9 +31,9 @@ const j = ({
|
|
|
31
31
|
"flex shrink-0 items-center",
|
|
32
32
|
{
|
|
33
33
|
[u]: !r,
|
|
34
|
-
[
|
|
34
|
+
[x]: r
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
b
|
|
37
37
|
),
|
|
38
38
|
key: `${n}-${c}`
|
|
39
39
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport type { ComponentPropsWithoutRef, FunctionComponent } from 'react';\n\nimport { getTheme } from './Breadcrumb.themes';\n\nimport type { Theme } from '@/types/Theme';\nimport { Icon } from '@clubmed/trident-icons';\nimport './Breadcrumb.css';\n\nexport interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {\n items: ({\n href: string;\n label: string;\n } & ComponentPropsWithoutRef<'li'>)[];\n theme?: Theme;\n}\n\nexport const Breadcrumb: FunctionComponent<BreadcrumbProps> = ({\n className,\n items,\n theme = 'light',\n ...attrs\n}) => {\n if (items.length == 0) {\n return null;\n }\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: '', className: 'breadcrumb-spacer' };\n const itemsToRender = !rest.length ? items : [first, second, spacer, lastItem];\n\n const { thStart, thEnd } = getTheme(theme);\n\n return (\n <nav\n role=\"navigation\"\n aria-label=\"Breadcrumb\"\n {...attrs}\n className={clsx(className, 'overflow-hidden')}\n data-name=\"Breadcrumb\"\n >\n <ol className=\"scrollbar-hidden flex items-center overflow-x-auto font-sans text-b4\">\n {itemsToRender.map(({ label, href, className, ...attrs }, index) => {\n const isLast = index === itemsToRender.length - 1;\n const isLink = href && !isLast;\n return (\n <li\n {...attrs}\n {...(isLast && { 'aria-current': 'page' })}\n className={clsx(\n 'flex shrink-0 items-center',\n {\n [thStart]: !isLast,\n [thEnd]: isLast,\n },\n className,\n )}\n key={`${label}-${index}`}\n >\n {isLink ? <a href={href}>{label}</a> : label}\n {!isLast && <Icon className=\"mx-4\" name=\"Diamond\" width=\"14px\" />}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"names":["Breadcrumb","className","items","theme","attrs","first","second","rest","lastItem","spacer","itemsToRender","thStart","thEnd","getTheme","jsx","clsx","label","href","index","isLast","isLink","createElement","Icon"],"mappings":";;;;;AAiBO,MAAMA,IAAiD,CAAC;AAAA,EAC7D,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,GAAGC;AACL,MAAM;AACJ,MAAIF,EAAM,UAAU;AAClB,WAAO;AAGT,QAAM,CAACG,GAAOC,KAAU,GAAGC,CAAI,IAAIL,GAC7BM,IAAWD,EAAK,SAASA,EAAKA,EAAK,SAAS,CAAC,IAAIL,EAAMA,EAAM,SAAS,CAAC,GACvEO,IAAS,EAAE,OAAO,IAAI,MAAM,IAAI,WAAW,oBAAA,GAC3CC,IAAiBH,EAAK,SAAiB,CAACF,GAAOC,GAAQG,GAAQD,CAAQ,IAAxCN,GAE/B,EAAE,SAAAS,GAAS,OAAAC,MAAUC,EAASV,CAAK;AAEzC,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAW;AAAA,MACV,GAAGV;AAAA,MACJ,WAAWW,EAAKd,GAAW,iBAAiB;AAAA,MAC5C,aAAU;AAAA,MAEV,UAAA,gBAAAa,EAAC,MAAA,EAAG,WAAU,wEACX,YAAc,IAAI,CAAC,EAAE,OAAAE,GAAO,MAAAC,GAAM,WAAAhB,GAAW,GAAGG,EAAAA,GAASc,MAAU;AAClE,cAAMC,IAASD,MAAUR,EAAc,SAAS,GAC1CU,IAASH,KAAQ,CAACE;AACxB,eACE,gBAAAE;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGjB;AAAAA,YACH,GAAIe,KAAU,EAAE,gBAAgB,OAAA;AAAA,YACjC,WAAWJ;AAAA,cACT;AAAA,cACA;AAAA,gBACE,CAACJ,CAAO,GAAG,CAACQ;AAAA,gBACZ,CAACP,CAAK,GAAGO;AAAA,cAAA;AAAA,cAEXlB;AAAAA,YAAA;AAAA,YAEF,KAAK,GAAGe,CAAK,IAAIE,CAAK;AAAA,UAAA;AAAA,UAErBE,IAAS,gBAAAN,EAAC,KAAA,EAAE,MAAAG,GAAa,aAAM,IAAOD;AAAA,UACtC,CAACG,KAAU,gBAAAL,EAACQ,GAAA,EAAK,WAAU,QAAO,MAAK,WAAU,OAAM,OAAA,CAAO;AAAA,QAAA;AAAA,MAGrE,CAAC,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import { c as l } from "../../../chunks/
|
|
3
|
+
import { c as l } from "../../../chunks/clsx.js";
|
|
4
4
|
import { getButtonClasses as B } from "./Button.type.js";
|
|
5
5
|
import { ButtonContent as c } from "../ButtonContent.js";
|
|
6
6
|
function p({ component: t, disabled: r, ...a }) {
|
|
@@ -34,20 +34,13 @@ const C = ({
|
|
|
34
34
|
color: a = "saffron",
|
|
35
35
|
icon: e,
|
|
36
36
|
iconWidth: o,
|
|
37
|
-
size:
|
|
38
|
-
theme:
|
|
39
|
-
variant:
|
|
37
|
+
size: u = "medium",
|
|
38
|
+
theme: i = "solid",
|
|
39
|
+
variant: s = "pill",
|
|
40
40
|
...m
|
|
41
41
|
}) => {
|
|
42
42
|
const { Cmp: f, attrs: d } = p(m);
|
|
43
|
-
return /* @__PURE__ */ n(
|
|
44
|
-
f,
|
|
45
|
-
{
|
|
46
|
-
...d,
|
|
47
|
-
className: l(B({ color: a, size: s, theme: u, variant: i }), t),
|
|
48
|
-
children: /* @__PURE__ */ n(c, { icon: e, iconWidth: o, children: r })
|
|
49
|
-
}
|
|
50
|
-
);
|
|
43
|
+
return /* @__PURE__ */ n(f, { ...d, className: l(B({ color: a, size: u, theme: i, variant: s }), t), children: /* @__PURE__ */ n(c, { icon: e, iconWidth: o, children: r }) });
|
|
51
44
|
};
|
|
52
45
|
C.displayName = "Button";
|
|
53
46
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../lib/molecules/Buttons/v2/Button.tsx"],"sourcesContent":["'use client';\nimport
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../lib/molecules/Buttons/v2/Button.tsx"],"sourcesContent":["'use client';\nimport clsx from 'clsx';\nimport type {\n ComponentPropsWithoutRef,\n FunctionComponent,\n PropsWithChildren,\n ReactElement,\n ReactPortal,\n} from 'react';\n\nimport { type ButtonProps as Btn, getButtonClasses } from './Button.type';\nimport { ButtonContent } from '../ButtonContent';\n\nimport './Button.css';\n\nexport interface ButtonProps extends Btn, Omit<ComponentPropsWithoutRef<'button'>, 'color'> {\n component?: 'button';\n}\n\nexport interface ButtonAnchorProps extends Btn, Omit<ComponentPropsWithoutRef<'a'>, 'color'> {\n component: 'a';\n disabled?: boolean;\n}\n\nexport interface FakeButtonProps extends Btn, Omit<ComponentPropsWithoutRef<'span'>, 'color'> {\n component: 'span' | 'div';\n disabled?: boolean;\n}\n// For Button with React Router Link or similar components\nexport interface ReactButtonProps\n extends Btn,\n Omit<ComponentPropsWithoutRef<'a'>, 'href' | 'color'> {\n component: ReactElement | ReactPortal;\n disabled?: boolean;\n}\n\ntype AnyButtonProps = ButtonProps | ButtonAnchorProps | FakeButtonProps | ReactButtonProps;\n\nexport function useButton({ component, disabled, ...props }: AnyButtonProps) {\n if (component === 'a' || 'href' in props || typeof component === 'object') {\n return {\n attrs: {\n 'data-name': 'ButtonAnchor',\n 'aria-disabled': disabled ? 'true' : undefined,\n ...props,\n },\n Cmp: 'a' as unknown as FunctionComponent<PropsWithChildren<any>>,\n };\n }\n\n if (component === 'span' || component === 'div') {\n return {\n attrs: {\n 'data-name': 'FakeButton',\n 'aria-disabled': disabled ? 'true' : undefined,\n ...props,\n },\n Cmp: 'span' as unknown as FunctionComponent<PropsWithChildren<any>>,\n };\n }\n\n return {\n attrs: {\n 'data-name': 'Button',\n type: 'button',\n disabled,\n ...props,\n },\n Cmp: 'button' as unknown as FunctionComponent<PropsWithChildren<any>>,\n };\n}\n\n// Main Button component that handles both button and anchor functionality\nexport const Button: FunctionComponent<AnyButtonProps> = ({\n className,\n children,\n color = 'saffron',\n icon,\n iconWidth,\n size = 'medium',\n theme = 'solid',\n variant = 'pill',\n ...props\n}) => {\n const { Cmp, attrs } = useButton(props);\n\n return (\n <Cmp {...attrs} className={clsx(getButtonClasses({ color, size, theme, variant }), className)}>\n <ButtonContent icon={icon} iconWidth={iconWidth}>\n {children}\n </ButtonContent>\n </Cmp>\n );\n};\n\nButton.displayName = 'Button';\n"],"names":["useButton","component","disabled","props","Button","className","children","color","icon","iconWidth","size","theme","variant","Cmp","attrs","jsx","clsx","getButtonClasses","ButtonContent"],"mappings":";;;;;AAsCO,SAASA,EAAU,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAAyB;AAC3E,SAAIF,MAAc,OAAO,UAAUE,KAAS,OAAOF,KAAc,WACxD;AAAA,IACL,OAAO;AAAA,MACL,aAAa;AAAA,MACb,iBAAiBC,IAAW,SAAS;AAAA,MACrC,GAAGC;AAAA,IAAA;AAAA,IAEL,KAAK;AAAA,EAAA,IAILF,MAAc,UAAUA,MAAc,QACjC;AAAA,IACL,OAAO;AAAA,MACL,aAAa;AAAA,MACb,iBAAiBC,IAAW,SAAS;AAAA,MACrC,GAAGC;AAAA,IAAA;AAAA,IAEL,KAAK;AAAA,EAAA,IAIF;AAAA,IACL,OAAO;AAAA,MACL,aAAa;AAAA,MACb,MAAM;AAAA,MACN,UAAAD;AAAA,MACA,GAAGC;AAAA,IAAA;AAAA,IAEL,KAAK;AAAA,EAAA;AAET;AAGO,MAAMC,IAA4C,CAAC;AAAA,EACxD,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,GAAGT;AACL,MAAM;AACJ,QAAM,EAAE,KAAAU,GAAK,OAAAC,MAAUd,EAAUG,CAAK;AAEtC,SACE,gBAAAY,EAACF,KAAK,GAAGC,GAAO,WAAWE,EAAKC,EAAiB,EAAE,OAAAV,GAAO,MAAAG,GAAM,OAAAC,GAAO,SAAAC,EAAA,CAAS,GAAGP,CAAS,GAC1F,4BAACa,GAAA,EAAc,MAAAV,GAAY,WAAAC,GACxB,UAAAH,EAAA,CACH,GACF;AAEJ;AAEAF,EAAO,cAAc;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as r } from "../../../chunks/
|
|
1
|
+
import { c as r } from "../../../chunks/clsx.js";
|
|
2
2
|
const u = {
|
|
3
3
|
black: "button-black",
|
|
4
4
|
green: "button-green",
|
|
@@ -17,10 +17,10 @@ const u = {
|
|
|
17
17
|
darkGrey: "button-darkGrey",
|
|
18
18
|
lightGrey: "button-lightGrey",
|
|
19
19
|
current: "button-current"
|
|
20
|
-
},
|
|
20
|
+
}, l = (t) => u[t || "saffron"], a = {
|
|
21
21
|
outline: "button-outline",
|
|
22
22
|
solid: "button-solid"
|
|
23
|
-
}, i = (t) =>
|
|
23
|
+
}, i = (t) => a[t || "solid"], s = {
|
|
24
24
|
circle: "button-circle",
|
|
25
25
|
pill: "button-pill"
|
|
26
26
|
}, b = (t) => s[t || "pill"], d = {
|
|
@@ -31,14 +31,14 @@ const u = {
|
|
|
31
31
|
"flex",
|
|
32
32
|
"button",
|
|
33
33
|
i(o),
|
|
34
|
-
|
|
34
|
+
l(t),
|
|
35
35
|
b(e),
|
|
36
36
|
c(n)
|
|
37
37
|
);
|
|
38
38
|
export {
|
|
39
39
|
u as BUTTON_COLORS,
|
|
40
40
|
d as BUTTON_SIZES,
|
|
41
|
-
|
|
41
|
+
a as BUTTON_THEMES,
|
|
42
42
|
s as BUTTON_VARIANTS,
|
|
43
43
|
m as getButtonClasses
|
|
44
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.type.js","sources":["../../../../lib/molecules/Buttons/v2/Button.type.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Button.type.js","sources":["../../../../lib/molecules/Buttons/v2/Button.type.ts"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { IconicNames, IconicTypes } from '@clubmed/trident-icons';\nimport type { Colors } from '@/types/Colors';\n\nexport interface ButtonProps {\n color?: Colors;\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 iconWidth?: string;\n size?: 'small' | 'medium' | 'large';\n theme?: 'outline' | 'solid';\n variant?: 'circle' | 'pill';\n}\n\ntype Params = {\n color: ButtonProps['color'];\n size: ButtonProps['size'];\n theme: ButtonProps['theme'];\n variant: ButtonProps['variant'];\n};\n\nexport const BUTTON_COLORS = {\n black: 'button-black',\n green: 'button-green',\n lavender: 'button-lavender',\n lightSand: 'button-lightSand',\n marygold: 'button-marygold',\n orange: 'button-orange',\n red: 'button-red',\n saffron: 'button-saffron',\n sand: 'button-sand',\n sienna: 'button-sienna',\n ultramarine: 'button-ultramarine',\n verdigris: 'button-verdigris',\n wave: 'button-wave',\n white: 'button-white',\n darkGrey: 'button-darkGrey',\n lightGrey: 'button-lightGrey',\n current: 'button-current',\n} as const satisfies Record<Colors, `button-${string}`>;\n\nconst getButtonColor = (color: ButtonProps['color']) => {\n return BUTTON_COLORS[color || 'saffron'];\n};\n\nexport const BUTTON_THEMES = {\n outline: 'button-outline',\n solid: 'button-solid',\n} as const satisfies Record<string, `button-${string}`>;\n\nconst getButtonTheme = (theme: ButtonProps['theme']) => {\n return BUTTON_THEMES[theme || 'solid'];\n};\n\nexport const BUTTON_VARIANTS = {\n circle: 'button-circle',\n pill: 'button-pill',\n} as const satisfies Record<string, `button-${string}`>;\n\nconst getButtonVariant = (variant: ButtonProps['variant']) => {\n return BUTTON_VARIANTS[variant || 'pill'];\n};\n\nexport const BUTTON_SIZES = {\n small: 'button-small',\n medium: 'button-medium',\n large: 'button-large',\n} as const satisfies Record<string, `button-${string}`>;\n\nconst getButtonSize = (size: ButtonProps['size']) => {\n return BUTTON_SIZES[size || 'medium'];\n};\n\nexport const getButtonClasses = ({ color, size, theme, variant }: Params) => {\n /* keep the \"flex\" class outside of \"button-*\" so that it can be overridden in responsive */\n return clsx(\n 'flex',\n 'button',\n getButtonTheme(theme),\n getButtonColor(color),\n getButtonVariant(variant),\n getButtonSize(size),\n );\n};\n"],"names":["BUTTON_COLORS","getButtonColor","color","BUTTON_THEMES","getButtonTheme","theme","BUTTON_VARIANTS","getButtonVariant","variant","BUTTON_SIZES","getButtonSize","size","getButtonClasses","clsx"],"mappings":";AA4BO,MAAMA,IAAgB;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,WAAW;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AACX,GAEMC,IAAiB,CAACC,MACfF,EAAcE,KAAS,SAAS,GAG5BC,IAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAAiB,CAACC,MACfF,EAAcE,KAAS,OAAO,GAG1BC,IAAkB;AAAA,EAC7B,QAAQ;AAAA,EACR,MAAM;AACR,GAEMC,IAAmB,CAACC,MACjBF,EAAgBE,KAAW,MAAM,GAG7BC,IAAe;AAAA,EAC1B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT,GAEMC,IAAgB,CAACC,MACdF,EAAaE,KAAQ,QAAQ,GAGzBC,IAAmB,CAAC,EAAE,OAAAV,GAAO,MAAAS,GAAM,OAAAN,GAAO,SAAAG,QAE9CK;AAAA,EACL;AAAA,EACA;AAAA,EACAT,EAAeC,CAAK;AAAA,EACpBJ,EAAeC,CAAK;AAAA,EACpBK,EAAiBC,CAAO;AAAA,EACxBE,EAAcC,CAAI;AAAA;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as s } from "../../chunks/
|
|
1
|
+
import { jsxs as c, Fragment as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "../../chunks/clsx.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { Image as
|
|
5
|
-
import { CardBackgroundContext as
|
|
4
|
+
import { Image as l } from "../../atoms/Image/Image.js";
|
|
5
|
+
import { CardBackgroundContext as m } from "./CardBackgroundContext.js";
|
|
6
6
|
const u = ({
|
|
7
7
|
children: o,
|
|
8
8
|
className: n,
|
|
9
9
|
...r
|
|
10
|
-
}) => /* @__PURE__ */ a
|
|
11
|
-
r?.src && /* @__PURE__ */ e(
|
|
10
|
+
}) => /* @__PURE__ */ c(a, { children: [
|
|
11
|
+
r?.src && /* @__PURE__ */ e(l, { ...r, src: r.src, className: "h-full w-full object-cover" }),
|
|
12
12
|
/* @__PURE__ */ e(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
@@ -20,7 +20,7 @@ const u = ({
|
|
|
20
20
|
},
|
|
21
21
|
n
|
|
22
22
|
),
|
|
23
|
-
children: /* @__PURE__ */ e(
|
|
23
|
+
children: /* @__PURE__ */ e(m.Provider, { value: { hasImage: !!r?.src }, children: o })
|
|
24
24
|
}
|
|
25
25
|
)
|
|
26
26
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBackground.js","sources":["../../../lib/molecules/Cards/CardBackground.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"CardBackground.js","sources":["../../../lib/molecules/Cards/CardBackground.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { type ComponentPropsWithoutRef, type FunctionComponent } from 'react';\nimport { Image, type ImageProps } from '@/atoms/Image/Image';\nimport { CardBackgroundContext } from './CardBackgroundContext';\n\nexport type CardBackgroundProps = ComponentPropsWithoutRef<'div'> & Partial<ImageProps>;\n\nexport const CardBackground: FunctionComponent<CardBackgroundProps> = ({\n children,\n className,\n ...attrs\n}) => {\n return (\n <>\n {attrs?.src && <Image {...attrs} src={attrs.src} className=\"h-full w-full object-cover\" />}\n\n <div\n {...attrs}\n className={clsx(\n 'pointer-events-none absolute inset-0 flex flex-col rounded-16',\n {\n 'bg-gradient-to-b from-transparent via-transparent to-black/40': attrs?.src,\n },\n className,\n )}\n >\n <CardBackgroundContext.Provider value={{ hasImage: !!attrs?.src }}>\n {children}\n </CardBackgroundContext.Provider>\n </div>\n </>\n );\n};\n"],"names":["CardBackground","children","className","attrs","jsxs","Fragment","Image","jsx","clsx","CardBackgroundContext"],"mappings":";;;;;AAOO,MAAMA,IAAyD,CAAC;AAAA,EACrE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,EAAAF,GAAO,yBAAQG,GAAA,EAAO,GAAGH,GAAO,KAAKA,EAAM,KAAK,WAAU,6BAAA,CAA6B;AAAA,EAExF,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGJ;AAAA,MACJ,WAAWK;AAAA,QACT;AAAA,QACA;AAAA,UACE,iEAAiEL,GAAO;AAAA,QAAA;AAAA,QAE1ED;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAK,EAACE,EAAsB,UAAtB,EAA+B,OAAO,EAAE,UAAU,CAAC,CAACN,GAAO,IAAA,GACzD,UAAAF,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AACF,GACF;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as x } from "../../chunks/clsx.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useCardBackground as
|
|
4
|
+
import { useCardBackground as i } from "./CardBackgroundContext.js";
|
|
5
5
|
const d = ({
|
|
6
6
|
children: t,
|
|
7
7
|
className: m,
|
|
8
8
|
coverLink: a = !1,
|
|
9
9
|
href: s,
|
|
10
10
|
onClick: r,
|
|
11
|
-
...
|
|
11
|
+
...p
|
|
12
12
|
}) => {
|
|
13
|
-
const e = !!s, { hasImage: o } =
|
|
13
|
+
const e = !!s, { hasImage: o } = i(), c = e ? "a" : "div", n = e ? { href: s, onClick: r } : {};
|
|
14
14
|
return /* @__PURE__ */ l(
|
|
15
|
-
|
|
15
|
+
c,
|
|
16
16
|
{
|
|
17
|
-
className:
|
|
17
|
+
className: x(
|
|
18
18
|
"pointer-events-auto flex w-full gap-x-8 px-12 pb-12 sm:px-24 sm:pb-24",
|
|
19
19
|
{
|
|
20
20
|
"justify-center text-center": !t,
|
|
@@ -25,8 +25,8 @@ const d = ({
|
|
|
25
25
|
},
|
|
26
26
|
m
|
|
27
27
|
),
|
|
28
|
-
...c,
|
|
29
28
|
...n,
|
|
29
|
+
...p,
|
|
30
30
|
children: t
|
|
31
31
|
}
|
|
32
32
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardClickable.js","sources":["../../../lib/molecules/Cards/CardClickable.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"CardClickable.js","sources":["../../../lib/molecules/Cards/CardClickable.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { type FunctionComponent, type HTMLAttributes } from 'react';\nimport { useCardBackground } from '@/molecules/Cards/CardBackgroundContext';\n\nexport interface CartTitleProps extends HTMLAttributes<HTMLDivElement | HTMLAnchorElement> {\n coverLink?: boolean;\n href?: string;\n}\n\nexport const CardClickable: FunctionComponent<CartTitleProps> = ({\n children,\n className,\n coverLink = false,\n href,\n onClick,\n ...attrs\n}) => {\n const hasLink = !!href;\n const { hasImage } = useCardBackground();\n const TagName = hasLink ? 'a' : 'div';\n const tagProps = hasLink ? { href, onClick } : {};\n\n return (\n <TagName\n className={clsx(\n 'pointer-events-auto flex w-full gap-x-8 px-12 pb-12 sm:px-24 sm:pb-24',\n {\n 'justify-center text-center': !children,\n 'h-full items-end': coverLink,\n 'mt-auto h-auto': !coverLink,\n 'text-white': hasImage,\n 'text-black': !hasImage,\n },\n className,\n )}\n {...tagProps}\n {...attrs}\n >\n {children}\n </TagName>\n );\n};\n"],"names":["CardClickable","children","className","coverLink","href","onClick","attrs","hasLink","hasImage","useCardBackground","TagName","tagProps","jsx","clsx"],"mappings":";;;;AASO,MAAMA,IAAmD,CAAC;AAAA,EAC/D,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAU,CAAC,CAACH,GACZ,EAAE,UAAAI,EAAA,IAAaC,EAAA,GACfC,IAAUH,IAAU,MAAM,OAC1BI,IAAWJ,IAAU,EAAE,MAAAH,GAAM,SAAAC,EAAA,IAAY,CAAA;AAE/C,SACE,gBAAAO;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAWG;AAAA,QACT;AAAA,QACA;AAAA,UACE,8BAA8B,CAACZ;AAAA,UAC/B,oBAAoBE;AAAA,UACpB,kBAAkB,CAACA;AAAA,UACnB,cAAcK;AAAA,UACd,cAAc,CAACA;AAAA,QAAA;AAAA,QAEjBN;AAAA,MAAA;AAAA,MAED,GAAGS;AAAA,MACH,GAAGL;AAAA,MAEH,UAAAL;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
3
3
|
import { useState as b, createElement as k } from "react";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as d } from "../../chunks/clsx.js";
|
|
5
5
|
import { Clickable as w } from "../../atoms/Clickable/Clickable.js";
|
|
6
6
|
import { Tag as v } from "../Tag.js";
|
|
7
7
|
import { CardBackground as C } from "./CardBackground.js";
|
|
@@ -10,9 +10,9 @@ import { Card as g } from "./v2/Card.js";
|
|
|
10
10
|
import { HeadingGroup as N } from "../../atoms/Heading/HeadingGroup.js";
|
|
11
11
|
import { Button as B } from "../Buttons/v2/Button.js";
|
|
12
12
|
const q = ({
|
|
13
|
-
children:
|
|
14
|
-
className:
|
|
15
|
-
hLevel:
|
|
13
|
+
children: i,
|
|
14
|
+
className: c,
|
|
15
|
+
hLevel: s = 3,
|
|
16
16
|
image: t,
|
|
17
17
|
onClick: m,
|
|
18
18
|
subtitle: p,
|
|
@@ -29,7 +29,7 @@ const q = ({
|
|
|
29
29
|
"data-name": "ExpandableCard",
|
|
30
30
|
"data-testid": "expandable-card",
|
|
31
31
|
...x,
|
|
32
|
-
className:
|
|
32
|
+
className: d({ "border-t-0": t?.src }, c),
|
|
33
33
|
"data-open": e,
|
|
34
34
|
children: [
|
|
35
35
|
/* @__PURE__ */ a(
|
|
@@ -45,11 +45,11 @@ const q = ({
|
|
|
45
45
|
/* @__PURE__ */ r(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
|
-
className:
|
|
48
|
+
className: d("mt-auto flex justify-between gap-x-8 p-20", {
|
|
49
49
|
"text-white": t?.src
|
|
50
50
|
}),
|
|
51
51
|
children: [
|
|
52
|
-
h && /* @__PURE__ */ a(N, { subtitle: p, level:
|
|
52
|
+
h && /* @__PURE__ */ a(N, { subtitle: p, level: s, children: l }),
|
|
53
53
|
/* @__PURE__ */ a(
|
|
54
54
|
B,
|
|
55
55
|
{
|
|
@@ -69,7 +69,7 @@ const q = ({
|
|
|
69
69
|
] })
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */ a(E, { isExpanded: e, children:
|
|
72
|
+
/* @__PURE__ */ a(E, { isExpanded: e, children: i })
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
);
|