@react-native-aria/combobox 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # @react-native-aria/combobox
2
+
3
+ ## 0.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @react-native-aria/utils@0.2.11
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _useComboBox = require("./useComboBox");
8
-
9
7
  Object.keys(_useComboBox).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _useComboBox[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './useComboBox';\n"]}
1
+ {"version":3,"names":["_useComboBox","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _useComboBox = require("./useComboBox.web");
8
-
9
7
  Object.keys(_useComboBox).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _useComboBox[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.web.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './useComboBox.web';\n"]}
1
+ {"version":3,"names":["_useComboBox","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useComboBox = useComboBox;
7
-
8
7
  // @ts-ignore
9
8
 
10
9
  /**
@@ -16,16 +15,15 @@ exports.useComboBox = useComboBox;
16
15
  function useComboBox(props, state) {
17
16
  let {
18
17
  inputRef
19
- } = props; // Press handlers for the ComboBox button
18
+ } = props;
20
19
 
20
+ // Press handlers for the ComboBox button
21
21
  let onPress = () => {
22
22
  var _inputRef$current;
23
-
24
23
  // Focus the input field in case it isn't focused yet
25
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
24
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
26
25
  state.toggle();
27
26
  };
28
-
29
27
  const onChangeText = state.setInputValue;
30
28
  return {
31
29
  labelProps: {},
@@ -1 +1 @@
1
- {"version":3,"sources":["useComboBox.ts"],"names":["useComboBox","props","state","inputRef","onPress","current","focus","toggle","onChangeText","setInputValue","labelProps","buttonProps","inputProps","value","inputValue","onFocus","setFocused","onBlur","listBoxProps"],"mappings":";;;;;;;AAGA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAT,CACLC,KADK,EAELC,KAFK,EAGS;AACd,MAAI;AAAEC,IAAAA;AAAF,MAAeF,KAAnB,CADc,CAGd;;AACA,MAAIG,OAAO,GAAG,MAAM;AAAA;;AAClB;AACA,yBAAAD,QAAQ,CAACE,OAAT,wEAAkBC,KAAlB;AACAJ,IAAAA,KAAK,CAACK,MAAN;AACD,GAJD;;AAMA,QAAMC,YAAY,GAAGN,KAAK,CAACO,aAA3B;AAEA,SAAO;AACLC,IAAAA,UAAU,EAAE,EADP;AAELC,IAAAA,WAAW,EAAE;AACXP,MAAAA;AADW,KAFR;AAKLQ,IAAAA,UAAU,EAAE;AACVJ,MAAAA,YADU;AAEVK,MAAAA,KAAK,EAAEX,KAAK,CAACY,UAFH;AAGVC,MAAAA,OAAO,EAAE,MAAM;AACbb,QAAAA,KAAK,CAACc,UAAN,CAAiB,IAAjB;AACD,OALS;AAMVC,MAAAA,MAAM,EAAE,MAAM;AACZf,QAAAA,KAAK,CAACc,UAAN,CAAiB,KAAjB;AACD;AARS,KALP;AAeLE,IAAAA,YAAY,EAAE;AAfT,GAAP;AAiBD","sourcesContent":["import { ComboBoxProps } from '@react-types/combobox';\nimport { ComboBoxState } from '@react-stately/combobox';\nimport { RefObject } from 'react';\n// @ts-ignore\nimport { KeyboardDelegate, PressEvent } from '@react-types/shared';\nimport { TextInput, View, Pressable, Touchable } from 'react-native';\n\ninterface AriaComboBoxProps<T> extends ComboBoxProps<T> {\n /** The ref for the input element. */\n inputRef: RefObject<TextInput>;\n /** The ref for the list box popover. */\n popoverRef: RefObject<View>;\n /** The ref for the list box. */\n listBoxRef: RefObject<View>;\n /** The ref for the list box popup trigger button. */\n buttonRef: RefObject<typeof Pressable | Touchable>;\n /** An optional keyboard delegate implementation, to override the default. */\n keyboardDelegate?: KeyboardDelegate;\n}\n\ninterface ComboBoxAria {\n /** Props for the combo box menu trigger button. */\n buttonProps: any;\n /** Props for the combo box input element. */\n inputProps: any;\n /** Props for the combo box menu. */\n listBoxProps: any;\n /** Props for the combo box label element. */\n labelProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a combo box component.\n * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.\n * @param props - Props for the combo box.\n * @param state - State for the select, as returned by `useComboBoxState`.\n */\nexport function useComboBox<T>(\n props: AriaComboBoxProps<T>,\n state: ComboBoxState<T>\n): ComboBoxAria {\n let { inputRef } = props;\n\n // Press handlers for the ComboBox button\n let onPress = () => {\n // Focus the input field in case it isn't focused yet\n inputRef.current?.focus();\n state.toggle();\n };\n\n const onChangeText = state.setInputValue;\n\n return {\n labelProps: {},\n buttonProps: {\n onPress,\n },\n inputProps: {\n onChangeText,\n value: state.inputValue,\n onFocus: () => {\n state.setFocused(true);\n },\n onBlur: () => {\n state.setFocused(false);\n },\n },\n listBoxProps: {},\n };\n}\n"]}
1
+ {"version":3,"names":["useComboBox","props","state","inputRef","onPress","_inputRef$current","current","focus","toggle","onChangeText","setInputValue","labelProps","buttonProps","inputProps","value","inputValue","onFocus","setFocused","onBlur","listBoxProps"],"sourceRoot":"../../src","sources":["useComboBox.ts"],"mappings":";;;;;;AAGA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAWA,CACzBC,KAA2B,EAC3BC,KAAuB,EACT;EACd,IAAI;IAAEC;EAAS,CAAC,GAAGF,KAAK;;EAExB;EACA,IAAIG,OAAO,GAAGA,CAAA,KAAM;IAAA,IAAAC,iBAAA;IAClB;IACA,CAAAA,iBAAA,GAAAF,QAAQ,CAACG,OAAO,cAAAD,iBAAA,eAAhBA,iBAAA,CAAkBE,KAAK,CAAC,CAAC;IACzBL,KAAK,CAACM,MAAM,CAAC,CAAC;EAChB,CAAC;EAED,MAAMC,YAAY,GAAGP,KAAK,CAACQ,aAAa;EAExC,OAAO;IACLC,UAAU,EAAE,CAAC,CAAC;IACdC,WAAW,EAAE;MACXR;IACF,CAAC;IACDS,UAAU,EAAE;MACVJ,YAAY;MACZK,KAAK,EAAEZ,KAAK,CAACa,UAAU;MACvBC,OAAO,EAAEA,CAAA,KAAM;QACbd,KAAK,CAACe,UAAU,CAAC,IAAI,CAAC;MACxB,CAAC;MACDC,MAAM,EAAEA,CAAA,KAAM;QACZhB,KAAK,CAACe,UAAU,CAAC,KAAK,CAAC;MACzB;IACF,CAAC;IACDE,YAAY,EAAE,CAAC;EACjB,CAAC;AACH"}
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useComboBox = useComboBox;
7
-
8
7
  var _combobox = require("@react-aria/combobox");
9
-
10
8
  var _utils = require("@react-native-aria/utils");
11
-
12
9
  /**
13
10
  * Provides the behavior and accessibility implementation for a combo box component.
14
11
  * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.
@@ -19,11 +16,13 @@ function useComboBox(props, state) {
19
16
  // @ts-ignore
20
17
  const params = (0, _combobox.useComboBox)(props, state);
21
18
  const onKeyPress = params.inputProps.onKeyDown;
22
- params.inputProps.onKeyDown = undefined; // RN Web supports onKeyPress. It's same as onKeyDown
23
- // https://necolas.github.io/react-native-web/docs/text-input/
19
+ params.inputProps.onKeyDown = undefined;
24
20
 
25
- params.inputProps.onKeyPress = onKeyPress; // @ts-ignore
21
+ // RN Web supports onKeyPress. It's same as onKeyDown
22
+ // https://necolas.github.io/react-native-web/docs/text-input/
23
+ params.inputProps.onKeyPress = onKeyPress;
26
24
 
25
+ // @ts-ignore
27
26
  params.inputProps.blurOnSubmit = false;
28
27
  params.inputProps.onKeyDown = undefined;
29
28
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["useComboBox.web.ts"],"names":["useComboBox","props","state","params","onKeyPress","inputProps","onKeyDown","undefined","blurOnSubmit","buttonProps","labelProps","listBoxProps"],"mappings":";;;;;;;AAKA;;AACA;;AA2BA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAT,CACLC,KADK,EAELC,KAFK,EAGS;AACd;AACA,QAAMC,MAAM,GAAG,2BAAeF,KAAf,EAAsBC,KAAtB,CAAf;AAEA,QAAME,UAAU,GAAGD,MAAM,CAACE,UAAP,CAAkBC,SAArC;AACAH,EAAAA,MAAM,CAACE,UAAP,CAAkBC,SAAlB,GAA8BC,SAA9B,CALc,CAOd;AACA;;AACAJ,EAAAA,MAAM,CAACE,UAAP,CAAkBD,UAAlB,GAA+BA,UAA/B,CATc,CAWd;;AACAD,EAAAA,MAAM,CAACE,UAAP,CAAkBG,YAAlB,GAAiC,KAAjC;AACAL,EAAAA,MAAM,CAACE,UAAP,CAAkBC,SAAlB,GAA8BC,SAA9B;AAEA,SAAO;AACLF,IAAAA,UAAU,EAAE,4BAAgBF,MAAM,CAACE,UAAvB,CADP;AAELI,IAAAA,WAAW,EAAE,4BAAgBN,MAAM,CAACM,WAAvB,CAFR;AAGLC,IAAAA,UAAU,EAAE,4BAAgBP,MAAM,CAACO,UAAvB,CAHP;AAILC,IAAAA,YAAY,EAAE,4BAAgBR,MAAM,CAACQ,YAAvB;AAJT,GAAP;AAMD","sourcesContent":["import { ComboBoxProps } from '@react-types/combobox';\nimport { ComboBoxState } from '@react-stately/combobox';\nimport { RefObject } from 'react';\nimport { KeyboardDelegate } from '@react-types/shared';\nimport { TextInput, View, Pressable, Touchable } from 'react-native';\nimport { useComboBox as useComboBoxWeb } from '@react-aria/combobox';\nimport { mapDomPropsToRN } from '@react-native-aria/utils';\nimport { TextInputProps } from 'react-native';\n\ninterface AriaComboBoxProps<T> extends ComboBoxProps<T> {\n /** The ref for the input element. */\n inputRef: RefObject<TextInput>;\n /** The ref for the list box popover. */\n popoverRef: RefObject<View>;\n /** The ref for the list box. */\n listBoxRef: RefObject<View>;\n /** The ref for the list box popup trigger button. */\n buttonRef: RefObject<typeof Pressable | Touchable>;\n /** An optional keyboard delegate implementation, to override the default. */\n keyboardDelegate?: KeyboardDelegate;\n}\n\ninterface ComboBoxAria {\n /** Props for the combo box menu trigger button. */\n buttonProps: any;\n /** Props for the combo box input element. */\n inputProps: TextInputProps;\n /** Props for the combo box menu. */\n listBoxProps: any;\n /** Props for the combo box label element. */\n labelProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a combo box component.\n * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.\n * @param props - Props for the combo box.\n * @param state - State for the select, as returned by `useComboBoxState`.\n */\nexport function useComboBox<T>(\n props: AriaComboBoxProps<T>,\n state: ComboBoxState<T>\n): ComboBoxAria {\n // @ts-ignore\n const params = useComboBoxWeb(props, state);\n\n const onKeyPress = params.inputProps.onKeyDown;\n params.inputProps.onKeyDown = undefined;\n\n // RN Web supports onKeyPress. It's same as onKeyDown\n // https://necolas.github.io/react-native-web/docs/text-input/\n params.inputProps.onKeyPress = onKeyPress;\n\n // @ts-ignore\n params.inputProps.blurOnSubmit = false;\n params.inputProps.onKeyDown = undefined;\n\n return {\n inputProps: mapDomPropsToRN(params.inputProps),\n buttonProps: mapDomPropsToRN(params.buttonProps),\n labelProps: mapDomPropsToRN(params.labelProps),\n listBoxProps: mapDomPropsToRN(params.listBoxProps),\n };\n}\n"]}
1
+ {"version":3,"names":["_combobox","require","_utils","useComboBox","props","state","params","useComboBoxWeb","onKeyPress","inputProps","onKeyDown","undefined","blurOnSubmit","mapDomPropsToRN","buttonProps","labelProps","listBoxProps"],"sourceRoot":"../../src","sources":["useComboBox.web.ts"],"mappings":";;;;;;AAKA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AA2BA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,WAAWA,CACzBC,KAA2B,EAC3BC,KAAuB,EACT;EACd;EACA,MAAMC,MAAM,GAAG,IAAAC,qBAAc,EAACH,KAAK,EAAEC,KAAK,CAAC;EAE3C,MAAMG,UAAU,GAAGF,MAAM,CAACG,UAAU,CAACC,SAAS;EAC9CJ,MAAM,CAACG,UAAU,CAACC,SAAS,GAAGC,SAAS;;EAEvC;EACA;EACAL,MAAM,CAACG,UAAU,CAACD,UAAU,GAAGA,UAAU;;EAEzC;EACAF,MAAM,CAACG,UAAU,CAACG,YAAY,GAAG,KAAK;EACtCN,MAAM,CAACG,UAAU,CAACC,SAAS,GAAGC,SAAS;EAEvC,OAAO;IACLF,UAAU,EAAE,IAAAI,sBAAe,EAACP,MAAM,CAACG,UAAU,CAAC;IAC9CK,WAAW,EAAE,IAAAD,sBAAe,EAACP,MAAM,CAACQ,WAAW,CAAC;IAChDC,UAAU,EAAE,IAAAF,sBAAe,EAACP,MAAM,CAACS,UAAU,CAAC;IAC9CC,YAAY,EAAE,IAAAH,sBAAe,EAACP,MAAM,CAACU,YAAY;EACnD,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAd","sourcesContent":["export * from './useComboBox';\n"]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,cAAc,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.web.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAd","sourcesContent":["export * from './useComboBox.web';\n"]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":"AAAA,cAAc,mBAAmB"}
@@ -9,16 +9,15 @@
9
9
  export function useComboBox(props, state) {
10
10
  let {
11
11
  inputRef
12
- } = props; // Press handlers for the ComboBox button
12
+ } = props;
13
13
 
14
+ // Press handlers for the ComboBox button
14
15
  let onPress = () => {
15
16
  var _inputRef$current;
16
-
17
17
  // Focus the input field in case it isn't focused yet
18
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
18
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
19
19
  state.toggle();
20
20
  };
21
-
22
21
  const onChangeText = state.setInputValue;
23
22
  return {
24
23
  labelProps: {},
@@ -1 +1 @@
1
- {"version":3,"sources":["useComboBox.ts"],"names":["useComboBox","props","state","inputRef","onPress","current","focus","toggle","onChangeText","setInputValue","labelProps","buttonProps","inputProps","value","inputValue","onFocus","setFocused","onBlur","listBoxProps"],"mappings":"AAGA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,WAAT,CACLC,KADK,EAELC,KAFK,EAGS;AACd,MAAI;AAAEC,IAAAA;AAAF,MAAeF,KAAnB,CADc,CAGd;;AACA,MAAIG,OAAO,GAAG,MAAM;AAAA;;AAClB;AACA,yBAAAD,QAAQ,CAACE,OAAT,wEAAkBC,KAAlB;AACAJ,IAAAA,KAAK,CAACK,MAAN;AACD,GAJD;;AAMA,QAAMC,YAAY,GAAGN,KAAK,CAACO,aAA3B;AAEA,SAAO;AACLC,IAAAA,UAAU,EAAE,EADP;AAELC,IAAAA,WAAW,EAAE;AACXP,MAAAA;AADW,KAFR;AAKLQ,IAAAA,UAAU,EAAE;AACVJ,MAAAA,YADU;AAEVK,MAAAA,KAAK,EAAEX,KAAK,CAACY,UAFH;AAGVC,MAAAA,OAAO,EAAE,MAAM;AACbb,QAAAA,KAAK,CAACc,UAAN,CAAiB,IAAjB;AACD,OALS;AAMVC,MAAAA,MAAM,EAAE,MAAM;AACZf,QAAAA,KAAK,CAACc,UAAN,CAAiB,KAAjB;AACD;AARS,KALP;AAeLE,IAAAA,YAAY,EAAE;AAfT,GAAP;AAiBD","sourcesContent":["import { ComboBoxProps } from '@react-types/combobox';\nimport { ComboBoxState } from '@react-stately/combobox';\nimport { RefObject } from 'react';\n// @ts-ignore\nimport { KeyboardDelegate, PressEvent } from '@react-types/shared';\nimport { TextInput, View, Pressable, Touchable } from 'react-native';\n\ninterface AriaComboBoxProps<T> extends ComboBoxProps<T> {\n /** The ref for the input element. */\n inputRef: RefObject<TextInput>;\n /** The ref for the list box popover. */\n popoverRef: RefObject<View>;\n /** The ref for the list box. */\n listBoxRef: RefObject<View>;\n /** The ref for the list box popup trigger button. */\n buttonRef: RefObject<typeof Pressable | Touchable>;\n /** An optional keyboard delegate implementation, to override the default. */\n keyboardDelegate?: KeyboardDelegate;\n}\n\ninterface ComboBoxAria {\n /** Props for the combo box menu trigger button. */\n buttonProps: any;\n /** Props for the combo box input element. */\n inputProps: any;\n /** Props for the combo box menu. */\n listBoxProps: any;\n /** Props for the combo box label element. */\n labelProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a combo box component.\n * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.\n * @param props - Props for the combo box.\n * @param state - State for the select, as returned by `useComboBoxState`.\n */\nexport function useComboBox<T>(\n props: AriaComboBoxProps<T>,\n state: ComboBoxState<T>\n): ComboBoxAria {\n let { inputRef } = props;\n\n // Press handlers for the ComboBox button\n let onPress = () => {\n // Focus the input field in case it isn't focused yet\n inputRef.current?.focus();\n state.toggle();\n };\n\n const onChangeText = state.setInputValue;\n\n return {\n labelProps: {},\n buttonProps: {\n onPress,\n },\n inputProps: {\n onChangeText,\n value: state.inputValue,\n onFocus: () => {\n state.setFocused(true);\n },\n onBlur: () => {\n state.setFocused(false);\n },\n },\n listBoxProps: {},\n };\n}\n"]}
1
+ {"version":3,"names":["useComboBox","props","state","inputRef","onPress","_inputRef$current","current","focus","toggle","onChangeText","setInputValue","labelProps","buttonProps","inputProps","value","inputValue","onFocus","setFocused","onBlur","listBoxProps"],"sourceRoot":"../../src","sources":["useComboBox.ts"],"mappings":"AAGA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,WAAWA,CACzBC,KAA2B,EAC3BC,KAAuB,EACT;EACd,IAAI;IAAEC;EAAS,CAAC,GAAGF,KAAK;;EAExB;EACA,IAAIG,OAAO,GAAGA,CAAA,KAAM;IAAA,IAAAC,iBAAA;IAClB;IACA,CAAAA,iBAAA,GAAAF,QAAQ,CAACG,OAAO,cAAAD,iBAAA,eAAhBA,iBAAA,CAAkBE,KAAK,CAAC,CAAC;IACzBL,KAAK,CAACM,MAAM,CAAC,CAAC;EAChB,CAAC;EAED,MAAMC,YAAY,GAAGP,KAAK,CAACQ,aAAa;EAExC,OAAO;IACLC,UAAU,EAAE,CAAC,CAAC;IACdC,WAAW,EAAE;MACXR;IACF,CAAC;IACDS,UAAU,EAAE;MACVJ,YAAY;MACZK,KAAK,EAAEZ,KAAK,CAACa,UAAU;MACvBC,OAAO,EAAEA,CAAA,KAAM;QACbd,KAAK,CAACe,UAAU,CAAC,IAAI,CAAC;MACxB,CAAC;MACDC,MAAM,EAAEA,CAAA,KAAM;QACZhB,KAAK,CAACe,UAAU,CAAC,KAAK,CAAC;MACzB;IACF,CAAC;IACDE,YAAY,EAAE,CAAC;EACjB,CAAC;AACH"}
@@ -1,6 +1,5 @@
1
1
  import { useComboBox as useComboBoxWeb } from '@react-aria/combobox';
2
2
  import { mapDomPropsToRN } from '@react-native-aria/utils';
3
-
4
3
  /**
5
4
  * Provides the behavior and accessibility implementation for a combo box component.
6
5
  * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.
@@ -11,11 +10,13 @@ export function useComboBox(props, state) {
11
10
  // @ts-ignore
12
11
  const params = useComboBoxWeb(props, state);
13
12
  const onKeyPress = params.inputProps.onKeyDown;
14
- params.inputProps.onKeyDown = undefined; // RN Web supports onKeyPress. It's same as onKeyDown
15
- // https://necolas.github.io/react-native-web/docs/text-input/
13
+ params.inputProps.onKeyDown = undefined;
16
14
 
17
- params.inputProps.onKeyPress = onKeyPress; // @ts-ignore
15
+ // RN Web supports onKeyPress. It's same as onKeyDown
16
+ // https://necolas.github.io/react-native-web/docs/text-input/
17
+ params.inputProps.onKeyPress = onKeyPress;
18
18
 
19
+ // @ts-ignore
19
20
  params.inputProps.blurOnSubmit = false;
20
21
  params.inputProps.onKeyDown = undefined;
21
22
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["useComboBox.web.ts"],"names":["useComboBox","useComboBoxWeb","mapDomPropsToRN","props","state","params","onKeyPress","inputProps","onKeyDown","undefined","blurOnSubmit","buttonProps","labelProps","listBoxProps"],"mappings":"AAKA,SAASA,WAAW,IAAIC,cAAxB,QAA8C,sBAA9C;AACA,SAASC,eAAT,QAAgC,0BAAhC;;AA2BA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASF,WAAT,CACLG,KADK,EAELC,KAFK,EAGS;AACd;AACA,QAAMC,MAAM,GAAGJ,cAAc,CAACE,KAAD,EAAQC,KAAR,CAA7B;AAEA,QAAME,UAAU,GAAGD,MAAM,CAACE,UAAP,CAAkBC,SAArC;AACAH,EAAAA,MAAM,CAACE,UAAP,CAAkBC,SAAlB,GAA8BC,SAA9B,CALc,CAOd;AACA;;AACAJ,EAAAA,MAAM,CAACE,UAAP,CAAkBD,UAAlB,GAA+BA,UAA/B,CATc,CAWd;;AACAD,EAAAA,MAAM,CAACE,UAAP,CAAkBG,YAAlB,GAAiC,KAAjC;AACAL,EAAAA,MAAM,CAACE,UAAP,CAAkBC,SAAlB,GAA8BC,SAA9B;AAEA,SAAO;AACLF,IAAAA,UAAU,EAAEL,eAAe,CAACG,MAAM,CAACE,UAAR,CADtB;AAELI,IAAAA,WAAW,EAAET,eAAe,CAACG,MAAM,CAACM,WAAR,CAFvB;AAGLC,IAAAA,UAAU,EAAEV,eAAe,CAACG,MAAM,CAACO,UAAR,CAHtB;AAILC,IAAAA,YAAY,EAAEX,eAAe,CAACG,MAAM,CAACQ,YAAR;AAJxB,GAAP;AAMD","sourcesContent":["import { ComboBoxProps } from '@react-types/combobox';\nimport { ComboBoxState } from '@react-stately/combobox';\nimport { RefObject } from 'react';\nimport { KeyboardDelegate } from '@react-types/shared';\nimport { TextInput, View, Pressable, Touchable } from 'react-native';\nimport { useComboBox as useComboBoxWeb } from '@react-aria/combobox';\nimport { mapDomPropsToRN } from '@react-native-aria/utils';\nimport { TextInputProps } from 'react-native';\n\ninterface AriaComboBoxProps<T> extends ComboBoxProps<T> {\n /** The ref for the input element. */\n inputRef: RefObject<TextInput>;\n /** The ref for the list box popover. */\n popoverRef: RefObject<View>;\n /** The ref for the list box. */\n listBoxRef: RefObject<View>;\n /** The ref for the list box popup trigger button. */\n buttonRef: RefObject<typeof Pressable | Touchable>;\n /** An optional keyboard delegate implementation, to override the default. */\n keyboardDelegate?: KeyboardDelegate;\n}\n\ninterface ComboBoxAria {\n /** Props for the combo box menu trigger button. */\n buttonProps: any;\n /** Props for the combo box input element. */\n inputProps: TextInputProps;\n /** Props for the combo box menu. */\n listBoxProps: any;\n /** Props for the combo box label element. */\n labelProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a combo box component.\n * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.\n * @param props - Props for the combo box.\n * @param state - State for the select, as returned by `useComboBoxState`.\n */\nexport function useComboBox<T>(\n props: AriaComboBoxProps<T>,\n state: ComboBoxState<T>\n): ComboBoxAria {\n // @ts-ignore\n const params = useComboBoxWeb(props, state);\n\n const onKeyPress = params.inputProps.onKeyDown;\n params.inputProps.onKeyDown = undefined;\n\n // RN Web supports onKeyPress. It's same as onKeyDown\n // https://necolas.github.io/react-native-web/docs/text-input/\n params.inputProps.onKeyPress = onKeyPress;\n\n // @ts-ignore\n params.inputProps.blurOnSubmit = false;\n params.inputProps.onKeyDown = undefined;\n\n return {\n inputProps: mapDomPropsToRN(params.inputProps),\n buttonProps: mapDomPropsToRN(params.buttonProps),\n labelProps: mapDomPropsToRN(params.labelProps),\n listBoxProps: mapDomPropsToRN(params.listBoxProps),\n };\n}\n"]}
1
+ {"version":3,"names":["useComboBox","useComboBoxWeb","mapDomPropsToRN","props","state","params","onKeyPress","inputProps","onKeyDown","undefined","blurOnSubmit","buttonProps","labelProps","listBoxProps"],"sourceRoot":"../../src","sources":["useComboBox.web.ts"],"mappings":"AAKA,SAASA,WAAW,IAAIC,cAAc,QAAQ,sBAAsB;AACpE,SAASC,eAAe,QAAQ,0BAA0B;AA2B1D;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASF,WAAWA,CACzBG,KAA2B,EAC3BC,KAAuB,EACT;EACd;EACA,MAAMC,MAAM,GAAGJ,cAAc,CAACE,KAAK,EAAEC,KAAK,CAAC;EAE3C,MAAME,UAAU,GAAGD,MAAM,CAACE,UAAU,CAACC,SAAS;EAC9CH,MAAM,CAACE,UAAU,CAACC,SAAS,GAAGC,SAAS;;EAEvC;EACA;EACAJ,MAAM,CAACE,UAAU,CAACD,UAAU,GAAGA,UAAU;;EAEzC;EACAD,MAAM,CAACE,UAAU,CAACG,YAAY,GAAG,KAAK;EACtCL,MAAM,CAACE,UAAU,CAACC,SAAS,GAAGC,SAAS;EAEvC,OAAO;IACLF,UAAU,EAAEL,eAAe,CAACG,MAAM,CAACE,UAAU,CAAC;IAC9CI,WAAW,EAAET,eAAe,CAACG,MAAM,CAACM,WAAW,CAAC;IAChDC,UAAU,EAAEV,eAAe,CAACG,MAAM,CAACO,UAAU,CAAC;IAC9CC,YAAY,EAAEX,eAAe,CAACG,MAAM,CAACQ,YAAY;EACnD,CAAC;AACH"}
@@ -1 +1,2 @@
1
1
  export * from './useComboBox';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './useComboBox.web';
2
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/index.web.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -33,3 +33,4 @@ interface ComboBoxAria {
33
33
  */
34
34
  export declare function useComboBox<T>(props: AriaComboBoxProps<T>, state: ComboBoxState<T>): ComboBoxAria;
35
35
  export {};
36
+ //# sourceMappingURL=useComboBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComboBox.d.ts","sourceRoot":"","sources":["../../src/useComboBox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAc,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,UAAU,iBAAiB,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACrD,qCAAqC;IACrC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/B,wCAAwC;IACxC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,gCAAgC;IAChC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,sDAAsD;IACtD,SAAS,EAAE,SAAS,CAAC,OAAO,SAAS,GAAG,SAAS,CAAC,CAAC;IACnD,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAED,UAAU,YAAY;IACpB,mDAAmD;IACnD,WAAW,EAAE,GAAG,CAAC;IACjB,6CAA6C;IAC7C,UAAU,EAAE,GAAG,CAAC;IAChB,oCAAoC;IACpC,YAAY,EAAE,GAAG,CAAC;IAClB,6CAA6C;IAC7C,UAAU,EAAE,GAAG,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GACtB,YAAY,CA6Bd"}
@@ -34,3 +34,4 @@ interface ComboBoxAria {
34
34
  */
35
35
  export declare function useComboBox<T>(props: AriaComboBoxProps<T>, state: ComboBoxState<T>): ComboBoxAria;
36
36
  export {};
37
+ //# sourceMappingURL=useComboBox.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComboBox.web.d.ts","sourceRoot":"","sources":["../../src/useComboBox.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,iBAAiB,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACrD,qCAAqC;IACrC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/B,wCAAwC;IACxC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,gCAAgC;IAChC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,sDAAsD;IACtD,SAAS,EAAE,SAAS,CAAC,OAAO,SAAS,GAAG,SAAS,CAAC,CAAC;IACnD,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAED,UAAU,YAAY;IACpB,mDAAmD;IACnD,WAAW,EAAE,GAAG,CAAC;IACjB,6CAA6C;IAC7C,UAAU,EAAE,cAAc,CAAC;IAC3B,oCAAoC;IACpC,YAAY,EAAE,GAAG,CAAC;IAClB,6CAA6C;IAC7C,UAAU,EAAE,GAAG,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GACtB,YAAY,CAqBd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-aria/combobox",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "mono repo setup with bob",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -26,6 +26,7 @@
26
26
  "test": "jest",
27
27
  "typescript": "tsc --noEmit",
28
28
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
29
+ "build": "bob build",
29
30
  "prepare": "bob build",
30
31
  "release": "release-it",
31
32
  "example": "yarn --cwd example",
@@ -37,13 +38,16 @@
37
38
  "ios",
38
39
  "android"
39
40
  ],
40
- "repository": "https://github.com/intergalacticspacehighway/react-native-bob-mono",
41
+ "homepage": "https://github.com/gluestack/gluestack-ui/tree/main/packages/react-native-aria/combobox#readme",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/gluestack/gluestack-ui.git"
45
+ },
41
46
  "author": "nishan <nishanbende@gmail.com> (https://github.com/intergalacticspacehighway)",
42
47
  "license": "MIT",
43
48
  "bugs": {
44
49
  "url": "https://github.com/intergalacticspacehighway/react-native-bob-mono/issues"
45
50
  },
46
- "homepage": "https://github.com/intergalacticspacehighway/react-native-bob-mono#readme",
47
51
  "publishConfig": {
48
52
  "registry": "https://registry.npmjs.org/"
49
53
  },
@@ -56,7 +60,7 @@
56
60
  "@react-aria/live-announcer": "^3.0.0-alpha.0",
57
61
  "@react-aria/overlays": "^3.7.0",
58
62
  "@react-aria/utils": "^3.6.0",
59
- "@react-native-aria/utils": "^0.2.10",
63
+ "@react-native-aria/utils": "0.2.11",
60
64
  "@react-types/button": "^3.3.1"
61
65
  },
62
66
  "jest": {