zkit-ui 1.0.0
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/README.md +267 -0
- package/dist/ComponentLibProvider.d.ts +15 -0
- package/dist/ComponentLibProvider.d.ts.map +1 -0
- package/dist/ComponentLibProvider.js +18 -0
- package/dist/assets/animations/spinner.json +1 -0
- package/dist/assets/icons/check.svg +4 -0
- package/dist/assets/icons/toast/error.webp +0 -0
- package/dist/assets/icons/toast/success.webp +0 -0
- package/dist/assets/icons/toast/warning.webp +0 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +42 -0
- package/dist/i18n/I18nProvider.d.ts +11 -0
- package/dist/i18n/I18nProvider.d.ts.map +1 -0
- package/dist/i18n/I18nProvider.js +84 -0
- package/dist/i18n/locale.d.ts +7 -0
- package/dist/i18n/locale.d.ts.map +1 -0
- package/dist/i18n/locale.js +87 -0
- package/dist/i18n/locales/de.d.ts +51 -0
- package/dist/i18n/locales/de.d.ts.map +1 -0
- package/dist/i18n/locales/de.js +62 -0
- package/dist/i18n/locales/en-US.d.ts +51 -0
- package/dist/i18n/locales/en-US.d.ts.map +1 -0
- package/dist/i18n/locales/en-US.js +62 -0
- package/dist/i18n/locales/index.d.ts +9 -0
- package/dist/i18n/locales/index.d.ts.map +1 -0
- package/dist/i18n/locales/index.js +23 -0
- package/dist/i18n/locales/ja.d.ts +51 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -0
- package/dist/i18n/locales/ja.js +62 -0
- package/dist/i18n/locales/zh-CN.d.ts +51 -0
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -0
- package/dist/i18n/locales/zh-CN.js +62 -0
- package/dist/i18n/locales/zh-TW.d.ts +51 -0
- package/dist/i18n/locales/zh-TW.d.ts.map +1 -0
- package/dist/i18n/locales/zh-TW.js +62 -0
- package/dist/i18n/types.d.ts +11 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +2 -0
- package/dist/i18n/useI18n.d.ts +2 -0
- package/dist/i18n/useI18n.d.ts.map +1 -0
- package/dist/i18n/useI18n.js +41 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/services/ActionDialogService/ActionDialog.d.ts +4 -0
- package/dist/services/ActionDialogService/ActionDialog.d.ts.map +1 -0
- package/dist/services/ActionDialogService/ActionDialog.js +531 -0
- package/dist/services/ActionDialogService/index.d.ts +4 -0
- package/dist/services/ActionDialogService/index.d.ts.map +1 -0
- package/dist/services/ActionDialogService/index.js +8 -0
- package/dist/services/ActionDialogService/service.d.ts +7 -0
- package/dist/services/ActionDialogService/service.d.ts.map +1 -0
- package/dist/services/ActionDialogService/service.js +309 -0
- package/dist/services/ActionDialogService/shared.d.ts +17 -0
- package/dist/services/ActionDialogService/shared.d.ts.map +1 -0
- package/dist/services/ActionDialogService/shared.js +167 -0
- package/dist/services/ActionDialogService/types.d.ts +160 -0
- package/dist/services/ActionDialogService/types.d.ts.map +1 -0
- package/dist/services/ActionDialogService/types.js +2 -0
- package/dist/services/CardToastService/index.d.ts +115 -0
- package/dist/services/CardToastService/index.d.ts.map +1 -0
- package/dist/services/CardToastService/index.js +899 -0
- package/dist/services/ImagePreviewService/index.d.ts +179 -0
- package/dist/services/ImagePreviewService/index.d.ts.map +1 -0
- package/dist/services/ImagePreviewService/index.js +1383 -0
- package/dist/services/LoadingService/index.d.ts +146 -0
- package/dist/services/LoadingService/index.d.ts.map +1 -0
- package/dist/services/LoadingService/index.js +827 -0
- package/dist/services/PermissionPurposeDialogService/index.d.ts +99 -0
- package/dist/services/PermissionPurposeDialogService/index.d.ts.map +1 -0
- package/dist/services/PermissionPurposeDialogService/index.js +360 -0
- package/dist/services/PickerService/index.d.ts +128 -0
- package/dist/services/PickerService/index.d.ts.map +1 -0
- package/dist/services/PickerService/index.js +250 -0
- package/dist/theme/ThemeProvider.d.ts +15 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +61 -0
- package/dist/theme/defaultTheme.d.ts +3 -0
- package/dist/theme/defaultTheme.d.ts.map +1 -0
- package/dist/theme/defaultTheme.js +28 -0
- package/dist/theme/mergeTheme.d.ts +3 -0
- package/dist/theme/mergeTheme.d.ts.map +1 -0
- package/dist/theme/mergeTheme.js +19 -0
- package/dist/theme/types.d.ts +17 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +2 -0
- package/dist/theme/useTheme.d.ts +2 -0
- package/dist/theme/useTheme.d.ts.map +1 -0
- package/dist/theme/useTheme.js +46 -0
- package/dist/ui/Accordion/index.d.ts +99 -0
- package/dist/ui/Accordion/index.d.ts.map +1 -0
- package/dist/ui/Accordion/index.js +777 -0
- package/dist/ui/AddressCascader/index.d.ts +58 -0
- package/dist/ui/AddressCascader/index.d.ts.map +1 -0
- package/dist/ui/AddressCascader/index.js +710 -0
- package/dist/ui/BetweenTime/index.d.ts +82 -0
- package/dist/ui/BetweenTime/index.d.ts.map +1 -0
- package/dist/ui/BetweenTime/index.js +702 -0
- package/dist/ui/Button/index.d.ts +93 -0
- package/dist/ui/Button/index.d.ts.map +1 -0
- package/dist/ui/Button/index.js +832 -0
- package/dist/ui/Checkbox/index.d.ts +103 -0
- package/dist/ui/Checkbox/index.d.ts.map +1 -0
- package/dist/ui/Checkbox/index.js +694 -0
- package/dist/ui/DatePicker/index.d.ts +5 -0
- package/dist/ui/DatePicker/index.d.ts.map +1 -0
- package/dist/ui/DatePicker/index.js +157 -0
- package/dist/ui/DatePicker/types.d.ts +99 -0
- package/dist/ui/DatePicker/types.d.ts.map +1 -0
- package/dist/ui/DatePicker/types.js +2 -0
- package/dist/ui/DatePicker/utils.d.ts +32 -0
- package/dist/ui/DatePicker/utils.d.ts.map +1 -0
- package/dist/ui/DatePicker/utils.js +316 -0
- package/dist/ui/LinkedScroll/index.d.ts +78 -0
- package/dist/ui/LinkedScroll/index.d.ts.map +1 -0
- package/dist/ui/LinkedScroll/index.js +470 -0
- package/dist/ui/LoadingSpinner/index.d.ts +8 -0
- package/dist/ui/LoadingSpinner/index.d.ts.map +1 -0
- package/dist/ui/LoadingSpinner/index.js +122 -0
- package/dist/ui/Picker/actionBar.d.ts +14 -0
- package/dist/ui/Picker/actionBar.d.ts.map +1 -0
- package/dist/ui/Picker/actionBar.js +28 -0
- package/dist/ui/Picker/index.d.ts +5 -0
- package/dist/ui/Picker/index.d.ts.map +1 -0
- package/dist/ui/Picker/index.js +412 -0
- package/dist/ui/Picker/types.d.ts +80 -0
- package/dist/ui/Picker/types.d.ts.map +1 -0
- package/dist/ui/Picker/types.js +2 -0
- package/dist/ui/Picker/utils.d.ts +27 -0
- package/dist/ui/Picker/utils.d.ts.map +1 -0
- package/dist/ui/Picker/utils.js +182 -0
- package/dist/ui/Radio/index.d.ts +95 -0
- package/dist/ui/Radio/index.d.ts.map +1 -0
- package/dist/ui/Radio/index.js +633 -0
- package/dist/ui/Sheet/index.d.ts +12 -0
- package/dist/ui/Sheet/index.d.ts.map +1 -0
- package/dist/ui/Sheet/index.js +832 -0
- package/dist/ui/Sheet/nativeBottom.d.ts +52 -0
- package/dist/ui/Sheet/nativeBottom.d.ts.map +1 -0
- package/dist/ui/Sheet/nativeBottom.js +442 -0
- package/dist/ui/Sheet/nativeBottom.web.d.ts +18 -0
- package/dist/ui/Sheet/nativeBottom.web.d.ts.map +1 -0
- package/dist/ui/Sheet/nativeBottom.web.js +46 -0
- package/dist/ui/Sheet/slots.d.ts +5 -0
- package/dist/ui/Sheet/slots.d.ts.map +1 -0
- package/dist/ui/Sheet/slots.js +40 -0
- package/dist/ui/Sheet/types.d.ts +131 -0
- package/dist/ui/Sheet/types.d.ts.map +1 -0
- package/dist/ui/Sheet/types.js +2 -0
- package/dist/ui/SliderCaptcha/index.d.ts +57 -0
- package/dist/ui/SliderCaptcha/index.d.ts.map +1 -0
- package/dist/ui/SliderCaptcha/index.js +586 -0
- package/dist/ui/Switch/index.d.ts +72 -0
- package/dist/ui/Switch/index.d.ts.map +1 -0
- package/dist/ui/Switch/index.js +671 -0
- package/dist/ui/Text/index.d.ts +41 -0
- package/dist/ui/Text/index.d.ts.map +1 -0
- package/dist/ui/Text/index.js +325 -0
- package/dist/ui/TextInput/TextInputPrimitive.d.ts +8 -0
- package/dist/ui/TextInput/TextInputPrimitive.d.ts.map +1 -0
- package/dist/ui/TextInput/TextInputPrimitive.js +54 -0
- package/dist/ui/TextInput/index.d.ts +89 -0
- package/dist/ui/TextInput/index.d.ts.map +1 -0
- package/dist/ui/TextInput/index.js +545 -0
- package/dist/ui/WheelColumn/ZKitWheelPickerNativeComponent.d.ts +39 -0
- package/dist/ui/WheelColumn/ZKitWheelPickerNativeComponent.d.ts.map +1 -0
- package/dist/ui/WheelColumn/ZKitWheelPickerNativeComponent.js +60 -0
- package/dist/ui/WheelColumn/constants.d.ts +2 -0
- package/dist/ui/WheelColumn/constants.d.ts.map +1 -0
- package/dist/ui/WheelColumn/constants.js +4 -0
- package/dist/ui/WheelColumn/index.d.ts +59 -0
- package/dist/ui/WheelColumn/index.d.ts.map +1 -0
- package/dist/ui/WheelColumn/index.js +547 -0
- package/ios/ZKitWheelPicker.h +18 -0
- package/ios/ZKitWheelPicker.mm +230 -0
- package/ios/ZKitWheelPickerLabel.h +10 -0
- package/ios/ZKitWheelPickerLabel.mm +31 -0
- package/ios/ZKitWheelPickerManager.h +5 -0
- package/ios/ZKitWheelPickerManager.mm +53 -0
- package/package.json +75 -0
- package/react-native.config.js +10 -0
- package/src/ComponentLibProvider.tsx +56 -0
- package/src/assets/animations/spinner.json +1 -0
- package/src/assets/icons/check.svg +4 -0
- package/src/assets/icons/toast/error.webp +0 -0
- package/src/assets/icons/toast/success.webp +0 -0
- package/src/assets/icons/toast/warning.webp +0 -0
- package/src/config.ts +65 -0
- package/src/i18n/I18nProvider.tsx +69 -0
- package/src/i18n/locale.ts +108 -0
- package/src/i18n/locales/de.ts +67 -0
- package/src/i18n/locales/en-US.ts +67 -0
- package/src/i18n/locales/index.ts +19 -0
- package/src/i18n/locales/ja.ts +67 -0
- package/src/i18n/locales/zh-CN.ts +67 -0
- package/src/i18n/locales/zh-TW.ts +67 -0
- package/src/i18n/types.ts +21 -0
- package/src/i18n/useI18n.ts +7 -0
- package/src/index.ts +395 -0
- package/src/services/ActionDialogService/ActionDialog.tsx +756 -0
- package/src/services/ActionDialogService/README.md +146 -0
- package/src/services/ActionDialogService/index.tsx +39 -0
- package/src/services/ActionDialogService/service.tsx +355 -0
- package/src/services/ActionDialogService/shared.ts +204 -0
- package/src/services/ActionDialogService/types.ts +197 -0
- package/src/services/CardToastService/README.md +128 -0
- package/src/services/CardToastService/index.tsx +1284 -0
- package/src/services/ImagePreviewService/README.md +67 -0
- package/src/services/ImagePreviewService/index.tsx +2148 -0
- package/src/services/LoadingService/README.md +128 -0
- package/src/services/LoadingService/index.tsx +1113 -0
- package/src/services/PermissionPurposeDialogService/README.md +80 -0
- package/src/services/PermissionPurposeDialogService/index.tsx +449 -0
- package/src/services/PickerService/README.md +154 -0
- package/src/services/PickerService/index.tsx +410 -0
- package/src/theme/ThemeProvider.tsx +40 -0
- package/src/theme/defaultTheme.ts +30 -0
- package/src/theme/mergeTheme.ts +16 -0
- package/src/theme/types.ts +36 -0
- package/src/theme/useTheme.ts +10 -0
- package/src/types/svg.d.ts +9 -0
- package/src/types/vant-area-data.d.ts +19 -0
- package/src/ui/Accordion/README.md +67 -0
- package/src/ui/Accordion/index.tsx +1221 -0
- package/src/ui/AddressCascader/README.md +144 -0
- package/src/ui/AddressCascader/index.tsx +1084 -0
- package/src/ui/BetweenTime/README.md +490 -0
- package/src/ui/BetweenTime/index.tsx +1001 -0
- package/src/ui/Button/README.md +186 -0
- package/src/ui/Button/index.tsx +1356 -0
- package/src/ui/Checkbox/README.md +211 -0
- package/src/ui/Checkbox/index.tsx +1231 -0
- package/src/ui/DatePicker/README.md +117 -0
- package/src/ui/DatePicker/index.tsx +295 -0
- package/src/ui/DatePicker/types.ts +115 -0
- package/src/ui/DatePicker/utils.ts +405 -0
- package/src/ui/LinkedScroll/README.md +55 -0
- package/src/ui/LinkedScroll/index.tsx +809 -0
- package/src/ui/LoadingSpinner/index.tsx +104 -0
- package/src/ui/Picker/README.md +190 -0
- package/src/ui/Picker/actionBar.tsx +70 -0
- package/src/ui/Picker/index.tsx +694 -0
- package/src/ui/Picker/types.ts +94 -0
- package/src/ui/Picker/utils.ts +239 -0
- package/src/ui/Radio/README.md +207 -0
- package/src/ui/Radio/index.tsx +1117 -0
- package/src/ui/Sheet/README.md +82 -0
- package/src/ui/Sheet/index.tsx +1163 -0
- package/src/ui/Sheet/nativeBottom.tsx +683 -0
- package/src/ui/Sheet/nativeBottom.web.tsx +40 -0
- package/src/ui/Sheet/slots.tsx +75 -0
- package/src/ui/Sheet/types.ts +195 -0
- package/src/ui/SliderCaptcha/README.md +61 -0
- package/src/ui/SliderCaptcha/index.tsx +816 -0
- package/src/ui/Switch/README.md +143 -0
- package/src/ui/Switch/index.tsx +1092 -0
- package/src/ui/Text/README.md +157 -0
- package/src/ui/Text/index.tsx +450 -0
- package/src/ui/TextInput/README.md +197 -0
- package/src/ui/TextInput/TextInputPrimitive.tsx +44 -0
- package/src/ui/TextInput/index.tsx +942 -0
- package/src/ui/WheelColumn/README.md +104 -0
- package/src/ui/WheelColumn/ZKitWheelPickerNativeComponent.tsx +68 -0
- package/src/ui/WheelColumn/constants.ts +1 -0
- package/src/ui/WheelColumn/index.tsx +826 -0
- package/zkit-ui.podspec +19 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text as RNText, type StyleProp, type TextProps as RNTextProps, type TextStyle } from 'react-native';
|
|
3
|
+
export type TextVariant = 'body' | 'label' | 'caption' | 'title' | 'heading' | 'display' | 'code';
|
|
4
|
+
export type TextSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
|
|
5
|
+
export type TextSizeValue = TextSize | number;
|
|
6
|
+
export type TextTone = 'default' | 'neutral' | 'muted' | 'subtle' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'disabled' | 'inverse' | 'onPrimary' | 'onSecondary' | 'inherit';
|
|
7
|
+
export type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black' | NonNullable<TextStyle['fontWeight']>;
|
|
8
|
+
export type TextTruncate = boolean | number;
|
|
9
|
+
type NativeTextProps = Omit<RNTextProps, 'style' | 'disabled' | 'numberOfLines' | 'ellipsizeMode'>;
|
|
10
|
+
export type TextRef = React.ComponentRef<typeof RNText>;
|
|
11
|
+
export interface TextProps extends NativeTextProps {
|
|
12
|
+
/**
|
|
13
|
+
* Semantic typography preset. Prefer this over raw font styles.
|
|
14
|
+
*/
|
|
15
|
+
variant?: TextVariant;
|
|
16
|
+
/**
|
|
17
|
+
* Named type scale token, or an unscaled design pixel size that will be resolved through wp(...).
|
|
18
|
+
*/
|
|
19
|
+
size?: TextSizeValue;
|
|
20
|
+
/**
|
|
21
|
+
* Optional line height in design pixels. Style still wins as the final escape hatch.
|
|
22
|
+
*/
|
|
23
|
+
lineHeight?: number;
|
|
24
|
+
weight?: TextWeight;
|
|
25
|
+
tone?: TextTone;
|
|
26
|
+
/**
|
|
27
|
+
* Theme color token, semantic token, or processable native color.
|
|
28
|
+
*/
|
|
29
|
+
color?: string;
|
|
30
|
+
align?: TextStyle['textAlign'];
|
|
31
|
+
transform?: TextStyle['textTransform'];
|
|
32
|
+
truncate?: TextTruncate;
|
|
33
|
+
tabularNumbers?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
numberOfLines?: RNTextProps['numberOfLines'];
|
|
36
|
+
ellipsizeMode?: RNTextProps['ellipsizeMode'];
|
|
37
|
+
style?: StyleProp<TextStyle>;
|
|
38
|
+
}
|
|
39
|
+
export declare const Text: React.NamedExoticComponent<TextProps & React.RefAttributes<RNText>>;
|
|
40
|
+
export {};
|
|
41
|
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IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAqXD,eAAO,MAAM,IAAI,qEAAuB,CAAC"}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Text = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const zkit_tools_1 = require("zkit-tools");
|
|
41
|
+
const useTheme_1 = require("../../theme/useTheme");
|
|
42
|
+
const SEMANTIC_COLORS = {
|
|
43
|
+
danger: '#DC2626',
|
|
44
|
+
error: '#DC2626',
|
|
45
|
+
info: '#2563EB',
|
|
46
|
+
success: '#16A34A',
|
|
47
|
+
warn: '#D97706',
|
|
48
|
+
warning: '#D97706',
|
|
49
|
+
};
|
|
50
|
+
const SIZE_TOKENS = {
|
|
51
|
+
'2xs': { fontSize: 11, lineHeight: 14 },
|
|
52
|
+
xs: { fontSize: 12, lineHeight: 16 },
|
|
53
|
+
sm: { fontSize: 13, lineHeight: 18 },
|
|
54
|
+
md: { fontSize: 15, lineHeight: 21 },
|
|
55
|
+
lg: { fontSize: 17, lineHeight: 24 },
|
|
56
|
+
xl: { fontSize: 20, lineHeight: 28 },
|
|
57
|
+
'2xl': { fontSize: 24, lineHeight: 32 },
|
|
58
|
+
'3xl': { fontSize: 30, lineHeight: 38 },
|
|
59
|
+
'4xl': { fontSize: 36, lineHeight: 44 },
|
|
60
|
+
};
|
|
61
|
+
const MONOSPACE_FONT_FAMILY = react_native_1.Platform.select({
|
|
62
|
+
android: 'monospace',
|
|
63
|
+
ios: 'Menlo',
|
|
64
|
+
web: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace',
|
|
65
|
+
default: 'monospace',
|
|
66
|
+
});
|
|
67
|
+
const VARIANT_TOKENS = {
|
|
68
|
+
body: {
|
|
69
|
+
size: 'md',
|
|
70
|
+
weight: 'regular',
|
|
71
|
+
},
|
|
72
|
+
label: {
|
|
73
|
+
size: 'sm',
|
|
74
|
+
weight: 'medium',
|
|
75
|
+
},
|
|
76
|
+
caption: {
|
|
77
|
+
size: 'xs',
|
|
78
|
+
weight: 'regular',
|
|
79
|
+
},
|
|
80
|
+
title: {
|
|
81
|
+
size: 'lg',
|
|
82
|
+
weight: 'semibold',
|
|
83
|
+
},
|
|
84
|
+
heading: {
|
|
85
|
+
size: '2xl',
|
|
86
|
+
weight: 'bold',
|
|
87
|
+
},
|
|
88
|
+
display: {
|
|
89
|
+
size: '3xl',
|
|
90
|
+
weight: 'bold',
|
|
91
|
+
},
|
|
92
|
+
code: {
|
|
93
|
+
size: 'sm',
|
|
94
|
+
weight: 'regular',
|
|
95
|
+
fontFamily: MONOSPACE_FONT_FAMILY,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
const WEB_NAMED_WEIGHT_MAP = {
|
|
99
|
+
black: 900,
|
|
100
|
+
bold: 700,
|
|
101
|
+
book: 400,
|
|
102
|
+
demibold: 600,
|
|
103
|
+
extrabold: 800,
|
|
104
|
+
extralight: 200,
|
|
105
|
+
hairline: 100,
|
|
106
|
+
heavy: 900,
|
|
107
|
+
light: 300,
|
|
108
|
+
medium: 500,
|
|
109
|
+
normal: 400,
|
|
110
|
+
regular: 400,
|
|
111
|
+
semibold: 600,
|
|
112
|
+
thin: 100,
|
|
113
|
+
ultrabold: 800,
|
|
114
|
+
ultralight: 200,
|
|
115
|
+
};
|
|
116
|
+
const baseStyles = react_native_1.StyleSheet.create({
|
|
117
|
+
root: {
|
|
118
|
+
includeFontPadding: false,
|
|
119
|
+
margin: 0,
|
|
120
|
+
padding: 0,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
function isFiniteNumber(value) {
|
|
124
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
125
|
+
}
|
|
126
|
+
function isProcessableColor(color) {
|
|
127
|
+
return (0, react_native_1.processColor)(color) != null;
|
|
128
|
+
}
|
|
129
|
+
function normalizeFontWeight(weight) {
|
|
130
|
+
if (weight == null)
|
|
131
|
+
return undefined;
|
|
132
|
+
const weightStr = String(weight).trim().toLowerCase();
|
|
133
|
+
const compactWeight = weightStr.replace(/[\s_-]/g, '');
|
|
134
|
+
let normalizedNumericWeight;
|
|
135
|
+
if (compactWeight === 'lighter')
|
|
136
|
+
normalizedNumericWeight = 300;
|
|
137
|
+
if (compactWeight === 'bolder')
|
|
138
|
+
normalizedNumericWeight = 700;
|
|
139
|
+
if (normalizedNumericWeight == null && WEB_NAMED_WEIGHT_MAP[compactWeight] != null) {
|
|
140
|
+
normalizedNumericWeight = WEB_NAMED_WEIGHT_MAP[compactWeight];
|
|
141
|
+
}
|
|
142
|
+
if (normalizedNumericWeight == null) {
|
|
143
|
+
const parsed = Number.parseInt(weightStr, 10);
|
|
144
|
+
if (Number.isNaN(parsed))
|
|
145
|
+
return 'normal';
|
|
146
|
+
normalizedNumericWeight = Math.round(parsed / 100) * 100;
|
|
147
|
+
}
|
|
148
|
+
const clamped = Math.max(100, Math.min(900, normalizedNumericWeight));
|
|
149
|
+
const androidApiLevel = typeof react_native_1.Platform.Version === 'number' ? react_native_1.Platform.Version : Number.parseInt(String(react_native_1.Platform.Version), 10);
|
|
150
|
+
if (react_native_1.Platform.OS === 'android' && Number.isFinite(androidApiLevel) && androidApiLevel < 28) {
|
|
151
|
+
return clamped >= 600 ? 'bold' : 'normal';
|
|
152
|
+
}
|
|
153
|
+
if (clamped === 400)
|
|
154
|
+
return 'normal';
|
|
155
|
+
if (clamped === 700)
|
|
156
|
+
return 'bold';
|
|
157
|
+
return String(clamped);
|
|
158
|
+
}
|
|
159
|
+
function resolveTextWeight(weight) {
|
|
160
|
+
switch (weight) {
|
|
161
|
+
case 'regular':
|
|
162
|
+
return '400';
|
|
163
|
+
case 'medium':
|
|
164
|
+
return '500';
|
|
165
|
+
case 'semibold':
|
|
166
|
+
return '600';
|
|
167
|
+
case 'bold':
|
|
168
|
+
return '700';
|
|
169
|
+
case 'heavy':
|
|
170
|
+
return '800';
|
|
171
|
+
case 'black':
|
|
172
|
+
return '900';
|
|
173
|
+
default:
|
|
174
|
+
return weight;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function resolveToneColor(colors, tone) {
|
|
178
|
+
switch (tone) {
|
|
179
|
+
case 'inherit':
|
|
180
|
+
return undefined;
|
|
181
|
+
case 'primary':
|
|
182
|
+
return colors.primary;
|
|
183
|
+
case 'success':
|
|
184
|
+
return SEMANTIC_COLORS.success;
|
|
185
|
+
case 'warning':
|
|
186
|
+
return SEMANTIC_COLORS.warning;
|
|
187
|
+
case 'danger':
|
|
188
|
+
return SEMANTIC_COLORS.danger;
|
|
189
|
+
case 'info':
|
|
190
|
+
return SEMANTIC_COLORS.info;
|
|
191
|
+
case 'muted':
|
|
192
|
+
return colors.muted;
|
|
193
|
+
case 'subtle':
|
|
194
|
+
return colors.disabled;
|
|
195
|
+
case 'disabled':
|
|
196
|
+
return colors.disabled;
|
|
197
|
+
case 'inverse':
|
|
198
|
+
case 'onPrimary':
|
|
199
|
+
return colors.onPrimary;
|
|
200
|
+
case 'onSecondary':
|
|
201
|
+
return colors.onSecondary;
|
|
202
|
+
case 'default':
|
|
203
|
+
case 'neutral':
|
|
204
|
+
default:
|
|
205
|
+
return colors.onSurface;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function resolveColorToken(input, fallback, theme) {
|
|
209
|
+
var _a;
|
|
210
|
+
if (input == null)
|
|
211
|
+
return fallback;
|
|
212
|
+
const key = input.trim();
|
|
213
|
+
if (!key)
|
|
214
|
+
return fallback;
|
|
215
|
+
const resolved = key === 'default' || key === 'neutral' || key === 'onSurface'
|
|
216
|
+
? theme.colors.onSurface
|
|
217
|
+
: key === 'primary'
|
|
218
|
+
? theme.colors.primary
|
|
219
|
+
: key === 'onPrimary' || key === 'inverse'
|
|
220
|
+
? theme.colors.onPrimary
|
|
221
|
+
: key === 'secondary'
|
|
222
|
+
? theme.colors.secondary
|
|
223
|
+
: key === 'onSecondary'
|
|
224
|
+
? theme.colors.onSecondary
|
|
225
|
+
: key === 'surface'
|
|
226
|
+
? theme.colors.surface
|
|
227
|
+
: key === 'border'
|
|
228
|
+
? theme.colors.border
|
|
229
|
+
: key === 'muted'
|
|
230
|
+
? theme.colors.muted
|
|
231
|
+
: key === 'subtle' || key === 'disabled'
|
|
232
|
+
? theme.colors.disabled
|
|
233
|
+
: (_a = SEMANTIC_COLORS[key]) !== null && _a !== void 0 ? _a : key;
|
|
234
|
+
return isProcessableColor(resolved) ? resolved : fallback;
|
|
235
|
+
}
|
|
236
|
+
function resolveTypographyToken(size) {
|
|
237
|
+
var _a;
|
|
238
|
+
if (typeof size === 'string') {
|
|
239
|
+
return (_a = SIZE_TOKENS[size]) !== null && _a !== void 0 ? _a : SIZE_TOKENS.md;
|
|
240
|
+
}
|
|
241
|
+
if (!isFiniteNumber(size))
|
|
242
|
+
return SIZE_TOKENS.md;
|
|
243
|
+
const fontSize = Math.max(0, size);
|
|
244
|
+
return {
|
|
245
|
+
fontSize,
|
|
246
|
+
lineHeight: Math.ceil(fontSize * 1.4),
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function resolveTypographyStyle(size, explicitLineHeight) {
|
|
250
|
+
const token = resolveTypographyToken(size);
|
|
251
|
+
return {
|
|
252
|
+
fontSize: (0, zkit_tools_1.wp)(token.fontSize),
|
|
253
|
+
lineHeight: (0, zkit_tools_1.wp)(isFiniteNumber(explicitLineHeight) ? Math.max(0, explicitLineHeight) : token.lineHeight),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function normalizeStyleFontWeight(style) {
|
|
257
|
+
if (!style)
|
|
258
|
+
return style;
|
|
259
|
+
const flattened = react_native_1.StyleSheet.flatten(style);
|
|
260
|
+
const fontWeight = flattened === null || flattened === void 0 ? void 0 : flattened.fontWeight;
|
|
261
|
+
if (fontWeight == null)
|
|
262
|
+
return style;
|
|
263
|
+
const normalizedFontWeight = normalizeFontWeight(fontWeight);
|
|
264
|
+
if (normalizedFontWeight === fontWeight)
|
|
265
|
+
return style;
|
|
266
|
+
return [style, { fontWeight: normalizedFontWeight }];
|
|
267
|
+
}
|
|
268
|
+
function resolveNumberOfLines(truncate, numberOfLines) {
|
|
269
|
+
if (truncate === true)
|
|
270
|
+
return 1;
|
|
271
|
+
if (typeof truncate === 'number' && Number.isFinite(truncate)) {
|
|
272
|
+
return Math.max(1, Math.floor(truncate));
|
|
273
|
+
}
|
|
274
|
+
return numberOfLines;
|
|
275
|
+
}
|
|
276
|
+
function resolveAccessibilityState(disabled, accessibilityState) {
|
|
277
|
+
if (!disabled)
|
|
278
|
+
return accessibilityState;
|
|
279
|
+
return {
|
|
280
|
+
...accessibilityState,
|
|
281
|
+
disabled: true,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
const TextBase = React.forwardRef(function Text({ variant = 'body', size, lineHeight, weight, tone = 'default', color, align, transform, truncate, tabularNumbers = false, disabled = false, style, maxFontSizeMultiplier, allowFontScaling, numberOfLines, ellipsizeMode, accessibilityState, children, ...rest }, ref) {
|
|
285
|
+
var _a;
|
|
286
|
+
const theme = (0, useTheme_1.useTheme)();
|
|
287
|
+
const { width: viewportWidth } = (0, react_native_1.useWindowDimensions)();
|
|
288
|
+
const variantToken = (_a = VARIANT_TOKENS[variant]) !== null && _a !== void 0 ? _a : VARIANT_TOKENS.body;
|
|
289
|
+
const resolvedSize = size !== null && size !== void 0 ? size : variantToken.size;
|
|
290
|
+
const resolvedWeight = weight !== null && weight !== void 0 ? weight : variantToken.weight;
|
|
291
|
+
const toneColor = resolveToneColor(theme.colors, disabled ? 'disabled' : tone);
|
|
292
|
+
const resolvedColor = resolveColorToken(color, toneColor, theme);
|
|
293
|
+
const resolvedNumberOfLines = resolveNumberOfLines(truncate, numberOfLines);
|
|
294
|
+
const resolvedEllipsizeMode = truncate ? (ellipsizeMode !== null && ellipsizeMode !== void 0 ? ellipsizeMode : 'tail') : ellipsizeMode;
|
|
295
|
+
const resolvedAccessibilityState = React.useMemo(() => resolveAccessibilityState(disabled, accessibilityState), [accessibilityState, disabled]);
|
|
296
|
+
const typographyStyle = React.useMemo(() => resolveTypographyStyle(resolvedSize, lineHeight), [lineHeight, resolvedSize, viewportWidth]);
|
|
297
|
+
const semanticStyle = React.useMemo(() => {
|
|
298
|
+
const nextStyle = {
|
|
299
|
+
fontFamily: variantToken.fontFamily,
|
|
300
|
+
fontVariant: tabularNumbers ? ['tabular-nums'] : undefined,
|
|
301
|
+
fontWeight: normalizeFontWeight(resolveTextWeight(resolvedWeight)),
|
|
302
|
+
textAlign: align,
|
|
303
|
+
textTransform: transform,
|
|
304
|
+
};
|
|
305
|
+
if (resolvedColor !== undefined) {
|
|
306
|
+
nextStyle.color = resolvedColor;
|
|
307
|
+
}
|
|
308
|
+
return nextStyle;
|
|
309
|
+
}, [
|
|
310
|
+
align,
|
|
311
|
+
resolvedColor,
|
|
312
|
+
resolvedWeight,
|
|
313
|
+
tabularNumbers,
|
|
314
|
+
transform,
|
|
315
|
+
variantToken.fontFamily,
|
|
316
|
+
]);
|
|
317
|
+
const normalizedStyle = React.useMemo(() => normalizeStyleFontWeight(style), [style]);
|
|
318
|
+
const finalStyle = React.useMemo(() => normalizedStyle
|
|
319
|
+
? [baseStyles.root, typographyStyle, semanticStyle, normalizedStyle]
|
|
320
|
+
: [baseStyles.root, typographyStyle, semanticStyle], [normalizedStyle, semanticStyle, typographyStyle]);
|
|
321
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, ...rest, accessibilityState: resolvedAccessibilityState, allowFontScaling: allowFontScaling, disabled: disabled, ellipsizeMode: resolvedEllipsizeMode, maxFontSizeMultiplier: allowFontScaling === false ? maxFontSizeMultiplier : (maxFontSizeMultiplier !== null && maxFontSizeMultiplier !== void 0 ? maxFontSizeMultiplier : (0, zkit_tools_1.getMaxFontSizeMultiplier)()), numberOfLines: resolvedNumberOfLines, style: finalStyle, children: children }));
|
|
322
|
+
});
|
|
323
|
+
TextBase.displayName = 'Text';
|
|
324
|
+
exports.Text = React.memo(TextBase);
|
|
325
|
+
exports.Text.displayName = 'Text';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TextInput as RNTextInput, type TextInputProps as RNTextInputNativeProps } from 'react-native';
|
|
3
|
+
export type TextInputPrimitiveProps = RNTextInputNativeProps;
|
|
4
|
+
export type TextInputPrimitiveRef = React.ComponentRef<typeof RNTextInput>;
|
|
5
|
+
export declare const TextInputPrimitive: React.ForwardRefExoticComponent<RNTextInputNativeProps & React.RefAttributes<RNTextInput>> & {
|
|
6
|
+
State: import("react-native").TextInputState;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=TextInputPrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputPrimitive.d.ts","sourceRoot":"","sources":["../../../src/ui/TextInput/TextInputPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,SAAS,IAAI,WAAW,EACxB,KAAK,cAAc,IAAI,sBAAsB,EAC9C,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AA+B3E,eAAO,MAAM,kBAAkB;;CAE7B,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TextInputPrimitive = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const zkit_tools_1 = require("zkit-tools");
|
|
41
|
+
const useTheme_1 = require("../../theme/useTheme");
|
|
42
|
+
const isAndroid = react_native_1.Platform.OS === 'android';
|
|
43
|
+
const TextInputPrimitiveBase = React.forwardRef(function TextInputPrimitive({ maxFontSizeMultiplier, selectionColor, cursorColor, selectionHandleColor, ...rest }, ref) {
|
|
44
|
+
const theme = (0, useTheme_1.useTheme)();
|
|
45
|
+
const finalSelectionColor = selectionColor !== null && selectionColor !== void 0 ? selectionColor : theme.colors.primary;
|
|
46
|
+
const finalCursorColor = cursorColor !== null && cursorColor !== void 0 ? cursorColor : finalSelectionColor;
|
|
47
|
+
const finalHandleColor = selectionHandleColor !== null && selectionHandleColor !== void 0 ? selectionHandleColor : finalSelectionColor;
|
|
48
|
+
const androidRemountKey = isAndroid ? String(finalCursorColor) : undefined;
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, maxFontSizeMultiplier: maxFontSizeMultiplier !== null && maxFontSizeMultiplier !== void 0 ? maxFontSizeMultiplier : (0, zkit_tools_1.getMaxFontSizeMultiplier)(), selectionColor: finalSelectionColor, cursorColor: finalCursorColor, selectionHandleColor: finalHandleColor, ...rest }, androidRemountKey));
|
|
50
|
+
});
|
|
51
|
+
TextInputPrimitiveBase.displayName = 'TextInputPrimitive';
|
|
52
|
+
exports.TextInputPrimitive = Object.assign(TextInputPrimitiveBase, {
|
|
53
|
+
State: react_native_1.TextInput.State,
|
|
54
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ColorValue, DimensionValue, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import { type TextInputPrimitiveProps, type TextInputPrimitiveRef } from './TextInputPrimitive';
|
|
4
|
+
export { TextInputPrimitive, type TextInputPrimitiveProps, type TextInputPrimitiveRef, } from './TextInputPrimitive';
|
|
5
|
+
export type TextInputVariant = 'outline' | 'filled' | 'plain';
|
|
6
|
+
export type TextInputTone = 'primary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
7
|
+
export type TextInputStatus = 'default' | 'success' | 'warning' | 'error';
|
|
8
|
+
export type TextInputSize = 'sm' | 'md' | 'lg';
|
|
9
|
+
export type TextInputLayout = {
|
|
10
|
+
width?: DimensionValue;
|
|
11
|
+
minWidth?: DimensionValue;
|
|
12
|
+
maxWidth?: DimensionValue;
|
|
13
|
+
height?: DimensionValue;
|
|
14
|
+
minHeight?: number;
|
|
15
|
+
maxHeight?: number;
|
|
16
|
+
paddingHorizontal?: number;
|
|
17
|
+
paddingVertical?: number;
|
|
18
|
+
gap?: number;
|
|
19
|
+
radius?: number;
|
|
20
|
+
textSize?: number;
|
|
21
|
+
textLineHeight?: number;
|
|
22
|
+
};
|
|
23
|
+
export type TextInputColors = {
|
|
24
|
+
background?: string;
|
|
25
|
+
border?: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
placeholder?: ColorValue;
|
|
28
|
+
label?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
success?: string;
|
|
32
|
+
warning?: string;
|
|
33
|
+
icon?: string;
|
|
34
|
+
disabledBackground?: string;
|
|
35
|
+
disabledBorder?: string;
|
|
36
|
+
disabledText?: string;
|
|
37
|
+
};
|
|
38
|
+
type NativeTextInputProps = Omit<TextInputPrimitiveProps, 'defaultValue' | 'editable' | 'onChange' | 'onChangeText' | 'readOnly' | 'style' | 'value'>;
|
|
39
|
+
type SubmitEditingEvent = Parameters<NonNullable<TextInputPrimitiveProps['onSubmitEditing']>>[0];
|
|
40
|
+
export type TextInputRef = TextInputPrimitiveRef;
|
|
41
|
+
export interface TextInputProps extends NativeTextInputProps {
|
|
42
|
+
value?: string;
|
|
43
|
+
defaultValue?: string;
|
|
44
|
+
onChange?: (value: string) => void;
|
|
45
|
+
onNativeChange?: TextInputPrimitiveProps['onChange'];
|
|
46
|
+
onSubmit?: (value: string, event: SubmitEditingEvent) => void;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
readOnly?: boolean;
|
|
49
|
+
required?: boolean;
|
|
50
|
+
invalid?: boolean;
|
|
51
|
+
variant?: TextInputVariant;
|
|
52
|
+
tone?: TextInputTone;
|
|
53
|
+
status?: TextInputStatus;
|
|
54
|
+
size?: TextInputSize;
|
|
55
|
+
color?: string;
|
|
56
|
+
colors?: TextInputColors;
|
|
57
|
+
layout?: TextInputLayout;
|
|
58
|
+
label?: React.ReactNode;
|
|
59
|
+
labelAction?: React.ReactNode;
|
|
60
|
+
description?: React.ReactNode;
|
|
61
|
+
error?: React.ReactNode;
|
|
62
|
+
prefix?: React.ReactNode;
|
|
63
|
+
suffix?: React.ReactNode;
|
|
64
|
+
clearable?: boolean;
|
|
65
|
+
clearIcon?: React.ReactNode;
|
|
66
|
+
clearAccessibilityLabel?: string;
|
|
67
|
+
onClear?: () => void;
|
|
68
|
+
minRows?: number;
|
|
69
|
+
maxRows?: number;
|
|
70
|
+
showCount?: boolean;
|
|
71
|
+
renderCount?: (info: {
|
|
72
|
+
count: number;
|
|
73
|
+
maxLength?: number;
|
|
74
|
+
}) => React.ReactNode;
|
|
75
|
+
style?: StyleProp<ViewStyle>;
|
|
76
|
+
fieldStyle?: StyleProp<ViewStyle>;
|
|
77
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
78
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
79
|
+
descriptionStyle?: StyleProp<TextStyle>;
|
|
80
|
+
errorStyle?: StyleProp<TextStyle>;
|
|
81
|
+
countStyle?: StyleProp<TextStyle>;
|
|
82
|
+
prefixStyle?: StyleProp<ViewStyle>;
|
|
83
|
+
suffixStyle?: StyleProp<ViewStyle>;
|
|
84
|
+
clearButtonStyle?: StyleProp<ViewStyle>;
|
|
85
|
+
}
|
|
86
|
+
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<import("react-native").TextInput>> & {
|
|
87
|
+
State: import("react-native").TextInputState;
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/TextInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EAEd,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAatB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC9F,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB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