@ahrowe/ui 0.31.0 → 0.33.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/dist/esm/common/actionButtons/actionButtons.mjs +1 -1
- package/dist/esm/common/actionButtons/actionButtons.mjs.map +1 -1
- package/dist/esm/common/alert/alert.mjs +1 -1
- package/dist/esm/common/alert/alert.mjs.map +1 -1
- package/dist/esm/common/alert/alert.types.mjs.map +1 -1
- package/dist/esm/common/breadcrumb/breadcrumb.mjs +1 -1
- package/dist/esm/common/breadcrumb/breadcrumb.mjs.map +1 -1
- package/dist/esm/common/card/Card.mjs +1 -1
- package/dist/esm/common/card/Card.mjs.map +1 -1
- package/dist/esm/common/card/card.types.mjs.map +1 -1
- package/dist/esm/common/carousel/carousel.mjs +1 -1
- package/dist/esm/common/carousel/carousel.mjs.map +1 -1
- package/dist/esm/common/chip/chip.mjs +1 -1
- package/dist/esm/common/chip/chip.mjs.map +1 -1
- package/dist/esm/common/chip/chip.types.mjs.map +1 -1
- package/dist/esm/common/colorPicker/colorPicker.mjs +1 -1
- package/dist/esm/common/colorPicker/colorPicker.mjs.map +1 -1
- package/dist/esm/common/configProvider/useLabels.mjs +2 -0
- package/dist/esm/common/configProvider/useLabels.mjs.map +1 -0
- package/dist/esm/common/confirmModal/confirmModal.mjs +1 -1
- package/dist/esm/common/confirmModal/confirmModal.mjs.map +1 -1
- package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.mjs +1 -1
- package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.mjs.map +1 -1
- package/dist/esm/common/datePicker/datePicker.mjs +1 -1
- package/dist/esm/common/datePicker/datePicker.mjs.map +1 -1
- package/dist/esm/common/drawer/drawer.mjs +1 -1
- package/dist/esm/common/drawer/drawer.mjs.map +1 -1
- package/dist/esm/common/dropdown/dropdown.mjs +1 -1
- package/dist/esm/common/dropdown/dropdown.mjs.map +1 -1
- package/dist/esm/common/emptyState/emptyState.mjs +1 -1
- package/dist/esm/common/emptyState/emptyState.mjs.map +1 -1
- package/dist/esm/common/fab/components/fabBase/fabBase.mjs +1 -1
- package/dist/esm/common/fab/components/fabBase/fabBase.mjs.map +1 -1
- package/dist/esm/common/fab/fab.mjs +1 -1
- package/dist/esm/common/fab/fab.mjs.map +1 -1
- package/dist/esm/common/infiniteBlock/infiniteBlock.mjs +1 -1
- package/dist/esm/common/infiniteBlock/infiniteBlock.mjs.map +1 -1
- package/dist/esm/common/input/input.mjs +1 -1
- package/dist/esm/common/input/input.mjs.map +1 -1
- package/dist/esm/common/input/input.types.mjs.map +1 -1
- package/dist/esm/common/klipyPicker/klipyPicker.mjs +1 -1
- package/dist/esm/common/klipyPicker/klipyPicker.mjs.map +1 -1
- package/dist/esm/common/modal/modal.mjs +1 -1
- package/dist/esm/common/modal/modal.mjs.map +1 -1
- package/dist/esm/common/multiSelect/multiSelect.mjs +1 -1
- package/dist/esm/common/multiSelect/multiSelect.mjs.map +1 -1
- package/dist/esm/common/numberInput/numberInput.mjs +1 -1
- package/dist/esm/common/numberInput/numberInput.mjs.map +1 -1
- package/dist/esm/common/otpInput/otpInput.mjs +1 -1
- package/dist/esm/common/otpInput/otpInput.mjs.map +1 -1
- package/dist/esm/common/otpInput/otpInput.types.mjs.map +1 -1
- package/dist/esm/common/pagination/pagination.mjs +1 -1
- package/dist/esm/common/pagination/pagination.mjs.map +1 -1
- package/dist/esm/common/progressBar/progressBar.mjs +1 -1
- package/dist/esm/common/progressBar/progressBar.mjs.map +1 -1
- package/dist/esm/common/roomDrawer/roomDrawer.mjs +1 -1
- package/dist/esm/common/roomDrawer/roomDrawer.mjs.map +1 -1
- package/dist/esm/common/searchInput/searchInput.mjs +1 -1
- package/dist/esm/common/searchInput/searchInput.mjs.map +1 -1
- package/dist/esm/common/splitButton/splitButton.mjs +1 -1
- package/dist/esm/common/splitButton/splitButton.mjs.map +1 -1
- package/dist/esm/common/timer/timer.mjs +1 -1
- package/dist/esm/common/timer/timer.mjs.map +1 -1
- package/dist/esm/common/toast/toast.mjs +1 -1
- package/dist/esm/common/toast/toast.mjs.map +1 -1
- package/dist/esm/common/toast/toastProvider.mjs +1 -1
- package/dist/esm/common/toast/toastProvider.mjs.map +1 -1
- package/dist/esm/common/tree/tree.mjs +1 -1
- package/dist/esm/common/tree/tree.mjs.map +1 -1
- package/dist/esm/common/virtualList/virtualList.mjs +1 -1
- package/dist/esm/common/virtualList/virtualList.mjs.map +1 -1
- package/dist/esm/common/virtualList/virtualListHeader.mjs +1 -1
- package/dist/esm/common/virtualList/virtualListHeader.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/types/common/actionButtons/actionButtons.types.d.ts +9 -2
- package/dist/types/common/alert/alert.types.d.ts +7 -0
- package/dist/types/common/breadcrumb/breadcrumb.types.d.ts +7 -0
- package/dist/types/common/card/card.types.d.ts +6 -1
- package/dist/types/common/carousel/carousel.types.d.ts +13 -0
- package/dist/types/common/chip/chip.types.d.ts +13 -2
- package/dist/types/common/colorPicker/colorPicker.d.ts +1 -1
- package/dist/types/common/colorPicker/colorPicker.types.d.ts +13 -1
- package/dist/types/common/configProvider/configProvider.types.d.ts +26 -1
- package/dist/types/common/configProvider/index.d.ts +1 -0
- package/dist/types/common/configProvider/useLabels.d.ts +22 -0
- package/dist/types/common/confirmModal/confirmModal.types.d.ts +13 -4
- package/dist/types/common/datePicker/components/datePickerMonth/datePickerMonth.d.ts +2 -14
- package/dist/types/common/datePicker/components/datePickerMonth/datePickerMonth.types.d.ts +23 -0
- package/dist/types/common/datePicker/datePicker.d.ts +1 -22
- package/dist/types/common/datePicker/datePicker.types.d.ts +60 -0
- package/dist/types/common/datePicker/index.d.ts +1 -0
- package/dist/types/common/drawer/drawer.d.ts +1 -1
- package/dist/types/common/drawer/drawer.types.d.ts +7 -1
- package/dist/types/common/dropdown/dropdown.types.d.ts +6 -6
- package/dist/types/common/emptyState/emptyState.d.ts +1 -1
- package/dist/types/common/emptyState/emptyState.types.d.ts +13 -1
- package/dist/types/common/fab/components/fabBase/fabBase.d.ts +1 -1
- package/dist/types/common/fab/components/fabBase/fabBase.types.d.ts +3 -1
- package/dist/types/common/fab/fab.d.ts +1 -1
- package/dist/types/common/fab/fab.types.d.ts +6 -1
- package/dist/types/common/infiniteBlock/infiniteBlock.d.ts +1 -1
- package/dist/types/common/infiniteBlock/infiniteBlock.types.d.ts +2 -0
- package/dist/types/common/input/input.types.d.ts +13 -0
- package/dist/types/common/klipyPicker/klipyPicker.d.ts +1 -1
- package/dist/types/common/klipyPicker/klipyPicker.types.d.ts +7 -0
- package/dist/types/common/modal/modal.types.d.ts +7 -0
- package/dist/types/common/multiSelect/multiSelect.types.d.ts +13 -6
- package/dist/types/common/numberInput/numberInput.types.d.ts +15 -2
- package/dist/types/common/otpInput/otpInput.types.d.ts +9 -0
- package/dist/types/common/pagination/pagination.types.d.ts +15 -0
- package/dist/types/common/progressBar/progressBar.d.ts +1 -1
- package/dist/types/common/progressBar/progressBar.types.d.ts +6 -1
- package/dist/types/common/roomDrawer/roomDrawer.types.d.ts +6 -0
- package/dist/types/common/searchInput/searchInput.d.ts +1 -1
- package/dist/types/common/searchInput/searchInput.types.d.ts +13 -1
- package/dist/types/common/splitButton/splitButton.types.d.ts +7 -0
- package/dist/types/common/timer/timer.types.d.ts +7 -0
- package/dist/types/common/toast/toast.d.ts +4 -2
- package/dist/types/common/toast/toast.types.d.ts +11 -1
- package/dist/types/common/toast/toastProvider.d.ts +1 -1
- package/dist/types/common/tree/tree.types.d.ts +7 -2
- package/dist/types/common/virtualList/virtualList.types.d.ts +15 -6
- package/dist/types/common/virtualList/virtualListHeader.d.ts +3 -3
- package/docs/ActionButtons.md +7 -6
- package/docs/Alert.md +2 -0
- package/docs/Breadcrumb.md +2 -0
- package/docs/Card.md +2 -0
- package/docs/Carousel.md +2 -0
- package/docs/Chip.md +5 -1
- package/docs/ColorPicker.md +4 -0
- package/docs/ConfigProvider.md +23 -0
- package/docs/ConfirmModal.md +7 -5
- package/docs/DatePicker.md +6 -1
- package/docs/Drawer.md +2 -0
- package/docs/Dropdown.md +2 -0
- package/docs/EmptyState.md +4 -0
- package/docs/Fab.md +2 -0
- package/docs/FormValidatorGroup.md +1 -1
- package/docs/Input.md +2 -0
- package/docs/KlipyPicker.md +2 -0
- package/docs/Modal.md +2 -0
- package/docs/MultiSelect.md +7 -5
- package/docs/NumberInput.md +8 -2
- package/docs/OtpInput.md +2 -0
- package/docs/Pagination.md +2 -0
- package/docs/ProgressBar.md +2 -0
- package/docs/RoomDrawer.md +2 -0
- package/docs/SearchInput.md +4 -0
- package/docs/SplitButton.md +2 -0
- package/docs/Timer.md +2 -0
- package/docs/Toast.md +2 -0
- package/docs/Tree.md +3 -1
- package/docs/VirtualList.md +3 -2
- package/docs/Wizard.md +1 -2
- package/package.json +1 -1
|
@@ -3,11 +3,16 @@ import { ButtonStyleType } from '../button';
|
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
import { IconContent } from '../types/icon.types';
|
|
5
5
|
export type ActionButtonsSlots = 'root' | 'submitButton' | 'cancelButton';
|
|
6
|
+
/** Text ActionButtons renders of its own, for translating it. */
|
|
7
|
+
export interface ActionButtonsLabels {
|
|
8
|
+
/** The confirming button (default `Save`). */
|
|
9
|
+
submit?: ReactElement | number | string;
|
|
10
|
+
/** The dismissing button (default `Cancel`). */
|
|
11
|
+
cancel?: ReactElement | number | string;
|
|
12
|
+
}
|
|
6
13
|
export interface ActionButtonsProps extends HtmlProps {
|
|
7
14
|
onSubmit?: () => void;
|
|
8
15
|
onClose?: () => void;
|
|
9
|
-
submitLabel?: ReactElement | number | string;
|
|
10
|
-
cancelLabel?: ReactElement | number | string;
|
|
11
16
|
submitButtonStyle?: ButtonStyleType;
|
|
12
17
|
isSubmitButtonLoading?: boolean;
|
|
13
18
|
isSubmitButtonDisabled?: boolean;
|
|
@@ -24,4 +29,6 @@ export interface ActionButtonsProps extends HtmlProps {
|
|
|
24
29
|
style?: CSSProperties;
|
|
25
30
|
classNames?: SlotClassNames<ActionButtonsSlots>;
|
|
26
31
|
styles?: SlotStyles<ActionButtonsSlots>;
|
|
32
|
+
/** Overrides the text ActionButtons renders of its own. Merged per key. */
|
|
33
|
+
labels?: ActionButtonsLabels;
|
|
27
34
|
}
|
|
@@ -9,6 +9,11 @@ export declare enum AlertStyleType {
|
|
|
9
9
|
Error = "error"
|
|
10
10
|
}
|
|
11
11
|
export type AlertSlots = 'root' | 'icon' | 'content' | 'title' | 'description' | 'closeButton';
|
|
12
|
+
/** Text Alert renders of its own, for translating it. */
|
|
13
|
+
export interface AlertLabels {
|
|
14
|
+
/** Close button, read out by screen readers. */
|
|
15
|
+
dismiss?: string;
|
|
16
|
+
}
|
|
12
17
|
export interface AlertProps extends Omit<HtmlProps, 'title'> {
|
|
13
18
|
title?: ReactNode;
|
|
14
19
|
children?: ReactNode;
|
|
@@ -20,4 +25,6 @@ export interface AlertProps extends Omit<HtmlProps, 'title'> {
|
|
|
20
25
|
style?: CSSProperties;
|
|
21
26
|
classNames?: SlotClassNames<AlertSlots>;
|
|
22
27
|
styles?: SlotStyles<AlertSlots>;
|
|
28
|
+
/** Overrides the text Alert renders of its own. Merged per key. */
|
|
29
|
+
labels?: AlertLabels;
|
|
23
30
|
}
|
|
@@ -10,6 +10,11 @@ export interface BreadcrumbItem {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export type BreadcrumbSlots = 'root' | 'list' | 'item' | 'link' | 'icon' | 'separator' | 'current' | 'ellipsis' | 'hiddenList' | 'hiddenItem';
|
|
13
|
+
/** Text Breadcrumb renders of its own, for translating it. */
|
|
14
|
+
export interface BreadcrumbLabels {
|
|
15
|
+
/** Button that reveals the collapsed middle items, and its tooltip. */
|
|
16
|
+
showHidden?: string;
|
|
17
|
+
}
|
|
13
18
|
export interface BreadcrumbProps extends HtmlProps {
|
|
14
19
|
items: BreadcrumbItem[];
|
|
15
20
|
separator?: ReactNode;
|
|
@@ -23,4 +28,6 @@ export interface BreadcrumbProps extends HtmlProps {
|
|
|
23
28
|
style?: CSSProperties;
|
|
24
29
|
classNames?: SlotClassNames<BreadcrumbSlots>;
|
|
25
30
|
styles?: SlotStyles<BreadcrumbSlots>;
|
|
31
|
+
/** Overrides the text Breadcrumb renders of its own. Merged per key. */
|
|
32
|
+
labels?: BreadcrumbLabels;
|
|
26
33
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonStyleType } from '../button/button.types';
|
|
3
|
-
import { HtmlProps } from '../types/slots.types';
|
|
3
|
+
import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
|
|
4
4
|
import { IconAction } from '../types/actions.types';
|
|
5
5
|
export declare enum CardStyleType {
|
|
6
6
|
Elevated = "elevated",
|
|
7
7
|
Outlined = "outlined",
|
|
8
8
|
Filled = "filled"
|
|
9
9
|
}
|
|
10
|
+
export type CardSlots = 'root' | 'content';
|
|
10
11
|
export interface CardProps extends Omit<HtmlProps, 'tabIndex'> {
|
|
11
12
|
className?: string | undefined;
|
|
12
13
|
children?: ReactNode;
|
|
@@ -17,6 +18,10 @@ export interface CardProps extends Omit<HtmlProps, 'tabIndex'> {
|
|
|
17
18
|
style?: React.CSSProperties;
|
|
18
19
|
autoGap?: boolean;
|
|
19
20
|
clip?: boolean;
|
|
21
|
+
/** Classes for the inner elements. See `CardSlots`. */
|
|
22
|
+
classNames?: SlotClassNames<CardSlots>;
|
|
23
|
+
/** Inline styles for the inner elements. See `CardSlots`. */
|
|
24
|
+
styles?: SlotStyles<CardSlots>;
|
|
20
25
|
}
|
|
21
26
|
export type CardHeaderAction = IconAction;
|
|
22
27
|
export interface CardHeaderProps {
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
3
3
|
export type CarouselSlots = 'root' | 'track' | 'slide' | 'prevButton' | 'nextButton' | 'dots' | 'dot';
|
|
4
|
+
/** Text Carousel renders of its own, for translating it. */
|
|
5
|
+
export interface CarouselLabels {
|
|
6
|
+
/** Button to the previous slide, and its tooltip. */
|
|
7
|
+
previous?: string;
|
|
8
|
+
/** Button to the next slide, and its tooltip. */
|
|
9
|
+
next?: string;
|
|
10
|
+
/** The dot strip, read out by screen readers. */
|
|
11
|
+
slides?: string;
|
|
12
|
+
/** One dot, given its 1-based slide number. */
|
|
13
|
+
goToSlide?: (slide: number) => string;
|
|
14
|
+
}
|
|
4
15
|
export interface CarouselProps extends Omit<HtmlProps, 'onChange'> {
|
|
5
16
|
children?: ReactNode;
|
|
6
17
|
currentIndex?: number;
|
|
@@ -19,4 +30,6 @@ export interface CarouselProps extends Omit<HtmlProps, 'onChange'> {
|
|
|
19
30
|
style?: CSSProperties;
|
|
20
31
|
classNames?: SlotClassNames<CarouselSlots>;
|
|
21
32
|
styles?: SlotStyles<CarouselSlots>;
|
|
33
|
+
/** Overrides the text Carousel renders of its own. Merged per key. */
|
|
34
|
+
labels?: CarouselLabels;
|
|
22
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HtmlProps } from '../types/slots.types';
|
|
1
|
+
import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
|
|
2
2
|
export declare enum ChipStyleType {
|
|
3
3
|
Default = "default",
|
|
4
4
|
Primary = "primary",
|
|
@@ -6,6 +6,12 @@ export declare enum ChipStyleType {
|
|
|
6
6
|
Warn = "warn",
|
|
7
7
|
Error = "error"
|
|
8
8
|
}
|
|
9
|
+
/** Text Chip renders of its own, for translating it. */
|
|
10
|
+
export interface ChipLabels {
|
|
11
|
+
/** The remove button, read out by screen readers (default `Remove`). */
|
|
12
|
+
remove?: string;
|
|
13
|
+
}
|
|
14
|
+
export type ChipSlots = 'root' | 'inner' | 'thumbnail' | 'text' | 'removeIcon';
|
|
9
15
|
export interface ChipProps extends HtmlProps {
|
|
10
16
|
className?: string;
|
|
11
17
|
text?: string;
|
|
@@ -13,9 +19,14 @@ export interface ChipProps extends HtmlProps {
|
|
|
13
19
|
styleType?: ChipStyleType;
|
|
14
20
|
showRemoveIcon?: boolean;
|
|
15
21
|
/** Accessible name for the remove button. Default `'Remove'`. */
|
|
16
|
-
removeLabel?: string;
|
|
17
22
|
onClick?: () => void;
|
|
18
23
|
onRemove?: () => void;
|
|
24
|
+
/** Overrides the text Chip renders of its own. Merged per key. */
|
|
25
|
+
labels?: ChipLabels;
|
|
26
|
+
/** Classes for the inner elements. See `ChipSlots`. */
|
|
27
|
+
classNames?: SlotClassNames<ChipSlots>;
|
|
28
|
+
/** Inline styles for the inner elements. See `ChipSlots`. */
|
|
29
|
+
styles?: SlotStyles<ChipSlots>;
|
|
19
30
|
}
|
|
20
31
|
export interface ChipContainerProps extends HtmlProps {
|
|
21
32
|
className?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ColorPickerProps } from './colorPicker.types';
|
|
3
|
-
declare function ColorPicker({ className, value, onChange, showInput, showAlpha, inline, ...rest }: ColorPickerProps): ReactElement;
|
|
3
|
+
declare function ColorPicker({ className, value, onChange, showInput, showAlpha, inline, labels, style, classNames, styles: slotStyles, ...rest }: ColorPickerProps): ReactElement;
|
|
4
4
|
export default ColorPicker;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { HtmlProps } from '../types/slots.types';
|
|
1
|
+
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
2
|
+
export type ColorPickerSlots = 'root' | 'swatch' | 'panel' | 'gradient' | 'hueSlider' | 'alphaSlider' | 'hexInput' | 'eyeDropper';
|
|
3
|
+
/** Text ColorPicker renders of its own, for translating it. */
|
|
4
|
+
export interface ColorPickerLabels {
|
|
5
|
+
/** The eyedropper button, read out by screen readers. */
|
|
6
|
+
pickFromScreen?: string;
|
|
7
|
+
}
|
|
2
8
|
export interface ColorPickerProps extends Omit<HtmlProps, 'onChange'> {
|
|
3
9
|
className?: string;
|
|
4
10
|
value?: string;
|
|
@@ -6,4 +12,10 @@ export interface ColorPickerProps extends Omit<HtmlProps, 'onChange'> {
|
|
|
6
12
|
showInput?: boolean;
|
|
7
13
|
showAlpha?: boolean;
|
|
8
14
|
inline?: boolean;
|
|
15
|
+
/** Overrides the text ColorPicker renders of its own. Merged per key. */
|
|
16
|
+
labels?: ColorPickerLabels;
|
|
17
|
+
/** Classes for the inner elements. See `ColorPickerSlots`. */
|
|
18
|
+
classNames?: SlotClassNames<ColorPickerSlots>;
|
|
19
|
+
/** Inline styles for the inner elements. See `ColorPickerSlots`. */
|
|
20
|
+
styles?: SlotStyles<ColorPickerSlots>;
|
|
9
21
|
}
|
|
@@ -7,7 +7,12 @@ import { InputDropdownProps } from '../inputDropdown/inputDropdown.types';
|
|
|
7
7
|
import { CheckboxProps } from '../checkbox/checkbox.types';
|
|
8
8
|
import { SwitchProps } from '../switch/switch.types';
|
|
9
9
|
import { RadioGroupProps } from '../radioGroup/radioGroup.types';
|
|
10
|
-
import { DatePickerProps } from '../datePicker/datePicker';
|
|
10
|
+
import { DatePickerProps } from '../datePicker/datePicker.types';
|
|
11
|
+
import { ColorPickerLabels } from '../colorPicker/colorPicker.types';
|
|
12
|
+
import { EmptyStateLabels } from '../emptyState/emptyState.types';
|
|
13
|
+
import { KlipyPickerLabels } from '../klipyPicker/klipyPicker.types';
|
|
14
|
+
import { SearchInputLabels } from '../searchInput/searchInput.types';
|
|
15
|
+
import { VirtualListLabels } from '../virtualList/virtualList.types';
|
|
11
16
|
import { ButtonProps } from '../button/button.types';
|
|
12
17
|
import { ActionButtonsProps } from '../actionButtons/actionButtons.types';
|
|
13
18
|
import { ConfirmModalProps } from '../confirmModal/confirmModal.types';
|
|
@@ -52,6 +57,26 @@ import { ModalProps } from '../modal/modal.types';
|
|
|
52
57
|
* own component-keyed defaults take precedence for props they handle themselves.
|
|
53
58
|
*/
|
|
54
59
|
export interface ComponentDefaults {
|
|
60
|
+
/**
|
|
61
|
+
* Labels only. These components take no other global defaults: `ColorPicker`
|
|
62
|
+
* and `Toast` are configured elsewhere, and `VirtualList`'s props are generic,
|
|
63
|
+
* which a per-key default map can't express.
|
|
64
|
+
*/
|
|
65
|
+
ColorPicker?: {
|
|
66
|
+
labels?: ColorPickerLabels;
|
|
67
|
+
};
|
|
68
|
+
EmptyState?: {
|
|
69
|
+
labels?: EmptyStateLabels;
|
|
70
|
+
};
|
|
71
|
+
KlipyPicker?: {
|
|
72
|
+
labels?: KlipyPickerLabels;
|
|
73
|
+
};
|
|
74
|
+
SearchInput?: {
|
|
75
|
+
labels?: SearchInputLabels;
|
|
76
|
+
};
|
|
77
|
+
VirtualList?: {
|
|
78
|
+
labels?: VirtualListLabels;
|
|
79
|
+
};
|
|
55
80
|
Input?: Partial<InputProps>;
|
|
56
81
|
Textarea?: Partial<TextareaProps>;
|
|
57
82
|
NumberInput?: Partial<NumberInputProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default } from './configProvider';
|
|
2
2
|
export { useComponentDefaults } from './useComponentDefaults';
|
|
3
|
+
export { useLabels } from './useLabels';
|
|
3
4
|
export { usePresentationDefault } from './usePresentationDefault';
|
|
4
5
|
export type { ComponentDefaults, ConfigProviderProps } from './configProvider.types';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentDefaults } from './configProvider.types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the text a component renders of its own, per key, from three places:
|
|
4
|
+
* the component's built-in English, the nearest `ConfigProvider`, and the
|
|
5
|
+
* instance's `labels` prop, in that order of increasing precedence.
|
|
6
|
+
*
|
|
7
|
+
* Per key is the point, and the reason this exists next to `useComponentDefaults`
|
|
8
|
+
* rather than relying on it. That one fills in whole props: a `labels` object on
|
|
9
|
+
* an instance would replace the provider's entirely, so translating an app once
|
|
10
|
+
* and overriding a single string on one instance would silently drop every other
|
|
11
|
+
* translation for that component.
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const DEFAULT_LABELS: Required<ModalLabels> = { close: 'Close' };
|
|
15
|
+
*
|
|
16
|
+
* function Modal({ labels, ...rest }: ModalProps) {
|
|
17
|
+
* const text = useLabels('Modal', labels, DEFAULT_LABELS);
|
|
18
|
+
* // text.close
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useLabels<L extends object>(component: keyof ComponentDefaults, labels: Partial<L> | undefined, defaults: L): L;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { HtmlProps } from '../types/slots.types';
|
|
2
3
|
import { ActionButtonsProps } from '../actionButtons';
|
|
3
|
-
|
|
4
|
+
/** Text ConfirmModal renders of its own, for translating it. */
|
|
5
|
+
export interface ConfirmModalLabels {
|
|
6
|
+
/** The confirming button (default `Confirm`). */
|
|
7
|
+
submit?: string;
|
|
8
|
+
/** The dismissing button (default `Cancel`). */
|
|
9
|
+
cancel?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ConfirmModalProps extends Omit<HtmlProps<HTMLDivElement>, 'onClose' | 'content' | 'title'> {
|
|
4
12
|
children?: ReactNode;
|
|
5
13
|
className?: string;
|
|
14
|
+
style?: CSSProperties;
|
|
6
15
|
onClose?: (didSubmit: boolean) => void;
|
|
7
16
|
onConfirm?: () => void | Promise<void>;
|
|
8
17
|
title?: string;
|
|
9
18
|
content?: ReactNode;
|
|
10
19
|
isOpen?: boolean;
|
|
11
|
-
submitLabel?: string;
|
|
12
|
-
cancelLabel?: string;
|
|
13
20
|
isDelete?: boolean;
|
|
14
21
|
actionButtonsProps?: ActionButtonsProps;
|
|
22
|
+
/** Overrides the text ConfirmModal renders of its own. Merged per key. */
|
|
23
|
+
labels?: ConfirmModalLabels;
|
|
15
24
|
}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
month?: number;
|
|
4
|
-
year?: number;
|
|
5
|
-
onSelect?: (date: Date) => void;
|
|
6
|
-
selectionStart?: Date;
|
|
7
|
-
selectionEnd?: Date;
|
|
8
|
-
minDate?: Date | null;
|
|
9
|
-
maxDate?: Date | null;
|
|
10
|
-
/** Called to shift the displayed month by ±1 when arrow navigation runs past its edge. */
|
|
11
|
-
onNavigateMonth?: (delta: 1 | -1) => void;
|
|
12
|
-
}
|
|
13
|
-
export default function DatePickerMonth({ className, month, year, onSelect, selectionStart, selectionEnd, minDate, maxDate, onNavigateMonth, }: DatePickerMonthProps): import("react").JSX.Element;
|
|
14
|
-
export {};
|
|
1
|
+
import { DatePickerMonthProps } from './datePickerMonth.types';
|
|
2
|
+
export default function DatePickerMonth({ style, className, month, year, onSelect, selectionStart, selectionEnd, minDate, maxDate, onNavigateMonth, }: DatePickerMonthProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface DatePickerMonthProps {
|
|
3
|
+
/** Class on the root element. */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Inline style on the root element, forwarded from DatePicker's `calendar` slot. */
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
/** Month to display, 1 to 12. */
|
|
8
|
+
month?: number;
|
|
9
|
+
/** Year to display. */
|
|
10
|
+
year?: number;
|
|
11
|
+
/** Called with the day that was picked. */
|
|
12
|
+
onSelect?: (date: Date) => void;
|
|
13
|
+
/** First day of the highlighted range, and the day that starts with the tab stop. */
|
|
14
|
+
selectionStart?: Date;
|
|
15
|
+
/** Last day of the highlighted range. */
|
|
16
|
+
selectionEnd?: Date;
|
|
17
|
+
/** Days before this are not selectable. */
|
|
18
|
+
minDate?: Date | null;
|
|
19
|
+
/** Days after this are not selectable. */
|
|
20
|
+
maxDate?: Date | null;
|
|
21
|
+
/** Called to shift the displayed month by ±1 when arrow navigation runs past its edge. */
|
|
22
|
+
onNavigateMonth?: (delta: 1 | -1) => void;
|
|
23
|
+
}
|
|
@@ -1,24 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface DatePickerProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
selected?: Date;
|
|
6
|
-
onSelect?: (date: Date | null) => void;
|
|
7
|
-
formValidator?: FormValidator | null;
|
|
8
|
-
noInput?: boolean;
|
|
9
|
-
noHeader?: boolean;
|
|
10
|
-
isModal?: boolean;
|
|
11
|
-
isInline?: boolean;
|
|
12
|
-
onChange?: (date: Date | null) => void;
|
|
13
|
-
minDate?: Date | null;
|
|
14
|
-
maxDate?: Date | null;
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
showClearButton?: boolean;
|
|
17
|
-
label?: string;
|
|
18
|
-
isValid?: boolean;
|
|
19
|
-
errorMessage?: string;
|
|
20
|
-
isRequired?: boolean;
|
|
21
|
-
startDate?: Date;
|
|
22
|
-
endDate?: Date;
|
|
23
|
-
}
|
|
2
|
+
import { DatePickerProps } from './datePicker.types';
|
|
24
3
|
export default function DatePicker(props: DatePickerProps): React.JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { FormValidator } from '../../services/formValidation';
|
|
3
|
+
import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
|
|
4
|
+
export type DatePickerSlots = 'root' | 'input' | 'header' | 'monthDropdown' | 'yearDropdown' | 'calendar' | 'clearButton';
|
|
5
|
+
/**
|
|
6
|
+
* `onChange` and `onSelect` report a date rather than a DOM event, so the native
|
|
7
|
+
* handlers of those names are dropped instead of being widened to accept both.
|
|
8
|
+
*/
|
|
9
|
+
export interface DatePickerProps extends Omit<HtmlProps<HTMLDivElement>, 'onChange' | 'onSelect'> {
|
|
10
|
+
/** Class on the root element. */
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
classNames?: SlotClassNames<DatePickerSlots>;
|
|
14
|
+
styles?: SlotStyles<DatePickerSlots>;
|
|
15
|
+
/** Selected date, controlled. Ignored while a `formValidator` owns the value. */
|
|
16
|
+
selected?: Date;
|
|
17
|
+
/** Floating label on the input. */
|
|
18
|
+
label?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Called when a day is picked in the calendar, after `onChange`. Picking also
|
|
21
|
+
* closes the picker.
|
|
22
|
+
*/
|
|
23
|
+
onSelect?: (date: Date | null) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Called whenever the value changes, whether picked in the calendar or typed
|
|
26
|
+
* into the input. `null` when the field was cleared or holds no valid date.
|
|
27
|
+
*/
|
|
28
|
+
onChange?: (date: Date | null) => void;
|
|
29
|
+
/** Hands the value to a validator, which then owns it. See docs/FormValidator.md. */
|
|
30
|
+
formValidator?: FormValidator | null;
|
|
31
|
+
/** Earliest selectable date. Also bounds the year dropdown. */
|
|
32
|
+
minDate?: Date | null;
|
|
33
|
+
/** Latest selectable date. Also bounds the year dropdown. */
|
|
34
|
+
maxDate?: Date | null;
|
|
35
|
+
/**
|
|
36
|
+
* Start of a highlighted range. Defaults to the selected date, so two pickers
|
|
37
|
+
* sharing a start and an end highlight the span between them.
|
|
38
|
+
*/
|
|
39
|
+
startDate?: Date;
|
|
40
|
+
/** End of the highlighted range. */
|
|
41
|
+
endDate?: Date;
|
|
42
|
+
/** Render the calendar in place instead of in a popover. */
|
|
43
|
+
isInline?: boolean;
|
|
44
|
+
/** Open the calendar in a modal, with the input read-only. */
|
|
45
|
+
isModal?: boolean;
|
|
46
|
+
/** Drop the text input and show the calendar alone. */
|
|
47
|
+
noInput?: boolean;
|
|
48
|
+
/** Drop the month and year navigation above the calendar. */
|
|
49
|
+
noHeader?: boolean;
|
|
50
|
+
/** Show a button that clears the value. */
|
|
51
|
+
showClearButton?: boolean;
|
|
52
|
+
/** Rendered under the calendar, inside the popover or modal. */
|
|
53
|
+
children?: ReactNode;
|
|
54
|
+
/** Marks the field invalid. A `formValidator` decides this for itself. */
|
|
55
|
+
isValid?: boolean;
|
|
56
|
+
/** Message for the error tooltip, shown while the field is focused or hovered. */
|
|
57
|
+
errorMessage?: string;
|
|
58
|
+
/** Appends ` *` to the label. Implied by a `required` validator on `formValidator`. */
|
|
59
|
+
isRequired?: boolean;
|
|
60
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { DrawerProps } from './drawer.types';
|
|
3
|
-
declare function Drawer({ className, isOpen, closedWidth, openedWidth, children }: DrawerProps): ReactElement;
|
|
3
|
+
declare function Drawer({ className, isOpen, closedWidth, openedWidth, children, style, classNames, styles: slotStyles, ...rest }: DrawerProps): ReactElement;
|
|
4
4
|
export default Drawer;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
|
|
3
|
+
export type DrawerSlots = 'root' | 'content' | 'inner';
|
|
4
|
+
export interface DrawerProps extends HtmlProps<HTMLDivElement> {
|
|
2
5
|
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
classNames?: SlotClassNames<DrawerSlots>;
|
|
8
|
+
styles?: SlotStyles<DrawerSlots>;
|
|
3
9
|
isOpen?: boolean;
|
|
4
10
|
/** Width of the container when closed. Defaults to 0. Any CSS length value, e.g. '48px'. */
|
|
5
11
|
closedWidth?: string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
1
2
|
import { ReactNode, Ref } from 'react';
|
|
2
3
|
import { FormValidator } from '../../services/formValidation';
|
|
3
|
-
import { HtmlProps } from '../types/slots.types';
|
|
4
4
|
import { Presentation } from '../floatingMenu/floatingMenu.types';
|
|
5
5
|
export interface DropdownItem {
|
|
6
6
|
key: string | number;
|
|
7
7
|
label: ReactNode;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
|
+
export type DropdownSlots = 'root' | 'label' | 'field' | 'control' | 'icon' | 'placeholder' | 'list' | 'option';
|
|
10
11
|
export interface DropdownProps extends Omit<HtmlProps, 'onFocus' | 'onBlur' | 'onMouseEnter' | 'onMouseLeave'> {
|
|
11
12
|
formValidator?: FormValidator | null;
|
|
12
13
|
onMouseEnter?: ((event: React.MouseEvent) => void) | null;
|
|
@@ -33,15 +34,14 @@ export interface DropdownProps extends Omit<HtmlProps, 'onFocus' | 'onBlur' | 'o
|
|
|
33
34
|
/** Where the list opens: anchored to the input (`Default`), pinned to the bottom of the
|
|
34
35
|
* screen, or the latter only on a small touch screen. */
|
|
35
36
|
presentation?: Presentation;
|
|
36
|
-
inputClassName?: string;
|
|
37
|
-
dropDownIconClassName?: string;
|
|
38
|
-
dropDownClassName?: string;
|
|
39
|
-
labelClassName?: string;
|
|
40
|
-
dropDownInputClassName?: string;
|
|
41
37
|
useMatLabelStyle?: boolean;
|
|
42
38
|
alwaysFloatLabel?: boolean;
|
|
43
39
|
placeholder?: string;
|
|
44
40
|
plainStyle?: boolean;
|
|
45
41
|
scrollToSelected?: boolean;
|
|
46
42
|
reactRef?: Ref<HTMLButtonElement>;
|
|
43
|
+
/** Classes for the inner elements. See `DropdownSlots`. */
|
|
44
|
+
classNames?: SlotClassNames<DropdownSlots>;
|
|
45
|
+
/** Inline styles for the inner elements. See `DropdownSlots`. */
|
|
46
|
+
styles?: SlotStyles<DropdownSlots>;
|
|
47
47
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { EmptyStateProps } from './emptyState.types';
|
|
3
|
-
export default function EmptyState({ className, icon, children, ...rest }: EmptyStateProps): ReactElement;
|
|
3
|
+
export default function EmptyState({ className, icon, children, labels, style, classNames, styles: slotStyles, ...rest }: EmptyStateProps): ReactElement;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { IconContent } from '../types/icon.types';
|
|
3
|
-
|
|
4
|
+
export type EmptyStateSlots = 'root' | 'icon' | 'text';
|
|
5
|
+
/** Text EmptyState renders of its own, for translating it. */
|
|
6
|
+
export interface EmptyStateLabels {
|
|
7
|
+
/** Shown when no `children` are given. */
|
|
8
|
+
empty?: string;
|
|
9
|
+
}
|
|
4
10
|
export interface EmptyStateProps extends HtmlProps {
|
|
5
11
|
className?: string;
|
|
6
12
|
icon?: IconContent;
|
|
7
13
|
children?: ReactNode;
|
|
14
|
+
/** Overrides the text EmptyState renders of its own. Merged per key. */
|
|
15
|
+
labels?: EmptyStateLabels;
|
|
16
|
+
/** Classes for the inner elements. See `EmptyStateSlots`. */
|
|
17
|
+
classNames?: SlotClassNames<EmptyStateSlots>;
|
|
18
|
+
/** Inline styles for the inner elements. See `EmptyStateSlots`. */
|
|
19
|
+
styles?: SlotStyles<EmptyStateSlots>;
|
|
8
20
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FabBaseProps } from './fabBase.types';
|
|
2
|
-
declare function FabBase({ children, size, className, styleType, onClick, }: FabBaseProps): import("react").JSX.Element;
|
|
2
|
+
declare function FabBase({ style, children, size, className, styleType, onClick, }: FabBaseProps): import("react").JSX.Element;
|
|
3
3
|
export default FabBase;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonStyleType } from '../../../button/button.types';
|
|
3
3
|
export type FabBaseSize = 'default' | 'mini';
|
|
4
4
|
export interface FabBaseProps {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
size?: FabBaseSize;
|
|
7
7
|
className?: string;
|
|
8
|
+
/** Forwarded from Fab's `button` slot. */
|
|
9
|
+
style?: CSSProperties;
|
|
8
10
|
styleType?: ButtonStyleType;
|
|
9
11
|
onClick?: () => void;
|
|
10
12
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FabProps } from './fab.types';
|
|
2
|
-
declare function Fab({ children, size, menuEntries, onMenuEntryClicked, onClick, closeMenuOnEntryClicked, ...rest }: FabProps): import("react").JSX.Element;
|
|
2
|
+
declare function Fab({ children, size, menuEntries, onMenuEntryClicked, onClick, closeMenuOnEntryClicked, className, style, classNames, styles: slotStyles, ...rest }: FabProps): import("react").JSX.Element;
|
|
3
3
|
export default Fab;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { IconContent } from '../types/icon.types';
|
|
3
|
-
import { HtmlProps } from '../types/slots.types';
|
|
4
4
|
export type FabSize = 'default' | 'mini';
|
|
5
5
|
export interface FabMenuEntry {
|
|
6
6
|
id: string;
|
|
7
7
|
icon: IconContent;
|
|
8
8
|
label?: string;
|
|
9
9
|
}
|
|
10
|
+
export type FabSlots = 'root' | 'backdrop' | 'button' | 'icon' | 'menu' | 'menuEntry' | 'menuEntryLabel';
|
|
10
11
|
export interface FabProps extends HtmlProps {
|
|
11
12
|
children?: ReactNode;
|
|
12
13
|
size?: FabSize;
|
|
@@ -14,4 +15,8 @@ export interface FabProps extends HtmlProps {
|
|
|
14
15
|
onMenuEntryClicked?: (id: string) => void;
|
|
15
16
|
onClick?: () => void;
|
|
16
17
|
closeMenuOnEntryClicked?: boolean;
|
|
18
|
+
/** Classes for the inner elements. See `FabSlots`. */
|
|
19
|
+
classNames?: SlotClassNames<FabSlots>;
|
|
20
|
+
/** Inline styles for the inner elements. See `FabSlots`. */
|
|
21
|
+
styles?: SlotStyles<FabSlots>;
|
|
17
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { InfiniteBlockProps } from './infiniteBlock.types';
|
|
3
|
-
declare function InfiniteBlock({ children, onScroll, className, isDataLoading, setHighlightedIndex, }: InfiniteBlockProps): React.JSX.Element;
|
|
3
|
+
declare function InfiniteBlock({ children, onScroll, className, style, isDataLoading, setHighlightedIndex, }: InfiniteBlockProps): React.JSX.Element;
|
|
4
4
|
export default InfiniteBlock;
|
|
@@ -4,6 +4,8 @@ export interface InfiniteBlockProps {
|
|
|
4
4
|
/** Called when the user scrolls to the bottom; must return a Promise that resolves when the new data has loaded. */
|
|
5
5
|
onScroll: () => Promise<void>;
|
|
6
6
|
className?: string;
|
|
7
|
+
/** Inline style on the scroll container. */
|
|
8
|
+
style?: React.CSSProperties;
|
|
7
9
|
/** Replaces children with a full-block spinner (initial load). */
|
|
8
10
|
isDataLoading?: boolean;
|
|
9
11
|
/** Called with the newly highlighted child index after keyboard navigation. */
|
|
@@ -17,6 +17,17 @@ export declare enum InputIconPosition {
|
|
|
17
17
|
}
|
|
18
18
|
export type InputSlots = 'label' | 'container' | 'input' | 'suffix' | 'upperRightLabel' | 'fieldset';
|
|
19
19
|
type OverriddenInputAttributes = 'onChange' | 'onFocus' | 'onBlur' | 'onMouseEnter' | 'onMouseLeave' | 'onClick' | 'type' | 'value' | 'min' | 'max' | 'autoComplete';
|
|
20
|
+
/** Text Input renders of its own, for translating it. */
|
|
21
|
+
export interface InputLabels {
|
|
22
|
+
/** Clear button on a search input, read out by screen readers. */
|
|
23
|
+
clear?: string;
|
|
24
|
+
/** Reveals a password, read out by screen readers. */
|
|
25
|
+
showPassword?: string;
|
|
26
|
+
/** Hides a password again. */
|
|
27
|
+
hidePassword?: string;
|
|
28
|
+
/** Clears a search input, read out by screen readers. */
|
|
29
|
+
clearSearch?: string;
|
|
30
|
+
}
|
|
20
31
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, OverriddenInputAttributes>, DataProps {
|
|
21
32
|
onMouseEnter?: ((event: React.MouseEvent) => void) | null;
|
|
22
33
|
onMouseLeave?: ((event: React.MouseEvent) => void) | null;
|
|
@@ -62,5 +73,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
62
73
|
autoResize?: boolean;
|
|
63
74
|
classNames?: SlotClassNames<InputSlots>;
|
|
64
75
|
styles?: SlotStyles<InputSlots>;
|
|
76
|
+
/** Overrides the text Input renders of its own. Merged per key. */
|
|
77
|
+
labels?: InputLabels;
|
|
65
78
|
}
|
|
66
79
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { KlipyPickerProps } from './klipyPicker.types';
|
|
3
|
-
export default function KlipyPicker({ className, token, isModal, onSelect, selected, }: KlipyPickerProps): ReactElement;
|
|
3
|
+
export default function KlipyPicker({ className, token, isModal, onSelect, selected, labels, }: KlipyPickerProps): ReactElement;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { KlipyResult } from '../../services/klipy';
|
|
2
|
+
/** Text KlipyPicker renders of its own, for translating it. */
|
|
3
|
+
export interface KlipyPickerLabels {
|
|
4
|
+
/** Floating label on the search field. */
|
|
5
|
+
search?: string;
|
|
6
|
+
}
|
|
2
7
|
export interface KlipyPickerProps {
|
|
3
8
|
className?: string;
|
|
4
9
|
token?: string;
|
|
5
10
|
isModal?: boolean;
|
|
6
11
|
onSelect?: (preview: KlipyResult | null) => void | Promise<void>;
|
|
7
12
|
selected?: string | null;
|
|
13
|
+
/** Overrides the text KlipyPicker renders of its own. Merged per key. */
|
|
14
|
+
labels?: KlipyPickerLabels;
|
|
8
15
|
}
|
|
@@ -2,6 +2,11 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
3
3
|
import { Presentation } from '../floatingMenu/floatingMenu.types';
|
|
4
4
|
export type ModalSlots = 'container' | 'backdrop' | 'modal' | 'header' | 'title' | 'closeButton' | 'body';
|
|
5
|
+
/** Text Modal renders of its own, for translating it. */
|
|
6
|
+
export interface ModalLabels {
|
|
7
|
+
/** Close button, read out by screen readers. */
|
|
8
|
+
close?: string;
|
|
9
|
+
}
|
|
5
10
|
export interface ModalProps extends HtmlProps<HTMLDivElement> {
|
|
6
11
|
children?: React.ReactNode;
|
|
7
12
|
title?: string;
|
|
@@ -18,4 +23,6 @@ export interface ModalProps extends HtmlProps<HTMLDivElement> {
|
|
|
18
23
|
presentation?: Presentation;
|
|
19
24
|
classNames?: SlotClassNames<ModalSlots>;
|
|
20
25
|
styles?: SlotStyles<ModalSlots>;
|
|
26
|
+
/** Overrides the text Modal renders of its own. Merged per key. */
|
|
27
|
+
labels?: ModalLabels;
|
|
21
28
|
}
|