@lumx/react 3.10.1-alpha.1 → 3.10.1-alpha.3

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 (64) hide show
  1. package/_internal/index.d.ts +1 -1
  2. package/_internal/index.js +99 -0
  3. package/_internal/index.js.map +1 -0
  4. package/index.d.ts +34 -57
  5. package/index.js +125 -107
  6. package/index.js.map +1 -1
  7. package/package.json +3 -3
  8. package/src/components/button/Button.tsx +4 -5
  9. package/src/components/button/ButtonRoot.tsx +1 -3
  10. package/src/components/chip/Chip.tsx +6 -10
  11. package/src/components/dialog/Dialog.tsx +1 -1
  12. package/src/components/expansion-panel/ExpansionPanel.tsx +14 -18
  13. package/src/components/flex-box/FlexBox.tsx +1 -1
  14. package/src/components/generic-block/GenericBlock.tsx +6 -7
  15. package/src/components/generic-block/constants.ts +9 -4
  16. package/src/components/grid-column/GridColumn.tsx +1 -2
  17. package/src/components/link/Link.tsx +3 -5
  18. package/src/components/list/ListItem.tsx +1 -2
  19. package/src/components/list/useInteractiveList.tsx +1 -2
  20. package/src/components/mosaic/Mosaic.test.tsx +3 -3
  21. package/src/components/mosaic/Mosaic.tsx +2 -3
  22. package/src/components/navigation/Navigation.tsx +42 -37
  23. package/src/components/navigation/NavigationSection.tsx +76 -79
  24. package/src/components/notification/Notification.tsx +1 -5
  25. package/src/components/post-block/PostBlock.tsx +4 -8
  26. package/src/components/progress-tracker/ProgressTracker.stories.tsx +11 -11
  27. package/src/components/select/Select.stories.tsx +14 -5
  28. package/src/components/select/Select.tsx +1 -2
  29. package/src/components/select/SelectMultiple.stories.tsx +12 -10
  30. package/src/components/side-navigation/SideNavigationItem.tsx +1 -1
  31. package/src/components/slideshow/Slides.tsx +1 -1
  32. package/src/components/slideshow/SlideshowControls.tsx +1 -1
  33. package/src/components/switch/Switch.tsx +1 -2
  34. package/src/components/tabs/Tabs.stories.tsx +3 -4
  35. package/src/components/text-field/TextField.test.tsx +2 -2
  36. package/src/components/text-field/TextField.tsx +2 -3
  37. package/src/components/user-block/UserBlock.tsx +7 -9
  38. package/src/hooks/useClickAway.tsx +1 -2
  39. package/src/hooks/useInterval.tsx +1 -4
  40. package/src/hooks/useKeyboardListNavigation.tsx +2 -4
  41. package/src/hooks/useStopPropagation.ts +1 -2
  42. package/src/stories/decorators/withCombinations.tsx +1 -1
  43. package/src/testing/utils/commonTestsSuiteRTL.tsx +2 -2
  44. package/src/utils/collection/castArray.test.ts +15 -0
  45. package/src/utils/collection/castArray.ts +3 -0
  46. package/src/utils/collection/chunk.test.ts +15 -0
  47. package/src/utils/collection/chunk.ts +6 -0
  48. package/src/utils/collection/isEmpty.test.js +20 -0
  49. package/src/utils/collection/isEmpty.ts +4 -0
  50. package/src/utils/collection/last.ts +2 -0
  51. package/src/utils/collection/partitionMulti.test.ts +35 -0
  52. package/src/utils/{partitionMulti.ts → collection/partitionMulti.ts} +13 -12
  53. package/src/utils/collection/pull.test.ts +17 -0
  54. package/src/utils/collection/pull.ts +7 -0
  55. package/src/utils/collection/range.test.js +9 -0
  56. package/src/utils/collection/range.ts +2 -0
  57. package/src/utils/date/getMonthCalendar.ts +3 -4
  58. package/src/utils/flattenChildren.ts +2 -3
  59. package/src/utils/makeListenerTowerContext.ts +2 -2
  60. package/src/utils/react/forwardRef.ts +3 -2
  61. package/src/utils/react/forwardRefPolymorphic.ts +1 -2
  62. package/src/utils/utils.test.ts +0 -27
  63. package/utils/index.js +1 -96
  64. package/utils/index.js.map +1 -1
@@ -282,4 +282,4 @@ declare const WhiteSpace: {
282
282
  };
283
283
  type WhiteSpace = ValueOf<typeof WhiteSpace>;
284
284
 
