@webority/mobile-ui 0.129.0 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas-kit/kit.js +2891 -2918
- package/dist/canvas-kit/manifest.json +241 -294
- package/dist/canvas-kit/release.json +6 -6
- package/lib/commonjs/components/AppLockOverlay/AppLockOverlay.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Banner/Banner.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Card/Card.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Confirm/confirm.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js +1 -1
- package/lib/commonjs/components/Drawer/Drawer.js +1 -1
- package/lib/commonjs/components/FieldBase/FieldBase.js +1 -1
- package/lib/commonjs/components/FilePicker/FilePicker.js +1 -1
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
- package/lib/commonjs/components/IconBadge/IconBadge.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/commonjs/components/Input/Input.js +1 -1
- package/lib/commonjs/components/ListItem/ListItem.js +1 -1
- package/lib/commonjs/components/Menu/Menu.js +1 -1
- package/lib/commonjs/components/Menu/MenuSurface.js +1 -1
- package/lib/commonjs/components/Menu/useContextMenu.js +1 -1
- package/lib/commonjs/components/Modal/Modal.js +1 -1
- package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
- package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +1 -1
- package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/commonjs/components/Radio/Radio.js +1 -1
- package/lib/commonjs/components/Rating/Rating.js +1 -1
- package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
- package/lib/commonjs/components/Select/Select.js +1 -1
- package/lib/commonjs/components/SliderField/SliderField.js +1 -1
- package/lib/commonjs/components/SquircleImage/SquircleImage.js +1 -1
- package/lib/commonjs/components/TimePicker/TimePicker.js +1 -1
- package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
- package/lib/commonjs/components/Tour/Tour.js +1 -1
- package/lib/commonjs/components/index.js +1 -1
- package/lib/commonjs/components/not-drawn.json +0 -1
- package/lib/commonjs/icons.js +1 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/navigation/DiscardGuard.js +1 -1
- package/lib/commonjs/sizes.js +1 -0
- package/lib/commonjs/squircle.js +1 -0
- package/lib/module/components/AppLockOverlay/AppLockOverlay.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Banner/Banner.js +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/module/components/Card/Card.js +1 -1
- package/lib/module/components/Checkbox/Checkbox.js +1 -1
- package/lib/module/components/Confirm/confirm.js +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +1 -1
- package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/module/components/Dialog/Dialog.js +1 -1
- package/lib/module/components/Drawer/Drawer.js +1 -1
- package/lib/module/components/FieldBase/FieldBase.js +1 -1
- package/lib/module/components/FilePicker/FilePicker.js +1 -1
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
- package/lib/module/components/IconBadge/IconBadge.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/module/components/Input/Input.js +1 -1
- package/lib/module/components/ListItem/ListItem.js +1 -1
- package/lib/module/components/Menu/Menu.js +1 -1
- package/lib/module/components/Menu/MenuSurface.js +1 -1
- package/lib/module/components/Menu/useContextMenu.js +1 -1
- package/lib/module/components/Modal/Modal.js +1 -1
- package/lib/module/components/OTPInput/OTPInput.js +1 -1
- package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/module/components/PickerTrigger/PickerTrigger.js +1 -1
- package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/module/components/Radio/Radio.js +1 -1
- package/lib/module/components/Rating/Rating.js +1 -1
- package/lib/module/components/SearchBar/SearchBar.js +1 -1
- package/lib/module/components/Select/Select.js +1 -1
- package/lib/module/components/SliderField/SliderField.js +1 -1
- package/lib/module/components/SquircleImage/SquircleImage.js +1 -1
- package/lib/module/components/TimePicker/TimePicker.js +1 -1
- package/lib/module/components/Tooltip/Tooltip.js +1 -1
- package/lib/module/components/Tour/Tour.js +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/components/not-drawn.json +0 -1
- package/lib/module/icons.js +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/navigation/DiscardGuard.js +1 -1
- package/lib/module/sizes.js +1 -0
- package/lib/module/squircle.js +1 -0
- package/lib/typescript/commonjs/components/AppLockOverlay/AppLockOverlay.d.ts +3 -3
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +7 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +1 -1
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +4 -4
- package/lib/typescript/commonjs/components/Calendar/calendarStyles.d.ts +4 -4
- package/lib/typescript/commonjs/components/Card/Card.d.ts +1 -3
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +3 -3
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/lib/typescript/commonjs/components/Descriptions/Descriptions.d.ts +2 -2
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +1 -1
- package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +4 -4
- package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +8 -6
- package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +5 -0
- package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +3 -3
- package/lib/typescript/commonjs/components/IconBadge/IconBadge.d.ts +4 -0
- package/lib/typescript/commonjs/components/IconBadge/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/Input/Input.d.ts +3 -2
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +7 -7
- package/lib/typescript/commonjs/components/Menu/Menu.d.ts +3 -3
- package/lib/typescript/commonjs/components/Menu/useContextMenu.d.ts +1 -1
- package/lib/typescript/commonjs/components/Modal/Modal.d.ts +4 -4
- package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +5 -5
- package/lib/typescript/commonjs/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -2
- package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +3 -3
- package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +5 -3
- package/lib/typescript/commonjs/components/Select/Select.d.ts +4 -3
- package/lib/typescript/commonjs/components/SliderField/SliderField.d.ts +2 -2
- package/lib/typescript/commonjs/components/SquircleImage/SquircleImage.d.ts +4 -3
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +3 -3
- package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +2 -2
- package/lib/typescript/commonjs/components/Tour/Tour.d.ts +1 -1
- package/lib/typescript/commonjs/components/index.d.ts +0 -2
- package/lib/typescript/commonjs/icons.d.ts +3 -0
- package/lib/typescript/commonjs/index.d.ts +7 -6
- package/lib/typescript/commonjs/sizes.d.ts +2 -0
- package/lib/typescript/commonjs/squircle.d.ts +2 -0
- package/lib/typescript/module/components/AppLockOverlay/AppLockOverlay.d.ts +3 -3
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +7 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts +1 -1
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +4 -4
- package/lib/typescript/module/components/Calendar/calendarStyles.d.ts +4 -4
- package/lib/typescript/module/components/Card/Card.d.ts +1 -3
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +3 -3
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/lib/typescript/module/components/Descriptions/Descriptions.d.ts +2 -2
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +1 -1
- package/lib/typescript/module/components/Drawer/Drawer.d.ts +4 -4
- package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +8 -6
- package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +5 -0
- package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +3 -3
- package/lib/typescript/module/components/IconBadge/IconBadge.d.ts +4 -0
- package/lib/typescript/module/components/IconBadge/index.d.ts +1 -1
- package/lib/typescript/module/components/Input/Input.d.ts +3 -2
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +7 -7
- package/lib/typescript/module/components/Menu/Menu.d.ts +3 -3
- package/lib/typescript/module/components/Menu/useContextMenu.d.ts +1 -1
- package/lib/typescript/module/components/Modal/Modal.d.ts +4 -4
- package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +5 -5
- package/lib/typescript/module/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -2
- package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +3 -3
- package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +5 -3
- package/lib/typescript/module/components/Select/Select.d.ts +4 -3
- package/lib/typescript/module/components/SliderField/SliderField.d.ts +2 -2
- package/lib/typescript/module/components/SquircleImage/SquircleImage.d.ts +4 -3
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +3 -3
- package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +2 -2
- package/lib/typescript/module/components/Tour/Tour.d.ts +1 -1
- package/lib/typescript/module/components/index.d.ts +0 -2
- package/lib/typescript/module/icons.d.ts +3 -0
- package/lib/typescript/module/index.d.ts +7 -6
- package/lib/typescript/module/sizes.d.ts +2 -0
- package/lib/typescript/module/squircle.d.ts +2 -0
- package/package.json +37 -7
- package/lib/commonjs/components/Notation/Notation.js +0 -1
- package/lib/commonjs/components/Notation/index.js +0 -1
- package/lib/module/components/Notation/Notation.js +0 -1
- package/lib/module/components/Notation/index.js +0 -1
- package/lib/typescript/commonjs/components/Notation/Notation.d.ts +0 -43
- package/lib/typescript/commonjs/components/Notation/index.d.ts +0 -3
- package/lib/typescript/module/components/Notation/Notation.d.ts +0 -43
- package/lib/typescript/module/components/Notation/index.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useDebounce}from"../../hooks/useDebounce.js";import{
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useDebounce}from"../../hooks/useDebounce.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{FieldBase,FieldLabel,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{normalizeSuggestion,SearchRecents,SearchScopeBar,SearchSuggestions}from"./SearchPanel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SEARCH_BAR_LABELS=Object.freeze({placeholder:"Search…",recents:"Recent searches",clearAll:"Clear all",clearAllRecents:"Clear all recent searches",searchAgain:"Searches again",removeRecent:e=>`Remove ${e} from recent searches`,scope:"Search scope",clearSearch:"Clear search",searching:e=>`Searching ${e}`,suggestionCount:e=>1===e?"1 suggestion":`${e} suggestions`,removed:e=>`Removed ${e}`,recentsCleared:"Recent searches cleared"});const DEFAULT_PANEL_ROWS=8,HOLD_RELEASE_MS=50,SearchBar=forwardRef((e,l)=>{const{value:s,onChangeText:a,onSubmit:o,onFocus:t,onBlur:r,placeholder:n,autoFocus:i=!1,disabled:c=!1,onClear:u,leftIcon:d,debounceMs:p,size:h="md",variant:b,radius:m,label:f,labelMode:S="top",labelStyle:g,scopes:v,scope:C,onScopeChange:x,recents:R,maxRecents:j=DEFAULT_PANEL_ROWS,onSelectRecent:y,onRemove:F,onClearRecents:_,suggestions:L,maxSuggestions:k=DEFAULT_PANEL_ROWS,onSelect:B,haptic:E,labels:A,style:I,inputStyle:T,accessibilityLabel:w,testID:z,...V}=e;warnInvalidValue("SearchBar","size",e.size,["sm","md","lg"]),warnInvalidValue("SearchBar","variant",e.variant,["outline","filled","underline"]),warnInvalidValue("SearchBar","labelMode",e.labelMode,["top","float"]);const H=useTheme(),M=useMemo(()=>({...DEFAULT_SEARCH_BAR_LABELS,...A}),[A]),D=n??M.placeholder,P=b??H.settings.components["search-bar"]?.defaultVariant??H.settings.components.field?.defaultVariant??"filled",O="underline"===P,N=resolveFieldSize(H,h),U=m??H.components["search-bar"][h].radius,W=resolveFieldTextStyle(H,{disabled:c}),$=useRef(null),q=useMemo(()=>mergeRefs($,l),[l]),K=useCallback(()=>{c||$.current?.focus()},[c]),G=useMemo(()=>buildStyles(H),[H]),J="string"==typeof s?s:"",[Q,X]=useState(!1),Y=useCallback(e=>{X(!0),t?.(e)},[t]),Z=useCallback(e=>{X(!1),r?.(e)},[r]),[ee,le]=useState(J),se=useDebounce(ee,p??0);useEffect(()=>{void 0!==p&&J!==ee&&le(J)},[J,p]);const ae=useRef(J);useEffect(()=>{void 0!==p&&se!==ae.current&&(ae.current=se,a(se))},[se,p,a]);const oe=useCallback(e=>{void 0===p?a(e):le(e)},[p,a]),te=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e),void 0!==p&&(le(""),ae.current=""),a(""),u?.()},[E,p,a,u]),re=useCallback(()=>{o?.(void 0!==p?ee:J)},[o,p,ee,J]),ne=void 0!==p?ee:J,ie=ne.length>0,[ce,ue]=useControllableState({value:C,defaultValue:v?.[0]?.value??"",onChange:x}),de=useCallback(e=>{ue(e);const l=v?.find(l=>l.value===e)?.label;l&&announce(M.searching(l))},[v,ue,M]),[pe,he]=useState(!1),be=useRef(null),me=useCallback(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),fe=useCallback(()=>{me(),he(!0)},[me]),Se=useCallback(()=>{me(),be.current=setTimeout(()=>he(!1),50)},[me]);useEffect(()=>me,[me]);const ge=!c&&(Q||pe),ve=useMemo(()=>(R??[]).slice(0,j),[R,j]),Ce=useMemo(()=>(L??[]).slice(0,k).map(normalizeSuggestion),[L,k]),xe=ge&&!ie&&ve.length>0,Re=ge&&ie&&Ce.length>0,je=Re?Ce.length:0,ye=je>0?M.suggestionCount(je):"";useEffect(()=>{ye&&announce(ye)},[ye]);const Fe=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e)},[E]),Le=useCallback(e=>{Fe(),$.current?.blur(),he(!1),y?.(e)},[Fe,y]),ke=useCallback(e=>{Fe(),$.current?.blur(),he(!1),B?.(e)},[Fe,B]),Be=useCallback(e=>{Fe(),F?.(e),announce(M.removed(e)),K()},[Fe,F,K,M]),Ee=useCallback(()=>{Fe(),_?.(),announce(M.recentsCleared),K()},[Fe,_,K,M]),Ae={size:N.icon,color:c?H.colors["text-disabled"]:H.colors["text-subtle"],disabled:c},Ie=d?renderSlotIcon(d,Ae):(H.settings.icons.search??defaultIcons.search)(Ae),Te=Boolean(f)&&"float"===S,we=useFloatingLabel({label:f,enabled:Te,floated:Q||ie,variant:P,sizeTokens:N,leadingOffset:N.icon+H.space.md,trailingOffset:ie?N.icon+H.space.md:0,paddingLeft:O?H.space.none:N["padding-x"],color:H.colors["field-label"],style:g}),ze=ie&&!c?_jsx(Pressable,{onPress:te,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:M.clearSearch,children:(H.settings.icons.close??defaultIcons.close)({size:N.icon,color:H.colors["text-muted"]})}):null;return _jsxs(View,{style:I,testID:z,children:[f&&!Te?_jsx(FieldLabel,{size:h,style:g,children:f}):null,_jsx(View,{style:G.root,children:_jsxs(View,{style:G.fieldWrap,children:[_jsx(FieldBase,{size:h,variant:P,focused:Q,disabled:c,filled:ie,minHeight:N["min-height"],paddingHorizontal:O?H.space.none:N["padding-x"],radius:U,leading:Ie,trailing:ze,topNotch:we.topNotch,onPress:K,pressFeedback:!1,accessibilityRole:"search",accessibilityLabel:w??D,children:_jsx(TextInput,{ref:q,style:[G.input,{fontSize:N.text,color:W.color,...W.weightStyle},T],value:ne,onChangeText:oe,onSubmitEditing:re,onFocus:Y,onBlur:Z,placeholder:!Te||Q||ie?D:void 0,placeholderTextColor:W.placeholderColor,autoFocus:i,editable:!c,returnKeyType:"search",selectionColor:resolveVariantColors(H,P).borderFocusedRepresentative,accessibilityLabel:w??D,accessibilityState:{disabled:c},"aria-disabled":c,...V})}),we.node]})}),v&&v.length>0?_jsx(SearchScopeBar,{scopes:v,scope:ce||(v[0]?.value??""),disabled:c,haptic:E,labels:M,onChange:de}):null,xe?_jsx(SearchRecents,{recents:ve,labels:M,onSelect:Le,onRemove:F?Be:void 0,onClear:_?Ee:void 0,onHold:fe,onRelease:Se}):null,Re?_jsx(SearchSuggestions,{suggestions:Ce,query:ne,onSelect:ke,onHold:fe,onRelease:Se}):null]})});SearchBar.displayName="SearchBar";const buildStyles=e=>StyleSheet.create({root:{flexDirection:"row",alignItems:"center",width:"100%",position:"relative",overflow:"visible"},fieldWrap:{flex:1,position:"relative",overflow:"visible"},input:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SearchBar};export default SearchBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,RequiredMark,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{TextInkContext}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SELECT_LABELS={placeholder:"Select…",noSelection:"No selection",selected:e=>`Selected: ${e}`,fallbackName:"Select",sheetName:"Options",searchPlaceholder:DEFAULT_OPTION_SHEET_LABELS.searchPlaceholder,empty:DEFAULT_OPTION_SHEET_LABELS.empty};const sameSelectValue=(e,t)=>String(e)===String(t),containsValue=(e,t)=>e.some(e=>sameSelectValue(e,t)),Select=forwardRef((e,t)=>{warnInvalidValue("Select","size",e.size,["sm","md","lg"]),warnInvalidValue("Select","variant",e.variant,["outline","filled","underline"]);const{options:l,getOptionLabel:i,getOptionValue:o,isOptionDisabled:
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,RequiredMark,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{TextInkContext}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SELECT_LABELS={placeholder:"Select…",noSelection:"No selection",selected:e=>`Selected: ${e}`,fallbackName:"Select",sheetName:"Options",searchPlaceholder:DEFAULT_OPTION_SHEET_LABELS.searchPlaceholder,empty:DEFAULT_OPTION_SHEET_LABELS.empty};const sameSelectValue=(e,t)=>String(e)===String(t),containsValue=(e,t)=>e.some(e=>sameSelectValue(e,t)),Select=forwardRef((e,t)=>{warnInvalidValue("Select","size",e.size,["sm","md","lg"]),warnInvalidValue("Select","variant",e.variant,["outline","filled","underline"]);const{options:l,getOptionLabel:i,getOptionValue:o,isOptionDisabled:n,getOptionDescription:r,getOptionIcon:s,placeholder:a,onOpenChange:c,searchable:d=!1,haptic:p,labels:u,label:h,help:x,title:S,required:m=!1,error:f,helperText:g,prefix:b,numberOfLines:v=1,disabled:y=!1,size:T="md",variant:C,leftIcon:j,rightIcon:L,chevronColor:_,chevronSize:O,radius:F,accessibilityLabel:E,labelStyle:V,style:I,triggerStyle:k,textStyle:z,optionStyle:A,selectedOptionStyle:H,optionTextStyle:w,selectedOptionTextStyle:P,testID:D}=e,B=!0===e.multi,N=u?{...DEFAULT_SELECT_LABELS,...u}:DEFAULT_SELECT_LABELS,M=useCallback(e=>i?i(e):e.label??"",[i]),R=useCallback(e=>o?o(e):e.value,[o]),U=useCallback(e=>n?n(e):!0===e.disabled,[n]),q=useCallback(e=>r?r(e):e.description,[r]),$=useCallback(e=>s?s(e):e.icon,[s]),G=useTheme(),J=useMemo(()=>buildStyles(G),[G]),K=resolveFieldSize(G,T),Q=resolveFieldTextStyle(G,{disabled:y}),W=C??G.settings.components.select?.defaultVariant??G.settings.components.field?.defaultVariant??"outline",[X,Y]=useState(!1),Z=useMemo(()=>{if(B){const t=e.value??[];return l.filter(e=>containsValue(t,R(e)))}const t=e.value;if(null==t)return[];const i=l.find(e=>sameSelectValue(R(e),t));return i?[i]:[]},[B,l,e.value,R]),ee=useCallback(()=>{if(y)return;const e=resolveHaptic(p,"selection");e&&triggerHaptic(e),Y(!0)},[y,p]),te=useCallback(()=>{Y(!1)},[]),le=useCallback(t=>{if(U(t))return;const l=R(t),i=resolveHaptic(p,"selection");if(i&&triggerHaptic(i),B){const t=e.value??[],i=containsValue(t,l)?t.filter(e=>!sameSelectValue(e,l)):[...t,l];return void e.onChange(i)}e.onChange(l),te()},[B,e,te,U,R,p]),ie=0===Z.length?a??N.placeholder:Z.map(e=>M(e)).join(", "),oe=0===Z.length,ne=!0===f||hasFieldText(f),re=hasFieldText(h),se=fieldTextAsString(h),ae=Math.round(1.4*K.text),ce=useMemo(()=>({fontSize:K.text,color:Q.placeholderColor}),[K.text,Q.placeholderColor]),de={color:y?G.colors["field-icon-disabled"]:X?G.colors["field-icon-focus"]:G.colors["field-icon"],size:K.icon,disabled:y,focused:X,error:ne},pe=0===Z.length?a??N.noSelection:N.selected(Z.map(e=>M(e)).join(", ")),ue=E??`${se??N.fallbackName}. ${pe}`;return _jsxs(View,{style:[J.container,I],testID:D,children:[re?_jsx(FieldLabel,{size:T,required:m,help:x,style:V,children:h}):null,_jsx(View,{ref:t,collapsable:!1,children:_jsxs(FieldBase,{size:T,variant:W,disabled:y,error:ne,filled:Z.length>0,onPress:ee,radius:F,paddingHorizontal:"underline"===W?G.space.none:void 0,accessibilityRole:"button",accessibilityLabel:ue,accessibilityState:{disabled:y,expanded:X},"aria-disabled":y,"aria-expanded":X,style:k,slotAlign:1===v?"center":"top",slotLineHeight:1===v?void 0:ae,leading:j?_jsx(View,{children:renderSlotIcon(j,de)}):null,trailing:L?_jsx(View,{children:renderSlotIcon(L,de)}):_jsx(Chevron,{color:_??(y?G.colors["text-disabled"]:G.colors["text-subtle"]),size:O??K.icon,open:X,style:J.chevron}),children:[hasFieldText(b)?"string"==typeof b||"number"==typeof b?_jsx(Text,{variant:"body",style:[J.prefix,{color:Q.placeholderColor,fontSize:K.text,lineHeight:1===v?void 0:ae,marginRight:G.space.xs}],children:b}):_jsx(View,{style:[J.prefixNode,{minHeight:1===v?void 0:ae,justifyContent:"center",marginRight:G.space.xs}],children:_jsx(Text,{variant:"body",style:[J.prefix,{color:Q.placeholderColor,fontSize:K.text,lineHeight:1===v?void 0:ae}],children:_jsx(TextInkContext.Provider,{value:ce,children:b})})}):null,_jsxs(Text,{variant:"body",style:[J.triggerText,{color:oe?Q.placeholderColor:Q.color,fontSize:K.text,lineHeight:1===v?void 0:ae,...Q.weightStyle},z],numberOfLines:v,children:[ie,oe&&m&&!re?_jsx(RequiredMark,{}):null]})]})}),_jsx(FieldMessage,{size:T,error:ne,text:ne?f:g}),_jsx(OptionSheet,{open:X,onClose:te,onOpenChange:c,haptic:p,title:S??se,accessibilityLabel:se??(re?S:void 0)??a??N.sheetName,options:l,getOptionLabel:M,getOptionValue:R,isOptionDisabled:U,getOptionDescription:q,getOptionIcon:$,value:e.value,onChange:(e,t)=>le(t),multi:B,searchable:d,labels:{searchPlaceholder:N.searchPlaceholder,empty:N.empty},optionStyle:A,selectedOptionStyle:H,optionTextStyle:w,selectedOptionTextStyle:P,searchSelectionColor:resolveVariantColors(G,W).borderFocusedRepresentative})]})});Select.displayName="Select";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},label:{includeFontPadding:!1},triggerText:{flex:1,includeFontPadding:!1},errorText:{includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},chevron:{marginLeft:e.space.sm}});export{Select};export default Select;
|
|
@@ -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{hitSlopMarker}from"../../utils/hitSlop.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.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:o,testID:r})=>{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:o,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:r})})},SliderField=forwardRef((e,l)=>{const{label:t,unit:i,info:a,required:s=!1,helperText:o,error:r,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:I=!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{hitSlopMarker}from"../../utils/hitSlop.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.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:o,testID:r})=>{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:o,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:r})})},SliderField=forwardRef((e,l)=>{const{label:t,unit:i,info:a,required:s=!1,helperText:o,error:r,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:I=!1,leftIcon:g,rightIcon:S,startLabel:j,endLabel:w,formatValue:v=defaultFormatValue,parseInput:T,animationDuration:_,inputWidth:F=DEFAULT_INPUT_WIDTH,labels:V,accessibilityLabel:D,style:L,labelStyle:B,boundStyle:z,sliderStyle:C,inputStyle:A,testID:k}=e;warnInvalidValue("SliderField","tone",e.tone,["primary","success","warning","danger","info","neutral"]),warnInvalidValue("SliderField","size",e.size,["sm","md","lg"]),warnInvalidValue("SliderField","variant",e.variant,["default","inset","minimal","bar"]);const E=useMemo(()=>({...DEFAULT_SLIDER_FIELD_LABELS,...V}),[V]),M=useTheme(),$=useMemo(()=>buildStyles(M),[M]),R=_??M.motion.duration.fast,P=!0===e.range,N=!0===r||hasFieldText(r),W=stepDecimals(c),[U,H]=useControllableState({value:e.value,defaultValue:e.defaultValue??(P?[n,d]:n),onChange:e.onChange}),[q,K]=P?U:[U,d],O=clampValue(Math.min(q,K),n,d),G=clampValue(Math.max(q,K),n,d),J=useValueDraft({value:O,min:n,max:d,step:c,format:v,parse:T,onChange:e=>H(P?[Math.min(e,G),G]:e)}),Q=useValueDraft({value:G,min:n,max:d,step:c,format:v,parse:T,onChange:e=>H([O,Math.max(e,O)])}),stepBy=e=>{const l=snapValue(O+e*c,n,d,c);l!==O&&H(l)},X={color:u?M.colors["text-disabled"]:M.colors["text-muted"],size:resolveFieldSize(M,"md").icon,disabled:u},Y=[$.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}),Z={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:Y,testID:k&&!P?`${k}-bubble`:void 0}):void 0,accessibilityLabel:D??t,style:C,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:[g?_jsx(View,{children:renderSlotIcon(g,X)}):null,I&&!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||O<=n,haptic:x,testID:k?`${k}-minus`:void 0}):null,P&&y?_jsx(ValueBox,{draft:J,error:N,disabled:u,width:F,accessibilityLabel:E.low(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input-low`:void 0}):f?boundText(j??v(n)):null,_jsx(View,{style:$.sliderWrap,children:_jsx(Slider,P?{...Z,range:!0,value:[O,G],onChange:H}:{...Z,value:O,onChange:H})}),P&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:F,accessibilityLabel:E.high(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input-high`:void 0}):f?boundText(w??v(d)):null,I&&!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||O>=d,haptic:x,testID:k?`${k}-plus`:void 0}):null,S?_jsx(View,{children:renderSlotIcon(S,X)}):null,!P&&y?_jsx(ValueBox,{draft:J,error:N,disabled:u,width:F,accessibilityLabel:E.current(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input`:void 0}):null]}),_jsx(FieldMessage,{text:N?r:o,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{Image}from"expo-image";import{Platform,StyleSheet,View}from"react-native";import Svg,{Path}from"react-native-svg";import{useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{squirclePath}from"../../utils/squircle.js";import{useSquircle}from"../SquircleFill/SquircleFill.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const CornerMask=({width:e,height:
|
|
1
|
+
"use strict";import{Image}from"expo-image";import{Platform,StyleSheet,View}from"react-native";import Svg,{Path}from"react-native-svg";import{radiusOf,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{squirclePath}from"../../utils/squircle.js";import{useSquircle}from"../SquircleFill/SquircleFill.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const CornerMask=({width:e,height:r,radius:o,color:t,smoothing:i})=>{const s=`M 0 0 H ${e} V ${r} H 0 Z ${squirclePath({width:e,height:r,radius:o,smoothing:i})}`;return _jsx(View,{pointerEvents:"none",style:StyleSheet.absoluteFill,children:_jsx(Svg,{width:e,height:r,viewBox:`0 0 ${e} ${r}`,children:_jsx(Path,{d:s,fill:t,fillRule:"evenodd"})})})},SquircleImage=({radius:e,cornerColor:r,style:o,onLayout:t,...i})=>{const s=useTheme(),l=radiusOf(s,e),a=useSquircle(l>0,l,t),u={borderRadius:l,overflow:"hidden"};if("ios"===Platform.OS){const e={...u,...smoothCorners};return _jsx(Image,{...i,onLayout:a.onLayout,style:[o,e]})}const n=a.active?a.size:null;return _jsxs(View,{style:[o,u],onLayout:a.onLayout,children:[_jsx(Image,{...i,style:StyleSheet.absoluteFill}),n?_jsx(CornerMask,{width:n.width,height:n.height,radius:l,color:r??s.colors.bg,smoothing:s.cornerSmoothing}):null]})};SquircleImage.displayName="SquircleImage";export{SquircleImage};export default SquircleImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import Button from"../Button/Button.js";import{Modal}from"../Modal/index.js";import{PickerTrigger}from"../PickerTrigger/PickerTrigger.js";import{Text}from"../Text/index.js";import{WheelPicker}from"../WheelPicker/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"});const range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import Button from"../Button/Button.js";import{Modal}from"../Modal/index.js";import{PickerTrigger}from"../PickerTrigger/PickerTrigger.js";import{Text}from"../Text/index.js";import{WheelPicker}from"../WheelPicker/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"});const range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{open:t,value:i,onChange:r,onClose:a,format:l="12h",minuteStep:o=1,labels:s,testID:n,style:u,containerStyle:m,headerLabelStyle:c,footerButtonStyle:p,formatValue:d,haptic:h,triggerLabels:g,label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:v,size:k,variant:T,clearable:I,onClear:P,leftIcon:j,trailing:H,triggerStyle:_,valueStyle:w,labelStyle:C,messageStyle:D,accessibilityLabel:L}=e,B={label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:v,size:k,variant:T,clearable:I,onClear:P,leftIcon:j,trailing:H,triggerStyle:_,valueStyle:w,labelStyle:C,messageStyle:D,accessibilityLabel:L};warnInvalidValue("TimePicker","format",e.format,["12h","24h"]),warnInvalidValue("TimePicker","minuteStep",e.minuteStep?.toString(),["1","5","15","30"]),warnInvalidValue("TimePicker","size",e.size,["sm","md","lg"]),warnInvalidValue("TimePicker","variant",e.variant,["outline","filled","underline"]);const $=useMemo(()=>({...DEFAULT_TIME_PICKER_LABELS,...s}),[s]),A=void 0!==e.open,[F,E]=useState(!1),V=A?t:F,N=A?n:n?`${n}-modal`:void 0,O=useTheme(),z=useMemo(()=>buildStyles(O),[O]),W=useCallback(()=>{A?a?.():E(!1)},[A,a]),R=useMemo(()=>"24h"===l?range(0,23):range(1,12),[l]),U=useMemo(()=>range(0,59,o),[o]),q=useMemo(()=>["AM","PM"],[]),K=useMemo(()=>{const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,o),{displayHour:a,period:s}=from24h(e,l);return{displayHour:a,minute:r,period:s,hour24:e}},[i,l,o]),[G,J]=useState(()=>{const e=R.indexOf(K.displayHour);return e>=0?e:0}),[Q,X]=useState(()=>{const e=U.indexOf(K.minute);return e>=0?e:0}),[Y,Z]=useState(()=>"PM"===K.period?1:0);useEffect(()=>{if(!V)return;const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,o),{displayHour:a,period:s}=from24h(e,l),n=R.indexOf(a);J(n>=0?n:0);const u=U.indexOf(r);X(u>=0?u:0),Z("PM"===s?1:0)},[V,i,l,o,R,U]);const ee=useCallback((e,t)=>{"hour"===e?J(Math.max(0,R.indexOf(Number(t)))):"minute"===e?X(Math.max(0,U.indexOf(Number(t)))):Z("PM"===t?1:0)},[R,U]),te=useCallback(()=>{!1!==h&&triggerHaptic("selection"),W()},[W,h]),ie=useCallback(()=>{const e=R[G]??0,t=q[Y]??"AM",i=to24h(e,t,l),a=U[Q]??0;!1!==h&&triggerHaptic("notificationSuccess"),r?.({hour:i,minute:a}),W()},[R,G,q,Y,U,Q,l,r,W,h]),re=useMemo(()=>{const e=R[G]??0,t=U[Q]??0;if("24h"===l)return`${pad2(e)}:${pad2(t)}`;const i=q[Y]??"AM";return`${pad2(e)}:${pad2(t)} ${i}`},[R,G,U,Q,q,Y,l]),ae=useMemo(()=>R.map(e=>({value:e,label:pad2(e),accessibilityLabel:$.hourItem(e)})),[R,$]),le=useMemo(()=>U.map(e=>({value:e,label:pad2(e),accessibilityLabel:$.minuteItem(e)})),[U,$]),oe=useMemo(()=>q.map(e=>({value:e,label:e})),[q]),se=useMemo(()=>{const e=[{key:"hour",label:$.hour,items:ae,value:R[G]??0,separator:":",testID:"time-picker-hour"},{key:"minute",label:$.minute,items:le,value:U[Q]??0,gapAfter:"12h"===l?O.space.md:void 0,testID:"time-picker-minute"}];return"12h"===l&&e.push({key:"period",label:$.period,items:oe,value:q[Y]??"AM",testID:"time-picker-period"}),e},[ae,le,oe,R,G,U,Q,q,Y,l,O.space.md,$]),ne=useCallback(e=>{if("24h"===l)return`${pad2(e.hour)}:${pad2(e.minute)}`;const{displayHour:t,period:i}=from24h(e.hour,"12h");return`${t}:${pad2(e.minute)} ${i}`},[l]),ue=!A&&i&&Number.isFinite(i.hour)&&Number.isFinite(i.minute)?(d??ne)(i):void 0,me=_jsxs(Modal,{open:V,onClose:W,presentation:"bottom",accessibilityLabel:$.title,haptic:h,contentStyle:[m,u],testID:N,children:[_jsx(Text,{variant:"title",align:"center",accessibilityRole:"header",style:[z.title,c],children:$.title}),_jsx(View,{style:z.summaryWrap,accessibilityLiveRegion:"polite",accessibilityLabel:$.selected(re),children:_jsx(Text,{variant:"h2",weight:"bold",color:"brand",style:z.summary,children:re})}),_jsx(WheelPicker,{columns:se,onChange:ee,haptic:h,style:z.wheels}),_jsxs(View,{style:z.footer,children:[_jsx(Button,{label:$.cancel,haptic:!1,variant:"ghost",tone:"neutral",onPress:te,style:[z.footerBtn,p],accessibilityHint:$.cancelHint,testID:"time-picker-cancel"}),_jsx(Button,{label:$.confirm,variant:"solid",tone:"primary",haptic:!1,onPress:ie,style:[z.footerBtn,p],accessibilityHint:$.confirmHint,testID:"time-picker-confirm"})]})]});return A?me:_jsxs(_Fragment,{children:[_jsx(PickerTrigger,{...B,labels:g,value:ue,onPress:()=>E(!0),testID:n}),me]})},buildStyles=e=>StyleSheet.create({title:{marginBottom:e.space.sm},summaryWrap:{alignItems:"center",marginBottom:e.space.md},summary:{letterSpacing:e["letter-spacing"].wide},wheels:{marginBottom:e.space.lg},footer:{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:e.space.sm},footerBtn:{paddingHorizontal:e.space.lg}});export{TimePicker};export default TimePicker;
|
|
@@ -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{smoothCorners}from"../../utils/corners.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{claimAnchoredSurface}from"../../utils/placement.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.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:o,variant:r="plain",title:s,action:n,placement:i="auto",
|
|
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{smoothCorners}from"../../utils/corners.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{claimAnchoredSurface}from"../../utils/placement.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.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:o,variant:r="plain",title:s,action:n,placement:i="auto",open:a,onOpenChange:l,hideOnContentPress:u=!0,maxWidth:c,showArrow:m=!0,accessibilityLabel:p,style:f,containerStyle:d,arrowStyle:h,messageStyle:g,labels:b,testID:T}=e;warnInvalidValue("Tooltip","variant",e.variant,["plain","rich"]),warnInvalidValue("Tooltip","placement",e.placement,["top","bottom","left","right","auto"]),warnInvalidValue("Tooltip","trigger",e.trigger,["longPress","press","manual"]);const S="rich"===r,w=e.trigger??(S?"press":"longPress"),y=useMemo(()=>({...DEFAULT_TOOLTIP_LABELS,...b}),[b]),R=useTheme(),A=usePresenceMotion(),_=useSafeAreaInsets(),[v,x]=useModalInsets(),j=useMemo(()=>({..._,top:v.top,bottom:v.bottom}),[_,v]),C=useWindowDimensions(),E=useMemo(()=>buildStyles(R),[R]),I=R.space.sm,M=R.space.sm,P=c??(S?280:240),L="press"===w&&!S,O=(R.settings.components.tooltip?.enableScaleAnimation??!1)&&!A.reduced,D="manual"===w||"boolean"==typeof a,[V,H]=useState(!1),W=D?Boolean(a):V,[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||!O?1:.85)).current,Q=useRef(createAnimatedValue(W?1:0)).current,Z=useRef(null),$=useRef(!1),[ee,te]=useState(W),oe=useCallback(e=>{D||H(e),l?.(e)},[D,l]),re=useCallback(()=>{U.current&&U.current.measureInWindow((e,t,o,r)=>{N({x:e,y:t,width:o,height:r})})},[]),se=useCallback(e=>{re(),oe(!0)},[re,oe]),ne=useCallback(()=>{oe(!1)},[oe]),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():S&&focusHost(z.current??U.current)},[S]);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]);useEffect(()=>{if(!$.current)return $.current=!0,W&&(re(),L&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{ne()},4e3))),()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)};let e;if(W){re();const t=[Animated.timing(Q,{toValue:1,duration:A.duration("fast"),useNativeDriver:!0})];O?t.push(Animated.spring(K,{toValue:1,damping:R.motion.spring.snappy.damping,stiffness:R.motion.spring.snappy.stiffness,mass:R.motion.spring.snappy.mass,useNativeDriver:!0})):setNativeValue(K,1),e=Animated.parallel(t),e.start(),L&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{ne()},4e3))}else{const t=[Animated.timing(Q,{toValue:0,duration:A.reduced?A.duration("fast"):150,easing:Easing.bezier(...R.motion.ease.accelerate),useNativeDriver:!0})];O&&t.push(Animated.timing(K,{toValue:.85,duration:150,easing:Easing.bezier(...R.motion.ease.accelerate),useNativeDriver:!0})),e=Animated.parallel(t),e.start(({finished:e})=>{e&&te(!1)}),Z.current&&(clearTimeout(Z.current),Z.current=null)}return()=>{e?.stop(),Z.current&&(clearTimeout(Z.current),Z.current=null)}},[W]);const handleContentLayout=e=>{const{width:t,height:o}=e.nativeEvent.layout;t===F.width&&o===F.height||B({width:t,height:o})},ue=useMemo(()=>resolveTooltipPosition({anchor:k,size:F,placement:i,rich:S,viewport:{width:C.width,height:C.height,insets:j},maxWidth:P,gap:I,padding:M,arrowCornerPadding:12}),[k,F,i,S,C.width,C.height,j,P,I,M]),ce=null!==k&&F.width>0,me=W&&ce;useEffect(()=>{if(!S||!me)return;const e="web"===Platform.OS?X:G,t=setTimeout(()=>focusHost(e.current),FOCUS_DELAY_MS);return()=>clearTimeout(t)},[S,me]),useEffect(()=>{!S&&me&&"ios"===Platform.OS&&"string"==typeof t&&announce(t)},[S,me,t]);const pe=o.props,fe=useMemo(()=>mergeRefs(pe.ref,z),[pe.ref]),de={};"longPress"!==w||pe.contextMenu?"press"===w&&(de.onPress=e=>{pe.onPress?.(e),se(e)}):(de.onLongPress=se,de.accessibilityHint=y.longPressHint),S&&(de.ref=fe);const he=React.cloneElement(o,de),ge=p??("string"==typeof t?t:y.fallbackName),be=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:S?R.colors.surface:R.colors["surface-inverse"]};return"top"===ue.placement?{...e,bottom:-6,left:ue.arrowOffset-4,transform:[{rotate:"180deg"}]}:"bottom"===ue.placement?{...e,top:-6,left:ue.arrowOffset-4}:"left"===ue.placement?{...e,right:-6,top:ue.arrowOffset-4,transform:[{rotate:"90deg"}]}:{...e,left:-6,top:ue.arrowOffset-4,transform:[{rotate:"-90deg"}]}},[m,ue,R,S]),Te={position:"absolute",top:ue.top,left:ue.left,maxWidth:P,opacity:W&&!ce?0:Q,transform:[{scale:K}]},Se=be?_jsx(View,{style:[be,h],pointerEvents:"none"}):null;return _jsxs(_Fragment,{children:[_jsx(View,{ref:U,collapsable:!1,onLayout:re,testID:T,children:he}),_jsxs(Modal,{open:ee,onClose:ne,presentation:"fullScreen",bare:!0,backdropOpacity:0,backdropPressClose:u,haptic:!1,labels:{close:y.close},onInsetsChange:x,onDismissed:ae,children:[ee&&S?_jsxs(Animated.View,{onLayout:handleContentLayout,style:[Te,d,f],children:[_jsx(RichTooltipBody,{title:s,content:t,action:n,onAction:le,focusRef:G,actionRef:X,messageStyle:g}),Se]}):null,ee&&!S?_jsxs(Animated.View,{accessibilityRole:"web"===Platform.OS?"tooltip":void 0,accessibilityLiveRegion:"polite",accessibilityLabel:ge,onLayout:handleContentLayout,style:[Te,d,f],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 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,StyleSheet,useWindowDimensions,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_TOUR_LABELS=Object.freeze({back:"Back",next:"Next",skip:"Skip",done:"Done",position:(e,t)=>`Step ${e} of ${t}`});const MAX_CARD_WIDTH=360,HIGHLIGHT_BORDER_WIDTH=2,measureInWindow=e=>new Promise(t=>{const i=e.current;i?i.measureInWindow((e,i,s,n)=>t({x:e,y:i,width:s,height:n})):t(null)}),isOnScreen=(e,t)=>e.width>0&&e.height>0&&e.x<t.width&&e.y<t.height&&e.x+e.width>0&&e.y+e.height>0,Tour=({tourId:e,steps:t,
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,StyleSheet,useWindowDimensions,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_TOUR_LABELS=Object.freeze({back:"Back",next:"Next",skip:"Skip",done:"Done",position:(e,t)=>`Step ${e} of ${t}`});const MAX_CARD_WIDTH=360,HIGHLIGHT_BORDER_WIDTH=2,measureInWindow=e=>new Promise(t=>{const i=e.current;i?i.measureInWindow((e,i,s,n)=>t({x:e,y:i,width:s,height:n})):t(null)}),isOnScreen=(e,t)=>e.width>0&&e.height>0&&e.x<t.width&&e.y<t.height&&e.x+e.width>0&&e.y+e.height>0,Tour=({tourId:e,steps:t,open:i,onClose:s,seenStore:n,labels:r,haptic:o,testID:a})=>{const c=useTheme(),l=usePresenceMotion().duration("fast"),u=useMemo(()=>buildStyles(c),[c]),d=useWindowDimensions(),h=useRef(d);h.current=d;const m=c.space.sm,p=c.space.sm,x=useMemo(()=>({...DEFAULT_TOUR_LABELS,...r}),[r]),[f,b]=useState(null),[g,y]=useState(0),w=useRef(createAnimatedValue(0)).current,j=useRef(t);j.current=t;const S=useRef(x);S.current=x;const _=useRef(s);_.current=s;const k=useRef(n);k.current=n;const T=useCallback(async(e,t)=>{for(let i=e;i>=0&&i<j.current.length;i+=t){const e=await measureInWindow(j.current[i].target);if(e&&isOnScreen(e,h.current))return{index:i,rect:e}}return null},[]);useEffect(()=>{if(!i)return void b(null);let t=!1;return(async()=>{const i=k.current;if(i&&await i.isSeen(e))return void(t||_.current("alreadySeen"));const s=await T(0,1);t||(s?(y(s.index),b(s)):_.current("noTargets"))})(),()=>{t=!0}},[i,e,T]),useEffect(()=>{if(!f)return;const e=j.current[f.index],t=S.current.position(f.index+1,j.current.length);AccessibilityInfo.announceForAccessibility([t,e.title,e.description].filter(Boolean).join(". ")),w.setValue(0);const i=Animated.timing(w,{toValue:1,duration:l,useNativeDriver:!0});return i.start(),()=>i.stop()},[f,w,l]);const v=useCallback(async t=>{b(null),await(k.current?.markSeen(e)),_.current(t)},[e]),C=useCallback(async()=>{if(!f)return;const e=await T(f.index+1,1);e?b(e):await v("finished")},[f,T,v]),D=useCallback(async()=>{if(!f)return;const e=await T(f.index-1,-1);e&&b(e)},[f,T]),M=useCallback(()=>{v("skipped")},[v]),R=f?t[f.index]:void 0,I=!!f&&f.index===t.length-1,A=c.space.xs,V=f?{x:f.rect.x-A,y:f.rect.y-A,width:f.rect.width+2*A,height:f.rect.height+2*A}:null,B=Math.min(d.width-2*p,360),E=V?(()=>{const e=V.x+V.width/2,t=Math.max(p,Math.min(e-B/2,d.width-B-p)),i=V.y,s=d.height-(V.y+V.height);return s>=i?{left:t,top:V.y+V.height+m,maxHeight:Math.max(s-m-p,0)}:{left:t,bottom:d.height-V.y+m,maxHeight:Math.max(i-m-p,0)}})():null,L=c.colors.scrim,W=V?Math.min(R?.radius?c.radius[R.radius]+A:c.radius.md,Math.min(V.width,V.height)/2):0,P=Math.max(d.width,d.height);return _jsx(Modal,{open:null!==f,onClose:M,presentation:"fullScreen",backdropPressClose:!1,backdropStyle:u.transparent,contentStyle:u.transparent,accessibilityLabel:R?.title??R?.description,haptic:o,testID:a,children:V&&E&&R?_jsxs(View,{style:StyleSheet.absoluteFill,children:[_jsx(View,{style:[u.dim,{borderColor:L,borderWidth:P,top:V.y-P,left:V.x-P,width:V.width+2*P,height:V.height+2*P,borderRadius:W+P}]}),_jsx(View,{pointerEvents:"none",style:[u.highlight,{top:V.y,left:V.x,width:V.width,height:V.height,borderRadius:W}]}),_jsxs(Animated.View,{accessibilityLiveRegion:"polite",style:[u.card,E,{width:B,opacity:w}],testID:a?`${a}-card`:void 0,children:[_jsx(Text,{variant:"caption",children:x.position((f?.index??0)+1,t.length)}),R.title?_jsx(Text,{variant:"title",accessibilityRole:"header",children:R.title}):null,_jsx(Text,{variant:"bodySmall",children:R.description}),_jsxs(View,{style:u.actions,children:[_jsx(Button,{label:x.skip,variant:"ghost",size:"sm",haptic:o,onPress:M,testID:a?`${a}-skip`:void 0}),_jsxs(View,{style:u.navigation,children:[f&&f.index>g?_jsx(Button,{label:x.back,variant:"outline",size:"sm",haptic:o,onPress:()=>{D()},testID:a?`${a}-back`:void 0}):null,_jsx(Button,{label:I?x.done:x.next,size:"sm",haptic:o,onPress:()=>{C()},testID:a?`${a}-next`:void 0})]})]})]})]}):null})};Tour.displayName="Tour";const buildStyles=e=>StyleSheet.create({transparent:{backgroundColor:"transparent"},dim:{position:"absolute"},highlight:{position:"absolute",borderWidth:2,borderColor:e.colors.primary,borderRadius:e.radius.md,...smoothCorners},card:{position:"absolute",backgroundColor:e.colors.surface,borderRadius:e.radius.lg,...smoothCorners,padding:e.space.lg,gap:e.space.sm,...e.shadow.popover},actions:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:e.space.xs},navigation:{flexDirection:"row",gap:e.space.sm}});export{Tour};export default Tour;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{Accordion,AccordionGroup}from"./Accordion/index.js";export{AmountSlider,DEFAULT_AMOUNT_SLIDER_LABELS}from"./AmountSlider/index.js";export{AnimatePresence}from"./AnimatePresence/index.js";export{AppBar,DEFAULT_APP_BAR_LABELS}from"./AppBar/index.js";export{AppLockOverlay,DEFAULT_APP_LOCK_OVERLAY_LABELS}from"./AppLockOverlay/index.js";export{AsyncBlock,DEFAULT_ASYNC_BLOCK_LABELS}from"./AsyncBlock/index.js";export{AuthedImage,authedImageCacheStats,clearAuthedImageCache,getAuthedImageCacheLimit,setAuthedImageCacheLimit}from"./AuthedImage/index.js";export{Autocomplete,DEFAULT_AUTOCOMPLETE_LABELS}from"./Autocomplete/index.js";export{Avatar,AvatarGroup,avatarToneColors,DEFAULT_AVATAR_LABELS}from"./Avatar/index.js";export{Badge,DEFAULT_BADGE_LABELS}from"./Badge/index.js";export{Banner,DEFAULT_BANNER_LABELS}from"./Banner/index.js";export{BarChart}from"./BarChart/index.js";export{BottomNavigation,DEFAULT_BOTTOM_NAVIGATION_LABELS}from"./BottomNavigation/index.js";export{BottomSheet,DEFAULT_BOTTOM_SHEET_LABELS,useBottomSheet}from"./BottomSheet/index.js";export{Box,Row,Spacer,Stack}from"./Box/index.js";export{Button,buttonLabelInk}from"./Button/index.js";export{Calendar,DEFAULT_CALENDAR_LABELS}from"./Calendar/index.js";export{Card,DEFAULT_CARD_LABELS}from"./Card/index.js";export{Carousel,DEFAULT_CAROUSEL_LABELS}from"./Carousel/index.js";export{Checkbox}from"./Checkbox/index.js";export{Chip}from"./Chip/index.js";export{ChoiceGroup}from"./ChoiceGroup/index.js";export{Composer,DEFAULT_COMPOSER_LABELS}from"./Composer/index.js";export{Confetti}from"./Confetti/index.js";export{ConfirmHost,confirm}from"./Confirm/index.js";export{DatePicker,DEFAULT_DATE_PICKER_LABELS}from"./DatePicker/index.js";export{DateRangePicker,DEFAULT_DATE_RANGE_PICKER_LABELS}from"./DateRangePicker/index.js";export{DateSeparator,DEFAULT_DATE_SEPARATOR_LABELS,dayLabel}from"./DateSeparator/index.js";export{cleanDecimalText,DEFAULT_DECIMAL_INPUT_LABELS,DecimalInput,isUnclearDecimalComma,parseDecimalText,pointDecimalText}from"./DecimalInput/index.js";export{Descriptions}from"./Descriptions/index.js";export{Dialog}from"./Dialog/index.js";export{Divider}from"./Divider/index.js";export{DEFAULT_DRAWER_LABELS,Drawer}from"./Drawer/index.js";export{EmptyState}from"./EmptyState/index.js";export{DEFAULT_ERROR_BOUNDARY_LABELS,ErrorBoundary,useErrorHandler,withErrorBoundary}from"./ErrorBoundary/index.js";export{DEFAULT_FILE_PICKER_LABELS,FilePicker,formatFileSize}from"./FilePicker/index.js";export{FileViewer}from"./FileViewer/index.js";export{FilterChipRow}from"./FilterChipRow/index.js";export{DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS,FloatingActionButton,FloatingActionButtonGroup}from"./FloatingActionButton/index.js";export{DEFAULT_FORCE_UPDATE_DIALOG_LABELS,ForceUpdateDialog}from"./ForceUpdateDialog/index.js";export{DEFAULT_FORM_FIELD_LABELS,FormField}from"./FormField/index.js";export{IconBadge}from"./IconBadge/index.js";export{IconButton}from"./IconButton/index.js";export{DEFAULT_IMAGE_GALLERY_LABELS,ImageGallery}from"./ImageGallery/index.js";export{DEFAULT_INLINE_SELECT_LABELS,InlineSelect}from"./InlineSelect/index.js";export{DEFAULT_INPUT_LABELS,Input}from"./Input/index.js";export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView/index.js";export{DEFAULT_KEYBOARD_TOOLBAR_LABELS,KeyboardToolbar}from"./KeyboardToolbar/index.js";export{ListItem}from"./ListItem/index.js";export{ListSection}from"./ListSection/index.js";export{DEFAULT_LOADER_OVERLAY_LABELS,LoaderOverlay,loader,useLoader}from"./LoaderOverlay/index.js";export{Markdown}from"./Markdown/index.js";export{DEFAULT_MENU_LABELS,Menu}from"./Menu/index.js";export{DEFAULT_MESSAGE_BUBBLE_LABELS,MessageBubble}from"./MessageBubble/index.js";export{DEFAULT_MESSAGE_LIST_LABELS,MessageList}from"./MessageList/index.js";export{DEFAULT_MODAL_LABELS,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal/index.js";export{
|
|
1
|
+
"use strict";export{Accordion,AccordionGroup}from"./Accordion/index.js";export{AmountSlider,DEFAULT_AMOUNT_SLIDER_LABELS}from"./AmountSlider/index.js";export{AnimatePresence}from"./AnimatePresence/index.js";export{AppBar,DEFAULT_APP_BAR_LABELS}from"./AppBar/index.js";export{AppLockOverlay,DEFAULT_APP_LOCK_OVERLAY_LABELS}from"./AppLockOverlay/index.js";export{AsyncBlock,DEFAULT_ASYNC_BLOCK_LABELS}from"./AsyncBlock/index.js";export{AuthedImage,authedImageCacheStats,clearAuthedImageCache,getAuthedImageCacheLimit,setAuthedImageCacheLimit}from"./AuthedImage/index.js";export{Autocomplete,DEFAULT_AUTOCOMPLETE_LABELS}from"./Autocomplete/index.js";export{Avatar,AvatarGroup,avatarToneColors,DEFAULT_AVATAR_LABELS}from"./Avatar/index.js";export{Badge,DEFAULT_BADGE_LABELS}from"./Badge/index.js";export{Banner,DEFAULT_BANNER_LABELS}from"./Banner/index.js";export{BarChart}from"./BarChart/index.js";export{BottomNavigation,DEFAULT_BOTTOM_NAVIGATION_LABELS}from"./BottomNavigation/index.js";export{BottomSheet,DEFAULT_BOTTOM_SHEET_LABELS,useBottomSheet}from"./BottomSheet/index.js";export{Box,Row,Spacer,Stack}from"./Box/index.js";export{Button,buttonLabelInk}from"./Button/index.js";export{Calendar,DEFAULT_CALENDAR_LABELS}from"./Calendar/index.js";export{Card,DEFAULT_CARD_LABELS}from"./Card/index.js";export{Carousel,DEFAULT_CAROUSEL_LABELS}from"./Carousel/index.js";export{Checkbox}from"./Checkbox/index.js";export{Chip}from"./Chip/index.js";export{ChoiceGroup}from"./ChoiceGroup/index.js";export{Composer,DEFAULT_COMPOSER_LABELS}from"./Composer/index.js";export{Confetti}from"./Confetti/index.js";export{ConfirmHost,confirm}from"./Confirm/index.js";export{DatePicker,DEFAULT_DATE_PICKER_LABELS}from"./DatePicker/index.js";export{DateRangePicker,DEFAULT_DATE_RANGE_PICKER_LABELS}from"./DateRangePicker/index.js";export{DateSeparator,DEFAULT_DATE_SEPARATOR_LABELS,dayLabel}from"./DateSeparator/index.js";export{cleanDecimalText,DEFAULT_DECIMAL_INPUT_LABELS,DecimalInput,isUnclearDecimalComma,parseDecimalText,pointDecimalText}from"./DecimalInput/index.js";export{Descriptions}from"./Descriptions/index.js";export{Dialog}from"./Dialog/index.js";export{Divider}from"./Divider/index.js";export{DEFAULT_DRAWER_LABELS,Drawer}from"./Drawer/index.js";export{EmptyState}from"./EmptyState/index.js";export{DEFAULT_ERROR_BOUNDARY_LABELS,ErrorBoundary,useErrorHandler,withErrorBoundary}from"./ErrorBoundary/index.js";export{DEFAULT_FILE_PICKER_LABELS,FilePicker,formatFileSize}from"./FilePicker/index.js";export{FileViewer}from"./FileViewer/index.js";export{FilterChipRow}from"./FilterChipRow/index.js";export{DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS,FloatingActionButton,FloatingActionButtonGroup}from"./FloatingActionButton/index.js";export{DEFAULT_FORCE_UPDATE_DIALOG_LABELS,ForceUpdateDialog}from"./ForceUpdateDialog/index.js";export{DEFAULT_FORM_FIELD_LABELS,FormField}from"./FormField/index.js";export{IconBadge}from"./IconBadge/index.js";export{IconButton}from"./IconButton/index.js";export{DEFAULT_IMAGE_GALLERY_LABELS,ImageGallery}from"./ImageGallery/index.js";export{DEFAULT_INLINE_SELECT_LABELS,InlineSelect}from"./InlineSelect/index.js";export{DEFAULT_INPUT_LABELS,Input}from"./Input/index.js";export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView/index.js";export{DEFAULT_KEYBOARD_TOOLBAR_LABELS,KeyboardToolbar}from"./KeyboardToolbar/index.js";export{ListItem}from"./ListItem/index.js";export{ListSection}from"./ListSection/index.js";export{DEFAULT_LOADER_OVERLAY_LABELS,LoaderOverlay,loader,useLoader}from"./LoaderOverlay/index.js";export{Markdown}from"./Markdown/index.js";export{DEFAULT_MENU_LABELS,Menu}from"./Menu/index.js";export{DEFAULT_MESSAGE_BUBBLE_LABELS,MessageBubble}from"./MessageBubble/index.js";export{DEFAULT_MESSAGE_LIST_LABELS,MessageList}from"./MessageList/index.js";export{DEFAULT_MODAL_LABELS,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal/index.js";export{DEFAULT_NUMBER_INPUT_LABELS,NumberInput}from"./NumberInput/index.js";export{DEFAULT_ONBOARDING_PAGER_LABELS,OnboardingPager}from"./OnboardingPager/index.js";export{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"./OptionSheet/index.js";export{DEFAULT_OTP_INPUT_LABELS,DEFAULT_OTP_RESEND_ROW_LABELS,OTPInput,OTPResendRow}from"./OTPInput/index.js";export{DEFAULT_PAGED_LIST_FOOTER_LABELS,PagedListFooter}from"./PagedListFooter/index.js";export{DEFAULT_PERMISSION_PROMPT_LABELS,PermissionPrompt,usePermissionPrompt}from"./PermissionPrompt/index.js";export{ALL_CALLING_CODES,DEFAULT_CALLING_CODES,DEFAULT_PHONE_NUMBER_INPUT_LABELS,formatE164,PhoneNumberInput,parseE164}from"./PhoneNumberInput/index.js";export{DEFAULT_PICKER_TRIGGER_LABELS,PickerTrigger}from"./PickerTrigger/index.js";export{DEFAULT_PROFILE_COMPLETION_LABELS,ProfileCompletion}from"./ProfileCompletion/index.js";export{DEFAULT_PROFILE_PICKER_LABELS,ProfilePicker}from"./ProfilePicker/index.js";export{DEFAULT_PROGRESS_BAR_LABELS,ProgressBar}from"./ProgressBar/index.js";export{ProgressRing}from"./ProgressRing/index.js";export{Radio,RadioDot,RadioGroup}from"./Radio/index.js";export{DEFAULT_RATING_LABELS,Rating}from"./Rating/index.js";export{DEFAULT_REPEATER_LABELS,Repeater}from"./Repeater/index.js";export{applyMarkdownAction,DEFAULT_RICH_TEXT_EDITOR_LABELS,RichTextEditor}from"./RichTextEditor/index.js";export{DEFAULT_SCANNER_OVERLAY_LABELS,ScannerOverlay}from"./ScannerOverlay/index.js";export{Screen}from"./Screen/index.js";export{DEFAULT_SEARCH_BAR_LABELS,SearchBar,useRecentSearches}from"./SearchBar/index.js";export{DEFAULT_SECTION_HEADER_LABELS,SectionHeader}from"./SectionHeader/index.js";export{SegmentedControl}from"./SegmentedControl/index.js";export{DEFAULT_SELECT_LABELS,Select}from"./Select/index.js";export{DEFAULT_SIGNATURE_PAD_LABELS,SignaturePad}from"./SignaturePad/index.js";export{DEFAULT_SKELETON_LABELS,Skeleton,SkeletonCircle,SkeletonClockProvider,SkeletonContent,SkeletonList,SkeletonProvider,SkeletonSkip,SkeletonText,useSkeletonClock,useSkeletonDefaults}from"./Skeleton/index.js";export{Slider}from"./Slider/index.js";export{DEFAULT_SLIDER_FIELD_LABELS,SliderField}from"./SliderField/index.js";export{DEFAULT_SLIDE_TO_CONFIRM_LABELS,SlideToConfirm}from"./SlideToConfirm/index.js";export{DEFAULT_SORTABLE_LIST_LABELS,SortableList}from"./SortableList/index.js";export{DEFAULT_SPARKLINE_LABELS,Sparkline}from"./Sparkline/index.js";export{DEFAULT_SPINNER_LABELS,Spinner}from"./Spinner/index.js";export{SquircleImage}from"./SquircleImage/index.js";export{SquircleView}from"./SquircleView/index.js";export{StatTile}from"./StatTile/index.js";export{StatusBadge}from"./StatusBadge/index.js";export{defineStatusMap}from"./StatusBadge/statusMap.js";export{Stepper}from"./Stepper/index.js";export{Swipeable}from"./Swipeable/index.js";export{Switch}from"./Switch/index.js";export{Tabs}from"./Tabs/index.js";export{TagInput}from"./TagInput/index.js";export{Text}from"./Text/index.js";export{TextInkContext,useTextInk}from"./Text/textInk.js";export{Timeline}from"./Timeline/index.js";export{DEFAULT_TIME_PICKER_LABELS,TimePicker}from"./TimePicker/index.js";export{DEFAULT_TOAST_LABELS,Toast,ToastHost,ToastProvider,toast,useToast}from"./Toast/index.js";export{DEFAULT_TOOLTIP_LABELS,Tooltip}from"./Tooltip/index.js";export{DEFAULT_TOUR_LABELS,Tour}from"./Tour/index.js";export{DEFAULT_TYPING_INDICATOR_LABELS,TypingIndicator}from"./TypingIndicator/index.js";export{DEFAULT_WHEEL_PICKER_LABELS,WheelPicker}from"./WheelPicker/index.js";export{ZoomableImage}from"./ZoomableImage/index.js";
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"Box": "Layout primitive. Canvas lays out a screen with its own frame nodes, so the kit draws the components placed inside them.",
|
|
4
4
|
"ConfirmHost": "Draws nothing until confirm is called, then shows the dialog that confirm opened.",
|
|
5
5
|
"ErrorBoundary": "Catches render errors around a subtree and draws nothing of its own.",
|
|
6
|
-
"FieldErrorScrollContext": "Shares the scroll-to-first-error target between a form and its fields and draws nothing of its own.",
|
|
7
6
|
"HookFormField": "Binds a library field to react-hook-form; the field it wraps is drawn through its own description.",
|
|
8
7
|
"KeyboardAwareScrollView": "A scroll container that keeps the focused field above the keyboard; it draws nothing of its own.",
|
|
9
8
|
"KitThemeBridge": "Canvas wraps kit parts in it to pass the render's light or dark theme; it draws nothing of its own.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export{CURATED_ICON_NAMES,defaultIcons,ICON_NAMES}from"./components/AppIcon/index.js";export{textOf}from"./theme/index.js";
|
package/lib/module/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{PHONE_CHROME_INSETS}from"./canvasKit/index.js";export
|
|
1
|
+
"use strict";export{PHONE_CHROME_INSETS}from"./canvasKit/index.js";export{Accordion,AccordionGroup,ALL_CALLING_CODES,AmountSlider,AnimatePresence,AppBar,AppLockOverlay,AsyncBlock,AuthedImage,Autocomplete,Avatar,AvatarGroup,authedImageCacheStats,Badge,Banner,BarChart,BottomNavigation,BottomSheet,Box,Button,buttonLabelInk,Calendar,Card,Carousel,Checkbox,Chip,ChoiceGroup,Composer,Confetti,ConfirmHost,clearAuthedImageCache,confirm,DatePicker,DateRangePicker,DateSeparator,DEFAULT_CALLING_CODES,DecimalInput,Descriptions,Dialog,Divider,Drawer,defineStatusMap,EmptyState,ErrorBoundary,FilePicker,FileViewer,FilterChipRow,FloatingActionButton,FloatingActionButtonGroup,ForceUpdateDialog,FormField,formatE164,formatFileSize,getAuthedImageCacheLimit,IconBadge,IconButton,ImageGallery,InlineSelect,Input,KeyboardAwareScrollView,KeyboardToolbar,ListItem,ListSection,LoaderOverlay,loader,Markdown,Menu,MessageBubble,MessageList,MODAL_DISMISS_GRACE_MS,Modal,NumberInput,OnboardingPager,OptionSheet,OTPInput,OTPResendRow,PagedListFooter,PermissionPrompt,PhoneNumberInput,PickerTrigger,ProfileCompletion,ProfilePicker,ProgressBar,ProgressRing,Radio,RadioDot,RadioGroup,Rating,Repeater,RichTextEditor,Row,ScannerOverlay,Screen,SearchBar,SectionHeader,SegmentedControl,Select,SignaturePad,Skeleton,SkeletonCircle,SkeletonClockProvider,SkeletonContent,SkeletonList,SkeletonProvider,SkeletonSkip,SkeletonText,Slider,SliderField,SlideToConfirm,SortableList,Spacer,Sparkline,Spinner,SquircleImage,SquircleView,Stack,StatTile,StatusBadge,Stepper,Swipeable,Switch,setAuthedImageCacheLimit,Tabs,TagInput,Text,TextInkContext,Timeline,TimePicker,Toast,ToastHost,ToastProvider,Tooltip,Tour,TypingIndicator,toast,useBottomSheet,useErrorHandler,useRecentSearches,useTextInk,useToast,WheelPicker,withErrorBoundary,ZoomableImage}from"./components/index.js";export{AppIcon}from"./components/AppIcon/index.js";export{HookFormField,useHookFormField}from"./form/index.js";export{useDebounce,useFieldChain,useRefreshControl,useScrollDirection}from"./hooks/index.js";export{NetworkStatusBanner}from"./network/index.js";export{KitThemeBridge,lightTheme,makeStyles,ThemeProvider,useTheme,useThemeMode}from"./theme/index.js";export{setHapticImplementation,triggerHaptic}from"./utils/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useNavigation,usePreventRemove}from"@react-navigation/native";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Dialog}from"../components/Dialog/index.js";import{jsx as _jsx}from"react/jsx-runtime";export const DEFAULT_DISCARD_GUARD_LABELS={title:"Discard your changes?",message:"The details you entered will be lost.",keep:"Keep editing",discard:"Discard"};export const DiscardGuard=forwardRef(({when:e,labels:t,testID:s},a)=>{const r=useNavigation(),n=useMemo(()=>({...DEFAULT_DISCARD_GUARD_LABELS,...t}),[t]),[l
|
|
1
|
+
"use strict";import{useNavigation,usePreventRemove}from"@react-navigation/native";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Dialog}from"../components/Dialog/index.js";import{jsx as _jsx}from"react/jsx-runtime";export const DEFAULT_DISCARD_GUARD_LABELS={title:"Discard your changes?",message:"The details you entered will be lost.",keep:"Keep editing",discard:"Discard"};export const DiscardGuard=forwardRef(({when:e,labels:t,testID:s},a)=>{const r=useNavigation(),n=useMemo(()=>({...DEFAULT_DISCARD_GUARD_LABELS,...t}),[t]),[o,l]=useState(null),[i,u]=useState(!1),c=useRef(null);usePreventRemove(e&&!i,({data:e})=>l(e.action)),useEffect(()=>{if(i&&c.current){const e=c.current;c.current=null,e()}},[i]);const d=useCallback(e=>{i?e():(c.current=e,u(!0))},[i]);useImperativeHandle(a,()=>({leave:d}),[d]);return _jsx(Dialog,{open:null!==o,onClose:()=>l(null),title:n.title,message:n.message,actions:[{label:n.keep,tone:"neutral",onPress:()=>l(null)},{label:n.discard,tone:"danger",onPress:()=>{const e=o;l(null),d(()=>{e&&r.dispatch(e)})}}],testID:s})});DiscardGuard.displayName="DiscardGuard";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export{resolveBadgeSize,resolveButtonSize,resolveCheckboxSize,resolveChipSize,resolveEmptyStateSize,resolveFieldSize,resolveFloatingActionButtonSize,resolveListItemSize,resolveOtpInputSize,resolveRadioSize,resolveSegmentedControlSize,resolveSliderSize,resolveSwitchSize,resolveTabsSize}from"./theme/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export{squircleApplies,squircleHostRadius,squirclePath}from"./utils/index.js";
|
|
@@ -10,7 +10,7 @@ export interface AppLockOverlayLabels {
|
|
|
10
10
|
}
|
|
11
11
|
export declare const DEFAULT_APP_LOCK_OVERLAY_LABELS: Readonly<AppLockOverlayLabels>;
|
|
12
12
|
export interface AppLockOverlayProps {
|
|
13
|
-
|
|
13
|
+
open: boolean;
|
|
14
14
|
onUnlock: () => void;
|
|
15
15
|
/** The last unlock failure; "cancelled" shows no message. */
|
|
16
16
|
failure?: AppLockFailure;
|
|
@@ -22,6 +22,6 @@ export interface AppLockOverlayProps {
|
|
|
22
22
|
labels?: Partial<AppLockOverlayLabels>;
|
|
23
23
|
testID?: string;
|
|
24
24
|
}
|
|
25
|
-
/** Calls `onUnlock` once each time it becomes
|
|
26
|
-
export declare function AppLockOverlay({
|
|
25
|
+
/** Calls `onUnlock` once each time it becomes open, and again on every press of the unlock button. */
|
|
26
|
+
export declare function AppLockOverlay({ open, onUnlock, failure, secondaryAction, brandMark, labels: labelOverrides, testID, }: AppLockOverlayProps): React.ReactElement | null;
|
|
27
27
|
//# sourceMappingURL=AppLockOverlay.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DownloadHttpClient } from "@webority/mobile-core/download";
|
|
1
2
|
import type React from "react";
|
|
2
3
|
import type { GestureResponderEvent, ImageSourcePropType, ImageStyle, PressableProps, View as RNView, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
4
|
import type { RadiusName } from "../../theme/tokens.generated";
|
|
@@ -65,6 +66,12 @@ export interface AvatarProps {
|
|
|
65
66
|
* triggers the initials fallback. When omitted, expo-image's `<Image>` is used.
|
|
66
67
|
*/
|
|
67
68
|
ImageComponent?: React.ComponentType<AvatarImageProps>;
|
|
69
|
+
/**
|
|
70
|
+
* The authed fetcher for a `source` with a `uri` (the app's signed-in client, as AuthedImage's `client`).
|
|
71
|
+
* With it set and no ImageComponent, the picture draws through AuthedImage: the image is fetched with the
|
|
72
|
+
* client, cached on disk and shown with the initials as its fallback.
|
|
73
|
+
*/
|
|
74
|
+
imageClient?: DownloadHttpClient;
|
|
68
75
|
name?: string;
|
|
69
76
|
size?: AvatarSize;
|
|
70
77
|
shape?: AvatarShape;
|
|
@@ -57,7 +57,7 @@ export interface BannerProps {
|
|
|
57
57
|
labels?: Partial<BannerLabels>;
|
|
58
58
|
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
59
59
|
haptic?: HapticType | false;
|
|
60
|
-
|
|
60
|
+
open?: boolean;
|
|
61
61
|
animateMount?: boolean;
|
|
62
62
|
/**
|
|
63
63
|
* When true, renders the component as its authored skeleton placeholder shape.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* USAGE:
|
|
8
8
|
*
|
|
9
9
|
* const [open, setOpen] = useState(false);
|
|
10
|
-
* <BottomSheet
|
|
10
|
+
* <BottomSheet open={open} onClose={() => setOpen(false)} snapPoints={[200, '50%', '90%']}>
|
|
11
11
|
* <YourContent />
|
|
12
12
|
* </BottomSheet>
|
|
13
13
|
*/
|
|
@@ -39,9 +39,9 @@ export interface BottomSheetProps {
|
|
|
39
39
|
*/
|
|
40
40
|
snapPoints?: SnapPoint[];
|
|
41
41
|
/** Whether the sheet is open. Set it to false in `onClose`; a sheet closed by the person stays closed until this goes false and true again. */
|
|
42
|
-
|
|
42
|
+
open: boolean;
|
|
43
43
|
/**
|
|
44
|
-
* Called after the person dismisses the sheet (a handle drag, a swipe down, the scrim, Android Back, Escape) and `onBeforeClose` allowed it. The parent sets `
|
|
44
|
+
* Called after the person dismisses the sheet (a handle drag, a swipe down, the scrim, Android Back, Escape) and `onBeforeClose` allowed it. The parent sets `open` to false in it; a sheet closed this way stays closed until `open` goes false and true again.
|
|
45
45
|
*/
|
|
46
46
|
onClose: () => void;
|
|
47
47
|
/** The snap point to open at, and the one to move to when it changes. Omitted, the sheet opens at its first snap point. A drag does not move it: follow the position with `onSnapChange`. */
|
|
@@ -132,7 +132,7 @@ export interface BottomSheetProps {
|
|
|
132
132
|
*/
|
|
133
133
|
presentation?: BottomSheetPresentation;
|
|
134
134
|
/**
|
|
135
|
-
* Whether a sheet that opens as it mounts (`
|
|
135
|
+
* Whether a sheet that opens as it mounts (`open` on the first render)
|
|
136
136
|
* slides up into place. When false it is drawn at its snap
|
|
137
137
|
* point at once, and a re-measured host moves it without a spring, until
|
|
138
138
|
* its first close; later opens slide as usual. Default true.
|
|
@@ -28,8 +28,8 @@ export declare const buildCalendarStyles: (theme: Theme) => {
|
|
|
28
28
|
opacity: number;
|
|
29
29
|
};
|
|
30
30
|
navText: {
|
|
31
|
-
fontFamily?: string | undefined | undefined;
|
|
32
31
|
fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined | undefined;
|
|
32
|
+
fontFamily?: string | undefined | undefined;
|
|
33
33
|
fontSize: number;
|
|
34
34
|
lineHeight: number;
|
|
35
35
|
color: string;
|
|
@@ -39,8 +39,8 @@ export declare const buildCalendarStyles: (theme: Theme) => {
|
|
|
39
39
|
alignItems: "center";
|
|
40
40
|
};
|
|
41
41
|
headerLabel: {
|
|
42
|
-
fontFamily?: string | undefined | undefined;
|
|
43
42
|
fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined | undefined;
|
|
43
|
+
fontFamily?: string | undefined | undefined;
|
|
44
44
|
fontSize: number;
|
|
45
45
|
color: string;
|
|
46
46
|
};
|
|
@@ -54,8 +54,8 @@ export declare const buildCalendarStyles: (theme: Theme) => {
|
|
|
54
54
|
paddingVertical: number;
|
|
55
55
|
};
|
|
56
56
|
weekdayText: {
|
|
57
|
-
fontFamily?: string | undefined | undefined;
|
|
58
57
|
fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined | undefined;
|
|
58
|
+
fontFamily?: string | undefined | undefined;
|
|
59
59
|
fontSize: number;
|
|
60
60
|
color: string;
|
|
61
61
|
letterSpacing: number;
|
|
@@ -101,8 +101,8 @@ export declare const buildCalendarStyles: (theme: Theme) => {
|
|
|
101
101
|
borderRadius: number;
|
|
102
102
|
};
|
|
103
103
|
dayText: {
|
|
104
|
-
fontFamily?: string | undefined | undefined;
|
|
105
104
|
fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined | undefined;
|
|
105
|
+
fontFamily?: string | undefined | undefined;
|
|
106
106
|
fontSize: number;
|
|
107
107
|
};
|
|
108
108
|
dots: {
|
|
@@ -12,7 +12,7 @@ export interface CardTextAction {
|
|
|
12
12
|
accessibilityLabel?: string;
|
|
13
13
|
}
|
|
14
14
|
export type CardElevation = "none" | ShadowName;
|
|
15
|
-
export type CardRadius = "sm" | "md" | "lg" | "xl";
|
|
15
|
+
export type CardRadius = "sm" | "md" | "lg" | "xl" | "pill";
|
|
16
16
|
export type CardPadding = "none" | "sm" | "md" | "lg" | "xl";
|
|
17
17
|
export type CardTitleFont = "sans" | "serif";
|
|
18
18
|
declare const BACKGROUND_TOKENS: readonly ["bg", "bg-subtle", "bg-muted", "surface", "scrim", "surface-inverse", "primary-wash"];
|
|
@@ -105,8 +105,6 @@ export interface CardProps extends Omit<PressableProps, "style" | "children"> {
|
|
|
105
105
|
bodyStyle?: StyleProp<ViewStyle>;
|
|
106
106
|
/** Style applied to the footer wrapper View. */
|
|
107
107
|
footerStyle?: StyleProp<ViewStyle>;
|
|
108
|
-
/** Per-instance override of the corner radius. Wins over the `radius` token. */
|
|
109
|
-
borderRadius?: number;
|
|
110
108
|
testID?: string;
|
|
111
109
|
}
|
|
112
110
|
declare const Card: React.MemoExoticComponent<React.ForwardRefExoticComponent<CardProps & React.RefAttributes<RNView>>> & {
|
|
@@ -24,9 +24,9 @@ export declare const DEFAULT_DATE_PICKER_LABELS: Readonly<DatePickerLabels>;
|
|
|
24
24
|
/**
|
|
25
25
|
* DatePicker operates in two modes:
|
|
26
26
|
*
|
|
27
|
-
* 1. **Controlled-modal mode
|
|
27
|
+
* 1. **Controlled-modal mode**: pass `open` (plus `onChange` / `onClose`)
|
|
28
28
|
* and own the open state externally. The component renders only the modal.
|
|
29
|
-
* 2. **Trigger mode
|
|
29
|
+
* 2. **Trigger mode**: omit `open`. The component renders a built-in
|
|
30
30
|
* PickerTrigger field (label / value / placeholder / chevron / clear /
|
|
31
31
|
* helper / error / size / variant) and manages its own open state. The
|
|
32
32
|
* field opens the modal on press and closes it on confirm/cancel.
|
|
@@ -36,7 +36,7 @@ export declare const DEFAULT_DATE_PICKER_LABELS: Readonly<DatePickerLabels>;
|
|
|
36
36
|
* they remain semantically required.
|
|
37
37
|
*/
|
|
38
38
|
export interface DatePickerProps extends PickerTriggerPassThroughProps {
|
|
39
|
-
|
|
39
|
+
open?: boolean;
|
|
40
40
|
value?: Date | null;
|
|
41
41
|
onChange?: (date: Date) => void;
|
|
42
42
|
onClose?: () => void;
|
|
@@ -18,14 +18,14 @@ export declare const DEFAULT_DATE_RANGE_PICKER_LABELS: Readonly<DateRangePickerL
|
|
|
18
18
|
/**
|
|
19
19
|
* DateRangePicker — supports two usage modes:
|
|
20
20
|
*
|
|
21
|
-
* 1. Controlled-modal mode (pass `
|
|
21
|
+
* 1. Controlled-modal mode (pass `open` + `onClose`): renders only the
|
|
22
22
|
* modal; parent owns open/close state.
|
|
23
|
-
* 2. Trigger mode (omit `
|
|
23
|
+
* 2. Trigger mode (omit `open`): renders a built-in `PickerTrigger`
|
|
24
24
|
* field that opens an internally-managed modal on tap. Confirm fires
|
|
25
25
|
* `onChange?.(...)` and closes.
|
|
26
26
|
*/
|
|
27
27
|
export interface DateRangePickerProps extends PickerTriggerPassThroughProps {
|
|
28
|
-
|
|
28
|
+
open?: boolean;
|
|
29
29
|
value: DateRange;
|
|
30
30
|
onChange?: (range: {
|
|
31
31
|
start: Date;
|
|
@@ -11,8 +11,8 @@ export interface DescriptionItem {
|
|
|
11
11
|
*/
|
|
12
12
|
label: React.ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
* A string, a number
|
|
15
|
-
* size, weight and colour (`strong`, `tone`)
|
|
14
|
+
* A string, a number or a list of those renders as text in the value's
|
|
15
|
+
* size, weight and colour (`strong`, `tone`). Any other node (a badge, a
|
|
16
16
|
* Text of your own) renders as-is in a View and owns its type. Empty renders as a plain hyphen, "-".
|
|
17
17
|
*/
|
|
18
18
|
value?: React.ReactNode;
|
|
@@ -27,12 +27,12 @@ export interface DrawerLabels {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const DEFAULT_DRAWER_LABELS: DrawerLabels;
|
|
29
29
|
export interface DrawerProps {
|
|
30
|
-
/** Controlled
|
|
31
|
-
|
|
30
|
+
/** Controlled open state. Omit to use internal state. */
|
|
31
|
+
open?: boolean;
|
|
32
32
|
/** Initial visibility for uncontrolled usage. */
|
|
33
|
-
|
|
33
|
+
defaultOpen?: boolean;
|
|
34
34
|
/** Fired whenever the drawer transitions open/closed. */
|
|
35
|
-
|
|
35
|
+
onOpenChange?: (open: boolean) => void;
|
|
36
36
|
/** Edge the drawer slides in from. */
|
|
37
37
|
side?: DrawerSide;
|
|
38
38
|
/** Drawer dimension along the slide axis (width for left/right, height for top/bottom). */
|
|
@@ -116,15 +116,15 @@ export interface FieldBaseProps {
|
|
|
116
116
|
paddingRight?: number;
|
|
117
117
|
/** Override vertical padding (single-line). Multiline parents usually leave this default. */
|
|
118
118
|
paddingVertical?: number;
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
/** Top-left corner radius. Wins over `
|
|
119
|
+
/** Corner radius token (shorthand for all four corners), resolved through `theme.radius`. SearchBar pill uses `"pill"`. */
|
|
120
|
+
radius?: keyof Theme["radius"];
|
|
121
|
+
/** Top-left corner radius. Wins over `radius`. */
|
|
122
122
|
borderTopLeftRadius?: number;
|
|
123
|
-
/** Top-right corner radius. Wins over `
|
|
123
|
+
/** Top-right corner radius. Wins over `radius`. */
|
|
124
124
|
borderTopRightRadius?: number;
|
|
125
|
-
/** Bottom-left corner radius. Wins over `
|
|
125
|
+
/** Bottom-left corner radius. Wins over `radius`. */
|
|
126
126
|
borderBottomLeftRadius?: number;
|
|
127
|
-
/** Bottom-right corner radius. Wins over `
|
|
127
|
+
/** Bottom-right corner radius. Wins over `radius`. */
|
|
128
128
|
borderBottomRightRadius?: number;
|
|
129
129
|
/** Override border width (shorthand — all four sides). OTP uses 1.5; everything else inherits `size.border`. */
|
|
130
130
|
borderWidth?: number;
|
|
@@ -138,6 +138,8 @@ export interface FieldBaseProps {
|
|
|
138
138
|
borderLeftWidth?: number;
|
|
139
139
|
/** Gap between leading / children / trailing. Defaults to `theme.space.md` (the spec's 12px). */
|
|
140
140
|
gap?: number;
|
|
141
|
+
/** Drop the room below the field, for a field that sits tight on the content under it. */
|
|
142
|
+
flushBottom?: boolean;
|
|
141
143
|
style?: StyleProp<ViewStyle>;
|
|
142
144
|
testID?: string;
|
|
143
145
|
accessibilityRole?: AccessibilityRole;
|
|
@@ -27,6 +27,11 @@ export interface FloatingActionButtonProps {
|
|
|
27
27
|
position?: FloatingActionButtonPosition;
|
|
28
28
|
bottomOffset?: number;
|
|
29
29
|
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Replaces the icon with a Spinner and ignores presses, for an action already in flight.
|
|
32
|
+
* The button keeps its colours and reports itself busy to assistive technology.
|
|
33
|
+
*/
|
|
34
|
+
loading?: boolean;
|
|
30
35
|
hideOnScroll?: boolean;
|
|
31
36
|
isScrolling?: boolean;
|
|
32
37
|
accessibilityLabel: string;
|