sit-onyx 1.0.0-beta.21 → 1.0.0-beta.22

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.
@@ -0,0 +1,11 @@
1
+ import type { MountResultJsx } from "@playwright/experimental-ct-vue";
2
+ import { type Locator, type Page } from "@playwright/test";
3
+ type PageOrLocator = Page | Locator | MountResultJsx;
4
+ type FormElementTooltip = "label" | "error" | "message";
5
+ export declare const createFormElementUtils: (page: PageOrLocator) => {
6
+ getRoot: (prev?: PageOrLocator) => Locator;
7
+ getTooltipTrigger: (type: FormElementTooltip, prev?: PageOrLocator) => Locator;
8
+ getTooltipPopover: (type: FormElementTooltip, prev?: PageOrLocator) => Locator;
9
+ triggerTooltipVisible: (type: FormElementTooltip, prev?: PageOrLocator) => Promise<void>;
10
+ };
11
+ export {};
@@ -1,6 +1,23 @@
1
1
  import type { OnyxInfoTooltipProps } from "./types";
2
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<OnyxInfoTooltipProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<OnyxInfoTooltipProps>>>, {}, {}>;
2
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<OnyxInfoTooltipProps>, {
3
+ open: string;
4
+ color: string;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<OnyxInfoTooltipProps>, {
6
+ open: string;
7
+ color: string;
8
+ }>>>, {
9
+ color: Extract<import("../../index.js").OnyxColor, "neutral" | "danger">;
10
+ open: import("../OnyxTooltip/types.js").TooltipOpen;
11
+ }, {}>;
3
12
  export default _default;
13
+ type __VLS_WithDefaults<P, D> = {
14
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
15
+ default: D[K];
16
+ }> : P[K];
17
+ };
18
+ type __VLS_Prettify<T> = {
19
+ [K in keyof T]: T[K];
20
+ } & {};
4
21
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
5
22
  type __VLS_TypePropsToOption<T> = {
6
23
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -1,6 +1,2 @@
1
1
  import type { OnyxTooltipProps } from "../OnyxTooltip/types";
2
- export type OnyxInfoTooltipProps = Required<Pick<OnyxTooltipProps, "text">> & Pick<OnyxTooltipProps, "position"> & {
3
- /**
4
- * Sets the aria-label of the info icon for accessibility / screen readers
5
- */ label?: string;
6
- };
2
+ export type OnyxInfoTooltipProps = Required<Pick<OnyxTooltipProps, "text">> & Pick<OnyxTooltipProps, "position" | "open" | "color">;
@@ -0,0 +1,7 @@
1
+ import type { Locator, Page } from "@playwright/test";
2
+ type PageLocater = Page | Locator;
3
+ export declare const tooltipUtils: (page: Page) => {
4
+ getTrigger: (type: "label" | "error" | "message", prev?: PageLocater) => Locator;
5
+ getTooltipPopover: (type: "label" | "error" | "message", prev?: PageLocater) => Locator;
6
+ };
7
+ export {};
@@ -1,30 +1,33 @@
1
+ import type { HTMLAttributes, VNode } from "vue";
1
2
  import type { OnyxTooltipProps } from "./types";
2
3
  declare function __VLS_template(): Readonly<{
3
4
  /**
4
- * Default slot where the parent content is placed that should open/close the tooltip.
5
+ * Default slot where the parent content is placed that controls the open/close state of the tooltip.
5
6
  *
6
- * **Accessibility**: Please ensure that your content includes at least one focusable element
7
- * (e.g. by using a button or input element).
7
+ * **Accessibility**: You must ensure that the trigger attributes are bound to a button when the `open` prop is not `hover`!
8
8
  */
9
- default(): unknown;
9
+ default(params: {
10
+ trigger: HTMLAttributes;
11
+ }): VNode;
10
12
  /**
11
13
  * Optional slot to place custom content for the tooltip text.
12
14
  *
13
- * **Accessibility**: Make sure that the tooltip content is NOT focusable/interactive.
15
+ * **Accessibility**: You must ensure that the tooltip content is NOT focusable/interactive.
14
16
  */
15
17
  tooltip?(): unknown;
16
18
  }> & {
17
19
  /**
18
- * Default slot where the parent content is placed that should open/close the tooltip.
20
+ * Default slot where the parent content is placed that controls the open/close state of the tooltip.
19
21
  *
20
- * **Accessibility**: Please ensure that your content includes at least one focusable element
21
- * (e.g. by using a button or input element).
22
+ * **Accessibility**: You must ensure that the trigger attributes are bound to a button when the `open` prop is not `hover`!
22
23
  */
23
- default(): unknown;
24
+ default(params: {
25
+ trigger: HTMLAttributes;
26
+ }): VNode;
24
27
  /**
25
28
  * Optional slot to place custom content for the tooltip text.
26
29
  *
27
- * **Accessibility**: Make sure that the tooltip content is NOT focusable/interactive.
30
+ * **Accessibility**: You must ensure that the tooltip content is NOT focusable/interactive.
28
31
  */
29
32
  tooltip?(): unknown;
30
33
  };
@@ -0,0 +1,12 @@
1
+ import type { OnyxTooltipProps } from "./types";
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<OnyxTooltipProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<OnyxTooltipProps>>>, {}, {}>;
3
+ export default _default;
4
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
5
+ type __VLS_TypePropsToOption<T> = {
6
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
7
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
8
+ } : {
9
+ type: import('vue').PropType<T[K]>;
10
+ required: true;
11
+ };
12
+ };
@@ -1,5 +1,15 @@
1
+ import type { MaybeRefOrGetter } from "vue";
1
2
  import type { DensityProp } from "../../composables/density";
2
3
  import type { OnyxColor } from "../../types";
4
+ export type TooltipOptions = {
5
+ /**
6
+ * Number of milliseconds to use as debounce when showing/hiding the tooltip.
7
+ */
8
+ debounce: MaybeRefOrGetter<number>;
9
+ };
10
+ export type ToggletipOptions = {
11
+ toggleLabel: MaybeRefOrGetter<string>;
12
+ };
3
13
  export type OnyxTooltipProps = DensityProp & {
4
14
  /**
5
15
  * Text to display inside the tooltip.
@@ -21,15 +31,19 @@ export type OnyxTooltipProps = DensityProp & {
21
31
  fitParent?: boolean;
22
32
  /**
23
33
  * How to open/trigger the tooltip. You can set a boolean to force show/hide the tooltip.
34
+ * When open is not the default value `hover`, the component will act as an "toggletip":
35
+ * - tooltip: Describes the associated element
36
+ * - toggletip: Gives additional information about in the current context
37
+ *
38
+ * The "toggletip" is implemented using an aria-live region.
39
+ * See also: https://inclusive-components.design/tooltips-toggletips/
24
40
  */
25
41
  open?: TooltipOpen;
26
42
  };
27
43
  export declare const TOOLTIP_POSITIONS: readonly ["top", "bottom"];
28
44
  export type TooltipPosition = (typeof TOOLTIP_POSITIONS)[number];
29
- export type TooltipOpen = "hover" | "click" | boolean | {
45
+ export type TooltipOpen = "hover" | "click" | boolean | ({
30
46
  type: "hover";
31
- /**
32
- * Number of milliseconds to use as debounce when showing/hiding the tooltip
33
- */
34
- debounce: number;
35
- };
47
+ } & Partial<TooltipOptions>) | ({
48
+ type: "click";
49
+ } & Partial<ToggletipOptions>);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
+ export default _default;