285
- export { Alignment as A, type Comp as C, Emphasis as E, type Falsy as F, type GenericProps as G, type HasTheme as H, Kind as K, Orientation as O, Size as S, Typography as T, type ValueOf as V, WhiteSpace as W, type HorizontalAlignment as a, ColorPalette as b, type VerticalAlignment as c, ColorVariant as d, type TextElement as e, type HeadingElement as f, AspectRatio as g, type HasClassName as h, type HasAriaLabelOrLabelledBy as i, type ComponentRef as j, type HasCloseMode as k, type GlobalSize as l, TypographyInterface as m, Theme as n, type Color as o, TypographyTitleCustom as p, TypographyCustom as q, type Callback as r };
285
+ export { Alignment as A, type Comp as C, Emphasis as E, type Falsy as F, type GenericProps as G, type HasTheme as H, Kind as K, Orientation as O, Size as S, Typography as T, type ValueOf as V, WhiteSpace as W, type HorizontalAlignment as a, ColorPalette as b, type VerticalAlignment as c, ColorVariant as d, type TextElement as e, type HeadingElement as f, AspectRatio as g, type HasClassName as h, type ComponentRef as i, type HasAriaLabelOrLabelledBy as j, type HasCloseMode as k, type GlobalSize as l, TypographyInterface as m, Theme as n, type Color as o, TypographyTitleCustom as p, TypographyCustom as q, type Callback as r };
@@ -0,0 +1,99 @@
1
+ import React__default, { useEffect, useContext, useMemo, useRef, createContext } from 'react';
2
+
3
+ /** Check if object or array is empty (true on falsy values) */
4
+ const isEmpty = obj => !obj || Object.entries(obj).length === 0;
5
+
6
+ const EVENT_TYPES = ['mousedown', 'touchstart'];
7
+ function isClickAway(target, refs) {
8
+ // The target element is not contained in any of the listed element references.
9
+ return !refs.some(e => {
10
+ var _e$current;
11
+ return e === null || e === void 0 ? void 0 : (_e$current = e.current) === null || _e$current === void 0 ? void 0 : _e$current.contains(target);
12
+ });
13
+ }
14
+ /**
15
+ * Listen to clicks away from the given elements and callback the passed in function.
16
+ *
17
+ * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.
18
+ */
19
+ function useClickAway(_ref) {
20
+ let {
21
+ callback,
22
+ childrenRefs
23
+ } = _ref;
24
+ useEffect(() => {
25
+ const {
26
+ current: currentRefs
27
+ } = childrenRefs;
28
+ if (!callback || !currentRefs || isEmpty(currentRefs)) {
29
+ return undefined;
30
+ }
31
+ const listener = evt => {
32
+ if (isClickAway(evt.target, currentRefs)) {
33
+ callback(evt);
34
+ }
35
+ };
36
+ EVENT_TYPES.forEach(evtType => document.addEventListener(evtType, listener));
37
+ return () => {
38
+ EVENT_TYPES.forEach(evtType => document.removeEventListener(evtType, listener));
39
+ };
40
+ }, [callback, childrenRefs]);
41
+ }
42
+
43
+ const ClickAwayAncestorContext = /*#__PURE__*/createContext(null);
44
+ /**
45
+ * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure
46
+ * we take into account both the DOM tree and the React tree to detect click away.
47
+ *
48
+ * @return the react component.
49
+ */
50
+ const ClickAwayProvider = _ref => {
51
+ let {
52
+ children,
53
+ callback,
54
+ childrenRefs,
55
+ parentRef
56
+ } = _ref;
57
+ const parentContext = useContext(ClickAwayAncestorContext);
58
+ const currentContext = useMemo(() => {
59
+ const context = {
60
+ childrenRefs: [],
61
+ /**
62
+ * Add element refs to the current context and propagate to the parent context.
63
+ */
64
+ addRefs() {
65
+ // Add element refs that should be considered as inside the click away context.
66
+ context.childrenRefs.push(...arguments);
67
+ if (parentContext) {
68
+ // Also add then to the parent context
69
+ parentContext.addRefs(...arguments);
70
+ if (parentRef) {
71
+ // The parent element is also considered as inside the parent click away context but not inside the current context
72
+ parentContext.addRefs(parentRef);
73
+ }
74
+ }
75
+ }
76
+ };
77
+ return context;
78
+ }, [parentContext, parentRef]);
79
+ useEffect(() => {
80
+ const {
81
+ current: currentRefs
82
+ } = childrenRefs;
83
+ if (!currentRefs) {
84
+ return;
85
+ }
86
+ currentContext.addRefs(...currentRefs);
87
+ }, [currentContext, childrenRefs]);
88
+ useClickAway({
89
+ callback,
90
+ childrenRefs: useRef(currentContext.childrenRefs)
91
+ });
92
+ return /*#__PURE__*/React__default.createElement(ClickAwayAncestorContext.Provider, {
93
+ value: currentContext
94
+ }, children);
95
+ };
96
+ ClickAwayProvider.displayName = 'ClickAwayProvider';
97
+
98
+ export { ClickAwayProvider as C, isEmpty as i };
99
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/utils/collection/isEmpty.ts","../../src/hooks/useClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx"],"sourcesContent":["import { Falsy } from '../type';\n\n/** Check if object or array is empty (true on falsy values) */\nexport const isEmpty = (obj: object | Falsy) => !obj || Object.entries(obj).length === 0;\n","import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\nimport { isEmpty } from '@lumx/react/utils/collection/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(target: HTMLElement, refs: Array<RefObject<HTMLElement>>): boolean {\n // The target element is not contained in any of the listed element references.\n return !refs.some((e) => e?.current?.contains(target));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n if (isClickAway(evt.target as HTMLElement, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import React, { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n"],"names":["isEmpty","obj","Object","entries","length","EVENT_TYPES","isClickAway","target","refs","some","e","_e$current","current","contains","useClickAway","_ref","callback","childrenRefs","useEffect","currentRefs","undefined","listener","evt","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","createContext","ClickAwayProvider","children","parentRef","parentContext","useContext","currentContext","useMemo","context","addRefs","push","arguments","useRef","React","createElement","Provider","value","displayName"],"mappings":";;AAEA;MACaA,OAAO,GAAIC,GAAmB,IAAK,CAACA,GAAG,IAAIC,MAAM,CAACC,OAAO,CAACF,GAAG,CAAC,CAACG,MAAM,KAAK;;ACEvF,MAAMC,WAAW,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AAE/C,SA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1C,GAAC,EAAE,CAACgB,cAAc,EAAElB,YAAY,CAAC,CAAC,CAAA;AAElCH,EAAAA,YAAY,CAAC;IAAEE,QAAQ;AAAEC,IAAAA,YAAY,EAAEwB,MAAM,CAACN,cAAc,CAAClB,YAAY,CAAA;AAAE,GAAC,CAAC,CAAA;AAC7E,EAAA,oBAAOyB,cAAA,CAAAC,aAAA,CAACf,wBAAwB,CAACgB,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEV,cAAAA;AAAe,GAAA,EAAEJ,QAA4C,CAAC,CAAA;AACnH,EAAC;AACDD,iBAAiB,CAACgB,WAAW,GAAG,mBAAmB;;;;"}
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { K as Kind, C as Comp, G as GenericProps, H as HasTheme, a as HorizontalAlignment, S as Size, b as ColorPalette, E as Emphasis, V as ValueOf, A as Alignment, c as VerticalAlignment, O as Orientation, d as ColorVariant, T as Typography, e as TextElement, W as WhiteSpace, f as HeadingElement, g as AspectRatio, F as Falsy, h as HasClassName, i as HasAriaLabelOrLabelledBy, j as ComponentRef, k as HasCloseMode, l as GlobalSize, m as TypographyInterface, n as Theme } from './_internal/index.js';
1
+ import { K as Kind, C as Comp, G as GenericProps, H as HasTheme, a as HorizontalAlignment, S as Size, b as ColorPalette, E as Emphasis, V as ValueOf, A as Alignment, c as VerticalAlignment, O as Orientation, d as ColorVariant, T as Typography, e as TextElement, W as WhiteSpace, f as HeadingElement, g as AspectRatio, F as Falsy, h as HasClassName, i as ComponentRef, j as HasAriaLabelOrLabelledBy, k as HasCloseMode, l as GlobalSize, m as TypographyInterface, n as Theme } from './_internal/index.js';
2
2
  export { r as Callback, o as Color, q as TypographyCustom, p as TypographyTitleCustom } from './_internal/index.js';
