sit-onyx 1.0.0-beta.70 → 1.0.0-beta.71

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.
@@ -4,8 +4,8 @@ import type { CustomValidityProp } from "../../composables/useCustomValidity";
4
4
  import type { SkeletonInjected } from "../../composables/useSkeletonState";
5
5
  import type { AutofocusProp, BaseSelectOption, Direction, SelectOptionValue } from "../../types";
6
6
  import type { FormInjected } from "../OnyxForm/OnyxForm.core";
7
- import type { OnyxFormElementProps } from "../OnyxFormElement/types";
8
- export type OnyxCheckboxGroupProps<TValue extends SelectOptionValue = SelectOptionValue> = DensityProp & Pick<BaseSelectOption, "truncation"> & Pick<OnyxFormElementProps, "label" | "hideLabel"> & {
7
+ import type { SharedFormElementProps } from "../OnyxFormElement/types";
8
+ export type OnyxCheckboxGroupProps<TValue extends SelectOptionValue = SelectOptionValue> = DensityProp & Pick<BaseSelectOption, "truncation"> & Pick<SharedFormElementProps, "label" | "hideLabel"> & {
9
9
  /**
10
10
  * Checkbox options.
11
11
  */
@@ -0,0 +1,13 @@
1
+ import type { FormMessages } from "../../composables/useCustomValidity";
2
+ type __VLS_Props = {
3
+ /**
4
+ * Message to display.
5
+ */
6
+ messages: FormMessages;
7
+ /**
8
+ * How the message should be colored and displayed.
9
+ */
10
+ type: "danger" | "success" | "neutral";
11
+ };
12
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import type { MountResultJsx } from "@playwright/experimental-ct-vue";
2
2
  import { type Locator, type Page } from "@playwright/test";
3
3
  type PageOrLocator = Page | Locator | MountResultJsx;
4
- type FormElementTooltip = "label" | "error" | "message";
4
+ type FormElementTooltip = "label" | "message";
5
5
  export declare const createFormElementUtils: (page: PageOrLocator) => {
6
6
  getRoot: (prev?: PageOrLocator) => Locator;
7
7
  getTooltipTrigger: (type: FormElementTooltip, prev?: PageOrLocator) => Locator;
@@ -1,12 +1,22 @@
1
1
  import type { RequiredMarkerProp } from "../../composables/required";
2
- import type { FormMessages } from "../../composables/useCustomValidity";
3
- export type OnyxFormElementProps = RequiredMarkerProp & {
2
+ import type { CustomMessageType, FormMessages } from "../../composables/useCustomValidity";
3
+ export type OnyxFormElementProps = Omit<SharedFormElementProps, "error" | "message" | "success"> & {
4
+ errorMessages?: FormMessages;
5
+ message?: FormMessages;
6
+ successMessages?: FormMessages;
7
+ };
8
+ export type SharedFormElementProps = RequiredMarkerProp & {
4
9
  /**
5
10
  * The id of a labelable form-related element.
6
11
  * If not given an id will be generated.
7
12
  * The id is passed as a `default` slot property.
8
13
  */
9
14
  id?: string;
15
+ /**
16
+ * Same as the native `name` attribute of `<input>`.
17
+ * Used to reference the input in JavaScript or in submitted form data.
18
+ */
19
+ name?: string;
10
20
  /**
11
21
  * Current value of the form element.
12
22
  */
@@ -14,6 +24,7 @@ export type OnyxFormElementProps = RequiredMarkerProp & {
14
24
  /**
15
25
  * Label to show above the form element. Required due to accessibility / screen readers.
16
26
  * If you want to visually hide the label, use the `hideLabel` property.
27
+ * TODO: make CustomMessageType
17
28
  */
18
29
  label: string;
19
30
  /**
@@ -28,18 +39,18 @@ export type OnyxFormElementProps = RequiredMarkerProp & {
28
39
  */
29
40
  hideLabel?: boolean;
30
41
  /**
31
- * Message / help text to display below the form element.
32
- * Will be replaced by an error message if the form element is invalid.
42
+ * Error messages that gives details about the cause of a form elements invalidity.
33
43
  */
34
- message?: string;
44
+ error?: CustomMessageType;
35
45
  /**
36
- * Info message / additional text to display inside a tooltip next to the message.
46
+ * Message / help text to display below the form element.
47
+ * Will be replaced by an error message if the form element is invalid.
37
48
  */
38
- messageTooltip?: string;
49
+ message?: CustomMessageType;
39
50
  /**
40
- * Error messages that inform about causes for invalidity of form components
51
+ * Success messages that inform about the state of form components
41
52
  */
42
- errorMessages?: FormMessages;
53
+ success?: CustomMessageType;
43
54
  /**
44
55
  * Maximum number of characters that are allowed to be entered.
45
56
  * Warning: when the value is (pre)set programmatically,
@@ -1,6 +1,6 @@
1
1
  import type { OnyxInfoTooltipProps } from "./types";
2
2
  declare const _default: import("vue").DefineComponent<OnyxInfoTooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxInfoTooltipProps> & Readonly<{}>, {
3
- color: Extract<import("../../index.ts").OnyxColor, "neutral" | "danger">;
3
+ color: Extract<import("../../index.ts").OnyxColor, "neutral" | "danger" | "success">;
4
4
  open: import("../OnyxTooltip/types.ts").TooltipOpen;
5
5
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLSpanElement>;
6
6
  export default _default;
@@ -4,8 +4,8 @@ import type { CustomValidityProp } from "../../composables/useCustomValidity";
4
4
  import type { SkeletonInjected } from "../../composables/useSkeletonState";
5
5
  import type { AutofocusProp } from "../../types";
6
6
  import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
7
- import type { OnyxFormElementProps } from "../OnyxFormElement/types";
8
- export type OnyxInputProps = FormInjectedProps & DensityProp & RequiredMarkerProp & CustomValidityProp & Omit<OnyxFormElementProps, "modelValue" | "errorMessages"> & AutofocusProp & {
7
+ import type { SharedFormElementProps } from "../OnyxFormElement/types";
8
+ export type OnyxInputProps = FormInjectedProps & DensityProp & RequiredMarkerProp & CustomValidityProp & Omit<SharedFormElementProps, "modelValue" | "errorMessages"> & AutofocusProp & {
9
9
  /**
10
10
  * Current value of the input.
11
11
  */
@@ -35,11 +35,6 @@ export type OnyxInputProps = FormInjectedProps & DensityProp & RequiredMarkerPro
35
35
  * @see [MDN autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
36
36
  */
37
37
  autocomplete?: Autocomplete;
38
- /**
39
- * Same as the native `name` attribute of `<input>`.
40
- * Used to reference the input in JavaScript or in submitted form data.
41
- */
42
- name?: string;
43
38
  /**
44
39
  * Pattern the value must match to be valid.
45
40
  */
@@ -4,18 +4,12 @@ import type { CustomValidityProp } from "../../composables/useCustomValidity";
4
4
  import type { SkeletonInjected } from "../../composables/useSkeletonState";
5
5
  import type { AutofocusProp, BaseSelectOption, Direction, SelectOptionValue } from "../../types";
6
6
  import type { FormInjected } from "../OnyxForm/OnyxForm.core";
7
- import type { OnyxFormElementProps } from "../OnyxFormElement/types";
8
- export type OnyxRadioGroupProps<TValue extends SelectOptionValue = SelectOptionValue> = DensityProp & RequiredMarkerProp & CustomValidityProp & Pick<BaseSelectOption, "truncation"> & Pick<OnyxFormElementProps, "label" | "hideLabel"> & {
7
+ import type { SharedFormElementProps } from "../OnyxFormElement/types";
8
+ export type OnyxRadioGroupProps<TValue extends SelectOptionValue = SelectOptionValue> = DensityProp & RequiredMarkerProp & CustomValidityProp & Pick<BaseSelectOption, "truncation"> & Pick<SharedFormElementProps, "label" | "hideLabel" | "name"> & {
9
9
  /**
10
10
  * Options for the individual radio buttons of the group.
11
11
  */
12
12
  options: RadioButtonOption<TValue>[];
13
- /**
14
- * Unique name for the radio group form element.
15
- * Will automatically filled, when it is not given.
16
- * Warning: Never use a name for form elements twice!
17
- */
18
- name?: string;
19
13
  /**
20
14
  * The selected radio button option.
21
15
  */
@@ -4,10 +4,10 @@ import type { CustomValidityProp } from "../../composables/useCustomValidity";
4
4
  import type { SkeletonInjected } from "../../composables/useSkeletonState";
5
5
  import type { AutofocusProp } from "../../types";
6
6
  import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
7
- import type { OnyxFormElementProps } from "../OnyxFormElement/types";
7
+ import type { SharedFormElementProps } from "../OnyxFormElement/types";
8
8
  export declare const MULTISELECT_TEXT_MODE: readonly ["summary", "preview"];
9
9
  export type MultiselectTextMode = (typeof MULTISELECT_TEXT_MODE)[number];
10
- export type OnyxSelectInputProps = FormInjectedProps & DensityProp & RequiredMarkerProp & CustomValidityProp & AutofocusProp & Omit<OnyxFormElementProps, "modelValue" | "maxlength" | "withCounter"> & {
10
+ export type OnyxSelectInputProps = FormInjectedProps & DensityProp & RequiredMarkerProp & CustomValidityProp & AutofocusProp & Omit<SharedFormElementProps, "modelValue" | "maxlength" | "withCounter"> & {
11
11
  /**
12
12
  * Current label(s) of the select.
13
13
  */
@@ -3,14 +3,9 @@ import type { CustomValidityProp } from "../../composables/useCustomValidity";
3
3
  import type { SkeletonInjected } from "../../composables/useSkeletonState";
4
4
  import type { AutofocusProp } from "../../types";
5
5
  import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
6
- import type { OnyxFormElementProps } from "../OnyxFormElement/types";
6
+ import type { SharedFormElementProps } from "../OnyxFormElement/types";
7
7
  import type { Autocomplete } from "../OnyxInput/types";
8
- export type OnyxStepperProps = FormInjectedProps & DensityProp & CustomValidityProp & Omit<OnyxFormElementProps, "modelValue" | "errorMessages" | "withCounter" | "maxlength"> & AutofocusProp & {
9
- /**
10
- * Same as the native `name` attribute of `<input>`.
11
- * Used to reference the input in JavaScript or in submitted form data.
12
- */
13
- name?: string;
8
+ export type OnyxStepperProps = FormInjectedProps & DensityProp & CustomValidityProp & Omit<SharedFormElementProps, "modelValue" | "errorMessages" | "withCounter" | "maxlength"> & AutofocusProp & {
14
9
  /**
15
10
  * Placeholder to show when the value is empty.
16
11
  */
@@ -2,7 +2,7 @@ import type { DensityProp } from "../../composables/density";
2
2
  import type { RequiredMarkerProp } from "../../composables/required";
3
3
  import type { CustomValidityProp } from "../../composables/useCustomValidity";
4
4
  import type { OnyxInputProps } from "../OnyxInput/types";
5
- export type OnyxTextareaProps = DensityProp & RequiredMarkerProp & CustomValidityProp & Pick<OnyxInputProps, "label" | "labelTooltip" | "hideLabel" | "modelValue" | "placeholder" | "autocapitalize" | "autofocus" | "name" | "readonly" | "disabled" | "minlength" | "maxlength" | "withCounter" | "message" | "messageTooltip" | "skeleton"> & {
5
+ export type OnyxTextareaProps = DensityProp & RequiredMarkerProp & CustomValidityProp & Pick<OnyxInputProps, "label" | "labelTooltip" | "hideLabel" | "modelValue" | "placeholder" | "autocapitalize" | "autofocus" | "name" | "readonly" | "disabled" | "minlength" | "maxlength" | "withCounter" | "message" | "success" | "skeleton"> & {
6
6
  /**
7
7
  * Override the default autosize behavior (height adjusts based on the current value).
8
8
  * By default, the textarea will autosize while maintaining at least 3 and at most 10 rows.
@@ -41,7 +41,7 @@ declare function __VLS_template(): {
41
41
  };
42
42
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
43
43
  declare const __VLS_component: import("vue").DefineComponent<OnyxTooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxTooltipProps> & Readonly<{}>, {
44
- color: Extract<import("../../index.ts").OnyxColor, "neutral" | "danger">;
44
+ color: Extract<import("../../index.ts").OnyxColor, "neutral" | "danger" | "success">;
45
45
  position: import("./types").TooltipPosition;
46
46
  alignment: import("../../composables/useWedgePosition").WedgePosition | "auto";
47
47
  fitParent: boolean;
@@ -21,7 +21,7 @@ export type OnyxTooltipProps = DensityProp & {
21
21
  * Optional icon to show on the left of the text.
22
22
  */
23
23
  icon?: string;
24
- color?: Extract<OnyxColor, "neutral" | "danger">;
24
+ color?: Extract<OnyxColor, "neutral" | "danger" | "success">;
25
25
  /**
26
26
  * How to position the tooltip relative to the parent element.
27
27
  */
@@ -7,10 +7,6 @@ export type CustomValidityProp = {
7
7
  * Custom error message to show. Will only show up after the user has interacted with the input.
8
8
  */
9
9
  customError?: CustomMessageType;
10
- /**
11
- * Success message to show. Will only show up after the user has interacted with the input.
12
- */
13
- successMessage?: CustomMessageType;
14
10
  };
15
11
  export type UseCustomValidityOptions = {
16
12
  /**
@@ -37,17 +33,23 @@ export type InputValidationElement = Pick<HTMLInputElement, "validity" | "setCus
37
33
  export declare const TRANSLATED_INPUT_TYPES: (keyof typeof enUS.validations.typeMismatch)[];
38
34
  export type TranslatedInputType = (typeof TRANSLATED_INPUT_TYPES)[number];
39
35
  /**
40
- * Translated messages that inform about the validity state of form components
36
+ * Translated messages that inform about the state of a form element.
41
37
  */
42
38
  export type FormMessages = {
43
39
  /**
44
- * A short message preview to inform the user about the validity state
40
+ * A short message preview to inform the user about the input state.
41
+ * It's usually shown directly underneath the input field.
45
42
  */
46
43
  shortMessage: string;
47
44
  /**
48
- * An extended informative message to provide more info
45
+ * An extended informative message to provide more details.
46
+ * It's usually shown in a tooltip next to the shortMessage.
49
47
  */
50
48
  longMessage?: string;
49
+ /**
50
+ * Will visually hide the message.
51
+ */
52
+ hidden?: boolean;
51
53
  };
52
54
  /**
53
55
  * Transforms a customMessage into the format needed to display an error preview and extended message
@@ -88,8 +90,4 @@ export declare const useCustomValidity: (options: UseCustomValidityOptions) => {
88
90
  * A custom error or the default translation of the first invalid state if one exists.
89
91
  */
90
92
  errorMessages: import("vue").ComputedRef<FormMessages | undefined>;
91
- /**
92
- * A custom success message if provided by the user.
93
- */
94
- successMessages: import("vue").ComputedRef<FormMessages | undefined>;
95
93
  };