@codecademy/gamut 67.6.1-alpha.1bf8a5.0 → 67.6.1-alpha.301aed.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.
- package/dist/BarChart/Bar/Bar.d.ts +6 -0
- package/dist/BarChart/Bar/Bar.js +178 -0
- package/dist/BarChart/Bar/elements.d.ts +1392 -0
- package/dist/BarChart/Bar/elements.js +58 -0
- package/dist/BarChart/Bar/index.d.ts +1 -0
- package/dist/BarChart/Bar/index.js +2 -0
- package/dist/BarChart/BarChartProvider.d.ts +12 -0
- package/dist/BarChart/BarChartProvider.js +16 -0
- package/dist/BarChart/index.d.ts +4 -0
- package/dist/BarChart/index.js +73 -0
- package/dist/BarChart/layout/GridLines.d.ts +7 -0
- package/dist/BarChart/layout/GridLines.js +77 -0
- package/dist/BarChart/layout/ScaleChartHeader.d.ts +10 -0
- package/dist/BarChart/layout/ScaleChartHeader.js +88 -0
- package/dist/BarChart/layout/VerticalSpacer.d.ts +6 -0
- package/dist/BarChart/layout/VerticalSpacer.js +47 -0
- package/dist/BarChart/types.d.ts +56 -0
- package/dist/BarChart/types.js +1 -0
- package/dist/BarChart/utils/hooks.d.ts +36 -0
- package/dist/BarChart/utils/hooks.js +61 -0
- package/dist/BarChart/utils/index.d.ts +83 -0
- package/dist/BarChart/utils/index.js +162 -0
- package/dist/ConnectedForm/ConnectedFormGroup.d.ts +0 -5
- package/dist/ConnectedForm/ConnectedFormGroup.js +1 -1
- package/dist/Form/elements/FormGroupLabel.js +2 -8
- package/dist/GridForm/GridFormInputGroup/__fixtures__/renderers.d.ts +0 -4
- package/dist/GridForm/types.d.ts +0 -5
- package/dist/Tip/InfoTip/InfoTipButton.js +2 -5
- package/dist/Tip/InfoTip/elements.d.ts +12 -0
- package/dist/Tip/InfoTip/elements.js +9 -0
- package/dist/Tip/InfoTip/index.d.ts +0 -18
- package/dist/Tip/InfoTip/index.js +66 -37
- package/dist/Tip/__tests__/helpers.d.ts +26 -5
- package/dist/Tip/shared/FloatingTip.js +3 -3
- package/dist/Tip/shared/InlineTip.js +1 -4
- package/dist/Tip/shared/types.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
/// <reference types="testing-library__jest-dom" />
|
|
3
3
|
import { setupRtl } from '@codecademy/gamut-tests';
|
|
4
4
|
import { RefObject } from 'react';
|
|
5
|
-
import { InfoTip } from '../InfoTip';
|
|
5
|
+
import { InfoTip, InfoTipProps } from '../InfoTip';
|
|
6
6
|
import { TipPlacements } from '../shared/types';
|
|
7
7
|
type InfoTipView = ReturnType<ReturnType<typeof setupRtl<typeof InfoTip>>>['view'];
|
|
8
|
+
type Placement = NonNullable<InfoTipProps['placement']>;
|
|
8
9
|
type ViewParam = {
|
|
9
10
|
view: InfoTipView;
|
|
10
11
|
};
|
|
@@ -15,7 +16,7 @@ type InfoParam = {
|
|
|
15
16
|
info: string;
|
|
16
17
|
};
|
|
17
18
|
type PlacementParam = {
|
|
18
|
-
placement:
|
|
19
|
+
placement: Placement;
|
|
19
20
|
};
|
|
20
21
|
export declare const createFocusOnClick: (ref: RefObject<HTMLDivElement>) => ({ isTipHidden }: {
|
|
21
22
|
isTipHidden: boolean;
|
|
@@ -47,10 +48,13 @@ export declare const pressKey: (key: string) => Promise<void>;
|
|
|
47
48
|
export declare const waitForLinkToHaveFocus: ({ view, linkText, }: ViewParam & LinkTextParam) => Promise<HTMLElement>;
|
|
48
49
|
export declare const openTipAndWaitForLink: ({ view, linkText, }: ViewParam & LinkTextParam) => Promise<HTMLElement>;
|
|
49
50
|
export declare const openTipTabToLinkAndWaitForFocus: (view: InfoTipView, linkText: string) => Promise<HTMLElement>;
|
|
50
|
-
export declare const
|
|
51
|
+
export declare const testShowTipOnClick: ({ view, info, placement, }: ViewParam & InfoParam & PlacementParam) => Promise<void>;
|
|
52
|
+
export declare const testEscapeKeyReturnsFocus: ({ view, info, placement, }: ViewParam & InfoParam & PlacementParam) => Promise<void>;
|
|
53
|
+
export declare const testFocusWrap: ({ view, containerRef, direction, }: ViewParam & {
|
|
54
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
51
55
|
direction: 'forward' | 'backward';
|
|
52
56
|
}) => Promise<void>;
|
|
53
|
-
export declare const
|
|
57
|
+
export declare const getTipContent: (view: InfoTipView, text: string, useQuery?: boolean) => HTMLElement;
|
|
54
58
|
export declare const testTabbingBetweenLinks: ({ view, firstLinkText, secondLinkText, placement, }: ViewParam & {
|
|
55
59
|
firstLinkText: string;
|
|
56
60
|
secondLinkText: string;
|
|
@@ -58,6 +62,7 @@ export declare const testTabbingBetweenLinks: ({ view, firstLinkText, secondLink
|
|
|
58
62
|
}) => Promise<void>;
|
|
59
63
|
export declare const setupLinkTestWithPlacement: (linkText: string, placement: TipPlacements, renderView: ReturnType<typeof setupRtl<typeof InfoTip>>) => {
|
|
60
64
|
view: import("@testing-library/react").RenderResult;
|
|
65
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
61
66
|
info: import("react/jsx-runtime").JSX.Element;
|
|
62
67
|
onClick: ({ isTipHidden }: {
|
|
63
68
|
isTipHidden: boolean;
|
|
@@ -81,12 +86,28 @@ type ViewWithQueries = {
|
|
|
81
86
|
getAllByText: (text: string) => HTMLElement[];
|
|
82
87
|
getAllByLabelText: (text: string) => HTMLElement[];
|
|
83
88
|
};
|
|
89
|
+
export declare const getVisibleTip: ({ text, placement, }: {
|
|
90
|
+
text: string;
|
|
91
|
+
placement?: "inline" | "floating" | undefined;
|
|
92
|
+
}) => HTMLElement | undefined;
|
|
93
|
+
export declare const expectTipToBeVisible: ({ text, placement, }: {
|
|
94
|
+
text: string;
|
|
95
|
+
placement?: "inline" | "floating" | undefined;
|
|
96
|
+
}) => void;
|
|
97
|
+
export declare const expectTipToBeClosed: ({ text, placement, }: {
|
|
98
|
+
text: string;
|
|
99
|
+
placement?: "inline" | "floating" | undefined;
|
|
100
|
+
}) => void;
|
|
84
101
|
export declare const openInfoTipsWithKeyboard: ({ view, count, }: {
|
|
85
102
|
view: ViewWithQueries;
|
|
86
103
|
count: number;
|
|
87
104
|
}) => Promise<void>;
|
|
88
105
|
export declare const expectTipsVisible: (tips: {
|
|
89
106
|
text: string;
|
|
107
|
+
placement?: 'inline' | 'floating';
|
|
108
|
+
}[]) => void;
|
|
109
|
+
export declare const expectTipsClosed: (tips: {
|
|
110
|
+
text: string;
|
|
111
|
+
placement?: 'inline' | 'floating';
|
|
90
112
|
}[]) => void;
|
|
91
|
-
export declare const expectTipsClosed: () => void;
|
|
92
113
|
export {};
|
|
@@ -18,7 +18,7 @@ export const FloatingTip = ({
|
|
|
18
18
|
loading,
|
|
19
19
|
narrow,
|
|
20
20
|
overline,
|
|
21
|
-
|
|
21
|
+
popoverContentRef,
|
|
22
22
|
truncateLines,
|
|
23
23
|
type,
|
|
24
24
|
username,
|
|
@@ -123,7 +123,7 @@ export const FloatingTip = ({
|
|
|
123
123
|
width: inheritDims ? 'inherit' : undefined,
|
|
124
124
|
onBlur: toolOnlyEventFunc,
|
|
125
125
|
onFocus: toolOnlyEventFunc,
|
|
126
|
-
onKeyDown: escapeKeyPressHandler,
|
|
126
|
+
onKeyDown: escapeKeyPressHandler ? e => escapeKeyPressHandler(e) : undefined,
|
|
127
127
|
onMouseDown: e => e.preventDefault(),
|
|
128
128
|
onMouseEnter: toolOnlyEventFunc,
|
|
129
129
|
children: children
|
|
@@ -134,7 +134,7 @@ export const FloatingTip = ({
|
|
|
134
134
|
horizontalOffset: offset,
|
|
135
135
|
isOpen: isPopoverOpen,
|
|
136
136
|
outline: true,
|
|
137
|
-
popoverContainerRef:
|
|
137
|
+
popoverContainerRef: popoverContentRef,
|
|
138
138
|
skipFocusTrap: true,
|
|
139
139
|
targetRef: ref,
|
|
140
140
|
variant: "secondary",
|
|
@@ -17,7 +17,6 @@ export const InlineTip = ({
|
|
|
17
17
|
loading,
|
|
18
18
|
narrow,
|
|
19
19
|
overline,
|
|
20
|
-
contentRef,
|
|
21
20
|
truncateLines,
|
|
22
21
|
type,
|
|
23
22
|
username,
|
|
@@ -43,7 +42,7 @@ export const InlineTip = ({
|
|
|
43
42
|
height: inheritDims ? 'inherit' : undefined,
|
|
44
43
|
ref: wrapperRef,
|
|
45
44
|
width: inheritDims ? 'inherit' : undefined,
|
|
46
|
-
onKeyDown: escapeKeyPressHandler,
|
|
45
|
+
onKeyDown: escapeKeyPressHandler ? e => escapeKeyPressHandler(e) : undefined,
|
|
47
46
|
children: children
|
|
48
47
|
});
|
|
49
48
|
const tipBody = /*#__PURE__*/_jsx(InlineTipBodyWrapper, {
|
|
@@ -56,9 +55,7 @@ export const InlineTip = ({
|
|
|
56
55
|
color: "currentColor",
|
|
57
56
|
horizNarrow: narrow && isHorizontalCenter,
|
|
58
57
|
id: id,
|
|
59
|
-
ref: contentRef,
|
|
60
58
|
role: type === 'tool' ? 'tooltip' : undefined,
|
|
61
|
-
tabIndex: type === 'info' ? -1 : undefined,
|
|
62
59
|
width: narrow && !isHorizontalCenter ? narrowWidth : 'max-content',
|
|
63
60
|
zIndex: "auto",
|
|
64
61
|
children: type === 'preview' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -46,7 +46,7 @@ export type TipPlacementComponentProps = Omit<TipNewBaseProps, 'placement' | 'em
|
|
|
46
46
|
escapeKeyPressHandler?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
47
47
|
id?: string;
|
|
48
48
|
isTipHidden?: boolean;
|
|
49
|
-
|
|
49
|
+
popoverContentRef?: React.RefObject<HTMLDivElement> | ((node: HTMLDivElement | null) => void);
|
|
50
50
|
type: 'info' | 'tool' | 'preview';
|
|
51
51
|
wrapperRef?: React.RefObject<HTMLDivElement>;
|
|
52
52
|
zIndex?: number;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/gamut",
|
|
3
3
|
"description": "Styleguide & Component library for Codecademy",
|
|
4
|
-
"version": "67.6.1-alpha.
|
|
4
|
+
"version": "67.6.1-alpha.301aed.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@codecademy/gamut-icons": "9.53.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"dist/**/[A-Z]**/[A-Z]*.js",
|
|
57
57
|
"dist/**/[A-Z]**/index.js"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "256e9aa6f08f98861b030e2eedd133f52f70f908"
|
|
60
60
|
}
|