@design-system-rte/core 1.2.2-rc1 → 1.2.2-rc3
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/components/button/icon-button/icon-button.interface.d.ts +3 -5
- package/components/button/index.d.ts +1 -1
- package/components/button/index.d.ts.map +1 -1
- package/components/button/index.js +0 -1
- package/components/common/common-types.d.ts +2 -0
- package/components/common/common-types.d.ts.map +1 -1
- package/components/modal/modal.interface.d.ts +1 -1
- package/components/stepper/stepper.interface.d.ts +27 -0
- package/components/stepper/stepper.utils.d.ts +9 -0
- package/components/stepper/stepper.utils.d.ts.map +1 -0
- package/components/stepper/stepper.utils.js +71 -0
- package/components/text-input/text-input.interface.d.ts +1 -1
- package/components/tooltip/tooltip.interface.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { BadgeHolderProps } from "../../badge/badge.interface";
|
|
2
|
+
|
|
3
|
+
export interface IconButtonProps extends BadgeHolderProps {
|
|
2
4
|
variant?: import("../common/common-button").ButtonVariant;
|
|
3
5
|
size?: import("../common/common-button").ButtonSize;
|
|
4
6
|
compactSpacing?: boolean;
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
name: string;
|
|
7
9
|
appearance?: "outlined" | "filled";
|
|
8
|
-
badgeContent?: import("../../badge/badge.interface").BadgeContent;
|
|
9
|
-
badgeCount?: import("../../badge/badge.interface").BadgeCount;
|
|
10
|
-
badgeType?: import("../../badge/badge.interface").BadgeType;
|
|
11
|
-
badgeIcon?: import("../../badge/badge.interface").BadgeProps["icon"];
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
export interface IconButtonToggleProps extends Omit<IconButtonProps, "appearance"> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type * from "./button.interface";
|
|
2
|
-
export * from "./common/common-button";
|
|
2
|
+
export type * from "./common/common-button";
|
|
3
3
|
export * from "./common/common-button.constants";
|
|
4
4
|
export type * from "./icon-button/icon-button.interface";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/button/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,oBAAoB,CAAC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/button/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,wBAAwB,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,mBAAmB,qCAAqC,CAAC"}
|
|
@@ -2,4 +2,6 @@ export type Position = "auto" | "top" | "bottom" | "left" | "right";
|
|
|
2
2
|
export type Alignment = "start" | "center" | "end";
|
|
3
3
|
export type Direction = "horizontal" | "vertical";
|
|
4
4
|
export type Size = "xs" | "s" | "m" | "l" | "xl";
|
|
5
|
+
export type Mode = "light" | "dark";
|
|
6
|
+
export type Theme = "bleu_iceberg" | "vert_foret" | "violet";
|
|
5
7
|
//# sourceMappingURL=common-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-types.d.ts","sourceRoot":"","sources":["../../../components/common/common-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACnD,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;AAClD,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"common-types.d.ts","sourceRoot":"","sources":["../../../components/common/common-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACnD,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;AAClD,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACjD,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,KAAK,GAAG,cAAc,GAAG,YAAY,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Direction } from "../common/common-types";
|
|
2
|
+
|
|
3
|
+
export type STEP_COMPLETION_STATE = "unvisited" | "incomplete" | "complete";
|
|
4
|
+
|
|
5
|
+
export interface Step {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
completionState: STEP_COMPLETION_STATE;
|
|
9
|
+
clickableCompleteStep?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface StepperProps {
|
|
14
|
+
steps: Step[];
|
|
15
|
+
orientation?: Direction;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface StepperItemProps {
|
|
19
|
+
id: string;
|
|
20
|
+
number?: number;
|
|
21
|
+
name?: string;
|
|
22
|
+
completionState: STEP_COMPLETION_STATE;
|
|
23
|
+
orientation?: Direction;
|
|
24
|
+
clickableCompleteStep?: boolean;
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
isActive?: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const focusNextStepElement: (currentFocusSteppedIndex: number, allSteps: HTMLElement[]) => void;
|
|
2
|
+
export declare const focusPreviousStepElement: (currentFocusSteppedIndex: number, allSteps: HTMLElement[]) => void;
|
|
3
|
+
export declare const focusNextNotStepElement: (classCriteria: string, parent: HTMLElement) => void;
|
|
4
|
+
export declare const focusPreviousNotStepElement: (classCriteria: string, parent: HTMLElement) => void;
|
|
5
|
+
export declare const isStepClickable: (stepConfig: {
|
|
6
|
+
completionState: string;
|
|
7
|
+
clickableCompleteStep: boolean;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
//# sourceMappingURL=stepper.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.utils.d.ts","sourceRoot":"","sources":["../../../components/stepper/stepper.utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,GAAI,0BAA0B,MAAM,EAAE,UAAU,WAAW,EAAE,SAW7F,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,0BAA0B,MAAM,EAAE,UAAU,WAAW,EAAE,SAYjG,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,eAAe,MAAM,EAAE,QAAQ,WAAW,SAoBjF,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,eAAe,MAAM,EAAE,QAAQ,WAAW,SAoBrF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,YAAY;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,qBAAqB,EAAE,OAAO,CAAA;CAAE,YAOtG,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FOCUSABLE_ELEMENTS_QUERY } from "@design-system-rte/core/constants/dom/dom.constants";
|
|
2
|
+
export const focusNextStepElement = (currentFocusSteppedIndex, allSteps) => {
|
|
3
|
+
let nextIndex = currentFocusSteppedIndex === allSteps.length - 1 ? 0 : currentFocusSteppedIndex + 1;
|
|
4
|
+
while (allSteps[nextIndex]?.getAttribute("aria-disabled") === "true") {
|
|
5
|
+
if (nextIndex === allSteps.length - 1) {
|
|
6
|
+
nextIndex = 0;
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
nextIndex++;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
allSteps[nextIndex].focus();
|
|
13
|
+
};
|
|
14
|
+
export const focusPreviousStepElement = (currentFocusSteppedIndex, allSteps) => {
|
|
15
|
+
let previousIndex = currentFocusSteppedIndex === 0 ? allSteps.length - 1 : currentFocusSteppedIndex - 1;
|
|
16
|
+
while (allSteps[previousIndex]?.getAttribute("aria-disabled") === "true") {
|
|
17
|
+
if (previousIndex === 0) {
|
|
18
|
+
previousIndex = allSteps.length - 1;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
previousIndex--;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
allSteps[previousIndex].focus();
|
|
25
|
+
};
|
|
26
|
+
export const focusNextNotStepElement = (classCriteria, parent) => {
|
|
27
|
+
const currentActiveSegmentElement = document.activeElement;
|
|
28
|
+
const allFocusableElement = Array.from(document.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY));
|
|
29
|
+
const currentActiveSegmentElementIndex = Array.from(allFocusableElement).indexOf(currentActiveSegmentElement);
|
|
30
|
+
let nextIndex = currentActiveSegmentElementIndex === allFocusableElement.length - 1 ? 0 : currentActiveSegmentElementIndex + 1;
|
|
31
|
+
while (allFocusableElement[nextIndex]?.classList.contains(classCriteria)) {
|
|
32
|
+
if (parent?.contains(allFocusableElement[nextIndex])) {
|
|
33
|
+
if (nextIndex === allFocusableElement.length - 1) {
|
|
34
|
+
nextIndex = 0;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
nextIndex++;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
allFocusableElement[nextIndex].focus();
|
|
45
|
+
};
|
|
46
|
+
export const focusPreviousNotStepElement = (classCriteria, parent) => {
|
|
47
|
+
const currentActiveSegmentElement = document.activeElement;
|
|
48
|
+
const allFocusableElement = Array.from(document.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY));
|
|
49
|
+
const currentActiveSegmentElementIndex = Array.from(allFocusableElement).indexOf(currentActiveSegmentElement);
|
|
50
|
+
let previousIndex = currentActiveSegmentElementIndex === 0 ? allFocusableElement.length - 1 : currentActiveSegmentElementIndex - 1;
|
|
51
|
+
while (allFocusableElement[previousIndex]?.classList.contains(classCriteria)) {
|
|
52
|
+
if (parent?.contains(allFocusableElement[previousIndex])) {
|
|
53
|
+
if (previousIndex === 0) {
|
|
54
|
+
previousIndex = allFocusableElement.length - 1;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
previousIndex--;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
allFocusableElement[previousIndex].focus();
|
|
65
|
+
};
|
|
66
|
+
export const isStepClickable = (stepConfig) => {
|
|
67
|
+
const { completionState, clickableCompleteStep } = stepConfig;
|
|
68
|
+
return ((completionState === "complete" && clickableCompleteStep) ||
|
|
69
|
+
completionState === "unvisited" ||
|
|
70
|
+
completionState === "incomplete");
|
|
71
|
+
};
|
|
@@ -10,7 +10,7 @@ export interface BaseTextInputProps {
|
|
|
10
10
|
showCounter?: boolean;
|
|
11
11
|
value?: string;
|
|
12
12
|
defaultValue?: string;
|
|
13
|
-
leftIcon?:
|
|
13
|
+
leftIcon?: string;
|
|
14
14
|
showRightIcon?: boolean;
|
|
15
15
|
rightIconAction?: RightIconAction;
|
|
16
16
|
rightIconSize?: import("../button/common/common-button").ButtonSize;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface TooltipProps {
|
|
2
|
-
position?: import("
|
|
3
|
-
alignment?: import("
|
|
2
|
+
position?: import("../common/common-types").Position;
|
|
3
|
+
alignment?: import("../common/common-types").Alignment;
|
|
4
4
|
label?: string;
|
|
5
5
|
arrow?: boolean;
|
|
6
6
|
gap?: number;
|