@webority/mobile-ui 0.146.1 → 0.147.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 (126) hide show
  1. package/dist/canvas-kit/kit.js +4344 -4214
  2. package/dist/canvas-kit/manifest.json +1 -1
  3. package/dist/canvas-kit/release.json +5 -5
  4. package/lib/commonjs/components/AuthedImage/authedImageCache.js +1 -1
  5. package/lib/commonjs/components/Avatar/Avatar.js +1 -1
  6. package/lib/commonjs/components/Badge/Badge.js +1 -1
  7. package/lib/commonjs/components/Banner/Banner.js +1 -1
  8. package/lib/commonjs/components/BarChart/BarChart.js +1 -1
  9. package/lib/commonjs/components/BottomNavigation/BottomNavigation.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/Calendar/Calendar.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/Confetti/Confetti.js +1 -1
  16. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
  17. package/lib/commonjs/components/Drawer/Drawer.js +1 -1
  18. package/lib/commonjs/components/FieldBase/Chevron.js +1 -1
  19. package/lib/commonjs/components/FilePicker/FilePicker.js +1 -1
  20. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
  21. package/lib/commonjs/components/FormField/FormField.js +1 -1
  22. package/lib/commonjs/components/Input/Input.js +1 -1
  23. package/lib/commonjs/components/LoaderOverlay/LoaderOverlay.js +1 -1
  24. package/lib/commonjs/components/Menu/MenuSurface.js +1 -1
  25. package/lib/commonjs/components/MessageList/MessageList.js +1 -1
  26. package/lib/commonjs/components/Modal/Modal.js +1 -1
  27. package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
  28. package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
  29. package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
  30. package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
  31. package/lib/commonjs/components/Radio/RadioDot.js +1 -1
  32. package/lib/commonjs/components/Rating/Rating.js +1 -1
  33. package/lib/commonjs/components/RichTextEditor/markdownActions.js +1 -1
  34. package/lib/commonjs/components/ScannerOverlay/ScannerOverlay.js +1 -1
  35. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +1 -1
  36. package/lib/commonjs/components/SignaturePad/SignaturePad.js +1 -1
  37. package/lib/commonjs/components/SignaturePad/signatureGeometry.js +1 -1
  38. package/lib/commonjs/components/Skeleton/SkeletonClock.js +1 -1
  39. package/lib/commonjs/components/Skeleton/SkeletonContent.js +1 -1
  40. package/lib/commonjs/components/Slider/valueText.js +1 -1
  41. package/lib/commonjs/components/Sparkline/Sparkline.js +1 -1
  42. package/lib/commonjs/components/Sparkline/geometry.js +1 -1
  43. package/lib/commonjs/components/Spinner/Spinner.js +1 -1
  44. package/lib/commonjs/components/Stepper/Stepper.js +1 -1
  45. package/lib/commonjs/components/Switch/Switch.js +1 -1
  46. package/lib/commonjs/components/Tabs/Tabs.js +1 -1
  47. package/lib/commonjs/components/TagInput/TagInput.js +1 -1
  48. package/lib/commonjs/components/Text/Text.js +1 -1
  49. package/lib/commonjs/components/Toast/Toast.js +1 -1
  50. package/lib/commonjs/components/Toast/ToastProvider.js +1 -1
  51. package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
  52. package/lib/commonjs/components/Tour/Tour.js +1 -1
  53. package/lib/commonjs/form/path.js +1 -1
  54. package/lib/commonjs/hooks/useDragToDismiss.js +1 -1
  55. package/lib/commonjs/hooks/usePressAnimation.js +1 -1
  56. package/lib/commonjs/network/NetworkStatusBanner.js +1 -1
  57. package/lib/commonjs/theme/animatedValue.js +1 -1
  58. package/lib/commonjs/theme/componentSizes.js +1 -1
  59. package/lib/commonjs/theme/merge.js +1 -1
  60. package/lib/commonjs/theme/toneInk.js +1 -1
  61. package/lib/commonjs/utils/color.js +1 -1
  62. package/lib/commonjs/utils/nativeDriver.js +1 -0
  63. package/lib/module/components/AuthedImage/authedImageCache.js +1 -1
  64. package/lib/module/components/Avatar/Avatar.js +1 -1
  65. package/lib/module/components/Badge/Badge.js +1 -1
  66. package/lib/module/components/Banner/Banner.js +1 -1
  67. package/lib/module/components/BarChart/BarChart.js +1 -1
  68. package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
  69. package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
  70. package/lib/module/components/Button/Button.js +1 -1
  71. package/lib/module/components/Calendar/Calendar.js +1 -1
  72. package/lib/module/components/Carousel/Carousel.js +1 -1
  73. package/lib/module/components/Checkbox/Checkbox.js +1 -1
  74. package/lib/module/components/Confetti/Confetti.js +1 -1
  75. package/lib/module/components/DatePicker/DatePicker.js +1 -1
  76. package/lib/module/components/Drawer/Drawer.js +1 -1
  77. package/lib/module/components/FieldBase/Chevron.js +1 -1
  78. package/lib/module/components/FilePicker/FilePicker.js +1 -1
  79. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
  80. package/lib/module/components/FormField/FormField.js +1 -1
  81. package/lib/module/components/Input/Input.js +1 -1
  82. package/lib/module/components/LoaderOverlay/LoaderOverlay.js +1 -1
  83. package/lib/module/components/Menu/MenuSurface.js +1 -1
  84. package/lib/module/components/MessageList/MessageList.js +1 -1
  85. package/lib/module/components/Modal/Modal.js +1 -1
  86. package/lib/module/components/OTPInput/OTPInput.js +1 -1
  87. package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
  88. package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
  89. package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
  90. package/lib/module/components/Radio/RadioDot.js +1 -1
  91. package/lib/module/components/Rating/Rating.js +1 -1
  92. package/lib/module/components/RichTextEditor/markdownActions.js +1 -1
  93. package/lib/module/components/ScannerOverlay/ScannerOverlay.js +1 -1
  94. package/lib/module/components/SegmentedControl/SegmentedControl.js +1 -1
  95. package/lib/module/components/SignaturePad/SignaturePad.js +1 -1
  96. package/lib/module/components/SignaturePad/signatureGeometry.js +1 -1
  97. package/lib/module/components/Skeleton/SkeletonClock.js +1 -1
  98. package/lib/module/components/Skeleton/SkeletonContent.js +1 -1
  99. package/lib/module/components/Slider/valueText.js +1 -1
  100. package/lib/module/components/Sparkline/Sparkline.js +1 -1
  101. package/lib/module/components/Sparkline/geometry.js +1 -1
  102. package/lib/module/components/Spinner/Spinner.js +1 -1
  103. package/lib/module/components/Stepper/Stepper.js +1 -1
  104. package/lib/module/components/Switch/Switch.js +1 -1
  105. package/lib/module/components/Tabs/Tabs.js +1 -1
  106. package/lib/module/components/TagInput/TagInput.js +1 -1
  107. package/lib/module/components/Text/Text.js +1 -1
  108. package/lib/module/components/Toast/Toast.js +1 -1
  109. package/lib/module/components/Toast/ToastProvider.js +1 -1
  110. package/lib/module/components/Tooltip/Tooltip.js +1 -1
  111. package/lib/module/components/Tour/Tour.js +1 -1
  112. package/lib/module/form/path.js +1 -1
  113. package/lib/module/hooks/useDragToDismiss.js +1 -1
  114. package/lib/module/hooks/usePressAnimation.js +1 -1
  115. package/lib/module/network/NetworkStatusBanner.js +1 -1
  116. package/lib/module/theme/animatedValue.js +1 -1
  117. package/lib/module/theme/componentSizes.js +1 -1
  118. package/lib/module/theme/merge.js +1 -1
  119. package/lib/module/theme/toneInk.js +1 -1
  120. package/lib/module/utils/color.js +1 -1
  121. package/lib/module/utils/nativeDriver.js +1 -0
  122. package/lib/typescript/commonjs/theme/animatedValue.d.ts +1 -1
  123. package/lib/typescript/commonjs/utils/nativeDriver.d.ts +2 -0
  124. package/lib/typescript/module/theme/animatedValue.d.ts +1 -1
  125. package/lib/typescript/module/utils/nativeDriver.d.ts +2 -0
  126. package/package.json +7 -7
