@webority/mobile-ui 0.179.0 → 0.180.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/canvas-kit/kit.js +10 -10
- package/dist/canvas-kit/manifest.json +11 -1
- package/dist/canvas-kit/release.json +6 -6
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Confetti/Confetti.js +1 -1
- package/lib/commonjs/components/Drawer/Drawer.js +1 -1
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
- package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
- package/lib/commonjs/components/SlideToConfirm/SlideToConfirm.js +1 -1
- package/lib/commonjs/components/Slider/Slider.js +1 -1
- package/lib/commonjs/components/SortableList/SortableList.js +1 -1
- package/lib/commonjs/components/Swipeable/Swipeable.js +1 -1
- package/lib/commonjs/components/TypingIndicator/TypingIndicator.js +1 -1
- package/lib/commonjs/components/ZoomableImage/ZoomableImage.js +1 -1
- package/lib/commonjs/theme/Gradient.js +1 -1
- package/lib/commonjs/theme/tokens.generated.js +1 -1
- package/lib/commonjs/utils/animatedDeps.js +1 -0
- package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/module/components/Confetti/Confetti.js +1 -1
- package/lib/module/components/Drawer/Drawer.js +1 -1
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
- package/lib/module/components/Skeleton/Skeleton.js +1 -1
- package/lib/module/components/SlideToConfirm/SlideToConfirm.js +1 -1
- package/lib/module/components/Slider/Slider.js +1 -1
- package/lib/module/components/SortableList/SortableList.js +1 -1
- package/lib/module/components/Swipeable/Swipeable.js +1 -1
- package/lib/module/components/TypingIndicator/TypingIndicator.js +1 -1
- package/lib/module/components/ZoomableImage/ZoomableImage.js +1 -1
- package/lib/module/theme/Gradient.js +1 -1
- package/lib/module/theme/tokens.generated.js +1 -1
- package/lib/module/utils/animatedDeps.js +1 -0
- package/lib/typescript/commonjs/theme/Gradient.d.ts +2 -2
- package/lib/typescript/commonjs/theme/tokens.generated.d.ts +1 -1
- package/lib/typescript/commonjs/utils/animatedDeps.d.ts +2 -0
- package/lib/typescript/module/theme/Gradient.d.ts +2 -2
- package/lib/typescript/module/theme/tokens.generated.d.ts +1 -1
- package/lib/typescript/module/utils/animatedDeps.d.ts +2 -0
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useEffectEvent,useMemo,useRef,useState}from"react";import{Dimensions,ScrollView,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{fillText,useMobileUiText}from"../../text/index.js";import{NON_MODAL_BOTTOM_SHEET_TEXT}from"../../text/phone/nonModalBottomSheet.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ERROR_PREFIX="[@webority/mobile-ui] NonModalBottomSheet: ",SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,OVERSHOOT_TO_CLOSE=80,PERCENT_PATTERN=/^(\d+(?:\.\d+)?|\.\d+)%$/,parsePercent=e=>{if("string"!=typeof e)return;const t=PERCENT_PATTERN.exec(e);if(!t)return;const o=Number(t[1]);return o>0&&o<=100?o:void 0},isValidSnapPoint=e=>"number"==typeof e?Number.isFinite(e)&&e>0:void 0!==parsePercent(e),validateProps=(e,t)=>{if(0===e.length)throw new Error(`${ERROR_PREFIX}snapPoints needs at least one snap point.`);for(const t of e)if(!isValidSnapPoint(t))throw new Error(`${ERROR_PREFIX}snap point ${String(t)} is not a positive number or a percentage up to 100%.`);if(null!=t&&(!Number.isInteger(t)||t<0||t>=e.length))throw new Error(`${ERROR_PREFIX}snapIndex ${t} is outside the snap points.`)},resolveNonModalSnapPoints=(e,t)=>e.map(e=>"number"==typeof e?e:parseFloat(e)/100*t).sort((e,t)=>e-t),topAt=(e,t,o)=>{const n=e[o];if(void 0===n)throw new Error(`${ERROR_PREFIX}snap index ${o} has no snap point.`);return Math.max(0,t-n)},NonModalBottomSheet=e=>{const{open:t,onClose:o,snapPoints:n,snapIndex:s,onSnapChange:i,enablePanDownToClose:r=!0,scrollable:a=!1,title:l,header:c,footer:u,labels:d,handleIndicatorStyle:
|
|
1
|
+
"use strict";import{useCallback,useEffect,useEffectEvent,useMemo,useRef,useState}from"react";import{Dimensions,ScrollView,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{fillText,useMobileUiText}from"../../text/index.js";import{NON_MODAL_BOTTOM_SHEET_TEXT}from"../../text/phone/nonModalBottomSheet.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{webDeps}from"../../utils/animatedDeps.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ERROR_PREFIX="[@webority/mobile-ui] NonModalBottomSheet: ",SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,OVERSHOOT_TO_CLOSE=80,PERCENT_PATTERN=/^(\d+(?:\.\d+)?|\.\d+)%$/,parsePercent=e=>{if("string"!=typeof e)return;const t=PERCENT_PATTERN.exec(e);if(!t)return;const o=Number(t[1]);return o>0&&o<=100?o:void 0},isValidSnapPoint=e=>"number"==typeof e?Number.isFinite(e)&&e>0:void 0!==parsePercent(e),validateProps=(e,t)=>{if(0===e.length)throw new Error(`${ERROR_PREFIX}snapPoints needs at least one snap point.`);for(const t of e)if(!isValidSnapPoint(t))throw new Error(`${ERROR_PREFIX}snap point ${String(t)} is not a positive number or a percentage up to 100%.`);if(null!=t&&(!Number.isInteger(t)||t<0||t>=e.length))throw new Error(`${ERROR_PREFIX}snapIndex ${t} is outside the snap points.`)},resolveNonModalSnapPoints=(e,t)=>e.map(e=>"number"==typeof e?e:parseFloat(e)/100*t).sort((e,t)=>e-t),topAt=(e,t,o)=>{const n=e[o];if(void 0===n)throw new Error(`${ERROR_PREFIX}snap index ${o} has no snap point.`);return Math.max(0,t-n)},NonModalBottomSheet=e=>{const{open:t,onClose:o,snapPoints:n,snapIndex:s,onSnapChange:i,enablePanDownToClose:r=!0,scrollable:a=!1,title:l,header:c,footer:u,labels:d,handleIndicatorStyle:m,sheetStyle:h,children:p,accessibilityLabel:f,testID:E}=e;validateProps(n,s);const b=useMobileUiText("nonModalBottomSheet",NON_MODAL_BOTTOM_SHEET_TEXT),v=useMemo(()=>({...b,...d}),[b,d]),S=useTheme(),R=usePresenceMotion(),x=R.reduced,g=useMemo(()=>buildStyles(S),[S]),[w,T]=useState(()=>Dimensions.get("window").height),_=useCallback(e=>{const t=e.nativeEvent.layout.height;t>0&&T(t)},[]),N=useMemo(()=>resolveNonModalSnapPoints(n,w),[n,w]),y=N[N.length-1]??0,M=w,O=Math.max(0,w-y),C=useCallback(e=>topAt(N,w,e),[N,w]),[P,I]=useState(!1),[j,D]=useState(-1),A=useRef(-1),V=useRef(o);V.current=o;const k=useRef(i);k.current=i;const F=useSharedValue(M),B=useSharedValue(M),G=useCallback(()=>{A.current<0&&I(!1)},[]),L=useCallback(()=>{if(A.current=-1,D(-1),x)return F.value=M,void G();F.value=withTiming(M,{duration:R.duration("fast"),easing:Easing.bezier(...S.motion.ease.accelerate),reduceMotion:PRESENCE_REDUCE_MOTION},e=>{"worklet";e&&scheduleOnRN(G)})},[M,R,x,S.motion.ease.accelerate,F,G]),$=useCallback(e=>{const t=C(e);F.value=x?t:withSpring(t,SPRING_CONFIG)},[x,C,F]),H=useCallback((e,t)=>{e!==A.current&&(A.current=e,D(e),$(e),t&&k.current?.(e))},[$]),X=useEffectEvent(e=>{if(!e)return void(A.current>=0&&L());const t=s??0;I(!0);const o=C(t);x?F.value=o:(F.value=M,F.value=withSpring(o,SPRING_CONFIG)),A.current=t,D(t)});useEffect(()=>{X(t)},[t]);const U=useEffectEvent(e=>{t&&P&&e!==A.current&&H(e,!1)});useEffect(()=>{null!=s&&U(s)},[s]);const Y=useEffectEvent(e=>{const t=A.current;t>=0&&(F.value=topAt(N,e,t))});useEffect(()=>{Y(w)},[w]);const z=useCallback(e=>{if(e<0)return triggerHaptic("selection"),L(),void V.current();e!==A.current?H(e,!0):$(e)},[H,$,L]),q=useCallback(e=>{const t=A.current;t<0||H(Math.min(Math.max(t+e,0),N.length-1),!0)},[H,N.length]),J=useMemo(()=>N.map(e=>w-e),[N,w]),K=useMemo(()=>{const e=J,t=O,o=r;return{testID:E?`${E}-pan-gesture`:"non-modal-bottom-sheet-pan-gesture",activeOffsetY:[-10,10],onActivate:()=>{"worklet";B.value=F.value},onUpdate:e=>{"worklet";const o=B.value+e.translationY;F.value=o<t?t+.25*(o-t):o},onDeactivate:t=>{"worklet";const n=F.value,s=e[0];if(void 0===s)return;if(t.velocityY>1e3)return void scheduleOnRN(z,o?-1:0);if(o&&n-s>80)return void scheduleOnRN(z,-1);let i=0,r=1/0,a=0;for(const t of e){const e=Math.abs(n-t);e<r&&(r=e,i=a),a++}scheduleOnRN(z,i)}}},[B,r,z,O,J,E,F]),Q=usePanGesture(K),W=useAnimatedStyle(()=>({top:Math.max(F.value,O)}),...webDeps([O])),Z=useAnimatedStyle(()=>{const e=Math.max(F.value,O),t=w-e;return{height:Math.max(0,Math.min(t,y))}},...webDeps([w,y,O]));return P?_jsx(View,{collapsable:!1,style:StyleSheet.absoluteFill,pointerEvents:"box-none",onLayout:_,testID:E,children:_jsx(Animated.View,{accessibilityLabel:f,testID:E?`${E}-sheet`:void 0,style:[g.sheet,{height:y,backgroundColor:S.colors.surface,borderTopLeftRadius:S.radius.xl,borderTopRightRadius:S.radius.xl,...smoothCorners,...S.shadow.modal},h,W],children:_jsxs(Animated.View,{style:[g.body,Z],children:[_jsx(GestureDetector,{gesture:Q,children:_jsx(View,{style:g.handleRow,accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:v.dragHandle,accessibilityHint:v.swipeHintText,accessibilityValue:{text:fillText(v.snapPointText,{position:j+1,total:N.length})},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:e=>{"increment"===e.nativeEvent.actionName?q(1):"decrement"===e.nativeEvent.actionName&&q(-1)},testID:E?`${E}-handle`:void 0,children:_jsx(View,{style:[g.handle,{backgroundColor:S.colors.border},m]})})}),null!=l?_jsx(Text,{variant:"title",accessibilityRole:"header",children:l}):null,c,a?_jsx(ScrollView,{style:g.scrollContent,children:p}):_jsx(View,{style:g.content,children:p}),u]})})}):null};NonModalBottomSheet.displayName="NonModalBottomSheet";const buildStyles=e=>StyleSheet.create({sheet:{position:"absolute",left:0,right:0,overflow:"hidden"},body:{overflow:"hidden"},handleRow:{alignItems:"center",justifyContent:"center",alignSelf:"stretch",paddingTop:e.space.md,paddingBottom:e.space.xl},handle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},content:{flex:1,overflow:"hidden"},scrollContent:{flex:1}});export{NonModalBottomSheet};export default NonModalBottomSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useMemo,useState}from"react";import{Animated,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useMobileUiText}from"../../text/index.js";import{SKELETON_TEXT}from"../../text/phone/skeleton.g.js";import{useTheme}from"../../theme/index.js";import{toBackgroundImage}from"../../theme/Gradient.js";import{useScreenDimensions}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{useSkeletonClock}from"./SkeletonClock.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{jsx as _jsx}from"react/jsx-runtime";const resolveRadius=(e,t)=>"number"==typeof t?t:e.radius[t],resolveWidth=e=>void 0===e?"100%":e,radiusForShape=(e,t,s,o,i)=>{if(void 0!==i)return resolveRadius(e,i);switch(t){case"circle":return"number"==typeof s?Math.min(s,o)/2:o/2;case"rounded":return e.radius.md;default:return e.radius.sm}},Skeleton=e=>{const{shape:t="rect",width:s="100%",height:o=16,radius:i,variant:r,colors:n,labels:a,style:l,testID:u}=e;assertValidValue("Skeleton","shape",e.shape,["rect","rounded","circle","text"]),assertValidValue("Skeleton","variant",e.variant,["shimmer","pulse","none"]);const m=useTheme(),d=useSkeletonDefaults(),c=useSkeletonClock(),h=useReducedMotion(),p=r??d.variant??"shimmer",S=h&&"auto"===(d.animation??"auto");let k=p;c.enabled?S&&"shimmer"===p&&(k="pulse"):k="none";const x=n?.background??d.colors?.background??m.colors.skeleton,y=n?.highlight??d.colors?.highlight??m.colors["skeleton-highlight"],{responsive:b}=useScreenDimensions(),g=useMemo(()=>buildStyles(),[]),f=useMobileUiText("skeleton",SKELETON_TEXT),v=useMemo(()=>({...f,...a}),[f,a]),j=resolveWidth(s),M=b.size(o),T=radiusForShape(m,t,j,M,i),[w,V]=useState(0),R=useMemo(()=>w<=0?0:Math.max(48,.7*w),[w]),C=useMemo(()=>w<=0?0:c.shimmer.interpolate({inputRange:[0,1],outputRange:[-R,w]}),[c.shimmer,R,w]),
|
|
1
|
+
"use strict";import{useMemo,useState}from"react";import{Animated,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useMobileUiText}from"../../text/index.js";import{SKELETON_TEXT}from"../../text/phone/skeleton.g.js";import{useTheme}from"../../theme/index.js";import{toBackgroundImage}from"../../theme/Gradient.js";import{useScreenDimensions}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{useSkeletonClock}from"./SkeletonClock.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{jsx as _jsx}from"react/jsx-runtime";const resolveRadius=(e,t)=>"number"==typeof t?t:e.radius[t],resolveWidth=e=>void 0===e?"100%":e,radiusForShape=(e,t,s,o,i)=>{if(void 0!==i)return resolveRadius(e,i);switch(t){case"circle":return"number"==typeof s?Math.min(s,o)/2:o/2;case"rounded":return e.radius.md;default:return e.radius.sm}},Skeleton=e=>{const{shape:t="rect",width:s="100%",height:o=16,radius:i,variant:r,colors:n,labels:a,style:l,testID:u}=e;assertValidValue("Skeleton","shape",e.shape,["rect","rounded","circle","text"]),assertValidValue("Skeleton","variant",e.variant,["shimmer","pulse","none"]);const m=useTheme(),d=useSkeletonDefaults(),c=useSkeletonClock(),h=useReducedMotion(),p=r??d.variant??"shimmer",S=h&&"auto"===(d.animation??"auto");let k=p;c.enabled?S&&"shimmer"===p&&(k="pulse"):k="none";const x=n?.background??d.colors?.background??m.colors.skeleton,y=n?.highlight??d.colors?.highlight??m.colors["skeleton-highlight"],{responsive:b}=useScreenDimensions(),g=useMemo(()=>buildStyles(),[]),f=useMobileUiText("skeleton",SKELETON_TEXT),v=useMemo(()=>({...f,...a}),[f,a]),j=resolveWidth(s),M=b.size(o),T=radiusForShape(m,t,j,M,i),[w,V]=useState(0),R=useMemo(()=>w<=0?0:Math.max(48,.7*w),[w]),C=useMemo(()=>w<=0?0:c.shimmer.interpolate({inputRange:[0,1],outputRange:[-R,w]}),[c.shimmer,R,w]),D=useMemo(()=>"none"===k?null:"pulse"===k?_jsx(Animated.View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{backgroundColor:y,opacity:c.pulse.interpolate({inputRange:[0,1],outputRange:[0,.55]})}]}):w<=0?null:_jsx(Animated.View,{pointerEvents:"none",style:[g.shimmerBand,{width:R,transform:[{translateX:C}],backgroundImage:[toBackgroundImage({colors:["transparent",y,"transparent"],locations:[0,.5,1],start:{x:0,y:.5},end:{x:1,y:.5}})]}]}),[k,y,c.pulse,w,g.shimmerBand,R,C]);return _jsx(View,{onLayout:e=>{const t=e.nativeEvent.layout.width;t!==w&&V(t)},accessible:!0,accessibilityLabel:v.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",testID:u,style:[g.base,{width:j,height:M,borderRadius:T,...smoothCorners,backgroundColor:x},l],children:D})};Skeleton.displayName="Skeleton";const SkeletonCircle=({size:e,style:t,...s})=>{const{responsive:o}=useScreenDimensions(),i=o.size(e);return _jsx(Skeleton,{...s,shape:"circle",width:i,height:e,style:t})};SkeletonCircle.displayName="SkeletonCircle";const SkeletonText=({lines:e=3,lastLineWidth:t="60%",spacing:s,fontSize:o,variant:i,radius:r="sm",width:n="100%",labels:a,style:l,testID:u})=>{const m=useTheme(),d=s??m.space.xs,c=Math.max(1,e),h=useMemo(()=>Array.from({length:c},(e,t)=>({key:`sk-text-line-${t}`,index:t})),[c]);return _jsx(View,{style:l,testID:u,children:h.map(e=>{const s=e.index===c-1;return _jsx(Skeleton,{shape:"text",width:s&&c>1?t:n,height:o??m.text.base.size,radius:r,variant:i,labels:a,style:e.index<c-1?{marginBottom:d}:void 0},e.key)})})};SkeletonText.displayName="SkeletonText";const buildStyles=()=>StyleSheet.create({base:{overflow:"hidden"},shimmerBand:{position:"absolute",top:0,bottom:0,left:0}});export{Skeleton,SkeletonCircle,SkeletonText};export default Skeleton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useMobileUiText}from"../../text/index.js";import{SLIDE_TO_CONFIRM_TEXT}from"../../text/phone/slideToConfirm.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SIZE_MAP={sm:{height:44,pad:"xxs"},md:{height:56,pad:"xs"},lg:{height:64,pad:"sm"}},Chevron=({color:e,size:t})=>_jsx(View,{style:{width:0,height:0,borderTopWidth:.4*t,borderBottomWidth:.4*t,borderLeftWidth:.55*t,borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:e,marginLeft:.2*t}});function SlideToConfirm({ref:e,...t}){const{onConfirm:i,label:a,tone:r="primary",size:
|
|
1
|
+
"use strict";import React,{useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useMobileUiText}from"../../text/index.js";import{SLIDE_TO_CONFIRM_TEXT}from"../../text/phone/slideToConfirm.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{webDeps}from"../../utils/animatedDeps.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SIZE_MAP={sm:{height:44,pad:"xxs"},md:{height:56,pad:"xs"},lg:{height:64,pad:"sm"}},Chevron=({color:e,size:t})=>_jsx(View,{style:{width:0,height:0,borderTopWidth:.4*t,borderBottomWidth:.4*t,borderLeftWidth:.55*t,borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:e,marginLeft:.2*t}});function SlideToConfirm({ref:e,...t}){const{onConfirm:i,label:a,tone:r="primary",size:s="md",disabled:o=!1,threshold:n=.9,resetAfter:l=!1,haptic:u,icon:c,labels:d,style:m,trackStyle:h,handleStyle:p,labelStyle:f,testID:b}=t;assertValidValue("SlideToConfirm","tone",t.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("SlideToConfirm","size",t.size,["sm","md","lg"]);const g=useMobileUiText("slideToConfirm",SLIDE_TO_CONFIRM_TEXT),v=useMemo(()=>({...g,...d}),[g,d]),x=useMemo(()=>[{name:"activate",label:v.confirmAction},{name:"increment",label:v.confirmAction}],[v.confirmAction]),y=useTheme(),S=SIZE_MAP[s],C=y.space[S.pad],T=S.height-2*C,w=useMemo(()=>buildStyles(y,S),[y,S]),j=y.colors[r],[A,V]=useState(!1),_=useSharedValue(0),k=useSharedValue(0),M=useSharedValue(0),E=useRef(null),D=useCallback(()=>{const e=resolveHaptic(u,"notificationSuccess");e&&triggerHaptic(e)},[u]),R=useCallback(()=>{V(!1),_.value=withSpring(0,{damping:18,stiffness:160,mass:1})},[_]),I=useCallback(()=>{V(!0),D(),i(),!1!==l&&(E.current&&clearTimeout(E.current),E.current=setTimeout(R,l))},[D,i,l,R]),L=useCallback(e=>{if(o||A)return;const{actionName:t}=e.nativeEvent;"activate"!==t&&"increment"!==t||I()},[o,A,I]);React.useEffect(()=>()=>{cancelAnimation(_),E.current&&clearTimeout(E.current)},[_]);const O=useCallback(e=>{k.value=Math.max(0,e.nativeEvent.layout.width-T-2*C)},[k,T,C]),z=useMemo(()=>{const e=n,t={damping:18,stiffness:160,mass:1},i={duration:y.motion.duration.fast,easing:Easing.out(Easing.cubic)};return{enabled:!o&&!A,minDistance:0,onActivate:()=>{"worklet";M.value=_.value},onUpdate:e=>{"worklet";_.value=Math.min(Math.max(M.value+e.translationX,0),k.value)},onDeactivate:()=>{"worklet";k.value>0&&_.value>=k.value*e?(_.value=withTiming(k.value,i),scheduleOnRN(I)):_.value=withSpring(0,t)}}},[o,A,n,_,k,M,I,y.motion.duration.fast]),N=usePanGesture(z),P=useAnimatedStyle(()=>({transform:[{translateX:_.value}]}),...webDeps([_])),W=useAnimatedStyle(()=>({width:_.value+T+C}),...webDeps([_,T,C])),G=useAnimatedStyle(()=>{const e=k.value>0?k.value:1;return{opacity:Math.max(0,1-_.value/(.6*e))}},...webDeps([k,_]));return _jsxs(View,{ref:e,style:[w.track,{backgroundColor:y.colors["bg-subtle"]},h,m],onLayout:O,testID:b,accessibilityRole:"adjustable",accessibilityLabel:A?v.confirmed:a??v.slide,accessibilityState:{disabled:o},"aria-disabled":o,accessibilityActions:x,onAccessibilityAction:L,children:[_jsx(Animated.View,{style:[w.fill,{backgroundColor:j,opacity:o?.5:1},W],pointerEvents:"none"}),_jsx(Animated.View,{style:[w.labelWrap,G],pointerEvents:"none",children:_jsx(Text,{variant:"body",style:[w.label,{color:y.colors["text-muted"]},f],numberOfLines:1,children:A?v.confirmed:a??v.slide})}),_jsx(GestureDetector,{gesture:N,children:_jsx(Animated.View,{style:[w.handle,{width:T,height:T,borderRadius:y.radius.pill,...smoothCorners,backgroundColor:y.colors.surface,opacity:o?.5:1,...y.shadow.card},p,P],children:c??_jsx(Chevron,{color:j,size:.5*T})})})]})}const buildStyles=(e,t)=>StyleSheet.create({track:{height:t.height,borderRadius:e.radius.pill,...smoothCorners,justifyContent:"center",overflow:"hidden",padding:e.space[t.pad]},fill:{position:"absolute",left:0,top:0,bottom:0,borderRadius:e.radius.pill,...smoothCorners},labelWrap:{position:"absolute",left:t.height,right:t.height},label:{textAlign:"center",includeFontPadding:!1},handle:{alignItems:"center",justifyContent:"center"}});export{SlideToConfirm};export default SlideToConfirm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Platform,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{SLIDER_TEXT}from"../../text/phone/slider.g.js";import{resolveSliderSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{sliderToneInk}from"./valueText.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const VARIANT_SIZE_MAP={inset:{sm:{trackHeight:14,thumbDiameter:10},md:{trackHeight:20,thumbDiameter:14},lg:{trackHeight:26,thumbDiameter:18}},minimal:{sm:{trackHeight:2,thumbDiameter:14},md:{trackHeight:3,thumbDiameter:18},lg:{trackHeight:4,thumbDiameter:22}},bar:{sm:{trackHeight:20,thumbDiameter:20},md:{trackHeight:28,thumbDiameter:28},lg:{trackHeight:36,thumbDiameter:36}}},INSET_RING_RATIO=.3,MIN_THUMB_TOUCH=44,clamp=(e,t,a)=>Math.min(Math.max(e,t),a),snapToStep=(e,t,a,i)=>{if(i<=0)return clamp(e,t,a);const r=Math.round((e-t)/i)*i+t,s=String(i).split(".")[1]?.length??0,n=s>0?Number(r.toFixed(s)):r;return clamp(n,t,a)},BUBBLE_GAP=2,BUBBLE_CARET=8,BUBBLE_WRAP_WIDTH=160,NO_SHADOW={shadowOpacity:0,elevation:0},defaultFormatLabel=e=>String(e),isPair=e=>Array.isArray(e);function Slider({ref:e,...t}){const{min:a=0,max:i=100,step:r=1,disabled:s=!1,tone:n="primary",size:o="md",variant:l="default",showLabel:u=!1,snapThumb:c=!1,formatLabel:d=defaultFormatLabel,renderLabel:m,accessibilityLabel:h,haptic:b,style:g,trackStyle:p,fillStyle:f,thumbStyle:v,labelStyle:w,thumbPressScale:y,labelShowDuration:S,labelOpacity:k,testID:x}=t;assertValidValue("Slider","tone",t.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Slider","size",t.size,["sm","md","lg"]),assertValidValue("Slider","variant",t.variant,["default","inset","minimal","bar"]);const C=useTheme(),A=useMobileUiText("slider",SLIDER_TEXT),V=useMemo(()=>{const e=resolveSliderSize(C,o);return{trackHeight:e["track-height"],thumbDiameter:e["thumb-diameter"]}},[C,o]),D=useMemo(()=>"default"===l?V:VARIANT_SIZE_MAP[l][o],[V,o,l]),j="inset"===l?D.trackHeight/2:0,M=C.settings.components.slider?.thumbPressAnimation??!1,_=y??1.1,T=S??C.motion.duration.fast,E=k??1,R=useMemo(()=>buildStyles(C,D),[C,D]),H=useMemo(()=>({damping:C.motion.spring.snappy.damping,stiffness:C.motion.spring.snappy.stiffness,mass:C.motion.spring.snappy.mass}),[C.motion.spring.snappy]),[O,I]=useState(0),P=C.colors[n],N=sliderToneInk(C,n),L=!0===t.range,W=useCallback(e=>{if(!0!==t.range){if(Array.isArray(e))throw new Error("Slider received a range value in single mode.");t.onChange?.(e)}else{if(!Array.isArray(e))throw new Error("Slider received a single value in range mode.");t.onChange?.(e)}},[t.onChange,t.range]),[X,B]=useControllableState({value:t.value,defaultValue:t.defaultValue??(L?[a,i]:a),onChange:W}),F=useSharedValue(0),G=useSharedValue(0),U=useSharedValue(isPair(X)?X[0]:X),z=useSharedValue(isPair(X)?X[1]:X),$=useSharedValue(0),Z=useSharedValue(0),J=useSharedValue(1),q=useSharedValue(1),K="always"===u,Q=useSharedValue(K?1:0),Y=useSharedValue(K?1:0),ee=useMemo(()=>10**(String(r).split(".")[1]?.length??0),[r]);useEffect(()=>()=>{cancelAnimation(F),cancelAnimation(G),cancelAnimation(J),cancelAnimation(q),cancelAnimation(Q),cancelAnimation(Y)},[F,G,J,q,Q,Y]);const te=useCallback((e,t)=>{const r=t-2*j;return i===a||r<=0?j:j+(e-a)/(i-a)*r},[a,i,j]),ae=useCallback((e,t)=>{const s=t-2*j;if(s<=0)return a;const n=clamp((e-j)/s,0,1);return snapToStep(a+n*(i-a),a,i,r)},[a,i,r,j]),ie=useRef(!1),re=C.motion.duration.fast,se=useRef(X);se.current=X;const ne=useRef(O);ne.current=O;const oe=useCallback((e=!1)=>{const t=ne.current;if(t<=0)return;const place=t=>e?withTiming(t,{duration:re,easing:Easing.out(Easing.cubic)}):t,a=se.current;if(isPair(a)){const[e,i]=a,r=Math.min(e,i),s=Math.max(e,i);U.value=r,z.value=s,F.value=place(te(r,t)),G.value=place(te(s,t))}else{const e=a;U.value=e,z.value=e,F.value=place(te(e,t))}},[te,U,z,F,G,re]),[le,ue]=useState(0),ce=useRef(!1),de=useCallback(e=>{ie.current=e,e||(ce.current=!0,ue(e=>e+1))},[]);useEffect(()=>{if(ie.current)return;const e=ce.current;ce.current=!1,oe(e)},[JSON.stringify(X),O,le,oe]);const me=useCallback(e=>{const t=e.nativeEvent.layout.width;Z.value=t,I(t)},[Z]),he=useCallback((e,t)=>{B(L?[e,t]:e)},[L,B]),be=useCallback(()=>{const e=resolveHaptic(b,"selection");e&&triggerHaptic(e)},[b]),ge=useRef(he);ge.current=he;const pe=useRef(be);pe.current=be;const fe=useCallback((e,t)=>ge.current(e,t),[]),ve=useCallback(()=>pe.current(),[]),we=Math.max(0,(44-D.thumbDiameter)/2),ye=we>0?we:void 0,Se=useCallback(e=>{const t="low"===e?F:G,n="low"===e?U:z,o="low"===e?z:U,l="low"===e?J:q,d="low"===e?Q:Y,m="low"===e,h=a,b=i,g=r,p=ee,f=L,v=_,w=M,y=!0===u,S=c,k=E,C=T,A=H,V=j,D=m&&x?`${x}-pan`:void 0,follow=e=>{"worklet";const a=Z.value-2*V;if(a<=0||!Number.isFinite(e))return;const i=Math.min(Math.max($.value+e,V),Z.value-V);let r=h+(i-V)/a*(b-h);g>0&&(r=Math.round((r-h)/g)*g+h,r=Math.round(r*p)/p),r=Math.min(Math.max(r,h),b),f&&(m&&r>o.value&&(r=o.value),!m&&r<o.value&&(r=o.value)),t.value=S||b===h?b===h?V:V+(r-h)/(b-h)*a:f?m?Math.min(i,G.value):Math.max(i,F.value):i,r!==n.value&&(n.value=r,r!==h&&r!==b||scheduleOnRN(ve),scheduleOnRN(fe,U.value,z.value))};return{enabled:!s,minDistance:0,testID:D,...void 0===ye?{}:{hitSlop:ye},onActivate:()=>{"worklet";scheduleOnRN(de,!0),$.value=t.value,w&&(l.value=withSpring(v,A)),y&&(d.value=withTiming(k,{duration:C,easing:Easing.out(Easing.cubic)})),scheduleOnRN(ve)},onUpdate:e=>{"worklet";follow(e.translationX)},onDeactivate:e=>{"worklet";follow(e.translationX),w&&(l.value=withSpring(1,A)),y&&(d.value=withTiming(0,{duration:C,easing:Easing.out(Easing.cubic)}))},onFinalize:()=>{"worklet";scheduleOnRN(de,!1)}}},[s,a,i,r,ee,L,_,M,u,c,E,T,H,j,ye,x,fe,ve,de,F,G,U,z,J,q,Q,Y,$,Z]),ke=useMemo(()=>Se("low"),[Se]),xe=useMemo(()=>Se("high"),[Se]),Ce=usePanGesture(ke),Ae=usePanGesture(xe),Ve=useCallback(e=>{if(s||L||O<=0)return;const t=clamp(e.nativeEvent.locationX,0,O),a=ae(t,O);a!==U.value&&(be(),U.value=a,F.value=withTiming(te(a,O),{duration:C.motion.duration.fast,easing:Easing.out(Easing.cubic)}),he(a,a))},[s,L,O,ae,te,he,be,F,U,C.motion.duration.fast]),De=useCallback(e=>{if(s)return;const t="increment"===e.nativeEvent.actionName?r:-r,n=r>0?Math.round(t*ee)/ee:t;if(L){const e=Math.round((U.value+n)*ee)/ee,t=clamp(e,a,z.value);t!==U.value&&(U.value=t,F.value=te(t,O),be(),he(t,z.value))}else{const e=Math.round((U.value+n)*ee)/ee,t=clamp(e,a,i);t!==U.value&&(U.value=t,F.value=te(t,O),be(),he(t,t))}},[s,r,ee,L,a,i,te,O,F,U,z,he,be]),je=D.thumbDiameter/2,Me=s?C.colors["surface-disabled"]:P,Te="inset"===l?{backgroundColor:Me,borderColor:C.colors.surface,borderWidth:Math.max(2,Math.round(.3*D.thumbDiameter)),...NO_SHADOW}:"minimal"===l?{backgroundColor:Me,borderWidth:0}:"bar"===l?{backgroundColor:"transparent",borderWidth:0,...NO_SHADOW}:{backgroundColor:C.colors.surface,borderColor:Me},Ee=useAnimatedStyle(()=>{const e=Z.value;if(e<=0)return{opacity:0,transform:[{translateX:0},{scaleX:1}]};const t=s?.55:1;if(L){const a=Math.max(0,G.value-F.value+2*j);return{opacity:t,transform:[{translateX:F.value-j},{scaleX:a/e}]}}return{opacity:t,transform:[{translateX:F.value+j-e},{scaleX:1}]}},[Z,s,L,G,F,j]),Re=useAnimatedStyle(()=>({transform:[{translateX:F.value-je},{scale:J.value}]}),[F,je,J]),He=useAnimatedStyle(()=>({transform:[{translateX:G.value-je},{scale:q.value}]}),[G,je,q]),Oe=useAnimatedStyle(()=>({opacity:Q.value}),[Q]),Ie=useAnimatedStyle(()=>({opacity:Y.value}),[Y]),clampDisplay=e=>clamp(e,a,i),Pe=clampDisplay(isPair(X)?Math.min(...X):X),Ne=clampDisplay(isPair(X)?Math.max(...X):X);return _jsx(View,{ref:e,style:[R.container,g],testID:x,accessibilityRole:"adjustable",accessibilityLabel:h,accessibilityState:{disabled:s},"aria-disabled":s,accessibilityValue:L?{min:a,max:i,now:Pe,text:fillText(A.text,{start:Pe,end:Ne})}:{min:a,max:i,now:Pe},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:De,children:_jsx(Pressable,{onPress:Ve,disabled:s||L,style:R.trackTouch,testID:x?`${x}-track-press`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:_jsxs(View,{style:R.trackWrap,onLayout:me,testID:x?`${x}-track`:void 0,children:[_jsxs(View,{style:R.trackClip,pointerEvents:"none",children:[_jsx(View,{style:[R.track,{backgroundColor:s?C.colors["surface-disabled"]:C.colors.border},p]}),_jsx(Animated.View,{style:[R.fill,{backgroundColor:s?C.colors["surface-disabled"]:P},f,Ee],testID:x?`${x}-fill`:void 0})]}),_jsx(GestureDetector,{gesture:Ce,children:_jsx(Animated.View,{style:[R.thumb,{width:D.thumbDiameter,height:D.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Te,v,Re],testID:x?`${x}-thumb`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[R.bubbleWrap,Oe],pointerEvents:"none",children:[_jsx(View,{style:[R.bubble,{backgroundColor:P}],children:m?m(Pe):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},w],numberOfLines:1,children:d(Pe)})}),_jsx(View,{style:[R.bubbleCaret,{backgroundColor:P}]})]}):null})}),L?_jsx(GestureDetector,{gesture:Ae,children:_jsx(Animated.View,{style:[R.thumb,{width:D.thumbDiameter,height:D.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Te,v,He],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[R.bubbleWrap,Ie],pointerEvents:"none",children:[_jsx(View,{style:[R.bubble,{backgroundColor:P}],children:m?m(Ne):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},w],numberOfLines:1,children:d(Ne)})}),_jsx(View,{style:[R.bubbleCaret,{backgroundColor:P}]})]}):null})}):null]})})})}const buildStyles=(e,t)=>{const a=e.shadow.elevated,i=Math.max(t.thumbDiameter,t.trackHeight),r=i/2+e.space.xs;return StyleSheet.create({container:{width:"100%",paddingVertical:r,justifyContent:"center"},trackTouch:{width:"100%",justifyContent:"center"},trackWrap:{width:"100%",height:i,justifyContent:"center"},trackClip:{position:"absolute",left:0,right:0,height:t.trackHeight,top:(i-t.trackHeight)/2,borderRadius:t.trackHeight/2,...smoothCorners,overflow:"hidden"},track:{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:t.trackHeight/2,...smoothCorners},fill:{position:"absolute",top:0,left:0,width:"100%",height:t.trackHeight,borderRadius:t.trackHeight/2,...smoothCorners,transformOrigin:"left"},thumb:{position:"absolute",top:(i-t.thumbDiameter)/2,left:0,borderWidth:2,shadowColor:a.shadowColor,shadowOffset:a.shadowOffset,shadowOpacity:a.shadowOpacity,shadowRadius:a.shadowRadius,elevation:a.elevation,alignItems:"center",justifyContent:"center"},bubbleWrap:{position:"absolute",bottom:t.thumbDiameter+2,left:t.thumbDiameter/2-80,width:160,alignItems:"center"},bubbleCaret:{width:8,height:8,marginTop:-5,borderRadius:e.radius.none,...smoothCorners,transform:[{rotate:"45deg"}]},bubble:{paddingHorizontal:e.space.sm,paddingVertical:e.space.xxs,borderRadius:e.radius.md,...smoothCorners,minWidth:36,alignItems:"center",justifyContent:"center",...Platform.select({ios:{shadowColor:e.shadow.card.shadowColor,shadowOffset:e.shadow.card.shadowOffset,shadowOpacity:e.shadow.card.shadowOpacity,shadowRadius:e.shadow.card.shadowRadius},android:{elevation:e.shadow.card.elevation},default:{}})}})};export{Slider};export default Slider;
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Platform,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{SLIDER_TEXT}from"../../text/phone/slider.g.js";import{resolveSliderSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{webDeps}from"../../utils/animatedDeps.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{sliderToneInk}from"./valueText.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const VARIANT_SIZE_MAP={inset:{sm:{trackHeight:14,thumbDiameter:10},md:{trackHeight:20,thumbDiameter:14},lg:{trackHeight:26,thumbDiameter:18}},minimal:{sm:{trackHeight:2,thumbDiameter:14},md:{trackHeight:3,thumbDiameter:18},lg:{trackHeight:4,thumbDiameter:22}},bar:{sm:{trackHeight:20,thumbDiameter:20},md:{trackHeight:28,thumbDiameter:28},lg:{trackHeight:36,thumbDiameter:36}}},INSET_RING_RATIO=.3,MIN_THUMB_TOUCH=44,clamp=(e,t,a)=>Math.min(Math.max(e,t),a),snapToStep=(e,t,a,i)=>{if(i<=0)return clamp(e,t,a);const r=Math.round((e-t)/i)*i+t,s=String(i).split(".")[1]?.length??0,n=s>0?Number(r.toFixed(s)):r;return clamp(n,t,a)},BUBBLE_GAP=2,BUBBLE_CARET=8,BUBBLE_WRAP_WIDTH=160,NO_SHADOW={shadowOpacity:0,elevation:0},defaultFormatLabel=e=>String(e),isPair=e=>Array.isArray(e);function Slider({ref:e,...t}){const{min:a=0,max:i=100,step:r=1,disabled:s=!1,tone:n="primary",size:o="md",variant:l="default",showLabel:u=!1,snapThumb:c=!1,formatLabel:d=defaultFormatLabel,renderLabel:m,accessibilityLabel:h,haptic:b,style:p,trackStyle:f,fillStyle:g,thumbStyle:v,labelStyle:w,thumbPressScale:y,labelShowDuration:S,labelOpacity:k,testID:x}=t;assertValidValue("Slider","tone",t.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Slider","size",t.size,["sm","md","lg"]),assertValidValue("Slider","variant",t.variant,["default","inset","minimal","bar"]);const C=useTheme(),D=useMobileUiText("slider",SLIDER_TEXT),A=useMemo(()=>{const e=resolveSliderSize(C,o);return{trackHeight:e["track-height"],thumbDiameter:e["thumb-diameter"]}},[C,o]),V=useMemo(()=>"default"===l?A:VARIANT_SIZE_MAP[l][o],[A,o,l]),j="inset"===l?V.trackHeight/2:0,M=C.settings.components.slider?.thumbPressAnimation??!1,_=y??1.1,T=S??C.motion.duration.fast,E=k??1,R=useMemo(()=>buildStyles(C,V),[C,V]),H=useMemo(()=>({damping:C.motion.spring.snappy.damping,stiffness:C.motion.spring.snappy.stiffness,mass:C.motion.spring.snappy.mass}),[C.motion.spring.snappy]),[O,I]=useState(0),P=C.colors[n],N=sliderToneInk(C,n),L=!0===t.range,W=useCallback(e=>{if(!0!==t.range){if(Array.isArray(e))throw new Error("Slider received a range value in single mode.");t.onChange?.(e)}else{if(!Array.isArray(e))throw new Error("Slider received a single value in range mode.");t.onChange?.(e)}},[t.onChange,t.range]),[X,B]=useControllableState({value:t.value,defaultValue:t.defaultValue??(L?[a,i]:a),onChange:W}),F=useSharedValue(0),G=useSharedValue(0),U=useSharedValue(isPair(X)?X[0]:X),z=useSharedValue(isPair(X)?X[1]:X),$=useSharedValue(0),Z=useSharedValue(0),J=useSharedValue(1),q=useSharedValue(1),K="always"===u,Q=useSharedValue(K?1:0),Y=useSharedValue(K?1:0),ee=useMemo(()=>10**(String(r).split(".")[1]?.length??0),[r]);useEffect(()=>()=>{cancelAnimation(F),cancelAnimation(G),cancelAnimation(J),cancelAnimation(q),cancelAnimation(Q),cancelAnimation(Y)},[F,G,J,q,Q,Y]);const te=useCallback((e,t)=>{const r=t-2*j;return i===a||r<=0?j:j+(e-a)/(i-a)*r},[a,i,j]),ae=useCallback((e,t)=>{const s=t-2*j;if(s<=0)return a;const n=clamp((e-j)/s,0,1);return snapToStep(a+n*(i-a),a,i,r)},[a,i,r,j]),ie=useRef(!1),re=C.motion.duration.fast,se=useRef(X);se.current=X;const ne=useRef(O);ne.current=O;const oe=useCallback((e=!1)=>{const t=ne.current;if(t<=0)return;const place=t=>e?withTiming(t,{duration:re,easing:Easing.out(Easing.cubic)}):t,a=se.current;if(isPair(a)){const[e,i]=a,r=Math.min(e,i),s=Math.max(e,i);U.value=r,z.value=s,F.value=place(te(r,t)),G.value=place(te(s,t))}else{const e=a;U.value=e,z.value=e,F.value=place(te(e,t))}},[te,U,z,F,G,re]),[le,ue]=useState(0),ce=useRef(!1),de=useCallback(e=>{ie.current=e,e||(ce.current=!0,ue(e=>e+1))},[]);useEffect(()=>{if(ie.current)return;const e=ce.current;ce.current=!1,oe(e)},[JSON.stringify(X),O,le,oe]);const me=useCallback(e=>{const t=e.nativeEvent.layout.width;Z.value=t,I(t)},[Z]),he=useCallback((e,t)=>{B(L?[e,t]:e)},[L,B]),be=useCallback(()=>{const e=resolveHaptic(b,"selection");e&&triggerHaptic(e)},[b]),pe=useRef(he);pe.current=he;const fe=useRef(be);fe.current=be;const ge=useCallback((e,t)=>pe.current(e,t),[]),ve=useCallback(()=>fe.current(),[]),we=Math.max(0,(44-V.thumbDiameter)/2),ye=we>0?we:void 0,Se=useCallback(e=>{const t="low"===e?F:G,n="low"===e?U:z,o="low"===e?z:U,l="low"===e?J:q,d="low"===e?Q:Y,m="low"===e,h=a,b=i,p=r,f=ee,g=L,v=_,w=M,y=!0===u,S=c,k=E,C=T,D=H,A=j,V=m&&x?`${x}-pan`:void 0,follow=e=>{"worklet";const a=Z.value-2*A;if(a<=0||!Number.isFinite(e))return;const i=Math.min(Math.max($.value+e,A),Z.value-A);let r=h+(i-A)/a*(b-h);p>0&&(r=Math.round((r-h)/p)*p+h,r=Math.round(r*f)/f),r=Math.min(Math.max(r,h),b),g&&(m&&r>o.value&&(r=o.value),!m&&r<o.value&&(r=o.value)),t.value=S||b===h?b===h?A:A+(r-h)/(b-h)*a:g?m?Math.min(i,G.value):Math.max(i,F.value):i,r!==n.value&&(n.value=r,r!==h&&r!==b||scheduleOnRN(ve),scheduleOnRN(ge,U.value,z.value))};return{enabled:!s,minDistance:0,testID:V,...void 0===ye?{}:{hitSlop:ye},onActivate:()=>{"worklet";scheduleOnRN(de,!0),$.value=t.value,w&&(l.value=withSpring(v,D)),y&&(d.value=withTiming(k,{duration:C,easing:Easing.out(Easing.cubic)})),scheduleOnRN(ve)},onUpdate:e=>{"worklet";follow(e.translationX)},onDeactivate:e=>{"worklet";follow(e.translationX),w&&(l.value=withSpring(1,D)),y&&(d.value=withTiming(0,{duration:C,easing:Easing.out(Easing.cubic)}))},onFinalize:()=>{"worklet";scheduleOnRN(de,!1)}}},[s,a,i,r,ee,L,_,M,u,c,E,T,H,j,ye,x,ge,ve,de,F,G,U,z,J,q,Q,Y,$,Z]),ke=useMemo(()=>Se("low"),[Se]),xe=useMemo(()=>Se("high"),[Se]),Ce=usePanGesture(ke),De=usePanGesture(xe),Ae=useCallback(e=>{if(s||L||O<=0)return;const t=clamp(e.nativeEvent.locationX,0,O),a=ae(t,O);a!==U.value&&(be(),U.value=a,F.value=withTiming(te(a,O),{duration:C.motion.duration.fast,easing:Easing.out(Easing.cubic)}),he(a,a))},[s,L,O,ae,te,he,be,F,U,C.motion.duration.fast]),Ve=useCallback(e=>{if(s)return;const t="increment"===e.nativeEvent.actionName?r:-r,n=r>0?Math.round(t*ee)/ee:t;if(L){const e=Math.round((U.value+n)*ee)/ee,t=clamp(e,a,z.value);t!==U.value&&(U.value=t,F.value=te(t,O),be(),he(t,z.value))}else{const e=Math.round((U.value+n)*ee)/ee,t=clamp(e,a,i);t!==U.value&&(U.value=t,F.value=te(t,O),be(),he(t,t))}},[s,r,ee,L,a,i,te,O,F,U,z,he,be]),je=V.thumbDiameter/2,Me=s?C.colors["surface-disabled"]:P,Te="inset"===l?{backgroundColor:Me,borderColor:C.colors.surface,borderWidth:Math.max(2,Math.round(.3*V.thumbDiameter)),...NO_SHADOW}:"minimal"===l?{backgroundColor:Me,borderWidth:0}:"bar"===l?{backgroundColor:"transparent",borderWidth:0,...NO_SHADOW}:{backgroundColor:C.colors.surface,borderColor:Me},Ee=useAnimatedStyle(()=>{const e=Z.value;if(e<=0)return{opacity:0,transform:[{translateX:0},{scaleX:1}]};const t=s?.55:1;if(L){const a=Math.max(0,G.value-F.value+2*j);return{opacity:t,transform:[{translateX:F.value-j},{scaleX:a/e}]}}return{opacity:t,transform:[{translateX:F.value+j-e},{scaleX:1}]}},...webDeps([Z,s,L,G,F,j])),Re=useAnimatedStyle(()=>({transform:[{translateX:F.value-je},{scale:J.value}]}),...webDeps([F,je,J])),He=useAnimatedStyle(()=>({transform:[{translateX:G.value-je},{scale:q.value}]}),...webDeps([G,je,q])),Oe=useAnimatedStyle(()=>({opacity:Q.value}),...webDeps([Q])),Ie=useAnimatedStyle(()=>({opacity:Y.value}),...webDeps([Y])),clampDisplay=e=>clamp(e,a,i),Pe=clampDisplay(isPair(X)?Math.min(...X):X),Ne=clampDisplay(isPair(X)?Math.max(...X):X);return _jsx(View,{ref:e,style:[R.container,p],testID:x,accessibilityRole:"adjustable",accessibilityLabel:h,accessibilityState:{disabled:s},"aria-disabled":s,accessibilityValue:L?{min:a,max:i,now:Pe,text:fillText(D.text,{start:Pe,end:Ne})}:{min:a,max:i,now:Pe},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:Ve,children:_jsx(Pressable,{onPress:Ae,disabled:s||L,style:R.trackTouch,testID:x?`${x}-track-press`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:_jsxs(View,{style:R.trackWrap,onLayout:me,testID:x?`${x}-track`:void 0,children:[_jsxs(View,{style:R.trackClip,pointerEvents:"none",children:[_jsx(View,{style:[R.track,{backgroundColor:s?C.colors["surface-disabled"]:C.colors.border},f]}),_jsx(Animated.View,{style:[R.fill,{backgroundColor:s?C.colors["surface-disabled"]:P},g,Ee],testID:x?`${x}-fill`:void 0})]}),_jsx(GestureDetector,{gesture:Ce,children:_jsx(Animated.View,{style:[R.thumb,{width:V.thumbDiameter,height:V.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Te,v,Re],testID:x?`${x}-thumb`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[R.bubbleWrap,Oe],pointerEvents:"none",children:[_jsx(View,{style:[R.bubble,{backgroundColor:P}],children:m?m(Pe):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},w],numberOfLines:1,children:d(Pe)})}),_jsx(View,{style:[R.bubbleCaret,{backgroundColor:P}]})]}):null})}),L?_jsx(GestureDetector,{gesture:De,children:_jsx(Animated.View,{style:[R.thumb,{width:V.thumbDiameter,height:V.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Te,v,He],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[R.bubbleWrap,Ie],pointerEvents:"none",children:[_jsx(View,{style:[R.bubble,{backgroundColor:P}],children:m?m(Ne):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},w],numberOfLines:1,children:d(Ne)})}),_jsx(View,{style:[R.bubbleCaret,{backgroundColor:P}]})]}):null})}):null]})})})}const buildStyles=(e,t)=>{const a=e.shadow.elevated,i=Math.max(t.thumbDiameter,t.trackHeight),r=i/2+e.space.xs;return StyleSheet.create({container:{width:"100%",paddingVertical:r,justifyContent:"center"},trackTouch:{width:"100%",justifyContent:"center"},trackWrap:{width:"100%",height:i,justifyContent:"center"},trackClip:{position:"absolute",left:0,right:0,height:t.trackHeight,top:(i-t.trackHeight)/2,borderRadius:t.trackHeight/2,...smoothCorners,overflow:"hidden"},track:{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:t.trackHeight/2,...smoothCorners},fill:{position:"absolute",top:0,left:0,width:"100%",height:t.trackHeight,borderRadius:t.trackHeight/2,...smoothCorners,transformOrigin:"left"},thumb:{position:"absolute",top:(i-t.thumbDiameter)/2,left:0,borderWidth:2,shadowColor:a.shadowColor,shadowOffset:a.shadowOffset,shadowOpacity:a.shadowOpacity,shadowRadius:a.shadowRadius,elevation:a.elevation,alignItems:"center",justifyContent:"center"},bubbleWrap:{position:"absolute",bottom:t.thumbDiameter+2,left:t.thumbDiameter/2-80,width:160,alignItems:"center"},bubbleCaret:{width:8,height:8,marginTop:-5,borderRadius:e.radius.none,...smoothCorners,transform:[{rotate:"45deg"}]},bubble:{paddingHorizontal:e.space.sm,paddingVertical:e.space.xxs,borderRadius:e.radius.md,...smoothCorners,minWidth:36,alignItems:"center",justifyContent:"center",...Platform.select({ios:{shadowColor:e.shadow.card.shadowColor,shadowOffset:e.shadow.card.shadowOffset,shadowOpacity:e.shadow.card.shadowOpacity,shadowRadius:e.shadow.card.shadowRadius},android:{elevation:e.shadow.card.elevation},default:{}})}})};export{Slider};export default Slider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,measure,scrollTo,useAnimatedRef,useAnimatedScrollHandler,useAnimatedStyle,useFrameCallback,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useMobileUiText}from"../../text/index.js";import{SORTABLE_LIST_TEXT}from"../../text/phone/sortableList.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{useScrollHost}from"../Screen/ScrollHost.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const LONG_PRESS_MS=350,EDGE_PX=48,SCROLL_STEP_PX=12,SCROLL_SLACK_PX=1,SPRING_CONFIG={damping:22,stiffness:260,mass:1},ACTION_STEP={moveUp:-1,moveDown:1},noop=e=>{};export function moveItem(e,t,a){const l=e.slice();if(t<0||t>=l.length)return l;const[s]=l.splice(t,1);return void 0===s||l.splice(a,0,s),l}export function topOf(e,t){"worklet";let a=0;for(let l=0;l<t;l++)a+=e[l]??0;return a}export function slotTop(e,t,a){"worklet";let l=0,s=0;for(let o=0;o<e.length&&s<a;o++)o!==t&&(l+=e[o]??0,s++);return l}export function dropIndex(e,t,a){"worklet";const l=topOf(e,t)+(e[t]??0)/2+a;let s=0,o=0;for(let a=0;a<e.length;a++){const r=e[a]??0;a!==t&&o+r/2<l&&s++,o+=r}return s}export function rowShifts(e,t,a){const l=[];let s=0;for(const t of e)l.push(s),s+=t;const o=e.map(()=>0),r=moveItem(e.map((e,t)=>t),t,a);let n=0;for(const t of r)o[t]=n-(l[t]??0),n+=e[t]??0;return o}const buildStyles=e=>StyleSheet.create({handleRow:{flexDirection:"row",alignItems:"center"},handle:{paddingHorizontal:e.space.sm,paddingVertical:e.space.md,gap:e.space.xxs},bar:{width:e.space.md,height:e.space.xxs,backgroundColor:e.colors["text-muted"]},body:{flex:1}});function SortableRow({rowKey:e,index:t,count:a,shift:l,isActive:s,dragging:o,handle:r,disabled:n,shared:u,callbacks:i,labels:c,children:d}){const m=useTheme(),h=useMemo(()=>buildStyles(m),[m]),v=useSharedValue(0);useEffect(()=>{v.value=o&&!s?withSpring(l,SPRING_CONFIG):l},[o,s,l,v]),useEffect(()=>()=>{cancelAnimation(v)},[v]);const f=useAnimatedStyle(()=>({transform:[{translateY:s?u.dragY.value:v.value}],zIndex:s?1:0})
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,measure,scrollTo,useAnimatedRef,useAnimatedScrollHandler,useAnimatedStyle,useFrameCallback,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useMobileUiText}from"../../text/index.js";import{SORTABLE_LIST_TEXT}from"../../text/phone/sortableList.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{webDeps}from"../../utils/animatedDeps.js";import{useScrollHost}from"../Screen/ScrollHost.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const LONG_PRESS_MS=350,EDGE_PX=48,SCROLL_STEP_PX=12,SCROLL_SLACK_PX=1,SPRING_CONFIG={damping:22,stiffness:260,mass:1},ACTION_STEP={moveUp:-1,moveDown:1},noop=e=>{};export function moveItem(e,t,a){const l=e.slice();if(t<0||t>=l.length)return l;const[s]=l.splice(t,1);return void 0===s||l.splice(a,0,s),l}export function topOf(e,t){"worklet";let a=0;for(let l=0;l<t;l++)a+=e[l]??0;return a}export function slotTop(e,t,a){"worklet";let l=0,s=0;for(let o=0;o<e.length&&s<a;o++)o!==t&&(l+=e[o]??0,s++);return l}export function dropIndex(e,t,a){"worklet";const l=topOf(e,t)+(e[t]??0)/2+a;let s=0,o=0;for(let a=0;a<e.length;a++){const r=e[a]??0;a!==t&&o+r/2<l&&s++,o+=r}return s}export function rowShifts(e,t,a){const l=[];let s=0;for(const t of e)l.push(s),s+=t;const o=e.map(()=>0),r=moveItem(e.map((e,t)=>t),t,a);let n=0;for(const t of r)o[t]=n-(l[t]??0),n+=e[t]??0;return o}const buildStyles=e=>StyleSheet.create({handleRow:{flexDirection:"row",alignItems:"center"},handle:{paddingHorizontal:e.space.sm,paddingVertical:e.space.md,gap:e.space.xxs},bar:{width:e.space.md,height:e.space.xxs,backgroundColor:e.colors["text-muted"]},body:{flex:1}});function SortableRow({rowKey:e,index:t,count:a,shift:l,isActive:s,dragging:o,handle:r,disabled:n,shared:u,callbacks:i,labels:c,children:d}){const m=useTheme(),h=useMemo(()=>buildStyles(m),[m]),v=useSharedValue(0);useEffect(()=>{v.value=o&&!s?withSpring(l,SPRING_CONFIG):l},[o,s,l,v]),useEffect(()=>()=>{cancelAnimation(v)},[v]);const f=useAnimatedStyle(()=>({transform:[{translateY:s?u.dragY.value:v.value}],zIndex:s?1:0}),...webDeps([s,u,v])),p=useMemo(()=>{const{dragIndex:e,dropTo:a,dragY:l,translation:s,absoluteY:o,scrollY:c,scrollStart:d,hostOffset:m,hostStart:h,hostTarget:v,heights:f}=u,{onLift:p,onDrop:g,onSettled:S}=i;return{enabled:!n,...r?{}:{activateAfterLongPress:350},onActivate:r=>{"worklet";o.value=r.absoluteY,e.value=t,a.value=t,d.value=c.value,h.value=m.value,v.value=m.value,s.value=0,l.value=0,scheduleOnRN(p,t)},onUpdate:a=>{"worklet";e.value===t&&(s.value=a.translationY,o.value=a.absoluteY)},onFinalize:()=>{"worklet";if(e.value!==t)return;const s=a.value,o=f.value;e.value=-1,l.value=topOf(o,t)+l.value-slotTop(o,t,s),l.value=withSpring(0,SPRING_CONFIG,e=>{"worklet";e&&scheduleOnRN(S)}),scheduleOnRN(g,t,s)}}},[n,r,t,i,u]),g=usePanGesture(p),S=n?[]:[...t>0?[{name:"moveUp",label:c.moveUp}]:[],...t<a-1?[{name:"moveDown",label:c.moveDown}]:[]];return _jsx(Animated.View,{style:f,onLayout:t=>i.onHeight(e,t.nativeEvent.layout.height),accessibilityActions:S,onAccessibilityAction:e=>{if(n)return;const l=t+(ACTION_STEP[e.nativeEvent.actionName]??0);l!==t&&l>=0&&l<a&&i.onMove(t,l)},testID:`sortable-row-${e}`,children:r?_jsxs(View,{style:h.handleRow,children:[_jsx(GestureDetector,{gesture:g,children:_jsxs(View,{style:h.handle,children:[_jsx(View,{style:h.bar}),_jsx(View,{style:h.bar}),_jsx(View,{style:h.bar})]})}),_jsx(View,{style:h.body,children:d})]}):_jsx(GestureDetector,{gesture:g,children:_jsx(View,{children:d})})})}export function SortableList(e){const{data:t,keyExtractor:a,renderItem:l,onReorder:s,handle:o=!1,disabled:r=!1,accessibilityLabel:n,labels:u,testID:i}=e,c=useMobileUiText("sortableList",SORTABLE_LIST_TEXT),d=useMemo(()=>({...c,...u}),[c,u]),m=useMemo(()=>t.map((e,t)=>({key:a(e,t),item:e})),[t,a]),h=useMemo(()=>m.map(e=>e.key),[m]),v=useAnimatedRef(),f=useSharedValue(0),p=useSharedValue(0),g=useSharedValue(0),S=useScrollHost(),b=useSharedValue(0),x=null!==S,w=S?.top??b,y=S?.bottom??b,k=S?.offset??b,_=S?.maxOffset??b,T=S?.scrollTo??noop,A=useSharedValue(0),R=useSharedValue(0),V=useSharedValue(0),I=useSharedValue(0),O=useSharedValue(-1),j=useSharedValue(-1),C=useSharedValue(0),L=useSharedValue([]),M=useRef(new Map),E=useRef(h),[N,D]=useState(null),Y=useCallback(()=>{L.value=E.current.map(e=>M.current.get(e)??0)},[L]);useEffect(()=>{E.current=h,Y()},[h,Y]),useEffect(()=>()=>{cancelAnimation(C)},[C]);const P=useCallback(e=>{D(t=>t?.dragging?{...t,to:e}:t)},[]),G=useFrameCallback(()=>{"worklet";const e=O.value;if(e<0)return;const t=measure(v);if(t){const e=x?Math.max(t.pageY,w.value):t.pageY,a=x?Math.min(t.pageY+t.height,y.value):t.pageY+t.height,l=Math.max(0,g.value-t.height-1);I.value<e+48?f.value>1?scrollTo(v,0,Math.max(0,f.value-12),!1):x&&R.value>0&&(R.value=Math.max(0,R.value-12),scheduleOnRN(T,R.value)):I.value>a-48&&(f.value<l?scrollTo(v,0,Math.min(l,f.value+12),!1):x&&R.value<_.value&&(R.value=Math.min(_.value,R.value+12),scheduleOnRN(T,R.value)))}C.value=V.value+f.value-p.value+k.value-A.value;const a=dropIndex(L.value,e,C.value);a!==j.value&&(j.value=a,scheduleOnRN(P,a))},!1),H=useCallback(e=>{triggerHaptic("longPress"),G.setActive(!0),D({key:h[e]??"",from:e,to:e,dragging:!0})},[G,h]),F=useCallback((e,t)=>{G.setActive(!1),D(e=>e?{...e,to:t,dragging:!1}:e),t!==e&&s(moveItem(h,e,t))},[G,h,s]),U=useCallback(()=>{D(e=>e&&!e.dragging?null:e)},[]),X=useCallback((e,t)=>{s(moveItem(h,e,t))},[h,s]),z=useCallback((e,t)=>{M.current.set(e,t),Y()},[Y]),K=useAnimatedScrollHandler({onScroll:e=>{"worklet";f.value=e.contentOffset.y}}),B=useCallback((e,t)=>{g.value=t},[g]),$=useMemo(()=>({scrollRef:v,scrollY:f,scrollStart:p,hostOffset:k,hostStart:A,hostTarget:R,translation:V,absoluteY:I,dragIndex:O,dropTo:j,dragY:C,heights:L}),[v,f,p,k,A,R,V,I,O,j,C,L]),q=useMemo(()=>({onLift:H,onDrop:F,onSettled:U,onMove:X,onHeight:z}),[H,F,U,X,z]),J=!0===N?.dragging,Q=J&&N?rowShifts(h.map(e=>M.current.get(e)??0),N.from,N.to):null;return _jsx(Animated.ScrollView,{ref:v,onScroll:K,onContentSizeChange:B,scrollEventThrottle:16,scrollEnabled:!J,accessibilityLabel:n,testID:i,children:m.map((e,t)=>{const a=N?.key===e.key;return _jsx(SortableRow,{rowKey:e.key,index:t,count:m.length,shift:Q?.[t]??0,isActive:a,dragging:J,handle:o,disabled:r,shared:$,callbacks:q,labels:d,children:l({item:e.item,index:t,isActive:a})},e.key)})})}SortableList.displayName="SortableList";export default SortableList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useRef}from"react";import{Dimensions,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,useAnimatedStyle,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SPRING_CONFIG={damping:22,stiffness:260,mass:1},DRAG_ACTIVATION_OFFSET=10,RUBBER_BAND_FACTOR=.35,FAIL_OFFSET_Y=15,ACTION_ICON_SIZE=20,toneToBg=(e,t)=>{switch(t){case"primary":return e.colors.primary;case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;default:return e.colors.neutral}},toneToOnColor=(e,t)=>{switch(t){case"primary":return e.colors["on-primary"];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"];default:return e.colors["on-neutral"]}},Swipeable=e=>{const{children:t,leftActions:n,rightActions:s,threshold:i,fullSwipeThreshold:o,onSwipeOpen:r,onSwipeClose:
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useRef}from"react";import{Dimensions,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,useAnimatedStyle,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{webDeps}from"../../utils/animatedDeps.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SPRING_CONFIG={damping:22,stiffness:260,mass:1},DRAG_ACTIVATION_OFFSET=10,RUBBER_BAND_FACTOR=.35,FAIL_OFFSET_Y=15,ACTION_ICON_SIZE=20,toneToBg=(e,t)=>{switch(t){case"primary":return e.colors.primary;case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;default:return e.colors.neutral}},toneToOnColor=(e,t)=>{switch(t){case"primary":return e.colors["on-primary"];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"];default:return e.colors["on-neutral"]}},Swipeable=e=>{const{children:t,leftActions:n,rightActions:s,threshold:i,fullSwipeThreshold:o,onSwipeOpen:r,onSwipeClose:a,disabled:l=!1,haptic:c,style:u,contentStyle:d,actionStyle:m,accessibilityLabel:h,testID:p}=e,b=useTheme(),w=i??80,S=o??200,f=useMemo(()=>buildStyles(b),[b]),g=useMemo(()=>buildActionStyles(b),[b]),y=!!n&&n.length>0,v=!!s&&s.length>0,x=Dimensions.get("window").width,A=y?w*(n?.length??0):0,I=v?w*(s?.length??0):0,_=useSharedValue(0),N=useSharedValue(0),C=useRef(null);useEffect(()=>()=>{cancelAnimation(_),cancelAnimation(N)},[_,N]);const O=useCallback(e=>{C.current!==e&&(C.current=e,r?.(e))},[r]),R=useCallback(()=>{null!==C.current&&(C.current=null,a?.())},[a]),j=useCallback(e=>{const t="left"===e?n:s,i=t?.[0];i&&(!1!==c&&triggerHaptic("notificationSuccess"),i.onPress(),_.value=withSpring(0,SPRING_CONFIG),C.current=null,a?.())},[n,s,_,a,c]),G=useCallback(()=>{_.value=withSpring(0,SPRING_CONFIG),R()},[_,R]),k=useCallback(e=>{const t=resolveHaptic(c,"selection");t&&triggerHaptic(t),e.onPress(),G()},[G,c]),P=useMemo(()=>{const e=A,t=I,n=S,s=-S,i=x,o=-x,r=w,a=y,c=v;return{enabled:!l,testID:p?`${p}-gesture`:"swipeable-gesture",activeOffsetX:[-10,10],failOffsetY:[-15,15],onActivate:()=>{"worklet";N.value=_.value},onUpdate:n=>{"worklet";const s=N.value+n.translationX;_.value=s>0&&!a||s<0&&!c?0:s>e&&a?e+.35*(s-e):s<-t&&c?.35*(s+t)-t:s},onDeactivate:()=>{"worklet";const l=_.value;return a&&l>=n?(_.value=withSpring(i,SPRING_CONFIG),void scheduleOnRN(j,"left")):c&&l<=s?(_.value=withSpring(o,SPRING_CONFIG),void scheduleOnRN(j,"right")):a&&l>=r?(_.value=withSpring(e,SPRING_CONFIG),void scheduleOnRN(O,"left")):c&&l<=-r?(_.value=withSpring(-t,SPRING_CONFIG),void scheduleOnRN(O,"right")):(_.value=withSpring(0,SPRING_CONFIG),void scheduleOnRN(R))}}},[l,N,j,S,y,v,A,R,O,I,x,w,_,p]),D=usePanGesture(P),T=useAnimatedStyle(()=>({transform:[{translateX:_.value}]}),...webDeps([_])),V=useAnimatedStyle(()=>({opacity:A>0?Math.min(1,Math.max(0,_.value/A)):0}),...webDeps([A,_])),F=useAnimatedStyle(()=>({opacity:I>0?Math.min(1,Math.max(0,-_.value/I)):0}),...webDeps([I,_])),E=useMemo(()=>{const e=[];return n?.forEach(t=>{e.push({name:t.key,label:t.label})}),s?.forEach(t=>{e.push({name:t.key,label:t.label})}),e},[n,s]),B=useCallback(e=>{const t=e.nativeEvent.actionName,i=[...n??[],...s??[]].find(e=>e.key===t);i&&(!1!==c&&triggerHaptic("selection"),i.onPress())},[n,s,c]);return y||v?_jsxs(View,{style:[f.root,u],testID:p,accessibilityLabel:h,accessibilityActions:E,onAccessibilityAction:B,children:[y?_jsx(Animated.View,{style:[f.actionsRow,f.actionsLeft,{width:A},m,V],pointerEvents:"box-none",children:n?.map(e=>_jsx(ActionButton,{action:e,theme:b,actionStyles:g,width:w,onPress:k},e.key))}):null,v?_jsx(Animated.View,{style:[f.actionsRow,f.actionsRight,{width:I},m,F],pointerEvents:"box-none",children:s?.map(e=>_jsx(ActionButton,{action:e,theme:b,actionStyles:g,width:w,onPress:k},e.key))}):null,_jsx(GestureDetector,{gesture:D,children:_jsx(Animated.View,{style:[f.content,d,T],children:t})})]}):_jsx(View,{style:u,testID:p,children:t})};Swipeable.displayName="Swipeable";const ActionButton=({action:e,theme:t,actionStyles:n,width:s,onPress:i})=>{assertValidValue("Swipeable","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const o=e.tone??"neutral",r=toneToBg(t,o),a=renderSlotIcon(e.icon,{color:toneToOnColor(t,o),size:20,disabled:!1}),l=Boolean(a);return _jsxs(Pressable,{onPress:()=>i(e),accessibilityRole:"button",accessibilityLabel:e.label,style:[n.button,{width:s,backgroundColor:r,paddingHorizontal:t.space.sm}],children:[l?_jsx(View,{style:n.icon,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:a}):null,_jsx(Text,{variant:"bodySmall",weight:"semibold",style:[n.label,{color:toneToOnColor(t,o)}],numberOfLines:1,children:e.label})]})},buildActionStyles=e=>StyleSheet.create({button:{flexGrow:0,flexShrink:0,alignItems:"center",justifyContent:"center"},icon:{marginBottom:e.space.xxs},label:{textAlign:"center"}}),buildStyles=e=>StyleSheet.create({root:{position:"relative",overflow:"hidden"},content:{backgroundColor:"transparent"},actionsRow:{position:"absolute",top:0,bottom:0,flexDirection:"row"},actionsLeft:{left:0},actionsRight:{right:0,justifyContent:"flex-end"}});export{Swipeable};export default Swipeable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useEffect,useMemo}from"react";import{StyleSheet,View}from"react-native";import Animated,{cancelAnimation,useAnimatedStyle,useSharedValue,withDelay,withRepeat,withSequence,withTiming}from"react-native-reanimated";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useMobileUiText}from"../../text/index.js";import{TYPING_INDICATOR_TEXT}from"../../text/phone/typingIndicator.g.js";import{useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DOT=6,DIM=.3,PULSE_MS=400,STAGGER_MS=160,STILL_OPACITY=[1,.65,.3],DOT_NAMES=["first","second","third"],Dot=({index:e,still:t,colour:i,dotStyle:s})=>{const o=useSharedValue(.3);useEffect(()=>{if(!t)return o.value=withDelay(160*e,withRepeat(withSequence(withTiming(1,{duration:400}),withTiming(.3,{duration:400})),-1)),()=>cancelAnimation(o)},[t,e,o]);const r=useAnimatedStyle(()=>({opacity:o.value})
|
|
1
|
+
"use strict";import{useEffect,useMemo}from"react";import{StyleSheet,View}from"react-native";import Animated,{cancelAnimation,useAnimatedStyle,useSharedValue,withDelay,withRepeat,withSequence,withTiming}from"react-native-reanimated";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useMobileUiText}from"../../text/index.js";import{TYPING_INDICATOR_TEXT}from"../../text/phone/typingIndicator.g.js";import{useTheme}from"../../theme/index.js";import{webDeps}from"../../utils/animatedDeps.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DOT=6,DIM=.3,PULSE_MS=400,STAGGER_MS=160,STILL_OPACITY=[1,.65,.3],DOT_NAMES=["first","second","third"],Dot=({index:e,still:t,colour:i,dotStyle:s})=>{const o=useSharedValue(.3);useEffect(()=>{if(!t)return o.value=withDelay(160*e,withRepeat(withSequence(withTiming(1,{duration:400}),withTiming(.3,{duration:400})),-1)),()=>cancelAnimation(o)},[t,e,o]);const r=useAnimatedStyle(()=>({opacity:o.value}),...webDeps([o]));return _jsx(Animated.View,{style:[s,{backgroundColor:i},t?{opacity:STILL_OPACITY[e]}:r]})};export const TypingIndicator=({label:e,accessibilityLabel:t,labels:i,bubble:s=!0,style:o,testID:r})=>{const a=useTheme(),l=useMemo(()=>buildStyles(a),[a]),n=useReducedMotion(),c=a.colors["text-subtle"],d=useMobileUiText("typingIndicator",TYPING_INDICATOR_TEXT),u=useMemo(()=>({...d,...i}),[d,i]);return _jsxs(View,{style:[l.root,s?l.bubble:null,o],accessible:!0,accessibilityRole:"progressbar",accessibilityLabel:e??t??u.typing,accessibilityState:{busy:!0},"aria-busy":!0,testID:r,children:[_jsx(View,{style:l.dots,children:DOT_NAMES.map((e,t)=>_jsx(Dot,{index:t,still:n,colour:c,dotStyle:l.dot},e))}),e?_jsx(Text,{variant:"bodySmall",color:"secondary",children:e}):null]})};const buildStyles=e=>StyleSheet.create({dot:{width:6,height:6,borderRadius:e.radius.pill,...smoothCorners},root:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",gap:e.space.sm,marginTop:e.space.sm},bubble:{backgroundColor:e.colors["bg-subtle"],borderRadius:e.radius.xl,...smoothCorners,paddingHorizontal:e.space.md,paddingVertical:e.space.sm+e.space.xs},dots:{flexDirection:"row",alignItems:"center",gap:e.space.xs}});export default TypingIndicator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo}from"react";import{StyleSheet}from"react-native";import{GestureDetector,useCompetingGestures,usePanGesture,usePinchGesture,useTapGesture}from"react-native-gesture-handler";import Animated,{useAnimatedStyle,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_MAX_SCALE=4,DEFAULT_MIN_SCALE=1,DEFAULT_DOUBLE_TAP_SCALE=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1};export const ZoomableImage=({children:e,maxScale:a=4,minScale:t=1,doubleTapScale:l=2,disabled:
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo}from"react";import{StyleSheet}from"react-native";import{GestureDetector,useCompetingGestures,usePanGesture,usePinchGesture,useTapGesture}from"react-native-gesture-handler";import Animated,{useAnimatedStyle,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{webDeps}from"../../utils/animatedDeps.js";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_MAX_SCALE=4,DEFAULT_MIN_SCALE=1,DEFAULT_DOUBLE_TAP_SCALE=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1};export const ZoomableImage=({children:e,maxScale:a=4,minScale:t=1,doubleTapScale:l=2,disabled:s=!1,haptic:i,style:u,accessibilityLabel:r,testID:n})=>{const o=useSharedValue(1),v=useSharedValue(1),c=useSharedValue(0),m=useSharedValue(0),S=useSharedValue(0),d=useSharedValue(0),p=useCallback(()=>{o.value=withSpring(1,SPRING_CONFIG),v.value=1,c.value=withSpring(0,SPRING_CONFIG),m.value=withSpring(0,SPRING_CONFIG),S.value=0,d.value=0},[o,v,c,m,S,d]);useEffect(()=>{s&&p()},[s,p]);const h=useCallback(()=>{const e=resolveHaptic(i,"impactLight");e&&triggerHaptic(e)},[i]),G=useMemo(()=>({enabled:!s,onActivate:()=>{"worklet";v.value=o.value},onUpdate:e=>{"worklet";const l=v.value*e.scale;o.value=l<t?t+.3*(l-t):l>a?a+.2*(l-a):l},onDeactivate:()=>{"worklet";return o.value<t?(o.value=withSpring(t,SPRING_CONFIG),c.value=withSpring(0,SPRING_CONFIG),m.value=withSpring(0,SPRING_CONFIG),v.value=t,S.value=0,void(d.value=0)):o.value>a?(o.value=withSpring(a,SPRING_CONFIG),void(v.value=a)):void(v.value=o.value)}}),[s,o,v,c,m,S,d,t,a]),I=usePinchGesture(G),g=useMemo(()=>({enabled:!s,minPointers:1,maxPointers:1,onActivate:()=>{"worklet";S.value=c.value,d.value=m.value},onUpdate:e=>{"worklet";o.value<=1||(c.value=S.value+e.translationX,m.value=d.value+e.translationY)},onDeactivate:()=>{"worklet";S.value=c.value,d.value=m.value}}),[s,o,c,m,S,d]),N=usePanGesture(g),w=useMemo(()=>({enabled:!s,numberOfTaps:2,onDeactivate:()=>{"worklet";scheduleOnRN(h),o.value>1?(o.value=withSpring(1,SPRING_CONFIG),c.value=withSpring(0,SPRING_CONFIG),m.value=withSpring(0,SPRING_CONFIG),v.value=1,S.value=0,d.value=0):(o.value=withSpring(l,SPRING_CONFIG),v.value=l)}}),[s,o,v,c,m,S,d,h,l]),_=useTapGesture(w),b=useCompetingGestures(I,N,_),C=useAnimatedStyle(()=>({transform:[{translateX:c.value},{translateY:m.value},{scale:o.value}]}),...webDeps([c,m,o]));return _jsx(GestureDetector,{gesture:b,children:_jsx(Animated.View,{style:[styles.container,u],testID:n,accessibilityLabel:r,accessibilityState:{disabled:s},"aria-disabled":s,children:_jsx(Animated.View,{style:[styles.content,C],children:e})})})};ZoomableImage.displayName="ZoomableImage";const styles=StyleSheet.create({container:{flex:1,alignItems:"center",justifyContent:"center",overflow:"hidden"},content:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center"}});export default ZoomableImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_START={x:.5,y:0},DEFAULT_END={x:.5,y:1},round=t=>Math.round(1e3*t)/1e3;export const gradientAngle=(t=DEFAULT_START,r=DEFAULT_END)=>{const
|
|
1
|
+
"use strict";import{View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_START={x:.5,y:0},DEFAULT_END={x:.5,y:1},round=t=>Math.round(1e3*t)/1e3;export const gradientAngle=(t=DEFAULT_START,r=DEFAULT_END)=>{const o=180*Math.atan2(r.x-t.x,t.y-r.y)/Math.PI;return round((o%360+360)%360)};export const toBackgroundImage=t=>{const r=t.colors.length-1;return{type:"linear-gradient",direction:`${gradientAngle(t.start,t.end)}deg`,colorStops:t.colors.map((o,e)=>{const n=t.locations?.[e]??(0===r?0:e/r);return{color:o,positions:[`${round(100*n)}%`]}})}};export const Gradient=({gradient:t,style:r,children:o})=>_jsx(View,{style:[{backgroundImage:[toBackgroundImage(t)]},r],children:o});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const COLOR_NAMES=["bg","bg-subtle","bg-muted","surface","surface-inverse","surface-dark","surface-dark-border","on-surface-dark","on-surface-dark-muted","surface-ink","text","text-body","text-muted","text-subtle","text-inverse","link","border","border-subtle","field-bg","field-border","field-border-focus","focus-ring","scrim","on-scrim","thumb","primary","primary-hover","primary-soft","primary-text","on-primary","primary-wash","primary-wash-strong","neutral","neutral-hover","neutral-text","on-neutral","success","success-soft","success-text","on-success","warning","warning-soft","warning-text","on-warning","danger","danger-soft","danger-border","danger-text","offline-fill","online-fill","on-danger","info","info-soft","info-text","on-info","primary-pressed","switch-thumb","on-neutral-strong","text-disabled","surface-pressed","surface-hover","surface-selected","surface-disabled","skeleton","skeleton-highlight","glass-fill","glass-border","on-glass","glass-badge","field-bg-focus","field-bg-disabled","field-border-error","field-label","field-text","field-text-disabled","field-placeholder","field-placeholder-disabled","field-icon","field-icon-focus","field-icon-disabled","field-caret","field-message","avatar-1","avatar-2","avatar-3","avatar-4","avatar-5","avatar-6","avatar-7","avatar-8"];export const SPACE_NAMES=["none","xxs","xs","sm","md","lg","xl","2xl","3xl","4xl"];export const RADIUS_NAMES=["none","sm","md","lg","xl","2xl","3xl","pill"];export const TEXT_NAMES=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl"];export const WEIGHT_NAMES=["normal","medium","semibold","bold"];export const LEADING_NAMES=["heading","body","display"];export const LETTER_SPACING_NAMES=["tight","normal","wide"];export const FONT_NAMES=["ui","display","mono"];export const SHADOW_NAMES=["card","elevated","popover","modal","drawer"];export const DURATION_NAMES=["instant","fast","default","slow","slower"];export const EASE_NAMES=["in-out","accelerate","decelerate","sharp"];export const SIZE_NAMES=["border"];export const COMPONENT_KINDS={field:{radius:"radius","padding-x":"space","padding-y":"space","min-height":"px",text:"text",icon:"px","label-text":"text","label-gap":"space","message-text":"text","message-gap":"space"},press:{opacity:"number"},disabled:{opacity:"number"},button:{"padding-x":"space","padding-y":"space","min-height":"px",text:"text",radius:"radius",icon:"px","badge-icon":"px"},input:{"multiline-min-height":"px"},"search-bar":{radius:"radius"},"empty-state":{icon:"px","illustration-size":"px","title-text":"text","description-text":"text","padding-y":"space","title-gap":"space","description-gap":"space"},"list-item":{"padding-y":"space","title-text":"text","subtitle-text":"text","min-height":"px"},badge:{text:"text","min-width":"px",height:"px","padding-x":"space","dot-size":"px","border-width":"px","anchor-offset":"px"},chip:{"padding-x":"space","padding-y":"space",text:"text","min-height":"px","close-size":"px","close-text":"text",gap:"space",icon:"px"},checkbox:{"box-size":"px","label-gap":"space"},radio:{outer:"px",inner:"px","label-gap":"space"},switch:{"track-width":"px","track-height":"px","thumb-size":"px",padding:"space"},"otp-input":{cell:"px",text:"text",radius:"radius",gap:"space"},"segmented-control":{height:"px",text:"text","padding-x":"space",icon:"px","track-padding":"space","underline-height":"px","pill-inset":"space"},tabs:{text:"text","padding-y":"space","padding-x":"space","scrollable-padding-x":"space",icon:"px","icon-gap":"space","track-padding":"space","underline-height":"px","pill-inset":"space","disabled-opacity":"number","badge-gap":"space"},slider:{"track-height":"px","thumb-diameter":"px"},"floating-action-button":{diameter:"px",icon:"px",text:"text","label-padding-x":"space","edge-offset":"space","bottom-offset":"space","secondary-gap":"space","stagger-ms":"ms"},dialog:{"icon-wrapper-size":"px","action-button-min-height":"px"},toast:{"icon-circle-size":"px","icon-glyph-text":"text","tint-bar-width":"px","action-min-height":"px"},banner:{"tint-bar-width":"px"},screen:{gutter:"space"}};export const lightTokens={mode:"light",colors:{bg:"#ffffff","bg-subtle":"#f8f8fb","bg-muted":"#f1f1f5",surface:"#ffffff","surface-inverse":"#0f0f1a","surface-dark":"#071437","surface-dark-border":"#2a3553","on-surface-dark":"#ffffff","on-surface-dark-muted":"#babdc7","surface-ink":"#0b0e16",text:"#252f4a","text-body":"#0f0f1a","text-muted":"#52525b","text-subtle":"#62626b","text-inverse":"#ffffff",link:"#4f46e5",border:"#e5e5ec","border-subtle":"#efeff3","field-bg":"#f9fbfc","field-border":"#ebedf3","field-border-focus":"#bed2f9","focus-ring":"#4f46e5",scrim:"#0f0f1a80","on-scrim":"#ffffff",thumb:"#ffffff",primary:"#4f46e5","primary-hover":"#4338ca","primary-soft":"#e0e7ff","primary-text":"#4f46e5","on-primary":"#ffffff","primary-wash":"#4f46e514","primary-wash-strong":"#4f46e533",neutral:"#f4f4f8","neutral-hover":"#e9e9f0","neutral-text":"#52525b","on-neutral":"#0f0f1a",success:"#18864f","success-soft":"#e8faee","success-text":"#147042","on-success":"#ffffff",warning:"#f59e0b","warning-soft":"#fff8e6","warning-text":"#8f5c06","on-warning":"#0f0f1a",danger:"#e12c32","danger-soft":"#ffeaef","danger-border":"#e5484d","danger-text":"#bc1b20","offline-fill":"#e82646","online-fill":"#04b440","on-danger":"#ffffff",info:"#1b6ef5","info-soft":"#e9f3ff","info-text":"#0958d9","on-info":"#ffffff","primary-pressed":"#3730a3","switch-thumb":"#ffffff","on-neutral-strong":"#ffffff","text-disabled":"#b4b4bb","surface-pressed":"#0f0f1a0f","surface-hover":"#0f0f1a0a","surface-selected":"#4f46e51a","surface-disabled":"#f1f1f5",skeleton:"#ebedf3","skeleton-highlight":"#f5f6fa","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#ffffff","field-bg-disabled":"#f5f6fa","field-border-error":"#fdbfce","field-label":"#242f4a","field-text":"#252f4a","field-text-disabled":"#7a8197","field-placeholder":"#626d8b","field-placeholder-disabled":"#7a8197","field-icon":"#7a849f","field-icon-focus":"#4b5675","field-icon-disabled":"#c4cada","field-caret":"#5b8dee","field-message":"#d81736","avatar-1":"#4f46e5","avatar-2":"#0a7979","avatar-3":"#a45a05","avatar-4":"#cd226e","avatar-5":"#2462eb","avatar-6":"#7c3aed","avatar-7":"#047c57","avatar-8":"#d42222"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,"2xl":18,"3xl":20,pill:9999},text:{xs:{size:11},sm:{size:13},base:{size:15},lg:{size:17},xl:{size:20},"2xl":{size:24},"3xl":{size:30},"4xl":{size:36},"5xl":{size:45},"6xl":{size:57},"7xl":{size:64},"8xl":{size:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{heading:1.2,body:1.4,display:1.2},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.059,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.078,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.102,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":35,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":40,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"sm","min-height":45,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"illustration-size":96,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"illustration-size":160,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"illustration-size":240,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0},screen:{gutter:"lg"}}};export const darkTokens={mode:"dark",colors:{bg:"#0b0b12","bg-subtle":"#13131c","bg-muted":"#1c1c26",surface:"#1c1c26","surface-inverse":"#fafafa","surface-dark":"#071437","surface-dark-border":"#2a3553","on-surface-dark":"#ffffff","on-surface-dark-muted":"#babdc7","surface-ink":"#0b0e16",text:"#e2e2e2","text-body":"#fafafa","text-muted":"#b4b4bb","text-subtle":"#919199","text-inverse":"#0f0f1a",link:"#9292ee",border:"#27272f","border-subtle":"#1c1c26","field-bg":"#13131c","field-border":"#27272f","field-border-focus":"#3d5fb0","focus-ring":"#7c7ce8",scrim:"#000000a6","on-scrim":"#ffffff",thumb:"#3a3e49",primary:"#7c7ce8","primary-hover":"#9292ee","primary-soft":"#1f1f3d","primary-text":"#8989ea","on-primary":"#0f0f1a","primary-wash":"#7c7ce814","primary-wash-strong":"#7c7ce833",neutral:"#1f1f26","neutral-hover":"#2a2a33","neutral-text":"#b4b4bb","on-neutral":"#fafafa",success:"#30c780","success-soft":"#04b4402e","success-text":"#30c780","on-success":"#0f0f1a",warning:"#fbbf24","warning-soft":"#dfa0002e","warning-text":"#fbbf24","on-warning":"#0f0f1a",danger:"#f87171","danger-soft":"#e826462e","danger-border":"#f87171","danger-text":"#f87171","offline-fill":"#e82646","online-fill":"#04b440","on-danger":"#0f0f1a",info:"#60a5fa","info-soft":"#056ee92e","info-text":"#60a5fa","on-info":"#0f0f1a","primary-pressed":"#a8a8f2","switch-thumb":"#ffffff","on-neutral-strong":"#0f0f1a","text-disabled":"#52525b","surface-pressed":"#ffffff14","surface-hover":"#ffffff0d","surface-selected":"#7c7ce82e","surface-disabled":"#1c1c26",skeleton:"#1c1c26","skeleton-highlight":"#27272f","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#0b0b12","field-bg-disabled":"#1c1c26","field-border-error":"#8a2f42","field-label":"#e4e6ee","field-text":"#fafafa","field-text-disabled":"#71717a","field-placeholder":"#84848d","field-placeholder-disabled":"#71717a","field-icon":"#8b8b95","field-icon-focus":"#d4d4db","field-icon-disabled":"#52525b","field-caret":"#7c9ef0","field-message":"#f87171","avatar-1":"#8b8bee","avatar-2":"#2dd4bf","avatar-3":"#fcd34d","avatar-4":"#f472b6","avatar-5":"#60a5fa","avatar-6":"#a78bfa","avatar-7":"#34d399","avatar-8":"#f87171"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,"2xl":18,"3xl":20,pill:9999},text:{xs:{size:11},sm:{size:13},base:{size:15},lg:{size:17},xl:{size:20},"2xl":{size:24},"3xl":{size:30},"4xl":{size:36},"5xl":{size:45},"6xl":{size:57},"7xl":{size:64},"8xl":{size:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{heading:1.2,body:1.4,display:1.2},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.4,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.502,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.549,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":35,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":40,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"sm","min-height":45,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"illustration-size":96,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"illustration-size":160,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"illustration-size":240,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0},screen:{gutter:"lg"}}};
|
|
1
|
+
"use strict";export const COLOR_NAMES=["bg","bg-subtle","bg-muted","surface","surface-inverse","surface-dark","surface-dark-border","on-surface-dark","on-surface-dark-muted","surface-ink","text","text-body","text-muted","text-subtle","text-inverse","link","border","border-subtle","field-bg","field-border","field-border-focus","focus-ring","scrim","on-scrim","thumb","primary","primary-hover","primary-pressed","primary-soft","primary-text","on-primary","primary-wash","primary-wash-strong","neutral","neutral-hover","neutral-text","on-neutral","success","success-soft","success-text","on-success","warning","warning-soft","warning-text","on-warning","danger","danger-soft","danger-border","danger-text","offline-fill","online-fill","on-danger","info","info-soft","info-text","on-info","switch-thumb","on-neutral-strong","text-disabled","surface-pressed","surface-hover","surface-selected","surface-disabled","skeleton","skeleton-highlight","glass-fill","glass-border","on-glass","glass-badge","field-bg-focus","field-bg-disabled","field-border-error","field-label","field-text","field-text-disabled","field-placeholder","field-placeholder-disabled","field-icon","field-icon-focus","field-icon-disabled","field-caret","field-message","avatar-1","avatar-2","avatar-3","avatar-4","avatar-5","avatar-6","avatar-7","avatar-8"];export const SPACE_NAMES=["none","xxs","xs","sm","md","lg","xl","2xl","3xl","4xl"];export const RADIUS_NAMES=["none","sm","md","lg","xl","2xl","3xl","pill"];export const TEXT_NAMES=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl"];export const WEIGHT_NAMES=["normal","medium","semibold","bold"];export const LEADING_NAMES=["heading","body","display"];export const LETTER_SPACING_NAMES=["tight","normal","wide"];export const FONT_NAMES=["ui","display","mono"];export const SHADOW_NAMES=["card","elevated","popover","modal","drawer"];export const DURATION_NAMES=["instant","fast","default","slow","slower"];export const EASE_NAMES=["in-out","accelerate","decelerate","sharp"];export const SIZE_NAMES=["border"];export const COMPONENT_KINDS={field:{radius:"radius","padding-x":"space","padding-y":"space","min-height":"px",text:"text",icon:"px","label-text":"text","label-gap":"space","message-text":"text","message-gap":"space"},press:{opacity:"number"},disabled:{opacity:"number"},button:{"padding-x":"space","padding-y":"space","min-height":"px",text:"text",radius:"radius",icon:"px","badge-icon":"px"},input:{"multiline-min-height":"px"},"search-bar":{radius:"radius"},"empty-state":{icon:"px","illustration-size":"px","title-text":"text","description-text":"text","padding-y":"space","title-gap":"space","description-gap":"space"},"list-item":{"padding-y":"space","title-text":"text","subtitle-text":"text","min-height":"px"},badge:{text:"text","min-width":"px",height:"px","padding-x":"space","dot-size":"px","border-width":"px","anchor-offset":"px"},chip:{"padding-x":"space","padding-y":"space",text:"text","min-height":"px","close-size":"px","close-text":"text",gap:"space",icon:"px"},checkbox:{"box-size":"px","label-gap":"space"},radio:{outer:"px",inner:"px","label-gap":"space"},switch:{"track-width":"px","track-height":"px","thumb-size":"px",padding:"space"},"otp-input":{cell:"px",text:"text",radius:"radius",gap:"space"},"segmented-control":{height:"px",text:"text","padding-x":"space",icon:"px","track-padding":"space","underline-height":"px","pill-inset":"space"},tabs:{text:"text","padding-y":"space","padding-x":"space","scrollable-padding-x":"space",icon:"px","icon-gap":"space","track-padding":"space","underline-height":"px","pill-inset":"space","disabled-opacity":"number","badge-gap":"space"},slider:{"track-height":"px","thumb-diameter":"px"},"floating-action-button":{diameter:"px",icon:"px",text:"text","label-padding-x":"space","edge-offset":"space","bottom-offset":"space","secondary-gap":"space","stagger-ms":"ms"},dialog:{"icon-wrapper-size":"px","action-button-min-height":"px"},toast:{"icon-circle-size":"px","icon-glyph-text":"text","tint-bar-width":"px","action-min-height":"px"},banner:{"tint-bar-width":"px"},screen:{gutter:"space"}};export const lightTokens={mode:"light",colors:{bg:"#ffffff","bg-subtle":"#f8f8fb","bg-muted":"#f1f1f5",surface:"#ffffff","surface-inverse":"#0f0f1a","surface-dark":"#071437","surface-dark-border":"#2a3553","on-surface-dark":"#ffffff","on-surface-dark-muted":"#babdc7","surface-ink":"#0b0e16",text:"#252f4a","text-body":"#0f0f1a","text-muted":"#52525b","text-subtle":"#62626b","text-inverse":"#ffffff",link:"#4f46e5",border:"#e5e5ec","border-subtle":"#efeff3","field-bg":"#f9fbfc","field-border":"#ebedf3","field-border-focus":"#bed2f9","focus-ring":"#4f46e5",scrim:"#0f0f1a80","on-scrim":"#ffffff",thumb:"#ffffff",primary:"#4f46e5","primary-hover":"#4338ca","primary-pressed":"#3730a3","primary-soft":"#e0e7ff","primary-text":"#4f46e5","on-primary":"#ffffff","primary-wash":"#4f46e514","primary-wash-strong":"#4f46e533",neutral:"#f4f4f8","neutral-hover":"#e9e9f0","neutral-text":"#52525b","on-neutral":"#0f0f1a",success:"#18864f","success-soft":"#e8faee","success-text":"#147042","on-success":"#ffffff",warning:"#f59e0b","warning-soft":"#fff8e6","warning-text":"#8f5c06","on-warning":"#0f0f1a",danger:"#e12c32","danger-soft":"#ffeaef","danger-border":"#e5484d","danger-text":"#bc1b20","offline-fill":"#e82646","online-fill":"#04b440","on-danger":"#ffffff",info:"#1b6ef5","info-soft":"#e9f3ff","info-text":"#0958d9","on-info":"#ffffff","switch-thumb":"#ffffff","on-neutral-strong":"#ffffff","text-disabled":"#b4b4bb","surface-pressed":"#0f0f1a0f","surface-hover":"#0f0f1a0a","surface-selected":"#4f46e51a","surface-disabled":"#f1f1f5",skeleton:"#ebedf3","skeleton-highlight":"#f5f6fa","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#ffffff","field-bg-disabled":"#f5f6fa","field-border-error":"#fdbfce","field-label":"#242f4a","field-text":"#252f4a","field-text-disabled":"#7a8197","field-placeholder":"#626d8b","field-placeholder-disabled":"#7a8197","field-icon":"#7a849f","field-icon-focus":"#4b5675","field-icon-disabled":"#c4cada","field-caret":"#5b8dee","field-message":"#d81736","avatar-1":"#4f46e5","avatar-2":"#0a7979","avatar-3":"#a45a05","avatar-4":"#cd226e","avatar-5":"#2462eb","avatar-6":"#7c3aed","avatar-7":"#047c57","avatar-8":"#d42222"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,"2xl":18,"3xl":20,pill:9999},text:{xs:{size:11},sm:{size:13},base:{size:15},lg:{size:17},xl:{size:20},"2xl":{size:24},"3xl":{size:30},"4xl":{size:36},"5xl":{size:45},"6xl":{size:57},"7xl":{size:64},"8xl":{size:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{heading:1.2,body:1.4,display:1.2},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.059,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.078,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.102,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":35,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":40,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"sm","min-height":45,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"illustration-size":96,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"illustration-size":160,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"illustration-size":240,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0},screen:{gutter:"lg"}}};export const darkTokens={mode:"dark",colors:{bg:"#0b0b12","bg-subtle":"#13131c","bg-muted":"#1c1c26",surface:"#1c1c26","surface-inverse":"#fafafa","surface-dark":"#071437","surface-dark-border":"#2a3553","on-surface-dark":"#ffffff","on-surface-dark-muted":"#babdc7","surface-ink":"#0b0e16",text:"#e2e2e2","text-body":"#fafafa","text-muted":"#b4b4bb","text-subtle":"#919199","text-inverse":"#0f0f1a",link:"#9292ee",border:"#27272f","border-subtle":"#1c1c26","field-bg":"#13131c","field-border":"#27272f","field-border-focus":"#3d5fb0","focus-ring":"#7c7ce8",scrim:"#000000a6","on-scrim":"#ffffff",thumb:"#3a3e49",primary:"#7c7ce8","primary-hover":"#9292ee","primary-pressed":"#a8a8f2","primary-soft":"#1f1f3d","primary-text":"#8989ea","on-primary":"#0f0f1a","primary-wash":"#7c7ce814","primary-wash-strong":"#7c7ce833",neutral:"#1f1f26","neutral-hover":"#2a2a33","neutral-text":"#b4b4bb","on-neutral":"#fafafa",success:"#30c780","success-soft":"#04b4402e","success-text":"#30c780","on-success":"#0f0f1a",warning:"#fbbf24","warning-soft":"#dfa0002e","warning-text":"#fbbf24","on-warning":"#0f0f1a",danger:"#f87171","danger-soft":"#e826462e","danger-border":"#f87171","danger-text":"#f87171","offline-fill":"#e82646","online-fill":"#04b440","on-danger":"#0f0f1a",info:"#60a5fa","info-soft":"#056ee92e","info-text":"#60a5fa","on-info":"#0f0f1a","switch-thumb":"#ffffff","on-neutral-strong":"#0f0f1a","text-disabled":"#52525b","surface-pressed":"#ffffff14","surface-hover":"#ffffff0d","surface-selected":"#7c7ce82e","surface-disabled":"#1c1c26",skeleton:"#1c1c26","skeleton-highlight":"#27272f","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#0b0b12","field-bg-disabled":"#1c1c26","field-border-error":"#8a2f42","field-label":"#e4e6ee","field-text":"#fafafa","field-text-disabled":"#71717a","field-placeholder":"#84848d","field-placeholder-disabled":"#71717a","field-icon":"#8b8b95","field-icon-focus":"#d4d4db","field-icon-disabled":"#52525b","field-caret":"#7c9ef0","field-message":"#f87171","avatar-1":"#8b8bee","avatar-2":"#2dd4bf","avatar-3":"#fcd34d","avatar-4":"#f472b6","avatar-5":"#60a5fa","avatar-6":"#a78bfa","avatar-7":"#34d399","avatar-8":"#f87171"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,"2xl":18,"3xl":20,pill:9999},text:{xs:{size:11},sm:{size:13},base:{size:15},lg:{size:17},xl:{size:20},"2xl":{size:24},"3xl":{size:30},"4xl":{size:36},"5xl":{size:45},"6xl":{size:57},"7xl":{size:64},"8xl":{size:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{heading:1.2,body:1.4,display:1.2},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.4,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.502,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.549,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":35,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":40,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"sm","min-height":45,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"illustration-size":96,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"illustration-size":160,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"illustration-size":240,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0},screen:{gutter:"lg"}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{Platform}from"react-native";export const webDeps=t=>"web"===Platform.OS?[t]:[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { GradientDefinition } from "./types";
|
|
4
|
-
type BackgroundImage = Extract<NonNullable<ViewStyle["
|
|
4
|
+
type BackgroundImage = Extract<NonNullable<ViewStyle["backgroundImage"]>, ReadonlyArray<unknown>>[number];
|
|
5
5
|
type LinearGradientValue = Extract<BackgroundImage, {
|
|
6
6
|
type: "linear-gradient";
|
|
7
7
|
}>;
|
|
8
8
|
/**
|
|
9
|
-
* Render a linear gradient with React Native's own `
|
|
9
|
+
* Render a linear gradient with React Native's own `backgroundImage`
|
|
10
10
|
* style prop. `GradientDefinition` keeps its vector-based `start`/`end` shape,
|
|
11
11
|
* which is translated to a CSS angle here.
|
|
12
12
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const COLOR_NAMES: readonly ["bg", "bg-subtle", "bg-muted", "surface", "surface-inverse", "surface-dark", "surface-dark-border", "on-surface-dark", "on-surface-dark-muted", "surface-ink", "text", "text-body", "text-muted", "text-subtle", "text-inverse", "link", "border", "border-subtle", "field-bg", "field-border", "field-border-focus", "focus-ring", "scrim", "on-scrim", "thumb", "primary", "primary-hover", "primary-soft", "primary-text", "on-primary", "primary-wash", "primary-wash-strong", "neutral", "neutral-hover", "neutral-text", "on-neutral", "success", "success-soft", "success-text", "on-success", "warning", "warning-soft", "warning-text", "on-warning", "danger", "danger-soft", "danger-border", "danger-text", "offline-fill", "online-fill", "on-danger", "info", "info-soft", "info-text", "on-info", "
|
|
1
|
+
export declare const COLOR_NAMES: readonly ["bg", "bg-subtle", "bg-muted", "surface", "surface-inverse", "surface-dark", "surface-dark-border", "on-surface-dark", "on-surface-dark-muted", "surface-ink", "text", "text-body", "text-muted", "text-subtle", "text-inverse", "link", "border", "border-subtle", "field-bg", "field-border", "field-border-focus", "focus-ring", "scrim", "on-scrim", "thumb", "primary", "primary-hover", "primary-pressed", "primary-soft", "primary-text", "on-primary", "primary-wash", "primary-wash-strong", "neutral", "neutral-hover", "neutral-text", "on-neutral", "success", "success-soft", "success-text", "on-success", "warning", "warning-soft", "warning-text", "on-warning", "danger", "danger-soft", "danger-border", "danger-text", "offline-fill", "online-fill", "on-danger", "info", "info-soft", "info-text", "on-info", "switch-thumb", "on-neutral-strong", "text-disabled", "surface-pressed", "surface-hover", "surface-selected", "surface-disabled", "skeleton", "skeleton-highlight", "glass-fill", "glass-border", "on-glass", "glass-badge", "field-bg-focus", "field-bg-disabled", "field-border-error", "field-label", "field-text", "field-text-disabled", "field-placeholder", "field-placeholder-disabled", "field-icon", "field-icon-focus", "field-icon-disabled", "field-caret", "field-message", "avatar-1", "avatar-2", "avatar-3", "avatar-4", "avatar-5", "avatar-6", "avatar-7", "avatar-8"];
|
|
2
2
|
export type ColorName = (typeof COLOR_NAMES)[number];
|
|
3
3
|
export declare const SPACE_NAMES: readonly ["none", "xxs", "xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl"];
|
|
4
4
|
export type SpaceName = (typeof SPACE_NAMES)[number];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { GradientDefinition } from "./types.js";
|
|
4
|
-
type BackgroundImage = Extract<NonNullable<ViewStyle["
|
|
4
|
+
type BackgroundImage = Extract<NonNullable<ViewStyle["backgroundImage"]>, ReadonlyArray<unknown>>[number];
|
|
5
5
|
type LinearGradientValue = Extract<BackgroundImage, {
|
|
6
6
|
type: "linear-gradient";
|
|
7
7
|
}>;
|
|
8
8
|
/**
|
|
9
|
-
* Render a linear gradient with React Native's own `
|
|
9
|
+
* Render a linear gradient with React Native's own `backgroundImage`
|
|
10
10
|
* style prop. `GradientDefinition` keeps its vector-based `start`/`end` shape,
|
|
11
11
|
* which is translated to a CSS angle here.
|
|
12
12
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const COLOR_NAMES: readonly ["bg", "bg-subtle", "bg-muted", "surface", "surface-inverse", "surface-dark", "surface-dark-border", "on-surface-dark", "on-surface-dark-muted", "surface-ink", "text", "text-body", "text-muted", "text-subtle", "text-inverse", "link", "border", "border-subtle", "field-bg", "field-border", "field-border-focus", "focus-ring", "scrim", "on-scrim", "thumb", "primary", "primary-hover", "primary-soft", "primary-text", "on-primary", "primary-wash", "primary-wash-strong", "neutral", "neutral-hover", "neutral-text", "on-neutral", "success", "success-soft", "success-text", "on-success", "warning", "warning-soft", "warning-text", "on-warning", "danger", "danger-soft", "danger-border", "danger-text", "offline-fill", "online-fill", "on-danger", "info", "info-soft", "info-text", "on-info", "
|
|
1
|
+
export declare const COLOR_NAMES: readonly ["bg", "bg-subtle", "bg-muted", "surface", "surface-inverse", "surface-dark", "surface-dark-border", "on-surface-dark", "on-surface-dark-muted", "surface-ink", "text", "text-body", "text-muted", "text-subtle", "text-inverse", "link", "border", "border-subtle", "field-bg", "field-border", "field-border-focus", "focus-ring", "scrim", "on-scrim", "thumb", "primary", "primary-hover", "primary-pressed", "primary-soft", "primary-text", "on-primary", "primary-wash", "primary-wash-strong", "neutral", "neutral-hover", "neutral-text", "on-neutral", "success", "success-soft", "success-text", "on-success", "warning", "warning-soft", "warning-text", "on-warning", "danger", "danger-soft", "danger-border", "danger-text", "offline-fill", "online-fill", "on-danger", "info", "info-soft", "info-text", "on-info", "switch-thumb", "on-neutral-strong", "text-disabled", "surface-pressed", "surface-hover", "surface-selected", "surface-disabled", "skeleton", "skeleton-highlight", "glass-fill", "glass-border", "on-glass", "glass-badge", "field-bg-focus", "field-bg-disabled", "field-border-error", "field-label", "field-text", "field-text-disabled", "field-placeholder", "field-placeholder-disabled", "field-icon", "field-icon-focus", "field-icon-disabled", "field-caret", "field-message", "avatar-1", "avatar-2", "avatar-3", "avatar-4", "avatar-5", "avatar-6", "avatar-7", "avatar-8"];
|
|
2
2
|
export type ColorName = (typeof COLOR_NAMES)[number];
|
|
3
3
|
export declare const SPACE_NAMES: readonly ["none", "xxs", "xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl"];
|
|
4
4
|
export type SpaceName = (typeof SPACE_NAMES)[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/mobile-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.180.0",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -126,13 +126,13 @@
|
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
|
-
"@webority/markdown-core": "0.
|
|
129
|
+
"@webority/markdown-core": "0.180.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependencies": {
|
|
132
132
|
"@react-navigation/bottom-tabs": ">=7.0.0",
|
|
133
133
|
"@react-navigation/native": ">=7.0.0",
|
|
134
|
-
"@webority/canvas-kit": "0.
|
|
135
|
-
"@webority/mobile-core": "0.
|
|
134
|
+
"@webority/canvas-kit": "0.180.0",
|
|
135
|
+
"@webority/mobile-core": "0.180.0",
|
|
136
136
|
"expo": ">=58.0.0",
|
|
137
137
|
"expo-file-system": ">=58.0.0",
|
|
138
138
|
"expo-haptics": ">=58.0.0",
|
|
@@ -196,10 +196,10 @@
|
|
|
196
196
|
"@types/jest": "29.5.14",
|
|
197
197
|
"@types/node": "25.6.0",
|
|
198
198
|
"@types/react": "19.3.0",
|
|
199
|
-
"@webority/canvas-kit": "0.
|
|
200
|
-
"@webority/mobile-core": "0.
|
|
199
|
+
"@webority/canvas-kit": "0.180.0",
|
|
200
|
+
"@webority/mobile-core": "0.180.0",
|
|
201
201
|
"@webority/mobile-dev": "0.0.0",
|
|
202
|
-
"@webority/tokens": "0.
|
|
202
|
+
"@webority/tokens": "0.180.0",
|
|
203
203
|
"expo": "58.0.23",
|
|
204
204
|
"expo-file-system": "58.0.13",
|
|
205
205
|
"expo-haptics": "58.0.7",
|