@webority/mobile-ui 0.109.6 → 0.109.8
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 +8178 -7802
- package/dist/canvas-kit/manifest.json +360 -2
- package/dist/canvas-kit/release.json +6 -6
- package/lib/commonjs/components/AppBar/AppBar.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Badge/Badge.js +1 -1
- package/lib/commonjs/components/Banner/Banner.js +1 -1
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.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/Dialog/Dialog.js +1 -1
- package/lib/commonjs/components/Dialog/OverlayActions.js +1 -0
- package/lib/commonjs/components/EmptyState/EmptyState.js +1 -1
- package/lib/commonjs/components/IconBadge/IconBadge.js +1 -1
- package/lib/commonjs/components/ListItem/ListItem.js +1 -1
- package/lib/commonjs/components/ListSection/ListSection.js +1 -0
- package/lib/commonjs/components/ListSection/index.js +1 -0
- package/lib/commonjs/components/Menu/MenuSurface.js +1 -1
- package/lib/commonjs/components/ProfileCompletion/ProfileCompletion.js +1 -1
- package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/commonjs/components/StatusBadge/StatusBadge.js +1 -1
- package/lib/commonjs/components/Tabs/Tabs.js +1 -1
- package/lib/commonjs/components/Timeline/Timeline.js +1 -1
- package/lib/commonjs/components/index.js +1 -1
- package/lib/commonjs/hooks/usePressAnimation.js +1 -1
- package/lib/module/components/AppBar/AppBar.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Badge/Badge.js +1 -1
- package/lib/module/components/Banner/Banner.js +1 -1
- package/lib/module/components/BottomNavigation/BottomNavigation.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/Dialog/Dialog.js +1 -1
- package/lib/module/components/Dialog/OverlayActions.js +1 -0
- package/lib/module/components/EmptyState/EmptyState.js +1 -1
- package/lib/module/components/IconBadge/IconBadge.js +1 -1
- package/lib/module/components/ListItem/ListItem.js +1 -1
- package/lib/module/components/ListSection/ListSection.js +1 -0
- package/lib/module/components/ListSection/index.js +1 -0
- package/lib/module/components/Menu/MenuSurface.js +1 -1
- package/lib/module/components/ProfileCompletion/ProfileCompletion.js +1 -1
- package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/module/components/StatusBadge/StatusBadge.js +1 -1
- package/lib/module/components/Tabs/Tabs.js +1 -1
- package/lib/module/components/Timeline/Timeline.js +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/hooks/usePressAnimation.js +1 -1
- package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +22 -2
- package/lib/typescript/commonjs/components/AppBar/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +20 -2
- package/lib/typescript/commonjs/components/Avatar/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/Badge/Badge.d.ts +5 -0
- package/lib/typescript/commonjs/components/Badge/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +3 -1
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +6 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +3 -0
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +9 -0
- package/lib/typescript/commonjs/components/Dialog/OverlayActions.d.ts +19 -0
- package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts +4 -0
- package/lib/typescript/commonjs/components/EmptyState/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/IconBadge/IconBadge.d.ts +20 -1
- package/lib/typescript/commonjs/components/IconBadge/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +9 -3
- package/lib/typescript/commonjs/components/ListItem/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/ListSection/ListSection.d.ts +20 -0
- package/lib/typescript/commonjs/components/ListSection/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/lib/typescript/commonjs/components/StatusBadge/StatusBadge.d.ts +18 -1
- package/lib/typescript/commonjs/components/StatusBadge/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/index.d.ts +9 -7
- package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts +6 -3
- package/lib/typescript/module/components/AppBar/AppBar.d.ts +22 -2
- package/lib/typescript/module/components/AppBar/index.d.ts +1 -1
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +20 -2
- package/lib/typescript/module/components/Avatar/index.d.ts +1 -1
- package/lib/typescript/module/components/Badge/Badge.d.ts +5 -0
- package/lib/typescript/module/components/Badge/index.d.ts +1 -1
- package/lib/typescript/module/components/Banner/Banner.d.ts +3 -1
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +6 -0
- package/lib/typescript/module/components/Card/Card.d.ts +3 -0
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +9 -0
- package/lib/typescript/module/components/Dialog/OverlayActions.d.ts +19 -0
- package/lib/typescript/module/components/EmptyState/EmptyState.d.ts +4 -0
- package/lib/typescript/module/components/EmptyState/index.d.ts +1 -1
- package/lib/typescript/module/components/IconBadge/IconBadge.d.ts +20 -1
- package/lib/typescript/module/components/IconBadge/index.d.ts +1 -1
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +9 -3
- package/lib/typescript/module/components/ListItem/index.d.ts +1 -1
- package/lib/typescript/module/components/ListSection/ListSection.d.ts +20 -0
- package/lib/typescript/module/components/ListSection/index.d.ts +3 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/lib/typescript/module/components/StatusBadge/StatusBadge.d.ts +18 -1
- package/lib/typescript/module/components/StatusBadge/index.d.ts +1 -1
- package/lib/typescript/module/components/index.d.ts +9 -7
- package/lib/typescript/module/hooks/usePressAnimation.d.ts +6 -3
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{createAnimatedValue,Gradient,setNativeValue,useTheme}from"../../theme/index.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PROGRESS_BAR_LABELS=Object.freeze({loading:"Loading"});const toneColor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors["text-muted"];default:return e.colors.primary}},DETERMINATE_ANIMATION_DURATION=400,INDETERMINATE_LOOP_DURATION=1500,INDETERMINATE_WIDTH="30%",GLOW_LOCATIONS=[0,.35,.5,.65,1],glowOf=e=>{const t=tintOf(e,0,"transparent"),r=tintOf(e,.6,e);return{colors:[t,r,e,r,t],locations:GLOW_LOCATIONS,start:{x:0,y:.5},end:{x:1,y:.5}}},clampProgress=e=>"number"!=typeof e||Number.isNaN(e)||e<0?0:e>1?1:e,ProgressBar=forwardRef((e,t)=>{const r=useTheme(),s=useReducedMotion(),{progress:a,label:o,showPercent:i=!1,
|
|
1
|
+
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{createAnimatedValue,Gradient,setNativeValue,useTheme}from"../../theme/index.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PROGRESS_BAR_LABELS=Object.freeze({loading:"Loading"});const toneColor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors["text-muted"];default:return e.colors.primary}},DETERMINATE_ANIMATION_DURATION=400,INDETERMINATE_LOOP_DURATION=1500,INDETERMINATE_WIDTH="30%",GLOW_LOCATIONS=[0,.35,.5,.65,1],glowOf=e=>{const t=tintOf(e,0,"transparent"),r=tintOf(e,.6,e);return{colors:[t,r,e,r,t],locations:GLOW_LOCATIONS,start:{x:0,y:.5},end:{x:1,y:.5}}},clampProgress=e=>"number"!=typeof e||Number.isNaN(e)||e<0?0:e>1?1:e,ProgressBar=forwardRef((e,t)=>{const r=useTheme(),s=useReducedMotion(),{progress:a,label:o,showPercent:i=!1,valueLabel:n,indeterminate:l,height:u=6,radius:c,tone:d="primary",trackColor:m,barColor:g,gradient:p,segments:f,animated:y=!0,style:h,containerStyle:b,barStyle:w,accessibilityLabel:x,labels:R,testID:A}=e;warnInvalidValue("ProgressBar","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const _=useMemo(()=>({...DEFAULT_PROGRESS_BAR_LABELS,...R}),[R]),j=l??"number"!=typeof a,E=clampProgress(a),v=useRef(createAnimatedValue(E)).current,V=useRef(createAnimatedValue(0)).current,S=useRef(createAnimatedValue(0)).current,T=useRef(0),N=useMemo(()=>buildStyles(r),[r]),O=c??r.radius.pill,I=m??r.colors["surface-disabled"],L=g??toneColor(r,d),B=useMemo(()=>p?"string"==typeof p?r.settings.gradients[p]??null:p:null,[p,r.settings.gradients]),C=useMemo(()=>glowOf(L),[L]),D=Array.isArray(f)&&f.length>0;useEffect(()=>{j||(y?Animated.timing(v,{toValue:E,duration:400,easing:Easing.bezier(...r.motion.ease["in-out"]),useNativeDriver:!1}).start():v.setValue(E))},[y,E,v,j,r]),useEffect(()=>{if(!j)return;setNativeValue(V,0);const e=Animated.loop(Animated.timing(V,{toValue:1,duration:1500,easing:Easing.inOut(Easing.ease),useNativeDriver:!0}));return e.start(),()=>{e.stop()}},[j,V]);const M=v.interpolate({inputRange:[0,1],outputRange:["0%","100%"]}),P=V.interpolate({inputRange:[0,1],outputRange:[-1,1]}),k=V.interpolate({inputRange:[0,.5,1],outputRange:[.4,1,.4]}),G=i&&!j&&!D,F=null!=o||G||null!=n,U=_jsx(View,{ref:t,accessibilityRole:"progressbar",accessibilityLabel:x??("string"==typeof o?o:void 0),accessibilityValue:j?{text:_.loading}:{min:0,max:100,now:Math.round(100*E)},testID:A,onLayout:e=>{const t=e.nativeEvent.layout.width;T.current=t,setNativeValue(S,t)},style:[N.track,{height:u,borderRadius:O,...smoothCorners,backgroundColor:I},h,b],children:D?_jsx(View,{style:[N.segments,{height:u}],children:(f??[]).map((e,t)=>_jsx(View,{style:{width:100*clampProgress(e.value)+"%",height:u,backgroundColor:e.color??toneColor(r,e.tone??"primary")}},t))}):_jsx(Animated.View,j?{style:[N.indeterminateBar,{height:u,width:s?"100%":"30%",opacity:s?k:1,transform:s?[]:[{translateX:Animated.multiply(P,S)}]},w],children:_jsx(Gradient,{gradient:C,style:StyleSheet.absoluteFill})}:{style:[N.determinateBar,{height:u,borderRadius:O,...smoothCorners,backgroundColor:B?"transparent":L,width:M,overflow:B?"hidden":void 0},w],children:B?_jsx(Gradient,{gradient:B,style:StyleSheet.absoluteFill}):null})});return F?_jsxs(View,{style:N.wrapper,children:[_jsxs(View,{style:[N.labelRow,{marginBottom:r.space.xs}],children:["string"==typeof o||"number"==typeof o?_jsx(Text,{variant:"label",color:"primary",style:N.label,children:o}):_jsx(View,{style:N.label,children:o}),null!=n?"string"==typeof n||"number"==typeof n?_jsx(Text,{variant:"label",color:"secondary",accessible:!1,importantForAccessibility:"no",children:n}):n:G?_jsx(Text,{variant:"label",color:"secondary",accessible:!1,importantForAccessibility:"no",children:`${Math.round(100*E)}%`}):null]}),U]}):U});ProgressBar.displayName="ProgressBar";const buildStyles=e=>StyleSheet.create({wrapper:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",columnGap:e.space.sm},label:{flexShrink:1},track:{width:"100%",overflow:"hidden"},determinateBar:{position:"absolute",left:0,top:0},indeterminateBar:{position:"absolute",left:0,top:0},segments:{flexDirection:"row",width:"100%"}});export{ProgressBar};export default ProgressBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{deriveToneInk}from"../../theme/toneInk.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const sizeMap={sm:{height:22,paddingX:"sm",dot:5,gap:"xs"},md:{height:24,paddingX:"md",dot:6,gap:"xs"}},sizeFor=(e,t)=>{const s=sizeMap[t];return{height:s.height,paddingH:e.space[s.paddingX],dot:s.dot,gap:e.space[s.gap]}},SOFT_FILL_OPACITY=.14,SOFT_BORDER_OPACITY=.4,BORDER_WIDTH=1,toneFor=(e,t)=>{const{colors:s}=e;switch(t){case"success":return{base:s.success,on:s["on-success"],ink:s["success-text"]};case"warning":return{base:s.warning,on:s["on-warning"],ink:s["warning-text"]};case"danger":return{base:s.danger,on:s["on-danger"],ink:s["danger-text"]};case"info":return{base:s.info,on:s["on-info"],ink:s["info-text"]};case"primary":return{base:s.primary,on:s["on-primary"],ink:s["primary-text"]};default:return{base:s["text-muted"],on:s["on-neutral-strong"],ink:s["text-muted"]}}},isHex=e=>"string"==typeof e&&/^#[0-9a-f]{6}$/i.test(e),paletteFor=(e,t,s,
|
|
1
|
+
"use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{deriveToneInk}from"../../theme/toneInk.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const sizeMap={sm:{height:22,paddingX:"sm",dot:5,gap:"xs"},md:{height:24,paddingX:"md",dot:6,gap:"xs"}},sizeFor=(e,t)=>{const s=sizeMap[t];return{height:s.height,paddingH:e.space[s.paddingX],dot:s.dot,gap:e.space[s.gap]}},SOFT_FILL_OPACITY=.14,SOFT_BORDER_OPACITY=.4,BORDER_WIDTH=1,toneFor=(e,t)=>{const{colors:s}=e;switch(t){case"success":return{base:s.success,on:s["on-success"],ink:s["success-text"],soft:s["success-soft"]};case"warning":return{base:s.warning,on:s["on-warning"],ink:s["warning-text"],soft:s["warning-soft"]};case"danger":return{base:s.danger,on:s["on-danger"],ink:s["danger-text"],soft:s["danger-soft"]};case"info":return{base:s.info,on:s["on-info"],ink:s["info-text"],soft:s["info-soft"]};case"primary":return{base:s.primary,on:s["on-primary"],ink:s["primary-text"],soft:s["primary-soft"]};default:return{base:s["text-muted"],on:s["on-neutral-strong"],ink:s["text-muted"],soft:s.border}}},isHex=e=>"string"==typeof e&&/^#[0-9a-f]{6}$/i.test(e),paletteFor=(e,t,s,a)=>{const o=isHex(a),{base:r,on:n,ink:i,soft:l}=o?{base:a,on:e.colors["text-inverse"],ink:deriveToneInk(a,[e.colors.bg,e.colors["bg-subtle"],e.colors["bg-muted"]],e.mode),soft:tintOf(a,.14,e.colors["bg-subtle"])}:toneFor(e,t),d=!o&&"neutral"===t,u=d?e.colors["bg-muted"]:tintOf(r,.14,e.colors["bg-subtle"]),g=d?e.colors.border:tintOf(r,.4,r);switch(s){case"solid":return{fill:r,border:r,text:n,dot:n};case"outline":return{fill:"transparent",border:d?g:r,text:i,dot:r};case"flat":return{fill:u,border:"transparent",text:i,dot:r};case"ghost":return{fill:"transparent",border:"transparent",text:i,dot:r};case"filled":return{fill:l,border:"transparent",text:i,dot:r};default:return{fill:u,border:g,text:i,dot:r}}},StatusBadge=forwardRef((e,t)=>{const{label:s,tone:a="neutral",variant:o="soft",size:r="md",ink:n="tone",weight:i="semibold",padding:l="default",dot:d=!1,color:u,loading:g=!1,accessibilityLabel:c,style:f,textStyle:m,testID:p}=e;warnInvalidValue("StatusBadge","tone",e.tone,["success","warning","danger","info","primary","neutral"]),warnInvalidValue("StatusBadge","variant",e.variant,["solid","soft","outline","ghost","flat","filled"]),warnInvalidValue("StatusBadge","size",e.size,["sm","md"]),warnInvalidValue("StatusBadge","ink",e.ink,["tone","primary"]),warnInvalidValue("StatusBadge","weight",e.weight,["semibold","bold"]),warnInvalidValue("StatusBadge","padding",e.padding,["default","sm","md"]);const b=useTheme(),x=sizeFor(b,r),h=useMemo(()=>paletteFor(b,a,o,u),[b,a,o,u]),S="primary"===n&&"solid"!==o?b.colors["text-body"]:h.text,y="default"===l?{minHeight:x.height,paddingHorizontal:x.paddingH}:{paddingHorizontal:b.space[l],paddingVertical:b.space.xs},w="filled"===o?0:1;return g?_jsx(StatusBadgeSkeleton,{...e}):_jsxs(View,{ref:t,accessible:!0,accessibilityRole:"text",accessibilityLabel:c??s,testID:p,style:[styles.base,{...y,borderRadius:b.radius.pill,...smoothCorners,backgroundColor:h.fill,borderColor:h.border,borderWidth:w},f],children:[d?_jsx(View,{testID:"status-badge-dot",style:{width:x.dot,height:x.dot,borderRadius:x.dot/2,marginRight:x.gap,backgroundColor:h.dot}}):null,_jsx(Text,{variant:"sm"===r?"caption":"bodySmall",weight:i,style:[styles.label,{color:S},m],numberOfLines:1,children:s})]})});StatusBadge.displayName="StatusBadge";const StatusBadgeSkeleton=({label:e,size:t="md",variant:s="soft",padding:a="default",dot:o,style:r})=>{const n=useTheme(),i=sizeFor(n,t),l=Math.max(32,Math.min(120,6.5*(e??"").length))+2*("default"===a?i.paddingH:n.space[a])+(o?i.dot+i.gap:0),d="default"===a?i.height:Math.round(n.text["sm"===t?"xs":"sm"].size*n.leading.body)+2*n.space.xs+2*("filled"===s?0:1);return _jsx(Skeleton,{width:l,height:d,radius:d/2,style:[styles.skeleton,r]})};StatusBadgeSkeleton.displayName="StatusBadgeSkeleton",StatusBadge.Skeleton=StatusBadgeSkeleton;const styles=StyleSheet.create({base:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",justifyContent:"center"},label:{textAlign:"center",includeFontPadding:!1,textAlignVertical:"center"},skeleton:{alignSelf:"flex-start"}});export{StatusBadge};export default StatusBadge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Logger}from"@webority/mobile-core";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Pressable,ScrollView,StyleSheet,View}from"react-native";import{createAnimatedValue,resolveSegmentedControlSize,resolveTabsSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.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 Tabs=forwardRef((e,t)=>{const{tabs:i,activeKey:
|
|
1
|
+
"use strict";import{Logger}from"@webority/mobile-core";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Pressable,ScrollView,StyleSheet,View}from"react-native";import{createAnimatedValue,resolveSegmentedControlSize,resolveTabsSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Badge}from"../Badge/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 Tabs=forwardRef((e,t)=>{const{tabs:i,activeKey:a,onChange:r,variant:n="underline",radius:s,size:l="md",scrollable:o=!1,align:d="left",style:c,tabStyle:u,tabLabelStyle:m,tabIconStyle:p,tabBadgeStyle:b,dividerStyle:g,indicatorStyle:f,progress:h,pages:y,haptic:x,accessibilityLabel:v,testID:S}=e;warnInvalidValue("Tabs","variant",e.variant,["underline","pills","segmented"]),warnInvalidValue("Tabs","size",e.size,["sm","md","lg"]),warnInvalidValue("Tabs","align",e.align,["left","center"]);const w=useTheme(),j=useMemo(()=>buildStyles(w),[w]),V=w.components.tabs,T=useMemo(()=>resolveTabsSize(w,l),[w,l]),_=o?T["scrollable-padding-x"]:T["padding-x"],k=T["padding-y"],I=T.text,R=w.space[V["icon-gap"]],z=T.icon,C=V["underline-height"],E=w.space[V["pill-inset"]],L=V["disabled-opacity"],A=w.space[V["badge-gap"]],M="segmented"===n,F=useMemo(()=>resolveSegmentedControlSize(w,l),[w,l]),H=w.space[V["track-padding"]],D="number"==typeof s?s:s?w.radius[s]:void 0,B=D??w.radius.md,P=void 0===D?w.radius.sm:Math.max(D-H,0),q=D??w.radius.pill,N=D??w.radius.none,O=w.colors["bg-muted"],W=useSquircle(M,B),[$,U]=useState({}),K=useRef(createAnimatedValue(0)).current,X=useRef(createAnimatedValue(0)).current,[G,J]=useState(0),Q=useRef(createAnimatedValue(0)).current,Y=useRef(null),Z=useRef(0),ee=$[a],te=Math.max(0,i.findIndex(e=>e.key===a)),ie=useMemo(()=>y&&G>0?Q.interpolate({inputRange:[0,G],outputRange:[0,1]}):void 0,[y,G,Q])??h,ae=i.every(e=>void 0!==$[e.key]),re=void 0!==ie&&ae&&i.length>1,ne=useMemo(()=>re&&ie?ie.interpolate({inputRange:i.map((e,t)=>t),outputRange:i.map(e=>$[e.key].x),extrapolate:"clamp"}):null,[re,ie,i,$]),se=useMemo(()=>re&&ie?ie.interpolate({inputRange:i.map((e,t)=>t),outputRange:i.map(e=>$[e.key].width),extrapolate:"clamp"}):null,[re,ie,i,$]),le=useRef(null);useEffect(()=>{if(!ee)return;if(re)return;const e=null!==le.current&&le.current!==a;if(le.current=a,!e)return K.setValue(ee.x),void X.setValue(ee.width);const t=w.motion.spring.snappy,i=Animated.parallel([Animated.spring(K,{toValue:ee.x,damping:t.damping,stiffness:t.stiffness,mass:t.mass,overshootClamping:!0,useNativeDriver:!1}),Animated.spring(X,{toValue:ee.width,damping:t.damping,stiffness:t.stiffness,mass:t.mass,overshootClamping:!0,useNativeDriver:!1})]);return i.start(),()=>i.stop()},[ee,a,K,X,w.motion.spring.snappy,re]),useEffect(()=>{y&&0!==G&&Z.current!==te&&(Z.current=te,Y.current?.scrollTo({x:te*G,animated:!0}))},[y,G,te]);const oe=y?.length;useEffect(()=>{__DEV__&&void 0!==oe&&oe!==i.length&&Logger.warn(`[@webority/mobile-ui] Tabs pages has ${oe} entries for ${i.length} tabs; each tab needs one page.`)},[oe,i.length]);const de=useCallback(e=>t=>{const{x:i,width:a}=t.nativeEvent.layout;U(t=>{const r=t[e];return r&&r.x===i&&r.width===a?t:{...t,[e]:{x:i,width:a}}})},[]),ce=useCallback(e=>{if(e.disabled)return;if(e.key===a)return;const t=resolveHaptic(x,"selection");t&&triggerHaptic(t),r(e.key)},[a,r,x]),ue="pills"===n,me=_jsx(Animated.View,{pointerEvents:"none",style:[M?j.indicatorThumb:ue?j.indicatorPill:j.indicatorUnderline,M?null:ue?{top:E,bottom:E}:{height:C},{width:se??X,transform:[{translateX:ne??K}],backgroundColor:M?w.colors.surface:ue?w.colors["primary-soft"]:w.colors.primary,borderRadius:M?P:ue?q:N,...smoothCorners},f]}),renderTabs=()=>i.map(e=>{const t=e.key===a,i=!0===e.disabled,r=t?w.colors.primary:w.colors["text-subtle"],n=renderSlotIcon(e.icon,{color:r,size:z,focused:t,disabled:i});return _jsxs(Pressable,{onPress:()=>ce(e),onLayout:de(e.key),disabled:i,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:t,disabled:i},"aria-selected":t,"aria-disabled":i,android_ripple:M?void 0:{color:w.colors["surface-pressed"],borderless:!1},style:({pressed:e})=>[j.tab,o?null:j.tabFlex,M?{paddingHorizontal:F["padding-x"],height:F.height-2*H}:{paddingHorizontal:_,paddingVertical:k},{opacity:i?L:e&&M&&!t?.7:1,backgroundColor:e&&!M?w.colors["surface-pressed"]:"transparent"},u],children:[n?_jsx(View,{style:[j.tabIcon,{marginRight:R},p],children:n}):null,_jsx(Text,{variant:"label",weight:t?"semibold":"medium",color:t?"brand":"tertiary",style:[j.tabLabel,{fontSize:M?F.text:I},m],numberOfLines:1,children:e.label}),void 0!==e.badge&&null!==e.badge?_jsx(Badge,{value:String(e.badge),tone:"primary",fill:"soft",accessible:!1,style:{marginLeft:A},badgeStyle:[j.tabBadge,b]}):null]},e.key)}),pe={flexDirection:"row",alignItems:"stretch",justifyContent:o?"flex-start":"center"===d?"center":"flex-start",position:"relative",overflow:"hidden"},be=_jsxs(_Fragment,M?{children:[me,renderTabs()]}:{children:[renderTabs(),me]}),ge=_jsxs(View,{ref:t,style:[j.container,{borderBottomColor:w.colors["border-subtle"],borderBottomWidth:"underline"===n?StyleSheet.hairlineWidth:0},"underline"===n?g:null,M?{padding:H,borderRadius:B,...smoothCorners,backgroundColor:W.active?"transparent":O}:null,c],onLayout:W.onLayout,accessibilityRole:"tablist",accessibilityLabel:v,testID:S,children:[W.active&&W.size?_jsx(SquircleFill,{width:W.size.width,height:W.size.height,radius:B,fill:O}):null,o?_jsx(ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:[pe],keyboardShouldPersistTaps:"handled",children:be}):_jsx(View,{style:pe,children:be})]});return y?_jsxs(View,{style:j.root,children:[ge,_jsx(Animated.ScrollView,{ref:Y,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,scrollEventThrottle:16,onLayout:e=>J(Math.round(e.nativeEvent.layout.width)),onScroll:Animated.event([{nativeEvent:{contentOffset:{x:Q}}}],{useNativeDriver:!1}),onMomentumScrollEnd:e=>{if(0===G)return;const t=Math.round(e.nativeEvent.contentOffset.x/G),n=i[t];n?.disabled?Y.current?.scrollTo({x:te*G,animated:!0}):(Z.current=t,n&&n.key!==a&&r(n.key))},style:j.pager,testID:S?`${S}-pages`:void 0,children:i.map((e,t)=>_jsx(View,{style:{width:G},accessibilityElementsHidden:t!==te,importantForAccessibility:t===te?"auto":"no-hide-descendants",children:y[t]},e.key))})]}):ge});Tabs.displayName="Tabs";const buildStyles=e=>StyleSheet.create({root:{flex:1},pager:{flex:1},container:{width:"100%",position:"relative"},tab:{flexDirection:"row",alignItems:"center",justifyContent:"center"},tabFlex:{flex:1},tabIcon:{},tabLabel:{includeFontPadding:!1,flexShrink:1},tabBadge:{minWidth:18,minHeight:0},indicatorUnderline:{position:"absolute",left:0,bottom:0},indicatorPill:{position:"absolute",left:0,zIndex:-1},indicatorThumb:{position:"absolute",left:0,top:0,bottom:0}});export{Tabs};export default Tabs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{
|
|
1
|
+
"use strict";import{useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{IconBadge}from"../IconBadge/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const DOT=12,HALO=6,RAIL=2,GUTTER=28,DISC=24,STATUS_VALUES=["upcoming","current","done","onHold","rejected","cancelled","skipped"];export const Timeline=({items:e,variant:t="feed",orientation:r="vertical",style:s,testID:o})=>{const n=useTheme(),l=n.space.xs,i=useMemo(()=>buildStyles(n),[n]),a="horizontal"===r,c=n.colors.border;warnInvalidValue("Timeline","variant",t,["feed","progress"]),warnInvalidValue("Timeline","orientation",r,["vertical","horizontal"]);const[d,u]=useState(0),m=useCallback(e=>{const{width:t}=e.nativeEvent.layout;u(e=>e===t?e:t)},[]),h=a&&d>0&&e.length>0?d/e.length:0,renderDisc=(e,t)=>e.icon?_jsx(View,{style:i.disc,children:e.icon}):_jsx(IconBadge,{dimension:24,color:t,fill:"halo",icon:_jsx(View,{style:[i.dot,{backgroundColor:t}]})}),renderText=(e,t)=>_jsxs(_Fragment,{children:[_jsx(Text,{variant:a?"bodySmall":"body",weight:"semibold",style:[{color:"upcoming"===t?n.colors["text-muted"]:n.colors["text-body"]},a?i.centred:null],children:e.title}),e.meta?_jsx(Text,{variant:"caption",style:[{color:n.colors["text-subtle"]},a?i.centred:null],children:e.meta}):null,e.description?_jsx(Text,{variant:"bodySmall",style:[{color:n.colors["text-muted"]},a?i.centred:null],children:e.description}):null,e.children]}),x=e.map((r,s)=>{warnInvalidValue("Timeline","status",r.status,STATUS_VALUES);const o=r.status??("feed"===t?"done":"upcoming"),d=r.color??(e=>{switch(e){case"done":return n.colors.success;case"current":return n.colors.warning;case"onHold":return n.colors.info;case"rejected":return n.colors.danger;case"cancelled":case"skipped":return n.colors["text-subtle"];default:return n.colors["text-disabled"]}})(o),u=0===s,m=s===e.length-1,x=r.key??`${r.title}-${s}`;return _jsxs(View,a?{testID:r.testID,style:[i.hColumn,h>0?{width:h,flex:0}:null],children:[_jsxs(View,{style:i.hDotRow,children:[_jsx(View,{style:[i.hSegment,{marginRight:l,backgroundColor:u?"transparent":c}]}),renderDisc(r,d),_jsx(View,{style:[i.hSegment,{marginLeft:l,backgroundColor:m?"transparent":c}]})]}),_jsx(View,{style:i.hBody,children:renderText(r,o)})]}:{testID:r.testID,style:i.row,children:[_jsxs(View,{style:i.gutter,children:[renderDisc(r,d),m?null:_jsx(View,{style:[i.rail,{backgroundColor:c}]})]}),_jsx(View,{style:[i.body,{paddingBottom:m?0:n.space.lg}],children:renderText(r,o)})]},x)});return _jsx(View,{style:[a?i.hRow:null,s],onLayout:a?m:void 0,testID:o,children:x})};const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row"},gutter:{width:Math.max(28,28),alignItems:"center"},disc:{width:24,height:24,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center"},dot:{width:12,height:12,borderRadius:e.radius.pill,...smoothCorners},rail:{width:2,flex:1,marginTop:e.space.xs,borderRadius:e.radius.pill,...smoothCorners},body:{flex:1,gap:e.space.xxs,paddingLeft:e.space.sm},hRow:{flexDirection:"row",alignItems:"flex-start"},hColumn:{flex:1,minWidth:0,alignItems:"center"},hDotRow:{alignSelf:"stretch",flexDirection:"row",alignItems:"center"},hSegment:{flex:1,height:2,borderRadius:e.radius.pill,...smoothCorners},hBody:{alignSelf:"stretch",alignItems:"center",paddingHorizontal:e.space.xs,marginTop:e.space.sm,gap:e.space.xxs},centred:{textAlign:"center"}});export default Timeline;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{Accordion,AccordionGroup}from"./Accordion/index.js";export{AmountSlider,DEFAULT_AMOUNT_SLIDER_LABELS}from"./AmountSlider/index.js";export{AnimatePresence}from"./AnimatePresence/index.js";export{AppBar,DEFAULT_APP_BAR_LABELS}from"./AppBar/index.js";export{AppLockOverlay,DEFAULT_APP_LOCK_OVERLAY_LABELS}from"./AppLockOverlay/index.js";export{AsyncBlock,DEFAULT_ASYNC_BLOCK_LABELS}from"./AsyncBlock/index.js";export{AuthedImage,authedImageCacheStats,clearAuthedImageCache,getAuthedImageCacheLimit,setAuthedImageCacheLimit}from"./AuthedImage/index.js";export{Autocomplete,DEFAULT_AUTOCOMPLETE_LABELS}from"./Autocomplete/index.js";export{Avatar,AvatarGroup,avatarToneColors,DEFAULT_AVATAR_LABELS}from"./Avatar/index.js";export{Badge,DEFAULT_BADGE_LABELS}from"./Badge/index.js";export{Banner,DEFAULT_BANNER_LABELS}from"./Banner/index.js";export{BarChart}from"./BarChart/index.js";export{BottomNavigation,DEFAULT_BOTTOM_NAVIGATION_LABELS}from"./BottomNavigation/index.js";export{BottomSheet,DEFAULT_BOTTOM_SHEET_LABELS,useBottomSheet}from"./BottomSheet/index.js";export{Box,Row,Spacer,Stack}from"./Box/index.js";export{Button,buttonLabelInk}from"./Button/index.js";export{Calendar,DEFAULT_CALENDAR_LABELS}from"./Calendar/index.js";export{Card,DEFAULT_CARD_LABELS}from"./Card/index.js";export{Carousel,DEFAULT_CAROUSEL_LABELS}from"./Carousel/index.js";export{Checkbox}from"./Checkbox/index.js";export{Chip}from"./Chip/index.js";export{ChoiceGroup}from"./ChoiceGroup/index.js";export{Composer,DEFAULT_COMPOSER_LABELS}from"./Composer/index.js";export{Confetti}from"./Confetti/index.js";export{ConfirmHost,confirm}from"./Confirm/index.js";export{DatePicker,DEFAULT_DATE_PICKER_LABELS}from"./DatePicker/index.js";export{DateRangePicker,DEFAULT_DATE_RANGE_PICKER_LABELS}from"./DateRangePicker/index.js";export{DateSeparator,DEFAULT_DATE_SEPARATOR_LABELS,dayLabel}from"./DateSeparator/index.js";export{cleanDecimalText,DEFAULT_DECIMAL_INPUT_LABELS,DecimalInput,isUnclearDecimalComma,parseDecimalText,pointDecimalText}from"./DecimalInput/index.js";export{Descriptions}from"./Descriptions/index.js";export{Dialog}from"./Dialog/index.js";export{Divider}from"./Divider/index.js";export{DEFAULT_DRAWER_LABELS,Drawer}from"./Drawer/index.js";export{EmptyState}from"./EmptyState/index.js";export{DEFAULT_ERROR_BOUNDARY_LABELS,ErrorBoundary,useErrorHandler,withErrorBoundary}from"./ErrorBoundary/index.js";export{DEFAULT_FILE_PICKER_LABELS,FilePicker,formatFileSize}from"./FilePicker/index.js";export{FileViewer}from"./FileViewer/index.js";export{FilterChipRow}from"./FilterChipRow/index.js";export{DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS,FloatingActionButton,FloatingActionButtonGroup}from"./FloatingActionButton/index.js";export{DEFAULT_FORCE_UPDATE_DIALOG_LABELS,ForceUpdateDialog}from"./ForceUpdateDialog/index.js";export{DEFAULT_FORM_FIELD_LABELS,FormField}from"./FormField/index.js";export{IconBadge}from"./IconBadge/index.js";export{IconButton}from"./IconButton/index.js";export{DEFAULT_IMAGE_GALLERY_LABELS,ImageGallery}from"./ImageGallery/index.js";export{DEFAULT_INLINE_SELECT_LABELS,InlineSelect}from"./InlineSelect/index.js";export{DEFAULT_INPUT_LABELS,Input}from"./Input/index.js";export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView/index.js";export{DEFAULT_KEYBOARD_TOOLBAR_LABELS,KeyboardToolbar}from"./KeyboardToolbar/index.js";export{ListItem}from"./ListItem/index.js";export{DEFAULT_LOADER_OVERLAY_LABELS,LoaderOverlay,loader,useLoader}from"./LoaderOverlay/index.js";export{Markdown}from"./Markdown/index.js";export{DEFAULT_MENU_LABELS,Menu}from"./Menu/index.js";export{DEFAULT_MESSAGE_BUBBLE_LABELS,MessageBubble}from"./MessageBubble/index.js";export{DEFAULT_MESSAGE_LIST_LABELS,MessageList}from"./MessageList/index.js";export{DEFAULT_MODAL_LABELS,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal/index.js";export{Notation,parseNotation,sym}from"./Notation/index.js";export{DEFAULT_NUMBER_INPUT_LABELS,NumberInput}from"./NumberInput/index.js";export{DEFAULT_ONBOARDING_PAGER_LABELS,OnboardingPager}from"./OnboardingPager/index.js";export{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"./OptionSheet/index.js";export{DEFAULT_OTP_INPUT_LABELS,OTPInput}from"./OTPInput/index.js";export{DEFAULT_PAGED_LIST_FOOTER_LABELS,PagedListFooter}from"./PagedListFooter/index.js";export{DEFAULT_PERMISSION_PROMPT_LABELS,PermissionPrompt,usePermissionPrompt}from"./PermissionPrompt/index.js";export{ALL_CALLING_CODES,DEFAULT_CALLING_CODES,DEFAULT_PHONE_NUMBER_INPUT_LABELS,formatE164,PhoneNumberInput,parseE164}from"./PhoneNumberInput/index.js";export{DEFAULT_PICKER_TRIGGER_LABELS,PickerTrigger}from"./PickerTrigger/index.js";export{DEFAULT_PROFILE_COMPLETION_LABELS,ProfileCompletion}from"./ProfileCompletion/index.js";export{DEFAULT_PROFILE_PICKER_LABELS,ProfilePicker}from"./ProfilePicker/index.js";export{DEFAULT_PROGRESS_BAR_LABELS,ProgressBar}from"./ProgressBar/index.js";export{ProgressRing}from"./ProgressRing/index.js";export{Radio,RadioDot,RadioGroup}from"./Radio/index.js";export{DEFAULT_RATING_LABELS,Rating}from"./Rating/index.js";export{DEFAULT_REPEATER_LABELS,Repeater}from"./Repeater/index.js";export{applyMarkdownAction,DEFAULT_RICH_TEXT_EDITOR_LABELS,RichTextEditor}from"./RichTextEditor/index.js";export{DEFAULT_SCANNER_OVERLAY_LABELS,ScannerOverlay}from"./ScannerOverlay/index.js";export{Screen}from"./Screen/index.js";export{DEFAULT_SEARCH_BAR_LABELS,SearchBar,useRecentSearches}from"./SearchBar/index.js";export{DEFAULT_SECTION_HEADER_LABELS,SectionHeader}from"./SectionHeader/index.js";export{SegmentedControl}from"./SegmentedControl/index.js";export{DEFAULT_SELECT_LABELS,Select}from"./Select/index.js";export{DEFAULT_SIGNATURE_PAD_LABELS,SignaturePad}from"./SignaturePad/index.js";export{DEFAULT_SKELETON_LABELS,Skeleton,SkeletonCircle,SkeletonClockProvider,SkeletonContent,SkeletonList,SkeletonProvider,SkeletonSkip,SkeletonText,useSkeletonClock,useSkeletonDefaults}from"./Skeleton/index.js";export{Slider}from"./Slider/index.js";export{DEFAULT_SLIDER_FIELD_LABELS,SliderField}from"./SliderField/index.js";export{DEFAULT_SLIDE_TO_CONFIRM_LABELS,SlideToConfirm}from"./SlideToConfirm/index.js";export{DEFAULT_SORTABLE_LIST_LABELS,SortableList}from"./SortableList/index.js";export{DEFAULT_SPARKLINE_LABELS,Sparkline}from"./Sparkline/index.js";export{DEFAULT_SPINNER_LABELS,Spinner}from"./Spinner/index.js";export{SquircleView}from"./SquircleView/index.js";export{StatTile}from"./StatTile/index.js";export{StatusBadge}from"./StatusBadge/index.js";export{defineStatusMap}from"./StatusBadge/statusMap.js";export{Stepper}from"./Stepper/index.js";export{Swipeable}from"./Swipeable/index.js";export{Switch}from"./Switch/index.js";export{Tabs}from"./Tabs/index.js";export{TagInput}from"./TagInput/index.js";export{Text}from"./Text/index.js";export{Timeline}from"./Timeline/index.js";export{DEFAULT_TIME_PICKER_LABELS,TimePicker}from"./TimePicker/index.js";export{DEFAULT_TOAST_LABELS,Toast,ToastHost,ToastProvider,toast,useToast}from"./Toast/index.js";export{DEFAULT_TOOLTIP_LABELS,Tooltip}from"./Tooltip/index.js";export{DEFAULT_TOUR_LABELS,Tour}from"./Tour/index.js";export{DEFAULT_TYPING_INDICATOR_LABELS,TypingIndicator}from"./TypingIndicator/index.js";export{DEFAULT_WHEEL_PICKER_LABELS,WheelPicker}from"./WheelPicker/index.js";export{ZoomableImage}from"./ZoomableImage/index.js";
|
|
1
|
+
"use strict";export{Accordion,AccordionGroup}from"./Accordion/index.js";export{AmountSlider,DEFAULT_AMOUNT_SLIDER_LABELS}from"./AmountSlider/index.js";export{AnimatePresence}from"./AnimatePresence/index.js";export{AppBar,DEFAULT_APP_BAR_LABELS}from"./AppBar/index.js";export{AppLockOverlay,DEFAULT_APP_LOCK_OVERLAY_LABELS}from"./AppLockOverlay/index.js";export{AsyncBlock,DEFAULT_ASYNC_BLOCK_LABELS}from"./AsyncBlock/index.js";export{AuthedImage,authedImageCacheStats,clearAuthedImageCache,getAuthedImageCacheLimit,setAuthedImageCacheLimit}from"./AuthedImage/index.js";export{Autocomplete,DEFAULT_AUTOCOMPLETE_LABELS}from"./Autocomplete/index.js";export{Avatar,AvatarGroup,avatarToneColors,DEFAULT_AVATAR_LABELS}from"./Avatar/index.js";export{Badge,DEFAULT_BADGE_LABELS}from"./Badge/index.js";export{Banner,DEFAULT_BANNER_LABELS}from"./Banner/index.js";export{BarChart}from"./BarChart/index.js";export{BottomNavigation,DEFAULT_BOTTOM_NAVIGATION_LABELS}from"./BottomNavigation/index.js";export{BottomSheet,DEFAULT_BOTTOM_SHEET_LABELS,useBottomSheet}from"./BottomSheet/index.js";export{Box,Row,Spacer,Stack}from"./Box/index.js";export{Button,buttonLabelInk}from"./Button/index.js";export{Calendar,DEFAULT_CALENDAR_LABELS}from"./Calendar/index.js";export{Card,DEFAULT_CARD_LABELS}from"./Card/index.js";export{Carousel,DEFAULT_CAROUSEL_LABELS}from"./Carousel/index.js";export{Checkbox}from"./Checkbox/index.js";export{Chip}from"./Chip/index.js";export{ChoiceGroup}from"./ChoiceGroup/index.js";export{Composer,DEFAULT_COMPOSER_LABELS}from"./Composer/index.js";export{Confetti}from"./Confetti/index.js";export{ConfirmHost,confirm}from"./Confirm/index.js";export{DatePicker,DEFAULT_DATE_PICKER_LABELS}from"./DatePicker/index.js";export{DateRangePicker,DEFAULT_DATE_RANGE_PICKER_LABELS}from"./DateRangePicker/index.js";export{DateSeparator,DEFAULT_DATE_SEPARATOR_LABELS,dayLabel}from"./DateSeparator/index.js";export{cleanDecimalText,DEFAULT_DECIMAL_INPUT_LABELS,DecimalInput,isUnclearDecimalComma,parseDecimalText,pointDecimalText}from"./DecimalInput/index.js";export{Descriptions}from"./Descriptions/index.js";export{Dialog}from"./Dialog/index.js";export{Divider}from"./Divider/index.js";export{DEFAULT_DRAWER_LABELS,Drawer}from"./Drawer/index.js";export{EmptyState}from"./EmptyState/index.js";export{DEFAULT_ERROR_BOUNDARY_LABELS,ErrorBoundary,useErrorHandler,withErrorBoundary}from"./ErrorBoundary/index.js";export{DEFAULT_FILE_PICKER_LABELS,FilePicker,formatFileSize}from"./FilePicker/index.js";export{FileViewer}from"./FileViewer/index.js";export{FilterChipRow}from"./FilterChipRow/index.js";export{DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS,FloatingActionButton,FloatingActionButtonGroup}from"./FloatingActionButton/index.js";export{DEFAULT_FORCE_UPDATE_DIALOG_LABELS,ForceUpdateDialog}from"./ForceUpdateDialog/index.js";export{DEFAULT_FORM_FIELD_LABELS,FormField}from"./FormField/index.js";export{IconBadge}from"./IconBadge/index.js";export{IconButton}from"./IconButton/index.js";export{DEFAULT_IMAGE_GALLERY_LABELS,ImageGallery}from"./ImageGallery/index.js";export{DEFAULT_INLINE_SELECT_LABELS,InlineSelect}from"./InlineSelect/index.js";export{DEFAULT_INPUT_LABELS,Input}from"./Input/index.js";export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView/index.js";export{DEFAULT_KEYBOARD_TOOLBAR_LABELS,KeyboardToolbar}from"./KeyboardToolbar/index.js";export{ListItem}from"./ListItem/index.js";export{ListSection}from"./ListSection/index.js";export{DEFAULT_LOADER_OVERLAY_LABELS,LoaderOverlay,loader,useLoader}from"./LoaderOverlay/index.js";export{Markdown}from"./Markdown/index.js";export{DEFAULT_MENU_LABELS,Menu}from"./Menu/index.js";export{DEFAULT_MESSAGE_BUBBLE_LABELS,MessageBubble}from"./MessageBubble/index.js";export{DEFAULT_MESSAGE_LIST_LABELS,MessageList}from"./MessageList/index.js";export{DEFAULT_MODAL_LABELS,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal/index.js";export{Notation,parseNotation,sym}from"./Notation/index.js";export{DEFAULT_NUMBER_INPUT_LABELS,NumberInput}from"./NumberInput/index.js";export{DEFAULT_ONBOARDING_PAGER_LABELS,OnboardingPager}from"./OnboardingPager/index.js";export{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"./OptionSheet/index.js";export{DEFAULT_OTP_INPUT_LABELS,OTPInput}from"./OTPInput/index.js";export{DEFAULT_PAGED_LIST_FOOTER_LABELS,PagedListFooter}from"./PagedListFooter/index.js";export{DEFAULT_PERMISSION_PROMPT_LABELS,PermissionPrompt,usePermissionPrompt}from"./PermissionPrompt/index.js";export{ALL_CALLING_CODES,DEFAULT_CALLING_CODES,DEFAULT_PHONE_NUMBER_INPUT_LABELS,formatE164,PhoneNumberInput,parseE164}from"./PhoneNumberInput/index.js";export{DEFAULT_PICKER_TRIGGER_LABELS,PickerTrigger}from"./PickerTrigger/index.js";export{DEFAULT_PROFILE_COMPLETION_LABELS,ProfileCompletion}from"./ProfileCompletion/index.js";export{DEFAULT_PROFILE_PICKER_LABELS,ProfilePicker}from"./ProfilePicker/index.js";export{DEFAULT_PROGRESS_BAR_LABELS,ProgressBar}from"./ProgressBar/index.js";export{ProgressRing}from"./ProgressRing/index.js";export{Radio,RadioDot,RadioGroup}from"./Radio/index.js";export{DEFAULT_RATING_LABELS,Rating}from"./Rating/index.js";export{DEFAULT_REPEATER_LABELS,Repeater}from"./Repeater/index.js";export{applyMarkdownAction,DEFAULT_RICH_TEXT_EDITOR_LABELS,RichTextEditor}from"./RichTextEditor/index.js";export{DEFAULT_SCANNER_OVERLAY_LABELS,ScannerOverlay}from"./ScannerOverlay/index.js";export{Screen}from"./Screen/index.js";export{DEFAULT_SEARCH_BAR_LABELS,SearchBar,useRecentSearches}from"./SearchBar/index.js";export{DEFAULT_SECTION_HEADER_LABELS,SectionHeader}from"./SectionHeader/index.js";export{SegmentedControl}from"./SegmentedControl/index.js";export{DEFAULT_SELECT_LABELS,Select}from"./Select/index.js";export{DEFAULT_SIGNATURE_PAD_LABELS,SignaturePad}from"./SignaturePad/index.js";export{DEFAULT_SKELETON_LABELS,Skeleton,SkeletonCircle,SkeletonClockProvider,SkeletonContent,SkeletonList,SkeletonProvider,SkeletonSkip,SkeletonText,useSkeletonClock,useSkeletonDefaults}from"./Skeleton/index.js";export{Slider}from"./Slider/index.js";export{DEFAULT_SLIDER_FIELD_LABELS,SliderField}from"./SliderField/index.js";export{DEFAULT_SLIDE_TO_CONFIRM_LABELS,SlideToConfirm}from"./SlideToConfirm/index.js";export{DEFAULT_SORTABLE_LIST_LABELS,SortableList}from"./SortableList/index.js";export{DEFAULT_SPARKLINE_LABELS,Sparkline}from"./Sparkline/index.js";export{DEFAULT_SPINNER_LABELS,Spinner}from"./Spinner/index.js";export{SquircleView}from"./SquircleView/index.js";export{StatTile}from"./StatTile/index.js";export{StatusBadge}from"./StatusBadge/index.js";export{defineStatusMap}from"./StatusBadge/statusMap.js";export{Stepper}from"./Stepper/index.js";export{Swipeable}from"./Swipeable/index.js";export{Switch}from"./Switch/index.js";export{Tabs}from"./Tabs/index.js";export{TagInput}from"./TagInput/index.js";export{Text}from"./Text/index.js";export{Timeline}from"./Timeline/index.js";export{DEFAULT_TIME_PICKER_LABELS,TimePicker}from"./TimePicker/index.js";export{DEFAULT_TOAST_LABELS,Toast,ToastHost,ToastProvider,toast,useToast}from"./Toast/index.js";export{DEFAULT_TOOLTIP_LABELS,Tooltip}from"./Tooltip/index.js";export{DEFAULT_TOUR_LABELS,Tour}from"./Tour/index.js";export{DEFAULT_TYPING_INDICATOR_LABELS,TypingIndicator}from"./TypingIndicator/index.js";export{DEFAULT_WHEEL_PICKER_LABELS,WheelPicker}from"./WheelPicker/index.js";export{ZoomableImage}from"./ZoomableImage/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useMemo,useRef}from"react";import{Easing,Animated as RNAnimated}from"react-native";import{useTheme}from"../theme/index.js";import{createAnimatedValue}from"../theme/animatedValue.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const PRESS_ANIMATION_PRESETS=["scale","bounce","fade","sink","pulse"];const FADE_TO=.6,SINK_BY=2,PULSE_TO=1.05,DEFAULT_SCALE_TO={scale:.97,bounce:.92,fade:1,sink:1,pulse:1};export const usePressAnimation=({preset:e="scale",scaleTo:a,pressDuration:s,enabled:t=!0}={})=>{const
|
|
1
|
+
"use strict";import{useCallback,useMemo,useRef}from"react";import{Easing,Animated as RNAnimated}from"react-native";import{setNativeValue,useTheme}from"../theme/index.js";import{createAnimatedValue}from"../theme/animatedValue.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const PRESS_ANIMATION_PRESETS=["scale","bounce","fade","sink","pulse","dim"];const FADE_TO=.6,DIM_TO=.7,SINK_BY=2,PULSE_TO=1.05,DEFAULT_SCALE_TO={scale:.97,bounce:.92,fade:1,sink:1,pulse:1,dim:1};export const usePressAnimation=({preset:e="scale",scaleTo:a,pressDuration:s,enabled:t=!0}={})=>{const i=useTheme(),n=usePresenceMotion(),r=useRef(createAnimatedValue(1)).current,o=useRef(createAnimatedValue(1)).current,u=useRef(createAnimatedValue(0)).current,c=n.reduced?"dim"===e?"dim":"fade":e,m=a??DEFAULT_SCALE_TO[c],l=s??n.duration("fast"),d=useCallback((e,a,s)=>RNAnimated.timing(e,{toValue:a,duration:l,easing:Easing.bezier(...s),useNativeDriver:!0}),[l]),p=useCallback((e,a,s)=>RNAnimated.spring(e,{toValue:a,damping:i.motion.spring[s].damping,stiffness:i.motion.spring[s].stiffness,mass:i.motion.spring[s].mass,useNativeDriver:!0}),[i]),f=useCallback(()=>{if(t)switch(c){case"scale":case"bounce":d(r,m,i.motion.ease["in-out"]).start();break;case"fade":d(o,.6,i.motion.ease["in-out"]).start();break;case"dim":setNativeValue(o,.7);break;case"sink":d(u,2,i.motion.ease["in-out"]).start()}},[t,c,m,r,o,u,i,d]),b=useCallback(()=>{if(t)switch(c){case"scale":p(r,1,"snappy").start();break;case"bounce":p(r,1,"bouncy").start();break;case"fade":d(o,1,i.motion.ease.decelerate).start();break;case"dim":setNativeValue(o,1);break;case"sink":p(u,0,"snappy").start()}},[t,c,r,o,u,i,d,p]),A=useCallback(()=>{t&&"pulse"===c&&RNAnimated.sequence([RNAnimated.timing(r,{toValue:1.05,duration:i.motion.duration.instant,easing:Easing.bezier(...i.motion.ease.accelerate),useNativeDriver:!0}),p(r,1,"snappy")]).start()},[t,c,r,i,p]),k=useMemo(()=>({transform:[{scale:r},{translateY:u}],opacity:o}),[r,u,o]);return{scale:r,opacity:o,translateY:u,style:k,pressIn:f,pressOut:b,press:A}};
|
|
@@ -2,6 +2,7 @@ import type React from "react";
|
|
|
2
2
|
import type { View as RNView, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import { Animated } from "react-native";
|
|
4
4
|
import type { HapticType } from "../../utils/hapticUtils";
|
|
5
|
+
import type { MenuItem } from "../Menu";
|
|
5
6
|
import type { TextVariant } from "../Text/Text";
|
|
6
7
|
export type AppBarVariant = "default" | "large" | "compact";
|
|
7
8
|
export type AppBarTitleAlignment = "left" | "center";
|
|
@@ -9,7 +10,7 @@ export interface AppBarLabels {
|
|
|
9
10
|
back: string;
|
|
10
11
|
}
|
|
11
12
|
export declare const DEFAULT_APP_BAR_LABELS: Readonly<AppBarLabels>;
|
|
12
|
-
export interface
|
|
13
|
+
export interface AppBarPressAction {
|
|
13
14
|
/** The glyph. Give `icon` or `label`; with neither the button draws nothing. */
|
|
14
15
|
icon?: React.ReactNode;
|
|
15
16
|
/**
|
|
@@ -25,12 +26,31 @@ export interface AppBarAction {
|
|
|
25
26
|
accessibilityLabel?: string;
|
|
26
27
|
testID?: string;
|
|
27
28
|
}
|
|
29
|
+
/** A button that opens an overflow menu; it has no `onPress` of its own. */
|
|
30
|
+
export interface AppBarMenuAction {
|
|
31
|
+
/** The glyph of the button; a `label` drawn instead wins, as for `AppBarPressAction`. */
|
|
32
|
+
icon: React.ReactNode;
|
|
33
|
+
/** A text label used instead of the glyph; see `AppBarPressAction`. */
|
|
34
|
+
label?: string;
|
|
35
|
+
/** Draws a small unread dot on the button's corner, with no count. */
|
|
36
|
+
dot?: boolean;
|
|
37
|
+
/** A count or short text drawn on the button's corner; zero draws nothing. */
|
|
38
|
+
badge?: number | string;
|
|
39
|
+
/** The spoken label of the button, required because the button has no text of its own. */
|
|
40
|
+
accessibilityLabel: string;
|
|
41
|
+
testID?: string;
|
|
42
|
+
/** The items of the menu the button opens. */
|
|
43
|
+
menu: MenuItem[];
|
|
44
|
+
/** A heading over the menu's items; also the menu's accessible name. */
|
|
45
|
+
menuTitle?: string;
|
|
46
|
+
}
|
|
47
|
+
export type AppBarAction = AppBarPressAction | AppBarMenuAction;
|
|
28
48
|
export interface AppBarProps {
|
|
29
49
|
title?: string;
|
|
30
50
|
/** One line, two on the large variant; longer text ends in an ellipsis. */
|
|
31
51
|
subtitle?: string;
|
|
32
52
|
titleAlignment?: AppBarTitleAlignment;
|
|
33
|
-
leftAction?:
|
|
53
|
+
leftAction?: AppBarPressAction;
|
|
34
54
|
rightActions?: AppBarAction[];
|
|
35
55
|
/** Any node in the left slot, after `leftAction` (a profile avatar button, say). */
|
|
36
56
|
leading?: React.ReactNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { AppBarAction, AppBarLabels, AppBarProps, AppBarTitleAlignment, AppBarVariant, } from "./AppBar";
|
|
1
|
+
export type { AppBarAction, AppBarLabels, AppBarMenuAction, AppBarPressAction, AppBarProps, AppBarTitleAlignment, AppBarVariant, } from "./AppBar";
|
|
2
2
|
export { AppBar, DEFAULT_APP_BAR_LABELS, default } from "./AppBar";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { GestureResponderEvent, ImageSourcePropType, ImageStyle, PressableProps, View as RNView, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import type { RadiusName } from "../../theme/tokens.generated";
|
|
3
4
|
import type { Theme } from "../../theme/types";
|
|
4
5
|
import type { Size, Tone } from "../../types/vocabulary";
|
|
5
6
|
import type { HapticType } from "../../utils/hapticUtils";
|
|
7
|
+
import { type SlotIcon } from "../AppIcon/slotIcon";
|
|
6
8
|
/**
|
|
7
9
|
* Props passed to a custom {@link AvatarProps.ImageComponent}. The built-in
|
|
8
10
|
* image is expo-image's `Image`, and both it (`contentFit`) and React Native's
|
|
@@ -14,8 +16,8 @@ import type { HapticType } from "../../utils/hapticUtils";
|
|
|
14
16
|
export interface AvatarImageProps {
|
|
15
17
|
source: ImageSourcePropType;
|
|
16
18
|
style: StyleProp<ImageStyle>;
|
|
17
|
-
contentFit:
|
|
18
|
-
resizeMode:
|
|
19
|
+
contentFit: AvatarContentFit;
|
|
20
|
+
resizeMode: AvatarContentFit;
|
|
19
21
|
onError: () => void;
|
|
20
22
|
accessibilityIgnoresInvertColors?: boolean;
|
|
21
23
|
}
|
|
@@ -35,6 +37,8 @@ export type AvatarStatusPosition = "topRight" | "bottomRight";
|
|
|
35
37
|
* primary text.
|
|
36
38
|
*/
|
|
37
39
|
export type AvatarTone = Tone;
|
|
40
|
+
export type AvatarContentFit = "cover" | "contain";
|
|
41
|
+
export type AvatarRadius = Extract<RadiusName, "sm" | "md" | "lg">;
|
|
38
42
|
export declare const AVATAR_COLORS: readonly ["avatar-1", "avatar-2", "avatar-3", "avatar-4", "avatar-5", "avatar-6", "avatar-7", "avatar-8"];
|
|
39
43
|
/** The fill and the ink (the tone as text, the `<tone>-text` colour names) of an initials disc in a tone. Shared with ProfilePicker's placeholder. */
|
|
40
44
|
export declare const avatarToneColors: (theme: Theme, tone: AvatarTone) => {
|
|
@@ -64,6 +68,20 @@ export interface AvatarProps {
|
|
|
64
68
|
name?: string;
|
|
65
69
|
size?: AvatarSize;
|
|
66
70
|
shape?: AvatarShape;
|
|
71
|
+
/** Width and height in points, for a host that sizes the picture itself. Wins over `size`. */
|
|
72
|
+
dimension?: number;
|
|
73
|
+
/** Corner of a `rounded` avatar from the radius tokens. Unset keeps 22 percent of the side. */
|
|
74
|
+
radius?: AvatarRadius;
|
|
75
|
+
/** Draws a 1 pt border in the border colour inside the frame; the picture fills what is left. Default false. */
|
|
76
|
+
border?: boolean;
|
|
77
|
+
/** How a picture fills the frame. `contain` shows all of it, with no fill behind it. Default `'cover'`. */
|
|
78
|
+
contentFit?: AvatarContentFit;
|
|
79
|
+
/**
|
|
80
|
+
* Drawn when there is no picture and no name, at 45 percent of the side, on
|
|
81
|
+
* the neutral grey (`bg-muted`) in `text-subtle`, unless `tone`,
|
|
82
|
+
* `backgroundColor` or `color` say otherwise.
|
|
83
|
+
*/
|
|
84
|
+
placeholderIcon?: SlotIcon;
|
|
67
85
|
status?: AvatarStatus;
|
|
68
86
|
statusPosition?: AvatarStatusPosition;
|
|
69
87
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { AvatarGroupOverflowVariant, AvatarGroupProps, AvatarGroupSpacing, AvatarImageProps, AvatarLabels, AvatarProps, AvatarShape, AvatarSize, AvatarStatus, AvatarStatusPosition, AvatarTone, } from "./Avatar";
|
|
1
|
+
export type { AvatarContentFit, AvatarGroupOverflowVariant, AvatarGroupProps, AvatarGroupSpacing, AvatarImageProps, AvatarLabels, AvatarProps, AvatarRadius, AvatarShape, AvatarSize, AvatarStatus, AvatarStatusPosition, AvatarTone, } from "./Avatar";
|
|
2
2
|
export { Avatar, AvatarGroup, avatarToneColors, DEFAULT_AVATAR_LABELS, default } from "./Avatar";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,6 +5,8 @@ export type BadgeVariant = "standard" | "dot";
|
|
|
5
5
|
export type BadgeTone = Tone;
|
|
6
6
|
export type BadgeSize = Extract<Size, "sm" | "md">;
|
|
7
7
|
export type BadgeAnchor = "topRight" | "topLeft" | "bottomRight" | "bottomLeft";
|
|
8
|
+
/** `solid` fills the pill with the tone. `soft` draws the tone's soft colour behind a semibold count in the tone. */
|
|
9
|
+
export type BadgeFill = "solid" | "soft";
|
|
8
10
|
export interface BadgeLabels {
|
|
9
11
|
indicator: string;
|
|
10
12
|
unread: (count: string) => string;
|
|
@@ -16,7 +18,10 @@ export interface BadgeProps {
|
|
|
16
18
|
variant?: BadgeVariant;
|
|
17
19
|
tone?: BadgeTone;
|
|
18
20
|
size?: BadgeSize;
|
|
21
|
+
fill?: BadgeFill;
|
|
19
22
|
invisible?: boolean;
|
|
23
|
+
/** False hides the badge from screen readers, for a host that already announces the count. */
|
|
24
|
+
accessible?: boolean;
|
|
20
25
|
/**
|
|
21
26
|
* When true, renders the component as its authored skeleton placeholder shape.
|
|
22
27
|
* The placeholder mirrors the real layout's footprint so the UI doesn't reflow
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { BadgeAnchor, BadgeLabels, BadgeProps, BadgeSize, BadgeTone, BadgeVariant } from "./Badge";
|
|
1
|
+
export type { BadgeAnchor, BadgeFill, BadgeLabels, BadgeProps, BadgeSize, BadgeTone, BadgeVariant } from "./Badge";
|
|
2
2
|
export { Badge, DEFAULT_BADGE_LABELS, default } from "./Badge";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -14,8 +14,10 @@ export type BannerRole = "alert" | "summary" | "none";
|
|
|
14
14
|
* How the banner is drawn. `'bar'` is the neutral surface with the tone's icon.
|
|
15
15
|
* `'wash'` fills the banner with the tone's soft colour, a small corner radius, no
|
|
16
16
|
* leading bar, and a title in the tone's ink.
|
|
17
|
+
* `'tint'` is the bar layout (medium corner, title in the body colour) on
|
|
18
|
+
* the tone's soft colour.
|
|
17
19
|
*/
|
|
18
|
-
export type BannerVariant = "bar" | "wash";
|
|
20
|
+
export type BannerVariant = "bar" | "wash" | "tint";
|
|
19
21
|
export type BannerActionVariant = Extract<FillVariant, "solid" | "outline" | "ghost">;
|
|
20
22
|
export type BannerActionSize = Extract<Size, "sm" | "md">;
|
|
21
23
|
export type BannerActionTone = Tone;
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
import type React from "react";
|
|
15
15
|
import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent, StyleProp, ViewStyle } from "react-native";
|
|
16
16
|
import { ScrollView } from "react-native";
|
|
17
|
+
import type { DialogAction } from "../Dialog/Dialog";
|
|
18
|
+
import { type ActionsLayout } from "../Dialog/OverlayActions";
|
|
17
19
|
/**
|
|
18
20
|
* A snap point: a height in dp, a percentage of the host height, or
|
|
19
21
|
* `'content'`, the measured height of the sheet's own content (handle,
|
|
@@ -144,6 +146,10 @@ export interface BottomSheetProps {
|
|
|
144
146
|
* state.
|
|
145
147
|
*/
|
|
146
148
|
header?: React.ReactNode;
|
|
149
|
+
/** Action buttons drawn in the footer, above `footer`. Laid out by `actionsLayout`. */
|
|
150
|
+
actions?: DialogAction[];
|
|
151
|
+
/** How `actions` are laid out: `'auto'` (default) stacks them when a label wraps, `'row'` never stacks, `'stacked'` is a column of full-width buttons in the order given. */
|
|
152
|
+
actionsLayout?: ActionsLayout;
|
|
147
153
|
/**
|
|
148
154
|
* Sticky region pinned to the bottom of the sheet, above the safe-area
|
|
149
155
|
* inset. Does not scroll with `children`, and rides up with the keyboard
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { GestureResponderEvent, ImageSourcePropType, PressableProps, View as RNView, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import type { PressAnimationPreset } from "../../hooks/usePressAnimation";
|
|
3
4
|
import type { GradientDefinition, ShadowName } from "../../theme/types";
|
|
4
5
|
import type { HapticType } from "../../utils/hapticUtils";
|
|
5
6
|
import type { ContextMenuConfig } from "../Menu/useContextMenu";
|
|
@@ -31,6 +32,8 @@ export interface CardProps extends Omit<PressableProps, "style" | "children"> {
|
|
|
31
32
|
radius?: CardRadius;
|
|
32
33
|
padding?: CardPadding;
|
|
33
34
|
interactive?: boolean;
|
|
35
|
+
/** Press feedback of a card with `onPress`. `false` draws none. Default `'scale'`. */
|
|
36
|
+
pressAnimation?: PressAnimationPreset | false;
|
|
34
37
|
/**
|
|
35
38
|
* Background colour: a background colour name (`bg`, `bg-subtle`, `bg-muted`, `surface`, `scrim`, `surface-inverse`) or any raw colour string. Applies on every variant and replaces the variant's default
|
|
36
39
|
* surface colour; `style` / `containerStyle` still win over it.
|
|
@@ -2,11 +2,15 @@ import type React from "react";
|
|
|
2
2
|
import type { ImageSourcePropType, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
import type { Tone } from "../../types/vocabulary";
|
|
4
4
|
import type { HapticType } from "../../utils/hapticUtils";
|
|
5
|
+
import type { SlotIcon } from "../AppIcon/slotIcon";
|
|
6
|
+
import { type ActionsLayout } from "./OverlayActions";
|
|
5
7
|
export type DialogActionTone = Tone;
|
|
6
8
|
export interface DialogAction {
|
|
7
9
|
label: string;
|
|
8
10
|
onPress: () => void;
|
|
9
11
|
tone?: DialogActionTone;
|
|
12
|
+
/** Icon before the label, drawn in the label's colour; the same icon contract as Button `leftIcon`. */
|
|
13
|
+
icon?: SlotIcon;
|
|
10
14
|
loading?: boolean;
|
|
11
15
|
/** Dims the action and blocks its press (a confirm waiting on a typed phrase, say). */
|
|
12
16
|
disabled?: boolean;
|
|
@@ -24,6 +28,11 @@ export interface DialogProps {
|
|
|
24
28
|
/** Tints the disc and draws its status mark (check, alert or info) unless `icon` or `illustration` is set. */
|
|
25
29
|
tone?: Tone;
|
|
26
30
|
actions?: DialogAction[];
|
|
31
|
+
/**
|
|
32
|
+
* How the action buttons are laid out. `'auto'` (default) stacks them into a column when a
|
|
33
|
+
* label wraps; `'row'` never stacks; `'stacked'` is always a column of full-width buttons, in the order given.
|
|
34
|
+
*/
|
|
35
|
+
actionsLayout?: ActionsLayout;
|
|
27
36
|
dismissOnAction?: boolean;
|
|
28
37
|
accessibilityLabel?: string;
|
|
29
38
|
/** Style applied to the underlying Modal sheet (consumer may override radius, padding, etc.). */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import type { DialogAction } from "./Dialog";
|
|
4
|
+
export declare const OVERLAY_TONES: readonly ["primary", "success", "warning", "danger", "info", "neutral"];
|
|
5
|
+
export declare const ACTIONS_LAYOUTS: readonly ["auto", "row", "stacked"];
|
|
6
|
+
export type ActionsLayout = (typeof ACTIONS_LAYOUTS)[number];
|
|
7
|
+
interface OverlayActionsProps {
|
|
8
|
+
actions: DialogAction[];
|
|
9
|
+
layout: ActionsLayout;
|
|
10
|
+
testID?: string;
|
|
11
|
+
/** The measured-stacked state, owned by a parent that outlives this row's unmount. */
|
|
12
|
+
stackedLabels?: [string | null, (key: string | null) => void];
|
|
13
|
+
rowStyle?: StyleProp<ViewStyle>;
|
|
14
|
+
buttonStyle?: StyleProp<ViewStyle>;
|
|
15
|
+
textStyle?: StyleProp<TextStyle>;
|
|
16
|
+
}
|
|
17
|
+
declare const OverlayActions: React.FC<OverlayActionsProps>;
|
|
18
|
+
export { OverlayActions };
|
|
19
|
+
//# sourceMappingURL=OverlayActions.d.ts.map
|
|
@@ -2,6 +2,8 @@ import type React from "react";
|
|
|
2
2
|
import type { ImageSourcePropType, View as RNView, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { Size } from "../../types/vocabulary";
|
|
4
4
|
export type EmptyStateSize = Extract<Size, "sm" | "md" | "lg">;
|
|
5
|
+
/** `block` is the centred block with room around it. `inline` is one quiet caption line, centred, with no padding; it draws the title only. */
|
|
6
|
+
export type EmptyStateVariant = "block" | "inline";
|
|
5
7
|
export interface EmptyStateAction {
|
|
6
8
|
label: string;
|
|
7
9
|
onPress: () => void;
|
|
@@ -20,6 +22,8 @@ export interface EmptyStateProps {
|
|
|
20
22
|
action?: EmptyStateAction;
|
|
21
23
|
secondaryAction?: EmptyStateAction;
|
|
22
24
|
size?: EmptyStateSize;
|
|
25
|
+
/** Default `'block'`. See {@link EmptyStateVariant}. */
|
|
26
|
+
variant?: EmptyStateVariant;
|
|
23
27
|
/**
|
|
24
28
|
* Grows to fill the space it is given and centres its content, so it sits in
|
|
25
29
|
* the middle of an empty list: pass it as `ListEmptyComponent` and give the
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { EmptyStateAction, EmptyStateProps, EmptyStateSize } from "./EmptyState";
|
|
1
|
+
export type { EmptyStateAction, EmptyStateProps, EmptyStateSize, EmptyStateVariant } from "./EmptyState";
|
|
2
2
|
export { default, EmptyState } from "./EmptyState";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import type { View as RNView, StyleProp, ViewStyle } from "react-native";
|
|
1
|
+
import type { View as RNView, StyleProp, ViewProps, ViewStyle } from "react-native";
|
|
2
2
|
import type { Size, Tone } from "../../types/vocabulary";
|
|
3
3
|
import type { IconVariant } from "../AppIcon/AppIcon";
|
|
4
4
|
import type { SlotIcon } from "../AppIcon/slotIcon";
|
|
5
5
|
export type IconBadgeSize = Extract<Size, "sm" | "md" | "lg">;
|
|
6
6
|
export type IconBadgeTone = Tone;
|
|
7
|
+
/**
|
|
8
|
+
* How the circle is filled. `tint`: the colour at a low tint (14 percent).
|
|
9
|
+
* `halo`: a slightly stronger tint (16 percent), the status halo round a
|
|
10
|
+
* timeline dot. `surface`: the surface colour, a seal cut out of whatever it
|
|
11
|
+
* overlaps.
|
|
12
|
+
*/
|
|
13
|
+
export type IconBadgeFill = "tint" | "halo" | "surface";
|
|
7
14
|
export interface IconBadgeProps {
|
|
8
15
|
/**
|
|
9
16
|
* The icon: an AppIcon name (`icon="shield-tick"`), `{ name, variant }`, a
|
|
@@ -17,11 +24,23 @@ export interface IconBadgeProps {
|
|
|
17
24
|
size?: IconBadgeSize;
|
|
18
25
|
/** Colour of the tinted fill and the icon. Default `'primary'`. */
|
|
19
26
|
tone?: IconBadgeTone;
|
|
27
|
+
/**
|
|
28
|
+
* A colour of the host's own for the fill tint and a named icon. Wins over
|
|
29
|
+
* `tone`. A value that is not `#RRGGBB` still colours the icon, and the
|
|
30
|
+
* fill falls back to the neutral grey (`bg-muted`), as `tintOf` does.
|
|
31
|
+
*/
|
|
32
|
+
color?: string;
|
|
33
|
+
/** Default `'tint'`. See {@link IconBadgeFill}. */
|
|
34
|
+
fill?: IconBadgeFill;
|
|
35
|
+
/** Width and height in points, for a host that sizes the circle itself. Wins over `size`; a named icon takes half of it, rounded. */
|
|
36
|
+
dimension?: number;
|
|
20
37
|
/**
|
|
21
38
|
* Announces the badge as an image with this name. Without it the badge is
|
|
22
39
|
* decorative: hidden from screen readers.
|
|
23
40
|
*/
|
|
24
41
|
accessibilityLabel?: string;
|
|
42
|
+
/** Passed to the root view; "none" lets touches reach what sits under the badge. */
|
|
43
|
+
pointerEvents?: ViewProps["pointerEvents"];
|
|
25
44
|
style?: StyleProp<ViewStyle>;
|
|
26
45
|
testID?: string;
|
|
27
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { GestureResponderEvent, View as RNView, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import type { GestureResponderEvent, PressableProps, View as RNView, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
import type { Size, Tone } from "../../types/vocabulary";
|
|
4
4
|
import type { HapticType } from "../../utils/hapticUtils";
|
|
5
5
|
import type { SlotIcon } from "../AppIcon/slotIcon";
|
|
@@ -7,6 +7,8 @@ import type { ButtonProps } from "../Button";
|
|
|
7
7
|
import type { ContextMenuConfig } from "../Menu/useContextMenu";
|
|
8
8
|
import type { SwipeableAction } from "../Swipeable";
|
|
9
9
|
export type ListItemSize = Extract<Size, "sm" | "md" | "lg">;
|
|
10
|
+
/** `menu` is a popup menu row: 48 pt high, no press scale, announced as a menu item. */
|
|
11
|
+
export type ListItemVariant = "list" | "menu";
|
|
10
12
|
/**
|
|
11
13
|
* Where the `right` slot sits. `side` is beside the text, `below` is under the
|
|
12
14
|
* subtitle and description, and `auto` is `side` until the user's text size is
|
|
@@ -45,7 +47,7 @@ export interface ListItemProps {
|
|
|
45
47
|
* slot placed below. Inside the row's press target.
|
|
46
48
|
*/
|
|
47
49
|
children?: React.ReactNode;
|
|
48
|
-
/** Lines a text title may take before it is truncated. Default 1; 0 for no limit. */
|
|
50
|
+
/** Lines a text title may take before it is truncated. Default 1, or 2 in a menu row; 0 for no limit. */
|
|
49
51
|
titleLines?: number;
|
|
50
52
|
/** Lines a text subtitle may take before it is truncated. Default 1; 0 for no limit. */
|
|
51
53
|
subtitleLines?: number;
|
|
@@ -72,7 +74,7 @@ export interface ListItemProps {
|
|
|
72
74
|
* nests inside the row's press target.
|
|
73
75
|
*/
|
|
74
76
|
selectable?: boolean;
|
|
75
|
-
/** Whether the row is checked. Controlled: update it from `onCheckedChange`. Used
|
|
77
|
+
/** Whether the row is checked. Controlled: update it from `onCheckedChange`. Used with `selectable`, and with `variant="menu"`, where it is announced. */
|
|
76
78
|
checked?: boolean;
|
|
77
79
|
/** Called with the next value when a `selectable` row is pressed. */
|
|
78
80
|
onCheckedChange?: (checked: boolean) => void;
|
|
@@ -94,6 +96,10 @@ export interface ListItemProps {
|
|
|
94
96
|
expanded?: boolean;
|
|
95
97
|
disabled?: boolean;
|
|
96
98
|
size?: ListItemSize;
|
|
99
|
+
/** Default `'list'`. See {@link ListItemVariant}. */
|
|
100
|
+
variant?: ListItemVariant;
|
|
101
|
+
/** Called when the row takes keyboard or screen reader focus. */
|
|
102
|
+
onFocus?: PressableProps["onFocus"];
|
|
97
103
|
divider?: boolean;
|
|
98
104
|
chevron?: boolean;
|
|
99
105
|
/** Optional swipe-from-left actions. Wraps the row in a Swipeable when provided. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { SwipeableAction } from "../Swipeable";
|
|
2
|
-
export type { ListItemAction, ListItemProps, ListItemRightPlacement, ListItemSize, } from "./ListItem";
|
|
2
|
+
export type { ListItemAction, ListItemProps, ListItemRightPlacement, ListItemSize, ListItemVariant, } from "./ListItem";
|
|
3
3
|
export { default, ListItem } from "./ListItem";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { CardVariant } from "../Card";
|
|
3
|
+
import type { SectionHeaderAction } from "../SectionHeader";
|
|
4
|
+
export interface ListSectionProps {
|
|
5
|
+
/** The heading above the card, drawn through SectionHeader. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** A link on the heading row, such as See all. It shows only with a title. */
|
|
8
|
+
action?: SectionHeaderAction;
|
|
9
|
+
/** A caption below the card. */
|
|
10
|
+
footer?: string;
|
|
11
|
+
/** The card's surface. Default 'outline'. */
|
|
12
|
+
variant?: CardVariant;
|
|
13
|
+
testID?: string;
|
|
14
|
+
/** The rows, each a ListItem. A divider is drawn between consecutive rows. */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/** A titled group of list rows in one card, with a divider between the rows. */
|
|
18
|
+
export declare const ListSection: React.FC<ListSectionProps>;
|
|
19
|
+
export default ListSection;
|
|
20
|
+
//# sourceMappingURL=ListSection.d.ts.map
|
|
@@ -19,6 +19,8 @@ export interface ProgressBarProps {
|
|
|
19
19
|
label?: ReactNode;
|
|
20
20
|
/** Shows the percent (`Math.round(progress * 100)%`) at the right of the label row. Determinate only. */
|
|
21
21
|
showPercent?: boolean;
|
|
22
|
+
/** Text or node at the right of the label row, in place of the percent. A string is drawn like the percent. */
|
|
23
|
+
valueLabel?: ReactNode;
|
|
22
24
|
indeterminate?: boolean;
|
|
23
25
|
height?: number;
|
|
24
26
|
radius?: number;
|