@onewelcome/react-lib-components 1.3.0 → 1.4.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.
Files changed (90) hide show
  1. package/dist/Button/IconButton.d.ts +2 -1
  2. package/dist/DataGrid/DataGrid.d.ts +1 -0
  3. package/dist/DataGrid/DataGridActions/DataGridActions.d.ts +2 -1
  4. package/dist/Form/Form.d.ts +3 -3
  5. package/dist/Notifications/SlideInModal/SlideInModal.d.ts +1 -1
  6. package/dist/Tabs/Tab.d.ts +5 -9
  7. package/dist/Tabs/TabButton.d.ts +3 -6
  8. package/dist/Tabs/Tabs.d.ts +1 -2
  9. package/dist/react-lib-components.cjs.development.js +437 -392
  10. package/dist/react-lib-components.cjs.development.js.map +1 -1
  11. package/dist/react-lib-components.cjs.production.min.js +1 -1
  12. package/dist/react-lib-components.cjs.production.min.js.map +1 -1
  13. package/dist/react-lib-components.esm.js +438 -393
  14. package/dist/react-lib-components.esm.js.map +1 -1
  15. package/package.json +1 -1
  16. package/src/Breadcrumbs/Breadcrumbs.tsx +46 -38
  17. package/src/Button/BaseButton.tsx +23 -20
  18. package/src/Button/Button.tsx +40 -40
  19. package/src/Button/IconButton.tsx +28 -28
  20. package/src/ContextMenu/ContextMenu.tsx +161 -160
  21. package/src/ContextMenu/ContextMenuItem.tsx +55 -49
  22. package/src/DataGrid/DataGrid.tsx +1 -0
  23. package/src/DataGrid/DataGridActions/DataGridActions.module.scss +1 -1
  24. package/src/DataGrid/DataGridActions/DataGridActions.test.tsx +4 -2
  25. package/src/DataGrid/DataGridActions/DataGridActions.tsx +95 -87
  26. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +64 -64
  27. package/src/DataGrid/DataGridBody/DataGridCell.tsx +42 -44
  28. package/src/DataGrid/DataGridBody/DataGridRow.tsx +29 -29
  29. package/src/DataGrid/DataGridHeader/DataGridHeader.tsx +78 -78
  30. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +48 -48
  31. package/src/Form/Checkbox/Checkbox.tsx +134 -130
  32. package/src/Form/Fieldset/Fieldset.tsx +81 -78
  33. package/src/Form/Form.tsx +9 -4
  34. package/src/Form/FormControl/FormControl.module.scss +1 -20
  35. package/src/Form/FormControl/FormControl.tsx +36 -35
  36. package/src/Form/FormGroup/FormGroup.tsx +62 -62
  37. package/src/Form/FormHelperText/FormHelperText.tsx +19 -18
  38. package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +58 -53
  39. package/src/Form/Input/Input.tsx +90 -87
  40. package/src/Form/Label/Label.tsx +17 -16
  41. package/src/Form/Radio/Radio.tsx +91 -91
  42. package/src/Form/Select/Option.tsx +66 -60
  43. package/src/Form/Select/Select.tsx +207 -209
  44. package/src/Form/Textarea/Textarea.tsx +51 -53
  45. package/src/Form/Toggle/Toggle.tsx +26 -23
  46. package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +51 -43
  47. package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +112 -106
  48. package/src/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +67 -62
  49. package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +42 -37
  50. package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +94 -94
  51. package/src/Form/Wrapper/Wrapper/Wrapper.tsx +73 -73
  52. package/src/Icon/Icon.tsx +19 -16
  53. package/src/Link/Link.tsx +68 -63
  54. package/src/Notifications/BaseModal/BaseModal.tsx +68 -68
  55. package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +13 -10
  56. package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.tsx +33 -25
  57. package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +20 -17
  58. package/src/Notifications/Dialog/Dialog.tsx +83 -83
  59. package/src/Notifications/Dialog/DialogActions/DialogActions.tsx +17 -14
  60. package/src/Notifications/Dialog/DialogTitle/DialogTitle.tsx +15 -12
  61. package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +40 -40
  62. package/src/Notifications/SlideInModal/SlideInModal.module.scss +5 -5
  63. package/src/Notifications/SlideInModal/SlideInModal.test.tsx +7 -2
  64. package/src/Notifications/SlideInModal/SlideInModal.tsx +47 -27
  65. package/src/Pagination/Pagination.tsx +169 -169
  66. package/src/Popover/Popover.module.scss +1 -0
  67. package/src/Popover/Popover.tsx +43 -33
  68. package/src/ProgressBar/ProgressBar.tsx +17 -14
  69. package/src/Skeleton/Skeleton.tsx +23 -20
  70. package/src/StatusIndicator/StatusIndicator.tsx +18 -15
  71. package/src/Tabs/{TabPanel.module.scss → Tab.module.scss} +1 -1
  72. package/src/Tabs/Tab.test.tsx +1 -39
  73. package/src/Tabs/Tab.tsx +16 -10
  74. package/src/Tabs/TabButton.module.scss +0 -4
  75. package/src/Tabs/TabButton.test.tsx +3 -31
  76. package/src/Tabs/TabButton.tsx +35 -49
  77. package/src/Tabs/Tabs.test.tsx +40 -33
  78. package/src/Tabs/Tabs.tsx +107 -101
  79. package/src/TextEllipsis/TextEllipsis.tsx +50 -41
  80. package/src/Tiles/Tile.tsx +58 -56
  81. package/src/Tiles/Tiles.tsx +44 -41
  82. package/src/Tooltip/Tooltip.tsx +101 -100
  83. package/src/Typography/Typography.tsx +47 -44
  84. package/src/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +55 -52
  85. package/src/Wizard/WizardSteps/WizardSteps.tsx +25 -22
  86. package/src/mixins.module.scss +2 -2
  87. package/src/util/helper.test.tsx +0 -28
  88. package/dist/Tabs/TabPanel.d.ts +0 -8
  89. package/src/Tabs/TabPanel.test.tsx +0 -92
  90. package/src/Tabs/TabPanel.tsx +0 -43
