@mintplayer/react-bootstrap 19.2.0 → 19.4.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/card/index.mjs +64 -53
- package/card/src/BsCardBody.d.ts +7 -6
- package/card/src/BsCardFooter.d.ts +13 -6
- package/card/src/BsCardGroup.d.ts +7 -6
- package/card/src/BsCardHeader.d.ts +18 -6
- package/card/src/BsCardImg.d.ts +18 -6
- package/card/src/BsCardLink.d.ts +13 -6
- package/card/src/BsCardSubtitle.d.ts +7 -6
- package/card/src/BsCardText.d.ts +7 -6
- package/card/src/BsCardTitle.d.ts +7 -6
- package/package.json +1 -1
- package/timeline/index.mjs +94 -0
- package/timeline/src/BsTimeline.d.ts +33 -0
- package/timeline/src/BsTimelineItem.d.ts +11 -0
- package/timeline/src/index.d.ts +4 -0
- package/tree-select/index.mjs +21 -0
- package/tree-select/src/BsTreeSelect.d.ts +24 -0
- package/tree-select/src/index.d.ts +3 -0
package/card/index.mjs
CHANGED
|
@@ -1,56 +1,67 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as B from "react";
|
|
2
|
+
import { forwardRef as r, useRef as p, useEffect as f } from "react";
|
|
3
|
+
import { createComponent as C } from "@lit/react";
|
|
4
|
+
import { MpCardElement as N, applyHeaderNavStyle as u } from "@mintplayer/web-components/card";
|
|
5
|
+
import { jsx as o, jsxs as x, Fragment as y } from "react/jsx-runtime";
|
|
6
|
+
const D = C({
|
|
7
|
+
react: B,
|
|
6
8
|
tagName: "mp-card",
|
|
7
|
-
elementClass:
|
|
8
|
-
}),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
9
|
+
elementClass: N
|
|
10
|
+
}), g = (...a) => a.filter(Boolean).join(" "), j = r(
|
|
11
|
+
({ className: a, ...e }, s) => /* @__PURE__ */ o("div", { ref: s, className: g("card-body", a), ...e })
|
|
12
|
+
);
|
|
13
|
+
j.displayName = "BsCardBody";
|
|
14
|
+
const v = (...a) => a.filter(Boolean).join(" "), $ = r(
|
|
15
|
+
({ className: a, color: e, ...s }, t) => /* @__PURE__ */ o("div", { ref: t, className: v("card-footer", e && `text-bg-${e}`, a), ...s })
|
|
16
|
+
);
|
|
17
|
+
$.displayName = "BsCardFooter";
|
|
18
|
+
const b = (...a) => a.filter(Boolean).join(" "), R = r(
|
|
19
|
+
({ className: a, ...e }, s) => /* @__PURE__ */ o("div", { ref: s, className: b("card-group", a), ...e })
|
|
20
|
+
);
|
|
21
|
+
R.displayName = "BsCardGroup";
|
|
22
|
+
const T = (...a) => a.filter(Boolean).join(" "), k = r(
|
|
23
|
+
({ className: a, color: e, navStyle: s, children: t, ...n }, i) => {
|
|
24
|
+
const c = p(null);
|
|
25
|
+
return f(() => {
|
|
26
|
+
c.current && u(c.current, s ?? null);
|
|
27
|
+
}, [s, t]), /* @__PURE__ */ o("div", { ref: (d) => {
|
|
28
|
+
c.current = d, typeof i == "function" ? i(d) : i && (i.current = d);
|
|
29
|
+
}, className: T("card-header", e && `text-bg-${e}`, a), ...n, children: t });
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
k.displayName = "BsCardHeader";
|
|
33
|
+
const l = (...a) => a.filter(Boolean).join(" "), F = r(
|
|
34
|
+
({ className: a, position: e = "top", src: s, alt: t, children: n, ...i }, c) => e === "overlay" ? /* @__PURE__ */ x(y, { children: [
|
|
35
|
+
/* @__PURE__ */ o("img", { ref: c, className: l("card-img", a), src: s, alt: t, ...i }),
|
|
36
|
+
/* @__PURE__ */ o("div", { className: "card-img-overlay", children: n })
|
|
37
|
+
] }) : /* @__PURE__ */ o("img", { ref: c, className: l(e === "bottom" ? "card-img-bottom" : "card-img-top", a), src: s, alt: t, ...i })
|
|
38
|
+
);
|
|
39
|
+
F.displayName = "BsCardImg";
|
|
40
|
+
const H = (...a) => a.filter(Boolean).join(" "), E = r(
|
|
41
|
+
({ className: a, href: e, ...s }, t) => /* @__PURE__ */ o("a", { ref: t, className: H("card-link", a), href: e, ...s })
|
|
42
|
+
);
|
|
43
|
+
E.displayName = "BsCardLink";
|
|
44
|
+
const G = (...a) => a.filter(Boolean).join(" "), I = r(
|
|
45
|
+
({ className: a, ...e }, s) => /* @__PURE__ */ o("div", { ref: s, className: G("card-subtitle", a), ...e })
|
|
46
|
+
);
|
|
47
|
+
I.displayName = "BsCardSubtitle";
|
|
48
|
+
const L = (...a) => a.filter(Boolean).join(" "), S = r(
|
|
49
|
+
({ className: a, ...e }, s) => /* @__PURE__ */ o("div", { ref: s, className: L("card-text", a), ...e })
|
|
50
|
+
);
|
|
51
|
+
S.displayName = "BsCardText";
|
|
52
|
+
const h = (...a) => a.filter(Boolean).join(" "), w = r(
|
|
53
|
+
({ className: a, ...e }, s) => /* @__PURE__ */ o("div", { ref: s, className: h("card-title", a), ...e })
|
|
54
|
+
);
|
|
55
|
+
w.displayName = "BsCardTitle";
|
|
45
56
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
D as BsCard,
|
|
58
|
+
j as BsCardBody,
|
|
59
|
+
$ as BsCardFooter,
|
|
60
|
+
R as BsCardGroup,
|
|
61
|
+
k as BsCardHeader,
|
|
62
|
+
F as BsCardImg,
|
|
63
|
+
E as BsCardLink,
|
|
64
|
+
I as BsCardSubtitle,
|
|
65
|
+
S as BsCardText,
|
|
66
|
+
w as BsCardTitle
|
|
56
67
|
};
|
package/card/src/BsCardBody.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* block if you need typed event listeners.
|
|
3
|
+
* Plain React `card-body` element. Renders a `div.card-body` that gets
|
|
4
|
+
* slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
5
|
+
* card sheet. Merges an incoming `className` and spreads remaining props.
|
|
7
6
|
*/
|
|
8
|
-
export declare const BsCardBody:
|
|
7
|
+
export declare const BsCardBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
children?: React.ReactNode | undefined;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface BsCardFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Bootstrap contextual color; emits a `text-bg-{color}` class. */
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* block if you need typed event listeners.
|
|
8
|
+
* Plain React `card-footer` element. Renders a `div.card-footer` that gets
|
|
9
|
+
* slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
10
|
+
* card sheet. Merges an incoming `className` and spreads remaining props.
|
|
7
11
|
*/
|
|
8
|
-
export declare const BsCardFooter:
|
|
12
|
+
export declare const BsCardFooter: React.ForwardRefExoticComponent<BsCardFooterProps & {
|
|
13
|
+
children?: React.ReactNode | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* block if you need typed event listeners.
|
|
3
|
+
* Plain React `card-group` element. Renders a `div.card-group` that gets
|
|
4
|
+
* slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
5
|
+
* card sheet. Merges an incoming `className` and spreads remaining props.
|
|
7
6
|
*/
|
|
8
|
-
export declare const BsCardGroup:
|
|
7
|
+
export declare const BsCardGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
children?: React.ReactNode | undefined;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { CardHeaderNavStyle } from '@mintplayer/web-components/card';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
interface BsCardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Bootstrap contextual color; emits a `text-bg-{color}` class. */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** Promotes a slotted nav to `card-header-tabs` / `card-header-pills`. */
|
|
8
|
+
navStyle?: CardHeaderNavStyle;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
11
|
+
* Plain React `card-header` element. Renders a `div.card-header` that gets
|
|
12
|
+
* slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
13
|
+
* card sheet. When `navStyle` is set, the kept `applyHeaderNavStyle` helper
|
|
14
|
+
* promotes the first slotted nav to the matching Bootstrap class.
|
|
15
|
+
* Merges an incoming `className` and spreads remaining props.
|
|
7
16
|
*/
|
|
8
|
-
export declare const BsCardHeader:
|
|
17
|
+
export declare const BsCardHeader: React.ForwardRefExoticComponent<BsCardHeaderProps & {
|
|
18
|
+
children?: React.ReactNode | undefined;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export {};
|
package/card/src/BsCardImg.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImgHTMLAttributes } from 'react';
|
|
2
|
+
import { CardImagePosition } from '@mintplayer/web-components/card';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
interface BsCardImgProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
5
|
+
/** Where the image sits relative to the card body. Defaults to `top`. */
|
|
6
|
+
position?: CardImagePosition;
|
|
7
|
+
src?: string;
|
|
8
|
+
alt?: string;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
11
|
+
* Plain React `card-img` element. Renders a `card-img-top` / `card-img-bottom`
|
|
12
|
+
* image, or — for `overlay` — a `card-img` paired with a `card-img-overlay`
|
|
13
|
+
* div that holds `children`. The result gets slotted into `<mp-card>` and
|
|
14
|
+
* styled by mp-card's shadow + the global card sheet. Merges an incoming
|
|
15
|
+
* `className` and spreads remaining props onto the `<img>`.
|
|
7
16
|
*/
|
|
8
|
-
export declare const BsCardImg:
|
|
17
|
+
export declare const BsCardImg: React.ForwardRefExoticComponent<BsCardImgProps & {
|
|
18
|
+
children?: React.ReactNode | undefined;
|
|
19
|
+
} & React.RefAttributes<HTMLImageElement>>;
|
|
20
|
+
export {};
|
package/card/src/BsCardLink.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface BsCardLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
/** Link target. */
|
|
5
|
+
href?: string;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* block if you need typed event listeners.
|
|
8
|
+
* Plain React `card-link` element. Renders an `a.card-link` that gets
|
|
9
|
+
* slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
10
|
+
* card sheet. Merges an incoming `className` and spreads remaining props.
|
|
7
11
|
*/
|
|
8
|
-
export declare const BsCardLink:
|
|
12
|
+
export declare const BsCardLink: React.ForwardRefExoticComponent<BsCardLinkProps & {
|
|
13
|
+
children?: React.ReactNode | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
15
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* block if you need typed event listeners.
|
|
3
|
+
* Plain React `card-subtitle` element. Renders a `div.card-subtitle` that
|
|
4
|
+
* gets slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
5
|
+
* card sheet. Merges an incoming `className` and spreads remaining props.
|
|
7
6
|
*/
|
|
8
|
-
export declare const BsCardSubtitle:
|
|
7
|
+
export declare const BsCardSubtitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
children?: React.ReactNode | undefined;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
package/card/src/BsCardText.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* block if you need typed event listeners.
|
|
3
|
+
* Plain React `card-text` element. Renders a `div.card-text` that gets
|
|
4
|
+
* slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
5
|
+
* card sheet. Merges an incoming `className` and spreads remaining props.
|
|
7
6
|
*/
|
|
8
|
-
export declare const BsCardText:
|
|
7
|
+
export declare const BsCardText: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
children?: React.ReactNode | undefined;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* React
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* block if you need typed event listeners.
|
|
3
|
+
* Plain React `card-title` element. Renders a `div.card-title` that gets
|
|
4
|
+
* slotted into `<mp-card>` and styled by mp-card's shadow + the global
|
|
5
|
+
* card sheet. Merges an incoming `className` and spreads remaining props.
|
|
7
6
|
*/
|
|
8
|
-
export declare const BsCardTitle:
|
|
7
|
+
export declare const BsCardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
children?: React.ReactNode | undefined;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/react-bootstrap",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.4.0",
|
|
4
4
|
"description": "React 19 wrappers around @mintplayer/web-components. Each sub-entry maps one-to-one with a WC sub-entry and exposes typed React components via @lit/react's createComponent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx as l, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { createComponent as M } from "@lit/react";
|
|
4
|
+
import { MpTimelineItem as y, MpTimeline as F, resolveSides as R } from "@mintplayer/web-components/timeline";
|
|
5
|
+
const q = M({
|
|
6
|
+
react: x,
|
|
7
|
+
tagName: "mp-timeline-item",
|
|
8
|
+
elementClass: y
|
|
9
|
+
}), z = M({
|
|
10
|
+
react: x,
|
|
11
|
+
tagName: "mp-timeline",
|
|
12
|
+
elementClass: F,
|
|
13
|
+
events: {
|
|
14
|
+
onItemClick: "item-click",
|
|
15
|
+
onSelectionChange: "selection-change"
|
|
16
|
+
}
|
|
17
|
+
}), v = (c, n) => c.id ?? n;
|
|
18
|
+
function H(c) {
|
|
19
|
+
const {
|
|
20
|
+
items: n,
|
|
21
|
+
orientation: g = "vertical",
|
|
22
|
+
align: C = "start",
|
|
23
|
+
reverse: a = !1,
|
|
24
|
+
selectable: I = "none",
|
|
25
|
+
selection: f,
|
|
26
|
+
onSelectionChange: S,
|
|
27
|
+
onItemClick: u,
|
|
28
|
+
renderMarker: r,
|
|
29
|
+
renderTitle: d,
|
|
30
|
+
renderTimestamp: m,
|
|
31
|
+
renderOpposite: p,
|
|
32
|
+
renderContent: h,
|
|
33
|
+
className: b,
|
|
34
|
+
children: B
|
|
35
|
+
} = c, T = !!(r || d || m || p || h), k = !!n && !T, N = T && !!n, j = (e) => u?.(e.detail), w = (e) => {
|
|
36
|
+
const t = e.detail;
|
|
37
|
+
if (n && n.length) {
|
|
38
|
+
const o = new Map(n.map((s, i) => [String(v(s, i)), s]));
|
|
39
|
+
S?.(
|
|
40
|
+
t.selected.map((s) => o.get(String(s.id ?? "")) ?? s)
|
|
41
|
+
);
|
|
42
|
+
} else
|
|
43
|
+
S?.(t.selected);
|
|
44
|
+
}, D = R(n?.length ?? 0, C, a);
|
|
45
|
+
return /* @__PURE__ */ l(
|
|
46
|
+
z,
|
|
47
|
+
{
|
|
48
|
+
orientation: g,
|
|
49
|
+
align: C,
|
|
50
|
+
reverse: a,
|
|
51
|
+
selectable: I,
|
|
52
|
+
className: b,
|
|
53
|
+
onItemClick: j,
|
|
54
|
+
onSelectionChange: w,
|
|
55
|
+
...k ? { items: n } : {},
|
|
56
|
+
...I !== "none" ? { selectedIds: f ? f.map((e, t) => v(e, t)) : [] } : {},
|
|
57
|
+
children: N && n ? n.map((e, t) => {
|
|
58
|
+
const o = n.length, s = a ? o - 1 - t : t, i = {
|
|
59
|
+
index: t,
|
|
60
|
+
visualIndex: s,
|
|
61
|
+
isFirst: s === 0,
|
|
62
|
+
isLast: s === o - 1,
|
|
63
|
+
orientation: g,
|
|
64
|
+
side: D[t] ?? "start"
|
|
65
|
+
}, L = e.time instanceof Date ? e.time.toLocaleDateString() : e.time;
|
|
66
|
+
return /* @__PURE__ */ O(
|
|
67
|
+
q,
|
|
68
|
+
{
|
|
69
|
+
itemId: e.id,
|
|
70
|
+
title: e.title,
|
|
71
|
+
description: e.description,
|
|
72
|
+
time: L ?? void 0,
|
|
73
|
+
icon: e.icon,
|
|
74
|
+
color: e.color,
|
|
75
|
+
itemClass: e.cssClass,
|
|
76
|
+
disabled: e.disabled,
|
|
77
|
+
children: [
|
|
78
|
+
r && /* @__PURE__ */ l("span", { slot: "marker", children: r(e, i) }),
|
|
79
|
+
d && /* @__PURE__ */ l("span", { slot: "title", children: d(e, i) }),
|
|
80
|
+
m && /* @__PURE__ */ l("span", { slot: "opposite", children: m(e, i) }),
|
|
81
|
+
p && /* @__PURE__ */ l("span", { slot: "opposite", children: p(e, i) }),
|
|
82
|
+
h && /* @__PURE__ */ l("div", { slot: "content", children: h(e, i) })
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
e.id ?? t
|
|
86
|
+
);
|
|
87
|
+
}) : k ? null : B
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
H as BsTimeline,
|
|
93
|
+
q as BsTimelineItem
|
|
94
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TimelineAlign, TimelineItem, TimelineItemClickDetail, TimelineItemContext, TimelineOrientation, TimelineSelectable } from '@mintplayer/web-components/timeline-core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type RenderProp = (item: TimelineItem, ctx: TimelineItemContext) => React.ReactNode;
|
|
4
|
+
export interface BsTimelineProps {
|
|
5
|
+
items?: TimelineItem[];
|
|
6
|
+
orientation?: TimelineOrientation;
|
|
7
|
+
align?: TimelineAlign;
|
|
8
|
+
reverse?: boolean;
|
|
9
|
+
selectable?: TimelineSelectable;
|
|
10
|
+
/** Controlled selection (array of items, identity via `id`). */
|
|
11
|
+
selection?: TimelineItem[];
|
|
12
|
+
onSelectionChange?: (selected: TimelineItem[]) => void;
|
|
13
|
+
onItemClick?: (detail: TimelineItemClickDetail) => void;
|
|
14
|
+
/** Render-props — lowered into `<BsTimelineItem>` children. */
|
|
15
|
+
renderMarker?: RenderProp;
|
|
16
|
+
renderTitle?: RenderProp;
|
|
17
|
+
renderTimestamp?: RenderProp;
|
|
18
|
+
renderOpposite?: RenderProp;
|
|
19
|
+
renderContent?: RenderProp;
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Declarative `<BsTimelineItem>` children (used when no render-props). */
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `<BsTimeline>` — React wrapper around `<mp-timeline>`.
|
|
26
|
+
*
|
|
27
|
+
* Render-props lower into `<BsTimelineItem>` children with their output in the
|
|
28
|
+
* item's named slots (one shadow boundary). With no render-props, `items` is
|
|
29
|
+
* set as the WC property, or declarative `<BsTimelineItem>` children pass
|
|
30
|
+
* straight through.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BsTimeline(props: BsTimelineProps): React.ReactElement;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MpTimelineItem } from '@mintplayer/web-components/timeline';
|
|
2
|
+
/**
|
|
3
|
+
* `<BsTimelineItem>` — declarative row for `<BsTimeline>`. Renders the
|
|
4
|
+
* `<mp-timeline-item>` custom element directly (props map to element
|
|
5
|
+
* properties), so it projects cleanly into the timeline's default slot.
|
|
6
|
+
*
|
|
7
|
+
* Props mirror the element's properties: `itemId`, `title`, `description`,
|
|
8
|
+
* `time`, `icon`, `color`, `itemClass`, `disabled`, `selected`. Slot content is
|
|
9
|
+
* passed as children with `slot="marker|title|opposite|content|connector"`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const BsTimelineItem: import('@lit/react').ReactWebComponent<MpTimelineItem, {}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { BsTimeline } from './BsTimeline';
|
|
2
|
+
export type { BsTimelineProps } from './BsTimeline';
|
|
3
|
+
export { BsTimelineItem } from './BsTimelineItem';
|
|
4
|
+
export type { TimelineItem, TimelineOrientation, TimelineAlign, TimelineSide, TimelineSelectable, TimelineItemContext, TimelineConnectorContext, TimelineItemClickDetail, TimelineSelectionChangeDetail, } from '@mintplayer/web-components/timeline-core';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { createComponent as r } from "@lit/react";
|
|
3
|
+
import { MpTreeSelect as o } from "@mintplayer/web-components/tree-select";
|
|
4
|
+
import { InMemoryTreeSelectProvider as m } from "@mintplayer/web-components/tree-select";
|
|
5
|
+
const n = r({
|
|
6
|
+
react: e,
|
|
7
|
+
tagName: "mp-tree-select",
|
|
8
|
+
elementClass: o,
|
|
9
|
+
events: {
|
|
10
|
+
onValueChange: "value-change",
|
|
11
|
+
onOpen: "open",
|
|
12
|
+
onClose: "close",
|
|
13
|
+
onClear: "clear",
|
|
14
|
+
onSearch: "search",
|
|
15
|
+
onLoadError: "load-error"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
n as BsTreeSelect,
|
|
20
|
+
m as InMemoryTreeSelectProvider
|
|
21
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { MpTreeSelect, TreeSelectChangeEventDetail } from '@mintplayer/web-components/tree-select';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for `<mp-tree-select>`. Side-effect-registers the WC.
|
|
5
|
+
*
|
|
6
|
+
* Object/function props (`provider`, `value`, `*Template` render-callbacks)
|
|
7
|
+
* are forwarded by @lit/react as element properties; string/boolean props
|
|
8
|
+
* (`mode`, `variant`, `cascadeSelect`, …) flow through as attributes.
|
|
9
|
+
*
|
|
10
|
+
* A `*Template` callback must return a DOM `Node` (the WC inserts it directly),
|
|
11
|
+
* e.g. `itemTemplate={(node) => { const s = document.createElement('span'); … }}`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BsTreeSelect: import('@lit/react').ReactWebComponent<MpTreeSelect, {
|
|
14
|
+
onValueChange: EventName<CustomEvent<TreeSelectChangeEventDetail>>;
|
|
15
|
+
onOpen: EventName<CustomEvent<void>>;
|
|
16
|
+
onClose: EventName<CustomEvent<void>>;
|
|
17
|
+
onClear: EventName<CustomEvent<void>>;
|
|
18
|
+
onSearch: EventName<CustomEvent<{
|
|
19
|
+
query: string;
|
|
20
|
+
}>>;
|
|
21
|
+
onLoadError: EventName<CustomEvent<{
|
|
22
|
+
error: unknown;
|
|
23
|
+
}>>;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { BsTreeSelect } from './BsTreeSelect';
|
|
2
|
+
export { InMemoryTreeSelectProvider } from '@mintplayer/web-components/tree-select';
|
|
3
|
+
export type { TreeNode, TreeSelectMode, TreeSelectVariant, TreeSelectProvider, TreeSelectChangeEventDetail, NodePage, NodeRequest, } from '@mintplayer/web-components/tree-select';
|