@ornikar/kitt-universal 25.26.0 → 25.27.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.27.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.26.0...@ornikar/kitt-universal@25.27.0) (2024-10-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * remove react-portal package and use createPortal instead [no issue] ([#2493](https://github.com/ornikar/kitt/issues/2493)) ([539d53a](https://github.com/ornikar/kitt/commit/539d53a3eefda8f40c579d17dc8e303d41a1b807))
12
+
13
+
14
+
6
15
  ## [25.26.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.25.0...@ornikar/kitt-universal@25.26.0) (2024-10-22)
7
16
 
8
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.web.d.ts","sourceRoot":"","sources":["../../../src/Picker/Picker.web.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAsB9C,wBAAgB,MAAM,CAAC,CAAC,EAAE,EACxB,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,wBAAgC,EAChC,gBAAwB,EACxB,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAqJ5B;yBAnKe,MAAM"}
1
+ {"version":3,"file":"Picker.web.d.ts","sourceRoot":"","sources":["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2J7B;yBA3Ke,OAAO"}
@@ -6,7 +6,7 @@ const react = require('react');
6
6
  const nativeBase = require('native-base');
7
7
  const jsxRuntime = require('react/jsx-runtime');
8
8
  const phosphor = require('@ornikar/kitt-icons/phosphor');
9
- const reactPortal = require('react-portal');
9
+ const reactDom = require('react-dom');
10
10
  const reactTransitionGroup = require('react-transition-group');
11
11
  const reactNative = require('react-native');
12
12
  const parser = require('@twemoji/parser');
@@ -18,7 +18,7 @@ const jsApiLoader = require('@googlemaps/js-api-loader');
18
18
  const libphonenumberJs = require('libphonenumber-js');
19
19
  const Animated = require('react-native-reanimated');
20
20
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
21
- const reactDom = require('@floating-ui/react-dom');
21
+ const reactDom$1 = require('@floating-ui/react-dom');
22
22
  const usehooksTs = require('usehooks-ts');
23
23
  const addons = require('@storybook/addons');
24
24
 
@@ -3729,9 +3729,7 @@ function ModalBehaviourPortal({
3729
3729
  isInitialRenderRef.current = false;
3730
3730
 
3731
3731
  // eslint-disable-next-line react/jsx-no-useless-fragment -- Portal propTypes define a required children, preventing a null children value
3732
- return /*#__PURE__*/jsxRuntime.jsx(reactPortal.Portal, {
3733
- children: children || /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {})
3734
- });
3732
+ return children ? /*#__PURE__*/reactDom.createPortal(children, document.body) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
3735
3733
  }
3736
3734
 
3737
3735
  const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
@@ -10826,11 +10824,11 @@ function Picker({
10826
10824
  y,
10827
10825
  refs,
10828
10826
  strategy
10829
- } = reactDom.useFloating({
10827
+ } = reactDom$1.useFloating({
10830
10828
  placement: 'bottom-start',
10831
10829
  strategy: 'fixed',
10832
- whileElementsMounted: reactDom.autoUpdate,
10833
- middleware: [reactDom.offset(8)]
10830
+ whileElementsMounted: reactDom$1.autoUpdate,
10831
+ middleware: [reactDom$1.offset(8)]
10834
10832
  });
10835
10833
  const tooltipY = Math.round(y ?? 0);
10836
10834
  const tooltipX = Math.round(x ?? 0);
@@ -10851,92 +10849,90 @@ function Picker({
10851
10849
  disabled,
10852
10850
  ...restToggleProps
10853
10851
  })
10854
- }), /*#__PURE__*/jsxRuntime.jsx(reactPortal.Portal, {
10852
+ }), /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/jsxRuntime.jsx(View, {
10853
+ ref: myRef => {
10854
+ const currentRef = myRef;
10855
+ refs.setFloating(currentRef);
10856
+ menuRef(currentRef);
10857
+ },
10858
+ testID: testID,
10859
+ ...menuProps,
10860
+ position: strategy,
10861
+ top: 0,
10862
+ left: 0,
10863
+ width: itemsWidth,
10864
+ paddingY: isOpen ? 'kitt.2' : undefined,
10865
+ _web: {
10866
+ style: {
10867
+ transform: `translate3d(${tooltipX}px, ${tooltipY}px, 0)`,
10868
+ visibility: isOpen ? 'visible' : 'hidden',
10869
+ transitionDuration: '300ms',
10870
+ transitionProperty: 'opacity, padding',
10871
+ transitionTimingFunction: 'ease-in-out'
10872
+ }
10873
+ },
10855
10874
  children: /*#__PURE__*/jsxRuntime.jsx(View, {
10856
- ref: myRef => {
10857
- const currentRef = myRef;
10858
- refs.setFloating(currentRef);
10859
- menuRef(currentRef);
10860
- },
10861
- testID: testID,
10862
- ...menuProps,
10863
- position: strategy,
10864
- top: 0,
10865
- left: 0,
10866
- width: itemsWidth,
10867
- paddingY: isOpen ? 'kitt.2' : undefined,
10875
+ opacity: isOpen ? 1 : 0,
10876
+ backgroundColor: "kitt.picker.web.optionsContainer.backgroundColor",
10877
+ borderRadius: "kitt.picker.web.optionsContainer.borderRadius",
10878
+ shadow: "kitt.picker.web.optionsContainer.shadow",
10868
10879
  _web: {
10869
10880
  style: {
10870
- transform: `translate3d(${tooltipX}px, ${tooltipY}px, 0)`,
10881
+ transform: `translateY(${isOpen ? 0 : 8})`,
10871
10882
  visibility: isOpen ? 'visible' : 'hidden',
10872
10883
  transitionDuration: '300ms',
10873
- transitionProperty: 'opacity, padding',
10874
10884
  transitionTimingFunction: 'ease-in-out'
10875
10885
  }
10876
10886
  },
10877
- children: /*#__PURE__*/jsxRuntime.jsx(View, {
10878
- opacity: isOpen ? 1 : 0,
10879
- backgroundColor: "kitt.picker.web.optionsContainer.backgroundColor",
10880
- borderRadius: "kitt.picker.web.optionsContainer.borderRadius",
10881
- shadow: "kitt.picker.web.optionsContainer.shadow",
10882
- _web: {
10883
- style: {
10884
- transform: `translateY(${isOpen ? 0 : 8})`,
10885
- visibility: isOpen ? 'visible' : 'hidden',
10886
- transitionDuration: '300ms',
10887
- transitionTimingFunction: 'ease-in-out'
10888
- }
10887
+ children: /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
10888
+ unmountOnExit: true,
10889
+ timeout: 300,
10890
+ in: isOpen,
10891
+ classNames: {
10892
+ enter,
10893
+ enterActive,
10894
+ exit,
10895
+ exitActive
10889
10896
  },
10890
- children: /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
10891
- unmountOnExit: true,
10892
- timeout: 300,
10893
- in: isOpen,
10894
- classNames: {
10895
- enter,
10896
- enterActive,
10897
- exit,
10898
- exitActive
10899
- },
10900
- children: /*#__PURE__*/jsxRuntime.jsx(View, {
10901
- paddingY: "kitt.2",
10902
- children: childrenArray.map((child, index) => {
10903
- const currentValue = items[index];
10904
- const {
10905
- onClick,
10906
- 'aria-selected': ariaSelected,
10907
- ...itemProps
10908
- } = getItemProps({
10909
- item: currentValue,
10910
- index,
10911
- disabled
10912
- });
10913
- return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
10914
- ...itemProps,
10915
- accessibilityState: {
10916
- selected: ariaSelected
10917
- },
10918
- onPress: onClick,
10919
- children: ({
10920
- isHovered,
10921
- isFocused,
10922
- isPressed
10923
- }) => {
10924
- return /*#__PURE__*/jsxRuntime.jsx(PickerItem, {
10925
- isSelected: checkSelectedItem(selectedItem || undefined, currentValue),
10926
- isHighlighted: highlightedIndex === index,
10927
- isHovered: isHovered,
10928
- isFocused: isFocused,
10929
- isPressed: isPressed,
10930
- children: child
10931
- });
10932
- }
10933
- }, itemProps.id);
10934
- })
10897
+ children: /*#__PURE__*/jsxRuntime.jsx(View, {
10898
+ paddingY: "kitt.2",
10899
+ children: childrenArray.map((child, index) => {
10900
+ const currentValue = items[index];
10901
+ const {
10902
+ onClick,
10903
+ 'aria-selected': ariaSelected,
10904
+ ...itemProps
10905
+ } = getItemProps({
10906
+ item: currentValue,
10907
+ index,
10908
+ disabled
10909
+ });
10910
+ return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
10911
+ ...itemProps,
10912
+ accessibilityState: {
10913
+ selected: ariaSelected
10914
+ },
10915
+ onPress: onClick,
10916
+ children: ({
10917
+ isHovered,
10918
+ isFocused,
10919
+ isPressed
10920
+ }) => {
10921
+ return /*#__PURE__*/jsxRuntime.jsx(PickerItem, {
10922
+ isSelected: checkSelectedItem(selectedItem || undefined, currentValue),
10923
+ isHighlighted: highlightedIndex === index,
10924
+ isHovered: isHovered,
10925
+ isFocused: isFocused,
10926
+ isPressed: isPressed,
10927
+ children: child
10928
+ });
10929
+ }
10930
+ }, itemProps.id);
10935
10931
  })
10936
10932
  })
10937
10933
  })
10938
10934
  })
10939
- })]
10935
+ }), document.body)]
10940
10936
  });
