@flipdish/ui-library 0.41.2 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/Dot/Dot.styles.cjs +1 -0
- package/dist/components/atoms/Dot/Dot.styles.cjs.map +1 -1
- package/dist/components/atoms/Dot/Dot.styles.d.ts +4 -0
- package/dist/components/atoms/Dot/Dot.styles.d.ts.map +1 -1
- package/dist/components/atoms/Dot/Dot.styles.js +1 -0
- package/dist/components/atoms/Dot/Dot.styles.js.map +1 -1
- package/dist/components/atoms/LoadingIndicator/index.cjs +5 -0
- package/dist/components/atoms/LoadingIndicator/index.cjs.map +1 -1
- package/dist/components/atoms/LoadingIndicator/index.d.ts +1 -1
- package/dist/components/atoms/LoadingIndicator/index.d.ts.map +1 -1
- package/dist/components/atoms/LoadingIndicator/index.js +5 -0
- package/dist/components/atoms/LoadingIndicator/index.js.map +1 -1
- package/dist/components/atoms/SearchInput/index.cjs +28 -2
- package/dist/components/atoms/SearchInput/index.cjs.map +1 -1
- package/dist/components/atoms/SearchInput/index.d.ts +8 -1
- package/dist/components/atoms/SearchInput/index.d.ts.map +1 -1
- package/dist/components/atoms/SearchInput/index.js +28 -2
- package/dist/components/atoms/SearchInput/index.js.map +1 -1
- package/dist/components/atoms/SocialButton/index.cjs +11 -7
- package/dist/components/atoms/SocialButton/index.cjs.map +1 -1
- package/dist/components/atoms/SocialButton/index.d.ts.map +1 -1
- package/dist/components/atoms/SocialButton/index.js +11 -7
- package/dist/components/atoms/SocialButton/index.js.map +1 -1
- package/dist/components/atoms/Tooltip/index.cjs +8 -1
- package/dist/components/atoms/Tooltip/index.cjs.map +1 -1
- package/dist/components/atoms/Tooltip/index.d.ts.map +1 -1
- package/dist/components/atoms/Tooltip/index.js +8 -1
- package/dist/components/atoms/Tooltip/index.js.map +1 -1
- package/dist/components/atoms/UtilityButton/index.cjs.map +1 -1
- package/dist/components/atoms/UtilityButton/index.d.ts +2 -0
- package/dist/components/atoms/UtilityButton/index.d.ts.map +1 -1
- package/dist/components/atoms/UtilityButton/index.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.cjs +16 -4
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.js +17 -5
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.js.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.cjs +8 -1
- package/dist/components/molecules/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.js +9 -2
- package/dist/components/molecules/ButtonGroup/index.js.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.cjs +8 -1
- package/dist/components/molecules/CodeSnippet/index.cjs.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.d.ts.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.js +8 -1
- package/dist/components/molecules/CodeSnippet/index.js.map +1 -1
- package/dist/components/molecules/Dropdown/index.cjs +10 -7
- package/dist/components/molecules/Dropdown/index.cjs.map +1 -1
- package/dist/components/molecules/Dropdown/index.d.ts.map +1 -1
- package/dist/components/molecules/Dropdown/index.js +11 -8
- package/dist/components/molecules/Dropdown/index.js.map +1 -1
- package/dist/components/molecules/EmptyState/index.cjs +3 -2
- package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
- package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
- package/dist/components/molecules/EmptyState/index.js +3 -2
- package/dist/components/molecules/EmptyState/index.js.map +1 -1
- package/dist/components/molecules/Select/components/Combobox.cjs +8 -1
- package/dist/components/molecules/Select/components/Combobox.cjs.map +1 -1
- package/dist/components/molecules/Select/components/Combobox.js +8 -1
- package/dist/components/molecules/Select/components/Combobox.js.map +1 -1
- package/dist/components/molecules/Select/components/SelectItem.cjs +10 -1
- package/dist/components/molecules/Select/components/SelectItem.cjs.map +1 -1
- package/dist/components/molecules/Select/components/SelectItem.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/SelectItem.js +10 -1
- package/dist/components/molecules/Select/components/SelectItem.js.map +1 -1
- package/dist/components/molecules/Select/index.cjs +11 -1
- package/dist/components/molecules/Select/index.cjs.map +1 -1
- package/dist/components/molecules/Select/index.d.ts.map +1 -1
- package/dist/components/molecules/Select/index.js +11 -1
- package/dist/components/molecules/Select/index.js.map +1 -1
- package/dist/components/molecules/Select/multiSelect.utils.cjs +5 -1
- package/dist/components/molecules/Select/multiSelect.utils.cjs.map +1 -1
- package/dist/components/molecules/Select/multiSelect.utils.d.ts.map +1 -1
- package/dist/components/molecules/Select/multiSelect.utils.js +5 -1
- package/dist/components/molecules/Select/multiSelect.utils.js.map +1 -1
- package/dist/components/molecules/Tabs/index.cjs +14 -9
- package/dist/components/molecules/Tabs/index.cjs.map +1 -1
- package/dist/components/molecules/Tabs/index.d.ts +5 -3
- package/dist/components/molecules/Tabs/index.d.ts.map +1 -1
- package/dist/components/molecules/Tabs/index.js +15 -10
- package/dist/components/molecules/Tabs/index.js.map +1 -1
- package/dist/components/molecules/Tags/Tags.styles.cjs +66 -0
- package/dist/components/molecules/Tags/Tags.styles.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tags.styles.d.ts +141 -0
- package/dist/components/molecules/Tags/Tags.styles.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tags.styles.js +64 -0
- package/dist/components/molecules/Tags/Tags.styles.js.map +1 -0
- package/dist/components/molecules/Tags/components/TagCheckbox.cjs +2 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.cjs.map +1 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.d.ts +2 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.d.ts.map +1 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.js +2 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.js.map +1 -1
- package/dist/components/molecules/Tags/components/TagCloseX.cjs +2 -6
- package/dist/components/molecules/Tags/components/TagCloseX.cjs.map +1 -1
- package/dist/components/molecules/Tags/components/TagCloseX.d.ts +2 -1
- package/dist/components/molecules/Tags/components/TagCloseX.d.ts.map +1 -1
- package/dist/components/molecules/Tags/components/TagCloseX.js +2 -6
- package/dist/components/molecules/Tags/components/TagCloseX.js.map +1 -1
- package/dist/components/molecules/Tags/index.cjs +18 -48
- package/dist/components/molecules/Tags/index.cjs.map +1 -1
- package/dist/components/molecules/Tags/index.d.ts +12 -3
- package/dist/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/components/molecules/Tags/index.js +18 -48
- package/dist/components/molecules/Tags/index.js.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.cjs +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.cjs.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.js +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.js.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.cjs +4 -1
- package/dist/components/organisms/ApplicationHeader/index.cjs.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.d.ts.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.js +4 -1
- package/dist/components/organisms/ApplicationHeader/index.js.map +1 -1
- package/dist/components/organisms/Calendar/calendar.utils.cjs +14 -0
- package/dist/components/organisms/Calendar/calendar.utils.cjs.map +1 -1
- package/dist/components/organisms/Calendar/calendar.utils.d.ts +7 -0
- package/dist/components/organisms/Calendar/calendar.utils.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/calendar.utils.js +14 -1
- package/dist/components/organisms/Calendar/calendar.utils.js.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.cjs +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.cjs.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.js +2 -2
- package/dist/components/organisms/Calendar/components/CalendarDayView.js.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarMonthView.cjs +12 -5
- package/dist/components/organisms/Calendar/components/CalendarMonthView.cjs.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarMonthView.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarMonthView.js +13 -6
- package/dist/components/organisms/Calendar/components/CalendarMonthView.js.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.cjs +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.cjs.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.js +2 -2
- package/dist/components/organisms/Calendar/components/CalendarWeekView.js.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.cjs +28 -13
- package/dist/components/organisms/Charts/components/ChartsBase.cjs.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.d.ts.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.js +28 -13
- package/dist/components/organisms/Charts/components/ChartsBase.js.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.cjs +1 -1
- package/dist/components/organisms/Charts/components/Metrics.cjs.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.d.ts.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.js +1 -1
- package/dist/components/organisms/Charts/components/Metrics.js.map +1 -1
- package/dist/components/organisms/ColorPicker/index.cjs +8 -5
- package/dist/components/organisms/ColorPicker/index.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.js +8 -5
- package/dist/components/organisms/ColorPicker/index.js.map +1 -1
- package/dist/components/organisms/Messaging/index.cjs +23 -5
- package/dist/components/organisms/Messaging/index.cjs.map +1 -1
- package/dist/components/organisms/Messaging/index.d.ts.map +1 -1
- package/dist/components/organisms/Messaging/index.js +24 -6
- package/dist/components/organisms/Messaging/index.js.map +1 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.cjs +7 -2
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.cjs.map +1 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.d.ts +3 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.d.ts.map +1 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.js +8 -3
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.cjs +121 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.d.ts +30 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.js +119 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs +39 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts +23 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js +37 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/index.cjs +34 -37
- package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.d.ts +52 -41
- package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.js +35 -38
- package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.cjs +13 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.d.ts +14 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.js +11 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.cjs +9 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.d.ts +13 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.js +7 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.cjs +52 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.d.ts +26 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.js +47 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.js.map +1 -0
- package/dist/components/organisms/Table/index.cjs +35 -5
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.d.ts +8 -2
- package/dist/components/organisms/Table/index.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.js +36 -6
- package/dist/components/organisms/Table/index.js.map +1 -1
- package/dist/components/organisms/Table/table.utils.cjs +37 -0
- package/dist/components/organisms/Table/table.utils.cjs.map +1 -0
- package/dist/components/organisms/Table/table.utils.d.ts +22 -0
- package/dist/components/organisms/Table/table.utils.d.ts.map +1 -0
- package/dist/components/organisms/Table/table.utils.js +33 -0
- package/dist/components/organisms/Table/table.utils.js.map +1 -0
- package/dist/components/organisms/TreeView/index.cjs +14 -7
- package/dist/components/organisms/TreeView/index.cjs.map +1 -1
- package/dist/components/organisms/TreeView/index.d.ts.map +1 -1
- package/dist/components/organisms/TreeView/index.js +14 -7
- package/dist/components/organisms/TreeView/index.js.map +1 -1
- package/dist/components/organisms/TreeView/treeView.utils.cjs +4 -1
- package/dist/components/organisms/TreeView/treeView.utils.cjs.map +1 -1
- package/dist/components/organisms/TreeView/treeView.utils.d.ts.map +1 -1
- package/dist/components/organisms/TreeView/treeView.utils.js +4 -1
- package/dist/components/organisms/TreeView/treeView.utils.js.map +1 -1
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.cjs +43 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.cjs.map +1 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.d.ts +12 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.d.ts.map +1 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.js +41 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.js.map +1 -0
- package/dist/components/templates/AppShell/index.cjs +10 -6
- package/dist/components/templates/AppShell/index.cjs.map +1 -1
- package/dist/components/templates/AppShell/index.d.ts +1 -1
- package/dist/components/templates/AppShell/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.js +11 -7
- package/dist/components/templates/AppShell/index.js.map +1 -1
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs +56 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs.map +1 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.d.ts +26 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.d.ts.map +1 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.js +54 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.js.map +1 -0
- package/dist/hooks/useDebouncedCallback/index.cjs +45 -0
- package/dist/hooks/useDebouncedCallback/index.cjs.map +1 -0
- package/dist/hooks/useDebouncedCallback/index.d.ts +18 -0
- package/dist/hooks/useDebouncedCallback/index.d.ts.map +1 -0
- package/dist/hooks/useDebouncedCallback/index.js +43 -0
- package/dist/hooks/useDebouncedCallback/index.js.map +1 -0
- package/dist/native/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Checkbox/index.js +1 -1
- package/dist/native/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/native/components/atoms/Dot/Dot.styles.d.ts +4 -0
- package/dist/native/components/atoms/Dot/Dot.styles.d.ts.map +1 -1
- package/dist/native/components/atoms/Dot/Dot.styles.js +1 -0
- package/dist/native/components/atoms/Dot/Dot.styles.js.map +1 -1
- package/dist/native/components/molecules/Tags/Tags.styles.d.ts +141 -0
- package/dist/native/components/molecules/Tags/Tags.styles.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/Tags.styles.js +92 -0
- package/dist/native/components/molecules/Tags/Tags.styles.js.map +1 -0
- package/dist/native/components/molecules/Tags/index.d.ts +95 -8
- package/dist/native/components/molecules/Tags/index.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/index.js +105 -0
- package/dist/native/components/molecules/Tags/index.js.map +1 -0
- package/dist/native/hooks/useDebouncedCallback/index.d.ts +18 -0
- package/dist/native/hooks/useDebouncedCallback/index.d.ts.map +1 -0
- package/dist/native/hooks/useDebouncedCallback/index.js +43 -0
- package/dist/native/hooks/useDebouncedCallback/index.js.map +1 -0
- package/dist/native/utilities/searchParamsUtils/index.d.ts +12 -0
- package/dist/utilities/searchParamsUtils/index.cjs +71 -0
- package/dist/utilities/searchParamsUtils/index.cjs.map +1 -0
- package/dist/utilities/searchParamsUtils/index.d.ts +61 -0
- package/dist/utilities/searchParamsUtils/index.d.ts.map +1 -0
- package/dist/utilities/searchParamsUtils/index.js +64 -0
- package/dist/utilities/searchParamsUtils/index.js.map +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface UseSlideoutStateOptions {
|
|
2
|
+
isOpen?: boolean;
|
|
3
|
+
defaultOpen?: boolean;
|
|
4
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
/** The open state in the shape react-aria's `OverlayTriggerState` has, so `Dialog` and `DialogTrigger` can share it. */
|
|
7
|
+
export interface SlideoutOpenState {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
setOpen: (isOpen: boolean) => void;
|
|
10
|
+
open: () => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
toggle: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Owns the panel's open state, controlled or uncontrolled by the usual pair of props, in the shape
|
|
16
|
+
* react-aria's trigger state has so a surrounding `DialogTrigger` and the `Dialog` inside can share it.
|
|
17
|
+
*
|
|
18
|
+
* @param options The open props as the consumer passed them.
|
|
19
|
+
* @returns The open state, with a stable identity across renders.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useSlideoutState: ({ isOpen, defaultOpen, onOpenChange }: UseSlideoutStateOptions) => SlideoutOpenState;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=useSlideoutState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSlideoutState.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"names":[],"mappings":"AAIA,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,wHAAwH;AACxH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,uCAAuC,uBAAuB,KAAG,iBA+BjG,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Owns the panel's open state, controlled or uncontrolled by the usual pair of props, in the shape
|
|
5
|
+
* react-aria's trigger state has so a surrounding `DialogTrigger` and the `Dialog` inside can share it.
|
|
6
|
+
*
|
|
7
|
+
* @param options The open props as the consumer passed them.
|
|
8
|
+
* @returns The open state, with a stable identity across renders.
|
|
9
|
+
*/
|
|
10
|
+
const useSlideoutState = ({ isOpen, defaultOpen, onOpenChange }) => {
|
|
11
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);
|
|
12
|
+
const isOpenControlled = isOpen !== undefined;
|
|
13
|
+
const resolvedOpen = isOpenControlled ? isOpen : uncontrolledOpen;
|
|
14
|
+
// The latest callback and value live in refs so the returned API keeps its identity across renders.
|
|
15
|
+
const onOpenChangeRef = useRef(onOpenChange);
|
|
16
|
+
const isOpenRef = useRef(resolvedOpen);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
onOpenChangeRef.current = onOpenChange;
|
|
19
|
+
isOpenRef.current = resolvedOpen;
|
|
20
|
+
});
|
|
21
|
+
const setOpen = useCallback((next) => {
|
|
22
|
+
if (!isOpenControlled)
|
|
23
|
+
setUncontrolledOpen(next);
|
|
24
|
+
if (next !== isOpenRef.current)
|
|
25
|
+
onOpenChangeRef.current?.(next);
|
|
26
|
+
}, [isOpenControlled]);
|
|
27
|
+
return useMemo(() => ({
|
|
28
|
+
isOpen: resolvedOpen,
|
|
29
|
+
setOpen,
|
|
30
|
+
open: () => setOpen(true),
|
|
31
|
+
close: () => setOpen(false),
|
|
32
|
+
toggle: () => setOpen(!isOpenRef.current),
|
|
33
|
+
}), [resolvedOpen, setOpen]);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { useSlideoutState };
|
|
37
|
+
//# sourceMappingURL=useSlideoutState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSlideoutState.js","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAmBA;;;;;;AAMG;AACI,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAA2B,KAAuB;AACpH,IAAA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,WAAW,IAAI,KAAK,CAAC;AAC9E,IAAA,MAAM,gBAAgB,GAAG,MAAM,KAAK,SAAS;IAC7C,MAAM,YAAY,GAAG,gBAAgB,GAAG,MAAM,GAAG,gBAAgB;;AAGjE,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC;AAC5C,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;IACtC,SAAS,CAAC,MAAK;AACb,QAAA,eAAe,CAAC,OAAO,GAAG,YAAY;AACtC,QAAA,SAAS,CAAC,OAAO,GAAG,YAAY;AAClC,IAAA,CAAC,CAAC;AAEF,IAAA,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,IAAa,KAAI;AAChB,QAAA,IAAI,CAAC,gBAAgB;YAAE,mBAAmB,CAAC,IAAI,CAAC;AAChD,QAAA,IAAI,IAAI,KAAK,SAAS,CAAC,OAAO;AAAE,YAAA,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;AACjE,IAAA,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB;AAED,IAAA,OAAO,OAAO,CACZ,OAAO;AACL,QAAA,MAAM,EAAE,YAAY;QACpB,OAAO;AACP,QAAA,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;AACzB,QAAA,KAAK,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC;QAC3B,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;AAC1C,KAAA,CAAC,EACF,CAAC,YAAY,EAAE,OAAO,CAAC,CACxB;AACH;;"}
|
|
@@ -1,61 +1,58 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var uiIcons = require('@flipdish/ui-icons');
|
|
4
5
|
var CloseButton = require('@flipdish/ui-library/components/atoms/CloseButton');
|
|
6
|
+
var UtilityButton = require('@flipdish/ui-library/components/atoms/UtilityButton');
|
|
5
7
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
8
|
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
9
|
+
var utils = require('@react-aria/utils');
|
|
10
|
+
var React = require('react');
|
|
7
11
|
var reactAriaComponents = require('react-aria-components');
|
|
12
|
+
var SlideoutShell = require('./components/SlideoutShell.cjs');
|
|
13
|
+
var SlideoutMenu_context = require('./providers/SlideoutMenu.context.cjs');
|
|
14
|
+
var slideoutMenu_utils = require('./utilities/slideoutMenu.utils.cjs');
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
const ModalOverlay = ({ children, ...props }) => {
|
|
11
|
-
return (jsxRuntime.jsx(reactAriaComponents.ModalOverlay, { ...props, className: (state) => cx.cx('fixed inset-0 z-50 flex min-h-dvh w-full items-center justify-end pl-6 outline-hidden md:pl-10',
|
|
12
|
-
// Nothing visible changes on the overlay itself; the bare animation keeps it mounted while its children animate.
|
|
13
|
-
state.isEntering && 'duration-300 animate-in', state.isExiting && 'duration-500 animate-out', typeof props.className === 'function' ? props.className(state) : props.className), children: (state) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { "aria-hidden": "true", className: cx.cx('absolute inset-0 bg-overlay/70 ease-linear', state.isEntering && 'duration-300 animate-in fade-in', state.isExiting && 'duration-500 animate-out fade-out') }), typeof children === 'function' ? children(state) : children] })) }));
|
|
14
|
-
};
|
|
15
|
-
ModalOverlay.displayName = 'ModalOverlay';
|
|
16
|
-
/** Panel that slides in from the right edge, wrapping react-aria-components `Modal`. */
|
|
17
|
-
const Modal = (props) => (jsxRuntime.jsx(reactAriaComponents.Modal, { ...props, className: (state) => cx.cx(
|
|
18
|
-
// relative, so the panel paints above the dimmer layer.
|
|
19
|
-
'relative inset-y-0 right-0 h-full w-full max-w-100 shadow-xl transition',
|
|
20
|
-
// The distance is spelled out: the bare utilities resolve to 0.25rem here, which reads as a fade, not a slide.
|
|
21
|
-
state.isEntering && 'duration-300 animate-in slide-in-from-right-[100%]', state.isExiting && 'duration-500 animate-out slide-out-to-right-[100%]', typeof props.className === 'function' ? props.className(state) : props.className) }));
|
|
22
|
-
Modal.displayName = 'Modal';
|
|
23
|
-
/** Scrollable dialog surface inside the panel that sets the `data-testid` prefix for its header, content and footer. */
|
|
24
|
-
const Dialog = ({ 'data-testid': dataTestId, ...props }) => {
|
|
25
|
-
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'slideout-menu', rootName: 'slideout-menu' });
|
|
26
|
-
return (jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(reactAriaComponents.Dialog, { role: "dialog", "aria-label": "Slideout menu", ...props, "data-testid": rootTestId, className: cx.cx('relative flex size-full flex-col items-start gap-6 overflow-y-auto bg-primary ring-1 ring-secondary_alt outline-hidden', props.className) }) }));
|
|
27
|
-
};
|
|
28
|
-
Dialog.displayName = 'Dialog';
|
|
29
|
-
const Menu = ({ children, dialogClassName, 'data-testid': dataTestId, ...props }) => {
|
|
30
|
-
return (jsxRuntime.jsx(ModalOverlay, { ...props, children: jsxRuntime.jsx(Modal, { className: (state) => cx.cx(typeof props.className === 'function' ? props.className(state) : props.className), children: (state) => (jsxRuntime.jsx(Dialog, { className: dialogClassName, "data-testid": dataTestId, children: ({ close }) => {
|
|
31
|
-
return typeof children === 'function' ? children({ ...state, close }) : children;
|
|
32
|
-
} })) }) }));
|
|
33
|
-
};
|
|
16
|
+
const Menu = (props) => jsxRuntime.jsx(SlideoutShell.SlideoutShell, { ...props });
|
|
34
17
|
Menu.displayName = 'SlideoutMenu';
|
|
35
|
-
const Content = ({
|
|
18
|
+
const Content = ({ 'data-testid': dataTestId, ...props }) => {
|
|
36
19
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
37
20
|
const contentTestId = dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'content') : undefined);
|
|
38
|
-
|
|
21
|
+
// No landmark role: the panel floats over a page that has its own `main`, and a dialog's content is not a second one.
|
|
22
|
+
return (jsxRuntime.jsx("div", { ...props, "data-testid": contentTestId, className: cx.cx('flex size-full flex-col gap-6 overflow-y-auto overscroll-auto px-4 md:px-6', props.className) }));
|
|
39
23
|
};
|
|
40
24
|
Content.displayName = 'SlideoutContent';
|
|
41
|
-
const Header = ({ className, children, onClose, 'data-testid': dataTestId, ...props }) => {
|
|
25
|
+
const Header = ({ className, children, onClose, closeLabel, href, linkLabel = 'Open full page', onLinkPress, 'data-testid': dataTestId, ref, ...props }) => {
|
|
26
|
+
const panel = React.useContext(SlideoutMenu_context.SlideoutMenuContext);
|
|
42
27
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
43
28
|
const headerTestId = dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'header') : undefined);
|
|
44
|
-
|
|
29
|
+
const titleRef = React.useRef(null);
|
|
30
|
+
const headerRef = utils.useObjectRef(ref);
|
|
31
|
+
// The shell decides what to speak: a swap between loading and loaded content remounts this header, so it cannot remember the last title itself.
|
|
32
|
+
// The heading alone when there is one, since the whole header read as one run would join avatar initials, name and email.
|
|
33
|
+
React.useLayoutEffect(() => {
|
|
34
|
+
const title = titleRef.current?.querySelector('h1, h2, h3, h4, h5, h6') ?? titleRef.current;
|
|
35
|
+
panel?.announceTitle(title?.textContent?.trim() ?? '');
|
|
36
|
+
});
|
|
37
|
+
// A `div`, not `header`: inside a dialog that element maps to `banner` and would duplicate the page's own.
|
|
38
|
+
return (jsxRuntime.jsxs("div", { ...props, ref: headerRef, "data-testid": headerTestId,
|
|
39
|
+
// Right padding clears the close button, and the link beside it, so a long title wraps instead of running under them.
|
|
40
|
+
className: cx.cx('relative z-1 w-full pt-6 pl-4 md:pl-6', href ? 'pr-24' : 'pr-12', className), children: [jsxRuntime.jsx("div", { ref: titleRef, className: "contents", children: children }), href && (jsxRuntime.jsx(UtilityButton.ButtonUtility, { href: href, onPress: onLinkPress, icon: uiIcons.ArrowUpRight, tooltip: linkLabel, color: "tertiary", size: "sm", className: "absolute top-3 right-12 size-9 shrink-0", "data-testid": prefix ? testIdUtils.joinTestId(prefix, 'link') : undefined })), jsxRuntime.jsx(CloseButton.CloseButton, { size: "sm", label: closeLabel ?? (panel?.label ? `Close ${panel.label}` : undefined), className: "absolute top-3 right-3 shrink-0", onClick: onClose ?? panel?.close, "data-testid": prefix ? testIdUtils.joinTestId(prefix, 'close') : undefined })] }));
|
|
45
41
|
};
|
|
46
42
|
Header.displayName = 'SlideoutHeader';
|
|
47
43
|
const Footer = ({ 'data-testid': dataTestId, ...props }) => {
|
|
48
44
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
49
45
|
const footerTestId = dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'footer') : undefined);
|
|
50
|
-
|
|
46
|
+
// A `div`, not `footer`: inside a dialog that element maps to `contentinfo` and would duplicate the page's own.
|
|
47
|
+
return (jsxRuntime.jsx("div", { ...props, "data-testid": footerTestId, className: cx.cx('w-full p-4 shadow-[inset_0px_1px_0px_0px] shadow-border-secondary md:px-6', props.className) }));
|
|
51
48
|
};
|
|
52
49
|
Footer.displayName = 'SlideoutFooter';
|
|
53
50
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* inside it.
|
|
51
|
+
* Panel that slides in from the right edge and floats over the page without dimming or blocking it,
|
|
52
|
+
* for the detail of the record the user just selected. It covers the page area only, never the header, the
|
|
53
|
+
* sidebar or a docked side panel; compose `Header`, `Content` and `Footer` inside it.
|
|
57
54
|
*
|
|
58
|
-
* @summary right-edge
|
|
55
|
+
* @summary non-modal right-edge panel for the selected record's detail
|
|
59
56
|
*/
|
|
60
57
|
const SlideoutMenu = Menu;
|
|
61
58
|
SlideoutMenu.displayName = 'SlideoutMenu';
|
|
@@ -64,8 +61,8 @@ SlideoutMenu.Content = Content;
|
|
|
64
61
|
SlideoutMenu.Header = Header;
|
|
65
62
|
SlideoutMenu.Footer = Footer;
|
|
66
63
|
|
|
67
|
-
exports.
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
64
|
+
exports.APP_HEADER_HEIGHT_VAR = slideoutMenu_utils.APP_HEADER_HEIGHT_VAR;
|
|
65
|
+
exports.APP_SIDEBAR_WIDTH_VAR = slideoutMenu_utils.APP_SIDEBAR_WIDTH_VAR;
|
|
66
|
+
exports.APP_SIDE_PANEL_WIDTH_VAR = slideoutMenu_utils.APP_SIDE_PANEL_WIDTH_VAR;
|
|
70
67
|
exports.SlideoutMenu = SlideoutMenu;
|
|
71
68
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","SlideoutShell","useTestIdPrefix","joinTestId","cx","useContext","SlideoutMenuContext","useRef","useObjectRef","useLayoutEffect","_jsxs","ButtonUtility","ArrowUpRight","CloseButton","AriaDialogTrigger"],"mappings":";;;;;;;;;;;;;;;AAqDA,MAAM,IAAI,GAAG,CAAC,KAAwB,KAAKA,cAAA,CA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AAG,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC;;AAGtF,IAAA,QACEH,cAAA,CAAA,KAAA,EAAA,EAAA,GACM,KAAK,iBACI,YAAY,EACzB,SAAS,EAAEI,KAAE,CAAC,2EAA2E,EAAE,KAAK,CAAC,SAAS,CAAC,EAAA,CAC3G;AAEN,CAAC;AACD,MAAM,CAAC,WAAW,GAAG,gBAAgB;AAErC;;;;;;AAMG;AACH,MAAM,YAAY,GAAG;AAMrB,YAAY,CAAC,WAAW,GAAG,cAAc;AAEzC,YAAY,CAAC,OAAO,GAAGU,iCAAiB;AACxC,YAAY,CAAC,OAAO,GAAG,OAAO;AAC9B,YAAY,CAAC,MAAM,GAAG,MAAM;AAC5B,YAAY,CAAC,MAAM,GAAG,MAAM;;;;;"}
|
|
@@ -1,71 +1,82 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef, ReactNode
|
|
2
|
-
import type { DialogProps as AriaDialogProps, ModalOverlayProps as AriaModalOverlayProps, ModalRenderProps as AriaModalRenderProps } from 'react-aria-components';
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
2
|
import { DialogTrigger as AriaDialogTrigger } from 'react-aria-components';
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
3
|
+
import type { SlideoutRenderProps } from './components/SlideoutShell';
|
|
4
|
+
import type { SlideoutBounds } from './utilities/slideoutMenu.utils';
|
|
5
|
+
export type { SlideoutRenderProps } from './components/SlideoutShell';
|
|
6
|
+
export type { SlideoutBounds } from './utilities/slideoutMenu.utils';
|
|
7
|
+
export { APP_HEADER_HEIGHT_VAR, APP_SIDE_PANEL_WIDTH_VAR, APP_SIDEBAR_WIDTH_VAR } from './utilities/slideoutMenu.utils';
|
|
8
|
+
export interface SlideoutMenuProps {
|
|
9
|
+
/** Controlled open state. Pair with `onOpenChange`; omit both to let `SlideoutMenu.Trigger` own it. */
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
/** Initial open state when uncontrolled. */
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Called with the new open state when the panel asks to open or close. Applies with `isOpen` or `defaultOpen`; inside a
|
|
15
|
+
* `SlideoutMenu.Trigger` the trigger owns the state, so pass `onOpenChange` to the trigger instead.
|
|
16
|
+
*/
|
|
17
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
18
|
+
/** Keeps the panel open on Escape, pressed inside the panel or anywhere on the page. */
|
|
19
|
+
isKeyboardDismissDisabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The box the panel may cover, as distances from the viewport edges; a number is pixels, a string any CSS length. Defaults to
|
|
22
|
+
* the `AppShell` page area, else the host's `--app-header-height`, `--app-sidebar-width` and `--app-side-panel-width`, read
|
|
23
|
+
* from `:root`, `body` or any ancestor of the element overlays portal into, each `0px` when unset. A key given here falls
|
|
24
|
+
* back to its variable when the others are omitted.
|
|
25
|
+
*/
|
|
26
|
+
bounds?: SlideoutBounds;
|
|
27
|
+
/** Names the dialog for assistive technology. Defaults to "Slideout menu"; prefer the name of what the panel shows. */
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/** Names the dialog by an element inside it, such as the heading in `Header`, instead of `aria-label`. */
|
|
30
|
+
'aria-labelledby'?: string;
|
|
31
|
+
/** Menu content, or a function that receives `close`. */
|
|
32
|
+
children: ReactNode | ((state: SlideoutRenderProps) => ReactNode);
|
|
33
|
+
/** Extra classes merged onto the sliding panel. */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Extra classes merged onto the scrollable dialog surface inside the panel. */
|
|
33
36
|
dialogClassName?: string;
|
|
34
37
|
/** Overrides the root `data-testid` (defaults to `fd-slideout-menu`). Descendants derive their ids from this prefix. */
|
|
35
38
|
'data-testid'?: string;
|
|
36
39
|
}
|
|
37
40
|
declare const Menu: {
|
|
38
|
-
(
|
|
41
|
+
(props: SlideoutMenuProps): import("react").JSX.Element;
|
|
39
42
|
displayName: string;
|
|
40
43
|
};
|
|
41
44
|
declare const Content: {
|
|
42
|
-
({
|
|
45
|
+
({ "data-testid": dataTestId, ...props }: ComponentPropsWithRef<"div"> & {
|
|
43
46
|
"data-testid"?: string;
|
|
44
47
|
}): import("react").JSX.Element;
|
|
45
48
|
displayName: string;
|
|
46
49
|
};
|
|
47
|
-
export interface SlideoutHeaderProps extends ComponentPropsWithRef<'
|
|
48
|
-
/**
|
|
50
|
+
export interface SlideoutHeaderProps extends ComponentPropsWithRef<'div'> {
|
|
51
|
+
/** Runs instead of closing the panel when the close button is pressed. */
|
|
49
52
|
onClose?: () => void;
|
|
53
|
+
/** Accessible name of the close button. Defaults to "Close {aria-label}", or "Close" for a panel named by `aria-labelledby`. */
|
|
54
|
+
closeLabel?: string;
|
|
55
|
+
/** The record's own page. Given, a link button beside the close button opens it through the app's router; omitted, nothing renders. */
|
|
56
|
+
href?: string;
|
|
57
|
+
/** Accessible name of the link button. Defaults to "Open full page". */
|
|
58
|
+
linkLabel?: string;
|
|
59
|
+
/** Runs when the link button is pressed, alongside the navigation, e.g. to record it or to follow the `href` where links are intercepted. */
|
|
60
|
+
onLinkPress?: () => void;
|
|
50
61
|
/** Overrides the header's `data-testid` (defaults to `<root>--header`). */
|
|
51
62
|
'data-testid'?: string;
|
|
52
63
|
}
|
|
53
64
|
declare const Header: {
|
|
54
|
-
({ className, children, onClose, "data-testid": dataTestId, ...props }: SlideoutHeaderProps): import("react").JSX.Element;
|
|
65
|
+
({ className, children, onClose, closeLabel, href, linkLabel, onLinkPress, "data-testid": dataTestId, ref, ...props }: SlideoutHeaderProps): import("react").JSX.Element;
|
|
55
66
|
displayName: string;
|
|
56
67
|
};
|
|
57
68
|
declare const Footer: {
|
|
58
|
-
({ "data-testid": dataTestId, ...props }: ComponentPropsWithRef<"
|
|
69
|
+
({ "data-testid": dataTestId, ...props }: ComponentPropsWithRef<"div"> & {
|
|
59
70
|
"data-testid"?: string;
|
|
60
71
|
}): import("react").JSX.Element;
|
|
61
72
|
displayName: string;
|
|
62
73
|
};
|
|
63
74
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* inside it.
|
|
75
|
+
* Panel that slides in from the right edge and floats over the page without dimming or blocking it,
|
|
76
|
+
* for the detail of the record the user just selected. It covers the page area only, never the header, the
|
|
77
|
+
* sidebar or a docked side panel; compose `Header`, `Content` and `Footer` inside it.
|
|
67
78
|
*
|
|
68
|
-
* @summary right-edge
|
|
79
|
+
* @summary non-modal right-edge panel for the selected record's detail
|
|
69
80
|
*/
|
|
70
81
|
declare const SlideoutMenu: typeof Menu & {
|
|
71
82
|
Trigger: typeof AriaDialogTrigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,YAAY,EAAE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M,CAAC;IACd,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6IAA6I;IAC7I,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM;2HAWT,mBAAmB;;CA+CrB,CAAC;AAGF,QAAA,MAAM,MAAM;8CAA6C,qBAAqB,CAAC,KAAK,CAAC,GAAG;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;;CAYjH,CAAC;AAGF;;;;;;GAMG;AACH,QAAA,MAAM,YAAY,EAAW,OAAO,IAAI,GAAG;IACzC,OAAO,EAAE,OAAO,iBAAiB,CAAC;IAClC,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,MAAM,CAAC;CACvB,CAAC;AAQF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,59 +1,56 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { ArrowUpRight } from '@flipdish/ui-icons';
|
|
2
3
|
import { CloseButton } from '@flipdish/ui-library/components/atoms/CloseButton';
|
|
4
|
+
import { ButtonUtility } from '@flipdish/ui-library/components/atoms/UtilityButton';
|
|
3
5
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
+
import { useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
7
|
+
import { useObjectRef } from '@react-aria/utils';
|
|
8
|
+
import { useContext, useRef, useLayoutEffect } from 'react';
|
|
9
|
+
import { DialogTrigger } from 'react-aria-components';
|
|
10
|
+
import { SlideoutShell } from './components/SlideoutShell.js';
|
|
11
|
+
import { SlideoutMenuContext } from './providers/SlideoutMenu.context.js';
|
|
12
|
+
export { APP_HEADER_HEIGHT_VAR, APP_SIDEBAR_WIDTH_VAR, APP_SIDE_PANEL_WIDTH_VAR } from './utilities/slideoutMenu.utils.js';
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
const ModalOverlay = ({ children, ...props }) => {
|
|
9
|
-
return (jsx(ModalOverlay$1, { ...props, className: (state) => cx('fixed inset-0 z-50 flex min-h-dvh w-full items-center justify-end pl-6 outline-hidden md:pl-10',
|
|
10
|
-
// Nothing visible changes on the overlay itself; the bare animation keeps it mounted while its children animate.
|
|
11
|
-
state.isEntering && 'duration-300 animate-in', state.isExiting && 'duration-500 animate-out', typeof props.className === 'function' ? props.className(state) : props.className), children: (state) => (jsxs(Fragment, { children: [jsx("div", { "aria-hidden": "true", className: cx('absolute inset-0 bg-overlay/70 ease-linear', state.isEntering && 'duration-300 animate-in fade-in', state.isExiting && 'duration-500 animate-out fade-out') }), typeof children === 'function' ? children(state) : children] })) }));
|
|
12
|
-
};
|
|
13
|
-
ModalOverlay.displayName = 'ModalOverlay';
|
|
14
|
-
/** Panel that slides in from the right edge, wrapping react-aria-components `Modal`. */
|
|
15
|
-
const Modal = (props) => (jsx(Modal$1, { ...props, className: (state) => cx(
|
|
16
|
-
// relative, so the panel paints above the dimmer layer.
|
|
17
|
-
'relative inset-y-0 right-0 h-full w-full max-w-100 shadow-xl transition',
|
|
18
|
-
// The distance is spelled out: the bare utilities resolve to 0.25rem here, which reads as a fade, not a slide.
|
|
19
|
-
state.isEntering && 'duration-300 animate-in slide-in-from-right-[100%]', state.isExiting && 'duration-500 animate-out slide-out-to-right-[100%]', typeof props.className === 'function' ? props.className(state) : props.className) }));
|
|
20
|
-
Modal.displayName = 'Modal';
|
|
21
|
-
/** Scrollable dialog surface inside the panel that sets the `data-testid` prefix for its header, content and footer. */
|
|
22
|
-
const Dialog = ({ 'data-testid': dataTestId, ...props }) => {
|
|
23
|
-
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'slideout-menu', rootName: 'slideout-menu' });
|
|
24
|
-
return (jsx(TestIdProvider, { value: rootTestId, children: jsx(Dialog$1, { role: "dialog", "aria-label": "Slideout menu", ...props, "data-testid": rootTestId, className: cx('relative flex size-full flex-col items-start gap-6 overflow-y-auto bg-primary ring-1 ring-secondary_alt outline-hidden', props.className) }) }));
|
|
25
|
-
};
|
|
26
|
-
Dialog.displayName = 'Dialog';
|
|
27
|
-
const Menu = ({ children, dialogClassName, 'data-testid': dataTestId, ...props }) => {
|
|
28
|
-
return (jsx(ModalOverlay, { ...props, children: jsx(Modal, { className: (state) => cx(typeof props.className === 'function' ? props.className(state) : props.className), children: (state) => (jsx(Dialog, { className: dialogClassName, "data-testid": dataTestId, children: ({ close }) => {
|
|
29
|
-
return typeof children === 'function' ? children({ ...state, close }) : children;
|
|
30
|
-
} })) }) }));
|
|
31
|
-
};
|
|
14
|
+
const Menu = (props) => jsx(SlideoutShell, { ...props });
|
|
32
15
|
Menu.displayName = 'SlideoutMenu';
|
|
33
|
-
const Content = ({
|
|
16
|
+
const Content = ({ 'data-testid': dataTestId, ...props }) => {
|
|
34
17
|
const prefix = useTestIdPrefix();
|
|
35
18
|
const contentTestId = dataTestId ?? (prefix ? joinTestId(prefix, 'content') : undefined);
|
|
36
|
-
|
|
19
|
+
// No landmark role: the panel floats over a page that has its own `main`, and a dialog's content is not a second one.
|
|
20
|
+
return (jsx("div", { ...props, "data-testid": contentTestId, className: cx('flex size-full flex-col gap-6 overflow-y-auto overscroll-auto px-4 md:px-6', props.className) }));
|
|
37
21
|
};
|
|
38
22
|
Content.displayName = 'SlideoutContent';
|
|
39
|
-
const Header = ({ className, children, onClose, 'data-testid': dataTestId, ...props }) => {
|
|
23
|
+
const Header = ({ className, children, onClose, closeLabel, href, linkLabel = 'Open full page', onLinkPress, 'data-testid': dataTestId, ref, ...props }) => {
|
|
24
|
+
const panel = useContext(SlideoutMenuContext);
|
|
40
25
|
const prefix = useTestIdPrefix();
|
|
41
26
|
const headerTestId = dataTestId ?? (prefix ? joinTestId(prefix, 'header') : undefined);
|
|
42
|
-
|
|
27
|
+
const titleRef = useRef(null);
|
|
28
|
+
const headerRef = useObjectRef(ref);
|
|
29
|
+
// The shell decides what to speak: a swap between loading and loaded content remounts this header, so it cannot remember the last title itself.
|
|
30
|
+
// The heading alone when there is one, since the whole header read as one run would join avatar initials, name and email.
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
const title = titleRef.current?.querySelector('h1, h2, h3, h4, h5, h6') ?? titleRef.current;
|
|
33
|
+
panel?.announceTitle(title?.textContent?.trim() ?? '');
|
|
34
|
+
});
|
|
35
|
+
// A `div`, not `header`: inside a dialog that element maps to `banner` and would duplicate the page's own.
|
|
36
|
+
return (jsxs("div", { ...props, ref: headerRef, "data-testid": headerTestId,
|
|
37
|
+
// Right padding clears the close button, and the link beside it, so a long title wraps instead of running under them.
|
|
38
|
+
className: cx('relative z-1 w-full pt-6 pl-4 md:pl-6', href ? 'pr-24' : 'pr-12', className), children: [jsx("div", { ref: titleRef, className: "contents", children: children }), href && (jsx(ButtonUtility, { href: href, onPress: onLinkPress, icon: ArrowUpRight, tooltip: linkLabel, color: "tertiary", size: "sm", className: "absolute top-3 right-12 size-9 shrink-0", "data-testid": prefix ? joinTestId(prefix, 'link') : undefined })), jsx(CloseButton, { size: "sm", label: closeLabel ?? (panel?.label ? `Close ${panel.label}` : undefined), className: "absolute top-3 right-3 shrink-0", onClick: onClose ?? panel?.close, "data-testid": prefix ? joinTestId(prefix, 'close') : undefined })] }));
|
|
43
39
|
};
|
|
44
40
|
Header.displayName = 'SlideoutHeader';
|
|
45
41
|
const Footer = ({ 'data-testid': dataTestId, ...props }) => {
|
|
46
42
|
const prefix = useTestIdPrefix();
|
|
47
43
|
const footerTestId = dataTestId ?? (prefix ? joinTestId(prefix, 'footer') : undefined);
|
|
48
|
-
|
|
44
|
+
// A `div`, not `footer`: inside a dialog that element maps to `contentinfo` and would duplicate the page's own.
|
|
45
|
+
return (jsx("div", { ...props, "data-testid": footerTestId, className: cx('w-full p-4 shadow-[inset_0px_1px_0px_0px] shadow-border-secondary md:px-6', props.className) }));
|
|
49
46
|
};
|
|
50
47
|
Footer.displayName = 'SlideoutFooter';
|
|
51
48
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* inside it.
|
|
49
|
+
* Panel that slides in from the right edge and floats over the page without dimming or blocking it,
|
|
50
|
+
* for the detail of the record the user just selected. It covers the page area only, never the header, the
|
|
51
|
+
* sidebar or a docked side panel; compose `Header`, `Content` and `Footer` inside it.
|
|
55
52
|
*
|
|
56
|
-
* @summary right-edge
|
|
53
|
+
* @summary non-modal right-edge panel for the selected record's detail
|
|
57
54
|
*/
|
|
58
55
|
const SlideoutMenu = Menu;
|
|
59
56
|
SlideoutMenu.displayName = 'SlideoutMenu';
|
|
@@ -62,5 +59,5 @@ SlideoutMenu.Content = Content;
|
|
|
62
59
|
SlideoutMenu.Header = Header;
|
|
63
60
|
SlideoutMenu.Footer = Footer;
|
|
64
61
|
|
|
65
|
-
export {
|
|
62
|
+
export { SlideoutMenu };
|
|
66
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaDialogTrigger"],"mappings":";;;;;;;;;;;;;AAqDA,MAAM,IAAI,GAAG,CAAC,KAAwB,KAAKA,GAAA,CAAC,aAAa,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AACvE,IAAI,CAAC,WAAW,GAAG,cAAc;AAEjC,MAAM,OAAO,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA6D,KAAI;AACrH,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;IAChC,MAAM,aAAa,GAAG,UAAU,KAAK,MAAM,GAAG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;;;;;;AAMG;AACH,MAAM,YAAY,GAAG;AAMrB,YAAY,CAAC,WAAW,GAAG,cAAc;AAEzC,YAAY,CAAC,OAAO,GAAGE,aAAiB;AACxC,YAAY,CAAC,OAAO,GAAG,OAAO;AAC9B,YAAY,CAAC,MAAM,GAAG,MAAM;AAC5B,YAAY,CAAC,MAAM,GAAG,MAAM;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Provided by `AppShell` from its measured page area, read by `SlideoutMenu` as the box it may cover.
|
|
7
|
+
* Context rather than a CSS variable because the shell sits below the themed root the overlay portals
|
|
8
|
+
* into, so nothing it sets in CSS could reach the panel; context crosses the portal.
|
|
9
|
+
*/
|
|
10
|
+
const OverlayBoundsContext = React.createContext(undefined);
|
|
11
|
+
|
|
12
|
+
exports.OverlayBoundsContext = OverlayBoundsContext;
|
|
13
|
+
//# sourceMappingURL=OverlayBounds.context.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayBounds.context.cjs","sources":["../../../../../src/components/organisms/SlideoutMenu/providers/OverlayBounds.context.ts"],"sourcesContent":[null],"names":["createContext"],"mappings":";;;;AAYA;;;;AAIG;MACU,oBAAoB,GAAGA,mBAAa,CAA4B,SAAS;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** The page area's position and size in the viewport, in pixels. */
|
|
2
|
+
export interface OverlayBounds {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Provided by `AppShell` from its measured page area, read by `SlideoutMenu` as the box it may cover.
|
|
10
|
+
* Context rather than a CSS variable because the shell sits below the themed root the overlay portals
|
|
11
|
+
* into, so nothing it sets in CSS could reach the panel; context crosses the portal.
|
|
12
|
+
*/
|
|
13
|
+
export declare const OverlayBoundsContext: import("react").Context<OverlayBounds | undefined>;
|
|
14
|
+
//# sourceMappingURL=OverlayBounds.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayBounds.context.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/providers/OverlayBounds.context.ts"],"names":[],"mappings":"AAIA,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,oDAAsD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provided by `AppShell` from its measured page area, read by `SlideoutMenu` as the box it may cover.
|
|
5
|
+
* Context rather than a CSS variable because the shell sits below the themed root the overlay portals
|
|
6
|
+
* into, so nothing it sets in CSS could reach the panel; context crosses the portal.
|
|
7
|
+
*/
|
|
8
|
+
const OverlayBoundsContext = createContext(undefined);
|
|
9
|
+
|
|
10
|
+
export { OverlayBoundsContext };
|
|
11
|
+
//# sourceMappingURL=OverlayBounds.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayBounds.context.js","sources":["../../../../../src/components/organisms/SlideoutMenu/providers/OverlayBounds.context.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAYA;;;;AAIG;MACU,oBAAoB,GAAG,aAAa,CAA4B,SAAS;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
/** Provided by the shell, read by `Header`, so the sections never import `../index`. */
|
|
6
|
+
const SlideoutMenuContext = React.createContext(undefined);
|
|
7
|
+
|
|
8
|
+
exports.SlideoutMenuContext = SlideoutMenuContext;
|
|
9
|
+
//# sourceMappingURL=SlideoutMenu.context.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideoutMenu.context.cjs","sources":["../../../../../src/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.ts"],"sourcesContent":[null],"names":["createContext"],"mappings":";;;;AAeA;MACa,mBAAmB,GAAGA,mBAAa,CAAuC,SAAS;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SlideoutMenuContextValue {
|
|
2
|
+
close: () => void;
|
|
3
|
+
/** The panel's `aria-label`, so the close button can say which panel it closes; absent when the panel is named by `aria-labelledby`. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Reports the `Header` title on every render. The shell speaks a change politely when the user's focus is outside the panel,
|
|
7
|
+
* and treats the first title it hears as the open, which the dialog announces itself.
|
|
8
|
+
*/
|
|
9
|
+
announceTitle: (title: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/** Provided by the shell, read by `Header`, so the sections never import `../index`. */
|
|
12
|
+
export declare const SlideoutMenuContext: import("react").Context<SlideoutMenuContextValue | undefined>;
|
|
13
|
+
//# sourceMappingURL=SlideoutMenu.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideoutMenu.context.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,wIAAwI;IACxI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,+DAAiE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Provided by the shell, read by `Header`, so the sections never import `../index`. */
|
|
4
|
+
const SlideoutMenuContext = createContext(undefined);
|
|
5
|
+
|
|
6
|
+
export { SlideoutMenuContext };
|
|
7
|
+
//# sourceMappingURL=SlideoutMenu.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideoutMenu.context.js","sources":["../../../../../src/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAeA;MACa,mBAAmB,GAAG,aAAa,CAAuC,SAAS;;"}
|