@servicetitan/anvil2 1.45.2 → 1.46.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/CHANGELOG.md +12 -0
- package/dist/{Calendar-BK861SAW.js → Calendar-BQ5F2ENO.js} +2 -2
- package/dist/{Calendar-BK861SAW.js.map → Calendar-BQ5F2ENO.js.map} +1 -1
- package/dist/Calendar.js +1 -1
- package/dist/{Checkbox-ZphVb1l0.js → Checkbox-DDrmVC-u.js} +2 -2
- package/dist/{Checkbox-ZphVb1l0.js.map → Checkbox-DDrmVC-u.js.map} +1 -1
- package/dist/{Checkbox-CYNjFdtO.js → Checkbox-Dl4KTwEJ.js} +2 -2
- package/dist/{Checkbox-CYNjFdtO.js.map → Checkbox-Dl4KTwEJ.js.map} +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/{useInfiniteCombobox-BaYWUxjg.js → Combobox-B9nesJuc.js} +18 -185
- package/dist/Combobox-B9nesJuc.js.map +1 -0
- package/dist/Combobox.js +2 -1
- package/dist/Combobox.js.map +1 -1
- package/dist/{DateField-DnasO2rB.js → DateField-DXxPsRtf.js} +2 -2
- package/dist/{DateField-DnasO2rB.js.map → DateField-DXxPsRtf.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DateFieldRange-Ba-8T-Nz.js → DateFieldRange-Xauviu1w.js} +6 -6
- package/dist/DateFieldRange-Xauviu1w.js.map +1 -0
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-BBu5Hi9c.js → DateFieldSingle-yLnwpVzd.js} +4 -4
- package/dist/{DateFieldSingle-BBu5Hi9c.js.map → DateFieldSingle-yLnwpVzd.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/Dnd.js +1 -1
- package/dist/DndSort.js +1 -1
- package/dist/{ListView-DEAMQopB.js → ListView-pb3rIcze.js} +2 -2
- package/dist/{ListView-DEAMQopB.js.map → ListView-pb3rIcze.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{SearchField-BKXkoWPs.js → SearchField-Bb0uObwG.js} +2 -2
- package/dist/{SearchField-BKXkoWPs.js.map → SearchField-Bb0uObwG.js.map} +1 -1
- package/dist/SearchField.js +1 -1
- package/dist/{SelectCard-BWh8Yp7T.js → SelectCard-BTYZg9TG.js} +2 -2
- package/dist/{SelectCard-BWh8Yp7T.js.map → SelectCard-BTYZg9TG.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/Toolbar-D4zuUFhb.js +2077 -0
- package/dist/Toolbar-D4zuUFhb.js.map +1 -0
- package/dist/Toolbar.css +139 -28
- package/dist/Toolbar.d.ts +3 -3
- package/dist/Toolbar.js +1 -1
- package/dist/beta/components/Toolbar/Filters/FilterButton.d.ts +30 -0
- package/dist/beta/components/Toolbar/Filters/FilterDateRange.d.ts +37 -0
- package/dist/beta/components/Toolbar/Filters/FilterDateSingle.d.ts +30 -0
- package/dist/beta/components/Toolbar/Filters/FilterDrawer.d.ts +15 -0
- package/dist/beta/components/Toolbar/Filters/FilterGroup.d.ts +25 -0
- package/dist/beta/components/Toolbar/Filters/FilterItemWrapper.d.ts +24 -0
- package/dist/beta/components/Toolbar/Filters/FilterSelect.d.ts +29 -0
- package/dist/beta/components/Toolbar/Filters/FilterToggleButton.d.ts +24 -0
- package/dist/beta/components/Toolbar/Filters/internal/FilterGroupContext.d.ts +40 -0
- package/dist/beta/components/Toolbar/Filters/internal/types.d.ts +130 -0
- package/dist/beta/components/Toolbar/Filters/internal/utils/filter-state.d.ts +40 -0
- package/dist/beta/components/Toolbar/Filters/internal/utils/test.d.ts +57 -0
- package/dist/beta/components/Toolbar/Toolbar.d.ts +302 -0
- package/dist/beta/components/Toolbar/ToolbarButton.d.ts +41 -0
- package/dist/beta/components/Toolbar/ToolbarButtonLink.d.ts +43 -0
- package/dist/beta/components/Toolbar/ToolbarButtonToggle.d.ts +42 -0
- package/dist/beta/components/Toolbar/ToolbarControlGroup.d.ts +20 -0
- package/dist/beta/components/Toolbar/ToolbarSearchField.d.ts +20 -0
- package/dist/beta/components/Toolbar/ToolbarSelect.d.ts +108 -0
- package/dist/beta/components/Toolbar/index.d.ts +9 -0
- package/dist/beta/components/Toolbar/internal/ToolbarItemOverflowContext.d.ts +19 -0
- package/dist/beta/components/Toolbar/internal/ToolbarItemWrapper.d.ts +40 -0
- package/dist/beta/components/Toolbar/internal/ToolbarOverflowContext.d.ts +35 -0
- package/dist/beta/components/Toolbar/internal/ToolbarOverflowMenu.d.ts +29 -0
- package/dist/beta/components/Toolbar/internal/utils/accessibility.d.ts +26 -0
- package/dist/beta/components/Toolbar/internal/utils/test.d.ts +29 -0
- package/dist/beta/components/Toolbar/types.d.ts +50 -0
- package/dist/beta/components/index.d.ts +1 -0
- package/dist/beta/index.d.ts +1 -0
- package/dist/beta.d.ts +2 -0
- package/dist/beta.js +2 -0
- package/dist/beta.js.map +1 -0
- package/dist/components/Combobox/ComboboxTypes.d.ts +8 -0
- package/dist/components/DateFieldRange/internal/DateFieldRangeCalendar.d.ts +1 -1
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/{indeterminate_check_box-Bg24oeHy.js → indeterminate_check_box-RY9zr3xS.js} +17 -17
- package/dist/{indeterminate_check_box-Bg24oeHy.js.map → indeterminate_check_box-RY9zr3xS.js.map} +1 -1
- package/dist/indeterminate_check_box.css +72 -66
- package/dist/{index-CqdP5W00.js → index-V5Ez2gq_.js} +2 -2
- package/dist/{index-CqdP5W00.js.map → index-V5Ez2gq_.js.map} +1 -1
- package/dist/index.css +125 -26
- package/dist/index.js +756 -24
- package/dist/index.js.map +1 -1
- package/dist/index2.css +88 -105
- package/dist/internal/hooks/index.d.ts +1 -0
- package/dist/internal/hooks/useContainerQuery/index.d.ts +1 -0
- package/dist/internal/hooks/useContainerQuery/useContainerQuery.d.ts +46 -0
- package/dist/{useDateFieldOrchestration-DPLftOxu.js → useDateFieldOrchestration-BNJCsRkS.js} +2 -2
- package/dist/{useDateFieldOrchestration-DPLftOxu.js.map → useDateFieldOrchestration-BNJCsRkS.js.map} +1 -1
- package/dist/useInfiniteCombobox-WcRgC9p6.js +179 -0
- package/dist/useInfiniteCombobox-WcRgC9p6.js.map +1 -0
- package/dist/useIntersectionObserver-BEmMDO3P.js +70 -0
- package/dist/useIntersectionObserver-BEmMDO3P.js.map +1 -0
- package/package.json +2 -1
- package/dist/DateFieldRange-Ba-8T-Nz.js.map +0 -1
- package/dist/Toolbar-DK7tXy_W.js +0 -807
- package/dist/Toolbar-DK7tXy_W.js.map +0 -1
- package/dist/useInfiniteCombobox-BaYWUxjg.js.map +0 -1
- /package/dist/{useInfiniteCombobox.css → Combobox.css} +0 -0
package/dist/Toolbar-DK7tXy_W.js
DELETED
|
@@ -1,807 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useRef, useEffect, useContext, createContext, useId, useCallback, forwardRef, useMemo } from 'react';
|
|
3
|
-
import { B as Button } from './Button-BxFXQ0-n.js';
|
|
4
|
-
import { T as Tooltip } from './Tooltip-BI3Xs75X.js';
|
|
5
|
-
import { g as getKeyboardFocusableElements } from './getKeyboardFocusableElements-QqcABz0D.js';
|
|
6
|
-
import { c as cx } from './index-tZvMCc77.js';
|
|
7
|
-
import { useTrackingId } from './useTrackingId.js';
|
|
8
|
-
import { B as ButtonToggle } from './ButtonToggle-pSwg7NvT.js';
|
|
9
|
-
import { B as ButtonLink } from './ButtonLink-CXv65WVV.js';
|
|
10
|
-
import { S as SvgArrowDropDown } from './arrow_drop_down-ChAdBDux.js';
|
|
11
|
-
import { L as Listbox } from './Listbox-CUhMbFm2.js';
|
|
12
|
-
import { P as Popover } from './Popover-r26xMIfm.js';
|
|
13
|
-
import { F as Flex } from './Flex-BdQMekvA.js';
|
|
14
|
-
import { S as SvgMoreHoriz } from './more_horiz-DJgdQiy0.js';
|
|
15
|
-
import { S as SvgMoreVert } from './more_vert-C_lJSyxt.js';
|
|
16
|
-
import { I as Icon } from './Icon-D8SPKeO4.js';
|
|
17
|
-
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-DjD5IMh0.js';
|
|
18
|
-
import { u as useMergeRefs } from './useMergeRefs-Bde85AWI.js';
|
|
19
|
-
|
|
20
|
-
import './Toolbar.css';function useIntersectionObserver({
|
|
21
|
-
threshold = 0,
|
|
22
|
-
root = null,
|
|
23
|
-
rootMargin = "0%",
|
|
24
|
-
freezeOnceVisible = false,
|
|
25
|
-
initialIsIntersecting = false,
|
|
26
|
-
onChange
|
|
27
|
-
} = {}) {
|
|
28
|
-
const [ref, setRef] = useState(null);
|
|
29
|
-
const [state, setState] = useState(() => ({
|
|
30
|
-
isIntersecting: initialIsIntersecting,
|
|
31
|
-
entry: void 0
|
|
32
|
-
}));
|
|
33
|
-
const callbackRef = useRef();
|
|
34
|
-
callbackRef.current = onChange;
|
|
35
|
-
const frozen = state.entry?.isIntersecting && freezeOnceVisible;
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (!ref) return;
|
|
38
|
-
if (!("IntersectionObserver" in window)) return;
|
|
39
|
-
if (frozen) return;
|
|
40
|
-
const observer = new IntersectionObserver(
|
|
41
|
-
(entries) => {
|
|
42
|
-
const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];
|
|
43
|
-
entries.forEach((entry) => {
|
|
44
|
-
const isIntersecting = entry.isIntersecting && thresholds.some(
|
|
45
|
-
(threshold2) => entry.intersectionRatio >= threshold2
|
|
46
|
-
);
|
|
47
|
-
setState({ isIntersecting, entry });
|
|
48
|
-
if (callbackRef.current) {
|
|
49
|
-
callbackRef.current(isIntersecting, entry);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
{ threshold, root, rootMargin }
|
|
54
|
-
);
|
|
55
|
-
observer.observe(ref);
|
|
56
|
-
return () => {
|
|
57
|
-
observer.disconnect();
|
|
58
|
-
};
|
|
59
|
-
}, [
|
|
60
|
-
ref,
|
|
61
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
-
JSON.stringify(threshold),
|
|
63
|
-
root,
|
|
64
|
-
rootMargin,
|
|
65
|
-
frozen,
|
|
66
|
-
freezeOnceVisible
|
|
67
|
-
]);
|
|
68
|
-
const prevRef = useRef(null);
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (!ref && state.entry?.target && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {
|
|
71
|
-
prevRef.current = state.entry.target;
|
|
72
|
-
setState({ isIntersecting: initialIsIntersecting, entry: void 0 });
|
|
73
|
-
}
|
|
74
|
-
}, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);
|
|
75
|
-
const result = [
|
|
76
|
-
setRef,
|
|
77
|
-
!!state.isIntersecting,
|
|
78
|
-
state.entry
|
|
79
|
-
];
|
|
80
|
-
result.ref = result[0];
|
|
81
|
-
result.isIntersecting = result[1];
|
|
82
|
-
result.entry = result[2];
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const OverflowItemContext = createContext({
|
|
87
|
-
isInOverflowMenu: false
|
|
88
|
-
});
|
|
89
|
-
const useOverFlowItemContext = () => useContext(OverflowItemContext);
|
|
90
|
-
|
|
91
|
-
const ToolbarOverflowContext = createContext({
|
|
92
|
-
overflowItems: [],
|
|
93
|
-
addItem: () => {
|
|
94
|
-
return;
|
|
95
|
-
},
|
|
96
|
-
removeItem: () => {
|
|
97
|
-
return;
|
|
98
|
-
},
|
|
99
|
-
toolbarRef: { current: null },
|
|
100
|
-
orderedIds: [],
|
|
101
|
-
overflow: "wrap"
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
function getToolbarElements(toolbarElement) {
|
|
105
|
-
const toolbarContent = toolbarElement.querySelector(
|
|
106
|
-
'[data-anv="toolbar-content"]'
|
|
107
|
-
);
|
|
108
|
-
const mainItems = getKeyboardFocusableElements(toolbarContent).filter(
|
|
109
|
-
(item) => {
|
|
110
|
-
const isVisible = !item.closest('[aria-hidden="true"]');
|
|
111
|
-
return isVisible;
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
const overflowTrigger = toolbarElement.querySelector(
|
|
115
|
-
'[data-anv="toolbar-overflow-trigger"]'
|
|
116
|
-
);
|
|
117
|
-
return overflowTrigger ? [...mainItems, overflowTrigger] : mainItems;
|
|
118
|
-
}
|
|
119
|
-
function updateToolbarItemsTabIndex(toolbarElement, activeItem) {
|
|
120
|
-
if (!toolbarElement) return;
|
|
121
|
-
const items = getToolbarElements(toolbarElement);
|
|
122
|
-
if (!items.length) return;
|
|
123
|
-
let activeIndex = 0;
|
|
124
|
-
if (typeof activeItem === "number") {
|
|
125
|
-
activeIndex = Math.max(0, Math.min(activeItem, items.length - 1));
|
|
126
|
-
} else if (activeItem instanceof Element) {
|
|
127
|
-
const foundIndex = items.indexOf(activeItem);
|
|
128
|
-
if (foundIndex !== -1) {
|
|
129
|
-
activeIndex = foundIndex;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
items.forEach((item, index) => {
|
|
133
|
-
item.setAttribute("tabindex", index === activeIndex ? "0" : "-1");
|
|
134
|
-
});
|
|
135
|
-
return items[activeIndex];
|
|
136
|
-
}
|
|
137
|
-
function handleToolbarKeyDown(event, toolbarElement) {
|
|
138
|
-
if (!toolbarElement || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
139
|
-
const items = getToolbarElements(toolbarElement);
|
|
140
|
-
if (!items.length) return;
|
|
141
|
-
const activeElement = event.target;
|
|
142
|
-
if (!toolbarElement.contains(activeElement)) return;
|
|
143
|
-
const activeItem = items.find(
|
|
144
|
-
(item) => item === activeElement || Array.from(item.children).some((child) => child === activeElement)
|
|
145
|
-
);
|
|
146
|
-
const activeIndex = activeItem ? items.indexOf(activeItem) : -1;
|
|
147
|
-
if (activeIndex === -1) return;
|
|
148
|
-
let nextIndex = activeIndex;
|
|
149
|
-
const isVertical = toolbarElement.getAttribute("aria-orientation") === "vertical";
|
|
150
|
-
switch (event.key) {
|
|
151
|
-
case "ArrowLeft":
|
|
152
|
-
case "ArrowUp":
|
|
153
|
-
event.preventDefault();
|
|
154
|
-
if (isVertical && event.key === "ArrowUp" || !isVertical && event.key === "ArrowLeft") {
|
|
155
|
-
nextIndex = activeIndex <= 0 ? items.length - 1 : activeIndex - 1;
|
|
156
|
-
}
|
|
157
|
-
break;
|
|
158
|
-
case "ArrowRight":
|
|
159
|
-
case "ArrowDown":
|
|
160
|
-
event.preventDefault();
|
|
161
|
-
if (isVertical && event.key === "ArrowDown" || !isVertical && event.key === "ArrowRight") {
|
|
162
|
-
nextIndex = activeIndex >= items.length - 1 ? 0 : activeIndex + 1;
|
|
163
|
-
}
|
|
164
|
-
break;
|
|
165
|
-
case "Home":
|
|
166
|
-
event.preventDefault();
|
|
167
|
-
nextIndex = 0;
|
|
168
|
-
break;
|
|
169
|
-
case "End":
|
|
170
|
-
event.preventDefault();
|
|
171
|
-
nextIndex = items.length - 1;
|
|
172
|
-
break;
|
|
173
|
-
default:
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
updateToolbarItemsTabIndex(toolbarElement, nextIndex);
|
|
177
|
-
items[nextIndex]?.focus();
|
|
178
|
-
}
|
|
179
|
-
const handleMenuKeyboardNavigation = (event) => {
|
|
180
|
-
const menuItems = Array.from(
|
|
181
|
-
event.currentTarget.querySelectorAll('[role="menuitem"]')
|
|
182
|
-
).map((menuItem) => {
|
|
183
|
-
return getKeyboardFocusableElements(menuItem)[0] || menuItem;
|
|
184
|
-
});
|
|
185
|
-
if (!menuItems.length) return;
|
|
186
|
-
const currentIndex = menuItems.indexOf(document.activeElement);
|
|
187
|
-
if (currentIndex === -1) return;
|
|
188
|
-
let nextIndex = currentIndex;
|
|
189
|
-
const isModifierKey = event.altKey || event.ctrlKey || event.metaKey;
|
|
190
|
-
if (isModifierKey) return;
|
|
191
|
-
switch (event.key) {
|
|
192
|
-
case "ArrowDown":
|
|
193
|
-
case "ArrowUp": {
|
|
194
|
-
event.preventDefault();
|
|
195
|
-
const direction = event.key === "ArrowDown" ? 1 : -1;
|
|
196
|
-
nextIndex = (currentIndex + direction + menuItems.length) % menuItems.length;
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
case "Home":
|
|
200
|
-
event.preventDefault();
|
|
201
|
-
nextIndex = 0;
|
|
202
|
-
break;
|
|
203
|
-
case "End":
|
|
204
|
-
event.preventDefault();
|
|
205
|
-
nextIndex = menuItems.length - 1;
|
|
206
|
-
break;
|
|
207
|
-
default:
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
menuItems[nextIndex]?.focus();
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const toolbar = "_toolbar_7lbdr_13";
|
|
214
|
-
const styles = {
|
|
215
|
-
toolbar: toolbar,
|
|
216
|
-
"toolbar-content": "_toolbar-content_7lbdr_20",
|
|
217
|
-
"toolbar-overflow-content": "_toolbar-overflow-content_7lbdr_23",
|
|
218
|
-
"toolbar-button-item": "_toolbar-button-item_7lbdr_31",
|
|
219
|
-
"toolbar-item": "_toolbar-item_7lbdr_37",
|
|
220
|
-
"overflow-collapse": "_overflow-collapse_7lbdr_41",
|
|
221
|
-
"toolbar-button-toggle-item": "_toolbar-button-toggle-item_7lbdr_65",
|
|
222
|
-
"toolbar-overflow-trigger": "_toolbar-overflow-trigger_7lbdr_71"
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const ToolbarItemWrapper = ({
|
|
226
|
-
item,
|
|
227
|
-
children
|
|
228
|
-
}) => {
|
|
229
|
-
const { addItem, removeItem, toolbarRef, overflow } = useContext(
|
|
230
|
-
ToolbarOverflowContext
|
|
231
|
-
);
|
|
232
|
-
const itemId = useId();
|
|
233
|
-
const elementRef = useRef(null);
|
|
234
|
-
const prevIntersectingRef = useRef(true);
|
|
235
|
-
const isCollapseMode = overflow === "collapse";
|
|
236
|
-
const handleVisibilityChange = useCallback(
|
|
237
|
-
(isVisible) => {
|
|
238
|
-
if (!isCollapseMode || prevIntersectingRef.current === isVisible) return;
|
|
239
|
-
const itemWithId = { ...item, id: itemId };
|
|
240
|
-
if (isVisible) {
|
|
241
|
-
removeItem(itemWithId);
|
|
242
|
-
} else {
|
|
243
|
-
addItem(itemWithId);
|
|
244
|
-
}
|
|
245
|
-
prevIntersectingRef.current = isVisible;
|
|
246
|
-
},
|
|
247
|
-
[isCollapseMode, item, itemId, addItem, removeItem]
|
|
248
|
-
);
|
|
249
|
-
const { isIntersecting, ref } = useIntersectionObserver({
|
|
250
|
-
root: isCollapseMode ? toolbarRef.current : null,
|
|
251
|
-
threshold: 1,
|
|
252
|
-
initialIsIntersecting: false,
|
|
253
|
-
onChange: handleVisibilityChange
|
|
254
|
-
});
|
|
255
|
-
const setRefCallback = useCallback(
|
|
256
|
-
(node) => {
|
|
257
|
-
elementRef.current = node;
|
|
258
|
-
if (isCollapseMode) {
|
|
259
|
-
ref(node);
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
[ref, isCollapseMode]
|
|
263
|
-
);
|
|
264
|
-
const handleFocusOrClick = useCallback(() => {
|
|
265
|
-
if (!toolbarRef.current || !elementRef.current) return;
|
|
266
|
-
const currentElement = elementRef.current.querySelector("button, a, input");
|
|
267
|
-
if (!currentElement) return;
|
|
268
|
-
updateToolbarItemsTabIndex(toolbarRef.current, currentElement);
|
|
269
|
-
}, [toolbarRef]);
|
|
270
|
-
useEffect(() => {
|
|
271
|
-
const interactiveEl = elementRef.current?.querySelector("button, a, input");
|
|
272
|
-
if (!interactiveEl) return;
|
|
273
|
-
interactiveEl.addEventListener("focus", handleFocusOrClick);
|
|
274
|
-
interactiveEl.addEventListener("click", handleFocusOrClick);
|
|
275
|
-
return () => {
|
|
276
|
-
interactiveEl.removeEventListener("focus", handleFocusOrClick);
|
|
277
|
-
interactiveEl.removeEventListener("click", handleFocusOrClick);
|
|
278
|
-
};
|
|
279
|
-
}, [handleFocusOrClick]);
|
|
280
|
-
useEffect(() => {
|
|
281
|
-
if (isCollapseMode) {
|
|
282
|
-
prevIntersectingRef.current = true;
|
|
283
|
-
}
|
|
284
|
-
}, [isCollapseMode]);
|
|
285
|
-
const isHidden = isCollapseMode && !isIntersecting;
|
|
286
|
-
return /* @__PURE__ */ jsx(
|
|
287
|
-
"div",
|
|
288
|
-
{
|
|
289
|
-
ref: setRefCallback,
|
|
290
|
-
className: styles["toolbar-item"],
|
|
291
|
-
style: { visibility: isHidden ? "hidden" : "visible" },
|
|
292
|
-
"aria-hidden": isHidden,
|
|
293
|
-
...{ inert: isHidden ? "" : void 0 },
|
|
294
|
-
"data-id": itemId,
|
|
295
|
-
"data-anv": "toolbar-item",
|
|
296
|
-
children
|
|
297
|
-
}
|
|
298
|
-
);
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
const ToolbarButton = forwardRef(
|
|
302
|
-
(props, _ref) => {
|
|
303
|
-
const { appearance = "ghost", className, children, ...rest } = props;
|
|
304
|
-
const { isInOverflowMenu = false } = useOverFlowItemContext?.() || {};
|
|
305
|
-
const trackingId = useTrackingId({
|
|
306
|
-
name: "ToolbarButton",
|
|
307
|
-
data: {
|
|
308
|
-
disabled: props.disabled,
|
|
309
|
-
"aria-label": props["aria-label"],
|
|
310
|
-
children: props.children
|
|
311
|
-
},
|
|
312
|
-
hasOverride: !!props["data-tracking-id"]
|
|
313
|
-
});
|
|
314
|
-
const buttonClassNames = cx(className, styles["toolbar-button-item"]);
|
|
315
|
-
const item = children ? /* @__PURE__ */ jsx(
|
|
316
|
-
Button,
|
|
317
|
-
{
|
|
318
|
-
"data-tracking-id": trackingId,
|
|
319
|
-
appearance,
|
|
320
|
-
size: "small",
|
|
321
|
-
"data-anv": "toolbar-button",
|
|
322
|
-
className: buttonClassNames,
|
|
323
|
-
...rest,
|
|
324
|
-
children
|
|
325
|
-
}
|
|
326
|
-
) : /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
327
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { children: /* @__PURE__ */ jsx(
|
|
328
|
-
Button,
|
|
329
|
-
{
|
|
330
|
-
"data-tracking-id": trackingId,
|
|
331
|
-
appearance,
|
|
332
|
-
size: "small",
|
|
333
|
-
"data-anv": "toolbar-button",
|
|
334
|
-
className: buttonClassNames,
|
|
335
|
-
...rest
|
|
336
|
-
}
|
|
337
|
-
) }),
|
|
338
|
-
/* @__PURE__ */ jsx(Tooltip.Content, { children: rest["aria-label"] })
|
|
339
|
-
] });
|
|
340
|
-
if (isInOverflowMenu) {
|
|
341
|
-
return item;
|
|
342
|
-
}
|
|
343
|
-
return /* @__PURE__ */ jsx(ToolbarItemWrapper, { item: { itemProps: props, itemType: "button" }, children: item });
|
|
344
|
-
}
|
|
345
|
-
);
|
|
346
|
-
ToolbarButton.displayName = "ToolbarButton";
|
|
347
|
-
|
|
348
|
-
const ToolbarButtonToggle = forwardRef((props, _ref) => {
|
|
349
|
-
const { className, children, ...rest } = props;
|
|
350
|
-
const { isInOverflowMenu = false } = useOverFlowItemContext?.() || {};
|
|
351
|
-
const trackingId = useTrackingId({
|
|
352
|
-
name: "ToolbarButtonToggle",
|
|
353
|
-
data: {
|
|
354
|
-
checked: props.checked,
|
|
355
|
-
disabled: props.disabled,
|
|
356
|
-
"aria-label": props["aria-label"],
|
|
357
|
-
children: props.children
|
|
358
|
-
},
|
|
359
|
-
hasOverride: !!props["data-tracking-id"]
|
|
360
|
-
});
|
|
361
|
-
const buttonToggleClassNames = cx(
|
|
362
|
-
className,
|
|
363
|
-
styles["toolbar-button-item"],
|
|
364
|
-
styles["toolbar-button-toggle-item"]
|
|
365
|
-
);
|
|
366
|
-
const item = children ? /* @__PURE__ */ jsx(
|
|
367
|
-
ButtonToggle,
|
|
368
|
-
{
|
|
369
|
-
"data-tracking-id": trackingId,
|
|
370
|
-
size: "small",
|
|
371
|
-
"data-anv": "toolbar-button-toggle",
|
|
372
|
-
className: buttonToggleClassNames,
|
|
373
|
-
...rest,
|
|
374
|
-
children
|
|
375
|
-
}
|
|
376
|
-
) : /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
377
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { children: /* @__PURE__ */ jsx(
|
|
378
|
-
ButtonToggle,
|
|
379
|
-
{
|
|
380
|
-
"data-tracking-id": trackingId,
|
|
381
|
-
size: "small",
|
|
382
|
-
"data-anv": "toolbar-button-toggle",
|
|
383
|
-
className: buttonToggleClassNames,
|
|
384
|
-
...rest
|
|
385
|
-
}
|
|
386
|
-
) }),
|
|
387
|
-
/* @__PURE__ */ jsx(Tooltip.Content, { children: rest["aria-label"] })
|
|
388
|
-
] });
|
|
389
|
-
if (isInOverflowMenu) {
|
|
390
|
-
return item;
|
|
391
|
-
}
|
|
392
|
-
return /* @__PURE__ */ jsx(ToolbarItemWrapper, { item: { itemProps: props, itemType: "buttonToggle" }, children: item });
|
|
393
|
-
});
|
|
394
|
-
ToolbarButtonToggle.displayName = "ToolbarButtonToggle";
|
|
395
|
-
|
|
396
|
-
const ToolbarButtonLink = forwardRef((props, _ref) => {
|
|
397
|
-
const { appearance = "ghost", className, children, ...rest } = props;
|
|
398
|
-
const { isInOverflowMenu = false } = useOverFlowItemContext?.() || {};
|
|
399
|
-
const trackingId = useTrackingId({
|
|
400
|
-
name: "ToolbarButtonLink",
|
|
401
|
-
data: {
|
|
402
|
-
href: props.href,
|
|
403
|
-
disabled: props.disabled,
|
|
404
|
-
"aria-label": props["aria-label"],
|
|
405
|
-
children: props.children,
|
|
406
|
-
target: props.target
|
|
407
|
-
},
|
|
408
|
-
hasOverride: !!props["data-tracking-id"]
|
|
409
|
-
});
|
|
410
|
-
const buttonLinkClassNames = cx(className, styles["toolbar-button-item"]);
|
|
411
|
-
const item = children ? /* @__PURE__ */ jsx(
|
|
412
|
-
ButtonLink,
|
|
413
|
-
{
|
|
414
|
-
"data-tracking-id": trackingId,
|
|
415
|
-
appearance,
|
|
416
|
-
size: "small",
|
|
417
|
-
"data-anv": "toolbar-button-link",
|
|
418
|
-
className: buttonLinkClassNames,
|
|
419
|
-
...rest,
|
|
420
|
-
children
|
|
421
|
-
}
|
|
422
|
-
) : /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
423
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { children: /* @__PURE__ */ jsx(
|
|
424
|
-
ButtonLink,
|
|
425
|
-
{
|
|
426
|
-
"data-tracking-id": trackingId,
|
|
427
|
-
appearance,
|
|
428
|
-
size: "small",
|
|
429
|
-
"data-anv": "toolbar-button-link",
|
|
430
|
-
className: buttonLinkClassNames,
|
|
431
|
-
...rest
|
|
432
|
-
}
|
|
433
|
-
) }),
|
|
434
|
-
/* @__PURE__ */ jsx(Tooltip.Content, { children: rest["aria-label"] })
|
|
435
|
-
] });
|
|
436
|
-
if (isInOverflowMenu) {
|
|
437
|
-
return item;
|
|
438
|
-
}
|
|
439
|
-
return /* @__PURE__ */ jsx(ToolbarItemWrapper, { item: { itemProps: props, itemType: "buttonLink" }, children: item });
|
|
440
|
-
});
|
|
441
|
-
ToolbarButtonLink.displayName = "ToolbarButtonLink";
|
|
442
|
-
|
|
443
|
-
const ToolbarSelect = forwardRef(
|
|
444
|
-
(props, _ref) => {
|
|
445
|
-
const {
|
|
446
|
-
appearance = "ghost",
|
|
447
|
-
onChange,
|
|
448
|
-
selected: selectedItemId,
|
|
449
|
-
accessibleLabel,
|
|
450
|
-
className,
|
|
451
|
-
items,
|
|
452
|
-
...rest
|
|
453
|
-
} = props;
|
|
454
|
-
const selectId = useId();
|
|
455
|
-
const defaultId = items.length > 0 ? items[0].id : "";
|
|
456
|
-
const [internalSelectedId, setInternalSelectedId] = useState(defaultId);
|
|
457
|
-
const selectedId = selectedItemId ?? internalSelectedId;
|
|
458
|
-
const selectedItem = items.find((item2) => item2.id === selectedId) || items.find((item2) => item2.id === defaultId);
|
|
459
|
-
useEffect(() => {
|
|
460
|
-
if (!selectedItemId && items.length > 0 && !items.some((item2) => item2.id === internalSelectedId)) {
|
|
461
|
-
setInternalSelectedId(items[0].id);
|
|
462
|
-
}
|
|
463
|
-
}, [items, selectedItemId, internalSelectedId]);
|
|
464
|
-
const handleSelectionChange = (selected) => {
|
|
465
|
-
if (selected?.id) {
|
|
466
|
-
if (selectedItemId === void 0) {
|
|
467
|
-
setInternalSelectedId(selected.id);
|
|
468
|
-
}
|
|
469
|
-
onChange?.(selected.id);
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
const { isInOverflowMenu = false } = useOverFlowItemContext?.() || {};
|
|
473
|
-
const trackingId = useTrackingId({
|
|
474
|
-
name: "ToolbarSelect",
|
|
475
|
-
data: {
|
|
476
|
-
selected: props.selected,
|
|
477
|
-
disabled: props.disabled,
|
|
478
|
-
"aria-label": props["aria-label"],
|
|
479
|
-
items: props.items
|
|
480
|
-
},
|
|
481
|
-
hasOverride: !!props["data-tracking-id"]
|
|
482
|
-
});
|
|
483
|
-
const buttonClassNames = cx(className, styles["toolbar-button-item"]);
|
|
484
|
-
const item = /* @__PURE__ */ jsxs(Popover, { noPadding: true, children: [
|
|
485
|
-
/* @__PURE__ */ jsx(
|
|
486
|
-
Popover.Button,
|
|
487
|
-
{
|
|
488
|
-
"data-tracking-id": trackingId,
|
|
489
|
-
appearance,
|
|
490
|
-
size: "small",
|
|
491
|
-
icon: { after: SvgArrowDropDown },
|
|
492
|
-
className: buttonClassNames,
|
|
493
|
-
id: selectId,
|
|
494
|
-
"data-anv": "toolbar-select",
|
|
495
|
-
...rest,
|
|
496
|
-
children: selectedItem?.label
|
|
497
|
-
}
|
|
498
|
-
),
|
|
499
|
-
/* @__PURE__ */ jsx(
|
|
500
|
-
Popover.Content,
|
|
501
|
-
{
|
|
502
|
-
className: styles["toolbar-select-content"],
|
|
503
|
-
"aria-label": `${accessibleLabel} options`,
|
|
504
|
-
children: /* @__PURE__ */ jsx(
|
|
505
|
-
Listbox,
|
|
506
|
-
{
|
|
507
|
-
selected: selectedItem,
|
|
508
|
-
onSelectionChange: handleSelectionChange,
|
|
509
|
-
items,
|
|
510
|
-
"aria-labelledby": selectId,
|
|
511
|
-
children: ({ items: items2 }) => items2.map((item2) => /* @__PURE__ */ jsx(Listbox.Option, { item: item2, children: item2.label }, item2.label))
|
|
512
|
-
}
|
|
513
|
-
)
|
|
514
|
-
}
|
|
515
|
-
)
|
|
516
|
-
] });
|
|
517
|
-
if (isInOverflowMenu) {
|
|
518
|
-
return item;
|
|
519
|
-
}
|
|
520
|
-
return /* @__PURE__ */ jsx(ToolbarItemWrapper, { item: { itemProps: props, itemType: "select" }, children: item });
|
|
521
|
-
}
|
|
522
|
-
);
|
|
523
|
-
ToolbarSelect.displayName = "ToolbarSelect";
|
|
524
|
-
|
|
525
|
-
const OverflowItem = ({ itemType, itemProps }) => {
|
|
526
|
-
switch (itemType) {
|
|
527
|
-
case "button":
|
|
528
|
-
return /* @__PURE__ */ jsx(ToolbarButton, { ...itemProps });
|
|
529
|
-
case "buttonToggle":
|
|
530
|
-
return /* @__PURE__ */ jsx(ToolbarButtonToggle, { ...itemProps });
|
|
531
|
-
case "buttonLink":
|
|
532
|
-
return /* @__PURE__ */ jsx(ToolbarButtonLink, { ...itemProps });
|
|
533
|
-
case "select":
|
|
534
|
-
return /* @__PURE__ */ jsx(ToolbarSelect, { ...itemProps });
|
|
535
|
-
default:
|
|
536
|
-
return null;
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
const ToolbarOverflowMenu = ({
|
|
540
|
-
additionalItems,
|
|
541
|
-
direction
|
|
542
|
-
}) => {
|
|
543
|
-
const { overflowItems, orderedIds } = useContext(ToolbarOverflowContext);
|
|
544
|
-
const menuTriggerId = useId();
|
|
545
|
-
const orderedItems = useMemo(() => {
|
|
546
|
-
const allElements = orderedIds?.map((id) => {
|
|
547
|
-
return overflowItems.find((item) => item.id === id);
|
|
548
|
-
});
|
|
549
|
-
return allElements?.filter((item) => item !== void 0) || [];
|
|
550
|
-
}, [orderedIds, overflowItems]);
|
|
551
|
-
const popoverButtonClassNames = cx(
|
|
552
|
-
styles["toolbar-button-item"],
|
|
553
|
-
styles["toolbar-overflow-trigger"]
|
|
554
|
-
);
|
|
555
|
-
const overflowIcon = direction === "horizontal" ? SvgMoreHoriz : SvgMoreVert;
|
|
556
|
-
return /* @__PURE__ */ jsxs(Popover, { noPadding: true, children: [
|
|
557
|
-
/* @__PURE__ */ jsx(
|
|
558
|
-
Popover.Button,
|
|
559
|
-
{
|
|
560
|
-
size: "small",
|
|
561
|
-
appearance: "ghost",
|
|
562
|
-
id: menuTriggerId,
|
|
563
|
-
className: popoverButtonClassNames,
|
|
564
|
-
"data-anv": "toolbar-overflow-trigger",
|
|
565
|
-
"aria-label": "Additional toolbar options",
|
|
566
|
-
children: /* @__PURE__ */ jsx(Icon, { svg: overflowIcon, size: "small" })
|
|
567
|
-
}
|
|
568
|
-
),
|
|
569
|
-
/* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx(OverflowItemContext.Provider, { value: { isInOverflowMenu: true }, children: /* @__PURE__ */ jsxs(
|
|
570
|
-
"ul",
|
|
571
|
-
{
|
|
572
|
-
role: "menu",
|
|
573
|
-
className: styles["toolbar-overflow-content"],
|
|
574
|
-
"data-anv": "toolbar-overflow-menu",
|
|
575
|
-
"aria-labelledby": menuTriggerId,
|
|
576
|
-
onKeyDown: handleMenuKeyboardNavigation,
|
|
577
|
-
children: [
|
|
578
|
-
orderedItems.map((item) => {
|
|
579
|
-
const { itemType, itemProps, id } = item;
|
|
580
|
-
return /* @__PURE__ */ jsx(
|
|
581
|
-
"li",
|
|
582
|
-
{
|
|
583
|
-
role: "menuitem",
|
|
584
|
-
"data-anv": "toolbar-overflow-item",
|
|
585
|
-
children: /* @__PURE__ */ jsx(
|
|
586
|
-
OverflowItem,
|
|
587
|
-
{
|
|
588
|
-
itemType,
|
|
589
|
-
itemProps,
|
|
590
|
-
id
|
|
591
|
-
}
|
|
592
|
-
)
|
|
593
|
-
},
|
|
594
|
-
`${itemType}-${id}`
|
|
595
|
-
);
|
|
596
|
-
}),
|
|
597
|
-
additionalItems?.map((item, index) => /* @__PURE__ */ jsx(
|
|
598
|
-
"li",
|
|
599
|
-
{
|
|
600
|
-
role: "menuitem",
|
|
601
|
-
"data-anv": "toolbar-overflow-item",
|
|
602
|
-
children: item
|
|
603
|
-
},
|
|
604
|
-
`additional-item-${index}`
|
|
605
|
-
))
|
|
606
|
-
]
|
|
607
|
-
}
|
|
608
|
-
) }) })
|
|
609
|
-
] });
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
const ToolbarElement = forwardRef(
|
|
613
|
-
(props, ref) => {
|
|
614
|
-
const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
|
|
615
|
-
const {
|
|
616
|
-
associatedContent,
|
|
617
|
-
className,
|
|
618
|
-
children,
|
|
619
|
-
style,
|
|
620
|
-
direction = "horizontal",
|
|
621
|
-
overflow = "wrap",
|
|
622
|
-
onKeyDown,
|
|
623
|
-
additionalItems,
|
|
624
|
-
...rest
|
|
625
|
-
} = componentProps;
|
|
626
|
-
const [overflowItems, setOverflowItems] = useState([]);
|
|
627
|
-
const toolbarItemsRef = useRef(null);
|
|
628
|
-
const toolbarRef = useRef(null);
|
|
629
|
-
const [orderedIds, setOrderedIds] = useState([]);
|
|
630
|
-
useEffect(() => {
|
|
631
|
-
const newOrderedIds = Array.from(
|
|
632
|
-
toolbarItemsRef.current?.querySelectorAll("[data-id]") || []
|
|
633
|
-
).map((el) => {
|
|
634
|
-
return el.getAttribute("data-id");
|
|
635
|
-
});
|
|
636
|
-
setOrderedIds(newOrderedIds);
|
|
637
|
-
}, [children]);
|
|
638
|
-
const addItem = useCallback((item) => {
|
|
639
|
-
setOverflowItems((prev) => [...prev, item]);
|
|
640
|
-
}, []);
|
|
641
|
-
const removeItem = useCallback((item) => {
|
|
642
|
-
setOverflowItems(
|
|
643
|
-
(prev) => prev.filter((component) => component.id !== item.id)
|
|
644
|
-
);
|
|
645
|
-
}, []);
|
|
646
|
-
useEffect(() => {
|
|
647
|
-
if (toolbarRef.current) {
|
|
648
|
-
updateToolbarItemsTabIndex(toolbarRef.current);
|
|
649
|
-
}
|
|
650
|
-
}, [children]);
|
|
651
|
-
const handleKeyDown = useCallback(
|
|
652
|
-
(event) => {
|
|
653
|
-
if (toolbarRef.current) {
|
|
654
|
-
handleToolbarKeyDown(event, toolbarRef.current);
|
|
655
|
-
}
|
|
656
|
-
onKeyDown?.(event);
|
|
657
|
-
},
|
|
658
|
-
[onKeyDown]
|
|
659
|
-
);
|
|
660
|
-
const showOverflowMenu = overflow === "collapse" && overflowItems.length > 0 || !!additionalItems;
|
|
661
|
-
const value = useMemo(
|
|
662
|
-
() => ({
|
|
663
|
-
overflowItems,
|
|
664
|
-
addItem,
|
|
665
|
-
removeItem,
|
|
666
|
-
toolbarRef,
|
|
667
|
-
orderedIds,
|
|
668
|
-
overflow
|
|
669
|
-
}),
|
|
670
|
-
[overflowItems, addItem, removeItem, toolbarRef, orderedIds, overflow]
|
|
671
|
-
);
|
|
672
|
-
const styleCombined = {
|
|
673
|
-
...style,
|
|
674
|
-
...layoutStyles
|
|
675
|
-
};
|
|
676
|
-
const toolbarClassNames = cx(styles["toolbar"], className);
|
|
677
|
-
const toolbarContentClassNames = cx(styles["toolbar-content"], {
|
|
678
|
-
[styles[`overflow-${overflow}`]]: overflow
|
|
679
|
-
});
|
|
680
|
-
return /* @__PURE__ */ jsx(ToolbarOverflowContext.Provider, { value, children: /* @__PURE__ */ jsxs(
|
|
681
|
-
Flex,
|
|
682
|
-
{
|
|
683
|
-
direction: direction === "horizontal" ? "row" : "column",
|
|
684
|
-
wrap: overflow === "wrap" ? "wrap" : "nowrap",
|
|
685
|
-
alignItems: "center",
|
|
686
|
-
className: toolbarClassNames,
|
|
687
|
-
style: styleCombined,
|
|
688
|
-
ref: useMergeRefs([toolbarRef, ref]),
|
|
689
|
-
role: "toolbar",
|
|
690
|
-
"data-anv": "toolbar",
|
|
691
|
-
"aria-orientation": direction,
|
|
692
|
-
"aria-label": `Toolbar for ${associatedContent}. Use arrow keys to navigate through toolbar controls.`,
|
|
693
|
-
onKeyDown: handleKeyDown,
|
|
694
|
-
...rest,
|
|
695
|
-
children: [
|
|
696
|
-
/* @__PURE__ */ jsx(
|
|
697
|
-
Flex,
|
|
698
|
-
{
|
|
699
|
-
ref: useMergeRefs([toolbarItemsRef, ref]),
|
|
700
|
-
className: toolbarContentClassNames,
|
|
701
|
-
direction: direction === "horizontal" ? "row" : "column",
|
|
702
|
-
wrap: overflow === "wrap" ? "wrap" : "nowrap",
|
|
703
|
-
alignItems: "center",
|
|
704
|
-
grow: 1,
|
|
705
|
-
"data-anv": "toolbar-content",
|
|
706
|
-
children
|
|
707
|
-
}
|
|
708
|
-
),
|
|
709
|
-
showOverflowMenu && /* @__PURE__ */ jsx(
|
|
710
|
-
ToolbarOverflowMenu,
|
|
711
|
-
{
|
|
712
|
-
direction,
|
|
713
|
-
additionalItems
|
|
714
|
-
}
|
|
715
|
-
)
|
|
716
|
-
]
|
|
717
|
-
}
|
|
718
|
-
) });
|
|
719
|
-
}
|
|
720
|
-
);
|
|
721
|
-
ToolbarElement.displayName = "Toolbar";
|
|
722
|
-
const Toolbar = Object.assign(ToolbarElement, {
|
|
723
|
-
/**
|
|
724
|
-
* ToolbarButton component for standard clickable actions within a toolbar with anvil2 tracking.
|
|
725
|
-
*
|
|
726
|
-
* Features:
|
|
727
|
-
* - Designed specifically for toolbar integration
|
|
728
|
-
* - Consistent styling with other toolbar items
|
|
729
|
-
* - Automatic tooltip for icon-only buttons
|
|
730
|
-
* - Overflow menu support
|
|
731
|
-
* - Accessibility enforcement for aria-labels
|
|
732
|
-
* - Small size optimized for toolbar layout
|
|
733
|
-
* - Ghost and primary appearance options
|
|
734
|
-
* - Automatic tracking ID generation for analytics
|
|
735
|
-
*
|
|
736
|
-
* @example
|
|
737
|
-
* <Toolbar.Button icon={BoldIcon} aria-label="Bold text" />
|
|
738
|
-
*
|
|
739
|
-
* @example
|
|
740
|
-
* <Toolbar.Button appearance="primary">
|
|
741
|
-
* Save
|
|
742
|
-
* </Toolbar.Button>
|
|
743
|
-
*/
|
|
744
|
-
Button: ToolbarButton,
|
|
745
|
-
/**
|
|
746
|
-
* ToolbarButtonToggle component for toggleable actions within a toolbar with anvil2 tracking.
|
|
747
|
-
*
|
|
748
|
-
* Features:
|
|
749
|
-
* - Toggle state management
|
|
750
|
-
* - Designed specifically for toolbar integration
|
|
751
|
-
* - Consistent styling with other toolbar items
|
|
752
|
-
* - Overflow menu support
|
|
753
|
-
* - Accessibility enforcement for aria-labels
|
|
754
|
-
* - Small size optimized for toolbar layout
|
|
755
|
-
* - Ghost and primary appearance options
|
|
756
|
-
* - Automatic tracking ID generation for analytics
|
|
757
|
-
*
|
|
758
|
-
* @example
|
|
759
|
-
* <Toolbar.ButtonToggle icon={BoldIcon} aria-label="Bold" checked={isBold} />
|
|
760
|
-
*/
|
|
761
|
-
ButtonToggle: ToolbarButtonToggle,
|
|
762
|
-
/**
|
|
763
|
-
* ToolbarButtonLink component for link actions within a toolbar with anvil2 tracking.
|
|
764
|
-
*
|
|
765
|
-
* Features:
|
|
766
|
-
* - Link functionality with href support
|
|
767
|
-
* - Designed specifically for toolbar integration
|
|
768
|
-
* - Consistent styling with other toolbar items
|
|
769
|
-
* - Overflow menu support
|
|
770
|
-
* - Accessibility enforcement for aria-labels
|
|
771
|
-
* - Small size optimized for toolbar layout
|
|
772
|
-
* - Ghost and primary appearance options
|
|
773
|
-
* - Automatic tracking ID generation for analytics
|
|
774
|
-
*
|
|
775
|
-
* @example
|
|
776
|
-
* <Toolbar.ButtonLink href="/help">
|
|
777
|
-
* Help
|
|
778
|
-
* </Toolbar.ButtonLink>
|
|
779
|
-
*/
|
|
780
|
-
ButtonLink: ToolbarButtonLink,
|
|
781
|
-
/**
|
|
782
|
-
* ToolbarSelect component provides a dropdown selector within a toolbar with anvil2 tracking.
|
|
783
|
-
*
|
|
784
|
-
* Features:
|
|
785
|
-
* - Dropdown menu with selectable options
|
|
786
|
-
* - Controlled and uncontrolled usage patterns
|
|
787
|
-
* - Automatic overflow menu integration
|
|
788
|
-
* - Accessibility support with proper ARIA labels
|
|
789
|
-
* - Small size optimized for toolbar layout
|
|
790
|
-
* - Ghost and primary appearance options
|
|
791
|
-
* - Dropdown arrow icon indicator
|
|
792
|
-
* - Listbox integration for keyboard navigation
|
|
793
|
-
* - Automatic tracking ID generation for analytics
|
|
794
|
-
*
|
|
795
|
-
* @example
|
|
796
|
-
* <Toolbar.Select
|
|
797
|
-
* items={fontOptions}
|
|
798
|
-
* selected="arial"
|
|
799
|
-
* accessibleLabel="Font family"
|
|
800
|
-
* onChange={(id) => setFont(id)}
|
|
801
|
-
* />
|
|
802
|
-
*/
|
|
803
|
-
Select: ToolbarSelect
|
|
804
|
-
});
|
|
805
|
-
|
|
806
|
-
export { Toolbar as T, ToolbarButton as a, ToolbarButtonToggle as b, ToolbarButtonLink as c, ToolbarSelect as d, ToolbarElement as e };
|
|
807
|
-
//# sourceMappingURL=Toolbar-DK7tXy_W.js.map
|