@flipdish/ui-library 0.28.0 → 0.30.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.
Files changed (138) hide show
  1. package/dist/components/atoms/Input/index.cjs +3 -1
  2. package/dist/components/atoms/Input/index.cjs.map +1 -1
  3. package/dist/components/atoms/Input/index.d.ts +5 -1
  4. package/dist/components/atoms/Input/index.d.ts.map +1 -1
  5. package/dist/components/atoms/Input/index.js +3 -1
  6. package/dist/components/atoms/Input/index.js.map +1 -1
  7. package/dist/components/molecules/Select/components/combobox.cjs +3 -1
  8. package/dist/components/molecules/Select/components/combobox.cjs.map +1 -1
  9. package/dist/components/molecules/Select/components/combobox.d.ts.map +1 -1
  10. package/dist/components/molecules/Select/components/combobox.js +3 -1
  11. package/dist/components/molecules/Select/components/combobox.js.map +1 -1
  12. package/dist/components/organisms/ApplicationHeader/applicationHeader.types.d.ts +12 -5
  13. package/dist/components/organisms/ApplicationHeader/applicationHeader.types.d.ts.map +1 -1
  14. package/dist/components/organisms/ApplicationHeader/index.cjs +12 -17
  15. package/dist/components/organisms/ApplicationHeader/index.cjs.map +1 -1
  16. package/dist/components/organisms/ApplicationHeader/index.d.ts +9 -5
  17. package/dist/components/organisms/ApplicationHeader/index.d.ts.map +1 -1
  18. package/dist/components/organisms/ApplicationHeader/index.js +12 -18
  19. package/dist/components/organisms/ApplicationHeader/index.js.map +1 -1
  20. package/dist/components/organisms/Calendar/index.cjs +3 -3
  21. package/dist/components/organisms/Calendar/index.cjs.map +1 -1
  22. package/dist/components/organisms/Calendar/index.js +3 -3
  23. package/dist/components/organisms/Calendar/index.js.map +1 -1
  24. package/dist/components/organisms/CommandMenu/commandMenu.utils.cjs +0 -21
  25. package/dist/components/organisms/CommandMenu/commandMenu.utils.cjs.map +1 -1
  26. package/dist/components/organisms/CommandMenu/commandMenu.utils.d.ts +0 -9
  27. package/dist/components/organisms/CommandMenu/commandMenu.utils.d.ts.map +1 -1
  28. package/dist/components/organisms/CommandMenu/commandMenu.utils.js +1 -21
  29. package/dist/components/organisms/CommandMenu/commandMenu.utils.js.map +1 -1
  30. package/dist/components/organisms/CommandMenu/components/command-input.cjs +2 -2
  31. package/dist/components/organisms/CommandMenu/components/command-input.cjs.map +1 -1
  32. package/dist/components/organisms/CommandMenu/components/command-input.d.ts +3 -2
  33. package/dist/components/organisms/CommandMenu/components/command-input.d.ts.map +1 -1
  34. package/dist/components/organisms/CommandMenu/components/command-input.js +2 -2
  35. package/dist/components/organisms/CommandMenu/components/command-input.js.map +1 -1
  36. package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs +15 -2
  37. package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs.map +1 -1
  38. package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts +9 -1
  39. package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts.map +1 -1
  40. package/dist/components/organisms/CommandMenu/components/command-menu-item.js +15 -2
  41. package/dist/components/organisms/CommandMenu/components/command-menu-item.js.map +1 -1
  42. package/dist/components/organisms/CommandMenu/components/command-shortcut.cjs +2 -2
  43. package/dist/components/organisms/CommandMenu/components/command-shortcut.cjs.map +1 -1
  44. package/dist/components/organisms/CommandMenu/components/command-shortcut.d.ts +1 -0
  45. package/dist/components/organisms/CommandMenu/components/command-shortcut.d.ts.map +1 -1
  46. package/dist/components/organisms/CommandMenu/components/command-shortcut.js +2 -2
  47. package/dist/components/organisms/CommandMenu/components/command-shortcut.js.map +1 -1
  48. package/dist/components/organisms/CommandMenu/index.cjs +65 -29
  49. package/dist/components/organisms/CommandMenu/index.cjs.map +1 -1
  50. package/dist/components/organisms/CommandMenu/index.d.ts +29 -2
  51. package/dist/components/organisms/CommandMenu/index.d.ts.map +1 -1
  52. package/dist/components/organisms/CommandMenu/index.js +69 -33
  53. package/dist/components/organisms/CommandMenu/index.js.map +1 -1
  54. package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.cjs +9 -0
  55. package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.cjs.map +1 -0
  56. package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.d.ts +3 -0
  57. package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.d.ts.map +1 -0
  58. package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.js +7 -0
  59. package/dist/components/organisms/CommandMenu/providers/command-menu-link-context.js.map +1 -0
  60. package/dist/components/organisms/DatePicker/components/input-date.cjs +3 -1
  61. package/dist/components/organisms/DatePicker/components/input-date.cjs.map +1 -1
  62. package/dist/components/organisms/DatePicker/components/input-date.d.ts +5 -1
  63. package/dist/components/organisms/DatePicker/components/input-date.d.ts.map +1 -1
  64. package/dist/components/organisms/DatePicker/components/input-date.js +3 -1
  65. package/dist/components/organisms/DatePicker/components/input-date.js.map +1 -1
  66. package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs +3 -1
  67. package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs.map +1 -1
  68. package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts +1 -1
  69. package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts.map +1 -1
  70. package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js +3 -1
  71. package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js.map +1 -1
  72. package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs +3 -1
  73. package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs.map +1 -1
  74. package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts +1 -1
  75. package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts.map +1 -1
  76. package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js +3 -1
  77. package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js.map +1 -1
  78. package/dist/components/organisms/SidebarNavigation/index.cjs +15 -5
  79. package/dist/components/organisms/SidebarNavigation/index.cjs.map +1 -1
  80. package/dist/components/organisms/SidebarNavigation/index.d.ts +3 -2
  81. package/dist/components/organisms/SidebarNavigation/index.d.ts.map +1 -1
  82. package/dist/components/organisms/SidebarNavigation/index.js +15 -5
  83. package/dist/components/organisms/SidebarNavigation/index.js.map +1 -1
  84. package/dist/components/organisms/TextEditor/components/text-editor-extensions.cjs +9 -4
  85. package/dist/components/organisms/TextEditor/components/text-editor-extensions.cjs.map +1 -1
  86. package/dist/components/organisms/TextEditor/components/text-editor-extensions.d.ts.map +1 -1
  87. package/dist/components/organisms/TextEditor/components/text-editor-extensions.js +10 -5
  88. package/dist/components/organisms/TextEditor/components/text-editor-extensions.js.map +1 -1
  89. package/dist/components/organisms/TextEditor/components/text-editor-toolbar.cjs +8 -2
  90. package/dist/components/organisms/TextEditor/components/text-editor-toolbar.cjs.map +1 -1
  91. package/dist/components/organisms/TextEditor/components/text-editor-toolbar.d.ts.map +1 -1
  92. package/dist/components/organisms/TextEditor/components/text-editor-toolbar.js +8 -2
  93. package/dist/components/organisms/TextEditor/components/text-editor-toolbar.js.map +1 -1
  94. package/dist/components/organisms/TextEditor/textEditor.utils.cjs +3 -0
  95. package/dist/components/organisms/TextEditor/textEditor.utils.cjs.map +1 -1
  96. package/dist/components/organisms/TextEditor/textEditor.utils.d.ts +4 -0
  97. package/dist/components/organisms/TextEditor/textEditor.utils.d.ts.map +1 -1
  98. package/dist/components/organisms/TextEditor/textEditor.utils.js +3 -1
  99. package/dist/components/organisms/TextEditor/textEditor.utils.js.map +1 -1
  100. package/dist/components/templates/AppShell/index.cjs +28 -0
  101. package/dist/components/templates/AppShell/index.cjs.map +1 -0
  102. package/dist/components/templates/AppShell/index.d.ts +40 -0
  103. package/dist/components/templates/AppShell/index.d.ts.map +1 -0
  104. package/dist/components/templates/AppShell/index.js +26 -0
  105. package/dist/components/templates/AppShell/index.js.map +1 -0
  106. package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs +24 -0
  107. package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs.map +1 -0
  108. package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.d.ts +22 -0
  109. package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.d.ts.map +1 -0
  110. package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.js +22 -0
  111. package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.js.map +1 -0
  112. package/dist/hooks/__internal__/useKeySequences/useKeySequences.cjs +54 -0
  113. package/dist/hooks/__internal__/useKeySequences/useKeySequences.cjs.map +1 -0
  114. package/dist/hooks/__internal__/useKeySequences/useKeySequences.d.ts +11 -0
  115. package/dist/hooks/__internal__/useKeySequences/useKeySequences.d.ts.map +1 -0
  116. package/dist/hooks/__internal__/useKeySequences/useKeySequences.js +52 -0
  117. package/dist/hooks/__internal__/useKeySequences/useKeySequences.js.map +1 -0
  118. package/dist/hooks/usePlatform/index.cjs +22 -0
  119. package/dist/hooks/usePlatform/index.cjs.map +1 -0
  120. package/dist/hooks/usePlatform/index.d.ts +22 -0
  121. package/dist/hooks/usePlatform/index.d.ts.map +1 -0
  122. package/dist/hooks/usePlatform/index.js +20 -0
  123. package/dist/hooks/usePlatform/index.js.map +1 -0
  124. package/dist/native/components/templates/AppShell/index.d.ts +12 -0
  125. package/dist/native/hooks/usePlatform/index.d.ts +12 -0
  126. package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs +222 -15
  127. package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs.map +1 -1
  128. package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.d.ts +60 -5
  129. package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.d.ts.map +1 -1
  130. package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.js +215 -15
  131. package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.js.map +1 -1
  132. package/dist/utilities/__internal__/platformUtils/platform.utils.cjs +26 -0
  133. package/dist/utilities/__internal__/platformUtils/platform.utils.cjs.map +1 -0
  134. package/dist/utilities/__internal__/platformUtils/platform.utils.d.ts +10 -0
  135. package/dist/utilities/__internal__/platformUtils/platform.utils.d.ts.map +1 -0
  136. package/dist/utilities/__internal__/platformUtils/platform.utils.js +23 -0
  137. package/dist/utilities/__internal__/platformUtils/platform.utils.js.map +1 -0
  138. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ import type { ReactNode, Ref } from 'react';
