@korsolutions/ui 0.0.90 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/components/avatar/components/avatar-image.js.map +1 -1
- package/dist/module/components/badge/badge.js +1 -6
- package/dist/module/components/badge/badge.js.map +1 -1
- package/dist/module/components/badge/variants/default.js +3 -2
- package/dist/module/components/badge/variants/default.js.map +1 -1
- package/dist/module/components/badge/variants/secondary.js +2 -1
- package/dist/module/components/badge/variants/secondary.js.map +1 -1
- package/dist/module/components/card/card-title.js +2 -3
- package/dist/module/components/card/card-title.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-list.js +24 -0
- package/dist/module/components/combobox/components/combobox-list.js.map +1 -0
- package/dist/module/components/combobox/components/combobox-option.js +17 -25
- package/dist/module/components/combobox/components/combobox-option.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-overlay.js +0 -1
- package/dist/module/components/combobox/components/combobox-overlay.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-root.js +62 -11
- package/dist/module/components/combobox/components/combobox-root.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-trigger.js +32 -18
- package/dist/module/components/combobox/components/combobox-trigger.js.map +1 -1
- package/dist/module/components/combobox/context.js.map +1 -1
- package/dist/module/components/combobox/index.js +2 -0
- package/dist/module/components/combobox/index.js.map +1 -1
- package/dist/module/components/link/link.js +16 -6
- package/dist/module/components/link/link.js.map +1 -1
- package/dist/module/components/menu/components/menu-selection-indicator.js +4 -3
- package/dist/module/components/menu/components/menu-selection-indicator.js.map +1 -1
- package/dist/module/components/phone-input/components/phone-input.js +16 -7
- package/dist/module/components/phone-input/components/phone-input.js.map +1 -1
- package/dist/module/components/portal/portal.js.map +1 -1
- package/dist/module/components/select/components/select-option.js +13 -16
- package/dist/module/components/select/components/select-option.js.map +1 -1
- package/dist/module/components/select/components/select-trigger.js +3 -1
- package/dist/module/components/select/components/select-trigger.js.map +1 -1
- package/dist/module/components/select/variants/default.js +6 -3
- package/dist/module/components/select/variants/default.js.map +1 -1
- package/dist/module/hooks/use-relative-position.js.map +1 -1
- package/dist/module/utils/normalize-layout.js.map +1 -1
- package/dist/typescript/src/components/avatar/components/avatar-image.d.ts +2 -2
- package/dist/typescript/src/components/avatar/components/avatar-image.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/badge.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/variants/secondary.d.ts.map +1 -1
- package/dist/typescript/src/components/card/card-title.d.ts +2 -2
- package/dist/typescript/src/components/card/card-title.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-list.d.ts +12 -0
- package/dist/typescript/src/components/combobox/components/combobox-list.d.ts.map +1 -0
- package/dist/typescript/src/components/combobox/components/combobox-option.d.ts +5 -5
- package/dist/typescript/src/components/combobox/components/combobox-option.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-root.d.ts +26 -6
- package/dist/typescript/src/components/combobox/components/combobox-root.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-trigger.d.ts +13 -4
- package/dist/typescript/src/components/combobox/components/combobox-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/context.d.ts +6 -2
- package/dist/typescript/src/components/combobox/context.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/index.d.ts +3 -0
- package/dist/typescript/src/components/combobox/index.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/types.d.ts +2 -3
- package/dist/typescript/src/components/combobox/types.d.ts.map +1 -1
- package/dist/typescript/src/components/input/input.d.ts +1 -1
- package/dist/typescript/src/components/input/input.d.ts.map +1 -1
- package/dist/typescript/src/components/link/link.d.ts +9 -3
- package/dist/typescript/src/components/link/link.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-selection-indicator.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/components/phone-input.d.ts +4 -6
- package/dist/typescript/src/components/phone-input/components/phone-input.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/index.d.ts +1 -2
- package/dist/typescript/src/components/phone-input/index.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-option.d.ts +4 -1
- package/dist/typescript/src/components/select/components/select-option.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/select/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-relative-position.d.ts +2 -2
- package/dist/typescript/src/hooks/use-relative-position.d.ts.map +1 -1
- package/dist/typescript/src/themes/types.d.ts +4 -0
- package/dist/typescript/src/themes/types.d.ts.map +1 -1
- package/dist/typescript/src/types/element.types.d.ts +3 -10
- package/dist/typescript/src/types/element.types.d.ts.map +1 -1
- package/dist/typescript/src/types/props.types.d.ts +1 -1
- package/dist/typescript/src/types/props.types.d.ts.map +1 -1
- package/dist/typescript/src/utils/normalize-layout.d.ts +3 -2
- package/dist/typescript/src/utils/normalize-layout.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/components/avatar-image.tsx +2 -2
- package/src/components/badge/badge.tsx +1 -3
- package/src/components/badge/variants/default.tsx +2 -1
- package/src/components/badge/variants/secondary.tsx +1 -0
- package/src/components/card/card-title.tsx +7 -4
- package/src/components/combobox/components/combobox-list.tsx +32 -0
- package/src/components/combobox/components/combobox-option.tsx +25 -36
- package/src/components/combobox/components/combobox-overlay.tsx +0 -1
- package/src/components/combobox/components/combobox-root.tsx +110 -23
- package/src/components/combobox/components/combobox-trigger.tsx +44 -21
- package/src/components/combobox/context.ts +7 -2
- package/src/components/combobox/index.ts +3 -0
- package/src/components/combobox/types.ts +2 -3
- package/src/components/link/link.tsx +24 -8
- package/src/components/menu/components/menu-selection-indicator.tsx +5 -4
- package/src/components/phone-input/components/phone-input.tsx +33 -23
- package/src/components/portal/portal.tsx +2 -2
- package/src/components/select/components/select-option.tsx +23 -19
- package/src/components/select/components/select-trigger.tsx +11 -6
- package/src/components/select/variants/default.tsx +4 -0
- package/src/hooks/use-relative-position.ts +4 -4
- package/src/themes/types.ts +4 -0
- package/src/types/element.types.ts +3 -10
- package/src/types/props.types.ts +1 -1
- package/src/utils/normalize-layout.ts +3 -2
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function PhoneInput({ placeholder, style }: PhoneInputProps): React.JSX.Element;
|
|
2
|
+
import { type TextInputProps } from "react-native";
|
|
3
|
+
export type ExpandableProps = Omit<TextInputProps, "value" | "onChangeText">;
|
|
4
|
+
export type PhoneInputProps = ExpandableProps;
|
|
5
|
+
export declare const PhoneInput: React.ForwardRefExoticComponent<ExpandableProps & React.RefAttributes<import("react-native/types_generated/Libraries/Components/TextInput/TextInput.flow").TextInputInstance>>;
|
|
8
6
|
//# sourceMappingURL=phone-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../../../../src/components/phone-input/components/phone-input.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../../../../src/components/phone-input/components/phone-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAI1E,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,cAAc,CAAC,CAAC;AAE7E,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;AAE9C,eAAO,MAAM,UAAU,gLA4BtB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export type { PhoneInputState, PhoneInputStyles } from "./types";
|
|
2
2
|
import { CountryPicker } from "./components/country-picker";
|
|
3
|
-
import { PhoneInput as PhoneInputComponent } from "./components/phone-input";
|
|
4
3
|
import { PhoneInputRoot } from "./components/phone-input-root";
|
|
5
4
|
export declare const PhoneInput: {
|
|
6
5
|
Root: typeof PhoneInputRoot;
|
|
7
6
|
CountryPicker: typeof CountryPicker;
|
|
8
|
-
Input:
|
|
7
|
+
Input: import("react").ForwardRefExoticComponent<import("./components/phone-input").ExpandableProps & import("react").RefAttributes<import("react-native/types_generated/Libraries/Components/TextInput/TextInput.flow").TextInputInstance>>;
|
|
9
8
|
};
|
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone-input/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone-input/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,eAAO,MAAM,UAAU;;;;CAItB,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type PressableProps } from "react-native";
|
|
3
|
+
import type { ElementChildren } from "../../../types/element.types";
|
|
2
4
|
export type SelectOptionProps = {
|
|
3
5
|
value: string;
|
|
4
|
-
children?:
|
|
6
|
+
children?: ElementChildren;
|
|
7
|
+
style?: PressableProps["style"];
|
|
5
8
|
};
|
|
6
9
|
export declare function SelectOption(props: SelectOptionProps): React.ReactElement;
|
|
7
10
|
//# sourceMappingURL=select-option.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-option.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAmBF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAuCzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"select-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAgCtD;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAelD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/variants/default.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/variants/default.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAwFhE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LayoutRectangle, type ScaledSize, type ViewStyle } from "react-native";
|
|
2
2
|
import { type SafeAreaInsets } from "../safe-area";
|
|
3
3
|
type UseRelativePositionArgs = Omit<GetContentStyleArgs, "dimensions" | "insets">;
|
|
4
4
|
type GetContentStyleArgs = GetPositionArgs & GetSidePositionArgs & GetAlignPositionArgs;
|
|
@@ -10,7 +10,7 @@ export interface LayoutPosition {
|
|
|
10
10
|
height: number;
|
|
11
11
|
}
|
|
12
12
|
interface GetPositionArgs {
|
|
13
|
-
dimensions:
|
|
13
|
+
dimensions: ScaledSize;
|
|
14
14
|
triggerPosition: LayoutPosition;
|
|
15
15
|
contentLayout: LayoutRectangle;
|
|
16
16
|
insets: SafeAreaInsets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-relative-position.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-relative-position.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,
|
|
1
|
+
{"version":3,"file":"use-relative-position.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-relative-position.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAItE,KAAK,uBAAuB,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,QAAQ,CAAC,CAAC;AAElF,KAAK,mBAAmB,GAAG,eAAe,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAExF,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,eAAe,EACf,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,GACd,EAAE,uBAAuB,GAAG,SAAS,CAsFrC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,cAAc,CAAC;IAChC,aAAa,EAAE,eAAe,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,UAAU,mBAAoB,SAAQ,eAAe;IACnD,aAAa,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,eAK5B,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,cAK9B,CAAC;AA6EF,UAAU,oBAAqB,SAAQ,eAAe;IACpD,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -47,6 +47,7 @@ import type { EmptyStyles } from "../components/empty/types";
|
|
|
47
47
|
import type { FieldStyles } from "../components/field/types";
|
|
48
48
|
import type { IconButtonStyles } from "../components/icon-button/types";
|
|
49
49
|
import type { InputStyles } from "../components/input/types";
|
|
50
|
+
import type { LinkStyles } from "../components/link";
|
|
50
51
|
import type { MenuStyles } from "../components/menu/types";
|
|
51
52
|
import type { PhoneInputStyles } from "../components/phone-input/types";
|
|
52
53
|
import type { PopoverStyles } from "../components/popover/types";
|
|
@@ -108,6 +109,9 @@ export interface ComponentsConfig {
|
|
|
108
109
|
input?: {
|
|
109
110
|
styles?: InputStyles;
|
|
110
111
|
};
|
|
112
|
+
link?: {
|
|
113
|
+
styles?: LinkStyles;
|
|
114
|
+
};
|
|
111
115
|
menu?: {
|
|
112
116
|
selectionIcon?: React.ComponentType<SvgProps>;
|
|
113
117
|
styles?: MenuStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/themes/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,KAAK,KAAK,GAAG,OAAO,MAAM,KAAK,MAAM,MAAM,MAAM,IAAI,CAAC;AAEtD,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,KAAK,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC;IACf,iBAAiB,EAAE,KAAK,CAAC;IACzB,SAAS,EAAE,KAAK,CAAC;IACjB,mBAAmB,EAAE,KAAK,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,eAAe,EAAE,KAAK,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,QAAQ,GAAG,MA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AAU,CAAC;KACrB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,cAAc,CAAC;KACzB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,cAAc,CAAC;KACzB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnF,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,MAAM,CAAC,EAAE,eAAe,CAAC;KAC1B,CAAC;IACF,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAC7B,CAAC;CACH"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextInput, View } from "react-native";
|
|
2
2
|
import type { SvgProps } from "./props.types";
|
|
3
|
-
export type ViewRef =
|
|
4
|
-
export type TextInputRef =
|
|
5
|
-
focus: () => void;
|
|
6
|
-
blur: () => void;
|
|
7
|
-
clear: () => void;
|
|
8
|
-
isFocused: () => boolean;
|
|
9
|
-
getNativeRef: () => HostInstance;
|
|
10
|
-
setSelection: (start: number, end?: number) => void;
|
|
11
|
-
};
|
|
3
|
+
export type ViewRef = React.ComponentRef<typeof View>;
|
|
4
|
+
export type TextInputRef = React.ComponentRef<typeof TextInput>;
|
|
12
5
|
export type TextChild = string | number | bigint | boolean | null | undefined;
|
|
13
6
|
export type TextChildren = TextChild | TextChild[];
|
|
14
7
|
export type ElementChildren = React.ReactElement | React.ReactElement[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.types.d.ts","sourceRoot":"","sources":["../../../../src/types/element.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"element.types.d.ts","sourceRoot":"","sources":["../../../../src/types/element.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;AACtD,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { ColorValue, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
export type PropsWithRender<P> = P & {
|
|
4
|
-
render?:
|
|
4
|
+
render?: React.ComponentType<P>;
|
|
5
5
|
};
|
|
6
6
|
export type PropsWithRequiredRender<P> = P & {
|
|
7
7
|
render: React.ComponentType<P>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.types.d.ts","sourceRoot":"","sources":["../../../../src/types/props.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG;IACnC,MAAM,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"props.types.d.ts","sourceRoot":"","sources":["../../../../src/types/props.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG;IACnC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI,CAAC,GAAG;IAC3C,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;CAC1C,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LayoutRectangle } from "react-native";
|
|
2
2
|
import type { LayoutPosition } from "../hooks";
|
|
3
|
+
import type { TextInputRef, ViewRef } from "../types/element.types";
|
|
3
4
|
export declare const normalizeLayout: (layout: LayoutRectangle) => {
|
|
4
5
|
x: number;
|
|
5
6
|
y: number;
|
|
6
7
|
width: number;
|
|
7
8
|
height: number;
|
|
8
9
|
};
|
|
9
|
-
export declare const measureLayoutPosition: (ref:
|
|
10
|
+
export declare const measureLayoutPosition: (ref: ViewRef | TextInputRef | null, callback: (layout: LayoutPosition) => void) => void;
|
|
10
11
|
//# sourceMappingURL=normalize-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-layout.d.ts","sourceRoot":"","sources":["../../../../src/utils/normalize-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"normalize-layout.d.ts","sourceRoot":"","sources":["../../../../src/utils/normalize-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEpE,eAAO,MAAM,eAAe,GAAI,QAAQ,eAAe;;;;;CAUtD,CAAC;AAUF,eAAO,MAAM,qBAAqB,GAChC,KAAK,OAAO,GAAG,YAAY,GAAG,IAAI,EAClC,UAAU,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,SAsB3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Image, type
|
|
2
|
+
import { Image, type ImageProps, type ImageStyle, type StyleProp } from "react-native";
|
|
3
3
|
import { useAvatar } from "../context";
|
|
4
4
|
|
|
5
5
|
export interface AvatarImageProps {
|
|
6
|
-
source:
|
|
6
|
+
source: ImageProps["source"];
|
|
7
7
|
style?: StyleProp<ImageStyle>;
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -25,9 +25,7 @@ export function Badge(props: BadgeProps) {
|
|
|
25
25
|
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
26
26
|
const composedStyle = StyleSheet.flatten([mergedStyles.root, props.style]);
|
|
27
27
|
|
|
28
|
-
const
|
|
29
|
-
const iconStyle = { ...mergedStyles.icon, ...props.style };
|
|
30
|
-
const organizedChildren = useOrganizedChildren(props.children, textStyle, iconStyle);
|
|
28
|
+
const organizedChildren = useOrganizedChildren(props.children, mergedStyles.text, mergedStyles.icon);
|
|
31
29
|
|
|
32
30
|
const Component = props.render ?? View;
|
|
33
31
|
return (
|
|
@@ -18,12 +18,13 @@ export const useBadgeVariantDefault = (): BadgeStyles => {
|
|
|
18
18
|
color: colors.primaryForeground,
|
|
19
19
|
fontSize: fontSize * 0.75,
|
|
20
20
|
lineHeight: Math.round(fontSize * 0.75 * 1.25),
|
|
21
|
-
fontWeight: "
|
|
21
|
+
fontWeight: "500",
|
|
22
22
|
fontFamily,
|
|
23
23
|
},
|
|
24
24
|
icon: {
|
|
25
25
|
color: colors.primaryForeground,
|
|
26
26
|
size: fontSize * 0.75,
|
|
27
|
+
strokeWidth: 3,
|
|
27
28
|
},
|
|
28
29
|
}),
|
|
29
30
|
);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, StyleSheet, Text, type TextStyle } from "react-native";
|
|
1
3
|
import type { TextChildren } from "../../types/element.types";
|
|
2
4
|
import type { PropsWithRender } from "../../types/props.types";
|
|
3
|
-
import { calculateComposedStyles } from "../../utils/calculate-styles";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { type StyleProp, Text, type TextStyle } from "react-native";
|
|
6
5
|
import { useCard } from "./context";
|
|
7
6
|
|
|
8
7
|
export interface CardTitleProps {
|
|
@@ -14,7 +13,11 @@ export interface CardTitleProps {
|
|
|
14
13
|
export function CardTitle(props: PropsWithRender<CardTitleProps>) {
|
|
15
14
|
const card = useCard();
|
|
16
15
|
|
|
17
|
-
const composedStyle =
|
|
16
|
+
const composedStyle: StyleProp<TextStyle> = StyleSheet.flatten([
|
|
17
|
+
card.styles?.title?.default,
|
|
18
|
+
card.styles?.title?.[card.state],
|
|
19
|
+
props.style,
|
|
20
|
+
]);
|
|
18
21
|
|
|
19
22
|
const Component = props.render ?? Text;
|
|
20
23
|
return <Component {...props} style={composedStyle} />;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useCombobox } from "../context";
|
|
3
|
+
|
|
4
|
+
export interface ComboboxListProps<T> {
|
|
5
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
6
|
+
renderItem: (info: { item: T; index: number }) => React.ReactElement;
|
|
7
|
+
renderEmpty?: () => React.ReactElement;
|
|
8
|
+
renderSeparator?: () => React.ReactElement;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function ComboboxList<T>(props: ComboboxListProps<T>) {
|
|
12
|
+
const combobox = useCombobox();
|
|
13
|
+
const items = combobox.filteredItems as T[];
|
|
14
|
+
|
|
15
|
+
const keyExtractor =
|
|
16
|
+
props.keyExtractor ?? ((item: T, index: number) => combobox.getItemValue(item) ?? String(index));
|
|
17
|
+
|
|
18
|
+
if (items.length === 0) {
|
|
19
|
+
return <>{props.renderEmpty?.()}</>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
{items.map((item, index) => (
|
|
25
|
+
<React.Fragment key={keyExtractor(item, index)}>
|
|
26
|
+
{props.renderItem({ item, index })}
|
|
27
|
+
{index < items.length - 1 && props.renderSeparator?.()}
|
|
28
|
+
</React.Fragment>
|
|
29
|
+
))}
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { Pressable, StyleSheet,
|
|
2
|
+
import { Pressable, StyleSheet, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import type { ElementChildren } from "../../../types/element.types";
|
|
3
4
|
import { useCombobox } from "../context";
|
|
4
5
|
import type { ComboboxOptionState, ComboboxState } from "../types";
|
|
5
6
|
|
|
6
|
-
export type ComboboxOptionProps = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
children?: React.ReactNode;
|
|
7
|
+
export type ComboboxOptionProps<T> = {
|
|
8
|
+
item: T;
|
|
9
|
+
children?: ElementChildren;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const calculateState = (
|
|
@@ -14,48 +14,37 @@ const calculateState = (
|
|
|
14
14
|
hovered: boolean,
|
|
15
15
|
selected: boolean,
|
|
16
16
|
): ComboboxOptionState => {
|
|
17
|
-
if (comboboxState === "disabled")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (selected) {
|
|
21
|
-
return "selected";
|
|
22
|
-
}
|
|
23
|
-
if (hovered) {
|
|
24
|
-
return "hovered";
|
|
25
|
-
}
|
|
17
|
+
if (comboboxState === "disabled") return "disabled";
|
|
18
|
+
if (selected) return "selected";
|
|
19
|
+
if (hovered) return "hovered";
|
|
26
20
|
return "default";
|
|
27
21
|
};
|
|
28
22
|
|
|
29
|
-
export function ComboboxOption(props: ComboboxOptionProps) {
|
|
23
|
+
export function ComboboxOption<T>(props: ComboboxOptionProps<T>) {
|
|
30
24
|
const [isHovered, setIsHovered] = useState(false);
|
|
31
25
|
const combobox = useCombobox();
|
|
32
|
-
|
|
26
|
+
|
|
27
|
+
const itemValue = combobox.getItemValue(props.item);
|
|
28
|
+
const selectedValue = combobox.value != null ? combobox.getItemValue(combobox.value) : undefined;
|
|
29
|
+
const isSelected = itemValue === selectedValue;
|
|
33
30
|
|
|
34
31
|
const optionState = calculateState(combobox.state, isHovered, isSelected);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
combobox.styles?.option?.[optionState],
|
|
38
|
-
]);
|
|
32
|
+
const optionStyles = combobox.styles?.option;
|
|
33
|
+
const composedStyles = StyleSheet.flatten([optionStyles?.default, optionStyles?.[optionState]]);
|
|
39
34
|
|
|
40
|
-
const
|
|
35
|
+
const handlePress = () => {
|
|
36
|
+
combobox.onChange?.(props.item);
|
|
37
|
+
combobox.setIsOpen(false);
|
|
38
|
+
};
|
|
41
39
|
|
|
42
40
|
return (
|
|
43
|
-
<
|
|
44
|
-
onPress={
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
combobox.setIsOpen(false);
|
|
49
|
-
}}
|
|
50
|
-
onPointerEnter={() => {
|
|
51
|
-
setIsHovered(true);
|
|
52
|
-
}}
|
|
53
|
-
onPointerLeave={() => {
|
|
54
|
-
setIsHovered(false);
|
|
55
|
-
}}
|
|
56
|
-
style={composedStyles}
|
|
41
|
+
<Pressable
|
|
42
|
+
onPress={handlePress}
|
|
43
|
+
onPointerEnter={() => setIsHovered(true)}
|
|
44
|
+
onPointerLeave={() => setIsHovered(false)}
|
|
45
|
+
style={composedStyles as StyleProp<ViewStyle>}
|
|
57
46
|
>
|
|
58
47
|
{props.children}
|
|
59
|
-
</
|
|
48
|
+
</Pressable>
|
|
60
49
|
);
|
|
61
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
type LayoutRectangle,
|
|
4
4
|
type StyleProp,
|
|
@@ -14,31 +14,81 @@ import { ComboboxContext } from "../context";
|
|
|
14
14
|
import type { ComboboxState } from "../types";
|
|
15
15
|
import { ComboboxVariants } from "../variants";
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const defaultGetItemValue = (item: unknown): string => {
|
|
18
|
+
if (typeof item === "string") return item;
|
|
19
|
+
if (typeof item === "object" && item !== null && "value" in item) {
|
|
20
|
+
return String((item as Record<string, unknown>).value);
|
|
21
|
+
}
|
|
22
|
+
return String(item);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const defaultGetItemLabel = (item: unknown): string => {
|
|
26
|
+
if (typeof item === "string") return item;
|
|
27
|
+
if (typeof item === "object" && item !== null && "label" in item) {
|
|
28
|
+
return String((item as Record<string, unknown>).label);
|
|
29
|
+
}
|
|
30
|
+
return defaultGetItemValue(item);
|
|
31
|
+
};
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
export interface ComboboxRootProps<T> {
|
|
34
|
+
/** The full list of selectable items. */
|
|
35
|
+
items: readonly T[];
|
|
23
36
|
|
|
24
|
-
/**
|
|
37
|
+
/** The currently selected item. */
|
|
38
|
+
value?: T;
|
|
39
|
+
|
|
40
|
+
/** Called when the user selects an item. */
|
|
41
|
+
onChange?: (item: T) => void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Extracts a unique string identifier from an item.
|
|
45
|
+
* Defaults to reading `item.value` or `String(item)`.
|
|
46
|
+
*/
|
|
47
|
+
getItemValue?: (item: T) => string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Extracts a display label from an item (shown in the trigger when selected).
|
|
51
|
+
* Defaults to reading `item.label` or falling back to `getItemValue`.
|
|
52
|
+
*/
|
|
53
|
+
getItemLabel?: (item: T) => string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Custom filter function. Return `true` to include the item.
|
|
57
|
+
* Defaults to case-insensitive label includes query.
|
|
58
|
+
* Pass `null` to disable built-in filtering (useful for async search).
|
|
59
|
+
*/
|
|
60
|
+
filter?: ((item: T, query: string) => boolean) | null;
|
|
61
|
+
|
|
62
|
+
/** Called when the text input value changes. Useful for async search. */
|
|
25
63
|
onInputChange?: (text: string) => void;
|
|
26
64
|
|
|
65
|
+
variant?: keyof typeof ComboboxVariants;
|
|
66
|
+
size?: Size;
|
|
27
67
|
isDisabled?: boolean;
|
|
28
|
-
|
|
29
68
|
children?: React.ReactNode;
|
|
30
69
|
style?: StyleProp<ViewStyle>;
|
|
31
70
|
}
|
|
32
71
|
|
|
33
|
-
const calculateState = (props: ComboboxRootProps): ComboboxState => {
|
|
34
|
-
if (props.isDisabled)
|
|
35
|
-
return "disabled";
|
|
36
|
-
}
|
|
72
|
+
const calculateState = <T,>(props: ComboboxRootProps<T>): ComboboxState => {
|
|
73
|
+
if (props.isDisabled) return "disabled";
|
|
37
74
|
return "default";
|
|
38
75
|
};
|
|
39
76
|
|
|
40
|
-
export function ComboboxRoot(props: ComboboxRootProps) {
|
|
41
|
-
const
|
|
77
|
+
export function ComboboxRoot<T>(props: ComboboxRootProps<T>) {
|
|
78
|
+
const {
|
|
79
|
+
items,
|
|
80
|
+
value,
|
|
81
|
+
onChange,
|
|
82
|
+
getItemValue = defaultGetItemValue as (item: T) => string,
|
|
83
|
+
getItemLabel = defaultGetItemLabel as (item: T) => string,
|
|
84
|
+
filter,
|
|
85
|
+
onInputChange,
|
|
86
|
+
variant = "default",
|
|
87
|
+
size = "md",
|
|
88
|
+
isDisabled = false,
|
|
89
|
+
} = props;
|
|
90
|
+
|
|
91
|
+
const variantStyles = ComboboxVariants[variant](size);
|
|
42
92
|
const globalStyles = useComponentConfig("combobox");
|
|
43
93
|
const mergedStyles = mergeStyles(variantStyles, globalStyles?.styles);
|
|
44
94
|
|
|
@@ -47,9 +97,18 @@ export function ComboboxRoot(props: ComboboxRootProps) {
|
|
|
47
97
|
const [triggerPosition, setTriggerPosition] = useState<LayoutPosition>(DEFAULT_POSITION);
|
|
48
98
|
const [inputValue, setInputValue] = useState("");
|
|
49
99
|
|
|
50
|
-
|
|
51
|
-
|
|
100
|
+
// Reset input value when closing
|
|
101
|
+
const prevOpen = useRef(isOpen);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (prevOpen.current && !isOpen) {
|
|
104
|
+
setInputValue("");
|
|
105
|
+
}
|
|
106
|
+
prevOpen.current = isOpen;
|
|
107
|
+
}, [isOpen]);
|
|
52
108
|
|
|
109
|
+
// Notify consumer when input value changes
|
|
110
|
+
const onInputChangeRef = useRef(onInputChange);
|
|
111
|
+
onInputChangeRef.current = onInputChange;
|
|
53
112
|
const isFirstRender = useRef(true);
|
|
54
113
|
useEffect(() => {
|
|
55
114
|
if (isFirstRender.current) {
|
|
@@ -59,6 +118,20 @@ export function ComboboxRoot(props: ComboboxRootProps) {
|
|
|
59
118
|
onInputChangeRef.current?.(inputValue);
|
|
60
119
|
}, [inputValue]);
|
|
61
120
|
|
|
121
|
+
const filteredItems = useMemo(() => {
|
|
122
|
+
if (filter === null) return items;
|
|
123
|
+
if (!inputValue) return items;
|
|
124
|
+
|
|
125
|
+
const filterFn =
|
|
126
|
+
filter ??
|
|
127
|
+
((item: T, query: string) => {
|
|
128
|
+
const label = getItemLabel(item);
|
|
129
|
+
return label.toLowerCase().includes(query.toLowerCase());
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
return items.filter((item) => filterFn(item, inputValue));
|
|
133
|
+
}, [items, inputValue, filter, getItemLabel]);
|
|
134
|
+
|
|
62
135
|
const state = calculateState(props);
|
|
63
136
|
const composedStyles = StyleSheet.flatten([
|
|
64
137
|
mergedStyles?.root?.default,
|
|
@@ -66,10 +139,21 @@ export function ComboboxRoot(props: ComboboxRootProps) {
|
|
|
66
139
|
props.style,
|
|
67
140
|
]);
|
|
68
141
|
|
|
142
|
+
const handleChange = useCallback(
|
|
143
|
+
(item: unknown) => {
|
|
144
|
+
onChange?.(item as T);
|
|
145
|
+
},
|
|
146
|
+
[onChange],
|
|
147
|
+
);
|
|
148
|
+
|
|
69
149
|
const contextValue: ComboboxContext = useMemo(
|
|
70
150
|
() => ({
|
|
71
|
-
|
|
72
|
-
|
|
151
|
+
items,
|
|
152
|
+
filteredItems,
|
|
153
|
+
getItemValue: getItemValue as (item: unknown) => string,
|
|
154
|
+
getItemLabel: getItemLabel as (item: unknown) => string,
|
|
155
|
+
value,
|
|
156
|
+
onChange: handleChange,
|
|
73
157
|
isOpen,
|
|
74
158
|
setIsOpen,
|
|
75
159
|
triggerPosition,
|
|
@@ -79,19 +163,22 @@ export function ComboboxRoot(props: ComboboxRootProps) {
|
|
|
79
163
|
inputValue,
|
|
80
164
|
setInputValue,
|
|
81
165
|
state,
|
|
82
|
-
isDisabled
|
|
166
|
+
isDisabled,
|
|
83
167
|
styles: mergedStyles,
|
|
84
168
|
}),
|
|
85
169
|
[
|
|
86
|
-
|
|
87
|
-
|
|
170
|
+
items,
|
|
171
|
+
filteredItems,
|
|
172
|
+
getItemValue,
|
|
173
|
+
getItemLabel,
|
|
174
|
+
value,
|
|
175
|
+
handleChange,
|
|
88
176
|
isOpen,
|
|
89
177
|
triggerPosition,
|
|
90
178
|
contentLayout,
|
|
91
179
|
inputValue,
|
|
92
|
-
setInputValue,
|
|
93
180
|
state,
|
|
94
|
-
|
|
181
|
+
isDisabled,
|
|
95
182
|
mergedStyles,
|
|
96
183
|
],
|
|
97
184
|
);
|