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.
- package/README.md +6 -0
- package/Sheet/Sheet.d.ts +3 -0
- package/Sheet/Sheet.js +273 -0
- package/Sheet/Sheet.module.css +153 -0
- package/Sheet/index.d.ts +2 -0
- package/Sheet/index.js +7 -0
- package/Sheet/index.props.d.ts +26 -0
- package/Sheet/package.json +9 -0
- package/Theme/index.d.ts +60 -0
- package/Theme/themes/buenos_aires.d.ts +30 -0
- package/Theme/themes/buenos_aires.js +30 -0
- package/Theme/themes/jaipur.d.ts +30 -0
- package/Theme/themes/jaipur.js +30 -0
- package/esm/Autocomplete/index.js +1 -0
- package/esm/Calendar/index.js +1 -0
- package/esm/Card/index.js +1 -0
- package/esm/CodeField/index.js +1 -0
- package/esm/Drawer/index.js +1 -0
- package/esm/Dropzone/index.js +1 -0
- package/esm/Editable/index.js +1 -0
- package/esm/Icons/index.js +21 -0
- package/esm/List/index.js +1 -0
- package/esm/NumberInput/index.js +1 -0
- package/esm/Progress/index.js +1 -0
- package/esm/Rating/index.js +1 -0
- package/esm/Sheet/Sheet.d.ts +3 -0
- package/esm/Sheet/Sheet.js +263 -0
- package/esm/Sheet/Sheet.module.css +153 -0
- package/esm/Sheet/index.d.ts +2 -0
- package/esm/Sheet/index.js +1 -0
- package/esm/Sheet/index.props.d.ts +26 -0
- package/esm/Slider/index.js +1 -0
- package/esm/Theme/index.d.ts +60 -0
- package/esm/Theme/index.js +1 -0
- package/esm/Theme/themes/buenos_aires.d.ts +30 -0
- package/esm/Theme/themes/buenos_aires.js +30 -0
- package/esm/Theme/themes/jaipur.d.ts +30 -0
- package/esm/Theme/themes/jaipur.js +30 -0
- package/esm/hooks/useMediaSizes/index.d.ts +4 -0
- package/esm/hooks/useMediaSizes/index.js +24 -30
- package/esm/index.d.ts +2 -0
- package/esm/index.js +1 -0
- package/esm/theme_ba_variables.css +30 -0
- package/esm/theme_jaipur_variables.css +30 -0
- package/hooks/useMediaSizes/index.d.ts +4 -0
- package/hooks/useMediaSizes/index.js +23 -33
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/package.json +1 -1
- package/theme_ba_variables.css +30 -0
- package/theme_jaipur_variables.css +30 -0
package/esm/Theme/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BUTTON_TOKENS } from '../Button/tokens.js';
|
|
2
2
|
import theme_jaipur from './themes/jaipur.js';
|
|
3
3
|
import THEME_BA from './themes/buenos_aires.js';
|
|
4
|
+
export { BREAKPOINTS, media } from './breakpoints.js';
|
|
4
5
|
|
|
5
6
|
var THEMES = {
|
|
6
7
|
JAIPUR: Object.assign(Object.assign({}, theme_jaipur), BUTTON_TOKENS),
|
|
@@ -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;
|
|
@@ -520,6 +520,36 @@ var THEME_BA = {
|
|
|
520
520
|
"component-avatar-font-size-xxxl": "9rem",
|
|
521
521
|
"component-accordion-text": Color.BRAND_BA_FOREST,
|
|
522
522
|
"component-accordion-line": Color.NEUTRAL_BA_300,
|
|
523
|
+
"component-sheet-bg": "var(--color-bg-surface)",
|
|
524
|
+
"component-sheet-text": "var(--color-text-primary)",
|
|
525
|
+
"component-sheet-secondary": "var(--color-text-secondary)",
|
|
526
|
+
"component-sheet-overlay": "var(--component-modal-overlay)",
|
|
527
|
+
"component-sheet-radius": "var(--radius-xl)",
|
|
528
|
+
"component-sheet-shadow": "var(--shadow-raised)",
|
|
529
|
+
"component-sheet-z-index": "1000",
|
|
530
|
+
"component-sheet-max-height": "96dvh",
|
|
531
|
+
"component-sheet-overlay-blur": "var(--space-3)",
|
|
532
|
+
"component-sheet-motion-duration": "220ms",
|
|
533
|
+
"component-sheet-resize-duration": "200ms",
|
|
534
|
+
"component-sheet-motion-easing": "cubic-bezier(0.2, 0.8, 0.2, 1)",
|
|
535
|
+
"component-sheet-reduced-motion-duration": "0.001ms",
|
|
536
|
+
"component-sheet-drag-area-height": "var(--space-6)",
|
|
537
|
+
"component-sheet-handle-width": "calc(var(--space-10) + var(--space-1))",
|
|
538
|
+
"component-sheet-handle-height": "var(--space-1)",
|
|
539
|
+
"component-sheet-handle-radius": "var(--radius-full)",
|
|
540
|
+
"component-sheet-handle-opacity": "0.45",
|
|
541
|
+
"component-sheet-header-gap": "var(--space-4)",
|
|
542
|
+
"component-sheet-header-padding": "var(--space-3) var(--space-5) var(--space-4)",
|
|
543
|
+
"component-sheet-border-width": "var(--border-width-hairline)",
|
|
544
|
+
"component-sheet-border-color": "var(--color-border-subtle)",
|
|
545
|
+
"component-sheet-title-font-size": "var(--font-size-heading-sm)",
|
|
546
|
+
"component-sheet-title-line-height": "var(--line-height-heading-sm)",
|
|
547
|
+
"component-sheet-title-font-weight": "var(--font-weight-semibold)",
|
|
548
|
+
"component-sheet-description-offset": "var(--space-1)",
|
|
549
|
+
"component-sheet-description-font-size": "var(--font-size-text-sm)",
|
|
550
|
+
"component-sheet-body-padding": "var(--space-5)",
|
|
551
|
+
"component-sheet-footer-padding-block": "var(--space-4)",
|
|
552
|
+
"component-sheet-footer-padding-inline": "var(--space-5)",
|
|
523
553
|
"component-modal-bg": Color.NEUTRAL_BA_0,
|
|
524
554
|
"component-modal-border": Color.NEUTRAL_BA_200,
|
|
525
555
|
"component-modal-overlay": "rgb(22 51 0 / 28%)",
|
|
@@ -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;
|
|
@@ -520,6 +520,36 @@ var theme_jaipur = {
|
|
|
520
520
|
"component-avatar-font-size-xxxl": "9rem",
|
|
521
521
|
"component-accordion-text": Color.BRAND_JP_EGGPLANT,
|
|
522
522
|
"component-accordion-line": Color.NEUTRAL_JP_300,
|
|
523
|
+
"component-sheet-bg": "var(--color-bg-surface)",
|
|
524
|
+
"component-sheet-text": "var(--color-text-primary)",
|
|
525
|
+
"component-sheet-secondary": "var(--color-text-secondary)",
|
|
526
|
+
"component-sheet-overlay": "var(--component-modal-overlay)",
|
|
527
|
+
"component-sheet-radius": "var(--radius-xl)",
|
|
528
|
+
"component-sheet-shadow": "var(--shadow-raised)",
|
|
529
|
+
"component-sheet-z-index": "1000",
|
|
530
|
+
"component-sheet-max-height": "96dvh",
|
|
531
|
+
"component-sheet-overlay-blur": "var(--space-3)",
|
|
532
|
+
"component-sheet-motion-duration": "220ms",
|
|
533
|
+
"component-sheet-resize-duration": "200ms",
|
|
534
|
+
"component-sheet-motion-easing": "cubic-bezier(0.2, 0.8, 0.2, 1)",
|
|
535
|
+
"component-sheet-reduced-motion-duration": "0.001ms",
|
|
536
|
+
"component-sheet-drag-area-height": "var(--space-6)",
|
|
537
|
+
"component-sheet-handle-width": "calc(var(--space-10) + var(--space-1))",
|
|
538
|
+
"component-sheet-handle-height": "var(--space-1)",
|
|
539
|
+
"component-sheet-handle-radius": "var(--radius-full)",
|
|
540
|
+
"component-sheet-handle-opacity": "0.45",
|
|
541
|
+
"component-sheet-header-gap": "var(--space-4)",
|
|
542
|
+
"component-sheet-header-padding": "var(--space-3) var(--space-5) var(--space-4)",
|
|
543
|
+
"component-sheet-border-width": "var(--border-width-hairline)",
|
|
544
|
+
"component-sheet-border-color": "var(--color-border-subtle)",
|
|
545
|
+
"component-sheet-title-font-size": "var(--font-size-heading-sm)",
|
|
546
|
+
"component-sheet-title-line-height": "var(--line-height-heading-sm)",
|
|
547
|
+
"component-sheet-title-font-weight": "var(--font-weight-semibold)",
|
|
548
|
+
"component-sheet-description-offset": "var(--space-1)",
|
|
549
|
+
"component-sheet-description-font-size": "var(--font-size-text-sm)",
|
|
550
|
+
"component-sheet-body-padding": "var(--space-5)",
|
|
551
|
+
"component-sheet-footer-padding-block": "var(--space-4)",
|
|
552
|
+
"component-sheet-footer-padding-inline": "var(--space-5)",
|
|
523
553
|
"component-modal-bg": Color.NEUTRAL_JP_0,
|
|
524
554
|
"component-modal-border": Color.NEUTRAL_JP_200,
|
|
525
555
|
"component-modal-overlay": "color-mix(in srgb, var(--palette-black) 25%, transparent)",
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Media } from "../../Theme/breakpoints";
|
|
2
2
|
export type QueryInputFunction = (breakpoints: Media) => string;
|
|
3
3
|
type QueryInput = QueryInputFunction | string;
|
|
4
|
+
/**
|
|
5
|
+
* Returns whether the media query matches.
|
|
6
|
+
* Returns `false` on the server and during hydration, the real value right after.
|
|
7
|
+
*/
|
|
4
8
|
export declare const useMediaSizes: (queryInput: QueryInput) => boolean;
|
|
5
9
|
export {};
|
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
1
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
3
2
|
import { media } from '../../Theme/breakpoints.js';
|
|
4
3
|
|
|
5
|
-
var
|
|
4
|
+
var getServerSnapshot = function getServerSnapshot() {
|
|
5
|
+
return false;
|
|
6
|
+
};
|
|
7
|
+
var getMediaQueryList = function getMediaQueryList(query) {
|
|
8
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query) : null;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Returns whether the media query matches.
|
|
12
|
+
* Returns `false` on the server and during hydration, the real value right after.
|
|
13
|
+
*/
|
|
6
14
|
var useMediaSizes = function useMediaSizes(queryInput) {
|
|
7
|
-
|
|
8
|
-
query =
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}),
|
|
16
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
-
match = _useState2[0],
|
|
18
|
-
setMatch = _useState2[1];
|
|
19
|
-
useEffect(function () {
|
|
20
|
-
if (!matchMedia) return undefined;
|
|
21
|
-
var active = true;
|
|
22
|
-
var queryList = matchMedia(query);
|
|
23
|
-
var updateMatch = function updateMatch() {
|
|
24
|
-
if (active) {
|
|
25
|
-
setMatch(queryList.matches);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
updateMatch();
|
|
29
|
-
queryList.addEventListener("change", updateMatch);
|
|
15
|
+
// A function input is a new function every render: memoize on the query string.
|
|
16
|
+
var query = (typeof queryInput === "function" ? queryInput(media) : queryInput).replace(/^\s*@media\s*/, "");
|
|
17
|
+
var subscribe = useCallback(function (onChange) {
|
|
18
|
+
var queryList = getMediaQueryList(query);
|
|
19
|
+
if (!queryList) return function () {};
|
|
20
|
+
queryList.addEventListener("change", onChange);
|
|
30
21
|
return function () {
|
|
31
|
-
|
|
32
|
-
queryList.removeEventListener("change", updateMatch);
|
|
22
|
+
return queryList.removeEventListener("change", onChange);
|
|
33
23
|
};
|
|
34
|
-
});
|
|
35
|
-
|
|
24
|
+
}, [query]);
|
|
25
|
+
var getSnapshot = useCallback(function () {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
return (_b = (_a = getMediaQueryList(query)) === null || _a === void 0 ? void 0 : _a.matches) !== null && _b !== void 0 ? _b : false;
|
|
28
|
+
}, [query]);
|
|
29
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
36
30
|
};
|
|
37
31
|
|
|
38
32
|
export { useMediaSizes };
|
package/esm/index.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ export { Select } from "./Select";
|
|
|
64
64
|
export type { SelectProps } from "./Select/index.props";
|
|
65
65
|
export { Separator } from "./Separator";
|
|
66
66
|
export type { SeparatorProps } from "./Separator/index.props";
|
|
67
|
+
export { Sheet } from "./Sheet";
|
|
68
|
+
export type { SheetProps, SheetSnapPoint, SheetCloseReason } from "./Sheet";
|
|
67
69
|
export { SkeletonRect, SkeletonText } from "./Skeleton";
|
|
68
70
|
export type { RectProps as SkeletonRectProps, TextProps as SkeletonTextProps, } from "./Skeleton/index.props";
|
|
69
71
|
export { Slider } from "./Slider";
|
package/esm/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export { RadioGroup } from './RadioGroup/index.js';
|
|
|
31
31
|
export { Rating } from './Rating/Rating.js';
|
|
32
32
|
export { Select } from './Select/index.js';
|
|
33
33
|
export { Separator } from './Separator/index.js';
|
|
34
|
+
export { Sheet } from './Sheet/Sheet.js';
|
|
34
35
|
export { SkeletonRect, SkeletonText } from './Skeleton/index.js';
|
|
35
36
|
export { Slider } from './Slider/Slider.js';
|
|
36
37
|
export { Status } from './Status/index.js';
|
|
@@ -518,6 +518,36 @@
|
|
|
518
518
|
--component-avatar-font-size-xxxl: 9rem;
|
|
519
519
|
--component-accordion-text: #163300;
|
|
520
520
|
--component-accordion-line: #CBD2C8;
|
|
521
|
+
--component-sheet-bg: var(--color-bg-surface);
|
|
522
|
+
--component-sheet-text: var(--color-text-primary);
|
|
523
|
+
--component-sheet-secondary: var(--color-text-secondary);
|
|
524
|
+
--component-sheet-overlay: var(--component-modal-overlay);
|
|
525
|
+
--component-sheet-radius: var(--radius-xl);
|
|
526
|
+
--component-sheet-shadow: var(--shadow-raised);
|
|
527
|
+
--component-sheet-z-index: 1000;
|
|
528
|
+
--component-sheet-max-height: 96dvh;
|
|
529
|
+
--component-sheet-overlay-blur: var(--space-3);
|
|
530
|
+
--component-sheet-motion-duration: 220ms;
|
|
531
|
+
--component-sheet-resize-duration: 200ms;
|
|
532
|
+
--component-sheet-motion-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
533
|
+
--component-sheet-reduced-motion-duration: 0.001ms;
|
|
534
|
+
--component-sheet-drag-area-height: var(--space-6);
|
|
535
|
+
--component-sheet-handle-width: calc(var(--space-10) + var(--space-1));
|
|
536
|
+
--component-sheet-handle-height: var(--space-1);
|
|
537
|
+
--component-sheet-handle-radius: var(--radius-full);
|
|
538
|
+
--component-sheet-handle-opacity: 0.45;
|
|
539
|
+
--component-sheet-header-gap: var(--space-4);
|
|
540
|
+
--component-sheet-header-padding: var(--space-3) var(--space-5) var(--space-4);
|
|
541
|
+
--component-sheet-border-width: var(--border-width-hairline);
|
|
542
|
+
--component-sheet-border-color: var(--color-border-subtle);
|
|
543
|
+
--component-sheet-title-font-size: var(--font-size-heading-sm);
|
|
544
|
+
--component-sheet-title-line-height: var(--line-height-heading-sm);
|
|
545
|
+
--component-sheet-title-font-weight: var(--font-weight-semibold);
|
|
546
|
+
--component-sheet-description-offset: var(--space-1);
|
|
547
|
+
--component-sheet-description-font-size: var(--font-size-text-sm);
|
|
548
|
+
--component-sheet-body-padding: var(--space-5);
|
|
549
|
+
--component-sheet-footer-padding-block: var(--space-4);
|
|
550
|
+
--component-sheet-footer-padding-inline: var(--space-5);
|
|
521
551
|
--component-modal-bg: #FFFFFF;
|
|
522
552
|
--component-modal-border: #E2E7DF;
|
|
523
553
|
--component-modal-overlay: rgb(22 51 0 / 28%);
|
|
@@ -518,6 +518,36 @@
|
|
|
518
518
|
--component-avatar-font-size-xxxl: 9rem;
|
|
519
519
|
--component-accordion-text: #2C2242;
|
|
520
520
|
--component-accordion-line: #D0CECC;
|
|
521
|
+
--component-sheet-bg: var(--color-bg-surface);
|
|
522
|
+
--component-sheet-text: var(--color-text-primary);
|
|
523
|
+
--component-sheet-secondary: var(--color-text-secondary);
|
|
524
|
+
--component-sheet-overlay: var(--component-modal-overlay);
|
|
525
|
+
--component-sheet-radius: var(--radius-xl);
|
|
526
|
+
--component-sheet-shadow: var(--shadow-raised);
|
|
527
|
+
--component-sheet-z-index: 1000;
|
|
528
|
+
--component-sheet-max-height: 96dvh;
|
|
529
|
+
--component-sheet-overlay-blur: var(--space-3);
|
|
530
|
+
--component-sheet-motion-duration: 220ms;
|
|
531
|
+
--component-sheet-resize-duration: 200ms;
|
|
532
|
+
--component-sheet-motion-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
533
|
+
--component-sheet-reduced-motion-duration: 0.001ms;
|
|
534
|
+
--component-sheet-drag-area-height: var(--space-6);
|
|
535
|
+
--component-sheet-handle-width: calc(var(--space-10) + var(--space-1));
|
|
536
|
+
--component-sheet-handle-height: var(--space-1);
|
|
537
|
+
--component-sheet-handle-radius: var(--radius-full);
|
|
538
|
+
--component-sheet-handle-opacity: 0.45;
|
|
539
|
+
--component-sheet-header-gap: var(--space-4);
|
|
540
|
+
--component-sheet-header-padding: var(--space-3) var(--space-5) var(--space-4);
|
|
541
|
+
--component-sheet-border-width: var(--border-width-hairline);
|
|
542
|
+
--component-sheet-border-color: var(--color-border-subtle);
|
|
543
|
+
--component-sheet-title-font-size: var(--font-size-heading-sm);
|
|
544
|
+
--component-sheet-title-line-height: var(--line-height-heading-sm);
|
|
545
|
+
--component-sheet-title-font-weight: var(--font-weight-semibold);
|
|
546
|
+
--component-sheet-description-offset: var(--space-1);
|
|
547
|
+
--component-sheet-description-font-size: var(--font-size-text-sm);
|
|
548
|
+
--component-sheet-body-padding: var(--space-5);
|
|
549
|
+
--component-sheet-footer-padding-block: var(--space-4);
|
|
550
|
+
--component-sheet-footer-padding-inline: var(--space-5);
|
|
521
551
|
--component-modal-bg: #FFFFFF;
|
|
522
552
|
--component-modal-border: #E4E3DF;
|
|
523
553
|
--component-modal-overlay: color-mix(in srgb, var(--palette-black) 25%, transparent);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Media } from "../../Theme/breakpoints";
|
|
2
2
|
export type QueryInputFunction = (breakpoints: Media) => string;
|
|
3
3
|
type QueryInput = QueryInputFunction | string;
|
|
4
|
+
/**
|
|
5
|
+
* Returns whether the media query matches.
|
|
6
|
+
* Returns `false` on the server and during hydration, the real value right after.
|
|
7
|
+
*/
|
|
4
8
|
export declare const useMediaSizes: (queryInput: QueryInput) => boolean;
|
|
5
9
|
export {};
|
|
@@ -1,44 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
3
|
var React = require('react');
|
|
5
4
|
var breakpoints = require('../../Theme/breakpoints.js');
|
|
6
5
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var getServerSnapshot = function getServerSnapshot() {
|
|
7
|
+
return false;
|
|
8
|
+
};
|
|
9
|
+
var getMediaQueryList = function getMediaQueryList(query) {
|
|
10
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query) : null;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Returns whether the media query matches.
|
|
14
|
+
* Returns `false` on the server and during hydration, the real value right after.
|
|
15
|
+
*/
|
|
12
16
|
var useMediaSizes = function useMediaSizes(queryInput) {
|
|
13
|
-
|
|
14
|
-
query =
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}),
|
|
22
|
-
_useState2 = _slicedToArray__default.default(_useState, 2),
|
|
23
|
-
match = _useState2[0],
|
|
24
|
-
setMatch = _useState2[1];
|
|
25
|
-
React.useEffect(function () {
|
|
26
|
-
if (!matchMedia) return undefined;
|
|
27
|
-
var active = true;
|
|
28
|
-
var queryList = matchMedia(query);
|
|
29
|
-
var updateMatch = function updateMatch() {
|
|
30
|
-
if (active) {
|
|
31
|
-
setMatch(queryList.matches);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
updateMatch();
|
|
35
|
-
queryList.addEventListener("change", updateMatch);
|
|
17
|
+
// A function input is a new function every render: memoize on the query string.
|
|
18
|
+
var query = (typeof queryInput === "function" ? queryInput(breakpoints.media) : queryInput).replace(/^\s*@media\s*/, "");
|
|
19
|
+
var subscribe = React.useCallback(function (onChange) {
|
|
20
|
+
var queryList = getMediaQueryList(query);
|
|
21
|
+
if (!queryList) return function () {};
|
|
22
|
+
queryList.addEventListener("change", onChange);
|
|
36
23
|
return function () {
|
|
37
|
-
|
|
38
|
-
queryList.removeEventListener("change", updateMatch);
|
|
24
|
+
return queryList.removeEventListener("change", onChange);
|
|
39
25
|
};
|
|
40
|
-
});
|
|
41
|
-
|
|
26
|
+
}, [query]);
|
|
27
|
+
var getSnapshot = React.useCallback(function () {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
return (_b = (_a = getMediaQueryList(query)) === null || _a === void 0 ? void 0 : _a.matches) !== null && _b !== void 0 ? _b : false;
|
|
30
|
+
}, [query]);
|
|
31
|
+
return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
42
32
|
};
|
|
43
33
|
|
|
44
34
|
exports.useMediaSizes = useMediaSizes;
|
package/index.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ export { Select } from "./Select";
|
|
|
64
64
|
export type { SelectProps } from "./Select/index.props";
|
|
65
65
|
export { Separator } from "./Separator";
|
|
66
66
|
export type { SeparatorProps } from "./Separator/index.props";
|
|
67
|
+
export { Sheet } from "./Sheet";
|
|
68
|
+
export type { SheetProps, SheetSnapPoint, SheetCloseReason } from "./Sheet";
|
|
67
69
|
export { SkeletonRect, SkeletonText } from "./Skeleton";
|
|
68
70
|
export type { RectProps as SkeletonRectProps, TextProps as SkeletonTextProps, } from "./Skeleton/index.props";
|
|
69
71
|
export { Slider } from "./Slider";
|
package/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var index$n = require('./RadioGroup/index.js');
|
|
|
33
33
|
require('./Rating/index.js');
|
|
34
34
|
var index$o = require('./Select/index.js');
|
|
35
35
|
var index$p = require('./Separator/index.js');
|
|
36
|
+
require('./Sheet/index.js');
|
|
36
37
|
var index$q = require('./Skeleton/index.js');
|
|
37
38
|
require('./Slider/index.js');
|
|
38
39
|
var index$r = require('./Status/index.js');
|
|
@@ -81,6 +82,7 @@ var Plus = require('./Icons/Plus.js');
|
|
|
81
82
|
var Progress = require('./Progress/Progress.js');
|
|
82
83
|
var Rating = require('./Rating/Rating.js');
|
|
83
84
|
var Setting = require('./Icons/Setting.js');
|
|
85
|
+
var Sheet = require('./Sheet/Sheet.js');
|
|
84
86
|
var Shield = require('./Icons/Shield.js');
|
|
85
87
|
var Slider = require('./Slider/Slider.js');
|
|
86
88
|
var Trash = require('./Icons/Trash.js');
|
|
@@ -168,6 +170,7 @@ exports.Plus = Plus.Plus;
|
|
|
168
170
|
exports.Progress = Progress.Progress;
|
|
169
171
|
exports.Rating = Rating.Rating;
|
|
170
172
|
exports.Setting = Setting.Setting;
|
|
173
|
+
exports.Sheet = Sheet.Sheet;
|
|
171
174
|
exports.Shield = Shield.Shield;
|
|
172
175
|
exports.Slider = Slider.Slider;
|
|
173
176
|
exports.Trash = Trash.Trash;
|
package/package.json
CHANGED
package/theme_ba_variables.css
CHANGED
|
@@ -518,6 +518,36 @@
|
|
|
518
518
|
--component-avatar-font-size-xxxl: 9rem;
|
|
519
519
|
--component-accordion-text: #163300;
|
|
520
520
|
--component-accordion-line: #CBD2C8;
|
|
521
|
+
--component-sheet-bg: var(--color-bg-surface);
|
|
522
|
+
--component-sheet-text: var(--color-text-primary);
|
|
523
|
+
--component-sheet-secondary: var(--color-text-secondary);
|
|
524
|
+
--component-sheet-overlay: var(--component-modal-overlay);
|
|
525
|
+
--component-sheet-radius: var(--radius-xl);
|
|
526
|
+
--component-sheet-shadow: var(--shadow-raised);
|
|
527
|
+
--component-sheet-z-index: 1000;
|
|
528
|
+
--component-sheet-max-height: 96dvh;
|
|
529
|
+
--component-sheet-overlay-blur: var(--space-3);
|
|
530
|
+
--component-sheet-motion-duration: 220ms;
|
|
531
|
+
--component-sheet-resize-duration: 200ms;
|
|
532
|
+
--component-sheet-motion-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
533
|
+
--component-sheet-reduced-motion-duration: 0.001ms;
|
|
534
|
+
--component-sheet-drag-area-height: var(--space-6);
|
|
535
|
+
--component-sheet-handle-width: calc(var(--space-10) + var(--space-1));
|
|
536
|
+
--component-sheet-handle-height: var(--space-1);
|
|
537
|
+
--component-sheet-handle-radius: var(--radius-full);
|
|
538
|
+
--component-sheet-handle-opacity: 0.45;
|
|
539
|
+
--component-sheet-header-gap: var(--space-4);
|
|
540
|
+
--component-sheet-header-padding: var(--space-3) var(--space-5) var(--space-4);
|
|
541
|
+
--component-sheet-border-width: var(--border-width-hairline);
|
|
542
|
+
--component-sheet-border-color: var(--color-border-subtle);
|
|
543
|
+
--component-sheet-title-font-size: var(--font-size-heading-sm);
|
|
544
|
+
--component-sheet-title-line-height: var(--line-height-heading-sm);
|
|
545
|
+
--component-sheet-title-font-weight: var(--font-weight-semibold);
|
|
546
|
+
--component-sheet-description-offset: var(--space-1);
|
|
547
|
+
--component-sheet-description-font-size: var(--font-size-text-sm);
|
|
548
|
+
--component-sheet-body-padding: var(--space-5);
|
|
549
|
+
--component-sheet-footer-padding-block: var(--space-4);
|
|
550
|
+
--component-sheet-footer-padding-inline: var(--space-5);
|
|
521
551
|
--component-modal-bg: #FFFFFF;
|
|
522
552
|
--component-modal-border: #E2E7DF;
|
|
523
553
|
--component-modal-overlay: rgb(22 51 0 / 28%);
|
|
@@ -518,6 +518,36 @@
|
|
|
518
518
|
--component-avatar-font-size-xxxl: 9rem;
|
|
519
519
|
--component-accordion-text: #2C2242;
|
|
520
520
|
--component-accordion-line: #D0CECC;
|
|
521
|
+
--component-sheet-bg: var(--color-bg-surface);
|
|
522
|
+
--component-sheet-text: var(--color-text-primary);
|
|
523
|
+
--component-sheet-secondary: var(--color-text-secondary);
|
|
524
|
+
--component-sheet-overlay: var(--component-modal-overlay);
|
|
525
|
+
--component-sheet-radius: var(--radius-xl);
|
|
526
|
+
--component-sheet-shadow: var(--shadow-raised);
|
|
527
|
+
--component-sheet-z-index: 1000;
|
|
528
|
+
--component-sheet-max-height: 96dvh;
|
|
529
|
+
--component-sheet-overlay-blur: var(--space-3);
|
|
530
|
+
--component-sheet-motion-duration: 220ms;
|
|
531
|
+
--component-sheet-resize-duration: 200ms;
|
|
532
|
+
--component-sheet-motion-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
533
|
+
--component-sheet-reduced-motion-duration: 0.001ms;
|
|
534
|
+
--component-sheet-drag-area-height: var(--space-6);
|
|
535
|
+
--component-sheet-handle-width: calc(var(--space-10) + var(--space-1));
|
|
536
|
+
--component-sheet-handle-height: var(--space-1);
|
|
537
|
+
--component-sheet-handle-radius: var(--radius-full);
|
|
538
|
+
--component-sheet-handle-opacity: 0.45;
|
|
539
|
+
--component-sheet-header-gap: var(--space-4);
|
|
540
|
+
--component-sheet-header-padding: var(--space-3) var(--space-5) var(--space-4);
|
|
541
|
+
--component-sheet-border-width: var(--border-width-hairline);
|
|
542
|
+
--component-sheet-border-color: var(--color-border-subtle);
|
|
543
|
+
--component-sheet-title-font-size: var(--font-size-heading-sm);
|
|
544
|
+
--component-sheet-title-line-height: var(--line-height-heading-sm);
|
|
545
|
+
--component-sheet-title-font-weight: var(--font-weight-semibold);
|
|
546
|
+
--component-sheet-description-offset: var(--space-1);
|
|
547
|
+
--component-sheet-description-font-size: var(--font-size-text-sm);
|
|
548
|
+
--component-sheet-body-padding: var(--space-5);
|
|
549
|
+
--component-sheet-footer-padding-block: var(--space-4);
|
|
550
|
+
--component-sheet-footer-padding-inline: var(--space-5);
|
|
521
551
|
--component-modal-bg: #FFFFFF;
|
|
522
552
|
--component-modal-border: #E4E3DF;
|
|
523
553
|
--component-modal-overlay: color-mix(in srgb, var(--palette-black) 25%, transparent);
|