@payfit/unity-components 2.12.10 → 2.13.0
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/dist/esm/components/timeline/Timeline.context.d.ts +16 -0
- package/dist/esm/components/timeline/Timeline.context.js +23 -0
- package/dist/esm/components/timeline/Timeline.d.ts +49 -0
- package/dist/esm/components/timeline/Timeline.js +37 -0
- package/dist/esm/components/timeline/Timeline.utils.d.ts +7 -0
- package/dist/esm/components/timeline/Timeline.utils.js +9 -0
- package/dist/esm/components/timeline/Timeline.variants.d.ts +169 -0
- package/dist/esm/components/timeline/Timeline.variants.js +121 -0
- package/dist/esm/components/timeline/parts/TimelineMarker.d.ts +22 -0
- package/dist/esm/components/timeline/parts/TimelineMarker.js +26 -0
- package/dist/esm/components/timeline/parts/TimelineStep.context.d.ts +13 -0
- package/dist/esm/components/timeline/parts/TimelineStep.context.js +21 -0
- package/dist/esm/components/timeline/parts/TimelineStep.d.ts +38 -0
- package/dist/esm/components/timeline/parts/TimelineStep.js +52 -0
- package/dist/esm/components/timeline/parts/TimelineStepContent.context.d.ts +18 -0
- package/dist/esm/components/timeline/parts/TimelineStepContent.context.js +22 -0
- package/dist/esm/components/timeline/parts/TimelineStepContent.d.ts +27 -0
- package/dist/esm/components/timeline/parts/TimelineStepContent.js +18 -0
- package/dist/esm/components/timeline/parts/TimelineStepDescription.d.ts +11 -0
- package/dist/esm/components/timeline/parts/TimelineStepDescription.js +8 -0
- package/dist/esm/components/timeline/parts/TimelineStepHeader.d.ts +24 -0
- package/dist/esm/components/timeline/parts/TimelineStepHeader.js +37 -0
- package/dist/esm/components/timeline/parts/check.svg.js +5 -0
- package/dist/esm/hooks/use-breakpoint-listener.d.ts +34 -0
- package/dist/esm/hooks/use-breakpoint-listener.js +17 -5
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +329 -317
- package/i18n/en-GB.json +4 -0
- package/i18n/es-ES.json +4 -0
- package/i18n/fr-FR.json +4 -0
- package/package.json +7 -7
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { useTimelineContext as l } from "../Timeline.context.js";
|
|
4
|
+
import { useIsHorizontalDesktop as a } from "../Timeline.utils.js";
|
|
5
|
+
import { timelineContent as f } from "../Timeline.variants.js";
|
|
6
|
+
import { TimelineStepContentProvider as c } from "./TimelineStepContent.context.js";
|
|
7
|
+
const C = d(({ className: o, children: r, statusSlot: e, actionSlot: n }, t) => {
|
|
8
|
+
const { orientation: m } = l(), p = a();
|
|
9
|
+
return /* @__PURE__ */ i(c, { statusSlot: e, children: /* @__PURE__ */ s("div", { ref: t, className: f({ orientation: m, className: o }), children: [
|
|
10
|
+
r,
|
|
11
|
+
p && e && /* @__PURE__ */ i("div", { "aria-hidden": "true", children: e }),
|
|
12
|
+
n
|
|
13
|
+
] }) });
|
|
14
|
+
});
|
|
15
|
+
C.displayName = "TimelineStepContent";
|
|
16
|
+
export {
|
|
17
|
+
C as TimelineStepContent
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type TimelineStepDescriptionProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Description text
|
|
5
|
+
*/
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* TimelineStepDescription displays detailed description for a timeline step
|
|
10
|
+
*/
|
|
11
|
+
export declare const TimelineStepDescription: import('react').ForwardRefExoticComponent<TimelineStepDescriptionProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { Text as i } from "../../text/Text.js";
|
|
4
|
+
const n = t(({ children: r }, e) => /* @__PURE__ */ o(i, { ref: e, variant: "body", color: "content.neutral", children: r }));
|
|
5
|
+
n.displayName = "TimelineStepDescription";
|
|
6
|
+
export {
|
|
7
|
+
n as TimelineStepDescription
|
|
8
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextProps } from '../../text/Text.js';
|
|
3
|
+
export type TimelineStepHeaderProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Label title
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional subtitle
|
|
10
|
+
*/
|
|
11
|
+
subtitle?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Optional header element type
|
|
14
|
+
* @default h3
|
|
15
|
+
*/
|
|
16
|
+
asHeader?: Extract<TextProps['asElement'], 'h3' | 'h4' | 'h5' | 'h6'>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* TimelineStepHeader groups title and subtitle together with no gap
|
|
20
|
+
* This matches the Figma design "Label container"
|
|
21
|
+
* The statusSlot from TimelineStepContent is displayed next to the title in vertical orientation
|
|
22
|
+
* or horizontal mobile, but not in horizontal desktop (where it appears at the bottom)
|
|
23
|
+
*/
|
|
24
|
+
export declare const TimelineStepHeader: import('react').ForwardRefExoticComponent<TimelineStepHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import { Text as l } from "../../text/Text.js";
|
|
4
|
+
import { useIsHorizontalDesktop as d } from "../Timeline.utils.js";
|
|
5
|
+
import { useTimelineStepContext as c } from "./TimelineStep.context.js";
|
|
6
|
+
import { useTimelineStepContentContext as p } from "./TimelineStepContent.context.js";
|
|
7
|
+
const f = u(({ title: i, subtitle: t, asHeader: n = "h3" }, s) => {
|
|
8
|
+
const { statusSlot: o } = p(), { labelId: a } = c(), m = !d() && o;
|
|
9
|
+
return /* @__PURE__ */ r(
|
|
10
|
+
"header",
|
|
11
|
+
{
|
|
12
|
+
ref: s,
|
|
13
|
+
className: "uy:flex uy:flex-col uy:gap-0 uy:items-start uy:w-full",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ r("div", { className: "uy:flex uy:gap-100 uy:items-start uy:w-full", children: [
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
l,
|
|
18
|
+
{
|
|
19
|
+
variant: "bodyStrong",
|
|
20
|
+
color: "content.neutral",
|
|
21
|
+
className: "uy:flex-1",
|
|
22
|
+
asElement: n,
|
|
23
|
+
id: a,
|
|
24
|
+
children: i
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
m && /* @__PURE__ */ e("div", { "aria-hidden": "true", children: o })
|
|
28
|
+
] }),
|
|
29
|
+
t && /* @__PURE__ */ e(l, { variant: "bodySmall", color: "content.neutral.lowest", children: t })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
f.displayName = "TimelineStepHeader";
|
|
35
|
+
export {
|
|
36
|
+
f as TimelineStepHeader
|
|
37
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const l = (t) => /* @__PURE__ */ e.createElement("svg", { fill: "none", height: 20, viewBox: "0 0 20 20", width: 20, xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("g", { id: "check" }, /* @__PURE__ */ e.createElement("path", { clipRule: "evenodd", d: "M16.0669 5.80806C16.311 6.05214 16.311 6.44786 16.0669 6.69194L8.56694 14.1919C8.32286 14.436 7.92714 14.436 7.68306 14.1919L4.55806 11.0669C4.31398 10.8229 4.31398 10.4271 4.55806 10.1831C4.80214 9.93898 5.19786 9.93898 5.44194 10.1831L8.125 12.8661L15.1831 5.80806C15.4271 5.56398 15.8229 5.56398 16.0669 5.80806Z", fill: "white", fillRule: "evenodd", id: "Vector" })));
|
|
3
|
+
export {
|
|
4
|
+
l as default
|
|
5
|
+
};
|
|
@@ -1,2 +1,36 @@
|
|
|
1
1
|
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
2
|
export declare function useBreakpointListener(): Breakpoint;
|
|
3
|
+
/**
|
|
4
|
+
* Desktop breakpoints (md, lg, xl)
|
|
5
|
+
*/
|
|
6
|
+
export declare const DESKTOP_BREAKPOINTS: readonly ["md", "lg", "xl"];
|
|
7
|
+
/**
|
|
8
|
+
* Mobile breakpoints (xs, sm)
|
|
9
|
+
*/
|
|
10
|
+
export declare const MOBILE_BREAKPOINTS: readonly ["xs", "sm"];
|
|
11
|
+
/**
|
|
12
|
+
* Desktop breakpoint type
|
|
13
|
+
*/
|
|
14
|
+
export type DesktopBreakpoint = (typeof DESKTOP_BREAKPOINTS)[number];
|
|
15
|
+
/**
|
|
16
|
+
* Mobile breakpoint type
|
|
17
|
+
*/
|
|
18
|
+
export type MobileBreakpoint = (typeof MOBILE_BREAKPOINTS)[number];
|
|
19
|
+
/**
|
|
20
|
+
* Type guard to check if a breakpoint is a desktop breakpoint (md, lg, xl)
|
|
21
|
+
* @example
|
|
22
|
+
* const breakpoint = useBreakpointListener()
|
|
23
|
+
* if (isDesktopBreakpoint(breakpoint)) {
|
|
24
|
+
* // Desktop layout
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
export declare const isDesktopBreakpoint: (breakpoint: Breakpoint) => breakpoint is DesktopBreakpoint;
|
|
28
|
+
/**
|
|
29
|
+
* Type guard to check if a breakpoint is a mobile breakpoint (xs, sm)
|
|
30
|
+
* @example
|
|
31
|
+
* const breakpoint = useBreakpointListener()
|
|
32
|
+
* if (isMobileBreakpoint(breakpoint)) {
|
|
33
|
+
* // Mobile layout
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
export declare const isMobileBreakpoint: (breakpoint: Breakpoint) => breakpoint is MobileBreakpoint;
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { useMediaQuery as
|
|
2
|
-
const
|
|
1
|
+
import { useMediaQuery as n } from "./use-media-query.js";
|
|
2
|
+
const i = (e) => {
|
|
3
3
|
const t = getComputedStyle(document.documentElement).getPropertyValue(
|
|
4
4
|
`--uy-breakpoint-${e}`
|
|
5
5
|
);
|
|
6
6
|
return parseInt(t.replace("px", ""), 10);
|
|
7
|
-
},
|
|
7
|
+
}, r = (e) => `(min-width: ${i(e)}px)`;
|
|
8
8
|
function a() {
|
|
9
|
-
const e = r(
|
|
10
|
-
return e ? "xl" : t ? "lg" :
|
|
9
|
+
const e = n(r("xl")), t = n(r("lg")), s = n(r("md")), o = n(r("sm"));
|
|
10
|
+
return e ? "xl" : t ? "lg" : s ? "md" : o ? "sm" : "xs";
|
|
11
11
|
}
|
|
12
|
+
const u = [
|
|
13
|
+
"md",
|
|
14
|
+
"lg",
|
|
15
|
+
"xl"
|
|
16
|
+
], c = [
|
|
17
|
+
"xs",
|
|
18
|
+
"sm"
|
|
19
|
+
], m = (e) => u.includes(e), p = (e) => c.includes(e);
|
|
12
20
|
export {
|
|
21
|
+
u as DESKTOP_BREAKPOINTS,
|
|
22
|
+
c as MOBILE_BREAKPOINTS,
|
|
23
|
+
m as isDesktopBreakpoint,
|
|
24
|
+
p as isMobileBreakpoint,
|
|
13
25
|
a as useBreakpointListener
|
|
14
26
|
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -179,6 +179,10 @@ export * from './components/task-menu/parts/TaskGroup.js';
|
|
|
179
179
|
export * from './components/text-area/TextArea.js';
|
|
180
180
|
export * from './components/text/Text.js';
|
|
181
181
|
export * from './components/text/Text.variants.js';
|
|
182
|
+
export * from './components/timeline/Timeline.js';
|
|
183
|
+
export * from './components/timeline/parts/TimelineStep.js';
|
|
184
|
+
export * from './components/timeline/parts/TimelineStepHeader.js';
|
|
185
|
+
export * from './components/timeline/parts/TimelineStepDescription.js';
|
|
182
186
|
export * from './components/toast/ToastManager.js';
|
|
183
187
|
export * from './components/toast/toast.js';
|
|
184
188
|
export * from './components/toggle-switch-group/ToggleSwitchGroup.js';
|