@openedx/paragon 22.6.1 → 22.8.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/Chip/ChipIcon.d.ts +11 -6
- package/dist/Chip/ChipIcon.js +0 -2
- package/dist/Chip/ChipIcon.js.map +1 -1
- package/dist/Chip/constants.d.ts +4 -0
- package/dist/Chip/constants.js +3 -2
- package/dist/Chip/constants.js.map +1 -0
- package/dist/Chip/index.d.ts +2 -1
- package/dist/Chip/index.js +0 -2
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js +0 -2
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/Container/index.d.ts +16 -0
- package/dist/Container/index.js +15 -13
- package/dist/Container/index.js.map +1 -1
- package/dist/IconButton/index.d.ts +344 -0
- package/dist/IconButton/index.js +17 -25
- package/dist/IconButton/index.js.map +1 -1
- package/dist/Menu/SelectMenu.js +9 -4
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Overlay/index.d.ts +128 -0
- package/dist/Overlay/index.js +5 -0
- package/dist/Overlay/index.js.map +1 -1
- package/dist/Tooltip/index.d.ts +7 -0
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/Chip/{Chip.test.jsx → Chip.test.tsx} +5 -7
- package/src/Chip/ChipIcon.tsx +7 -7
- package/src/Chip/{constants.js → constants.ts} +1 -1
- package/src/Chip/index.tsx +1 -3
- package/src/ChipCarousel/index.tsx +0 -2
- package/src/Container/{Container.test.jsx → Container.test.tsx} +14 -8
- package/src/Container/README.md +4 -0
- package/src/Container/index.tsx +64 -0
- package/src/IconButton/{IconButton.test.jsx → IconButton.test.tsx} +24 -3
- package/src/IconButton/__snapshots__/IconButton.test.tsx.snap +112 -0
- package/src/IconButton/{index.jsx → index.tsx} +62 -22
- package/src/Menu/SelectMenu.jsx +5 -0
- package/src/Menu/SelectMenu.test.jsx +6 -0
- package/src/Menu/select-menu.md +8 -0
- package/src/Overlay/{index.jsx → index.tsx} +10 -6
- package/src/Tooltip/{index.jsx → index.tsx} +9 -3
- package/src/index.d.ts +4 -4
- package/src/index.js +3 -3
- package/src/Container/index.jsx +0 -49
- package/src/IconButton/__snapshots__/IconButton.test.jsx.snap +0 -43
- /package/src/Chip/__snapshots__/{Chip.test.jsx.snap → Chip.test.tsx.snap} +0 -0
- /package/src/Tooltip/{Tooltip.test.jsx → Tooltip.test.tsx} +0 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { type Placement } from 'react-bootstrap/Overlay';
|
|
5
|
+
import Icon from '../Icon';
|
|
6
|
+
interface Props extends React.HTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
iconAs?: typeof Icon | typeof FontAwesomeIcon;
|
|
8
|
+
/** Additional CSS class[es] to apply to this button */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Alt text for your icon. For best practice, avoid using alt text to describe
|
|
11
|
+
* the image in the `IconButton`. Instead, we recommend describing the function
|
|
12
|
+
* of the button. */
|
|
13
|
+
alt: string;
|
|
14
|
+
/** Changes icon styles for dark background */
|
|
15
|
+
invertColors?: boolean;
|
|
16
|
+
/** An icon component to render. Example import of a Paragon icon component:
|
|
17
|
+
* `import { Check } from '@openedx/paragon/icons';`
|
|
18
|
+
* */
|
|
19
|
+
src?: React.ComponentType;
|
|
20
|
+
/** Extra class names that will be added to the icon */
|
|
21
|
+
iconClassNames?: string;
|
|
22
|
+
/** Click handler for the button */
|
|
23
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
24
|
+
/** whether to show the `IconButton` in an active state, whose styling is distinct from default state */
|
|
25
|
+
isActive?: boolean;
|
|
26
|
+
/** @deprecated Using FontAwesome icons is deprecated. Instead, pass iconAs={Icon} src={...} */
|
|
27
|
+
icon?: {
|
|
28
|
+
prefix?: string;
|
|
29
|
+
iconName?: string;
|
|
30
|
+
icon?: any[];
|
|
31
|
+
};
|
|
32
|
+
/** Type of button (uses Bootstrap options) */
|
|
33
|
+
variant?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand';
|
|
34
|
+
/** size of button to render */
|
|
35
|
+
size?: 'sm' | 'md' | 'inline';
|
|
36
|
+
/** no children */
|
|
37
|
+
children?: never;
|
|
38
|
+
}
|
|
39
|
+
interface PropsWithTooltip extends Props {
|
|
40
|
+
/** choose from https://popper.js.org/docs/v2/constructors/#options */
|
|
41
|
+
tooltipPlacement: Placement;
|
|
42
|
+
/** any content to pass to tooltip content area */
|
|
43
|
+
tooltipContent: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* An icon button wrapped in overlaytrigger to display a tooltip.
|
|
47
|
+
*/
|
|
48
|
+
declare function IconButtonWithTooltip({ tooltipPlacement, tooltipContent, ...props }: PropsWithTooltip): React.JSX.Element;
|
|
49
|
+
declare namespace IconButtonWithTooltip {
|
|
50
|
+
var defaultProps: {
|
|
51
|
+
tooltipPlacement: string;
|
|
52
|
+
iconAs?: React.FC<import("../Icon").IconProps> | typeof FontAwesomeIcon | undefined;
|
|
53
|
+
className?: string | undefined;
|
|
54
|
+
alt?: string | undefined;
|
|
55
|
+
invertColors?: boolean | undefined;
|
|
56
|
+
src?: React.ComponentType<{}> | undefined;
|
|
57
|
+
iconClassNames?: string | undefined;
|
|
58
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
59
|
+
isActive?: boolean | undefined;
|
|
60
|
+
icon?: {
|
|
61
|
+
prefix?: string | undefined;
|
|
62
|
+
iconName?: string | undefined;
|
|
63
|
+
icon?: any[] | undefined;
|
|
64
|
+
} | undefined;
|
|
65
|
+
variant?: "primary" | "success" | "warning" | "secondary" | "danger" | "dark" | "light" | "black" | "brand" | undefined;
|
|
66
|
+
size?: "sm" | "md" | "inline" | undefined;
|
|
67
|
+
children?: undefined;
|
|
68
|
+
defaultChecked?: boolean | undefined;
|
|
69
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
70
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
71
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
72
|
+
accessKey?: string | undefined;
|
|
73
|
+
autoFocus?: boolean | undefined;
|
|
74
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
75
|
+
contextMenu?: string | undefined;
|
|
76
|
+
dir?: string | undefined;
|
|
77
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
78
|
+
hidden?: boolean | undefined;
|
|
79
|
+
id?: string | undefined;
|
|
80
|
+
lang?: string | undefined;
|
|
81
|
+
nonce?: string | undefined;
|
|
82
|
+
placeholder?: string | undefined;
|
|
83
|
+
slot?: string | undefined;
|
|
84
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
85
|
+
style?: React.CSSProperties | undefined;
|
|
86
|
+
tabIndex?: number | undefined;
|
|
87
|
+
title?: string | undefined;
|
|
88
|
+
translate?: "yes" | "no" | undefined;
|
|
89
|
+
radioGroup?: string | undefined;
|
|
90
|
+
role?: React.AriaRole | undefined;
|
|
91
|
+
about?: string | undefined;
|
|
92
|
+
content?: string | undefined;
|
|
93
|
+
datatype?: string | undefined;
|
|
94
|
+
inlist?: any;
|
|
95
|
+
prefix?: string | undefined;
|
|
96
|
+
property?: string | undefined;
|
|
97
|
+
rel?: string | undefined;
|
|
98
|
+
resource?: string | undefined;
|
|
99
|
+
rev?: string | undefined;
|
|
100
|
+
typeof?: string | undefined;
|
|
101
|
+
vocab?: string | undefined;
|
|
102
|
+
autoCapitalize?: string | undefined;
|
|
103
|
+
autoCorrect?: string | undefined;
|
|
104
|
+
autoSave?: string | undefined;
|
|
105
|
+
color?: string | undefined;
|
|
106
|
+
itemProp?: string | undefined;
|
|
107
|
+
itemScope?: boolean | undefined;
|
|
108
|
+
itemType?: string | undefined;
|
|
109
|
+
itemID?: string | undefined;
|
|
110
|
+
itemRef?: string | undefined;
|
|
111
|
+
results?: number | undefined;
|
|
112
|
+
security?: string | undefined;
|
|
113
|
+
unselectable?: "on" | "off" | undefined;
|
|
114
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
115
|
+
is?: string | undefined;
|
|
116
|
+
"aria-activedescendant"?: string | undefined;
|
|
117
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
118
|
+
"aria-autocomplete"?: "inline" | "list" | "none" | "both" | undefined;
|
|
119
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
120
|
+
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
121
|
+
"aria-colcount"?: number | undefined;
|
|
122
|
+
"aria-colindex"?: number | undefined;
|
|
123
|
+
"aria-colspan"?: number | undefined;
|
|
124
|
+
"aria-controls"?: string | undefined;
|
|
125
|
+
"aria-current"?: boolean | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
|
|
126
|
+
"aria-describedby"?: string | undefined;
|
|
127
|
+
"aria-details"?: string | undefined;
|
|
128
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
129
|
+
"aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
130
|
+
"aria-errormessage"?: string | undefined;
|
|
131
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
132
|
+
"aria-flowto"?: string | undefined;
|
|
133
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
134
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
135
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
136
|
+
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
137
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
138
|
+
"aria-label"?: string | undefined;
|
|
139
|
+
"aria-labelledby"?: string | undefined;
|
|
140
|
+
"aria-level"?: number | undefined;
|
|
141
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
142
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
143
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
144
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
145
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
146
|
+
"aria-owns"?: string | undefined;
|
|
147
|
+
"aria-placeholder"?: string | undefined;
|
|
148
|
+
"aria-posinset"?: number | undefined;
|
|
149
|
+
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
150
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
151
|
+
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
152
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
153
|
+
"aria-roledescription"?: string | undefined;
|
|
154
|
+
"aria-rowcount"?: number | undefined;
|
|
155
|
+
"aria-rowindex"?: number | undefined;
|
|
156
|
+
"aria-rowspan"?: number | undefined;
|
|
157
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
158
|
+
"aria-setsize"?: number | undefined;
|
|
159
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
160
|
+
"aria-valuemax"?: number | undefined;
|
|
161
|
+
"aria-valuemin"?: number | undefined;
|
|
162
|
+
"aria-valuenow"?: number | undefined;
|
|
163
|
+
"aria-valuetext"?: string | undefined;
|
|
164
|
+
dangerouslySetInnerHTML?: {
|
|
165
|
+
__html: string | TrustedHTML;
|
|
166
|
+
} | undefined;
|
|
167
|
+
onCopy?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
168
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
169
|
+
onCut?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
170
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
171
|
+
onPaste?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
172
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
173
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
174
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
175
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
176
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
177
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
178
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
179
|
+
onFocus?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
180
|
+
onFocusCapture?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
181
|
+
onBlur?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
182
|
+
onBlurCapture?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
183
|
+
onChange?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
184
|
+
onChangeCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
185
|
+
onBeforeInput?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
186
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
187
|
+
onInput?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
188
|
+
onInputCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
189
|
+
onReset?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
190
|
+
onResetCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
191
|
+
onSubmit?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
192
|
+
onSubmitCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
193
|
+
onInvalid?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
194
|
+
onInvalidCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
|
195
|
+
onLoad?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
196
|
+
onLoadCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
197
|
+
onError?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
198
|
+
onErrorCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
199
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
200
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
201
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
202
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
203
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
204
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
205
|
+
onAbort?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
206
|
+
onAbortCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
207
|
+
onCanPlay?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
208
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
209
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
210
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
211
|
+
onDurationChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
212
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
213
|
+
onEmptied?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
214
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
215
|
+
onEncrypted?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
216
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
217
|
+
onEnded?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
218
|
+
onEndedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
219
|
+
onLoadedData?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
220
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
221
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
222
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
223
|
+
onLoadStart?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
224
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
225
|
+
onPause?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
226
|
+
onPauseCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
227
|
+
onPlay?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
228
|
+
onPlayCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
229
|
+
onPlaying?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
230
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
231
|
+
onProgress?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
232
|
+
onProgressCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
233
|
+
onRateChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
234
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
235
|
+
onSeeked?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
236
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
237
|
+
onSeeking?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
238
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
239
|
+
onStalled?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
240
|
+
onStalledCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
241
|
+
onSuspend?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
242
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
243
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
244
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
245
|
+
onVolumeChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
246
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
247
|
+
onWaiting?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
248
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
249
|
+
onAuxClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
250
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
251
|
+
onClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
252
|
+
onContextMenu?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
253
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
254
|
+
onDoubleClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
255
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
256
|
+
onDrag?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
257
|
+
onDragCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
258
|
+
onDragEnd?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
259
|
+
onDragEndCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
260
|
+
onDragEnter?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
261
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
262
|
+
onDragExit?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
263
|
+
onDragExitCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
264
|
+
onDragLeave?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
265
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
266
|
+
onDragOver?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
267
|
+
onDragOverCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
268
|
+
onDragStart?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
269
|
+
onDragStartCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
270
|
+
onDrop?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
271
|
+
onDropCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
|
272
|
+
onMouseDown?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
273
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
274
|
+
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
275
|
+
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
276
|
+
onMouseMove?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
277
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
278
|
+
onMouseOut?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
279
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
280
|
+
onMouseOver?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
281
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
282
|
+
onMouseUp?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
283
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
284
|
+
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
285
|
+
onSelectCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
286
|
+
onTouchCancel?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
287
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
288
|
+
onTouchEnd?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
289
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
290
|
+
onTouchMove?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
291
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
292
|
+
onTouchStart?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
293
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
294
|
+
onPointerDown?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
295
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
296
|
+
onPointerMove?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
297
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
298
|
+
onPointerUp?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
299
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
300
|
+
onPointerCancel?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
301
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
302
|
+
onPointerEnter?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
303
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
304
|
+
onPointerLeave?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
305
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
306
|
+
onPointerOver?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
307
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
308
|
+
onPointerOut?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
309
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
310
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
311
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
312
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
313
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
314
|
+
onScroll?: React.UIEventHandler<HTMLButtonElement> | undefined;
|
|
315
|
+
onScrollCapture?: React.UIEventHandler<HTMLButtonElement> | undefined;
|
|
316
|
+
onWheel?: React.WheelEventHandler<HTMLButtonElement> | undefined;
|
|
317
|
+
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement> | undefined;
|
|
318
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
319
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
320
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
321
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
322
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
323
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
324
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
325
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
326
|
+
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
327
|
+
key?: React.Key | null | undefined;
|
|
328
|
+
};
|
|
329
|
+
var propTypes: {
|
|
330
|
+
/** tooltip placement can be top, left, right etc, per https://popper.js.org/docs/v2/constructors/#options */
|
|
331
|
+
tooltipPlacement: PropTypes.Requireable<string>;
|
|
332
|
+
/** any valid JSX or text to be rendered as tooltip contents */
|
|
333
|
+
tooltipContent: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
334
|
+
/** Type of button (uses Bootstrap options) */
|
|
335
|
+
variant: PropTypes.Requireable<string>;
|
|
336
|
+
/** Changes icon styles for dark background */
|
|
337
|
+
invertColors: PropTypes.Requireable<boolean>;
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>> & {
|
|
341
|
+
IconButtonWithTooltip: typeof IconButtonWithTooltip;
|
|
342
|
+
};
|
|
343
|
+
export default _default;
|
|
344
|
+
export { IconButtonWithTooltip };
|
package/dist/IconButton/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["className", "alt", "invertColors", "icon", "src", "iconClassNames", "onClick", "size", "variant", "iconAs", "isActive"],
|
|
3
|
-
_excluded2 = ["tooltipPlacement", "tooltipContent"
|
|
2
|
+
var _excluded = ["className", "alt", "invertColors", "icon", "src", "iconClassNames", "onClick", "size", "variant", "iconAs", "isActive", "children"],
|
|
3
|
+
_excluded2 = ["tooltipPlacement", "tooltipContent"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
6
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
@@ -25,6 +27,7 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
25
27
|
variant = _ref.variant,
|
|
26
28
|
iconAs = _ref.iconAs,
|
|
27
29
|
isActive = _ref.isActive,
|
|
30
|
+
children = _ref.children,
|
|
28
31
|
attrs = _objectWithoutProperties(_ref, _excluded);
|
|
29
32
|
var invert = invertColors ? 'inverse-' : '';
|
|
30
33
|
var activeStyle = isActive ? "".concat(variant, "-") : '';
|
|
@@ -50,7 +53,7 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
50
53
|
});
|
|
51
54
|
IconButton.defaultProps = {
|
|
52
55
|
iconAs: undefined,
|
|
53
|
-
src:
|
|
56
|
+
src: undefined,
|
|
54
57
|
icon: undefined,
|
|
55
58
|
iconClassNames: undefined,
|
|
56
59
|
className: undefined,
|
|
@@ -58,7 +61,8 @@ IconButton.defaultProps = {
|
|
|
58
61
|
variant: 'primary',
|
|
59
62
|
size: 'md',
|
|
60
63
|
onClick: function onClick() {},
|
|
61
|
-
isActive: false
|
|
64
|
+
isActive: false,
|
|
65
|
+
children: undefined
|
|
62
66
|
};
|
|
63
67
|
IconButton.propTypes = {
|
|
64
68
|
/** A custom class name. */
|
|
@@ -67,9 +71,9 @@ IconButton.propTypes = {
|
|
|
67
71
|
* but is going to be deprecated soon, please use Paragon's icons instead. */
|
|
68
72
|
iconAs: PropTypes.elementType,
|
|
69
73
|
/** An icon component to render. Example import of a Paragon icon component:
|
|
70
|
-
* `import { Check } from '@openedx/paragon/
|
|
74
|
+
* `import { Check } from '@openedx/paragon/icons';`
|
|
71
75
|
* */
|
|
72
|
-
src: PropTypes.
|
|
76
|
+
src: PropTypes.elementType,
|
|
73
77
|
/** Alt text for your icon. For best practice, avoid using alt text to describe
|
|
74
78
|
* the image in the `IconButton`. Instead, we recommend describing the function
|
|
75
79
|
* of the button. */
|
|
@@ -94,37 +98,25 @@ IconButton.propTypes = {
|
|
|
94
98
|
/** whether to show the `IconButton` in an active state, whose styling is distinct from default state */
|
|
95
99
|
isActive: PropTypes.bool
|
|
96
100
|
};
|
|
97
|
-
|
|
98
101
|
/**
|
|
99
|
-
*
|
|
100
|
-
* @param { object } args Arguments
|
|
101
|
-
* @param { string } args.tooltipPlacement choose from https://popper.js.org/docs/v2/constructors/#options
|
|
102
|
-
* @param { React.Component } args.tooltipContent any content to pass to tooltip content area
|
|
103
|
-
* @returns { IconButton } a button wrapped in overlaytrigger
|
|
102
|
+
* An icon button wrapped in overlaytrigger to display a tooltip.
|
|
104
103
|
*/
|
|
105
104
|
function IconButtonWithTooltip(_ref2) {
|
|
106
105
|
var tooltipPlacement = _ref2.tooltipPlacement,
|
|
107
106
|
tooltipContent = _ref2.tooltipContent,
|
|
108
|
-
variant = _ref2.variant,
|
|
109
|
-
invertColors = _ref2.invertColors,
|
|
110
107
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
111
|
-
var invert = invertColors ? 'inverse-' : '';
|
|
108
|
+
var invert = props.invertColors ? 'inverse-' : '';
|
|
112
109
|
return /*#__PURE__*/React.createElement(OverlayTrigger, {
|
|
113
110
|
placement: tooltipPlacement,
|
|
114
111
|
overlay: /*#__PURE__*/React.createElement(Tooltip, {
|
|
115
112
|
id: "iconbutton-tooltip-".concat(tooltipPlacement),
|
|
116
|
-
variant: invert ? 'light' :
|
|
113
|
+
variant: invert ? 'light' : undefined
|
|
117
114
|
}, tooltipContent)
|
|
118
|
-
}, /*#__PURE__*/React.createElement(IconButton,
|
|
119
|
-
variant: variant,
|
|
120
|
-
invertColors: invertColors
|
|
121
|
-
}, props)));
|
|
115
|
+
}, /*#__PURE__*/React.createElement(IconButton, props));
|
|
122
116
|
}
|
|
123
|
-
IconButtonWithTooltip.defaultProps = {
|
|
124
|
-
tooltipPlacement: 'top'
|
|
125
|
-
|
|
126
|
-
invertColors: false
|
|
127
|
-
};
|
|
117
|
+
IconButtonWithTooltip.defaultProps = _objectSpread(_objectSpread({}, IconButton.defaultProps), {}, {
|
|
118
|
+
tooltipPlacement: 'top'
|
|
119
|
+
});
|
|
128
120
|
IconButtonWithTooltip.propTypes = {
|
|
129
121
|
/** tooltip placement can be top, left, right etc, per https://popper.js.org/docs/v2/constructors/#options */
|
|
130
122
|
tooltipPlacement: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","FontAwesomeIcon","OverlayTrigger","Tooltip","IconButton","forwardRef","_ref","ref","className","alt","invertColors","icon","src","iconClassNames","onClick","size","variant","iconAs","isActive","attrs","_objectWithoutProperties","_excluded","invert","activeStyle","concat","process","env","NODE_ENV","console","msg","warn","IconComponent","createElement","_extends","_defineProperty","type","defaultProps","undefined","propTypes","string","elementType","oneOfType","element","isRequired","bool","shape","prefix","iconName","array","func","oneOf","IconButtonWithTooltip","_ref2","tooltipPlacement","tooltipContent","props","_excluded2","placement","overlay","id","node"],"sources":["../../src/IconButton/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { OverlayTrigger } from '../Overlay';\nimport Tooltip from '../Tooltip';\n\nconst IconButton = React.forwardRef(({\n className,\n alt,\n invertColors,\n icon,\n src,\n iconClassNames,\n onClick,\n size,\n variant,\n iconAs,\n isActive,\n ...attrs\n}, ref) => {\n const invert = invertColors ? 'inverse-' : '';\n const activeStyle = isActive ? `${variant}-` : '';\n if (!iconAs && process.env.NODE_ENV === 'development' && console) {\n const msg = '[Deprecated] IconButton: you have not provided a value for iconAs prop and '\n + 'are using a default one - FontAwesomeIcon, the default value is going to be changed soon '\n + 'as Paragon is moving away from FontAwesome, please use Paragon\\'s icons instead.';\n // eslint-disable-next-line no-console\n console.warn(msg);\n }\n const IconComponent = iconAs || FontAwesomeIcon;\n return (\n <button\n aria-label={alt}\n className={classNames(\n 'btn-icon',\n `btn-icon-${invert}${variant}`,\n `btn-icon-${size}`,\n {\n [`btn-icon-${invert}${activeStyle}active`]: isActive,\n },\n className,\n )}\n onClick={onClick}\n type=\"button\"\n ref={ref}\n {...attrs}\n >\n <span className=\"btn-icon__icon-container\">\n <IconComponent\n className={classNames('btn-icon__icon', iconClassNames)}\n icon={icon}\n src={src}\n />\n </span>\n </button>\n );\n});\n\nIconButton.defaultProps = {\n iconAs: undefined,\n src: null,\n icon: undefined,\n iconClassNames: undefined,\n className: undefined,\n invertColors: false,\n variant: 'primary',\n size: 'md',\n onClick: () => {},\n isActive: false,\n};\n\nIconButton.propTypes = {\n /** A custom class name. */\n className: PropTypes.string,\n /** Component that renders the icon, currently defaults to `FontAwesomeIcon`,\n * but is going to be deprecated soon, please use Paragon's icons instead. */\n iconAs: PropTypes.elementType,\n /** An icon component to render. Example import of a Paragon icon component:\n * `import { Check } from '@openedx/paragon/dist/icon';`\n * */\n src: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),\n /** Alt text for your icon. For best practice, avoid using alt text to describe\n * the image in the `IconButton`. Instead, we recommend describing the function\n * of the button. */\n alt: PropTypes.string.isRequired,\n /** Changes icon styles for dark background */\n invertColors: PropTypes.bool,\n /** Accepts a React fontawesome icon. */\n icon: PropTypes.shape({\n prefix: PropTypes.string,\n iconName: PropTypes.string,\n // eslint-disable-next-line react/forbid-prop-types\n icon: PropTypes.array,\n }),\n /** Extra class names that will be added to the icon */\n iconClassNames: PropTypes.string,\n /** Click handler for the button */\n onClick: PropTypes.func,\n /** Type of button (uses Bootstrap options) */\n variant: PropTypes.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'light', 'dark', 'black', 'brand']),\n /** size of button to render */\n size: PropTypes.oneOf(['sm', 'md', 'inline']),\n /** whether to show the `IconButton` in an active state, whose styling is distinct from default state */\n isActive: PropTypes.bool,\n};\n\n/**\n *\n * @param { object } args Arguments\n * @param { string } args.tooltipPlacement choose from https://popper.js.org/docs/v2/constructors/#options\n * @param { React.Component } args.tooltipContent any content to pass to tooltip content area\n * @returns { IconButton } a button wrapped in overlaytrigger\n */\nfunction IconButtonWithTooltip({\n tooltipPlacement, tooltipContent, variant, invertColors, ...props\n}) {\n const invert = invertColors ? 'inverse-' : '';\n return (\n <OverlayTrigger\n placement={tooltipPlacement}\n overlay={(\n <Tooltip\n id={`iconbutton-tooltip-${tooltipPlacement}`}\n variant={invert ? 'light' : ''}\n >\n {tooltipContent}\n </Tooltip>\n )}\n >\n <IconButton variant={variant} invertColors={invertColors} {...props} />\n </OverlayTrigger>\n );\n}\n\nIconButtonWithTooltip.defaultProps = {\n tooltipPlacement: 'top',\n variant: 'primary',\n invertColors: false,\n};\n\nIconButtonWithTooltip.propTypes = {\n /** tooltip placement can be top, left, right etc, per https://popper.js.org/docs/v2/constructors/#options */\n tooltipPlacement: PropTypes.string,\n /** any valid JSX or text to be rendered as tooltip contents */\n tooltipContent: PropTypes.node.isRequired,\n /** Type of button (uses Bootstrap options) */\n variant: PropTypes.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'light', 'dark', 'black', 'brand']),\n /** Changes icon styles for dark background */\n invertColors: PropTypes.bool,\n};\n\nIconButton.IconButtonWithTooltip = IconButtonWithTooltip;\n\nexport default IconButton;\nexport { IconButtonWithTooltip };\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,cAAc,QAAQ,YAAY;AAC3C,OAAOC,OAAO,MAAM,YAAY;AAEhC,IAAMC,UAAU,gBAAGN,KAAK,CAACO,UAAU,CAAC,UAAAC,IAAA,EAajCC,GAAG,EAAK;EAAA,IAZTC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,GAAG,GAAAH,IAAA,CAAHG,GAAG;IACHC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,IAAI,GAAAL,IAAA,CAAJK,IAAI;IACJC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IACHC,cAAc,GAAAP,IAAA,CAAdO,cAAc;IACdC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IACPC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,OAAO,GAAAV,IAAA,CAAPU,OAAO;IACPC,MAAM,GAAAX,IAAA,CAANW,MAAM;IACNC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;IACLC,KAAK,GAAAC,wBAAA,CAAAd,IAAA,EAAAe,SAAA;EAER,IAAMC,MAAM,GAAGZ,YAAY,GAAG,UAAU,GAAG,EAAE;EA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","PropTypes","classNames","FontAwesomeIcon","OverlayTrigger","Tooltip","IconButton","forwardRef","_ref","ref","className","alt","invertColors","icon","src","iconClassNames","onClick","size","variant","iconAs","isActive","children","attrs","_objectWithoutProperties","_excluded","invert","activeStyle","concat","process","env","NODE_ENV","console","msg","warn","IconComponent","createElement","_extends","_defineProperty","type","defaultProps","undefined","propTypes","string","elementType","isRequired","bool","shape","prefix","iconName","array","func","oneOf","IconButtonWithTooltip","_ref2","tooltipPlacement","tooltipContent","props","_excluded2","placement","overlay","id","_objectSpread","node"],"sources":["../../src/IconButton/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { type Placement } from 'react-bootstrap/Overlay';\n\nimport { OverlayTrigger } from '../Overlay';\nimport Tooltip from '../Tooltip';\nimport Icon from '../Icon';\n\ninterface Props extends React.HTMLAttributes<HTMLButtonElement> {\n iconAs?: typeof Icon | typeof FontAwesomeIcon,\n /** Additional CSS class[es] to apply to this button */\n className?: string;\n /** Alt text for your icon. For best practice, avoid using alt text to describe\n * the image in the `IconButton`. Instead, we recommend describing the function\n * of the button. */\n alt: string;\n /** Changes icon styles for dark background */\n invertColors?: boolean;\n /** An icon component to render. Example import of a Paragon icon component:\n * `import { Check } from '@openedx/paragon/icons';`\n * */\n // Note: React.ComponentType is what we want here. React.ElementType would allow some element type strings like \"div\",\n // but we only want to allow components like 'Add' (a specific icon component function/class)\n src?: React.ComponentType;\n /** Extra class names that will be added to the icon */\n iconClassNames?: string;\n /** Click handler for the button */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** whether to show the `IconButton` in an active state, whose styling is distinct from default state */\n isActive?: boolean;\n /** @deprecated Using FontAwesome icons is deprecated. Instead, pass iconAs={Icon} src={...} */\n icon?: { prefix?: string; iconName?: string, icon?: any[] },\n /** Type of button (uses Bootstrap options) */\n variant?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand';\n /** size of button to render */\n size?: 'sm' | 'md' | 'inline';\n /** no children */\n children?: never;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, Props>(({\n className,\n alt,\n invertColors,\n icon,\n src,\n iconClassNames,\n onClick,\n size,\n variant,\n iconAs,\n isActive,\n children, // unused, just here because we don't want it to be part of 'attrs'\n ...attrs\n}, ref) => {\n const invert = invertColors ? 'inverse-' : '';\n const activeStyle = isActive ? `${variant}-` : '';\n if (!iconAs && process.env.NODE_ENV === 'development' && console) {\n const msg = '[Deprecated] IconButton: you have not provided a value for iconAs prop and '\n + 'are using a default one - FontAwesomeIcon, the default value is going to be changed soon '\n + 'as Paragon is moving away from FontAwesome, please use Paragon\\'s icons instead.';\n // eslint-disable-next-line no-console\n console.warn(msg);\n }\n const IconComponent = iconAs || FontAwesomeIcon;\n return (\n <button\n aria-label={alt}\n className={classNames(\n 'btn-icon',\n `btn-icon-${invert}${variant}`,\n `btn-icon-${size}`,\n {\n [`btn-icon-${invert}${activeStyle}active`]: isActive,\n },\n className,\n )}\n onClick={onClick}\n type=\"button\"\n ref={ref}\n {...attrs}\n >\n <span className=\"btn-icon__icon-container\">\n <IconComponent\n className={classNames('btn-icon__icon', iconClassNames)}\n icon={icon as any}\n src={src}\n />\n </span>\n </button>\n );\n});\n\nIconButton.defaultProps = {\n iconAs: undefined,\n src: undefined,\n icon: undefined,\n iconClassNames: undefined,\n className: undefined,\n invertColors: false,\n variant: 'primary',\n size: 'md',\n onClick: () => {},\n isActive: false,\n children: undefined,\n};\n\nIconButton.propTypes = {\n /** A custom class name. */\n className: PropTypes.string,\n /** Component that renders the icon, currently defaults to `FontAwesomeIcon`,\n * but is going to be deprecated soon, please use Paragon's icons instead. */\n iconAs: PropTypes.elementType as any,\n /** An icon component to render. Example import of a Paragon icon component:\n * `import { Check } from '@openedx/paragon/icons';`\n * */\n src: PropTypes.elementType as any,\n /** Alt text for your icon. For best practice, avoid using alt text to describe\n * the image in the `IconButton`. Instead, we recommend describing the function\n * of the button. */\n alt: PropTypes.string.isRequired,\n /** Changes icon styles for dark background */\n invertColors: PropTypes.bool,\n /** Accepts a React fontawesome icon. */\n icon: PropTypes.shape({\n prefix: PropTypes.string,\n iconName: PropTypes.string,\n // eslint-disable-next-line react/forbid-prop-types\n icon: PropTypes.array,\n }) as any,\n /** Extra class names that will be added to the icon */\n iconClassNames: PropTypes.string,\n /** Click handler for the button */\n onClick: PropTypes.func,\n /** Type of button (uses Bootstrap options) */\n variant: PropTypes.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'light', 'dark', 'black', 'brand']),\n /** size of button to render */\n size: PropTypes.oneOf(['sm', 'md', 'inline']),\n /** whether to show the `IconButton` in an active state, whose styling is distinct from default state */\n isActive: PropTypes.bool,\n};\n\ninterface PropsWithTooltip extends Props {\n /** choose from https://popper.js.org/docs/v2/constructors/#options */\n tooltipPlacement: Placement,\n /** any content to pass to tooltip content area */\n tooltipContent: React.ReactNode,\n}\n\n/**\n * An icon button wrapped in overlaytrigger to display a tooltip.\n */\nfunction IconButtonWithTooltip({\n tooltipPlacement, tooltipContent, ...props\n}: PropsWithTooltip) {\n const invert = props.invertColors ? 'inverse-' : '';\n return (\n <OverlayTrigger\n placement={tooltipPlacement}\n overlay={(\n <Tooltip\n id={`iconbutton-tooltip-${tooltipPlacement}`}\n variant={invert ? 'light' : undefined}\n >\n {tooltipContent}\n </Tooltip>\n )}\n >\n <IconButton {...props} />\n </OverlayTrigger>\n );\n}\n\nIconButtonWithTooltip.defaultProps = {\n ...IconButton.defaultProps,\n tooltipPlacement: 'top',\n};\n\nIconButtonWithTooltip.propTypes = {\n /** tooltip placement can be top, left, right etc, per https://popper.js.org/docs/v2/constructors/#options */\n tooltipPlacement: PropTypes.string,\n /** any valid JSX or text to be rendered as tooltip contents */\n tooltipContent: PropTypes.node.isRequired,\n /** Type of button (uses Bootstrap options) */\n variant: PropTypes.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'light', 'dark', 'black', 'brand']),\n /** Changes icon styles for dark background */\n invertColors: PropTypes.bool,\n};\n\n(IconButton as any).IconButtonWithTooltip = IconButtonWithTooltip;\n\nexport default IconButton as typeof IconButton & {\n IconButtonWithTooltip: typeof IconButtonWithTooltip,\n};\nexport { IconButtonWithTooltip };\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,eAAe,QAAQ,gCAAgC;AAGhE,SAASC,cAAc,QAAQ,YAAY;AAC3C,OAAOC,OAAO,MAAM,YAAY;AAmChC,IAAMC,UAAU,gBAAGN,KAAK,CAACO,UAAU,CAA2B,UAAAC,IAAA,EAc3DC,GAAG,EAAK;EAAA,IAbTC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,GAAG,GAAAH,IAAA,CAAHG,GAAG;IACHC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,IAAI,GAAAL,IAAA,CAAJK,IAAI;IACJC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IACHC,cAAc,GAAAP,IAAA,CAAdO,cAAc;IACdC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IACPC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,OAAO,GAAAV,IAAA,CAAPU,OAAO;IACPC,MAAM,GAAAX,IAAA,CAANW,MAAM;IACNC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;IACRC,QAAQ,GAAAb,IAAA,CAARa,QAAQ;IACLC,KAAK,GAAAC,wBAAA,CAAAf,IAAA,EAAAgB,SAAA;EAER,IAAMC,MAAM,GAAGb,YAAY,GAAG,UAAU,GAAG,EAAE;EAC7C,IAAMc,WAAW,GAAGN,QAAQ,MAAAO,MAAA,CAAMT,OAAO,SAAM,EAAE;EACjD,IAAI,CAACC,MAAM,IAAIS,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,IAAIC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3D,KAAA,CAAAmC,aAAA,CAAC9B,OAAO;MACNuD,EAAE,wBAAAjC,MAAA,CAAwB2B,gBAAgB,CAAG;MAC7CpC,OAAO,EAAEO,MAAM,GAAG,OAAO,GAAGe;IAAU,GAErCe,cACM;EACT,gBAEFvD,KAAA,CAAAmC,aAAA,CAAC7B,UAAU,EAAKkD,KAAQ,CACV,CAAC;AAErB;AAEAJ,qBAAqB,CAACb,YAAY,GAAAsB,aAAA,CAAAA,aAAA,KAC7BvD,UAAU,CAACiC,YAAY;EAC1Be,gBAAgB,EAAE;AAAK,EACxB;AAEDF,qBAAqB,CAACX,SAAS,GAAG;EAChC;EACAa,gBAAgB,EAAErD,SAAS,CAACyC,MAAM;EAClC;EACAa,cAAc,EAAEtD,SAAS,CAAC6D,IAAI,CAAClB,UAAU;EACzC;EACA1B,OAAO,EAAEjB,SAAS,CAACkD,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EACrH;EACAvC,YAAY,EAAEX,SAAS,CAAC4C;AAC1B,CAAC;AAEAvC,UAAU,CAAS8C,qBAAqB,GAAGA,qBAAqB;AAEjE,eAAe9C,UAAU;AAGzB,SAAS8C,qBAAqB","ignoreList":[]}
|
package/dist/Menu/SelectMenu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["defaultMessage", "children", "className", "variant"];
|
|
1
|
+
var _excluded = ["defaultMessage", "children", "className", "variant", "disabled"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -23,6 +23,7 @@ function SelectMenu(_ref) {
|
|
|
23
23
|
children = _ref.children,
|
|
24
24
|
className = _ref.className,
|
|
25
25
|
variant = _ref.variant,
|
|
26
|
+
disabled = _ref.disabled,
|
|
26
27
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
var _useState = useState(null),
|
|
28
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -106,7 +107,8 @@ function SelectMenu(_ref) {
|
|
|
106
107
|
ref: setTriggerTarget,
|
|
107
108
|
variant: variant,
|
|
108
109
|
iconAfter: ExpandMore,
|
|
109
|
-
onClick: open
|
|
110
|
+
onClick: open,
|
|
111
|
+
disabled: disabled
|
|
110
112
|
}, selected !== undefined && children[selected] ? children[selected].props.children : defaultMessage), /*#__PURE__*/React.createElement("div", {
|
|
111
113
|
className: "pgn__menu-select-popup"
|
|
112
114
|
}, /*#__PURE__*/React.createElement(ModalPopup, {
|
|
@@ -140,12 +142,15 @@ SelectMenu.propTypes = {
|
|
|
140
142
|
/** Specifies class name to append to the base element */
|
|
141
143
|
className: PropTypes.string,
|
|
142
144
|
/** Specifies variant to use. */
|
|
143
|
-
variant: PropTypes.string
|
|
145
|
+
variant: PropTypes.string,
|
|
146
|
+
/** Specifies if the `SelectMenu` is disabled. */
|
|
147
|
+
disabled: PropTypes.bool
|
|
144
148
|
};
|
|
145
149
|
SelectMenu.defaultProps = {
|
|
146
150
|
defaultMessage: SELECT_MENU_DEFAULT_MESSAGE,
|
|
147
151
|
className: undefined,
|
|
148
|
-
variant: 'outline-primary'
|
|
152
|
+
variant: 'outline-primary',
|
|
153
|
+
disabled: false
|
|
149
154
|
};
|
|
150
155
|
var SelectMenuWithDeprecatedProp = withDeprecatedProps(SelectMenu, 'SelectMenu', {
|
|
151
156
|
isLink: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenu.js","names":["React","useState","useEffect","useCallback","PropTypes","classNames","ExpandMore","Button","ModalPopup","useToggle","Menu","withDeprecatedProps","DeprTypes","SELECT_MENU_DEFAULT_MESSAGE","SelectMenu","_ref","defaultMessage","children","className","variant","props","_objectWithoutProperties","_excluded","_useState","_useState2","_slicedToArray","triggerTarget","setTriggerTarget","focusMenuRef","useRef","itemsCollection","useMemo","Array","from","length","map","createRef","defaultIndex","i","defaultSelected","undefined","_useState3","_useState4","selected","setSelected","_useToggle","_useToggle2","isOpen","open","close","createMenuItems","Children","child","index","newProps","onClick","e","current","id","concat","toString","role","cloneElement","prevOpenRef","numItems","scrollIntoView","block","focus","preventScroll","createElement","_extends","ref","iconAfter","placement","positionRef","onClose","modifiers","name","options","padding","top","bottom","key","propTypes","string","node","isRequired","defaultProps","SelectMenuWithDeprecatedProp","isLink","deprType","MOVED_AND_FORMAT","message","newName","transform"],"sources":["../../src/Menu/SelectMenu.jsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { ExpandMore } from '../../icons';\nimport Button from '../Button';\nimport ModalPopup from '../Modal/ModalPopup';\nimport useToggle from '../hooks/useToggle';\nimport Menu from '.';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const SELECT_MENU_DEFAULT_MESSAGE = 'Select...';\n\nfunction SelectMenu({\n defaultMessage,\n children,\n className,\n variant,\n ...props\n}) {\n const [triggerTarget, setTriggerTarget] = useState(null);\n // this ref is used to focus the menu open button after any menu option is clicked.\n // triggerTarget.current.focus() inside the onCLick() function didn't guarantee element focus.\n const focusMenuRef = React.useRef(false);\n const itemsCollection = React.useMemo(\n () => Array.from({ length: children.length }).map(() => React.createRef()),\n [children.length],\n );\n\n const defaultIndex = useCallback(() => {\n for (let i = 0; i < children.length; i++) {\n if (children[i].props && children[i].props.defaultSelected) {\n return i;\n }\n }\n return undefined;\n }, [children]);\n\n const [selected, setSelected] = useState(defaultIndex());\n const [isOpen, open, close] = useToggle(false);\n\n const createMenuItems = () => React.Children.map(children, (child, index) => {\n const newProps = {\n onClick(e) {\n if (child.props.onClick) {\n child.props.onClick(e);\n }\n setSelected(index);\n close();\n focusMenuRef.current = true;\n },\n id: `${index.toString()}_pgn__menu-item`,\n role: 'link',\n };\n if (selected === index) {\n newProps['aria-current'] = 'page';\n }\n return React.cloneElement(child, newProps);\n });\n\n const prevOpenRef = React.useRef();\n\n useEffect(() => {\n if (isOpen && selected) {\n const numItems = children.length;\n if (numItems > 6 && selected > 1 && numItems - selected > 2) {\n // on \"middle elements\", set offset to center of block and scroll to center\n itemsCollection[selected].current.children[0].scrollIntoView({\n block: 'center',\n });\n }\n }\n // set focus on open\n if (isOpen && !prevOpenRef.current && selected) {\n itemsCollection[selected].current.children[0].focus({ preventScroll: (defaultIndex() === selected) });\n }\n if (focusMenuRef.current) {\n triggerTarget.focus();\n focusMenuRef.current = false;\n }\n prevOpenRef.current = isOpen;\n }, [isOpen, children.length, defaultIndex, itemsCollection, selected, triggerTarget]);\n\n return (\n <div className={classNames('pgn__menu-select', className)} {...props}>\n <Button\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n ref={setTriggerTarget}\n variant={variant}\n iconAfter={ExpandMore}\n onClick={open}\n >\n {selected !== undefined && children[selected] ? children[selected].props.children : defaultMessage}\n </Button>\n <div className=\"pgn__menu-select-popup\">\n <ModalPopup\n placement=\"bottom-start\"\n positionRef={triggerTarget}\n isOpen={isOpen}\n onClose={close}\n modifiers={\n [\n {\n name: 'flip',\n options: {\n padding: { top: 150, bottom: 150 },\n },\n },\n ]\n }\n >\n <Menu aria-label=\"Select Menu\">\n {createMenuItems().map((child, index) => (\n <div key={child.props.id} ref={itemsCollection[index]}>\n {child}\n </div>\n ))}\n </Menu>\n </ModalPopup>\n </div>\n </div>\n );\n}\n\nSelectMenu.propTypes = {\n /** String that is displayed for default value of the ``SelectMenu`` */\n defaultMessage: PropTypes.string,\n /** Specifies the content of the ``SelectMenu`` */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element */\n className: PropTypes.string,\n /** Specifies variant to use. */\n variant: PropTypes.string,\n};\n\nSelectMenu.defaultProps = {\n defaultMessage: SELECT_MENU_DEFAULT_MESSAGE,\n className: undefined,\n variant: 'outline-primary',\n};\n\nconst SelectMenuWithDeprecatedProp = withDeprecatedProps(SelectMenu, 'SelectMenu', {\n isLink: {\n deprType: DeprTypes.MOVED_AND_FORMAT,\n message: 'Use \"variant\" prop instead, i.e. variant=\"link\"',\n newName: 'variant',\n transform: () => 'link',\n },\n});\n\nexport default SelectMenuWithDeprecatedProp;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AAC/D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,IAAI,MAAM,GAAG;AACpB,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,OAAO,IAAMC,2BAA2B,GAAG,WAAW;AAEtD,SAASC,UAAUA,CAAAC,IAAA,EAMhB;EAAA,IALDC,cAAc,GAAAD,IAAA,CAAdC,cAAc;IACdC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACJC,KAAK,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA;EAER,IAAAC,SAAA,GAA0CtB,QAAQ,CAAC,IAAI,CAAC;IAAAuB,UAAA,GAAAC,cAAA,CAAAF,SAAA;IAAjDG,aAAa,G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BwC,eAAe,CAAC,CAAC,CAACf,GAAG,CAAC,UAACiB,KAAK,EAAEC,KAAK;IAAA,oBAClCrD,KAAA,CAAAqE,aAAA;MAAKa,GAAG,EAAE9B,KAAK,CAAChC,KAAK,CAACsC,EAAG;MAACa,GAAG,EAAEzC,eAAe,CAACuB,KAAK;IAAE,GACnDD,KACE,CAAC;EAAA,CACP,CACG,CACI,CACT,CACF,CAAC;AAEV;AAEAtC,UAAU,CAACqE,SAAS,GAAG;EACrB;EACAnE,cAAc,EAAEZ,SAAS,CAACgF,MAAM;EAChC;EACAnE,QAAQ,EAAEb,SAAS,CAACiF,IAAI,CAACC,UAAU;EACnC;EACApE,SAAS,EAAEd,SAAS,CAACgF,MAAM;EAC3B;EACAjE,OAAO,EAAEf,SAAS,CAACgF;AACrB,CAAC;AAEDtE,UAAU,CAACyE,YAAY,GAAG;EACxBvE,cAAc,EAAEH,2BAA2B;EAC3CK,SAAS,EAAEsB,SAAS;EACpBrB,OAAO,EAAE;AACX,CAAC;AAED,IAAMqE,4BAA4B,GAAG7E,mBAAmB,CAACG,UAAU,EAAE,YAAY,EAAE;EACjF2E,MAAM,EAAE;IACNC,QAAQ,EAAE9E,SAAS,CAAC+E,gBAAgB;IACpCC,OAAO,EAAE,iDAAiD;IAC1DC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,SAAAA,UAAA;MAAA,OAAM,MAAM;IAAA;EACzB;AACF,CAAC,CAAC;AAEF,eAAeN,4BAA4B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"SelectMenu.js","names":["React","useState","useEffect","useCallback","PropTypes","classNames","ExpandMore","Button","ModalPopup","useToggle","Menu","withDeprecatedProps","DeprTypes","SELECT_MENU_DEFAULT_MESSAGE","SelectMenu","_ref","defaultMessage","children","className","variant","disabled","props","_objectWithoutProperties","_excluded","_useState","_useState2","_slicedToArray","triggerTarget","setTriggerTarget","focusMenuRef","useRef","itemsCollection","useMemo","Array","from","length","map","createRef","defaultIndex","i","defaultSelected","undefined","_useState3","_useState4","selected","setSelected","_useToggle","_useToggle2","isOpen","open","close","createMenuItems","Children","child","index","newProps","onClick","e","current","id","concat","toString","role","cloneElement","prevOpenRef","numItems","scrollIntoView","block","focus","preventScroll","createElement","_extends","ref","iconAfter","placement","positionRef","onClose","modifiers","name","options","padding","top","bottom","key","propTypes","string","node","isRequired","bool","defaultProps","SelectMenuWithDeprecatedProp","isLink","deprType","MOVED_AND_FORMAT","message","newName","transform"],"sources":["../../src/Menu/SelectMenu.jsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { ExpandMore } from '../../icons';\nimport Button from '../Button';\nimport ModalPopup from '../Modal/ModalPopup';\nimport useToggle from '../hooks/useToggle';\nimport Menu from '.';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const SELECT_MENU_DEFAULT_MESSAGE = 'Select...';\n\nfunction SelectMenu({\n defaultMessage,\n children,\n className,\n variant,\n disabled,\n ...props\n}) {\n const [triggerTarget, setTriggerTarget] = useState(null);\n // this ref is used to focus the menu open button after any menu option is clicked.\n // triggerTarget.current.focus() inside the onCLick() function didn't guarantee element focus.\n const focusMenuRef = React.useRef(false);\n const itemsCollection = React.useMemo(\n () => Array.from({ length: children.length }).map(() => React.createRef()),\n [children.length],\n );\n\n const defaultIndex = useCallback(() => {\n for (let i = 0; i < children.length; i++) {\n if (children[i].props && children[i].props.defaultSelected) {\n return i;\n }\n }\n return undefined;\n }, [children]);\n\n const [selected, setSelected] = useState(defaultIndex());\n const [isOpen, open, close] = useToggle(false);\n\n const createMenuItems = () => React.Children.map(children, (child, index) => {\n const newProps = {\n onClick(e) {\n if (child.props.onClick) {\n child.props.onClick(e);\n }\n setSelected(index);\n close();\n focusMenuRef.current = true;\n },\n id: `${index.toString()}_pgn__menu-item`,\n role: 'link',\n };\n if (selected === index) {\n newProps['aria-current'] = 'page';\n }\n return React.cloneElement(child, newProps);\n });\n\n const prevOpenRef = React.useRef();\n\n useEffect(() => {\n if (isOpen && selected) {\n const numItems = children.length;\n if (numItems > 6 && selected > 1 && numItems - selected > 2) {\n // on \"middle elements\", set offset to center of block and scroll to center\n itemsCollection[selected].current.children[0].scrollIntoView({\n block: 'center',\n });\n }\n }\n // set focus on open\n if (isOpen && !prevOpenRef.current && selected) {\n itemsCollection[selected].current.children[0].focus({ preventScroll: (defaultIndex() === selected) });\n }\n if (focusMenuRef.current) {\n triggerTarget.focus();\n focusMenuRef.current = false;\n }\n prevOpenRef.current = isOpen;\n }, [isOpen, children.length, defaultIndex, itemsCollection, selected, triggerTarget]);\n\n return (\n <div className={classNames('pgn__menu-select', className)} {...props}>\n <Button\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n ref={setTriggerTarget}\n variant={variant}\n iconAfter={ExpandMore}\n onClick={open}\n disabled={disabled}\n >\n {selected !== undefined && children[selected] ? children[selected].props.children : defaultMessage}\n </Button>\n <div className=\"pgn__menu-select-popup\">\n <ModalPopup\n placement=\"bottom-start\"\n positionRef={triggerTarget}\n isOpen={isOpen}\n onClose={close}\n modifiers={\n [\n {\n name: 'flip',\n options: {\n padding: { top: 150, bottom: 150 },\n },\n },\n ]\n }\n >\n <Menu aria-label=\"Select Menu\">\n {createMenuItems().map((child, index) => (\n <div key={child.props.id} ref={itemsCollection[index]}>\n {child}\n </div>\n ))}\n </Menu>\n </ModalPopup>\n </div>\n </div>\n );\n}\n\nSelectMenu.propTypes = {\n /** String that is displayed for default value of the ``SelectMenu`` */\n defaultMessage: PropTypes.string,\n /** Specifies the content of the ``SelectMenu`` */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element */\n className: PropTypes.string,\n /** Specifies variant to use. */\n variant: PropTypes.string,\n /** Specifies if the `SelectMenu` is disabled. */\n disabled: PropTypes.bool,\n};\n\nSelectMenu.defaultProps = {\n defaultMessage: SELECT_MENU_DEFAULT_MESSAGE,\n className: undefined,\n variant: 'outline-primary',\n disabled: false,\n};\n\nconst SelectMenuWithDeprecatedProp = withDeprecatedProps(SelectMenu, 'SelectMenu', {\n isLink: {\n deprType: DeprTypes.MOVED_AND_FORMAT,\n message: 'Use \"variant\" prop instead, i.e. variant=\"link\"',\n newName: 'variant',\n transform: () => 'link',\n },\n});\n\nexport default SelectMenuWithDeprecatedProp;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AAC/D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,IAAI,MAAM,GAAG;AACpB,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,OAAO,IAAMC,2BAA2B,GAAG,WAAW;AAEtD,SAASC,UAAUA,CAAAC,IAAA,EAOhB;EAAA,IANDC,cAAc,GAAAD,IAAA,CAAdC,cAAc;IACdC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACLC,KAAK,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA;EAER,IAAAC,SAAA,GAA0CvB,QAAQ,CAAC,IAAI,CAAC;IAAAwB,UAAA,GAAAC,cAAA,CAAAF,SAAA;IAAjDG,aAAa,GAAAF,UAAA;IAAEG,gBAAgB,GAAAH,UAAA;EACtC;EACA;EACA,IAAMI,YAAY,GAAG7B,KAAK,CAAC8B,MAAM,CAAC,KAAK,CAAC;EACxC,IAAMC,eAAe,GAAG/B,KAAK,CAACgC,OAAO,CACnC;IAAA,OAAMC,KAAK,CAACC,IAAI,CAAC;MAAE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