@ornikar/kitt-universal 32.5.3-canary.00f8f98ae6299285821fb6a87eab9440995c7566.0 → 32.5.3-canary.f3d9b69069a5f00edad9110e1f71513d5e1ba86a.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.
@@ -4274,28 +4274,6 @@ function useStaticBottomSheet(Content) {
4274
4274
  };
4275
4275
  }
4276
4276
 
4277
- function isDocumentBodyAvailable(body) {
4278
- return !!body;
4279
- }
4280
-
4281
- /**
4282
- * Returns document.body if it exists, or null otherwise.
4283
- * This is useful when document.body might not be available, such as when document.write() is called
4284
- * which destroys the DOM and causes React portals to fail with "Target container is not a DOM element" error.
4285
- */
4286
- function getDocumentBodyIfExists() {
4287
- // document.body can be null when document.write() is called
4288
- var body = typeof document !== 'undefined' ? document.body : null;
4289
- return isDocumentBodyAvailable(body) ? body : null;
4290
- }
4291
-
4292
- function Portal(_ref) {
4293
- var children = _ref.children;
4294
- var container = getDocumentBodyIfExists();
4295
- if (!container) return null;
4296
- return /*#__PURE__*/createPortal(children, container);
4297
- }
4298
-
4299
4277
  function useBlockBodyScroll(shouldBlockScroll, isInitialRender) {
4300
4278
  useEffect(function () {
4301
4279
  if (shouldBlockScroll) {
@@ -4317,9 +4295,7 @@ function ModalBehaviourPortal(_ref) {
4317
4295
  var isInitialRenderRef = useRef(true);
4318
4296
  useBlockBodyScroll(!!visible, isInitialRenderRef.current);
4319
4297
  isInitialRenderRef.current = false;
4320
- return children ? /*#__PURE__*/jsx(Portal, {
4321
- children: children
4322
- }) : null;
4298
+ return children ? /*#__PURE__*/createPortal(children, document.body) : null;
4323
4299
  }
4324
4300
 
4325
4301
  var OnCloseContext = /*#__PURE__*/createContext(function () {});
@@ -5487,10 +5463,11 @@ function InputPressable(_ref) {
5487
5463
  return /*#__PURE__*/jsx(Pressable$2, _objectSpread({}, props));
5488
5464
  }
5489
5465
 
5490
- var inputTextContainer = "kitt-u_inputTextContainer_i1encr9g";
5466
+ var styles$3 = {"inputTextContainer":"InputTextContainer-module_inputTextContainer__gzH8Q"};
5467
+
5491
5468
  function InputTextContainer(props) {
5492
5469
  return /*#__PURE__*/jsx("div", _objectSpread({
5493
- className: inputTextContainer
5470
+ className: styles$3.inputTextContainer
5494
5471
  }, props));
5495
5472
  }
5496
5473
 
@@ -11954,86 +11931,84 @@ function Picker(_ref) {
11954
11931
  isOpen: isOpen,
11955
11932
  disabled: disabled
11956
11933
  }, restToggleProps))
11957
- })), /*#__PURE__*/jsx(Portal, {
11958
- children: /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
11959
- ref: refMemo,
11960
- testID: testID
11961
- }, menuProps), {}, {
11962
- position: strategy,
11963
- top: 0,
11964
- left: 0,
11965
- width: isItemsWidthFixed ? '100%' : itemsWidth,
11966
- maxWidth: isItemsWidthFixed ? 'kitt.picker.maxWidthFixed' : undefined,
11967
- zIndex: 1,
11934
+ })), /*#__PURE__*/createPortal(/*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
11935
+ ref: refMemo,
11936
+ testID: testID
11937
+ }, menuProps), {}, {
11938
+ position: strategy,
11939
+ top: 0,
11940
+ left: 0,
11941
+ width: isItemsWidthFixed ? '100%' : itemsWidth,
11942
+ maxWidth: isItemsWidthFixed ? 'kitt.picker.maxWidthFixed' : undefined,
11943
+ zIndex: 1,
11944
+ _web: {
11945
+ style: {
11946
+ transform: "translate3d(".concat(tooltipX, "px, ").concat(tooltipY, "px, 0)"),
11947
+ visibility: isOpen ? 'visible' : 'hidden',
11948
+ transitionDuration: '300ms',
11949
+ transitionProperty: 'opacity, padding',
11950
+ transitionTimingFunction: 'ease-in-out'
11951
+ }
11952
+ },
11953
+ children: /*#__PURE__*/jsx(View, {
11954
+ opacity: isOpen ? 1 : 0,
11955
+ backgroundColor: "kitt.picker.web.optionsContainer.backgroundColor",
11956
+ borderRadius: "kitt.picker.web.optionsContainer.borderRadius",
11957
+ shadow: "kitt.picker.web.optionsContainer.shadow",
11968
11958
  _web: {
11969
11959
  style: {
11970
- transform: "translate3d(".concat(tooltipX, "px, ").concat(tooltipY, "px, 0)"),
11960
+ transform: "translateY(".concat(isOpen ? 0 : 8, ")"),
11971
11961
  visibility: isOpen ? 'visible' : 'hidden',
11972
11962
  transitionDuration: '300ms',
11973
- transitionProperty: 'opacity, padding',
11974
11963
  transitionTimingFunction: 'ease-in-out'
11975
11964
  }
11976
11965
  },
11977
- children: /*#__PURE__*/jsx(View, {
11978
- opacity: isOpen ? 1 : 0,
11979
- backgroundColor: "kitt.picker.web.optionsContainer.backgroundColor",
11980
- borderRadius: "kitt.picker.web.optionsContainer.borderRadius",
11981
- shadow: "kitt.picker.web.optionsContainer.shadow",
11982
- _web: {
11983
- style: {
11984
- transform: "translateY(".concat(isOpen ? 0 : 8, ")"),
11985
- visibility: isOpen ? 'visible' : 'hidden',
11986
- transitionDuration: '300ms',
11987
- transitionTimingFunction: 'ease-in-out'
11988
- }
11989
- },
11990
- children: /*#__PURE__*/jsx(CSSTransition, {
11991
- unmountOnExit: true,
11992
- nodeRef: nodeRef,
11993
- timeout: 300,
11994
- "in": isOpen,
11995
- classNames: pickerClassNames,
11996
- children: /*#__PURE__*/jsx(View, {
11997
- ref: nodeRef,
11998
- paddingY: "kitt.2",
11999
- children: childrenArray.map(function (child, index) {
12000
- var currentValue = items[index];
12001
- if (currentValue === undefined) {
12002
- throw new Error("Picker: No value found for item at index ".concat(index));
11966
+ children: /*#__PURE__*/jsx(CSSTransition, {
11967
+ unmountOnExit: true,
11968
+ nodeRef: nodeRef,
11969
+ timeout: 300,
11970
+ "in": isOpen,
11971
+ classNames: pickerClassNames,
11972
+ children: /*#__PURE__*/jsx(View, {
11973
+ ref: nodeRef,
11974
+ paddingY: "kitt.2",
11975
+ children: childrenArray.map(function (child, index) {
11976
+ var currentValue = items[index];
11977
+ if (currentValue === undefined) {
11978
+ throw new Error("Picker: No value found for item at index ".concat(index));
11979
+ }
11980
+ var _getItemProps = getItemProps({
11981
+ item: currentValue,
11982
+ index: index,
11983
+ disabled: disabled
11984
+ }),
11985
+ onClick = _getItemProps.onClick,
11986
+ ariaSelected = _getItemProps['aria-selected'],
11987
+ itemProps = _objectWithoutProperties(_getItemProps, _excluded3$2);
11988
+ return /*#__PURE__*/jsx(Pressable, _objectSpread(_objectSpread({}, itemProps), {}, {
11989
+ accessibilityState: {
11990
+ selected: ariaSelected
11991
+ },
11992
+ onPress: onClick,
11993
+ children: function (_ref2) {
11994
+ var isHovered = _ref2.isHovered,
11995
+ isFocused = _ref2.isFocused,
11996
+ isPressed = _ref2.isPressed;
11997
+ return /*#__PURE__*/jsx(PickerItem, {
11998
+ isSelected: checkSelectedItem(selectedItem || undefined, currentValue),
11999
+ isHighlighted: highlightedIndex === index,
12000
+ isHovered: isHovered,
12001
+ isFocused: isFocused,
12002
+ isPressed: isPressed,
12003
+ children: child
12004
+ });
12003
12005
  }
12004
- var _getItemProps = getItemProps({
12005
- item: currentValue,
12006
- index: index,
12007
- disabled: disabled
12008
- }),
12009
- onClick = _getItemProps.onClick,
12010
- ariaSelected = _getItemProps['aria-selected'],
12011
- itemProps = _objectWithoutProperties(_getItemProps, _excluded3$2);
12012
- return /*#__PURE__*/jsx(Pressable, _objectSpread(_objectSpread({}, itemProps), {}, {
12013
- accessibilityState: {
12014
- selected: ariaSelected
12015
- },
12016
- onPress: onClick,
12017
- children: function (_ref2) {
12018
- var isHovered = _ref2.isHovered,
12019
- isFocused = _ref2.isFocused,
12020
- isPressed = _ref2.isPressed;
12021
- return /*#__PURE__*/jsx(PickerItem, {
12022
- isSelected: checkSelectedItem(selectedItem || undefined, currentValue),
12023
- isHighlighted: highlightedIndex === index,
12024
- isHovered: isHovered,
12025
- isFocused: isFocused,
12026
- isPressed: isPressed,
12027
- children: child
12028
- });
12029
- }
12030
- }), itemProps.id);
12031
- })
12006
+ }), itemProps.id);
12032
12007
  })
12033
12008
  })
12034
12009
  })
12035
- }))
12036
- })]
12010
+ })
12011
+ })), document.body)]
12037
12012
  });
