@codecademy/gamut 72.2.3-alpha.c298d6.0 → 72.2.3-alpha.f0a032.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/agent-tools/skills/gamut-forms/SKILL.md +16 -0
- package/agent-tools/skills/gamut-select-dropdown/SKILL.md +236 -0
- package/dist/Button/IconButton.js +0 -1
- package/dist/Form/SelectDropdown/SelectDropdown.js +48 -100
- package/dist/Form/SelectDropdown/core/accessibility.d.ts +3 -0
- package/dist/Form/SelectDropdown/core/accessibility.js +12 -0
- package/dist/Form/SelectDropdown/core/constants.d.ts +13 -0
- package/dist/Form/SelectDropdown/core/constants.js +14 -0
- package/dist/Form/SelectDropdown/{styles.js → core/styles.js} +30 -12
- package/dist/Form/SelectDropdown/{utils.d.ts → core/utils.d.ts} +12 -2
- package/dist/Form/SelectDropdown/{utils.js → core/utils.js} +23 -0
- package/dist/Form/SelectDropdown/elements/constants.d.ts +0 -8
- package/dist/Form/SelectDropdown/elements/constants.js +1 -9
- package/dist/Form/SelectDropdown/elements/containers.d.ts +6 -2
- package/dist/Form/SelectDropdown/elements/containers.js +17 -1
- package/dist/Form/SelectDropdown/elements/controls.d.ts +1 -15
- package/dist/Form/SelectDropdown/elements/controls.js +2 -91
- package/dist/Form/SelectDropdown/elements/index.d.ts +2 -1
- package/dist/Form/SelectDropdown/elements/index.js +2 -1
- package/dist/Form/SelectDropdown/elements/options.d.ts +1 -0
- package/dist/Form/SelectDropdown/elements/options.js +5 -2
- package/dist/Form/SelectDropdown/hooks/useSelectHandlers.d.ts +22 -0
- package/dist/Form/SelectDropdown/hooks/useSelectHandlers.js +62 -0
- package/dist/Form/SelectDropdown/hooks/useSelectOptions.d.ts +14 -0
- package/dist/Form/SelectDropdown/hooks/useSelectOptions.js +39 -0
- package/dist/Form/SelectDropdown/types/component-props.d.ts +54 -6
- package/dist/Form/SelectDropdown/types/internal.d.ts +3 -3
- package/dist/Form/SelectDropdown/types/styles.d.ts +5 -1
- package/dist/Form/styles/index.d.ts +1 -1
- package/dist/Form/styles/index.js +1 -1
- package/dist/Tip/ToolTip/index.d.ts +2 -7
- package/dist/Tip/shared/FloatingTip.js +0 -15
- package/dist/Tip/shared/InlineTip.js +0 -17
- package/dist/Tip/shared/types.d.ts +0 -1
- package/package.json +6 -6
- /package/dist/Form/SelectDropdown/{styles.d.ts → core/styles.d.ts} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
1
|
import { InfoTipContainer } from '../InfoTip/styles';
|
|
3
2
|
import { PreviewTipContents, PreviewTipShadow } from '../PreviewTip/elements';
|
|
4
3
|
import { ToolTipContainer } from '../ToolTip/elements';
|
|
@@ -10,7 +9,6 @@ export const InlineTip = ({
|
|
|
10
9
|
alignment,
|
|
11
10
|
avatar,
|
|
12
11
|
children,
|
|
13
|
-
closeOnClick,
|
|
14
12
|
escapeKeyPressHandler,
|
|
15
13
|
id,
|
|
16
14
|
inheritDims,
|
|
@@ -27,12 +25,6 @@ export const InlineTip = ({
|
|
|
27
25
|
zIndex
|
|
28
26
|
}) => {
|
|
29
27
|
const isHoverType = type === 'tool' || type === 'preview';
|
|
30
|
-
const [isSuppressed, setIsSuppressed] = useState(false);
|
|
31
|
-
const handleClick = useCallback(() => {
|
|
32
|
-
if (closeOnClick) setIsSuppressed(true);
|
|
33
|
-
}, [closeOnClick]);
|
|
34
|
-
const handleBlur = useCallback(() => setIsSuppressed(false), []);
|
|
35
|
-
const handleMouseLeave = useCallback(() => setIsSuppressed(false), []);
|
|
36
28
|
const InlineTipWrapper = isHoverType ? ToolTipWrapper : InfoTipWrapper;
|
|
37
29
|
const InlineTipBodyWrapper = isHoverType ? ToolTipContainer : InfoTipContainer;
|
|
38
30
|
const inlineWrapperProps = isHoverType ? {} : {
|
|
@@ -47,17 +39,10 @@ export const InlineTip = ({
|
|
|
47
39
|
type
|
|
48
40
|
});
|
|
49
41
|
const isHorizontalCenter = tipBodyAlignment === 'horizontalCenter';
|
|
50
|
-
const suppressedBodyStyle = isHoverType && isSuppressed ? {
|
|
51
|
-
opacity: 0,
|
|
52
|
-
visibility: 'hidden',
|
|
53
|
-
transition: 'none'
|
|
54
|
-
} : undefined;
|
|
55
42
|
const target = /*#__PURE__*/_jsx(TargetContainer, {
|
|
56
43
|
height: inheritDims ? 'inherit' : undefined,
|
|
57
44
|
ref: wrapperRef,
|
|
58
45
|
width: inheritDims ? 'inherit' : undefined,
|
|
59
|
-
onBlur: isHoverType ? handleBlur : undefined,
|
|
60
|
-
onClick: isHoverType ? handleClick : undefined,
|
|
61
46
|
onKeyDown: escapeKeyPressHandler,
|
|
62
47
|
children: children
|
|
63
48
|
});
|
|
@@ -65,7 +50,6 @@ export const InlineTip = ({
|
|
|
65
50
|
alignment: alignment,
|
|
66
51
|
zIndex: zIndex ?? 1,
|
|
67
52
|
...inlineWrapperProps,
|
|
68
|
-
style: suppressedBodyStyle,
|
|
69
53
|
children: /*#__PURE__*/_jsx(TipBody, {
|
|
70
54
|
alignment: tipBodyAlignment,
|
|
71
55
|
"aria-hidden": isHoverType,
|
|
@@ -94,7 +78,6 @@ export const InlineTip = ({
|
|
|
94
78
|
});
|
|
95
79
|
return /*#__PURE__*/_jsx(InlineTipWrapper, {
|
|
96
80
|
...tipWrapperProps,
|
|
97
|
-
onMouseLeave: isHoverType ? handleMouseLeave : undefined,
|
|
98
81
|
children: alignment.includes('top') ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
99
82
|
children: [tipBody, target]
|
|
100
83
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -47,7 +47,6 @@ export type TipPlacementComponentProps = Omit<TipNewBaseProps, 'placement' | 'em
|
|
|
47
47
|
id?: string;
|
|
48
48
|
isTipHidden?: boolean;
|
|
49
49
|
contentRef?: React.RefObject<HTMLDivElement> | ((node: HTMLDivElement | null) => void);
|
|
50
|
-
closeOnClick?: boolean;
|
|
51
50
|
type: 'info' | 'tool' | 'preview';
|
|
52
51
|
wrapperRef?: React.RefObject<HTMLDivElement>;
|
|
53
52
|
zIndex?: number;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/gamut",
|
|
3
3
|
"description": "Styleguide & Component library for Codecademy",
|
|
4
|
-
"version": "72.2.3-alpha.
|
|
4
|
+
"version": "72.2.3-alpha.f0a032.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"bin": "./bin/gamut.mjs",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@codecademy/gamut-icons": "9.57.10-alpha.
|
|
9
|
-
"@codecademy/gamut-illustrations": "0.58.16-alpha.
|
|
10
|
-
"@codecademy/gamut-patterns": "0.10.35-alpha.
|
|
11
|
-
"@codecademy/gamut-styles": "20.0.3-alpha.
|
|
12
|
-
"@codecademy/variance": "0.26.2-alpha.
|
|
8
|
+
"@codecademy/gamut-icons": "9.57.10-alpha.f0a032.0",
|
|
9
|
+
"@codecademy/gamut-illustrations": "0.58.16-alpha.f0a032.0",
|
|
10
|
+
"@codecademy/gamut-patterns": "0.10.35-alpha.f0a032.0",
|
|
11
|
+
"@codecademy/gamut-styles": "20.0.3-alpha.f0a032.0",
|
|
12
|
+
"@codecademy/variance": "0.26.2-alpha.f0a032.0",
|
|
13
13
|
"@formatjs/intl-locale": "5.3.1",
|
|
14
14
|
"@react-aria/interactions": "3.25.0",
|
|
15
15
|
"@types/marked": "^4.0.8",
|
|
File without changes
|