@clubmed/trident-ui 1.3.0-beta.8 → 1.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +133 -0
- package/README.md +8 -0
- package/assets/icons/ResortFill/PHUC_Fill.svg +287 -10
- package/assets/icons/ResortFill/TOMC_Fill.svg +199 -14
- package/assets/icons/ResortFill-EC/KIPC_EC_Fill.svg +499 -0
- package/assets/icons/ResortOutline/PHUC_Outline.svg +156 -6
- package/assets/icons/ResortOutline/TOMC_Outline.svg +99 -6
- package/assets/icons/ResortOutline-EC/KIPC_EC_Outline.svg +380 -0
- package/assets/icons/Transports/Taxi.svg +5 -0
- package/assets/icons/Utilities/Doorhanger.svg +5 -0
- package/assets/{style.css → trident-ui.css} +1 -1
- package/atoms/Clickable/Clickable.d.ts +5 -0
- package/atoms/Clickable/Clickable.js +25 -0
- package/atoms/Clickable/Clickable.js.map +1 -0
- package/atoms/Heading/Heading.d.ts +6 -0
- package/atoms/Heading/Heading.js +14 -0
- package/atoms/Heading/Heading.js.map +1 -0
- package/atoms/Heading/HeadingGroup.d.ts +7 -0
- package/atoms/Heading/HeadingGroup.js +15 -0
- package/atoms/Heading/HeadingGroup.js.map +1 -0
- package/atoms/Icons/Iconics.d.ts +1 -1
- package/atoms/Icons/IconsResolver.d.ts +1 -1
- package/atoms/Icons/contexts/IconsContext.d.ts +1 -1
- package/atoms/Icons/svg/SvgIcon.d.ts +1 -1
- package/atoms/Icons/svg-use/SvgUseIcon.d.ts +1 -1
- package/atoms/Image/Image.d.ts +7 -0
- package/atoms/Image/Image.js +18 -0
- package/atoms/Image/Image.js.map +1 -0
- package/atoms/Prose/Prose.d.ts +5 -0
- package/atoms/Prose/Prose.js +18 -0
- package/atoms/Prose/Prose.js.map +1 -0
- package/chunks/ResizeObserver.js +287 -0
- package/chunks/ResizeObserver.js.map +1 -0
- package/chunks/_commonjsHelpers.js +19 -14
- package/chunks/_commonjsHelpers.js.map +1 -1
- package/chunks/index.js +36 -33
- package/chunks/index.js.map +1 -1
- package/chunks/plugin.js +57 -46
- package/chunks/plugin.js.map +1 -1
- package/contexts/Devices/Device.d.ts +3 -3
- package/contexts/Devices/hooks/useQueries.d.ts +2 -2
- package/contexts/Devices/reducers/reducer.d.ts +2 -2
- package/contexts/TridentUIConfig.d.ts +1 -1
- package/contexts/TridentUIConfig.js +1265 -653
- package/contexts/TridentUIConfig.js.map +1 -1
- package/helpers/colors/colors.d.ts +108 -0
- package/helpers/colors/colors.js +132 -0
- package/helpers/colors/colors.js.map +1 -0
- package/hooks/useKeyboardControls.d.ts +1 -1
- package/hooks/useResizeObserver.d.ts +2 -0
- package/hooks/useResizeObserver.js +84 -0
- package/hooks/useResizeObserver.js.map +1 -0
- package/hooks/useSafeBoop.d.ts +2 -2
- package/molecules/Arrows/Arrows.d.ts +2 -2
- package/molecules/Avatar.d.ts +1 -1
- package/molecules/Avatar.js +24 -24
- package/molecules/Avatar.js.map +1 -1
- package/molecules/Backdrop.d.ts +1 -1
- package/molecules/Breadcrumb.d.ts +7 -11
- package/molecules/Breadcrumb.js +44 -36
- package/molecules/Breadcrumb.js.map +1 -1
- package/molecules/Breadcrumb.themes.d.ts +8 -0
- package/molecules/Breadcrumb.themes.js +15 -0
- package/molecules/Breadcrumb.themes.js.map +1 -0
- package/molecules/Buttons/ArrowButton.d.ts +1 -1
- package/molecules/Buttons/Button.d.ts +7 -3
- package/molecules/Buttons/Button.js +12 -10
- package/molecules/Buttons/Button.js.map +1 -1
- package/molecules/Buttons/ButtonAnchor.d.ts +7 -2
- package/molecules/Buttons/ButtonAnchor.js +13 -10
- package/molecules/Buttons/ButtonAnchor.js.map +1 -1
- package/molecules/Buttons/ButtonContent.d.ts +2 -2
- package/molecules/Buttons/FakeButton.d.ts +7 -7
- package/molecules/Buttons/FakeButton.js +5 -24
- package/molecules/Buttons/FakeButton.js.map +1 -1
- package/molecules/Buttons/InertButton.d.ts +3 -3
- package/molecules/Buttons/InertButton.js +9 -8
- package/molecules/Buttons/InertButton.js.map +1 -1
- package/molecules/Buttons/v2/Button.d.ts +2286 -8
- package/molecules/Buttons/v2/Button.js +51 -26
- package/molecules/Buttons/v2/Button.js.map +1 -1
- package/molecules/Buttons/v2/Button.type.d.ts +5 -2
- package/molecules/Buttons/v2/Button.type.js +8 -5
- package/molecules/Buttons/v2/Button.type.js.map +1 -1
- package/molecules/Card.d.ts +1 -11
- package/molecules/Card.js +2 -34
- package/molecules/Card.js.map +1 -1
- package/molecules/Cards/Card.d.ts +13 -0
- package/molecules/Cards/Card.js +22 -0
- package/molecules/Cards/Card.js.map +1 -0
- package/molecules/Cards/CardAspectRatios.d.ts +6 -0
- package/molecules/Cards/CardAspectRatios.js +10 -0
- package/molecules/Cards/CardAspectRatios.js.map +1 -0
- package/molecules/Cards/CardBackground.d.ts +4 -0
- package/molecules/Cards/CardBackground.js +30 -0
- package/molecules/Cards/CardBackground.js.map +1 -0
- package/molecules/Cards/CardBackgroundContext.d.ts +6 -0
- package/molecules/Cards/CardBackgroundContext.js +10 -0
- package/molecules/Cards/CardBackgroundContext.js.map +1 -0
- package/molecules/Cards/CardClickable.d.ts +6 -0
- package/molecules/Cards/CardClickable.js +37 -0
- package/molecules/Cards/CardClickable.js.map +1 -0
- package/molecules/Cards/ExpandableCard.d.ts +14 -0
- package/molecules/Cards/ExpandableCard.js +80 -0
- package/molecules/Cards/ExpandableCard.js.map +1 -0
- package/molecules/Cards/v2/Card.d.ts +15 -0
- package/molecules/Cards/v2/Card.js +34 -0
- package/molecules/Cards/v2/Card.js.map +1 -0
- package/molecules/Chip.d.ts +9 -0
- package/molecules/Chip.js +31 -0
- package/molecules/Chip.js.map +1 -0
- package/molecules/Chip.themes.d.ts +12 -0
- package/molecules/Chip.themes.js +24 -0
- package/molecules/Chip.themes.js.map +1 -0
- package/molecules/ElasticHeight.d.ts +6 -27
- package/molecules/ElasticHeight.js +27 -33
- package/molecules/ElasticHeight.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.d.ts +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.js +43 -43
- package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkboxes.d.ts +2 -2
- package/molecules/Forms/DateField.d.ts +2 -2
- package/molecules/Forms/DateField.js +60 -61
- package/molecules/Forms/DateField.js.map +1 -1
- package/molecules/Forms/Filter.d.ts +1 -2
- package/molecules/Forms/Filter.js +29 -29
- package/molecules/Forms/Filter.js.map +1 -1
- package/molecules/Forms/FormControl.d.ts +4 -4
- package/molecules/Forms/FormLabel.d.ts +1 -1
- package/molecules/Forms/NumberField.d.ts +280 -280
- package/molecules/Forms/Password/Password.d.ts +1 -1
- package/molecules/Forms/Password/ValidationMessage.d.ts +1 -1
- package/molecules/Forms/Radios/Radio.d.ts +4 -2
- package/molecules/Forms/Radios/Radio.js +29 -28
- package/molecules/Forms/Radios/Radio.js.map +1 -1
- package/molecules/Forms/Radios/RadioGroup.d.ts +2 -2
- package/molecules/Forms/Radios/RadioGroup.js +70 -33
- package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
- package/molecules/Forms/Range.d.ts +1 -2
- package/molecules/Forms/Range.js +144 -421
- package/molecules/Forms/Range.js.map +1 -1
- package/molecules/Forms/Select.d.ts +3 -3
- package/molecules/Forms/Switch.d.ts +1 -1
- package/molecules/Forms/TextField.d.ts +3 -3
- package/molecules/HamburgerIcon.d.ts +1 -1
- package/molecules/Link.d.ts +2 -2
- package/molecules/Loader.d.ts +1 -1
- package/molecules/Pagination.d.ts +2 -2
- package/molecules/Popin.d.ts +1 -1
- package/molecules/Spinner.d.ts +1 -1
- package/molecules/Tabs/Tab.d.ts +2 -3
- package/molecules/Tabs/Tab.js +41 -42
- package/molecules/Tabs/Tab.js.map +1 -1
- package/molecules/Tabs/TabList.d.ts +1 -1
- package/molecules/Tabs/TabList.js +21 -21
- package/molecules/Tabs/TabList.js.map +1 -1
- package/molecules/Tabs/TabPanel.d.ts +1 -1
- package/molecules/Tabs/TabPanel.js +13 -13
- package/molecules/Tabs/TabPanel.js.map +1 -1
- package/molecules/Tabs/Tabs.d.ts +1 -1
- package/molecules/Tabs/TabsBody.d.ts +1 -1
- package/molecules/Tabs/context/TabControl.d.ts +2 -2
- package/molecules/Tabs/hooks/tabControl.d.ts +5 -5
- package/molecules/Tag.d.ts +43 -0
- package/molecules/Tag.js +73 -0
- package/molecules/Tag.js.map +1 -0
- package/package.json +48 -45
- package/styles/index.css +1 -1
- package/tailwind/plugins/animationDelay.d.ts +2 -2
- package/tailwind/plugins/hocus.d.ts +2 -2
- package/tailwind/plugins/lineClampFix.d.ts +2 -2
- package/tailwind/plugins/popover.d.ts +2 -2
- package/tailwind/plugins/startingStyle.d.ts +2 -2
- package/tailwind/plugins/transitionBehavior.d.ts +2 -2
- package/tailwind/tailwind.preset.d.ts +50 -50
- package/types/LiteralUnion.d.js +2 -0
- package/types/LiteralUnion.d.js.map +1 -0
- package/types/Theme.d.js +2 -0
- package/types/Theme.d.js.map +1 -0
- package/assets/icons/ResortFill/KIPC_Fill.svg +0 -12
- package/assets/icons/ResortOutline/KIPC_Outline.svg +0 -7
- package/molecules/Buttons/v2/ButtonAnchor.d.ts +0 -12
- package/molecules/Buttons/v2/ButtonAnchor.js +0 -32
- package/molecules/Buttons/v2/ButtonAnchor.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../chunks/index.js";
|
|
3
|
+
import { getTheme as c } from "./Chip.themes.js";
|
|
4
|
+
const f = ({
|
|
5
|
+
className: e,
|
|
6
|
+
color: s = "sienna",
|
|
7
|
+
size: r = "size-32",
|
|
8
|
+
theme: o = "solid",
|
|
9
|
+
children: t,
|
|
10
|
+
...n
|
|
11
|
+
}) => {
|
|
12
|
+
const { thRoot: i } = c(o, { color: s });
|
|
13
|
+
return /* @__PURE__ */ a(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
...n,
|
|
17
|
+
className: m(
|
|
18
|
+
"inline-flex aspect-square shrink-0 items-center justify-center overflow-hidden rounded-full border",
|
|
19
|
+
r,
|
|
20
|
+
i,
|
|
21
|
+
e
|
|
22
|
+
),
|
|
23
|
+
"data-name": "Chip",
|
|
24
|
+
children: t
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
f as Chip
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=Chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../lib/molecules/Chip.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { getTheme, type Theme } from './Chip.themes';\n\nimport type { Colors } from '@/types/Colors';\n\nexport interface ChipProps extends ComponentPropsWithoutRef<'span'> {\n color?: Colors;\n size?: string;\n theme?: Theme;\n}\n\nexport const Chip = ({\n className,\n color = 'sienna',\n size = 'size-32',\n theme = 'solid',\n children,\n ...attrs\n}: ChipProps) => {\n const { thRoot } = getTheme(theme, { color });\n\n return (\n <span\n {...attrs}\n className={classNames(\n 'inline-flex aspect-square shrink-0 items-center justify-center overflow-hidden rounded-full border',\n size,\n thRoot,\n className,\n )}\n data-name=\"Chip\"\n >\n {children}\n </span>\n );\n};\n"],"names":["Chip","className","color","size","theme","children","attrs","thRoot","getTheme","jsx","classNames"],"mappings":";;;AAaO,MAAMA,IAAO,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,GAAGC;AACL,MAAiB;AACf,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAASJ,GAAO,EAAE,OAAAF,GAAO;AAE5C,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGH;AAAA,MACJ,WAAWI;AAAAA,QACT;AAAA,QACAP;AAAA,QACAI;AAAA,QACAN;AAAA,MAAA;AAAA,MAEF,aAAU;AAAA,MAET,UAAAI;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Colors } from '../types/Colors';
|
|
2
|
+
export type Theme = 'solid' | 'outline' | 'light' | 'dark';
|
|
3
|
+
type Options = {
|
|
4
|
+
color: Colors;
|
|
5
|
+
};
|
|
6
|
+
export declare const themes: (color: Colors) => Record<Theme, {
|
|
7
|
+
thRoot: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getTheme: (theme: Theme, { color }: Options) => {
|
|
10
|
+
thRoot: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { c as e } from "../chunks/index.js";
|
|
2
|
+
import { getBorderColor as r, getTextColor as n, getBgColor as g, getComplementaryTextColor as i } from "../helpers/colors/colors.js";
|
|
3
|
+
const l = (t) => ({
|
|
4
|
+
solid: {
|
|
5
|
+
thRoot: e(g(t), r(t), i(t))
|
|
6
|
+
},
|
|
7
|
+
outline: {
|
|
8
|
+
thRoot: e("bg-transparent", r(t), n(t))
|
|
9
|
+
},
|
|
10
|
+
light: {
|
|
11
|
+
thRoot: e("bg-lightSand text-black border-lightSand")
|
|
12
|
+
},
|
|
13
|
+
dark: {
|
|
14
|
+
thRoot: e("bg-ultramarine text-white border-ultramarine")
|
|
15
|
+
}
|
|
16
|
+
}), h = (t, { color: a }) => {
|
|
17
|
+
const o = l(a);
|
|
18
|
+
return o[t] || o.solid;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
h as getTheme,
|
|
22
|
+
l as themes
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Chip.themes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.themes.js","sources":["../../lib/molecules/Chip.themes.ts"],"sourcesContent":["import classnames from 'classnames';\nimport type { Colors } from '@/types/Colors';\nimport {\n getBgColor,\n getBorderColor,\n getComplementaryTextColor,\n getTextColor,\n} from '@/helpers/colors/colors';\n\nexport type Theme = 'solid' | 'outline' | 'light' | 'dark';\n\ntype Options = { color: Colors };\n\nexport const themes = (color: Colors): Record<Theme, { thRoot: string }> => ({\n solid: {\n thRoot: classnames(getBgColor(color), getBorderColor(color), getComplementaryTextColor(color)),\n },\n outline: {\n thRoot: classnames('bg-transparent', getBorderColor(color), getTextColor(color)),\n },\n light: {\n thRoot: classnames('bg-lightSand text-black border-lightSand'),\n },\n dark: {\n thRoot: classnames('bg-ultramarine text-white border-ultramarine'),\n },\n});\n\nexport const getTheme = (theme: Theme, { color }: Options) => {\n const THEMES = themes(color);\n\n return THEMES[theme] || THEMES.solid;\n};\n"],"names":["themes","color","classnames","getBgColor","getBorderColor","getComplementaryTextColor","getTextColor","getTheme","theme","THEMES"],"mappings":";;AAaO,MAAMA,IAAS,CAACC,OAAsD;AAAA,EAC3E,OAAO;AAAA,IACL,QAAQC,EAAWC,EAAWF,CAAK,GAAGG,EAAeH,CAAK,GAAGI,EAA0BJ,CAAK,CAAC;AAAA,EAAA;AAAA,EAE/F,SAAS;AAAA,IACP,QAAQC,EAAW,kBAAkBE,EAAeH,CAAK,GAAGK,EAAaL,CAAK,CAAC;AAAA,EAAA;AAAA,EAEjF,OAAO;AAAA,IACL,QAAQC,EAAW,0CAA0C;AAAA,EAAA;AAAA,EAE/D,MAAM;AAAA,IACJ,QAAQA,EAAW,8CAA8C;AAAA,EAAA;AAErE,IAEaK,IAAW,CAACC,GAAc,EAAE,OAAAP,QAAqB;AAC5D,QAAMQ,IAAST,EAAOC,CAAK;AAE3B,SAAOQ,EAAOD,CAAK,KAAKC,EAAO;AACjC;"}
|
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* ID is there for accessibility purposes.
|
|
7
|
-
*
|
|
8
|
-
* This is in no way affiliated with Amazon ElasticSearch.
|
|
9
|
-
*/
|
|
10
|
-
interface ElasticHeightProps {
|
|
11
|
-
/**
|
|
12
|
-
* Id of the element
|
|
13
|
-
*/
|
|
14
|
-
id?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Class of the element (please provide something that sets the height)
|
|
17
|
-
*/
|
|
18
|
-
className?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Class of the container (to avoid CLS, mainly)
|
|
21
|
-
*/
|
|
22
|
-
containerClassName?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Role of the element
|
|
25
|
-
*/
|
|
26
|
-
role?: string;
|
|
1
|
+
import { ComponentPropsWithoutRef, FunctionComponent } from 'react';
|
|
2
|
+
interface ElasticHeightProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
innerClassName?: string;
|
|
4
|
+
isExpanded?: boolean;
|
|
5
|
+
min?: number;
|
|
27
6
|
}
|
|
28
|
-
export declare const ElasticHeight: FunctionComponent<
|
|
7
|
+
export declare const ElasticHeight: FunctionComponent<ElasticHeightProps>;
|
|
29
8
|
export {};
|
|
@@ -1,42 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { c as u } from "../chunks/index.js";
|
|
4
|
+
import { useRef as l, useState as m, useLayoutEffect as d } from "react";
|
|
5
|
+
import h from "../hooks/useResizeObserver.js";
|
|
6
|
+
const H = ({
|
|
7
|
+
className: i,
|
|
8
|
+
children: o,
|
|
9
|
+
innerClassName: a,
|
|
10
|
+
isExpanded: t = !1,
|
|
11
|
+
min: n = 0,
|
|
12
|
+
...f
|
|
11
13
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
config: {
|
|
24
|
-
tension: 170,
|
|
25
|
-
friction: 26
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}, [o, e]), /* @__PURE__ */ s(
|
|
29
|
-
p.div,
|
|
14
|
+
const e = l(null), [c, r] = m(0);
|
|
15
|
+
return h({
|
|
16
|
+
ref: e,
|
|
17
|
+
onResize: () => {
|
|
18
|
+
e.current && r(e.current?.offsetHeight);
|
|
19
|
+
}
|
|
20
|
+
}), d(() => {
|
|
21
|
+
e.current && r(e.current.offsetHeight);
|
|
22
|
+
}, [e]), /* @__PURE__ */ s(
|
|
23
|
+
"div",
|
|
30
24
|
{
|
|
31
|
-
|
|
32
|
-
className:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
children: /* @__PURE__ */ s("div", { className: a, ref:
|
|
25
|
+
...f,
|
|
26
|
+
className: u("overflow-hidden transition-all duration-500", i),
|
|
27
|
+
"data-expanded": t,
|
|
28
|
+
style: { height: t ? c : n },
|
|
29
|
+
children: /* @__PURE__ */ s("div", { className: a, ref: e, children: o })
|
|
36
30
|
}
|
|
37
31
|
);
|
|
38
32
|
};
|
|
39
33
|
export {
|
|
40
|
-
|
|
34
|
+
H as ElasticHeight
|
|
41
35
|
};
|
|
42
36
|
//# sourceMappingURL=ElasticHeight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElasticHeight.js","sources":["../../lib/molecules/ElasticHeight.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ElasticHeight.js","sources":["../../lib/molecules/ElasticHeight.tsx"],"sourcesContent":["'use client';\n\nimport classnames from 'classnames';\nimport {\n type ComponentPropsWithoutRef,\n type FunctionComponent,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport useResizeObserver from '@/hooks/useResizeObserver';\n\ninterface ElasticHeightProps extends ComponentPropsWithoutRef<'div'> {\n innerClassName?: string;\n isExpanded?: boolean;\n min?: number;\n}\n\nexport const ElasticHeight: FunctionComponent<ElasticHeightProps> = ({\n className,\n children,\n innerClassName,\n isExpanded = false,\n min = 0,\n ...attrs\n}) => {\n const ref = useRef<HTMLDivElement>(null as any);\n const [max, setMax] = useState(0);\n\n useResizeObserver<HTMLDivElement>({\n ref: ref,\n onResize: () => {\n if (ref.current) {\n setMax(ref.current?.offsetHeight);\n }\n },\n });\n\n useLayoutEffect(() => {\n if (!ref.current) {\n return;\n }\n setMax(ref.current.offsetHeight);\n }, [ref]);\n\n return (\n <div\n {...attrs}\n className={classnames('overflow-hidden transition-all duration-500', className)}\n data-expanded={isExpanded}\n style={{ height: isExpanded ? max : min }}\n >\n <div className={innerClassName} ref={ref}>\n {children}\n </div>\n </div>\n );\n};\n"],"names":["ElasticHeight","className","children","innerClassName","isExpanded","min","attrs","ref","useRef","max","setMax","useState","useResizeObserver","useLayoutEffect","jsx","classnames"],"mappings":";;;;;AAkBO,MAAMA,IAAuD,CAAC;AAAA,EACnE,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,KAAAC,IAAM;AAAA,EACN,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAMC,EAAuB,IAAW,GACxC,CAACC,GAAKC,CAAM,IAAIC,EAAS,CAAC;AAEhC,SAAAC,EAAkC;AAAA,IAChC,KAAAL;AAAA,IACA,UAAU,MAAM;AACd,MAAIA,EAAI,WACNG,EAAOH,EAAI,SAAS,YAAY;AAAA,IAEpC;AAAA,EAAA,CACD,GAEDM,EAAgB,MAAM;AACpB,IAAKN,EAAI,WAGTG,EAAOH,EAAI,QAAQ,YAAY;AAAA,EACjC,GAAG,CAACA,CAAG,CAAC,GAGN,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGR;AAAA,MACJ,WAAWS,EAAW,+CAA+Cd,CAAS;AAAA,MAC9E,iBAAeG;AAAA,MACf,OAAO,EAAE,QAAQA,IAAaK,IAAMJ,EAAA;AAAA,MAEpC,UAAA,gBAAAS,EAAC,OAAA,EAAI,WAAWX,GAAgB,KAAAI,GAC7B,UAAAL,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../../chunks/index.js";
|
|
3
3
|
import { useId as D } from "react";
|
|
4
4
|
import { useValue as S } from "../../../hooks/useValue.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { useInternalStatus as V } from "../../../hooks/useInternalStatus.js";
|
|
7
|
-
import { Icon as
|
|
8
|
-
function A(
|
|
9
|
-
const
|
|
10
|
-
id: s =
|
|
11
|
-
name:
|
|
12
|
-
className:
|
|
13
|
-
dataTestId:
|
|
7
|
+
import { Icon as h } from "@clubmed/trident-icons";
|
|
8
|
+
function A(p) {
|
|
9
|
+
const u = D(), {
|
|
10
|
+
id: s = u,
|
|
11
|
+
name: o = s,
|
|
12
|
+
className: x,
|
|
13
|
+
dataTestId: f,
|
|
14
14
|
disabled: r = !1,
|
|
15
|
-
checked:
|
|
15
|
+
checked: b = !1,
|
|
16
16
|
value: l,
|
|
17
17
|
size: i = 24,
|
|
18
|
-
tabIndex:
|
|
19
|
-
validationStatus:
|
|
20
|
-
errorMessage:
|
|
21
|
-
children:
|
|
22
|
-
onChange:
|
|
23
|
-
...
|
|
24
|
-
} =
|
|
25
|
-
name:
|
|
26
|
-
initialValue:
|
|
27
|
-
onChange(w,
|
|
28
|
-
|
|
18
|
+
tabIndex: k = 0,
|
|
19
|
+
validationStatus: g = "default",
|
|
20
|
+
errorMessage: c,
|
|
21
|
+
children: v,
|
|
22
|
+
onChange: C,
|
|
23
|
+
...N
|
|
24
|
+
} = p, { value: d, setValue: y } = S({
|
|
25
|
+
name: o,
|
|
26
|
+
initialValue: b,
|
|
27
|
+
onChange(w, m) {
|
|
28
|
+
C?.(w, m ? l !== void 0 ? l : m : null);
|
|
29
29
|
}
|
|
30
30
|
}), e = V({
|
|
31
31
|
isDisabled: r,
|
|
32
|
-
validationStatus:
|
|
33
|
-
}),
|
|
34
|
-
return /* @__PURE__ */
|
|
32
|
+
validationStatus: g
|
|
33
|
+
}), I = e === "error" && c;
|
|
34
|
+
return /* @__PURE__ */ a(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
37
|
+
className: n("flex flex-col space-y-2", x),
|
|
38
38
|
"data-testid": `checkbox-container-${s}`,
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ a(
|
|
41
41
|
"label",
|
|
42
42
|
{
|
|
43
|
-
className:
|
|
43
|
+
className: n("cursor-pointer relative flex text-b3 items-center", {
|
|
44
44
|
"text-grey": e === "disabled",
|
|
45
45
|
"text-black": e !== "default"
|
|
46
46
|
}),
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ a("span", { className: "relative self-start me-8", children: [
|
|
49
|
+
/* @__PURE__ */ t(
|
|
50
50
|
"input",
|
|
51
51
|
{
|
|
52
|
-
...
|
|
53
|
-
name:
|
|
54
|
-
"data-testid":
|
|
52
|
+
...N,
|
|
53
|
+
name: o,
|
|
54
|
+
"data-testid": f,
|
|
55
55
|
type: "checkbox",
|
|
56
|
-
tabIndex:
|
|
56
|
+
tabIndex: k,
|
|
57
57
|
onChange: () => {
|
|
58
|
-
!r &&
|
|
58
|
+
!r && y(!d);
|
|
59
59
|
},
|
|
60
|
-
checked:
|
|
60
|
+
checked: d,
|
|
61
61
|
"data-name": "Checkbox",
|
|
62
62
|
disabled: r,
|
|
63
63
|
value: l
|
|
64
64
|
}
|
|
65
65
|
),
|
|
66
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ t(
|
|
67
67
|
"span",
|
|
68
68
|
{
|
|
69
69
|
style: { height: i, width: i },
|
|
70
|
-
className:
|
|
70
|
+
className: n({ "!border-red": e === "error" }),
|
|
71
71
|
"data-testid": `check-container-${s}`,
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
|
|
72
|
+
children: /* @__PURE__ */ t(
|
|
73
|
+
h,
|
|
74
74
|
{
|
|
75
75
|
name: "CheckDefault",
|
|
76
76
|
type: "svg",
|
|
@@ -82,13 +82,13 @@ function A(u) {
|
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
] }),
|
|
85
|
-
|
|
85
|
+
v
|
|
86
86
|
]
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
89
|
+
I && /* @__PURE__ */ a("span", { className: "text-red text-b4 flex items-start space-x-4 ps-20", role: "alert", children: [
|
|
90
|
+
/* @__PURE__ */ t(h, { name: "Error", width: "20px" }),
|
|
91
|
+
c
|
|
92
92
|
] })
|
|
93
93
|
]
|
|
94
94
|
}
|
|
@@ -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 { 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,GAA6B;AACpE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDhB,GAEE,EAAE,OAAOiB,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAf;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMa,GAAS;AACtB,MAAAF,
|
|
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,GAA6B;AACpE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDhB,GAEE,EAAE,OAAOiB,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAf;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMa,GAAS;AACtB,MAAAF,IAAWX,GAAMa,IAAYR,MAAU,SAAYA,IAAQQ,IAAqB,IAAI;AAAA,IACtF;AAAA,EAAA,CACD,GACKG,IAAiBC,EAAkB;AAAA,IACvC,YAAYd;AAAA,IACZ,kBAAAK;AAAA,EAAA,CACD,GAEKU,IAA4BF,MAAmB,WAAWP;AAEhE,SACE,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,2BAA2BnB,CAAS;AAAA,MAC1D,eAAa,sBAAsBF,CAAE;AAAA,MAErC,UAAA;AAAA,QAAA,gBAAAoB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC,EAAW,qDAAqD;AAAA,cACzE,aAAaJ,MAAmB;AAAA,cAChC,cAAcA,MAAmB;AAAA,YAAA,CAClC;AAAA,YAED,UAAA;AAAA,cAAA,gBAAAG,EAAC,QAAA,EAAK,WAAU,4BACd,UAAA;AAAA,gBAAA,gBAAAE;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACE,GAAGT;AAAA,oBACJ,MAAAZ;AAAA,oBACA,eAAaE;AAAA,oBACb,MAAK;AAAA,oBACL,UAAAK;AAAA,oBACA,UAAU,MAAM;AACd,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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { FormControlProps } from '../FormControl.js';
|
|
3
3
|
export interface CheckboxesProps<Value = string> extends Pick<FormControlProps<Value[]>, 'id' | 'name' | 'value' | 'onChange' | 'disabled' | 'readOnly' | 'tabIndex' | 'description' | 'validationStatus' | 'errorMessage'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
4
|
}
|
|
5
5
|
export declare function Checkboxes<Value = string>(props: CheckboxesProps<Value>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IconicNames, IconicTypes } from '@clubmed/trident-icons';
|
|
2
|
+
import { FormControlProps } from './FormControl.js';
|
|
3
3
|
interface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {
|
|
4
4
|
description?: string;
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as p, jsxs as
|
|
1
|
+
import { jsx as p, jsxs as C } 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
4
|
import { Icon as E } from "@clubmed/trident-icons";
|
|
@@ -25,7 +25,7 @@ function z(t) {
|
|
|
25
25
|
function G(t, e) {
|
|
26
26
|
return P(2, arguments), z(t).getTime() - z(e).getTime();
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function f(t, e) {
|
|
29
29
|
for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; )
|
|
30
30
|
r = "0" + r;
|
|
31
31
|
return n + r;
|
|
@@ -36,98 +36,97 @@ function W(t, e) {
|
|
|
36
36
|
var a = z(t);
|
|
37
37
|
if (isNaN(a.getTime()))
|
|
38
38
|
throw new RangeError("Invalid time value");
|
|
39
|
-
var
|
|
40
|
-
if (
|
|
39
|
+
var c = String((n = e?.format) !== null && n !== void 0 ? n : "extended"), i = String((r = e?.representation) !== null && r !== void 0 ? r : "complete");
|
|
40
|
+
if (c !== "extended" && c !== "basic")
|
|
41
41
|
throw new RangeError("format must be 'extended' or 'basic'");
|
|
42
42
|
if (i !== "date" && i !== "time" && i !== "complete")
|
|
43
43
|
throw new RangeError("representation must be 'date', 'time', or 'complete'");
|
|
44
|
-
var
|
|
44
|
+
var d = "", g = "", D = c === "extended" ? "-" : "", I = c === "extended" ? ":" : "";
|
|
45
45
|
if (i !== "time") {
|
|
46
|
-
var o =
|
|
47
|
-
|
|
46
|
+
var o = f(a.getDate(), 2), y = f(a.getMonth() + 1, 2), T = f(a.getFullYear(), 4);
|
|
47
|
+
d = "".concat(T).concat(D).concat(y).concat(D).concat(o);
|
|
48
48
|
}
|
|
49
49
|
if (i !== "date") {
|
|
50
50
|
var b = a.getTimezoneOffset();
|
|
51
51
|
if (b !== 0) {
|
|
52
|
-
var
|
|
53
|
-
g = "".concat(
|
|
52
|
+
var w = Math.abs(b), l = f(Math.floor(w / 60), 2), u = f(w % 60, 2), j = b < 0 ? "+" : "-";
|
|
53
|
+
g = "".concat(j).concat(l, ":").concat(u);
|
|
54
54
|
} else
|
|
55
55
|
g = "Z";
|
|
56
|
-
var F =
|
|
57
|
-
|
|
56
|
+
var F = f(a.getHours(), 2), x = f(a.getMinutes(), 2), S = f(a.getSeconds(), 2), M = d === "" ? "" : "T", s = [F, x, S].join(I);
|
|
57
|
+
d = "".concat(d).concat(M).concat(s).concat(g);
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return d;
|
|
60
60
|
}
|
|
61
61
|
const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e, n) => {
|
|
62
62
|
if (!t)
|
|
63
63
|
return !0;
|
|
64
|
-
const r = (i) => new Date(i.getFullYear(), i.getMonth(), i.getDate()), a = new Date(t),
|
|
65
|
-
return !(e &&
|
|
64
|
+
const r = (i) => new Date(i.getFullYear(), i.getMonth(), i.getDate()), a = new Date(t), c = r(a);
|
|
65
|
+
return !(e && c < r(e) || n && c > r(n));
|
|
66
66
|
}, se = (t) => {
|
|
67
67
|
const e = A(), {
|
|
68
68
|
id: n = e,
|
|
69
69
|
name: r = n,
|
|
70
70
|
label: a,
|
|
71
|
-
description:
|
|
71
|
+
description: c,
|
|
72
72
|
openDatepicker: i,
|
|
73
|
-
validationStatus:
|
|
73
|
+
validationStatus: d = "default",
|
|
74
74
|
icon: g = "CalendarDefault",
|
|
75
|
-
iconType:
|
|
76
|
-
errorMessage:
|
|
75
|
+
iconType: D,
|
|
76
|
+
errorMessage: I,
|
|
77
77
|
disabled: o = !1,
|
|
78
|
-
required:
|
|
79
|
-
hideRequiredStar:
|
|
78
|
+
required: y = !1,
|
|
79
|
+
hideRequiredStar: T,
|
|
80
80
|
dataTestId: b = "DateField",
|
|
81
|
-
value:
|
|
82
|
-
min:
|
|
83
|
-
max:
|
|
84
|
-
onChange:
|
|
81
|
+
value: w,
|
|
82
|
+
min: l,
|
|
83
|
+
max: u,
|
|
84
|
+
onChange: j,
|
|
85
85
|
...F
|
|
86
|
-
} = t,
|
|
86
|
+
} = t, x = B(null), [S, M] = H(!1), s = Q({
|
|
87
87
|
isDisabled: o,
|
|
88
|
-
validationStatus:
|
|
89
|
-
}), { setValue:
|
|
88
|
+
validationStatus: d
|
|
89
|
+
}), { setValue: v, value: h } = K({
|
|
90
90
|
name: r,
|
|
91
91
|
formatter: O,
|
|
92
|
-
initialValue:
|
|
93
|
-
onChange: (
|
|
94
|
-
}),
|
|
95
|
-
|
|
92
|
+
initialValue: w,
|
|
93
|
+
onChange: (m, R) => j?.(m, new Date(R))
|
|
94
|
+
}), N = O(l), k = O(u), Y = (m) => {
|
|
95
|
+
v(m.target.value);
|
|
96
96
|
}, Z = () => {
|
|
97
|
-
|
|
98
|
-
(c = S.current) == null || c.showPicker();
|
|
97
|
+
x.current?.showPicker();
|
|
99
98
|
}, _ = L(() => {
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
const R = Math.abs(G(
|
|
103
|
-
|
|
99
|
+
const m = new Date(h);
|
|
100
|
+
if (l && u) {
|
|
101
|
+
const R = Math.abs(G(m, l)), $ = Math.abs(G(m, u));
|
|
102
|
+
v(R <= $ ? N : k);
|
|
104
103
|
return;
|
|
105
104
|
}
|
|
106
|
-
if (
|
|
107
|
-
|
|
105
|
+
if (l) {
|
|
106
|
+
v(N);
|
|
108
107
|
return;
|
|
109
108
|
}
|
|
110
|
-
if (
|
|
111
|
-
|
|
109
|
+
if (u) {
|
|
110
|
+
v(k);
|
|
112
111
|
return;
|
|
113
112
|
}
|
|
114
|
-
}, [
|
|
113
|
+
}, [u, l, k, N, v, h]);
|
|
115
114
|
return J(() => {
|
|
116
|
-
!X(
|
|
117
|
-
}, [_,
|
|
115
|
+
!X(h, l, u) && !S && _();
|
|
116
|
+
}, [_, u, l, S, h]), /* @__PURE__ */ p(
|
|
118
117
|
U,
|
|
119
118
|
{
|
|
120
119
|
id: n,
|
|
121
120
|
label: a,
|
|
122
|
-
description:
|
|
121
|
+
description: c,
|
|
123
122
|
dataName: "DateField",
|
|
124
123
|
dataTestId: b,
|
|
125
124
|
disabled: o,
|
|
126
|
-
required:
|
|
127
|
-
hideRequiredStar:
|
|
128
|
-
validationStatus:
|
|
129
|
-
errorMessage:
|
|
130
|
-
children: /* @__PURE__ */
|
|
125
|
+
required: y,
|
|
126
|
+
hideRequiredStar: T,
|
|
127
|
+
validationStatus: d,
|
|
128
|
+
errorMessage: I,
|
|
129
|
+
children: /* @__PURE__ */ C("div", { className: "relative", children: [
|
|
131
130
|
/* @__PURE__ */ p(
|
|
132
131
|
"input",
|
|
133
132
|
{
|
|
@@ -146,17 +145,17 @@ const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e,
|
|
|
146
145
|
),
|
|
147
146
|
id: n,
|
|
148
147
|
disabled: o,
|
|
149
|
-
required:
|
|
150
|
-
ref:
|
|
151
|
-
value:
|
|
152
|
-
min:
|
|
153
|
-
max:
|
|
148
|
+
required: y,
|
|
149
|
+
ref: x,
|
|
150
|
+
value: h,
|
|
151
|
+
min: N,
|
|
152
|
+
max: k,
|
|
154
153
|
onChange: Y,
|
|
155
|
-
onFocus: () =>
|
|
156
|
-
onBlur: () =>
|
|
154
|
+
onFocus: () => M(!0),
|
|
155
|
+
onBlur: () => M(!1)
|
|
157
156
|
}
|
|
158
157
|
),
|
|
159
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ C(
|
|
160
159
|
"div",
|
|
161
160
|
{
|
|
162
161
|
className: q(
|
|
@@ -168,11 +167,11 @@ const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e,
|
|
|
168
167
|
}
|
|
169
168
|
),
|
|
170
169
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */ p(E, { name: g, iconType:
|
|
170
|
+
/* @__PURE__ */ C("button", { className: "pointer-events-auto leading-none", onClick: Z, children: [
|
|
171
|
+
/* @__PURE__ */ p(E, { name: g, iconType: D, width: "24px" }),
|
|
173
172
|
/* @__PURE__ */ p("span", { className: "sr-only", children: i })
|
|
174
173
|
] }),
|
|
175
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ C("span", { className: "ms-auto flex gap-x-8", children: [
|
|
176
175
|
s === "error" && /* @__PURE__ */ p(E, { name: "CrossDefault", width: "24px" }),
|
|
177
176
|
s === "success" && /* @__PURE__ */ p(E, { name: "CheckDefault", width: "24px" })
|
|
178
177
|
] })
|