etudes 6.0.0 → 6.1.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/components/Accordion.js +28 -22
- package/components/BurgerButton.js +6 -5
- package/components/Button.js +3 -3
- package/components/Carousel.js +1 -1
- package/components/Collection.d.ts +1 -1
- package/components/Collection.js +3 -3
- package/components/Counter.js +4 -4
- package/components/CoverImage.js +3 -3
- package/components/CoverVideo.js +3 -3
- package/components/Dial.js +3 -3
- package/components/Dropdown.js +9 -7
- package/components/FlatSVG.js +1 -1
- package/components/Image.js +1 -1
- package/components/MasonryGrid.js +2 -1
- package/components/OptionButton.js +1 -1
- package/components/Panorama.js +1 -1
- package/components/PanoramaSlider.js +4 -4
- package/components/RangeSlider.js +5 -5
- package/components/SelectableButton.js +1 -1
- package/components/Slider.js +4 -4
- package/components/StepwiseSlider.js +4 -4
- package/components/SwipeContainer.js +1 -1
- package/components/TextField.d.ts +2 -0
- package/components/TextField.js +2 -2
- package/components/Video.js +1 -1
- package/components/WithTooltip.js +3 -2
- package/package.json +1 -1
package/components/Accordion.js
CHANGED
|
@@ -131,7 +131,7 @@ export const Accordion = forwardRef(({ children, style, autoCollapseSections = f
|
|
|
131
131
|
return;
|
|
132
132
|
handleSelectionChange(prevSelection, selection);
|
|
133
133
|
}, [JSON.stringify(selection)]);
|
|
134
|
-
return (_jsx("div", { ...props, ref: ref,
|
|
134
|
+
return (_jsx("div", { ...props, ref: ref, style: styles(style, fixedStyles.root), children: _jsx(Each, { in: sections, children: (section, sectionIndex) => {
|
|
135
135
|
const { collectionPadding = 0, items, itemLength = 50, itemPadding = 0, isSelectionTogglable, layout = 'list', maxVisible = -1, numSegments = 1 } = section;
|
|
136
136
|
const allVisible = layout === 'list' ? items.length : Math.ceil(items.length / numSegments);
|
|
137
137
|
const numVisible = maxVisible < 0 ? allVisible : Math.min(allVisible, maxVisible);
|
|
@@ -141,34 +141,40 @@ export const Accordion = forwardRef(({ children, style, autoCollapseSections = f
|
|
|
141
141
|
marginTop: sectionIndex === 0 ? '0px' : `${sectionPadding}px`,
|
|
142
142
|
} : {
|
|
143
143
|
marginLeft: sectionIndex === 0 ? '0px' : `${sectionPadding}px`,
|
|
144
|
-
}), children: [HeaderComponent ? (_jsx(HeaderComponent, { className: clsx({ collapsed: isCollapsed, expanded: !isCollapsed }),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
}), children: [HeaderComponent ? (_jsx(HeaderComponent, { "aria-expanded": !isCollapsed, className: clsx({ collapsed: isCollapsed, expanded: !isCollapsed }), index: sectionIndex, isCollapsed: isCollapsed, role: 'button', section: section, style: styles(fixedStyles.header), onClick: () => toggleSectionAt(sectionIndex), onCustomEvent: (name, info) => onHeaderCustomEvent?.(sectionIndex, name, info) })) : (cloneStyledElement(components.header ?? _jsx(AccordionHeader, {}), {
|
|
145
|
+
'aria-expanded': !isCollapsed,
|
|
146
|
+
'className': clsx({ collapsed: isCollapsed, expanded: !isCollapsed }),
|
|
147
|
+
'style': styles(fixedStyles.header),
|
|
148
|
+
'role': 'button',
|
|
149
|
+
'onClick': () => toggleSectionAt(sectionIndex),
|
|
150
|
+
}, _jsx("span", { dangerouslySetInnerHTML: { __html: section.label } }), isCollapsed ? components.collapseIcon ?? components.expandIcon : components.expandIcon)), _jsx("div", { hidden: isCollapsed, role: 'region', style: styles(orientation === 'vertical' ? {
|
|
149
151
|
width: '100%',
|
|
150
|
-
height: isCollapsed ? '
|
|
151
|
-
marginTop: isCollapsed ? '
|
|
152
|
+
height: isCollapsed ? '0' : `${maxLength}px`,
|
|
153
|
+
marginTop: isCollapsed ? '0' : `${collectionPadding}px`,
|
|
152
154
|
overflowY: maxVisible < 0 || maxVisible >= allVisible ? 'hidden' : 'scroll',
|
|
153
155
|
} : {
|
|
154
|
-
marginLeft: isCollapsed ? '
|
|
156
|
+
marginLeft: isCollapsed ? '0' : `${collectionPadding}px`,
|
|
155
157
|
overflowX: maxVisible < 0 || maxVisible >= allVisible ? 'hidden' : 'scroll',
|
|
156
|
-
width: isCollapsed ? '
|
|
158
|
+
width: isCollapsed ? '0' : `${maxLength}px`,
|
|
157
159
|
height: '100%',
|
|
158
|
-
}),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
}), children: _jsx(Collection, { className: clsx({ collapsed: isCollapsed, expanded: !isCollapsed }), isSelectionTogglable: isSelectionTogglable, ItemComponent: ItemComponent, itemLength: itemLength, itemPadding: itemPadding, items: items, layout: layout, numSegments: numSegments, orientation: orientation, selection: selection[sectionIndex] ?? [], selectionMode: selectionMode, style: styles(orientation === 'vertical' ? {
|
|
161
|
+
width: '100%',
|
|
162
|
+
} : {
|
|
163
|
+
height: '100%',
|
|
164
|
+
}), onActivateAt: itemIndex => {
|
|
165
|
+
onActivateAt?.(itemIndex, sectionIndex);
|
|
166
|
+
}, onCustomEvent: (itemIndex, name, info) => {
|
|
167
|
+
onItemCustomEvent?.(itemIndex, sectionIndex, name, info);
|
|
168
|
+
}, onDeselectAt: itemIndex => {
|
|
169
|
+
handleDeselectAt?.(itemIndex, sectionIndex);
|
|
170
|
+
}, onSelectAt: itemIndex => {
|
|
171
|
+
handleSelectAt?.(itemIndex, sectionIndex);
|
|
172
|
+
} }) })] }));
|
|
167
173
|
} }) }));
|
|
168
174
|
});
|
|
169
|
-
export const AccordionHeader = ({ children, ...props }) => (_jsx("button", { ...props,
|
|
170
|
-
export const AccordionExpandIcon = ({ children, ...props }) => (_jsx("figure", { ...props,
|
|
171
|
-
export const AccordionCollapseIcon = ({ children, ...props }) => (_jsx("figure", { ...props,
|
|
175
|
+
export const AccordionHeader = ({ children, ...props }) => (_jsx("button", { ...props, children: children }));
|
|
176
|
+
export const AccordionExpandIcon = ({ children, ...props }) => (_jsx("figure", { ...props, children: children }));
|
|
177
|
+
export const AccordionCollapseIcon = ({ children, ...props }) => (_jsx("figure", { ...props, children: children }));
|
|
172
178
|
function sortIndices(indices) {
|
|
173
179
|
return indices.sort((a, b) => a - b);
|
|
174
180
|
}
|
|
@@ -31,12 +31,13 @@ export const BurgerButton = forwardRef(({ children, className, style, isActive =
|
|
|
31
31
|
}),
|
|
32
32
|
});
|
|
33
33
|
const fixedStyles = getFixedStyles({ isSplit, isActive, isTailHidden });
|
|
34
|
-
return (_jsx("button", { ...props, ref: ref, className: clsx(className, fixedClassNames.root),
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
return (_jsx("button", { ...props, ref: ref, "aria-expanded": isActive, className: clsx(className, fixedClassNames.root), style: styles(style, fixedStyles.root), onClick: onClick, children: _jsx(Repeat, { count: isSplit ? 2 : 1, children: j => (_jsx("div", { "aria-hidden": true, style: styles(fixedStyles.section, fixedStyles[`section${j}`]), children: _jsx(Repeat, { count: 3, children: i => cloneStyledElement(components.bar ?? _jsx(BurgerButtonBar, {}), {
|
|
35
|
+
'aria-hidden': true,
|
|
36
|
+
'className': clsx(fixedClassNames.bar),
|
|
37
|
+
'style': styles(fixedStyles.bar, fixedStyles[`bar${j}${i}`]),
|
|
37
38
|
}) }) })) }) }));
|
|
38
39
|
});
|
|
39
|
-
export const BurgerButtonBar = ({ ...props }) => (_jsx("span", { ...props
|
|
40
|
+
export const BurgerButtonBar = ({ ...props }) => (_jsx("span", { ...props }));
|
|
40
41
|
function getFixedStyles({ isActive = false, isSplit = false, isTailHidden = false }) {
|
|
41
42
|
return asStyleDict({
|
|
42
43
|
root: {
|
|
@@ -45,7 +46,7 @@ function getFixedStyles({ isActive = false, isSplit = false, isTailHidden = fals
|
|
|
45
46
|
display: 'block',
|
|
46
47
|
outline: 'none',
|
|
47
48
|
},
|
|
48
|
-
|
|
49
|
+
section: {
|
|
49
50
|
height: '100%',
|
|
50
51
|
position: 'absolute',
|
|
51
52
|
width: isSplit ? '50%' : '100%',
|
package/components/Button.js
CHANGED
|
@@ -3,13 +3,13 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
export function Button({ children, className, href, isDisabled = false, label, opensInNewTab, to, type, ...props }) {
|
|
5
5
|
if (href) {
|
|
6
|
-
return (_jsx("a", { ...props, className: clsx(className, { disabled: isDisabled }),
|
|
6
|
+
return (_jsx("a", { ...props, "aria-disabled": isDisabled, "aria-label": label, className: clsx(className, { disabled: isDisabled }), href: href, rel: opensInNewTab ? 'noopener,noreferrer' : undefined, target: opensInNewTab ? '_blank' : undefined, children: children ?? label }));
|
|
7
7
|
}
|
|
8
8
|
else if (to) {
|
|
9
|
-
return (_jsx(Link, { ...props, className: clsx(className, { disabled: isDisabled }),
|
|
9
|
+
return (_jsx(Link, { ...props, "aria-disabled": isDisabled, "aria-label": label, className: clsx(className, { disabled: isDisabled }), to: to, children: children ?? label }));
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
return (_jsx("button", { ...props,
|
|
12
|
+
return (_jsx("button", { ...props, "aria-disabled": isDisabled, "aria-label": label, className: className, disabled: isDisabled, type: type, children: children ?? label }));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
Object.defineProperty(Button, 'displayName', { value: 'Button', writable: false });
|
package/components/Carousel.js
CHANGED
|
@@ -150,7 +150,7 @@ export const Carousel = forwardRef(({ autoAdvanceInterval = 0, index = 0, isDrag
|
|
|
150
150
|
}, [orientation, isDragEnabled]);
|
|
151
151
|
useTimeout(() => handleIndexChange((index + items.length + 1) % items.length), (isPointerDown || autoAdvanceInterval <= 0) ? -1 : autoAdvanceInterval, [isPointerDown, index, items.length]);
|
|
152
152
|
const fixedStyles = getFixedStyles({ isPointerDown, orientation });
|
|
153
|
-
return (_jsx("div", { ...props, ref: ref,
|
|
153
|
+
return (_jsx("div", { ...props, ref: ref, role: 'region', onClick: event => handleClick(event), onPointerDown: event => handlePointerDown(event), onPointerLeave: event => handlePointerUp(event), onPointerUp: event => handlePointerUp(event), children: _jsx("div", { ref: viewportRef, style: styles(fixedStyles.viewport), children: _jsx(Each, { in: items, children: ({ style: itemStyle, ...itemProps }, idx) => (_jsx("div", { style: styles(fixedStyles.itemContainer), children: _jsx(ItemComponent, { "aria-hidden": idx !== index, exposure: tracksItemExposure ? exposures?.[idx] : undefined, style: styles(itemStyle, fixedStyles.item), ...itemProps }) })) }) }) }));
|
|
154
154
|
});
|
|
155
155
|
function getFixedStyles({ isPointerDown = false, orientation = 'horizontal' }) {
|
|
156
156
|
return asStyleDict({
|
|
@@ -133,7 +133,7 @@ export type CollectionProps<T> = HTMLAttributes<HTMLDivElement> & {
|
|
|
133
133
|
* @param eventName User-defined name of the dispatched custom event.
|
|
134
134
|
* @param eventInfo Optional user-defined info of the dispatched custom event.
|
|
135
135
|
*/
|
|
136
|
-
|
|
136
|
+
onCustomEvent?: (index: number, eventName: string, eventInfo?: any) => void;
|
|
137
137
|
/**
|
|
138
138
|
* Handler invoked when an item is selected. The order of handlers invoked
|
|
139
139
|
* when any selection changes take place is:
|
package/components/Collection.js
CHANGED
|
@@ -9,7 +9,7 @@ import { asStyleDict, styles } from '../utils/index.js';
|
|
|
9
9
|
* on the provided `ItemComponent`. This component supports different layouts in
|
|
10
10
|
* both horizontal and vertical orientations.
|
|
11
11
|
*/
|
|
12
|
-
export const Collection = forwardRef(({ className, style, isSelectionTogglable = false, itemLength, itemPadding = 0, items, layout = 'list', numSegments = 1, orientation = 'vertical', selection: externalSelection, selectionMode = 'none', onActivateAt, onDeselectAt,
|
|
12
|
+
export const Collection = forwardRef(({ className, style, isSelectionTogglable = false, itemLength, itemPadding = 0, items, layout = 'list', numSegments = 1, orientation = 'vertical', selection: externalSelection, selectionMode = 'none', onActivateAt, onDeselectAt, onCustomEvent, onSelectAt, onSelectionChange, ItemComponent, ...props }, ref) => {
|
|
13
13
|
const isIndexOutOfRange = (index) => {
|
|
14
14
|
if (isNaN(index))
|
|
15
15
|
return true;
|
|
@@ -87,7 +87,7 @@ export const Collection = forwardRef(({ className, style, isSelectionTogglable =
|
|
|
87
87
|
return;
|
|
88
88
|
handleSelectionChange(prevSelection, selection);
|
|
89
89
|
}, [JSON.stringify(selection)]);
|
|
90
|
-
return (_jsx("div", { ...props, ref: ref, className: clsx(className),
|
|
90
|
+
return (_jsx("div", { ...props, ref: ref, "aria-multiselectable": selectionMode === 'multiple', className: clsx(className), role: layout === 'grid' ? 'grid' : (selectionMode === 'none' ? 'list' : 'listbox'), style: styles(style, fixedStyles.root), children: ItemComponent && (_jsx(Each, { in: items, children: (val, idx) => (_jsx(ItemComponent, { "aria-selected": isSelectedAt(idx), className: clsx({ selected: isSelectedAt(idx) }), index: idx, isSelected: isSelectedAt(idx), item: val, orientation: orientation, role: layout === 'grid' ? 'gridcell' : (selectionMode === 'none' ? 'listitem' : 'option'), style: styles(fixedStyles.item, {
|
|
91
91
|
pointerEvents: isSelectionTogglable !== true && isSelectedAt(idx) ? 'none' : 'auto',
|
|
92
92
|
...idx >= items.length - 1 ? {} : {
|
|
93
93
|
...layout === 'list' ? {
|
|
@@ -98,7 +98,7 @@ export const Collection = forwardRef(({ className, style, isSelectionTogglable =
|
|
|
98
98
|
},
|
|
99
99
|
} : {},
|
|
100
100
|
},
|
|
101
|
-
}), onClick: () => activateAt(idx), onCustomEvent: (name, info) =>
|
|
101
|
+
}), onClick: () => activateAt(idx), onCustomEvent: (name, info) => onCustomEvent?.(idx, name, info) })) })) }));
|
|
102
102
|
});
|
|
103
103
|
function sortIndices(indices) {
|
|
104
104
|
return indices.sort((a, b) => a - b);
|
package/components/Counter.js
CHANGED
|
@@ -50,7 +50,7 @@ export const Counter = forwardRef(({ children, style, allowsInput = true, max =
|
|
|
50
50
|
addButton: CounterAddButton,
|
|
51
51
|
subscribeButton: CounterSubtractButton,
|
|
52
52
|
});
|
|
53
|
-
return (_jsxs("div", { ...props, ref: ref,
|
|
53
|
+
return (_jsxs("div", { ...props, ref: ref, style: styles(style, FIXED_STYLES.root), children: [cloneStyledElement(components.subscribeButton ?? _jsx(CounterSubtractButton, {}), {
|
|
54
54
|
className: clsx({ disabled: isSubtractingDisabled }),
|
|
55
55
|
style: styles(FIXED_STYLES.subtract),
|
|
56
56
|
onClick: () => handleSubtract(),
|
|
@@ -74,9 +74,9 @@ export const Counter = forwardRef(({ children, style, allowsInput = true, max =
|
|
|
74
74
|
onClick: () => handleAdd(),
|
|
75
75
|
})] }));
|
|
76
76
|
});
|
|
77
|
-
export const CounterTextField = ({ ...props }) => (_jsx(TextField, { ...props
|
|
78
|
-
export const CounterAddButton = ({ children, ...props }) => (_jsx("button", { ...props,
|
|
79
|
-
export const CounterSubtractButton = ({ children, ...props }) => (_jsx("button", { ...props,
|
|
77
|
+
export const CounterTextField = ({ ...props }) => (_jsx(TextField, { ...props }));
|
|
78
|
+
export const CounterAddButton = ({ children, ...props }) => (_jsx("button", { ...props, children: children }));
|
|
79
|
+
export const CounterSubtractButton = ({ children, ...props }) => (_jsx("button", { ...props, children: children }));
|
|
80
80
|
const FIXED_STYLES = asStyleDict({
|
|
81
81
|
root: styles({
|
|
82
82
|
display: 'flex',
|
package/components/CoverImage.js
CHANGED
|
@@ -23,7 +23,7 @@ export const CoverImage = forwardRef(({ children, style, alt, aspectRatio: exter
|
|
|
23
23
|
content: CoverImageContent,
|
|
24
24
|
viewport: CoverImageViewport,
|
|
25
25
|
});
|
|
26
|
-
return (_jsxs("div", { ...props, ref: rootRef,
|
|
26
|
+
return (_jsxs("div", { ...props, ref: rootRef, style: styles(style, FIXED_STYLES.root), children: [_jsx(Image, { alt: alt, sizes: sizes, src: src, srcSet: srcSet, style: styles(FIXED_STYLES.viewport, {
|
|
27
27
|
height: `${imageSize.height}px`,
|
|
28
28
|
maxWidth: 'unset',
|
|
29
29
|
width: `${imageSize.width}px`,
|
|
@@ -35,8 +35,8 @@ export const CoverImage = forwardRef(({ children, style, alt, aspectRatio: exter
|
|
|
35
35
|
}),
|
|
36
36
|
}), components.content] }));
|
|
37
37
|
});
|
|
38
|
-
export const CoverImageViewport = ({ children, ...props }) => (_jsx("div", { ...props,
|
|
39
|
-
export const CoverImageContent = ({ children, ...props }) => (_jsx("div", { ...props,
|
|
38
|
+
export const CoverImageViewport = ({ children, ...props }) => (_jsx("div", { ...props, children: children }));
|
|
39
|
+
export const CoverImageContent = ({ children, ...props }) => (_jsx("div", { ...props, children: children }));
|
|
40
40
|
const FIXED_STYLES = asStyleDict({
|
|
41
41
|
root: {
|
|
42
42
|
overflow: 'hidden',
|
package/components/CoverVideo.js
CHANGED
|
@@ -24,7 +24,7 @@ export const CoverVideo = forwardRef(({ className, children, style, aspectRatio:
|
|
|
24
24
|
content: CoverVideoContent,
|
|
25
25
|
viewport: CoverVideoViewport,
|
|
26
26
|
});
|
|
27
|
-
return (_jsxs("div", { ...props, ref: rootRef, className: className,
|
|
27
|
+
return (_jsxs("div", { ...props, ref: rootRef, className: className, style: styles(style, FIXED_STYLES.root), children: [_jsx(Video, { autoLoop: autoLoop, autoPlay: autoPlay, hasControls: hasControls, isMuted: isMuted, playsInline: playsInline, posterSrc: posterSrc, src: src, style: styles(FIXED_STYLES.viewport, {
|
|
28
28
|
width: `${videoSize.width}px`,
|
|
29
29
|
height: `${videoSize.height}px`,
|
|
30
30
|
maxWidth: 'unset',
|
|
@@ -36,8 +36,8 @@ export const CoverVideo = forwardRef(({ className, children, style, aspectRatio:
|
|
|
36
36
|
}),
|
|
37
37
|
}), components.content] }));
|
|
38
38
|
});
|
|
39
|
-
export const CoverVideoViewport = ({ children, ...props }) => (_jsx("div", { ...props,
|
|
40
|
-
export const CoverVideoContent = ({ children, ...props }) => (_jsx("div", { ...props,
|
|
39
|
+
export const CoverVideoViewport = ({ children, ...props }) => (_jsx("div", { ...props, children: children }));
|
|
40
|
+
export const CoverVideoContent = ({ children, ...props }) => (_jsx("div", { ...props, children: children }));
|
|
41
41
|
const FIXED_STYLES = asStyleDict({
|
|
42
42
|
root: {
|
|
43
43
|
overflow: 'hidden',
|
package/components/Dial.js
CHANGED
|
@@ -15,7 +15,7 @@ export const Dial = forwardRef(({ children, style, angle = 0, knobLength = 30, k
|
|
|
15
15
|
knob: DialKnob,
|
|
16
16
|
});
|
|
17
17
|
const fixedStyles = getFixedStyles({ angle, diameter });
|
|
18
|
-
return (_jsxs("div", { ...props, ref: ref,
|
|
18
|
+
return (_jsxs("div", { ...props, ref: ref, style: styles(style, fixedStyles.root), children: [_jsx("div", { style: fixedStyles.trackContainer, children: _jsx("svg", { height: diameter, style: fixedStyles.svgContainer, viewBox: `0 0 ${diameter} ${diameter}`, width: diameter, children: cloneStyledElement(components.track ?? _jsx(DialTrack, {}), {
|
|
19
19
|
cx: radius,
|
|
20
20
|
cy: radius,
|
|
21
21
|
fill: 'none',
|
|
@@ -28,8 +28,8 @@ export const Dial = forwardRef(({ children, style, angle = 0, knobLength = 30, k
|
|
|
28
28
|
strokeWidth: knobThickness,
|
|
29
29
|
}) }) })] }));
|
|
30
30
|
});
|
|
31
|
-
export const DialTrack = ({ ...props }) => (_jsx("circle", { ...props
|
|
32
|
-
export const DialKnob = ({ ...props }) => (_jsx("path", { ...props
|
|
31
|
+
export const DialTrack = ({ ...props }) => (_jsx("circle", { ...props }));
|
|
32
|
+
export const DialKnob = ({ ...props }) => (_jsx("path", { ...props }));
|
|
33
33
|
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
|
|
34
34
|
const angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
|
35
35
|
return {
|
package/components/Dropdown.js
CHANGED
|
@@ -85,14 +85,16 @@ export const Dropdown = forwardRef(({ children, className, style, collapsesOnSel
|
|
|
85
85
|
window.removeEventListener('click', clickOutsideHandler);
|
|
86
86
|
};
|
|
87
87
|
}, [isCollapsed]);
|
|
88
|
-
return (_jsx("div", { ...props, ref: ref, className: clsx(className, { collapsed: isCollapsed, expanded: !isCollapsed }),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
return (_jsx("div", { ...props, ref: ref, className: clsx(className, { collapsed: isCollapsed, expanded: !isCollapsed }), style: styles(style, fixedStyles.root), children: _jsxs("div", { ref: bodyRef, style: styles(fixedStyles.body), children: [ToggleComponent ? (_jsx(ToggleComponent, { "aria-expanded": !isCollapsed, "aria-haspopup": 'listbox', style: styles(fixedStyles.toggle), onClick: () => toggle(), onCustomEvent: (name, info) => onToggleCustomEvent?.(name, info) })) : (cloneStyledElement(components.toggle ?? _jsx(DropdownToggle, {}), {
|
|
89
|
+
'aria-haspopup': 'listbox',
|
|
90
|
+
'aria-expanded': !isCollapsed,
|
|
91
|
+
'style': styles(fixedStyles.toggle),
|
|
92
|
+
'onClick': () => toggle(),
|
|
93
|
+
}, _jsx("span", { dangerouslySetInnerHTML: { __html: label?.(selection) ?? (selection.length > 0 ? selection.map(t => items[t].label).join(', ') : '') } }), isCollapsed ? components.collapseIcon ?? components.expandIcon : components.expandIcon)), _jsx(Collection, { isSelectionTogglable: isSelectionTogglable, ItemComponent: ItemComponent, itemLength: itemLength, itemPadding: itemPadding, items: items, layout: layout, numSegments: numSegments, orientation: orientation, selection: selection, selectionMode: selectionMode, style: styles(fixedStyles.collection), onActivateAt: onActivateAt, onDeselectAt: onDeselectAt, onSelectAt: selectAtHandler, onSelectionChange: selectionChangeHandler })] }) }));
|
|
92
94
|
});
|
|
93
|
-
export const DropdownToggle = ({ children, ...props }) => (_jsx("button", { ...props,
|
|
94
|
-
export const DropdownExpandIcon = ({ children, ...props }) => (_jsx("figure", { ...props, "
|
|
95
|
-
export const DropdownCollapseIcon = ({ children, ...props }) => (_jsx("figure", { ...props, "
|
|
95
|
+
export const DropdownToggle = ({ children, ...props }) => (_jsx("button", { ...props, children: children }));
|
|
96
|
+
export const DropdownExpandIcon = ({ children, ...props }) => (_jsx("figure", { ...props, "aria-hidden": true, children: children }));
|
|
97
|
+
export const DropdownCollapseIcon = ({ children, ...props }) => (_jsx("figure", { ...props, "aria-hidden": true, children: children }));
|
|
96
98
|
function sortIndices(indices) {
|
|
97
99
|
return indices.sort((a, b) => a - b);
|
|
98
100
|
}
|
package/components/FlatSVG.js
CHANGED
|
@@ -39,6 +39,6 @@ export const FlatSVG = forwardRef(({ svg, shouldStripClasses = true, shouldStrip
|
|
|
39
39
|
const xml = parser.parse(svg);
|
|
40
40
|
return builder.build(xml);
|
|
41
41
|
};
|
|
42
|
-
return (_jsx("figure", { ...props, ref: ref, dangerouslySetInnerHTML: { __html: sanitizedMarkup() },
|
|
42
|
+
return (_jsx("figure", { ...props, ref: ref, dangerouslySetInnerHTML: { __html: sanitizedMarkup() }, role: 'img' }));
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(FlatSVG, 'displayName', { value: 'FlatSVG', writable: false });
|
package/components/Image.js
CHANGED
|
@@ -42,6 +42,6 @@ export const Image = forwardRef(({ alt, loadingMode = 'preload', sizes, src: fal
|
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
onSizeChange?.(size);
|
|
44
44
|
}, [size]);
|
|
45
|
-
return (_jsx("img", { ...props, ref: ref, alt: alt,
|
|
45
|
+
return (_jsx("img", { ...props, ref: ref, alt: alt, loading: loadingMode === 'lazy' ? 'lazy' : 'eager', sizes: sizesValue, src: fallbackSrc, srcSet: srcSetValue }));
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(Image, 'displayName', { value: 'Image', writable: false });
|
|
@@ -45,6 +45,7 @@ export const MasonryGrid = forwardRef(({ alignSections = false, children, classN
|
|
|
45
45
|
continue;
|
|
46
46
|
const base = computeBaseFromElement(child, sections);
|
|
47
47
|
const [colIdx, y] = computeNextAvailableSectionAndLengthByBase(sectionHeights, base);
|
|
48
|
+
child.role = 'gridcell';
|
|
48
49
|
child.style.position = 'absolute';
|
|
49
50
|
child.style.width = `calc(${100 / numSections * base}% - ${horizontalSpacing * (numSections - 1) / numSections * base}px + ${horizontalSpacing * (base - 1)}px)`;
|
|
50
51
|
child.style.height = '';
|
|
@@ -137,7 +138,7 @@ export const MasonryGrid = forwardRef(({ alignSections = false, children, classN
|
|
|
137
138
|
}, [children]);
|
|
138
139
|
const fixedClassNames = getFixedClassNames({ orientation });
|
|
139
140
|
const fixedStyles = getFixedStyles({ orientation, minHeight, minWidth });
|
|
140
|
-
return (_jsx("div", { ...props, ref: ref, className: clsx(className, fixedClassNames.root),
|
|
141
|
+
return (_jsx("div", { ...props, ref: ref, className: clsx(className, fixedClassNames.root), role: 'grid', children: _jsx("div", { ref: bodyRef, style: fixedStyles.body, children: children }) }));
|
|
141
142
|
});
|
|
142
143
|
function getFixedClassNames({ orientation = 'horizontal' }) {
|
|
143
144
|
return asClassNameDict({
|
|
@@ -12,6 +12,6 @@ export const OptionButton = forwardRef(({ index = 0, isDisabled = false, options
|
|
|
12
12
|
const nextValue = typeof nextOption === 'string' ? nextOption : nextOption?.value;
|
|
13
13
|
onChange?.(nextValue, nextIndex);
|
|
14
14
|
};
|
|
15
|
-
return (_jsx("button", { ...props, ref: ref, "
|
|
15
|
+
return (_jsx("button", { ...props, ref: ref, "aria-disabled": isDisabled, "aria-label": label, disabled: isDisabled, onClick: onClick, children: label }));
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(OptionButton, 'displayName', { value: 'OptionButton', writable: false });
|
package/components/Panorama.js
CHANGED
|
@@ -54,7 +54,7 @@ export const Panorama = forwardRef(({ angle: externalAngle = 0, speed = 1, src,
|
|
|
54
54
|
onImageSizeChange?.(imageSize);
|
|
55
55
|
}, [imageSize?.width, imageSize?.height]);
|
|
56
56
|
const fixedStyles = getFixedStyles({ src, displacement });
|
|
57
|
-
return (_jsx("div", { ...props, ref: ref, "
|
|
57
|
+
return (_jsx("div", { ...props, ref: ref, "aria-valuenow": angle, role: 'slider', children: _jsx("div", { ref: bodyRef, style: fixedStyles.body }) }));
|
|
58
58
|
});
|
|
59
59
|
function getFixedStyles({ src = '', displacement = NaN }) {
|
|
60
60
|
return asStyleDict({
|
|
@@ -53,7 +53,7 @@ export const PanoramaSlider = forwardRef(({ className, style, angle = 0, autoDim
|
|
|
53
53
|
indicator: PanoramaSliderIndicator,
|
|
54
54
|
});
|
|
55
55
|
const fixedStyles = getFixedStyles({ autoDimension, panoramaRect, aspectRatio, reticleWidth });
|
|
56
|
-
return (_jsxs("div", { ...props, ref: ref, className: clsx(className, { dragging: isDragging }),
|
|
56
|
+
return (_jsxs("div", { ...props, ref: ref, className: clsx(className, { dragging: isDragging }), style: styles(style, fixedStyles.root), children: [_jsx(Panorama, { ref: panoramaRef, angle: angle, speed: speed, src: src, style: fixedStyles.panorama, zeroAnchor: adjustedZeroAnchor, onAngleChange: onAngleChange, onDragEnd: dragEndHandler, onDragStart: dragStartHandler, onImageSizeChange: setImageSize, onLoadImageComplete: onLoadImageComplete, onLoadImageError: onLoadImageError, onLoadImageStart: onLoadImageStart, onPositionChange: onPositionChange }), _jsx("div", { style: fixedStyles.body, children: _jsxs("div", { style: fixedStyles.controls, children: [cloneStyledElement(components.track ?? _jsx(PanoramaSliderTrack, {}), {
|
|
57
57
|
className: clsx({ dragging: isDragging }),
|
|
58
58
|
style: styles(fixedStyles.track),
|
|
59
59
|
}), cloneStyledElement(components.reticle ?? _jsx(PanoramaSliderReticle, {}), {
|
|
@@ -67,9 +67,9 @@ export const PanoramaSlider = forwardRef(({ className, style, angle = 0, autoDim
|
|
|
67
67
|
style: styles(fixedStyles.indicator),
|
|
68
68
|
})] }));
|
|
69
69
|
});
|
|
70
|
-
export const PanoramaSliderTrack = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref
|
|
71
|
-
export const PanoramaSliderReticle = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref
|
|
72
|
-
export const PanoramaSliderIndicator = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref
|
|
70
|
+
export const PanoramaSliderTrack = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref })));
|
|
71
|
+
export const PanoramaSliderReticle = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref })));
|
|
72
|
+
export const PanoramaSliderIndicator = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref })));
|
|
73
73
|
function getFixedStyles({ autoDimension = 'width', panoramaRect = Rect.make(), aspectRatio = 0, reticleWidth = 0 }) {
|
|
74
74
|
return asStyleDict({
|
|
75
75
|
root: {
|
|
@@ -90,7 +90,7 @@ export const RangeSlider = forwardRef(({ children, className, decimalPlaces = 2,
|
|
|
90
90
|
label: RangeSliderLabel,
|
|
91
91
|
});
|
|
92
92
|
const fixedStyles = getFixedStyles({ orientation, highlightLength, start, knobPadding, knobWidth, knobHeight });
|
|
93
|
-
return (_jsx("div", { ...props, ref: ref, className: clsx(className, orientation),
|
|
93
|
+
return (_jsx("div", { ...props, ref: ref, "aria-valuemax": maxValue, "aria-valuemin": minValue, className: clsx(className, orientation), role: 'slider', children: _jsxs("div", { ref: bodyRef, style: fixedStyles.body, children: [cloneStyledElement(components.gutter ?? _jsx(RangeSliderGutter, {}), {
|
|
94
94
|
style: styles(fixedStyles.gutter),
|
|
95
95
|
}), cloneStyledElement(components.highlight ?? _jsx(RangeSliderHighlight, {}), {
|
|
96
96
|
style: styles(fixedStyles.highlight),
|
|
@@ -144,10 +144,10 @@ export const RangeSlider = forwardRef(({ children, className, decimalPlaces = 2,
|
|
|
144
144
|
style: styles(fixedStyles.label),
|
|
145
145
|
}, Number(endValue.toFixed(decimalPlaces)).toLocaleString()))] }) }));
|
|
146
146
|
});
|
|
147
|
-
export const RangeSliderGutter = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref
|
|
148
|
-
export const RangeSliderLabel = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref
|
|
149
|
-
export const RangeSliderHighlight = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref
|
|
150
|
-
export const RangeSliderKnob = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref
|
|
147
|
+
export const RangeSliderGutter = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref })));
|
|
148
|
+
export const RangeSliderLabel = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref })));
|
|
149
|
+
export const RangeSliderHighlight = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref })));
|
|
150
|
+
export const RangeSliderKnob = forwardRef(({ ...props }, ref) => (_jsx("div", { ...props, ref: ref })));
|
|
151
151
|
function getFixedStyles({ orientation = 'horizontal', knobWidth = 0, knobHeight = 0, highlightLength = 0, start = 0, knobPadding = 0 }) {
|
|
152
152
|
return asStyleDict({
|
|
153
153
|
body: {
|
|
@@ -16,6 +16,6 @@ export const SelectableButton = forwardRef(({ children, className, isDeselectabl
|
|
|
16
16
|
onSelect?.();
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
return (_jsx("button", { ...props, ref: ref, className: clsx(className, { active: isSelected, disabled: isDisabled || (isSelected && !isDeselectable) }),
|
|
19
|
+
return (_jsx("button", { ...props, ref: ref, "aria-disabled": isDisabled, "aria-label": label, "aria-selected": isSelected, className: clsx(className, { active: isSelected, disabled: isDisabled || (isSelected && !isDeselectable) }), disabled: isDisabled || (isSelected && !isDeselectable), onClick: onClick, children: children ?? label }));
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(SelectableButton, 'displayName', { value: 'SelectableButton', writable: false });
|
package/components/Slider.js
CHANGED
|
@@ -84,7 +84,7 @@ export const Slider = forwardRef(({ children, className, isInverted = false, isT
|
|
|
84
84
|
});
|
|
85
85
|
const fixedClassNames = getFixedClassNames({ orientation, isAtEnd, isAtStart, isDragging, isReleasing });
|
|
86
86
|
const fixedStyles = getFixedStyles({ orientation, isDragging, naturalPosition, knobHeight, knobWidth, isTrackInteractive });
|
|
87
|
-
return (_jsx("div", { ...props, ref: ref, className: clsx(className, fixedClassNames.root),
|
|
87
|
+
return (_jsx("div", { ...props, ref: ref, "aria-orientation": orientation, "aria-valuenow": position, className: clsx(className, fixedClassNames.root), role: 'slider', children: _jsxs("div", { ref: bodyRef, style: fixedStyles.body, children: [cloneStyledElement(components.track ?? _jsx(SliderTrack, {}), {
|
|
88
88
|
className: clsx('start', fixedClassNames.track),
|
|
89
89
|
style: styles(fixedStyles.track, orientation === 'vertical' ? {
|
|
90
90
|
height: `calc(${naturalPosition * 100}% - ${trackPadding <= 0 ? 0 : knobHeight * 0.5}px - ${trackPadding}px)`,
|
|
@@ -112,9 +112,9 @@ export const Slider = forwardRef(({ children, className, isInverted = false, isT
|
|
|
112
112
|
style: styles(fixedStyles.label),
|
|
113
113
|
}, labelProvider(position))) })] }) }));
|
|
114
114
|
});
|
|
115
|
-
export const SliderTrack = ({ ...props }) => (_jsx("div", { ...props
|
|
116
|
-
export const SliderKnob = ({ ...props }) => (_jsx("div", { ...props
|
|
117
|
-
export const SliderLabel = ({ ...props }) => (_jsx("div", { ...props
|
|
115
|
+
export const SliderTrack = ({ ...props }) => (_jsx("div", { ...props }));
|
|
116
|
+
export const SliderKnob = ({ ...props }) => (_jsx("div", { ...props }));
|
|
117
|
+
export const SliderLabel = ({ ...props }) => (_jsx("div", { ...props }));
|
|
118
118
|
function getFixedClassNames({ orientation = 'vertical', isAtEnd = false, isAtStart = false, isDragging = false, isReleasing = false }) {
|
|
119
119
|
return asClassNameDict({
|
|
120
120
|
root: clsx(orientation, {
|
|
@@ -106,7 +106,7 @@ export const StepwiseSlider = forwardRef(({ children, className, index: external
|
|
|
106
106
|
onPositionChange?.(nearestPosition, true);
|
|
107
107
|
}
|
|
108
108
|
}, [isDragging]);
|
|
109
|
-
return (_jsx("div", { ...props, ref: ref, className: clsx(className, fixedClassNames.root),
|
|
109
|
+
return (_jsx("div", { ...props, ref: ref, "aria-valuenow": index, className: clsx(className, fixedClassNames.root), role: 'slider', children: _jsxs("div", { ref: bodyRef, style: fixedStyles.body, children: [cloneStyledElement(components.track ?? _jsx(StepwiseSliderTrack, {}), {
|
|
110
110
|
className: clsx('start', fixedClassNames.track),
|
|
111
111
|
style: styles(fixedStyles.track, orientation === 'vertical' ? {
|
|
112
112
|
height: `calc(${naturalPosition * 100}% - ${trackPadding <= 0 ? 0 : knobHeight * 0.5}px - ${trackPadding}px)`,
|
|
@@ -134,9 +134,9 @@ export const StepwiseSlider = forwardRef(({ children, className, index: external
|
|
|
134
134
|
style: styles(fixedStyles.label),
|
|
135
135
|
}, labelProvider(position, getNearestIndexByPosition(position, steps)))) })] }) }));
|
|
136
136
|
});
|
|
137
|
-
export const StepwiseSliderTrack = ({ ...props }) => (_jsx("div", { ...props
|
|
138
|
-
export const StepwiseSliderKnob = ({ ...props }) => (_jsx("div", { ...props
|
|
139
|
-
export const StepwiseSliderLabel = ({ ...props }) => (_jsx("div", { ...props
|
|
137
|
+
export const StepwiseSliderTrack = ({ ...props }) => (_jsx("div", { ...props }));
|
|
138
|
+
export const StepwiseSliderKnob = ({ ...props }) => (_jsx("div", { ...props }));
|
|
139
|
+
export const StepwiseSliderLabel = ({ ...props }) => (_jsx("div", { ...props }));
|
|
140
140
|
/**
|
|
141
141
|
* Generates a set of steps compatible with this component.
|
|
142
142
|
*
|
|
@@ -62,6 +62,6 @@ export const SwipeContainer = forwardRef(({ children, isEnabled = true, threshol
|
|
|
62
62
|
setDragEndPosition(undefined);
|
|
63
63
|
setDragStartTime(NaN);
|
|
64
64
|
};
|
|
65
|
-
return (_jsx("div", { ...props, ref: ref,
|
|
65
|
+
return (_jsx("div", { ...props, ref: ref, onMouseDown: event => onDragStart(event.clientX, event.clientY), onMouseLeave: () => onDragCancel(), onMouseMove: event => onDragMove(event.clientX, event.clientY), onMouseUp: () => onDragEnd(), onTouchEnd: () => onDragEnd(), onTouchMove: event => onDragMove(event.targetTouches[0].clientX, event.targetTouches[0].clientY), onTouchStart: event => onDragStart(event.targetTouches[0].clientX, event.targetTouches[0].clientY), children: children }));
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(SwipeContainer, 'displayName', { value: 'SwipeContainer', writable: false });
|
|
@@ -2,6 +2,7 @@ import { type HTMLAttributes } from 'react';
|
|
|
2
2
|
export type TextFieldProps = HTMLAttributes<HTMLInputElement> & {
|
|
3
3
|
emptyValue?: string;
|
|
4
4
|
isDisabled?: boolean;
|
|
5
|
+
isRequired?: boolean;
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
value?: string;
|
|
7
8
|
formatter?: (prevValue: string, newValue: string) => string;
|
|
@@ -12,6 +13,7 @@ export type TextFieldProps = HTMLAttributes<HTMLInputElement> & {
|
|
|
12
13
|
export declare const TextField: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLInputElement> & {
|
|
13
14
|
emptyValue?: string;
|
|
14
15
|
isDisabled?: boolean;
|
|
16
|
+
isRequired?: boolean;
|
|
15
17
|
placeholder?: string;
|
|
16
18
|
value?: string;
|
|
17
19
|
formatter?: (prevValue: string, newValue: string) => string;
|
package/components/TextField.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef, useEffect } from 'react';
|
|
4
4
|
import { usePrevious } from '../hooks/usePrevious.js';
|
|
5
|
-
export const TextField = forwardRef(({ className, emptyValue = '', isDisabled = false, placeholder, value: externalValue, formatter, onFocus, onUnfocus, onValueChange, ...props }, ref) => {
|
|
5
|
+
export const TextField = forwardRef(({ className, emptyValue = '', isDisabled = false, isRequired = false, placeholder, value: externalValue, formatter, onFocus, onUnfocus, onValueChange, ...props }, ref) => {
|
|
6
6
|
const handleValueChange = (newValue) => {
|
|
7
7
|
const formatted = (newValue !== emptyValue) ? (formatter?.(value, newValue) ?? newValue) : emptyValue;
|
|
8
8
|
if (formatted === value)
|
|
@@ -16,6 +16,6 @@ export const TextField = forwardRef(({ className, emptyValue = '', isDisabled =
|
|
|
16
16
|
return;
|
|
17
17
|
handleValueChange(value);
|
|
18
18
|
}, [value]);
|
|
19
|
-
return (_jsx("input", { ...props, ref: ref, className: clsx(className, { disabled: isDisabled }),
|
|
19
|
+
return (_jsx("input", { ...props, ref: ref, "aria-disabled": isDisabled, "aria-placeholder": placeholder, "aria-required": isRequired, className: clsx(className, { disabled: isDisabled }), disabled: isDisabled, placeholder: placeholder, required: isRequired, type: 'text', value: value, onBlur: ({ target }) => onUnfocus?.(target.value), onChange: ({ target }) => handleValueChange(target.value), onFocus: ({ target }) => onFocus?.(target.value) }));
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(TextField, 'displayName', { value: 'TextField', writable: false });
|
package/components/Video.js
CHANGED
|
@@ -60,6 +60,6 @@ export const Video = forwardRef(({ autoLoop = true, autoPlay = true, hasControls
|
|
|
60
60
|
return;
|
|
61
61
|
videoRef.current.pause();
|
|
62
62
|
};
|
|
63
|
-
return (_jsx("video", { ...props, ref: ref, autoPlay: autoPlay, controls: hasControls,
|
|
63
|
+
return (_jsx("video", { ...props, ref: ref, autoPlay: autoPlay, controls: hasControls, loop: autoLoop, muted: isMuted, playsInline: playsInline, poster: posterSrc, onCanPlay: canPlayHandler, onEnded: endHandler, onPause: pauseHandler, onPlay: playHandler, children: _jsx("source", { src: src }) }));
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(Video, 'displayName', { value: 'Video', writable: false });
|
|
@@ -10,14 +10,13 @@ export function WithTooltip({ children, className, style, alignment: externalAli
|
|
|
10
10
|
const dialog = document.createElement('span');
|
|
11
11
|
dialog.className = clsx(className);
|
|
12
12
|
dialog.innerHTML = hint;
|
|
13
|
-
dialog.
|
|
13
|
+
dialog.role = 'tooltip';
|
|
14
14
|
const alignment = externalAlignment ?? (targetRef.current ? computeAlignment(targetRef.current, threshold) : 'tl');
|
|
15
15
|
const fullDialogSize = computeMaxSize(dialog);
|
|
16
16
|
const fixedStyles = getFixedStyles({ alignment, arrowSize: Size.make(arrowWidth, arrowHeight), gap, maxDialogWidth: maxWidth, fullDialogWidth: fullDialogSize.width, targetWidth: targetRect.width });
|
|
17
17
|
const dialogStyle = styles(style, fixedStyles.dialog);
|
|
18
18
|
Object.keys(dialogStyle).forEach(rule => dialog.style[rule] = dialogStyle[rule]);
|
|
19
19
|
const arrow = document.createElement('span');
|
|
20
|
-
arrow.setAttribute('data-child', 'arrow');
|
|
21
20
|
Object.keys(fixedStyles.arrow).forEach(rule => arrow.style[rule] = fixedStyles.arrow[rule]);
|
|
22
21
|
dialog.appendChild(arrow);
|
|
23
22
|
return dialog;
|
|
@@ -26,11 +25,13 @@ export function WithTooltip({ children, className, style, alignment: externalAli
|
|
|
26
25
|
if (!dialogRef.current)
|
|
27
26
|
return;
|
|
28
27
|
dialogRef.current.style.opacity = '1';
|
|
28
|
+
dialogRef.current.ariaHidden = 'false';
|
|
29
29
|
};
|
|
30
30
|
const mouseLeaveHandler = () => {
|
|
31
31
|
if (!dialogRef.current)
|
|
32
32
|
return;
|
|
33
33
|
dialogRef.current.style.opacity = '0';
|
|
34
|
+
dialogRef.current.ariaHidden = 'true';
|
|
34
35
|
};
|
|
35
36
|
const targetRef = useRef(null);
|
|
36
37
|
const dialogRef = useRef();
|