@reillymc/react-native-components 0.10.14 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/lib/components/AlertIndicator.js +1 -1
  2. package/lib/components/Avatar.js +1 -1
  3. package/lib/components/Panel.js +1 -1
  4. package/lib/components/SwipeAction.js +1 -1
  5. package/lib/components/Toast.js +1 -1
  6. package/lib/components/action/Action.js +1 -1
  7. package/lib/components/action/ActionBase.js +1 -1
  8. package/lib/components/action/IconAction.js +1 -1
  9. package/lib/components/action/IconActionBase.js +1 -1
  10. package/lib/components/action/index.js +1 -1
  11. package/lib/components/button/Button.js +1 -1
  12. package/lib/components/button/ButtonBase.js +1 -1
  13. package/lib/components/button/IconButton.js +1 -1
  14. package/lib/components/button/IconButtonBase.js +1 -1
  15. package/lib/components/button/index.js +1 -1
  16. package/lib/components/container/CollapsibleContainer.js +1 -1
  17. package/lib/components/container/FloatingContainer.js +1 -1
  18. package/lib/components/container/FloatingContainer.web.js +1 -1
  19. package/lib/components/container/FormContainer.js +1 -1
  20. package/lib/components/container/FormRow.js +1 -1
  21. package/lib/components/container/SwipeableContainer.js +1 -1
  22. package/lib/components/container/index.js +1 -1
  23. package/lib/components/icon/Icon.js +1 -1
  24. package/lib/components/icon/IconBase.js +1 -1
  25. package/lib/components/icon/InteractiveIcon.js +1 -1
  26. package/lib/components/icon/componentWithIcon.js +1 -1
  27. package/lib/components/icon/index.js +1 -1
  28. package/lib/components/index.js +1 -1
  29. package/lib/components/input/CounterInput.js +1 -1
  30. package/lib/components/input/DropdownInput.js +1 -1
  31. package/lib/components/input/DropdownInputBase.js +1 -1
  32. package/lib/components/input/InputAction.js +1 -1
  33. package/lib/components/input/InputBase.js +1 -1
  34. package/lib/components/input/InputRowContainer.js +1 -1
  35. package/lib/components/input/InputScaffold.js +1 -1
  36. package/lib/components/input/NumberInput.js +1 -1
  37. package/lib/components/input/NumberInputBase.js +1 -1
  38. package/lib/components/input/RatingInput.js +1 -1
  39. package/lib/components/input/SelectionInput.js +1 -1
  40. package/lib/components/input/TextInput.js +1 -1
  41. package/lib/components/input/TimeInput.js +1 -1
  42. package/lib/components/input/ToggleInput.js +1 -1
  43. package/lib/components/input/index.js +1 -1
  44. package/lib/components/listItem/ListItem.js +1 -1
  45. package/lib/components/listItem/ListItemAlert.js +1 -1
  46. package/lib/components/listItem/ListItemAvatar.js +1 -1
  47. package/lib/components/listItem/ListItemFooter.js +1 -1
  48. package/lib/components/listItem/ListItemRow.js +1 -1
  49. package/lib/components/listItem/index.js +1 -1
  50. package/lib/components/menu/Menu.js +1 -1
  51. package/lib/components/menu/MenuItem.js +1 -1
  52. package/lib/components/menu/index.js +1 -1
  53. package/lib/components/rating/Rating.js +1 -0
  54. package/lib/components/rating/index.js +1 -0
  55. package/lib/components/rating/ratingUtils.js +1 -0
  56. package/lib/components/tag/Tag.js +1 -1
  57. package/lib/components/tag/TagIcon.js +1 -1
  58. package/lib/components/tag/index.js +1 -1
  59. package/lib/components/text/HighlightedText.js +1 -1
  60. package/lib/components/text/InteractiveText.js +1 -1
  61. package/lib/components/text/Text.js +1 -1
  62. package/lib/components/text/index.js +1 -1
  63. package/lib/hooks/index.js +1 -1
  64. package/lib/hooks/useForwardedRef.js +1 -1
  65. package/lib/hooks/useKeyboardHeight.js +1 -1
  66. package/lib/hooks/usePersistentKeyboardHeight.js +1 -1
  67. package/lib/hooks/useTheme.js +1 -1
  68. package/lib/hooks/useThemedStyles.js +1 -1
  69. package/lib/icons/base.js +1 -1
  70. package/lib/icons/index.js +1 -1
  71. package/lib/icons/octicons.js +1 -1
  72. package/lib/icons/stars/StarBorder.js +1 -1
  73. package/lib/icons/stars/StarFull.js +1 -1
  74. package/lib/icons/stars/StarHalf.js +1 -1
  75. package/lib/icons/stars/index.js +1 -1
  76. package/lib/index.js +1 -1
  77. package/lib/providers/ThemeContext.js +1 -0
  78. package/lib/providers/ThemeProvider.js +1 -1
  79. package/lib/providers/index.js +1 -1
  80. package/lib/theme/icons.js +1 -1
  81. package/lib/theme/index.js +1 -1
  82. package/lib/theme/styles.js +1 -1
  83. package/lib/theme/theme.js +1 -1
  84. package/lib/types/components/container/FloatingContainer.web.d.ts +17 -0
  85. package/lib/types/components/container/FloatingContainer.web.d.ts.map +1 -0
  86. package/lib/types/components/index.d.ts +1 -1
  87. package/lib/types/components/input/RatingInput.d.ts +1 -1
  88. package/lib/types/components/{Rating.d.ts → rating/Rating.d.ts} +2 -5
  89. package/lib/types/components/rating/Rating.d.ts.map +1 -0
  90. package/lib/types/components/rating/index.d.ts +3 -0
  91. package/lib/types/components/rating/index.d.ts.map +1 -0
  92. package/lib/types/components/rating/ratingUtils.d.ts +5 -0
  93. package/lib/types/components/rating/ratingUtils.d.ts.map +1 -0
  94. package/lib/types/icons/base.d.ts +12 -1
  95. package/lib/types/icons/base.d.ts.map +1 -1
  96. package/lib/types/icons/index.d.ts +1 -1
  97. package/lib/types/icons/index.d.ts.map +1 -1
  98. package/lib/types/providers/ThemeContext.d.ts +8 -0
  99. package/lib/types/providers/ThemeContext.d.ts.map +1 -0
  100. package/lib/types/providers/ThemeProvider.d.ts +1 -7
  101. package/lib/types/providers/ThemeProvider.d.ts.map +1 -1
  102. package/lib/types/providers/index.d.ts +2 -1
  103. package/lib/types/providers/index.d.ts.map +1 -1
  104. package/lib/types/theme/icons.d.ts +3 -3
  105. package/lib/types/theme/icons.d.ts.map +1 -1
  106. package/package.json +5 -3
  107. package/lib/components/Rating.js +0 -1
  108. package/lib/types/components/Rating.d.ts.map +0 -1
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.NumberInput=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _react=require("react");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _text=require("../text");var _InputAction=require("./InputAction");var _InputRowContainer=require("./InputRowContainer");var _InputScaffold=require("./InputScaffold");var _NumberInputBase=require("./NumberInputBase");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["keyboardType","enabledRepresentations","disabled","clearButtonMode","placeholder","placeholder2","maxLength","value","variant","onChange","onSubmitEditing","ref"];var getNextMode=(enabledRepresentations,current)=>{var currentIndex=enabledRepresentations.indexOf(current);var nextIndex=currentIndex+1>=enabledRepresentations.length?0:currentIndex+1;return enabledRepresentations[nextIndex];};var getNextValue=(nextMode,_ref)=>{var value=_ref.value,representation=_ref.representation;if(nextMode===representation)return undefined;switch(nextMode){case"number":return{representation:"number",value:value?.[0]??""};case"fraction":return{representation:"fraction",value:[value?.[0]??(typeof value==="string"?value:""),"",""]};case"range":return{representation:"range",value:[value?.[0]??(typeof value==="string"?value:""),""]};}};var NumberInput=t0=>{var $=(0,_compilerRuntime.c)(83);var baseProps;var clearButtonMode;var maxLength;var onChange;var onSubmitEditing;var placeholder;var placeholder2;var ref;var t1;var t2;var t3;var t4;var t5;if($[0]!==t0){var _t=t0;t1=_t.keyboardType;t2=_t.enabledRepresentations;t3=_t.disabled;clearButtonMode=_t.clearButtonMode;placeholder=_t.placeholder;placeholder2=_t.placeholder2;maxLength=_t.maxLength;t4=_t.value;t5=_t.variant;onChange=_t.onChange;onSubmitEditing=_t.onSubmitEditing;ref=_t.ref;baseProps=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=baseProps;$[2]=clearButtonMode;$[3]=maxLength;$[4]=onChange;$[5]=onSubmitEditing;$[6]=placeholder;$[7]=placeholder2;$[8]=ref;$[9]=t1;$[10]=t2;$[11]=t3;$[12]=t4;$[13]=t5;}else{baseProps=$[1];clearButtonMode=$[2];maxLength=$[3];onChange=$[4];onSubmitEditing=$[5];placeholder=$[6];placeholder2=$[7];ref=$[8];t1=$[9];t2=$[10];t3=$[11];t4=$[12];t5=$[13];}var keyboardType=t1===undefined?"number-pad":t1;var t6;if($[14]!==t2){t6=t2===undefined?["number","fraction","range"]:t2;$[14]=t2;$[15]=t6;}else{t6=$[15];}var enabledRepresentations=t6;var disabled=t3===undefined?false:t3;var t7;if($[16]!==t4){t7=t4===undefined?{representation:"number",value:""}:t4;$[16]=t4;$[17]=t7;}else{t7=$[17];}var value=t7;var variant=t5===undefined?"regular":t5;var t8;if($[18]!==value){t8={props:{value}};$[18]=value;$[19]=t8;}else{t8=$[19];}var _useThemedStyles=(0,_hooks.useThemedStyles)("numberInput",createStyles,t8),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,2),styles=_useThemedStyles2[0],t9=_useThemedStyles2[1];var icons=t9.icons;var icon=icons[value.representation];var t10;if($[20]!==enabledRepresentations||$[21]!==onChange||$[22]!==value){t10=()=>{var nextMode=getNextMode(enabledRepresentations,value.representation);if(!nextMode){return;}var nextValue=getNextValue(nextMode,value);if(!nextValue){return;}onChange?.(nextValue);};$[20]=enabledRepresentations;$[21]=onChange;$[22]=value;$[23]=t10;}else{t10=$[23];}var handleChangeMode=t10;var t11;if($[24]!==onChange||$[25]!==value.representation||$[26]!==value.value?.[1]||$[27]!==value.value?.[2]){t11=text=>{bb33:switch(value.representation){case"number":{onChange?.({representation:value.representation,value:text});break bb33;}case"fraction":{onChange?.({representation:value.representation,value:[text,value.value?.[1]??"",value.value?.[2]??""]});break bb33;}case"range":{onChange?.({representation:value.representation,value:[text,value.value?.[1]??""]});}}};$[24]=onChange;$[25]=value.representation;$[26]=value.value?.[1];$[27]=value.value?.[2];$[28]=t11;}else{t11=$[28];}var handlePrimaryInputChangeText=t11;var t12=enabledRepresentations.length>1?handleChangeMode:undefined;var t13;if($[29]!==disabled||$[30]!==icon||$[31]!==t12||$[32]!==variant){t13=(0,_jsxRuntime.jsx)(_InputAction.InputAction,Object.assign({disabled:disabled,variant:variant},icon,{onPress:t12}));$[29]=disabled;$[30]=icon;$[31]=t12;$[32]=variant;$[33]=t13;}else{t13=$[33];}var t14=value.representation==="range"?placeholder2:placeholder;var t15=value.representation==="number"?value.value:value.value?.[0];var t16=value.representation==="fraction"?"number-pad":keyboardType;var t17=value.representation==="number"?onSubmitEditing:undefined;var t18;if($[34]!==clearButtonMode||$[35]!==disabled||$[36]!==handlePrimaryInputChangeText||$[37]!==maxLength||$[38]!==ref||$[39]!==styles.input||$[40]!==t14||$[41]!==t15||$[42]!==t16||$[43]!==t17||$[44]!==variant){t18=(0,_jsxRuntime.jsx)(_NumberInputBase.NumberInputBase,{ref:ref,disabled:disabled,variant:variant,placeholder:t14,maxLength:maxLength,clearButtonMode:clearButtonMode,value:t15,keyboardType:t16,inputStyle:styles.input,onChangeText:handlePrimaryInputChangeText,onSubmitEditing:t17});$[34]=clearButtonMode;$[35]=disabled;$[36]=handlePrimaryInputChangeText;$[37]=maxLength;$[38]=ref;$[39]=styles.input;$[40]=t14;$[41]=t15;$[42]=t16;$[43]=t17;$[44]=variant;$[45]=t18;}else{t18=$[45];}var t19;if($[46]!==clearButtonMode||$[47]!==disabled||$[48]!==maxLength||$[49]!==onChange||$[50]!==onSubmitEditing||$[51]!==placeholder2||$[52]!==styles.input||$[53]!==value.representation||$[54]!==value.value?.[0]||$[55]!==value.value?.[1]||$[56]!==value.value?.[2]||$[57]!==variant){t19=value.representation==="fraction"&&(0,_jsxRuntime.jsx)(_NumberInputBase.NumberInputBase,{disabled:disabled,variant:variant,placeholder:placeholder2,value:value.value?.[1],maxLength:maxLength,clearButtonMode:clearButtonMode,keyboardType:"number-pad",inputStyle:styles.input,onChangeText:text_0=>onChange?.({representation:value.representation,value:[value.value?.[0]??"",text_0,value.value?.[2]??""]}),onSubmitEditing:onSubmitEditing});$[46]=clearButtonMode;$[47]=disabled;$[48]=maxLength;$[49]=onChange;$[50]=onSubmitEditing;$[51]=placeholder2;$[52]=styles.input;$[53]=value.representation;$[54]=value.value?.[0];$[55]=value.value?.[1];$[56]=value.value?.[2];$[57]=variant;$[58]=t19;}else{t19=$[58];}var t20;if($[59]!==clearButtonMode||$[60]!==disabled||$[61]!==keyboardType||$[62]!==maxLength||$[63]!==onChange||$[64]!==onSubmitEditing||$[65]!==placeholder2||$[66]!==styles.input||$[67]!==styles.separator||$[68]!==value.representation||$[69]!==value.value?.[0]||$[70]!==value.value?.[1]||$[71]!==value.value?.[2]||$[72]!==variant){t20=value.representation!=="number"&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.separator,children:(0,_jsxRuntime.jsx)(_text.Text,{variant:"title",children:value.representation==="fraction"?"/":"\u2212"})}),(0,_jsxRuntime.jsx)(_NumberInputBase.NumberInputBase,{disabled:disabled,variant:variant,placeholder:placeholder2,value:value.representation==="fraction"?value.value?.[2]:value.value?.[1],maxLength:maxLength,clearButtonMode:clearButtonMode,keyboardType:value.representation==="fraction"?"number-pad":keyboardType,inputStyle:styles.input,onChangeText:text_1=>{if(value.representation==="fraction"){onChange?.({representation:value.representation,value:[value.value?.[0]??"",value.value?.[1]??"",text_1]});return;}onChange?.({representation:value.representation,value:[value.value?.[0]??"",text_1]});},onSubmitEditing:onSubmitEditing})]});$[59]=clearButtonMode;$[60]=disabled;$[61]=keyboardType;$[62]=maxLength;$[63]=onChange;$[64]=onSubmitEditing;$[65]=placeholder2;$[66]=styles.input;$[67]=styles.separator;$[68]=value.representation;$[69]=value.value?.[0];$[70]=value.value?.[1];$[71]=value.value?.[2];$[72]=variant;$[73]=t20;}else{t20=$[73];}var t21;if($[74]!==disabled||$[75]!==t13||$[76]!==t18||$[77]!==t19||$[78]!==t20){t21=(0,_jsxRuntime.jsxs)(_InputRowContainer.InputRowContainer,{disabled:disabled,children:[t13,t18,t19,t20]});$[74]=disabled;$[75]=t13;$[76]=t18;$[77]=t19;$[78]=t20;$[79]=t21;}else{t21=$[79];}var t22;if($[80]!==baseProps||$[81]!==t21){t22=(0,_jsxRuntime.jsx)(_InputScaffold.InputScaffold,Object.assign({},baseProps,{children:t21}));$[80]=baseProps;$[81]=t21;$[82]=t22;}else{t22=$[82];}return t22;};exports.NumberInput=NumberInput;var createStyles=(_,_ref2)=>{var value=_ref2.value;return _reactNative.StyleSheet.create({input:{flexGrow:1,flexBasis:0,textAlign:value.representation==="number"?"left":"center"},separator:{justifyContent:"center"}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/NumberInput.tsx";var _excluded=["keyboardType","enabledRepresentations","disabled","clearButtonMode","placeholder","placeholder2","maxLength","value","variant","onChange","onSubmitEditing","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{useCallback}from"react";import{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{Text}from"../text";import{InputAction}from"./InputAction";import{InputRowContainer}from"./InputRowContainer";import{InputScaffold}from"./InputScaffold";import{NumberInputBase}from"./NumberInputBase";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";var getNextMode=(enabledRepresentations,current)=>{var currentIndex=enabledRepresentations.indexOf(current);var nextIndex=currentIndex+1>=enabledRepresentations.length?0:currentIndex+1;return enabledRepresentations[nextIndex];};var getNextValue=(nextMode,{value,representation})=>{if(nextMode===representation)return undefined;switch(nextMode){case"number":return{representation:"number",value:value?.[0]??""};case"fraction":return{representation:"fraction",value:[value?.[0]??(typeof value==="string"?value:""),"",""]};case"range":return{representation:"range",value:[value?.[0]??(typeof value==="string"?value:""),""]};}};export var NumberInput=t0=>{var $=_c(83);var baseProps;var clearButtonMode;var maxLength;var onChange;var onSubmitEditing;var placeholder;var placeholder2;var ref;var t1;var t2;var t3;var t4;var t5;if($[0]!==t0){t1=t0.keyboardType;t2=t0.enabledRepresentations;t3=t0.disabled;clearButtonMode=t0.clearButtonMode;placeholder=t0.placeholder;placeholder2=t0.placeholder2;maxLength=t0.maxLength;t4=t0.value;t5=t0.variant;onChange=t0.onChange;onSubmitEditing=t0.onSubmitEditing;ref=t0.ref;baseProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=baseProps;$[2]=clearButtonMode;$[3]=maxLength;$[4]=onChange;$[5]=onSubmitEditing;$[6]=placeholder;$[7]=placeholder2;$[8]=ref;$[9]=t1;$[10]=t2;$[11]=t3;$[12]=t4;$[13]=t5;}else{baseProps=$[1];clearButtonMode=$[2];maxLength=$[3];onChange=$[4];onSubmitEditing=$[5];placeholder=$[6];placeholder2=$[7];ref=$[8];t1=$[9];t2=$[10];t3=$[11];t4=$[12];t5=$[13];}var keyboardType=t1===undefined?"number-pad":t1;var t6;if($[14]!==t2){t6=t2===undefined?["number","fraction","range"]:t2;$[14]=t2;$[15]=t6;}else{t6=$[15];}var enabledRepresentations=t6;var disabled=t3===undefined?false:t3;var t7;if($[16]!==t4){t7=t4===undefined?{representation:"number",value:""}:t4;$[16]=t4;$[17]=t7;}else{t7=$[17];}var value=t7;var variant=t5===undefined?"regular":t5;var t8;if($[18]!==value){t8={props:{value}};$[18]=value;$[19]=t8;}else{t8=$[19];}var _useThemedStyles=useThemedStyles("numberInput",createStyles,t8),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],t9=_useThemedStyles2[1];var icons=t9.icons;var icon=icons[value.representation];var t10;if($[20]!==enabledRepresentations||$[21]!==onChange||$[22]!==value){t10=()=>{var nextMode=getNextMode(enabledRepresentations,value.representation);if(!nextMode){return;}var nextValue=getNextValue(nextMode,value);if(!nextValue){return;}onChange?.(nextValue);};$[20]=enabledRepresentations;$[21]=onChange;$[22]=value;$[23]=t10;}else{t10=$[23];}var handleChangeMode=t10;var t11;if($[24]!==onChange||$[25]!==value.representation||$[26]!==value.value?.[1]||$[27]!==value.value?.[2]){t11=text=>{bb33:switch(value.representation){case"number":{onChange?.({representation:value.representation,value:text});break bb33;}case"fraction":{onChange?.({representation:value.representation,value:[text,value.value?.[1]??"",value.value?.[2]??""]});break bb33;}case"range":{onChange?.({representation:value.representation,value:[text,value.value?.[1]??""]});}}};$[24]=onChange;$[25]=value.representation;$[26]=value.value?.[1];$[27]=value.value?.[2];$[28]=t11;}else{t11=$[28];}var handlePrimaryInputChangeText=t11;var t12=enabledRepresentations.length>1?handleChangeMode:undefined;var t13;if($[29]!==disabled||$[30]!==icon||$[31]!==t12||$[32]!==variant){t13=_jsx(InputAction,{disabled:disabled,variant:variant,...icon,onPress:t12});$[29]=disabled;$[30]=icon;$[31]=t12;$[32]=variant;$[33]=t13;}else{t13=$[33];}var t14=value.representation==="range"?placeholder2:placeholder;var t15=value.representation==="number"?value.value:value.value?.[0];var t16=value.representation==="fraction"?"number-pad":keyboardType;var t17=value.representation==="number"?onSubmitEditing:undefined;var t18;if($[34]!==clearButtonMode||$[35]!==disabled||$[36]!==handlePrimaryInputChangeText||$[37]!==maxLength||$[38]!==ref||$[39]!==styles.input||$[40]!==t14||$[41]!==t15||$[42]!==t16||$[43]!==t17||$[44]!==variant){t18=_jsx(NumberInputBase,{ref:ref,disabled:disabled,variant:variant,placeholder:t14,maxLength:maxLength,clearButtonMode:clearButtonMode,value:t15,keyboardType:t16,inputStyle:styles.input,onChangeText:handlePrimaryInputChangeText,onSubmitEditing:t17});$[34]=clearButtonMode;$[35]=disabled;$[36]=handlePrimaryInputChangeText;$[37]=maxLength;$[38]=ref;$[39]=styles.input;$[40]=t14;$[41]=t15;$[42]=t16;$[43]=t17;$[44]=variant;$[45]=t18;}else{t18=$[45];}var t19;if($[46]!==clearButtonMode||$[47]!==disabled||$[48]!==maxLength||$[49]!==onChange||$[50]!==onSubmitEditing||$[51]!==placeholder2||$[52]!==styles.input||$[53]!==value.representation||$[54]!==value.value?.[0]||$[55]!==value.value?.[1]||$[56]!==value.value?.[2]||$[57]!==variant){t19=value.representation==="fraction"&&_jsx(NumberInputBase,{disabled:disabled,variant:variant,placeholder:placeholder2,value:value.value?.[1],maxLength:maxLength,clearButtonMode:clearButtonMode,keyboardType:"number-pad",inputStyle:styles.input,onChangeText:text_0=>onChange?.({representation:value.representation,value:[value.value?.[0]??"",text_0,value.value?.[2]??""]}),onSubmitEditing:onSubmitEditing});$[46]=clearButtonMode;$[47]=disabled;$[48]=maxLength;$[49]=onChange;$[50]=onSubmitEditing;$[51]=placeholder2;$[52]=styles.input;$[53]=value.representation;$[54]=value.value?.[0];$[55]=value.value?.[1];$[56]=value.value?.[2];$[57]=variant;$[58]=t19;}else{t19=$[58];}var t20;if($[59]!==clearButtonMode||$[60]!==disabled||$[61]!==keyboardType||$[62]!==maxLength||$[63]!==onChange||$[64]!==onSubmitEditing||$[65]!==placeholder2||$[66]!==styles.input||$[67]!==styles.separator||$[68]!==value.representation||$[69]!==value.value?.[0]||$[70]!==value.value?.[1]||$[71]!==value.value?.[2]||$[72]!==variant){t20=value.representation!=="number"&&_jsxs(_Fragment,{children:[_jsx(View,{style:styles.separator,children:_jsx(Text,{variant:"title",children:value.representation==="fraction"?"/":"\u2212"})}),_jsx(NumberInputBase,{disabled:disabled,variant:variant,placeholder:placeholder2,value:value.representation==="fraction"?value.value?.[2]:value.value?.[1],maxLength:maxLength,clearButtonMode:clearButtonMode,keyboardType:value.representation==="fraction"?"number-pad":keyboardType,inputStyle:styles.input,onChangeText:text_1=>{if(value.representation==="fraction"){onChange?.({representation:value.representation,value:[value.value?.[0]??"",value.value?.[1]??"",text_1]});return;}onChange?.({representation:value.representation,value:[value.value?.[0]??"",text_1]});},onSubmitEditing:onSubmitEditing})]});$[59]=clearButtonMode;$[60]=disabled;$[61]=keyboardType;$[62]=maxLength;$[63]=onChange;$[64]=onSubmitEditing;$[65]=placeholder2;$[66]=styles.input;$[67]=styles.separator;$[68]=value.representation;$[69]=value.value?.[0];$[70]=value.value?.[1];$[71]=value.value?.[2];$[72]=variant;$[73]=t20;}else{t20=$[73];}var t21;if($[74]!==disabled||$[75]!==t13||$[76]!==t18||$[77]!==t19||$[78]!==t20){t21=_jsxs(InputRowContainer,{disabled:disabled,children:[t13,t18,t19,t20]});$[74]=disabled;$[75]=t13;$[76]=t18;$[77]=t19;$[78]=t20;$[79]=t21;}else{t21=$[79];}var t22;if($[80]!==baseProps||$[81]!==t21){t22=_jsx(InputScaffold,{...baseProps,children:t21});$[80]=baseProps;$[81]=t21;$[82]=t22;}else{t22=$[82];}return t22;};var createStyles=(_,{value})=>StyleSheet.create({input:{flexGrow:1,flexBasis:0,textAlign:value.representation==="number"?"left":"center"},separator:{justifyContent:"center"}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.NumberInputBase=void 0;var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _react=require("react");var _InputBase=require("./InputBase");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onChangeText","keyboardType"];var NumberInputBase=t0=>{var $=(0,_compilerRuntime.c)(11);var onChangeText;var props;var t1;if($[0]!==t0){var _t=t0;onChangeText=_t.onChangeText;t1=_t.keyboardType;props=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=onChangeText;$[2]=props;$[3]=t1;}else{onChangeText=$[1];props=$[2];t1=$[3];}var keyboardType=t1===undefined?"number-pad":t1;var t2;if($[4]!==keyboardType||$[5]!==onChangeText){t2=text=>{if(onChangeText){var regExp=keyboardType==="decimal-pad"?/^([0-9]*\.*[0-9]*)/g:/^([0-9]*)/g;var validatedString=text.match(regExp)?.[0];var num=Number.parseFloat(validatedString??"");if(Number.isNaN(num)||validatedString!==num.toString()){onChangeText?.(validatedString??"");return;}onChangeText?.(num.toString());}};$[4]=keyboardType;$[5]=onChangeText;$[6]=t2;}else{t2=$[6];}var handleChangeText=t2;var t3;if($[7]!==handleChangeText||$[8]!==keyboardType||$[9]!==props){t3=(0,_jsxRuntime.jsx)(_InputBase.InputBase,Object.assign({},props,{keyboardType:keyboardType,onChangeText:handleChangeText}));$[7]=handleChangeText;$[8]=keyboardType;$[9]=props;$[10]=t3;}else{t3=$[10];}return t3;};exports.NumberInputBase=NumberInputBase;
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/NumberInputBase.tsx";var _excluded=["onChangeText","keyboardType"];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{useCallback}from"react";import{InputBase}from"./InputBase";import{jsx as _jsx}from"react/jsx-runtime";export var NumberInputBase=t0=>{var $=_c(11);var onChangeText;var props;var t1;if($[0]!==t0){onChangeText=t0.onChangeText;t1=t0.keyboardType;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=onChangeText;$[2]=props;$[3]=t1;}else{onChangeText=$[1];props=$[2];t1=$[3];}var keyboardType=t1===undefined?"number-pad":t1;var t2;if($[4]!==keyboardType||$[5]!==onChangeText){t2=text=>{if(onChangeText){var regExp=keyboardType==="decimal-pad"?/^([0-9]*\.*[0-9]*)/g:/^([0-9]*)/g;var validatedString=text.match(regExp)?.[0];var num=Number.parseFloat(validatedString??"");if(Number.isNaN(num)||validatedString!==num.toString()){onChangeText?.(validatedString??"");return;}onChangeText?.(num.toString());}};$[4]=keyboardType;$[5]=onChangeText;$[6]=t2;}else{t2=$[6];}var handleChangeText=t2;var t3;if($[7]!==handleChangeText||$[8]!==keyboardType||$[9]!==props){t3=_jsx(InputBase,{...props,keyboardType:keyboardType,onChangeText:handleChangeText});$[7]=handleChangeText;$[8]=keyboardType;$[9]=props;$[10]=t3;}else{t3=$[10];}return t3;};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.RatingInput=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _react=require("react");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _icon=require("../icon");var _Rating=require("../Rating");var _InputScaffold=require("./InputScaffold");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["value","max","disabled","variant","scale","onChange"];var animationConfig={easing:_reactNative.Easing.elastic(2),duration:300,scale:1.2,delay:300};var RatingInput=t0=>{var $=(0,_compilerRuntime.c)(44);var disabledProp;var onChange;var props;var scale;var t1;var t2;var t3;if($[0]!==t0){var _t=t0;t1=_t.value;t2=_t.max;disabledProp=_t.disabled;t3=_t.variant;scale=_t.scale;onChange=_t.onChange;props=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=disabledProp;$[2]=onChange;$[3]=props;$[4]=scale;$[5]=t1;$[6]=t2;$[7]=t3;}else{disabledProp=$[1];onChange=$[2];props=$[3];scale=$[4];t1=$[5];t2=$[6];t3=$[7];}var value=t1===undefined?0:t1;var max=t2===undefined?5:t2;var variant=t3===undefined?"regular":t3;var disabled=disabledProp||!onChange;var _useTheme=(0,_hooks.useTheme)(),theme=_useTheme.theme,t4=_useTheme.styles;var inputBase=t4.inputBase,rating=t4.rating;var t5;if($[8]!==disabled||$[9]!==variant){t5={props:{disabled,variant}};$[8]=disabled;$[9]=variant;$[10]=t5;}else{t5=$[10];}var _useThemedStyles=(0,_hooks.useThemedStyles)("ratingInput",createStyles,t5),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,2),styles=_useThemedStyles2[0],t6=_useThemedStyles2[1];var icons=t6.icons;var _useState=(0,_react.useState)(),_useState2=(0,_slicedToArray2.default)(_useState,2),width=_useState2[0],setWidth=_useState2[1];var t7;bb0:{if(!width||width<=0){t7=0;break bb0;}var maxSizeForWidth=Math.floor((width-inputBase.container.padding-theme.spacing.tiny*(max-1))/max);var maxSizeForHeight=inputBase.container.height[variant]-inputBase.container.padding-theme.spacing.tiny*2;t7=Math.max(0,Math.min(maxSizeForWidth,maxSizeForHeight));}var ratingIconSize=t7;var scaledRating=scale?(0,_Rating.valueToRating)(value,max,scale):value;var ratingIcons=(0,_Rating.getRatingIcons)(scaledRating,max);var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2.default)(_useState3,2),isInteracting=_useState4[0],setInteracting=_useState4[1];var t8;bb1:{var _t2;if($[11]!==max||$[12]!==value||$[13]!==width){_t2=x=>{if(!width){return value;}return Math.max(0,Math.min(Math.round(x/width*max*2+0.2)/2,max));};$[11]=max;$[12]=value;$[13]=width;$[14]=_t2;}else{_t2=$[14];}var calculateRating=_t2;var _t3;if($[15]!==disabled||$[16]!==max||$[17]!==onChange||$[18]!==scale||$[19]!==value){_t3=newRating=>{if(disabled||newRating===value){return;}onChange?.(scale?(0,_Rating.ratingToValue)(newRating,max,scale):newRating);};$[15]=disabled;$[16]=max;$[17]=onChange;$[18]=scale;$[19]=value;$[20]=_t3;}else{_t3=$[20];}var handleChange=_t3;if(disabled){var _t4;if($[21]===Symbol.for("react.memo_cache_sentinel")){_t4={};$[21]=_t4;}else{_t4=$[21];}t8=_t4;break bb1;}var _t5;if($[22]!==calculateRating||$[23]!==disabled||$[24]!==handleChange){var _t6;if($[26]!==calculateRating||$[27]!==handleChange){_t6=e=>{var newRating_0=calculateRating(e.nativeEvent.locationX);handleChange(newRating_0);};$[26]=calculateRating;$[27]=handleChange;$[28]=_t6;}else{_t6=$[28];}var _t7;if($[29]!==calculateRating||$[30]!==handleChange){_t7=e_1=>{var newRating_2=calculateRating(e_1.nativeEvent.locationX);handleChange(newRating_2);setTimeout(()=>{setInteracting(false);},animationConfig.delay);};$[29]=calculateRating;$[30]=handleChange;$[31]=_t7;}else{_t7=$[31];}var t14;if($[32]===Symbol.for("react.memo_cache_sentinel")){t14=()=>{setTimeout(()=>{setInteracting(false);},animationConfig.delay);};$[32]=t14;}else{t14=$[32];}_t5=_reactNative.PanResponder.create({onStartShouldSetPanResponder:_temp,onStartShouldSetPanResponderCapture:_temp2,onMoveShouldSetPanResponder:_temp3,onMoveShouldSetPanResponderCapture:_temp4,onPanResponderMove:_t6,onPanResponderStart:e_0=>{var newRating_1=calculateRating(e_0.nativeEvent.locationX);handleChange(newRating_1);if(disabled){return;}setInteracting(true);},onPanResponderEnd:_t7,onPanResponderTerminate:t14});$[22]=calculateRating;$[23]=disabled;$[24]=handleChange;$[25]=_t5;}else{_t5=$[25];}t8=_t5.panHandlers;}var panHandlers=t8;var T0=_InputScaffold.InputScaffold;var T1=_reactNative.View;var t9=styles.container;var t10;if($[33]===Symbol.for("react.memo_cache_sentinel")){t10=e_2=>{var nextWidth=e_2.nativeEvent.layout.width;if(nextWidth>0){setWidth(nextWidth);}};$[33]=t10;}else{t10=$[33];}var t11=ratingIcons.map((variant_0,i)=>(0,_jsxRuntime.jsx)(AnimatedIcon,{active:isInteracting&&scaledRating>i&&scaledRating-1<=i,children:(0,_jsxRuntime.jsx)(_icon.IconBase,Object.assign({},icons[variant_0],{style:{size:ratingIconSize,color:rating.icon.color[variant_0]}}))},i));var t12;if($[34]!==T1||$[35]!==panHandlers||$[36]!==styles.container||$[37]!==t10||$[38]!==t11){t12=(0,_jsxRuntime.jsx)(T1,Object.assign({style:t9},panHandlers,{onLayout:t10,children:t11}));$[34]=T1;$[35]=panHandlers;$[36]=styles.container;$[37]=t10;$[38]=t11;$[39]=t12;}else{t12=$[39];}var t13;if($[40]!==T0||$[41]!==props||$[42]!==t12){t13=(0,_jsxRuntime.jsx)(T0,Object.assign({},props,{children:t12}));$[40]=T0;$[41]=props;$[42]=t12;$[43]=t13;}else{t13=$[43];}return t13;};exports.RatingInput=RatingInput;var AnimatedIcon=t0=>{var $=(0,_compilerRuntime.c)(11);var active=t0.active,children=t0.children;var scale=animationConfig.scale,easing=animationConfig.easing,duration=animationConfig.duration;var t1;if($[0]!==active){t1=()=>new _reactNative.Animated.Value(active?scale:1);$[0]=active;$[1]=t1;}else{t1=$[1];}var _useState5=(0,_react.useState)(t1),_useState6=(0,_slicedToArray2.default)(_useState5,1),animatedSize=_useState6[0];var t2;var t3;if($[2]!==active||$[3]!==animatedSize){t2=()=>{var animation=_reactNative.Animated.timing(animatedSize,{toValue:active?scale:1,useNativeDriver:true,easing,duration});animation.start();return animation.stop;};t3=[active,animatedSize];$[2]=active;$[3]=animatedSize;$[4]=t2;$[5]=t3;}else{t2=$[4];t3=$[5];}(0,_react.useEffect)(t2,t3);var t4;if($[6]!==animatedSize){t4={transform:[{scale:animatedSize}]};$[6]=animatedSize;$[7]=t4;}else{t4=$[7];}var t5;if($[8]!==children||$[9]!==t4){t5=(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:t4,children:children});$[8]=children;$[9]=t4;$[10]=t5;}else{t5=$[10];}return t5;};var createStyles=(_ref,_ref2)=>{var inputBase=_ref.styles.inputBase;var disabled=_ref2.disabled,variant=_ref2.variant;var _inputBase$container=inputBase.container,borderRadius=_inputBase$container.borderRadius,padding=_inputBase$container.padding,height=_inputBase$container.height;return _reactNative.StyleSheet.create({container:{height:height[variant],borderRadius,backgroundColor:inputBase.container.backgroundColor[disabled?"disabled":"enabled"],padding,flexDirection:"row",alignItems:"center",justifyContent:"space-evenly"}});};function _temp(){return true;}function _temp2(){return true;}function _temp3(){return true;}function _temp4(){return true;}
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/RatingInput.tsx";var _excluded=["value","max","disabled","variant","scale","onChange"];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{useEffect,useMemo,useState}from"react";import{Animated,Easing,PanResponder,StyleSheet,View}from"react-native";import{useTheme,useThemedStyles}from"../../hooks";import{IconBase}from"../icon";import{getRatingIcons,ratingToValue,valueToRating}from"../rating";import{InputScaffold}from"./InputScaffold";import{jsx as _jsx}from"react/jsx-runtime";var animationConfig={easing:Easing.elastic(2),duration:300,scale:1.2,delay:300};export var RatingInput=t0=>{var $=_c(44);var disabledProp;var onChange;var props;var scale;var t1;var t2;var t3;if($[0]!==t0){t1=t0.value;t2=t0.max;disabledProp=t0.disabled;t3=t0.variant;scale=t0.scale;onChange=t0.onChange;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=disabledProp;$[2]=onChange;$[3]=props;$[4]=scale;$[5]=t1;$[6]=t2;$[7]=t3;}else{disabledProp=$[1];onChange=$[2];props=$[3];scale=$[4];t1=$[5];t2=$[6];t3=$[7];}var value=t1===undefined?0:t1;var max=t2===undefined?5:t2;var variant=t3===undefined?"regular":t3;var disabled=disabledProp||!onChange;var _useTheme=useTheme(),theme=_useTheme.theme,t4=_useTheme.styles;var inputBase=t4.inputBase,rating=t4.rating;var t5;if($[8]!==disabled||$[9]!==variant){t5={props:{disabled,variant}};$[8]=disabled;$[9]=variant;$[10]=t5;}else{t5=$[10];}var _useThemedStyles=useThemedStyles("ratingInput",createStyles,t5),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],t6=_useThemedStyles2[1];var icons=t6.icons;var _useState=useState(),_useState2=_slicedToArray(_useState,2),width=_useState2[0],setWidth=_useState2[1];var t7;bb0:{if(!width||width<=0){t7=0;break bb0;}var maxSizeForWidth=Math.floor((width-inputBase.container.padding-theme.spacing.tiny*(max-1))/max);var maxSizeForHeight=inputBase.container.height[variant]-inputBase.container.padding-theme.spacing.tiny*2;t7=Math.max(0,Math.min(maxSizeForWidth,maxSizeForHeight));}var ratingIconSize=t7;var scaledRating=scale?valueToRating(value,max,scale):value;var ratingIcons=getRatingIcons(scaledRating,max);var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isInteracting=_useState4[0],setInteracting=_useState4[1];var t8;bb1:{var _t;if($[11]!==max||$[12]!==value||$[13]!==width){_t=x=>{if(!width){return value;}return Math.max(0,Math.min(Math.round(x/width*max*2+0.2)/2,max));};$[11]=max;$[12]=value;$[13]=width;$[14]=_t;}else{_t=$[14];}var calculateRating=_t;var _t2;if($[15]!==disabled||$[16]!==max||$[17]!==onChange||$[18]!==scale||$[19]!==value){_t2=newRating=>{if(disabled||newRating===value){return;}onChange?.(scale?ratingToValue(newRating,max,scale):newRating);};$[15]=disabled;$[16]=max;$[17]=onChange;$[18]=scale;$[19]=value;$[20]=_t2;}else{_t2=$[20];}var handleChange=_t2;if(disabled){var _t3;if($[21]===Symbol.for("react.memo_cache_sentinel")){_t3={};$[21]=_t3;}else{_t3=$[21];}t8=_t3;break bb1;}var _t4;if($[22]!==calculateRating||$[23]!==disabled||$[24]!==handleChange){var _t5;if($[26]!==calculateRating||$[27]!==handleChange){_t5=e=>{var newRating_0=calculateRating(e.nativeEvent.locationX);handleChange(newRating_0);};$[26]=calculateRating;$[27]=handleChange;$[28]=_t5;}else{_t5=$[28];}var _t6;if($[29]!==calculateRating||$[30]!==handleChange){_t6=e_1=>{var newRating_2=calculateRating(e_1.nativeEvent.locationX);handleChange(newRating_2);setTimeout(()=>{setInteracting(false);},animationConfig.delay);};$[29]=calculateRating;$[30]=handleChange;$[31]=_t6;}else{_t6=$[31];}var t14;if($[32]===Symbol.for("react.memo_cache_sentinel")){t14=()=>{setTimeout(()=>{setInteracting(false);},animationConfig.delay);};$[32]=t14;}else{t14=$[32];}_t4=PanResponder.create({onStartShouldSetPanResponder:_temp,onStartShouldSetPanResponderCapture:_temp2,onMoveShouldSetPanResponder:_temp3,onMoveShouldSetPanResponderCapture:_temp4,onPanResponderMove:_t5,onPanResponderStart:e_0=>{var newRating_1=calculateRating(e_0.nativeEvent.locationX);handleChange(newRating_1);if(disabled){return;}setInteracting(true);},onPanResponderEnd:_t6,onPanResponderTerminate:t14});$[22]=calculateRating;$[23]=disabled;$[24]=handleChange;$[25]=_t4;}else{_t4=$[25];}t8=_t4.panHandlers;}var panHandlers=t8;var T0=InputScaffold;var T1=View;var t9=styles.container;var t10;if($[33]===Symbol.for("react.memo_cache_sentinel")){t10=e_2=>{var nextWidth=e_2.nativeEvent.layout.width;if(nextWidth>0){setWidth(nextWidth);}};$[33]=t10;}else{t10=$[33];}var t11=ratingIcons.map((variant_0,i)=>_jsx(AnimatedIcon,{active:isInteracting&&scaledRating>i&&scaledRating-1<=i,children:_jsx(IconBase,{...icons[variant_0],style:{size:ratingIconSize,color:rating.icon.color[variant_0]}})},i));var t12;if($[34]!==T1||$[35]!==panHandlers||$[36]!==styles.container||$[37]!==t10||$[38]!==t11){t12=_jsx(T1,{style:t9,...panHandlers,onLayout:t10,children:t11});$[34]=T1;$[35]=panHandlers;$[36]=styles.container;$[37]=t10;$[38]=t11;$[39]=t12;}else{t12=$[39];}var t13;if($[40]!==T0||$[41]!==props||$[42]!==t12){t13=_jsx(T0,{...props,children:t12});$[40]=T0;$[41]=props;$[42]=t12;$[43]=t13;}else{t13=$[43];}return t13;};var AnimatedIcon=t0=>{var $=_c(11);var active=t0.active,children=t0.children;var scale=animationConfig.scale,easing=animationConfig.easing,duration=animationConfig.duration;var t1;if($[0]!==active){t1=()=>new Animated.Value(active?scale:1);$[0]=active;$[1]=t1;}else{t1=$[1];}var _useState5=useState(t1),_useState6=_slicedToArray(_useState5,1),animatedSize=_useState6[0];var t2;var t3;if($[2]!==active||$[3]!==animatedSize){t2=()=>{var animation=Animated.timing(animatedSize,{toValue:active?scale:1,useNativeDriver:true,easing,duration});animation.start();return animation.stop;};t3=[active,animatedSize];$[2]=active;$[3]=animatedSize;$[4]=t2;$[5]=t3;}else{t2=$[4];t3=$[5];}useEffect(t2,t3);var t4;if($[6]!==animatedSize){t4={transform:[{scale:animatedSize}]};$[6]=animatedSize;$[7]=t4;}else{t4=$[7];}var t5;if($[8]!==children||$[9]!==t4){t5=_jsx(Animated.View,{pointerEvents:"none",style:t4,children:children});$[8]=children;$[9]=t4;$[10]=t5;}else{t5=$[10];}return t5;};var createStyles=({styles:{inputBase}},{disabled,variant})=>{var _inputBase$container=inputBase.container,borderRadius=_inputBase$container.borderRadius,padding=_inputBase$container.padding,height=_inputBase$container.height;return StyleSheet.create({container:{height:height[variant],borderRadius,backgroundColor:inputBase.container.backgroundColor[disabled?"disabled":"enabled"],padding,flexDirection:"row",alignItems:"center",justifyContent:"space-evenly"}});};function _temp(){return true;}function _temp2(){return true;}function _temp3(){return true;}function _temp4(){return true;}
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.SelectionInput=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _action=require("../action");var _icon=require("../icon");var _tag=require("../tag");var _text=require("../text");var _InputScaffold=require("./InputScaffold");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["label","disabled","placeholder","hideLabel","selectionMode","selection","style","variant","onAdd"];var SelectionInput=t0=>{var $=(0,_compilerRuntime.c)(43);var disabledProp;var hideLabel;var label;var onAdd;var placeholder;var props;var selection;var selectionMode;var styleOverrides;var t1;if($[0]!==t0){var _t=t0;label=_t.label;disabledProp=_t.disabled;placeholder=_t.placeholder;hideLabel=_t.hideLabel;selectionMode=_t.selectionMode;selection=_t.selection;styleOverrides=_t.style;t1=_t.variant;onAdd=_t.onAdd;props=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=disabledProp;$[2]=hideLabel;$[3]=label;$[4]=onAdd;$[5]=placeholder;$[6]=props;$[7]=selection;$[8]=selectionMode;$[9]=styleOverrides;$[10]=t1;}else{disabledProp=$[1];hideLabel=$[2];label=$[3];onAdd=$[4];placeholder=$[5];props=$[6];selection=$[7];selectionMode=$[8];styleOverrides=$[9];t1=$[10];}var variant=t1===undefined?"regular":t1;var disabled=disabledProp||!onAdd;var t2;if($[11]!==styleOverrides){t2={selectionInput:styleOverrides};$[11]=styleOverrides;$[12]=t2;}else{t2=$[12];}var t3;if($[13]!==disabled||$[14]!==variant){t3={disabled,variant};$[13]=disabled;$[14]=variant;$[15]=t3;}else{t3=$[15];}var t4;if($[16]!==t2||$[17]!==t3){t4={styles:t2,props:t3};$[16]=t2;$[17]=t3;$[18]=t4;}else{t4=$[18];}var _useThemedStyles=(0,_hooks.useThemedStyles)("selectionInput",createStyles,t4),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var style=t5.style,icons=t5.icons;var hasSelection=selectionMode==="single"?!!selection:!!selection?.length;var t6=!hideLabel&&label;var t7;if($[19]!==styles.container||$[20]!==styles.containerPressed){t7=t8=>{var pressed=t8.pressed;return[styles.container,pressed&&styles.containerPressed];};$[19]=styles.container;$[20]=styles.containerPressed;$[21]=t7;}else{t7=$[21];}var t8;if($[22]!==disabled||$[23]!==hasSelection||$[24]!==icons.showOptions||$[25]!==placeholder||$[26]!==selection||$[27]!==selectionMode||$[28]!==style.icon||$[29]!==styles.iconContainer||$[30]!==styles.placeholderText||$[31]!==styles.selectionContainer||$[32]!==styles.selectionItemLabel){t8=pressableState=>(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.selectionContainer,children:[selectionMode==="single"&&!!selection&&(0,_jsxRuntime.jsx)(_text.Text,{style:styles.selectionItemLabel,children:selection.label}),selectionMode==="multi"&&!!selection?.length&&selection.map(_temp),!hasSelection&&(0,_jsxRuntime.jsx)(_text.Text,{style:styles.placeholderText,children:placeholder})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.iconContainer,children:(0,_jsxRuntime.jsx)(_icon.InteractiveIcon,Object.assign({},icons.showOptions,{disabled:disabled,style:style.icon},pressableState))})]});$[22]=disabled;$[23]=hasSelection;$[24]=icons.showOptions;$[25]=placeholder;$[26]=selection;$[27]=selectionMode;$[28]=style.icon;$[29]=styles.iconContainer;$[30]=styles.placeholderText;$[31]=styles.selectionContainer;$[32]=styles.selectionItemLabel;$[33]=t8;}else{t8=$[33];}var t9;if($[34]!==disabled||$[35]!==onAdd||$[36]!==t7||$[37]!==t8){t9=(0,_jsxRuntime.jsx)(_action.ActionBase,{disabled:disabled,containerStyle:t7,onPress:onAdd,children:t8});$[34]=disabled;$[35]=onAdd;$[36]=t7;$[37]=t8;$[38]=t9;}else{t9=$[38];}var t10;if($[39]!==props||$[40]!==t6||$[41]!==t9){t10=(0,_jsxRuntime.jsx)(_InputScaffold.InputScaffold,Object.assign({label:t6},props,{children:t9}));$[39]=props;$[40]=t6;$[41]=t9;$[42]=t10;}else{t10=$[42];}return t10;};exports.SelectionInput=SelectionInput;SelectionInput.displayName="SelectionInput";var createStyles=(_ref,_ref2)=>{var _ref$styles=_ref.styles,inputBase=_ref$styles.inputBase,selectionInput=_ref$styles.selectionInput;var disabled=_ref2.disabled,variant=_ref2.variant;var _inputBase$container=inputBase.container,borderRadius=_inputBase$container.borderRadius,padding=_inputBase$container.padding,height=_inputBase$container.height;return _reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",minHeight:height[variant],borderRadius,backgroundColor:inputBase.container.backgroundColor[disabled?"disabled":"enabled"]},containerPressed:{backgroundColor:selectionInput.container.backgroundColor.pressed},selectionContainer:{flex:1,minWidth:0,flexDirection:"row",flexWrap:"wrap",gap:selectionInput.selectionContainer.gap,paddingLeft:padding,marginVertical:padding},selectionItemLabel:{color:inputBase.text.color[disabled?"disabled":"enabled"]},placeholderText:{color:inputBase.text.placeholderColor},iconContainer:{width:height[variant],height:height[variant],alignItems:"center",justifyContent:"center"}});};function _temp(item){return(0,_jsxRuntime.jsx)(_tag.Tag,{label:item.label},"id"in item?item.id:item.value);}
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/SelectionInput.tsx";var _excluded=["label","disabled","placeholder","hideLabel","selectionMode","selection","style","variant","onAdd"];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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{ActionBase}from"../action";import{InteractiveIcon}from"../icon";import{Tag}from"../tag";import{Text}from"../text";import{InputScaffold}from"./InputScaffold";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export var SelectionInput=t0=>{var $=_c(43);var disabledProp;var hideLabel;var label;var onAdd;var placeholder;var props;var selection;var selectionMode;var styleOverrides;var t1;if($[0]!==t0){label=t0.label;disabledProp=t0.disabled;placeholder=t0.placeholder;hideLabel=t0.hideLabel;selectionMode=t0.selectionMode;selection=t0.selection;styleOverrides=t0.style;t1=t0.variant;onAdd=t0.onAdd;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=disabledProp;$[2]=hideLabel;$[3]=label;$[4]=onAdd;$[5]=placeholder;$[6]=props;$[7]=selection;$[8]=selectionMode;$[9]=styleOverrides;$[10]=t1;}else{disabledProp=$[1];hideLabel=$[2];label=$[3];onAdd=$[4];placeholder=$[5];props=$[6];selection=$[7];selectionMode=$[8];styleOverrides=$[9];t1=$[10];}var variant=t1===undefined?"regular":t1;var disabled=disabledProp||!onAdd;var t2;if($[11]!==styleOverrides){t2={selectionInput:styleOverrides};$[11]=styleOverrides;$[12]=t2;}else{t2=$[12];}var t3;if($[13]!==disabled||$[14]!==variant){t3={disabled,variant};$[13]=disabled;$[14]=variant;$[15]=t3;}else{t3=$[15];}var t4;if($[16]!==t2||$[17]!==t3){t4={styles:t2,props:t3};$[16]=t2;$[17]=t3;$[18]=t4;}else{t4=$[18];}var _useThemedStyles=useThemedStyles("selectionInput",createStyles,t4),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var style=t5.style,icons=t5.icons;var hasSelection=selectionMode==="single"?!!selection:!!selection?.length;var t6=!hideLabel&&label;var t7;if($[19]!==styles.container||$[20]!==styles.containerPressed){t7=t8=>{var pressed=t8.pressed;return[styles.container,pressed&&styles.containerPressed];};$[19]=styles.container;$[20]=styles.containerPressed;$[21]=t7;}else{t7=$[21];}var t8;if($[22]!==disabled||$[23]!==hasSelection||$[24]!==icons.showOptions||$[25]!==placeholder||$[26]!==selection||$[27]!==selectionMode||$[28]!==style.icon||$[29]!==styles.iconContainer||$[30]!==styles.placeholderText||$[31]!==styles.selectionContainer||$[32]!==styles.selectionItemLabel){t8=pressableState=>_jsxs(_Fragment,{children:[_jsxs(View,{style:styles.selectionContainer,children:[selectionMode==="single"&&!!selection&&_jsx(Text,{style:styles.selectionItemLabel,children:selection.label}),selectionMode==="multi"&&!!selection?.length&&selection.map(_temp),!hasSelection&&_jsx(Text,{style:styles.placeholderText,children:placeholder})]}),_jsx(View,{style:styles.iconContainer,children:_jsx(InteractiveIcon,{...icons.showOptions,disabled:disabled,style:style.icon,...pressableState})})]});$[22]=disabled;$[23]=hasSelection;$[24]=icons.showOptions;$[25]=placeholder;$[26]=selection;$[27]=selectionMode;$[28]=style.icon;$[29]=styles.iconContainer;$[30]=styles.placeholderText;$[31]=styles.selectionContainer;$[32]=styles.selectionItemLabel;$[33]=t8;}else{t8=$[33];}var t9;if($[34]!==disabled||$[35]!==onAdd||$[36]!==t7||$[37]!==t8){t9=_jsx(ActionBase,{disabled:disabled,containerStyle:t7,onPress:onAdd,children:t8});$[34]=disabled;$[35]=onAdd;$[36]=t7;$[37]=t8;$[38]=t9;}else{t9=$[38];}var t10;if($[39]!==props||$[40]!==t6||$[41]!==t9){t10=_jsx(InputScaffold,{label:t6,...props,children:t9});$[39]=props;$[40]=t6;$[41]=t9;$[42]=t10;}else{t10=$[42];}return t10;};SelectionInput.displayName="SelectionInput";var createStyles=({styles:{inputBase,selectionInput}},{disabled,variant})=>{var _inputBase$container=inputBase.container,borderRadius=_inputBase$container.borderRadius,padding=_inputBase$container.padding,height=_inputBase$container.height;return StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",minHeight:height[variant],borderRadius,backgroundColor:inputBase.container.backgroundColor[disabled?"disabled":"enabled"]},containerPressed:{backgroundColor:selectionInput.container.backgroundColor.pressed},selectionContainer:{flex:1,minWidth:0,flexDirection:"row",flexWrap:"wrap",gap:selectionInput.selectionContainer.gap,paddingLeft:padding,marginVertical:padding},selectionItemLabel:{color:inputBase.text.color[disabled?"disabled":"enabled"]},placeholderText:{color:inputBase.text.placeholderColor},iconContainer:{width:height[variant],height:height[variant],alignItems:"center",justifyContent:"center"}});};function _temp(item){return _jsx(Tag,{label:item.label},"id"in item?item.id:item.value);}
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.TextInput=void 0;var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _InputBase=require("./InputBase");var _InputScaffold=require("./InputScaffold");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["label","helpText","mandatory","hasError","containerStyle"];var TextInput=t0=>{var $=(0,_compilerRuntime.c)(16);var containerStyle;var hasError;var helpText;var label;var mandatory;var props;if($[0]!==t0){var _t=t0;label=_t.label;helpText=_t.helpText;mandatory=_t.mandatory;hasError=_t.hasError;containerStyle=_t.containerStyle;props=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=containerStyle;$[2]=hasError;$[3]=helpText;$[4]=label;$[5]=mandatory;$[6]=props;}else{containerStyle=$[1];hasError=$[2];helpText=$[3];label=$[4];mandatory=$[5];props=$[6];}var t1;if($[7]!==props){t1=(0,_jsxRuntime.jsx)(_InputBase.InputBase,Object.assign({},props));$[7]=props;$[8]=t1;}else{t1=$[8];}var t2;if($[9]!==containerStyle||$[10]!==hasError||$[11]!==helpText||$[12]!==label||$[13]!==mandatory||$[14]!==t1){t2=(0,_jsxRuntime.jsx)(_InputScaffold.InputScaffold,{label:label,helpText:helpText,mandatory:mandatory,hasError:hasError,containerStyle:containerStyle,children:t1});$[9]=containerStyle;$[10]=hasError;$[11]=helpText;$[12]=label;$[13]=mandatory;$[14]=t1;$[15]=t2;}else{t2=$[15];}return t2;};exports.TextInput=TextInput;
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/TextInput.tsx";var _excluded=["label","helpText","mandatory","hasError","containerStyle"];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{InputBase}from"./InputBase";import{InputScaffold}from"./InputScaffold";import{jsx as _jsx}from"react/jsx-runtime";export var TextInput=t0=>{var $=_c(16);var containerStyle;var hasError;var helpText;var label;var mandatory;var props;if($[0]!==t0){label=t0.label;helpText=t0.helpText;mandatory=t0.mandatory;hasError=t0.hasError;containerStyle=t0.containerStyle;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=containerStyle;$[2]=hasError;$[3]=helpText;$[4]=label;$[5]=mandatory;$[6]=props;}else{containerStyle=$[1];hasError=$[2];helpText=$[3];label=$[4];mandatory=$[5];props=$[6];}var t1;if($[7]!==props){t1=_jsx(InputBase,{...props});$[7]=props;$[8]=t1;}else{t1=$[8];}var t2;if($[9]!==containerStyle||$[10]!==hasError||$[11]!==helpText||$[12]!==label||$[13]!==mandatory||$[14]!==t1){t2=_jsx(InputScaffold,{label:label,helpText:helpText,mandatory:mandatory,hasError:hasError,containerStyle:containerStyle,children:t1});$[9]=containerStyle;$[10]=hasError;$[11]=helpText;$[12]=label;$[13]=mandatory;$[14]=t1;$[15]=t2;}else{t2=$[15];}return t2;};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.TimeInput=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _react=require("react");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _text=require("../text");var _InputAction=require("./InputAction");var _InputBase=require("./InputBase");var _InputRowContainer=require("./InputRowContainer");var _InputScaffold=require("./InputScaffold");var _NumberInputBase=require("./NumberInputBase");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["disabled","clearButtonMode","hoursPlaceholder","minutesPlaceholder","variant","value","onChange","onSubmitEditing"];var TimeInput=t0=>{var $=(0,_compilerRuntime.c)(74);var baseProps;var clearButtonMode;var disabledProp;var hoursPlaceholder;var minutesPlaceholder;var onChange;var onSubmitEditing;var t1;var t2;if($[0]!==t0){var _t=t0;disabledProp=_t.disabled;clearButtonMode=_t.clearButtonMode;hoursPlaceholder=_t.hoursPlaceholder;minutesPlaceholder=_t.minutesPlaceholder;t1=_t.variant;t2=_t.value;onChange=_t.onChange;onSubmitEditing=_t.onSubmitEditing;baseProps=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=baseProps;$[2]=clearButtonMode;$[3]=disabledProp;$[4]=hoursPlaceholder;$[5]=minutesPlaceholder;$[6]=onChange;$[7]=onSubmitEditing;$[8]=t1;$[9]=t2;}else{baseProps=$[1];clearButtonMode=$[2];disabledProp=$[3];hoursPlaceholder=$[4];minutesPlaceholder=$[5];onChange=$[6];onSubmitEditing=$[7];t1=$[8];t2=$[9];}var variant=t1===undefined?"regular":t1;var t3;if($[10]!==t2){t3=t2===undefined?{hours:"",minutes:""}:t2;$[10]=t2;$[11]=t3;}else{t3=$[11];}var value=t3;var disabled=disabledProp||!onChange;var hoursRef=(0,_react.useRef)(null);var minutesRef=(0,_react.useRef)(null);var t4;if($[12]!==variant){t4={props:{variant}};$[12]=variant;$[13]=t4;}else{t4=$[13];}var _useThemedStyles=(0,_hooks.useThemedStyles)("timeInput",createStyles,t4),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var icons=t5.icons;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isFocused=_useState2[0],setIsFocused=_useState2[1];var t6;if($[14]!==disabled||$[15]!==icons.time||$[16]!==variant){t6=(0,_jsxRuntime.jsx)(_InputAction.InputAction,Object.assign({},icons.time,{variant:variant,disabled:disabled}));$[14]=disabled;$[15]=icons.time;$[16]=variant;$[17]=t6;}else{t6=$[17];}var t7=value?.hours;var t8;if($[18]!==onChange||$[19]!==value){t8=text=>onChange?.(Object.assign({},value,{hours:text}));$[18]=onChange;$[19]=value;$[20]=t8;}else{t8=$[20];}var t10;var t11;var t9;if($[21]===Symbol.for("react.memo_cache_sentinel")){t9=()=>setIsFocused(true);t10=()=>setIsFocused(false);t11=()=>minutesRef.current?.focus();$[21]=t10;$[22]=t11;$[23]=t9;}else{t10=$[21];t11=$[22];t9=$[23];}var t12;if($[24]!==clearButtonMode||$[25]!==disabled||$[26]!==hoursPlaceholder||$[27]!==styles.input||$[28]!==t7||$[29]!==t8||$[30]!==variant){t12=(0,_jsxRuntime.jsx)(_NumberInputBase.NumberInputBase,{ref:hoursRef,disabled:disabled,placeholder:hoursPlaceholder,maxLength:2,clearButtonMode:clearButtonMode,value:t7,variant:variant,keyboardType:"number-pad",submitBehavior:"submit",returnKeyType:"next",inputStyle:styles.input,onChangeText:t8,onFocus:t9,onBlur:t10,onSubmitEditing:t11});$[24]=clearButtonMode;$[25]=disabled;$[26]=hoursPlaceholder;$[27]=styles.input;$[28]=t7;$[29]=t8;$[30]=variant;$[31]=t12;}else{t12=$[31];}var t13;if($[32]===Symbol.for("react.memo_cache_sentinel")){t13=()=>hoursRef.current?.focus();$[32]=t13;}else{t13=$[32];}var t14;if($[33]===Symbol.for("react.memo_cache_sentinel")){t14=(0,_jsxRuntime.jsx)(_text.Text,{variant:"body",children:"h"});$[33]=t14;}else{t14=$[33];}var t15;if($[34]!==styles.timeLabel){t15=(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:t13,style:styles.timeLabel,children:t14});$[34]=styles.timeLabel;$[35]=t15;}else{t15=$[35];}var t16;if($[36]!==onChange||$[37]!==value){t16=text_0=>{var addToHours=text_0?Math.floor(Number.parseInt(text_0,10)/60):undefined;var remainingMinutes=text_0?Number.parseInt(text_0,10)%60:text_0;onChange?.(Object.assign({},value,{hours:value.hours?(Number.parseInt(value.hours,10)+(addToHours??0)).toString():addToHours?.toString()??"",minutes:remainingMinutes.toString()}));};$[36]=onChange;$[37]=value;$[38]=t16;}else{t16=$[38];}var t17;var t18;if($[39]===Symbol.for("react.memo_cache_sentinel")){t17=()=>setIsFocused(true);t18=()=>setIsFocused(false);$[39]=t17;$[40]=t18;}else{t17=$[39];t18=$[40];}var t19;if($[41]!==clearButtonMode||$[42]!==disabled||$[43]!==minutesPlaceholder||$[44]!==onSubmitEditing||$[45]!==styles.input||$[46]!==t16||$[47]!==value.minutes||$[48]!==variant){t19=(0,_jsxRuntime.jsx)(_NumberInputBase.NumberInputBase,{ref:minutesRef,disabled:disabled,placeholder:minutesPlaceholder,value:value.minutes,maxLength:2,clearButtonMode:clearButtonMode,variant:variant,keyboardType:"number-pad",returnKeyType:"done",inputStyle:styles.input,onChangeText:t16,onFocus:t17,onBlur:t18,onSubmitEditing:onSubmitEditing});$[41]=clearButtonMode;$[42]=disabled;$[43]=minutesPlaceholder;$[44]=onSubmitEditing;$[45]=styles.input;$[46]=t16;$[47]=value.minutes;$[48]=variant;$[49]=t19;}else{t19=$[49];}var t20;var t21;if($[50]===Symbol.for("react.memo_cache_sentinel")){t20=()=>minutesRef.current?.focus();t21=(0,_jsxRuntime.jsx)(_text.Text,{variant:"body",children:"m"});$[50]=t20;$[51]=t21;}else{t20=$[50];t21=$[51];}var t22;if($[52]!==styles.timeLabel){t22=(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:styles.timeLabel,onPress:t20,children:t21});$[52]=styles.timeLabel;$[53]=t22;}else{t22=$[53];}var t23=disabled||!isFocused?"never":"always";var t24=value.hours!==""||value.minutes!==""?" ":"";var t25;if($[54]!==onChange){t25=()=>onChange?.({hours:"",minutes:""});$[54]=onChange;$[55]=t25;}else{t25=$[55];}var t26;if($[56]!==disabled||$[57]!==styles.clearInput||$[58]!==t23||$[59]!==t24||$[60]!==t25||$[61]!==variant){t26=(0,_jsxRuntime.jsx)(_InputBase.InputBase,{clearButtonMode:t23,value:t24,selectionColor:"transparent",focusable:false,autoComplete:"off",variant:variant,caretHidden:true,contextMenuHidden:true,disabled:disabled,showSoftInputOnFocus:false,inputStyle:styles.clearInput,onFocus:t25});$[56]=disabled;$[57]=styles.clearInput;$[58]=t23;$[59]=t24;$[60]=t25;$[61]=variant;$[62]=t26;}else{t26=$[62];}var t27;if($[63]!==disabled||$[64]!==t12||$[65]!==t15||$[66]!==t19||$[67]!==t22||$[68]!==t26||$[69]!==t6){t27=(0,_jsxRuntime.jsxs)(_InputRowContainer.InputRowContainer,{disabled:disabled,children:[t6,t12,t15,t19,t22,t26]});$[63]=disabled;$[64]=t12;$[65]=t15;$[66]=t19;$[67]=t22;$[68]=t26;$[69]=t6;$[70]=t27;}else{t27=$[70];}var t28;if($[71]!==baseProps||$[72]!==t27){t28=(0,_jsxRuntime.jsx)(_InputScaffold.InputScaffold,Object.assign({},baseProps,{children:t27}));$[71]=baseProps;$[72]=t27;$[73]=t28;}else{t28=$[73];}return t28;};exports.TimeInput=TimeInput;var createStyles=(_ref,_ref2)=>{var inputBase=_ref.styles.inputBase;var variant=_ref2.variant;return _reactNative.StyleSheet.create({input:{flexGrow:1,flexBasis:0,textAlign:"right"},clearInput:{flexShrink:1,marginLeft:inputBase.container.padding},timeLabel:{height:inputBase.container.height[variant],justifyContent:"center"}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/TimeInput.tsx";var _excluded=["disabled","clearButtonMode","hoursPlaceholder","minutesPlaceholder","variant","value","onChange","onSubmitEditing"];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{useRef,useState}from"react";import{Pressable,StyleSheet}from"react-native";import{useThemedStyles}from"../../hooks";import{Text}from"../text";import{InputAction}from"./InputAction";import{InputBase}from"./InputBase";import{InputRowContainer}from"./InputRowContainer";import{InputScaffold}from"./InputScaffold";import{NumberInputBase}from"./NumberInputBase";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var TimeInput=t0=>{var $=_c(74);var baseProps;var clearButtonMode;var disabledProp;var hoursPlaceholder;var minutesPlaceholder;var onChange;var onSubmitEditing;var t1;var t2;if($[0]!==t0){disabledProp=t0.disabled;clearButtonMode=t0.clearButtonMode;hoursPlaceholder=t0.hoursPlaceholder;minutesPlaceholder=t0.minutesPlaceholder;t1=t0.variant;t2=t0.value;onChange=t0.onChange;onSubmitEditing=t0.onSubmitEditing;baseProps=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=baseProps;$[2]=clearButtonMode;$[3]=disabledProp;$[4]=hoursPlaceholder;$[5]=minutesPlaceholder;$[6]=onChange;$[7]=onSubmitEditing;$[8]=t1;$[9]=t2;}else{baseProps=$[1];clearButtonMode=$[2];disabledProp=$[3];hoursPlaceholder=$[4];minutesPlaceholder=$[5];onChange=$[6];onSubmitEditing=$[7];t1=$[8];t2=$[9];}var variant=t1===undefined?"regular":t1;var t3;if($[10]!==t2){t3=t2===undefined?{hours:"",minutes:""}:t2;$[10]=t2;$[11]=t3;}else{t3=$[11];}var value=t3;var disabled=disabledProp||!onChange;var hoursRef=useRef(null);var minutesRef=useRef(null);var t4;if($[12]!==variant){t4={props:{variant}};$[12]=variant;$[13]=t4;}else{t4=$[13];}var _useThemedStyles=useThemedStyles("timeInput",createStyles,t4),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var icons=t5.icons;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isFocused=_useState2[0],setIsFocused=_useState2[1];var t6;if($[14]!==disabled||$[15]!==icons.time||$[16]!==variant){t6=_jsx(InputAction,{...icons.time,variant:variant,disabled:disabled});$[14]=disabled;$[15]=icons.time;$[16]=variant;$[17]=t6;}else{t6=$[17];}var t7=value?.hours;var t8;if($[18]!==onChange||$[19]!==value){t8=text=>onChange?.({...value,hours:text});$[18]=onChange;$[19]=value;$[20]=t8;}else{t8=$[20];}var t10;var t11;var t9;if($[21]===Symbol.for("react.memo_cache_sentinel")){t9=()=>setIsFocused(true);t10=()=>setIsFocused(false);t11=()=>minutesRef.current?.focus();$[21]=t10;$[22]=t11;$[23]=t9;}else{t10=$[21];t11=$[22];t9=$[23];}var t12;if($[24]!==clearButtonMode||$[25]!==disabled||$[26]!==hoursPlaceholder||$[27]!==styles.input||$[28]!==t7||$[29]!==t8||$[30]!==variant){t12=_jsx(NumberInputBase,{ref:hoursRef,disabled:disabled,placeholder:hoursPlaceholder,maxLength:2,clearButtonMode:clearButtonMode,value:t7,variant:variant,keyboardType:"number-pad",submitBehavior:"submit",returnKeyType:"next",inputStyle:styles.input,onChangeText:t8,onFocus:t9,onBlur:t10,onSubmitEditing:t11});$[24]=clearButtonMode;$[25]=disabled;$[26]=hoursPlaceholder;$[27]=styles.input;$[28]=t7;$[29]=t8;$[30]=variant;$[31]=t12;}else{t12=$[31];}var t13;if($[32]===Symbol.for("react.memo_cache_sentinel")){t13=()=>hoursRef.current?.focus();$[32]=t13;}else{t13=$[32];}var t14;if($[33]===Symbol.for("react.memo_cache_sentinel")){t14=_jsx(Text,{variant:"body",children:"h"});$[33]=t14;}else{t14=$[33];}var t15;if($[34]!==styles.timeLabel){t15=_jsx(Pressable,{onPress:t13,style:styles.timeLabel,children:t14});$[34]=styles.timeLabel;$[35]=t15;}else{t15=$[35];}var t16;if($[36]!==onChange||$[37]!==value){t16=text_0=>{var addToHours=text_0?Math.floor(Number.parseInt(text_0,10)/60):undefined;var remainingMinutes=text_0?Number.parseInt(text_0,10)%60:text_0;onChange?.({...value,hours:value.hours?(Number.parseInt(value.hours,10)+(addToHours??0)).toString():addToHours?.toString()??"",minutes:remainingMinutes.toString()});};$[36]=onChange;$[37]=value;$[38]=t16;}else{t16=$[38];}var t17;var t18;if($[39]===Symbol.for("react.memo_cache_sentinel")){t17=()=>setIsFocused(true);t18=()=>setIsFocused(false);$[39]=t17;$[40]=t18;}else{t17=$[39];t18=$[40];}var t19;if($[41]!==clearButtonMode||$[42]!==disabled||$[43]!==minutesPlaceholder||$[44]!==onSubmitEditing||$[45]!==styles.input||$[46]!==t16||$[47]!==value.minutes||$[48]!==variant){t19=_jsx(NumberInputBase,{ref:minutesRef,disabled:disabled,placeholder:minutesPlaceholder,value:value.minutes,maxLength:2,clearButtonMode:clearButtonMode,variant:variant,keyboardType:"number-pad",returnKeyType:"done",inputStyle:styles.input,onChangeText:t16,onFocus:t17,onBlur:t18,onSubmitEditing:onSubmitEditing});$[41]=clearButtonMode;$[42]=disabled;$[43]=minutesPlaceholder;$[44]=onSubmitEditing;$[45]=styles.input;$[46]=t16;$[47]=value.minutes;$[48]=variant;$[49]=t19;}else{t19=$[49];}var t20;var t21;if($[50]===Symbol.for("react.memo_cache_sentinel")){t20=()=>minutesRef.current?.focus();t21=_jsx(Text,{variant:"body",children:"m"});$[50]=t20;$[51]=t21;}else{t20=$[50];t21=$[51];}var t22;if($[52]!==styles.timeLabel){t22=_jsx(Pressable,{style:styles.timeLabel,onPress:t20,children:t21});$[52]=styles.timeLabel;$[53]=t22;}else{t22=$[53];}var t23=disabled||!isFocused?"never":"always";var t24=value.hours!==""||value.minutes!==""?" ":"";var t25;if($[54]!==onChange){t25=()=>onChange?.({hours:"",minutes:""});$[54]=onChange;$[55]=t25;}else{t25=$[55];}var t26;if($[56]!==disabled||$[57]!==styles.clearInput||$[58]!==t23||$[59]!==t24||$[60]!==t25||$[61]!==variant){t26=_jsx(InputBase,{clearButtonMode:t23,value:t24,selectionColor:"transparent",focusable:false,autoComplete:"off",variant:variant,caretHidden:true,contextMenuHidden:true,disabled:disabled,showSoftInputOnFocus:false,inputStyle:styles.clearInput,onFocus:t25});$[56]=disabled;$[57]=styles.clearInput;$[58]=t23;$[59]=t24;$[60]=t25;$[61]=variant;$[62]=t26;}else{t26=$[62];}var t27;if($[63]!==disabled||$[64]!==t12||$[65]!==t15||$[66]!==t19||$[67]!==t22||$[68]!==t26||$[69]!==t6){t27=_jsxs(InputRowContainer,{disabled:disabled,children:[t6,t12,t15,t19,t22,t26]});$[63]=disabled;$[64]=t12;$[65]=t15;$[66]=t19;$[67]=t22;$[68]=t26;$[69]=t6;$[70]=t27;}else{t27=$[70];}var t28;if($[71]!==baseProps||$[72]!==t27){t28=_jsx(InputScaffold,{...baseProps,children:t27});$[71]=baseProps;$[72]=t27;$[73]=t28;}else{t28=$[73];}return t28;};var createStyles=({styles:{inputBase}},{variant})=>StyleSheet.create({input:{flexGrow:1,flexBasis:0,textAlign:"right"},clearInput:{flexShrink:1,marginLeft:inputBase.container.padding},timeLabel:{height:inputBase.container.height[variant],justifyContent:"center"}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.ToggleInput=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _reactNative=require("react-native");var _hooks=require("../../hooks");var _action=require("../action");var _icon=require("../icon");var _text=require("../text");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["label","helpText","value","toggleVariant","containerStyle","variant","disabled","styles","onChange"];var ToggleInput=exports.ToggleInput=(0,_icon.withIcon)(_ref=>{var label=_ref.label,helpText=_ref.helpText,_ref$value=_ref.value,value=_ref$value===void 0?false:_ref$value,_ref$toggleVariant=_ref.toggleVariant,toggleVariant=_ref$toggleVariant===void 0?"primary":_ref$toggleVariant,containerStyle=_ref.containerStyle,_ref$variant=_ref.variant,variant=_ref$variant===void 0?"regular":_ref$variant,disabledProp=_ref.disabled,styleOverrides=_ref.styles,onChange=_ref.onChange,iconProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var disabled=disabledProp||!onChange;var _useThemedStyles=(0,_hooks.useThemedStyles)("toggleInput",createStyles,{styles:{toggleInput:styleOverrides},props:{variant}}),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,2),styles=_useThemedStyles2[0],_useThemedStyles2$=_useThemedStyles2[1],toggleInput=_useThemedStyles2$.style,icons=_useThemedStyles2$.icons;return(0,_jsxRuntime.jsx)(_action.ActionBase,{disabled:disabled,containerStyle:[styles.container,containerStyle],onPress:()=>onChange(!value),children:pressableState=>(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.labelIconContainer,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.iconContainer,children:[(0,_jsxRuntime.jsx)(_icon.InteractiveIcon,Object.assign({},icons.outline,{style:{size:toggleInput.indicator.size[variant],color:value?toggleInput.indicator.color.selected[toggleVariant]:toggleInput.indicator.color.deselected},disabled:disabled},pressableState)),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.icon,children:!!value&&(0,_jsxRuntime.jsx)(_icon.InteractiveIcon,Object.assign({},iconProps,{style:{size:toggleInput.indicator.size[variant],color:toggleInput.indicator.color.selected[toggleVariant]},disabled:disabled},pressableState))})]}),label&&(0,_jsxRuntime.jsx)(_text.Text,{variant:"label",disabled:disabled,children:label})]}),helpText&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.helpText,children:typeof helpText==="string"?(0,_jsxRuntime.jsx)(_text.Text,{variant:"caption",children:helpText}):helpText})]})});});var createStyles=(_ref2,_ref3)=>{var _ref2$styles=_ref2.styles,toggleInput=_ref2$styles.toggleInput,inputScaffold=_ref2$styles.inputScaffold;var variant=_ref3.variant;var styles=_reactNative.StyleSheet.create({container:{justifyContent:"center"},labelIconContainer:{flexDirection:"row",alignItems:"center",gap:toggleInput.label.gap},iconContainer:{width:toggleInput.indicator.size[variant],height:toggleInput.indicator.size[variant]},icon:{position:"absolute",alignSelf:"center"},helpText:{marginLeft:toggleInput.indicator.size[variant]+toggleInput.label.gap,marginTop:inputScaffold.gap}});return styles;};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/ToggleInput.tsx";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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{ActionBase}from"../action";import{InteractiveIcon,withIcon}from"../icon";import{Text}from"../text";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export var ToggleInput=withIcon(({label,helpText,value=false,toggleVariant="primary",containerStyle,variant="regular",disabled:disabledProp,styles:styleOverrides,onChange,...iconProps})=>{var disabled=disabledProp||!onChange;var _useThemedStyles=useThemedStyles("toggleInput",createStyles,{styles:{toggleInput:styleOverrides},props:{variant}}),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],_useThemedStyles2$=_useThemedStyles2[1],toggleInput=_useThemedStyles2$.style,icons=_useThemedStyles2$.icons;return _jsx(ActionBase,{disabled:disabled,containerStyle:[styles.container,containerStyle],onPress:()=>onChange(!value),children:pressableState=>_jsxs(_Fragment,{children:[_jsxs(View,{style:styles.labelIconContainer,children:[_jsxs(View,{style:styles.iconContainer,children:[_jsx(InteractiveIcon,{...icons.outline,style:{size:toggleInput.indicator.size[variant],color:value?toggleInput.indicator.color.selected[toggleVariant]:toggleInput.indicator.color.deselected},disabled:disabled,...pressableState}),_jsx(View,{style:styles.icon,children:!!value&&_jsx(InteractiveIcon,{...iconProps,style:{size:toggleInput.indicator.size[variant],color:toggleInput.indicator.color.selected[toggleVariant]},disabled:disabled,...pressableState})})]}),label&&_jsx(Text,{variant:"label",disabled:disabled,children:label})]}),helpText&&_jsx(View,{style:styles.helpText,children:typeof helpText==="string"?_jsx(Text,{variant:"caption",children:helpText}):helpText})]})});});var createStyles=({styles:{toggleInput,inputScaffold}},{variant})=>{var styles=StyleSheet.create({container:{justifyContent:"center"},labelIconContainer:{flexDirection:"row",alignItems:"center",gap:toggleInput.label.gap},iconContainer:{width:toggleInput.indicator.size[variant],height:toggleInput.indicator.size[variant]},icon:{position:"absolute",alignSelf:"center"},helpText:{marginLeft:toggleInput.indicator.size[variant]+toggleInput.label.gap,marginTop:inputScaffold.gap}});return styles;};
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"CounterInput",{enumerable:true,get:function(){return _CounterInput.CounterInput;}});Object.defineProperty(exports,"DropdownInput",{enumerable:true,get:function(){return _DropdownInput.DropdownInput;}});Object.defineProperty(exports,"DropdownInputBase",{enumerable:true,get:function(){return _DropdownInputBase.DropdownInputBase;}});Object.defineProperty(exports,"InputAction",{enumerable:true,get:function(){return _InputAction.InputAction;}});Object.defineProperty(exports,"InputBase",{enumerable:true,get:function(){return _InputBase.InputBase;}});Object.defineProperty(exports,"InputRowContainer",{enumerable:true,get:function(){return _InputRowContainer.InputRowContainer;}});Object.defineProperty(exports,"InputScaffold",{enumerable:true,get:function(){return _InputScaffold.InputScaffold;}});Object.defineProperty(exports,"NumberInput",{enumerable:true,get:function(){return _NumberInput.NumberInput;}});Object.defineProperty(exports,"RatingInput",{enumerable:true,get:function(){return _RatingInput.RatingInput;}});Object.defineProperty(exports,"SelectionInput",{enumerable:true,get:function(){return _SelectionInput.SelectionInput;}});Object.defineProperty(exports,"TextInput",{enumerable:true,get:function(){return _TextInput.TextInput;}});Object.defineProperty(exports,"TimeInput",{enumerable:true,get:function(){return _TimeInput.TimeInput;}});Object.defineProperty(exports,"ToggleInput",{enumerable:true,get:function(){return _ToggleInput.ToggleInput;}});var _CounterInput=require("./CounterInput");var _DropdownInput=require("./DropdownInput");var _DropdownInputBase=require("./DropdownInputBase");var _InputAction=require("./InputAction");var _InputBase=require("./InputBase");var _InputRowContainer=require("./InputRowContainer");var _InputScaffold=require("./InputScaffold");var _NumberInput=require("./NumberInput");var _RatingInput=require("./RatingInput");var _SelectionInput=require("./SelectionInput");var _TextInput=require("./TextInput");var _TimeInput=require("./TimeInput");var _ToggleInput=require("./ToggleInput");
1
+ export{CounterInput}from"./CounterInput";export{DropdownInput}from"./DropdownInput";export{DropdownInputBase}from"./DropdownInputBase";export{InputAction}from"./InputAction";export{InputBase}from"./InputBase";export{InputRowContainer}from"./InputRowContainer";export{InputScaffold}from"./InputScaffold";export{NumberInput}from"./NumberInput";export{RatingInput}from"./RatingInput";export{SelectionInput}from"./SelectionInput";export{TextInput}from"./TextInput";export{TimeInput}from"./TimeInput";export{ToggleInput}from"./ToggleInput";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.ListItem=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _esUtils=require("@reillymc/es-utils");var _hooks=require("../../hooks");var _container=require("../container");var _text=require("../text");var _jsxRuntime=require("react/jsx-runtime");var ListItem=t0=>{var $=(0,_compilerRuntime.c)(41);var avatar=t0.avatar,alert=t0.alert,heading=t0.heading,footer=t0.footer,header=t0.header,t1=t0.variant,t2=t0.contentRows,swipeActions=t0.swipeActions,style=t0.style,contentContainerStyle=t0.contentContainerStyle,onPress=t0.onPress;var variant=t1===undefined?"default":t1;var t3;if($[0]!==t2){t3=t2===undefined?[]:t2;$[0]=t2;$[1]=t3;}else{t3=$[1];}var contentRows=t3;var t4;if($[2]!==contentRows){t4=contentRows.filter(_esUtils.Undefined);$[2]=contentRows;$[3]=t4;}else{t4=$[3];}var filteredRows=t4;var t5;if($[4]!==swipeActions){t5=swipeActions?.filter(_esUtils.Undefined);$[4]=swipeActions;$[5]=t5;}else{t5=$[5];}var filteredActions=t5;var t6;if($[6]!==variant){t6={props:{variant}};$[6]=variant;$[7]=t6;}else{t6=$[7];}var _useThemedStyles=(0,_hooks.useThemedStyles)("listItem",createStyles,t6),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t7;if($[8]!==style||$[9]!==styles.pressableContainer){t7=[styles.pressableContainer,style];$[8]=style;$[9]=styles.pressableContainer;$[10]=t7;}else{t7=$[10];}var t8;if($[11]!==contentContainerStyle||$[12]!==styles.contentContainer){t8=[styles.contentContainer,contentContainerStyle];$[11]=contentContainerStyle;$[12]=styles.contentContainer;$[13]=t8;}else{t8=$[13];}var t9;if($[14]!==heading){t9=!!heading&&typeof heading==="string"?(0,_jsxRuntime.jsx)(_text.Text,{variant:"heading",numberOfLines:2,children:heading}):heading;$[14]=heading;$[15]=t9;}else{t9=$[15];}var t10;if($[16]!==filteredRows||$[17]!==t8||$[18]!==t9){t10=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:t8,children:[t9,filteredRows]});$[16]=filteredRows;$[17]=t8;$[18]=t9;$[19]=t10;}else{t10=$[19];}var t11;if($[20]!==avatar||$[21]!==styles.innerContainer||$[22]!==t10){t11=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.innerContainer,children:[avatar,t10]});$[20]=avatar;$[21]=styles.innerContainer;$[22]=t10;$[23]=t11;}else{t11=$[23];}var t12;if($[24]!==alert||$[25]!==styles.bodyContainer||$[26]!==t11){t12=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.bodyContainer,children:[t11,alert]});$[24]=alert;$[25]=styles.bodyContainer;$[26]=t11;$[27]=t12;}else{t12=$[27];}var t13;if($[28]!==footer||$[29]!==header||$[30]!==onPress||$[31]!==t12||$[32]!==t7){t13=(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:onPress,style:t7,children:[header,t12,footer]});$[28]=footer;$[29]=header;$[30]=onPress;$[31]=t12;$[32]=t7;$[33]=t13;}else{t13=$[33];}var innerContent=t13;var t14;if($[34]!==filteredActions?.length||$[35]!==innerContent||$[36]!==swipeActions){t14=filteredActions?.length?(0,_jsxRuntime.jsx)(_container.SwipeableContainer,{rightActions:swipeActions,children:(0,_jsxRuntime.jsx)(_reactNative.View,{children:innerContent})}):innerContent;$[34]=filteredActions?.length;$[35]=innerContent;$[36]=swipeActions;$[37]=t14;}else{t14=$[37];}var t15;if($[38]!==styles.container||$[39]!==t14){t15=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:t14});$[38]=styles.container;$[39]=t14;$[40]=t15;}else{t15=$[40];}return t15;};exports.ListItem=ListItem;var createStyles=(_ref,_ref2)=>{var listItem=_ref.styles.listItem,theme=_ref.theme;var variant=_ref2.variant;return _reactNative.StyleSheet.create({container:{backgroundColor:theme.color.background,borderRadius:variant==="compact"?undefined:listItem.borderRadius,overflow:"hidden",width:"100%"},pressableContainer:{display:"flex",flexDirection:"column",backgroundColor:theme.color.foreground,borderRadius:variant==="compact"?undefined:listItem.borderRadius},bodyContainer:{flexDirection:"row",justifyContent:"space-between"},innerContainer:{flexDirection:"row",flexShrink:1},contentContainer:{flexShrink:1,flexDirection:"column",alignItems:"flex-start",justifyContent:"center",width:"100%",padding:listItem.internalSpacing}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/listItem/ListItem.tsx";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{Pressable,StyleSheet,View}from"react-native";import{Undefined}from"@reillymc/es-utils";import{useThemedStyles}from"../../hooks";import{SwipeableContainer}from"../container";import{Text}from"../text";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var ListItem=t0=>{var $=_c(41);var avatar=t0.avatar,alert=t0.alert,heading=t0.heading,footer=t0.footer,header=t0.header,t1=t0.variant,t2=t0.contentRows,swipeActions=t0.swipeActions,style=t0.style,contentContainerStyle=t0.contentContainerStyle,onPress=t0.onPress;var variant=t1===undefined?"default":t1;var t3;if($[0]!==t2){t3=t2===undefined?[]:t2;$[0]=t2;$[1]=t3;}else{t3=$[1];}var contentRows=t3;var t4;if($[2]!==contentRows){t4=contentRows.filter(Undefined);$[2]=contentRows;$[3]=t4;}else{t4=$[3];}var filteredRows=t4;var t5;if($[4]!==swipeActions){t5=swipeActions?.filter(Undefined);$[4]=swipeActions;$[5]=t5;}else{t5=$[5];}var filteredActions=t5;var t6;if($[6]!==variant){t6={props:{variant}};$[6]=variant;$[7]=t6;}else{t6=$[7];}var _useThemedStyles=useThemedStyles("listItem",createStyles,t6),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t7;if($[8]!==style||$[9]!==styles.pressableContainer){t7=[styles.pressableContainer,style];$[8]=style;$[9]=styles.pressableContainer;$[10]=t7;}else{t7=$[10];}var t8;if($[11]!==contentContainerStyle||$[12]!==styles.contentContainer){t8=[styles.contentContainer,contentContainerStyle];$[11]=contentContainerStyle;$[12]=styles.contentContainer;$[13]=t8;}else{t8=$[13];}var t9;if($[14]!==heading){t9=!!heading&&typeof heading==="string"?_jsx(Text,{variant:"heading",numberOfLines:2,children:heading}):heading;$[14]=heading;$[15]=t9;}else{t9=$[15];}var t10;if($[16]!==filteredRows||$[17]!==t8||$[18]!==t9){t10=_jsxs(View,{style:t8,children:[t9,filteredRows]});$[16]=filteredRows;$[17]=t8;$[18]=t9;$[19]=t10;}else{t10=$[19];}var t11;if($[20]!==avatar||$[21]!==styles.innerContainer||$[22]!==t10){t11=_jsxs(View,{style:styles.innerContainer,children:[avatar,t10]});$[20]=avatar;$[21]=styles.innerContainer;$[22]=t10;$[23]=t11;}else{t11=$[23];}var t12;if($[24]!==alert||$[25]!==styles.bodyContainer||$[26]!==t11){t12=_jsxs(View,{style:styles.bodyContainer,children:[t11,alert]});$[24]=alert;$[25]=styles.bodyContainer;$[26]=t11;$[27]=t12;}else{t12=$[27];}var t13;if($[28]!==footer||$[29]!==header||$[30]!==onPress||$[31]!==t12||$[32]!==t7){t13=_jsxs(Pressable,{onPress:onPress,style:t7,children:[header,t12,footer]});$[28]=footer;$[29]=header;$[30]=onPress;$[31]=t12;$[32]=t7;$[33]=t13;}else{t13=$[33];}var innerContent=t13;var t14;if($[34]!==filteredActions?.length||$[35]!==innerContent||$[36]!==swipeActions){t14=filteredActions?.length?_jsx(SwipeableContainer,{rightActions:swipeActions,children:_jsx(View,{children:innerContent})}):innerContent;$[34]=filteredActions?.length;$[35]=innerContent;$[36]=swipeActions;$[37]=t14;}else{t14=$[37];}var t15;if($[38]!==styles.container||$[39]!==t14){t15=_jsx(View,{style:styles.container,children:t14});$[38]=styles.container;$[39]=t14;$[40]=t15;}else{t15=$[40];}return t15;};var createStyles=({styles:{listItem},theme},{variant})=>StyleSheet.create({container:{backgroundColor:theme.color.background,borderRadius:variant==="compact"?undefined:listItem.borderRadius,overflow:"hidden",width:"100%"},pressableContainer:{display:"flex",flexDirection:"column",backgroundColor:theme.color.foreground,borderRadius:variant==="compact"?undefined:listItem.borderRadius},bodyContainer:{flexDirection:"row",justifyContent:"space-between"},innerContainer:{flexDirection:"row",flexShrink:1},contentContainer:{flexShrink:1,flexDirection:"column",alignItems:"flex-start",justifyContent:"center",width:"100%",padding:listItem.internalSpacing}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.ListItemAlert=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _jsxRuntime=require("react/jsx-runtime");var ListItemAlert=t0=>{var $=(0,_compilerRuntime.c)(3);var children=t0.children;var _useThemedStyles=(0,_hooks.useThemedStyles)("listItem",createStyles),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==children||$[1]!==styles.alert){t1=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.alert,children:children});$[0]=children;$[1]=styles.alert;$[2]=t1;}else{t1=$[2];}return t1;};exports.ListItemAlert=ListItemAlert;var createStyles=_ref=>{var listItem=_ref.styles.listItem;return _reactNative.StyleSheet.create({alert:{alignItems:"center",justifyContent:"center",marginLeft:listItem.spacingMargin,marginRight:listItem.internalSpacing}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/listItem/ListItemAlert.tsx";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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";export var ListItemAlert=t0=>{var $=_c(3);var children=t0.children;var _useThemedStyles=useThemedStyles("listItem",createStyles),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==children||$[1]!==styles.alert){t1=_jsx(View,{style:styles.alert,children:children});$[0]=children;$[1]=styles.alert;$[2]=t1;}else{t1=$[2];}return t1;};var createStyles=({styles:{listItem}})=>StyleSheet.create({alert:{alignItems:"center",justifyContent:"center",marginLeft:listItem.spacingMargin,marginRight:listItem.internalSpacing}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.ListItemAvatar=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _jsxRuntime=require("react/jsx-runtime");var ListItemAvatar=t0=>{var $=(0,_compilerRuntime.c)(3);var children=t0.children;var _useThemedStyles=(0,_hooks.useThemedStyles)("listItem",createStyles),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==children||$[1]!==styles.avatar){t1=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.avatar,children:children});$[0]=children;$[1]=styles.avatar;$[2]=t1;}else{t1=$[2];}return t1;};exports.ListItemAvatar=ListItemAvatar;var createStyles=_ref=>{var listItem=_ref.styles.listItem;return _reactNative.StyleSheet.create({avatar:{alignItems:"center",justifyContent:"center",marginLeft:listItem.internalSpacing}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/listItem/ListItemAvatar.tsx";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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";export var ListItemAvatar=t0=>{var $=_c(3);var children=t0.children;var _useThemedStyles=useThemedStyles("listItem",createStyles),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==children||$[1]!==styles.avatar){t1=_jsx(View,{style:styles.avatar,children:children});$[0]=children;$[1]=styles.avatar;$[2]=t1;}else{t1=$[2];}return t1;};var createStyles=({styles:{listItem}})=>StyleSheet.create({avatar:{alignItems:"center",justifyContent:"center",marginLeft:listItem.internalSpacing}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.ListItemFooter=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _jsxRuntime=require("react/jsx-runtime");var ListItemFooter=t0=>{var $=(0,_compilerRuntime.c)(3);var children=t0.children;var _useThemedStyles=(0,_hooks.useThemedStyles)("listItem",createStyles),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==children||$[1]!==styles.footer){t1=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.footer,children:children});$[0]=children;$[1]=styles.footer;$[2]=t1;}else{t1=$[2];}return t1;};exports.ListItemFooter=ListItemFooter;var createStyles=_ref=>{var listItem=_ref.styles.listItem;return _reactNative.StyleSheet.create({footer:{display:"flex",marginBottom:listItem.internalSpacing,marginLeft:listItem.internalSpacing,marginRight:listItem.internalSpacing}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/listItem/ListItemFooter.tsx";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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";export var ListItemFooter=t0=>{var $=_c(3);var children=t0.children;var _useThemedStyles=useThemedStyles("listItem",createStyles),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==children||$[1]!==styles.footer){t1=_jsx(View,{style:styles.footer,children:children});$[0]=children;$[1]=styles.footer;$[2]=t1;}else{t1=$[2];}return t1;};var createStyles=({styles:{listItem}})=>StyleSheet.create({footer:{display:"flex",marginBottom:listItem.internalSpacing,marginLeft:listItem.internalSpacing,marginRight:listItem.internalSpacing}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.ListItemRow=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _text=require("../text");var _jsxRuntime=require("react/jsx-runtime");var ListItemRow=t0=>{var $=(0,_compilerRuntime.c)(13);var contentItems=t0.contentItems;var _useThemedStyles=(0,_hooks.useThemedStyles)("listItem",createStyles),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==contentItems){t1=Array.isArray(contentItems)?contentItems:[contentItems];$[0]=contentItems;$[1]=t1;}else{t1=$[1];}var items=t1;var t2=styles.contentItem;var t3;if($[2]!==items||$[3]!==styles.contentItem||$[4]!==styles.spacer){var _t;if($[6]!==items.length||$[7]!==styles.contentItem||$[8]!==styles.spacer){_t=(item,index)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.contentItem,children:[item,index<items.length-1&&(0,_jsxRuntime.jsx)(_text.Text,{style:styles.spacer,children:"\xB7"})]},item?.key);$[6]=items.length;$[7]=styles.contentItem;$[8]=styles.spacer;$[9]=_t;}else{_t=$[9];}t3=items.map(_t);$[2]=items;$[3]=styles.contentItem;$[4]=styles.spacer;$[5]=t3;}else{t3=$[5];}var t4;if($[10]!==styles.contentItem||$[11]!==t3){t4=(0,_jsxRuntime.jsx)(_reactNative.View,{style:t2,children:t3});$[10]=styles.contentItem;$[11]=t3;$[12]=t4;}else{t4=$[12];}return t4;};exports.ListItemRow=ListItemRow;var createStyles=_ref=>{var listItem=_ref.styles.listItem;return _reactNative.StyleSheet.create({contentItem:{flexDirection:"row",flexShrink:1},spacer:{marginHorizontal:listItem.contentItemSpacing}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/listItem/ListItemRow.tsx";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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{Text}from"../text";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var ListItemRow=t0=>{var $=_c(13);var contentItems=t0.contentItems;var _useThemedStyles=useThemedStyles("listItem",createStyles),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t1;if($[0]!==contentItems){t1=Array.isArray(contentItems)?contentItems:[contentItems];$[0]=contentItems;$[1]=t1;}else{t1=$[1];}var items=t1;var t2=styles.contentItem;var t3;if($[2]!==items||$[3]!==styles.contentItem||$[4]!==styles.spacer){var _t;if($[6]!==items.length||$[7]!==styles.contentItem||$[8]!==styles.spacer){_t=(item,index)=>_jsxs(View,{style:styles.contentItem,children:[item,index<items.length-1&&_jsx(Text,{style:styles.spacer,children:"\xB7"})]},item?.key);$[6]=items.length;$[7]=styles.contentItem;$[8]=styles.spacer;$[9]=_t;}else{_t=$[9];}t3=items.map(_t);$[2]=items;$[3]=styles.contentItem;$[4]=styles.spacer;$[5]=t3;}else{t3=$[5];}var t4;if($[10]!==styles.contentItem||$[11]!==t3){t4=_jsx(View,{style:t2,children:t3});$[10]=styles.contentItem;$[11]=t3;$[12]=t4;}else{t4=$[12];}return t4;};var createStyles=({styles:{listItem}})=>StyleSheet.create({contentItem:{flexDirection:"row",flexShrink:1},spacer:{marginHorizontal:listItem.contentItemSpacing}});
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"ListItem",{enumerable:true,get:function(){return _ListItem.ListItem;}});Object.defineProperty(exports,"ListItemAlert",{enumerable:true,get:function(){return _ListItemAlert.ListItemAlert;}});Object.defineProperty(exports,"ListItemAvatar",{enumerable:true,get:function(){return _ListItemAvatar.ListItemAvatar;}});Object.defineProperty(exports,"ListItemFooter",{enumerable:true,get:function(){return _ListItemFooter.ListItemFooter;}});Object.defineProperty(exports,"ListItemRow",{enumerable:true,get:function(){return _ListItemRow.ListItemRow;}});var _ListItem=require("./ListItem");var _ListItemAlert=require("./ListItemAlert");var _ListItemAvatar=require("./ListItemAvatar");var _ListItemFooter=require("./ListItemFooter");var _ListItemRow=require("./ListItemRow");
1
+ export{ListItem}from"./ListItem";export{ListItemAlert}from"./ListItemAlert";export{ListItemAvatar}from"./ListItemAvatar";export{ListItemFooter}from"./ListItemFooter";export{ListItemRow}from"./ListItemRow";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.Menu=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _jsxRuntime=require("react/jsx-runtime");var Menu=t0=>{var $=(0,_compilerRuntime.c)(10);var style=t0.style,reverse=t0.reverse,children=t0.children;var t1;if($[0]!==style){t1={styles:{menu:style}};$[0]=style;$[1]=t1;}else{t1=$[1];}var _useThemedStyles=(0,_hooks.useThemedStyles)("menu",createStyles,t1),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t2=reverse?"column-reverse":"column";var t3;if($[2]!==t2){t3={flexDirection:t2};$[2]=t2;$[3]=t3;}else{t3=$[3];}var t4;if($[4]!==styles.container||$[5]!==t3){t4=[styles.container,t3];$[4]=styles.container;$[5]=t3;$[6]=t4;}else{t4=$[6];}var t5;if($[7]!==children||$[8]!==t4){t5=(0,_jsxRuntime.jsx)(_reactNative.View,{style:t4,children:children});$[7]=children;$[8]=t4;$[9]=t5;}else{t5=$[9];}return t5;};exports.Menu=Menu;var createStyles=_ref=>{var menu=_ref.styles.menu;var styles=_reactNative.StyleSheet.create({container:{backgroundColor:menu.backgroundColor,borderRadius:menu.borderRadius,padding:menu.padding,gap:menu.gap}});return styles;};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/menu/Menu.tsx";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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";export var Menu=t0=>{var $=_c(10);var style=t0.style,reverse=t0.reverse,children=t0.children;var t1;if($[0]!==style){t1={styles:{menu:style}};$[0]=style;$[1]=t1;}else{t1=$[1];}var _useThemedStyles=useThemedStyles("menu",createStyles,t1),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t2=reverse?"column-reverse":"column";var t3;if($[2]!==t2){t3={flexDirection:t2};$[2]=t2;$[3]=t3;}else{t3=$[3];}var t4;if($[4]!==styles.container||$[5]!==t3){t4=[styles.container,t3];$[4]=styles.container;$[5]=t3;$[6]=t4;}else{t4=$[6];}var t5;if($[7]!==children||$[8]!==t4){t5=_jsx(View,{style:t4,children:children});$[7]=children;$[8]=t4;$[9]=t5;}else{t5=$[9];}return t5;};var createStyles=({styles:{menu}})=>{var styles=StyleSheet.create({container:{backgroundColor:menu.backgroundColor,borderRadius:menu.borderRadius,padding:menu.padding,gap:menu.gap}});return styles;};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.MenuItem=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _text=require("../text");var _jsxRuntime=require("react/jsx-runtime");var MenuItem=t0=>{var $=(0,_compilerRuntime.c)(14);var label=t0.label,description=t0.description,searchValue=t0.searchValue,onPress=t0.onPress;var _useTheme=(0,_hooks.useTheme)(),t1=_useTheme.theme;var color=t1.color;var _useThemedStyles=(0,_hooks.useThemedStyles)("menuItem",createStyles),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t2;if($[0]!==color||$[1]!==styles.dropdownItem){t2=t3=>{var pressed=t3.pressed;return[styles.dropdownItem,pressed&&{backgroundColor:color.pressOverlay}];};$[0]=color;$[1]=styles.dropdownItem;$[2]=t2;}else{t2=$[2];}var t3;if($[3]!==label||$[4]!==searchValue){t3=(0,_jsxRuntime.jsx)(_text.HighlightedText,{text:label,highlight:searchValue});$[3]=label;$[4]=searchValue;$[5]=t3;}else{t3=$[5];}var t4;if($[6]!==description||$[7]!==searchValue){t4=!!description&&(0,_jsxRuntime.jsx)(_text.HighlightedText,{variant:"caption",text:description,highlight:searchValue});$[6]=description;$[7]=searchValue;$[8]=t4;}else{t4=$[8];}var t5;if($[9]!==onPress||$[10]!==t2||$[11]!==t3||$[12]!==t4){t5=(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:onPress,style:t2,children:[t3,t4]});$[9]=onPress;$[10]=t2;$[11]=t3;$[12]=t4;$[13]=t5;}else{t5=$[13];}return t5;};exports.MenuItem=MenuItem;MenuItem.displayName="MenuItem";var createStyles=_ref=>{var menuItem=_ref.styles.menuItem;return _reactNative.StyleSheet.create({dropdownItem:menuItem});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/menu/MenuItem.tsx";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{Pressable,StyleSheet}from"react-native";import{useTheme,useThemedStyles}from"../../hooks";import{HighlightedText}from"../text";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var MenuItem=t0=>{var $=_c(14);var label=t0.label,description=t0.description,searchValue=t0.searchValue,onPress=t0.onPress;var _useTheme=useTheme(),t1=_useTheme.theme;var color=t1.color;var _useThemedStyles=useThemedStyles("menuItem",createStyles),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t2;if($[0]!==color||$[1]!==styles.dropdownItem){t2=t3=>{var pressed=t3.pressed;return[styles.dropdownItem,pressed&&{backgroundColor:color.pressOverlay}];};$[0]=color;$[1]=styles.dropdownItem;$[2]=t2;}else{t2=$[2];}var t3;if($[3]!==label||$[4]!==searchValue){t3=_jsx(HighlightedText,{text:label,highlight:searchValue});$[3]=label;$[4]=searchValue;$[5]=t3;}else{t3=$[5];}var t4;if($[6]!==description||$[7]!==searchValue){t4=!!description&&_jsx(HighlightedText,{variant:"caption",text:description,highlight:searchValue});$[6]=description;$[7]=searchValue;$[8]=t4;}else{t4=$[8];}var t5;if($[9]!==onPress||$[10]!==t2||$[11]!==t3||$[12]!==t4){t5=_jsxs(Pressable,{onPress:onPress,style:t2,children:[t3,t4]});$[9]=onPress;$[10]=t2;$[11]=t3;$[12]=t4;$[13]=t5;}else{t5=$[13];}return t5;};MenuItem.displayName="MenuItem";var createStyles=({styles:{menuItem}})=>StyleSheet.create({dropdownItem:menuItem});
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Menu",{enumerable:true,get:function(){return _Menu.Menu;}});Object.defineProperty(exports,"MenuItem",{enumerable:true,get:function(){return _MenuItem.MenuItem;}});var _Menu=require("./Menu");var _MenuItem=require("./MenuItem");
1
+ export{Menu}from"./Menu";export{MenuItem}from"./MenuItem";
@@ -0,0 +1 @@
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/rating/Rating.tsx";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{StyleSheet,View}from"react-native";import{useThemedStyles}from"../../hooks";import{IconBase}from"../icon";import{getRatingIcons,valueToRating}from"./ratingUtils";import{jsx as _jsx}from"react/jsx-runtime";export var Rating=t0=>{var $=_c(16);var t1=t0.value,t2=t0.max,scale=t0.scale,styleOverrides=t0.style,containerStyle=t0.containerStyle;var value=t1===undefined?0:t1;var max=t2===undefined?5:t2;var t3;if($[0]!==styleOverrides){t3={styles:{rating:styleOverrides}};$[0]=styleOverrides;$[1]=t3;}else{t3=$[1];}var _useThemedStyles=useThemedStyles("rating",createStyles,t3),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],t4=_useThemedStyles2[1];var style=t4.style,icons=t4.icons;var t5;if($[2]!==containerStyle||$[3]!==icons||$[4]!==max||$[5]!==scale||$[6]!==style||$[7]!==styles.starRating||$[8]!==value){var scaledRating=scale?valueToRating(value,max,scale):value;var t6;if($[10]!==containerStyle||$[11]!==styles.starRating){t6=[styles.starRating,containerStyle];$[10]=containerStyle;$[11]=styles.starRating;$[12]=t6;}else{t6=$[12];}var t7;if($[13]!==icons||$[14]!==style){t7=(variant,i)=>_jsx(IconBase,{...icons[variant],style:{size:style.icon.size,color:style.icon.color[variant]}},i);$[13]=icons;$[14]=style;$[15]=t7;}else{t7=$[15];}t5=_jsx(View,{style:t6,accessibilityLabel:`star rating. ${scaledRating} of ${max}.`,children:getRatingIcons(scaledRating,max).map(t7)});$[2]=containerStyle;$[3]=icons;$[4]=max;$[5]=scale;$[6]=style;$[7]=styles.starRating;$[8]=value;$[9]=t5;}else{t5=$[9];}return t5;};var createStyles=({styles:{rating}})=>StyleSheet.create({starRating:{flexDirection:"row",gap:rating.gap}});
@@ -0,0 +1 @@
1
+ export{Rating}from"./Rating";export{getRatingIcons,ratingToValue,valueToRating}from"./ratingUtils";
@@ -0,0 +1 @@
1
+ export var valueToRating=(rating,starCount,scale)=>rating/scale*starCount;export var ratingToValue=(stars,starCount,scale)=>stars*scale/starCount;export var getRatingIcons=(rating,maxRating)=>[...Array(maxRating)].map((_,i)=>{if(rating-i>=1){return"full";}return rating-i>=0.5?"half":"empty";});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.Tag=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _text=require("../text");var _jsxRuntime=require("react/jsx-runtime");var Tag=t0=>{var $=(0,_compilerRuntime.c)(15);var label=t0.label,onPress=t0.onPress,icon=t0.icon,variant=t0.variant,style=t0.style;var t1;if($[0]!==label||$[1]!==variant){t1={props:{variant,label}};$[0]=label;$[1]=variant;$[2]=t1;}else{t1=$[2];}var _useThemedStyles=(0,_hooks.useThemedStyles)("tag",createStyles,t1),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t2=!onPress;var t3;if($[3]!==style||$[4]!==styles.container){t3=[styles.container,style];$[3]=style;$[4]=styles.container;$[5]=t3;}else{t3=$[5];}var t4;if($[6]!==label||$[7]!==styles.text){t4=(0,_jsxRuntime.jsx)(_text.Text,{style:styles.text,children:label});$[6]=label;$[7]=styles.text;$[8]=t4;}else{t4=$[8];}var t5;if($[9]!==icon||$[10]!==onPress||$[11]!==t2||$[12]!==t3||$[13]!==t4){t5=(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{disabled:t2,onPress:onPress,style:t3,children:[icon,t4]});$[9]=icon;$[10]=onPress;$[11]=t2;$[12]=t3;$[13]=t4;$[14]=t5;}else{t5=$[14];}return t5;};exports.Tag=Tag;var createStyles=(_ref,_ref2)=>{var color=_ref.theme.color,tag=_ref.styles.tag;var _ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?"dark":_ref2$variant;var styles=_reactNative.StyleSheet.create({container:{display:"flex",flexDirection:"row",alignItems:"center",borderRadius:tag.borderRadius,padding:tag.padding,backgroundColor:variant==="dark"?color.background:color.foreground,width:"auto",gap:tag.internalSpacing},text:{color:color.textPrimary}});return styles;};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/tag/Tag.tsx";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{Pressable,StyleSheet}from"react-native";import{useThemedStyles}from"../../hooks";import{Text}from"../text";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var Tag=t0=>{var $=_c(15);var label=t0.label,onPress=t0.onPress,icon=t0.icon,variant=t0.variant,style=t0.style;var t1;if($[0]!==label||$[1]!==variant){t1={props:{variant,label}};$[0]=label;$[1]=variant;$[2]=t1;}else{t1=$[2];}var _useThemedStyles=useThemedStyles("tag",createStyles,t1),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t2=!onPress;var t3;if($[3]!==style||$[4]!==styles.container){t3=[styles.container,style];$[3]=style;$[4]=styles.container;$[5]=t3;}else{t3=$[5];}var t4;if($[6]!==label||$[7]!==styles.text){t4=_jsx(Text,{style:styles.text,children:label});$[6]=label;$[7]=styles.text;$[8]=t4;}else{t4=$[8];}var t5;if($[9]!==icon||$[10]!==onPress||$[11]!==t2||$[12]!==t3||$[13]!==t4){t5=_jsxs(Pressable,{disabled:t2,onPress:onPress,style:t3,children:[icon,t4]});$[9]=icon;$[10]=onPress;$[11]=t2;$[12]=t3;$[13]=t4;$[14]=t5;}else{t5=$[14];}return t5;};var createStyles=({theme:{color},styles:{tag}},{variant="dark"})=>{var styles=StyleSheet.create({container:{display:"flex",flexDirection:"row",alignItems:"center",borderRadius:tag.borderRadius,padding:tag.padding,backgroundColor:variant==="dark"?color.background:color.foreground,width:"auto",gap:tag.internalSpacing},text:{color:color.textPrimary}});return styles;};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.TagIcon=void 0;var _objectDestructuringEmpty2=_interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));var _hooks=require("../../hooks");var _icon=require("../icon");var _jsxRuntime=require("react/jsx-runtime");var TagIcon=exports.TagIcon=(0,_icon.withIcon)(_ref=>{var iconProps=Object.assign({},((0,_objectDestructuringEmpty2.default)(_ref),_ref));var _useTheme=(0,_hooks.useTheme)(),theme=_useTheme.theme,styles=_useTheme.styles;return(0,_jsxRuntime.jsx)(_icon.IconBase,Object.assign({},iconProps,{style:{color:theme.color.textPrimary,size:styles.text.font.body.size}}));});
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/tag/TagIcon.tsx";import{useTheme}from"../../hooks";import{IconBase,withIcon}from"../icon";import{jsx as _jsx}from"react/jsx-runtime";export var TagIcon=withIcon(({...iconProps})=>{var _useTheme=useTheme(),theme=_useTheme.theme,styles=_useTheme.styles;return _jsx(IconBase,{...iconProps,style:{color:theme.color.textPrimary,size:styles.text.font.body.size}});});
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Tag",{enumerable:true,get:function(){return _Tag.Tag;}});Object.defineProperty(exports,"TagIcon",{enumerable:true,get:function(){return _TagIcon.TagIcon;}});var _Tag=require("./Tag");var _TagIcon=require("./TagIcon");
1
+ export{Tag}from"./Tag";export{TagIcon}from"./TagIcon";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.HighlightedText=exports.EscapeForRegexProcessing=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _Text=require("./Text");var _react=require("react");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["text","highlight","textStyles","style","variant"];var EscapeForRegexProcessing=string=>string.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");exports.EscapeForRegexProcessing=EscapeForRegexProcessing;var HighlightedText=t0=>{var $=(0,_compilerRuntime.c)(27);var props;var styleOverrides;var t1;var t2;var t3;var textStyles;if($[0]!==t0){var _t=t0;t1=_t.text;t2=_t.highlight;textStyles=_t.textStyles;styleOverrides=_t.style;t3=_t.variant;props=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=props;$[2]=styleOverrides;$[3]=t1;$[4]=t2;$[5]=t3;$[6]=textStyles;}else{props=$[1];styleOverrides=$[2];t1=$[3];t2=$[4];t3=$[5];textStyles=$[6];}var text=t1===undefined?"":t1;var highlight=t2===undefined?"":t2;var variant=t3===undefined?"body":t3;var t4;if($[7]!==styleOverrides){t4={styles:{highlightedText:styleOverrides}};$[7]=styleOverrides;$[8]=t4;}else{t4=$[8];}var _useThemedStyles=(0,_hooks.useThemedStyles)("highlightedText",createStyles,t4),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var style=t5.style;var t6;if($[9]!==highlight){t6=EscapeForRegexProcessing(highlight.toLowerCase());$[9]=highlight;$[10]=t6;}else{t6=$[10];}var highlightedString=t6;var t7;if($[11]!==highlightedString||$[12]!==props||$[13]!==style||$[14]!==styles.textWrapper||$[15]!==text||$[16]!==textStyles||$[17]!==variant){var parts=text.split(new RegExp(`(${highlightedString})`,"gi"));var t8;if($[19]!==styles.textWrapper||$[20]!==textStyles){t8=[styles.textWrapper,textStyles];$[19]=styles.textWrapper;$[20]=textStyles;$[21]=t8;}else{t8=$[21];}var t9;if($[22]!==highlightedString||$[23]!==props||$[24]!==style||$[25]!==variant){t9=(part,idx)=>(0,_react.createElement)(_Text.Text,Object.assign({},props,{variant:variant,key:`${part}${idx}`,style:part.toLowerCase()===highlightedString&&{fontWeight:style.highlightedWeight[variant]}}),part);$[22]=highlightedString;$[23]=props;$[24]=style;$[25]=variant;$[26]=t9;}else{t9=$[26];}t7=(0,_jsxRuntime.jsx)(_Text.Text,{style:t8,children:parts.map(t9)});$[11]=highlightedString;$[12]=props;$[13]=style;$[14]=styles.textWrapper;$[15]=text;$[16]=textStyles;$[17]=variant;$[18]=t7;}else{t7=$[18];}return t7;};exports.HighlightedText=HighlightedText;var createStyles=()=>_reactNative.StyleSheet.create({textWrapper:{display:"flex",flexDirection:"row"}});
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/text/HighlightedText.tsx";var _excluded=["text","highlight","textStyles","style","variant"];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{StyleSheet}from"react-native";import{useThemedStyles}from"../../hooks";import{Text}from"./Text";import{createElement as _createElement}from"react";import{jsx as _jsx}from"react/jsx-runtime";export var EscapeForRegexProcessing=string=>string.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");export var HighlightedText=t0=>{var $=_c(27);var props;var styleOverrides;var t1;var t2;var t3;var textStyles;if($[0]!==t0){t1=t0.text;t2=t0.highlight;textStyles=t0.textStyles;styleOverrides=t0.style;t3=t0.variant;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=props;$[2]=styleOverrides;$[3]=t1;$[4]=t2;$[5]=t3;$[6]=textStyles;}else{props=$[1];styleOverrides=$[2];t1=$[3];t2=$[4];t3=$[5];textStyles=$[6];}var text=t1===undefined?"":t1;var highlight=t2===undefined?"":t2;var variant=t3===undefined?"body":t3;var t4;if($[7]!==styleOverrides){t4={styles:{highlightedText:styleOverrides}};$[7]=styleOverrides;$[8]=t4;}else{t4=$[8];}var _useThemedStyles=useThemedStyles("highlightedText",createStyles,t4),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var style=t5.style;var t6;if($[9]!==highlight){t6=EscapeForRegexProcessing(highlight.toLowerCase());$[9]=highlight;$[10]=t6;}else{t6=$[10];}var highlightedString=t6;var t7;if($[11]!==highlightedString||$[12]!==props||$[13]!==style||$[14]!==styles.textWrapper||$[15]!==text||$[16]!==textStyles||$[17]!==variant){var parts=text.split(new RegExp(`(${highlightedString})`,"gi"));var t8;if($[19]!==styles.textWrapper||$[20]!==textStyles){t8=[styles.textWrapper,textStyles];$[19]=styles.textWrapper;$[20]=textStyles;$[21]=t8;}else{t8=$[21];}var t9;if($[22]!==highlightedString||$[23]!==props||$[24]!==style||$[25]!==variant){t9=(part,idx)=>_createElement(Text,{...props,variant:variant,key:`${part}${idx}`,style:part.toLowerCase()===highlightedString&&{fontWeight:style.highlightedWeight[variant]},__self:this,__source:{fileName:_jsxFileName,lineNumber:46,columnNumber:17}},part);$[22]=highlightedString;$[23]=props;$[24]=style;$[25]=variant;$[26]=t9;}else{t9=$[26];}t7=_jsx(Text,{style:t8,children:parts.map(t9)});$[11]=highlightedString;$[12]=props;$[13]=style;$[14]=styles.textWrapper;$[15]=text;$[16]=textStyles;$[17]=variant;$[18]=t7;}else{t7=$[18];}return t7;};var createStyles=()=>StyleSheet.create({textWrapper:{display:"flex",flexDirection:"row"}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.InteractiveText=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _Text=require("./Text");var _jsxRuntime=require("react/jsx-runtime");var InteractiveText=t0=>{var $=(0,_compilerRuntime.c)(17);var pressed=t0.pressed,styleOverrides=t0.style,textVariant=t0.textVariant,children=t0.children,t1=t0.disabled;var disabled=t1===undefined?false:t1;var t2;if($[0]!==styleOverrides){t2={interactiveText:styleOverrides};$[0]=styleOverrides;$[1]=t2;}else{t2=$[1];}var t3;if($[2]!==disabled){t3={disabled};$[2]=disabled;$[3]=t3;}else{t3=$[3];}var t4;if($[4]!==t2||$[5]!==t3){t4={styles:t2,props:t3};$[4]=t2;$[5]=t3;$[6]=t4;}else{t4=$[6];}var _useThemedStyles=(0,_hooks.useThemedStyles)("interactiveText",createStyles,t4),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var style=t5.style;var t6;if($[7]!==pressed||$[8]!==style){t6=pressed&&{color:style.color.pressed};$[7]=pressed;$[8]=style;$[9]=t6;}else{t6=$[9];}var t7;if($[10]!==styles.label||$[11]!==t6){t7=[styles.label,t6];$[10]=styles.label;$[11]=t6;$[12]=t7;}else{t7=$[12];}var t8;if($[13]!==children||$[14]!==t7||$[15]!==textVariant){t8=(0,_jsxRuntime.jsx)(_Text.Text,{numberOfLines:1,variant:textVariant,style:t7,children:children});$[13]=children;$[14]=t7;$[15]=textVariant;$[16]=t8;}else{t8=$[16];}return t8;};exports.InteractiveText=InteractiveText;var createStyles=(_ref,_ref2)=>{var interactiveText=_ref.styles.interactiveText;var disabled=_ref2.disabled;return _reactNative.StyleSheet.create({label:{color:interactiveText.color[disabled?"disabled":"enabled"]}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/text/InteractiveText.tsx";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{StyleSheet}from"react-native";import{useThemedStyles}from"../../hooks";import{Text}from"./Text";import{jsx as _jsx}from"react/jsx-runtime";export var InteractiveText=t0=>{var $=_c(17);var pressed=t0.pressed,styleOverrides=t0.style,textVariant=t0.textVariant,children=t0.children,t1=t0.disabled;var disabled=t1===undefined?false:t1;var t2;if($[0]!==styleOverrides){t2={interactiveText:styleOverrides};$[0]=styleOverrides;$[1]=t2;}else{t2=$[1];}var t3;if($[2]!==disabled){t3={disabled};$[2]=disabled;$[3]=t3;}else{t3=$[3];}var t4;if($[4]!==t2||$[5]!==t3){t4={styles:t2,props:t3};$[4]=t2;$[5]=t3;$[6]=t4;}else{t4=$[6];}var _useThemedStyles=useThemedStyles("interactiveText",createStyles,t4),_useThemedStyles2=_slicedToArray(_useThemedStyles,2),styles=_useThemedStyles2[0],t5=_useThemedStyles2[1];var style=t5.style;var t6;if($[7]!==pressed||$[8]!==style){t6=pressed&&{color:style.color.pressed};$[7]=pressed;$[8]=style;$[9]=t6;}else{t6=$[9];}var t7;if($[10]!==styles.label||$[11]!==t6){t7=[styles.label,t6];$[10]=styles.label;$[11]=t6;$[12]=t7;}else{t7=$[12];}var t8;if($[13]!==children||$[14]!==t7||$[15]!==textVariant){t8=_jsx(Text,{numberOfLines:1,variant:textVariant,style:t7,children:children});$[13]=children;$[14]=t7;$[15]=textVariant;$[16]=t8;}else{t8=$[16];}return t8;};var createStyles=({styles:{interactiveText}},{disabled})=>StyleSheet.create({label:{color:interactiveText.color[disabled?"disabled":"enabled"]}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.Text=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutPropertiesLoose2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _compilerRuntime=require("react/compiler-runtime");var _reactNative=require("react-native");var _hooks=require("../../hooks");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["variant","style","children"];var Text=t0=>{var $=(0,_compilerRuntime.c)(14);var children;var props;var style;var t1;if($[0]!==t0){var _t=t0;t1=_t.variant;style=_t.style;children=_t.children;props=(0,_objectWithoutPropertiesLoose2.default)(_t,_excluded);_t;$[0]=t0;$[1]=children;$[2]=props;$[3]=style;$[4]=t1;}else{children=$[1];props=$[2];style=$[3];t1=$[4];}var variant=t1===undefined?"body":t1;var t2;if($[5]!==variant){t2={props:{variant}};$[5]=variant;$[6]=t2;}else{t2=$[6];}var _useThemedStyles=(0,_hooks.useThemedStyles)("text",createStyles,t2),_useThemedStyles2=(0,_slicedToArray2.default)(_useThemedStyles,1),styles=_useThemedStyles2[0];var t3;if($[7]!==style||$[8]!==styles.text){t3=[styles.text,style];$[7]=style;$[8]=styles.text;$[9]=t3;}else{t3=$[9];}var t4;if($[10]!==children||$[11]!==props||$[12]!==t3){t4=(0,_jsxRuntime.jsx)(_reactNative.Text,Object.assign({},props,{style:t3,children:children}));$[10]=children;$[11]=props;$[12]=t3;$[13]=t4;}else{t4=$[13];}return t4;};exports.Text=Text;var createStyles=(_ref,_ref2)=>{var text=_ref.styles.text;var _ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?"body":_ref2$variant;return _reactNative.StyleSheet.create({text:{fontFamily:text.font[variant].family,fontWeight:text.font[variant].weight,fontSize:text.font[variant].size,color:text.color}});};
1
+ var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/text/Text.tsx";var _excluded=["variant","style","children"];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{Text as RnText,StyleSheet}from"react-native";import{useThemedStyles}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";export var Text=t0=>{var $=_c(14);var children;var props;var style;var t1;if($[0]!==t0){t1=t0.variant;style=t0.style;children=t0.children;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=children;$[2]=props;$[3]=style;$[4]=t1;}else{children=$[1];props=$[2];style=$[3];t1=$[4];}var variant=t1===undefined?"body":t1;var t2;if($[5]!==variant){t2={props:{variant}};$[5]=variant;$[6]=t2;}else{t2=$[6];}var _useThemedStyles=useThemedStyles("text",createStyles,t2),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var t3;if($[7]!==style||$[8]!==styles.text){t3=[styles.text,style];$[7]=style;$[8]=styles.text;$[9]=t3;}else{t3=$[9];}var t4;if($[10]!==children||$[11]!==props||$[12]!==t3){t4=_jsx(RnText,{...props,style:t3,children:children});$[10]=children;$[11]=props;$[12]=t3;$[13]=t4;}else{t4=$[13];}return t4;};var createStyles=({styles:{text}},{variant="body"})=>StyleSheet.create({text:{fontFamily:text.font[variant].family,fontWeight:text.font[variant].weight,fontSize:text.font[variant].size,color:text.color}});
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"HighlightedText",{enumerable:true,get:function(){return _HighlightedText.HighlightedText;}});Object.defineProperty(exports,"InteractiveText",{enumerable:true,get:function(){return _InteractiveText.InteractiveText;}});Object.defineProperty(exports,"Text",{enumerable:true,get:function(){return _Text.Text;}});var _HighlightedText=require("./HighlightedText");var _InteractiveText=require("./InteractiveText");var _Text=require("./Text");
1
+ export{HighlightedText}from"./HighlightedText";export{InteractiveText}from"./InteractiveText";export{Text}from"./Text";
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"useForwardedRef",{enumerable:true,get:function(){return _useForwardedRef.useForwardedRef;}});Object.defineProperty(exports,"useKeyboardHeight",{enumerable:true,get:function(){return _useKeyboardHeight.useKeyboardHeight;}});Object.defineProperty(exports,"usePersistentKeyboardHeight",{enumerable:true,get:function(){return _usePersistentKeyboardHeight.usePersistentKeyboardHeight;}});Object.defineProperty(exports,"useStyles",{enumerable:true,get:function(){return _useThemedStyles.useStyles;}});Object.defineProperty(exports,"useTheme",{enumerable:true,get:function(){return _useTheme.useTheme;}});Object.defineProperty(exports,"useThemedStyles",{enumerable:true,get:function(){return _useThemedStyles.useThemedStyles;}});Object.defineProperty(exports,"useThemedStylesExternal",{enumerable:true,get:function(){return _useThemedStyles.useThemedStylesExternal;}});var _useForwardedRef=require("./useForwardedRef");var _useKeyboardHeight=require("./useKeyboardHeight");var _usePersistentKeyboardHeight=require("./usePersistentKeyboardHeight");var _useTheme=require("./useTheme");var _useThemedStyles=require("./useThemedStyles");
1
+ export{useForwardedRef}from"./useForwardedRef";export{useKeyboardHeight}from"./useKeyboardHeight";export{usePersistentKeyboardHeight}from"./usePersistentKeyboardHeight";export{useTheme}from"./useTheme";export{useStyles,useThemedStyles,useThemedStylesExternal}from"./useThemedStyles";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.useForwardedRef=void 0;var _react=_interopRequireDefault(require("react"));var useForwardedRef=ref=>{var localRef=_react.default.useRef(null);return ref??localRef;};exports.useForwardedRef=useForwardedRef;
1
+ import React from"react";export var useForwardedRef=ref=>{var localRef=React.useRef(null);return ref??localRef;};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.useKeyboardHeight=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _react=require("react");var _reactNative=require("react-native");var isIos=_reactNative.Platform.OS==="ios";var useKeyboardHeight=()=>{var $=(0,_compilerRuntime.c)(4);var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2.default)(_useState,2),keyboardHeight=_useState2[0],setKeyboardHeight=_useState2[1];var t0;var t1;if($[0]===Symbol.for("react.memo_cache_sentinel")){t0=()=>{var showEvent=isIos?"keyboardWillShow":"keyboardDidShow";var hideEvent=isIos?"keyboardWillHide":"keyboardDidHide";var showListener=_reactNative.Keyboard.addListener(showEvent,e=>{setKeyboardHeight(e.endCoordinates.height);});var hideListener=_reactNative.Keyboard.addListener(hideEvent,()=>{setKeyboardHeight(0);});return()=>{showListener.remove();hideListener.remove();};};t1=[];$[0]=t0;$[1]=t1;}else{t0=$[0];t1=$[1];}(0,_react.useEffect)(t0,t1);var t2;if($[2]!==keyboardHeight){t2={keyboardHeight};$[2]=keyboardHeight;$[3]=t2;}else{t2=$[3];}return t2;};exports.useKeyboardHeight=useKeyboardHeight;
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,useState}from"react";import{Keyboard,Platform}from"react-native";var isIos=Platform.OS==="ios";export var useKeyboardHeight=()=>{var $=_c(4);var _useState=useState(0),_useState2=_slicedToArray(_useState,2),keyboardHeight=_useState2[0],setKeyboardHeight=_useState2[1];var t0;var t1;if($[0]===Symbol.for("react.memo_cache_sentinel")){t0=()=>{var showEvent=isIos?"keyboardWillShow":"keyboardDidShow";var hideEvent=isIos?"keyboardWillHide":"keyboardDidHide";var showListener=Keyboard.addListener(showEvent,e=>{setKeyboardHeight(e.endCoordinates.height);});var hideListener=Keyboard.addListener(hideEvent,()=>{setKeyboardHeight(0);});return()=>{showListener.remove();hideListener.remove();};};t1=[];$[0]=t0;$[1]=t1;}else{t0=$[0];t1=$[1];}useEffect(t0,t1);var t2;if($[2]!==keyboardHeight){t2={keyboardHeight};$[2]=keyboardHeight;$[3]=t2;}else{t2=$[3];}return t2;};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault").default;Object.defineProperty(exports,"__esModule",{value:true});exports.usePersistentKeyboardHeight=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _compilerRuntime=require("react/compiler-runtime");var _react=require("react");var _reactNative=require("react-native");var isIos=_reactNative.Platform.OS==="ios";var usePersistentKeyboardHeight=()=>{var $=(0,_compilerRuntime.c)(4);var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2.default)(_useState,2),keyboardHeight=_useState2[0],setKeyboardHeight=_useState2[1];var t0;var t1;if($[0]===Symbol.for("react.memo_cache_sentinel")){t0=()=>{var showEvent=isIos?"keyboardWillShow":"keyboardDidShow";var showListener=_reactNative.Keyboard.addListener(showEvent,e=>{setKeyboardHeight(e.endCoordinates.height);});return()=>{showListener.remove();};};t1=[];$[0]=t0;$[1]=t1;}else{t0=$[0];t1=$[1];}(0,_react.useEffect)(t0,t1);var t2;if($[2]!==keyboardHeight){t2={keyboardHeight};$[2]=keyboardHeight;$[3]=t2;}else{t2=$[3];}return t2;};exports.usePersistentKeyboardHeight=usePersistentKeyboardHeight;
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,useState}from"react";import{Keyboard,Platform}from"react-native";var isIos=Platform.OS==="ios";export var usePersistentKeyboardHeight=()=>{var $=_c(4);var _useState=useState(0),_useState2=_slicedToArray(_useState,2),keyboardHeight=_useState2[0],setKeyboardHeight=_useState2[1];var t0;var t1;if($[0]===Symbol.for("react.memo_cache_sentinel")){t0=()=>{var showEvent=isIos?"keyboardWillShow":"keyboardDidShow";var showListener=Keyboard.addListener(showEvent,e=>{setKeyboardHeight(e.endCoordinates.height);});return()=>{showListener.remove();};};t1=[];$[0]=t0;$[1]=t1;}else{t0=$[0];t1=$[1];}useEffect(t0,t1);var t2;if($[2]!==keyboardHeight){t2={keyboardHeight};$[2]=keyboardHeight;$[3]=t2;}else{t2=$[3];}return t2;};
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.useTheme=void 0;var _react=require("react");var _providers=require("../providers");var useTheme=()=>(0,_react.use)(_providers.ThemeContext);exports.useTheme=useTheme;
1
+ import{use}from"react";import{ThemeContext}from"../providers";export var useTheme=()=>use(ThemeContext);