@razorpay/blade 12.110.0 → 12.111.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 (129) hide show
  1. package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js +5 -5
  2. package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js.map +1 -1
  3. package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js +6 -0
  4. package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -0
  5. package/build/lib/native/components/BaseMotion/BaseMotion.native.js +22 -0
  6. package/build/lib/native/components/BaseMotion/BaseMotion.native.js.map +1 -0
  7. package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js +11 -0
  8. package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js.map +1 -0
  9. package/build/lib/native/components/BaseMotion/baseMotionUtils.js +4 -0
  10. package/build/lib/native/components/BaseMotion/baseMotionUtils.js.map +1 -0
  11. package/build/lib/native/components/BaseMotion/index.js +3 -0
  12. package/build/lib/native/components/BaseMotion/index.js.map +1 -0
  13. package/build/lib/native/components/BaseMotion/types.js +2 -0
  14. package/build/lib/native/components/BaseMotion/types.js.map +1 -0
  15. package/build/lib/native/components/Dropdown/FilterChipSelectInput.native.js +2 -1
  16. package/build/lib/native/components/Dropdown/FilterChipSelectInput.native.js.map +1 -1
  17. package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js +4 -0
  18. package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
  19. package/build/lib/native/components/Fade/Fade.native.js +7 -5
  20. package/build/lib/native/components/Fade/Fade.native.js.map +1 -1
  21. package/build/lib/native/components/FilterChip/BaseFilterChip.native.js +2 -2
  22. package/build/lib/native/components/FilterChip/BaseFilterChip.native.js.map +1 -1
  23. package/build/lib/native/components/Morph/Morph.native.js +9 -5
  24. package/build/lib/native/components/Morph/Morph.native.js.map +1 -1
  25. package/build/lib/native/components/Move/Move.native.js +8 -5
  26. package/build/lib/native/components/Move/Move.native.js.map +1 -1
  27. package/build/lib/native/components/Scale/Scale.native.js +7 -5
  28. package/build/lib/native/components/Scale/Scale.native.js.map +1 -1
  29. package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js +27 -0
  30. package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js.map +1 -0
  31. package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js +8 -0
  32. package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
  33. package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js +18 -0
  34. package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js.map +1 -0
  35. package/build/lib/native/components/SegmentedControl/index.js +3 -0
  36. package/build/lib/native/components/SegmentedControl/index.js.map +1 -0
  37. package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js +4 -0
  38. package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
  39. package/build/lib/native/components/Slide/Slide.native.js +7 -5
  40. package/build/lib/native/components/Slide/Slide.native.js.map +1 -1
  41. package/build/lib/native/components/Stagger/Stagger.native.js +10 -5
  42. package/build/lib/native/components/Stagger/Stagger.native.js.map +1 -1
  43. package/build/lib/native/components/Stagger/StaggerProvider.js +6 -0
  44. package/build/lib/native/components/Stagger/StaggerProvider.js.map +1 -0
  45. package/build/lib/native/components/index.js +3 -0
  46. package/build/lib/native/components/index.js.map +1 -1
  47. package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
  48. package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
  49. package/build/lib/native/utils/msToSeconds.js +4 -0
  50. package/build/lib/native/utils/msToSeconds.js.map +1 -0
  51. package/build/lib/web/development/_virtual/flatten.js +1 -1
  52. package/build/lib/web/development/_virtual/flatten3.js +1 -1
  53. package/build/lib/web/development/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
  54. package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
  55. package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
  56. package/build/lib/web/development/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
  57. package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
  58. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +8 -1
  59. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  60. package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
  61. package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
  62. package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +40 -5
  63. package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
  64. package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js +11 -21
  65. package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
  66. package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js +46 -0
  67. package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
  68. package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +35 -11
  69. package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
  70. package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js +196 -0
  71. package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
  72. package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js +18 -0
  73. package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
  74. package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
  75. package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
  76. package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
  77. package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
  78. package/build/lib/web/development/components/SegmentedControl/index.js +3 -0
  79. package/build/lib/web/development/components/SegmentedControl/index.js.map +1 -0
  80. package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js +53 -0
  81. package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
  82. package/build/lib/web/development/components/Stagger/StaggerProvider.js.map +1 -1
  83. package/build/lib/web/development/components/index.js +3 -0
  84. package/build/lib/web/development/components/index.js.map +1 -1
  85. package/build/lib/web/development/node_modules/es-toolkit/dist/array/flatten.js +1 -1
  86. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
  87. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
  88. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
  89. package/build/lib/web/development/utils/metaAttribute/metaConstants.js +3 -1
  90. package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
  91. package/build/lib/web/production/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
  92. package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
  93. package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
  94. package/build/lib/web/production/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
  95. package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
  96. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +8 -1
  97. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  98. package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
  99. package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
  100. package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +40 -5
  101. package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
  102. package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +11 -21
  103. package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
  104. package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js +46 -0
  105. package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
  106. package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +35 -11
  107. package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
  108. package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js +196 -0
  109. package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
  110. package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js +18 -0
  111. package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
  112. package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
  113. package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
  114. package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
  115. package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
  116. package/build/lib/web/production/components/SegmentedControl/index.js +3 -0
  117. package/build/lib/web/production/components/SegmentedControl/index.js.map +1 -0
  118. package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js +53 -0
  119. package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
  120. package/build/lib/web/production/components/Stagger/StaggerProvider.js.map +1 -1
  121. package/build/lib/web/production/components/index.js +3 -0
  122. package/build/lib/web/production/components/index.js.map +1 -1
  123. package/build/lib/web/production/utils/metaAttribute/metaConstants.js +3 -1
  124. package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
  125. package/build/types/components/index.d.ts +238 -8
  126. package/build/types/components/index.native.d.ts +410 -14
  127. package/package.json +1 -1
  128. package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js.map +0 -1
  129. package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js.map +0 -1
@@ -19,9 +19,9 @@ import '../BladeProvider/index.js';
19
19
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
20
20
  import { size } from '../../tokens/global/size.js';
21
21
  import { makeBorderSize } from '../../utils/makeBorderSize/makeBorderSize.native.js';
22
+ import { Text } from '../Typography/Text/Text.js';
22
23
  import { Box } from '../Box/Box.js';
23
24
  import { Counter } from '../Counter/Counter.js';
24
- import { Text } from '../Typography/Text/Text.js';
25
25
  import useTheme from '../BladeProvider/useTheme.js';
26
26
  import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.native.js';
27
27
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
@@ -32,7 +32,7 @@ import CloseIcon from '../Icons/CloseIcon/CloseIcon.js';
32
32
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
33
33
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
34
34
 
