@webority/mobile-ui 0.170.1 → 0.171.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/dist/canvas-kit/kit.js +10 -10
- package/dist/canvas-kit/manifest.json +22 -1
- package/dist/canvas-kit/release.json +6 -6
- package/lib/commonjs/components/AppIcon/catalog.g.js +1 -1
- package/lib/commonjs/components/AppIcon/glyphs.g.js +1 -1
- package/lib/commonjs/components/AppIcon/variants.g.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Card/Card.js +1 -1
- package/lib/commonjs/components/ChoiceGroup/ChoiceGroup.js +1 -1
- package/lib/commonjs/components/FormField/FormField.js +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +1 -1
- package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/module/components/AppIcon/catalog.g.js +1 -1
- package/lib/module/components/AppIcon/glyphs.g.js +1 -1
- package/lib/module/components/AppIcon/variants.g.js +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/module/components/Card/Card.js +1 -1
- package/lib/module/components/ChoiceGroup/ChoiceGroup.js +1 -1
- package/lib/module/components/FormField/FormField.js +1 -1
- package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +1 -1
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/typescript/commonjs/components/AppIcon/catalog.g.d.ts +1 -1
- package/lib/typescript/commonjs/components/AppIcon/glyphs.g.d.ts +10 -1
- package/lib/typescript/commonjs/components/ChoiceGroup/ChoiceGroup.d.ts +4 -0
- package/lib/typescript/module/components/AppIcon/catalog.g.d.ts +1 -1
- package/lib/typescript/module/components/AppIcon/glyphs.g.d.ts +10 -1
- package/lib/typescript/module/components/ChoiceGroup/ChoiceGroup.d.ts +4 -0
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{createContext,useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Dimensions,Keyboard,Platform,ScrollView,StyleSheet,useWindowDimensions,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useNativeGesture,usePanGesture,useTapGesture}from"react-native-gesture-handler";import{useReanimatedKeyboardAnimation}from"react-native-keyboard-controller";import Animated,{Easing,useAnimatedStyle,useDerivedValue,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{BOTTOM_SHEET_TEXT}from"../../text/phone/bottomSheet.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{transparentOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{ACTIONS_LAYOUTS,OverlayActions}from"../Dialog/OverlayActions.js";import{Modal}from"../Modal/Modal.js";import{useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_SNAP_POINTS=["content"],TABLET_MIN_SHORT_SIDE=600,DIALOG_MAX_WIDTH=560,BottomSheetContext=createContext(null);export const useBottomSheet=()=>{const e=useContext(BottomSheetContext);if(!e)throw new Error("[@webority/mobile-ui] BottomSheet: useBottomSheet must be used inside a <BottomSheet>.");return e};const SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,BottomSheet=e=>{const{snapPoints:t=DEFAULT_SNAP_POINTS,open:o,onClose:s,snapIndex:r,onSnapChange:a,onAnimate:n,onAfterClose:i,enablePanDownToClose:l=!0,enableBackdropPress:u=!0,onBeforeClose:c,title:d,labels:h,scrollable:m=!1,scrollRef:f,onScroll:b,onContentSizeChange:p,onScrollLayout:S,scrollEventThrottle:v,keyboardBehavior:y="shift",inline:g=!1,presentation:x="sheet",animateMount:C=!0,handleIndicatorStyle:w,sheetStyle:M,header:R,actions:_,actionsLayout:T="auto",footer:k,headerStyle:O,footerStyle:E,children:I,accessibilityLabel:j,accessibilityViewIsModal:A,testID:V}=e;assertValidValue("BottomSheet","presentation",e.presentation,["sheet","dialog","auto"]),assertValidValue("BottomSheet","keyboardBehavior",e.keyboardBehavior,["none","shift"]),assertValidValue("BottomSheet","actionsLayout",e.actionsLayout,ACTIONS_LAYOUTS);const N=useMobileUiText("bottomSheet",BOTTOM_SHEET_TEXT),D=useMemo(()=>({...N,...h}),[N,h]),B=null!=R||null!=d,P=null!=_&&_.length>0,L=null!=k||P,H=g?"inline":"modal",G=useTheme(),F=usePresenceMotion(),U=useSafeAreaInsets(),[Y,$]=useState(()=>Dimensions.get("window").height),[z,K]=useState(()=>Dimensions.get("window").width),X=useCallback(e=>{const{height:t,width:o}=e.nativeEvent.layout;t>0&&$(e=>e===t?e:t),o>0&&K(e=>e===o?e:o)},[]),W=useWindowDimensions(),q="dialog"===x||"auto"===x&&Math.min(W.width,W.height)>=600,J=Math.min(560,z-2*G.space.xl),[Q,Z]=useModalInsets(),ee="modal"===H?Q.top:U.top,te="modal"===H?Q.bottom:U.bottom,oe=t.includes("content"),[se,re]=useMeasuredHeight(),[ae,ne]=useMeasuredHeight(),[ie,le,ue]=useMeasuredHeight(),[ce,de]=useMeasuredHeight(),he=q?G.space.md:se,me=oe?Math.min(he+(B?ae:0)+ie+(L?ce:0)+te,Y-ee):0,fe=useCallback((e,t)=>{oe&&ue(t),p?.(e,t)},[oe,p,ue]),be=useMemo(()=>resolveSnapPoints(t,Y,me),[t,Y,me]),pe=Y,Se=be[be.length-1]??0,ve=useSharedValue(pe),ye=useSharedValue(pe),ge=useSharedValue(1),xe=useSharedValue(-1),[Ce,we]=useState(-1),Me=useRef(!1),[Re,Te]=useState(!1),[ke,Oe]=useState(!1),Ee=useRef(!1),Ie=useRef(i);Ie.current=i;const[je,Ae]=useState(!1),Ve=useRef(!C&&o),Ne=useRef(-1),De=useRef(!1);De.current="modal"===H?ke:je;const Be=useRef(c);Be.current=c;const Pe=useRef(s);Pe.current=s;const Le=useRef(!1),He=useRef(!0),Ge=useRef([]),Fe=useCallback(e=>{const t=Ge.current;Ge.current=[];for(const o of t)o(e)},[]);useEffect(()=>(He.current=!0,()=>{He.current=!1,Fe(!1)}),[Fe]);const Ue=useCallback(e=>{if(e<0||e>=be.length)return pe;const t=be[e];if(void 0===t)throw new Error("BottomSheet: an in-range snap index always has a resolved snap point");return q?(Y-t)/2:Y-t},[be,Y,pe,q]),Ye=useCallback(e=>{Ne.current=e;Ce!==e&&(we(e),xe.value=e,e>=0&&a?.(e))},[Ce,xe,a]),$e=useCallback(()=>{Me.current=!1,xe.value<0&&(Ee.current=!0,"modal"===H?(Te(!1),"ios"!==Platform.OS&&Oe(!1)):Ae(!1))},[H,xe]),ze=useCallback(()=>{Ee.current&&Oe(!1)},[]);useEffect(()=>{("modal"===H?!ke:!je)&&Ee.current&&(Ee.current=!1,Ie.current?.(),Fe(!0))},[H,ke,je,Fe]);const Ke=useCallback((e,t,o)=>{Me.current=!0,n?.(t,o),ve.value=withSpring(e,SPRING_CONFIG,e=>{"worklet";e&&scheduleOnRN($e)})},[n,ve,$e]),Xe=useCallback(e=>{const t="number"==typeof e?clamp(e,0,be.length-1):Math.max(Ce,0),o=xe.value,s=Ue(t);return Ee.current=!1,Fe(!1),"modal"===H?(Oe(!0),Te(!0)):Ae(!0),o<0&&Ve.current?(ve.value=s,ge.value=1,Ye(t),void n?.(o,t)):o<0&&F.reduced?(ve.value=s,ge.value=0,ge.value=withTiming(1,{duration:F.duration("fast"),easing:Easing.bezier(...G.motion.ease.decelerate),reduceMotion:PRESENCE_REDUCE_MOTION}),Ye(t),void n?.(o,t)):(o<0&&(ve.value=pe,ge.value=1),Ye(t),void Ke(s,o,t))},[Ke,pe,Ce,xe,H,n,F,ge,be.length,Ye,Fe,G.motion.ease.decelerate,ve,Ue]),We=useCallback(()=>new Promise(e=>{if(Ne.current<0)return void(De.current?Ge.current.push(e):e(!0));Ge.current.push(e),Ve.current=!1;const t=xe.value;Ye(-1),Me.current=!0,n?.(t,-1);const o=F.reduced?ge:ve,s=F.reduced?0:pe;o.value=withTiming(s,{duration:F.duration("fast"),easing:Easing.bezier(...G.motion.ease.accelerate),reduceMotion:PRESENCE_REDUCE_MOTION},e=>{"worklet";e&&scheduleOnRN($e)})}),[pe,xe,$e,n,F,ge,Ye,ve,G.motion.ease.accelerate]),qe=useCallback((e,t,o)=>{const s=Be.current;if(!s)return void e();if(Le.current)return void t?.();const r=s();"boolean"!=typeof r?(Le.current=!0,o?.(),r.then(o=>{Le.current=!1,o&&He.current&&Ne.current>=0?e():t?.()},e=>{throw Le.current=!1,e})):(r?e:t)?.()},[]),Je=useCallback(()=>new Promise(e=>{Ne.current<0?e(!0):qe(()=>{Pe.current(),We(),e(!0)},()=>e(!1))}),[We,qe]),Qe=useCallback(()=>{Pe.current()},[]),Ze=useCallback(()=>{u&&Je()},[u,Je]),et=useRef(null),tt=useRef(Xe);tt.current=Xe;const ot=useRef(We);ot.current=We,useEffect(()=>{const e=et.current!==o;et.current=o,e?o?tt.current(r??0):ot.current():o&&"number"==typeof r&&r!==xe.value&&tt.current(r)},[o,r,xe]);const st=useRef({hostHeight:Y,contentSnap:me}),rt=useRef(Ue);rt.current=Ue,useEffect(()=>{const e=st.current;if(e.hostHeight===Y&&e.contentSnap===me)return;if(st.current={hostHeight:Y,contentSnap:me},e.hostHeight===Y&&xe.value<0)return;const t=rt.current(xe.value);ve.value=Ve.current?t:withSpring(t,SPRING_CONFIG)},[Y,me,xe,ve]);const at=Y-Se,nt=useMemo(()=>be.map(e=>Y-e),[be,Y]),it=useCallback(()=>{const e=Ne.current;e<0||Ke(Ue(e),e,e)},[Ke,Ue]),lt=useCallback((e,t)=>{const o=xe.value;-1!==e?(Ye(e),Ke(t,o,e)):qe(()=>{Keyboard.dismiss(),triggerHaptic("selection"),Pe.current(),We()},it,it)},[Ke,We,xe,qe,Ye,it]),ut=useMemo(()=>({testID:V?`${V}-content-gesture`:"bottom-sheet-content-gesture"}),[V]),ct=useNativeGesture(ut),dt=useMemo(()=>{const e=nt,t=pe,o=at,s=l;return{testID:V?`${V}-pan-gesture`:"bottom-sheet-pan-gesture",activeOffsetY:[-10,10],failOffsetX:[-15,15],onActivate:()=>{"worklet";ye.value=ve.value},onUpdate:e=>{"worklet";const t=ye.value+e.translationY;ve.value=t<o?o+.25*(t-o):t},onDeactivate:o=>{"worklet";const r=ve.value,a=o.velocityY,[n]=e;if(void 0===n)return void scheduleOnRN(lt,-1,t);if(a>1e3)return s?void scheduleOnRN(lt,-1,t):void scheduleOnRN(lt,0,n);let i=0,l=n,u=1/0,c=0;for(const t of e){const e=Math.abs(r-t);e<u&&(u=e,l=t,i=c),c++}s&&r-n>80?scheduleOnRN(lt,-1,t):scheduleOnRN(lt,i,l)}}},[pe,ye,l,lt,at,nt,V,ve]),ht=usePanGesture(dt),{height:mt}=useReanimatedKeyboardAnimation(),ft="shift"===y,bt=useDerivedValue(()=>ft?mt.value:0,[ft,mt]),pt=be[Math.max(Ce,0)]??Se,St=G.space.md,vt=useAnimatedStyle(()=>{if(q){const e=bt.value,t=Y+e-pt-St,o=e<0&&ve.value>t?t:ve.value;return{top:Math.max(o,ee),opacity:ge.value}}const e=ve.value+bt.value,t=bt.value<0?ee:at;return{top:Math.max(e,t),opacity:ge.value}},[q,bt,Y,pt,St,ve,ee,ge,at]),yt=useAnimatedStyle(()=>{const e=bt.value;if(q){const t=Y+e-pt-St,o=e<0&&ve.value>t?t:ve.value,s=Math.max(o,ee),r=Y+e-St-s;return{height:r<0?0:Math.min(r,pt)}}const t=e<0?ee:at,o=ve.value+e,s=Math.max(o,t),r=Y+e-s;return{height:r<0?0:Math.min(r,Se)}},[bt,q,Y,pt,St,ve,ee,at,Se]),gt=Ce>=0,xt=useMemo(()=>buildStyles(G),[G]),Ct=useCallback(()=>{u&&qe(()=>{triggerHaptic("selection"),Pe.current(),We()})},[u,We,qe]),wt=useMemo(()=>({testID:V?`${V}-backdrop-gesture`:"bottom-sheet-backdrop-gesture",maxDuration:250,onDeactivate:e=>{"worklet";e.canceled||scheduleOnRN(Ct)}}),[Ct,V]),Mt=useTapGesture(wt),Rt=useMemo(()=>({snapIndex:Ce,snapPoints:be,close:Qe,requestClose:Je}),[Ce,be,Qe,Je]);if("inline"===H&&!je)return null;if("modal"===H&&!ke)return null;const _t=_jsxs(View,{collapsable:!1,style:["modal"===H?xt.backdropModal:xt.backdropInline,{backgroundColor:"modal"===H?transparentOf(G.colors.scrim):G.colors.scrim}],onLayout:X,testID:V,accessibilityViewIsModal:A??gt,children:[_jsx(GestureDetector,{gesture:Mt,children:_jsx(Animated.View,{style:StyleSheet.absoluteFill,accessibilityRole:"button",accessibilityLabel:D.close})}),_jsx(Animated.View,{accessibilityRole:"alert",accessibilityLabel:j,accessibilityViewIsModal:A??gt,accessibilityActions:[{name:"escape",label:D.close}],onAccessibilityAction:e=>{"escape"===e.nativeEvent.actionName&&Ze()},onAccessibilityEscape:Ze,style:[xt.sheet,{height:Se,backgroundColor:G.colors.surface,borderTopLeftRadius:G.radius.xl,borderTopRightRadius:G.radius.xl,...smoothCorners,...G.shadow.modal},q?{height:pt,left:(z-J)/2,right:void 0,width:J,borderBottomLeftRadius:G.radius.xl,borderBottomRightRadius:G.radius.xl}:null,M,vt],children:_jsxs(SheetBody,{style:[xt.body,yt],keyboardOffset:bt,children:[q?_jsx(View,{style:{height:G.space.md}}):_jsx(GestureDetector,{gesture:ht,children:_jsx(View,{style:xt.handleRow,onLayout:oe?re:void 0,accessible:!0,accessibilityLabel:D.dragHandle,accessibilityHint:D.dragHandleHintText,testID:V?`${V}-handle`:"bottom-sheet-handle",children:_jsx(View,{style:[xt.handle,{backgroundColor:G.colors.border},w]})})}),B&&_jsxs(View,{style:[xt.header,O],onLayout:oe?ne:void 0,children:[null!=d?_jsx(Text,{variant:"title",accessibilityRole:"header",children:d}):null,R]}),m?_jsx(GestureDetector,{gesture:ct,children:_jsx(ScrollView,{ref:f,testID:V?`${V}-scroll`:void 0,style:xt.scrollContent,onScroll:b,onContentSizeChange:fe,onLayout:S,scrollEventThrottle:v,keyboardShouldPersistTaps:"always",keyboardDismissMode:"none",children:I})}):_jsx(View,{style:oe?[xt.content,{overflow:"visible"}]:xt.content,children:oe?_jsx(View,{onLayout:le,children:I}):I}),L&&_jsxs(View,{style:[xt.footer,E],onLayout:oe?de:void 0,children:[P?_jsx(View,{style:xt.actions,children:_jsx(OverlayActions,{actions:_??[],layout:T})}):null,k]})]})})]}),Tt=_jsx(BottomSheetContext.Provider,{value:Rt,children:_t});return"modal"===H?_jsx(Modal,{open:Re,onClose:Ze,presentation:"fullScreen",bare:!0,backdropPressClose:!1,haptic:!1,animateMount:!1,onInsetsChange:Z,onDismissed:"ios"===Platform.OS?ze:void 0,children:"android"===Platform.OS?_jsx(GestureHandlerRootView,{style:xt.modalRoot,children:Tt}):Tt}):Tt},SheetBody=({style:e,keyboardOffset:t,children:o})=>{const s=useSafeAreaInsets().bottom,r=useAnimatedStyle(()=>{const e=s+t.value;return{paddingBottom:Math.max(e,0)}},[s,t]);return _jsx(Animated.View,{style:[e,r],children:o})};BottomSheet.displayName="BottomSheet";const useMeasuredHeight=()=>{const[e,t]=useState(0),o=useCallback(e=>{t(t=>t===e?t:e)},[]);return[e,useCallback(e=>o(e.nativeEvent.layout.height),[o]),o]},resolveSnapPoints=(e,t,o)=>[...e.map(e=>{if("number"==typeof e)return e;if("content"===e)return o;const s=parseFloat(e);return Number.isNaN(s)?0:s/100*t})].sort((e,t)=>e-t),clamp=(e,t,o)=>Math.min(Math.max(e,t),o),buildStyles=e=>StyleSheet.create({backdropModal:{flex:1},backdropInline:{...StyleSheet.absoluteFill},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},header:{},actions:{padding:e.space.lg},footer:{},handle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},content:{flex:1,overflow:"hidden"},scrollContent:{flex:1},modalRoot:{flex:1}});export{BottomSheet};export default BottomSheet;
|
|
1
|
+
"use strict";import{createContext,useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Dimensions,Keyboard,Platform,ScrollView,StyleSheet,useWindowDimensions,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useNativeGesture,usePanGesture,useTapGesture}from"react-native-gesture-handler";import{useReanimatedKeyboardAnimation}from"react-native-keyboard-controller";import Animated,{Easing,useAnimatedStyle,useDerivedValue,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{BOTTOM_SHEET_TEXT}from"../../text/phone/bottomSheet.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{transparentOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{ACTIONS_LAYOUTS,OverlayActions}from"../Dialog/OverlayActions.js";import{Modal}from"../Modal/Modal.js";import{useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_SNAP_POINTS=["content"],TABLET_MIN_SHORT_SIDE=600,DIALOG_MAX_WIDTH=560,BottomSheetContext=createContext(null);export const useBottomSheet=()=>{const e=useContext(BottomSheetContext);if(!e)throw new Error("[@webority/mobile-ui] BottomSheet: useBottomSheet must be used inside a <BottomSheet>.");return e};const SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,BottomSheet=e=>{const{snapPoints:t=DEFAULT_SNAP_POINTS,open:o,onClose:s,snapIndex:r,onSnapChange:n,onAnimate:a,onAfterClose:l,enablePanDownToClose:i=!0,enableBackdropPress:u=!0,onBeforeClose:c,title:d,labels:h,scrollable:m=!1,scrollRef:f,onScroll:b,onContentSizeChange:p,onScrollLayout:S,scrollEventThrottle:v,keyboardBehavior:y="shift",inline:g=!1,presentation:x="sheet",animateMount:C=!0,handleIndicatorStyle:w,sheetStyle:M,header:R,actions:_,actionsLayout:T="auto",footer:k,headerStyle:O,footerStyle:E,children:I,accessibilityLabel:j,accessibilityViewIsModal:A,testID:V}=e;assertValidValue("BottomSheet","presentation",e.presentation,["sheet","dialog","auto"]),assertValidValue("BottomSheet","keyboardBehavior",e.keyboardBehavior,["none","shift"]),assertValidValue("BottomSheet","actionsLayout",e.actionsLayout,ACTIONS_LAYOUTS);const N=useMobileUiText("bottomSheet",BOTTOM_SHEET_TEXT),D=useMemo(()=>({...N,...h}),[N,h]),B=null!=R||null!=d,P=null!=_&&_.length>0,L=null!=k||P,H=g?"inline":"modal",G=useTheme(),F=usePresenceMotion(),U=useSafeAreaInsets(),[Y,$]=useState(()=>Dimensions.get("window").height),[z,K]=useState(()=>Dimensions.get("window").width),X=useCallback(e=>{const{height:t,width:o}=e.nativeEvent.layout;t>0&&$(e=>e===t?e:t),o>0&&K(e=>e===o?e:o)},[]),W=useWindowDimensions(),q="dialog"===x||"auto"===x&&Math.min(W.width,W.height)>=600,J=Math.min(560,z-2*G.space.xl),[Q,Z]=useModalInsets(),ee="modal"===H?Q.top:U.top,te="modal"===H?Q.bottom:U.bottom,oe=t.includes("content"),[se,re]=useMeasuredHeight(),[ne,ae]=useMeasuredHeight(),[le,ie,ue]=useMeasuredHeight(),[ce,de]=useMeasuredHeight(),he=q?G.space.md:se,me=oe?Math.min(he+(B?ne:0)+le+(L?ce:0)+te,Y-ee):0,fe=useCallback((e,t)=>{oe&&ue(t),p?.(e,t)},[oe,p,ue]),be=useMemo(()=>resolveSnapPoints(t,Y,me),[t,Y,me]),pe=Y,Se=be[be.length-1]??0,ve=useSharedValue(pe),ye=useSharedValue(pe),ge=useSharedValue(1),xe=useSharedValue(-1),[Ce,we]=useState(-1),[Me,Re]=useState(!1),[Te,ke]=useState(!1),Oe=useRef(!1),Ee=useRef(l);Ee.current=l;const[Ie,je]=useState(!1),Ae=useRef(!C&&o),Ve=useRef(-1),Ne=useRef(!1);Ne.current="modal"===H?Te:Ie;const De=useRef(c);De.current=c;const Be=useRef(s);Be.current=s;const Pe=useRef(!1),Le=useRef(!0),He=useRef([]),Ge=useCallback(e=>{const t=He.current;He.current=[];for(const o of t)o(e)},[]);useEffect(()=>(Le.current=!0,()=>{Le.current=!1,Ge(!1)}),[Ge]);const Fe=useCallback(e=>{if(e<0||e>=be.length)return pe;const t=be[e];if(void 0===t)throw new Error("BottomSheet: an in-range snap index always has a resolved snap point");return q?(Y-t)/2:Y-t},[be,Y,pe,q]),Ue=useCallback(e=>{Ve.current=e;Ce!==e&&(we(e),xe.value=e,e>=0&&n?.(e))},[Ce,xe,n]),Ye=useCallback(()=>{xe.value<0&&(Oe.current=!0,"modal"===H?(Re(!1),"ios"!==Platform.OS&&ke(!1)):je(!1))},[H,xe]),$e=useCallback(()=>{Oe.current&&ke(!1)},[]);useEffect(()=>{("modal"===H?!Te:!Ie)&&Oe.current&&(Oe.current=!1,Ee.current?.(),Ge(!0))},[H,Te,Ie,Ge]);const ze=useCallback((e,t,o)=>{a?.(t,o),ve.value=withSpring(e,SPRING_CONFIG,e=>{"worklet";e&&scheduleOnRN(Ye)})},[a,ve,Ye]),Ke=useRef(null),Xe=useCallback(e=>{const t="number"==typeof e?clamp(e,0,be.length-1):Math.max(Ce,0),o=xe.value,s=Fe(t);return Oe.current=!1,Ge(!1),"modal"===H?(ke(!0),Re(!0)):je(!0),o<0&&Ae.current?(ve.value=s,ge.value=1,Ue(t),void a?.(o,t)):o<0&&F.reduced?(ve.value=s,ge.value=0,ge.value=withTiming(1,{duration:F.duration("fast"),easing:Easing.bezier(...G.motion.ease.decelerate),reduceMotion:PRESENCE_REDUCE_MOTION}),Ue(t),void a?.(o,t)):(o<0&&(ve.value=pe,ge.value=1),Ue(t),void(o<0&&t>=0&&!Ne.current?Ke.current={fromIndex:o,target:t}:ze(s,o,t)))},[ze,pe,Ce,xe,H,a,F,ge,be.length,Ue,Ge,G.motion.ease.decelerate,ve,Fe]),We=useCallback(()=>new Promise(e=>{if(Ve.current<0)return void(Ne.current?He.current.push(e):e(!0));He.current.push(e),Ae.current=!1,Ke.current=null;const t=xe.value;Ue(-1),a?.(t,-1);const o=F.reduced?ge:ve,s=F.reduced?0:pe;o.value=withTiming(s,{duration:F.duration("fast"),easing:Easing.bezier(...G.motion.ease.accelerate),reduceMotion:PRESENCE_REDUCE_MOTION},e=>{"worklet";e&&scheduleOnRN(Ye)})}),[pe,xe,Ye,a,F,ge,Ue,ve,G.motion.ease.accelerate]),qe=useCallback((e,t,o)=>{const s=De.current;if(!s)return void e();if(Pe.current)return void t?.();const r=s();"boolean"!=typeof r?(Pe.current=!0,o?.(),r.then(o=>{Pe.current=!1,o&&Le.current&&Ve.current>=0?e():t?.()},e=>{throw Pe.current=!1,e})):(r?e:t)?.()},[]),Je=useCallback(()=>new Promise(e=>{Ve.current<0?e(!0):qe(()=>{Be.current(),We(),e(!0)},()=>e(!1))}),[We,qe]),Qe=useCallback(()=>{Be.current()},[]),Ze=useCallback(()=>{u&&Je()},[u,Je]),et=useRef(null),tt=useRef(Xe);tt.current=Xe;const ot=useRef(We);ot.current=We,useEffect(()=>{const e=et.current!==o;et.current=o,e?o?tt.current(r??0):ot.current():o&&"number"==typeof r&&r!==xe.value&&tt.current(r)},[o,r,xe]);const st=useRef({hostHeight:Y,contentSnap:me}),rt=useRef(Fe);rt.current=Fe,useEffect(()=>{const e=st.current;if(e.hostHeight===Y&&e.contentSnap===me)return;if(st.current={hostHeight:Y,contentSnap:me},e.hostHeight===Y&&xe.value<0)return;const t=rt.current(xe.value);ve.value=Ae.current?t:withSpring(t,SPRING_CONFIG)},[Y,me,xe,ve]);const nt="modal"===H?Te:Ie;useEffect(()=>{const e=Ke.current;null!==e&&nt&&(Ke.current=null,Ve.current===e.target&&ze(rt.current(e.target),e.fromIndex,e.target))},[nt,ze]);const at=Y-Se,lt=useMemo(()=>be.map(e=>Y-e),[be,Y]),it=useCallback(()=>{const e=Ve.current;e<0||ze(Fe(e),e,e)},[ze,Fe]),ut=useCallback((e,t)=>{const o=xe.value;-1!==e?(Ue(e),ze(t,o,e)):qe(()=>{Keyboard.dismiss(),triggerHaptic("selection"),Be.current(),We()},it,it)},[ze,We,xe,qe,Ue,it]),ct=useMemo(()=>({testID:V?`${V}-content-gesture`:"bottom-sheet-content-gesture"}),[V]),dt=useNativeGesture(ct),ht=useMemo(()=>{const e=lt,t=pe,o=at,s=i;return{testID:V?`${V}-pan-gesture`:"bottom-sheet-pan-gesture",activeOffsetY:[-10,10],failOffsetX:[-15,15],onActivate:()=>{"worklet";ye.value=ve.value},onUpdate:e=>{"worklet";const t=ye.value+e.translationY;ve.value=t<o?o+.25*(t-o):t},onDeactivate:o=>{"worklet";const r=ve.value,n=o.velocityY,[a]=e;if(void 0===a)return void scheduleOnRN(ut,-1,t);if(n>1e3)return s?void scheduleOnRN(ut,-1,t):void scheduleOnRN(ut,0,a);let l=0,i=a,u=1/0,c=0;for(const t of e){const e=Math.abs(r-t);e<u&&(u=e,i=t,l=c),c++}s&&r-a>80?scheduleOnRN(ut,-1,t):scheduleOnRN(ut,l,i)}}},[pe,ye,i,ut,at,lt,V,ve]),mt=usePanGesture(ht),{height:ft}=useReanimatedKeyboardAnimation(),bt="shift"===y,pt=useDerivedValue(()=>bt?ft.value:0,[bt,ft]),St=be[Math.max(Ce,0)]??Se,vt=G.space.md,yt=useAnimatedStyle(()=>{if(q){const e=pt.value,t=Y+e-St-vt,o=e<0&&ve.value>t?t:ve.value;return{top:Math.max(o,ee),opacity:ge.value}}const e=ve.value+pt.value,t=pt.value<0?ee:at;return{top:Math.max(e,t),opacity:ge.value}},[q,pt,Y,St,vt,ve,ee,ge,at]),gt=useAnimatedStyle(()=>{const e=pt.value;if(q){const t=Y+e-St-vt,o=e<0&&ve.value>t?t:ve.value,s=Math.max(o,ee),r=Y+e-vt-s;return{height:r<0?0:Math.min(r,St)}}const t=e<0?ee:at,o=ve.value+e,s=Math.max(o,t),r=Y+e-s;return{height:r<0?0:Math.min(r,Se)}},[pt,q,Y,St,vt,ve,ee,at,Se]),xt=Ce>=0,Ct=useMemo(()=>buildStyles(G),[G]),wt=useCallback(()=>{u&&qe(()=>{triggerHaptic("selection"),Be.current(),We()})},[u,We,qe]),Mt=useMemo(()=>({testID:V?`${V}-backdrop-gesture`:"bottom-sheet-backdrop-gesture",maxDuration:250,onDeactivate:e=>{"worklet";e.canceled||scheduleOnRN(wt)}}),[wt,V]),Rt=useTapGesture(Mt),_t=useMemo(()=>({snapIndex:Ce,snapPoints:be,close:Qe,requestClose:Je}),[Ce,be,Qe,Je]);if("inline"===H&&!Ie)return null;if("modal"===H&&!Te)return null;const Tt=_jsxs(View,{collapsable:!1,style:["modal"===H?Ct.backdropModal:Ct.backdropInline,{backgroundColor:"modal"===H?transparentOf(G.colors.scrim):G.colors.scrim}],onLayout:X,testID:V,accessibilityViewIsModal:A??xt,children:[_jsx(GestureDetector,{gesture:Rt,children:_jsx(Animated.View,{style:StyleSheet.absoluteFill,accessibilityRole:"button",accessibilityLabel:D.close})}),_jsx(Animated.View,{accessibilityRole:"alert",accessibilityLabel:j,accessibilityViewIsModal:A??xt,accessibilityActions:[{name:"escape",label:D.close}],onAccessibilityAction:e=>{"escape"===e.nativeEvent.actionName&&Ze()},onAccessibilityEscape:Ze,style:[Ct.sheet,{height:Se,backgroundColor:G.colors.surface,borderTopLeftRadius:G.radius.xl,borderTopRightRadius:G.radius.xl,...smoothCorners,...G.shadow.modal},q?{height:St,left:(z-J)/2,right:void 0,width:J,borderBottomLeftRadius:G.radius.xl,borderBottomRightRadius:G.radius.xl}:null,M,yt],children:_jsxs(SheetBody,{style:[Ct.body,gt],keyboardOffset:pt,children:[q?_jsx(View,{style:{height:G.space.md}}):_jsx(GestureDetector,{gesture:mt,children:_jsx(View,{style:Ct.handleRow,onLayout:oe?re:void 0,accessible:!0,accessibilityLabel:D.dragHandle,accessibilityHint:D.dragHandleHintText,testID:V?`${V}-handle`:"bottom-sheet-handle",children:_jsx(View,{style:[Ct.handle,{backgroundColor:G.colors.border},w]})})}),B&&_jsxs(View,{style:[Ct.header,O],onLayout:oe?ae:void 0,children:[null!=d?_jsx(Text,{variant:"title",accessibilityRole:"header",children:d}):null,R]}),m?_jsx(GestureDetector,{gesture:dt,children:_jsx(ScrollView,{ref:f,testID:V?`${V}-scroll`:void 0,style:Ct.scrollContent,onScroll:b,onContentSizeChange:fe,onLayout:S,scrollEventThrottle:v,keyboardShouldPersistTaps:"always",keyboardDismissMode:"none",children:I})}):_jsx(View,{style:oe?[Ct.content,{overflow:"visible"}]:Ct.content,children:oe?_jsx(View,{onLayout:ie,children:I}):I}),L&&_jsxs(View,{style:[Ct.footer,E],onLayout:oe?de:void 0,children:[P?_jsx(View,{style:Ct.actions,children:_jsx(OverlayActions,{actions:_??[],layout:T})}):null,k]})]})})]}),kt=_jsx(BottomSheetContext.Provider,{value:_t,children:Tt});return"modal"===H?_jsx(Modal,{open:Me,onClose:Ze,presentation:"fullScreen",bare:!0,backdropPressClose:!1,haptic:!1,animateMount:!1,onInsetsChange:Z,onDismissed:"ios"===Platform.OS?$e:void 0,children:"android"===Platform.OS?_jsx(GestureHandlerRootView,{style:Ct.modalRoot,children:kt}):kt}):kt},SheetBody=({style:e,keyboardOffset:t,children:o})=>{const s=useSafeAreaInsets().bottom,r=useAnimatedStyle(()=>{const e=s+t.value;return{paddingBottom:Math.max(e,0)}},[s,t]);return _jsx(Animated.View,{style:[e,r],children:o})};BottomSheet.displayName="BottomSheet";const useMeasuredHeight=()=>{const[e,t]=useState(0),o=useCallback(e=>{t(t=>t===e?t:e)},[]);return[e,useCallback(e=>o(e.nativeEvent.layout.height),[o]),o]},resolveSnapPoints=(e,t,o)=>[...e.map(e=>{if("number"==typeof e)return e;if("content"===e)return o;const s=parseFloat(e);return Number.isNaN(s)?0:s/100*t})].sort((e,t)=>e-t),clamp=(e,t,o)=>Math.min(Math.max(e,t),o),buildStyles=e=>StyleSheet.create({backdropModal:{flex:1},backdropInline:{...StyleSheet.absoluteFill},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},header:{},actions:{padding:e.space.lg},footer:{},handle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},content:{flex:1,overflow:"hidden"},scrollContent:{flex:1},modalRoot:{flex:1}});export{BottomSheet};export default BottomSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{forwardRef,useMemo}from"react";import{Animated,Image,Pressable,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{useMobileUiText}from"../../text/index.js";import{CARD_TEXT}from"../../text/phone/card.g.js";import{fontFor,Gradient,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{isOneOf}from"../../utils/guards.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{supportsBoxShadow,toBoxShadow}from"../../utils/shadows.js";import{squircleHostRadius}from"../../utils/squircle.js";import{themeStyles}from"../../utils/themeStyles.js";import{AppIcon}from"../AppIcon/AppIcon.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{Skeleton,SkeletonText}from"../Skeleton/index.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const BACKGROUND_TOKENS=["bg","bg-subtle","bg-muted","surface","scrim","surface-inverse","primary-wash"],paddingMap={none:"none",sm:"sm",md:"lg",lg:"xl",xl:"2xl"},CardRoot=React.memo(forwardRef((e,t)=>{const{children:i,variant:s,elevation:o="card",radius:r,padding:a,interactive:l=!1,pressAnimation:n="scale",bg:d,header:c,title:u,titleFont:m,lead:h,action:p,headerActions:g,collapsible:b=!1,collapsed:y,defaultCollapsed:x=!1,onCollapsedChange:f,collapsedSummary:j,onRemove:C,separatorHeight:S=StyleSheet.hairlineWidth,footer:v,imageSource:_,imageHeight:w=160,imageAspectRatio:R,imageOverlay:A,loading:T=!1,gradient:V,onPress:k,haptic:F,contextMenu:B,accessibilityLabel:I,accessibilityHint:P,accessibilityRole:H,style:M,headerStyle:z,bodyStyle:L,footerStyle:O,testID:q,labels:D,onLayout:E,...W}=e;assertValidValue("Card","variant",e.variant,["elevated","outline","filled","flat"]),assertValidValue("Card","radius",e.radius,["sm","md","lg","xl","pill"]),assertValidValue("Card","padding",e.padding,["none","sm","md","lg","xl"]),assertValidValue("Card","titleFont",e.titleFont,["sans","serif"]),assertValidValue("Card","pressAnimation",e.pressAnimation,["scale","bounce","fade","sink","pulse","dim","false"]);const N=useTheme(),U=N.settings.components.card,G=s??U?.defaultVariant??"elevated",K=r??U?.defaultRadius??"lg",X=a??U?.defaultPadding??"md",$=m??U?.defaultTitleFont??"sans",J=useMobileUiText("card",CARD_TEXT),Q=useMemo(()=>({...J,...D}),[J,D]),Y=l||"function"==typeof k,Z=useContextMenu(B,{haptic:F||!1,testID:q,accessibilityActions:W.accessibilityActions,onAccessibilityAction:W.onAccessibilityAction}),ee=useMemo(()=>mergeRefs(t,Z.hostRef),[t,Z.hostRef]),te=Y||Z.enabled,{style:ie,pressIn:se,pressOut:oe}=usePressAnimation({preset:n||"scale",enabled:te&&!1!==n}),re=stylesFor(N),ae=Boolean(_),le=N.space[paddingMap[X]],ne=useMemo(()=>V?"string"==typeof V?N.settings.gradients[V]??null:V:null,[V,N.settings.gradients]),de="flat"===G,ce=de?N.radius.none:N.radius[K],ue=resolveBackground(N,d),[me,he]=useControllableState({value:y,defaultValue:x,onChange:f}),pe=b&&me,ge=hasBuiltInHeaderContent(e),be=Boolean(c)||ge,ye=useSquircle(!ae&&!ne&&!de,ce,E),xe=StyleSheet.flatten(M)??{},fe="string"==typeof xe.backgroundColor?xe.backgroundColor:void 0,je="string"==typeof xe.borderColor?xe.borderColor:void 0,Ce=fe??ue??("filled"===G?N.colors["bg-subtle"]:N.colors.surface),Se="outline"===G?N.size.border:0,ve=je??N.colors.border,we="none"===o?void 0:N.shadow[o],Re="elevated"===G&&supportsBoxShadow()&&we?toBoxShadow(we):void 0,Ae=ye.active&&"elevated"===G&&!Re,Te=ye.active&&!Ae?{backgroundColor:"transparent",borderColor:"transparent"}:null,Ve=useMemo(()=>{const e={borderRadius:Ae&&ye.size?squircleHostRadius(ye.size.width,ye.size.height,ce):ce,...smoothCorners,padding:ae||ye.active?N.space.none:le,overflow:ye.active?"visible":"hidden"};switch(G){case"flat":return{...e,backgroundColor:ue??N.colors.surface,borderBottomWidth:S,borderBottomColor:N.colors.border};case"outline":return{...e,backgroundColor:ye.active?"transparent":ue??N.colors.surface,borderWidth:N.size.border,borderColor:ye.active?"transparent":N.colors.border};case"filled":return{...e,backgroundColor:ye.active?"transparent":ue??N.colors["bg-subtle"]};default:return{...e,backgroundColor:ue??N.colors.surface,...Re?{boxShadow:Re}:we}}},[N,G,we,ce,ae,le,ye.active,ye.size,Re,Ae,ue,S]),ke=useMemo(()=>({..."number"==typeof R?{width:"100%",aspectRatio:R}:{width:"100%",height:w},borderTopLeftRadius:ce,borderTopRightRadius:ce,borderBottomLeftRadius:N.radius.none,borderBottomRightRadius:N.radius.none,...smoothCorners}),[N,ce,R,w]),Fe=u??"",Be=_jsxs(_Fragment,{children:[_jsxs(View,{style:re.titleColumn,children:[u?_jsx(Text,{variant:"title",accessibilityRole:"header",style:titleFaceFor(N,$),children:u}):null,h?_jsx(Text,{variant:"bodySmall",style:re.lead,children:h}):null,pe&&j?_jsx(Text,{variant:"caption",style:re.lead,children:j}):null]}),isCardTextAction(p)?_jsx(CardTextActionButton,{action:p,haptic:F}):p?_jsx(View,{style:re.actionNode,children:p}):null,g,b?_jsx(CardIconAction,{icon:pe?"chevron-down":"chevron-up",label:`${pe?Q.show:Q.hide} ${Fe}`.trim(),expanded:!pe,onPress:()=>he(!pe),haptic:F}):null,C?_jsx(CardIconAction,{icon:"trash",label:Q.remove,onPress:C,color:N.colors["danger-text"],haptic:F}):null]}),Ie=_jsxs(_Fragment,{children:[be?_jsx(View,{style:[re.header,!c&&re.headerRow,pe&&re.headerFolded,z],children:c??Be}):null,pe?null:_jsx(View,{style:[be||v?re.body:null,L],children:i}),v&&!pe?_jsx(View,{style:[re.footer,O],children:v}):null]}),Pe=_?_jsxs(_Fragment,{children:[_jsxs(View,{style:re.imageWrapper,children:[_jsx(Image,{source:_,resizeMode:"cover",style:ke,accessibilityLabel:"",accessible:!1}),A?_jsx(View,{pointerEvents:"box-none",style:re.imageOverlay,children:A}):null]}),_jsx(View,{style:{padding:le},children:Ie})]}):Ie,He=ne?_jsxs(_Fragment,{children:[_jsx(Gradient,{gradient:ne,style:StyleSheet.absoluteFill}),Pe]}):ye.active&&ye.size?_jsxs(_Fragment,{children:[_jsx(SquircleFill,{width:ye.size.width,height:ye.size.height,radius:ce,fill:Ce,stroke:Se?ve:void 0,strokeWidth:Se}),_jsx(View,{style:[re.squircleClip,{padding:le,borderRadius:ye.size?squircleHostRadius(ye.size.width,ye.size.height,ce):ce}],children:Pe})]}):Pe;let Me;if(te){const handlePress=e=>{Y&&(F&&triggerHaptic(F),k?.(e))};Me=_jsx(Animated.View,{style:ie,children:_jsx(Pressable,{ref:ee,onPress:handlePress,onPressIn:se,onPressOut:oe,accessibilityRole:H??(Y?"button":void 0),accessibilityLabel:I,accessibilityHint:P,testID:q,onLayout:ye.onLayout,style:[Ve,M,Te],...W,...Z.hostProps,children:He})})}else Me=_jsx(View,{ref:t,accessibilityLabel:I,accessibilityHint:P,accessibilityRole:H,testID:q,onLayout:ye.onLayout,style:[Ve,M,Te],...W,children:He});return T?_jsx(CardSkeleton,{...e}):Z.enabled?_jsxs(_Fragment,{children:[Me,Z.renderSurface(_jsx(View,{style:[Ve,M,Te,re.preview],children:He}))]}):Me})),CardSkeleton=({variant:e,elevation:t,radius:i,padding:s,bg:o,header:r,footer:a,imageSource:l,imageHeight:n=160,imageAspectRatio:d,headerStyle:c,bodyStyle:u,footerStyle:m,style:h,labels:p,...g})=>{const b=useTheme(),y=b.settings.components.card,x=e??y?.defaultVariant??"elevated",f=i??y?.defaultRadius??"lg",j=s??y?.defaultPadding??"md",C={...useMobileUiText("card",CARD_TEXT),...p},S=paddingMap[j],v=b.space[S],_="flat"===x?b.radius.none:b.radius[f],w=void 0!==r||hasBuiltInHeaderContent(g),R=resolveBackground(b,o)??b.colors.surface,A="outline"===x?1:0,T="outline"===x?b.colors.border:void 0;return _jsxs(View,{style:[{backgroundColor:R,borderRadius:_,...smoothCorners,borderWidth:A,borderColor:T,overflow:"hidden"},h],accessibilityRole:"progressbar",accessibilityLabel:C.loading,accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==l?_jsx(Skeleton,{width:"100%",height:d?void 0:n,style:d?{aspectRatio:d,width:"100%"}:void 0}):null,w?_jsx(View,{style:[{padding:v,paddingBottom:b.space.sm},c],children:_jsx(Skeleton,{shape:"text",width:"60%",height:18})}):null,_jsx(View,{style:[{padding:v},u],children:_jsx(SkeletonText,{lines:3,fontSize:b.text.base.size,lastLineWidth:"55%"})}),void 0!==a?_jsx(View,{style:[{padding:v,paddingTop:b.space.sm,flexDirection:"row"},m],children:_jsx(Skeleton,{width:88,height:32,shape:"rounded"})}):null]})};CardSkeleton.displayName="CardSkeleton";const Card=Object.assign(CardRoot,{Skeleton:CardSkeleton});Card.displayName="Card";const hasBuiltInHeaderContent=e=>Boolean(e.title||e.lead||e.action||e.headerActions||e.collapsible||e.onRemove),isCardTextAction=e=>"object"==typeof e&&null!==e&&!React.isValidElement(e)&&"label"in e&&"onPress"in e,HIT_TARGET=44,CardIconAction=({icon:e,label:t,onPress:i,expanded:s,color:o,haptic:r})=>{const a=useTheme();return _jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:t,accessibilityState:void 0===s?void 0:{expanded:s},"aria-expanded":s,onPress:()=>{r&&triggerHaptic(r),i()},style:iconActionStyle,children:_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:_jsx(AppIcon,{name:e,size:20,color:o??a.colors["text-body"]})})})},CardTextActionButton=({action:e,haptic:t})=>_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,onPress:()=>{t&&triggerHaptic(t),e.onPress()},style:textActionStyle,children:_jsx(Text,{variant:"label",weight:"semibold",color:"brand",children:e.label})}),iconActionStyle={width:44,height:44,alignItems:"center",justifyContent:"center"},textActionStyle={minWidth:44,minHeight:44,alignItems:"center",justifyContent:"center"},titleFaceFor=(e,t)=>"serif"===t?fontFor(e,"semibold","display"):{fontFamily:void 0,...fontFor(e,"semibold")},resolveBackground=(e,t)=>{if(null!=t)return isOneOf(BACKGROUND_TOKENS,t)?e.colors[t]:t},buildStyles=e=>StyleSheet.create({header:{marginBottom:e.space.md},headerRow:{flexDirection:"row",alignItems:"center",gap:e.space.sm},headerFolded:{marginBottom:e.space.none},titleColumn:{flex:1},lead:{marginTop:e.space.xs},actionNode:{flexShrink:0},body:{flexShrink:1},footer:{marginTop:e.space.md},imageWrapper:{position:"relative"},imageOverlay:{...StyleSheet.absoluteFill},squircleClip:{overflow:"hidden",...smoothCorners},preview:{margin:e.space.none,marginTop:e.space.none,marginBottom:e.space.none,marginLeft:e.space.none,marginRight:e.space.none,marginStart:e.space.none,marginEnd:e.space.none,marginHorizontal:e.space.none,marginVertical:e.space.none,position:"relative",top:0,left:0,width:"100%",height:"100%"}}),stylesFor=themeStyles(buildStyles);export{Card};export default Card;
|
|
1
|
+
"use strict";import React,{forwardRef,useMemo}from"react";import{Animated,Image,Pressable,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{useMobileUiText}from"../../text/index.js";import{CARD_TEXT}from"../../text/phone/card.g.js";import{fontFor,Gradient,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{isOneOf}from"../../utils/guards.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{supportsBoxShadow,toBoxShadow}from"../../utils/shadows.js";import{squircleHostRadius}from"../../utils/squircle.js";import{themeStyles}from"../../utils/themeStyles.js";import{AppIcon}from"../AppIcon/AppIcon.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{Skeleton,SkeletonText}from"../Skeleton/index.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const OUTER_LAYOUT_KEYS=new Set(["flex","flexGrow","flexShrink","flexBasis","alignSelf","width","height","minWidth","maxWidth","minHeight","maxHeight","position","top","right","bottom","left","start","end","zIndex"]),splitOuterLayout=e=>{const t={},i={};for(const[s,o]of Object.entries(StyleSheet.flatten(e)??{}))(OUTER_LAYOUT_KEYS.has(s)||s.startsWith("margin")?t:i)[s]=o;return{outer:t,inner:i}},BACKGROUND_TOKENS=["bg","bg-subtle","bg-muted","surface","scrim","surface-inverse","primary-wash"],paddingMap={none:"none",sm:"sm",md:"lg",lg:"xl",xl:"2xl"},CardRoot=React.memo(forwardRef((e,t)=>{const{children:i,variant:s,elevation:o="card",radius:r,padding:a,interactive:l=!1,pressAnimation:n="scale",bg:d,header:c,title:u,titleFont:m,lead:h,action:p,headerActions:g,collapsible:b=!1,collapsed:f,defaultCollapsed:y=!1,onCollapsedChange:x,collapsedSummary:S,onRemove:j,separatorHeight:C=StyleSheet.hairlineWidth,footer:v,imageSource:_,imageHeight:w=160,imageAspectRatio:R,imageOverlay:A,loading:T=!1,gradient:V,onPress:F,haptic:k,contextMenu:B,accessibilityLabel:I,accessibilityHint:H,accessibilityRole:L,style:O,headerStyle:P,bodyStyle:z,footerStyle:M,testID:E,labels:q,onLayout:W,...D}=e;assertValidValue("Card","variant",e.variant,["elevated","outline","filled","flat"]),assertValidValue("Card","radius",e.radius,["sm","md","lg","xl","pill"]),assertValidValue("Card","padding",e.padding,["none","sm","md","lg","xl"]),assertValidValue("Card","titleFont",e.titleFont,["sans","serif"]),assertValidValue("Card","pressAnimation",e.pressAnimation,["scale","bounce","fade","sink","pulse","dim","false"]);const U=useTheme(),N=U.settings.components.card,G=s??N?.defaultVariant??"elevated",K=r??N?.defaultRadius??"lg",Y=a??N?.defaultPadding??"md",X=m??N?.defaultTitleFont??"sans",$=useMobileUiText("card",CARD_TEXT),J=useMemo(()=>({...$,...q}),[$,q]),Q=l||"function"==typeof F,Z=useContextMenu(B,{haptic:k||!1,testID:E,accessibilityActions:D.accessibilityActions,onAccessibilityAction:D.onAccessibilityAction}),ee=useMemo(()=>mergeRefs(t,Z.hostRef),[t,Z.hostRef]),te=Q||Z.enabled,{style:ie,pressIn:se,pressOut:oe}=usePressAnimation({preset:n||"scale",enabled:te&&!1!==n}),re=stylesFor(U),ae=Boolean(_),le=U.space[paddingMap[Y]],ne=useMemo(()=>V?"string"==typeof V?U.settings.gradients[V]??null:V:null,[V,U.settings.gradients]),de="flat"===G,ce=de?U.radius.none:U.radius[K],ue=resolveBackground(U,d),[me,he]=useControllableState({value:f,defaultValue:y,onChange:x}),pe=b&&me,ge=hasBuiltInHeaderContent(e),be=Boolean(c)||ge,fe=useSquircle(!ae&&!ne&&!de,ce,W),ye=StyleSheet.flatten(O)??{},xe="string"==typeof ye.backgroundColor?ye.backgroundColor:void 0,Se="string"==typeof ye.borderColor?ye.borderColor:void 0,je=xe??ue??("filled"===G?U.colors["bg-subtle"]:U.colors.surface),Ce="outline"===G?U.size.border:0,ve=Se??U.colors.border,we="none"===o?void 0:U.shadow[o],Re="elevated"===G&&supportsBoxShadow()&&we?toBoxShadow(we):void 0,Ae=fe.active&&"elevated"===G&&!Re,Te=fe.active&&!Ae?{backgroundColor:"transparent",borderColor:"transparent"}:null,Ve=useMemo(()=>{const e={borderRadius:Ae&&fe.size?squircleHostRadius(fe.size.width,fe.size.height,ce):ce,...smoothCorners,padding:ae||fe.active?U.space.none:le,overflow:fe.active?"visible":"hidden"};switch(G){case"flat":return{...e,backgroundColor:ue??U.colors.surface,borderBottomWidth:C,borderBottomColor:U.colors.border};case"outline":return{...e,backgroundColor:fe.active?"transparent":ue??U.colors.surface,borderWidth:U.size.border,borderColor:fe.active?"transparent":U.colors.border};case"filled":return{...e,backgroundColor:fe.active?"transparent":ue??U.colors["bg-subtle"]};default:return{...e,backgroundColor:ue??U.colors.surface,...Re?{boxShadow:Re}:we}}},[U,G,we,ce,ae,le,fe.active,fe.size,Re,Ae,ue,C]),Fe=useMemo(()=>({..."number"==typeof R?{width:"100%",aspectRatio:R}:{width:"100%",height:w},borderTopLeftRadius:ce,borderTopRightRadius:ce,borderBottomLeftRadius:U.radius.none,borderBottomRightRadius:U.radius.none,...smoothCorners}),[U,ce,R,w]),ke=u??"",Be=_jsxs(_Fragment,{children:[_jsxs(View,{style:re.titleColumn,children:[u?_jsx(Text,{variant:"title",accessibilityRole:"header",style:titleFaceFor(U,X),children:u}):null,h?_jsx(Text,{variant:"bodySmall",style:re.lead,children:h}):null,pe&&S?_jsx(Text,{variant:"caption",style:re.lead,children:S}):null]}),isCardTextAction(p)?_jsx(CardTextActionButton,{action:p,haptic:k}):p?_jsx(View,{style:re.actionNode,children:p}):null,g,b?_jsx(CardIconAction,{icon:pe?"chevron-down":"chevron-up",label:`${pe?J.show:J.hide} ${ke}`.trim(),expanded:!pe,onPress:()=>he(!pe),haptic:k}):null,j?_jsx(CardIconAction,{icon:"trash",label:J.remove,onPress:j,color:U.colors["danger-text"],haptic:k}):null]}),Ie=_jsxs(_Fragment,{children:[be?_jsx(View,{style:[re.header,!c&&re.headerRow,pe&&re.headerFolded,P],children:c??Be}):null,pe?null:_jsx(View,{style:[be||v?re.body:null,z],children:i}),v&&!pe?_jsx(View,{style:[re.footer,M],children:v}):null]}),He=_?_jsxs(_Fragment,{children:[_jsxs(View,{style:re.imageWrapper,children:[_jsx(Image,{source:_,resizeMode:"cover",style:Fe,accessibilityLabel:"",accessible:!1}),A?_jsx(View,{pointerEvents:"box-none",style:re.imageOverlay,children:A}):null]}),_jsx(View,{style:{padding:le},children:Ie})]}):Ie,Le=ne?_jsxs(_Fragment,{children:[_jsx(Gradient,{gradient:ne,style:StyleSheet.absoluteFill}),He]}):fe.active&&fe.size?_jsxs(_Fragment,{children:[_jsx(SquircleFill,{width:fe.size.width,height:fe.size.height,radius:ce,fill:je,stroke:Ce?ve:void 0,strokeWidth:Ce}),_jsx(View,{style:[re.squircleClip,{padding:le,borderRadius:fe.size?squircleHostRadius(fe.size.width,fe.size.height,ce):ce}],children:He})]}):He,{outer:Oe,inner:Pe}=splitOuterLayout(O);let ze;if(te){const handlePress=e=>{Q&&(k&&triggerHaptic(k),F?.(e))};ze=_jsx(Animated.View,{style:[ie,Oe],children:_jsx(Pressable,{ref:ee,onPress:handlePress,onPressIn:se,onPressOut:oe,accessibilityRole:L??(Q?"button":void 0),accessibilityLabel:I,accessibilityHint:H,testID:E,onLayout:fe.onLayout,style:[Ve,Pe,Te,re.pressFill],...D,...Z.hostProps,children:Le})})}else ze=_jsx(View,{ref:t,accessibilityLabel:I,accessibilityHint:H,accessibilityRole:L,testID:E,onLayout:fe.onLayout,style:[Ve,O,Te],...D,children:Le});return T?_jsx(CardSkeleton,{...e}):Z.enabled?_jsxs(_Fragment,{children:[ze,Z.renderSurface(_jsx(View,{style:[Ve,O,Te,re.preview],children:Le}))]}):ze})),CardSkeleton=({variant:e,elevation:t,radius:i,padding:s,bg:o,header:r,footer:a,imageSource:l,imageHeight:n=160,imageAspectRatio:d,headerStyle:c,bodyStyle:u,footerStyle:m,style:h,labels:p,...g})=>{const b=useTheme(),f=b.settings.components.card,y=e??f?.defaultVariant??"elevated",x=i??f?.defaultRadius??"lg",S=s??f?.defaultPadding??"md",j={...useMobileUiText("card",CARD_TEXT),...p},C=paddingMap[S],v=b.space[C],_="flat"===y?b.radius.none:b.radius[x],w=void 0!==r||hasBuiltInHeaderContent(g),R=resolveBackground(b,o)??b.colors.surface,A="outline"===y?1:0,T="outline"===y?b.colors.border:void 0;return _jsxs(View,{style:[{backgroundColor:R,borderRadius:_,...smoothCorners,borderWidth:A,borderColor:T,overflow:"hidden"},h],accessibilityRole:"progressbar",accessibilityLabel:j.loading,accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==l?_jsx(Skeleton,{width:"100%",height:d?void 0:n,style:d?{aspectRatio:d,width:"100%"}:void 0}):null,w?_jsx(View,{style:[{padding:v,paddingBottom:b.space.sm},c],children:_jsx(Skeleton,{shape:"text",width:"60%",height:18})}):null,_jsx(View,{style:[{padding:v},u],children:_jsx(SkeletonText,{lines:3,fontSize:b.text.base.size,lastLineWidth:"55%"})}),void 0!==a?_jsx(View,{style:[{padding:v,paddingTop:b.space.sm,flexDirection:"row"},m],children:_jsx(Skeleton,{width:88,height:32,shape:"rounded"})}):null]})};CardSkeleton.displayName="CardSkeleton";const Card=Object.assign(CardRoot,{Skeleton:CardSkeleton});Card.displayName="Card";const hasBuiltInHeaderContent=e=>Boolean(e.title||e.lead||e.action||e.headerActions||e.collapsible||e.onRemove),isCardTextAction=e=>"object"==typeof e&&null!==e&&!React.isValidElement(e)&&"label"in e&&"onPress"in e,HIT_TARGET=44,CardIconAction=({icon:e,label:t,onPress:i,expanded:s,color:o,haptic:r})=>{const a=useTheme();return _jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:t,accessibilityState:void 0===s?void 0:{expanded:s},"aria-expanded":s,onPress:()=>{r&&triggerHaptic(r),i()},style:iconActionStyle,children:_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:_jsx(AppIcon,{name:e,size:20,color:o??a.colors["text-body"]})})})},CardTextActionButton=({action:e,haptic:t})=>_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,onPress:()=>{t&&triggerHaptic(t),e.onPress()},style:textActionStyle,children:_jsx(Text,{variant:"label",weight:"semibold",color:"brand",children:e.label})}),iconActionStyle={width:44,height:44,alignItems:"center",justifyContent:"center"},textActionStyle={minWidth:44,minHeight:44,alignItems:"center",justifyContent:"center"},titleFaceFor=(e,t)=>"serif"===t?fontFor(e,"semibold","display"):{fontFamily:void 0,...fontFor(e,"semibold")},resolveBackground=(e,t)=>{if(null!=t)return isOneOf(BACKGROUND_TOKENS,t)?e.colors[t]:t},buildStyles=e=>StyleSheet.create({header:{marginBottom:e.space.md},headerRow:{flexDirection:"row",alignItems:"center",gap:e.space.sm},headerFolded:{marginBottom:e.space.none},titleColumn:{flex:1},lead:{marginTop:e.space.xs},actionNode:{flexShrink:0},body:{flexShrink:1},footer:{marginTop:e.space.md},imageWrapper:{position:"relative"},imageOverlay:{...StyleSheet.absoluteFill},squircleClip:{overflow:"hidden",...smoothCorners},pressFill:{flexGrow:1},preview:{margin:e.space.none,marginTop:e.space.none,marginBottom:e.space.none,marginLeft:e.space.none,marginRight:e.space.none,marginStart:e.space.none,marginEnd:e.space.none,marginHorizontal:e.space.none,marginVertical:e.space.none,position:"relative",top:0,left:0,width:"100%",height:"100%"}}),stylesFor=themeStyles(buildStyles);export{Card};export default Card;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useMemo}from"react";import{Pressable,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{isRecord}from"../../utils/guards.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{hasChoiceDetail}from"../FieldBase/ChoiceText.js";import{RadioDot}from"../Radio/RadioDot.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const sizeTokensOf=e=>({sm:{paddingHorizontal:e.space.sm,chipPaddingHorizontal:e.space.md,paddingVertical:e.space.xs,fontSize:e.text.sm.size,minHeight:32,iconSize:14},md:{paddingHorizontal:e.space.md,chipPaddingHorizontal:e.space.lg,paddingVertical:e.space.sm,fontSize:e.text.base.size,minHeight:40,iconSize:16},lg:{paddingHorizontal:e.space.lg,chipPaddingHorizontal:e.space.xl,paddingVertical:e.space.md,fontSize:e.text.lg.size,minHeight:48,iconSize:18}}),isChoiceOption=e=>isRecord(e)&&("string"==typeof e.value||"number"==typeof e.value);function ChoiceGroup(e){const{ref:i,options:o,getOptionLabel:t,getOptionValue:r,isOptionDisabled:s,getOptionDescription:l,getOptionIcon:a,getOptionColor:n,renderOption:
|
|
1
|
+
"use strict";import{useCallback,useMemo}from"react";import{Pressable,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{isRecord}from"../../utils/guards.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{FieldLabel,hasFieldText}from"../FieldBase/index.js";import{hasChoiceDetail}from"../FieldBase/ChoiceText.js";import{RadioDot}from"../Radio/RadioDot.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const sizeTokensOf=e=>({sm:{paddingHorizontal:e.space.sm,chipPaddingHorizontal:e.space.md,paddingVertical:e.space.xs,fontSize:e.text.sm.size,minHeight:32,iconSize:14},md:{paddingHorizontal:e.space.md,chipPaddingHorizontal:e.space.lg,paddingVertical:e.space.sm,fontSize:e.text.base.size,minHeight:40,iconSize:16},lg:{paddingHorizontal:e.space.lg,chipPaddingHorizontal:e.space.xl,paddingVertical:e.space.md,fontSize:e.text.lg.size,minHeight:48,iconSize:18}}),isChoiceOption=e=>isRecord(e)&&("string"==typeof e.value||"number"==typeof e.value);function ChoiceGroup(e){const{ref:i,options:o,getOptionLabel:t,getOptionValue:r,isOptionDisabled:s,getOptionDescription:l,getOptionIcon:a,getOptionColor:n,renderOption:d,variant:c="card",indicatorPosition:p="trailing",direction:u="row",gap:h,wrap:m=!1,fullWidth:g,disabled:b=!1,size:x="md",labelLines:f,descriptionLines:y=2,haptic:C,accessibilityLabel:z,style:v,optionStyle:j,label:V,required:S=!1,description:H,helperText:w,error:O,testID:T}=e,_=useTheme(),k=useMemo(()=>buildStyles(_),[_]),G=useMemo(()=>sizeTokensOf(_)[x],[_,x]);assertValidValue("ChoiceGroup","variant",e.variant,["card","chip"]),assertValidValue("ChoiceGroup","size",e.size,["sm","md","lg"]),assertValidValue("ChoiceGroup","direction",e.direction,["row","column"]),assertValidValue("ChoiceGroup","indicatorPosition",e.indicatorPosition,["leading","trailing"]),assertValidValue("ChoiceGroup","selectionMode",e.selectionMode,["single","multiple"]);const D=useCallback(e=>t?t(e):isChoiceOption(e)?e.label??"":"",[t]),L=useCallback(e=>{if(r)return r(e);if(isChoiceOption(e))return e.value;throw new Error("ChoiceGroup option has no value; pass getOptionValue.")},[r]),M=useCallback(e=>s?s(e):isChoiceOption(e)&&!0===e.disabled,[s]),F=useCallback(e=>l?l(e):isChoiceOption(e)?e.description:void 0,[l]),P=useCallback(e=>a?a(e):isChoiceOption(e)?e.icon:void 0,[a]),I=useCallback(e=>n?n(e):isChoiceOption(e)?e.color:void 0,[n]),R="multiple"===e.selectionMode,{min:A,max:W}=e,B=useCallback(i=>{if("multiple"!==e.selectionMode){if("string"!=typeof i&&"number"!=typeof i)throw new Error(`ChoiceGroup received a ${Array.isArray(i)?"list":"missing"} value in single mode.`);e.onChange?.(i)}else{if(!Array.isArray(i))throw new Error("ChoiceGroup received a single value in multiple mode.");e.onChange?.(i)}},[e.onChange,e.selectionMode]),[E,$]=useControllableState({controlled:"value"in e,value:e.value,defaultValue:e.defaultValue??(R?[]:void 0),onChange:B}),q=Array.isArray(E)?E:[],N=useCallback(e=>{const i=L(e);if(R){const e=q.includes(i);if(e&&null!=A&&q.length<=A)return;if(!e&&null!=W&&q.length>=W)return;const o=resolveHaptic(C,"selection");return o&&triggerHaptic(o),void $(e?q.filter(e=>e!==i):[...q,i])}const o=resolveHaptic(C,"selection");o&&triggerHaptic(o),$(i)},[C,R,A,W,q,$,L]),J=g??("card"===c&&"row"===u&&!m),K=m||J&&"row"===u,Q=_.radius.md,surfaceFor=(e,i,o)=>i?{borderColor:_.colors.border,backgroundColor:_.colors["surface-disabled"]}:{borderColor:e?o:_.colors.border,backgroundColor:e?tintOf(o,.12,_.colors["surface-selected"]):_.colors.bg},renderIcon=(e,i,o,t)=>{const r=P(e);if(null==r)return null;return renderSlotIcon("string"==typeof r&&i?{name:r,variant:"bold"}:r,{color:o,size:G.iconSize,disabled:t})},renderChip=e=>{const{option:i,selected:o,disabled:t,color:r}=e,s=t?_.colors["text-disabled"]:o?r:_.colors["text-body"],l=renderIcon(i,o,s,t);return _jsxs(View,{style:[k.chip,{minHeight:G.minHeight,paddingHorizontal:G.chipPaddingHorizontal,paddingVertical:G.paddingVertical,borderRadius:_.radius.pill,...smoothCorners,borderWidth:_.size.border,...surfaceFor(o,t,r),columnGap:_.space.xs}],children:[l?_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:l}):null,_jsx(Text,{weight:"medium",numberOfLines:f,ellipsizeMode:"tail",style:[k.cardLabel,{color:s,fontSize:G.fontSize,lineHeight:Math.round(G.fontSize*_.leading.body)}],children:D(i)})]})},renderDefaultCard=e=>{const{option:i,selected:o,disabled:t,color:r}=e,s=t?_.colors["text-disabled"]:o?r:I(i)??_.colors["text-body"],l=F(i),a=renderIcon(i,o,s,t),n=_jsx(RadioDot,{selected:o,color:r,disabled:t,size:x});return _jsxs(View,{style:[k.card,{minHeight:G.minHeight,paddingHorizontal:G.paddingHorizontal,paddingVertical:G.paddingVertical,borderRadius:Q,...smoothCorners,borderWidth:_.size.border,...surfaceFor(o,t,r),columnGap:_.space.sm}],children:["leading"===p?n:null,a?_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:a}):null,_jsxs(View,{style:k.cardTextWrap,children:[_jsx(Text,{weight:"medium",numberOfLines:f,ellipsizeMode:"tail",style:[k.cardLabel,{color:s,fontSize:G.fontSize,lineHeight:Math.round(G.fontSize*_.leading.body)}],children:D(i)}),l?_jsx(Text,{numberOfLines:y,ellipsizeMode:"tail",style:[k.cardDescription,{color:o?_.colors["text-muted"]:_.colors["text-subtle"],fontSize:_.text.xs.size,lineHeight:Math.round(_.text.xs.size*_.leading.body)}],children:l}):null]}),"trailing"===p?n:null]})},U="string"==typeof O&&""!==O?O:void 0,X=!0===O||void 0!==U?null:w,Y=_jsx(View,{ref:i,accessibilityRole:R?void 0:"radiogroup",accessibilityLabel:z??("string"==typeof V?V:void 0),accessibilityState:{disabled:b},"aria-disabled":b,testID:T,style:[{flexDirection:u,gap:h??_.space.sm,flexWrap:K?"wrap":"nowrap"},v],children:o.map((e,i)=>{const o=L(e),t=R?q.includes(o):E===o,r=R&&null!=W&&!t&&q.length>=W,s=b||r||M(e),l=I(e)??_.colors.primary,a=d||"card"!==c?void 0:F(e);return _jsx(Pressable,{testID:isChoiceOption(e)?e.testID:void 0,onPress:()=>{s||N(e)},disabled:s,accessibilityRole:R?"checkbox":"radio",accessibilityLabel:a?`${D(e)}, ${a}`:D(e),accessibilityState:{checked:t,disabled:s},"aria-checked":t,"aria-disabled":s,style:[J?k.stretchOption:null,{opacity:s&&d?.55:1},j],children:({pressed:o})=>{const r={option:e,index:i,selected:t,pressed:o&&!s,disabled:s,color:l};return _jsx(_Fragment,{children:d?d(r):"chip"===c?renderChip(r):renderDefaultCard(r)})}},String(o))})}),Z=hasFieldText(V);return Z||hasChoiceDetail({description:H,error:U,helperText:X??void 0})?_jsxs(View,{children:[Z?_jsx(FieldLabel,{size:x,required:S,children:V}):null,H?_jsx(Text,{variant:"bodySmall",color:"secondary",style:{marginBottom:_.space.xs},children:H}):null,Y,void 0!==U?_jsx(Text,{variant:"caption",color:"danger",accessibilityLiveRegion:"polite",style:{marginTop:_.space.xs},children:U}):X?_jsx(Text,{variant:"caption",color:"tertiary",style:{marginTop:_.space.xs},children:X}):null]}):Y}ChoiceGroup.displayName="ChoiceGroup";const buildStyles=e=>StyleSheet.create({stretchOption:{flexGrow:1,flexShrink:0,flexBasis:"auto"},card:{flexDirection:"row",alignItems:"center"},chip:{flexDirection:"row",alignItems:"center",justifyContent:"center"},cardTextWrap:{flexGrow:1,flexShrink:1,flexBasis:"auto"},cardLabel:{includeFontPadding:!1},cardDescription:{includeFontPadding:!1,marginTop:e.space.xxs}});export{ChoiceGroup};export default ChoiceGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,StyleSheet,Text,View}from"react-native";import{useFieldErrorAnchor}from"../../hooks/useFieldErrorScroll.js";import{fillText,useMobileUiText}from"../../text/index.js";import{FORM_FIELD_TEXT}from"../../text/phone/formField.g.js";import{createAnimatedValue,fontFor,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{fieldTextAsString,hasFieldText,RequiredMark}from"../FieldBase/index.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const FormField=forwardRef((e,t)=>{assertValidValue("FormField","layout",e.layout,["stacked","inline"]);const{label:
|
|
1
|
+
"use strict";import React,{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,StyleSheet,Text,View}from"react-native";import{useFieldErrorAnchor}from"../../hooks/useFieldErrorScroll.js";import{fillText,useMobileUiText}from"../../text/index.js";import{FORM_FIELD_TEXT}from"../../text/phone/formField.g.js";import{createAnimatedValue,fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{fieldTextAsString,hasFieldText,RequiredMark}from"../FieldBase/index.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const FormField=forwardRef((e,t)=>{assertValidValue("FormField","layout",e.layout,["stacked","inline"]);const{label:l,help:i,helperText:r,error:s,required:o=!1,children:n,layout:a="stacked",helperLines:d,labelStyle:x,helperStyle:m,errorStyle:u,style:c,inputContainerStyle:f,accessibilityLabel:h,labels:p,testID:F}=e,T=useFieldErrorAnchor(hasFieldText(s),t),b=useTheme(),S=useMemo(()=>buildStyles(b),[b]),y=useMobileUiText("formField",FORM_FIELD_TEXT),j=useMemo(()=>({...y,...p}),[y,p]),v=fieldTextAsString(s),k=useRef(createAnimatedValue(s?1:0)).current;useEffect(()=>{const e=Animated.timing(k,{toValue:s?1:0,duration:b.motion.duration.fast,useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[s,k,b.motion.duration.fast]);const I=useMemo(()=>{if(h)return h;const e=fieldTextAsString(l);return e?v?fillText(j.labelWithError,{label:e,error:v}):e:void 0},[h,l,v,j]),g=resolveFieldSize(b,"md"),_=useTextInk(x,g["label-text"],b.colors["field-label"]),V=useTextInk(m,g["message-text"],b.colors["text-muted"]),w=useTextInk(u,g["message-text"],b.colors["field-message"]),R=hasFieldText(l),E=_jsxs(Text,{style:[S.label,"inline"!==a||hasFieldText(i)?null:S.labelInline,hasFieldText(i)?S.labelShrink:null,x],children:[_jsx(TextInkContext.Provider,{value:_,children:l}),o?_jsx(RequiredMark,{}):null]}),D=R?hasFieldText(i)?_jsxs(View,{style:[S.labelRow,"inline"===a?S.labelInline:null],children:[E,_jsx(View,{style:[S.help,{marginLeft:b.space.xs}],children:i})]}):E:null,A="inline"===a?S.inputInline:S.inputStacked,M=hasFieldText(s),L=!M&&hasFieldText(r),z=o&&!R&&React.isValidElement(n)?React.cloneElement(n,{required:!0}):n;return _jsxs(View,{ref:T,style:["inline"===a?S.rootInline:S.rootStacked,c],accessibilityLabel:I,accessibilityHint:v||void 0,testID:F,children:[D,_jsx(View,{style:[A,f],children:z}),L?_jsx(Text,{style:[S.helper,m],numberOfLines:d||void 0,children:_jsx(TextInkContext.Provider,{value:V,children:r})}):null,M?_jsx(Animated.Text,{style:[S.error,{opacity:k},u],numberOfLines:d||void 0,accessibilityLiveRegion:"polite",children:_jsx(TextInkContext.Provider,{value:w,children:s})}):null]})});FormField.displayName="FormField";const buildStyles=e=>{const t=resolveFieldSize(e,"md");return StyleSheet.create({rootStacked:{flexDirection:"column",gap:e.space.xs},rootInline:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:e.space.xs},label:{fontSize:t["label-text"],...fontFor(e,"semibold"),color:e.colors["field-label"]},labelShrink:{flexShrink:1},labelRow:{flexDirection:"row",alignItems:"center"},help:{flexShrink:0},labelInline:{width:"35%"},inputStacked:{width:"100%"},inputInline:{flex:1,minWidth:0},helper:{fontSize:t["message-text"],...fontFor(e,"normal"),color:e.colors["text-muted"]},error:{fontSize:t["message-text"],...fontFor(e,"normal"),color:e.colors["field-message"]}})};export{FormField};export default FormField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef}from"react";import{Keyboard,Pressable,RefreshControl}from"react-native";import{KeyboardAwareScrollView as ControllerScrollView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useTheme}from"../../theme/index.js";import{jsx as _jsx}from"react/jsx-runtime";const tapAreaStyle={flexGrow:1},KeyboardAwareScrollView=forwardRef((e,r)=>{const{children:o,bottomOffset:t=24,extraKeyboardSpace:
|
|
1
|
+
"use strict";import{forwardRef}from"react";import{Keyboard,Pressable,RefreshControl,StyleSheet}from"react-native";import{KeyboardAwareScrollView as ControllerScrollView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useTheme}from"../../theme/index.js";import{jsx as _jsx}from"react/jsx-runtime";const tapAreaStyle={flexGrow:1},CHILD_LAYOUT_KEYS=["gap","rowGap","columnGap","flexDirection","flexWrap","alignItems","alignContent","justifyContent"],childLayout=e=>{const r=StyleSheet.flatten(e),o={};for(const e of CHILD_LAYOUT_KEYS)void 0!==r?.[e]&&Object.assign(o,{[e]:r[e]});return o},KeyboardAwareScrollView=forwardRef((e,r)=>{const{children:o,bottomOffset:t=24,extraKeyboardSpace:a=0,safeAreaEdges:l=["bottom"],refreshing:s=!1,onRefresh:n,dismissOnTapOutside:i=!0,contentContainerStyle:d,refreshControl:c,...f}=e,m=useTheme(),p=useSafeAreaInsets(),y=l.includes("bottom"),b={paddingBottom:y?p.bottom:0,...l.includes("top")?{paddingTop:p.top}:null,...l.includes("left")?{paddingLeft:p.left}:null,...l.includes("right")?{paddingRight:p.right}:null},u=c??(n?_jsx(RefreshControl,{refreshing:s,onRefresh:n,tintColor:m.colors.primary,colors:[m.colors.primary],progressBackgroundColor:m.colors.surface,titleColor:m.colors["text-muted"]}):void 0);return _jsx(ControllerScrollView,{ref:r,bottomOffset:t,extraKeyboardSpace:a-(y?p.bottom:0),disableScrollOnKeyboardHide:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"none",contentContainerStyle:[d,b],refreshControl:u,...f,children:i?_jsx(Pressable,{accessible:!1,onPress:Keyboard.dismiss,style:[tapAreaStyle,childLayout(d)],children:o}):o})});KeyboardAwareScrollView.displayName="KeyboardAwareScrollView";export{KeyboardAwareScrollView};export default KeyboardAwareScrollView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{countryFlagEmoji,formatPhoneAsTyped,getFormatterConfig,getPhoneCountries,isSupportedCountry,isValidNationalNumber,maxNationalNumberLength,reportIdleActivity,splitPhoneNumber}from"@webority/mobile-core";import{PHONE_COUNTRY_NAMES}from"@webority/mobile-core/phone/countries";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{PHONE_NUMBER_INPUT_TEXT}from"../../text/phone/phoneNumberInput.g.js";import{fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,RequiredPlaceholder,resolveFieldTextStyle}from"../FieldBase/index.js";import{Chevron}from"../FieldBase/Chevron.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_CALLING_CODES=[{iso:"AU",code:"61",label:"Australia"},{iso:"CA",code:"1",label:"Canada"},{iso:"IN",code:"91",label:"India"},{iso:"SA",code:"966",label:"Saudi Arabia"},{iso:"SG",code:"65",label:"Singapore"},{iso:"AE",code:"971",label:"United Arab Emirates"},{iso:"GB",code:"44",label:"United Kingdom"},{iso:"US",code:"1",label:"United States"}];export const ALL_CALLING_CODES=getPhoneCountries().map(e=>({iso:e.iso,code:e.callingCode,label:PHONE_COUNTRY_NAMES[e.iso]??e.iso})).sort((e,t)=>e.label.localeCompare(t.label));const digitsOnly=e=>e.replace(/[^0-9]/g,"");export const formatE164=e=>`+${e.callingCode}${e.nationalNumber}`;export const parseE164=(e,t,o)=>{const i=e.replace(/[^0-9]/g,"");if(!i)return null;const n=splitPhoneNumber(`+${i}`);let l=n?.callingCode,r=n?.nationalNumber??"";if(!l){const e=Array.from(new Set(t.map(e=>e.code))).sort((e,t)=>t.length-e.length);if(l=e.find(e=>i.startsWith(e)),!l)return null;r=i.slice(l.length)}const a=t.filter(e=>e.code===l),s=a.find(e=>e.iso===o)?.iso??a.find(e=>e.iso===n?.country)?.iso??n?.country??a[0]?.iso??"";return{callingCode:l,nationalNumber:r,iso:s}};const planOf=e=>isSupportedCountry(e)?e:null,assertDefaultCountryVisible=(e,t)=>{if(void 0!==e&&!t.some(t=>t.iso===e))throw new RangeError(`PhoneNumberInput: defaultCountry "${e}" is not among the visible countries. Add it to countries, or remove it from hiddenCountries.`)};export const PhoneNumberInput=forwardRef((e,t)=>{const{value:o,defaultValue:i,onChange:n,e164:l,onChangeE164:r,returnKeyType:a,submitBehavior:s,onSubmitEditing:u,onComplete:d,onValidityChange:c,countries:p=ALL_CALLING_CODES,popularCountries:m,hiddenCountries:b,showFlag:f=!0,renderFlag:h,renderCountry:g,showAlphabetIndex:N,defaultCountry:x,validation:y="any",maxLength:C,formatAsYouType:v=!0,countryLocked:S=!1,label:T,labelMode:I="top",labelStyle:F,placeholder:E,helperText:P,error:j,invalidMessage:_,required:L,disabled:V=!1,size:O="md",variant:A,radius:M,labels:w,haptic:k,accessibilityLabel:z,countryAccessibilityLabel:D,onFocus:R,onBlur:U,style:B,testID:$}=e;assertValidValue("PhoneNumberInput","size",e.size,["sm","md","lg"]),assertValidValue("PhoneNumberInput","variant",e.variant,["outline","filled","underline"]),assertValidValue("PhoneNumberInput","labelMode",e.labelMode,["top","float"]),assertValidValue("PhoneNumberInput","validation",!1===e.validation?void 0:e.validation,["any","mobile"]);const H=useTheme(),W=useMemo(()=>buildStyles(H),[H]),q=useRef(null),G=useMobileUiText("phoneNumberInput",PHONE_NUMBER_INPUT_TEXT),Y=useMemo(()=>({...G,...w}),[G,w]),K=E??Y.placeholder,X=useMemo(()=>/-([A-Za-z]{2})(?:-|$)/.exec(getFormatterConfig().locale)?.[1]?.toUpperCase(),[]),Z=useMemo(()=>b?.length?p.filter(e=>!b.includes(e.iso)):p,[p,b]),J=useMemo(()=>{if(!m?.length)return;const e=m.map(e=>Z.find(t=>t.iso===e)).filter(e=>void 0!==e);return e.length?[{title:Y.popular,options:e},{title:Y.allCountries,options:Z}]:void 0},[m,Y.popular,Y.allCountries,Z]),Q=useCallback((e,t,o)=>{if(!e)return null;if(h)return h(e);if(!f)return null;const i=countryFlagEmoji(e.iso);return i?_jsx(Text,{variant:"body",style:[W.flag,{fontSize:t}],testID:o,children:i}):null},[h,f,W.flag]),ee=useCallback(e=>{const t=planOf(e),o=t?maxNationalNumberLength(t,!1===y?"any":y):Number.POSITIVE_INFINITY;return C?Math.min(o,C):o},[C,y]),te=useCallback((e,t)=>e.slice(0,ee(t)),[ee]),oe=useCallback((e,t)=>{const o=planOf(t)??void 0,i=splitPhoneNumber(e,o);if(!i)return null;const n=i.country??t,l=p.find(e=>e.iso===n);return{callingCode:l?.code??i.callingCode,nationalNumber:te(i.nationalNumber,n),iso:l?.iso??n}},[p,te]);useState(()=>assertDefaultCountryVisible(x,Z));const ie=useMemo(()=>{const e=Z.find(e=>e.iso===(x??X))??Z[0]??p[0],t={callingCode:e?.code??"",nationalNumber:"",iso:e?.iso??""};return"string"==typeof i?oe(i,t.iso)??t:i??t},[p,Z,x,X,i,oe]),ne=useCallback(e=>{if(!1===y)return e.nationalNumber.length>0;const t=planOf(e.iso);return t?isValidNationalNumber(e.nationalNumber,t,y):e.nationalNumber.length>0},[y]),[le,re]=useState(ie.iso),ae=useMemo(()=>{if(void 0===l)return;const e=l?parseE164(l,p,le):null;if(e)return{...e,nationalNumber:te(e.nationalNumber,e.iso)};const t=p.find(e=>e.iso===le);return{callingCode:t?.code??ie.callingCode,nationalNumber:"",iso:le}},[l,p,le,ie.callingCode,te]),se=useCallback(e=>{re(e.iso),n?.(e),r?.(e.nationalNumber?formatE164(e):"",{country:p.find(t=>t.iso===e.iso),national:e.nationalNumber,valid:ne(e)})},[n,r,p,ne]),[ue,de]=useControllableState({value:o??ae,defaultValue:ie,onChange:se}),[ce,pe]=useState(!1),me=useCallback(()=>{V||q.current?.focus()},[V]),[be,fe]=useState(!1),[he,ge]=useState(!1),[Ne,xe]=useState(!1),ye=useRef(!1);useEffect(()=>{Ne||(ye.current=!1)},[Ne]);const Ce=resolveFieldSize(H,O),ve=resolveFieldTextStyle(H,{disabled:V}),Se=A??H.settings.components.field?.defaultVariant??"outline",Te="underline"===Se,Ie=H.space.md,[Fe,Ee]=useState(0),Pe=Fe+Ie+1+Ie,je=ue.nationalNumber.length>0,Le=L&&!T&&!je&&K.length>0,Ve=ce||je,Oe=Boolean(T)&&"float"===I&&Fe>0,Ae=useFloatingLabel({label:T,enabled:Oe,floated:Ve,required:L,variant:Se,sizeTokens:Ce,leadingOffset:Pe,paddingLeft:Te?H.space.none:Ce["padding-x"],color:H.colors["field-label"],style:F}),Me=useMemo(()=>p.find(e=>e.iso===ue.iso),[p,ue.iso]),we=planOf(ue.iso),ke=v&&we?formatPhoneAsTyped(ue.nationalNumber,we):ue.nationalNumber,ze=ee(ue.iso),De=0===ue.nationalNumber.length||be||!Number.isFinite(ze)?void 0:ke.length+Math.max(0,ze-ue.nationalNumber.length),Re=ne(ue);useEffect(()=>{je||ge(!1)},[je]);const Ue=we?maxNationalNumberLength(we,!1===y?"any":y):Number.POSITIVE_INFINITY,Be=ue.nationalNumber.length>=Ue,$e=!1!==y&&!1!==_&&je&&!Re&&(he||Be),He="mobile"===y?Y.invalidMobile:Y.invalid,We=hasFieldText(j)?j:$e?_||He:void 0,qe=!0===j||hasFieldText(We),Ge=useRef(Re),Ye=useRef(ue);Ye.current=ue,useEffect(()=>{Ge.current!==Re&&(Ge.current=Re,c?.(Re),Re&&d?.(formatE164(Ye.current)))},[Re,d,c]);const Ke=useCallback(e=>{if(reportIdleActivity(),e.includes("+")){const t=oe(e,ue.iso);if(t&&!S&&Z.some(e=>e.iso===t.iso))return void de(t);if(t&&t.iso===ue.iso)return void de(t)}de({...ue,nationalNumber:te(digitsOnly(e),ue.iso)})},[Z,S,ue,oe,te,de]),Xe=useCallback(e=>{de({callingCode:e.code,iso:e.iso,nationalNumber:te(ue.nationalNumber,e.iso)}),xe(!1);const t=resolveHaptic(k,"selection");t&&triggerHaptic(t)},[ue,k,te,de]);useImperativeHandle(t,()=>({focus:()=>q.current?.focus(),blur:()=>q.current?.blur(),clear:()=>de({...Ye.current,nationalNumber:""}),isFocused:()=>q.current?.isFocused()??!1,getValue:()=>Ye.current,getE164:()=>formatE164(Ye.current),getFormatted:()=>{const e=Ye.current,t=planOf(e.iso);return t?formatPhoneAsTyped(e.nationalNumber,t):e.nationalNumber},isValid:()=>ne(Ye.current),getCountry:()=>p.find(e=>e.iso===Ye.current.iso)}),[p,ne,de]);const Ze=V||S,Je=_jsx(FieldBase,{testID:$?`${$}-field`:void 0,size:O,variant:Se,radius:M,topNotch:Ae.topNotch,focused:ce,disabled:V,error:qe,filled:je,onPress:me,pressFeedback:!1,leadingDivider:!0,paddingLeft:Te?H.space.none:void 0,leading:_jsxs(Pressable,{onPress:()=>{Ze||(ye.current=!0,xe(!0))},disabled:Ze,accessibilityRole:"button",accessibilityLabel:D??fillText(Y.countryButton,{callingCode:ue.callingCode}),accessibilityState:{disabled:Ze},"aria-disabled":Ze,hitSlop:6,...hitSlopMarker(6),onLayout:e=>{const{width:t}=e.nativeEvent.layout;Ee(e=>e===t?e:t)},style:W.codeTrigger,testID:$?`${$}-code`:void 0,children:[Q(Me,Ce.text,$?`${$}-flag`:void 0),_jsx(Text,{variant:"body",style:[W.codeText,{color:ve.color,fontSize:Ce.text}],children:`+${ue.callingCode}`}),S?null:_jsx(Chevron,{color:V?H.colors["field-icon-disabled"]:H.colors["field-icon"],size:Ce.icon,open:Ne})]}),children:_jsxs(View,{style:W.inputWrap,children:[_jsx(TextInput,{ref:q,value:ke,maxLength:De,onChangeText:Ke,returnKeyType:a,submitBehavior:s,onSubmitEditing:u,onSelectionChange:e=>{const{start:t,end:o}=e.nativeEvent.selection;fe(t!==o)},onFocus:()=>{pe(!0),R?.()},onBlur:()=>{pe(!1),je&&!ye.current&&ge(!0),U?.()},editable:!V,placeholder:Oe&&!Ve||Le?void 0:K,placeholderTextColor:ve.placeholderColor,accessibilityLabel:z??T??K,selectionColor:H.colors["field-caret"],keyboardType:"phone-pad",textContentType:"telephoneNumber",autoComplete:"tel",style:[W.input,{color:ve.color,fontSize:Ce.text,...ve.weightStyle,paddingLeft:Te?H.space.none:void 0}],testID:$?`${$}-input`:void 0}),Le?_jsx(RequiredPlaceholder,{text:K,color:ve.placeholderColor,fontSize:Ce.text,weightStyle:ve.weightStyle}):null]})});return _jsxs(View,{style:B,testID:$,children:[T&&"top"===I?_jsx(FieldLabel,{size:O,required:L,children:T}):null,_jsxs(View,{style:W.fieldWrapper,children:[Je,Ae.node]}),_jsx(FieldMessage,{size:O,error:qe,text:qe?We:P}),_jsx(OptionSheet,{open:Ne,haptic:k,onClose:()=>xe(!1),title:Y.countrySheetTitle,options:Z,sections:J,getOptionLabel:e=>`${e.label} (+${e.code})`,getOptionValue:e=>e.iso,getOptionIcon:e=>Q(e,H.text.lg.size),renderOption:g?({option:e,selected:t})=>g(e,{selected:t}):void 0,value:Me?.iso,onChange:(e,t)=>Xe(t),searchable:Z.length>8,labels:{searchPlaceholder:Y.countrySearchPlaceholder},alphabetIndex:N??Z.length>20})]})});PhoneNumberInput.displayName="PhoneNumberInput";const buildStyles=e=>StyleSheet.create({fieldWrapper:{position:"relative",overflow:"visible"},codeTrigger:{flexDirection:"row",alignItems:"center",gap:e.space.xxs},flag:{includeFontPadding:!1,marginRight:e.space.xs},codeText:{...fontFor(e,"semibold"),fontWeight:"600",includeFontPadding:!1,writingDirection:"ltr"},input:{padding:e.space.none,margin:e.space.none,includeFontPadding:!1,writingDirection:"ltr"},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"}});export default PhoneNumberInput;
|
|
1
|
+
"use strict";import{countryFlagEmoji,formatPhoneAsTyped,getFormatterConfig,getPhoneCountries,isSupportedCountry,isValidNationalNumber,maxNationalNumberLength,reportIdleActivity,splitPhoneNumber}from"@webority/mobile-core";import{PHONE_COUNTRY_NAMES}from"@webority/mobile-core/phone/countries";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{PHONE_NUMBER_INPUT_TEXT}from"../../text/phone/phoneNumberInput.g.js";import{fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,RequiredPlaceholder,resolveFieldTextStyle}from"../FieldBase/index.js";import{Chevron}from"../FieldBase/Chevron.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_CALLING_CODES=[{iso:"AU",code:"61",label:"Australia"},{iso:"CA",code:"1",label:"Canada"},{iso:"IN",code:"91",label:"India"},{iso:"SA",code:"966",label:"Saudi Arabia"},{iso:"SG",code:"65",label:"Singapore"},{iso:"AE",code:"971",label:"United Arab Emirates"},{iso:"GB",code:"44",label:"United Kingdom"},{iso:"US",code:"1",label:"United States"}];export const ALL_CALLING_CODES=getPhoneCountries().map(e=>({iso:e.iso,code:e.callingCode,label:PHONE_COUNTRY_NAMES[e.iso]??e.iso})).sort((e,t)=>e.label.localeCompare(t.label));const digitsOnly=e=>e.replace(/[^0-9]/g,"");export const formatE164=e=>`+${e.callingCode}${e.nationalNumber}`;export const parseE164=(e,t,o)=>{const i=e.replace(/[^0-9]/g,"");if(!i)return null;const n=splitPhoneNumber(`+${i}`);let l=n?.callingCode,r=n?.nationalNumber??"";if(!l){const e=Array.from(new Set(t.map(e=>e.code))).sort((e,t)=>t.length-e.length);if(l=e.find(e=>i.startsWith(e)),!l)return null;r=i.slice(l.length)}const a=t.filter(e=>e.code===l),s=a.find(e=>e.iso===o)?.iso??a.find(e=>e.iso===n?.country)?.iso??n?.country??a[0]?.iso??"";return{callingCode:l,nationalNumber:r,iso:s}};const planOf=e=>isSupportedCountry(e)?e:null,assertDefaultCountryVisible=(e,t)=>{if(void 0!==e&&!t.some(t=>t.iso===e))throw new RangeError(`PhoneNumberInput: defaultCountry "${e}" is not among the visible countries. Add it to countries, or remove it from hiddenCountries.`)};export const PhoneNumberInput=forwardRef((e,t)=>{const{value:o,defaultValue:i,onChange:n,e164:l,onChangeE164:r,returnKeyType:a,submitBehavior:s,onSubmitEditing:u,onComplete:d,onValidityChange:c,countries:p=ALL_CALLING_CODES,popularCountries:m,hiddenCountries:b,showFlag:f=!0,renderFlag:h,renderCountry:g,showAlphabetIndex:N,defaultCountry:x,validation:y="any",maxLength:C,formatAsYouType:v=!0,countryLocked:S=!1,label:T,labelMode:I="top",labelStyle:F,placeholder:E,helperText:P,error:j,invalidMessage:_,required:L,disabled:V=!1,size:O="md",variant:A,radius:M,labels:w,haptic:k,accessibilityLabel:z,countryAccessibilityLabel:D,onFocus:R,onBlur:U,style:B,testID:$}=e;assertValidValue("PhoneNumberInput","size",e.size,["sm","md","lg"]),assertValidValue("PhoneNumberInput","variant",e.variant,["outline","filled","underline"]),assertValidValue("PhoneNumberInput","labelMode",e.labelMode,["top","float"]),assertValidValue("PhoneNumberInput","validation",!1===e.validation?void 0:e.validation,["any","mobile"]);const H=useTheme(),W=useMemo(()=>buildStyles(H),[H]),q=useRef(null),G=useMobileUiText("phoneNumberInput",PHONE_NUMBER_INPUT_TEXT),Y=useMemo(()=>({...G,...w}),[G,w]),K=E??Y.placeholder,X=useMemo(()=>/-([A-Za-z]{2})(?:-|$)/.exec(getFormatterConfig().locale)?.[1]?.toUpperCase(),[]),Z=useMemo(()=>b?.length?p.filter(e=>!b.includes(e.iso)):p,[p,b]),J=useMemo(()=>{if(!m?.length)return;const e=m.map(e=>Z.find(t=>t.iso===e)).filter(e=>void 0!==e);return e.length?[{title:Y.popular,options:e},{title:Y.allCountries,options:Z}]:void 0},[m,Y.popular,Y.allCountries,Z]),Q=useCallback((e,t,o)=>{if(!e)return null;if(h)return h(e);if(!f)return null;const i=countryFlagEmoji(e.iso);return i?_jsx(Text,{variant:"body",style:[W.flag,{fontSize:t}],testID:o,children:i}):null},[h,f,W.flag]),ee=useCallback(e=>{const t=planOf(e),o=t?maxNationalNumberLength(t,!1===y?"any":y):Number.POSITIVE_INFINITY;return C?Math.min(o,C):o},[C,y]),te=useCallback((e,t)=>e.slice(0,ee(t)),[ee]),oe=useCallback((e,t)=>{const o=planOf(t)??void 0,i=splitPhoneNumber(e,o);if(!i)return null;const n=i.country??t,l=p.find(e=>e.iso===n);return{callingCode:l?.code??i.callingCode,nationalNumber:te(i.nationalNumber,n),iso:l?.iso??n}},[p,te]);useState(()=>assertDefaultCountryVisible(x,Z));const ie=useMemo(()=>{const e=Z.find(e=>e.iso===(x??X))??Z[0]??p[0],t={callingCode:e?.code??"",nationalNumber:"",iso:e?.iso??""};return"string"==typeof i?oe(i,t.iso)??t:i??t},[p,Z,x,X,i,oe]),ne=useCallback(e=>{if(!1===y)return e.nationalNumber.length>0;const t=planOf(e.iso);return t?isValidNationalNumber(e.nationalNumber,t,y):e.nationalNumber.length>0},[y]),[le,re]=useState(ie.iso),ae=useMemo(()=>{if(void 0===l)return;const e=l?parseE164(l,p,le):null;if(e)return{...e,nationalNumber:te(e.nationalNumber,e.iso)};const t=p.find(e=>e.iso===le);return{callingCode:t?.code??ie.callingCode,nationalNumber:"",iso:le}},[l,p,le,ie.callingCode,te]),se=useCallback(e=>{re(e.iso),n?.(e),r?.(e.nationalNumber?formatE164(e):"",{country:p.find(t=>t.iso===e.iso),national:e.nationalNumber,valid:ne(e)})},[n,r,p,ne]),[ue,de]=useControllableState({value:o??ae,defaultValue:ie,onChange:se}),[ce,pe]=useState(!1),me=useCallback(()=>{V||q.current?.focus()},[V]),[be,fe]=useState(!1),[he,ge]=useState(!1),[Ne,xe]=useState(!1),ye=useRef(!1);useEffect(()=>{Ne||(ye.current=!1)},[Ne]);const Ce=resolveFieldSize(H,O),ve=resolveFieldTextStyle(H,{disabled:V}),Se=A??H.settings.components.field?.defaultVariant??"outline",Te="underline"===Se,Ie=H.space.md,[Fe,Ee]=useState(0),Pe=Fe+Ie+1+Ie,je=ue.nationalNumber.length>0,Le=L&&!T&&!je&&K.length>0,Ve=ce||je,Oe=Boolean(T)&&"float"===I&&Fe>0,Ae=useFloatingLabel({label:T,enabled:Oe,floated:Ve,required:L,variant:Se,sizeTokens:Ce,leadingOffset:Pe,paddingLeft:Te?H.space.none:Ce["padding-x"],color:H.colors["field-label"],style:F}),Me=useMemo(()=>p.find(e=>e.iso===ue.iso),[p,ue.iso]),we=planOf(ue.iso),ke=v&&we?formatPhoneAsTyped(ue.nationalNumber,we):ue.nationalNumber,ze=ee(ue.iso),De=0===ue.nationalNumber.length||be||!Number.isFinite(ze)?void 0:ke.length+Math.max(0,ze-ue.nationalNumber.length),Re=ne(ue);useEffect(()=>{je||ge(!1)},[je]);const Ue=we?maxNationalNumberLength(we,!1===y?"any":y):Number.POSITIVE_INFINITY,Be=ue.nationalNumber.length>=Ue,$e=!1!==y&&!1!==_&&je&&!Re&&(he||Be),He="mobile"===y?Y.invalidMobile:Y.invalid,We=hasFieldText(j)?j:$e?_||He:void 0,qe=!0===j||hasFieldText(We),Ge=useRef(Re),Ye=useRef(ue);Ye.current=ue,useEffect(()=>{Ge.current!==Re&&(Ge.current=Re,c?.(Re),Re&&d?.(formatE164(Ye.current)))},[Re,d,c]);const Ke=useCallback(e=>{if(reportIdleActivity(),e.includes("+")){const t=oe(e,ue.iso);if(t&&!S&&Z.some(e=>e.iso===t.iso))return void de(t);if(t&&t.iso===ue.iso)return void de(t)}de({...ue,nationalNumber:te(digitsOnly(e),ue.iso)})},[Z,S,ue,oe,te,de]),Xe=useCallback(e=>{de({callingCode:e.code,iso:e.iso,nationalNumber:te(ue.nationalNumber,e.iso)}),xe(!1);const t=resolveHaptic(k,"selection");t&&triggerHaptic(t)},[ue,k,te,de]);useImperativeHandle(t,()=>({focus:()=>q.current?.focus(),blur:()=>q.current?.blur(),clear:()=>de({...Ye.current,nationalNumber:""}),isFocused:()=>q.current?.isFocused()??!1,getValue:()=>Ye.current,getE164:()=>formatE164(Ye.current),getFormatted:()=>{const e=Ye.current,t=planOf(e.iso);return t?formatPhoneAsTyped(e.nationalNumber,t):e.nationalNumber},isValid:()=>ne(Ye.current),getCountry:()=>p.find(e=>e.iso===Ye.current.iso)}),[p,ne,de]);const Ze=V||S,Je=_jsx(FieldBase,{testID:$?`${$}-field`:void 0,size:O,variant:Se,radius:M,topNotch:Ae.topNotch,focused:ce,disabled:V,error:qe,filled:je,onPress:me,pressFeedback:!1,leadingDivider:!0,paddingLeft:Te?H.space.none:void 0,leading:_jsxs(Pressable,{onPress:()=>{Ze||(ye.current=!0,xe(!0))},disabled:Ze,accessibilityRole:"button",accessibilityLabel:D??fillText(Y.countryButton,{callingCode:ue.callingCode}),accessibilityState:{disabled:Ze},"aria-disabled":Ze,hitSlop:6,...hitSlopMarker(6),onLayout:e=>{const{width:t}=e.nativeEvent.layout;Ee(e=>e===t?e:t)},style:W.codeTrigger,testID:$?`${$}-code`:void 0,children:[Q(Me,Ce.text,$?`${$}-flag`:void 0),_jsx(Text,{variant:"body",style:[W.codeText,{color:ve.color,fontSize:Ce.text}],children:`+${ue.callingCode}`}),S?null:_jsx(Chevron,{color:V?H.colors["field-icon-disabled"]:H.colors["field-icon"],size:Ce.icon,open:Ne})]}),children:_jsxs(View,{style:W.inputWrap,children:[_jsx(TextInput,{ref:q,value:ke,maxLength:De,onChangeText:Ke,returnKeyType:a,submitBehavior:s,onSubmitEditing:u,onSelectionChange:e=>{const{start:t,end:o}=e.nativeEvent.selection;fe(t!==o)},onFocus:()=>{pe(!0),R?.()},onBlur:()=>{pe(!1),je&&!ye.current&&ge(!0),U?.()},editable:!V,placeholder:Oe&&!Ve||Le?void 0:K,placeholderTextColor:ve.placeholderColor,accessibilityLabel:z??T??K,selectionColor:H.colors["field-caret"],keyboardType:"phone-pad",textContentType:"telephoneNumber",autoComplete:"tel",style:[W.input,{color:ve.color,fontSize:Ce.text,...ve.weightStyle,paddingLeft:Te?H.space.none:void 0}],testID:$?`${$}-input`:void 0}),Le?_jsx(RequiredPlaceholder,{text:K,color:ve.placeholderColor,fontSize:Ce.text,weightStyle:ve.weightStyle}):null]})});return _jsxs(View,{style:B,testID:$,children:[T&&"top"===I?_jsx(FieldLabel,{size:O,required:L,style:F,children:T}):null,_jsxs(View,{style:W.fieldWrapper,children:[Je,Ae.node]}),_jsx(FieldMessage,{size:O,error:qe,text:qe?We:P}),_jsx(OptionSheet,{open:Ne,haptic:k,onClose:()=>xe(!1),title:Y.countrySheetTitle,options:Z,sections:J,getOptionLabel:e=>`${e.label} (+${e.code})`,getOptionValue:e=>e.iso,getOptionIcon:e=>Q(e,H.text.lg.size),renderOption:g?({option:e,selected:t})=>g(e,{selected:t}):void 0,value:Me?.iso,onChange:(e,t)=>Xe(t),searchable:Z.length>8,labels:{searchPlaceholder:Y.countrySearchPlaceholder},alphabetIndex:N??Z.length>20})]})});PhoneNumberInput.displayName="PhoneNumberInput";const buildStyles=e=>StyleSheet.create({fieldWrapper:{position:"relative",overflow:"visible"},codeTrigger:{flexDirection:"row",alignItems:"center",gap:e.space.xxs},flag:{includeFontPadding:!1,marginRight:e.space.xs},codeText:{...fontFor(e,"semibold"),fontWeight:"600",includeFontPadding:!1,writingDirection:"ltr"},input:{padding:e.space.none,margin:e.space.none,includeFontPadding:!1,writingDirection:"ltr"},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"}});export default PhoneNumberInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type IconName = "aave" | "activity" | "add" | "add-circle" | "add-square" | "additem" | "airdrop" | "airplane" | "airplane-square" | "airpod" | "airpods" | "alarm" | "alert-circle" | "alert-triangle" | "align-bottom" | "align-horizontally" | "align-left" | "align-right" | "align-top" | "align-vertically" | "android" | "ankr" | "apple" | "aquarius" | "archive" | "archive-add" | "archive-book" | "archive-box" | "archive-minus" | "archive-slash" | "archive-tick" | "arrange-horizontal" | "arrange-horizontal-circle" | "arrange-horizontal-square" | "arrange-vertical" | "arrange-vertical-circle" | "arrange-vertical-square" | "arrow" | "arrow-circle-down" | "arrow-circle-down-2" | "arrow-circle-left" | "arrow-circle-left-2" | "arrow-circle-right" | "arrow-circle-right-2" | "arrow-circle-up" | "arrow-circle-up-2" | "arrow-down" | "arrow-down-2" | "arrow-down-3" | "arrow-down-up" | "arrow-forward" | "arrow-forward-square" | "arrow-left" | "arrow-left-2" | "arrow-left-3" | "arrow-right" | "arrow-right-2" | "arrow-right-3" | "arrow-rotate-left" | "arrow-rotate-right" | "arrow-square" | "arrow-square-down" | "arrow-square-left" | "arrow-square-right" | "arrow-square-up" | "arrow-swap-horizontal" | "arrow-swap-vertical" | "arrow-up" | "arrow-up-2" | "arrow-up-3" | "arrow-up-right" | "at" | "attach-circle" | "attach-square" | "audio-square" | "augur" | "autobrightness" | "autonio" | "avalanche" | "award" | "back" | "back-square" | "backward" | "backward-10-seconds" | "backward-15-seconds" | "backward-5-seconds" | "backward-item" | "badge-check" | "bag" | "bag-2" | "bag-cross" | "bag-cross-1" | "bag-happy" | "bag-tick" | "bag-tick-2" | "bag-timer" | "ban" | "bank" | "barcode" | "battery-charging" | "battery-disable" | "battery-empty" | "battery-empty-1" | "battery-full" | "be" | "bell" | "bezier" | "bill" | "binance-coin" | "binance-usd" | "bitcoin" | "bitcoin-card" | "bitcoin-convert" | "bitcoin-refresh" | "blend" | "blend-2" | "blogger" | "bluetooth" | "bluetooth-2" | "bluetooth-circle" | "bluetooth-rectangle" | "blur" | "bolt" | "book" | "book-1" | "book-saved" | "book-square" | "bookmark" | "bookmark-2" | "bootstrap" | "box" | "box-1" | "box-2" | "box-add" | "box-remove" | "box-seam" | "box-search" | "box-tick" | "box-time" | "briefcase" | "briefcase-cross" | "briefcase-tick" | "briefcase-timer" | "brifecase-cross" | "brifecase-tick" | "brifecase-timer" | "brodcast" | "broom" | "brush" | "brush-2" | "brush-3" | "brush-big" | "brush-square" | "bubble" | "bucket" | "bucket-circle" | "bucket-square" | "bug" | "building" | "building-2" | "building-3" | "building-4" | "buildings" | "buildings-2" | "buliding" | "bullseye" | "bus" | "buy-crypto" | "cake" | "calculator" | "calendar" | "calendar-1" | "calendar-2" | "calendar-add" | "calendar-check" | "calendar-circle" | "calendar-dots" | "calendar-edit" | "calendar-remove" | "calendar-search" | "calendar-tick" | "call" | "call-add" | "call-calling" | "call-incoming" | "call-minus" | "call-outgoing" | "call-received" | "call-remove" | "call-slash" | "camera" | "camera-slash" | "candle" | "candle-2" | "car" | "card" | "card-add" | "card-coin" | "card-edit" | "card-pos" | "card-receive" | "card-remove" | "card-remove-1" | "card-send" | "card-slash" | "card-tick" | "card-tick-1" | "cardano" | "cards" | "cash-stack" | "category" | "category-2" | "cd" | "celo" | "celsius" | "chainlink" | "chart" | "chart-1" | "chart-2" | "chart-21" | "chart-circle" | "chart-column" | "chart-fail" | "chart-square" | "chart-success" | "chat" | "chat-dots" | "check" | "check-check" | "check-circle" | "chemical-glass" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chevrons-left" | "chevrons-right" | "chevrons-up-down" | "chrome" | "circle" | "circle-help" | "civic" | "clipboard" | "clipboard-check" | "clipboard-close" | "clipboard-export" | "clipboard-import" | "clipboard-text" | "clipboard-tick" | "clock" | "close-circle" | "close-square" | "cloud" | "cloud-add" | "cloud-change" | "cloud-connection" | "cloud-cross" | "cloud-drizzle" | "cloud-fog" | "cloud-lightning" | "cloud-minus" | "cloud-notif" | "cloud-plus" | "cloud-remove" | "cloud-snow" | "cloud-sunny" | "code" | "code-1" | "code-circle" | "coffee" | "coin" | "coin-1" | "coins" | "color-swatch" | "colorfilter" | "colors-square" | "command" | "command-square" | "comment" | "component" | "computing" | "contact" | "convert" | "convert-3-d-cube" | "convert-card" | "convertshape" | "convertshape-2" | "copy" | "copy-success" | "copyright" | "courthouse" | "cpu" | "cpu-charge" | "cpu-setting" | "creative-commons" | "credit-card" | "crop" | "crown" | "crown-1" | "cup" | "cursor" | "cut" | "dai" | "danger" | "dash" | "data" | "data-2" | "decred" | "dent" | "designtools" | "device-message" | "devices" | "diagram" | "diagram-3" | "diamonds" | "direct" | "direct-down" | "direct-inbox" | "direct-left" | "direct-normal" | "direct-notification" | "direct-right" | "direct-send" | "direct-up" | "directbox-default" | "directbox-notif" | "directbox-receive" | "directbox-send" | "discount-circle" | "discount-shape" | "discover" | "dislike" | "display" | "document" | "document-cloud" | "document-code" | "document-code-2" | "document-copy" | "document-download" | "document-favorite" | "document-filter" | "document-forward" | "document-like" | "document-previous" | "document-sketch" | "document-text" | "document-text-1" | "document-upload" | "dollar-circle" | "dollar-square" | "download" | "dribbble" | "driver" | "driver-2" | "driver-refresh" | "driving" | "drop" | "dropbox" | "edit" | "edit-2" | "educare" | "electricity" | "element" | "element-2" | "element-3" | "element-4" | "element-equal" | "element-plus" | "emercoin" | "emoji-happy" | "emoji-normal" | "emoji-sad" | "emoji-smile" | "empty-wallet" | "empty-wallet-add" | "empty-wallet-change" | "empty-wallet-remove" | "empty-wallet-tick" | "empty-wallet-time" | "enjin-coin" | "eos" | "eraser" | "eraser-square" | "ethereum" | "ethereum-classic" | "export" | "export-circle" | "export-curve" | "export-square" | "external-drive" | "external-link" | "eye" | "eye-off" | "eye-slash" | "facebook" | "factory" | "fatrows" | "favorite-chart" | "figma" | "figma-1" | "file-plus-2" | "file-text" | "files" | "filter" | "filter-add" | "filter-edit" | "filter-remove" | "filter-search" | "filter-square" | "filter-tick" | "finger-cricle" | "finger-scan" | "firstline" | "flag" | "flag-2" | "flame" | "flash" | "flash-circle" | "flash-slash" | "flashy" | "folder" | "folder-2" | "folder-add" | "folder-cloud" | "folder-connection" | "folder-cross" | "folder-favorite" | "folder-kanban" | "folder-minus" | "folder-open" | "folder-plus" | "forbidden" | "forbidden-2" | "format-circle" | "format-square" | "forward" | "forward-10-seconds" | "forward-15-seconds" | "forward-5-seconds" | "forward-item" | "framer" | "ftx-token" | "gallery" | "gallery-add" | "gallery-edit" | "gallery-export" | "gallery-favorite" | "gallery-import" | "gallery-remove" | "gallery-slash" | "gallery-tick" | "game" | "gameboy" | "gas-station" | "gauge" | "gemini" | "gemini-2" | "ghost" | "gift" | "github" | "glass" | "global" | "global-edit" | "global-refresh" | "global-search" | "globe" | "globe2" | "google" | "google-drive" | "google-play" | "gps" | "gps-slash" | "grammerly" | "graph" | "grid" | "grid-1" | "grid-2" | "grid-3" | "grid-4" | "grid-5" | "grid-6" | "grid-7" | "grid-8" | "grid-9" | "grid-edit" | "grid-eraser" | "grid-lock" | "hamberger-menu" | "hamburger-menu" | "hand" | "happyemoji" | "hard-hat" | "harmony" | "hashtag" | "hashtag-down" | "hashtag-square" | "hashtag-up" | "headphone" | "headphones" | "health" | "heart" | "heart-add" | "heart-circle" | "heart-edit" | "heart-remove" | "heart-search" | "heart-slash" | "heart-tick" | "hedera-hashgraph" | "hex" | "hierarchy" | "hierarchy-2" | "hierarchy-3" | "hierarchy-square" | "hierarchy-square-2" | "hierarchy-square-3" | "history" | "home" | "home-2" | "home-3" | "home-hashtag" | "home-trend-down" | "home-trend-up" | "home-wifi" | "hospital" | "house" | "house-2" | "html-3" | "html-5" | "huobi-token" | "i-24-support" | "i-3-d-cube-scan" | "i-3-d-rotate" | "i-3-d-square" | "i-3-dcube" | "i-3-square" | "icon" | "illustrator" | "image" | "import" | "import-circle" | "import-curve" | "import-square" | "inbox" | "info" | "info-circle" | "information" | "instagram" | "iost" | "java-script" | "js" | "judge" | "kanban" | "key" | "key-square" | "keyboard" | "keyboard-open" | "kyber-network" | "lamp" | "lamp-charge" | "lamp-on" | "lamp-slash" | "language-circle" | "language-square" | "layer" | "layout-dashboard" | "layout-grid" | "layout-maximize" | "level" | "lifebuoy" | "lightbulb" | "like" | "like-1" | "like-dislike" | "like-shapes" | "like-tag" | "link" | "link-1" | "link-2" | "link-21" | "link-circle" | "link-square" | "linkedin" | "list" | "litecoin" | "location" | "location-add" | "location-cross" | "location-discover" | "location-minus" | "location-slash" | "location-tick" | "lock" | "lock-1" | "lock-circle" | "lock-slash" | "log-out" | "login" | "login-curve" | "logout" | "logout-curve" | "lovely" | "magic-star" | "magicpen" | "mail" | "main-component" | "maker" | "man" | "map" | "map-1" | "map-pin" | "mask" | "mask-left" | "mask-right" | "math" | "maximize" | "maximize-1" | "maximize-2" | "maximize-3" | "maximize-4" | "maximize-circle" | "medal" | "medal-star" | "menu" | "menu-board" | "message" | "message-2" | "message-add" | "message-add-1" | "message-circle" | "message-edit" | "message-favorite" | "message-minus" | "message-notif" | "message-programming" | "message-question" | "message-remove" | "message-search" | "message-square" | "message-text" | "message-text-1" | "message-tick" | "message-time" | "messages" | "messages-1" | "messages-2" | "messages-3" | "messenger" | "microphone" | "microphone-2" | "microphone-slash" | "microphone-slash-1" | "microscope" | "microsoft" | "milk" | "mini-music-sqaure" | "minus" | "minus-circle" | "minus-cirlce" | "minus-square" | "mirror" | "mirroring-screen" | "mobile" | "mobile-programming" | "monero" | "money" | "money-2" | "money-3" | "money-4" | "money-add" | "money-archive" | "money-change" | "money-forbidden" | "money-receive" | "money-recive" | "money-remove" | "money-send" | "money-tick" | "money-time" | "moneys" | "monitor" | "monitor-mobbile" | "monitor-recorder" | "moon" | "more" | "more-2" | "more-circle" | "more-horizontal" | "more-square" | "mouse" | "mouse-circle" | "mouse-square" | "music" | "music-circle" | "music-dashboard" | "music-filter" | "music-library-2" | "music-play" | "music-playlist" | "music-square" | "music-square-add" | "music-square-remove" | "music-square-search" | "musicnote" | "nebulas" | "nem" | "nexo" | "next" | "note" | "note-1" | "note-add" | "note-favorite" | "note-remove" | "note-square" | "note-text" | "notepad" | "notepad-2" | "notification" | "notification-1" | "notification-bing" | "notification-circle" | "notification-favorite" | "notification-status" | "ocean-protocol" | "okb" | "okru" | "omega-circle" | "omega-square" | "ontology" | "paintbucket" | "palette" | "panel-left-close" | "panel-left-open" | "paperclip" | "paperclip-2" | "password-check" | "path-tool" | "path-tool-2" | "path-tool-square" | "pause" | "pause-circle" | "paypal" | "pen-add" | "pen-close" | "pen-remove" | "pen-tool" | "pen-tool-2" | "pencil" | "people" | "percentage-circle" | "percentage-square" | "personalcard" | "pet" | "pharagraphspacing" | "phone" | "photoshop" | "picture-frame" | "play" | "play-add" | "play-circle" | "play-cricle" | "play-remove" | "plug" | "plus" | "plus-circle" | "pointer" | "polkadot" | "polygon" | "polyswarm" | "presentation-chart" | "presention-chart" | "previous" | "printer" | "printer-slash" | "profile" | "profile-2-user" | "profile-add" | "profile-circle" | "profile-delete" | "profile-remove" | "profile-tick" | "programming-arrow" | "programming-arrows" | "python" | "quant" | "quote-down" | "quote-down-circle" | "quote-down-square" | "quote-up" | "quote-up-circle" | "quote-up-square" | "radar" | "radar-2" | "radio" | "ram" | "ram-2" | "rank" | "ranking" | "receipt" | "receipt-1" | "receipt-2" | "receipt-21" | "receipt-add" | "receipt-discount" | "receipt-disscount" | "receipt-edit" | "receipt-item" | "receipt-minus" | "receipt-search" | "receipt-square" | "receipt-text" | "receive" | "receive-square" | "receive-square-2" | "record" | "record-circle" | "recovery-convert" | "reddit" | "refresh" | "refresh-2" | "refresh-circle" | "refresh-cw" | "refresh-left-square" | "refresh-right-square" | "refresh-square" | "repeat" | "repeat-circle" | "repeate-music" | "repeate-one" | "reserve" | "robot" | "rotate-ccw" | "rotate-cw" | "rotate-left" | "rotate-right" | "route-square" | "routing" | "routing-2" | "row-horizontal" | "row-vertical" | "ruler" | "ruler-pen" | "safe-home" | "sagittarius" | "save-2" | "save-add" | "save-minus" | "save-remove" | "scan" | "scan-barcode" | "scanner" | "scanning" | "scissor" | "screenmirroring" | "scroll" | "search" | "search-favorite" | "search-favorite-1" | "search-normal" | "search-normal-1" | "search-status" | "search-status-1" | "search-zoom-in" | "search-zoom-in-1" | "search-zoom-out" | "search-zoom-out-1" | "security" | "security-card" | "security-safe" | "security-time" | "security-user" | "send" | "send-2" | "server" | "setting" | "setting-2" | "setting-3" | "setting-4" | "setting-5" | "settings" | "shapes" | "shapes-1" | "share" | "share-2" | "shield" | "shield-check" | "shield-cross" | "shield-lock" | "shield-plus" | "shield-search" | "shield-security" | "shield-slash" | "shield-tick" | "ship" | "shop" | "shop-add" | "shop-remove" | "shopping-bag" | "shopping-cart" | "shuffle" | "shutterstock" | "siacoin" | "sidebar-bottom" | "sidebar-left" | "sidebar-right" | "sidebar-top" | "signpost" | "simcard" | "simcard-1" | "simcard-2" | "size" | "slack" | "slash" | "slider" | "slider-horizontal" | "slider-horizontal-1" | "slider-vertical" | "slider-vertical-1" | "smallcaps" | "smart-car" | "smart-home" | "smileys" | "sms" | "sms-edit" | "sms-notification" | "sms-search" | "sms-star" | "sms-tracking" | "snapchat" | "snowflake" | "solana" | "sort" | "sound" | "sparkles" | "speaker" | "speedometer" | "spotify" | "stacks" | "star" | "star-1" | "star-slash" | "stars" | "status" | "status-up" | "stellar" | "sticker" | "stickynote" | "stop" | "stop-circle" | "story" | "strongbox" | "strongbox-2" | "subtitle" | "sun" | "sun-1" | "sun-fog" | "table-document" | "table-lamp" | "tag" | "tag-2" | "tag-cross" | "tag-right" | "tag-user" | "task" | "task-square" | "teacher" | "telephone" | "tenx" | "tether" | "text" | "text-block" | "text-bold" | "text-italic" | "text-underline" | "textalign-center" | "textalign-justifycenter" | "textalign-justifyleft" | "textalign-justifyright" | "textalign-left" | "textalign-right" | "the-graph" | "theta" | "thorchain" | "thumbs-down" | "thumbs-up" | "tick-circle" | "tick-square" | "ticket" | "ticket-2" | "ticket-discount" | "ticket-expired" | "ticket-star" | "timer" | "timer-1" | "timer-pause" | "timer-start" | "toggle-off" | "toggle-off-circle" | "toggle-on" | "toggle-on-circle" | "trade" | "transaction-minus" | "translate" | "transmit" | "transmit-sqaure-2" | "transmit-square" | "trash" | "trash-2" | "tree" | "trello" | "trend-down" | "trend-up" | "trending-up" | "triangle" | "triangle-logo" | "trontron" | "truck" | "truck-fast" | "truck-remove" | "truck-tick" | "truck-time" | "trush-square" | "twitch" | "two-page" | "ui-8" | "unlimited" | "unlock" | "upload" | "usd-coin" | "user" | "user-add" | "user-check" | "user-cirlce-add" | "user-edit" | "user-minus" | "user-octagon" | "user-plus" | "user-remove" | "user-search" | "user-square" | "user-tag" | "user-tick" | "users" | "velas" | "verify" | "vibe" | "video" | "video-add" | "video-circle" | "video-horizontal" | "video-octagon" | "video-play" | "video-remove" | "video-slash" | "video-square" | "video-tick" | "video-time" | "video-vertical" | "voice-circle" | "voice-cricle" | "voice-square" | "volume" | "volume-cross" | "volume-high" | "volume-low" | "volume-low-1" | "volume-mute" | "volume-slash" | "volume-up" | "wallet" | "wallet-1" | "wallet-2" | "wallet-3" | "wallet-add" | "wallet-add-1" | "wallet-check" | "wallet-minus" | "wallet-money" | "wallet-remove" | "wallet-search" | "wallet2" | "wanchain" | "wanchain-1" | "wand-sparkles" | "warning-2" | "watch" | "watch-status" | "weight" | "weight-meter" | "whatsapp" | "wifi" | "wifi-square" | "wind" | "wind-2" | "windows" | "wing" | "woman" | "wrist-clock" | "x" | "x-circle" | "xd" | "xiaomi" | "xrp" | "youtube" | "zap" | "zel" | "zoom" | "zoom-in" | "zoom-out";
|
|
1
|
+
export type IconName = "aave" | "activity" | "add" | "add-circle" | "add-square" | "additem" | "airdrop" | "airplane" | "airplane-square" | "airpod" | "airpods" | "alarm" | "alert-circle" | "alert-triangle" | "align-bottom" | "align-horizontally" | "align-left" | "align-right" | "align-top" | "align-vertically" | "android" | "ankr" | "apple" | "aquarius" | "archive" | "archive-add" | "archive-book" | "archive-box" | "archive-minus" | "archive-slash" | "archive-tick" | "arrange-horizontal" | "arrange-horizontal-circle" | "arrange-horizontal-square" | "arrange-vertical" | "arrange-vertical-circle" | "arrange-vertical-square" | "arrow" | "arrow-circle-down" | "arrow-circle-down-2" | "arrow-circle-left" | "arrow-circle-left-2" | "arrow-circle-right" | "arrow-circle-right-2" | "arrow-circle-up" | "arrow-circle-up-2" | "arrow-down" | "arrow-down-2" | "arrow-down-3" | "arrow-down-up" | "arrow-forward" | "arrow-forward-square" | "arrow-left" | "arrow-left-2" | "arrow-left-3" | "arrow-right" | "arrow-right-1" | "arrow-right-2" | "arrow-right-3" | "arrow-rotate-left" | "arrow-rotate-right" | "arrow-square" | "arrow-square-down" | "arrow-square-left" | "arrow-square-right" | "arrow-square-up" | "arrow-swap-horizontal" | "arrow-swap-vertical" | "arrow-up" | "arrow-up-2" | "arrow-up-3" | "arrow-up-right" | "at" | "attach-circle" | "attach-square" | "audio-square" | "augur" | "autobrightness" | "autonio" | "avalanche" | "award" | "back" | "back-square" | "backward" | "backward-10-seconds" | "backward-15-seconds" | "backward-5-seconds" | "backward-item" | "badge-check" | "bag" | "bag-2" | "bag-cross" | "bag-cross-1" | "bag-happy" | "bag-tick" | "bag-tick-2" | "bag-timer" | "ban" | "bank" | "barcode" | "battery-charging" | "battery-disable" | "battery-empty" | "battery-empty-1" | "battery-full" | "be" | "bell" | "bezier" | "bill" | "binance-coin" | "binance-usd" | "bitcoin" | "bitcoin-card" | "bitcoin-convert" | "bitcoin-refresh" | "blend" | "blend-2" | "blogger" | "bluetooth" | "bluetooth-2" | "bluetooth-circle" | "bluetooth-rectangle" | "blur" | "bolt" | "book" | "book-1" | "book-saved" | "book-square" | "bookmark" | "bookmark-2" | "bootstrap" | "box" | "box-1" | "box-2" | "box-add" | "box-remove" | "box-seam" | "box-search" | "box-tick" | "box-time" | "briefcase" | "briefcase-cross" | "briefcase-tick" | "briefcase-timer" | "brifecase-cross" | "brifecase-tick" | "brifecase-timer" | "brodcast" | "broom" | "brush" | "brush-2" | "brush-3" | "brush-big" | "brush-square" | "bubble" | "bucket" | "bucket-circle" | "bucket-square" | "bug" | "building" | "building-2" | "building-3" | "building-4" | "buildings" | "buildings-2" | "buliding" | "bullseye" | "bus" | "buy-crypto" | "cake" | "calculator" | "calendar" | "calendar-1" | "calendar-2" | "calendar-add" | "calendar-check" | "calendar-circle" | "calendar-dots" | "calendar-edit" | "calendar-remove" | "calendar-search" | "calendar-tick" | "call" | "call-add" | "call-calling" | "call-incoming" | "call-minus" | "call-outgoing" | "call-received" | "call-remove" | "call-slash" | "camera" | "camera-slash" | "candle" | "candle-2" | "car" | "card" | "card-add" | "card-coin" | "card-edit" | "card-pos" | "card-receive" | "card-remove" | "card-remove-1" | "card-send" | "card-slash" | "card-tick" | "card-tick-1" | "cardano" | "cards" | "cash-stack" | "category" | "category-2" | "cd" | "celo" | "celsius" | "chainlink" | "chart" | "chart-1" | "chart-2" | "chart-21" | "chart-circle" | "chart-column" | "chart-fail" | "chart-square" | "chart-success" | "chat" | "chat-dots" | "check" | "check-check" | "check-circle" | "chemical-glass" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chevrons-left" | "chevrons-right" | "chevrons-up-down" | "chrome" | "circle" | "circle-help" | "civic" | "clipboard" | "clipboard-check" | "clipboard-close" | "clipboard-export" | "clipboard-import" | "clipboard-text" | "clipboard-tick" | "clock" | "close-circle" | "close-square" | "cloud" | "cloud-add" | "cloud-change" | "cloud-connection" | "cloud-cross" | "cloud-drizzle" | "cloud-fog" | "cloud-lightning" | "cloud-minus" | "cloud-notif" | "cloud-plus" | "cloud-remove" | "cloud-snow" | "cloud-sunny" | "code" | "code-1" | "code-circle" | "coffee" | "coin" | "coin-1" | "coins" | "color-swatch" | "colorfilter" | "colors-square" | "command" | "command-square" | "comment" | "component" | "computing" | "contact" | "convert" | "convert-3-d-cube" | "convert-card" | "convertshape" | "convertshape-2" | "copy" | "copy-success" | "copyright" | "courthouse" | "cpu" | "cpu-charge" | "cpu-setting" | "creative-commons" | "credit-card" | "crop" | "crown" | "crown-1" | "cup" | "cursor" | "cut" | "dai" | "danger" | "dash" | "data" | "data-2" | "database" | "decred" | "dent" | "designtools" | "device-message" | "devices" | "diagram" | "diagram-3" | "diamonds" | "direct" | "direct-down" | "direct-inbox" | "direct-left" | "direct-normal" | "direct-notification" | "direct-right" | "direct-send" | "direct-up" | "directbox-default" | "directbox-notif" | "directbox-receive" | "directbox-send" | "discount-circle" | "discount-shape" | "discover" | "dislike" | "display" | "document" | "document-cloud" | "document-code" | "document-code-2" | "document-copy" | "document-download" | "document-favorite" | "document-filter" | "document-forward" | "document-like" | "document-previous" | "document-sketch" | "document-text" | "document-text-1" | "document-upload" | "dollar-circle" | "dollar-square" | "download" | "dribbble" | "driver" | "driver-2" | "driver-refresh" | "driving" | "drop" | "dropbox" | "edit" | "edit-2" | "educare" | "electricity" | "element" | "element-2" | "element-3" | "element-4" | "element-equal" | "element-plus" | "ellipsis" | "emercoin" | "emoji-happy" | "emoji-normal" | "emoji-sad" | "emoji-smile" | "empty-wallet" | "empty-wallet-add" | "empty-wallet-change" | "empty-wallet-remove" | "empty-wallet-tick" | "empty-wallet-time" | "enjin-coin" | "eos" | "eraser" | "eraser-square" | "ethereum" | "ethereum-classic" | "export" | "export-circle" | "export-curve" | "export-square" | "external-drive" | "external-link" | "eye" | "eye-off" | "eye-slash" | "facebook" | "factory" | "fatrows" | "favorite-chart" | "figma" | "figma-1" | "file-plus-2" | "file-text" | "files" | "filter" | "filter-add" | "filter-edit" | "filter-remove" | "filter-search" | "filter-square" | "filter-tick" | "finger-cricle" | "finger-scan" | "firstline" | "flag" | "flag-2" | "flame" | "flash" | "flash-circle" | "flash-slash" | "flashy" | "folder" | "folder-2" | "folder-add" | "folder-cloud" | "folder-connection" | "folder-cross" | "folder-favorite" | "folder-kanban" | "folder-minus" | "folder-open" | "folder-plus" | "forbidden" | "forbidden-2" | "format-circle" | "format-square" | "forward" | "forward-10-seconds" | "forward-15-seconds" | "forward-5-seconds" | "forward-item" | "framer" | "ftx-token" | "funnel" | "gallery" | "gallery-add" | "gallery-edit" | "gallery-export" | "gallery-favorite" | "gallery-import" | "gallery-remove" | "gallery-slash" | "gallery-tick" | "game" | "gameboy" | "gas-station" | "gauge" | "gemini" | "gemini-2" | "ghost" | "gift" | "github" | "glass" | "global" | "global-edit" | "global-refresh" | "global-search" | "globe" | "globe2" | "google" | "google-drive" | "google-play" | "gps" | "gps-slash" | "grammerly" | "graph" | "grid" | "grid-1" | "grid-2" | "grid-3" | "grid-4" | "grid-5" | "grid-6" | "grid-7" | "grid-8" | "grid-9" | "grid-edit" | "grid-eraser" | "grid-lock" | "hamberger-menu" | "hamburger-menu" | "hand" | "happyemoji" | "hard-hat" | "harmony" | "hashtag" | "hashtag-down" | "hashtag-square" | "hashtag-up" | "headphone" | "headphones" | "health" | "heart" | "heart-add" | "heart-circle" | "heart-edit" | "heart-remove" | "heart-search" | "heart-slash" | "heart-tick" | "hedera-hashgraph" | "hex" | "hierarchy" | "hierarchy-2" | "hierarchy-3" | "hierarchy-square" | "hierarchy-square-2" | "hierarchy-square-3" | "history" | "home" | "home-2" | "home-3" | "home-hashtag" | "home-trend-down" | "home-trend-up" | "home-wifi" | "hospital" | "house" | "house-2" | "html-3" | "html-5" | "huobi-token" | "i-24-support" | "i-3-d-cube-scan" | "i-3-d-rotate" | "i-3-d-square" | "i-3-dcube" | "i-3-square" | "icon" | "illustrator" | "image" | "import" | "import-circle" | "import-curve" | "import-square" | "inbox" | "info" | "info-circle" | "information" | "instagram" | "iost" | "java-script" | "journal-text" | "js" | "judge" | "kanban" | "key" | "key-square" | "keyboard" | "keyboard-open" | "kyber-network" | "lamp" | "lamp-charge" | "lamp-on" | "lamp-slash" | "language-circle" | "language-square" | "layer" | "layers" | "layout-dashboard" | "layout-grid" | "layout-maximize" | "level" | "lifebuoy" | "lightbulb" | "like" | "like-1" | "like-dislike" | "like-shapes" | "like-tag" | "link" | "link-1" | "link-2" | "link-21" | "link-circle" | "link-square" | "linkedin" | "list" | "litecoin" | "location" | "location-add" | "location-cross" | "location-discover" | "location-minus" | "location-slash" | "location-tick" | "lock" | "lock-1" | "lock-circle" | "lock-slash" | "log-out" | "login" | "login-curve" | "logout" | "logout-curve" | "lovely" | "magic-star" | "magicpen" | "mail" | "main-component" | "maker" | "man" | "map" | "map-1" | "map-pin" | "mask" | "mask-left" | "mask-right" | "math" | "maximize" | "maximize-1" | "maximize-2" | "maximize-3" | "maximize-4" | "maximize-circle" | "medal" | "medal-star" | "menu" | "menu-board" | "message" | "message-2" | "message-add" | "message-add-1" | "message-circle" | "message-edit" | "message-favorite" | "message-minus" | "message-notif" | "message-programming" | "message-question" | "message-remove" | "message-search" | "message-square" | "message-text" | "message-text-1" | "message-tick" | "message-time" | "messages" | "messages-1" | "messages-2" | "messages-3" | "messenger" | "microphone" | "microphone-2" | "microphone-slash" | "microphone-slash-1" | "microscope" | "microsoft" | "milk" | "mini-music-sqaure" | "minus" | "minus-circle" | "minus-cirlce" | "minus-square" | "mirror" | "mirroring-screen" | "mobile" | "mobile-programming" | "monero" | "money" | "money-2" | "money-3" | "money-4" | "money-add" | "money-archive" | "money-change" | "money-forbidden" | "money-receive" | "money-recive" | "money-remove" | "money-send" | "money-tick" | "money-time" | "moneys" | "monitor" | "monitor-mobbile" | "monitor-recorder" | "moon" | "more" | "more-2" | "more-circle" | "more-horizontal" | "more-square" | "mouse" | "mouse-circle" | "mouse-square" | "music" | "music-circle" | "music-dashboard" | "music-filter" | "music-library-2" | "music-play" | "music-playlist" | "music-square" | "music-square-add" | "music-square-remove" | "music-square-search" | "musicnote" | "nebulas" | "nem" | "nexo" | "next" | "note" | "note-1" | "note-2" | "note-add" | "note-favorite" | "note-remove" | "note-square" | "note-text" | "notepad" | "notepad-2" | "notification" | "notification-1" | "notification-bing" | "notification-circle" | "notification-favorite" | "notification-status" | "ocean-protocol" | "okb" | "okru" | "omega-circle" | "omega-square" | "ontology" | "paintbucket" | "palette" | "panel-left-close" | "panel-left-open" | "paperclip" | "paperclip-2" | "password-check" | "path-tool" | "path-tool-2" | "path-tool-square" | "pause" | "pause-circle" | "paypal" | "pen-add" | "pen-close" | "pen-remove" | "pen-tool" | "pen-tool-2" | "pencil" | "people" | "percentage-circle" | "percentage-square" | "personalcard" | "pet" | "pharagraphspacing" | "phone" | "photoshop" | "picture-frame" | "play" | "play-add" | "play-circle" | "play-cricle" | "play-remove" | "plug" | "plus" | "plus-circle" | "pointer" | "polkadot" | "polygon" | "polyswarm" | "presentation-chart" | "presention-chart" | "previous" | "printer" | "printer-slash" | "profile" | "profile-2-user" | "profile-add" | "profile-circle" | "profile-delete" | "profile-remove" | "profile-tick" | "programming-arrow" | "programming-arrows" | "python" | "quant" | "quote-down" | "quote-down-circle" | "quote-down-square" | "quote-up" | "quote-up-circle" | "quote-up-square" | "radar" | "radar-2" | "radio" | "ram" | "ram-2" | "rank" | "ranking" | "receipt" | "receipt-1" | "receipt-2" | "receipt-21" | "receipt-add" | "receipt-discount" | "receipt-disscount" | "receipt-edit" | "receipt-item" | "receipt-minus" | "receipt-search" | "receipt-square" | "receipt-text" | "receive" | "receive-square" | "receive-square-2" | "record" | "record-circle" | "recovery-convert" | "reddit" | "refresh" | "refresh-2" | "refresh-circle" | "refresh-cw" | "refresh-left-square" | "refresh-right-square" | "refresh-square" | "repeat" | "repeat-circle" | "repeate-music" | "repeate-one" | "reserve" | "robot" | "rotate-ccw" | "rotate-cw" | "rotate-left" | "rotate-right" | "route-square" | "routing" | "routing-2" | "row-horizontal" | "row-vertical" | "ruler" | "ruler-pen" | "safe-home" | "sagittarius" | "save-2" | "save-add" | "save-minus" | "save-remove" | "scan" | "scan-barcode" | "scanner" | "scanning" | "scissor" | "screenmirroring" | "scroll" | "search" | "search-favorite" | "search-favorite-1" | "search-normal" | "search-normal-1" | "search-status" | "search-status-1" | "search-zoom-in" | "search-zoom-in-1" | "search-zoom-out" | "search-zoom-out-1" | "security" | "security-card" | "security-safe" | "security-time" | "security-user" | "send" | "send-2" | "server" | "setting" | "setting-2" | "setting-3" | "setting-4" | "setting-5" | "settings" | "shapes" | "shapes-1" | "share" | "share-2" | "shield" | "shield-check" | "shield-cross" | "shield-lock" | "shield-plus" | "shield-search" | "shield-security" | "shield-slash" | "shield-tick" | "ship" | "shop" | "shop-add" | "shop-remove" | "shopping-bag" | "shopping-cart" | "shuffle" | "shutterstock" | "siacoin" | "sidebar-bottom" | "sidebar-left" | "sidebar-right" | "sidebar-top" | "signpost" | "simcard" | "simcard-1" | "simcard-2" | "size" | "slack" | "slash" | "slider" | "slider-horizontal" | "slider-horizontal-1" | "slider-vertical" | "slider-vertical-1" | "sliders" | "sliders-horizontal" | "smallcaps" | "smart-car" | "smart-home" | "smileys" | "sms" | "sms-edit" | "sms-notification" | "sms-search" | "sms-star" | "sms-tracking" | "snapchat" | "snowflake" | "solana" | "sort" | "sound" | "sparkles" | "speaker" | "speedometer" | "spotify" | "stacks" | "star" | "star-1" | "star-slash" | "stars" | "status" | "status-up" | "stellar" | "sticker" | "stickynote" | "stop" | "stop-circle" | "story" | "strongbox" | "strongbox-2" | "subtitle" | "sun" | "sun-1" | "sun-fog" | "table-document" | "table-lamp" | "tag" | "tag-2" | "tag-cross" | "tag-right" | "tag-user" | "task" | "task-square" | "teacher" | "telephone" | "tenx" | "tether" | "text" | "text-block" | "text-bold" | "text-italic" | "text-underline" | "textalign-center" | "textalign-justifycenter" | "textalign-justifyleft" | "textalign-justifyright" | "textalign-left" | "textalign-right" | "the-graph" | "theta" | "thorchain" | "thumbs-down" | "thumbs-up" | "tick-circle" | "tick-square" | "ticket" | "ticket-2" | "ticket-discount" | "ticket-expired" | "ticket-star" | "timer" | "timer-1" | "timer-pause" | "timer-start" | "toggle-off" | "toggle-off-circle" | "toggle-on" | "toggle-on-circle" | "trade" | "transaction-minus" | "translate" | "transmit" | "transmit-sqaure-2" | "transmit-square" | "trash" | "trash-2" | "tree" | "trello" | "trend-down" | "trend-up" | "trending-up" | "triangle" | "triangle-logo" | "trontron" | "truck" | "truck-fast" | "truck-remove" | "truck-tick" | "truck-time" | "trush-square" | "twitch" | "two-page" | "ui-8" | "unlimited" | "unlock" | "upload" | "usd-coin" | "user" | "user-add" | "user-check" | "user-cirlce-add" | "user-edit" | "user-minus" | "user-octagon" | "user-plus" | "user-remove" | "user-search" | "user-square" | "user-tag" | "user-tick" | "users" | "velas" | "verify" | "vibe" | "video" | "video-add" | "video-circle" | "video-horizontal" | "video-octagon" | "video-play" | "video-remove" | "video-slash" | "video-square" | "video-tick" | "video-time" | "video-vertical" | "voice-circle" | "voice-cricle" | "voice-square" | "volume" | "volume-cross" | "volume-high" | "volume-low" | "volume-low-1" | "volume-mute" | "volume-slash" | "volume-up" | "wallet" | "wallet-1" | "wallet-2" | "wallet-3" | "wallet-add" | "wallet-add-1" | "wallet-check" | "wallet-minus" | "wallet-money" | "wallet-remove" | "wallet-search" | "wallet2" | "wanchain" | "wanchain-1" | "wand-sparkles" | "warning-2" | "watch" | "watch-status" | "weight" | "weight-meter" | "whatsapp" | "wifi" | "wifi-square" | "wind" | "wind-2" | "windows" | "wing" | "woman" | "wrist-clock" | "x" | "x-circle" | "xd" | "xiaomi" | "xrp" | "youtube" | "zap" | "zel" | "zoom" | "zoom-in" | "zoom-out";
|
|
2
2
|
export declare const ICON_NAMES: IconName[];
|
|
3
3
|
export type CatalogStyle = "linear" | "bold" | "broken" | "bulk" | "outline" | "twotone";
|
|
4
4
|
type ShardLoader = () => Record<string, string>;
|
|
@@ -11,6 +11,7 @@ export declare const GLYPHS: {
|
|
|
11
11
|
readonly "arrow-left": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.57 5.93L3.5 12l6.07 6.07M20.5 12H3.67"></path>';
|
|
12
12
|
readonly "arrow-left-2": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M15 19.92L8.48 13.4c-.77-.77-.77-2.03 0-2.8L15 4.08"></path>';
|
|
13
13
|
readonly "arrow-right": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M14.43 5.93L20.5 12l-6.07 6.07M3.5 12h16.83"></path>';
|
|
14
|
+
readonly "arrow-right-1": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M14.43 5.93L20.5 12l-6.07 6.07M3.5 12h16.83"></path>';
|
|
14
15
|
readonly "arrow-right-2": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M8.91 19.92l6.52-6.52c.77-.77.77-2.03 0-2.8L8.91 4.08"></path>';
|
|
15
16
|
readonly "arrow-swap-horizontal": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M20.5 14.99l-5.01 5.02M3.5 14.99h17M3.5 9.01l5.01-5.02M20.5 9.01h-17"></path>';
|
|
16
17
|
readonly "arrow-up": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M18.07 9.57L12 3.5 5.93 9.57M12 20.5V3.67"></path>';
|
|
@@ -71,6 +72,7 @@ export declare const GLYPHS: {
|
|
|
71
72
|
readonly "credit-card": '<path d="M2 8.505h20M6 16.505h2M10.5 16.505h4" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M6.44 3.505h11.11c3.56 0 4.45.88 4.45 4.39v8.21c0 3.51-.89 4.39-4.44 4.39H6.44c-3.55.01-4.44-.87-4.44-4.38v-8.22c0-3.51.89-4.39 4.44-4.39Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
72
73
|
readonly cursor: '<path d="m16.15 12.83-1.73.58c-.48.16-.85.53-1.01 1.01l-.58 1.73c-.49 1.49-2.59 1.46-3.05-.03L7.83 9.84c-.38-1.25.77-2.4 2-2.02l6.29 1.95c1.49.47 1.51 2.57.03 3.06Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
73
74
|
readonly danger: '<path d="M12 9v5M12 21.41H5.94c-3.47 0-4.92-2.48-3.24-5.51l3.12-5.62L8.76 5c1.78-3.21 4.7-3.21 6.48 0l2.94 5.29 3.12 5.62c1.68 3.03.22 5.51-3.24 5.51H12v-.01Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 17h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
75
|
+
readonly database: '<path d="M18.5 12.65v3.7c0 3.12-2.91 5.65-6.5 5.65s-6.5-2.53-6.5-5.65v-3.7C5.5 15.77 8.41 18 12 18s6.5-2.23 6.5-5.35Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M18.5 7.65c0 .91-.25 1.75-.69 2.47C16.74 11.88 14.54 13 12 13c-2.54 0-4.74-1.12-5.81-2.88-.44-.72-.69-1.56-.69-2.47 0-1.56.73-2.97 1.9-3.99C8.58 2.63 10.2 2 12 2c1.8 0 3.42.63 4.6 1.65 1.17 1.03 1.9 2.44 1.9 4Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M18.5 7.65v5c0 3.12-2.91 5.35-6.5 5.35s-6.5-2.23-6.5-5.35v-5C5.5 4.53 8.41 2 12 2c1.8 0 3.42.63 4.6 1.65 1.17 1.03 1.9 2.44 1.9 4Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
74
76
|
readonly "diagram-3": '<path d="M5 15V8M5.25 22a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM5 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM19 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM5.13 15a4.058 4.058 0 0 1 3.94-3.04l3.43.01c2.62.01 4.85-1.67 5.67-4.01" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
75
77
|
readonly display: '<path d="M6.44 2h11.11C21.11 2 22 2.89 22 6.44v6.33c0 3.56-.89 4.44-4.44 4.44H6.44C2.89 17.22 2 16.33 2 12.78V6.44C2 2.89 2.89 2 6.44 2ZM12 17.22V22M2 13h20M7.5 22h9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
76
78
|
readonly document: '<path d="M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10h-4c-3 0-4-1-4-4V2l8 8Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
@@ -79,6 +81,7 @@ export declare const GLYPHS: {
|
|
|
79
81
|
readonly download: '<path d="M9 11v6l2-2M9 17l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10h-4c-3 0-4-1-4-4V2l8 8Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
80
82
|
readonly edit: '<path d="m13.26 3.6-8.21 8.69c-.31.33-.61.98-.67 1.43l-.37 3.24c-.13 1.17.71 1.97 1.87 1.77l3.22-.55c.45-.08 1.08-.41 1.39-.75l8.21-8.69c1.42-1.5 2.06-3.21-.15-5.3-2.2-2.07-3.87-1.34-5.29.16Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.89 5.05a6.126 6.126 0 0 0 5.45 5.15M3 22h18" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
81
83
|
readonly "edit-2": '<path d="m13.26 3.6-8.21 8.69c-.31.33-.61.98-.67 1.43l-.37 3.24c-.13 1.17.71 1.97 1.87 1.77l3.22-.55c.45-.08 1.08-.41 1.39-.75l8.21-8.69c1.42-1.5 2.06-3.21-.15-5.3-2.2-2.07-3.87-1.34-5.29.16Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.89 5.05a6.126 6.126 0 0 0 5.45 5.15M3 22h18" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
84
|
+
readonly ellipsis: '<path d="M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2ZM19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2ZM12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z" stroke="currentColor" stroke-width="1.5"></path>';
|
|
82
85
|
readonly "emoji-smile": '<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.5 9.75a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM8.5 9.75a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM8.4 13.3h7.2c.5 0 .9.4.9.9 0 2.49-2.01 4.5-4.5 4.5s-4.5-2.01-4.5-4.5c0-.5.4-.9.9-.9Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
83
86
|
readonly export: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.32 6.5l2.56-2.56 2.56 2.56M11.88 14.18V4.01M4 12c0 4.42 3 8 8 8s8-3.58 8-8"></path>';
|
|
84
87
|
readonly "external-link": '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13 11l8.2-8.2M22 6.8V2h-4.8M11 2H9C4 2 2 4 2 9v6c0 5 2 7 7 7h6c5 0 7-2 7-7v-2"></path>';
|
|
@@ -98,6 +101,7 @@ export declare const GLYPHS: {
|
|
|
98
101
|
readonly "folder-kanban": '<path d="M10.5 19.9V4.1c0-1.5-.64-2.1-2.23-2.1H4.23C2.64 2 2 2.6 2 4.1v15.8c0 1.5.64 2.1 2.23 2.1h4.04c1.59 0 2.23-.6 2.23-2.1ZM22 12.9V4.1c0-1.5-.64-2.1-2.23-2.1h-4.04c-1.59 0-2.23.6-2.23 2.1v8.8c0 1.5.64 2.1 2.23 2.1h4.04c1.59 0 2.23-.6 2.23-2.1Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
99
102
|
readonly "folder-open": '<path d="m21.67 14.3-.4 5c-.15 1.53-.27 2.7-2.98 2.7H5.71C3 22 2.88 20.83 2.73 19.3l-.4-5c-.08-.83.18-1.6.65-2.19l.02-.02C3.55 11.42 4.38 11 5.31 11h13.38c.93 0 1.75.42 2.29 1.07.01.01.02.02.02.03.49.59.76 1.36.67 2.2Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10"></path><path d="M3.5 11.43V6.28c0-3.4.85-4.25 4.25-4.25h1.27c1.27 0 1.56.38 2.04 1.02l1.27 1.7c.32.42.51.68 1.36.68h2.55c3.4 0 4.25.85 4.25 4.25v1.79M9.43 17h5.14" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
100
103
|
readonly "folder-plus": '<path d="M12.06 16.5v-5M14.5 14h-5" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 11v6c0 4-1 5-5 5H7c-4 0-5-1-5-5V7c0-4 1-5 5-5h1.5c1.5 0 1.83.44 2.4 1.2l1.5 2c.38.5.6.8 1.6.8h3c4 0 5 1 5 5Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10"></path>';
|
|
104
|
+
readonly funnel: '<path d="M5.4 2.1h13.2c1.1 0 2 .9 2 2v2.2c0 .8-.5 1.8-1 2.3l-4.3 3.8c-.6.5-1 1.5-1 2.3V19c0 .6-.4 1.4-.9 1.7l-1.4.9c-1.3.8-3.1-.1-3.1-1.7v-5.3c0-.7-.4-1.6-.8-2.1l-3.8-4c-.5-.5-.9-1.4-.9-2V4.2c0-1.2.9-2.1 2-2.1ZM10.93 2.1 6 10" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
101
105
|
readonly gauge: '<path d="M19.14 19.5a9.964 9.964 0 0 0 2.86-7c0-5.52-4.48-10-10-10S2 6.98 2 12.5c0 2.72 1.08 5.18 2.84 6.99" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 21.5a3.38 3.38 0 1 0 0-6.76 3.38 3.38 0 0 0 0 6.76ZM15.25 12H16c.82 0 1.5-.67 1.5-1.5 0-.82-.68-1.5-1.5-1.5s-1.5.67-1.5 1.5v.75c0 .41.34.75.75.75Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
102
106
|
readonly gift: '<path d="M19.97 10h-16v8c0 3 1 4 4 4h8c3 0 4-1 4-4v-8ZM21.5 7v1c0 1.1-.53 2-2 2h-15c-1.53 0-2-.9-2-2V7c0-1.1.47-2 2-2h15c1.47 0 2 .9 2 2ZM11.64 5H6.12a.936.936 0 0 1 .03-1.3l1.42-1.42a.96.96 0 0 1 1.35 0L11.64 5ZM17.87 5h-5.52l2.72-2.72a.96.96 0 0 1 1.35 0l1.42 1.42c.36.36.37.93.03 1.3Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.94 10v5.14c0 .8.88 1.27 1.55.84l.94-.62a1 1 0 0 1 1.1 0l.89.6a.997.997 0 0 0 1.55-.83V10H8.94Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
103
107
|
readonly github: '<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 4.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" fill="currentColor"/>';
|
|
@@ -119,9 +123,11 @@ export declare const GLYPHS: {
|
|
|
119
123
|
readonly info: '<g transform="rotate(180 12 12)"><path d="M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10ZM12 8v5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 16h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g>';
|
|
120
124
|
readonly "info-circle": '<path d="M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10ZM12 8v5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 16h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
121
125
|
readonly instagram: '<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.636 7h.012" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
126
|
+
readonly "journal-text": '<path d="M8 2v3M16 2v3M21 8.5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5ZM8 11h8M8 16h4" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
122
127
|
readonly kanban: '<path d="M10.5 19.9V4.1c0-1.5-.64-2.1-2.23-2.1H4.23C2.64 2 2 2.6 2 4.1v15.8c0 1.5.64 2.1 2.23 2.1h4.04c1.59 0 2.23-.6 2.23-2.1ZM22 12.9V4.1c0-1.5-.64-2.1-2.23-2.1h-4.04c-1.59 0-2.23.6-2.23 2.1v8.8c0 1.5.64 2.1 2.23 2.1h4.04c1.59 0 2.23-.6 2.23-2.1Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
123
128
|
readonly key: '<path d="M19.79 14.93a7.575 7.575 0 0 1-7.6 1.87l-4.71 4.7c-.34.35-1.01.56-1.49.49l-2.18-.3c-.72-.1-1.39-.78-1.5-1.5l-.3-2.18c-.07-.48.16-1.15.49-1.49l4.7-4.7c-.8-2.6-.18-5.55 1.88-7.6 2.95-2.95 7.74-2.95 10.7 0 2.96 2.95 2.96 7.76.01 10.71ZM6.89 17.49l2.3 2.3" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
124
129
|
readonly layer: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.01 2.92l5.9 2.62c1.7.75 1.7 1.99 0 2.74l-5.9 2.62c-.67.3-1.77.3-2.44 0l-5.9-2.62c-1.7-.75-1.7-1.99 0-2.74l5.9-2.62c.67-.3 1.77-.3 2.44 0z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 11c0 .84.63 1.81 1.4 2.15l6.79 3.02c.52.23 1.11.23 1.62 0l6.79-3.02c.77-.34 1.4-1.31 1.4-2.15"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 16c0 .93.55 1.77 1.4 2.15l6.79 3.02c.52.23 1.11.23 1.62 0l6.79-3.02c.85-.38 1.4-1.22 1.4-2.15"></path>';
|
|
130
|
+
readonly layers: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.01 2.92l5.9 2.62c1.7.75 1.7 1.99 0 2.74l-5.9 2.62c-.67.3-1.77.3-2.44 0l-5.9-2.62c-1.7-.75-1.7-1.99 0-2.74l5.9-2.62c.67-.3 1.77-.3 2.44 0z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 11c0 .84.63 1.81 1.4 2.15l6.79 3.02c.52.23 1.11.23 1.62 0l6.79-3.02c.77-.34 1.4-1.31 1.4-2.15"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 16c0 .93.55 1.77 1.4 2.15l6.79 3.02c.52.23 1.11.23 1.62 0l6.79-3.02c.85-.38 1.4-1.22 1.4-2.15"></path>';
|
|
125
131
|
readonly "layout-dashboard": '<path d="M5 10h2c2 0 3-1 3-3V5c0-2-1-3-3-3H5C3 2 2 3 2 5v2c0 2 1 3 3 3ZM17 10h2c2 0 3-1 3-3V5c0-2-1-3-3-3h-2c-2 0-3 1-3 3v2c0 2 1 3 3 3ZM17 22h2c2 0 3-1 3-3v-2c0-2-1-3-3-3h-2c-2 0-3 1-3 3v2c0 2 1 3 3 3ZM5 22h2c2 0 3-1 3-3v-2c0-2-1-3-3-3H5c-2 0-3 1-3 3v2c0 2 1 3 3 3Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
126
132
|
readonly "layout-grid": '<path d="M17 10h2c2 0 3-1 3-3V5c0-2-1-3-3-3h-2c-2 0-3 1-3 3v2c0 2 1 3 3 3ZM5 22h2c2 0 3-1 3-3v-2c0-2-1-3-3-3H5c-2 0-3 1-3 3v2c0 2 1 3 3 3ZM6 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM18 22a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
127
133
|
readonly lightbulb: '<path d="M20.78 13.65v4.94H3.22v-4.94c0-4.82 3.9-8.72 8.72-8.72h.12c4.82 0 8.72 3.9 8.72 8.72ZM12 2v2.93M15.65 18.59A3.661 3.661 0 0 1 12 22c-1.93 0-3.52-1.5-3.65-3.41h7.3Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
@@ -148,6 +154,7 @@ export declare const GLYPHS: {
|
|
|
148
154
|
readonly moon: '<path d="M2.03 12.42c.36 5.15 4.73 9.34 9.96 9.57 3.69.16 6.99-1.56 8.97-4.27.82-1.11.38-1.85-.99-1.6-.67.12-1.36.17-2.08.14C13 16.06 9 11.97 8.98 7.14c-.01-1.3.26-2.53.75-3.65.54-1.24-.11-1.83-1.36-1.3C4.41 3.86 1.7 7.85 2.03 12.42Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
149
155
|
readonly "more-horizontal": '<path d="M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2ZM19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2ZM12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z" stroke="currentColor" stroke-width="1.5"></path>';
|
|
150
156
|
readonly music: '<path d="M6.28 22a3.12 3.12 0 1 0 0-6.24 3.12 3.12 0 0 0 0 6.24Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M20.84 16.8V4.6c0-2.6-1.63-2.96-3.28-2.51l-6.24 1.7C10.18 4.1 9.4 5 9.4 6.3v12.57" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.72 19.92a3.12 3.12 0 1 0 0-6.24 3.12 3.12 0 0 0 0 6.24ZM9.4 9.52 20.84 6.4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
157
|
+
readonly "note-2": '<path d="M8 2v3M16 2v3M7 13h8M7 17h5M16 3.5c3.33.18 5 1.45 5 6.15v6.18c0 4.12-1 6.18-6 6.18H9c-5 0-6-2.06-6-6.18V9.65c0-4.7 1.67-5.96 5-6.15h8Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
151
158
|
readonly notification: '<path d="M12.02 2.91c-3.31 0-6 2.69-6 6v2.89c0 .61-.26 1.54-.57 2.06L4.3 15.77c-.71 1.18-.22 2.49 1.08 2.93 4.31 1.44 8.96 1.44 13.27 0 1.21-.4 1.74-1.83 1.08-2.93l-1.15-1.91c-.3-.52-.56-1.45-.56-2.06V8.91c0-3.3-2.7-6-6-6Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"></path><path d="M13.87 3.2a6.754 6.754 0 0 0-3.7 0c.29-.74 1.01-1.26 1.85-1.26.84 0 1.56.52 1.85 1.26Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.02 19.06c0 1.65-1.35 3-3 3-.82 0-1.58-.34-2.12-.88a3.01 3.01 0 0 1-.88-2.12" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10"></path>';
|
|
152
159
|
readonly palette: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10 4.5V18c0 1.08-.44 2.07-1.14 2.79l-.04.04c-.09.09-.19.18-.28.25-.3.26-.64.46-.99.6-.11.05-.22.09-.33.13-.39.13-.81.19-1.22.19-.27 0-.54-.03-.8-.08-.13-.03-.26-.06-.39-.1-.16-.05-.31-.1-.46-.17 0-.01 0-.01-.01 0-.28-.14-.55-.3-.8-.49l-.01-.01c-.13-.1-.25-.2-.36-.32-.11-.12-.22-.24-.33-.37-.19-.25-.35-.52-.49-.8.01-.01.01-.01 0-.01 0 0 0-.01-.01-.02-.06-.14-.11-.29-.16-.44a5.58 5.58 0 01-.1-.39c-.05-.26-.08-.53-.08-.8V4.5C2 3 3 2 4.5 2h3C9 2 10 3 10 4.5z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M22 16.5v3c0 1.5-1 2.5-2.5 2.5H6c.41 0 .83-.06 1.22-.19.11-.04.22-.08.33-.13.35-.14.69-.34.99-.6.09-.07.19-.16.28-.25l.04-.04 6.8-6.79h3.84c1.5 0 2.5 1 2.5 2.5zM4.81 21.82c-.6-.18-1.17-.51-1.64-.99-.48-.47-.81-1.04-.99-1.64a4.02 4.02 0 002.63 2.63z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M18.37 11.29L15.66 14l-6.8 6.79C9.56 20.07 10 19.08 10 18V8.34l2.71-2.71c1.06-1.06 2.48-1.06 3.54 0l2.12 2.12c1.06 1.06 1.06 2.48 0 3.54zM6 19a1 1 0 100-2 1 1 0 000 2z"></path>';
|
|
153
160
|
readonly "panel-left-close": '<path d="M21.97 15V9c0-5-2-7-7-7h-6c-5 0-7 2-7 7v6c0 5 2 7 7 7h6c5 0 7-2 7-7ZM7.97 2v20" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.97 9.44 12.41 12l2.56 2.56" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
@@ -190,6 +197,8 @@ export declare const GLYPHS: {
|
|
|
190
197
|
readonly "shield-plus": '<path d="M10.49 2.23 5.5 4.11c-1.15.43-2.09 1.79-2.09 3.01v7.43c0 1.18.78 2.73 1.73 3.44l4.3 3.21c1.41 1.06 3.73 1.06 5.14 0l4.3-3.21c.95-.71 1.73-2.26 1.73-3.44V7.12c0-1.23-.94-2.59-2.09-3.02l-4.99-1.87c-.85-.31-2.21-.31-3.04 0Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 12.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 12.5v3" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
191
198
|
readonly "shield-tick": '<path d="M10.49 2.23 5.5 4.11c-1.15.43-2.09 1.79-2.09 3.01v7.43c0 1.18.78 2.73 1.73 3.44l4.3 3.21c1.41 1.06 3.73 1.06 5.14 0l4.3-3.21c.95-.71 1.73-2.26 1.73-3.44V7.12c0-1.23-.94-2.59-2.09-3.02l-4.99-1.87c-.85-.31-2.21-.31-3.04 0Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m9.05 11.87 1.61 1.61 4.3-4.3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
192
199
|
readonly shop: '<path d="M3.01 11.22v4.49C3.01 20.2 4.81 22 9.3 22h5.39c4.49 0 6.29-1.8 6.29-6.29v-4.49" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 12c1.83 0 3.18-1.49 3-3.32L14.34 2H9.67L9 8.68C8.82 10.51 10.17 12 12 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M18.31 12c2.02 0 3.5-1.64 3.3-3.65l-.28-2.75C20.97 3 19.97 2 17.35 2H14.3l.7 7.01c.17 1.65 1.66 2.99 3.31 2.99ZM5.64 12c1.65 0 3.14-1.34 3.3-2.99l.22-2.21.48-4.8H6.59C3.97 2 2.97 3 2.61 5.6l-.27 2.75C2.14 10.36 3.62 12 5.64 12ZM12 17c-1.67 0-2.5.83-2.5 2.5V22h5v-2.5c0-1.67-.83-2.5-2.5-2.5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
200
|
+
readonly sliders: '<path d="M19 22V11M19 7V2M12 22v-5M12 13V2M5 22V11M5 7V2M3 11h4M17 11h4M10 13h4" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
201
|
+
readonly "sliders-horizontal": '<path d="M22 6.5h-6M6 6.5H2M10 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7ZM22 17.5h-4M8 17.5H2M14 21a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
193
202
|
readonly snowflake: '<path d="M16.61 20c1.34.01 2.63-.49 3.62-1.39 3.27-2.86 1.52-8.6-2.79-9.14C15.9.13 2.43 3.67 5.62 12.56" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M7.28 12.97c-.53-.27-1.12-.41-1.71-.4-4.66.33-4.65 7.11 0 7.44M15.82 9.89c.52-.26 1.08-.4 1.66-.41" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12.995 18.5h.01M8.995 18.5h.01M10.995 21.5h.01" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
194
203
|
readonly sort: '<path d="M3 7h18M6 12h12M10 17h4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>';
|
|
195
204
|
readonly sparkles: '<path d="m17.29 4.14-.07 3.79c-.01.52.32 1.21.74 1.52l2.48 1.88c1.59 1.2 1.33 2.67-.57 3.27l-3.23 1.01c-.54.17-1.11.76-1.25 1.31l-.77 2.94c-.61 2.32-2.13 2.55-3.39.51l-1.76-2.85c-.32-.52-1.08-.91-1.68-.88l-3.34.17c-2.39.12-3.07-1.26-1.51-3.08l1.98-2.3c.37-.43.54-1.23.37-1.77L4.28 6.43c-.59-1.9.47-2.95 2.36-2.33l2.95.97c.5.16 1.25.05 1.67-.26l3.08-2.22c1.66-1.2 2.99-.5 2.95 1.55ZM21.91 22l-3.03-3.03" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
@@ -233,5 +242,5 @@ export declare const GLYPHS: {
|
|
|
233
242
|
readonly "zoom-out": '<path d="M9 11.7h5M11.5 21a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM22 22l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>';
|
|
234
243
|
};
|
|
235
244
|
export type CuratedIconName = keyof typeof GLYPHS;
|
|
236
|
-
export declare const CURATED_ICON_NAMES: ("activity" | "add" | "add-circle" | "alarm" | "alert-circle" | "alert-triangle" | "arrow-down" | "arrow-down-2" | "arrow-down-up" | "arrow-left" | "arrow-left-2" | "arrow-right" | "arrow-right-2" | "arrow-swap-horizontal" | "arrow-up" | "arrow-up-2" | "arrow-up-right" | "at" | "badge-check" | "ban" | "bank" | "bell" | "book" | "bookmark" | "box-seam" | "briefcase" | "bug" | "building" | "building-2" | "bullseye" | "cake" | "calculator" | "calendar" | "calendar-1" | "calendar-add" | "calendar-check" | "calendar-dots" | "calendar-tick" | "camera" | "cash-stack" | "chart" | "chart-column" | "chat" | "chat-dots" | "check" | "check-check" | "check-circle" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chevrons-left" | "chevrons-right" | "chevrons-up-down" | "circle" | "circle-help" | "clipboard-check" | "clipboard-text" | "clipboard-tick" | "clock" | "close-circle" | "cloud" | "code" | "code-circle" | "coins" | "comment" | "contact" | "copy" | "cpu" | "credit-card" | "cursor" | "danger" | "diagram-3" | "display" | "document" | "document-download" | "document-text" | "download" | "edit" | "edit-2" | "emoji-smile" | "export" | "external-link" | "eye" | "eye-off" | "facebook" | "factory" | "file-plus-2" | "file-text" | "files" | "filter" | "flag" | "flame" | "flash" | "folder" | "folder-2" | "folder-kanban" | "folder-open" | "folder-plus" | "gauge" | "gift" | "github" | "globe" | "globe2" | "google" | "grid" | "hand" | "hard-hat" | "headphone" | "health" | "heart" | "hierarchy" | "history" | "home-2" | "house" | "image" | "inbox" | "info" | "info-circle" | "instagram" | "kanban" | "key" | "layer" | "layout-dashboard" | "layout-grid" | "lightbulb" | "link-2" | "linkedin" | "list" | "lock" | "lock-1" | "log-out" | "login" | "logout" | "mail" | "map-pin" | "maximize-4" | "menu" | "message-question" | "message-square" | "message-text" | "microsoft" | "minus" | "minus-circle" | "mobile" | "monitor" | "moon" | "more-horizontal" | "music" | "notification" | "palette" | "panel-left-close" | "panel-left-open" | "paperclip" | "pause" | "pen-tool" | "pencil" | "people" | "phone" | "play" | "plug" | "plus" | "plus-circle" | "printer" | "profile-circle" | "ranking" | "receipt" | "receipt-text" | "reddit" | "refresh" | "refresh-cw" | "repeat" | "robot" | "rotate-ccw" | "rotate-cw" | "routing" | "search" | "search-normal" | "send" | "server" | "setting-2" | "settings" | "share" | "share-2" | "shield" | "shield-check" | "shield-cross" | "shield-lock" | "shield-plus" | "shield-tick" | "shop" | "snowflake" | "sort" | "sparkles" | "star" | "stars" | "stop" | "subtitle" | "sun" | "tag" | "task" | "task-square" | "telephone" | "text" | "thumbs-down" | "thumbs-up" | "tick-circle" | "trash" | "trash-2" | "trending-up" | "triangle" | "two-page" | "upload" | "user" | "user-check" | "user-edit" | "user-minus" | "user-plus" | "users" | "volume-high" | "volume-mute" | "volume-slash" | "wallet2" | "wand-sparkles" | "warning-2" | "whatsapp" | "x" | "x-circle" | "youtube" | "zap" | "zoom-in" | "zoom-out")[];
|
|
245
|
+
export declare const CURATED_ICON_NAMES: ("activity" | "add" | "add-circle" | "alarm" | "alert-circle" | "alert-triangle" | "arrow-down" | "arrow-down-2" | "arrow-down-up" | "arrow-left" | "arrow-left-2" | "arrow-right" | "arrow-right-1" | "arrow-right-2" | "arrow-swap-horizontal" | "arrow-up" | "arrow-up-2" | "arrow-up-right" | "at" | "badge-check" | "ban" | "bank" | "bell" | "book" | "bookmark" | "box-seam" | "briefcase" | "bug" | "building" | "building-2" | "bullseye" | "cake" | "calculator" | "calendar" | "calendar-1" | "calendar-add" | "calendar-check" | "calendar-dots" | "calendar-tick" | "camera" | "cash-stack" | "chart" | "chart-column" | "chat" | "chat-dots" | "check" | "check-check" | "check-circle" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chevrons-left" | "chevrons-right" | "chevrons-up-down" | "circle" | "circle-help" | "clipboard-check" | "clipboard-text" | "clipboard-tick" | "clock" | "close-circle" | "cloud" | "code" | "code-circle" | "coins" | "comment" | "contact" | "copy" | "cpu" | "credit-card" | "cursor" | "danger" | "database" | "diagram-3" | "display" | "document" | "document-download" | "document-text" | "download" | "edit" | "edit-2" | "ellipsis" | "emoji-smile" | "export" | "external-link" | "eye" | "eye-off" | "facebook" | "factory" | "file-plus-2" | "file-text" | "files" | "filter" | "flag" | "flame" | "flash" | "folder" | "folder-2" | "folder-kanban" | "folder-open" | "folder-plus" | "funnel" | "gauge" | "gift" | "github" | "globe" | "globe2" | "google" | "grid" | "hand" | "hard-hat" | "headphone" | "health" | "heart" | "hierarchy" | "history" | "home-2" | "house" | "image" | "inbox" | "info" | "info-circle" | "instagram" | "journal-text" | "kanban" | "key" | "layer" | "layers" | "layout-dashboard" | "layout-grid" | "lightbulb" | "link-2" | "linkedin" | "list" | "lock" | "lock-1" | "log-out" | "login" | "logout" | "mail" | "map-pin" | "maximize-4" | "menu" | "message-question" | "message-square" | "message-text" | "microsoft" | "minus" | "minus-circle" | "mobile" | "monitor" | "moon" | "more-horizontal" | "music" | "note-2" | "notification" | "palette" | "panel-left-close" | "panel-left-open" | "paperclip" | "pause" | "pen-tool" | "pencil" | "people" | "phone" | "play" | "plug" | "plus" | "plus-circle" | "printer" | "profile-circle" | "ranking" | "receipt" | "receipt-text" | "reddit" | "refresh" | "refresh-cw" | "repeat" | "robot" | "rotate-ccw" | "rotate-cw" | "routing" | "search" | "search-normal" | "send" | "server" | "setting-2" | "settings" | "share" | "share-2" | "shield" | "shield-check" | "shield-cross" | "shield-lock" | "shield-plus" | "shield-tick" | "shop" | "sliders" | "sliders-horizontal" | "snowflake" | "sort" | "sparkles" | "star" | "stars" | "stop" | "subtitle" | "sun" | "tag" | "task" | "task-square" | "telephone" | "text" | "thumbs-down" | "thumbs-up" | "tick-circle" | "trash" | "trash-2" | "trending-up" | "triangle" | "two-page" | "upload" | "user" | "user-check" | "user-edit" | "user-minus" | "user-plus" | "users" | "volume-high" | "volume-mute" | "volume-slash" | "wallet2" | "wand-sparkles" | "warning-2" | "whatsapp" | "x" | "x-circle" | "youtube" | "zap" | "zoom-in" | "zoom-out")[];
|
|
237
246
|
//# sourceMappingURL=glyphs.g.d.ts.map
|
|
@@ -126,6 +126,10 @@ interface BaseChoiceGroupProps<T = ChoiceOption> {
|
|
|
126
126
|
min?: number | undefined;
|
|
127
127
|
/** Multiple mode only: most options that can be selected. At this count the unselected options are disabled. Default no limit. */
|
|
128
128
|
max?: number | undefined;
|
|
129
|
+
/** A label above the group, drawn like the other fields' labels. A string also names the group when `accessibilityLabel` is not set. */
|
|
130
|
+
label?: React.ReactNode | undefined;
|
|
131
|
+
/** Marks the label as required, as on the other fields. */
|
|
132
|
+
required?: boolean | undefined;
|
|
129
133
|
/** A line of text drawn above the options: a string, or a node for a symbol with a subscript. */
|
|
130
134
|
description?: React.ReactNode | undefined;
|
|
131
135
|
/** A hint drawn under the options, a string or a node; hidden while `error` is set. */
|