@reillymc/react-native-components 0.11.6 → 0.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/container/anchoredContainer/AnchoredContainer.ios.js +1 -0
- package/lib/components/container/anchoredContainer/AnchoredContainer.js +1 -0
- package/lib/components/container/anchoredContainer/AnchoredContainer.styles.js +1 -0
- package/lib/components/container/anchoredContainer/AnchoredContainer.web.js +1 -0
- package/lib/components/container/anchoredContainer/InlineMount.js +1 -0
- package/lib/components/container/anchoredContainer/OverlayMount.js +1 -0
- package/lib/components/container/anchoredContainer/helpers.js +1 -0
- package/lib/components/container/anchoredContainer/index.js +1 -0
- package/lib/components/container/anchoredContainer/useAnchoredContainerPosition.js +1 -0
- package/lib/components/container/index.js +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/input/CounterInput.js +1 -1
- package/lib/components/input/NumberInput.js +1 -1
- package/lib/components/input/SelectionInput.js +1 -1
- package/lib/components/input/TimeInput.js +1 -1
- package/lib/components/input/dropdownInput/DropdownBlurGuard.js +1 -0
- package/lib/components/input/dropdownInput/DropdownBlurGuard.web.js +1 -0
- package/lib/components/input/dropdownInput/DropdownInput.js +1 -0
- package/lib/components/input/dropdownInput/DropdownInputBase.js +1 -0
- package/lib/components/input/dropdownInput/helpers.js +1 -0
- package/lib/components/input/dropdownInput/index.js +1 -0
- package/lib/components/input/dropdownInput/useDropdownController.js +1 -0
- package/lib/components/input/index.js +1 -1
- package/lib/components/menu/Menu.js +1 -1
- package/lib/components/menu/Menu.styles.js +1 -1
- package/lib/components/menu/MenuItem.js +1 -1
- package/lib/components/toast/Toast.js +1 -1
- package/lib/components/toast/Toast.styles.js +1 -1
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useControlledState.js +1 -0
- package/lib/hooks/usePersistentKeyboardHeight.js +1 -1
- package/lib/hooks/useTheme.js +1 -1
- package/lib/hooks/useThemedStyles.js +1 -1
- package/lib/providers/ThemeContext.js +1 -1
- package/lib/providers/ThemeProvider.js +1 -1
- package/lib/theme/index.js +1 -1
- package/lib/theme/styles.js +1 -1
- package/lib/theme/theme.js +1 -1
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.d.ts +48 -0
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.ios.d.ts +4 -0
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.ios.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.styles.d.ts +4 -0
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.styles.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.web.d.ts +4 -0
- package/lib/types/components/container/anchoredContainer/AnchoredContainer.web.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/InlineMount.d.ts +8 -0
- package/lib/types/components/container/anchoredContainer/InlineMount.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/OverlayMount.d.ts +10 -0
- package/lib/types/components/container/anchoredContainer/OverlayMount.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/helpers.d.ts +5 -0
- package/lib/types/components/container/anchoredContainer/helpers.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/index.d.ts +3 -0
- package/lib/types/components/container/anchoredContainer/index.d.ts.map +1 -0
- package/lib/types/components/container/anchoredContainer/useAnchoredContainerPosition.d.ts +29 -0
- package/lib/types/components/container/anchoredContainer/useAnchoredContainerPosition.d.ts.map +1 -0
- package/lib/types/components/container/index.d.ts +2 -1
- package/lib/types/components/container/index.d.ts.map +1 -1
- package/lib/types/components/index.d.ts +4 -4
- package/lib/types/components/index.d.ts.map +1 -1
- package/lib/types/components/input/CounterInput.d.ts +3 -1
- package/lib/types/components/input/CounterInput.d.ts.map +1 -1
- package/lib/types/components/input/InputBase.d.ts +2 -2
- package/lib/types/components/input/InputBase.d.ts.map +1 -1
- package/lib/types/components/input/NumberInput.d.ts +12 -4
- package/lib/types/components/input/NumberInput.d.ts.map +1 -1
- package/lib/types/components/input/NumberInputBase.d.ts +2 -2
- package/lib/types/components/input/NumberInputBase.d.ts.map +1 -1
- package/lib/types/components/input/SelectionInput.d.ts +5 -5
- package/lib/types/components/input/SelectionInput.d.ts.map +1 -1
- package/lib/types/components/input/TimeInput.d.ts +5 -2
- package/lib/types/components/input/TimeInput.d.ts.map +1 -1
- package/lib/types/components/input/dropdownInput/DropdownBlurGuard.d.ts +8 -0
- package/lib/types/components/input/dropdownInput/DropdownBlurGuard.d.ts.map +1 -0
- package/lib/types/components/input/dropdownInput/DropdownBlurGuard.web.d.ts +9 -0
- package/lib/types/components/input/dropdownInput/DropdownBlurGuard.web.d.ts.map +1 -0
- package/lib/types/components/input/dropdownInput/DropdownInput.d.ts +8 -0
- package/lib/types/components/input/dropdownInput/DropdownInput.d.ts.map +1 -0
- package/lib/types/components/input/{DropdownInput.styles.d.ts → dropdownInput/DropdownInput.styles.d.ts} +1 -1
- package/lib/types/components/input/dropdownInput/DropdownInput.styles.d.ts.map +1 -0
- package/lib/types/components/input/dropdownInput/DropdownInputBase.d.ts +72 -0
- package/lib/types/components/input/dropdownInput/DropdownInputBase.d.ts.map +1 -0
- package/lib/types/components/input/dropdownInput/helpers.d.ts +13 -0
- package/lib/types/components/input/dropdownInput/helpers.d.ts.map +1 -0
- package/lib/types/components/input/dropdownInput/index.d.ts +4 -0
- package/lib/types/components/input/dropdownInput/index.d.ts.map +1 -0
- package/lib/types/components/input/dropdownInput/useDropdownController.d.ts +43 -0
- package/lib/types/components/input/dropdownInput/useDropdownController.d.ts.map +1 -0
- package/lib/types/components/input/index.d.ts +3 -5
- package/lib/types/components/input/index.d.ts.map +1 -1
- package/lib/types/components/menu/Menu.d.ts +17 -6
- package/lib/types/components/menu/Menu.d.ts.map +1 -1
- package/lib/types/components/menu/Menu.styles.d.ts.map +1 -1
- package/lib/types/components/menu/MenuItem.d.ts +1 -0
- package/lib/types/components/menu/MenuItem.d.ts.map +1 -1
- package/lib/types/components/toast/Toast.d.ts +6 -3
- package/lib/types/components/toast/Toast.d.ts.map +1 -1
- package/lib/types/components/toast/Toast.styles.d.ts +1 -1
- package/lib/types/components/toast/Toast.styles.d.ts.map +1 -1
- package/lib/types/hooks/index.d.ts +1 -0
- package/lib/types/hooks/index.d.ts.map +1 -1
- package/lib/types/hooks/useControlledState.d.ts +8 -0
- package/lib/types/hooks/useControlledState.d.ts.map +1 -0
- package/lib/types/hooks/usePersistentKeyboardHeight.d.ts.map +1 -1
- package/lib/types/hooks/useTheme.d.ts +6 -1
- package/lib/types/hooks/useTheme.d.ts.map +1 -1
- package/lib/types/hooks/useThemedStyles.d.ts +4 -3
- package/lib/types/hooks/useThemedStyles.d.ts.map +1 -1
- package/lib/types/providers/ThemeContext.d.ts +4 -4
- package/lib/types/providers/ThemeContext.d.ts.map +1 -1
- package/lib/types/providers/ThemeProvider.d.ts +9 -6
- package/lib/types/providers/ThemeProvider.d.ts.map +1 -1
- package/lib/types/theme/index.d.ts +3 -3
- package/lib/types/theme/index.d.ts.map +1 -1
- package/lib/types/theme/styles.d.ts +7 -2
- package/lib/types/theme/styles.d.ts.map +1 -1
- package/lib/types/theme/theme.d.ts +6 -7
- package/lib/types/theme/theme.d.ts.map +1 -1
- package/package.json +3 -2
- package/lib/components/container/FloatingContainer.js +0 -1
- package/lib/components/container/FloatingContainer.styles.js +0 -1
- package/lib/components/container/FloatingContainer.web.js +0 -1
- package/lib/components/input/DropdownInput.js +0 -1
- package/lib/components/input/DropdownInputBase.js +0 -1
- package/lib/types/components/container/FloatingContainer.d.ts +0 -22
- package/lib/types/components/container/FloatingContainer.d.ts.map +0 -1
- package/lib/types/components/container/FloatingContainer.styles.d.ts +0 -4
- package/lib/types/components/container/FloatingContainer.styles.d.ts.map +0 -1
- package/lib/types/components/container/FloatingContainer.web.d.ts +0 -4
- package/lib/types/components/container/FloatingContainer.web.d.ts.map +0 -1
- package/lib/types/components/input/DropdownInput.d.ts +0 -8
- package/lib/types/components/input/DropdownInput.d.ts.map +0 -1
- package/lib/types/components/input/DropdownInput.styles.d.ts.map +0 -1
- package/lib/types/components/input/DropdownInputBase.d.ts +0 -38
- package/lib/types/components/input/DropdownInputBase.d.ts.map +0 -1
- /package/lib/components/input/{DropdownInput.styles.js → dropdownInput/DropdownInput.styles.js} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import type { BlurEvent, TextInput as DefaultTextInput, FocusEvent, TextInputKeyPressEvent } from "react-native";
|
|
3
|
+
import type { ValueItem } from "../../../common";
|
|
4
|
+
import type { InputBaseProps } from "../InputBase";
|
|
5
|
+
import { type DropdownValue } from "./helpers";
|
|
6
|
+
export type DropdownControllerOptions<T> = {
|
|
7
|
+
items: Array<ValueItem<T>>;
|
|
8
|
+
value: DropdownValue<T> | undefined;
|
|
9
|
+
defaultValue: DropdownValue<T> | undefined;
|
|
10
|
+
isValueControlled: boolean;
|
|
11
|
+
onChange?: (item: ValueItem<T> | undefined, inputValue: string) => void;
|
|
12
|
+
onChangeText?: (text: string) => void;
|
|
13
|
+
onFocus?: InputBaseProps["onFocus"];
|
|
14
|
+
onBlur?: InputBaseProps["onBlur"];
|
|
15
|
+
onKeyPress?: InputBaseProps["onKeyPress"];
|
|
16
|
+
onSubmitEditing?: InputBaseProps["onSubmitEditing"];
|
|
17
|
+
openOnFocus: boolean;
|
|
18
|
+
allowsCustomValue: boolean;
|
|
19
|
+
blurOnSelect: boolean;
|
|
20
|
+
filterItems?: (item: ValueItem<T>, query: string) => boolean;
|
|
21
|
+
minimumSearchLength: number;
|
|
22
|
+
maxSuggestionCount?: number;
|
|
23
|
+
inputRef: RefObject<DefaultTextInput | null>;
|
|
24
|
+
isMenuInverted?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const useDropdownController: <T>({ items, value, defaultValue, isValueControlled, onChange, onChangeText, onFocus, onBlur, onKeyPress, onSubmitEditing, openOnFocus, allowsCustomValue, blurOnSelect, filterItems, minimumSearchLength, maxSuggestionCount, inputRef, isMenuInverted, }: DropdownControllerOptions<T>) => {
|
|
27
|
+
displayText: string;
|
|
28
|
+
query: string;
|
|
29
|
+
filteredItems: ValueItem<T>[];
|
|
30
|
+
showContainer: boolean;
|
|
31
|
+
activeIndex: number;
|
|
32
|
+
handleFocus: (e: FocusEvent) => void;
|
|
33
|
+
handleBlur: (e: BlurEvent) => void;
|
|
34
|
+
handleChangeText: (next: string) => void;
|
|
35
|
+
handleKeyPress: (e: TextInputKeyPressEvent) => void;
|
|
36
|
+
handleSubmitEditing: (e: import("react-native").TextInputSubmitEditingEvent) => void;
|
|
37
|
+
selectItem: (item: ValueItem<T>) => void;
|
|
38
|
+
setInputValue: (next: string) => void;
|
|
39
|
+
clear: () => void;
|
|
40
|
+
open: () => void;
|
|
41
|
+
close: () => void;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=useDropdownController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdownController.d.ts","sourceRoot":"","sources":["../../../../../src/components/input/dropdownInput/useDropdownController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EACR,SAAS,EACT,SAAS,IAAI,gBAAgB,EAC7B,UAAU,EACV,sBAAsB,EACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,KAAK,aAAa,EAAmC,MAAM,WAAW,CAAC;AAQhF,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IACvC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IACpD,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAE,wPAmBtC,yBAAyB,CAAC,CAAC,CAAC;;;;;;;;6BAyFK,MAAM;;;uBA7CZ,SAAS,CAAC,CAAC,CAAC;0BAkJT,MAAM;;;;CAqCtC,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export type { CounterInputIcons, CounterInputProps } from "./CounterInput";
|
|
2
2
|
export { CounterInput } from "./CounterInput";
|
|
3
|
-
export type
|
|
4
|
-
export { DropdownInput } from "./DropdownInput";
|
|
5
|
-
export { DropdownInputBase, type DropdownInputBaseProps, } from "./DropdownInputBase";
|
|
3
|
+
export { DropdownInput, type DropdownInputProps, type DropdownInputStyles, } from "./dropdownInput";
|
|
6
4
|
export type { InputActionProps, InputActionStyles, } from "./InputAction";
|
|
7
5
|
export { InputAction } from "./InputAction";
|
|
8
6
|
export type { InputBaseProps, InputBaseStyles } from "./InputBase";
|
|
@@ -11,7 +9,7 @@ export type { InputRowContainerProps } from "./InputRowContainer";
|
|
|
11
9
|
export { InputRowContainer } from "./InputRowContainer";
|
|
12
10
|
export type { InputScaffoldIcons, InputScaffoldProps, InputScaffoldStyles, } from "./InputScaffold";
|
|
13
11
|
export { InputScaffold } from "./InputScaffold";
|
|
14
|
-
export type { FractionValue, NumberInputIcons, NumberInputProps, NumberInputValue, NumberValue, RangeValue, } from "./NumberInput";
|
|
12
|
+
export type { FractionValue, NumberInputIcons, NumberInputPlaceholders, NumberInputProps, NumberInputValue, NumberValue, RangeValue, } from "./NumberInput";
|
|
15
13
|
export { NumberInput } from "./NumberInput";
|
|
16
14
|
export type { RatingInputIcons, RatingInputProps, RatingInputStyles, } from "./RatingInput";
|
|
17
15
|
export { RatingInput } from "./RatingInput";
|
|
@@ -19,7 +17,7 @@ export type { SelectionInputIcons, SelectionInputProps, SelectionInputStyles, }
|
|
|
19
17
|
export { SelectionInput } from "./SelectionInput";
|
|
20
18
|
export type { TextInputProps, TextInputStyles } from "./TextInput";
|
|
21
19
|
export { TextInput } from "./TextInput";
|
|
22
|
-
export type { TimeInputIcons, TimeInputProps, TimeInputValue, } from "./TimeInput";
|
|
20
|
+
export type { TimeInputIcons, TimeInputPlaceholders, TimeInputProps, TimeInputValue, } from "./TimeInput";
|
|
23
21
|
export { TimeInput } from "./TimeInput";
|
|
24
22
|
export type { ToggleInputIcons, ToggleInputProps, ToggleInputStyles, } from "./ToggleInput";
|
|
25
23
|
export { ToggleInput } from "./ToggleInput";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACH,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GAC3B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACR,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACR,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACR,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,UAAU,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACR,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACR,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACR,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,cAAc,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACR,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type ColorValue } from "react-native";
|
|
1
|
+
import { type ColorValue, type FlatListProps, type ListRenderItem } from "react-native";
|
|
3
2
|
import type { DeepPartial } from "@reillymc/es-utils";
|
|
4
3
|
export type MenuStyles = {
|
|
5
4
|
parentMargin: number;
|
|
@@ -7,10 +6,22 @@ export type MenuStyles = {
|
|
|
7
6
|
borderRadius: number;
|
|
8
7
|
padding: number;
|
|
9
8
|
gap: number;
|
|
9
|
+
maxHeight: number;
|
|
10
10
|
};
|
|
11
|
-
export type MenuProps =
|
|
12
|
-
|
|
11
|
+
export type MenuProps<T = unknown> = {
|
|
12
|
+
data: ReadonlyArray<T>;
|
|
13
|
+
renderItem: ListRenderItem<T>;
|
|
14
|
+
keyExtractor: (item: T, index: number) => string;
|
|
13
15
|
reverse?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
maxHeight?: number;
|
|
17
|
+
onScroll?: FlatListProps<T>["onScroll"];
|
|
18
|
+
showsScrollIndicator?: boolean;
|
|
19
|
+
style?: DeepPartial<MenuStyles>;
|
|
20
|
+
/**
|
|
21
|
+
* Passthrough for list features such as pagination/async loading
|
|
22
|
+
* (`onEndReached`, `ListFooterComponent`, `refreshing`, …).
|
|
23
|
+
*/
|
|
24
|
+
listProps?: Omit<FlatListProps<T>, "data" | "renderItem" | "keyExtractor" | "inverted" | "horizontal" | "style" | "contentContainerStyle" | "showsVerticalScrollIndicator">;
|
|
25
|
+
};
|
|
26
|
+
export declare const Menu: <T>({ data, renderItem, keyExtractor, reverse, maxHeight, onScroll, showsScrollIndicator, style, listProps, }: MenuProps<T>) => import("react").JSX.Element;
|
|
16
27
|
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EAEf,KAAK,aAAa,EAClB,KAAK,cAAc,EAGtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,MAAM,UAAU,GAAG;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,UAAU,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI;IACjC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC9B,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACxC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAEhC;;;OAGG;IACH,SAAS,CAAC,EAAE,IAAI,CACZ,aAAa,CAAC,CAAC,CAAC,EACd,MAAM,GACN,YAAY,GACZ,cAAc,GACd,UAAU,GACV,YAAY,GACZ,OAAO,GACP,uBAAuB,GACvB,8BAA8B,CACnC,CAAC;CACL,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,CAAC,EAAG,2GAUtB,SAAS,CAAC,CAAC,CAAC,gCAwBd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK,KAAG,
|
|
1
|
+
{"version":3,"file":"Menu.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK,KAAG,UAWhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,MAAM,MAAM,cAAc,GAAG;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,MAAM,MAAM,cAAc,GAAG;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAiCtC,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { FunctionComponent, ReactNode } from "react";
|
|
2
|
-
import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
|
+
import { type ColorValue, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
export interface ToastStyles {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
container: {
|
|
5
|
+
backgroundColor: ColorValue;
|
|
6
|
+
padding: number;
|
|
7
|
+
borderRadius: number;
|
|
8
|
+
};
|
|
6
9
|
}
|
|
7
10
|
export interface ToastProps {
|
|
8
11
|
action?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EACH,KAAK,UAAU,EACf,KAAK,SAAS,EAGd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAStB,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE;QACP,eAAe,EAAE,UAAU,CAAC;QAC5B,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;CACL;AACD,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAMD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CA4B/C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Theme } from "../../theme/theme";
|
|
2
2
|
import type { ToastStyles } from "./Toast";
|
|
3
|
-
export declare const defaultToastStyles: ({ spacing }: Theme) => ToastStyles;
|
|
3
|
+
export declare const defaultToastStyles: ({ color, spacing, border, }: Theme) => ToastStyles;
|
|
4
4
|
//# sourceMappingURL=Toast.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/Toast.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,kBAAkB,GAAI,
|
|
1
|
+
{"version":3,"file":"Toast.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/Toast.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,kBAAkB,GAAI,6BAIhC,KAAK,KAAG,WAMT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACH,KAAK,YAAY,EACjB,SAAS,EACT,eAAe,GAClB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACH,KAAK,YAAY,EACjB,SAAS,EACT,eAAe,GAClB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splits a value into controlled (prop-driven) or uncontrolled (internal)
|
|
3
|
+
* state. `isControlled` is determined by the caller (e.g. whether the prop key
|
|
4
|
+
* was supplied) so that clearing back to `undefined` keeps working in
|
|
5
|
+
* controlled mode.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useControlledState: <T>(isControlled: boolean, value: T | undefined, defaultValue: T | undefined) => readonly [T | undefined, (nextValue: T | undefined) => void];
|
|
8
|
+
//# sourceMappingURL=useControlledState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useControlledState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useControlledState.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAChC,cAAc,OAAO,EACrB,OAAO,CAAC,GAAG,SAAS,EACpB,cAAc,CAAC,GAAG,SAAS,0CAQE,CAAC,GAAG,SAAS,UAO7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePersistentKeyboardHeight.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePersistentKeyboardHeight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePersistentKeyboardHeight.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePersistentKeyboardHeight.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,2BAA2B;;CAkBvC,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ThemeContextDefinition } from "../providers";
|
|
2
|
+
/**
|
|
3
|
+
* Reads the active theme. Pass a consumer extension type to see any custom
|
|
4
|
+
* tokens that were provided to `ThemeProvider` (e.g. `useTheme<AppTheme>()`).
|
|
5
|
+
*/
|
|
6
|
+
export declare function useTheme<E extends object = Record<never, never>>(): ThemeContextDefinition<E>;
|
|
2
7
|
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,QAAQ,CACpB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,KACtC,sBAAsB,CAAC,CAAC,CAAC,CAE7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** biome-ignore-all lint/suspicious/noExplicitAny: any prop definition is permitted */
|
|
2
|
-
import type { ThemeContextDefinition
|
|
2
|
+
import type { ThemeContextDefinition } from "../providers";
|
|
3
3
|
import type { Icons, StyleOverrides, Styles } from "../theme";
|
|
4
|
-
export type
|
|
4
|
+
export type ThemedStyles<E extends object = Record<never, never>> = ThemeContextDefinition<E>;
|
|
5
5
|
type StyleOnlyKey = keyof Styles;
|
|
6
6
|
type IconOnlyKey = keyof Icons;
|
|
7
7
|
type ComponentKey = StyleOnlyKey | IconOnlyKey;
|
|
@@ -22,7 +22,7 @@ type UseStylesReturn<C extends ComponentKey, G = undefined> = [
|
|
|
22
22
|
];
|
|
23
23
|
type AnyGenerator = (...args: any[]) => any;
|
|
24
24
|
type GeneratorResult<G extends AnyGenerator> = ReturnType<G>;
|
|
25
|
-
type GeneratorProps<G extends AnyGenerator> = Parameters<G> extends [
|
|
25
|
+
type GeneratorProps<G extends AnyGenerator> = Parameters<G> extends [ThemeContextDefinition<any>, infer U] ? U : never;
|
|
26
26
|
type UseStylesOptions<G extends AnyGenerator> = [GeneratorProps<G>] extends [
|
|
27
27
|
never
|
|
28
28
|
] ? [
|
|
@@ -47,4 +47,5 @@ type UseStylesOptions<G extends AnyGenerator> = [GeneratorProps<G>] extends [
|
|
|
47
47
|
export declare function useThemedStyles<C extends ComponentKey, G extends AnyGenerator>(componentName: C, generator: G, ...options: UseStylesOptions<G>): UseStylesReturn<C, GeneratorResult<G>>;
|
|
48
48
|
export declare function useThemedStyles<G extends AnyGenerator>(generator: G, ...options: UseStylesOptions<G>): GeneratorResult<G>;
|
|
49
49
|
export declare const useStyles: (componentStyles: StyleOverrides) => Styles;
|
|
50
|
+
export {};
|
|
50
51
|
//# sourceMappingURL=useThemedStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemedStyles.d.ts","sourceRoot":"","sources":["../../../src/hooks/useThemedStyles.tsx"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,KAAK,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"useThemedStyles.d.ts","sourceRoot":"","sources":["../../../src/hooks/useThemedStyles.tsx"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAI9D,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAC5D,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAS9B,KAAK,YAAY,GAAG,MAAM,MAAM,CAAC;AACjC,KAAK,WAAW,GAAG,MAAM,KAAK,CAAC;AAC/B,KAAK,YAAY,GAAG,YAAY,GAAG,WAAW,CAAC;AAE/C,KAAK,iBAAiB,GAAG;KACpB,CAAC,IAAI,MAAM,MAAM,GAAG,MAAM,KAAK,GAAG,CAAC,SAAS,MAAM,MAAM,GACnD,CAAC,SAAS,MAAM,KAAK,GACjB;QACI,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QACjB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;KACnB,GACD;QACI,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;KACpB,GACL,CAAC,SAAS,MAAM,KAAK,GACnB;QACI,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;KACnB,GACD,KAAK;CAChB,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,iBAAiB,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAE3E,KAAK,eAAe,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,GAAG,SAAS,IAAI;IAC1D,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;CAC5B,CAAC;AACF,KAAK,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE5C,KAAK,eAAe,CAAC,CAAC,SAAS,YAAY,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AAE7D,KAAK,cAAc,CAAC,CAAC,SAAS,YAAY,IACtC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE7E,KAAK,gBAAgB,CAAC,CAAC,SAAS,YAAY,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS;IACxE,KAAK;CACR,GACK;IACI,OAAO,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,cAAc,CAAC;KAC3B;CACJ,GACD;IACI,OAAO,EAAE;QACL,MAAM,CAAC,EAAE,cAAc,CAAC;QACxB,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;KAC5B;CACJ,CAAC;AAwDR;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,EAC1E,aAAa,EAAE,CAAC,EAChB,SAAS,EAAE,CAAC,EACZ,GAAG,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAChC,eAAe,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EAClD,SAAS,EAAE,CAAC,EACZ,GAAG,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAChC,eAAe,CAAC,CAAC,CAAC,CAAC;AAmCtB,eAAO,MAAM,SAAS,GAAI,iBAAiB,cAAc,WAgBxD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ThemeContextDefinition {
|
|
3
|
-
theme: Theme;
|
|
1
|
+
import type { Icons, Styles, Theme } from "../theme";
|
|
2
|
+
export interface ThemeContextDefinition<E extends object = Record<never, never>> {
|
|
3
|
+
theme: Theme & E;
|
|
4
4
|
styles: Styles;
|
|
5
5
|
icons: Icons;
|
|
6
6
|
}
|
|
7
|
-
export declare const ThemeContext: import("react").Context<ThemeContextDefinition
|
|
7
|
+
export declare const ThemeContext: import("react").Context<ThemeContextDefinition<Record<never, never>>>;
|
|
8
8
|
//# sourceMappingURL=ThemeContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeContext.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKrD,MAAM,WAAW,sBAAsB,CACnC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;IAEvC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,uEAIvB,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
import type { DeepPartial } from "@reillymc/es-utils";
|
|
3
|
-
import { type Icons, type StyleOverrides, type
|
|
4
|
-
interface ThemeProviderProps {
|
|
5
|
-
|
|
3
|
+
import { type Icons, type StyleOverrides, type ThemeOverrides } from "../theme";
|
|
4
|
+
export interface ThemeProviderProps<E extends object = Record<never, never>> {
|
|
5
|
+
/**
|
|
6
|
+
* The active theme. Consumers may extend it with their own tokens
|
|
7
|
+
* (`ThemeOverrides & E`) and read them back via `useTheme<E>()`.
|
|
8
|
+
*/
|
|
9
|
+
theme?: ThemeOverrides & E;
|
|
6
10
|
styles?: StyleOverrides;
|
|
7
11
|
icons?: DeepPartial<Icons>;
|
|
8
12
|
children?: ReactNode;
|
|
9
13
|
}
|
|
10
|
-
export declare const ThemeProvider:
|
|
11
|
-
export {};
|
|
14
|
+
export declare const ThemeProvider: <E extends object = Record<never, never>>({ theme: initialTheme, styles: initialStyles, icons: initialIcons, children, }: ThemeProviderProps<E>) => import("react").JSX.Element;
|
|
12
15
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAEH,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACtB,MAAM,UAAU,CAAC;AAKlB,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;IACvE;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,gFAKpE,kBAAkB,CAAC,CAAC,CAAC,gCAUvB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export type { ComponentIconAssets, Icons } from "./icons";
|
|
2
|
+
export { createStyles, type StyleOverrides, type Styles } from "./styles";
|
|
3
|
+
export { createTheme, type Theme, type ThemeOverrides } from "./theme";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DeepPartial } from "@reillymc/es-utils";
|
|
2
|
-
import type { ActionStyles, AlertIndicatorStyles, AvatarStyles, ButtonBaseStyles, ButtonStyles, DropdownInputStyles,
|
|
2
|
+
import type { ActionStyles, AlertIndicatorStyles, AnchoredContainerStyles, AvatarStyles, ButtonBaseStyles, ButtonStyles, DropdownInputStyles, HighlightedTextStyles, IconActionBaseStyles, IconActionStyles, IconBaseStyles, IconButtonBaseStyles, IconButtonStyles, IconStyles, InputActionStyles, InputBaseStyles, InputScaffoldStyles, InteractiveIconStyles, InteractiveTextStyles, ListItemStyles, MenuItemStyles, MenuStyles, RatingInputStyles, RatingStyles, SelectionInputStyles, SwipeActionStyles, TagStyles, TextStyles, ToastStyles, ToggleInputStyles } from "../components";
|
|
3
3
|
import type { Theme } from "./theme";
|
|
4
4
|
export type Styles = {
|
|
5
5
|
text: TextStyles;
|
|
@@ -37,7 +37,7 @@ export type Styles = {
|
|
|
37
37
|
menu: MenuStyles;
|
|
38
38
|
menuItem: MenuItemStyles;
|
|
39
39
|
swipeAction: SwipeActionStyles;
|
|
40
|
-
|
|
40
|
+
anchoredContainer: AnchoredContainerStyles;
|
|
41
41
|
tag: TagStyles;
|
|
42
42
|
};
|
|
43
43
|
export type StyleOverrides = DeepPartial<Styles>;
|
|
@@ -49,5 +49,10 @@ export type CreateStyles = (theme: Theme) => Styles;
|
|
|
49
49
|
*/
|
|
50
50
|
export declare const createDefaultStyles: CreateStyles;
|
|
51
51
|
export declare const MergeStyles: (styles: Styles, overrides?: StyleOverrides | undefined) => Styles;
|
|
52
|
+
/**
|
|
53
|
+
* Builds the full `Styles` registry for a theme, optionally merged with
|
|
54
|
+
* consumer style overrides.
|
|
55
|
+
*/
|
|
56
|
+
export declare const createStyles: (theme: Theme, overrides?: StyleOverrides) => Styles;
|
|
52
57
|
export declare const MergeStyleSlice: <T>(base: T, override: unknown) => T;
|
|
53
58
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/theme/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,KAAK,EACR,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/theme/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,KAAK,EACR,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,WAAW,EACX,iBAAiB,EACpB,MAAM,eAAe,CAAC;AA8BvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,MAAM,GAAG;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,eAAe,EAAE,qBAAqB,CAAC;IACvC,eAAe,EAAE,qBAAqB,CAAC;IAEvC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,qBAAqB,CAAC;IAEvC,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,cAAc,EAAE,oBAAoB,CAAC;IAErC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,EAAE,oBAAoB,CAAC;IACrC,UAAU,EAAE,gBAAgB,CAAC;IAE7B,SAAS,EAAE,eAAe,CAAC;IAC3B,aAAa,EAAE,mBAAmB,CAAC;IACnC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,WAAW,EAAE,iBAAiB,CAAC;IAC/B,cAAc,EAAE,oBAAoB,CAAC;IACrC,WAAW,EAAE,iBAAiB,CAAC;IAE/B,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,EAAE,oBAAoB,CAAC;IAErC,aAAa,EAAE,mBAAmB,CAAC;IACnC,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE;QACJ,MAAM,EAAE;YACJ,QAAQ,EAAE;iBACL,IAAI,IAAI,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM;aAClD,CAAC;SACL,CAAC;KACL,CAAC;IACF,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C,GAAG,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAyChC,CAAC;AAEH,eAAO,MAAM,WAAW,GACpB,QAAQ,MAAM,EACd,YAAW,cAAc,GAAG,SAAc,KAC3C,MAAsC,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,YAAY,GACrB,OAAO,KAAK,EACZ,YAAY,cAAc,KAC3B,MAA4D,CAAC;AAEhE,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU,OAAO,KAAG,CACI,CAAC"}
|
|
@@ -59,11 +59,6 @@ export declare const DefaultTheme: {
|
|
|
59
59
|
warning: string;
|
|
60
60
|
};
|
|
61
61
|
spacing: {
|
|
62
|
-
screenContentTop: number;
|
|
63
|
-
pageHorizontal: number;
|
|
64
|
-
pageBottom: number;
|
|
65
|
-
pageTop: number;
|
|
66
|
-
navigationActionHorizontal: number;
|
|
67
62
|
large: number;
|
|
68
63
|
medium: number;
|
|
69
64
|
small: number;
|
|
@@ -82,6 +77,10 @@ export declare const DefaultTheme: {
|
|
|
82
77
|
};
|
|
83
78
|
};
|
|
84
79
|
};
|
|
85
|
-
export declare
|
|
86
|
-
|
|
80
|
+
export declare const MergeTheme: <E extends object = Record<never, never>>(first?: ThemeOverrides & E, second?: ThemeOverrides & DeepPartial<NoInfer<E>>) => Theme & E;
|
|
81
|
+
/**
|
|
82
|
+
* Builds a complete theme from a single set of base overrides, optionally
|
|
83
|
+
* deriving additional app-owned tokens from the resolved base theme.
|
|
84
|
+
*/
|
|
85
|
+
export declare const createTheme: <E extends object = Record<never, never>>(overrides?: ThemeOverrides, createExtras?: (theme: Theme) => E) => Theme & E;
|
|
87
86
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/theme/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/theme/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,MAAM,KAAK,GAAG,OAAO,YAAY,CAAC;AAExC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AAEhD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGxB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,QAAQ,cAAc,GAAG,CAAC,EAC1B,SAAS,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAClD,KAAK,GAAG,CAAoE,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC/D,YAAY,cAAc,EAC1B,eAAe,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,KACnC,KAAK,GAAG,CAMV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reillymc/react-native-components",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.9",
|
|
4
4
|
"description": "A collection of React Native components and resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -75,10 +75,11 @@
|
|
|
75
75
|
"@babel/preset-typescript": "^7.27.1",
|
|
76
76
|
"@biomejs/biome": "2.4.9",
|
|
77
77
|
"@expo/metro-runtime": "~56.0.15",
|
|
78
|
-
"@react-native/babel-preset": "0.85.3",
|
|
79
78
|
"@react-native-vector-icons/octicons": "^21.1.2",
|
|
79
|
+
"@react-native/babel-preset": "0.85.3",
|
|
80
80
|
"@types/lodash.merge": "^4.6.9",
|
|
81
81
|
"@types/react": "~19.2.0",
|
|
82
|
+
"@types/react-dom": "~19.2.0",
|
|
82
83
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
83
84
|
"babel-preset-expo": "~56.0.0",
|
|
84
85
|
"dependency-cruiser": "^17.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/container/FloatingContainer.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{useRef,useState}from"react";import{I18nManager,KeyboardAvoidingView,Platform,StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{FullWindowOverlay}from"react-native-screens";import{useThemedStyles}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";var EMPTY_PANEL_LAYOUT={parentY:0,parentHeight:0,inverted:false,visibleAreaHeight:0};export var FloatingContainer=t0=>{var $=_c(20);var parentRef=t0.parentRef,show=t0.show,t1=t0.position,containerStyle=t0.containerStyle,children=t0.children;var position=t1===undefined?"auto":t1;var containerRef=useRef(null);var _useState=useState(),_useState2=_slicedToArray(_useState,2),layout=_useState2[0],setLayout=_useState2[1];var t2;if($[0]!==layout){t2={props:{layout}};$[0]=layout;$[1]=t2;}else{t2=$[1];}var _useThemedStyles=useThemedStyles("floatingContainer",createStyles,t2),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var _useWindowDimensions=useWindowDimensions(),screenHeight=_useWindowDimensions.height,screenWidth=_useWindowDimensions.width;var _useSafeAreaInsets=useSafeAreaInsets(),top=_useSafeAreaInsets.top;var _useState3=useState(screenHeight),_useState4=_slicedToArray(_useState3,2),visibleAreaHeight=_useState4[0],setVisibleAreaHeight=_useState4[1];var t3;if($[2]===Symbol.for("react.memo_cache_sentinel")){t3=e=>{setVisibleAreaHeight(e.nativeEvent.layout.height);};$[2]=t3;}else{t3=$[2];}var onVisibleAreaLayout=t3;var t4;if($[3]!==parentRef||$[4]!==position||$[5]!==top||$[6]!==visibleAreaHeight){t4=e_0=>{parentRef.current?.measureInWindow((parentX,parentY,parentWidth,parentHeight)=>{var panelHeight=e_0.nativeEvent.layout.height;var parentBottom=parentY+parentHeight;var availableBelow=visibleAreaHeight-top-parentBottom;var inverted=position==="above"||availableBelow<panelHeight;setLayout({parentY,parentHeight,inverted,visibleAreaHeight,parentX,parentWidth});});};$[3]=parentRef;$[4]=position;$[5]=top;$[6]=visibleAreaHeight;$[7]=t4;}else{t4=$[7];}var onPanelLayout=t4;var panelX=layout?.parentX!==undefined&&layout.parentWidth!==undefined?I18nManager.isRTL?screenWidth-layout.parentX-layout.parentWidth:layout.parentX:layout?.parentX;var t5;if($[8]===Symbol.for("react.memo_cache_sentinel")){t5=Platform.select({ios:"padding"});$[8]=t5;}else{t5=$[8];}var t6;if($[9]!==children||$[10]!==containerStyle||$[11]!==layout||$[12]!==onPanelLayout||$[13]!==panelX||$[14]!==show||$[15]!==styles.container){t6=show&&_jsx(View,{ref:containerRef,onLayout:onPanelLayout,style:[styles.container,panelX!==undefined&&{left:panelX},containerStyle],children:typeof children==="function"?children(layout??EMPTY_PANEL_LAYOUT):children});$[9]=children;$[10]=containerStyle;$[11]=layout;$[12]=onPanelLayout;$[13]=panelX;$[14]=show;$[15]=styles.container;$[16]=t6;}else{t6=$[16];}var t7;if($[17]!==styles.keyboardView||$[18]!==t6){t7=_jsx(FullWindowOverlay,{children:_jsx(KeyboardAvoidingView,{behavior:t5,style:styles.keyboardView,onLayout:onVisibleAreaLayout,children:t6})});$[17]=styles.keyboardView;$[18]=t6;$[19]=t7;}else{t7=$[19];}return t7;};var createStyles=({styles:{floatingContainer}},{layout})=>StyleSheet.create({keyboardView:{...StyleSheet.absoluteFill,pointerEvents:"box-none"},container:layout?{position:"absolute",zIndex:10,width:layout.parentWidth,overflow:"hidden",top:layout.inverted?undefined:layout.parentY+layout.parentHeight,bottom:layout.inverted?layout.visibleAreaHeight-layout.parentY:undefined,marginTop:floatingContainer.parentMargin,marginBottom:floatingContainer.parentMargin}:{opacity:0,pointerEvents:"box-none"}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var defaultFloatingContainerStyles=({spacing})=>({parentMargin:spacing.small});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/container/FloatingContainer.web.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{useRef,useState}from"react";import{StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePersistentKeyboardHeight,useThemedStyles}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";var EMPTY_PANEL_LAYOUT={parentY:0,parentHeight:0,inverted:false,visibleAreaHeight:0};export var FloatingContainer=t0=>{var $=_c(19);var parentRef=t0.parentRef,show=t0.show,t1=t0.position,containerStyle=t0.containerStyle,children=t0.children;var position=t1===undefined?"auto":t1;var containerRef=useRef(null);var _useState=useState(),_useState2=_slicedToArray(_useState,2),layout=_useState2[0],setLayout=_useState2[1];var t2;if($[0]!==layout){t2={props:{layout}};$[0]=layout;$[1]=t2;}else{t2=$[1];}var _useThemedStyles=useThemedStyles("floatingContainer",createStyles,t2),_useThemedStyles2=_slicedToArray(_useThemedStyles,1),styles=_useThemedStyles2[0];var _useWindowDimensions=useWindowDimensions(),screenHeight=_useWindowDimensions.height;var _useSafeAreaInsets=useSafeAreaInsets(),top=_useSafeAreaInsets.top;var _usePersistentKeyboar=usePersistentKeyboardHeight(),keyboardHeight=_usePersistentKeyboar.keyboardHeight;var t3;if($[2]!==keyboardHeight||$[3]!==parentRef||$[4]!==position||$[5]!==screenHeight||$[6]!==top){t3=e=>{parentRef.current?.measureInWindow((_ix,parentY,_iw,parentHeight)=>{var panelHeight=e.nativeEvent.layout.height;var size=parentY+parentHeight+panelHeight;var screenMaxHeight=screenHeight-keyboardHeight-top;setLayout({parentY,parentHeight,inverted:position==="above"||size>screenMaxHeight,visibleAreaHeight:screenMaxHeight});});};$[2]=keyboardHeight;$[3]=parentRef;$[4]=position;$[5]=screenHeight;$[6]=top;$[7]=t3;}else{t3=$[7];}var onLayout=t3;var t4;if($[8]!==containerStyle||$[9]!==styles.container){t4=[styles.container,containerStyle];$[8]=containerStyle;$[9]=styles.container;$[10]=t4;}else{t4=$[10];}var t5;if($[11]!==children||$[12]!==layout||$[13]!==show){t5=show&&(typeof children==="function"?children(layout??EMPTY_PANEL_LAYOUT):children);$[11]=children;$[12]=layout;$[13]=show;$[14]=t5;}else{t5=$[14];}var t6;if($[15]!==onLayout||$[16]!==t4||$[17]!==t5){t6=_jsx(View,{ref:containerRef,style:t4,onLayout:onLayout,children:t5});$[15]=onLayout;$[16]=t4;$[17]=t5;$[18]=t6;}else{t6=$[18];}return t6;};var createStyles=({styles:{floatingContainer}},{layout})=>StyleSheet.create({container:{position:"absolute",bottom:layout?.inverted?layout.parentHeight:undefined,opacity:layout?1:0,zIndex:10,width:"100%",overflow:"hidden",top:layout?.inverted?undefined:layout?.parentHeight,marginTop:layout?.inverted?undefined:floatingContainer.parentMargin,marginBottom:layout?.inverted?floatingContainer.parentMargin:undefined}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/DropdownInput.tsx";var _excluded=["label","helpText","hasError","mandatory","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{DropdownInputBase}from"./DropdownInputBase";import{InputScaffold}from"./InputScaffold";import{jsx as _jsx}from"react/jsx-runtime";export var DropdownInput=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;hasError=t0.hasError;mandatory=t0.mandatory;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(DropdownInputBase,{...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 +0,0 @@
|
|
|
1
|
-
var _jsxFileName="/home/runner/work/ReactNativeComponents/ReactNativeComponents/src/components/input/DropdownInputBase.tsx";var _excluded=["items","selectedValue","minimumSearchLength","maxSuggestionCount","selectBehaviour","panelPosition","onSelect","textValue","onChangeText","onBlur","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{useDeferredValue,useState}from"react";import{useForwardedRef}from"../../hooks";import{FloatingContainer}from"../container";import{Menu,MenuItem}from"../menu";import{InputBase}from"./InputBase";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";var EMPTY_ITEMS=[];var isSelectableItem=({item,label,description},search,selectedValue)=>{var itemId="id"in item?item.id:item.value;if(selectedValue!==undefined&&itemId===selectedValue)return false;if(label===search)return false;return label.includes(search)||!!description?.includes(search);};export var DropdownInputBase=t0=>{var $=_c(36);var onBlur;var onChangeText;var onSelect;var panelPosition;var props;var ref;var selectedValue;var t1;var t2;var t3;var t4;var textValue;if($[0]!==t0){t1=t0.items;selectedValue=t0.selectedValue;t2=t0.minimumSearchLength;t3=t0.maxSuggestionCount;t4=t0.selectBehaviour;panelPosition=t0.panelPosition;onSelect=t0.onSelect;textValue=t0.textValue;onChangeText=t0.onChangeText;onBlur=t0.onBlur;ref=t0.ref;props=_objectWithoutProperties(t0,_excluded);$[0]=t0;$[1]=onBlur;$[2]=onChangeText;$[3]=onSelect;$[4]=panelPosition;$[5]=props;$[6]=ref;$[7]=selectedValue;$[8]=t1;$[9]=t2;$[10]=t3;$[11]=t4;$[12]=textValue;}else{onBlur=$[1];onChangeText=$[2];onSelect=$[3];panelPosition=$[4];props=$[5];ref=$[6];selectedValue=$[7];t1=$[8];t2=$[9];t3=$[10];t4=$[11];textValue=$[12];}var items=t1===undefined?EMPTY_ITEMS:t1;var minimumSearchLength=t2===undefined?1:t2;var maxSuggestionCount=t3===undefined?5:t3;var selectBehaviour=t4===undefined?"blurAndSelect":t4;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hasFocus=_useState2[0],setHasFocus=_useState2[1];var inputRef=useForwardedRef(ref);var normalizedItems=items.map(_temp);var t5;if($[13]!==selectedValue){t5=t6=>{var item_0=t6.item;if("id"in item_0){return item_0.id===selectedValue;}return item_0.value===selectedValue;};$[13]=selectedValue;$[14]=t5;}else{t5=$[14];}var existingItem=normalizedItems.find(t5);var existingItemLabel=existingItem?.item.label;var t6;if($[15]===Symbol.for("react.memo_cache_sentinel")){t6=()=>{setHasFocus(true);};$[15]=t6;}else{t6=$[15];}var handleFocus=t6;var t7;if($[16]!==inputRef||$[17]!==onSelect||$[18]!==selectBehaviour||$[19]!==selectedValue){t7=item_1=>{var selectedItemId="id"in item_1?item_1.id:item_1.value;var isAlreadySelected=selectedValue!==undefined&&selectedValue===selectedItemId;if(!isAlreadySelected){onSelect(item_1);}if(selectBehaviour==="blurAndSelect"){inputRef.current?.blur();}};$[16]=inputRef;$[17]=onSelect;$[18]=selectBehaviour;$[19]=selectedValue;$[20]=t7;}else{t7=$[20];}var handleSelect=t7;var inputText=textValue??existingItemLabel??"";var deferredInputText=useDeferredValue(inputText);var search=deferredInputText.toLowerCase();var handleBlur=e=>{var blurSearch=inputText.toLowerCase();var existingItem_0=normalizedItems.find(t8=>{var label=t8.label;return label===blurSearch;})?.item;if(existingItem_0){var existingItemId="id"in existingItem_0?existingItem_0.id:existingItem_0.value;var isAlreadySelected_0=selectedValue!==undefined&&selectedValue===existingItemId;if(!isAlreadySelected_0){onSelect(existingItem_0);}}setHasFocus(false);onBlur?.(e);};var handleChangeText=text=>{var didMatchSelection=selectedValue!==undefined&&existingItemLabel!==undefined&&text!==existingItemLabel;if(didMatchSelection){onSelect(undefined);}onChangeText?.(text);};var isSelectionActive=selectedValue!==undefined&&existingItemLabel!==undefined&&inputText===existingItemLabel;var filteredItems=[];for(var normalized of normalizedItems){if(filteredItems.length>=maxSuggestionCount){break;}if(isSelectableItem(normalized,search,selectedValue)){filteredItems.push(normalized.item);}}var showDropdownPanel=hasFocus&&!isSelectionActive&&!!filteredItems.length&&inputText.length>=minimumSearchLength;var t9;if($[21]!==handleBlur||$[22]!==handleChangeText||$[23]!==handleFocus||$[24]!==inputRef||$[25]!==inputText||$[26]!==props){t9=_jsx(InputBase,{...props,ref:inputRef,value:inputText,onFocus:handleFocus,onBlur:handleBlur,onChangeText:handleChangeText,autoCorrect:false,spellCheck:false});$[21]=handleBlur;$[22]=handleChangeText;$[23]=handleFocus;$[24]=inputRef;$[25]=inputText;$[26]=props;$[27]=t9;}else{t9=$[27];}var t10=t11=>{var inverted=t11.inverted;return _jsx(Menu,{reverse:inverted,children:filteredItems.map(item_2=>_jsx(MenuItem,{label:item_2.label,description:item_2.description,searchValue:deferredInputText,onPress:()=>handleSelect(item_2)},"id"in item_2?item_2.id:item_2.value))});};var t12;if($[28]!==inputRef||$[29]!==panelPosition||$[30]!==showDropdownPanel||$[31]!==t10){t12=_jsx(FloatingContainer,{parentRef:inputRef,show:showDropdownPanel,position:panelPosition,children:t10});$[28]=inputRef;$[29]=panelPosition;$[30]=showDropdownPanel;$[31]=t10;$[32]=t12;}else{t12=$[32];}var t13;if($[33]!==t12||$[34]!==t9){t13=_jsxs(_Fragment,{children:[t9,t12]});$[33]=t12;$[34]=t9;$[35]=t13;}else{t13=$[35];}return t13;};function _temp(item){return{item,label:item.label.toLowerCase(),description:item.description?.toLowerCase()};}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type FC, type ReactNode, type RefObject } from "react";
|
|
2
|
-
import { type StyleProp, type TextInput, type ViewStyle } from "react-native";
|
|
3
|
-
export type PanelLayout = {
|
|
4
|
-
parentY: number;
|
|
5
|
-
parentHeight: number;
|
|
6
|
-
inverted: boolean;
|
|
7
|
-
visibleAreaHeight: number;
|
|
8
|
-
parentX?: number;
|
|
9
|
-
parentWidth?: number;
|
|
10
|
-
};
|
|
11
|
-
export type FloatingContainerStyles = {
|
|
12
|
-
parentMargin: number;
|
|
13
|
-
};
|
|
14
|
-
export interface FloatingContainerProps {
|
|
15
|
-
parentRef: RefObject<TextInput | null>;
|
|
16
|
-
show?: boolean;
|
|
17
|
-
position?: "auto" | "above";
|
|
18
|
-
children?: ReactNode | ((panelLayout: PanelLayout) => ReactNode);
|
|
19
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
20
|
-
}
|
|
21
|
-
export declare const FloatingContainer: FC<FloatingContainerProps>;
|
|
22
|
-
//# sourceMappingURL=FloatingContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/container/FloatingContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAAE,EACP,KAAK,SAAS,EACd,KAAK,SAAS,EAGjB,MAAM,OAAO,CAAC;AACf,OAAO,EAKH,KAAK,SAAS,EAEd,KAAK,SAAS,EAGd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAMtB,MAAM,MAAM,WAAW,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACnC,SAAS,EAAE,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC;IACjE,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACzC;AASD,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA+ExD,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Theme } from "../../theme/theme";
|
|
2
|
-
import type { FloatingContainerStyles } from "./FloatingContainer";
|
|
3
|
-
export declare const defaultFloatingContainerStyles: ({ spacing, }: Theme) => FloatingContainerStyles;
|
|
4
|
-
//# sourceMappingURL=FloatingContainer.styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingContainer.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/container/FloatingContainer.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,eAAO,MAAM,8BAA8B,GAAI,cAE5C,KAAK,KAAG,uBAET,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingContainer.web.d.ts","sourceRoot":"","sources":["../../../../src/components/container/FloatingContainer.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAoB,MAAM,OAAO,CAAC;AAclD,OAAO,KAAK,EAAE,sBAAsB,EAAe,MAAM,qBAAqB,CAAC;AAS/E,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAgDxD,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type DropdownInputBaseProps } from "./DropdownInputBase";
|
|
2
|
-
import { type InputScaffoldFieldProps } from "./InputScaffold";
|
|
3
|
-
export interface DropdownInputStyles {
|
|
4
|
-
panelGap: number;
|
|
5
|
-
}
|
|
6
|
-
export type DropdownInputProps<T = string> = Pick<DropdownInputBaseProps<T>, "autoCapitalize" | "returnKeyType" | "returnKeyLabel" | "onBlur" | "placeholder" | "onChangeText" | "textValue" | "clearButtonMode" | "maxLength" | "onSubmitEditing" | "autoFocus" | "submitBehavior" | "disabled" | "variant" | "items" | "selectedValue" | "minimumSearchLength" | "maxSuggestionCount" | "panelPosition" | "onSelect" | "ref" | "selectBehaviour"> & InputScaffoldFieldProps;
|
|
7
|
-
export declare const DropdownInput: <T>({ label, helpText, hasError, mandatory, containerStyle, ...props }: DropdownInputProps<T>) => import("react").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=DropdownInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownInput.d.ts","sourceRoot":"","sources":["../../../../src/components/input/DropdownInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAiB,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,CAC7C,sBAAsB,CAAC,CAAC,CAAC,EACvB,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,aAAa,GACb,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,gBAAgB,GAChB,UAAU,GACV,SAAS,GACT,OAAO,GACP,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,eAAe,GACf,UAAU,GACV,KAAK,GACL,iBAAiB,CACtB,GACG,uBAAuB,CAAC;AAC5B,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,oEAO/B,kBAAkB,CAAC,CAAC,CAAC,gCAUvB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownInput.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/input/DropdownInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,eAAO,MAAM,0BAA0B,GACnC,QAAQ,KAAK,KACd,mBAED,CAAC"}
|