@webority/mobile-ui 0.157.0 → 0.160.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 (111) hide show
  1. package/canvas-kit.json +1 -1
  2. package/dist/canvas-kit/kit.js +5 -5
  3. package/dist/canvas-kit/manifest.json +22 -12
  4. package/dist/canvas-kit/release.json +7 -7
  5. package/lib/commonjs/components/AppBar/AppBar.js +1 -1
  6. package/lib/commonjs/components/AppIcon/AppIcon.js +1 -1
  7. package/lib/commonjs/components/AppIcon/index.js +1 -1
  8. package/lib/commonjs/components/Banner/Banner.js +1 -1
  9. package/lib/commonjs/components/BarChart/BarChart.js +1 -1
  10. package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
  11. package/lib/commonjs/components/Button/Button.js +1 -1
  12. package/lib/commonjs/components/Button/index.js +1 -1
  13. package/lib/commonjs/components/Carousel/Carousel.js +1 -1
  14. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
  15. package/lib/commonjs/components/ChoiceGroup/ChoiceGroup.js +1 -1
  16. package/lib/commonjs/components/Confetti/Confetti.js +1 -1
  17. package/lib/commonjs/components/Drawer/Drawer.js +1 -1
  18. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
  19. package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
  20. package/lib/commonjs/components/MessageList/MessageList.js +1 -1
  21. package/lib/commonjs/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
  22. package/lib/commonjs/components/NumberInput/NumberInput.js +1 -1
  23. package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
  24. package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
  25. package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
  26. package/lib/commonjs/components/Radio/Radio.js +1 -1
  27. package/lib/commonjs/components/Radio/RadioGroup.js +1 -1
  28. package/lib/commonjs/components/Rating/Rating.js +1 -1
  29. package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
  30. package/lib/commonjs/components/SearchBar/useRecentSearches.js +1 -1
  31. package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
  32. package/lib/commonjs/components/Skeleton/SkeletonContent.js +1 -1
  33. package/lib/commonjs/components/Skeleton/SkeletonList.js +1 -1
  34. package/lib/commonjs/components/Slider/valueText.js +1 -1
  35. package/lib/commonjs/components/Stepper/Stepper.js +1 -1
  36. package/lib/commonjs/components/TagInput/TagInput.js +1 -1
  37. package/lib/commonjs/components/TimePicker/TimePicker.js +1 -1
  38. package/lib/commonjs/components/Toast/Toast.js +1 -1
  39. package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
  40. package/lib/commonjs/hooks/useControllableState.js +1 -1
  41. package/lib/commonjs/icons.js +1 -1
  42. package/lib/commonjs/index.js +1 -1
  43. package/lib/module/components/AppBar/AppBar.js +1 -1
  44. package/lib/module/components/AppIcon/AppIcon.js +1 -1
  45. package/lib/module/components/AppIcon/index.js +1 -1
  46. package/lib/module/components/Banner/Banner.js +1 -1
  47. package/lib/module/components/BarChart/BarChart.js +1 -1
  48. package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
  49. package/lib/module/components/Button/Button.js +1 -1
  50. package/lib/module/components/Button/index.js +1 -1
  51. package/lib/module/components/Carousel/Carousel.js +1 -1
  52. package/lib/module/components/Checkbox/Checkbox.js +1 -1
  53. package/lib/module/components/ChoiceGroup/ChoiceGroup.js +1 -1
  54. package/lib/module/components/Confetti/Confetti.js +1 -1
  55. package/lib/module/components/Drawer/Drawer.js +1 -1
  56. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
  57. package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
  58. package/lib/module/components/MessageList/MessageList.js +1 -1
  59. package/lib/module/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
  60. package/lib/module/components/NumberInput/NumberInput.js +1 -1
  61. package/lib/module/components/OTPInput/OTPInput.js +1 -1
  62. package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
  63. package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
  64. package/lib/module/components/Radio/Radio.js +1 -1
  65. package/lib/module/components/Radio/RadioGroup.js +1 -1
  66. package/lib/module/components/Rating/Rating.js +1 -1
  67. package/lib/module/components/SearchBar/SearchBar.js +1 -1
  68. package/lib/module/components/SearchBar/useRecentSearches.js +1 -1
  69. package/lib/module/components/Skeleton/Skeleton.js +1 -1
  70. package/lib/module/components/Skeleton/SkeletonContent.js +1 -1
  71. package/lib/module/components/Skeleton/SkeletonList.js +1 -1
  72. package/lib/module/components/Slider/valueText.js +1 -1
  73. package/lib/module/components/Stepper/Stepper.js +1 -1
  74. package/lib/module/components/TagInput/TagInput.js +1 -1
  75. package/lib/module/components/TimePicker/TimePicker.js +1 -1
  76. package/lib/module/components/Toast/Toast.js +1 -1
  77. package/lib/module/components/Tooltip/Tooltip.js +1 -1
  78. package/lib/module/hooks/useControllableState.js +1 -1
  79. package/lib/module/icons.js +1 -1
  80. package/lib/module/index.js +1 -1
  81. package/lib/typescript/commonjs/components/AppIcon/AppIcon.d.ts +2 -0
  82. package/lib/typescript/commonjs/components/AppIcon/index.d.ts +1 -1
  83. package/lib/typescript/commonjs/components/Button/Button.d.ts +4 -0
  84. package/lib/typescript/commonjs/components/Button/index.d.ts +1 -1
  85. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +7 -4
  86. package/lib/typescript/commonjs/components/ChoiceGroup/ChoiceGroup.d.ts +14 -6
  87. package/lib/typescript/commonjs/components/FieldBase/ChoiceText.d.ts +6 -5
  88. package/lib/typescript/commonjs/components/FilePicker/FilePicker.d.ts +2 -2
  89. package/lib/typescript/commonjs/components/ProfilePicker/ProfilePicker.d.ts +15 -9
  90. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +7 -4
  91. package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +5 -0
  92. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +4 -4
  93. package/lib/typescript/commonjs/hooks/useControllableState.d.ts +23 -8
  94. package/lib/typescript/commonjs/icons.d.ts +1 -1
  95. package/lib/typescript/commonjs/index.d.ts +2 -1
  96. package/lib/typescript/module/components/AppIcon/AppIcon.d.ts +2 -0
  97. package/lib/typescript/module/components/AppIcon/index.d.ts +1 -1
  98. package/lib/typescript/module/components/Button/Button.d.ts +4 -0
  99. package/lib/typescript/module/components/Button/index.d.ts +1 -1
  100. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +7 -4
  101. package/lib/typescript/module/components/ChoiceGroup/ChoiceGroup.d.ts +14 -6
  102. package/lib/typescript/module/components/FieldBase/ChoiceText.d.ts +6 -5
  103. package/lib/typescript/module/components/FilePicker/FilePicker.d.ts +2 -2
  104. package/lib/typescript/module/components/ProfilePicker/ProfilePicker.d.ts +15 -9
  105. package/lib/typescript/module/components/Radio/Radio.d.ts +7 -4
  106. package/lib/typescript/module/components/Radio/RadioGroup.d.ts +5 -0
  107. package/lib/typescript/module/components/Switch/Switch.d.ts +4 -4
  108. package/lib/typescript/module/hooks/useControllableState.d.ts +23 -8
  109. package/lib/typescript/module/icons.d.ts +1 -1
  110. package/lib/typescript/module/index.d.ts +2 -1
  111. package/package.json +7 -7
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Rating=exports.DEFAULT_RATING_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_hitSlop=require("../../utils/hitSlop.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Skeleton/index.js"),_index3=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const RATING_SIZES=["sm","md","lg"],RATING_TONES=["primary","success","warning","danger","info","neutral"],DEFAULT_RATING_LABELS=exports.DEFAULT_RATING_LABELS=Object.freeze({value:(e,t)=>`${e} of ${t} stars`}),sizePxMap={sm:16,md:24,lg:32},resolveSize=e=>sizePxMap[e],PULSE_SCALE=1.2,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},clampToStep=(e,t,i)=>{const a=Math.max(0,Math.min(t,e)),s=Math.round(a/i)*i;return Number(s.toFixed(2))},Star=({index:e,filled:t,size:i,filledColor:a,emptyColor:s,scale:r})=>{const n=Math.max(0,Math.min(1,t-e));return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[starStyles.starWrap,{width:i,height:i,transform:[{scale:r}]}],children:[(0,_jsxRuntime.jsx)(_index3.Text,{variant:"body",style:[starStyles.glyph,{color:s,fontSize:i,lineHeight:i}],accessible:!1,children:"☆"}),n>0?(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[starStyles.fillClip,{width:i*n,height:i}],children:(0,_jsxRuntime.jsx)(_index3.Text,{variant:"body",style:[starStyles.glyph,{color:a,fontSize:i,lineHeight:i}],accessible:!1,children:"★"})}):null]})},RatingRoot=(0,_react.forwardRef)((e,t)=>{const{value:i,onChange:a,max:s=5,allowHalf:r=!0,readonly:n=!1,size:l="md",tone:o="warning",label:c,loading:u=!1,haptic:d,labels:m,accessibilityLabel:x,style:_,containerStyle:p,starContainerStyle:y,testID:v}=e;(0,_assertValidValue.assertValidValue)("Rating","size",e.size,RATING_SIZES),(0,_assertValidValue.assertValidValue)("Rating","tone",e.tone,RATING_TONES);const g=(0,_react.useMemo)(()=>({...DEFAULT_RATING_LABELS,...m}),[m]),h=(0,_index.useTheme)(),S=(0,_react.useMemo)(()=>buildStyles(h),[h]),f=!n&&"function"==typeof a,R=r?.5:1,b=resolveSize(l),j=toneColorFor(h,o),N=h.colors.border,w=(0,_react.useRef)(b),A=(0,_react.useCallback)(e=>{w.current=e.nativeEvent.layout.width},[]),V=(0,_react.useRef)(new Map),T=(0,_react.useMemo)(()=>{const e=V.current,t=[];for(let i=0;i<s;i+=1){let a=e.get(i);a||(a=new _reactNative.Animated.Value(1),e.set(i,a)),t.push(a)}for(const t of Array.from(e.keys()))t>=s&&e.delete(t);return t},[s]),E=h.settings.components.rating?.pulseOnPress??!1,C=(0,_react.useCallback)(e=>{const t=T[e];if(!t)throw new Error(`Rating has no star at index ${e}; the pulse index must be below max.`);_reactNative.Animated.sequence([_reactNative.Animated.timing(t,{toValue:1.2,duration:h.motion.duration.fast,easing:_reactNative.Easing.bezier(...h.motion.ease["in-out"]),useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.spring(t,{toValue:1,damping:h.motion.spring.bouncy.damping,stiffness:h.motion.spring.bouncy.stiffness,mass:h.motion.spring.bouncy.mass,useNativeDriver:_nativeDriver.nativeDriver})]).start()},[h.motion,T]),L=(0,_react.useCallback)((e,t)=>{if(!f||!a)return;const i=clampToStep(e,s,R),r=(0,_hapticUtils.resolveHaptic)(d,"selection");r&&(0,_hapticUtils.triggerHaptic)(r),E&&"number"==typeof t&&C(t),a(i)},[f,a,s,R,C,d,E]),k=(0,_react.useCallback)(e=>t=>{if(!f)return;const i=w.current||b,a=t.nativeEvent.locationX??i;let s;s=r&&a<i/2?e+.5:e+1,L(s,e)},[f,b,r,L]),D=(0,_react.useCallback)(e=>{f&&("increment"===e.nativeEvent.actionName?L(i+R):"decrement"===e.nativeEvent.actionName&&L(i-R))},[f,i,R,L]),z=g.value(i,s),I=x??c??z,M=[];for(const[e,t]of T.entries()){const a=(0,_jsxRuntime.jsx)(Star,{index:e,filled:i,size:b,filledColor:j,emptyColor:N,scale:t},e);M.push(f?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:k(e),onLayout:0===e?A:void 0,hitSlop:4,...(0,_hitSlop.hitSlopMarker)(4),accessible:!1,style:S.starPress,children:a},e):(0,_jsxRuntime.jsx)(_reactNative.View,{onLayout:0===e?A:void 0,style:S.starPress,children:a},e))}const q=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[S.wrapper,p,_],ref:t,testID:v,children:[c?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",color:"secondary",style:S.label,children:c}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[S.row,y],accessible:!0,accessibilityRole:f?"adjustable":"text",accessibilityLabel:I,accessibilityValue:f?{min:0,max:s,now:i,text:z}:void 0,accessibilityActions:f?[{name:"increment"},{name:"decrement"}]:void 0,onAccessibilityAction:f?D:void 0,children:M})]});return u?(0,_jsxRuntime.jsx)(RatingSkeleton,{...e}):q});RatingRoot.displayName="Rating";const RatingSkeleton=({max:e=5,size:t="md",label:i,containerStyle:a,starContainerStyle:s,style:r})=>{const n=(0,_index.useTheme)(),l=resolveSize(t),o=Math.max(1,e);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[{alignItems:"flex-start"},a,r],accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==i?(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:80,height:14,style:{marginBottom:n.space.xs}}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{flexDirection:"row"},s],children:Array.from({length:o}).map((e,t)=>(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:l,height:l,radius:Math.round(.25*l),style:t<o-1?{marginRight:n.space.xs}:void 0},`sk-star-${t}`))})]})};RatingSkeleton.displayName="RatingSkeleton";const Rating=exports.Rating=Object.assign(RatingRoot,{Skeleton:RatingSkeleton}),starStyles=_reactNative.StyleSheet.create({starWrap:{position:"relative",alignItems:"flex-start",justifyContent:"center"},glyph:{textAlign:"left",includeFontPadding:!1},fillClip:{position:"absolute",top:0,left:0,overflow:"hidden"}}),buildStyles=e=>_reactNative.StyleSheet.create({wrapper:{flexDirection:"column"},row:{flexDirection:"row",alignItems:"center"},starPress:{marginRight:e.space.xs},label:{marginBottom:e.space.xs}});var _default=exports.default=Rating;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Rating=exports.DEFAULT_RATING_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_hitSlop=require("../../utils/hitSlop.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Skeleton/index.js"),_index3=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const RATING_SIZES=["sm","md","lg"],RATING_TONES=["primary","success","warning","danger","info","neutral"],DEFAULT_RATING_LABELS=exports.DEFAULT_RATING_LABELS=Object.freeze({value:(e,t)=>`${e} of ${t} stars`}),sizePxMap={sm:16,md:24,lg:32},resolveSize=e=>sizePxMap[e],PULSE_SCALE=1.2,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},clampToStep=(e,t,i)=>{const a=Math.max(0,Math.min(t,e)),s=Math.round(a/i)*i;return Number(s.toFixed(2))},Star=({index:e,filled:t,size:i,filledColor:a,emptyColor:s,scale:r})=>{const n=Math.max(0,Math.min(1,t-e));return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[starStyles.starWrap,{width:i,height:i,transform:[{scale:r}]}],children:[(0,_jsxRuntime.jsx)(_index3.Text,{variant:"body",style:[starStyles.glyph,{color:s,fontSize:i,lineHeight:i}],accessible:!1,children:"☆"}),n>0?(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[starStyles.fillClip,{width:i*n,height:i}],children:(0,_jsxRuntime.jsx)(_index3.Text,{variant:"body",style:[starStyles.glyph,{color:a,fontSize:i,lineHeight:i}],accessible:!1,children:"★"})}):null]})},RatingRoot=(0,_react.forwardRef)((e,t)=>{const{value:i,onChange:a,max:s=5,allowHalf:r=!0,readonly:n=!1,size:l="md",tone:o="warning",label:c,loading:u=!1,haptic:d,labels:m,accessibilityLabel:x,style:_,containerStyle:p,starContainerStyle:y,testID:v}=e;(0,_assertValidValue.assertValidValue)("Rating","size",e.size,RATING_SIZES),(0,_assertValidValue.assertValidValue)("Rating","tone",e.tone,RATING_TONES);const g=(0,_react.useMemo)(()=>({...DEFAULT_RATING_LABELS,...m}),[m]),h=(0,_index.useTheme)(),S=(0,_react.useMemo)(()=>buildStyles(h),[h]),f=!n&&"function"==typeof a,R=r?.5:1,b=resolveSize(l),j=toneColorFor(h,o),N=h.colors.border,w=(0,_react.useRef)(b),A=(0,_react.useCallback)(e=>{w.current=e.nativeEvent.layout.width},[]),V=(0,_react.useRef)(new Map),T=(0,_react.useMemo)(()=>{const e=V.current,t=[];for(let i=0;i<s;i+=1){let a=e.get(i);a||(a=new _reactNative.Animated.Value(1),e.set(i,a)),t.push(a)}for(const t of Array.from(e.keys()))t>=s&&e.delete(t);return t},[s]),E=h.settings.components.rating?.pulseOnPress??!1,k=(0,_react.useCallback)(e=>{const t=T[e];if(!t)throw new Error(`Rating has no star at index ${e}; the pulse index must be below max.`);_reactNative.Animated.sequence([_reactNative.Animated.timing(t,{toValue:1.2,duration:h.motion.duration.fast,easing:_reactNative.Easing.bezier(...h.motion.ease["in-out"]),useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.spring(t,{toValue:1,damping:h.motion.spring.bouncy.damping,stiffness:h.motion.spring.bouncy.stiffness,mass:h.motion.spring.bouncy.mass,useNativeDriver:_nativeDriver.nativeDriver})]).start()},[h.motion,T]),C=(0,_react.useCallback)((e,t)=>{if(!f||!a)return;const i=clampToStep(e,s,R),r=(0,_hapticUtils.resolveHaptic)(d,"selection");r&&(0,_hapticUtils.triggerHaptic)(r),E&&"number"==typeof t&&k(t),a(i)},[f,a,s,R,k,d,E]),L=(0,_react.useCallback)(e=>t=>{if(!f)return;const i=w.current||b,a=t.nativeEvent.locationX??i;let s;s=r&&a<i/2?e+.5:e+1,C(s,e)},[f,b,r,C]),D=(0,_react.useCallback)(e=>{f&&("increment"===e.nativeEvent.actionName?C(i+R):"decrement"===e.nativeEvent.actionName&&C(i-R))},[f,i,R,C]),M=g.value(i,s),z=x??c??M,I=[];for(const[e,t]of T.entries()){const a=(0,_jsxRuntime.jsx)(Star,{index:e,filled:i,size:b,filledColor:j,emptyColor:N,scale:t},e);I.push(f?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:L(e),onLayout:0===e?A:void 0,hitSlop:4,...(0,_hitSlop.hitSlopMarker)(4),accessible:!1,style:S.starPress,children:a},e):(0,_jsxRuntime.jsx)(_reactNative.View,{onLayout:0===e?A:void 0,style:S.starPress,children:a},e))}const q=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[S.wrapper,p,_],ref:t,testID:v,children:[c?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",color:"secondary",style:S.label,children:c}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[S.row,y],accessible:!0,accessibilityRole:f?"adjustable":"text",accessibilityLabel:z,accessibilityValue:f?{min:0,max:s,now:i,text:M}:void 0,accessibilityActions:f?[{name:"increment"},{name:"decrement"}]:void 0,onAccessibilityAction:f?D:void 0,children:I})]});return u?(0,_jsxRuntime.jsx)(RatingSkeleton,{...e}):q});RatingRoot.displayName="Rating";const RatingSkeleton=({max:e=5,size:t="md",label:i,containerStyle:a,starContainerStyle:s,style:r})=>{const n=(0,_index.useTheme)(),l=resolveSize(t),o=Math.max(1,e),c=(0,_react.useMemo)(()=>Array.from({length:o},(e,t)=>({key:`sk-star-${t}`,index:t})),[o]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[{alignItems:"flex-start"},a,r],accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==i?(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:80,height:14,style:{marginBottom:n.space.xs}}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{flexDirection:"row"},s],children:c.map(({key:e,index:t})=>(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:l,height:l,radius:Math.round(.25*l),style:t<o-1?{marginRight:n.space.xs}:void 0},e))})]})};RatingSkeleton.displayName="RatingSkeleton";const Rating=exports.Rating=Object.assign(RatingRoot,{Skeleton:RatingSkeleton}),starStyles=_reactNative.StyleSheet.create({starWrap:{position:"relative",alignItems:"flex-start",justifyContent:"center"},glyph:{textAlign:"left",includeFontPadding:!1},fillClip:{position:"absolute",top:0,left:0,overflow:"hidden"}}),buildStyles=e=>_reactNative.StyleSheet.create({wrapper:{flexDirection:"column"},row:{flexDirection:"row",alignItems:"center"},starPress:{marginRight:e.space.xs},label:{marginBottom:e.space.xs}});var _default=exports.default=Rating;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.SearchBar=exports.DEFAULT_SEARCH_BAR_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_useControllableState=require("../../hooks/useControllableState.js"),_useDebounce=require("../../hooks/useDebounce.js"),_index=require("../../theme/index.js"),_announce=require("../../utils/announce.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_hitSlop=require("../../utils/hitSlop.js"),_mergeRefs=require("../../utils/mergeRefs.js"),_defaultIcons=require("../AppIcon/defaultIcons.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_FieldBase=require("../FieldBase/FieldBase.js"),_useFloatingLabel=require("../FieldBase/useFloatingLabel.js"),_SearchPanel=require("./SearchPanel.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_SEARCH_BAR_LABELS=exports.DEFAULT_SEARCH_BAR_LABELS=Object.freeze({placeholder:"Search…",recents:"Recent searches",clearAll:"Clear all",clearAllRecents:"Clear all recent searches",searchAgain:"Searches again",removeRecent:e=>`Remove ${e} from recent searches`,scope:"Search scope",clearSearch:"Clear search",searching:e=>`Searching ${e}`,suggestionCount:e=>1===e?"1 suggestion":`${e} suggestions`,removed:e=>`Removed ${e}`,recentsCleared:"Recent searches cleared"}),DEFAULT_PANEL_ROWS=8,HOLD_RELEASE_MS=50,SearchBar=exports.SearchBar=(0,_react.forwardRef)((e,a)=>{const{value:t,onChangeText:s,onSubmit:l,onFocus:r,onBlur:c,placeholder:i,autoFocus:n=!1,disabled:o=!1,onClear:u,leftIcon:d,debounceMs:_,size:h="md",variant:b,radius:p,label:S,labelMode:g="top",labelStyle:f,scopes:m,scope:v,onScopeChange:x,recents:R,maxRecents:C=DEFAULT_PANEL_ROWS,onSelectRecent:j,onRemove:F,onClearRecents:B,suggestions:L,maxSuggestions:y=DEFAULT_PANEL_ROWS,onSelect:A,haptic:E,labels:V,style:k,inputStyle:q,accessibilityLabel:I,testID:T,...D}=e;(0,_assertValidValue.assertValidValue)("SearchBar","size",e.size,["sm","md","lg"]),(0,_assertValidValue.assertValidValue)("SearchBar","variant",e.variant,["outline","filled","underline"]),(0,_assertValidValue.assertValidValue)("SearchBar","labelMode",e.labelMode,["top","float"]);const H=(0,_index.useTheme)(),N=(0,_react.useMemo)(()=>({...DEFAULT_SEARCH_BAR_LABELS,...V}),[V]),P=i??N.placeholder,z=b??H.settings.components["search-bar"]?.defaultVariant??H.settings.components.field?.defaultVariant??"filled",U="underline"===z,M=(0,_index.resolveFieldSize)(H,h),w=p??H.components["search-bar"][h].radius,O=(0,_FieldBase.resolveFieldTextStyle)(H,{disabled:o}),W=(0,_react.useRef)(null),$=(0,_react.useMemo)(()=>(0,_mergeRefs.mergeRefs)(W,a),[a]),K=(0,_react.useCallback)(()=>{o||W.current?.focus()},[o]),G=(0,_react.useMemo)(()=>buildStyles(H),[H]),J="string"==typeof t?t:"",[Q,X]=(0,_react.useState)(!1),Y=(0,_react.useCallback)(e=>{X(!0),r?.(e)},[r]),Z=(0,_react.useCallback)(e=>{X(!1),c?.(e)},[c]),[ee,ae]=(0,_react.useState)(J),te=(0,_useDebounce.useDebounce)(ee,_??0);(0,_react.useEffect)(()=>{void 0!==_&&J!==ee&&ae(J)},[J,_]);const se=(0,_react.useRef)(J);(0,_react.useEffect)(()=>{void 0!==_&&te!==se.current&&(se.current=te,s(te))},[te,_,s]);const le=(0,_react.useCallback)(e=>{void 0===_?s(e):ae(e)},[_,s]),re=(0,_react.useCallback)(()=>{const e=(0,_hapticUtils.resolveHaptic)(E,"selection");e&&(0,_hapticUtils.triggerHaptic)(e),void 0!==_&&(ae(""),se.current=""),s(""),u?.()},[E,_,s,u]),ce=(0,_react.useCallback)(()=>{l?.(void 0!==_?ee:J)},[l,_,ee,J]),ie=void 0!==_?ee:J,ne=ie.length>0,[oe,ue]=(0,_useControllableState.useControllableState)({value:v,defaultValue:m?.[0]?.value??"",onChange:x}),de=(0,_react.useCallback)(e=>{ue(e);const a=m?.find(a=>a.value===e)?.label;a&&(0,_announce.announce)(N.searching(a))},[m,ue,N]),[he,be]=(0,_react.useState)(!1),pe=(0,_react.useRef)(null),Se=(0,_react.useCallback)(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),ge=(0,_react.useCallback)(()=>{Se(),be(!0)},[Se]),fe=(0,_react.useCallback)(()=>{Se(),pe.current=setTimeout(()=>be(!1),50)},[Se]);(0,_react.useEffect)(()=>Se,[Se]);const me=!o&&(Q||he),ve=(0,_react.useMemo)(()=>(R??[]).slice(0,C),[R,C]),xe=(0,_react.useMemo)(()=>(L??[]).slice(0,y).map(_SearchPanel.normalizeSuggestion),[L,y]),Re=me&&!ne&&ve.length>0,Ce=me&&ne&&xe.length>0,je=Ce?xe.length:0,Fe=je>0?N.suggestionCount(je):"";(0,_react.useEffect)(()=>{Fe&&(0,_announce.announce)(Fe)},[Fe]);const Be=(0,_react.useCallback)(()=>{const e=(0,_hapticUtils.resolveHaptic)(E,"selection");e&&(0,_hapticUtils.triggerHaptic)(e)},[E]),Le=(0,_react.useCallback)(e=>{Be(),W.current?.blur(),be(!1),j?.(e)},[Be,j]),ye=(0,_react.useCallback)(e=>{Be(),W.current?.blur(),be(!1),A?.(e)},[Be,A]),Ae=(0,_react.useCallback)(e=>{Be(),F?.(e),(0,_announce.announce)(N.removed(e)),K()},[Be,F,K,N]),Ee=(0,_react.useCallback)(()=>{Be(),B?.(),(0,_announce.announce)(N.recentsCleared),K()},[Be,B,K,N]),Ve={size:M.icon,color:o?H.colors["text-disabled"]:H.colors["text-subtle"],disabled:o},ke=d?(0,_slotIcon.renderSlotIcon)(d,Ve):(H.settings.icons.search??_defaultIcons.defaultIcons.search)(Ve),qe=(0,_jsxRuntime.jsx)(_reactNative.View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:ke}),Ie=Boolean(S)&&"float"===g,Te=(0,_useFloatingLabel.useFloatingLabel)({label:S,enabled:Ie,floated:Q||ne,variant:z,sizeTokens:M,leadingOffset:M.icon+H.space.md,trailingOffset:ne?M.icon+H.space.md:0,paddingLeft:U?H.space.none:M["padding-x"],color:H.colors["field-label"],style:f}),De=ne&&!o?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:re,hitSlop:8,...(0,_hitSlop.hitSlopMarker)(8),accessibilityRole:"button",accessibilityLabel:N.clearSearch,children:(H.settings.icons.close??_defaultIcons.defaultIcons.close)({size:M.icon,color:H.colors["text-muted"]})}):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:k,testID:T,children:[S&&!Ie?(0,_jsxRuntime.jsx)(_FieldBase.FieldLabel,{size:h,style:f,children:S}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:G.root,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:G.fieldWrap,children:[(0,_jsxRuntime.jsx)(_FieldBase.FieldBase,{size:h,variant:z,focused:Q,disabled:o,filled:ne,minHeight:M["min-height"],paddingHorizontal:U?H.space.none:M["padding-x"],radius:w,leading:qe,trailing:De,topNotch:Te.topNotch,onPress:K,pressFeedback:!1,accessibilityRole:"search",accessibilityLabel:I??P,children:(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:$,style:[G.input,{fontSize:M.text,color:O.color,...O.weightStyle},q],value:ie,onChangeText:le,onSubmitEditing:ce,onFocus:Y,onBlur:Z,placeholder:!Ie||Q||ne?P:void 0,placeholderTextColor:O.placeholderColor,autoFocus:n,editable:!o,returnKeyType:"search",selectionColor:(0,_FieldBase.resolveVariantColors)(H,z).borderFocusedRepresentative,accessibilityLabel:I??P,accessibilityState:{disabled:o},"aria-disabled":o,...D})}),Te.node]})}),m&&m.length>0?(0,_jsxRuntime.jsx)(_SearchPanel.SearchScopeBar,{scopes:m,scope:oe||(m[0]?.value??""),disabled:o,haptic:E,labels:N,onChange:de}):null,Re?(0,_jsxRuntime.jsx)(_SearchPanel.SearchRecents,{recents:ve,labels:N,onSelect:Le,onRemove:F?Ae:void 0,onClear:B?Ee:void 0,onHold:ge,onRelease:fe}):null,Ce?(0,_jsxRuntime.jsx)(_SearchPanel.SearchSuggestions,{suggestions:xe,query:ie,onSelect:ye,onHold:ge,onRelease:fe}):null]})});SearchBar.displayName="SearchBar";const buildStyles=e=>_reactNative.StyleSheet.create({root:{flexDirection:"row",alignItems:"center",width:"100%",position:"relative",overflow:"visible"},fieldWrap:{flex:1,position:"relative",overflow:"visible"},input:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});var _default=exports.default=SearchBar;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.SearchBar=exports.DEFAULT_SEARCH_BAR_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_useControllableState=require("../../hooks/useControllableState.js"),_useDebounce=require("../../hooks/useDebounce.js"),_index=require("../../theme/index.js"),_announce=require("../../utils/announce.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_hitSlop=require("../../utils/hitSlop.js"),_mergeRefs=require("../../utils/mergeRefs.js"),_defaultIcons=require("../AppIcon/defaultIcons.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_FieldBase=require("../FieldBase/FieldBase.js"),_useFloatingLabel=require("../FieldBase/useFloatingLabel.js"),_SearchPanel=require("./SearchPanel.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_SEARCH_BAR_LABELS=exports.DEFAULT_SEARCH_BAR_LABELS=Object.freeze({placeholder:"Search…",recents:"Recent searches",clearAll:"Clear all",clearAllRecents:"Clear all recent searches",searchAgain:"Searches again",removeRecent:e=>`Remove ${e} from recent searches`,scope:"Search scope",clearSearch:"Clear search",searching:e=>`Searching ${e}`,suggestionCount:e=>1===e?"1 suggestion":`${e} suggestions`,removed:e=>`Removed ${e}`,recentsCleared:"Recent searches cleared"}),DEFAULT_PANEL_ROWS=8,HOLD_RELEASE_MS=50,SearchBar=exports.SearchBar=(0,_react.forwardRef)((e,a)=>{const{value:t,onChangeText:s,onSubmit:l,onFocus:r,onBlur:c,placeholder:n,autoFocus:i=!1,disabled:o=!1,onClear:u,leftIcon:d,debounceMs:_,size:h="md",variant:b,radius:p,label:S,labelMode:g="top",labelStyle:f,scopes:m,scope:v,onScopeChange:x,recents:R,maxRecents:C=DEFAULT_PANEL_ROWS,onSelectRecent:j,onRemove:F,onClearRecents:B,suggestions:L,maxSuggestions:y=DEFAULT_PANEL_ROWS,onSelect:A,haptic:E,labels:V,style:k,inputStyle:q,accessibilityLabel:I,testID:T,...D}=e;(0,_assertValidValue.assertValidValue)("SearchBar","size",e.size,["sm","md","lg"]),(0,_assertValidValue.assertValidValue)("SearchBar","variant",e.variant,["outline","filled","underline"]),(0,_assertValidValue.assertValidValue)("SearchBar","labelMode",e.labelMode,["top","float"]);const H=(0,_index.useTheme)(),N=(0,_react.useMemo)(()=>({...DEFAULT_SEARCH_BAR_LABELS,...V}),[V]),P=n??N.placeholder,z=b??H.settings.components["search-bar"]?.defaultVariant??H.settings.components.field?.defaultVariant??"filled",U="underline"===z,M=(0,_index.resolveFieldSize)(H,h),w=p??H.components["search-bar"][h].radius,O=(0,_FieldBase.resolveFieldTextStyle)(H,{disabled:o}),W=(0,_react.useRef)(null),$=(0,_react.useMemo)(()=>(0,_mergeRefs.mergeRefs)(W,a),[a]),K=(0,_react.useCallback)(()=>{o||W.current?.focus()},[o]),G=(0,_react.useMemo)(()=>buildStyles(H),[H]),J="string"==typeof t?t:"",[Q,X]=(0,_react.useState)(!1),Y=(0,_react.useCallback)(e=>{X(!0),r?.(e)},[r]),Z=(0,_react.useCallback)(e=>{X(!1),c?.(e)},[c]),[ee,ae]=(0,_react.useState)(J),te=(0,_react.useRef)(ee);te.current=ee;const se=(0,_useDebounce.useDebounce)(ee,_??0);(0,_react.useEffect)(()=>{void 0!==_&&J!==te.current&&ae(J)},[J,_]);const le=(0,_react.useRef)(J);(0,_react.useEffect)(()=>{void 0!==_&&se!==le.current&&(le.current=se,s(se))},[se,_,s]);const re=(0,_react.useCallback)(e=>{void 0===_?s(e):ae(e)},[_,s]),ce=(0,_react.useCallback)(()=>{const e=(0,_hapticUtils.resolveHaptic)(E,"selection");e&&(0,_hapticUtils.triggerHaptic)(e),void 0!==_&&(ae(""),le.current=""),s(""),u?.()},[E,_,s,u]),ne=(0,_react.useCallback)(()=>{l?.(void 0!==_?ee:J)},[l,_,ee,J]),ie=void 0!==_?ee:J,oe=ie.length>0,[ue,de]=(0,_useControllableState.useControllableState)({value:v,defaultValue:m?.[0]?.value??"",onChange:x}),he=(0,_react.useCallback)(e=>{de(e);const a=m?.find(a=>a.value===e)?.label;a&&(0,_announce.announce)(N.searching(a))},[m,de,N]),[be,pe]=(0,_react.useState)(!1),Se=(0,_react.useRef)(null),ge=(0,_react.useCallback)(()=>{Se.current&&(clearTimeout(Se.current),Se.current=null)},[]),fe=(0,_react.useCallback)(()=>{ge(),pe(!0)},[ge]),me=(0,_react.useCallback)(()=>{ge(),Se.current=setTimeout(()=>pe(!1),50)},[ge]);(0,_react.useEffect)(()=>ge,[ge]);const ve=!o&&(Q||be),xe=(0,_react.useMemo)(()=>(R??[]).slice(0,C),[R,C]),Re=(0,_react.useMemo)(()=>(L??[]).slice(0,y).map(_SearchPanel.normalizeSuggestion),[L,y]),Ce=ve&&!oe&&xe.length>0,je=ve&&oe&&Re.length>0,Fe=je?Re.length:0,Be=Fe>0?N.suggestionCount(Fe):"";(0,_react.useEffect)(()=>{Be&&(0,_announce.announce)(Be)},[Be]);const Le=(0,_react.useCallback)(()=>{const e=(0,_hapticUtils.resolveHaptic)(E,"selection");e&&(0,_hapticUtils.triggerHaptic)(e)},[E]),ye=(0,_react.useCallback)(e=>{Le(),W.current?.blur(),pe(!1),j?.(e)},[Le,j]),Ae=(0,_react.useCallback)(e=>{Le(),W.current?.blur(),pe(!1),A?.(e)},[Le,A]),Ee=(0,_react.useCallback)(e=>{Le(),F?.(e),(0,_announce.announce)(N.removed(e)),K()},[Le,F,K,N]),Ve=(0,_react.useCallback)(()=>{Le(),B?.(),(0,_announce.announce)(N.recentsCleared),K()},[Le,B,K,N]),ke={size:M.icon,color:o?H.colors["text-disabled"]:H.colors["text-subtle"],disabled:o},qe=d?(0,_slotIcon.renderSlotIcon)(d,ke):(H.settings.icons.search??_defaultIcons.defaultIcons.search)(ke),Ie=(0,_jsxRuntime.jsx)(_reactNative.View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:qe}),Te=Boolean(S)&&"float"===g,De=(0,_useFloatingLabel.useFloatingLabel)({label:S,enabled:Te,floated:Q||oe,variant:z,sizeTokens:M,leadingOffset:M.icon+H.space.md,trailingOffset:oe?M.icon+H.space.md:0,paddingLeft:U?H.space.none:M["padding-x"],color:H.colors["field-label"],style:f}),He=oe&&!o?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:ce,hitSlop:8,...(0,_hitSlop.hitSlopMarker)(8),accessibilityRole:"button",accessibilityLabel:N.clearSearch,children:(H.settings.icons.close??_defaultIcons.defaultIcons.close)({size:M.icon,color:H.colors["text-muted"]})}):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:k,testID:T,children:[S&&!Te?(0,_jsxRuntime.jsx)(_FieldBase.FieldLabel,{size:h,style:f,children:S}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:G.root,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:G.fieldWrap,children:[(0,_jsxRuntime.jsx)(_FieldBase.FieldBase,{size:h,variant:z,focused:Q,disabled:o,filled:oe,minHeight:M["min-height"],paddingHorizontal:U?H.space.none:M["padding-x"],radius:w,leading:Ie,trailing:He,topNotch:De.topNotch,onPress:K,pressFeedback:!1,accessibilityRole:"search",accessibilityLabel:I??P,children:(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:$,style:[G.input,{fontSize:M.text,color:O.color,...O.weightStyle},q],value:ie,onChangeText:re,onSubmitEditing:ne,onFocus:Y,onBlur:Z,placeholder:!Te||Q||oe?P:void 0,placeholderTextColor:O.placeholderColor,autoFocus:i,editable:!o,returnKeyType:"search",selectionColor:(0,_FieldBase.resolveVariantColors)(H,z).borderFocusedRepresentative,accessibilityLabel:I??P,accessibilityState:{disabled:o},"aria-disabled":o,...D})}),De.node]})}),m&&m.length>0?(0,_jsxRuntime.jsx)(_SearchPanel.SearchScopeBar,{scopes:m,scope:ue||(m[0]?.value??""),disabled:o,haptic:E,labels:N,onChange:he}):null,Ce?(0,_jsxRuntime.jsx)(_SearchPanel.SearchRecents,{recents:xe,labels:N,onSelect:ye,onRemove:F?Ee:void 0,onClear:B?Ve:void 0,onHold:fe,onRelease:me}):null,je?(0,_jsxRuntime.jsx)(_SearchPanel.SearchSuggestions,{suggestions:Re,query:ie,onSelect:Ae,onHold:fe,onRelease:me}):null]})});SearchBar.displayName="SearchBar";const buildStyles=e=>_reactNative.StyleSheet.create({root:{flexDirection:"row",alignItems:"center",width:"100%",position:"relative",overflow:"visible"},fieldWrap:{flex:1,position:"relative",overflow:"visible"},input:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});var _default=exports.default=SearchBar;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useRecentSearches=void 0;var _mobileCore=require("@webority/mobile-core"),_react=require("react");const DEFAULT_MAX=8,isStringList=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e),parseStringList=e=>isStringList(e)?e:null,useRecentSearches=(e,r)=>{const t=r?.max??8,[c,s]=(0,_react.useState)([]),a=(0,_react.useRef)([]),n=(0,_react.useRef)(!1);(0,_react.useEffect)(()=>{let r=!1;return n.current=!1,a.current=[],s([]),_mobileCore.Storage.getJson(e,parseStringList).then(e=>{if(r||n.current||null===e)return;const c=e.slice(0,t);a.current=c,s(c)}),()=>{r=!0}},[e]);const u=(0,_react.useCallback)(r=>{n.current=!0,a.current=r,s(r),_mobileCore.Storage.setJson(e,r)},[e]);return{recents:c,add:(0,_react.useCallback)(e=>{const r=e.trim();if(!r)return;const c=r.toLowerCase(),s=a.current.filter(e=>e.toLowerCase()!==c);u([r,...s].slice(0,t))},[u,t]),remove:(0,_react.useCallback)(e=>{u(a.current.filter(r=>r!==e))},[u]),clear:(0,_react.useCallback)(()=>{const e=a.current;return u([]),e},[u]),replace:(0,_react.useCallback)(e=>{u(e.slice(0,t))},[u,t])}};exports.useRecentSearches=useRecentSearches;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useRecentSearches=void 0;var _mobileCore=require("@webority/mobile-core"),_react=require("react");const DEFAULT_MAX=8,isStringList=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e),parseStringList=e=>isStringList(e)?e:null,useRecentSearches=(e,r)=>{const t=r?.max??8,c=(0,_react.useRef)(t);c.current=t;const[s,a]=(0,_react.useState)([]),n=(0,_react.useRef)([]),u=(0,_react.useRef)(!1);(0,_react.useEffect)(()=>{let r=!1;const t=c.current;return u.current=!1,n.current=[],a([]),_mobileCore.Storage.getJson(e,parseStringList).then(e=>{if(r||u.current||null===e)return;const c=e.slice(0,t);n.current=c,a(c)}),()=>{r=!0}},[e]);const o=(0,_react.useCallback)(r=>{u.current=!0,n.current=r,a(r),_mobileCore.Storage.setJson(e,r)},[e]);return{recents:s,add:(0,_react.useCallback)(e=>{const r=e.trim();if(!r)return;const c=r.toLowerCase(),s=n.current.filter(e=>e.toLowerCase()!==c);o([r,...s].slice(0,t))},[o,t]),remove:(0,_react.useCallback)(e=>{o(n.current.filter(r=>r!==e))},[o]),clear:(0,_react.useCallback)(()=>{const e=n.current;return o([]),e},[o]),replace:(0,_react.useCallback)(e=>{o(e.slice(0,t))},[o,t])}};exports.useRecentSearches=useRecentSearches;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.SkeletonText=exports.SkeletonCircle=exports.Skeleton=exports.DEFAULT_SKELETON_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_useReducedMotion=require("../../hooks/useReducedMotion.js"),_index=require("../../theme/index.js"),_Gradient=require("../../theme/Gradient.js"),_index2=require("../../utils/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_SkeletonClock=require("./SkeletonClock.js"),_SkeletonProvider=require("./SkeletonProvider.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_SKELETON_LABELS=exports.DEFAULT_SKELETON_LABELS=Object.freeze({loading:"Loading"}),resolveRadius=(e,t)=>"number"==typeof t?t:e.radius[t],resolveWidth=e=>void 0===e?"100%":e,radiusForShape=(e,t,s,r,i)=>{if(void 0!==i)return resolveRadius(e,i);switch(t){case"circle":return"number"==typeof s?Math.min(s,r)/2:r/2;case"rounded":return e.radius.md;default:return e.radius.sm}},Skeleton=e=>{const{shape:t="rect",width:s="100%",height:r=16,radius:i,variant:o,colors:a,labels:n,style:l,testID:u}=e;(0,_assertValidValue.assertValidValue)("Skeleton","shape",e.shape,["rect","rounded","circle","text"]),(0,_assertValidValue.assertValidValue)("Skeleton","variant",e.variant,["shimmer","pulse","none"]);const c=(0,_index.useTheme)(),d=(0,_SkeletonProvider.useSkeletonDefaults)(),m=(0,_SkeletonClock.useSkeletonClock)(),h=(0,_useReducedMotion.useReducedMotion)(),S=o??d.variant??"shimmer",_=h&&"auto"===(d.animation??"auto");let p=S;m.enabled?_&&"shimmer"===S&&(p="pulse"):p="none";const x=a?.background??d.colors?.background??c.colors.skeleton,k=a?.highlight??d.colors?.highlight??c.colors["skeleton-highlight"],{responsive:v}=(0,_index2.useScreenDimensions)(),b=(0,_react.useMemo)(()=>buildStyles(),[]),y=(0,_react.useMemo)(()=>({...DEFAULT_SKELETON_LABELS,...n}),[n]),g=resolveWidth(s),j=v.size(r),L=radiusForShape(c,t,g,j,i),[R,E]=(0,_react.useState)(0),T=(0,_react.useMemo)(()=>R<=0?0:Math.max(48,.7*R),[R]),V=(0,_react.useMemo)(()=>R<=0?0:m.shimmer.interpolate({inputRange:[0,1],outputRange:[-T,R]}),[m.shimmer,T,R]),f=(0,_react.useMemo)(()=>"none"===p?null:"pulse"===p?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[_reactNative.StyleSheet.absoluteFill,{backgroundColor:k,opacity:m.pulse.interpolate({inputRange:[0,1],outputRange:[0,.55]})}]}):R<=0?null:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[b.shimmerBand,{width:T,transform:[{translateX:V}],experimental_backgroundImage:[(0,_Gradient.toBackgroundImage)({colors:["transparent",k,"transparent"],locations:[0,.5,1],start:{x:0,y:.5},end:{x:1,y:.5}})]}]}),[p,k,m.pulse,R,b.shimmerBand,T,V]);return(0,_jsxRuntime.jsx)(_reactNative.View,{onLayout:e=>{const t=e.nativeEvent.layout.width;t!==R&&E(t)},accessible:!0,accessibilityLabel:y.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",testID:u,style:[b.base,{width:g,height:j,borderRadius:L,..._corners.smoothCorners,backgroundColor:x},l],children:f})};exports.Skeleton=Skeleton,Skeleton.displayName="Skeleton";const SkeletonCircle=({size:e,style:t,...s})=>{const{responsive:r}=(0,_index2.useScreenDimensions)(),i=r.size(e);return(0,_jsxRuntime.jsx)(Skeleton,{...s,shape:"circle",width:i,height:e,style:t})};exports.SkeletonCircle=SkeletonCircle,SkeletonCircle.displayName="SkeletonCircle";const SkeletonText=({lines:e=3,lastLineWidth:t="60%",spacing:s,fontSize:r,variant:i,radius:o="sm",width:a="100%",labels:n,style:l,testID:u})=>{const c=(0,_index.useTheme)(),d=s??c.space.xs,m=Math.max(1,e);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:l,testID:u,children:Array.from({length:m}).map((e,s)=>{const l=s===m-1&&m>1?t:a;return(0,_jsxRuntime.jsx)(Skeleton,{shape:"text",width:l,height:r??c.text.base.size,radius:o,variant:i,labels:n,style:s<m-1?{marginBottom:d}:void 0},s)})})};exports.SkeletonText=SkeletonText,SkeletonText.displayName="SkeletonText";const buildStyles=()=>_reactNative.StyleSheet.create({base:{overflow:"hidden"},shimmerBand:{position:"absolute",top:0,bottom:0,left:0}});var _default=exports.default=Skeleton;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.SkeletonText=exports.SkeletonCircle=exports.Skeleton=exports.DEFAULT_SKELETON_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_useReducedMotion=require("../../hooks/useReducedMotion.js"),_index=require("../../theme/index.js"),_Gradient=require("../../theme/Gradient.js"),_index2=require("../../utils/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_SkeletonClock=require("./SkeletonClock.js"),_SkeletonProvider=require("./SkeletonProvider.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_SKELETON_LABELS=exports.DEFAULT_SKELETON_LABELS=Object.freeze({loading:"Loading"}),resolveRadius=(e,t)=>"number"==typeof t?t:e.radius[t],resolveWidth=e=>void 0===e?"100%":e,radiusForShape=(e,t,s,i,r)=>{if(void 0!==r)return resolveRadius(e,r);switch(t){case"circle":return"number"==typeof s?Math.min(s,i)/2:i/2;case"rounded":return e.radius.md;default:return e.radius.sm}},Skeleton=e=>{const{shape:t="rect",width:s="100%",height:i=16,radius:r,variant:o,colors:n,labels:a,style:l,testID:u}=e;(0,_assertValidValue.assertValidValue)("Skeleton","shape",e.shape,["rect","rounded","circle","text"]),(0,_assertValidValue.assertValidValue)("Skeleton","variant",e.variant,["shimmer","pulse","none"]);const d=(0,_index.useTheme)(),c=(0,_SkeletonProvider.useSkeletonDefaults)(),m=(0,_SkeletonClock.useSkeletonClock)(),h=(0,_useReducedMotion.useReducedMotion)(),_=o??c.variant??"shimmer",x=h&&"auto"===(c.animation??"auto");let S=_;m.enabled?x&&"shimmer"===_&&(S="pulse"):S="none";const p=n?.background??c.colors?.background??d.colors.skeleton,k=n?.highlight??c.colors?.highlight??d.colors["skeleton-highlight"],{responsive:v}=(0,_index2.useScreenDimensions)(),y=(0,_react.useMemo)(()=>buildStyles(),[]),b=(0,_react.useMemo)(()=>({...DEFAULT_SKELETON_LABELS,...a}),[a]),g=resolveWidth(s),j=v.size(i),L=radiusForShape(d,t,g,j,r),[R,E]=(0,_react.useState)(0),T=(0,_react.useMemo)(()=>R<=0?0:Math.max(48,.7*R),[R]),V=(0,_react.useMemo)(()=>R<=0?0:m.shimmer.interpolate({inputRange:[0,1],outputRange:[-T,R]}),[m.shimmer,T,R]),f=(0,_react.useMemo)(()=>"none"===S?null:"pulse"===S?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[_reactNative.StyleSheet.absoluteFill,{backgroundColor:k,opacity:m.pulse.interpolate({inputRange:[0,1],outputRange:[0,.55]})}]}):R<=0?null:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[y.shimmerBand,{width:T,transform:[{translateX:V}],experimental_backgroundImage:[(0,_Gradient.toBackgroundImage)({colors:["transparent",k,"transparent"],locations:[0,.5,1],start:{x:0,y:.5},end:{x:1,y:.5}})]}]}),[S,k,m.pulse,R,y.shimmerBand,T,V]);return(0,_jsxRuntime.jsx)(_reactNative.View,{onLayout:e=>{const t=e.nativeEvent.layout.width;t!==R&&E(t)},accessible:!0,accessibilityLabel:b.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",testID:u,style:[y.base,{width:g,height:j,borderRadius:L,..._corners.smoothCorners,backgroundColor:p},l],children:f})};exports.Skeleton=Skeleton,Skeleton.displayName="Skeleton";const SkeletonCircle=({size:e,style:t,...s})=>{const{responsive:i}=(0,_index2.useScreenDimensions)(),r=i.size(e);return(0,_jsxRuntime.jsx)(Skeleton,{...s,shape:"circle",width:r,height:e,style:t})};exports.SkeletonCircle=SkeletonCircle,SkeletonCircle.displayName="SkeletonCircle";const SkeletonText=({lines:e=3,lastLineWidth:t="60%",spacing:s,fontSize:i,variant:r,radius:o="sm",width:n="100%",labels:a,style:l,testID:u})=>{const d=(0,_index.useTheme)(),c=s??d.space.xs,m=Math.max(1,e),h=(0,_react.useMemo)(()=>Array.from({length:m},(e,t)=>({key:`sk-text-line-${t}`,index:t})),[m]);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:l,testID:u,children:h.map(e=>{const s=e.index===m-1&&m>1?t:n;return(0,_jsxRuntime.jsx)(Skeleton,{shape:"text",width:s,height:i??d.text.base.size,radius:o,variant:r,labels:a,style:e.index<m-1?{marginBottom:c}:void 0},e.key)})})};exports.SkeletonText=SkeletonText,SkeletonText.displayName="SkeletonText";const buildStyles=()=>_reactNative.StyleSheet.create({base:{overflow:"hidden"},shimmerBand:{position:"absolute",top:0,bottom:0,left:0}});var _default=exports.default=Skeleton;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.SkeletonContent=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_usePresenceMotion=require("../../hooks/usePresenceMotion.js"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_guards=require("../../utils/guards.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Text/index.js"),_Skeleton=require("./Skeleton.js"),_SkeletonProvider=require("./SkeletonProvider.js"),_SkeletonSkip=require("./SkeletonSkip.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var r,i,n=Object.defineProperty,s={__proto__:null,default:e};if(Object(e)!==e)return s;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,s)}for(i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((r=n&&Object.getOwnPropertyDescriptor(e,i))&&(r.get||r.set)?n(s,i,r):s[i]=e[i]);return s}const DEFAULT_REVEAL_FADE_MS=300,flattenStyle=e=>({..._reactNative.StyleSheet.flatten(e)}),isWidthText=e=>"auto"===e||"100%"===e||/^\d+(\.\d+)?%$/.test(e),isComponentType=e=>"function"==typeof e||(0,_guards.isRecord)(e),resolveWidth=(e,t)=>"number"==typeof e||"string"==typeof e&&isWidthText(e)?e:t,resolveRadius=(e,t)=>"number"==typeof e?e:t,skeletonizeNode=(e,t,r,i,n="r")=>{if(null==t||"boolean"==typeof t)return null;if("string"==typeof t||"number"==typeof t)return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{shape:"text",width:"60%",height:14,variant:r,colors:i},`${n}-text`);if(Array.isArray(t))return _react.Children.map(t,(t,s)=>skeletonizeNode(e,t,r,i,`${n}-${s}`));if(!(0,_react.isValidElement)(t))return null;const s=t,a=s.props??{},o=s.type;if(o===_SkeletonSkip.SkeletonSkip)return(0,_react.cloneElement)(s,{key:`${n}-skip`});if(("function"==typeof o||"object"==typeof o)&&"Skeleton"in o&&isComponentType(o.Skeleton)){const e=o.Skeleton;return(0,_jsxRuntime.jsx)(e,{...a},`${n}-self`)}if(o===_reactNative.Image){const e=flattenStyle(a.style),t=resolveWidth(e.width,"100%"),s="number"==typeof e.height?e.height:120,o=resolveRadius(e.borderRadius,"sm");return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{width:t,height:s,radius:o,variant:r,colors:i,style:{margin:"number"==typeof e.margin?e.margin:void 0}},`${n}-img`)}if(o===_reactNative.Text||o===_index2.Text){const t=flattenStyle(a.style),s="number"==typeof t.fontSize?t.fontSize:e.text.base.size,o=resolveWidth(t.width,"85%");return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{shape:"text",width:o,height:Math.round(1.15*s),variant:r,colors:i,style:{marginVertical:e.space.xxs}},`${n}-txt`)}if(null!=a.children)return(0,_react.cloneElement)(s,{key:`${n}-w`},skeletonizeNode(e,a.children,r,i,`${n}-c`));if(o===_reactNative.View){const e=flattenStyle(a.style);if(null!=e.width||null!=e.height){const t=resolveWidth(e.width,"100%"),s="number"==typeof e.height?e.height:20,a=resolveRadius(e.borderRadius,"sm");return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{width:t,height:s,radius:a,variant:r,colors:i},`${n}-vw`)}}return(0,_react.cloneElement)(s,{key:`${n}-leaf`})},SkeletonContent=e=>{const{loading:t,children:r,placeholder:i,variant:n,count:s=1,colors:a,labels:o,fadeDuration:l,style:u,testID:c}=e;(0,_assertValidValue.assertValidValue)("SkeletonContent","variant",e.variant,["shimmer","pulse","none"]);const d=(0,_index.useTheme)(),_=(0,_react.useMemo)(()=>({..._Skeleton.DEFAULT_SKELETON_LABELS,...o}),[o]),f=(0,_SkeletonProvider.useSkeletonDefaults)(),h=(0,_usePresenceMotion.usePresenceMotion)(),p=l??f.fadeDuration??(h.reduced?h.duration("default"):300),y=(0,_react.useRef)(t),m=(0,_react.useRef)((0,_index.createAnimatedValue)(t?0:1)).current;if((0,_react.useEffect)(()=>{let e;return y.current&&!t?(m.setValue(0),e=_reactNative.Animated.timing(m,{toValue:1,duration:p,useNativeDriver:_nativeDriver.nativeDriver}),e.start()):!y.current&&t&&m.setValue(1),y.current=t,()=>e?.stop()},[t,m,p]),!t)return p<=0?(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:r}):(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[u,{opacity:m}],testID:c,children:r});if(void 0!==i){const e=s>1?Array.from({length:s},(e,t)=>(0,_jsxRuntime.jsx)(_react.default.Fragment,{children:i},`sk-ph-${t}`)):i;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:u,testID:c,accessible:!0,accessibilityLabel:_.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",children:e})}const x=s>1?Array.from({length:s},(e,t)=>(0,_jsxRuntime.jsx)(_react.default.Fragment,{children:r},`sk-rep-${t}`)):r;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:u,testID:c,accessible:!0,accessibilityLabel:_.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",children:skeletonizeNode(d,x,n,a)})};exports.SkeletonContent=SkeletonContent,SkeletonContent.displayName="SkeletonContent";var _default=exports.default=SkeletonContent;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.SkeletonContent=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_usePresenceMotion=require("../../hooks/usePresenceMotion.js"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_guards=require("../../utils/guards.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Text/index.js"),_Skeleton=require("./Skeleton.js"),_SkeletonProvider=require("./SkeletonProvider.js"),_SkeletonSkip=require("./SkeletonSkip.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var i,r,n=Object.defineProperty,s={__proto__:null,default:e};if(Object(e)!==e)return s;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,s)}for(r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((i=n&&Object.getOwnPropertyDescriptor(e,r))&&(i.get||i.set)?n(s,r,i):s[r]=e[r]);return s}const DEFAULT_REVEAL_FADE_MS=300,flattenStyle=e=>({..._reactNative.StyleSheet.flatten(e)}),isWidthText=e=>"auto"===e||"100%"===e||/^\d+(\.\d+)?%$/.test(e),isComponentType=e=>"function"==typeof e||(0,_guards.isRecord)(e),resolveWidth=(e,t)=>"number"==typeof e||"string"==typeof e&&isWidthText(e)?e:t,resolveRadius=(e,t)=>"number"==typeof e?e:t,skeletonizeNode=(e,t,i,r,n="r")=>{if(null==t||"boolean"==typeof t)return null;if("string"==typeof t||"number"==typeof t)return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{shape:"text",width:"60%",height:14,variant:i,colors:r},`${n}-text`);if(Array.isArray(t))return _react.Children.map(t,(t,s)=>skeletonizeNode(e,t,i,r,`${n}-${s}`));if(!(0,_react.isValidElement)(t))return null;const s=t,a=s.props??{},o=s.type;if(o===_SkeletonSkip.SkeletonSkip)return(0,_react.cloneElement)(s,{key:`${n}-skip`});if(("function"==typeof o||"object"==typeof o)&&"Skeleton"in o&&isComponentType(o.Skeleton)){const e=o.Skeleton;return(0,_jsxRuntime.jsx)(e,{...a},`${n}-self`)}if(o===_reactNative.Image){const e=flattenStyle(a.style),t=resolveWidth(e.width,"100%"),s="number"==typeof e.height?e.height:120,o=resolveRadius(e.borderRadius,"sm");return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{width:t,height:s,radius:o,variant:i,colors:r,style:{margin:"number"==typeof e.margin?e.margin:void 0}},`${n}-img`)}if(o===_reactNative.Text||o===_index2.Text){const t=flattenStyle(a.style),s="number"==typeof t.fontSize?t.fontSize:e.text.base.size,o=resolveWidth(t.width,"85%");return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{shape:"text",width:o,height:Math.round(1.15*s),variant:i,colors:r,style:{marginVertical:e.space.xxs}},`${n}-txt`)}if(null!=a.children)return(0,_react.cloneElement)(s,{key:`${n}-w`},skeletonizeNode(e,a.children,i,r,`${n}-c`));if(o===_reactNative.View){const e=flattenStyle(a.style);if(null!=e.width||null!=e.height){const t=resolveWidth(e.width,"100%"),s="number"==typeof e.height?e.height:20,a=resolveRadius(e.borderRadius,"sm");return(0,_jsxRuntime.jsx)(_Skeleton.Skeleton,{width:t,height:s,radius:a,variant:i,colors:r},`${n}-vw`)}}return(0,_react.cloneElement)(s,{key:`${n}-leaf`})},SkeletonContent=e=>{const{loading:t,children:i,placeholder:r,variant:n,count:s=1,colors:a,labels:o,fadeDuration:l,style:u,testID:c}=e;(0,_assertValidValue.assertValidValue)("SkeletonContent","variant",e.variant,["shimmer","pulse","none"]);const d=(0,_index.useTheme)(),_=(0,_react.useMemo)(()=>({..._Skeleton.DEFAULT_SKELETON_LABELS,...o}),[o]),f=(0,_react.useMemo)(()=>Array.from({length:s},(e,t)=>({key:`sk-slot-${t}`})),[s]),h=(0,_SkeletonProvider.useSkeletonDefaults)(),y=(0,_usePresenceMotion.usePresenceMotion)(),p=l??h.fadeDuration??(y.reduced?y.duration("default"):300),m=(0,_react.useRef)(t),k=(0,_react.useRef)((0,_index.createAnimatedValue)(t?0:1)).current;if((0,_react.useEffect)(()=>{let e;return m.current&&!t?(k.setValue(0),e=_reactNative.Animated.timing(k,{toValue:1,duration:p,useNativeDriver:_nativeDriver.nativeDriver}),e.start()):!m.current&&t&&k.setValue(1),m.current=t,()=>e?.stop()},[t,k,p]),!t)return p<=0?(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:i}):(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[u,{opacity:k}],testID:c,children:i});if(void 0!==r){const e=s>1?f.map(e=>(0,_jsxRuntime.jsx)(_react.default.Fragment,{children:r},e.key)):r;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:u,testID:c,accessible:!0,accessibilityLabel:_.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",children:e})}const x=s>1?f.map(e=>(0,_jsxRuntime.jsx)(_react.default.Fragment,{children:i},e.key)):i;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:u,testID:c,accessible:!0,accessibilityLabel:_.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",children:skeletonizeNode(d,x,n,a)})};exports.SkeletonContent=SkeletonContent,SkeletonContent.displayName="SkeletonContent";var _default=exports.default=SkeletonContent;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SkeletonList=SkeletonList;var _react=_interopRequireDefault(require("react")),_reactNative=require("react-native"),_SkeletonContent=require("./SkeletonContent.js"),_SkeletonProvider=require("./SkeletonProvider.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function SkeletonList(e){const{loading:t,data:r,renderItem:n,renderPlaceholder:l,placeholderCount:o,variant:i,colors:s,labels:a,placeholderContainerStyle:u,horizontal:c,contentContainerStyle:d,style:_,testID:x,...m}=e,S=(0,_SkeletonProvider.useSkeletonDefaults)(),j=o??S.placeholderCount??3;if(t){const e=Array.from({length:Math.max(0,j)},(e,t)=>(0,_jsxRuntime.jsx)(_react.default.Fragment,{children:l?l(t):null},`sk-list-${t}`));return(0,_jsxRuntime.jsx)(_SkeletonContent.SkeletonContent,{loading:!0,variant:i,colors:s,labels:a,style:_,testID:x,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[c?styles.row:styles.column,u],children:e})})}return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{data:r??[],renderItem:n,horizontal:c,contentContainerStyle:d,style:_,testID:x,...m})}const styles={row:{flexDirection:"row"},column:{flexDirection:"column"}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SkeletonList=SkeletonList;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_SkeletonContent=require("./SkeletonContent.js"),_SkeletonProvider=require("./SkeletonProvider.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var r,n,o=Object.defineProperty,l={__proto__:null,default:e};if(Object(e)!==e)return l;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,l)}for(n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((r=o&&Object.getOwnPropertyDescriptor(e,n))&&(r.get||r.set)?o(l,n,r):l[n]=e[n]);return l}function SkeletonList(e){const{loading:t,data:r,renderItem:n,renderPlaceholder:o,placeholderCount:l,variant:a,colors:i,labels:c,placeholderContainerStyle:s,horizontal:u,contentContainerStyle:d,style:_,testID:h,...f}=e,y=(0,_SkeletonProvider.useSkeletonDefaults)(),p=l??y.placeholderCount??3,x=(0,_react.useMemo)(()=>Array.from({length:Math.max(0,p)},(e,t)=>({key:`sk-list-${t}`,index:t})),[p]);return t?(0,_jsxRuntime.jsx)(_SkeletonContent.SkeletonContent,{loading:!0,variant:a,colors:i,labels:c,style:_,testID:h,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[u?styles.row:styles.column,s],children:x.map(e=>(0,_jsxRuntime.jsx)(_react.default.Fragment,{children:o?o(e.index):null},e.key))})}):(0,_jsxRuntime.jsx)(_reactNative.FlatList,{data:r??[],renderItem:n,horizontal:u,contentContainerStyle:d,style:_,testID:h,...f})}const styles={row:{flexDirection:"row"},column:{flexDirection:"column"}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useValueDraft=exports.snapValue=exports.sliderToneInk=exports.parseTyped=exports.clampValue=exports.RollingText=exports.CountingText=void 0;var _react=require("react"),_reactNative=require("react-native"),_nativeDriver=require("../../utils/nativeDriver.js"),_index=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const sliderToneInk=(e,t)=>{switch(t){case"success":return e.colors["on-success"];case"warning":return e.colors["on-warning"];case"danger":return e.colors["on-danger"];case"info":return e.colors["on-info"];case"neutral":return e.colors["on-neutral"];case"primary":return e.colors["on-primary"]}};exports.sliderToneInk=sliderToneInk;const clampValue=(e,t,r)=>Math.min(Math.max(e,t),r);exports.clampValue=clampValue;const snapValue=(e,t,r,n)=>{if(n<=0)return clampValue(e,t,r);const a=String(n).split(".")[1]?.length??0,s=Math.round((e-t)/n)*n+t;return clampValue(a>0?Number(s.toFixed(a)):s,t,r)};exports.snapValue=snapValue;const parseTyped=e=>{const t=e.replace(/[^\d.-]/g,"");if(""===t||"."===t||"-"===t)return null;const r=Number.parseFloat(t);return Number.isFinite(r)?r:null};exports.parseTyped=parseTyped;const easeOutCubic=e=>1-(1-e)**3,roundTo=(e,t)=>{const r=10**t;return Math.round(e*r)/r},CountingText=exports.CountingText=(0,_react.memo)(({value:e,format:t,decimals:r=2,duration:n,jumpKey:a="",style:s,testID:o})=>{const[i,l]=(0,_react.useState)(e),u=(0,_react.useRef)(e),c=(0,_react.useRef)(a);return(0,_react.useEffect)(()=>{const t=c.current!==a;c.current=a;const r=u.current;if(t||n<=0||r===e)return u.current=e,void l(e);const s=Date.now();let o=0;const tick=()=>{const t=Math.min(1,(Date.now()-s)/n),a=r+(e-r)*easeOutCubic(t);u.current=a,l(a),t<1&&(o=requestAnimationFrame(tick))};return o=requestAnimationFrame(tick),()=>cancelAnimationFrame(o)},[e,a,n]),(0,_jsxRuntime.jsx)(_index.Text,{variant:"caption",weight:"semibold",style:s,testID:o,children:t(roundTo(i,r))})});CountingText.displayName="CountingText";const useValueDraft=({value:e,min:t,max:r,step:n,format:a,parse:s=parseTyped,onChange:o})=>{const[i,l]=(0,_react.useState)(null);return{text:i??a(e),editing:null!==i,onFocus:()=>l(a(e)),onChangeText:e=>{l(e);const n=s(e);null!==n&&o(clampValue(n,t,r))},onBlur:()=>{if(null===i)return;const a=s(i);l(null);const u=snapValue(a??t,t,r,n);u!==e&&o(u)}}};exports.useValueDraft=useValueDraft;const ROLL_TRAVEL_RATIO=1.2,RollingSlot=(0,_react.memo)(({text:e,direction:t,duration:r,style:n,testID:a})=>{const[s,o]=(0,_react.useState)(null),i=(0,_react.useRef)(e),l=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current,u=1.2*(_reactNative.StyleSheet.flatten(n)?.fontSize??14);(0,_react.useEffect)(()=>{if(i.current===e)return;const t=i.current;if(i.current=e,r<=0)return void o(null);o(t),l.setValue(0);const n=_reactNative.Animated.timing(l,{toValue:1,duration:r,easing:_reactNative.Easing.out(_reactNative.Easing.cubic),useNativeDriver:_nativeDriver.nativeDriver});return n.start(({finished:e})=>{e&&o(null)}),()=>n.stop()},[e,r,l]);const c="up"===t?-1:1,p=null===s?null:{opacity:l,transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[-c*u,0]})}]},x={opacity:l.interpolate({inputRange:[0,1],outputRange:[1,0]}),transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[0,c*u]})}]};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:rollStyles.slot,children:[(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{style:[n,p],testID:a,children:e}),null!==s?(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{style:[n,rollStyles.leaving,x],testID:a?`${a}-leaving`:void 0,children:s}):null]})});RollingSlot.displayName="RollingSlot";const RollingText=exports.RollingText=(0,_react.memo)(({text:e,direction:t="up",duration:r,perCharacter:n=!0,style:a,testID:s})=>{const o=(0,_react.useRef)(e),i=n?Math.max(e.length,o.current.length):1;return(0,_react.useEffect)(()=>{o.current=e},[e]),(0,_jsxRuntime.jsx)(_reactNative.View,{style:rollStyles.row,testID:s,children:n?Array.from({length:i},(n,o)=>(0,_jsxRuntime.jsx)(RollingSlot,{text:e[o]??"",direction:t,duration:r,style:a,testID:s?`${s}-char`:void 0},o)):(0,_jsxRuntime.jsx)(RollingSlot,{text:e,direction:t,duration:r,style:a,testID:s?`${s}-char`:void 0})})});RollingText.displayName="RollingText";const rollStyles=_reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"baseline"},slot:{overflow:"hidden"},leaving:{position:"absolute",left:0,top:0}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useValueDraft=exports.snapValue=exports.sliderToneInk=exports.parseTyped=exports.clampValue=exports.RollingText=exports.CountingText=void 0;var _react=require("react"),_reactNative=require("react-native"),_nativeDriver=require("../../utils/nativeDriver.js"),_index=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const sliderToneInk=(e,t)=>{switch(t){case"success":return e.colors["on-success"];case"warning":return e.colors["on-warning"];case"danger":return e.colors["on-danger"];case"info":return e.colors["on-info"];case"neutral":return e.colors["on-neutral"];case"primary":return e.colors["on-primary"]}};exports.sliderToneInk=sliderToneInk;const clampValue=(e,t,r)=>Math.min(Math.max(e,t),r);exports.clampValue=clampValue;const snapValue=(e,t,r,n)=>{if(n<=0)return clampValue(e,t,r);const a=String(n).split(".")[1]?.length??0,s=Math.round((e-t)/n)*n+t;return clampValue(a>0?Number(s.toFixed(a)):s,t,r)};exports.snapValue=snapValue;const parseTyped=e=>{const t=e.replace(/[^\d.-]/g,"");if(""===t||"."===t||"-"===t)return null;const r=Number.parseFloat(t);return Number.isFinite(r)?r:null};exports.parseTyped=parseTyped;const easeOutCubic=e=>1-(1-e)**3,roundTo=(e,t)=>{const r=10**t;return Math.round(e*r)/r},CountingText=exports.CountingText=(0,_react.memo)(({value:e,format:t,decimals:r=2,duration:n,jumpKey:a="",style:s,testID:o})=>{const[i,l]=(0,_react.useState)(e),u=(0,_react.useRef)(e),c=(0,_react.useRef)(a);return(0,_react.useEffect)(()=>{const t=c.current!==a;c.current=a;const r=u.current;if(t||n<=0||r===e)return u.current=e,void l(e);const s=Date.now();let o=0;const tick=()=>{const t=Math.min(1,(Date.now()-s)/n),a=r+(e-r)*easeOutCubic(t);u.current=a,l(a),t<1&&(o=requestAnimationFrame(tick))};return o=requestAnimationFrame(tick),()=>cancelAnimationFrame(o)},[e,a,n]),(0,_jsxRuntime.jsx)(_index.Text,{variant:"caption",weight:"semibold",style:s,testID:o,children:t(roundTo(i,r))})});CountingText.displayName="CountingText";const useValueDraft=({value:e,min:t,max:r,step:n,format:a,parse:s=parseTyped,onChange:o})=>{const[i,l]=(0,_react.useState)(null);return{text:i??a(e),editing:null!==i,onFocus:()=>l(a(e)),onChangeText:e=>{l(e);const n=s(e);null!==n&&o(clampValue(n,t,r))},onBlur:()=>{if(null===i)return;const a=s(i);l(null);const u=snapValue(a??t,t,r,n);u!==e&&o(u)}}};exports.useValueDraft=useValueDraft;const ROLL_TRAVEL_RATIO=1.2,RollingSlot=(0,_react.memo)(({text:e,direction:t,duration:r,style:n,testID:a})=>{const[s,o]=(0,_react.useState)(null),i=(0,_react.useRef)(e),l=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current,u=1.2*(_reactNative.StyleSheet.flatten(n)?.fontSize??14);(0,_react.useEffect)(()=>{if(i.current===e)return;const t=i.current;if(i.current=e,r<=0)return void o(null);o(t),l.setValue(0);const n=_reactNative.Animated.timing(l,{toValue:1,duration:r,easing:_reactNative.Easing.out(_reactNative.Easing.cubic),useNativeDriver:_nativeDriver.nativeDriver});return n.start(({finished:e})=>{e&&o(null)}),()=>n.stop()},[e,r,l]);const c="up"===t?-1:1,p=null===s?null:{opacity:l,transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[-c*u,0]})}]},x={opacity:l.interpolate({inputRange:[0,1],outputRange:[1,0]}),transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[0,c*u]})}]};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:rollStyles.slot,children:[(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{style:[n,p],testID:a,children:e}),null!==s?(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{style:[n,rollStyles.leaving,x],testID:a?`${a}-leaving`:void 0,children:s}):null]})});RollingSlot.displayName="RollingSlot";const RollingText=exports.RollingText=(0,_react.memo)(({text:e,direction:t="up",duration:r,perCharacter:n=!0,style:a,testID:s})=>{const o=(0,_react.useRef)(e),i=n?Math.max(e.length,o.current.length):1;(0,_react.useEffect)(()=>{o.current=e},[e]);const l=(0,_react.useMemo)(()=>Array.from({length:i},(e,t)=>({key:`roll-slot-${t}`,index:t})),[i]);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:rollStyles.row,testID:s,children:n?l.map(({key:n,index:o})=>(0,_jsxRuntime.jsx)(RollingSlot,{text:e[o]??"",direction:t,duration:r,style:a,testID:s?`${s}-char`:void 0},n)):(0,_jsxRuntime.jsx)(RollingSlot,{text:e,direction:t,duration:r,style:a,testID:s?`${s}-char`:void 0})})});RollingText.displayName="RollingText";const rollStyles=_reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"baseline"},slot:{overflow:"hidden"},leaving:{position:"absolute",left:0,top:0}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Stepper=exports.DEFAULT_STEPPER_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_hitSlop=require("../../utils/hitSlop.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Skeleton/index.js"),_index3=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_STEPPER_LABELS=exports.DEFAULT_STEPPER_LABELS=Object.freeze({step:(e,t,i,s)=>`Step ${e} of ${t}, ${i}, ${s}`,statusComplete:"complete",statusActive:"active",statusUpcoming:"upcoming",progressStep:(e,t)=>`Progress: step ${e} of ${t}`,progressDone:(e,t)=>`Progress: ${e} of ${t} steps done`,captionStep:(e,t,i)=>`Step ${e} of ${t}${i?` · ${i}`:""}`,captionDone:(e,t)=>`${e} of ${t} done`}),CIRCLE_SIZE=24,SEGMENT_HEIGHT=4,PULSE_SIZE=32,PULSE_DURATION=1100,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},toneOnColorFor=(e,t)=>{switch(t){case"success":return e.colors["on-success"];case"warning":return e.colors["on-warning"];case"danger":return e.colors["on-danger"];case"info":return e.colors["on-info"];case"neutral":return e.colors["on-neutral"];case"primary":return e.colors["on-primary"]}},statusWordFor=(e,t)=>{switch(t){case"complete":return e.statusComplete;case"active":return e.statusActive;case"upcoming":return e.statusUpcoming}},StepCircle=({index:e,step:t,status:i,toneColor:s,upcomingColor:r,upcomingFillColor:n,textOnColor:a,upcomingTextColor:o,interactive:l,canPress:c,totalSteps:u,onPress:d,pulseEnabled:p,labels:m,circleStyles:x,circleSlotStyle:_})=>{const h="active"===i,v=(0,_index.useTheme)(),g=(0,_react.useRef)((0,_index.createAnimatedValue)(1)).current,y=(0,_react.useRef)((0,_index.createAnimatedValue)(.5)).current;(0,_react.useEffect)(()=>{if(!h||!p)return g.setValue(1),void y.setValue(0);const e=_reactNative.Animated.loop(_reactNative.Animated.parallel([_reactNative.Animated.sequence([_reactNative.Animated.timing(g,{toValue:1.4,duration:1100,easing:_reactNative.Easing.out(_reactNative.Easing.ease),useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(g,{toValue:1,duration:0,useNativeDriver:_nativeDriver.nativeDriver})]),_reactNative.Animated.sequence([_reactNative.Animated.timing(y,{toValue:0,duration:1100,easing:_reactNative.Easing.out(_reactNative.Easing.ease),useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(y,{toValue:.5,duration:0,useNativeDriver:_nativeDriver.nativeDriver})])]));return e.start(),()=>e.stop()},[h,g,y,p]);const b="upcoming"===i?n:s,j="upcoming"===i?r:s,S="upcoming"===i?o:a,R="complete"===i,w=m.step(e+1,u,t.label,statusWordFor(m,i)),C=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:x.relative,children:[h&&p?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[x.pulse,{width:32,height:32,borderRadius:v.radius.pill,..._corners.smoothCorners,backgroundColor:s,opacity:y,transform:[{scale:g}]}]}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[x.circle,{width:24,height:24,borderRadius:v.radius.pill,..._corners.smoothCorners,backgroundColor:b,borderColor:j},_],children:t.icon?t.icon:R?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",weight:"semibold",style:[x.glyph,{color:S}],children:"✓"}):(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",weight:"semibold",style:[x.glyph,{color:S}],children:e+1})})]});return l?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>d(e),disabled:!c,accessibilityRole:"button",accessibilityLabel:w,accessibilityState:{selected:h,disabled:!c},"aria-selected":h,"aria-disabled":!c,hitSlop:8,...(0,_hitSlop.hitSlopMarker)(8),children:C}):(0,_jsxRuntime.jsx)(_reactNative.View,{accessibilityRole:"text",accessibilityLabel:w,accessibilityState:{selected:h},"aria-selected":h,children:C})},buildCircleStyles=()=>_reactNative.StyleSheet.create({relative:{alignItems:"center",justifyContent:"center"},pulse:{position:"absolute"},circle:{borderWidth:2,alignItems:"center",justifyContent:"center"},glyph:{includeFontPadding:!1}}),StepperRoot=(0,_react.forwardRef)((e,t)=>{const{steps:i,activeStep:s,defaultActiveStep:r=0,pressMode:n="none",onStepPress:a,onActiveStepChange:o,variant:l="horizontal",tone:c="primary",formatCaption:u,showCaption:d=!0,loading:p=!1,labels:m,accessibilityLabel:x,style:_,containerStyle:h,circleStyle:v,labelStyle:g,connectorStyle:y,haptic:b,testID:j}=e;(0,_assertValidValue.assertValidValue)("Stepper","variant",e.variant,["horizontal","vertical","segmented"]),(0,_assertValidValue.assertValidValue)("Stepper","tone",e.tone,["primary","success","warning","danger","info","neutral"]),(0,_assertValidValue.assertValidValue)("Stepper","pressMode",e.pressMode,["none","back","select"]);const S=(0,_react.useMemo)(()=>({...DEFAULT_STEPPER_LABELS,...m}),[m]),R=(0,_index.useTheme)(),w=R.settings.components.stepper?.pulseAnimation??!1,C=(0,_hapticUtils.resolveHaptic)(b,"selection"),f=(0,_react.useMemo)(()=>buildStyles(R),[R]),N=(0,_react.useMemo)(()=>buildCircleStyles(),[]),V=toneColorFor(R,c),k=R.colors.border,D=R.colors.bg,E=R.colors["text-muted"],L=toneOnColorFor(R,c),A=i.length,T="none"!==n,I=void 0!==s,[P,F]=(0,_react.useState)(r),$=I?s:P,B=null==$||$<0?null:$,statusOf=e=>null===B?"upcoming":e<B?"complete":e===B?"active":"upcoming",q=i.map((e,t)=>statusOf(t)),M=q.filter(e=>"upcoming"!==e).length,O=q.filter(e=>"complete"===e).length,canPressStatus=e=>"back"===n?"complete"===e:T,handleStepPress=e=>{if(!canPressStatus(statusOf(e)))return;C&&(0,_hapticUtils.triggerHaptic)(C),a?.(e);const t="select"===n&&e===B?null:e;I||F(t),o?.(t)},U=(0,_react.useRef)((0,_index.createAnimatedValue)(M)).current,H=(0,_react.useRef)(M);(0,_react.useEffect)(()=>{const e=H.current;if(e===M)return;H.current=M;const t=_reactNative.Animated.timing(U,{toValue:M,duration:R.motion.duration.default*Math.abs(M-e),easing:_reactNative.Easing.linear,useNativeDriver:!1});return t.start(),()=>t.stop()},[M,U,R.motion]);const sliceOf=e=>U.interpolate({inputRange:[e,e+1],outputRange:["0%","100%"],extrapolate:"clamp"}),z=A<=1?"0%":U.interpolate({inputRange:[1,A],outputRange:["0%","100%"],extrapolate:"clamp"}),W=null!==B&&B<A?B:null,G=x??(null!==W?S.progressStep(W+1,A):S.progressDone(O,A)),[Z,J]=(0,_react.useState)(0),K=A>0&&Z>0?Z/(2*A):0,Q=(0,_jsxRuntime.jsx)(_reactNative.View,{ref:t,style:[f.container,h,_],testID:j,accessibilityRole:"progressbar",accessibilityLabel:G,accessibilityValue:{min:0,max:A,now:M},children:"segmented"===l?(()=>{const e=null!==W?i[W]:void 0,t=d?u?u(W,A,e):null!==W?S.captionStep(W+1,A,e?.label):S.captionDone(O,A):"";return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[d?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",style:[f.sCaption,{marginBottom:R.space.sm},g],numberOfLines:1,children:t}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:f.sRow,children:i.map((e,t)=>{const i=statusOf(t),s=S.step(t+1,A,e.label,statusWordFor(S,i)),r=(0,_jsxRuntime.jsx)(_reactNative.View,{testID:j?`${j}-segment-${t}`:void 0,style:[f.sTrack,{backgroundColor:k},y],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[f.sFill,{backgroundColor:V,width:sliceOf(t)}]})});if(T){const n=canPressStatus(i);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:f.sItem,onPress:()=>handleStepPress(t),disabled:!n,accessibilityRole:"button",accessibilityLabel:s,accessibilityState:{selected:"active"===i,disabled:!n},"aria-selected":"active"===i,"aria-disabled":!n,hitSlop:{top:12,bottom:12},...(0,_hitSlop.hitSlopMarker)({top:12,bottom:12}),children:r},e.key)}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:f.sItem,accessibilityRole:"text",accessibilityLabel:s,accessibilityState:{selected:"active"===i},"aria-selected":"active"===i,children:r},e.key)})})]})})():"vertical"===l?(0,_jsxRuntime.jsx)(_reactNative.View,{style:f.vCol,children:i.map((e,t)=>{const i=statusOf(t),s=t===A-1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.vRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.vLeft,children:[(0,_jsxRuntime.jsx)(StepCircle,{index:t,step:e,status:i,toneColor:V,upcomingColor:k,upcomingFillColor:D,onPressColor:V,textOnColor:L,upcomingTextColor:E,interactive:T,canPress:canPressStatus(i),totalSteps:A,onPress:handleStepPress,pulseEnabled:w,labels:S,circleStyles:N,circleSlotStyle:v}),s?null:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[f.vConnectorContainer,y],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[f.vConnectorTrack,{backgroundColor:k}]}),(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[f.vConnectorFill,{backgroundColor:V,height:sliceOf(t+1)}]})]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.vBody,children:[(0,_jsxRuntime.jsx)(_index3.Text,{variant:"body",weight:"semibold",style:[f.vLabel,{color:"upcoming"===i?R.colors["text-subtle"]:R.colors["text-body"]},g],numberOfLines:1,children:e?.label??" "}),e.description?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",style:f.vDescription,numberOfLines:3,children:e.description}):null]})]},e.key)})}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.hRow,onLayout:e=>J(e.nativeEvent.layout.width),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"none",style:[f.hConnectorContainer,{left:K,right:K},y],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[f.hConnectorTrack,{backgroundColor:k}]}),(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[f.hConnectorFill,{backgroundColor:V,width:z}]})]}),i.map((e,t)=>{const i=statusOf(t);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.hStepItem,children:[(0,_jsxRuntime.jsx)(StepCircle,{index:t,step:e,status:i,toneColor:V,upcomingColor:k,upcomingFillColor:D,onPressColor:V,textOnColor:L,upcomingTextColor:E,interactive:T,canPress:canPressStatus(i),totalSteps:A,onPress:handleStepPress,pulseEnabled:w,labels:S,circleStyles:N,circleSlotStyle:v}),(0,_jsxRuntime.jsx)(_index3.Text,{variant:"caption",style:[f.hLabel,{color:"upcoming"===i?R.colors["text-subtle"]:R.colors["text-body"]},g],numberOfLines:1,children:e?.label??" "})]},e.key)})]})});return p?(0,_jsxRuntime.jsx)(StepperSkeleton,{...e}):Q});StepperRoot.displayName="Stepper";const StepperSkeleton=({steps:e,variant:t="horizontal",showCaption:i=!0,containerStyle:s,style:r,testID:n})=>{const a=(0,_index.useTheme)(),o=(0,_react.useMemo)(()=>buildStyles(a),[a]),l=(0,_react.useMemo)(()=>buildSkeletonStyles(a),[a]),c=e.length||3;return"segmented"===t?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[o.container,s,r],testID:n,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[i?(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"45%",height:14,style:{marginBottom:a.space.sm}}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:o.sRow,children:Array.from({length:c}).map((e,t)=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:o.sItem,children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:"100%",height:4,radius:"pill"})},`sk-step-${t}`))})]}):"vertical"===t?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[o.container,s,r],testID:n,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.vCol,children:Array.from({length:c}).map((e,t)=>{const i=t===c-1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:l.vRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[l.vLeft,{width:32}],children:[(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"circle",width:24,height:24}),i?null:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:2,height:36})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:l.vBody,children:[(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"55%",height:16,style:{marginBottom:a.space.xs}}),(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"80%",height:12})]})]},`sk-step-${t}`)})})}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[o.container,s,r],testID:n,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:o.hRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[o.hConnectorContainer,{left:50/c+"%",right:50/c+"%"}],children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:"100%",height:2,radius:"pill"})}),Array.from({length:c}).map((e,t)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:o.hStepItem,children:[(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"circle",width:24,height:24}),(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"80%",height:12,style:{marginTop:a.space.xs}})]},`sk-step-${t}`))]})})};StepperSkeleton.displayName="StepperSkeleton";const Stepper=exports.Stepper=Object.assign(StepperRoot,{Skeleton:StepperSkeleton}),buildSkeletonStyles=e=>_reactNative.StyleSheet.create({vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center"},vBody:{flex:1,paddingLeft:e.space.md,paddingBottom:e.space.lg}}),buildStyles=e=>_reactNative.StyleSheet.create({container:{width:"100%"},hRow:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",position:"relative"},hConnectorContainer:{position:"absolute",top:11,height:2,flexDirection:"row",alignItems:"center"},hConnectorTrack:{position:"absolute",left:0,right:0,height:2,borderRadius:e.radius.pill,..._corners.smoothCorners},hConnectorFill:{position:"absolute",left:0,height:2,borderRadius:e.radius.pill,..._corners.smoothCorners},hStepItem:{alignItems:"center",flex:1},hLabel:{marginTop:e.space.xs,textAlign:"center"},vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center",alignSelf:"stretch",width:32},vConnectorContainer:{flex:1,width:2,minHeight:32,position:"relative",alignSelf:"center"},vConnectorTrack:{position:"absolute",top:0,bottom:0,width:2,borderRadius:e.radius.pill,..._corners.smoothCorners},vConnectorFill:{position:"absolute",top:0,width:2,borderRadius:e.radius.pill,..._corners.smoothCorners},vBody:{flex:1,paddingLeft:e.space.sm,paddingBottom:e.space.md},vLabel:{marginBottom:e.space.xxs},vDescription:{},sCaption:{includeFontPadding:!1},sRow:{flexDirection:"row",columnGap:e.space.xs},sItem:{flex:1},sTrack:{height:4,borderRadius:e.radius.pill,overflow:"hidden"},sFill:{height:4,borderRadius:e.radius.pill}});var _default=exports.default=Stepper;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Stepper=exports.DEFAULT_STEPPER_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_hitSlop=require("../../utils/hitSlop.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Skeleton/index.js"),_index3=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_STEPPER_LABELS=exports.DEFAULT_STEPPER_LABELS=Object.freeze({step:(e,t,i,s)=>`Step ${e} of ${t}, ${i}, ${s}`,statusComplete:"complete",statusActive:"active",statusUpcoming:"upcoming",progressStep:(e,t)=>`Progress: step ${e} of ${t}`,progressDone:(e,t)=>`Progress: ${e} of ${t} steps done`,captionStep:(e,t,i)=>`Step ${e} of ${t}${i?` · ${i}`:""}`,captionDone:(e,t)=>`${e} of ${t} done`}),CIRCLE_SIZE=24,SEGMENT_HEIGHT=4,PULSE_SIZE=32,PULSE_DURATION=1100,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},toneOnColorFor=(e,t)=>{switch(t){case"success":return e.colors["on-success"];case"warning":return e.colors["on-warning"];case"danger":return e.colors["on-danger"];case"info":return e.colors["on-info"];case"neutral":return e.colors["on-neutral"];case"primary":return e.colors["on-primary"]}},statusWordFor=(e,t)=>{switch(t){case"complete":return e.statusComplete;case"active":return e.statusActive;case"upcoming":return e.statusUpcoming}},StepCircle=({index:e,step:t,status:i,toneColor:s,upcomingColor:r,upcomingFillColor:n,textOnColor:a,upcomingTextColor:o,interactive:l,canPress:c,totalSteps:u,onPress:d,pulseEnabled:p,labels:m,circleStyles:x,circleSlotStyle:_})=>{const h="active"===i,v=(0,_index.useTheme)(),g=(0,_react.useRef)((0,_index.createAnimatedValue)(1)).current,y=(0,_react.useRef)((0,_index.createAnimatedValue)(.5)).current;(0,_react.useEffect)(()=>{if(!h||!p)return g.setValue(1),void y.setValue(0);const e=_reactNative.Animated.loop(_reactNative.Animated.parallel([_reactNative.Animated.sequence([_reactNative.Animated.timing(g,{toValue:1.4,duration:1100,easing:_reactNative.Easing.out(_reactNative.Easing.ease),useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(g,{toValue:1,duration:0,useNativeDriver:_nativeDriver.nativeDriver})]),_reactNative.Animated.sequence([_reactNative.Animated.timing(y,{toValue:0,duration:1100,easing:_reactNative.Easing.out(_reactNative.Easing.ease),useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(y,{toValue:.5,duration:0,useNativeDriver:_nativeDriver.nativeDriver})])]));return e.start(),()=>e.stop()},[h,g,y,p]);const b="upcoming"===i?n:s,j="upcoming"===i?r:s,S="upcoming"===i?o:a,R="complete"===i,w=m.step(e+1,u,t.label,statusWordFor(m,i)),C=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:x.relative,children:[h&&p?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[x.pulse,{width:32,height:32,borderRadius:v.radius.pill,..._corners.smoothCorners,backgroundColor:s,opacity:y,transform:[{scale:g}]}]}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[x.circle,{width:24,height:24,borderRadius:v.radius.pill,..._corners.smoothCorners,backgroundColor:b,borderColor:j},_],children:t.icon?t.icon:R?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",weight:"semibold",style:[x.glyph,{color:S}],children:"✓"}):(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",weight:"semibold",style:[x.glyph,{color:S}],children:e+1})})]});return l?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>d(e),disabled:!c,accessibilityRole:"button",accessibilityLabel:w,accessibilityState:{selected:h,disabled:!c},"aria-selected":h,"aria-disabled":!c,hitSlop:8,...(0,_hitSlop.hitSlopMarker)(8),children:C}):(0,_jsxRuntime.jsx)(_reactNative.View,{accessibilityRole:"text",accessibilityLabel:w,accessibilityState:{selected:h},"aria-selected":h,children:C})},buildCircleStyles=()=>_reactNative.StyleSheet.create({relative:{alignItems:"center",justifyContent:"center"},pulse:{position:"absolute"},circle:{borderWidth:2,alignItems:"center",justifyContent:"center"},glyph:{includeFontPadding:!1}}),StepperRoot=(0,_react.forwardRef)((e,t)=>{const{steps:i,activeStep:s,defaultActiveStep:r=0,pressMode:n="none",onStepPress:a,onActiveStepChange:o,variant:l="horizontal",tone:c="primary",formatCaption:u,showCaption:d=!0,loading:p=!1,labels:m,accessibilityLabel:x,style:_,containerStyle:h,circleStyle:v,labelStyle:g,connectorStyle:y,haptic:b,testID:j}=e;(0,_assertValidValue.assertValidValue)("Stepper","variant",e.variant,["horizontal","vertical","segmented"]),(0,_assertValidValue.assertValidValue)("Stepper","tone",e.tone,["primary","success","warning","danger","info","neutral"]),(0,_assertValidValue.assertValidValue)("Stepper","pressMode",e.pressMode,["none","back","select"]);const S=(0,_react.useMemo)(()=>({...DEFAULT_STEPPER_LABELS,...m}),[m]),R=(0,_index.useTheme)(),w=R.settings.components.stepper?.pulseAnimation??!1,C=(0,_hapticUtils.resolveHaptic)(b,"selection"),f=(0,_react.useMemo)(()=>buildStyles(R),[R]),N=(0,_react.useMemo)(()=>buildCircleStyles(),[]),V=toneColorFor(R,c),k=R.colors.border,D=R.colors.bg,E=R.colors["text-muted"],L=toneOnColorFor(R,c),A=i.length,T="none"!==n,I=void 0!==s,[P,F]=(0,_react.useState)(r),$=I?s:P,B=null==$||$<0?null:$,statusOf=e=>null===B?"upcoming":e<B?"complete":e===B?"active":"upcoming",M=i.map((e,t)=>statusOf(t)),q=M.filter(e=>"upcoming"!==e).length,O=M.filter(e=>"complete"===e).length,canPressStatus=e=>"back"===n?"complete"===e:T,handleStepPress=e=>{if(!canPressStatus(statusOf(e)))return;C&&(0,_hapticUtils.triggerHaptic)(C),a?.(e);const t="select"===n&&e===B?null:e;I||F(t),o?.(t)},U=(0,_react.useRef)((0,_index.createAnimatedValue)(q)).current,H=(0,_react.useRef)(q);(0,_react.useEffect)(()=>{const e=H.current;if(e===q)return;H.current=q;const t=_reactNative.Animated.timing(U,{toValue:q,duration:R.motion.duration.default*Math.abs(q-e),easing:_reactNative.Easing.linear,useNativeDriver:!1});return t.start(),()=>t.stop()},[q,U,R.motion]);const sliceOf=e=>U.interpolate({inputRange:[e,e+1],outputRange:["0%","100%"],extrapolate:"clamp"}),z=A<=1?"0%":U.interpolate({inputRange:[1,A],outputRange:["0%","100%"],extrapolate:"clamp"}),W=null!==B&&B<A?B:null,G=x??(null!==W?S.progressStep(W+1,A):S.progressDone(O,A)),[Z,J]=(0,_react.useState)(0),K=A>0&&Z>0?Z/(2*A):0,Q=(0,_jsxRuntime.jsx)(_reactNative.View,{ref:t,style:[f.container,h,_],testID:j,accessibilityRole:"progressbar",accessibilityLabel:G,accessibilityValue:{min:0,max:A,now:q},children:"segmented"===l?(()=>{const e=null!==W?i[W]:void 0,t=d?u?u(W,A,e):null!==W?S.captionStep(W+1,A,e?.label):S.captionDone(O,A):"";return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[d?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",style:[f.sCaption,{marginBottom:R.space.sm},g],numberOfLines:1,children:t}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:f.sRow,children:i.map((e,t)=>{const i=statusOf(t),s=S.step(t+1,A,e.label,statusWordFor(S,i)),r=(0,_jsxRuntime.jsx)(_reactNative.View,{testID:j?`${j}-segment-${t}`:void 0,style:[f.sTrack,{backgroundColor:k},y],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[f.sFill,{backgroundColor:V,width:sliceOf(t)}]})});if(T){const n=canPressStatus(i);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:f.sItem,onPress:()=>handleStepPress(t),disabled:!n,accessibilityRole:"button",accessibilityLabel:s,accessibilityState:{selected:"active"===i,disabled:!n},"aria-selected":"active"===i,"aria-disabled":!n,hitSlop:{top:12,bottom:12},...(0,_hitSlop.hitSlopMarker)({top:12,bottom:12}),children:r},e.key)}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:f.sItem,accessibilityRole:"text",accessibilityLabel:s,accessibilityState:{selected:"active"===i},"aria-selected":"active"===i,children:r},e.key)})})]})})():"vertical"===l?(0,_jsxRuntime.jsx)(_reactNative.View,{style:f.vCol,children:i.map((e,t)=>{const i=statusOf(t),s=t===A-1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.vRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.vLeft,children:[(0,_jsxRuntime.jsx)(StepCircle,{index:t,step:e,status:i,toneColor:V,upcomingColor:k,upcomingFillColor:D,onPressColor:V,textOnColor:L,upcomingTextColor:E,interactive:T,canPress:canPressStatus(i),totalSteps:A,onPress:handleStepPress,pulseEnabled:w,labels:S,circleStyles:N,circleSlotStyle:v}),s?null:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[f.vConnectorContainer,y],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[f.vConnectorTrack,{backgroundColor:k}]}),(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[f.vConnectorFill,{backgroundColor:V,height:sliceOf(t+1)}]})]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.vBody,children:[(0,_jsxRuntime.jsx)(_index3.Text,{variant:"body",weight:"semibold",style:[f.vLabel,{color:"upcoming"===i?R.colors["text-subtle"]:R.colors["text-body"]},g],numberOfLines:1,children:e?.label??" "}),e.description?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",style:f.vDescription,numberOfLines:3,children:e.description}):null]})]},e.key)})}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.hRow,onLayout:e=>J(e.nativeEvent.layout.width),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"none",style:[f.hConnectorContainer,{left:K,right:K},y],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[f.hConnectorTrack,{backgroundColor:k}]}),(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[f.hConnectorFill,{backgroundColor:V,width:z}]})]}),i.map((e,t)=>{const i=statusOf(t);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:f.hStepItem,children:[(0,_jsxRuntime.jsx)(StepCircle,{index:t,step:e,status:i,toneColor:V,upcomingColor:k,upcomingFillColor:D,onPressColor:V,textOnColor:L,upcomingTextColor:E,interactive:T,canPress:canPressStatus(i),totalSteps:A,onPress:handleStepPress,pulseEnabled:w,labels:S,circleStyles:N,circleSlotStyle:v}),(0,_jsxRuntime.jsx)(_index3.Text,{variant:"caption",style:[f.hLabel,{color:"upcoming"===i?R.colors["text-subtle"]:R.colors["text-body"]},g],numberOfLines:1,children:e?.label??" "})]},e.key)})]})});return p?(0,_jsxRuntime.jsx)(StepperSkeleton,{...e}):Q});StepperRoot.displayName="Stepper";const StepperSkeleton=({steps:e,variant:t="horizontal",showCaption:i=!0,containerStyle:s,style:r,testID:n})=>{const a=(0,_index.useTheme)(),o=(0,_react.useMemo)(()=>buildStyles(a),[a]),l=(0,_react.useMemo)(()=>buildSkeletonStyles(a),[a]),c=e.length||3,u=(0,_react.useMemo)(()=>Array.from({length:c},(e,t)=>({key:`sk-step-${t}`,index:t})),[c]);return"segmented"===t?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[o.container,s,r],testID:n,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[i?(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"45%",height:14,style:{marginBottom:a.space.sm}}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:o.sRow,children:u.map(e=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:o.sItem,children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:"100%",height:4,radius:"pill"})},e.key))})]}):"vertical"===t?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[o.container,s,r],testID:n,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.vCol,children:u.map(e=>{const t=e.index===c-1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:l.vRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[l.vLeft,{width:32}],children:[(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"circle",width:24,height:24}),t?null:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:2,height:36})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:l.vBody,children:[(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"55%",height:16,style:{marginBottom:a.space.xs}}),(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"80%",height:12})]})]},e.key)})})}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[o.container,s,r],testID:n,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:o.hRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[o.hConnectorContainer,{left:50/c+"%",right:50/c+"%"}],children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:"100%",height:2,radius:"pill"})}),u.map(e=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:o.hStepItem,children:[(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"circle",width:24,height:24}),(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"80%",height:12,style:{marginTop:a.space.xs}})]},e.key))]})})};StepperSkeleton.displayName="StepperSkeleton";const Stepper=exports.Stepper=Object.assign(StepperRoot,{Skeleton:StepperSkeleton}),buildSkeletonStyles=e=>_reactNative.StyleSheet.create({vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center"},vBody:{flex:1,paddingLeft:e.space.md,paddingBottom:e.space.lg}}),buildStyles=e=>_reactNative.StyleSheet.create({container:{width:"100%"},hRow:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",position:"relative"},hConnectorContainer:{position:"absolute",top:11,height:2,flexDirection:"row",alignItems:"center"},hConnectorTrack:{position:"absolute",left:0,right:0,height:2,borderRadius:e.radius.pill,..._corners.smoothCorners},hConnectorFill:{position:"absolute",left:0,height:2,borderRadius:e.radius.pill,..._corners.smoothCorners},hStepItem:{alignItems:"center",flex:1},hLabel:{marginTop:e.space.xs,textAlign:"center"},vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center",alignSelf:"stretch",width:32},vConnectorContainer:{flex:1,width:2,minHeight:32,position:"relative",alignSelf:"center"},vConnectorTrack:{position:"absolute",top:0,bottom:0,width:2,borderRadius:e.radius.pill,..._corners.smoothCorners},vConnectorFill:{position:"absolute",top:0,width:2,borderRadius:e.radius.pill,..._corners.smoothCorners},vBody:{flex:1,paddingLeft:e.space.sm,paddingBottom:e.space.md},vLabel:{marginBottom:e.space.xxs},vDescription:{},sCaption:{includeFontPadding:!1},sRow:{flexDirection:"row",columnGap:e.space.xs},sItem:{flex:1},sTrack:{height:4,borderRadius:e.radius.pill,overflow:"hidden"},sFill:{height:4,borderRadius:e.radius.pill}});var _default=exports.default=Stepper;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TagInput=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../hooks/index.js"),_index2=require("../../theme/index.js"),_index3=require("../../utils/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_index4=require("../Chip/index.js"),_index5=require("../FieldBase/index.js"),_jsxRuntime=require("react/jsx-runtime");const TagInput=exports.TagInput=(0,_react.forwardRef)((e,t)=>{const{value:i,defaultValue:a,onChange:r,placeholder:s,label:n,helperText:l,error:u,required:o,disabled:d=!1,size:c="md",variant:x,maxTags:_,unique:p=!0,transform:m,separators:g=[","],haptic:h,onFocus:f,style:b,testID:j}=e;(0,_assertValidValue.assertValidValue)("TagInput","size",e.size,["sm","md","lg"]),(0,_assertValidValue.assertValidValue)("TagInput","variant",e.variant,["outline","filled","underline"]);const v=(0,_index2.useTheme)(),y=(0,_react.useMemo)(()=>buildStyles(v),[v]),[V,T]=(0,_index.useControllableState)({value:i,defaultValue:a??[],onChange:r}),[R,C]=(0,_react.useState)(""),[q,I]=(0,_react.useState)(!1),w=(0,_react.useRef)(null),S=(0,_react.useMemo)(()=>(0,_index3.mergeRefs)(w,t),[t]),z=(0,_react.useCallback)(()=>{d||w.current?.focus()},[d]),F="number"==typeof _&&V.length>=_,k=!0===u||(0,_index5.hasFieldText)(u),B=o&&!n&&0===V.length&&0===R.length&&Boolean(s),N=(0,_react.useCallback)(e=>{const t=m?m(e.trim()):e.trim();if(!t)return;if(F)return;if(p&&V.some(e=>e.toLowerCase()===t.toLowerCase()))return void C("");T([...V,t]),C("");const i=(0,_index3.resolveHaptic)(h,"selection");i&&(0,_index3.triggerHaptic)(i)},[F,h,T,V,m,p]),D=(0,_react.useCallback)(e=>{const t=V.filter((t,i)=>i!==e);T(t);const i=(0,_index3.resolveHaptic)(h,"selection");i&&(0,_index3.triggerHaptic)(i)},[h,T,V]),H=(0,_react.useCallback)(e=>{const t=g.find(t=>t.length>0&&e.includes(t));t?N(e.slice(0,e.indexOf(t))):C(e)},[N,g]),L=(0,_react.useCallback)(e=>{d||"Backspace"===e.nativeEvent.key&&""===R&&V.length>0&&D(V.length-1)},[d,R,D,V.length]),M=(0,_jsxRuntime.jsx)(_index5.FieldBase,{size:c,variant:x,focused:q,disabled:d,error:k,filled:V.length>0||R.length>0,onPress:z,pressFeedback:!1,style:b,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:y.wrap,children:[V.map((e,t)=>(0,_jsxRuntime.jsx)(_index4.Chip,{label:e,size:"sm",onRemove:d?void 0:()=>D(t),haptic:h},`${e}-${t}`)),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:y.inputBox,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:S,value:R,onChangeText:H,onKeyPress:L,onSubmitEditing:()=>N(R),onFocus:e=>{I(!0),f?.(e)},onBlur:()=>{I(!1),N(R)},editable:!d&&!F,placeholder:F||B?void 0:s,placeholderTextColor:v.colors["text-subtle"],blurOnSubmit:!1,returnKeyType:"done",accessibilityLabel:n??s,style:[y.input,{color:v.colors["text-body"],fontSize:v.text.base.size}],testID:j?`${j}-input`:void 0}),B?(0,_jsxRuntime.jsx)(_index5.RequiredPlaceholder,{text:s??"",color:v.colors["text-subtle"],fontSize:v.text.base.size,weightStyle:(0,_index2.fontFor)(v,"normal")}):null]})]})});return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:j,children:[n?(0,_jsxRuntime.jsx)(_index5.FieldLabel,{size:c,required:o,children:n}):null,M,(0,_jsxRuntime.jsx)(_index5.FieldMessage,{size:c,error:k,text:k?u:l})]})});TagInput.displayName="TagInput";const buildStyles=e=>_reactNative.StyleSheet.create({wrap:{flex:1,flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,paddingVertical:e.space.xs},inputBox:{flexGrow:1,minWidth:80},input:{...(0,_index2.fontFor)(e,"normal"),padding:e.space.none}});var _default=exports.default=TagInput;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TagInput=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../hooks/index.js"),_index2=require("../../theme/index.js"),_index3=require("../../utils/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_index4=require("../Chip/index.js"),_index5=require("../FieldBase/index.js"),_jsxRuntime=require("react/jsx-runtime");const TagInput=exports.TagInput=(0,_react.forwardRef)((e,t)=>{const{value:i,defaultValue:a,onChange:r,placeholder:s,label:n,helperText:l,error:u,required:o,disabled:d=!1,size:c="md",variant:x,maxTags:_,unique:p=!0,transform:m,separators:g=[","],haptic:h,onFocus:f,style:b,testID:j}=e;(0,_assertValidValue.assertValidValue)("TagInput","size",e.size,["sm","md","lg"]),(0,_assertValidValue.assertValidValue)("TagInput","variant",e.variant,["outline","filled","underline"]);const v=(0,_index2.useTheme)(),y=(0,_react.useMemo)(()=>buildStyles(v),[v]),[V,T]=(0,_index.useControllableState)({value:i,defaultValue:a??[],onChange:r}),[R,C]=(0,_react.useState)(""),[q,I]=(0,_react.useState)(!1),w=(0,_react.useRef)(null),S=(0,_react.useMemo)(()=>(0,_index3.mergeRefs)(w,t),[t]),k=(0,_react.useCallback)(()=>{d||w.current?.focus()},[d]),z="number"==typeof _&&V.length>=_,F=!0===u||(0,_index5.hasFieldText)(u),B=o&&!n&&0===V.length&&0===R.length&&Boolean(s),N=(0,_react.useCallback)(e=>{const t=m?m(e.trim()):e.trim();if(!t)return;if(z)return;if(p&&V.some(e=>e.toLowerCase()===t.toLowerCase()))return void C("");T([...V,t]),C("");const i=(0,_index3.resolveHaptic)(h,"selection");i&&(0,_index3.triggerHaptic)(i)},[z,h,T,V,m,p]),M=(0,_react.useCallback)(e=>{const t=V.filter((t,i)=>i!==e);T(t);const i=(0,_index3.resolveHaptic)(h,"selection");i&&(0,_index3.triggerHaptic)(i)},[h,T,V]),D=(0,_react.useCallback)(e=>{const t=g.find(t=>t.length>0&&e.includes(t));t?N(e.slice(0,e.indexOf(t))):C(e)},[N,g]),H=(0,_react.useCallback)(e=>{d||"Backspace"===e.nativeEvent.key&&""===R&&V.length>0&&M(V.length-1)},[d,R,M,V.length]),L=(0,_react.useMemo)(()=>V.map((e,t)=>({key:`${e}-${t}`,tag:e,index:t})),[V]),P=(0,_jsxRuntime.jsx)(_index5.FieldBase,{size:c,variant:x,focused:q,disabled:d,error:F,filled:V.length>0||R.length>0,onPress:k,pressFeedback:!1,style:b,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:y.wrap,children:[L.map(({key:e,tag:t,index:i})=>(0,_jsxRuntime.jsx)(_index4.Chip,{label:t,size:"sm",onRemove:d?void 0:()=>M(i),haptic:h},e)),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:y.inputBox,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:S,value:R,onChangeText:D,onKeyPress:H,onSubmitEditing:()=>N(R),onFocus:e=>{I(!0),f?.(e)},onBlur:()=>{I(!1),N(R)},editable:!d&&!z,placeholder:z||B?void 0:s,placeholderTextColor:v.colors["text-subtle"],blurOnSubmit:!1,returnKeyType:"done",accessibilityLabel:n??s,style:[y.input,{color:v.colors["text-body"],fontSize:v.text.base.size}],testID:j?`${j}-input`:void 0}),B?(0,_jsxRuntime.jsx)(_index5.RequiredPlaceholder,{text:s??"",color:v.colors["text-subtle"],fontSize:v.text.base.size,weightStyle:(0,_index2.fontFor)(v,"normal")}):null]})]})});return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:j,children:[n?(0,_jsxRuntime.jsx)(_index5.FieldLabel,{size:c,required:o,children:n}):null,P,(0,_jsxRuntime.jsx)(_index5.FieldMessage,{size:c,error:F,text:F?u:l})]})});TagInput.displayName="TagInput";const buildStyles=e=>_reactNative.StyleSheet.create({wrap:{flex:1,flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,paddingVertical:e.space.xs},inputBox:{flexGrow:1,minWidth:80},input:{...(0,_index2.fontFor)(e,"normal"),padding:e.space.none}});var _default=exports.default=TagInput;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TimePicker=exports.DEFAULT_TIME_PICKER_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_Button=_interopRequireDefault(require("../Button/Button.js")),_index2=require("../Modal/index.js"),_PickerTrigger=require("../PickerTrigger/PickerTrigger.js"),_index3=require("../Text/index.js"),_index4=require("../WheelPicker/index.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const DEFAULT_TIME_PICKER_LABELS=exports.DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"}),range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{open:t,value:i,onChange:r,onClose:a,format:s="12h",minuteStep:l=1,labels:n,testID:o,style:u,containerStyle:c,headerLabelStyle:m,footerButtonStyle:d,formatValue:p,haptic:_,triggerLabels:h,label:x,help:b,placeholder:g,helperText:y,error:f,required:M,disabled:S,size:j,variant:v,clearable:T,onClear:P,leftIcon:k,trailing:I,triggerStyle:H,valueStyle:V,labelStyle:L,messageStyle:D,accessibilityLabel:R}=e,C={label:x,help:b,placeholder:g,helperText:y,error:f,required:M,disabled:S,size:j,variant:v,clearable:T,onClear:P,leftIcon:k,trailing:I,triggerStyle:H,valueStyle:V,labelStyle:L,messageStyle:D,accessibilityLabel:R};(0,_assertValidValue.assertValidValue)("TimePicker","format",e.format,["12h","24h"]),(0,_assertValidValue.assertValidValue)("TimePicker","minuteStep",e.minuteStep?.toString(),["1","5","15","30"]),(0,_assertValidValue.assertValidValue)("TimePicker","size",e.size,["sm","md","lg"]),(0,_assertValidValue.assertValidValue)("TimePicker","variant",e.variant,["outline","filled","underline"]);const A=(0,_react.useMemo)(()=>({...DEFAULT_TIME_PICKER_LABELS,...n}),[n]),E=void 0!==t,[B,q]=(0,_react.useState)(!1),$=E?t:B,w=E?o:o?`${o}-modal`:void 0,N=(0,_index.useTheme)(),F=(0,_react.useMemo)(()=>buildStyles(N),[N]),O=(0,_react.useCallback)(()=>{E?a?.():q(!1)},[E,a]),U=(0,_react.useMemo)(()=>"24h"===s?range(0,23):range(1,12),[s]),z=(0,_react.useMemo)(()=>range(0,59,l),[l]),K=(0,_react.useMemo)(()=>["AM","PM"],[]),W=(0,_react.useMemo)(()=>{const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,l),{displayHour:a,period:n}=from24h(e,s);return{displayHour:a,minute:r,period:n,hour24:e}},[i,s,l]),[G,J]=(0,_react.useState)(()=>{const e=U.indexOf(W.displayHour);return e>=0?e:0}),[Q,X]=(0,_react.useState)(()=>{const e=z.indexOf(W.minute);return e>=0?e:0}),[Y,Z]=(0,_react.useState)(()=>"PM"===W.period?1:0);(0,_react.useEffect)(()=>{if(!$)return;const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,l),{displayHour:a,period:n}=from24h(e,s),o=U.indexOf(a);J(o>=0?o:0);const u=z.indexOf(r);X(u>=0?u:0),Z("PM"===n?1:0)},[$,i,s,l,U,z]);const ee=(0,_react.useCallback)((e,t)=>{"hour"===e?J(Math.max(0,U.indexOf(Number(t)))):"minute"===e?X(Math.max(0,z.indexOf(Number(t)))):Z("PM"===t?1:0)},[U,z]),te=(0,_react.useCallback)(()=>{!1!==_&&(0,_hapticUtils.triggerHaptic)("selection"),O()},[O,_]),ie=(0,_react.useCallback)(()=>{const e=U[G]??0,t=K[Y]??"AM",i=to24h(e,t,s),a=z[Q]??0;!1!==_&&(0,_hapticUtils.triggerHaptic)("notificationSuccess"),r?.({hour:i,minute:a}),O()},[U,G,K,Y,z,Q,s,r,O,_]),re=(0,_react.useMemo)(()=>{const e=U[G]??0,t=z[Q]??0;if("24h"===s)return`${pad2(e)}:${pad2(t)}`;const i=K[Y]??"AM";return`${pad2(e)}:${pad2(t)} ${i}`},[U,G,z,Q,K,Y,s]),ae=(0,_react.useMemo)(()=>U.map(e=>({value:e,label:pad2(e),accessibilityLabel:A.hourItem(e)})),[U,A]),se=(0,_react.useMemo)(()=>z.map(e=>({value:e,label:pad2(e),accessibilityLabel:A.minuteItem(e)})),[z,A]),le=(0,_react.useMemo)(()=>K.map(e=>({value:e,label:e})),[K]),ne=(0,_react.useMemo)(()=>{const e=[{key:"hour",label:A.hour,items:ae,value:U[G]??0,separator:":",testID:"time-picker-hour"},{key:"minute",label:A.minute,items:se,value:z[Q]??0,gapAfter:"12h"===s?N.space.md:void 0,testID:"time-picker-minute"}];return"12h"===s&&e.push({key:"period",label:A.period,items:le,value:K[Y]??"AM",testID:"time-picker-period"}),e},[ae,se,le,U,G,z,Q,K,Y,s,N.space.md,A]),oe=(0,_react.useCallback)(e=>{if("24h"===s)return`${pad2(e.hour)}:${pad2(e.minute)}`;const{displayHour:t,period:i}=from24h(e.hour,"12h");return`${t}:${pad2(e.minute)} ${i}`},[s]),ue=!E&&i&&Number.isFinite(i.hour)&&Number.isFinite(i.minute)?(p??oe)(i):void 0,ce=(0,_jsxRuntime.jsxs)(_index2.Modal,{open:$,onClose:O,presentation:"bottom",accessibilityLabel:A.title,haptic:_,contentStyle:[c,u],testID:w,children:[(0,_jsxRuntime.jsx)(_index3.Text,{variant:"title",align:"center",accessibilityRole:"header",style:[F.title,m],children:A.title}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:F.summaryWrap,accessibilityLiveRegion:"polite",accessibilityLabel:A.selected(re),children:(0,_jsxRuntime.jsx)(_index3.Text,{variant:"h2",weight:"bold",color:"brand",style:F.summary,children:re})}),(0,_jsxRuntime.jsx)(_index4.WheelPicker,{columns:ne,onChange:ee,haptic:_,style:F.wheels}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:F.footer,children:[(0,_jsxRuntime.jsx)(_Button.default,{label:A.cancel,haptic:!1,variant:"ghost",tone:"neutral",onPress:te,style:[F.footerBtn,d],accessibilityHint:A.cancelHint,testID:"time-picker-cancel"}),(0,_jsxRuntime.jsx)(_Button.default,{label:A.confirm,variant:"solid",tone:"primary",haptic:!1,onPress:ie,style:[F.footerBtn,d],accessibilityHint:A.confirmHint,testID:"time-picker-confirm"})]})]});return E?ce:(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_PickerTrigger.PickerTrigger,{...C,labels:h,value:ue,onPress:()=>q(!0),testID:o}),ce]})};exports.TimePicker=TimePicker;const buildStyles=e=>_reactNative.StyleSheet.create({title:{marginBottom:e.space.sm},summaryWrap:{alignItems:"center",marginBottom:e.space.md},summary:{letterSpacing:e["letter-spacing"].wide},wheels:{marginBottom:e.space.lg},footer:{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:e.space.sm},footerBtn:{paddingHorizontal:e.space.lg}});var _default=exports.default=TimePicker;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TimePicker=exports.DEFAULT_TIME_PICKER_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_Button=_interopRequireDefault(require("../Button/Button.js")),_index2=require("../Modal/index.js"),_PickerTrigger=require("../PickerTrigger/PickerTrigger.js"),_index3=require("../Text/index.js"),_index4=require("../WheelPicker/index.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const DEFAULT_TIME_PICKER_LABELS=exports.DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"}),range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{open:t,value:i,onChange:r,onClose:a,format:s="12h",minuteStep:l=1,labels:n,testID:o,style:u,containerStyle:c,headerLabelStyle:m,footerButtonStyle:d,formatValue:p,haptic:h,triggerLabels:_,label:x,help:b,placeholder:g,helperText:y,error:f,required:M,disabled:S,size:j,variant:v,clearable:T,onClear:P,leftIcon:k,trailing:I,triggerStyle:H,valueStyle:V,labelStyle:L,messageStyle:D,accessibilityLabel:R}=e,C={label:x,help:b,placeholder:g,helperText:y,error:f,required:M,disabled:S,size:j,variant:v,clearable:T,onClear:P,leftIcon:k,trailing:I,triggerStyle:H,valueStyle:V,labelStyle:L,messageStyle:D,accessibilityLabel:R};(0,_assertValidValue.assertValidValue)("TimePicker","format",e.format,["12h","24h"]),(0,_assertValidValue.assertValidValue)("TimePicker","minuteStep",e.minuteStep?.toString(),["1","5","15","30"]),(0,_assertValidValue.assertValidValue)("TimePicker","size",e.size,["sm","md","lg"]),(0,_assertValidValue.assertValidValue)("TimePicker","variant",e.variant,["outline","filled","underline"]);const A=(0,_react.useMemo)(()=>({...DEFAULT_TIME_PICKER_LABELS,...n}),[n]),E=void 0!==t,[B,q]=(0,_react.useState)(!1),$=E?t:B,w=E?o:o?`${o}-modal`:void 0,N=(0,_index.useTheme)(),F=(0,_react.useMemo)(()=>buildStyles(N),[N]),O=(0,_react.useCallback)(()=>{E?a?.():q(!1)},[E,a]),U=(0,_react.useMemo)(()=>"24h"===s?range(0,23):range(1,12),[s]),z=(0,_react.useMemo)(()=>range(0,59,l),[l]),K=(0,_react.useMemo)(()=>["AM","PM"],[]),W=(0,_react.useMemo)(()=>{const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,l),{displayHour:a,period:n}=from24h(e,s);return{displayHour:a,minute:r,period:n,hour24:e}},[i,s,l]),[G,J]=(0,_react.useState)(()=>{const e=U.indexOf(W.displayHour);return Math.max(e,0)}),[Q,X]=(0,_react.useState)(()=>{const e=z.indexOf(W.minute);return Math.max(e,0)}),[Y,Z]=(0,_react.useState)(()=>"PM"===W.period?1:0);(0,_react.useEffect)(()=>{if(!$)return;const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,l),{displayHour:a,period:n}=from24h(e,s),o=U.indexOf(a);J(Math.max(o,0));const u=z.indexOf(r);X(Math.max(u,0)),Z("PM"===n?1:0)},[$,i,s,l,U,z]);const ee=(0,_react.useCallback)((e,t)=>{"hour"===e?J(Math.max(0,U.indexOf(Number(t)))):"minute"===e?X(Math.max(0,z.indexOf(Number(t)))):Z("PM"===t?1:0)},[U,z]),te=(0,_react.useCallback)(()=>{!1!==h&&(0,_hapticUtils.triggerHaptic)("selection"),O()},[O,h]),ie=(0,_react.useCallback)(()=>{const e=U[G]??0,t=K[Y]??"AM",i=to24h(e,t,s),a=z[Q]??0;!1!==h&&(0,_hapticUtils.triggerHaptic)("notificationSuccess"),r?.({hour:i,minute:a}),O()},[U,G,K,Y,z,Q,s,r,O,h]),re=(0,_react.useMemo)(()=>{const e=U[G]??0,t=z[Q]??0;if("24h"===s)return`${pad2(e)}:${pad2(t)}`;const i=K[Y]??"AM";return`${pad2(e)}:${pad2(t)} ${i}`},[U,G,z,Q,K,Y,s]),ae=(0,_react.useMemo)(()=>U.map(e=>({value:e,label:pad2(e),accessibilityLabel:A.hourItem(e)})),[U,A]),se=(0,_react.useMemo)(()=>z.map(e=>({value:e,label:pad2(e),accessibilityLabel:A.minuteItem(e)})),[z,A]),le=(0,_react.useMemo)(()=>K.map(e=>({value:e,label:e})),[K]),ne=(0,_react.useMemo)(()=>{const e=[{key:"hour",label:A.hour,items:ae,value:U[G]??0,separator:":",testID:"time-picker-hour"},{key:"minute",label:A.minute,items:se,value:z[Q]??0,gapAfter:"12h"===s?N.space.md:void 0,testID:"time-picker-minute"}];return"12h"===s&&e.push({key:"period",label:A.period,items:le,value:K[Y]??"AM",testID:"time-picker-period"}),e},[ae,se,le,U,G,z,Q,K,Y,s,N.space.md,A]),oe=(0,_react.useCallback)(e=>{if("24h"===s)return`${pad2(e.hour)}:${pad2(e.minute)}`;const{displayHour:t,period:i}=from24h(e.hour,"12h");return`${t}:${pad2(e.minute)} ${i}`},[s]),ue=!E&&i&&Number.isFinite(i.hour)&&Number.isFinite(i.minute)?(p??oe)(i):void 0,ce=(0,_jsxRuntime.jsxs)(_index2.Modal,{open:$,onClose:O,presentation:"bottom",accessibilityLabel:A.title,haptic:h,contentStyle:[c,u],testID:w,children:[(0,_jsxRuntime.jsx)(_index3.Text,{variant:"title",align:"center",accessibilityRole:"header",style:[F.title,m],children:A.title}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:F.summaryWrap,accessibilityLiveRegion:"polite",accessibilityLabel:A.selected(re),children:(0,_jsxRuntime.jsx)(_index3.Text,{variant:"h2",weight:"bold",color:"brand",style:F.summary,children:re})}),(0,_jsxRuntime.jsx)(_index4.WheelPicker,{columns:ne,onChange:ee,haptic:h,style:F.wheels}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:F.footer,children:[(0,_jsxRuntime.jsx)(_Button.default,{label:A.cancel,haptic:!1,variant:"ghost",tone:"neutral",onPress:te,style:[F.footerBtn,d],accessibilityHint:A.cancelHint,testID:"time-picker-cancel"}),(0,_jsxRuntime.jsx)(_Button.default,{label:A.confirm,variant:"solid",tone:"primary",haptic:!1,onPress:ie,style:[F.footerBtn,d],accessibilityHint:A.confirmHint,testID:"time-picker-confirm"})]})]});return E?ce:(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_PickerTrigger.PickerTrigger,{...C,labels:_,value:ue,onPress:()=>q(!0),testID:o}),ce]})};exports.TimePicker=TimePicker;const buildStyles=e=>_reactNative.StyleSheet.create({title:{marginBottom:e.space.sm},summaryWrap:{alignItems:"center",marginBottom:e.space.md},summary:{letterSpacing:e["letter-spacing"].wide},wheels:{marginBottom:e.space.lg},footer:{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:e.space.sm},footerBtn:{paddingHorizontal:e.space.lg}});var _default=exports.default=TimePicker;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Toast=exports.DEFAULT_TOAST_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_usePresenceMotion=require("../../hooks/usePresenceMotion.js"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_hitSlop=require("../../utils/hitSlop.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_TOAST_LABELS=exports.DEFAULT_TOAST_LABELS=Object.freeze({dismiss:"Dismiss",undo:"Undo",seconds:e=>`${e} seconds`}),SWIPE_DISMISS_THRESHOLD=80,SWIPE_VELOCITY_THRESHOLD=.5,STACK_OFFSET=8,STACK_SCALE_STEP=.04,DEFAULT_AUTO_DISMISS_MS=3e3,WEB_ACTION_MIN_DURATION_MS=8e3,COUNTDOWN_BAR_HEIGHT=3,ACTION_HIT_SLOP={top:10,bottom:10,left:10,right:10},Toast=({toast:e,index:t,onClose:i,shownAt:a,runtime:r})=>{const n=(0,_index.useTheme)(),s=(0,_usePresenceMotion.usePresenceMotion)(),o=s.duration("fast");(0,_assertValidValue.assertValidValue)("Toast","tone",e.tone,["primary","success","warning","danger","info","neutral"]),(0,_assertValidValue.assertValidValue)("Toast","position",e.position,["top","bottom"]);const c=e.tone??"neutral",l=e.position??"bottom",u=r?.labels??DEFAULT_TOAST_LABELS,d=(0,_react.useMemo)(()=>[{name:"dismiss",label:u.dismiss}],[u]),m=(0,_react.useMemo)(()=>buildStyles(n),[n]),v=(0,_react.useMemo)(()=>tintFor(n,c),[n,c]),_=(0,_react.useMemo)(()=>inkFor(n,c),[n,c]),p=n.components.toast["icon-circle-size"],g=n.text[n.components.toast["icon-glyph-text"]].size,x=n.components.toast["tint-bar-width"],h=n.settings.components.toast?.defaultDurationMs??3e3,f=n.settings.components.toast?.enableSwipeDismiss??!0,b="top"===l?-120:120,D=(0,_react.useRef)((0,_index.createAnimatedValue)(s.reduced?0:b)).current,N=(0,_react.useRef)((0,_index.createAnimatedValue)(0)).current,A=(0,_react.useRef)((0,_index.createAnimatedValue)(0)).current,y=(0,_react.useRef)(!1),T="top"===l?8*t:8*-t,S=Math.max(1-.04*t,.9),w=(0,_react.useRef)((0,_index.createAnimatedValue)(T)).current;(0,_react.useEffect)(()=>{(0,_index.setNativeValue)(w,T)},[T,w]);const V=(0,_react.useMemo)(()=>_reactNative.Animated.add(D,w),[D,w]),R=void 0!==e.action,M=e.duration??h,j=M>0&&R&&"web"===_reactNative.Platform.OS?Math.max(M,8e3):M,E=j<=0||R&&!0===r?.screenReaderOn,C=!0===e.countdown&&!E,L=(0,_react.useRef)((0,_index.createAnimatedValue)(1)).current,O=(0,_react.useRef)({initialised:!1,timer:null,remaining:0,startedAt:0}),P=(0,_react.useRef)({touch:!1,pan:!1,hover:!1}),I=(0,_react.useRef)(()=>{}),k=(0,_react.useRef)({id:e.id,totalMs:j,shownAt:a,runtime:r,persistent:E,animateBar:!1});k.current={id:e.id,totalMs:j,shownAt:a,runtime:r,persistent:E,animateBar:C&&!s.reduced};const B=(0,_react.useCallback)(()=>{const e=O.current,t=k.current,i=P.current;if(!e.initialised){e.initialised=!0;const i=t.runtime?.readRemaining(t.id),a=void 0===t.shownAt?0:Date.now()-t.shownAt;e.remaining=i??(t.totalMs>0?Math.max(t.totalMs-a,0):0),t.totalMs>0&&e.remaining<t.totalMs&&(0,_index.setNativeValue)(L,e.remaining/t.totalMs)}const a=!(t.persistent||y.current||i.touch||i.pan||i.hover);a&&null===e.timer?(e.startedAt=Date.now(),e.timer=setTimeout(()=>{e.timer=null,e.remaining=0,I.current()},e.remaining),t.animateBar&&_reactNative.Animated.timing(L,{toValue:0,duration:e.remaining,easing:_reactNative.Easing.linear,useNativeDriver:_nativeDriver.nativeDriver}).start()):a||null===e.timer||(clearTimeout(e.timer),e.timer=null,e.remaining=Math.max(e.remaining-(Date.now()-e.startedAt),0),L.stopAnimation())},[L]),dismiss=()=>{if(y.current)return;y.current=!0,B();const t=[_reactNative.Animated.timing(A,{toValue:0,duration:o,easing:_reactNative.Easing.bezier(...n.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})];s.reduced||t.push(_reactNative.Animated.timing(D,{toValue:b,duration:n.motion.duration.fast,easing:_reactNative.Easing.bezier(...n.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})),_reactNative.Animated.parallel(t).start(()=>i(e.id))};I.current=dismiss,(0,_react.useEffect)(()=>{const e=s.reduced?_reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver}):_reactNative.Animated.parallel([_reactNative.Animated.spring(D,{toValue:0,damping:18,stiffness:180,mass:1,useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver})]);return e.start(),()=>e.stop()},[]),(0,_react.useEffect)(()=>{B()},[E,B]),(0,_react.useEffect)(()=>()=>{const e=O.current,t=k.current;null!==e.timer&&(clearTimeout(e.timer),e.timer=null,e.remaining=Math.max(e.remaining-(Date.now()-e.startedAt),0)),L.stopAnimation(),e.initialised&&t.totalMs>0&&!y.current&&t.runtime?.writeRemaining(t.id,e.remaining)},[L]);const F=(0,_react.useCallback)((e,t)=>{P.current[e]=t,B()},[B]),H=(0,_react.useCallback)(()=>F("touch",!0),[F]),q=(0,_react.useCallback)(e=>F("touch",(e.nativeEvent.touches?.length??0)>0),[F]),U=(0,_react.useCallback)(()=>F("hover",!0),[F]),z=(0,_react.useCallback)(()=>F("hover",!1),[F]),$=(0,_react.useMemo)(()=>_reactNative.PanResponder.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>Math.abs(t.dy)&&Math.abs(t.dx)>6,onPanResponderGrant:()=>F("pan",!0),onPanResponderMove:(e,t)=>{(0,_index.setNativeValue)(N,t.dx);const i=1-.7*Math.min(Math.abs(t.dx)/200,1);(0,_index.setNativeValue)(A,i)},onPanResponderTerminate:()=>{if(F("pan",!1),s.reduced)return(0,_index.setNativeValue)(N,0),void _reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver}).start();_reactNative.Animated.parallel([_reactNative.Animated.spring(N,{toValue:0,damping:n.motion.spring.snappy.damping,stiffness:n.motion.spring.snappy.stiffness,mass:n.motion.spring.snappy.mass,useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver})]).start()},onPanResponderRelease:(t,a)=>{if(Math.abs(a.dx)>80||Math.abs(a.vx)>.5){const t=a.dx>=0?1:-1;y.current=!0,F("pan",!1);const r=[_reactNative.Animated.timing(A,{toValue:0,duration:o,useNativeDriver:_nativeDriver.nativeDriver})];s.reduced||r.push(_reactNative.Animated.timing(N,{toValue:500*t,duration:n.motion.duration.fast,useNativeDriver:_nativeDriver.nativeDriver})),_reactNative.Animated.parallel(r).start(()=>i(e.id))}else F("pan",!1),s.reduced?((0,_index.setNativeValue)(N,0),_reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver}).start()):_reactNative.Animated.parallel([_reactNative.Animated.spring(N,{toValue:0,useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.spring(A,{toValue:1,useNativeDriver:_nativeDriver.nativeDriver})]).start()}}),[N,A,F,o,s.reduced,n.motion.duration.fast,n.motion.spring.snappy.damping,n.motion.spring.snappy.stiffness,n.motion.spring.snappy.mass,i,e.id]),G={accessibilityActions:d,onAccessibilityAction:e=>{"dismiss"===e.nativeEvent.actionName&&dismiss()}},[W,K]=(0,_react.useState)(0),X=(0,_react.useMemo)(()=>L.interpolate({inputRange:[0,1],outputRange:[-W,0]}),[L,W]),Y=e.description?`${e.message}. ${e.description}`:e.message,J=e.action&&C?`${e.action.label}, ${u.seconds(Math.ceil(j/1e3))}`:e.action?.label;return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{...f?$.panHandlers:{},...R?{}:{accessible:!0,...G},..."web"===_reactNative.Platform.OS?{onPointerEnter:U,onPointerLeave:z}:{},onTouchStart:H,onTouchEnd:q,onTouchCancel:q,accessibilityLabel:Y,testID:e.testID,style:[m.container,{backgroundColor:n.colors.surface,borderRadius:n.radius.lg,..._corners.smoothCorners,padding:n.space.md,...n.shadow.elevated,opacity:A,transform:[{translateY:V},{translateX:N},{scale:S}]},e.style],children:[x>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[m.tintBar,{width:x,backgroundColor:v}]}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:m.row,children:[(()=>{if(e.icon)return e.icon;const t=defaultGlyph(c);return t?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[m.iconCircle,{width:p,height:p,borderRadius:n.radius.pill,..._corners.smoothCorners,backgroundColor:`${v}22`},e.iconCircleStyle],children:(0,_jsxRuntime.jsx)(_index2.Text,{variant:"body",style:[m.iconGlyph,{color:_,fontSize:g}],accessible:!1,children:t})}):null})(),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:m.textBlock,children:[(0,_jsxRuntime.jsx)(_index2.Text,{variant:"body",weight:"semibold",style:[e.textStyle,e.messageStyle],numberOfLines:2,children:e.message}),e.description?(0,_jsxRuntime.jsx)(_index2.Text,{variant:"bodySmall",style:m.description,numberOfLines:3,children:e.description}):null]}),e.action?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:J,hitSlop:ACTION_HIT_SLOP,...(0,_hitSlop.hitSlopMarker)(ACTION_HIT_SLOP),...G,onPress:()=>{e.action?.onPress(),dismiss()},style:({pressed:t})=>[m.actionBtn,{backgroundColor:t?n.colors["surface-pressed"]:"transparent"},e.actionButtonStyle],children:(0,_jsxRuntime.jsx)(_index2.Text,{variant:"bodySmall",weight:"semibold",style:{color:v},numberOfLines:1,children:e.action.label})}):null]}),C?(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"none",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",onLayout:e=>K(e.nativeEvent.layout.width),testID:"toast-countdown",style:[m.countdownTrack,{backgroundColor:`${v}22`}],children:[s.reduced?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[m.countdownFill,{backgroundColor:v}]}):null,!s.reduced&&W>0?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[m.countdownFill,{backgroundColor:v,transform:[{translateX:X}]}]}):null]}):null]})};exports.Toast=Toast;const tintFor=(e,t)=>{switch(t){case"primary":return e.colors.primary;case"success":return e.colors.success;case"danger":return e.colors.danger;case"warning":return e.colors.warning;case"info":return e.colors.info;case"neutral":return e.colors["text-body"]}},inkFor=(e,t)=>{switch(t){case"primary":return e.colors["primary-text"];case"success":return e.colors["success-text"];case"danger":return e.colors["danger-text"];case"warning":return e.colors["warning-text"];case"info":return e.colors["info-text"];case"neutral":return e.colors["text-body"]}},defaultGlyph=e=>{switch(e){case"success":return"✓";case"danger":return"×";case"warning":return"!";case"info":return"i";case"primary":case"neutral":return""}},buildStyles=e=>_reactNative.StyleSheet.create({container:{overflow:"hidden",marginVertical:e.space.xs},tintBar:{position:"absolute",left:0,top:0,bottom:0},row:{flexDirection:"row",alignItems:"center",paddingLeft:e.space.sm},iconCircle:{alignItems:"center",justifyContent:"center",marginRight:e.space.md},iconGlyph:{fontWeight:"700",lineHeight:Math.round(e.text[e.components.toast["icon-glyph-text"]].size*e.leading.heading)},textBlock:{flex:1,paddingRight:e.space.sm},description:{marginTop:e.space.xxs},countdownTrack:{position:"absolute",left:0,right:0,bottom:0,height:3,overflow:"hidden"},countdownFill:{position:"absolute",left:0,right:0,top:0,bottom:0},actionBtn:{paddingHorizontal:e.space.sm,paddingVertical:e.space.xs,minHeight:e.components.toast["action-min-height"],borderRadius:e.radius.md,..._corners.smoothCorners,marginLeft:e.space.sm}});var _default=exports.default=Toast;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Toast=exports.DEFAULT_TOAST_LABELS=void 0;var _react=require("react"),_reactNative=require("react-native"),_usePresenceMotion=require("../../hooks/usePresenceMotion.js"),_index=require("../../theme/index.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_hitSlop=require("../../utils/hitSlop.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_index2=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_TOAST_LABELS=exports.DEFAULT_TOAST_LABELS=Object.freeze({dismiss:"Dismiss",undo:"Undo",seconds:e=>`${e} seconds`}),SWIPE_DISMISS_THRESHOLD=80,SWIPE_VELOCITY_THRESHOLD=.5,STACK_OFFSET=8,STACK_SCALE_STEP=.04,DEFAULT_AUTO_DISMISS_MS=3e3,WEB_ACTION_MIN_DURATION_MS=8e3,COUNTDOWN_BAR_HEIGHT=3,ACTION_HIT_SLOP={top:10,bottom:10,left:10,right:10},Toast=({toast:e,index:t,onClose:i,shownAt:a,runtime:r})=>{const n=(0,_index.useTheme)(),s=(0,_usePresenceMotion.usePresenceMotion)(),o=s.duration("fast");(0,_assertValidValue.assertValidValue)("Toast","tone",e.tone,["primary","success","warning","danger","info","neutral"]),(0,_assertValidValue.assertValidValue)("Toast","position",e.position,["top","bottom"]);const c=e.tone??"neutral",u=e.position??"bottom",l=r?.labels??DEFAULT_TOAST_LABELS,d=(0,_react.useMemo)(()=>[{name:"dismiss",label:l.dismiss}],[l]),m=(0,_react.useMemo)(()=>buildStyles(n),[n]),v=(0,_react.useMemo)(()=>tintFor(n,c),[n,c]),_=(0,_react.useMemo)(()=>inkFor(n,c),[n,c]),p=n.components.toast["icon-circle-size"],g=n.text[n.components.toast["icon-glyph-text"]].size,x=n.components.toast["tint-bar-width"],h=n.settings.components.toast?.defaultDurationMs??3e3,f=n.settings.components.toast?.enableSwipeDismiss??!0,b="top"===u?-120:120,D=(0,_react.useRef)((0,_index.createAnimatedValue)(s.reduced?0:b)).current,N=(0,_react.useRef)((0,_index.createAnimatedValue)(0)).current,A=(0,_react.useRef)((0,_index.createAnimatedValue)(0)).current,y=(0,_react.useRef)(!1),T="top"===u?8*t:8*-t,S=Math.max(1-.04*t,.9),w=(0,_react.useRef)((0,_index.createAnimatedValue)(T)).current;(0,_react.useEffect)(()=>{(0,_index.setNativeValue)(w,T)},[T,w]);const V=(0,_react.useMemo)(()=>_reactNative.Animated.add(D,w),[D,w]),M=void 0!==e.action,R=e.duration??h,j=R>0&&M&&"web"===_reactNative.Platform.OS?Math.max(R,8e3):R,E=j<=0||M&&!0===r?.screenReaderOn,C=!0===e.countdown&&!E,L=(0,_react.useRef)((0,_index.createAnimatedValue)(1)).current,O=(0,_react.useRef)({initialised:!1,timer:null,remaining:0,startedAt:0}),P=(0,_react.useRef)({touch:!1,pan:!1,hover:!1}),I=(0,_react.useRef)(()=>{}),k=(0,_react.useRef)({id:e.id,totalMs:j,shownAt:a,runtime:r,persistent:E,animateBar:!1});k.current={id:e.id,totalMs:j,shownAt:a,runtime:r,persistent:E,animateBar:C&&!s.reduced};const B=(0,_react.useCallback)(()=>{const e=O.current,t=k.current,i=P.current;if(!e.initialised){e.initialised=!0;const i=t.runtime?.readRemaining(t.id),a=void 0===t.shownAt?0:Date.now()-t.shownAt;e.remaining=i??(t.totalMs>0?Math.max(t.totalMs-a,0):0),t.totalMs>0&&e.remaining<t.totalMs&&(0,_index.setNativeValue)(L,e.remaining/t.totalMs)}const a=!(t.persistent||y.current||i.touch||i.pan||i.hover);a&&null===e.timer?(e.startedAt=Date.now(),e.timer=setTimeout(()=>{e.timer=null,e.remaining=0,I.current()},e.remaining),t.animateBar&&_reactNative.Animated.timing(L,{toValue:0,duration:e.remaining,easing:_reactNative.Easing.linear,useNativeDriver:_nativeDriver.nativeDriver}).start()):a||null===e.timer||(clearTimeout(e.timer),e.timer=null,e.remaining=Math.max(e.remaining-(Date.now()-e.startedAt),0),L.stopAnimation())},[L]),dismiss=()=>{if(y.current)return;y.current=!0,B();const t=[_reactNative.Animated.timing(A,{toValue:0,duration:o,easing:_reactNative.Easing.bezier(...n.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})];s.reduced||t.push(_reactNative.Animated.timing(D,{toValue:b,duration:n.motion.duration.fast,easing:_reactNative.Easing.bezier(...n.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})),_reactNative.Animated.parallel(t).start(()=>i(e.id))};I.current=dismiss;const F=(0,_react.useRef)({reduced:s.reduced,fadeMs:o});F.current={reduced:s.reduced,fadeMs:o},(0,_react.useEffect)(()=>{const e=F.current,t=e.reduced?_reactNative.Animated.timing(A,{toValue:1,duration:e.fadeMs,useNativeDriver:_nativeDriver.nativeDriver}):_reactNative.Animated.parallel([_reactNative.Animated.spring(D,{toValue:0,damping:18,stiffness:180,mass:1,useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(A,{toValue:1,duration:e.fadeMs,useNativeDriver:_nativeDriver.nativeDriver})]);return t.start(),()=>t.stop()},[A,D]),(0,_react.useEffect)(()=>{B()},[E,B]),(0,_react.useEffect)(()=>()=>{const e=O.current,t=k.current;null!==e.timer&&(clearTimeout(e.timer),e.timer=null,e.remaining=Math.max(e.remaining-(Date.now()-e.startedAt),0)),L.stopAnimation(),e.initialised&&t.totalMs>0&&!y.current&&t.runtime?.writeRemaining(t.id,e.remaining)},[L]);const H=(0,_react.useCallback)((e,t)=>{P.current[e]=t,B()},[B]),q=(0,_react.useCallback)(()=>H("touch",!0),[H]),U=(0,_react.useCallback)(e=>H("touch",(e.nativeEvent.touches?.length??0)>0),[H]),z=(0,_react.useCallback)(()=>H("hover",!0),[H]),$=(0,_react.useCallback)(()=>H("hover",!1),[H]),G=(0,_react.useMemo)(()=>_reactNative.PanResponder.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>Math.abs(t.dy)&&Math.abs(t.dx)>6,onPanResponderGrant:()=>H("pan",!0),onPanResponderMove:(e,t)=>{(0,_index.setNativeValue)(N,t.dx);const i=1-.7*Math.min(Math.abs(t.dx)/200,1);(0,_index.setNativeValue)(A,i)},onPanResponderTerminate:()=>{if(H("pan",!1),s.reduced)return(0,_index.setNativeValue)(N,0),void _reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver}).start();_reactNative.Animated.parallel([_reactNative.Animated.spring(N,{toValue:0,damping:n.motion.spring.snappy.damping,stiffness:n.motion.spring.snappy.stiffness,mass:n.motion.spring.snappy.mass,useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver})]).start()},onPanResponderRelease:(t,a)=>{if(Math.abs(a.dx)>80||Math.abs(a.vx)>.5){const t=a.dx>=0?1:-1;y.current=!0,H("pan",!1);const r=[_reactNative.Animated.timing(A,{toValue:0,duration:o,useNativeDriver:_nativeDriver.nativeDriver})];s.reduced||r.push(_reactNative.Animated.timing(N,{toValue:500*t,duration:n.motion.duration.fast,useNativeDriver:_nativeDriver.nativeDriver})),_reactNative.Animated.parallel(r).start(()=>i(e.id))}else H("pan",!1),s.reduced?((0,_index.setNativeValue)(N,0),_reactNative.Animated.timing(A,{toValue:1,duration:o,useNativeDriver:_nativeDriver.nativeDriver}).start()):_reactNative.Animated.parallel([_reactNative.Animated.spring(N,{toValue:0,useNativeDriver:_nativeDriver.nativeDriver}),_reactNative.Animated.spring(A,{toValue:1,useNativeDriver:_nativeDriver.nativeDriver})]).start()}}),[N,A,H,o,s.reduced,n.motion.duration.fast,n.motion.spring.snappy.damping,n.motion.spring.snappy.stiffness,n.motion.spring.snappy.mass,i,e.id]),W={accessibilityActions:d,onAccessibilityAction:e=>{"dismiss"===e.nativeEvent.actionName&&dismiss()}},[K,X]=(0,_react.useState)(0),Y=(0,_react.useMemo)(()=>L.interpolate({inputRange:[0,1],outputRange:[-K,0]}),[L,K]),J=e.description?`${e.message}. ${e.description}`:e.message,Q=e.action&&C?`${e.action.label}, ${l.seconds(Math.ceil(j/1e3))}`:e.action?.label;return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{...f?G.panHandlers:{},...M?{}:{accessible:!0,...W},..."web"===_reactNative.Platform.OS?{onPointerEnter:z,onPointerLeave:$}:{},onTouchStart:q,onTouchEnd:U,onTouchCancel:U,accessibilityLabel:J,testID:e.testID,style:[m.container,{backgroundColor:n.colors.surface,borderRadius:n.radius.lg,..._corners.smoothCorners,padding:n.space.md,...n.shadow.elevated,opacity:A,transform:[{translateY:V},{translateX:N},{scale:S}]},e.style],children:[x>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[m.tintBar,{width:x,backgroundColor:v}]}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:m.row,children:[(()=>{if(e.icon)return e.icon;const t=defaultGlyph(c);return t?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[m.iconCircle,{width:p,height:p,borderRadius:n.radius.pill,..._corners.smoothCorners,backgroundColor:`${v}22`},e.iconCircleStyle],children:(0,_jsxRuntime.jsx)(_index2.Text,{variant:"body",style:[m.iconGlyph,{color:_,fontSize:g}],accessible:!1,children:t})}):null})(),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:m.textBlock,children:[(0,_jsxRuntime.jsx)(_index2.Text,{variant:"body",weight:"semibold",style:[e.textStyle,e.messageStyle],numberOfLines:2,children:e.message}),e.description?(0,_jsxRuntime.jsx)(_index2.Text,{variant:"bodySmall",style:m.description,numberOfLines:3,children:e.description}):null]}),e.action?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:Q,hitSlop:ACTION_HIT_SLOP,...(0,_hitSlop.hitSlopMarker)(ACTION_HIT_SLOP),...W,onPress:()=>{e.action?.onPress(),dismiss()},style:({pressed:t})=>[m.actionBtn,{backgroundColor:t?n.colors["surface-pressed"]:"transparent"},e.actionButtonStyle],children:(0,_jsxRuntime.jsx)(_index2.Text,{variant:"bodySmall",weight:"semibold",style:{color:v},numberOfLines:1,children:e.action.label})}):null]}),C?(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"none",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",onLayout:e=>X(e.nativeEvent.layout.width),testID:"toast-countdown",style:[m.countdownTrack,{backgroundColor:`${v}22`}],children:[s.reduced?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[m.countdownFill,{backgroundColor:v}]}):null,!s.reduced&&K>0?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[m.countdownFill,{backgroundColor:v,transform:[{translateX:Y}]}]}):null]}):null]})};exports.Toast=Toast;const tintFor=(e,t)=>{switch(t){case"primary":return e.colors.primary;case"success":return e.colors.success;case"danger":return e.colors.danger;case"warning":return e.colors.warning;case"info":return e.colors.info;case"neutral":return e.colors["text-body"]}},inkFor=(e,t)=>{switch(t){case"primary":return e.colors["primary-text"];case"success":return e.colors["success-text"];case"danger":return e.colors["danger-text"];case"warning":return e.colors["warning-text"];case"info":return e.colors["info-text"];case"neutral":return e.colors["text-body"]}},defaultGlyph=e=>{switch(e){case"success":return"✓";case"danger":return"×";case"warning":return"!";case"info":return"i";case"primary":case"neutral":return""}},buildStyles=e=>_reactNative.StyleSheet.create({container:{overflow:"hidden",marginVertical:e.space.xs},tintBar:{position:"absolute",left:0,top:0,bottom:0},row:{flexDirection:"row",alignItems:"center",paddingLeft:e.space.sm},iconCircle:{alignItems:"center",justifyContent:"center",marginRight:e.space.md},iconGlyph:{fontWeight:"700",lineHeight:Math.round(e.text[e.components.toast["icon-glyph-text"]].size*e.leading.heading)},textBlock:{flex:1,paddingRight:e.space.sm},description:{marginTop:e.space.xxs},countdownTrack:{position:"absolute",left:0,right:0,bottom:0,height:3,overflow:"hidden"},countdownFill:{position:"absolute",left:0,right:0,top:0,bottom:0},actionBtn:{paddingHorizontal:e.space.sm,paddingVertical:e.space.xs,minHeight:e.components.toast["action-min-height"],borderRadius:e.radius.md,..._corners.smoothCorners,marginLeft:e.space.sm}});var _default=exports.default=Toast;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Tooltip=exports.DEFAULT_TOOLTIP_LABELS=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_usePresenceMotion=require("../../hooks/usePresenceMotion.js"),_index=require("../../theme/index.js"),_announce=require("../../utils/announce.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_mergeRefs=require("../../utils/mergeRefs.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_placement=require("../../utils/placement.js"),_focusHost=require("../Menu/focusHost.js"),_index2=require("../Modal/index.js"),_ModalSafeArea=require("../ModalSafeArea/ModalSafeArea.js"),_index3=require("../Text/index.js"),_RichTooltipBody=require("./RichTooltipBody.js"),_tooltipPosition=require("./tooltipPosition.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var r,a,i=Object.defineProperty,o={__proto__:null,default:e};if(Object(e)!==e)return o;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,o)}for(a in e)"default"!==a&&{}.hasOwnProperty.call(e,a)&&((r=i&&Object.getOwnPropertyDescriptor(e,a))&&(r.get||r.set)?i(o,a,r):o[a]=e[a]);return o}const DEFAULT_TOOLTIP_LABELS=exports.DEFAULT_TOOLTIP_LABELS=Object.freeze({close:"Close tooltip",longPressHint:"Long press for more info",fallbackName:"Tooltip"}),PRESS_AUTO_HIDE_MS=4e3,ARROW_HALF_WIDTH=4,ARROW_HEIGHT=6,ARROW_CORNER_PADDING=12,DEFAULT_MAX_WIDTH=240,RICH_MAX_WIDTH=280,MESSAGE_LINE_HEIGHT=18,EXIT_DURATION_MS=150,Tooltip=e=>{const{content:t,children:r,variant:a="plain",title:i,action:o,placement:s="auto",open:n,onOpenChange:c,hideOnContentPress:l=!0,maxWidth:u,showArrow:_=!0,accessibilityLabel:d,style:p,containerStyle:f,arrowStyle:m,messageStyle:h,labels:v,testID:g}=e;(0,_assertValidValue.assertValidValue)("Tooltip","variant",e.variant,["plain","rich"]),(0,_assertValidValue.assertValidValue)("Tooltip","placement",e.placement,["top","bottom","left","right","auto"]),(0,_assertValidValue.assertValidValue)("Tooltip","trigger",e.trigger,["longPress","press","manual"]);const b="rich"===a,R=e.trigger??(b?"press":"longPress"),x=(0,_react.useMemo)(()=>({...DEFAULT_TOOLTIP_LABELS,...v}),[v]),T=(0,_index.useTheme)(),y=(0,_usePresenceMotion.usePresenceMotion)(),A=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),[S,j]=(0,_ModalSafeArea.useModalInsets)(),w=(0,_react.useMemo)(()=>({...A,top:S.top,bottom:S.bottom}),[A,S]),N=(0,_reactNative.useWindowDimensions)(),P=(0,_react.useMemo)(()=>buildStyles(T),[T]),D=T.space.sm,O=T.space.sm,L=u??(b?280:240),E="press"===R&&!b,M=(T.settings.components.tooltip?.enableScaleAnimation??!1)&&!y.reduced,V="manual"===R||"boolean"==typeof n,[C,H]=(0,_react.useState)(!1),I=V?Boolean(n):C,[q,W]=(0,_react.useState)(null),[k,B]=(0,_react.useState)({width:0,height:0}),F=(0,_react.useRef)(null),U=(0,_react.useRef)(null),z=(0,_react.useRef)(null),G=(0,_react.useRef)(null),X=(0,_react.useRef)(null),Y=(0,_react.useRef)(!1),J=(0,_react.useRef)(!1),K=(0,_react.useRef)((0,_index.createAnimatedValue)(I||!M?1:.85)).current,Q=(0,_react.useRef)((0,_index.createAnimatedValue)(I?1:0)).current,Z=(0,_react.useRef)(null),$=(0,_react.useRef)(!1),[ee,te]=(0,_react.useState)(I),re=(0,_react.useCallback)(e=>{V||H(e),c?.(e)},[V,c]),ae=(0,_react.useCallback)(()=>{F.current&&F.current.measureInWindow((e,t,r,a)=>{W({x:e,y:t,width:r,height:a})})},[]),ie=(0,_react.useCallback)(e=>{ae(),re(!0)},[ae,re]),oe=(0,_react.useCallback)(()=>{re(!1)},[re]),se=(0,_react.useRef)(oe);se.current=oe;const ne=(0,_react.useCallback)(()=>{if(!Y.current)return;Y.current=!1;const e=X.current;X.current=null,e?e():b&&(0,_focusHost.focusHost)(U.current??F.current)},[b]);(0,_react.useEffect)(()=>{if(I)return J.current=!0,Y.current=!1,(0,_placement.claimAnchoredSurface)(()=>se.current());J.current&&(J.current=!1,Y.current=!0)},[I]),(0,_react.useEffect)(()=>{I&&te(!0)},[I]);const ce=(0,_react.useCallback)(()=>{X.current=o?.onPress??null,oe()},[o,oe]);(0,_react.useEffect)(()=>{if(!$.current)return $.current=!0,I&&(ae(),E&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{oe()},4e3))),()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)};let e;if(I){ae();const t=[_reactNative.Animated.timing(Q,{toValue:1,duration:y.duration("fast"),useNativeDriver:_nativeDriver.nativeDriver})];M?t.push(_reactNative.Animated.spring(K,{toValue:1,damping:T.motion.spring.snappy.damping,stiffness:T.motion.spring.snappy.stiffness,mass:T.motion.spring.snappy.mass,useNativeDriver:_nativeDriver.nativeDriver})):(0,_index.setNativeValue)(K,1),e=_reactNative.Animated.parallel(t),e.start(),E&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{oe()},4e3))}else{const t=[_reactNative.Animated.timing(Q,{toValue:0,duration:y.reduced?y.duration("fast"):150,easing:_reactNative.Easing.bezier(...T.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})];M&&t.push(_reactNative.Animated.timing(K,{toValue:.85,duration:150,easing:_reactNative.Easing.bezier(...T.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})),e=_reactNative.Animated.parallel(t),e.start(({finished:e})=>{e&&te(!1)}),Z.current&&(clearTimeout(Z.current),Z.current=null)}return()=>{e?.stop(),Z.current&&(clearTimeout(Z.current),Z.current=null)}},[I]);const handleContentLayout=e=>{const{width:t,height:r}=e.nativeEvent.layout;t===k.width&&r===k.height||B({width:t,height:r})},le=(0,_react.useMemo)(()=>(0,_tooltipPosition.resolveTooltipPosition)({anchor:q,size:k,placement:s,rich:b,viewport:{width:N.width,height:N.height,insets:w},maxWidth:L,gap:D,padding:O,arrowCornerPadding:12}),[q,k,s,b,N.width,N.height,w,L,D,O]),ue=null!==q&&k.width>0,de=I&&ue;(0,_react.useEffect)(()=>{if(!b||!de)return;const e="web"===_reactNative.Platform.OS?G:z,t=setTimeout(()=>(0,_focusHost.focusHost)(e.current),_focusHost.FOCUS_DELAY_MS);return()=>clearTimeout(t)},[b,de]),(0,_react.useEffect)(()=>{!b&&de&&"ios"===_reactNative.Platform.OS&&"string"==typeof t&&(0,_announce.announce)(t)},[b,de,t]);const pe=r.props,fe=(0,_react.useMemo)(()=>(0,_mergeRefs.mergeRefs)(pe.ref,U),[pe.ref]),me={};"longPress"!==R||pe.contextMenu?"press"===R&&(me.onPress=e=>{pe.onPress?.(e),ie(e)}):(me.onLongPress=ie,me.accessibilityHint=x.longPressHint),b&&(me.ref=fe);const he=_react.default.cloneElement(r,me),ve=d??("string"==typeof t?t:x.fallbackName),ge=(0,_react.useMemo)(()=>{if(!_)return null;const e={position:"absolute",width:0,height:0,backgroundColor:"transparent",borderStyle:"solid",borderLeftWidth:4,borderRightWidth:4,borderBottomWidth:6,borderTopWidth:0,borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:b?T.colors.surface:T.colors["surface-inverse"]};return"top"===le.placement?{...e,bottom:-6,left:le.arrowOffset-4,transform:[{rotate:"180deg"}]}:"bottom"===le.placement?{...e,top:-6,left:le.arrowOffset-4}:"left"===le.placement?{...e,right:-6,top:le.arrowOffset-4,transform:[{rotate:"90deg"}]}:{...e,left:-6,top:le.arrowOffset-4,transform:[{rotate:"-90deg"}]}},[_,le,T,b]),be={position:"absolute",top:le.top,left:le.left,maxWidth:L,opacity:I&&!ue?0:Q,transform:[{scale:K}]},Re=ge?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[ge,m],pointerEvents:"none"}):null;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{ref:F,collapsable:!1,onLayout:ae,testID:g,children:he}),(0,_jsxRuntime.jsxs)(_index2.Modal,{open:ee,onClose:oe,presentation:"fullScreen",bare:!0,backdropOpacity:0,backdropPressClose:l,haptic:!1,labels:{close:x.close},onInsetsChange:j,onDismissed:ne,children:[ee&&b?(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{onLayout:handleContentLayout,style:[be,f,p],children:[(0,_jsxRuntime.jsx)(_RichTooltipBody.RichTooltipBody,{title:i,content:t,action:o,onAction:ce,focusRef:z,actionRef:G,messageStyle:h}),Re]}):null,ee&&!b?(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{accessibilityRole:"web"===_reactNative.Platform.OS?"tooltip":void 0,accessibilityLiveRegion:"polite",accessibilityLabel:ve,onLayout:handleContentLayout,style:[be,f,p],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[P.tooltip,{backgroundColor:T.colors["surface-inverse"],borderRadius:T.radius.md,..._corners.smoothCorners,paddingHorizontal:T.space.md,paddingVertical:T.space.sm,...T.shadow.popover,shadowColor:T.shadow.popover.shadowColor}],children:"string"==typeof t?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",color:"inverse",style:{lineHeight:18,..._reactNative.StyleSheet.flatten(h)},children:t}):t}),Re]}):null]})]})};exports.Tooltip=Tooltip;const buildStyles=e=>_reactNative.StyleSheet.create({tooltip:{overflow:"hidden"}});var _default=exports.default=Tooltip;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Tooltip=exports.DEFAULT_TOOLTIP_LABELS=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_usePresenceMotion=require("../../hooks/usePresenceMotion.js"),_index=require("../../theme/index.js"),_announce=require("../../utils/announce.js"),_assertValidValue=require("../../utils/assertValidValue.js"),_corners=require("../../utils/corners.js"),_mergeRefs=require("../../utils/mergeRefs.js"),_nativeDriver=require("../../utils/nativeDriver.js"),_placement=require("../../utils/placement.js"),_focusHost=require("../Menu/focusHost.js"),_index2=require("../Modal/index.js"),_ModalSafeArea=require("../ModalSafeArea/ModalSafeArea.js"),_index3=require("../Text/index.js"),_RichTooltipBody=require("./RichTooltipBody.js"),_tooltipPosition=require("./tooltipPosition.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var r,a,i=Object.defineProperty,o={__proto__:null,default:e};if(Object(e)!==e)return o;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,o)}for(a in e)"default"!==a&&{}.hasOwnProperty.call(e,a)&&((r=i&&Object.getOwnPropertyDescriptor(e,a))&&(r.get||r.set)?i(o,a,r):o[a]=e[a]);return o}const DEFAULT_TOOLTIP_LABELS=exports.DEFAULT_TOOLTIP_LABELS=Object.freeze({close:"Close tooltip",longPressHint:"Long press for more info",fallbackName:"Tooltip"}),PRESS_AUTO_HIDE_MS=4e3,ARROW_HALF_WIDTH=4,ARROW_HEIGHT=6,ARROW_CORNER_PADDING=12,DEFAULT_MAX_WIDTH=240,RICH_MAX_WIDTH=280,MESSAGE_LINE_HEIGHT=18,EXIT_DURATION_MS=150,Tooltip=e=>{const{content:t,children:r,variant:a="plain",title:i,action:o,placement:s="auto",open:n,onOpenChange:c,hideOnContentPress:l=!0,maxWidth:u,showArrow:d=!0,accessibilityLabel:_,style:p,containerStyle:f,arrowStyle:m,messageStyle:h,labels:v,testID:g}=e;(0,_assertValidValue.assertValidValue)("Tooltip","variant",e.variant,["plain","rich"]),(0,_assertValidValue.assertValidValue)("Tooltip","placement",e.placement,["top","bottom","left","right","auto"]),(0,_assertValidValue.assertValidValue)("Tooltip","trigger",e.trigger,["longPress","press","manual"]);const b="rich"===a,R=e.trigger??(b?"press":"longPress"),x=(0,_react.useMemo)(()=>({...DEFAULT_TOOLTIP_LABELS,...v}),[v]),T=(0,_index.useTheme)(),y=(0,_usePresenceMotion.usePresenceMotion)(),A=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),[S,j]=(0,_ModalSafeArea.useModalInsets)(),w=(0,_react.useMemo)(()=>({...A,top:S.top,bottom:S.bottom}),[A,S]),N=(0,_reactNative.useWindowDimensions)(),P=(0,_react.useMemo)(()=>buildStyles(T),[T]),D=T.space.sm,O=T.space.sm,L=u??(b?280:240),E="press"===R&&!b,M=(T.settings.components.tooltip?.enableScaleAnimation??!1)&&!y.reduced,V="manual"===R||"boolean"==typeof n,[H,C]=(0,_react.useState)(!1),I=V?Boolean(n):H,[q,W]=(0,_react.useState)(null),[k,B]=(0,_react.useState)({width:0,height:0}),F=(0,_react.useRef)(null),U=(0,_react.useRef)(null),z=(0,_react.useRef)(null),G=(0,_react.useRef)(null),X=(0,_react.useRef)(null),Y=(0,_react.useRef)(!1),J=(0,_react.useRef)(!1),K=(0,_react.useRef)((0,_index.createAnimatedValue)(I||!M?1:.85)).current,Q=(0,_react.useRef)((0,_index.createAnimatedValue)(I?1:0)).current,Z=(0,_react.useRef)(null),$=(0,_react.useRef)(!1),[ee,te]=(0,_react.useState)(I),re=(0,_react.useCallback)(e=>{V||C(e),c?.(e)},[V,c]),ae=(0,_react.useCallback)(()=>{F.current&&F.current.measureInWindow((e,t,r,a)=>{W({x:e,y:t,width:r,height:a})})},[]),ie=(0,_react.useCallback)(e=>{ae(),re(!0)},[ae,re]),oe=(0,_react.useCallback)(()=>{re(!1)},[re]),se=(0,_react.useRef)(oe);se.current=oe;const ne=(0,_react.useCallback)(()=>{if(!Y.current)return;Y.current=!1;const e=X.current;X.current=null,e?e():b&&(0,_focusHost.focusHost)(U.current??F.current)},[b]);(0,_react.useEffect)(()=>{if(I)return J.current=!0,Y.current=!1,(0,_placement.claimAnchoredSurface)(()=>se.current());J.current&&(J.current=!1,Y.current=!0)},[I]),(0,_react.useEffect)(()=>{I&&te(!0)},[I]);const ce=(0,_react.useCallback)(()=>{X.current=o?.onPress??null,oe()},[o,oe]),le=(0,_react.useRef)({autoHide:E,scaleAnimates:M,presence:y,theme:T,handleHide:oe});le.current={autoHide:E,scaleAnimates:M,presence:y,theme:T,handleHide:oe},(0,_react.useEffect)(()=>{const{autoHide:e,scaleAnimates:t,presence:r,theme:a,handleHide:i}=le.current;if(!$.current)return $.current=!0,I&&(ae(),e&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{i()},4e3))),()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)};let o;if(I){ae();const s=[_reactNative.Animated.timing(Q,{toValue:1,duration:r.duration("fast"),useNativeDriver:_nativeDriver.nativeDriver})];t?s.push(_reactNative.Animated.spring(K,{toValue:1,damping:a.motion.spring.snappy.damping,stiffness:a.motion.spring.snappy.stiffness,mass:a.motion.spring.snappy.mass,useNativeDriver:_nativeDriver.nativeDriver})):(0,_index.setNativeValue)(K,1),o=_reactNative.Animated.parallel(s),o.start(),e&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{i()},4e3))}else{const e=[_reactNative.Animated.timing(Q,{toValue:0,duration:r.reduced?r.duration("fast"):150,easing:_reactNative.Easing.bezier(...a.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})];t&&e.push(_reactNative.Animated.timing(K,{toValue:.85,duration:150,easing:_reactNative.Easing.bezier(...a.motion.ease.accelerate),useNativeDriver:_nativeDriver.nativeDriver})),o=_reactNative.Animated.parallel(e),o.start(({finished:e})=>{e&&te(!1)}),Z.current&&(clearTimeout(Z.current),Z.current=null)}return()=>{o?.stop(),Z.current&&(clearTimeout(Z.current),Z.current=null)}},[I,ae,Q,K]);const handleContentLayout=e=>{const{width:t,height:r}=e.nativeEvent.layout;t===k.width&&r===k.height||B({width:t,height:r})},ue=(0,_react.useMemo)(()=>(0,_tooltipPosition.resolveTooltipPosition)({anchor:q,size:k,placement:s,rich:b,viewport:{width:N.width,height:N.height,insets:w},maxWidth:L,gap:D,padding:O,arrowCornerPadding:12}),[q,k,s,b,N.width,N.height,w,L,D,O]),de=null!==q&&k.width>0,pe=I&&de;(0,_react.useEffect)(()=>{if(!b||!pe)return;const e="web"===_reactNative.Platform.OS?G:z,t=setTimeout(()=>(0,_focusHost.focusHost)(e.current),_focusHost.FOCUS_DELAY_MS);return()=>clearTimeout(t)},[b,pe]),(0,_react.useEffect)(()=>{!b&&pe&&"ios"===_reactNative.Platform.OS&&"string"==typeof t&&(0,_announce.announce)(t)},[b,pe,t]);const fe=r.props,me=(0,_react.useMemo)(()=>(0,_mergeRefs.mergeRefs)(fe.ref,U),[fe.ref]),he={};"longPress"!==R||fe.contextMenu?"press"===R&&(he.onPress=e=>{fe.onPress?.(e),ie(e)}):(he.onLongPress=ie,he.accessibilityHint=x.longPressHint),b&&(he.ref=me);const ve=_react.default.cloneElement(r,he),ge=_??("string"==typeof t?t:x.fallbackName),be=(0,_react.useMemo)(()=>{if(!d)return null;const e={position:"absolute",width:0,height:0,backgroundColor:"transparent",borderStyle:"solid",borderLeftWidth:4,borderRightWidth:4,borderBottomWidth:6,borderTopWidth:0,borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:b?T.colors.surface:T.colors["surface-inverse"]};return"top"===ue.placement?{...e,bottom:-6,left:ue.arrowOffset-4,transform:[{rotate:"180deg"}]}:"bottom"===ue.placement?{...e,top:-6,left:ue.arrowOffset-4}:"left"===ue.placement?{...e,right:-6,top:ue.arrowOffset-4,transform:[{rotate:"90deg"}]}:{...e,left:-6,top:ue.arrowOffset-4,transform:[{rotate:"-90deg"}]}},[d,ue,T,b]),Re={position:"absolute",top:ue.top,left:ue.left,maxWidth:L,opacity:I&&!de?0:Q,transform:[{scale:K}]},xe=be?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[be,m],pointerEvents:"none"}):null;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{ref:F,collapsable:!1,onLayout:ae,testID:g,children:ve}),(0,_jsxRuntime.jsxs)(_index2.Modal,{open:ee,onClose:oe,presentation:"fullScreen",bare:!0,backdropOpacity:0,backdropPressClose:l,haptic:!1,labels:{close:x.close},onInsetsChange:j,onDismissed:ne,children:[ee&&b?(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{onLayout:handleContentLayout,style:[Re,f,p],children:[(0,_jsxRuntime.jsx)(_RichTooltipBody.RichTooltipBody,{title:i,content:t,action:o,onAction:ce,focusRef:z,actionRef:G,messageStyle:h}),xe]}):null,ee&&!b?(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{accessibilityRole:"web"===_reactNative.Platform.OS?"tooltip":void 0,accessibilityLiveRegion:"polite",accessibilityLabel:ge,onLayout:handleContentLayout,style:[Re,f,p],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[P.tooltip,{backgroundColor:T.colors["surface-inverse"],borderRadius:T.radius.md,..._corners.smoothCorners,paddingHorizontal:T.space.md,paddingVertical:T.space.sm,...T.shadow.popover,shadowColor:T.shadow.popover.shadowColor}],children:"string"==typeof t?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",color:"inverse",style:{lineHeight:18,..._reactNative.StyleSheet.flatten(h)},children:t}):t}),xe]}):null]})]})};exports.Tooltip=Tooltip;const buildStyles=e=>_reactNative.StyleSheet.create({tooltip:{overflow:"hidden"}});var _default=exports.default=Tooltip;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useControllableState=useControllableState;var _react=require("react");function useControllableState({value:e,defaultValue:t,onChange:a}){const r=(0,_react.useRef)(void 0!==e).current,[l,u]=(0,_react.useState)(t);return[r&&void 0!==e?e:l,(0,_react.useCallback)(e=>{r||u(e),a?.(e)},[r,a])]}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useControllableState=useControllableState;var _react=require("react");function useControllableState(e){const{defaultValue:t,onChange:l}=e,a=(0,_react.useRef)(e.controlled??void 0!==e.value).current,[r,o]=(0,_react.useState)(t);let u=r;a&&(void 0!==e.controlled||void 0!==e.value)&&(u=e.value);return[u,(0,_react.useCallback)(e=>{a||o(e),l?.(e)},[a,l])]}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"CURATED_ICON_NAMES",{enumerable:!0,get:function(){return _index.CURATED_ICON_NAMES}}),Object.defineProperty(exports,"ICON_NAMES",{enumerable:!0,get:function(){return _index.ICON_NAMES}}),Object.defineProperty(exports,"defaultIcons",{enumerable:!0,get:function(){return _index.defaultIcons}}),Object.defineProperty(exports,"textOf",{enumerable:!0,get:function(){return _index2.textOf}});var _index=require("./components/AppIcon/index.js"),_index2=require("./theme/index.js");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"CURATED_ICON_NAMES",{enumerable:!0,get:function(){return _index.CURATED_ICON_NAMES}}),Object.defineProperty(exports,"ICONSAX_SUFFIX",{enumerable:!0,get:function(){return _index.ICONSAX_SUFFIX}}),Object.defineProperty(exports,"ICON_NAMES",{enumerable:!0,get:function(){return _index.ICON_NAMES}}),Object.defineProperty(exports,"defaultIcons",{enumerable:!0,get:function(){return _index.defaultIcons}}),Object.defineProperty(exports,"isAppIconName",{enumerable:!0,get:function(){return _index.isAppIconName}}),Object.defineProperty(exports,"textOf",{enumerable:!0,get:function(){return _index2.textOf}});var _index=require("./components/AppIcon/index.js"),_index2=require("./theme/index.js");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ALL_CALLING_CODES",{enumerable:!0,get:function(){return _index2.ALL_CALLING_CODES}}),Object.defineProperty(exports,"Accordion",{enumerable:!0,get:function(){return _index2.Accordion}}),Object.defineProperty(exports,"AccordionGroup",{enumerable:!0,get:function(){return _index2.AccordionGroup}}),Object.defineProperty(exports,"AmountSlider",{enumerable:!0,get:function(){return _index2.AmountSlider}}),Object.defineProperty(exports,"AnimatePresence",{enumerable:!0,get:function(){return _index2.AnimatePresence}}),Object.defineProperty(exports,"AppBar",{enumerable:!0,get:function(){return _index2.AppBar}}),Object.defineProperty(exports,"AppIcon",{enumerable:!0,get:function(){return _index3.AppIcon}}),Object.defineProperty(exports,"AppLockOverlay",{enumerable:!0,get:function(){return _index2.AppLockOverlay}}),Object.defineProperty(exports,"AsyncBlock",{enumerable:!0,get:function(){return _index2.AsyncBlock}}),Object.defineProperty(exports,"AuthedImage",{enumerable:!0,get:function(){return _index2.AuthedImage}}),Object.defineProperty(exports,"Autocomplete",{enumerable:!0,get:function(){return _index2.Autocomplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return _index2.Avatar}}),Object.defineProperty(exports,"AvatarGroup",{enumerable:!0,get:function(){return _index2.AvatarGroup}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return _index2.Badge}}),Object.defineProperty(exports,"Banner",{enumerable:!0,get:function(){return _index2.Banner}}),Object.defineProperty(exports,"BarChart",{enumerable:!0,get:function(){return _index2.BarChart}}),Object.defineProperty(exports,"BottomNavigation",{enumerable:!0,get:function(){return _index2.BottomNavigation}}),Object.defineProperty(exports,"BottomSheet",{enumerable:!0,get:function(){return _index2.BottomSheet}}),Object.defineProperty(exports,"Box",{enumerable:!0,get:function(){return _index2.Box}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return _index2.Button}}),Object.defineProperty(exports,"Calendar",{enumerable:!0,get:function(){return _index2.Calendar}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return _index2.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return _index2.Carousel}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return _index2.Checkbox}}),Object.defineProperty(exports,"Chip",{enumerable:!0,get:function(){return _index2.Chip}}),Object.defineProperty(exports,"ChoiceGroup",{enumerable:!0,get:function(){return _index2.ChoiceGroup}}),Object.defineProperty(exports,"Composer",{enumerable:!0,get:function(){return _index2.Composer}}),Object.defineProperty(exports,"Confetti",{enumerable:!0,get:function(){return _index2.Confetti}}),Object.defineProperty(exports,"ConfirmHost",{enumerable:!0,get:function(){return _index2.ConfirmHost}}),Object.defineProperty(exports,"DEFAULT_CALLING_CODES",{enumerable:!0,get:function(){return _index2.DEFAULT_CALLING_CODES}}),Object.defineProperty(exports,"DatePicker",{enumerable:!0,get:function(){return _index2.DatePicker}}),Object.defineProperty(exports,"DateRangePicker",{enumerable:!0,get:function(){return _index2.DateRangePicker}}),Object.defineProperty(exports,"DateSeparator",{enumerable:!0,get:function(){return _index2.DateSeparator}}),Object.defineProperty(exports,"DecimalInput",{enumerable:!0,get:function(){return _index2.DecimalInput}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return _index2.Descriptions}}),Object.defineProperty(exports,"Dialog",{enumerable:!0,get:function(){return _index2.Dialog}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return _index2.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return _index2.Drawer}}),Object.defineProperty(exports,"EmptyState",{enumerable:!0,get:function(){return _index2.EmptyState}}),Object.defineProperty(exports,"ErrorBoundary",{enumerable:!0,get:function(){return _index2.ErrorBoundary}}),Object.defineProperty(exports,"FilePicker",{enumerable:!0,get:function(){return _index2.FilePicker}}),Object.defineProperty(exports,"FileViewer",{enumerable:!0,get:function(){return _index2.FileViewer}}),Object.defineProperty(exports,"FilterChipRow",{enumerable:!0,get:function(){return _index2.FilterChipRow}}),Object.defineProperty(exports,"FloatingActionButton",{enumerable:!0,get:function(){return _index2.FloatingActionButton}}),Object.defineProperty(exports,"FloatingActionButtonGroup",{enumerable:!0,get:function(){return _index2.FloatingActionButtonGroup}}),Object.defineProperty(exports,"ForceUpdateDialog",{enumerable:!0,get:function(){return _index2.ForceUpdateDialog}}),Object.defineProperty(exports,"FormField",{enumerable:!0,get:function(){return _index2.FormField}}),Object.defineProperty(exports,"HookFormField",{enumerable:!0,get:function(){return _index4.HookFormField}}),Object.defineProperty(exports,"IconBadge",{enumerable:!0,get:function(){return _index2.IconBadge}}),Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return _index2.IconButton}}),Object.defineProperty(exports,"ImageGallery",{enumerable:!0,get:function(){return _index2.ImageGallery}}),Object.defineProperty(exports,"InlineSelect",{enumerable:!0,get:function(){return _index2.InlineSelect}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return _index2.Input}}),Object.defineProperty(exports,"KeyboardAwareScrollView",{enumerable:!0,get:function(){return _index2.KeyboardAwareScrollView}}),Object.defineProperty(exports,"KeyboardToolbar",{enumerable:!0,get:function(){return _index2.KeyboardToolbar}}),Object.defineProperty(exports,"KitThemeBridge",{enumerable:!0,get:function(){return _index7.KitThemeBridge}}),Object.defineProperty(exports,"ListItem",{enumerable:!0,get:function(){return _index2.ListItem}}),Object.defineProperty(exports,"ListSection",{enumerable:!0,get:function(){return _index2.ListSection}}),Object.defineProperty(exports,"LoaderOverlay",{enumerable:!0,get:function(){return _index2.LoaderOverlay}}),Object.defineProperty(exports,"MODAL_DISMISS_GRACE_MS",{enumerable:!0,get:function(){return _index2.MODAL_DISMISS_GRACE_MS}}),Object.defineProperty(exports,"Markdown",{enumerable:!0,get:function(){return _index2.Markdown}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return _index2.Menu}}),Object.defineProperty(exports,"MessageBubble",{enumerable:!0,get:function(){return _index2.MessageBubble}}),Object.defineProperty(exports,"MessageList",{enumerable:!0,get:function(){return _index2.MessageList}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return _index2.Modal}}),Object.defineProperty(exports,"NetworkStatusBanner",{enumerable:!0,get:function(){return _index6.NetworkStatusBanner}}),Object.defineProperty(exports,"NonModalBottomSheet",{enumerable:!0,get:function(){return _index2.NonModalBottomSheet}}),Object.defineProperty(exports,"NumberInput",{enumerable:!0,get:function(){return _index2.NumberInput}}),Object.defineProperty(exports,"OTPInput",{enumerable:!0,get:function(){return _index2.OTPInput}}),Object.defineProperty(exports,"OTPResendRow",{enumerable:!0,get:function(){return _index2.OTPResendRow}}),Object.defineProperty(exports,"OnboardingPager",{enumerable:!0,get:function(){return _index2.OnboardingPager}}),Object.defineProperty(exports,"OptionSheet",{enumerable:!0,get:function(){return _index2.OptionSheet}}),Object.defineProperty(exports,"PHONE_CHROME_INSETS",{enumerable:!0,get:function(){return _index.PHONE_CHROME_INSETS}}),Object.defineProperty(exports,"PagedListFooter",{enumerable:!0,get:function(){return _index2.PagedListFooter}}),Object.defineProperty(exports,"PermissionPrompt",{enumerable:!0,get:function(){return _index2.PermissionPrompt}}),Object.defineProperty(exports,"PhoneNumberInput",{enumerable:!0,get:function(){return _index2.PhoneNumberInput}}),Object.defineProperty(exports,"PickerTrigger",{enumerable:!0,get:function(){return _index2.PickerTrigger}}),Object.defineProperty(exports,"ProfileCompletion",{enumerable:!0,get:function(){return _index2.ProfileCompletion}}),Object.defineProperty(exports,"ProfilePicker",{enumerable:!0,get:function(){return _index2.ProfilePicker}}),Object.defineProperty(exports,"ProgressBar",{enumerable:!0,get:function(){return _index2.ProgressBar}}),Object.defineProperty(exports,"ProgressRing",{enumerable:!0,get:function(){return _index2.ProgressRing}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return _index2.Radio}}),Object.defineProperty(exports,"RadioDot",{enumerable:!0,get:function(){return _index2.RadioDot}}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:function(){return _index2.RadioGroup}}),Object.defineProperty(exports,"Rating",{enumerable:!0,get:function(){return _index2.Rating}}),Object.defineProperty(exports,"Repeater",{enumerable:!0,get:function(){return _index2.Repeater}}),Object.defineProperty(exports,"RichTextEditor",{enumerable:!0,get:function(){return _index2.RichTextEditor}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return _index2.Row}}),Object.defineProperty(exports,"ScannerOverlay",{enumerable:!0,get:function(){return _index2.ScannerOverlay}}),Object.defineProperty(exports,"Screen",{enumerable:!0,get:function(){return _index2.Screen}}),Object.defineProperty(exports,"SearchBar",{enumerable:!0,get:function(){return _index2.SearchBar}}),Object.defineProperty(exports,"SectionHeader",{enumerable:!0,get:function(){return _index2.SectionHeader}}),Object.defineProperty(exports,"SegmentedControl",{enumerable:!0,get:function(){return _index2.SegmentedControl}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return _index2.Select}}),Object.defineProperty(exports,"SignaturePad",{enumerable:!0,get:function(){return _index2.SignaturePad}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return _index2.Skeleton}}),Object.defineProperty(exports,"SkeletonCircle",{enumerable:!0,get:function(){return _index2.SkeletonCircle}}),Object.defineProperty(exports,"SkeletonClockProvider",{enumerable:!0,get:function(){return _index2.SkeletonClockProvider}}),Object.defineProperty(exports,"SkeletonContent",{enumerable:!0,get:function(){return _index2.SkeletonContent}}),Object.defineProperty(exports,"SkeletonList",{enumerable:!0,get:function(){return _index2.SkeletonList}}),Object.defineProperty(exports,"SkeletonProvider",{enumerable:!0,get:function(){return _index2.SkeletonProvider}}),Object.defineProperty(exports,"SkeletonSkip",{enumerable:!0,get:function(){return _index2.SkeletonSkip}}),Object.defineProperty(exports,"SkeletonText",{enumerable:!0,get:function(){return _index2.SkeletonText}}),Object.defineProperty(exports,"SlideToConfirm",{enumerable:!0,get:function(){return _index2.SlideToConfirm}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return _index2.Slider}}),Object.defineProperty(exports,"SliderField",{enumerable:!0,get:function(){return _index2.SliderField}}),Object.defineProperty(exports,"SortableList",{enumerable:!0,get:function(){return _index2.SortableList}}),Object.defineProperty(exports,"Spacer",{enumerable:!0,get:function(){return _index2.Spacer}}),Object.defineProperty(exports,"Sparkline",{enumerable:!0,get:function(){return _index2.Sparkline}}),Object.defineProperty(exports,"Spinner",{enumerable:!0,get:function(){return _index2.Spinner}}),Object.defineProperty(exports,"SquircleImage",{enumerable:!0,get:function(){return _index2.SquircleImage}}),Object.defineProperty(exports,"SquircleView",{enumerable:!0,get:function(){return _index2.SquircleView}}),Object.defineProperty(exports,"Stack",{enumerable:!0,get:function(){return _index2.Stack}}),Object.defineProperty(exports,"StatTile",{enumerable:!0,get:function(){return _index2.StatTile}}),Object.defineProperty(exports,"StatusBadge",{enumerable:!0,get:function(){return _index2.StatusBadge}}),Object.defineProperty(exports,"Stepper",{enumerable:!0,get:function(){return _index2.Stepper}}),Object.defineProperty(exports,"Swipeable",{enumerable:!0,get:function(){return _index2.Swipeable}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return _index2.Switch}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return _index2.Tabs}}),Object.defineProperty(exports,"TagInput",{enumerable:!0,get:function(){return _index2.TagInput}}),Object.defineProperty(exports,"Text",{enumerable:!0,get:function(){return _index2.Text}}),Object.defineProperty(exports,"TextInkContext",{enumerable:!0,get:function(){return _index2.TextInkContext}}),Object.defineProperty(exports,"ThemeProvider",{enumerable:!0,get:function(){return _index7.ThemeProvider}}),Object.defineProperty(exports,"TimePicker",{enumerable:!0,get:function(){return _index2.TimePicker}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return _index2.Timeline}}),Object.defineProperty(exports,"Toast",{enumerable:!0,get:function(){return _index2.Toast}}),Object.defineProperty(exports,"ToastHost",{enumerable:!0,get:function(){return _index2.ToastHost}}),Object.defineProperty(exports,"ToastProvider",{enumerable:!0,get:function(){return _index2.ToastProvider}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return _index2.Tooltip}}),Object.defineProperty(exports,"Tour",{enumerable:!0,get:function(){return _index2.Tour}}),Object.defineProperty(exports,"TypingIndicator",{enumerable:!0,get:function(){return _index2.TypingIndicator}}),Object.defineProperty(exports,"WheelPicker",{enumerable:!0,get:function(){return _index2.WheelPicker}}),Object.defineProperty(exports,"ZoomableImage",{enumerable:!0,get:function(){return _index2.ZoomableImage}}),Object.defineProperty(exports,"announce",{enumerable:!0,get:function(){return _index8.announce}}),Object.defineProperty(exports,"authedImageCacheStats",{enumerable:!0,get:function(){return _index2.authedImageCacheStats}}),Object.defineProperty(exports,"buttonLabelInk",{enumerable:!0,get:function(){return _index2.buttonLabelInk}}),Object.defineProperty(exports,"clearAuthedImageCache",{enumerable:!0,get:function(){return _index2.clearAuthedImageCache}}),Object.defineProperty(exports,"configureFeedback",{enumerable:!0,get:function(){return _index8.configureFeedback}}),Object.defineProperty(exports,"confirm",{enumerable:!0,get:function(){return _index2.confirm}}),Object.defineProperty(exports,"defineStatusMap",{enumerable:!0,get:function(){return _index2.defineStatusMap}}),Object.defineProperty(exports,"fontFor",{enumerable:!0,get:function(){return _index7.fontFor}}),Object.defineProperty(exports,"formatE164",{enumerable:!0,get:function(){return _index2.formatE164}}),Object.defineProperty(exports,"formatFileSize",{enumerable:!0,get:function(){return _index2.formatFileSize}}),Object.defineProperty(exports,"getAuthedImageCacheLimit",{enumerable:!0,get:function(){return _index2.getAuthedImageCacheLimit}}),Object.defineProperty(exports,"isFeedbackEnabled",{enumerable:!0,get:function(){return _index8.isFeedbackEnabled}}),Object.defineProperty(exports,"lightTheme",{enumerable:!0,get:function(){return _index7.lightTheme}}),Object.defineProperty(exports,"loader",{enumerable:!0,get:function(){return _index2.loader}}),Object.defineProperty(exports,"makeStyles",{enumerable:!0,get:function(){return _index7.makeStyles}}),Object.defineProperty(exports,"radiusOf",{enumerable:!0,get:function(){return _index7.radiusOf}}),Object.defineProperty(exports,"setAuthedImageCacheLimit",{enumerable:!0,get:function(){return _index2.setAuthedImageCacheLimit}}),Object.defineProperty(exports,"setHapticImplementation",{enumerable:!0,get:function(){return _index8.setHapticImplementation}}),Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return _index2.toast}}),Object.defineProperty(exports,"triggerHaptic",{enumerable:!0,get:function(){return _index8.triggerHaptic}}),Object.defineProperty(exports,"useBottomSheet",{enumerable:!0,get:function(){return _index2.useBottomSheet}}),Object.defineProperty(exports,"useDebounce",{enumerable:!0,get:function(){return _index5.useDebounce}}),Object.defineProperty(exports,"useErrorHandler",{enumerable:!0,get:function(){return _index2.useErrorHandler}}),Object.defineProperty(exports,"useFieldChain",{enumerable:!0,get:function(){return _index5.useFieldChain}}),Object.defineProperty(exports,"useHookFormField",{enumerable:!0,get:function(){return _index4.useHookFormField}}),Object.defineProperty(exports,"useRecentSearches",{enumerable:!0,get:function(){return _index2.useRecentSearches}}),Object.defineProperty(exports,"useReducedMotion",{enumerable:!0,get:function(){return _index5.useReducedMotion}}),Object.defineProperty(exports,"useRefreshControl",{enumerable:!0,get:function(){return _index5.useRefreshControl}}),Object.defineProperty(exports,"useScrollDirection",{enumerable:!0,get:function(){return _index5.useScrollDirection}}),Object.defineProperty(exports,"useTextInk",{enumerable:!0,get:function(){return _index2.useTextInk}}),Object.defineProperty(exports,"useTheme",{enumerable:!0,get:function(){return _index7.useTheme}}),Object.defineProperty(exports,"useThemeMode",{enumerable:!0,get:function(){return _index7.useThemeMode}}),Object.defineProperty(exports,"useToast",{enumerable:!0,get:function(){return _index2.useToast}}),Object.defineProperty(exports,"withErrorBoundary",{enumerable:!0,get:function(){return _index2.withErrorBoundary}});var _index=require("./canvasKit/index.js"),_index2=require("./components/index.js"),_index3=require("./components/AppIcon/index.js"),_index4=require("./form/index.js"),_index5=require("./hooks/index.js"),_index6=require("./network/index.js"),_index7=require("./theme/index.js"),_index8=require("./utils/index.js");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ALL_CALLING_CODES",{enumerable:!0,get:function(){return _index2.ALL_CALLING_CODES}}),Object.defineProperty(exports,"Accordion",{enumerable:!0,get:function(){return _index2.Accordion}}),Object.defineProperty(exports,"AccordionGroup",{enumerable:!0,get:function(){return _index2.AccordionGroup}}),Object.defineProperty(exports,"AmountSlider",{enumerable:!0,get:function(){return _index2.AmountSlider}}),Object.defineProperty(exports,"AnimatePresence",{enumerable:!0,get:function(){return _index2.AnimatePresence}}),Object.defineProperty(exports,"AppBar",{enumerable:!0,get:function(){return _index2.AppBar}}),Object.defineProperty(exports,"AppIcon",{enumerable:!0,get:function(){return _index3.AppIcon}}),Object.defineProperty(exports,"AppLockOverlay",{enumerable:!0,get:function(){return _index2.AppLockOverlay}}),Object.defineProperty(exports,"AsyncBlock",{enumerable:!0,get:function(){return _index2.AsyncBlock}}),Object.defineProperty(exports,"AuthedImage",{enumerable:!0,get:function(){return _index2.AuthedImage}}),Object.defineProperty(exports,"Autocomplete",{enumerable:!0,get:function(){return _index2.Autocomplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return _index2.Avatar}}),Object.defineProperty(exports,"AvatarGroup",{enumerable:!0,get:function(){return _index2.AvatarGroup}}),Object.defineProperty(exports,"BUTTON_TONES",{enumerable:!0,get:function(){return _index4.BUTTON_TONES}}),Object.defineProperty(exports,"BUTTON_VARIANTS",{enumerable:!0,get:function(){return _index4.BUTTON_VARIANTS}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return _index2.Badge}}),Object.defineProperty(exports,"Banner",{enumerable:!0,get:function(){return _index2.Banner}}),Object.defineProperty(exports,"BarChart",{enumerable:!0,get:function(){return _index2.BarChart}}),Object.defineProperty(exports,"BottomNavigation",{enumerable:!0,get:function(){return _index2.BottomNavigation}}),Object.defineProperty(exports,"BottomSheet",{enumerable:!0,get:function(){return _index2.BottomSheet}}),Object.defineProperty(exports,"Box",{enumerable:!0,get:function(){return _index2.Box}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return _index2.Button}}),Object.defineProperty(exports,"Calendar",{enumerable:!0,get:function(){return _index2.Calendar}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return _index2.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return _index2.Carousel}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return _index2.Checkbox}}),Object.defineProperty(exports,"Chip",{enumerable:!0,get:function(){return _index2.Chip}}),Object.defineProperty(exports,"ChoiceGroup",{enumerable:!0,get:function(){return _index2.ChoiceGroup}}),Object.defineProperty(exports,"Composer",{enumerable:!0,get:function(){return _index2.Composer}}),Object.defineProperty(exports,"Confetti",{enumerable:!0,get:function(){return _index2.Confetti}}),Object.defineProperty(exports,"ConfirmHost",{enumerable:!0,get:function(){return _index2.ConfirmHost}}),Object.defineProperty(exports,"DEFAULT_CALLING_CODES",{enumerable:!0,get:function(){return _index2.DEFAULT_CALLING_CODES}}),Object.defineProperty(exports,"DatePicker",{enumerable:!0,get:function(){return _index2.DatePicker}}),Object.defineProperty(exports,"DateRangePicker",{enumerable:!0,get:function(){return _index2.DateRangePicker}}),Object.defineProperty(exports,"DateSeparator",{enumerable:!0,get:function(){return _index2.DateSeparator}}),Object.defineProperty(exports,"DecimalInput",{enumerable:!0,get:function(){return _index2.DecimalInput}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return _index2.Descriptions}}),Object.defineProperty(exports,"Dialog",{enumerable:!0,get:function(){return _index2.Dialog}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return _index2.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return _index2.Drawer}}),Object.defineProperty(exports,"EmptyState",{enumerable:!0,get:function(){return _index2.EmptyState}}),Object.defineProperty(exports,"ErrorBoundary",{enumerable:!0,get:function(){return _index2.ErrorBoundary}}),Object.defineProperty(exports,"FilePicker",{enumerable:!0,get:function(){return _index2.FilePicker}}),Object.defineProperty(exports,"FileViewer",{enumerable:!0,get:function(){return _index2.FileViewer}}),Object.defineProperty(exports,"FilterChipRow",{enumerable:!0,get:function(){return _index2.FilterChipRow}}),Object.defineProperty(exports,"FloatingActionButton",{enumerable:!0,get:function(){return _index2.FloatingActionButton}}),Object.defineProperty(exports,"FloatingActionButtonGroup",{enumerable:!0,get:function(){return _index2.FloatingActionButtonGroup}}),Object.defineProperty(exports,"ForceUpdateDialog",{enumerable:!0,get:function(){return _index2.ForceUpdateDialog}}),Object.defineProperty(exports,"FormField",{enumerable:!0,get:function(){return _index2.FormField}}),Object.defineProperty(exports,"HookFormField",{enumerable:!0,get:function(){return _index5.HookFormField}}),Object.defineProperty(exports,"ICONSAX_SUFFIX",{enumerable:!0,get:function(){return _index3.ICONSAX_SUFFIX}}),Object.defineProperty(exports,"IconBadge",{enumerable:!0,get:function(){return _index2.IconBadge}}),Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return _index2.IconButton}}),Object.defineProperty(exports,"ImageGallery",{enumerable:!0,get:function(){return _index2.ImageGallery}}),Object.defineProperty(exports,"InlineSelect",{enumerable:!0,get:function(){return _index2.InlineSelect}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return _index2.Input}}),Object.defineProperty(exports,"KeyboardAwareScrollView",{enumerable:!0,get:function(){return _index2.KeyboardAwareScrollView}}),Object.defineProperty(exports,"KeyboardToolbar",{enumerable:!0,get:function(){return _index2.KeyboardToolbar}}),Object.defineProperty(exports,"KitThemeBridge",{enumerable:!0,get:function(){return _index8.KitThemeBridge}}),Object.defineProperty(exports,"ListItem",{enumerable:!0,get:function(){return _index2.ListItem}}),Object.defineProperty(exports,"ListSection",{enumerable:!0,get:function(){return _index2.ListSection}}),Object.defineProperty(exports,"LoaderOverlay",{enumerable:!0,get:function(){return _index2.LoaderOverlay}}),Object.defineProperty(exports,"MODAL_DISMISS_GRACE_MS",{enumerable:!0,get:function(){return _index2.MODAL_DISMISS_GRACE_MS}}),Object.defineProperty(exports,"Markdown",{enumerable:!0,get:function(){return _index2.Markdown}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return _index2.Menu}}),Object.defineProperty(exports,"MessageBubble",{enumerable:!0,get:function(){return _index2.MessageBubble}}),Object.defineProperty(exports,"MessageList",{enumerable:!0,get:function(){return _index2.MessageList}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return _index2.Modal}}),Object.defineProperty(exports,"NetworkStatusBanner",{enumerable:!0,get:function(){return _index7.NetworkStatusBanner}}),Object.defineProperty(exports,"NonModalBottomSheet",{enumerable:!0,get:function(){return _index2.NonModalBottomSheet}}),Object.defineProperty(exports,"NumberInput",{enumerable:!0,get:function(){return _index2.NumberInput}}),Object.defineProperty(exports,"OTPInput",{enumerable:!0,get:function(){return _index2.OTPInput}}),Object.defineProperty(exports,"OTPResendRow",{enumerable:!0,get:function(){return _index2.OTPResendRow}}),Object.defineProperty(exports,"OnboardingPager",{enumerable:!0,get:function(){return _index2.OnboardingPager}}),Object.defineProperty(exports,"OptionSheet",{enumerable:!0,get:function(){return _index2.OptionSheet}}),Object.defineProperty(exports,"PHONE_CHROME_INSETS",{enumerable:!0,get:function(){return _index.PHONE_CHROME_INSETS}}),Object.defineProperty(exports,"PagedListFooter",{enumerable:!0,get:function(){return _index2.PagedListFooter}}),Object.defineProperty(exports,"PermissionPrompt",{enumerable:!0,get:function(){return _index2.PermissionPrompt}}),Object.defineProperty(exports,"PhoneNumberInput",{enumerable:!0,get:function(){return _index2.PhoneNumberInput}}),Object.defineProperty(exports,"PickerTrigger",{enumerable:!0,get:function(){return _index2.PickerTrigger}}),Object.defineProperty(exports,"ProfileCompletion",{enumerable:!0,get:function(){return _index2.ProfileCompletion}}),Object.defineProperty(exports,"ProfilePicker",{enumerable:!0,get:function(){return _index2.ProfilePicker}}),Object.defineProperty(exports,"ProgressBar",{enumerable:!0,get:function(){return _index2.ProgressBar}}),Object.defineProperty(exports,"ProgressRing",{enumerable:!0,get:function(){return _index2.ProgressRing}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return _index2.Radio}}),Object.defineProperty(exports,"RadioDot",{enumerable:!0,get:function(){return _index2.RadioDot}}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:function(){return _index2.RadioGroup}}),Object.defineProperty(exports,"Rating",{enumerable:!0,get:function(){return _index2.Rating}}),Object.defineProperty(exports,"Repeater",{enumerable:!0,get:function(){return _index2.Repeater}}),Object.defineProperty(exports,"RichTextEditor",{enumerable:!0,get:function(){return _index2.RichTextEditor}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return _index2.Row}}),Object.defineProperty(exports,"ScannerOverlay",{enumerable:!0,get:function(){return _index2.ScannerOverlay}}),Object.defineProperty(exports,"Screen",{enumerable:!0,get:function(){return _index2.Screen}}),Object.defineProperty(exports,"SearchBar",{enumerable:!0,get:function(){return _index2.SearchBar}}),Object.defineProperty(exports,"SectionHeader",{enumerable:!0,get:function(){return _index2.SectionHeader}}),Object.defineProperty(exports,"SegmentedControl",{enumerable:!0,get:function(){return _index2.SegmentedControl}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return _index2.Select}}),Object.defineProperty(exports,"SignaturePad",{enumerable:!0,get:function(){return _index2.SignaturePad}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return _index2.Skeleton}}),Object.defineProperty(exports,"SkeletonCircle",{enumerable:!0,get:function(){return _index2.SkeletonCircle}}),Object.defineProperty(exports,"SkeletonClockProvider",{enumerable:!0,get:function(){return _index2.SkeletonClockProvider}}),Object.defineProperty(exports,"SkeletonContent",{enumerable:!0,get:function(){return _index2.SkeletonContent}}),Object.defineProperty(exports,"SkeletonList",{enumerable:!0,get:function(){return _index2.SkeletonList}}),Object.defineProperty(exports,"SkeletonProvider",{enumerable:!0,get:function(){return _index2.SkeletonProvider}}),Object.defineProperty(exports,"SkeletonSkip",{enumerable:!0,get:function(){return _index2.SkeletonSkip}}),Object.defineProperty(exports,"SkeletonText",{enumerable:!0,get:function(){return _index2.SkeletonText}}),Object.defineProperty(exports,"SlideToConfirm",{enumerable:!0,get:function(){return _index2.SlideToConfirm}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return _index2.Slider}}),Object.defineProperty(exports,"SliderField",{enumerable:!0,get:function(){return _index2.SliderField}}),Object.defineProperty(exports,"SortableList",{enumerable:!0,get:function(){return _index2.SortableList}}),Object.defineProperty(exports,"Spacer",{enumerable:!0,get:function(){return _index2.Spacer}}),Object.defineProperty(exports,"Sparkline",{enumerable:!0,get:function(){return _index2.Sparkline}}),Object.defineProperty(exports,"Spinner",{enumerable:!0,get:function(){return _index2.Spinner}}),Object.defineProperty(exports,"SquircleImage",{enumerable:!0,get:function(){return _index2.SquircleImage}}),Object.defineProperty(exports,"SquircleView",{enumerable:!0,get:function(){return _index2.SquircleView}}),Object.defineProperty(exports,"Stack",{enumerable:!0,get:function(){return _index2.Stack}}),Object.defineProperty(exports,"StatTile",{enumerable:!0,get:function(){return _index2.StatTile}}),Object.defineProperty(exports,"StatusBadge",{enumerable:!0,get:function(){return _index2.StatusBadge}}),Object.defineProperty(exports,"Stepper",{enumerable:!0,get:function(){return _index2.Stepper}}),Object.defineProperty(exports,"Swipeable",{enumerable:!0,get:function(){return _index2.Swipeable}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return _index2.Switch}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return _index2.Tabs}}),Object.defineProperty(exports,"TagInput",{enumerable:!0,get:function(){return _index2.TagInput}}),Object.defineProperty(exports,"Text",{enumerable:!0,get:function(){return _index2.Text}}),Object.defineProperty(exports,"TextInkContext",{enumerable:!0,get:function(){return _index2.TextInkContext}}),Object.defineProperty(exports,"ThemeProvider",{enumerable:!0,get:function(){return _index8.ThemeProvider}}),Object.defineProperty(exports,"TimePicker",{enumerable:!0,get:function(){return _index2.TimePicker}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return _index2.Timeline}}),Object.defineProperty(exports,"Toast",{enumerable:!0,get:function(){return _index2.Toast}}),Object.defineProperty(exports,"ToastHost",{enumerable:!0,get:function(){return _index2.ToastHost}}),Object.defineProperty(exports,"ToastProvider",{enumerable:!0,get:function(){return _index2.ToastProvider}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return _index2.Tooltip}}),Object.defineProperty(exports,"Tour",{enumerable:!0,get:function(){return _index2.Tour}}),Object.defineProperty(exports,"TypingIndicator",{enumerable:!0,get:function(){return _index2.TypingIndicator}}),Object.defineProperty(exports,"WheelPicker",{enumerable:!0,get:function(){return _index2.WheelPicker}}),Object.defineProperty(exports,"ZoomableImage",{enumerable:!0,get:function(){return _index2.ZoomableImage}}),Object.defineProperty(exports,"announce",{enumerable:!0,get:function(){return _index9.announce}}),Object.defineProperty(exports,"authedImageCacheStats",{enumerable:!0,get:function(){return _index2.authedImageCacheStats}}),Object.defineProperty(exports,"buttonLabelInk",{enumerable:!0,get:function(){return _index2.buttonLabelInk}}),Object.defineProperty(exports,"clearAuthedImageCache",{enumerable:!0,get:function(){return _index2.clearAuthedImageCache}}),Object.defineProperty(exports,"configureFeedback",{enumerable:!0,get:function(){return _index9.configureFeedback}}),Object.defineProperty(exports,"confirm",{enumerable:!0,get:function(){return _index2.confirm}}),Object.defineProperty(exports,"defineStatusMap",{enumerable:!0,get:function(){return _index2.defineStatusMap}}),Object.defineProperty(exports,"fontFor",{enumerable:!0,get:function(){return _index8.fontFor}}),Object.defineProperty(exports,"formatE164",{enumerable:!0,get:function(){return _index2.formatE164}}),Object.defineProperty(exports,"formatFileSize",{enumerable:!0,get:function(){return _index2.formatFileSize}}),Object.defineProperty(exports,"getAuthedImageCacheLimit",{enumerable:!0,get:function(){return _index2.getAuthedImageCacheLimit}}),Object.defineProperty(exports,"isAppIconName",{enumerable:!0,get:function(){return _index3.isAppIconName}}),Object.defineProperty(exports,"isButtonTone",{enumerable:!0,get:function(){return _index4.isButtonTone}}),Object.defineProperty(exports,"isButtonVariant",{enumerable:!0,get:function(){return _index4.isButtonVariant}}),Object.defineProperty(exports,"isFeedbackEnabled",{enumerable:!0,get:function(){return _index9.isFeedbackEnabled}}),Object.defineProperty(exports,"lightTheme",{enumerable:!0,get:function(){return _index8.lightTheme}}),Object.defineProperty(exports,"loader",{enumerable:!0,get:function(){return _index2.loader}}),Object.defineProperty(exports,"makeStyles",{enumerable:!0,get:function(){return _index8.makeStyles}}),Object.defineProperty(exports,"radiusOf",{enumerable:!0,get:function(){return _index8.radiusOf}}),Object.defineProperty(exports,"setAuthedImageCacheLimit",{enumerable:!0,get:function(){return _index2.setAuthedImageCacheLimit}}),Object.defineProperty(exports,"setHapticImplementation",{enumerable:!0,get:function(){return _index9.setHapticImplementation}}),Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return _index2.toast}}),Object.defineProperty(exports,"triggerHaptic",{enumerable:!0,get:function(){return _index9.triggerHaptic}}),Object.defineProperty(exports,"useBottomSheet",{enumerable:!0,get:function(){return _index2.useBottomSheet}}),Object.defineProperty(exports,"useDebounce",{enumerable:!0,get:function(){return _index6.useDebounce}}),Object.defineProperty(exports,"useErrorHandler",{enumerable:!0,get:function(){return _index2.useErrorHandler}}),Object.defineProperty(exports,"useFieldChain",{enumerable:!0,get:function(){return _index6.useFieldChain}}),Object.defineProperty(exports,"useHookFormField",{enumerable:!0,get:function(){return _index5.useHookFormField}}),Object.defineProperty(exports,"useRecentSearches",{enumerable:!0,get:function(){return _index2.useRecentSearches}}),Object.defineProperty(exports,"useReducedMotion",{enumerable:!0,get:function(){return _index6.useReducedMotion}}),Object.defineProperty(exports,"useRefreshControl",{enumerable:!0,get:function(){return _index6.useRefreshControl}}),Object.defineProperty(exports,"useScrollDirection",{enumerable:!0,get:function(){return _index6.useScrollDirection}}),Object.defineProperty(exports,"useTextInk",{enumerable:!0,get:function(){return _index2.useTextInk}}),Object.defineProperty(exports,"useTheme",{enumerable:!0,get:function(){return _index8.useTheme}}),Object.defineProperty(exports,"useThemeMode",{enumerable:!0,get:function(){return _index8.useThemeMode}}),Object.defineProperty(exports,"useToast",{enumerable:!0,get:function(){return _index2.useToast}}),Object.defineProperty(exports,"withErrorBoundary",{enumerable:!0,get:function(){return _index2.withErrorBoundary}});var _index=require("./canvasKit/index.js"),_index2=require("./components/index.js"),_index3=require("./components/AppIcon/index.js"),_index4=require("./components/Button/index.js"),_index5=require("./form/index.js"),_index6=require("./hooks/index.js"),_index7=require("./network/index.js"),_index8=require("./theme/index.js"),_index9=require("./utils/index.js");