@clubmed/trident-ui 1.3.0-beta.12 → 1.3.0-beta.13
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/.npm/_logs/2025-08-08T15_19_22_167Z-debug-0.log +19 -0
- package/.npm/_logs/2025-08-08T15_19_22_257Z-debug-0.log +14 -0
- package/CHANGELOG.md +7 -0
- package/README.md +8 -0
- package/assets/{style.css → trident-ui.css} +1 -1
- package/atoms/Clickable/Clickable.d.ts +2 -2
- package/atoms/Heading/Heading.d.ts +1 -1
- package/atoms/Heading/HeadingGroup.d.ts +2 -2
- 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 +1 -1
- package/atoms/Image/Image.js +12 -12
- package/atoms/Image/Image.js.map +1 -1
- package/atoms/Prose/Prose.d.ts +2 -2
- package/chunks/ResizeObserver.js +1 -1
- package/chunks/ResizeObserver.js.map +1 -1
- 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 +1 -1
- package/hooks/useKeyboardControls.d.ts +1 -1
- package/hooks/useResizeObserver.d.ts +1 -1
- 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 +2 -3
- package/molecules/Breadcrumb.js +25 -36
- package/molecules/Breadcrumb.js.map +1 -1
- package/molecules/Breadcrumb.themes.d.ts +1 -1
- package/molecules/Buttons/ArrowButton.d.ts +1 -1
- package/molecules/Buttons/Button.d.ts +3 -3
- package/molecules/Buttons/ButtonAnchor.d.ts +2 -2
- package/molecules/Buttons/ButtonContent.d.ts +2 -2
- package/molecules/Buttons/FakeButton.d.ts +2 -3
- package/molecules/Buttons/InertButton.d.ts +2 -2
- package/molecules/Buttons/v2/Button.d.ts +2081 -2082
- package/molecules/Buttons/v2/Button.type.d.ts +2 -2
- package/molecules/Cards/Card.d.ts +4 -4
- package/molecules/Cards/CardBackground.d.ts +2 -2
- package/molecules/Cards/CardBackground.js +17 -17
- package/molecules/Cards/CardBackground.js.map +1 -1
- package/molecules/Cards/CardBackgroundContext.d.ts +1 -1
- package/molecules/Cards/CardClickable.d.ts +1 -1
- package/molecules/Cards/ExpandableCard.d.ts +3 -3
- package/molecules/Cards/ExpandableCard.js +41 -41
- package/molecules/Cards/ExpandableCard.js.map +1 -1
- package/molecules/Cards/v2/Card.d.ts +1 -1
- package/molecules/Cards/v2/Card.js +13 -13
- package/molecules/Cards/v2/Card.js.map +1 -1
- package/molecules/Chip.d.ts +3 -3
- package/molecules/Chip.themes.d.ts +1 -1
- package/molecules/ElasticHeight.d.ts +1 -1
- package/molecules/ElasticHeight.js +20 -21
- 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 +278 -278
- 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 +1 -2
- package/molecules/Forms/Radios/Radio.js +30 -30
- package/molecules/Forms/Radios/Radio.js.map +1 -1
- package/molecules/Forms/Radios/RadioGroup.d.ts +2 -2
- package/molecules/Forms/Radios/RadioGroup.js +50 -52
- package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
- package/molecules/Forms/Range.d.ts +1 -2
- package/molecules/Forms/Range.js +118 -113
- 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 +4 -4
- package/package.json +29 -32
- 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/tests/helpers/device.d.ts +14 -0
- package/tests/helpers/device.js +13426 -0
- package/tests/helpers/device.js.map +1 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import useResizeObserver from 'use-resize-observer';
|
|
1
|
+
import { default as useResizeObserver } from 'use-resize-observer';
|
|
2
2
|
export default useResizeObserver;
|
package/hooks/useSafeBoop.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import useBoop from 'use-boop';
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { default as useBoop } from 'use-boop';
|
|
3
3
|
type Args = Parameters<typeof useBoop>[0];
|
|
4
4
|
export declare const useSafeBoop: (boopArgs: Args) => [CSSProperties, () => void];
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ComponentProps, ComponentPropsWithoutRef, FunctionComponent } from 'react';
|
|
2
|
+
import { ArrowsLabels } from './ArrowsLabels';
|
|
3
3
|
import { ArrowButton } from '../Buttons/ArrowButton';
|
|
4
4
|
export interface ArrowsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
5
5
|
color?: ComponentProps<typeof ArrowButton>['color'];
|
package/molecules/Avatar.d.ts
CHANGED
package/molecules/Avatar.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { jsx as l, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { c as u } from "../chunks/index.js";
|
|
3
|
+
const a = (e = "") => e.split(" ").map((t) => t.slice(0, 1)).join("");
|
|
4
|
+
function p({
|
|
5
5
|
alt: e,
|
|
6
|
-
src:
|
|
6
|
+
src: t,
|
|
7
7
|
srcSet: n,
|
|
8
|
-
style:
|
|
9
|
-
children:
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
8
|
+
style: r,
|
|
9
|
+
children: o,
|
|
10
|
+
className: i,
|
|
11
|
+
...s
|
|
12
12
|
}) {
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ l(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
|
-
...
|
|
17
|
-
...
|
|
18
|
-
className:
|
|
16
|
+
...s,
|
|
17
|
+
...t || n ? { role: "figure", "aria-label": e } : {},
|
|
18
|
+
className: u(
|
|
19
19
|
"flex items-center justify-center relative overflow-hidden",
|
|
20
20
|
{
|
|
21
|
-
"rounded-full": !
|
|
22
|
-
"text-black": !
|
|
23
|
-
"bg-saffron": !
|
|
21
|
+
"rounded-full": !i?.includes("rounded-"),
|
|
22
|
+
"text-black": !i?.includes("text-"),
|
|
23
|
+
"bg-saffron": !i?.includes("bg-")
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
i
|
|
26
26
|
),
|
|
27
27
|
style: {
|
|
28
28
|
width: "48px",
|
|
29
29
|
height: "48px",
|
|
30
|
-
...
|
|
30
|
+
...r
|
|
31
31
|
},
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
children: /* @__PURE__ */ f("span", { className: "flex items-center justify-center font-bold uppercase text-h6 h-full", children: [
|
|
33
|
+
t || n ? /* @__PURE__ */ l(
|
|
34
34
|
"img",
|
|
35
35
|
{
|
|
36
36
|
srcSet: n,
|
|
37
|
-
src:
|
|
37
|
+
src: t,
|
|
38
38
|
alt: e,
|
|
39
39
|
className: "w-full h-full object-cover transparent indent-[1000px]"
|
|
40
40
|
}
|
|
41
|
-
) :
|
|
42
|
-
|
|
41
|
+
) : a(e),
|
|
42
|
+
o
|
|
43
43
|
] })
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
p as Avatar
|
|
49
49
|
};
|
|
50
50
|
//# sourceMappingURL=Avatar.js.map
|
package/molecules/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../lib/molecules/Avatar.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport classnames from 'classnames';\n\nconst initial = (text = '') => {\n return text\n .split(' ')\n .map((text) => text.slice(0, 1))\n .join('');\n};\n\ninterface AvatarProps extends HTMLAttributes<HTMLDivElement> {\n alt?: string;\n src?: string | undefined;\n srcSet?: string | undefined;\n}\n\nexport function Avatar({\n alt,\n src,\n srcSet,\n style,\n children,\n className,\n ...props\n}: PropsWithChildren<AvatarProps>) {\n return (\n <div\n {...props}\n {...(src || srcSet ? { role: 'figure', 'aria-label': alt } : {})}\n className={classnames(\n 'flex items-center justify-center relative overflow-hidden',\n {\n 'rounded-full': !className?.includes('rounded-'),\n 'text-black': !className?.includes('text-'),\n 'bg-saffron': !className?.includes('bg-'),\n },\n className,\n )}\n style={{\n width: '48px',\n height: '48px',\n ...style,\n }}\n >\n <span className=\"flex items-center justify-center font-bold uppercase text-h6 h-full\">\n {src || srcSet ? (\n <img\n srcSet={srcSet}\n src={src}\n alt={alt}\n className={'w-full h-full object-cover transparent indent-[1000px]'}\n />\n ) : (\n initial(alt)\n )}\n {children}\n </span>\n </div>\n );\n}\n"],"names":["initial","text","Avatar","alt","src","srcSet","style","children","className","props","jsx","classnames","jsxs"],"mappings":";;AAGA,MAAMA,IAAU,CAACC,IAAO,OACfA,EACJ,MAAM,GAAG,EACT,IAAI,CAACA,MAASA,EAAK,MAAM,GAAG,CAAC,CAAC,EAC9B,KAAK,EAAE;AASL,SAASC,EAAO;AAAA,EACrB,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACH,GAAIL,KAAOC,IAAS,EAAE,MAAM,UAAU,cAAcF,EAAA,IAAQ,CAAA;AAAA,MAC7D,WAAWQ;AAAA,QACT;AAAA,QACA;AAAA,UACE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../lib/molecules/Avatar.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport classnames from 'classnames';\n\nconst initial = (text = '') => {\n return text\n .split(' ')\n .map((text) => text.slice(0, 1))\n .join('');\n};\n\ninterface AvatarProps extends HTMLAttributes<HTMLDivElement> {\n alt?: string;\n src?: string | undefined;\n srcSet?: string | undefined;\n}\n\nexport function Avatar({\n alt,\n src,\n srcSet,\n style,\n children,\n className,\n ...props\n}: PropsWithChildren<AvatarProps>) {\n return (\n <div\n {...props}\n {...(src || srcSet ? { role: 'figure', 'aria-label': alt } : {})}\n className={classnames(\n 'flex items-center justify-center relative overflow-hidden',\n {\n 'rounded-full': !className?.includes('rounded-'),\n 'text-black': !className?.includes('text-'),\n 'bg-saffron': !className?.includes('bg-'),\n },\n className,\n )}\n style={{\n width: '48px',\n height: '48px',\n ...style,\n }}\n >\n <span className=\"flex items-center justify-center font-bold uppercase text-h6 h-full\">\n {src || srcSet ? (\n <img\n srcSet={srcSet}\n src={src}\n alt={alt}\n className={'w-full h-full object-cover transparent indent-[1000px]'}\n />\n ) : (\n initial(alt)\n )}\n {children}\n </span>\n </div>\n );\n}\n"],"names":["initial","text","Avatar","alt","src","srcSet","style","children","className","props","jsx","classnames","jsxs"],"mappings":";;AAGA,MAAMA,IAAU,CAACC,IAAO,OACfA,EACJ,MAAM,GAAG,EACT,IAAI,CAACA,MAASA,EAAK,MAAM,GAAG,CAAC,CAAC,EAC9B,KAAK,EAAE;AASL,SAASC,EAAO;AAAA,EACrB,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACH,GAAIL,KAAOC,IAAS,EAAE,MAAM,UAAU,cAAcF,EAAA,IAAQ,CAAA;AAAA,MAC7D,WAAWQ;AAAA,QACT;AAAA,QACA;AAAA,UACE,gBAAgB,CAACH,GAAW,SAAS,UAAU;AAAA,UAC/C,cAAc,CAACA,GAAW,SAAS,OAAO;AAAA,UAC1C,cAAc,CAACA,GAAW,SAAS,KAAK;AAAA,QAAA;AAAA,QAE1CA;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,GAAGF;AAAA,MAAA;AAAA,MAGL,UAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,uEACb,UAAA;AAAA,QAAAR,KAAOC,IACN,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,QAAAL;AAAA,YACA,KAAAD;AAAA,YACA,KAAAD;AAAA,YACA,WAAW;AAAA,UAAA;AAAA,QAAA,IAGbH,EAAQG,CAAG;AAAA,QAEZI;AAAA,MAAA,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/molecules/Backdrop.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import './Breadcrumb.css';
|
|
1
|
+
import { ComponentPropsWithoutRef, FunctionComponent } from 'react';
|
|
2
|
+
import { Theme } from '../types/Theme';
|
|
4
3
|
export interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {
|
|
5
4
|
items: ({
|
|
6
5
|
href: string;
|
package/molecules/Breadcrumb.js
CHANGED
|
@@ -1,61 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createElement as
|
|
3
|
-
import { c as
|
|
4
|
-
import { getTheme as
|
|
5
|
-
import { Icon as
|
|
6
|
-
const
|
|
7
|
-
className:
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as k } from "react";
|
|
3
|
+
import { c as l } from "../chunks/index.js";
|
|
4
|
+
import { getTheme as w } from "./Breadcrumb.themes.js";
|
|
5
|
+
import { Icon as B } from "@clubmed/trident-icons";
|
|
6
|
+
const j = ({
|
|
7
|
+
className: m,
|
|
8
8
|
items: e,
|
|
9
|
-
theme:
|
|
10
|
-
...
|
|
9
|
+
theme: i = "light",
|
|
10
|
+
...h
|
|
11
11
|
}) => {
|
|
12
12
|
if (e.length == 0)
|
|
13
13
|
return null;
|
|
14
|
-
const [d,
|
|
15
|
-
return /* @__PURE__ */
|
|
14
|
+
const [d, f, , ...t] = e, p = t.length ? t[t.length - 1] : e[e.length - 1], g = { label: "", href: "", className: "breadcrumb-spacer" }, s = t.length ? [d, f, g, p] : e, { thStart: u, thEnd: b } = w(i);
|
|
15
|
+
return /* @__PURE__ */ a(
|
|
16
16
|
"nav",
|
|
17
17
|
{
|
|
18
18
|
role: "navigation",
|
|
19
19
|
"aria-label": "Breadcrumb",
|
|
20
|
-
...
|
|
21
|
-
className:
|
|
20
|
+
...h,
|
|
21
|
+
className: l(m, "overflow-hidden"),
|
|
22
22
|
"data-name": "Breadcrumb",
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
const r =
|
|
25
|
-
return /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ a("ol", { className: "scrollbar-hidden flex items-center overflow-x-auto font-sans text-b4", children: s.map(({ label: n, href: o, className: x, ...N }, c) => {
|
|
24
|
+
const r = c === s.length - 1, v = o && !r;
|
|
25
|
+
return /* @__PURE__ */ k(
|
|
26
26
|
"li",
|
|
27
27
|
{
|
|
28
|
-
...
|
|
28
|
+
...N,
|
|
29
29
|
...r && { "aria-current": "page" },
|
|
30
|
-
className:
|
|
30
|
+
className: l(
|
|
31
31
|
"flex shrink-0 items-center",
|
|
32
32
|
{
|
|
33
|
-
[
|
|
34
|
-
[
|
|
33
|
+
[u]: !r,
|
|
34
|
+
[b]: r
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
x
|
|
37
37
|
),
|
|
38
|
-
key: n
|
|
38
|
+
key: `${n}-${c}`
|
|
39
39
|
},
|
|
40
|
-
v ? /* @__PURE__ */
|
|
41
|
-
!r && /* @__PURE__ */
|
|
42
|
-
w,
|
|
43
|
-
{
|
|
44
|
-
"data-testid": "BreadcrumbIcon",
|
|
45
|
-
className: "mx-4",
|
|
46
|
-
name: "Diamond",
|
|
47
|
-
width: "14px",
|
|
48
|
-
"aria-hidden": "true",
|
|
49
|
-
"aria-label": null,
|
|
50
|
-
role: null
|
|
51
|
-
}
|
|
52
|
-
)
|
|
40
|
+
v ? /* @__PURE__ */ a("a", { href: o, children: n }) : n,
|
|
41
|
+
!r && /* @__PURE__ */ a(B, { className: "mx-4", name: "Diamond", width: "14px" })
|
|
53
42
|
);
|
|
54
43
|
}) })
|
|
55
44
|
}
|
|
56
45
|
);
|
|
57
46
|
};
|
|
58
47
|
export {
|
|
59
|
-
|
|
48
|
+
j as Breadcrumb
|
|
60
49
|
};
|
|
61
50
|
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { ComponentPropsWithoutRef, FunctionComponent } from 'react';\n\nimport { getTheme } from './Breadcrumb.themes';\n\nimport type { Theme } from '@/types/Theme';\nimport { Icon } from '@clubmed/trident-icons';\nimport './Breadcrumb.css';\n\nexport interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {\n items: ({\n href: string;\n label: string;\n } & ComponentPropsWithoutRef<'li'>)[];\n theme?: Theme;\n}\n\nexport const Breadcrumb: FunctionComponent<BreadcrumbProps> = ({\n className,\n items,\n theme = 'light',\n ...attrs\n}) => {\n if (items.length == 0) {\n return null;\n }\n\n const [first, second, , ...rest] = items;\n const lastItem = rest.length ? rest[rest.length - 1] : items[items.length - 1];\n const spacer = { label: '', href: '', className: 'breadcrumb-spacer' };\n const itemsToRender = !rest.length ? items : [first, second, spacer, lastItem];\n\n const { thStart, thEnd } = getTheme(theme);\n\n return (\n <nav\n role=\"navigation\"\n aria-label=\"Breadcrumb\"\n {...attrs}\n className={classnames(className, 'overflow-hidden')}\n data-name=\"Breadcrumb\"\n >\n <ol className=\"scrollbar-hidden flex items-center overflow-x-auto font-sans text-b4\">\n {itemsToRender.map(({ label, href, className, ...attrs }, index) => {\n const isLast = index === itemsToRender.length - 1;\n const isLink = href && !isLast;\n return (\n <li\n {...attrs}\n {...(isLast && { 'aria-current': 'page' })}\n className={classnames(\n 'flex shrink-0 items-center',\n {\n [thStart]: !isLast,\n [thEnd]: isLast,\n },\n className,\n )}\n key={label}\n >\n {isLink ? <a href={href}>{label}</a> : label}\n {!isLast &&
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../lib/molecules/Breadcrumb.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { ComponentPropsWithoutRef, FunctionComponent } from 'react';\n\nimport { getTheme } from './Breadcrumb.themes';\n\nimport type { Theme } from '@/types/Theme';\nimport { Icon } from '@clubmed/trident-icons';\nimport './Breadcrumb.css';\n\nexport interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {\n items: ({\n href: string;\n label: string;\n } & ComponentPropsWithoutRef<'li'>)[];\n theme?: Theme;\n}\n\nexport const Breadcrumb: FunctionComponent<BreadcrumbProps> = ({\n className,\n items,\n theme = 'light',\n ...attrs\n}) => {\n if (items.length == 0) {\n return null;\n }\n\n const [first, second, , ...rest] = items;\n const lastItem = rest.length ? rest[rest.length - 1] : items[items.length - 1];\n const spacer = { label: '', href: '', className: 'breadcrumb-spacer' };\n const itemsToRender = !rest.length ? items : [first, second, spacer, lastItem];\n\n const { thStart, thEnd } = getTheme(theme);\n\n return (\n <nav\n role=\"navigation\"\n aria-label=\"Breadcrumb\"\n {...attrs}\n className={classnames(className, 'overflow-hidden')}\n data-name=\"Breadcrumb\"\n >\n <ol className=\"scrollbar-hidden flex items-center overflow-x-auto font-sans text-b4\">\n {itemsToRender.map(({ label, href, className, ...attrs }, index) => {\n const isLast = index === itemsToRender.length - 1;\n const isLink = href && !isLast;\n return (\n <li\n {...attrs}\n {...(isLast && { 'aria-current': 'page' })}\n className={classnames(\n 'flex shrink-0 items-center',\n {\n [thStart]: !isLast,\n [thEnd]: isLast,\n },\n className,\n )}\n key={`${label}-${index}`}\n >\n {isLink ? <a href={href}>{label}</a> : label}\n {!isLast && <Icon className=\"mx-4\" name=\"Diamond\" width=\"14px\" />}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"names":["Breadcrumb","className","items","theme","attrs","first","second","rest","lastItem","spacer","itemsToRender","thStart","thEnd","getTheme","jsx","classnames","label","href","index","isLast","isLink","createElement","Icon"],"mappings":";;;;;AAiBO,MAAMA,IAAiD,CAAC;AAAA,EAC7D,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,GAAGC;AACL,MAAM;AACJ,MAAIF,EAAM,UAAU;AAClB,WAAO;AAGT,QAAM,CAACG,GAAOC,KAAU,GAAGC,CAAI,IAAIL,GAC7BM,IAAWD,EAAK,SAASA,EAAKA,EAAK,SAAS,CAAC,IAAIL,EAAMA,EAAM,SAAS,CAAC,GACvEO,IAAS,EAAE,OAAO,IAAI,MAAM,IAAI,WAAW,oBAAA,GAC3CC,IAAiBH,EAAK,SAAiB,CAACF,GAAOC,GAAQG,GAAQD,CAAQ,IAAxCN,GAE/B,EAAE,SAAAS,GAAS,OAAAC,MAAUC,EAASV,CAAK;AAEzC,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAW;AAAA,MACV,GAAGV;AAAA,MACJ,WAAWW,EAAWd,GAAW,iBAAiB;AAAA,MAClD,aAAU;AAAA,MAEV,UAAA,gBAAAa,EAAC,MAAA,EAAG,WAAU,wEACX,YAAc,IAAI,CAAC,EAAE,OAAAE,GAAO,MAAAC,GAAM,WAAAhB,GAAW,GAAGG,EAAAA,GAASc,MAAU;AAClE,cAAMC,IAASD,MAAUR,EAAc,SAAS,GAC1CU,IAASH,KAAQ,CAACE;AACxB,eACE,gBAAAE;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGjB;AAAAA,YACH,GAAIe,KAAU,EAAE,gBAAgB,OAAA;AAAA,YACjC,WAAWJ;AAAA,cACT;AAAA,cACA;AAAA,gBACE,CAACJ,CAAO,GAAG,CAACQ;AAAA,gBACZ,CAACP,CAAK,GAAGO;AAAA,cAAA;AAAA,cAEXlB;AAAAA,YAAA;AAAA,YAEF,KAAK,GAAGe,CAAK,IAAIE,CAAK;AAAA,UAAA;AAAA,UAErBE,IAAS,gBAAAN,EAAC,KAAA,EAAE,MAAAG,GAAa,aAAM,IAAOD;AAAA,UACtC,CAACG,KAAU,gBAAAL,EAACQ,GAAA,EAAK,WAAU,QAAO,MAAK,WAAU,OAAM,OAAA,CAAO;AAAA,QAAA;AAAA,MAGrE,CAAC,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, FunctionComponent } from 'react';
|
|
2
2
|
import { Button } from './Button';
|
|
3
3
|
interface Props extends ComponentProps<typeof Button> {
|
|
4
4
|
icon: 'ArrowDefaultLeft' | 'ArrowDefaultRight' | 'ArrowTailLeft' | 'ArrowTailRight';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { ButtonHTMLAttributes, FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps as ButtonPropsV2 } from './v2/Button.js';
|
|
3
|
+
import { 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,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';
|
|
2
|
+
import { CommonButtonProps } from './Button';
|
|
3
3
|
type ButtonAnchorProps = CommonButtonProps & {
|
|
4
4
|
component?: FunctionComponent<PropsWithChildren<any>> | string;
|
|
5
5
|
} & AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { IconicNames, IconicTypes } from '@clubmed/trident-icons';
|
|
3
3
|
export type ButtonContentProps = {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './v2/Button
|
|
3
|
-
import { type FakeButtonProps } from './v2/Button';
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { FakeButtonProps } from './v2/Button';
|
|
4
3
|
/**
|
|
5
4
|
* @deprecated use Button with `component="span"` instead
|
|
6
5
|
* @param props
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { CommonButtonProps } from './Button';
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated use Button with `component="span"` instead
|
|
5
5
|
* @param props
|