@webority/mobile-ui 0.164.0 → 0.165.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 (95) hide show
  1. package/LICENSE.txt +1 -1
  2. package/dist/canvas-kit/kit.js +5 -5
  3. package/dist/canvas-kit/manifest.json +6 -1
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/lib/commonjs/components/Avatar/Avatar.js +1 -1
  6. package/lib/commonjs/components/Banner/Banner.js +1 -1
  7. package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
  8. package/lib/commonjs/components/Card/Card.js +1 -1
  9. package/lib/commonjs/components/Carousel/Carousel.js +1 -1
  10. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +1 -1
  11. package/lib/commonjs/components/FieldBase/FieldBase.js +1 -1
  12. package/lib/commonjs/components/IconBadge/IconBadge.js +1 -1
  13. package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
  14. package/lib/commonjs/components/Input/Input.js +1 -1
  15. package/lib/commonjs/components/MessageBubble/MessageBubble.js +1 -1
  16. package/lib/commonjs/components/Modal/Modal.js +1 -1
  17. package/lib/commonjs/components/NumberInput/NumberInput.js +1 -1
  18. package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
  19. package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  20. package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
  21. package/lib/commonjs/components/Screen/Screen.js +1 -1
  22. package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
  23. package/lib/commonjs/components/Slider/Slider.js +1 -1
  24. package/lib/commonjs/components/SliderField/SliderField.js +1 -1
  25. package/lib/commonjs/components/TagInput/TagInput.js +1 -1
  26. package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
  27. package/lib/commonjs/hooks/useDragToDismiss.js +1 -1
  28. package/lib/commonjs/theme/merge.js +1 -1
  29. package/lib/module/components/Avatar/Avatar.js +1 -1
  30. package/lib/module/components/Banner/Banner.js +1 -1
  31. package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
  32. package/lib/module/components/Card/Card.js +1 -1
  33. package/lib/module/components/Carousel/Carousel.js +1 -1
  34. package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
  35. package/lib/module/components/FieldBase/FieldBase.js +1 -1
  36. package/lib/module/components/IconBadge/IconBadge.js +1 -1
  37. package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
  38. package/lib/module/components/Input/Input.js +1 -1
  39. package/lib/module/components/MessageBubble/MessageBubble.js +1 -1
  40. package/lib/module/components/Modal/Modal.js +1 -1
  41. package/lib/module/components/NumberInput/NumberInput.js +1 -1
  42. package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
  43. package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  44. package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
  45. package/lib/module/components/Screen/Screen.js +1 -1
  46. package/lib/module/components/SearchBar/SearchBar.js +1 -1
  47. package/lib/module/components/Slider/Slider.js +1 -1
  48. package/lib/module/components/SliderField/SliderField.js +1 -1
  49. package/lib/module/components/TagInput/TagInput.js +1 -1
  50. package/lib/module/components/Tooltip/Tooltip.js +1 -1
  51. package/lib/module/hooks/useDragToDismiss.js +1 -1
  52. package/lib/module/theme/merge.js +1 -1
  53. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +1 -0
  54. package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +1 -0
  55. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +1 -0
  56. package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +1 -0
  57. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +1 -0
  58. package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +1 -0
  59. package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +1 -0
  60. package/lib/typescript/commonjs/components/Input/Input.d.ts +1 -0
  61. package/lib/typescript/commonjs/components/Menu/Menu.d.ts +1 -1
  62. package/lib/typescript/commonjs/components/Modal/Modal.d.ts +1 -0
  63. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +1 -0
  64. package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +1 -1
  65. package/lib/typescript/commonjs/components/PhoneNumberInput/PhoneNumberInput.d.ts +1 -0
  66. package/lib/typescript/commonjs/components/ProfilePicker/ProfilePicker.d.ts +1 -0
  67. package/lib/typescript/commonjs/components/Screen/Screen.d.ts +1 -0
  68. package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +1 -0
  69. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +5 -0
  70. package/lib/typescript/commonjs/components/SliderField/SliderField.d.ts +1 -0
  71. package/lib/typescript/commonjs/components/TagInput/TagInput.d.ts +1 -0
  72. package/lib/typescript/commonjs/hooks/useDragToDismiss.d.ts +2 -0
  73. package/lib/typescript/commonjs/theme/types.d.ts +9 -3
  74. package/lib/typescript/module/components/AppBar/AppBar.d.ts +1 -0
  75. package/lib/typescript/module/components/Avatar/Avatar.d.ts +1 -0
  76. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +1 -0
  77. package/lib/typescript/module/components/Carousel/Carousel.d.ts +1 -0
  78. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +1 -0
  79. package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +1 -0
  80. package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +1 -0
  81. package/lib/typescript/module/components/Input/Input.d.ts +1 -0
  82. package/lib/typescript/module/components/Menu/Menu.d.ts +1 -1
  83. package/lib/typescript/module/components/Modal/Modal.d.ts +1 -0
  84. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +1 -0
  85. package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +1 -1
  86. package/lib/typescript/module/components/PhoneNumberInput/PhoneNumberInput.d.ts +1 -0
  87. package/lib/typescript/module/components/ProfilePicker/ProfilePicker.d.ts +1 -0
  88. package/lib/typescript/module/components/Screen/Screen.d.ts +1 -0
  89. package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +1 -0
  90. package/lib/typescript/module/components/Slider/Slider.d.ts +5 -0
  91. package/lib/typescript/module/components/SliderField/SliderField.d.ts +1 -0
  92. package/lib/typescript/module/components/TagInput/TagInput.d.ts +1 -0
  93. package/lib/typescript/module/hooks/useDragToDismiss.d.ts +2 -0
  94. package/lib/typescript/module/theme/types.d.ts +9 -3
  95. package/package.json +9 -10
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{AppIcon,renderSlotIcon}from"../AppIcon/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{IconButton}from"../IconButton/index.js";import{Slider}from"../Slider/index.js";import{CountingText,clampValue,sliderToneInk,snapValue,useValueDraft}from"../Slider/valueText.js";import{Text}from"../Text/index.js";import{Tooltip}from"../Tooltip/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SLIDER_FIELD_LABELS=Object.freeze({about:e=>`About ${e}`,decrease:"Decrease",increase:"Increase",fallbackName:"Value",low:e=>`${e} low`,high:e=>`${e} high`,current:e=>`${e} value`});const DEFAULT_INPUT_WIDTH=72,defaultFormatValue=e=>String(e),stepDecimals=e=>String(e).split(".")[1]?.length??0,ValueBox=({draft:e,error:l,disabled:t,width:i,accessibilityLabel:a,styles:s,style:r,testID:o})=>{const n=useTheme(),d=resolveFieldSize(n,"sm"),c=resolveFieldTextStyle(n,{disabled:t}),u=useRef(null),m=useCallback(()=>{t||u.current?.focus()},[t]);return _jsx(FieldBase,{size:"sm",focused:e.editing,disabled:t,error:l,filled:!0,width:i,onPress:m,pressFeedback:!1,paddingHorizontal:n.space.sm,gap:n.space.xs,trailing:l?_jsx(AppIcon,{name:"info-circle",size:d.icon,color:n.colors["danger-text"]}):void 0,style:r,children:_jsx(TextInput,{ref:u,style:[s.boxInput,{color:c.color,fontSize:d.text,...c.weightStyle}],value:e.text,onChangeText:e.onChangeText,onFocus:e.onFocus,onBlur:e.onBlur,onSubmitEditing:e.onBlur,editable:!t,keyboardType:"decimal-pad",returnKeyType:"done",textAlign:"center",selectionColor:n.colors.primary,accessibilityLabel:a,accessibilityState:{disabled:t},"aria-disabled":t,testID:o})})},SliderField=forwardRef((e,l)=>{const{label:t,unit:i,info:a,required:s=!1,helperText:r,error:o,min:n=0,max:d=100,step:c=1,disabled:u=!1,tone:m="primary",size:p,variant:b,haptic:x,showBubble:h=!0,showBounds:f=!0,showInput:y=!1,showStepper:g=!1,leftIcon:S,rightIcon:I,startLabel:j,endLabel:w,formatValue:v=defaultFormatValue,parseInput:F,animationDuration:T,inputWidth:V=DEFAULT_INPUT_WIDTH,labels:_,accessibilityLabel:D,style:L,labelStyle:B,boundStyle:z,sliderStyle:A,inputStyle:C,testID:k}=e;assertValidValue("SliderField","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("SliderField","size",e.size,["sm","md","lg"]),assertValidValue("SliderField","variant",e.variant,["default","inset","minimal","bar"]);const E=useMemo(()=>({...DEFAULT_SLIDER_FIELD_LABELS,..._}),[_]),M=useTheme(),$=useMemo(()=>buildStyles(M),[M]),R=T??M.motion.duration.fast,P=!0===e.range,N=!0===o||hasFieldText(o),W=stepDecimals(c),U=useCallback(l=>{if(!0!==e.range){if(Array.isArray(l))throw new Error("SliderField received a range value in single mode.");e.onChange?.(l)}else{if(!Array.isArray(l))throw new Error("SliderField received a single value in range mode.");e.onChange?.(l)}},[e.onChange,e.range]),[H,q]=useControllableState({value:e.value,defaultValue:e.defaultValue??(P?[n,d]:n),onChange:U}),[K,O]=Array.isArray(H)?H:[H,d],G=clampValue(Math.min(K,O),n,d),J=clampValue(Math.max(K,O),n,d),Q=useValueDraft({value:G,min:n,max:d,step:c,format:v,parse:F,onChange:e=>q(P?[Math.min(e,J),J]:e)}),X=useValueDraft({value:J,min:n,max:d,step:c,format:v,parse:F,onChange:e=>q([G,Math.max(e,G)])}),stepBy=e=>{const l=snapValue(G+e*c,n,d,c);l!==G&&q(l)},Y={color:u?M.colors["text-disabled"]:M.colors["text-muted"],size:resolveFieldSize(M,"md").icon,disabled:u},Z=[$.bubbleText,{color:sliderToneInk(M,m)}],boundText=e=>_jsx(Text,{variant:"bodySmall",style:[$.bound,{color:u?M.colors["text-disabled"]:M.colors["text-muted"]},z],children:e}),ee={min:n,max:d,step:c,disabled:u,tone:m,size:p,variant:b,haptic:x,showLabel:!!h&&"always",renderLabel:h?e=>_jsx(CountingText,{value:e,format:v,decimals:W,duration:R,style:Z,testID:k&&!P?`${k}-bubble`:void 0}):void 0,accessibilityLabel:D??t,style:A,testID:k?`${k}-slider`:void 0};return _jsxs(View,{ref:l,style:[$.container,L],testID:k,children:[t?_jsxs(View,{style:$.labelRow,children:[_jsx(FieldLabel,{required:s,style:B,children:t}),i?_jsx(Text,{variant:"caption",style:{color:M.colors["text-subtle"]},children:i}):null,a?_jsx(Tooltip,{content:a,trigger:"press",placement:"top",children:_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:E.about(t),hitSlop:8,...hitSlopMarker(8),style:$.infoButton,children:_jsx(AppIcon,{name:"info-circle",variant:"bold",size:16,color:M.colors["text-subtle"]})})}):null]}):null,_jsxs(View,{style:[$.row,h?$.rowWithBubble:null],children:[S?_jsx(View,{children:renderSlotIcon(S,Y)}):null,g&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"minus",size:e.size,color:e.color}),onPress:()=>stepBy(-1),accessibilityLabel:E.decrease,variant:"ghost",tone:"neutral",size:"sm",disabled:u||G<=n,haptic:x,testID:k?`${k}-minus`:void 0}):null,P&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:V,accessibilityLabel:E.low(t??E.fallbackName),styles:$,style:C,testID:k?`${k}-input-low`:void 0}):f?boundText(j??v(n)):null,_jsx(View,{style:$.sliderWrap,children:_jsx(Slider,P?{...ee,range:!0,value:[G,J],onChange:q}:{...ee,value:G,onChange:q})}),P&&y?_jsx(ValueBox,{draft:X,error:N,disabled:u,width:V,accessibilityLabel:E.high(t??E.fallbackName),styles:$,style:C,testID:k?`${k}-input-high`:void 0}):f?boundText(w??v(d)):null,g&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"add",size:e.size,color:e.color}),onPress:()=>stepBy(1),accessibilityLabel:E.increase,variant:"ghost",tone:"neutral",size:"sm",disabled:u||G>=d,haptic:x,testID:k?`${k}-plus`:void 0}):null,I?_jsx(View,{children:renderSlotIcon(I,Y)}):null,!P&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:V,accessibilityLabel:E.current(t??E.fallbackName),styles:$,style:C,testID:k?`${k}-input`:void 0}):null]}),_jsx(FieldMessage,{text:N?o:r,error:N})]})});SliderField.displayName="SliderField";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",gap:e.space.xs},infoButton:{marginLeft:e.space.xxs},row:{flexDirection:"row",alignItems:"center",gap:e.space.sm},rowWithBubble:{marginTop:e.space.lg},sliderWrap:{flex:1,paddingHorizontal:e.space.sm},bound:{fontVariant:["tabular-nums"]},bubbleText:{fontVariant:["tabular-nums"]},boxInput:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SliderField};export default SliderField;
1
+ "use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{AppIcon,renderSlotIcon}from"../AppIcon/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{IconButton}from"../IconButton/index.js";import{Slider}from"../Slider/index.js";import{CountingText,clampValue,sliderToneInk,snapValue,useValueDraft}from"../Slider/valueText.js";import{Text}from"../Text/index.js";import{Tooltip}from"../Tooltip/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SLIDER_FIELD_LABELS=Object.freeze({about:e=>`About ${e}`,decrease:"Decrease",increase:"Increase",fallbackName:"Value",low:e=>`${e} low`,high:e=>`${e} high`,current:e=>`${e} value`});const DEFAULT_INPUT_WIDTH=72,defaultFormatValue=e=>String(e),stepDecimals=e=>String(e).split(".")[1]?.length??0,ValueBox=({draft:e,error:l,disabled:t,width:i,accessibilityLabel:a,styles:s,style:r,testID:o,fieldTestID:n})=>{const d=useTheme(),c=resolveFieldSize(d,"sm"),u=resolveFieldTextStyle(d,{disabled:t}),m=useRef(null),p=useCallback(()=>{t||m.current?.focus()},[t]);return _jsx(FieldBase,{testID:n,size:"sm",focused:e.editing,disabled:t,error:l,filled:!0,width:i,onPress:p,pressFeedback:!1,paddingHorizontal:d.space.sm,gap:d.space.xs,trailing:l?_jsx(AppIcon,{name:"info-circle",size:c.icon,color:d.colors["danger-text"]}):void 0,style:r,children:_jsx(TextInput,{ref:m,style:[s.boxInput,{color:u.color,fontSize:c.text,...u.weightStyle}],value:e.text,onChangeText:e.onChangeText,onFocus:e.onFocus,onBlur:e.onBlur,onSubmitEditing:e.onBlur,editable:!t,keyboardType:"decimal-pad",returnKeyType:"done",textAlign:"center",selectionColor:d.colors.primary,accessibilityLabel:a,accessibilityState:{disabled:t},"aria-disabled":t,testID:o})})},SliderField=forwardRef((e,l)=>{const{label:t,unit:i,info:a,required:s=!1,helperText:r,error:o,min:n=0,max:d=100,step:c=1,disabled:u=!1,tone:m="primary",size:p,variant:b,haptic:x,showBubble:h=!0,showBounds:f=!0,showInput:y=!1,showStepper:g=!1,leftIcon:I,rightIcon:S,startLabel:j,endLabel:v,formatValue:T=defaultFormatValue,parseInput:w,animationDuration:F,inputWidth:V=DEFAULT_INPUT_WIDTH,labels:_,accessibilityLabel:D,style:L,labelStyle:B,boundStyle:z,sliderStyle:A,inputStyle:C,testID:k}=e;assertValidValue("SliderField","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("SliderField","size",e.size,["sm","md","lg"]),assertValidValue("SliderField","variant",e.variant,["default","inset","minimal","bar"]);const $=useMemo(()=>({...DEFAULT_SLIDER_FIELD_LABELS,..._}),[_]),E=useTheme(),M=useMemo(()=>buildStyles(E),[E]),R=F??E.motion.duration.fast,P=!0===e.range,N=!0===o||hasFieldText(o),W=stepDecimals(c),U=useCallback(l=>{if(!0!==e.range){if(Array.isArray(l))throw new Error("SliderField received a range value in single mode.");e.onChange?.(l)}else{if(!Array.isArray(l))throw new Error("SliderField received a single value in range mode.");e.onChange?.(l)}},[e.onChange,e.range]),[H,q]=useControllableState({value:e.value,defaultValue:e.defaultValue??(P?[n,d]:n),onChange:U}),[K,O]=Array.isArray(H)?H:[H,d],G=clampValue(Math.min(K,O),n,d),J=clampValue(Math.max(K,O),n,d),Q=useValueDraft({value:G,min:n,max:d,step:c,format:T,parse:w,onChange:e=>q(P?[Math.min(e,J),J]:e)}),X=useValueDraft({value:J,min:n,max:d,step:c,format:T,parse:w,onChange:e=>q([G,Math.max(e,G)])}),stepBy=e=>{const l=snapValue(G+e*c,n,d,c);l!==G&&q(l)},Y={color:u?E.colors["text-disabled"]:E.colors["text-muted"],size:resolveFieldSize(E,"md").icon,disabled:u},Z=[M.bubbleText,{color:sliderToneInk(E,m)}],boundText=e=>_jsx(Text,{variant:"bodySmall",style:[M.bound,{color:u?E.colors["text-disabled"]:E.colors["text-muted"]},z],children:e}),ee={min:n,max:d,step:c,disabled:u,tone:m,size:p,variant:b,haptic:x,showLabel:!!h&&"always",renderLabel:h?e=>_jsx(CountingText,{value:e,format:T,decimals:W,duration:R,style:Z,testID:k&&!P?`${k}-bubble`:void 0}):void 0,accessibilityLabel:D??t,style:A,testID:k?`${k}-slider`:void 0};return _jsxs(View,{ref:l,style:[M.container,L],testID:k,children:[t?_jsxs(View,{style:M.labelRow,children:[_jsx(FieldLabel,{required:s,style:B,children:t}),i?_jsx(Text,{variant:"caption",style:{color:E.colors["text-subtle"]},children:i}):null,a?_jsx(Tooltip,{content:a,trigger:"press",placement:"top",children:_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:$.about(t),hitSlop:8,...hitSlopMarker(8),style:M.infoButton,children:_jsx(AppIcon,{name:"info-circle",variant:"bold",size:16,color:E.colors["text-subtle"]})})}):null]}):null,_jsxs(View,{style:[M.row,h?M.rowWithBubble:null],children:[I?_jsx(View,{children:renderSlotIcon(I,Y)}):null,g&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"minus",size:e.size,color:e.color}),onPress:()=>stepBy(-1),accessibilityLabel:$.decrease,variant:"ghost",tone:"neutral",size:"sm",disabled:u||G<=n,haptic:x,testID:k?`${k}-minus`:void 0}):null,P&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:V,accessibilityLabel:$.low(t??$.fallbackName),styles:M,style:C,testID:k?`${k}-input-low`:void 0,fieldTestID:k?`${k}-field-low`:void 0}):f?boundText(j??T(n)):null,_jsx(View,{style:M.sliderWrap,children:_jsx(Slider,P?{...ee,range:!0,value:[G,J],onChange:q}:{...ee,value:G,onChange:q})}),P&&y?_jsx(ValueBox,{draft:X,error:N,disabled:u,width:V,accessibilityLabel:$.high(t??$.fallbackName),styles:M,style:C,testID:k?`${k}-input-high`:void 0,fieldTestID:k?`${k}-field-high`:void 0}):f?boundText(v??T(d)):null,g&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"add",size:e.size,color:e.color}),onPress:()=>stepBy(1),accessibilityLabel:$.increase,variant:"ghost",tone:"neutral",size:"sm",disabled:u||G>=d,haptic:x,testID:k?`${k}-plus`:void 0}):null,S?_jsx(View,{children:renderSlotIcon(S,Y)}):null,!P&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:V,accessibilityLabel:$.current(t??$.fallbackName),styles:M,style:C,testID:k?`${k}-input`:void 0,fieldTestID:k?`${k}-field`:void 0}):null]}),_jsx(FieldMessage,{text:N?o:r,error:N})]})});SliderField.displayName="SliderField";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",gap:e.space.xs},infoButton:{marginLeft:e.space.xxs},row:{flexDirection:"row",alignItems:"center",gap:e.space.sm},rowWithBubble:{marginTop:e.space.lg},sliderWrap:{flex:1,paddingHorizontal:e.space.sm},bound:{fontVariant:["tabular-nums"]},bubbleText:{fontVariant:["tabular-nums"]},boxInput:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SliderField};export default SliderField;
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fontFor,useTheme}from"../../theme/index.js";import{mergeRefs,resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{Chip}from"../Chip/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,RequiredPlaceholder}from"../FieldBase/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const TagInput=forwardRef((e,t)=>{const{value:s,defaultValue:l,onChange:a,placeholder:i,label:r,helperText:o,error:n,required:u,disabled:d=!1,size:c="md",variant:p,maxTags:m,unique:x=!0,transform:f,separators:h=[","],haptic:g,onFocus:b,style:j,testID:y}=e;assertValidValue("TagInput","size",e.size,["sm","md","lg"]),assertValidValue("TagInput","variant",e.variant,["outline","filled","underline"]);const v=useTheme(),C=useMemo(()=>buildStyles(v),[v]),[T,F]=useControllableState({value:s,defaultValue:l??[],onChange:a}),[S,V]=useState(""),[w,k]=useState(!1),I=useRef(null),z=useMemo(()=>mergeRefs(I,t),[t]),_=useCallback(()=>{d||I.current?.focus()},[d]),B="number"==typeof m&&T.length>=m,R=!0===n||hasFieldText(n),H=u&&!r&&0===T.length&&0===S.length&&Boolean(i),M=useCallback(e=>{const t=f?f(e.trim()):e.trim();if(!t)return;if(B)return;if(x&&T.some(e=>e.toLowerCase()===t.toLowerCase()))return void V("");F([...T,t]),V("");const s=resolveHaptic(g,"selection");s&&triggerHaptic(s)},[B,g,F,T,f,x]),q=useCallback(e=>{const t=T.filter((t,s)=>s!==e);F(t);const s=resolveHaptic(g,"selection");s&&triggerHaptic(s)},[g,F,T]),L=useCallback(e=>{const t=h.find(t=>t.length>0&&e.includes(t));t?M(e.slice(0,e.indexOf(t))):V(e)},[M,h]),D=useCallback(e=>{d||"Backspace"===e.nativeEvent.key&&""===S&&T.length>0&&q(T.length-1)},[d,S,q,T.length]),P=useMemo(()=>T.map((e,t)=>({key:`${e}-${t}`,tag:e,index:t})),[T]),$=_jsx(FieldBase,{size:c,variant:p,focused:w,disabled:d,error:R,filled:T.length>0||S.length>0,onPress:_,pressFeedback:!1,style:j,children:_jsxs(View,{style:C.wrap,children:[P.map(({key:e,tag:t,index:s})=>_jsx(Chip,{label:t,size:"sm",onRemove:d?void 0:()=>q(s),haptic:g},e)),_jsxs(View,{style:C.inputBox,children:[_jsx(TextInput,{ref:z,value:S,onChangeText:L,onKeyPress:D,onSubmitEditing:()=>M(S),onFocus:e=>{k(!0),b?.(e)},onBlur:()=>{k(!1),M(S)},editable:!d&&!B,placeholder:B||H?void 0:i,placeholderTextColor:v.colors["text-subtle"],submitBehavior:"submit",returnKeyType:"done",accessibilityLabel:r??i,style:[C.input,{color:v.colors["text-body"],fontSize:v.text.base.size}],testID:y?`${y}-input`:void 0}),H?_jsx(RequiredPlaceholder,{text:i??"",color:v.colors["text-subtle"],fontSize:v.text.base.size,weightStyle:fontFor(v,"normal")}):null]})]})});return _jsxs(View,{testID:y,children:[r?_jsx(FieldLabel,{size:c,required:u,children:r}):null,$,_jsx(FieldMessage,{size:c,error:R,text:R?n:o})]})});TagInput.displayName="TagInput";const buildStyles=e=>StyleSheet.create({wrap:{flex:1,flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,paddingVertical:e.space.xs},inputBox:{flexGrow:1,minWidth:80},input:{...fontFor(e,"normal"),padding:e.space.none}});export default TagInput;
1
+ "use strict";import{forwardRef,useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fontFor,useTheme}from"../../theme/index.js";import{mergeRefs,resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{Chip}from"../Chip/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,RequiredPlaceholder}from"../FieldBase/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const TagInput=forwardRef((e,t)=>{const{value:s,defaultValue:l,onChange:a,placeholder:i,label:r,helperText:o,error:n,required:u,disabled:d=!1,size:c="md",variant:p,maxTags:m,unique:x=!0,transform:f,separators:h=[","],haptic:g,onFocus:b,style:j,testID:v}=e;assertValidValue("TagInput","size",e.size,["sm","md","lg"]),assertValidValue("TagInput","variant",e.variant,["outline","filled","underline"]);const y=useTheme(),C=useMemo(()=>buildStyles(y),[y]),[T,F]=useControllableState({value:s,defaultValue:l??[],onChange:a}),[S,V]=useState(""),[w,I]=useState(!1),k=useRef(null),z=useMemo(()=>mergeRefs(k,t),[t]),_=useCallback(()=>{d||k.current?.focus()},[d]),B="number"==typeof m&&T.length>=m,R=!0===n||hasFieldText(n),H=u&&!r&&0===T.length&&0===S.length&&Boolean(i),M=useCallback(e=>{const t=f?f(e.trim()):e.trim();if(!t)return;if(B)return;if(x&&T.some(e=>e.toLowerCase()===t.toLowerCase()))return void V("");F([...T,t]),V("");const s=resolveHaptic(g,"selection");s&&triggerHaptic(s)},[B,g,F,T,f,x]),q=useCallback(e=>{const t=T.filter((t,s)=>s!==e);F(t);const s=resolveHaptic(g,"selection");s&&triggerHaptic(s)},[g,F,T]),D=useCallback(e=>{const t=h.find(t=>t.length>0&&e.includes(t));t?M(e.slice(0,e.indexOf(t))):V(e)},[M,h]),L=useCallback(e=>{d||"Backspace"===e.nativeEvent.key&&""===S&&T.length>0&&q(T.length-1)},[d,S,q,T.length]),P=useMemo(()=>T.map((e,t)=>({key:`${e}-${t}`,tag:e,index:t})),[T]),$=_jsx(FieldBase,{testID:v?`${v}-field`:void 0,size:c,variant:p,focused:w,disabled:d,error:R,filled:T.length>0||S.length>0,onPress:_,pressFeedback:!1,style:j,children:_jsxs(View,{style:C.wrap,children:[P.map(({key:e,tag:t,index:s})=>_jsx(Chip,{label:t,size:"sm",onRemove:d?void 0:()=>q(s),haptic:g},e)),_jsxs(View,{style:C.inputBox,children:[_jsx(TextInput,{ref:z,value:S,onChangeText:D,onKeyPress:L,onSubmitEditing:()=>M(S),onFocus:e=>{I(!0),b?.(e)},onBlur:()=>{I(!1),M(S)},editable:!d&&!B,placeholder:B||H?void 0:i,placeholderTextColor:y.colors["text-subtle"],submitBehavior:"submit",returnKeyType:"done",accessibilityLabel:r??i,style:[C.input,{color:y.colors["text-body"],fontSize:y.text.base.size}],testID:v?`${v}-input`:void 0}),H?_jsx(RequiredPlaceholder,{text:i??"",color:y.colors["text-subtle"],fontSize:y.text.base.size,weightStyle:fontFor(y,"normal")}):null]})]})});return _jsxs(View,{testID:v,children:[r?_jsx(FieldLabel,{size:c,required:u,children:r}):null,$,_jsx(FieldMessage,{size:c,error:R,text:R?n:o})]})});TagInput.displayName="TagInput";const buildStyles=e=>StyleSheet.create({wrap:{flex:1,flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,paddingVertical:e.space.xs},inputBox:{flexGrow:1,minWidth:80},input:{...fontFor(e,"normal"),padding:e.space.none}});export default TagInput;
@@ -1 +1 @@
1
- "use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Platform,StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,setNativeValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{claimAnchoredSurface}from"../../utils/placement.js";import{FOCUS_DELAY_MS,focusHost}from"../Menu/focusHost.js";import{Modal}from"../Modal/index.js";import{useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{RichTooltipBody}from"./RichTooltipBody.js";import{resolveTooltipPosition}from"./tooltipPosition.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TOOLTIP_LABELS=Object.freeze({close:"Close tooltip",longPressHint:"Long press for more info",fallbackName:"Tooltip"});const PRESS_AUTO_HIDE_MS=4e3,ARROW_HALF_WIDTH=4,ARROW_HEIGHT=6,ARROW_CORNER_PADDING=12,DEFAULT_MAX_WIDTH=240,RICH_MAX_WIDTH=280,MESSAGE_LINE_HEIGHT=18,EXIT_DURATION_MS=150,Tooltip=e=>{const{content:t,children:r,variant:o="plain",title:s,action:n,placement:i="auto",open:a,onOpenChange:l,hideOnContentPress:u=!0,maxWidth:c,showArrow:m=!0,accessibilityLabel:d,style:p,containerStyle:f,arrowStyle:h,messageStyle:g,labels:b,testID:T}=e;assertValidValue("Tooltip","variant",e.variant,["plain","rich"]),assertValidValue("Tooltip","placement",e.placement,["top","bottom","left","right","auto"]),assertValidValue("Tooltip","trigger",e.trigger,["longPress","press","manual"]);const v="rich"===o,S=e.trigger??(v?"press":"longPress"),A=useMemo(()=>({...DEFAULT_TOOLTIP_LABELS,...b}),[b]),R=useTheme(),y=usePresenceMotion(),_=useSafeAreaInsets(),[w,j]=useModalInsets(),x=useMemo(()=>({..._,top:w.top,bottom:w.bottom}),[_,w]),C=useWindowDimensions(),E=useMemo(()=>buildStyles(R),[R]),D=R.space.sm,M=R.space.sm,P=c??(v?280:240),V="press"===S&&!v,H=(R.settings.components.tooltip?.enableScaleAnimation??!1)&&!y.reduced,L="manual"===S||"boolean"==typeof a,[O,I]=useState(!1),W=L?Boolean(a):O,[k,N]=useState(null),[F,B]=useState({width:0,height:0}),U=useRef(null),z=useRef(null),G=useRef(null),X=useRef(null),Y=useRef(null),q=useRef(!1),J=useRef(!1),K=useRef(createAnimatedValue(W||!H?1:.85)).current,Q=useRef(createAnimatedValue(W?1:0)).current,Z=useRef(null),$=useRef(!1),[ee,te]=useState(W),re=useCallback(e=>{L||I(e),l?.(e)},[L,l]),oe=useCallback(()=>{U.current&&U.current.measureInWindow((e,t,r,o)=>{N({x:e,y:t,width:r,height:o})})},[]),se=useCallback(e=>{oe(),re(!0)},[oe,re]),ne=useCallback(()=>{re(!1)},[re]),ie=useRef(ne);ie.current=ne;const ae=useCallback(()=>{if(!q.current)return;q.current=!1;const e=Y.current;Y.current=null,e?e():v&&focusHost(z.current??U.current)},[v]);useEffect(()=>{if(W)return J.current=!0,q.current=!1,claimAnchoredSurface(()=>ie.current());J.current&&(J.current=!1,q.current=!0)},[W]),useEffect(()=>{W&&te(!0)},[W]);const le=useCallback(()=>{Y.current=n?.onPress??null,ne()},[n,ne]),ue=useRef({autoHide:V,scaleAnimates:H,presence:y,theme:R,handleHide:ne});ue.current={autoHide:V,scaleAnimates:H,presence:y,theme:R,handleHide:ne},useEffect(()=>{const{autoHide:e,scaleAnimates:t,presence:r,theme:o,handleHide:s}=ue.current;if(!$.current)return $.current=!0,W&&(oe(),e&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{s()},4e3))),()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)};let n;if(W){oe();const i=[Animated.timing(Q,{toValue:1,duration:r.duration("fast"),useNativeDriver:nativeDriver})];t?i.push(Animated.spring(K,{toValue:1,damping:o.motion.spring.snappy.damping,stiffness:o.motion.spring.snappy.stiffness,mass:o.motion.spring.snappy.mass,useNativeDriver:nativeDriver})):setNativeValue(K,1),n=Animated.parallel(i),n.start(),e&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{s()},4e3))}else{const e=[Animated.timing(Q,{toValue:0,duration:r.reduced?r.duration("fast"):150,easing:Easing.bezier(...o.motion.ease.accelerate),useNativeDriver:nativeDriver})];t&&e.push(Animated.timing(K,{toValue:.85,duration:150,easing:Easing.bezier(...o.motion.ease.accelerate),useNativeDriver:nativeDriver})),n=Animated.parallel(e),n.start(({finished:e})=>{e&&te(!1)}),Z.current&&(clearTimeout(Z.current),Z.current=null)}return()=>{n?.stop(),Z.current&&(clearTimeout(Z.current),Z.current=null)}},[W,oe,Q,K]);const handleContentLayout=e=>{const{width:t,height:r}=e.nativeEvent.layout;t===F.width&&r===F.height||B({width:t,height:r})},ce=useMemo(()=>resolveTooltipPosition({anchor:k,size:F,placement:i,rich:v,viewport:{width:C.width,height:C.height,insets:x},maxWidth:P,gap:D,padding:M,arrowCornerPadding:12}),[k,F,i,v,C.width,C.height,x,P,D,M]),me=null!==k&&F.width>0,de=W&&me;useEffect(()=>{if(!v||!de)return;const e="web"===Platform.OS?X:G,t=setTimeout(()=>focusHost(e.current),FOCUS_DELAY_MS);return()=>clearTimeout(t)},[v,de]),useEffect(()=>{!v&&de&&"ios"===Platform.OS&&"string"==typeof t&&announce(t)},[v,de,t]);const pe=r.props,fe=useMemo(()=>mergeRefs(pe.ref,z),[pe.ref]),he={};"longPress"!==S||pe.contextMenu?"press"===S&&(he.onPress=e=>{pe.onPress?.(e),se(e)}):(he.onLongPress=se,he.accessibilityHint=A.longPressHint),v&&(he.ref=fe);const ge=React.cloneElement(r,he),be=d??("string"==typeof t?t:A.fallbackName),Te=useMemo(()=>{if(!m)return null;const e={position:"absolute",width:0,height:0,backgroundColor:"transparent",borderStyle:"solid",borderLeftWidth:4,borderRightWidth:4,borderBottomWidth:6,borderTopWidth:0,borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:v?R.colors.surface:R.colors["surface-inverse"]};return"top"===ce.placement?{...e,bottom:-6,left:ce.arrowOffset-4,transform:[{rotate:"180deg"}]}:"bottom"===ce.placement?{...e,top:-6,left:ce.arrowOffset-4}:"left"===ce.placement?{...e,right:-6,top:ce.arrowOffset-4,transform:[{rotate:"90deg"}]}:{...e,left:-6,top:ce.arrowOffset-4,transform:[{rotate:"-90deg"}]}},[m,ce,R,v]),ve={position:"absolute",top:ce.top,left:ce.left,maxWidth:P,opacity:W&&!me?0:Q,transform:[{scale:K}]},Se=Te?_jsx(View,{style:[Te,h],pointerEvents:"none"}):null;return _jsxs(_Fragment,{children:[_jsx(View,{ref:U,collapsable:!1,onLayout:oe,testID:T,children:ge}),_jsxs(Modal,{open:ee,onClose:ne,presentation:"fullScreen",bare:!0,backdropOpacity:0,backdropPressClose:u,haptic:!1,labels:{close:A.close},onInsetsChange:j,onDismissed:ae,children:[ee&&v?_jsxs(Animated.View,{onLayout:handleContentLayout,style:[ve,f,p],children:[_jsx(RichTooltipBody,{title:s,content:t,action:n,onAction:le,focusRef:G,actionRef:X,messageStyle:g}),Se]}):null,ee&&!v?_jsxs(Animated.View,{accessibilityRole:"web"===Platform.OS?"tooltip":void 0,accessibilityLiveRegion:"polite",accessibilityLabel:be,onLayout:handleContentLayout,style:[ve,f,p],children:[_jsx(View,{style:[E.tooltip,{backgroundColor:R.colors["surface-inverse"],borderRadius:R.radius.md,...smoothCorners,paddingHorizontal:R.space.md,paddingVertical:R.space.sm,...R.shadow.popover,shadowColor:R.shadow.popover.shadowColor}],children:"string"==typeof t?_jsx(Text,{variant:"bodySmall",color:"inverse",style:{lineHeight:18,...StyleSheet.flatten(g)},children:t}):t}),Se]}):null]})]})},buildStyles=e=>StyleSheet.create({tooltip:{overflow:"hidden"}});export{Tooltip};export default Tooltip;
1
+ "use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Platform,StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,setNativeValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{claimAnchoredSurface}from"../../utils/placement.js";import{FOCUS_DELAY_MS,focusHost}from"../Menu/focusHost.js";import{Modal}from"../Modal/index.js";import{useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{RichTooltipBody}from"./RichTooltipBody.js";import{resolveTooltipPosition}from"./tooltipPosition.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TOOLTIP_LABELS=Object.freeze({close:"Close tooltip",longPressHint:"Long press for more info",fallbackName:"Tooltip"});const PRESS_AUTO_HIDE_MS=4e3,ARROW_HALF_WIDTH=4,ARROW_HEIGHT=6,ARROW_CORNER_PADDING=12,DEFAULT_MAX_WIDTH=240,RICH_MAX_WIDTH=280,MESSAGE_LINE_HEIGHT=18,EXIT_DURATION_MS=150,Tooltip=e=>{const{content:t,children:r,variant:o="plain",title:s,action:n,placement:i="auto",open:a,onOpenChange:l,hideOnContentPress:u=!0,maxWidth:c,showArrow:m=!0,accessibilityLabel:d,style:p,containerStyle:f,arrowStyle:h,messageStyle:g,labels:b,testID:T}=e;assertValidValue("Tooltip","variant",e.variant,["plain","rich"]),assertValidValue("Tooltip","placement",e.placement,["top","bottom","left","right","auto"]),assertValidValue("Tooltip","trigger",e.trigger,["longPress","press","manual"]);const v="rich"===o,S=e.trigger??(v?"press":"longPress"),A=useMemo(()=>({...DEFAULT_TOOLTIP_LABELS,...b}),[b]),R=useTheme(),y=usePresenceMotion(),_=useSafeAreaInsets(),[w,j]=useModalInsets(),x=useMemo(()=>({..._,top:w.top,bottom:w.bottom}),[_,w]),C=useWindowDimensions(),D=useMemo(()=>buildStyles(R),[R]),E=R.space.sm,M=R.space.sm,P=c??(v?280:240),V="press"===S&&!v,H=(R.settings.components.tooltip?.enableScaleAnimation??!1)&&!y.reduced,L="manual"===S||"boolean"==typeof a,[O,I]=useState(!1),W=L?Boolean(a):O,[k,N]=useState(null),[F,B]=useState({width:0,height:0}),U=useRef(null),z=useRef(null),G=useRef(null),X=useRef(null),Y=useRef(null),q=useRef(!1),J=useRef(!1),K=useRef(createAnimatedValue(W||!H?1:.85)).current,Q=useRef(createAnimatedValue(W?1:0)).current,Z=useRef(null),$=useRef(!1),[ee,te]=useState(W),re=useCallback(e=>{L||I(e),l?.(e)},[L,l]),oe=useCallback(()=>{U.current&&U.current.measureInWindow((e,t,r,o)=>{N({x:e,y:t,width:r,height:o})})},[]),se=useCallback(e=>{oe(),re(!0)},[oe,re]),ne=useCallback(()=>{re(!1)},[re]),ie=useRef(ne);ie.current=ne;const ae=useCallback(()=>{if(!q.current)return;q.current=!1;const e=Y.current;Y.current=null,e?e():v&&focusHost(z.current??U.current)},[v]);useEffect(()=>{if(W)return J.current=!0,q.current=!1,claimAnchoredSurface(()=>ie.current());J.current&&(J.current=!1,q.current=!0)},[W]),useEffect(()=>{W&&te(!0)},[W]);const le=useCallback(()=>{Y.current=n?.onPress??null,ne()},[n,ne]),ue=useRef({autoHide:V,scaleAnimates:H,presence:y,theme:R,handleHide:ne});ue.current={autoHide:V,scaleAnimates:H,presence:y,theme:R,handleHide:ne},useEffect(()=>{const{autoHide:e,scaleAnimates:t,presence:r,theme:o,handleHide:s}=ue.current;if(!$.current)return $.current=!0,W&&(oe(),e&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{s()},4e3))),()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)};let n;if(W){oe();const i=[Animated.timing(Q,{toValue:1,duration:r.duration("fast"),useNativeDriver:nativeDriver})];t?i.push(Animated.spring(K,{toValue:1,damping:o.motion.spring.snappy.damping,stiffness:o.motion.spring.snappy.stiffness,mass:o.motion.spring.snappy.mass,useNativeDriver:nativeDriver})):setNativeValue(K,1),n=Animated.parallel(i),n.start(),e&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{s()},4e3))}else{const e=[Animated.timing(Q,{toValue:0,duration:r.reduced?r.duration("fast"):150,easing:Easing.bezier(...o.motion.ease.accelerate),useNativeDriver:nativeDriver})];t&&e.push(Animated.timing(K,{toValue:.85,duration:150,easing:Easing.bezier(...o.motion.ease.accelerate),useNativeDriver:nativeDriver})),n=Animated.parallel(e),n.start(({finished:e})=>{e&&te(!1)}),Z.current&&(clearTimeout(Z.current),Z.current=null)}return()=>{n?.stop(),Z.current&&(clearTimeout(Z.current),Z.current=null)}},[W,oe,Q,K]);const handleContentLayout=e=>{const{width:t,height:r}=e.nativeEvent.layout;t===F.width&&r===F.height||B({width:t,height:r})},ce=useMemo(()=>resolveTooltipPosition({anchor:k,size:F,placement:i,rich:v,viewport:{width:C.width,height:C.height,insets:x},maxWidth:P,gap:E,padding:M,arrowCornerPadding:12}),[k,F,i,v,C.width,C.height,x,P,E,M]),me=null!==k&&F.width>0,de=W&&me;useEffect(()=>{if(!v||!de)return;const e="web"===Platform.OS?X:G,t=setTimeout(()=>focusHost(e.current),FOCUS_DELAY_MS);return()=>clearTimeout(t)},[v,de]),useEffect(()=>{!v&&de&&"ios"===Platform.OS&&"string"==typeof t&&announce(t)},[v,de,t]);const pe=r.props,fe=useMemo(()=>mergeRefs(pe.ref,z),[pe.ref]),he={};"longPress"!==S||pe.contextMenu?"press"===S&&(he.onPress=e=>{pe.onPress?.(e),se(e)}):(he.onLongPress=se,he.accessibilityHint=A.longPressHint),v&&(he.ref=fe);const ge=React.cloneElement(r,he),be=d??("string"==typeof t?t:A.fallbackName),Te=useMemo(()=>{if(!m)return null;const e={position:"absolute",width:0,height:0,backgroundColor:"transparent",borderStyle:"solid",borderLeftWidth:4,borderRightWidth:4,borderBottomWidth:6,borderTopWidth:0,borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:v?R.colors.surface:R.colors["surface-inverse"]};return"top"===ce.placement?{...e,bottom:-6,left:ce.arrowOffset-4,transform:[{rotate:"180deg"}]}:"bottom"===ce.placement?{...e,top:-6,left:ce.arrowOffset-4}:"left"===ce.placement?{...e,right:-6,top:ce.arrowOffset-4,transform:[{rotate:"90deg"}]}:{...e,left:-6,top:ce.arrowOffset-4,transform:[{rotate:"-90deg"}]}},[m,ce,R,v]),ve={position:"absolute",top:ce.top,left:ce.left,maxWidth:P,opacity:W&&!me?0:Q,transform:[{scale:K}]},Se=Te?_jsx(View,{style:[Te,h],pointerEvents:"none"}):null;return _jsxs(_Fragment,{children:[_jsx(View,{ref:U,collapsable:!1,onLayout:oe,testID:T,children:ge}),_jsxs(Modal,{open:ee,onClose:ne,presentation:"fullScreen",bare:!0,backdropOpacity:0,backdropPressClose:u,haptic:!1,labels:{close:A.close},onInsetsChange:j,onDismissed:ae,testID:T,children:[ee&&v?_jsxs(Animated.View,{onLayout:handleContentLayout,style:[ve,f,p],children:[_jsx(RichTooltipBody,{title:s,content:t,action:n,onAction:le,focusRef:G,actionRef:X,messageStyle:g}),Se]}):null,ee&&!v?_jsxs(Animated.View,{accessibilityRole:"web"===Platform.OS?"tooltip":void 0,accessibilityLiveRegion:"polite",accessibilityLabel:be,onLayout:handleContentLayout,style:[ve,f,p],children:[_jsx(View,{style:[D.tooltip,{backgroundColor:R.colors["surface-inverse"],borderRadius:R.radius.md,...smoothCorners,paddingHorizontal:R.space.md,paddingVertical:R.space.sm,...R.shadow.popover,shadowColor:R.shadow.popover.shadowColor}],children:"string"==typeof t?_jsx(Text,{variant:"bodySmall",color:"inverse",style:{lineHeight:18,...StyleSheet.flatten(g)},children:t}):t}),Se]}):null]})]})},buildStyles=e=>StyleSheet.create({tooltip:{overflow:"hidden"}});export{Tooltip};export default Tooltip;
@@ -1 +1 @@
1
- "use strict";import{useMemo,useRef}from"react";import{Animated,Easing}from"react-native";import{usePanGesture}from"react-native-gesture-handler";import{createAnimatedValue,setNativeValue,useTheme}from"../theme/index.js";import{nativeDriver}from"../utils/nativeDriver.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const DRAG_DISMISS_DISTANCE=100;export const DRAG_DISMISS_VELOCITY=.5;export const createDragToDismissController=({drag:e,travel:t,onDismiss:a,opacity:i},r,s)=>{const{snappy:n}=r.spring,springBack=()=>Animated.spring(e,{toValue:0,damping:n.damping,stiffness:n.stiffness,mass:n.mass,useNativeDriver:nativeDriver}).start(),o=!0===s?.reduced?i:void 0,u=s?.duration("default")??r.duration.default;return{move:t=>{setNativeValue(e,Math.max(0,t))},release:(i,s)=>{if(i>100||s>.5){if(o)return void Animated.timing(o,{toValue:0,duration:u,easing:Easing.bezier(...r.ease.accelerate),useNativeDriver:nativeDriver}).start(()=>a());Animated.timing(e,{toValue:"function"==typeof t?t():t,duration:r.duration.fast,easing:Easing.bezier(...r.ease.accelerate),useNativeDriver:nativeDriver}).start(()=>a())}else springBack()},cancel:springBack}};export const useDragToDismiss=e=>{const{drag:t,travel:a,onDismiss:i,contentAtTop:r,scrollGesture:s}=e,{motion:n}=useTheme(),o=usePresenceMotion(),u=useRef(createAnimatedValue(1)).current,c=useMemo(()=>createDragToDismissController({drag:t,travel:a,onDismiss:i,opacity:u},n,o),[t,a,i,u,n,o]),l=useMemo(()=>({runOnJS:!0,activeOffsetY:6,failOffsetX:[-12,12],onUpdate:e=>c.move(e.translationY),onDeactivate:e=>c.release(e.translationY,e.velocityY/1e3),onFinalize:e=>{e.canceled&&c.cancel()}}),[c]),m=usePanGesture(l),v=useMemo(()=>{let e=0,t=!1;return{runOnJS:!0,activeOffsetY:8,failOffsetX:[-12,12],simultaneousWith:s,onBegin:()=>{e=0,t=!1},onUpdate:a=>{if(!t){if(r&&!r())return;t=!0,e=a.translationY}c.move(a.translationY-e)},onDeactivate:a=>{t&&c.release(a.translationY-e,a.velocityY/1e3)},onFinalize:e=>{e.canceled&&t&&c.cancel()}}},[c,r,s]),f=usePanGesture(v);return useMemo(()=>({handleGesture:m,sheetGesture:f,opacity:u}),[m,f,u])};
1
+ "use strict";import{useMemo,useRef}from"react";import{Animated,Easing}from"react-native";import{usePanGesture}from"react-native-gesture-handler";import{createAnimatedValue,setNativeValue,useTheme}from"../theme/index.js";import{nativeDriver}from"../utils/nativeDriver.js";import{usePresenceMotion}from"./usePresenceMotion.js";export const DRAG_DISMISS_DISTANCE=100;export const DRAG_DISMISS_VELOCITY=.5;export const createDragToDismissController=({drag:e,travel:t,onDismiss:a,opacity:i},s,r)=>{const{snappy:n}=s.spring,springBack=()=>Animated.spring(e,{toValue:0,damping:n.damping,stiffness:n.stiffness,mass:n.mass,useNativeDriver:nativeDriver}).start(),o=!0===r?.reduced?i:void 0,u=r?.duration("default")??s.duration.default;return{move:t=>{setNativeValue(e,Math.max(0,t))},release:(i,r)=>{if(i>100||r>.5){if(o)return void Animated.timing(o,{toValue:0,duration:u,easing:Easing.bezier(...s.ease.accelerate),useNativeDriver:nativeDriver}).start(()=>a());Animated.timing(e,{toValue:"function"==typeof t?t():t,duration:s.duration.fast,easing:Easing.bezier(...s.ease.accelerate),useNativeDriver:nativeDriver}).start(()=>a())}else springBack()},cancel:springBack}};export const useDragToDismiss=e=>{const{drag:t,travel:a,onDismiss:i,contentAtTop:s,scrollGesture:r,testID:n}=e,{motion:o}=useTheme(),u=usePresenceMotion(),c=useRef(createAnimatedValue(1)).current,l=useMemo(()=>createDragToDismissController({drag:t,travel:a,onDismiss:i,opacity:c},o,u),[t,a,i,c,o,u]),m=useMemo(()=>({runOnJS:!0,activeOffsetY:6,failOffsetX:[-12,12],testID:n?`${n}-pan`:void 0,onUpdate:e=>l.move(e.translationY),onDeactivate:e=>l.release(e.translationY,e.velocityY/1e3),onFinalize:e=>{e.canceled&&l.cancel()}}),[l,n]),v=usePanGesture(m),f=useMemo(()=>{let e=0,t=!1;return{runOnJS:!0,activeOffsetY:8,failOffsetX:[-12,12],simultaneousWith:r,onBegin:()=>{e=0,t=!1},onUpdate:a=>{if(!t){if(s&&!s())return;t=!0,e=a.translationY}l.move(a.translationY-e)},onDeactivate:a=>{t&&l.release(a.translationY-e,a.velocityY/1e3)},onFinalize:e=>{e.canceled&&t&&l.cancel()}}},[l,s,r]),d=usePanGesture(f);return useMemo(()=>({handleGesture:v,sheetGesture:d,opacity:c}),[v,d,c])};
@@ -1 +1 @@
1
- "use strict";import{hasKey,isOneOf,isRecord,keysOf}from"../utils/guards.js";import{validateComponentTokens}from"./componentSizes.js";import{COLOR_NAMES,FONT_NAMES,RADIUS_NAMES,WEIGHT_NAMES}from"./tokens.generated.js";import{deriveSolidFill,deriveStateFills,deriveToneInk}from"./toneInk.js";const HINT="Run webority upgrade to rename old names.",BRAND_KEYS=["colors","radius","font"],COLOR_MODES=["light","dark"],FIXED_RADII=["none","pill"],RADIUS_ALLOWED="sm, md, lg, xl",SETTINGS_KEYS=["icons","gradients","textVariants","maxFontSizeMultiplier","components"],COMPONENT_SETTING_KEYS={field:{defaultVariant:!0,requiredMarker:!0},input:{defaultVariant:!0,defaultLabelMode:!0,tintLabelOnFocus:!0,shakeOnError:!0},"search-bar":{defaultVariant:!0},select:{defaultVariant:!0},"otp-input":{shakeOnError:!0},"option-sheet":{selectedMarker:!0},"profile-picker":{defaultTone:!0,defaultVariant:!0,defaultAvatarTone:!0},slider:{thumbPressAnimation:!0},rating:{pulseOnPress:!0},stepper:{pulseAnimation:!0},tooltip:{enableScaleAnimation:!0},toast:{enableSwipeDismiss:!0,defaultDurationMs:!0},button:{defaultVariant:!0,defaultSize:!0,defaultPressAnimation:!0},card:{defaultVariant:!0,defaultPadding:!0,defaultRadius:!0,defaultTitleFont:!0},"section-header":{defaultVariant:!0,defaultFlush:!0},"empty-state":{defaultSize:!0,defaultVariant:!0},screen:{tabBarFloats:!0,headerShadowOnScroll:!0}},isPlainObject=o=>"object"==typeof o&&null!==o&&!Array.isArray(o),validateBrand=o=>{if(void 0===o)return;if(!isPlainObject(o))throw new Error(`A brand is an object of colors, radius and font; got ${typeof o}. ${HINT}`);for(const e of Object.keys(o))if(!BRAND_KEYS.includes(e))throw new Error(`A brand sets colors, radius and font only; ${e} is not allowed (allowed: colors, radius, font). ${HINT}`);const e=o.colors;if(void 0!==e&&!isPlainObject(e))throw new Error(`A brand's colors is an object of light and dark; got ${typeof e}. ${HINT}`);if(isRecord(e))for(const o of Object.keys(e)){if(!COLOR_MODES.includes(o))throw new Error(`A brand sets colours under light and dark only; ${o} is not allowed (allowed: light, dark). ${HINT}`);const t=e[o];if(void 0===t)throw new Error(`A brand's ${o} colours are missing. ${HINT}`);if(!isRecord(t))throw new Error(`A brand's ${o} colours is an object of colour names; got ${typeof t}. ${HINT}`);for(const o of Object.keys(t)){if(!isOneOf(COLOR_NAMES,o))throw new Error(`unknown colour ${o}; allowed: ${COLOR_NAMES.join(", ")}. ${HINT}`);if(void 0!==t[o]&&"string"!=typeof t[o])throw new Error(`colour ${o} must be a string; got ${typeof t[o]}.`)}}const t=o.radius;if(void 0!==t){if(!isPlainObject(t))throw new Error(`A brand's radius is an object of radius names; got ${typeof t}. ${HINT}`);for(const o of Object.keys(t)){const e=t[o];if(!isOneOf(RADIUS_NAMES,o))throw new Error(`unknown radius ${o}; allowed: ${RADIUS_ALLOWED}. ${HINT}`);if(FIXED_RADII.includes(o))throw new Error(`radius ${o} is fixed by the library; allowed: ${RADIUS_ALLOWED}.`);if("number"!=typeof e||!Number.isFinite(e))throw new Error(`radius ${o} must be a number; got ${typeof e}.`)}}const n=o.font;if(void 0!==n){if(!isPlainObject(n))throw new Error(`A brand's font is an object of font names; got ${typeof n}. ${HINT}`);for(const o of Object.keys(n)){if(!isOneOf(FONT_NAMES,o))throw new Error(`unknown font ${o}; allowed: ${FONT_NAMES.join(", ")}. ${HINT}`);const e=n[o];if(!isPlainObject(e))throw new Error(`font ${o} must be an object of weights; got ${typeof e}. ${HINT}`);for(const t of Object.keys(e)){if(!isOneOf(WEIGHT_NAMES,t))throw new Error(`unknown font weight ${t} in font ${o}; allowed: ${WEIGHT_NAMES.join(", ")}. ${HINT}`);const n=e[t];if("string"!=typeof n||0===n.length)throw new Error(`font ${o} weight ${t} must be a non-empty string.`)}}}},validateSettings=o=>{if(void 0===o)return;if(!isPlainObject(o))throw new Error(`Theme settings is an object; got ${typeof o}. ${HINT}`);for(const e of Object.keys(o))if(!isOneOf(SETTINGS_KEYS,e))throw new Error(`Theme settings take ${SETTINGS_KEYS.join(", ")} only; ${e} is not allowed. ${HINT}`);const e=o.components;if(void 0!==e){if(!isPlainObject(e))throw new Error(`Theme settings components is an object of component names; got ${typeof e}. ${HINT}`);for(const o of Object.keys(e)){if(!hasKey(COMPONENT_SETTING_KEYS,o))throw new Error(`unknown component ${o} in theme settings; allowed: ${Object.keys(COMPONENT_SETTING_KEYS).join(", ")}. ${HINT}`);const t=e[o];if(void 0===t)continue;if(!isPlainObject(t))throw new Error(`theme settings for ${o} is an object; got ${typeof t}. ${HINT}`);const n=COMPONENT_SETTING_KEYS[o];for(const e of Object.keys(t))if(!(e in n))throw new Error(`unknown setting ${e} for ${o}; allowed: ${Object.keys(n).join(", ")}. ${HINT}`)}}},TONES=["primary","success","warning","danger","info"],setComponentSettings=(o,e,t)=>{o[e]=t},mergeComponentSettings=(o,e,t)=>({...hasKey(o,t)?o[t]:void 0,...void 0!==e&&hasKey(e,t)?e[t]:void 0});export const mergeBrand=(o,e,t)=>{validateBrand(e),validateSettings(t);const n={};for(const[t,r]of Object.entries(e?.colors?.[o.mode]??{}))void 0!==r&&(n[t]=r);const r={...o.colors,...n},colorOf=o=>{const e=r[o];if(void 0===e)throw new Error(`The theme has no colour ${o}.`);return e},i={...o.radius,...e?.radius},s={...o.font};if(void 0!==e?.font)for(const t of keysOf(e.font))s[t]={...o.font[t],...e.font[t]};const a=[colorOf("bg"),colorOf("bg-subtle"),colorOf("bg-muted")],f={};for(const e of TONES){const t="string"==typeof n[e];let r=colorOf(e);if(t||"string"==typeof n[`on-${e}`]){const o=deriveSolidFill(r,colorOf(`on-${e}`));o!==r&&(f[e]=o,r=o)}if(t&&"string"!=typeof n[`${e}-text`]&&(f[`${e}-text`]=deriveToneInk(r,a,o.mode)),"primary"===e&&(t||void 0!==f.primary)){const e=deriveStateFills(r,colorOf("on-primary"),{fill:o.colors.primary,hover:o.colors["primary-hover"],pressed:o.colors["primary-pressed"]});"string"!=typeof n["primary-hover"]&&(f["primary-hover"]=e.hover),"string"!=typeof n["primary-pressed"]&&(f["primary-pressed"]=e.pressed)}}const l=o.settings.components,d=t?.components,c={},u=new Set([...keysOf(l),...void 0===d?[]:keysOf(d)]);for(const o of u)setComponentSettings(c,o,mergeComponentSettings(l,d,o));const p=t?.maxFontSizeMultiplier??o.settings.maxFontSizeMultiplier,m={icons:{...o.settings.icons,...t?.icons},gradients:{...o.settings.gradients,...t?.gradients},textVariants:{...o.settings.textVariants,...t?.textVariants},components:c,...void 0===p?{}:{maxFontSizeMultiplier:p}},w={...o.colors};for(const o of COLOR_NAMES)w[o]=f[o]??r[o];const O={...o,colors:w,radius:i,font:s,settings:m};return validateComponentTokens(O),O};
1
+ "use strict";import{hasKey,isOneOf,isRecord,keysOf}from"../utils/guards.js";import{validateComponentTokens}from"./componentSizes.js";import{COLOR_NAMES,FONT_NAMES,RADIUS_NAMES,WEIGHT_NAMES}from"./tokens.generated.js";import{deriveSolidFill,deriveStateFills,deriveToneInk}from"./toneInk.js";const HINT="Run webority upgrade to rename old names.",BRAND_KEYS=["colors","descriptions","radius","font"],COLOR_MODES=["light","dark"],FIXED_RADII=["none","pill"],RADIUS_ALLOWED="sm, md, lg, xl",SETTINGS_KEYS=["icons","gradients","textVariants","maxFontSizeMultiplier","components"],COMPONENT_SETTING_KEYS={field:{defaultVariant:!0,requiredMarker:!0},input:{defaultVariant:!0,defaultLabelMode:!0,tintLabelOnFocus:!0,shakeOnError:!0},"search-bar":{defaultVariant:!0},select:{defaultVariant:!0},"otp-input":{shakeOnError:!0},"option-sheet":{selectedMarker:!0},"profile-picker":{defaultTone:!0,defaultVariant:!0,defaultAvatarTone:!0},slider:{thumbPressAnimation:!0},rating:{pulseOnPress:!0},stepper:{pulseAnimation:!0},tooltip:{enableScaleAnimation:!0},toast:{enableSwipeDismiss:!0,defaultDurationMs:!0},button:{defaultVariant:!0,defaultSize:!0,defaultPressAnimation:!0},card:{defaultVariant:!0,defaultPadding:!0,defaultRadius:!0,defaultTitleFont:!0},"section-header":{defaultVariant:!0,defaultFlush:!0},"empty-state":{defaultSize:!0,defaultVariant:!0},screen:{tabBarFloats:!0,headerShadowOnScroll:!0}},isPlainObject=o=>"object"==typeof o&&null!==o&&!Array.isArray(o),validateBrand=o=>{if(void 0===o)return;if(!isPlainObject(o))throw new Error(`A brand is an object of colors, radius and font; got ${typeof o}. ${HINT}`);for(const e of Object.keys(o))if(!BRAND_KEYS.includes(e))throw new Error(`A brand sets colors, descriptions, radius and font only; ${e} is not allowed (allowed: colors, descriptions, radius, font). ${HINT}`);const e=o.descriptions;if(void 0!==e){if(!isPlainObject(e))throw new Error(`A brand's descriptions is an object of colour names to a description; got ${typeof e}. ${HINT}`);for(const o of Object.keys(e)){const t=e[o];if("string"!=typeof t||""===t)throw new Error(`description of colour ${o} must be a non-empty string.`)}}const t=o.colors;if(void 0!==t&&!isPlainObject(t))throw new Error(`A brand's colors is an object of light and dark; got ${typeof t}. ${HINT}`);if(isRecord(t))for(const o of Object.keys(t)){if(!COLOR_MODES.includes(o))throw new Error(`A brand sets colours under light and dark only; ${o} is not allowed (allowed: light, dark). ${HINT}`);const n=t[o];if(void 0===n)throw new Error(`A brand's ${o} colours are missing. ${HINT}`);if(!isRecord(n))throw new Error(`A brand's ${o} colours is an object of colour names; got ${typeof n}. ${HINT}`);for(const o of Object.keys(n)){const t=isRecord(e)&&"string"==typeof e[o];if(!isOneOf(COLOR_NAMES,o)&&!t)throw new Error(`unknown colour ${o}; allowed: ${COLOR_NAMES.join(", ")}. ${HINT}`);if(void 0!==n[o]&&"string"!=typeof n[o])throw new Error(`colour ${o} must be a string; got ${typeof n[o]}.`)}}const n=o.radius;if(void 0!==n){if(!isPlainObject(n))throw new Error(`A brand's radius is an object of radius names; got ${typeof n}. ${HINT}`);for(const o of Object.keys(n)){const e=n[o];if(!isOneOf(RADIUS_NAMES,o))throw new Error(`unknown radius ${o}; allowed: ${RADIUS_ALLOWED}. ${HINT}`);if(FIXED_RADII.includes(o))throw new Error(`radius ${o} is fixed by the library; allowed: ${RADIUS_ALLOWED}.`);if("number"!=typeof e||!Number.isFinite(e))throw new Error(`radius ${o} must be a number; got ${typeof e}.`)}}const r=o.font;if(void 0!==r){if(!isPlainObject(r))throw new Error(`A brand's font is an object of font names; got ${typeof r}. ${HINT}`);for(const o of Object.keys(r)){if(!isOneOf(FONT_NAMES,o))throw new Error(`unknown font ${o}; allowed: ${FONT_NAMES.join(", ")}. ${HINT}`);const e=r[o];if(!isPlainObject(e))throw new Error(`font ${o} must be an object of weights; got ${typeof e}. ${HINT}`);for(const t of Object.keys(e)){if(!isOneOf(WEIGHT_NAMES,t))throw new Error(`unknown font weight ${t} in font ${o}; allowed: ${WEIGHT_NAMES.join(", ")}. ${HINT}`);const n=e[t];if("string"!=typeof n||0===n.length)throw new Error(`font ${o} weight ${t} must be a non-empty string.`)}}}},validateSettings=o=>{if(void 0===o)return;if(!isPlainObject(o))throw new Error(`Theme settings is an object; got ${typeof o}. ${HINT}`);for(const e of Object.keys(o))if(!isOneOf(SETTINGS_KEYS,e))throw new Error(`Theme settings take ${SETTINGS_KEYS.join(", ")} only; ${e} is not allowed. ${HINT}`);const e=o.components;if(void 0!==e){if(!isPlainObject(e))throw new Error(`Theme settings components is an object of component names; got ${typeof e}. ${HINT}`);for(const o of Object.keys(e)){if(!hasKey(COMPONENT_SETTING_KEYS,o))throw new Error(`unknown component ${o} in theme settings; allowed: ${Object.keys(COMPONENT_SETTING_KEYS).join(", ")}. ${HINT}`);const t=e[o];if(void 0===t)continue;if(!isPlainObject(t))throw new Error(`theme settings for ${o} is an object; got ${typeof t}. ${HINT}`);const n=COMPONENT_SETTING_KEYS[o];for(const e of Object.keys(t))if(!(e in n))throw new Error(`unknown setting ${e} for ${o}; allowed: ${Object.keys(n).join(", ")}. ${HINT}`)}}},TONES=["primary","success","warning","danger","info"],setComponentSettings=(o,e,t)=>{o[e]=t},mergeComponentSettings=(o,e,t)=>({...hasKey(o,t)?o[t]:void 0,...void 0!==e&&hasKey(e,t)?e[t]:void 0});export const mergeBrand=(o,e,t)=>{validateBrand(e),validateSettings(t);const n={};for(const[t,r]of Object.entries(e?.colors?.[o.mode]??{}))void 0!==r&&(n[t]=r);const r={...o.colors,...n},colorOf=o=>{const e=r[o];if(void 0===e)throw new Error(`The theme has no colour ${o}.`);return e},i={...o.radius,...e?.radius},s={...o.font};if(void 0!==e?.font)for(const t of keysOf(e.font))s[t]={...o.font[t],...e.font[t]};const a=[colorOf("bg"),colorOf("bg-subtle"),colorOf("bg-muted")],f={};for(const e of TONES){const t="string"==typeof n[e];let r=colorOf(e);if(t||"string"==typeof n[`on-${e}`]){const o=deriveSolidFill(r,colorOf(`on-${e}`));o!==r&&(f[e]=o,r=o)}if(t&&"string"!=typeof n[`${e}-text`]&&(f[`${e}-text`]=deriveToneInk(r,a,o.mode)),"primary"===e&&(t||void 0!==f.primary)){const e=deriveStateFills(r,colorOf("on-primary"),{fill:o.colors.primary,hover:o.colors["primary-hover"],pressed:o.colors["primary-pressed"]});"string"!=typeof n["primary-hover"]&&(f["primary-hover"]=e.hover),"string"!=typeof n["primary-pressed"]&&(f["primary-pressed"]=e.pressed)}}const d=o.settings.components,l=t?.components,c={},u=new Set([...keysOf(d),...void 0===l?[]:keysOf(l)]);for(const o of u)setComponentSettings(c,o,mergeComponentSettings(d,l,o));const p=t?.maxFontSizeMultiplier??o.settings.maxFontSizeMultiplier,O={icons:{...o.settings.icons,...t?.icons},gradients:{...o.settings.gradients,...t?.gradients},textVariants:{...o.settings.textVariants,...t?.textVariants},components:c,...void 0===p?{}:{maxFontSizeMultiplier:p}},m={...o.colors,...Object.fromEntries(Object.entries(n).filter(([o])=>!isOneOf(COLOR_NAMES,o))),...Object.fromEntries(COLOR_NAMES.map(o=>[o,f[o]??colorOf(o)]))},w={...o,colors:m,radius:i,font:s,settings:O};return validateComponentTokens(w),w};
@@ -126,6 +126,7 @@ export interface AppBarProps {
126
126
  * to override the default.
127
127
  */
128
128
  haptic?: HapticType | false | undefined;
129
+ /** The bar's root testID; the large variant's title row is `${testID}-title-row`. */
129
130
  testID?: string | undefined;
130
131
  }
