@povio/ui 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/package.json +17 -0
- package/povio-ui-0.0.1.tgz +0 -0
- package/src/assets/icons/AlignCenter.d.ts +2 -0
- package/src/assets/icons/AlignLeft.d.ts +2 -0
- package/src/assets/icons/AlignLeftRight.d.ts +2 -0
- package/src/assets/icons/AlignRight.d.ts +2 -0
- package/src/assets/icons/ArrowDropDown.d.ts +2 -0
- package/src/assets/icons/ArrowDropUp.d.ts +2 -0
- package/src/assets/icons/ArrowLeft.d.ts +2 -0
- package/src/assets/icons/ArrowRight.d.ts +2 -0
- package/src/assets/icons/Bold.d.ts +2 -0
- package/src/assets/icons/BulletedList.d.ts +2 -0
- package/src/assets/icons/Calendar.d.ts +2 -0
- package/src/assets/icons/Check.d.ts +2 -0
- package/src/assets/icons/CheckCircle.d.ts +2 -0
- package/src/assets/icons/CheckboxCheckmark.d.ts +2 -0
- package/src/assets/icons/CheckboxIndeterminate.d.ts +2 -0
- package/src/assets/icons/ChevronDown.d.ts +2 -0
- package/src/assets/icons/ChevronLeft.d.ts +2 -0
- package/src/assets/icons/ChevronRight.d.ts +2 -0
- package/src/assets/icons/ChevronUp.d.ts +2 -0
- package/src/assets/icons/ChevronsLeft.d.ts +2 -0
- package/src/assets/icons/ChevronsRight.d.ts +2 -0
- package/src/assets/icons/Clock.d.ts +2 -0
- package/src/assets/icons/Close.d.ts +2 -0
- package/src/assets/icons/DateTime.d.ts +2 -0
- package/src/assets/icons/Drag.d.ts +2 -0
- package/src/assets/icons/File.d.ts +2 -0
- package/src/assets/icons/Highlight.d.ts +2 -0
- package/src/assets/icons/HighlightOn.d.ts +6 -0
- package/src/assets/icons/Info.d.ts +2 -0
- package/src/assets/icons/Italic.d.ts +2 -0
- package/src/assets/icons/Link.d.ts +2 -0
- package/src/assets/icons/Menu.d.ts +2 -0
- package/src/assets/icons/NumberedList.d.ts +2 -0
- package/src/assets/icons/PointerHorizontal.d.ts +2 -0
- package/src/assets/icons/PointerVertical.d.ts +2 -0
- package/src/assets/icons/Send.d.ts +2 -0
- package/src/assets/icons/Strikethrough.d.ts +2 -0
- package/src/assets/icons/TextColor.d.ts +6 -0
- package/src/assets/icons/Today.d.ts +2 -0
- package/src/assets/icons/Underlined.d.ts +2 -0
- package/src/assets/icons/Upload.d.ts +2 -0
- package/src/assets/icons/View.d.ts +2 -0
- package/src/assets/icons/ViewOff.d.ts +2 -0
- package/src/assets/icons/Warningfilled.d.ts +2 -0
- package/src/components/Menu/Menu.d.ts +14 -0
- package/src/components/Menu/MenuDesktop.d.ts +2 -0
- package/src/components/Menu/MenuItem.d.ts +5 -0
- package/src/components/Menu/MenuMobile.d.ts +2 -0
- package/src/components/Menu/MenuPopover.d.ts +5 -0
- package/src/components/buttons/Button/Button.d.ts +27 -0
- package/src/components/buttons/Button/button.cva.d.ts +30 -0
- package/src/components/buttons/IconButton/IconButton.d.ts +10 -0
- package/src/components/buttons/InlineIconButton/InlineIconButton.d.ts +11 -0
- package/src/components/buttons/PillButton/PillButton.d.ts +11 -0
- package/src/components/buttons/PillButton/pillButton.cva.d.ts +14 -0
- package/src/components/buttons/SplitButton/SplitButton.d.ts +10 -0
- package/src/components/buttons/TextButton/TextButton.d.ts +11 -0
- package/src/components/buttons/ToggleButton/ToggleButton.d.ts +9 -0
- package/src/components/buttons/shared/ButtonContent.d.ts +16 -0
- package/src/components/buttons/shared/buttonContent.cva.d.ts +6 -0
- package/src/components/inputs/Checkbox/Checkbox.d.ts +17 -0
- package/src/components/inputs/Checkbox/CheckboxCheckmark.d.ts +9 -0
- package/src/components/inputs/Checkbox/checkbox.cva.d.ts +11 -0
- package/src/components/inputs/DateTime/DatePicker/DatePicker.d.ts +24 -0
- package/src/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +32 -0
- package/src/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +22 -0
- package/src/components/inputs/DateTime/TimePicker/TimePicker.d.ts +20 -0
- package/src/components/inputs/DateTime/shared/Calendar.d.ts +20 -0
- package/src/components/inputs/DateTime/shared/CalendarCell.d.ts +20 -0
- package/src/components/inputs/DateTime/shared/CalendarGrid.d.ts +25 -0
- package/src/components/inputs/DateTime/shared/CalendarHeader.d.ts +16 -0
- package/src/components/inputs/DateTime/shared/CalendarSelectHeader.d.ts +17 -0
- package/src/components/inputs/DateTime/shared/DateField.d.ts +12 -0
- package/src/components/inputs/DateTime/shared/DatePickerInput.d.ts +20 -0
- package/src/components/inputs/DateTime/shared/DateSegmentItem.d.ts +11 -0
- package/src/components/inputs/DateTime/shared/DateTimeDialog.d.ts +15 -0
- package/src/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +7 -0
- package/src/components/inputs/DateTime/shared/MonthPicker.d.ts +7 -0
- package/src/components/inputs/DateTime/shared/RangeCalendar.d.ts +26 -0
- package/src/components/inputs/DateTime/shared/TimeField.d.ts +12 -0
- package/src/components/inputs/DateTime/shared/TimePickerForm.d.ts +10 -0
- package/src/components/inputs/DateTime/shared/TimePickerInput.d.ts +18 -0
- package/src/components/inputs/DateTime/shared/YearPicker.d.ts +8 -0
- package/src/components/inputs/File/FileUpload.d.ts +4 -0
- package/src/components/inputs/File/FileUploadContainer.d.ts +3 -0
- package/src/components/inputs/File/InputUpload.d.ts +4 -0
- package/src/components/inputs/File/fileUpload.types.d.ts +79 -0
- package/src/components/inputs/File/index.d.ts +9 -0
- package/src/components/inputs/File/inputUpload.types.d.ts +30 -0
- package/src/components/inputs/File/shared/FileCard.d.ts +9 -0
- package/src/components/inputs/File/shared/FileCardList.d.ts +9 -0
- package/src/components/inputs/File/shared/FileProgressBar.d.ts +3 -0
- package/src/components/inputs/File/shared/FileUploadContent.d.ts +10 -0
- package/src/components/inputs/File/shared/FileUploadContentEmpty.d.ts +9 -0
- package/src/components/inputs/File/shared/FileUploadContentError.d.ts +11 -0
- package/src/components/inputs/File/shared/FileUploadContentFilled.d.ts +11 -0
- package/src/components/inputs/File/shared/FileUploadContentLoading.d.ts +9 -0
- package/src/components/inputs/File/shared/InputUploadContent.d.ts +8 -0
- package/src/components/inputs/File/shared/InputUploadFilled.d.ts +7 -0
- package/src/components/inputs/File/shared/fileUpload.cva.d.ts +11 -0
- package/src/components/inputs/File/shared/inputUploadButton.cva.d.ts +10 -0
- package/src/components/inputs/FormField/FormField.d.ts +17 -0
- package/src/components/inputs/FormField/FormFieldError.d.ts +7 -0
- package/src/components/inputs/FormField/FormFieldHeader.d.ts +14 -0
- package/src/components/inputs/FormField/FormFieldHeaderClose.d.ts +5 -0
- package/src/components/inputs/FormField/FormFieldLabel.d.ts +11 -0
- package/src/components/inputs/Input/NumberInput/NumberInput.d.ts +18 -0
- package/src/components/inputs/Input/PasswordInput/PasswordInput.d.ts +7 -0
- package/src/components/inputs/Input/TextArea/TextArea.d.ts +17 -0
- package/src/components/inputs/Input/TextInput/TextInput.d.ts +19 -0
- package/src/components/inputs/Input/shared/InputContent.d.ts +27 -0
- package/src/components/inputs/Inputs/Form.d.ts +26 -0
- package/src/components/inputs/Inputs/InputItem.d.ts +73 -0
- package/src/components/inputs/Inputs/Inputs.d.ts +10 -0
- package/src/components/inputs/RadioGroup/RadioGroup.d.ts +18 -0
- package/src/components/inputs/RadioGroup/radio.cva.d.ts +11 -0
- package/src/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +8 -0
- package/src/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +19 -0
- package/src/components/inputs/Selection/Select/Select.d.ts +8 -0
- package/src/components/inputs/Selection/shared/SelectBase.d.ts +24 -0
- package/src/components/inputs/Selection/shared/SelectDesktop.d.ts +5 -0
- package/src/components/inputs/Selection/shared/SelectInput.d.ts +15 -0
- package/src/components/inputs/Selection/shared/SelectListBox.d.ts +9 -0
- package/src/components/inputs/Selection/shared/SelectListBoxItem.d.ts +8 -0
- package/src/components/inputs/Selection/shared/SelectListBoxItemSelectAll.d.ts +4 -0
- package/src/components/inputs/Selection/shared/SelectListBoxLoadingItem.d.ts +6 -0
- package/src/components/inputs/Selection/shared/SelectListBoxSelectionBar.d.ts +5 -0
- package/src/components/inputs/Selection/shared/SelectMobile.d.ts +5 -0
- package/src/components/inputs/Selection/shared/select.context.d.ts +30 -0
- package/src/components/inputs/Selection/shared/select.types.d.ts +55 -0
- package/src/components/inputs/Selection/shared/useSelectItems.d.ts +23 -0
- package/src/components/inputs/Slider/Slider.d.ts +18 -0
- package/src/components/inputs/TextEditor/TextEditor.d.ts +20 -0
- package/src/components/inputs/TextEditor/Toolbar/ColorPicker.d.ts +7 -0
- package/src/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.d.ts +10 -0
- package/src/components/inputs/TextEditor/Toolbar/HyperlinkAction.d.ts +2 -0
- package/src/components/inputs/TextEditor/Toolbar/TextAlignSelect.d.ts +2 -0
- package/src/components/inputs/TextEditor/Toolbar/TextColorSelect.d.ts +2 -0
- package/src/components/inputs/TextEditor/Toolbar/TextEditorToolbar.d.ts +6 -0
- package/src/components/inputs/TextEditor/Toolbar/TextHighlightSelect.d.ts +2 -0
- package/src/components/inputs/TextEditor/Toolbar/TextListActions.d.ts +2 -0
- package/src/components/inputs/TextEditor/Toolbar/TextMarksActions.d.ts +2 -0
- package/src/components/inputs/TextEditor/Toolbar/TextStyleSelect.d.ts +2 -0
- package/src/components/inputs/TextEditor/textEditor.types.d.ts +5 -0
- package/src/components/inputs/Toggle/Toggle.d.ts +14 -0
- package/src/components/inputs/Toggle/toggle.cva.d.ts +10 -0
- package/src/components/inputs/shared/CheckContent.d.ts +7 -0
- package/src/components/inputs/shared/InputClear.d.ts +6 -0
- package/src/components/inputs/shared/form.types.d.ts +12 -0
- package/src/components/inputs/shared/input.cva.d.ts +22 -0
- package/src/components/inputs/shared/label.cva.d.ts +10 -0
- package/src/components/outline.clsx.d.ts +2 -0
- package/src/components/overlays/ActionModal/ActionModal.d.ts +19 -0
- package/src/components/overlays/BottomSheet/BottomSheet.d.ts +21 -0
- package/src/components/overlays/Drawer/Drawer.d.ts +13 -0
- package/src/components/overlays/Modal/Modal.d.ts +11 -0
- package/src/components/overlays/Modal/modal.cva.d.ts +12 -0
- package/src/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +10 -0
- package/src/components/overlays/Tooltip/Tooltip.d.ts +9 -0
- package/src/components/overlays/Tooltip/TooltipEllipsis.d.ts +7 -0
- package/src/components/segment/Segment.d.ts +4 -0
- package/src/components/segment/SegmentItem.d.ts +2 -0
- package/src/components/segment/segment.types.d.ts +34 -0
- package/src/components/shared/pagination/Pagination.d.ts +9 -0
- package/src/components/shared/pagination/PaginationList.d.ts +15 -0
- package/src/components/shared/pagination/minWidth.cva.d.ts +3 -0
- package/src/components/status/Alert/Alert.d.ts +11 -0
- package/src/components/status/Alert/alert.cva.d.ts +7 -0
- package/src/components/status/Loader/Loader.d.ts +5 -0
- package/src/components/status/Loader/loader.cva.d.ts +9 -0
- package/src/components/status/Toast/Toast.d.ts +14 -0
- package/src/components/status/Toast/toast.cva.d.ts +18 -0
- package/src/components/status/Toast/useToast.d.ts +12 -0
- package/src/components/status/shared/status.cva.d.ts +8 -0
- package/src/components/table/CellText.d.ts +7 -0
- package/src/components/table/ColumnConfig.d.ts +10 -0
- package/src/components/table/HeaderText.d.ts +5 -0
- package/src/components/table/InfiniteTable.d.ts +9 -0
- package/src/components/table/PaginatedTable.d.ts +11 -0
- package/src/components/table/Table.d.ts +37 -0
- package/src/components/table/table.cva.d.ts +15 -0
- package/src/components/text/Link/Link.d.ts +7 -0
- package/src/components/text/Link/link.cva.d.ts +6 -0
- package/src/components/text/Tag/Tag.d.ts +10 -0
- package/src/components/text/Tag/tag.cva.d.ts +6 -0
- package/src/components/text/Typography/Typography.d.ts +11 -0
- package/src/components/text/Typography/typography.cva.d.ts +8 -0
- package/src/config/confirmation.context.d.ts +20 -0
- package/src/config/i18n.d.ts +315 -0
- package/src/config/router.context.d.ts +20 -0
- package/src/config/uiConfig.context.d.ts +28 -0
- package/src/config/uiStyle.context.d.ts +84 -0
- package/src/helpers/dynamicColumns.d.ts +44 -0
- package/src/helpers/dynamicInputs.d.ts +83 -0
- package/src/hooks/useAutosave.d.ts +9 -0
- package/src/hooks/useBreakpoint.d.ts +3 -0
- package/src/hooks/useDebounceCallback.d.ts +6 -0
- package/src/hooks/useDeepCompare.d.ts +4 -0
- package/src/hooks/useFilters.d.ts +7 -0
- package/src/hooks/useForm.d.ts +18 -0
- package/src/hooks/useFormAutosave.d.ts +13 -0
- package/src/hooks/useIntersectionObserver.d.ts +7 -0
- package/src/hooks/useLocalStorage.d.ts +13 -0
- package/src/hooks/useLongPressRepeat.d.ts +9 -0
- package/src/hooks/usePagination.d.ts +7 -0
- package/src/hooks/useScrollableListBox.d.ts +3 -0
- package/src/hooks/useSingletonMutation.d.ts +2 -0
- package/src/hooks/useSorting.d.ts +6 -0
- package/src/hooks/useStateAndRef.d.ts +4 -0
- package/src/hooks/useTableColumnConfig.d.ts +16 -0
- package/src/hooks/useTableNav.d.ts +84 -0
- package/src/hooks/useTranslationMemo.d.ts +4 -0
- package/src/index.d.ts +205 -0
- package/src/types/common.d.ts +12 -0
- package/src/types/react-query.d.ts +6 -0
- package/src/utils/array.utils.d.ts +3 -0
- package/src/utils/array.utils.spec.d.ts +1 -0
- package/src/utils/compoundMapper.d.ts +19 -0
- package/src/utils/compoundMapper.spec.d.ts +1 -0
- package/src/utils/date-time.utils.d.ts +14 -0
- package/src/utils/date-time.utils.spec.d.ts +1 -0
- package/src/utils/date.utils.d.ts +3 -0
- package/src/utils/date.utils.spec.d.ts +1 -0
- package/src/utils/dom.utils.d.ts +5 -0
- package/src/utils/file.utils.d.ts +9 -0
- package/src/utils/isEqual.d.ts +1 -0
- package/src/utils/logger.d.ts +7 -0
- package/src/utils/object.utils.d.ts +10 -0
- package/src/utils/queries.utils.d.ts +4 -0
- package/src/utils/rest/interceptors/logging.interceptor.d.ts +2 -0
- package/src/utils/rest/interceptors/response.interceptor.d.ts +2 -0
- package/src/utils/rest/interceptors/rest-interceptor.d.ts +8 -0
- package/src/utils/rest/rest-client.d.ts +29 -0
- package/src/utils/rest/rest.utils.d.ts +10 -0
- package/src/utils/routing.utils.d.ts +3 -0
- package/src/utils/string.utils.d.ts +4 -0
- package/src/utils/vendor/error-handling.d.ts +21 -0
- package/src/utils/zod.utils.d.ts +19 -0
- package/styles/editor.css +47 -0
- package/styles/index.css +1 -0
- package/vite.config.d.ts +2 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { AriaTextFieldProps } from 'react-aria';
|
|
3
|
+
import { InputProps as AriaInputProps } from 'react-aria-components';
|
|
4
|
+
import { FieldValues } from 'react-hook-form';
|
|
5
|
+
import { FormFieldProps } from '#ui/components/inputs/FormField/FormField';
|
|
6
|
+
import { InputContentProps } from '#ui/components/inputs/Input/shared/InputContent';
|
|
7
|
+
import { ControlProps } from '#ui/components/inputs/shared/form.types';
|
|
8
|
+
import { InputVariantProps } from '#ui/components/inputs/shared/input.cva';
|
|
9
|
+
type AllowedHTMLInputTypeAttribute = "email" | "hidden" | "tel" | "text" | "url";
|
|
10
|
+
interface TextInputBaseProps extends FormFieldProps, InputVariantProps, Omit<InputContentProps, "ref" | "value" | "onChange">, Omit<AriaInputProps, "value" | "defaultValue" | "onChange" | "disabled" | "required" | "type" | "size" | "className" | keyof AriaTextFieldProps>, Omit<AriaTextFieldProps<HTMLInputElement>, "label"> {
|
|
11
|
+
ref?: Ref<HTMLInputElement>;
|
|
12
|
+
inputClassName?: string;
|
|
13
|
+
type?: AllowedHTMLInputTypeAttribute;
|
|
14
|
+
}
|
|
15
|
+
export interface TextInputProps extends TextInputBaseProps {
|
|
16
|
+
}
|
|
17
|
+
export type ControlledTextInputProps<TFieldValues extends FieldValues> = ControlProps<TextInputProps, TFieldValues>;
|
|
18
|
+
export declare const TextInput: <TFieldValues extends FieldValues>(props: ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CSSProperties, FC, ReactElement, ReactNode, SVGProps } from 'react';
|
|
2
|
+
import { InlineIconButtonProps } from '#ui/components/buttons/InlineIconButton/InlineIconButton';
|
|
3
|
+
import { FormFieldHeaderProps } from '#ui/components/inputs/FormField/FormFieldHeader';
|
|
4
|
+
import { InputVariantProps } from '#ui/components/inputs/shared/input.cva';
|
|
5
|
+
export interface InputContentProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
unit?: string;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
action?: {
|
|
11
|
+
icon: InlineIconButtonProps["icon"];
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
altText: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
leadingIcon?: FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
17
|
+
trailingIcon?: FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
18
|
+
isClearable?: boolean;
|
|
19
|
+
value?: string;
|
|
20
|
+
onChange?: (value: string) => void;
|
|
21
|
+
headerProps?: FormFieldHeaderProps;
|
|
22
|
+
}
|
|
23
|
+
interface InputContentComponentProps extends InputContentProps, InputVariantProps {
|
|
24
|
+
children: (style: CSSProperties) => ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare const InputContent: ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, children, headerProps, as, size, }: InputContentComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SubmitErrorHandler, SubmitHandler, UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { InputComponentProps, InputDefBaseProps } from '#ui/components/inputs/Inputs/InputItem';
|
|
5
|
+
import { AllowedComponentType, DefaultComponentType } from '#ui/helpers/dynamicInputs';
|
|
6
|
+
type Capitalize<T extends string> = T extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : T;
|
|
7
|
+
type FieldProps<TProps = {}> = {
|
|
8
|
+
label: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
} & TProps;
|
|
11
|
+
type FieldComponentProps<TSchema extends z.ZodObject<any>, K extends keyof z.infer<TSchema>, T extends AllowedComponentType<TSchema["shape"][K]> | undefined = undefined> = FieldProps<InputDefBaseProps<InputComponentProps<T extends AllowedComponentType<TSchema["shape"][K]> ? T : DefaultComponentType<TSchema["shape"][K]>>>> & {
|
|
12
|
+
inputType?: T extends AllowedComponentType<TSchema["shape"][K]> ? T : never;
|
|
13
|
+
};
|
|
14
|
+
type FieldComponents<TSchema extends z.ZodObject<any>> = {
|
|
15
|
+
[K in keyof Required<z.infer<TSchema>> as Capitalize<K & string>]: <T extends AllowedComponentType<TSchema["shape"][K]> | undefined = undefined>(props: FieldComponentProps<TSchema, K, T>) => ReactNode;
|
|
16
|
+
};
|
|
17
|
+
interface FormProps<TSchema extends z.ZodObject<any>, TSchemaType extends Record<string, any> = z.infer<TSchema>> {
|
|
18
|
+
form: UseFormReturn<TSchemaType>;
|
|
19
|
+
schema: TSchema;
|
|
20
|
+
onSubmit: SubmitHandler<TSchemaType>;
|
|
21
|
+
onError?: SubmitErrorHandler<TSchemaType>;
|
|
22
|
+
className?: string;
|
|
23
|
+
children: (components: FieldComponents<TSchema>) => ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function Form<TSchema extends z.ZodObject<any>>({ form, schema, onSubmit, onError, className, children, }: FormProps<TSchema>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ComponentProps, JSXElementConstructor, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { Control, UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { HasRequiredProperty } from '#ui/types/common';
|
|
5
|
+
declare const componentRegistry: {
|
|
6
|
+
readonly toggle: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/Toggle/Toggle').ControlledToggleProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
readonly checkbox: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/Checkbox/Checkbox').ControlledCheckboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
readonly numberInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/Input/NumberInput/NumberInput').ControlledNumberInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
readonly slider: <TFieldValues extends import('react-hook-form').FieldValues, IsRange extends boolean = false>(props: import('#ui/components/inputs/Slider/Slider').ControlledSliderProps<TFieldValues, IsRange>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
readonly textInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/Input/TextInput/TextInput').ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
readonly passwordInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/Input/PasswordInput/PasswordInput').ControlledPasswordInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
readonly textArea: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/Input/TextArea/TextArea').ControlledTextAreaProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
readonly select: <TFieldValues extends import('react-hook-form').FieldValues, TKey extends import('react-aria').Key = import('react-aria').Key, TInitialSelectItem = import('../Selection/shared/select.types').DefaultInitialSelectItem<TKey>>(props: import('#ui/components/inputs/Selection/Select/Select').ControlledSelectProps<TFieldValues, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
readonly autocomplete: <TFieldValues extends import('react-hook-form').FieldValues, TKey extends import('react-aria').Key = import('react-aria').Key, TInitialSelectItem = import('../Selection/shared/select.types').DefaultInitialSelectItem<TKey>>(props: import('#ui/components/inputs/Selection/Autocomplete/Autocomplete').ControlledAutocompleteProps<TFieldValues, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
readonly queryAutocomplete: <TFieldValues extends import('react-hook-form').FieldValues, TSelectItem extends import('../Selection/shared/select.types').SelectItem<any>, TQueryFn extends (...args: any) => import('@tanstack/react-query').UseQueryResult<TSelectItem[]>>({ query, queryParams, queryOptions, ...props }: import('#ui/types/common').OmitDiscriminatedUnion<import('#ui/components/inputs/Selection/Autocomplete/Autocomplete').AutocompleteProps<Exclude<ReturnType<TQueryFn>["data"], undefined>[0] extends {
|
|
16
|
+
id: infer InferredKey extends import('react-aria').Key;
|
|
17
|
+
} ? InferredKey : never>, "onChange" | "value" | "isLoading" | "items" | "selectionMode" | "showSelectionBar" | "showSelectAllOption" | "initialSelection" | "showSelectionContent" | "onSearchChange"> & (import('../Selection/shared/select.types').GroupedSelectControlProps<TFieldValues, Exclude<ReturnType<TQueryFn>["data"], undefined>[0] extends {
|
|
18
|
+
id: infer InferredKey extends import('react-aria').Key;
|
|
19
|
+
} ? InferredKey : never> & {
|
|
20
|
+
query: Parameters<TQueryFn>[0] extends {
|
|
21
|
+
search?: string;
|
|
22
|
+
} ? TQueryFn : never;
|
|
23
|
+
queryParams?: Omit<Parameters<TQueryFn>[0], "search"> | undefined;
|
|
24
|
+
queryOptions?: Parameters<TQueryFn>[1] | undefined;
|
|
25
|
+
})) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
readonly segment: <TFieldValues extends import('react-hook-form').FieldValues, TKey extends import('react-aria').Key = import('react-aria').Key>(props: import('../../..').ControlledSegmentProps<TFieldValues, TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
readonly datePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, minValue, maxValue, ...props }: import('#ui/components/inputs/DateTime/DatePicker/DatePicker').ControlledDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, ...props }: import('#ui/components/inputs/DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
readonly timePicker: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/DateTime/TimePicker/TimePicker').ControlledTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
readonly dateRangePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, minValue, maxValue, ...props }: import('#ui/components/inputs/DateTime/DateRangePicker/DateRangePicker').ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
readonly textEditor: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('#ui/components/inputs/TextEditor/TextEditor').ControlledTextEditorProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
readonly unknown: null;
|
|
33
|
+
};
|
|
34
|
+
export type InputComponentRegistry = typeof componentRegistry;
|
|
35
|
+
export type InputComponentType = keyof InputComponentRegistry;
|
|
36
|
+
interface InputItemProps<TSchema extends z.ZodObject<any>, TSchemaType extends Record<string, any> = z.infer<TSchema>> {
|
|
37
|
+
form: UseFormReturn<TSchemaType>;
|
|
38
|
+
inputDef: InputDef<TSchemaType>;
|
|
39
|
+
}
|
|
40
|
+
export type InputDef<TSchemaType extends Record<string, any>> = {
|
|
41
|
+
[T in InputComponentType]: T extends "unknown" ? never : {
|
|
42
|
+
[K in keyof TSchemaType]: TypeBasedInputDef<TSchemaType, T, K> | RenderBasedInputDef<TSchemaType, K>;
|
|
43
|
+
}[keyof TSchemaType];
|
|
44
|
+
}[InputComponentType];
|
|
45
|
+
type TypeBasedInputDef<TSchemaType extends Record<string, any>, T extends InputComponentType, K extends keyof TSchemaType> = {
|
|
46
|
+
type: T;
|
|
47
|
+
name: K;
|
|
48
|
+
label: string;
|
|
49
|
+
placeholder?: string;
|
|
50
|
+
inputWrapper?: InputWrapperType;
|
|
51
|
+
render?: never;
|
|
52
|
+
} & (HasRequiredProperty<InputDefBaseProps<InputComponentProps<T>>> extends true ? {
|
|
53
|
+
props?: InputDefBaseProps<InputComponentProps<T>>;
|
|
54
|
+
} : {
|
|
55
|
+
props: InputDefBaseProps<InputComponentProps<T>>;
|
|
56
|
+
});
|
|
57
|
+
interface RenderBasedInputDef<TSchemaType extends Record<string, any>, K extends keyof TSchemaType> {
|
|
58
|
+
type?: never;
|
|
59
|
+
name: K;
|
|
60
|
+
label?: never;
|
|
61
|
+
placeholder?: never;
|
|
62
|
+
props?: never;
|
|
63
|
+
inputWrapper?: never;
|
|
64
|
+
render: (formControl: {
|
|
65
|
+
control: Control<TSchemaType>;
|
|
66
|
+
name: K;
|
|
67
|
+
}, form: UseFormReturn<TSchemaType>) => ReactElement;
|
|
68
|
+
}
|
|
69
|
+
export type InputWrapperType = (children: ReactNode, label: string) => ReactElement;
|
|
70
|
+
export type InputComponentProps<T extends InputComponentType> = InputComponentRegistry[T] extends keyof React.JSX.IntrinsicElements | JSXElementConstructor<any> ? ComponentProps<InputComponentRegistry[T]> : null;
|
|
71
|
+
export type InputDefBaseProps<TProps> = Omit<TProps, "formControl" | "label" | "placeholder" | "children">;
|
|
72
|
+
export declare function InputItem<TSchema extends z.ZodObject<any>, TSchemaType extends Record<string, any> = z.infer<TSchema>>({ form, inputDef }: InputItemProps<TSchema, TSchemaType>): import("react/jsx-runtime").JSX.Element | null;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { InputDef } from './InputItem';
|
|
5
|
+
export interface InputsProps<TSchema extends z.ZodObject<any>, TSchemaType extends Record<string, any> = z.infer<TSchema>> {
|
|
6
|
+
form: UseFormReturn<TSchemaType>;
|
|
7
|
+
inputDefs: Array<InputDef<TSchemaType>>;
|
|
8
|
+
children?: (inputs: Record<keyof TSchemaType, ReactNode>) => ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function Inputs<TSchema extends z.ZodObject<any>, TSchemaType extends Record<string, any> = z.infer<TSchema>>({ form, inputDefs, children, }: InputsProps<TSchema, TSchemaType>): string | number | bigint | boolean | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element[] | null | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement, Ref } from 'react';
|
|
2
|
+
import { RadioGroupProps as AriaRadioGroupProps } from 'react-aria-components';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { FormFieldProps } from '#ui/components/inputs/FormField/FormField';
|
|
5
|
+
import { RadioVariantProps } from '#ui/components/inputs/RadioGroup/radio.cva';
|
|
6
|
+
import { ControlProps } from '#ui/components/inputs/shared/form.types';
|
|
7
|
+
interface RadioGroupBaseProps extends Omit<FormFieldProps, "variant">, RadioVariantProps, Omit<AriaRadioGroupProps, "className"> {
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
|
+
options: {
|
|
10
|
+
label: string | ReactElement;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
export interface RadioGroupProps extends RadioGroupBaseProps {
|
|
15
|
+
}
|
|
16
|
+
export type ControlledRadioGroupProps<TFieldValues extends FieldValues> = ControlProps<RadioGroupProps, TFieldValues>;
|
|
17
|
+
export declare const RadioGroup: <TFieldValues extends FieldValues>(props: ControlledRadioGroupProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { TypographyVariantProps } from '#ui/components/text/Typography/typography.cva';
|
|
3
|
+
export declare const radio: (props?: ({
|
|
4
|
+
variant?: "default" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface RadioVariantProps extends VariantProps<typeof radio> {
|
|
7
|
+
}
|
|
8
|
+
export declare const radioIndicatorClass = "group flex items-center gap-2";
|
|
9
|
+
export declare const radioTypography: (props: {
|
|
10
|
+
variant?: "default" | null | undefined;
|
|
11
|
+
}) => TypographyVariantProps | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Key } from 'react-aria-components';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
4
|
+
import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps } from '#ui/components/inputs/Selection/shared/select.types';
|
|
5
|
+
import { OmitDiscriminatedUnion } from '#ui/types/common';
|
|
6
|
+
export type AutocompleteProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, "isSearchable">;
|
|
7
|
+
export type ControlledAutocompleteProps<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = Omit<AutocompleteProps<TKey, TInitialSelectItem>, keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey, TInitialSelectItem>;
|
|
8
|
+
export declare const Autocomplete: <TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: ControlledAutocompleteProps<TFieldValues, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { Key } from 'react-aria-components';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { AutocompleteProps } from '#ui/components/inputs/Selection/Autocomplete/Autocomplete';
|
|
5
|
+
import { GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
6
|
+
import { OmitDiscriminatedUnion } from '#ui/types/common';
|
|
7
|
+
type QueryFn<TSelectItem extends SelectItem = SelectItem> = (...args: any) => UseQueryResult<Array<TSelectItem>>;
|
|
8
|
+
type TKey<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>[0] extends {
|
|
9
|
+
id: infer InferredKey extends Key;
|
|
10
|
+
} ? InferredKey : never;
|
|
11
|
+
type QueryAutocompleteProps<TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn<TSelectItem>> = OmitDiscriminatedUnion<AutocompleteProps<TKey<TQueryFn>>, "items" | "onSearchChange" | "isLoading" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey<TQueryFn>> & {
|
|
12
|
+
query: Parameters<TQueryFn>[0] extends {
|
|
13
|
+
search?: string;
|
|
14
|
+
} ? TQueryFn : never;
|
|
15
|
+
queryParams?: Omit<Parameters<TQueryFn>[0], "search">;
|
|
16
|
+
queryOptions?: Parameters<TQueryFn>[1];
|
|
17
|
+
};
|
|
18
|
+
export declare const QueryAutocomplete: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn<TSelectItem>>({ query, queryParams, queryOptions, ...props }: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Key } from 'react-aria-components';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
4
|
+
import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectAsyncProps } from '#ui/components/inputs/Selection/shared/select.types';
|
|
5
|
+
import { OmitDiscriminatedUnion } from '#ui/types/common';
|
|
6
|
+
export type SelectProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, "initialSelection" | "mapInitialToSelectItem" | keyof SelectAsyncProps>;
|
|
7
|
+
export type ControlledSelectProps<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = Omit<SelectProps<TKey, TInitialSelectItem>, keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey>;
|
|
8
|
+
export declare const Select: <TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: ControlledSelectProps<TFieldValues, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactElement, Ref } from 'react';
|
|
2
|
+
import { AriaButtonProps } from 'react-aria';
|
|
3
|
+
import { Key } from 'react-aria-components';
|
|
4
|
+
import { FormFieldProps } from '#ui/components/inputs/FormField/FormField';
|
|
5
|
+
import { DefaultInitialSelectItem, GroupedSelectProps, SelectAsyncProps, SelectItem, SelectNewItemProps } from '#ui/components/inputs/Selection/shared/select.types';
|
|
6
|
+
import { InputVariantProps } from '#ui/components/inputs/shared/input.cva';
|
|
7
|
+
export type SelectBaseProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = FormFieldProps & GroupedSelectProps<TKey, TInitialSelectItem> & SelectNewItemProps & SelectAsyncProps & InputVariantProps & Pick<AriaButtonProps, "onBlur"> & {
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
|
+
className?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
hideDropdownIcon?: boolean;
|
|
12
|
+
isSearchable?: boolean;
|
|
13
|
+
isClearable?: boolean;
|
|
14
|
+
isClientSearchDisabled?: boolean;
|
|
15
|
+
ignoreTriggerWidth?: boolean;
|
|
16
|
+
items: SelectItem<TKey>[];
|
|
17
|
+
inputClassName?: string;
|
|
18
|
+
containerClassName?: string;
|
|
19
|
+
customTrigger?: ReactElement;
|
|
20
|
+
onInputChange?: (value: string) => void;
|
|
21
|
+
onSearchChange?: (value: string) => void;
|
|
22
|
+
mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem<TKey>;
|
|
23
|
+
};
|
|
24
|
+
export declare const SelectBase: <TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(dProps: SelectBaseProps<TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Key } from 'react-aria-components';
|
|
2
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
3
|
+
type SelectDesktopProps<TKey extends Key = Key> = SelectBaseProps<TKey>;
|
|
4
|
+
export declare const SelectDesktop: <TKey extends Key = Key>({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }: SelectDesktopProps<TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AriaFieldProps } from 'react-aria';
|
|
2
|
+
import { ComboBoxState } from 'react-stately';
|
|
3
|
+
import { FormFieldHeaderProps } from '#ui/components/inputs/FormField/FormFieldHeader';
|
|
4
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
5
|
+
import { SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
6
|
+
import { InputVariantProps } from '#ui/components/inputs/shared/input.cva';
|
|
7
|
+
interface SelectInputProps extends InputVariantProps, Pick<SelectBaseProps, "ref" | "placeholder" | "isDisabled" | "hideDropdownIcon" | "isSearchable" | "isClearable" | "onBlur" | "showSelectionContent" | "inputClassName"> {
|
|
8
|
+
isInvalid?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
fieldProps?: AriaFieldProps;
|
|
11
|
+
headerProps?: FormFieldHeaderProps;
|
|
12
|
+
onCloseComboBox?: (state: ComboBoxState<SelectItem> | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const SelectInput: ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, onCloseComboBox, onBlur, ...props }: SelectInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AriaListBoxProps } from 'react-aria';
|
|
2
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
3
|
+
import { SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
4
|
+
export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
|
|
5
|
+
className?: string;
|
|
6
|
+
isScrollable?: boolean;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
2
|
+
import { SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
3
|
+
interface SelectListBoxItemProps extends Pick<SelectBaseProps, "isSearchable" | "newItemRender">, SelectItem {
|
|
4
|
+
isNewItem?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const SelectListBoxItem: ({ isSearchable, isNewItem, newItemRender, id, label, content, isDisabled, }: SelectListBoxItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const selectListBoxItemClass: string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
2
|
+
type SelectListBoxItemSelectAllProps = SelectItem;
|
|
3
|
+
export declare const SelectListBoxItemSelectAll: ({ id, label, isDisabled }: SelectListBoxItemSelectAllProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
2
|
+
interface SelectListBoxLoadingItemProps extends Omit<SelectItem, "isDisabled"> {
|
|
3
|
+
onLoadMore?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const SelectListBoxLoadingItem: ({ id, label, onLoadMore }: SelectListBoxLoadingItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Key } from 'react-aria-components';
|
|
2
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
3
|
+
type SelectMobileProps<TKey extends Key = Key> = SelectBaseProps<TKey>;
|
|
4
|
+
export declare const SelectMobile: <TKey extends Key = Key>({ ref, error, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }: SelectMobileProps<TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { Key } from 'react-aria-components';
|
|
3
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
4
|
+
import { ExtendedSelectItem, GroupedSelectProps, SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
5
|
+
export declare namespace SelectContext {
|
|
6
|
+
interface FieldState {
|
|
7
|
+
value: Key | Key[] | null;
|
|
8
|
+
inputValue: string;
|
|
9
|
+
searchValue: string;
|
|
10
|
+
}
|
|
11
|
+
export type Type = {
|
|
12
|
+
fieldState: FieldState;
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
15
|
+
isDebouncing: boolean;
|
|
16
|
+
onChange: (val: Key | Key[]) => void;
|
|
17
|
+
onClear: () => void;
|
|
18
|
+
onSelectAll: () => void;
|
|
19
|
+
onRemove: (val: Key) => void;
|
|
20
|
+
listItems: ExtendedSelectItem[];
|
|
21
|
+
selectableListItems: SelectItem[];
|
|
22
|
+
selectedItems: SelectItem[];
|
|
23
|
+
selectedIds: Key[];
|
|
24
|
+
isMultiple: boolean;
|
|
25
|
+
} & Pick<SelectBaseProps, "onInputChange" | "isLoading" | "hasLoadMore">;
|
|
26
|
+
export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled">;
|
|
27
|
+
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export const useSelect: () => Type;
|
|
29
|
+
export {};
|
|
30
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Key } from 'react-aria-components';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { ControlProps } from '#ui/components/inputs/shared/form.types';
|
|
5
|
+
export interface SelectItem<TKey extends Key = Key> {
|
|
6
|
+
id: TKey;
|
|
7
|
+
label: string;
|
|
8
|
+
content?: string | ReactElement;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ExtendedSelectItem<TKey extends Key = Key> extends SelectItem<TKey> {
|
|
12
|
+
isNewItem?: boolean;
|
|
13
|
+
isSelectAllItem?: boolean;
|
|
14
|
+
isLoadingItem?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface DefaultInitialSelectItem<TKey extends Key = Key> {
|
|
17
|
+
id: TKey;
|
|
18
|
+
label?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SingleSelectProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> {
|
|
22
|
+
selectionMode?: "single";
|
|
23
|
+
value?: TKey | undefined | null;
|
|
24
|
+
onChange?: (value: TKey | null) => void;
|
|
25
|
+
showSelectionBar?: never;
|
|
26
|
+
showSelectAllOption?: never;
|
|
27
|
+
initialSelection?: TInitialSelectItem | null;
|
|
28
|
+
showSelectionContent?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface MultiSelectProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> {
|
|
31
|
+
selectionMode: "multiple";
|
|
32
|
+
value?: TKey[];
|
|
33
|
+
onChange?: (value: TKey[]) => void;
|
|
34
|
+
showSelectionBar?: boolean;
|
|
35
|
+
showSelectAllOption?: boolean;
|
|
36
|
+
initialSelection?: TInitialSelectItem[] | null;
|
|
37
|
+
showSelectionContent?: never;
|
|
38
|
+
}
|
|
39
|
+
export type GroupedSelectProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = MultiSelectProps<TKey, TInitialSelectItem> | SingleSelectProps<TKey, TInitialSelectItem>;
|
|
40
|
+
export type GroupedSelectControlProps<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = ({
|
|
41
|
+
selectionMode: MultiSelectProps["selectionMode"];
|
|
42
|
+
} & ControlProps<MultiSelectProps<TKey, TInitialSelectItem>, TFieldValues>) | ({
|
|
43
|
+
selectionMode?: SingleSelectProps["selectionMode"];
|
|
44
|
+
} & ControlProps<SingleSelectProps<TKey, TInitialSelectItem>, TFieldValues>);
|
|
45
|
+
export interface SelectNewItemProps {
|
|
46
|
+
showNewItemOption?: boolean;
|
|
47
|
+
newItemMinLength?: number;
|
|
48
|
+
onNewItemOption?: (value: string) => void;
|
|
49
|
+
newItemRender?: (label: string) => ReactElement;
|
|
50
|
+
}
|
|
51
|
+
export interface SelectAsyncProps {
|
|
52
|
+
isLoading?: boolean;
|
|
53
|
+
hasLoadMore?: boolean;
|
|
54
|
+
onLoadMore?: () => void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Key } from 'react-aria-components';
|
|
2
|
+
import { SelectBaseProps } from '#ui/components/inputs/Selection/shared/SelectBase';
|
|
3
|
+
import { ExtendedSelectItem, SelectItem } from '#ui/components/inputs/Selection/shared/select.types';
|
|
4
|
+
export declare const SelectAllItemId = "all-item-id";
|
|
5
|
+
export declare const NewItemId = "new-item-id";
|
|
6
|
+
export declare const LoadingItemId = "loading-item-id";
|
|
7
|
+
export declare const ReservedItemIds: string[];
|
|
8
|
+
interface UseSelectItemsProps extends Pick<SelectBaseProps, "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "isLoading" | "hasLoadMore" | "isClientSearchDisabled"> {
|
|
9
|
+
initialSelectedItems?: SelectItem[] | SelectItem | null;
|
|
10
|
+
selectedItems?: SelectItem[] | SelectItem | null;
|
|
11
|
+
cachedItems: SelectItem[];
|
|
12
|
+
inputValue: string;
|
|
13
|
+
showAll: boolean;
|
|
14
|
+
isMultiple: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function useSelectItems({ initialSelectedItems, selectedItems, cachedItems, inputValue, showAll, isMultiple, showSelectAllOption, showNewItemOption, newItemMinLength, isLoading, hasLoadMore, isClientSearchDisabled, }: UseSelectItemsProps): {
|
|
17
|
+
allItems: SelectItem<Key>[];
|
|
18
|
+
allListItems: ExtendedSelectItem<Key>[];
|
|
19
|
+
filteredListItems: ExtendedSelectItem<Key>[];
|
|
20
|
+
listItems: ExtendedSelectItem<Key>[];
|
|
21
|
+
selectableListItems: ExtendedSelectItem<Key>[];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { SliderProps as AriaSliderProps } from 'react-aria-components';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { FormFieldProps } from '#ui/components/inputs/FormField/FormField';
|
|
5
|
+
import { ControlProps } from '#ui/components/inputs/shared/form.types';
|
|
6
|
+
type SliderValue<IsRange extends boolean = false> = IsRange extends false ? number : number[];
|
|
7
|
+
interface SliderBaseProps<IsRange extends boolean = false> extends FormFieldProps, Omit<AriaSliderProps, "value" | "defaultValue" | "onChange" | "className"> {
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
|
+
unit?: string;
|
|
10
|
+
isRange?: IsRange;
|
|
11
|
+
defaultValue?: SliderValue<IsRange>;
|
|
12
|
+
value?: SliderValue<IsRange>;
|
|
13
|
+
onChange?: (value: SliderValue<IsRange>) => void;
|
|
14
|
+
}
|
|
15
|
+
export type SliderProps<IsRange extends boolean = false> = SliderBaseProps<IsRange>;
|
|
16
|
+
export type ControlledSliderProps<TFieldValues extends FieldValues, IsRange extends boolean = false> = ControlProps<SliderProps<IsRange>, TFieldValues>;
|
|
17
|
+
export declare const Slider: <TFieldValues extends FieldValues, IsRange extends boolean = false>(props: ControlledSliderProps<TFieldValues, IsRange>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
2
|
+
import { Ref } from 'react';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { FormFieldProps } from '#ui/components/inputs/FormField/FormField';
|
|
5
|
+
import { ControlProps } from '#ui/components/inputs/shared/form.types';
|
|
6
|
+
export interface TextEditorValue {
|
|
7
|
+
html?: string | null;
|
|
8
|
+
json?: JSONContent | null;
|
|
9
|
+
}
|
|
10
|
+
export interface TextEditorBaseProps extends FormFieldProps {
|
|
11
|
+
ref?: Ref<HTMLDivElement>;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
value?: TextEditorValue | null;
|
|
14
|
+
onChange?: (value: TextEditorValue | null) => void;
|
|
15
|
+
onBlur?: () => void;
|
|
16
|
+
as?: "default" | "filter" | "floating" | "inline" | null;
|
|
17
|
+
}
|
|
18
|
+
export type TextEditorProps = TextEditorBaseProps;
|
|
19
|
+
export type ControlledTextEditorProps<TFieldValues extends FieldValues> = ControlProps<TextEditorProps, TFieldValues>;
|
|
20
|
+
export declare const TextEditor: <TFieldValues extends FieldValues>(props: ControlledTextEditorProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
interface ColorPickerDropdownProps {
|
|
3
|
+
colors: string[];
|
|
4
|
+
value: string | undefined;
|
|
5
|
+
onChange: (color: string) => void;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
children: ReactElement;
|
|
8
|
+
}
|
|
9
|
+
export declare const ColorPickerDropdown: ({ colors, value, onChange, isDisabled, children }: ColorPickerDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { SwitchProps as AriaSwitchProps } from 'react-aria-components';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { FormFieldErrorProps } from '#ui/components/inputs/FormField/FormFieldError';
|
|
5
|
+
import { ControlProps } from '#ui/components/inputs/shared/form.types';
|
|
6
|
+
import { ToggleVariantProps } from '#ui/components/inputs/Toggle/toggle.cva';
|
|
7
|
+
interface ToggleBaseProps extends FormFieldErrorProps, ToggleVariantProps, Omit<AriaSwitchProps, "className"> {
|
|
8
|
+
ref?: Ref<HTMLLabelElement>;
|
|
9
|
+
children?: string;
|
|
10
|
+
}
|
|
11
|
+
export type ToggleProps = ToggleBaseProps;
|
|
12
|
+
export type ControlledToggleProps<TFieldValues extends FieldValues> = ControlProps<ToggleProps, TFieldValues, "isSelected">;
|
|
13
|
+
export declare const Toggle: <TFieldValues extends FieldValues>(props: ControlledToggleProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { TypographyVariantProps } from '#ui/components/text/Typography/typography.cva';
|
|
3
|
+
export declare const toggle: (props?: ({
|
|
4
|
+
variant?: "default" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface ToggleVariantProps extends VariantProps<typeof toggle> {
|
|
7
|
+
}
|
|
8
|
+
export declare const toggleTypography: (props: {
|
|
9
|
+
variant?: "default" | null | undefined;
|
|
10
|
+
}) => TypographyVariantProps | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { TypographyVariantProps } from '#ui/components/text/Typography/typography.cva';
|
|
3
|
+
interface CheckContentProps {
|
|
4
|
+
typography?: TypographyVariantProps;
|
|
5
|
+
}
|
|
6
|
+
export declare const CheckContent: ({ children, ...props }: PropsWithChildren<CheckContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|