@mintplayer/react-bootstrap 19.7.0 → 19.8.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/accordion/index.mjs +58 -0
- package/accordion/src/BsAccordion.d.ts +43 -0
- package/accordion/src/index.d.ts +2 -0
- package/carousel/index.mjs +32 -0
- package/carousel/src/BsCarousel.d.ts +27 -0
- package/carousel/src/index.d.ts +3 -0
- package/package.json +5 -2
- package/react-bootstrap.css +1 -1
- package/splitter/src/BsSplitter.d.ts +5 -3
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as a, jsxs as l, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { createComponent as m } from "@lit/react";
|
|
4
|
+
import { MpAccordion as g, MpAccordionTab as f } from "@mintplayer/web-components/accordion";
|
|
5
|
+
const u = m({
|
|
6
|
+
react: o,
|
|
7
|
+
tagName: "mp-accordion",
|
|
8
|
+
elementClass: g,
|
|
9
|
+
events: {
|
|
10
|
+
onTabToggle: "mp-accordion-tab-toggle"
|
|
11
|
+
}
|
|
12
|
+
}), A = m({
|
|
13
|
+
react: o,
|
|
14
|
+
tagName: "mp-accordion-tab",
|
|
15
|
+
elementClass: f
|
|
16
|
+
});
|
|
17
|
+
function h({
|
|
18
|
+
header: i,
|
|
19
|
+
isActive: n,
|
|
20
|
+
disabled: r,
|
|
21
|
+
index: e = 0,
|
|
22
|
+
children: c
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ l(b, { children: [
|
|
25
|
+
/* @__PURE__ */ a("span", { "accordion-header": "", slot: `h${e}`, children: i }),
|
|
26
|
+
/* @__PURE__ */ a(
|
|
27
|
+
A,
|
|
28
|
+
{
|
|
29
|
+
"accordion-tab": "",
|
|
30
|
+
slot: `c${e}`,
|
|
31
|
+
...n ? { "is-active": "" } : {},
|
|
32
|
+
...r ? { disabled: "" } : {},
|
|
33
|
+
children: c
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
const T = o.forwardRef(function({ multi: n, highlightActiveTab: r, children: e, ...c }, s) {
|
|
39
|
+
let d = 0;
|
|
40
|
+
const p = o.Children.map(
|
|
41
|
+
e,
|
|
42
|
+
(t) => o.isValidElement(t) && t.type === h ? o.cloneElement(t, { index: d++ }) : t
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ a(
|
|
45
|
+
u,
|
|
46
|
+
{
|
|
47
|
+
ref: s,
|
|
48
|
+
...n ? { multi: !0 } : {},
|
|
49
|
+
...r ? { "highlight-active-tab": !0 } : {},
|
|
50
|
+
...c,
|
|
51
|
+
children: p
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
T as BsAccordion,
|
|
57
|
+
h as BsAccordionItem
|
|
58
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { MpAccordion, AccordionTabToggleDetail } from '@mintplayer/web-components/accordion';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface BsAccordionProps {
|
|
4
|
+
/** Allow several tabs to stay open at once (checkbox machine with JS off). */
|
|
5
|
+
multi?: boolean;
|
|
6
|
+
/** Paint the open header with the Bootstrap active background. */
|
|
7
|
+
highlightActiveTab?: boolean;
|
|
8
|
+
/** A tab opened or closed. `detail.index` is its position. */
|
|
9
|
+
onTabToggle?: (event: CustomEvent<AccordionTabToggleDetail>) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
/** `BsAccordionItem`s; anything else renders as plain accordion content. */
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface BsAccordionItemProps {
|
|
15
|
+
/** Header content — any node, not just a string. */
|
|
16
|
+
header?: React.ReactNode;
|
|
17
|
+
isActive?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Position among its siblings, injected by `BsAccordion`. Passing it
|
|
22
|
+
* yourself is only needed when items are not direct children.
|
|
23
|
+
*/
|
|
24
|
+
index?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One tab: a header and a body that render as SIBLINGS, not as a wrapper
|
|
28
|
+
* around them. Named slots only accept direct children of `<mp-accordion>`,
|
|
29
|
+
* so the header cannot live inside the tab element — a React fragment lets
|
|
30
|
+
* one component contribute both.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BsAccordionItem({ header, isActive, disabled, index, children, }: BsAccordionItemProps): React.JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* React wrapper for `<mp-accordion>`.
|
|
35
|
+
*
|
|
36
|
+
* <BsAccordion multi onTabToggle={e => …}>
|
|
37
|
+
* <BsAccordionItem header="Profile" isActive>Body</BsAccordionItem>
|
|
38
|
+
* </BsAccordion>
|
|
39
|
+
*
|
|
40
|
+
* Items are numbered here rather than by themselves: the index is a tab's
|
|
41
|
+
* identity for slots and toggle events, and only the parent knows the order.
|
|
42
|
+
*/
|
|
43
|
+
export declare const BsAccordion: React.ForwardRefExoticComponent<BsAccordionProps & React.RefAttributes<MpAccordion>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { createComponent as p } from "@lit/react";
|
|
4
|
+
import { MpCarousel as u } from "@mintplayer/web-components/carousel";
|
|
5
|
+
const f = p({
|
|
6
|
+
react: o,
|
|
7
|
+
tagName: "mp-carousel",
|
|
8
|
+
elementClass: u,
|
|
9
|
+
events: {
|
|
10
|
+
onSlideChange: "slide-change",
|
|
11
|
+
onPausedChange: "paused-change",
|
|
12
|
+
onAnimationStart: "animation-start",
|
|
13
|
+
onAnimationEnd: "animation-end"
|
|
14
|
+
}
|
|
15
|
+
}), h = o.forwardRef(function({ ariaLabel: a, indicators: n, interval: e, wrap: t, keyboardEvents: r, paused: s, ...m }, i) {
|
|
16
|
+
return /* @__PURE__ */ l(
|
|
17
|
+
f,
|
|
18
|
+
{
|
|
19
|
+
ref: i,
|
|
20
|
+
...a != null ? { "aria-label": a } : {},
|
|
21
|
+
...n ? { indicators: !0 } : {},
|
|
22
|
+
...e && e > 0 ? { interval: e } : {},
|
|
23
|
+
...t === !1 ? { wrap: "false" } : {},
|
|
24
|
+
...r === !1 ? { "keyboard-events": "false" } : {},
|
|
25
|
+
...s ? { paused: !0 } : {},
|
|
26
|
+
...m
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
h as BsCarousel
|
|
32
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MpCarousel, CarouselAnimation, CarouselOrientation, CarouselPausedChangeEventDetail, CarouselSlideChangeEventDetail } from '@mintplayer/web-components/carousel';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface BsCarouselProps {
|
|
4
|
+
/** Slide transition: `slide` (default), `fade`, or `none`. */
|
|
5
|
+
animation?: CarouselAnimation;
|
|
6
|
+
orientation?: CarouselOrientation;
|
|
7
|
+
/** Show the indicator dots. */
|
|
8
|
+
indicators?: boolean;
|
|
9
|
+
/** Auto-advance interval in ms; omit for no autoplay. */
|
|
10
|
+
interval?: number;
|
|
11
|
+
/** Wrap around at the ends (default true). */
|
|
12
|
+
wrap?: boolean;
|
|
13
|
+
/** Arrow/Home/End navigation on the focused viewport (default true). */
|
|
14
|
+
keyboardEvents?: boolean;
|
|
15
|
+
/** Whether autoplay is paused (controlled via onPausedChange). */
|
|
16
|
+
paused?: boolean;
|
|
17
|
+
/** Accessible label for the carousel region. Maps to `aria-label`. */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
onSlideChange?: (event: CustomEvent<CarouselSlideChangeEventDetail>) => void;
|
|
20
|
+
onPausedChange?: (event: CustomEvent<CarouselPausedChangeEventDetail>) => void;
|
|
21
|
+
onAnimationStart?: (event: CustomEvent<void>) => void;
|
|
22
|
+
onAnimationEnd?: (event: CustomEvent<void>) => void;
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Slides (plus an optional element with slot="play-pause"). */
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare const BsCarousel: React.ForwardRefExoticComponent<BsCarouselProps & React.RefAttributes<MpCarousel>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/react-bootstrap",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.8.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": {
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
"email": "info@mintplayer.com"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
|
-
"sideEffects": [
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"**/src/index.{ts,js,mjs,tsx,jsx}",
|
|
19
|
+
"**/Bs*.{mjs,js,tsx,jsx}"
|
|
20
|
+
],
|
|
18
21
|
"main": "./index.mjs",
|
|
19
22
|
"types": "./src/index.d.ts",
|
|
20
23
|
"exports": {
|
package/react-bootstrap.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.dropdown-item>a,.dropdown-item>button{display:block;width:auto;margin:calc(-1 * var(--bs-dropdown-item-padding-y, .25rem)) calc(-1 * var(--bs-dropdown-item-padding-x, 1rem));padding:var(--bs-dropdown-item-padding-y, .25rem) var(--bs-dropdown-item-padding-x, 1rem);color:inherit;text-decoration:none;text-align:inherit;background:none;border:0;font:inherit}
|
|
1
|
+
.dropdown-item>a,.dropdown-item>button{display:block;width:auto;margin:calc(-1 * var(--bs-dropdown-item-padding-y, .25rem)) calc(-1 * var(--bs-dropdown-item-padding-x, 1rem));padding:var(--bs-dropdown-item-padding-y, .25rem) var(--bs-dropdown-item-padding-x, 1rem);color:inherit;text-decoration:none;text-align:inherit;background:none;border:0;font:inherit}.dropdown-item>a.active,.dropdown-item>button.active{color:var(--bs-dropdown-link-active-color, #fff);background-color:var(--bs-dropdown-link-active-bg, var(--bs-primary))}
|
|
@@ -5,9 +5,11 @@ import { MpSplitter, SplitterResizeEventDetail } from '@mintplayer/web-component
|
|
|
5
5
|
* the import above. Surfaces the 3-stage resize lifecycle as React
|
|
6
6
|
* `on*` props with full detail typing.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
8
|
+
* Each direct child becomes a resizable panel with draggable dividers
|
|
9
|
+
* auto-inserted between them. Configure via the `orientation`
|
|
10
|
+
* (`horizontal` | `vertical`), `minPanelSize` and `touchMode` props;
|
|
11
|
+
* read/write sizes programmatically through a ref
|
|
12
|
+
* (`getPanelSizes()` / `setPanelSizes()` / `resizeDividerBy()`).
|
|
11
13
|
*/
|
|
12
14
|
export declare const BsSplitter: import('@lit/react').ReactWebComponent<MpSplitter, {
|
|
13
15
|
onResizeStart: EventName<CustomEvent<SplitterResizeEventDetail>>;
|