@clubmed/trident-ui 1.3.0-beta.6 → 1.3.0-beta.7
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/molecules/Breadcrumb.js +8 -9
- package/molecules/Breadcrumb.js.map +1 -1
- package/molecules/Buttons/Button.d.ts +1 -1
- package/molecules/Buttons/Button.js.map +1 -1
- package/molecules/Buttons/ButtonContent.d.ts +1 -1
- package/molecules/Buttons/ButtonContent.js +7 -8
- package/molecules/Buttons/ButtonContent.js.map +1 -1
- package/molecules/Buttons/v2/Button.type.d.ts +1 -1
- package/molecules/Buttons/v2/Button.type.js.map +1 -1
- package/molecules/Card.d.ts +1 -1
- package/molecules/Card.js +7 -8
- package/molecules/Card.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.js +12 -13
- package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
- package/molecules/Forms/DateField.d.ts +1 -1
- package/molecules/Forms/DateField.js +3 -4
- package/molecules/Forms/DateField.js.map +1 -1
- package/molecules/Forms/Filter.js +12 -13
- package/molecules/Forms/Filter.js.map +1 -1
- package/molecules/Forms/FormControl.js +15 -16
- package/molecules/Forms/FormControl.js.map +1 -1
- package/molecules/Forms/Password/Password.js +10 -11
- package/molecules/Forms/Password/Password.js.map +1 -1
- package/molecules/Forms/Password/ValidationMessage.js +8 -9
- package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
- package/molecules/Forms/Select.d.ts +1 -1
- package/molecules/Forms/Select.js +3 -4
- package/molecules/Forms/Select.js.map +1 -1
- package/molecules/Forms/TextField.d.ts +1 -1
- package/molecules/Forms/TextField.js +7 -8
- package/molecules/Forms/TextField.js.map +1 -1
- package/molecules/Link.d.ts +1 -1
- package/molecules/Link.js +8 -9
- package/molecules/Link.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# ClubMed React UI components changelog
|
|
2
2
|
|
|
3
|
+
# [1.3.0-beta.7](https://scm.clubmed.com/clubmed/ui/trident-ui/compare/v1.3.0-beta.6...v1.3.0-beta.7) (2025-08-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **icons:** migrate icon imports to @clubmed/trident-icons package ([cc803d8](https://scm.clubmed.com/clubmed/ui/trident-ui/-/commit/cc803d87cbad892df50093167fc25fc7c1a229bb))
|
|
9
|
+
|
|
3
10
|
# [1.3.0-beta.6](https://scm.clubmed.com/clubmed/ui/trident-ui/compare/v1.3.0-beta.5...v1.3.0-beta.6) (2025-08-04)
|
|
4
11
|
|
|
5
12
|
|
package/molecules/Breadcrumb.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import { c as w } from "../chunks/index.js";
|
|
3
|
-
import { Icon as B } from "
|
|
4
|
-
import "@clubmed/trident-icons";
|
|
3
|
+
import { Icon as B } from "@clubmed/trident-icons";
|
|
5
4
|
const E = {
|
|
6
5
|
light: {
|
|
7
6
|
thStart: "text-middleGrey",
|
|
@@ -11,14 +10,14 @@ const E = {
|
|
|
11
10
|
thStart: "text-white",
|
|
12
11
|
thEnd: "text-white font-bold"
|
|
13
12
|
}
|
|
14
|
-
},
|
|
15
|
-
className:
|
|
13
|
+
}, I = ({
|
|
14
|
+
className: l,
|
|
16
15
|
items: n,
|
|
17
|
-
theme:
|
|
18
|
-
component:
|
|
16
|
+
theme: o = "light",
|
|
17
|
+
component: h = "a"
|
|
19
18
|
}) => {
|
|
20
|
-
const [
|
|
21
|
-
return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", className:
|
|
19
|
+
const [i, m, , ...r] = n, d = r.length ? r[r.length - 1] : n[n.length - 1], x = { label: "...", href: "" }, s = r.length ? [i, m, x, d] : n, { thStart: p, thEnd: f } = E[o], g = h;
|
|
20
|
+
return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", className: l, children: /* @__PURE__ */ e("ul", { className: "flex items-center", children: s.map(({ label: a, href: c }, b) => {
|
|
22
21
|
const t = b === s.length - 1, u = c && !t;
|
|
23
22
|
return /* @__PURE__ */ k(
|
|
24
23
|
"li",
|
|
@@ -38,6 +37,6 @@ const E = {
|
|
|
38
37
|
}) }) });
|
|
39
38
|
};
|
|
40
39
|
export {
|
|
41
|
-
|
|
40
|
+
I as Breadcrumb
|
|
42
41
|
};
|
|
43
42
|
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport type { FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon } from '
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport type { FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon } from '@clubmed/trident-icons';\n\nexport interface BreadcrumbProps {\n className?: string;\n items: {\n label: string;\n href: string;\n }[];\n theme?: 'dark' | 'light';\n /**\n * Allow giving a custom component\n */\n component?: FunctionComponent<PropsWithChildren<any>> | string;\n}\n\nconst themes = {\n light: {\n thStart: 'text-middleGrey',\n thEnd: 'text-black font-bold',\n },\n dark: {\n thStart: 'text-white',\n thEnd: 'text-white font-bold',\n },\n};\n\nexport const Breadcrumb: FunctionComponent<BreadcrumbProps> = ({\n className,\n items,\n theme = 'light',\n component = 'a',\n}) => {\n const [first, second, , ...rest] = items;\n const lastItem = rest.length ? rest[rest.length - 1] : items[items.length - 1];\n const spacer = { label: '...', href: '' };\n const itemsToRender = !rest.length ? items : [first, second, spacer, lastItem];\n const { thStart, thEnd } = themes[theme];\n const Cmp = component as FunctionComponent<PropsWithChildren<{ href: string }>>;\n\n return (\n <nav data-name=\"Breadcrumb\" aria-label=\"Breadcrumb\" className={className}>\n <ul className=\"flex items-center\">\n {itemsToRender.map(({ label, href }, index) => {\n const isLast = index === itemsToRender.length - 1;\n const isLink = href && !isLast;\n return (\n <li\n key={label}\n className={classnames('text-b4 flex items-center', {\n [thStart]: !isLast,\n [thEnd]: isLast,\n })}\n {...(isLast && { 'aria-current': 'page' })}\n >\n <span>{isLink ? <Cmp href={href}>{label}</Cmp> : label}</span>\n {!isLast && <Icon name=\"Diamond\" width=\"14px\" className=\"mx-4\" />}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n};\n"],"names":["themes","Breadcrumb","className","items","theme","component","first","second","rest","lastItem","spacer","itemsToRender","thStart","thEnd","Cmp","jsx","label","href","index","isLast","isLink","jsxs","classnames","Icon"],"mappings":";;;AAmBA,MAAMA,IAAS;AAAA,EACb,OAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAAA,EAET,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAEX,GAEaC,IAAiD,CAAC;AAAA,EAC7D,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAC,IAAY;AACd,MAAM;AACJ,QAAM,CAACC,GAAOC,KAAU,GAAGC,CAAI,IAAIL,GAC7BM,IAAWD,EAAK,SAASA,EAAKA,EAAK,SAAS,CAAC,IAAIL,EAAMA,EAAM,SAAS,CAAC,GACvEO,IAAS,EAAE,OAAO,OAAO,MAAM,GAAA,GAC/BC,IAAiBH,EAAK,SAAiB,CAACF,GAAOC,GAAQG,GAAQD,CAAQ,IAAxCN,GAC/B,EAAE,SAAAS,GAAS,OAAAC,MAAUb,EAAOI,CAAK,GACjCU,IAAMT;AAEZ,2BACG,OAAA,EAAI,aAAU,cAAa,cAAW,cAAa,WAAAH,GAClD,UAAA,gBAAAa,EAAC,MAAA,EAAG,WAAU,qBACX,YAAc,IAAI,CAAC,EAAE,OAAAC,GAAO,MAAAC,EAAA,GAAQC,MAAU;AAC7C,UAAMC,IAASD,MAAUP,EAAc,SAAS,GAC1CS,IAASH,KAAQ,CAACE;AACxB,WACE,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWC,EAAW,6BAA6B;AAAA,UACjD,CAACV,CAAO,GAAG,CAACO;AAAA,UACZ,CAACN,CAAK,GAAGM;AAAA,QAAA,CACV;AAAA,QACA,GAAIA,KAAU,EAAE,gBAAgB,OAAA;AAAA,QAEjC,UAAA;AAAA,UAAA,gBAAAJ,EAAC,UAAM,UAAAK,IAAS,gBAAAL,EAACD,KAAI,MAAAG,GAAa,UAAAD,GAAM,IAASA,EAAA,CAAM;AAAA,UACtD,CAACG,KAAU,gBAAAJ,EAACQ,GAAA,EAAK,MAAK,WAAU,OAAM,QAAO,WAAU,OAAA,CAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAR1DP;AAAA,IAAA;AAAA,EAWX,CAAC,GACH,GACF;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes, type FunctionComponent, type ReactNode } from 'react';
|
|
2
|
-
import type { IconicNames, IconicTypes } from '../../atoms/Icons/index.js';
|
|
3
2
|
import { type ButtonProps as ButtonPropsV2 } from './v2/Button.js';
|
|
3
|
+
import type { IconicNames, IconicTypes } from '@clubmed/trident-icons';
|
|
4
4
|
export declare const BUTTON_THEME_LEGACY: any;
|
|
5
5
|
export declare const BUTTON_VARIANT_LEGACY: any;
|
|
6
6
|
export type ButtonPropsLegacy = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../lib/molecules/Buttons/Button.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, type FunctionComponent, type ReactNode } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../lib/molecules/Buttons/Button.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, type FunctionComponent, type ReactNode } from 'react';\nimport { Button as ButtonV2, type ButtonProps as ButtonPropsV2 } from './v2/Button.js';\nimport type { IconicNames, IconicTypes } from '@clubmed/trident-icons';\n\nexport const BUTTON_THEME_LEGACY: any = {\n white: {\n color: 'white',\n theme: 'solid',\n },\n black: {\n color: 'black',\n theme: 'solid',\n },\n yellow: {\n color: 'saffron',\n theme: 'solid',\n },\n whiteStroke: {\n color: 'white',\n theme: 'outline',\n },\n blackStroke: {\n color: 'black',\n theme: 'outline',\n },\n};\n\nexport const BUTTON_VARIANT_LEGACY: any = {\n textSmall: {\n size: 'small',\n variant: undefined,\n },\n icon: {\n variant: 'circle',\n label: undefined,\n },\n arrow: {\n variant: 'circle',\n label: undefined,\n size: 'large',\n },\n};\n\nexport type ButtonPropsLegacy = {\n /**\n * Button themes defining background color and text/icon color\n */\n theme?: 'yellow' | 'white' | 'black' | 'whiteStroke' | 'blackStroke' | ButtonPropsV2['theme'];\n /**\n * Is it a text button? An icon button? An arrow button?\n */\n variant?: 'text' | 'textSmall' | 'icon' | 'arrow' | 'monogram' | ButtonPropsV2['variant'];\n /**\n * Background Color override\n * Ideally please use ONLY for the \"white\" and \"black\" themes\n * @deprecated\n */\n backgroundOverride?: string;\n /**\n * Button contents\n * @deprecated\n */\n label?: string;\n /**\n * Optional children (you might never use this, please actually try to avoid it)\n */\n children?: ReactNode;\n /**\n * Optional icon name\n */\n icon?: IconicNames;\n /**\n * Force the icon type to be svg, font or default\n */\n iconType?: IconicTypes;\n /**\n * Group name\n * Used to group buttons together (you might not need this)\n * @deprecated\n */\n groupName?: string;\n};\n\nexport type CommonButtonProps = Omit<ButtonPropsV2, 'theme' | 'variant'> & ButtonPropsLegacy;\n\ntype ButtonProps = CommonButtonProps & ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Button: FunctionComponent<ButtonProps> = (props: ButtonProps) => {\n const opts = {\n ...props,\n ...(BUTTON_THEME_LEGACY[props.theme!] || {}),\n ...(BUTTON_VARIANT_LEGACY[props.variant!] || {}),\n };\n\n return (\n <ButtonV2 {...opts}>\n {opts.label}\n {props.children}\n </ButtonV2>\n );\n};\n"],"names":["BUTTON_THEME_LEGACY","BUTTON_VARIANT_LEGACY","Button","props","opts","jsxs","ButtonV2"],"mappings":";;;AAIO,MAAMA,IAA2B;AAAA,EACtC,OAAO;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,OAAO;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,aAAa;AAAA,IACX,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,aAAa;AAAA,IACX,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX,GAEaC,IAA6B;AAAA,EACxC,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAAA,EAET,OAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAEV,GA8CaC,IAAyC,CAACC,MAAuB;AAC5E,QAAMC,IAAO;AAAA,IACX,GAAGD;AAAA,IACH,GAAIH,EAAoBG,EAAM,KAAM,KAAK,CAAA;AAAA,IACzC,GAAIF,EAAsBE,EAAM,OAAQ,KAAK,CAAA;AAAA,EAAC;AAGhD,SACE,gBAAAE,EAACC,GAAA,EAAU,GAAGF,GACX,UAAA;AAAA,IAAAA,EAAK;AAAA,IACLD,EAAM;AAAA,EAAA,GACT;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FunctionComponent, ReactNode } from 'react';
|
|
2
|
-
import { type IconicNames, type IconicTypes } from '
|
|
2
|
+
import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
|
|
3
3
|
export type ButtonContentProps = {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { jsxs as p, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { Icon as c } from "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
showLabel: r,
|
|
2
|
+
import { Icon as c } from "@clubmed/trident-icons";
|
|
3
|
+
const x = ({
|
|
4
|
+
showLabel: s,
|
|
6
5
|
label: t,
|
|
7
|
-
children:
|
|
6
|
+
children: r,
|
|
8
7
|
icon: e,
|
|
9
8
|
iconType: o,
|
|
10
9
|
iconWidth: m
|
|
11
10
|
}) => /* @__PURE__ */ p("span", { className: "flex items-center justify-center gap-x-8 w-full", children: [
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
s ? t : t && /* @__PURE__ */ n("span", { className: "sr-only", children: t }),
|
|
12
|
+
r,
|
|
14
13
|
e && /* @__PURE__ */ n(c, { name: e, width: m ?? "24px", type: o })
|
|
15
14
|
] });
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
x as ButtonContent
|
|
18
17
|
};
|
|
19
18
|
//# sourceMappingURL=ButtonContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonContent.js","sources":["../../../lib/molecules/Buttons/ButtonContent.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '
|
|
1
|
+
{"version":3,"file":"ButtonContent.js","sources":["../../../lib/molecules/Buttons/ButtonContent.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\n\nexport type ButtonContentProps = {\n /**\n * @deprecated\n */\n showLabel?: boolean;\n /**\n * @deprecated\n */\n label?: string;\n children?: ReactNode;\n icon?: IconicNames;\n iconType?: IconicTypes;\n iconWidth?: string;\n};\n\nexport const ButtonContent: FunctionComponent<ButtonContentProps> = ({\n showLabel,\n label,\n children,\n icon,\n iconType,\n iconWidth,\n}) => {\n return (\n <span className=\"flex items-center justify-center gap-x-8 w-full\">\n {showLabel ? label : label && <span className=\"sr-only\">{label}</span>}\n {children}\n {icon && <Icon name={icon} width={iconWidth ?? '24px'} type={iconType} />}\n </span>\n );\n};\n"],"names":["ButtonContent","showLabel","label","children","icon","iconType","iconWidth","jsxs","jsx","Icon"],"mappings":";;AAmBO,MAAMA,IAAuD,CAAC;AAAA,EACnE,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,MAEI,gBAAAC,EAAC,QAAA,EAAK,WAAU,mDACb,UAAA;AAAA,EAAAN,IAAYC,IAAQA,KAAS,gBAAAM,EAAC,QAAA,EAAK,WAAU,WAAW,UAAAN,GAAM;AAAA,EAC9DC;AAAA,EACAC,uBAASK,GAAA,EAAK,MAAML,GAAM,OAAOE,KAAa,QAAQ,MAAMD,EAAA,CAAU;AAAA,GACzE;"}
|
|
@@ -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 { Colors } from '@/types/Colors';\nimport type { IconicNames, IconicTypes } from '
|
|
1
|
+
{"version":3,"file":"Button.type.js","sources":["../../../../lib/molecules/Buttons/v2/Button.type.ts"],"sourcesContent":["import classnames from 'classnames';\n\nimport type { Colors } from '@/types/Colors';\nimport type { IconicNames, IconicTypes } from '@clubmed/trident-icons';\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} as const satisfies Record<string, `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;AACT,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,5 +1,5 @@
|
|
|
1
1
|
import type { FunctionComponent, PropsWithChildren } from 'react';
|
|
2
|
-
import { type IconicNames, type IconicTypes } from '
|
|
2
|
+
import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
|
|
3
3
|
interface CardProps {
|
|
4
4
|
title: string;
|
|
5
5
|
icon: IconicNames;
|
package/molecules/Card.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { c as d } from "../chunks/index.js";
|
|
3
|
-
import { Icon as o } from "
|
|
4
|
-
|
|
5
|
-
const x = ({
|
|
3
|
+
import { Icon as o } from "@clubmed/trident-icons";
|
|
4
|
+
const f = ({
|
|
6
5
|
title: a,
|
|
7
|
-
children:
|
|
8
|
-
icon:
|
|
6
|
+
children: s,
|
|
7
|
+
icon: i,
|
|
9
8
|
iconType: l,
|
|
10
9
|
theme: r = "light",
|
|
11
10
|
dataName: n = "Card"
|
|
@@ -22,17 +21,17 @@ const x = ({
|
|
|
22
21
|
"bg-ultramarine text-white": r === "dark",
|
|
23
22
|
"bg-lightSand text-black": r === "light"
|
|
24
23
|
}),
|
|
25
|
-
children: /* @__PURE__ */ e(o, { name:
|
|
24
|
+
children: /* @__PURE__ */ e(o, { name: i, type: l, width: "24px" })
|
|
26
25
|
}
|
|
27
26
|
),
|
|
28
27
|
/* @__PURE__ */ t("div", { className: "space-y-8 font-sans", children: [
|
|
29
28
|
/* @__PURE__ */ e("div", { className: "text-b3 font-semibold", children: a }),
|
|
30
|
-
/* @__PURE__ */ e("div", { className: "text-b4 font-normal", children:
|
|
29
|
+
/* @__PURE__ */ e("div", { className: "text-b4 font-normal", children: s })
|
|
31
30
|
] })
|
|
32
31
|
]
|
|
33
32
|
}
|
|
34
33
|
);
|
|
35
34
|
export {
|
|
36
|
-
|
|
35
|
+
f as Card
|
|
37
36
|
};
|
|
38
37
|
//# sourceMappingURL=Card.js.map
|
package/molecules/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../lib/molecules/Card.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../lib/molecules/Card.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\n\ninterface CardProps {\n title: string;\n icon: IconicNames;\n iconType?: IconicTypes;\n theme?: 'light' | 'dark';\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 <div\n className=\"border-lightGrey rounded-16 flex shrink-0 flex-row gap-20 border bg-white p-20\"\n data-name={dataName}\n >\n <div\n className={classnames('flex h-48 w-48 shrink-0 items-center justify-center rounded-full', {\n 'bg-ultramarine text-white': theme === 'dark',\n 'bg-lightSand text-black': theme === 'light',\n })}\n >\n <Icon name={icon} type={iconType} width=\"24px\" />\n </div>\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 </div>\n );\n};\n"],"names":["Card","title","children","icon","iconType","theme","dataName","jsxs","jsx","classnames","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;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,aAAWD;AAAA,IAEX,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWC,EAAW,oEAAoE;AAAA,YACxF,6BAA6BJ,MAAU;AAAA,YACvC,2BAA2BA,MAAU;AAAA,UAAA,CACtC;AAAA,UAED,4BAACK,GAAA,EAAK,MAAMP,GAAM,MAAMC,GAAU,OAAM,OAAA,CAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAEjD,gBAAAG,EAAC,OAAA,EAAI,WAAU,uBACb,UAAA;AAAA,QAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,yBAAyB,UAAAP,GAAM;AAAA,QAC9C,gBAAAO,EAAC,OAAA,EAAI,WAAU,uBAAuB,UAAAN,EAAA,CAAS;AAAA,MAAA,EAAA,CACjD;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "../../../chunks/index.js";
|
|
2
|
+
import { c as o } from "../../../chunks/index.js";
|
|
3
3
|
import { useId as D } from "react";
|
|
4
|
-
import { Icon as h } from "../../../atoms/Icons/Icon.js";
|
|
5
|
-
import "@clubmed/trident-icons";
|
|
6
4
|
import { useValue as S } from "../../../hooks/useValue.js";
|
|
7
5
|
/* empty css */
|
|
8
6
|
import { useInternalStatus as V } from "../../../hooks/useInternalStatus.js";
|
|
9
|
-
|
|
7
|
+
import { Icon as p } from "@clubmed/trident-icons";
|
|
8
|
+
function A(u) {
|
|
10
9
|
const x = D(), {
|
|
11
10
|
id: s = x,
|
|
12
11
|
name: n = s,
|
|
@@ -20,13 +19,13 @@ function B(u) {
|
|
|
20
19
|
validationStatus: N = "default",
|
|
21
20
|
errorMessage: d,
|
|
22
21
|
children: g,
|
|
23
|
-
onChange:
|
|
22
|
+
onChange: c,
|
|
24
23
|
...y
|
|
25
24
|
} = u, { value: m, setValue: I } = S({
|
|
26
25
|
name: n,
|
|
27
26
|
initialValue: k,
|
|
28
|
-
onChange(w,
|
|
29
|
-
|
|
27
|
+
onChange(w, h) {
|
|
28
|
+
c == null || c(w, h ? l !== void 0 ? l : h : null);
|
|
30
29
|
}
|
|
31
30
|
}), e = V({
|
|
32
31
|
isDisabled: r,
|
|
@@ -35,13 +34,13 @@ function B(u) {
|
|
|
35
34
|
return /* @__PURE__ */ t(
|
|
36
35
|
"div",
|
|
37
36
|
{
|
|
38
|
-
className:
|
|
37
|
+
className: o("flex flex-col space-y-2", f),
|
|
39
38
|
"data-testid": `checkbox-container-${s}`,
|
|
40
39
|
children: [
|
|
41
40
|
/* @__PURE__ */ t(
|
|
42
41
|
"label",
|
|
43
42
|
{
|
|
44
|
-
className:
|
|
43
|
+
className: o("cursor-pointer relative flex text-b3 items-center", {
|
|
45
44
|
"text-grey": e === "disabled",
|
|
46
45
|
"text-black": e !== "default"
|
|
47
46
|
}),
|
|
@@ -68,10 +67,10 @@ function B(u) {
|
|
|
68
67
|
"span",
|
|
69
68
|
{
|
|
70
69
|
style: { height: i, width: i },
|
|
71
|
-
className:
|
|
70
|
+
className: o({ "!border-red": e === "error" }),
|
|
72
71
|
"data-testid": `check-container-${s}`,
|
|
73
72
|
children: /* @__PURE__ */ a(
|
|
74
|
-
|
|
73
|
+
p,
|
|
75
74
|
{
|
|
76
75
|
name: "CheckDefault",
|
|
77
76
|
type: "svg",
|
|
@@ -88,7 +87,7 @@ function B(u) {
|
|
|
88
87
|
}
|
|
89
88
|
),
|
|
90
89
|
C && /* @__PURE__ */ t("span", { className: "text-red text-b4 flex items-start space-x-4 ps-20", role: "alert", children: [
|
|
91
|
-
/* @__PURE__ */ a(
|
|
90
|
+
/* @__PURE__ */ a(p, { name: "Error", width: "20px" }),
|
|
92
91
|
d
|
|
93
92
|
] })
|
|
94
93
|
]
|
|
@@ -96,6 +95,6 @@ function B(u) {
|
|
|
96
95
|
);
|
|
97
96
|
}
|
|
98
97
|
export {
|
|
99
|
-
|
|
98
|
+
A as Checkbox
|
|
100
99
|
};
|
|
101
100
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../../lib/molecules/Forms/Checkboxes/Checkbox.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useId } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../../lib/molecules/Forms/Checkboxes/Checkbox.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useId } from 'react';\nimport { useValue } from '@/hooks/useValue.js';\nimport '../controls.css';\nimport type { FormControlProps } from '@/molecules/Forms/FormControl';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { Icon } from '@clubmed/trident-icons';\n\nexport interface CheckboxProps<Value = string> extends FormControlProps<Value> {\n size?: number;\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Checkbox<Value = string>(props: CheckboxProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled = false,\n checked: initialChecked = false,\n value,\n size = 24,\n tabIndex = 0,\n validationStatus = 'default',\n errorMessage,\n children,\n onChange,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col space-y-2', className)}\n data-testid={`checkbox-container-${id}`}\n >\n <label\n className={classnames('cursor-pointer relative flex text-b3 items-center', {\n 'text-grey': internalStatus === 'disabled',\n 'text-black': internalStatus !== 'default',\n })}\n >\n <span className=\"relative self-start me-8\">\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Checkbox\"\n disabled={disabled}\n value={value as any}\n />\n\n <span\n style={{ height: size, width: size }}\n className={classnames({ '!border-red': internalStatus === 'error' })}\n data-testid={`check-container-${id}`}\n >\n <Icon\n name=\"CheckDefault\"\n type=\"svg\"\n width={`${size}px`}\n color=\"black\"\n className=\"absolute\"\n />\n </span>\n </span>\n\n {children}\n </label>\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start space-x-4 ps-20\" role=\"alert\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n}\n"],"names":["Checkbox","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","size","tabIndex","validationStatus","errorMessage","children","onChange","rest","checked","setValue","useValue","internalStatus","useInternalStatus","shouldDisplayErrorMessage","jsxs","classnames","jsx","Icon"],"mappings":";;;;;;;AAaO,SAASA,EAAyBC,GA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d,uBAACJ,KAAYW,EAAS,CAACD,CAAO;AAAA,oBAChC;AAAA,oBACA,SAAAA;AAAA,oBACA,aAAU;AAAA,oBACV,UAAAV;AAAA,oBACA,OAAAE;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGF,gBAAAgB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,OAAO,EAAE,QAAQf,GAAM,OAAOA,EAAA;AAAA,oBAC9B,WAAWc,EAAW,EAAE,eAAeJ,MAAmB,SAAS;AAAA,oBACnE,eAAa,mBAAmBjB,CAAE;AAAA,oBAElC,UAAA,gBAAAsB;AAAA,sBAACC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,MAAK;AAAA,wBACL,OAAO,GAAGhB,CAAI;AAAA,wBACd,OAAM;AAAA,wBACN,WAAU;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACZ;AAAA,gBAAA;AAAA,cACF,GACF;AAAA,cAECI;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGFQ,KACC,gBAAAC,EAAC,QAAA,EAAK,WAAU,qDAAoD,MAAK,SACvE,UAAA;AAAA,UAAA,gBAAAE,EAACC,GAAA,EAAK,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/Bb;AAAA,QAAA,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IconicNames, type IconicTypes } from '
|
|
1
|
+
import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
|
|
2
2
|
import { type FormControlProps } from './FormControl.js';
|
|
3
3
|
interface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {
|
|
4
4
|
description?: string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as p, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import { c as q } from "../../chunks/index.js";
|
|
3
3
|
import { useId as A, useRef as B, useState as H, useCallback as L, useEffect as J } from "react";
|
|
4
|
-
import { Icon as E } from "
|
|
5
|
-
import "@clubmed/trident-icons";
|
|
4
|
+
import { Icon as E } from "@clubmed/trident-icons";
|
|
6
5
|
import { useValue as K } from "../../hooks/useValue.js";
|
|
7
6
|
import { useInternalStatus as Q } from "../../hooks/useInternalStatus.js";
|
|
8
7
|
import { FormControl as U } from "./FormControl.js";
|
|
@@ -64,7 +63,7 @@ const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e,
|
|
|
64
63
|
return !0;
|
|
65
64
|
const r = (i) => new Date(i.getFullYear(), i.getMonth(), i.getDate()), a = new Date(t), l = r(a);
|
|
66
65
|
return !(e && l < r(e) || n && l > r(n));
|
|
67
|
-
},
|
|
66
|
+
}, se = (t) => {
|
|
68
67
|
const e = A(), {
|
|
69
68
|
id: n = e,
|
|
70
69
|
name: r = n,
|
|
@@ -185,6 +184,6 @@ const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e,
|
|
|
185
184
|
);
|
|
186
185
|
};
|
|
187
186
|
export {
|
|
188
|
-
|
|
187
|
+
se as DateField
|
|
189
188
|
};
|
|
190
189
|
//# sourceMappingURL=DateField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","sources":["../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../../node_modules/date-fns/esm/toDate/index.js","../../../node_modules/date-fns/esm/differenceInMilliseconds/index.js","../../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/esm/formatISO/index.js","../../../lib/molecules/Forms/DateField.tsx"],"sourcesContent":["export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return sign + output;\n}","import toDate from \"../toDate/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with local time zone, or both.\n * @returns {String} the formatted date string (in local time zone)\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport default function formatISO(date, options) {\n var _options$format, _options$representati;\n requiredArgs(1, arguments);\n var originalDate = toDate(date);\n if (isNaN(originalDate.getTime())) {\n throw new RangeError('Invalid time value');\n }\n var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended');\n var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete');\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n var result = '';\n var tzOffset = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : '';\n\n // Representation is either 'date' or 'complete'\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== 'date') {\n // Add the timezone.\n var offset = originalDate.getTimezoneOffset();\n if (offset !== 0) {\n var absoluteOffset = Math.abs(offset);\n var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n var sign = offset < 0 ? '+' : '-';\n tzOffset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n tzOffset = 'Z';\n }\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n var separator = result === '' ? '' : 'T';\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n var time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = \"\".concat(result).concat(separator).concat(time).concat(tzOffset);\n }\n return result;\n}","import classnames from 'classnames';\nimport { differenceInMilliseconds, formatISO } from 'date-fns';\nimport { type ChangeEvent, useCallback, useEffect, useId, useRef, useState } from 'react';\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { useInternalStatus } from '@/hooks/useInternalStatus.js';\nimport { FormControl, type FormControlProps } from './FormControl.js';\n\ninterface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {\n description?: string;\n /**\n * Open datepicker text\n */\n openDatepicker?: string;\n id?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n /**\n * Minimum Date allowed\n */\n min?: Date | undefined;\n /**\n * Maximum Date allowed\n */\n max?: Date | undefined;\n}\n\nconst formatDate = (value: Date | number | undefined | null): string => {\n if (!value) {\n return '';\n }\n\n return formatISO(new Date(value), { representation: 'date' });\n};\n\nconst validateDateRange = (date: string, min?: Date, max?: Date): boolean => {\n if (!date) {\n return true;\n }\n\n const normalizeDate = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());\n const inputDate = new Date(date);\n const normalizedInputDate = normalizeDate(inputDate);\n\n if (min && normalizedInputDate < normalizeDate(min)) {\n return false;\n }\n if (max && normalizedInputDate > normalizeDate(max)) {\n return false;\n }\n\n return true;\n};\n\nexport const DateField = (props: DateFieldProps) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n description,\n openDatepicker,\n validationStatus = 'default',\n icon = 'CalendarDefault',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n dataTestId = 'DateField',\n value: initialValue,\n min: initialMin,\n max: initialMax,\n onChange,\n ...rest\n } = props;\n\n // NO LOGIC IS IMPLEMENTED YET HERE\n // THIS IS A VISUAL COMPONENT ONLY\n const ref = useRef<HTMLInputElement>(null);\n const [isFocused, setIsFocused] = useState<boolean>(false);\n\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { setValue, value } = useValue<string, Date | number | undefined | null>({\n name,\n formatter: formatDate as never,\n initialValue,\n onChange: (name, value) => onChange?.(name, new Date(value)),\n });\n\n const min = formatDate(initialMin);\n const max = formatDate(initialMax);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value);\n };\n\n const handleClickPicker = () => {\n ref.current?.showPicker();\n };\n\n const handleOutOfRangeDate = useCallback(() => {\n const currentDate = new Date(value);\n\n if (initialMin && initialMax) {\n const distanceToMin = Math.abs(differenceInMilliseconds(currentDate, initialMin));\n const distanceToMax = Math.abs(differenceInMilliseconds(currentDate, initialMax));\n setValue(distanceToMin <= distanceToMax ? min : max);\n return;\n }\n\n if (initialMin) {\n setValue(min);\n return;\n }\n\n if (initialMax) {\n setValue(max);\n return;\n }\n }, [initialMax, initialMin, max, min, setValue, value]);\n\n useEffect(() => {\n const isValid = validateDateRange(value, initialMin, initialMax);\n if (!isValid && !isFocused) {\n handleOutOfRangeDate();\n }\n }, [handleOutOfRangeDate, initialMax, initialMin, isFocused, value]);\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n dataName=\"DateField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n type=\"date\"\n className={classnames(\n 'text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-pearl text-grey': disabled,\n 'bg-white text-black': !disabled,\n 'border-red': !disabled && internalStatus === 'error',\n 'border-green': !disabled && internalStatus === 'success',\n },\n )}\n id={id}\n disabled={disabled}\n required={required}\n ref={ref}\n value={value}\n min={min}\n max={max}\n onChange={handleChange}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n />\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': disabled,\n 'text-red': !disabled && internalStatus === 'error',\n 'text-green': !disabled && internalStatus === 'success',\n },\n )}\n >\n <button className=\"pointer-events-auto leading-none\" onClick={handleClickPicker}>\n <Icon name={icon} iconType={iconType} width=\"24px\" />\n <span className=\"sr-only\">\n {openDatepicker}\n {/* REPLACE THAT WITH SOMETHING LIKE \"OPEN DATEPICKER\" SOONER RATHER THAN LATER PLZ */}\n </span>\n </button>\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && <Icon name=\"CrossDefault\" width=\"24px\" />}\n {internalStatus === 'success' && <Icon name=\"CheckDefault\" width=\"24px\" />}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["_typeof","o","requiredArgs","required","args","toDate","argument","argStr","differenceInMilliseconds","dateLeft","dateRight","addLeadingZeros","number","targetLength","sign","output","formatISO","date","options","_options$format","_options$representati","originalDate","format","representation","result","tzOffset","dateDelimiter","timeDelimiter","day","month","year","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","formatDate","value","validateDateRange","min","max","normalizeDate","d","inputDate","normalizedInputDate","DateField","props","internalId","useId","id","name","label","description","openDatepicker","validationStatus","icon","iconType","errorMessage","disabled","hideRequiredStar","dataTestId","initialValue","initialMin","initialMax","onChange","rest","ref","useRef","isFocused","setIsFocused","useState","internalStatus","useInternalStatus","setValue","useValue","handleChange","event","handleClickPicker","_a","handleOutOfRangeDate","useCallback","currentDate","distanceToMin","distanceToMax","useEffect","jsx","FormControl","jsxs","classnames","Icon"],"mappings":";;;;;;;;AAAe,SAASA,EAAQC,GAAG;AACjC;AAEA,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAChG,WAAO,OAAOA;AAAA,EAChB,IAAI,SAAUA,GAAG;AACf,WAAOA,KAAmB,OAAO,UAArB,cAA+BA,EAAE,gBAAgB,UAAUA,MAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EACpH,GAAGD,EAAQC,CAAC;AACd;ACRe,SAASC,EAAaC,GAAUC,GAAM;AACnD,MAAIA,EAAK,SAASD;AAChB,UAAM,IAAI,UAAUA,IAAW,eAAeA,IAAW,IAAI,MAAM,MAAM,yBAAyBC,EAAK,SAAS,UAAU;AAE9H;AC4Be,SAASC,EAAOC,GAAU;AACvC,EAAAJ,EAAa,GAAG,SAAS;AACzB,MAAIK,IAAS,OAAO,UAAU,SAAS,KAAKD,CAAQ;AAGpD,SAAIA,aAAoB,QAAQN,EAAQM,CAAQ,MAAM,YAAYC,MAAW,kBAEpE,IAAI,KAAKD,EAAS,SAAS,IACzB,OAAOA,KAAa,YAAYC,MAAW,oBAC7C,IAAI,KAAKD,CAAQ,MAEnB,OAAOA,KAAa,YAAYC,MAAW,sBAAsB,OAAO,UAAY,QAEvF,QAAQ,KAAK,oNAAoN,GAEjO,QAAQ,KAAK,IAAI,MAAK,EAAG,KAAK,IAEzB,oBAAI,KAAK,GAAG;AAEvB;AC3Be,SAASC,EAAyBC,GAAUC,GAAW;AACpE,SAAAR,EAAa,GAAG,SAAS,GAClBG,EAAOI,CAAQ,EAAE,QAA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AAS,MAAMN,EAAa,EAAI;AAAA,YAChC,QAAQ,MAAMA,EAAa,EAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAElC,gBAAAkB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,aAAa9B;AAAA,gBACb,YAAY,CAACA,KAAYa,MAAmB;AAAA,gBAC5C,cAAc,CAACb,KAAYa,MAAmB;AAAA,cAAA;AAAA,YAChD;AAAA,YAGF,UAAA;AAAA,cAAA,gBAAAgB,EAAC,UAAA,EAAO,WAAU,oCAAmC,SAASV,GAC5D,UAAA;AAAA,gBAAA,gBAAAQ,EAACI,GAAA,EAAK,MAAMlC,GAAM,UAAAC,GAAoB,OAAM,QAAO;AAAA,gBACnD,gBAAA6B,EAAC,QAAA,EAAK,WAAU,WACb,UAAAhC,EAAA,CAEH;AAAA,cAAA,GACF;AAAA,cACA,gBAAAkC,EAAC,QAAA,EAAK,WAAU,wBACb,UAAA;AAAA,gBAAAhB,MAAmB,WAAW,gBAAAc,EAACI,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,gBACrElB,MAAmB,aAAa,gBAAAc,EAACI,KAAK,MAAK,gBAAe,OAAM,OAAA,CAAO;AAAA,cAAA,EAAA,CAC1E;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4,5]}
|
|
1
|
+
{"version":3,"file":"DateField.js","sources":["../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../../node_modules/date-fns/esm/toDate/index.js","../../../node_modules/date-fns/esm/differenceInMilliseconds/index.js","../../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/esm/formatISO/index.js","../../../lib/molecules/Forms/DateField.tsx"],"sourcesContent":["export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return sign + output;\n}","import toDate from \"../toDate/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with local time zone, or both.\n * @returns {String} the formatted date string (in local time zone)\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport default function formatISO(date, options) {\n var _options$format, _options$representati;\n requiredArgs(1, arguments);\n var originalDate = toDate(date);\n if (isNaN(originalDate.getTime())) {\n throw new RangeError('Invalid time value');\n }\n var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended');\n var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete');\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n var result = '';\n var tzOffset = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : '';\n\n // Representation is either 'date' or 'complete'\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== 'date') {\n // Add the timezone.\n var offset = originalDate.getTimezoneOffset();\n if (offset !== 0) {\n var absoluteOffset = Math.abs(offset);\n var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n var sign = offset < 0 ? '+' : '-';\n tzOffset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n tzOffset = 'Z';\n }\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n var separator = result === '' ? '' : 'T';\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n var time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = \"\".concat(result).concat(separator).concat(time).concat(tzOffset);\n }\n return result;\n}","import classnames from 'classnames';\nimport { differenceInMilliseconds, formatISO } from 'date-fns';\nimport { type ChangeEvent, useCallback, useEffect, useId, useRef, useState } from 'react';\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { useInternalStatus } from '@/hooks/useInternalStatus.js';\nimport { FormControl, type FormControlProps } from './FormControl.js';\n\ninterface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {\n description?: string;\n /**\n * Open datepicker text\n */\n openDatepicker?: string;\n id?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n /**\n * Minimum Date allowed\n */\n min?: Date | undefined;\n /**\n * Maximum Date allowed\n */\n max?: Date | undefined;\n}\n\nconst formatDate = (value: Date | number | undefined | null): string => {\n if (!value) {\n return '';\n }\n\n return formatISO(new Date(value), { representation: 'date' });\n};\n\nconst validateDateRange = (date: string, min?: Date, max?: Date): boolean => {\n if (!date) {\n return true;\n }\n\n const normalizeDate = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());\n const inputDate = new Date(date);\n const normalizedInputDate = normalizeDate(inputDate);\n\n if (min && normalizedInputDate < normalizeDate(min)) {\n return false;\n }\n if (max && normalizedInputDate > normalizeDate(max)) {\n return false;\n }\n\n return true;\n};\n\nexport const DateField = (props: DateFieldProps) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n description,\n openDatepicker,\n validationStatus = 'default',\n icon = 'CalendarDefault',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n dataTestId = 'DateField',\n value: initialValue,\n min: initialMin,\n max: initialMax,\n onChange,\n ...rest\n } = props;\n\n // NO LOGIC IS IMPLEMENTED YET HERE\n // THIS IS A VISUAL COMPONENT ONLY\n const ref = useRef<HTMLInputElement>(null);\n const [isFocused, setIsFocused] = useState<boolean>(false);\n\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { setValue, value } = useValue<string, Date | number | undefined | null>({\n name,\n formatter: formatDate as never,\n initialValue,\n onChange: (name, value) => onChange?.(name, new Date(value)),\n });\n\n const min = formatDate(initialMin);\n const max = formatDate(initialMax);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value);\n };\n\n const handleClickPicker = () => {\n ref.current?.showPicker();\n };\n\n const handleOutOfRangeDate = useCallback(() => {\n const currentDate = new Date(value);\n\n if (initialMin && initialMax) {\n const distanceToMin = Math.abs(differenceInMilliseconds(currentDate, initialMin));\n const distanceToMax = Math.abs(differenceInMilliseconds(currentDate, initialMax));\n setValue(distanceToMin <= distanceToMax ? min : max);\n return;\n }\n\n if (initialMin) {\n setValue(min);\n return;\n }\n\n if (initialMax) {\n setValue(max);\n return;\n }\n }, [initialMax, initialMin, max, min, setValue, value]);\n\n useEffect(() => {\n const isValid = validateDateRange(value, initialMin, initialMax);\n if (!isValid && !isFocused) {\n handleOutOfRangeDate();\n }\n }, [handleOutOfRangeDate, initialMax, initialMin, isFocused, value]);\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n dataName=\"DateField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n type=\"date\"\n className={classnames(\n 'text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-pearl text-grey': disabled,\n 'bg-white text-black': !disabled,\n 'border-red': !disabled && internalStatus === 'error',\n 'border-green': !disabled && internalStatus === 'success',\n },\n )}\n id={id}\n disabled={disabled}\n required={required}\n ref={ref}\n value={value}\n min={min}\n max={max}\n onChange={handleChange}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n />\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': disabled,\n 'text-red': !disabled && internalStatus === 'error',\n 'text-green': !disabled && internalStatus === 'success',\n },\n )}\n >\n <button className=\"pointer-events-auto leading-none\" onClick={handleClickPicker}>\n <Icon name={icon} iconType={iconType} width=\"24px\" />\n <span className=\"sr-only\">\n {openDatepicker}\n {/* REPLACE THAT WITH SOMETHING LIKE \"OPEN DATEPICKER\" SOONER RATHER THAN LATER PLZ */}\n </span>\n </button>\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && <Icon name=\"CrossDefault\" width=\"24px\" />}\n {internalStatus === 'success' && <Icon name=\"CheckDefault\" width=\"24px\" />}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["_typeof","o","requiredArgs","required","args","toDate","argument","argStr","differenceInMilliseconds","dateLeft","dateRight","addLeadingZeros","number","targetLength","sign","output","formatISO","date","options","_options$format","_options$representati","originalDate","format","representation","result","tzOffset","dateDelimiter","timeDelimiter","day","month","year","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","formatDate","value","validateDateRange","min","max","normalizeDate","d","inputDate","normalizedInputDate","DateField","props","internalId","useId","id","name","label","description","openDatepicker","validationStatus","icon","iconType","errorMessage","disabled","hideRequiredStar","dataTestId","initialValue","initialMin","initialMax","onChange","rest","ref","useRef","isFocused","setIsFocused","useState","internalStatus","useInternalStatus","setValue","useValue","handleChange","event","handleClickPicker","_a","handleOutOfRangeDate","useCallback","currentDate","distanceToMin","distanceToMax","useEffect","jsx","FormControl","jsxs","classnames","Icon"],"mappings":";;;;;;;AAAe,SAASA,EAAQC,GAAG;AACjC;AAEA,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAChG,WAAO,OAAOA;AAAA,EAChB,IAAI,SAAUA,GAAG;AACf,WAAOA,KAAmB,OAAO,UAArB,cAA+BA,EAAE,gBAAgB,UAAUA,MAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EACpH,GAAGD,EAAQC,CAAC;AACd;ACRe,SAASC,EAAaC,GAAUC,GAAM;AACnD,MAAIA,EAAK,SAASD;AAChB,UAAM,IAAI,UAAUA,IAAW,eAAeA,IAAW,IAAI,MAAM,MAAM,yBAAyBC,EAAK,SAAS,UAAU;AAE9H;AC4Be,SAASC,EAAOC,GAAU;AACvC,EAAAJ,EAAa,GAAG,SAAS;AACzB,MAAIK,IAAS,OAAO,UAAU,SAAS,KAAKD,CAAQ;AAGpD,SAAIA,aAAoB,QAAQN,EAAQM,CAAQ,MAAM,YAAYC,MAAW,kBAEpE,IAAI,KAAKD,EAAS,SAAS,IACzB,OAAOA,KAAa,YAAYC,MAAW,oBAC7C,IAAI,KAAKD,CAAQ,MAEnB,OAAOA,KAAa,YAAYC,MAAW,sBAAsB,OAAO,UAAY,QAEvF,QAAQ,KAAK,oNAAoN,GA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AA,YAClD;AAAA,YAEF,IAAAtB;AAAA,YACA,UAAAS;AAAA,YACA,UAAA3D;AAAA,YACA,KAAAmE;AAAA,YACA,OAAA7B;AAAA,YACA,KAAAE;AAAA,YACA,KAAAC;AAAA,YACA,UAAUmC;AAAA,YACV,SAAS,MAAMN,EAAa,EAAI;AAAA,YAChC,QAAQ,MAAMA,EAAa,EAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAElC,gBAAAkB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,aAAa9B;AAAA,gBACb,YAAY,CAACA,KAAYa,MAAmB;AAAA,gBAC5C,cAAc,CAACb,KAAYa,MAAmB;AAAA,cAAA;AAAA,YAChD;AAAA,YAGF,UAAA;AAAA,cAAA,gBAAAgB,EAAC,UAAA,EAAO,WAAU,oCAAmC,SAASV,GAC5D,UAAA;AAAA,gBAAA,gBAAAQ,EAACI,GAAA,EAAK,MAAMlC,GAAM,UAAAC,GAAoB,OAAM,QAAO;AAAA,gBACnD,gBAAA6B,EAAC,QAAA,EAAK,WAAU,WACb,UAAAhC,EAAA,CAEH;AAAA,cAAA,GACF;AAAA,cACA,gBAAAkC,EAAC,QAAA,EAAK,WAAU,wBACb,UAAA;AAAA,gBAAAhB,MAAmB,WAAW,gBAAAc,EAACI,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,gBACrElB,MAAmB,aAAa,gBAAAc,EAACI,KAAK,MAAK,gBAAe,OAAM,OAAA,CAAO;AAAA,cAAA,EAAA,CAC1E;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4,5]}
|
|
@@ -2,16 +2,15 @@ import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as r } from "../../chunks/index.js";
|
|
3
3
|
import { useId as D } from "react";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { Icon as c } from "
|
|
6
|
-
import "@clubmed/trident-icons";
|
|
5
|
+
import { Icon as c } from "@clubmed/trident-icons";
|
|
7
6
|
import { useValue as N } from "../../hooks/useValue.js";
|
|
8
|
-
function
|
|
7
|
+
function A(m) {
|
|
9
8
|
const d = D(), {
|
|
10
|
-
id:
|
|
11
|
-
name: l =
|
|
12
|
-
className:
|
|
9
|
+
id: u = d,
|
|
10
|
+
name: l = u,
|
|
11
|
+
className: p,
|
|
13
12
|
dataTestId: h,
|
|
14
|
-
disabled:
|
|
13
|
+
disabled: n,
|
|
15
14
|
checked: f = !1,
|
|
16
15
|
value: a,
|
|
17
16
|
tabIndex: b = 0,
|
|
@@ -19,14 +18,14 @@ function T(m) {
|
|
|
19
18
|
hasDropdown: x,
|
|
20
19
|
children: k,
|
|
21
20
|
...w
|
|
22
|
-
} = m, { value:
|
|
21
|
+
} = m, { value: o, setValue: I } = N({
|
|
23
22
|
name: l,
|
|
24
23
|
initialValue: f,
|
|
25
24
|
onChange(v, s) {
|
|
26
25
|
t == null || t(v, s ? a !== void 0 ? a : s : null);
|
|
27
26
|
}
|
|
28
27
|
});
|
|
29
|
-
return /* @__PURE__ */ i("label", { className: r(
|
|
28
|
+
return /* @__PURE__ */ i("label", { className: r(p, "relative"), children: [
|
|
30
29
|
/* @__PURE__ */ e(
|
|
31
30
|
"input",
|
|
32
31
|
{
|
|
@@ -36,11 +35,11 @@ function T(m) {
|
|
|
36
35
|
type: "checkbox",
|
|
37
36
|
tabIndex: b,
|
|
38
37
|
onChange: () => {
|
|
39
|
-
!
|
|
38
|
+
!n && I(!o);
|
|
40
39
|
},
|
|
41
|
-
checked:
|
|
40
|
+
checked: o,
|
|
42
41
|
"data-name": "Filter",
|
|
43
|
-
disabled:
|
|
42
|
+
disabled: n,
|
|
44
43
|
value: a
|
|
45
44
|
}
|
|
46
45
|
),
|
|
@@ -52,6 +51,6 @@ function T(m) {
|
|
|
52
51
|
] });
|
|
53
52
|
}
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
A as Filter
|
|
56
55
|
};
|
|
57
56
|
//# sourceMappingURL=Filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.js","sources":["../../../lib/molecules/Forms/Filter.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type InputHTMLAttributes, useId } from 'react';\nimport './controls.css';\nimport { Icon } from '
|
|
1
|
+
{"version":3,"file":"Filter.js","sources":["../../../lib/molecules/Forms/Filter.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type InputHTMLAttributes, useId } from 'react';\nimport './controls.css';\nimport { Icon } from '@clubmed/trident-icons';\nimport { useValue } from '@/hooks/useValue.js';\n\nexport interface FilterProps<Value = string>\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /**\n * The data-testid to apply to the button.\n * This is used for testing purposes.\n * */\n dataTestId?: string;\n /**\n * Is it attached to a dropdown?\n */\n hasDropdown?: boolean;\n\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Filter<Value = string>(props: FilterProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled,\n checked: initialChecked = false,\n value,\n tabIndex = 0,\n onChange,\n hasDropdown,\n children,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n\n return (\n <label className={classnames(className, 'relative')}>\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Filter\"\n disabled={disabled}\n value={value}\n />\n <span>\n <span className={classnames('text-b3 font-semibold')}>{children}</span>\n <Icon width={null} name=\"CheckDefault\" color=\"black\" />\n {hasDropdown && (\n <Icon name=\"ArrowDefaultDown\" className=\"ml-8\" width=\"24px\" color=\"black\" />\n )}\n </span>\n </label>\n );\n}\n"],"names":["Filter","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","tabIndex","onChange","hasDropdown","children","rest","checked","setValue","useValue","classnames","jsx","Icon"],"mappings":";;;;;;AAqBO,SAASA,EAAuBC,GAA2B;AAChE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDd,GAEE,EAAE,OAAOe,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAb;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMW,GAAS;AACtB,MAAAJ,KAAA,QAAAA,EAAWP,GAAMW,IAAYN,MAAU,SAAYA,IAAQM,IAAqB;AAAA,IAClF;AAAA,EAAA,CACD;AAED,2BACG,SAAA,EAAM,WAAWG,EAAWb,GAAW,UAAU,GAChD,UAAA;AAAA,IAAA,gBAAAc;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGL;AAAA,QACJ,MAAAV;AAAA,QACA,eAAaE;AAAA,QACb,MAAK;AAAA,QACL,UAAAI;AAAA,QACA,UAAU,MAAM;AACd,WAACH,KAAYS,EAAS,CAACD,CAAO;AAAA,QAChC;AAAA,QACA,SAAAA;AAAA,QACA,aAAU;AAAA,QACV,UAAAR;AAAA,QACA,OAAAE;AAAA,MAAA;AAAA,IAAA;AAAA,sBAED,QAAA,EACC,UAAA;AAAA,MAAA,gBAAAU,EAAC,QAAA,EAAK,WAAWD,EAAW,uBAAuB,GAAI,UAAAL,GAAS;AAAA,wBAC/DO,GAAA,EAAK,OAAO,MAAM,MAAK,gBAAe,OAAM,SAAQ;AAAA,MACpDR,KACC,gBAAAO,EAACC,GAAA,EAAK,MAAK,oBAAmB,WAAU,QAAO,OAAM,QAAO,OAAM,QAAA,CAAQ;AAAA,IAAA,EAAA,CAE9E;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useInternalStatus as h } from "../../hooks/useInternalStatus.js";
|
|
3
3
|
import { FormLabel as S } from "./FormLabel.js";
|
|
4
|
-
import { Icon as b } from "
|
|
5
|
-
import "@clubmed/trident-icons";
|
|
4
|
+
import { Icon as b } from "@clubmed/trident-icons";
|
|
6
5
|
import { c as g } from "../../chunks/index.js";
|
|
7
|
-
const
|
|
6
|
+
const v = ({
|
|
8
7
|
id: t,
|
|
9
8
|
label: r,
|
|
10
9
|
description: o,
|
|
11
|
-
disabled:
|
|
12
|
-
required:
|
|
13
|
-
className:
|
|
14
|
-
validationStatus:
|
|
15
|
-
children:
|
|
10
|
+
disabled: n,
|
|
11
|
+
required: m,
|
|
12
|
+
className: l,
|
|
13
|
+
validationStatus: i = "default",
|
|
14
|
+
children: c,
|
|
16
15
|
errorMessage: a,
|
|
17
|
-
dataTestId:
|
|
16
|
+
dataTestId: p,
|
|
18
17
|
dataName: d,
|
|
19
18
|
hideRequiredStar: x,
|
|
20
19
|
layout: f
|
|
21
20
|
}) => {
|
|
22
21
|
const u = h({
|
|
23
|
-
isDisabled: !!
|
|
24
|
-
validationStatus:
|
|
22
|
+
isDisabled: !!n,
|
|
23
|
+
validationStatus: i
|
|
25
24
|
}) === "error" && a;
|
|
26
25
|
return /* @__PURE__ */ s(
|
|
27
26
|
"div",
|
|
28
27
|
{
|
|
29
|
-
className: g("flex flex-col gap-4",
|
|
28
|
+
className: g("flex flex-col gap-4", l),
|
|
30
29
|
"data-name": d,
|
|
31
|
-
"data-testid":
|
|
30
|
+
"data-testid": p,
|
|
32
31
|
children: [
|
|
33
32
|
r && t && /* @__PURE__ */ e(
|
|
34
33
|
S,
|
|
@@ -36,12 +35,12 @@ const w = ({
|
|
|
36
35
|
description: o,
|
|
37
36
|
id: t,
|
|
38
37
|
layout: f,
|
|
39
|
-
required:
|
|
38
|
+
required: m,
|
|
40
39
|
hideRequiredStar: x,
|
|
41
40
|
children: r
|
|
42
41
|
}
|
|
43
42
|
),
|
|
44
|
-
|
|
43
|
+
c,
|
|
45
44
|
u && /* @__PURE__ */ s("span", { className: "text-red text-b4 flex items-start gap-x-4 px-20", children: [
|
|
46
45
|
/* @__PURE__ */ e(b, { name: "Error", width: "20px" }),
|
|
47
46
|
a
|
|
@@ -51,6 +50,6 @@ const w = ({
|
|
|
51
50
|
);
|
|
52
51
|
};
|
|
53
52
|
export {
|
|
54
|
-
|
|
53
|
+
v as FormControl
|
|
55
54
|
};
|
|
56
55
|
//# sourceMappingURL=FormControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.js","sources":["../../../lib/molecules/Forms/FormControl.tsx"],"sourcesContent":["import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';\nimport { useInternalStatus, type ValidationStatus } from '@/hooks/useInternalStatus';\nimport { FormLabel, type FormLabelProps } from './FormLabel';\nimport { Icon } from '
|
|
1
|
+
{"version":3,"file":"FormControl.js","sources":["../../../lib/molecules/Forms/FormControl.tsx"],"sourcesContent":["import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';\nimport { useInternalStatus, type ValidationStatus } from '@/hooks/useInternalStatus';\nimport { FormLabel, type FormLabelProps } from './FormLabel';\nimport { Icon } from '@clubmed/trident-icons';\nimport classnames from 'classnames';\n\nexport type FormControlProps<\n Value = unknown,\n Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>,\n> = {\n value?: Value;\n label?: ReactNode;\n validationStatus?: ValidationStatus;\n onChange?: (name: string, value: Value) => void;\n dataTestId?: string;\n dataName?: string;\n errorMessage?: string;\n} & Omit<Attributes & Partial<FormLabelProps>, 'onChange' | 'value'>;\n\nexport const FormControl = <Value = string,>({\n id,\n label,\n description,\n disabled,\n required,\n className,\n validationStatus = 'default',\n children,\n errorMessage,\n dataTestId,\n dataName,\n hideRequiredStar,\n layout,\n}: FormControlProps<Value>) => {\n const internalStatus = useInternalStatus({\n isDisabled: !!disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col gap-4', className)}\n data-name={dataName}\n data-testid={dataTestId}\n >\n {label && id && (\n <FormLabel\n description={description}\n id={id}\n layout={layout}\n required={required}\n hideRequiredStar={hideRequiredStar}\n >\n {label}\n </FormLabel>\n )}\n\n {children}\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start gap-x-4 px-20\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n};\n"],"names":["FormControl","id","label","description","disabled","required","className","validationStatus","children","errorMessage","dataTestId","dataName","hideRequiredStar","layout","shouldDisplayErrorMessage","useInternalStatus","jsxs","classnames","jsx","FormLabel","Icon"],"mappings":";;;;;AAmBO,MAAMA,IAAc,CAAkB;AAAA,EAC3C,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,QAAAC;AACF,MAA+B;AAM7B,QAAMC,IALiBC,EAAkB;AAAA,IACvC,YAAY,CAAC,CAACX;AAAA,IACd,kBAAAG;AAAA,EAAA,CACD,MAEoD,WAAWE;AAEhE,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuBX,CAAS;AAAA,MACtD,aAAWK;AAAA,MACX,eAAaD;AAAA,MAEZ,UAAA;AAAA,QAAAR,KAASD,KACR,gBAAAiB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,aAAAhB;AAAA,YACA,IAAAF;AAAA,YACA,QAAAY;AAAA,YACA,UAAAR;AAAA,YACA,kBAAAO;AAAA,YAEC,UAAAV;AAAA,UAAA;AAAA,QAAA;AAAA,QAIJM;AAAA,QAEAM,KACC,gBAAAE,EAAC,QAAA,EAAK,WAAU,mDACd,UAAA;AAAA,UAAA,gBAAAE,EAACE,GAAA,EAAK,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/BX;AAAA,QAAA,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useInternalStatus as M } from "../../../hooks/useInternalStatus.js";
|
|
3
3
|
import { c as f } from "../../../chunks/index.js";
|
|
4
4
|
import { useId as P, useState as T, useEffect as q } from "react";
|
|
5
5
|
import { useValue as F } from "../../../hooks/useValue.js";
|
|
6
6
|
import { FormControl as z } from "../FormControl.js";
|
|
7
|
-
import { Icon as
|
|
8
|
-
import "@clubmed/trident-icons";
|
|
7
|
+
import { Icon as p } from "@clubmed/trident-icons";
|
|
9
8
|
import { ValidationMessage as E } from "./ValidationMessage.js";
|
|
10
|
-
function
|
|
9
|
+
function O(b) {
|
|
11
10
|
const x = P(), {
|
|
12
11
|
id: l = x,
|
|
13
12
|
name: o = l,
|
|
@@ -36,7 +35,7 @@ function Q(b) {
|
|
|
36
35
|
n(t ? "password" : r);
|
|
37
36
|
}, [r, t]);
|
|
38
37
|
const k = () => n(r === "password" ? "text" : "password");
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ c(
|
|
40
39
|
z,
|
|
41
40
|
{
|
|
42
41
|
className: y,
|
|
@@ -50,7 +49,7 @@ function Q(b) {
|
|
|
50
49
|
validationStatus: s ? "default" : e,
|
|
51
50
|
errorMessage: w,
|
|
52
51
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
54
53
|
/* @__PURE__ */ a(
|
|
55
54
|
"input",
|
|
56
55
|
{
|
|
@@ -82,9 +81,9 @@ function Q(b) {
|
|
|
82
81
|
className: f(
|
|
83
82
|
"pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12"
|
|
84
83
|
),
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
!s && e === "error" && /* @__PURE__ */ a(
|
|
87
|
-
!s && e === "success" && /* @__PURE__ */ a(
|
|
84
|
+
children: /* @__PURE__ */ c("span", { className: "ms-auto flex gap-x-8", children: [
|
|
85
|
+
!s && e === "error" && /* @__PURE__ */ a(p, { name: "CrossDefault", color: "red", width: "24px" }),
|
|
86
|
+
!s && e === "success" && /* @__PURE__ */ a(p, { name: "CheckDefault", color: "green", width: "24px" }),
|
|
88
87
|
!t && /* @__PURE__ */ a(
|
|
89
88
|
"button",
|
|
90
89
|
{
|
|
@@ -92,7 +91,7 @@ function Q(b) {
|
|
|
92
91
|
className: "pointer-events-auto size-24 inline-flex",
|
|
93
92
|
onClick: k,
|
|
94
93
|
children: /* @__PURE__ */ a(
|
|
95
|
-
|
|
94
|
+
p,
|
|
96
95
|
{
|
|
97
96
|
name: r === "password" ? "Invisible" : "Visible",
|
|
98
97
|
width: "24px",
|
|
@@ -111,6 +110,6 @@ function Q(b) {
|
|
|
111
110
|
);
|
|
112
111
|
}
|
|
113
112
|
export {
|
|
114
|
-
|
|
113
|
+
O as Password
|
|
115
114
|
};
|
|
116
115
|
//# sourceMappingURL=Password.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import { useInternalStatus } from '@/hooks/useInternalStatus';\nimport classnames from 'classnames';\n\nimport { type HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, type FormControlProps } from '../FormControl';\nimport { Icon } from '
|
|
1
|
+
{"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import { useInternalStatus } from '@/hooks/useInternalStatus';\nimport classnames from 'classnames';\n\nimport { type HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, type FormControlProps } from '../FormControl';\nimport { Icon } from '@clubmed/trident-icons';\nimport { ValidationMessage } from './ValidationMessage';\n\nexport interface PasswordProps<Value> extends FormControlProps<Value> {\n validationMessages?: ValidationMessage[];\n withoutFieldValidation?: boolean;\n}\n\nexport function Password<Value = string>(props: PasswordProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n disabled = false,\n required = false,\n hideRequiredStar,\n validationStatus = 'default',\n errorMessage,\n validationMessages = [],\n withoutFieldValidation = false,\n className,\n onChange,\n dataTestId = 'Password',\n ...rest\n } = props;\n\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { value, setValue } = useValue<Value>({\n name,\n initialValue,\n onChange,\n });\n const [type, setType] = useState<HTMLInputTypeAttribute>('password');\n\n useEffect(() => {\n if (disabled) {\n setType('password');\n } else {\n setType(type);\n }\n }, [type, disabled]);\n\n const toggleType = () => setType(type === 'password' ? 'text' : 'password');\n\n return (\n <FormControl\n className={className}\n id={id}\n label={label}\n dataName=\"Password\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={withoutFieldValidation ? 'default' : validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n type={type}\n value={value as any}\n disabled={disabled}\n required={required}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n (withoutFieldValidation || validationStatus === 'default') &&\n internalStatus !== 'disabled',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'pe-[84px]':\n !withoutFieldValidation &&\n (validationStatus === 'error' || validationStatus === 'success'),\n 'border-red': !withoutFieldValidation && validationStatus === 'error',\n 'border-green': !withoutFieldValidation && validationStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {!withoutFieldValidation && validationStatus === 'error' && (\n <Icon name=\"CrossDefault\" color=\"red\" width=\"24px\" />\n )}\n\n {!withoutFieldValidation && validationStatus === 'success' && (\n <Icon name=\"CheckDefault\" color=\"green\" width=\"24px\" />\n )}\n\n {!disabled && (\n <button\n type=\"button\"\n className=\"pointer-events-auto size-24 inline-flex\"\n onClick={toggleType}\n >\n <Icon\n name={type === 'password' ? 'Invisible' : 'Visible'}\n width=\"24px\"\n type=\"svg\"\n />\n </button>\n )}\n </span>\n </div>\n </div>\n\n {validationMessages.length > 0 && (\n <div className=\"flex flex-col gap-[10px] mt-8\">\n {validationMessages.map(({ label, status }, index) => (\n <ValidationMessage label={label} status={status} key={index} />\n ))}\n </div>\n )}\n </FormControl>\n );\n}\n"],"names":["Password","props","internalId","useId","id","name","label","initialValue","disabled","required","hideRequiredStar","validationStatus","errorMessage","validationMessages","withoutFieldValidation","className","onChange","dataTestId","rest","internalStatus","useInternalStatus","value","setValue","useValue","type","setType","useState","useEffect","toggleType","jsxs","FormControl","jsx","e","classnames","Icon","status","index","ValidationMessage"],"mappings":";;;;;;;;AAeO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF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,WAAU,iCACZ,UAAAlB,EAAmB,IAAI,CAAC,EAAE,OAAAP,GAAO,QAAA6B,EAAA,GAAUC,MAC1C,gBAAAL,EAACM,GAAA,EAAkB,OAAO/B,GAAO,QAAA6B,KAAqBC,CAAO,CAC9D,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { c as s } from "../../../chunks/index.js";
|
|
3
|
-
import { Icon as
|
|
4
|
-
|
|
5
|
-
const a = {
|
|
3
|
+
import { Icon as a } from "@clubmed/trident-icons";
|
|
4
|
+
const t = {
|
|
6
5
|
default: {
|
|
7
6
|
iconName: "Edit",
|
|
8
7
|
iconColor: "middleGrey"
|
|
@@ -16,14 +15,14 @@ const a = {
|
|
|
16
15
|
iconColor: "green"
|
|
17
16
|
}
|
|
18
17
|
};
|
|
19
|
-
function
|
|
20
|
-
const { iconName:
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */ e(
|
|
18
|
+
function p({ label: r, status: c }) {
|
|
19
|
+
const { iconName: n, iconColor: o } = t[c];
|
|
20
|
+
return /* @__PURE__ */ i("div", { className: "flex gap-[6px] px-20 items-center", children: [
|
|
21
|
+
/* @__PURE__ */ e(a, { name: n, width: "30px", color: o }),
|
|
23
22
|
/* @__PURE__ */ e("span", { className: s("text-b3", `text-${o}`), children: r })
|
|
24
23
|
] });
|
|
25
24
|
}
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
p as ValidationMessage
|
|
28
27
|
};
|
|
29
28
|
//# sourceMappingURL=ValidationMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationMessage.js","sources":["../../../../lib/molecules/Forms/Password/ValidationMessage.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { Icon } from '
|
|
1
|
+
{"version":3,"file":"ValidationMessage.js","sources":["../../../../lib/molecules/Forms/Password/ValidationMessage.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { Icon } from '@clubmed/trident-icons';\nimport type { ValidationStatus } from '@/hooks/useInternalStatus';\n\nexport interface ValidationMessage {\n label: string;\n status: ValidationStatus;\n}\n\nconst ICON_PROPS = {\n default: {\n iconName: 'Edit',\n iconColor: 'middleGrey',\n },\n error: {\n iconName: 'Error',\n iconColor: 'red',\n },\n success: {\n iconName: 'CheckDefault',\n iconColor: 'green',\n },\n};\n\nexport function ValidationMessage({ label, status }: ValidationMessage) {\n const { iconName, iconColor } = ICON_PROPS[status];\n\n return (\n <div className=\"flex gap-[6px] px-20 items-center\">\n <Icon name={iconName} width=\"30px\" color={iconColor} />\n <span className={classnames('text-b3', `text-${iconColor}`)}>{label}</span>\n </div>\n );\n}\n"],"names":["ICON_PROPS","ValidationMessage","label","status","iconName","iconColor","jsxs","jsx","Icon","classnames"],"mappings":";;;AASA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEb,OAAO;AAAA,IACL,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEb,SAAS;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAEf;AAEO,SAASC,EAAkB,EAAE,OAAAC,GAAO,QAAAC,KAA6B;AACtE,QAAM,EAAE,UAAAC,GAAU,WAAAC,MAAcL,EAAWG,CAAM;AAEjD,SACE,gBAAAG,EAAC,OAAA,EAAI,WAAU,qCACb,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAK,MAAMJ,GAAU,OAAM,QAAO,OAAOC,GAAW;AAAA,IACrD,gBAAAE,EAAC,UAAK,WAAWE,EAAW,WAAW,QAAQJ,CAAS,EAAE,GAAI,UAAAH,EAAA,CAAM;AAAA,EAAA,GACtE;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FormControlProps } from './FormControl.js';
|
|
2
|
-
import { type IconicTypes } from '
|
|
2
|
+
import { type IconicTypes } from '@clubmed/trident-icons';
|
|
3
3
|
import { type SelectHTMLAttributes } from 'react';
|
|
4
4
|
export interface SelectProps<Value> extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {
|
|
5
5
|
description?: string;
|
|
@@ -3,10 +3,9 @@ import { c as l } from "../../chunks/index.js";
|
|
|
3
3
|
import { useValue as I } from "../../hooks/useValue.js";
|
|
4
4
|
import { useInternalStatus as S } from "../../hooks/useInternalStatus.js";
|
|
5
5
|
import { FormControl as j } from "./FormControl.js";
|
|
6
|
-
import { Icon as n } from "
|
|
7
|
-
import "@clubmed/trident-icons";
|
|
6
|
+
import { Icon as n } from "@clubmed/trident-icons";
|
|
8
7
|
import { useId as T } from "react";
|
|
9
|
-
const
|
|
8
|
+
const R = (p) => {
|
|
10
9
|
const u = T(), {
|
|
11
10
|
id: t = u,
|
|
12
11
|
name: a = t,
|
|
@@ -100,6 +99,6 @@ const B = (p) => {
|
|
|
100
99
|
);
|
|
101
100
|
};
|
|
102
101
|
export {
|
|
103
|
-
|
|
102
|
+
R as Select
|
|
104
103
|
};
|
|
105
104
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../lib/molecules/Forms/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicTypes } from '
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../lib/molecules/Forms/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicTypes } from '@clubmed/trident-icons';\nimport { type SelectHTMLAttributes, useId } from 'react';\n\nexport interface SelectProps<Value>\n extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {\n description?: string;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n}\n\nexport const Select = <Value = string,>(props: SelectProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = id,\n onChange,\n children,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n className={className}\n label={label}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div\n className={classnames('relative rounded-pill z-0', {\n 'bg-white': internalStatus !== 'disabled',\n 'bg-pearl': internalStatus === 'disabled',\n })}\n >\n <select\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n internalStatus === 'default',\n 'pe-[84px]': internalStatus === 'error' || internalStatus === 'success',\n 'text-black': internalStatus !== 'disabled',\n 'text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n >\n {children}\n </select>\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12 -z-1',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n\n <button className=\"pointer-events-auto inline-flex\">\n <Icon name=\"ArrowDefaultDown\" type=\"svg\" width=\"24px\" color=\"black\" />\n </button>\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["Select","props","internalId","useId","id","name","label","initialValue","description","validationStatus","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","children","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","classnames","e","Icon"],"mappings":";;;;;;;AAeO,MAAMA,IAAS,CAAkBC,MAA8B;AACpE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAaZ;AAAA,IACb,UAAAa;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDlB,GAEE,EAAE,OAAAmB,GAAO,UAAAC,MAAaC,EAAgB,EAAE,MAAAjB,GAAM,cAAAE,GAAc,UAAAU,GAAU,GACtEM,IAAiBC,EAAkB;AAAA,IACvC,YAAYZ;AAAA,IACZ,kBAAAH;AAAA,EAAA,CACD;AAED,SACE,gBAAAgB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAtB;AAAA,MACA,WAAAW;AAAA,MACA,OAAAT;AAAA,MACA,aAAAE;AAAA,MACA,UAAS;AAAA,MACT,YAAAQ;AAAA,MACA,UAAAJ;AAAA,MACA,UAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBA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mCAChB,4BAACK,GAAA,EAAK,MAAK,oBAAmB,MAAK,OAAM,OAAM,QAAO,OAAM,SAAQ,EAAA,CACtE;AAAA,gBAAA,EAAA,CACF;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type UseValueProps } from '../../hooks/useValue';
|
|
2
2
|
import { type FormControlProps } from './FormControl.js';
|
|
3
|
-
import { type IconicNames, type IconicTypes } from '
|
|
3
|
+
import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
|
|
4
4
|
export interface TextFieldProps<Value> extends FormControlProps<Value> {
|
|
5
5
|
description?: string;
|
|
6
6
|
icon?: IconicNames;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as u } from "../../chunks/index.js";
|
|
3
3
|
import { useValue as F } from "../../hooks/useValue.js";
|
|
4
4
|
import { useInternalStatus as S } from "../../hooks/useInternalStatus.js";
|
|
5
5
|
import { FormControl as j } from "./FormControl.js";
|
|
6
|
-
import { Icon as i } from "
|
|
7
|
-
import "@clubmed/trident-icons";
|
|
6
|
+
import { Icon as i } from "@clubmed/trident-icons";
|
|
8
7
|
import { useId as D } from "react";
|
|
9
|
-
const
|
|
8
|
+
const B = (m) => {
|
|
10
9
|
const p = D(), {
|
|
11
10
|
id: t = p,
|
|
12
11
|
name: a = t,
|
|
@@ -25,7 +24,7 @@ const E = (u) => {
|
|
|
25
24
|
onChange: w,
|
|
26
25
|
formatter: N,
|
|
27
26
|
...C
|
|
28
|
-
} =
|
|
27
|
+
} = m, { value: I, setValue: T } = F({ name: a, initialValue: b, onChange: w, formatter: N }), e = S({
|
|
29
28
|
isDisabled: l,
|
|
30
29
|
validationStatus: n
|
|
31
30
|
});
|
|
@@ -54,7 +53,7 @@ const E = (u) => {
|
|
|
54
53
|
required: c,
|
|
55
54
|
value: I,
|
|
56
55
|
onChange: (k) => T(k.target.value),
|
|
57
|
-
className:
|
|
56
|
+
className: u(
|
|
58
57
|
"text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none",
|
|
59
58
|
{
|
|
60
59
|
"border-lightGrey focus:border-black active:border-black": e === "default",
|
|
@@ -72,7 +71,7 @@ const E = (u) => {
|
|
|
72
71
|
/* @__PURE__ */ o(
|
|
73
72
|
"div",
|
|
74
73
|
{
|
|
75
|
-
className:
|
|
74
|
+
className: u(
|
|
76
75
|
"pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12",
|
|
77
76
|
{
|
|
78
77
|
"text-grey": e === "disabled",
|
|
@@ -94,6 +93,6 @@ const E = (u) => {
|
|
|
94
93
|
);
|
|
95
94
|
};
|
|
96
95
|
export {
|
|
97
|
-
|
|
96
|
+
B as TextField
|
|
98
97
|
};
|
|
99
98
|
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sources":["../../../lib/molecules/Forms/TextField.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue, type UseValueProps } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicNames, type IconicTypes } from '
|
|
1
|
+
{"version":3,"file":"TextField.js","sources":["../../../lib/molecules/Forms/TextField.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue, type UseValueProps } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\nimport { useId } from 'react';\n\nexport interface TextFieldProps<Value> extends FormControlProps<Value> {\n description?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n formatter?: UseValueProps<Value>['formatter'];\n}\n\nexport const TextField = <Value = string,>(props: TextFieldProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n icon,\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = 'TextField',\n onChange,\n formatter,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange, formatter });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n label={label}\n className={className}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'ps-[52px]': icon,\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n {icon && <Icon name={icon} width=\"24px\" />}\n\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["TextField","props","internalId","useId","id","name","label","initialValue","description","validationStatus","icon","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","formatter","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","e","classnames","Icon"],"mappings":";;;;;;;AAgBO,MAAMA,IAAY,CAAkBC,MAAiC;AAC1E,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDnB,GAEE,EAAE,OAAAoB,GAAO,UAAAC,EAAA,IAAaC,EAAgB,EAAE,MAAAlB,GAAM,cAAAE,GAAc,UAAAW,GAAU,WAAAC,GAAW,GACjFK,IAAiBC,EAAkB;AAAA,IACvC,YAAYZ;AAAA,IACZ,kBAAAJ;AAAA,EAAA,CACD;AAED,SACE,gBAAAiB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAvB;AAAA,MACA,OAAAE;AAAA,MACA,WAAAU;AAAA,MACA,aAAAR;AAAA,MACA,UAAS;AAAA,MACT,YAAAS;AAAA,MACA,UAAAJ;AAAA,MACA,UAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAN;AAAA,MACA,cAAAG;AAAA,MAEA,UAAA,gBAAAgB,EAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,QAAA,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGN;AAAA,YACJ,IAAAhB;AAAA,YACA,MAAAC;AAAA,YACA,UAAAQ;AAAA,YACA,UAAAC;AAAA,YACA,OAAAO;AAAA,YACA,UAAU,CAACQ,MAAMP,EAASO,EAAE,OAAO,KAAc;AAAA,YACjD,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,2DACEN,MAAmB;AAAA,gBACrB,aAAad;AAAA,gBACb,aAAac,MAAmB,WAAWA,MAAmB;AAAA,gBAC9D,uBAAuBA,MAAmB;AAAA,gBAC1C,sBAAsBA,MAAmB;AAAA,gBACzC,cAAcA,MAAmB;AAAA,gBACjC,gBAAgBA,MAAmB;AAAA,cAAA;AAAA,YACrC;AAAA,YAEF,cAAYnB;AAAA,UAAA;AAAA,QAAA;AAAA,QAGd,gBAAAuB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWE;AAAA,cACT;AAAA,cACA;AAAA,gBACE,aAAaN,MAAmB;AAAA,gBAChC,YAAYA,MAAmB;AAAA,gBAC/B,cAAcA,MAAmB;AAAA,cAAA;AAAA,YACnC;AAAA,YAGD,UAAA;AAAA,cAAAd,KAAQ,gBAAAgB,EAACK,GAAA,EAAK,MAAMrB,GAAM,OAAM,QAAO;AAAA,cAExC,gBAAAkB,EAAC,QAAA,EAAK,WAAU,wBACb,UAAA;AAAA,gBAAAJ,MAAmB,6BACjBO,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAA,CAAU;AAAA,gBAGxDa,MAAmB,aAClB,gBAAAE,EAACK,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAA,CAAU;AAAA,cAAA,EAAA,CAE3D;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/molecules/Link.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';
|
|
2
|
-
import { type IconicNames, type IconicTypes } from '
|
|
2
|
+
import { type IconicNames, type IconicTypes } from '@clubmed/trident-icons';
|
|
3
3
|
interface LinkProps<T extends HTMLAnchorElement = HTMLAnchorElement> extends AnchorHTMLAttributes<T> {
|
|
4
4
|
/**
|
|
5
5
|
* Label text
|
package/molecules/Link.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
1
|
+
import { jsxs as t, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { c as a } from "../chunks/index.js";
|
|
3
|
-
import { Icon as u } from "
|
|
4
|
-
|
|
5
|
-
const C = ({
|
|
3
|
+
import { Icon as u } from "@clubmed/trident-icons";
|
|
4
|
+
const j = ({
|
|
6
5
|
label: n,
|
|
7
6
|
icon: s,
|
|
8
|
-
component:
|
|
7
|
+
component: o = "a",
|
|
9
8
|
iconType: m,
|
|
10
9
|
underlined: e = !0,
|
|
11
10
|
className: l,
|
|
@@ -14,7 +13,7 @@ const C = ({
|
|
|
14
13
|
}) => {
|
|
15
14
|
const r = n.lastIndexOf(" "), i = r === -1 ? n.length : r, h = n.substring(0, 1), x = n.substring(1, i + 1), g = n.substring(i);
|
|
16
15
|
return /* @__PURE__ */ t(
|
|
17
|
-
p ? "span" :
|
|
16
|
+
p ? "span" : o,
|
|
18
17
|
{
|
|
19
18
|
className: a(
|
|
20
19
|
"text-b3 decoration-none link-container cursor-pointer text-inherit",
|
|
@@ -23,7 +22,7 @@ const C = ({
|
|
|
23
22
|
"data-name": "Link",
|
|
24
23
|
...d,
|
|
25
24
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ c("span", { className: a({ "link-underline": e }), children: h }),
|
|
27
26
|
/* @__PURE__ */ t(
|
|
28
27
|
"span",
|
|
29
28
|
{
|
|
@@ -35,7 +34,7 @@ const C = ({
|
|
|
35
34
|
x,
|
|
36
35
|
/* @__PURE__ */ t("span", { className: "inline-block", children: [
|
|
37
36
|
g,
|
|
38
|
-
s && /* @__PURE__ */
|
|
37
|
+
s && /* @__PURE__ */ c(
|
|
39
38
|
u,
|
|
40
39
|
{
|
|
41
40
|
name: s,
|
|
@@ -53,6 +52,6 @@ const C = ({
|
|
|
53
52
|
);
|
|
54
53
|
};
|
|
55
54
|
export {
|
|
56
|
-
|
|
55
|
+
j as Link
|
|
57
56
|
};
|
|
58
57
|
//# sourceMappingURL=Link.js.map
|
package/molecules/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":["../../lib/molecules/Link.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '
|
|
1
|
+
{"version":3,"file":"Link.js","sources":["../../lib/molecules/Link.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';\n\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\n\ninterface LinkProps<T extends HTMLAnchorElement = HTMLAnchorElement>\n extends AnchorHTMLAttributes<T> {\n /**\n * Label text\n */\n label: string;\n /**\n * Icon name\n */\n icon?: IconicNames;\n iconType?: IconicTypes;\n /**\n * Underlined\n */\n underlined?: boolean;\n /**\n * Additional class names\n */\n className?: string;\n /**\n * Is the link inert (not itself clickable but part of a clickable element)\n */\n inert?: boolean;\n /**\n * Allow giving a custom component\n */\n component?: FunctionComponent<PropsWithChildren<any>> | string;\n}\n\nexport const Link: FunctionComponent<LinkProps> = ({\n label,\n icon,\n component = 'a',\n iconType,\n underlined = true,\n className,\n inert,\n ...anchorAttrs\n}) => {\n const lastSpace = label.lastIndexOf(' ');\n const lastIndex = lastSpace === -1 ? label.length : lastSpace;\n\n const first = label.substring(0, 1);\n const middle = label.substring(1, lastIndex + 1);\n const last = label.substring(lastIndex);\n const Cmp = component as FunctionComponent<PropsWithChildren>;\n\n const TagName = inert ? 'span' : Cmp;\n\n return (\n <TagName\n className={classnames(\n 'text-b3 decoration-none link-container cursor-pointer text-inherit',\n className,\n )}\n data-name=\"Link\"\n {...anchorAttrs}\n >\n <span className={classnames({ 'link-underline': underlined })}>{first}</span>\n <span\n className={classnames('hoverable', {\n 'has-icon': icon,\n 'link-underline': underlined,\n })}\n >\n {middle}\n <span className=\"inline-block\">\n {last}\n {icon && (\n <Icon\n name={icon}\n iconType={iconType}\n width=\"24px\"\n style={{ marginInlineStart: '8px' }}\n />\n )}\n </span>\n </span>\n </TagName>\n );\n};\n"],"names":["Link","label","icon","component","iconType","underlined","className","inert","anchorAttrs","lastSpace","lastIndex","first","middle","last","jsxs","classnames","jsx","Icon"],"mappings":";;;AAkCO,MAAMA,IAAqC,CAAC;AAAA,EACjD,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAYR,EAAM,YAAY,GAAG,GACjCS,IAAYD,MAAc,KAAKR,EAAM,SAASQ,GAE9CE,IAAQV,EAAM,UAAU,GAAG,CAAC,GAC5BW,IAASX,EAAM,UAAU,GAAGS,IAAY,CAAC,GACzCG,IAAOZ,EAAM,UAAUS,CAAS;AAKtC,SACE,gBAAAI;AAAA,IAHcP,IAAQ,SAFZJ;AAAA,IAKT;AAAA,MACC,WAAWY;AAAA,QACT;AAAA,QACAT;AAAA,MAAA;AAAA,MAEF,aAAU;AAAA,MACT,GAAGE;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAQ,EAAC,QAAA,EAAK,WAAWD,EAAW,EAAE,kBAAkBV,GAAY,GAAI,UAAAM,GAAM;AAAA,QACtE,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC,EAAW,aAAa;AAAA,cACjC,YAAYb;AAAA,cACZ,kBAAkBG;AAAA,YAAA,CACnB;AAAA,YAEA,UAAA;AAAA,cAAAO;AAAA,cACD,gBAAAE,EAAC,QAAA,EAAK,WAAU,gBACb,UAAA;AAAA,gBAAAD;AAAA,gBACAX,KACC,gBAAAc;AAAA,kBAACC;AAAA,kBAAA;AAAA,oBACC,MAAMf;AAAA,oBACN,UAAAE;AAAA,oBACA,OAAM;AAAA,oBACN,OAAO,EAAE,mBAAmB,MAAA;AAAA,kBAAM;AAAA,gBAAA;AAAA,cACpC,EAAA,CAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clubmed/trident-ui",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared ClubMed React UI components",
|
|
6
6
|
"keywords": [
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
"import": "./molecules/Forms/Checkboxes/index.js",
|
|
52
52
|
"default": "./molecules/Forms/Checkboxes/index.js"
|
|
53
53
|
},
|
|
54
|
-
"./molecules/Forms/Password": {
|
|
55
|
-
"types": "./molecules/Forms/Password/index.d.ts",
|
|
56
|
-
"import": "./molecules/Forms/Password/index.js",
|
|
57
|
-
"default": "./molecules/Forms/Password/index.js"
|
|
58
|
-
},
|
|
59
54
|
"./molecules/Forms/Radios": {
|
|
60
55
|
"types": "./molecules/Forms/Radios/index.d.ts",
|
|
61
56
|
"import": "./molecules/Forms/Radios/index.js",
|
|
62
57
|
"default": "./molecules/Forms/Radios/index.js"
|
|
63
58
|
},
|
|
59
|
+
"./molecules/Forms/Password": {
|
|
60
|
+
"types": "./molecules/Forms/Password/index.d.ts",
|
|
61
|
+
"import": "./molecules/Forms/Password/index.js",
|
|
62
|
+
"default": "./molecules/Forms/Password/index.js"
|
|
63
|
+
},
|
|
64
64
|
"./fonts/*": "./fonts/*",
|
|
65
65
|
"./atoms/*": {
|
|
66
66
|
"types": "./atoms/*.d.ts",
|