@tpc-mare/mare-ui-components-react 0.1.4 → 0.1.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/dist/accordion/Accordion.d.ts +2 -0
- package/dist/accordion/Accordion.types.d.ts +20 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +4 -0
- package/dist/banner/Banner.d.ts +2 -0
- package/dist/banner/Banner.types.d.ts +15 -0
- package/dist/banner/index.d.ts +2 -0
- package/dist/banner/index.js +4 -0
- package/dist/checkbox/index.js +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/date-picker/DatePicker.d.ts +3 -0
- package/dist/date-picker/DatePicker.types.d.ts +52 -0
- package/dist/date-picker/index.d.ts +2 -0
- package/dist/date-picker/index.js +4 -0
- package/dist/dialog/index.js +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/index/index.d.ts +18 -0
- package/dist/index/index.js +66 -46
- package/dist/input-otp/InputOtp.d.ts +2 -0
- package/dist/input-otp/InputOtp.types.d.ts +27 -0
- package/dist/input-otp/index.d.ts +2 -0
- package/dist/input-otp/index.js +4 -0
- package/dist/paginator/Paginator.d.ts +2 -0
- package/dist/paginator/Paginator.types.d.ts +21 -0
- package/dist/paginator/index.d.ts +2 -0
- package/dist/paginator/index.js +4 -0
- package/dist/panel-menu/PanelMenu.d.ts +2 -0
- package/dist/panel-menu/PanelMenu.types.d.ts +12 -0
- package/dist/panel-menu/index.d.ts +2 -0
- package/dist/panel-menu/index.js +4 -0
- package/dist/password/Password.d.ts +7 -0
- package/dist/password/Password.types.d.ts +39 -0
- package/dist/password/index.d.ts +2 -0
- package/dist/password/index.js +5 -0
- package/dist/search-field/index.js +1 -1
- package/dist/select-field/index.js +1 -1
- package/dist/shared/Accordion-Cbs8KQ5v.js +63 -0
- package/dist/shared/Banner-BWyV9K8e.js +52 -0
- package/dist/shared/{Checkbox-DsM70wQl.js → Checkbox-D17WWbSe.js} +1 -1
- package/dist/shared/{Combobox-DeUG_muZ.js → Combobox-CBa1lnAd.js} +1 -1
- package/dist/shared/DatePicker-BQulFC2D.js +856 -0
- package/dist/shared/{DialogFooter-DLWy6Mln.js → DialogFooter-0gaMdpXV.js} +1 -1
- package/dist/shared/{DrawerFooter-DvUgumx0.js → DrawerFooter-CpO7chLC.js} +1 -1
- package/dist/shared/InputOtp-CUXXVP2E.js +72 -0
- package/dist/shared/Paginator-Da0XKfF3.js +164 -0
- package/dist/shared/PanelMenu-CYbr6cvz.js +123 -0
- package/dist/shared/Password-vADi8ZJz.js +94 -0
- package/dist/shared/{SearchField-CgDz_s1O.js → SearchField-9bL2s8zj.js} +1 -1
- package/dist/shared/{SelectField-BSTmWjYy.js → SelectField-dNCMdSYU.js} +1 -1
- package/dist/shared/Snackbar-C29nLHO9.js +100 -0
- package/dist/shared/Stepper-DApoMP1U.js +110 -0
- package/dist/shared/icons-bQxPPV8R.js +55 -0
- package/dist/shared/icons.d.ts +8 -0
- package/dist/shared/useMediaQuery.d.ts +5 -0
- package/dist/snackbar/Snackbar.d.ts +3 -0
- package/dist/snackbar/Snackbar.types.d.ts +42 -0
- package/dist/snackbar/index.d.ts +2 -0
- package/dist/snackbar/index.js +5 -0
- package/dist/stepper/Stepper.d.ts +2 -0
- package/dist/stepper/Stepper.types.d.ts +18 -0
- package/dist/stepper/index.d.ts +2 -0
- package/dist/stepper/index.js +4 -0
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -0
- package/dist/utilities-standalone.css +1 -0
- package/package.json +5 -6
- package/dist/shared/icons-DeVfnVLm.js +0 -37
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { Steps as a } from "@ark-ui/react/steps";
|
|
3
|
+
import { b, e as k, f as v } from "./icons-bQxPPV8R.js";
|
|
4
|
+
const y = "mare:flex mare:ark-horizontal:flex-col mare:ark-vertical:flex-row mare:gap-4 mare:w-full", N = `
|
|
5
|
+
mare:hidden mare:sm:flex mare:gap-2 mare:overflow-x-auto
|
|
6
|
+
mare:ark-horizontal:flex-row mare:ark-horizontal:items-center mare:ark-horizontal:justify-between
|
|
7
|
+
mare:ark-vertical:flex-col mare:ark-vertical:items-start
|
|
8
|
+
`, w = "mare:relative mare:flex mare:items-center mare:ark-vertical:items-start mare:gap-3 mare:flex-1 mare:last:flex-none", j = `
|
|
9
|
+
mare:group mare:flex mare:items-center mare:gap-3 mare:bg-transparent mare:border-none
|
|
10
|
+
mare:text-left mare:cursor-pointer mare:rounded-md mare:outline-none
|
|
11
|
+
mare:disabled:cursor-not-allowed mare:disabled:opacity-50
|
|
12
|
+
`, z = (t) => `
|
|
13
|
+
mare:group mare:flex mare:items-center mare:justify-center mare:shrink-0 mare:relative
|
|
14
|
+
mare:size-8 mare:rounded-full mare:tpc-typography-label-s
|
|
15
|
+
mare:ark-incomplete:bg-neutral-weak mare:ark-incomplete:text-weak
|
|
16
|
+
mare:ark-current:bg-accent mare:ark-current:text-on-accent
|
|
17
|
+
${t === "strong" ? "mare:ark-complete:bg-accent mare:ark-complete:text-on-accent" : "mare:ark-complete:bg-accent-weak mare:ark-complete:text-accent"}
|
|
18
|
+
`, C = "mare:flex mare:items-center mare:justify-center mare:[&>svg]:size-4", S = "mare:flex mare:items-center mare:justify-center mare:group-[[data-complete]]:hidden", I = "mare:hidden mare:group-[[data-complete]]:flex mare:items-center mare:justify-center mare:absolute mare:inset-0 mare:[&>svg]:size-4", T = `
|
|
19
|
+
mare:flex-1 mare:h-[1.5px] mare:bg-neutral-weak mare:transition-colors mare:duration-300
|
|
20
|
+
mare:ark-complete:bg-accent
|
|
21
|
+
mare:ark-vertical:absolute mare:ark-vertical:flex-none mare:ark-vertical:w-[1.5px] mare:ark-vertical:h-auto
|
|
22
|
+
mare:ark-vertical:top-8 mare:ark-vertical:bottom-[-0.5rem] mare:ark-vertical:start-[calc(1rem-0.75px)]
|
|
23
|
+
`, L = "mare:flex mare:flex-col mare:items-start mare:gap-0.5", R = "mare:tpc-typography-label-s mare:text-default mare:group-[[data-incomplete]]:text-weak", B = "mare:block mare:tpc-typography-body-xs mare:text-weak", F = `
|
|
24
|
+
mare:p-4 mare:min-h-24 mare:rounded-input mare:border mare:border-default
|
|
25
|
+
mare:bg-default mare:text-default mare:tpc-typography-body-s
|
|
26
|
+
`, M = `
|
|
27
|
+
mare:flex mare:sm:hidden mare:items-center mare:justify-between mare:gap-3
|
|
28
|
+
mare:px-3 mare:py-2 mare:rounded-input mare:border mare:border-default mare:bg-default
|
|
29
|
+
`, P = "mare:flex-1 mare:text-center mare:truncate mare:tpc-typography-body-s mare:text-default", c = `
|
|
30
|
+
mare:flex mare:items-center mare:justify-center mare:size-8 mare:rounded-full mare:text-default
|
|
31
|
+
mare:hover:bg-hover mare:disabled:opacity-40 mare:disabled:cursor-not-allowed mare:disabled:pointer-events-none
|
|
32
|
+
`;
|
|
33
|
+
function $({ items: t }) {
|
|
34
|
+
return /* @__PURE__ */ m("div", { className: M, children: [
|
|
35
|
+
/* @__PURE__ */ e(a.PrevTrigger, { className: c, children: /* @__PURE__ */ e(k, {}) }),
|
|
36
|
+
/* @__PURE__ */ e(a.Context, { children: (n) => /* @__PURE__ */ m("span", { className: P, children: [
|
|
37
|
+
t[n.value]?.title,
|
|
38
|
+
" · ",
|
|
39
|
+
n.value + 1,
|
|
40
|
+
"/",
|
|
41
|
+
n.count
|
|
42
|
+
] }) }),
|
|
43
|
+
/* @__PURE__ */ e(a.NextTrigger, { className: c, children: /* @__PURE__ */ e(v, {}) })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
function E({
|
|
47
|
+
items: t,
|
|
48
|
+
step: n,
|
|
49
|
+
defaultStep: o,
|
|
50
|
+
onStepChange: s,
|
|
51
|
+
onStepComplete: i,
|
|
52
|
+
linear: d = !1,
|
|
53
|
+
orientation: p = "horizontal",
|
|
54
|
+
indicatorVariant: u = "default",
|
|
55
|
+
isStepValid: f,
|
|
56
|
+
isStepSkippable: h
|
|
57
|
+
}) {
|
|
58
|
+
const x = z(u);
|
|
59
|
+
return /* @__PURE__ */ m(
|
|
60
|
+
a.Root,
|
|
61
|
+
{
|
|
62
|
+
className: y,
|
|
63
|
+
count: t.length,
|
|
64
|
+
step: n,
|
|
65
|
+
defaultStep: o,
|
|
66
|
+
linear: d,
|
|
67
|
+
orientation: p,
|
|
68
|
+
isStepValid: f,
|
|
69
|
+
isStepSkippable: h,
|
|
70
|
+
onStepChange: (r) => s?.(r.step),
|
|
71
|
+
onStepComplete: i,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ e(a.List, { className: N, children: t.map((r, l) => /* @__PURE__ */ m(
|
|
74
|
+
a.Item,
|
|
75
|
+
{
|
|
76
|
+
index: l,
|
|
77
|
+
className: w,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ m(a.Trigger, { className: j, children: [
|
|
80
|
+
/* @__PURE__ */ e(a.Indicator, { className: x, children: r.icon ? /* @__PURE__ */ e("span", { className: C, children: r.icon }) : /* @__PURE__ */ m(g, { children: [
|
|
81
|
+
/* @__PURE__ */ e("span", { className: I, children: /* @__PURE__ */ e(b, {}) }),
|
|
82
|
+
/* @__PURE__ */ e("span", { className: S, children: l + 1 })
|
|
83
|
+
] }) }),
|
|
84
|
+
/* @__PURE__ */ m("span", { className: L, children: [
|
|
85
|
+
/* @__PURE__ */ e("span", { className: R, children: r.title }),
|
|
86
|
+
r.description && /* @__PURE__ */ e("span", { className: B, children: r.description })
|
|
87
|
+
] })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ e(a.Separator, { className: T })
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
l
|
|
93
|
+
)) }),
|
|
94
|
+
/* @__PURE__ */ e($, { items: t }),
|
|
95
|
+
t.map((r, l) => /* @__PURE__ */ e(
|
|
96
|
+
a.Content,
|
|
97
|
+
{
|
|
98
|
+
index: l,
|
|
99
|
+
className: F,
|
|
100
|
+
children: r.content
|
|
101
|
+
},
|
|
102
|
+
l
|
|
103
|
+
))
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
E as S
|
|
110
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
const o = (c) => function(t) {
|
|
3
|
+
return /* @__PURE__ */ s(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
fill: "none",
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
strokeWidth: "2",
|
|
11
|
+
strokeLinecap: "round",
|
|
12
|
+
strokeLinejoin: "round",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
width: "1em",
|
|
15
|
+
height: "1em",
|
|
16
|
+
...t,
|
|
17
|
+
children: c.map((n) => /* @__PURE__ */ s(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: n
|
|
21
|
+
},
|
|
22
|
+
n
|
|
23
|
+
))
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}, M = o(["M6 9l6 6 6-6"]), h = o(["M15 18l-6-6 6-6"]), l = o(["M9 18l6-6-6-6"]), i = o(["M11 17l-5-5 5-5", "M18 17l-5-5 5-5"]), I = o(["M6 17l5-5-5-5", "M13 17l5-5-5-5"]), v = o(["M5 12l5 5L20 7"]), C = o([
|
|
27
|
+
"M8 2v4M16 2v4",
|
|
28
|
+
"M3 8h18",
|
|
29
|
+
"M4 4h16a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z"
|
|
30
|
+
]), e = o(["M6 6l12 12", "M18 6L6 18"]), d = e, f = o([
|
|
31
|
+
"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z",
|
|
32
|
+
"M15 12a3 3 0 1 1-6 0 3 3 0 1 1 6 0z"
|
|
33
|
+
]), g = o([
|
|
34
|
+
"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z",
|
|
35
|
+
"M15 12a3 3 0 1 1-6 0 3 3 0 1 1 6 0z",
|
|
36
|
+
"M3 3l18 18"
|
|
37
|
+
]), u = o(["M5 12h14"]), w = o([
|
|
38
|
+
"M10 3a7 7 0 1 0 0 14 7 7 0 0 0 0-14z",
|
|
39
|
+
"M20 20l-5-5"
|
|
40
|
+
]);
|
|
41
|
+
export {
|
|
42
|
+
M as C,
|
|
43
|
+
f as E,
|
|
44
|
+
u as M,
|
|
45
|
+
w as S,
|
|
46
|
+
d as a,
|
|
47
|
+
v as b,
|
|
48
|
+
e as c,
|
|
49
|
+
i as d,
|
|
50
|
+
h as e,
|
|
51
|
+
l as f,
|
|
52
|
+
I as g,
|
|
53
|
+
g as h,
|
|
54
|
+
C as i
|
|
55
|
+
};
|
package/dist/shared/icons.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
2
|
export declare const ChevronDownIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
3
|
+
export declare const ChevronUpIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
4
|
+
export declare const ChevronLeftIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
5
|
+
export declare const ChevronRightIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
6
|
+
export declare const ChevronsLeftIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
7
|
+
export declare const ChevronsRightIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
3
8
|
export declare const CheckIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
9
|
+
export declare const CalendarIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
4
10
|
export declare const ClearIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
5
11
|
export declare const CloseIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
12
|
+
export declare const EyeIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
13
|
+
export declare const EyeOffIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
6
14
|
export declare const MinusIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
7
15
|
export declare const SearchIcon: (properties: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Tiny `matchMedia` subscription — no dependency, mirrors the Vue DS's
|
|
2
|
+
* useScreenWidth for the one thing components here actually need: whether
|
|
3
|
+
* we're at/above Tailwind's default `sm` breakpoint (640px). */
|
|
4
|
+
export declare function useMediaQuery(query: string): boolean;
|
|
5
|
+
export declare const SM_BREAKPOINT_QUERY = "(min-width: 640px)";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SnackbarController, SnackbarConfig, SnackbarProperties } from './Snackbar.types';
|
|
2
|
+
export declare function createSnackbar(config?: SnackbarConfig): SnackbarController;
|
|
3
|
+
export declare function Snackbar({ controller, portalContainer }: SnackbarProperties): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { SnackbarSeverity, SnackbarPlacement } from '@tpc-development/mare-ui-components-core/snackbar';
|
|
3
|
+
export type { SnackbarSeverity, SnackbarPlacement, } from '@tpc-development/mare-ui-components-core/snackbar';
|
|
4
|
+
/** The payload for `controller.show()`/`.update()`. Framework-shaped on
|
|
5
|
+
* purpose (ReactNode `detail`/`leading`) — this is why it lives in the
|
|
6
|
+
* adapter, not in core alongside `SnackbarSeverity`/`SnackbarPlacement`. */
|
|
7
|
+
export interface SnackbarShowOptions {
|
|
8
|
+
/** @default 'contrast' */
|
|
9
|
+
severity?: SnackbarSeverity;
|
|
10
|
+
detail: ReactNode;
|
|
11
|
+
/** Icon or image shown before the detail text. Mutually exclusive with
|
|
12
|
+
* nothing in particular — it's just whatever `ReactNode` you pass. */
|
|
13
|
+
leading?: ReactNode;
|
|
14
|
+
/** @default 3000, and never resolves lower than that. */
|
|
15
|
+
life?: number;
|
|
16
|
+
/** Progress bar filling over `life`, indicating time until auto-dismiss. @default false */
|
|
17
|
+
progressBar?: boolean;
|
|
18
|
+
action?: {
|
|
19
|
+
label: string;
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Returned by `createSnackbar()`. Mirrors the legacy `useToast()` service —
|
|
24
|
+
* mount ONE `<Snackbar controller={controller} />` per controller, then push
|
|
25
|
+
* messages into it from anywhere via `controller.show(...)`. */
|
|
26
|
+
export interface SnackbarController {
|
|
27
|
+
/** Pushes a new message, returns its id. */
|
|
28
|
+
show(options: SnackbarShowOptions): string;
|
|
29
|
+
/** Dismisses one message by id, or every message in this controller if omitted. */
|
|
30
|
+
dismiss(id?: string): void;
|
|
31
|
+
update(id: string, options: Partial<SnackbarShowOptions>): void;
|
|
32
|
+
}
|
|
33
|
+
export interface SnackbarConfig {
|
|
34
|
+
/** @default 'bottom-center' */
|
|
35
|
+
placement?: SnackbarPlacement;
|
|
36
|
+
}
|
|
37
|
+
export interface SnackbarProperties {
|
|
38
|
+
controller: SnackbarController;
|
|
39
|
+
/** Where the toast stack portals to. Override if your app scopes
|
|
40
|
+
* `data-theme` to a sub-tree rather than the document root. */
|
|
41
|
+
portalContainer?: RefObject<HTMLElement | null>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StepItemData, StepperOrientation, StepperIndicatorVariant } from '@tpc-development/mare-ui-components-core/stepper';
|
|
2
|
+
export type { StepItemData, StepperOrientation, StepperIndicatorVariant, } from '@tpc-development/mare-ui-components-core/stepper';
|
|
3
|
+
export interface StepperProperties {
|
|
4
|
+
items: StepItemData[];
|
|
5
|
+
/** Controlled current step index (0-based). Omit to let Ark manage it. */
|
|
6
|
+
step?: number;
|
|
7
|
+
defaultStep?: number;
|
|
8
|
+
onStepChange?: (step: number) => void;
|
|
9
|
+
onStepComplete?: () => void;
|
|
10
|
+
/** Requires steps to be completed in order — blocks jumping ahead. */
|
|
11
|
+
linear?: boolean;
|
|
12
|
+
orientation?: StepperOrientation;
|
|
13
|
+
/** 'default': completed steps stay weak-accent. 'strong': completed steps
|
|
14
|
+
* get the same full-accent treatment as the current one. */
|
|
15
|
+
indicatorVariant?: StepperIndicatorVariant;
|
|
16
|
+
isStepValid?: (index: number) => boolean;
|
|
17
|
+
isStepSkippable?: (index: number) => boolean;
|
|
18
|
+
}
|