@codecademy/gamut 68.1.2 → 68.1.3-alpha.090a30.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/Alert/elements.d.ts +4 -4
- package/dist/Anchor/index.d.ts +18 -9
- package/dist/Anchor/index.js +9 -6
- package/dist/Box/Box.d.ts +1 -1
- package/dist/Box/FlexBox.d.ts +1 -1
- package/dist/Box/GridBox.d.ts +1 -1
- package/dist/Box/props.d.ts +1 -1
- package/dist/Button/CTAButton.d.ts +2 -2
- package/dist/Button/FillButton.d.ts +4 -4
- package/dist/Button/IconButton.d.ts +4 -4
- package/dist/Button/StrokeButton.d.ts +4 -4
- package/dist/Button/TextButton.d.ts +4 -4
- package/dist/Button/shared/InlineIconButton.d.ts +2 -2
- package/dist/Button/shared/styles.d.ts +3 -3
- package/dist/Button/shared/types.d.ts +1 -1
- package/dist/ButtonBase/ButtonBase.d.ts +9 -4
- package/dist/ButtonBase/ButtonBase.js +11 -4
- package/dist/Card/elements.d.ts +187 -139
- package/dist/Card/styles.d.ts +8 -8
- package/dist/Coachmark/index.d.ts +1 -1
- package/dist/ConnectedForm/ConnectedForm.d.ts +1 -1
- package/dist/ConnectedForm/utils.d.ts +2 -2
- package/dist/ContentContainer/index.d.ts +1 -1
- package/dist/Disclosure/elements.d.ts +20 -14
- package/dist/FeatureShimmer/index.js +1 -1
- package/dist/Form/SelectDropdown/elements/controls.js +2 -2
- package/dist/Form/SelectDropdown/elements/multi-value.js +2 -2
- package/dist/Form/SelectDropdown/types/internal.d.ts +2 -2
- package/dist/Form/elements/Form.d.ts +15 -15
- package/dist/Form/elements/FormGroup.d.ts +2 -2
- package/dist/GridForm/GridFormButtons/index.d.ts +4 -4
- package/dist/InternalFloatingCard/InternalFloatingCard.d.ts +1 -1
- package/dist/Layout/Column.d.ts +1 -1
- package/dist/Layout/LayoutGrid.d.ts +1 -1
- package/dist/List/ListProvider.d.ts +1 -1
- package/dist/List/elements.d.ts +75 -59
- package/dist/List/hooks.d.ts +1 -1
- package/dist/Menu/Menu.d.ts +1 -1
- package/dist/Menu/MenuItem.js +10 -6
- package/dist/Menu/elements.d.ts +4 -4
- package/dist/Modals/elements.d.ts +1 -1
- package/dist/Pagination/AnimatedPaginationButtons.d.ts +61 -45
- package/dist/Pagination/EllipsisButton.d.ts +4 -4
- package/dist/Pagination/PaginationButton.d.ts +6 -6
- package/dist/Pagination/utils.d.ts +59 -43
- package/dist/Pagination/utils.js +14 -11
- package/dist/Popover/Popover.js +4 -4
- package/dist/Popover/elements.d.ts +2 -2
- package/dist/Popover/types.d.ts +3 -2
- package/dist/PopoverContainer/PopoverContainer.js +9 -11
- package/dist/PopoverContainer/hooks.d.ts +16 -4
- package/dist/PopoverContainer/hooks.js +31 -24
- package/dist/PopoverContainer/types.d.ts +3 -2
- package/dist/Tabs/TabButton.d.ts +2 -2
- package/dist/Tabs/TabNav.d.ts +1 -1
- package/dist/Tabs/TabNavLink.d.ts +2 -2
- package/dist/Tag/elements.d.ts +18 -12
- package/dist/Tip/InfoTip/InfoTipButton.d.ts +4 -4
- package/dist/Tip/InfoTip/styles.d.ts +1 -1
- package/dist/Tip/PreviewTip/elements.d.ts +13 -7
- package/dist/Tip/ToolTip/elements.d.ts +1 -1
- package/dist/Tip/__tests__/helpers.d.ts +3 -3
- package/dist/Tip/shared/FloatingTip.js +2 -2
- package/dist/Tip/shared/elements.d.ts +3 -3
- package/dist/Tip/shared/types.d.ts +2 -2
- package/dist/Toggle/elements.d.ts +1 -1
- package/dist/Typography/Text.d.ts +3 -3
- package/dist/utils/react.js +2 -1
- package/package.json +10 -10
|
@@ -12,8 +12,8 @@ export declare const getBackPageNumber: ({ shownPageArray, chapterSize, }: Omit<
|
|
|
12
12
|
export declare const getForwardPageNumber: ({ chapterSize, totalPages, shownPageArray, }: Omit<PaginationUtils, 'currentPage'>) => number;
|
|
13
13
|
export declare const getMinWidth: ({ chapterSize, }: Pick<PaginationUtils, 'chapterSize'>) => string;
|
|
14
14
|
export declare const wrapWithSlideAnimation: (WrappedComponent: typeof BaseEllipsisButton | typeof PaginationButton) => (props: React.ComponentProps<typeof BaseEllipsisButton>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare const createAnimatedFadeButton: (WrappedComponent: typeof PaginationButton) => (props: {
|
|
16
|
-
mode?: "
|
|
15
|
+
export declare const createAnimatedFadeButton: (WrappedComponent: typeof PaginationButton) => (props: Omit<{
|
|
16
|
+
mode?: "light" | "dark" | undefined;
|
|
17
17
|
border?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
18
18
|
readonly property: "border";
|
|
19
19
|
readonly scale: "borders";
|
|
@@ -46,8 +46,8 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
46
46
|
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
47
47
|
readonly transform: (value: string | number) => string | 0;
|
|
48
48
|
}>;
|
|
49
|
-
"aria-hidden"?: (boolean | "
|
|
50
|
-
ref?: React.
|
|
49
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
50
|
+
ref?: React.Ref<import("..").ButtonBaseElements> | undefined;
|
|
51
51
|
key?: React.Key | null | undefined;
|
|
52
52
|
defaultChecked?: boolean | undefined;
|
|
53
53
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
@@ -56,17 +56,17 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
56
56
|
accessKey?: string | undefined;
|
|
57
57
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
58
58
|
autoFocus?: boolean | undefined;
|
|
59
|
-
contentEditable?: "inherit" | (boolean | "
|
|
59
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
60
60
|
contextMenu?: string | undefined;
|
|
61
|
-
draggable?: (boolean | "
|
|
62
|
-
enterKeyHint?: "search" | "
|
|
61
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
62
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
63
63
|
hidden?: boolean | undefined;
|
|
64
64
|
id?: string | undefined;
|
|
65
65
|
lang?: string | undefined;
|
|
66
66
|
nonce?: string | undefined;
|
|
67
|
-
spellCheck?: (boolean | "
|
|
67
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
68
68
|
tabIndex?: number | undefined;
|
|
69
|
-
translate?: "
|
|
69
|
+
translate?: "yes" | "no" | undefined;
|
|
70
70
|
radioGroup?: string | undefined;
|
|
71
71
|
role?: React.AriaRole | undefined;
|
|
72
72
|
about?: string | undefined;
|
|
@@ -90,56 +90,60 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
90
90
|
results?: number | undefined;
|
|
91
91
|
security?: string | undefined;
|
|
92
92
|
unselectable?: "off" | "on" | undefined;
|
|
93
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
94
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
95
|
+
popoverTarget?: string | undefined;
|
|
96
|
+
inert?: boolean | undefined;
|
|
93
97
|
inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
94
98
|
is?: string | undefined;
|
|
95
99
|
exportparts?: string | undefined;
|
|
96
100
|
part?: string | undefined;
|
|
97
101
|
"aria-activedescendant"?: string | undefined;
|
|
98
|
-
"aria-atomic"?: (boolean | "
|
|
99
|
-
"aria-autocomplete"?: "none" | "inline" | "
|
|
102
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
103
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
100
104
|
"aria-braillelabel"?: string | undefined;
|
|
101
105
|
"aria-brailleroledescription"?: string | undefined;
|
|
102
|
-
"aria-busy"?: (boolean | "
|
|
103
|
-
"aria-checked"?: boolean | "
|
|
106
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
107
|
+
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
104
108
|
"aria-colcount"?: number | undefined;
|
|
105
109
|
"aria-colindex"?: number | undefined;
|
|
106
110
|
"aria-colindextext"?: string | undefined;
|
|
107
111
|
"aria-colspan"?: number | undefined;
|
|
108
112
|
"aria-controls"?: string | undefined;
|
|
109
|
-
"aria-current"?: boolean | "time" | "page" | "
|
|
113
|
+
"aria-current"?: boolean | "time" | "page" | "true" | "false" | "step" | "location" | "date" | undefined;
|
|
110
114
|
"aria-describedby"?: string | undefined;
|
|
111
115
|
"aria-description"?: string | undefined;
|
|
112
116
|
"aria-details"?: string | undefined;
|
|
113
|
-
"aria-disabled"?: (boolean | "
|
|
117
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
114
118
|
"aria-dropeffect"?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
115
119
|
"aria-errormessage"?: string | undefined;
|
|
116
|
-
"aria-expanded"?: (boolean | "
|
|
120
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
117
121
|
"aria-flowto"?: string | undefined;
|
|
118
|
-
"aria-grabbed"?: (boolean | "
|
|
119
|
-
"aria-haspopup"?: boolean | "dialog" | "menu" | "grid" | "
|
|
120
|
-
"aria-invalid"?: boolean | "
|
|
122
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
123
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree" | undefined;
|
|
124
|
+
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
121
125
|
"aria-keyshortcuts"?: string | undefined;
|
|
122
126
|
"aria-label"?: string | undefined;
|
|
123
127
|
"aria-labelledby"?: string | undefined;
|
|
124
128
|
"aria-level"?: number | undefined;
|
|
125
129
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
126
|
-
"aria-modal"?: (boolean | "
|
|
127
|
-
"aria-multiline"?: (boolean | "
|
|
128
|
-
"aria-multiselectable"?: (boolean | "
|
|
130
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
131
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
132
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
129
133
|
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
130
134
|
"aria-owns"?: string | undefined;
|
|
131
135
|
"aria-placeholder"?: string | undefined;
|
|
132
136
|
"aria-posinset"?: number | undefined;
|
|
133
|
-
"aria-pressed"?: boolean | "
|
|
134
|
-
"aria-readonly"?: (boolean | "
|
|
137
|
+
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
138
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
135
139
|
"aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
136
|
-
"aria-required"?: (boolean | "
|
|
140
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
137
141
|
"aria-roledescription"?: string | undefined;
|
|
138
142
|
"aria-rowcount"?: number | undefined;
|
|
139
143
|
"aria-rowindex"?: number | undefined;
|
|
140
144
|
"aria-rowindextext"?: string | undefined;
|
|
141
145
|
"aria-rowspan"?: number | undefined;
|
|
142
|
-
"aria-selected"?: (boolean | "
|
|
146
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
143
147
|
"aria-setsize"?: number | undefined;
|
|
144
148
|
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
145
149
|
"aria-valuemax"?: number | undefined;
|
|
@@ -165,18 +169,18 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
165
169
|
onFocusCapture?: React.FocusEventHandler<HTMLButtonElement> | (React.FocusEventHandler<HTMLButtonElement> & React.FocusEventHandler<HTMLAnchorElement>) | undefined;
|
|
166
170
|
onBlur?: React.FocusEventHandler<HTMLButtonElement> | (React.FocusEventHandler<HTMLButtonElement> & React.FocusEventHandler<HTMLAnchorElement>) | undefined;
|
|
167
171
|
onBlurCapture?: React.FocusEventHandler<HTMLButtonElement> | (React.FocusEventHandler<HTMLButtonElement> & React.FocusEventHandler<HTMLAnchorElement>) | undefined;
|
|
168
|
-
onChange?: React.
|
|
169
|
-
onChangeCapture?: React.
|
|
172
|
+
onChange?: React.ChangeEventHandler<HTMLButtonElement, Element> | (React.ChangeEventHandler<HTMLButtonElement, Element> & React.ChangeEventHandler<HTMLAnchorElement, Element>) | undefined;
|
|
173
|
+
onChangeCapture?: React.ChangeEventHandler<HTMLButtonElement, Element> | (React.ChangeEventHandler<HTMLButtonElement, Element> & React.ChangeEventHandler<HTMLAnchorElement, Element>) | undefined;
|
|
170
174
|
onBeforeInput?: React.InputEventHandler<HTMLButtonElement> | (React.InputEventHandler<HTMLButtonElement> & React.InputEventHandler<HTMLAnchorElement>) | undefined;
|
|
171
|
-
onBeforeInputCapture?: React.
|
|
172
|
-
onInput?: React.
|
|
173
|
-
onInputCapture?: React.
|
|
174
|
-
onReset?: React.
|
|
175
|
-
onResetCapture?: React.
|
|
176
|
-
onSubmit?: React.
|
|
177
|
-
onSubmitCapture?: React.
|
|
178
|
-
onInvalid?: React.
|
|
179
|
-
onInvalidCapture?: React.
|
|
175
|
+
onBeforeInputCapture?: React.InputEventHandler<HTMLButtonElement> | (React.InputEventHandler<HTMLButtonElement> & React.InputEventHandler<HTMLAnchorElement>) | undefined;
|
|
176
|
+
onInput?: React.InputEventHandler<HTMLButtonElement> | (React.InputEventHandler<HTMLButtonElement> & React.InputEventHandler<HTMLAnchorElement>) | undefined;
|
|
177
|
+
onInputCapture?: React.InputEventHandler<HTMLButtonElement> | (React.InputEventHandler<HTMLButtonElement> & React.InputEventHandler<HTMLAnchorElement>) | undefined;
|
|
178
|
+
onReset?: React.ReactEventHandler<HTMLButtonElement> | (React.ReactEventHandler<HTMLButtonElement> & React.ReactEventHandler<HTMLAnchorElement>) | undefined;
|
|
179
|
+
onResetCapture?: React.ReactEventHandler<HTMLButtonElement> | (React.ReactEventHandler<HTMLButtonElement> & React.ReactEventHandler<HTMLAnchorElement>) | undefined;
|
|
180
|
+
onSubmit?: React.SubmitEventHandler<HTMLButtonElement> | (React.SubmitEventHandler<HTMLButtonElement> & React.SubmitEventHandler<HTMLAnchorElement>) | undefined;
|
|
181
|
+
onSubmitCapture?: React.SubmitEventHandler<HTMLButtonElement> | (React.SubmitEventHandler<HTMLButtonElement> & React.SubmitEventHandler<HTMLAnchorElement>) | undefined;
|
|
182
|
+
onInvalid?: React.ReactEventHandler<HTMLButtonElement> | (React.ReactEventHandler<HTMLButtonElement> & React.ReactEventHandler<HTMLAnchorElement>) | undefined;
|
|
183
|
+
onInvalidCapture?: React.ReactEventHandler<HTMLButtonElement> | (React.ReactEventHandler<HTMLButtonElement> & React.ReactEventHandler<HTMLAnchorElement>) | undefined;
|
|
180
184
|
onLoad?: React.ReactEventHandler<HTMLButtonElement> | (React.ReactEventHandler<HTMLButtonElement> & React.ReactEventHandler<HTMLAnchorElement>) | undefined;
|
|
181
185
|
onLoadCapture?: React.ReactEventHandler<HTMLButtonElement> | (React.ReactEventHandler<HTMLButtonElement> & React.ReactEventHandler<HTMLAnchorElement>) | undefined;
|
|
182
186
|
onError?: React.ReactEventHandler<HTMLButtonElement> | (React.ReactEventHandler<HTMLButtonElement> & React.ReactEventHandler<HTMLAnchorElement>) | undefined;
|
|
@@ -294,6 +298,8 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
294
298
|
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLButtonElement> | (React.PointerEventHandler<HTMLButtonElement> & React.PointerEventHandler<HTMLAnchorElement>) | undefined;
|
|
295
299
|
onScroll?: React.UIEventHandler<HTMLButtonElement> | (React.UIEventHandler<HTMLButtonElement> & React.UIEventHandler<HTMLAnchorElement>) | undefined;
|
|
296
300
|
onScrollCapture?: React.UIEventHandler<HTMLButtonElement> | (React.UIEventHandler<HTMLButtonElement> & React.UIEventHandler<HTMLAnchorElement>) | undefined;
|
|
301
|
+
onScrollEnd?: React.UIEventHandler<HTMLButtonElement> | (React.UIEventHandler<HTMLButtonElement> & React.UIEventHandler<HTMLAnchorElement>) | undefined;
|
|
302
|
+
onScrollEndCapture?: React.UIEventHandler<HTMLButtonElement> | (React.UIEventHandler<HTMLButtonElement> & React.UIEventHandler<HTMLAnchorElement>) | undefined;
|
|
297
303
|
onWheel?: React.WheelEventHandler<HTMLButtonElement> | (React.WheelEventHandler<HTMLButtonElement> & React.WheelEventHandler<HTMLAnchorElement>) | undefined;
|
|
298
304
|
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement> | (React.WheelEventHandler<HTMLButtonElement> & React.WheelEventHandler<HTMLAnchorElement>) | undefined;
|
|
299
305
|
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement> | (React.AnimationEventHandler<HTMLButtonElement> & React.AnimationEventHandler<HTMLAnchorElement>) | undefined;
|
|
@@ -301,8 +307,16 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
301
307
|
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement> | (React.AnimationEventHandler<HTMLButtonElement> & React.AnimationEventHandler<HTMLAnchorElement>) | undefined;
|
|
302
308
|
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement> | (React.AnimationEventHandler<HTMLButtonElement> & React.AnimationEventHandler<HTMLAnchorElement>) | undefined;
|
|
303
309
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | (React.AnimationEventHandler<HTMLButtonElement> & React.AnimationEventHandler<HTMLAnchorElement>) | undefined;
|
|
310
|
+
onToggle?: React.ToggleEventHandler<HTMLButtonElement> | (React.ToggleEventHandler<HTMLButtonElement> & React.ToggleEventHandler<HTMLAnchorElement>) | undefined;
|
|
311
|
+
onBeforeToggle?: React.ToggleEventHandler<HTMLButtonElement> | (React.ToggleEventHandler<HTMLButtonElement> & React.ToggleEventHandler<HTMLAnchorElement>) | undefined;
|
|
312
|
+
onTransitionCancel?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
313
|
+
onTransitionCancelCapture?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
304
314
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
305
315
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
316
|
+
onTransitionRun?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
317
|
+
onTransitionRunCapture?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
318
|
+
onTransitionStart?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
319
|
+
onTransitionStartCapture?: React.TransitionEventHandler<HTMLButtonElement> | (React.TransitionEventHandler<HTMLButtonElement> & React.TransitionEventHandler<HTMLAnchorElement>) | undefined;
|
|
306
320
|
alignSelf?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
307
321
|
readonly property: "alignSelf";
|
|
308
322
|
}>;
|
|
@@ -495,11 +509,7 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
495
509
|
overflow?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
496
510
|
readonly property: "overflow";
|
|
497
511
|
}>;
|
|
498
|
-
size?: "small" | "normal" | "large" | undefined;
|
|
499
|
-
type?: "button" | "reset" | "submit" | undefined;
|
|
500
512
|
href?: string | undefined;
|
|
501
|
-
icon?: React.ComponentType<import("@codecademy/gamut-icons").GamutIconProps> | undefined;
|
|
502
|
-
ellipsis?: boolean | undefined;
|
|
503
513
|
px?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
504
514
|
readonly property: "padding";
|
|
505
515
|
readonly properties: {
|
|
@@ -788,15 +798,21 @@ export declare const createAnimatedFadeButton: (WrappedComponent: typeof Paginat
|
|
|
788
798
|
readonly transform: (value: string | number) => string | 0;
|
|
789
799
|
}>;
|
|
790
800
|
theme?: import("@emotion/react").Theme | undefined;
|
|
801
|
+
size?: "small" | "normal" | "large" | undefined;
|
|
791
802
|
variant?: "primary" | "secondary" | "danger" | "interface" | undefined;
|
|
792
803
|
as?: undefined;
|
|
793
|
-
formAction?: string | undefined;
|
|
804
|
+
formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
|
|
794
805
|
formEncType?: string | undefined;
|
|
795
806
|
formMethod?: string | undefined;
|
|
796
807
|
formNoValidate?: boolean | undefined;
|
|
797
808
|
formTarget?: string | undefined;
|
|
809
|
+
type?: "button" | "submit" | "reset" | undefined;
|
|
798
810
|
value?: string | number | readonly string[] | undefined;
|
|
811
|
+
icon?: React.ComponentType<import("@codecademy/gamut-icons").GamutIconProps> | undefined;
|
|
812
|
+
ellipsis?: boolean | undefined;
|
|
799
813
|
buttonType?: "text" | "stroke" | undefined;
|
|
800
814
|
showButton?: "hidden" | "shown" | undefined;
|
|
801
|
-
} & import("framer-motion").
|
|
815
|
+
} & import("framer-motion/dist/types.d-DOCC-kZB").M, "children"> & {
|
|
816
|
+
children?: React.ReactNode | import("motion-dom").MotionValue<number> | import("motion-dom").MotionValue<string>;
|
|
817
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
802
818
|
export {};
|
package/dist/Pagination/utils.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { timingValues } from '@codecademy/gamut-styles';
|
|
1
2
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
2
3
|
import { useEffect, useRef } from 'react';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const FADE_DURATION_SECONDS = timingValues.base / 1000;
|
|
5
7
|
export const shouldPagesChange = ({
|
|
6
8
|
chapterSize,
|
|
7
9
|
currentPage,
|
|
@@ -49,7 +51,7 @@ export const wrapWithSlideAnimation = WrappedComponent => {
|
|
|
49
51
|
exit: "hidden",
|
|
50
52
|
initial: props.buttonDirection === 'forward' && isFirstRender.current ? 'shown' : 'hidden',
|
|
51
53
|
transition: {
|
|
52
|
-
duration:
|
|
54
|
+
duration: FADE_DURATION_SECONDS
|
|
53
55
|
},
|
|
54
56
|
variants: slideAnimationVariants,
|
|
55
57
|
children: /*#__PURE__*/_jsx(WrappedComponent, {
|
|
@@ -69,6 +71,16 @@ const fadeAnimationVariants = {
|
|
|
69
71
|
cursor: 'default'
|
|
70
72
|
}
|
|
71
73
|
};
|
|
74
|
+
const fadeTransition = {
|
|
75
|
+
duration: FADE_DURATION_SECONDS,
|
|
76
|
+
ease: 'easeOut',
|
|
77
|
+
transitionStart: {
|
|
78
|
+
visibility: 'visible'
|
|
79
|
+
},
|
|
80
|
+
transitionEnd: {
|
|
81
|
+
visibility: 'hidden'
|
|
82
|
+
}
|
|
83
|
+
};
|
|
72
84
|
export const createAnimatedFadeButton = WrappedComponent => {
|
|
73
85
|
const AnimatedButton = motion.create(WrappedComponent);
|
|
74
86
|
return props => /*#__PURE__*/_jsx(AnimatedButton, {
|
|
@@ -76,16 +88,7 @@ export const createAnimatedFadeButton = WrappedComponent => {
|
|
|
76
88
|
"aria-label": props.showButton === 'hidden' ? undefined : props['aria-label'],
|
|
77
89
|
disabled: props.showButton === 'hidden',
|
|
78
90
|
initial: false,
|
|
79
|
-
transition:
|
|
80
|
-
transitionStart: {
|
|
81
|
-
visibility: 'visible'
|
|
82
|
-
},
|
|
83
|
-
duration: 0.3,
|
|
84
|
-
ease: [0.04, 0.62, 0.23, 0.98],
|
|
85
|
-
transitionEnd: {
|
|
86
|
-
visibility: 'hidden'
|
|
87
|
-
}
|
|
88
|
-
},
|
|
91
|
+
transition: fadeTransition,
|
|
89
92
|
variants: fadeAnimationVariants,
|
|
90
93
|
...props
|
|
91
94
|
});
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { useWindowScroll, useWindowSize } from 'react-use';
|
|
3
3
|
import { FocusTrap } from '../FocusTrap';
|
|
4
|
-
import { useResizingParentEffect, useScrollingParentsEffect } from '../PopoverContainer/hooks';
|
|
4
|
+
import { getRefElement, useResizingParentEffect, useScrollingParentsEffect } from '../PopoverContainer/hooks';
|
|
5
5
|
import { Beak, BeakBox, PatternContainer, PopoverContainer, PopoverPortal, RaisedDiv } from './elements';
|
|
6
6
|
import { getBeakVariant } from './styles/beak';
|
|
7
7
|
import { getDefaultOffset } from './utils';
|
|
@@ -100,10 +100,10 @@ export const Popover = ({
|
|
|
100
100
|
};
|
|
101
101
|
}, [align, horizontalOffset, popoverHeight, popoverWidth, position, targetRect, verticalOffset]);
|
|
102
102
|
useEffect(() => {
|
|
103
|
-
setTargetRect(targetRef?.
|
|
103
|
+
setTargetRect(getRefElement(targetRef)?.getBoundingClientRect());
|
|
104
104
|
}, [targetRef, isOpen, width, height, x, y]);
|
|
105
105
|
const updateTargetPosition = useCallback(rect => {
|
|
106
|
-
const target = targetRef
|
|
106
|
+
const target = getRefElement(targetRef);
|
|
107
107
|
if (!target) return;
|
|
108
108
|
const newRect = rect || target.getBoundingClientRect();
|
|
109
109
|
setTargetRect(newRect);
|
|
@@ -119,7 +119,7 @@ export const Popover = ({
|
|
|
119
119
|
}, [targetRect, isInViewport, onRequestClose]);
|
|
120
120
|
const handleClickOutside = useCallback(e => {
|
|
121
121
|
const target = e.target;
|
|
122
|
-
const targetElement = targetRef
|
|
122
|
+
const targetElement = getRefElement(targetRef);
|
|
123
123
|
if (!targetElement) return;
|
|
124
124
|
|
|
125
125
|
/**
|
|
@@ -15,7 +15,7 @@ export declare const RaisedDiv: import("@emotion/styled").StyledComponent<{
|
|
|
15
15
|
export declare const Beak: import("@emotion/styled").StyledComponent<{
|
|
16
16
|
theme?: import("@emotion/react").Theme | undefined;
|
|
17
17
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
18
|
-
} & import("../Box").BoxProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | keyof import("react").ClassAttributes<HTMLDivElement> | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "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-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
|
|
18
|
+
} & import("../Box").BoxProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | keyof import("react").ClassAttributes<HTMLDivElement> | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "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-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture"> & {
|
|
19
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
20
20
|
} & Partial<Record<"widthRestricted", boolean>> & {
|
|
21
21
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -23,7 +23,7 @@ export declare const Beak: import("@emotion/styled").StyledComponent<{
|
|
|
23
23
|
export declare const BeakBox: import("@emotion/styled").StyledComponent<{
|
|
24
24
|
theme?: import("@emotion/react").Theme | undefined;
|
|
25
25
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
26
|
-
} & import("../Box").FlexBoxProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | keyof import("react").ClassAttributes<HTMLDivElement> | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "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-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
|
|
26
|
+
} & import("../Box").FlexBoxProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | keyof import("react").ClassAttributes<HTMLDivElement> | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "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-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture"> & {
|
|
27
27
|
theme?: import("@emotion/react").Theme | undefined;
|
|
28
28
|
} & import("@codecademy/variance/dist/types/config").VariantProps<"variant", false | "center" | "above" | "below"> & {
|
|
29
29
|
theme?: import("@emotion/react").Theme | undefined;
|
package/dist/Popover/types.d.ts
CHANGED
|
@@ -83,12 +83,13 @@ export type PopoverProps = PopoverBaseProps & PopoverVariants & Pick<HTMLAttribu
|
|
|
83
83
|
isOpen: boolean;
|
|
84
84
|
/**
|
|
85
85
|
* The target element around which the popover will be positioned.
|
|
86
|
+
* Only ref objects (e.g. from useRef) are supported at runtime; RefCallback is not.
|
|
86
87
|
*/
|
|
87
|
-
targetRef: React.
|
|
88
|
+
targetRef: React.Ref<HTMLElement | null>;
|
|
88
89
|
/**
|
|
89
90
|
* The PopoverContainer which contents will be rendered into.
|
|
90
91
|
*/
|
|
91
|
-
popoverContainerRef?: React.
|
|
92
|
+
popoverContainerRef?: React.Ref<HTMLDivElement | null>;
|
|
92
93
|
/**
|
|
93
94
|
* Whether to add width restrictions to Popover.
|
|
94
95
|
*/
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import { useWindowScroll, useWindowSize } from 'react-use';
|
|
7
7
|
import { BodyPortal } from '../BodyPortal';
|
|
8
8
|
import { FocusTrap } from '../FocusTrap';
|
|
9
|
-
import { useResizingParentEffect, useScrollingParents, useScrollingParentsEffect } from './hooks';
|
|
9
|
+
import { getRefElement, getTargetAsElement, useResizingParentEffect, useScrollingParents, useScrollingParentsEffect } from './hooks';
|
|
10
10
|
import { getContainers, getPosition, isOutOfView } from './utils';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const PopoverContent = /*#__PURE__*/_styled("div", {
|
|
@@ -16,7 +16,7 @@ const PopoverContent = /*#__PURE__*/_styled("div", {
|
|
|
16
16
|
transform: {
|
|
17
17
|
property: 'transform'
|
|
18
18
|
}
|
|
19
|
-
})), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Qb3BvdmVyQ29udGFpbmVyL1BvcG92ZXJDb250YWluZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlCdUIiLCJmaWxlIjoiLi4vLi4vc3JjL1BvcG92ZXJDb250YWluZXIvUG9wb3ZlckNvbnRhaW5lci50c3giLCJzb3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BhbGxvd1BhZ2VJbnRlcmFjdGlvbj17aW5saW5lIHx8IGFsbG93UGFnZUludGVyYWN0aW9ufVxuICAgICAgb25DbGlja091dHNpZGU9e2hhbmRsZUNsaWNrT3V0c2lkZX1cbiAgICAgIG9uRXNjYXBlS2V5PXtvblJlcXVlc3RDbG9zZX1cbiAgICA+XG4gICAgICA8UG9wb3ZlckNvbnRlbnRcbiAgICAgICAgZGF0YS1mbG9hdGluZz1cInBvcG92ZXJcIlxuICAgICAgICBkYXRhLXRlc3RpZD1cInBvcG92ZXItY29udGVudC1jb250YWluZXJcIlxuICAgICAgICBwb3NpdGlvbj1cImFic29sdXRlXCJcbiAgICAgICAgcmVmPXtwb3BvdmVyUmVmfVxuICAgICAgICB0YWJJbmRleD17LTF9XG4gICAgICAgIHpJbmRleD17aW5saW5lID8gNSA6ICdpbml0aWFsJ31cbiAgICAgICAgey4uLnBvcG92ZXJQb3NpdGlvbi5zdHlsZXN9XG4gICAgICAgIC8qIFBoeXNpY2FsIGlubGluZSBzdHlsZSBmb3IgY2VudGVyZWQgYWxpZ25tZW50cyAodG9wL2JvdHRvbSkgd2hlcmVcbiAgICAgICAgICAgaW5zZXQtaW5saW5lLXN0YXJ0IHdvdWxkIGluY29ycmVjdGx5IGZsaXAgdGhlIGNlbnRlciBwb2ludCBpbiBSVEwgKi9cbiAgICAgICAgLyogZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGdhbXV0L25vLWlubGluZS1zdHlsZSAqL1xuICAgICAgICBzdHlsZT17cG9wb3ZlclBvc2l0aW9uLnBoeXNpY2FsU3R5bGVzfVxuICAgICAgICB7Li4ucmVzdH1cbiAgICAgIC8+XG4gICAgPC9Gb2N1c1RyYXA+XG4gICk7XG5cbiAgaWYgKGlubGluZSkgcmV0dXJuIGNvbnRlbnQ7XG5cbiAgcmV0dXJuIDxCb2R5UG9ydGFsPntjb250ZW50fTwvQm9keVBvcnRhbD47XG59O1xuIl19 */");
|
|
19
|
+
})), process.env.NODE_ENV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aW50LWRpc2FibGUtbmV4dC1saW5lIGdhbXV0L25vLWlubGluZS1zdHlsZSAqL1xuICAgICAgICBzdHlsZT17cG9wb3ZlclBvc2l0aW9uLnBoeXNpY2FsU3R5bGVzfVxuICAgICAgICB7Li4ucmVzdH1cbiAgICAgIC8+XG4gICAgPC9Gb2N1c1RyYXA+XG4gICk7XG5cbiAgaWYgKGlubGluZSkgcmV0dXJuIGNvbnRlbnQ7XG5cbiAgcmV0dXJuIDxCb2R5UG9ydGFsPntjb250ZW50fTwvQm9keVBvcnRhbD47XG59O1xuIl19 */");
|
|
20
20
|
export const PopoverContainer = ({
|
|
21
21
|
alignment = 'bottom-left',
|
|
22
22
|
offset = 20,
|
|
@@ -45,8 +45,6 @@ export const PopoverContainer = ({
|
|
|
45
45
|
const [containers, setContainers] = useState();
|
|
46
46
|
const [targetRect, setTargetRect] = useState();
|
|
47
47
|
const parent = containers?.parent;
|
|
48
|
-
|
|
49
|
-
// Memoize scrolling parents to avoid expensive DOM traversals
|
|
50
48
|
const scrollingParents = useScrollingParents(targetRef);
|
|
51
49
|
|
|
52
50
|
// Keep onRequestClose ref up to date
|
|
@@ -59,7 +57,7 @@ export const PopoverContainer = ({
|
|
|
59
57
|
const [isRtl, setIsRtl] = useState(false);
|
|
60
58
|
useEffect(() => {
|
|
61
59
|
const checkDirection = () => {
|
|
62
|
-
const target = targetRef
|
|
60
|
+
const target = getRefElement(targetRef);
|
|
63
61
|
const el = target instanceof Element ? target : document.documentElement;
|
|
64
62
|
setIsRtl(getComputedStyle(el).direction === 'rtl');
|
|
65
63
|
};
|
|
@@ -90,7 +88,7 @@ export const PopoverContainer = ({
|
|
|
90
88
|
};
|
|
91
89
|
}, [parent, x, y, offset, alignment, invertAxis, isRtl]);
|
|
92
90
|
useEffect(() => {
|
|
93
|
-
const target = targetRef
|
|
91
|
+
const target = getRefElement(targetRef);
|
|
94
92
|
if (!target) return;
|
|
95
93
|
setContainers(getContainers(target, inline, {
|
|
96
94
|
x: winX,
|
|
@@ -100,12 +98,12 @@ export const PopoverContainer = ({
|
|
|
100
98
|
|
|
101
99
|
// Update target rectangle when window size/scroll changes
|
|
102
100
|
useEffect(() => {
|
|
103
|
-
setTargetRect(targetRef?.
|
|
101
|
+
setTargetRect(getRefElement(targetRef)?.getBoundingClientRect());
|
|
104
102
|
}, [targetRef, isOpen, winW, winH, winX, winY]);
|
|
105
103
|
|
|
106
104
|
// Update target rectangle when parent size/scroll changes
|
|
107
105
|
const updateTargetPosition = useCallback(rect => {
|
|
108
|
-
const target = targetRef
|
|
106
|
+
const target = getRefElement(targetRef);
|
|
109
107
|
if (!target) return;
|
|
110
108
|
const newRect = rect || target.getBoundingClientRect();
|
|
111
109
|
setTargetRect(newRect);
|
|
@@ -124,7 +122,7 @@ export const PopoverContainer = ({
|
|
|
124
122
|
if (!closeOnViewportExit) return;
|
|
125
123
|
const rect = targetRect || containers?.viewport;
|
|
126
124
|
if (!rect) return;
|
|
127
|
-
const isOut = isOutOfView(rect, targetRef
|
|
125
|
+
const isOut = isOutOfView(rect, getTargetAsElement(getRefElement(targetRef)) ?? undefined, scrollingParents);
|
|
128
126
|
if (isOut && !hasRequestedCloseRef.current) {
|
|
129
127
|
hasRequestedCloseRef.current = true;
|
|
130
128
|
onRequestCloseRef.current?.();
|
|
@@ -139,7 +137,7 @@ export const PopoverContainer = ({
|
|
|
139
137
|
*/
|
|
140
138
|
const handleClickOutside = useCallback(e => {
|
|
141
139
|
const target = e.target;
|
|
142
|
-
const targetElement = targetRef
|
|
140
|
+
const targetElement = getRefElement(targetRef);
|
|
143
141
|
if (!targetElement) return;
|
|
144
142
|
if (targetElement.contains(target)) return;
|
|
145
143
|
if (popoverRef.current?.contains(target)) return;
|
|
@@ -154,7 +152,7 @@ export const PopoverContainer = ({
|
|
|
154
152
|
*/
|
|
155
153
|
const handleGlobalClickOutside = useCallback(e => {
|
|
156
154
|
const target = e.target;
|
|
157
|
-
const targetElement = targetRef
|
|
155
|
+
const targetElement = getRefElement(targetRef);
|
|
158
156
|
if (!targetElement || !isOpen) return;
|
|
159
157
|
if (targetElement.contains(target) || popoverRef.current?.contains(target)) return;
|
|
160
158
|
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Minimal element shape required for popover positioning.
|
|
4
|
+
* Accepts both HTMLElement and TargetRef so Popover and PopoverContainer can share hooks.
|
|
5
|
+
*/
|
|
6
|
+
export interface PopoverTargetElement {
|
|
7
|
+
getBoundingClientRect(): DOMRect;
|
|
8
|
+
contains(other: Node | null): boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Resolves Ref to current element; returns null for RefCallback or null ref. */
|
|
11
|
+
export declare function getRefElement(ref: React.Ref<PopoverTargetElement | null>): PopoverTargetElement | null;
|
|
12
|
+
/** Casts minimal target to HTMLElement for utils that need full DOM (e.g. parentElement). */
|
|
13
|
+
export declare function getTargetAsElement(target: PopoverTargetElement | null): HTMLElement | null;
|
|
14
|
+
export declare const useScrollingParentsEffect: (targetRef: React.Ref<PopoverTargetElement | null>, setTargetRect: (rect: DOMRect | undefined) => void) => void;
|
|
15
|
+
export declare const useResizingParentEffect: (targetRef: React.Ref<PopoverTargetElement | null>, setTargetRect: (rect: DOMRect | undefined) => void) => void;
|
|
3
16
|
/**
|
|
4
17
|
* Memoizes the list of scrolling parent elements for a target element.
|
|
5
|
-
* This avoids expensive DOM traversals and getComputedStyle calls on every render.
|
|
6
18
|
* Returns an empty array if the target element is not available.
|
|
7
19
|
*/
|
|
8
|
-
export declare const useScrollingParents: (targetRef: React.
|
|
20
|
+
export declare const useScrollingParents: (targetRef: React.Ref<PopoverTargetElement | null>) => HTMLElement[];
|