@trackunit/react-form-components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/index.cjs +1274 -0
- package/index.css +259 -0
- package/index.js +1210 -0
- package/package.json +21 -0
- package/src/components/ActionButton/ActionButton.d.ts +26 -0
- package/src/components/ActionButton/index.d.ts +1 -0
- package/src/components/BaseInput/BaseInput.d.ts +62 -0
- package/src/components/BaseInput/index.d.ts +1 -0
- package/src/components/Checkbox/CheckIcon.d.ts +12 -0
- package/src/components/Checkbox/Checkbox.d.ts +48 -0
- package/src/components/Checkbox/IndeterminateIcon.d.ts +10 -0
- package/src/components/Checkbox/index.d.ts +1 -0
- package/src/components/DateField/DateField.d.ts +19 -0
- package/src/components/DateInput/DateInput.d.ts +28 -0
- package/src/components/DropZone/DropZone.d.ts +34 -0
- package/src/components/EmailField/EmailField.d.ts +17 -0
- package/src/components/EmailInput/EmailInput.d.ts +13 -0
- package/src/components/EmailInput/index.d.ts +1 -0
- package/src/components/FormGroup/FormGroup.d.ts +39 -0
- package/src/components/Label/Label.d.ts +34 -0
- package/src/components/Label/index.d.ts +1 -0
- package/src/components/NumberField/NumberField.d.ts +19 -0
- package/src/components/NumberInput/NumberInput.d.ts +12 -0
- package/src/components/PhoneField/PhoneField.d.ts +28 -0
- package/src/components/PhoneInput/CountryCodeSelect.d.ts +16 -0
- package/src/components/PhoneInput/CountryCodes.d.ts +5 -0
- package/src/components/PhoneInput/PhoneInput.d.ts +25 -0
- package/src/components/PhoneInput/index.d.ts +1 -0
- package/src/components/RadioGroup/RadioGroup.d.ts +57 -0
- package/src/components/RadioGroup/RadioGroupContext.d.ts +11 -0
- package/src/components/RadioGroup/RadioItem.d.ts +23 -0
- package/src/components/RadioGroup/index.d.ts +2 -0
- package/src/components/Search/Search.d.ts +62 -0
- package/src/components/Search/index.d.ts +1 -0
- package/src/components/Select/CreatableSelect.d.ts +38 -0
- package/src/components/Select/FieldContainer.d.ts +20 -0
- package/src/components/Select/Select.d.ts +18 -0
- package/src/components/Select/SelectMenuItem/SelectMenuItem.d.ts +49 -0
- package/src/components/Select/TagWithWidth.d.ts +17 -0
- package/src/components/Select/TagsContainer.d.ts +45 -0
- package/src/components/Select/index.d.ts +7 -0
- package/src/components/Select/shared.d.ts +15 -0
- package/src/components/Select/useCustomComponents.d.ts +19 -0
- package/src/components/Select/useCustomStyles.d.ts +14 -0
- package/src/components/Select/useSelect.d.ts +143 -0
- package/src/components/TextArea/TextArea.d.ts +30 -0
- package/src/components/TextArea/index.d.ts +1 -0
- package/src/components/TextAreaField/TextAreaField.d.ts +18 -0
- package/src/components/TextAreaField/index.d.ts +1 -0
- package/src/components/TextField/TextField.d.ts +24 -0
- package/src/components/TextField/TextLenghtIndicator.d.ts +19 -0
- package/src/components/TextField/index.d.ts +1 -0
- package/src/components/TextInput/TextInput.d.ts +12 -0
- package/src/components/Toggle/Toggle.d.ts +57 -0
- package/src/components/Toggle/index.d.ts +1 -0
- package/src/components/UploadField/UploadField.d.ts +15 -0
- package/src/components/UploadInput/UploadInput.d.ts +33 -0
- package/src/index.d.ts +24 -0
- package/src/test-utils/hooks.d.ts +4 -0
- package/src/test-utils/test-utils.d.ts +5 -0
- package/src/translation.d.ts +34 -0
- package/translation.cjs +7 -0
- package/translation.js +5 -0
- package/translation10.cjs +7 -0
- package/translation10.js +5 -0
- package/translation11.cjs +7 -0
- package/translation11.js +5 -0
- package/translation12.cjs +7 -0
- package/translation12.js +5 -0
- package/translation13.cjs +7 -0
- package/translation13.js +5 -0
- package/translation14.cjs +7 -0
- package/translation14.js +5 -0
- package/translation15.cjs +7 -0
- package/translation15.js +5 -0
- package/translation16.cjs +7 -0
- package/translation16.js +5 -0
- package/translation17.cjs +7 -0
- package/translation17.js +5 -0
- package/translation2.cjs +7 -0
- package/translation2.js +5 -0
- package/translation3.cjs +7 -0
- package/translation3.js +5 -0
- package/translation4.cjs +7 -0
- package/translation4.js +5 -0
- package/translation5.cjs +7 -0
- package/translation5.js +5 -0
- package/translation6.cjs +7 -0
- package/translation6.js +5 -0
- package/translation7.cjs +7 -0
- package/translation7.js +5 -0
- package/translation8.cjs +7 -0
- package/translation8.js +5 -0
- package/translation9.cjs +7 -0
- package/translation9.js +5 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
3
|
+
import { BaseInputProps } from "../BaseInput";
|
|
4
|
+
type BaseInputExposedProps = Omit<BaseInputProps, "type" | "suffix" | "prefix" | "addonAfter" | "addonBefore" | "actions" | "placeholder">;
|
|
5
|
+
export interface UploadInputProps extends BaseInputExposedProps, CommonProps {
|
|
6
|
+
/**
|
|
7
|
+
* A flag to disable the upload input.
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* A string to set the file formats, for example '.pdf' or '.pdf, .jgp'.
|
|
12
|
+
*/
|
|
13
|
+
acceptedTypes?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Label for the file selector button,
|
|
16
|
+
*/
|
|
17
|
+
uploadLabel: string;
|
|
18
|
+
/**
|
|
19
|
+
* A flag to allow the upload input to accept multiple files.
|
|
20
|
+
*/
|
|
21
|
+
multipleFiles?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* A flag to disable interaction with input for example if you want to use input as a child of higher component
|
|
24
|
+
*/
|
|
25
|
+
nonInteractive?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A thin wrapper around the `BaseInput` component for upload input fields.
|
|
29
|
+
*
|
|
30
|
+
* NOTE: If shown with a label, please use the `UploadField` component instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare const UploadInput: import("react").ForwardRefExoticComponent<UploadInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
33
|
+
export {};
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from "./components/ActionButton";
|
|
2
|
+
export * from "./components/BaseInput";
|
|
3
|
+
export * from "./components/Checkbox";
|
|
4
|
+
export * from "./components/DateField/DateField";
|
|
5
|
+
export * from "./components/DateInput/DateInput";
|
|
6
|
+
export * from "./components/DropZone/DropZone";
|
|
7
|
+
export * from "./components/EmailField/EmailField";
|
|
8
|
+
export * from "./components/EmailInput";
|
|
9
|
+
export * from "./components/FormGroup/FormGroup";
|
|
10
|
+
export * from "./components/Label/Label";
|
|
11
|
+
export * from "./components/NumberField/NumberField";
|
|
12
|
+
export * from "./components/NumberInput/NumberInput";
|
|
13
|
+
export * from "./components/PhoneField/PhoneField";
|
|
14
|
+
export * from "./components/PhoneInput/PhoneInput";
|
|
15
|
+
export * from "./components/RadioGroup";
|
|
16
|
+
export * from "./components/Search";
|
|
17
|
+
export * from "./components/Select";
|
|
18
|
+
export * from "./components/TextArea";
|
|
19
|
+
export * from "./components/TextAreaField";
|
|
20
|
+
export * from "./components/TextField";
|
|
21
|
+
export * from "./components/TextInput/TextInput";
|
|
22
|
+
export * from "./components/Toggle";
|
|
23
|
+
export * from "./components/UploadField/UploadField";
|
|
24
|
+
export * from "./components/UploadInput/UploadInput";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RenderHookOptions } from "@testing-library/react";
|
|
2
|
+
declare const customRenderHook: <T, K>(callback: (props: T) => K, options?: RenderHookOptions<T, typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement> | undefined) => import("@testing-library/react").RenderHookResult<K, T>;
|
|
3
|
+
export * from "@testing-library/react";
|
|
4
|
+
export { customRenderHook as renderHook };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RenderOptions } from "@testing-library/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const customRender: (ui: React.ReactElement, options?: Omit<RenderOptions, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
4
|
+
export * from "@testing-library/react";
|
|
5
|
+
export { customRender as render };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NamespaceTransProps, TransForLibs, TranslationResource } from "@trackunit/i18n-library-translation";
|
|
3
|
+
import defaultTranslations from "./locales/en/translation.json";
|
|
4
|
+
/** A type for all available translation keys in this library */
|
|
5
|
+
export type TranslationKeys = keyof typeof defaultTranslations;
|
|
6
|
+
/** The translation namespace for this library */
|
|
7
|
+
export declare const namespace = "react.form-components";
|
|
8
|
+
/**
|
|
9
|
+
* The TranslationResource for this Library.
|
|
10
|
+
* Holds lazy loaded imports for all languages supported by the library.
|
|
11
|
+
*
|
|
12
|
+
* This is used to register the translations for this library before initializing i18next.
|
|
13
|
+
*/
|
|
14
|
+
export declare const translations: TranslationResource<TranslationKeys>;
|
|
15
|
+
/**
|
|
16
|
+
* Local useTranslation for this specific library
|
|
17
|
+
*/
|
|
18
|
+
export declare const useTranslation: () => [TransForLibs<never>, import("i18next").i18n, boolean] & {
|
|
19
|
+
t: TransForLibs<never>;
|
|
20
|
+
i18n: import("i18next").i18n;
|
|
21
|
+
ready: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Type of the t function for the local useTranslation for this specific library
|
|
25
|
+
*/
|
|
26
|
+
export type TranslationFunction = TransForLibs<TranslationKeys>;
|
|
27
|
+
/**
|
|
28
|
+
* Trans for this specific library.
|
|
29
|
+
*/
|
|
30
|
+
export declare const Trans: (props: NamespaceTransProps<TranslationKeys>) => JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Registers the translations for this library
|
|
33
|
+
*/
|
|
34
|
+
export declare const setupLibraryTranslations: () => void;
|
package/translation.cjs
ADDED
package/translation.js
ADDED
package/translation10.js
ADDED
package/translation11.js
ADDED
package/translation12.js
ADDED
package/translation13.js
ADDED
package/translation14.js
ADDED
package/translation15.js
ADDED
package/translation16.js
ADDED
package/translation17.js
ADDED
package/translation2.cjs
ADDED
package/translation2.js
ADDED
package/translation3.cjs
ADDED
package/translation3.js
ADDED
package/translation4.cjs
ADDED
package/translation4.js
ADDED
package/translation5.cjs
ADDED
package/translation5.js
ADDED
package/translation6.cjs
ADDED
package/translation6.js
ADDED
package/translation7.cjs
ADDED
package/translation7.js
ADDED
package/translation8.cjs
ADDED
package/translation8.js
ADDED
package/translation9.cjs
ADDED