@servicetitan/anvil2 1.46.4 → 1.46.6
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 +18 -0
- package/dist/Calendar-BqOvsaby.js.map +1 -1
- package/dist/{Combobox-DO8cIvRQ.js → Combobox-BIBYdOCc.js} +2 -2
- package/dist/{Combobox-DO8cIvRQ.js.map → Combobox-BIBYdOCc.js.map} +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DateField-DLqKbCcm.js → DateField-BLLbVZBF.js} +2 -2
- package/dist/{DateField-DLqKbCcm.js.map → DateField-BLLbVZBF.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DateFieldRange-DI-iF-sd.js → DateFieldRange-BYwuTSkT.js} +2 -2
- package/dist/{DateFieldRange-DI-iF-sd.js.map → DateFieldRange-BYwuTSkT.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-BXakaSIE.js → DateFieldSingle-B70fKeo-.js} +2 -2
- package/dist/{DateFieldSingle-BXakaSIE.js.map → DateFieldSingle-B70fKeo-.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DaysOfTheWeek-DPH13VCK.js → DaysOfTheWeek-CvWu1j6-.js} +3 -3
- package/dist/{DaysOfTheWeek-DPH13VCK.js.map → DaysOfTheWeek-CvWu1j6-.js.map} +1 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/{Page-CRuqAlNu.js → Page-DEpBEr_s.js} +2 -2
- package/dist/{Page-CRuqAlNu.js.map → Page-DEpBEr_s.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Popover-v8R920kj.js → Popover-Du2PBdp1.js} +2 -2
- package/dist/Popover-Du2PBdp1.js.map +1 -0
- package/dist/Popover.js +1 -1
- package/dist/{TimeField-B5Jgy-Zg.js → TimeField-CGg_yTaJ.js} +2 -2
- package/dist/{TimeField-B5Jgy-Zg.js.map → TimeField-CGg_yTaJ.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/{Toolbar-DNErV9v8.js → Toolbar-DHcP_Jal.js} +81 -35
- package/dist/Toolbar-DHcP_Jal.js.map +1 -0
- package/dist/Toolbar.js +1 -1
- package/dist/assets/icons/st/response_copy.svg +1 -0
- package/dist/assets/icons/st/response_copy_failed.svg +1 -0
- package/dist/assets/icons/st/response_dislike.svg +1 -0
- package/dist/assets/icons/st/response_dislike_failed.svg +1 -0
- package/dist/assets/icons/st/response_disliked.svg +1 -0
- package/dist/assets/icons/st/response_flag.svg +1 -0
- package/dist/assets/icons/st/response_flag_failed.svg +1 -0
- package/dist/assets/icons/st/response_flagged.svg +1 -0
- package/dist/assets/icons/st/response_like.svg +1 -0
- package/dist/assets/icons/st/response_like_failed.svg +1 -0
- package/dist/assets/icons/st/response_liked.svg +1 -0
- package/dist/assets/icons/st/response_read.svg +1 -0
- package/dist/assets/icons/st/response_read_failed.svg +1 -0
- package/dist/assets/icons/st/response_reading.svg +1 -0
- package/dist/assets/icons/st/response_replay.svg +1 -0
- package/dist/assets/icons/st/response_replay_failed.svg +1 -0
- package/dist/assets/icons/st.ts +16 -0
- package/dist/beta.js +1 -1
- package/dist/components/Calendar/Calendar.d.ts +2 -2
- package/dist/index.js +88 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Popover-v8R920kj.js.map +0 -1
- package/dist/Toolbar-DNErV9v8.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -14,13 +14,13 @@ export { C as Card } from './Card-vTYeSkxt.js';
|
|
|
14
14
|
export { C as Checkbox } from './Checkbox-DAODkzN3.js';
|
|
15
15
|
export { C as CheckboxGroup } from './Checkbox-C5PX8wur.js';
|
|
16
16
|
export { C as Chip } from './Chip-DLU13qe-.js';
|
|
17
|
-
export { C as Combobox, c as ComboboxContent, a as ComboboxElement, i as ComboboxEmpty, e as ComboboxItem, f as ComboboxItemAddNew, d as ComboboxList, g as ComboboxSearchField, b as ComboboxSelect, h as ComboboxSelectTrigger } from './Combobox-
|
|
17
|
+
export { C as Combobox, c as ComboboxContent, a as ComboboxElement, i as ComboboxEmpty, e as ComboboxItem, f as ComboboxItemAddNew, d as ComboboxList, g as ComboboxSearchField, b as ComboboxSelect, h as ComboboxSelectTrigger } from './Combobox-BIBYdOCc.js';
|
|
18
18
|
export { u as useInfiniteCombobox } from './useInfiniteCombobox-WcRgC9p6.js';
|
|
19
|
-
export { D as DateField } from './DateField-
|
|
20
|
-
export { D as DateFieldRange } from './DateFieldRange-
|
|
21
|
-
export { D as DateFieldSingle } from './DateFieldSingle-
|
|
19
|
+
export { D as DateField } from './DateField-BLLbVZBF.js';
|
|
20
|
+
export { D as DateFieldRange } from './DateFieldRange-BYwuTSkT.js';
|
|
21
|
+
export { D as DateFieldSingle } from './DateFieldSingle-B70fKeo-.js';
|
|
22
22
|
export { D as DateFieldYearless } from './DateFieldYearless-BmeKGaDc.js';
|
|
23
|
-
export { D as DaysOfTheWeek } from './DaysOfTheWeek-
|
|
23
|
+
export { D as DaysOfTheWeek } from './DaysOfTheWeek-CvWu1j6-.js';
|
|
24
24
|
export { D as Details, b as DetailsContent, a as DetailsSummary } from './Details-CF8DImjw.js';
|
|
25
25
|
export { D as Dialog, a as DialogCancelButton, b as DialogContent, c as DialogFooter, d as DialogHeader } from './Dialog-xsgqM6e1.js';
|
|
26
26
|
export { D as Divider } from './Divider-DJe8kLf2.js';
|
|
@@ -42,10 +42,10 @@ export { L as ListView, a as ListViewOption, b as ListViewOptionCell } from './L
|
|
|
42
42
|
export { M as Menu, a as MenuItem } from './Menu-DUZqzpwg.js';
|
|
43
43
|
export { N as NumberField } from './NumberField-DWPAy1eG.js';
|
|
44
44
|
export { Overflow, OverflowText } from './Overflow.js';
|
|
45
|
-
export { P as Page } from './Page-
|
|
45
|
+
export { P as Page } from './Page-DEpBEr_s.js';
|
|
46
46
|
export { P as Pagination } from './Pagination-B_G9QcHf.js';
|
|
47
|
-
import { P as Popover } from './Popover-
|
|
48
|
-
export { a as PopoverButton, b as PopoverClose, c as PopoverContent, d as PopoverTrigger } from './Popover-
|
|
47
|
+
import { P as Popover } from './Popover-Du2PBdp1.js';
|
|
48
|
+
export { a as PopoverButton, b as PopoverClose, c as PopoverContent, d as PopoverTrigger } from './Popover-Du2PBdp1.js';
|
|
49
49
|
export { P as ProgressBar } from './ProgressBar-BWN2yv1s.js';
|
|
50
50
|
export { R as Radio } from './Radio-C5riI-do.js';
|
|
51
51
|
export { R as RadioGroup } from './RadioGroup-B7O06pVu.js';
|
|
@@ -63,7 +63,7 @@ export { T as Tab, a as TabButton, b as TabList, c as TabPanel } from './Tab-CzN
|
|
|
63
63
|
export { T as Text } from './Text-BqvcbXyp.js';
|
|
64
64
|
export { T as Textarea } from './Textarea-B2-6m291.js';
|
|
65
65
|
export { T as TextField } from './TextField-uCHgwO5F.js';
|
|
66
|
-
export { T as TimeField } from './TimeField-
|
|
66
|
+
export { T as TimeField } from './TimeField-CGg_yTaJ.js';
|
|
67
67
|
export { T as Toaster } from './Toaster-CHyB-Mxs.js';
|
|
68
68
|
export { t as toast } from './Toaster-CyiGDKMh.js';
|
|
69
69
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -737,7 +737,7 @@ const ToolbarItemWrapper = ({
|
|
|
737
737
|
};
|
|
738
738
|
|
|
739
739
|
const ToolbarButton = forwardRef(
|
|
740
|
-
(props,
|
|
740
|
+
(props, ref) => {
|
|
741
741
|
const { appearance = "ghost", className, children, ...rest } = props;
|
|
742
742
|
const { isInOverflowMenu = false } = useOverFlowItemContext?.() || {};
|
|
743
743
|
const trackingId = useTrackingId({
|
|
@@ -753,6 +753,7 @@ const ToolbarButton = forwardRef(
|
|
|
753
753
|
const item = children ? /* @__PURE__ */ jsx(
|
|
754
754
|
Button,
|
|
755
755
|
{
|
|
756
|
+
ref,
|
|
756
757
|
"data-tracking-id": trackingId,
|
|
757
758
|
appearance,
|
|
758
759
|
size: "small",
|
|
@@ -765,6 +766,7 @@ const ToolbarButton = forwardRef(
|
|
|
765
766
|
/* @__PURE__ */ jsx(Tooltip.Trigger, { children: /* @__PURE__ */ jsx(
|
|
766
767
|
Button,
|
|
767
768
|
{
|
|
769
|
+
ref,
|
|
768
770
|
"data-tracking-id": trackingId,
|
|
769
771
|
appearance,
|
|
770
772
|
size: "small",
|
|
@@ -890,6 +892,8 @@ const ToolbarSelect = forwardRef(
|
|
|
890
892
|
...rest
|
|
891
893
|
} = props;
|
|
892
894
|
const selectId = useId();
|
|
895
|
+
const popoverContentRef = useRef(null);
|
|
896
|
+
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
893
897
|
const defaultId = items.length > 0 ? items[0].id : "";
|
|
894
898
|
const [internalSelectedId, setInternalSelectedId] = useState(defaultId);
|
|
895
899
|
const selectedId = selectedItemId ?? internalSelectedId;
|
|
@@ -899,12 +903,37 @@ const ToolbarSelect = forwardRef(
|
|
|
899
903
|
setInternalSelectedId(items[0].id);
|
|
900
904
|
}
|
|
901
905
|
}, [items, selectedItemId, internalSelectedId]);
|
|
906
|
+
const prevIsPopoverOpen = useRef(isPopoverOpen);
|
|
907
|
+
useEffect(() => {
|
|
908
|
+
if (prevIsPopoverOpen.current && !isPopoverOpen) {
|
|
909
|
+
setTimeout(() => {
|
|
910
|
+
const triggerButton = document.getElementById(selectId);
|
|
911
|
+
if (triggerButton) {
|
|
912
|
+
triggerButton.focus();
|
|
913
|
+
}
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
prevIsPopoverOpen.current = isPopoverOpen;
|
|
917
|
+
}, [isPopoverOpen, selectId]);
|
|
902
918
|
const handleSelectionChange = (selected) => {
|
|
903
919
|
if (selected?.id) {
|
|
904
920
|
if (selectedItemId === void 0) {
|
|
905
921
|
setInternalSelectedId(selected.id);
|
|
906
922
|
}
|
|
907
923
|
onChange?.(selected.id);
|
|
924
|
+
setIsPopoverOpen(false);
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
const handleKeyDown = (event) => {
|
|
928
|
+
if (event.code === "ArrowDown" && isPopoverOpen) {
|
|
929
|
+
const listboxContainer = popoverContentRef.current?.querySelector(
|
|
930
|
+
'[role="listbox"]'
|
|
931
|
+
);
|
|
932
|
+
if (listboxContainer) {
|
|
933
|
+
listboxContainer.focus();
|
|
934
|
+
}
|
|
935
|
+
event.stopPropagation();
|
|
936
|
+
event.preventDefault();
|
|
908
937
|
}
|
|
909
938
|
};
|
|
910
939
|
const { isInOverflowMenu = false } = useOverFlowItemContext?.() || {};
|
|
@@ -919,39 +948,58 @@ const ToolbarSelect = forwardRef(
|
|
|
919
948
|
hasOverride: !!props["data-tracking-id"]
|
|
920
949
|
});
|
|
921
950
|
const buttonClassNames = cx(className, styles["toolbar-button-item"]);
|
|
922
|
-
const item = /* @__PURE__ */ jsxs(
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
),
|
|
937
|
-
/* @__PURE__ */ jsx(
|
|
938
|
-
Popover.Content,
|
|
939
|
-
{
|
|
940
|
-
className: styles["toolbar-select-content"],
|
|
941
|
-
"aria-label": `${accessibleLabel} options`,
|
|
942
|
-
children: /* @__PURE__ */ jsx(
|
|
943
|
-
Listbox,
|
|
951
|
+
const item = /* @__PURE__ */ jsxs(
|
|
952
|
+
Popover,
|
|
953
|
+
{
|
|
954
|
+
noPadding: true,
|
|
955
|
+
open: isPopoverOpen,
|
|
956
|
+
onClickOutside: () => {
|
|
957
|
+
setIsPopoverOpen(false);
|
|
958
|
+
},
|
|
959
|
+
onClose: () => {
|
|
960
|
+
setIsPopoverOpen(false);
|
|
961
|
+
},
|
|
962
|
+
children: [
|
|
963
|
+
/* @__PURE__ */ jsx(
|
|
964
|
+
Popover.Button,
|
|
944
965
|
{
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
966
|
+
"data-tracking-id": trackingId,
|
|
967
|
+
appearance,
|
|
968
|
+
size: "small",
|
|
969
|
+
icon: { after: SvgArrowDropDown },
|
|
970
|
+
className: buttonClassNames,
|
|
971
|
+
id: selectId,
|
|
972
|
+
"data-anv": "toolbar-select",
|
|
973
|
+
onClick: () => {
|
|
974
|
+
setIsPopoverOpen(!isPopoverOpen);
|
|
975
|
+
},
|
|
976
|
+
onKeyDown: handleKeyDown,
|
|
977
|
+
...rest,
|
|
978
|
+
children: selectedItem?.label
|
|
979
|
+
}
|
|
980
|
+
),
|
|
981
|
+
/* @__PURE__ */ jsx(
|
|
982
|
+
Popover.Content,
|
|
983
|
+
{
|
|
984
|
+
ref: popoverContentRef,
|
|
985
|
+
className: styles["toolbar-select-content"],
|
|
986
|
+
"aria-label": `${accessibleLabel} options`,
|
|
987
|
+
children: /* @__PURE__ */ jsx(
|
|
988
|
+
Listbox,
|
|
989
|
+
{
|
|
990
|
+
selected: selectedItem,
|
|
991
|
+
onSelectionChange: handleSelectionChange,
|
|
992
|
+
items,
|
|
993
|
+
"aria-labelledby": selectId,
|
|
994
|
+
disableAutoSelectOnFocus: true,
|
|
995
|
+
children: ({ items: items2 }) => items2.map((item2) => /* @__PURE__ */ jsx(Listbox.Option, { item: item2, children: item2.label }, item2.label))
|
|
996
|
+
}
|
|
997
|
+
)
|
|
950
998
|
}
|
|
951
999
|
)
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1000
|
+
]
|
|
1001
|
+
}
|
|
1002
|
+
);
|
|
955
1003
|
if (isInOverflowMenu) {
|
|
956
1004
|
return item;
|
|
957
1005
|
}
|