@linzjs/lui 24.20.1 → 26.1.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 (148) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/assets/svg-content.d.ts +7 -7
  3. package/dist/components/Drawer/Drawer.d.ts +45 -45
  4. package/dist/components/Drawer/DrawerContext.d.ts +6 -7
  5. package/dist/components/Drawer/DrawerGlobal.d.ts +12 -12
  6. package/dist/components/Drawer/DrawerGlobalContext.d.ts +14 -14
  7. package/dist/components/Drawer/utils.d.ts +7 -7
  8. package/dist/components/LuiAccordicard/LuiAccordicard.d.ts +9 -9
  9. package/dist/components/LuiAccordicardStatic/LuiAccordicardStatic.d.ts +9 -9
  10. package/dist/components/LuiAccordion/LuiAccordion.d.ts +12 -12
  11. package/dist/components/LuiBadge/LuiBadge.d.ts +12 -12
  12. package/dist/components/LuiBanner/LuiBanner.d.ts +10 -10
  13. package/dist/components/LuiBannerV2/LuiBannerV2.d.ts +22 -22
  14. package/dist/components/LuiBearingInput/LuiBearingInput.d.ts +16 -16
  15. package/dist/components/LuiButton/LuiButton.d.ts +44 -44
  16. package/dist/components/LuiColourPicker/ColorBucket.d.ts +6 -6
  17. package/dist/components/LuiColourPicker/ColorInput.d.ts +9 -9
  18. package/dist/components/LuiColourPicker/ColorPalette.d.ts +14 -14
  19. package/dist/components/LuiColourPicker/ColourPaletteConstants.d.ts +8 -8
  20. package/dist/components/LuiCommonInputProps.d.ts +5 -5
  21. package/dist/components/LuiCounter/LuiCounter.d.ts +8 -8
  22. package/dist/components/LuiError/LuiError.d.ts +8 -8
  23. package/dist/components/LuiErrorPage/LuiErrorIllustration.d.ts +5 -5
  24. package/dist/components/LuiErrorPage/LuiErrorPage.d.ts +9 -9
  25. package/dist/components/LuiErrorPanel/LuiErrorPanel.d.ts +23 -23
  26. package/dist/components/LuiExpandableBanner/LuiExpandableBanner.d.ts +19 -19
  27. package/dist/components/LuiFilterContainer/LuiFilterContainer.d.ts +14 -14
  28. package/dist/components/LuiFilterMenu/LuiFilterMenu.d.ts +16 -16
  29. package/dist/components/LuiFooter/LuiAppFooterSml.d.ts +13 -13
  30. package/dist/components/LuiFooter/LuiFooter.d.ts +12 -12
  31. package/dist/components/LuiFormElements/ClearableLuiTextInput/ClearableLuiTextInput.d.ts +14 -14
  32. package/dist/components/LuiFormElements/LuiCheckboxInput/LuiCheckboxInput.d.ts +16 -16
  33. package/dist/components/LuiFormElements/LuiComboSelect/LuiComboSelect.d.ts +27 -27
  34. package/dist/components/LuiFormElements/LuiDateInput/DateInput.d.ts +5 -5
  35. package/dist/components/LuiFormElements/LuiDateInput/DateInputHelper.d.ts +6 -6
  36. package/dist/components/LuiFormElements/LuiDateInput/FireDateChange.d.ts +1 -1
  37. package/dist/components/LuiFormElements/LuiDateInput/LuiDateInput.d.ts +5 -5
  38. package/dist/components/LuiFormElements/LuiFileInputBox/LuiFileInputBox.d.ts +36 -36
  39. package/dist/components/LuiFormElements/LuiMoneyInput/LuiMoneyInput.d.ts +28 -28
  40. package/dist/components/LuiFormElements/LuiRadioInput/LuiRadioInput.d.ts +15 -15
  41. package/dist/components/LuiFormElements/LuiSelectInput/LuiSelectInput.d.ts +20 -20
  42. package/dist/components/LuiFormElements/LuiTextAreaInput/LuiAutoExpandTextAreaInput.d.ts +3 -3
  43. package/dist/components/LuiFormElements/LuiTextAreaInput/LuiTextAreaInput.d.ts +12 -12
  44. package/dist/components/LuiFormElements/LuiTextInput/LuiTextInput.d.ts +23 -23
  45. package/dist/components/LuiForms/LuiFormSection/LuiFormSectionHeader.d.ts +7 -7
  46. package/dist/components/LuiForms/LuiFormSection/LuiHelpInfo/LuiHelpInfo.d.ts +6 -6
  47. package/dist/components/LuiHeader/LuiHeader.d.ts +72 -72
  48. package/dist/components/LuiHeaderMenu/LuiHeaderMenus.d.ts +51 -51
  49. package/dist/components/LuiHeaderMenuV2/LuiHeaderMenusV2.d.ts +87 -102
  50. package/dist/components/LuiHeaderV2/LuiHeaderV2.d.ts +103 -109
  51. package/dist/components/LuiIcon/LuiIcon.d.ts +35 -35
  52. package/dist/components/LuiListBox/LuiListBox.d.ts +59 -59
  53. package/dist/components/LuiListBox/LuiListBoxGroup.d.ts +10 -10
  54. package/dist/components/LuiListBox/LuiListBoxItem.d.ts +10 -10
  55. package/dist/components/LuiListBox/Renderers/CheckboxItemRenderer.d.ts +4 -4
  56. package/dist/components/LuiListBox/Renderers/RadioItemRenderer.d.ts +4 -4
  57. package/dist/components/LuiListBox/useLuiListBox.d.ts +3 -3
  58. package/dist/components/LuiLoadingSpinner/LuiLoadingSpinner.d.ts +16 -16
  59. package/dist/components/LuiLoadingSpinner/LuiLottieLight.d.ts +14 -14
  60. package/dist/components/LuiMenu/LuiMenu.d.ts +12 -12
  61. package/dist/components/LuiMenuTrigger/LuiMenuTrigger.d.ts +5 -5
  62. package/dist/components/LuiModal/LuiAlertModalV2.d.ts +7 -7
  63. package/dist/components/LuiModal/LuiModal.d.ts +40 -40
  64. package/dist/components/LuiModal/LuiModalContext.d.ts +6 -0
  65. package/dist/components/LuiModal/LuiModalV2.d.ts +36 -36
  66. package/dist/components/LuiMultiSwitch/LuiMultiSwitch.d.ts +23 -23
  67. package/dist/components/LuiMultiSwitch/LuiMultiSwitch.examples.d.ts +4 -4
  68. package/dist/components/LuiPagination/LuiPagination.d.ts +23 -23
  69. package/dist/components/LuiProgressBar/LuiProgressBar.d.ts +9 -9
  70. package/dist/components/LuiResizableLayout/LuiResizableLayout.d.ts +25 -25
  71. package/dist/components/LuiSearchBox/LuiSearchBox.d.ts +41 -41
  72. package/dist/components/LuiSearchInput/LuiPassiveSearchInput.d.ts +28 -28
  73. package/dist/components/LuiSearchInput/LuiSearchInput.d.ts +38 -38
  74. package/dist/components/LuiSearchInput/ResultsDisplay.d.ts +23 -23
  75. package/dist/components/LuiSelectMenu/LuiSelectDataMenu.d.ts +15 -15
  76. package/dist/components/LuiSelectMenu/LuiSelectMenu.d.ts +25 -25
  77. package/dist/components/LuiShadow/LuiShadow.d.ts +6 -6
  78. package/dist/components/LuiSideMenu/LuiSideMenu.d.ts +5 -5
  79. package/dist/components/LuiSideMenu/LuiSideMenuItem.d.ts +11 -11
  80. package/dist/components/LuiSidePanel/LuiSidePanel.d.ts +9 -9
  81. package/dist/components/LuiSidePanel/LuiSidePanelHelper.d.ts +7 -7
  82. package/dist/components/LuiSideToolbar/LuiSideToolbar.d.ts +11 -11
  83. package/dist/components/LuiSideToolbar/ToolbarButton.d.ts +21 -21
  84. package/dist/components/LuiSideToolbar/ToolbarIcon.d.ts +13 -13
  85. package/dist/components/LuiSideToolbar/ToolbarItem.d.ts +17 -17
  86. package/dist/components/LuiSplitButton/LuiSplitButton.d.ts +30 -30
  87. package/dist/components/LuiStaticMessage/LuiStaticMessage.d.ts +10 -10
  88. package/dist/components/LuiSwitchButton/LuiSwitchButton.d.ts +8 -8
  89. package/dist/components/LuiTabs/LuiTab/LuiTab.d.ts +13 -13
  90. package/dist/components/LuiTabs/LuiTabs.d.ts +10 -10
  91. package/dist/components/LuiTabs/LuiTabsGroup/LuiTabsGroup.d.ts +5 -5
  92. package/dist/components/LuiTabs/LuiTabsPanel/LuiTabsPanel.d.ts +8 -8
  93. package/dist/components/LuiTabs/LuiTabsPanelSwitch/LuiTabsPanelSwitch.d.ts +8 -8
  94. package/dist/components/LuiToastMessage/LuiToastMessage.d.ts +20 -20
  95. package/dist/components/LuiTooltip/LuiTooltip.d.ts +16 -16
  96. package/dist/components/LuiUpdateSplashModal/LuiUpdatesSplashModal.d.ts +27 -27
  97. package/dist/components/Splitter/Control/Control.d.ts +9 -9
  98. package/dist/components/Splitter/Control/ControlIcon.d.ts +7 -7
  99. package/dist/components/Splitter/Separator/Separator.d.ts +11 -11
  100. package/dist/components/Splitter/Splitter.d.ts +44 -44
  101. package/dist/components/Splitter/Stories/RangeAsPx.d.ts +9 -9
  102. package/dist/components/Splitter/Stories/Section.d.ts +5 -3
  103. package/dist/components/Splitter/helpers/clampSeparator.d.ts +10 -10
  104. package/dist/components/Splitter/helpers/dataBoundary.d.ts +18 -18
  105. package/dist/components/Splitter/helpers/getGridTemplate.d.ts +14 -14
  106. package/dist/components/Splitter/helpers/getKeyDownDeltaMove.d.ts +6 -7
  107. package/dist/components/Splitter/helpers/getSeparatorAttributes.d.ts +27 -27
  108. package/dist/components/Splitter/helpers/getSeparatorPosition.d.ts +7 -7
  109. package/dist/components/Splitter/helpers/transition.d.ts +5 -5
  110. package/dist/components/Splitter/helpers/useForkRef.d.ts +3 -4
  111. package/dist/components/Splitter/helpers/useMoveSeparator.d.ts +11 -11
  112. package/dist/components/Splitter/helpers/useShowSeparator.d.ts +7 -7
  113. package/dist/components/Splitter/helpers/useValueSeparator.d.ts +15 -15
  114. package/dist/components/Splitter/helpers/useValueSeparatorEffects.d.ts +5 -5
  115. package/dist/components/Splitter/useSplitterRef.d.ts +5 -5
  116. package/dist/components/Toast/Helpers/ToastSection.d.ts +9 -9
  117. package/dist/components/Toast/Helpers/ToastTypes.d.ts +35 -35
  118. package/dist/components/Toast/Helpers/getToastProviderEl.d.ts +15 -15
  119. package/dist/components/Toast/Helpers/toastUsage.d.ts +2 -2
  120. package/dist/components/Toast/Helpers/useToastState.d.ts +20 -21
  121. package/dist/components/Toast/ToastBanner.d.ts +6 -6
  122. package/dist/components/Toast/ToastProvider.d.ts +10 -10
  123. package/dist/components/Toast/Upgrade/LuiToastMessageCompatibleInterface.d.ts +5 -5
  124. package/dist/components/Toast/Upgrade/ToastVersion.d.ts +2 -3
  125. package/dist/components/Toast/Upgrade/index.d.ts +39 -39
  126. package/dist/components/Toast/Upgrade/observeOlderToasts.d.ts +6 -6
  127. package/dist/components/Toast/Upgrade/useShowLUIMessageCompatibleInterface.d.ts +5 -5
  128. package/dist/components/Toast/index.d.ts +2 -2
  129. package/dist/components/Toast/useToast.d.ts +43 -43
  130. package/dist/components/common/Hooks.d.ts +32 -32
  131. package/dist/components/common/ResponsiveUtils.d.ts +7 -7
  132. package/dist/components/common/StorybookSupport.d.ts +6 -6
  133. package/dist/components/common/UseMediaQuery.d.ts +9 -9
  134. package/dist/contexts/LuiFilterCharactersProvider.d.ts +12 -12
  135. package/dist/contexts/LuiMessagingContextProvider.d.ts +14 -14
  136. package/dist/fonts.d.ts +10 -10
  137. package/dist/functions/LinzFreeTextFilter.d.ts +14 -14
  138. package/dist/functions/LinzFreeTextValidator.d.ts +2 -2
  139. package/dist/hooks/index.d.ts +1 -1
  140. package/dist/hooks/useClickedOutsideElement.d.ts +14 -14
  141. package/dist/hooks/useDeprecatedWarning.d.ts +1 -1
  142. package/dist/index.d.ts +92 -92
  143. package/dist/index.js +10917 -9559
  144. package/dist/index.js.map +1 -1
  145. package/dist/lui.esm.js +10917 -9559
  146. package/dist/lui.esm.js.map +1 -1
  147. package/dist/scss/Components/LuiSwitchButton/LuiSwitchButton.scss +1 -0
  148. package/package.json +73 -61
