@arc-ui/components 11.24.2 → 11.26.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 (67) hide show
  1. package/dist/Button/Button.cjs.js +1 -1
  2. package/dist/Button/Button.esm.js +1 -1
  3. package/dist/DatePicker/DatePicker.cjs.js +1276 -22
  4. package/dist/DatePicker/DatePicker.esm.js +1245 -10
  5. package/dist/InformationCard/InformationCard.cjs.js +1 -1
  6. package/dist/InformationCard/InformationCard.esm.js +1 -1
  7. package/dist/Modal/Modal.cjs.js +438 -225
  8. package/dist/Modal/Modal.esm.js +420 -225
  9. package/dist/PaginationSimple/PaginationSimple.cjs.js +23 -2
  10. package/dist/PaginationSimple/PaginationSimple.esm.js +23 -2
  11. package/dist/Select/Select.cjs.js +1514 -1065
  12. package/dist/Select/Select.esm.js +1496 -1066
  13. package/dist/SiteHeader/SiteHeader.cjs.js +2 -2
  14. package/dist/SiteHeader/SiteHeader.esm.js +2 -2
  15. package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +2 -2
  16. package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +2 -2
  17. package/dist/Tabs/Tabs.cjs.js +4 -6
  18. package/dist/Tabs/Tabs.esm.js +4 -6
  19. package/dist/TextArea/TextArea.cjs.js +10 -13
  20. package/dist/TextArea/TextArea.esm.js +10 -13
  21. package/dist/Toast/Toast.cjs.js +4 -6
  22. package/dist/Toast/Toast.esm.js +4 -6
  23. package/dist/UniversalHeader/UniversalHeader.cjs.js +2 -2
  24. package/dist/UniversalHeader/UniversalHeader.esm.js +2 -2
  25. package/dist/_shared/cjs/{Button-6ba21d3b.js → Button-5b28f0ce.js} +3 -3
  26. package/dist/_shared/cjs/{SiteHeader.rehydrator-9d8f3dad.js → SiteHeader.rehydrator-8fa9d174.js} +1 -1
  27. package/dist/_shared/cjs/{SiteHeaderV2-ce1c8737.js → SiteHeaderV2-ca2f13a8.js} +1 -1
  28. package/dist/_shared/cjs/{Tabs-bc9fac46.js → Tabs-89455281.js} +19 -15
  29. package/dist/_shared/cjs/{Toast-26207fef.js → Toast-c760c89d.js} +32 -14
  30. package/dist/_shared/cjs/{UniversalHeader-b8389447.js → UniversalHeader-73e154eb.js} +6 -2
  31. package/dist/_shared/cjs/component-4979b2e7.js +409 -0
  32. package/dist/_shared/cjs/{index-77ab5c6a.js → floating-ui.react-dom-08b8b87c.js} +12 -284
  33. package/dist/_shared/cjs/index-1efbba95.js +1252 -0
  34. package/dist/_shared/cjs/{index-74004a9c.js → index-4edec793.js} +1 -1
  35. package/dist/_shared/cjs/{index-dd1d18ea.js → index-7641213c.js} +127 -2
  36. package/dist/_shared/cjs/{index-9f99d686.js → index-af744fa9.js} +1 -1
  37. package/dist/_shared/cjs/{index-6eb396a3.js → index-fb0cad18.js} +1 -1
  38. package/dist/_shared/esm/{Button-a7d134c6.js → Button-5b48b7ce.js} +3 -3
  39. package/dist/_shared/esm/{SiteHeader.rehydrator-2ec02ee7.js → SiteHeader.rehydrator-8f3c5d6e.js} +1 -1
  40. package/dist/_shared/esm/{SiteHeaderV2-a7c1b1cb.js → SiteHeaderV2-cb081752.js} +1 -1
  41. package/dist/_shared/esm/{Tabs-9485cab6.js → Tabs-959e885d.js} +10 -6
  42. package/dist/_shared/esm/{Toast-fcbfc194.js → Toast-a590067d.js} +25 -7
  43. package/dist/_shared/esm/{UniversalHeader-80c7313f.js → UniversalHeader-96bfbacc.js} +6 -2
  44. package/dist/_shared/esm/component-d7b471ff.js +382 -0
  45. package/dist/_shared/esm/{index-b84a20c6.js → floating-ui.react-dom-1bb71aae.js} +4 -281
  46. package/dist/_shared/esm/{index-7b531fa7.js → index-0ae23b06.js} +126 -2
  47. package/dist/_shared/esm/index-307f1bbc.js +1212 -0
  48. package/dist/_shared/esm/{index-044da8d0.js → index-9e54cc7d.js} +1 -1
  49. package/dist/_shared/esm/{index-efa9be1a.js → index-af7b6e55.js} +1 -1
  50. package/dist/_shared/esm/{index-2cfab9f2.js → index-ebe72f34.js} +1 -1
  51. package/dist/index.es.js +3608 -2938
  52. package/dist/index.es.js.map +1 -1
  53. package/dist/index.js +3591 -2921
  54. package/dist/index.js.map +1 -1
  55. package/dist/styles.css +2 -2
  56. package/dist/types/components/Button/Button.d.ts +12 -0
  57. package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +28 -0
  58. package/dist/types/components/UniversalHeader/UniversalHeader.d.ts +4 -0
  59. package/package.json +3 -3
  60. package/dist/_shared/cjs/Combination-9974f2e2.js +0 -1330
  61. package/dist/_shared/cjs/index-a31e64a9.js +0 -27
  62. package/dist/_shared/cjs/index-d38f1bd0.js +0 -131
  63. package/dist/_shared/cjs/index-dcfdd5da.js +0 -11
  64. package/dist/_shared/esm/Combination-e9f7e64e.js +0 -1301
  65. package/dist/_shared/esm/index-25a5b393.js +0 -25
  66. package/dist/_shared/esm/index-a624de47.js +0 -9
  67. package/dist/_shared/esm/index-ca72c9d5.js +0 -129
