@clubmed/trident-ui 1.3.0-beta.9 → 1.3.0-rc.2
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 +127 -0
- package/README.md +8 -0
- package/assets/icons/ResortFill/PHUC_Fill.svg +287 -10
- package/assets/icons/ResortFill/TOMC_Fill.svg +199 -14
- package/assets/icons/ResortFill-EC/KIPC_EC_Fill.svg +499 -0
- package/assets/icons/ResortOutline/PHUC_Outline.svg +156 -6
- package/assets/icons/ResortOutline/TOMC_Outline.svg +99 -6
- package/assets/icons/ResortOutline-EC/KIPC_EC_Outline.svg +380 -0
- package/assets/icons/Transports/Taxi.svg +5 -0
- package/assets/icons/Utilities/Doorhanger.svg +5 -0
- package/assets/{style.css → trident-ui.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/Icons/Iconics.d.ts +1 -1
- package/atoms/Icons/IconsResolver.d.ts +1 -1
- package/atoms/Icons/contexts/IconsContext.d.ts +1 -1
- package/atoms/Icons/svg/SvgIcon.d.ts +1 -1
- package/atoms/Icons/svg-use/SvgUseIcon.d.ts +1 -1
- 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 +19 -14
- package/chunks/_commonjsHelpers.js.map +1 -1
- package/chunks/index.js +36 -33
- package/chunks/index.js.map +1 -1
- package/chunks/plugin.js +57 -46
- package/chunks/plugin.js.map +1 -1
- package/contexts/Devices/Device.d.ts +3 -3
- package/contexts/Devices/hooks/useQueries.d.ts +2 -2
- package/contexts/Devices/reducers/reducer.d.ts +2 -2
- package/contexts/TridentUIConfig.d.ts +1 -1
- package/contexts/TridentUIConfig.js +1265 -653
- 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/useKeyboardControls.d.ts +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.d.ts +2 -2
- package/molecules/Arrows/Arrows.d.ts +2 -2
- package/molecules/Avatar.d.ts +1 -1
- package/molecules/Avatar.js +24 -24
- package/molecules/Avatar.js.map +1 -1
- package/molecules/Backdrop.d.ts +1 -1
- package/molecules/Breadcrumb.d.ts +7 -11
- package/molecules/Breadcrumb.js +44 -36
- package/molecules/Breadcrumb.js.map +1 -1
- package/molecules/Breadcrumb.themes.d.ts +8 -0
- package/molecules/Breadcrumb.themes.js +15 -0
- package/molecules/Breadcrumb.themes.js.map +1 -0
- package/molecules/Buttons/ArrowButton.d.ts +1 -1
- package/molecules/Buttons/Button.d.ts +3 -3
- package/molecules/Buttons/ButtonAnchor.d.ts +2 -2
- package/molecules/Buttons/ButtonContent.d.ts +2 -2
- package/molecules/Buttons/FakeButton.d.ts +2 -3
- package/molecules/Buttons/InertButton.d.ts +2 -2
- package/molecules/Buttons/v2/Button.d.ts +2096 -2097
- package/molecules/Buttons/v2/Button.type.d.ts +5 -2
- package/molecules/Buttons/v2/Button.type.js +8 -5
- package/molecules/Buttons/v2/Button.type.js.map +1 -1
- package/molecules/Card.d.ts +1 -11
- package/molecules/Card.js +2 -34
- 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 +27 -33
- package/molecules/ElasticHeight.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.d.ts +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.js +43 -43
- package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkboxes.d.ts +2 -2
- package/molecules/Forms/DateField.d.ts +2 -2
- package/molecules/Forms/DateField.js +60 -61
- package/molecules/Forms/DateField.js.map +1 -1
- package/molecules/Forms/Filter.d.ts +1 -2
- package/molecules/Forms/Filter.js +29 -29
- package/molecules/Forms/Filter.js.map +1 -1
- package/molecules/Forms/FormControl.d.ts +4 -4
- package/molecules/Forms/FormLabel.d.ts +1 -1
- package/molecules/Forms/NumberField.d.ts +280 -280
- package/molecules/Forms/Password/Password.d.ts +1 -1
- package/molecules/Forms/Password/ValidationMessage.d.ts +1 -1
- package/molecules/Forms/Radios/Radio.d.ts +4 -2
- package/molecules/Forms/Radios/Radio.js +29 -28
- package/molecules/Forms/Radios/Radio.js.map +1 -1
- package/molecules/Forms/Radios/RadioGroup.d.ts +2 -2
- package/molecules/Forms/Radios/RadioGroup.js +70 -33
- package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
- package/molecules/Forms/Range.d.ts +1 -2
- package/molecules/Forms/Range.js +144 -421
- package/molecules/Forms/Range.js.map +1 -1
- package/molecules/Forms/Select.d.ts +3 -3
- package/molecules/Forms/Switch.d.ts +1 -1
- package/molecules/Forms/TextField.d.ts +3 -3
- package/molecules/HamburgerIcon.d.ts +1 -1
- package/molecules/Link.d.ts +2 -2
- package/molecules/Loader.d.ts +1 -1
- package/molecules/Pagination.d.ts +2 -2
- package/molecules/Popin.d.ts +1 -1
- package/molecules/Spinner.d.ts +1 -1
- package/molecules/Tabs/Tab.d.ts +2 -3
- package/molecules/Tabs/Tab.js +41 -42
- package/molecules/Tabs/Tab.js.map +1 -1
- package/molecules/Tabs/TabList.d.ts +1 -1
- package/molecules/Tabs/TabList.js +21 -21
- package/molecules/Tabs/TabList.js.map +1 -1
- package/molecules/Tabs/TabPanel.d.ts +1 -1
- package/molecules/Tabs/TabPanel.js +13 -13
- package/molecules/Tabs/TabPanel.js.map +1 -1
- package/molecules/Tabs/Tabs.d.ts +1 -1
- package/molecules/Tabs/TabsBody.d.ts +1 -1
- package/molecules/Tabs/context/TabControl.d.ts +2 -2
- package/molecules/Tabs/hooks/tabControl.d.ts +5 -5
- package/molecules/Tag.d.ts +43 -0
- package/molecules/Tag.js +73 -0
- package/molecules/Tag.js.map +1 -0
- package/package.json +43 -40
- package/styles/index.css +1 -1
- package/tailwind/plugins/animationDelay.d.ts +2 -2
- package/tailwind/plugins/hocus.d.ts +2 -2
- package/tailwind/plugins/lineClampFix.d.ts +2 -2
- package/tailwind/plugins/popover.d.ts +2 -2
- package/tailwind/plugins/startingStyle.d.ts +2 -2
- package/tailwind/plugins/transitionBehavior.d.ts +2 -2
- package/tailwind/tailwind.preset.d.ts +50 -50
- package/types/LiteralUnion.d.js +2 -0
- package/types/LiteralUnion.d.js.map +1 -0
- package/types/Theme.d.js +2 -0
- package/types/Theme.d.js.map +1 -0
- package/assets/icons/ResortFill/KIPC_Fill.svg +0 -12
- package/assets/icons/ResortOutline/KIPC_Outline.svg +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { IconicNames, IconicTypes } from '@clubmed/trident-icons';
|
|
2
|
+
import { Colors } from '../../../types/Colors';
|
|
3
3
|
export interface ButtonProps {
|
|
4
4
|
color?: Colors;
|
|
5
5
|
/**
|
|
@@ -36,6 +36,9 @@ export declare const BUTTON_COLORS: {
|
|
|
36
36
|
readonly verdigris: "button-verdigris";
|
|
37
37
|
readonly wave: "button-wave";
|
|
38
38
|
readonly white: "button-white";
|
|
39
|
+
readonly darkGrey: "button-darkGrey";
|
|
40
|
+
readonly lightGrey: "button-lightGrey";
|
|
41
|
+
readonly current: "button-current";
|
|
39
42
|
};
|
|
40
43
|
export declare const BUTTON_THEMES: {
|
|
41
44
|
readonly outline: "button-outline";
|
|
@@ -13,21 +13,24 @@ const u = {
|
|
|
13
13
|
ultramarine: "button-ultramarine",
|
|
14
14
|
verdigris: "button-verdigris",
|
|
15
15
|
wave: "button-wave",
|
|
16
|
-
white: "button-white"
|
|
16
|
+
white: "button-white",
|
|
17
|
+
darkGrey: "button-darkGrey",
|
|
18
|
+
lightGrey: "button-lightGrey",
|
|
19
|
+
current: "button-current"
|
|
17
20
|
}, a = (t) => u[t || "saffron"], l = {
|
|
18
21
|
outline: "button-outline",
|
|
19
22
|
solid: "button-solid"
|
|
20
|
-
},
|
|
23
|
+
}, i = (t) => l[t || "solid"], s = {
|
|
21
24
|
circle: "button-circle",
|
|
22
25
|
pill: "button-pill"
|
|
23
|
-
}, b = (t) =>
|
|
26
|
+
}, b = (t) => s[t || "pill"], d = {
|
|
24
27
|
small: "button-small",
|
|
25
28
|
medium: "button-medium",
|
|
26
29
|
large: "button-large"
|
|
27
30
|
}, c = (t) => d[t || "medium"], m = ({ color: t, size: n, theme: o, variant: e }) => r(
|
|
28
31
|
"flex",
|
|
29
32
|
"button",
|
|
30
|
-
|
|
33
|
+
i(o),
|
|
31
34
|
a(t),
|
|
32
35
|
b(e),
|
|
33
36
|
c(n)
|
|
@@ -36,7 +39,7 @@ export {
|
|
|
36
39
|
u as BUTTON_COLORS,
|
|
37
40
|
d as BUTTON_SIZES,
|
|
38
41
|
l as BUTTON_THEMES,
|
|
39
|
-
|
|
42
|
+
s as BUTTON_VARIANTS,
|
|
40
43
|
m as getButtonClasses
|
|
41
44
|
};
|
|
42
45
|
//# sourceMappingURL=Button.type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.type.js","sources":["../../../../lib/molecules/Buttons/v2/Button.type.ts"],"sourcesContent":["import classnames from 'classnames';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"Button.type.js","sources":["../../../../lib/molecules/Buttons/v2/Button.type.ts"],"sourcesContent":["import classnames from 'classnames';\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 classnames(\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","classnames"],"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;"}
|
package/molecules/Card.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
|
|
3
|
-
interface CardProps {
|
|
4
|
-
title: string;
|
|
5
|
-
icon: IconicNames;
|
|
6
|
-
iconType?: IconicTypes;
|
|
7
|
-
theme?: 'light' | 'dark';
|
|
8
|
-
dataName?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const Card: FunctionComponent<PropsWithChildren<CardProps>>;
|
|
11
|
-
export {};
|
|
1
|
+
export * from './Cards/Card';
|
package/molecules/Card.js
CHANGED
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as d } from "../chunks/index.js";
|
|
3
|
-
import { Icon as o } from "@clubmed/trident-icons";
|
|
4
|
-
const f = ({
|
|
5
|
-
title: a,
|
|
6
|
-
children: s,
|
|
7
|
-
icon: i,
|
|
8
|
-
iconType: l,
|
|
9
|
-
theme: r = "light",
|
|
10
|
-
dataName: n = "Card"
|
|
11
|
-
}) => /* @__PURE__ */ t(
|
|
12
|
-
"div",
|
|
13
|
-
{
|
|
14
|
-
className: "border-lightGrey rounded-16 flex shrink-0 flex-row gap-20 border bg-white p-20",
|
|
15
|
-
"data-name": n,
|
|
16
|
-
children: [
|
|
17
|
-
/* @__PURE__ */ e(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
className: d("flex h-48 w-48 shrink-0 items-center justify-center rounded-full", {
|
|
21
|
-
"bg-ultramarine text-white": r === "dark",
|
|
22
|
-
"bg-lightSand text-black": r === "light"
|
|
23
|
-
}),
|
|
24
|
-
children: /* @__PURE__ */ e(o, { name: i, type: l, width: "24px" })
|
|
25
|
-
}
|
|
26
|
-
),
|
|
27
|
-
/* @__PURE__ */ t("div", { className: "space-y-8 font-sans", children: [
|
|
28
|
-
/* @__PURE__ */ e("div", { className: "text-b3 font-semibold", children: a }),
|
|
29
|
-
/* @__PURE__ */ e("div", { className: "text-b4 font-normal", children: s })
|
|
30
|
-
] })
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
);
|
|
1
|
+
import { Card as a } from "./Cards/Card.js";
|
|
34
2
|
export {
|
|
35
|
-
|
|
3
|
+
a as Card
|
|
36
4
|
};
|
|
37
5
|
//# sourceMappingURL=Card.js.map
|
package/molecules/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":[
|
|
1
|
+
{"version":3,"file":"Card.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FunctionComponent, PropsWithChildren } from 'react';
|
|
2
|
+
import { CardProps as CardPropsV2 } from './v2/Card';
|
|
3
|
+
import { IconicNames, IconicTypes } from '@clubmed/trident-icons';
|
|
4
|
+
import { ChipProps } from '../Chip';
|
|
5
|
+
interface CardProps extends Omit<CardPropsV2, 'theme'> {
|
|
6
|
+
title: string;
|
|
7
|
+
icon: IconicNames;
|
|
8
|
+
iconType?: IconicTypes;
|
|
9
|
+
theme?: ChipProps['theme'];
|
|
10
|
+
dataName?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Card: FunctionComponent<PropsWithChildren<CardProps>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Card as n } from "./v2/Card.js";
|
|
3
|
+
import { Icon as d } from "@clubmed/trident-icons";
|
|
4
|
+
import { Chip as l } from "../Chip.js";
|
|
5
|
+
const x = ({
|
|
6
|
+
title: e,
|
|
7
|
+
children: s,
|
|
8
|
+
icon: i,
|
|
9
|
+
iconType: t,
|
|
10
|
+
theme: o = "light",
|
|
11
|
+
dataName: m = "Card"
|
|
12
|
+
}) => /* @__PURE__ */ a(n, { "data-name": m, className: "p-20 flex shrink-0 flex-row gap-20", children: [
|
|
13
|
+
/* @__PURE__ */ r(l, { theme: o, size: "size-48", children: /* @__PURE__ */ r(d, { name: i, type: t, width: "24px" }) }),
|
|
14
|
+
/* @__PURE__ */ a("div", { className: "space-y-8 font-sans", children: [
|
|
15
|
+
/* @__PURE__ */ r("div", { className: "text-b3 font-semibold", children: e }),
|
|
16
|
+
/* @__PURE__ */ r("div", { className: "text-b4 font-normal", children: s })
|
|
17
|
+
] })
|
|
18
|
+
] });
|
|
19
|
+
export {
|
|
20
|
+
x as Card
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../lib/molecules/Cards/Card.tsx"],"sourcesContent":["import type { FunctionComponent, PropsWithChildren } from 'react';\nimport { Card as CardV2, type CardProps as CardPropsV2 } from '@/molecules/Cards/v2/Card';\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\nimport { Chip, type ChipProps } from '@/molecules/Chip';\n\ninterface CardProps extends Omit<CardPropsV2, 'theme'> {\n title: string;\n icon: IconicNames;\n iconType?: IconicTypes;\n theme?: ChipProps['theme'];\n dataName?: string;\n}\n\nexport const Card: FunctionComponent<PropsWithChildren<CardProps>> = ({\n title,\n children,\n icon,\n iconType,\n theme = 'light',\n dataName = 'Card',\n}) => {\n return (\n <CardV2 data-name={dataName} className=\"p-20 flex shrink-0 flex-row gap-20\">\n <Chip theme={theme} size={'size-48'}>\n <Icon name={icon} type={iconType} width=\"24px\" />\n </Chip>\n <div className=\"space-y-8 font-sans\">\n <div className=\"text-b3 font-semibold\">{title}</div>\n <div className=\"text-b4 font-normal\">{children}</div>\n </div>\n </CardV2>\n );\n};\n"],"names":["Card","title","children","icon","iconType","theme","dataName","jsxs","CardV2","jsx","Chip","Icon"],"mappings":";;;;AAaO,MAAMA,IAAwD,CAAC;AAAA,EACpE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AACb,MAEI,gBAAAC,EAACC,GAAA,EAAO,aAAWF,GAAU,WAAU,uCACrC,UAAA;AAAA,EAAA,gBAAAG,EAACC,GAAA,EAAK,OAAAL,GAAc,MAAM,WACxB,UAAA,gBAAAI,EAACE,GAAA,EAAK,MAAMR,GAAM,MAAMC,GAAU,OAAM,OAAA,CAAO,GACjD;AAAA,EACA,gBAAAG,EAAC,OAAA,EAAI,WAAU,uBACb,UAAA;AAAA,IAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,yBAAyB,UAAAR,GAAM;AAAA,IAC9C,gBAAAQ,EAAC,OAAA,EAAI,WAAU,uBAAuB,UAAAP,EAAA,CAAS;AAAA,EAAA,EAAA,CACjD;AAAA,GACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardAspectRatios.js","sources":["../../../lib/molecules/Cards/CardAspectRatios.ts"],"sourcesContent":["export const CARD_ASPECT_RATIOS = {\n horizontal: 'aspect-horizontal',\n vertical: 'aspect-vertical',\n square: 'aspect-square',\n custom: '',\n} as const;\n"],"names":["CARD_ASPECT_RATIOS"],"mappings":"AAAO,MAAMA,IAAqB;AAAA,EAChC,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AACV;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, FunctionComponent } from 'react';
|
|
2
|
+
import { ImageProps } from '../../atoms/Image/Image';
|
|
3
|
+
export type CardBackgroundProps = ComponentPropsWithoutRef<'div'> & Partial<ImageProps>;
|
|
4
|
+
export declare const CardBackground: FunctionComponent<CardBackgroundProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "../../chunks/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Image as m } from "../../atoms/Image/Image.js";
|
|
5
|
+
import { CardBackgroundContext as l } from "./CardBackgroundContext.js";
|
|
6
|
+
const u = ({
|
|
7
|
+
children: o,
|
|
8
|
+
className: n,
|
|
9
|
+
...r
|
|
10
|
+
}) => /* @__PURE__ */ a(c, { children: [
|
|
11
|
+
r?.src && /* @__PURE__ */ e(m, { ...r, src: r.src, className: "h-full w-full object-cover" }),
|
|
12
|
+
/* @__PURE__ */ e(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
...r,
|
|
16
|
+
className: s(
|
|
17
|
+
"pointer-events-none absolute inset-0 flex flex-col rounded-16",
|
|
18
|
+
{
|
|
19
|
+
"bg-gradient-to-b from-transparent via-transparent to-black/40": r?.src
|
|
20
|
+
},
|
|
21
|
+
n
|
|
22
|
+
),
|
|
23
|
+
children: /* @__PURE__ */ e(l.Provider, { value: { hasImage: !!r?.src }, children: o })
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] });
|
|
27
|
+
export {
|
|
28
|
+
u as CardBackground
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=CardBackground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardBackground.js","sources":["../../../lib/molecules/Cards/CardBackground.tsx"],"sourcesContent":["import classnames from 'classnames';\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={classnames(\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","classnames","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;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardBackgroundContext.js","sources":["../../../lib/molecules/Cards/CardBackgroundContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport const CardBackgroundContext = createContext<{ hasImage: boolean }>({ hasImage: true });\n\nexport function useCardBackground() {\n return useContext(CardBackgroundContext);\n}\n"],"names":["CardBackgroundContext","createContext","useCardBackground","useContext"],"mappings":";AAEO,MAAMA,IAAwBC,EAAqC,EAAE,UAAU,IAAM;AAErF,SAASC,IAAoB;AAClC,SAAOC,EAAWH,CAAqB;AACzC;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FunctionComponent, HTMLAttributes } from 'react';
|
|
2
|
+
export interface CartTitleProps extends HTMLAttributes<HTMLDivElement | HTMLAnchorElement> {
|
|
3
|
+
coverLink?: boolean;
|
|
4
|
+
href?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const CardClickable: FunctionComponent<CartTitleProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "../../chunks/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { useCardBackground as u } from "./CardBackgroundContext.js";
|
|
5
|
+
const d = ({
|
|
6
|
+
children: t,
|
|
7
|
+
className: m,
|
|
8
|
+
coverLink: a = !1,
|
|
9
|
+
href: s,
|
|
10
|
+
onClick: r,
|
|
11
|
+
...n
|
|
12
|
+
}) => {
|
|
13
|
+
const e = !!s, { hasImage: o } = u(), p = e ? "a" : "div", c = e ? { href: s, onClick: r } : {};
|
|
14
|
+
return /* @__PURE__ */ l(
|
|
15
|
+
p,
|
|
16
|
+
{
|
|
17
|
+
className: i(
|
|
18
|
+
"pointer-events-auto flex w-full gap-x-8 px-12 pb-12 sm:px-24 sm:pb-24",
|
|
19
|
+
{
|
|
20
|
+
"justify-center text-center": !t,
|
|
21
|
+
"h-full items-end": a,
|
|
22
|
+
"mt-auto h-auto": !a,
|
|
23
|
+
"text-white": o,
|
|
24
|
+
"text-black": !o
|
|
25
|
+
},
|
|
26
|
+
m
|
|
27
|
+
),
|
|
28
|
+
...c,
|
|
29
|
+
...n,
|
|
30
|
+
children: t
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
d as CardClickable
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=CardClickable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardClickable.js","sources":["../../../lib/molecules/Cards/CardClickable.tsx"],"sourcesContent":["import classnames from 'classnames';\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={classnames(\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","classnames"],"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;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps, FunctionComponent } from 'react';
|
|
2
|
+
import { Heading } from '../../atoms/Heading/Heading';
|
|
3
|
+
import { Tag } from '../Tag';
|
|
4
|
+
import { CardBackgroundProps } from './CardBackground';
|
|
5
|
+
import { CardProps } from './v2/Card';
|
|
6
|
+
export interface ExpandableCardProps extends Omit<CardProps<'article'>, 'onClick'> {
|
|
7
|
+
hLevel?: ComponentProps<typeof Heading>['level'];
|
|
8
|
+
image?: CardBackgroundProps;
|
|
9
|
+
onClick?: (isExpanded: boolean) => void;
|
|
10
|
+
subtitle?: string | null;
|
|
11
|
+
tags?: ComponentProps<typeof Tag>[] | null;
|
|
12
|
+
title: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ExpandableCard: FunctionComponent<ExpandableCardProps>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { useState as b, createElement as k } from "react";
|
|
4
|
+
import { c as s } from "../../chunks/index.js";
|
|
5
|
+
import { Clickable as w } from "../../atoms/Clickable/Clickable.js";
|
|
6
|
+
import { Tag as v } from "../Tag.js";
|
|
7
|
+
import { CardBackground as C } from "./CardBackground.js";
|
|
8
|
+
import { ElasticHeight as E } from "../ElasticHeight.js";
|
|
9
|
+
import { Card as g } from "./v2/Card.js";
|
|
10
|
+
import { HeadingGroup as N } from "../../atoms/Heading/HeadingGroup.js";
|
|
11
|
+
import { Button as B } from "../Buttons/v2/Button.js";
|
|
12
|
+
const q = ({
|
|
13
|
+
children: d,
|
|
14
|
+
className: i,
|
|
15
|
+
hLevel: c = 3,
|
|
16
|
+
image: t,
|
|
17
|
+
onClick: m,
|
|
18
|
+
subtitle: p,
|
|
19
|
+
tags: o,
|
|
20
|
+
title: l,
|
|
21
|
+
component: f = "article",
|
|
22
|
+
...x
|
|
23
|
+
}) => {
|
|
24
|
+
const h = !!l, [e, u] = b(!1);
|
|
25
|
+
return /* @__PURE__ */ r(
|
|
26
|
+
g,
|
|
27
|
+
{
|
|
28
|
+
component: f,
|
|
29
|
+
"data-name": "ExpandableCard",
|
|
30
|
+
"data-testid": "expandable-card",
|
|
31
|
+
...x,
|
|
32
|
+
className: s({ "border-t-0": t?.src }, i),
|
|
33
|
+
"data-open": e,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ a(
|
|
36
|
+
w,
|
|
37
|
+
{
|
|
38
|
+
className: "group relative -m-1 block aspect-horizontal overflow-hidden rounded-16 text-start",
|
|
39
|
+
"data-testid": "expandable-card-clickable",
|
|
40
|
+
onClick: () => {
|
|
41
|
+
m?.(!e), u(!e);
|
|
42
|
+
},
|
|
43
|
+
children: /* @__PURE__ */ r(C, { ...t || {}, children: [
|
|
44
|
+
!!o?.length && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4 self-start p-20", children: o?.map((n) => /* @__PURE__ */ k(v, { ...n, key: n.label })) }),
|
|
45
|
+
/* @__PURE__ */ r(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: s("mt-auto flex justify-between gap-x-8 p-20", {
|
|
49
|
+
"text-white": t?.src
|
|
50
|
+
}),
|
|
51
|
+
children: [
|
|
52
|
+
h && /* @__PURE__ */ a(N, { subtitle: p, level: c, children: l }),
|
|
53
|
+
/* @__PURE__ */ a(
|
|
54
|
+
B,
|
|
55
|
+
{
|
|
56
|
+
component: "span",
|
|
57
|
+
className: "!transition duration-500",
|
|
58
|
+
color: t?.src ? "white" : "black",
|
|
59
|
+
icon: "ArrowDefaultDown",
|
|
60
|
+
style: { rotate: e ? "-180deg" : "0deg" },
|
|
61
|
+
tabIndex: -1,
|
|
62
|
+
theme: "outline",
|
|
63
|
+
variant: "circle"
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] })
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ a(E, { isExpanded: e, children: d })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
q as ExpandableCard
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=ExpandableCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpandableCard.js","sources":["../../../lib/molecules/Cards/ExpandableCard.tsx"],"sourcesContent":["'use client';\n\nimport classnames from 'classnames';\nimport { type ComponentProps, type FunctionComponent, useState } from 'react';\n\nimport { Clickable } from '../../atoms/Clickable/Clickable';\nimport { Heading } from '../../atoms/Heading/Heading';\nimport { Tag } from '../Tag';\nimport { CardBackground, type CardBackgroundProps } from '@/molecules/Cards/CardBackground';\nimport { ElasticHeight } from '@/molecules/ElasticHeight';\nimport { Card, type CardProps } from '@/molecules/Cards/v2/Card';\nimport { HeadingGroup } from '@/atoms/Heading/HeadingGroup';\nimport { Button } from '@/molecules/Buttons/v2/Button';\n\nexport interface ExpandableCardProps extends Omit<CardProps<'article'>, 'onClick'> {\n hLevel?: ComponentProps<typeof Heading>['level'];\n image?: CardBackgroundProps;\n onClick?: (isExpanded: boolean) => void;\n subtitle?: string | null;\n tags?: ComponentProps<typeof Tag>[] | null;\n title: string;\n}\n\nexport const ExpandableCard: FunctionComponent<ExpandableCardProps> = ({\n children,\n className,\n hLevel = 3,\n image,\n onClick,\n subtitle,\n tags,\n title,\n component = 'article',\n ...attrs\n}) => {\n const hasTitle = Boolean(title);\n\n const [isExpanded, setIsExpanded] = useState(false);\n\n return (\n <Card<'article'>\n component={component}\n data-name=\"ExpandableCard\"\n data-testid=\"expandable-card\"\n {...attrs}\n className={classnames({ 'border-t-0': image?.src }, className)}\n data-open={isExpanded}\n >\n <Clickable\n className=\"group relative -m-1 block aspect-horizontal overflow-hidden rounded-16 text-start\"\n data-testid=\"expandable-card-clickable\"\n onClick={() => {\n onClick?.(!isExpanded);\n setIsExpanded(!isExpanded);\n }}\n >\n <CardBackground {...(image || {})}>\n {Boolean(tags?.length) && (\n <div className=\"flex flex-wrap gap-4 self-start p-20\">\n {tags?.map((tag) => <Tag {...tag} key={tag.label} />)}\n </div>\n )}\n <div\n className={classnames('mt-auto flex justify-between gap-x-8 p-20', {\n 'text-white': image?.src,\n })}\n >\n {hasTitle && (\n <HeadingGroup subtitle={subtitle} level={hLevel}>\n {title}\n </HeadingGroup>\n )}\n <Button\n component=\"span\"\n className=\"!transition duration-500\"\n color={image?.src ? 'white' : 'black'}\n icon=\"ArrowDefaultDown\"\n style={{ rotate: isExpanded ? '-180deg' : '0deg' }}\n tabIndex={-1}\n theme=\"outline\"\n variant=\"circle\"\n />\n </div>\n </CardBackground>\n </Clickable>\n <ElasticHeight isExpanded={isExpanded}>{children}</ElasticHeight>\n </Card>\n );\n};\n"],"names":["ExpandableCard","children","className","hLevel","image","onClick","subtitle","tags","title","component","attrs","hasTitle","isExpanded","setIsExpanded","useState","jsxs","Card","classnames","jsx","Clickable","CardBackground","tag","createElement","Tag","HeadingGroup","Button","ElasticHeight"],"mappings":";;;;;;;;;;;AAuBO,MAAMA,IAAyD,CAAC;AAAA,EACrE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAW,EAAQH,GAEnB,CAACI,GAAYC,CAAa,IAAIC,EAAS,EAAK;AAElD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAP;AAAA,MACA,aAAU;AAAA,MACV,eAAY;AAAA,MACX,GAAGC;AAAA,MACJ,WAAWO,EAAW,EAAE,cAAcb,GAAO,IAAA,GAAOF,CAAS;AAAA,MAC7D,aAAWU;AAAA,MAEX,UAAA;AAAA,QAAA,gBAAAM;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,SAAS,MAAM;AACb,cAAAd,IAAU,CAACO,CAAU,GACrBC,EAAc,CAACD,CAAU;AAAA,YAC3B;AAAA,YAEA,UAAA,gBAAAG,EAACK,GAAA,EAAgB,GAAIhB,KAAS,CAAA,GAC3B,UAAA;AAAA,cAAA,EAAQG,GAAM,4BACZ,OAAA,EAAI,WAAU,wCACZ,UAAAA,GAAM,IAAI,CAACc,MAAQ,gBAAAC,EAACC,KAAK,GAAGF,GAAK,KAAKA,EAAI,OAAO,CAAE,GACtD;AAAA,cAEF,gBAAAN;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWE,EAAW,6CAA6C;AAAA,oBACjE,cAAcb,GAAO;AAAA,kBAAA,CACtB;AAAA,kBAEA,UAAA;AAAA,oBAAAO,KACC,gBAAAO,EAACM,GAAA,EAAa,UAAAlB,GAAoB,OAAOH,GACtC,UAAAK,GACH;AAAA,oBAEF,gBAAAU;AAAA,sBAACO;AAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,WAAU;AAAA,wBACV,OAAOrB,GAAO,MAAM,UAAU;AAAA,wBAC9B,MAAK;AAAA,wBACL,OAAO,EAAE,QAAQQ,IAAa,YAAY,OAAA;AAAA,wBAC1C,UAAU;AAAA,wBACV,OAAM;AAAA,wBACN,SAAQ;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACV;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF,EAAA,CACF;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAAM,EAACQ,GAAA,EAAc,YAAAd,GAAyB,UAAAX,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGvD;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
2
|
+
import { CARD_ASPECT_RATIOS } from '../CardAspectRatios';
|
|
3
|
+
type CARD_THEME = 'none' | 'bordered' | 'frame';
|
|
4
|
+
export type CardProps<T extends ElementType = 'div'> = {
|
|
5
|
+
component?: string;
|
|
6
|
+
/**
|
|
7
|
+
* By default the card has a border.
|
|
8
|
+
* Set to false to remove it.
|
|
9
|
+
*/
|
|
10
|
+
border?: boolean;
|
|
11
|
+
format?: keyof typeof CARD_ASPECT_RATIOS;
|
|
12
|
+
theme?: CARD_THEME | CARD_THEME[];
|
|
13
|
+
} & ComponentPropsWithoutRef<T>;
|
|
14
|
+
export declare function Card<T extends ElementType = 'div'>({ children, className, component, format, theme, ...attrs }: CardProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../../../chunks/index.js";
|
|
3
|
+
import { CARD_ASPECT_RATIOS as l } from "../CardAspectRatios.js";
|
|
4
|
+
function f({
|
|
5
|
+
children: o,
|
|
6
|
+
className: e,
|
|
7
|
+
component: d = "div",
|
|
8
|
+
format: i = "custom",
|
|
9
|
+
theme: t = "bordered",
|
|
10
|
+
...n
|
|
11
|
+
}) {
|
|
12
|
+
const s = d, r = [].concat(t).join(" ");
|
|
13
|
+
return /* @__PURE__ */ c(
|
|
14
|
+
s,
|
|
15
|
+
{
|
|
16
|
+
...n,
|
|
17
|
+
className: m(
|
|
18
|
+
l[i],
|
|
19
|
+
"relative isolate rounded-16",
|
|
20
|
+
{
|
|
21
|
+
"bg-white": !e?.includes("bg-"),
|
|
22
|
+
"group overflow-hidden": r.includes("frame"),
|
|
23
|
+
"border border-lightGrey": r.includes("bordered")
|
|
24
|
+
},
|
|
25
|
+
e
|
|
26
|
+
),
|
|
27
|
+
children: o
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
f as Card
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../../lib/molecules/Cards/v2/Card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ElementType } from 'react';\nimport cx from 'classnames';\nimport { CARD_ASPECT_RATIOS } from '../CardAspectRatios';\n\ntype CARD_THEME = 'none' | 'bordered' | 'frame';\n\nexport type CardProps<T extends ElementType = 'div'> = {\n component?: string;\n /**\n * By default the card has a border.\n * Set to false to remove it.\n */\n border?: boolean;\n format?: keyof typeof CARD_ASPECT_RATIOS;\n theme?: CARD_THEME | CARD_THEME[];\n} & ComponentPropsWithoutRef<T>;\n\nexport function Card<T extends ElementType = 'div'>({\n children,\n className,\n component = 'div',\n format = 'custom',\n theme = 'bordered',\n ...attrs\n}: CardProps<T>) {\n const Cmp = component as ElementType;\n const resolvedTheme = ([] as CARD_THEME[]).concat(theme).join(' ');\n\n return (\n <Cmp\n {...attrs}\n className={cx(\n CARD_ASPECT_RATIOS[format],\n 'relative isolate rounded-16',\n {\n 'bg-white': !className?.includes('bg-'),\n 'group overflow-hidden': resolvedTheme.includes('frame'),\n 'border border-lightGrey': resolvedTheme.includes('bordered'),\n },\n className,\n )}\n >\n {children}\n </Cmp>\n );\n}\n"],"names":["Card","children","className","component","format","theme","attrs","Cmp","resolvedTheme","jsx","cx","CARD_ASPECT_RATIOS"],"mappings":";;;AAiBO,SAASA,EAAoC;AAAA,EAClD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,GAAGC;AACL,GAAiB;AACf,QAAMC,IAAMJ,GACNK,IAAiB,CAAA,EAAoB,OAAOH,CAAK,EAAE,KAAK,GAAG;AAEjE,SACE,gBAAAI;AAAA,IAACF;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,WAAWI;AAAAA,QACTC,EAAmBP,CAAM;AAAA,QACzB;AAAA,QACA;AAAA,UACE,YAAY,CAACF,GAAW,SAAS,KAAK;AAAA,UACtC,yBAAyBM,EAAc,SAAS,OAAO;AAAA,UACvD,2BAA2BA,EAAc,SAAS,UAAU;AAAA,QAAA;AAAA,QAE9DN;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { Theme } from './Chip.themes';
|
|
3
|
+
import { Colors } from '../types/Colors';
|
|
4
|
+
export interface ChipProps extends ComponentPropsWithoutRef<'span'> {
|
|
5
|
+
color?: Colors;
|
|
6
|
+
size?: string;
|
|
7
|
+
theme?: Theme;
|
|
8
|
+
}
|
|
9
|
+
export declare const Chip: ({ className, color, size, theme, children, ...attrs }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../chunks/index.js";
|
|
3
|
+
import { getTheme as c } from "./Chip.themes.js";
|
|
4
|
+
const f = ({
|
|
5
|
+
className: e,
|
|
6
|
+
color: s = "sienna",
|
|
7
|
+
size: r = "size-32",
|
|
8
|
+
theme: o = "solid",
|
|
9
|
+
children: t,
|
|
10
|
+
...n
|
|
11
|
+
}) => {
|
|
12
|
+
const { thRoot: i } = c(o, { color: s });
|
|
13
|
+
return /* @__PURE__ */ a(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
...n,
|
|
17
|
+
className: m(
|
|
18
|
+
"inline-flex aspect-square shrink-0 items-center justify-center overflow-hidden rounded-full border",
|
|
19
|
+
r,
|
|
20
|
+
i,
|
|
21
|
+
e
|
|
22
|
+
),
|
|
23
|
+
"data-name": "Chip",
|
|
24
|
+
children: t
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
f as Chip
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=Chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../lib/molecules/Chip.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { getTheme, type Theme } from './Chip.themes';\n\nimport type { Colors } from '@/types/Colors';\n\nexport interface ChipProps extends ComponentPropsWithoutRef<'span'> {\n color?: Colors;\n size?: string;\n theme?: Theme;\n}\n\nexport const Chip = ({\n className,\n color = 'sienna',\n size = 'size-32',\n theme = 'solid',\n children,\n ...attrs\n}: ChipProps) => {\n const { thRoot } = getTheme(theme, { color });\n\n return (\n <span\n {...attrs}\n className={classNames(\n 'inline-flex aspect-square shrink-0 items-center justify-center overflow-hidden rounded-full border',\n size,\n thRoot,\n className,\n )}\n data-name=\"Chip\"\n >\n {children}\n </span>\n );\n};\n"],"names":["Chip","className","color","size","theme","children","attrs","thRoot","getTheme","jsx","classNames"],"mappings":";;;AAaO,MAAMA,IAAO,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,GAAGC;AACL,MAAiB;AACf,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAASJ,GAAO,EAAE,OAAAF,GAAO;AAE5C,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGH;AAAA,MACJ,WAAWI;AAAAA,QACT;AAAA,QACAP;AAAA,QACAI;AAAA,QACAN;AAAA,MAAA;AAAA,MAEF,aAAU;AAAA,MAET,UAAAI;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Colors } from '../types/Colors';
|
|
2
|
+
export type Theme = 'solid' | 'outline' | 'light' | 'dark';
|
|
3
|
+
type Options = {
|
|
4
|
+
color: Colors;
|
|
5
|
+
};
|
|
6
|
+
export declare const themes: (color: Colors) => Record<Theme, {
|
|
7
|
+
thRoot: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getTheme: (theme: Theme, { color }: Options) => {
|
|
10
|
+
thRoot: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { c as e } from "../chunks/index.js";
|
|
2
|
+
import { getBorderColor as r, getTextColor as n, getBgColor as g, getComplementaryTextColor as i } from "../helpers/colors/colors.js";
|
|
3
|
+
const l = (t) => ({
|
|
4
|
+
solid: {
|
|
5
|
+
thRoot: e(g(t), r(t), i(t))
|
|
6
|
+
},
|
|
7
|
+
outline: {
|
|
8
|
+
thRoot: e("bg-transparent", r(t), n(t))
|
|
9
|
+
},
|
|
10
|
+
light: {
|
|
11
|
+
thRoot: e("bg-lightSand text-black border-lightSand")
|
|
12
|
+
},
|
|
13
|
+
dark: {
|
|
14
|
+
thRoot: e("bg-ultramarine text-white border-ultramarine")
|
|
15
|
+
}
|
|
16
|
+
}), h = (t, { color: a }) => {
|
|
17
|
+
const o = l(a);
|
|
18
|
+
return o[t] || o.solid;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
h as getTheme,
|
|
22
|
+
l as themes
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Chip.themes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.themes.js","sources":["../../lib/molecules/Chip.themes.ts"],"sourcesContent":["import classnames from 'classnames';\nimport type { Colors } from '@/types/Colors';\nimport {\n getBgColor,\n getBorderColor,\n getComplementaryTextColor,\n getTextColor,\n} from '@/helpers/colors/colors';\n\nexport type Theme = 'solid' | 'outline' | 'light' | 'dark';\n\ntype Options = { color: Colors };\n\nexport const themes = (color: Colors): Record<Theme, { thRoot: string }> => ({\n solid: {\n thRoot: classnames(getBgColor(color), getBorderColor(color), getComplementaryTextColor(color)),\n },\n outline: {\n thRoot: classnames('bg-transparent', getBorderColor(color), getTextColor(color)),\n },\n light: {\n thRoot: classnames('bg-lightSand text-black border-lightSand'),\n },\n dark: {\n thRoot: classnames('bg-ultramarine text-white border-ultramarine'),\n },\n});\n\nexport const getTheme = (theme: Theme, { color }: Options) => {\n const THEMES = themes(color);\n\n return THEMES[theme] || THEMES.solid;\n};\n"],"names":["themes","color","classnames","getBgColor","getBorderColor","getComplementaryTextColor","getTextColor","getTheme","theme","THEMES"],"mappings":";;AAaO,MAAMA,IAAS,CAACC,OAAsD;AAAA,EAC3E,OAAO;AAAA,IACL,QAAQC,EAAWC,EAAWF,CAAK,GAAGG,EAAeH,CAAK,GAAGI,EAA0BJ,CAAK,CAAC;AAAA,EAAA;AAAA,EAE/F,SAAS;AAAA,IACP,QAAQC,EAAW,kBAAkBE,EAAeH,CAAK,GAAGK,EAAaL,CAAK,CAAC;AAAA,EAAA;AAAA,EAEjF,OAAO;AAAA,IACL,QAAQC,EAAW,0CAA0C;AAAA,EAAA;AAAA,EAE/D,MAAM;AAAA,IACJ,QAAQA,EAAW,8CAA8C;AAAA,EAAA;AAErE,IAEaK,IAAW,CAACC,GAAc,EAAE,OAAAP,QAAqB;AAC5D,QAAMQ,IAAST,EAAOC,CAAK;AAE3B,SAAOQ,EAAOD,CAAK,KAAKC,EAAO;AACjC;"}
|
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* ID is there for accessibility purposes.
|
|
7
|
-
*
|
|
8
|
-
* This is in no way affiliated with Amazon ElasticSearch.
|
|
9
|
-
*/
|
|
10
|
-
interface ElasticHeightProps {
|
|
11
|
-
/**
|
|
12
|
-
* Id of the element
|
|
13
|
-
*/
|
|
14
|
-
id?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Class of the element (please provide something that sets the height)
|
|
17
|
-
*/
|
|
18
|
-
className?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Class of the container (to avoid CLS, mainly)
|
|
21
|
-
*/
|
|
22
|
-
containerClassName?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Role of the element
|
|
25
|
-
*/
|
|
26
|
-
role?: string;
|
|
1
|
+
import { ComponentPropsWithoutRef, FunctionComponent } from 'react';
|
|
2
|
+
interface ElasticHeightProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
innerClassName?: string;
|
|
4
|
+
isExpanded?: boolean;
|
|
5
|
+
min?: number;
|
|
27
6
|
}
|
|
28
|
-
export declare const ElasticHeight: FunctionComponent<
|
|
7
|
+
export declare const ElasticHeight: FunctionComponent<ElasticHeightProps>;
|
|
29
8
|
export {};
|