@coopdigital/react 0.54.0 → 0.56.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/README.md +2 -2
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Card/Card.js +4 -4
- package/dist/components/DatePicker/DatePicker.d.ts +2 -1
- package/dist/components/DatePicker/DatePicker.js +7 -6
- package/dist/components/DatePicker/datepicker-utils.js +1 -5
- package/dist/components/Expandable/Expandable.js +1 -1
- package/dist/components/Field/Field.d.ts +7 -24
- package/dist/components/Field/Field.js +11 -18
- package/dist/components/Field/index.js +0 -1
- package/dist/components/Fieldset/Fieldset.d.ts +12 -17
- package/dist/components/Fieldset/Fieldset.js +6 -8
- package/dist/components/Pill/Pill.js +2 -2
- package/dist/components/Popover/Popover.js +6 -6
- package/dist/components/Searchbox/Searchbox.d.ts +1 -1
- package/dist/components/Searchbox/Searchbox.js +5 -5
- package/dist/components/Signpost/Signpost.js +2 -2
- package/dist/components/Tag/Tag.js +2 -2
- package/dist/components/TextInput/TextInput.d.ts +5 -1
- package/dist/components/TextInput/TextInput.js +8 -2
- package/dist/components/Textarea/Textarea.js +2 -0
- package/dist/components/icons/AccountCircleFilledIcon.d.ts +6 -0
- package/dist/components/icons/AccountCircleFilledIcon.js +20 -0
- package/dist/components/icons/AccountCircleIcon.d.ts +6 -0
- package/dist/components/icons/AccountCircleIcon.js +20 -0
- package/dist/components/icons/AccountFilledIcon.d.ts +6 -0
- package/dist/components/icons/AccountFilledIcon.js +20 -0
- package/dist/components/icons/AccountIcon.d.ts +6 -0
- package/dist/components/icons/AccountIcon.js +20 -0
- package/dist/components/icons/AddIcon.js +2 -2
- package/dist/components/icons/AppsFilledIcon.d.ts +6 -0
- package/dist/components/icons/AppsFilledIcon.js +20 -0
- package/dist/components/icons/{CoopIcon.d.ts → AppsIcon.d.ts} +1 -1
- package/dist/components/icons/AppsIcon.js +20 -0
- package/dist/components/icons/ArrowDownIcon.js +2 -2
- package/dist/components/icons/ArrowLeftIcon.js +2 -2
- package/dist/components/icons/ArrowRightIcon.js +2 -2
- package/dist/components/icons/ArrowUpIcon.js +2 -2
- package/dist/components/icons/BackspaceFilledIcon.d.ts +6 -0
- package/dist/components/icons/BackspaceFilledIcon.js +20 -0
- package/dist/components/icons/{AvatarAltIcon.d.ts → BackspaceIcon.d.ts} +1 -1
- package/dist/components/icons/BackspaceIcon.js +20 -0
- package/dist/components/icons/{CoopLocationIcon.d.ts → BasketFilledIcon.d.ts} +1 -1
- package/dist/components/icons/BasketFilledIcon.js +20 -0
- package/dist/components/icons/BasketIcon.js +2 -2
- package/dist/components/icons/BellFilledIcon.d.ts +6 -0
- package/dist/components/icons/BellFilledIcon.js +20 -0
- package/dist/components/icons/BellIcon.d.ts +6 -0
- package/dist/components/icons/BellIcon.js +20 -0
- package/dist/components/icons/{CloseIcon.d.ts → BroomIcon.d.ts} +1 -1
- package/dist/components/icons/BroomIcon.js +20 -0
- package/dist/components/icons/CalendarFilledIcon.d.ts +6 -0
- package/dist/components/icons/CalendarFilledIcon.js +20 -0
- package/dist/components/icons/CalendarIcon.js +2 -2
- package/dist/components/icons/CashFilledIcon.d.ts +6 -0
- package/dist/components/icons/CashFilledIcon.js +20 -0
- package/dist/components/icons/CashIcon.d.ts +6 -0
- package/dist/components/icons/CashIcon.js +20 -0
- package/dist/components/icons/ChevronDownIcon.js +2 -2
- package/dist/components/icons/ChevronLeftIcon.js +2 -2
- package/dist/components/icons/ChevronRightIcon.js +2 -2
- package/dist/components/icons/ChevronUpIcon.js +2 -2
- package/dist/components/icons/CircleBurgerFilledIcon.d.ts +6 -0
- package/dist/components/icons/CircleBurgerFilledIcon.js +20 -0
- package/dist/components/icons/CircleBurgerIcon.d.ts +6 -0
- package/dist/components/icons/CircleBurgerIcon.js +20 -0
- package/dist/components/icons/ClipboardFilledIcon.d.ts +6 -0
- package/dist/components/icons/ClipboardFilledIcon.js +20 -0
- package/dist/components/icons/ClipboardIcon.d.ts +6 -0
- package/dist/components/icons/ClipboardIcon.js +20 -0
- package/dist/components/icons/{InformationIcon.d.ts → ClockFilledIcon.d.ts} +1 -1
- package/dist/components/icons/ClockFilledIcon.js +20 -0
- package/dist/components/icons/ClockIcon.js +2 -2
- package/dist/components/icons/CloseAltFilledIcon.d.ts +6 -0
- package/dist/components/icons/CloseAltFilledIcon.js +20 -0
- package/dist/components/icons/CloseAltIcon.js +2 -2
- package/dist/components/icons/{VanIcon.d.ts → CogIcon.d.ts} +1 -1
- package/dist/components/icons/CogIcon.js +20 -0
- package/dist/components/icons/CommunityFilledIcon.d.ts +6 -0
- package/dist/components/icons/CommunityFilledIcon.js +20 -0
- package/dist/components/icons/CommunityIcon.d.ts +6 -0
- package/dist/components/icons/CommunityIcon.js +20 -0
- package/dist/components/icons/{QuestionIcon.d.ts → ComputerIcon.d.ts} +1 -1
- package/dist/components/icons/ComputerIcon.js +20 -0
- package/dist/components/icons/ContactFilledIcon.d.ts +6 -0
- package/dist/components/icons/ContactFilledIcon.js +20 -0
- package/dist/components/icons/ContactIcon.d.ts +6 -0
- package/dist/components/icons/ContactIcon.js +20 -0
- package/dist/components/icons/ContactlessFilledIcon.d.ts +6 -0
- package/dist/components/icons/ContactlessFilledIcon.js +20 -0
- package/dist/components/icons/ContactlessIcon.d.ts +6 -0
- package/dist/components/icons/ContactlessIcon.js +20 -0
- package/dist/components/icons/{SettingsIcon.d.ts → CoopLiveIcon.d.ts} +1 -1
- package/dist/components/icons/CoopLiveIcon.js +20 -0
- package/dist/components/icons/CoopLocationFilledIcon.d.ts +6 -0
- package/dist/components/icons/{CoopLocationIcon.js → CoopLocationFilledIcon.js} +5 -5
- package/dist/components/icons/{CoopCardIcon.d.ts → CoopLogoIcon.d.ts} +1 -1
- package/dist/components/icons/CoopLogoIcon.js +20 -0
- package/dist/components/icons/CoopMembershipCardFilledIcon.d.ts +6 -0
- package/dist/components/icons/CoopMembershipCardFilledIcon.js +20 -0
- package/dist/components/icons/CreditCardFilledIcon.d.ts +6 -0
- package/dist/components/icons/CreditCardFilledIcon.js +20 -0
- package/dist/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/components/icons/CreditCardIcon.js +20 -0
- package/dist/components/icons/CrossIcon.d.ts +6 -0
- package/dist/components/icons/CrossIcon.js +20 -0
- package/dist/components/icons/DocumentIcon.d.ts +6 -0
- package/dist/components/icons/DocumentIcon.js +20 -0
- package/dist/components/icons/DownloadIcon.js +2 -2
- package/dist/components/icons/EnterStoreIcon.d.ts +6 -0
- package/dist/components/icons/EnterStoreIcon.js +20 -0
- package/dist/components/icons/ExitStoreIcon.d.ts +6 -0
- package/dist/components/icons/ExitStoreIcon.js +20 -0
- package/dist/components/icons/EyeFilledIcon.d.ts +6 -0
- package/dist/components/icons/EyeFilledIcon.js +20 -0
- package/dist/components/icons/EyeIcon.d.ts +6 -0
- package/dist/components/icons/EyeIcon.js +20 -0
- package/dist/components/icons/EyeStrikeFilledIcon.d.ts +6 -0
- package/dist/components/icons/EyeStrikeFilledIcon.js +20 -0
- package/dist/components/icons/EyeStrikeIcon.d.ts +6 -0
- package/dist/components/icons/EyeStrikeIcon.js +20 -0
- package/dist/components/icons/FeedbackFilledIcon.d.ts +6 -0
- package/dist/components/icons/FeedbackFilledIcon.js +20 -0
- package/dist/components/icons/FeedbackIcon.d.ts +6 -0
- package/dist/components/icons/FeedbackIcon.js +20 -0
- package/dist/components/icons/{AvatarIcon.d.ts → FilterIcon.d.ts} +1 -1
- package/dist/components/icons/FilterIcon.js +20 -0
- package/dist/components/icons/GiftCardFilledIcon.d.ts +6 -0
- package/dist/components/icons/GiftCardFilledIcon.js +20 -0
- package/dist/components/icons/GiftCardIcon.d.ts +6 -0
- package/dist/components/icons/GiftCardIcon.js +20 -0
- package/dist/components/icons/GiftFilledIcon.d.ts +6 -0
- package/dist/components/icons/GiftFilledIcon.js +20 -0
- package/dist/components/icons/GiftIcon.d.ts +6 -0
- package/dist/components/icons/GiftIcon.js +20 -0
- package/dist/components/icons/HelpFilledIcon.d.ts +6 -0
- package/dist/components/icons/HelpFilledIcon.js +20 -0
- package/dist/components/icons/HelpIcon.d.ts +6 -0
- package/dist/components/icons/HelpIcon.js +20 -0
- package/dist/components/icons/HomeFilledIcon.d.ts +6 -0
- package/dist/components/icons/HomeFilledIcon.js +20 -0
- package/dist/components/icons/HomeIcon.js +2 -2
- package/dist/components/icons/HowDoIAssistantIcon.d.ts +6 -0
- package/dist/components/icons/HowDoIAssistantIcon.js +20 -0
- package/dist/components/icons/InfoIcon.d.ts +6 -0
- package/dist/components/icons/InfoIcon.js +20 -0
- package/dist/components/icons/KebabIcon.d.ts +6 -0
- package/dist/components/icons/KebabIcon.js +20 -0
- package/dist/components/icons/LoadingIcon.js +3 -3
- package/dist/components/icons/LocationFilledIcon.d.ts +6 -0
- package/dist/components/icons/LocationFilledIcon.js +20 -0
- package/dist/components/icons/LocationIcon.js +2 -2
- package/dist/components/icons/LogoutIcon.d.ts +6 -0
- package/dist/components/icons/LogoutIcon.js +20 -0
- package/dist/components/icons/MailIcon.js +2 -2
- package/dist/components/icons/MenuIcon.js +2 -2
- package/dist/components/icons/MessageIcon.js +2 -2
- package/dist/components/icons/MinusIcon.js +2 -2
- package/dist/components/icons/NotesFilledIcon.d.ts +6 -0
- package/dist/components/icons/NotesFilledIcon.js +20 -0
- package/dist/components/icons/NotesIcon.d.ts +6 -0
- package/dist/components/icons/NotesIcon.js +20 -0
- package/dist/components/icons/OpenNewIcon.js +2 -2
- package/dist/components/icons/OwnBagIcon.d.ts +6 -0
- package/dist/components/icons/OwnBagIcon.js +20 -0
- package/dist/components/icons/PadlockIcon.d.ts +6 -0
- package/dist/components/icons/PadlockIcon.js +20 -0
- package/dist/components/icons/PencilIcon.js +2 -2
- package/dist/components/icons/PhoneIcon.js +2 -2
- package/dist/components/icons/PowerIcon.d.ts +6 -0
- package/dist/components/icons/PowerIcon.js +20 -0
- package/dist/components/icons/SaveFilledIcon.d.ts +6 -0
- package/dist/components/icons/SaveFilledIcon.js +20 -0
- package/dist/components/icons/SaveIcon.d.ts +6 -0
- package/dist/components/icons/SaveIcon.js +20 -0
- package/dist/components/icons/ScooterIcon.js +3 -3
- package/dist/components/icons/SearchFilledIcon.d.ts +6 -0
- package/dist/components/icons/SearchFilledIcon.js +20 -0
- package/dist/components/icons/SearchIcon.js +2 -2
- package/dist/components/icons/SendIcon.d.ts +6 -0
- package/dist/components/icons/SendIcon.js +20 -0
- package/dist/components/icons/SpannerIcon.d.ts +6 -0
- package/dist/components/icons/SpannerIcon.js +20 -0
- package/dist/components/icons/StarFilledIcon.d.ts +6 -0
- package/dist/components/icons/StarFilledIcon.js +20 -0
- package/dist/components/icons/StarIcon.d.ts +6 -0
- package/dist/components/icons/StarIcon.js +20 -0
- package/dist/components/icons/TickAltFilledIcon.d.ts +6 -0
- package/dist/components/icons/TickAltFilledIcon.js +20 -0
- package/dist/components/icons/TickAltIcon.js +2 -2
- package/dist/components/icons/TickIcon.js +2 -2
- package/dist/components/icons/TruckIcon.d.ts +6 -0
- package/dist/components/icons/TruckIcon.js +20 -0
- package/dist/components/icons/UserWipeIcon.d.ts +6 -0
- package/dist/components/icons/UserWipeIcon.js +20 -0
- package/dist/components/icons/VoucherFilledIcon.d.ts +6 -0
- package/dist/components/icons/VoucherFilledIcon.js +20 -0
- package/dist/components/icons/VoucherIcon.d.ts +6 -0
- package/dist/components/icons/VoucherIcon.js +20 -0
- package/dist/components/icons/WarningFilledIcon.d.ts +6 -0
- package/dist/components/icons/WarningFilledIcon.js +20 -0
- package/dist/components/icons/WarningIcon.js +2 -2
- package/dist/components/icons/WifiIcon.d.ts +6 -0
- package/dist/components/icons/WifiIcon.js +20 -0
- package/dist/components/icons/WriteIcon.js +2 -2
- package/dist/components/icons/index.d.ts +77 -10
- package/dist/components/icons/index.js +77 -10
- package/dist/hooks/useSlots.js +3 -3
- package/dist/index.js +2 -2
- package/package.json +11 -11
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +13 -12
- package/src/components/Expandable/Expandable.tsx +1 -6
- package/src/components/Field/Field.tsx +5 -29
- package/src/components/Fieldset/Fieldset.tsx +6 -8
- package/src/components/Searchbox/Searchbox.tsx +2 -2
- package/src/components/TextInput/TextInput.tsx +18 -2
- package/src/components/Textarea/Textarea.tsx +2 -0
- package/src/components/icons/AccountCircleFilledIcon.tsx +28 -0
- package/src/components/icons/AccountCircleIcon.tsx +28 -0
- package/src/components/icons/AccountFilledIcon.tsx +28 -0
- package/src/components/icons/AccountIcon.tsx +28 -0
- package/src/components/icons/AddIcon.tsx +2 -9
- package/src/components/icons/AppsFilledIcon.tsx +28 -0
- package/src/components/icons/AppsIcon.tsx +28 -0
- package/src/components/icons/ArrowDownIcon.tsx +2 -6
- package/src/components/icons/ArrowLeftIcon.tsx +2 -6
- package/src/components/icons/ArrowRightIcon.tsx +2 -6
- package/src/components/icons/ArrowUpIcon.tsx +2 -6
- package/src/components/icons/BackspaceFilledIcon.tsx +28 -0
- package/src/components/icons/BackspaceIcon.tsx +28 -0
- package/src/components/icons/BasketFilledIcon.tsx +28 -0
- package/src/components/icons/BasketIcon.tsx +2 -9
- package/src/components/icons/BellFilledIcon.tsx +29 -0
- package/src/components/icons/BellIcon.tsx +28 -0
- package/src/components/icons/BroomIcon.tsx +28 -0
- package/src/components/icons/CalendarFilledIcon.tsx +28 -0
- package/src/components/icons/CalendarIcon.tsx +2 -9
- package/src/components/icons/CashFilledIcon.tsx +28 -0
- package/src/components/icons/CashIcon.tsx +33 -0
- package/src/components/icons/ChevronDownIcon.tsx +2 -5
- package/src/components/icons/ChevronLeftIcon.tsx +2 -5
- package/src/components/icons/ChevronRightIcon.tsx +2 -5
- package/src/components/icons/ChevronUpIcon.tsx +2 -5
- package/src/components/icons/CircleBurgerFilledIcon.tsx +28 -0
- package/src/components/icons/CircleBurgerIcon.tsx +28 -0
- package/src/components/icons/ClipboardFilledIcon.tsx +28 -0
- package/src/components/icons/ClipboardIcon.tsx +28 -0
- package/src/components/icons/{InformationIcon.tsx → ClockFilledIcon.tsx} +6 -9
- package/src/components/icons/ClockIcon.tsx +2 -9
- package/src/components/icons/CloseAltFilledIcon.tsx +32 -0
- package/src/components/icons/CloseAltIcon.tsx +2 -13
- package/src/components/icons/CogIcon.tsx +28 -0
- package/src/components/icons/CommunityFilledIcon.tsx +28 -0
- package/src/components/icons/CommunityIcon.tsx +28 -0
- package/src/components/icons/ComputerIcon.tsx +28 -0
- package/src/components/icons/ContactFilledIcon.tsx +28 -0
- package/src/components/icons/ContactIcon.tsx +28 -0
- package/src/components/icons/ContactlessFilledIcon.tsx +28 -0
- package/src/components/icons/ContactlessIcon.tsx +28 -0
- package/src/components/icons/CoopLiveIcon.tsx +29 -0
- package/src/components/icons/CoopLocationFilledIcon.tsx +30 -0
- package/src/components/icons/CoopLogoIcon.tsx +28 -0
- package/src/components/icons/CoopMembershipCardFilledIcon.tsx +40 -0
- package/src/components/icons/CreditCardFilledIcon.tsx +42 -0
- package/src/components/icons/CreditCardIcon.tsx +28 -0
- package/src/components/icons/{CloseIcon.tsx → CrossIcon.tsx} +4 -11
- package/src/components/icons/DocumentIcon.tsx +28 -0
- package/src/components/icons/DownloadIcon.tsx +2 -13
- package/src/components/icons/EnterStoreIcon.tsx +28 -0
- package/src/components/icons/ExitStoreIcon.tsx +28 -0
- package/src/components/icons/EyeFilledIcon.tsx +28 -0
- package/src/components/icons/EyeIcon.tsx +28 -0
- package/src/components/icons/EyeStrikeFilledIcon.tsx +28 -0
- package/src/components/icons/EyeStrikeIcon.tsx +28 -0
- package/src/components/icons/FeedbackFilledIcon.tsx +35 -0
- package/src/components/icons/FeedbackIcon.tsx +28 -0
- package/src/components/icons/FilterIcon.tsx +28 -0
- package/src/components/icons/GiftCardFilledIcon.tsx +28 -0
- package/src/components/icons/GiftCardIcon.tsx +28 -0
- package/src/components/icons/GiftFilledIcon.tsx +28 -0
- package/src/components/icons/GiftIcon.tsx +28 -0
- package/src/components/icons/HelpFilledIcon.tsx +28 -0
- package/src/components/icons/HelpIcon.tsx +28 -0
- package/src/components/icons/HomeFilledIcon.tsx +28 -0
- package/src/components/icons/HomeIcon.tsx +2 -13
- package/src/components/icons/HowDoIAssistantIcon.tsx +28 -0
- package/src/components/icons/InfoIcon.tsx +28 -0
- package/src/components/icons/KebabIcon.tsx +28 -0
- package/src/components/icons/LoadingIcon.tsx +3 -6
- package/src/components/icons/LocationFilledIcon.tsx +28 -0
- package/src/components/icons/LocationIcon.tsx +2 -9
- package/src/components/icons/LogoutIcon.tsx +28 -0
- package/src/components/icons/MailIcon.tsx +2 -5
- package/src/components/icons/MenuIcon.tsx +2 -5
- package/src/components/icons/MessageIcon.tsx +2 -5
- package/src/components/icons/MinusIcon.tsx +2 -5
- package/src/components/icons/NotesFilledIcon.tsx +28 -0
- package/src/components/icons/NotesIcon.tsx +28 -0
- package/src/components/icons/OpenNewIcon.tsx +3 -9
- package/src/components/icons/OwnBagIcon.tsx +28 -0
- package/src/components/icons/PadlockIcon.tsx +28 -0
- package/src/components/icons/PencilIcon.tsx +2 -5
- package/src/components/icons/PhoneIcon.tsx +2 -5
- package/src/components/icons/PowerIcon.tsx +28 -0
- package/src/components/icons/SaveFilledIcon.tsx +28 -0
- package/src/components/icons/SaveIcon.tsx +28 -0
- package/src/components/icons/ScooterIcon.tsx +3 -22
- package/src/components/icons/SearchFilledIcon.tsx +28 -0
- package/src/components/icons/SearchIcon.tsx +9 -9
- package/src/components/icons/SendIcon.tsx +28 -0
- package/src/components/icons/SpannerIcon.tsx +28 -0
- package/src/components/icons/StarFilledIcon.tsx +31 -0
- package/src/components/icons/StarIcon.tsx +28 -0
- package/src/components/icons/TickAltFilledIcon.tsx +32 -0
- package/src/components/icons/TickAltIcon.tsx +2 -9
- package/src/components/icons/TickIcon.tsx +2 -5
- package/src/components/icons/TruckIcon.tsx +28 -0
- package/src/components/icons/UserWipeIcon.tsx +28 -0
- package/src/components/icons/VoucherFilledIcon.tsx +28 -0
- package/src/components/icons/VoucherIcon.tsx +28 -0
- package/src/components/icons/WarningFilledIcon.tsx +28 -0
- package/src/components/icons/WarningIcon.tsx +2 -9
- package/src/components/icons/WifiIcon.tsx +28 -0
- package/src/components/icons/WriteIcon.tsx +5 -17
- package/src/components/icons/index.ts +77 -10
- package/dist/components/icons/AvatarAltIcon.js +0 -20
- package/dist/components/icons/AvatarIcon.js +0 -20
- package/dist/components/icons/CloseIcon.js +0 -20
- package/dist/components/icons/CoopCardIcon.js +0 -20
- package/dist/components/icons/CoopIcon.js +0 -20
- package/dist/components/icons/InformationIcon.js +0 -20
- package/dist/components/icons/QuestionIcon.js +0 -20
- package/dist/components/icons/SettingsIcon.js +0 -20
- package/dist/components/icons/VanIcon.js +0 -20
- package/dist/node_modules/@date-fns/tz/date/index.js +0 -83
- package/dist/node_modules/@date-fns/tz/date/mini.js +0 -235
- package/dist/node_modules/@date-fns/tz/tzName/index.js +0 -39
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +0 -44
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -63
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -213
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -31
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -209
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -303
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -285
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -19
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -132
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -89
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -7
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -775
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -94
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -66
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -31
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +0 -11
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +0 -8
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -25
- package/dist/node_modules/date-fns/addDays.js +0 -41
- package/dist/node_modules/date-fns/addMonths.js +0 -75
- package/dist/node_modules/date-fns/addWeeks.js +0 -33
- package/dist/node_modules/date-fns/addYears.js +0 -33
- package/dist/node_modules/date-fns/constants.js +0 -67
- package/dist/node_modules/date-fns/constructFrom.js +0 -49
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -62
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -42
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +0 -65
- package/dist/node_modules/date-fns/eachYearOfInterval.js +0 -65
- package/dist/node_modules/date-fns/endOfISOWeek.js +0 -35
- package/dist/node_modules/date-fns/endOfMonth.js +0 -37
- package/dist/node_modules/date-fns/endOfWeek.js +0 -53
- package/dist/node_modules/date-fns/endOfYear.js +0 -37
- package/dist/node_modules/date-fns/format.js +0 -423
- package/dist/node_modules/date-fns/getDayOfYear.js +0 -34
- package/dist/node_modules/date-fns/getDaysInMonth.js +0 -36
- package/dist/node_modules/date-fns/getDefaultOptions.js +0 -31
- package/dist/node_modules/date-fns/getISODay.js +0 -33
- package/dist/node_modules/date-fns/getISOWeek.js +0 -40
- package/dist/node_modules/date-fns/getISOWeekYear.js +0 -52
- package/dist/node_modules/date-fns/getMonth.js +0 -29
- package/dist/node_modules/date-fns/getWeek.js +0 -54
- package/dist/node_modules/date-fns/getWeekYear.js +0 -75
- package/dist/node_modules/date-fns/getYear.js +0 -29
- package/dist/node_modules/date-fns/isAfter.js +0 -25
- package/dist/node_modules/date-fns/isBefore.js +0 -25
- package/dist/node_modules/date-fns/isDate.js +0 -41
- package/dist/node_modules/date-fns/isSameDay.js +0 -46
- package/dist/node_modules/date-fns/isSameMonth.js +0 -43
- package/dist/node_modules/date-fns/isSameYear.js +0 -35
- package/dist/node_modules/date-fns/isValid.js +0 -39
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -10
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -64
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -59
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -22
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -103
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -41
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -13
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -189
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -134
- package/dist/node_modules/date-fns/locale/en-US.js +0 -28
- package/dist/node_modules/date-fns/max.js +0 -49
- package/dist/node_modules/date-fns/min.js +0 -49
- package/dist/node_modules/date-fns/parse/_lib/Parser.js +0 -27
- package/dist/node_modules/date-fns/parse/_lib/Setter.js +0 -59
- package/dist/node_modules/date-fns/parse/_lib/constants.js +0 -33
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +0 -55
- package/dist/node_modules/date-fns/parse/_lib/parsers/DateParser.js +0 -59
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +0 -57
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayParser.js +0 -64
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +0 -56
- package/dist/node_modules/date-fns/parse/_lib/parsers/EraParser.js +0 -41
- package/dist/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +0 -24
- package/dist/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +0 -21
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +0 -36
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +0 -31
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +0 -32
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +0 -38
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +0 -118
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +0 -47
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -47
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +0 -48
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +0 -44
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +0 -96
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +0 -47
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +0 -76
- package/dist/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +0 -31
- package/dist/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +0 -86
- package/dist/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +0 -83
- package/dist/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +0 -31
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -97
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +0 -86
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +0 -83
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -19
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +0 -19
- package/dist/node_modules/date-fns/parse/_lib/parsers/YearParser.js +0 -62
- package/dist/node_modules/date-fns/parse/_lib/parsers.js +0 -110
- package/dist/node_modules/date-fns/parse/_lib/utils.js +0 -135
- package/dist/node_modules/date-fns/parse.js +0 -497
- package/dist/node_modules/date-fns/setDay.js +0 -59
- package/dist/node_modules/date-fns/setISODay.js +0 -40
- package/dist/node_modules/date-fns/setISOWeek.js +0 -39
- package/dist/node_modules/date-fns/setMonth.js +0 -46
- package/dist/node_modules/date-fns/setWeek.js +0 -53
- package/dist/node_modules/date-fns/setYear.js +0 -40
- package/dist/node_modules/date-fns/startOfDay.js +0 -35
- package/dist/node_modules/date-fns/startOfISOWeek.js +0 -35
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -42
- package/dist/node_modules/date-fns/startOfMonth.js +0 -37
- package/dist/node_modules/date-fns/startOfWeek.js +0 -53
- package/dist/node_modules/date-fns/startOfWeekYear.js +0 -64
- package/dist/node_modules/date-fns/startOfYear.js +0 -36
- package/dist/node_modules/date-fns/toDate.js +0 -46
- package/dist/node_modules/date-fns/transpose.js +0 -52
- package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +0 -320
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +0 -122
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +0 -604
- package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +0 -31
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +0 -23
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +0 -73
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +0 -95
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +0 -22
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +0 -59
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +0 -24
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +0 -46
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +0 -24
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +0 -53
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +0 -69
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +0 -51
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +0 -40
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +0 -36
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +0 -37
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +0 -36
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +0 -31
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +0 -11
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +0 -32
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +0 -25
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +0 -22
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +0 -67
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +0 -57
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +0 -45
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +0 -44
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +0 -174
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +0 -113
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +0 -25
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +0 -56
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +0 -31
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +0 -95
- package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +0 -57
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +0 -62
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +0 -30
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +0 -74
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +0 -35
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +0 -66
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
- package/dist/node_modules/tslib/tslib.es6.js +0 -56
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
- package/src/components/icons/AvatarAltIcon.tsx +0 -39
- package/src/components/icons/AvatarIcon.tsx +0 -35
- package/src/components/icons/CoopCardIcon.tsx +0 -32
- package/src/components/icons/CoopIcon.tsx +0 -32
- package/src/components/icons/CoopLocationIcon.tsx +0 -39
- package/src/components/icons/QuestionIcon.tsx +0 -35
- package/src/components/icons/SettingsIcon.tsx +0 -31
- package/src/components/icons/VanIcon.tsx +0 -31
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
// packages/react/compose-refs/src/compose-refs.tsx
|
|
4
|
-
function setRef(ref, value) {
|
|
5
|
-
if (typeof ref === "function") {
|
|
6
|
-
return ref(value);
|
|
7
|
-
} else if (ref !== null && ref !== void 0) {
|
|
8
|
-
ref.current = value;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
function composeRefs(...refs) {
|
|
12
|
-
return (node) => {
|
|
13
|
-
let hasCleanup = false;
|
|
14
|
-
const cleanups = refs.map((ref) => {
|
|
15
|
-
const cleanup = setRef(ref, node);
|
|
16
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
17
|
-
hasCleanup = true;
|
|
18
|
-
}
|
|
19
|
-
return cleanup;
|
|
20
|
-
});
|
|
21
|
-
if (hasCleanup) {
|
|
22
|
-
return () => {
|
|
23
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
24
|
-
const cleanup = cleanups[i];
|
|
25
|
-
if (typeof cleanup == "function") {
|
|
26
|
-
cleanup();
|
|
27
|
-
} else {
|
|
28
|
-
setRef(refs[i], null);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function useComposedRefs(...refs) {
|
|
36
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { composeRefs, useComposedRefs };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
// packages/react/context/src/create-context.tsx
|
|
5
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
6
|
-
let defaultContexts = [];
|
|
7
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
8
|
-
const BaseContext = React.createContext(defaultContext);
|
|
9
|
-
const index = defaultContexts.length;
|
|
10
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
11
|
-
const Provider = (props) => {
|
|
12
|
-
const { scope, children, ...context } = props;
|
|
13
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
14
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
15
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
16
|
-
};
|
|
17
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
18
|
-
function useContext2(consumerName, scope) {
|
|
19
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
20
|
-
const context = React.useContext(Context);
|
|
21
|
-
if (context) return context;
|
|
22
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
23
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
24
|
-
}
|
|
25
|
-
return [Provider, useContext2];
|
|
26
|
-
}
|
|
27
|
-
const createScope = () => {
|
|
28
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
29
|
-
return React.createContext(defaultContext);
|
|
30
|
-
});
|
|
31
|
-
return function useScope(scope) {
|
|
32
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
33
|
-
return React.useMemo(
|
|
34
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
35
|
-
[scope, contexts]
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
createScope.scopeName = scopeName;
|
|
40
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
41
|
-
}
|
|
42
|
-
function composeContextScopes(...scopes) {
|
|
43
|
-
const baseScope = scopes[0];
|
|
44
|
-
if (scopes.length === 1) return baseScope;
|
|
45
|
-
const createScope = () => {
|
|
46
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
47
|
-
useScope: createScope2(),
|
|
48
|
-
scopeName: createScope2.scopeName
|
|
49
|
-
}));
|
|
50
|
-
return function useComposedScopes(overrideScopes) {
|
|
51
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
52
|
-
const scopeProps = useScope(overrideScopes);
|
|
53
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
54
|
-
return { ...nextScopes2, ...currentScope };
|
|
55
|
-
}, {});
|
|
56
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
createScope.scopeName = baseScope.scopeName;
|
|
60
|
-
return createScope;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { createContextScope };
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { composeEventHandlers } from '../../primitive/dist/index.js';
|
|
5
|
-
import { Primitive, dispatchDiscreteCustomEvent } from '../../react-primitive/dist/index.js';
|
|
6
|
-
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
7
|
-
import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
|
|
8
|
-
import { useEscapeKeydown } from '../../react-use-escape-keydown/dist/index.js';
|
|
9
|
-
import { jsx } from 'react/jsx-runtime';
|
|
10
|
-
|
|
11
|
-
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
12
|
-
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
13
|
-
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
14
|
-
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
15
|
-
var originalBodyPointerEvents;
|
|
16
|
-
var DismissableLayerContext = React.createContext({
|
|
17
|
-
layers: /* @__PURE__ */ new Set(),
|
|
18
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
19
|
-
branches: /* @__PURE__ */ new Set()
|
|
20
|
-
});
|
|
21
|
-
var DismissableLayer = React.forwardRef(
|
|
22
|
-
(props, forwardedRef) => {
|
|
23
|
-
const {
|
|
24
|
-
disableOutsidePointerEvents = false,
|
|
25
|
-
onEscapeKeyDown,
|
|
26
|
-
onPointerDownOutside,
|
|
27
|
-
onFocusOutside,
|
|
28
|
-
onInteractOutside,
|
|
29
|
-
onDismiss,
|
|
30
|
-
...layerProps
|
|
31
|
-
} = props;
|
|
32
|
-
const context = React.useContext(DismissableLayerContext);
|
|
33
|
-
const [node, setNode] = React.useState(null);
|
|
34
|
-
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
35
|
-
const [, force] = React.useState({});
|
|
36
|
-
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
37
|
-
const layers = Array.from(context.layers);
|
|
38
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
39
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
40
|
-
const index = node ? layers.indexOf(node) : -1;
|
|
41
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
42
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
43
|
-
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
44
|
-
const target = event.target;
|
|
45
|
-
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
46
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
47
|
-
onPointerDownOutside?.(event);
|
|
48
|
-
onInteractOutside?.(event);
|
|
49
|
-
if (!event.defaultPrevented) onDismiss?.();
|
|
50
|
-
}, ownerDocument);
|
|
51
|
-
const focusOutside = useFocusOutside((event) => {
|
|
52
|
-
const target = event.target;
|
|
53
|
-
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
54
|
-
if (isFocusInBranch) return;
|
|
55
|
-
onFocusOutside?.(event);
|
|
56
|
-
onInteractOutside?.(event);
|
|
57
|
-
if (!event.defaultPrevented) onDismiss?.();
|
|
58
|
-
}, ownerDocument);
|
|
59
|
-
useEscapeKeydown((event) => {
|
|
60
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
61
|
-
if (!isHighestLayer) return;
|
|
62
|
-
onEscapeKeyDown?.(event);
|
|
63
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
64
|
-
event.preventDefault();
|
|
65
|
-
onDismiss();
|
|
66
|
-
}
|
|
67
|
-
}, ownerDocument);
|
|
68
|
-
React.useEffect(() => {
|
|
69
|
-
if (!node) return;
|
|
70
|
-
if (disableOutsidePointerEvents) {
|
|
71
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
72
|
-
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
73
|
-
ownerDocument.body.style.pointerEvents = "none";
|
|
74
|
-
}
|
|
75
|
-
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
76
|
-
}
|
|
77
|
-
context.layers.add(node);
|
|
78
|
-
dispatchUpdate();
|
|
79
|
-
return () => {
|
|
80
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
81
|
-
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
85
|
-
React.useEffect(() => {
|
|
86
|
-
return () => {
|
|
87
|
-
if (!node) return;
|
|
88
|
-
context.layers.delete(node);
|
|
89
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
90
|
-
dispatchUpdate();
|
|
91
|
-
};
|
|
92
|
-
}, [node, context]);
|
|
93
|
-
React.useEffect(() => {
|
|
94
|
-
const handleUpdate = () => force({});
|
|
95
|
-
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
96
|
-
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
97
|
-
}, []);
|
|
98
|
-
return /* @__PURE__ */ jsx(
|
|
99
|
-
Primitive.div,
|
|
100
|
-
{
|
|
101
|
-
...layerProps,
|
|
102
|
-
ref: composedRefs,
|
|
103
|
-
style: {
|
|
104
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
105
|
-
...props.style
|
|
106
|
-
},
|
|
107
|
-
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
108
|
-
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
109
|
-
onPointerDownCapture: composeEventHandlers(
|
|
110
|
-
props.onPointerDownCapture,
|
|
111
|
-
pointerDownOutside.onPointerDownCapture
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
118
|
-
var BRANCH_NAME = "DismissableLayerBranch";
|
|
119
|
-
var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
120
|
-
const context = React.useContext(DismissableLayerContext);
|
|
121
|
-
const ref = React.useRef(null);
|
|
122
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
123
|
-
React.useEffect(() => {
|
|
124
|
-
const node = ref.current;
|
|
125
|
-
if (node) {
|
|
126
|
-
context.branches.add(node);
|
|
127
|
-
return () => {
|
|
128
|
-
context.branches.delete(node);
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
}, [context.branches]);
|
|
132
|
-
return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
133
|
-
});
|
|
134
|
-
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
135
|
-
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
136
|
-
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
137
|
-
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
138
|
-
const handleClickRef = React.useRef(() => {
|
|
139
|
-
});
|
|
140
|
-
React.useEffect(() => {
|
|
141
|
-
const handlePointerDown = (event) => {
|
|
142
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
143
|
-
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
144
|
-
handleAndDispatchCustomEvent(
|
|
145
|
-
POINTER_DOWN_OUTSIDE,
|
|
146
|
-
handlePointerDownOutside,
|
|
147
|
-
eventDetail,
|
|
148
|
-
{ discrete: true }
|
|
149
|
-
);
|
|
150
|
-
};
|
|
151
|
-
const eventDetail = { originalEvent: event };
|
|
152
|
-
if (event.pointerType === "touch") {
|
|
153
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
154
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
155
|
-
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
156
|
-
} else {
|
|
157
|
-
handleAndDispatchPointerDownOutsideEvent2();
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
161
|
-
}
|
|
162
|
-
isPointerInsideReactTreeRef.current = false;
|
|
163
|
-
};
|
|
164
|
-
const timerId = window.setTimeout(() => {
|
|
165
|
-
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
166
|
-
}, 0);
|
|
167
|
-
return () => {
|
|
168
|
-
window.clearTimeout(timerId);
|
|
169
|
-
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
170
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
171
|
-
};
|
|
172
|
-
}, [ownerDocument, handlePointerDownOutside]);
|
|
173
|
-
return {
|
|
174
|
-
// ensures we check React component tree (not just DOM tree)
|
|
175
|
-
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
179
|
-
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
180
|
-
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
181
|
-
React.useEffect(() => {
|
|
182
|
-
const handleFocus = (event) => {
|
|
183
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
184
|
-
const eventDetail = { originalEvent: event };
|
|
185
|
-
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
186
|
-
discrete: false
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
ownerDocument.addEventListener("focusin", handleFocus);
|
|
191
|
-
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
192
|
-
}, [ownerDocument, handleFocusOutside]);
|
|
193
|
-
return {
|
|
194
|
-
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
195
|
-
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
function dispatchUpdate() {
|
|
199
|
-
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
200
|
-
document.dispatchEvent(event);
|
|
201
|
-
}
|
|
202
|
-
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
203
|
-
const target = detail.originalEvent.target;
|
|
204
|
-
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
205
|
-
if (handler) target.addEventListener(name, handler, { once: true });
|
|
206
|
-
if (discrete) {
|
|
207
|
-
dispatchDiscreteCustomEvent(target, event);
|
|
208
|
-
} else {
|
|
209
|
-
target.dispatchEvent(event);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export { DismissableLayer, DismissableLayerBranch };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
var count = 0;
|
|
6
|
-
function useFocusGuards() {
|
|
7
|
-
React.useEffect(() => {
|
|
8
|
-
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
9
|
-
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
10
|
-
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
11
|
-
count++;
|
|
12
|
-
return () => {
|
|
13
|
-
if (count === 1) {
|
|
14
|
-
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
15
|
-
}
|
|
16
|
-
count--;
|
|
17
|
-
};
|
|
18
|
-
}, []);
|
|
19
|
-
}
|
|
20
|
-
function createFocusGuard() {
|
|
21
|
-
const element = document.createElement("span");
|
|
22
|
-
element.setAttribute("data-radix-focus-guard", "");
|
|
23
|
-
element.tabIndex = 0;
|
|
24
|
-
element.style.outline = "none";
|
|
25
|
-
element.style.opacity = "0";
|
|
26
|
-
element.style.position = "fixed";
|
|
27
|
-
element.style.pointerEvents = "none";
|
|
28
|
-
return element;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { useFocusGuards };
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
5
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
6
|
-
import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
10
|
-
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
11
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
12
|
-
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
13
|
-
var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
14
|
-
const {
|
|
15
|
-
loop = false,
|
|
16
|
-
trapped = false,
|
|
17
|
-
onMountAutoFocus: onMountAutoFocusProp,
|
|
18
|
-
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
19
|
-
...scopeProps
|
|
20
|
-
} = props;
|
|
21
|
-
const [container, setContainer] = React.useState(null);
|
|
22
|
-
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
23
|
-
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
24
|
-
const lastFocusedElementRef = React.useRef(null);
|
|
25
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
26
|
-
const focusScope = React.useRef({
|
|
27
|
-
paused: false,
|
|
28
|
-
pause() {
|
|
29
|
-
this.paused = true;
|
|
30
|
-
},
|
|
31
|
-
resume() {
|
|
32
|
-
this.paused = false;
|
|
33
|
-
}
|
|
34
|
-
}).current;
|
|
35
|
-
React.useEffect(() => {
|
|
36
|
-
if (trapped) {
|
|
37
|
-
let handleFocusIn2 = function(event) {
|
|
38
|
-
if (focusScope.paused || !container) return;
|
|
39
|
-
const target = event.target;
|
|
40
|
-
if (container.contains(target)) {
|
|
41
|
-
lastFocusedElementRef.current = target;
|
|
42
|
-
} else {
|
|
43
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
44
|
-
}
|
|
45
|
-
}, handleFocusOut2 = function(event) {
|
|
46
|
-
if (focusScope.paused || !container) return;
|
|
47
|
-
const relatedTarget = event.relatedTarget;
|
|
48
|
-
if (relatedTarget === null) return;
|
|
49
|
-
if (!container.contains(relatedTarget)) {
|
|
50
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
51
|
-
}
|
|
52
|
-
}, handleMutations2 = function(mutations) {
|
|
53
|
-
const focusedElement = document.activeElement;
|
|
54
|
-
if (focusedElement !== document.body) return;
|
|
55
|
-
for (const mutation of mutations) {
|
|
56
|
-
if (mutation.removedNodes.length > 0) focus(container);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
document.addEventListener("focusin", handleFocusIn2);
|
|
60
|
-
document.addEventListener("focusout", handleFocusOut2);
|
|
61
|
-
const mutationObserver = new MutationObserver(handleMutations2);
|
|
62
|
-
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
63
|
-
return () => {
|
|
64
|
-
document.removeEventListener("focusin", handleFocusIn2);
|
|
65
|
-
document.removeEventListener("focusout", handleFocusOut2);
|
|
66
|
-
mutationObserver.disconnect();
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}, [trapped, container, focusScope.paused]);
|
|
70
|
-
React.useEffect(() => {
|
|
71
|
-
if (container) {
|
|
72
|
-
focusScopesStack.add(focusScope);
|
|
73
|
-
const previouslyFocusedElement = document.activeElement;
|
|
74
|
-
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
75
|
-
if (!hasFocusedCandidate) {
|
|
76
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
77
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
78
|
-
container.dispatchEvent(mountEvent);
|
|
79
|
-
if (!mountEvent.defaultPrevented) {
|
|
80
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
81
|
-
if (document.activeElement === previouslyFocusedElement) {
|
|
82
|
-
focus(container);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return () => {
|
|
87
|
-
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
90
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
91
|
-
container.dispatchEvent(unmountEvent);
|
|
92
|
-
if (!unmountEvent.defaultPrevented) {
|
|
93
|
-
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
94
|
-
}
|
|
95
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
96
|
-
focusScopesStack.remove(focusScope);
|
|
97
|
-
}, 0);
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
101
|
-
const handleKeyDown = React.useCallback(
|
|
102
|
-
(event) => {
|
|
103
|
-
if (!loop && !trapped) return;
|
|
104
|
-
if (focusScope.paused) return;
|
|
105
|
-
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
106
|
-
const focusedElement = document.activeElement;
|
|
107
|
-
if (isTabKey && focusedElement) {
|
|
108
|
-
const container2 = event.currentTarget;
|
|
109
|
-
const [first, last] = getTabbableEdges(container2);
|
|
110
|
-
const hasTabbableElementsInside = first && last;
|
|
111
|
-
if (!hasTabbableElementsInside) {
|
|
112
|
-
if (focusedElement === container2) event.preventDefault();
|
|
113
|
-
} else {
|
|
114
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
115
|
-
event.preventDefault();
|
|
116
|
-
if (loop) focus(first, { select: true });
|
|
117
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
118
|
-
event.preventDefault();
|
|
119
|
-
if (loop) focus(last, { select: true });
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
[loop, trapped, focusScope.paused]
|
|
125
|
-
);
|
|
126
|
-
return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
127
|
-
});
|
|
128
|
-
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
129
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
130
|
-
const previouslyFocusedElement = document.activeElement;
|
|
131
|
-
for (const candidate of candidates) {
|
|
132
|
-
focus(candidate, { select });
|
|
133
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function getTabbableEdges(container) {
|
|
137
|
-
const candidates = getTabbableCandidates(container);
|
|
138
|
-
const first = findVisible(candidates, container);
|
|
139
|
-
const last = findVisible(candidates.reverse(), container);
|
|
140
|
-
return [first, last];
|
|
141
|
-
}
|
|
142
|
-
function getTabbableCandidates(container) {
|
|
143
|
-
const nodes = [];
|
|
144
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
145
|
-
acceptNode: (node) => {
|
|
146
|
-
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
147
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
148
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
152
|
-
return nodes;
|
|
153
|
-
}
|
|
154
|
-
function findVisible(elements, container) {
|
|
155
|
-
for (const element of elements) {
|
|
156
|
-
if (!isHidden(element, { upTo: container })) return element;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function isHidden(node, { upTo }) {
|
|
160
|
-
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
161
|
-
while (node) {
|
|
162
|
-
if (upTo !== void 0 && node === upTo) return false;
|
|
163
|
-
if (getComputedStyle(node).display === "none") return true;
|
|
164
|
-
node = node.parentElement;
|
|
165
|
-
}
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
function isSelectableInput(element) {
|
|
169
|
-
return element instanceof HTMLInputElement && "select" in element;
|
|
170
|
-
}
|
|
171
|
-
function focus(element, { select = false } = {}) {
|
|
172
|
-
if (element && element.focus) {
|
|
173
|
-
const previouslyFocusedElement = document.activeElement;
|
|
174
|
-
element.focus({ preventScroll: true });
|
|
175
|
-
if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
|
|
176
|
-
element.select();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
var focusScopesStack = createFocusScopesStack();
|
|
180
|
-
function createFocusScopesStack() {
|
|
181
|
-
let stack = [];
|
|
182
|
-
return {
|
|
183
|
-
add(focusScope) {
|
|
184
|
-
const activeFocusScope = stack[0];
|
|
185
|
-
if (focusScope !== activeFocusScope) {
|
|
186
|
-
activeFocusScope?.pause();
|
|
187
|
-
}
|
|
188
|
-
stack = arrayRemove(stack, focusScope);
|
|
189
|
-
stack.unshift(focusScope);
|
|
190
|
-
},
|
|
191
|
-
remove(focusScope) {
|
|
192
|
-
stack = arrayRemove(stack, focusScope);
|
|
193
|
-
stack[0]?.resume();
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
function arrayRemove(array, item) {
|
|
198
|
-
const updatedArray = [...array];
|
|
199
|
-
const index = updatedArray.indexOf(item);
|
|
200
|
-
if (index !== -1) {
|
|
201
|
-
updatedArray.splice(index, 1);
|
|
202
|
-
}
|
|
203
|
-
return updatedArray;
|
|
204
|
-
}
|
|
205
|
-
function removeLinks(items) {
|
|
206
|
-
return items.filter((item) => item.tagName !== "A");
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export { FocusScope };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
|
|
3
|
-
|
|
4
|
-
// packages/react/id/src/id.tsx
|
|
5
|
-
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
6
|
-
var count = 0;
|
|
7
|
-
function useId(deterministicId) {
|
|
8
|
-
const [id, setId] = React.useState(useReactId());
|
|
9
|
-
useLayoutEffect2(() => {
|
|
10
|
-
setId((reactId) => reactId ?? String(count++));
|
|
11
|
-
}, [deterministicId]);
|
|
12
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { useId };
|