@caratlogic/design-system 0.1.44 → 0.1.45
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/components/molecules/FloatingSlideOver/FloatingSlideOver.d.ts +11 -0
- package/dist/components/molecules/FloatingSlideOver/FloatingSlideOver.d.ts.map +1 -0
- package/dist/components/molecules/FloatingSlideOver/FloatingSlideOver.hooks.d.ts +23 -0
- package/dist/components/molecules/FloatingSlideOver/FloatingSlideOver.hooks.d.ts.map +1 -0
- package/dist/components/molecules/FloatingSlideOver/FloatingSlideOver.types.d.ts +19 -0
- package/dist/components/molecules/FloatingSlideOver/FloatingSlideOver.types.d.ts.map +1 -0
- package/dist/components/molecules/FloatingSlideOver/FloatingSlideOver.utils.d.ts +9 -0
- package/dist/components/molecules/FloatingSlideOver/FloatingSlideOver.utils.d.ts.map +1 -0
- package/dist/components/molecules/FloatingSlideOver/index.d.ts +3 -0
- package/dist/components/molecules/FloatingSlideOver/index.d.ts.map +1 -0
- package/dist/components/molecules/Sidebar/Sidebar.parts.d.ts.map +1 -1
- package/dist/components/molecules/SlideOut/SlideOut.parts.d.ts +2 -0
- package/dist/components/molecules/SlideOut/SlideOut.parts.d.ts.map +1 -1
- package/dist/components/organisms/Filters/FilterSurface/FilterSurface.accessibility.d.ts +1 -0
- package/dist/components/organisms/Filters/FilterSurface/FilterSurface.accessibility.d.ts.map +1 -1
- package/dist/components/organisms/Filters/FilterSurface/FilterSurface.d.ts +1 -1
- package/dist/components/organisms/Filters/FilterSurface/FilterSurface.d.ts.map +1 -1
- package/dist/components/organisms/Filters/FilterSurface/FilterSurface.types.d.ts +6 -1
- package/dist/components/organisms/Filters/FilterSurface/FilterSurface.types.d.ts.map +1 -1
- package/dist/index.cjs.js +153 -39
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +153 -40
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { FloatingSlideOverProps } from './FloatingSlideOver.types';
|
|
3
|
+
export type { FloatingSlideOverProps } from './FloatingSlideOver.types';
|
|
4
|
+
/**
|
|
5
|
+
* A large panel that slides in from the right over the page and covers everything right of the sidebar,
|
|
6
|
+
* floating with a small gap on every side and rounded corners, on the slide-outs' dimmed, slightly blurred
|
|
7
|
+
* backdrop. The page behind, sidebar included, can't be used until it closes. A click outside calls
|
|
8
|
+
* `onClose`; the content closes it otherwise (a close button, Escape).
|
|
9
|
+
*/
|
|
10
|
+
export declare function FloatingSlideOver({ open, title, onClose, className, children, }: FloatingSlideOverProps): ReactElement;
|
|
11
|
+
//# sourceMappingURL=FloatingSlideOver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingSlideOver.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FloatingSlideOver/FloatingSlideOver.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAUlD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,GACT,EAAE,sBAAsB,GAAG,YAAY,CAgDvC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Backdrop handlers that call `onClose` on a click outside the panel, unless a dropdown or menu was open
|
|
4
|
+
* when the press began: that click only closes the dropdown.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useBackdropClose(onClose?: () => void): {
|
|
7
|
+
onPointerDown: () => void;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
};
|
|
10
|
+
/** Keeps the panel mounted while it slides out; `closing` is true for that time. */
|
|
11
|
+
export declare function useSlideOverPresence(open: boolean): {
|
|
12
|
+
mounted: boolean;
|
|
13
|
+
closing: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Where the content area right of the sidebar starts, in px from the viewport's left; 0 without a sidebar. */
|
|
16
|
+
export declare function useSidebarInsetLeft(active: boolean): number;
|
|
17
|
+
/**
|
|
18
|
+
* While `active`, makes the app behind the panel inert (no clicks, focus or screen reader) and moves focus
|
|
19
|
+
* into `panel`; on close, focus goes back where it was. Popovers and menus portal outside the app root, so
|
|
20
|
+
* they stay usable.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useModalPanel(anchor: RefObject<HTMLElement | null>, panel: RefObject<HTMLElement | null>, active: boolean): void;
|
|
23
|
+
//# sourceMappingURL=FloatingSlideOver.hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingSlideOver.hooks.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FloatingSlideOver/FloatingSlideOver.hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG;IACtD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAWA;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,CAaA;AAED,+GAA+G;AAC/G,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAqB3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACrC,KAAK,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACpC,MAAM,EAAE,OAAO,GACd,IAAI,CAcN"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface FloatingSlideOverProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
/** Names the panel for assistive tech, e.g. `Advance Search`. */
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* The panel's content; it fills the panel and handles its own scrolling and closing (e.g. a
|
|
8
|
+
* `FilterSurface`, whose back arrow and Escape close it). Mounted only while open and while the panel
|
|
9
|
+
* slides out, so its data loads when the panel opens.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Called on a click outside the panel. A click that only closes a dropdown or menu open inside the
|
|
14
|
+
* panel doesn't count.
|
|
15
|
+
*/
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=FloatingSlideOver.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingSlideOver.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FloatingSlideOver/FloatingSlideOver.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The app's content area, right of the sidebar; the panel starts at its left edge. */
|
|
2
|
+
export declare const SIDEBAR_INSET_SELECTOR = "[data-slot=\"sidebar-inset\"]";
|
|
3
|
+
/** Dropdowns, menus and listboxes, portaled outside the panel; an outside click first closes them. */
|
|
4
|
+
export declare const OPEN_LAYER_SELECTOR = "[data-slot=\"popover-content\"], [role=\"menu\"], [role=\"listbox\"]";
|
|
5
|
+
/** How long the panel takes to slide out; it stays mounted until then. */
|
|
6
|
+
export declare const SLIDE_OUT_MS = 200;
|
|
7
|
+
/** The top-level element under `<body>` that holds `node`: the app root, for a node in the page. */
|
|
8
|
+
export declare function getBodyChild(node: Element): Element | null;
|
|
9
|
+
//# sourceMappingURL=FloatingSlideOver.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingSlideOver.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FloatingSlideOver/FloatingSlideOver.utils.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,kCAAgC,CAAC;AAEpE,sGAAsG;AACtG,eAAO,MAAM,mBAAmB,yEACkC,CAAC;AAEnE,0EAA0E;AAC1E,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,oGAAoG;AACpG,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAK1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FloatingSlideOver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.parts.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Sidebar/Sidebar.parts.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAA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aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,CAAC;AAEF,eAAO,MAAM,WAAW,8GAA4B,CAAC;AACrD,eAAO,MAAM,kBAAkB,wHAA+B,CAAC;AAC/D,eAAO,MAAM,kBAAkB,qHAA+B,CAAC"}
|
|
@@ -4,6 +4,8 @@ declare const SlideOut: ({ open, onOpenChange, ...props }: React.ComponentProps<
|
|
|
4
4
|
declare const SlideOutTrigger: React.ForwardRefExoticComponent<SlideOutPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const SlideOutClose: React.ForwardRefExoticComponent<SlideOutPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare const SlideOutPortal: React.FC<SlideOutPrimitive.DialogPortalProps>;
|
|
7
|
+
/** The slide-outs' backdrop, dimmed and slightly blurred; other panels over the page reuse it to match. */
|
|
8
|
+
export declare const SLIDE_OUT_BACKDROP_CLASS_NAME: string;
|
|
7
9
|
declare const SlideOutOverlay: React.ForwardRefExoticComponent<Omit<SlideOutPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
10
|
declare const SlideOutContent: React.ForwardRefExoticComponent<Omit<SlideOutPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
11
|
overlayClassName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideOut.parts.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SlideOut/SlideOut.parts.tsx"],"names":[],"mappings":"AAEA,OAAO,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B,GACpB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Leaves without applying; the draft is discarded. */
|
|
2
2
|
export declare const BACK_LABEL = "Back without applying";
|
|
3
|
+
export declare const CLOSE_LABEL = "Close without applying";
|
|
3
4
|
export declare const LOADING_LABEL = "Loading filters";
|
|
4
5
|
export declare const ERROR_TITLE = "Couldn't load filters";
|
|
5
6
|
export declare const DEFAULT_ERROR_MESSAGE = "Something went wrong while loading the filters. Check your connection and try again.";
|
package/dist/components/organisms/Filters/FilterSurface/FilterSurface.accessibility.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSurface.accessibility.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Filters/FilterSurface/FilterSurface.accessibility.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,eAAO,MAAM,UAAU,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterSurface.accessibility.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Filters/FilterSurface/FilterSurface.accessibility.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,eAAO,MAAM,UAAU,0BAA0B,CAAC;AAClD,eAAO,MAAM,WAAW,2BAA2B,CAAC;AAEpD,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,eAAO,MAAM,WAAW,0BAA0B,CAAC;AACnD,eAAO,MAAM,qBAAqB,yFACsD,CAAC;AACzF,eAAO,MAAM,WAAW,cAAc,CAAC;AAEvC,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,MAAwB,CAAC;AACzE,eAAO,MAAM,iBAAiB,2BAA2B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type ReactElement } from 'react';
|
|
|
2
2
|
import type { FilterSurfaceGroupProps, FilterSurfaceMoreProps, FilterSurfaceProps, FilterSurfaceSortableProps } from './FilterSurface.types';
|
|
3
3
|
export type { FilterCardLayout, FilterSurfaceGroupProps, FilterSurfaceMoreProps, FilterSurfaceProps, FilterSurfaceSortableProps, FilterSurfaceStatus, } from './FilterSurface.types';
|
|
4
4
|
/** Full-page filter screen (e.g. an advanced search): one sticky header with every action, then the scrolling card grid. */
|
|
5
|
-
export declare function FilterSurface({ title, headerActions, primaryActions, chips, onClose, status, errorMessage, onRetry, skeleton, children, }: FilterSurfaceProps): ReactElement;
|
|
5
|
+
export declare function FilterSurface({ title, headerActions, primaryActions, chips, onClose, closeButton, status, errorMessage, onRetry, skeleton, children, }: FilterSurfaceProps): ReactElement;
|
|
6
6
|
/**
|
|
7
7
|
* Lets the user drag the cards of its `FilterSurfaceGroup`s (those with a `sortableId`) into any order and
|
|
8
8
|
* between groups, from a grip on each card. A collapsed `FilterSurfaceMore` opens when a card rests on it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSurface.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Filters/FilterSurface/FilterSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterSurface.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Filters/FilterSurface/FilterSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AA8BpD,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,4HAA4H;AAC5H,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,aAAa,EACb,cAAc,EACd,KAAK,EACL,OAAO,EACP,WAAoB,EACpB,MAAgB,EAChB,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,EAAE,kBAAkB,GAAG,YAAY,CA2DnC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,cAAc,EACd,UAAU,EACV,SAAS,EACT,QAAQ,GACT,EAAE,0BAA0B,GAAG,YAAY,CAsB3C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAe,EACf,UAAU,EACV,SAAS,EACT,QAAQ,GACT,EAAE,uBAAuB,GAAG,YAAY,CA4CxC;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,eAAe,EACf,QAAQ,GACT,EAAE,sBAAsB,GAAG,YAAY,CA6BvC"}
|
|
@@ -8,8 +8,13 @@ export interface FilterSurfaceProps {
|
|
|
8
8
|
primaryActions?: ReactNode;
|
|
9
9
|
/** Fills the header between the back arrow and the actions, e.g. the "Filtered by" chips with Clear all. */
|
|
10
10
|
chips?: ReactNode;
|
|
11
|
-
/** The back arrow and Escape leave without applying. */
|
|
11
|
+
/** The back arrow (or close button) and Escape leave without applying. */
|
|
12
12
|
onClose: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* `back` (default): a back arrow at the header's start, for a full page. `close`: an X at its end, after
|
|
15
|
+
* the actions, for a panel over the page (e.g. in a `FloatingSlideOver`).
|
|
16
|
+
*/
|
|
17
|
+
closeButton?: 'back' | 'close';
|
|
13
18
|
/** `loading` shows skeleton cards and `error` an error panel in place of the cards; the primary actions and chips show only when `ready`. */
|
|
14
19
|
status?: FilterSurfaceStatus;
|
|
15
20
|
/** Error panel text. Default explains the filters couldn't load. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSurface.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Filters/FilterSurface/FilterSurface.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,2BAA2B,EAC3B,cAAc,EACd,gBAAgB,EAChB,aAAa,EACd,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,4GAA4G;IAC5G,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"FilterSurface.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Filters/FilterSurface/FilterSurface.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,2BAA2B,EAC3B,cAAc,EACd,gBAAgB,EAChB,aAAa,EACd,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,4GAA4G;IAC5G,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,6IAA6I;IAC7I,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,wGAAwG;IACxG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhE,MAAM,WAAW,0BAA0B;IACzC,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D,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,CAAC;IACtC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IACtD,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,0GAA0G;IAC1G,gBAAgB,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAC3E;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB,mBAAmB,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,SAAS,EAAE,2BAA2B,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -43832,6 +43832,154 @@ function TriStateFilter({ value, onChange, ariaLabel, compact = false, }) {
|
|
|
43832
43832
|
}) }));
|
|
43833
43833
|
}
|
|
43834
43834
|
|
|
43835
|
+
const SlideOut = ({ open, onOpenChange, ...props }) => {
|
|
43836
|
+
const scheduleLockRelease = useOverlayBodyLockRelease(open);
|
|
43837
|
+
return (jsxRuntime.jsx(DialogPrimitive__namespace.Root, { ...props, open: open, onOpenChange: (next) => {
|
|
43838
|
+
onOpenChange?.(next);
|
|
43839
|
+
if (!next)
|
|
43840
|
+
scheduleLockRelease();
|
|
43841
|
+
} }));
|
|
43842
|
+
};
|
|
43843
|
+
const SlideOutTrigger = DialogPrimitive__namespace.Trigger;
|
|
43844
|
+
const SlideOutClose = DialogPrimitive__namespace.Close;
|
|
43845
|
+
const SlideOutPortal = DialogPrimitive__namespace.Portal;
|
|
43846
|
+
// Overlay
|
|
43847
|
+
const SLIDE_OUT_OVERLAY_CLASS_NAME = 'fixed inset-0 z-40 bg-black/50';
|
|
43848
|
+
const SLIDE_OUT_OVERLAY_BLUR_CLASS_NAME = 'backdrop-blur-sm';
|
|
43849
|
+
/** The slide-outs' backdrop, dimmed and slightly blurred; other panels over the page reuse it to match. */
|
|
43850
|
+
const SLIDE_OUT_BACKDROP_CLASS_NAME = cn(SLIDE_OUT_OVERLAY_CLASS_NAME, SLIDE_OUT_OVERLAY_BLUR_CLASS_NAME);
|
|
43851
|
+
const SlideOutOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { ref: ref, className: cn(SLIDE_OUT_OVERLAY_CLASS_NAME, className), ...props })));
|
|
43852
|
+
SlideOutOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
43853
|
+
// Positional classes per edge. `right` is the historical default and its
|
|
43854
|
+
// value is byte-for-byte what SlideOutContent always rendered.
|
|
43855
|
+
const slideOutSideClasses = {
|
|
43856
|
+
right: 'right-0 top-0 h-full w-[488px] max-w-full border-l slide-in-from-right',
|
|
43857
|
+
left: 'left-0 top-0 h-full w-[488px] max-w-full border-r slide-in-from-left',
|
|
43858
|
+
top: 'inset-x-0 top-0 h-1/3 w-full border-b slide-in-from-top',
|
|
43859
|
+
bottom: 'inset-x-0 bottom-0 h-1/3 w-full border-t slide-in-from-bottom',
|
|
43860
|
+
};
|
|
43861
|
+
// Content — slide-out panel. Defaults to a right-anchored 488px drawer;
|
|
43862
|
+
// pass `side` to anchor to any edge (absorbs the old sheet/drawer use cases).
|
|
43863
|
+
const SlideOutContent = React__namespace.forwardRef(({ className, children, overlayClassName, side = 'right', ...props }, ref) => (jsxRuntime.jsxs(SlideOutPortal, { children: [jsxRuntime.jsx(SlideOutOverlay, { className: overlayClassName ?? SLIDE_OUT_OVERLAY_BLUR_CLASS_NAME }), jsxRuntime.jsx(DialogPrimitive__namespace.Content, { ref: ref, className: cn('fixed z-50 border-border bg-card text-card-foreground shadow-xl animate-in', slideOutSideClasses[side], className), ...props, children: children })] })));
|
|
43864
|
+
SlideOutContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
43865
|
+
// Header — owns the standard 16px padding and bottom border.
|
|
43866
|
+
const SlideOutHeader = ({ className, ...props }) => (jsxRuntime.jsx("div", { className: cn('flex flex-col space-y-1.5 border-b border-border px-4 py-4 text-xs', className), ...props }));
|
|
43867
|
+
SlideOutHeader.displayName = 'SlideOutHeader';
|
|
43868
|
+
// Title
|
|
43869
|
+
const SlideOutTitle = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx(DialogPrimitive__namespace.Title, { ref: ref, className: cn('text-lg font-semibold', className), ...props })));
|
|
43870
|
+
SlideOutTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
43871
|
+
// Description
|
|
43872
|
+
const SlideOutDescription = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx(DialogPrimitive__namespace.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
43873
|
+
SlideOutDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
43874
|
+
|
|
43875
|
+
/** The app's content area, right of the sidebar; the panel starts at its left edge. */
|
|
43876
|
+
const SIDEBAR_INSET_SELECTOR = '[data-slot="sidebar-inset"]';
|
|
43877
|
+
/** Dropdowns, menus and listboxes, portaled outside the panel; an outside click first closes them. */
|
|
43878
|
+
const OPEN_LAYER_SELECTOR = '[data-slot="popover-content"], [role="menu"], [role="listbox"]';
|
|
43879
|
+
/** How long the panel takes to slide out; it stays mounted until then. */
|
|
43880
|
+
const SLIDE_OUT_MS = 200;
|
|
43881
|
+
/** The top-level element under `<body>` that holds `node`: the app root, for a node in the page. */
|
|
43882
|
+
function getBodyChild(node) {
|
|
43883
|
+
let current = node;
|
|
43884
|
+
while (current && current.parentElement !== node.ownerDocument.body)
|
|
43885
|
+
current = current.parentElement;
|
|
43886
|
+
return current;
|
|
43887
|
+
}
|
|
43888
|
+
|
|
43889
|
+
/**
|
|
43890
|
+
* Backdrop handlers that call `onClose` on a click outside the panel, unless a dropdown or menu was open
|
|
43891
|
+
* when the press began: that click only closes the dropdown.
|
|
43892
|
+
*/
|
|
43893
|
+
function useBackdropClose(onClose) {
|
|
43894
|
+
const layerOpenRef = React.useRef(false);
|
|
43895
|
+
return {
|
|
43896
|
+
onPointerDown: () => {
|
|
43897
|
+
layerOpenRef.current = !!document.querySelector(OPEN_LAYER_SELECTOR);
|
|
43898
|
+
},
|
|
43899
|
+
onClick: () => {
|
|
43900
|
+
if (!layerOpenRef.current)
|
|
43901
|
+
onClose?.();
|
|
43902
|
+
layerOpenRef.current = false;
|
|
43903
|
+
},
|
|
43904
|
+
};
|
|
43905
|
+
}
|
|
43906
|
+
/** Keeps the panel mounted while it slides out; `closing` is true for that time. */
|
|
43907
|
+
function useSlideOverPresence(open) {
|
|
43908
|
+
const [mounted, setMounted] = React.useState(open);
|
|
43909
|
+
React.useEffect(() => {
|
|
43910
|
+
if (open) {
|
|
43911
|
+
setMounted(true);
|
|
43912
|
+
return;
|
|
43913
|
+
}
|
|
43914
|
+
const timer = window.setTimeout(() => setMounted(false), SLIDE_OUT_MS);
|
|
43915
|
+
return () => window.clearTimeout(timer);
|
|
43916
|
+
}, [open]);
|
|
43917
|
+
return { mounted: mounted || open, closing: mounted && !open };
|
|
43918
|
+
}
|
|
43919
|
+
/** Where the content area right of the sidebar starts, in px from the viewport's left; 0 without a sidebar. */
|
|
43920
|
+
function useSidebarInsetLeft(active) {
|
|
43921
|
+
const [left, setLeft] = React.useState(0);
|
|
43922
|
+
React.useLayoutEffect(() => {
|
|
43923
|
+
if (!active)
|
|
43924
|
+
return;
|
|
43925
|
+
const inset = document.querySelector(SIDEBAR_INSET_SELECTOR);
|
|
43926
|
+
if (!inset)
|
|
43927
|
+
return;
|
|
43928
|
+
const measure = () => setLeft(Math.max(0, inset.getBoundingClientRect().left));
|
|
43929
|
+
measure();
|
|
43930
|
+
// The inset narrows or widens with the window and the sidebar.
|
|
43931
|
+
const observer = new ResizeObserver(measure);
|
|
43932
|
+
observer.observe(inset);
|
|
43933
|
+
window.addEventListener('resize', measure);
|
|
43934
|
+
return () => {
|
|
43935
|
+
observer.disconnect();
|
|
43936
|
+
window.removeEventListener('resize', measure);
|
|
43937
|
+
};
|
|
43938
|
+
}, [active]);
|
|
43939
|
+
return left;
|
|
43940
|
+
}
|
|
43941
|
+
/**
|
|
43942
|
+
* While `active`, makes the app behind the panel inert (no clicks, focus or screen reader) and moves focus
|
|
43943
|
+
* into `panel`; on close, focus goes back where it was. Popovers and menus portal outside the app root, so
|
|
43944
|
+
* they stay usable.
|
|
43945
|
+
*/
|
|
43946
|
+
function useModalPanel(anchor, panel, active) {
|
|
43947
|
+
React.useEffect(() => {
|
|
43948
|
+
const root = anchor.current && getBodyChild(anchor.current);
|
|
43949
|
+
if (!active || !(root instanceof HTMLElement))
|
|
43950
|
+
return;
|
|
43951
|
+
const previousFocus = document.activeElement;
|
|
43952
|
+
const wasInert = root.inert;
|
|
43953
|
+
root.inert = true;
|
|
43954
|
+
panel.current?.focus({ preventScroll: true });
|
|
43955
|
+
return () => {
|
|
43956
|
+
root.inert = wasInert;
|
|
43957
|
+
if (previousFocus instanceof HTMLElement)
|
|
43958
|
+
previousFocus.focus({ preventScroll: true });
|
|
43959
|
+
};
|
|
43960
|
+
}, [anchor, panel, active]);
|
|
43961
|
+
}
|
|
43962
|
+
|
|
43963
|
+
/**
|
|
43964
|
+
* A large panel that slides in from the right over the page and covers everything right of the sidebar,
|
|
43965
|
+
* floating with a small gap on every side and rounded corners, on the slide-outs' dimmed, slightly blurred
|
|
43966
|
+
* backdrop. The page behind, sidebar included, can't be used until it closes. A click outside calls
|
|
43967
|
+
* `onClose`; the content closes it otherwise (a close button, Escape).
|
|
43968
|
+
*/
|
|
43969
|
+
function FloatingSlideOver({ open, title, onClose, className, children, }) {
|
|
43970
|
+
const anchorRef = React.useRef(null);
|
|
43971
|
+
const panelRef = React.useRef(null);
|
|
43972
|
+
const { mounted, closing } = useSlideOverPresence(open);
|
|
43973
|
+
const left = useSidebarInsetLeft(mounted);
|
|
43974
|
+
useModalPanel(anchorRef, panelRef, mounted);
|
|
43975
|
+
const backdrop = useBackdropClose(onClose);
|
|
43976
|
+
const state = closing ? 'closed' : 'open';
|
|
43977
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { ref: anchorRef, hidden: true }), mounted &&
|
|
43978
|
+
ReactDOM.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { "aria-hidden": "true", "data-state": state, className: SLIDE_OUT_BACKDROP_CLASS_NAME, onPointerDown: backdrop.onPointerDown, onClick: backdrop.onClick }), jsxRuntime.jsx("div", { ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, "data-state": state,
|
|
43979
|
+
// The same gap from the sidebar's edge as on the other sides.
|
|
43980
|
+
style: { left: `calc(${left}px + 0.5rem)` }, className: cn('fixed inset-y-2 right-2 z-50 flex flex-col overflow-hidden rounded-xl border border-border bg-background shadow-xl outline-none', 'data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:duration-300 data-[state=open]:ease-out', 'data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:duration-200 data-[state=closed]:ease-in', 'motion-reduce:animate-none', className), children: children })] }), document.body)] }));
|
|
43981
|
+
}
|
|
43982
|
+
|
|
43835
43983
|
/** Read-only filter summaries of a saved search, as pills; optionally one line ending in "+N more". */
|
|
43836
43984
|
function SavedSearchChipList({ chips, emptyText = 'No filters', collapsible = false, className, }) {
|
|
43837
43985
|
const { listRef, expanded, toggle, visibleChips, hiddenCount } = useChipOverflow(chips, collapsible);
|
|
@@ -73479,7 +73627,7 @@ const SidebarRail = React__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
73479
73627
|
return (jsxRuntime.jsx("button", { ref: ref, "data-sidebar": "rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn('absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex', '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize', '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize', 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar', 'group-data-[side=left][data-collapsible=offcanvas]:-right-2', 'group-data-[side=right][data-collapsible=offcanvas]:-left-2', className), ...props }));
|
|
73480
73628
|
});
|
|
73481
73629
|
SidebarRail.displayName = 'SidebarRail';
|
|
73482
|
-
const SidebarInset = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx("main", { ref: ref, className: cn('relative flex min-h-screen flex-1 flex-col bg-background', 'peer-data-[variant=inset]:min-h-[calc(100svh-1rem)] md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow', className), ...props })));
|
|
73630
|
+
const SidebarInset = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx("main", { ref: ref, "data-slot": "sidebar-inset", className: cn('relative flex min-h-screen flex-1 flex-col bg-background', 'peer-data-[variant=inset]:min-h-[calc(100svh-1rem)] md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow', className), ...props })));
|
|
73483
73631
|
SidebarInset.displayName = 'SidebarInset';
|
|
73484
73632
|
const SidebarInput = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx("input", { ref: ref, "data-sidebar": "input", className: cn('h-8 w-full bg-background text-sm shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring', className), ...props })));
|
|
73485
73633
|
SidebarInput.displayName = 'SidebarInput';
|
|
@@ -73617,42 +73765,6 @@ const AppSidebar = ({ brand, navGroups = [], footer, className, }) => {
|
|
|
73617
73765
|
return (jsxRuntime.jsxs(Sidebar, { collapsible: "icon", className: className, children: [brand && (jsxRuntime.jsx(SidebarHeader, { children: jsxRuntime.jsx(BrandHeader$1, { brand: brand }) })), jsxRuntime.jsx(SidebarContent, { children: navGroups.map((group) => (jsxRuntime.jsx(NavGroupSection, { group: group }, group.label ?? 'nav-group'))) }), footer && jsxRuntime.jsx(SidebarFooter, { children: footer }), jsxRuntime.jsx(SidebarRail, {})] }));
|
|
73618
73766
|
};
|
|
73619
73767
|
|
|
73620
|
-
const SlideOut = ({ open, onOpenChange, ...props }) => {
|
|
73621
|
-
const scheduleLockRelease = useOverlayBodyLockRelease(open);
|
|
73622
|
-
return (jsxRuntime.jsx(DialogPrimitive__namespace.Root, { ...props, open: open, onOpenChange: (next) => {
|
|
73623
|
-
onOpenChange?.(next);
|
|
73624
|
-
if (!next)
|
|
73625
|
-
scheduleLockRelease();
|
|
73626
|
-
} }));
|
|
73627
|
-
};
|
|
73628
|
-
const SlideOutTrigger = DialogPrimitive__namespace.Trigger;
|
|
73629
|
-
const SlideOutClose = DialogPrimitive__namespace.Close;
|
|
73630
|
-
const SlideOutPortal = DialogPrimitive__namespace.Portal;
|
|
73631
|
-
// Overlay
|
|
73632
|
-
const SlideOutOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { ref: ref, className: cn('fixed inset-0 z-40 bg-black/50', className), ...props })));
|
|
73633
|
-
SlideOutOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
73634
|
-
// Positional classes per edge. `right` is the historical default and its
|
|
73635
|
-
// value is byte-for-byte what SlideOutContent always rendered.
|
|
73636
|
-
const slideOutSideClasses = {
|
|
73637
|
-
right: 'right-0 top-0 h-full w-[488px] max-w-full border-l slide-in-from-right',
|
|
73638
|
-
left: 'left-0 top-0 h-full w-[488px] max-w-full border-r slide-in-from-left',
|
|
73639
|
-
top: 'inset-x-0 top-0 h-1/3 w-full border-b slide-in-from-top',
|
|
73640
|
-
bottom: 'inset-x-0 bottom-0 h-1/3 w-full border-t slide-in-from-bottom',
|
|
73641
|
-
};
|
|
73642
|
-
// Content — slide-out panel. Defaults to a right-anchored 488px drawer;
|
|
73643
|
-
// pass `side` to anchor to any edge (absorbs the old sheet/drawer use cases).
|
|
73644
|
-
const SlideOutContent = React__namespace.forwardRef(({ className, children, overlayClassName, side = 'right', ...props }, ref) => (jsxRuntime.jsxs(SlideOutPortal, { children: [jsxRuntime.jsx(SlideOutOverlay, { className: overlayClassName ?? 'backdrop-blur-sm' }), jsxRuntime.jsx(DialogPrimitive__namespace.Content, { ref: ref, className: cn('fixed z-50 border-border bg-card text-card-foreground shadow-xl animate-in', slideOutSideClasses[side], className), ...props, children: children })] })));
|
|
73645
|
-
SlideOutContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
73646
|
-
// Header — owns the standard 16px padding and bottom border.
|
|
73647
|
-
const SlideOutHeader = ({ className, ...props }) => (jsxRuntime.jsx("div", { className: cn('flex flex-col space-y-1.5 border-b border-border px-4 py-4 text-xs', className), ...props }));
|
|
73648
|
-
SlideOutHeader.displayName = 'SlideOutHeader';
|
|
73649
|
-
// Title
|
|
73650
|
-
const SlideOutTitle = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx(DialogPrimitive__namespace.Title, { ref: ref, className: cn('text-lg font-semibold', className), ...props })));
|
|
73651
|
-
SlideOutTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
73652
|
-
// Description
|
|
73653
|
-
const SlideOutDescription = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx(DialogPrimitive__namespace.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
73654
|
-
SlideOutDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
73655
|
-
|
|
73656
73768
|
const SpecList = ({ rows, zebra = true, className, }) => {
|
|
73657
73769
|
const visible = rows.filter((r) => !r.hidden);
|
|
73658
73770
|
if (visible.length === 0)
|
|
@@ -77886,6 +77998,7 @@ function FilterField(props) {
|
|
|
77886
77998
|
|
|
77887
77999
|
/** Leaves without applying; the draft is discarded. */
|
|
77888
78000
|
const BACK_LABEL = 'Back without applying';
|
|
78001
|
+
const CLOSE_LABEL = 'Close without applying';
|
|
77889
78002
|
const LOADING_LABEL = 'Loading filters';
|
|
77890
78003
|
const ERROR_TITLE = "Couldn't load filters";
|
|
77891
78004
|
const DEFAULT_ERROR_MESSAGE = 'Something went wrong while loading the filters. Check your connection and try again.';
|
|
@@ -78399,11 +78512,11 @@ function FilterCardOverlay({ node, }) {
|
|
|
78399
78512
|
}
|
|
78400
78513
|
|
|
78401
78514
|
/** Full-page filter screen (e.g. an advanced search): one sticky header with every action, then the scrolling card grid. */
|
|
78402
|
-
function FilterSurface({ title, headerActions, primaryActions, chips, onClose, status = 'ready', errorMessage, onRetry, skeleton, children, }) {
|
|
78515
|
+
function FilterSurface({ title, headerActions, primaryActions, chips, onClose, closeButton = 'back', status = 'ready', errorMessage, onRetry, skeleton, children, }) {
|
|
78403
78516
|
useCloseOnEscape(onClose);
|
|
78404
78517
|
const ready = status === 'ready';
|
|
78405
78518
|
const actions = ready ? primaryActions : undefined;
|
|
78406
|
-
return (jsxRuntime.jsxs("div", { role: "region", "aria-label": title, className: "flex h-full min-h-0 flex-col bg-background", children: [jsxRuntime.jsxs("header", { className: "sticky top-0 z-20 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-2 bg-background px-3 py-2.5", children: [jsxRuntime.jsx(IconButton, { appearance: "ghost", size: "sm", "aria-label": BACK_LABEL, title: BACK_LABEL, onClick: onClose, children: jsxRuntime.jsx(ArrowLeft, {}) }), jsxRuntime.jsx("h1", { className: "sr-only", children: title }), jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: ready && chips }), jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [headerActions, actions] })] }), jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-3 pb-3", children: status === 'loading' ? (jsxRuntime.jsx(FilterSurfaceSkeleton, { children: skeleton })) : status === 'error' ? (jsxRuntime.jsx(FilterSurfaceError, { message: errorMessage ?? DEFAULT_ERROR_MESSAGE, onRetry: onRetry })) : (jsxRuntime.jsx("div", { className: "flex flex-col gap-3", children: children })) })] }));
|
|
78519
|
+
return (jsxRuntime.jsxs("div", { role: "region", "aria-label": title, className: "flex h-full min-h-0 flex-col bg-background", children: [jsxRuntime.jsxs("header", { className: "sticky top-0 z-20 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-2 bg-background px-3 py-2.5", children: [closeButton === 'back' && (jsxRuntime.jsx(IconButton, { appearance: "ghost", size: "sm", "aria-label": BACK_LABEL, title: BACK_LABEL, onClick: onClose, children: jsxRuntime.jsx(ArrowLeft, {}) })), jsxRuntime.jsx("h1", { className: "sr-only", children: title }), jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: ready && chips }), jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [headerActions, actions, closeButton === 'close' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { "aria-hidden": "true", className: "mx-1 h-6 w-px bg-border" }), jsxRuntime.jsx(IconButton, { appearance: "ghost", size: "sm", "aria-label": CLOSE_LABEL, title: CLOSE_LABEL, onClick: onClose, children: jsxRuntime.jsx(X$2, {}) })] }))] })] }), jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-3 pb-3", children: status === 'loading' ? (jsxRuntime.jsx(FilterSurfaceSkeleton, { children: skeleton })) : status === 'error' ? (jsxRuntime.jsx(FilterSurfaceError, { message: errorMessage ?? DEFAULT_ERROR_MESSAGE, onRetry: onRetry })) : (jsxRuntime.jsx("div", { className: "flex flex-col gap-3", children: children })) })] }));
|
|
78407
78520
|
}
|
|
78408
78521
|
/**
|
|
78409
78522
|
* Lets the user drag the cards of its `FilterSurfaceGroup`s (those with a `sortableId`) into any order and
|
|
@@ -81094,6 +81207,7 @@ exports.FilterSurface = FilterSurface;
|
|
|
81094
81207
|
exports.FilterSurfaceGroup = FilterSurfaceGroup;
|
|
81095
81208
|
exports.FilterSurfaceMore = FilterSurfaceMore;
|
|
81096
81209
|
exports.FilterSurfaceSortable = FilterSurfaceSortable;
|
|
81210
|
+
exports.FloatingSlideOver = FloatingSlideOver;
|
|
81097
81211
|
exports.FormSectionCard = FormSectionCard;
|
|
81098
81212
|
exports.FormSectionCardSkeleton = FormSectionCardSkeleton;
|
|
81099
81213
|
exports.GEM_AUDIT_CONFIG = GEM_AUDIT_CONFIG;
|