@@ -1,25 +0,0 @@
1
- import { _ as _extends } from './extends-8cc61aad.js';
2
- import { forwardRef, createElement } from 'react';
3
- import { e as $8927f6f2acc4f386$export$250ffa63cdc0d034 } from './index-7b531fa7.js';
4
-
5
- const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
6
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
7
- ref: forwardedRef,
8
- style: {
9
- // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
10
- position: 'absolute',
11
- border: 0,
12
- width: 1,
13
- height: 1,
14
- padding: 0,
15
- margin: -1,
16
- overflow: 'hidden',
17
- clip: 'rect(0, 0, 0, 0)',
18
- whiteSpace: 'nowrap',
19
- wordWrap: 'normal',
20
- ...props.style
21
- }
22
- }));
23
- });
24
-
25
- export { $ea1ef594cf570d83$export$439d29a4e110a164 as $ };
@@ -1,9 +0,0 @@
1
- import { useContext, createContext } from 'react';
2
-
3
- const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undefined);
4
- /* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
5
- const globalDir = useContext($f631663db3294ace$var$DirectionContext);
6
- return localDir || globalDir || 'ltr';
7
- }
8
-
9
- export { $f631663db3294ace$export$b39126d51d94e6f3 as $ };
@@ -1,129 +0,0 @@
1
- import { Children, cloneElement, useState, useRef, useEffect, useCallback, useReducer } from 'react';
2
- import { flushSync } from 'react-dom';
3
- import { b as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, h as $9f79659886946c16$export$e5c5a5f917a5871c } from './index-7b531fa7.js';
4
-
5
- function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
6
- return useReducer((state, event)=>{
7
- const nextState = machine[state][event];
8
- return nextState !== null && nextState !== void 0 ? nextState : state;
9
- }, initialState);
10
- }
11
-
12
-
13
- const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
14
- const { present: present , children: children } = props;
15
- const presence = $921a889cee6df7e8$var$usePresence(present);
16
- const child = typeof children === 'function' ? children({
17
- present: presence.isPresent
18
- }) : Children.only(children);
19
- const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
20
- const forceMount = typeof children === 'function';
21
- return forceMount || presence.isPresent ? /*#__PURE__*/ cloneElement(child, {
22
- ref: ref
23
- }) : null;
24
- };
25
- $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
26
- /* -------------------------------------------------------------------------------------------------
27
- * usePresence
28
- * -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
29
- const [node1, setNode] = useState();
30
- const stylesRef = useRef({});
31
- const prevPresentRef = useRef(present);
32
- const prevAnimationNameRef = useRef('none');
33
- const initialState = present ? 'mounted' : 'unmounted';
34
- const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
35
- mounted: {
36
- UNMOUNT: 'unmounted',
37
- ANIMATION_OUT: 'unmountSuspended'
38
- },
39
- unmountSuspended: {
40
- MOUNT: 'mounted',
41
- ANIMATION_END: 'unmounted'
42
- },
43
- unmounted: {
44
- MOUNT: 'mounted'
45
- }
46
- });
47
- useEffect(()=>{
48
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
49
- prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
50
- }, [
51
- state
52
- ]);
53
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
54
- const styles = stylesRef.current;
55
- const wasPresent = prevPresentRef.current;
56
- const hasPresentChanged = wasPresent !== present;
57
- if (hasPresentChanged) {
58
- const prevAnimationName = prevAnimationNameRef.current;
59
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
60
- if (present) send('MOUNT');
61
- else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run
62
- // so we unmount instantly
63
- send('UNMOUNT');
64
- else {
65
- /**
66
- * When `present` changes to `false`, we check changes to animation-name to
67
- * determine whether an animation has started. We chose this approach (reading
68
- * computed styles) because there is no `animationrun` event and `animationstart`
69
- * fires after `animation-delay` has expired which would be too late.
70
- */ const isAnimating = prevAnimationName !== currentAnimationName;
71
- if (wasPresent && isAnimating) send('ANIMATION_OUT');
72
- else send('UNMOUNT');
73
- }
74
- prevPresentRef.current = present;
75
- }
76
- }, [
77
- present,
78
- send
79
- ]);
80
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
81
- if (node1) {
82
- /**
83
- * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
84
- * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
85
- * make sure we only trigger ANIMATION_END for the currently active animation.
86
- */ const handleAnimationEnd = (event)=>{
87
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
88
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
89
- if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
90
- // a frame after the animation ends, creating a flash of visible content.
91
- // By manually flushing we ensure they sync within a frame, removing the flash.
92
- flushSync(()=>send('ANIMATION_END')
93
- );
94
- };
95
- const handleAnimationStart = (event)=>{
96
- if (event.target === node1) // if animation occurred, store its name as the previous animation.
97
- prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
98
- };
99
- node1.addEventListener('animationstart', handleAnimationStart);
100
- node1.addEventListener('animationcancel', handleAnimationEnd);
101
- node1.addEventListener('animationend', handleAnimationEnd);
102
- return ()=>{
103
- node1.removeEventListener('animationstart', handleAnimationStart);
104
- node1.removeEventListener('animationcancel', handleAnimationEnd);
105
- node1.removeEventListener('animationend', handleAnimationEnd);
106
- };
107
- } else // Transition to the unmounted state if the node is removed prematurely.
108
- // We avoid doing so during cleanup as the node may change but still exist.
109
- send('ANIMATION_END');
110
- }, [
111
- node1,
112
- send
113
- ]);
114
- return {
115
- isPresent: [
116
- 'mounted',
117
- 'unmountSuspended'
118
- ].includes(state),
119
- ref: useCallback((node)=>{
120
- if (node) stylesRef.current = getComputedStyle(node);
121
- setNode(node);
122
- }, [])
123
- };
124
- }
125
- /* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
126
- return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
127
- }
128
-
129
- export { $921a889cee6df7e8$export$99c2b779aa4e8b8b as $ };