colibri-ui 0.8.78 → 0.8.81

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.
Files changed (51) hide show
  1. package/README.md +6 -0
  2. package/Sheet/Sheet.d.ts +3 -0
  3. package/Sheet/Sheet.js +273 -0
  4. package/Sheet/Sheet.module.css +153 -0
  5. package/Sheet/index.d.ts +2 -0
  6. package/Sheet/index.js +7 -0
  7. package/Sheet/index.props.d.ts +26 -0
  8. package/Sheet/package.json +9 -0
  9. package/Theme/index.d.ts +60 -0
  10. package/Theme/themes/buenos_aires.d.ts +30 -0
  11. package/Theme/themes/buenos_aires.js +30 -0
  12. package/Theme/themes/jaipur.d.ts +30 -0
  13. package/Theme/themes/jaipur.js +30 -0
  14. package/esm/Autocomplete/index.js +1 -0
  15. package/esm/Calendar/index.js +1 -0
  16. package/esm/Card/index.js +1 -0
  17. package/esm/CodeField/index.js +1 -0
  18. package/esm/Drawer/index.js +1 -0
  19. package/esm/Dropzone/index.js +1 -0
  20. package/esm/Editable/index.js +1 -0
  21. package/esm/Icons/index.js +21 -0
  22. package/esm/List/index.js +1 -0
  23. package/esm/NumberInput/index.js +1 -0
  24. package/esm/Progress/index.js +1 -0
  25. package/esm/Rating/index.js +1 -0
  26. package/esm/Sheet/Sheet.d.ts +3 -0
  27. package/esm/Sheet/Sheet.js +263 -0
  28. package/esm/Sheet/Sheet.module.css +153 -0
  29. package/esm/Sheet/index.d.ts +2 -0
  30. package/esm/Sheet/index.js +1 -0
  31. package/esm/Sheet/index.props.d.ts +26 -0
  32. package/esm/Slider/index.js +1 -0
  33. package/esm/Theme/index.d.ts +60 -0
  34. package/esm/Theme/index.js +1 -0
  35. package/esm/Theme/themes/buenos_aires.d.ts +30 -0
  36. package/esm/Theme/themes/buenos_aires.js +30 -0
  37. package/esm/Theme/themes/jaipur.d.ts +30 -0
  38. package/esm/Theme/themes/jaipur.js +30 -0
  39. package/esm/hooks/useMediaSizes/index.d.ts +4 -0
  40. package/esm/hooks/useMediaSizes/index.js +24 -30
  41. package/esm/index.d.ts +2 -0
  42. package/esm/index.js +1 -0
  43. package/esm/theme_ba_variables.css +30 -0
  44. package/esm/theme_jaipur_variables.css +30 -0
  45. package/hooks/useMediaSizes/index.d.ts +4 -0
  46. package/hooks/useMediaSizes/index.js +23 -33
  47. package/index.d.ts +2 -0
  48. package/index.js +3 -0
  49. package/package.json +1 -1
  50. package/theme_ba_variables.css +30 -0
  51. package/theme_jaipur_variables.css +30 -0