@@ -1 +1 @@
1
- "use strict";const tokenize=t=>{const e=[],r=/[^.[\]]+/g;for(const n of t.matchAll(r)){const t=n[0];e.push(/^\d+$/.test(t)?Number(t):t)}return e};export const getPath=(t,e)=>{const r=tokenize(e);let n=t;for(const t of r){if(null==n||"object"!=typeof n)return;n=n[t]}return n};export const setPath=(t,e,r)=>{const n=tokenize(e);if(0===n.length)return t;const o=Array.isArray(t)?[...t]:{...t};let s=o;for(let t=0;t<n.length-1;t++){const e=n[t],r=n[t+1],o=s[e],c=null!=o&&"object"==typeof o?Array.isArray(o)?[...o]:{...o}:"number"==typeof r?[]:{};s[e]=c,s=c}return s[n[n.length-1]]=r,o};export const deletePath=(t,e)=>{const r=tokenize(e);if(0===r.length)return t;const n=Array.isArray(t)?[...t]:{...t};let o=n;for(let t=0;t<r.length-1;t++){const e=r[t],s=o[e];if(null==s||"object"!=typeof s)return n;const c=Array.isArray(s)?[...s]:{...s};o[e]=c,o=c}const s=r[r.length-1];return Array.isArray(o)&&"number"==typeof s?o.splice(s,1):delete o[s],n};
1
+ "use strict";const tokenize=t=>{const r=[],o=/[^.[\]]+/g;for(const e of t.matchAll(o)){const t=e[0];r.push(/^\d+$/.test(t)?Number(t):t)}return r};export const getPath=(t,r)=>{const o=tokenize(r);let e=t;for(const t of o){if(null==e||"object"!=typeof e)return;e=e[t]}return e};export const setPath=(t,r,o)=>{const e=tokenize(r),n=e.pop();if(void 0===n)return t;const s=Array.isArray(t)?[...t]:{...t};let c=s,i=e.shift();for(const t of[...e,n]){if(void 0===i)break;const r=c[i],o=null!=r&&"object"==typeof r?Array.isArray(r)?[...r]:{...r}:"number"==typeof t?[]:{};c[i]=o,c=o,i=t}return c[n]=o,s};export const deletePath=(t,r)=>{const o=tokenize(r),e=o.pop();if(void 0===e)return t;const n=Array.isArray(t)?[...t]:{...t};let s=n;for(const t of o){const r=s[t];if(null==r||"object"!=typeof r)return n;const o=Array.isArray(r)?[...r]:{...r};s[t]=o,s=o}return Array.isArray(s)&&"number"==typeof e?s.splice(e,1):delete s[e],n};
@@ -1 +1 @@
1
- "use strict";import{useMemo,useRef}from"react";import{Animated,Easing}from"react-native";import{Gesture}from"react-native-gesture-handler";import{createAnimatedValue,setNativeValue,useTheme}from"../theme/index.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const DRAG_DISMISS_DISTANCE=100;export const DRAG_DISMISS_VELOCITY=.5;export const createDragToDismissController=({drag:e,travel:t,onDismiss:a,opacity:s},n,r)=>{const{snappy:i}=n.spring,springBack=()=>Animated.spring(e,{toValue:0,damping:i.damping,stiffness:i.stiffness,mass:i.mass,useNativeDriver:!0}).start(),o=!0===r?.reduced?s:void 0,u=r?.duration("default")??n.duration.default;return{move:t=>{setNativeValue(e,Math.max(0,t))},release:(s,r)=>{if(s>100||r>.5){if(o)return void Animated.timing(o,{toValue:0,duration:u,easing:Easing.bezier(...n.ease.accelerate),useNativeDriver:!0}).start(()=>a());Animated.timing(e,{toValue:"function"==typeof t?t():t,duration:n.duration.fast,easing:Easing.bezier(...n.ease.accelerate),useNativeDriver:!0}).start(()=>a())}else springBack()},cancel:springBack}};export const useDragToDismiss=e=>{const{drag:t,travel:a,onDismiss:s,contentAtTop:n,scrollGesture:r}=e,{motion:i}=useTheme(),o=usePresenceMotion(),u=useRef(createAnimatedValue(1)).current;return useMemo(()=>{const e=createDragToDismissController({drag:t,travel:a,onDismiss:s,opacity:u},i,o),l=Gesture.Pan().runOnJS(!0).activeOffsetY(6).failOffsetX([-12,12]).onUpdate(t=>e.move(t.translationY)).onEnd(t=>e.release(t.translationY,t.velocityY/1e3)).onFinalize((_e,t)=>{t||e.cancel()});let c=0,m=!1;const f=Gesture.Pan().runOnJS(!0).activeOffsetY(8).failOffsetX([-12,12]).onBegin(()=>{c=0,m=!1}).onUpdate(t=>{if(!m){if(n&&!n())return;m=!0,c=t.translationY}e.move(t.translationY-c)}).onEnd(t=>{m&&e.release(t.translationY-c,t.velocityY/1e3)}).onFinalize((_e,t)=>{!t&&m&&e.cancel()});return r&&f.simultaneousWithExternalGesture(r),{handleGesture:l,sheetGesture:f,opacity:u}},[t,a,s,n,r,i,o,u])};
1
+ "use strict";import{useMemo,useRef}from"react";import{Animated,Easing}from"react-native";import{Gesture}from"react-native-gesture-handler";import{createAnimatedValue,setNativeValue,useTheme}from"../theme/index.js";import{nativeDriver}from"../utils/nativeDriver.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const DRAG_DISMISS_DISTANCE=100;export const DRAG_DISMISS_VELOCITY=.5;export const createDragToDismissController=({drag:e,travel:t,onDismiss:r,opacity:a},i,s)=>{const{snappy:n}=i.spring,springBack=()=>Animated.spring(e,{toValue:0,damping:n.damping,stiffness:n.stiffness,mass:n.mass,useNativeDriver:nativeDriver}).start(),o=!0===s?.reduced?a:void 0,u=s?.duration("default")??i.duration.default;return{move:t=>{setNativeValue(e,Math.max(0,t))},release:(a,s)=>{if(a>100||s>.5){if(o)return void Animated.timing(o,{toValue:0,duration:u,easing:Easing.bezier(...i.ease.accelerate),useNativeDriver:nativeDriver}).start(()=>r());Animated.timing(e,{toValue:"function"==typeof t?t():t,duration:i.duration.fast,easing:Easing.bezier(...i.ease.accelerate),useNativeDriver:nativeDriver}).start(()=>r())}else springBack()},cancel:springBack}};export const useDragToDismiss=e=>{const{drag:t,travel:r,onDismiss:a,contentAtTop:i,scrollGesture:s}=e,{motion:n}=useTheme(),o=usePresenceMotion(),u=useRef(createAnimatedValue(1)).current;return useMemo(()=>{const e=createDragToDismissController({drag:t,travel:r,onDismiss:a,opacity:u},n,o),l=Gesture.Pan().runOnJS(!0).activeOffsetY(6).failOffsetX([-12,12]).onUpdate(t=>e.move(t.translationY)).onEnd(t=>e.release(t.translationY,t.velocityY/1e3)).onFinalize((_e,t)=>{t||e.cancel()});let c=0,m=!1;const v=Gesture.Pan().runOnJS(!0).activeOffsetY(8).failOffsetX([-12,12]).onBegin(()=>{c=0,m=!1}).onUpdate(t=>{if(!m){if(i&&!i())return;m=!0,c=t.translationY}e.move(t.translationY-c)}).onEnd(t=>{m&&e.release(t.translationY-c,t.velocityY/1e3)}).onFinalize((_e,t)=>{!t&&m&&e.cancel()});return s&&v.simultaneousWithExternalGesture(s),{handleGesture:l,sheetGesture:v,opacity:u}},[t,r,a,i,s,n,o,u])};
@@ -1 +1 @@
1
- "use strict";import{useCallback,useMemo,useRef}from"react";import{Easing,Animated as RNAnimated}from"react-native";import{setNativeValue,useTheme}from"../theme/index.js";import{createAnimatedValue}from"../theme/animatedValue.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const PRESS_ANIMATION_PRESETS=["scale","bounce","fade","sink","pulse","dim"];const FADE_TO=.6,DIM_TO=.7,SINK_BY=2,PULSE_TO=1.05,DEFAULT_SCALE_TO={scale:.97,bounce:.92,fade:1,sink:1,pulse:1,dim:1};export const usePressAnimation=({preset:e="scale",scaleTo:a,pressDuration:s,enabled:t=!0}={})=>{const i=useTheme(),n=usePresenceMotion(),r=useRef(createAnimatedValue(1)).current,o=useRef(createAnimatedValue(1)).current,u=useRef(createAnimatedValue(0)).current,c=n.reduced?"dim"===e?"dim":"fade":e,m=a??DEFAULT_SCALE_TO[c],l=s??n.duration("fast"),d=useCallback((e,a,s)=>RNAnimated.timing(e,{toValue:a,duration:l,easing:Easing.bezier(...s),useNativeDriver:!0}),[l]),p=useCallback((e,a,s)=>RNAnimated.spring(e,{toValue:a,damping:i.motion.spring[s].damping,stiffness:i.motion.spring[s].stiffness,mass:i.motion.spring[s].mass,useNativeDriver:!0}),[i]),f=useCallback(()=>{if(t)switch(c){case"scale":case"bounce":d(r,m,i.motion.ease["in-out"]).start();break;case"fade":d(o,.6,i.motion.ease["in-out"]).start();break;case"dim":setNativeValue(o,.7);break;case"sink":d(u,2,i.motion.ease["in-out"]).start()}},[t,c,m,r,o,u,i,d]),b=useCallback(()=>{if(t)switch(c){case"scale":p(r,1,"snappy").start();break;case"bounce":p(r,1,"bouncy").start();break;case"fade":d(o,1,i.motion.ease.decelerate).start();break;case"dim":setNativeValue(o,1);break;case"sink":p(u,0,"snappy").start()}},[t,c,r,o,u,i,d,p]),A=useCallback(()=>{t&&"pulse"===c&&RNAnimated.sequence([RNAnimated.timing(r,{toValue:1.05,duration:i.motion.duration.instant,easing:Easing.bezier(...i.motion.ease.accelerate),useNativeDriver:!0}),p(r,1,"snappy")]).start()},[t,c,r,i,p]),k=useMemo(()=>({transform:[{scale:r},{translateY:u}],opacity:o}),[r,u,o]);return{scale:r,opacity:o,translateY:u,style:k,pressIn:f,pressOut:b,press:A}};
1
+ "use strict";import{useCallback,useMemo,useRef}from"react";import{Easing,Animated as RNAnimated}from"react-native";import{setNativeValue,useTheme}from"../theme/index.js";import{createAnimatedValue}from"../theme/animatedValue.js";import{nativeDriver}from"../utils/nativeDriver.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const PRESS_ANIMATION_PRESETS=["scale","bounce","fade","sink","pulse","dim"];const FADE_TO=.6,DIM_TO=.7,SINK_BY=2,PULSE_TO=1.05,DEFAULT_SCALE_TO={scale:.97,bounce:.92,fade:1,sink:1,pulse:1,dim:1};export const usePressAnimation=({preset:e="scale",scaleTo:a,pressDuration:s,enabled:t=!0}={})=>{const i=useTheme(),r=usePresenceMotion(),n=useRef(createAnimatedValue(1)).current,o=useRef(createAnimatedValue(1)).current,u=useRef(createAnimatedValue(0)).current,c=r.reduced?"dim"===e?"dim":"fade":e,m=a??DEFAULT_SCALE_TO[c],l=s??r.duration("fast"),d=useCallback((e,a,s)=>RNAnimated.timing(e,{toValue:a,duration:l,easing:Easing.bezier(...s),useNativeDriver:nativeDriver}),[l]),p=useCallback((e,a,s)=>RNAnimated.spring(e,{toValue:a,damping:i.motion.spring[s].damping,stiffness:i.motion.spring[s].stiffness,mass:i.motion.spring[s].mass,useNativeDriver:nativeDriver}),[i]),f=useCallback(()=>{if(t)switch(c){case"scale":case"bounce":d(n,m,i.motion.ease["in-out"]).start();break;case"fade":d(o,.6,i.motion.ease["in-out"]).start();break;case"dim":setNativeValue(o,.7);break;case"sink":d(u,2,i.motion.ease["in-out"]).start()}},[t,c,m,n,o,u,i,d]),b=useCallback(()=>{if(t)switch(c){case"scale":p(n,1,"snappy").start();break;case"bounce":p(n,1,"bouncy").start();break;case"fade":d(o,1,i.motion.ease.decelerate).start();break;case"dim":setNativeValue(o,1);break;case"sink":p(u,0,"snappy").start()}},[t,c,n,o,u,i,d,p]),v=useCallback(()=>{t&&"pulse"===c&&RNAnimated.sequence([RNAnimated.timing(n,{toValue:1.05,duration:i.motion.duration.instant,easing:Easing.bezier(...i.motion.ease.accelerate),useNativeDriver:nativeDriver}),p(n,1,"snappy")]).start()},[t,c,n,i,p]),A=useMemo(()=>({transform:[{scale:n},{translateY:u}],opacity:o}),[n,u,o]);return{scale:n,opacity:o,translateY:u,style:A,pressIn:f,pressOut:b,press:v}};
@@ -1 +1 @@
1
- "use strict";import{useNetworkStatus}from"@webority/mobile-core";import{useEffect,useMemo,useRef,useState}from"react";import{Animated,StyleSheet,Text}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../hooks/usePresenceMotion.js";import{fontFor,useTheme}from"../theme/index.js";import{jsx as _jsx}from"react/jsx-runtime";export const NetworkStatusBanner=({message:e="You are offline. Some features may be unavailable.",restoredMessage:t="You are back online.",restoredDuration:o=2e3,position:n="top",style:s,disabled:r=!1,safeArea:i=!0})=>{const a=useTheme(),u=usePresenceMotion(),l=useSafeAreaInsets(),d=i?"top"===n?l.top:l.bottom:0,[c,m]=useState(0),f=c>0?c:56+d,{isConnected:p,isInternetReachable:b}=useNetworkStatus(),g=!(r||p&&!1!==b),[h,S]=useState("hidden"),[x,y]=useState("offline");useEffect(()=>{"hidden"!==h&&y(h)},[h]),useEffect(()=>{S(g?"offline":r?"hidden":e=>"offline"===e?"restored":e)},[g,r]),useEffect(()=>{if("restored"!==h)return;const e=setTimeout(()=>S("hidden"),o);return()=>clearTimeout(e)},[h,o]);const v="hidden"!==h,A="restored"===h||"hidden"===h&&"restored"===x,w=useRef(new Animated.Value(0)).current,R=useRef(new Animated.Value(0)).current,j=u.duration("default");useEffect(()=>{Animated.parallel([Animated.timing(w,{toValue:v?1:0,duration:a.motion.duration.default,useNativeDriver:!0}),Animated.timing(R,{toValue:v?1:0,duration:j,useNativeDriver:!0})]).start()},[v,w,R,a.motion.duration.default,j]);const k=useMemo(()=>buildStyles(a),[a]),E=w.interpolate({inputRange:[0,1],outputRange:u.range("top"===n?-f:f,0)});return _jsx(Animated.View,{pointerEvents:v?"auto":"none",accessibilityRole:"alert",accessibilityLiveRegion:v?"polite":"none",onLayout:e=>m(e.nativeEvent.layout.height),style:[k.container,"top"===n?k.top:k.bottom,"top"===n?{paddingTop:a.space.sm+d}:{paddingBottom:a.space.sm+d},{backgroundColor:A?a.colors["online-fill"]:a.colors["offline-fill"],opacity:R,transform:[{translateY:E}]},s],children:_jsx(Text,{style:{color:A?a.colors["on-success"]:a.colors["on-danger"],fontSize:a.text.sm.size,...fontFor(a,"semibold"),textAlign:"center"},numberOfLines:2,children:A?t:e})})};const buildStyles=e=>StyleSheet.create({container:{position:"absolute",left:0,right:0,paddingVertical:e.space.sm,paddingHorizontal:e.space.lg,zIndex:1e3,elevation:8},top:{top:0},bottom:{bottom:0}});export default NetworkStatusBanner;
1
+ "use strict";import{useNetworkStatus}from"@webority/mobile-core";import{useEffect,useMemo,useRef,useState}from"react";import{Animated,StyleSheet,Text}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../hooks/usePresenceMotion.js";import{fontFor,useTheme}from"../theme/index.js";import{nativeDriver}from"../utils/nativeDriver.js";import{jsx as _jsx}from"react/jsx-runtime";export const NetworkStatusBanner=({message:e="You are offline. Some features may be unavailable.",restoredMessage:t="You are back online.",restoredDuration:o=2e3,position:n="top",style:r,disabled:i=!1,safeArea:s=!0})=>{const a=useTheme(),u=usePresenceMotion(),l=useSafeAreaInsets(),d=s?"top"===n?l.top:l.bottom:0,[c,m]=useState(0),f=c>0?c:56+d,{isConnected:p,isInternetReachable:v}=useNetworkStatus(),b=!(i||p&&!1!==v),[g,h]=useState("hidden"),[S,x]=useState("offline");useEffect(()=>{"hidden"!==g&&x(g)},[g]),useEffect(()=>{h(b?"offline":i?"hidden":e=>"offline"===e?"restored":e)},[b,i]),useEffect(()=>{if("restored"!==g)return;const e=setTimeout(()=>h("hidden"),o);return()=>clearTimeout(e)},[g,o]);const y="hidden"!==g,A="restored"===g||"hidden"===g&&"restored"===S,j=useRef(new Animated.Value(0)).current,w=useRef(new Animated.Value(0)).current,R=u.duration("default");useEffect(()=>{Animated.parallel([Animated.timing(j,{toValue:y?1:0,duration:a.motion.duration.default,useNativeDriver:nativeDriver}),Animated.timing(w,{toValue:y?1:0,duration:R,useNativeDriver:nativeDriver})]).start()},[y,j,w,a.motion.duration.default,R]);const k=useMemo(()=>buildStyles(a),[a]),D=j.interpolate({inputRange:[0,1],outputRange:u.range("top"===n?-f:f,0)});return _jsx(Animated.View,{pointerEvents:y?"auto":"none",accessibilityRole:"alert",accessibilityLiveRegion:y?"polite":"none",onLayout:e=>m(e.nativeEvent.layout.height),style:[k.container,"top"===n?k.top:k.bottom,"top"===n?{paddingTop:a.space.sm+d}:{paddingBottom:a.space.sm+d},{backgroundColor:A?a.colors["online-fill"]:a.colors["offline-fill"],opacity:w,transform:[{translateY:D}]},r],children:_jsx(Text,{style:{color:A?a.colors["on-success"]:a.colors["on-danger"],fontSize:a.text.sm.size,...fontFor(a,"semibold"),textAlign:"center"},numberOfLines:2,children:A?t:e})})};const buildStyles=e=>StyleSheet.create({container:{position:"absolute",left:0,right:0,paddingVertical:e.space.sm,paddingHorizontal:e.space.lg,zIndex:1e3,elevation:8},top:{top:0},bottom:{bottom:0}});export default NetworkStatusBanner;
@@ -1 +1 @@
1
- "use strict";import{Animated,Platform}from"react-native";export const createAnimatedValue=(t,e)=>{const a=new Animated.Value(t,e);return"web"===Platform.OS?a:(a._tracking=null,Object.seal(a))};export const setNativeValue=(t,e)=>{Animated.timing(t,{toValue:e,duration:0,useNativeDriver:!0}).start()};
1
+ "use strict";import{Animated,Platform}from"react-native";import{nativeDriver}from"../utils/nativeDriver.js";export const createAnimatedValue=(t,e)=>{const r=new Animated.Value(t,e);return"web"===Platform.OS?r:(r._tracking=null,Object.seal(r))};export const setNativeValue=(t,e)=>{Animated.timing(t,{toValue:e,duration:0,useNativeDriver:nativeDriver}).start()};
@@ -1 +1 @@
1
- "use strict";import{scaleStep}from"./scale.js";import{COMPONENT_KINDS}from"./tokens.generated.js";const SIZE_KEYS=["xs","sm","md","lg","xl"],kindOf=(e,o,t)=>{const s=COMPONENT_KINDS[e][o];if(!s)throw new Error(`components.${e}${t?`.${t}`:""}.${o} has no kind in COMPONENT_KINDS.`);return s},pixelsOf=(e,o,t,s)=>{if("space"===o||"text"===o||"radius"===o)return scaleStep(e,o,String(t),s);if("number"!=typeof t)throw new Error(`${s} is ${JSON.stringify(t)}; it takes a number.`);return t},resolveSize=(e,o,t)=>{const s=e.components[o][t],r={};for(const i of Object.keys(s))r[i]=pixelsOf(e,kindOf(o,i,t),s[i],`components.${o}.${t}.${i}`);return r};export const resolveButtonSize=(e,o)=>resolveSize(e,"button",o);export const resolveFieldSize=(e,o)=>resolveSize(e,"field",o);export const resolveEmptyStateSize=(e,o)=>resolveSize(e,"empty-state",o);export const resolveListItemSize=(e,o)=>resolveSize(e,"list-item",o);export const resolveBadgeSize=(e,o)=>resolveSize(e,"badge",o);export const resolveChipSize=(e,o)=>resolveSize(e,"chip",o);export const resolveCheckboxSize=(e,o)=>resolveSize(e,"checkbox",o);export const resolveRadioSize=(e,o)=>resolveSize(e,"radio",o);export const resolveSwitchSize=(e,o)=>resolveSize(e,"switch",o);export const resolveOtpInputSize=(e,o)=>resolveSize(e,"otp-input",o);export const resolveSegmentedControlSize=(e,o)=>resolveSize(e,"segmented-control",o);export const resolveTabsSize=(e,o)=>resolveSize(e,"tabs",o);export const resolveSliderSize=(e,o)=>resolveSize(e,"slider",o);export const resolveFloatingActionButtonSize=(e,o)=>resolveSize(e,"floating-action-button",o);export const validateComponentTokens=e=>{for(const o of Object.keys(COMPONENT_KINDS)){const t=e.components[o];for(const s of Object.keys(t))SIZE_KEYS.includes(s)?resolveSize(e,o,s):pixelsOf(e,kindOf(o,s),t[s],`components.${o}.${s}`)}};
1
+ "use strict";import{scaleStep}from"./scale.js";import{COMPONENT_KINDS}from"./tokens.generated.js";const SIZE_KEYS=["xs","sm","md","lg","xl"],kindOf=(e,o,t)=>{const s=COMPONENT_KINDS[e][o];if(!s)throw new Error(`components.${e}${t?`.${t}`:""}.${o} has no kind in COMPONENT_KINDS.`);return s},pixelsOf=(e,o,t,s)=>{if("space"===o||"text"===o||"radius"===o)return scaleStep(e,o,String(t),s);if("number"!=typeof t)throw new Error(`${s} is ${JSON.stringify(t)}; it takes a number.`);return t},resolveSize=(e,o,t)=>{const s=e.components[o][t];if(void 0===s)throw new Error(`components.${o} has no "${t}" size in the theme.`);const r={};for(const i of Object.keys(s))r[i]=pixelsOf(e,kindOf(o,i,t),s[i],`components.${o}.${t}.${i}`);return r};export const resolveButtonSize=(e,o)=>resolveSize(e,"button",o);export const resolveFieldSize=(e,o)=>resolveSize(e,"field",o);export const resolveEmptyStateSize=(e,o)=>resolveSize(e,"empty-state",o);export const resolveListItemSize=(e,o)=>resolveSize(e,"list-item",o);export const resolveBadgeSize=(e,o)=>resolveSize(e,"badge",o);export const resolveChipSize=(e,o)=>resolveSize(e,"chip",o);export const resolveCheckboxSize=(e,o)=>resolveSize(e,"checkbox",o);export const resolveRadioSize=(e,o)=>resolveSize(e,"radio",o);export const resolveSwitchSize=(e,o)=>resolveSize(e,"switch",o);export const resolveOtpInputSize=(e,o)=>resolveSize(e,"otp-input",o);export const resolveSegmentedControlSize=(e,o)=>resolveSize(e,"segmented-control",o);export const resolveTabsSize=(e,o)=>resolveSize(e,"tabs",o);export const resolveSliderSize=(e,o)=>resolveSize(e,"slider",o);export const resolveFloatingActionButtonSize=(e,o)=>resolveSize(e,"floating-action-button",o);export const validateComponentTokens=e=>{for(const o of Object.keys(COMPONENT_KINDS)){const t=e.components[o];for(const s of Object.keys(t))SIZE_KEYS.includes(s)?resolveSize(e,o,s):pixelsOf(e,kindOf(o,s),t[s],`components.${o}.${s}`)}};
@@ -1 +1 @@
1
- "use strict";import{validateComponentTokens}from"./componentSizes.js";import{COLOR_NAMES,FONT_NAMES,RADIUS_NAMES,WEIGHT_NAMES}from"./tokens.generated.js";import{deriveSolidFill,deriveStateFills,deriveToneInk}from"./toneInk.js";const HINT="Run webority upgrade to rename old names.",BRAND_KEYS=["colors","radius","font"],COLOR_MODES=["light","dark"],FIXED_RADII=["none","pill"],RADIUS_ALLOWED="sm, md, lg, xl",SETTINGS_KEYS=["icons","gradients","textVariants","maxFontSizeMultiplier","components"],COMPONENT_SETTING_KEYS={field:{defaultVariant:!0,requiredMarker:!0},input:{defaultVariant:!0,defaultLabelMode:!0,tintLabelOnFocus:!0,shakeOnError:!0},"search-bar":{defaultVariant:!0},select:{defaultVariant:!0},"otp-input":{shakeOnError:!0},"option-sheet":{selectedMarker:!0},"profile-picker":{defaultTone:!0,defaultVariant:!0,defaultAvatarTone:!0},slider:{thumbPressAnimation:!0},rating:{pulseOnPress:!0},stepper:{pulseAnimation:!0},tooltip:{enableScaleAnimation:!0},toast:{enableSwipeDismiss:!0,defaultDurationMs:!0},button:{defaultVariant:!0,defaultSize:!0,defaultPressAnimation:!0},card:{defaultVariant:!0,defaultPadding:!0,defaultRadius:!0,defaultTitleFont:!0},"section-header":{defaultVariant:!0,defaultFlush:!0},"empty-state":{defaultSize:!0,defaultVariant:!0},screen:{tabBarFloats:!0,headerShadowOnScroll:!0}},isPlainObject=t=>"object"==typeof t&&null!==t&&!Array.isArray(t),validateBrand=t=>{if(void 0===t)return;if(!isPlainObject(t))throw new Error(`A brand is an object of colors, radius and font; got ${typeof t}. ${HINT}`);for(const e of Object.keys(t))if(!BRAND_KEYS.includes(e))throw new Error(`A brand sets colors, radius and font only; ${e} is not allowed (allowed: colors, radius, font). ${HINT}`);const e=t.colors;if(void 0!==e&&!isPlainObject(e))throw new Error(`A brand's colors is an object of light and dark; got ${typeof e}. ${HINT}`);for(const t of Object.keys(e??{})){if(!COLOR_MODES.includes(t))throw new Error(`A brand sets colours under light and dark only; ${t} is not allowed (allowed: light, dark). ${HINT}`);const o=e[t];for(const t of Object.keys(o)){if(!COLOR_NAMES.includes(t))throw new Error(`unknown colour ${t}; allowed: ${COLOR_NAMES.join(", ")}. ${HINT}`);if(void 0!==o[t]&&"string"!=typeof o[t])throw new Error(`colour ${t} must be a string; got ${typeof o[t]}.`)}}const o=t.radius;if(void 0!==o&&!isPlainObject(o))throw new Error(`A brand's radius is an object of radius names; got ${typeof o}. ${HINT}`);for(const t of Object.keys(o??{})){const e=o[t];if(!RADIUS_NAMES.includes(t))throw new Error(`unknown radius ${t}; allowed: ${RADIUS_ALLOWED}. ${HINT}`);if(FIXED_RADII.includes(t))throw new Error(`radius ${t} is fixed by the library; allowed: ${RADIUS_ALLOWED}.`);if("number"!=typeof e||!Number.isFinite(e))throw new Error(`radius ${t} must be a number; got ${typeof e}.`)}const n=t.font;if(void 0!==n&&!isPlainObject(n))throw new Error(`A brand's font is an object of font names; got ${typeof n}. ${HINT}`);for(const t of Object.keys(n??{})){if(!FONT_NAMES.includes(t))throw new Error(`unknown font ${t}; allowed: ${FONT_NAMES.join(", ")}. ${HINT}`);const e=n[t];if(!isPlainObject(e))throw new Error(`font ${t} must be an object of weights; got ${typeof e}. ${HINT}`);for(const o of Object.keys(e)){if(!WEIGHT_NAMES.includes(o))throw new Error(`unknown font weight ${o} in font ${t}; allowed: ${WEIGHT_NAMES.join(", ")}. ${HINT}`);const n=e[o];if("string"!=typeof n||0===n.length)throw new Error(`font ${t} weight ${o} must be a non-empty string.`)}}},validateSettings=t=>{if(void 0===t)return;if(!isPlainObject(t))throw new Error(`Theme settings is an object; got ${typeof t}. ${HINT}`);for(const e of Object.keys(t))if(!SETTINGS_KEYS.includes(e))throw new Error(`Theme settings take ${SETTINGS_KEYS.join(", ")} only; ${e} is not allowed. ${HINT}`);const e=t.components;if(void 0===e)return;if(!isPlainObject(e))throw new Error(`Theme settings components is an object of component names; got ${typeof e}. ${HINT}`);const o=COMPONENT_SETTING_KEYS;for(const t of Object.keys(e)){if(!Object.keys(o).includes(t))throw new Error(`unknown component ${t} in theme settings; allowed: ${Object.keys(COMPONENT_SETTING_KEYS).join(", ")}. ${HINT}`);const n=e[t];if(void 0===n)continue;if(!isPlainObject(n))throw new Error(`theme settings for ${t} is an object; got ${typeof n}. ${HINT}`);const r=o[t];for(const e of Object.keys(n))if(!(e in r))throw new Error(`unknown setting ${e} for ${t}; allowed: ${Object.keys(r).join(", ")}. ${HINT}`)}},TONES=["primary","success","warning","danger","info"];export const mergeBrand=(t,e,o)=>{validateBrand(e),validateSettings(o);const n=Object.fromEntries(Object.entries(e?.colors?.[t.mode]??{}).filter(([,t])=>void 0!==t)),r={...t.colors,...n},i={...t.radius,...e?.radius},s={...t.font};for(const o of Object.keys(e?.font??{}))s[o]={...t.font[o],...e?.font?.[o]};const a=[r.bg,r["bg-subtle"],r["bg-muted"]],l={};for(const e of TONES){const o="string"==typeof n[e];let i=r[e];if(o||"string"==typeof n[`on-${e}`]){const t=deriveSolidFill(i,r[`on-${e}`]);t!==i&&(l[e]=t,i=t)}if(o&&"string"!=typeof n[`${e}-text`]&&(l[`${e}-text`]=deriveToneInk(i,a,t.mode)),"primary"===e&&(o||void 0!==l.primary)){const e=deriveStateFills(i,r["on-primary"],{fill:t.colors.primary,hover:t.colors["primary-hover"],pressed:t.colors["primary-pressed"]});"string"!=typeof n["primary-hover"]&&(l["primary-hover"]=e.hover),"string"!=typeof n["primary-pressed"]&&(l["primary-pressed"]=e.pressed)}}const d={},f=new Set([...Object.keys(t.settings.components),...Object.keys(o?.components??{})]);for(const e of f)d[e]={...t.settings.components[e],...o?.components?.[e]};const c=o?.maxFontSizeMultiplier??t.settings.maxFontSizeMultiplier,u={icons:{...t.settings.icons,...o?.icons},gradients:{...t.settings.gradients,...o?.gradients},textVariants:{...t.settings.textVariants,...o?.textVariants},components:d,...void 0===c?{}:{maxFontSizeMultiplier:c}},p={...t,colors:{...r,...l},radius:i,font:s,settings:u};return validateComponentTokens(p),p};
1
+ "use strict";import{validateComponentTokens}from"./componentSizes.js";import{COLOR_NAMES,FONT_NAMES,RADIUS_NAMES,WEIGHT_NAMES}from"./tokens.generated.js";import{deriveSolidFill,deriveStateFills,deriveToneInk}from"./toneInk.js";const HINT="Run webority upgrade to rename old names.",BRAND_KEYS=["colors","radius","font"],COLOR_MODES=["light","dark"],FIXED_RADII=["none","pill"],RADIUS_ALLOWED="sm, md, lg, xl",SETTINGS_KEYS=["icons","gradients","textVariants","maxFontSizeMultiplier","components"],COMPONENT_SETTING_KEYS={field:{defaultVariant:!0,requiredMarker:!0},input:{defaultVariant:!0,defaultLabelMode:!0,tintLabelOnFocus:!0,shakeOnError:!0},"search-bar":{defaultVariant:!0},select:{defaultVariant:!0},"otp-input":{shakeOnError:!0},"option-sheet":{selectedMarker:!0},"profile-picker":{defaultTone:!0,defaultVariant:!0,defaultAvatarTone:!0},slider:{thumbPressAnimation:!0},rating:{pulseOnPress:!0},stepper:{pulseAnimation:!0},tooltip:{enableScaleAnimation:!0},toast:{enableSwipeDismiss:!0,defaultDurationMs:!0},button:{defaultVariant:!0,defaultSize:!0,defaultPressAnimation:!0},card:{defaultVariant:!0,defaultPadding:!0,defaultRadius:!0,defaultTitleFont:!0},"section-header":{defaultVariant:!0,defaultFlush:!0},"empty-state":{defaultSize:!0,defaultVariant:!0},screen:{tabBarFloats:!0,headerShadowOnScroll:!0}},isPlainObject=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),validateBrand=e=>{if(void 0===e)return;if(!isPlainObject(e))throw new Error(`A brand is an object of colors, radius and font; got ${typeof e}. ${HINT}`);for(const o of Object.keys(e))if(!BRAND_KEYS.includes(o))throw new Error(`A brand sets colors, radius and font only; ${o} is not allowed (allowed: colors, radius, font). ${HINT}`);const o=e.colors;if(void 0!==o&&!isPlainObject(o))throw new Error(`A brand's colors is an object of light and dark; got ${typeof o}. ${HINT}`);for(const e of Object.keys(o??{})){if(!COLOR_MODES.includes(e))throw new Error(`A brand sets colours under light and dark only; ${e} is not allowed (allowed: light, dark). ${HINT}`);const t=o[e];if(void 0===t)throw new Error(`A brand's ${e} colours are missing. ${HINT}`);for(const e of Object.keys(t)){if(!COLOR_NAMES.includes(e))throw new Error(`unknown colour ${e}; allowed: ${COLOR_NAMES.join(", ")}. ${HINT}`);if(void 0!==t[e]&&"string"!=typeof t[e])throw new Error(`colour ${e} must be a string; got ${typeof t[e]}.`)}}const t=e.radius;if(void 0!==t&&!isPlainObject(t))throw new Error(`A brand's radius is an object of radius names; got ${typeof t}. ${HINT}`);for(const e of Object.keys(t??{})){const o=t[e];if(!RADIUS_NAMES.includes(e))throw new Error(`unknown radius ${e}; allowed: ${RADIUS_ALLOWED}. ${HINT}`);if(FIXED_RADII.includes(e))throw new Error(`radius ${e} is fixed by the library; allowed: ${RADIUS_ALLOWED}.`);if("number"!=typeof o||!Number.isFinite(o))throw new Error(`radius ${e} must be a number; got ${typeof o}.`)}const n=e.font;if(void 0!==n&&!isPlainObject(n))throw new Error(`A brand's font is an object of font names; got ${typeof n}. ${HINT}`);for(const e of Object.keys(n??{})){if(!FONT_NAMES.includes(e))throw new Error(`unknown font ${e}; allowed: ${FONT_NAMES.join(", ")}. ${HINT}`);const o=n[e];if(!isPlainObject(o))throw new Error(`font ${e} must be an object of weights; got ${typeof o}. ${HINT}`);for(const t of Object.keys(o)){if(!WEIGHT_NAMES.includes(t))throw new Error(`unknown font weight ${t} in font ${e}; allowed: ${WEIGHT_NAMES.join(", ")}. ${HINT}`);const n=o[t];if("string"!=typeof n||0===n.length)throw new Error(`font ${e} weight ${t} must be a non-empty string.`)}}},validateSettings=e=>{if(void 0===e)return;if(!isPlainObject(e))throw new Error(`Theme settings is an object; got ${typeof e}. ${HINT}`);for(const o of Object.keys(e))if(!SETTINGS_KEYS.includes(o))throw new Error(`Theme settings take ${SETTINGS_KEYS.join(", ")} only; ${o} is not allowed. ${HINT}`);const o=e.components;if(void 0===o)return;if(!isPlainObject(o))throw new Error(`Theme settings components is an object of component names; got ${typeof o}. ${HINT}`);const t=COMPONENT_SETTING_KEYS;for(const e of Object.keys(o)){if(!Object.keys(t).includes(e))throw new Error(`unknown component ${e} in theme settings; allowed: ${Object.keys(COMPONENT_SETTING_KEYS).join(", ")}. ${HINT}`);const n=o[e];if(void 0===n)continue;if(!isPlainObject(n))throw new Error(`theme settings for ${e} is an object; got ${typeof n}. ${HINT}`);const r=t[e];if(void 0===r)throw new Error(`theme settings for ${e} have no allowed keys table. ${HINT}`);for(const o of Object.keys(n))if(!(o in r))throw new Error(`unknown setting ${o} for ${e}; allowed: ${Object.keys(r).join(", ")}. ${HINT}`)}},TONES=["primary","success","warning","danger","info"];export const mergeBrand=(e,o,t)=>{validateBrand(o),validateSettings(t);const n=Object.fromEntries(Object.entries(o?.colors?.[e.mode]??{}).filter(([,e])=>void 0!==e)),r={...e.colors,...n},colorOf=e=>{const o=r[e];if(void 0===o)throw new Error(`The theme has no colour ${e}.`);return o},i={...e.radius,...o?.radius},s={...e.font};for(const t of Object.keys(o?.font??{}))s[t]={...e.font[t],...o?.font?.[t]};const a=[colorOf("bg"),colorOf("bg-subtle"),colorOf("bg-muted")],l={};for(const o of TONES){const t="string"==typeof n[o];let r=colorOf(o);if(t||"string"==typeof n[`on-${o}`]){const e=deriveSolidFill(r,colorOf(`on-${o}`));e!==r&&(l[o]=e,r=e)}if(t&&"string"!=typeof n[`${o}-text`]&&(l[`${o}-text`]=deriveToneInk(r,a,e.mode)),"primary"===o&&(t||void 0!==l.primary)){const o=deriveStateFills(r,colorOf("on-primary"),{fill:e.colors.primary,hover:e.colors["primary-hover"],pressed:e.colors["primary-pressed"]});"string"!=typeof n["primary-hover"]&&(l["primary-hover"]=o.hover),"string"!=typeof n["primary-pressed"]&&(l["primary-pressed"]=o.pressed)}}const d={},f=new Set([...Object.keys(e.settings.components),...Object.keys(t?.components??{})]);for(const o of f)d[o]={...e.settings.components[o],...t?.components?.[o]};const c=t?.maxFontSizeMultiplier??e.settings.maxFontSizeMultiplier,u={icons:{...e.settings.icons,...t?.icons},gradients:{...e.settings.gradients,...t?.gradients},textVariants:{...e.settings.textVariants,...t?.textVariants},components:d,...void 0===c?{}:{maxFontSizeMultiplier:c}},w={...e,colors:{...r,...l},radius:i,font:s,settings:u};return validateComponentTokens(w),w};
@@ -1 +1 @@
1
- "use strict";import{blendOf}from"../utils/color.js";const HEX=/^#([0-9a-f]{6})$/i,TARGET=4.55,TINT_OPACITY=.14,STEP=.0025,channelsOf=t=>{const e=Number.parseInt(t.slice(1,7),16);return[e>>16&255,e>>8&255,255&e]},luminance=t=>{const[e,r,n]=channelsOf(t).map(t=>{const e=t/255;return e<=.03928?e/12.92:((e+.055)/1.055)**2.4});return.2126*e+.7152*r+.0722*n};export const contrastRatio=(t,e)=>{const[r,n]=[luminance(t),luminance(e)].sort((t,e)=>e-t);return(r+.05)/(n+.05)};const toHsl=t=>{const[e,r,n]=channelsOf(t).map(t=>t/255),s=Math.max(e,r,n),o=Math.min(e,r,n),a=s-o,l=(s+o)/2;if(0===a)return[0,0,l];return[60*(s===e?((r-n)/a+6)%6:s===r?(n-e)/a+2:(e-r)/a+4),l>.5?a/(2-s-o):a/(s+o),l]},fromHsl=([t,e,r])=>{const n=e*Math.min(r,1-r),channel=e=>{const s=(e+t/30)%12,o=r-n*Math.max(-1,Math.min(s-3,9-s,1));return Math.round(255*o).toString(16).padStart(2,"0")};return`#${channel(0)}${channel(8)}${channel(4)}`.toUpperCase()},moveUntil=(t,e,r)=>{const[n,s,o]=toHsl(t);let a=t;for(let t=o+e*STEP;t>=0&&t<=1;t+=e*STEP)if(a=fromHsl([n,s,t]),r(a))return a;return a};export const deriveToneInk=(t,e,r)=>{if(!HEX.test(t))return t;const n=e.filter(t=>HEX.test(t));if(0===n.length)return t;const s=n.flatMap(e=>[e,blendOf(t,.14,e,e)]),reads=t=>s.every(e=>contrastRatio(t,e)>=4.55);return reads(t)?t:moveUntil(t,"dark"===r?1:-1,reads)};export const deriveSolidFill=(t,e)=>{if(!HEX.test(t)||!HEX.test(e))return t;const reads=t=>contrastRatio(t,e)>=4.55;return reads(t)?t:moveUntil(t,luminance(e)>luminance(t)?-1:1,reads)};export const deriveStateFills=(t,e,r)=>{if(![t,e,r.fill,r.hover,r.pressed].every(t=>HEX.test(t)))return{hover:r.hover,pressed:r.pressed};const[n,s,o]=toHsl(t),a=toHsl(r.fill)[2],l=[Math.abs(toHsl(r.hover)[2]-a),Math.abs(toHsl(r.pressed)[2]-a)],i=luminance(e)>luminance(t)?-1:1,c=(t=>l.every(e=>o+t*e>=0&&o+t*e<=1))(i)?i:1===i?-1:1,at=t=>fromHsl([n,s,Math.max(0,Math.min(1,o+c*t))]);return{hover:at(l[0]),pressed:at(l[1])}};
1
+ "use strict";import{blendOf}from"../utils/color.js";const HEX=/^#([0-9a-f]{6})$/i,TARGET=4.55,TINT_OPACITY=.14,STEP=.0025,channelsOf=t=>{const e=Number.parseInt(t.slice(1,7),16);return[e>>16&255,e>>8&255,255&e]},linearOf=t=>{const e=t/255;return e<=.03928?e/12.92:((e+.055)/1.055)**2.4},luminance=t=>{const[e,n,r]=channelsOf(t);return.2126*linearOf(e)+.7152*linearOf(n)+.0722*linearOf(r)};export const contrastRatio=(t,e)=>{const n=luminance(t),r=luminance(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)};const toHsl=t=>{const[e,n,r]=channelsOf(t),s=e/255,o=n/255,a=r/255,l=Math.max(s,o,a),i=Math.min(s,o,a),c=l-i,u=(l+i)/2;if(0===c)return[0,0,u];return[60*(l===s?((o-a)/c+6)%6:l===o?(a-s)/c+2:(s-o)/c+4),u>.5?c/(2-l-i):c/(l+i),u]},fromHsl=([t,e,n])=>{const r=e*Math.min(n,1-n),channel=e=>{const s=(e+t/30)%12,o=n-r*Math.max(-1,Math.min(s-3,9-s,1));return Math.round(255*o).toString(16).padStart(2,"0")};return`#${channel(0)}${channel(8)}${channel(4)}`.toUpperCase()},moveUntil=(t,e,n)=>{const[r,s,o]=toHsl(t);let a=t;for(let t=o+e*STEP;t>=0&&t<=1;t+=e*STEP)if(a=fromHsl([r,s,t]),n(a))return a;return a};export const deriveToneInk=(t,e,n)=>{if(!HEX.test(t))return t;const r=e.filter(t=>HEX.test(t));if(0===r.length)return t;const s=r.flatMap(e=>[e,blendOf(t,.14,e,e)]),reads=t=>s.every(e=>contrastRatio(t,e)>=4.55);return reads(t)?t:moveUntil(t,"dark"===n?1:-1,reads)};export const deriveSolidFill=(t,e)=>{if(!HEX.test(t)||!HEX.test(e))return t;const reads=t=>contrastRatio(t,e)>=4.55;return reads(t)?t:moveUntil(t,luminance(e)>luminance(t)?-1:1,reads)};export const deriveStateFills=(t,e,n)=>{if(![t,e,n.fill,n.hover,n.pressed].every(t=>HEX.test(t)))return{hover:n.hover,pressed:n.pressed};const[r,s,o]=toHsl(t),a=toHsl(n.fill)[2],l=[Math.abs(toHsl(n.hover)[2]-a),Math.abs(toHsl(n.pressed)[2]-a)],i=luminance(e)>luminance(t)?-1:1,c=(t=>l.every(e=>o+t*e>=0&&o+t*e<=1))(i)?i:1===i?-1:1,at=t=>fromHsl([r,s,Math.max(0,Math.min(1,o+c*t))]);return{hover:at(l[0]),pressed:at(l[1])}};
@@ -1 +1 @@
1
- "use strict";export const ACCENT_PRESSED_TINT="rgba(0, 0, 0, 0.12)";export const tintOf=(t,r,e)=>{const s=/^#([0-9a-f]{6})$/i.exec(t);if(!s)return e;const a=Math.round(255*r).toString(16).padStart(2,"0");return`#${s[1]}${a}`};const channelsOf=t=>{const r=/^#([0-9a-f]{6})$/i.exec(t);if(!r)return null;const e=Number.parseInt(r[1],16);return[e>>16&255,e>>8&255,255&e]},rgbaOf=t=>{const r=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(t);if(r){const t=3===r[1].length?[...r[1]].map(t=>t+t).join(""):r[1],n=r=>Number.parseInt(t.slice(r,r+2),16);return[n(0),n(2),n(4),8===t.length?n(6)/255:1]}const e=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i.exec(t);return e?[Number(e[1]),Number(e[2]),Number(e[3]),void 0===e[4]?1:Number(e[4])]:null};export const withAlpha=(t,r)=>{const e=rgbaOf(t);return e?`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${r})`:null};export const transparentOf=t=>withAlpha(t,0)??"transparent";export const blendOf=(t,r,e,s)=>{const a=channelsOf(t),o=channelsOf(e);if(!a||!o)return s;return`#${a.map((t,e)=>Math.round(t*r+o[e]*(1-r))).map(t=>t.toString(16).padStart(2,"0")).join("")}`.toUpperCase()};
1
+ "use strict";export const ACCENT_PRESSED_TINT="rgba(0, 0, 0, 0.12)";export const tintOf=(t,r,e)=>{const s=/^#([0-9a-f]{6})$/i.exec(t);if(!s)return e;const o=Math.round(255*r).toString(16).padStart(2,"0");return`#${s[1]}${o}`};const channelsOf=t=>{const r=/^#([0-9a-f]{6})$/i.exec(t);if(!r)return null;const e=r[1];if(void 0===e)throw new Error("The six-digit hex pattern captures its digits.");const s=Number.parseInt(e,16);return[s>>16&255,s>>8&255,255&s]},rgbaOf=t=>{const r=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(t);if(r){const t=r[1];if(void 0===t)throw new Error("The hex pattern captures its digits.");const e=3===t.length?[...t].map(t=>t+t).join(""):t,n=t=>Number.parseInt(e.slice(t,t+2),16);return[n(0),n(2),n(4),8===e.length?n(6)/255:1]}const e=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i.exec(t);return e?[Number(e[1]),Number(e[2]),Number(e[3]),void 0===e[4]?1:Number(e[4])]:null};export const withAlpha=(t,r)=>{const e=rgbaOf(t);return e?`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${r})`:null};export const transparentOf=t=>withAlpha(t,0)??"transparent";export const blendOf=(t,r,e,s)=>{const o=channelsOf(t),a=channelsOf(e);if(!o||!a)return s;const[i,c,u]=o,[p,f,h]=a;return`#${[Math.round(i*r+p*(1-r)),Math.round(c*r+f*(1-r)),Math.round(u*r+h*(1-r))].map(t=>t.toString(16).padStart(2,"0")).join("")}`.toUpperCase()};
@@ -0,0 +1 @@
1
+ "use strict";import{Platform}from"react-native";export const nativeDriver="web"!==Platform.OS;
@@ -36,7 +36,7 @@ export declare const createAnimatedValue: (initial: number, config?: Constructor
36
36
  /**
37
37
  * Set an `Animated.Value` to a target without going through JS.
38
38
  *
39
- * Once a value has been driven by `useNativeDriver: true`, the underlying
39
+ * Once a value has been driven by the native driver, the underlying
40
40
  * native node owns it — calling `value.setValue(x)` from JS throws
41
41
  * "Attempting to run JS driven animation on animated node that has been moved to native".
42
42
  * Use this helper for any value that is *also* used in a native-driven
@@ -0,0 +1,2 @@
1
+ export declare const nativeDriver: boolean;
2
+ //# sourceMappingURL=nativeDriver.d.ts.map
@@ -36,7 +36,7 @@ export declare const createAnimatedValue: (initial: number, config?: Constructor
36
36
  /**
37
37
  * Set an `Animated.Value` to a target without going through JS.
38
38
  *
39
- * Once a value has been driven by `useNativeDriver: true`, the underlying
39
+ * Once a value has been driven by the native driver, the underlying
40
40
  * native node owns it — calling `value.setValue(x)` from JS throws
41
41
  * "Attempting to run JS driven animation on animated node that has been moved to native".
42
42
  * Use this helper for any value that is *also* used in a native-driven
@@ -0,0 +1,2 @@
1
+ export declare const nativeDriver: boolean;
2
+ //# sourceMappingURL=nativeDriver.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/mobile-ui",
3
- "version": "0.146.1",
3
+ "version": "0.147.0",
4
4
  "description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -115,13 +115,13 @@
115
115
  }
116
116
  },
117
117
  "dependencies": {
118
- "@webority/markdown-core": "0.146.1"
118
+ "@webority/markdown-core": "0.147.0"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@react-navigation/bottom-tabs": ">=7.0.0",
122
122
  "@react-navigation/native": ">=7.0.0",
123
- "@webority/canvas-kit": "0.146.1",
124
- "@webority/mobile-core": "0.146.1",
123
+ "@webority/canvas-kit": "0.147.0",
124
+ "@webority/mobile-core": "0.147.0",
125
125
  "expo": ">=57.0.0",
126
126
  "expo-file-system": ">=57.0.0",
127
127
  "expo-haptics": ">=57.0.0",
@@ -185,10 +185,10 @@
185
185
  "@types/node": "25.6.0",
186
186
  "@types/react": "19.2.18",
187
187
  "@types/react-test-renderer": "19.1.0",
188
- "@webority/canvas-kit": "0.146.1",
189
- "@webority/mobile-core": "0.146.1",
188
+ "@webority/canvas-kit": "0.147.0",
189
+ "@webority/mobile-core": "0.147.0",
190
190
  "@webority/mobile-dev": "0.0.0",
191
- "@webority/tokens": "0.146.1",
191
+ "@webority/tokens": "0.147.0",
192
192
  "expo": "57.0.31",
193
193
  "expo-file-system": "57.0.7",
194
194
  "expo-haptics": "57.0.3",