@povio/ui 3.3.0-rc.4 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/browser-tests/checkbox/CheckboxGroupHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/CheckboxHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/checkbox-group.spec.d.ts +1 -0
- package/dist/browser-tests/checkbox/checkbox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/DateTimeHarnesses.d.ts +43 -0
- package/dist/browser-tests/datetime-picker/assertions.d.ts +9 -0
- package/dist/browser-tests/datetime-picker/date-input-focus.firefox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-range-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload/FileUploadHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload/file-upload.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload-container/FileUploadContainerHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload-container/file-upload-container.spec.d.ts +1 -0
- package/dist/browser-tests/input-upload/InputUploadHarness.d.ts +9 -0
- package/dist/browser-tests/input-upload/input-upload.spec.d.ts +1 -0
- package/dist/browser-tests/modal/ModalHarness.d.ts +5 -0
- package/dist/browser-tests/modal/modal.spec.d.ts +1 -0
- package/dist/browser-tests/number-input/NumberInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-input/number-input.spec.d.ts +1 -0
- package/dist/browser-tests/number-range-input/NumberRangeInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-range-input/number-range-input.spec.d.ts +1 -0
- package/dist/browser-tests/password-input/PasswordInputHarness.d.ts +6 -0
- package/dist/browser-tests/password-input/password-input.spec.d.ts +1 -0
- package/dist/browser-tests/radio-group/RadioGroupHarness.d.ts +15 -0
- package/dist/browser-tests/radio-group/radio-group.spec.d.ts +1 -0
- package/dist/browser-tests/selection/SelectionHarnesses.d.ts +61 -0
- package/dist/browser-tests/selection/autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/interactions.d.ts +2 -0
- package/dist/browser-tests/selection/query-autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/query-select.spec.d.ts +1 -0
- package/dist/browser-tests/selection/select.spec.d.ts +1 -0
- package/dist/browser-tests/slider/SliderHarness.d.ts +11 -0
- package/dist/browser-tests/slider/slider.spec.d.ts +1 -0
- package/dist/browser-tests/text-area/TextAreaHarness.d.ts +10 -0
- package/dist/browser-tests/text-area/text-area.spec.d.ts +1 -0
- package/dist/browser-tests/text-input/TextInputHarness.d.ts +10 -0
- package/dist/browser-tests/text-input/text-input.spec.d.ts +1 -0
- package/dist/browser-tests/toggle/ToggleHarness.d.ts +10 -0
- package/dist/browser-tests/toggle/toggle.spec.d.ts +1 -0
- package/dist/browser-tests/utils/blur.d.ts +22 -0
- package/dist/browser-tests/utils/events.d.ts +4 -0
- package/dist/browser-tests/utils/input.d.ts +10 -0
- package/dist/components/buttons/Button/button.cva.d.ts +1 -1
- package/dist/components/buttons/Button/button.cva.js +4 -4
- package/dist/components/buttons/PillButton/pillButton.cva.js +4 -4
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +19 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +28 -20
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -4
- package/dist/components/inputs/FormField/FormField.js +34 -47
- package/dist/components/inputs/Selection/Select/Select.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +154 -156
- package/dist/components/inputs/shared/InputClear.js +24 -40
- package/dist/components/overlays/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +3 -2
- package/dist/components/overlays/Modal/Modal.js +3 -1
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/table/Table.d.ts +2 -8
- package/dist/components/table/Table.js +33 -55
- package/dist/config/uiOverrides.context.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/dist/vitest.setup.browser.d.ts +6 -0
- package/package.json +2 -2
- package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
- package/dist/components/inputs/FormField/formField.cva.js +0 -16
- package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
- package/dist/components/table/TableColumnFilterInput.js +0 -108
- package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
- package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
- package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
- package/dist/components/table/TableColumnFilterRow.js +0 -68
package/README.md
CHANGED
|
@@ -4,11 +4,25 @@ UI Components that match Povio's Atlas Design System.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
`
|
|
7
|
+
`bun add @povio/ui`
|
|
8
8
|
|
|
9
9
|
## Versioning
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
`^2.1` still corresponds to Atlas 2.1. All versions after that currently target Atlas 2.2 and follow semantic versioning — breaking changes bump the major version.
|
|
12
|
+
|
|
13
|
+
## Publishing
|
|
14
|
+
|
|
15
|
+
### Stable release
|
|
16
|
+
|
|
17
|
+
Create a GitHub release with a tag matching `v*.*.*-ui`. This triggers the publish workflow and releases the package to NPM.
|
|
18
|
+
|
|
19
|
+
Example: `v1.2.3-ui`
|
|
20
|
+
|
|
21
|
+
### Release candidate
|
|
22
|
+
|
|
23
|
+
Create and push a git tag matching `v*.*.*-rc.*-ui` (do not use a GitHub release for this). This publishes the package to NPM under the `next` dist-tag.
|
|
24
|
+
|
|
25
|
+
Example: `v1.2.3-rc.1-ui`
|
|
12
26
|
|
|
13
27
|
## Requirements
|
|
14
28
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CheckboxGroupProps } from '../../src/components/inputs/Checkbox/CheckboxGroup';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface CheckboxGroupHarnessProps extends Omit<CheckboxGroupProps, "formControl" | "value" | "onBlur" | "onChange"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
initialValue?: string[] | null;
|
|
6
|
+
mode?: HarnessMode;
|
|
7
|
+
validationMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const CheckboxGroupHarness: ({ formDisabled, initialValue, mode, validationMessage, ...props }: CheckboxGroupHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CheckboxProps } from '../../src/components/inputs/Checkbox/Checkbox';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface CheckboxHarnessProps extends Omit<CheckboxProps, "formControl" | "isSelected" | "onBlur" | "onChange"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
initialValue?: boolean;
|
|
6
|
+
mode?: HarnessMode;
|
|
7
|
+
validationMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const CheckboxHarness: ({ formDisabled, initialValue, mode, validationMessage, ...props }: CheckboxHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DatePickerProps, DateRangePickerProps, DateTimePickerProps, TimePickerProps } from '@povio/ui';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
type RangeValue = NonNullable<DateRangePickerProps["value"]>;
|
|
4
|
+
interface DatePickerHarnessProps extends Omit<DatePickerProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
5
|
+
externalSetValue?: string | null;
|
|
6
|
+
formDisabled?: boolean;
|
|
7
|
+
initialValue?: string | null;
|
|
8
|
+
mode?: HarnessMode;
|
|
9
|
+
validationMessage?: string;
|
|
10
|
+
}
|
|
11
|
+
interface DateTimePickerHarnessProps extends Omit<DateTimePickerProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
12
|
+
externalSetValue?: string | null;
|
|
13
|
+
formDisabled?: boolean;
|
|
14
|
+
initialValue?: string | null;
|
|
15
|
+
mode?: HarnessMode;
|
|
16
|
+
validationMessage?: string;
|
|
17
|
+
}
|
|
18
|
+
interface TimePickerHarnessProps extends Omit<TimePickerProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
19
|
+
formDisabled?: boolean;
|
|
20
|
+
initialValue?: string | null;
|
|
21
|
+
mode?: HarnessMode;
|
|
22
|
+
validationMessage?: string;
|
|
23
|
+
}
|
|
24
|
+
interface DateRangePickerHarnessProps extends Omit<DateRangePickerProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
25
|
+
externalSetValue?: RangeValue | null;
|
|
26
|
+
formDisabled?: boolean;
|
|
27
|
+
initialValue?: RangeValue | null;
|
|
28
|
+
mode?: HarnessMode;
|
|
29
|
+
validationMessage?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const DatePickerHarness: ({ externalSetValue, formDisabled, initialValue, mode, validationMessage, ...props }: DatePickerHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
interface DatePickerAutosaveHarnessProps extends Omit<DatePickerProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
33
|
+
initialValue?: string | null;
|
|
34
|
+
}
|
|
35
|
+
export declare const DatePickerAutosaveHarness: ({ initialValue, ...props }: DatePickerAutosaveHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const DateTimePickerHarness: ({ externalSetValue, formDisabled, initialValue, mode, validationMessage, ...props }: DateTimePickerHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
type FocusPicker = "date" | "date-range" | "date-time" | "time";
|
|
38
|
+
export declare const DateInputFocusHarness: ({ picker }: {
|
|
39
|
+
picker: FocusPicker;
|
|
40
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const TimePickerHarness: ({ formDisabled, initialValue, mode, validationMessage, ...props }: TimePickerHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare const DateRangePickerHarness: ({ externalSetValue, formDisabled, initialValue, mode, validationMessage, ...props }: DateRangePickerHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Locator } from 'vitest/browser';
|
|
2
|
+
export declare const expectDateTimeSegments: (segments: Locator, texts: Array<RegExp | string>) => Promise<void>;
|
|
3
|
+
export declare const typeDateTimeSegments: (_page: unknown, segments: Locator, texts: string[]) => Promise<void>;
|
|
4
|
+
/** react-aria puts aria-selected on the gridcell, not the day button. */
|
|
5
|
+
export declare const expectCalendarDaySelected: (dayButton: Locator, isSelected: boolean) => Promise<void>;
|
|
6
|
+
/** DateRangePicker paints selection via rangeSelection (this class), not aria-selected. */
|
|
7
|
+
export declare const CALENDAR_DAY_VISUAL_SELECTED_CLASS = "bg-interactive-contained-primary-idle";
|
|
8
|
+
export declare const expectCalendarDayVisuallySelected: (dayButton: Locator, isSelected: boolean) => Promise<void>;
|
|
9
|
+
export declare const countVisuallySelectedCalendarDays: (root: Locator) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FileUploadProps } from '../../src/components/inputs/File/FileUpload';
|
|
2
|
+
type FileUploadHarnessProps = Partial<Omit<FileUploadProps, "fileRemove" | "fileUpload" | "onInvalidFileType">>;
|
|
3
|
+
export declare const FileUploadHarness: (props: FileUploadHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FileUploadContainerProps } from '../../src/components/inputs/File/FileUploadContainer';
|
|
2
|
+
type FileUploadContainerHarnessProps = Partial<Omit<FileUploadContainerProps, "fileUpload" | "children">>;
|
|
3
|
+
export declare const FileUploadContainerHarness: (props: FileUploadContainerHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InputUploadProps } from '../../src/components/inputs/File/InputUpload';
|
|
2
|
+
type InputUploadHarnessProps = Partial<Omit<InputUploadProps, "formControl" | "onChange" | "value">> & {
|
|
3
|
+
initialValue?: File | File[] | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const InputUploadHarness: ({ initialValue, ...props }: InputUploadHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const InputUploadFormHarness: ({ formDisabled }: {
|
|
7
|
+
formDisabled?: boolean;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ModalProps } from '@povio/ui';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
type ModalHarnessProps = PropsWithChildren<Omit<ModalProps, "isOpen" | "onClose">>;
|
|
4
|
+
export declare const ModalHarness: ({ children, ...props }: ModalHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NumberInputProps } from '../../src/components/inputs/Input/NumberInput/NumberInput';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface NumberInputHarnessProps extends Omit<NumberInputProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
mode?: HarnessMode;
|
|
6
|
+
initialValue?: number | null;
|
|
7
|
+
validationMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const NumberInputHarness: ({ formDisabled, mode, initialValue, validationMessage, action, ...props }: NumberInputHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NumberRangeInputProps, NumberRangeValue } from '../../src/components/inputs/Input/NumberRangeInput/NumberRangeInput';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface NumberRangeInputHarnessProps extends Omit<NumberRangeInputProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
mode?: HarnessMode;
|
|
6
|
+
initialValue?: NumberRangeValue;
|
|
7
|
+
validationMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const NumberRangeInputHarness: ({ formDisabled, mode, initialValue, validationMessage, ...props }: NumberRangeInputHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PasswordInputProps } from '../../src/components/inputs/Input/PasswordInput/PasswordInput';
|
|
2
|
+
interface PasswordInputHarnessProps extends Omit<PasswordInputProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
3
|
+
initialValue?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const PasswordInputHarness: ({ initialValue, ...props }: PasswordInputHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RadioGroupProps } from '../../src/components/inputs/RadioGroup/RadioGroup';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface RadioGroupHarnessProps extends Omit<RadioGroupProps, "formControl" | "onBlur" | "onChange" | "options" | "value"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
initialValue?: string;
|
|
6
|
+
mode?: HarnessMode;
|
|
7
|
+
options?: RadioGroupProps["options"];
|
|
8
|
+
validationMessage?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const RADIO_OPTIONS: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare const RadioGroupHarness: ({ formDisabled, initialValue, mode, validationMessage, options, ...props }: RadioGroupHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InfiniteData, UseInfiniteQueryResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { AutocompleteProps } from '../../src/components/inputs/Selection/Autocomplete/Autocomplete';
|
|
3
|
+
import { SelectProps } from '../../src/components/inputs/Selection/Select/Select';
|
|
4
|
+
import { SelectItem } from '../../src/components/inputs/Selection/shared/select.types';
|
|
5
|
+
type HarnessMode = "controlled" | "form";
|
|
6
|
+
type SelectionValue = string | string[] | null;
|
|
7
|
+
export declare const selectionItems: SelectItem<string>[];
|
|
8
|
+
type SelectHarnessProps = Omit<SelectProps<string>, "items" | "onBlur" | "onChange" | "value"> & {
|
|
9
|
+
formDisabled?: boolean;
|
|
10
|
+
initialValue?: SelectionValue;
|
|
11
|
+
items?: SelectItem<string>[];
|
|
12
|
+
mode?: HarnessMode;
|
|
13
|
+
validationMessage?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const SelectHarness: ({ formDisabled, initialValue, items, mode, renderStaticInput, selectionMode, validationMessage, ...props }: SelectHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
type AutocompleteHarnessProps = Omit<AutocompleteProps<string>, "items" | "onBlur" | "onChange" | "value"> & {
|
|
17
|
+
formDisabled?: boolean;
|
|
18
|
+
initialValue?: SelectionValue;
|
|
19
|
+
items?: SelectItem<string>[];
|
|
20
|
+
mode?: HarnessMode;
|
|
21
|
+
validationMessage?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const AutocompleteHarness: ({ formDisabled, initialValue, items, mode, renderStaticInput, selectionMode, validationMessage, ...props }: AutocompleteHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
type QueryFilter = {
|
|
25
|
+
ids?: string[];
|
|
26
|
+
} & Record<string, unknown>;
|
|
27
|
+
type QueryParams = {
|
|
28
|
+
search?: string;
|
|
29
|
+
limit?: number;
|
|
30
|
+
filter?: QueryFilter;
|
|
31
|
+
};
|
|
32
|
+
type QueryOptions = {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
};
|
|
35
|
+
type QuerySelectionPage = {
|
|
36
|
+
items: SelectItem<string>[];
|
|
37
|
+
totalItems?: number;
|
|
38
|
+
};
|
|
39
|
+
type QuerySelectionResult = UseQueryResult<SelectItem<string>[]> | UseInfiniteQueryResult<InfiniteData<QuerySelectionPage>>;
|
|
40
|
+
type QuerySelectionFn = (params?: QueryParams, options?: QueryOptions) => QuerySelectionResult;
|
|
41
|
+
export declare const querySelectionItems: (params?: QueryParams, options?: QueryOptions) => UseQueryResult<SelectItem<string>[]>;
|
|
42
|
+
export declare const querySelectionItemsWithFetchedInitialLabel: (_params?: QueryParams, options?: QueryOptions) => UseQueryResult<SelectItem<string>[]>;
|
|
43
|
+
type QuerySelectionHarnessProps = Omit<SelectHarnessProps, "items" | "onInputChange" | "onSearchChange" | "onNewItemOption"> & {
|
|
44
|
+
component: "query-autocomplete" | "query-select";
|
|
45
|
+
isInitialQueryDisabled?: boolean;
|
|
46
|
+
query?: QuerySelectionFn;
|
|
47
|
+
queryMap?: (items: SelectItem<string>[] | QuerySelectionPage | QuerySelectionPage[]) => SelectItem<string>[];
|
|
48
|
+
showInfiniteFetchCount?: boolean;
|
|
49
|
+
useInfiniteQuery?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export declare const QuerySelectionHarness: ({ component, formDisabled, initialValue, mode, query, queryMap, renderStaticInput, selectionMode, showInfiniteFetchCount, useInfiniteQuery, validationMessage, ...props }: QuerySelectionHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const QuerySelectionDeepInitialValueHarness: ({ component, resolveSelectedItemsWithIds, useConfigResolveSelectedItemsWithIds, wrapResolvedIdsInInfiniteData, }: {
|
|
53
|
+
component: "query-autocomplete" | "query-select";
|
|
54
|
+
resolveSelectedItemsWithIds?: boolean;
|
|
55
|
+
useConfigResolveSelectedItemsWithIds?: boolean;
|
|
56
|
+
wrapResolvedIdsInInfiniteData?: boolean;
|
|
57
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare const QuerySelectionSearchDebounceHarness: ({ component, }: {
|
|
59
|
+
component: "query-autocomplete" | "query-select";
|
|
60
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SliderProps } from '../../src/components/inputs/Slider/Slider';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
type SliderHarnessValue = number | number[];
|
|
4
|
+
interface SliderHarnessProps extends Omit<SliderProps<boolean>, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
5
|
+
formDisabled?: boolean;
|
|
6
|
+
initialValue?: SliderHarnessValue;
|
|
7
|
+
mode?: HarnessMode;
|
|
8
|
+
validationMessage?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SliderHarness: ({ formDisabled, initialValue, mode, validationMessage, ...props }: SliderHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextAreaProps } from '../../src/components/inputs/Input/TextArea/TextArea';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface TextAreaHarnessProps extends Omit<TextAreaProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
mode?: HarnessMode;
|
|
6
|
+
initialValue?: string;
|
|
7
|
+
validationMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TextAreaHarness: ({ formDisabled, mode, initialValue, validationMessage, ...props }: TextAreaHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextInputProps } from '../../src/components/inputs/Input/TextInput/TextInput';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface TextInputHarnessProps extends Omit<TextInputProps, "formControl" | "onBlur" | "onChange" | "value"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
mode?: HarnessMode;
|
|
6
|
+
initialValue?: string;
|
|
7
|
+
validationMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TextInputHarness: ({ formDisabled, mode, initialValue, validationMessage, action, ...props }: TextInputHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToggleProps } from '../../src/components/inputs/Toggle/Toggle';
|
|
2
|
+
type HarnessMode = "controlled" | "form";
|
|
3
|
+
interface ToggleHarnessProps extends Omit<ToggleProps, "formControl" | "isSelected" | "onBlur" | "onChange"> {
|
|
4
|
+
formDisabled?: boolean;
|
|
5
|
+
initialValue?: boolean;
|
|
6
|
+
mode?: HarnessMode;
|
|
7
|
+
validationMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ToggleHarness: ({ formDisabled, initialValue, mode, validationMessage, ...props }: ToggleHarnessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BrowserPage, Locator } from 'vitest/browser';
|
|
2
|
+
interface BlurPage {
|
|
3
|
+
getByTestId: BrowserPage["getByTestId"];
|
|
4
|
+
}
|
|
5
|
+
interface ExpectBlurCountToIncrementOptions {
|
|
6
|
+
action?: () => Promise<void>;
|
|
7
|
+
blurCount?: Locator;
|
|
8
|
+
blurWith?: () => Promise<void>;
|
|
9
|
+
page: BlurPage;
|
|
10
|
+
target?: Locator;
|
|
11
|
+
}
|
|
12
|
+
export declare const expectBlurCountToIncrement: ({ action, blurCount, blurWith, page, target, }: ExpectBlurCountToIncrementOptions) => Promise<void>;
|
|
13
|
+
interface ExpectBlurValueOptions {
|
|
14
|
+
action?: () => Promise<void>;
|
|
15
|
+
blurValue?: Locator;
|
|
16
|
+
blurWith?: () => Promise<void>;
|
|
17
|
+
expectedValue: string;
|
|
18
|
+
page: BlurPage;
|
|
19
|
+
target?: Locator;
|
|
20
|
+
}
|
|
21
|
+
export declare const expectBlurValueAfterFocusLeaves: ({ action, blurValue, blurWith, expectedValue, page, target, }: ExpectBlurValueOptions) => Promise<void>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Locator } from 'vitest/browser';
|
|
2
|
+
export declare const dispatchPointerEvent: (target: Locator, type: string, init?: PointerEventInit) => Promise<void>;
|
|
3
|
+
export declare const getLocatorRect: (target: Locator) => DOMRect;
|
|
4
|
+
export declare const focusLocator: (target: Locator) => Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Locator, BrowserPage } from 'vitest/browser';
|
|
2
|
+
type InputScope = Pick<BrowserPage | Locator, "getByRole" | "getByTestId">;
|
|
3
|
+
export declare const expectInputValueState: (input: Locator, expected: {
|
|
4
|
+
isEmpty: boolean;
|
|
5
|
+
value: string;
|
|
6
|
+
}) => Promise<void>;
|
|
7
|
+
export declare const clearInput: (scope: InputScope) => Promise<void>;
|
|
8
|
+
export declare const expectHarnessValue: (scope: InputScope, value: string) => Promise<void>;
|
|
9
|
+
export declare const expectClearControlNotRendered: (scope: InputScope) => Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -92,7 +92,7 @@ export declare const buttonIconSizeDefinition: {
|
|
|
92
92
|
export type ButtonIconSizeConfig = NonNullable<typeof buttonIconSizeDefinition.config>;
|
|
93
93
|
export declare const buttonTypography: (props: {
|
|
94
94
|
readonly width?: "fill" | "hug" | null | undefined;
|
|
95
|
-
readonly size?: "none" | "
|
|
95
|
+
readonly size?: "none" | "s" | "xs" | "m" | "l" | null | undefined;
|
|
96
96
|
readonly color?: "error" | "primary" | "dual" | "secondary" | "success" | "warning" | null | undefined;
|
|
97
97
|
readonly variant?: "text" | "contained" | "outlined" | "subtle" | "ghost" | null | undefined;
|
|
98
98
|
readonly inverted?: boolean | null | undefined;
|
|
@@ -88,7 +88,7 @@ var buttonDefinition = UIOverrides.defineConfig({
|
|
|
88
88
|
"pressed:border-interactive-subtle-primary-pressed pressed:bg-interactive-subtle-primary-pressed pressed:text-interactive-subtle-primary-on-pressed",
|
|
89
89
|
"disabled:border-interactive-subtle-primary-disabled disabled:bg-interactive-subtle-primary-disabled disabled:text-interactive-subtle-primary-on-disabled",
|
|
90
90
|
"focus-visible:outline-interactive-subtle-primary-focus",
|
|
91
|
-
"selected:border-interactive-
|
|
91
|
+
"selected:border-interactive-subtle-primary-toggled-idle selected:bg-interactive-subtle-primary-toggled-idle selected:text-interactive-subtle-primary-on-toggled-idle",
|
|
92
92
|
"selected:hover:border-interactive-subtle-primary-toggled-hover selected:hover:bg-interactive-subtle-primary-toggled-hover selected:hover:text-interactive-subtle-primary-on-toggled-hover",
|
|
93
93
|
"selected:disabled:border-interactive-subtle-primary-toggled-disabled selected:disabled:bg-interactive-subtle-primary-toggled-disabled selected:disabled:text-interactive-subtle-primary-on-toggled-disabled",
|
|
94
94
|
"group-data-[split]/split:data-[separator]:after:bg-interactive-subtle-primary-on-idle!"
|
|
@@ -133,9 +133,9 @@ var buttonDefinition = UIOverrides.defineConfig({
|
|
|
133
133
|
"pressed:border-interactive-outlined-secondary-outline-pressed pressed:bg-interactive-outlined-secondary-pressed pressed:text-interactive-outlined-secondary-on-pressed",
|
|
134
134
|
"disabled:border-interactive-outlined-secondary-outline-disabled disabled:bg-interactive-outlined-secondary-disabled disabled:text-interactive-outlined-secondary-on-disabled",
|
|
135
135
|
"focus-visible:outline-interactive-outlined-secondary-focus",
|
|
136
|
-
"selected:border-interactive-
|
|
137
|
-
"selected:hover:border-interactive-
|
|
138
|
-
"selected:disabled:border-interactive-
|
|
136
|
+
"selected:border-interactive-outlined-secondary-toggled-idle selected:bg-interactive-outlined-secondary-toggled-idle selected:text-interactive-outlined-secondary-on-toggled-idle",
|
|
137
|
+
"selected:hover:border-interactive-outlined-secondary-toggled-hover selected:hover:bg-interactive-outlined-secondary-toggled-hover selected:hover:text-interactive-outlined-secondary-on-toggled-hover",
|
|
138
|
+
"selected:disabled:border-interactive-outlined-secondary-toggled-disabled selected:disabled:bg-interactive-outlined-secondary-toggled-disabled selected:disabled:text-interactive-outlined-secondary-on-toggled-disabled"
|
|
139
139
|
]
|
|
140
140
|
},
|
|
141
141
|
{
|
|
@@ -63,7 +63,7 @@ var pillButtonDefinition = UIOverrides.defineConfig({
|
|
|
63
63
|
"pressed:border-interactive-subtle-primary-pressed pressed:bg-interactive-subtle-primary-pressed pressed:text-interactive-subtle-primary-on-pressed",
|
|
64
64
|
"disabled:border-interactive-subtle-primary-disabled disabled:bg-interactive-subtle-primary-disabled disabled:text-interactive-subtle-primary-on-disabled",
|
|
65
65
|
"focus-visible:outline-interactive-subtle-primary-focus",
|
|
66
|
-
"selected:border-interactive-
|
|
66
|
+
"selected:border-interactive-subtle-primary-toggled-idle selected:bg-interactive-subtle-primary-toggled-idle selected:text-interactive-subtle-primary-on-toggled-idle",
|
|
67
67
|
"selected:hover:border-interactive-subtle-primary-toggled-hover selected:hover:bg-interactive-subtle-primary-toggled-hover selected:hover:text-interactive-subtle-primary-on-toggled-hover",
|
|
68
68
|
"selected:disabled:border-interactive-subtle-primary-toggled-disabled selected:disabled:bg-interactive-subtle-primary-toggled-disabled selected:disabled:text-interactive-subtle-primary-on-toggled-disabled"
|
|
69
69
|
]
|
|
@@ -91,9 +91,9 @@ var pillButtonDefinition = UIOverrides.defineConfig({
|
|
|
91
91
|
"pressed:border-interactive-outlined-secondary-outline-pressed pressed:bg-interactive-outlined-secondary-pressed pressed:text-interactive-outlined-secondary-on-pressed",
|
|
92
92
|
"disabled:border-interactive-outlined-secondary-outline-disabled disabled:bg-interactive-outlined-secondary-disabled disabled:text-interactive-outlined-secondary-on-disabled",
|
|
93
93
|
"focus-visible:outline-interactive-outlined-secondary-focus",
|
|
94
|
-
"selected:border-interactive-
|
|
95
|
-
"selected:hover:border-interactive-
|
|
96
|
-
"selected:disabled:border-interactive-
|
|
94
|
+
"selected:border-interactive-outlined-secondary-toggled-idle selected:bg-interactive-outlined-secondary-toggled-idle selected:text-interactive-outlined-secondary-on-toggled-idle",
|
|
95
|
+
"selected:hover:border-interactive-outlined-secondary-toggled-hover selected:hover:bg-interactive-outlined-secondary-toggled-hover selected:hover:text-interactive-outlined-secondary-on-toggled-hover",
|
|
96
|
+
"selected:disabled:border-interactive-outlined-secondary-toggled-disabled selected:disabled:bg-interactive-outlined-secondary-toggled-disabled selected:disabled:text-interactive-outlined-secondary-on-toggled-disabled"
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
99
|
{
|
|
@@ -164,6 +164,18 @@ var DatePickerBase = (props) => {
|
|
|
164
164
|
dialogState.setValue(null);
|
|
165
165
|
if (fireBlurOnChange) handleBlur(null);
|
|
166
166
|
};
|
|
167
|
+
const syncDialogFromControlledValue = () => {
|
|
168
|
+
dialogState.setValue(state.value);
|
|
169
|
+
if (state.value) {
|
|
170
|
+
calendarState.setFocusedDate(normalizeByGranularity(state.value));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
calendarState.setFocusedDate(today(effectiveTimeZone));
|
|
174
|
+
};
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
if (!state.isOpen) return;
|
|
177
|
+
syncDialogFromControlledValue();
|
|
178
|
+
}, [state.isOpen]);
|
|
167
179
|
useEffect(() => {
|
|
168
180
|
if (!state.isOpen) return;
|
|
169
181
|
if (granularity !== "year") return;
|
|
@@ -180,11 +192,13 @@ var DatePickerBase = (props) => {
|
|
|
180
192
|
normalizeByGranularity,
|
|
181
193
|
effectiveTimeZone
|
|
182
194
|
]);
|
|
183
|
-
const onOpenChange = (
|
|
195
|
+
const onOpenChange = (_isOpen) => {
|
|
196
|
+
state.toggle();
|
|
197
|
+
syncDialogFromControlledValue();
|
|
198
|
+
};
|
|
199
|
+
const onOpenDropdown = () => {
|
|
200
|
+
syncDialogFromControlledValue();
|
|
184
201
|
state.toggle();
|
|
185
|
-
if (state.value) calendarState.setFocusedDate(normalizeByGranularity(state.value));
|
|
186
|
-
if (!state.value) calendarState.setFocusedDate(today(effectiveTimeZone));
|
|
187
|
-
if (!isOpen) dialogState.setValue(state.value);
|
|
188
202
|
};
|
|
189
203
|
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
190
204
|
as,
|
|
@@ -225,7 +239,7 @@ var DatePickerBase = (props) => {
|
|
|
225
239
|
todayIconButtonSize,
|
|
226
240
|
todayIconButtonComponent,
|
|
227
241
|
todayIconPlacement,
|
|
228
|
-
onOpenDropdown
|
|
242
|
+
onOpenDropdown,
|
|
229
243
|
placeholder,
|
|
230
244
|
className: inputClassName,
|
|
231
245
|
dateGranularity: granularity,
|
|
@@ -18,7 +18,7 @@ import { RangeCalendar } from "../shared/RangeCalendar.js";
|
|
|
18
18
|
import { c } from "react/compiler-runtime";
|
|
19
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
import { clsx } from "clsx";
|
|
21
|
-
import { useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
21
|
+
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
22
22
|
import { Button } from "react-aria-components";
|
|
23
23
|
import { useDateRangePicker, useLocale as useLocale$1 } from "react-aria";
|
|
24
24
|
import { mergeRefs } from "@react-aria/utils";
|
|
@@ -460,25 +460,33 @@ var DateRangePickerBase = (props) => {
|
|
|
460
460
|
setHoverDate(null);
|
|
461
461
|
if (fireBlurOnChange) handleBlur(null);
|
|
462
462
|
};
|
|
463
|
-
const
|
|
464
|
-
state.
|
|
465
|
-
if (!
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
leftCalendarState.setValue(state.value);
|
|
469
|
-
rightCalendarState.setValue(state.value);
|
|
470
|
-
const startDate_3 = state.value.start || today(effectiveTimeZone);
|
|
471
|
-
const endDate_3 = state.value.end || today(effectiveTimeZone).add({ months: 1 });
|
|
472
|
-
leftCalendarState.setFocusedDate(startDate_3);
|
|
473
|
-
if (startDate_3.year === endDate_3.year && startDate_3.month === endDate_3.month) rightCalendarState.setFocusedDate(startDate_3.add({ months: 1 }));
|
|
474
|
-
else rightCalendarState.setFocusedDate(endDate_3);
|
|
475
|
-
setRangeSelection({
|
|
476
|
-
start: state.value.start,
|
|
477
|
-
end: state.value.end,
|
|
478
|
-
isSelecting: false
|
|
479
|
-
});
|
|
480
|
-
}
|
|
463
|
+
const syncSelectionFromControlledValue = () => {
|
|
464
|
+
const currentValue = state.value;
|
|
465
|
+
if (!(currentValue != null && currentValue.start != null && currentValue.end != null)) {
|
|
466
|
+
syncCalendarStates(null);
|
|
467
|
+
return;
|
|
481
468
|
}
|
|
469
|
+
syncCalendarStates(currentValue);
|
|
470
|
+
const startDate_3 = currentValue.start;
|
|
471
|
+
const endDate_3 = currentValue.end;
|
|
472
|
+
leftCalendarState.setFocusedDate(startDate_3);
|
|
473
|
+
if (startDate_3.year === endDate_3.year && startDate_3.month === endDate_3.month) {
|
|
474
|
+
rightCalendarState.setFocusedDate(startDate_3.add({ months: 1 }));
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
rightCalendarState.setFocusedDate(endDate_3);
|
|
478
|
+
};
|
|
479
|
+
useEffect(() => {
|
|
480
|
+
if (!state.isOpen) return;
|
|
481
|
+
syncSelectionFromControlledValue();
|
|
482
|
+
}, [state.isOpen]);
|
|
483
|
+
const onOpenChange = (_isOpen) => {
|
|
484
|
+
state.toggle();
|
|
485
|
+
syncSelectionFromControlledValue();
|
|
486
|
+
};
|
|
487
|
+
const onOpenDropdown = () => {
|
|
488
|
+
syncSelectionFromControlledValue();
|
|
489
|
+
state.toggle();
|
|
482
490
|
};
|
|
483
491
|
const todayDate_0 = today(effectiveTimeZone);
|
|
484
492
|
const getThisWeekRange = () => {
|
|
@@ -659,7 +667,7 @@ var DateRangePickerBase = (props) => {
|
|
|
659
667
|
autoFixYear,
|
|
660
668
|
placeholder,
|
|
661
669
|
className: inputClassName,
|
|
662
|
-
onOpenDropdown
|
|
670
|
+
onOpenDropdown,
|
|
663
671
|
timeZone: effectiveTimeZone,
|
|
664
672
|
fireBlurOnChange,
|
|
665
673
|
onClear: onInputClear
|