10941
10937
  }
10942
10938
  Picker.Option = PickerOption;
@@ -12182,19 +12178,19 @@ function Tooltip({
12182
12178
  refs,
12183
12179
  middlewareData,
12184
12180
  placement
12185
- } = reactDom.useFloating({
12181
+ } = reactDom$1.useFloating({
12186
12182
  placement: position,
12187
12183
  strategy: 'fixed',
12188
- whileElementsMounted: reactDom.autoUpdate,
12184
+ whileElementsMounted: reactDom$1.autoUpdate,
12189
12185
  middleware: [
12190
12186
  // Order matters
12191
- reactDom.offset(currentFloatingPadding), reactDom.autoPlacement({
12187
+ reactDom$1.offset(currentFloatingPadding), reactDom$1.autoPlacement({
12192
12188
  allowedPlacements: ['top', 'bottom'],
12193
12189
  padding: currentFloatingPadding
12194
- }), reactDom.shift({
12190
+ }), reactDom$1.shift({
12195
12191
  crossAxis: false,
12196
12192
  padding: currentFloatingPadding
12197
- }), reactDom.arrow({
12193
+ }), reactDom$1.arrow({
12198
12194
  element: arrowRef
12199
12195
  })]
12200
12196
  });
@@ -12255,67 +12251,65 @@ function Tooltip({
12255
12251
  if (onToggle) onToggle(false);
12256
12252
  setIsVisible(false);
12257
12253
  }
12258
- }), /*#__PURE__*/jsxRuntime.jsx(reactPortal.Portal, {
12259
- children: /*#__PURE__*/jsxRuntime.jsx(View, {
12260
- ref: refs.setFloating,
12261
- "aria-hidden": !isVisible,
12262
- paddingX: {
12263
- base: 'kitt.4',
12264
- small: 0
12265
- },
12266
- width: {
12267
- base: '100%',
12268
- small: 'max-content'
12269
- },
12270
- maxWidth: {
12271
- base: '100%',
12272
- small: 'kitt.tooltip.maxWidth'
12273
- },
12274
- opacity: isVisible ? 'kitt.tooltip.opacity' : 0,
12254
+ }), /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/jsxRuntime.jsx(View, {
12255
+ ref: refs.setFloating,
12256
+ "aria-hidden": !isVisible,
12257
+ paddingX: {
12258
+ base: 'kitt.4',
12259
+ small: 0
12260
+ },
12261
+ width: {
12262
+ base: '100%',
12263
+ small: 'max-content'
12264
+ },
12265
+ maxWidth: {
12266
+ base: '100%',
12267
+ small: 'kitt.tooltip.maxWidth'
12268
+ },
12269
+ opacity: isVisible ? 'kitt.tooltip.opacity' : 0,
12270
+ style: {
12271
+ pointerEvents: isVisible || isCursorOnTooltip ? 'auto' : 'none'
12272
+ },
12273
+ position: strategy,
12274
+ zIndex: zIndex,
12275
+ top: 0,
12276
+ left: 0,
12277
+ _web: {
12275
12278
  style: {
12276
- pointerEvents: isVisible || isCursorOnTooltip ? 'auto' : 'none'
12277
- },
12278
- position: strategy,
12279
- zIndex: zIndex,
12280
- top: 0,
12281
- left: 0,
12279
+ transform: `translate3d(${isBase && !fullWidth ? `0, ${tooltipY}px, 0` : `${tooltipX}px, ${tooltipY}px, 0`})`,
12280
+ visibility: isVisible ? 'visible' : 'hidden',
12281
+ transitionDuration,
12282
+ transitionProperty: theme.kitt.tooltip.transition[themePart].property,
12283
+ transitionTimingFunction
12284
+ }
12285
+ },
12286
+ onTouchStart: handleMouseEnter,
12287
+ onTouchEnd: handleMouseLeave,
12288
+ onMouseEnter: handleMouseEnter,
12289
+ onMouseLeave: handleMouseLeave,
12290
+ children: /*#__PURE__*/jsxRuntime.jsxs(View, {
12282
12291
  _web: {
12283
12292
  style: {
12284
- transform: `translate3d(${isBase && !fullWidth ? `0, ${tooltipY}px, 0` : `${tooltipX}px, ${tooltipY}px, 0`})`,
12285
- visibility: isVisible ? 'visible' : 'hidden',
12286
- transitionDuration,
12287
- transitionProperty: theme.kitt.tooltip.transition[themePart].property,
12288
- transitionTimingFunction
12293
+ transform: `scale(${isVisible ? 1 : 0.8})`,
12294
+ transitionDuration: isVisible ? '0' : transitionDuration,
12295
+ transitionProperty: 'all',
12296
+ transitionTimingFunction,
12297
+ transformOrigin
12289
12298
  }
12290
12299
  },
12291
- onTouchStart: handleMouseEnter,
12292
- onTouchEnd: handleMouseLeave,
12293
- onMouseEnter: handleMouseEnter,
12294
- onMouseLeave: handleMouseLeave,
12295
- children: /*#__PURE__*/jsxRuntime.jsxs(View, {
12296
- _web: {
12297
- style: {
12298
- transform: `scale(${isVisible ? 1 : 0.8})`,
12299
- transitionDuration: isVisible ? '0' : transitionDuration,
12300
- transitionProperty: 'all',
12301
- transitionTimingFunction,
12302
- transformOrigin
12303
- }
12304
- },
12305
- children: [shouldRenderArrow && placement === 'bottom' ? /*#__PURE__*/jsxRuntime.jsx(Arrow, {
12306
- ref: arrowRef,
12307
- position: "bottom",
12308
- ...sharedArrowProps
12309
- }) : null, /*#__PURE__*/jsxRuntime.jsx(TooltipContent, {
12310
- children: content
12311
- }), shouldRenderArrow && placement === 'top' ? /*#__PURE__*/jsxRuntime.jsx(Arrow, {
12312
- ref: arrowRef,
12313
- position: "top",
12314
- ...sharedArrowProps
12315
- }) : null]
12316
- })
12300
+ children: [shouldRenderArrow && placement === 'bottom' ? /*#__PURE__*/jsxRuntime.jsx(Arrow, {
12301
+ ref: arrowRef,
12302
+ position: "bottom",
12303
+ ...sharedArrowProps
12304
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(TooltipContent, {
12305
+ children: content
12306
+ }), shouldRenderArrow && placement === 'top' ? /*#__PURE__*/jsxRuntime.jsx(Arrow, {
12307
+ ref: arrowRef,
12308
+ position: "top",
12309
+ ...sharedArrowProps
12310
+ }) : null]
12317
12311
  })
12318
- })]
12312
+ }), document.body)]
12319
12313
  });
12320
12314
  }
12321
12315
  Tooltip.Arrow = Arrow;