@@ -518,6 +518,36 @@ declare const _default: {
518
518
  "component-avatar-font-size-xxxl": string;
519
519
  "component-accordion-text": string;
520
520
  "component-accordion-line": string;
521
+ "component-sheet-bg": string;
522
+ "component-sheet-text": string;
523
+ "component-sheet-secondary": string;
524
+ "component-sheet-overlay": string;
525
+ "component-sheet-radius": string;
526
+ "component-sheet-shadow": string;
527
+ "component-sheet-z-index": string;
528
+ "component-sheet-max-height": string;
529
+ "component-sheet-overlay-blur": string;
530
+ "component-sheet-motion-duration": string;
531
+ "component-sheet-resize-duration": string;
532
+ "component-sheet-motion-easing": string;
533
+ "component-sheet-reduced-motion-duration": string;
534
+ "component-sheet-drag-area-height": string;
535
+ "component-sheet-handle-width": string;
536
+ "component-sheet-handle-height": string;
537
+ "component-sheet-handle-radius": string;
538
+ "component-sheet-handle-opacity": string;
539
+ "component-sheet-header-gap": string;
540
+ "component-sheet-header-padding": string;
541
+ "component-sheet-border-width": string;
542
+ "component-sheet-border-color": string;
543
+ "component-sheet-title-font-size": string;
544
+ "component-sheet-title-line-height": string;
545
+ "component-sheet-title-font-weight": string;
546
+ "component-sheet-description-offset": string;
547
+ "component-sheet-description-font-size": string;
548
+ "component-sheet-body-padding": string;
549
+ "component-sheet-footer-padding-block": string;
550
+ "component-sheet-footer-padding-inline": string;
521
551
  "component-modal-bg": string;
522
552
  "component-modal-border": string;
523
553
  "component-modal-overlay": string;
@@ -524,6 +524,36 @@ var theme_jaipur = {
524
524
  "component-avatar-font-size-xxxl": "9rem",
525
525
  "component-accordion-text": theme_jaipur$1.default.BRAND_JP_EGGPLANT,
526
526
  "component-accordion-line": theme_jaipur$1.default.NEUTRAL_JP_300,
527
+ "component-sheet-bg": "var(--color-bg-surface)",
528
+ "component-sheet-text": "var(--color-text-primary)",
529
+ "component-sheet-secondary": "var(--color-text-secondary)",
530
+ "component-sheet-overlay": "var(--component-modal-overlay)",
531
+ "component-sheet-radius": "var(--radius-xl)",
532
+ "component-sheet-shadow": "var(--shadow-raised)",
533
+ "component-sheet-z-index": "1000",
534
+ "component-sheet-max-height": "96dvh",
535
+ "component-sheet-overlay-blur": "var(--space-3)",
536
+ "component-sheet-motion-duration": "220ms",
537
+ "component-sheet-resize-duration": "200ms",
538
+ "component-sheet-motion-easing": "cubic-bezier(0.2, 0.8, 0.2, 1)",
539
+ "component-sheet-reduced-motion-duration": "0.001ms",
540
+ "component-sheet-drag-area-height": "var(--space-6)",
541
+ "component-sheet-handle-width": "calc(var(--space-10) + var(--space-1))",
542
+ "component-sheet-handle-height": "var(--space-1)",
543
+ "component-sheet-handle-radius": "var(--radius-full)",
544
+ "component-sheet-handle-opacity": "0.45",
545
+ "component-sheet-header-gap": "var(--space-4)",
546
+ "component-sheet-header-padding": "var(--space-3) var(--space-5) var(--space-4)",
547
+ "component-sheet-border-width": "var(--border-width-hairline)",
548
+ "component-sheet-border-color": "var(--color-border-subtle)",
549
+ "component-sheet-title-font-size": "var(--font-size-heading-sm)",
550
+ "component-sheet-title-line-height": "var(--line-height-heading-sm)",
551
+ "component-sheet-title-font-weight": "var(--font-weight-semibold)",
552
+ "component-sheet-description-offset": "var(--space-1)",
553
+ "component-sheet-description-font-size": "var(--font-size-text-sm)",
554
+ "component-sheet-body-padding": "var(--space-5)",
555
+ "component-sheet-footer-padding-block": "var(--space-4)",
556
+ "component-sheet-footer-padding-inline": "var(--space-5)",
527
557
  "component-modal-bg": theme_jaipur$1.default.NEUTRAL_JP_0,
528
558
  "component-modal-border": theme_jaipur$1.default.NEUTRAL_JP_200,
529
559
  "component-modal-overlay": "color-mix(in srgb, var(--palette-black) 25%, transparent)",
@@ -0,0 +1 @@
1
+ export { Autocomplete } from './Autocomplete.js';
@@ -0,0 +1 @@
1
+ export { Calendar } from './Calendar.js';
@@ -0,0 +1 @@
1
+ export { Card, CardContent, CardInnerContent } from './Card.js';
@@ -0,0 +1 @@
1
+ export { CodeField, ONLY_CHARS_PATTERN, ONLY_DIGITS_AND_CHARS_PATTERN, ONLY_DIGITS_PATTERN } from './CodeField.js';
@@ -0,0 +1 @@
1
+ export { Drawer, DrawerContent, DrawerFooter, DrawerHeader } from './Drawer.js';
@@ -0,0 +1 @@
1
+ export { Dropzone } from './Dropzone.js';
@@ -0,0 +1 @@
1
+ export { Editable } from './Editable.js';
@@ -0,0 +1,21 @@
1
+ export { ArrowNext } from './ArrowNext.js';
2
+ export { Cart } from './Cart.js';
3
+ export { Check } from './Check.js';
4
+ export { Chevron } from './Chevron.js';
5
+ export { Close } from './Close.js';
6
+ export { Copy } from './Copy.js';
7
+ export { Cross } from './Cross.js';
8
+ export { CrossFill } from './CrossFill.js';
9
+ export { Edit } from './Edit.js';
10
+ export { Exit } from './Exit.js';
11
+ export { EyeOpen } from './EyeOpen.js';
12
+ export { EyeClosed } from './EyeClosed.js';
13
+ export { Help } from './Help.js';
14
+ export { Info } from './Info.js';
15
+ export { Minus } from './Minus.js';
16
+ export { More } from './More.js';
17
+ export { Plus } from './Plus.js';
18
+ export { Setting } from './Setting.js';
19
+ export { Shield } from './Shield.js';
20
+ export { Trash } from './Trash.js';
21
+ export { User } from './User.js';
@@ -0,0 +1 @@
1
+ export { List, ListItem, ListSection } from './List.js';
@@ -0,0 +1 @@
1
+ export { NumberInput } from './NumberInput.js';
@@ -0,0 +1 @@
1
+ export { Progress } from './Progress.js';
@@ -0,0 +1 @@
1
+ export { Rating } from './Rating.js';
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import type { SheetProps } from "./index.props";
3
+ export declare const Sheet: React.ForwardRefExoticComponent<SheetProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,263 @@
1
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
+ import { __rest } from 'tslib';
4
+ import React, { forwardRef, useState, useRef, useId, useMemo, useEffect } from 'react';
5
+ import { createPortal } from 'react-dom';
6
+ import clsx from 'clsx';
7
+ import styles from './Sheet.module.css';
8
+
9
+ var defaultSnapPoints = ["60dvh"];
10
+ var focusableSelector = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
11
+ var toCssSize = function toCssSize(point) {
12
+ return typeof point === "number" ? "".concat(point, "px") : point;
13
+ };
14
+ var toPixels = function toPixels(point, viewportHeight) {
15
+ if (typeof point === "number") return point;
16
+ var value = Number.parseFloat(point);
17
+ if (!Number.isFinite(value)) return 0;
18
+ if (point.endsWith("%") || point.endsWith("vh") || point.endsWith("dvh")) return viewportHeight * value / 100;
19
+ return value;
20
+ };
21
+ var findPoint = function findPoint(points, preferred) {
22
+ var _a;
23
+ if (preferred !== undefined && points.includes(preferred)) return preferred;
24
+ return (_a = points[0]) !== null && _a !== void 0 ? _a : "60dvh";
25
+ };
26
+ var Sheet = /*#__PURE__*/forwardRef(function SheetComponent(_a, forwardedRef) {
27
+ var open = _a.open,
28
+ onOpenChange = _a.onOpenChange,
29
+ title = _a.title,
30
+ description = _a.description,
31
+ header = _a.header,
32
+ footer = _a.footer,
33
+ _a$snapPoints = _a.snapPoints,
34
+ snapPoints = _a$snapPoints === void 0 ? defaultSnapPoints : _a$snapPoints,
35
+ snapPoint = _a.snapPoint,
36
+ defaultSnapPoint = _a.defaultSnapPoint,
37
+ onSnapPointChange = _a.onSnapPointChange,
38
+ _a$modal = _a.modal,
39
+ modal = _a$modal === void 0 ? true : _a$modal,
40
+ _a$blurOverlay = _a.blurOverlay,
41
+ blurOverlay = _a$blurOverlay === void 0 ? false : _a$blurOverlay,
42
+ _a$closeOnOverlayClic = _a.closeOnOverlayClick,
43
+ closeOnOverlayClick = _a$closeOnOverlayClic === void 0 ? true : _a$closeOnOverlayClic,
44
+ _a$closeOnEscape = _a.closeOnEscape,
45
+ closeOnEscape = _a$closeOnEscape === void 0 ? true : _a$closeOnEscape,
46
+ _a$draggable = _a.draggable,
47
+ draggable = _a$draggable === void 0 ? true : _a$draggable,
48
+ _a$showHandle = _a.showHandle,
49
+ showHandle = _a$showHandle === void 0 ? true : _a$showHandle,
50
+ _a$lockBodyScroll = _a.lockBodyScroll,
51
+ lockBodyScroll = _a$lockBodyScroll === void 0 ? true : _a$lockBodyScroll,
52
+ portalContainer = _a.portalContainer,
53
+ initialFocusRef = _a.initialFocusRef,
54
+ returnFocusRef = _a.returnFocusRef,
55
+ zIndex = _a.zIndex,
56
+ className = _a.className,
57
+ style = _a.style,
58
+ children = _a.children,
59
+ ariaLabel = _a["aria-label"],
60
+ ariaLabelledBy = _a["aria-labelledby"],
61
+ ariaDescribedBy = _a["aria-describedby"],
62
+ rest = __rest(_a, ["open", "onOpenChange", "title", "description", "header", "footer", "snapPoints", "snapPoint", "defaultSnapPoint", "onSnapPointChange", "modal", "blurOverlay", "closeOnOverlayClick", "closeOnEscape", "draggable", "showHandle", "lockBodyScroll", "portalContainer", "initialFocusRef", "returnFocusRef", "zIndex", "className", "style", "children", "aria-label", "aria-labelledby", "aria-describedby"]);
63
+ var normalizedPoints = snapPoints.length ? snapPoints : defaultSnapPoints;
64
+ var controlledSnap = snapPoint !== undefined;
65
+ var _useState = useState(function () {
66
+ return findPoint(normalizedPoints, defaultSnapPoint);
67
+ }),
68
+ _useState2 = _slicedToArray(_useState, 2),
69
+ internalSnap = _useState2[0],
70
+ setInternalSnap = _useState2[1];
71
+ var activeSnap = findPoint(normalizedPoints, controlledSnap ? snapPoint : internalSnap);
72
+ var _useState3 = useState(open),
73
+ _useState4 = _slicedToArray(_useState3, 2),
74
+ rendered = _useState4[0],
75
+ setRendered = _useState4[1];
76
+ var _useState5 = useState(false),
77
+ _useState6 = _slicedToArray(_useState5, 2),
78
+ closing = _useState6[0],
79
+ setClosing = _useState6[1];
80
+ var panelRef = useRef(null);
81
+ var previousFocusRef = useRef(null);
82
+ var dragRef = useRef({
83
+ pointerId: -1,
84
+ startY: 0,
85
+ startHeight: 0,
86
+ currentHeight: 0
87
+ });
88
+ var titleId = useId();
89
+ var descriptionId = useId();
90
+ var setPanelRef = function setPanelRef(node) {
91
+ panelRef.current = node;
92
+ if (typeof forwardedRef === "function") forwardedRef(node);else if (forwardedRef) forwardedRef.current = node;
93
+ };
94
+ var sortedPoints = useMemo(function () {
95
+ return _toConsumableArray(normalizedPoints).sort(function (left, right) {
96
+ var height = typeof window === "undefined" ? 1000 : window.innerHeight;
97
+ return toPixels(left, height) - toPixels(right, height);
98
+ });
99
+ }, [normalizedPoints]);
100
+ var changeSnap = function changeSnap(next) {
101
+ if (!controlledSnap) setInternalSnap(next);
102
+ onSnapPointChange === null || onSnapPointChange === void 0 ? void 0 : onSnapPointChange(next);
103
+ };
104
+ useEffect(function () {
105
+ if (open) {
106
+ setRendered(true);
107
+ setClosing(false);
108
+ return;
109
+ }
110
+ if (!rendered) return;
111
+ setClosing(true);
112
+ var duration = panelRef.current ? Number.parseFloat(getComputedStyle(panelRef.current).animationDuration) * 1000 : 220;
113
+ var timer = window.setTimeout(function () {
114
+ setRendered(false);
115
+ setClosing(false);
116
+ }, Number.isFinite(duration) ? duration : 220);
117
+ return function () {
118
+ return window.clearTimeout(timer);
119
+ };
120
+ }, [open, rendered]);
121
+ useEffect(function () {
122
+ var _a;
123
+ if (!open || typeof document === "undefined") return;
124
+ previousFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
125
+ var returnFocusElement = (_a = returnFocusRef === null || returnFocusRef === void 0 ? void 0 : returnFocusRef.current) !== null && _a !== void 0 ? _a : previousFocusRef.current;
126
+ var previousOverflow = document.body.style.overflow;
127
+ if (modal && lockBodyScroll) document.body.style.overflow = "hidden";
128
+ var frame = window.requestAnimationFrame(function () {
129
+ var _a, _b, _c, _d;
130
+ var first = (_a = panelRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(focusableSelector);
131
+ (_d = (_c = (_b = initialFocusRef === null || initialFocusRef === void 0 ? void 0 : initialFocusRef.current) !== null && _b !== void 0 ? _b : first) !== null && _c !== void 0 ? _c : panelRef.current) === null || _d === void 0 ? void 0 : _d.focus();
132
+ });
133
+ var onKeyDown = function onKeyDown(event) {
134
+ if (event.key === "Escape" && closeOnEscape) {
135
+ event.preventDefault();
136
+ onOpenChange(false, "escape");
137
+ return;
138
+ }
139
+ if (!modal || event.key !== "Tab" || !panelRef.current) return;
140
+ var focusable = Array.from(panelRef.current.querySelectorAll(focusableSelector));
141
+ if (!focusable.length) {
142
+ event.preventDefault();
143
+ panelRef.current.focus();
144
+ return;
145
+ }
146
+ var first = focusable[0];
147
+ var last = focusable[focusable.length - 1];
148
+ if (event.shiftKey && document.activeElement === first) {
149
+ event.preventDefault();
150
+ last.focus();
151
+ } else if (!event.shiftKey && document.activeElement === last) {
152
+ event.preventDefault();
153
+ first.focus();
154
+ }
155
+ };
156
+ document.addEventListener("keydown", onKeyDown);
157
+ return function () {
158
+ window.cancelAnimationFrame(frame);
159
+ document.removeEventListener("keydown", onKeyDown);
160
+ if (modal && lockBodyScroll) document.body.style.overflow = previousOverflow;
161
+ returnFocusElement === null || returnFocusElement === void 0 ? void 0 : returnFocusElement.focus();
162
+ };
163
+ }, [open, modal, lockBodyScroll, closeOnEscape, onOpenChange, initialFocusRef, returnFocusRef]);
164
+ var startDrag = function startDrag(event) {
165
+ if (!draggable || !panelRef.current) return;
166
+ event.currentTarget.setPointerCapture(event.pointerId);
167
+ var height = panelRef.current.getBoundingClientRect().height;
168
+ dragRef.current = {
169
+ pointerId: event.pointerId,
170
+ startY: event.clientY,
171
+ startHeight: height,
172
+ currentHeight: height
173
+ };
174
+ panelRef.current.classList.add(styles.dragging);
175
+ };
176
+ var moveDrag = function moveDrag(event) {
177
+ if (dragRef.current.pointerId !== event.pointerId || !panelRef.current) return;
178
+ var viewportHeight = window.innerHeight;
179
+ var maximum = Math.max.apply(Math, _toConsumableArray(sortedPoints.map(function (point) {
180
+ return toPixels(point, viewportHeight);
181
+ })));
182
+ var nextHeight = Math.max(0, Math.min(maximum, dragRef.current.startHeight - (event.clientY - dragRef.current.startY)));
183
+ dragRef.current.currentHeight = nextHeight;
184
+ panelRef.current.style.height = "".concat(nextHeight, "px");
185
+ };
186
+ var endDrag = function endDrag(event) {
187
+ if (dragRef.current.pointerId !== event.pointerId || !panelRef.current) return;
188
+ event.currentTarget.releasePointerCapture(event.pointerId);
189
+ panelRef.current.classList.remove(styles.dragging);
190
+ var _dragRef$current = dragRef.current,
191
+ currentHeight = _dragRef$current.currentHeight,
192
+ startHeight = _dragRef$current.startHeight;
193
+ dragRef.current.pointerId = -1;
194
+ var pointHeights = sortedPoints.map(function (point) {
195
+ return toPixels(point, window.innerHeight);
196
+ });
197
+ var minimum = pointHeights[0];
198
+ if (currentHeight < Math.min(minimum * 0.65, startHeight * 0.65)) {
199
+ panelRef.current.style.height = toCssSize(activeSnap);
200
+ onOpenChange(false, "drag");
201
+ return;
202
+ }
203
+ var nearest = 0;
204
+ pointHeights.forEach(function (height, index) {
205
+ if (Math.abs(height - currentHeight) < Math.abs(pointHeights[nearest] - currentHeight)) nearest = index;
206
+ });
207
+ var next = sortedPoints[nearest];
208
+ panelRef.current.style.height = toCssSize(next);
209
+ changeSnap(next);
210
+ };
211
+ if (!rendered || typeof document === "undefined") return null;
212
+ var panelStyle = Object.assign(Object.assign({}, style), {
213
+ height: toCssSize(activeSnap)
214
+ });
215
+ var node = /*#__PURE__*/React.createElement("div", {
216
+ className: clsx(styles.root, !modal && styles["non-modal"], closing && styles.closing),
217
+ style: {
218
+ zIndex: zIndex
219
+ }
220
+ }, modal && (/*#__PURE__*/React.createElement("div", {
221
+ className: clsx(styles.overlay, blurOverlay && styles.blur),
222
+ "aria-hidden": "true",
223
+ onClick: function onClick() {
224
+ return closeOnOverlayClick && onOpenChange(false, "overlay");
225
+ }
226
+ })), /*#__PURE__*/React.createElement("div", Object.assign({}, rest, {
227
+ ref: setPanelRef,
228
+ role: "dialog",
229
+ "aria-modal": modal || undefined,
230
+ "aria-label": ariaLabel,
231
+ "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : title ? titleId : undefined,
232
+ "aria-describedby": ariaDescribedBy !== null && ariaDescribedBy !== void 0 ? ariaDescribedBy : description ? descriptionId : undefined,
233
+ tabIndex: -1,
234
+ className: clsx(styles.sheet, className),
235
+ style: panelStyle
236
+ }), (showHandle || draggable) && (/*#__PURE__*/React.createElement("div", {
237
+ className: styles["drag-area"],
238
+ onPointerDown: startDrag,
239
+ onPointerMove: moveDrag,
240
+ onPointerUp: endDrag,
241
+ onPointerCancel: endDrag
242
+ }, showHandle && (/*#__PURE__*/React.createElement("span", {
243
+ className: styles.handle,
244
+ "aria-hidden": "true"
245
+ })))), (title || description || header) && (/*#__PURE__*/React.createElement("header", {
246
+ className: styles.header
247
+ }, /*#__PURE__*/React.createElement("div", {
248
+ className: styles.heading
249
+ }, title && /*#__PURE__*/React.createElement("h2", {
250
+ id: titleId
251
+ }, title), description && /*#__PURE__*/React.createElement("p", {
252
+ id: descriptionId
253
+ }, description)), header && (/*#__PURE__*/React.createElement("div", {
254
+ className: styles["header-actions"]
255
+ }, header)))), /*#__PURE__*/React.createElement("div", {
256
+ className: styles.body
257
+ }, children), footer && /*#__PURE__*/React.createElement("footer", {
258
+ className: styles.footer
259
+ }, footer)));
260
+ return /*#__PURE__*/createPortal(node, portalContainer !== null && portalContainer !== void 0 ? portalContainer : document.body);
261
+ });
262
+
263
+ export { Sheet };
@@ -0,0 +1,153 @@
1
+ .root {
2
+ font-family: var(--font-family-ui);
3
+ inset: 0;
4
+ pointer-events: none;
5
+ position: fixed;
6
+ z-index: var(--component-sheet-z-index);
7
+ }
8
+
9
+ .overlay {
10
+ animation: fade-in var(--component-sheet-motion-duration) ease-out both;
11
+ background: var(--component-sheet-overlay);
12
+ inset: 0;
13
+ pointer-events: auto;
14
+ position: absolute;
15
+ }
16
+
17
+ .blur {
18
+ backdrop-filter: blur(var(--component-sheet-overlay-blur));
19
+ }
20
+
21
+ .sheet {
22
+ animation: sheet-in var(--component-sheet-motion-duration) var(--component-sheet-motion-easing) both;
23
+ background: var(--component-sheet-bg);
24
+ border-radius: var(--component-sheet-radius) var(--component-sheet-radius) 0 0;
25
+ bottom: 0;
26
+ box-shadow: var(--component-sheet-shadow);
27
+ box-sizing: border-box;
28
+ color: var(--component-sheet-text);
29
+ display: flex;
30
+ flex-direction: column;
31
+ left: 0;
32
+ max-height: min(var(--component-sheet-max-height), 100%);
33
+ outline: none;
34
+ overflow: hidden;
35
+ pointer-events: auto;
36
+ position: absolute;
37
+ right: 0;
38
+ transition: height var(--component-sheet-resize-duration) ease, transform var(--component-sheet-motion-duration) ease;
39
+ }
40
+
41
+ .dragging {
42
+ transition: none;
43
+ user-select: none;
44
+ }
45
+
46
+ .drag-area {
47
+ align-items: center;
48
+ cursor: ns-resize;
49
+ display: flex;
50
+ flex: none;
51
+ justify-content: center;
52
+ min-height: var(--component-sheet-drag-area-height);
53
+ touch-action: none;
54
+ }
55
+
56
+ .handle {
57
+ background: var(--component-sheet-secondary);
58
+ border-radius: var(--component-sheet-handle-radius);
59
+ height: var(--component-sheet-handle-height);
60
+ opacity: var(--component-sheet-handle-opacity);
61
+ width: var(--component-sheet-handle-width);
62
+ }
63
+
64
+ .header {
65
+ align-items: flex-start;
66
+ border-bottom: var(--component-sheet-border-width) solid var(--component-sheet-border-color);
67
+ display: flex;
68
+ flex: none;
69
+ gap: var(--component-sheet-header-gap);
70
+ padding: var(--component-sheet-header-padding);
71
+ }
72
+
73
+ .heading {
74
+ flex: 1;
75
+ min-width: 0;
76
+ }
77
+
78
+ .heading h2 {
79
+ font-size: var(--component-sheet-title-font-size);
80
+ font-weight: var(--component-sheet-title-font-weight);
81
+ line-height: var(--component-sheet-title-line-height);
82
+ margin: 0;
83
+ }
84
+
85
+ .heading p {
86
+ color: var(--component-sheet-secondary);
87
+ font-size: var(--component-sheet-description-font-size);
88
+ margin: var(--component-sheet-description-offset) 0 0;
89
+ }
90
+
91
+ .header-actions {
92
+ align-items: center;
93
+ display: flex;
94
+ flex: none;
95
+ }
96
+
97
+ .body {
98
+ flex: 1;
99
+ min-height: 0;
100
+ overflow: auto;
101
+ overscroll-behavior: contain;
102
+ padding: var(--component-sheet-body-padding);
103
+ }
104
+
105
+ .footer {
106
+ background: var(--component-sheet-bg);
107
+ border-top: var(--component-sheet-border-width) solid var(--component-sheet-border-color);
108
+ flex: none;
109
+ padding: var(--component-sheet-footer-padding-block) var(--component-sheet-footer-padding-inline) max(var(--component-sheet-footer-padding-block), env(safe-area-inset-bottom));
110
+ }
111
+
112
+ .closing .overlay {
113
+ animation: fade-out var(--component-sheet-motion-duration) ease-in both;
114
+ }
115
+
116
+ .closing .sheet {
117
+ animation: sheet-out var(--component-sheet-motion-duration) ease-in both;
118
+ }
119
+
120
+ .non-modal {
121
+ height: 100%;
122
+ inset: auto 0 0;
123
+ }
124
+
125
+ @keyframes fade-in {
126
+ from {
127
+ opacity: 0;
128
+ }
129
+ }
130
+ @keyframes fade-out {
131
+ to {
132
+ opacity: 0;
133
+ }
134
+ }
135
+ @keyframes sheet-in {
136
+ from {
137
+ transform: translateY(100%);
138
+ }
139
+ }
140
+ @keyframes sheet-out {
141
+ to {
142
+ transform: translateY(100%);
143
+ }
144
+ }
145
+ @media (prefers-reduced-motion: reduce) {
146
+ .overlay,
147
+ .sheet,
148
+ .closing .overlay,
149
+ .closing .sheet {
150
+ animation-duration: var(--component-sheet-reduced-motion-duration);
151
+ transition-duration: var(--component-sheet-reduced-motion-duration);
152
+ }
153
+ }
@@ -0,0 +1,2 @@
1
+ export { Sheet } from "./Sheet";
2
+ export type { SheetProps, SheetSnapPoint, SheetCloseReason, } from "./index.props";
@@ -0,0 +1 @@
1
+ export { Sheet } from './Sheet.js';
@@ -0,0 +1,26 @@
1
+ import type { HTMLAttributes, ReactNode, RefObject } from "react";
2
+ export type SheetSnapPoint = number | `${number}px` | `${number}%` | `${number}vh` | `${number}dvh`;
3
+ export type SheetCloseReason = "overlay" | "escape" | "drag";
4
+ export interface SheetProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "onChange"> {
5
+ open: boolean;
6
+ onOpenChange: (open: boolean, reason?: SheetCloseReason) => void;
7
+ title?: ReactNode;
8
+ description?: ReactNode;
9
+ header?: ReactNode;
10
+ footer?: ReactNode;
11
+ snapPoints?: readonly SheetSnapPoint[];
12
+ snapPoint?: SheetSnapPoint;
13
+ defaultSnapPoint?: SheetSnapPoint;
14
+ onSnapPointChange?: (snapPoint: SheetSnapPoint) => void;
15
+ modal?: boolean;
16
+ blurOverlay?: boolean;
17
+ closeOnOverlayClick?: boolean;
18
+ closeOnEscape?: boolean;
19
+ draggable?: boolean;
20
+ showHandle?: boolean;
21
+ lockBodyScroll?: boolean;
22
+ portalContainer?: HTMLElement | null;
23
+ initialFocusRef?: RefObject<HTMLElement | null>;
24
+ returnFocusRef?: RefObject<HTMLElement | null>;
25
+ zIndex?: number;
26
+ }
@@ -0,0 +1 @@
1
+ export { Slider } from './Slider.js';
@@ -597,6 +597,36 @@ export declare const THEMES: {
597
597
  "component-avatar-font-size-xxxl": string;
598
598
  "component-accordion-text": string;
599
599
  "component-accordion-line": string;
600
+ "component-sheet-bg": string;
601
+ "component-sheet-text": string;
602
+ "component-sheet-secondary": string;
603
+ "component-sheet-overlay": string;
604
+ "component-sheet-radius": string;
605
+ "component-sheet-shadow": string;
606
+ "component-sheet-z-index": string;
607
+ "component-sheet-max-height": string;
608
+ "component-sheet-overlay-blur": string;
609
+ "component-sheet-motion-duration": string;
610
+ "component-sheet-resize-duration": string;
611
+ "component-sheet-motion-easing": string;
612
+ "component-sheet-reduced-motion-duration": string;
613
+ "component-sheet-drag-area-height": string;
614
+ "component-sheet-handle-width": string;
615
+ "component-sheet-handle-height": string;
616
+ "component-sheet-handle-radius": string;
617
+ "component-sheet-handle-opacity": string;
618
+ "component-sheet-header-gap": string;
619
+ "component-sheet-header-padding": string;
620
+ "component-sheet-border-width": string;
621
+ "component-sheet-border-color": string;
622
+ "component-sheet-title-font-size": string;
623
+ "component-sheet-title-line-height": string;
624
+ "component-sheet-title-font-weight": string;
625
+ "component-sheet-description-offset": string;
626
+ "component-sheet-description-font-size": string;
627
+ "component-sheet-body-padding": string;
628
+ "component-sheet-footer-padding-block": string;
629
+ "component-sheet-footer-padding-inline": string;
600
630
  "component-modal-bg": string;
601
631
  "component-modal-border": string;
602
632
  "component-modal-overlay": string;
@@ -1384,6 +1414,36 @@ export declare const THEMES: {
1384
1414
  "component-avatar-font-size-xxxl": string;
1385
1415
  "component-accordion-text": string;
1386
1416
  "component-accordion-line": string;
1417
+ "component-sheet-bg": string;
1418
+ "component-sheet-text": string;
1419
+ "component-sheet-secondary": string;
1420
+ "component-sheet-overlay": string;
1421
+ "component-sheet-radius": string;
1422
+ "component-sheet-shadow": string;
1423
+ "component-sheet-z-index": string;
1424
+ "component-sheet-max-height": string;
1425
+ "component-sheet-overlay-blur": string;
1426
+ "component-sheet-motion-duration": string;
1427
+ "component-sheet-resize-duration": string;
1428
+ "component-sheet-motion-easing": string;
1429
+ "component-sheet-reduced-motion-duration": string;
1430
+ "component-sheet-drag-area-height": string;
1431
+ "component-sheet-handle-width": string;
1432
+ "component-sheet-handle-height": string;
1433
+ "component-sheet-handle-radius": string;
1434
+ "component-sheet-handle-opacity": string;
1435
+ "component-sheet-header-gap": string;
1436
+ "component-sheet-header-padding": string;
1437
+ "component-sheet-border-width": string;
1438
+ "component-sheet-border-color": string;
1439
+ "component-sheet-title-font-size": string;
1440
+ "component-sheet-title-line-height": string;
1441
+ "component-sheet-title-font-weight": string;
1442
+ "component-sheet-description-offset": string;
1443
+ "component-sheet-description-font-size": string;
1444
+ "component-sheet-body-padding": string;
1445
+ "component-sheet-footer-padding-block": string;
1446
+ "component-sheet-footer-padding-inline": string;
1387
1447
  "component-modal-bg": string;
1388
1448
  "component-modal-border": string;
1389
1449
  "component-modal-overlay": string;