35
- var _excluded=["value","onClearButtonClick","label","isDisabled","selectionType","onClick","onKeyDown","accessibilityProps","id"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/FilterChip/BaseFilterChip.native.tsx";var FILTER_CHIP_HEIGHT_NATIVE=size['28'];var DashedBorder=function DashedBorder(_ref){var width=_ref.width,height=_ref.height,borderRadius=_ref.borderRadius,strokeWidth=_ref.strokeWidth,color=_ref.color;if(width<=0||height<=0){return null;}var inset=strokeWidth/2;var rectWidth=width-strokeWidth;var rectHeight=height-strokeWidth;var radius=Math.max(borderRadius-inset,0);var straightWidth=Math.max(rectWidth-2*radius,0);var straightHeight=Math.max(rectHeight-2*radius,0);var perimeter=2*straightWidth+2*straightHeight+2*Math.PI*radius;var targetSegment=4;var segmentCount=Math.max(1,Math.round(perimeter/targetSegment));var segmentLength=perimeter/segmentCount;var dashLength=segmentLength/2;return jsx(View,{style:StyleSheet.absoluteFill,pointerEvents:"none",children:jsx(Svg,{width:width,height:height,children:jsx(Rect,{x:inset,y:inset,width:rectWidth,height:rectHeight,rx:radius,ry:radius,fill:"none",stroke:color,strokeWidth:strokeWidth,strokeDasharray:[dashLength,segmentLength-dashLength]})})});};var StyledFilterChip=styled(View)(function(_ref2){var theme=_ref2.theme,$isDisabled=_ref2.$isDisabled,$isSelected=_ref2.$isSelected;return {borderWidth:$isSelected?makeBorderSize(theme.border.width.thin):0,borderColor:$isSelected?theme.colors.interactive.border.gray[$isDisabled?'disabled':'faded']:'transparent',height:FILTER_CHIP_HEIGHT_NATIVE,borderRadius:theme.border.radius.small,borderStyle:'solid',backgroundColor:theme.colors.surface.background.gray.intense,flexDirection:'row',alignSelf:'flex-start',overflow:$isSelected?'hidden':'visible'};});var StyledFilterTrigger=styled(Pressable)(function(_ref3){var theme=_ref3.theme,$isSelected=_ref3.$isSelected;var spacing=theme.spacing;return {backgroundColor:'transparent',borderRadius:$isSelected?0:theme.border.radius.small,borderTopLeftRadius:theme.border.radius.small,borderBottomLeftRadius:theme.border.radius.small,paddingLeft:spacing[4],paddingRight:$isSelected?spacing[2]:spacing[3],flexDirection:'row',alignItems:'center',height:'100%',gap:spacing[2]};});var StyledFilterCloseButton=styled(Pressable)(function(_ref4){var theme=_ref4.theme;return {backgroundColor:'transparent',borderTopRightRadius:theme.border.radius.small,borderBottomRightRadius:theme.border.radius.small,paddingLeft:theme.spacing[2]+theme.spacing[1],paddingRight:theme.spacing[2]+theme.spacing[1],justifyContent:'center',alignItems:'center',height:'100%'};});var renderValue=function renderValue(selectionType,value,isDisabled){if(selectionType==='multiple'&&Array.isArray(value)){return jsx(Box,{alignItems:"center",flexDirection:"row",children:jsx(Counter,{value:value.length,color:"neutral",size:"small"})});}return jsx(Text,{size:"small",weight:"medium",color:isDisabled?'interactive.text.gray.disabled':'interactive.text.gray.normal',children:typeof value==='string'?value:''});};var _BaseFilterChip=function _BaseFilterChip(_ref5,ref){var _accessibilityProps$r;var value=_ref5.value,onClearButtonClick=_ref5.onClearButtonClick,label=_ref5.label,isDisabled=_ref5.isDisabled,_ref5$selectionType=_ref5.selectionType,selectionType=_ref5$selectionType===void 0?'single':_ref5$selectionType,onClick=_ref5.onClick,onKeyDown=_ref5.onKeyDown,accessibilityProps=_ref5.accessibilityProps,id=_ref5.id,rest=_objectWithoutProperties(_ref5,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var isSelected=selectionType==='multiple'?Array.isArray(value)&&value.length>0:!!value;var _React$useState=React__default.useState({width:0,height:0}),_React$useState2=_slicedToArray(_React$useState,2),chipSize=_React$useState2[0],setChipSize=_React$useState2[1];var handleLayout=function handleLayout(event){var _event$nativeEvent$la=event.nativeEvent.layout,width=_event$nativeEvent$la.width,height=_event$nativeEvent$la.height;setChipSize(function(prev){return prev.width===width&&prev.height===height?prev:{width:width,height:height};});};return jsxs(StyledFilterChip,{$isDisabled:isDisabled,$isSelected:isSelected,ref:ref,onLayout:isSelected?undefined:handleLayout,children:[jsxs(StyledFilterTrigger,Object.assign({$isSelected:isSelected,disabled:isDisabled,id:id,onPress:isDisabled?undefined:function(e){onClick==null?void 0:onClick(e);},onKeyDown:isDisabled?undefined:function(e){onKeyDown==null?void 0:onKeyDown(e);}},makeAccessible(Object.assign({},accessibilityProps,{role:(_accessibilityProps$r=accessibilityProps==null?void 0:accessibilityProps.role)!=null?_accessibilityProps$r:'button'})),makeAnalyticsAttribute(rest),metaAttribute({name:'filter-chip-trigger',testID:rest.testID}),{children:[jsxs(Box,{flexDirection:"row",gap:"spacing.2",alignItems:"center",children:[jsxs(Text,{size:"small",weight:"medium",color:"interactive.text.gray.subtle",truncateAfterLines:1,children:[label,isSelected?':':null]}),isSelected?renderValue(selectionType,value,isDisabled):null]}),jsx(Box,{flexDirection:"row",alignItems:"center",paddingRight:"spacing.1",children:jsx(ChevronDownIcon,{size:"small",color:"interactive.icon.gray.muted"})})]})),isSelected?jsxs(Fragment,{children:[jsx(Divider,{orientation:"vertical",variant:isDisabled?'muted':'subtle'}),jsx(StyledFilterCloseButton,Object.assign({},makeAccessible({label:`Clear ${label} value`,role:'button'}),{onPress:isDisabled?undefined:function(){return onClearButtonClick==null?void 0:onClearButtonClick({value:value!=null?value:''});},disabled:isDisabled},metaAttribute({name:'filter-chip-close-button'}),{children:jsx(CloseIcon,{size:"small",color:"interactive.icon.gray.muted"})}))]}):null,isSelected?null:jsx(DashedBorder,{width:chipSize.width,height:chipSize.height,borderRadius:theme.border.radius.small,strokeWidth:makeBorderSize(theme.border.width.thin),color:theme.colors.interactive.border.gray[isDisabled?'disabled':'faded']})]});};var BaseFilterChip=assignWithoutSideEffects(React__default.forwardRef(_BaseFilterChip),{componentId:MetaConstants.BaseFilterChip});
35
+ var _excluded=["value","onClearButtonClick","label","isDisabled","selectionType","showClearButton","onClick","onKeyDown","accessibilityProps","id"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/FilterChip/BaseFilterChip.native.tsx";var FILTER_CHIP_HEIGHT_NATIVE=size['28'];var DashedBorder=function DashedBorder(_ref){var width=_ref.width,height=_ref.height,borderRadius=_ref.borderRadius,strokeWidth=_ref.strokeWidth,color=_ref.color;if(width<=0||height<=0){return null;}var inset=strokeWidth/2;var rectWidth=width-strokeWidth;var rectHeight=height-strokeWidth;var radius=Math.max(borderRadius-inset,0);var straightWidth=Math.max(rectWidth-2*radius,0);var straightHeight=Math.max(rectHeight-2*radius,0);var perimeter=2*straightWidth+2*straightHeight+2*Math.PI*radius;var targetSegment=4;var segmentCount=Math.max(1,Math.round(perimeter/targetSegment));var segmentLength=perimeter/segmentCount;var dashLength=segmentLength/2;return jsx(View,{style:StyleSheet.absoluteFill,pointerEvents:"none",children:jsx(Svg,{width:width,height:height,children:jsx(Rect,{x:inset,y:inset,width:rectWidth,height:rectHeight,rx:radius,ry:radius,fill:"none",stroke:color,strokeWidth:strokeWidth,strokeDasharray:[dashLength,segmentLength-dashLength]})})});};var StyledFilterChip=styled(View)(function(_ref2){var theme=_ref2.theme,$isDisabled=_ref2.$isDisabled,$isSelected=_ref2.$isSelected;return {borderWidth:$isSelected?makeBorderSize(theme.border.width.thin):0,borderColor:$isSelected?theme.colors.interactive.border.gray[$isDisabled?'disabled':'faded']:'transparent',height:FILTER_CHIP_HEIGHT_NATIVE,borderRadius:theme.border.radius.small,borderStyle:'solid',backgroundColor:theme.colors.surface.background.gray.intense,flexDirection:'row',alignSelf:'flex-start',overflow:$isSelected?'hidden':'visible'};});var StyledFilterTrigger=styled(Pressable)(function(_ref3){var theme=_ref3.theme,$hasClearButton=_ref3.$hasClearButton;var spacing=theme.spacing;return {backgroundColor:'transparent',borderRadius:$hasClearButton?0:theme.border.radius.small,borderTopLeftRadius:theme.border.radius.small,borderBottomLeftRadius:theme.border.radius.small,paddingLeft:spacing[4],paddingRight:$hasClearButton?spacing[2]:spacing[3],flexDirection:'row',alignItems:'center',height:'100%',gap:spacing[2]};});var StyledFilterCloseButton=styled(Pressable)(function(_ref4){var theme=_ref4.theme;return {backgroundColor:'transparent',borderTopRightRadius:theme.border.radius.small,borderBottomRightRadius:theme.border.radius.small,paddingLeft:theme.spacing[2]+theme.spacing[1],paddingRight:theme.spacing[2]+theme.spacing[1],justifyContent:'center',alignItems:'center',height:'100%'};});var renderValue=function renderValue(selectionType,value,isDisabled){var valueColor=isDisabled?'interactive.text.gray.disabled':'interactive.text.gray.normal';if(selectionType==='multiple'){var valueArray=Array.isArray(value)?value:value!=null?[value]:[];if(valueArray.length===1){var _valueArray$;return jsx(Text,{size:"small",weight:"medium",color:valueColor,truncateAfterLines:1,children:String((_valueArray$=valueArray[0])!=null?_valueArray$:'')});}return jsx(Box,{alignItems:"center",flexDirection:"row",children:jsx(Counter,{value:valueArray.length,color:"neutral",size:"small"})});}return jsx(Text,{size:"small",weight:"medium",color:valueColor,children:value!=null?String(value):''});};var _BaseFilterChip=function _BaseFilterChip(_ref5,ref){var _accessibilityProps$r;var value=_ref5.value,onClearButtonClick=_ref5.onClearButtonClick,label=_ref5.label,isDisabled=_ref5.isDisabled,_ref5$selectionType=_ref5.selectionType,selectionType=_ref5$selectionType===void 0?'single':_ref5$selectionType,_ref5$showClearButton=_ref5.showClearButton,showClearButton=_ref5$showClearButton===void 0?true:_ref5$showClearButton,onClick=_ref5.onClick,onKeyDown=_ref5.onKeyDown,accessibilityProps=_ref5.accessibilityProps,id=_ref5.id,rest=_objectWithoutProperties(_ref5,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var isSelected=selectionType==='multiple'?Array.isArray(value)&&value.length>0:!!value;var shouldShowClearButton=isSelected&&showClearButton;var _React$useState=React__default.useState({width:0,height:0}),_React$useState2=_slicedToArray(_React$useState,2),chipSize=_React$useState2[0],setChipSize=_React$useState2[1];var handleLayout=function handleLayout(event){var _event$nativeEvent$la=event.nativeEvent.layout,width=_event$nativeEvent$la.width,height=_event$nativeEvent$la.height;setChipSize(function(prev){return prev.width===width&&prev.height===height?prev:{width:width,height:height};});};return jsxs(StyledFilterChip,{$isDisabled:isDisabled,$isSelected:isSelected,ref:ref,onLayout:isSelected?undefined:handleLayout,children:[jsxs(StyledFilterTrigger,Object.assign({$hasClearButton:shouldShowClearButton,disabled:isDisabled,id:id,onPress:isDisabled?undefined:function(e){onClick==null?void 0:onClick(e);},onKeyDown:isDisabled?undefined:function(e){onKeyDown==null?void 0:onKeyDown(e);}},makeAccessible(Object.assign({},accessibilityProps,{role:(_accessibilityProps$r=accessibilityProps==null?void 0:accessibilityProps.role)!=null?_accessibilityProps$r:'button'})),makeAnalyticsAttribute(rest),metaAttribute({name:'filter-chip-trigger',testID:rest.testID}),{children:[jsxs(Box,{flexDirection:"row",gap:"spacing.2",alignItems:"center",children:[jsxs(Text,{size:"small",weight:"medium",color:"interactive.text.gray.subtle",truncateAfterLines:1,children:[label,isSelected?':':null]}),isSelected?renderValue(selectionType,value,isDisabled):null]}),jsx(Box,{flexDirection:"row",alignItems:"center",paddingRight:"spacing.1",children:jsx(ChevronDownIcon,{size:"small",color:"interactive.icon.gray.muted"})})]})),shouldShowClearButton?jsxs(Fragment,{children:[jsx(Divider,{orientation:"vertical",variant:isDisabled?'muted':'subtle'}),jsx(StyledFilterCloseButton,Object.assign({},makeAccessible({label:`Clear ${label} value`,role:'button'}),{onPress:isDisabled?undefined:function(){return onClearButtonClick==null?void 0:onClearButtonClick({value:value!=null?value:''});},disabled:isDisabled},metaAttribute({name:'filter-chip-close-button'}),{children:jsx(CloseIcon,{size:"small",color:"interactive.icon.gray.muted"})}))]}):null,isSelected?null:jsx(DashedBorder,{width:chipSize.width,height:chipSize.height,borderRadius:theme.border.radius.small,strokeWidth:makeBorderSize(theme.border.width.thin),color:theme.colors.interactive.border.gray[isDisabled?'disabled':'faded']})]});};var BaseFilterChip=assignWithoutSideEffects(React__default.forwardRef(_BaseFilterChip),{componentId:MetaConstants.BaseFilterChip});
36
36
 
37
37
  export { BaseFilterChip };
38
38
  //# sourceMappingURL=BaseFilterChip.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseFilterChip.native.js","sources":["../../../../../src/components/FilterChip/BaseFilterChip.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, View } from 'react-native';\nimport type { LayoutChangeEvent, GestureResponderEvent } from 'react-native';\nimport styled from 'styled-components/native';\nimport Svg, { Rect } from 'react-native-svg';\nimport type { BaseFilterChipProps } from './types';\nimport { size } from '~tokens/global';\nimport { makeBorderSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { Box } from '~components/Box';\nimport { Counter } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport { ChevronDownIcon, CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useTheme } from '~components/BladeProvider';\nimport type { Theme } from '~components/BladeProvider';\n\nconst FILTER_CHIP_HEIGHT_NATIVE = size['28'];\n\n/**\n * React Native's `borderStyle: 'dashed'` combined with `borderRadius` is buggy on iOS —\n * dashes render inconsistently and produce a broken/overlapping artifact near the corners\n * and the right edge. To match web's clean dashed pill, we draw the dashed border ourselves\n * with `react-native-svg` as a rounded `Rect` whose dash pattern divides evenly around the\n * perimeter (so there's no visible seam where the stroke path closes).\n */\nconst DashedBorder = ({\n width,\n height,\n borderRadius,\n strokeWidth,\n color,\n}: {\n width: number;\n height: number;\n borderRadius: number;\n strokeWidth: number;\n color: string;\n}): React.ReactElement | null => {\n if (width <= 0 || height <= 0) {\n return null;\n }\n\n // Inset the stroke by half its width so it sits fully inside the bounds and the\n // right/bottom edges aren't clipped.\n const inset = strokeWidth / 2;\n const rectWidth = width - strokeWidth;\n const rectHeight = height - strokeWidth;\n const radius = Math.max(borderRadius - inset, 0);\n\n // Perimeter of a rounded rectangle = straight edges + the four quarter-circle corners.\n const straightWidth = Math.max(rectWidth - 2 * radius, 0);\n const straightHeight = Math.max(rectHeight - 2 * radius, 0);\n const perimeter = 2 * straightWidth + 2 * straightHeight + 2 * Math.PI * radius;\n\n // Target a small dot-like dash+gap (~4pt) and round to an integer number of segments so\n // the pattern lands exactly on the path's start/end point (no broken dash on the right edge).\n const targetSegment = 4;\n const segmentCount = Math.max(1, Math.round(perimeter / targetSegment));\n const segmentLength = perimeter / segmentCount;\n const dashLength = segmentLength / 2;\n\n return (\n <View style={StyleSheet.absoluteFill} pointerEvents=\"none\">\n <Svg width={width} height={height}>\n <Rect\n x={inset}\n y={inset}\n width={rectWidth}\n height={rectHeight}\n rx={radius}\n ry={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeDasharray={[dashLength, segmentLength - dashLength]}\n />\n </Svg>\n </View>\n );\n};\n\nconst StyledFilterChip = styled(View)<{\n theme: Theme;\n $isSelected?: boolean;\n $isDisabled?: boolean;\n}>(({ theme, $isDisabled, $isSelected }) => {\n return {\n // When unselected the dashed border is drawn via an SVG overlay (see DashedBorder) so we\n // rely on it entirely: the native border has zero width, keeping the overlay's coordinate\n // space aligned with the border-box and avoiding iOS's buggy dashed+radius render.\n borderWidth: $isSelected ? makeBorderSize(theme.border.width.thin) : 0,\n borderColor: $isSelected\n ? theme.colors.interactive.border.gray[$isDisabled ? 'disabled' : 'faded']\n : 'transparent',\n height: FILTER_CHIP_HEIGHT_NATIVE,\n borderRadius: theme.border.radius.small,\n borderStyle: 'solid',\n backgroundColor: theme.colors.surface.background.gray.intense,\n flexDirection: 'row',\n alignSelf: 'flex-start',\n // The SVG dashed border must not be clipped when unselected; the selected state clips its\n // divider/close button to the rounded corners.\n overflow: $isSelected ? 'hidden' : 'visible',\n };\n});\n\nconst StyledFilterTrigger = styled(Pressable)<{\n theme: Theme;\n $isSelected?: boolean;\n}>(({ theme, $isSelected }) => {\n const { spacing } = theme;\n return {\n backgroundColor: 'transparent',\n borderRadius: $isSelected ? 0 : theme.border.radius.small,\n borderTopLeftRadius: theme.border.radius.small,\n borderBottomLeftRadius: theme.border.radius.small,\n paddingLeft: spacing[4],\n paddingRight: $isSelected ? spacing[2] : spacing[3],\n flexDirection: 'row',\n alignItems: 'center',\n height: '100%',\n gap: spacing[2],\n };\n});\n\nconst StyledFilterCloseButton = styled(Pressable)<{ theme: Theme }>(({ theme }) => {\n return {\n backgroundColor: 'transparent',\n borderTopRightRadius: theme.border.radius.small,\n borderBottomRightRadius: theme.border.radius.small,\n paddingLeft: theme.spacing[2] + theme.spacing[1],\n paddingRight: theme.spacing[2] + theme.spacing[1],\n justifyContent: 'center',\n alignItems: 'center',\n height: '100%',\n };\n});\n\nconst renderValue = (\n selectionType: BaseFilterChipProps['selectionType'],\n value: BaseFilterChipProps['value'],\n isDisabled?: boolean,\n): React.ReactElement => {\n if (selectionType === 'multiple' && Array.isArray(value)) {\n return (\n <Box alignItems=\"center\" flexDirection=\"row\">\n <Counter value={value.length} color=\"neutral\" size=\"small\" />\n </Box>\n );\n }\n\n return (\n <Text\n size=\"small\"\n weight=\"medium\"\n color={isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.normal'}\n >\n {typeof value === 'string' ? value : ''}\n </Text>\n );\n};\n\nconst _BaseFilterChip: React.ForwardRefRenderFunction<View, BaseFilterChipProps> = (\n {\n value,\n onClearButtonClick,\n label,\n isDisabled,\n selectionType = 'single',\n onClick,\n onKeyDown,\n accessibilityProps,\n id,\n ...rest\n }: BaseFilterChipProps,\n ref: React.Ref<View>,\n): React.ReactElement => {\n const { theme } = useTheme();\n const isSelected =\n selectionType === 'multiple' ? Array.isArray(value) && value.length > 0 : !!value;\n\n const [chipSize, setChipSize] = React.useState({ width: 0, height: 0 });\n const handleLayout = (event: LayoutChangeEvent): void => {\n const { width, height } = event.nativeEvent.layout;\n setChipSize((prev) =>\n prev.width === width && prev.height === height ? prev : { width, height },\n );\n };\n\n return (\n <StyledFilterChip\n $isDisabled={isDisabled}\n $isSelected={isSelected}\n ref={ref}\n onLayout={isSelected ? undefined : handleLayout}\n >\n <StyledFilterTrigger\n $isSelected={isSelected}\n disabled={isDisabled}\n id={id}\n onPress={\n isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onClick?.((e as unknown) as React.MouseEventHandler);\n }\n }\n {...(({\n onKeyDown: isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onKeyDown?.((e as unknown) as React.KeyboardEvent<Element>);\n },\n } as unknown) as Record<string, unknown>)}\n {...makeAccessible({\n ...accessibilityProps,\n role: accessibilityProps?.role ?? 'button',\n })}\n {...makeAnalyticsAttribute(rest)}\n {...metaAttribute({ name: 'filter-chip-trigger', testID: rest.testID })}\n >\n <Box flexDirection=\"row\" gap=\"spacing.2\" alignItems=\"center\">\n <Text\n size=\"small\"\n weight=\"medium\"\n color=\"interactive.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {label}\n {isSelected ? ':' : null}\n </Text>\n {isSelected ? renderValue(selectionType, value, isDisabled) : null}\n </Box>\n <Box flexDirection=\"row\" alignItems=\"center\" paddingRight=\"spacing.1\">\n <ChevronDownIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </Box>\n </StyledFilterTrigger>\n {isSelected ? (\n <>\n <Divider orientation=\"vertical\" variant={isDisabled ? 'muted' : 'subtle'} />\n <StyledFilterCloseButton\n {...makeAccessible({ label: `Clear ${label} value`, role: 'button' })}\n // value can never be undefined because when it's undefined the button itself doesn't render\n onPress={isDisabled ? undefined : () => onClearButtonClick?.({ value: value ?? '' })}\n disabled={isDisabled}\n {...metaAttribute({ name: 'filter-chip-close-button' })}\n >\n <CloseIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </StyledFilterCloseButton>\n </>\n ) : null}\n {isSelected ? null : (\n <DashedBorder\n width={chipSize.width}\n height={chipSize.height}\n borderRadius={theme.border.radius.small}\n strokeWidth={makeBorderSize(theme.border.width.thin)}\n color={theme.colors.interactive.border.gray[isDisabled ? 'disabled' : 'faded']}\n />\n )}\n </StyledFilterChip>\n );\n};\n\nconst BaseFilterChip = assignWithoutSideEffects(React.forwardRef(_BaseFilterChip), {\n componentId: MetaConstants.BaseFilterChip,\n});\n\nexport { BaseFilterChip };\n"],"names":["this","FILTER_CHIP_HEIGHT_NATIVE","size","DashedBorder","_ref","width","height","borderRadius","strokeWidth","color","inset","rectWidth","rectHeight","radius","Math","max","straightWidth","straightHeight","perimeter","PI","targetSegment","segmentCount","round","segmentLength","dashLength","_jsx","View","style","StyleSheet","absoluteFill","pointerEvents","children","Svg","Rect","x","y","rx","ry","fill","stroke","strokeDasharray","StyledFilterChip","styled","_ref2","theme","$isDisabled","$isSelected","borderWidth","makeBorderSize","border","thin","borderColor","colors","interactive","gray","small","borderStyle","backgroundColor","surface","background","intense","flexDirection","alignSelf","overflow","StyledFilterTrigger","Pressable","_ref3","spacing","borderTopLeftRadius","borderBottomLeftRadius","paddingLeft","paddingRight","alignItems","gap","StyledFilterCloseButton","_ref4","borderTopRightRadius","borderBottomRightRadius","justifyContent","renderValue","selectionType","value","isDisabled","Array","isArray","Box","Counter","length","Text","weight","_BaseFilterChip","_ref5","ref","_accessibilityProps$r","onClearButtonClick","label","_ref5$selectionType","onClick","onKeyDown","accessibilityProps","id","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","isSelected","_React$useState","React","useState","_React$useState2","_slicedToArray","chipSize","setChipSize","handleLayout","event","_event$nativeEvent$la","nativeEvent","layout","prev","_jsxs","onLayout","undefined","Object","assign","disabled","onPress","e","makeAccessible","role","makeAnalyticsAttribute","metaAttribute","name","testID","truncateAfterLines","ChevronDownIcon","_Fragment","Divider","orientation","variant","CloseIcon","BaseFilterChip","assignWithoutSideEffects","forwardRef","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,YAAA,CAAA,eAAA,CAAA,SAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,CAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,kGAAA,CAoBA,IAAMC,yBAAyB,CAAGC,IAAI,CAAC,IAAI,CAAC,CAS5C,IAAMC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAYe,CAAA,IAX/BC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,YAAY,CAAAH,IAAA,CAAZG,YAAY,CACZC,WAAW,CAAAJ,IAAA,CAAXI,WAAW,CACXC,KAAK,CAAAL,IAAA,CAALK,KAAK,CAQL,GAAIJ,KAAK,EAAI,CAAC,EAAIC,MAAM,EAAI,CAAC,CAAE,CAC7B,OAAO,IAAI,CACb,CAIA,IAAMI,KAAK,CAAGF,WAAW,CAAG,CAAC,CAC7B,IAAMG,SAAS,CAAGN,KAAK,CAAGG,WAAW,CACrC,IAAMI,UAAU,CAAGN,MAAM,CAAGE,WAAW,CACvC,IAAMK,MAAM,CAAGC,IAAI,CAACC,GAAG,CAACR,YAAY,CAAGG,KAAK,CAAE,C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,UAAU,CAACrD,eAAe,CAAC,CAAE,CACjFsD,WAAW,CAAEC,aAAa,CAACJ,cAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"BaseFilterChip.native.js","sources":["../../../../../src/components/FilterChip/BaseFilterChip.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, View } from 'react-native';\nimport type { LayoutChangeEvent, GestureResponderEvent } from 'react-native';\nimport styled from 'styled-components/native';\nimport Svg, { Rect } from 'react-native-svg';\nimport type { BaseFilterChipProps } from './types';\nimport { size } from '~tokens/global';\nimport { makeBorderSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { Box } from '~components/Box';\nimport { Counter } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport { ChevronDownIcon, CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useTheme } from '~components/BladeProvider';\nimport type { Theme } from '~components/BladeProvider';\n\nconst FILTER_CHIP_HEIGHT_NATIVE = size['28'];\n\n/**\n * React Native's `borderStyle: 'dashed'` combined with `borderRadius` is buggy on iOS —\n * dashes render inconsistently and produce a broken/overlapping artifact near the corners\n * and the right edge. To match web's clean dashed pill, we draw the dashed border ourselves\n * with `react-native-svg` as a rounded `Rect` whose dash pattern divides evenly around the\n * perimeter (so there's no visible seam where the stroke path closes).\n */\nconst DashedBorder = ({\n width,\n height,\n borderRadius,\n strokeWidth,\n color,\n}: {\n width: number;\n height: number;\n borderRadius: number;\n strokeWidth: number;\n color: string;\n}): React.ReactElement | null => {\n if (width <= 0 || height <= 0) {\n return null;\n }\n\n // Inset the stroke by half its width so it sits fully inside the bounds and the\n // right/bottom edges aren't clipped.\n const inset = strokeWidth / 2;\n const rectWidth = width - strokeWidth;\n const rectHeight = height - strokeWidth;\n const radius = Math.max(borderRadius - inset, 0);\n\n // Perimeter of a rounded rectangle = straight edges + the four quarter-circle corners.\n const straightWidth = Math.max(rectWidth - 2 * radius, 0);\n const straightHeight = Math.max(rectHeight - 2 * radius, 0);\n const perimeter = 2 * straightWidth + 2 * straightHeight + 2 * Math.PI * radius;\n\n // Target a small dot-like dash+gap (~4pt) and round to an integer number of segments so\n // the pattern lands exactly on the path's start/end point (no broken dash on the right edge).\n const targetSegment = 4;\n const segmentCount = Math.max(1, Math.round(perimeter / targetSegment));\n const segmentLength = perimeter / segmentCount;\n const dashLength = segmentLength / 2;\n\n return (\n <View style={StyleSheet.absoluteFill} pointerEvents=\"none\">\n <Svg width={width} height={height}>\n <Rect\n x={inset}\n y={inset}\n width={rectWidth}\n height={rectHeight}\n rx={radius}\n ry={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeDasharray={[dashLength, segmentLength - dashLength]}\n />\n </Svg>\n </View>\n );\n};\n\nconst StyledFilterChip = styled(View)<{\n theme: Theme;\n $isSelected?: boolean;\n $isDisabled?: boolean;\n}>(({ theme, $isDisabled, $isSelected }) => {\n return {\n // When unselected the dashed border is drawn via an SVG overlay (see DashedBorder) so we\n // rely on it entirely: the native border has zero width, keeping the overlay's coordinate\n // space aligned with the border-box and avoiding iOS's buggy dashed+radius render.\n borderWidth: $isSelected ? makeBorderSize(theme.border.width.thin) : 0,\n borderColor: $isSelected\n ? theme.colors.interactive.border.gray[$isDisabled ? 'disabled' : 'faded']\n : 'transparent',\n height: FILTER_CHIP_HEIGHT_NATIVE,\n borderRadius: theme.border.radius.small,\n borderStyle: 'solid',\n backgroundColor: theme.colors.surface.background.gray.intense,\n flexDirection: 'row',\n alignSelf: 'flex-start',\n // The SVG dashed border must not be clipped when unselected; the selected state clips its\n // divider/close button to the rounded corners.\n overflow: $isSelected ? 'hidden' : 'visible',\n };\n});\n\nconst StyledFilterTrigger = styled(Pressable)<{\n theme: Theme;\n $hasClearButton?: boolean;\n}>(({ theme, $hasClearButton }) => {\n const { spacing } = theme;\n return {\n backgroundColor: 'transparent',\n // When a clear button follows the trigger its right corners butt against the divider,\n // so they're squared off. Without a clear button the trigger is a self-contained pill.\n borderRadius: $hasClearButton ? 0 : theme.border.radius.small,\n borderTopLeftRadius: theme.border.radius.small,\n borderBottomLeftRadius: theme.border.radius.small,\n paddingLeft: spacing[4],\n paddingRight: $hasClearButton ? spacing[2] : spacing[3],\n flexDirection: 'row',\n alignItems: 'center',\n height: '100%',\n gap: spacing[2],\n };\n});\n\nconst StyledFilterCloseButton = styled(Pressable)<{ theme: Theme }>(({ theme }) => {\n return {\n backgroundColor: 'transparent',\n borderTopRightRadius: theme.border.radius.small,\n borderBottomRightRadius: theme.border.radius.small,\n paddingLeft: theme.spacing[2] + theme.spacing[1],\n paddingRight: theme.spacing[2] + theme.spacing[1],\n justifyContent: 'center',\n alignItems: 'center',\n height: '100%',\n };\n});\n\nconst renderValue = (\n selectionType: BaseFilterChipProps['selectionType'],\n value: BaseFilterChipProps['value'],\n isDisabled?: boolean,\n): React.ReactElement => {\n const valueColor = isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.normal';\n\n // For multiple selection: when a single option is selected we show its name (no redundant\n // \"1\" counter); once more than one is selected we collapse to a compact counter.\n // Use an explicit type guard so a non-array value (e.g. a plain string returned by\n // getFilterChipDisplayValue) never enters the array branch where .length would be\n // misinterpreted as character count.\n if (selectionType === 'multiple') {\n const valueArray = Array.isArray(value) ? value : value != null ? [value] : [];\n if (valueArray.length === 1) {\n return (\n <Text size=\"small\" weight=\"medium\" color={valueColor} truncateAfterLines={1}>\n {String(valueArray[0] ?? '')}\n </Text>\n );\n }\n return (\n <Box alignItems=\"center\" flexDirection=\"row\">\n <Counter value={valueArray.length} color=\"neutral\" size=\"small\" />\n </Box>\n );\n }\n\n return (\n <Text size=\"small\" weight=\"medium\" color={valueColor}>\n {value != null ? String(value) : ''}\n </Text>\n );\n};\n\nconst _BaseFilterChip: React.ForwardRefRenderFunction<View, BaseFilterChipProps> = (\n {\n value,\n onClearButtonClick,\n label,\n isDisabled,\n selectionType = 'single',\n showClearButton = true,\n onClick,\n onKeyDown,\n accessibilityProps,\n id,\n ...rest\n }: BaseFilterChipProps,\n ref: React.Ref<View>,\n): React.ReactElement => {\n const { theme } = useTheme();\n const isSelected =\n selectionType === 'multiple' ? Array.isArray(value) && value.length > 0 : !!value;\n const shouldShowClearButton = isSelected && showClearButton;\n\n const [chipSize, setChipSize] = React.useState({ width: 0, height: 0 });\n const handleLayout = (event: LayoutChangeEvent): void => {\n const { width, height } = event.nativeEvent.layout;\n setChipSize((prev) =>\n prev.width === width && prev.height === height ? prev : { width, height },\n );\n };\n\n return (\n <StyledFilterChip\n $isDisabled={isDisabled}\n $isSelected={isSelected}\n ref={ref}\n onLayout={isSelected ? undefined : handleLayout}\n >\n <StyledFilterTrigger\n $hasClearButton={shouldShowClearButton}\n disabled={isDisabled}\n id={id}\n onPress={\n isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onClick?.((e as unknown) as React.MouseEventHandler);\n }\n }\n {...(({\n onKeyDown: isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onKeyDown?.((e as unknown) as React.KeyboardEvent<Element>);\n },\n } as unknown) as Record<string, unknown>)}\n {...makeAccessible({\n ...accessibilityProps,\n role: accessibilityProps?.role ?? 'button',\n })}\n {...makeAnalyticsAttribute(rest)}\n {...metaAttribute({ name: 'filter-chip-trigger', testID: rest.testID })}\n >\n <Box flexDirection=\"row\" gap=\"spacing.2\" alignItems=\"center\">\n <Text\n size=\"small\"\n weight=\"medium\"\n color=\"interactive.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {label}\n {isSelected ? ':' : null}\n </Text>\n {isSelected ? renderValue(selectionType, value, isDisabled) : null}\n </Box>\n <Box flexDirection=\"row\" alignItems=\"center\" paddingRight=\"spacing.1\">\n <ChevronDownIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </Box>\n </StyledFilterTrigger>\n {shouldShowClearButton ? (\n <>\n <Divider orientation=\"vertical\" variant={isDisabled ? 'muted' : 'subtle'} />\n <StyledFilterCloseButton\n {...makeAccessible({ label: `Clear ${label} value`, role: 'button' })}\n // value can never be undefined because when it's undefined the button itself doesn't render\n onPress={isDisabled ? undefined : () => onClearButtonClick?.({ value: value ?? '' })}\n disabled={isDisabled}\n {...metaAttribute({ name: 'filter-chip-close-button' })}\n >\n <CloseIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </StyledFilterCloseButton>\n </>\n ) : null}\n {isSelected ? null : (\n <DashedBorder\n width={chipSize.width}\n height={chipSize.height}\n borderRadius={theme.border.radius.small}\n strokeWidth={makeBorderSize(theme.border.width.thin)}\n color={theme.colors.interactive.border.gray[isDisabled ? 'disabled' : 'faded']}\n />\n )}\n </StyledFilterChip>\n );\n};\n\nconst BaseFilterChip = assignWithoutSideEffects(React.forwardRef(_BaseFilterChip), {\n componentId: MetaConstants.BaseFilterChip,\n});\n\nexport { BaseFilterChip };\n"],"names":["FILTER_CHIP_HEIGHT_NATIVE","size","DashedBorder","_ref","width","height","borderRadius","strokeWidth","color","inset","rectWidth","rectHeight","radius","Math","max","straightWidth","straightHeight","perimeter","PI","targetSegment","segmentCount","round","segmentLength","dashLength","_jsx","View","style","StyleSheet","absoluteFill","pointerEvents","children","Svg","Rect","x","y","rx","ry","fill","stroke","strokeDasharray","StyledFilterChip","styled","_ref2","theme","$isDisabled","$isSelected","borderWidth","makeBorderSize","border","thin","borderColor","colors","interactive","gray","small","borderStyle","backgroundColor","surface","background","intense","flexDirection","alignSelf","overflow","StyledFilterTrigger","Pressable","_ref3","$hasClearButton","spacing","borderTopLeftRadius","borderBottomLeftRadius","paddingLeft","paddingRight","alignItems","gap","StyledFilterCloseButton","_ref4","borderTopRightRadius","borderBottomRightRadius","justifyContent","renderValue","selectionType","value","isDisabled","valueColor","valueArray","Array","isArray","length","_valueArray$","Text","weight","truncateAfterLines","String","Box","Counter","_BaseFilterChip","_ref5","ref","_accessibilityProps$r","onClearButtonClick","label","_ref5$selectionType","_ref5$showClearButton","showClearButton","onClick","onKeyDown","accessibilityProps","id","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","isSelected","shouldShowClearButton","_React$useState","React","useState","_React$useState2","_slicedToArray","chipSize","setChipSize","handleLayout","event","_event$nativeEvent$la","nativeEvent","layout","prev","_jsxs","onLayout","undefined","Object","assign","disabled","onPress","e","makeAccessible","role","makeAnalyticsAttribute","metaAttribute","name","testID","ChevronDownIcon","_Fragment","Divider","orientation","variant","CloseIcon","BaseFilterChip","assignWithoutSideEffects","forwardRef","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wRAoBA,IAAMA,yBAAyB,CAAGC,IAAI,CAAC,IAAI,CAAC,CAS5C,IAAMC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAYe,CAX/B,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,YAAY,CAAAH,IAAA,CAAZG,YAAY,CACZC,WAAW,CAAAJ,IAAA,CAAXI,WAAW,CACXC,KAAK,CAAAL,IAAA,CAALK,KAAK,CAQL,GAAIJ,KAAK,EAAI,CAAC,EAAIC,MAAM,EAAI,CAAC,CAAE,CAC7B,OAAW,IAAA,CACb,CAIA,IAAMI,KAAK,CAAGF,WAAW,CAAG,CAAC,CAC7B,IAAMG,SAAS,CAAGN,KAAK,CAAGG,WAAW,CACrC,IAAMI,UAAU,CAAGN,MAAM,CAAGE,WAAW,CACvC,IAAMK,MAAM,CAAGC,IAAI,CAACC,GAAG,CAACR,YAAY,CAAGG,KAAK,CAAE,CAAC,CAAC,CAGhD,IAAMM,aAAa,CAAGF,IAAI,CAACC,GAAG,CAACJ,SAAS,CAAG,CAAC,CAAGE,MAAM,CAAE,CAAC,CAAC,CACzD,IAAMI,cAAc,CAAGH,IAAI,CAACC,GAAG,CAACH,UAAU,CAAG,CAAC,CAAG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IAAI,CACPyG,UAAU,CAAG,IAAI,CAChBzF,GAAA,CAACtB,YAAY,EACXE,KAAK,CAAEoH,QAAQ,CAACpH,KAAM,CACtBC,MAAM,CAAEmH,QAAQ,CAACnH,MAAO,CACxBC,YAAY,CAAEqC,KAAK,CAACK,MAAM,CAACpC,MAAM,CAAC0C,KAAM,CACxC/C,WAAW,CAAEwC,cAAc,CAACJ,KAAK,CAACK,MAAM,CAAC5C,KAAK,CAAC6C,IAAI,CAAE,CACrDzC,KAAK,CAAEmC,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACJ,MAAM,CAACK,IAAI,CAAC6B,UAAU,CAAG,UAAU,CAAG,OAAO,CAAE,CAChF,CACF,CACe,CAAA,CAAC,CAEvB,CAAC,CAEK,IAAAkE,cAAc,CAAGC,wBAAwB,CAACjC,cAAK,CAACkC,UAAU,CAACvD,eAAe,CAAC,CAAE,CACjFwD,WAAW,CAAEC,aAAa,CAACJ,cAC7B,CAAC;;;;"}
@@ -1,10 +1,14 @@
1
- import '../Typography/index.js';
1
+ import React__default from 'react';
2
+ import { findNodeHandle, UIManager, View } from 'react-native';
3
+ import Animated, { useSharedValue, withTiming, useAnimatedStyle, interpolateColor } from 'react-native-reanimated';
4
+ import { useMemoizedStyles } from '../Box/BaseBox/useMemoizedStyles.native.js';
5
+ import '../../utils/index.js';
2
6
  import '../../utils/logger/index.js';
3
- import { jsx } from 'react/jsx-runtime';
4
- import { throwBladeError } from '../../utils/logger/logger.js';
5
- import { Text } from '../Typography/Text/Text.js';
7
+ import { jsx, Fragment } from 'react/jsx-runtime';
8
+ import useTheme from '../BladeProvider/useTheme.js';
9
+ import { logger } from '../../utils/logger/logger.js';
6
10
 
7
- var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Morph/Morph.native.tsx";var Morph=function Morph(_props){throwBladeError({message:'Morph is not yet implemented for native',moduleName:'Morph'});return jsx(Text,{children:"Morph Component is not available for Native mobile apps."});};
11
+ var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Morph/Morph.native.tsx";var liveLayouts=new Map();var pendingHandoffs=new Map();var handoffTimers=new Map();var HANDOFF_TTL_MS=1500;var measureNodeInWindow=function measureNodeInWindow(node,onMeasured){if(!node)return;var handle=findNodeHandle(node);if(handle!=null&&typeof UIManager.measureInWindow==='function'){UIManager.measureInWindow(handle,function(x,y,width,height){if(!(width>0&&height>0))return;onMeasured({x:x,y:y,width:width,height:height,ts:Date.now()});});return;}var measurable=node;if(typeof measurable.measure==='function'){measurable.measure(function(_x,_y,width,height,pageX,pageY){if(!(width>0&&height>0))return;onMeasured({x:pageX,y:pageY,width:width,height:height,ts:Date.now()});});}};var Morph=function Morph(_ref){var _ref2,_theme$motion$duratio;var children=_ref.children,layoutId=_ref.layoutId;var _useTheme=useTheme(),theme=_useTheme.theme;var measureRef=React__default.useRef(null);var lastKnownLayout=React__default.useRef(null);var incomingHandoff=React__default.useRef(null);var hasPlayedHandoff=React__default.useRef(false);var rafIdRef=React__default.useRef(null);var isValidChild=React__default.isValidElement(children);var childProps=(_ref2=children==null?void 0:children.props)!=null?_ref2:{};var rawBorderRadius=childProps.borderRadius;var rawBackgroundColor=childProps.backgroundColor;var cssProps=useMemoizedStyles({borderRadius:rawBorderRadius,backgroundColor:rawBackgroundColor,theme:theme});var toRadius=typeof cssProps.borderRadius==='number'?cssProps.borderRadius:undefined;var toColor=typeof cssProps.backgroundColor==='string'?cssProps.backgroundColor:undefined;var progress=useSharedValue(0);var fromRadius=useSharedValue(toRadius!=null?toRadius:0);var toRadiusSV=useSharedValue(toRadius!=null?toRadius:0);var fromColor=useSharedValue(toColor!=null?toColor:'transparent');var toColorSV=useSharedValue(toColor!=null?toColor:'transparent');var translateX=useSharedValue(0);var translateY=useSharedValue(0);var scaleX=useSharedValue(1);var scaleY=useSharedValue(1);var opacity=useSharedValue(0);var duration=(_theme$motion$duratio=theme.motion.duration.gentle)!=null?_theme$motion$duratio:theme.motion.duration.moderate;var easing=theme.motion.easing.standard;var timingConfig=React__default.useMemo(function(){return {duration:duration,easing:easing};},[duration,easing]);React__default.useLayoutEffect(function(){var prev=pendingHandoffs.get(layoutId);if(prev&&Date.now()-prev.ts<HANDOFF_TTL_MS){pendingHandoffs.delete(layoutId);var timer=handoffTimers.get(layoutId);if(timer){clearTimeout(timer);handoffTimers.delete(layoutId);}incomingHandoff.current=prev;if(__DEV__){logger({moduleName:'Morph',type:'log',message:`consumed handoff for "${layoutId}" from y=${Math.round(prev.y)}`});}}return function(){var _liveLayouts$get;var live=(_liveLayouts$get=liveLayouts.get(layoutId))!=null?_liveLayouts$get:lastKnownLayout.current;if(live){pendingHandoffs.set(layoutId,Object.assign({},live,{ts:Date.now()}));var existingTimer=handoffTimers.get(layoutId);if(existingTimer)clearTimeout(existingTimer);handoffTimers.set(layoutId,setTimeout(function(){pendingHandoffs.delete(layoutId);handoffTimers.delete(layoutId);},HANDOFF_TTL_MS));if(__DEV__){logger({moduleName:'Morph',type:'log',message:`stashed handoff for "${layoutId}" at y=${Math.round(live.y)}`});}}liveLayouts.delete(layoutId);};},[layoutId]);var playHandoffIfNeeded=React__default.useCallback(function(current){lastKnownLayout.current=current;liveLayouts.set(layoutId,current);if(hasPlayedHandoff.current)return;var prev=incomingHandoff.current;if(prev&&prev.width>0&&prev.height>0){var isSameElement=Math.abs(prev.width-current.width)<1&&Math.abs(prev.height-current.height)<1&&Math.abs(prev.x-current.x)<1&&Math.abs(prev.y-current.y)<1;if(isSameElement){incomingHandoff.current=null;hasPlayedHandoff.current=true;opacity.value=withTiming(1,{duration:theme.motion.duration.xquick,easing:easing});return;}hasPlayedHandoff.current=true;incomingHandoff.current=null;var startTX=prev.x+prev.width/2-(current.x+current.width/2);var startTY=prev.y+prev.height/2-(current.y+current.height/2);var startSX=Math.max(0.01,prev.width/current.width);var startSY=Math.max(0.01,prev.height/current.height);if(__DEV__){logger({moduleName:'Morph',type:'log',message:`FLIP "${layoutId}" Δy=${Math.round(startTY)} scale=${startSX.toFixed(2)}`});}translateX.value=startTX;translateY.value=startTY;scaleX.value=startSX;scaleY.value=startSY;opacity.value=1;rafIdRef.current=requestAnimationFrame(function(){rafIdRef.current=null;translateX.value=withTiming(0,timingConfig);translateY.value=withTiming(0,timingConfig);scaleX.value=withTiming(1,timingConfig);scaleY.value=withTiming(1,timingConfig);});return;}hasPlayedHandoff.current=true;opacity.value=withTiming(1,{duration:theme.motion.duration.xquick,easing:easing});},[layoutId,timingConfig,theme.motion.duration.xquick,easing]);React__default.useEffect(function(){fromRadius.value=toRadiusSV.value;toRadiusSV.value=toRadius!=null?toRadius:fromRadius.value;fromColor.value=toColorSV.value;toColorSV.value=toColor!=null?toColor:fromColor.value;progress.value=0;progress.value=withTiming(1,timingConfig);},[toColor,toRadius]);var onLayout=React__default.useCallback(function(_e){measureNodeInWindow(measureRef.current,playHandoffIfNeeded);},[playHandoffIfNeeded]);React__default.useEffect(function(){var ids=[32,100,250].map(function(ms){return setTimeout(function(){if(!hasPlayedHandoff.current){measureNodeInWindow(measureRef.current,playHandoffIfNeeded);}},ms);});var safetyNetId=setTimeout(function(){if(!hasPlayedHandoff.current){hasPlayedHandoff.current=true;opacity.value=withTiming(1,{duration:theme.motion.duration.xquick,easing:easing});if(__DEV__){logger({moduleName:'Morph',type:'warn',message:`safety-net timeout fired for "${layoutId}" revealing without FLIP`});}}},500);return function(){ids.forEach(clearTimeout);clearTimeout(safetyNetId);if(rafIdRef.current!==null){cancelAnimationFrame(rafIdRef.current);rafIdRef.current=null;}};},[playHandoffIfNeeded]);var animatedStyle=useAnimatedStyle(function(){var style={opacity:opacity.value,transform:[{translateX:translateX.value},{translateY:translateY.value},{scaleX:scaleX.value},{scaleY:scaleY.value}]};if(toColor!==undefined){style.backgroundColor=interpolateColor(progress.value,[0,1],[fromColor.value,toColorSV.value]);}if(toRadius!==undefined){style.borderRadius=fromRadius.value+(toRadiusSV.value-fromRadius.value)*progress.value;}return style;});if(!isValidChild){return jsx(Fragment,{children:children});}var child=React__default.cloneElement(children,{backgroundColor:undefined,borderRadius:undefined});return(jsx(View,{ref:measureRef,collapsable:false,onLayout:onLayout,style:{alignSelf:'center'},children:jsx(Animated.View,{style:animatedStyle,children:child})}));};
8
12
 
9
13
  export { Morph };
10
14
  //# sourceMappingURL=Morph.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Morph.native.js","sources":["../../../../../src/components/Morph/Morph.native.tsx"],"sourcesContent":["import type { MorphProps } from './types';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\n\nconst Morph = (_props: MorphProps): React.ReactElement => {\n throwBladeError({\n message: 'Morph is not yet implemented for native',\n moduleName: 'Morph',\n });\n\n return <Text>Morph Component is not available for Native mobile apps.</Text>;\n};\n\nexport { Morph };\n"],"names":["Morph","_props","throwBladeError","message","moduleName","_jsx","Text","children"],"mappings":";;;;;;sHAIM,IAAAA,KAAK,CAAG,SAARA,KAAKA,CAAIC,MAAkB,CAAyB,CACxDC,eAAe,CAAC,CACdC,OAAO,CAAE,yCAAyC,CAClDC,UAAU,CAAE,OACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAA,CAAAC,QAAA,CAAC,0DAAwD,CAAM,CAAC,CAC9E;;;;"}
1
+ {"version":3,"file":"Morph.native.js","sources":["../../../../../src/components/Morph/Morph.native.tsx"],"sourcesContent":["import React from 'react';\nimport { findNodeHandle, UIManager, View } from 'react-native';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport Animated, {\n useSharedValue,\n useAnimatedStyle,\n withTiming,\n interpolateColor,\n} from 'react-native-reanimated';\nimport type { MorphProps } from './types';\nimport { useMemoizedStyles } from '~components/Box/BaseBox/useMemoizedStyles';\nimport type { BoxProps } from '~components/Box';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~utils';\nimport { logger } from '~utils/logger';\n\ntype LayoutRect = {\n x: number;\n y: number;\n width: number;\n height: number;\n ts: number;\n};\n\n/**\n * Live window bounds for currently mounted Morphs (updated on every layout).\n * Copied into `pendingHandoffs` on unmount so the next Morph with the same\n * `layoutId` can FLIP from the previous element's position (e.g. card center → page top).\n */\nconst liveLayouts = new Map<string, LayoutRect>();\nconst pendingHandoffs = new Map<string, LayoutRect>();\n// Timers for self-expiring pendingHandoffs entries, keyed by layoutId.\nconst handoffTimers = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst HANDOFF_TTL_MS = 1500;\n\nconst measureNodeInWindow = (node: View | null, onMeasured: (rect: LayoutRect) => void): void => {\n if (!node) return;\n\n // Prefer UIManager + findNodeHandle — reliable for both View and host refs.\n const handle = findNodeHandle(node);\n if (handle != null && typeof UIManager.measureInWindow === 'function') {\n UIManager.measureInWindow(handle, (x, y, width, height) => {\n if (!(width > 0 && height > 0)) return;\n onMeasured({ x, y, width, height, ts: Date.now() });\n });\n return;\n }\n\n // Fallback: View.measure → pageX / pageY are window-relative.\n const measurable = node as View & {\n measure?: (\n cb: (x: number, y: number, w: number, h: number, pageX: number, pageY: number) => void,\n ) => void;\n };\n if (typeof measurable.measure === 'function') {\n measurable.measure((_x, _y, width, height, pageX, pageY) => {\n if (!(width > 0 && height > 0)) return;\n onMeasured({ x: pageX, y: pageY, width, height, ts: Date.now() });\n });\n }\n};\n\n/**\n * Morph (native) — approximates web framer `layout`/`layoutId` FLIP.\n *\n * MorphOnText: card heading (center) unmounts → page Display (top) mounts starting at the\n * card's window position, then animates to the top.\n */\nconst Morph = ({ children, layoutId }: MorphProps): React.ReactElement => {\n const { theme } = useTheme();\n const measureRef = React.useRef<View>(null);\n const lastKnownLayout = React.useRef<LayoutRect | null>(null);\n const incomingHandoff = React.useRef<LayoutRect | null>(null);\n const hasPlayedHandoff = React.useRef(false);\n const rafIdRef = React.useRef<number | null>(null);\n\n // Determine child validity before any hooks that depend on child props.\n // All hooks below MUST be called unconditionally (Rules of Hooks).\n const isValidChild = React.isValidElement(children);\n const childProps = (children?.props as Record<string, unknown>) ?? {};\n const rawBorderRadius = childProps.borderRadius;\n const rawBackgroundColor = childProps.backgroundColor;\n\n const cssProps = useMemoizedStyles(({\n borderRadius: rawBorderRadius,\n backgroundColor: rawBackgroundColor,\n theme,\n } as unknown) as BoxProps & { theme: Theme });\n\n const toRadius = typeof cssProps.borderRadius === 'number' ? cssProps.borderRadius : undefined;\n const toColor =\n typeof cssProps.backgroundColor === 'string' ? cssProps.backgroundColor : undefined;\n\n const progress = useSharedValue(0);\n const fromRadius = useSharedValue(toRadius ?? 0);\n const toRadiusSV = useSharedValue(toRadius ?? 0);\n const fromColor = useSharedValue(toColor ?? 'transparent');\n const toColorSV = useSharedValue(toColor ?? 'transparent');\n\n const translateX = useSharedValue(0);\n const translateY = useSharedValue(0);\n const scaleX = useSharedValue(1);\n const scaleY = useSharedValue(1);\n // Hidden until we know whether to FLIP from a previous layoutId instance.\n const opacity = useSharedValue(0);\n\n const duration = theme.motion.duration.gentle ?? theme.motion.duration.moderate;\n const easing = theme.motion.easing.standard;\n const timingConfig = React.useMemo(() => ({ duration, easing }), [duration, easing]);\n\n // Grab any pending handoff synchronously before paint of children that replace us.\n React.useLayoutEffect(() => {\n const prev = pendingHandoffs.get(layoutId);\n if (prev && Date.now() - prev.ts < HANDOFF_TTL_MS) {\n pendingHandoffs.delete(layoutId);\n // Clear any pending self-expiry timer since we consumed the entry.\n const timer = handoffTimers.get(layoutId);\n if (timer) {\n clearTimeout(timer);\n handoffTimers.delete(layoutId);\n }\n incomingHandoff.current = prev;\n if (__DEV__) {\n logger({\n moduleName: 'Morph',\n type: 'log',\n message: `consumed handoff for \"${layoutId}\" from y=${Math.round(prev.y)}`,\n });\n }\n }\n\n return () => {\n const live = liveLayouts.get(layoutId) ?? lastKnownLayout.current;\n if (live) {\n pendingHandoffs.set(layoutId, { ...live, ts: Date.now() });\n // Self-expiry: if no subsequent Morph with the same layoutId consumes this\n // entry within the TTL, clean it up to prevent unbounded Map growth.\n const existingTimer = handoffTimers.get(layoutId);\n if (existingTimer) clearTimeout(existingTimer);\n handoffTimers.set(\n layoutId,\n setTimeout(() => {\n pendingHandoffs.delete(layoutId);\n handoffTimers.delete(layoutId);\n }, HANDOFF_TTL_MS),\n );\n if (__DEV__) {\n logger({\n moduleName: 'Morph',\n type: 'log',\n message: `stashed handoff for \"${layoutId}\" at y=${Math.round(live.y)}`,\n });\n }\n }\n liveLayouts.delete(layoutId);\n };\n }, [layoutId]);\n\n const playHandoffIfNeeded = React.useCallback(\n (current: LayoutRect): void => {\n lastKnownLayout.current = current;\n liveLayouts.set(layoutId, current);\n\n if (hasPlayedHandoff.current) return;\n\n const prev = incomingHandoff.current;\n if (prev && prev.width > 0 && prev.height > 0) {\n // Strict Mode guard: in dev, React mounts → unmounts → remounts. The cleanup\n // stashes the live layout into pendingHandoffs, and the second mount consumes\n // it — causing a spurious self-FLIP. Skip if the incoming handoff dimensions\n // match the current element's dimensions (same element, not a true handoff).\n const isSameElement =\n Math.abs(prev.width - current.width) < 1 &&\n Math.abs(prev.height - current.height) < 1 &&\n Math.abs(prev.x - current.x) < 1 &&\n Math.abs(prev.y - current.y) < 1;\n if (isSameElement) {\n incomingHandoff.current = null;\n hasPlayedHandoff.current = true;\n opacity.value = withTiming(1, { duration: theme.motion.duration.xquick, easing });\n return;\n }\n\n hasPlayedHandoff.current = true;\n incomingHandoff.current = null;\n\n const startTX = prev.x + prev.width / 2 - (current.x + current.width / 2);\n const startTY = prev.y + prev.height / 2 - (current.y + current.height / 2);\n const startSX = Math.max(0.01, prev.width / current.width);\n const startSY = Math.max(0.01, prev.height / current.height);\n\n if (__DEV__) {\n logger({\n moduleName: 'Morph',\n type: 'log',\n message: `FLIP \"${layoutId}\" Δy=${Math.round(startTY)} scale=${startSX.toFixed(2)}`,\n });\n }\n\n // Pose at previous element (center of card) first…\n translateX.value = startTX;\n translateY.value = startTY;\n scaleX.value = startSX;\n scaleY.value = startSY;\n opacity.value = 1;\n\n // …then animate to natural layout (top).\n rafIdRef.current = requestAnimationFrame(() => {\n rafIdRef.current = null;\n translateX.value = withTiming(0, timingConfig);\n translateY.value = withTiming(0, timingConfig);\n scaleX.value = withTiming(1, timingConfig);\n scaleY.value = withTiming(1, timingConfig);\n });\n return;\n }\n\n // Cold mount — fade in at natural position.\n hasPlayedHandoff.current = true;\n opacity.value = withTiming(1, { duration: theme.motion.duration.xquick, easing });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [layoutId, timingConfig, theme.motion.duration.xquick, easing],\n );\n\n React.useEffect(() => {\n fromRadius.value = toRadiusSV.value;\n toRadiusSV.value = toRadius ?? fromRadius.value;\n fromColor.value = toColorSV.value;\n toColorSV.value = toColor ?? fromColor.value;\n progress.value = 0;\n progress.value = withTiming(1, timingConfig);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [toColor, toRadius]);\n\n const onLayout = React.useCallback(\n (_e: LayoutChangeEvent) => {\n measureNodeInWindow(measureRef.current, playHandoffIfNeeded);\n },\n [playHandoffIfNeeded],\n );\n\n // Retry measure — first onLayout can run before text has intrinsic size.\n React.useEffect(() => {\n const ids = [32, 100, 250].map((ms) =>\n setTimeout(() => {\n if (!hasPlayedHandoff.current) {\n measureNodeInWindow(measureRef.current, playHandoffIfNeeded);\n }\n }, ms),\n );\n // Safety-net: if all measurement attempts fail (off-screen, zero size, unresponsive\n // bridge), unconditionally reveal the element so it doesn't stay invisible forever.\n const safetyNetId = setTimeout(() => {\n if (!hasPlayedHandoff.current) {\n hasPlayedHandoff.current = true;\n opacity.value = withTiming(1, { duration: theme.motion.duration.xquick, easing });\n if (__DEV__) {\n logger({\n moduleName: 'Morph',\n type: 'warn',\n message: `safety-net timeout fired for \"${layoutId}\" — revealing without FLIP`,\n });\n }\n }\n }, 500);\n return () => {\n ids.forEach(clearTimeout);\n clearTimeout(safetyNetId);\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n rafIdRef.current = null;\n }\n };\n }, [playHandoffIfNeeded]);\n\n const animatedStyle = useAnimatedStyle(() => {\n const style: ViewStyle = {\n opacity: opacity.value,\n transform: [\n { translateX: translateX.value },\n { translateY: translateY.value },\n { scaleX: scaleX.value },\n { scaleY: scaleY.value },\n ],\n };\n if (toColor !== undefined) {\n style.backgroundColor = interpolateColor(\n progress.value,\n [0, 1],\n [fromColor.value, toColorSV.value],\n );\n }\n if (toRadius !== undefined) {\n style.borderRadius =\n fromRadius.value + (toRadiusSV.value - fromRadius.value) * progress.value;\n }\n return style;\n });\n\n // Guard: Morph expects a single React element child (e.g. <Box>) so it can read\n // borderRadius/backgroundColor from props and clone it. Strings, numbers, arrays,\n // fragments, or null are not valid — render them as-is without animation.\n // This early return is placed AFTER all hooks to satisfy the Rules of Hooks.\n if (!isValidChild) {\n return <>{children}</>;\n }\n\n const child = React.cloneElement(children, {\n backgroundColor: undefined,\n borderRadius: undefined,\n } as Partial<Record<string, undefined>> & React.Attributes);\n\n return (\n // Outer RN View owns measurement; inner Reanimated view owns the FLIP transform.\n <View ref={measureRef} collapsable={false} onLayout={onLayout} style={{ alignSelf: 'center' }}>\n <Animated.View style={animatedStyle}>{child}</Animated.View>\n </View>\n );\n};\n\nexport { Morph };\n"],"names":["liveLayouts","Map","pendingHandoffs","handoffTimers","HANDOFF_TTL_MS","measureNodeInWindow","node","onMeasured","handle","findNodeHandle","UIManager","measureInWindow","x","y","width","height","ts","Date","now","measurable","measure","_x","_y","pageX","pageY","Morph","_ref","_ref2","_theme$motion$duratio","children","layoutId","_useTheme","useTheme","theme","measureRef","React","useRef","lastKnownLayout","incomingHandoff","hasPlayedHandoff","rafIdRef","isValidChild","isValidElement","childProps","props","rawBorderRadius","borderRadius","rawBackgroundColor","backgroundColor","cssProps","useMemoizedStyles","toRadius","undefined","toColor","progress","useSharedValue","fromRadius","toRadiusSV","fromColor","toColorSV","translateX","translateY","scaleX","scaleY","opacity","duration","motion","gentle","moderate","easing","standard","timingConfig","useMemo","useLayoutEffect","prev","get","delete","timer","clearTimeout","current","__DEV__","logger","moduleName","type","message","Math","round","_liveLayouts$get","live","set","Object","assign","existingTimer","setTimeout","playHandoffIfNeeded","useCallback","isSameElement","abs","value","withTiming","xquick","startTX","startTY","startSX","max","startSY","toFixed","requestAnimationFrame","useEffect","onLayout","_e","ids","map","ms","safetyNetId","forEach","cancelAnimationFrame","animatedStyle","useAnimatedStyle","style","transform","interpolateColor","_jsx","_Fragment","child","cloneElement","View","ref","collapsable","alignSelf","Animated"],"mappings":";;;;;;;;;;sHA6BA,IAAMA,WAAW,CAAG,IAAIC,GAAG,EAAsB,CACjD,IAAMC,eAAe,CAAG,IAAID,GAAG,EAAsB,CAErD,IAAME,aAAa,CAAG,IAAIF,GAAG,EAAyC,CAEtE,IAAMG,cAAc,CAAG,IAAI,CAE3B,IAAMC,mBAAmB,CAAG,SAAtBA,mBAAmBA,CAAIC,IAAiB,CAAEC,UAAsC,CAAW,CAC/F,GAAI,CAACD,IAAI,CAAE,OAGX,IAAME,MAAM,CAAGC,cAAc,CAACH,IAAI,CAAC,CACnC,GAAIE,MAAM,EAAI,IAAI,EAAI,OAAOE,SAAS,CAACC,eAAe,GAAK,UAAU,CAAE,CACrED,SAAS,CAACC,eAAe,CAACH,MAAM,CAAE,SAACI,CAAC,CAAEC,CAAC,CAAEC,KAAK,CAAEC,MAAM,CAAK,CACzD,GAAI,EAAED,KAAK,CAAG,CAAC,EAAIC,MAAM,CAAG,CAAC,CAAC,CAAE,OAChCR,UAAU,CAAC,CAAEK,CAAC,CAADA,CAAC,CAAEC,CAAC,CAADA,CAAC,CAAEC,KAAK,CAALA,KAAK,CAAEC,MAAM,CAANA,MAAM,CAAEC,EAAE,CAAEC,IAAI,CAACC,GAAG,EAAG,CAAC,CAAC,CACrD,CAAC,CAAC,CACF,OACF,CAGA,IAAMC,UAAU,CAAGb,IAIlB,CACD,GAAI,OAAOa,UAAU,CAACC,OAAO,GAAK,UAAU,CAAE,CAC5CD,UAAU,CAACC,OAAO,CAAC,SAACC,EAAE,CAAEC,EAAE,CAAER,KAAK,CAAEC,MAAM,CAAEQ,KAAK,CAAEC,KAAK,CA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A,GAAI/C,QAAQ,GAAKC,SAAS,CAAE,CAC1BmE,KAAK,CAACzE,YAAY,CAChBU,UAAU,CAAC0C,KAAK,CAAG,CAACzC,UAAU,CAACyC,KAAK,CAAG1C,UAAU,CAAC0C,KAAK,EAAI5C,QAAQ,CAAC4C,KAAK,CAC7E,CACA,OAAOqB,KAAK,CACd,CAAC,CAAC,CAMF,GAAI,CAAC9E,YAAY,CAAE,CACjB,OAAOiF,GAAA,CAAAC,QAAA,EAAA9F,QAAA,CAAGA,QAAQ,CAAG,CAAC,CACxB,CAEA,IAAM+F,KAAK,CAAGzF,cAAK,CAAC0F,YAAY,CAAChG,QAAQ,CAAE,CACzCmB,eAAe,CAAEI,SAAS,CAC1BN,YAAY,CAAEM,SAChB,CAA0D,CAAC,CAE3D,OAEEsE,GAAA,CAACI,IAAI,CAAA,CAACC,GAAG,CAAE7F,UAAW,CAAC8F,WAAW,CAAE,KAAM,CAACnB,QAAQ,CAAEA,QAAS,CAACU,KAAK,CAAE,CAAEU,SAAS,CAAE,QAAS,CAAE,CAAApG,QAAA,CAC5F6F,GAAA,CAACQ,QAAQ,CAACJ,IAAI,CAAA,CAACP,KAAK,CAAEF,aAAc,CAAAxF,QAAA,CAAE+F,KAAK,CAAgB,CAAC,CACxD,CAAC,EAEX;;;;"}
@@ -1,10 +1,13 @@
1
- import '../Typography/index.js';
2
- import '../../utils/logger/index.js';
1
+ import 'react';
2
+ import '../BaseMotion/index.js';
3
+ import { msToSeconds } from '../../utils/msToSeconds.js';
4
+ import '../../utils/index.js';
3
5
  import { jsx } from 'react/jsx-runtime';
4
- import { throwBladeError } from '../../utils/logger/logger.js';
5
- import { Text } from '../Typography/Text/Text.js';
6
+ import useTheme from '../BladeProvider/useTheme.js';
7
+ import { makeSpace } from '../../utils/makeSpace/makeSpace.js';
8
+ import { BaseMotionEntryExit } from '../BaseMotion/BaseMotion.native.js';
6
9
 
7
- var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Move/Move.native.tsx";var Move=function Move(_props){throwBladeError({message:'Move is not yet implemented for native',moduleName:'Move'});return jsx(Text,{children:"Move Component is not available for Native mobile apps."});};
10
+ var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Move/Move.native.tsx";var ENTRANCE_EASING=[0,0,0.2,1];var EXIT_EASING=[0.17,0,1,1];var Move=function Move(_ref){var children=_ref.children,_ref$type=_ref.type,type=_ref$type===void 0?'inout':_ref$type,isVisible=_ref.isVisible,motionTriggers=_ref.motionTriggers,shouldUnmountWhenHidden=_ref.shouldUnmountWhenHidden,delay=_ref.delay;var _useTheme=useTheme(),theme=_useTheme.theme;var enterDelay=typeof delay==='object'?delay.enter:delay;var exitDelay=typeof delay==='object'?delay.exit:delay;var movePx=makeSpace(theme.spacing[5]);var moveVariants={initial:{opacity:0,transform:`translateY(${movePx})`},animate:{opacity:1,transform:`translateY(${makeSpace(theme.spacing[0])})`,transition:Object.assign({},enterDelay?{delay:msToSeconds(theme.motion.delay[enterDelay])}:{},{duration:msToSeconds(theme.motion.duration.xmoderate),ease:[].concat(ENTRANCE_EASING)})},exit:{opacity:0,transform:`translateY(${movePx})`,transition:Object.assign({},exitDelay?{delay:msToSeconds(theme.motion.delay[exitDelay])}:{},{duration:msToSeconds(theme.motion.duration.quick),ease:[].concat(EXIT_EASING)})}};return jsx(BaseMotionEntryExit,{motionVariants:moveVariants,children:children,type:type,isVisible:isVisible,motionTriggers:motionTriggers,shouldUnmountWhenHidden:shouldUnmountWhenHidden});};
8
11
 
9
12
  export { Move };
10
13
  //# sourceMappingURL=Move.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Move.native.js","sources":["../../../../../src/components/Move/Move.native.tsx"],"sourcesContent":["import type { MoveProps } from './types';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\n\nconst Move = (_props: MoveProps): React.ReactElement => {\n throwBladeError({\n message: 'Move is not yet implemented for native',\n moduleName: 'Move',\n });\n\n return <Text>Move Component is not available for Native mobile apps.</Text>;\n};\n\nexport { Move };\n"],"names":["Move","_props","throwBladeError","message","moduleName","_jsx","Text","children"],"mappings":";;;;;;oHAIM,IAAAA,IAAI,CAAG,SAAPA,IAAIA,CAAIC,MAAiB,CAAyB,CACtDC,eAAe,CAAC,CACdC,OAAO,CAAE,wCAAwC,CACjDC,UAAU,CAAE,MACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAA,CAAAC,QAAA,CAAC,yDAAuD,CAAM,CAAC,CAC7E;;;;"}
1
+ {"version":3,"file":"Move.native.js","sources":["../../../../../src/components/Move/Move.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { MoveProps } from './types';\nimport { BaseMotionEntryExit } from '~components/BaseMotion';\nimport type { MotionVariantsType } from '~components/BaseMotion';\nimport { msToSeconds } from '~utils/msToSeconds';\nimport { makeSpace, useTheme } from '~utils';\n\n// The native interpreter (`baseMotionInterpreter.native.ts` → `getTiming`) expects `ease` as a\n// [x1, y1, x2, y2] cubic-bezier array. On native, `theme.motion.easing.*` is an opaque\n// `EasingFactoryFn` (not a `cubic-bezier(...)` string), so `cssBezierToArray(castWebType(...))`\n// would crash. We mirror the token control points directly instead.\n// Keep in sync with tokens/global/motion.ts (easing.entrance / easing.exit).\nconst ENTRANCE_EASING = [0, 0, 0.2, 1] as const; // matches easing.entrance\nconst EXIT_EASING = [0.17, 0, 1, 1] as const; // matches easing.exit\n\n/**\n * ## Move\n *\n * Move is one of the motion presets that we expose from blade to help you make components appear / disappear with move\n *\n * ### Usage\n *\n * #### Move in on mount\n *\n * ```jsx\n * <Move>\n * <Card />\n * </Move>\n * ```\n *\n * #### Conditionally move based on state\n *\n * ```jsx\n * <Move isVisible={isVisibleState}>\n * <Card />\n * </Move>\n * ```\n */\nconst Move = ({\n children,\n type = 'inout',\n isVisible,\n motionTriggers,\n shouldUnmountWhenHidden,\n delay,\n}: MoveProps): React.ReactElement => {\n const { theme } = useTheme();\n const enterDelay = typeof delay === 'object' ? delay.enter : delay;\n const exitDelay = typeof delay === 'object' ? delay.exit : delay;\n\n const movePx = makeSpace(theme.spacing[5]);\n\n const moveVariants: MotionVariantsType = {\n initial: {\n opacity: 0,\n transform: `translateY(${movePx})`,\n },\n animate: {\n opacity: 1,\n transform: `translateY(${makeSpace(theme.spacing[0])})`,\n transition: {\n // We have to make sure we don't add delay prop because if we define it, it takes precedence in stagger.\n // Even setting `undefined` would break the stagger\n ...(enterDelay ? { delay: msToSeconds(theme.motion.delay[enterDelay]) } : {}),\n duration: msToSeconds(theme.motion.duration.xmoderate),\n ease: [...ENTRANCE_EASING],\n },\n },\n exit: {\n opacity: 0,\n transform: `translateY(${movePx})`,\n transition: {\n ...(exitDelay ? { delay: msToSeconds(theme.motion.delay[exitDelay]) } : {}),\n duration: msToSeconds(theme.motion.duration.quick),\n ease: [...EXIT_EASING],\n },\n },\n };\n\n return (\n <BaseMotionEntryExit\n motionVariants={moveVariants}\n children={children}\n type={type}\n isVisible={isVisible}\n motionTriggers={motionTriggers}\n shouldUnmountWhenHidden={shouldUnmountWhenHidden}\n />\n );\n};\n\nexport { Move };\n"],"names":["this","ENTRANCE_EASING","EXIT_EASING","Move","_ref","children","_ref$type","type","isVisible","motionTriggers","shouldUnmountWhenHidden","delay","_useTheme","useTheme","theme","enterDelay","enter","exitDelay","exit","movePx","makeSpace","spacing","moveVariants","initial","opacity","transform","animate","transition","Object","assign","msToSeconds","motion","duration","xmoderate","ease","concat","quick","_jsx","BaseMotionEntryExit","motionVariants"],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,kFAAA,CAYA,IAAMC,eAAe,CAAG,CAAC,CAAC,CAAE,CAAC,CAAE,GAAG,CAAE,CAAC,CAAU,CAC/C,IAAMC,WAAW,CAAG,CAAC,IAAI,CAAE,CAAC,CAAE,CAAC,CAAE,CAAC,CAAU,CAyBtC,IAAAC,IAAI,CAAG,SAAPA,IAAIA,CAAAC,IAAA,CAO2B,CANnC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MAAA,CAAMlC,eAAe,CAAC,CAE9B,CAAA,CAAC,CACDiB,IAAI,CAAE,CACJM,OAAO,CAAE,CAAC,CACVC,SAAS,CAAE,CAAcN,WAAAA,EAAAA,MAAM,CAAG,CAAA,CAAA,CAClCQ,UAAU,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACJZ,SAAS,CAAG,CAAEN,KAAK,CAAEmB,WAAW,CAAChB,KAAK,CAACiB,MAAM,CAACpB,KAAK,CAACM,SAAS,CAAC,CAAE,CAAC,CAAG,EAAE,CAC1Ee,CAAAA,QAAQ,CAAEF,WAAW,CAAChB,KAAK,CAACiB,MAAM,CAACC,QAAQ,CAACI,KAAK,CAAC,CAClDF,IAAI,CAAA,EAAA,CAAAC,MAAA,CAAMjC,WAAW,CAAC,CAAA,CAE1B,CACF,CAAC,CAED,OACEmC,GAAA,CAACC,mBAAmB,EAClBC,cAAc,CAAEjB,YAAa,CAC7BjB,QAAQ,CAAEA,QAAS,CACnBE,IAAI,CAAEA,IAAK,CACXC,SAAS,CAAEA,SAAU,CACrBC,cAAc,CAAEA,cAAe,CAC/BC,uBAAuB,CAAEA,uBAAwB,CAClD,CAAC,CAEN;;;;"}
@@ -1,10 +1,12 @@
1
- import '../Typography/index.js';
2
- import '../../utils/logger/index.js';
1
+ import 'react';
2
+ import '../BaseMotion/index.js';
3
+ import { msToSeconds } from '../../utils/msToSeconds.js';
4
+ import '../../utils/index.js';
3
5
  import { jsx } from 'react/jsx-runtime';
4
- import { throwBladeError } from '../../utils/logger/logger.js';
5
- import { Text } from '../Typography/Text/Text.js';
6
+ import useTheme from '../BladeProvider/useTheme.js';
7
+ import { BaseMotionEnhancerBox } from '../BaseMotion/BaseMotion.native.js';
6
8
 
7
- var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Scale/Scale.native.tsx";var Scale=function Scale(_props){throwBladeError({message:'Scale is not yet implemented for native',moduleName:'Scale'});return jsx(Text,{children:"Scale Component is not available for Native mobile apps."});};
9
+ var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Scale/Scale.native.tsx";var STANDARD_EASING=[0.3,0,0.2,1];var Scale=function Scale(_ref){var children=_ref.children,isHighlighted=_ref.isHighlighted,_ref$type=_ref.type,type=_ref$type===void 0?'inout':_ref$type,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'scale-up':_ref$variant,motionTriggers=_ref.motionTriggers;var isControlledHighlighted=typeof isHighlighted==='boolean';var defaultMotionTriggers=isControlledHighlighted?['mount']:['hover'];var _useTheme=useTheme(),theme=_useTheme.theme;var targetScale=variant==='scale-up'?1.05:0.98;var scaleVariants={initial:{scale:1},animate:{scale:targetScale,transition:{duration:msToSeconds(theme.motion.duration.moderate),ease:[].concat(STANDARD_EASING)}},exit:{scale:1}};return jsx(BaseMotionEnhancerBox,Object.assign({motionVariants:scaleVariants,type:type,motionTriggers:motionTriggers!=null?motionTriggers:defaultMotionTriggers},isControlledHighlighted?{animateVisibility:isHighlighted?'animate':'initial'}:{},{children:children}));};
8
10
 
9
11
  export { Scale };
10
12
  //# sourceMappingURL=Scale.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Scale.native.js","sources":["../../../../../src/components/Scale/Scale.native.tsx"],"sourcesContent":["import type { ScaleProps } from './types';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\n\nconst Scale = (_props: ScaleProps): React.ReactElement => {\n throwBladeError({\n message: 'Scale is not yet implemented for native',\n moduleName: 'Scale',\n });\n\n return <Text>Scale Component is not available for Native mobile apps.</Text>;\n};\n\nexport { Scale };\n"],"names":["Scale","_props","throwBladeError","message","moduleName","_jsx","Text","children"],"mappings":";;;;;;sHAIM,IAAAA,KAAK,CAAG,SAARA,KAAKA,CAAIC,MAAkB,CAAyB,CACxDC,eAAe,CAAC,CACdC,OAAO,CAAE,yCAAyC,CAClDC,UAAU,CAAE,OACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAA,CAAAC,QAAA,CAAC,0DAAwD,CAAM,CAAC,CAC9E;;;;"}
1
+ {"version":3,"file":"Scale.native.js","sources":["../../../../../src/components/Scale/Scale.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { ScaleProps } from './types';\nimport { BaseMotionEnhancerBox } from '~components/BaseMotion';\nimport type { MotionVariantsType } from '~components/BaseMotion';\nimport { msToSeconds } from '~utils/msToSeconds';\nimport { useTheme } from '~utils';\n\n/**\n * Bezier control points of the `standard` easing token (`cubic-bezier(0.3, 0, 0.2, 1)`).\n *\n * On native `theme.motion.easing.standard` is an `EasingFactoryFn` object (not a CSS string), so\n * `cssBezierToArray` would crash at runtime. The native interpreter expects a 4-number bezier\n * array, so we supply the token's numeric control points directly (matches the web-resolved value).\n */\nconst STANDARD_EASING = [0.3, 0, 0.2, 1] as const;\n\n/**\n * ## Scale\n *\n * Scale is one of the highlight presets that we expose from blade to help you scale up or scale down components based on interactions\n *\n * ### Usage\n *\n * #### Scale up on hover\n *\n * ```jsx\n * <Scale motionTriggers={['hover']}>\n * <Card />\n * </Scale>\n * ```\n *\n * #### Scale down on tap\n *\n * ```jsx\n * <Scale variant=\"scale-down\" motionTriggers={['tap']}>\n * <Card />\n * </Scale>\n * ```\n *\n * #### Conditionally scale\n *\n * ```jsx\n * <Scale isHighlighted={isHighlightedState}>\n * <MyComponent />\n * </Scale>\n * ```\n */\nconst Scale = ({\n children,\n isHighlighted,\n type = 'inout',\n variant = 'scale-up',\n motionTriggers,\n}: ScaleProps): React.ReactElement => {\n const isControlledHighlighted = typeof isHighlighted === 'boolean';\n const defaultMotionTriggers = isControlledHighlighted ? ['mount' as const] : ['hover' as const];\n const { theme } = useTheme();\n\n const targetScale = variant === 'scale-up' ? 1.05 : 0.98;\n\n const scaleVariants: MotionVariantsType = {\n initial: {\n scale: 1,\n },\n animate: {\n // Keep the target scale always defined. On native the interpreter re-animates only when the\n // resolved `targetName` changes (not when variant content changes), so the \"not highlighted\"\n // state is expressed via `animateVisibility: 'initial'` rather than an undefined scale.\n scale: targetScale,\n transition: {\n duration: msToSeconds(theme.motion.duration.moderate),\n ease: [...STANDARD_EASING],\n },\n },\n exit: {\n scale: 1,\n },\n };\n\n return (\n <BaseMotionEnhancerBox\n motionVariants={scaleVariants}\n type={type}\n motionTriggers={motionTriggers ?? defaultMotionTriggers}\n // Native fix: drive the target for the controlled path so toggling `isHighlighted`\n // flips `targetName` between 'animate'/'initial' and actually re-runs the animation.\n {...(isControlledHighlighted\n ? { animateVisibility: isHighlighted ? ('animate' as const) : ('initial' as const) }\n : {})}\n >\n {children}\n </BaseMotionEnhancerBox>\n );\n};\n\nexport { Scale };\n"],"names":["STANDARD_EASING","Scale","_ref","children","isHighlighted","_ref$type","type","_ref$variant","variant","motionTriggers","isControlledHighlighted","defaultMotionTriggers","_useTheme","useTheme","theme","targetScale","scaleVariants","initial","scale","animate","transition","duration","msToSeconds","motion","moderate","ease","concat","exit","_jsx","BaseMotionEnhancerBox","Object","assign","motionVariants","animateVisibility"],"mappings":";;;;;;;;sHAcA,IAAMA,eAAe,CAAG,CAAC,GAAG,CAAE,CAAC,CAAE,GAAG,CAAE,CAAC,CAAU,CAiC3C,IAAAC,KAAK,CAAG,SAARA,KAAKA,CAAAC,IAAA,CAM2B,CAAA,IALpCC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,aAAa,CAAAF,IAAA,CAAbE,aAAa,CAAAC,SAAA,CAAAH,IAAA,CACbI,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAA,KAAA,CAAA,CAAG,OAAO,CAAAA,SAAA,CAAAE,YAAA,CAAAL,IAAA,CACdM,OAAO,CAAPA,OAAO,CAAAD,YAAA,GAAA,KAAA,CAAA,CAAG,UAAU,CAAAA,YAAA,CACpBE,cAAc,CAAAP,IAAA,CAAdO,cAAc,CAEd,IAAMC,uBAAuB,CAAG,OAAON,aAAa,GAAK,SAAS,CAClE,IAAMO,qBAAqB,CAAGD,uBAAuB,CAAG,CAAC,OAAO,CAAU,CAAG,CAAC,OAAO,CAAU,CAC/F,IAAAE,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CAEb,IAAMC,WAAW,CAAGP,OAAO,GAAK,UAAU,CAAG,IAAI,CAAG,IAAI,CAExD,IAAMQ,aAAiC,CAAG,CACxCC,OAAO,CAAE,CACPC,KAAK,CAAE,CACT,CAAC,CACDC,OAAO,CAAE,CAIPD,KAAK,CAAEH,WAAW,CAClBK,UAAU,CAAE,CACVC,QAAQ,CAAEC,WAAW,CAACR,KAAK,CAACS,MAAM,CAACF,QAAQ,CAACG,QAAQ,CAAC,CACrDC,IAAI,CAAA,EAAA,CAAAC,MAAA,CAAM1B,eAAe,CAC3B,CACF,CAAC,CACD2B,IAAI,CAAE,CACJT,KAAK,CAAE,CACT,CACF,CAAC,CAED,OACEU,GAAA,CAACC,qBAAqB,CAAAC,MAAA,CAAAC,MAAA,CACpBC,CAAAA,cAAc,CAAEhB,aAAc,CAC9BV,IAAI,CAAEA,IAAK,CACXG,cAAc,CAAEA,cAAc,OAAdA,cAAc,CAAIE,qBAAsB,CAAA,CAGnDD,uBAAuB,CACxB,CAAEuB,iBAAiB,CAAE7B,aAAa,CAAI,SAAS,CAAc,SAAoB,CAAC,CAClF,EAAE,CAAAD,CAAAA,QAAA,CAELA,QAAQ,CACY,CAAA,CAAC,CAE5B;;;;"}
@@ -0,0 +1,27 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
+ import React__default from 'react';
4
+ import { View } from 'react-native';
5
+ import { SegmentedControlContext } from './SegmentedControlContext.js';
6
+ import { containerHeight, containerBorderRadius, containerPadding, gap } from './segmentedControlTokens.js';
7
+ import { useControllableState } from '../../utils/useControllable.js';
8
+ import { useId } from '../../utils/useId.js';
9
+ import '../BladeProvider/index.js';
10
+ import '../../utils/metaAttribute/index.js';
11
+ import '../../utils/makeAnalyticsAttribute/index.js';
12
+ import '../Form/index.js';
13
+ import '../Box/BaseBox/index.js';
14
+ import getIn from '../../utils/lodashButBetter/get.js';
15
+ import { jsx, jsxs } from 'react/jsx-runtime';
16
+ import useTheme from '../BladeProvider/useTheme.js';
17
+ import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
18
+ import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
19
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
20
+ import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
21
+ import { FormLabel } from '../Form/FormLabel.js';
22
+ import { FormHint } from '../Form/FormHint.js';
23
+
24
+ var _excluded=["children","defaultValue","value","onChange","size","isDisabled","name","label","accessibilityLabel","labelPosition","helpText","errorText","validationState","necessityIndicator","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/SegmentedControl/SegmentedControl.native.tsx";var _SegmentedControl=function _SegmentedControl(_ref,ref){var children=_ref.children,defaultValue=_ref.defaultValue,value=_ref.value,_onChange=_ref.onChange,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,name=_ref.name,label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,helpText=_ref.helpText,errorText=_ref.errorText,_ref$validationState=_ref.validationState,validationState=_ref$validationState===void 0?'none':_ref$validationState,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useControllableState=useControllableState({defaultValue:defaultValue,value:value,onChange:function onChange(val){_onChange==null?void 0:_onChange({name:name,value:val});}}),_useControllableState2=_slicedToArray(_useControllableState,2),selectedValue=_useControllableState2[0],setSelectedValue=_useControllableState2[1];var baseId=useId('segmented-control');var labelId=`${baseId}-label`;var totalItems=React__default.Children.count(children);var contextValue=React__default.useMemo(function(){return {selectedValue:selectedValue,setSelectedValue:setSelectedValue,size:size,isDisabled:isDisabled,name:name,baseId:baseId,totalItems:totalItems};},[selectedValue,setSelectedValue,size,isDisabled,name,baseId,totalItems]);var showError=validationState==='error'&&errorText;var showHelpText=!showError&&helpText;var accessibilityText=`${showError?errorText:''} ${showHelpText?helpText:''}`.trim();var willRenderHintText=Boolean(helpText)||validationState==='error'&&Boolean(errorText);var segmentedControlElement=jsx(View,Object.assign({ref:ref,style:{flexDirection:'row',alignItems:'center',alignSelf:'stretch',height:containerHeight[size],backgroundColor:theme.colors.interactive.background.gray.faded,borderRadius:theme.border.radius[containerBorderRadius[size]],padding:getIn(theme,containerPadding[size]),gap:getIn(theme,gap[size])},accessibilityRole:"radiogroup",accessibilityLabel:label||accessibilityLabel||name},metaAttribute({name:MetaConstants.SegmentedControl,testID:testID}),makeAnalyticsAttribute(rest),{children:children}));return jsx(SegmentedControlContext.Provider,{value:contextValue,children:jsxs(BaseBox,{display:"flex",flexDirection:labelPosition==='left'?'row':'column',alignItems:labelPosition==='left'?'center':undefined,children:[label?jsx(FormLabel,{as:"span",necessityIndicator:necessityIndicator,position:labelPosition,id:labelId,accessibilityText:accessibilityText&&`,${accessibilityText}`,size:size,children:label}):null,jsxs(BaseBox,{flex:1,children:[segmentedControlElement,willRenderHintText?jsx(FormHint,{size:size,type:validationState==='error'?'error':'help',errorText:errorText,helpText:helpText}):null]})]})});};var SegmentedControl=React__default.forwardRef(_SegmentedControl);
25
+
26
+ export { SegmentedControl };
27
+ //# sourceMappingURL=SegmentedControl.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SegmentedControl.native.js","sources":["../../../../../src/components/SegmentedControl/SegmentedControl.native.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport type { SegmentedControlProps } from './types';\nimport { SegmentedControlContext } from './SegmentedControlContext';\nimport {\n containerPadding,\n containerBorderRadius,\n containerHeight,\n gap,\n} from './segmentedControlTokens';\nimport { useControllableState } from '~utils/useControllable';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { FormLabel, FormHint } from '~components/Form';\nimport BaseBox from '~components/Box/BaseBox';\nimport getIn from '~utils/lodashButBetter/get';\n\nconst _SegmentedControl = (\n {\n children,\n defaultValue,\n value,\n onChange,\n size = 'medium',\n isDisabled = false,\n name,\n label,\n accessibilityLabel,\n labelPosition = 'top',\n helpText,\n errorText,\n validationState = 'none',\n necessityIndicator = 'none',\n testID,\n ...rest\n }: SegmentedControlProps,\n ref: React.Ref<View>,\n): React.ReactElement => {\n const { theme } = useTheme();\n\n const [selectedValue, setSelectedValue] = useControllableState({\n defaultValue,\n value,\n onChange: (val) => {\n onChange?.({ name, value: val });\n },\n });\n\n const baseId = useId('segmented-control');\n const labelId = `${baseId}-label`;\n const totalItems = React.Children.count(children);\n\n const contextValue = React.useMemo(\n () => ({\n selectedValue,\n setSelectedValue,\n size,\n isDisabled,\n name,\n baseId,\n totalItems,\n }),\n [selectedValue, setSelectedValue, size, isDisabled, name, baseId, totalItems],\n );\n\n const showError = validationState === 'error' && errorText;\n const showHelpText = !showError && helpText;\n const accessibilityText = `${showError ? errorText : ''} ${showHelpText ? helpText : ''}`.trim();\n const willRenderHintText =\n Boolean(helpText) || (validationState === 'error' && Boolean(errorText));\n\n const segmentedControlElement = (\n <View\n ref={ref}\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'stretch',\n height: containerHeight[size],\n backgroundColor: theme.colors.interactive.background.gray.faded,\n borderRadius: theme.border.radius[containerBorderRadius[size]],\n padding: getIn(theme, containerPadding[size]),\n gap: getIn(theme, gap[size]),\n }}\n accessibilityRole=\"radiogroup\"\n accessibilityLabel={label || accessibilityLabel || name}\n {...metaAttribute({ name: MetaConstants.SegmentedControl, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </View>\n );\n\n return (\n <SegmentedControlContext.Provider value={contextValue}>\n <BaseBox\n display=\"flex\"\n flexDirection={labelPosition === 'left' ? 'row' : 'column'}\n alignItems={labelPosition === 'left' ? 'center' : undefined}\n >\n {label ? (\n <FormLabel\n as=\"span\"\n necessityIndicator={necessityIndicator}\n position={labelPosition}\n id={labelId}\n accessibilityText={accessibilityText && `,${accessibilityText}`}\n size={size}\n >\n {label}\n </FormLabel>\n ) : null}\n <BaseBox flex={1}>\n {segmentedControlElement}\n {willRenderHintText ? (\n <FormHint\n size={size}\n type={validationState === 'error' ? 'error' : 'help'}\n errorText={errorText}\n helpText={helpText}\n />\n ) : null}\n </BaseBox>\n </BaseBox>\n </SegmentedControlContext.Provider>\n );\n};\n\nconst SegmentedControl = React.forwardRef(_SegmentedControl);\n\nexport { SegmentedControl };\n"],"names":["this","_SegmentedControl","_ref","ref","children","defaultValue","value","onChange","_ref$size","size","_ref$isDisabled","isDisabled","name","label","accessibilityLabel","_ref$labelPosition","labelPosition","helpText","errorText","_ref$validationState","validationState","_ref$necessityIndicat","necessityIndicator","testID","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useControllableState","useControllableState","val","_useControllableState2","_slicedToArray","selectedValue","setSelectedValue","baseId","useId","labelId","totalItems","React","Children","count","contextValue","useMemo","showError","showHelpText","accessibilityText","trim","willRenderHintText","Boolean","segmentedControlElement","_jsx","View","Object","assign","style","flexDirection","alignItems","alignSelf","height","containerHeight","backgroundColor","colors","interactive","background","gray","faded","borderRadius","border","radius","containerBorderRadius","padding","getIn","containerPadding","gap","accessibilityRole","metaAttribute","MetaConstants","SegmentedControl","makeAnalyticsAttribute","SegmentedControlContext","Provider","_jsxs","BaseBox","display","undefined","FormLabel","as","position","id","flex","FormHint","type","forwardRef"],"mappings":";;;;;;;;;;;;;;;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BA,QAAQ,CAAA,CACL,CACP,CAED,OACEiD,GAAA,CAAC6B,uBAAuB,CAACC,QAAQ,CAAC7E,CAAAA,KAAK,CAAEsC,YAAa,CAAAxC,QAAA,CACpDgF,IAAA,CAACC,OAAO,CAAA,CACNC,OAAO,CAAC,MAAM,CACd5B,aAAa,CAAE1C,aAAa,GAAK,MAAM,CAAG,KAAK,CAAG,QAAS,CAC3D2C,UAAU,CAAE3C,aAAa,GAAK,MAAM,CAAG,QAAQ,CAAGuE,SAAU,CAAAnF,QAAA,CAE3DS,CAAAA,KAAK,CACJwC,GAAA,CAACmC,SAAS,CACRC,CAAAA,EAAE,CAAC,MAAM,CACTnE,kBAAkB,CAAEA,kBAAmB,CACvCoE,QAAQ,CAAE1E,aAAc,CACxB2E,EAAE,CAAEpD,OAAQ,CACZS,iBAAiB,CAAEA,iBAAiB,EAAI,CAAA,CAAA,EAAIA,iBAAiB,CAAG,CAAA,CAChEvC,IAAI,CAAEA,IAAK,CAAAL,QAAA,CAEVS,KAAK,CACG,CAAC,CACV,IAAI,CACRuE,IAAA,CAACC,OAAO,CAAA,CAACO,IAAI,CAAE,CAAE,CAAAxF,QAAA,CAAA,CACdgD,uBAAuB,CACvBF,kBAAkB,CACjBG,GAAA,CAACwC,QAAQ,CAAA,CACPpF,IAAI,CAAEA,IAAK,CACXqF,IAAI,CAAE1E,eAAe,GAAK,OAAO,CAAG,OAAO,CAAG,MAAO,CACrDF,SAAS,CAAEA,SAAU,CACrBD,QAAQ,CAAEA,QAAS,CACpB,CAAC,CACA,IAAI,CACD,CAAA,CAAC,EACH,CAAC,CACsB,CAAC,CAEvC,CAAC,CAEK,IAAA+D,gBAAgB,CAAGvC,cAAK,CAACsD,UAAU,CAAC9F,iBAAiB;;;;"}
@@ -0,0 +1,8 @@
1
+ import React__default from 'react';
2
+ import '../../utils/logger/index.js';
3
+ import { throwBladeError } from '../../utils/logger/logger.js';
4
+
5
+ var SegmentedControlContext=React__default.createContext(null);var useSegmentedControlContext=function useSegmentedControlContext(){var context=React__default.useContext(SegmentedControlContext);if(!context){throwBladeError({moduleName:'SegmentedControl',message:'useSegmentedControlContext must be used within SegmentedControl'});}return context;};
6
+
7
+ export { SegmentedControlContext, useSegmentedControlContext };
8
+ //# sourceMappingURL=SegmentedControlContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SegmentedControlContext.js","sources":["../../../../../src/components/SegmentedControl/SegmentedControlContext.ts"],"sourcesContent":["import React from 'react';\nimport type { SegmentedControlSize } from './types';\nimport { throwBladeError } from '~utils/logger';\nimport type { ControllableStateSetter } from '~utils/useControllable';\n\ntype SegmentedControlContextProps = {\n selectedValue: string | undefined;\n setSelectedValue: ControllableStateSetter<string>;\n size: SegmentedControlSize;\n isDisabled: boolean;\n name?: string;\n baseId: string;\n totalItems: number;\n firstEnabledValue?: string;\n itemRefs?: React.MutableRefObject<Map<string, HTMLElement>>;\n} | null;\n\nconst SegmentedControlContext = React.createContext<SegmentedControlContextProps>(null);\n\nconst useSegmentedControlContext = (): NonNullable<SegmentedControlContextProps> => {\n const context = React.useContext(SegmentedControlContext);\n\n if (!context) {\n throwBladeError({\n moduleName: 'SegmentedControl',\n message: 'useSegmentedControlContext must be used within SegmentedControl',\n });\n }\n\n return context!;\n};\n\nexport { SegmentedControlContext, useSegmentedControlContext };\n"],"names":["SegmentedControlContext","React","createContext","useSegmentedControlContext","context","useContext","throwBladeError","moduleName","message"],"mappings":";;;;AAiBM,IAAAA,uBAAuB,CAAGC,cAAK,CAACC,aAAa,CAA+B,IAAI,EAEhF,IAAAC,0BAA0B,CAAG,SAA7BA,0BAA0BA,EAAoD,CAClF,IAAMC,OAAO,CAAGH,cAAK,CAACI,UAAU,CAACL,uBAAuB,CAAC,CAEzD,GAAI,CAACI,OAAO,CAAE,CACZE,eAAe,CAAC,CACdC,UAAU,CAAE,kBAAkB,CAC9BC,OAAO,CAAE,iEACX,CAAC,CAAC,CACJ,CAEA,OAAOJ,OAAO,CAChB;;;;"}
@@ -0,0 +1,18 @@
1
+ import 'react';
2
+ import { Pressable } from 'react-native';
3
+ import { useSegmentedControlContext } from './SegmentedControlContext.js';
4
+ import { itemHeight, paddingY, paddingX, itemBorderRadius, iconSizeMap, textSizeMap } from './segmentedControlTokens.js';
5
+ import '../Typography/index.js';
6
+ import '../BladeProvider/index.js';
7
+ import '../../utils/metaAttribute/index.js';
8
+ import getIn from '../../utils/lodashButBetter/get.js';
9
+ import { jsxs, jsx } from 'react/jsx-runtime';
10
+ import useTheme from '../BladeProvider/useTheme.js';
11
+ import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
12
+ import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
13
+ import { Text } from '../Typography/Text/Text.js';
14
+
15
+ var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/SegmentedControl/SegmentedControlItem.native.tsx";var SegmentedControlItem=function SegmentedControlItem(_ref){var children=_ref.children,value=_ref.value,Leading=_ref.leading,_ref$isDisabled=_ref.isDisabled,isItemDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,accessibilityLabel=_ref.accessibilityLabel,testID=_ref.testID;var _useSegmentedControlC=useSegmentedControlContext(),selectedValue=_useSegmentedControlC.selectedValue,setSelectedValue=_useSegmentedControlC.setSelectedValue,size=_useSegmentedControlC.size,isGroupDisabled=_useSegmentedControlC.isDisabled;var _useTheme=useTheme(),theme=_useTheme.theme;var isSelected=selectedValue===value;var isDisabled=isGroupDisabled||isItemDisabled;var textColor=isDisabled?'interactive.text.gray.disabled':isSelected?'interactive.text.gray.normal':'interactive.text.gray.muted';var iconColor=isDisabled?'interactive.icon.gray.disabled':isSelected?'interactive.icon.gray.normal':'interactive.icon.gray.muted';return jsxs(Pressable,Object.assign({onPress:function onPress(){if(!isDisabled){setSelectedValue(function(){return value;});}},disabled:isDisabled,accessibilityRole:"radio",accessibilityLabel:accessibilityLabel,accessibilityState:{selected:isSelected,disabled:isDisabled},style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',height:itemHeight[size],gap:theme.spacing[3],paddingVertical:getIn(theme,paddingY[size]),paddingHorizontal:getIn(theme,paddingX[size]),borderRadius:theme.border.radius[itemBorderRadius[size]],backgroundColor:isSelected?theme.colors.surface.background.gray.intense:'transparent'}},metaAttribute({name:MetaConstants.SegmentedControlItem,testID:testID}),{children:[Leading?jsx(Leading,{size:iconSizeMap[size],color:iconColor}):null,children?jsx(Text,{color:textColor,size:textSizeMap[size],weight:"medium",children:children}):null]}));};
16
+
17
+ export { SegmentedControlItem };
18
+ //# sourceMappingURL=SegmentedControlItem.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SegmentedControlItem.native.js","sources":["../../../../../src/components/SegmentedControl/SegmentedControlItem.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable } from 'react-native';\nimport type { SegmentedControlItemProps } from './types';\nimport { useSegmentedControlContext } from './SegmentedControlContext';\nimport {\n paddingX,\n paddingY,\n textSizeMap,\n iconSizeMap,\n itemBorderRadius,\n itemHeight,\n} from './segmentedControlTokens';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport getIn from '~utils/lodashButBetter/get';\n\nconst SegmentedControlItem = ({\n children,\n value,\n leading: Leading,\n isDisabled: isItemDisabled = false,\n accessibilityLabel,\n testID,\n}: SegmentedControlItemProps): React.ReactElement => {\n const {\n selectedValue,\n setSelectedValue,\n size,\n isDisabled: isGroupDisabled,\n } = useSegmentedControlContext();\n const { theme } = useTheme();\n\n const isSelected = selectedValue === value;\n const isDisabled = isGroupDisabled || isItemDisabled;\n\n const textColor = isDisabled\n ? 'interactive.text.gray.disabled'\n : isSelected\n ? 'interactive.text.gray.normal'\n : 'interactive.text.gray.muted';\n const iconColor = isDisabled\n ? 'interactive.icon.gray.disabled'\n : isSelected\n ? 'interactive.icon.gray.normal'\n : 'interactive.icon.gray.muted';\n\n return (\n <Pressable\n onPress={() => {\n if (!isDisabled) {\n setSelectedValue(() => value);\n }\n }}\n disabled={isDisabled}\n accessibilityRole=\"radio\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected: isSelected, disabled: isDisabled }}\n style={{\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n height: itemHeight[size],\n gap: theme.spacing[3],\n paddingVertical: getIn(theme, paddingY[size]),\n paddingHorizontal: getIn(theme, paddingX[size]),\n borderRadius: theme.border.radius[itemBorderRadius[size]],\n backgroundColor: isSelected ? theme.colors.surface.background.gray.intense : 'transparent',\n }}\n {...metaAttribute({ name: MetaConstants.SegmentedControlItem, testID })}\n >\n {Leading ? <Leading size={iconSizeMap[size]} color={iconColor} /> : null}\n {children ? (\n <Text color={textColor} size={textSizeMap[size]} weight=\"medium\">\n {children}\n </Text>\n ) : null}\n </Pressable>\n );\n};\n\nexport { SegmentedControlItem };\n"],"names":["SegmentedControlItem","_ref","children","value","Leading","leading","_ref$isDisabled","isDisabled","isItemDisabled","accessibilityLabel","testID","_useSegmentedControlC","useSegmentedControlContext","selectedValue","setSelectedValue","size","isGroupDisabled","_useTheme","useTheme","theme","isSelected","textColor","iconColor","_jsxs","Pressable","Object","assign","onPress","disabled","accessibilityRole","accessibilityState","selected","style","flex","flexDirection","alignItems","justifyContent","height","itemHeight","gap","spacing","paddingVertical","getIn","paddingY","paddingHorizontal","paddingX","borderRadius","border","radius","itemBorderRadius","backgroundColor","colors","surface","background","gray","intense","metaAttribute","name","MetaConstants","_jsx","iconSizeMap","color","Text","textSizeMap","weight"],"mappings":";;;;;;;;;;;;;;gJAiBM,IAAAA,oBAAoB,CAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,CAO2B,CAAA,IANnDC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACIC,OAAO,CAAAH,IAAA,CAAhBI,OAAO,CAAAC,eAAA,CAAAL,IAAA,CACPM,UAAU,CAAEC,cA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CAACvB,IAAI,CAAC,CACxBwB,GAAG,CAAEpB,KAAK,CAACqB,OAAO,CAAC,CAAC,CAAC,CACrBC,eAAe,CAAEC,KAAK,CAACvB,KAAK,CAAEwB,QAAQ,CAAC5B,IAAI,CAAC,CAAC,CAC7C6B,iBAAiB,CAAEF,KAAK,CAACvB,KAAK,CAAE0B,QAAQ,CAAC9B,IAAI,CAAC,CAAC,CAC/C+B,YAAY,CAAE3B,KAAK,CAAC4B,MAAM,CAACC,MAAM,CAACC,gBAAgB,CAAClC,IAAI,CAAC,CAAC,CACzDmC,eAAe,CAAE9B,UAAU,CAAGD,KAAK,CAACgC,MAAM,CAACC,OAAO,CAACC,UAAU,CAACC,IAAI,CAACC,OAAO,CAAG,aAC/E,CAAE,CACEC,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAAC1D,oBAAoB,CAAEU,MAAM,CAANA,MAAO,CAAC,CAAC,EAAAR,QAAA,CAAA,CAEtEE,OAAO,CAAGuD,GAAA,CAACvD,OAAO,CAACW,CAAAA,IAAI,CAAE6C,WAAW,CAAC7C,IAAI,CAAE,CAAC8C,KAAK,CAAEvC,SAAU,CAAE,CAAC,CAAG,IAAI,CACvEpB,QAAQ,CACPyD,GAAA,CAACG,IAAI,CAACD,CAAAA,KAAK,CAAExC,SAAU,CAACN,IAAI,CAAEgD,WAAW,CAAChD,IAAI,CAAE,CAACiD,MAAM,CAAC,QAAQ,CAAA9D,QAAA,CAC7DA,QAAQ,CACL,CAAC,CACL,IAAI,CAAA,CAAA,CACC,CAAC,CAEhB;;;;"}
@@ -0,0 +1,3 @@
1
+ export { SegmentedControl } from './SegmentedControl.native.js';
2
+ export { SegmentedControlItem } from './SegmentedControlItem.native.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,4 @@
1
+ var paddingY={small:'spacing.2',medium:'spacing.2',large:'spacing.3'};var paddingX={small:'spacing.3',medium:'spacing.3',large:'spacing.3'};var containerPadding={small:'spacing.2',medium:'spacing.2',large:'spacing.2'};var gap={small:'spacing.1',medium:'spacing.1',large:'spacing.1'};var containerBorderRadius={small:'small',medium:'small',large:'medium'};var itemBorderRadius={small:'xsmall',medium:'xsmall',large:'small'};var containerHeight={small:32,medium:36,large:48};var itemHeight={small:24,medium:28,large:40};var textSizeMap={small:'small',medium:'medium',large:'large'};var iconSizeMap={small:'medium',medium:'medium',large:'large'};
2
+
3
+ export { containerBorderRadius, containerHeight, containerPadding, gap, iconSizeMap, itemBorderRadius, itemHeight, paddingX, paddingY, textSizeMap };
4
+ //# sourceMappingURL=segmentedControlTokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmentedControlTokens.js","sources":["../../../../../src/components/SegmentedControl/segmentedControlTokens.ts"],"sourcesContent":["import type { SegmentedControlSize } from './types';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\n\ntype SizeTokenMap = Record<SegmentedControlSize, DotNotationSpacingStringToken>;\n\nconst paddingY: SizeTokenMap = {\n small: 'spacing.2',\n medium: 'spacing.2',\n large: 'spacing.3',\n};\n\nconst paddingX: SizeTokenMap = {\n small: 'spacing.3',\n medium: 'spacing.3',\n large: 'spacing.3',\n};\n\nconst containerPadding: SizeTokenMap = {\n small: 'spacing.2',\n medium: 'spacing.2',\n large: 'spacing.2',\n};\n\nconst gap: SizeTokenMap = {\n small: 'spacing.1',\n medium: 'spacing.1',\n large: 'spacing.1',\n};\n\nconst containerBorderRadius: Record<SegmentedControlSize, 'small' | 'medium'> = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n};\n\nconst itemBorderRadius: Record<SegmentedControlSize, 'xsmall' | 'small'> = {\n small: 'xsmall',\n medium: 'xsmall',\n large: 'small',\n};\n\nconst containerHeight: Record<SegmentedControlSize, number> = {\n small: 32,\n medium: 36,\n large: 48,\n};\n\nconst itemHeight: Record<SegmentedControlSize, number> = {\n small: 24,\n medium: 28,\n large: 40,\n};\n\nconst textSizeMap: Record<SegmentedControlSize, 'small' | 'medium' | 'large'> = {\n small: 'small',\n medium: 'medium',\n large: 'large',\n};\n\nconst iconSizeMap: Record<SegmentedControlSize, 'small' | 'medium' | 'large'> = {\n small: 'medium',\n medium: 'medium',\n large: 'large',\n};\n\nexport {\n paddingY,\n paddingX,\n containerPadding,\n containerBorderRadius,\n itemBorderRadius,\n containerHeight,\n itemHeight,\n gap,\n textSizeMap,\n iconSizeMap,\n};\n"],"names":["paddingY","small","medium","large","paddingX","containerPadding","gap","containerBorderRadius","itemBorderRadius","containerHeight","itemHeight","textSizeMap","iconSizeMap"],"mappings":"AAKM,IAAAA,QAAsB,CAAG,CAC7BC,KAAK,CAAE,WAAW,CAClBC,MAAM,CAAE,WAAW,CACnBC,KAAK,CAAE,WACT,EAEM,IAAAC,QAAsB,CAAG,CAC7BH,KAAK,CAAE,WAAW,CAClBC,MAAM,CAAE,WAAW,CACnBC,KAAK,CAAE,WACT,EAEM,IAAAE,gBAA8B,CAAG,CACrCJ,KAAK,CAAE,WAAW,CAClBC,MAAM,CAAE,WAAW,CACnBC,KAAK,CAAE,WACT,EAEM,IAAAG,GAAiB,CAAG,CACxBL,KAAK,CAAE,WAAW,CAClBC,MAAM,CAAE,WAAW,CACnBC,KAAK,CAAE,WACT,EAEM,IAAAI,qBAAuE,CAAG,CAC9EN,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,OAAO,CACfC,KAAK,CAAE,QACT,EAEM,IAAAK,gBAAkE,CAAG,CACzEP,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,EAEM,IAAAM,eAAqD,CAAG,CAC5DR,KAAK,CAAE,EAAE,CACTC,MAAM,CAAE,EAAE,CACVC,KAAK,CAAE,EACT,EAEM,IAAAO,UAAgD,CAAG,CACvDT,KAAK,CAAE,EAAE,CACTC,MAAM,CAAE,EAAE,CACVC,KAAK,CAAE,EACT,EAEM,IAAAQ,WAAuE,CAAG,CAC9EV,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,EAEM,IAAAS,WAAuE,CAAG,CAC9EX,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT;;;;"}
@@ -1,10 +1,12 @@
1
- import '../Typography/index.js';
2
- import '../../utils/logger/index.js';
1
+ import React__default from 'react';
2
+ import '../BaseMotion/index.js';
3
+ import { msToSeconds } from '../../utils/msToSeconds.js';
4
+ import '../../utils/index.js';
3
5
  import { jsx } from 'react/jsx-runtime';
4
- import { throwBladeError } from '../../utils/logger/logger.js';
5
- import { Text } from '../Typography/Text/Text.js';
6
+ import useTheme from '../BladeProvider/useTheme.js';
7
+ import { BaseMotionEntryExit } from '../BaseMotion/BaseMotion.native.js';
6
8
 
7
- var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Slide/Slide.native.tsx";var Slide=function Slide(_props){throwBladeError({message:'Slide is not yet implemented for native',moduleName:'Slide'});return jsx(Text,{children:"Slide Component is not available for Native mobile apps."});};
9
+ var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Slide/Slide.native.tsx";var ENTRANCE_EASING=[0,0,0.2,1];var EXIT_EASING=[0.17,0,1,1];var EMPHASIZED_EASING=[0.5,0,0,1];var getFromTransform=function getFromTransform(direction,fromOffset){if(direction==='top'){return `translateY(-${fromOffset})`;}if(direction==='left'){return `translateX(-${fromOffset})`;}if(direction==='right'){return `translateX(${fromOffset})`;}return `translateY(${fromOffset})`;};var Slide=function Slide(_ref){var children=_ref.children,_ref$type=_ref.type,type=_ref$type===void 0?'inout':_ref$type,_ref$direction=_ref.direction,direction=_ref$direction===void 0?'bottom':_ref$direction,isVisible=_ref.isVisible,motionTriggers=_ref.motionTriggers,shouldUnmountWhenHidden=_ref.shouldUnmountWhenHidden,fromOffset=_ref.fromOffset,delay=_ref.delay;var _useTheme=useTheme(),theme=_useTheme.theme;var enterDirection=typeof direction==='object'?direction.enter:direction;var exitDirection=typeof direction==='object'?direction.exit:direction;var isEnterDirectionHorizontal=['left','right'].includes(enterDirection);var isExitDirectionHorizontal=['left','right'].includes(exitDirection);var defaultOffset=isEnterDirectionHorizontal?'100vw':'100vh';var enterTransform=getFromTransform(enterDirection,fromOffset!=null?fromOffset:defaultOffset);var exitTransform=getFromTransform(exitDirection,fromOffset!=null?fromOffset:defaultOffset);var zeroTarget=isEnterDirectionHorizontal?'translateX(0%)':'translateY(0%)';var enterDelay=typeof delay==='object'?delay.enter:delay;var exitDelay=typeof delay==='object'?delay.exit:delay;var slideVariants=React__default.useMemo(function(){return {initial:{opacity:0,transform:enterTransform},animate:{opacity:1,transform:zeroTarget,transition:Object.assign({},enterDelay?{delay:msToSeconds(theme.motion.delay[enterDelay])}:{},{duration:msToSeconds(isEnterDirectionHorizontal?theme.motion.duration.xmoderate:theme.motion.duration['2xgentle']),ease:isEnterDirectionHorizontal?ENTRANCE_EASING:EMPHASIZED_EASING})},exit:{opacity:0,transform:exitTransform,transition:Object.assign({},exitDelay?{delay:msToSeconds(theme.motion.delay[exitDelay])}:{},{duration:msToSeconds(isExitDirectionHorizontal?theme.motion.duration.moderate:theme.motion.duration.xgentle),ease:isExitDirectionHorizontal?EXIT_EASING:EMPHASIZED_EASING})}};},[enterTransform,exitTransform,zeroTarget,isEnterDirectionHorizontal,isExitDirectionHorizontal,enterDelay,exitDelay,theme.name]);return jsx(BaseMotionEntryExit,{motionVariants:slideVariants,type:type,isVisible:isVisible,motionTriggers:motionTriggers,shouldUnmountWhenHidden:shouldUnmountWhenHidden,children:children});};
8
10
 
9
11
  export { Slide };
10
12
  //# sourceMappingURL=Slide.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slide.native.js","sources":["../../../../../src/components/Slide/Slide.native.tsx"],"sourcesContent":["import type { SlideProps } from './types';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\n\nconst Slide = (_props: SlideProps): React.ReactElement => {\n throwBladeError({\n message: 'Slide is not yet implemented for native',\n moduleName: 'Slide',\n });\n\n return <Text>Slide Component is not available for Native mobile apps.</Text>;\n};\n\nexport { Slide };\n"],"names":["Slide","_props","throwBladeError","message","moduleName","_jsx","Text","children"],"mappings":";;;;;;sHAIM,IAAAA,KAAK,CAAG,SAARA,KAAKA,CAAIC,MAAkB,CAAyB,CACxDC,eAAe,CAAC,CACdC,OAAO,CAAE,yCAAyC,CAClDC,UAAU,CAAE,OACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAA,CAAAC,QAAA,CAAC,0DAAwD,CAAM,CAAC,CAC9E;;;;"}
1
+ {"version":3,"file":"Slide.native.js","sources":["../../../../../src/components/Slide/Slide.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { SlideProps } from './types';\nimport { BaseMotionEntryExit } from '~components/BaseMotion';\nimport type { MotionVariantsType } from '~components/BaseMotion';\nimport { msToSeconds } from '~utils/msToSeconds';\nimport { useTheme } from '~utils';\n\n/**\n * NATIVE easing control points, mirroring the theme easing tokens.\n *\n * On native, `theme.motion.easing.*` resolves to an `EasingFactoryFn` (a reanimated easing\n * function), not a `cubic-bezier(...)` string. `cssBezierToArray` (used on web) calls\n * `.indexOf('(')` on it and crashes, so we supply the bezier control points directly. The native\n * interpreter's `getTiming` builds `Easing.bezier(...)` from a 4-number array (else falls back to\n * `Easing.ease`).\n */\nconst ENTRANCE_EASING: [number, number, number, number] = [0, 0, 0.2, 1]; // theme.motion.easing.entrance\nconst EXIT_EASING: [number, number, number, number] = [0.17, 0, 1, 1]; // theme.motion.easing.exit\nconst EMPHASIZED_EASING: [number, number, number, number] = [0.5, 0, 0, 1]; // theme.motion.easing.emphasized\n\nconst getFromTransform = (\n direction: 'top' | 'right' | 'bottom' | 'left',\n fromOffset: NonNullable<SlideProps['fromOffset']>,\n): `translate${string}` => {\n if (direction === 'top') {\n return `translateY(-${fromOffset})`;\n }\n\n if (direction === 'left') {\n return `translateX(-${fromOffset})`;\n }\n\n if (direction === 'right') {\n return `translateX(${fromOffset})`;\n }\n\n return `translateY(${fromOffset})`;\n};\n\n/**\n * ## Slide\n *\n * Slide is one of the motion presets that we expose from blade to help you make components slide in from outside of viewport\n *\n * If you're looking for subtle movement on enter in the viewport itself, checkout `Move` preset instead.\n *\n * ### Usage\n *\n * #### Slide in on mount\n *\n * ```jsx\n * <Slide direction=\"bottom\">\n * <Card />\n * </Slide>\n * ```\n *\n * #### Conditionally slide based on state\n *\n * ```jsx\n * <Slide isVisible={isVisibleState}>\n * <Card />\n * </Slide>\n * ```\n *\n * ### Native limitations\n *\n * - Only the default `100vw` / `100vh` offsets slide on native (resolved via `Dimensions`).\n * A `%`-based `fromOffset` cannot be measured against the element size and degrades to no movement.\n * - `in-view` triggers degrade to `mount` (no scroll-driven in-view detection on native).\n */\nconst Slide = ({\n children,\n type = 'inout',\n direction = 'bottom',\n isVisible,\n motionTriggers,\n shouldUnmountWhenHidden,\n fromOffset,\n delay,\n}: SlideProps): React.ReactElement => {\n const { theme } = useTheme();\n\n const enterDirection = typeof direction === 'object' ? direction.enter : direction;\n const exitDirection = typeof direction === 'object' ? direction.exit : direction;\n const isEnterDirectionHorizontal = ['left', 'right'].includes(enterDirection);\n const isExitDirectionHorizontal = ['left', 'right'].includes(exitDirection);\n\n // vw/vh resolve via Dimensions in the native interpreter; `%` offsets degrade to no movement.\n const defaultOffset: NonNullable<SlideProps['fromOffset']> = isEnterDirectionHorizontal\n ? '100vw'\n : '100vh';\n\n const enterTransform = getFromTransform(enterDirection, fromOffset ?? defaultOffset);\n const exitTransform = getFromTransform(exitDirection, fromOffset ?? defaultOffset);\n // NATIVE: single-string zero target (not a keyframe array). The interpreter reads only the last\n // keyframe entry, so an array would collapse to `0` and lose the enter slide.\n const zeroTarget = isEnterDirectionHorizontal ? 'translateX(0%)' : 'translateY(0%)';\n\n const enterDelay = typeof delay === 'object' ? delay.enter : delay;\n const exitDelay = typeof delay === 'object' ? delay.exit : delay;\n\n const slideVariants: MotionVariantsType = React.useMemo(\n () => ({\n // NATIVE: the off-screen offset lives in `initial.transform` (Move-style) so the interpreter\n // interpolates from the offset → zero target on enter. Web keeps `initial` transform-less for\n // its `in-view` trigger, but native `in-view` degrades to mount so we're free to offset here.\n initial: {\n opacity: 0,\n transform: enterTransform,\n },\n animate: {\n opacity: 1,\n transform: zeroTarget,\n transition: {\n // We have to make sure we don't add delay prop because if we define it, it takes precedence in stagger.\n // Even setting `undefined` would break the stagger\n ...(enterDelay ? { delay: msToSeconds(theme.motion.delay[enterDelay]) } : {}),\n duration: msToSeconds(\n isEnterDirectionHorizontal\n ? theme.motion.duration.xmoderate\n : theme.motion.duration['2xgentle'],\n ),\n ease: isEnterDirectionHorizontal ? ENTRANCE_EASING : EMPHASIZED_EASING,\n },\n },\n exit: {\n opacity: 0,\n transform: exitTransform,\n // NATIVE: `transitionEnd` is a no-op in the interpreter; reset relies on the initial offset\n // / remount instead.\n transition: {\n ...(exitDelay ? { delay: msToSeconds(theme.motion.delay[exitDelay]) } : {}),\n duration: msToSeconds(\n isExitDirectionHorizontal\n ? theme.motion.duration.moderate\n : theme.motion.duration.xgentle,\n ),\n ease: isExitDirectionHorizontal ? EXIT_EASING : EMPHASIZED_EASING,\n },\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n enterTransform,\n exitTransform,\n zeroTarget,\n isEnterDirectionHorizontal,\n isExitDirectionHorizontal,\n enterDelay,\n exitDelay,\n theme.name,\n ],\n );\n\n // Pass `children` as a real JSX child (not the `children={...}` prop shorthand) so the native\n // `BaseMotionEntryExit` can read `children.props.ref`.\n return (\n <BaseMotionEntryExit\n motionVariants={slideVariants}\n type={type}\n isVisible={isVisible}\n motionTriggers={motionTriggers}\n shouldUnmountWhenHidden={shouldUnmountWhenHidden}\n >\n {children}\n </BaseMotionEntryExit>\n );\n};\n\nexport { Slide };\n"],"names":["this","ENTRANCE_EASING","EXIT_EASING","EMPHASIZED_EASING","getFromTransform","direction","fromOffset","Slide","_ref","children","_ref$type","type","_ref$direction","isVisible","motionTriggers","shouldUnmountWhenHidden","delay","_useTheme","useTheme","theme","enterDirection","enter","exitDirection","exit","isEnterDirectionHorizontal","includes","isExitDirectionHorizontal","defaultOffset","enterTransform","exitTransform","zeroTarget","enterDelay","exitDelay","slideVariants","React","useMemo","initial","opacity","transform","animate","transition","Object","assign","msToSeconds","motion","duration","xmoderate","ease","moderate","xgentle","name","_jsx","BaseMotionEntryExit","motionVariants"],"mappings":";;;;;;;;AAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,oFAAA,CAgBA,IAAMC,eAAiD,CAAG,CAAC,CAAC,CAAE,CAAC,CAAE,GAAG,CAAE,CAAC,CAAC,CACxE,IAAMC,WAA6C,CAAG,CAAC,IAAI,CAAE,CAAC,CAAE,CAAC,CAAE,CAAC,CAAC,CACrE,IAAMC,iBAAmD,CAAG,CAAC,GAAG,CAAE,CAAC,CAAE,CAAC,CAAE,CAAC,CAAC,CAE1E,IAAMC,gBAAgB,CAAG,SAAnBA,gBAAgBA,CACpBC,SAA8C,CAC9CC,UAAiD,CACxB,CACzB,GAAID,SAAS,GAAK,KAAK,CAAE,CACvB,OAAO,CAAeC,YAAAA,EAAAA,UAAU,CAAG,CAAA,CAAA,CACrC,CAEA,GAAID,SAAS,GAAK,MAAM,CAAE,CACxB,OAAO,CAAA,YAAA,EAAeC,UAAU,CAAG,CAAA,CAAA,CACrC,CAEA,GAAID,SAAS,GAAK,OAAO,CAAE,CACzB,OAAO,CAAA,WAAA,EAAcC,UAAU,CAAA,CAAA,CAAG,CACpC,CAEA,OAAO,CAAA,WAAA,EAAcA,UAAU,CAAG,CAAA,CAAA,CACpC,CAAC,CAiCK,IAAAC,KAAK,CAAG,SAARA,KAAKA,CAAAC,IAAA,CAS2B,CAAA,IARpCC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAAC,SAAA,CAAAF,IAAA,CACRG,IAAI,C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