@lumx/react 3.20.1-alpha.36 → 3.20.1-alpha.37

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 (105) hide show
  1. package/index.js +13990 -64
  2. package/index.js.map +1 -0
  3. package/package.json +3 -3
  4. package/utils/index.js +159 -3
  5. package/utils/index.js.map +1 -0
  6. package/_internal/035c132d.js +0 -314
  7. package/_internal/0b9c76cb.js +0 -5
  8. package/_internal/0ea95af1.js +0 -819
  9. package/_internal/230173a8.js +0 -12
  10. package/_internal/2a3d237c.js +0 -11
  11. package/_internal/2c2b6a89.js +0 -51
  12. package/_internal/3181f000.js +0 -13
  13. package/_internal/36bd7352.js +0 -218
  14. package/_internal/3864a6c1.js +0 -436
  15. package/_internal/3a1facc0.js +0 -17
  16. package/_internal/49bbeed3.js +0 -5
  17. package/_internal/4daccdd5.js +0 -24
  18. package/_internal/4f4c0582.js +0 -2169
  19. package/_internal/5cef5e8c.js +0 -74
  20. package/_internal/6a60381c.js +0 -117
  21. package/_internal/6f084a40.js +0 -111
  22. package/_internal/76ddefd4.js +0 -61
  23. package/_internal/78df9309.js +0 -19
  24. package/_internal/7ad474e4.js +0 -98
  25. package/_internal/7b293665.js +0 -19
  26. package/_internal/7daf0f24.js +0 -76
  27. package/_internal/825ac334.js +0 -129
  28. package/_internal/827b804a.js +0 -5
  29. package/_internal/8bce732e.js +0 -8
  30. package/_internal/9d1336a1.js +0 -18
  31. package/_internal/a38bdcd0.js +0 -49
  32. package/_internal/b326655a.js +0 -682
  33. package/_internal/b83e864b.js +0 -76
  34. package/_internal/bace1bf1.js +0 -103
  35. package/_internal/c57190eb.js +0 -146
  36. package/_internal/components/alert-dialog/index-284fed80.js +0 -163
  37. package/_internal/components/autocomplete/__mockData__/index-96fc7ea7.js +0 -27
  38. package/_internal/components/autocomplete/index-27a49d5d.js +0 -261
  39. package/_internal/components/avatar/index-b8bc3cae.js +0 -83
  40. package/_internal/components/badge/index-9880f056.js +0 -81
  41. package/_internal/components/button/index-d919f96d.js +0 -47
  42. package/_internal/components/checkbox/index-dd478de9.js +0 -143
  43. package/_internal/components/chip/index-7f84cdbd.js +0 -102
  44. package/_internal/components/comment-block/index-e942de30.js +0 -138
  45. package/_internal/components/date-picker/index-a258d3ce.js +0 -596
  46. package/_internal/components/dialog/index-c7066813.js +0 -238
  47. package/_internal/components/divider/index-b6934baf.js +0 -50
  48. package/_internal/components/drag-handle/index-80e5af6c.js +0 -52
  49. package/_internal/components/dropdown/index-cebfc268.js +0 -147
  50. package/_internal/components/expansion-panel/index-9d45a211.js +0 -167
  51. package/_internal/components/flag/index-33e9d909.js +0 -59
  52. package/_internal/components/flex-box/index-0d6b6b43.js +0 -56
  53. package/_internal/components/generic-block/index-836c4352.js +0 -124
  54. package/_internal/components/grid/index-8c16a4f1.js +0 -104
  55. package/_internal/components/grid-column/index-4a2f56bb.js +0 -59
  56. package/_internal/components/heading/index-fd558a9a.js +0 -53
  57. package/_internal/components/icon/index-e7b9b40e.js +0 -1
  58. package/_internal/components/image-block/index-7021c2f1.js +0 -110
  59. package/_internal/components/image-lightbox/index-27017547.js +0 -759
  60. package/_internal/components/inline-list/index-52efec7f.js +0 -74
  61. package/_internal/components/input-helper/index-5a837e7c.js +0 -71
  62. package/_internal/components/input-label/index-0113f382.js +0 -59
  63. package/_internal/components/lightbox/index-fad5a9f2.js +0 -155
  64. package/_internal/components/link/index-008bae4b.js +0 -72
  65. package/_internal/components/link-preview/index-3e9c32f2.js +0 -117
  66. package/_internal/components/list/index-da88c6e9.js +0 -71
  67. package/_internal/components/message/index-17b568f2.js +0 -98
  68. package/_internal/components/mosaic/index-2d40e01c.js +0 -95
  69. package/_internal/components/navigation/index-dc17c639.js +0 -225
  70. package/_internal/components/notification/index-a1101015.js +0 -146
  71. package/_internal/components/popover/index-dbca63f1.js +0 -2
  72. package/_internal/components/popover-dialog/index-654d2abc.js +0 -66
  73. package/_internal/components/post-block/index-4b6b4dcb.js +0 -109
  74. package/_internal/components/progress/index-6f578c31.js +0 -182
  75. package/_internal/components/progress-tracker/index-700bc4c2.js +0 -309
  76. package/_internal/components/radio-button/index-89b725af.js +0 -149
  77. package/_internal/components/select/index-2755aa32.js +0 -458
  78. package/_internal/components/side-navigation/index-0bbe1fdd.js +0 -165
  79. package/_internal/components/skeleton/index-b2f8501c.js +0 -166
  80. package/_internal/components/slider/index-4f9b891b.js +0 -311
  81. package/_internal/components/slideshow/index-d4604589.js +0 -150
  82. package/_internal/components/switch/index-58fe0f0c.js +0 -122
  83. package/_internal/components/table/index-d541aa88.js +0 -297
  84. package/_internal/components/tabs/index-af1538d6.js +0 -298
  85. package/_internal/components/text/index-5bfc6d5e.js +0 -1
  86. package/_internal/components/text-field/index-47c98d09.js +0 -360
  87. package/_internal/components/thumbnail/index-71545d95.js +0 -41
  88. package/_internal/components/toolbar/index-7041a5a6.js +0 -61
  89. package/_internal/components/tooltip/index-8bb97e60.js +0 -327
  90. package/_internal/components/uploader/index-8f6f55de.js +0 -153
  91. package/_internal/components/user-block/index-70d4ce8f.js +0 -145
  92. package/_internal/d0e3f49e.js +0 -23
  93. package/_internal/de24f857.js +0 -3
  94. package/_internal/e806b848.js +0 -8
  95. package/_internal/e913a3af.js +0 -117
  96. package/_internal/ea04260d.js +0 -28
  97. package/_internal/eaf6c45a.js +0 -3
  98. package/_internal/ebdcb0c7.js +0 -60
  99. package/_internal/ef5d1aac.js +0 -3
  100. package/_internal/f0d7d6ea.js +0 -29
  101. package/_internal/utils/ClickAwayProvider/index-1234ce76.js +0 -94
  102. package/_internal/utils/MaterialThemeSwitcher/index-8d22de5a.js +0 -48
  103. package/_internal/utils/Portal/index-6e0a7404.js +0 -44
  104. package/_internal/utils/disabled/index-075b99c3.js +0 -36
  105. package/_internal/utils/type/index-ea9fc197.js +0 -2
