@webority/mobile-ui 0.89.0 → 0.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
  2. package/lib/commonjs/components/Button/Button.js +1 -1
  3. package/lib/commonjs/components/Card/Card.js +1 -1
  4. package/lib/commonjs/components/Composer/Composer.js +1 -1
  5. package/lib/commonjs/components/Dialog/Dialog.js +1 -1
  6. package/lib/commonjs/components/EmptyState/EmptyState.js +1 -1
  7. package/lib/commonjs/components/IconButton/IconButton.js +1 -1
  8. package/lib/commonjs/components/Input/Input.js +1 -1
  9. package/lib/commonjs/components/ProfileCompletion/ProfileCompletion.js +1 -1
  10. package/lib/commonjs/components/RichTextEditor/RichTextEditor.js +1 -1
  11. package/lib/commonjs/components/Text/Text.js +1 -1
  12. package/lib/commonjs/theme/tokens.generated.js +1 -1
  13. package/lib/commonjs/utils/hitSlop.js +1 -0
  14. package/lib/commonjs/utils/warnInvalidValue.js +1 -0
  15. package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
  16. package/lib/module/components/Button/Button.js +1 -1
  17. package/lib/module/components/Card/Card.js +1 -1
  18. package/lib/module/components/Composer/Composer.js +1 -1
  19. package/lib/module/components/Dialog/Dialog.js +1 -1
  20. package/lib/module/components/EmptyState/EmptyState.js +1 -1
  21. package/lib/module/components/IconButton/IconButton.js +1 -1
  22. package/lib/module/components/Input/Input.js +1 -1
  23. package/lib/module/components/ProfileCompletion/ProfileCompletion.js +1 -1
  24. package/lib/module/components/RichTextEditor/RichTextEditor.js +1 -1
  25. package/lib/module/components/Text/Text.js +1 -1
  26. package/lib/module/theme/tokens.generated.js +1 -1
  27. package/lib/module/utils/hitSlop.js +1 -0
  28. package/lib/module/utils/warnInvalidValue.js +1 -0
  29. package/lib/typescript/commonjs/components/Card/Card.d.ts +3 -0
  30. package/lib/typescript/commonjs/components/Text/Text.d.ts +1 -1
  31. package/lib/typescript/commonjs/theme/tokens.generated.d.ts +1 -2
  32. package/lib/typescript/commonjs/theme/types.d.ts +1 -1
  33. package/lib/typescript/commonjs/utils/hitSlop.d.ts +14 -0
  34. package/lib/typescript/commonjs/utils/warnInvalidValue.d.ts +10 -0
  35. package/lib/typescript/module/components/Card/Card.d.ts +3 -0
  36. package/lib/typescript/module/components/Text/Text.d.ts +1 -1
  37. package/lib/typescript/module/theme/tokens.generated.d.ts +1 -2
  38. package/lib/typescript/module/theme/types.d.ts +1 -1
  39. package/lib/typescript/module/utils/hitSlop.d.ts +14 -0
  40. package/lib/typescript/module/utils/warnInvalidValue.d.ts +10 -0
  41. package/package.json +6 -6
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.BottomNavigation=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_useReducedMotion=require("../../hooks/useReducedMotion.js"),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_corners=require("../../utils/corners.js"),_shadows=require("../../utils/shadows.js"),_index3=require("../AppIcon/index.js"),_useScreenReaderEnabled=require("./useScreenReaderEnabled.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var i,a,n=Object.defineProperty,r={__proto__:null,default:e};if(Object(e)!==e)return r;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,r)}for(a in e)"default"!==a&&{}.hasOwnProperty.call(e,a)&&((i=n&&Object.getOwnPropertyDescriptor(e,a))&&(i.get||i.set)?n(r,a,i):r[a]=e[a]);return r}const DEFAULT_ICON_SIZE=18,DEFAULT_LABEL_MAX_FONT_SCALE=1.2,ICON_WRAP_AIR=4,PILL_AIR=8,DEFAULT_PILL_MAX_WIDTH=64,TILE_MAX_WIDTH=96,DEFAULT_UNDERLINE_HEIGHT=3,DEFAULT_BUBBLE_SIZE=48,DEFAULT_BUBBLE_LIFT=14,DEFAULT_CENTER_SIZE=48,DEFAULT_CENTER_ICON_SIZE=24,CENTER_KEY="__webority_center_action__",EXPANDED_FLEX=1.5,SOLID_INACTIVE_OPACITY=.7,TILE_INSET=2,formatBadge=e=>null==e||!1===e?null:!0===e||"·"===e?{text:"",isDot:!0}:"number"==typeof e?e<=0?null:{text:e>99?"99+":String(e),isDot:!1}:"string"==typeof e?0===e.length?null:{text:e,isDot:!1}:null,badgeAccessibilitySuffix=e=>null==e||!1===e?"":"number"==typeof e?e>0?`, ${e} unread`:"":!0===e||"·"===e?", new updates":"string"==typeof e&&e.length>0?`, ${e}`:"",BottomNavigation=exports.BottomNavigation=(0,_react.forwardRef)((e,t)=>{const{tabs:i,centerAction:a,activeTab:n,onChange:r,haptic:o="selection",showLabels:s=!0,variant:l="pill",indicatorPosition:c="bottom",radius:d,indicatorRadius:u="auto",elevation:p,iconSize:h,marginHorizontal:m,marginVertical:_,paddingHorizontal:g,paddingVertical:x,border:b,minimizeOnScroll:f=!1,scrollDirection:y="idle",accessory:v,style:R,indicatorStyle:j,labelStyle:N,labelMaxFontScale:w,testID:S}=e,E=(0,_index.useTheme)(),I=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),A=(0,_react.useMemo)(()=>buildStyles(E),[E]),C=h??18,L=C+4+8,T=E.space.lg,D=E.space.lg,M=E.radius.xl,V=(0,_useReducedMotion.useReducedMotion)(),k=(0,_useScreenReaderEnabled.useScreenReaderEnabled)(f),[B,z]=_react.default.useState(null);(0,_react.useEffect)(()=>{null!==B&&B!==y&&z(null)},[B,y]);const P=f&&!k&&"down"===y&&null===B,[H,W]=_react.default.useState(P);(0,_react.useEffect)(()=>{H!==P&&(V||"web"===_reactNative.Platform.OS||_reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut),W(P))},[H,P,V]);const F="function"==typeof v?v({minimized:H}):v,O=null!=F&&!1!==F,q=H&&O,[U,$]=_react.default.useState(0),X=O&&!q?U+E.space.xs:0,Z="tile"===l,Y="floating"===l||Z,K="bubble"===l,G="expand"===l,J="solid"===l,Q="pill"===l||Y||J,ee=Math.max(0,i.findIndex(e=>e.key===n)),[te,ie]=_react.default.useState(0),[ae,ne]=_react.default.useState(0),re=a?Math.ceil(i.length/2):i.length,oe=i.length+(a?1:0),[se,le]=_react.default.useState({width:0,height:0}),ce=a?.size??48,de=void 0!==a?.gap,ue=Math.max(0,a?.gap??0),pe=de?(se.width||ce)+2*ue:0,he=de?i.length>0?Math.max(0,te-pe)/i.length:0:oe>0?te/oe:0,me=de?pe:he,ge=(0,_react.useRef)((0,_index.createAnimatedValue)(ee)).current,xe=(0,_react.useRef)({}),be=(0,_react.useRef)({});i.forEach(e=>{xe.current[e.key]||(xe.current[e.key]=new _reactNative.Animated.Value(1)),be.current[e.key]||(be.current[e.key]=(0,_index.createAnimatedValue)(e.key===n?1:0))});const fe=he>0?Z?Math.min(he-4,96):Math.min(he-T,64):0,ye=he>0?(he-fe)/2:0,ve=he>0?(he-48)/2:0,hasLabel=e=>s&&!H&&!1!==e.showLabel&&e.label.trim().length>0,Re=i[ee],je=Re&&!hasLabel(Re)&&ae>0?ae/2:E.space.xs+(C+4)/2,Ne=je-14-24,we=Math.max(0,ae-4),Se=Z?2:je-L/2,Ee=(0,_react.useRef)(ee);(0,_react.useEffect)(()=>{if(Ee.current===ee)return;Ee.current=ee;const e=_reactNative.Animated.spring(ge,{toValue:ee,tension:120,friction:14,useNativeDriver:!0});return e.start(),()=>e.stop()},[ee,ge]);const Ie=Math.max(1,i.length-1),Ae=(0,_react.useMemo)(()=>{const e=[],t=[];for(let i=0;i<=Ie;i++)e.push(i),t.push(i<re?i*he:i*he+me);return ge.interpolate({inputRange:e,outputRange:t})},[ge,Ie,re,he,me]),Ce=i.map(e=>e.key).join(" "),Le=K||G;(0,_react.useEffect)(()=>{const e=Ce.split(" ").flatMap(e=>{const t=e===n?1:0,i=be.current[e];return i?Le?[_reactNative.Animated.spring(i,{toValue:t,tension:140,friction:13,useNativeDriver:!1})]:(i.setValue(t),[]):[]});if(0===e.length)return;const t=_reactNative.Animated.parallel(e);return t.start(),()=>t.stop()},[n,Ce,Le]);const popIcon=e=>{_reactNative.Animated.sequence([_reactNative.Animated.timing(e,{toValue:1.15,duration:120,useNativeDriver:!0}),_reactNative.Animated.spring(e,{toValue:1,tension:200,friction:8,useNativeDriver:!0})]).start()},Te=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current,{colors:De}=E,Me=J?De.primary:De.surface,Ve=J?De["on-primary"]:De.primary,ke=J?De["on-primary"]:Z?De["text-body"]:De["text-subtle"],Be=J?De["on-primary"]:De["primary-soft"],ze=J?De.primary:K?De["on-primary"]:Ve,Pe=m??D,He=_??(Y?D:0),We=He>0,Fe=x??E.space.sm,Oe=g??(Y?E.space.sm:E.space.xs),qe=We?Fe:Math.max(Fe,I.bottom),Ue=We?Math.max(He,I.bottom>0?I.bottom+E.space.sm:0):0,$e="pill"===d,Xe=Y?ae+X+2*Fe+2*_reactNative.StyleSheet.hairlineWidth:ae+X+Fe+qe,Ze=$e?ae>0?Xe/2:E.radius.pill:d??(Z?E.radius.pill:Y?M:E.radius.none),Ye=void 0!==d,activeBgRadius=(e,t)=>"number"==typeof u?Math.max(0,Math.min(u,e/2)):"auto"===u&&Ye?Math.min(Ze,e/2):t,Ke="underline"===l?Math.max(Oe,$e&&0===ae?0:Ze):Oe,Ge=p??"none",Je="none"===Ge?void 0:E.shadow[Ge],Qe=void 0===Je?null:(0,_shadows.supportsBoxShadow)()?{boxShadow:(0,_shadows.toBoxShadow)(Je)}:Je,et=b?_reactNative.StyleSheet.hairlineWidth:0,tt=J?De.primary:De.border,it=a?.lift??0,at=Fe+et+X,nt=a&&ae>0?Math.max(0,(se.height||ce)/2+it-ae/2-at):0,rt=a?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[A.centerCell,de?{flex:0,marginHorizontal:ue}:null],pointerEvents:"box-none",children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>{if(!a)return;const e=a.haptic??o;!1!==e&&(0,_index2.triggerHaptic)(e),popIcon(Te),a.onPress()},onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;le(e=>e.width===t&&e.height===i?e:{width:t,height:i})},accessibilityRole:"button",accessibilityLabel:a.label,hitSlop:{top:6,bottom:6,left:6,right:6},style:({pressed:e})=>[{top:-it},e?{opacity:.85}:null],testID:a.testID??(S?`${S}-center`:void 0),children:a.content?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{transform:[{scale:Te}]},children:a.content}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[A.centerCircle,{width:ce,height:ce,borderRadius:E.radius.pill,..._corners.smoothCorners,backgroundColor:a.color??De.primary}],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{transform:[{scale:Te}]},children:(0,_index3.renderSlotIcon)(a.icon??"add",{color:a.iconColor??De["on-primary"],size:a.iconSize??24,disabled:!1})})})})},CENTER_KEY):null,ot=O?(0,_jsxRuntime.jsx)(_reactNative.View,{style:q?A.accessoryInline:A.accessoryStacked,onLayout:e=>$(e.nativeEvent.layout.height),testID:S?`${S}-accessory`:void 0,children:F}):null,st=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:q?[A.tabRow,A.tabRowInline]:A.tabRow,onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;ie(t),ne(i)},children:[Q&&fe>0&&(!Z||we>0)?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[A.pill,{width:fe,height:Z?we:L,left:ye,top:Se,backgroundColor:Be,borderRadius:Z?activeBgRadius(we,we/2):activeBgRadius(L,E.radius.pill),..._corners.smoothCorners,transform:[{translateX:Ae}]},j]}):null,K&&he>0?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[A.bubble,E.shadow.elevated,{width:48,height:48,borderRadius:E.radius.pill,..._corners.smoothCorners,left:ve,top:Ne,backgroundColor:De.primary,borderColor:De.surface,transform:[{translateX:Ae}]},j]}):null,(lt=i.map(e=>{const t=e.key===n,i=t?Ve:ke,a=t?ze:ke,s="string"==typeof e.icon?{name:e.icon,variant:"bold"}:e.icon,l=t?e.activeIcon??s:e.icon,c=xe.current[e.key],d=be.current[e.key],u=formatBadge(e.badge??null),p=badgeAccessibilitySuffix(e.badge??null),h=J&&!t?.7:1,m=K&&t||J?De.primary:De.surface,_=hasLabel(e),g=_&&(!G||t),x=(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[A.iconWrap,{width:C+4,height:C+4,opacity:h,transform:[{scale:c}]}],children:[(0,_index3.renderSlotIcon)(l,{color:a,size:C,focused:t,disabled:!1}),u?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[u.isDot?A.badgeDot:A.badgePill,{backgroundColor:De.danger,borderColor:m}],children:u.isDot?null:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.badgeText,{color:De["on-danger"]}],numberOfLines:1,children:u.text})}):null]}),b=K?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{top:d.interpolate({inputRange:[0,1],outputRange:[0,-14]})},children:x}):x,f=g?(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{numberOfLines:1,maxFontSizeMultiplier:w??E.settings.maxFontSizeMultiplier??1.2,style:[A.label,G?A.labelInline:null,{color:i,opacity:G?d:h,fontWeight:t?E.weight.semibold:E.weight.normal},N],children:e.label}):null,v=(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>(e=>{H&&z(y),e.key!==n&&!1!==o&&(0,_index2.triggerHaptic)(o);const t=xe.current[e.key];t&&popIcon(t),r(e.key)})(e),accessibilityRole:"tab",accessibilityState:{selected:t},"aria-selected":t,accessibilityLabel:`${e.label}${p}`,accessibilityHint:`Switches to ${e.label}`,hitSlop:{top:6,bottom:6,left:6,right:6},style:({pressed:e})=>[A.tab,Z?A.tabTile:null,e?{opacity:.85}:null],testID:S?`${S}-tab-${e.key}`:void 0,children:G?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[A.expandPill,{height:L,paddingHorizontal:t&&_?E.space.md:Math.max(0,(L-(C+4))/2)}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[A.expandFill,{borderRadius:activeBgRadius(L,L/2),..._corners.smoothCorners,backgroundColor:t?De["primary-soft"]:"transparent"},t?j:null]}),b,f]}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[b,f]})},e.key);return G?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{flex:d.interpolate({inputRange:[0,1],outputRange:[1,_?1.5:1]})},children:v},e.key):v}),rt?[...lt.slice(0,re),rt,...lt.slice(re)]:lt),"underline"===l&&he>0?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[A.underline,"top"===c?A.underlineTop:A.underlineBottom,"top"===c?{top:-Fe-X}:{bottom:-Fe},{width:he,height:3,backgroundColor:De.primary,transform:[{translateX:Ae}]},j]}):null]});var lt;return(0,_jsxRuntime.jsx)(_reactNative.View,{ref:t,testID:S,accessibilityRole:"tablist",style:[A.outer,{paddingHorizontal:Pe,paddingTop:Math.max(He,nt),paddingBottom:Ue},R],children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[Y?A.floatingBar:A.dockedBar,q?A.barInline:null,Qe,{backgroundColor:Me,borderColor:tt,borderRadius:Ze,..._corners.smoothCorners},Y?{borderWidth:et,paddingHorizontal:Oe,paddingVertical:Fe}:{borderTopWidth:et,borderBottomWidth:et,borderLeftWidth:et,borderRightWidth:et,paddingHorizontal:Ke,paddingTop:Fe,paddingBottom:qe}],children:[ot,st]})})});BottomNavigation.displayName="BottomNavigation";const buildStyles=e=>_reactNative.StyleSheet.create({outer:{backgroundColor:"transparent"},dockedBar:{paddingHorizontal:e.space.xs},floatingBar:{paddingVertical:e.space.sm,paddingHorizontal:e.space.sm},tabRow:{flexDirection:"row",alignItems:"stretch",position:"relative"},tabRowInline:{flex:1},barInline:{flexDirection:"row",alignItems:"center"},accessoryStacked:{marginBottom:e.space.xs},accessoryInline:{flexShrink:0,marginRight:e.space.xs},tab:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center",paddingVertical:e.space.xs,gap:e.space.xs},tabTile:{paddingVertical:e.space.sm,gap:e.space.xxs},centerCell:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center"},centerCircle:{alignItems:"center",justifyContent:"center"},iconWrap:{alignItems:"center",justifyContent:"center",position:"relative"},label:{fontSize:e.text.xs.size,lineHeight:e.text.xs.size*e.leading.tight,textAlign:"center",includeFontPadding:!1},labelInline:{fontSize:e.text.sm.size,lineHeight:e.text.sm.size*e.leading.tight,flexShrink:1,includeFontPadding:!1},expandPill:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:e.space.xs},expandFill:{position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden"},pill:{position:"absolute",left:0},bubble:{position:"absolute",left:0,borderWidth:3},underline:{position:"absolute",left:0,height:3},underlineBottom:{borderTopLeftRadius:e.radius.none,borderTopRightRadius:e.radius.none,..._corners.smoothCorners},underlineTop:{borderBottomLeftRadius:e.radius.none,borderBottomRightRadius:e.radius.none,..._corners.smoothCorners},badgePill:{position:"absolute",top:-4,right:-8,minWidth:18,height:18,borderRadius:e.radius.pill,..._corners.smoothCorners,paddingHorizontal:e.space.xs,paddingVertical:e.space.xxs,alignItems:"center",justifyContent:"center",borderWidth:1.5},badgeDot:{position:"absolute",top:-2,right:-2,width:10,height:10,borderRadius:e.radius.pill,..._corners.smoothCorners,borderWidth:1.5},badgeText:{fontSize:e.text.xs.size,fontWeight:"700",lineHeight:13,textAlign:"center",includeFontPadding:!1}});var _default=exports.default=BottomNavigation;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.BottomNavigation=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_useReducedMotion=require("../../hooks/useReducedMotion.js"),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_corners=require("../../utils/corners.js"),_shadows=require("../../utils/shadows.js"),_index3=require("../AppIcon/index.js"),_useScreenReaderEnabled=require("./useScreenReaderEnabled.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var i,a,n=Object.defineProperty,r={__proto__:null,default:e};if(Object(e)!==e)return r;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,r)}for(a in e)"default"!==a&&{}.hasOwnProperty.call(e,a)&&((i=n&&Object.getOwnPropertyDescriptor(e,a))&&(i.get||i.set)?n(r,a,i):r[a]=e[a]);return r}const DEFAULT_ICON_SIZE=18,DEFAULT_LABEL_MAX_FONT_SCALE=1.2,ICON_WRAP_AIR=4,PILL_AIR=8,DEFAULT_PILL_MAX_WIDTH=64,TILE_MAX_WIDTH=96,DEFAULT_UNDERLINE_HEIGHT=3,DEFAULT_BUBBLE_SIZE=48,DEFAULT_BUBBLE_LIFT=14,DEFAULT_CENTER_SIZE=48,DEFAULT_CENTER_ICON_SIZE=24,CENTER_KEY="__webority_center_action__",EXPANDED_FLEX=1.5,SOLID_INACTIVE_OPACITY=.7,TILE_INSET=2,formatBadge=e=>null==e||!1===e?null:!0===e||"·"===e?{text:"",isDot:!0}:"number"==typeof e?e<=0?null:{text:e>99?"99+":String(e),isDot:!1}:"string"==typeof e?0===e.length?null:{text:e,isDot:!1}:null,badgeAccessibilitySuffix=e=>null==e||!1===e?"":"number"==typeof e?e>0?`, ${e} unread`:"":!0===e||"·"===e?", new updates":"string"==typeof e&&e.length>0?`, ${e}`:"",BottomNavigation=exports.BottomNavigation=(0,_react.forwardRef)((e,t)=>{const{tabs:i,centerAction:a,activeTab:n,onChange:r,haptic:o="selection",showLabels:s=!0,variant:l="pill",indicatorPosition:c="bottom",radius:d,indicatorRadius:u="auto",elevation:p,iconSize:h,marginHorizontal:m,marginVertical:_,paddingHorizontal:g,paddingVertical:x,border:b,minimizeOnScroll:f=!1,scrollDirection:y="idle",accessory:v,style:R,indicatorStyle:j,labelStyle:N,labelMaxFontScale:w,testID:S}=e,E=(0,_index.useTheme)(),I=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),A=(0,_react.useMemo)(()=>buildStyles(E),[E]),C=h??18,L=C+4+8,T=E.space.lg,D=E.space.lg,M=E.radius.xl,V=(0,_useReducedMotion.useReducedMotion)(),k=(0,_useScreenReaderEnabled.useScreenReaderEnabled)(f),[B,z]=_react.default.useState(null);(0,_react.useEffect)(()=>{null!==B&&B!==y&&z(null)},[B,y]);const P=f&&!k&&"down"===y&&null===B,[H,W]=_react.default.useState(P);(0,_react.useEffect)(()=>{H!==P&&(V||"web"===_reactNative.Platform.OS||_reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut),W(P))},[H,P,V]);const F="function"==typeof v?v({minimized:H}):v,O=null!=F&&!1!==F,q=H&&O,[U,$]=_react.default.useState(0),X=O&&!q?U+E.space.xs:0,Z="tile"===l,Y="floating"===l||Z,K="bubble"===l,G="expand"===l,J="solid"===l,Q="pill"===l||Y||J,ee=Math.max(0,i.findIndex(e=>e.key===n)),[te,ie]=_react.default.useState(0),[ae,ne]=_react.default.useState(0),re=a?Math.ceil(i.length/2):i.length,oe=i.length+(a?1:0),[se,le]=_react.default.useState({width:0,height:0}),ce=a?.size??48,de=void 0!==a?.gap,ue=Math.max(0,a?.gap??0),pe=de?(se.width||ce)+2*ue:0,he=de?i.length>0?Math.max(0,te-pe)/i.length:0:oe>0?te/oe:0,me=de?pe:he,ge=(0,_react.useRef)((0,_index.createAnimatedValue)(ee)).current,xe=(0,_react.useRef)({}),be=(0,_react.useRef)({});i.forEach(e=>{xe.current[e.key]||(xe.current[e.key]=new _reactNative.Animated.Value(1)),be.current[e.key]||(be.current[e.key]=(0,_index.createAnimatedValue)(e.key===n?1:0))});const fe=he>0?Z?Math.min(he-4,96):Math.min(he-T,64):0,ye=he>0?(he-fe)/2:0,ve=he>0?(he-48)/2:0,hasLabel=e=>s&&!H&&!1!==e.showLabel&&e.label.trim().length>0,Re=i[ee],je=Re&&!hasLabel(Re)&&ae>0?ae/2:E.space.xs+(C+4)/2,Ne=je-14-24,we=Math.max(0,ae-4),Se=Z?2:je-L/2,Ee=(0,_react.useRef)(ee);(0,_react.useEffect)(()=>{if(Ee.current===ee)return;Ee.current=ee;const e=_reactNative.Animated.spring(ge,{toValue:ee,tension:120,friction:14,useNativeDriver:!0});return e.start(),()=>e.stop()},[ee,ge]);const Ie=Math.max(1,i.length-1),Ae=(0,_react.useMemo)(()=>{const e=[],t=[];for(let i=0;i<=Ie;i++)e.push(i),t.push(i<re?i*he:i*he+me);return ge.interpolate({inputRange:e,outputRange:t})},[ge,Ie,re,he,me]),Ce=i.map(e=>e.key).join(" "),Le=K||G;(0,_react.useEffect)(()=>{const e=Ce.split(" ").flatMap(e=>{const t=e===n?1:0,i=be.current[e];return i?Le?[_reactNative.Animated.spring(i,{toValue:t,tension:140,friction:13,useNativeDriver:!1})]:(i.setValue(t),[]):[]});if(0===e.length)return;const t=_reactNative.Animated.parallel(e);return t.start(),()=>t.stop()},[n,Ce,Le]);const popIcon=e=>{_reactNative.Animated.sequence([_reactNative.Animated.timing(e,{toValue:1.15,duration:120,useNativeDriver:!0}),_reactNative.Animated.spring(e,{toValue:1,tension:200,friction:8,useNativeDriver:!0})]).start()},Te=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current,{colors:De}=E,Me=J?De.primary:De.surface,Ve=J?De["on-primary"]:De.primary,ke=J?De["on-primary"]:Z?De["text-body"]:De["text-subtle"],Be=J?De["on-primary"]:De["primary-soft"],ze=J?De.primary:K?De["on-primary"]:Ve,Pe=m??D,He=_??(Y?D:0),We=He>0,Fe=x??E.space.sm,Oe=g??(Y?E.space.sm:E.space.xs),qe=We?Fe:Math.max(Fe,I.bottom),Ue=We?Math.max(He,I.bottom>0?I.bottom+E.space.sm:0):0,$e="pill"===d,Xe=Y?ae+X+2*Fe+2*_reactNative.StyleSheet.hairlineWidth:ae+X+Fe+qe,Ze=$e?ae>0?Xe/2:E.radius.pill:d??(Z?E.radius.pill:Y?M:E.radius.none),Ye=void 0!==d,activeBgRadius=(e,t)=>"number"==typeof u?Math.max(0,Math.min(u,e/2)):"auto"===u&&Ye?Math.min(Ze,e/2):t,Ke="underline"===l?Math.max(Oe,$e&&0===ae?0:Ze):Oe,Ge=p??"none",Je="none"===Ge?void 0:E.shadow[Ge],Qe=void 0===Je?null:(0,_shadows.supportsBoxShadow)()?{boxShadow:(0,_shadows.toBoxShadow)(Je)}:Je,et=b?_reactNative.StyleSheet.hairlineWidth:0,tt=J?De.primary:De.border,it=a?.lift??0,at=Fe+et+X,nt=a&&ae>0?Math.max(0,(se.height||ce)/2+it-ae/2-at):0,rt=a?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[A.centerCell,de?{flex:0,marginHorizontal:ue}:null],pointerEvents:"box-none",children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>{if(!a)return;const e=a.haptic??o;!1!==e&&(0,_index2.triggerHaptic)(e),popIcon(Te),a.onPress()},onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;le(e=>e.width===t&&e.height===i?e:{width:t,height:i})},accessibilityRole:"button",accessibilityLabel:a.label,hitSlop:{top:6,bottom:6,left:6,right:6},style:({pressed:e})=>[{top:-it},e?{opacity:.85}:null],testID:a.testID??(S?`${S}-center`:void 0),children:a.content?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{transform:[{scale:Te}]},children:a.content}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[A.centerCircle,{width:ce,height:ce,borderRadius:E.radius.pill,..._corners.smoothCorners,backgroundColor:a.color??De.primary}],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{transform:[{scale:Te}]},children:(0,_index3.renderSlotIcon)(a.icon??"add",{color:a.iconColor??De["on-primary"],size:a.iconSize??24,disabled:!1})})})})},CENTER_KEY):null,ot=O?(0,_jsxRuntime.jsx)(_reactNative.View,{style:q?A.accessoryInline:A.accessoryStacked,onLayout:e=>$(e.nativeEvent.layout.height),testID:S?`${S}-accessory`:void 0,children:F}):null,st=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:q?[A.tabRow,A.tabRowInline]:A.tabRow,onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;ie(t),ne(i)},children:[Q&&fe>0&&(!Z||we>0)?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[A.pill,{width:fe,height:Z?we:L,left:ye,top:Se,backgroundColor:Be,borderRadius:Z?activeBgRadius(we,we/2):activeBgRadius(L,E.radius.pill),..._corners.smoothCorners,transform:[{translateX:Ae}]},j]}):null,K&&he>0?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[A.bubble,E.shadow.elevated,{width:48,height:48,borderRadius:E.radius.pill,..._corners.smoothCorners,left:ve,top:Ne,backgroundColor:De.primary,borderColor:De.surface,transform:[{translateX:Ae}]},j]}):null,(lt=i.map(e=>{const t=e.key===n,i=t?Ve:ke,a=t?ze:ke,s="string"==typeof e.icon?{name:e.icon,variant:"bold"}:e.icon,l=t?e.activeIcon??s:e.icon,c=xe.current[e.key],d=be.current[e.key],u=formatBadge(e.badge??null),p=badgeAccessibilitySuffix(e.badge??null),h=J&&!t?.7:1,m=K&&t||J?De.primary:De.surface,_=hasLabel(e),g=_&&(!G||t),x=(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[A.iconWrap,{width:C+4,height:C+4,opacity:h,transform:[{scale:c}]}],children:[(0,_index3.renderSlotIcon)(l,{color:a,size:C,focused:t,disabled:!1}),u?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[u.isDot?A.badgeDot:A.badgePill,{backgroundColor:De.danger,borderColor:m}],children:u.isDot?null:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.badgeText,{color:De["on-danger"]}],numberOfLines:1,children:u.text})}):null]}),b=K?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{top:d.interpolate({inputRange:[0,1],outputRange:[0,-14]})},children:x}):x,f=g?(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{numberOfLines:1,maxFontSizeMultiplier:w??E.settings.maxFontSizeMultiplier??1.2,style:[A.label,G?A.labelInline:null,{color:i,opacity:G?d:h,fontWeight:t?E.weight.semibold:E.weight.normal},N],children:e.label}):null,v=(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>(e=>{H&&z(y),e.key!==n&&!1!==o&&(0,_index2.triggerHaptic)(o);const t=xe.current[e.key];t&&popIcon(t),r(e.key)})(e),accessibilityRole:"tab",accessibilityState:{selected:t},"aria-selected":t,accessibilityLabel:`${e.label}${p}`,accessibilityHint:`Switches to ${e.label}`,hitSlop:{top:6,bottom:6,left:6,right:6},style:({pressed:e})=>[A.tab,Z?A.tabTile:null,e?{opacity:.85}:null],testID:S?`${S}-tab-${e.key}`:void 0,children:G?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[A.expandPill,{height:L,paddingHorizontal:t&&_?E.space.md:Math.max(0,(L-(C+4))/2)}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[A.expandFill,{borderRadius:activeBgRadius(L,L/2),..._corners.smoothCorners,backgroundColor:t?De["primary-soft"]:"transparent"},t?j:null]}),b,f]}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[b,f]})},e.key);return G?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{flex:d.interpolate({inputRange:[0,1],outputRange:[1,_?1.5:1]})},children:v},e.key):v}),rt?[...lt.slice(0,re),rt,...lt.slice(re)]:lt),"underline"===l&&he>0?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[A.underline,"top"===c?A.underlineTop:A.underlineBottom,"top"===c?{top:-Fe-X}:{bottom:-Fe},{width:he,height:3,backgroundColor:De.primary,transform:[{translateX:Ae}]},j]}):null]});var lt;return(0,_jsxRuntime.jsx)(_reactNative.View,{ref:t,testID:S,accessibilityRole:"tablist",style:[A.outer,{paddingHorizontal:Pe,paddingTop:Math.max(He,nt),paddingBottom:Ue},R],children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[Y?A.floatingBar:A.dockedBar,q?A.barInline:null,Qe,{backgroundColor:Me,borderColor:tt,borderRadius:Ze,..._corners.smoothCorners},Y?{borderWidth:et,paddingHorizontal:Oe,paddingVertical:Fe}:{borderTopWidth:et,borderBottomWidth:et,borderLeftWidth:et,borderRightWidth:et,paddingHorizontal:Ke,paddingTop:Fe,paddingBottom:qe}],children:[ot,st]})})});BottomNavigation.displayName="BottomNavigation";const buildStyles=e=>_reactNative.StyleSheet.create({outer:{backgroundColor:"transparent"},dockedBar:{paddingHorizontal:e.space.xs},floatingBar:{paddingVertical:e.space.sm,paddingHorizontal:e.space.sm},tabRow:{flexDirection:"row",alignItems:"stretch",position:"relative"},tabRowInline:{flex:1},barInline:{flexDirection:"row",alignItems:"center"},accessoryStacked:{marginBottom:e.space.xs},accessoryInline:{flexShrink:0,marginRight:e.space.xs},tab:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center",paddingVertical:e.space.xs,gap:e.space.xs},tabTile:{paddingVertical:e.space.sm,gap:e.space.xxs},centerCell:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center"},centerCircle:{alignItems:"center",justifyContent:"center"},iconWrap:{alignItems:"center",justifyContent:"center",position:"relative"},label:{fontSize:e.text.xs.size,lineHeight:e.text.xs.size*e.leading.heading,textAlign:"center",includeFontPadding:!1},labelInline:{fontSize:e.text.sm.size,lineHeight:e.text.sm.size*e.leading.heading,flexShrink:1,includeFontPadding:!1},expandPill:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:e.space.xs},expandFill:{position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden"},pill:{position:"absolute",left:0},bubble:{position:"absolute",left:0,borderWidth:3},underline:{position:"absolute",left:0,height:3},underlineBottom:{borderTopLeftRadius:e.radius.none,borderTopRightRadius:e.radius.none,..._corners.smoothCorners},underlineTop:{borderBottomLeftRadius:e.radius.none,borderBottomRightRadius:e.radius.none,..._corners.smoothCorners},badgePill:{position:"absolute",top:-4,right:-8,minWidth:18,height:18,borderRadius:e.radius.pill,..._corners.smoothCorners,paddingHorizontal:e.space.xs,paddingVertical:e.space.xxs,alignItems:"center",justifyContent:"center",borderWidth:1.5},badgeDot:{position:"absolute",top:-2,right:-2,width:10,height:10,borderRadius:e.radius.pill,..._corners.smoothCorners,borderWidth:1.5},badgeText:{fontSize:e.text.xs.size,fontWeight:"700",lineHeight:13,textAlign:"center",includeFontPadding:!1}});var _default=exports.default=BottomNavigation;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Button=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_useFlickGuard=require("../../hooks/useFlickGuard.js"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_animatedValue=require("../../theme/animatedValue.js"),_ariaState=require("../../utils/ariaState.js"),_color=require("../../utils/color.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_index2=require("../Spinner/index.js"),_SquircleFill=require("../SquircleFill/SquircleFill.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var r,o,s=Object.defineProperty,i={__proto__:null,default:e};if(Object(e)!==e)return i;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,i)}for(o in e)"default"!==o&&{}.hasOwnProperty.call(e,o)&&((r=s&&Object.getOwnPropertyDescriptor(e,o))&&(r.get||r.set)?s(i,o,r):i[o]=e[o]);return i}const Button=exports.Button=(0,_react.forwardRef)((e,t)=>{const{title:r,children:o,variant:s="solid",tone:i="primary",size:n="md",loading:a=!1,disabled:l=!1,fullWidth:c=!1,leftIcon:d,rightIcon:u,iconVariant:b,leftIconBadge:g=!1,haptic:_,rounded:h=!1,gradient:p,style:f,containerStyle:x,textStyle:m,pressAnimation:y,onPress:j,accessibilityLabel:v,accessibilityHint:C,accessibilityState:S,testID:I,onLayout:R,...k}=e;if(__DEV__&&hasTextChild(o))throw new Error('[@webority/mobile-ui] Button was given its label as text children. Pass it as `title` (<Button title="Save" />): text children draw a blank button with no accessible name.');const w=(0,_index.useTheme)(),F=!l&&!a,T={...S,disabled:!F,busy:a},N="link"===s,L=y??(!N&&"scale"),q=(0,_usePressAnimation.usePressAnimation)({preset:L||"scale",enabled:!1!==L&&F}),O=(0,_useFlickGuard.useFlickGuard)(),P=(0,_react.useMemo)(()=>buildStyles(w),[w]),W=(0,_react.useMemo)(()=>(0,_index.resolveButtonSize)(w,n),[w,n]),V=(0,_react.useMemo)(()=>toneFor(w,i),[w,i]),A=(0,_react.useMemo)(()=>variantFor(w,s,V,l),[w,s,V,l]),B=(0,_react.useMemo)(()=>!p||l||"solid"!==s?null:"string"==typeof p?w.settings.gradients[p]??null:p,[p,l,s,w.settings.gradients]),z=_reactNative.StyleSheet.flatten(f)?.borderRadius,D=N?0:"number"==typeof z?z:h?w.radius.pill:W.radius,M=(0,_SquircleFill.useSquircle)(!B&&"link"!==s,D,R),E=(0,_react.useRef)((0,_animatedValue.createAnimatedValue)(0)).current,[H,U]=(0,_react.useState)(0),[G,K]=(0,_react.useState)(null),X=N?e=>U(e.nativeEvent.layout.width):void 0,Y=v??r,J="outline"===s||"ghost"===s,Q=!J&&!N,Z={color:A.textColor,size:W.icon,disabled:l},$=g&&!N&&Boolean(d),ee=w.space.xs,te=W["min-height"]-2*ee-2*A.borderWidth,re={color:A.badgeInk,size:W["badge-icon"],disabled:l},oe=a?(0,_jsxRuntime.jsx)(_index2.Spinner,{variant:"circular",size:"sm",color:$?A.badgeInk:A.textColor,accessibilityLabel:"Loading"}):d?(0,_slotIcon.renderSlotIcon)(d,$?re:Z,b):null,se=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:P.contentRow,children:[$?(0,_jsxRuntime.jsx)(_reactNative.View,{testID:"button-icon-badge",style:[P.iconLeft,P.iconBadge,{width:te,height:te,borderRadius:te/2,backgroundColor:A.badgeFill}],children:oe}):oe?(0,_jsxRuntime.jsx)(_reactNative.View,{style:P.iconLeft,children:oe}):null,r?(0,_jsxRuntime.jsxs)(_reactNative.View,{onLayout:X,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[P.label,{color:A.textColor,fontSize:W.text,...(0,_index.fontFor)(w,"semibold")},m],numberOfLines:1,children:r}),N?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",testID:"button-link-underline",style:[P.linkUnderline,{backgroundColor:A.textColor,transform:[{translateX:E.interpolate({inputRange:[0,1],outputRange:[-H/2,0]})},{scaleX:E.interpolate({inputRange:[0,1],outputRange:[0,1]})}]}]}):null]}):o,u?(0,_jsxRuntime.jsx)(_reactNative.View,{style:P.iconRight,children:(0,_slotIcon.renderSlotIcon)(u,Z,b)}):null]}),ie=N?null===G?LINK_HIT_SLOP:Math.max(LINK_HIT_SLOP,touchSlopFor(G)):touchSlopFor(W["min-height"]),ne={top:ie,bottom:ie,left:N?LINK_HIT_SLOP:0,right:N?LINK_HIT_SLOP:0};return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[q.style,c?P.fullWidth:null,x],children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{ref:t,onPress:e=>{F&&!O.isFlick(e)&&(q.press(),_&&(0,_hapticUtils.triggerHaptic)(_),j?.(e))},onPressIn:e=>{O.onPressIn(e),q.pressIn(),N&&F&&(E.stopAnimation(),E.setValue(0),_reactNative.Animated.timing(E,{toValue:1,duration:w.motion.duration.slower,easing:_reactNative.Easing.bezier(...w.motion.ease.decelerate),useNativeDriver:!0}).start())},onPressOut:()=>{q.pressOut()},disabled:!F,hitSlop:ne,accessibilityRole:"button",accessibilityLabel:Y,accessibilityHint:C,accessibilityState:T,...(0,_ariaState.ariaFromState)(T),testID:I,onLayout:e=>{M.onLayout(e),N&&K(e.nativeEvent.layout.height)},style:({pressed:e})=>[P.base,{paddingHorizontal:N?0:W["padding-x"],paddingVertical:N?0:$?ee:W["padding-y"],paddingLeft:$?ee:void 0,minHeight:N?void 0:W["min-height"],borderRadius:D,..._corners.smoothCorners,backgroundColor:B||M.active?"transparent":A.backgroundColor,borderWidth:A.borderWidth,borderColor:M.active?"transparent":A.borderColor,opacity:a?.55:1,overflow:M.active||N?"visible":"hidden"},e&&J&&!M.active?{backgroundColor:w.colors["surface-pressed"]}:null,c?P.fullWidth:null,f],...k,"aria-disabled":!F,"aria-busy":a,children:({pressed:e})=>(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[M.active&&M.size?(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:M.size.width,height:M.size.height,radius:D,fill:e&&J?w.colors["surface-pressed"]:A.backgroundColor,stroke:A.borderColor,strokeWidth:A.borderWidth,outset:A.borderWidth}):null,B?(0,_jsxRuntime.jsx)(_index.Gradient,{gradient:B,style:[_reactNative.StyleSheet.absoluteFill,{borderRadius:D,..._corners.smoothCorners}]}):null,e&&Q?M.active&&M.size?(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:M.size.width,height:M.size.height,radius:D,fill:A.pressedTint,outset:A.borderWidth,testID:"button-pressed"}):(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[P.pressedOverlay,{borderRadius:D,backgroundColor:A.pressedTint,..._corners.smoothCorners}],testID:"button-pressed"}):null,se]})})})});Button.displayName="Button";const hasTextChild=e=>_react.default.Children.toArray(e).some(e=>"string"==typeof e||"number"==typeof e),SOFT_FILL_OPACITY=.14,toneFor=(e,t)=>{switch(t){case"primary":return{base:e.colors.primary,on:e.colors["on-primary"],fg:e.colors["primary-text"],soft:(0,_color.tintOf)(e.colors.primary,.14,e.colors["primary-soft"])};case"secondary":return{base:e.colors.neutral,on:e.colors["on-neutral"],fg:e.colors["on-neutral"],soft:e.colors.neutral};case"success":return{base:e.colors.success,on:e.colors["on-success"],fg:e.colors["success-text"],soft:(0,_color.tintOf)(e.colors.success,.14,e.colors["bg-subtle"])};case"warning":return{base:e.colors.warning,on:e.colors["on-warning"],fg:e.colors["warning-text"],soft:(0,_color.tintOf)(e.colors.warning,.14,e.colors["bg-subtle"])};case"danger":return{base:e.colors.danger,on:e.colors["on-danger"],fg:e.colors["danger-text"],soft:(0,_color.tintOf)(e.colors.danger,.14,e.colors["bg-subtle"])};default:return{base:e.colors["bg-muted"],on:e.colors["text-body"],fg:e.colors["text-body"],soft:e.colors["bg-subtle"]}}},BUTTON_BORDER_WIDTH=1,MIN_TOUCH_TARGET=44,LINK_HIT_SLOP=8,touchSlopFor=e=>Math.max(0,Math.ceil((44-e)/2)),variantFor=(e,t,r,o)=>{const s=o?e.colors["text-disabled"]:r.fg,i={badgeFill:e.colors["surface-disabled"],badgeInk:e.colors["text-disabled"]},n=o?i:{badgeFill:r.on,badgeInk:r.base},a=o?i:{badgeFill:r.base,badgeInk:r.on};switch(t){case"solid":return{backgroundColor:o?e.colors["surface-disabled"]:r.base,borderColor:"transparent",borderWidth:1,textColor:o?e.colors["text-disabled"]:r.on,pressedTint:e.colors["surface-pressed"],...n};case"soft":return{backgroundColor:o?e.colors["surface-disabled"]:r.soft,borderColor:"transparent",borderWidth:1,textColor:s,pressedTint:e.colors["surface-pressed"],...a};case"outline":return{backgroundColor:"transparent",borderColor:o?e.colors.border:r.base,borderWidth:1,textColor:s,pressedTint:e.colors["surface-pressed"],...a};case"ghost":return{backgroundColor:"transparent",borderColor:"transparent",borderWidth:1,textColor:s,pressedTint:e.colors["surface-pressed"],...a};case"link":return{backgroundColor:"transparent",borderColor:"transparent",borderWidth:0,textColor:o?e.colors["text-disabled"]:e.colors.link,pressedTint:e.colors["surface-pressed"],...a};case"glass":return{backgroundColor:e.colors["glass-fill"],borderColor:e.colors["glass-border"],borderWidth:1,textColor:o?e.colors["text-disabled"]:e.colors["on-glass"],pressedTint:_color.ACCENT_PRESSED_TINT,badgeFill:e.colors["glass-badge"],badgeInk:o?e.colors["text-disabled"]:r.base};default:return{backgroundColor:r.base,borderColor:"transparent",borderWidth:1,textColor:r.on,pressedTint:e.colors["surface-pressed"],...n}}},buildStyles=e=>_reactNative.StyleSheet.create({pressedOverlay:{position:"absolute",top:0,right:0,bottom:0,left:0},base:{alignItems:"center",justifyContent:"center",flexDirection:"row",overflow:"hidden"},contentRow:{flexDirection:"row",alignItems:"center",justifyContent:"center"},label:{textAlign:"center",includeFontPadding:!1,textAlignVertical:"center"},linkUnderline:{height:1.5,marginTop:1},iconLeft:{marginRight:e.space.sm},iconBadge:{alignItems:"center",justifyContent:"center"},iconRight:{marginLeft:e.space.sm},fullWidth:{alignSelf:"stretch"}});var _default=exports.default=Button;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Button=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_useFlickGuard=require("../../hooks/useFlickGuard.js"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_animatedValue=require("../../theme/animatedValue.js"),_ariaState=require("../../utils/ariaState.js"),_color=require("../../utils/color.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_hitSlop=require("../../utils/hitSlop.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_index2=require("../Spinner/index.js"),_SquircleFill=require("../SquircleFill/SquircleFill.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var r,o,s=Object.defineProperty,i={__proto__:null,default:e};if(Object(e)!==e)return i;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,i)}for(o in e)"default"!==o&&{}.hasOwnProperty.call(e,o)&&((r=s&&Object.getOwnPropertyDescriptor(e,o))&&(r.get||r.set)?s(i,o,r):i[o]=e[o]);return i}const Button=exports.Button=(0,_react.forwardRef)((e,t)=>{const{title:r,children:o,variant:s="solid",tone:i="primary",size:n="md",loading:a=!1,disabled:l=!1,fullWidth:c=!1,leftIcon:d,rightIcon:u,iconVariant:b,leftIconBadge:g=!1,haptic:_,rounded:h=!1,gradient:p,style:f,containerStyle:x,textStyle:m,pressAnimation:y,onPress:j,accessibilityLabel:v,accessibilityHint:S,accessibilityState:C,testID:I,onLayout:k,...R}=e;if(__DEV__&&hasTextChild(o))throw new Error('[@webority/mobile-ui] Button was given its label as text children. Pass it as `title` (<Button title="Save" />): text children draw a blank button with no accessible name.');const w=(0,_index.useTheme)(),F=!l&&!a,T={...C,disabled:!F,busy:a},N="link"===s,q=y??(!N&&"scale"),L=(0,_usePressAnimation.usePressAnimation)({preset:q||"scale",enabled:!1!==q&&F}),O=(0,_useFlickGuard.useFlickGuard)(),P=(0,_react.useMemo)(()=>buildStyles(w),[w]),W=(0,_react.useMemo)(()=>(0,_index.resolveButtonSize)(w,n),[w,n]),V=(0,_react.useMemo)(()=>toneFor(w,i),[w,i]),A=(0,_react.useMemo)(()=>variantFor(w,s,V,l),[w,s,V,l]),B=(0,_react.useMemo)(()=>!p||l||"solid"!==s?null:"string"==typeof p?w.settings.gradients[p]??null:p,[p,l,s,w.settings.gradients]),z=_reactNative.StyleSheet.flatten(f)?.borderRadius,D=N?0:"number"==typeof z?z:h?w.radius.pill:W.radius,M=(0,_SquircleFill.useSquircle)(!B&&"link"!==s,D,k),E=(0,_react.useRef)((0,_animatedValue.createAnimatedValue)(0)).current,[H,U]=(0,_react.useState)(0),[G,K]=(0,_react.useState)(null),X=N?e=>U(e.nativeEvent.layout.width):void 0,Y=v??r,J="outline"===s||"ghost"===s,Q=!J&&!N,Z={color:A.textColor,size:W.icon,disabled:l},$=g&&!N&&Boolean(d),ee=w.space.xs,te=W["min-height"]-2*ee-2*A.borderWidth,re={color:A.badgeInk,size:W["badge-icon"],disabled:l},oe=a?(0,_jsxRuntime.jsx)(_index2.Spinner,{variant:"circular",size:"sm",color:$?A.badgeInk:A.textColor,accessibilityLabel:"Loading"}):d?(0,_slotIcon.renderSlotIcon)(d,$?re:Z,b):null,se=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:P.contentRow,children:[$?(0,_jsxRuntime.jsx)(_reactNative.View,{testID:"button-icon-badge",style:[P.iconLeft,P.iconBadge,{width:te,height:te,borderRadius:te/2,backgroundColor:A.badgeFill}],children:oe}):oe?(0,_jsxRuntime.jsx)(_reactNative.View,{style:P.iconLeft,children:oe}):null,r?(0,_jsxRuntime.jsxs)(_reactNative.View,{onLayout:X,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[P.label,{color:A.textColor,fontSize:W.text,...(0,_index.fontFor)(w,"semibold")},m],numberOfLines:1,children:r}),N?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",testID:"button-link-underline",style:[P.linkUnderline,{backgroundColor:A.textColor,transform:[{translateX:E.interpolate({inputRange:[0,1],outputRange:[-H/2,0]})},{scaleX:E.interpolate({inputRange:[0,1],outputRange:[0,1]})}]}]}):null]}):o,u?(0,_jsxRuntime.jsx)(_reactNative.View,{style:P.iconRight,children:(0,_slotIcon.renderSlotIcon)(u,Z,b)}):null]}),ie=N?null===G?LINK_HIT_SLOP:Math.max(LINK_HIT_SLOP,touchSlopFor(G)):touchSlopFor(W["min-height"]),ne={top:ie,bottom:ie,left:N?LINK_HIT_SLOP:0,right:N?LINK_HIT_SLOP:0};return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[L.style,c?P.fullWidth:null,x],children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{ref:t,onPress:e=>{F&&!O.isFlick(e)&&(L.press(),_&&(0,_hapticUtils.triggerHaptic)(_),j?.(e))},onPressIn:e=>{O.onPressIn(e),L.pressIn(),N&&F&&(E.stopAnimation(),E.setValue(0),_reactNative.Animated.timing(E,{toValue:1,duration:w.motion.duration.slower,easing:_reactNative.Easing.bezier(...w.motion.ease.decelerate),useNativeDriver:!0}).start())},onPressOut:()=>{L.pressOut()},disabled:!F,hitSlop:ne,...(0,_hitSlop.hitSlopMarker)(ne),accessibilityRole:"button",accessibilityLabel:Y,accessibilityHint:S,accessibilityState:T,...(0,_ariaState.ariaFromState)(T),testID:I,onLayout:e=>{M.onLayout(e),N&&K(e.nativeEvent.layout.height)},style:({pressed:e})=>[P.base,{paddingHorizontal:N?0:W["padding-x"],paddingVertical:N?0:$?ee:W["padding-y"],paddingLeft:$?ee:void 0,minHeight:N?void 0:W["min-height"],borderRadius:D,..._corners.smoothCorners,backgroundColor:B||M.active?"transparent":A.backgroundColor,borderWidth:A.borderWidth,borderColor:M.active?"transparent":A.borderColor,opacity:a?.55:1,overflow:M.active||N?"visible":"hidden"},e&&J&&!M.active?{backgroundColor:w.colors["surface-pressed"]}:null,c?P.fullWidth:null,f],...R,"aria-disabled":!F,"aria-busy":a,children:({pressed:e})=>(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[M.active&&M.size?(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:M.size.width,height:M.size.height,radius:D,fill:e&&J?w.colors["surface-pressed"]:A.backgroundColor,stroke:A.borderColor,strokeWidth:A.borderWidth,outset:A.borderWidth}):null,B?(0,_jsxRuntime.jsx)(_index.Gradient,{gradient:B,style:[_reactNative.StyleSheet.absoluteFill,{borderRadius:D,..._corners.smoothCorners}]}):null,e&&Q?M.active&&M.size?(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:M.size.width,height:M.size.height,radius:D,fill:A.pressedTint,outset:A.borderWidth,testID:"button-pressed"}):(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[P.pressedOverlay,{borderRadius:D,backgroundColor:A.pressedTint,..._corners.smoothCorners}],testID:"button-pressed"}):null,se]})})})});Button.displayName="Button";const hasTextChild=e=>_react.default.Children.toArray(e).some(e=>"string"==typeof e||"number"==typeof e),SOFT_FILL_OPACITY=.14,toneFor=(e,t)=>{switch(t){case"primary":return{base:e.colors.primary,on:e.colors["on-primary"],fg:e.colors["primary-text"],soft:(0,_color.tintOf)(e.colors.primary,.14,e.colors["primary-soft"])};case"secondary":return{base:e.colors.neutral,on:e.colors["on-neutral"],fg:e.colors["on-neutral"],soft:e.colors.neutral};case"success":return{base:e.colors.success,on:e.colors["on-success"],fg:e.colors["success-text"],soft:(0,_color.tintOf)(e.colors.success,.14,e.colors["bg-subtle"])};case"warning":return{base:e.colors.warning,on:e.colors["on-warning"],fg:e.colors["warning-text"],soft:(0,_color.tintOf)(e.colors.warning,.14,e.colors["bg-subtle"])};case"danger":return{base:e.colors.danger,on:e.colors["on-danger"],fg:e.colors["danger-text"],soft:(0,_color.tintOf)(e.colors.danger,.14,e.colors["bg-subtle"])};default:return{base:e.colors["bg-muted"],on:e.colors["text-body"],fg:e.colors["text-body"],soft:e.colors["bg-subtle"]}}},BUTTON_BORDER_WIDTH=1,MIN_TOUCH_TARGET=44,LINK_HIT_SLOP=8,touchSlopFor=e=>Math.max(0,Math.ceil((44-e)/2)),variantFor=(e,t,r,o)=>{const s=o?e.colors["text-disabled"]:r.fg,i={badgeFill:e.colors["surface-disabled"],badgeInk:e.colors["text-disabled"]},n=o?i:{badgeFill:r.on,badgeInk:r.base},a=o?i:{badgeFill:r.base,badgeInk:r.on};switch(t){case"solid":return{backgroundColor:o?e.colors["surface-disabled"]:r.base,borderColor:"transparent",borderWidth:1,textColor:o?e.colors["text-disabled"]:r.on,pressedTint:e.colors["surface-pressed"],...n};case"soft":return{backgroundColor:o?e.colors["surface-disabled"]:r.soft,borderColor:"transparent",borderWidth:1,textColor:s,pressedTint:e.colors["surface-pressed"],...a};case"outline":return{backgroundColor:"transparent",borderColor:o?e.colors.border:r.base,borderWidth:1,textColor:s,pressedTint:e.colors["surface-pressed"],...a};case"ghost":return{backgroundColor:"transparent",borderColor:"transparent",borderWidth:1,textColor:s,pressedTint:e.colors["surface-pressed"],...a};case"link":return{backgroundColor:"transparent",borderColor:"transparent",borderWidth:0,textColor:o?e.colors["text-disabled"]:e.colors.link,pressedTint:e.colors["surface-pressed"],...a};case"glass":return{backgroundColor:e.colors["glass-fill"],borderColor:e.colors["glass-border"],borderWidth:1,textColor:o?e.colors["text-disabled"]:e.colors["on-glass"],pressedTint:_color.ACCENT_PRESSED_TINT,badgeFill:e.colors["glass-badge"],badgeInk:o?e.colors["text-disabled"]:r.base};default:return{backgroundColor:r.base,borderColor:"transparent",borderWidth:1,textColor:r.on,pressedTint:e.colors["surface-pressed"],...n}}},buildStyles=e=>_reactNative.StyleSheet.create({pressedOverlay:{position:"absolute",top:0,right:0,bottom:0,left:0},base:{alignItems:"center",justifyContent:"center",flexDirection:"row",overflow:"hidden"},contentRow:{flexDirection:"row",alignItems:"center",justifyContent:"center"},label:{textAlign:"center",includeFontPadding:!1,textAlignVertical:"center"},linkUnderline:{height:1.5,marginTop:1},iconLeft:{marginRight:e.space.sm},iconBadge:{alignItems:"center",justifyContent:"center"},iconRight:{marginLeft:e.space.sm},fullWidth:{alignSelf:"stretch"}});var _default=exports.default=Button;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Card=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_useControllableState=require("../../hooks/useControllableState.js"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_mergeRefs=require("../../utils/mergeRefs.js"),_shadows=require("../../utils/shadows.js"),_squircle=require("../../utils/squircle.js"),_themeStyles=require("../../utils/themeStyles.js"),_AppIcon=require("../AppIcon/AppIcon.js"),_useContextMenu=require("../Menu/useContextMenu.js"),_index2=require("../Skeleton/index.js"),_SquircleFill=require("../SquircleFill/SquircleFill.js"),_index3=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var i,s,r=Object.defineProperty,a={__proto__:null,default:e};if(Object(e)!==e)return a;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,a)}for(s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=r&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?r(a,s,i):a[s]=e[s]);return a}const BACKGROUND_TOKENS=["bg","bg-subtle","bg-muted","surface","scrim","surface-inverse"],paddingMap={none:"none",sm:"sm",md:"lg",lg:"xl",xl:"2xl"},Card=exports.Card=_react.default.memo((0,_react.forwardRef)((e,t)=>{const{children:i,variant:s="elevated",elevation:r="card",radius:a="lg",padding:n="md",interactive:o=!1,bg:l,header:c,title:d,lead:u,action:h,headerActions:x,collapsible:m=!1,collapsed:_,defaultCollapsed:p=!1,onCollapsedChange:b,collapsedSummary:g,onRemove:j,removeLabel:y="Remove",separatorHeight:v=_reactNative.StyleSheet.hairlineWidth,footer:R,imageSource:f,imageHeight:S=160,imageAspectRatio:C,imageOverlay:w,loading:A=!1,gradient:N,onPress:q,haptic:k,contextMenu:T,accessibilityLabel:B,accessibilityHint:P,accessibilityRole:I,style:L,containerStyle:F,headerStyle:M,bodyStyle:V,footerStyle:H,borderRadius:O,testID:z,onLayout:W,...D}=e,U=(0,_index.useTheme)(),E=o||"function"==typeof q,G=(0,_useContextMenu.useContextMenu)(T,{haptic:k||!1,testID:z,accessibilityActions:D.accessibilityActions,onAccessibilityAction:D.onAccessibilityAction}),K=(0,_react.useMemo)(()=>(0,_mergeRefs.mergeRefs)(t,G.hostRef),[t,G.hostRef]),$=E||G.enabled,{style:J,pressIn:Q,pressOut:X}=(0,_usePressAnimation.usePressAnimation)({enabled:$}),Y=stylesFor(U),Z=Boolean(f),ee=U.space[paddingMap[n]],te=(0,_react.useMemo)(()=>N?"string"==typeof N?U.settings.gradients[N]??null:N:null,[N,U.settings.gradients]),ie="flat"===s,se=ie?U.radius.none:O??U.radius[a],re=resolveBackground(U,l),[ae,ne]=(0,_useControllableState.useControllableState)({value:_,defaultValue:p,onChange:b}),oe=m&&ae,le=hasBuiltInHeaderContent(e),ce=Boolean(c)||le,de=(0,_SquircleFill.useSquircle)(!Z&&!te&&!ie,se,W),ue=_reactNative.StyleSheet.flatten([L,F])??{},he=ue.backgroundColor,xe=ue.borderColor,me=he??re??("filled"===s?U.colors["bg-subtle"]:U.colors.surface),pe="outlined"===s?U.size.border:0,be=xe??U.colors.border,ge="none"===r?void 0:U.shadow[r],je="elevated"===s&&(0,_shadows.supportsBoxShadow)()&&ge?(0,_shadows.toBoxShadow)(ge):void 0,ye=de.active&&"elevated"===s&&!je,ve=de.active&&!ye?{backgroundColor:"transparent",borderColor:"transparent"}:null,Re=(0,_react.useMemo)(()=>{const e={borderRadius:ye&&de.size?(0,_squircle.squircleHostRadius)(de.size.width,de.size.height,se):se,..._corners.smoothCorners,padding:Z?U.space.none:ee,overflow:de.active?"visible":"hidden"};switch(s){case"flat":return{...e,backgroundColor:re??U.colors.surface,borderBottomWidth:v,borderBottomColor:U.colors.border};case"outlined":return{...e,backgroundColor:de.active?"transparent":re??U.colors.surface,borderWidth:U.size.border,borderColor:de.active?"transparent":U.colors.border};case"filled":return{...e,backgroundColor:de.active?"transparent":re??U.colors["bg-subtle"]};default:return{...e,backgroundColor:re??U.colors.surface,...je?{boxShadow:je}:ge}}},[U,s,ge,se,Z,ee,de.active,de.size,je,ye,re,v]),fe=(0,_react.useMemo)(()=>({..."number"==typeof C?{width:"100%",aspectRatio:C}:{width:"100%",height:S},borderTopLeftRadius:se,borderTopRightRadius:se,borderBottomLeftRadius:U.radius.none,borderBottomRightRadius:U.radius.none,..._corners.smoothCorners}),[U,se,C,S]),Se="string"==typeof d?d:"",Ce=(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:Y.titleColumn,children:["string"==typeof d?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"title",accessibilityRole:"header",children:d}):d,u?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",style:Y.lead,children:u}):null,oe&&g?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"caption",style:Y.lead,children:g}):null]}),isCardTextAction(h)?(0,_jsxRuntime.jsx)(CardTextActionButton,{action:h,haptic:k}):h?(0,_jsxRuntime.jsx)(_reactNative.View,{style:Y.actionNode,children:h}):null,x,m?(0,_jsxRuntime.jsx)(CardIconAction,{icon:oe?"chevron-down":"chevron-up",label:`${oe?"Show":"Hide"} ${Se}`.trim(),expanded:!oe,onPress:()=>ne(!oe),haptic:k}):null,j?(0,_jsxRuntime.jsx)(CardIconAction,{icon:"trash",label:y,onPress:j,color:U.colors["danger-text"],haptic:k}):null]}),we=(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[ce?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[Y.header,!c&&Y.headerRow,oe&&Y.headerFolded,M],children:c??Ce}):null,oe?null:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[ce||R?Y.body:null,V],children:i}),R&&!oe?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[Y.footer,H],children:R}):null]}),Ae=Z?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:Y.imageWrapper,children:[(0,_jsxRuntime.jsx)(_reactNative.Image,{source:f,resizeMode:"cover",style:fe,accessibilityLabel:"",accessible:!1}),w?(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"box-none",style:Y.imageOverlay,children:w}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:{padding:ee},children:we})]}):we,Ne=te?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_index.Gradient,{gradient:te,style:_reactNative.StyleSheet.absoluteFill}),Ae]}):de.active&&de.size?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:de.size.width,height:de.size.height,radius:se,fill:me,stroke:pe?be:void 0,strokeWidth:pe,outset:pe}),Ae]}):Ae;let qe;if($){const handlePress=e=>{E&&(k&&(0,_hapticUtils.triggerHaptic)(k),q?.(e))};qe=(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:J,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{ref:K,onPress:handlePress,onPressIn:Q,onPressOut:X,android_ripple:{color:U.colors["surface-pressed"],borderless:!1},accessibilityRole:I??(E?"button":void 0),accessibilityLabel:B,accessibilityHint:P,testID:z,onLayout:de.onLayout,style:[Re,L,F,ve],...D,...G.hostProps,children:Ne})})}else qe=(0,_jsxRuntime.jsx)(_reactNative.View,{ref:t,accessibilityLabel:B,accessibilityHint:P,accessibilityRole:I,testID:z,onLayout:de.onLayout,style:[Re,L,F,ve],...D,children:Ne});return A?(0,_jsxRuntime.jsx)(CardSkeleton,{...e}):G.enabled?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[qe,G.renderSurface((0,_jsxRuntime.jsx)(_reactNative.View,{style:[Re,L,F,ve,Y.preview],children:Ne}))]}):qe}));Card.displayName="Card";const CardSkeleton=({variant:e="elevated",elevation:t,radius:i="lg",padding:s="md",bg:r,header:a,footer:n,imageSource:o,imageHeight:l=160,imageAspectRatio:c,borderRadius:d,containerStyle:u,headerStyle:h,bodyStyle:x,footerStyle:m,style:_,...p})=>{const b=(0,_index.useTheme)(),g=paddingMap[s],j=b.space[g],y="flat"===e?b.radius.none:d??b.radius[i],v=void 0!==a||hasBuiltInHeaderContent(p),R=resolveBackground(b,r)??b.colors.surface,f="outlined"===e?1:0,S="outlined"===e?b.colors.border:void 0;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[{backgroundColor:R,borderRadius:y,..._corners.smoothCorners,borderWidth:f,borderColor:S,overflow:"hidden"},u,_],accessibilityRole:"progressbar",accessibilityLabel:"Loading",accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==o?(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:"100%",height:c?void 0:l,style:c?{aspectRatio:c,width:"100%"}:void 0}):null,v?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{padding:j,paddingBottom:b.space.sm},h],children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"60%",height:18})}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{padding:j},x],children:(0,_jsxRuntime.jsx)(_index2.SkeletonText,{lines:3,fontSize:b.text.base.size,lastLineWidth:"55%"})}),void 0!==n?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{padding:j,paddingTop:b.space.sm,flexDirection:"row"},m],children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:88,height:32,shape:"rounded"})}):null]})};CardSkeleton.displayName="CardSkeleton",Card.Skeleton=CardSkeleton;const hasBuiltInHeaderContent=e=>Boolean(e.title||e.lead||e.action||e.headerActions||e.collapsible||e.onRemove),isCardTextAction=e=>"object"==typeof e&&null!==e&&!_react.default.isValidElement(e)&&"label"in e&&"onPress"in e,HIT_TARGET=44,CardIconAction=({icon:e,label:t,onPress:i,expanded:s,color:r,haptic:a})=>{const n=(0,_index.useTheme)();return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:t,accessibilityState:void 0===s?void 0:{expanded:s},"aria-expanded":s,onPress:()=>{a&&(0,_hapticUtils.triggerHaptic)(a),i()},style:iconActionStyle,children:(0,_jsxRuntime.jsx)(_AppIcon.AppIcon,{name:e,size:20,color:r??n.colors["text-body"]})})},CardTextActionButton=({action:e,haptic:t})=>{const i=(0,_index.useTheme)();return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,onPress:()=>{t&&(0,_hapticUtils.triggerHaptic)(t),e.onPress()},style:textActionStyle,children:(0,_jsxRuntime.jsx)(_index3.Text,{variant:"label",weight:"semibold",color:i.colors.primary,children:e.label})})},iconActionStyle={width:44,height:44,alignItems:"center",justifyContent:"center"},textActionStyle={minWidth:44,minHeight:44,alignItems:"center",justifyContent:"center"},resolveBackground=(e,t)=>{if(null!=t)return BACKGROUND_TOKENS.includes(t)?e.colors[t]:t},buildStyles=e=>_reactNative.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:{..._reactNative.StyleSheet.absoluteFill},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=(0,_themeStyles.themeStyles)(buildStyles);var _default=exports.default=Card;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Card=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_useControllableState=require("../../hooks/useControllableState.js"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_mergeRefs=require("../../utils/mergeRefs.js"),_shadows=require("../../utils/shadows.js"),_squircle=require("../../utils/squircle.js"),_themeStyles=require("../../utils/themeStyles.js"),_AppIcon=require("../AppIcon/AppIcon.js"),_useContextMenu=require("../Menu/useContextMenu.js"),_index2=require("../Skeleton/index.js"),_SquircleFill=require("../SquircleFill/SquircleFill.js"),_index3=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var i,s,r=Object.defineProperty,n={__proto__:null,default:e};if(Object(e)!==e)return n;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,n)}for(s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=r&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?r(n,s,i):n[s]=e[s]);return n}const BACKGROUND_TOKENS=["bg","bg-subtle","bg-muted","surface","scrim","surface-inverse"],paddingMap={none:"none",sm:"sm",md:"lg",lg:"xl",xl:"2xl"},Card=exports.Card=_react.default.memo((0,_react.forwardRef)((e,t)=>{const{children:i,variant:s="elevated",elevation:r="card",radius:n="lg",padding:a="md",interactive:o=!1,bg:l,header:c,title:d,titleFont:u="sans",lead:h,action:x,headerActions:m,collapsible:_=!1,collapsed:p,defaultCollapsed:b=!1,onCollapsedChange:g,collapsedSummary:y,onRemove:j,removeLabel:v="Remove",separatorHeight:R=_reactNative.StyleSheet.hairlineWidth,footer:f,imageSource:S,imageHeight:C=160,imageAspectRatio:w,imageOverlay:A,loading:N=!1,gradient:q,onPress:k,haptic:F,contextMenu:T,accessibilityLabel:B,accessibilityHint:P,accessibilityRole:I,style:L,containerStyle:M,headerStyle:V,bodyStyle:H,footerStyle:O,borderRadius:z,testID:W,onLayout:D,...U}=e,E=(0,_index.useTheme)(),G=o||"function"==typeof k,K=(0,_useContextMenu.useContextMenu)(T,{haptic:F||!1,testID:W,accessibilityActions:U.accessibilityActions,onAccessibilityAction:U.onAccessibilityAction}),$=(0,_react.useMemo)(()=>(0,_mergeRefs.mergeRefs)(t,K.hostRef),[t,K.hostRef]),J=G||K.enabled,{style:Q,pressIn:X,pressOut:Y}=(0,_usePressAnimation.usePressAnimation)({enabled:J}),Z=stylesFor(E),ee=Boolean(S),te=E.space[paddingMap[a]],ie=(0,_react.useMemo)(()=>q?"string"==typeof q?E.settings.gradients[q]??null:q:null,[q,E.settings.gradients]),se="flat"===s,re=se?E.radius.none:z??E.radius[n],ne=resolveBackground(E,l),[ae,oe]=(0,_useControllableState.useControllableState)({value:p,defaultValue:b,onChange:g}),le=_&&ae,ce=hasBuiltInHeaderContent(e),de=Boolean(c)||ce,ue=(0,_SquircleFill.useSquircle)(!ee&&!ie&&!se,re,D),he=_reactNative.StyleSheet.flatten([L,M])??{},xe=he.backgroundColor,me=he.borderColor,pe=xe??ne??("filled"===s?E.colors["bg-subtle"]:E.colors.surface),be="outlined"===s?E.size.border:0,ge=me??E.colors.border,ye="none"===r?void 0:E.shadow[r],je="elevated"===s&&(0,_shadows.supportsBoxShadow)()&&ye?(0,_shadows.toBoxShadow)(ye):void 0,ve=ue.active&&"elevated"===s&&!je,Re=ue.active&&!ve?{backgroundColor:"transparent",borderColor:"transparent"}:null,fe=(0,_react.useMemo)(()=>{const e={borderRadius:ve&&ue.size?(0,_squircle.squircleHostRadius)(ue.size.width,ue.size.height,re):re,..._corners.smoothCorners,padding:ee?E.space.none:te,overflow:ue.active?"visible":"hidden"};switch(s){case"flat":return{...e,backgroundColor:ne??E.colors.surface,borderBottomWidth:R,borderBottomColor:E.colors.border};case"outlined":return{...e,backgroundColor:ue.active?"transparent":ne??E.colors.surface,borderWidth:E.size.border,borderColor:ue.active?"transparent":E.colors.border};case"filled":return{...e,backgroundColor:ue.active?"transparent":ne??E.colors["bg-subtle"]};default:return{...e,backgroundColor:ne??E.colors.surface,...je?{boxShadow:je}:ye}}},[E,s,ye,re,ee,te,ue.active,ue.size,je,ve,ne,R]),Se=(0,_react.useMemo)(()=>({..."number"==typeof w?{width:"100%",aspectRatio:w}:{width:"100%",height:C},borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomLeftRadius:E.radius.none,borderBottomRightRadius:E.radius.none,..._corners.smoothCorners}),[E,re,w,C]),Ce="string"==typeof d?d:"",we=(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:Z.titleColumn,children:["string"==typeof d?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"title",accessibilityRole:"header",style:titleFaceFor(E,u),children:d}):d,h?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"bodySmall",style:Z.lead,children:h}):null,le&&y?(0,_jsxRuntime.jsx)(_index3.Text,{variant:"caption",style:Z.lead,children:y}):null]}),isCardTextAction(x)?(0,_jsxRuntime.jsx)(CardTextActionButton,{action:x,haptic:F}):x?(0,_jsxRuntime.jsx)(_reactNative.View,{style:Z.actionNode,children:x}):null,m,_?(0,_jsxRuntime.jsx)(CardIconAction,{icon:le?"chevron-down":"chevron-up",label:`${le?"Show":"Hide"} ${Ce}`.trim(),expanded:!le,onPress:()=>oe(!le),haptic:F}):null,j?(0,_jsxRuntime.jsx)(CardIconAction,{icon:"trash",label:v,onPress:j,color:E.colors["danger-text"],haptic:F}):null]}),Ae=(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[de?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[Z.header,!c&&Z.headerRow,le&&Z.headerFolded,V],children:c??we}):null,le?null:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[de||f?Z.body:null,H],children:i}),f&&!le?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[Z.footer,O],children:f}):null]}),Ne=ee?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:Z.imageWrapper,children:[(0,_jsxRuntime.jsx)(_reactNative.Image,{source:S,resizeMode:"cover",style:Se,accessibilityLabel:"",accessible:!1}),A?(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"box-none",style:Z.imageOverlay,children:A}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:{padding:te},children:Ae})]}):Ae,qe=ie?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_index.Gradient,{gradient:ie,style:_reactNative.StyleSheet.absoluteFill}),Ne]}):ue.active&&ue.size?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:ue.size.width,height:ue.size.height,radius:re,fill:pe,stroke:be?ge:void 0,strokeWidth:be,outset:be}),Ne]}):Ne;let ke;if(J){const handlePress=e=>{G&&(F&&(0,_hapticUtils.triggerHaptic)(F),k?.(e))};ke=(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:Q,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{ref:$,onPress:handlePress,onPressIn:X,onPressOut:Y,android_ripple:{color:E.colors["surface-pressed"],borderless:!1},accessibilityRole:I??(G?"button":void 0),accessibilityLabel:B,accessibilityHint:P,testID:W,onLayout:ue.onLayout,style:[fe,L,M,Re],...U,...K.hostProps,children:qe})})}else ke=(0,_jsxRuntime.jsx)(_reactNative.View,{ref:t,accessibilityLabel:B,accessibilityHint:P,accessibilityRole:I,testID:W,onLayout:ue.onLayout,style:[fe,L,M,Re],...U,children:qe});return N?(0,_jsxRuntime.jsx)(CardSkeleton,{...e}):K.enabled?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[ke,K.renderSurface((0,_jsxRuntime.jsx)(_reactNative.View,{style:[fe,L,M,Re,Z.preview],children:qe}))]}):ke}));Card.displayName="Card";const CardSkeleton=({variant:e="elevated",elevation:t,radius:i="lg",padding:s="md",bg:r,header:n,footer:a,imageSource:o,imageHeight:l=160,imageAspectRatio:c,borderRadius:d,containerStyle:u,headerStyle:h,bodyStyle:x,footerStyle:m,style:_,...p})=>{const b=(0,_index.useTheme)(),g=paddingMap[s],y=b.space[g],j="flat"===e?b.radius.none:d??b.radius[i],v=void 0!==n||hasBuiltInHeaderContent(p),R=resolveBackground(b,r)??b.colors.surface,f="outlined"===e?1:0,S="outlined"===e?b.colors.border:void 0;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[{backgroundColor:R,borderRadius:j,..._corners.smoothCorners,borderWidth:f,borderColor:S,overflow:"hidden"},u,_],accessibilityRole:"progressbar",accessibilityLabel:"Loading",accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==o?(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:"100%",height:c?void 0:l,style:c?{aspectRatio:c,width:"100%"}:void 0}):null,v?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{padding:y,paddingBottom:b.space.sm},h],children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{shape:"text",width:"60%",height:18})}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{padding:y},x],children:(0,_jsxRuntime.jsx)(_index2.SkeletonText,{lines:3,fontSize:b.text.base.size,lastLineWidth:"55%"})}),void 0!==a?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{padding:y,paddingTop:b.space.sm,flexDirection:"row"},m],children:(0,_jsxRuntime.jsx)(_index2.Skeleton,{width:88,height:32,shape:"rounded"})}):null]})};CardSkeleton.displayName="CardSkeleton",Card.Skeleton=CardSkeleton;const hasBuiltInHeaderContent=e=>Boolean(e.title||e.lead||e.action||e.headerActions||e.collapsible||e.onRemove),isCardTextAction=e=>"object"==typeof e&&null!==e&&!_react.default.isValidElement(e)&&"label"in e&&"onPress"in e,HIT_TARGET=44,CardIconAction=({icon:e,label:t,onPress:i,expanded:s,color:r,haptic:n})=>{const a=(0,_index.useTheme)();return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:t,accessibilityState:void 0===s?void 0:{expanded:s},"aria-expanded":s,onPress:()=>{n&&(0,_hapticUtils.triggerHaptic)(n),i()},style:iconActionStyle,children:(0,_jsxRuntime.jsx)(_AppIcon.AppIcon,{name:e,size:20,color:r??a.colors["text-body"]})})},CardTextActionButton=({action:e,haptic:t})=>{const i=(0,_index.useTheme)();return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,onPress:()=>{t&&(0,_hapticUtils.triggerHaptic)(t),e.onPress()},style:textActionStyle,children:(0,_jsxRuntime.jsx)(_index3.Text,{variant:"label",weight:"semibold",color:i.colors.primary,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?(0,_index.fontFor)(e,"semibold","display"):{fontFamily:void 0,...(0,_index.fontFor)(e,"semibold")},resolveBackground=(e,t)=>{if(null!=t)return BACKGROUND_TOKENS.includes(t)?e.colors[t]:t},buildStyles=e=>_reactNative.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:{..._reactNative.StyleSheet.absoluteFill},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=(0,_themeStyles.themeStyles)(buildStyles);var _default=exports.default=Card;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Composer=void 0;var _react=require("react"),_reactNative=require("react-native"),_reactNativeKeyboardController=require("react-native-keyboard-controller"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_useControllableState=require("../../hooks/useControllableState.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_FieldBase=require("../FieldBase/FieldBase.js"),_index2=require("../IconButton/index.js"),_jsxRuntime=require("react/jsx-runtime");const MIN_BOX=44,Composer=exports.Composer=(0,_react.forwardRef)(({onSend:e,value:t,onChangeText:a,placeholder:o="Message",accessibilityLabel:r,sendLabel:i="Send",busy:s=!1,disabled:l=!1,maxLength:n,maxLines:d=5,leading:c,trailing:u,above:b,below:x,keyboardAware:p=!0,keyboardOffset:m,safeArea:_=!0,autoFocus:h,haptic:g,style:v,testID:C},f)=>{const y=(0,_index.useTheme)(),S=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),j=(0,_react.useMemo)(()=>buildStyles(y),[y]),[N,w]=(0,_useControllableState.useControllableState)({value:t,defaultValue:"",onChange:a}),k=N.trim(),q=s||l||""===k,I=_?S.bottom:0,R=m??I,T=(0,_FieldBase.resolveFieldTextStyle)(y,{disabled:l}),B=y.text.base.size,F=Math.round(B*y.leading.normal),z=(44-F)/2,D=F*d+2*z,[L,M]=(0,_react.useState)(void 0),V=(0,_react.useCallback)(e=>{const t=e.nativeEvent.contentSize.height+2*z;M(Math.min(Math.max(t,44),D))},[z,D]),A=(0,_react.useCallback)(()=>{q||(w(""),e(k))},[q,w,e,k]),H=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[j.bar,{paddingBottom:y.space.sm+I},v],testID:C,children:[b,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:j.row,children:[c,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[j.box,l?j.boxDisabled:null],children:(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:f,value:N,onChangeText:w,multiline:!0,maxLength:n,editable:!l,autoFocus:h,placeholder:o,placeholderTextColor:T.placeholderColor,selectionColor:y.colors["field-caret"],accessibilityLabel:r??o,accessibilityState:{disabled:l},"aria-disabled":l,onContentSizeChange:"web"===_reactNative.Platform.OS?V:void 0,style:[j.input,{color:T.color,...T.weightStyle,fontSize:B,lineHeight:F,paddingVertical:z,maxHeight:D,height:"web"===_reactNative.Platform.OS?L:void 0}],testID:C?`${C}-input`:void 0})}),u,(0,_jsxRuntime.jsx)(_index2.IconButton,{icon:"send",accessibilityLabel:i,variant:"solid",tone:"primary",disabled:q,loading:s,haptic:g,onPress:A,testID:C?`${C}-send`:void 0})]}),x]});return p?(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardStickyView,{offset:{closed:0,opened:R},children:H}):H});Composer.displayName="Composer";const buildStyles=e=>_reactNative.StyleSheet.create({bar:{gap:e.space.xs,paddingHorizontal:e.space.md,paddingTop:e.space.sm,backgroundColor:e.colors.bg,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:e.colors["border-subtle"]},row:{flexDirection:"row",alignItems:"flex-end",gap:e.space.sm},box:{flex:1,minHeight:44,justifyContent:"center",backgroundColor:e.colors["field-bg"],borderRadius:e.radius.pill,..._corners.smoothCorners,paddingHorizontal:e.space.md},boxDisabled:{backgroundColor:e.colors["field-bg-disabled"]},input:{margin:e.space.none,paddingHorizontal:e.space.none,includeFontPadding:!1,textAlignVertical:"top"}});var _default=exports.default=Composer;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Composer=void 0;var _react=require("react"),_reactNative=require("react-native"),_reactNativeKeyboardController=require("react-native-keyboard-controller"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_useControllableState=require("../../hooks/useControllableState.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_FieldBase=require("../FieldBase/FieldBase.js"),_index2=require("../IconButton/index.js"),_jsxRuntime=require("react/jsx-runtime");const MIN_BOX=44,Composer=exports.Composer=(0,_react.forwardRef)(({onSend:e,value:t,onChangeText:a,placeholder:o="Message",accessibilityLabel:r,sendLabel:i="Send",busy:s=!1,disabled:l=!1,maxLength:n,maxLines:d=5,leading:c,trailing:u,above:b,below:x,keyboardAware:p=!0,keyboardOffset:m,safeArea:_=!0,autoFocus:h,haptic:g,style:v,testID:C},y)=>{const f=(0,_index.useTheme)(),S=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),j=(0,_react.useMemo)(()=>buildStyles(f),[f]),[N,w]=(0,_useControllableState.useControllableState)({value:t,defaultValue:"",onChange:a}),k=N.trim(),q=s||l||""===k,I=_?S.bottom:0,R=m??I,T=(0,_FieldBase.resolveFieldTextStyle)(f,{disabled:l}),B=f.text.base.size,F=Math.round(B*f.leading.body),z=(44-F)/2,D=F*d+2*z,[L,M]=(0,_react.useState)(void 0),V=(0,_react.useCallback)(e=>{const t=e.nativeEvent.contentSize.height+2*z;M(Math.min(Math.max(t,44),D))},[z,D]),A=(0,_react.useCallback)(()=>{q||(w(""),e(k))},[q,w,e,k]),H=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[j.bar,{paddingBottom:f.space.sm+I},v],testID:C,children:[b,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:j.row,children:[c,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[j.box,l?j.boxDisabled:null],children:(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:y,value:N,onChangeText:w,multiline:!0,maxLength:n,editable:!l,autoFocus:h,placeholder:o,placeholderTextColor:T.placeholderColor,selectionColor:f.colors["field-caret"],accessibilityLabel:r??o,accessibilityState:{disabled:l},"aria-disabled":l,onContentSizeChange:"web"===_reactNative.Platform.OS?V:void 0,style:[j.input,{color:T.color,...T.weightStyle,fontSize:B,lineHeight:F,paddingVertical:z,maxHeight:D,height:"web"===_reactNative.Platform.OS?L:void 0}],testID:C?`${C}-input`:void 0})}),u,(0,_jsxRuntime.jsx)(_index2.IconButton,{icon:"send",accessibilityLabel:i,variant:"solid",tone:"primary",disabled:q,loading:s,haptic:g,onPress:A,testID:C?`${C}-send`:void 0})]}),x]});return p?(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardStickyView,{offset:{closed:0,opened:R},children:H}):H});Composer.displayName="Composer";const buildStyles=e=>_reactNative.StyleSheet.create({bar:{gap:e.space.xs,paddingHorizontal:e.space.md,paddingTop:e.space.sm,backgroundColor:e.colors.bg,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:e.colors["border-subtle"]},row:{flexDirection:"row",alignItems:"flex-end",gap:e.space.sm},box:{flex:1,minHeight:44,justifyContent:"center",backgroundColor:e.colors["field-bg"],borderRadius:e.radius.pill,..._corners.smoothCorners,paddingHorizontal:e.space.md},boxDisabled:{backgroundColor:e.colors["field-bg-disabled"]},input:{margin:e.space.none,paddingHorizontal:e.space.none,includeFontPadding:!1,textAlignVertical:"top"}});var _default=exports.default=Composer;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Dialog=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_color=require("../../utils/color.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_Modal=require("../Modal/Modal.js"),_jsxRuntime=require("react/jsx-runtime");const Dialog=e=>{const{visible:t,onClose:r,title:o,message:i,children:l,icon:s,variant:a="default",actions:n,dismissOnAction:c=!0,accessibilityLabel:d,contentStyle:u,containerStyle:b,titleStyle:g,messageStyle:m,iconWrapperStyle:x,actionsRowStyle:p,actionButtonStyle:_,actionTextStyle:y,haptic:h,testID:C}=e,f=(0,_index.useTheme)(),j=(0,_react.useMemo)(()=>buildStyles(f),[f]),S=(0,_react.useMemo)(()=>discFor(f,a),[f,a]),R=f.components.dialog["icon-wrapper-size"],v=f.components.dialog["action-button-min-height"],w=Boolean(n&&n.length>0),D=(0,_react.useCallback)(e=>{if(e.loading||e.disabled)return;const t=(0,_hapticUtils.resolveHaptic)(h,"selection");t&&(0,_hapticUtils.triggerHaptic)(t),c?(r(),setTimeout(e.onPress,_Modal.MODAL_DISMISS_GRACE_MS)):e.onPress()},[c,r,h]);return(0,_jsxRuntime.jsx)(_Modal.Modal,{visible:t,onRequestClose:r,haptic:h,presentation:"centered",accessibilityLabel:d??o,contentStyle:u,testID:C,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{accessibilityRole:"alert",accessibilityLabel:d??o,style:[j.container,b],children:[s?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[j.iconWrapper,{width:R,height:R,borderRadius:f.radius.pill,..._corners.smoothCorners,backgroundColor:S,marginBottom:f.space.md},x],children:s}):null,o?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[j.title,{color:f.colors["text-body"],fontSize:f.text.xl.size,...(0,_index.fontFor)(f,"semibold"),marginBottom:i||null!=l?f.space.sm:f.space.md},g],accessibilityRole:"header",children:o}):null,i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[j.message,{color:f.colors["text-muted"],fontSize:f.text.base.size,lineHeight:f.text.base.size*f.leading.normal,marginBottom:null!=l?f.space.md:w?f.space.lg:0},m],children:i}):null,null!=l?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{marginBottom:w?f.space.lg:0},children:l}):null,n&&n.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[j.actionsRow,p],children:n.map((e,t)=>{const r=e.tone??"primary",o=Boolean(e.disabled),i=actionStyleFor(f,r,o),l=t===n.length-1;return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>D(e),disabled:e.loading||o,accessibilityRole:"button",accessibilityLabel:e.label,accessibilityState:{busy:e.loading,disabled:Boolean(e.loading)||o},"aria-busy":e.loading,"aria-disabled":Boolean(e.loading)||o,style:({pressed:t})=>[j.actionButton,{minHeight:v,backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth,borderRadius:f.radius.md,..._corners.smoothCorners,paddingVertical:f.space.sm,paddingHorizontal:f.space.md,marginRight:l?0:f.space.sm,opacity:e.loading?.7:t&&!o?.85:1},_],children:e.loading?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"small",color:i.textColor}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[{color:i.textColor,fontSize:f.text.base.size,...(0,_index.fontFor)(f,"semibold"),textAlign:"center"},y],children:e.label})},`${e.label}-${t}`)})}):null]})})};exports.Dialog=Dialog,Dialog.displayName="Dialog";const SOFT_DISC_OPACITY=.14,discFor=(e,t)=>{const r=e.colors["bg-subtle"];switch(t){case"success":return(0,_color.tintOf)(e.colors.success,.14,r);case"warning":return(0,_color.tintOf)(e.colors.warning,.14,r);case"danger":return(0,_color.tintOf)(e.colors.danger,.14,r);case"info":return(0,_color.tintOf)(e.colors.info,.14,r);default:return e.colors["primary-soft"]}},actionStyleFor=(e,t,r)=>{if(r)return{backgroundColor:"neutral"===t?"transparent":e.colors["surface-disabled"],borderColor:"neutral"===t?e.colors.border:"transparent",borderWidth:"neutral"===t?1:0,textColor:e.colors["text-disabled"]};switch(t){case"primary":return{backgroundColor:e.colors.primary,borderColor:"transparent",borderWidth:0,textColor:e.colors["on-primary"]};case"info":return{backgroundColor:e.colors.info,borderColor:"transparent",borderWidth:0,textColor:e.colors["on-info"]};case"danger":return{backgroundColor:e.colors.danger,borderColor:"transparent",borderWidth:0,textColor:e.colors["on-danger"]};default:return{backgroundColor:"transparent",borderColor:e.colors.border,borderWidth:1,textColor:e.colors["text-body"]}}},buildStyles=e=>_reactNative.StyleSheet.create({container:{alignItems:"stretch"},iconWrapper:{alignItems:"center",justifyContent:"center",alignSelf:"center"},title:{textAlign:"center"},message:{textAlign:"center"},actionsRow:{flexDirection:"row",justifyContent:"flex-end",alignItems:"stretch"},actionButton:{flex:1,alignItems:"center",justifyContent:"center"}});var _default=exports.default=Dialog;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Dialog=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_color=require("../../utils/color.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_Modal=require("../Modal/Modal.js"),_jsxRuntime=require("react/jsx-runtime");const Dialog=e=>{const{visible:t,onClose:o,title:r,message:i,children:l,icon:s,variant:a="default",actions:n,dismissOnAction:c=!0,accessibilityLabel:d,contentStyle:u,containerStyle:b,titleStyle:g,messageStyle:m,iconWrapperStyle:x,actionsRowStyle:p,actionButtonStyle:_,actionTextStyle:y,haptic:h,testID:C}=e,f=(0,_index.useTheme)(),j=(0,_react.useMemo)(()=>buildStyles(f),[f]),S=(0,_react.useMemo)(()=>discFor(f,a),[f,a]),R=f.components.dialog["icon-wrapper-size"],v=f.components.dialog["action-button-min-height"],w=Boolean(n&&n.length>0),D=(0,_react.useCallback)(e=>{if(e.loading||e.disabled)return;const t=(0,_hapticUtils.resolveHaptic)(h,"selection");t&&(0,_hapticUtils.triggerHaptic)(t),c?(o(),setTimeout(e.onPress,_Modal.MODAL_DISMISS_GRACE_MS)):e.onPress()},[c,o,h]);return(0,_jsxRuntime.jsx)(_Modal.Modal,{visible:t,onRequestClose:o,haptic:h,presentation:"centered",accessibilityLabel:d??r,contentStyle:u,testID:C,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{accessibilityRole:"alert",accessibilityLabel:d??r,style:[j.container,b],children:[s?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[j.iconWrapper,{width:R,height:R,borderRadius:f.radius.pill,..._corners.smoothCorners,backgroundColor:S,marginBottom:f.space.md},x],children:s}):null,r?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[j.title,{color:f.colors["text-body"],fontSize:f.text.xl.size,...(0,_index.fontFor)(f,"semibold"),marginBottom:i||null!=l?f.space.sm:f.space.md},g],accessibilityRole:"header",children:r}):null,i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[j.message,{color:f.colors["text-muted"],fontSize:f.text.base.size,lineHeight:f.text.base.size*f.leading.body,marginBottom:null!=l?f.space.md:w?f.space.lg:0},m],children:i}):null,null!=l?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{marginBottom:w?f.space.lg:0},children:l}):null,n&&n.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[j.actionsRow,p],children:n.map((e,t)=>{const o=e.tone??"primary",r=Boolean(e.disabled),i=actionStyleFor(f,o,r),l=t===n.length-1;return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>D(e),disabled:e.loading||r,accessibilityRole:"button",accessibilityLabel:e.label,accessibilityState:{busy:e.loading,disabled:Boolean(e.loading)||r},"aria-busy":e.loading,"aria-disabled":Boolean(e.loading)||r,style:({pressed:t})=>[j.actionButton,{minHeight:v,backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth,borderRadius:f.radius.md,..._corners.smoothCorners,paddingVertical:f.space.sm,paddingHorizontal:f.space.md,marginRight:l?0:f.space.sm,opacity:e.loading?.7:t&&!r?.85:1},_],children:e.loading?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"small",color:i.textColor}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[{color:i.textColor,fontSize:f.text.base.size,...(0,_index.fontFor)(f,"semibold"),textAlign:"center"},y],children:e.label})},`${e.label}-${t}`)})}):null]})})};exports.Dialog=Dialog,Dialog.displayName="Dialog";const SOFT_DISC_OPACITY=.14,discFor=(e,t)=>{const o=e.colors["bg-subtle"];switch(t){case"success":return(0,_color.tintOf)(e.colors.success,.14,o);case"warning":return(0,_color.tintOf)(e.colors.warning,.14,o);case"danger":return(0,_color.tintOf)(e.colors.danger,.14,o);case"info":return(0,_color.tintOf)(e.colors.info,.14,o);default:return e.colors["primary-soft"]}},actionStyleFor=(e,t,o)=>{if(o)return{backgroundColor:"neutral"===t?"transparent":e.colors["surface-disabled"],borderColor:"neutral"===t?e.colors.border:"transparent",borderWidth:"neutral"===t?1:0,textColor:e.colors["text-disabled"]};switch(t){case"primary":return{backgroundColor:e.colors.primary,borderColor:"transparent",borderWidth:0,textColor:e.colors["on-primary"]};case"info":return{backgroundColor:e.colors.info,borderColor:"transparent",borderWidth:0,textColor:e.colors["on-info"]};case"danger":return{backgroundColor:e.colors.danger,borderColor:"transparent",borderWidth:0,textColor:e.colors["on-danger"]};default:return{backgroundColor:"transparent",borderColor:e.colors.border,borderWidth:1,textColor:e.colors["text-body"]}}},buildStyles=e=>_reactNative.StyleSheet.create({container:{alignItems:"stretch"},iconWrapper:{alignItems:"center",justifyContent:"center",alignSelf:"center"},title:{textAlign:"center"},message:{textAlign:"center"},actionsRow:{flexDirection:"row",justifyContent:"flex-end",alignItems:"stretch"},actionButton:{flex:1,alignItems:"center",justifyContent:"center"}});var _default=exports.default=Dialog;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.EmptyState=void 0;var _react=require("react"),_reactNative=require("react-native"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_SquircleFill=require("../SquircleFill/SquircleFill.js"),_jsxRuntime=require("react/jsx-runtime");const ActionButton=({action:e,variant:t})=>{const r=(0,_index.useTheme)(),{style:i,pressIn:s,pressOut:o}=(0,_usePressAnimation.usePressAnimation)({enabled:!0}),n=(0,_react.useMemo)(()=>buildActionStyles(r),[r]),a="primary"===t,l=(0,_SquircleFill.useSquircle)(!0,r.radius.md),fillFor=e=>a?e?r.colors["primary-hover"]:r.colors.primary:e?r.colors["surface-pressed"]:"transparent";return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:i,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>{(0,_hapticUtils.triggerHaptic)("selection"),e.onPress()},onPressIn:s,onPressOut:o,accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,accessibilityHint:e.accessibilityHint,testID:e.testID,onLayout:l.onLayout,style:({pressed:e})=>[n.button,a?n.buttonPrimary:n.buttonSecondary,e&&!l.active?a?n.buttonPrimaryPressed:n.buttonSecondaryPressed:null,l.active?n.buttonSquircleHost:null],children:({pressed:t})=>(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[l.active&&l.size?(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:l.size.width,height:l.size.height,radius:r.radius.md,fill:fillFor(t),stroke:a?void 0:r.colors.border,strokeWidth:a?0:1,outset:a?0:1}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[n.buttonText,a?n.buttonTextPrimary:n.buttonTextSecondary],numberOfLines:1,children:e.label})]})})})},EmptyState=exports.EmptyState=(0,_react.forwardRef)((e,t)=>{const{icon:r,title:i,description:s,action:o,secondaryAction:n,size:a="md",fill:l=!1,style:c,testID:u}=e,d=(0,_index.useTheme)(),m=(0,_react.useMemo)(()=>(0,_index.resolveEmptyStateSize)(d,a),[d,a]),x=(0,_react.useMemo)(()=>buildStyles(d),[d]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{ref:t,accessibilityRole:"summary",testID:u,style:[x.root,{paddingVertical:m["padding-y"]},l?x.fill:null,c],children:[r?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[x.iconCircle,{width:m.icon,height:m.icon,marginBottom:m["title-gap"],borderRadius:d.radius.pill,..._corners.smoothCorners}],children:r}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[x.title,{fontSize:m["title-text"],...(0,_index.fontFor)(d,"semibold")}],children:i}),s?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[x.description,{fontSize:m["description-text"],marginTop:m["description-gap"]}],children:s}):null,o||n?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:x.actions,children:[o?(0,_jsxRuntime.jsx)(ActionButton,{action:o,variant:"primary"}):null,n?(0,_jsxRuntime.jsx)(ActionButton,{action:n,variant:"secondary"}):null]}):null]})});EmptyState.displayName="EmptyState";const buildStyles=e=>_reactNative.StyleSheet.create({root:{alignItems:"center",justifyContent:"center",paddingHorizontal:e.space.lg},fill:{flexGrow:1},iconCircle:{backgroundColor:e.colors["surface-disabled"],alignItems:"center",justifyContent:"center"},title:{color:e.colors["text-body"],textAlign:"center"},description:{color:e.colors["text-muted"],textAlign:"center",maxWidth:320,lineHeight:e.text.base.size*e.leading.normal},actions:{flexDirection:"row",alignItems:"center",gap:e.space.sm,marginTop:e.space.lg}}),buildActionStyles=e=>_reactNative.StyleSheet.create({button:{paddingHorizontal:e.space.lg,paddingVertical:e.space.sm,minHeight:42,borderRadius:e.radius.md,..._corners.smoothCorners,overflow:"hidden",alignItems:"center",justifyContent:"center",flexDirection:"row"},buttonPrimary:{backgroundColor:e.colors.primary},buttonPrimaryPressed:{backgroundColor:e.colors["primary-hover"]},buttonSecondary:{backgroundColor:"transparent",borderWidth:1,borderColor:e.colors.border},buttonSecondaryPressed:{backgroundColor:e.colors["surface-pressed"]},buttonSquircleHost:{backgroundColor:"transparent",borderColor:"transparent",overflow:"visible"},buttonText:{fontSize:e.text.base.size,...(0,_index.fontFor)(e,"semibold")},buttonTextPrimary:{color:e.colors["on-primary"]},buttonTextSecondary:{color:e.colors["text-body"]}});var _default=exports.default=EmptyState;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.EmptyState=void 0;var _react=require("react"),_reactNative=require("react-native"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_SquircleFill=require("../SquircleFill/SquircleFill.js"),_jsxRuntime=require("react/jsx-runtime");const ActionButton=({action:e,variant:t})=>{const r=(0,_index.useTheme)(),{style:i,pressIn:s,pressOut:o}=(0,_usePressAnimation.usePressAnimation)({enabled:!0}),n=(0,_react.useMemo)(()=>buildActionStyles(r),[r]),a="primary"===t,l=(0,_SquircleFill.useSquircle)(!0,r.radius.md),fillFor=e=>a?e?r.colors["primary-hover"]:r.colors.primary:e?r.colors["surface-pressed"]:"transparent";return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:i,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>{(0,_hapticUtils.triggerHaptic)("selection"),e.onPress()},onPressIn:s,onPressOut:o,accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,accessibilityHint:e.accessibilityHint,testID:e.testID,onLayout:l.onLayout,style:({pressed:e})=>[n.button,a?n.buttonPrimary:n.buttonSecondary,e&&!l.active?a?n.buttonPrimaryPressed:n.buttonSecondaryPressed:null,l.active?n.buttonSquircleHost:null],children:({pressed:t})=>(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[l.active&&l.size?(0,_jsxRuntime.jsx)(_SquircleFill.SquircleFill,{width:l.size.width,height:l.size.height,radius:r.radius.md,fill:fillFor(t),stroke:a?void 0:r.colors.border,strokeWidth:a?0:1,outset:a?0:1}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[n.buttonText,a?n.buttonTextPrimary:n.buttonTextSecondary],numberOfLines:1,children:e.label})]})})})},EmptyState=exports.EmptyState=(0,_react.forwardRef)((e,t)=>{const{icon:r,title:i,description:s,action:o,secondaryAction:n,size:a="md",fill:l=!1,style:c,testID:u}=e,d=(0,_index.useTheme)(),m=(0,_react.useMemo)(()=>(0,_index.resolveEmptyStateSize)(d,a),[d,a]),y=(0,_react.useMemo)(()=>buildStyles(d),[d]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{ref:t,accessibilityRole:"summary",testID:u,style:[y.root,{paddingVertical:m["padding-y"]},l?y.fill:null,c],children:[r?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[y.iconCircle,{width:m.icon,height:m.icon,marginBottom:m["title-gap"],borderRadius:d.radius.pill,..._corners.smoothCorners}],children:r}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[y.title,{fontSize:m["title-text"],...(0,_index.fontFor)(d,"semibold")}],children:i}),s?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[y.description,{fontSize:m["description-text"],marginTop:m["description-gap"]}],children:s}):null,o||n?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:y.actions,children:[o?(0,_jsxRuntime.jsx)(ActionButton,{action:o,variant:"primary"}):null,n?(0,_jsxRuntime.jsx)(ActionButton,{action:n,variant:"secondary"}):null]}):null]})});EmptyState.displayName="EmptyState";const buildStyles=e=>_reactNative.StyleSheet.create({root:{alignItems:"center",justifyContent:"center",paddingHorizontal:e.space.lg},fill:{flexGrow:1},iconCircle:{backgroundColor:e.colors["surface-disabled"],alignItems:"center",justifyContent:"center"},title:{color:e.colors["text-body"],textAlign:"center"},description:{color:e.colors["text-muted"],textAlign:"center",maxWidth:320,lineHeight:e.text.base.size*e.leading.body},actions:{flexDirection:"row",alignItems:"center",gap:e.space.sm,marginTop:e.space.lg}}),buildActionStyles=e=>_reactNative.StyleSheet.create({button:{paddingHorizontal:e.space.lg,paddingVertical:e.space.sm,minHeight:42,borderRadius:e.radius.md,..._corners.smoothCorners,overflow:"hidden",alignItems:"center",justifyContent:"center",flexDirection:"row"},buttonPrimary:{backgroundColor:e.colors.primary},buttonPrimaryPressed:{backgroundColor:e.colors["primary-hover"]},buttonSecondary:{backgroundColor:"transparent",borderWidth:1,borderColor:e.colors.border},buttonSecondaryPressed:{backgroundColor:e.colors["surface-pressed"]},buttonSquircleHost:{backgroundColor:"transparent",borderColor:"transparent",overflow:"visible"},buttonText:{fontSize:e.text.base.size,...(0,_index.fontFor)(e,"semibold")},buttonTextPrimary:{color:e.colors["on-primary"]},buttonTextSecondary:{color:e.colors["text-body"]}});var _default=exports.default=EmptyState;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.IconButton=void 0;var _react=require("react"),_reactNative=require("react-native"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_color=require("../../utils/color.js"),_corners=require("../../utils/corners.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_index3=require("../Spinner/index.js"),_jsxRuntime=require("react/jsx-runtime");const GLASS_RIM_WIDTH=1,SOFT_FILL_OPACITY=.14,SIZE_MAP={sm:{diameter:32,icon:16},md:{diameter:40,icon:20},lg:{diameter:48,icon:24}},toneFor=(e,s)=>{switch(s){case"secondary":return{base:e.colors.neutral,on:e.colors["on-neutral"],fg:e.colors.neutral};case"success":return{base:e.colors.success,on:e.colors["on-success"],fg:e.colors["success-text"]};case"warning":return{base:e.colors.warning,on:e.colors["on-warning"],fg:e.colors["warning-text"]};case"danger":return{base:e.colors.danger,on:e.colors["on-danger"],fg:e.colors["danger-text"]};case"neutral":return{base:e.colors["bg-muted"],on:e.colors["text-body"],fg:e.colors["text-body"]};default:return{base:e.colors.primary,on:e.colors["on-primary"],fg:e.colors.primary}}},IconButton=exports.IconButton=(0,_react.forwardRef)((e,s)=>{const{icon:r,iconVariant:o,onPress:t,accessibilityLabel:n,tone:i="primary",variant:a="solid",size:c="md",shape:l="circle",active:d=!1,disabled:u=!1,loading:b=!1,haptic:_,style:m,testID:x}=e,g=(0,_index.useTheme)(),p=SIZE_MAP[c],y=u||b,{style:f,pressIn:I,pressOut:j}=(0,_usePressAnimation.usePressAnimation)({scaleTo:.92,enabled:!y}),{base:h,on:P,fg:v}=toneFor(g,i),S=d?"solid":a;let q="transparent",A="transparent",w=0,R=y?g.colors["text-disabled"]:v;"solid"===S?(q=y?g.colors["surface-disabled"]:h,R=y?g.colors["text-disabled"]:P):"soft"===S?q=y?g.colors["surface-disabled"]:(0,_color.tintOf)(h,.14,g.colors["bg-subtle"]):"outline"===S?(A=y?g.colors.border:h,w=g.size.border):"glass"===S&&(q=g.colors["glass-fill"],A=g.colors["glass-border"],w=1,R=y?g.colors["text-disabled"]:g.colors["on-glass"]);const B={color:R,size:p.icon,disabled:y},C="circle"===l?p.diameter/2:g.radius.md;return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{ref:s,onPress:e=>{if(y)return;const s=(0,_index2.resolveHaptic)(_,"selection");s&&(0,_index2.triggerHaptic)(s),t?.(e)},onPressIn:I,onPressOut:j,disabled:y,accessibilityRole:"button",accessibilityLabel:n,accessibilityState:{disabled:y,selected:d},"aria-disabled":y,"aria-selected":d,hitSlop:6,testID:x,style:({pressed:e})=>[styles.base,{width:p.diameter,height:p.diameter,borderRadius:C,..._corners.smoothCorners,backgroundColor:q,borderColor:A,borderWidth:w,opacity:e&&"solid"!==S?.7:1},m],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.content,f],children:b?(0,_jsxRuntime.jsx)(_index3.Spinner,{size:"sm",color:R}):(0,_slotIcon.renderSlotIcon)(r,B,o)})})});IconButton.displayName="IconButton";const styles=_reactNative.StyleSheet.create({base:{alignItems:"center",justifyContent:"center"},content:{alignItems:"center",justifyContent:"center"}});var _default=exports.default=IconButton;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.IconButton=void 0;var _react=require("react"),_reactNative=require("react-native"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_color=require("../../utils/color.js"),_corners=require("../../utils/corners.js"),_hitSlop=require("../../utils/hitSlop.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_index3=require("../Spinner/index.js"),_jsxRuntime=require("react/jsx-runtime");const GLASS_RIM_WIDTH=1,HIT_SLOP=6,SOFT_FILL_OPACITY=.14,SIZE_MAP={sm:{diameter:32,icon:16},md:{diameter:40,icon:20},lg:{diameter:48,icon:24}},toneFor=(e,s)=>{switch(s){case"secondary":return{base:e.colors.neutral,on:e.colors["on-neutral"],fg:e.colors.neutral};case"success":return{base:e.colors.success,on:e.colors["on-success"],fg:e.colors["success-text"]};case"warning":return{base:e.colors.warning,on:e.colors["on-warning"],fg:e.colors["warning-text"]};case"danger":return{base:e.colors.danger,on:e.colors["on-danger"],fg:e.colors["danger-text"]};case"neutral":return{base:e.colors["bg-muted"],on:e.colors["text-body"],fg:e.colors["text-body"]};default:return{base:e.colors.primary,on:e.colors["on-primary"],fg:e.colors.primary}}},IconButton=exports.IconButton=(0,_react.forwardRef)((e,s)=>{const{icon:r,iconVariant:o,onPress:t,accessibilityLabel:n,tone:i="primary",variant:a="solid",size:c="md",shape:l="circle",active:d=!1,disabled:u=!1,loading:b=!1,haptic:_,style:m,testID:x}=e,p=(0,_index.useTheme)(),g=SIZE_MAP[c],y=u||b,{style:I,pressIn:f,pressOut:h}=(0,_usePressAnimation.usePressAnimation)({scaleTo:.92,enabled:!y}),{base:j,on:S,fg:P}=toneFor(p,i),v=d?"solid":a;let q="transparent",A="transparent",w=0,R=y?p.colors["text-disabled"]:P;"solid"===v?(q=y?p.colors["surface-disabled"]:j,R=y?p.colors["text-disabled"]:S):"soft"===v?q=y?p.colors["surface-disabled"]:(0,_color.tintOf)(j,.14,p.colors["bg-subtle"]):"outline"===v?(A=y?p.colors.border:j,w=p.size.border):"glass"===v&&(q=p.colors["glass-fill"],A=p.colors["glass-border"],w=1,R=y?p.colors["text-disabled"]:p.colors["on-glass"]);const O={color:R,size:g.icon,disabled:y},B="circle"===l?g.diameter/2:p.radius.md;return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{ref:s,onPress:e=>{if(y)return;const s=(0,_index2.resolveHaptic)(_,"selection");s&&(0,_index2.triggerHaptic)(s),t?.(e)},onPressIn:f,onPressOut:h,disabled:y,accessibilityRole:"button",accessibilityLabel:n,accessibilityState:{disabled:y,selected:d},"aria-disabled":y,"aria-selected":d,hitSlop:6,...(0,_hitSlop.hitSlopMarker)(6),testID:x,style:({pressed:e})=>[styles.base,{width:g.diameter,height:g.diameter,borderRadius:B,..._corners.smoothCorners,backgroundColor:q,borderColor:A,borderWidth:w,opacity:e&&"solid"!==v?.7:1},m],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.content,I],children:b?(0,_jsxRuntime.jsx)(_index3.Spinner,{size:"sm",color:R}):(0,_slotIcon.renderSlotIcon)(r,O,o)})})});IconButton.displayName="IconButton";const styles=_reactNative.StyleSheet.create({base:{alignItems:"center",justifyContent:"center"},content:{alignItems:"center",justifyContent:"center"}});var _default=exports.default=IconButton;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Input=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../hooks/index.js"),_index2=require("../../theme/index.js"),_index3=require("../../utils/index.js"),_defaultIcons=require("../AppIcon/defaultIcons.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_index4=require("../Button/index.js"),_FieldBase=require("../FieldBase/FieldBase.js"),_useFloatingLabel=require("../FieldBase/useFloatingLabel.js"),_Notation=require("../Notation/Notation.js"),_jsxRuntime=require("react/jsx-runtime");const Input=exports.Input=(0,_react.forwardRef)((e,t)=>{const{label:i,help:n,placeholder:a,value:o,onChangeText:s,error:r,helperText:l,type:d="input",secureTextEntry:c=!1,showPasswordToggle:u=!1,disabled:x=!1,multiline:p=!1,leftIcon:f,rightIcon:_,unit:g,unitStyle:m,prefix:v,prefixStyle:h,readOnly:j=!1,action:y,actionStyle:b,size:N="md",variant:R,labelMode:S,required:w=!1,maxLength:F,showCounter:I=!0,textAlign:T,format:V,parse:A,style:B,containerStyle:z,inputStyle:q,labelStyle:C,messageStyle:L,borderRadius:k,onFocus:D,onBlur:P,accessibilityLabel:H,testID:M,editable:O,...E}=e,G=(0,_index2.useTheme)(),W=(0,_react.useMemo)(()=>buildStyles(G),[G]),$=(0,_index2.resolveFieldSize)(G,N),X=G.components.input[N]["multiline-min-height"],J=Math.round(1.4*$.text),K=R??G.settings.components.input?.defaultVariant??G.settings.components.field?.defaultVariant??"outlined",Q=S??G.settings.components.input?.defaultLabelMode??"top",[U,Y]=(0,_react.useState)(!1),[Z,ee]=(0,_react.useState)(!1),te="password"===d||u||c,ie="password"===d||u,ne="textarea"===d||p,ae=ne?Math.round(.1*$.text):0,oe="string"==typeof o&&o.length>0,se=(0,_FieldBase.hasFieldText)(r),re=!0===r||se,le=(0,_FieldBase.hasFieldText)(l),de=se||!re&&le,ce=(0,_FieldBase.hasFieldText)(i),ue=(0,_FieldBase.hasFieldText)(v),xe=!x&&!1!==O,pe=U||oe||ue,fe=(0,_react.useRef)(null),ge=(0,_react.useMemo)(()=>(0,_index3.mergeRefs)(fe,t),[t]),me=(0,_react.useCallback)(()=>{xe&&fe.current?.focus()},[xe]),ve=ce&&"float"===Q,he=(0,_react.useRef)((0,_index2.createAnimatedValue)(0)).current,je=(0,_react.useRef)((0,_index2.createAnimatedValue)(de?1:0)).current;(0,_react.useEffect)(()=>{const e=_reactNative.Animated.timing(je,{toValue:de?1:0,duration:G.motion.duration.fast,easing:_reactNative.Easing.bezier(...G.motion.ease["in-out"]),useNativeDriver:!0});return e.start(),()=>e.stop()},[de,je,G.motion.duration.fast,G.motion.ease["in-out"]]);const ye=(0,_index.useReducedMotion)(),be=G.settings.components.input?.shakeOnError??!1,Ne=(0,_react.useRef)(re);(0,_react.useEffect)(()=>{if(!be)return void(Ne.current=re);let e;return re&&!Ne.current&&(ye||((0,_index2.setNativeValue)(he,0),e=_reactNative.Animated.sequence([_reactNative.Animated.timing(he,{toValue:1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:-1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:-1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:0,duration:100,useNativeDriver:!0})]),e.start()),(0,_index3.triggerHaptic)("notificationError")),Ne.current=re,()=>e?.stop()},[re,he,be,ye]);const Re=(0,_react.useCallback)(e=>{Y(!0),D?.(e)},[D]),Se=(0,_react.useCallback)(e=>{Y(!1),P?.(e)},[P]),we=(0,_react.useCallback)(()=>{(0,_index3.triggerHaptic)("selection"),ee(e=>!e)},[]),Fe=G.colors["field-caret"],Ie=k??$.radius,Te=G.settings.components.input?.tintLabelOnFocus??!1,Ve=U&&Te?G.colors["field-border-focus"]:G.colors["field-label"],Ae=he.interpolate({inputRange:[-1,0,1],outputRange:[-6,0,6]}),Be=Boolean(_)||Boolean(g)||ie,ze="underline"===K,qe=f?$.icon+G.space.md+1+G.space.md:0,Ce=(0,_useFloatingLabel.useFloatingLabel)({label:i,enabled:ve,floated:pe,required:w,variant:K,sizeTokens:$,leadingOffset:qe,trailingOffset:Be?$.icon+G.space.sm:0,textAlign:T,paddingLeft:ze?G.space.none:$["padding-x"],lineHeight:ne?J:void 0,restNudge:ae,floatTrim:ne?2:0,color:Ve,style:C}),Le=(0,_FieldBase.resolveFieldTextStyle)(G,{disabled:x}),ke=Le.color,De=Le.placeholderColor,Pe=w&&!ce&&!oe&&"string"==typeof a&&a.length>0,He=re?r:l,Me=I&&"number"==typeof F&&"string"==typeof o?`${o.length} / ${F}`:null,Oe=re?G.colors["field-message"]:G.colors["text-muted"],Ee=(0,_Notation.useNotationInk)(L,$["message-text"],Oe),Ge=H??(0,_FieldBase.fieldTextAsString)(i)??a,We=x?G.colors["field-icon-disabled"]:U?G.colors["field-icon-focus"]:G.colors["field-icon"],$e={focused:U,disabled:x,error:re,color:We,size:$.icon},renderSlot=e=>(0,_slotIcon.renderSlotIcon)(e,$e),Xe=(()=>{if(ie){const e=(Z?G.settings.icons.eyeOff:G.settings.icons.eye)??(Z?_defaultIcons.defaultIcons.eyeOff:_defaultIcons.defaultIcons.eye);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:we,disabled:!xe,hitSlop:8,accessibilityRole:"button",accessibilityLabel:Z?"Hide password":"Show password",children:e({size:$.icon,color:We})})}const e=g?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.unit,{fontSize:$.text,color:De},m],children:g}):null,t=_?(0,_jsxRuntime.jsx)(_reactNative.View,{children:renderSlot(_)}):null;return e&&t?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:W.trailingRow,children:[e,t]}):e??t})(),Je=f?(0,_jsxRuntime.jsx)(_reactNative.View,{children:renderSlot(f)}):null,Ke=_reactNative.StyleSheet.flatten(h),Qe=Ke?.fontSize??$.text,Ue=Ke?.color??De,Ye=(0,_react.useMemo)(()=>({fontSize:Qe,color:Ue}),[Qe,Ue]),Ze=ue?"string"==typeof v||"number"==typeof v?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.prefix,{fontSize:$.text,color:De,marginRight:G.space.xs,lineHeight:ne?J:void 0,paddingTop:ne?ae:void 0},h],children:v}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[W.prefixNode,{marginRight:G.space.xs,minHeight:ne?J:void 0,justifyContent:"center",paddingTop:ne?ae:void 0}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.prefix,{fontSize:$.text,color:De,lineHeight:ne?J:void 0},h],children:(0,_jsxRuntime.jsx)(_Notation.NotationInkContext.Provider,{value:Ye,children:v})})}):null,et=y?(0,_jsxRuntime.jsx)(_index4.Button,{variant:y.variant??"outline",tone:y.tone??"primary",size:N,title:y.label,leftIcon:y.icon,loading:y.loading,disabled:x||y.disabled,onPress:y.onPress,pressAnimation:!1,testID:y.testID,style:[W.action,{minHeight:$["min-height"],alignSelf:ne?"flex-start":"stretch"},b]}):null;return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[W.container,{transform:[{translateX:Ae}]},B],children:[ce&&!ve?(0,_jsxRuntime.jsx)(_FieldBase.FieldLabel,{size:N,required:w,help:n,color:Ve,style:C,children:i}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[W.fieldRow,{columnGap:G.space.sm,alignItems:ne?"flex-start":"stretch"}],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:W.fieldWrapper,children:[(0,_jsxRuntime.jsxs)(_FieldBase.FieldBase,{size:N,variant:K,focused:U,disabled:x,error:re,filled:oe,minHeight:ne?X:void 0,borderRadius:Ie,leading:Je,leadingDivider:null!=f,paddingLeft:ze?G.space.none:void 0,trailing:Xe,slotAlign:ne?"top":"center",slotLineHeight:ne?J:void 0,topNotch:Ce.topNotch,onPress:me,pressFeedback:!1,style:z,children:[Ze,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:W.inputWrap,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:ge,style:[W.input,{color:ke,fontSize:$.text,...Le.weightStyle,paddingLeft:ze?G.space.none:void 0,minHeight:ne?X-2*$["padding-y"]:void 0,lineHeight:ne?J:void 0,paddingTop:ne?ae:void 0,textAlignVertical:ne?"top":"center"},q],textAlign:T,placeholder:ve&&!pe||Pe?void 0:a,placeholderTextColor:De,value:V&&null!=o?V(o):o,onChangeText:e=>{s&&s(A?A(e):e)},onFocus:Re,onBlur:Se,editable:xe,readOnly:j,secureTextEntry:te&&!Z,multiline:ne,autoCapitalize:te?"none":void 0,autoCorrect:!te&&void 0,maxLength:F,selectionColor:Fe,accessibilityLabel:Ge,accessibilityState:{disabled:x},"aria-disabled":x,testID:M,...E}),Pe?(0,_jsxRuntime.jsx)(_FieldBase.RequiredPlaceholder,{text:a,color:De,fontSize:$.text,weightStyle:Le.weightStyle,align:ne?"top":"center",paddingTop:ne?ae:void 0,textAlign:T}):null]})]}),Ce.node]}),et]}),de||Me?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[W.footerRow,{marginTop:$["message-gap"]}],children:[de?(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[W.messageRow,{columnGap:G.space.xs,opacity:je}],accessibilityLiveRegion:re?"polite":"none",children:[re?(0,_jsxRuntime.jsx)(_FieldBase.FieldErrorGlyph,{size:$["message-text"],color:Oe}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.messageText,{color:Oe,fontSize:$["message-text"],...(0,_index2.fontFor)(G,"normal")},L],children:(0,_jsxRuntime.jsx)(_Notation.NotationInkContext.Provider,{value:Ee,children:He})})]}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:W.footerSpacer}),Me?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.counterText,{color:G.colors["text-subtle"],fontSize:$["message-text"],...(0,_index2.fontFor)(G,"normal")}],children:Me}):null]}):null]})});Input.displayName="Input";const buildStyles=e=>_reactNative.StyleSheet.create({container:{width:"100%"},fieldRow:{flexDirection:"row"},fieldWrapper:{position:"relative",overflow:"visible",flex:1},action:{flexShrink:0},input:{padding:e.space.none,margin:e.space.none,includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"},unit:{includeFontPadding:!1},trailingRow:{flexDirection:"row",alignItems:"center",columnGap:e.space.sm},footerRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",columnGap:e.space.sm},footerSpacer:{flex:1},messageRow:{flex:1,flexDirection:"row",alignItems:"center"},messageText:{flexShrink:1,includeFontPadding:!1},counterText:{flexShrink:0,includeFontPadding:!1}});var _default=exports.default=Input;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Input=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../hooks/index.js"),_index2=require("../../theme/index.js"),_index3=require("../../utils/index.js"),_defaultIcons=require("../AppIcon/defaultIcons.js"),_slotIcon=require("../AppIcon/slotIcon.js"),_index4=require("../Button/index.js"),_FieldBase=require("../FieldBase/FieldBase.js"),_useFloatingLabel=require("../FieldBase/useFloatingLabel.js"),_Notation=require("../Notation/Notation.js"),_jsxRuntime=require("react/jsx-runtime");const Input=exports.Input=(0,_react.forwardRef)((e,t)=>{const{label:i,help:n,placeholder:a,value:o,onChangeText:s,error:r,helperText:l,type:d="input",secureTextEntry:c=!1,showPasswordToggle:u=!1,disabled:x=!1,multiline:p=!1,leftIcon:f,rightIcon:g,unit:_,unitStyle:m,prefix:v,prefixStyle:h,readOnly:y=!1,action:j,actionStyle:b,size:N="md",variant:R,labelMode:S,required:w=!1,maxLength:F,showCounter:I=!0,textAlign:T,format:V,parse:A,style:B,containerStyle:z,inputStyle:q,labelStyle:C,messageStyle:L,borderRadius:k,onFocus:D,onBlur:P,accessibilityLabel:H,testID:M,editable:O,...E}=e,G=(0,_index2.useTheme)(),W=(0,_react.useMemo)(()=>buildStyles(G),[G]),$=(0,_index2.resolveFieldSize)(G,N),X=G.components.input[N]["multiline-min-height"],J=Math.round($.text*G.leading.body),K=R??G.settings.components.input?.defaultVariant??G.settings.components.field?.defaultVariant??"outlined",Q=S??G.settings.components.input?.defaultLabelMode??"top",[U,Y]=(0,_react.useState)(!1),[Z,ee]=(0,_react.useState)(!1),te="password"===d||u||c,ie="password"===d||u,ne="textarea"===d||p,ae=ne?Math.round(.1*$.text):0,oe="string"==typeof o&&o.length>0,se=(0,_FieldBase.hasFieldText)(r),re=!0===r||se,le=(0,_FieldBase.hasFieldText)(l),de=se||!re&&le,ce=(0,_FieldBase.hasFieldText)(i),ue=(0,_FieldBase.hasFieldText)(v),xe=!x&&!1!==O,pe=U||oe||ue,fe=(0,_react.useRef)(null),ge=(0,_react.useMemo)(()=>(0,_index3.mergeRefs)(fe,t),[t]),me=(0,_react.useCallback)(()=>{xe&&fe.current?.focus()},[xe]),ve=ce&&"float"===Q,he=(0,_react.useRef)((0,_index2.createAnimatedValue)(0)).current,ye=(0,_react.useRef)((0,_index2.createAnimatedValue)(de?1:0)).current;(0,_react.useEffect)(()=>{const e=_reactNative.Animated.timing(ye,{toValue:de?1:0,duration:G.motion.duration.fast,easing:_reactNative.Easing.bezier(...G.motion.ease["in-out"]),useNativeDriver:!0});return e.start(),()=>e.stop()},[de,ye,G.motion.duration.fast,G.motion.ease["in-out"]]);const je=(0,_index.useReducedMotion)(),be=G.settings.components.input?.shakeOnError??!1,Ne=(0,_react.useRef)(re);(0,_react.useEffect)(()=>{if(!be)return void(Ne.current=re);let e;return re&&!Ne.current&&(je||((0,_index2.setNativeValue)(he,0),e=_reactNative.Animated.sequence([_reactNative.Animated.timing(he,{toValue:1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:-1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:-1,duration:50,useNativeDriver:!0}),_reactNative.Animated.timing(he,{toValue:0,duration:100,useNativeDriver:!0})]),e.start()),(0,_index3.triggerHaptic)("notificationError")),Ne.current=re,()=>e?.stop()},[re,he,be,je]);const Re=(0,_react.useCallback)(e=>{Y(!0),D?.(e)},[D]),Se=(0,_react.useCallback)(e=>{Y(!1),P?.(e)},[P]),we=(0,_react.useCallback)(()=>{(0,_index3.triggerHaptic)("selection"),ee(e=>!e)},[]),Fe=G.colors["field-caret"],Ie=k??$.radius,Te=G.settings.components.input?.tintLabelOnFocus??!1,Ve=U&&Te?G.colors["field-border-focus"]:G.colors["field-label"],Ae=he.interpolate({inputRange:[-1,0,1],outputRange:[-6,0,6]}),Be=Boolean(g)||Boolean(_)||ie,ze="underline"===K,qe=f?$.icon+G.space.md+1+G.space.md:0,Ce=(0,_useFloatingLabel.useFloatingLabel)({label:i,enabled:ve,floated:pe,required:w,variant:K,sizeTokens:$,leadingOffset:qe,trailingOffset:Be?$.icon+G.space.sm:0,textAlign:T,paddingLeft:ze?G.space.none:$["padding-x"],lineHeight:ne?J:void 0,restNudge:ae,floatTrim:ne?2:0,color:Ve,style:C}),Le=(0,_FieldBase.resolveFieldTextStyle)(G,{disabled:x}),ke=Le.color,De=Le.placeholderColor,Pe=w&&!ce&&!oe&&"string"==typeof a&&a.length>0,He=re?r:l,Me=I&&"number"==typeof F&&"string"==typeof o?`${o.length} / ${F}`:null,Oe=re?G.colors["field-message"]:G.colors["text-muted"],Ee=(0,_Notation.useNotationInk)(L,$["message-text"],Oe),Ge=H??(0,_FieldBase.fieldTextAsString)(i)??a,We=x?G.colors["field-icon-disabled"]:U?G.colors["field-icon-focus"]:G.colors["field-icon"],$e={focused:U,disabled:x,error:re,color:We,size:$.icon},renderSlot=e=>(0,_slotIcon.renderSlotIcon)(e,$e),Xe=(()=>{if(ie){const e=(Z?G.settings.icons.eyeOff:G.settings.icons.eye)??(Z?_defaultIcons.defaultIcons.eyeOff:_defaultIcons.defaultIcons.eye);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:we,disabled:!xe,hitSlop:8,accessibilityRole:"button",accessibilityLabel:Z?"Hide password":"Show password",children:e({size:$.icon,color:We})})}const e=_?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.unit,{fontSize:$.text,color:De},m],children:_}):null,t=g?(0,_jsxRuntime.jsx)(_reactNative.View,{children:renderSlot(g)}):null;return e&&t?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:W.trailingRow,children:[e,t]}):e??t})(),Je=f?(0,_jsxRuntime.jsx)(_reactNative.View,{children:renderSlot(f)}):null,Ke=_reactNative.StyleSheet.flatten(h),Qe=Ke?.fontSize??$.text,Ue=Ke?.color??De,Ye=(0,_react.useMemo)(()=>({fontSize:Qe,color:Ue}),[Qe,Ue]),Ze=ue?"string"==typeof v||"number"==typeof v?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.prefix,{fontSize:$.text,color:De,marginRight:G.space.xs,lineHeight:ne?J:void 0,paddingTop:ne?ae:void 0},h],children:v}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[W.prefixNode,{marginRight:G.space.xs,minHeight:ne?J:void 0,justifyContent:"center",paddingTop:ne?ae:void 0}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.prefix,{fontSize:$.text,color:De,lineHeight:ne?J:void 0},h],children:(0,_jsxRuntime.jsx)(_Notation.NotationInkContext.Provider,{value:Ye,children:v})})}):null,et=j?(0,_jsxRuntime.jsx)(_index4.Button,{variant:j.variant??"outline",tone:j.tone??"primary",size:N,title:j.label,leftIcon:j.icon,loading:j.loading,disabled:x||j.disabled,onPress:j.onPress,pressAnimation:!1,testID:j.testID,style:[W.action,{minHeight:$["min-height"],alignSelf:ne?"flex-start":"stretch"},b]}):null;return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[W.container,{transform:[{translateX:Ae}]},B],children:[ce&&!ve?(0,_jsxRuntime.jsx)(_FieldBase.FieldLabel,{size:N,required:w,help:n,color:Ve,style:C,children:i}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[W.fieldRow,{columnGap:G.space.sm,alignItems:ne?"flex-start":"stretch"}],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:W.fieldWrapper,children:[(0,_jsxRuntime.jsxs)(_FieldBase.FieldBase,{size:N,variant:K,focused:U,disabled:x,error:re,filled:oe,minHeight:ne?X:void 0,borderRadius:Ie,leading:Je,leadingDivider:null!=f,paddingLeft:ze?G.space.none:void 0,trailing:Xe,slotAlign:ne?"top":"center",slotLineHeight:ne?J:void 0,topNotch:Ce.topNotch,onPress:me,pressFeedback:!1,style:z,children:[Ze,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:W.inputWrap,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:ge,style:[W.input,{color:ke,fontSize:$.text,...Le.weightStyle,paddingLeft:ze?G.space.none:void 0,minHeight:ne?X-2*$["padding-y"]:void 0,lineHeight:ne?J:void 0,paddingTop:ne?ae:void 0,textAlignVertical:ne?"top":"center"},q],textAlign:T,placeholder:ve&&!pe||Pe?void 0:a,placeholderTextColor:De,value:V&&null!=o?V(o):o,onChangeText:e=>{s&&s(A?A(e):e)},onFocus:Re,onBlur:Se,editable:xe,readOnly:y,secureTextEntry:te&&!Z,multiline:ne,autoCapitalize:te?"none":void 0,autoCorrect:!te&&void 0,maxLength:F,selectionColor:Fe,accessibilityLabel:Ge,accessibilityState:{disabled:x},"aria-disabled":x,testID:M,...E}),Pe?(0,_jsxRuntime.jsx)(_FieldBase.RequiredPlaceholder,{text:a,color:De,fontSize:$.text,weightStyle:Le.weightStyle,align:ne?"top":"center",paddingTop:ne?ae:void 0,textAlign:T}):null]})]}),Ce.node]}),et]}),de||Me?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[W.footerRow,{marginTop:$["message-gap"]}],children:[de?(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[W.messageRow,{columnGap:G.space.xs,opacity:ye}],accessibilityLiveRegion:re?"polite":"none",children:[re?(0,_jsxRuntime.jsx)(_FieldBase.FieldErrorGlyph,{size:$["message-text"],color:Oe}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.messageText,{color:Oe,fontSize:$["message-text"],...(0,_index2.fontFor)(G,"normal")},L],children:(0,_jsxRuntime.jsx)(_Notation.NotationInkContext.Provider,{value:Ee,children:He})})]}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:W.footerSpacer}),Me?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[W.counterText,{color:G.colors["text-subtle"],fontSize:$["message-text"],...(0,_index2.fontFor)(G,"normal")}],children:Me}):null]}):null]})});Input.displayName="Input";const buildStyles=e=>_reactNative.StyleSheet.create({container:{width:"100%"},fieldRow:{flexDirection:"row"},fieldWrapper:{position:"relative",overflow:"visible",flex:1},action:{flexShrink:0},input:{padding:e.space.none,margin:e.space.none,includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"},unit:{includeFontPadding:!1},trailingRow:{flexDirection:"row",alignItems:"center",columnGap:e.space.sm},footerRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",columnGap:e.space.sm},footerSpacer:{flex:1},messageRow:{flex:1,flexDirection:"row",alignItems:"center"},messageText:{flexShrink:1,includeFontPadding:!1},counterText:{flexShrink:0,includeFontPadding:!1}});var _default=exports.default=Input;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ProfileCompletion=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_index2=require("../AppIcon/index.js"),_index3=require("../Avatar/index.js"),_index4=require("../ProgressRing/index.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_AVATAR_SIZE=56,DEFAULT_RING_WIDTH=3,DEFAULT_RING_GAP=1,ProfileCompletion=exports.ProfileCompletion=(0,_react.forwardRef)((e,t)=>{const{progress:i,title:r,subtitle:s,description:o,source:n,ImageComponent:l,size:a=DEFAULT_AVATAR_SIZE,avatarTone:c="neutral",avatarBackgroundColor:d,avatarColor:u,ringWidth:m,ringGap:x=DEFAULT_RING_GAP,ringVariant:_="banded",tone:p,ringColor:g,animated:b=!0,showCompleteBadge:y=!0,trailing:f,accessibilityLabel:j,style:h,titleStyle:v,subtitleStyle:R,descriptionStyle:I,testID:N}=e,w=(0,_index.useTheme)(),A=(0,_react.useMemo)(()=>buildStyles(w),[w]),C=m??3,S=a+2*(x+C),T=Math.min(100,Math.max(0,Number.isNaN(i)?0:i)),D=Math.round(T),P=j??`${r}, profile ${D}% complete`,z=N??"profile-completion",L=y&&T>=100,V=Math.max(16,Math.round(.3*S)),G=S/2*(1+Math.SQRT1_2)-C/2,q=g??("banded"===_&&null==p||"success"===p?w.colors.success:"warning"===p?w.colors.warning:"danger"===p?w.colors.danger:w.colors.primary);return(0,_jsxRuntime.jsxs)(_reactNative.View,{ref:t,style:[A.root,h],testID:N,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:A.summary,accessible:!0,accessibilityRole:"summary",accessibilityLabel:P,accessibilityValue:{min:0,max:100,now:D},testID:`${z}-summary`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{width:S,height:S},children:[(0,_jsxRuntime.jsx)(_index4.ProgressRing,{progress:T/100,size:S,strokeWidth:C,tone:p??"primary",ringColor:g,colorByProgress:"banded"===_&&null==p&&null==g,animated:b,testID:`${z}-ring`,children:(0,_jsxRuntime.jsx)(_index3.Avatar,{name:r,source:n,ImageComponent:l,size:a,tone:c,backgroundColor:d,color:u,accessibilityLabel:`${r}'s avatar`})}),L?(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[A.badge,{width:V,height:V,borderRadius:w.radius.pill,..._corners.smoothCorners,left:G-V/2,top:G-V/2,backgroundColor:w.colors.surface}],testID:`${z}-complete-badge`,children:(0,_jsxRuntime.jsx)(_index2.AppIcon,{name:"verify",variant:"bold",size:V-2,color:q})}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:A.body,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.title,v],numberOfLines:2,children:r}),s?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.subtitle,R],numberOfLines:1,children:s}):null,o?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.description,I],children:o}):null]})]}),null!=f?(0,_jsxRuntime.jsx)(_reactNative.View,{style:A.trailing,children:f}):null]})});ProfileCompletion.displayName="ProfileCompletion";const buildStyles=e=>_reactNative.StyleSheet.create({root:{flexDirection:"row",alignItems:"center",columnGap:e.space.md},summary:{flex:1,flexDirection:"row",alignItems:"center",columnGap:e.space.md},body:{flex:1,rowGap:e.space.xxs},badge:{position:"absolute",alignItems:"center",justifyContent:"center"},title:{fontSize:e.text.xl.size,lineHeight:e.text.xl.size*e.leading.tight,color:e.colors["text-body"],...(0,_index.fontFor)(e,"semibold")},subtitle:{fontSize:e.text.sm.size,color:e.colors["text-subtle"],textTransform:"uppercase",letterSpacing:e["letter-spacing"].wide,...(0,_index.fontFor)(e,"medium")},description:{fontSize:e.text.base.size,color:e.colors["text-muted"],...(0,_index.fontFor)(e,"normal")},trailing:{alignSelf:"flex-start"}});var _default=exports.default=ProfileCompletion;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ProfileCompletion=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_index2=require("../AppIcon/index.js"),_index3=require("../Avatar/index.js"),_index4=require("../ProgressRing/index.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_AVATAR_SIZE=56,DEFAULT_RING_WIDTH=3,DEFAULT_RING_GAP=1,ProfileCompletion=exports.ProfileCompletion=(0,_react.forwardRef)((e,t)=>{const{progress:i,title:r,subtitle:s,description:n,source:o,ImageComponent:l,size:a=DEFAULT_AVATAR_SIZE,avatarTone:c="neutral",avatarBackgroundColor:d,avatarColor:u,ringWidth:m,ringGap:x=DEFAULT_RING_GAP,ringVariant:_="banded",tone:p,ringColor:g,animated:b=!0,showCompleteBadge:y=!0,trailing:f,accessibilityLabel:j,style:h,titleStyle:v,subtitleStyle:R,descriptionStyle:I,testID:N}=e,w=(0,_index.useTheme)(),A=(0,_react.useMemo)(()=>buildStyles(w),[w]),C=m??3,S=a+2*(x+C),T=Math.min(100,Math.max(0,Number.isNaN(i)?0:i)),D=Math.round(T),P=j??`${r}, profile ${D}% complete`,z=N??"profile-completion",L=y&&T>=100,V=Math.max(16,Math.round(.3*S)),G=S/2*(1+Math.SQRT1_2)-C/2,q=g??("banded"===_&&null==p||"success"===p?w.colors.success:"warning"===p?w.colors.warning:"danger"===p?w.colors.danger:w.colors.primary);return(0,_jsxRuntime.jsxs)(_reactNative.View,{ref:t,style:[A.root,h],testID:N,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:A.summary,accessible:!0,accessibilityRole:"summary",accessibilityLabel:P,accessibilityValue:{min:0,max:100,now:D},testID:`${z}-summary`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{width:S,height:S},children:[(0,_jsxRuntime.jsx)(_index4.ProgressRing,{progress:T/100,size:S,strokeWidth:C,tone:p??"primary",ringColor:g,colorByProgress:"banded"===_&&null==p&&null==g,animated:b,testID:`${z}-ring`,children:(0,_jsxRuntime.jsx)(_index3.Avatar,{name:r,source:o,ImageComponent:l,size:a,tone:c,backgroundColor:d,color:u,accessibilityLabel:`${r}'s avatar`})}),L?(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[A.badge,{width:V,height:V,borderRadius:w.radius.pill,..._corners.smoothCorners,left:G-V/2,top:G-V/2,backgroundColor:w.colors.surface}],testID:`${z}-complete-badge`,children:(0,_jsxRuntime.jsx)(_index2.AppIcon,{name:"verify",variant:"bold",size:V-2,color:q})}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:A.body,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.title,v],numberOfLines:2,children:r}),s?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.subtitle,R],numberOfLines:1,children:s}):null,n?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[A.description,I],children:n}):null]})]}),null!=f?(0,_jsxRuntime.jsx)(_reactNative.View,{style:A.trailing,children:f}):null]})});ProfileCompletion.displayName="ProfileCompletion";const buildStyles=e=>_reactNative.StyleSheet.create({root:{flexDirection:"row",alignItems:"center",columnGap:e.space.md},summary:{flex:1,flexDirection:"row",alignItems:"center",columnGap:e.space.md},body:{flex:1,rowGap:e.space.xxs},badge:{position:"absolute",alignItems:"center",justifyContent:"center"},title:{fontSize:e.text.xl.size,lineHeight:e.text.xl.size*e.leading.heading,color:e.colors["text-body"],...(0,_index.fontFor)(e,"semibold")},subtitle:{fontSize:e.text.sm.size,color:e.colors["text-subtle"],textTransform:"uppercase",letterSpacing:e["letter-spacing"].wide,...(0,_index.fontFor)(e,"medium")},description:{fontSize:e.text.base.size,color:e.colors["text-muted"],...(0,_index.fontFor)(e,"normal")},trailing:{alignSelf:"flex-start"}});var _default=exports.default=ProfileCompletion;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.RichTextEditor=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_corners=require("../../utils/corners.js"),_index3=require("../Skeleton/index.js"),_markdownActions=require("./markdownActions.js"),_jsxRuntime=require("react/jsx-runtime");const ACTION_META={bold:{glyph:"B",label:"Bold"},italic:{glyph:"I",label:"Italic"},strikethrough:{glyph:"S",label:"Strikethrough"},code:{glyph:"</>",label:"Inline code"},link:{glyph:"link",label:"Link"},heading1:{glyph:"H1",label:"Heading 1"},heading2:{glyph:"H2",label:"Heading 2"},bulletList:{glyph:"•",label:"Bulleted list"},numberedList:{glyph:"1.",label:"Numbered list"},quote:{glyph:">",label:"Quote"}},DEFAULT_ACTIONS=["bold","italic","strikethrough","code","link","heading1","heading2","bulletList","numberedList","quote"],DEFAULT_MIN_HEIGHT=160,RichTextEditor=exports.RichTextEditor=(0,_react.forwardRef)((e,t)=>{const{value:i,onChangeText:o,placeholder:l,actions:s=DEFAULT_ACTIONS,disabled:r=!1,loading:n=!1,minHeight:a=DEFAULT_MIN_HEIGHT,autoFocus:c=!1,accessibilityLabel:d,haptic:u,style:h,toolbarStyle:x,inputStyle:b,testID:_}=e,g=(0,_index.useTheme)(),m=(0,_react.useMemo)(()=>buildStyles(g),[g]),p=i??"",[y,j]=(0,_react.useState)({start:0,end:0}),[T,S]=(0,_react.useState)(!1),[k,R]=(0,_react.useState)(null),v=(0,_react.useCallback)(e=>{j(e.nativeEvent.selection),R(null)},[]),I=(0,_react.useCallback)(e=>{R(null),o?.(e)},[o]),C=(0,_react.useCallback)(e=>{if(r)return;const t=(0,_index2.resolveHaptic)(u,"selection");t&&(0,_index2.triggerHaptic)(t);const i=(0,_markdownActions.applyMarkdownAction)({text:p,selection:(0,_markdownActions.normalizeSelection)(y,p.length)},e);j(i.selection),R(i.selection),o?.(i.text)},[r,u,o,y,p]);return n?(0,_jsxRuntime.jsx)(RichTextEditorSkeleton,{actionCount:s.length,minHeight:a,style:h,testID:_}):(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:_,style:[m.container,{borderColor:T?g.colors["focus-ring"]:g.colors.border,opacity:r?.55:1},h],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[m.toolbar,x],children:s.map(e=>(0,_jsxRuntime.jsx)(ToolbarButton,{action:e,disabled:r,onPress:C,styles:m,theme:g,testID:_?`${_}-${e}`:void 0},e))}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:t,value:p,onChangeText:I,onSelectionChange:v,onFocus:()=>S(!0),onBlur:()=>S(!1),selection:k??void 0,editable:!r,autoFocus:c,multiline:!0,textAlignVertical:"top",placeholder:l,placeholderTextColor:g.colors["text-subtle"],accessibilityLabel:d,style:[m.input,{minHeight:a},b],testID:_?`${_}-input`:void 0})]})});RichTextEditor.displayName="RichTextEditor";const ToolbarButton=({action:e,disabled:t,onPress:i,styles:o,theme:l,testID:s})=>{const r=ACTION_META[e],n={color:t?l.colors["text-disabled"]:l.colors["text-body"]};return"bold"===e&&(n.fontWeight=l.weight.bold),"italic"===e&&(n.fontStyle="italic"),"strikethrough"===e&&(n.textDecorationLine="line-through"),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i(e),disabled:t,accessibilityRole:"button",accessibilityLabel:r.label,accessibilityState:{disabled:t},"aria-disabled":t,hitSlop:4,testID:s,style:({pressed:e})=>[o.button,{backgroundColor:e?l.colors["surface-pressed"]:l.colors["bg-subtle"]}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{allowFontScaling:!1,style:[o.buttonLabel,n],children:r.glyph})})};ToolbarButton.displayName="RichTextEditorToolbarButton";const RichTextEditorSkeleton=({actionCount:e,minHeight:t,style:i,testID:o})=>{const l=(0,_index.useTheme)(),s=(0,_react.useMemo)(()=>buildStyles(l),[l]),r=Array.from({length:Math.max(1,e)},(e,t)=>t);return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:o,style:[s.container,i],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:s.toolbar,children:r.map(e=>(0,_jsxRuntime.jsx)(_index3.Skeleton,{width:34,height:30,radius:"sm"},e))}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[s.skeletonBody,{minHeight:t}],children:[(0,_jsxRuntime.jsx)(_index3.Skeleton,{shape:"text",width:"94%",height:14}),(0,_jsxRuntime.jsx)(_index3.Skeleton,{shape:"text",width:"100%",height:14}),(0,_jsxRuntime.jsx)(_index3.Skeleton,{shape:"text",width:"72%",height:14})]})]})};RichTextEditorSkeleton.displayName="RichTextEditorSkeleton";const buildStyles=e=>_reactNative.StyleSheet.create({container:{borderWidth:e.size.border,borderColor:e.colors.border,borderRadius:e.radius.md,..._corners.smoothCorners,backgroundColor:e.colors.bg,overflow:"hidden"},toolbar:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,padding:e.space.xs,borderBottomWidth:_reactNative.StyleSheet.hairlineWidth,borderBottomColor:e.colors["border-subtle"],backgroundColor:e.colors["bg-subtle"]},button:{minWidth:34,height:30,paddingHorizontal:e.space.xs,borderRadius:e.radius.sm,..._corners.smoothCorners,alignItems:"center",justifyContent:"center"},buttonLabel:{...(0,_index.fontFor)(e,"medium"),fontSize:e.text.sm.size},input:{...(0,_index.fontFor)(e,"normal"),color:e.colors["text-body"],fontSize:e.text.base.size,lineHeight:1.5*e.text.base.size,paddingHorizontal:e.space.md,paddingVertical:e.space.sm},skeletonBody:{paddingHorizontal:e.space.md,paddingVertical:e.space.sm,gap:e.space.sm}});var _default=exports.default=RichTextEditor;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.RichTextEditor=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_corners=require("../../utils/corners.js"),_index3=require("../Skeleton/index.js"),_markdownActions=require("./markdownActions.js"),_jsxRuntime=require("react/jsx-runtime");const ACTION_META={bold:{glyph:"B",label:"Bold"},italic:{glyph:"I",label:"Italic"},strikethrough:{glyph:"S",label:"Strikethrough"},code:{glyph:"</>",label:"Inline code"},link:{glyph:"link",label:"Link"},heading1:{glyph:"H1",label:"Heading 1"},heading2:{glyph:"H2",label:"Heading 2"},bulletList:{glyph:"•",label:"Bulleted list"},numberedList:{glyph:"1.",label:"Numbered list"},quote:{glyph:">",label:"Quote"}},DEFAULT_ACTIONS=["bold","italic","strikethrough","code","link","heading1","heading2","bulletList","numberedList","quote"],DEFAULT_MIN_HEIGHT=160,TOOLBAR_GLYPH_MAX_SCALE=1.5,RichTextEditor=exports.RichTextEditor=(0,_react.forwardRef)((e,t)=>{const{value:i,onChangeText:o,placeholder:l,actions:s=DEFAULT_ACTIONS,disabled:r=!1,loading:n=!1,minHeight:a=DEFAULT_MIN_HEIGHT,autoFocus:c=!1,accessibilityLabel:d,haptic:u,style:h,toolbarStyle:x,inputStyle:b,testID:_}=e,m=(0,_index.useTheme)(),g=(0,_react.useMemo)(()=>buildStyles(m),[m]),p=i??"",[y,j]=(0,_react.useState)({start:0,end:0}),[S,T]=(0,_react.useState)(!1),[R,k]=(0,_react.useState)(null),v=(0,_react.useCallback)(e=>{j(e.nativeEvent.selection),k(null)},[]),C=(0,_react.useCallback)(e=>{k(null),o?.(e)},[o]),I=(0,_react.useCallback)(e=>{if(r)return;const t=(0,_index2.resolveHaptic)(u,"selection");t&&(0,_index2.triggerHaptic)(t);const i=(0,_markdownActions.applyMarkdownAction)({text:p,selection:(0,_markdownActions.normalizeSelection)(y,p.length)},e);j(i.selection),k(i.selection),o?.(i.text)},[r,u,o,y,p]);return n?(0,_jsxRuntime.jsx)(RichTextEditorSkeleton,{actionCount:s.length,minHeight:a,style:h,testID:_}):(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:_,style:[g.container,{borderColor:S?m.colors["focus-ring"]:m.colors.border,opacity:r?.55:1},h],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[g.toolbar,x],children:s.map(e=>(0,_jsxRuntime.jsx)(ToolbarButton,{action:e,disabled:r,onPress:I,styles:g,theme:m,testID:_?`${_}-${e}`:void 0},e))}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:t,value:p,onChangeText:C,onSelectionChange:v,onFocus:()=>T(!0),onBlur:()=>T(!1),selection:R??void 0,editable:!r,autoFocus:c,multiline:!0,textAlignVertical:"top",placeholder:l,placeholderTextColor:m.colors["text-subtle"],accessibilityLabel:d,style:[g.input,{minHeight:a},b],testID:_?`${_}-input`:void 0})]})});RichTextEditor.displayName="RichTextEditor";const ToolbarButton=({action:e,disabled:t,onPress:i,styles:o,theme:l,testID:s})=>{const r=ACTION_META[e],n={color:t?l.colors["text-disabled"]:l.colors["text-body"]};return"bold"===e&&(n.fontWeight=l.weight.bold),"italic"===e&&(n.fontStyle="italic"),"strikethrough"===e&&(n.textDecorationLine="line-through"),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i(e),disabled:t,accessibilityRole:"button",accessibilityLabel:r.label,accessibilityState:{disabled:t},"aria-disabled":t,hitSlop:4,testID:s,style:({pressed:e})=>[o.button,{backgroundColor:e?l.colors["surface-pressed"]:l.colors["bg-subtle"]}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:Math.min(l.settings.maxFontSizeMultiplier??1.5,1.5),style:[o.buttonLabel,n],children:r.glyph})})};ToolbarButton.displayName="RichTextEditorToolbarButton";const RichTextEditorSkeleton=({actionCount:e,minHeight:t,style:i,testID:o})=>{const l=(0,_index.useTheme)(),s=(0,_react.useMemo)(()=>buildStyles(l),[l]),r=Array.from({length:Math.max(1,e)},(e,t)=>t);return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:o,style:[s.container,i],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:s.toolbar,children:r.map(e=>(0,_jsxRuntime.jsx)(_index3.Skeleton,{width:34,height:30,radius:"sm"},e))}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[s.skeletonBody,{minHeight:t}],children:[(0,_jsxRuntime.jsx)(_index3.Skeleton,{shape:"text",width:"94%",height:14}),(0,_jsxRuntime.jsx)(_index3.Skeleton,{shape:"text",width:"100%",height:14}),(0,_jsxRuntime.jsx)(_index3.Skeleton,{shape:"text",width:"72%",height:14})]})]})};RichTextEditorSkeleton.displayName="RichTextEditorSkeleton";const buildStyles=e=>_reactNative.StyleSheet.create({container:{borderWidth:e.size.border,borderColor:e.colors.border,borderRadius:e.radius.md,..._corners.smoothCorners,backgroundColor:e.colors.bg,overflow:"hidden"},toolbar:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,padding:e.space.xs,borderBottomWidth:_reactNative.StyleSheet.hairlineWidth,borderBottomColor:e.colors["border-subtle"],backgroundColor:e.colors["bg-subtle"]},button:{minWidth:34,height:30,paddingHorizontal:e.space.xs,borderRadius:e.radius.sm,..._corners.smoothCorners,alignItems:"center",justifyContent:"center"},buttonLabel:{...(0,_index.fontFor)(e,"medium"),fontSize:e.text.sm.size},input:{...(0,_index.fontFor)(e,"normal"),color:e.colors["text-body"],fontSize:e.text.base.size,lineHeight:1.5*e.text.base.size,paddingHorizontal:e.space.md,paddingVertical:e.space.sm},skeletonBody:{paddingHorizontal:e.space.md,paddingVertical:e.space.sm,gap:e.space.sm}});var _default=exports.default=RichTextEditor;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveColor=exports.default=exports.Text=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_jsxRuntime=require("react/jsx-runtime");const VARIANTS={display:{size:"4xl",weight:"bold",line:"tight",color:"primary",heading:!0,fontFamily:"display"},h1:{size:"3xl",weight:"bold",line:"tight",color:"primary",heading:!0,fontFamily:"display"},h2:{size:"2xl",weight:"semibold",line:"tight",color:"primary",heading:!0,fontFamily:"display"},h3:{size:"xl",weight:"semibold",line:"tight",color:"primary",heading:!0},title:{size:"lg",weight:"semibold",line:"normal",color:"primary",fontFamily:"display"},body:{size:"base",weight:"normal",line:"normal",color:"primary"},bodySmall:{size:"sm",weight:"normal",line:"normal",color:"secondary"},caption:{size:"xs",weight:"normal",line:"normal",color:"tertiary"},label:{size:"sm",weight:"medium",line:"normal",color:"secondary"},overline:{size:"xs",weight:"semibold",line:"normal",color:"secondary",uppercase:!0,letterSpacing:"wide"}},TEXT_ROLE_COLOR={textStrong:"text",primary:"text-body",secondary:"text-muted",tertiary:"text-subtle",inverse:"text-inverse",disabled:"text-disabled",link:"link"},SEMANTIC={success:!0,warning:!0,danger:!0,info:!0},resolveColor=(e,t)=>Object.hasOwn(TEXT_ROLE_COLOR,t)?e.colors[TEXT_ROLE_COLOR[t]]:Object.hasOwn(SEMANTIC,t)?e.colors[`${t}-text`]:t;exports.resolveColor=resolveColor;const Text=exports.Text=(0,_react.forwardRef)((e,t)=>{const{variant:i="body",color:r,weight:o,size:l,align:n,italic:a,underline:s,style:c,children:d,...x}=e,m=(0,_index.useTheme)(),p=Object.hasOwn(VARIANTS,i),g=m.settings.textVariants,y=!p&&g&&Object.hasOwn(g,i)?g[i]:void 0,h=(0,_react.useMemo)(()=>{if(y){const e="string"==typeof l?l:y.size;return{fontSize:"number"==typeof l?l:m.text[e].size,lineHeight:y.lineHeight??("number"==typeof l?void 0:m.text[e].lineHeight),color:void 0!==r?resolveColor(m,r):y.color?m.colors[y.color]:resolveColor(m,"primary"),textAlign:n,textTransform:y.uppercase?"uppercase":void 0,letterSpacing:y.letterSpacing?m["letter-spacing"][y.letterSpacing]:void 0,fontStyle:a||y.italic?"italic":void 0,fontVariant:y.fontVariant,textDecorationLine:s?"underline":void 0,...(0,_index.fontFor)(m,o??y.weight??"normal",y.fontFamily)}}const e=VARIANTS[p?i:"body"],t="number"==typeof l?l:m.text[l??e.size].size;return{fontSize:t,lineHeight:Math.round(t*m.leading[e.line]),color:resolveColor(m,r??e.color),textAlign:n,textTransform:e.uppercase?"uppercase":void 0,letterSpacing:e.letterSpacing?m["letter-spacing"][e.letterSpacing]:void 0,fontStyle:a?"italic":void 0,textDecorationLine:s?"underline":void 0,...(0,_index.fontFor)(m,o??e.weight,e.fontFamily)}},[m,y,p,i,r,o,l,n,a,s]),u=p?VARIANTS[i].heading:y?.heading;return(0,_jsxRuntime.jsx)(_reactNative.Text,{ref:t,style:[h,c],maxFontSizeMultiplier:m.settings.maxFontSizeMultiplier,accessibilityRole:u?"header":x.accessibilityRole,...x,children:d})});Text.displayName="Text";var _default=exports.default=Text;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveColor=exports.default=exports.Text=void 0;var _react=require("react"),_reactNative=require("react-native"),_index=require("../../theme/index.js"),_warnInvalidValue=require("../../utils/warnInvalidValue.js"),_jsxRuntime=require("react/jsx-runtime");const VARIANTS={display:{size:"4xl",weight:"bold",line:"display",color:"primary",heading:!0,fontFamily:"display"},h1:{size:"3xl",weight:"bold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h2:{size:"2xl",weight:"semibold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h3:{size:"xl",weight:"semibold",line:"heading",color:"primary",heading:!0},title:{size:"lg",weight:"semibold",line:"body",color:"primary",fontFamily:"display"},body:{size:"base",weight:"normal",line:"body",color:"primary"},bodySmall:{size:"sm",weight:"normal",line:"body",color:"secondary"},caption:{size:"xs",weight:"normal",line:"body",color:"tertiary"},label:{size:"sm",weight:"medium",line:"body",color:"secondary"},overline:{size:"xs",weight:"semibold",line:"body",color:"secondary",uppercase:!0,letterSpacing:"wide"}},TEXT_ROLE_COLOR={textStrong:"text",primary:"text-body",secondary:"text-muted",tertiary:"text-subtle",inverse:"text-inverse",disabled:"text-disabled",link:"link"},SEMANTIC={success:!0,warning:!0,danger:!0,info:!0},resolveColor=(e,i)=>Object.hasOwn(TEXT_ROLE_COLOR,i)?e.colors[TEXT_ROLE_COLOR[i]]:Object.hasOwn(SEMANTIC,i)?e.colors[`${i}-text`]:i;exports.resolveColor=resolveColor;const Text=exports.Text=(0,_react.forwardRef)((e,i)=>{const{variant:t="body",color:r,weight:o,size:l,align:n,italic:a,underline:s,style:d,children:c,...y}=e,p=(0,_index.useTheme)(),x=Object.hasOwn(VARIANTS,t),g=p.settings.textVariants,u=!x&&g&&Object.hasOwn(g,t)?g[t]:void 0;x||u||(0,_warnInvalidValue.warnInvalidValue)("Text","variant",e.variant,[...Object.keys(VARIANTS),...Object.keys(g??{})]);const m=(0,_react.useMemo)(()=>{if(u){const e="string"==typeof l?l:u.size,i="number"==typeof l?l:p.text[e].size;return{fontSize:i,lineHeight:u.lineHeight??("number"==typeof l?void 0:Math.round(i*p.leading[u.heading?"heading":"body"])),color:void 0!==r?resolveColor(p,r):u.color?p.colors[u.color]:resolveColor(p,"primary"),textAlign:n,textTransform:u.uppercase?"uppercase":void 0,letterSpacing:u.letterSpacing?p["letter-spacing"][u.letterSpacing]:void 0,fontStyle:a||u.italic?"italic":void 0,fontVariant:u.fontVariant,textDecorationLine:s?"underline":void 0,...(0,_index.fontFor)(p,o??u.weight??"normal",u.fontFamily)}}const e=VARIANTS[x?t:"body"],i="number"==typeof l?l:p.text[l??e.size].size;return{fontSize:i,lineHeight:Math.round(i*p.leading[e.line]),color:resolveColor(p,r??e.color),textAlign:n,textTransform:e.uppercase?"uppercase":void 0,letterSpacing:e.letterSpacing?p["letter-spacing"][e.letterSpacing]:void 0,fontStyle:a?"italic":void 0,textDecorationLine:s?"underline":void 0,...(0,_index.fontFor)(p,o??e.weight,e.fontFamily)}},[p,u,x,t,r,o,l,n,a,s]),h=x?VARIANTS[t].heading:u?.heading;return(0,_jsxRuntime.jsx)(_reactNative.Text,{ref:i,style:[m,d],maxFontSizeMultiplier:p.settings.maxFontSizeMultiplier,accessibilityRole:h?"header":y.accessibilityRole,...y,children:c})});Text.displayName="Text";var _default=exports.default=Text;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.lightTokens=exports.darkTokens=exports.WEIGHT_NAMES=exports.TEXT_NAMES=exports.SPACE_NAMES=exports.SIZE_NAMES=exports.SHADOW_NAMES=exports.RADIUS_NAMES=exports.LETTER_SPACING_NAMES=exports.LEADING_NAMES=exports.FONT_NAMES=exports.EASE_NAMES=exports.DURATION_NAMES=exports.COMPONENT_KINDS=exports.COLOR_NAMES=void 0;const COLOR_NAMES=exports.COLOR_NAMES=["bg","bg-subtle","bg-muted","surface","surface-inverse","text","text-body","text-muted","text-subtle","text-inverse","link","border","border-subtle","field-bg","field-border","field-border-focus","focus-ring","scrim","on-scrim","thumb","primary","primary-hover","primary-soft","primary-text","on-primary","primary-wash","primary-wash-strong","neutral","neutral-hover","neutral-text","on-neutral","success","success-soft","success-text","on-success","warning","warning-soft","warning-text","on-warning","danger","danger-soft","danger-border","danger-text","on-danger","info","info-soft","info-text","on-info","primary-pressed","on-neutral-strong","text-disabled","surface-pressed","surface-hover","surface-selected","surface-disabled","skeleton","skeleton-highlight","glass-fill","glass-border","on-glass","glass-badge","field-bg-focus","field-bg-disabled","field-border-error","field-label","field-text","field-text-disabled","field-placeholder","field-placeholder-disabled","field-icon","field-icon-focus","field-icon-disabled","field-caret","field-message","avatar-1","avatar-2","avatar-3","avatar-4","avatar-5","avatar-6","avatar-7","avatar-8"],SPACE_NAMES=exports.SPACE_NAMES=["none","xxs","xs","sm","md","lg","xl","2xl","3xl","4xl"],RADIUS_NAMES=exports.RADIUS_NAMES=["none","sm","md","lg","xl","pill"],TEXT_NAMES=exports.TEXT_NAMES=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl"],WEIGHT_NAMES=exports.WEIGHT_NAMES=["normal","medium","semibold","bold"],LEADING_NAMES=exports.LEADING_NAMES=["tight","normal","relaxed"],LETTER_SPACING_NAMES=exports.LETTER_SPACING_NAMES=["tight","normal","wide"],FONT_NAMES=exports.FONT_NAMES=["ui","display","mono"],SHADOW_NAMES=exports.SHADOW_NAMES=["card","elevated","popover","modal","drawer"],DURATION_NAMES=exports.DURATION_NAMES=["instant","fast","default","slow","slower"],EASE_NAMES=exports.EASE_NAMES=["in-out","accelerate","decelerate","sharp"],SIZE_NAMES=exports.SIZE_NAMES=["border"],COMPONENT_KINDS=exports.COMPONENT_KINDS={field:{radius:"radius","padding-x":"space","padding-y":"space","min-height":"px",text:"text",icon:"px","label-text":"text","label-gap":"space","message-text":"text","message-gap":"space"},press:{opacity:"number"},disabled:{opacity:"number"},button:{"padding-x":"space","padding-y":"space","min-height":"px",text:"text",radius:"radius",icon:"px","badge-icon":"px"},input:{"multiline-min-height":"px"},"search-bar":{radius:"radius"},"empty-state":{icon:"px","title-text":"text","description-text":"text","padding-y":"space","title-gap":"space","description-gap":"space"},"list-item":{"padding-y":"space","title-text":"text","subtitle-text":"text","min-height":"px"},badge:{text:"text","min-width":"px",height:"px","padding-x":"space","dot-size":"px","border-width":"px","anchor-offset":"px"},chip:{"padding-x":"space","padding-y":"space",text:"text","min-height":"px","close-size":"px","close-text":"text",gap:"space",icon:"px"},checkbox:{"box-size":"px","label-gap":"space"},radio:{outer:"px",inner:"px","label-gap":"space"},switch:{"track-width":"px","track-height":"px","thumb-size":"px",padding:"space"},"otp-input":{cell:"px",text:"text",radius:"radius",gap:"space"},"segmented-control":{height:"px",text:"text","padding-x":"space",icon:"px","track-padding":"space","underline-height":"px","pill-inset":"space"},tabs:{text:"text","padding-y":"space","padding-x":"space","scrollable-padding-x":"space",icon:"px","icon-gap":"space","track-padding":"space","underline-height":"px","pill-inset":"space","disabled-opacity":"number","badge-gap":"space"},slider:{"track-height":"px","thumb-diameter":"px"},"floating-action-button":{diameter:"px",icon:"px",text:"text","label-padding-x":"space","edge-offset":"space","bottom-offset":"space","secondary-gap":"space","stagger-ms":"ms"},dialog:{"icon-wrapper-size":"px","action-button-min-height":"px"},toast:{"icon-circle-size":"px","icon-glyph-text":"text","tint-bar-width":"px","action-min-height":"px"},banner:{"tint-bar-width":"px"}},lightTokens=exports.lightTokens={mode:"light",colors:{bg:"#ffffff","bg-subtle":"#f8f8fb","bg-muted":"#f1f1f5",surface:"#ffffff","surface-inverse":"#0f0f1a",text:"#252f4a","text-body":"#0f0f1a","text-muted":"#52525b","text-subtle":"#62626b","text-inverse":"#ffffff",link:"#5b5bd6",border:"#e5e5ec","border-subtle":"#efeff3","field-bg":"#f9fbfc","field-border":"#ebedf3","field-border-focus":"#bed2f9","focus-ring":"#5b5bd6",scrim:"#0f0f1a80","on-scrim":"#ffffff",thumb:"#ffffff",primary:"#5b5bd6","primary-hover":"#4f4fbf","primary-soft":"#eeeefc","primary-text":"#4f4fd3","on-primary":"#ffffff","primary-wash":"#5b5bd614","primary-wash-strong":"#5b5bd633",neutral:"#f4f4f8","neutral-hover":"#e9e9f0","neutral-text":"#52525b","on-neutral":"#0f0f1a",success:"#18864f","success-soft":"#e8faee","success-text":"#147042","on-success":"#ffffff",warning:"#f59e0b","warning-soft":"#fff8e6","warning-text":"#8f5c06","on-warning":"#0f0f1a",danger:"#e12c32","danger-soft":"#ffeaef","danger-border":"#e5484d","danger-text":"#bc1b20","on-danger":"#ffffff",info:"#1b6ef5","info-soft":"#e9f3ff","info-text":"#0958d9","on-info":"#ffffff","primary-pressed":"#4040a8","on-neutral-strong":"#ffffff","text-disabled":"#b4b4bb","surface-pressed":"#0f0f1a0f","surface-hover":"#0f0f1a0a","surface-selected":"#5b5bd61a","surface-disabled":"#f1f1f5",skeleton:"#ebedf3","skeleton-highlight":"#f5f6fa","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#ffffff","field-bg-disabled":"#f5f6fa","field-border-error":"#fdbfce","field-label":"#242f4a","field-text":"#252f4a","field-text-disabled":"#c4cada","field-placeholder":"#626d8b","field-placeholder-disabled":"#c4cada","field-icon":"#7a849f","field-icon-focus":"#4b5675","field-icon-disabled":"#c4cada","field-caret":"#5b8dee","field-message":"#d81736","avatar-1":"#5b5bd6","avatar-2":"#0a7979","avatar-3":"#a45a05","avatar-4":"#cd226e","avatar-5":"#2462eb","avatar-6":"#7c3aed","avatar-7":"#047c57","avatar-8":"#d42222"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,pill:9999},text:{xs:{size:11,lineHeight:17},sm:{size:13,lineHeight:20},base:{size:15,lineHeight:23},lg:{size:17,lineHeight:24},xl:{size:20,lineHeight:26},"2xl":{size:24,lineHeight:30},"3xl":{size:30,lineHeight:36},"4xl":{size:36,lineHeight:40},"5xl":{size:45,lineHeight:47},"6xl":{size:57,lineHeight:57},"7xl":{size:64,lineHeight:64},"8xl":{size:72,lineHeight:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{tight:1.2,normal:1.4,relaxed:1.6},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.059,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.078,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.102,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":34,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":44,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":58,text:"xl",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0}}},darkTokens=exports.darkTokens={mode:"dark",colors:{bg:"#0b0b12","bg-subtle":"#13131c","bg-muted":"#1c1c26",surface:"#1c1c26","surface-inverse":"#fafafa",text:"#e2e2e2","text-body":"#fafafa","text-muted":"#b4b4bb","text-subtle":"#919199","text-inverse":"#0f0f1a",link:"#9292ee",border:"#27272f","border-subtle":"#1c1c26","field-bg":"#13131c","field-border":"#27272f","field-border-focus":"#3d5fb0","focus-ring":"#7c7ce8",scrim:"#000000a6","on-scrim":"#ffffff",thumb:"#ffffff",primary:"#7c7ce8","primary-hover":"#9292ee","primary-soft":"#1f1f3d","primary-text":"#8989ea","on-primary":"#0f0f1a","primary-wash":"#7c7ce814","primary-wash-strong":"#7c7ce833",neutral:"#1f1f26","neutral-hover":"#2a2a33","neutral-text":"#b4b4bb","on-neutral":"#fafafa",success:"#30c780","success-soft":"#04b4402e","success-text":"#30c780","on-success":"#0f0f1a",warning:"#fbbf24","warning-soft":"#dfa0002e","warning-text":"#fbbf24","on-warning":"#0f0f1a",danger:"#f87171","danger-soft":"#e826462e","danger-border":"#f87171","danger-text":"#f87171","on-danger":"#0f0f1a",info:"#60a5fa","info-soft":"#056ee92e","info-text":"#60a5fa","on-info":"#0f0f1a","primary-pressed":"#a8a8f2","on-neutral-strong":"#0f0f1a","text-disabled":"#52525b","surface-pressed":"#ffffff14","surface-hover":"#ffffff0d","surface-selected":"#7c7ce82e","surface-disabled":"#1c1c26",skeleton:"#1c1c26","skeleton-highlight":"#27272f","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#0b0b12","field-bg-disabled":"#1c1c26","field-border-error":"#8a2f42","field-label":"#e4e6ee","field-text":"#fafafa","field-text-disabled":"#52525b","field-placeholder":"#84848d","field-placeholder-disabled":"#52525b","field-icon":"#8b8b95","field-icon-focus":"#d4d4db","field-icon-disabled":"#52525b","field-caret":"#7c9ef0","field-message":"#f87171","avatar-1":"#8b8bee","avatar-2":"#2dd4bf","avatar-3":"#fcd34d","avatar-4":"#f472b6","avatar-5":"#60a5fa","avatar-6":"#a78bfa","avatar-7":"#34d399","avatar-8":"#f87171"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,pill:9999},text:{xs:{size:11,lineHeight:17},sm:{size:13,lineHeight:20},base:{size:15,lineHeight:23},lg:{size:17,lineHeight:24},xl:{size:20,lineHeight:26},"2xl":{size:24,lineHeight:30},"3xl":{size:30,lineHeight:36},"4xl":{size:36,lineHeight:40},"5xl":{size:45,lineHeight:47},"6xl":{size:57,lineHeight:57},"7xl":{size:64,lineHeight:64},"8xl":{size:72,lineHeight:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{tight:1.2,normal:1.4,relaxed:1.6},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.4,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.502,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.549,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":34,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":44,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":58,text:"xl",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.lightTokens=exports.darkTokens=exports.WEIGHT_NAMES=exports.TEXT_NAMES=exports.SPACE_NAMES=exports.SIZE_NAMES=exports.SHADOW_NAMES=exports.RADIUS_NAMES=exports.LETTER_SPACING_NAMES=exports.LEADING_NAMES=exports.FONT_NAMES=exports.EASE_NAMES=exports.DURATION_NAMES=exports.COMPONENT_KINDS=exports.COLOR_NAMES=void 0;const COLOR_NAMES=exports.COLOR_NAMES=["bg","bg-subtle","bg-muted","surface","surface-inverse","text","text-body","text-muted","text-subtle","text-inverse","link","border","border-subtle","field-bg","field-border","field-border-focus","focus-ring","scrim","on-scrim","thumb","primary","primary-hover","primary-soft","primary-text","on-primary","primary-wash","primary-wash-strong","neutral","neutral-hover","neutral-text","on-neutral","success","success-soft","success-text","on-success","warning","warning-soft","warning-text","on-warning","danger","danger-soft","danger-border","danger-text","on-danger","info","info-soft","info-text","on-info","primary-pressed","on-neutral-strong","text-disabled","surface-pressed","surface-hover","surface-selected","surface-disabled","skeleton","skeleton-highlight","glass-fill","glass-border","on-glass","glass-badge","field-bg-focus","field-bg-disabled","field-border-error","field-label","field-text","field-text-disabled","field-placeholder","field-placeholder-disabled","field-icon","field-icon-focus","field-icon-disabled","field-caret","field-message","avatar-1","avatar-2","avatar-3","avatar-4","avatar-5","avatar-6","avatar-7","avatar-8"],SPACE_NAMES=exports.SPACE_NAMES=["none","xxs","xs","sm","md","lg","xl","2xl","3xl","4xl"],RADIUS_NAMES=exports.RADIUS_NAMES=["none","sm","md","lg","xl","pill"],TEXT_NAMES=exports.TEXT_NAMES=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl"],WEIGHT_NAMES=exports.WEIGHT_NAMES=["normal","medium","semibold","bold"],LEADING_NAMES=exports.LEADING_NAMES=["heading","body","display"],LETTER_SPACING_NAMES=exports.LETTER_SPACING_NAMES=["tight","normal","wide"],FONT_NAMES=exports.FONT_NAMES=["ui","display","mono"],SHADOW_NAMES=exports.SHADOW_NAMES=["card","elevated","popover","modal","drawer"],DURATION_NAMES=exports.DURATION_NAMES=["instant","fast","default","slow","slower"],EASE_NAMES=exports.EASE_NAMES=["in-out","accelerate","decelerate","sharp"],SIZE_NAMES=exports.SIZE_NAMES=["border"],COMPONENT_KINDS=exports.COMPONENT_KINDS={field:{radius:"radius","padding-x":"space","padding-y":"space","min-height":"px",text:"text",icon:"px","label-text":"text","label-gap":"space","message-text":"text","message-gap":"space"},press:{opacity:"number"},disabled:{opacity:"number"},button:{"padding-x":"space","padding-y":"space","min-height":"px",text:"text",radius:"radius",icon:"px","badge-icon":"px"},input:{"multiline-min-height":"px"},"search-bar":{radius:"radius"},"empty-state":{icon:"px","title-text":"text","description-text":"text","padding-y":"space","title-gap":"space","description-gap":"space"},"list-item":{"padding-y":"space","title-text":"text","subtitle-text":"text","min-height":"px"},badge:{text:"text","min-width":"px",height:"px","padding-x":"space","dot-size":"px","border-width":"px","anchor-offset":"px"},chip:{"padding-x":"space","padding-y":"space",text:"text","min-height":"px","close-size":"px","close-text":"text",gap:"space",icon:"px"},checkbox:{"box-size":"px","label-gap":"space"},radio:{outer:"px",inner:"px","label-gap":"space"},switch:{"track-width":"px","track-height":"px","thumb-size":"px",padding:"space"},"otp-input":{cell:"px",text:"text",radius:"radius",gap:"space"},"segmented-control":{height:"px",text:"text","padding-x":"space",icon:"px","track-padding":"space","underline-height":"px","pill-inset":"space"},tabs:{text:"text","padding-y":"space","padding-x":"space","scrollable-padding-x":"space",icon:"px","icon-gap":"space","track-padding":"space","underline-height":"px","pill-inset":"space","disabled-opacity":"number","badge-gap":"space"},slider:{"track-height":"px","thumb-diameter":"px"},"floating-action-button":{diameter:"px",icon:"px",text:"text","label-padding-x":"space","edge-offset":"space","bottom-offset":"space","secondary-gap":"space","stagger-ms":"ms"},dialog:{"icon-wrapper-size":"px","action-button-min-height":"px"},toast:{"icon-circle-size":"px","icon-glyph-text":"text","tint-bar-width":"px","action-min-height":"px"},banner:{"tint-bar-width":"px"}},lightTokens=exports.lightTokens={mode:"light",colors:{bg:"#ffffff","bg-subtle":"#f8f8fb","bg-muted":"#f1f1f5",surface:"#ffffff","surface-inverse":"#0f0f1a",text:"#252f4a","text-body":"#0f0f1a","text-muted":"#52525b","text-subtle":"#62626b","text-inverse":"#ffffff",link:"#5b5bd6",border:"#e5e5ec","border-subtle":"#efeff3","field-bg":"#f9fbfc","field-border":"#ebedf3","field-border-focus":"#bed2f9","focus-ring":"#5b5bd6",scrim:"#0f0f1a80","on-scrim":"#ffffff",thumb:"#ffffff",primary:"#5b5bd6","primary-hover":"#4f4fbf","primary-soft":"#eeeefc","primary-text":"#4f4fd3","on-primary":"#ffffff","primary-wash":"#5b5bd614","primary-wash-strong":"#5b5bd633",neutral:"#f4f4f8","neutral-hover":"#e9e9f0","neutral-text":"#52525b","on-neutral":"#0f0f1a",success:"#18864f","success-soft":"#e8faee","success-text":"#147042","on-success":"#ffffff",warning:"#f59e0b","warning-soft":"#fff8e6","warning-text":"#8f5c06","on-warning":"#0f0f1a",danger:"#e12c32","danger-soft":"#ffeaef","danger-border":"#e5484d","danger-text":"#bc1b20","on-danger":"#ffffff",info:"#1b6ef5","info-soft":"#e9f3ff","info-text":"#0958d9","on-info":"#ffffff","primary-pressed":"#4040a8","on-neutral-strong":"#ffffff","text-disabled":"#b4b4bb","surface-pressed":"#0f0f1a0f","surface-hover":"#0f0f1a0a","surface-selected":"#5b5bd61a","surface-disabled":"#f1f1f5",skeleton:"#ebedf3","skeleton-highlight":"#f5f6fa","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#ffffff","field-bg-disabled":"#f5f6fa","field-border-error":"#fdbfce","field-label":"#242f4a","field-text":"#252f4a","field-text-disabled":"#c4cada","field-placeholder":"#626d8b","field-placeholder-disabled":"#c4cada","field-icon":"#7a849f","field-icon-focus":"#4b5675","field-icon-disabled":"#c4cada","field-caret":"#5b8dee","field-message":"#d81736","avatar-1":"#5b5bd6","avatar-2":"#0a7979","avatar-3":"#a45a05","avatar-4":"#cd226e","avatar-5":"#2462eb","avatar-6":"#7c3aed","avatar-7":"#047c57","avatar-8":"#d42222"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,pill:9999},text:{xs:{size:11},sm:{size:13},base:{size:15},lg:{size:17},xl:{size:20},"2xl":{size:24},"3xl":{size:30},"4xl":{size:36},"5xl":{size:45},"6xl":{size:57},"7xl":{size:64},"8xl":{size:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{heading:1.2,body:1.4,display:1.2},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.059,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.078,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.102,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.141,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":34,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":44,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":58,text:"xl",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0}}},darkTokens=exports.darkTokens={mode:"dark",colors:{bg:"#0b0b12","bg-subtle":"#13131c","bg-muted":"#1c1c26",surface:"#1c1c26","surface-inverse":"#fafafa",text:"#e2e2e2","text-body":"#fafafa","text-muted":"#b4b4bb","text-subtle":"#919199","text-inverse":"#0f0f1a",link:"#9292ee",border:"#27272f","border-subtle":"#1c1c26","field-bg":"#13131c","field-border":"#27272f","field-border-focus":"#3d5fb0","focus-ring":"#7c7ce8",scrim:"#000000a6","on-scrim":"#ffffff",thumb:"#ffffff",primary:"#7c7ce8","primary-hover":"#9292ee","primary-soft":"#1f1f3d","primary-text":"#8989ea","on-primary":"#0f0f1a","primary-wash":"#7c7ce814","primary-wash-strong":"#7c7ce833",neutral:"#1f1f26","neutral-hover":"#2a2a33","neutral-text":"#b4b4bb","on-neutral":"#fafafa",success:"#30c780","success-soft":"#04b4402e","success-text":"#30c780","on-success":"#0f0f1a",warning:"#fbbf24","warning-soft":"#dfa0002e","warning-text":"#fbbf24","on-warning":"#0f0f1a",danger:"#f87171","danger-soft":"#e826462e","danger-border":"#f87171","danger-text":"#f87171","on-danger":"#0f0f1a",info:"#60a5fa","info-soft":"#056ee92e","info-text":"#60a5fa","on-info":"#0f0f1a","primary-pressed":"#a8a8f2","on-neutral-strong":"#0f0f1a","text-disabled":"#52525b","surface-pressed":"#ffffff14","surface-hover":"#ffffff0d","surface-selected":"#7c7ce82e","surface-disabled":"#1c1c26",skeleton:"#1c1c26","skeleton-highlight":"#27272f","glass-fill":"#ffffff47","glass-border":"#ffffff73","on-glass":"#0f0f1a","glass-badge":"#ffffff","field-bg-focus":"#0b0b12","field-bg-disabled":"#1c1c26","field-border-error":"#8a2f42","field-label":"#e4e6ee","field-text":"#fafafa","field-text-disabled":"#52525b","field-placeholder":"#84848d","field-placeholder-disabled":"#52525b","field-icon":"#8b8b95","field-icon-focus":"#d4d4db","field-icon-disabled":"#52525b","field-caret":"#7c9ef0","field-message":"#f87171","avatar-1":"#8b8bee","avatar-2":"#2dd4bf","avatar-3":"#fcd34d","avatar-4":"#f472b6","avatar-5":"#60a5fa","avatar-6":"#a78bfa","avatar-7":"#34d399","avatar-8":"#f87171"},space:{none:0,xxs:2,xs:4,sm:8,md:12,lg:16,xl:24,"2xl":32,"3xl":48,"4xl":64},radius:{none:0,sm:6,md:10,lg:14,xl:20,pill:9999},text:{xs:{size:11},sm:{size:13},base:{size:15},lg:{size:17},xl:{size:20},"2xl":{size:24},"3xl":{size:30},"4xl":{size:36},"5xl":{size:45},"6xl":{size:57},"7xl":{size:64},"8xl":{size:72}},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},leading:{heading:1.2,body:1.4,display:1.2},"letter-spacing":{tight:-.2,normal:0,wide:.4},font:{ui:{},display:{},mono:{}},shadow:{card:{shadowColor:"#000000",shadowOffset:{width:0,height:2},shadowOpacity:.4,shadowRadius:4,elevation:2},elevated:{shadowColor:"#000000",shadowOffset:{width:0,height:4},shadowOpacity:.502,shadowRadius:8,elevation:4},popover:{shadowColor:"#000000",shadowOffset:{width:0,height:8},shadowOpacity:.549,shadowRadius:16,elevation:8},modal:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12},drawer:{shadowColor:"#000000",shadowOffset:{width:0,height:12},shadowOpacity:.6,shadowRadius:24,elevation:12}},motion:{duration:{instant:80,fast:160,default:240,slow:360,slower:500},ease:{"in-out":[.4,0,.2,1],accelerate:[.4,0,1,1],decelerate:[0,0,.2,1],sharp:[.4,0,.6,1]}},size:{border:1},components:{field:{sm:{radius:"md","padding-x":"sm","padding-y":"sm","min-height":38,text:"sm",icon:14,"label-text":"xs","label-gap":"xs","message-text":"xs","message-gap":"xxs"},md:{radius:"md","padding-x":"md","padding-y":"md","min-height":44,text:"base",icon:16,"label-text":"sm","label-gap":"xs","message-text":"sm","message-gap":"xxs"},lg:{radius:"md","padding-x":"lg","padding-y":"lg","min-height":52,text:"lg",icon:18,"label-text":"base","label-gap":"xs","message-text":"base","message-gap":"xxs"}},press:{opacity:.85},disabled:{opacity:.55},button:{xs:{"padding-x":"sm","padding-y":"xs","min-height":28,text:"xs",radius:"md",icon:14,"badge-icon":11},sm:{"padding-x":"md","padding-y":"xs","min-height":34,text:"sm",radius:"md",icon:16,"badge-icon":16},md:{"padding-x":"lg","padding-y":"sm","min-height":44,text:"base",radius:"md",icon:18,"badge-icon":18},lg:{"padding-x":"xl","padding-y":"md","min-height":50,text:"lg",radius:"lg",icon:20,"badge-icon":20},xl:{"padding-x":"2xl","padding-y":"md","min-height":58,text:"xl",radius:"lg",icon:22,"badge-icon":22}},input:{sm:{"multiline-min-height":72},md:{"multiline-min-height":92},lg:{"multiline-min-height":110}},"search-bar":{sm:{radius:"pill"},md:{radius:"pill"},lg:{radius:"pill"}},"empty-state":{sm:{icon:48,"title-text":"lg","description-text":"sm","padding-y":"lg","title-gap":"md","description-gap":"xs"},md:{icon:64,"title-text":"xl","description-text":"base","padding-y":"xl","title-gap":"md","description-gap":"xs"},lg:{icon:80,"title-text":"2xl","description-text":"lg","padding-y":"2xl","title-gap":"md","description-gap":"xs"}},"list-item":{sm:{"padding-y":"sm","title-text":"sm","subtitle-text":"xs","min-height":44},md:{"padding-y":"md","title-text":"base","subtitle-text":"sm","min-height":56},lg:{"padding-y":"lg","title-text":"lg","subtitle-text":"base","min-height":72}},badge:{sm:{text:"xs","min-width":16,height:16,"padding-x":"xs","dot-size":8},md:{text:"sm","min-width":20,height:20,"padding-x":"sm","dot-size":10},"border-width":1.5,"anchor-offset":4},chip:{sm:{"padding-x":"sm","padding-y":"xs",text:"xs","min-height":26,"close-size":16,"close-text":"xs",gap:"xs",icon:14},md:{"padding-x":"md","padding-y":"xs",text:"sm","min-height":32,"close-size":18,"close-text":"sm",gap:"sm",icon:16}},checkbox:{sm:{"box-size":16},md:{"box-size":20},lg:{"box-size":24},"label-gap":"sm"},radio:{sm:{outer:16,inner:8},md:{outer:20,inner:10},lg:{outer:24,inner:12},"label-gap":"sm"},switch:{sm:{"track-width":42,"track-height":26,"thumb-size":22,padding:"xxs"},md:{"track-width":51,"track-height":31,"thumb-size":27,padding:"xxs"},lg:{"track-width":60,"track-height":36,"thumb-size":32,padding:"xxs"}},"otp-input":{sm:{cell:36,text:"base",radius:"sm",gap:"sm"},md:{cell:48,text:"xl",radius:"md",gap:"sm"},lg:{cell:56,text:"2xl",radius:"lg",gap:"md"}},"segmented-control":{sm:{height:32,text:"sm","padding-x":"sm",icon:14},md:{height:40,text:"base","padding-x":"md",icon:16},lg:{height:48,text:"lg","padding-x":"lg",icon:18},"track-padding":"xs","underline-height":2,"pill-inset":"xs"},tabs:{sm:{text:"sm","padding-y":"sm","padding-x":"xs","scrollable-padding-x":"md",icon:16},md:{text:"base","padding-y":"md","padding-x":"sm","scrollable-padding-x":"lg",icon:18},lg:{text:"lg","padding-y":"lg","padding-x":"md","scrollable-padding-x":"xl",icon:20},"icon-gap":"xs","track-padding":"xs","underline-height":2,"pill-inset":"xs","disabled-opacity":.45,"badge-gap":"xs"},slider:{sm:{"track-height":4,"thumb-diameter":24},md:{"track-height":6,"thumb-diameter":28},lg:{"track-height":8,"thumb-diameter":32}},"floating-action-button":{sm:{diameter:40,icon:18,text:"sm","label-padding-x":"md"},md:{diameter:56,icon:22,text:"base","label-padding-x":"lg"},lg:{diameter:72,icon:28,text:"lg","label-padding-x":"xl"},"edge-offset":"xl","bottom-offset":"xl","secondary-gap":"lg","stagger-ms":50},dialog:{"icon-wrapper-size":48,"action-button-min-height":44},toast:{"icon-circle-size":28,"icon-glyph-text":"lg","tint-bar-width":0,"action-min-height":30},banner:{"tint-bar-width":0}}};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hitSlopMarker=void 0;const hitSlopMarker=t=>{const{top:e=0,right:o=0,bottom:r=0,left:p=0}="number"==typeof t?{top:t,right:t,bottom:t,left:t}:t;return{dataSet:{wuiHitSlop:`${e} ${o} ${r} ${p}`}}};exports.hitSlopMarker=hitSlopMarker;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resetInvalidValueWarnings=resetInvalidValueWarnings,exports.warnInvalidValue=warnInvalidValue;const seen=new Set;function warnInvalidValue(e,n,t,a){if(!__DEV__||null==t)return;const s=a instanceof Set?a:new Set(a);if(s.has(t))return;const i=`${e}.${n}.${String(t)}`;seen.has(i)||(seen.add(i),console.warn(`[@webority/mobile-ui] <${e}> received ${n}="${String(t)}", which is not one of ${[...s].map(e=>`"${e}"`).join(" | ")}. The component fell back to its default, so this renders something other than what the call site asks for.`))}function resetInvalidValueWarnings(){seen.clear()}