@@ -1,10 +1,10 @@
1
- import './ToastProvider.scss';
2
- import * as React from 'react';
3
- import { ReactNode } from 'react';
4
- import { ToastAction } from './Helpers/ToastTypes';
5
- export declare const ToastContext: React.Context<React.Dispatch<ToastAction> | undefined>;
6
- export declare const ToastProvider: ({ children, defaultTimeout, stack, }: {
7
- defaultTimeout?: number | undefined;
8
- stack?: number | undefined;
9
- children: ReactNode;
10
- }) => React.JSX.Element;
1
+ import './ToastProvider.scss';
2
+ import * as React from 'react';
3
+ import { ReactNode } from 'react';
4
+ import { ToastAction } from './Helpers/ToastTypes';
5
+ export declare const ToastContext: React.Context<React.Dispatch<ToastAction> | undefined>;
6
+ export declare const ToastProvider: ({ children, defaultTimeout, stack, }: {
7
+ defaultTimeout?: number;
8
+ stack?: number;
9
+ children: ReactNode;
10
+ }) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import React, { ComponentProps } from 'react';
2
- import { LuiToastMessage } from '../../LuiToastMessage/LuiToastMessage';
3
- type Props = ComponentProps<typeof LuiToastMessage>;
4
- export declare const LuiToastMessageCompatibleInterface: (props: Props) => React.JSX.Element;
5
- export {};
1
+ import React, { ComponentProps } from 'react';
2
+ import { LuiToastMessage } from '../../LuiToastMessage/LuiToastMessage';
3
+ type Props = ComponentProps<typeof LuiToastMessage>;
4
+ export declare const LuiToastMessageCompatibleInterface: (props: Props) => React.JSX.Element;
5
+ export {};
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const ToastVersion: import("react").Context<"v1" | "v2">;
3
- export declare const useToastVersion: () => "v1" | "v2";
1
+ export declare const ToastVersion: import("react").Context<"v1" | "v2">;
2
+ export declare const useToastVersion: () => "v1" | "v2";
@@ -1,39 +1,39 @@
1
- import React, { ComponentProps, ReactNode } from 'react';
2
- import { LuiToastMessage as LuiToastMessageOld } from '../../LuiToastMessage/LuiToastMessage';
3
- type ProviderPropsV1 = {
4
- /** Use v2 explicitely to get the new designs */
5
- version?: 'v1';
6
- /** Default timeout is not permitted in v1 */
7
- defaultTimeout?: never;
8
- /** Stack is not permitted in v1 */
9
- stack?: never;
10
- };
11
- type ProviderPropsV2 = {
12
- /** Latest designs */
13
- version: 'v2';
14
- /** Default timeout for ephemeral toasts is 4000ms */
15
- defaultTimeout?: number;
16
- /** Max number of toast allowed simultaneously. Default value is 5. */
17
- stack?: number;
18
- };
19
- type ProviderProps = {
20
- children?: ReactNode;
21
- } & (ProviderPropsV1 | ProviderPropsV2);
22
- /**
23
- * Context provider to handle global logic of toast messages. It defaults to legacy version 'v1'.
24
- * @description Set version property to 'v2' to get the latest designs.
25
- */
26
- export declare const LuiMessagingContextProvider: (props: ProviderProps) => React.JSX.Element;
27
- /**
28
- * Hook to display pop-up messages in response to a user action or state change. Examples include: Saving, exporting, committing, deleting, etc.
29
- * @description Legacy hook to trigger toasts. It requires {@linkcode LuiMessagingContextProvider}.
30
- * @alias useToast. For a more flexible API when you're using v2 designs, using useToast is recommended.
31
- * @returns Toaster function to trigger branded toasts (e.g. warning, error, info) in the top right of the page.
32
- * @example
33
- * const toaster = useShowLUIMessage();
34
- * toaster({ message: 'Failed to save', messageType: 'toast', messageLevel: 'error' });
35
- */
36
- export declare const useShowLUIMessage: () => (messageProps: import("../../../contexts/LuiMessagingContextProvider").ShowMessageProps) => void;
37
- type LuiToastMessageProps = ComponentProps<typeof LuiToastMessageOld>;
38
- export declare const LuiToastMessage: (props: LuiToastMessageProps) => React.JSX.Element;
39
- export {};
1
+ import React, { ComponentProps, ReactNode } from 'react';
2
+ import { LuiToastMessage as LuiToastMessageOld } from '../../LuiToastMessage/LuiToastMessage';
3
+ type ProviderPropsV1 = {
4
+ /** Use v2 explicitely to get the new designs */
5
+ version?: 'v1';
6
+ /** Default timeout is not permitted in v1 */
7
+ defaultTimeout?: never;
8
+ /** Stack is not permitted in v1 */
9
+ stack?: never;
10
+ };
11
+ type ProviderPropsV2 = {
12
+ /** Latest designs */
13
+ version: 'v2';
14
+ /** Default timeout for ephemeral toasts is 4000ms */
15
+ defaultTimeout?: number;
16
+ /** Max number of toast allowed simultaneously. Default value is 5. */
17
+ stack?: number;
18
+ };
19
+ type ProviderProps = {
20
+ children?: ReactNode;
21
+ } & (ProviderPropsV1 | ProviderPropsV2);
22
+ /**
23
+ * Context provider to handle global logic of toast messages. It defaults to legacy version 'v1'.
24
+ * @description Set version property to 'v2' to get the latest designs.
25
+ */
26
+ export declare const LuiMessagingContextProvider: (props: ProviderProps) => React.JSX.Element;
27
+ /**
28
+ * Hook to display pop-up messages in response to a user action or state change. Examples include: Saving, exporting, committing, deleting, etc.
29
+ * @description Legacy hook to trigger toasts. It requires {@linkcode LuiMessagingContextProvider}.
30
+ * @alias useToast. For a more flexible API when you're using v2 designs, using useToast is recommended.
31
+ * @returns Toaster function to trigger branded toasts (e.g. warning, error, info) in the top right of the page.
32
+ * @example
33
+ * const toaster = useShowLUIMessage();
34
+ * toaster({ message: 'Failed to save', messageType: 'toast', messageLevel: 'error' });
35
+ */
36
+ export declare const useShowLUIMessage: () => (messageProps: import("../../../contexts/LuiMessagingContextProvider").ShowMessageProps) => void;
37
+ type LuiToastMessageProps = ComponentProps<typeof LuiToastMessageOld>;
38
+ export declare const LuiToastMessage: (props: LuiToastMessageProps) => React.JSX.Element;
39
+ export {};
@@ -1,6 +1,6 @@
1
- /**
2
- * Observes DOM changes in the elements tree to identify older toasts
3
- * that have been added to the page, to calculate a CSS top value so
4
- * that these are stacked below the new ones, if any.
5
- */
6
- export declare const observeOlderToasts: (portal: HTMLDivElement) => void;
1
+ /**
2
+ * Observes DOM changes in the elements tree to identify older toasts
3
+ * that have been added to the page, to calculate a CSS top value so
4
+ * that these are stacked below the new ones, if any.
5
+ */
6
+ export declare const observeOlderToasts: (portal: HTMLDivElement) => void;
@@ -1,5 +1,5 @@
1
- import { ShowMessageProps } from '../../../contexts/LuiMessagingContextProvider';
2
- /**
3
- * Provide new toast hook with old interface from original useShowLUIMessage
4
- */
5
- export declare const useShowLUIMessageCompatibleInterface: () => (props: ShowMessageProps) => number;
1
+ import { ShowMessageProps } from '../../../contexts/LuiMessagingContextProvider';
2
+ /**
3
+ * Provide new toast hook with old interface from original useShowLUIMessage
4
+ */
5
+ export declare const useShowLUIMessageCompatibleInterface: () => (props: ShowMessageProps) => number;
@@ -1,2 +1,2 @@
1
- export { ToastProvider } from './ToastProvider';
2
- export { useToast } from './useToast';
1
+ export { ToastProvider } from './ToastProvider';
2
+ export { useToast } from './useToast';
@@ -1,43 +1,43 @@
1
- import './ToastProvider.scss';
2
- import { ReactNode } from 'react';
3
- import { ToastNode, ToastOptions } from './Helpers/ToastTypes';
4
- type Config = ToastOptions & {
5
- id?: number;
6
- };
7
- type BannerToast = (children: ReactNode, config?: Config) => number;
8
- /**
9
- * Hook to display pop-up messages in response to a user action or state change. Examples include: Saving, exporting, committing, deleting, etc.
10
- * It requires 'LuiMessagingContextProvider' with property version set to 'v2'.
11
- * Toasts that are `warning` or `error` won't timeout automatically, unless configured otherwise.
12
- * @description Hook to trigger pop-up messages (a.k.a. toasts). Each toast helper function returns a a toast id `number` that can be used for manual dismiss or updates.
13
- * @example
14
- * // Error message
15
- * const { error } = useToast();
16
- * error("Failed to save");
17
- * @example
18
- * // Toast error and then turn toast into success
19
- * const { error, success } = useToast();
20
- * const toastId = error("Failed to save");
21
- * success('Toast updated to success', { id: toastId });
22
- * @example
23
- * // Dismiss info toast that won't dismiss automatically
24
- * const { info, dismiss } = useToast();
25
- * const toastId = info(<a href="#">Some useful link</a>, { timeout: Infinity });
26
- * dismiss(toastId);
27
- * @example
28
- * // Custom toasts accept `ReactNode` or `({ close: () => void }) => ReactNode`
29
- * const { toast } = useToast();
30
- * toast(({ close }) => <button onClick={() => close()}>Click me to dismiss</button>, { timeout: Infinity });
31
- * toast(<div>I will be dismissed in 3s.</div>, { timeout: 3000 });
32
- * toast("I'm placed in the topLeft of the page", { position: 'topLeft' });
33
- */
34
- export declare const useToast: () => {
35
- toast: (notification: ToastNode, config?: Config) => number;
36
- dismiss: (toastId: number) => void;
37
- info: BannerToast;
38
- success: BannerToast;
39
- error: BannerToast;
40
- warning: BannerToast;
41
- plain: BannerToast;
42
- };
43
- export {};
1
+ import './ToastProvider.scss';
2
+ import { ReactNode } from 'react';
3
+ import { ToastNode, ToastOptions } from './Helpers/ToastTypes';
4
+ type Config = ToastOptions & {
5
+ id?: number;
6
+ };
7
+ type BannerToast = (children: ReactNode, config?: Config) => number;
8
+ /**
9
+ * Hook to display pop-up messages in response to a user action or state change. Examples include: Saving, exporting, committing, deleting, etc.
10
+ * It requires 'LuiMessagingContextProvider' with property version set to 'v2'.
11
+ * Toasts that are `warning` or `error` won't timeout automatically, unless configured otherwise.
12
+ * @description Hook to trigger pop-up messages (a.k.a. toasts). Each toast helper function returns a a toast id `number` that can be used for manual dismiss or updates.
13
+ * @example
14
+ * // Error message
15
+ * const { error } = useToast();
16
+ * error("Failed to save");
17
+ * @example
18
+ * // Toast error and then turn toast into success
19
+ * const { error, success } = useToast();
20
+ * const toastId = error("Failed to save");
21
+ * success('Toast updated to success', { id: toastId });
22
+ * @example
23
+ * // Dismiss info toast that won't dismiss automatically
24
+ * const { info, dismiss } = useToast();
25
+ * const toastId = info(<a href="#">Some useful link</a>, { timeout: Infinity });
26
+ * dismiss(toastId);
27
+ * @example
28
+ * // Custom toasts accept `ReactNode` or `({ close: () => void }) => ReactNode`
29
+ * const { toast } = useToast();
30
+ * toast(({ close }) => <button onClick={() => close()}>Click me to dismiss</button>, { timeout: Infinity });
31
+ * toast(<div>I will be dismissed in 3s.</div>, { timeout: 3000 });
32
+ * toast("I'm placed in the topLeft of the page", { position: 'topLeft' });
33
+ */
34
+ export declare const useToast: () => {
35
+ toast: (notification: ToastNode, config?: Config) => number;
36
+ dismiss: (toastId: number) => void;
37
+ info: BannerToast;
38
+ success: BannerToast;
39
+ error: BannerToast;
40
+ warning: BannerToast;
41
+ plain: BannerToast;
42
+ };
43
+ export {};
@@ -1,32 +1,32 @@
1
- import { MutableRefObject } from 'react';
2
- /**
3
- * A hook which allows you to register a handler when the escape key is pressed
4
- *
5
- * @param onEscape the handler function
6
- * @param elRef a react ref to the element that should listen to the key event. If this argument is `undefined` it means the consumer wants to attach the listener to `document`. If this argument is a ref to `null` no event listener will be added.
7
- */
8
- export declare const useEscapeFunction: (onEscape: (e: KeyboardEvent) => void | Promise<void>, trigger?: 'keyup' | 'keydown', elRef?: MutableRefObject<HTMLElement | null>) => void;
9
- /**
10
- * A hook which allows handling of click event anywhere on the page.
11
- * Provides a way of handling clicks done inside or outside the element bound to the returned react ref.
12
- *
13
- * @deprecated
14
- * This hook is deprecated. It's no longer supported and will be removed in future version.
15
- *
16
- * For click inside element handling, consider attaching an `onClick` handler directly onto the element.
17
- *
18
- * For click outside element handling, consider using the `useClickedOutsideElement` hook instead.
19
- *
20
- * For click anywhere (both inside and outside) handling, consider attaching an `onClick` handler directly onto the document.
21
- *
22
- * @param onClickInsideArg handler for mouse clicks inside the element
23
- * @param onClickOutsideArg handler for mouse clicks outside the element
24
- * @return a react ref which can be bound to an html element
25
- */
26
- export declare const usePageClickFunction: <H extends Element>(onClickInsideArg: (event: MouseEvent) => void, onClickOutsideArg: (event: MouseEvent) => void) => import("react").RefObject<H | null>;
27
- /** Disables scrolling on an specified element */
28
- export declare const useDisableScroll: (el?: HTMLElement | null, shouldDisable?: boolean) => void;
29
- /**
30
- * Provides a stable ID across renders, can be replaced in react 18+ by native implementation
31
- */
32
- export declare function useId(): string;
1
+ import { MutableRefObject } from 'react';
2
+ /**
3
+ * A hook which allows you to register a handler when the escape key is pressed
4
+ *
5
+ * @param onEscape the handler function
6
+ * @param elRef a react ref to the element that should listen to the key event. If this argument is `undefined` it means the consumer wants to attach the listener to `document`. If this argument is a ref to `null` no event listener will be added.
7
+ */
8
+ export declare const useEscapeFunction: (onEscape: (e: KeyboardEvent) => void | Promise<void>, trigger?: "keyup" | "keydown", elRef?: MutableRefObject<HTMLElement | null>) => void;
9
+ /**
10
+ * A hook which allows handling of click event anywhere on the page.
11
+ * Provides a way of handling clicks done inside or outside the element bound to the returned react ref.
12
+ *
13
+ * @deprecated
14
+ * This hook is deprecated. It's no longer supported and will be removed in future version.
15
+ *
16
+ * For click inside element handling, consider attaching an `onClick` handler directly onto the element.
17
+ *
18
+ * For click outside element handling, consider using the `useClickedOutsideElement` hook instead.
19
+ *
20
+ * For click anywhere (both inside and outside) handling, consider attaching an `onClick` handler directly onto the document.
21
+ *
22
+ * @param onClickInsideArg handler for mouse clicks inside the element
23
+ * @param onClickOutsideArg handler for mouse clicks outside the element
24
+ * @return a react ref which can be bound to an html element
25
+ */
26
+ export declare const usePageClickFunction: <H extends Element>(onClickInsideArg: (event: MouseEvent) => void, onClickOutsideArg: (event: MouseEvent) => void) => import("react").RefObject<H | null>;
27
+ /** Disables scrolling on an specified element */
28
+ export declare const useDisableScroll: (el?: HTMLElement | null, shouldDisable?: boolean) => void;
29
+ /**
30
+ * Provides a stable ID across renders, can be replaced in react 18+ by native implementation
31
+ */
32
+ export declare function useId(): string;
@@ -1,7 +1,7 @@
1
- import { ClassDictionary } from 'clsx';
2
- export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
- export type Range = {
4
- from?: Size;
5
- upto?: Size;
6
- };
7
- export declare const buildHideClassDict: ({ from, upto, }: Range) => ClassDictionary;
1
+ import { ClassDictionary } from 'clsx';
2
+ export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
+ export type Range = {
4
+ from?: Size;
5
+ upto?: Size;
6
+ };
7
+ export declare const buildHideClassDict: ({ from, upto, }: Range) => ClassDictionary;
@@ -1,6 +1,6 @@
1
- /**
2
- * Open menu after render so chromatic can see it.
3
- * Place in useEffect in story. e.g. useEffect(openHeaderMenu, []);
4
- */
5
- export declare const openHeaderMenu: (menuIconClass?: string) => void;
6
- export declare const expandCollapsedContainer: () => void;
1
+ /**
2
+ * Open menu after render so chromatic can see it.
3
+ * Place in useEffect in story. e.g. useEffect(openHeaderMenu, []);
4
+ */
5
+ export declare const openHeaderMenu: (menuIconClass?: string) => void;
6
+ export declare const expandCollapsedContainer: () => void;
@@ -1,9 +1,9 @@
1
- import { Size } from './ResponsiveUtils';
2
- export type Breakpoint = Exclude<Size | 'xxl', 'xs'>;
3
- export declare const breakpoints: Record<Breakpoint, number>;
4
- export declare const breakpointQuery: {
5
- up: (bp: Breakpoint) => string;
6
- down: (bp: Breakpoint) => string;
7
- between: (bp1: Breakpoint, bp2: Breakpoint) => string;
8
- };
9
- export declare const useMediaQuery: (query: string) => boolean;
1
+ import { Size } from './ResponsiveUtils';
2
+ export type Breakpoint = Exclude<Size | 'xxl', 'xs'>;
3
+ export declare const breakpoints: Record<Breakpoint, number>;
4
+ export declare const breakpointQuery: {
5
+ up: (bp: Breakpoint) => string;
6
+ down: (bp: Breakpoint) => string;
7
+ between: (bp1: Breakpoint, bp2: Breakpoint) => string;
8
+ };
9
+ export declare const useMediaQuery: (query: string) => boolean;
@@ -1,12 +1,12 @@
1
- import React, { ChangeEvent, PropsWithChildren } from 'react';
2
- export interface LuiFilterCharactersContext {
3
- filterCharacters: (input: string | undefined) => string | undefined;
4
- filterInputEvent: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
5
- }
6
- export declare const LuiFilterCharactersContext: React.Context<LuiFilterCharactersContext>;
7
- export declare function useFilterCharacters(): LuiFilterCharactersContext;
8
- export type LuiFilterCharactersProviderProps = {
9
- filterFunction?: (input: string) => string;
10
- enabled?: boolean;
11
- };
12
- export declare const LuiFilterCharactersProvider: ({ children, filterFunction, enabled, }: PropsWithChildren<LuiFilterCharactersProviderProps>) => React.JSX.Element;
1
+ import React, { ChangeEvent, PropsWithChildren } from 'react';
2
+ export interface LuiFilterCharactersContext {
3
+ filterCharacters: (input: string | undefined) => string | undefined;
4
+ filterInputEvent: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
5
+ }
6
+ export declare const LuiFilterCharactersContext: React.Context<LuiFilterCharactersContext>;
7
+ export declare function useFilterCharacters(): LuiFilterCharactersContext;
8
+ export type LuiFilterCharactersProviderProps = {
9
+ filterFunction?: (input: string) => string;
10
+ enabled?: boolean;
11
+ };
12
+ export declare const LuiFilterCharactersProvider: ({ children, filterFunction, enabled, }: PropsWithChildren<LuiFilterCharactersProviderProps>) => React.JSX.Element;
@@ -1,14 +1,14 @@
1
- import { JSX, PropsWithChildren } from 'react';
2
- export type MessageLevel = 'success' | 'info' | 'warning' | 'error';
3
- export type MessageType = 'toast';
4
- export interface IUIMessagingContext {
5
- showMessage: (messageProps: ShowMessageProps) => void;
6
- }
7
- export declare function useShowLUIMessage(): (messageProps: ShowMessageProps) => void;
8
- export interface ShowMessageProps {
9
- message: string | JSX.Element;
10
- messageType: MessageType;
11
- messageLevel: MessageLevel;
12
- requireDismiss?: boolean;
13
- }
14
- export declare const LuiMessagingContextProvider: ({ children, }: PropsWithChildren<unknown>) => JSX.Element;
1
+ import { JSX, PropsWithChildren } from 'react';
2
+ export type MessageLevel = 'success' | 'info' | 'warning' | 'error';
3
+ export type MessageType = 'toast';
4
+ export interface IUIMessagingContext {
5
+ showMessage: (messageProps: ShowMessageProps) => void;
6
+ }
7
+ export declare function useShowLUIMessage(): (messageProps: ShowMessageProps) => void;
8
+ export interface ShowMessageProps {
9
+ message: string | JSX.Element;
10
+ messageType: MessageType;
11
+ messageLevel: MessageLevel;
12
+ requireDismiss?: boolean;
13
+ }
14
+ export declare const LuiMessagingContextProvider: ({ children, }: PropsWithChildren<unknown>) => JSX.Element;
package/dist/fonts.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import '@fontsource/open-sans/300.css';
2
- import '@fontsource/open-sans/400.css';
3
- import '@fontsource/open-sans/500.css';
4
- import '@fontsource/open-sans/600.css';
5
- import '@fontsource/open-sans/700.css';
6
- import '@fontsource/open-sans/300-italic.css';
7
- import '@fontsource/open-sans/400-italic.css';
8
- import '@fontsource/open-sans/500-italic.css';
9
- import '@fontsource/open-sans/600-italic.css';
10
- import '@fontsource/open-sans/700-italic.css';
1
+ import '@fontsource/open-sans/300.css';
2
+ import '@fontsource/open-sans/400.css';
3
+ import '@fontsource/open-sans/500.css';
4
+ import '@fontsource/open-sans/600.css';
5
+ import '@fontsource/open-sans/700.css';
6
+ import '@fontsource/open-sans/300-italic.css';
7
+ import '@fontsource/open-sans/400-italic.css';
8
+ import '@fontsource/open-sans/500-italic.css';
9
+ import '@fontsource/open-sans/600-italic.css';
10
+ import '@fontsource/open-sans/700-italic.css';
@@ -1,14 +1,14 @@
1
- export type LinzFreeTextFilterType = (value?: string | null) => string;
2
- /**
3
- * Default LINZ free text filter function.
4
- * Silently converts some invalid characters with supported alternatives.
5
- * Removes all other invalid characters.
6
- */
7
- export declare const LinzFreeTextFilter: LinzFreeTextFilterType;
8
- /**
9
- * LINZ free text filter function that leaves invalid characters intact.
10
- * Silently converts some invalid characters with supported alternatives.
11
- * Leaves all other invalid characters as is.
12
- * Should be paired with LinzFreeTextValidator to warn users about invalid characters.
13
- */
14
- export declare const LinzFreeTextFilterConvertOnly: LinzFreeTextFilterType;
1
+ export type LinzFreeTextFilterType = (value?: string | null) => string;
2
+ /**
3
+ * Default LINZ free text filter function.
4
+ * Silently converts some invalid characters with supported alternatives.
5
+ * Removes all other invalid characters.
6
+ */
7
+ export declare const LinzFreeTextFilter: LinzFreeTextFilterType;
8
+ /**
9
+ * LINZ free text filter function that leaves invalid characters intact.
10
+ * Silently converts some invalid characters with supported alternatives.
11
+ * Leaves all other invalid characters as is.
12
+ * Should be paired with LinzFreeTextValidator to warn users about invalid characters.
13
+ */
14
+ export declare const LinzFreeTextFilterConvertOnly: LinzFreeTextFilterType;
@@ -1,2 +1,2 @@
1
- export declare const LinzInvalidCharMatcher: RegExp;
2
- export declare const LinzFreeTextValidator: (value?: string | null, invalidCharMatcher?: RegExp, maxReportedChars?: number) => string | undefined;
1
+ export declare const LinzInvalidCharMatcher: RegExp;
2
+ export declare const LinzFreeTextValidator: (value?: string | null, invalidCharMatcher?: RegExp, maxReportedChars?: number) => string | undefined;
@@ -1 +1 @@
1
- export { useClickedOutsideElement } from './useClickedOutsideElement';
1
+ export { useClickedOutsideElement } from './useClickedOutsideElement';
@@ -1,14 +1,14 @@
1
- import { MutableRefObject, RefObject } from 'react';
2
- /**
3
- * This hook will callback with handleClickOutside() when "mousedown" dom event occurs off the refElement
4
- * usage:
5
- ```typescript
6
- const refElement = React.useRef<HTMLButtonElement>(null);
7
- const handleClickOutside = () => {
8
- console.log("hello world");
9
- };
10
- useClickedOutsideElement(refElement, handleClickOutside);
11
- return <button ref={refElement}>Click Me!</button>;
12
- ```
13
- */
14
- export declare function useClickedOutsideElement(refElement: RefObject<HTMLElement | null> | MutableRefObject<HTMLElement | null>, handleClickOutside: CallableFunction): void;
1
+ import { MutableRefObject, RefObject } from 'react';
2
+ /**
3
+ * This hook will callback with handleClickOutside() when "mousedown" dom event occurs off the refElement
4
+ * usage:
5
+ ```typescript
6
+ const refElement = React.useRef<HTMLButtonElement>(null);
7
+ const handleClickOutside = () => {
8
+ console.log("hello world");
9
+ };
10
+ useClickedOutsideElement(refElement, handleClickOutside);
11
+ return <button ref={refElement}>Click Me!</button>;
12
+ ```
13
+ */
14
+ export declare function useClickedOutsideElement(refElement: RefObject<HTMLElement | null> | MutableRefObject<HTMLElement | null>, handleClickOutside: CallableFunction): void;
@@ -1 +1 @@
1
- export declare function useDeprecatedWarning(componentName: string): void;
1
+ export declare function useDeprecatedWarning(componentName: string): void;