2
+ export interface AppShellScrollAreaProps {
3
+ /** `id` for the scrolling element, e.g. for a scroll-to-top helper that looks it up. */
4
+ id?: string;
5
+ /** Ref to the scrolling element, e.g. to reset `scrollTop` on navigation or attach a scroll listener. */
6
+ ref?: Ref<HTMLDivElement>;
7
+ /** Overrides the scrolling element's `data-testid` (defaults to `<root>--scroll-area`). */
8
+ 'data-testid'?: string;
9
+ }
10
+ export interface AppShellProps {
11
+ /** Primary navigation, rendered first beside the content column. Compose `<SidebarNavigation>` here. */
12
+ sidebar?: ReactNode;
13
+ /** Top bar, rendered at the top of the content column. It stays in place while the page area scrolls. Compose `<ApplicationHeader>` here. */
14
+ header?: ReactNode;
15
+ /**
16
+ * Side panel rendered under the header, beside the page area, which narrows to make room. It fills
17
+ * the height under the header and stays in view while the page area scrolls.
18
+ */
19
+ panel?: ReactNode;
20
+ /** Page content, normally a `<PageLayout>`. Rendered inside the shell's scroll area. */
21
+ children: ReactNode;
22
+ /** Hooks for the element that scrolls the page content, since the document itself does not scroll. */
23
+ scrollAreaProps?: AppShellScrollAreaProps;
24
+ /** Extra classes merged onto the root element. */
25
+ className?: string;
26
+ /** Overrides the `data-testid` (defaults to `fd-app-shell`). */
27
+ 'data-testid'?: string;
28
+ }
29
+ /**
30
+ * Layout-only template for an app shell: navigation beside a content column that stacks the
31
+ * header above the page, with an optional side panel that pushes the page instead of covering it.
32
+ * The shell is exactly the height of the window and the document never scrolls: the page content
33
+ * scrolls in its own area under the header, so the header, navigation and side panel stay in place
34
+ * with no sticky positioning. It holds no state and renders whatever is passed to its slots, so the
35
+ * app keeps ownership of navigation, search and panel state.
36
+ *
37
+ * @summary window-height layout template placing navigation, header, a scrolling page area and a side panel
38
+ */
39
+ export declare const AppShell: ({ sidebar, header, panel, children, scrollAreaProps, className, "data-testid": dataTestId }: AppShellProps) => ReactNode;
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/AppShell/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,WAAW,uBAAuB;IACtC,wFAAwF;IACxF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yGAAyG;IACzG,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,wGAAwG;IACxG,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,6IAA6I;IAC7I,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wFAAwF;IACxF,QAAQ,EAAE,SAAS,CAAC;IACpB,sGAAsG;IACtG,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,6FAA6F,aAAa,KAAG,SA8BrI,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { cx } from '@flipdish/ui-library/utilities/cx';
3
+ import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
4
+
5
+ /**
6
+ * Layout-only template for an app shell: navigation beside a content column that stacks the
7
+ * header above the page, with an optional side panel that pushes the page instead of covering it.
8
+ * The shell is exactly the height of the window and the document never scrolls: the page content
9
+ * scrolls in its own area under the header, so the header, navigation and side panel stay in place
10
+ * with no sticky positioning. It holds no state and renders whatever is passed to its slots, so the
11
+ * app keeps ownership of navigation, search and panel state.
12
+ *
13
+ * @summary window-height layout template placing navigation, header, a scrolling page area and a side panel
14
+ */
15
+ const AppShell = ({ sidebar, header, panel, children, scrollAreaProps, className, 'data-testid': dataTestId }) => {
16
+ const appShellTestId = useResolvedTestId({ testId: dataTestId, segment: 'app-shell', rootName: 'app-shell' });
17
+ return (
18
+ // A column below `lg`, so a navigation that renders its own mobile top bar stacks above the content.
19
+ jsxs("div", { "data-testid": appShellTestId, className: cx('flex h-dvh w-full flex-col overflow-hidden bg-primary lg:flex-row', className), children: [sidebar, jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [header, jsxs("div", { className: "flex min-h-0 flex-1", children: [jsx("div", { id: scrollAreaProps?.id, ref: scrollAreaProps?.ref, "data-testid": scrollAreaProps?.['data-testid'] ?? joinTestId(appShellTestId, 'scroll-area'),
20
+ // Focusable so keyboard users can scroll a page that has no focusable content of its own (axe: scrollable-region-focusable).
21
+ // biome-ignore lint/a11y/noNoninteractiveTabindex: a scrollable region must be reachable by keyboard
22
+ tabIndex: 0, className: "flex min-w-0 flex-1 flex-col overflow-y-auto outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2", children: children }), panel] })] })] }));
23
+ };
24
+
25
+ export { AppShell };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/templates/AppShell/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;AAmCA;;;;;;;;;AASG;MACU,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAiB,KAAe;AAChJ,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IAE7G;;IAEEA,IAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAkB,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,mEAAmE,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CAC5H,OAAO,EAGRA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,sCAAsC,aAClD,MAAM,EAEPA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,qBAAqB,aAClCC,GAAA,CAAA,KAAA,EAAA,EACE,EAAE,EAAE,eAAe,EAAE,EAAE,EACvB,GAAG,EAAE,eAAe,EAAE,GAAG,iBACZ,eAAe,GAAG,aAAa,CAAC,IAAI,UAAU,CAAC,cAAc,EAAE,aAAa,CAAC;;;AAG1F,gCAAA,QAAQ,EAAE,CAAC,EACX,SAAS,EAAC,yHAAyH,EAAA,QAAA,EAElI,QAAQ,EAAA,CACL,EAEL,KAAK,CAAA,EAAA,CACF,CAAA,EAAA,CACF,CAAA,EAAA,CACF;AAEV;;;;"}
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var usePlatform = require('@flipdish/ui-library/hooks/usePlatform');
4
+ var hotkeys_utils = require('../../../utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs');
5
+
6
+ /**
7
+ * Turns a shortcut into the label for the user's device: `mod+k` and `⌘K` both read `⌘K` on macOS and
8
+ * `Ctrl K` elsewhere. Serves every shortcut label in the library, whether the value is a real hotkey or
9
+ * display text: text that is not a hotkey (`Hold to talk`) is returned exactly as written. Reads as
10
+ * the non-Mac form on the server and during hydration.
11
+ *
12
+ * @param hotkey `react-hotkeys-hook` syntax (`mod+k`, `mod+slash`, a sequence such as `g>p`), the symbol
13
+ * shorthand (`⌘K`), a shortcut written out (`Ctrl+K`), or any other text.
14
+ * @returns The label, or `undefined` when nothing is given.
15
+ *
16
+ * @summary format a hotkey as a platform-aware label such as ⌘K or Ctrl K
17
+ */
18
+ const useHotkeyHint = (hotkey, { commandOn = 'mac' } = {}) => {
19
+ const { isMac, isApple } = usePlatform.usePlatform();
20
+ return hotkey ? hotkeys_utils.formatHotkeyLabel(hotkey, commandOn === 'apple' ? isApple : isMac) : undefined;
21
+ };
22
+
23
+ exports.useHotkeyHint = useHotkeyHint;
24
+ //# sourceMappingURL=useHotkeyHint.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHotkeyHint.cjs","sources":["../../../../src/hooks/__internal__/useHotkeyHint/useHotkeyHint.ts"],"sourcesContent":[null],"names":["usePlatform","formatHotkeyLabel"],"mappings":";;;;;AAcA;;;;;;;;;;;AAWG;AACI,MAAM,aAAa,GAAG,CAAC,MAAiC,EAAE,EAAE,SAAS,GAAG,KAAK,EAAA,GAAwB,EAAE,KAAwB;IACpI,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAGA,uBAAW,EAAE;IAExC,OAAO,MAAM,GAAGC,+BAAiB,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC,GAAG,SAAS;AAChG;;;;"}
@@ -0,0 +1,22 @@
1
+ export interface HotkeyHintOptions {
2
+ /**
3
+ * Which devices press ⌘ for `mod`. `mac` matches `react-hotkeys-hook`, which uses ⌘ on macOS only.
4
+ * `apple` matches editors built on ProseMirror, which also use ⌘ on iPhone and iPad.
5
+ * @default "mac"
6
+ */
7
+ commandOn?: 'mac' | 'apple';
8
+ }
9
+ /**
10
+ * Turns a shortcut into the label for the user's device: `mod+k` and `⌘K` both read `⌘K` on macOS and
11
+ * `Ctrl K` elsewhere. Serves every shortcut label in the library, whether the value is a real hotkey or
12
+ * display text: text that is not a hotkey (`Hold to talk`) is returned exactly as written. Reads as
13
+ * the non-Mac form on the server and during hydration.
14
+ *
15
+ * @param hotkey `react-hotkeys-hook` syntax (`mod+k`, `mod+slash`, a sequence such as `g>p`), the symbol
16
+ * shorthand (`⌘K`), a shortcut written out (`Ctrl+K`), or any other text.
17
+ * @returns The label, or `undefined` when nothing is given.
18
+ *
19
+ * @summary format a hotkey as a platform-aware label such as ⌘K or Ctrl K
20
+ */
21
+ export declare const useHotkeyHint: (hotkey: string | null | undefined, { commandOn }?: HotkeyHintOptions) => string | undefined;
22
+ //# sourceMappingURL=useHotkeyHint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHotkeyHint.d.ts","sourceRoot":"","sources":["../../../../src/hooks/__internal__/useHotkeyHint/useHotkeyHint.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,gBAAuB,iBAAsB,KAAG,MAAM,GAAG,SAIzH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { usePlatform } from '@flipdish/ui-library/hooks/usePlatform';
2
+ import { formatHotkeyLabel } from '../../../utilities/__internal__/hotkeysUtils/hotkeys.utils.js';
3
+
4
+ /**
5
+ * Turns a shortcut into the label for the user's device: `mod+k` and `⌘K` both read `⌘K` on macOS and
6
+ * `Ctrl K` elsewhere. Serves every shortcut label in the library, whether the value is a real hotkey or
7
+ * display text: text that is not a hotkey (`Hold to talk`) is returned exactly as written. Reads as
8
+ * the non-Mac form on the server and during hydration.
9
+ *
10
+ * @param hotkey `react-hotkeys-hook` syntax (`mod+k`, `mod+slash`, a sequence such as `g>p`), the symbol
11
+ * shorthand (`⌘K`), a shortcut written out (`Ctrl+K`), or any other text.
12
+ * @returns The label, or `undefined` when nothing is given.
13
+ *
14
+ * @summary format a hotkey as a platform-aware label such as ⌘K or Ctrl K
15
+ */
16
+ const useHotkeyHint = (hotkey, { commandOn = 'mac' } = {}) => {
17
+ const { isMac, isApple } = usePlatform();
18
+ return hotkey ? formatHotkeyLabel(hotkey, commandOn === 'apple' ? isApple : isMac) : undefined;
19
+ };
20
+
21
+ export { useHotkeyHint };
22
+ //# sourceMappingURL=useHotkeyHint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHotkeyHint.js","sources":["../../../../src/hooks/__internal__/useHotkeyHint/useHotkeyHint.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAcA;;;;;;;;;;;AAWG;AACI,MAAM,aAAa,GAAG,CAAC,MAAiC,EAAE,EAAE,SAAS,GAAG,KAAK,EAAA,GAAwB,EAAE,KAAwB;IACpI,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE;IAExC,OAAO,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC,GAAG,SAAS;AAChG;;;;"}
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var hotkeys_utils = require('../../../utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs');
5
+ var platform_utils = require('../../../utilities/__internal__/platformUtils/platform.utils.cjs');
6
+
7
+ /**
8
+ * Listens for plain-key shortcuts typed anywhere on the page: single keys (`?`) and sequences
9
+ * (`g` then `p`), including sequences that share a first key, which `react-hotkeys-hook` cannot
10
+ * tell apart. Keys pressed with ⌘/Ctrl/Alt or Shift plus a letter, or while focus is in a field, are ignored so ordinary
11
+ * typing and other shortcuts are never hijacked. A sequence must be completed within `timeoutMs`
12
+ * of its previous key.
13
+ *
14
+ * @summary match single-key and multi-key plain shortcuts outside form fields
15
+ */
16
+ const useKeySequences = (sequences, onMatch, timeoutMs = 1000) => {
17
+ const latest = React.useRef({ sequences, onMatch });
18
+ React.useEffect(() => {
19
+ latest.current = { sequences, onMatch };
20
+ });
21
+ const hasSequences = sequences.length > 0;
22
+ React.useEffect(() => {
23
+ if (!hasSequences)
24
+ return;
25
+ let buffer = [];
26
+ let lastKeyAt = 0;
27
+ const onKeyDown = (event) => {
28
+ // A key name longer than one character (Shift, Enter, ArrowDown) is not a typed character.
29
+ if (event.defaultPrevented || event.repeat || event.key.length !== 1 || hotkeys_utils.isTypingInField(event))
30
+ return;
31
+ // AltGr (reported as Ctrl+Alt on Windows) and Option on Apple keyboards type characters such as `@` or `[` on many layouts.
32
+ const os = platform_utils.getPlatformOs();
33
+ const typesCharacter = event.getModifierState('AltGraph') || ((os === 'macos' || os === 'ios') && event.altKey && !event.ctrlKey);
34
+ if (event.metaKey || ((event.ctrlKey || event.altKey) && !typesCharacter))
35
+ return;
36
+ // Shift plus a letter is its own shortcut (`⇧d`), not the letter.
37
+ if (event.shiftKey && event.key.toLowerCase() !== event.key.toUpperCase())
38
+ return;
39
+ const now = Date.now();
40
+ const result = hotkeys_utils.advanceKeySequence(now - lastKeyAt > timeoutMs ? [] : buffer, event.key.toLowerCase(), latest.current.sequences);
41
+ buffer = result.buffer;
42
+ lastKeyAt = now;
43
+ if (result.matched !== undefined) {
44
+ event.preventDefault();
45
+ latest.current.onMatch(result.matched);
46
+ }
47
+ };
48
+ document.addEventListener('keydown', onKeyDown);
49
+ return () => document.removeEventListener('keydown', onKeyDown);
50
+ }, [hasSequences, timeoutMs]);
51
+ };
52
+
53
+ exports.useKeySequences = useKeySequences;
54
+ //# sourceMappingURL=useKeySequences.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeySequences.cjs","sources":["../../../../src/hooks/__internal__/useKeySequences/useKeySequences.ts"],"sourcesContent":[null],"names":["useRef","useEffect","isTypingInField","getPlatformOs","advanceKeySequence"],"mappings":";;;;;;AAMA;;;;;;;;AAQG;AACI,MAAM,eAAe,GAAG,CAAC,SAAqB,EAAE,OAAgC,EAAE,SAAS,GAAG,IAAI,KAAU;IACjH,MAAM,MAAM,GAAGA,YAAM,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAC7CC,eAAS,CAAC,MAAK;QACb,MAAM,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AACzC,IAAA,CAAC,CAAC;AAEF,IAAA,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC;IAEzCA,eAAS,CAAC,MAAK;AACb,QAAA,IAAI,CAAC,YAAY;YAAE;QAEnB,IAAI,MAAM,GAAa,EAAE;QACzB,IAAI,SAAS,GAAG,CAAC;AAEjB,QAAA,MAAM,SAAS,GAAG,CAAC,KAAoB,KAAI;;AAEzC,YAAA,IAAI,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAIC,6BAAe,CAAC,KAAK,CAAC;gBAAE;;AAEhG,YAAA,MAAM,EAAE,GAAGC,4BAAa,EAAE;AAC1B,YAAA,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,KAAK,KAAK,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AACjI,YAAA,IAAI,KAAK,CAAC,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,cAAc,CAAC;gBAAE;;AAE3E,YAAA,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE;gBAAE;AAE3E,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;AACtB,YAAA,MAAM,MAAM,GAAGC,gCAAkB,CAAC,GAAG,GAAG,SAAS,GAAG,SAAS,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/H,YAAA,MAAM,GAAG,MAAM,CAAC,MAAM;YACtB,SAAS,GAAG,GAAG;AAEf,YAAA,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE;gBAChC,KAAK,CAAC,cAAc,EAAE;gBACtB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;YACxC;AACF,QAAA,CAAC;AAED,QAAA,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC;QAC/C,OAAO,MAAM,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC;AACjE,IAAA,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAC/B;;;;"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Listens for plain-key shortcuts typed anywhere on the page: single keys (`?`) and sequences
3
+ * (`g` then `p`), including sequences that share a first key, which `react-hotkeys-hook` cannot
4
+ * tell apart. Keys pressed with ⌘/Ctrl/Alt or Shift plus a letter, or while focus is in a field, are ignored so ordinary
5
+ * typing and other shortcuts are never hijacked. A sequence must be completed within `timeoutMs`
6
+ * of its previous key.
7
+ *
8
+ * @summary match single-key and multi-key plain shortcuts outside form fields
9
+ */
10
+ export declare const useKeySequences: (sequences: string[][], onMatch: (index: number) => void, timeoutMs?: number) => void;
11
+ //# sourceMappingURL=useKeySequences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeySequences.d.ts","sourceRoot":"","sources":["../../../../src/hooks/__internal__/useKeySequences/useKeySequences.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,EAAE,EAAE,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EAAE,kBAAgB,KAAG,IAsC3G,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { useRef, useEffect } from 'react';
2
+ import { isTypingInField, advanceKeySequence } from '../../../utilities/__internal__/hotkeysUtils/hotkeys.utils.js';
3
+ import { getPlatformOs } from '../../../utilities/__internal__/platformUtils/platform.utils.js';
4
+
5
+ /**
6
+ * Listens for plain-key shortcuts typed anywhere on the page: single keys (`?`) and sequences
7
+ * (`g` then `p`), including sequences that share a first key, which `react-hotkeys-hook` cannot
8
+ * tell apart. Keys pressed with ⌘/Ctrl/Alt or Shift plus a letter, or while focus is in a field, are ignored so ordinary
9
+ * typing and other shortcuts are never hijacked. A sequence must be completed within `timeoutMs`
10
+ * of its previous key.
11
+ *
12
+ * @summary match single-key and multi-key plain shortcuts outside form fields
13
+ */
14
+ const useKeySequences = (sequences, onMatch, timeoutMs = 1000) => {
15
+ const latest = useRef({ sequences, onMatch });
16
+ useEffect(() => {
17
+ latest.current = { sequences, onMatch };
18
+ });
19
+ const hasSequences = sequences.length > 0;
20
+ useEffect(() => {
21
+ if (!hasSequences)
22
+ return;
23
+ let buffer = [];
24
+ let lastKeyAt = 0;
25
+ const onKeyDown = (event) => {
26
+ // A key name longer than one character (Shift, Enter, ArrowDown) is not a typed character.
27
+ if (event.defaultPrevented || event.repeat || event.key.length !== 1 || isTypingInField(event))
28
+ return;
29
+ // AltGr (reported as Ctrl+Alt on Windows) and Option on Apple keyboards type characters such as `@` or `[` on many layouts.
30
+ const os = getPlatformOs();
31
+ const typesCharacter = event.getModifierState('AltGraph') || ((os === 'macos' || os === 'ios') && event.altKey && !event.ctrlKey);
32
+ if (event.metaKey || ((event.ctrlKey || event.altKey) && !typesCharacter))
33
+ return;
34
+ // Shift plus a letter is its own shortcut (`⇧d`), not the letter.
35
+ if (event.shiftKey && event.key.toLowerCase() !== event.key.toUpperCase())
36
+ return;
37
+ const now = Date.now();
38
+ const result = advanceKeySequence(now - lastKeyAt > timeoutMs ? [] : buffer, event.key.toLowerCase(), latest.current.sequences);
39
+ buffer = result.buffer;
40
+ lastKeyAt = now;
41
+ if (result.matched !== undefined) {
42
+ event.preventDefault();
43
+ latest.current.onMatch(result.matched);
44
+ }
45
+ };
46
+ document.addEventListener('keydown', onKeyDown);
47
+ return () => document.removeEventListener('keydown', onKeyDown);
48
+ }, [hasSequences, timeoutMs]);
49
+ };
50
+
51
+ export { useKeySequences };
52
+ //# sourceMappingURL=useKeySequences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeySequences.js","sources":["../../../../src/hooks/__internal__/useKeySequences/useKeySequences.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAMA;;;;;;;;AAQG;AACI,MAAM,eAAe,GAAG,CAAC,SAAqB,EAAE,OAAgC,EAAE,SAAS,GAAG,IAAI,KAAU;IACjH,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAC7C,SAAS,CAAC,MAAK;QACb,MAAM,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AACzC,IAAA,CAAC,CAAC;AAEF,IAAA,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC;IAEzC,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,CAAC,YAAY;YAAE;QAEnB,IAAI,MAAM,GAAa,EAAE;QACzB,IAAI,SAAS,GAAG,CAAC;AAEjB,QAAA,MAAM,SAAS,GAAG,CAAC,KAAoB,KAAI;;AAEzC,YAAA,IAAI,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC;gBAAE;;AAEhG,YAAA,MAAM,EAAE,GAAG,aAAa,EAAE;AAC1B,YAAA,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,KAAK,KAAK,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AACjI,YAAA,IAAI,KAAK,CAAC,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,cAAc,CAAC;gBAAE;;AAE3E,YAAA,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE;gBAAE;AAE3E,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;AACtB,YAAA,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,GAAG,SAAS,GAAG,SAAS,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/H,YAAA,MAAM,GAAG,MAAM,CAAC,MAAM;YACtB,SAAS,GAAG,GAAG;AAEf,YAAA,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE;gBAChC,KAAK,CAAC,cAAc,EAAE;gBACtB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;YACxC;AACF,QAAA,CAAC;AAED,QAAA,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC;QAC/C,OAAO,MAAM,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC;AACjE,IAAA,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAC/B;;;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var platform_utils = require('../../utilities/__internal__/platformUtils/platform.utils.cjs');
5
+
6
+ const subscribeToNothing = () => () => { };
7
+ const getServerOs = () => 'unknown';
8
+ /**
9
+ * Reports the operating system of the user's device, for wording that depends on it: a shortcut
10
+ * label, a download link, a help article. Detection reads the user agent, so treat it as a best
11
+ * guess and never as a reason to change behaviour; use `useBreakpoints` or feature detection for
12
+ * that. Every flag is `false` on the server and during hydration, then settles on the real device.
13
+ *
14
+ * @summary detect the user's operating system, safely across hydration
15
+ */
16
+ const usePlatform = () => {
17
+ const os = React.useSyncExternalStore(subscribeToNothing, platform_utils.getPlatformOs, getServerOs);
18
+ return React.useMemo(() => ({ os, isMac: os === 'macos', isApple: os === 'macos' || os === 'ios', isWindows: os === 'windows' }), [os]);
19
+ };
20
+
21
+ exports.usePlatform = usePlatform;
22
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/hooks/usePlatform/index.ts"],"sourcesContent":[null],"names":["useSyncExternalStore","getPlatformOs","useMemo"],"mappings":";;;;;AAmBA,MAAM,kBAAkB,GAAG,MAAM,MAAK,EAAE,CAAC;AACzC,MAAM,WAAW,GAAG,MAAkB,SAAS;AAE/C;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,MAAmB;IAC5C,MAAM,EAAE,GAAGA,0BAAoB,CAAC,kBAAkB,EAAEC,4BAAa,EAAE,WAAW,CAAC;AAE/E,IAAA,OAAOC,aAAO,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACnI;;;;"}
@@ -0,0 +1,22 @@
1
+ import type { PlatformOs } from '../../utilities/__internal__/platformUtils/platform.utils';
2
+ export type { PlatformOs };
3
+ export interface PlatformInfo {
4
+ /** The operating system, or `unknown` on the server, during hydration and when it cannot be told. */
5
+ os: PlatformOs;
6
+ /** macOS only, where ⌘ is the primary shortcut modifier. Also true for an iPad in desktop mode, which reports itself as a Mac. */
7
+ isMac: boolean;
8
+ /** Any Apple device: macOS, iPhone or iPad. */
9
+ isApple: boolean;
10
+ /** Windows only, where the primary shortcut modifier is `ctrl`. */
11
+ isWindows: boolean;
12
+ }
13
+ /**
14
+ * Reports the operating system of the user's device, for wording that depends on it: a shortcut
15
+ * label, a download link, a help article. Detection reads the user agent, so treat it as a best
16
+ * guess and never as a reason to change behaviour; use `useBreakpoints` or feature detection for
17
+ * that. Every flag is `false` on the server and during hydration, then settles on the real device.
18
+ *
19
+ * @summary detect the user's operating system, safely across hydration
20
+ */
21
+ export declare const usePlatform: () => PlatformInfo;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePlatform/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AAE5F,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,MAAM,WAAW,YAAY;IAC3B,qGAAqG;IACrG,EAAE,EAAE,UAAU,CAAC;IACf,kIAAkI;IAClI,KAAK,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC;CACpB;AAKD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,QAAO,YAI9B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { useSyncExternalStore, useMemo } from 'react';
2
+ import { getPlatformOs } from '../../utilities/__internal__/platformUtils/platform.utils.js';
3
+
4
+ const subscribeToNothing = () => () => { };
5
+ const getServerOs = () => 'unknown';
6
+ /**
7
+ * Reports the operating system of the user's device, for wording that depends on it: a shortcut
8
+ * label, a download link, a help article. Detection reads the user agent, so treat it as a best
9
+ * guess and never as a reason to change behaviour; use `useBreakpoints` or feature detection for
10
+ * that. Every flag is `false` on the server and during hydration, then settles on the real device.
11
+ *
12
+ * @summary detect the user's operating system, safely across hydration
13
+ */
14
+ const usePlatform = () => {
15
+ const os = useSyncExternalStore(subscribeToNothing, getPlatformOs, getServerOs);
16
+ return useMemo(() => ({ os, isMac: os === 'macos', isApple: os === 'macos' || os === 'ios', isWindows: os === 'windows' }), [os]);
17
+ };
18
+
19
+ export { usePlatform };
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/hooks/usePlatform/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAmBA,MAAM,kBAAkB,GAAG,MAAM,MAAK,EAAE,CAAC;AACzC,MAAM,WAAW,GAAG,MAAkB,SAAS;AAE/C;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,MAAmB;IAC5C,MAAM,EAAE,GAAG,oBAAoB,CAAC,kBAAkB,EAAE,aAAa,EAAE,WAAW,CAAC;AAE/E,IAAA,OAAO,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACnI;;;;"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `AppShell` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/templates/AppShell` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `AppShell` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `usePlatform` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/hooks/usePlatform` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `usePlatform` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;