@sentropic/design-system-react 0.8.0 → 0.10.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/Autosave.d.ts +3 -0
- package/dist/Autosave.d.ts.map +1 -0
- package/dist/Autosave.js +2 -0
- package/dist/Autosave.js.map +1 -0
- package/dist/Calendar.d.ts +3 -0
- package/dist/Calendar.d.ts.map +1 -0
- package/dist/Calendar.js +2 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Popper.d.ts +77 -0
- package/dist/Popper.d.ts.map +1 -0
- package/dist/Popper.js +172 -0
- package/dist/Popper.js.map +1 -0
- package/dist/Portal.d.ts +29 -0
- package/dist/Portal.d.ts.map +1 -0
- package/dist/Portal.js +46 -0
- package/dist/Portal.js.map +1 -0
- package/dist/Rating.d.ts +3 -0
- package/dist/Rating.d.ts.map +1 -0
- package/dist/Rating.js +2 -0
- package/dist/Rating.js.map +1 -0
- package/dist/SlideIndicator.d.ts +3 -0
- package/dist/SlideIndicator.d.ts.map +1 -0
- package/dist/SlideIndicator.js +2 -0
- package/dist/SlideIndicator.js.map +1 -0
- package/dist/TimePicker.d.ts +3 -0
- package/dist/TimePicker.d.ts.map +1 -0
- package/dist/TimePicker.js +2 -0
- package/dist/TimePicker.js.map +1 -0
- package/dist/catalog.d.ts +104 -0
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +385 -0
- package/dist/catalog.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +491 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autosave.d.ts","sourceRoot":"","sources":["../src/Autosave.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/Autosave.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autosave.js","sourceRoot":"","sources":["../src/Autosave.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/Calendar.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/Popper.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type PopperStrategy = "absolute" | "fixed";
|
|
3
|
+
export type PopperPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end";
|
|
4
|
+
export type PopperSide = "top" | "bottom" | "left" | "right";
|
|
5
|
+
export type PopperAlign = "start" | "center" | "end";
|
|
6
|
+
export type PopperProps = {
|
|
7
|
+
/** Reference element the panel is positioned against. */
|
|
8
|
+
anchor: HTMLElement | null;
|
|
9
|
+
/** Controlled open state. When false (or no anchor) nothing renders. */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** Wanted placement of the panel relative to the anchor. */
|
|
12
|
+
placement?: PopperPlacement;
|
|
13
|
+
/** Main-axis distance (px) between the anchor and the panel. */
|
|
14
|
+
offset?: number;
|
|
15
|
+
/** Flip to the opposite side when the panel would overflow the viewport. */
|
|
16
|
+
flip?: boolean;
|
|
17
|
+
/** Shift along the cross axis to keep the panel within the viewport. */
|
|
18
|
+
shift?: boolean;
|
|
19
|
+
/** Expose a positioned arrow element. */
|
|
20
|
+
arrow?: boolean;
|
|
21
|
+
/** CSS positioning strategy. */
|
|
22
|
+
strategy?: PopperStrategy;
|
|
23
|
+
/** Render the panel into `document.body` via a Portal. */
|
|
24
|
+
portal?: boolean;
|
|
25
|
+
/** Optional class applied to the floating panel. */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Notified whenever the resolved placement changes (after flip). */
|
|
28
|
+
onPlacementChange?: (placement: PopperPlacement) => void;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
/** Split a placement into its side and (optional) alignment. */
|
|
32
|
+
export declare function splitPlacement(placement: PopperPlacement): {
|
|
33
|
+
side: PopperSide;
|
|
34
|
+
align: PopperAlign;
|
|
35
|
+
};
|
|
36
|
+
/** Recompose a side + alignment into a placement string. */
|
|
37
|
+
export declare function joinPlacement(side: PopperSide, align: PopperAlign): PopperPlacement;
|
|
38
|
+
export type Rect = {
|
|
39
|
+
top: number;
|
|
40
|
+
left: number;
|
|
41
|
+
right: number;
|
|
42
|
+
bottom: number;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Pure geometry: compute the panel coordinates (in the chosen strategy's
|
|
48
|
+
* coordinate space) given the anchor rect, the panel size, and options.
|
|
49
|
+
* Returns the resolved placement (after flip) and the top/left coordinates,
|
|
50
|
+
* plus the arrow offset along the main edge.
|
|
51
|
+
*
|
|
52
|
+
* Coordinates are viewport-relative; callers add scroll offsets for the
|
|
53
|
+
* `absolute` strategy. No DOM access here — safe to unit test.
|
|
54
|
+
*/
|
|
55
|
+
export declare function computePosition(anchorRect: Rect, panelWidth: number, panelHeight: number, options: {
|
|
56
|
+
placement: PopperPlacement;
|
|
57
|
+
offset: number;
|
|
58
|
+
flip: boolean;
|
|
59
|
+
shift: boolean;
|
|
60
|
+
viewportWidth: number;
|
|
61
|
+
viewportHeight: number;
|
|
62
|
+
}): {
|
|
63
|
+
placement: PopperPlacement;
|
|
64
|
+
top: number;
|
|
65
|
+
left: number;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Float a panel next to an anchor element. Positioning is recomputed on open,
|
|
69
|
+
* scroll, and resize via `computePosition` (pure geometry shared across
|
|
70
|
+
* frameworks). Renders nothing unless `open` and an `anchor` are provided.
|
|
71
|
+
* SSR-safe: all DOM access happens inside effects.
|
|
72
|
+
*/
|
|
73
|
+
export declare function Popper({ anchor, open, placement, offset, flip, shift, arrow, strategy, portal, className, onPlacementChange, children, }: PopperProps): React.ReactElement | null;
|
|
74
|
+
export declare namespace Popper {
|
|
75
|
+
var displayName: string;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=Popper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../src/Popper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,WAAW,GACX,SAAS,GACT,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,aAAa,GACb,WAAW,CAAC;AAEhB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG;IACxB,yDAAyD;IACzD,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,wEAAwE;IACxE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4DAA4D;IAC5D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,g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ACtB,cAAc,EAAE,MAAM,CAAC;CACxB,GACA;IAAE,SAAS,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAwD3D;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,IAAY,EACZ,SAAoB,EACpB,MAAU,EACV,IAAW,EACX,KAAY,EACZ,KAAa,EACb,QAAqB,EACrB,MAAa,EACb,SAAS,EACT,iBAAiB,EACjB,QAAQ,GACT,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAwGzC;yBArHe,MAAM"}
|
package/dist/Popper.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { classNames } from "./classNames.js";
|
|
4
|
+
import { Portal } from "./Portal.js";
|
|
5
|
+
/** Split a placement into its side and (optional) alignment. */
|
|
6
|
+
export function splitPlacement(placement) {
|
|
7
|
+
const [side, align] = placement.split("-");
|
|
8
|
+
return { side, align: align ?? "center" };
|
|
9
|
+
}
|
|
10
|
+
/** Recompose a side + alignment into a placement string. */
|
|
11
|
+
export function joinPlacement(side, align) {
|
|
12
|
+
return (align === "center" ? side : `${side}-${align}`);
|
|
13
|
+
}
|
|
14
|
+
const OPPOSITE = {
|
|
15
|
+
top: "bottom",
|
|
16
|
+
bottom: "top",
|
|
17
|
+
left: "right",
|
|
18
|
+
right: "left",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Pure geometry: compute the panel coordinates (in the chosen strategy's
|
|
22
|
+
* coordinate space) given the anchor rect, the panel size, and options.
|
|
23
|
+
* Returns the resolved placement (after flip) and the top/left coordinates,
|
|
24
|
+
* plus the arrow offset along the main edge.
|
|
25
|
+
*
|
|
26
|
+
* Coordinates are viewport-relative; callers add scroll offsets for the
|
|
27
|
+
* `absolute` strategy. No DOM access here — safe to unit test.
|
|
28
|
+
*/
|
|
29
|
+
export function computePosition(anchorRect, panelWidth, panelHeight, options) {
|
|
30
|
+
const { offset, flip, shift, viewportWidth, viewportHeight } = options;
|
|
31
|
+
let { side, align } = splitPlacement(options.placement);
|
|
32
|
+
const place = (s, a) => {
|
|
33
|
+
let top = 0;
|
|
34
|
+
let left = 0;
|
|
35
|
+
if (s === "top" || s === "bottom") {
|
|
36
|
+
top = s === "top" ? anchorRect.top - panelHeight - offset : anchorRect.bottom + offset;
|
|
37
|
+
if (a === "start")
|
|
38
|
+
left = anchorRect.left;
|
|
39
|
+
else if (a === "end")
|
|
40
|
+
left = anchorRect.right - panelWidth;
|
|
41
|
+
else
|
|
42
|
+
left = anchorRect.left + anchorRect.width / 2 - panelWidth / 2;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
left = s === "left" ? anchorRect.left - panelWidth - offset : anchorRect.right + offset;
|
|
46
|
+
if (a === "start")
|
|
47
|
+
top = anchorRect.top;
|
|
48
|
+
else if (a === "end")
|
|
49
|
+
top = anchorRect.bottom - panelHeight;
|
|
50
|
+
else
|
|
51
|
+
top = anchorRect.top + anchorRect.height / 2 - panelHeight / 2;
|
|
52
|
+
}
|
|
53
|
+
return { top, left };
|
|
54
|
+
};
|
|
55
|
+
// Flip: if the panel overflows on the chosen side, try the opposite side.
|
|
56
|
+
if (flip) {
|
|
57
|
+
const candidate = place(side, align);
|
|
58
|
+
const overflows = (side === "top" && candidate.top < 0) ||
|
|
59
|
+
(side === "bottom" && candidate.top + panelHeight > viewportHeight) ||
|
|
60
|
+
(side === "left" && candidate.left < 0) ||
|
|
61
|
+
(side === "right" && candidate.left + panelWidth > viewportWidth);
|
|
62
|
+
if (overflows) {
|
|
63
|
+
const flipped = OPPOSITE[side];
|
|
64
|
+
const flippedPos = place(flipped, align);
|
|
65
|
+
const flippedOverflows = (flipped === "top" && flippedPos.top < 0) ||
|
|
66
|
+
(flipped === "bottom" && flippedPos.top + panelHeight > viewportHeight) ||
|
|
67
|
+
(flipped === "left" && flippedPos.left < 0) ||
|
|
68
|
+
(flipped === "right" && flippedPos.left + panelWidth > viewportWidth);
|
|
69
|
+
// Only flip if the opposite side fits better.
|
|
70
|
+
if (!flippedOverflows)
|
|
71
|
+
side = flipped;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
let { top, left } = place(side, align);
|
|
75
|
+
// Shift: clamp along the cross axis so the panel stays in the viewport.
|
|
76
|
+
if (shift) {
|
|
77
|
+
if (side === "top" || side === "bottom") {
|
|
78
|
+
const max = Math.max(0, viewportWidth - panelWidth);
|
|
79
|
+
left = Math.min(Math.max(0, left), max);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const max = Math.max(0, viewportHeight - panelHeight);
|
|
83
|
+
top = Math.min(Math.max(0, top), max);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return { placement: joinPlacement(side, align), top, left };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Float a panel next to an anchor element. Positioning is recomputed on open,
|
|
90
|
+
* scroll, and resize via `computePosition` (pure geometry shared across
|
|
91
|
+
* frameworks). Renders nothing unless `open` and an `anchor` are provided.
|
|
92
|
+
* SSR-safe: all DOM access happens inside effects.
|
|
93
|
+
*/
|
|
94
|
+
export function Popper({ anchor, open = false, placement = "bottom", offset = 8, flip = true, shift = true, arrow = false, strategy = "absolute", portal = true, className, onPlacementChange, children, }) {
|
|
95
|
+
const panelRef = React.useRef(null);
|
|
96
|
+
const [coords, setCoords] = React.useState({
|
|
97
|
+
top: 0,
|
|
98
|
+
left: 0,
|
|
99
|
+
});
|
|
100
|
+
// Placement actually applied (may differ from the requested `placement`
|
|
101
|
+
// after a flip). Defaults to the requested placement.
|
|
102
|
+
const [resolvedPlacement, setResolvedPlacement] = React.useState(placement);
|
|
103
|
+
// Keep latest callback without re-registering listeners.
|
|
104
|
+
const onPlacementChangeRef = React.useRef(onPlacementChange);
|
|
105
|
+
onPlacementChangeRef.current = onPlacementChange;
|
|
106
|
+
React.useEffect(() => {
|
|
107
|
+
if (typeof window === "undefined")
|
|
108
|
+
return;
|
|
109
|
+
if (!open || !anchor)
|
|
110
|
+
return;
|
|
111
|
+
const reposition = () => {
|
|
112
|
+
const panel = panelRef.current;
|
|
113
|
+
if (!panel)
|
|
114
|
+
return;
|
|
115
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
116
|
+
const panelRect = panel.getBoundingClientRect();
|
|
117
|
+
const result = computePosition({
|
|
118
|
+
top: anchorRect.top,
|
|
119
|
+
left: anchorRect.left,
|
|
120
|
+
right: anchorRect.right,
|
|
121
|
+
bottom: anchorRect.bottom,
|
|
122
|
+
width: anchorRect.width,
|
|
123
|
+
height: anchorRect.height,
|
|
124
|
+
}, panelRect.width, panelRect.height, {
|
|
125
|
+
placement,
|
|
126
|
+
offset,
|
|
127
|
+
flip,
|
|
128
|
+
shift,
|
|
129
|
+
viewportWidth: window.innerWidth,
|
|
130
|
+
viewportHeight: window.innerHeight,
|
|
131
|
+
});
|
|
132
|
+
// `absolute` is positioned relative to the document, so add scroll
|
|
133
|
+
// offsets. `fixed` is viewport-relative, so coordinates are used as-is.
|
|
134
|
+
if (strategy === "absolute") {
|
|
135
|
+
setCoords({ top: result.top + window.scrollY, left: result.left + window.scrollX });
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
setCoords({ top: result.top, left: result.left });
|
|
139
|
+
}
|
|
140
|
+
setResolvedPlacement((prev) => {
|
|
141
|
+
if (result.placement !== prev) {
|
|
142
|
+
onPlacementChangeRef.current?.(result.placement);
|
|
143
|
+
}
|
|
144
|
+
return result.placement;
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
reposition();
|
|
148
|
+
const onScroll = () => reposition();
|
|
149
|
+
const onResize = () => reposition();
|
|
150
|
+
window.addEventListener("scroll", onScroll, true);
|
|
151
|
+
window.addEventListener("resize", onResize);
|
|
152
|
+
return () => {
|
|
153
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
154
|
+
window.removeEventListener("resize", onResize);
|
|
155
|
+
};
|
|
156
|
+
}, [anchor, open, placement, offset, flip, shift, strategy]);
|
|
157
|
+
if (!open || !anchor)
|
|
158
|
+
return null;
|
|
159
|
+
const side = splitPlacement(resolvedPlacement).side;
|
|
160
|
+
const panelStyle = {
|
|
161
|
+
position: strategy,
|
|
162
|
+
top: `${coords.top}px`,
|
|
163
|
+
left: `${coords.left}px`,
|
|
164
|
+
};
|
|
165
|
+
const floating = (_jsxs("div", { ref: panelRef, className: classNames("st-popper", className), "data-popper-placement": resolvedPlacement, style: panelStyle, children: [children, arrow ? (_jsx("span", { className: "st-popper__arrow", "data-popper-side": side, "aria-hidden": "true" })) : null] }));
|
|
166
|
+
if (portal) {
|
|
167
|
+
return _jsx(Portal, { target: "body", children: floating });
|
|
168
|
+
}
|
|
169
|
+
return floating;
|
|
170
|
+
}
|
|
171
|
+
Popper.displayName = "Popper";
|
|
172
|
+
//# sourceMappingURL=Popper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popper.js","sourceRoot":"","sources":["../src/Popper.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA+CrC,gEAAgE;AAChE,MAAM,UAAU,cAAc,CAAC,SAA0B;IAIvD,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAA+B,CAAC;IACzE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,CAAC;AAC5C,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,aAAa,CAAC,IAAgB,EAAE,KAAkB;IAChE,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CA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MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE7D,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAElC,MAAM,IAAI,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC;IACpD,MAAM,UAAU,GAAwB;QACtC,QAAQ,EAAE,QAAQ;QAClB,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI;QACtB,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI;KACzB,CAAC;IAEF,MAAM,QAAQ,GAAG,CACf,eACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,2BACtB,iBAAiB,EACxC,KAAK,EAAE,UAAU,aAEhB,QAAQ,EACR,KAAK,CAAC,CAAC,CAAC,CACP,eAAM,SAAS,EAAC,kBAAkB,sBAAmB,IAAI,iBAAc,MAAM,GAAG,CACjF,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;IAEF,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,KAAC,MAAM,IAAC,MAAM,EAAC,MAAM,YAAE,QAAQ,GAAU,CAAC;IACnD,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
package/dist/Portal.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type PortalProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Where to teleport the children. A CSS selector string or an actual
|
|
5
|
+
* `HTMLElement`. Defaults to the document `<body>`.
|
|
6
|
+
*/
|
|
7
|
+
target?: string | HTMLElement;
|
|
8
|
+
/** When `true`, render inline in place (no teleportation). */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Optional class applied to the portal container element. */
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a target prop to an `HTMLElement`. Returns `null` when it cannot be
|
|
16
|
+
* resolved (SSR, missing selector, etc.).
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolvePortalTarget(target: string | HTMLElement | undefined): HTMLElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* Teleport `children` into another part of the DOM via `ReactDOM.createPortal`.
|
|
21
|
+
* SSR-safe: nothing is portalled during the server render or before mount; the
|
|
22
|
+
* portal is created only after the component has mounted on the client. When
|
|
23
|
+
* `disabled` is set the children render inline in place.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Portal({ target, disabled, className, children, }: PortalProps): React.ReactElement | null;
|
|
26
|
+
export declare namespace Portal {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../src/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GACvC,WAAW,GAAG,IAAI,CAOpB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAe,EACf,QAAgB,EAChB,SAAS,EACT,QAAQ,GACT,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA0CzC;yBA/Ce,MAAM"}
|
package/dist/Portal.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
import { classNames } from "./classNames.js";
|
|
5
|
+
/**
|
|
6
|
+
* Resolve a target prop to an `HTMLElement`. Returns `null` when it cannot be
|
|
7
|
+
* resolved (SSR, missing selector, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export function resolvePortalTarget(target) {
|
|
10
|
+
if (typeof document === "undefined")
|
|
11
|
+
return null;
|
|
12
|
+
if (target == null)
|
|
13
|
+
return document.body;
|
|
14
|
+
if (typeof target === "string") {
|
|
15
|
+
return document.querySelector(target) ?? document.body;
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Teleport `children` into another part of the DOM via `ReactDOM.createPortal`.
|
|
21
|
+
* SSR-safe: nothing is portalled during the server render or before mount; the
|
|
22
|
+
* portal is created only after the component has mounted on the client. When
|
|
23
|
+
* `disabled` is set the children render inline in place.
|
|
24
|
+
*/
|
|
25
|
+
export function Portal({ target = "body", disabled = false, className, children, }) {
|
|
26
|
+
// Only create the portal after mount so the server render and the first
|
|
27
|
+
// client render agree (no DOM access during SSR).
|
|
28
|
+
const [mounted, setMounted] = React.useState(false);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
setMounted(true);
|
|
31
|
+
}, []);
|
|
32
|
+
if (disabled) {
|
|
33
|
+
return (_jsx("div", { className: classNames("st-portal", className), "data-st-portal": "inline", children: children }));
|
|
34
|
+
}
|
|
35
|
+
if (!mounted) {
|
|
36
|
+
// SSR / first client render: render inline so markup is produced in place
|
|
37
|
+
// and hydration stays consistent. The effect below re-renders into a portal.
|
|
38
|
+
return (_jsx("div", { className: classNames("st-portal", className), "data-st-portal": "inline", children: children }));
|
|
39
|
+
}
|
|
40
|
+
const destination = resolvePortalTarget(target);
|
|
41
|
+
if (!destination)
|
|
42
|
+
return null;
|
|
43
|
+
return ReactDOM.createPortal(_jsx("div", { className: classNames("st-portal", className), "data-st-portal": "teleported", children: children }), destination);
|
|
44
|
+
}
|
|
45
|
+
Portal.displayName = "Portal";
|
|
46
|
+
//# sourceMappingURL=Portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.js","sourceRoot":"","sources":["../src/Portal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAe7C;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAwC;IAExC,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IACjD,IAAI,MAAM,IAAI,IAAI;QAAE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,QAAQ,CAAC,aAAa,CAAc,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC;IACtE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,MAAM,GAAG,MAAM,EACf,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,QAAQ,GACI;IACZ,wEAAwE;IACxE,kDAAkD;IAClD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CACL,cACE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,oBAC9B,QAAQ,YAEtB,QAAQ,GACL,CACP,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,0EAA0E;QAC1E,6EAA6E;QAC7E,OAAO,CACL,cACE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,oBAC9B,QAAQ,YAEtB,QAAQ,GACL,CACP,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9B,OAAO,QAAQ,CAAC,YAAY,CAC1B,cAAK,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,oBAAiB,YAAY,YAC5E,QAAQ,GACL,EACN,WAAW,CACZ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
package/dist/Rating.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../src/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/Rating.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rating.js","sourceRoot":"","sources":["../src/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideIndicator.d.ts","sourceRoot":"","sources":["../src/SlideIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideIndicator.js","sourceRoot":"","sources":["../src/SlideIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../src/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../src/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/catalog.d.ts
CHANGED
|
@@ -780,5 +780,109 @@ export type UnorderedListProps = React.HTMLAttributes<HTMLUListElement> & {
|
|
|
780
780
|
items: UnorderedListInput[];
|
|
781
781
|
};
|
|
782
782
|
export declare function UnorderedList({ items, className, ...rest }: UnorderedListProps): import("react/jsx-runtime").JSX.Element;
|
|
783
|
+
export type RatingSize = "sm" | "md" | "lg";
|
|
784
|
+
export type RatingProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "onChange"> & {
|
|
785
|
+
/** Note courante (0..max). Pas de 1, ou 0.5 si `allowHalf`. */
|
|
786
|
+
value?: number;
|
|
787
|
+
/** Nombre d'étoiles. */
|
|
788
|
+
max?: number;
|
|
789
|
+
/** Appelé avec la nouvelle note au clic ou au clavier. */
|
|
790
|
+
onChange?: (value: number) => void;
|
|
791
|
+
/** Affichage seul : ni clic ni clavier n'émettent. */
|
|
792
|
+
readonly?: boolean;
|
|
793
|
+
/** Autorise les demi-étoiles (sélection au demi-point). */
|
|
794
|
+
allowHalf?: boolean;
|
|
795
|
+
size?: RatingSize;
|
|
796
|
+
/** Attribut name (utile dans un formulaire / pour la sémantique radio). */
|
|
797
|
+
name?: string;
|
|
798
|
+
/** Étiquette accessible du groupe. */
|
|
799
|
+
label?: string;
|
|
800
|
+
className?: string;
|
|
801
|
+
};
|
|
802
|
+
export declare function Rating({ value, max, onChange, readonly, allowHalf, size, name, label, className, ...rest }: RatingProps): import("react/jsx-runtime").JSX.Element;
|
|
803
|
+
export type TimePickerFormat = "24" | "12";
|
|
804
|
+
export type TimePickerProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "onChange"> & {
|
|
805
|
+
/** Heure courante au format "HH:mm" (24h, toujours). Vide = non renseigné. */
|
|
806
|
+
value?: string;
|
|
807
|
+
/** Appelé avec "HH:mm" lors d'une sélection. */
|
|
808
|
+
onChange?: (value: string) => void;
|
|
809
|
+
/** Pas (en minutes) entre deux créneaux générés. */
|
|
810
|
+
step?: number;
|
|
811
|
+
/** Borne minimale "HH:mm" (inclusive). */
|
|
812
|
+
min?: string;
|
|
813
|
+
/** Borne maximale "HH:mm" (inclusive). */
|
|
814
|
+
max?: string;
|
|
815
|
+
/** Affichage 24h (par défaut) ou 12h (AM/PM). La valeur émise reste "HH:mm". */
|
|
816
|
+
format?: TimePickerFormat;
|
|
817
|
+
size?: "sm" | "md" | "lg";
|
|
818
|
+
disabled?: boolean;
|
|
819
|
+
label?: string;
|
|
820
|
+
className?: string;
|
|
821
|
+
id?: string;
|
|
822
|
+
};
|
|
823
|
+
export declare function TimePicker({ value, onChange, step, min, max, format, size, disabled, label, className, id, ...rest }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
824
|
+
/**
|
|
825
|
+
* En mode simple : `string | null` ("YYYY-MM-DD").
|
|
826
|
+
* En mode plage (`range`) : tuple `[start, end]` où chaque borne est
|
|
827
|
+
* "YYYY-MM-DD" ou null.
|
|
828
|
+
*/
|
|
829
|
+
export type CalendarValue = string | null | [string | null, string | null];
|
|
830
|
+
export type CalendarProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "onChange"> & {
|
|
831
|
+
/** Date sélectionnée ("YYYY-MM-DD") ou tuple [start,end] si `range`. */
|
|
832
|
+
value?: CalendarValue;
|
|
833
|
+
/** Appelé avec la nouvelle date (ou le tuple en mode plage). */
|
|
834
|
+
onChange?: (value: CalendarValue) => void;
|
|
835
|
+
/** Borne minimale "YYYY-MM-DD" (inclusive). */
|
|
836
|
+
min?: string;
|
|
837
|
+
/** Borne maximale "YYYY-MM-DD" (inclusive). */
|
|
838
|
+
max?: string;
|
|
839
|
+
/** Sélection d'une plage de deux dates. */
|
|
840
|
+
range?: boolean;
|
|
841
|
+
/** Premier jour de la semaine : 0 = dimanche, 1 = lundi. */
|
|
842
|
+
weekStartsOn?: 0 | 1;
|
|
843
|
+
locale?: string;
|
|
844
|
+
/** Mois affiché ("YYYY-MM"), contrôlable de l'extérieur. */
|
|
845
|
+
month?: string;
|
|
846
|
+
className?: string;
|
|
847
|
+
previousMonthLabel?: string;
|
|
848
|
+
nextMonthLabel?: string;
|
|
849
|
+
};
|
|
850
|
+
export declare function Calendar({ value, onChange, min, max, range, weekStartsOn, locale, month, className, previousMonthLabel, nextMonthLabel, ...rest }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
851
|
+
export type SlideIndicatorVariant = "dots" | "bars";
|
|
852
|
+
export type SlideIndicatorProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "onChange"> & {
|
|
853
|
+
/** Nombre total de diapositives. */
|
|
854
|
+
count: number;
|
|
855
|
+
/** Index de la diapositive courante (0-based). */
|
|
856
|
+
current?: number;
|
|
857
|
+
/** Appelé avec l'index ciblé au clic ou au clavier. */
|
|
858
|
+
onChange?: (index: number) => void;
|
|
859
|
+
size?: "sm" | "md" | "lg";
|
|
860
|
+
variant?: SlideIndicatorVariant;
|
|
861
|
+
/** Préfixe d'étiquette accessible de chaque point ("Diapositive 1"...). */
|
|
862
|
+
label?: string;
|
|
863
|
+
className?: string;
|
|
864
|
+
};
|
|
865
|
+
export declare function SlideIndicator({ count, current, onChange, size, variant, label, className, ...rest }: SlideIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
866
|
+
export type AutosaveStatus = "idle" | "saving" | "saved" | "error";
|
|
867
|
+
export type AutosaveLabels = {
|
|
868
|
+
idle?: string;
|
|
869
|
+
saving?: string;
|
|
870
|
+
saved?: string;
|
|
871
|
+
error?: string;
|
|
872
|
+
};
|
|
873
|
+
export type AutosaveProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
874
|
+
status?: AutosaveStatus;
|
|
875
|
+
/** Horodatage de la dernière sauvegarde réussie. */
|
|
876
|
+
lastSaved?: string | Date;
|
|
877
|
+
/** Affiche un bouton « Réessayer » sur le statut `error`. */
|
|
878
|
+
onRetry?: () => void;
|
|
879
|
+
/** Surcharge des libellés par statut. */
|
|
880
|
+
labels?: AutosaveLabels;
|
|
881
|
+
/** Étiquette du bouton de relance. */
|
|
882
|
+
retryLabel?: string;
|
|
883
|
+
locale?: string;
|
|
884
|
+
className?: string;
|
|
885
|
+
};
|
|
886
|
+
export declare function Autosave({ status, lastSaved, onRetry, labels, retryLabel, locale, className, ...rest }: AutosaveProps): import("react/jsx-runtime").JSX.Element;
|
|
783
887
|
export {};
|
|
784
888
|
//# sourceMappingURL=catalog.d.ts.map
|