@youngonesworks/ui 0.1.78 → 0.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.storybook/main.d.ts +3 -0
- package/dist/.storybook/preview.d.ts +12 -0
- package/dist/components/arbitraryExample.d.ts +1 -0
- package/dist/components/calendar/index.d.ts +0 -0
- package/dist/components/checkbox/Checkbox.stories.d.ts +9 -0
- package/dist/components/linkText/LinkText.stories.d.ts +6 -0
- package/dist/components/linkText/index.d.ts +11 -0
- package/dist/components/phoneInput/index.d.ts +0 -0
- package/dist/components/phoneNumberInput/PhoneInputSelect.test.d.ts +1 -0
- package/dist/components/profileMenu/ProfileMenu.d.ts +20 -0
- package/dist/components/scrollToTop/scrollToTop.css +36 -0
- package/dist/components/test/index.d.ts +1 -0
- package/dist/index.cjs +52 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +53 -37
- package/dist/index.js.map +1 -1
- package/dist/react-is-esm.d.ts +38 -0
- package/dist/react-is-shim.d.ts +4 -0
- package/dist/react-tooltip-shim.d.ts +2 -0
- package/dist/src/components/accordion/Accordion.stories.d.ts +6 -0
- package/dist/src/components/accordion/AccordionItem.d.ts +14 -0
- package/dist/src/components/accordion/AccordionItem.stories.d.ts +11 -0
- package/dist/src/components/accordion/AccordionItem.test.d.ts +1 -0
- package/dist/src/components/accordion/AccordionWrapper.d.ts +7 -0
- package/dist/src/components/accordion/index.d.ts +2 -0
- package/dist/src/components/actionIcon/ActionIcon.stories.d.ts +9 -0
- package/dist/src/components/actionIcon/index.d.ts +24 -0
- package/dist/src/components/alert/Alert.stories.d.ts +6 -0
- package/dist/src/components/alert/Alert.test.d.ts +1 -0
- package/dist/src/components/alert/index.d.ts +18 -0
- package/dist/src/components/appleAppButtonIcon/AppleAppButtonIcon.stories.d.ts +6 -0
- package/dist/src/components/appleAppButtonIcon/index.d.ts +2 -0
- package/dist/src/components/autoCompleteInput/AutoCompleteInput.stories.d.ts +6 -0
- package/dist/src/components/autoCompleteInput/index.d.ts +16 -0
- package/dist/src/components/avatar/Avatar.stories.d.ts +6 -0
- package/dist/src/components/avatar/index.d.ts +22 -0
- package/dist/src/components/avatarIndicator/AvatarIndicator.stories.d.ts +6 -0
- package/dist/src/components/avatarIndicator/index.d.ts +6 -0
- package/dist/src/components/badge/Badge.stories.d.ts +6 -0
- package/dist/src/components/badge/index.d.ts +27 -0
- package/dist/src/components/bigBadge/BigBadge.stories.d.ts +6 -0
- package/dist/src/components/bigBadge/index.d.ts +9 -0
- package/dist/src/components/breadCrumb/BreadCrumb.stories.d.ts +6 -0
- package/dist/src/components/breadCrumb/index.d.ts +9 -0
- package/dist/src/components/button/Button.stories.d.ts +9 -0
- package/dist/src/components/button/buttonVariants.d.ts +10 -0
- package/dist/src/components/button/index.d.ts +16 -0
- package/dist/src/components/calendar/index.d.ts +0 -0
- package/dist/src/components/checkbox/Checkbox.stories.d.ts +9 -0
- package/dist/src/components/checkbox/index.d.ts +11 -0
- package/dist/src/components/divider/Divider.stories.d.ts +6 -0
- package/dist/src/components/divider/index.d.ts +6 -0
- package/dist/src/components/favouriteButton/FavouriteButton.stories.d.ts +6 -0
- package/dist/src/components/favouriteButton/FavouriteButton.test.d.ts +1 -0
- package/dist/src/components/favouriteButton/index.d.ts +24 -0
- package/dist/src/components/filters/FilterButton.d.ts +9 -0
- package/dist/src/components/filters/FilterButton.stories.d.ts +7 -0
- package/dist/src/components/filters/FilterButton.test.d.ts +1 -0
- package/dist/src/components/filters/FilterItem.d.ts +7 -0
- package/dist/src/components/filters/FilterItem.stories.d.ts +7 -0
- package/dist/src/components/filters/FilterItem.test.d.ts +1 -0
- package/dist/src/components/filters/Filters.stories.d.ts +7 -0
- package/dist/src/components/filters/index.d.ts +11 -0
- package/dist/src/components/googleAppButtonIcon/GoogleAppButtonIcon.stories.d.ts +6 -0
- package/dist/src/components/googleAppButtonIcon/index.d.ts +2 -0
- package/dist/src/components/hamburgerMenuButton/HamburgerMenuButton.stories.d.ts +6 -0
- package/dist/src/components/hamburgerMenuButton/index.d.ts +6 -0
- package/dist/src/components/hr/HR.stories.d.ts +6 -0
- package/dist/src/components/hr/index.d.ts +8 -0
- package/dist/src/components/island/Island.stories.d.ts +6 -0
- package/dist/src/components/island/index.d.ts +11 -0
- package/dist/src/components/label/Label.stories.d.ts +6 -0
- package/dist/src/components/label/index.d.ts +7 -0
- package/dist/src/components/linkText/LinkText.stories.d.ts +6 -0
- package/dist/src/components/linkText/index.d.ts +11 -0
- package/dist/src/components/loader/Loader.stories.d.ts +6 -0
- package/dist/src/components/loader/index.d.ts +4 -0
- package/dist/src/components/logo/Logo.stories.d.ts +6 -0
- package/dist/src/components/logo/index.d.ts +2 -0
- package/dist/src/components/modal/Modal.stories.d.ts +6 -0
- package/dist/src/components/modal/index.d.ts +19 -0
- package/dist/src/components/navButtons/NavButtons.stories.d.ts +10 -0
- package/dist/src/components/navButtons/NavButtons.test.d.ts +1 -0
- package/dist/src/components/navButtons/index.d.ts +6 -0
- package/dist/src/components/numberField/NumberField.stories.d.ts +6 -0
- package/dist/src/components/numberField/index.d.ts +14 -0
- package/dist/src/components/pageUnavailable/PageUnavailable.stories.d.ts +6 -0
- package/dist/src/components/pageUnavailable/index.d.ts +7 -0
- package/dist/src/components/passwordInput/PasswordInput.stories.d.ts +6 -0
- package/dist/src/components/passwordInput/index.d.ts +3 -0
- package/dist/src/components/phoneInput/index.d.ts +0 -0
- package/dist/src/components/popover/Popover.stories.d.ts +6 -0
- package/dist/src/components/popover/index.d.ts +15 -0
- package/dist/src/components/progressBar/ProgressBar.stories.d.ts +6 -0
- package/dist/src/components/progressBar/index.d.ts +7 -0
- package/dist/src/components/radioButton/RadioButton.stories.d.ts +6 -0
- package/dist/src/components/radioButton/index.d.ts +17 -0
- package/dist/src/components/rating/Rating.stories.d.ts +7 -0
- package/dist/src/components/rating/index.d.ts +10 -0
- package/dist/src/components/regionSelector/RegionSelector.stories.d.ts +6 -0
- package/dist/src/components/regionSelector/index.d.ts +11 -0
- package/dist/src/components/reviews/Reviews.stories.d.ts +6 -0
- package/dist/src/components/reviews/index.d.ts +13 -0
- package/dist/src/components/scrollToTop/ScrollToTop.stories.d.ts +6 -0
- package/dist/src/components/scrollToTop/index.d.ts +3 -0
- package/dist/src/components/searchInput/SearchInput.stories.d.ts +6 -0
- package/dist/src/components/searchInput/index.d.ts +1 -0
- package/dist/src/components/select/Select.stories.d.ts +6 -0
- package/dist/src/components/select/index.d.ts +26 -0
- package/dist/src/components/settingsCard/SettingsCard.stories.d.ts +6 -0
- package/dist/src/components/settingsCard/index.d.ts +14 -0
- package/dist/src/components/skeleton/Skeleton.stories.d.ts +6 -0
- package/dist/src/components/skeleton/index.d.ts +5 -0
- package/dist/src/components/skillPill/SkillPill.stories.d.ts +6 -0
- package/dist/src/components/skillPill/index.d.ts +6 -0
- package/dist/src/components/stepper/NumberedStepper.d.ts +13 -0
- package/dist/src/components/stepper/NumberedStepper.stories.d.ts +8 -0
- package/dist/src/components/stepper/NumberedStepper.test.d.ts +1 -0
- package/dist/src/components/stepper/Stepper.d.ts +16 -0
- package/dist/src/components/stepper/Stepper.stories.d.ts +9 -0
- package/dist/src/components/stepper/Stepper.test.d.ts +1 -0
- package/dist/src/components/stepper/index.d.ts +2 -0
- package/dist/src/components/stickyMobileButton/StickyMobileButtonWrapper.stories.d.ts +6 -0
- package/dist/src/components/stickyMobileButton/index.d.ts +6 -0
- package/dist/src/components/table/Table.stories.d.ts +6 -0
- package/dist/src/components/table/index.d.ts +6 -0
- package/dist/src/components/table/tableCell/TableCell.stories.d.ts +6 -0
- package/dist/src/components/table/tableCell/index.d.ts +7 -0
- package/dist/src/components/table/tableHeader/TableHeader.stories.d.ts +6 -0
- package/dist/src/components/table/tableHeader/index.d.ts +5 -0
- package/dist/src/components/table/tableHeaderItem/TableHeaderItem.stories.d.ts +6 -0
- package/dist/src/components/table/tableHeaderItem/index.d.ts +7 -0
- package/dist/src/components/table/tableHeaderRow/TableHeaderRow.stories.d.ts +6 -0
- package/dist/src/components/table/tableHeaderRow/index.d.ts +6 -0
- package/dist/src/components/table/tableRow/TableRow.stories.d.ts +6 -0
- package/dist/src/components/table/tableRow/index.d.ts +8 -0
- package/dist/src/components/tabs/Tab.d.ts +11 -0
- package/dist/src/components/tabs/Tab.stories.d.ts +15 -0
- package/dist/src/components/tabs/Tab.test.d.ts +1 -0
- package/dist/src/components/tabs/TabsBadge.d.ts +8 -0
- package/dist/src/components/tabs/TabsBadge.stories.d.ts +19 -0
- package/dist/src/components/tabs/TabsBadge.test.d.ts +1 -0
- package/dist/src/components/tabs/TabsWrapper.d.ts +17 -0
- package/dist/src/components/tabs/index.d.ts +2 -0
- package/dist/src/components/textArea/Textarea.stories.d.ts +6 -0
- package/dist/src/components/textArea/index.d.ts +8 -0
- package/dist/src/components/textInput/TextInput.stories.d.ts +8 -0
- package/dist/src/components/textInput/index.d.ts +22 -0
- package/dist/src/components/themeIcon/ThemeIcon.stories.d.ts +8 -0
- package/dist/src/components/themeIcon/index.d.ts +9 -0
- package/dist/src/components/toggle/Toggle.stories.d.ts +7 -0
- package/dist/src/components/toggle/index.d.ts +7 -0
- package/dist/src/components/tooltip/Tooltip.stories.d.ts +8 -0
- package/dist/src/components/tooltip/index.d.ts +13 -0
- package/dist/src/components/truncatedText/TruncatedText.stories.d.ts +7 -0
- package/dist/src/components/truncatedText/index.d.ts +6 -0
- package/dist/src/components/unorderedList/UnorderedList.stories.d.ts +7 -0
- package/dist/src/components/unorderedList/index.d.ts +7 -0
- package/dist/src/components/unorderedListItem/UnorderedListItem.stories.d.ts +7 -0
- package/dist/src/components/unorderedListItem/index.d.ts +9 -0
- package/dist/src/components/unstyledButton/UnstyledButton.stories.d.ts +6 -0
- package/dist/src/components/unstyledButton/index.d.ts +6 -0
- package/dist/src/components/wysiwygEditor/WysiwygEditor.stories.d.ts +7 -0
- package/dist/src/components/wysiwygEditor/index.d.ts +16 -0
- package/dist/src/icons/IconLoading.d.ts +2 -0
- package/dist/src/icons/IconStarEmpty.d.ts +2 -0
- package/dist/src/icons/IconStarFilled.d.ts +2 -0
- package/dist/src/icons/IconStarHalfFilled.d.ts +2 -0
- package/dist/src/icons/index.d.ts +4 -0
- package/dist/src/index.d.ts +60 -0
- package/dist/src/jsx-runtime-shim.d.ts +4 -0
- package/dist/src/stories/Button.d.ts +15 -0
- package/dist/src/stories/Button.stories.d.ts +23 -0
- package/dist/src/stories/Header.d.ts +12 -0
- package/dist/src/stories/Header.stories.d.ts +18 -0
- package/dist/src/stories/Page.d.ts +3 -0
- package/dist/src/stories/Page.stories.d.ts +12 -0
- package/dist/src/utils/cn.d.ts +2 -0
- package/dist/src/utils/enums.d.ts +48 -0
- package/dist/src/utils/formatIcon.d.ts +8 -0
- package/dist/styles/arbitrary-values.css +43 -0
- package/dist/styles.css +13 -0
- package/dist/tailwind-theme.d.ts +19 -0
- package/dist/use-client.d.ts +0 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
import * as React$1 from "react";
|
|
4
5
|
import React, { Fragment, cloneElement, createRef, forwardRef, isValidElement, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { IconAlertCircle, IconArrowNarrowLeft, IconBold, IconCalendar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCircleCheck, IconClearFormatting, IconEyeCheck, IconEyeOff, IconFilter, IconHeart, IconHeartFilled, IconItalic, IconList, IconListNumbers, IconMessageDots, IconSelector, IconUnderline, IconX } from "@tabler/icons-react";
|
|
6
7
|
import { cn } from "@utils/cn";
|
|
@@ -25,6 +26,12 @@ import { EditorContent, useEditor } from "@tiptap/react";
|
|
|
25
26
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
26
27
|
import { isSSR } from "@utils/ssr";
|
|
27
28
|
|
|
29
|
+
//#region src/jsx-runtime-shim.ts
|
|
30
|
+
const jsx$1 = React$1.createElement;
|
|
31
|
+
const jsxs$1 = React$1.createElement;
|
|
32
|
+
const Fragment$2 = React$1.Fragment;
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
28
35
|
//#region src/components/unstyledButton/index.tsx
|
|
29
36
|
const UnstyledButton = forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("button", {
|
|
30
37
|
type: "button",
|
|
@@ -430,9 +437,9 @@ const TextInput = React.forwardRef(({ rightSection, leftSection, className, erro
|
|
|
430
437
|
step,
|
|
431
438
|
maxLength,
|
|
432
439
|
className: clsx(`${loadingState ? "cursor-not-allowed" : ""}`, `${disabled ? "text-gray-500" : "text-gray-900"} selection:bg-turquoise-200 focus:border-turquoise-500 focus:ring-turquoise-500 active:border-turquoise-500 active:ring-turquoise-500 h-10 w-full rounded-[4px] border border-gray-200 bg-gray-50 px-3 text-sm font-normal outline-hidden ${rightSection && "pr-12"} ${leftSection && "pl-12"} ${error && "border-red-500 text-red-500 selection:bg-red-200 focus:border-red-500 focus:ring-red-500 focus:placeholder:text-red-500 active:border-red-500 active:ring-red-500"}`, className),
|
|
433
|
-
"aria-busy": loadingState ||
|
|
434
|
-
"data-lpignore": enablePasswordManagerAutofill ?
|
|
435
|
-
"data-1p-ignore": enablePasswordManagerAutofill ?
|
|
440
|
+
"aria-busy": loadingState || undefined,
|
|
441
|
+
"data-lpignore": enablePasswordManagerAutofill ? undefined : "true",
|
|
442
|
+
"data-1p-ignore": enablePasswordManagerAutofill ? undefined : "true",
|
|
436
443
|
ref,
|
|
437
444
|
...props,
|
|
438
445
|
type: password ? showPassword ? "text" : "password" : "text"
|
|
@@ -790,7 +797,7 @@ const Popover = forwardRef(({ content, children, hoverEnabled = false, passedOpe
|
|
|
790
797
|
//#region src/components/datePickerInput/index.tsx
|
|
791
798
|
const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil, className, error, onChange, placeholder, label, disabled, minimalDropdownYears = 4 }) => {
|
|
792
799
|
const [selected, setSelected] = useState(value);
|
|
793
|
-
const today =
|
|
800
|
+
const today = new Date();
|
|
794
801
|
const [newMonth, setNewMonth] = useState(selected || today);
|
|
795
802
|
const [dropdownOpened, setDropdownOpened] = useState({
|
|
796
803
|
month: false,
|
|
@@ -871,7 +878,7 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
871
878
|
captionLayout: "dropdown",
|
|
872
879
|
onMonthChange: (newMonth$1) => setNewMonth(newMonth$1),
|
|
873
880
|
showOutsideDays: true,
|
|
874
|
-
disabled: disabledFrom ? { before: disabledFrom } : disabledUntil ? { after: disabledUntil } :
|
|
881
|
+
disabled: disabledFrom ? { before: disabledFrom } : disabledUntil ? { after: disabledUntil } : undefined,
|
|
875
882
|
className,
|
|
876
883
|
classNames: {
|
|
877
884
|
month_grid: "mt-3 max-w-[400px] border-t border-gray-100",
|
|
@@ -909,7 +916,7 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
909
916
|
Dropdown: (props) => {
|
|
910
917
|
const { goToMonth, months } = useDayPicker();
|
|
911
918
|
const { className: dropdownClassName } = props;
|
|
912
|
-
const today$1 =
|
|
919
|
+
const today$1 = new Date();
|
|
913
920
|
/* istanbul ignore next - react-day-picker may not pass this className in our test env */
|
|
914
921
|
if (dropdownClassName === "rdp-months_dropdown") {
|
|
915
922
|
const selectedYear = newMonth.getFullYear();
|
|
@@ -957,8 +964,8 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
957
964
|
children: todayText
|
|
958
965
|
})] });
|
|
959
966
|
} else if (dropdownClassName === "rdp-years_dropdown") {
|
|
960
|
-
const earliestYear =
|
|
961
|
-
const latestYear =
|
|
967
|
+
const earliestYear = new Date().getFullYear() - minimalDropdownYears;
|
|
968
|
+
const latestYear = new Date().getFullYear() + 1;
|
|
962
969
|
/* istanbul ignore else - defensive guard will always be truthy */
|
|
963
970
|
if (earliestYear && latestYear) {
|
|
964
971
|
const years = Array.from({ length: latestYear - earliestYear + 1 }, (_, i) => earliestYear + i).reverse();
|
|
@@ -977,7 +984,7 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
977
984
|
className: "shadow-dropdown absolute z-70 rounded-md border border-gray-50 bg-white max-h-64 overflow-y-auto",
|
|
978
985
|
children: years.map((year) => /* @__PURE__ */ jsx("div", {
|
|
979
986
|
onClick: () => {
|
|
980
|
-
const newDate = months?.[0].date ||
|
|
987
|
+
const newDate = months?.[0].date || new Date();
|
|
981
988
|
newDate.setFullYear(year);
|
|
982
989
|
goToMonth(newDate);
|
|
983
990
|
setDropdownOpened({
|
|
@@ -1022,11 +1029,11 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1022
1029
|
className: "text-sm font-normal text-nowrap text-black",
|
|
1023
1030
|
children: selected ? selected.toLocaleDateString() : placeholder
|
|
1024
1031
|
}),
|
|
1025
|
-
selected !==
|
|
1032
|
+
selected !== undefined && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("span", {
|
|
1026
1033
|
className: "cursor-pointer text-sm font-normal text-gray-800",
|
|
1027
1034
|
onClick: () => {
|
|
1028
|
-
setSelected(
|
|
1029
|
-
onChange?.(
|
|
1035
|
+
setSelected(undefined);
|
|
1036
|
+
onChange?.(undefined);
|
|
1030
1037
|
},
|
|
1031
1038
|
children: /* @__PURE__ */ jsx(IconX, { size: 15 })
|
|
1032
1039
|
}) })
|
|
@@ -1693,6 +1700,10 @@ const PasswordInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(TextI
|
|
|
1693
1700
|
}));
|
|
1694
1701
|
PasswordInput.displayName = "PasswordInput";
|
|
1695
1702
|
|
|
1703
|
+
//#endregion
|
|
1704
|
+
//#region node_modules/react-phone-input-2/lib/style.css
|
|
1705
|
+
var style_default = {};
|
|
1706
|
+
|
|
1696
1707
|
//#endregion
|
|
1697
1708
|
//#region src/components/phoneNumberInput/index.tsx
|
|
1698
1709
|
const PhoneNumberInput = ({ setValue, setPhoneNumberExt, phoneNumberExt, isValid = true, phoneNumberError, phoneNumberExtensionError, phoneNumberField, phoneNumberExtField, className, label, disabled }) => {
|
|
@@ -1708,11 +1719,13 @@ const PhoneNumberInput = ({ setValue, setPhoneNumberExt, phoneNumberExt, isValid
|
|
|
1708
1719
|
shouldDirty: true,
|
|
1709
1720
|
shouldValidate: true
|
|
1710
1721
|
});
|
|
1711
|
-
if (setPhoneNumberExt)
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1722
|
+
if (setPhoneNumberExt) {
|
|
1723
|
+
setPhoneNumberExt({
|
|
1724
|
+
number: numberWithoutDialCode,
|
|
1725
|
+
ext: dialCode,
|
|
1726
|
+
countryCode: country.countryCode || ""
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1716
1729
|
}, [
|
|
1717
1730
|
setValue,
|
|
1718
1731
|
phoneNumberField,
|
|
@@ -1793,7 +1806,7 @@ const RadioButton = ({ id, name, value, label, onChange, checked, dataTestId, cl
|
|
|
1793
1806
|
id,
|
|
1794
1807
|
name,
|
|
1795
1808
|
value,
|
|
1796
|
-
onChange: props.disabled ?
|
|
1809
|
+
onChange: props.disabled ? undefined : onChange,
|
|
1797
1810
|
checked,
|
|
1798
1811
|
"data-testid": dataTestId,
|
|
1799
1812
|
className: `${clsx(className, "ease checked:border-navyBlue checked:bg-navy-blue relative m-0 flex size-5 cursor-pointer appearance-none items-center justify-center rounded-full border border-gray-400 bg-white transition-colors duration-100 focus:ring-0 focus:outline-hidden focus-visible:ring-0", { "cursor-not-allowed opacity-50": props.disabled })}`,
|
|
@@ -2561,7 +2574,7 @@ const TabContent = forwardRef(({ tab, setActiveTab, activeTab }, ref) => /* @__P
|
|
|
2561
2574
|
setActiveTab,
|
|
2562
2575
|
activeTab: activeTab === tab.value,
|
|
2563
2576
|
tabContent: tab.name,
|
|
2564
|
-
rightSection: tab?.rightSection ||
|
|
2577
|
+
rightSection: tab?.rightSection || undefined,
|
|
2565
2578
|
clickFnc: () => {
|
|
2566
2579
|
tab.clickFnc(tab.value);
|
|
2567
2580
|
setActiveTab(tab.value);
|
|
@@ -2827,23 +2840,26 @@ const ProfileMenu = ({ title, metaTitle, icon, content, disabled = false, classN
|
|
|
2827
2840
|
const buttonId = `${menuId}-button`;
|
|
2828
2841
|
const defaultStyling = "text-black flex items-center gap-1 bg-transparent py-1 px-2.5 h-9 min-w-9 cursor-pointer border-gray-200 focus:bg-gray-50 focus:ring focus:ring-primary focus:outline-none focus:border-0 focus:ring-inset";
|
|
2829
2842
|
const handleToggle = () => {
|
|
2830
|
-
if (!disabled)
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2843
|
+
if (!disabled) {
|
|
2844
|
+
setIsOpen((prev) => {
|
|
2845
|
+
const newIsOpen = !prev;
|
|
2846
|
+
/* istanbul ignore next - branch depends on async DOM focus */
|
|
2847
|
+
if (newIsOpen) {
|
|
2848
|
+
setTimeout(() => {
|
|
2849
|
+
/* istanbul ignore next - async focus behavior depends on DOM/timing */
|
|
2850
|
+
setFocusedIndex(0);
|
|
2851
|
+
/* istanbul ignore next - async focus behavior depends on DOM/timing */
|
|
2852
|
+
menuItemRefs.current[0]?.focus();
|
|
2853
|
+
}, 0);
|
|
2854
|
+
} else {
|
|
2855
|
+
/* istanbul ignore next - focus reset depends on DOM/timing */
|
|
2856
|
+
setFocusedIndex(-1);
|
|
2857
|
+
/* istanbul ignore next - focus reset depends on DOM/timing */
|
|
2858
|
+
buttonRef.current?.focus();
|
|
2859
|
+
}
|
|
2860
|
+
return newIsOpen;
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2847
2863
|
};
|
|
2848
2864
|
/* istanbul ignore next - click handler behavior covered via integration; unit env flaky */
|
|
2849
2865
|
const handleItemClick = (onClick) => {
|
|
@@ -2925,7 +2941,7 @@ const ProfileMenu = ({ title, metaTitle, icon, content, disabled = false, classN
|
|
|
2925
2941
|
"aria-label": "Toggle profile menu",
|
|
2926
2942
|
"aria-expanded": isOpen,
|
|
2927
2943
|
"aria-haspopup": "menu",
|
|
2928
|
-
"aria-controls": isOpen ? menuId :
|
|
2944
|
+
"aria-controls": isOpen ? menuId : undefined,
|
|
2929
2945
|
className: cn(buttonVariants$1["secondary"], defaultStyling, classNames?.button),
|
|
2930
2946
|
disabled,
|
|
2931
2947
|
onClick: handleToggle,
|