@flipdish/ui-library 0.31.4 → 0.31.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/dist/components/atoms/AppStoreButton/index.cjs +4 -0
- package/dist/components/atoms/AppStoreButton/index.cjs.map +1 -1
- package/dist/components/atoms/AppStoreButton/index.d.ts +9 -0
- package/dist/components/atoms/AppStoreButton/index.d.ts.map +1 -1
- package/dist/components/atoms/AppStoreButton/index.js +4 -0
- package/dist/components/atoms/AppStoreButton/index.js.map +1 -1
- package/dist/components/atoms/Avatar/components/AvatarBase.cjs.map +1 -1
- package/dist/components/atoms/Avatar/components/AvatarBase.d.ts +4 -0
- package/dist/components/atoms/Avatar/components/AvatarBase.d.ts.map +1 -1
- package/dist/components/atoms/Avatar/components/AvatarBase.js.map +1 -1
- package/dist/components/atoms/BackgroundPattern/index.cjs +1 -1
- package/dist/components/atoms/BackgroundPattern/index.cjs.map +1 -1
- package/dist/components/atoms/BackgroundPattern/index.d.ts +5 -1
- package/dist/components/atoms/BackgroundPattern/index.d.ts.map +1 -1
- package/dist/components/atoms/BackgroundPattern/index.js +1 -1
- package/dist/components/atoms/BackgroundPattern/index.js.map +1 -1
- package/dist/components/atoms/Badge/index.cjs +6 -0
- package/dist/components/atoms/Badge/index.cjs.map +1 -1
- package/dist/components/atoms/Badge/index.d.ts +11 -0
- package/dist/components/atoms/Badge/index.d.ts.map +1 -1
- package/dist/components/atoms/Badge/index.js +6 -0
- package/dist/components/atoms/Badge/index.js.map +1 -1
- package/dist/components/atoms/Button/index.cjs.map +1 -1
- package/dist/components/atoms/Button/index.d.ts +3 -0
- package/dist/components/atoms/Button/index.d.ts.map +1 -1
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/Checkbox/index.cjs +1 -0
- package/dist/components/atoms/Checkbox/index.cjs.map +1 -1
- package/dist/components/atoms/Checkbox/index.d.ts +11 -0
- package/dist/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/index.js +1 -0
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/CloseButton/index.cjs +1 -1
- package/dist/components/atoms/CloseButton/index.cjs.map +1 -1
- package/dist/components/atoms/CloseButton/index.d.ts +4 -1
- package/dist/components/atoms/CloseButton/index.d.ts.map +1 -1
- package/dist/components/atoms/CloseButton/index.js +1 -1
- package/dist/components/atoms/CloseButton/index.js.map +1 -1
- package/dist/components/atoms/Dot/index.cjs.map +1 -1
- package/dist/components/atoms/Dot/index.d.ts +1 -0
- package/dist/components/atoms/Dot/index.d.ts.map +1 -1
- package/dist/components/atoms/Dot/index.js.map +1 -1
- package/dist/components/atoms/FeaturedIcon/index.cjs +1 -1
- package/dist/components/atoms/FeaturedIcon/index.cjs.map +1 -1
- package/dist/components/atoms/FeaturedIcon/index.d.ts +8 -1
- package/dist/components/atoms/FeaturedIcon/index.d.ts.map +1 -1
- package/dist/components/atoms/FeaturedIcon/index.js +1 -1
- package/dist/components/atoms/FeaturedIcon/index.js.map +1 -1
- package/dist/components/atoms/Illustration/components/Box.cjs.map +1 -1
- package/dist/components/atoms/Illustration/components/Box.d.ts +3 -0
- package/dist/components/atoms/Illustration/components/Box.d.ts.map +1 -1
- package/dist/components/atoms/Illustration/components/Box.js.map +1 -1
- package/dist/components/atoms/Illustration/components/Cloud.cjs.map +1 -1
- package/dist/components/atoms/Illustration/components/Cloud.d.ts +3 -0
- package/dist/components/atoms/Illustration/components/Cloud.d.ts.map +1 -1
- package/dist/components/atoms/Illustration/components/Cloud.js.map +1 -1
- package/dist/components/atoms/Illustration/components/CreditCard.cjs.map +1 -1
- package/dist/components/atoms/Illustration/components/CreditCard.d.ts +3 -0
- package/dist/components/atoms/Illustration/components/CreditCard.d.ts.map +1 -1
- package/dist/components/atoms/Illustration/components/CreditCard.js.map +1 -1
- package/dist/components/atoms/Illustration/components/Documents.cjs.map +1 -1
- package/dist/components/atoms/Illustration/components/Documents.d.ts +3 -0
- package/dist/components/atoms/Illustration/components/Documents.d.ts.map +1 -1
- package/dist/components/atoms/Illustration/components/Documents.js.map +1 -1
- package/dist/components/atoms/Illustration/index.cjs.map +1 -1
- package/dist/components/atoms/Illustration/index.d.ts +4 -0
- package/dist/components/atoms/Illustration/index.d.ts.map +1 -1
- package/dist/components/atoms/Illustration/index.js.map +1 -1
- package/dist/components/atoms/Input/index.cjs +2 -0
- package/dist/components/atoms/Input/index.cjs.map +1 -1
- package/dist/components/atoms/Input/index.d.ts +5 -4
- package/dist/components/atoms/Input/index.d.ts.map +1 -1
- package/dist/components/atoms/Input/index.js +2 -0
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/ProgressBar/index.cjs +1 -1
- package/dist/components/atoms/ProgressBar/index.d.ts +1 -1
- package/dist/components/atoms/ProgressBar/index.js +1 -1
- package/dist/components/atoms/QRCode/index.cjs +2 -1
- package/dist/components/atoms/QRCode/index.cjs.map +1 -1
- package/dist/components/atoms/QRCode/index.d.ts +2 -1
- package/dist/components/atoms/QRCode/index.d.ts.map +1 -1
- package/dist/components/atoms/QRCode/index.js +2 -1
- package/dist/components/atoms/QRCode/index.js.map +1 -1
- package/dist/components/atoms/RadioButton/index.cjs +2 -0
- package/dist/components/atoms/RadioButton/index.cjs.map +1 -1
- package/dist/components/atoms/RadioButton/index.d.ts +11 -0
- package/dist/components/atoms/RadioButton/index.d.ts.map +1 -1
- package/dist/components/atoms/RadioButton/index.js +2 -0
- package/dist/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/components/atoms/RatingBadge/index.cjs +1 -0
- package/dist/components/atoms/RatingBadge/index.cjs.map +1 -1
- package/dist/components/atoms/RatingBadge/index.d.ts +5 -0
- package/dist/components/atoms/RatingBadge/index.d.ts.map +1 -1
- package/dist/components/atoms/RatingBadge/index.js +1 -0
- package/dist/components/atoms/RatingBadge/index.js.map +1 -1
- package/dist/components/atoms/RatingStars/index.cjs +1 -0
- package/dist/components/atoms/RatingStars/index.cjs.map +1 -1
- package/dist/components/atoms/RatingStars/index.d.ts +1 -0
- package/dist/components/atoms/RatingStars/index.d.ts.map +1 -1
- package/dist/components/atoms/RatingStars/index.js +1 -0
- package/dist/components/atoms/RatingStars/index.js.map +1 -1
- package/dist/components/atoms/Slider/index.cjs.map +1 -1
- package/dist/components/atoms/Slider/index.d.ts +2 -0
- package/dist/components/atoms/Slider/index.d.ts.map +1 -1
- package/dist/components/atoms/Slider/index.js.map +1 -1
- package/dist/components/atoms/SocialButton/index.cjs.map +1 -1
- package/dist/components/atoms/SocialButton/index.d.ts +5 -0
- package/dist/components/atoms/SocialButton/index.d.ts.map +1 -1
- package/dist/components/atoms/SocialButton/index.js.map +1 -1
- package/dist/components/atoms/Toggle/index.cjs +1 -0
- package/dist/components/atoms/Toggle/index.cjs.map +1 -1
- package/dist/components/atoms/Toggle/index.d.ts +5 -0
- package/dist/components/atoms/Toggle/index.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/index.js +1 -0
- package/dist/components/atoms/Toggle/index.js.map +1 -1
- package/dist/components/atoms/Tooltip/index.cjs +1 -0
- package/dist/components/atoms/Tooltip/index.cjs.map +1 -1
- package/dist/components/atoms/Tooltip/index.d.ts +1 -0
- package/dist/components/atoms/Tooltip/index.d.ts.map +1 -1
- package/dist/components/atoms/Tooltip/index.js +1 -0
- package/dist/components/atoms/Tooltip/index.js.map +1 -1
- package/dist/components/atoms/UtilityButton/index.cjs +1 -1
- package/dist/components/atoms/UtilityButton/index.d.ts +1 -1
- package/dist/components/atoms/UtilityButton/index.js +1 -1
- package/dist/components/molecules/BadgeGroup/index.cjs +1 -2
- package/dist/components/molecules/BadgeGroup/index.cjs.map +1 -1
- package/dist/components/molecules/BadgeGroup/index.d.ts +8 -2
- package/dist/components/molecules/BadgeGroup/index.d.ts.map +1 -1
- package/dist/components/molecules/BadgeGroup/index.js +1 -2
- package/dist/components/molecules/BadgeGroup/index.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbAccountItem.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbAccountItem.d.ts +3 -0
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbAccountItem.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbAccountItem.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.d.ts +8 -0
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.cjs +1 -2
- package/dist/components/molecules/Breadcrumbs/index.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.d.ts +5 -2
- package/dist/components/molecules/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.js +1 -2
- package/dist/components/molecules/Breadcrumbs/index.js.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.d.ts +2 -0
- package/dist/components/molecules/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.js.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.cjs.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.d.ts +1 -0
- package/dist/components/molecules/CodeSnippet/index.d.ts.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.js.map +1 -1
- package/dist/components/molecules/ContentDivider/index.cjs.map +1 -1
- package/dist/components/molecules/ContentDivider/index.d.ts +3 -0
- package/dist/components/molecules/ContentDivider/index.d.ts.map +1 -1
- package/dist/components/molecules/ContentDivider/index.js.map +1 -1
- package/dist/components/molecules/CreditCard/index.cjs +1 -2
- package/dist/components/molecules/CreditCard/index.cjs.map +1 -1
- package/dist/components/molecules/CreditCard/index.d.ts +8 -2
- package/dist/components/molecules/CreditCard/index.d.ts.map +1 -1
- package/dist/components/molecules/CreditCard/index.js +1 -2
- package/dist/components/molecules/CreditCard/index.js.map +1 -1
- package/dist/components/molecules/EmptyState/index.cjs +1 -2
- package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
- package/dist/components/molecules/EmptyState/index.d.ts +10 -2
- package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
- package/dist/components/molecules/EmptyState/index.js +1 -2
- package/dist/components/molecules/EmptyState/index.js.map +1 -1
- package/dist/components/molecules/Modal/index.cjs +4 -4
- package/dist/components/molecules/Modal/index.cjs.map +1 -1
- package/dist/components/molecules/Modal/index.d.ts +4 -4
- package/dist/components/molecules/Modal/index.d.ts.map +1 -1
- package/dist/components/molecules/Modal/index.js +4 -4
- package/dist/components/molecules/Modal/index.js.map +1 -1
- package/dist/components/molecules/Notification/index.cjs +6 -0
- package/dist/components/molecules/Notification/index.cjs.map +1 -1
- package/dist/components/molecules/Notification/index.d.ts +16 -0
- package/dist/components/molecules/Notification/index.d.ts.map +1 -1
- package/dist/components/molecules/Notification/index.js +6 -0
- package/dist/components/molecules/Notification/index.js.map +1 -1
- package/dist/components/molecules/Pagination/components/PaginationBase.cjs.map +1 -1
- package/dist/components/molecules/Pagination/components/PaginationBase.d.ts +1 -0
- package/dist/components/molecules/Pagination/components/PaginationBase.d.ts.map +1 -1
- package/dist/components/molecules/Pagination/components/PaginationBase.js.map +1 -1
- package/dist/components/molecules/Pagination/index.cjs +3 -0
- package/dist/components/molecules/Pagination/index.cjs.map +1 -1
- package/dist/components/molecules/Pagination/index.d.ts +3 -0
- package/dist/components/molecules/Pagination/index.d.ts.map +1 -1
- package/dist/components/molecules/Pagination/index.js +3 -0
- package/dist/components/molecules/Pagination/index.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.cjs +1 -2
- package/dist/components/molecules/ProgressSteps/index.cjs.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.d.ts +1 -2
- package/dist/components/molecules/ProgressSteps/index.d.ts.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.js +1 -2
- package/dist/components/molecules/ProgressSteps/index.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/progressSteps.types.d.ts +8 -0
- package/dist/components/molecules/ProgressSteps/progressSteps.types.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.d.ts +2 -0
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.d.ts +2 -0
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.d.ts +2 -0
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.d.ts +2 -0
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.d.ts +2 -0
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupRadioButton.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupRadioButton.d.ts +2 -0
- package/dist/components/molecules/RadioGroup/components/RadioGroupRadioButton.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupRadioButton.js.map +1 -1
- package/dist/components/molecules/SectionFooter/index.cjs.map +1 -1
- package/dist/components/molecules/SectionFooter/index.d.ts +1 -0
- package/dist/components/molecules/SectionFooter/index.d.ts.map +1 -1
- package/dist/components/molecules/SectionFooter/index.js.map +1 -1
- package/dist/components/molecules/Select/index.cjs.map +1 -1
- package/dist/components/molecules/Select/index.d.ts +4 -0
- package/dist/components/molecules/Select/index.d.ts.map +1 -1
- package/dist/components/molecules/Select/index.js.map +1 -1
- package/dist/components/molecules/Tabs/index.cjs +3 -0
- package/dist/components/molecules/Tabs/index.cjs.map +1 -1
- package/dist/components/molecules/Tabs/index.d.ts +4 -0
- package/dist/components/molecules/Tabs/index.d.ts.map +1 -1
- package/dist/components/molecules/Tabs/index.js +3 -0
- package/dist/components/molecules/Tabs/index.js.map +1 -1
- package/dist/components/molecules/Tags/index.cjs +4 -2
- package/dist/components/molecules/Tags/index.cjs.map +1 -1
- package/dist/components/molecules/Tags/index.d.ts +6 -2
- package/dist/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/components/molecules/Tags/index.js +4 -2
- package/dist/components/molecules/Tags/index.js.map +1 -1
- package/dist/components/molecules/TextArea/index.cjs +1 -0
- package/dist/components/molecules/TextArea/index.cjs.map +1 -1
- package/dist/components/molecules/TextArea/index.d.ts +1 -0
- package/dist/components/molecules/TextArea/index.d.ts.map +1 -1
- package/dist/components/molecules/TextArea/index.js +1 -0
- package/dist/components/molecules/TextArea/index.js.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.cjs.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.d.ts +4 -0
- package/dist/components/molecules/VerificationCodeInput/index.d.ts.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.js.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.cjs.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.d.ts +11 -0
- package/dist/components/organisms/ActivityFeed/index.d.ts.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.js.map +1 -1
- package/dist/components/organisms/Calendar/index.cjs.map +1 -1
- package/dist/components/organisms/Calendar/index.d.ts +3 -0
- package/dist/components/organisms/Calendar/index.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/index.js.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.cjs.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.d.ts +8 -0
- package/dist/components/organisms/Charts/components/Metrics.d.ts.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.js.map +1 -1
- package/dist/components/organisms/Charts/index.d.ts +0 -2
- package/dist/components/organisms/Charts/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.cjs +1 -0
- package/dist/components/organisms/ColorPicker/index.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/index.d.ts +2 -0
- package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.js +1 -0
- package/dist/components/organisms/ColorPicker/index.js.map +1 -1
- package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts +1 -0
- package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.js.map +1 -1
- package/dist/components/organisms/CommandMenu/index.cjs +5 -0
- package/dist/components/organisms/CommandMenu/index.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/index.d.ts +13 -0
- package/dist/components/organisms/CommandMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/index.js +5 -0
- package/dist/components/organisms/CommandMenu/index.js.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.d.ts +1 -0
- package/dist/components/organisms/DatePicker/components/DateRangePicker.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.js.map +1 -1
- package/dist/components/organisms/DatePicker/components/InputDate.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/components/InputDate.d.ts +4 -0
- package/dist/components/organisms/DatePicker/components/InputDate.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/components/InputDate.js.map +1 -1
- package/dist/components/organisms/DatePicker/index.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/index.d.ts +1 -0
- package/dist/components/organisms/DatePicker/index.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/index.js.map +1 -1
- package/dist/components/organisms/FileUpload/index.cjs +7 -0
- package/dist/components/organisms/FileUpload/index.cjs.map +1 -1
- package/dist/components/organisms/FileUpload/index.d.ts +7 -0
- package/dist/components/organisms/FileUpload/index.d.ts.map +1 -1
- package/dist/components/organisms/FileUpload/index.js +7 -0
- package/dist/components/organisms/FileUpload/index.js.map +1 -1
- package/dist/components/organisms/GradientPicker/providers/GradientPicker.provider.cjs.map +1 -1
- package/dist/components/organisms/GradientPicker/providers/GradientPicker.provider.d.ts +1 -0
- package/dist/components/organisms/GradientPicker/providers/GradientPicker.provider.d.ts.map +1 -1
- package/dist/components/organisms/GradientPicker/providers/GradientPicker.provider.js.map +1 -1
- package/dist/components/organisms/ImagePicker/providers/ImagePicker.provider.cjs.map +1 -1
- package/dist/components/organisms/ImagePicker/providers/ImagePicker.provider.d.ts +1 -0
- package/dist/components/organisms/ImagePicker/providers/ImagePicker.provider.d.ts.map +1 -1
- package/dist/components/organisms/ImagePicker/providers/ImagePicker.provider.js.map +1 -1
- package/dist/components/organisms/Messaging/index.cjs +1 -0
- package/dist/components/organisms/Messaging/index.cjs.map +1 -1
- package/dist/components/organisms/Messaging/index.d.ts +3 -0
- package/dist/components/organisms/Messaging/index.d.ts.map +1 -1
- package/dist/components/organisms/Messaging/index.js +1 -0
- package/dist/components/organisms/Messaging/index.js.map +1 -1
- package/dist/components/organisms/PageHeader/index.cjs.map +1 -1
- package/dist/components/organisms/PageHeader/index.d.ts +1 -0
- package/dist/components/organisms/PageHeader/index.d.ts.map +1 -1
- package/dist/components/organisms/PageHeader/index.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.cjs +3 -0
- package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.d.ts +6 -0
- package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.js +3 -0
- package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
- package/dist/components/organisms/Table/index.cjs +1 -0
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.d.ts +2 -0
- package/dist/components/organisms/Table/index.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.js +1 -0
- package/dist/components/organisms/Table/index.js.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorButton.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorButton.d.ts +1 -0
- package/dist/components/organisms/TextEditor/components/TextEditorButton.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorButton.js.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorToolbar.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorToolbar.d.ts +4 -0
- package/dist/components/organisms/TextEditor/components/TextEditorToolbar.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorToolbar.js.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorTooltip.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorTooltip.d.ts +2 -0
- package/dist/components/organisms/TextEditor/components/TextEditorTooltip.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorTooltip.js.map +1 -1
- package/dist/components/organisms/TreeView/index.cjs.map +1 -1
- package/dist/components/organisms/TreeView/index.d.ts +1 -0
- package/dist/components/organisms/TreeView/index.d.ts.map +1 -1
- package/dist/components/organisms/TreeView/index.js.map +1 -1
- package/dist/components/organisms/VideoPlayer/index.cjs.map +1 -1
- package/dist/components/organisms/VideoPlayer/index.d.ts +1 -0
- package/dist/components/organisms/VideoPlayer/index.d.ts.map +1 -1
- package/dist/components/organisms/VideoPlayer/index.js.map +1 -1
- package/dist/components/templates/AppShell/index.cjs +5 -7
- package/dist/components/templates/AppShell/index.cjs.map +1 -1
- package/dist/components/templates/AppShell/index.d.ts +5 -7
- package/dist/components/templates/AppShell/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.js +5 -7
- package/dist/components/templates/AppShell/index.js.map +1 -1
- package/dist/components/templates/NotFoundPage/index.cjs +3 -9
- package/dist/components/templates/NotFoundPage/index.cjs.map +1 -1
- package/dist/components/templates/NotFoundPage/index.d.ts +3 -9
- package/dist/components/templates/NotFoundPage/index.d.ts.map +1 -1
- package/dist/components/templates/NotFoundPage/index.js +3 -9
- package/dist/components/templates/NotFoundPage/index.js.map +1 -1
- package/dist/components/templates/PageLayout/index.cjs +5 -12
- package/dist/components/templates/PageLayout/index.cjs.map +1 -1
- package/dist/components/templates/PageLayout/index.d.ts +5 -12
- package/dist/components/templates/PageLayout/index.d.ts.map +1 -1
- package/dist/components/templates/PageLayout/index.js +5 -12
- package/dist/components/templates/PageLayout/index.js.map +1 -1
- package/dist/hooks/__internal__/useAriaDisclosureAttrs/useAriaDisclosureAttrs.cjs +4 -2
- package/dist/hooks/__internal__/useAriaDisclosureAttrs/useAriaDisclosureAttrs.cjs.map +1 -1
- package/dist/hooks/__internal__/useAriaDisclosureAttrs/useAriaDisclosureAttrs.d.ts +3 -2
- package/dist/hooks/__internal__/useAriaDisclosureAttrs/useAriaDisclosureAttrs.d.ts.map +1 -1
- package/dist/hooks/__internal__/useAriaDisclosureAttrs/useAriaDisclosureAttrs.js +4 -2
- package/dist/hooks/__internal__/useAriaDisclosureAttrs/useAriaDisclosureAttrs.js.map +1 -1
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs +1 -2
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs.map +1 -1
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.d.ts +1 -2
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.d.ts.map +1 -1
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.js +1 -2
- package/dist/hooks/__internal__/useHotkeyHint/useHotkeyHint.js.map +1 -1
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.cjs +4 -2
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.cjs.map +1 -1
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.d.ts +4 -2
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.d.ts.map +1 -1
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.js +4 -2
- package/dist/hooks/__internal__/useKeySequences/useKeySequences.js.map +1 -1
- package/dist/hooks/useBreakpoints/index.cjs +5 -5
- package/dist/hooks/useBreakpoints/index.d.ts +5 -5
- package/dist/hooks/useBreakpoints/index.js +5 -5
- package/dist/hooks/useClipboard/index.cjs +5 -2
- package/dist/hooks/useClipboard/index.cjs.map +1 -1
- package/dist/hooks/useClipboard/index.d.ts +5 -2
- package/dist/hooks/useClipboard/index.d.ts.map +1 -1
- package/dist/hooks/useClipboard/index.js +5 -2
- package/dist/hooks/useClipboard/index.js.map +1 -1
- package/dist/hooks/usePlatform/index.cjs +4 -5
- package/dist/hooks/usePlatform/index.cjs.map +1 -1
- package/dist/hooks/usePlatform/index.d.ts +4 -5
- package/dist/hooks/usePlatform/index.d.ts.map +1 -1
- package/dist/hooks/usePlatform/index.js +4 -5
- package/dist/hooks/usePlatform/index.js.map +1 -1
- package/dist/hooks/useResizeObserver/index.cjs +7 -2
- package/dist/hooks/useResizeObserver/index.cjs.map +1 -1
- package/dist/hooks/useResizeObserver/index.d.ts +7 -2
- package/dist/hooks/useResizeObserver/index.d.ts.map +1 -1
- package/dist/hooks/useResizeObserver/index.js +7 -2
- package/dist/hooks/useResizeObserver/index.js.map +1 -1
- package/dist/hooks/useSidePanel/index.cjs +7 -5
- package/dist/hooks/useSidePanel/index.cjs.map +1 -1
- package/dist/hooks/useSidePanel/index.d.ts +7 -5
- package/dist/hooks/useSidePanel/index.d.ts.map +1 -1
- package/dist/hooks/useSidePanel/index.js +7 -5
- package/dist/hooks/useSidePanel/index.js.map +1 -1
- package/dist/native/components/atoms/Avatar/index.d.ts +3 -1
- package/dist/native/components/atoms/Avatar/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Avatar/index.js +1 -1
- package/dist/native/components/atoms/Avatar/index.js.map +1 -1
- package/dist/native/components/atoms/Divider/index.d.ts +1 -1
- package/dist/native/components/atoms/Divider/index.js +1 -1
- package/dist/native/components/atoms/Dot/index.d.ts +1 -0
- package/dist/native/components/atoms/Dot/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Dot/index.js.map +1 -1
- package/dist/native/utilities/__internal__/componentGuardUtils/componentGuard.utils.d.ts +24 -4
- package/dist/native/utilities/__internal__/componentGuardUtils/componentGuard.utils.d.ts.map +1 -1
- package/dist/native/utilities/__internal__/componentGuardUtils/componentGuard.utils.js +24 -4
- package/dist/native/utilities/__internal__/componentGuardUtils/componentGuard.utils.js.map +1 -1
- package/dist/native/utilities/cx/index.d.ts +9 -9
- package/dist/native/utilities/cx/index.d.ts.map +1 -1
- package/dist/native/utilities/cx/index.js +9 -9
- package/dist/native/utilities/cx/index.js.map +1 -1
- package/dist/native/utilities/testIdUtils/index.d.ts +44 -10
- package/dist/native/utilities/testIdUtils/index.d.ts.map +1 -1
- package/dist/native/utilities/testIdUtils/index.js +44 -10
- package/dist/native/utilities/testIdUtils/index.js.map +1 -1
- package/dist/providers/ErrorBoundary/index.cjs +5 -7
- package/dist/providers/ErrorBoundary/index.cjs.map +1 -1
- package/dist/providers/ErrorBoundary/index.d.ts +5 -7
- package/dist/providers/ErrorBoundary/index.d.ts.map +1 -1
- package/dist/providers/ErrorBoundary/index.js +5 -7
- package/dist/providers/ErrorBoundary/index.js.map +1 -1
- package/dist/providers/PortalContainer/index.cjs +1 -1
- package/dist/providers/PortalContainer/index.cjs.map +1 -1
- package/dist/providers/PortalContainer/index.d.ts +2 -1
- package/dist/providers/PortalContainer/index.d.ts.map +1 -1
- package/dist/providers/PortalContainer/index.js +1 -1
- package/dist/providers/PortalContainer/index.js.map +1 -1
- package/dist/providers/RouteProvider/index.cjs +5 -1
- package/dist/providers/RouteProvider/index.cjs.map +1 -1
- package/dist/providers/RouteProvider/index.d.ts +5 -1
- package/dist/providers/RouteProvider/index.d.ts.map +1 -1
- package/dist/providers/RouteProvider/index.js +5 -1
- package/dist/providers/RouteProvider/index.js.map +1 -1
- package/dist/providers/ThemeProvider/index.cjs +11 -1
- package/dist/providers/ThemeProvider/index.cjs.map +1 -1
- package/dist/providers/ThemeProvider/index.d.ts +11 -1
- package/dist/providers/ThemeProvider/index.d.ts.map +1 -1
- package/dist/providers/ThemeProvider/index.js +11 -1
- package/dist/providers/ThemeProvider/index.js.map +1 -1
- package/dist/providers/UIProvider/index.cjs +5 -1
- package/dist/providers/UIProvider/index.cjs.map +1 -1
- package/dist/providers/UIProvider/index.d.ts +5 -1
- package/dist/providers/UIProvider/index.d.ts.map +1 -1
- package/dist/providers/UIProvider/index.js +5 -1
- package/dist/providers/UIProvider/index.js.map +1 -1
- package/dist/utilities/__internal__/childrenUtils/children.utils.cjs +4 -0
- package/dist/utilities/__internal__/childrenUtils/children.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/childrenUtils/children.utils.d.ts +4 -0
- package/dist/utilities/__internal__/childrenUtils/children.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/childrenUtils/children.utils.js +4 -0
- package/dist/utilities/__internal__/childrenUtils/children.utils.js.map +1 -1
- package/dist/utilities/__internal__/componentGuardUtils/componentGuard.utils.cjs +24 -4
- package/dist/utilities/__internal__/componentGuardUtils/componentGuard.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/componentGuardUtils/componentGuard.utils.d.ts +24 -4
- package/dist/utilities/__internal__/componentGuardUtils/componentGuard.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/componentGuardUtils/componentGuard.utils.js +24 -4
- package/dist/utilities/__internal__/componentGuardUtils/componentGuard.utils.js.map +1 -1
- package/dist/utilities/__internal__/focusUtils/focus.utils.cjs +5 -1
- package/dist/utilities/__internal__/focusUtils/focus.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/focusUtils/focus.utils.d.ts +5 -1
- package/dist/utilities/__internal__/focusUtils/focus.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/focusUtils/focus.utils.js +5 -1
- package/dist/utilities/__internal__/focusUtils/focus.utils.js.map +1 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs +65 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.d.ts +65 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.js +65 -1
- package/dist/utilities/__internal__/hotkeysUtils/hotkeys.utils.js.map +1 -1
- package/dist/utilities/__internal__/logUtils/log.utils.cjs +3 -0
- package/dist/utilities/__internal__/logUtils/log.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/logUtils/log.utils.d.ts +3 -0
- package/dist/utilities/__internal__/logUtils/log.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/logUtils/log.utils.js +3 -0
- package/dist/utilities/__internal__/logUtils/log.utils.js.map +1 -1
- package/dist/utilities/__internal__/platformUtils/platform.utils.cjs +8 -1
- package/dist/utilities/__internal__/platformUtils/platform.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/platformUtils/platform.utils.d.ts +8 -1
- package/dist/utilities/__internal__/platformUtils/platform.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/platformUtils/platform.utils.js +8 -1
- package/dist/utilities/__internal__/platformUtils/platform.utils.js.map +1 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs +24 -3
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts +24 -3
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js +24 -3
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js.map +1 -1
- package/dist/utilities/cssScopeUtils/index.cjs +6 -5
- package/dist/utilities/cssScopeUtils/index.cjs.map +1 -1
- package/dist/utilities/cssScopeUtils/index.d.ts +6 -5
- package/dist/utilities/cssScopeUtils/index.d.ts.map +1 -1
- package/dist/utilities/cssScopeUtils/index.js +6 -5
- package/dist/utilities/cssScopeUtils/index.js.map +1 -1
- package/dist/utilities/cx/index.cjs +9 -9
- package/dist/utilities/cx/index.cjs.map +1 -1
- package/dist/utilities/cx/index.d.ts +9 -9
- package/dist/utilities/cx/index.d.ts.map +1 -1
- package/dist/utilities/cx/index.js +9 -9
- package/dist/utilities/cx/index.js.map +1 -1
- package/dist/utilities/hrefUtils/index.cjs +10 -11
- package/dist/utilities/hrefUtils/index.cjs.map +1 -1
- package/dist/utilities/hrefUtils/index.d.ts +10 -11
- package/dist/utilities/hrefUtils/index.d.ts.map +1 -1
- package/dist/utilities/hrefUtils/index.js +10 -11
- package/dist/utilities/hrefUtils/index.js.map +1 -1
- package/dist/utilities/localStorageUtils/index.cjs +8 -5
- package/dist/utilities/localStorageUtils/index.cjs.map +1 -1
- package/dist/utilities/localStorageUtils/index.d.ts +8 -5
- package/dist/utilities/localStorageUtils/index.d.ts.map +1 -1
- package/dist/utilities/localStorageUtils/index.js +8 -5
- package/dist/utilities/localStorageUtils/index.js.map +1 -1
- package/dist/utilities/renderUtils/importWithRetry.utils.cjs +3 -0
- package/dist/utilities/renderUtils/importWithRetry.utils.cjs.map +1 -1
- package/dist/utilities/renderUtils/importWithRetry.utils.d.ts +3 -0
- package/dist/utilities/renderUtils/importWithRetry.utils.d.ts.map +1 -1
- package/dist/utilities/renderUtils/importWithRetry.utils.js +3 -0
- package/dist/utilities/renderUtils/importWithRetry.utils.js.map +1 -1
- package/dist/utilities/renderUtils/index.cjs +31 -30
- package/dist/utilities/renderUtils/index.cjs.map +1 -1
- package/dist/utilities/renderUtils/index.d.ts +31 -30
- package/dist/utilities/renderUtils/index.d.ts.map +1 -1
- package/dist/utilities/renderUtils/index.js +31 -30
- package/dist/utilities/renderUtils/index.js.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.cjs +8 -5
- package/dist/utilities/sessionStorageUtils/index.cjs.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.d.ts +8 -5
- package/dist/utilities/sessionStorageUtils/index.d.ts.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.js +8 -5
- package/dist/utilities/sessionStorageUtils/index.js.map +1 -1
- package/dist/utilities/testIdUtils/index.cjs +44 -10
- package/dist/utilities/testIdUtils/index.cjs.map +1 -1
- package/dist/utilities/testIdUtils/index.d.ts +44 -10
- package/dist/utilities/testIdUtils/index.d.ts.map +1 -1
- package/dist/utilities/testIdUtils/index.js +44 -10
- package/dist/utilities/testIdUtils/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,6 +4,12 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
|
|
6
6
|
const ThemeContext = React.createContext(undefined);
|
|
7
|
+
/**
|
|
8
|
+
* Reads the current theme and its setter from the nearest `ThemeProvider`.
|
|
9
|
+
*
|
|
10
|
+
* @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
|
|
11
|
+
* element carrying `data-theme`.
|
|
12
|
+
*/
|
|
7
13
|
const useTheme = () => {
|
|
8
14
|
const context = React.useContext(ThemeContext);
|
|
9
15
|
if (context === undefined) {
|
|
@@ -17,7 +23,11 @@ const resolveSystemPreference = () => {
|
|
|
17
23
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
18
24
|
};
|
|
19
25
|
/**
|
|
20
|
-
*
|
|
26
|
+
* Provides light/dark/system theme context, persisted to `localStorage` and following the OS
|
|
27
|
+
* when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
|
|
28
|
+
* and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
|
|
29
|
+
*
|
|
30
|
+
* @summary light/dark/system theme provider carrying data-theme
|
|
21
31
|
*/
|
|
22
32
|
const ThemeProvider = ({ children, defaultTheme = 'system', storageKey = 'ui-theme', themeModeOverride }) => {
|
|
23
33
|
const [theme, setTheme] = React.useState(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["createContext","useContext","useState","useEffect","useMemo","_jsx"],"mappings":";;;;;AAcA,MAAM,YAAY,GAAGA,mBAAa,CAA+B,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["createContext","useContext","useState","useEffect","useMemo","_jsx"],"mappings":";;;;;AAcA,MAAM,YAAY,GAAGA,mBAAa,CAA+B,SAAS,CAAC;AAE3E;;;;;AAKG;AACI,MAAM,QAAQ,GAAG,MAAuB;AAC7C,IAAA,MAAM,OAAO,GAAGC,gBAAU,CAAC,YAAY,CAAC;AAExC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;IACjE;AAEA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,uBAAuB,GAAG,MAAuB;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW;AA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AAC,UAAU,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AACrF,QAAA,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC;QACnD,OAAO,MAAM,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;IACrE,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAE9D,IAAA,MAAM,YAAY,GAAGC,aAAO,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAEvI,IAAA,QACEC,cAAA,CAAC,YAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,QAAA,EACxCA,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,YAAY,EAAA,YAAA,EAAc,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAC7E,QAAQ,EAAA,CACL,EAAA,CACgB;AAE5B;;;"}
|
|
@@ -6,6 +6,12 @@ interface ThemeContextType {
|
|
|
6
6
|
themeRoot: HTMLElement | null;
|
|
7
7
|
resolvedMode: 'light' | 'dark';
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Reads the current theme and its setter from the nearest `ThemeProvider`.
|
|
11
|
+
*
|
|
12
|
+
* @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
|
|
13
|
+
* element carrying `data-theme`.
|
|
14
|
+
*/
|
|
9
15
|
export declare const useTheme: () => ThemeContextType;
|
|
10
16
|
interface ThemeProviderProps {
|
|
11
17
|
children: ReactNode;
|
|
@@ -26,7 +32,11 @@ interface ThemeProviderProps {
|
|
|
26
32
|
themeModeOverride?: 'light' | 'dark';
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
29
|
-
*
|
|
35
|
+
* Provides light/dark/system theme context, persisted to `localStorage` and following the OS
|
|
36
|
+
* when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
|
|
37
|
+
* and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
|
|
38
|
+
*
|
|
39
|
+
* @summary light/dark/system theme provider carrying data-theme
|
|
30
40
|
*/
|
|
31
41
|
export declare const ThemeProvider: ({ children, defaultTheme, storageKey, themeModeOverride }: ThemeProviderProps) => import("react").JSX.Element;
|
|
32
42
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzC,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC;AAID,eAAO,MAAM,QAAQ,QAAO,gBAQ3B,CAAC;AAOF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACtC;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzC,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC;AAID;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,QAAO,gBAQ3B,CAAC;AAOF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACtC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,2DAAmF,kBAAkB,gCA0ClI,CAAC"}
|
|
@@ -2,6 +2,12 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { createContext, useState, useEffect, useMemo, useContext } from 'react';
|
|
3
3
|
|
|
4
4
|
const ThemeContext = createContext(undefined);
|
|
5
|
+
/**
|
|
6
|
+
* Reads the current theme and its setter from the nearest `ThemeProvider`.
|
|
7
|
+
*
|
|
8
|
+
* @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
|
|
9
|
+
* element carrying `data-theme`.
|
|
10
|
+
*/
|
|
5
11
|
const useTheme = () => {
|
|
6
12
|
const context = useContext(ThemeContext);
|
|
7
13
|
if (context === undefined) {
|
|
@@ -15,7 +21,11 @@ const resolveSystemPreference = () => {
|
|
|
15
21
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
16
22
|
};
|
|
17
23
|
/**
|
|
18
|
-
*
|
|
24
|
+
* Provides light/dark/system theme context, persisted to `localStorage` and following the OS
|
|
25
|
+
* when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
|
|
26
|
+
* and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
|
|
27
|
+
*
|
|
28
|
+
* @summary light/dark/system theme provider carrying data-theme
|
|
19
29
|
*/
|
|
20
30
|
const ThemeProvider = ({ children, defaultTheme = 'system', storageKey = 'ui-theme', themeModeOverride }) => {
|
|
21
31
|
const [theme, setTheme] = useState(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;AAcA,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;AAcA,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC;AAE3E;;;;;AAKG;AACI,MAAM,QAAQ,GAAG,MAAuB;AAC7C,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC;AAExC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;IACjE;AAEA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,uBAAuB,GAAG,MAAuB;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,OAAO;AACjD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO;AACrF,CAAC;AAqBD;;;;;;AAMG;AACI,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,GAAG,QAAQ,EAAE,UAAU,GAAG,UAAU,EAAE,iBAAiB,EAAsB,KAAI;IACrI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAQ,MAAK;AAC7C,QAAA,IAAI,OAAO,MAAM,KAAK,W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EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAEvI,IAAA,QACEA,GAAA,CAAC,YAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,QAAA,EACxCA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,YAAY,EAAA,YAAA,EAAc,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAC7E,QAAQ,EAAA,CACL,EAAA,CACgB;AAE5B;;"}
|
|
@@ -71,7 +71,11 @@ const UIProviderInner = ({ children, baseUrl, errorBoundary, portalContainer })
|
|
|
71
71
|
return (jsxRuntime.jsx(reactRouter.BrowserRouter, { basename: baseUrl, children: jsxRuntime.jsx(RouteProvider.RouteProvider, { children: jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { ...errorBoundary, children: jsxRuntime.jsx(PortalContainer.PortalContainer, { getContainer: getContainer, children: children }) }) }) }));
|
|
72
72
|
};
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
|
|
75
|
+
* and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
|
|
76
|
+
* only when overlays must land in a specific container.
|
|
77
|
+
*
|
|
78
|
+
* @summary root provider composing theme, routing, errors and portals
|
|
75
79
|
*/
|
|
76
80
|
const UIProvider = ({ children, themeModeOverride, ...rest }) => {
|
|
77
81
|
// TODO(i18n): add an internal library translation context so ui-library components can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["useTheme","useState","useRef","useLayoutEffect","useCallback","_jsx","BrowserRouter","RouteProvider","ErrorBoundary","PortalContainer","ThemeProvider"],"mappings":";;;;;;;;;;AA2CA,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE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;QACnB,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC;AACpE,IAAA,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;;;;;;;AAQlB,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAAC,MAAK;AACpC,QAAA,MAAM,QAAQ,GAAG,eAAe,IAAI,IAAI,IAAI;QAC5C,IAAI,QAAQ,EAAE;AACZ,YAAA,OAAO,QAAQ,KAAK,qBAAqB,CAAC,OAAO,GAAG,YAAY,GAAG,IAAI;QACzE;QACA,IAAI,eAAe,EAAE;AACnB,YAAA,OAAO,IAAI;QACb;AACA,QAAA,OAAO,SAAS;IAClB,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;AAE9C,IAAA,QACEC,cAAA,CAACC,yBAAa,EAAA,EAAC,QAAQ,EAAE,OAAO,EAAA,QAAA,EAC9BD,cAAA,CAACE,2BAAa,EAAA,EAAA,QAAA,EACZF,cAAA,CAACG,2BAAa,EAAA,EAAA,GAAK,aAAa,EAAA,QAAA,EAC9BH,cAAA,CAACI,+BAAe,EAAA,EAAC,YAAY,EAAE,YAAY,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CAC3D,EAAA,CACF,EAAA,CACF;AAEpB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["useTheme","useState","useRef","useLayoutEffect","useCallback","_jsx","BrowserRouter","RouteProvider","ErrorBoundary","PortalContainer","ThemeProvider"],"mappings":";;;;;;;;;;AA2CA,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAiE,KAAI;IAC/I,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAGA,sBAAQ,EAAE;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGC,cAAQ,CAAqB,IAAI,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C,MAAK;AACpC,QAAA,MAAM,QAAQ,GAAG,eAAe,IAAI,IAAI,IAAI;QAC5C,IAAI,QAAQ,EAAE;AACZ,YAAA,OAAO,QAAQ,KAAK,qBAAqB,CAAC,OAAO,GAAG,YAAY,GAAG,IAAI;QACzE;QACA,IAAI,eAAe,EAAE;AACnB,YAAA,OAAO,IAAI;QACb;AACA,QAAA,OAAO,SAAS;IAClB,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;AAE9C,IAAA,QACEC,cAAA,CAACC,yBAAa,EAAA,EAAC,QAAQ,EAAE,OAAO,EAAA,QAAA,EAC9BD,cAAA,CAACE,2BAAa,EAAA,EAAA,QAAA,EACZF,cAAA,CAACG,2BAAa,EAAA,EAAA,GAAK,aAAa,EAAA,QAAA,EAC9BH,cAAA,CAACI,+BAAe,EAAA,EAAC,YAAY,EAAE,YAAY,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CAC3D,EAAA,CACF,EAAA,CACF;AAEpB,CAAC;AAED;;;;;;AAMG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAsC,KAAI;;;;;AAKzG,IAAA,QACEJ,cAAA,CAACK,2BAAa,EAAA,EAAC,iBAAiB,EAAE,iBAAiB,EAAA,QAAA,EACjDL,cAAA,CAAC,eAAe,OAAK,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CACzC;AAEpB;;"}
|
|
@@ -34,7 +34,11 @@ export interface UIProviderProps {
|
|
|
34
34
|
portalContainer?: (() => HTMLElement | null) | null;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
|
|
38
|
+
* and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
|
|
39
|
+
* only when overlays must land in a specific container.
|
|
40
|
+
*
|
|
41
|
+
* @summary root provider composing theme, routing, errors and portals
|
|
38
42
|
*/
|
|
39
43
|
export declare const UIProvider: ({ children, themeModeOverride, ...rest }: PropsWithChildren<UIProviderProps>) => import("react").JSX.Element;
|
|
40
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UIProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAItG,OAAO,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACpD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CACrD;AAoFD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UIProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAItG,OAAO,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACpD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CACrD;AAoFD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,0CAA0C,iBAAiB,CAAC,eAAe,CAAC,gCAUtG,CAAC"}
|
|
@@ -69,7 +69,11 @@ const UIProviderInner = ({ children, baseUrl, errorBoundary, portalContainer })
|
|
|
69
69
|
return (jsx(BrowserRouter, { basename: baseUrl, children: jsx(RouteProvider, { children: jsx(ErrorBoundary, { ...errorBoundary, children: jsx(PortalContainer, { getContainer: getContainer, children: children }) }) }) }));
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
|
|
73
|
+
* and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
|
|
74
|
+
* only when overlays must land in a specific container.
|
|
75
|
+
*
|
|
76
|
+
* @summary root provider composing theme, routing, errors and portals
|
|
73
77
|
*/
|
|
74
78
|
const UIProvider = ({ children, themeModeOverride, ...rest }) => {
|
|
75
79
|
// TODO(i18n): add an internal library translation context so ui-library components can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;;AA2CA,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAiE,KAAI;IAC/I,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC;AAC1E,IAAA,MAAM,gBAAgB,GAAG,MAAM,CAAqB,IAAI,CAAC;AACzD,IAAA,MAAM,qBAAqB,GAAG,MAAM,CAAqB,IAAI,CAAC;;;;;;;;IAS9D,eAAe,CAAC,MAAK;AACnB,QAAA,MAAM,QAAQ,GAAG,eAAe,IAAI,IAAI,IAAI;A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AC9BA,GAAA,CAAC,eAAe,EAAA,EAAC,YAAY,EAAE,YAAY,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CAC3D,EAAA,CACF,EAAA,CACF;AAEpB,CAAC;AAED;;;;;;AAMG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAsC,KAAI;;;;;AAKzG,IAAA,QACEA,GAAA,CAAC,aAAa,EAAA,EAAC,iBAAiB,EAAE,iBAAiB,EAAA,QAAA,EACjDA,GAAA,CAAC,eAAe,OAAK,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CACzC;AAEpB;;"}
|
|
@@ -10,6 +10,10 @@ var React = require('react');
|
|
|
10
10
|
* Unwrapped items are re-keyed with the JSON-encoded path of Fragment keys above them, so
|
|
11
11
|
* siblings stay unique after flattening. Plain concatenation is ambiguous: Fragment `a` +
|
|
12
12
|
* child `b` and a sibling keyed `a.$b` would both produce `.$a.$b`.
|
|
13
|
+
*
|
|
14
|
+
* @param children The children to flatten, as received by a component.
|
|
15
|
+
* @param keyPath The Fragment keys above `children`; callers leave it empty and the recursion fills it.
|
|
16
|
+
* @returns The children as a flat array with every Fragment unwrapped and keys unique.
|
|
13
17
|
*/
|
|
14
18
|
const flattenChildren = (children, keyPath = []) => React.Children.toArray(children).flatMap((child) => {
|
|
15
19
|
if (React.isValidElement(child) && child.type === React.Fragment) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children.utils.cjs","sources":["../../../../src/utilities/__internal__/childrenUtils/children.utils.ts"],"sourcesContent":[null],"names":["Children","isValidElement","Fragment","cloneElement"],"mappings":";;;;AAEA
|
|
1
|
+
{"version":3,"file":"children.utils.cjs","sources":["../../../../src/utilities/__internal__/childrenUtils/children.utils.ts"],"sourcesContent":[null],"names":["Children","isValidElement","Fragment","cloneElement"],"mappings":";;;;AAEA;;;;;;;;;;;;AAYG;AACI,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAE,OAAA,GAA6B,EAAE,KAClFA,cAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;IAC3C,IAAIC,oBAAc,CAA2B,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAKC,cAAQ,EAAE;QAC9E,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IACrF;AACA,IAAA,OAAO,OAAO,CAAC,MAAM,IAAID,oBAAc,CAAC,KAAK,CAAC,GAAGE,kBAAY,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK;AAC9I,CAAC;;"}
|
|
@@ -7,6 +7,10 @@ import { type ReactNode } from 'react';
|
|
|
7
7
|
* Unwrapped items are re-keyed with the JSON-encoded path of Fragment keys above them, so
|
|
8
8
|
* siblings stay unique after flattening. Plain concatenation is ambiguous: Fragment `a` +
|
|
9
9
|
* child `b` and a sibling keyed `a.$b` would both produce `.$a.$b`.
|
|
10
|
+
*
|
|
11
|
+
* @param children The children to flatten, as received by a component.
|
|
12
|
+
* @param keyPath The Fragment keys above `children`; callers leave it empty and the recursion fills it.
|
|
13
|
+
* @returns The children as a flat array with every Fragment unwrapped and keys unique.
|
|
10
14
|
*/
|
|
11
15
|
export declare const flattenChildren: (children: ReactNode, keyPath?: readonly string[]) => ReactNode[];
|
|
12
16
|
//# sourceMappingURL=children.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/childrenUtils/children.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF
|
|
1
|
+
{"version":3,"file":"children.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/childrenUtils/children.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,SAAS,EAAE,UAAS,SAAS,MAAM,EAAO,KAAG,SAAS,EAM5F,CAAC"}
|
|
@@ -8,6 +8,10 @@ import { Children, isValidElement, Fragment, cloneElement } from 'react';
|
|
|
8
8
|
* Unwrapped items are re-keyed with the JSON-encoded path of Fragment keys above them, so
|
|
9
9
|
* siblings stay unique after flattening. Plain concatenation is ambiguous: Fragment `a` +
|
|
10
10
|
* child `b` and a sibling keyed `a.$b` would both produce `.$a.$b`.
|
|
11
|
+
*
|
|
12
|
+
* @param children The children to flatten, as received by a component.
|
|
13
|
+
* @param keyPath The Fragment keys above `children`; callers leave it empty and the recursion fills it.
|
|
14
|
+
* @returns The children as a flat array with every Fragment unwrapped and keys unique.
|
|
11
15
|
*/
|
|
12
16
|
const flattenChildren = (children, keyPath = []) => Children.toArray(children).flatMap((child) => {
|
|
13
17
|
if (isValidElement(child) && child.type === Fragment) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children.utils.js","sources":["../../../../src/utilities/__internal__/childrenUtils/children.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA
|
|
1
|
+
{"version":3,"file":"children.utils.js","sources":["../../../../src/utilities/__internal__/childrenUtils/children.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;AAYG;AACI,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAE,OAAA,GAA6B,EAAE,KAClF,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;IAC3C,IAAI,cAAc,CAA2B,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC9E,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IACrF;AACA,IAAA,OAAO,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK;AAC9I,CAAC;;"}
|
|
@@ -12,22 +12,42 @@
|
|
|
12
12
|
* (NativeWind). INTERNAL: imported by components as
|
|
13
13
|
* `#internal/utilities/componentGuardUtils/componentGuard.utils`.
|
|
14
14
|
*/
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Checks if a given value is a function component.
|
|
17
|
+
*
|
|
18
|
+
* @param component The value passed where a component or an element is accepted.
|
|
19
|
+
* @returns `true` for any function, which includes class components.
|
|
20
|
+
*/
|
|
16
21
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
17
22
|
const isFunctionComponent = (component) => {
|
|
18
23
|
return typeof component === 'function';
|
|
19
24
|
};
|
|
20
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Checks if a given value is a class component.
|
|
27
|
+
*
|
|
28
|
+
* @param component The value passed where a component or an element is accepted.
|
|
29
|
+
* @returns `true` when its prototype marks it as a React class component or it defines `render`.
|
|
30
|
+
*/
|
|
21
31
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
22
32
|
const isClassComponent = (component) => {
|
|
23
33
|
return typeof component === 'function' && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
|
|
24
34
|
};
|
|
25
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Checks if a given value is a forward ref component.
|
|
37
|
+
*
|
|
38
|
+
* @param component The value passed where a component or an element is accepted.
|
|
39
|
+
* @returns `true` for an object created by `forwardRef`.
|
|
40
|
+
*/
|
|
26
41
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
27
42
|
const isForwardRefComponent = (component) => {
|
|
28
43
|
return typeof component === 'object' && component !== null && component.$$typeof?.toString() === 'Symbol(react.forward_ref)';
|
|
29
44
|
};
|
|
30
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Checks if a given value is a valid React component (FC, class, or forwardRef).
|
|
47
|
+
*
|
|
48
|
+
* @param component The value passed where a component or an element is accepted.
|
|
49
|
+
* @returns `true` when it should be rendered as `<Component />` rather than used as an element.
|
|
50
|
+
*/
|
|
31
51
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
32
52
|
const isReactComponent = (component) => {
|
|
33
53
|
return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentGuard.utils.cjs","sources":["../../../../src/utilities/__internal__/componentGuardUtils/componentGuard.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAMA;;;;;;;;;;;AAWG;AAEH;
|
|
1
|
+
{"version":3,"file":"componentGuard.utils.cjs","sources":["../../../../src/utilities/__internal__/componentGuardUtils/componentGuard.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAMA;;;;;;;;;;;AAWG;AAEH;;;;;AAKG;AACH;AACO,MAAM,mBAAmB,GAAG,CAAC,SAAc,KAAgC;AAChF,IAAA,OAAO,OAAO,SAAS,KAAK,UAAU;AACxC;AAEA;;;;;AAKG;AACH;AACO,MAAM,gBAAgB,GAAG,CAAC,SAAc,KAAiD;IAC9F,OAAO,OAAO,SAAS,KAAK,UAAU,IAAI,SAAS,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,gBAAgB,IAAI,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;AAC3I;AAEA;;;;;AAKG;AACH;AACO,MAAM,qBAAqB,GAAG,CAAC,SAAc,KAAuD;AACzG,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,2BAA2B;AAC9H;AAEA;;;;;AAKG;AACH;AACO,MAAM,gBAAgB,GAAG,CAAC,SAAc,KAAiC;AAC9E,IAAA,OAAO,mBAAmB,CAAC,SAAS,CAAC,IAAI,qBAAqB,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,SAAS,CAAC;AAC1G;;;;;"}
|
|
@@ -12,13 +12,33 @@ type ReactComponent = React.FC<any> | React.ComponentClass<any, any> | React.For
|
|
|
12
12
|
* (NativeWind). INTERNAL: imported by components as
|
|
13
13
|
* `#internal/utilities/componentGuardUtils/componentGuard.utils`.
|
|
14
14
|
*/
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Checks if a given value is a function component.
|
|
17
|
+
*
|
|
18
|
+
* @param component The value passed where a component or an element is accepted.
|
|
19
|
+
* @returns `true` for any function, which includes class components.
|
|
20
|
+
*/
|
|
16
21
|
export declare const isFunctionComponent: (component: any) => component is React.FC<any>;
|
|
17
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Checks if a given value is a class component.
|
|
24
|
+
*
|
|
25
|
+
* @param component The value passed where a component or an element is accepted.
|
|
26
|
+
* @returns `true` when its prototype marks it as a React class component or it defines `render`.
|
|
27
|
+
*/
|
|
18
28
|
export declare const isClassComponent: (component: any) => component is React.ComponentClass<any, any>;
|
|
19
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Checks if a given value is a forward ref component.
|
|
31
|
+
*
|
|
32
|
+
* @param component The value passed where a component or an element is accepted.
|
|
33
|
+
* @returns `true` for an object created by `forwardRef`.
|
|
34
|
+
*/
|
|
20
35
|
export declare const isForwardRefComponent: (component: any) => component is React.ForwardRefExoticComponent<any>;
|
|
21
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Checks if a given value is a valid React component (FC, class, or forwardRef).
|
|
38
|
+
*
|
|
39
|
+
* @param component The value passed where a component or an element is accepted.
|
|
40
|
+
* @returns `true` when it should be rendered as `<Component />` rather than used as an element.
|
|
41
|
+
*/
|
|
22
42
|
export declare const isReactComponent: (component: any) => component is ReactComponent;
|
|
23
43
|
export {};
|
|
24
44
|
//# sourceMappingURL=componentGuard.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentGuard.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/componentGuardUtils/componentGuard.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,cAAc,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;AAE5G;;;;;;;;;;;GAWG;AAEH
|
|
1
|
+
{"version":3,"file":"componentGuard.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/componentGuardUtils/componentGuard.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,cAAc,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;AAE5G;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AAEH,eAAO,MAAM,mBAAmB,GAAI,WAAW,GAAG,KAAG,SAAS,IAAI,KAAK,CAAC,EAAE,CAAC,GAAG,CAE7E,CAAC;AAEF;;;;;GAKG;AAEH,eAAO,MAAM,gBAAgB,GAAI,WAAW,GAAG,KAAG,SAAS,IAAI,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAE3F,CAAC;AAEF;;;;;GAKG;AAEH,eAAO,MAAM,qBAAqB,GAAI,WAAW,GAAG,KAAG,SAAS,IAAI,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAEtG,CAAC;AAEF;;;;;GAKG;AAEH,eAAO,MAAM,gBAAgB,GAAI,WAAW,GAAG,KAAG,SAAS,IAAI,cAE9D,CAAC"}
|
|
@@ -10,22 +10,42 @@
|
|
|
10
10
|
* (NativeWind). INTERNAL: imported by components as
|
|
11
11
|
* `#internal/utilities/componentGuardUtils/componentGuard.utils`.
|
|
12
12
|
*/
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Checks if a given value is a function component.
|
|
15
|
+
*
|
|
16
|
+
* @param component The value passed where a component or an element is accepted.
|
|
17
|
+
* @returns `true` for any function, which includes class components.
|
|
18
|
+
*/
|
|
14
19
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
15
20
|
const isFunctionComponent = (component) => {
|
|
16
21
|
return typeof component === 'function';
|
|
17
22
|
};
|
|
18
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Checks if a given value is a class component.
|
|
25
|
+
*
|
|
26
|
+
* @param component The value passed where a component or an element is accepted.
|
|
27
|
+
* @returns `true` when its prototype marks it as a React class component or it defines `render`.
|
|
28
|
+
*/
|
|
19
29
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
20
30
|
const isClassComponent = (component) => {
|
|
21
31
|
return typeof component === 'function' && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
|
|
22
32
|
};
|
|
23
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Checks if a given value is a forward ref component.
|
|
35
|
+
*
|
|
36
|
+
* @param component The value passed where a component or an element is accepted.
|
|
37
|
+
* @returns `true` for an object created by `forwardRef`.
|
|
38
|
+
*/
|
|
24
39
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
25
40
|
const isForwardRefComponent = (component) => {
|
|
26
41
|
return typeof component === 'object' && component !== null && component.$$typeof?.toString() === 'Symbol(react.forward_ref)';
|
|
27
42
|
};
|
|
28
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Checks if a given value is a valid React component (FC, class, or forwardRef).
|
|
45
|
+
*
|
|
46
|
+
* @param component The value passed where a component or an element is accepted.
|
|
47
|
+
* @returns `true` when it should be rendered as `<Component />` rather than used as an element.
|
|
48
|
+
*/
|
|
29
49
|
// biome-ignore lint/suspicious/noExplicitAny: required for React component type guard
|
|
30
50
|
const isReactComponent = (component) => {
|
|
31
51
|
return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentGuard.utils.js","sources":["../../../../src/utilities/__internal__/componentGuardUtils/componentGuard.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAMA;;;;;;;;;;;AAWG;AAEH;
|
|
1
|
+
{"version":3,"file":"componentGuard.utils.js","sources":["../../../../src/utilities/__internal__/componentGuardUtils/componentGuard.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAMA;;;;;;;;;;;AAWG;AAEH;;;;;AAKG;AACH;AACO,MAAM,mBAAmB,GAAG,CAAC,SAAc,KAAgC;AAChF,IAAA,OAAO,OAAO,SAAS,KAAK,UAAU;AACxC;AAEA;;;;;AAKG;AACH;AACO,MAAM,gBAAgB,GAAG,CAAC,SAAc,KAAiD;IAC9F,OAAO,OAAO,SAAS,KAAK,UAAU,IAAI,SAAS,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,gBAAgB,IAAI,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;AAC3I;AAEA;;;;;AAKG;AACH;AACO,MAAM,qBAAqB,GAAG,CAAC,SAAc,KAAuD;AACzG,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,2BAA2B;AAC9H;AAEA;;;;;AAKG;AACH;AACO,MAAM,gBAAgB,GAAG,CAAC,SAAc,KAAiC;AAC9E,IAAA,OAAO,mBAAmB,CAAC,SAAS,CAAC,IAAI,qBAAqB,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,SAAS,CAAC;AAC1G;;"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The element that has keyboard focus.
|
|
5
|
+
*
|
|
6
|
+
* @returns The focused element, or `null` on the server and when focus rests on the page itself.
|
|
7
|
+
*/
|
|
4
8
|
const getFocusedElement = () => {
|
|
5
9
|
if (typeof document === 'undefined')
|
|
6
10
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.utils.cjs","sources":["../../../../src/utilities/__internal__/focusUtils/focus.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;
|
|
1
|
+
{"version":3,"file":"focus.utils.cjs","sources":["../../../../src/utilities/__internal__/focusUtils/focus.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,MAAyB;IACxD,IAAI,OAAO,QAAQ,KAAK,WAAW;AAAE,QAAA,OAAO,IAAI;AAChD,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ;AAElC,IAAA,OAAO,aAAa,YAAY,WAAW,IAAI,aAAa,KAAK,QAAQ,CAAC,IAAI,GAAG,aAAa,GAAG,IAAI;AACvG;;"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* The element that has keyboard focus.
|
|
3
|
+
*
|
|
4
|
+
* @returns The focused element, or `null` on the server and when focus rests on the page itself.
|
|
5
|
+
*/
|
|
2
6
|
export declare const getFocusedElement: () => HTMLElement | null;
|
|
3
7
|
//# sourceMappingURL=focus.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/focusUtils/focus.utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"focus.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/focusUtils/focus.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAO,WAAW,GAAG,IAKlD,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* The element that has keyboard focus.
|
|
3
|
+
*
|
|
4
|
+
* @returns The focused element, or `null` on the server and when focus rests on the page itself.
|
|
5
|
+
*/
|
|
2
6
|
const getFocusedElement = () => {
|
|
3
7
|
if (typeof document === 'undefined')
|
|
4
8
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.utils.js","sources":["../../../../src/utilities/__internal__/focusUtils/focus.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"file":"focus.utils.js","sources":["../../../../src/utilities/__internal__/focusUtils/focus.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,MAAyB;IACxD,IAAI,OAAO,QAAQ,KAAK,WAAW;AAAE,QAAA,OAAO,IAAI;AAChD,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ;AAElC,IAAA,OAAO,aAAa,YAAY,WAAW,IAAI,aAAa,KAAK,QAAQ,CAAC,IAAI,GAAG,aAAa,GAAG,IAAI;AACvG;;"}
|
|
@@ -30,15 +30,44 @@ const mappedKeys = {
|
|
|
30
30
|
ControlLeft: 'ctrl',
|
|
31
31
|
ControlRight: 'ctrl',
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Maps a key name or `KeyboardEvent.code` to the lowercase name the parser matches on (`esc` is `escape`, `KeyK` is `k`).
|
|
35
|
+
*
|
|
36
|
+
* @param key A key name from a hotkey string or a physical key code; surrounding spaces are ignored.
|
|
37
|
+
* @returns The canonical lowercase key name.
|
|
38
|
+
*/
|
|
33
39
|
function mapCode(key) {
|
|
34
40
|
return (mappedKeys[key.trim()] || key.trim()).toLowerCase().replace(/key|digit|numpad/, '');
|
|
35
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Reports whether a parsed key is a modifier rather than a key of its own.
|
|
44
|
+
*
|
|
45
|
+
* @param key A lowercase key name as produced by `mapCode`.
|
|
46
|
+
* @returns `true` for `shift`, `alt`, `meta`, `mod`, `ctrl` and `control`.
|
|
47
|
+
*/
|
|
36
48
|
function isHotkeyModifier(key) {
|
|
37
49
|
return reservedModifierKeywords.includes(key);
|
|
38
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Splits a hook input into its alternative hotkeys (`mod+k,ctrl+k`).
|
|
53
|
+
*
|
|
54
|
+
* @param keys The hotkey string passed to `react-hotkeys-hook`.
|
|
55
|
+
* @param delimiter The character that separates alternatives.
|
|
56
|
+
* @returns Each alternative, lowercased.
|
|
57
|
+
*/
|
|
39
58
|
function parseKeysHookInput(keys, delimiter = ',') {
|
|
40
59
|
return keys.toLowerCase().split(delimiter);
|
|
41
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Parses one hotkey into its modifier flags and keys, as `react-hotkeys-hook` does before matching.
|
|
63
|
+
*
|
|
64
|
+
* @param hotkey A single alternative, either a combination (`mod+k`) or a sequence (`g>p`).
|
|
65
|
+
* @param splitKey The character joining the keys of a combination.
|
|
66
|
+
* @param sequenceSplitKey The character separating the steps of a sequence; its presence makes the hotkey a sequence.
|
|
67
|
+
* @param useKey Whether matching uses the produced character rather than the physical key; carried through unchanged.
|
|
68
|
+
* @param description Text describing the hotkey; carried through unchanged.
|
|
69
|
+
* @returns The modifier flags, the non-modifier keys, and whether the hotkey is a sequence.
|
|
70
|
+
*/
|
|
42
71
|
function parseHotkey(hotkey, splitKey = '+', sequenceSplitKey = '>', useKey = false, description) {
|
|
43
72
|
let keys = [];
|
|
44
73
|
let isSequence = false;
|
|
@@ -115,7 +144,12 @@ const SHIFTED_KEYS = {
|
|
|
115
144
|
'(': '9',
|
|
116
145
|
')': '0',
|
|
117
146
|
};
|
|
118
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* The character a key name stands for (`slash` is `/`), or the name itself when it is not punctuation.
|
|
149
|
+
*
|
|
150
|
+
* @param key A lowercase key name in hook format.
|
|
151
|
+
* @returns The punctuation character, or `key` unchanged.
|
|
152
|
+
*/
|
|
119
153
|
const hotkeyCharacter = (key) => KEY_NAME_CHARACTERS[key] ?? key;
|
|
120
154
|
/**
|
|
121
155
|
* Accepts a hotkey in `react-hotkeys-hook` format (`mod+k`) or the symbol shorthand (`⌘K`, `⌘⇧P`,
|
|
@@ -125,6 +159,10 @@ const hotkeyCharacter = (key) => KEY_NAME_CHARACTERS[key] ?? key;
|
|
|
125
159
|
*
|
|
126
160
|
* `forDisplay` keeps a shifted symbol as written (`⌘?`). Without it, a shifted symbol in a combination
|
|
127
161
|
* becomes Shift plus its key (`mod+shift+slash`), which is the form that can be registered.
|
|
162
|
+
*
|
|
163
|
+
* @param hotkey One step of a shortcut in either hook format or symbol shorthand.
|
|
164
|
+
* @param options `forDisplay` keeps shifted symbols as written instead of expanding them to Shift plus a key.
|
|
165
|
+
* @returns The hook-format hotkey with duplicate keys removed, or an empty string when `hotkey` holds no keys.
|
|
128
166
|
*/
|
|
129
167
|
const normalizeHotkey = (hotkey, { forDisplay = false } = {}) => {
|
|
130
168
|
const keys = hotkey
|
|
@@ -145,6 +183,10 @@ const normalizeHotkey = (hotkey, { forDisplay = false } = {}) => {
|
|
|
145
183
|
* Turns an item's `shortcutKeys` into hook-format steps. Each entry is one step (`['⌘e']` is a combination,
|
|
146
184
|
* `['g', 'p']` is G then P), except that an entry holding only modifiers joins the entry after it, so the
|
|
147
185
|
* older `['⌘', 'H']` spelling still means ⌘H.
|
|
186
|
+
*
|
|
187
|
+
* @param shortcutKeys The item's shortcut entries, in hook format or symbol shorthand.
|
|
188
|
+
* @param options Passed to `normalizeHotkey` for each entry; `forDisplay` keeps shifted symbols as written.
|
|
189
|
+
* @returns One hook-format hotkey per step; trailing modifiers with no key form a final step of their own.
|
|
148
190
|
*/
|
|
149
191
|
const toHotkeySteps = (shortcutKeys, options) => {
|
|
150
192
|
const steps = [];
|
|
@@ -168,6 +210,9 @@ const toHotkeySteps = (shortcutKeys, options) => {
|
|
|
168
210
|
* - `guarded`: one step that typing could produce (Shift+A) or a named key (F1), so it is ignored in fields.
|
|
169
211
|
* - `typed`: character keys pressed in turn (`?`, G then P), also ignored in fields.
|
|
170
212
|
* - `unsupported`: several steps with a modifier or named key, which no handler can match.
|
|
213
|
+
*
|
|
214
|
+
* @param steps Hook-format steps as returned by `toHotkeySteps`.
|
|
215
|
+
* @returns The way the shortcut can be triggered.
|
|
171
216
|
*/
|
|
172
217
|
const getItemHotkeyKind = (steps) => {
|
|
173
218
|
const stepKeys = steps.map((step) => step.split('+'));
|
|
@@ -196,6 +241,9 @@ const deepActiveElement = () => {
|
|
|
196
241
|
* Whether a key event happened while the user is typing in a field, including one inside a shadow root.
|
|
197
242
|
* Checks the focused element as well as the event target, because react-aria re-dispatches keys typed
|
|
198
243
|
* in a combobox onto its list.
|
|
244
|
+
*
|
|
245
|
+
* @param event The key event to check.
|
|
246
|
+
* @returns `true` when the event target or the focused element is editable.
|
|
199
247
|
*/
|
|
200
248
|
const isTypingInField = (event) => isEditable(event.composedPath()[0] ?? event.target) || isEditable(event.target) || isEditable(deepActiveElement());
|
|
201
249
|
const startsWith = (sequence, prefix) => prefix.every((key, index) => sequence[index] === key);
|
|
@@ -203,6 +251,11 @@ const startsWith = (sequence, prefix) => prefix.every((key, index) => sequence[i
|
|
|
203
251
|
* Feeds one typed key into the keys typed so far and reports whether a sequence is now complete.
|
|
204
252
|
* Returns the index of the matched sequence and an empty buffer, or the buffer to carry forward:
|
|
205
253
|
* the longest run of recent keys that still begins some sequence.
|
|
254
|
+
*
|
|
255
|
+
* @param typedKeys The buffer carried forward from the previous call.
|
|
256
|
+
* @param key The character just typed.
|
|
257
|
+
* @param sequences The sequences to match against, each a list of characters pressed in turn.
|
|
258
|
+
* @returns The next buffer, plus the position in `sequences` of the match when one completed.
|
|
206
259
|
*/
|
|
207
260
|
const advanceKeySequence = (typedKeys, key, sequences) => {
|
|
208
261
|
const typed = [...typedKeys, key];
|
|
@@ -238,6 +291,9 @@ const FUNCTION_KEY = /^f([1-9]|1\d|2[0-4])$/;
|
|
|
238
291
|
/**
|
|
239
292
|
* Whether a normalised hotkey is made only of modifiers and real keys. Display props accept any text
|
|
240
293
|
* (`"Ctrl K"`, `"Hold to talk"`), and formatting text that is not a hotkey would mangle it.
|
|
294
|
+
*
|
|
295
|
+
* @param hotkey A single step already passed through `normalizeHotkey`.
|
|
296
|
+
* @returns `true` when it holds at least one real key and nothing that is neither a key nor a modifier.
|
|
241
297
|
*/
|
|
242
298
|
const isRecognisedHotkey = (hotkey) => {
|
|
243
299
|
const keys = hotkey.split('+').map(mapCode).filter(Boolean);
|
|
@@ -267,6 +323,10 @@ const MODIFIER_ORDER = ['meta', 'mod', 'ctrl', 'control', 'alt', 'shift'];
|
|
|
267
323
|
* `isMac` says whether `mod` is ⌘. For a `react-hotkeys-hook` key that is macOS only (not iOS).
|
|
268
324
|
* Formats one hotkey: of several comma-separated alternatives it draws only the first. `formatHotkeyLabel`
|
|
269
325
|
* is the entry point that draws them all.
|
|
326
|
+
*
|
|
327
|
+
* @param hotkey A hook-format hotkey; only its first comma-separated alternative is drawn.
|
|
328
|
+
* @param isMac Whether to draw macOS symbols (`⌘⇧K`) instead of spelled-out modifiers (`Ctrl Shift K`).
|
|
329
|
+
* @returns The display label for the first alternative.
|
|
270
330
|
*/
|
|
271
331
|
const formatHotkeyHint = (hotkey, isMac) => {
|
|
272
332
|
const modifiers = isMac ? MAC_MODIFIERS : OTHER_MODIFIERS;
|
|
@@ -288,6 +348,10 @@ const formatSteps = (hotkey, isMac) => {
|
|
|
288
348
|
* shorthand (`⌘K`) or a shortcut written out (`Ctrl+K`), and draws each distinct comma-separated alternative.
|
|
289
349
|
* Text that is not a hotkey (`Hold to talk`) is returned exactly as written, so a display prop can take
|
|
290
350
|
* any label.
|
|
351
|
+
*
|
|
352
|
+
* @param hotkey The shortcut in any accepted form, or arbitrary display text.
|
|
353
|
+
* @param isMac Whether `mod` reads as ⌘ and modifiers are drawn as macOS symbols.
|
|
354
|
+
* @returns The label for every distinct alternative, or `hotkey` unchanged when any part is not a hotkey.
|
|
291
355
|
*/
|
|
292
356
|
const formatHotkeyLabel = (hotkey, isMac) => {
|
|
293
357
|
const alternatives = hotkey.split(ALTERNATIVE_SEPARATOR).map((alternative) => formatSteps(alternative, isMac));
|