131
132
  declare const AppBar: React.ForwardRefExoticComponent<AppBarProps & React.RefAttributes<HostInstance>>;
@@ -139,6 +139,7 @@ export interface AvatarProps {
139
139
  textStyle?: StyleProp<TextStyle> | undefined;
140
140
  /** Spoken text in its default English. Override any key to translate it or to change its wording. */
141
141
  labels?: Partial<AvatarLabels> | undefined;
142
+ /** Test id of the root; the built-in picture is `<testID>-image`. */
142
143
  testID?: string | undefined;
143
144
  }
144
145
  declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HostInstance>> & {
@@ -163,6 +163,7 @@ export interface BottomSheetProps {
163
163
  children?: React.ReactNode | undefined;
164
164
  accessibilityLabel?: string | undefined;
165
165
  accessibilityViewIsModal?: boolean | undefined;
166
+ /** Test handle root; the inner ScrollView, when `scrollable`, is `${testID}-scroll`. */
166
167
  testID?: string | undefined;
167
168
  }
168
169
  /**
@@ -52,6 +52,7 @@ export interface CarouselProps<T = unknown> {
52
52
  spacing?: number | undefined;
53
53
  containerStyle?: StyleProp<ViewStyle> | undefined;
54
54
  accessibilityLabel?: string | undefined;
55
+ /** Also derives `${testID}-list` for the slide FlatList. */
55
56
  testID?: string | undefined;
56
57
  /** Render a horizontal strip of 40x40 thumbnails below the carousel. */
57
58
  showThumbnails?: boolean | undefined;
@@ -63,6 +63,7 @@ export interface DateRangePickerProps extends PickerTriggerPassThroughProps {
63
63
  navButtonStyle?: StyleProp<ViewStyle> | undefined;
64
64
  /** Style override for the cancel/confirm footer buttons. */
65
65
  footerButtonStyle?: StyleProp<ViewStyle> | undefined;
66
+ /** The handle / title row's drag gesture is `${testID}-pan`. */
66
67
  testID?: string | undefined;
67
68
  }
68
69
  declare const DateRangePicker: ForwardRefExoticComponent<DateRangePickerProps & RefAttributes<HostInstance>>;
@@ -141,6 +141,7 @@ export interface FieldBaseProps {
141
141
  /** Drop the room below the field, for a field that sits tight on the content under it. */
142
142
  flushBottom?: boolean | undefined;
143
143
  style?: StyleProp<ViewStyle> | undefined;
144
+ /** Also derives `${testID}-press`, the box-press Pressable wrapping the field when `onPress` is set. */
144
145
  testID?: string | undefined;
145
146
  accessibilityRole?: AccessibilityRole | undefined;
146
147
  accessibilityLabel?: string | undefined;
@@ -57,6 +57,7 @@ export interface ImageGalleryProps {
57
57
  loading?: boolean | undefined;
58
58
  accessibilityLabel?: string | undefined;
59
59
  containerStyle?: StyleProp<ViewStyle> | undefined;
60
+ /** Also derives `${testID}-lightbox` for the lightbox Carousel. */
60
61
  testID?: string | undefined;
61
62
  }
62
63
  declare const ImageGallery: React.FC<ImageGalleryProps> & {
@@ -178,6 +178,7 @@ export interface InputProps extends Omit<TextInputProps, "style"> {
178
178
  accessibilityLabel?: string | undefined;
179
179
  /** Overrides for the password toggle's screen-reader names; merged over DEFAULT_INPUT_LABELS. */
180
180
  labels?: Partial<InputLabels> | undefined;
181
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
181
182
  testID?: string | undefined;
182
183
  }
183
184
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInputInstance>>;
@@ -34,7 +34,7 @@ export interface MenuProps {
34
34
  accessibilityLabel?: string | undefined;
35
35
  /** Accessible names of the tap-outside area (`close`, default 'Close menu') and of a submenu's Back row (`back`, default 'Back'). */
36
36
  labels?: Partial<MenuLabels> | undefined;
37
- /** On the trigger wrapper; the open menu takes `<testID>-menu` and its scrim `<testID>-scrim`. */
37
+ /** On the trigger wrapper; the open menu takes `<testID>-menu` and its dismiss backdrop `<testID>-modal-backdrop`. */
38
38
  testID?: string | undefined;
39
39
  }
40
40
  /**
@@ -59,6 +59,7 @@ export interface ModalProps {
59
59
  placement?: PlacementPreference | undefined;
60
60
  /** Horizontal alignment of the anchored presentation against the anchor. Default "center". */
61
61
  align?: PlacementAlign | undefined;
62
+ /** Test handle of the native modal; its dismiss-tap target is `${testID}-backdrop`. */
62
63
  testID?: string | undefined;
63
64
  /**
64
65
  * Draws no surface, radius, shadow, padding or width around children: the children are the card.
@@ -55,6 +55,7 @@ export interface NumberInputProps {
55
55
  unitStyle?: StyleProp<TextStyle> | undefined;
56
56
  labelStyle?: StyleProp<TextStyle> | undefined;
57
57
  textInputProps?: Omit<TextInputProps, "value" | "onChangeText" | "onBlur" | "keyboardType" | "editable"> | undefined;
58
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
58
59
  testID?: string | undefined;
59
60
  }
60
61
  declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<NumberInputRef>>;
@@ -130,7 +130,7 @@ export interface OptionSheetProps<T = SelectOption> {
130
130
  selectedOptionTextStyle?: StyleProp<TextStyle> | undefined;
131
131
  /** The haptic for the sheet's own open and dismiss; false turns it off. Default: the Modal's default. */
132
132
  haptic?: HapticType | false | undefined;
133
- /** Test selector on the sheet panel. */
133
+ /** Test selector on the sheet panel. The handle / title row's drag gesture is `${testID}-pan`. */
134
134
  testID?: string | undefined;
135
135
  }
136
136
  export declare function OptionSheet<T = SelectOption>(props: OptionSheetProps<T>): React.ReactElement;
@@ -201,6 +201,7 @@ export interface PhoneNumberInputProps extends Pick<TextInputProps, "returnKeyTy
201
201
  onFocus?: (() => void) | undefined;
202
202
  onBlur?: (() => void) | undefined;
203
203
  style?: StyleProp<ViewStyle> | undefined;
204
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
204
205
  testID?: string | undefined;
205
206
  }
206
207
  /** `+<code><national>`, presentational only; the value stays structured. */
@@ -117,6 +117,7 @@ export interface ProfilePickerProps<F extends PickedFile = PickedFile> {
117
117
  onError?: ((message: string) => void) | undefined;
118
118
  accessibilityLabel?: string | undefined;
119
119
  style?: StyleProp<ViewStyle> | undefined;
120
+ /** Test id of the root; the Avatar is `<testID>-avatar` and its picture `<testID>-avatar-image`. */
120
121
  testID?: string | undefined;
121
122
  }
122
123
  declare function ProfilePicker<F extends PickedFile = PickedFile>(props: ProfilePickerProps<F> & {
@@ -61,6 +61,7 @@ export interface ScreenProps<ItemT = unknown> {
61
61
  scrollRef?: React.Ref<ScrollViewInstance | FlatList<ItemT>> | undefined;
62
62
  onScroll?: ((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;
63
63
  contentContainerStyle?: StyleProp<ViewStyle> | undefined;
64
+ /** The root testID; the app bar takes `${testID}-app-bar`. */
64
65
  testID?: string | undefined;
65
66
  }
66
67
  /**
@@ -90,6 +90,7 @@ export interface SearchBarProps extends Omit<TextInputProps, "style" | "value" |
90
90
  /** Style applied to the search text, after the library's own size, colour and font. */
91
91
  inputStyle?: StyleProp<TextStyle> | undefined;
92
92
  accessibilityLabel?: string | undefined;
93
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
93
94
  testID?: string | undefined;
94
95
  }
95
96
  declare const SearchBar: ForwardRefExoticComponent<SearchBarProps & RefAttributes<TextInputInstance>>;
@@ -70,6 +70,11 @@ interface SliderCommonProps {
70
70
  labelShowDuration?: number | undefined;
71
71
  /** Override the label final opacity when visible (default 1). */
72
72
  labelOpacity?: number | undefined;
73
+ /**
74
+ * Test handles derived from it: `${testID}-track-press` on the track Pressable, `${testID}-track`
75
+ * on the track wrapper, `${testID}-fill` on the fill, `${testID}-thumb` on the low thumb, and
76
+ * `${testID}-pan` on the low thumb's pan gesture.
77
+ */
73
78
  testID?: string | undefined;
74
79
  }
75
80
  export interface SliderSingleProps extends SliderCommonProps {
@@ -76,6 +76,7 @@ interface SliderFieldCommonProps {
76
76
  boundStyle?: StyleProp<TextStyle> | undefined;
77
77
  sliderStyle?: StyleProp<ViewStyle> | undefined;
78
78
  inputStyle?: StyleProp<ViewStyle> | undefined;
79
+ /** Derives `${testID}-field` (the value box) and `${testID}-field-press` (its box-press wrapper); a range uses `-field-low` and `-field-high`. */
79
80
  testID?: string | undefined;
80
81
  }
81
82
  interface SliderFieldSingleProps extends SliderFieldCommonProps {
@@ -31,6 +31,7 @@ export interface TagInputProps {
31
31
  /** Called when the text field takes focus. */
32
32
  onFocus?: ((e: FocusEvent) => void) | undefined;
33
33
  style?: StyleProp<ViewStyle> | undefined;
34
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
34
35
  testID?: string | undefined;
35
36
  }
36
37
  /**
@@ -45,6 +45,8 @@ export interface UseDragToDismissOptions {
45
45
  contentAtTop?: (() => boolean) | undefined;
46
46
  /** The scrollable content's `useNativeGesture()`, so the sheet drag runs alongside its scroll. */
47
47
  scrollGesture?: SheetNativeGesture | undefined;
48
+ /** When set, the handle gesture gets the test id `${testID}-pan`. */
49
+ testID?: string | undefined;
48
50
  }
49
51
  export interface UseDragToDismissResult {
50
52
  /** Wrap the grab handle / title row in a `GestureDetector` with this. */
@@ -183,11 +183,14 @@ export interface ThemeSettings {
183
183
  components?: ComponentSettings | undefined;
184
184
  }
185
185
  /** A product's brand, generated by `webority brand` as theme/generated/brand.phone.js. Never spacing, text or component sizes. */
186
+ type BrandColors = Partial<Record<ColorName, string>> & Record<string, string | undefined>;
186
187
  export interface BrandOverrides {
187
188
  colors?: {
188
- light?: Partial<Record<ColorName, string>> | undefined;
189
- dark?: Partial<Record<ColorName, string>> | undefined;
189
+ light?: BrandColors | undefined;
190
+ dark?: BrandColors | undefined;
190
191
  } | undefined;
192
+ /** What each colour the brand adds is for, by name. A colour name the library does not define must be described here. */
193
+ descriptions?: Record<string, string> | undefined;
191
194
  radius?: Partial<Record<Exclude<RadiusName, "none" | "pill">, number>> | undefined;
192
195
  font?: Partial<Record<FontName, FontFaces>> | undefined;
193
196
  }
@@ -201,7 +204,10 @@ export interface SpringScale {
201
204
  bouncy: Spring;
202
205
  snappy: Spring;
203
206
  }
204
- export interface Theme extends Omit<TokenSet, "motion"> {
207
+ export interface Theme extends Omit<TokenSet, "motion" | "colors"> {
208
+ colors: TokenSet["colors"] & {
209
+ readonly [name: string]: string | undefined;
210
+ };
205
211
  motion: TokenSet["motion"] & {
206
212
  spring: SpringScale;
207
213
  fadeDuration: number;
@@ -126,6 +126,7 @@ export interface AppBarProps {
126
126
  * to override the default.
127
127
  */
128
128
  haptic?: HapticType | false | undefined;
129
+ /** The bar's root testID; the large variant's title row is `${testID}-title-row`. */
129
130
  testID?: string | undefined;
130
131
  }
131
132
  declare const AppBar: React.ForwardRefExoticComponent<AppBarProps & React.RefAttributes<HostInstance>>;
@@ -139,6 +139,7 @@ export interface AvatarProps {
139
139
  textStyle?: StyleProp<TextStyle> | undefined;
140
140
  /** Spoken text in its default English. Override any key to translate it or to change its wording. */
141
141
  labels?: Partial<AvatarLabels> | undefined;
142
+ /** Test id of the root; the built-in picture is `<testID>-image`. */
142
143
  testID?: string | undefined;
143
144
  }
144
145
  declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HostInstance>> & {
@@ -163,6 +163,7 @@ export interface BottomSheetProps {
163
163
  children?: React.ReactNode | undefined;
164
164
  accessibilityLabel?: string | undefined;
165
165
  accessibilityViewIsModal?: boolean | undefined;
166
+ /** Test handle root; the inner ScrollView, when `scrollable`, is `${testID}-scroll`. */
166
167
  testID?: string | undefined;
167
168
  }
168
169
  /**
@@ -52,6 +52,7 @@ export interface CarouselProps<T = unknown> {
52
52
  spacing?: number | undefined;
53
53
  containerStyle?: StyleProp<ViewStyle> | undefined;
54
54
  accessibilityLabel?: string | undefined;
55
+ /** Also derives `${testID}-list` for the slide FlatList. */
55
56
  testID?: string | undefined;
56
57
  /** Render a horizontal strip of 40x40 thumbnails below the carousel. */
57
58
  showThumbnails?: boolean | undefined;
@@ -63,6 +63,7 @@ export interface DateRangePickerProps extends PickerTriggerPassThroughProps {
63
63
  navButtonStyle?: StyleProp<ViewStyle> | undefined;
64
64
  /** Style override for the cancel/confirm footer buttons. */
65
65
  footerButtonStyle?: StyleProp<ViewStyle> | undefined;
66
+ /** The handle / title row's drag gesture is `${testID}-pan`. */
66
67
  testID?: string | undefined;
67
68
  }
68
69
  declare const DateRangePicker: ForwardRefExoticComponent<DateRangePickerProps & RefAttributes<HostInstance>>;
@@ -141,6 +141,7 @@ export interface FieldBaseProps {
141
141
  /** Drop the room below the field, for a field that sits tight on the content under it. */
142
142
  flushBottom?: boolean | undefined;
143
143
  style?: StyleProp<ViewStyle> | undefined;
144
+ /** Also derives `${testID}-press`, the box-press Pressable wrapping the field when `onPress` is set. */
144
145
  testID?: string | undefined;
145
146
  accessibilityRole?: AccessibilityRole | undefined;
146
147
  accessibilityLabel?: string | undefined;
@@ -57,6 +57,7 @@ export interface ImageGalleryProps {
57
57
  loading?: boolean | undefined;
58
58
  accessibilityLabel?: string | undefined;
59
59
  containerStyle?: StyleProp<ViewStyle> | undefined;
60
+ /** Also derives `${testID}-lightbox` for the lightbox Carousel. */
60
61
  testID?: string | undefined;
61
62
  }
62
63
  declare const ImageGallery: React.FC<ImageGalleryProps> & {
@@ -178,6 +178,7 @@ export interface InputProps extends Omit<TextInputProps, "style"> {
178
178
  accessibilityLabel?: string | undefined;
179
179
  /** Overrides for the password toggle's screen-reader names; merged over DEFAULT_INPUT_LABELS. */
180
180
  labels?: Partial<InputLabels> | undefined;
181
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
181
182
  testID?: string | undefined;
182
183
  }
183
184
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInputInstance>>;
@@ -34,7 +34,7 @@ export interface MenuProps {
34
34
  accessibilityLabel?: string | undefined;
35
35
  /** Accessible names of the tap-outside area (`close`, default 'Close menu') and of a submenu's Back row (`back`, default 'Back'). */
36
36
  labels?: Partial<MenuLabels> | undefined;
37
- /** On the trigger wrapper; the open menu takes `<testID>-menu` and its scrim `<testID>-scrim`. */
37
+ /** On the trigger wrapper; the open menu takes `<testID>-menu` and its dismiss backdrop `<testID>-modal-backdrop`. */
38
38
  testID?: string | undefined;
39
39
  }
40
40
  /**
@@ -59,6 +59,7 @@ export interface ModalProps {
59
59
  placement?: PlacementPreference | undefined;
60
60
  /** Horizontal alignment of the anchored presentation against the anchor. Default "center". */
61
61
  align?: PlacementAlign | undefined;
62
+ /** Test handle of the native modal; its dismiss-tap target is `${testID}-backdrop`. */
62
63
  testID?: string | undefined;
63
64
  /**
64
65
  * Draws no surface, radius, shadow, padding or width around children: the children are the card.
@@ -55,6 +55,7 @@ export interface NumberInputProps {
55
55
  unitStyle?: StyleProp<TextStyle> | undefined;
56
56
  labelStyle?: StyleProp<TextStyle> | undefined;
57
57
  textInputProps?: Omit<TextInputProps, "value" | "onChangeText" | "onBlur" | "keyboardType" | "editable"> | undefined;
58
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
58
59
  testID?: string | undefined;
59
60
  }
60
61
  declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<NumberInputRef>>;
@@ -130,7 +130,7 @@ export interface OptionSheetProps<T = SelectOption> {
130
130
  selectedOptionTextStyle?: StyleProp<TextStyle> | undefined;
131
131
  /** The haptic for the sheet's own open and dismiss; false turns it off. Default: the Modal's default. */
132
132
  haptic?: HapticType | false | undefined;
133
- /** Test selector on the sheet panel. */
133
+ /** Test selector on the sheet panel. The handle / title row's drag gesture is `${testID}-pan`. */
134
134
  testID?: string | undefined;
135
135
  }
136
136
  export declare function OptionSheet<T = SelectOption>(props: OptionSheetProps<T>): React.ReactElement;
@@ -201,6 +201,7 @@ export interface PhoneNumberInputProps extends Pick<TextInputProps, "returnKeyTy
201
201
  onFocus?: (() => void) | undefined;
202
202
  onBlur?: (() => void) | undefined;
203
203
  style?: StyleProp<ViewStyle> | undefined;
204
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
204
205
  testID?: string | undefined;
205
206
  }
206
207
  /** `+<code><national>`, presentational only; the value stays structured. */
@@ -117,6 +117,7 @@ export interface ProfilePickerProps<F extends PickedFile = PickedFile> {
117
117
  onError?: ((message: string) => void) | undefined;
118
118
  accessibilityLabel?: string | undefined;
119
119
  style?: StyleProp<ViewStyle> | undefined;
120
+ /** Test id of the root; the Avatar is `<testID>-avatar` and its picture `<testID>-avatar-image`. */
120
121
  testID?: string | undefined;
121
122
  }
122
123
  declare function ProfilePicker<F extends PickedFile = PickedFile>(props: ProfilePickerProps<F> & {
@@ -61,6 +61,7 @@ export interface ScreenProps<ItemT = unknown> {
61
61
  scrollRef?: React.Ref<ScrollViewInstance | FlatList<ItemT>> | undefined;
62
62
  onScroll?: ((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;
63
63
  contentContainerStyle?: StyleProp<ViewStyle> | undefined;
64
+ /** The root testID; the app bar takes `${testID}-app-bar`. */
64
65
  testID?: string | undefined;
65
66
  }
66
67
  /**
@@ -90,6 +90,7 @@ export interface SearchBarProps extends Omit<TextInputProps, "style" | "value" |
90
90
  /** Style applied to the search text, after the library's own size, colour and font. */
91
91
  inputStyle?: StyleProp<TextStyle> | undefined;
92
92
  accessibilityLabel?: string | undefined;
93
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
93
94
  testID?: string | undefined;
94
95
  }
95
96
  declare const SearchBar: ForwardRefExoticComponent<SearchBarProps & RefAttributes<TextInputInstance>>;
@@ -70,6 +70,11 @@ interface SliderCommonProps {
70
70
  labelShowDuration?: number | undefined;
71
71
  /** Override the label final opacity when visible (default 1). */
72
72
  labelOpacity?: number | undefined;
73
+ /**
74
+ * Test handles derived from it: `${testID}-track-press` on the track Pressable, `${testID}-track`
75
+ * on the track wrapper, `${testID}-fill` on the fill, `${testID}-thumb` on the low thumb, and
76
+ * `${testID}-pan` on the low thumb's pan gesture.
77
+ */
73
78
  testID?: string | undefined;
74
79
  }
75
80
  export interface SliderSingleProps extends SliderCommonProps {
@@ -76,6 +76,7 @@ interface SliderFieldCommonProps {
76
76
  boundStyle?: StyleProp<TextStyle> | undefined;
77
77
  sliderStyle?: StyleProp<ViewStyle> | undefined;
78
78
  inputStyle?: StyleProp<ViewStyle> | undefined;
79
+ /** Derives `${testID}-field` (the value box) and `${testID}-field-press` (its box-press wrapper); a range uses `-field-low` and `-field-high`. */
79
80
  testID?: string | undefined;
80
81
  }
81
82
  interface SliderFieldSingleProps extends SliderFieldCommonProps {
@@ -31,6 +31,7 @@ export interface TagInputProps {
31
31
  /** Called when the text field takes focus. */
32
32
  onFocus?: ((e: FocusEvent) => void) | undefined;
33
33
  style?: StyleProp<ViewStyle> | undefined;
34
+ /** Derives `${testID}-field` (the field box) and `${testID}-field-press` (its box-press wrapper). */
34
35
  testID?: string | undefined;
35
36
  }
36
37
  /**
@@ -45,6 +45,8 @@ export interface UseDragToDismissOptions {
45
45
  contentAtTop?: (() => boolean) | undefined;
46
46
  /** The scrollable content's `useNativeGesture()`, so the sheet drag runs alongside its scroll. */
47
47
  scrollGesture?: SheetNativeGesture | undefined;
48
+ /** When set, the handle gesture gets the test id `${testID}-pan`. */
49
+ testID?: string | undefined;
48
50
  }
49
51
  export interface UseDragToDismissResult {
50
52
  /** Wrap the grab handle / title row in a `GestureDetector` with this. */