@flipdish/ui-library 0.29.0 → 0.31.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/Input/index.cjs +3 -1
- package/dist/components/atoms/Input/index.cjs.map +1 -1
- package/dist/components/atoms/Input/index.d.ts +5 -1
- package/dist/components/atoms/Input/index.d.ts.map +1 -1
- package/dist/components/atoms/Input/index.js +3 -1
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/molecules/Select/components/combobox.cjs +3 -1
- package/dist/components/molecules/Select/components/combobox.cjs.map +1 -1
- package/dist/components/molecules/Select/components/combobox.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/combobox.js +3 -1
- package/dist/components/molecules/Select/components/combobox.js.map +1 -1
- package/dist/components/organisms/ApplicationHeader/applicationHeader.types.d.ts +12 -5
- package/dist/components/organisms/ApplicationHeader/applicationHeader.types.d.ts.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.cjs +12 -17
- package/dist/components/organisms/ApplicationHeader/index.cjs.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.d.ts +9 -5
- package/dist/components/organisms/ApplicationHeader/index.d.ts.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.js +12 -18
- package/dist/components/organisms/ApplicationHeader/index.js.map +1 -1
- package/dist/components/organisms/Calendar/index.cjs +3 -3
- package/dist/components/organisms/Calendar/index.cjs.map +1 -1
- package/dist/components/organisms/Calendar/index.js +3 -3
- package/dist/components/organisms/Calendar/index.js.map +1 -1
- package/dist/components/organisms/CommandMenu/commandMenu.utils.cjs +0 -21
- package/dist/components/organisms/CommandMenu/commandMenu.utils.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/commandMenu.utils.d.ts +0 -9
- package/dist/components/organisms/CommandMenu/commandMenu.utils.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/commandMenu.utils.js +1 -21
- package/dist/components/organisms/CommandMenu/commandMenu.utils.js.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-input.cjs +2 -2
- package/dist/components/organisms/CommandMenu/components/command-input.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-input.d.ts +3 -2
- package/dist/components/organisms/CommandMenu/components/command-input.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-input.js +2 -2
- package/dist/components/organisms/CommandMenu/components/command-input.js.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs +15 -2
- package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts +9 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.js +15 -2
- package/dist/components/organisms/CommandMenu/components/command-menu-item.js.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-shortcut.cjs +2 -2
- package/dist/components/organisms/CommandMenu/components/command-shortcut.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-shortcut.d.ts +1 -0
- package/dist/components/organisms/CommandMenu/components/command-shortcut.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-shortcut.js +2 -2
- package/dist/components/organisms/CommandMenu/components/command-shortcut.js.map +1 -1
- package/dist/components/organisms/CommandMenu/index.cjs +65 -29
- package/dist/components/organisms/CommandMenu/index.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/index.d.ts +29 -2
- package/dist/components/organisms/CommandMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/index.js +69 -33
- package/dist/components/organisms/CommandMenu/index.js.map +1 -1
- package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.cjs +9 -0
- package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.cjs.map +1 -0
- package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.d.ts +3 -0
- package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.d.ts.map +1 -0
- package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.js +7 -0
- package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.js.map +1 -0
- package/dist/components/organisms/DatePicker/components/input-date.cjs +3 -1
- package/dist/components/organisms/DatePicker/components/input-date.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/components/input-date.d.ts +5 -1
- package/dist/components/organisms/DatePicker/components/input-date.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/components/input-date.js +3 -1
- package/dist/components/organisms/DatePicker/components/input-date.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js.map +1 -1
- package/dist/components/organisms/SidePanel/components/side-panel-content.cjs +15 -0
- package/dist/components/organisms/SidePanel/components/side-panel-content.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-content.d.ts +11 -0
- package/dist/components/organisms/SidePanel/components/side-panel-content.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-content.js +13 -0
- package/dist/components/organisms/SidePanel/components/side-panel-content.js.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-footer.cjs +15 -0
- package/dist/components/organisms/SidePanel/components/side-panel-footer.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-footer.d.ts +11 -0
- package/dist/components/organisms/SidePanel/components/side-panel-footer.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-footer.js +13 -0
- package/dist/components/organisms/SidePanel/components/side-panel-footer.js.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-header.cjs +19 -0
- package/dist/components/organisms/SidePanel/components/side-panel-header.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-header.d.ts +15 -0
- package/dist/components/organisms/SidePanel/components/side-panel-header.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-header.js +17 -0
- package/dist/components/organisms/SidePanel/components/side-panel-header.js.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-region.cjs +42 -0
- package/dist/components/organisms/SidePanel/components/side-panel-region.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-region.d.ts +15 -0
- package/dist/components/organisms/SidePanel/components/side-panel-region.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/components/side-panel-region.js +39 -0
- package/dist/components/organisms/SidePanel/components/side-panel-region.js.map +1 -0
- package/dist/components/organisms/SidePanel/hooks/useOpenOnMount.cjs +29 -0
- package/dist/components/organisms/SidePanel/hooks/useOpenOnMount.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/hooks/useOpenOnMount.d.ts +13 -0
- package/dist/components/organisms/SidePanel/hooks/useOpenOnMount.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/hooks/useOpenOnMount.js +27 -0
- package/dist/components/organisms/SidePanel/hooks/useOpenOnMount.js.map +1 -0
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.cjs +76 -0
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.d.ts +22 -0
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.js +74 -0
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.js.map +1 -0
- package/dist/components/organisms/SidePanel/index.cjs +51 -0
- package/dist/components/organisms/SidePanel/index.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/index.d.ts +48 -0
- package/dist/components/organisms/SidePanel/index.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/index.js +49 -0
- package/dist/components/organisms/SidePanel/index.js.map +1 -0
- package/dist/components/organisms/SidePanel/providers/page-cover-context.cjs +12 -0
- package/dist/components/organisms/SidePanel/providers/page-cover-context.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/providers/page-cover-context.d.ts +6 -0
- package/dist/components/organisms/SidePanel/providers/page-cover-context.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/providers/page-cover-context.js +10 -0
- package/dist/components/organisms/SidePanel/providers/page-cover-context.js.map +1 -0
- package/dist/components/organisms/SidePanel/providers/side-panel-context.cjs +9 -0
- package/dist/components/organisms/SidePanel/providers/side-panel-context.cjs.map +1 -0
- package/dist/components/organisms/SidePanel/providers/side-panel-context.d.ts +8 -0
- package/dist/components/organisms/SidePanel/providers/side-panel-context.d.ts.map +1 -0
- package/dist/components/organisms/SidePanel/providers/side-panel-context.js +7 -0
- package/dist/components/organisms/SidePanel/providers/side-panel-context.js.map +1 -0
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.cjs +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.js +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.cjs +15 -5
- package/dist/components/organisms/SidebarNavigation/index.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.d.ts +3 -2
- package/dist/components/organisms/SidebarNavigation/index.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.js +15 -5
- package/dist/components/organisms/SidebarNavigation/index.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.cjs +9 -3
- package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.d.ts +1 -1
- package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.js +10 -4
- package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
- package/dist/components/organisms/TextEditor/components/text-editor-extensions.cjs +9 -4
- package/dist/components/organisms/TextEditor/components/text-editor-extensions.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/text-editor-extensions.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/components/text-editor-extensions.js +10 -5
- package/dist/components/organisms/TextEditor/components/text-editor-extensions.js.map +1 -1
- package/dist/components/organisms/TextEditor/components/text-editor-toolbar.cjs +8 -2
- package/dist/components/organisms/TextEditor/components/text-editor-toolbar.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/text-editor-toolbar.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/components/text-editor-toolbar.js +8 -2
- package/dist/components/organisms/TextEditor/components/text-editor-toolbar.js.map +1 -1
- package/dist/components/organisms/TextEditor/textEditor.utils.cjs +3 -0
- package/dist/components/organisms/TextEditor/textEditor.utils.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/textEditor.utils.d.ts +4 -0
- package/dist/components/organisms/TextEditor/textEditor.utils.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/textEditor.utils.js +3 -1
- package/dist/components/organisms/TextEditor/textEditor.utils.js.map +1 -1
- package/dist/components/templates/AppShell/hooks/usePageCover.cjs +24 -0
- package/dist/components/templates/AppShell/hooks/usePageCover.cjs.map +1 -0
- package/dist/components/templates/AppShell/hooks/usePageCover.d.ts +14 -0
- package/dist/components/templates/AppShell/hooks/usePageCover.d.ts.map +1 -0
- package/dist/components/templates/AppShell/hooks/usePageCover.js +22 -0
- package/dist/components/templates/AppShell/hooks/usePageCover.js.map +1 -0
- package/dist/components/templates/AppShell/index.cjs +13 -7
- package/dist/components/templates/AppShell/index.cjs.map +1 -1
- package/dist/components/templates/AppShell/index.d.ts +8 -7
- package/dist/components/templates/AppShell/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.js +13 -7
- package/dist/components/templates/AppShell/index.js.map +1 -1
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs +24 -0
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs.map +1 -0
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.d.ts +22 -0
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.d.ts.map +1 -0
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.js +22 -0
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.js.map +1 -0
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.cjs +54 -0
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.cjs.map +1 -0
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.d.ts +11 -0
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.d.ts.map +1 -0
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.js +52 -0
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.js.map +1 -0
- package/dist/hooks/usePlatform/index.cjs +22 -0
- package/dist/hooks/usePlatform/index.cjs.map +1 -0
- package/dist/hooks/usePlatform/index.d.ts +22 -0
- package/dist/hooks/usePlatform/index.d.ts.map +1 -0
- package/dist/hooks/usePlatform/index.js +20 -0
- package/dist/hooks/usePlatform/index.js.map +1 -0
- package/dist/hooks/useSidePanel/index.cjs +61 -0
- package/dist/hooks/useSidePanel/index.cjs.map +1 -0
- package/dist/hooks/useSidePanel/index.d.ts +31 -0
- package/dist/hooks/useSidePanel/index.d.ts.map +1 -0
- package/dist/hooks/useSidePanel/index.js +59 -0
- package/dist/hooks/useSidePanel/index.js.map +1 -0
- package/dist/native/components/organisms/SidePanel/index.d.ts +12 -0
- package/dist/native/hooks/usePlatform/index.d.ts +12 -0
- package/dist/native/hooks/useSidePanel/index.d.ts +12 -0
- package/dist/utilities/__internal__/focusUtils/focus.utils.cjs +12 -0
- package/dist/utilities/__internal__/focusUtils/focus.utils.cjs.map +1 -0
- package/dist/utilities/__internal__/focusUtils/focus.utils.d.ts +3 -0
- package/dist/utilities/__internal__/focusUtils/focus.utils.d.ts.map +1 -0
- package/dist/utilities/__internal__/focusUtils/focus.utils.js +10 -0
- package/dist/utilities/__internal__/focusUtils/focus.utils.js.map +1 -0
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs +222 -15
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.d.ts +60 -5
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.js +215 -15
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.js.map +1 -1
- package/dist/utilities/__internal__/platformUtils/platform.utils.cjs +26 -0
- package/dist/utilities/__internal__/platformUtils/platform.utils.cjs.map +1 -0
- package/dist/utilities/__internal__/platformUtils/platform.utils.d.ts +10 -0
- package/dist/utilities/__internal__/platformUtils/platform.utils.d.ts.map +1 -0
- package/dist/utilities/__internal__/platformUtils/platform.utils.js +23 -0
- package/dist/utilities/__internal__/platformUtils/platform.utils.js.map +1 -0
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs +3 -0
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts +2 -0
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js +3 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js.map +1 -1
- package/dist/utilities/localStorageUtils/index.cjs +7 -0
- package/dist/utilities/localStorageUtils/index.cjs.map +1 -1
- package/dist/utilities/localStorageUtils/index.d.ts +2 -0
- package/dist/utilities/localStorageUtils/index.d.ts.map +1 -1
- package/dist/utilities/localStorageUtils/index.js +8 -2
- package/dist/utilities/localStorageUtils/index.js.map +1 -1
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs +2 -0
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs.map +1 -1
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts +2 -0
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts.map +1 -1
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.js +2 -0
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,9 +6,11 @@ import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
|
6
6
|
import { useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
7
7
|
import { createContext, useContext } from 'react';
|
|
8
8
|
import { Group, DateInput, DateSegment } from 'react-aria-components';
|
|
9
|
+
import { useHotkeyHint } from '../../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.js';
|
|
9
10
|
|
|
10
11
|
const DateFieldContext = createContext({});
|
|
11
12
|
const InputDateBase = ({ tooltip, shortcut, groupRef, size = 'md', isInvalid, isDisabled, icon: Icon, wrapperClassName, tooltipClassName, iconClassName, ...inputProps }) => {
|
|
13
|
+
const shortcutLabel = useHotkeyHint(shortcut === true ? 'mod+k' : shortcut || null);
|
|
12
14
|
// Check if the input has a leading icon or tooltip
|
|
13
15
|
const hasTrailingIcon = tooltip || isInvalid;
|
|
14
16
|
const hasLeadingIcon = Icon;
|
|
@@ -48,7 +50,7 @@ const InputDateBase = ({ tooltip, shortcut, groupRef, size = 'md', isInvalid, is
|
|
|
48
50
|
// The placeholder segment.
|
|
49
51
|
segment.isPlaceholder && 'text-placeholder uppercase',
|
|
50
52
|
// The separator "/" segment.
|
|
51
|
-
segment.type === 'literal' && 'text-fg-quaternary') })) }), tooltip && (jsx(Tooltip, { title: tooltip, placement: "top", children: jsx(TooltipTrigger, { className: cx('absolute cursor-pointer text-fg-quaternary transition duration-200 group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsx(HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), jsx(InfoCircle, { className: cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) }), shortcut && (jsx("div", { className: cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 flex items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8', sizes[inputSize].shortcut), children: jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children:
|
|
53
|
+
segment.type === 'literal' && 'text-fg-quaternary') })) }), tooltip && (jsx(Tooltip, { title: tooltip, placement: "top", children: jsx(TooltipTrigger, { className: cx('absolute cursor-pointer text-fg-quaternary transition duration-200 group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsx(HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), jsx(InfoCircle, { className: cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) }), shortcut && (jsx("div", { className: cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 flex items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8', sizes[inputSize].shortcut), children: jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: shortcutLabel }) }))] }));
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
export { InputDateBase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-date.js","sources":["../../../../../src/components/organisms/DatePicker/components/input-date.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaGroup","_jsx","AriaDateInput","AriaDateSegment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"input-date.js","sources":["../../../../../src/components/organisms/DatePicker/components/input-date.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaGroup","_jsx","AriaDateInput","AriaDateSegment"],"mappings":";;;;;;;;;;AAmBA,MAAM,gBAAgB,GAAG,aAAa,CAMnC,EAAE,CAAC;AAgCC,MAAM,aAAa,GAAG,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,SAAS,EACT,UAAU,EACV,IAAI,EAAE,IAAI,EACV,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,GAAG,UAAU,EAC8B,KAAI;AAC/C,IAAA,MAAM,aAAa,GAAG,aAAa,CAAC,QAAQ,KAAK,IAAI,GAAG,OAAO,GAAG,QAAQ,IAAI,IAAI,CAAC;;AAEnF,IAAA,MAAM,eAAe,GAAG,OAAO,IAAI,SAAS;IAC5C,MAAM,cAAc,GAAG,IAAI;;AAG3B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC;AAE5C,IAAA,MAAM,SAAS,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;AAEvC,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAChC,IAAA,MAAM,IAAI,GAAG,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,GAAG,UAAU,CAAC,IAAI,GAAG,SAAS;IAC9E,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,CAAA,MAAA,EAAS,IAAI,CAAA,CAAE,GAAG,OA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AC,CAAC,QAAQ,CAC1B,EAAA,QAAA,EAEDA,6BACc,MAAM,EAClB,SAAS,EAAC,yHAAyH,EAAA,QAAA,EAElI,aAAa,EAAA,CACT,EAAA,CACH,CACP,CAAA,EAAA,CACS;AAEhB;;;;"}
|
|
@@ -11,6 +11,7 @@ var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
|
11
11
|
var focus = require('@react-aria/focus');
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var reactAriaComponents = require('react-aria-components');
|
|
14
|
+
var useHotkeyHint = require('../../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs');
|
|
14
15
|
var log_utils = require('../../../../utilities/__internal__/logUtils/log.utils.cjs');
|
|
15
16
|
|
|
16
17
|
const NavAccountMenu = ({ className, selectedAccountId, accounts = [], menuItems = [], bottomMenuItems = [], testIdPrefix, ...dialogProps }) => {
|
|
@@ -43,9 +44,10 @@ const NavAccountMenu = ({ className, selectedAccountId, accounts = [], menuItems
|
|
|
43
44
|
jsxRuntime.jsxs("button", { className: cx.cx('relative w-full cursor-pointer rounded-md px-2 py-1.5 text-left outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover focus:z-10 focus-visible:outline-2 focus-visible:outline-offset-2', account.id === selectedAccountId && 'bg-primary_hover'), children: [jsxRuntime.jsx(Avatar.AvatarLabelGroup, { status: account.status, size: "md", src: account.avatar, title: account.name, subtitle: account.email }), jsxRuntime.jsx(RadioButton.RadioButtonBase, { isSelected: account.id === selectedAccountId, className: "absolute top-2 right-2" })] }, account.id))) })] }), jsxRuntime.jsx("div", { className: "flex flex-col gap-2 px-2 pt-0.5 pb-2", children: jsxRuntime.jsx(Button.Button, { iconLeading: uiIcons.Plus, color: "secondary", size: "sm", children: "Add account" }) })] }), bottomMenuItems.length > 0 && (jsxRuntime.jsx("div", { className: "pt-1 pb-1.5", children: bottomMenuItems.map((item) => (jsxRuntime.jsx(NavAccountCardMenuItem, { label: item.label, icon: item.icon, shortcut: item.shortcut, onClick: item.onClick, "data-testid": menuItemTestId(item) }, item.label))) }))] }));
|
|
44
45
|
};
|
|
45
46
|
const NavAccountCardMenuItem = ({ icon: Icon, label, shortcut, ...buttonProps }) => {
|
|
47
|
+
const shortcutLabel = useHotkeyHint.useHotkeyHint(shortcut);
|
|
46
48
|
return (jsxRuntime.jsx("button", { ...buttonProps, className: cx.cx('group/item w-full cursor-pointer px-1.5 focus:outline-hidden', buttonProps.className), children: jsxRuntime.jsxs("div", { className: cx.cx('flex w-full items-center justify-between gap-3 rounded-md p-2 group-hover/item:bg-primary_hover',
|
|
47
49
|
// Focus styles.
|
|
48
|
-
'outline-focus-ring group-focus-visible/item:outline-2 group-focus-visible/item:outline-offset-2'), children: [jsxRuntime.jsxs("div", { className: "flex gap-2 text-sm font-semibold text-secondary group-hover/item:text-secondary_hover", children: [Icon && jsxRuntime.jsx(Icon, { className: "size-5 text-fg-quaternary group-hover/item:text-fg-quaternary_hover" }), " ", label] }),
|
|
50
|
+
'outline-focus-ring group-focus-visible/item:outline-2 group-focus-visible/item:outline-offset-2'), children: [jsxRuntime.jsxs("div", { className: "flex gap-2 text-sm font-semibold text-secondary group-hover/item:text-secondary_hover", children: [Icon && jsxRuntime.jsx(Icon, { className: "size-5 text-fg-quaternary group-hover/item:text-fg-quaternary_hover" }), " ", label] }), shortcutLabel && (jsxRuntime.jsx("kbd", { className: "flex rounded px-1 py-px font-body text-xs font-medium text-tertiary ring-1 ring-secondary ring-inset", children: shortcutLabel }))] }) }));
|
|
49
51
|
};
|
|
50
52
|
const NavAccountCard = ({ popoverPlacement, selectedAccountId, items, avatarRounded, menuItems, bottomMenuItems, 'data-testid': dataTestId, }) => {
|
|
51
53
|
const triggerRef = React.useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-account-card.cjs","sources":["../../../../../src/components/organisms/HeaderNavigation/components/nav-account-card.tsx"],"sourcesContent":[null],"names":["joinTestId","slugifyTestId","useFocusManager","useRef","useCallback","useEffect","_jsxs","AriaDialog","cx","_jsx","AvatarLabelGroup","RadioButtonBase","Button","Plus","useBreakpoints","useResolvedTestId","warnOnce","AriaDialogTrigger","AriaButton","ChevronSelectorVertical","AriaPopover"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nav-account-card.cjs","sources":["../../../../../src/components/organisms/HeaderNavigation/components/nav-account-card.tsx"],"sourcesContent":[null],"names":["joinTestId","slugifyTestId","useFocusManager","useRef","useCallback","useEffect","_jsxs","AriaDialog","cx","_jsx","AvatarLabelGroup","RadioButtonBase","Button","Plus","useHotkeyHint","useBreakpoints","useResolvedTestId","warnOnce","AriaDialogTrigger","AriaButton","ChevronSelectorVertical","AriaPopover"],"mappings":";;;;;;;;;;;;;;;;AA6CO,MAAM,cAAc,GAAG,CAAC,EAC7B,SAAS,EACT,iBAAiB,EACjB,QAAQ,GAAG,EAAE,EACb,SAAS,GAAG,EAAE,EACd,eAAe,GAAG,EAAE,EACpB,YAAY,EACZ,GAAG,WAAW,EAYf,KAAI;AACH,IAAA,MAAM,cAAc,GAAG,CAAC,IAA4B,KAClD,IAAI,CAAC,aAAa,CAAC,KAAK,YAAY,GAAGA,sBAAU,CAAC,YAAY,EAAE,aAAa,IAAI,CAAC,EAAE,IAAIC,yBAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;AAEnI,IAAA,MAAM,YAAY,GAAGC,qBAAe,EAAE;AACtC,IAAA,MAAM,SAAS,GAAGC,YAAM,CAAiB,IAAI,CAAC;AAE9C,IAAA,MAAM,SAAS,GAAGC,iBAAW,CAC3B,CAAC,CAAgB,KAAI;AACnB,QAAA,QAAQ,CAAC,CAAC,GAAG;AACX,YAAA,KAAK,WAAW;AACd,gBAAA,YAAY,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;gBACvD;AACF,YAAA,KAAK,SAAS;AACZ,gBAAA,YAAY,EAAE,aAAa,CAAC,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AAA,QAAA,EAGHC,cAAA,CAAC,cAAc,EAAA,EACb,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,KAAK,EACf,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,aAAa,EAAA,CAC3B,EAAA,CACU,CAAA,EAAA,CACI,CAAA,EAAA,CAChB;AAEV;;;;;"}
|
|
@@ -19,7 +19,7 @@ export type NavAccountMenuItemType = {
|
|
|
19
19
|
icon?: FC<{
|
|
20
20
|
className?: string;
|
|
21
21
|
}>;
|
|
22
|
-
/** Keyboard shortcut hint to display. */
|
|
22
|
+
/** Keyboard shortcut hint to display. A shortcut (`⌘S`, `mod+s`) is drawn for the user's platform; text that is not a shortcut is shown as written. */
|
|
23
23
|
shortcut?: string;
|
|
24
24
|
/** Click handler. */
|
|
25
25
|
onClick?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-account-card.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/HeaderNavigation/components/nav-account-card.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAAE,EAAkB,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,SAAS,EAAsB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"nav-account-card.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/HeaderNavigation/components/nav-account-card.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAAE,EAAkB,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,SAAS,EAAsB,MAAM,uBAAuB,CAAC;AAK3G,MAAM,MAAM,cAAc,GAAG;IAC3B,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,wBA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GAAmG;IACnG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,uCAwDA,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { useResolvedTestId, joinTestId, slugifyTestId } from '@flipdish/ui-libra
|
|
|
9
9
|
import { useFocusManager } from '@react-aria/focus';
|
|
10
10
|
import { useRef, useCallback, useEffect } from 'react';
|
|
11
11
|
import { DialogTrigger, Button, Popover, Dialog } from 'react-aria-components';
|
|
12
|
+
import { useHotkeyHint } from '../../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.js';
|
|
12
13
|
import { warnOnce } from '../../../../utilities/__internal__/logUtils/log.utils.js';
|
|
13
14
|
|
|
14
15
|
const NavAccountMenu = ({ className, selectedAccountId, accounts = [], menuItems = [], bottomMenuItems = [], testIdPrefix, ...dialogProps }) => {
|
|
@@ -41,9 +42,10 @@ const NavAccountMenu = ({ className, selectedAccountId, accounts = [], menuItems
|
|
|
41
42
|
jsxs("button", { className: cx('relative w-full cursor-pointer rounded-md px-2 py-1.5 text-left outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover focus:z-10 focus-visible:outline-2 focus-visible:outline-offset-2', account.id === selectedAccountId && 'bg-primary_hover'), children: [jsx(AvatarLabelGroup, { status: account.status, size: "md", src: account.avatar, title: account.name, subtitle: account.email }), jsx(RadioButtonBase, { isSelected: account.id === selectedAccountId, className: "absolute top-2 right-2" })] }, account.id))) })] }), jsx("div", { className: "flex flex-col gap-2 px-2 pt-0.5 pb-2", children: jsx(Button$1, { iconLeading: Plus, color: "secondary", size: "sm", children: "Add account" }) })] }), bottomMenuItems.length > 0 && (jsx("div", { className: "pt-1 pb-1.5", children: bottomMenuItems.map((item) => (jsx(NavAccountCardMenuItem, { label: item.label, icon: item.icon, shortcut: item.shortcut, onClick: item.onClick, "data-testid": menuItemTestId(item) }, item.label))) }))] }));
|
|
42
43
|
};
|
|
43
44
|
const NavAccountCardMenuItem = ({ icon: Icon, label, shortcut, ...buttonProps }) => {
|
|
45
|
+
const shortcutLabel = useHotkeyHint(shortcut);
|
|
44
46
|
return (jsx("button", { ...buttonProps, className: cx('group/item w-full cursor-pointer px-1.5 focus:outline-hidden', buttonProps.className), children: jsxs("div", { className: cx('flex w-full items-center justify-between gap-3 rounded-md p-2 group-hover/item:bg-primary_hover',
|
|
45
47
|
// Focus styles.
|
|
46
|
-
'outline-focus-ring group-focus-visible/item:outline-2 group-focus-visible/item:outline-offset-2'), children: [jsxs("div", { className: "flex gap-2 text-sm font-semibold text-secondary group-hover/item:text-secondary_hover", children: [Icon && jsx(Icon, { className: "size-5 text-fg-quaternary group-hover/item:text-fg-quaternary_hover" }), " ", label] }),
|
|
48
|
+
'outline-focus-ring group-focus-visible/item:outline-2 group-focus-visible/item:outline-offset-2'), children: [jsxs("div", { className: "flex gap-2 text-sm font-semibold text-secondary group-hover/item:text-secondary_hover", children: [Icon && jsx(Icon, { className: "size-5 text-fg-quaternary group-hover/item:text-fg-quaternary_hover" }), " ", label] }), shortcutLabel && (jsx("kbd", { className: "flex rounded px-1 py-px font-body text-xs font-medium text-tertiary ring-1 ring-secondary ring-inset", children: shortcutLabel }))] }) }));
|
|
47
49
|
};
|
|
48
50
|
const NavAccountCard = ({ popoverPlacement, selectedAccountId, items, avatarRounded, menuItems, bottomMenuItems, 'data-testid': dataTestId, }) => {
|
|
49
51
|
const triggerRef = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-account-card.js","sources":["../../../../../src/components/organisms/HeaderNavigation/components/nav-account-card.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaDialog","_jsx","Button","AriaDialogTrigger","AriaButton","AriaPopover"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nav-account-card.js","sources":["../../../../../src/components/organisms/HeaderNavigation/components/nav-account-card.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaDialog","_jsx","Button","AriaDialogTrigger","AriaButton","AriaPopover"],"mappings":";;;;;;;;;;;;;;AA6CO,MAAM,cAAc,GAAG,CAAC,E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Ae,CAAC,MAAM,EAC3B,KAAK,EAAE,eAAe,CAAC,IAAI,EAC3B,QAAQ,EAAE,eAAe,CAAC,KAAK,EAC/B,MAAM,EAAE,eAAe,CAAC,MAAM,EAC9B,OAAO,EAAE,aAAa,EAAA,CACtB,EAEFF,IAAA,CAACI,aAAiB,EAAA,EAAA,QAAA,EAAA,CAChBF,GAAA,CAACG,MAAU,EAAA,EAAA,aAAA,EACI,aAAa,EAAA,YAAA,EACf,mBAAmB,EAC9B,SAAS,EAAC,0UAA0U,EAAA,QAAA,EAEpVH,GAAA,CAAC,uBAAuB,IAAC,SAAS,EAAC,iCAAiC,EAAA,CAAG,EAAA,CAC5D,EACbA,IAACI,OAAW,EAAA,EACV,SAAS,EAAE,gBAAgB,KAAK,SAAS,GAAG,cAAc,GAAG,WAAW,CAAC,EACzE,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,EAAsB,KACvD,EAAE,CACA,uDAAuD,EACvD,UAAU;AACR,4BAAA,+JAA+J,EACjK,SAAS;AACP,4BAAA,6JAA6J,CAChK,EAAA,QAAA,EAGHJ,GAAA,CAAC,cAAc,EAAA,EACb,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,KAAK,EACf,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,aAAa,EAAA,CAC3B,EAAA,CACU,CAAA,EAAA,CACI,CAAA,EAAA,CAChB;AAEV;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
|
+
|
|
7
|
+
/** The scrolling body. It takes the height the header and footer leave. */
|
|
8
|
+
const SidePanelContent = ({ className, 'data-testid': dataTestId, ...props }) => {
|
|
9
|
+
const prefix = testIdUtils.useTestIdPrefix();
|
|
10
|
+
return (jsxRuntime.jsx("div", { ...props, "data-testid": dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'content') : undefined), className: cx.cx('flex min-h-0 w-full flex-1 flex-col gap-6 overflow-y-auto px-4 lg:px-6', className) }));
|
|
11
|
+
};
|
|
12
|
+
SidePanelContent.displayName = 'SidePanelContent';
|
|
13
|
+
|
|
14
|
+
exports.SidePanelContent = SidePanelContent;
|
|
15
|
+
//# sourceMappingURL=side-panel-content.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-content.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-content.tsx"],"sourcesContent":[null],"names":["useTestIdPrefix","_jsx","joinTestId","cx"],"mappings":";;;;;;AAWA;AACO,MAAM,gBAAgB,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB,KAAI;AAC5G,IAAA,MAAM,MAAM,GAAGA,2BAAe,EAAE;AAEhC,IAAA,QACEC,cAAA,CAAA,KAAA,EAAA,EAAA,GACM,KAAK,EAAA,aAAA,EACI,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC,EAC/E,SAAS,EAAEC,KAAE,CAAC,wEAAwE,EAAE,SAAS,CAAC,EAAA,CAClG;AAEN;AACA,gBAAgB,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type SidePanelContentProps = ComponentPropsWithRef<'div'> & {
|
|
3
|
+
/** Overrides the content's `data-testid` (defaults to `<root>--content`). */
|
|
4
|
+
'data-testid'?: string;
|
|
5
|
+
};
|
|
6
|
+
/** The scrolling body. It takes the height the header and footer leave. */
|
|
7
|
+
export declare const SidePanelContent: {
|
|
8
|
+
({ className, "data-testid": dataTestId, ...props }: SidePanelContentProps): import("react").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=side-panel-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-content.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-content.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,KAAK,CAAC,GAAG;IACjE,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB;yDAAwD,qBAAqB;;CAUzG,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
|
+
|
|
5
|
+
/** The scrolling body. It takes the height the header and footer leave. */
|
|
6
|
+
const SidePanelContent = ({ className, 'data-testid': dataTestId, ...props }) => {
|
|
7
|
+
const prefix = useTestIdPrefix();
|
|
8
|
+
return (jsx("div", { ...props, "data-testid": dataTestId ?? (prefix ? joinTestId(prefix, 'content') : undefined), className: cx('flex min-h-0 w-full flex-1 flex-col gap-6 overflow-y-auto px-4 lg:px-6', className) }));
|
|
9
|
+
};
|
|
10
|
+
SidePanelContent.displayName = 'SidePanelContent';
|
|
11
|
+
|
|
12
|
+
export { SidePanelContent };
|
|
13
|
+
//# sourceMappingURL=side-panel-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-content.js","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-content.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAWA;AACO,MAAM,gBAAgB,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB,KAAI;AAC5G,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAEhC,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,GACM,KAAK,EAAA,aAAA,EACI,UAAU,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC,EAC/E,SAAS,EAAE,EAAE,CAAC,wEAAwE,EAAE,SAAS,CAAC,EAAA,CAClG;AAEN;AACA,gBAAgB,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
|
+
|
|
7
|
+
/** Pinned actions under the content, such as a message input. */
|
|
8
|
+
const SidePanelFooter = ({ className, 'data-testid': dataTestId, ...props }) => {
|
|
9
|
+
const prefix = testIdUtils.useTestIdPrefix();
|
|
10
|
+
return (jsxRuntime.jsx("footer", { ...props, "data-testid": dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'footer') : undefined), className: cx.cx('w-full px-4 pb-4 lg:px-6 lg:pb-5', className) }));
|
|
11
|
+
};
|
|
12
|
+
SidePanelFooter.displayName = 'SidePanelFooter';
|
|
13
|
+
|
|
14
|
+
exports.SidePanelFooter = SidePanelFooter;
|
|
15
|
+
//# sourceMappingURL=side-panel-footer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-footer.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-footer.tsx"],"sourcesContent":[null],"names":["useTestIdPrefix","_jsx","joinTestId","cx"],"mappings":";;;;;;AAWA;AACO,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAwB,KAAI;AAC1G,IAAA,MAAM,MAAM,GAAGA,2BAAe,EAAE;AAEhC,IAAA,QACEC,cAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EAAA,aAAA,EACI,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAEC,KAAE,CAAC,kCAAkC,EAAE,SAAS,CAAC,EAAA,CAC5D;AAEN;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type SidePanelFooterProps = ComponentPropsWithRef<'footer'> & {
|
|
3
|
+
/** Overrides the footer's `data-testid` (defaults to `<root>--footer`). */
|
|
4
|
+
'data-testid'?: string;
|
|
5
|
+
};
|
|
6
|
+
/** Pinned actions under the content, such as a message input. */
|
|
7
|
+
export declare const SidePanelFooter: {
|
|
8
|
+
({ className, "data-testid": dataTestId, ...props }: SidePanelFooterProps): import("react").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=side-panel-footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-footer.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-footer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,GAAG;IACnE,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,eAAe;yDAAwD,oBAAoB;;CAUvG,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
|
+
|
|
5
|
+
/** Pinned actions under the content, such as a message input. */
|
|
6
|
+
const SidePanelFooter = ({ className, 'data-testid': dataTestId, ...props }) => {
|
|
7
|
+
const prefix = useTestIdPrefix();
|
|
8
|
+
return (jsx("footer", { ...props, "data-testid": dataTestId ?? (prefix ? joinTestId(prefix, 'footer') : undefined), className: cx('w-full px-4 pb-4 lg:px-6 lg:pb-5', className) }));
|
|
9
|
+
};
|
|
10
|
+
SidePanelFooter.displayName = 'SidePanelFooter';
|
|
11
|
+
|
|
12
|
+
export { SidePanelFooter };
|
|
13
|
+
//# sourceMappingURL=side-panel-footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-footer.js","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-footer.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAWA;AACO,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAwB,KAAI;AAC1G,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAEhC,IAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EAAA,aAAA,EACI,UAAU,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAE,EAAE,CAAC,kCAAkC,EAAE,SAAS,CAAC,EAAA,CAC5D;AAEN;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var CloseButton = require('@flipdish/ui-library/components/atoms/CloseButton');
|
|
5
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var sidePanelContext = require('../providers/side-panel-context.cjs');
|
|
9
|
+
|
|
10
|
+
/** Title area with a close button, which closes the panel unless `onClose` is passed. */
|
|
11
|
+
const SidePanelHeader = ({ className, children, onClose, closeLabel, 'data-testid': dataTestId, ...props }) => {
|
|
12
|
+
const panel = React.useContext(sidePanelContext.SidePanelContext);
|
|
13
|
+
const prefix = testIdUtils.useTestIdPrefix();
|
|
14
|
+
return (jsxRuntime.jsxs("header", { ...props, "data-testid": dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'header') : undefined), className: cx.cx('relative w-full px-4 pt-6 pb-8 lg:px-6', className), children: [children, jsxRuntime.jsx(CloseButton.CloseButton, { size: "md", label: closeLabel ?? (panel ? `Close ${panel.label}` : undefined), className: "absolute top-3 right-3 shrink-0", onClick: onClose ?? panel?.close, "data-testid": prefix ? testIdUtils.joinTestId(prefix, 'close') : undefined })] }));
|
|
15
|
+
};
|
|
16
|
+
SidePanelHeader.displayName = 'SidePanelHeader';
|
|
17
|
+
|
|
18
|
+
exports.SidePanelHeader = SidePanelHeader;
|
|
19
|
+
//# sourceMappingURL=side-panel-header.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-header.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-header.tsx"],"sourcesContent":[null],"names":["useContext","SidePanelContext","useTestIdPrefix","_jsxs","joinTestId","cx","_jsx","CloseButton"],"mappings":";;;;;;;;;AAkBA;MACa,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAwB,KAAI;AACzI,IAAA,MAAM,KAAK,GAAGA,gBAAU,CAACC,iCAAgB,CAAC;AAC1C,IAAA,MAAM,MAAM,GAAGC,2BAAe,EAAE;AAEhC,IAAA,QACEC,eAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,iBACI,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAEC,KAAE,CAAC,wCAAwC,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CAEjE,QAAQ,EACTC,cAAA,CAACC,uBAAW,IACV,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,UAAU,KAAK,KAAK,GAAG,SAAS,KAAK,CAAC,KAAK,CAAA,CAAE,GAAG,SAAS,CAAC,EACjE,SAAS,EAAC,iCAAiC,EAC3C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,EAAA,aAAA,EACnB,MAAM,GAAGH,sBAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAA,CAC7D,CAAA,EAAA,CACK;AAEb;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export interface SidePanelHeaderProps extends ComponentPropsWithRef<'header'> {
|
|
3
|
+
/** Runs instead of closing the panel when the close button is pressed. */
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
/** Accessible name of the close button. Defaults to "Close" followed by the panel's `aria-label`. */
|
|
6
|
+
closeLabel?: string;
|
|
7
|
+
/** Overrides the header's `data-testid` (defaults to `<root>--header`). */
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Title area with a close button, which closes the panel unless `onClose` is passed. */
|
|
11
|
+
export declare const SidePanelHeader: {
|
|
12
|
+
({ className, children, onClose, closeLabel, "data-testid": dataTestId, ...props }: SidePanelHeaderProps): import("react").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=side-panel-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-header.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-header.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IAC3E,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qGAAqG;IACrG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yFAAyF;AACzF,eAAO,MAAM,eAAe;wFAAuF,oBAAoB;;CAoBtI,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { CloseButton } from '@flipdish/ui-library/components/atoms/CloseButton';
|
|
3
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
+
import { useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
|
+
import { useContext } from 'react';
|
|
6
|
+
import { SidePanelContext } from '../providers/side-panel-context.js';
|
|
7
|
+
|
|
8
|
+
/** Title area with a close button, which closes the panel unless `onClose` is passed. */
|
|
9
|
+
const SidePanelHeader = ({ className, children, onClose, closeLabel, 'data-testid': dataTestId, ...props }) => {
|
|
10
|
+
const panel = useContext(SidePanelContext);
|
|
11
|
+
const prefix = useTestIdPrefix();
|
|
12
|
+
return (jsxs("header", { ...props, "data-testid": dataTestId ?? (prefix ? joinTestId(prefix, 'header') : undefined), className: cx('relative w-full px-4 pt-6 pb-8 lg:px-6', className), children: [children, jsx(CloseButton, { size: "md", label: closeLabel ?? (panel ? `Close ${panel.label}` : undefined), className: "absolute top-3 right-3 shrink-0", onClick: onClose ?? panel?.close, "data-testid": prefix ? joinTestId(prefix, 'close') : undefined })] }));
|
|
13
|
+
};
|
|
14
|
+
SidePanelHeader.displayName = 'SidePanelHeader';
|
|
15
|
+
|
|
16
|
+
export { SidePanelHeader };
|
|
17
|
+
//# sourceMappingURL=side-panel-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-header.js","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-header.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAkBA;MACa,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAwB,KAAI;AACzI,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC;AAC1C,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAEhC,IAAA,QACEA,IAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,iBACI,UAAU,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAE,EAAE,CAAC,wCAAwC,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CAEjE,QAAQ,EACTC,GAAA,CAAC,WAAW,IACV,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,UAAU,KAAK,KAAK,GAAG,SAAS,KAAK,CAAC,KAAK,CAAA,CAAE,GAAG,SAAS,CAAC,EACjE,SAAS,EAAC,iCAAiC,EAC3C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,EAAA,aAAA,EACnB,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAA,CAC7D,CAAA,EAAA,CACK;AAEb;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var react = require('motion/react');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var usePanelFocus = require('../hooks/usePanelFocus.cjs');
|
|
8
|
+
|
|
9
|
+
/** Width of the panel from `lg` in pixels. Matches `w-100`. Below `lg` the panel is as wide as the page. */
|
|
10
|
+
const SIDE_PANEL_WIDTH = 400;
|
|
11
|
+
const SPRING = { type: 'spring', damping: 26, stiffness: 220, bounce: 0 };
|
|
12
|
+
const DOCKED = {
|
|
13
|
+
closed: { width: 0, x: 0 },
|
|
14
|
+
open: { width: SIDE_PANEL_WIDTH, x: 0 },
|
|
15
|
+
};
|
|
16
|
+
const FULL_PAGE = {
|
|
17
|
+
closed: { width: '100%', x: '100%' },
|
|
18
|
+
open: { width: '100%', x: 0 },
|
|
19
|
+
};
|
|
20
|
+
/** The rendered region. A component of its own so it can tell, while animating out, that it is leaving. */
|
|
21
|
+
const SidePanelRegion = ({ 'aria-label': ariaLabel, children, className, testId, isDesktop, shouldFocusOnMount }) => {
|
|
22
|
+
const panelRef = React.useRef(null);
|
|
23
|
+
const isPresent = react.useIsPresent();
|
|
24
|
+
const shouldReduceMotion = react.useReducedMotion();
|
|
25
|
+
const { onFocusCapture } = usePanelFocus.usePanelFocus({ panelRef, isPresent, isDesktop, shouldFocusOnMount });
|
|
26
|
+
// Crossing the breakpoint while open swaps the layout at once; only opening and closing animate.
|
|
27
|
+
const previousIsDesktop = React.useRef(isDesktop);
|
|
28
|
+
const hasCrossedBreakpoint = previousIsDesktop.current !== isDesktop;
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
previousIsDesktop.current = isDesktop;
|
|
31
|
+
}, [isDesktop]);
|
|
32
|
+
const motionStates = isDesktop ? DOCKED : FULL_PAGE;
|
|
33
|
+
return (jsxRuntime.jsx(react.motion.aside, { ref: panelRef, "aria-label": ariaLabel, "data-testid": testId,
|
|
34
|
+
// Focusable by script only, so opening can land on the region without adding a tab stop.
|
|
35
|
+
tabIndex: -1, onFocusCapture: onFocusCapture, initial: motionStates.closed, animate: motionStates.open, exit: motionStates.closed, transition: shouldReduceMotion || hasCrossedBreakpoint ? { duration: 0 } : SPRING,
|
|
36
|
+
// overflow-hidden clips the fixed-width content while the panel's own width animates.
|
|
37
|
+
className: cx.cx('flex h-full min-h-0 shrink-0 overflow-hidden bg-secondary outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2', !isDesktop && 'absolute inset-y-0 right-0 z-10', className), children: jsxRuntime.jsx("div", { className: cx.cx('flex h-full shrink-0 flex-col', isDesktop ? 'w-100 border-l border-secondary' : 'w-full'), children: children }) }));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.SIDE_PANEL_WIDTH = SIDE_PANEL_WIDTH;
|
|
41
|
+
exports.SidePanelRegion = SidePanelRegion;
|
|
42
|
+
//# sourceMappingURL=side-panel-region.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-region.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-region.tsx"],"sourcesContent":[null],"names":["useRef","useIsPresent","useReducedMotion","usePanelFocus","useEffect","_jsx","motion","cx"],"mappings":";;;;;;;;AAQA;AACO,MAAM,gBAAgB,GAAG;AAEhC,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAW;AAElF,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC1B,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC,EAAE;CAC/B;AAEV,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EA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AAsI,EACtI,CAAC,SAAS,IAAI,iCAAiC,EAC/C,SAAS,CACV,EAAA,QAAA,EAGDF,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEE,KAAE,CAAC,+BAA+B,EAAE,SAAS,GAAG,iCAAiC,GAAG,QAAQ,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,EAAA,CAClH;AAEnB;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Width of the panel from `lg` in pixels. Matches `w-100`. Below `lg` the panel is as wide as the page. */
|
|
3
|
+
export declare const SIDE_PANEL_WIDTH = 400;
|
|
4
|
+
interface SidePanelRegionProps {
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
testId: string;
|
|
9
|
+
isDesktop: boolean;
|
|
10
|
+
shouldFocusOnMount: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** The rendered region. A component of its own so it can tell, while animating out, that it is leaving. */
|
|
13
|
+
export declare const SidePanelRegion: ({ "aria-label": ariaLabel, children, className, testId, isDesktop, shouldFocusOnMount }: SidePanelRegionProps) => import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=side-panel-region.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-region.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-region.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,4GAA4G;AAC5G,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAcpC,UAAU,oBAAoB;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,2GAA2G;AAC3G,eAAO,MAAM,eAAe,GAAI,yFAAyF,oBAAoB,gCAsC5I,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useIsPresent, useReducedMotion, motion } from 'motion/react';
|
|
4
|
+
import { useRef, useEffect } from 'react';
|
|
5
|
+
import { usePanelFocus } from '../hooks/usePanelFocus.js';
|
|
6
|
+
|
|
7
|
+
/** Width of the panel from `lg` in pixels. Matches `w-100`. Below `lg` the panel is as wide as the page. */
|
|
8
|
+
const SIDE_PANEL_WIDTH = 400;
|
|
9
|
+
const SPRING = { type: 'spring', damping: 26, stiffness: 220, bounce: 0 };
|
|
10
|
+
const DOCKED = {
|
|
11
|
+
closed: { width: 0, x: 0 },
|
|
12
|
+
open: { width: SIDE_PANEL_WIDTH, x: 0 },
|
|
13
|
+
};
|
|
14
|
+
const FULL_PAGE = {
|
|
15
|
+
closed: { width: '100%', x: '100%' },
|
|
16
|
+
open: { width: '100%', x: 0 },
|
|
17
|
+
};
|
|
18
|
+
/** The rendered region. A component of its own so it can tell, while animating out, that it is leaving. */
|
|
19
|
+
const SidePanelRegion = ({ 'aria-label': ariaLabel, children, className, testId, isDesktop, shouldFocusOnMount }) => {
|
|
20
|
+
const panelRef = useRef(null);
|
|
21
|
+
const isPresent = useIsPresent();
|
|
22
|
+
const shouldReduceMotion = useReducedMotion();
|
|
23
|
+
const { onFocusCapture } = usePanelFocus({ panelRef, isPresent, isDesktop, shouldFocusOnMount });
|
|
24
|
+
// Crossing the breakpoint while open swaps the layout at once; only opening and closing animate.
|
|
25
|
+
const previousIsDesktop = useRef(isDesktop);
|
|
26
|
+
const hasCrossedBreakpoint = previousIsDesktop.current !== isDesktop;
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
previousIsDesktop.current = isDesktop;
|
|
29
|
+
}, [isDesktop]);
|
|
30
|
+
const motionStates = isDesktop ? DOCKED : FULL_PAGE;
|
|
31
|
+
return (jsx(motion.aside, { ref: panelRef, "aria-label": ariaLabel, "data-testid": testId,
|
|
32
|
+
// Focusable by script only, so opening can land on the region without adding a tab stop.
|
|
33
|
+
tabIndex: -1, onFocusCapture: onFocusCapture, initial: motionStates.closed, animate: motionStates.open, exit: motionStates.closed, transition: shouldReduceMotion || hasCrossedBreakpoint ? { duration: 0 } : SPRING,
|
|
34
|
+
// overflow-hidden clips the fixed-width content while the panel's own width animates.
|
|
35
|
+
className: cx('flex h-full min-h-0 shrink-0 overflow-hidden bg-secondary outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2', !isDesktop && 'absolute inset-y-0 right-0 z-10', className), children: jsx("div", { className: cx('flex h-full shrink-0 flex-col', isDesktop ? 'w-100 border-l border-secondary' : 'w-full'), children: children }) }));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { SIDE_PANEL_WIDTH, SidePanelRegion };
|
|
39
|
+
//# sourceMappingURL=side-panel-region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-region.js","sources":["../../../../../src/components/organisms/SidePanel/components/side-panel-region.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;AAQA;AACO,MAAM,gBAAgB,GAAG;AAEhC,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAW;AAElF,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC1B,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC,EAAE;CAC/B;AAEV,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,E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I,CAAC,SAAS,IAAI,iCAAiC,EAC/C,SAAS,CACV,EAAA,QAAA,EAGDA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,GAAG,iCAAiC,GAAG,QAAQ,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,EAAA,CAClH;AAEnB;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
const subscribeToNothing = () => () => { };
|
|
6
|
+
/**
|
|
7
|
+
* Tells the panel whether opening should move focus into it. A panel that is already open when the
|
|
8
|
+
* page loads must not pull focus away from the page, and "when the page loads" means the first render
|
|
9
|
+
* that knows the viewport: on the server and while hydrating nothing renders, so state restored right
|
|
10
|
+
* after hydration still counts as open on load.
|
|
11
|
+
*
|
|
12
|
+
* @returns whether the viewport is known yet, and whether an opening panel should take focus
|
|
13
|
+
*/
|
|
14
|
+
const useOpenOnMount = (isOpen) => {
|
|
15
|
+
// False on the server and while hydrating, where the viewport is unknown. True at once in a client-only app.
|
|
16
|
+
const canMeasureViewport = React.useSyncExternalStore(subscribeToNothing, () => true, () => false);
|
|
17
|
+
const wasOpenOnMount = React.useRef(null);
|
|
18
|
+
if (canMeasureViewport && wasOpenOnMount.current === null)
|
|
19
|
+
wasOpenOnMount.current = isOpen;
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
// Once it has been closed, the next open is the user's doing and takes focus.
|
|
22
|
+
if (canMeasureViewport && !isOpen)
|
|
23
|
+
wasOpenOnMount.current = false;
|
|
24
|
+
}, [canMeasureViewport, isOpen]);
|
|
25
|
+
return { canMeasureViewport, shouldFocusOnMount: !wasOpenOnMount.current };
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.useOpenOnMount = useOpenOnMount;
|
|
29
|
+
//# sourceMappingURL=useOpenOnMount.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOpenOnMount.cjs","sources":["../../../../../src/components/organisms/SidePanel/hooks/useOpenOnMount.ts"],"sourcesContent":[null],"names":["useSyncExternalStore","useRef","useEffect"],"mappings":";;;;AAIA,MAAM,kBAAkB,GAAG,MAAM,MAAK,EAAE,CAAC;AAEzC;;;;;;;AAOG;AACI,MAAM,cAAc,GAAG,CAAC,MAAe,KAAI;;AAEhD,IAAA,MAAM,kBAAkB,GAAGA,0BAAoB,CAC7C,kBAAkB,EAClB,MAAM,IAAI,EACV,MAAM,KAAK,CACZ;AAED,IAAA,MAAM,cAAc,GAAGC,YAAM,CAAiB,IAAI,CAAC;AACnD,IAAA,IAAI,kBAAkB,IAAI,cAAc,CAAC,OAAO,KAAK,IAAI;AAAE,QAAA,cAAc,CAAC,OAAO,GAAG,MAAM;IAC1FC,eAAS,CAAC,MAAK;;QAEb,IAAI,kBAAkB,IAAI,CAAC,MAAM;AAAE,YAAA,cAAc,CAAC,OAAO,GAAG,KAAK;AACnE,IAAA,CAAC,EAAE,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;IAEhC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE;AAC5E;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tells the panel whether opening should move focus into it. A panel that is already open when the
|
|
3
|
+
* page loads must not pull focus away from the page, and "when the page loads" means the first render
|
|
4
|
+
* that knows the viewport: on the server and while hydrating nothing renders, so state restored right
|
|
5
|
+
* after hydration still counts as open on load.
|
|
6
|
+
*
|
|
7
|
+
* @returns whether the viewport is known yet, and whether an opening panel should take focus
|
|
8
|
+
*/
|
|
9
|
+
export declare const useOpenOnMount: (isOpen: boolean) => {
|
|
10
|
+
canMeasureViewport: boolean;
|
|
11
|
+
shouldFocusOnMount: boolean;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useOpenOnMount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOpenOnMount.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/hooks/useOpenOnMount.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,OAAO;;;CAgB7C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useSyncExternalStore, useRef, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const subscribeToNothing = () => () => { };
|
|
4
|
+
/**
|
|
5
|
+
* Tells the panel whether opening should move focus into it. A panel that is already open when the
|
|
6
|
+
* page loads must not pull focus away from the page, and "when the page loads" means the first render
|
|
7
|
+
* that knows the viewport: on the server and while hydrating nothing renders, so state restored right
|
|
8
|
+
* after hydration still counts as open on load.
|
|
9
|
+
*
|
|
10
|
+
* @returns whether the viewport is known yet, and whether an opening panel should take focus
|
|
11
|
+
*/
|
|
12
|
+
const useOpenOnMount = (isOpen) => {
|
|
13
|
+
// False on the server and while hydrating, where the viewport is unknown. True at once in a client-only app.
|
|
14
|
+
const canMeasureViewport = useSyncExternalStore(subscribeToNothing, () => true, () => false);
|
|
15
|
+
const wasOpenOnMount = useRef(null);
|
|
16
|
+
if (canMeasureViewport && wasOpenOnMount.current === null)
|
|
17
|
+
wasOpenOnMount.current = isOpen;
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
// Once it has been closed, the next open is the user's doing and takes focus.
|
|
20
|
+
if (canMeasureViewport && !isOpen)
|
|
21
|
+
wasOpenOnMount.current = false;
|
|
22
|
+
}, [canMeasureViewport, isOpen]);
|
|
23
|
+
return { canMeasureViewport, shouldFocusOnMount: !wasOpenOnMount.current };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { useOpenOnMount };
|
|
27
|
+
//# sourceMappingURL=useOpenOnMount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOpenOnMount.js","sources":["../../../../../src/components/organisms/SidePanel/hooks/useOpenOnMount.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA,MAAM,kBAAkB,GAAG,MAAM,MAAK,EAAE,CAAC;AAEzC;;;;;;;AAOG;AACI,MAAM,cAAc,GAAG,CAAC,MAAe,KAAI;;AAEhD,IAAA,MAAM,kBAAkB,GAAG,oBAAoB,CAC7C,kBAAkB,EAClB,MAAM,IAAI,EACV,MAAM,KAAK,CACZ;AAED,IAAA,MAAM,cAAc,GAAG,MAAM,CAAiB,IAAI,CAAC;AACnD,IAAA,IAAI,kBAAkB,IAAI,cAAc,CAAC,OAAO,KAAK,IAAI;AAAE,QAAA,cAAc,CAAC,OAAO,GAAG,MAAM;IAC1F,SAAS,CAAC,MAAK;;QAEb,IAAI,kBAAkB,IAAI,CAAC,MAAM;AAAE,YAAA,cAAc,CAAC,OAAO,GAAG,KAAK;AACnE,IAAA,CAAC,EAAE,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;IAEhC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE;AAC5E;;;;"}
|