@@ -1,129 +0,0 @@
1
- import { createContext, useContext, useEffect, useMemo, useCallback } from 'react';
2
- import { u as useId } from './3a1facc0.js';
3
-
4
- const INIT_STATE = {
5
- isLazy: true,
6
- shouldActivateOnFocus: false,
7
- activeTabIndex: 0,
8
- ids: {
9
- tab: [],
10
- tabPanel: []
11
- }
12
- };
13
- const reducer = (state, action) => {
14
- switch (action.type) {
15
- case 'update':
16
- return {
17
- ...state,
18
- ...action.payload
19
- };
20
- case 'setActiveTabIndex':
21
- {
22
- if (state.activeTabIndex === action.payload) {
23
- return state;
24
- }
25
- // Change active tab index.
26
- return {
27
- ...state,
28
- activeTabIndex: action.payload
29
- };
30
- }
31
- case 'register':
32
- {
33
- const {
34
- type,
35
- id
36
- } = action.payload;
37
- // Append tab/tabPanel id in state.
38
- return {
39
- ...state,
40
- ids: {
41
- ...state.ids,
42
- [type]: [...state.ids[type], id]
43
- }
44
- };
45
- }
46
- case 'unregister':
47
- {
48
- const {
49
- type,
50
- id
51
- } = action.payload;
52
- const index = state.ids[type].indexOf(id);
53
- if (index === -1) return state;
54
- // Remove tab & tab panel at index.
55
- const tabIds = [...state.ids.tab];
56
- tabIds.splice(index, 1);
57
- const tabPanelIds = [...state.ids.tabPanel];
58
- tabPanelIds.splice(index, 1);
59
- return {
60
- ...state,
61
- ids: {
62
- tab: tabIds,
63
- tabPanel: tabPanelIds
64
- }
65
- };
66
- }
67
- default:
68
- return state;
69
- }
70
- };
71
- const TabProviderContext = /*#__PURE__*/createContext(null);
72
- /* eslint-disable react-hooks/rules-of-hooks */
73
- const useTabProviderContext = (type, originalId) => {
74
- const context = useContext(TabProviderContext);
75
- if (!context) {
76
- return undefined;
77
- }
78
- const [state, dispatch] = context;
79
-
80
- // Current tab or tab panel id.
81
- const generatedId = useId();
82
- const id = originalId || generatedId;
83
- useEffect(() => {
84
- // On mount: register tab or tab panel id.
85
- dispatch({
86
- type: 'register',
87
- payload: {
88
- type,
89
- id
90
- }
91
- });
92
- return () => {
93
- // On unmount: unregister tab or tab panel id.
94
- dispatch({
95
- type: 'unregister',
96
- payload: {
97
- type,
98
- id
99
- }
100
- });
101
- };
102
- },
103
- // eslint-disable-next-line react-hooks/exhaustive-deps
104
- []);
105
-
106
- // Find tab/tabPanel index using it's id.
107
- const index = useMemo(() => state.ids[type].indexOf(id), [state.ids, type, id]);
108
- const tabId = useMemo(() => state.ids.tab[index] || '', [state, index]);
109
- const tabPanelId = useMemo(() => state.ids.tabPanel[index] || '', [state, index]);
110
- const isActive = useMemo(() => state.activeTabIndex === index, [state, index]);
111
- const changeToTab = useCallback(() => dispatch({
112
- type: 'setActiveTabIndex',
113
- payload: index
114
- }), [dispatch, index]);
115
- return {
116
- isLazy: state.isLazy,
117
- shouldActivateOnFocus: state.shouldActivateOnFocus,
118
- tabId,
119
- tabPanelId,
120
- isActive,
121
- changeToTab
122
- };
123
- };
124
- const useTabProviderContextState = () => {
125
- const context = useContext(TabProviderContext);
126
- return context?.[0];
127
- };
128
-
129
- export { INIT_STATE as I, TabProviderContext as T, useTabProviderContext as a, reducer as r, useTabProviderContextState as u };
@@ -1,5 +0,0 @@
1
- const mdiChevronLeft = 'M15.41 16.58 10.83 12l4.58-4.59L14 6l-6 6 6 6z';
2
-
3
- const mdiChevronRight = 'M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6z';
4
-
5
- export { mdiChevronRight as a, mdiChevronLeft as m };
@@ -1,8 +0,0 @@
1
- import React__default from 'react';
2
-
3
- /**
4
- * React.forwardRef but re-typed to attach some custom metadata on our components.
5
- */
6
- const forwardRef = React__default.forwardRef;
7
-
8
- export { forwardRef as f };
@@ -1,18 +0,0 @@
1
- import React__default from 'react';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const DEFAULT_VALUE = {};
5
-
6
- /**
7
- * Tooltip react context simply used as a marker to know when parent react node have a tooltip
8
- */
9
- const TooltipContext = /*#__PURE__*/React__default.createContext(undefined);
10
- const TooltipContextProvider = ({
11
- children
12
- }) => /*#__PURE__*/jsx(TooltipContext.Provider, {
13
- value: DEFAULT_VALUE,
14
- children: children
15
- });
16
- const useTooltipContext = () => React__default.useContext(TooltipContext);
17
-
18
- export { TooltipContextProvider as T, useTooltipContext as u };
@@ -1,49 +0,0 @@
1
- import { useState, useRef, useEffect } from 'react';
2
- import { W as WINDOW } from './d0e3f49e.js';
3
-
4
- /** Check if user prefers reduced motion */
5
- function isReducedMotion() {
6
- return WINDOW?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
7
- }
8
-
9
- /**
10
- * Returns true if the component is visible tracking the opacity transition.
11
- *
12
- * @param ref Element on which to listen the transition event.
13
- * @param isComponentVisible Whether the component intends to be visible or not.
14
- * @param onVisibilityChange Callback called when the visibility changes.
15
- * @return true if the component should be rendered
16
- */
17
- const useTransitionVisibility = (ref, isComponentVisible, timeout, onVisibilityChange) => {
18
- const [isVisible, setVisible] = useState(isComponentVisible);
19
- const previousVisibility = useRef(isVisible);
20
-
21
- // On component visibility change.
22
- useEffect(() => {
23
- if (isComponentVisible) {
24
- setVisible(true);
25
- return undefined;
26
- }
27
- const {
28
- current: element
29
- } = ref;
30
-
31
- // Transition event is not supported or the user prefers reduced motion.
32
- // => Skip and set visibility to false directly.
33
- if (!element || !window.TransitionEvent || isReducedMotion()) {
34
- setVisible(false);
35
- return undefined;
36
- }
37
- const timer = setTimeout(() => setVisible(false), timeout);
38
- return () => clearTimeout(timer);
39
- }, [isComponentVisible, ref, timeout]);
40
- useEffect(() => {
41
- if (onVisibilityChange && previousVisibility.current !== isVisible) {
42
- onVisibilityChange(isVisible);
43
- previousVisibility.current = isVisible;
44
- }
45
- }, [isVisible, onVisibilityChange]);
46
- return isVisible || isComponentVisible;
47
- };
48
-
49
- export { isReducedMotion as i, useTransitionVisibility as u };