@@ -16,6 +16,7 @@
16
16
 
17
17
  import React, {
18
18
  ComponentPropsWithRef,
19
+ ForwardRefRenderFunction,
19
20
  ReactElement,
20
21
  ReactNode,
21
22
  useEffect,
@@ -50,110 +51,110 @@ const defaultPosition: DefaultPosition = {
50
51
  transformOrigin: { horizontal: "left", vertical: "center" }
51
52
  };
52
53
 
53
- export const Tooltip = React.forwardRef<HTMLDivElement, Props>(
54
- (
55
- {
56
- children,
57
- className,
58
- placement = defaultPosition.placement,
59
- offset = defaultPosition.offset,
60
- transformOrigin = defaultPosition.transformOrigin,
61
- domRoot = document.body,
62
- label,
63
- ...rest
64
- }: Props,
65
- ref
66
- ) => {
67
- const [identifier] = useState(generateID());
68
- const [visible, setVisible] = useState(false);
69
-
70
- const relativeElement = useRef<HTMLDivElement>(null);
71
- const elementToBePositioned = useRef<HTMLDivElement>(null);
72
-
73
- const { top, bottom, right, left, calculatePosition } = usePosition({
74
- relativeElement: relativeElement,
75
- elementToBePositioned: elementToBePositioned,
76
- placement: placement,
77
- offset: offset,
78
- transformOrigin: transformOrigin
79
- });
80
-
81
- useEffect(() => {
82
- if (!visible) return;
83
-
84
- function escapePressHandler(event: KeyboardEvent) {
85
- if (event.key === "Escape") {
86
- setVisible(false);
87
- }
88
- }
54
+ const TooltipComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
55
+ {
56
+ children,
57
+ className,
58
+ placement = defaultPosition.placement,
59
+ offset = defaultPosition.offset,
60
+ transformOrigin = defaultPosition.transformOrigin,
61
+ domRoot = document.body,
62
+ label,
63
+ ...rest
64
+ }: Props,
65
+ ref
66
+ ) => {
67
+ const [identifier] = useState(generateID());
68
+ const [visible, setVisible] = useState(false);
69
+
70
+ const relativeElement = useRef<HTMLDivElement>(null);
71
+ const elementToBePositioned = useRef<HTMLDivElement>(null);
72
+
73
+ const { top, bottom, right, left, calculatePosition } = usePosition({
74
+ relativeElement: relativeElement,
75
+ elementToBePositioned: elementToBePositioned,
76
+ placement: placement,
77
+ offset: offset,
78
+ transformOrigin: transformOrigin
79
+ });
89
80
 
90
- document.addEventListener("keyup", escapePressHandler);
91
-
92
- return () => {
93
- document.removeEventListener("keyup", escapePressHandler);
94
- };
95
- }, [visible]);
96
-
97
- useLayoutEffect(() => {
98
- calculatePosition();
99
- }, [visible]);
100
-
101
- const renderChildren = () => {
102
- if (React.isValidElement(label)) {
103
- return React.cloneElement(label as ReactElement, {
104
- onFocus: () => setVisible(true),
105
- onBlur: () => setVisible(false),
106
- "aria-describedby": identifier,
107
- tabIndex: 0,
108
- className: classes["label"]
109
- });
81
+ useEffect(() => {
82
+ if (!visible) return;
83
+
84
+ function escapePressHandler(event: KeyboardEvent) {
85
+ if (event.key === "Escape") {
86
+ setVisible(false);
110
87
  }
88
+ }
89
+
90
+ document.addEventListener("keyup", escapePressHandler);
111
91
 
112
- return (
113
- <span
114
- className={classes["label"]}
115
- tabIndex={0}
116
- onFocus={() => setVisible(true)}
117
- onBlur={() => setVisible(false)}
118
- aria-describedby={identifier}
119
- >
120
- {label}
121
- </span>
122
- );
92
+ return () => {
93
+ document.removeEventListener("keyup", escapePressHandler);
123
94
  };
95
+ }, [visible]);
96
+
97
+ useLayoutEffect(() => {
98
+ calculatePosition();
99
+ }, [visible]);
100
+
101
+ const renderChildren = () => {
102
+ if (React.isValidElement(label)) {
103
+ return React.cloneElement(label as ReactElement, {
104
+ onFocus: () => setVisible(true),
105
+ onBlur: () => setVisible(false),
106
+ "aria-describedby": identifier,
107
+ tabIndex: 0,
108
+ className: classes["label"]
109
+ });
110
+ }
124
111
 
125
112
  return (
126
- <div {...rest} ref={ref} className={`${classes.wrapper} ${className ?? ""}`}>
127
- {renderChildren()}
128
- <div className={`${classes["tooltip-wrapper"]}`}>
129
- <Icon
130
- ref={relativeElement}
131
- tag="div"
132
- onMouseEnter={() => setVisible(true)}
133
- onMouseLeave={() => setVisible(false)}
134
- icon={Icons.InfoCircle}
135
- className={classes.icon}
136
- />
137
- {createPortal(
138
- <div
139
- ref={elementToBePositioned}
140
- style={{
141
- ...rest.style,
142
- top: top,
143
- left: left,
144
- right: right,
145
- bottom: bottom
146
- }}
147
- aria-hidden={!visible}
148
- id={identifier}
149
- className={`${classes.tooltip} ${visible ? classes.visible : ""}`}
150
- >
151
- {children}
152
- </div>,
153
- domRoot
154
- )}
155
- </div>
156
- </div>
113
+ <span
114
+ className={classes["label"]}
115
+ tabIndex={0}
116
+ onFocus={() => setVisible(true)}
117
+ onBlur={() => setVisible(false)}
118
+ aria-describedby={identifier}
119
+ >
120
+ {label}
121
+ </span>
157
122
  );
158
- }
159
- );
123
+ };
124
+
125
+ return (
126
+ <div {...rest} ref={ref} className={`${classes.wrapper} ${className ?? ""}`}>
127
+ {renderChildren()}
128
+ <div className={`${classes["tooltip-wrapper"]}`}>
129
+ <Icon
130
+ ref={relativeElement}
131
+ tag="div"
132
+ onMouseEnter={() => setVisible(true)}
133
+ onMouseLeave={() => setVisible(false)}
134
+ icon={Icons.InfoCircle}
135
+ className={classes.icon}
136
+ />
137
+ {createPortal(
138
+ <div
139
+ ref={elementToBePositioned}
140
+ style={{
141
+ ...rest.style,
142
+ top: top,
143
+ left: left,
144
+ right: right,
145
+ bottom: bottom
146
+ }}
147
+ aria-hidden={!visible}
148
+ id={identifier}
149
+ className={`${classes.tooltip} ${visible ? classes.visible : ""}`}
150
+ >
151
+ {children}
152
+ </div>,
153
+ domRoot
154
+ )}
155
+ </div>
156
+ </div>
157
+ );
158
+ };
159
+
160
+ export const Tooltip = React.forwardRef(TooltipComponent);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { ComponentPropsWithRef, ReactNode } from "react";
17
+ import React, { ForwardRefRenderFunction, ComponentPropsWithRef, ReactNode } from "react";
18
18
  import classes from "./Typography.module.scss";
19
19
  import { Spacing, useSpacing } from "../hooks/useSpacing";
20
20
 
@@ -56,51 +56,54 @@ export interface Props extends ComponentPropsWithRef<any> {
56
56
  spacing?: Spacing;
57
57
  }
58
58
 
59
- export const Typography = React.forwardRef<any, Props>(
60
- ({ children, variant, tag, style, spacing, className = "", ...rest }: Props, ref) => {
61
- if (!validVariants.includes(variant)) {
62
- throw new Error(
63
- `You entered an invalid variant. You can choose from: ${validVariants}, you entered: ${variant}`
64
- );
65
- }
59
+ const TypographyComponent: ForwardRefRenderFunction<any, Props> = (
60
+ { children, variant, tag, style, spacing, className = "", ...rest }: Props,
61
+ ref
62
+ ) => {
63
+ if (!validVariants.includes(variant)) {
64
+ throw new Error(
65
+ `You entered an invalid variant. You can choose from: ${validVariants}, you entered: ${variant}`
66
+ );
67
+ }
66
68
 
67
- const styleWithSpacing = useSpacing(spacing, style);
69
+ const styleWithSpacing = useSpacing(spacing, style);
68
70
 
69
- if (!tag) {
70
- switch (variant) {
71
- case "h1":
72
- case "h2":
73
- case "h3":
74
- case "h4":
75
- case "code":
76
- tag = variant;
77
- break;
78
- case "body":
79
- tag = "p";
80
- break;
81
- case "body-bold":
82
- tag = "p";
83
- break;
84
- case "sub-text":
85
- tag = "span";
86
- break;
87
- default:
88
- tag = "div";
89
- break;
90
- }
71
+ if (!tag) {
72
+ switch (variant) {
73
+ case "h1":
74
+ case "h2":
75
+ case "h3":
76
+ case "h4":
77
+ case "code":
78
+ tag = variant;
79
+ break;
80
+ case "body":
81
+ tag = "p";
82
+ break;
83
+ case "body-bold":
84
+ tag = "p";
85
+ break;
86
+ case "sub-text":
87
+ tag = "span";
88
+ break;
89
+ default:
90
+ tag = "div";
91
+ break;
91
92
  }
93
+ }
92
94
 
93
- let TagName = tag;
95
+ let TagName = tag;
94
96
 
95
- return (
96
- <TagName
97
- {...rest}
98
- ref={ref}
99
- style={styleWithSpacing}
100
- className={`${classes["typography_style_" + variant]} ${className}`}
101
- >
102
- {children}
103
- </TagName>
104
- );
105
- }
106
- );
97
+ return (
98
+ <TagName
99
+ {...rest}
100
+ ref={ref}
101
+ style={styleWithSpacing}
102
+ className={`${classes["typography_style_" + variant]} ${className}`}
103
+ >
104
+ {children}
105
+ </TagName>
106
+ );
107
+ };
108
+
109
+ export const Typography = React.forwardRef(TypographyComponent);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { ComponentPropsWithRef, Fragment } from "react";
17
+ import React, { ForwardRefRenderFunction, ComponentPropsWithRef, Fragment } from "react";
18
18
  import classes from "./BaseWizardSteps.module.scss";
19
19
  import { Icon, Icons } from "../../Icon/Icon";
20
20
 
@@ -32,59 +32,62 @@ export interface Props extends Omit<ComponentPropsWithRef<"div">, "onClick"> {
32
32
  futureStepsClickable?: boolean;
33
33
  }
34
34
 
35
- export const BaseWizardSteps = React.forwardRef<HTMLDivElement, Props>(
36
- ({ steps, currentStepNo, onClick, futureStepsClickable = false, ...rest }: Props, ref) => {
37
- const getStepState = (stepNo: number): StepState => {
38
- if (currentStepNo === stepNo) {
39
- return "current";
40
- } else if (stepNo < currentStepNo) {
41
- return "finished";
42
- }
43
- return "future";
44
- };
35
+ const BaseWizardStepsComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
36
+ { steps, currentStepNo, onClick, futureStepsClickable = false, ...rest }: Props,
37
+ ref
38
+ ) => {
39
+ const getStepState = (stepNo: number): StepState => {
40
+ if (currentStepNo === stepNo) {
41
+ return "current";
42
+ } else if (stepNo < currentStepNo) {
43
+ return "finished";
44
+ }
45
+ return "future";
46
+ };
45
47
 
46
- const getStepContent = (stepState: StepState, index: number, disabled?: boolean) => {
47
- const stepNumberString = String(index + 1);
48
- if (stepState === "finished") {
49
- return disabled ? null : <Icon className={classes["checkmark"]} icon={Icons.Checkmark} />;
50
- } else {
51
- return <Fragment>{stepNumberString}</Fragment>;
52
- }
53
- };
48
+ const getStepContent = (stepState: StepState, index: number, disabled?: boolean) => {
49
+ const stepNumberString = String(index + 1);
50
+ if (stepState === "finished") {
51
+ return disabled ? null : <Icon className={classes["checkmark"]} icon={Icons.Checkmark} />;
52
+ } else {
53
+ return <Fragment>{stepNumberString}</Fragment>;
54
+ }
55
+ };
54
56
 
55
- const generatedSteps = steps.map((step, index) => {
56
- const stepState = getStepState(index);
57
- const disabledStyleClassName = step.disabled ? classes["disabled"] : "";
58
- const clickableClassName = futureStepsClickable ? classes["clickable"] : "";
59
-
60
- return (
61
- <button
62
- key={step.label.toLowerCase().replace(/\s/, "-")}
63
- disabled={
64
- step.disabled ||
65
- (stepState === "future" && !futureStepsClickable) ||
66
- stepState === "current"
67
- }
68
- aria-current={stepState === "current" ? "step" : undefined}
69
- onClick={() => onClick && onClick(index)}
70
- className={`${classes["wizard-element"]} ${classes[stepState]} ${clickableClassName} ${disabledStyleClassName}`}
71
- >
72
- <div className={classes["number-wrapper"]}>
73
- <span className={classes["number"]}>
74
- {getStepContent(stepState, index, step.disabled)}
75
- </span>
76
- </div>
77
- <div className={classes["two-line-text-overflow"]}>
78
- <span className={classes["label"]}>{step.label}</span>
79
- </div>
80
- </button>
81
- );
82
- });
57
+ const generatedSteps = steps.map((step, index) => {
58
+ const stepState = getStepState(index);
59
+ const disabledStyleClassName = step.disabled ? classes["disabled"] : "";
60
+ const clickableClassName = futureStepsClickable ? classes["clickable"] : "";
83
61
 
84
62
  return (
85
- <div {...rest} ref={ref} className={classes["wizard"]}>
86
- {generatedSteps}
87
- </div>
63
+ <button
64
+ key={step.label.toLowerCase().replace(/\s/, "-")}
65
+ disabled={
66
+ step.disabled ||
67
+ (stepState === "future" && !futureStepsClickable) ||
68
+ stepState === "current"
69
+ }
70
+ aria-current={stepState === "current" ? "step" : undefined}
71
+ onClick={() => onClick && onClick(index)}
72
+ className={`${classes["wizard-element"]} ${classes[stepState]} ${clickableClassName} ${disabledStyleClassName}`}
73
+ >
74
+ <div className={classes["number-wrapper"]}>
75
+ <span className={classes["number"]}>
76
+ {getStepContent(stepState, index, step.disabled)}
77
+ </span>
78
+ </div>
79
+ <div className={classes["two-line-text-overflow"]}>
80
+ <span className={classes["label"]}>{step.label}</span>
81
+ </div>
82
+ </button>
88
83
  );
89
- }
90
- );
84
+ });
85
+
86
+ return (
87
+ <div {...rest} ref={ref} className={classes["wizard"]}>
88
+ {generatedSteps}
89
+ </div>
90
+ );
91
+ };
92
+
93
+ export const BaseWizardSteps = React.forwardRef(BaseWizardStepsComponent);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { ComponentPropsWithRef, useContext } from "react";
17
+ import React, { ForwardRefRenderFunction, ComponentPropsWithRef, useContext } from "react";
18
18
  import { WizardStateContext } from "../WizardStateProvider";
19
19
  import { BaseWizardSteps } from "../BaseWizardSteps/BaseWizardSteps";
20
20
  import { changeCurrentStepNo } from "../wizardStateReducer";
@@ -23,26 +23,29 @@ export interface Props extends ComponentPropsWithRef<"div"> {
23
23
  onStepClick: (currentStepNo: number, selectedStepNo: number) => boolean;
24
24
  }
25
25
 
26
- export const WizardSteps = React.forwardRef<HTMLDivElement, Props>(
27
- ({ onStepClick, ...rest }: Props, ref) => {
28
- const {
29
- state: { currentStepNo, mode, steps },
30
- dispatch
31
- } = useContext(WizardStateContext);
26
+ const WizardStepsComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
27
+ { onStepClick, ...rest }: Props,
28
+ ref
29
+ ) => {
30
+ const {
31
+ state: { currentStepNo, mode, steps },
32
+ dispatch
33
+ } = useContext(WizardStateContext);
32
34
 
33
- const onClick = (selectedStepNo: number) => {
34
- onStepClick(currentStepNo, selectedStepNo) && dispatch(changeCurrentStepNo(selectedStepNo));
35
- };
35
+ const onClick = (selectedStepNo: number) => {
36
+ onStepClick(currentStepNo, selectedStepNo) && dispatch(changeCurrentStepNo(selectedStepNo));
37
+ };
36
38
 
37
- return (
38
- <BaseWizardSteps
39
- {...rest}
40
- ref={ref}
41
- onClick={onClick}
42
- steps={steps}
43
- currentStepNo={currentStepNo}
44
- futureStepsClickable={mode === "edit"}
45
- />
46
- );
47
- }
48
- );
39
+ return (
40
+ <BaseWizardSteps
41
+ {...rest}
42
+ ref={ref}
43
+ onClick={onClick}
44
+ steps={steps}
45
+ currentStepNo={currentStepNo}
46
+ futureStepsClickable={mode === "edit"}
47
+ />
48
+ );
49
+ };
50
+
51
+ export const WizardSteps = React.forwardRef(WizardStepsComponent);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- @import "./readyclasses.module.scss";
17
+ @use "./readyclasses.module.scss";
18
18
 
19
19
  @mixin button($variant: "text", $type: "default") {
20
20
  $disabledSelector: if($type == "link", ".disabled", ":disabled");
@@ -84,7 +84,7 @@
84
84
  color: $color;
85
85
  }
86
86
 
87
- @include focusOutline(var(--color-focus));
87
+ @include readyclasses.focusOutline(var(--color-focus));
88
88
 
89
89
  &:hover:not(.disabled),
90
90
  &:focus:not(.disabled) {
@@ -123,34 +123,6 @@ describe("debounce function", () => {
123
123
  });
124
124
 
125
125
  describe("throttling works", () => {
126
- it("throttles the function", async () => {
127
- const throttledFunction = jest.fn();
128
-
129
- window.addEventListener("resize", throttle(throttledFunction, 1));
130
-
131
- await fireEvent.resize(window);
132
- await fireEvent.resize(window);
133
- await fireEvent.resize(window);
134
- await fireEvent.resize(window);
135
- await fireEvent.resize(window);
136
- await fireEvent.resize(window);
137
- await fireEvent.resize(window);
138
- await fireEvent.resize(window);
139
- await fireEvent.resize(window);
140
- await fireEvent.resize(window);
141
- await fireEvent.resize(window);
142
- await fireEvent.resize(window);
143
- await fireEvent.resize(window);
144
- await fireEvent.resize(window);
145
- await fireEvent.resize(window);
146
- await fireEvent.resize(window);
147
- await fireEvent.resize(window);
148
- await fireEvent.resize(window);
149
-
150
- expect(throttledFunction).not.toHaveBeenCalledTimes(1);
151
- expect(throttledFunction).not.toHaveBeenCalledTimes(10);
152
- });
153
-
154
126
  it("Works in a react component as well, it should only fire the exampleFunction once.", async () => {
155
127
  const ExampleComponent = ({
156
128
  throttledFunction
@@ -1,8 +0,0 @@
1
- import React, { ComponentPropsWithRef } from "react";
2
- export interface Props extends ComponentPropsWithRef<"div"> {
3
- children: React.ReactNode;
4
- tabId: string;
5
- tabPanelId: string;
6
- selected?: boolean;
7
- }
8
- export declare const TabPanel: React.ForwardRefExoticComponent<Pick<Props, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "tabId" | "tabPanelId" | "selected"> & React.RefAttributes<HTMLDivElement>>;