12038
12013
  }
12039
12014
  Picker.Option = PickerOption;
@@ -13523,67 +13498,65 @@ function Tooltip(_ref) {
13523
13498
  onFocus: handleToggleTooltip,
13524
13499
  onBlur: handleToggleTooltip,
13525
13500
  width: '100%'
13526
- }), /*#__PURE__*/jsx(Portal, {
13527
- children: /*#__PURE__*/jsx(View, {
13528
- ref: refs.setFloating,
13529
- "aria-hidden": !isVisible,
13530
- paddingX: {
13531
- base: 'kitt.4',
13532
- small: 0
13533
- },
13534
- width: {
13535
- base: '100%',
13536
- small: 'max-content'
13537
- },
13538
- maxWidth: {
13539
- base: '100%',
13540
- small: 'kitt.tooltip.maxWidth'
13541
- },
13542
- opacity: isVisible ? 'kitt.tooltip.opacity' : 0,
13543
- paddingTop: placement === 'bottom' ? currentFloatingPadding : undefined,
13544
- paddingBottom: placement === 'top' ? currentFloatingPadding : undefined,
13501
+ }), /*#__PURE__*/createPortal(/*#__PURE__*/jsx(View, {
13502
+ ref: refs.setFloating,
13503
+ "aria-hidden": !isVisible,
13504
+ paddingX: {
13505
+ base: 'kitt.4',
13506
+ small: 0
13507
+ },
13508
+ width: {
13509
+ base: '100%',
13510
+ small: 'max-content'
13511
+ },
13512
+ maxWidth: {
13513
+ base: '100%',
13514
+ small: 'kitt.tooltip.maxWidth'
13515
+ },
13516
+ opacity: isVisible ? 'kitt.tooltip.opacity' : 0,
13517
+ paddingTop: placement === 'bottom' ? currentFloatingPadding : undefined,
13518
+ paddingBottom: placement === 'top' ? currentFloatingPadding : undefined,
13519
+ style: {
13520
+ pointerEvents: isVisible ? 'auto' : 'none'
13521
+ },
13522
+ position: strategy,
13523
+ zIndex: zIndex,
13524
+ top: 0,
13525
+ left: 0,
13526
+ _web: {
13545
13527
  style: {
13546
- pointerEvents: isVisible ? 'auto' : 'none'
13547
- },
13548
- position: strategy,
13549
- zIndex: zIndex,
13550
- top: 0,
13551
- left: 0,
13528
+ transform: "translate3d(".concat(isBase && !fullWidth ? "0, ".concat(tooltipY, "px, 0") : "".concat(tooltipX, "px, ").concat(tooltipY, "px, 0"), ")"),
13529
+ visibility: isVisible ? 'visible' : 'hidden',
13530
+ transitionDuration: transitionDuration,
13531
+ transitionProperty: theme.kitt.tooltip.transition[themePart].property,
13532
+ transitionTimingFunction: transitionTimingFunction
13533
+ }
13534
+ },
13535
+ onTouchStart: handleToggleTooltip,
13536
+ onTouchEnd: handleToggleTooltip,
13537
+ onMouseEnter: handleToggleTooltip,
13538
+ onMouseLeave: handleToggleTooltip,
13539
+ children: /*#__PURE__*/jsxs(View, {
13552
13540
  _web: {
13553
13541
  style: {
13554
- transform: "translate3d(".concat(isBase && !fullWidth ? "0, ".concat(tooltipY, "px, 0") : "".concat(tooltipX, "px, ").concat(tooltipY, "px, 0"), ")"),
13555
- visibility: isVisible ? 'visible' : 'hidden',
13556
- transitionDuration: transitionDuration,
13557
- transitionProperty: theme.kitt.tooltip.transition[themePart].property,
13558
- transitionTimingFunction: transitionTimingFunction
13542
+ transform: "scale(".concat(isVisible ? 1 : 0.8, ")"),
13543
+ transitionDuration: isVisible ? '0' : transitionDuration,
13544
+ transitionProperty: 'all',
13545
+ transitionTimingFunction: transitionTimingFunction,
13546
+ transformOrigin: transformOrigin
13559
13547
  }
13560
13548
  },
13561
- onTouchStart: handleToggleTooltip,
13562
- onTouchEnd: handleToggleTooltip,
13563
- onMouseEnter: handleToggleTooltip,
13564
- onMouseLeave: handleToggleTooltip,
13565
- children: /*#__PURE__*/jsxs(View, {
13566
- _web: {
13567
- style: {
13568
- transform: "scale(".concat(isVisible ? 1 : 0.8, ")"),
13569
- transitionDuration: isVisible ? '0' : transitionDuration,
13570
- transitionProperty: 'all',
13571
- transitionTimingFunction: transitionTimingFunction,
13572
- transformOrigin: transformOrigin
13573
- }
13574
- },
13575
- children: [shouldRenderArrow && placement === 'bottom' ? /*#__PURE__*/jsx(Arrow, _objectSpread({
13576
- ref: arrowRef,
13577
- position: "bottom"
13578
- }, sharedArrowProps)) : null, /*#__PURE__*/jsx(TooltipContent, {
13579
- children: content
13580
- }), shouldRenderArrow && placement === 'top' ? /*#__PURE__*/jsx(Arrow, _objectSpread({
13581
- ref: arrowRef,
13582
- position: "top"
13583
- }, sharedArrowProps)) : null]
13584
- })
13549
+ children: [shouldRenderArrow && placement === 'bottom' ? /*#__PURE__*/jsx(Arrow, _objectSpread({
13550
+ ref: arrowRef,
13551
+ position: "bottom"
13552
+ }, sharedArrowProps)) : null, /*#__PURE__*/jsx(TooltipContent, {
13553
+ children: content
13554
+ }), shouldRenderArrow && placement === 'top' ? /*#__PURE__*/jsx(Arrow, _objectSpread({
13555
+ ref: arrowRef,
13556
+ position: "top"
13557
+ }, sharedArrowProps)) : null]
13585
13558
  })
13586
- })]
13559
+ }), document.body)]
13587
13560
  });
13588
13561
  }
13589
13562
  Tooltip.Arrow = Arrow;