3
3
  import React, { ReactNode, SyntheticEvent, ReactElement, MouseEventHandler, KeyboardEventHandler, AriaAttributes, DetailedHTMLProps, ButtonHTMLAttributes, InputHTMLAttributes, Ref, RefObject, ImgHTMLAttributes, CSSProperties, SetStateAction, Key } from 'react';
4
4
 
@@ -989,24 +989,13 @@ interface FlexBoxProps extends GenericProps {
989
989
  */
990
990
  declare const FlexBox: Comp<FlexBoxProps, HTMLDivElement>;
991
991
 
992
+ type GenericBlockGapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;
992
993
  /**
993
994
  * Accepted gap sizes for the generic block.
994
995
  */
995
- declare const GenericBlockGapSize: Pick<{
996
- readonly xxs: "xxs";
997
- readonly xs: "xs";
998
- readonly s: "s";
999
- readonly m: "m";
1000
- readonly l: "l";
1001
- readonly xl: "xl";
1002
- readonly xxl: "xxl";
1003
- readonly tiny: "tiny";
1004
- readonly regular: "regular";
1005
- readonly medium: "medium";
1006
- readonly big: "big";
1007
- readonly huge: "huge";
1008
- }, "big" | "tiny" | "regular" | "medium" | "huge">;
1009
- type GenericBlockGapSize = ValueOf<typeof GenericBlockGapSize>;
996
+ declare const GenericBlockGapSize: {
997
+ [S in GenericBlockGapSize]: S;
998
+ };
1010
999
 
1011
1000
  interface GenericBlockProps extends FlexBoxProps {
1012
1001
  /**
@@ -1822,57 +1811,45 @@ declare const Mosaic: Comp<MosaicProps, HTMLDivElement>;
1822
1811
 
1823
1812
  interface NavigationSectionProps extends React.ComponentPropsWithoutRef<'button'>, HasClassName {
1824
1813
  /** Items inside the section */
1825
- children: ReactNode;
1814
+ children: React.ReactNode;
1826
1815
  /** Icon (SVG path). */
1827
1816
  icon?: string;
1828
1817
  /** Label content. */
1829
- label: string | ReactNode;
1818
+ label: string | React.ReactNode;
1830
1819
  }
1820
+ declare const NavigationSection: Comp<NavigationSectionProps, HTMLLIElement>;
1821
+
1822
+ type BaseNavigationItemProps = {
1823
+ /** Icon (SVG path). */
1824
+ icon?: string;
1825
+ /** Label content. */
1826
+ label: ReactNode;
1827
+ /** Mark as the current page link */
1828
+ isCurrentPage?: boolean;
1829
+ };
1830
+ /** Make `href` required when `as` is `a` */
1831
+ type RequiredLinkHref<E> = E extends 'a' ? {
1832
+ href: string;
1833
+ } : Record<string, unknown>;
1834
+ declare const NavigationItem: (<E extends React.ElementType = "a">(props: React.PropsWithoutRef<React.ComponentProps<E>> & {
1835
+ as?: E | undefined;
1836
+ } & HasTheme & HasClassName & BaseNavigationItemProps & RequiredLinkHref<E> & React.ComponentProps<E> & {
1837
+ ref?: ComponentRef<E> | undefined;
1838
+ }) => React.JSX.Element) & {
1839
+ displayName: string;
1840
+ className: string;
1841
+ };
1831
1842
 
1832
1843
  type NavigationProps = React.ComponentProps<'nav'> & HasClassName & HasTheme & {
1833
1844
  /** Content of the navigation. These components should be of type NavigationItem to be rendered */
1834
- children?: ReactNode;
1845
+ children?: React.ReactNode;
1835
1846
  orientation?: Orientation;
1836
1847
  } & HasAriaLabelOrLabelledBy;
1837
- declare const Navigation: React.ForwardRefExoticComponent<(Omit<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & HasClassName & HasTheme & {
1838
- /** Content of the navigation. These components should be of type NavigationItem to be rendered */
1839
- children?: ReactNode;
1840
- orientation?: Orientation | undefined;
1841
- } & {
1842
- 'aria-label': string;
1843
- 'aria-labelledby'?: undefined;
1844
- }, "ref"> | Omit<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & HasClassName & HasTheme & {
1845
- /** Content of the navigation. These components should be of type NavigationItem to be rendered */
1846
- children?: ReactNode;
1847
- orientation?: Orientation | undefined;
1848
- } & {
1849
- 'aria-labelledby': string;
1850
- 'aria-label'?: undefined;
1851
- }, "ref">) & React.RefAttributes<HTMLElement>> & {
1852
- displayName: string;
1853
- className: string;
1854
- defaultProps: {
1855
- orientation: "vertical";
1856
- };
1857
- Section: React.ForwardRefExoticComponent<NavigationSectionProps & React.RefAttributes<HTMLLIElement>> & {
1858
- displayName: string;
1859
- className: string;
1860
- };
1861
- Item: (<E extends React.ElementType = "a">(props: React.PropsWithoutRef<React.ComponentProps<E>> & {
1862
- as?: E | undefined;
1863
- } & HasTheme & HasClassName & {
1864
- icon?: string | undefined;
1865
- label: React.ReactNode;
1866
- isCurrentPage?: boolean | undefined;
1867
- } & (E extends "a" ? {
1868
- href: string;
1869
- } : Record<string, unknown>) & {
1870
- ref?: ComponentRef<E> | undefined;
1871
- }) => React.ReactNode) & {
1872
- displayName: string;
1873
- className: string;
1874
- };
1848
+ type SubComponents = {
1849
+ Section: typeof NavigationSection;
1850
+ Item: typeof NavigationItem;
1875
1851
  };
1852
+ declare const Navigation: Comp<NavigationProps, HTMLElement> & SubComponents;
1876
1853
 
1877
1854
  /**
1878
1855
  * Defines the props of the component.