@reillymc/react-native-components 0.12.7 → 0.12.9
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/lib/actions/swipeAction/SwipeAction.js +1 -1
- package/lib/actions/swipeAction/SwipeAction.theme.js +1 -1
- package/lib/forms/input/TextInput.js +1 -1
- package/lib/forms/input/TextInput.theme.js +1 -1
- package/lib/forms/input/comboboxInput/ComboboxInput.theme.js +1 -1
- package/lib/forms/input/comboboxInput/ComboboxInputBase.js +1 -1
- package/lib/forms/input/comboboxInput/useComboboxController.js +1 -1
- package/lib/forms/input/counterInput/CounterControl.js +1 -1
- package/lib/forms/input/counterInput/CounterInput.theme.js +1 -1
- package/lib/forms/input/numberInput/NumberInput.js +1 -1
- package/lib/forms/input/numberInput/NumberInput.theme.js +1 -1
- package/lib/forms/input/selectionInput/SelectionControl.js +1 -1
- package/lib/forms/input/timeInput/TimeInput.js +1 -1
- package/lib/forms/input/timeInput/TimeInput.theme.js +1 -1
- package/lib/overlays/anchoredContainer/AnchoredContainer.theme.js +1 -1
- package/lib/overlays/anchoredContainer/AnchoredContainer.web.js +1 -1
- package/lib/overlays/menu/Menu.js +1 -1
- package/lib/overlays/menu/MenuItem.js +1 -1
- package/lib/overlays/menu/MenuItem.theme.js +1 -1
- package/lib/overlays/menu/useMenuScroll.js +1 -0
- package/lib/theme/palette.js +1 -1
- package/lib/types/actions/button/index.d.ts +1 -1
- package/lib/types/actions/button/index.d.ts.map +1 -1
- package/lib/types/actions/index.d.ts +2 -2
- package/lib/types/actions/index.d.ts.map +1 -1
- package/lib/types/actions/swipeAction/SwipeAction.d.ts +9 -4
- package/lib/types/actions/swipeAction/SwipeAction.d.ts.map +1 -1
- package/lib/types/actions/swipeAction/SwipeAction.theme.d.ts.map +1 -1
- package/lib/types/actions/swipeAction/index.d.ts +1 -1
- package/lib/types/actions/swipeAction/index.d.ts.map +1 -1
- package/lib/types/forms/input/TextInput.theme.d.ts +3 -2
- package/lib/types/forms/input/TextInput.theme.d.ts.map +1 -1
- package/lib/types/forms/input/comboboxInput/ComboboxInput.theme.d.ts +5 -2
- package/lib/types/forms/input/comboboxInput/ComboboxInput.theme.d.ts.map +1 -1
- package/lib/types/forms/input/comboboxInput/ComboboxInputBase.d.ts +1 -1
- package/lib/types/forms/input/comboboxInput/ComboboxInputBase.d.ts.map +1 -1
- package/lib/types/forms/input/comboboxInput/useComboboxController.d.ts +1 -0
- package/lib/types/forms/input/comboboxInput/useComboboxController.d.ts.map +1 -1
- package/lib/types/forms/input/counterInput/CounterInput.theme.d.ts +1 -1
- package/lib/types/forms/input/counterInput/CounterInput.theme.d.ts.map +1 -1
- package/lib/types/forms/input/numberInput/NumberInput.theme.d.ts +1 -1
- package/lib/types/forms/input/numberInput/NumberInput.theme.d.ts.map +1 -1
- package/lib/types/forms/input/selectionInput/SelectionControl.d.ts.map +1 -1
- package/lib/types/forms/input/timeInput/TimeInput.theme.d.ts +1 -1
- package/lib/types/forms/input/timeInput/TimeInput.theme.d.ts.map +1 -1
- package/lib/types/overlays/anchoredContainer/AnchoredContainer.web.d.ts.map +1 -1
- package/lib/types/overlays/anchoredContainer/index.d.ts +1 -1
- package/lib/types/overlays/anchoredContainer/index.d.ts.map +1 -1
- package/lib/types/overlays/index.d.ts +2 -1
- package/lib/types/overlays/index.d.ts.map +1 -1
- package/lib/types/overlays/menu/Menu.d.ts +4 -5
- package/lib/types/overlays/menu/Menu.d.ts.map +1 -1
- package/lib/types/overlays/menu/MenuItem.d.ts +12 -2
- package/lib/types/overlays/menu/MenuItem.d.ts.map +1 -1
- package/lib/types/overlays/menu/MenuItem.theme.d.ts.map +1 -1
- package/lib/types/overlays/menu/index.d.ts +2 -2
- package/lib/types/overlays/menu/index.d.ts.map +1 -1
- package/lib/types/overlays/menu/useMenuScroll.d.ts +22 -0
- package/lib/types/overlays/menu/useMenuScroll.d.ts.map +1 -0
- package/lib/types/theme/palette.d.ts +2 -0
- package/lib/types/theme/palette.d.ts.map +1 -1
- package/lib/types/typography/index.d.ts +1 -1
- package/lib/types/typography/index.d.ts.map +1 -1
- package/lib/types/typography/text/HighlightedText.d.ts +8 -6
- package/lib/types/typography/text/HighlightedText.d.ts.map +1 -1
- package/lib/types/typography/text/HighlightedText.theme.d.ts.map +1 -1
- package/lib/types/typography/text/index.d.ts +2 -2
- package/lib/types/typography/text/index.d.ts.map +1 -1
- package/lib/typography/text/HighlightedText.js +1 -1
- package/lib/typography/text/HighlightedText.theme.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{defineStyles,useComponent}from"../../internal";import{IconButton}from"../button";import{jsx as _jsx}from"react/jsx-runtime";export var SwipeAction=
|
|
1
|
+
var _excluded=["theme"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{defineStyles,useComponent}from"../../internal";import{IconButton}from"../button";import{jsx as _jsx}from"react/jsx-runtime";export var SwipeAction=t0=>{var $=_c(9);var props;var themeOverrides;if($[0]!==t0){themeOverrides=t0.theme;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=props;$[2]=themeOverrides;}else{props=$[1];themeOverrides=$[2];}var t1;if($[3]!==themeOverrides){t1={themeOverrides,createStyles};$[3]=themeOverrides;$[4]=t1;}else{t1=$[4];}var _useComponent=useComponent("swipeAction",t1),styles=_useComponent.styles,theme=_useComponent.theme;var t2;if($[5]!==props||$[6]!==styles.actionButton||$[7]!==theme.button){t2=_jsx(IconButton,{...props,theme:theme.button,appearance:"prominent",style:styles.actionButton});$[5]=props;$[6]=styles.actionButton;$[7]=theme.button;$[8]=t2;}else{t2=$[8];}return t2;};var createStyles=defineStyles(theme=>({actionButton:{height:"100%",alignItems:"center",justifyContent:"center",borderRadius:theme.container.borderRadius,width:theme.container.width}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultSwipeActionTheme=({palette})=>({width:60,borderRadius:palette.border.radius.loose});
|
|
1
|
+
export var defaultSwipeActionTheme=({palette,theme})=>({container:{width:60,borderRadius:palette.border.radius.loose},button:theme.iconButton});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _excluded=["label","hideLabel","help","error","required","disabled","readOnly","variant","style","theme"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useComponent}from"../../internal";import{Field,FieldSurface,FieldTextInput}from"../field";import{jsx as _jsx}from"react/jsx-runtime";export var TextInput=t0=>{var $=_c(
|
|
1
|
+
var _excluded=["label","hideLabel","help","error","required","disabled","readOnly","variant","style","theme"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useComponent}from"../../internal";import{Field,FieldSurface,FieldTextInput}from"../field";import{jsx as _jsx}from"react/jsx-runtime";export var TextInput=t0=>{var $=_c(31);var disabled;var error;var help;var hideLabel;var inputProps;var label;var readOnly;var required;var style;var themeOverrides;var variant;if($[0]!==t0){label=t0.label;hideLabel=t0.hideLabel;help=t0.help;error=t0.error;required=t0.required;disabled=t0.disabled;readOnly=t0.readOnly;variant=t0.variant;style=t0.style;themeOverrides=t0.theme;inputProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=disabled;$[2]=error;$[3]=help;$[4]=hideLabel;$[5]=inputProps;$[6]=label;$[7]=readOnly;$[8]=required;$[9]=style;$[10]=themeOverrides;$[11]=variant;}else{disabled=$[1];error=$[2];help=$[3];hideLabel=$[4];inputProps=$[5];label=$[6];readOnly=$[7];required=$[8];style=$[9];themeOverrides=$[10];variant=$[11];}var t1;if($[12]!==themeOverrides){t1={themeOverrides};$[12]=themeOverrides;$[13]=t1;}else{t1=$[13];}var _useComponent=useComponent("textInput",t1),theme=_useComponent.theme;var t2;if($[14]!==inputProps||$[15]!==theme.input){t2=_jsx(FieldTextInput,{theme:theme.input,...inputProps});$[14]=inputProps;$[15]=theme.input;$[16]=t2;}else{t2=$[16];}var t3;if($[17]!==t2||$[18]!==theme.surface){t3=_jsx(FieldSurface,{theme:theme.surface,children:t2});$[17]=t2;$[18]=theme.surface;$[19]=t3;}else{t3=$[19];}var t4;if($[20]!==disabled||$[21]!==error||$[22]!==help||$[23]!==hideLabel||$[24]!==label||$[25]!==readOnly||$[26]!==required||$[27]!==style||$[28]!==t3||$[29]!==variant){t4=_jsx(Field,{label:label,hideLabel:hideLabel,help:help,error:error,required:required,disabled:disabled,readOnly:readOnly,variant:variant,style:style,children:t3});$[20]=disabled;$[21]=error;$[22]=help;$[23]=hideLabel;$[24]=label;$[25]=readOnly;$[26]=required;$[27]=style;$[28]=t3;$[29]=variant;$[30]=t4;}else{t4=$[30];}return t4;};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultTextInputTheme=({theme})=>({
|
|
1
|
+
export var defaultTextInputTheme=({theme})=>({surface:theme.field.surface,input:theme.field.text});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultComboboxInputTheme=({
|
|
1
|
+
export var defaultComboboxInputTheme=({theme})=>({panel:theme.anchoredContainer,surface:theme.field.surface,input:theme.field.text,menu:theme.menu,option:theme.menuItem});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _excluded=["items","value","defaultValue","inputValue","defaultInputValue","onChange","onInputChange","onSubmit","submitOnEnter","selectBehavior","controllerRef","disableOpenOnFocus","allowsCustomValue","filterItems","minimumSearchLength","maxSuggestionCount","containerPosition","anchorRef","theme","onBlur","onFocus","onKeyPress","ref"];function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useImperativeHandle,useState}from"react";import{useComponent,useForwardedRef}from"../../../internal";import{AnchoredContainer}from"../../../overlays/anchoredContainer";import{Menu,MenuItem}from"../../../overlays/menu";import{FieldTextInput,useFieldControlState}from"../../field";import{ComboboxBlurGuard}from"./ComboboxBlurGuard";import{getItemKey}from"./helpers";import{useComboboxController}from"./useComboboxController";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";var EMPTY_ITEMS=[];export var ComboboxInputBase=props=>{var $=_c(85);var anchorRef;var containerPosition;var controllerRef;var defaultInputValue;var defaultValue;var filterItems;var inputProps;var inputValue;var maxSuggestionCount;var onBlur;var onChange;var onFocus;var onInputChange;var onKeyPress;var onSubmit;var ref;var t0;var t1;var t2;var t3;var t4;var t5;var themeOverrides;var value;if($[0]!==props){t0=props.items;value=props.value;defaultValue=props.defaultValue;inputValue=props.inputValue;defaultInputValue=props.defaultInputValue;onChange=props.onChange;onInputChange=props.onInputChange;onSubmit=props.onSubmit;t1=props.submitOnEnter;t2=props.selectBehavior;controllerRef=props.controllerRef;t3=props.disableOpenOnFocus;t4=props.allowsCustomValue;filterItems=props.filterItems;t5=props.minimumSearchLength;maxSuggestionCount=props.maxSuggestionCount;containerPosition=props.containerPosition;anchorRef=props.anchorRef;themeOverrides=props.theme;onBlur=props.onBlur;onFocus=props.onFocus;onKeyPress=props.onKeyPress;ref=props.ref;inputProps=_objectWithoutProperties(props,_excluded);$[0]=props;$[1]=anchorRef;$[2]=containerPosition;$[3]=controllerRef;$[4]=defaultInputValue;$[5]=defaultValue;$[6]=filterItems;$[7]=inputProps;$[8]=inputValue;$[9]=maxSuggestionCount;$[10]=onBlur;$[11]=onChange;$[12]=onFocus;$[13]=onInputChange;$[14]=onKeyPress;$[15]=onSubmit;$[16]=ref;$[17]=t0;$[18]=t1;$[19]=t2;$[20]=t3;$[21]=t4;$[22]=t5;$[23]=themeOverrides;$[24]=value;}else{anchorRef=$[1];containerPosition=$[2];controllerRef=$[3];defaultInputValue=$[4];defaultValue=$[5];filterItems=$[6];inputProps=$[7];inputValue=$[8];maxSuggestionCount=$[9];onBlur=$[10];onChange=$[11];onFocus=$[12];onInputChange=$[13];onKeyPress=$[14];onSubmit=$[15];ref=$[16];t0=$[17];t1=$[18];t2=$[19];t3=$[20];t4=$[21];t5=$[22];themeOverrides=$[23];value=$[24];}var items=t0===undefined?EMPTY_ITEMS:t0;var submitOnEnter=t1===undefined?false:t1;var selectBehavior=t2===undefined?"blurAndClose":t2;var disableOpenOnFocus=t3===undefined?false:t3;var allowsCustomValue=t4===undefined?false:t4;var minimumSearchLength=t5===undefined?1:t5;var isValueControlled="value"in props;var isInputControlled="inputValue"in props;var _useFieldControlState=useFieldControlState(),interactive=_useFieldControlState.interactive;var inputRef=useForwardedRef(ref);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isMenuInverted=_useState2[0],setIsMenuInverted=_useState2[1];var t6;if($[25]!==themeOverrides){t6={themeOverrides};$[25]=themeOverrides;$[26]=t6;}else{t6=$[26];}var _useComponent=useComponent("comboboxInput",t6),theme=_useComponent.theme;var t7;if($[27]!==allowsCustomValue||$[28]!==defaultInputValue||$[29]!==defaultValue||$[30]!==disableOpenOnFocus||$[31]!==filterItems||$[32]!==inputRef||$[33]!==inputValue||$[34]!==interactive||$[35]!==isInputControlled||$[36]!==isMenuInverted||$[37]!==isValueControlled||$[38]!==items||$[39]!==maxSuggestionCount||$[40]!==minimumSearchLength||$[41]!==onBlur||$[42]!==onChange||$[43]!==onFocus||$[44]!==onInputChange||$[45]!==onKeyPress||$[46]!==onSubmit||$[47]!==selectBehavior||$[48]!==submitOnEnter||$[49]!==value){t7={items,value,defaultValue,isValueControlled,inputValue,defaultInputValue,isInputControlled,interactive,onChange,onInputChange,onSubmit,onFocus,onBlur,onKeyPress,selectBehavior,disableOpenOnFocus,allowsCustomValue,submitOnEnter,filterItems,minimumSearchLength,maxSuggestionCount,inputRef,isMenuInverted};$[27]=allowsCustomValue;$[28]=defaultInputValue;$[29]=defaultValue;$[30]=disableOpenOnFocus;$[31]=filterItems;$[32]=inputRef;$[33]=inputValue;$[34]=interactive;$[35]=isInputControlled;$[36]=isMenuInverted;$[37]=isValueControlled;$[38]=items;$[39]=maxSuggestionCount;$[40]=minimumSearchLength;$[41]=onBlur;$[42]=onChange;$[43]=onFocus;$[44]=onInputChange;$[45]=onKeyPress;$[46]=onSubmit;$[47]=selectBehavior;$[48]=submitOnEnter;$[49]=value;$[50]=t7;}else{t7=$[50];}var _useComboboxControlle=useComboboxController(t7),displayText=_useComboboxControlle.displayText,query=_useComboboxControlle.query,filteredItems=_useComboboxControlle.filteredItems,showContainer=_useComboboxControlle.showContainer,activeIndex=_useComboboxControlle.activeIndex,handleFocus=_useComboboxControlle.handleFocus,handleBlur=_useComboboxControlle.handleBlur,handleKeyPress=_useComboboxControlle.handleKeyPress,handleSubmitEditing=_useComboboxControlle.handleSubmitEditing,selectItem=_useComboboxControlle.selectItem,updateInputText=_useComboboxControlle.updateInputText,open=_useComboboxControlle.open,close=_useComboboxControlle.close;var t8;var t9;if($[51]!==close||$[52]!==inputRef||$[53]!==interactive||$[54]!==open){t8=()=>({open,close,focus:()=>interactive&&inputRef.current?.focus(),blur:()=>inputRef.current?.blur()});t9=[open,close,interactive,inputRef];$[51]=close;$[52]=inputRef;$[53]=interactive;$[54]=open;$[55]=t8;$[56]=t9;}else{t8=$[55];t9=$[56];}useImperativeHandle(controllerRef,t8,t9);var t10;if($[57]!==displayText||$[58]!==handleBlur||$[59]!==handleFocus||$[60]!==handleKeyPress||$[61]!==handleSubmitEditing||$[62]!==inputProps||$[63]!==inputRef||$[64]!==theme.textInput||$[65]!==updateInputText){t10=_jsx(FieldTextInput,{...inputProps,ref:inputRef,theme:theme.textInput,value:displayText,submitBehavior:"submit",blurOnSubmit:false,onFocus:handleFocus,onBlur:handleBlur,onKeyPress:handleKeyPress,onSubmitEditing:handleSubmitEditing,onChangeText:updateInputText,autoCorrect:false,spellCheck:false});$[57]=displayText;$[58]=handleBlur;$[59]=handleFocus;$[60]=handleKeyPress;$[61]=handleSubmitEditing;$[62]=inputProps;$[63]=inputRef;$[64]=theme.textInput;$[65]=updateInputText;$[66]=t10;}else{t10=$[66];}var t11;if($[67]!==theme.panelGap){t11={parentMargin:theme.panelGap};$[67]=theme.panelGap;$[68]=t11;}else{t11=$[68];}var t12;if($[69]!==activeIndex||$[70]!==filteredItems||$[71]!==query||$[72]!==selectItem||$[73]!==theme.menu){t12=t13=>{var inverted=t13.inverted;return _jsx(ComboboxBlurGuard,{children:_jsx(Menu,{theme:theme.menu,data:filteredItems,activeIndex:activeIndex,reverse:inverted,keyExtractor:_temp,renderItem:t14=>{var item_0=t14.item,index=t14.index;return _jsx(MenuItem,{label:item_0.label,description:item_0.description,searchValue:query,highlighted:index===activeIndex,onPress:()=>selectItem(item_0)});}})});};$[69]=activeIndex;$[70]=filteredItems;$[71]=query;$[72]=selectItem;$[73]=theme.menu;$[74]=t12;}else{t12=$[74];}var t13;if($[75]!==anchorRef||$[76]!==containerPosition||$[77]!==inputRef||$[78]!==showContainer||$[79]!==t11||$[80]!==t12){t13=_jsx(AnchoredContainer,{parentRef:inputRef,anchorRef:anchorRef,show:showContainer,position:containerPosition,theme:t11,onInvertedChange:setIsMenuInverted,children:t12});$[75]=anchorRef;$[76]=containerPosition;$[77]=inputRef;$[78]=showContainer;$[79]=t11;$[80]=t12;$[81]=t13;}else{t13=$[81];}var t14;if($[82]!==t10||$[83]!==t13){t14=_jsxs(_Fragment,{children:[t10,t13]});$[82]=t10;$[83]=t13;$[84]=t14;}else{t14=$[84];}return t14;};function _temp(item){return String(getItemKey(item));}
|
|
1
|
+
var _excluded=["items","value","defaultValue","inputValue","defaultInputValue","onChange","onInputChange","onSubmit","submitOnEnter","selectBehavior","controllerRef","disableOpenOnFocus","allowsCustomValue","filterItems","minimumSearchLength","maxSuggestionCount","containerPosition","anchorRef","theme","onBlur","onFocus","onKeyPress","ref"];function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useImperativeHandle,useState}from"react";import{Platform}from"react-native";import{useComponent,useForwardedRef}from"../../../internal";import{Menu,MenuItem}from"../../../overlays";import{AnchoredContainer}from"../../../overlays/anchoredContainer";import{FieldTextInput,useFieldControlState}from"../../field";import{ComboboxBlurGuard}from"./ComboboxBlurGuard";import{getItemKey}from"./helpers";import{useComboboxController}from"./useComboboxController";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";var EMPTY_ITEMS=[];export var ComboboxInputBase=props=>{var $=_c(88);var anchorRef;var containerPosition;var controllerRef;var defaultInputValue;var defaultValue;var filterItems;var inputProps;var inputValue;var maxSuggestionCount;var onBlur;var onChange;var onFocus;var onInputChange;var onKeyPress;var onSubmit;var ref;var t0;var t1;var t2;var t3;var t4;var t5;var themeOverrides;var value;if($[0]!==props){t0=props.items;value=props.value;defaultValue=props.defaultValue;inputValue=props.inputValue;defaultInputValue=props.defaultInputValue;onChange=props.onChange;onInputChange=props.onInputChange;onSubmit=props.onSubmit;t1=props.submitOnEnter;t2=props.selectBehavior;controllerRef=props.controllerRef;t3=props.disableOpenOnFocus;t4=props.allowsCustomValue;filterItems=props.filterItems;t5=props.minimumSearchLength;maxSuggestionCount=props.maxSuggestionCount;containerPosition=props.containerPosition;anchorRef=props.anchorRef;themeOverrides=props.theme;onBlur=props.onBlur;onFocus=props.onFocus;onKeyPress=props.onKeyPress;ref=props.ref;inputProps=_objectWithoutProperties(props,_excluded);$[0]=props;$[1]=anchorRef;$[2]=containerPosition;$[3]=controllerRef;$[4]=defaultInputValue;$[5]=defaultValue;$[6]=filterItems;$[7]=inputProps;$[8]=inputValue;$[9]=maxSuggestionCount;$[10]=onBlur;$[11]=onChange;$[12]=onFocus;$[13]=onInputChange;$[14]=onKeyPress;$[15]=onSubmit;$[16]=ref;$[17]=t0;$[18]=t1;$[19]=t2;$[20]=t3;$[21]=t4;$[22]=t5;$[23]=themeOverrides;$[24]=value;}else{anchorRef=$[1];containerPosition=$[2];controllerRef=$[3];defaultInputValue=$[4];defaultValue=$[5];filterItems=$[6];inputProps=$[7];inputValue=$[8];maxSuggestionCount=$[9];onBlur=$[10];onChange=$[11];onFocus=$[12];onInputChange=$[13];onKeyPress=$[14];onSubmit=$[15];ref=$[16];t0=$[17];t1=$[18];t2=$[19];t3=$[20];t4=$[21];t5=$[22];themeOverrides=$[23];value=$[24];}var items=t0===undefined?EMPTY_ITEMS:t0;var submitOnEnter=t1===undefined?false:t1;var selectBehavior=t2===undefined?"blurAndClose":t2;var disableOpenOnFocus=t3===undefined?false:t3;var allowsCustomValue=t4===undefined?false:t4;var minimumSearchLength=t5===undefined?1:t5;var isValueControlled="value"in props;var isInputControlled="inputValue"in props;var _useFieldControlState=useFieldControlState(),interactive=_useFieldControlState.interactive;var inputRef=useForwardedRef(ref);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isMenuInverted=_useState2[0],setIsMenuInverted=_useState2[1];var t6;if($[25]!==themeOverrides){t6={themeOverrides};$[25]=themeOverrides;$[26]=t6;}else{t6=$[26];}var _useComponent=useComponent("comboboxInput",t6),theme=_useComponent.theme;var singleLineHeight=theme.option.paddingVertical*2+theme.option.lineHeight.label;var descriptionHeight=singleLineHeight+theme.option.lineHeight.description;var hasDescriptionLines=items.some(_temp);var optionHeight=hasDescriptionLines?descriptionHeight:singleLineHeight;var t7;if($[27]!==allowsCustomValue||$[28]!==defaultInputValue||$[29]!==defaultValue||$[30]!==disableOpenOnFocus||$[31]!==filterItems||$[32]!==inputRef||$[33]!==inputValue||$[34]!==interactive||$[35]!==isInputControlled||$[36]!==isMenuInverted||$[37]!==isValueControlled||$[38]!==items||$[39]!==maxSuggestionCount||$[40]!==minimumSearchLength||$[41]!==onBlur||$[42]!==onChange||$[43]!==onFocus||$[44]!==onInputChange||$[45]!==onKeyPress||$[46]!==onSubmit||$[47]!==selectBehavior||$[48]!==submitOnEnter||$[49]!==value){t7={items,value,defaultValue,isValueControlled,inputValue,defaultInputValue,isInputControlled,interactive,onChange,onInputChange,onSubmit,onFocus,onBlur,onKeyPress,selectBehavior,disableOpenOnFocus,allowsCustomValue,submitOnEnter,filterItems,minimumSearchLength,maxSuggestionCount,inputRef,isMenuInverted};$[27]=allowsCustomValue;$[28]=defaultInputValue;$[29]=defaultValue;$[30]=disableOpenOnFocus;$[31]=filterItems;$[32]=inputRef;$[33]=inputValue;$[34]=interactive;$[35]=isInputControlled;$[36]=isMenuInverted;$[37]=isValueControlled;$[38]=items;$[39]=maxSuggestionCount;$[40]=minimumSearchLength;$[41]=onBlur;$[42]=onChange;$[43]=onFocus;$[44]=onInputChange;$[45]=onKeyPress;$[46]=onSubmit;$[47]=selectBehavior;$[48]=submitOnEnter;$[49]=value;$[50]=t7;}else{t7=$[50];}var _useComboboxControlle=useComboboxController(t7),displayText=_useComboboxControlle.displayText,query=_useComboboxControlle.query,filteredItems=_useComboboxControlle.filteredItems,showContainer=_useComboboxControlle.showContainer,activeIndex=_useComboboxControlle.activeIndex,handleFocus=_useComboboxControlle.handleFocus,handleBlur=_useComboboxControlle.handleBlur,handleKeyPress=_useComboboxControlle.handleKeyPress,handleSubmitEditing=_useComboboxControlle.handleSubmitEditing,selectItem=_useComboboxControlle.selectItem,updateInputText=_useComboboxControlle.updateInputText,open=_useComboboxControlle.open,close=_useComboboxControlle.close,handlePress=_useComboboxControlle.handlePress;var t8;if($[51]!==handlePress){t8=Platform.OS==="web"?{onMouseDown:handlePress}:{onPressIn:handlePress};$[51]=handlePress;$[52]=t8;}else{t8=$[52];}var pressHandlers=t8;var t10;var t9;if($[53]!==close||$[54]!==inputRef||$[55]!==interactive||$[56]!==open){t9=()=>({open,close,focus:()=>interactive&&inputRef.current?.focus(),blur:()=>inputRef.current?.blur()});t10=[open,close,interactive,inputRef];$[53]=close;$[54]=inputRef;$[55]=interactive;$[56]=open;$[57]=t10;$[58]=t9;}else{t10=$[57];t9=$[58];}useImperativeHandle(controllerRef,t9,t10);var t11;if($[59]!==displayText||$[60]!==handleBlur||$[61]!==handleFocus||$[62]!==handleKeyPress||$[63]!==handleSubmitEditing||$[64]!==inputProps||$[65]!==inputRef||$[66]!==pressHandlers||$[67]!==theme.input||$[68]!==updateInputText){t11=_jsx(FieldTextInput,{...inputProps,...pressHandlers,ref:inputRef,theme:theme.input,value:displayText,submitBehavior:"submit",blurOnSubmit:false,onFocus:handleFocus,onBlur:handleBlur,onKeyPress:handleKeyPress,onSubmitEditing:handleSubmitEditing,onChangeText:updateInputText,autoCorrect:false,spellCheck:false});$[59]=displayText;$[60]=handleBlur;$[61]=handleFocus;$[62]=handleKeyPress;$[63]=handleSubmitEditing;$[64]=inputProps;$[65]=inputRef;$[66]=pressHandlers;$[67]=theme.input;$[68]=updateInputText;$[69]=t11;}else{t11=$[69];}var t12;if($[70]!==activeIndex||$[71]!==filteredItems||$[72]!==optionHeight||$[73]!==query||$[74]!==selectItem||$[75]!==theme.menu||$[76]!==theme.option){t12=t13=>{var inverted=t13.inverted;return _jsx(ComboboxBlurGuard,{children:_jsx(Menu,{theme:theme.menu,data:filteredItems,activeIndex:activeIndex,reverse:inverted,scrollResetKey:query,getItemLayout:(_data,index)=>({length:optionHeight,offset:theme.menu.padding+index*(optionHeight+theme.menu.gap),index}),keyExtractor:_temp2,renderItem:t14=>{var item_1=t14.item,index_0=t14.index;return _jsx(MenuItem,{label:item_1.label,description:item_1.description,searchValue:query,highlighted:index_0===activeIndex,truncate:true,height:optionHeight,onPress:()=>selectItem(item_1),theme:theme.option});}})});};$[70]=activeIndex;$[71]=filteredItems;$[72]=optionHeight;$[73]=query;$[74]=selectItem;$[75]=theme.menu;$[76]=theme.option;$[77]=t12;}else{t12=$[77];}var t13;if($[78]!==anchorRef||$[79]!==containerPosition||$[80]!==inputRef||$[81]!==showContainer||$[82]!==t12||$[83]!==theme.panel){t13=_jsx(AnchoredContainer,{parentRef:inputRef,anchorRef:anchorRef,show:showContainer,position:containerPosition,theme:theme.panel,onInvertedChange:setIsMenuInverted,children:t12});$[78]=anchorRef;$[79]=containerPosition;$[80]=inputRef;$[81]=showContainer;$[82]=t12;$[83]=theme.panel;$[84]=t13;}else{t13=$[84];}var t14;if($[85]!==t11||$[86]!==t13){t14=_jsxs(_Fragment,{children:[t11,t13]});$[85]=t11;$[86]=t13;$[87]=t14;}else{t14=$[87];}return t14;};function _temp(item){return item.description!==undefined&&item.description!=="";}function _temp2(item_0){return String(getItemKey(item_0));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}import{c as _c}from"react/compiler-runtime";import{useEffect,useRef,useState}from"react";import{filterComboboxItems,getItemKey}from"./helpers";var resolveSubmit=({showContainer,activeIndex,filteredItems,query,selectedItem,allowsCustomValue})=>{var highlightedItem=showContainer&&activeIndex>=0?filteredItems[activeIndex]:undefined;if(highlightedItem){return{type:"item",item:highlightedItem};}var customValue=query.trim();if(allowsCustomValue&&customValue&&customValue!==selectedItem?.label.trim()){return{type:"custom",customValue};}return{type:"selected",item:selectedItem};};export var useComboboxController=t0=>{var $=_c(135);var items=t0.items,value=t0.value,defaultValue=t0.defaultValue,isValueControlled=t0.isValueControlled,inputValue=t0.inputValue,defaultInputValue=t0.defaultInputValue,isInputControlled=t0.isInputControlled,interactive=t0.interactive,onChange=t0.onChange,onInputChange=t0.onInputChange,onSubmit=t0.onSubmit,onFocus=t0.onFocus,onBlur=t0.onBlur,onKeyPress=t0.onKeyPress,selectBehavior=t0.selectBehavior,disableOpenOnFocus=t0.disableOpenOnFocus,allowsCustomValue=t0.allowsCustomValue,submitOnEnter=t0.submitOnEnter,filterItems=t0.filterItems,minimumSearchLength=t0.minimumSearchLength,maxSuggestionCount=t0.maxSuggestionCount,inputRef=t0.inputRef,isMenuInverted=t0.isMenuInverted;var _useControlledState=useControlledState(isValueControlled,value,defaultValue),_useControlledState2=_slicedToArray(_useControlledState,2),selectedKey=_useControlledState2[0],setSelectedKey=_useControlledState2[1];var _useState=useState(defaultInputValue),_useState2=_slicedToArray(_useState,2),inputText=_useState2[0],setInputText=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isOpen=_useState4[0],setIsOpen=_useState4[1];var _useState5=useState(-1),_useState6=_slicedToArray(_useState5,2),activeIndex=_useState6[0],setActiveIndex=_useState6[1];var skipBlurRef=useRef(false);var previousValueRef=useRef(value);var expectedValueChangeRef=useRef(undefined);var t1;var t2;if($[0]!==isInputControlled||$[1]!==value){t1=()=>{var previousValue=previousValueRef.current;if(previousValue===value){return;}previousValueRef.current=value;var expectedChange=expectedValueChangeRef.current;expectedValueChangeRef.current=undefined;if(expectedChange&&expectedChange.value===value){return;}if(!isInputControlled){setInputText(undefined);}};t2=[isInputControlled,value];$[0]=isInputControlled;$[1]=value;$[2]=t1;$[3]=t2;}else{t1=$[2];t2=$[3];}useEffect(t1,t2);var t3;var t4;if($[4]!==interactive){t3=()=>{if(!interactive){setIsOpen(false);setActiveIndex(-1);}};t4=[interactive];$[4]=interactive;$[5]=t3;$[6]=t4;}else{t3=$[5];t4=$[6];}useEffect(t3,t4);var t5;if($[7]!==items||$[8]!==selectedKey){var _t;if($[10]!==selectedKey){_t=item=>getItemKey(item)===selectedKey;$[10]=selectedKey;$[11]=_t;}else{_t=$[11];}t5=items.find(_t);$[7]=items;$[8]=selectedKey;$[9]=t5;}else{t5=$[9];}var selectedItem=t5;var isInputCleared=isInputControlled?(inputValue??"")==="":inputText==="";var query=isInputControlled?inputValue??"":inputText??"";var displayText=isInputControlled?inputValue??"":inputText??selectedItem?.label??"";var filteredItems;var meetsMinimum;var showContainer;var t6;if($[12]!==filterItems||$[13]!==isOpen||$[14]!==items||$[15]!==maxSuggestionCount||$[16]!==minimumSearchLength||$[17]!==query||$[18]!==selectedKey){var _filterComboboxItems=filterComboboxItems(items,query,{filterItems,maxSuggestionCount,minimumSearchLength});filteredItems=_filterComboboxItems.filteredItems;meetsMinimum=_filterComboboxItems.meetsMinimum;showContainer=isOpen&&meetsMinimum&&filteredItems.length>0;t6=selectedKey===undefined?-1:filteredItems.findIndex(item_0=>getItemKey(item_0)===selectedKey);$[12]=filterItems;$[13]=isOpen;$[14]=items;$[15]=maxSuggestionCount;$[16]=minimumSearchLength;$[17]=query;$[18]=selectedKey;$[19]=filteredItems;$[20]=meetsMinimum;$[21]=showContainer;$[22]=t6;}else{filteredItems=$[19];meetsMinimum=$[20];showContainer=$[21];t6=$[22];}var selectedIndex=t6;var initialActiveIndex=selectedIndex>=0?selectedIndex:0;var t7;var t8;if($[23]!==activeIndex||$[24]!==filteredItems.length||$[25]!==isInputCleared||$[26]!==showContainer){t7=()=>{if(!showContainer||filteredItems.length===0){if(activeIndex!==-1){setActiveIndex(-1);}return;}if(activeIndex<0){if(!isInputCleared){setActiveIndex(0);}return;}if(activeIndex>=filteredItems.length){setActiveIndex(filteredItems.length-1);}};t8=[activeIndex,filteredItems.length,isInputCleared,showContainer];$[23]=activeIndex;$[24]=filteredItems.length;$[25]=isInputCleared;$[26]=showContainer;$[27]=t7;$[28]=t8;}else{t7=$[27];t8=$[28];}useEffect(t7,t8);var t9;if($[29]!==displayText||$[30]!==isInputControlled||$[31]!==onInputChange||$[32]!==selectedItem?.label){t9=()=>{var fallback=selectedItem?.label??"";if(!isInputControlled){setInputText(undefined);}if(displayText!==fallback){onInputChange?.({inputValue:fallback,reason:"revert"});}};$[29]=displayText;$[30]=isInputControlled;$[31]=onInputChange;$[32]=selectedItem?.label;$[33]=t9;}else{t9=$[33];}var revertText=t9;var commitCustomValue;var selectItem;var settleText;if($[34]!==allowsCustomValue||$[35]!==inputRef||$[36]!==interactive||$[37]!==isInputControlled||$[38]!==onChange||$[39]!==onInputChange||$[40]!==query||$[41]!==revertText||$[42]!==selectBehavior||$[43]!==selectedItem?.label||$[44]!==selectedKey||$[45]!==setSelectedKey){settleText=()=>{var customValue=query.trim();if(allowsCustomValue&&customValue&&customValue!==selectedItem?.label.trim()){commitCustomValue(customValue,true);return;}revertText();};var _t2;if($[49]!==inputRef||$[50]!==interactive||$[51]!==isInputControlled||$[52]!==onChange||$[53]!==onInputChange||$[54]!==selectBehavior||$[55]!==setSelectedKey){_t2=item_1=>{if(!interactive){return;}var nextKey=getItemKey(item_1);setSelectedKey(nextKey);expectedValueChangeRef.current={value:nextKey};onChange?.({value:nextKey,item:item_1,reason:"select"});if(!isInputControlled){setInputText(undefined);}onInputChange?.({inputValue:item_1.label,reason:"select"});setActiveIndex(-1);var shouldBlur=selectBehavior==="blurAndClose";var shouldClose=selectBehavior!=="keepOpen";if(shouldClose){setIsOpen(false);}if(shouldBlur){skipBlurRef.current=true;inputRef.current?.blur();}};$[49]=inputRef;$[50]=interactive;$[51]=isInputControlled;$[52]=onChange;$[53]=onInputChange;$[54]=selectBehavior;$[55]=setSelectedKey;$[56]=_t2;}else{_t2=$[56];}selectItem=_t2;commitCustomValue=(customValue_0,notifyInputChange)=>{if(!interactive){return;}if(selectedKey!==undefined){setSelectedKey(undefined);expectedValueChangeRef.current={value:undefined};onChange?.({value:undefined,item:undefined,reason:"deselect"});}if(!isInputControlled){setInputText(customValue_0);}if(notifyInputChange){onInputChange?.({inputValue:customValue_0,reason:"commit"});}setActiveIndex(-1);setIsOpen(false);};$[34]=allowsCustomValue;$[35]=inputRef;$[36]=interactive;$[37]=isInputControlled;$[38]=onChange;$[39]=onInputChange;$[40]=query;$[41]=revertText;$[42]=selectBehavior;$[43]=selectedItem?.label;$[44]=selectedKey;$[45]=setSelectedKey;$[46]=commitCustomValue;$[47]=selectItem;$[48]=settleText;}else{commitCustomValue=$[46];selectItem=$[47];settleText=$[48];}var t10;if($[57]!==disableOpenOnFocus||$[58]!==initialActiveIndex||$[59]!==interactive||$[60]!==onFocus){t10=e=>{skipBlurRef.current=false;var shouldOpen=interactive&&!disableOpenOnFocus;setIsOpen(shouldOpen);setActiveIndex(shouldOpen?initialActiveIndex:-1);onFocus?.(e);};$[57]=disableOpenOnFocus;$[58]=initialActiveIndex;$[59]=interactive;$[60]=onFocus;$[61]=t10;}else{t10=$[61];}var handleFocus=t10;var t11;if($[62]!==interactive||$[63]!==onBlur||$[64]!==settleText){t11=e_0=>{setIsOpen(false);setActiveIndex(-1);if(!interactive){onBlur?.(e_0);return;}if(skipBlurRef.current){skipBlurRef.current=false;onBlur?.(e_0);return;}settleText();onBlur?.(e_0);};$[62]=interactive;$[63]=onBlur;$[64]=settleText;$[65]=t11;}else{t11=$[65];}var handleBlur=t11;var t12;if($[66]!==interactive||$[67]!==isInputControlled||$[68]!==onChange||$[69]!==onInputChange||$[70]!==selectedKey||$[71]!==setSelectedKey){t12=next=>{if(!interactive){return;}skipBlurRef.current=false;setIsOpen(true);if(!isInputControlled){setInputText(next);}if(next===""){if(selectedKey!==undefined){setSelectedKey(undefined);expectedValueChangeRef.current={value:undefined};onChange?.({value:undefined,item:undefined,reason:"deselect"});}onInputChange?.({inputValue:next,reason:"clear"});setActiveIndex(-1);return;}onInputChange?.({inputValue:next,reason:"input"});setActiveIndex(0);};$[66]=interactive;$[67]=isInputControlled;$[68]=onChange;$[69]=onInputChange;$[70]=selectedKey;$[71]=setSelectedKey;$[72]=t12;}else{t12=$[72];}var updateInputText=t12;var t13;if($[73]!==filteredItems.length||$[74]!==initialActiveIndex||$[75]!==interactive||$[76]!==isMenuInverted||$[77]!==meetsMinimum||$[78]!==showContainer){t13=e_1=>{if(!interactive){return;}e_1.preventDefault?.();var itemCount=filteredItems.length;if(!showContainer){if(itemCount>0&&meetsMinimum){setIsOpen(true);setActiveIndex(initialActiveIndex);}return;}setActiveIndex(prev=>Math.min(Math.max(prev+(isMenuInverted?-1:1),0),itemCount-1));};$[73]=filteredItems.length;$[74]=initialActiveIndex;$[75]=interactive;$[76]=isMenuInverted;$[77]=meetsMinimum;$[78]=showContainer;$[79]=t13;}else{t13=$[79];}var handleArrowDown=t13;var t14;if($[80]!==filteredItems.length||$[81]!==interactive||$[82]!==isMenuInverted||$[83]!==showContainer){t14=e_2=>{if(!interactive){return;}e_2.preventDefault?.();if(!showContainer){return;}var itemCount_0=filteredItems.length;var step=isMenuInverted?1:-1;setActiveIndex(prev_0=>Math.min(Math.max(prev_0+step,0),itemCount_0-1));};$[80]=filteredItems.length;$[81]=interactive;$[82]=isMenuInverted;$[83]=showContainer;$[84]=t14;}else{t14=$[84];}var handleArrowUp=t14;var t15;if($[85]!==handleArrowDown||$[86]!==handleArrowUp||$[87]!==interactive||$[88]!==onKeyPress||$[89]!==revertText){t15=e_3=>{if(!interactive){onKeyPress?.(e_3);return;}switch(e_3.nativeEvent.key){case"ArrowDown":{handleArrowDown(e_3);return;}case"ArrowUp":{handleArrowUp(e_3);return;}case"Escape":{setIsOpen(false);setActiveIndex(-1);revertText();return;}default:{onKeyPress?.(e_3);}}};$[85]=handleArrowDown;$[86]=handleArrowUp;$[87]=interactive;$[88]=onKeyPress;$[89]=revertText;$[90]=t15;}else{t15=$[90];}var handleKeyPress=t15;var t16;if($[91]!==inputRef){t16=()=>{skipBlurRef.current=true;inputRef.current?.blur();};$[91]=inputRef;$[92]=t16;}else{t16=$[92];}var blurInput=t16;var t17;if($[93]!==onSubmit||$[94]!==selectItem||$[95]!==submitOnEnter){t17=item_2=>{selectItem(item_2);if(!submitOnEnter){return;}onSubmit?.({value:getItemKey(item_2),item:item_2,inputValue:item_2.label,reason:"select"});};$[93]=onSubmit;$[94]=selectItem;$[95]=submitOnEnter;$[96]=t17;}else{t17=$[96];}var submitItem=t17;var t18;if($[97]!==blurInput||$[98]!==commitCustomValue||$[99]!==onSubmit||$[100]!==query){t18=customValue_1=>{commitCustomValue(customValue_1,customValue_1!==query);onSubmit?.({value:undefined,item:undefined,inputValue:customValue_1,reason:"custom"});blurInput();};$[97]=blurInput;$[98]=commitCustomValue;$[99]=onSubmit;$[100]=query;$[101]=t18;}else{t18=$[101];}var submitCustom=t18;var t19;if($[102]!==blurInput||$[103]!==displayText||$[104]!==onSubmit||$[105]!==revertText){t19=item_3=>{if(displayText!==(item_3?.label??"")){revertText();}onSubmit?.({value:item_3?getItemKey(item_3):undefined,item:item_3,inputValue:item_3?.label??"",reason:item_3?"select":"empty"});blurInput();};$[102]=blurInput;$[103]=displayText;$[104]=onSubmit;$[105]=revertText;$[106]=t19;}else{t19=$[106];}var submitSelection=t19;var t20;if($[107]!==activeIndex||$[108]!==allowsCustomValue||$[109]!==filteredItems||$[110]!==interactive||$[111]!==query||$[112]!==selectedItem||$[113]!==showContainer||$[114]!==submitCustom||$[115]!==submitItem||$[116]!==submitSelection){t20=()=>{if(!interactive){return;}var resolution=resolveSubmit({showContainer,activeIndex,filteredItems,query,selectedItem,allowsCustomValue});if(resolution.type==="item"){submitItem(resolution.item);return;}if(resolution.type==="custom"){submitCustom(resolution.customValue);return;}submitSelection(resolution.item);};$[107]=activeIndex;$[108]=allowsCustomValue;$[109]=filteredItems;$[110]=interactive;$[111]=query;$[112]=selectedItem;$[113]=showContainer;$[114]=submitCustom;$[115]=submitItem;$[116]=submitSelection;$[117]=t20;}else{t20=$[117];}var handleSubmitEditing=t20;var t21;if($[118]!==initialActiveIndex||$[119]!==interactive){t21=()=>{if(interactive){setIsOpen(true);setActiveIndex(initialActiveIndex);}};$[118]=initialActiveIndex;$[119]=interactive;$[120]=t21;}else{t21=$[120];}var t22;if($[121]===Symbol.for("react.memo_cache_sentinel")){t22=()=>{setIsOpen(false);setActiveIndex(-1);};$[121]=t22;}else{t22=$[121];}var t23;if($[122]!==activeIndex||$[123]!==displayText||$[124]!==filteredItems||$[125]!==handleBlur||$[126]!==handleFocus||$[127]!==handleKeyPress||$[128]!==handleSubmitEditing||$[129]!==query||$[130]!==selectItem||$[131]!==showContainer||$[132]!==t21||$[133]!==updateInputText){t23={displayText,query,filteredItems,showContainer,activeIndex,handleFocus,handleBlur,handleKeyPress,handleSubmitEditing,selectItem,updateInputText,open:t21,close:t22};$[122]=activeIndex;$[123]=displayText;$[124]=filteredItems;$[125]=handleBlur;$[126]=handleFocus;$[127]=handleKeyPress;$[128]=handleSubmitEditing;$[129]=query;$[130]=selectItem;$[131]=showContainer;$[132]=t21;$[133]=updateInputText;$[134]=t23;}else{t23=$[134];}return t23;};var useControlledState=(isControlled,value,defaultValue)=>{var $=_c(5);var _useState7=useState(defaultValue),_useState8=_slicedToArray(_useState7,2),internalValue=_useState8[0],setInternalValue=_useState8[1];var currentValue=isControlled?value:internalValue;var t0;if($[0]!==isControlled){t0=nextValue=>{if(!isControlled){setInternalValue(nextValue);}};$[0]=isControlled;$[1]=t0;}else{t0=$[1];}var setValue=t0;var t1;if($[2]!==currentValue||$[3]!==setValue){t1=[currentValue,setValue];$[2]=currentValue;$[3]=setValue;$[4]=t1;}else{t1=$[4];}return t1;};
|
|
1
|
+
function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}import{c as _c}from"react/compiler-runtime";import{useEffect,useRef,useState}from"react";import{filterComboboxItems,getItemKey}from"./helpers";var resolveSubmit=({showContainer,activeIndex,filteredItems,query,selectedItem,allowsCustomValue})=>{var highlightedItem=showContainer&&activeIndex>=0?filteredItems[activeIndex]:undefined;if(highlightedItem){return{type:"item",item:highlightedItem};}var customValue=query.trim();if(allowsCustomValue&&customValue&&customValue!==selectedItem?.label.trim()){return{type:"custom",customValue};}return{type:"selected",item:selectedItem};};export var useComboboxController=t0=>{var $=_c(143);var items=t0.items,value=t0.value,defaultValue=t0.defaultValue,isValueControlled=t0.isValueControlled,inputValue=t0.inputValue,defaultInputValue=t0.defaultInputValue,isInputControlled=t0.isInputControlled,interactive=t0.interactive,onChange=t0.onChange,onInputChange=t0.onInputChange,onSubmit=t0.onSubmit,onFocus=t0.onFocus,onBlur=t0.onBlur,onKeyPress=t0.onKeyPress,selectBehavior=t0.selectBehavior,disableOpenOnFocus=t0.disableOpenOnFocus,allowsCustomValue=t0.allowsCustomValue,submitOnEnter=t0.submitOnEnter,filterItems=t0.filterItems,minimumSearchLength=t0.minimumSearchLength,maxSuggestionCount=t0.maxSuggestionCount,inputRef=t0.inputRef,isMenuInverted=t0.isMenuInverted;var _useControlledState=useControlledState(isValueControlled,value,defaultValue),_useControlledState2=_slicedToArray(_useControlledState,2),selectedKey=_useControlledState2[0],setSelectedKey=_useControlledState2[1];var _useState=useState(defaultInputValue),_useState2=_slicedToArray(_useState,2),inputText=_useState2[0],setInputText=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isFocused=_useState4[0],setIsFocused=_useState4[1];var _useState5=useState(false),_useState6=_slicedToArray(_useState5,2),isOpen=_useState6[0],setIsOpen=_useState6[1];var _useState7=useState(-1),_useState8=_slicedToArray(_useState7,2),activeIndex=_useState8[0],setActiveIndex=_useState8[1];var skipBlurRef=useRef(false);var previousValueRef=useRef(value);var expectedValueChangeRef=useRef(undefined);var t1;var t2;if($[0]!==isInputControlled||$[1]!==value){t1=()=>{var previousValue=previousValueRef.current;if(previousValue===value){return;}previousValueRef.current=value;var expectedChange=expectedValueChangeRef.current;expectedValueChangeRef.current=undefined;if(expectedChange&&expectedChange.value===value){return;}if(!isInputControlled){setInputText(undefined);}};t2=[isInputControlled,value];$[0]=isInputControlled;$[1]=value;$[2]=t1;$[3]=t2;}else{t1=$[2];t2=$[3];}useEffect(t1,t2);var t3;var t4;if($[4]!==interactive){t3=()=>{if(!interactive){setIsOpen(false);setActiveIndex(-1);}};t4=[interactive];$[4]=interactive;$[5]=t3;$[6]=t4;}else{t3=$[5];t4=$[6];}useEffect(t3,t4);var t5;if($[7]!==items||$[8]!==selectedKey){var _t;if($[10]!==selectedKey){_t=item=>getItemKey(item)===selectedKey;$[10]=selectedKey;$[11]=_t;}else{_t=$[11];}t5=items.find(_t);$[7]=items;$[8]=selectedKey;$[9]=t5;}else{t5=$[9];}var selectedItem=t5;var isInputCleared=isInputControlled?(inputValue??"")==="":inputText==="";var query=isInputControlled?inputValue??"":inputText??"";var displayText=isInputControlled?inputValue??"":inputText??selectedItem?.label??"";var filteredItems;var meetsMinimum;var showContainer;var t6;if($[12]!==filterItems||$[13]!==isOpen||$[14]!==items||$[15]!==maxSuggestionCount||$[16]!==minimumSearchLength||$[17]!==query||$[18]!==selectedKey){var _filterComboboxItems=filterComboboxItems(items,query,{filterItems,maxSuggestionCount,minimumSearchLength});filteredItems=_filterComboboxItems.filteredItems;meetsMinimum=_filterComboboxItems.meetsMinimum;showContainer=isOpen&&meetsMinimum&&filteredItems.length>0;t6=selectedKey===undefined?-1:filteredItems.findIndex(item_0=>getItemKey(item_0)===selectedKey);$[12]=filterItems;$[13]=isOpen;$[14]=items;$[15]=maxSuggestionCount;$[16]=minimumSearchLength;$[17]=query;$[18]=selectedKey;$[19]=filteredItems;$[20]=meetsMinimum;$[21]=showContainer;$[22]=t6;}else{filteredItems=$[19];meetsMinimum=$[20];showContainer=$[21];t6=$[22];}var selectedIndex=t6;var initialActiveIndex=selectedIndex>=0?selectedIndex:0;var t7;var t8;if($[23]!==activeIndex||$[24]!==filteredItems.length||$[25]!==isInputCleared||$[26]!==showContainer){t7=()=>{if(!showContainer||filteredItems.length===0){if(activeIndex!==-1){setActiveIndex(-1);}return;}if(activeIndex<0){if(!isInputCleared){setActiveIndex(0);}return;}if(activeIndex>=filteredItems.length){setActiveIndex(filteredItems.length-1);}};t8=[activeIndex,filteredItems.length,isInputCleared,showContainer];$[23]=activeIndex;$[24]=filteredItems.length;$[25]=isInputCleared;$[26]=showContainer;$[27]=t7;$[28]=t8;}else{t7=$[27];t8=$[28];}useEffect(t7,t8);var t9;if($[29]!==displayText||$[30]!==isInputControlled||$[31]!==onInputChange||$[32]!==selectedItem?.label){t9=()=>{var fallback=selectedItem?.label??"";if(!isInputControlled){setInputText(undefined);}if(displayText!==fallback){onInputChange?.({inputValue:fallback,reason:"revert"});}};$[29]=displayText;$[30]=isInputControlled;$[31]=onInputChange;$[32]=selectedItem?.label;$[33]=t9;}else{t9=$[33];}var revertText=t9;var commitCustomValue;var selectItem;var settleText;if($[34]!==allowsCustomValue||$[35]!==inputRef||$[36]!==interactive||$[37]!==isInputControlled||$[38]!==onChange||$[39]!==onInputChange||$[40]!==query||$[41]!==revertText||$[42]!==selectBehavior||$[43]!==selectedItem?.label||$[44]!==selectedKey||$[45]!==setSelectedKey){settleText=()=>{var customValue=query.trim();if(allowsCustomValue&&customValue&&customValue!==selectedItem?.label.trim()){commitCustomValue(customValue,true);return;}revertText();};var _t2;if($[49]!==inputRef||$[50]!==interactive||$[51]!==isInputControlled||$[52]!==onChange||$[53]!==onInputChange||$[54]!==selectBehavior||$[55]!==setSelectedKey){_t2=item_1=>{if(!interactive){return;}var nextKey=getItemKey(item_1);setSelectedKey(nextKey);expectedValueChangeRef.current={value:nextKey};onChange?.({value:nextKey,item:item_1,reason:"select"});if(!isInputControlled){setInputText(undefined);}onInputChange?.({inputValue:item_1.label,reason:"select"});setActiveIndex(-1);var shouldBlur=selectBehavior==="blurAndClose";var shouldClose=selectBehavior!=="keepOpen";if(shouldClose){setIsOpen(false);}if(shouldBlur){skipBlurRef.current=true;inputRef.current?.blur();}};$[49]=inputRef;$[50]=interactive;$[51]=isInputControlled;$[52]=onChange;$[53]=onInputChange;$[54]=selectBehavior;$[55]=setSelectedKey;$[56]=_t2;}else{_t2=$[56];}selectItem=_t2;commitCustomValue=(customValue_0,notifyInputChange)=>{if(!interactive){return;}if(selectedKey!==undefined){setSelectedKey(undefined);expectedValueChangeRef.current={value:undefined};onChange?.({value:undefined,item:undefined,reason:"deselect"});}if(!isInputControlled){setInputText(customValue_0);}if(notifyInputChange){onInputChange?.({inputValue:customValue_0,reason:"commit"});}setActiveIndex(-1);setIsOpen(false);};$[34]=allowsCustomValue;$[35]=inputRef;$[36]=interactive;$[37]=isInputControlled;$[38]=onChange;$[39]=onInputChange;$[40]=query;$[41]=revertText;$[42]=selectBehavior;$[43]=selectedItem?.label;$[44]=selectedKey;$[45]=setSelectedKey;$[46]=commitCustomValue;$[47]=selectItem;$[48]=settleText;}else{commitCustomValue=$[46];selectItem=$[47];settleText=$[48];}var t10;if($[57]!==disableOpenOnFocus||$[58]!==initialActiveIndex||$[59]!==interactive||$[60]!==onFocus){t10=e=>{setIsFocused(true);skipBlurRef.current=false;var shouldOpen=interactive&&!disableOpenOnFocus;setIsOpen(shouldOpen);setActiveIndex(shouldOpen?initialActiveIndex:-1);onFocus?.(e);};$[57]=disableOpenOnFocus;$[58]=initialActiveIndex;$[59]=interactive;$[60]=onFocus;$[61]=t10;}else{t10=$[61];}var handleFocus=t10;var t11;if($[62]!==interactive||$[63]!==onBlur||$[64]!==settleText){t11=e_0=>{setIsFocused(false);setIsOpen(false);setActiveIndex(-1);if(!interactive){onBlur?.(e_0);return;}if(skipBlurRef.current){skipBlurRef.current=false;onBlur?.(e_0);return;}settleText();onBlur?.(e_0);};$[62]=interactive;$[63]=onBlur;$[64]=settleText;$[65]=t11;}else{t11=$[65];}var handleBlur=t11;var t12;if($[66]!==interactive||$[67]!==isInputControlled||$[68]!==onChange||$[69]!==onInputChange||$[70]!==selectedKey||$[71]!==setSelectedKey){t12=next=>{if(!interactive){return;}skipBlurRef.current=false;setIsOpen(true);if(!isInputControlled){setInputText(next);}if(next===""){if(selectedKey!==undefined){setSelectedKey(undefined);expectedValueChangeRef.current={value:undefined};onChange?.({value:undefined,item:undefined,reason:"deselect"});}onInputChange?.({inputValue:next,reason:"clear"});setActiveIndex(-1);return;}onInputChange?.({inputValue:next,reason:"input"});setActiveIndex(0);};$[66]=interactive;$[67]=isInputControlled;$[68]=onChange;$[69]=onInputChange;$[70]=selectedKey;$[71]=setSelectedKey;$[72]=t12;}else{t12=$[72];}var updateInputText=t12;var t13;if($[73]!==filteredItems.length||$[74]!==initialActiveIndex||$[75]!==interactive||$[76]!==isMenuInverted||$[77]!==meetsMinimum||$[78]!==showContainer){t13=e_1=>{if(!interactive){return;}e_1.preventDefault?.();var itemCount=filteredItems.length;if(!showContainer){if(itemCount>0&&meetsMinimum){setIsOpen(true);setActiveIndex(initialActiveIndex);}return;}setActiveIndex(prev=>Math.min(Math.max(prev+(isMenuInverted?-1:1),0),itemCount-1));};$[73]=filteredItems.length;$[74]=initialActiveIndex;$[75]=interactive;$[76]=isMenuInverted;$[77]=meetsMinimum;$[78]=showContainer;$[79]=t13;}else{t13=$[79];}var handleArrowDown=t13;var t14;if($[80]!==filteredItems.length||$[81]!==interactive||$[82]!==isMenuInverted||$[83]!==showContainer){t14=e_2=>{if(!interactive){return;}e_2.preventDefault?.();if(!showContainer){return;}var itemCount_0=filteredItems.length;var step=isMenuInverted?1:-1;setActiveIndex(prev_0=>Math.min(Math.max(prev_0+step,0),itemCount_0-1));};$[80]=filteredItems.length;$[81]=interactive;$[82]=isMenuInverted;$[83]=showContainer;$[84]=t14;}else{t14=$[84];}var handleArrowUp=t14;var t15;if($[85]!==handleArrowDown||$[86]!==handleArrowUp||$[87]!==interactive||$[88]!==onKeyPress||$[89]!==revertText){t15=e_3=>{if(!interactive){onKeyPress?.(e_3);return;}switch(e_3.nativeEvent.key){case"ArrowDown":{handleArrowDown(e_3);return;}case"ArrowUp":{handleArrowUp(e_3);return;}case"Escape":{setIsOpen(false);setActiveIndex(-1);revertText();return;}default:{onKeyPress?.(e_3);}}};$[85]=handleArrowDown;$[86]=handleArrowUp;$[87]=interactive;$[88]=onKeyPress;$[89]=revertText;$[90]=t15;}else{t15=$[90];}var handleKeyPress=t15;var t16;if($[91]!==inputRef){t16=()=>{skipBlurRef.current=true;inputRef.current?.blur();};$[91]=inputRef;$[92]=t16;}else{t16=$[92];}var blurInput=t16;var t17;if($[93]!==onSubmit||$[94]!==selectItem||$[95]!==submitOnEnter){t17=item_2=>{selectItem(item_2);if(!submitOnEnter){return;}onSubmit?.({value:getItemKey(item_2),item:item_2,inputValue:item_2.label,reason:"select"});};$[93]=onSubmit;$[94]=selectItem;$[95]=submitOnEnter;$[96]=t17;}else{t17=$[96];}var submitItem=t17;var t18;if($[97]!==blurInput||$[98]!==commitCustomValue||$[99]!==onSubmit||$[100]!==query){t18=customValue_1=>{commitCustomValue(customValue_1,customValue_1!==query);onSubmit?.({value:undefined,item:undefined,inputValue:customValue_1,reason:"custom"});blurInput();};$[97]=blurInput;$[98]=commitCustomValue;$[99]=onSubmit;$[100]=query;$[101]=t18;}else{t18=$[101];}var submitCustom=t18;var t19;if($[102]!==blurInput||$[103]!==displayText||$[104]!==onSubmit||$[105]!==revertText){t19=item_3=>{if(displayText!==(item_3?.label??"")){revertText();}onSubmit?.({value:item_3?getItemKey(item_3):undefined,item:item_3,inputValue:item_3?.label??"",reason:item_3?"select":"empty"});blurInput();};$[102]=blurInput;$[103]=displayText;$[104]=onSubmit;$[105]=revertText;$[106]=t19;}else{t19=$[106];}var submitSelection=t19;var t20;if($[107]!==initialActiveIndex||$[108]!==interactive){t20=()=>{if(interactive){setIsOpen(true);setActiveIndex(initialActiveIndex);}};$[107]=initialActiveIndex;$[108]=interactive;$[109]=t20;}else{t20=$[109];}var openMenu=t20;var t21;if($[110]===Symbol.for("react.memo_cache_sentinel")){t21=()=>{setIsOpen(false);setActiveIndex(-1);};$[110]=t21;}else{t21=$[110];}var closeMenu=t21;var t22;if($[111]!==interactive||$[112]!==isOpen||$[113]!==openMenu){t22=()=>{if(!interactive){return;}if(isOpen){closeMenu();return;}openMenu();};$[111]=interactive;$[112]=isOpen;$[113]=openMenu;$[114]=t22;}else{t22=$[114];}var toggleMenu=t22;var t23;if($[115]!==isFocused||$[116]!==toggleMenu){t23=()=>{if(isFocused){toggleMenu();}};$[115]=isFocused;$[116]=toggleMenu;$[117]=t23;}else{t23=$[117];}var handlePress=t23;var t24;if($[118]!==activeIndex||$[119]!==allowsCustomValue||$[120]!==filteredItems||$[121]!==interactive||$[122]!==query||$[123]!==selectedItem||$[124]!==showContainer||$[125]!==submitCustom||$[126]!==submitItem||$[127]!==submitSelection){t24=()=>{if(!interactive){return;}var resolution=resolveSubmit({showContainer,activeIndex,filteredItems,query,selectedItem,allowsCustomValue});if(resolution.type==="item"){submitItem(resolution.item);return;}if(resolution.type==="custom"){submitCustom(resolution.customValue);return;}submitSelection(resolution.item);};$[118]=activeIndex;$[119]=allowsCustomValue;$[120]=filteredItems;$[121]=interactive;$[122]=query;$[123]=selectedItem;$[124]=showContainer;$[125]=submitCustom;$[126]=submitItem;$[127]=submitSelection;$[128]=t24;}else{t24=$[128];}var handleSubmitEditing=t24;var t25;if($[129]!==activeIndex||$[130]!==displayText||$[131]!==filteredItems||$[132]!==handleBlur||$[133]!==handleFocus||$[134]!==handleKeyPress||$[135]!==handlePress||$[136]!==handleSubmitEditing||$[137]!==openMenu||$[138]!==query||$[139]!==selectItem||$[140]!==showContainer||$[141]!==updateInputText){t25={displayText,query,filteredItems,showContainer,activeIndex,handleFocus,handleBlur,handleKeyPress,handleSubmitEditing,selectItem,updateInputText,open:openMenu,close:closeMenu,handlePress};$[129]=activeIndex;$[130]=displayText;$[131]=filteredItems;$[132]=handleBlur;$[133]=handleFocus;$[134]=handleKeyPress;$[135]=handlePress;$[136]=handleSubmitEditing;$[137]=openMenu;$[138]=query;$[139]=selectItem;$[140]=showContainer;$[141]=updateInputText;$[142]=t25;}else{t25=$[142];}return t25;};var useControlledState=(isControlled,value,defaultValue)=>{var $=_c(5);var _useState9=useState(defaultValue),_useState0=_slicedToArray(_useState9,2),internalValue=_useState0[0],setInternalValue=_useState0[1];var currentValue=isControlled?value:internalValue;var t0;if($[0]!==isControlled){t0=nextValue=>{if(!isControlled){setInternalValue(nextValue);}};$[0]=isControlled;$[1]=t0;}else{t0=$[1];}var setValue=t0;var t1;if($[2]!==currentValue||$[3]!==setValue){t1=[currentValue,setValue];$[2]=currentValue;$[3]=setValue;$[4]=t1;}else{t1=$[4];}return t1;};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{StyleSheet}from"react-native";import{useComponent}from"../../../internal";import{FieldAction,FieldNumberInput,FieldRow,FieldSurface,useFieldControlState}from"../../field";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var CounterControl=t0=>{var $=_c(52);var value=t0.value,onChange=t0.onChange,disableKeyboardInput=t0.disableKeyboardInput,interval=t0.interval,min=t0.min,max=t0.max,keyboardType=t0.keyboardType,placeholder=t0.placeholder,maxLength=t0.maxLength,onSubmitEditing=t0.onSubmitEditing,themeOverrides=t0.theme;var t1;if($[0]!==themeOverrides){t1={themeOverrides};$[0]=themeOverrides;$[1]=t1;}else{t1=$[1];}var _useComponent=useComponent("counterInput",t1),icons=_useComponent.icons,theme=_useComponent.theme;var _useFieldControlState=useFieldControlState(),interactive=_useFieldControlState.interactive;var canChange=interactive&&!!onChange;var t2;if($[2]!==min||$[3]!==value){var parsedValue=Number.parseFloat(value??"");t2=Number.isFinite(parsedValue)?parsedValue:min;$[2]=min;$[3]=value;$[4]=t2;}else{t2=$[4];}var numericValue=t2;var t3;if($[5]!==max||$[6]!==min){t3=next=>Math.min(Math.max(next,min),max);$[5]=max;$[6]=min;$[7]=t3;}else{t3=$[7];}var clampValue=t3;var t4;if($[8]!==clampValue||$[9]!==numericValue||$[10]!==onChange){t4=delta=>onChange?.(clampValue(numericValue+delta).toString());$[8]=clampValue;$[9]=numericValue;$[10]=onChange;$[11]=t4;}else{t4=$[11];}var changeBy=t4;var t5;if($[12]!==clampValue||$[13]!==onChange||$[14]!==value){t5=()=>{if(!value){return;}var parsed=Number.parseFloat(value);if(!Number.isFinite(parsed)){onChange?.("");return;}var clamped=clampValue(parsed).toString();if(clamped!==value){onChange?.(clamped);}};$[12]=clampValue;$[13]=onChange;$[14]=value;$[15]=t5;}else{t5=$[15];}var handleBlur=t5;var t6;if($[16]!==canChange||$[17]!==changeBy||$[18]!==interval){t6=canChange?()=>changeBy(-interval):undefined;$[16]=canChange;$[17]=changeBy;$[18]=interval;$[19]=t6;}else{t6=$[19];}var t7;if($[20]!==icons.decrease||$[21]!==t6){t7=_jsx(FieldAction,{...icons.decrease,accessibilityLabel:"Decrease",tabIndex:-1,onPress:t6});$[20]=icons.decrease;$[21]=t6;$[22]=t7;}else{t7=$[22];}var t8=value??"";var t9=canChange?onChange:undefined;var t10=canChange?handleBlur:undefined;var t11;if($[23]!==canChange||$[24]!==changeBy||$[25]!==interval){t11=canChange?direction=>changeBy(direction*interval):undefined;$[23]=canChange;$[24]=changeBy;$[25]=interval;$[26]=t11;}else{t11=$[26];}var t12;if($[27]!==disableKeyboardInput||$[28]!==keyboardType||$[29]!==maxLength||$[30]!==onSubmitEditing||$[31]!==placeholder||$[32]!==t10||$[33]!==t11||$[34]!==t8||$[35]!==t9||$[36]!==theme.
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{StyleSheet}from"react-native";import{useComponent}from"../../../internal";import{FieldAction,FieldNumberInput,FieldRow,FieldSurface,useFieldControlState}from"../../field";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var CounterControl=t0=>{var $=_c(52);var value=t0.value,onChange=t0.onChange,disableKeyboardInput=t0.disableKeyboardInput,interval=t0.interval,min=t0.min,max=t0.max,keyboardType=t0.keyboardType,placeholder=t0.placeholder,maxLength=t0.maxLength,onSubmitEditing=t0.onSubmitEditing,themeOverrides=t0.theme;var t1;if($[0]!==themeOverrides){t1={themeOverrides};$[0]=themeOverrides;$[1]=t1;}else{t1=$[1];}var _useComponent=useComponent("counterInput",t1),icons=_useComponent.icons,theme=_useComponent.theme;var _useFieldControlState=useFieldControlState(),interactive=_useFieldControlState.interactive;var canChange=interactive&&!!onChange;var t2;if($[2]!==min||$[3]!==value){var parsedValue=Number.parseFloat(value??"");t2=Number.isFinite(parsedValue)?parsedValue:min;$[2]=min;$[3]=value;$[4]=t2;}else{t2=$[4];}var numericValue=t2;var t3;if($[5]!==max||$[6]!==min){t3=next=>Math.min(Math.max(next,min),max);$[5]=max;$[6]=min;$[7]=t3;}else{t3=$[7];}var clampValue=t3;var t4;if($[8]!==clampValue||$[9]!==numericValue||$[10]!==onChange){t4=delta=>onChange?.(clampValue(numericValue+delta).toString());$[8]=clampValue;$[9]=numericValue;$[10]=onChange;$[11]=t4;}else{t4=$[11];}var changeBy=t4;var t5;if($[12]!==clampValue||$[13]!==onChange||$[14]!==value){t5=()=>{if(!value){return;}var parsed=Number.parseFloat(value);if(!Number.isFinite(parsed)){onChange?.("");return;}var clamped=clampValue(parsed).toString();if(clamped!==value){onChange?.(clamped);}};$[12]=clampValue;$[13]=onChange;$[14]=value;$[15]=t5;}else{t5=$[15];}var handleBlur=t5;var t6;if($[16]!==canChange||$[17]!==changeBy||$[18]!==interval){t6=canChange?()=>changeBy(-interval):undefined;$[16]=canChange;$[17]=changeBy;$[18]=interval;$[19]=t6;}else{t6=$[19];}var t7;if($[20]!==icons.decrease||$[21]!==t6){t7=_jsx(FieldAction,{...icons.decrease,accessibilityLabel:"Decrease",tabIndex:-1,onPress:t6});$[20]=icons.decrease;$[21]=t6;$[22]=t7;}else{t7=$[22];}var t8=value??"";var t9=canChange?onChange:undefined;var t10=canChange?handleBlur:undefined;var t11;if($[23]!==canChange||$[24]!==changeBy||$[25]!==interval){t11=canChange?direction=>changeBy(direction*interval):undefined;$[23]=canChange;$[24]=changeBy;$[25]=interval;$[26]=t11;}else{t11=$[26];}var t12;if($[27]!==disableKeyboardInput||$[28]!==keyboardType||$[29]!==maxLength||$[30]!==onSubmitEditing||$[31]!==placeholder||$[32]!==t10||$[33]!==t11||$[34]!==t8||$[35]!==t9||$[36]!==theme.input){t12=_jsx(FieldNumberInput,{maxLength:maxLength,placeholder:placeholder,keyboardType:keyboardType,theme:theme.input,value:t8,onSubmitEditing:onSubmitEditing,onChangeText:t9,onBlur:t10,onStep:t11,readOnly:disableKeyboardInput,style:styles.input});$[27]=disableKeyboardInput;$[28]=keyboardType;$[29]=maxLength;$[30]=onSubmitEditing;$[31]=placeholder;$[32]=t10;$[33]=t11;$[34]=t8;$[35]=t9;$[36]=theme.input;$[37]=t12;}else{t12=$[37];}var t13;if($[38]!==canChange||$[39]!==changeBy||$[40]!==interval){t13=canChange?()=>changeBy(interval):undefined;$[38]=canChange;$[39]=changeBy;$[40]=interval;$[41]=t13;}else{t13=$[41];}var t14;if($[42]!==icons.increase||$[43]!==t13){t14=_jsx(FieldAction,{...icons.increase,accessibilityLabel:"Increase",tabIndex:-1,onPress:t13});$[42]=icons.increase;$[43]=t13;$[44]=t14;}else{t14=$[44];}var t15;if($[45]!==t12||$[46]!==t14||$[47]!==t7){t15=_jsxs(FieldRow,{children:[t7,t12,t14]});$[45]=t12;$[46]=t14;$[47]=t7;$[48]=t15;}else{t15=$[48];}var t16;if($[49]!==t15||$[50]!==theme.surface){t16=_jsx(FieldSurface,{theme:theme.surface,children:t15});$[49]=t15;$[50]=theme.surface;$[51]=t16;}else{t16=$[51];}return t16;};var styles=StyleSheet.create({input:{flexGrow:1,flexBasis:0,textAlign:"center"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultCounterInputTheme=({theme})=>({surface:{...theme.field.surface,padding:0},
|
|
1
|
+
export var defaultCounterInputTheme=({theme})=>({surface:{...theme.field.surface,padding:0},input:theme.field.text});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _excluded=["keyboardType","enabledRepresentations","placeholder","maxLength","value","onChange","onSubmitEditing","returnKeyType","enterKeyHint","submitBehavior","ref","disabled","readOnly","theme"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useImperativeHandle}from"react";import{StyleSheet,View}from"react-native";import{useComponent}from"../../../internal";import{Text}from"../../../typography/text";import{Field,FieldAction,FieldNumberInput,FieldRow,FieldSurface}from"../../field";import{SegmentedInputSegments}from"../shared/SegmentedInputSegments";import{useSegmentedInputNavigation}from"../shared/useSegmentedInputNavigation";import{getClearedNumberInputValue,getNextMode,getNextValue,getNumberInputSegmentStepValue,getNumberInputSegments,updateNumberInputSegment}from"./helpers";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_ENABLED_REPRESENTATIONS=["number","fraction","range"];var DEFAULT_VALUE={representation:"number",value:""};export var NumberInput=t0=>{var $=_c(68);var disabled;var enterKeyHint;var fieldProps;var maxLength;var onChange;var onSubmitEditing;var placeholder;var readOnly;var ref;var returnKeyType;var submitBehavior;var t1;var t2;var t3;var themeOverrides;if($[0]!==t0){t1=t0.keyboardType;t2=t0.enabledRepresentations;placeholder=t0.placeholder;maxLength=t0.maxLength;t3=t0.value;onChange=t0.onChange;onSubmitEditing=t0.onSubmitEditing;returnKeyType=t0.returnKeyType;enterKeyHint=t0.enterKeyHint;submitBehavior=t0.submitBehavior;ref=t0.ref;disabled=t0.disabled;readOnly=t0.readOnly;themeOverrides=t0.theme;fieldProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=disabled;$[2]=enterKeyHint;$[3]=fieldProps;$[4]=maxLength;$[5]=onChange;$[6]=onSubmitEditing;$[7]=placeholder;$[8]=readOnly;$[9]=ref;$[10]=returnKeyType;$[11]=submitBehavior;$[12]=t1;$[13]=t2;$[14]=t3;$[15]=themeOverrides;}else{disabled=$[1];enterKeyHint=$[2];fieldProps=$[3];maxLength=$[4];onChange=$[5];onSubmitEditing=$[6];placeholder=$[7];readOnly=$[8];ref=$[9];returnKeyType=$[10];submitBehavior=$[11];t1=$[12];t2=$[13];t3=$[14];themeOverrides=$[15];}var keyboardType=t1===undefined?"number-pad":t1;var enabledRepresentations=t2===undefined?DEFAULT_ENABLED_REPRESENTATIONS:t2;var value=t3===undefined?DEFAULT_VALUE:t3;var t4;if($[16]!==themeOverrides){t4={themeOverrides};$[16]=themeOverrides;$[17]=t4;}else{t4=$[17];}var _useComponent=useComponent("numberInput",t4),icons=_useComponent.icons,theme=_useComponent.theme;var t5;if($[18]!==placeholder){t5=key=>placeholder?.[key]??placeholder?.value;$[18]=placeholder;$[19]=t5;}else{t5=$[19];}var getPlaceholder=t5;var icon=icons[value.representation];var t6;if($[20]!==getPlaceholder||$[21]!==keyboardType||$[22]!==value){t6=getNumberInputSegments({value,getPlaceholder,keyboardType});$[20]=getPlaceholder;$[21]=keyboardType;$[22]=value;$[23]=t6;}else{t6=$[23];}var segments=t6;var t7;if($[24]!==enterKeyHint||$[25]!==onSubmitEditing||$[26]!==returnKeyType||$[27]!==segments||$[28]!==submitBehavior){t7={segments,onSubmitEditing,finalReturnKeyType:returnKeyType,finalEnterKeyHint:enterKeyHint,finalSubmitBehavior:submitBehavior};$[24]=enterKeyHint;$[25]=onSubmitEditing;$[26]=returnKeyType;$[27]=segments;$[28]=submitBehavior;$[29]=t7;}else{t7=$[29];}var _useSegmentedInputNav=useSegmentedInputNavigation(t7),getSegmentInputProps=_useSegmentedInputNav.getSegmentInputProps,focusSegment=_useSegmentedInputNav.focusSegment,blurSegments=_useSegmentedInputNav.blurSegments;var t8;var t9;if($[30]!==blurSegments||$[31]!==disabled||$[32]!==focusSegment||$[33]!==onChange||$[34]!==readOnly||$[35]!==value.representation){t8=()=>({focus:()=>{if(!disabled){focusSegment("primary");}},blur:blurSegments,clear:()=>{if(disabled||readOnly||!onChange){return;}onChange(getClearedNumberInputValue(value.representation));}});t9=[blurSegments,disabled,focusSegment,onChange,readOnly,value.representation];$[30]=blurSegments;$[31]=disabled;$[32]=focusSegment;$[33]=onChange;$[34]=readOnly;$[35]=value.representation;$[36]=t8;$[37]=t9;}else{t8=$[36];t9=$[37];}useImperativeHandle(ref,t8,t9);var t10;if($[38]!==enabledRepresentations||$[39]!==onChange||$[40]!==value){t10=()=>{var nextMode=getNextMode(enabledRepresentations,value.representation);if(!nextMode){return;}var nextValue=getNextValue(nextMode,value);if(!nextValue){return;}onChange?.(nextValue);};$[38]=enabledRepresentations;$[39]=onChange;$[40]=value;$[41]=t10;}else{t10=$[41];}var handleChangeMode=t10;var t11=enabledRepresentations.length>1&&onChange?handleChangeMode:undefined;var t12;if($[42]!==icon||$[43]!==t11){t12=_jsx(FieldAction,{...icon,accessibilityLabel:"Switch number format",onPress:t11});$[42]=icon;$[43]=t11;$[44]=t12;}else{t12=$[44];}var t13;if($[45]!==value.representation){t13=segment=>`${value.representation}-${segment.key}`;$[45]=value.representation;$[46]=t13;}else{t13=$[46];}var t14;if($[47]!==getSegmentInputProps||$[48]!==maxLength||$[49]!==onChange||$[50]!==theme.
|
|
1
|
+
var _excluded=["keyboardType","enabledRepresentations","placeholder","maxLength","value","onChange","onSubmitEditing","returnKeyType","enterKeyHint","submitBehavior","ref","disabled","readOnly","theme"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useImperativeHandle}from"react";import{StyleSheet,View}from"react-native";import{useComponent}from"../../../internal";import{Text}from"../../../typography/text";import{Field,FieldAction,FieldNumberInput,FieldRow,FieldSurface}from"../../field";import{SegmentedInputSegments}from"../shared/SegmentedInputSegments";import{useSegmentedInputNavigation}from"../shared/useSegmentedInputNavigation";import{getClearedNumberInputValue,getNextMode,getNextValue,getNumberInputSegmentStepValue,getNumberInputSegments,updateNumberInputSegment}from"./helpers";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_ENABLED_REPRESENTATIONS=["number","fraction","range"];var DEFAULT_VALUE={representation:"number",value:""};export var NumberInput=t0=>{var $=_c(68);var disabled;var enterKeyHint;var fieldProps;var maxLength;var onChange;var onSubmitEditing;var placeholder;var readOnly;var ref;var returnKeyType;var submitBehavior;var t1;var t2;var t3;var themeOverrides;if($[0]!==t0){t1=t0.keyboardType;t2=t0.enabledRepresentations;placeholder=t0.placeholder;maxLength=t0.maxLength;t3=t0.value;onChange=t0.onChange;onSubmitEditing=t0.onSubmitEditing;returnKeyType=t0.returnKeyType;enterKeyHint=t0.enterKeyHint;submitBehavior=t0.submitBehavior;ref=t0.ref;disabled=t0.disabled;readOnly=t0.readOnly;themeOverrides=t0.theme;fieldProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=disabled;$[2]=enterKeyHint;$[3]=fieldProps;$[4]=maxLength;$[5]=onChange;$[6]=onSubmitEditing;$[7]=placeholder;$[8]=readOnly;$[9]=ref;$[10]=returnKeyType;$[11]=submitBehavior;$[12]=t1;$[13]=t2;$[14]=t3;$[15]=themeOverrides;}else{disabled=$[1];enterKeyHint=$[2];fieldProps=$[3];maxLength=$[4];onChange=$[5];onSubmitEditing=$[6];placeholder=$[7];readOnly=$[8];ref=$[9];returnKeyType=$[10];submitBehavior=$[11];t1=$[12];t2=$[13];t3=$[14];themeOverrides=$[15];}var keyboardType=t1===undefined?"number-pad":t1;var enabledRepresentations=t2===undefined?DEFAULT_ENABLED_REPRESENTATIONS:t2;var value=t3===undefined?DEFAULT_VALUE:t3;var t4;if($[16]!==themeOverrides){t4={themeOverrides};$[16]=themeOverrides;$[17]=t4;}else{t4=$[17];}var _useComponent=useComponent("numberInput",t4),icons=_useComponent.icons,theme=_useComponent.theme;var t5;if($[18]!==placeholder){t5=key=>placeholder?.[key]??placeholder?.value;$[18]=placeholder;$[19]=t5;}else{t5=$[19];}var getPlaceholder=t5;var icon=icons[value.representation];var t6;if($[20]!==getPlaceholder||$[21]!==keyboardType||$[22]!==value){t6=getNumberInputSegments({value,getPlaceholder,keyboardType});$[20]=getPlaceholder;$[21]=keyboardType;$[22]=value;$[23]=t6;}else{t6=$[23];}var segments=t6;var t7;if($[24]!==enterKeyHint||$[25]!==onSubmitEditing||$[26]!==returnKeyType||$[27]!==segments||$[28]!==submitBehavior){t7={segments,onSubmitEditing,finalReturnKeyType:returnKeyType,finalEnterKeyHint:enterKeyHint,finalSubmitBehavior:submitBehavior};$[24]=enterKeyHint;$[25]=onSubmitEditing;$[26]=returnKeyType;$[27]=segments;$[28]=submitBehavior;$[29]=t7;}else{t7=$[29];}var _useSegmentedInputNav=useSegmentedInputNavigation(t7),getSegmentInputProps=_useSegmentedInputNav.getSegmentInputProps,focusSegment=_useSegmentedInputNav.focusSegment,blurSegments=_useSegmentedInputNav.blurSegments;var t8;var t9;if($[30]!==blurSegments||$[31]!==disabled||$[32]!==focusSegment||$[33]!==onChange||$[34]!==readOnly||$[35]!==value.representation){t8=()=>({focus:()=>{if(!disabled){focusSegment("primary");}},blur:blurSegments,clear:()=>{if(disabled||readOnly||!onChange){return;}onChange(getClearedNumberInputValue(value.representation));}});t9=[blurSegments,disabled,focusSegment,onChange,readOnly,value.representation];$[30]=blurSegments;$[31]=disabled;$[32]=focusSegment;$[33]=onChange;$[34]=readOnly;$[35]=value.representation;$[36]=t8;$[37]=t9;}else{t8=$[36];t9=$[37];}useImperativeHandle(ref,t8,t9);var t10;if($[38]!==enabledRepresentations||$[39]!==onChange||$[40]!==value){t10=()=>{var nextMode=getNextMode(enabledRepresentations,value.representation);if(!nextMode){return;}var nextValue=getNextValue(nextMode,value);if(!nextValue){return;}onChange?.(nextValue);};$[38]=enabledRepresentations;$[39]=onChange;$[40]=value;$[41]=t10;}else{t10=$[41];}var handleChangeMode=t10;var t11=enabledRepresentations.length>1&&onChange?handleChangeMode:undefined;var t12;if($[42]!==icon||$[43]!==t11){t12=_jsx(FieldAction,{...icon,accessibilityLabel:"Switch number format",onPress:t11});$[42]=icon;$[43]=t11;$[44]=t12;}else{t12=$[44];}var t13;if($[45]!==value.representation){t13=segment=>`${value.representation}-${segment.key}`;$[45]=value.representation;$[46]=t13;}else{t13=$[46];}var t14;if($[47]!==getSegmentInputProps||$[48]!==maxLength||$[49]!==onChange||$[50]!==theme.input||$[51]!==value){t14=(segment_0,index)=>_jsxs(_Fragment,{children:[segment_0.separator&&_jsx(View,{style:styles.separator,children:_jsx(Text,{variant:"title",children:segment_0.separator})}),_jsx(FieldNumberInput,{...segment_0.inputProps,...getSegmentInputProps(segment_0.key),theme:theme.input,value:segment_0.value,maxLength:maxLength,style:[styles.input,value.representation!=="number"&&styles.centered],onStep:onChange?direction=>onChange(getNumberInputSegmentStepValue(value,index,direction)):undefined,onChangeText:text=>onChange?.(updateNumberInputSegment(value,index,text))})]});$[47]=getSegmentInputProps;$[48]=maxLength;$[49]=onChange;$[50]=theme.input;$[51]=value;$[52]=t14;}else{t14=$[52];}var t15;if($[53]!==segments||$[54]!==t13||$[55]!==t14){t15=_jsx(SegmentedInputSegments,{segments:segments,keyExtractor:t13,renderSegment:t14});$[53]=segments;$[54]=t13;$[55]=t14;$[56]=t15;}else{t15=$[56];}var t16;if($[57]!==t12||$[58]!==t15){t16=_jsxs(FieldRow,{children:[t12,t15]});$[57]=t12;$[58]=t15;$[59]=t16;}else{t16=$[59];}var t17;if($[60]!==t16||$[61]!==theme.surface){t17=_jsx(FieldSurface,{theme:theme.surface,children:t16});$[60]=t16;$[61]=theme.surface;$[62]=t17;}else{t17=$[62];}var t18;if($[63]!==disabled||$[64]!==fieldProps||$[65]!==readOnly||$[66]!==t17){t18=_jsx(Field,{disabled:disabled,readOnly:readOnly,...fieldProps,children:t17});$[63]=disabled;$[64]=fieldProps;$[65]=readOnly;$[66]=t17;$[67]=t18;}else{t18=$[67];}return t18;};var styles=StyleSheet.create({input:{flexGrow:1,flexBasis:0},centered:{textAlign:"center"},separator:{justifyContent:"center"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultNumberInputTheme=({theme})=>({surface:{...theme.field.surface,padding:0},
|
|
1
|
+
export var defaultNumberInputTheme=({theme})=>({surface:{...theme.field.surface,padding:0},input:theme.field.text});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{View}from"react-native";import{Tag}from"../../../display/tag";import{defineStyles,useComponent}from"../../../internal";import{Text}from"../../../typography/text";import{FieldIcon,FieldRow,FieldSurface,useFieldControlState}from"../../field";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var SelectionControl=t0=>{var $=_c(37);var placeholder=t0.placeholder,selectionMode=t0.selectionMode,selection=t0.selection,themeOverrides=t0.themeOverrides,onAdd=t0.onAdd,onRemoveItem=t0.onRemoveItem;var _useFieldControlState=useFieldControlState(),interactive=_useFieldControlState.interactive;var t1;if($[0]!==themeOverrides){t1={themeOverrides,createStyles};$[0]=themeOverrides;$[1]=t1;}else{t1=$[1];}var _useComponent=useComponent("selectionInput",t1),icons=_useComponent.icons,styles=_useComponent.styles,theme=_useComponent.theme;var _useComponent2=useComponent("field"),fieldTheme=_useComponent2.theme;var canAdd=interactive&&!!onAdd;var canRemove=interactive&&!!onRemoveItem;var hasSelection=Array.isArray(selection)?selection.length>0:!!selection;var t2=canAdd?onAdd:undefined;var t3;if($[2]!==fieldTheme.surface.padding){t3={paddingStart:fieldTheme.surface.padding,paddingVertical:fieldTheme.surface.padding};$[2]=fieldTheme.surface.padding;$[3]=t3;}else{t3=$[3];}var t4;if($[4]!==styles.selectionContainer||$[5]!==t3){t4=[styles.selectionContainer,t3];$[4]=styles.selectionContainer;$[5]=t3;$[6]=t4;}else{t4=$[6];}var t5;if($[7]!==fieldTheme.text||$[8]!==selection||$[9]!==selectionMode||$[10]!==styles.
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{View}from"react-native";import{Tag}from"../../../display/tag";import{defineStyles,useComponent}from"../../../internal";import{Text}from"../../../typography/text";import{FieldIcon,FieldRow,FieldSurface,useFieldControlState}from"../../field";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var SelectionControl=t0=>{var $=_c(37);var placeholder=t0.placeholder,selectionMode=t0.selectionMode,selection=t0.selection,themeOverrides=t0.themeOverrides,onAdd=t0.onAdd,onRemoveItem=t0.onRemoveItem;var _useFieldControlState=useFieldControlState(),interactive=_useFieldControlState.interactive;var t1;if($[0]!==themeOverrides){t1={themeOverrides,createStyles};$[0]=themeOverrides;$[1]=t1;}else{t1=$[1];}var _useComponent=useComponent("selectionInput",t1),icons=_useComponent.icons,styles=_useComponent.styles,theme=_useComponent.theme;var _useComponent2=useComponent("field"),fieldTheme=_useComponent2.theme;var canAdd=interactive&&!!onAdd;var canRemove=interactive&&!!onRemoveItem;var hasSelection=Array.isArray(selection)?selection.length>0:!!selection;var t2=canAdd?onAdd:undefined;var t3;if($[2]!==fieldTheme.surface.padding){t3={paddingStart:fieldTheme.surface.padding,paddingVertical:fieldTheme.surface.padding};$[2]=fieldTheme.surface.padding;$[3]=t3;}else{t3=$[3];}var t4;if($[4]!==styles.selectionContainer||$[5]!==t3){t4=[styles.selectionContainer,t3];$[4]=styles.selectionContainer;$[5]=t3;$[6]=t4;}else{t4=$[6];}var t5;if($[7]!==fieldTheme.text||$[8]!==selection||$[9]!==selectionMode||$[10]!==styles.valueLabel){t5=selectionMode==="single"&&!!selection&&!Array.isArray(selection)&&_jsx(View,{style:styles.valueLabel,children:_jsx(Text,{numberOfLines:1,ellipsizeMode:"tail",theme:{color:fieldTheme.text.color},children:selection.label})});$[7]=fieldTheme.text;$[8]=selection;$[9]=selectionMode;$[10]=styles.valueLabel;$[11]=t5;}else{t5=$[11];}var t6;if($[12]!==canRemove||$[13]!==onRemoveItem||$[14]!==selection||$[15]!==selectionMode){t6=selectionMode==="multi"&&Array.isArray(selection)&&selection.map(item=>_jsx(Tag,{label:item.label,onPress:canRemove&&onRemoveItem?()=>onRemoveItem(item):undefined},"id"in item?item.id:item.value));$[12]=canRemove;$[13]=onRemoveItem;$[14]=selection;$[15]=selectionMode;$[16]=t6;}else{t6=$[16];}var t7;if($[17]!==fieldTheme.text||$[18]!==hasSelection||$[19]!==placeholder||$[20]!==styles.valueLabel){t7=!hasSelection&&_jsx(View,{style:styles.valueLabel,children:_jsx(Text,{numberOfLines:1,ellipsizeMode:"tail",theme:{color:fieldTheme.text.placeholderColor},children:placeholder})});$[17]=fieldTheme.text;$[18]=hasSelection;$[19]=placeholder;$[20]=styles.valueLabel;$[21]=t7;}else{t7=$[21];}var t8;if($[22]!==t4||$[23]!==t5||$[24]!==t6||$[25]!==t7){t8=_jsxs(View,{style:t4,children:[t5,t6,t7]});$[22]=t4;$[23]=t5;$[24]=t6;$[25]=t7;$[26]=t8;}else{t8=$[26];}var t9;if($[27]!==icons.showOptions){t9=_jsx(FieldIcon,{...icons.showOptions});$[27]=icons.showOptions;$[28]=t9;}else{t9=$[28];}var t10;if($[29]!==styles.boxNone||$[30]!==t8||$[31]!==t9){t10=_jsxs(FieldRow,{style:styles.boxNone,children:[t8,t9]});$[29]=styles.boxNone;$[30]=t8;$[31]=t9;$[32]=t10;}else{t10=$[32];}var t11;if($[33]!==t10||$[34]!==t2||$[35]!==theme.surface){t11=_jsx(FieldSurface,{onPress:t2,theme:theme.surface,children:t10});$[33]=t10;$[34]=t2;$[35]=theme.surface;$[36]=t11;}else{t11=$[36];}return t11;};var createStyles=defineStyles(theme=>({selectionContainer:{flex:1,minWidth:0,flexDirection:"row",flexWrap:"wrap",alignItems:"center",alignContent:"center",gap:theme.selectionContainer.gap,pointerEvents:"box-none"},boxNone:{pointerEvents:"box-none"},valueLabel:{pointerEvents:"none",flexShrink:1,minWidth:0,width:"100%",maxWidth:"100%"}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _excluded=["placeholder","value","onChange","onSubmitEditing","returnKeyType","enterKeyHint","submitBehavior","disabled","readOnly","ref","theme"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useImperativeHandle}from"react";import{Pressable}from"react-native";import{defineStyles,useComponent}from"../../../internal";import{Text}from"../../../typography/text";import{Field,FieldIcon,FieldNumberInput,FieldRow,FieldSurface}from"../../field";import{SegmentedInputSegments}from"../shared/SegmentedInputSegments";import{useSegmentedInputNavigation}from"../shared/useSegmentedInputNavigation";import{DEFAULT_TIME_VALUE,getTimeInputSegments,TIME_SEGMENT_MAX_LENGTH}from"./helpers";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";export var TimeInput=t0=>{var $=_c(64);var disabled;var enterKeyHint;var fieldProps;var onChange;var onSubmitEditing;var placeholder;var readOnly;var ref;var returnKeyType;var submitBehavior;var t1;var themeOverrides;if($[0]!==t0){placeholder=t0.placeholder;t1=t0.value;onChange=t0.onChange;onSubmitEditing=t0.onSubmitEditing;returnKeyType=t0.returnKeyType;enterKeyHint=t0.enterKeyHint;submitBehavior=t0.submitBehavior;disabled=t0.disabled;readOnly=t0.readOnly;ref=t0.ref;themeOverrides=t0.theme;fieldProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=disabled;$[2]=enterKeyHint;$[3]=fieldProps;$[4]=onChange;$[5]=onSubmitEditing;$[6]=placeholder;$[7]=readOnly;$[8]=ref;$[9]=returnKeyType;$[10]=submitBehavior;$[11]=t1;$[12]=themeOverrides;}else{disabled=$[1];enterKeyHint=$[2];fieldProps=$[3];onChange=$[4];onSubmitEditing=$[5];placeholder=$[6];readOnly=$[7];ref=$[8];returnKeyType=$[9];submitBehavior=$[10];t1=$[11];themeOverrides=$[12];}var value=t1===undefined?DEFAULT_TIME_VALUE:t1;var t2;if($[13]!==themeOverrides){t2={themeOverrides,createStyles};$[13]=themeOverrides;$[14]=t2;}else{t2=$[14];}var _useComponent=useComponent("timeInput",t2),icons=_useComponent.icons,styles=_useComponent.styles,theme=_useComponent.theme;var _useComponent2=useComponent("field"),fieldTheme=_useComponent2.theme;var t3;if($[15]!==onChange||$[16]!==placeholder||$[17]!==value){t3=getTimeInputSegments({value,placeholder,onChange});$[15]=onChange;$[16]=placeholder;$[17]=value;$[18]=t3;}else{t3=$[18];}var segments=t3;var t4;if($[19]!==enterKeyHint||$[20]!==onSubmitEditing||$[21]!==returnKeyType||$[22]!==segments||$[23]!==submitBehavior){t4={segments,onSubmitEditing,finalReturnKeyType:returnKeyType,finalEnterKeyHint:enterKeyHint,finalSubmitBehavior:submitBehavior};$[19]=enterKeyHint;$[20]=onSubmitEditing;$[21]=returnKeyType;$[22]=segments;$[23]=submitBehavior;$[24]=t4;}else{t4=$[24];}var _useSegmentedInputNav=useSegmentedInputNavigation(t4),getSegmentInputProps=_useSegmentedInputNav.getSegmentInputProps,focusSegment=_useSegmentedInputNav.focusSegment,blurSegments=_useSegmentedInputNav.blurSegments;var t5;var t6;if($[25]!==blurSegments||$[26]!==disabled||$[27]!==focusSegment||$[28]!==onChange||$[29]!==readOnly){t5=()=>({focus:()=>{if(!disabled){focusSegment("hours");}},blur:blurSegments,clear:()=>{if(disabled||readOnly||!onChange){return;}onChange(DEFAULT_TIME_VALUE);}});t6=[blurSegments,disabled,focusSegment,onChange,readOnly];$[25]=blurSegments;$[26]=disabled;$[27]=focusSegment;$[28]=onChange;$[29]=readOnly;$[30]=t5;$[31]=t6;}else{t5=$[30];t6=$[31];}useImperativeHandle(ref,t5,t6);var t7=disabled||readOnly;var t8;if($[32]!==focusSegment){t8=()=>focusSegment("hours");$[32]=focusSegment;$[33]=t8;}else{t8=$[33];}var t9;if($[34]!==icons.time){t9=_jsx(FieldIcon,{...icons.time});$[34]=icons.time;$[35]=t9;}else{t9=$[35];}var t10;if($[36]!==t7||$[37]!==t8||$[38]!==t9){t10=_jsx(Pressable,{accessible:false,focusable:false,disabled:t7,"aria-hidden":true,tabIndex:-1,onPress:t8,children:t9});$[36]=t7;$[37]=t8;$[38]=t9;$[39]=t10;}else{t10=$[39];}var t11;if($[40]!==fieldTheme.surface.padding){t11={paddingRight:fieldTheme.surface.padding};$[40]=fieldTheme.surface.padding;$[41]=t11;}else{t11=$[41];}var t12;if($[42]!==disabled||$[43]!==focusSegment||$[44]!==getSegmentInputProps||$[45]!==styles.input||$[46]!==styles.unitLabel||$[47]!==theme.
|
|
1
|
+
var _excluded=["placeholder","value","onChange","onSubmitEditing","returnKeyType","enterKeyHint","submitBehavior","disabled","readOnly","ref","theme"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{useImperativeHandle}from"react";import{Pressable}from"react-native";import{defineStyles,useComponent}from"../../../internal";import{Text}from"../../../typography/text";import{Field,FieldIcon,FieldNumberInput,FieldRow,FieldSurface}from"../../field";import{SegmentedInputSegments}from"../shared/SegmentedInputSegments";import{useSegmentedInputNavigation}from"../shared/useSegmentedInputNavigation";import{DEFAULT_TIME_VALUE,getTimeInputSegments,TIME_SEGMENT_MAX_LENGTH}from"./helpers";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";export var TimeInput=t0=>{var $=_c(64);var disabled;var enterKeyHint;var fieldProps;var onChange;var onSubmitEditing;var placeholder;var readOnly;var ref;var returnKeyType;var submitBehavior;var t1;var themeOverrides;if($[0]!==t0){placeholder=t0.placeholder;t1=t0.value;onChange=t0.onChange;onSubmitEditing=t0.onSubmitEditing;returnKeyType=t0.returnKeyType;enterKeyHint=t0.enterKeyHint;submitBehavior=t0.submitBehavior;disabled=t0.disabled;readOnly=t0.readOnly;ref=t0.ref;themeOverrides=t0.theme;fieldProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=disabled;$[2]=enterKeyHint;$[3]=fieldProps;$[4]=onChange;$[5]=onSubmitEditing;$[6]=placeholder;$[7]=readOnly;$[8]=ref;$[9]=returnKeyType;$[10]=submitBehavior;$[11]=t1;$[12]=themeOverrides;}else{disabled=$[1];enterKeyHint=$[2];fieldProps=$[3];onChange=$[4];onSubmitEditing=$[5];placeholder=$[6];readOnly=$[7];ref=$[8];returnKeyType=$[9];submitBehavior=$[10];t1=$[11];themeOverrides=$[12];}var value=t1===undefined?DEFAULT_TIME_VALUE:t1;var t2;if($[13]!==themeOverrides){t2={themeOverrides,createStyles};$[13]=themeOverrides;$[14]=t2;}else{t2=$[14];}var _useComponent=useComponent("timeInput",t2),icons=_useComponent.icons,styles=_useComponent.styles,theme=_useComponent.theme;var _useComponent2=useComponent("field"),fieldTheme=_useComponent2.theme;var t3;if($[15]!==onChange||$[16]!==placeholder||$[17]!==value){t3=getTimeInputSegments({value,placeholder,onChange});$[15]=onChange;$[16]=placeholder;$[17]=value;$[18]=t3;}else{t3=$[18];}var segments=t3;var t4;if($[19]!==enterKeyHint||$[20]!==onSubmitEditing||$[21]!==returnKeyType||$[22]!==segments||$[23]!==submitBehavior){t4={segments,onSubmitEditing,finalReturnKeyType:returnKeyType,finalEnterKeyHint:enterKeyHint,finalSubmitBehavior:submitBehavior};$[19]=enterKeyHint;$[20]=onSubmitEditing;$[21]=returnKeyType;$[22]=segments;$[23]=submitBehavior;$[24]=t4;}else{t4=$[24];}var _useSegmentedInputNav=useSegmentedInputNavigation(t4),getSegmentInputProps=_useSegmentedInputNav.getSegmentInputProps,focusSegment=_useSegmentedInputNav.focusSegment,blurSegments=_useSegmentedInputNav.blurSegments;var t5;var t6;if($[25]!==blurSegments||$[26]!==disabled||$[27]!==focusSegment||$[28]!==onChange||$[29]!==readOnly){t5=()=>({focus:()=>{if(!disabled){focusSegment("hours");}},blur:blurSegments,clear:()=>{if(disabled||readOnly||!onChange){return;}onChange(DEFAULT_TIME_VALUE);}});t6=[blurSegments,disabled,focusSegment,onChange,readOnly];$[25]=blurSegments;$[26]=disabled;$[27]=focusSegment;$[28]=onChange;$[29]=readOnly;$[30]=t5;$[31]=t6;}else{t5=$[30];t6=$[31];}useImperativeHandle(ref,t5,t6);var t7=disabled||readOnly;var t8;if($[32]!==focusSegment){t8=()=>focusSegment("hours");$[32]=focusSegment;$[33]=t8;}else{t8=$[33];}var t9;if($[34]!==icons.time){t9=_jsx(FieldIcon,{...icons.time});$[34]=icons.time;$[35]=t9;}else{t9=$[35];}var t10;if($[36]!==t7||$[37]!==t8||$[38]!==t9){t10=_jsx(Pressable,{accessible:false,focusable:false,disabled:t7,"aria-hidden":true,tabIndex:-1,onPress:t8,children:t9});$[36]=t7;$[37]=t8;$[38]=t9;$[39]=t10;}else{t10=$[39];}var t11;if($[40]!==fieldTheme.surface.padding){t11={paddingRight:fieldTheme.surface.padding};$[40]=fieldTheme.surface.padding;$[41]=t11;}else{t11=$[41];}var t12;if($[42]!==disabled||$[43]!==focusSegment||$[44]!==getSegmentInputProps||$[45]!==styles.input||$[46]!==styles.unitLabel||$[47]!==theme.input){t12=segment=>_jsxs(_Fragment,{children:[_jsx(FieldNumberInput,{...segment.inputProps,...getSegmentInputProps(segment.key),theme:theme.input,value:segment.value,style:styles.input,keyboardType:"number-pad",maxLength:TIME_SEGMENT_MAX_LENGTH}),segment.separator&&_jsx(Pressable,{accessible:false,focusable:false,disabled:disabled,onPress:()=>focusSegment(segment.key),style:styles.unitLabel,tabIndex:-1,children:_jsx(Text,{variant:"body",children:segment.separator})})]});$[42]=disabled;$[43]=focusSegment;$[44]=getSegmentInputProps;$[45]=styles.input;$[46]=styles.unitLabel;$[47]=theme.input;$[48]=t12;}else{t12=$[48];}var t13;if($[49]!==segments||$[50]!==t11||$[51]!==t12){t13=_jsx(SegmentedInputSegments,{segments:segments,style:t11,renderSegment:t12});$[49]=segments;$[50]=t11;$[51]=t12;$[52]=t13;}else{t13=$[52];}var t14;if($[53]!==t10||$[54]!==t13){t14=_jsxs(FieldRow,{children:[t10,t13]});$[53]=t10;$[54]=t13;$[55]=t14;}else{t14=$[55];}var t15;if($[56]!==t14||$[57]!==theme.surface){t15=_jsx(FieldSurface,{theme:theme.surface,children:t14});$[56]=t14;$[57]=theme.surface;$[58]=t15;}else{t15=$[58];}var t16;if($[59]!==disabled||$[60]!==fieldProps||$[61]!==readOnly||$[62]!==t15){t16=_jsx(Field,{disabled:disabled,readOnly:readOnly,...fieldProps,children:t15});$[59]=disabled;$[60]=fieldProps;$[61]=readOnly;$[62]=t15;$[63]=t16;}else{t16=$[63];}return t16;};var createStyles=defineStyles(theme=>({input:{flexGrow:1,flexBasis:0,textAlign:"right"},unitLabel:{justifyContent:"center",paddingStart:theme.unitLabel.paddingStart}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultTimeInputTheme=({palette,theme})=>({unitLabel:{paddingStart:palette.spacing.tiny},surface:{...theme.field.surface,padding:0},
|
|
1
|
+
export var defaultTimeInputTheme=({palette,theme})=>({unitLabel:{paddingStart:palette.spacing.tiny},surface:{...theme.field.surface,padding:0},input:theme.field.text});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultAnchoredContainerTheme=({palette:{spacing}})=>({parentMargin:spacing.
|
|
1
|
+
export var defaultAnchoredContainerTheme=({palette:{spacing}})=>({parentMargin:spacing.tiny});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}import{c as _c}from"react/compiler-runtime";import{useCallback,useEffect,useRef,useState}from"react";import{createPortal}from"react-dom";import{StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useComponent}from"../../internal";import{getContainerPlacement}from"./helpers";import{jsx as _jsx}from"react/jsx-runtime";var FIXED_POSITION="fixed";export var AnchoredContainer=t0=>{var $=_c(
|
|
1
|
+
function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}import{c as _c}from"react/compiler-runtime";import{useCallback,useEffect,useRef,useState}from"react";import{createPortal}from"react-dom";import{StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useComponent}from"../../internal";import{getContainerPlacement}from"./helpers";import{jsx as _jsx}from"react/jsx-runtime";var FIXED_POSITION="fixed";export var AnchoredContainer=t0=>{var $=_c(40);var parentRef=t0.parentRef,anchorRef=t0.anchorRef,show=t0.show,t1=t0.position,themeOverrides=t0.theme,onInvertedChange=t0.onInvertedChange,style=t0.style,children=t0.children;var position=t1===undefined?"auto":t1;var _useState=useState(),_useState2=_slicedToArray(_useState,2),geometry=_useState2[0],setGeometry=_useState2[1];var t2;if($[0]!==themeOverrides){t2={themeOverrides};$[0]=themeOverrides;$[1]=t2;}else{t2=$[1];}var _useComponent=useComponent("anchoredContainer",t2),theme=_useComponent.theme;var inverted=geometry?.inverted;var t3;var t4;if($[2]!==inverted||$[3]!==onInvertedChange){t3=()=>{if(inverted!==undefined){onInvertedChange?.(inverted);}};t4=[inverted,onInvertedChange];$[2]=inverted;$[3]=onInvertedChange;$[4]=t3;$[5]=t4;}else{t3=$[4];t4=$[5];}useEffect(t3,t4);var _useWindowDimensions=useWindowDimensions(),windowHeight=_useWindowDimensions.height;var _useSafeAreaInsets=useSafeAreaInsets(),top=_useSafeAreaInsets.top,bottom=_useSafeAreaInsets.bottom;var anchorRectRef=useRef(undefined);var contentHeightRef=useRef(0);var t5;if($[6]!==bottom||$[7]!==position||$[8]!==theme.parentMargin||$[9]!==top||$[10]!==windowHeight){t5=()=>{var anchor=anchorRectRef.current;var contentHeight=contentHeightRef.current;if(!(anchor&&contentHeight)){return;}var viewportTop=top;var viewportBottom=windowHeight-bottom;var availableBelow=viewportBottom-(anchor.y+anchor.height);var availableAbove=anchor.y-viewportTop;var inverted_0=position==="above"||availableBelow<contentHeight+theme.parentMargin&&availableAbove>availableBelow;setGeometry({parentY:anchor.y,parentX:anchor.x,parentWidth:anchor.width,parentHeight:anchor.height,offsetY:anchor.y,contentHeight,inverted:inverted_0,visibleAreaHeight:viewportBottom-viewportTop,maxHeight:Math.max(0,(inverted_0?availableAbove:availableBelow)-theme.parentMargin)});};$[6]=bottom;$[7]=position;$[8]=theme.parentMargin;$[9]=top;$[10]=windowHeight;$[11]=t5;}else{t5=$[11];}var recompute=t5;var t6;if($[12]!==anchorRef||$[13]!==parentRef||$[14]!==recompute){t6=()=>{var anchorElement=anchorRef?.current;var parentElement=parentRef.current;var element=anchorElement??parentElement;if(element?.getBoundingClientRect){var rect=element.getBoundingClientRect();anchorRectRef.current={x:rect.left,y:rect.top,width:rect.width,height:rect.height};}recompute();};$[12]=anchorRef;$[13]=parentRef;$[14]=recompute;$[15]=t6;}else{t6=$[15];}var updateAnchor=t6;var t7;var t8;if($[16]!==anchorRef||$[17]!==parentRef||$[18]!==show||$[19]!==updateAnchor){t7=()=>{if(!show||typeof document==="undefined"){return;}updateAnchor();var frame=0;var schedule=()=>{cancelAnimationFrame(frame);frame=requestAnimationFrame(updateAnchor);};window.addEventListener("scroll",schedule,true);window.addEventListener("resize",schedule);var node=anchorRef?.current??parentRef.current;var observer;if(node instanceof Element&&typeof ResizeObserver!=="undefined"){observer=new ResizeObserver(schedule);observer.observe(node);}return()=>{cancelAnimationFrame(frame);window.removeEventListener("scroll",schedule,true);window.removeEventListener("resize",schedule);observer?.disconnect();};};t8=[show,updateAnchor,anchorRef,parentRef];$[16]=anchorRef;$[17]=parentRef;$[18]=show;$[19]=updateAnchor;$[20]=t7;$[21]=t8;}else{t7=$[20];t8=$[21];}useEffect(t7,t8);var t10;var t9;if($[22]!==show){t9=()=>{if(!show){setGeometry(undefined);anchorRectRef.current=undefined;contentHeightRef.current=0;}};t10=[show];$[22]=show;$[23]=t10;$[24]=t9;}else{t10=$[23];t9=$[24];}useEffect(t9,t10);var t11;if($[25]!==recompute){t11=e=>{var height=e.nativeEvent.layout.height;if(height!==contentHeightRef.current){contentHeightRef.current=height;recompute();}};$[25]=recompute;$[26]=t11;}else{t11=$[26];}var onLayout=t11;if(!show||typeof document==="undefined"){return null;}var t12;if($[27]!==geometry||$[28]!==theme.parentMargin){t12=geometry?{left:geometry.parentX,width:geometry.parentWidth,top:geometry.inverted?geometry.parentY-geometry.contentHeight-theme.parentMargin:geometry.parentY+geometry.parentHeight+theme.parentMargin}:styles.hidden;$[27]=geometry;$[28]=theme.parentMargin;$[29]=t12;}else{t12=$[29];}var t13;if($[30]!==style||$[31]!==t12){t13=[styles.container,t12,style];$[30]=style;$[31]=t12;$[32]=t13;}else{t13=$[32];}var t14;if($[33]!==children||$[34]!==geometry){t14=typeof children==="function"?children(getContainerPlacement(geometry)):children;$[33]=children;$[34]=geometry;$[35]=t14;}else{t14=$[35];}var t15;if($[36]!==onLayout||$[37]!==t13||$[38]!==t14){t15=createPortal(_jsx(View,{onLayout:onLayout,style:t13,children:t14}),document.body);$[36]=onLayout;$[37]=t13;$[38]=t14;$[39]=t15;}else{t15=$[39];}return t15;};var styles=StyleSheet.create({container:{position:FIXED_POSITION,zIndex:9999},hidden:{position:FIXED_POSITION,zIndex:9999,opacity:0,pointerEvents:"none"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded=["data","renderItem","keyExtractor","activeIndex","reverse","onScroll","showsScrollIndicator","theme","scrollResetKey"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{FlatList,View}from"react-native";import{defineStyles,useComponent}from"../../internal";import{useSystems}from"../../theme/useSystems";import{ScrollViewContextResetter}from"./ScrollViewContextResetter";import{useMenuScroll}from"./useMenuScroll";import{VirtualizedListContextResetter}from"./VirtualizedListContextResetter";import{jsx as _jsx}from"react/jsx-runtime";export var Menu=t0=>{var $=_c(41);var activeIndex;var data;var keyExtractor;var listProps;var onScroll;var renderItem;var reverse;var scrollResetKey;var showsScrollIndicator;var themeOverrides;if($[0]!==t0){data=t0.data;renderItem=t0.renderItem;keyExtractor=t0.keyExtractor;activeIndex=t0.activeIndex;reverse=t0.reverse;onScroll=t0.onScroll;showsScrollIndicator=t0.showsScrollIndicator;themeOverrides=t0.theme;scrollResetKey=t0.scrollResetKey;listProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=activeIndex;$[2]=data;$[3]=keyExtractor;$[4]=listProps;$[5]=onScroll;$[6]=renderItem;$[7]=reverse;$[8]=scrollResetKey;$[9]=showsScrollIndicator;$[10]=themeOverrides;}else{activeIndex=$[1];data=$[2];keyExtractor=$[3];listProps=$[4];onScroll=$[5];renderItem=$[6];reverse=$[7];scrollResetKey=$[8];showsScrollIndicator=$[9];themeOverrides=$[10];}var t1;if($[11]!==themeOverrides){t1={themeOverrides,createStyles};$[11]=themeOverrides;$[12]=t1;}else{t1=$[12];}var _useComponent=useComponent("menu",t1),styles=_useComponent.styles,theme=_useComponent.theme;var _useSystems=useSystems(),shadowStyle=_useSystems.shadowStyle;var t2;if($[13]!==activeIndex||$[14]!==data||$[15]!==listProps.getItemLayout||$[16]!==listProps.onContentSizeChange||$[17]!==scrollResetKey||$[18]!==theme.gap){t2={data,activeIndex,scrollResetKey,getItemLayout:listProps.getItemLayout,onContentSizeChange:listProps.onContentSizeChange,gap:theme.gap};$[13]=activeIndex;$[14]=data;$[15]=listProps.getItemLayout;$[16]=listProps.onContentSizeChange;$[17]=scrollResetKey;$[18]=theme.gap;$[19]=t2;}else{t2=$[19];}var _useMenuScroll=useMenuScroll(t2),listRef=_useMenuScroll.listRef,isReady=_useMenuScroll.isReady,initialScrollIndex=_useMenuScroll.initialScrollIndex,onContentSizeChange=_useMenuScroll.onContentSizeChange,onScrollToIndexFailed=_useMenuScroll.onScrollToIndexFailed;var t3=!isReady&&styles.hidden;var t4;if($[20]!==shadowStyle||$[21]!==styles.shadow||$[22]!==t3){t4=[styles.shadow,shadowStyle,t3];$[20]=shadowStyle;$[21]=styles.shadow;$[22]=t3;$[23]=t4;}else{t4=$[23];}var t5;if($[24]!==data||$[25]!==initialScrollIndex||$[26]!==keyExtractor||$[27]!==listProps||$[28]!==listRef||$[29]!==onContentSizeChange||$[30]!==onScroll||$[31]!==onScrollToIndexFailed||$[32]!==renderItem||$[33]!==reverse||$[34]!==showsScrollIndicator||$[35]!==styles.container||$[36]!==styles.content){t5=_jsx(FlatList,{...listProps,ref:listRef,data:data,renderItem:renderItem,keyExtractor:keyExtractor,inverted:reverse,initialScrollIndex:initialScrollIndex,onScroll:onScroll,onContentSizeChange:onContentSizeChange,onScrollToIndexFailed:onScrollToIndexFailed,scrollEventThrottle:16,keyboardShouldPersistTaps:"always",keyboardDismissMode:"none",showsVerticalScrollIndicator:showsScrollIndicator,style:styles.container,contentContainerStyle:styles.content});$[24]=data;$[25]=initialScrollIndex;$[26]=keyExtractor;$[27]=listProps;$[28]=listRef;$[29]=onContentSizeChange;$[30]=onScroll;$[31]=onScrollToIndexFailed;$[32]=renderItem;$[33]=reverse;$[34]=showsScrollIndicator;$[35]=styles.container;$[36]=styles.content;$[37]=t5;}else{t5=$[37];}var t6;if($[38]!==t4||$[39]!==t5){t6=_jsx(VirtualizedListContextResetter,{children:_jsx(ScrollViewContextResetter,{children:_jsx(View,{style:t4,children:t5})})});$[38]=t4;$[39]=t5;$[40]=t6;}else{t6=$[40];}return t6;};var createStyles=defineStyles(theme=>({shadow:{backgroundColor:theme.backgroundColor,borderRadius:theme.borderRadius},container:{backgroundColor:theme.backgroundColor,borderRadius:theme.borderRadius,overflow:"hidden",pointerEvents:"auto",maxHeight:theme.maxHeight},content:{padding:theme.padding,gap:theme.gap},hidden:{opacity:0,pointerEvents:"none"}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{InteractionSurface}from"../../actions/surface";import{defineStyles,useComponent}from"../../internal";import{HighlightedText}from"../../typography/text";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var MenuItem=t0=>{var $=_c(
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{InteractionSurface}from"../../actions/surface";import{defineStyles,useComponent}from"../../internal";import{HighlightedText}from"../../typography/text";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var MenuItem=t0=>{var $=_c(26);var label=t0.label,description=t0.description,searchValue=t0.searchValue,highlighted=t0.highlighted,truncate=t0.truncate,height=t0.height,onPress=t0.onPress,themeOverrides=t0.theme;var t1;if($[0]!==height){t1={height};$[0]=height;$[1]=t1;}else{t1=$[1];}var t2;if($[2]!==t1||$[3]!==themeOverrides){t2={themeOverrides,props:t1,createStyles};$[2]=t1;$[3]=themeOverrides;$[4]=t2;}else{t2=$[4];}var _useComponent=useComponent("menuItem",t2),styles=_useComponent.styles,theme=_useComponent.theme;var t3=truncate?1:undefined;var t4=truncate?"tail":undefined;var t5;if($[5]!==theme.lineHeight.label){t5={lineHeight:theme.lineHeight.label};$[5]=theme.lineHeight.label;$[6]=t5;}else{t5=$[6];}var t6;if($[7]!==label||$[8]!==searchValue||$[9]!==t3||$[10]!==t4||$[11]!==t5||$[12]!==theme.label){t6=_jsx(HighlightedText,{text:label,highlight:searchValue,numberOfLines:t3,ellipsizeMode:t4,style:t5,theme:theme.label});$[7]=label;$[8]=searchValue;$[9]=t3;$[10]=t4;$[11]=t5;$[12]=theme.label;$[13]=t6;}else{t6=$[13];}var t7;if($[14]!==description||$[15]!==searchValue||$[16]!==theme.description||$[17]!==theme.lineHeight.description||$[18]!==truncate){t7=!!description&&_jsx(HighlightedText,{variant:"caption",text:description,highlight:searchValue,numberOfLines:truncate?1:undefined,ellipsizeMode:truncate?"tail":undefined,style:{lineHeight:theme.lineHeight.description},theme:theme.description});$[14]=description;$[15]=searchValue;$[16]=theme.description;$[17]=theme.lineHeight.description;$[18]=truncate;$[19]=t7;}else{t7=$[19];}var t8;if($[20]!==highlighted||$[21]!==onPress||$[22]!==styles.menuItem||$[23]!==t6||$[24]!==t7){t8=_jsxs(InteractionSurface,{hitSlop:0,highlighted:highlighted,onPress:onPress,style:styles.menuItem,children:[t6,t7]});$[20]=highlighted;$[21]=onPress;$[22]=styles.menuItem;$[23]=t6;$[24]=t7;$[25]=t8;}else{t8=$[25];}return t8;};MenuItem.displayName="MenuItem";var createStyles=defineStyles((theme,props)=>({menuItem:{alignSelf:"stretch",minWidth:0,paddingHorizontal:theme.paddingHorizontal,paddingVertical:theme.paddingVertical,borderRadius:theme.borderRadius,height:props.height}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultMenuItemTheme=({palette,theme})=>
|
|
1
|
+
export var defaultMenuItemTheme=({palette,theme})=>{var textTheme={...theme.highlightedText,text:{...theme.highlightedText.text,color:theme.menu.textColor}};return{paddingHorizontal:theme.field.surface.padding-theme.menu.padding,paddingVertical:palette.spacing.small+palette.spacing.tiny,borderRadius:palette.border.radius.tight,lineHeight:{label:Math.ceil(textTheme.text.font.body.size*palette.font.lineHeightScale),description:Math.ceil(textTheme.text.font.caption.size*palette.font.lineHeightScale)},label:textTheme,description:textTheme};};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}import{c as _c}from"react/compiler-runtime";import{useCallback,useEffect,useRef,useState}from"react";var VIEW_POSITION=0.33;export var useMenuScroll=t0=>{var $=_c(34);var data=t0.data,activeIndex=t0.activeIndex,scrollResetKey=t0.scrollResetKey,getItemLayout=t0.getItemLayout,onContentSizeChange=t0.onContentSizeChange,gap=t0.gap;var listRef=useRef(null);var hasActiveIndex=activeIndex!==undefined&&activeIndex>=0&&activeIndex<data.length;var hasItemLayout=getItemLayout!==undefined;var t1;if($[0]!==activeIndex||$[1]!==data||$[2]!==getItemLayout||$[3]!==hasActiveIndex){t1=hasActiveIndex?getItemLayout?.(data,activeIndex)?.length:undefined;$[0]=activeIndex;$[1]=data;$[2]=getItemLayout;$[3]=hasActiveIndex;$[4]=t1;}else{t1=$[4];}var activeItemLength=t1;var _useState=useState(!hasActiveIndex||activeIndex===0),_useState2=_slicedToArray(_useState,2),isReady=_useState2[0],setIsReady=_useState2[1];var hasPositionedRef=useRef(false);var scrollResetKeyRef=useRef(scrollResetKey);var t2;if($[5]!==activeIndex||$[6]!==hasActiveIndex||$[7]!==hasItemLayout){t2=()=>hasItemLayout&&hasActiveIndex&&activeIndex>0?activeIndex-1:undefined;$[5]=activeIndex;$[6]=hasActiveIndex;$[7]=hasItemLayout;$[8]=t2;}else{t2=$[8];}var _useState3=useState(t2),_useState4=_slicedToArray(_useState3,1),initialScrollIndex=_useState4[0];var t3;if($[9]!==activeIndex||$[10]!==activeItemLength||$[11]!==gap||$[12]!==hasActiveIndex){t3=animated=>{if(!hasActiveIndex){return;}listRef.current?.scrollToIndex({index:activeIndex,animated,...(activeItemLength===undefined?{viewPosition:VIEW_POSITION}:{viewPosition:0,viewOffset:activeItemLength+gap})});};$[9]=activeIndex;$[10]=activeItemLength;$[11]=gap;$[12]=hasActiveIndex;$[13]=t3;}else{t3=$[13];}var scrollToActive=t3;var t4;if($[14]!==scrollResetKey||$[15]!==scrollToActive){t4=()=>{hasPositionedRef.current=true;scrollResetKeyRef.current=scrollResetKey;scrollToActive(false);};$[14]=scrollResetKey;$[15]=scrollToActive;$[16]=t4;}else{t4=$[16];}var positionFirst=t4;var t5;var t6;if($[17]!==hasActiveIndex||$[18]!==hasItemLayout||$[19]!==positionFirst||$[20]!==scrollResetKey||$[21]!==scrollToActive){t5=()=>{if(!hasActiveIndex){return;}var isFirstPosition=!hasPositionedRef.current;if(isFirstPosition&&!hasItemLayout){return;}if(isFirstPosition){positionFirst();}else{var isReset=scrollResetKeyRef.current!==scrollResetKey;scrollResetKeyRef.current=scrollResetKey;scrollToActive(!isReset);}setIsReady(true);};t6=[hasActiveIndex,hasItemLayout,scrollResetKey,positionFirst,scrollToActive];$[17]=hasActiveIndex;$[18]=hasItemLayout;$[19]=positionFirst;$[20]=scrollResetKey;$[21]=scrollToActive;$[22]=t5;$[23]=t6;}else{t5=$[22];t6=$[23];}useEffect(t5,t6);var t7;if($[24]!==onContentSizeChange||$[25]!==positionFirst){t7=(width,height)=>{if(!hasPositionedRef.current){positionFirst();requestAnimationFrame(()=>setIsReady(true));}onContentSizeChange?.(width,height);};$[24]=onContentSizeChange;$[25]=positionFirst;$[26]=t7;}else{t7=$[26];}var handleContentSizeChange=t7;var t8;if($[27]!==activeIndex){t8=t9=>{var index=t9.index,averageItemLength=t9.averageItemLength;if(index!==activeIndex){return;}listRef.current?.scrollToOffset({offset:averageItemLength>0?averageItemLength*index:0,animated:false});};$[27]=activeIndex;$[28]=t8;}else{t8=$[28];}var handleScrollToIndexFailed=t8;var t9;if($[29]!==handleContentSizeChange||$[30]!==handleScrollToIndexFailed||$[31]!==initialScrollIndex||$[32]!==isReady){t9={listRef,isReady,initialScrollIndex,onContentSizeChange:handleContentSizeChange,onScrollToIndexFailed:handleScrollToIndexFailed};$[29]=handleContentSizeChange;$[30]=handleScrollToIndexFailed;$[31]=initialScrollIndex;$[32]=isReady;$[33]=t9;}else{t9=$[33];}return t9;};
|
package/lib/theme/palette.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Platform,StyleSheet}from"react-native";import{lightColorScheme}from"./colors";import{mergeTheme}from"./mergeTheme";export var defaultPalette={font:{family:{sans:Platform.select({ios:"System",android:"sans-serif",default:"system-ui"})??"system-ui",mono:Platform.select({ios:"Menlo",android:"monospace",default:"monospace"})??"monospace"},size:{tiny:10,small:12,regular:14,large:16,xLarge:20,xxLarge:28}},color:lightColorScheme,spacing:{large:24,medium:16,small:8,tiny:4},border:{radius:{tight:4,regular:8,loose:16},width:{thick:2,regular:1,thin:StyleSheet.hairlineWidth}}};export var createPalette=overrides=>mergeTheme(defaultPalette,overrides);
|
|
1
|
+
import{Platform,StyleSheet}from"react-native";import{lightColorScheme}from"./colors";import{mergeTheme}from"./mergeTheme";export var defaultPalette={font:{family:{sans:Platform.select({ios:"System",android:"sans-serif",default:"system-ui"})??"system-ui",mono:Platform.select({ios:"Menlo",android:"monospace",default:"monospace"})??"monospace"},lineHeightScale:1.2,size:{tiny:10,small:12,regular:14,large:16,xLarge:20,xxLarge:28}},color:lightColorScheme,spacing:{large:24,medium:16,small:8,tiny:4},border:{radius:{tight:4,regular:8,loose:16},width:{thick:2,regular:1,thin:StyleSheet.hairlineWidth}}};export var createPalette=overrides=>mergeTheme(defaultPalette,overrides);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Button, type ButtonAppearance, type ButtonProps } from "./Button";
|
|
2
2
|
export { ButtonBase, type ButtonBaseProps } from "./ButtonBase";
|
|
3
|
-
export { IconButton, type IconButtonProps } from "./IconButton";
|
|
3
|
+
export { IconButton, type IconButtonProps, type IconButtonTheme, } from "./IconButton";
|
|
4
4
|
export { IconButtonBase, type IconButtonBaseProps } from "./IconButtonBase";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/actions/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/actions/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EACH,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,eAAe,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ActionBaseProps, ActionProps, IconActionBaseProps, IconActionProps, } from "./action";
|
|
2
2
|
export { Action, ActionBase, IconAction, IconActionBase } from "./action";
|
|
3
|
-
export type { ButtonAppearance, ButtonBaseProps, ButtonProps, IconButtonBaseProps, IconButtonProps, } from "./button";
|
|
3
|
+
export type { ButtonAppearance, ButtonBaseProps, ButtonProps, IconButtonBaseProps, IconButtonProps, IconButtonTheme, } from "./button";
|
|
4
4
|
export { Button, ButtonBase, IconButton, IconButtonBase } from "./button";
|
|
5
|
-
export { SwipeAction, type SwipeActionProps } from "./swipeAction";
|
|
5
|
+
export { SwipeAction, type SwipeActionProps, type SwipeActionTheme, } from "./swipeAction";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,eAAe,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1E,YAAY,EACR,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,eAAe,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,eAAe,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1E,YAAY,EACR,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,eAAe,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EACH,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACxB,MAAM,eAAe,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import type { DeepPartial } from "@reillymc/es-utils";
|
|
1
2
|
import type { IconComponentProps } from "../../icons/IconComponentProps";
|
|
2
|
-
import { type IconButtonProps } from "../button";
|
|
3
|
+
import { type IconButtonProps, type IconButtonTheme } from "../button";
|
|
3
4
|
export type SwipeActionTheme = {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
container: {
|
|
6
|
+
width: number;
|
|
7
|
+
borderRadius: number;
|
|
8
|
+
};
|
|
9
|
+
button: IconButtonTheme;
|
|
6
10
|
};
|
|
7
11
|
export interface SwipeActionProps extends Pick<IconButtonProps, "onPress" | "variant"> {
|
|
12
|
+
theme?: DeepPartial<SwipeActionTheme>;
|
|
8
13
|
}
|
|
9
|
-
export declare const SwipeAction: <G extends string>(props: SwipeActionProps & IconComponentProps<G>) => import("react").JSX.Element;
|
|
14
|
+
export declare const SwipeAction: <G extends string>({ theme: themeOverrides, ...props }: SwipeActionProps & IconComponentProps<G>) => import("react").JSX.Element;
|
|
10
15
|
//# sourceMappingURL=SwipeAction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeAction.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,
|
|
1
|
+
{"version":3,"file":"SwipeAction.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAEH,KAAK,eAAe,EACpB,KAAK,eAAe,EACvB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,gBAAgB,GAAG;IAC3B,SAAS,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,MAAM,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,gBACb,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,CAAC;IACpD,KAAK,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,EAAE,qCAG3C,gBAAgB,GAAG,kBAAkB,CAAC,CAAC,CAAC,gCAc1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeAction.theme.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"SwipeAction.theme.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,aAAa,CAS9D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SwipeAction, type SwipeActionProps } from "./SwipeAction";
|
|
1
|
+
export { SwipeAction, type SwipeActionProps, type SwipeActionTheme, } from "./SwipeAction";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACxB,MAAM,eAAe,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ThemeFactory } from "../../theme/theme";
|
|
2
|
-
import type { FieldTextInputTheme } from "../field";
|
|
2
|
+
import type { FieldTextInputTheme, FieldTheme } from "../field";
|
|
3
3
|
export type TextInputTheme = {
|
|
4
|
-
|
|
4
|
+
surface: FieldTheme["surface"];
|
|
5
|
+
input: FieldTextInputTheme;
|
|
5
6
|
};
|
|
6
7
|
export declare const defaultTextInputTheme: ThemeFactory<"textInput">;
|
|
7
8
|
//# sourceMappingURL=TextInput.theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.theme.d.ts","sourceRoot":"","sources":["../../../../src/forms/input/TextInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TextInput.theme.d.ts","sourceRoot":"","sources":["../../../../src/forms/input/TextInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,KAAK,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAK1D,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { AnchoredContainerTheme } from "../../../overlays/anchoredContainer/AnchoredContainer";
|
|
1
2
|
import type { MenuTheme } from "../../../overlays/menu/Menu";
|
|
3
|
+
import type { MenuItemTheme } from "../../../overlays/menu/MenuItem";
|
|
2
4
|
import type { ThemeFactory } from "../../../theme/theme";
|
|
3
5
|
import type { FieldTextInputTheme, FieldTheme } from "../../field";
|
|
4
6
|
export interface ComboboxInputTheme {
|
|
5
|
-
|
|
7
|
+
panel: AnchoredContainerTheme;
|
|
6
8
|
surface: FieldTheme["surface"];
|
|
7
|
-
|
|
9
|
+
input: FieldTextInputTheme;
|
|
8
10
|
menu: MenuTheme;
|
|
11
|
+
option: MenuItemTheme;
|
|
9
12
|
}
|
|
10
13
|
export declare const defaultComboboxInputTheme: ThemeFactory<"comboboxInput">;
|
|
11
14
|
//# sourceMappingURL=ComboboxInput.theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/comboboxInput/ComboboxInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IAC/B,
|
|
1
|
+
{"version":3,"file":"ComboboxInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/comboboxInput/ComboboxInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,eAAe,CAQlE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Ref } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type TextInput as DefaultTextInput, type View } from "react-native";
|
|
3
3
|
import type { AnimatedRef } from "react-native-reanimated";
|
|
4
4
|
import type { DeepPartial } from "@reillymc/es-utils";
|
|
5
5
|
import { type AnchoredContainerProps } from "../../../overlays/anchoredContainer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxInputBase.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/comboboxInput/ComboboxInputBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAiC,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ComboboxInputBase.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/comboboxInput/ComboboxInputBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAiC,MAAM,OAAO,CAAC;AAChE,OAAO,EACH,KAAK,SAAS,IAAI,gBAAgB,EAElC,KAAK,IAAI,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEH,KAAK,mBAAmB,EAE3B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,WAAW,CAAC;AAC3D,OAAO,EACH,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAElC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,MAAM,sBAAsB,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,CACjD,mBAAmB,EACjB,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,WAAW,GACX,OAAO,CACZ,GAAG;IACA,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAEzB,gDAAgD;IAChD,YAAY,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE5D;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAE9D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAEvD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,oDAAoD;IACpD,aAAa,CAAC,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAEzC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;IAExC,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAE7D;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,iBAAiB,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAEvD;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAE9B,KAAK,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAExC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC/B,CAAC;AAQF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,OAAO,sBAAsB,CAAC,CAAC,CAAC,gCA2KrE,CAAC"}
|
|
@@ -65,6 +65,7 @@ export declare const useComboboxController: <T>({ items, value, defaultValue, is
|
|
|
65
65
|
updateInputText: (next: string) => void;
|
|
66
66
|
open: () => void;
|
|
67
67
|
close: () => void;
|
|
68
|
+
handlePress: () => void;
|
|
68
69
|
};
|
|
69
70
|
export {};
|
|
70
71
|
//# sourceMappingURL=useComboboxController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComboboxController.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/comboboxInput/useComboboxController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EACR,SAAS,EACT,SAAS,IAAI,gBAAgB,EAC7B,UAAU,EACV,sBAAsB,EACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,aAAa,EAAmC,MAAM,WAAW,CAAC;AAEhF,KAAK,yBAAyB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEvD,KAAK,yBAAyB,GACxB,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,OAAO,CAAC;AAEd,KAAK,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,CAAC;AAE3E,MAAM,WAAW,0BAA0B,CAAC,CAAC;IACzC,2EAA2E;IAC3E,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpC,uEAAuE;IACvE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,yBAAyB,CAAC;CACrC;AAED,MAAM,WAAW,0BAA0B;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yBAAyB,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACpC,+EAA+E;IAC/E,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpC,sEAAsE;IACtE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,oBAAoB,CAAC;CAChC;AAgDD,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IACvC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC/C,cAAc,EAAE,sBAAsB,CAAC;IACvC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAE,yUAwBtC,yBAAyB,CAAC,CAAC,CAAC;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useComboboxController.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/comboboxInput/useComboboxController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EACR,SAAS,EACT,SAAS,IAAI,gBAAgB,EAC7B,UAAU,EACV,sBAAsB,EACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,aAAa,EAAmC,MAAM,WAAW,CAAC;AAEhF,KAAK,yBAAyB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEvD,KAAK,yBAAyB,GACxB,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,OAAO,CAAC;AAEd,KAAK,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,CAAC;AAE3E,MAAM,WAAW,0BAA0B,CAAC,CAAC;IACzC,2EAA2E;IAC3E,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpC,uEAAuE;IACvE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,yBAAyB,CAAC;CACrC;AAED,MAAM,WAAW,0BAA0B;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yBAAyB,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACpC,+EAA+E;IAC/E,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpC,sEAAsE;IACtE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,oBAAoB,CAAC;CAChC;AAgDD,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IACvC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC/C,cAAc,EAAE,sBAAsB,CAAC;IACvC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAE,yUAwBtC,yBAAyB,CAAC,CAAC,CAAC;;;;;;;;;;uBAoHD,SAAS,CAAC,CAAC,CAAC;4BA0FP,MAAM;;;;CA8MxC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { ThemeFactory } from "../../../theme/theme";
|
|
|
2
2
|
import type { FieldTextInputTheme, FieldTheme } from "../../field";
|
|
3
3
|
export type CounterInputTheme = {
|
|
4
4
|
surface: FieldTheme["surface"];
|
|
5
|
-
|
|
5
|
+
input: FieldTextInputTheme;
|
|
6
6
|
};
|
|
7
7
|
export declare const defaultCounterInputTheme: ThemeFactory<"counterInput">;
|
|
8
8
|
//# sourceMappingURL=CounterInput.theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CounterInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/counterInput/CounterInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,
|
|
1
|
+
{"version":3,"file":"CounterInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/counterInput/CounterInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,KAAK,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,cAAc,CAKhE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { ThemeFactory } from "../../../theme/theme";
|
|
|
2
2
|
import type { FieldTextInputTheme, FieldTheme } from "../../field";
|
|
3
3
|
export type NumberInputTheme = {
|
|
4
4
|
surface: FieldTheme["surface"];
|
|
5
|
-
|
|
5
|
+
input: FieldTextInputTheme;
|
|
6
6
|
};
|
|
7
7
|
export declare const defaultNumberInputTheme: ThemeFactory<"numberInput">;
|
|
8
8
|
//# sourceMappingURL=NumberInput.theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/numberInput/NumberInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,
|
|
1
|
+
{"version":3,"file":"NumberInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/numberInput/NumberInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,KAAK,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,aAAa,CAK9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionControl.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/selectionInput/SelectionControl.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAWtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,KAAK,qBAAqB,CAAC,CAAC,IAAI;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAG,iFAOlC,qBAAqB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"SelectionControl.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/selectionInput/SelectionControl.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAWtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,KAAK,qBAAqB,CAAC,CAAC,IAAI;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAG,iFAOlC,qBAAqB,CAAC,CAAC,CAAC,gCAyE1B,CAAC"}
|
|
@@ -5,7 +5,7 @@ export type TimeInputTheme = {
|
|
|
5
5
|
paddingStart: number;
|
|
6
6
|
};
|
|
7
7
|
surface: FieldTheme["surface"];
|
|
8
|
-
|
|
8
|
+
input: FieldTextInputTheme;
|
|
9
9
|
};
|
|
10
10
|
export declare const defaultTimeInputTheme: ThemeFactory<"timeInput">;
|
|
11
11
|
//# sourceMappingURL=TimeInput.theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/timeInput/TimeInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,cAAc,GAAG;IACzB,SAAS,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,
|
|
1
|
+
{"version":3,"file":"TimeInput.theme.d.ts","sourceRoot":"","sources":["../../../../../src/forms/input/timeInput/TimeInput.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,cAAc,GAAG;IACzB,SAAS,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,KAAK,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAS1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchoredContainer.web.d.ts","sourceRoot":"","sources":["../../../../src/overlays/anchoredContainer/AnchoredContainer.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA4C,MAAM,OAAO,CAAC;AAY1E,OAAO,KAAK,EACR,sBAAsB,EAEzB,MAAM,qBAAqB,CAAC;AAY7B,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"AnchoredContainer.web.d.ts","sourceRoot":"","sources":["../../../../src/overlays/anchoredContainer/AnchoredContainer.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA4C,MAAM,OAAO,CAAC;AAY1E,OAAO,KAAK,EACR,sBAAsB,EAEzB,MAAM,qBAAqB,CAAC;AAY7B,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA8JxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/overlays/anchoredContainer/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/overlays/anchoredContainer/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,sBAAsB,EACtB,sBAAsB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { AnchoredContainerTheme } from "./anchoredContainer";
|
|
2
|
+
export type { MenuItemProps, MenuItemTheme, MenuProps, MenuTheme, } from "./menu";
|
|
2
3
|
export { Menu, MenuItem } from "./menu";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlays/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlays/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EACR,aAAa,EACb,aAAa,EACb,SAAS,EACT,SAAS,GACZ,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -18,10 +18,9 @@ export type MenuProps<T = unknown> = {
|
|
|
18
18
|
showsScrollIndicator?: boolean;
|
|
19
19
|
theme?: DeepPartial<MenuTheme>;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* (`onEndReached`, `ListFooterComponent`, `refreshing`, …).
|
|
21
|
+
* Change this value to reset the list to `activeIndex` without animating
|
|
23
22
|
*/
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
export declare const Menu: <T>({ data, renderItem, keyExtractor, activeIndex, reverse, onScroll, showsScrollIndicator, theme: themeOverrides,
|
|
23
|
+
scrollResetKey?: string | number;
|
|
24
|
+
} & Omit<FlatListProps<T>, "data" | "renderItem" | "keyExtractor" | "inverted" | "horizontal" | "style" | "contentContainerStyle" | "showsVerticalScrollIndicator" | "initialScrollIndex" | "onScroll" | "onScrollToIndexFailed">;
|
|
25
|
+
export declare const Menu: <T>({ data, renderItem, keyExtractor, activeIndex, reverse, onScroll, showsScrollIndicator, theme: themeOverrides, scrollResetKey, ...listProps }: MenuProps<T>) => import("react").JSX.Element;
|
|
27
26
|
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/Menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EAEf,KAAK,aAAa,EAClB,KAAK,cAAc,EAEtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQtD,MAAM,MAAM,SAAS,GAAG;IACpB,eAAe,EAAE,UAAU,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI;IACjC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC9B,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACxC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC/B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACpC,GAAG,IAAI,CACJ,aAAa,CAAC,CAAC,CAAC,EACd,MAAM,GACN,YAAY,GACZ,cAAc,GACd,UAAU,GACV,YAAY,GACZ,OAAO,GACP,uBAAuB,GACvB,8BAA8B,GAC9B,oBAAoB,GACpB,UAAU,GACV,uBAAuB,CAC5B,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,CAAC,EAAG,+IAWtB,SAAS,CAAC,CAAC,CAAC,gCAqDd,CAAC"}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import type { FC } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DeepPartial } from "@reillymc/es-utils";
|
|
3
|
+
import { type HighlightedTextTheme } from "../../typography/text";
|
|
3
4
|
export type MenuItemTheme = {
|
|
4
5
|
paddingHorizontal: number;
|
|
5
6
|
paddingVertical: number;
|
|
6
7
|
borderRadius: number;
|
|
7
|
-
|
|
8
|
+
lineHeight: {
|
|
9
|
+
label: number;
|
|
10
|
+
description: number;
|
|
11
|
+
};
|
|
12
|
+
label: HighlightedTextTheme;
|
|
13
|
+
description: HighlightedTextTheme;
|
|
8
14
|
};
|
|
9
15
|
export interface MenuItemProps {
|
|
10
16
|
label: string;
|
|
11
17
|
description?: string;
|
|
12
18
|
searchValue?: string;
|
|
13
19
|
highlighted?: boolean;
|
|
20
|
+
/** Truncate label and description to a single line with a tail ellipsis. */
|
|
21
|
+
truncate?: boolean;
|
|
22
|
+
height?: number;
|
|
14
23
|
onPress: () => void;
|
|
24
|
+
theme?: DeepPartial<MenuItemTheme>;
|
|
15
25
|
}
|
|
16
26
|
export declare const MenuItem: FC<MenuItemProps>;
|
|
17
27
|
//# sourceMappingURL=MenuItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAEH,KAAK,oBAAoB,EAC5B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,EAAE,oBAAoB,CAAC;IAC5B,WAAW,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8CtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.theme.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/MenuItem.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"MenuItem.theme.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/MenuItem.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,UAAU,CA2BzD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { MenuProps } from "./Menu";
|
|
1
|
+
export type { MenuProps, MenuTheme } from "./Menu";
|
|
2
2
|
export { Menu } from "./Menu";
|
|
3
|
-
export type { MenuItemProps } from "./MenuItem";
|
|
3
|
+
export type { MenuItemProps, MenuItemTheme } from "./MenuItem";
|
|
4
4
|
export { MenuItem } from "./MenuItem";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FlatList, FlatListProps } from "react-native";
|
|
2
|
+
type MenuScrollOptions<T> = {
|
|
3
|
+
data: ReadonlyArray<T>;
|
|
4
|
+
activeIndex?: number;
|
|
5
|
+
scrollResetKey?: string | number;
|
|
6
|
+
getItemLayout?: FlatListProps<T>["getItemLayout"];
|
|
7
|
+
onContentSizeChange?: FlatListProps<T>["onContentSizeChange"];
|
|
8
|
+
gap: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const useMenuScroll: <T>({ data, activeIndex, scrollResetKey, getItemLayout, onContentSizeChange, gap, }: MenuScrollOptions<T>) => {
|
|
11
|
+
listRef: import("react").RefObject<FlatList<T> | null>;
|
|
12
|
+
isReady: boolean;
|
|
13
|
+
initialScrollIndex: number | undefined;
|
|
14
|
+
onContentSizeChange: (contentWidth: number, contentHeight: number) => void;
|
|
15
|
+
onScrollToIndexFailed: (info: {
|
|
16
|
+
index: number;
|
|
17
|
+
highestMeasuredFrameIndex: number;
|
|
18
|
+
averageItemLength: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=useMenuScroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMenuScroll.d.ts","sourceRoot":"","sources":["../../../../src/overlays/menu/useMenuScroll.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI5D,KAAK,iBAAiB,CAAC,CAAC,IAAI;IACxB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAClD,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;IAC9D,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,iFAO9B,iBAAiB,CAAC,CAAC,CAAC;;;;;;;;;;CAwGtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../src/theme/palette.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,UAAU,CAAC;AAG9D,MAAM,MAAM,OAAO,GAAG;IAClB,IAAI,EAAE;QACF,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,IAAI,EAAE;YACF,kBAAkB;YAClB,IAAI,EAAE,MAAM,CAAC;YACb,kBAAkB;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,kBAAkB;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,kBAAkB;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,kBAAkB;YAClB,MAAM,EAAE,MAAM,CAAC;YACf,kBAAkB;YAClB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL,CAAC;IACF,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE;QACL,kBAAkB;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,kBAAkB;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,iBAAiB;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,iBAAiB;QACjB,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACJ,MAAM,EAAE;YACJ,iBAAiB;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,iBAAiB;YACjB,OAAO,EAAE,MAAM,CAAC;YAChB,kBAAkB;YAClB,KAAK,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,KAAK,EAAE;YACH,iBAAiB;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,iBAAiB;YACjB,OAAO,EAAE,MAAM,CAAC;YAChB,wCAAwC;YACxC,IAAI,EAAE,MAAM,CAAC;SAChB,CAAC;KACL,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../src/theme/palette.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,UAAU,CAAC;AAG9D,MAAM,MAAM,OAAO,GAAG;IAClB,IAAI,EAAE;QACF,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,mBAAmB;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE;YACF,kBAAkB;YAClB,IAAI,EAAE,MAAM,CAAC;YACb,kBAAkB;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,kBAAkB;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,kBAAkB;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,kBAAkB;YAClB,MAAM,EAAE,MAAM,CAAC;YACf,kBAAkB;YAClB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL,CAAC;IACF,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE;QACL,kBAAkB;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,kBAAkB;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,iBAAiB;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,iBAAiB;QACjB,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACJ,MAAM,EAAE;YACJ,iBAAiB;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,iBAAiB;YACjB,OAAO,EAAE,MAAM,CAAC;YAChB,kBAAkB;YAClB,KAAK,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,KAAK,EAAE;YACH,iBAAiB;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,iBAAiB;YACjB,OAAO,EAAE,MAAM,CAAC;YAChB,wCAAwC;YACxC,IAAI,EAAE,MAAM,CAAC;SAChB,CAAC;KACL,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAE,OA6C5B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,YAAY,gBAAgB,KAAG,OACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/typography/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/typography/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,EACT,SAAS,GACZ,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { FunctionComponent } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type TextStyle } from "react-native";
|
|
3
3
|
import type { DeepPartial } from "@reillymc/es-utils";
|
|
4
|
-
import { type TextProps, type TextVariant } from "./Text";
|
|
4
|
+
import { type TextProps, type TextTheme, type TextVariant } from "./Text";
|
|
5
5
|
export interface HighlightedTextTheme {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
text: TextTheme;
|
|
7
|
+
highlight: {
|
|
8
|
+
weight: Record<TextVariant, TextStyle["fontWeight"]>;
|
|
9
|
+
};
|
|
8
10
|
}
|
|
9
|
-
export interface HighlightedTextProps extends Pick<TextProps, "variant"> {
|
|
11
|
+
export interface HighlightedTextProps extends Pick<TextProps, "variant" | "numberOfLines" | "ellipsizeMode"> {
|
|
10
12
|
text?: string;
|
|
11
|
-
|
|
13
|
+
style?: TextProps["style"];
|
|
12
14
|
theme?: DeepPartial<HighlightedTextTheme>;
|
|
13
15
|
highlight?: string;
|
|
14
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../../../src/typography/text/HighlightedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../../../src/typography/text/HighlightedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAsChF,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE;QACP,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;KACxD,CAAC;CACL;AACD,MAAM,WAAW,oBACb,SAAQ,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,GAAG,eAAe,CAAC;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,CA+CnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightedText.theme.d.ts","sourceRoot":"","sources":["../../../../src/typography/text/HighlightedText.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"HighlightedText.theme.d.ts","sourceRoot":"","sources":["../../../../src/typography/text/HighlightedText.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,iBAAiB,CActE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { HighlightedText, type HighlightedTextProps } from "./HighlightedText";
|
|
2
|
-
export { Text, type TextProps } from "./Text";
|
|
1
|
+
export { HighlightedText, type HighlightedTextProps, type HighlightedTextTheme, } from "./HighlightedText";
|
|
2
|
+
export { Text, type TextProps, type TextTheme } from "./Text";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/typography/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/typography/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _excluded=["text","highlight","
|
|
1
|
+
var _excluded=["text","highlight","style","theme","variant"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}import{c as _c}from"react/compiler-runtime";import{StyleSheet}from"react-native";import{useComponent}from"../../internal";import{Text}from"./Text";import{jsx as _jsx}from"react/jsx-runtime";var escapeForRegex=value=>value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var splitHighlight=(text,highlight)=>{if(!highlight)return[{text,highlighted:false,offset:0}];var lowerHighlight=highlight.toLowerCase();var pattern=new RegExp(`(${escapeForRegex(highlight)})`,"gi");var parts=[];var offset=0;for(var part of text.split(pattern)){if(part==="")continue;parts.push({text:part,highlighted:part.toLowerCase()===lowerHighlight,offset});offset+=part.length;}return parts;};export var HighlightedText=t0=>{var $=_c(24);var props;var style;var t1;var t2;var t3;var themeOverrides;if($[0]!==t0){t1=t0.text;t2=t0.highlight;style=t0.style;themeOverrides=t0.theme;t3=t0.variant;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=props;$[2]=style;$[3]=t1;$[4]=t2;$[5]=t3;$[6]=themeOverrides;}else{props=$[1];style=$[2];t1=$[3];t2=$[4];t3=$[5];themeOverrides=$[6];}var text=t1===undefined?"":t1;var highlight=t2===undefined?"":t2;var variant=t3===undefined?"body":t3;var t4;if($[7]!==themeOverrides){t4={themeOverrides};$[7]=themeOverrides;$[8]=t4;}else{t4=$[8];}var _useComponent=useComponent("highlightedText",t4),theme=_useComponent.theme;var t5;if($[9]!==highlight||$[10]!==props||$[11]!==style||$[12]!==text||$[13]!==theme.highlight||$[14]!==theme.text||$[15]!==variant){var parts=splitHighlight(text,highlight);var t6=props.numberOfLines===1?styles.textWrapperTruncated:styles.textWrapperRow;var t7;if($[17]!==style||$[18]!==t6){t7=[styles.textWrapper,t6,style];$[17]=style;$[18]=t6;$[19]=t7;}else{t7=$[19];}var t8;if($[20]!==theme.highlight||$[21]!==theme.text||$[22]!==variant){t8=part=>_jsx(Text,{variant:variant,theme:{...theme.text,font:{...theme.text.font,[variant]:{...theme.text.font[variant],weight:part.highlighted?theme.highlight.weight[variant]:undefined}}},children:part.text},part.offset);$[20]=theme.highlight;$[21]=theme.text;$[22]=variant;$[23]=t8;}else{t8=$[23];}t5=_jsx(Text,{...props,variant:variant,theme:theme.text,style:t7,children:parts.map(t8)});$[9]=highlight;$[10]=props;$[11]=style;$[12]=text;$[13]=theme.highlight;$[14]=theme.text;$[15]=variant;$[16]=t5;}else{t5=$[16];}return t5;};var styles=StyleSheet.create({textWrapper:{flexShrink:1,minWidth:0},textWrapperRow:{display:"flex",flexDirection:"row"},textWrapperTruncated:{width:"100%",maxWidth:"100%",overflow:"hidden"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultHighlightedTextTheme=({
|
|
1
|
+
export var defaultHighlightedTextTheme=({theme})=>({text:theme.text,highlight:{weight:{body:"800",caption:"800",display:"800",heading:"800",label:"800",title:"800"}}});
|