@beautinique/frontend-components 1.0.8 → 1.0.9
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 +225 -16
- package/dist/auth/SocialAuth.d.cts +33 -0
- package/dist/auth/SocialAuth.d.cts.map +1 -0
- package/dist/auth/SocialAuth.d.ts +33 -0
- package/dist/auth/SocialAuth.d.ts.map +1 -0
- package/dist/auth/index.cjs +34 -26
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +1 -0
- package/dist/auth/index.d.cts.map +1 -1
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +32 -25
- package/dist/auth/index.js.map +1 -1
- package/dist/breadcrumb/Breadcrumb.d.cts +34 -0
- package/dist/breadcrumb/Breadcrumb.d.cts.map +1 -0
- package/dist/breadcrumb/Breadcrumb.d.ts +34 -0
- package/dist/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb/breadcrumb-icons.d.cts +6 -0
- package/dist/breadcrumb/breadcrumb-icons.d.cts.map +1 -0
- package/dist/breadcrumb/breadcrumb-icons.d.ts +6 -0
- package/dist/breadcrumb/breadcrumb-icons.d.ts.map +1 -0
- package/dist/breadcrumb/getBreadcrumbItems.d.cts +16 -0
- package/dist/breadcrumb/getBreadcrumbItems.d.cts.map +1 -0
- package/dist/breadcrumb/getBreadcrumbItems.d.ts +16 -0
- package/dist/breadcrumb/getBreadcrumbItems.d.ts.map +1 -0
- package/dist/breadcrumb/index.cjs +110 -0
- package/dist/breadcrumb/index.cjs.map +1 -0
- package/dist/breadcrumb/index.d.cts +3 -0
- package/dist/breadcrumb/index.d.cts.map +1 -0
- package/dist/breadcrumb/index.d.ts +3 -0
- package/dist/breadcrumb/index.d.ts.map +1 -0
- package/dist/breadcrumb/index.js +107 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/color-input/ColorInput.d.cts +33 -0
- package/dist/color-input/ColorInput.d.cts.map +1 -0
- package/dist/color-input/ColorInput.d.ts +33 -0
- package/dist/color-input/ColorInput.d.ts.map +1 -0
- package/dist/color-input/color-input-icons.d.cts +6 -0
- package/dist/color-input/color-input-icons.d.cts.map +1 -0
- package/dist/color-input/color-input-icons.d.ts +6 -0
- package/dist/color-input/color-input-icons.d.ts.map +1 -0
- package/dist/color-input/color.d.cts +10 -0
- package/dist/color-input/color.d.cts.map +1 -0
- package/dist/color-input/color.d.ts +10 -0
- package/dist/color-input/color.d.ts.map +1 -0
- package/dist/color-input/index.cjs +375 -0
- package/dist/color-input/index.cjs.map +1 -0
- package/dist/color-input/index.d.cts +2 -0
- package/dist/color-input/index.d.cts.map +1 -0
- package/dist/color-input/index.d.ts +2 -0
- package/dist/color-input/index.d.ts.map +1 -0
- package/dist/color-input/index.js +373 -0
- package/dist/color-input/index.js.map +1 -0
- package/dist/file-input/FileInput.d.cts +53 -0
- package/dist/file-input/FileInput.d.cts.map +1 -0
- package/dist/file-input/FileInput.d.ts +53 -0
- package/dist/file-input/FileInput.d.ts.map +1 -0
- package/dist/file-input/file-input-icons.d.cts +6 -0
- package/dist/file-input/file-input-icons.d.cts.map +1 -0
- package/dist/file-input/file-input-icons.d.ts +6 -0
- package/dist/file-input/file-input-icons.d.ts.map +1 -0
- package/dist/file-input/index.cjs +259 -0
- package/dist/file-input/index.cjs.map +1 -0
- package/dist/file-input/index.d.cts +3 -0
- package/dist/file-input/index.d.cts.map +1 -0
- package/dist/file-input/index.d.ts +3 -0
- package/dist/file-input/index.d.ts.map +1 -0
- package/dist/file-input/index.js +256 -0
- package/dist/file-input/index.js.map +1 -0
- package/dist/file-input/media-type.d.cts +8 -0
- package/dist/file-input/media-type.d.cts.map +1 -0
- package/dist/file-input/media-type.d.ts +8 -0
- package/dist/file-input/media-type.d.ts.map +1 -0
- package/dist/file-input/useObjectUrls.d.cts +10 -0
- package/dist/file-input/useObjectUrls.d.cts.map +1 -0
- package/dist/file-input/useObjectUrls.d.ts +10 -0
- package/dist/file-input/useObjectUrls.d.ts.map +1 -0
- package/dist/hierarchy-select/HierarchySelect.d.cts +58 -0
- package/dist/hierarchy-select/HierarchySelect.d.cts.map +1 -0
- package/dist/hierarchy-select/HierarchySelect.d.ts +58 -0
- package/dist/hierarchy-select/HierarchySelect.d.ts.map +1 -0
- package/dist/hierarchy-select/hierarchy-select-icons.d.cts +6 -0
- package/dist/hierarchy-select/hierarchy-select-icons.d.cts.map +1 -0
- package/dist/hierarchy-select/hierarchy-select-icons.d.ts +6 -0
- package/dist/hierarchy-select/hierarchy-select-icons.d.ts.map +1 -0
- package/dist/hierarchy-select/index.cjs +596 -0
- package/dist/hierarchy-select/index.cjs.map +1 -0
- package/dist/hierarchy-select/index.d.cts +2 -0
- package/dist/hierarchy-select/index.d.cts.map +1 -0
- package/dist/hierarchy-select/index.d.ts +2 -0
- package/dist/hierarchy-select/index.d.ts.map +1 -0
- package/dist/hierarchy-select/index.js +594 -0
- package/dist/hierarchy-select/index.js.map +1 -0
- package/dist/hierarchy-select/tree.d.cts +38 -0
- package/dist/hierarchy-select/tree.d.cts.map +1 -0
- package/dist/hierarchy-select/tree.d.ts +38 -0
- package/dist/hierarchy-select/tree.d.ts.map +1 -0
- package/dist/index.cjs +7 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/inputs/Checkbox.d.cts +21 -0
- package/dist/inputs/Checkbox.d.cts.map +1 -0
- package/dist/inputs/Checkbox.d.ts +21 -0
- package/dist/inputs/Checkbox.d.ts.map +1 -0
- package/dist/inputs/Input.d.cts +26 -0
- package/dist/inputs/Input.d.cts.map +1 -0
- package/dist/inputs/Input.d.ts +26 -0
- package/dist/inputs/Input.d.ts.map +1 -0
- package/dist/inputs/InputError.d.cts +11 -0
- package/dist/inputs/InputError.d.cts.map +1 -0
- package/dist/inputs/InputError.d.ts +11 -0
- package/dist/inputs/InputError.d.ts.map +1 -0
- package/dist/inputs/InputIcon.d.cts +9 -0
- package/dist/inputs/InputIcon.d.cts.map +1 -0
- package/dist/inputs/InputIcon.d.ts +9 -0
- package/dist/inputs/InputIcon.d.ts.map +1 -0
- package/dist/inputs/InputLabel.d.cts +8 -0
- package/dist/inputs/InputLabel.d.cts.map +1 -0
- package/dist/inputs/InputLabel.d.ts +8 -0
- package/dist/inputs/InputLabel.d.ts.map +1 -0
- package/dist/inputs/Radio.d.cts +25 -0
- package/dist/inputs/Radio.d.cts.map +1 -0
- package/dist/inputs/Radio.d.ts +25 -0
- package/dist/inputs/Radio.d.ts.map +1 -0
- package/dist/inputs/Select.d.cts +53 -0
- package/dist/inputs/Select.d.cts.map +1 -0
- package/dist/inputs/Select.d.ts +53 -0
- package/dist/inputs/Select.d.ts.map +1 -0
- package/dist/inputs/Textarea.d.cts +19 -0
- package/dist/inputs/Textarea.d.cts.map +1 -0
- package/dist/inputs/Textarea.d.ts +19 -0
- package/dist/inputs/Textarea.d.ts.map +1 -0
- package/dist/inputs/index.cjs +746 -0
- package/dist/inputs/index.cjs.map +1 -0
- package/dist/inputs/index.d.cts +10 -0
- package/dist/inputs/index.d.cts.map +1 -0
- package/dist/inputs/index.d.ts +10 -0
- package/dist/inputs/index.d.ts.map +1 -0
- package/dist/inputs/index.js +737 -0
- package/dist/inputs/index.js.map +1 -0
- package/dist/inputs/inputs-icons.d.cts +6 -0
- package/dist/inputs/inputs-icons.d.cts.map +1 -0
- package/dist/inputs/inputs-icons.d.ts +6 -0
- package/dist/inputs/inputs-icons.d.ts.map +1 -0
- package/dist/inputs/types.d.cts +48 -0
- package/dist/inputs/types.d.cts.map +1 -0
- package/dist/inputs/types.d.ts +48 -0
- package/dist/inputs/types.d.ts.map +1 -0
- package/dist/inputs/useFieldIds.d.cts +24 -0
- package/dist/inputs/useFieldIds.d.cts.map +1 -0
- package/dist/inputs/useFieldIds.d.ts +24 -0
- package/dist/inputs/useFieldIds.d.ts.map +1 -0
- package/dist/layout/ApiStatus.d.cts +20 -0
- package/dist/layout/ApiStatus.d.cts.map +1 -0
- package/dist/layout/ApiStatus.d.ts +20 -0
- package/dist/layout/ApiStatus.d.ts.map +1 -0
- package/dist/layout/BorderGradient.d.cts +11 -0
- package/dist/layout/BorderGradient.d.cts.map +1 -0
- package/dist/layout/BorderGradient.d.ts +11 -0
- package/dist/layout/BorderGradient.d.ts.map +1 -0
- package/dist/layout/ConfirmModal.d.cts +44 -0
- package/dist/layout/ConfirmModal.d.cts.map +1 -0
- package/dist/layout/ConfirmModal.d.ts +44 -0
- package/dist/layout/ConfirmModal.d.ts.map +1 -0
- package/dist/layout/Dropdown.d.cts +33 -0
- package/dist/layout/Dropdown.d.cts.map +1 -0
- package/dist/layout/Dropdown.d.ts +33 -0
- package/dist/layout/Dropdown.d.ts.map +1 -0
- package/dist/layout/LoadingPage.d.cts +11 -0
- package/dist/layout/LoadingPage.d.cts.map +1 -0
- package/dist/layout/LoadingPage.d.ts +11 -0
- package/dist/layout/LoadingPage.d.ts.map +1 -0
- package/dist/layout/LoadingRings.d.cts +12 -0
- package/dist/layout/LoadingRings.d.cts.map +1 -0
- package/dist/layout/LoadingRings.d.ts +12 -0
- package/dist/layout/LoadingRings.d.ts.map +1 -0
- package/dist/layout/LoadingText.d.cts +13 -0
- package/dist/layout/LoadingText.d.cts.map +1 -0
- package/dist/layout/LoadingText.d.ts +13 -0
- package/dist/layout/LoadingText.d.ts.map +1 -0
- package/dist/layout/ModalWrapper.d.cts +48 -0
- package/dist/layout/ModalWrapper.d.cts.map +1 -0
- package/dist/layout/ModalWrapper.d.ts +48 -0
- package/dist/layout/ModalWrapper.d.ts.map +1 -0
- package/dist/layout/NetworkStatusToaster.d.cts +39 -0
- package/dist/layout/NetworkStatusToaster.d.cts.map +1 -0
- package/dist/layout/NetworkStatusToaster.d.ts +39 -0
- package/dist/layout/NetworkStatusToaster.d.ts.map +1 -0
- package/dist/layout/ScrollableGradientContainer.d.cts +28 -0
- package/dist/layout/ScrollableGradientContainer.d.cts.map +1 -0
- package/dist/layout/ScrollableGradientContainer.d.ts +28 -0
- package/dist/layout/ScrollableGradientContainer.d.ts.map +1 -0
- package/dist/layout/Skeleton.d.cts +9 -0
- package/dist/layout/Skeleton.d.cts.map +1 -0
- package/dist/layout/Skeleton.d.ts +9 -0
- package/dist/layout/Skeleton.d.ts.map +1 -0
- package/dist/layout/Table.d.cts +9 -0
- package/dist/layout/Table.d.cts.map +1 -0
- package/dist/layout/Table.d.ts +9 -0
- package/dist/layout/Table.d.ts.map +1 -0
- package/dist/layout/index.cjs +743 -3
- package/dist/layout/index.cjs.map +1 -1
- package/dist/layout/index.d.cts +12 -0
- package/dist/layout/index.d.cts.map +1 -1
- package/dist/layout/index.d.ts +12 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +724 -2
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/layout-icons.d.cts +6 -0
- package/dist/layout/layout-icons.d.cts.map +1 -0
- package/dist/layout/layout-icons.d.ts +6 -0
- package/dist/layout/layout-icons.d.ts.map +1 -0
- package/dist/lib/dropdown-position.d.cts +33 -0
- package/dist/lib/dropdown-position.d.cts.map +1 -0
- package/dist/lib/dropdown-position.d.ts +33 -0
- package/dist/lib/dropdown-position.d.ts.map +1 -0
- package/dist/lib/focus.d.cts +3 -0
- package/dist/lib/focus.d.cts.map +1 -0
- package/dist/lib/focus.d.ts +3 -0
- package/dist/lib/focus.d.ts.map +1 -0
- package/dist/lib/icon-registry.d.cts +14 -0
- package/dist/lib/icon-registry.d.cts.map +1 -0
- package/dist/lib/icon-registry.d.ts +14 -0
- package/dist/lib/icon-registry.d.ts.map +1 -0
- package/dist/lib/mergeRefs.d.cts +10 -0
- package/dist/lib/mergeRefs.d.cts.map +1 -0
- package/dist/lib/mergeRefs.d.ts +10 -0
- package/dist/lib/mergeRefs.d.ts.map +1 -0
- package/dist/lib/scrollRowIntoView.d.cts +7 -0
- package/dist/lib/scrollRowIntoView.d.cts.map +1 -0
- package/dist/lib/scrollRowIntoView.d.ts +7 -0
- package/dist/lib/scrollRowIntoView.d.ts.map +1 -0
- package/dist/lib/typeahead.d.cts +21 -0
- package/dist/lib/typeahead.d.cts.map +1 -0
- package/dist/lib/typeahead.d.ts +21 -0
- package/dist/lib/typeahead.d.ts.map +1 -0
- package/dist/lib/useAnchoredBox.d.cts +26 -0
- package/dist/lib/useAnchoredBox.d.cts.map +1 -0
- package/dist/lib/useAnchoredBox.d.ts +26 -0
- package/dist/lib/useAnchoredBox.d.ts.map +1 -0
- package/dist/lib/useDismiss.d.cts +34 -0
- package/dist/lib/useDismiss.d.cts.map +1 -0
- package/dist/lib/useDismiss.d.ts +34 -0
- package/dist/lib/useDismiss.d.ts.map +1 -0
- package/dist/lib/useFocusTrap.d.cts +24 -0
- package/dist/lib/useFocusTrap.d.cts.map +1 -0
- package/dist/lib/useFocusTrap.d.ts +24 -0
- package/dist/lib/useFocusTrap.d.ts.map +1 -0
- package/dist/lib/useIsClient.d.cts +7 -0
- package/dist/lib/useIsClient.d.cts.map +1 -0
- package/dist/lib/useIsClient.d.ts +7 -0
- package/dist/lib/useIsClient.d.ts.map +1 -0
- package/dist/lib/usePrefersReducedMotion.d.cts +7 -0
- package/dist/lib/usePrefersReducedMotion.d.cts.map +1 -0
- package/dist/lib/usePrefersReducedMotion.d.ts +7 -0
- package/dist/lib/usePrefersReducedMotion.d.ts.map +1 -0
- package/dist/lib/useScrollLock.d.cts +7 -0
- package/dist/lib/useScrollLock.d.cts.map +1 -0
- package/dist/lib/useScrollLock.d.ts +7 -0
- package/dist/lib/useScrollLock.d.ts.map +1 -0
- package/dist/lib/useScrollable.d.cts +17 -0
- package/dist/lib/useScrollable.d.cts.map +1 -0
- package/dist/lib/useScrollable.d.ts +17 -0
- package/dist/lib/useScrollable.d.ts.map +1 -0
- package/dist/loading-screen/LoadingScreen.d.cts +21 -0
- package/dist/loading-screen/LoadingScreen.d.cts.map +1 -0
- package/dist/loading-screen/LoadingScreen.d.ts +21 -0
- package/dist/loading-screen/LoadingScreen.d.ts.map +1 -0
- package/dist/loading-screen/Teddy.d.cts +10 -0
- package/dist/loading-screen/Teddy.d.cts.map +1 -0
- package/dist/loading-screen/Teddy.d.ts +10 -0
- package/dist/loading-screen/Teddy.d.ts.map +1 -0
- package/dist/loading-screen/WakeUpProgress.d.cts +16 -0
- package/dist/loading-screen/WakeUpProgress.d.cts.map +1 -0
- package/dist/loading-screen/WakeUpProgress.d.ts +16 -0
- package/dist/loading-screen/WakeUpProgress.d.ts.map +1 -0
- package/dist/loading-screen/beauty-facts.d.cts +4 -0
- package/dist/loading-screen/beauty-facts.d.cts.map +1 -0
- package/dist/loading-screen/beauty-facts.d.ts +4 -0
- package/dist/loading-screen/beauty-facts.d.ts.map +1 -0
- package/dist/loading-screen/index.cjs +405 -0
- package/dist/loading-screen/index.cjs.map +1 -0
- package/dist/loading-screen/index.d.cts +5 -0
- package/dist/loading-screen/index.d.cts.map +1 -0
- package/dist/loading-screen/index.d.ts +5 -0
- package/dist/loading-screen/index.d.ts.map +1 -0
- package/dist/loading-screen/index.js +400 -0
- package/dist/loading-screen/index.js.map +1 -0
- package/dist/loading-screen/loading-screen-icons.d.cts +6 -0
- package/dist/loading-screen/loading-screen-icons.d.cts.map +1 -0
- package/dist/loading-screen/loading-screen-icons.d.ts +6 -0
- package/dist/loading-screen/loading-screen-icons.d.ts.map +1 -0
- package/dist/media/MediaCarousel.d.cts +30 -0
- package/dist/media/MediaCarousel.d.cts.map +1 -0
- package/dist/media/MediaCarousel.d.ts +30 -0
- package/dist/media/MediaCarousel.d.ts.map +1 -0
- package/dist/media/MediaCarouselWithModal.d.cts +17 -0
- package/dist/media/MediaCarouselWithModal.d.cts.map +1 -0
- package/dist/media/MediaCarouselWithModal.d.ts +17 -0
- package/dist/media/MediaCarouselWithModal.d.ts.map +1 -0
- package/dist/media/MediaCarouselWithParentMedia.d.cts +30 -0
- package/dist/media/MediaCarouselWithParentMedia.d.cts.map +1 -0
- package/dist/media/MediaCarouselWithParentMedia.d.ts +30 -0
- package/dist/media/MediaCarouselWithParentMedia.d.ts.map +1 -0
- package/dist/media/MediaModal.d.cts +27 -0
- package/dist/media/MediaModal.d.cts.map +1 -0
- package/dist/media/MediaModal.d.ts +27 -0
- package/dist/media/MediaModal.d.ts.map +1 -0
- package/dist/media/VideoPlayer.d.cts +37 -0
- package/dist/media/VideoPlayer.d.cts.map +1 -0
- package/dist/media/VideoPlayer.d.ts +37 -0
- package/dist/media/VideoPlayer.d.ts.map +1 -0
- package/dist/media/captureVideoPoster.d.cts +20 -0
- package/dist/media/captureVideoPoster.d.cts.map +1 -0
- package/dist/media/captureVideoPoster.d.ts +20 -0
- package/dist/media/captureVideoPoster.d.ts.map +1 -0
- package/dist/media/index.cjs +613 -0
- package/dist/media/index.cjs.map +1 -0
- package/dist/media/index.d.cts +8 -0
- package/dist/media/index.d.cts.map +1 -0
- package/dist/media/index.d.ts +8 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +605 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/labels.d.cts +33 -0
- package/dist/media/labels.d.cts.map +1 -0
- package/dist/media/labels.d.ts +33 -0
- package/dist/media/labels.d.ts.map +1 -0
- package/dist/media/media-icons.d.cts +6 -0
- package/dist/media/media-icons.d.cts.map +1 -0
- package/dist/media/media-icons.d.ts +6 -0
- package/dist/media/media-icons.d.ts.map +1 -0
- package/dist/media/streaming.d.cts +18 -0
- package/dist/media/streaming.d.cts.map +1 -0
- package/dist/media/streaming.d.ts +18 -0
- package/dist/media/streaming.d.ts.map +1 -0
- package/dist/resend/index.cjs +5 -28
- package/dist/resend/index.cjs.map +1 -1
- package/dist/resend/index.js +1 -24
- package/dist/resend/index.js.map +1 -1
- package/dist/static-page/StaticPage.d.cts +91 -0
- package/dist/static-page/StaticPage.d.cts.map +1 -0
- package/dist/static-page/StaticPage.d.ts +91 -0
- package/dist/static-page/StaticPage.d.ts.map +1 -0
- package/dist/static-page/index.cjs +247 -0
- package/dist/static-page/index.cjs.map +1 -0
- package/dist/static-page/index.d.cts +2 -0
- package/dist/static-page/index.d.cts.map +1 -0
- package/dist/static-page/index.d.ts +2 -0
- package/dist/static-page/index.d.ts.map +1 -0
- package/dist/static-page/index.js +235 -0
- package/dist/static-page/index.js.map +1 -0
- package/dist/static-page/static-page-icons.d.cts +6 -0
- package/dist/static-page/static-page-icons.d.cts.map +1 -0
- package/dist/static-page/static-page-icons.d.ts +6 -0
- package/dist/static-page/static-page-icons.d.ts.map +1 -0
- package/dist/testimonials/TestimonialCarousel.d.cts +40 -0
- package/dist/testimonials/TestimonialCarousel.d.cts.map +1 -0
- package/dist/testimonials/TestimonialCarousel.d.ts +40 -0
- package/dist/testimonials/TestimonialCarousel.d.ts.map +1 -0
- package/dist/testimonials/index.cjs +246 -0
- package/dist/testimonials/index.cjs.map +1 -0
- package/dist/testimonials/index.d.cts +2 -0
- package/dist/testimonials/index.d.cts.map +1 -0
- package/dist/testimonials/index.d.ts +2 -0
- package/dist/testimonials/index.d.ts.map +1 -0
- package/dist/testimonials/index.js +244 -0
- package/dist/testimonials/index.js.map +1 -0
- package/dist/testimonials/testimonials-icons.d.cts +6 -0
- package/dist/testimonials/testimonials-icons.d.cts.map +1 -0
- package/dist/testimonials/testimonials-icons.d.ts +6 -0
- package/dist/testimonials/testimonials-icons.d.ts.map +1 -0
- package/dist/toast/index.cjs +2 -38
- package/dist/toast/index.cjs.map +1 -1
- package/dist/toast/index.js +1 -37
- package/dist/toast/index.js.map +1 -1
- package/package.json +67 -1
package/README.md
CHANGED
|
@@ -13,6 +13,13 @@ npm install @beautinique/frontend-components @beautinique/frontend-stores @beaut
|
|
|
13
13
|
|
|
14
14
|
Peer dependencies: `react`, `react-dom`, `@iconify/react`, `@beautinique/frontend-styles` and [`@beautinique/frontend-stores`](../stores/README.md) (the toasts are kept in a store that the app makes with it, see [Toasts](#toasts); that needs `zustand` in the app).
|
|
15
15
|
|
|
16
|
+
Two more are **optional**, needed only by the path that uses them (an app that never imports that path does not need them, and the bundler never looks for them):
|
|
17
|
+
|
|
18
|
+
| Optional peer | Needed by |
|
|
19
|
+
| --------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
20
|
+
| `hls.js` | `/media`, only to play a stream (`.m3u8`) in a browser that cannot play it itself; it is loaded when it is needed |
|
|
21
|
+
| `react-color-palette` | `/color-input` (its picker) |
|
|
22
|
+
|
|
16
23
|
## Setup (once per app)
|
|
17
24
|
|
|
18
25
|
In the app's own `index.css`, in this order:
|
|
@@ -29,22 +36,31 @@ generated and the components come out unstyled. (The playground has a page that
|
|
|
29
36
|
|
|
30
37
|
## Import paths
|
|
31
38
|
|
|
32
|
-
Components that most screens use live in `/ui`, `/layout`, `/theme` and `/toast`, and the root gives
|
|
39
|
+
Components that most screens use live in `/ui`, `/layout`, `/inputs`, `/theme` and `/toast`, and the root gives
|
|
33
40
|
all of them. Components that few screens use have a path of their own and are **not** in the root, so
|
|
34
41
|
an app only bundles what it imports.
|
|
35
42
|
|
|
36
|
-
| Import path
|
|
37
|
-
|
|
|
38
|
-
| `@beautinique/frontend-components`
|
|
39
|
-
| `@beautinique/frontend-components/ui`
|
|
40
|
-
| `@beautinique/frontend-components/
|
|
41
|
-
| `@beautinique/frontend-components/
|
|
42
|
-
| `@beautinique/frontend-components/
|
|
43
|
-
| `@beautinique/frontend-components/
|
|
44
|
-
| `@beautinique/frontend-components/
|
|
45
|
-
| `@beautinique/frontend-components/
|
|
46
|
-
| `@beautinique/frontend-components/
|
|
47
|
-
| `@beautinique/frontend-components/
|
|
43
|
+
| Import path | What it gives |
|
|
44
|
+
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
45
|
+
| `@beautinique/frontend-components` | Everything `/ui`, `/layout`, `/inputs`, `/theme` and `/toast` give (the very same values), and the types |
|
|
46
|
+
| `@beautinique/frontend-components/ui` | `Badge`, `Button`, `Divider`, `GradientText`, `Tooltip` |
|
|
47
|
+
| `@beautinique/frontend-components/inputs` | `Input`, `Textarea`, `Checkbox`, `Radio`, `Select`, and what they are made of: `InputLabel`, `InputError`, `InputIcon` |
|
|
48
|
+
| `@beautinique/frontend-components/layout` | `ApiStatus`, `BorderGradient`, `ConfirmModal`, `Dropdown`, `LoadingPage`, `LoadingRings`, `LoadingText`, `ModalWrapper`, `NetworkStatusToaster`, `ScrollableGradientContainer`, `ScrollToTop`, `Skeleton`, `Table` and its parts |
|
|
49
|
+
| `@beautinique/frontend-components/theme` | `Theme` (the dark / light button) |
|
|
50
|
+
| `@beautinique/frontend-components/toast` | `ToastContainer`, `Toaster`, the types of the toasts, and what works out what a toast shows |
|
|
51
|
+
| `@beautinique/frontend-components/auth` | `AuthBottomInstructions`, `SocialAuth` |
|
|
52
|
+
| `@beautinique/frontend-components/breadcrumb` | `Breadcrumb`, `getBreadcrumbItems` |
|
|
53
|
+
| `@beautinique/frontend-components/color-input` | `ColorInput` (needs `react-color-palette`) |
|
|
54
|
+
| `@beautinique/frontend-components/file-input` | `FileInput`, `getMediaType` |
|
|
55
|
+
| `@beautinique/frontend-components/hierarchy-select` | `HierarchySelect` |
|
|
56
|
+
| `@beautinique/frontend-components/linear-gradient` | `LinearGradient` |
|
|
57
|
+
| `@beautinique/frontend-components/loading-screen` | `LoadingScreen`, `Teddy`, `WakeUpProgress`, `BEAUTY_FACTS` |
|
|
58
|
+
| `@beautinique/frontend-components/media` | `VideoPlayer`, `MediaCarousel`, `MediaCarouselWithParentMedia`, `MediaCarouselWithModal`, `MediaModal`, `captureVideoPoster`, `MEDIA_LABELS` |
|
|
59
|
+
| `@beautinique/frontend-components/resend` | `Resend` |
|
|
60
|
+
| `@beautinique/frontend-components/static-page` | `StaticPageLayout`, `StaticPageHeader`, `StaticPageSection`, `InfoCardGrid`, `Checklist`, `HighlightNote`, `NumberedSteps`, `StaticPageCTA`, `EmailUsAction`, `LastUpdatedBadge` |
|
|
61
|
+
| `@beautinique/frontend-components/stepper` | `Stepper` |
|
|
62
|
+
| `@beautinique/frontend-components/testimonials` | `TestimonialCarousel` |
|
|
63
|
+
| `@beautinique/frontend-components/source.css` | The `@source` line of the setup above |
|
|
48
64
|
|
|
49
65
|
What the root gives can be imported from the root or from its own path, it is the same component
|
|
50
66
|
either way:
|
|
@@ -267,6 +283,196 @@ the compiler asks for `href`), `terms` and `privacy` are the props of those link
|
|
|
267
283
|
/>
|
|
268
284
|
```
|
|
269
285
|
|
|
286
|
+
### Inputs (`Input`, `Textarea`, `Checkbox`, `Radio`, `Select`)
|
|
287
|
+
|
|
288
|
+
```tsx
|
|
289
|
+
import { Input, Select } from '@beautinique/frontend-components';
|
|
290
|
+
|
|
291
|
+
<Input
|
|
292
|
+
label="Name"
|
|
293
|
+
error={errors.name?.message}
|
|
294
|
+
inputProps={{ name: 'name', placeholder: 'Your name' }}
|
|
295
|
+
register={register('name')} // React Hook Form, optional
|
|
296
|
+
icons={{ right: { icon: 'solar:close-circle-linear', label: 'Clear', onClick: clear } }}
|
|
297
|
+
/>;
|
|
298
|
+
|
|
299
|
+
<Select
|
|
300
|
+
label="Fruit"
|
|
301
|
+
options={[
|
|
302
|
+
{ label: 'Apple', value: 'apple' },
|
|
303
|
+
{ label: 'Banana', value: 'banana', disabled: true },
|
|
304
|
+
]}
|
|
305
|
+
selectProps={{ value, onChange: setValue, placeholder: 'Pick a fruit' }}
|
|
306
|
+
/>;
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
The label sits on the border of the field and is its name (it is tied to the field by its `id`); an `error` is said as
|
|
310
|
+
soon as it shows up and marks the field `aria-invalid`. An icon that does something (`onClick`) is drawn inside a
|
|
311
|
+
real `<button>` and needs a `label` (the compiler asks for it). `Checkbox` is a `role="switch"`, `Radio` a real radio
|
|
312
|
+
group (the arrows move the choice), and `Select` a combobox: the arrow keys, Home, End, Enter, Escape and typing a word
|
|
313
|
+
work, the list is drawn in `document.body` (a parent that scrolls does not cut it) and it flips to the other side when
|
|
314
|
+
there is no room.
|
|
315
|
+
|
|
316
|
+
### Layout parts
|
|
317
|
+
|
|
318
|
+
- `ApiStatus`: the state of a request in the middle of its place: rings while it loads, an icon with a title for `error` (said as an alert), `empty` and `success`.
|
|
319
|
+
- `BorderGradient`: a card with a gradient border.
|
|
320
|
+
- `Skeleton`: a grey block that pulses where something loads. It is hidden from assistive technology: say "loading" once, on the area (`aria-busy`).
|
|
321
|
+
- `Table`, `TableHead`, `TableBody`, `TableRow`, `TableHeadCell`, `TableRowCell`: real `<table>` elements with the look of the apps; they take their attributes (`colSpan`...), and a header cell is `scope="col"` unless told another.
|
|
322
|
+
- `ScrollableGradientContainer`: content that scrolls in a box with a fade on the edge that has more behind it; it is a tab stop while it scrolls. `scrollerRef` gives the element that scrolls.
|
|
323
|
+
- `LoadingRings`, `LoadingText`, `LoadingPage`: rings and a shining word for a part of a page that loads, and a whole page of them.
|
|
324
|
+
- `Dropdown`: a button that opens a panel under it (`aria-expanded`; a closed panel is `inert`, out of reach of the keyboard). `closeOnEscape`, `closeOnOutsideClick`; `children` can be a function that gets `{ close }`.
|
|
325
|
+
- `ModalWrapper`: a dialog over the page, drawn in `document.body`: `role="dialog"`, named by its title or `label`, the focus is kept inside and goes back to what had it, the page behind does not scroll, Escape closes the one that is on top.
|
|
326
|
+
- `ConfirmModal`: a dialog that asks for a decision (an `alertdialog`) or says how something went; `type="custom"` shows your own content. A press on the backdrop does not close it: a decision is not made by a stray click.
|
|
327
|
+
- `NetworkStatusToaster`: says when the connection goes away and when it comes back, with the toaster the app gives (`status` is e.g. `useOnlineStatus().status`).
|
|
328
|
+
|
|
329
|
+
```tsx
|
|
330
|
+
import { ConfirmModal } from '@beautinique/frontend-components';
|
|
331
|
+
|
|
332
|
+
<ConfirmModal
|
|
333
|
+
type="warning"
|
|
334
|
+
title="Delete this category?"
|
|
335
|
+
description="It cannot be undone."
|
|
336
|
+
buttons={{
|
|
337
|
+
left: { content: 'Cancel' },
|
|
338
|
+
right: { content: 'Delete', buttonProps: { onClick: remove } },
|
|
339
|
+
}}
|
|
340
|
+
modalProps={{ isOpen, onClose: () => setIsOpen(false) }}
|
|
341
|
+
/>;
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### LoadingScreen, Teddy, WakeUpProgress
|
|
345
|
+
|
|
346
|
+
```tsx
|
|
347
|
+
import { LoadingScreen, WakeUpProgress } from '@beautinique/frontend-components/loading-screen';
|
|
348
|
+
|
|
349
|
+
<LoadingScreen>
|
|
350
|
+
<WakeUpProgress phase="services" services={['user', 'product']} awakeServices={['user']} />
|
|
351
|
+
</LoadingScreen>;
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
The screen of the start of an app: the bear (or what you give it) and a fact of beauty under it that changes every 5
|
|
355
|
+
seconds (`facts`, `interval`; `BEAUTY_FACTS` is the default list). A screen reader hears `label` once, not each fact.
|
|
356
|
+
`WakeUpProgress` shows the steps of a backend that wakes up. `Teddy` imports its css
|
|
357
|
+
(`@beautinique/frontend-styles/teddy.css`) itself.
|
|
358
|
+
|
|
359
|
+
### Media
|
|
360
|
+
|
|
361
|
+
```tsx
|
|
362
|
+
import { MediaCarouselWithModal, VideoPlayer } from '@beautinique/frontend-components/media';
|
|
363
|
+
|
|
364
|
+
const media = [
|
|
365
|
+
{ type: 'image', url: '/a.webp' },
|
|
366
|
+
{ type: 'video', url: 'https://cdn.example/clip.mp4' },
|
|
367
|
+
];
|
|
368
|
+
|
|
369
|
+
<MediaCarouselWithModal media={media} />; // thumbnails; one opens a dialog
|
|
370
|
+
<VideoPlayer videoProps={{ src: 'https://cdn.example/master.m3u8', controls: true }} />;
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
- `MediaCarousel` is the row of thumbnails: buttons named "Show image 2 of 5", `aria-current` on the chosen one, an optional remove button on each; the row scrolls to the chosen one without moving the page. `MediaCarouselWithParentMedia` shows the chosen item big with previous / next buttons (they go round, the left and right arrow keys do the same, the counter "2 of 5" is read out) and the row under it. `MediaModal` shows the same in a dialog (a video there has controls) and `MediaCarouselWithModal` is the row that opens it.
|
|
374
|
+
- `VideoPlayer` plays muted and inline, without controls or a loop, unless told otherwise. A **stream** (`.m3u8`) is played by the browser when it can (Safari, iOS) and by `hls.js` when it cannot: install `hls.js`; it is loaded **only then**, so a page that plays no stream never downloads it. `onStreamError` is told when a stream cannot be played; nothing is logged. `showPosterOnly` shows only the poster, which is made from the file in the browser (`captureVideoPoster`) unless you give `videoProps.poster` or `getPoster` (e.g. a poster that a CDN makes).
|
|
375
|
+
- Every word said to assistive technology is in `labels` (`MEDIA_LABELS` has the English ones), e.g. `labels={{ next: 'Siguiente' }}`.
|
|
376
|
+
|
|
377
|
+
### TestimonialCarousel
|
|
378
|
+
|
|
379
|
+
```tsx
|
|
380
|
+
import { TestimonialCarousel } from '@beautinique/frontend-components/testimonials';
|
|
381
|
+
|
|
382
|
+
<TestimonialCarousel
|
|
383
|
+
testimonials={[{ name: 'Asha Rao', role: 'Founder', content: 'Lovely products.', rating: 5 }]}
|
|
384
|
+
interval={5000}
|
|
385
|
+
/>;
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
One testimonial at a time, turning by itself the way a carousel that moves has to: it stops while the pointer is over it
|
|
389
|
+
(a mouse, not a finger) or the focus is in it, a pause / play button stops it for good, and with the system setting for
|
|
390
|
+
less motion it does not turn at all. Previous and next buttons go round. What is announced is the current slide, and only
|
|
391
|
+
while it is not turning. Without an `image` the initials of the name are shown.
|
|
392
|
+
|
|
393
|
+
### HierarchySelect
|
|
394
|
+
|
|
395
|
+
```tsx
|
|
396
|
+
import { HierarchySelect } from '@beautinique/frontend-components/hierarchy-select';
|
|
397
|
+
|
|
398
|
+
<HierarchySelect
|
|
399
|
+
label="Category"
|
|
400
|
+
options={[
|
|
401
|
+
{ label: 'Skin care', value: 'skin', children: [{ label: 'Cleanser', value: 'cleanser' }] },
|
|
402
|
+
]}
|
|
403
|
+
selectProps={{ value, onChange: setValue, placeholder: 'Choose a category' }}
|
|
404
|
+
/>;
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
A field that opens a tree of options with a search field above it. Only an option without children is chosen; the others
|
|
408
|
+
open and close. The focus stays in the search field while the arrow keys move through the tree (Right and Left open and
|
|
409
|
+
close a branch, Enter chooses, Escape closes and gives the focus back, Tab closes). A search shows the matches and the
|
|
410
|
+
branches that lead to them, all open. Give `inputProps={{ value, onChange }}` to own the search (to search on a server).
|
|
411
|
+
|
|
412
|
+
### ColorInput
|
|
413
|
+
|
|
414
|
+
```tsx
|
|
415
|
+
import { ColorInput } from '@beautinique/frontend-components/color-input';
|
|
416
|
+
|
|
417
|
+
<ColorInput label="Brand colour" value={hex} onChange={setHex} />;
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Needs `react-color-palette`. The field is one button that opens a picker (a dialog that holds the focus until it is closed
|
|
421
|
+
and gives it back). `value` and what `onChange` gets are hex strings; text that is no colour is not passed on. The
|
|
422
|
+
sliders need a mouse or a finger; the hex and rgb fields in the picker work from the keyboard.
|
|
423
|
+
|
|
424
|
+
### FileInput
|
|
425
|
+
|
|
426
|
+
```tsx
|
|
427
|
+
import { FileInput } from '@beautinique/frontend-components/file-input';
|
|
428
|
+
|
|
429
|
+
<FileInput
|
|
430
|
+
label="Photos"
|
|
431
|
+
fileInputProps={{ name: 'photos', multiple: true, value: files, onChange: addFiles }}
|
|
432
|
+
errors={files.map((file) => (file.size > MAX ? 'Too big' : undefined))}
|
|
433
|
+
handleRemove={removeFile}
|
|
434
|
+
/>;
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
A real file input (the keyboard reaches it, the field shows the focus, the same file can be chosen again) with a thumbnail
|
|
438
|
+
under it for each file in `value` (a `File`, or the address of one that is already saved). A thumbnail opens the file big
|
|
439
|
+
in a dialog and can have a remove button; `errors` gives a message per file and a red border to its thumbnail. The files
|
|
440
|
+
get a browser address (`URL.createObjectURL`) that is given back when the file goes. `getMediaType` says what is a picture
|
|
441
|
+
and what a video (the default looks at the type and at the ending).
|
|
442
|
+
|
|
443
|
+
### Breadcrumb
|
|
444
|
+
|
|
445
|
+
```tsx
|
|
446
|
+
import { Breadcrumb, getBreadcrumbItems } from '@beautinique/frontend-components/breadcrumb';
|
|
447
|
+
|
|
448
|
+
<Breadcrumb items={getBreadcrumbItems(pathname)} onNavigate={(href) => navigate(href)} />;
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
A `nav` with a list; the last item is the current page. The links are plain `<a href>` (they work in a new tab);
|
|
452
|
+
`onNavigate` is called for a plain click (not for a click with a modifier, or a middle click) so the app can go there with
|
|
453
|
+
its router. `getBreadcrumbItems('/products/skin-care')` makes the items from a path.
|
|
454
|
+
|
|
455
|
+
### SocialAuth
|
|
456
|
+
|
|
457
|
+
```tsx
|
|
458
|
+
import { SocialAuth } from '@beautinique/frontend-components/auth';
|
|
459
|
+
|
|
460
|
+
<SocialAuth
|
|
461
|
+
providers={[{ name: 'Google', icon: 'logos:google-icon', href: '/auth/google' }]}
|
|
462
|
+
onProviderClick={() => sessionStorage.setItem('redirect', location.pathname)}
|
|
463
|
+
/>;
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
Icons that are links ("Continue with Google"). `onProviderClick` runs before the browser leaves for the provider. An icon
|
|
467
|
+
given by name comes from the Iconify API unless the app has it registered (`addIcon`).
|
|
468
|
+
|
|
469
|
+
### Static page parts
|
|
470
|
+
|
|
471
|
+
`StaticPageLayout`, `StaticPageHeader` (the page `h1`), `StaticPageSection` (an `h2`), `InfoCardGrid` (`h3` cards),
|
|
472
|
+
`Checklist`, `HighlightNote` (a `note`), `NumberedSteps` (an ordered list), `StaticPageCTA`, `EmailUsAction` and
|
|
473
|
+
`LastUpdatedBadge` (`date` is required; it is written in UTC and in a fixed language, so a server and a browser agree)
|
|
474
|
+
make the pages that are only content (company, legal, information). The icons are given by name.
|
|
475
|
+
|
|
270
476
|
### Toasts
|
|
271
477
|
|
|
272
478
|
This package draws the toasts; the store that keeps them and the `toaster` that shows them are [`@beautinique/frontend-stores`](../stores/README.md)'s. The store is **made by the app**, once, with the toasts of this package, and given to the two things that need it: the `ToastContainer` here, as a prop, and `createToaster` of the stores package. This package holds no store and no toaster of its own, and exports none.
|
|
@@ -321,12 +527,12 @@ The icons of the toasts are bundled, so a toast shows its icon without a network
|
|
|
321
527
|
|
|
322
528
|
## Rules for the code of this package
|
|
323
529
|
|
|
324
|
-
- **The package holds no state.** The toast store is made by the app (`createToastStore` of `@beautinique/frontend-stores`, with this package's `TToast`) and given in, to the `ToastContainer` as a prop. The toaster is the stores package's too (`createToaster`). Nothing here makes a store or a toaster, or exports one, so the package can never be the cause of two stores. The root only re-exports `/ui`, `/layout`, `/theme` and `/toast` (`tsup.config.ts` keeps them external, and `built-files.test.ts` checks the built files after `npm run build`).
|
|
325
|
-
- **The root has what most screens use** (`/ui`, `/layout`, `/theme` and `/toast`). A component that
|
|
530
|
+
- **The package holds no state.** The toast store is made by the app (`createToastStore` of `@beautinique/frontend-stores`, with this package's `TToast`) and given in, to the `ToastContainer` as a prop. The toaster is the stores package's too (`createToaster`). Nothing here makes a store or a toaster, or exports one, so the package can never be the cause of two stores. The root only re-exports `/ui`, `/layout`, `/inputs`, `/theme` and `/toast` (`tsup.config.ts` keeps them external, and `built-files.test.ts` checks the built files after `npm run build`).
|
|
531
|
+
- **The root has what most screens use** (`/ui`, `/layout`, `/inputs`, `/theme` and `/toast`). A component that
|
|
326
532
|
few screens use gets a path of its own and is not in the root.
|
|
327
533
|
- **Icons are Iconify icons, bundled and registered.** A component draws its icons with Iconify's
|
|
328
534
|
`Icon`, and the icon data is in the package (`toast-icons.ts`, `stepper-icons.ts`,
|
|
329
|
-
`theme-icons.ts`, registered with `addCollection`), so they show without a network and without
|
|
535
|
+
`theme-icons.ts`, `inputs-icons.ts`, `media-icons.ts`..., registered with `addCollection`), so they show without a network and without
|
|
330
536
|
waiting for the Iconify API. A component registers its own icons when it renders (not when its file
|
|
331
537
|
is imported), so an app only carries the icons of the components it uses. Iconify draws icons in the
|
|
332
538
|
browser only: on a server a placeholder is in their place (fine for the Vite apps).
|
|
@@ -338,6 +544,9 @@ The icons of the toasts are bundled, so a toast shows its icon without a network
|
|
|
338
544
|
import them again: importing them a second time, after the app's own css, would undo the app's
|
|
339
545
|
overrides.
|
|
340
546
|
- **No imports from an app.** What a component needs from its app comes in through props.
|
|
547
|
+
- **One entry imports another only through its `index`** (`../ui/index.js`, never `../ui/Button.js`): the build leaves such an import as an import of the public path, so a component is never bundled twice (`entries.test.ts` checks it).
|
|
548
|
+
- **Heavy or rare dependencies are optional peers, loaded when they are needed**: `hls.js` is `import()`ed when a stream is played, and `react-color-palette` is only imported by `/color-input`.
|
|
549
|
+
- **Words are props.** Every sentence a component says to assistive technology has a default in English and a prop (`labels`) to change it.
|
|
341
550
|
|
|
342
551
|
## Development
|
|
343
552
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MouseEvent, ReactElement } from 'react';
|
|
2
|
+
import type { IClassName } from '../types/component.js';
|
|
3
|
+
/** A service the person can sign in with. */
|
|
4
|
+
export interface ISocialProvider {
|
|
5
|
+
/** The name of the service ("Google"): the link says "Continue with Google". */
|
|
6
|
+
name: string;
|
|
7
|
+
/** An icon of Iconify (`'logos:google-icon'`) or any element. */
|
|
8
|
+
icon: string | ReactElement;
|
|
9
|
+
/** Where the sign in starts. */
|
|
10
|
+
href: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ISocialAuth extends IClassName {
|
|
13
|
+
providers: readonly ISocialProvider[];
|
|
14
|
+
/**
|
|
15
|
+
* Called when a provider is pressed, before the browser goes to its address: the place to remember
|
|
16
|
+
* where the person was, to bring them back after the sign in.
|
|
17
|
+
*/
|
|
18
|
+
onProviderClick?: (provider: ISocialProvider, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
19
|
+
/** What a link says to assistive technology. @default `Continue with ${provider.name}` */
|
|
20
|
+
getLabel?: (provider: ISocialProvider) => string;
|
|
21
|
+
/** The name of the group of links. @default 'Sign in with' */
|
|
22
|
+
label?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A row of icons, each a link that starts a sign in with a service (Google, GitHub...). They are plain
|
|
26
|
+
* links, because signing in with a service leaves the app for the page of the service: an
|
|
27
|
+
* `<a href>`, named "Continue with Google", that also works when opened in a new tab.
|
|
28
|
+
*
|
|
29
|
+
* The icons that are given by name come from the Iconify API unless the app has them registered
|
|
30
|
+
* (`addIcon()`), which also makes them show without a network.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SocialAuth: ({ providers, onProviderClick, getLabel, label, className, }: ISocialAuth) => import("react").JSX.Element | null;
|
|
33
|
+
//# sourceMappingURL=SocialAuth.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialAuth.d.cts","sourceRoot":"","sources":["../../src/auth/SocialAuth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5F,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,CAAC;IACjD,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,6DAMxB,WAAW,uCA6Bb,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MouseEvent, ReactElement } from 'react';
|
|
2
|
+
import type { IClassName } from '../types/component.js';
|
|
3
|
+
/** A service the person can sign in with. */
|
|
4
|
+
export interface ISocialProvider {
|
|
5
|
+
/** The name of the service ("Google"): the link says "Continue with Google". */
|
|
6
|
+
name: string;
|
|
7
|
+
/** An icon of Iconify (`'logos:google-icon'`) or any element. */
|
|
8
|
+
icon: string | ReactElement;
|
|
9
|
+
/** Where the sign in starts. */
|
|
10
|
+
href: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ISocialAuth extends IClassName {
|
|
13
|
+
providers: readonly ISocialProvider[];
|
|
14
|
+
/**
|
|
15
|
+
* Called when a provider is pressed, before the browser goes to its address: the place to remember
|
|
16
|
+
* where the person was, to bring them back after the sign in.
|
|
17
|
+
*/
|
|
18
|
+
onProviderClick?: (provider: ISocialProvider, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
19
|
+
/** What a link says to assistive technology. @default `Continue with ${provider.name}` */
|
|
20
|
+
getLabel?: (provider: ISocialProvider) => string;
|
|
21
|
+
/** The name of the group of links. @default 'Sign in with' */
|
|
22
|
+
label?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A row of icons, each a link that starts a sign in with a service (Google, GitHub...). They are plain
|
|
26
|
+
* links, because signing in with a service leaves the app for the page of the service: an
|
|
27
|
+
* `<a href>`, named "Continue with Google", that also works when opened in a new tab.
|
|
28
|
+
*
|
|
29
|
+
* The icons that are given by name come from the Iconify API unless the app has them registered
|
|
30
|
+
* (`addIcon()`), which also makes them show without a network.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SocialAuth: ({ providers, onProviderClick, getLabel, label, className, }: ISocialAuth) => import("react").JSX.Element | null;
|
|
33
|
+
//# sourceMappingURL=SocialAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialAuth.d.ts","sourceRoot":"","sources":["../../src/auth/SocialAuth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5F,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,CAAC;IACjD,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,6DAMxB,WAAW,uCA6Bb,CAAC"}
|
package/dist/auth/index.cjs
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var ui = require('@beautinique/frontend-components/ui');
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('@iconify/react');
|
|
4
6
|
|
|
5
7
|
var __defProp = Object.defineProperty;
|
|
6
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var BASE_CSS = "text-fill-transparent w-fit";
|
|
8
|
-
var FORCED_COLORS_CSS = "forced-colors:bg-none forced-colors:[-webkit-text-fill-color:currentColor]";
|
|
9
|
-
var GRADIENT_CSS = {
|
|
10
|
-
accent: "bg-accent-duo",
|
|
11
|
-
silver: "bg-silver-duo"
|
|
12
|
-
};
|
|
13
|
-
var GradientText = /* @__PURE__ */ __name(({
|
|
14
|
-
as,
|
|
15
|
-
type,
|
|
16
|
-
text,
|
|
17
|
-
children,
|
|
18
|
-
className = "",
|
|
19
|
-
...rest
|
|
20
|
-
}) => {
|
|
21
|
-
const Component = as ?? "span";
|
|
22
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
-
Component,
|
|
24
|
-
{
|
|
25
|
-
...rest,
|
|
26
|
-
className: `${BASE_CSS} ${GRADIENT_CSS[type]} ${FORCED_COLORS_CSS} ${className}`,
|
|
27
|
-
children: children ?? text
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}, "GradientText");
|
|
31
9
|
var defaultMessage = /* @__PURE__ */ __name(({ terms, privacy }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
32
10
|
"By continuing, you agree to our ",
|
|
33
11
|
terms,
|
|
@@ -49,7 +27,7 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
|
|
|
49
27
|
const Link = as ?? "a";
|
|
50
28
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { ...pProps, className: `text-tertiary text-xs ${className}`, children: message({
|
|
51
29
|
terms: /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
-
GradientText,
|
|
30
|
+
ui.GradientText,
|
|
53
31
|
{
|
|
54
32
|
...terms,
|
|
55
33
|
as: Link,
|
|
@@ -59,7 +37,7 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
|
|
|
59
37
|
}
|
|
60
38
|
),
|
|
61
39
|
privacy: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
-
GradientText,
|
|
40
|
+
ui.GradientText,
|
|
63
41
|
{
|
|
64
42
|
...privacy,
|
|
65
43
|
as: Link,
|
|
@@ -70,7 +48,37 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
|
|
|
70
48
|
)
|
|
71
49
|
}) });
|
|
72
50
|
}, "AuthBottomInstructions");
|
|
51
|
+
var defaultGetLabel = /* @__PURE__ */ __name((provider) => `Continue with ${provider.name}`, "defaultGetLabel");
|
|
52
|
+
var SocialAuth = /* @__PURE__ */ __name(({
|
|
53
|
+
providers,
|
|
54
|
+
onProviderClick,
|
|
55
|
+
getLabel = defaultGetLabel,
|
|
56
|
+
label = "Sign in with",
|
|
57
|
+
className = ""
|
|
58
|
+
}) => {
|
|
59
|
+
if (providers.length === 0) return null;
|
|
60
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { "aria-label": label, className: `flex items-center justify-center gap-4 ${className}`, children: providers.map((provider) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
"a",
|
|
62
|
+
{
|
|
63
|
+
href: provider.href,
|
|
64
|
+
"aria-label": getLabel(provider),
|
|
65
|
+
className: "block rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c",
|
|
66
|
+
onClick: (event) => {
|
|
67
|
+
onProviderClick?.(provider, event);
|
|
68
|
+
},
|
|
69
|
+
children: typeof provider.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
+
react.Icon,
|
|
71
|
+
{
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
icon: provider.icon,
|
|
74
|
+
className: "border-primary/40 shadow-primary/50 h-12 w-12 shrink-0 rounded-xl border bg-white/90 p-2.5 shadow-sm backdrop-blur-sm transition-transform duration-500 hover:scale-110 motion-reduce:transition-none"
|
|
75
|
+
}
|
|
76
|
+
) : provider.icon
|
|
77
|
+
}
|
|
78
|
+
) }, provider.name)) });
|
|
79
|
+
}, "SocialAuth");
|
|
73
80
|
|
|
74
81
|
exports.AuthBottomInstructions = AuthBottomInstructions;
|
|
82
|
+
exports.SocialAuth = SocialAuth;
|
|
75
83
|
//# sourceMappingURL=index.cjs.map
|
|
76
84
|
//# sourceMappingURL=index.cjs.map
|
package/dist/auth/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/auth/AuthBottomInstructions.tsx","../../src/auth/SocialAuth.tsx"],"names":["jsxs","Fragment","jsx","GradientText","Icon"],"mappings":";;;;;;;;AA6CA,IAAM,iCAAiB,MAAA,CAAA,CAAC,EAAE,KAAA,EAAO,OAAA,uBAC/BA,eAAA,CAAAC,mBAAA,EAAA,EAAE,QAAA,EAAA;AAAA,EAAA,kCAAA;AAAA,EACiC,KAAA;AAAA,EAAM,OAAA;AAAA,EAAM,OAAA;AAAA,EAAQ;AAAA,CAAA,EACvD,CAAA,EAHqB,gBAAA,CAAA;AAMvB,IAAM,QAAA,GAAW,aAAA;AAMV,IAAM,yCAAyB,MAAA,CAAA,CAAgC;AAAA,EACpE,EAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA,GAAa,oBAAA;AAAA,EACb,YAAA,GAAe,gBAAA;AAAA,EACf,OAAA,GAAU,cAAA;AAAA,EACV,SAAA,GAAY,EAAA;AAAA,EACZ,GAAG;AACL,CAAA,KAAoC;AAClC,EAAA,MAAM,OAAoB,EAAA,IAAM,GAAA;AAEhC,EAAA,uBACEC,cAAA,CAAC,OAAG,GAAG,MAAA,EAAQ,WAAW,CAAA,sBAAA,EAAyB,SAAS,IACzD,QAAA,EAAA,OAAA,CAAQ;AAAA,IACP,KAAA,kBACEA,cAAA;AAAA,MAACC,eAAA;AAAA,MAAA;AAAA,QACE,GAAI,KAAA;AAAA,QACL,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAK,QAAA;AAAA,QACL,IAAA,EAAM,UAAA;AAAA,QACN,SAAA,EAAW;AAAA;AAAA,KACb;AAAA,IAEF,OAAA,kBACED,cAAA;AAAA,MAACC,eAAA;AAAA,MAAA;AAAA,QACE,GAAI,OAAA;AAAA,QACL,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAK,QAAA;AAAA,QACL,IAAA,EAAM,YAAA;AAAA,QACN,SAAA,EAAW;AAAA;AAAA;AACb,GAEH,CAAA,EACH,CAAA;AAEJ,CAAA,EApCsC,wBAAA;AC7BtC,IAAM,kCAAkB,MAAA,CAAA,CAAC,QAAA,KAA8B,CAAA,cAAA,EAAiB,QAAA,CAAS,IAAI,CAAA,CAAA,EAA7D,iBAAA,CAAA;AAUjB,IAAM,6BAAa,MAAA,CAAA,CAAC;AAAA,EACzB,SAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA,GAAW,eAAA;AAAA,EACX,KAAA,GAAQ,cAAA;AAAA,EACR,SAAA,GAAY;AACd,CAAA,KAAmB;AACjB,EAAA,IAAI,SAAA,CAAU,MAAA,KAAW,CAAA,EAAG,OAAO,IAAA;AAEnC,EAAA,uBACED,cAAAA,CAAC,IAAA,EAAA,EAAG,YAAA,EAAY,KAAA,EAAO,WAAW,CAAA,uCAAA,EAA0C,SAAS,CAAA,CAAA,EAClF,QAAA,EAAA,SAAA,CAAU,IAAI,CAAC,QAAA,qBACdA,cAAAA,CAAC,QACC,QAAA,kBAAAA,cAAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,MAAM,QAAA,CAAS,IAAA;AAAA,MACf,YAAA,EAAY,SAAS,QAAQ,CAAA;AAAA,MAC7B,SAAA,EAAU,8GAAA;AAAA,MACV,OAAA,EAAS,CAAC,KAAA,KAAU;AAClB,QAAA,eAAA,GAAkB,UAAU,KAAK,CAAA;AAAA,MACnC,CAAA;AAAA,MAEC,QAAA,EAAA,OAAO,QAAA,CAAS,IAAA,KAAS,QAAA,mBACxBA,cAAAA;AAAA,QAACE,UAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAY,MAAA;AAAA,UACZ,MAAM,QAAA,CAAS,IAAA;AAAA,UACf,SAAA,EAAU;AAAA;AAAA,UAGZ,QAAA,CAAS;AAAA;AAAA,GAEb,EAAA,EAlBO,QAAA,CAAS,IAmBlB,CACD,CAAA,EACH,CAAA;AAEJ,CAAA,EAnC0B,YAAA","file":"index.cjs","sourcesContent":["import type { ComponentProps, ComponentPropsWithRef, ElementType, ReactNode } from 'react';\n\nimport { GradientText } from '../ui/index.js';\n\n/**\n * What the link to a page needs, as the component that makes the link asks for it: `{ to: '/terms' }`\n * for the `Link` of a router, `{ href: '/terms' }` for a plain `<a>` (which has to have one).\n */\nexport type TAuthLinkProps<TAs extends ElementType> = Omit<\n ComponentPropsWithRef<TAs>,\n 'children' | 'className' | 'text' | 'type'\n> &\n (TAs extends 'a' ? { href: string } : unknown);\n\n/** The two links of the sentence, ready to be put in it. */\nexport interface IAuthLinks {\n terms: ReactNode;\n privacy: ReactNode;\n}\n\ninterface IAuthBottomInstructionsOwnProps<TAs extends ElementType> {\n /**\n * What makes the links: `'a'`, or the `Link` of the router of the app. The router is the app's,\n * not this package's.\n * @default 'a'\n */\n as?: TAs;\n /** The link to the terms and conditions, in the props of `as`. */\n terms: TAuthLinkProps<TAs>;\n /** The link to the privacy policy, in the props of `as`. */\n privacy: TAuthLinkProps<TAs>;\n /** @default 'Terms & Conditions' */\n termsLabel?: string;\n /** @default 'Privacy Policy' */\n privacyLabel?: string;\n /**\n * The sentence around the two links, for another wording or another language.\n * @default ({ terms, privacy }) => <>By continuing, you agree to our {terms} and {privacy}.</>\n */\n message?: (links: IAuthLinks) => ReactNode;\n}\n\nexport type IAuthBottomInstructions<TAs extends ElementType = 'a'> =\n IAuthBottomInstructionsOwnProps<TAs> & Omit<ComponentProps<'p'>, 'children'>;\n\nconst defaultMessage = ({ terms, privacy }: IAuthLinks) => (\n <>\n By continuing, you agree to our {terms} and {privacy}.\n </>\n);\n\nconst LINK_CSS = 'font-medium';\n\n/**\n * The small print under a sign-in or sign-up form: that going on means accepting the terms and the\n * privacy policy, with a link to each.\n */\nexport const AuthBottomInstructions = <TAs extends ElementType = 'a'>({\n as,\n terms,\n privacy,\n termsLabel = 'Terms & Conditions',\n privacyLabel = 'Privacy Policy',\n message = defaultMessage,\n className = '',\n ...pProps\n}: IAuthBottomInstructions<TAs>) => {\n const Link: ElementType = as ?? 'a';\n\n return (\n <p {...pProps} className={`text-tertiary text-xs ${className}`}>\n {message({\n terms: (\n <GradientText\n {...(terms as object)}\n as={Link}\n type=\"accent\"\n text={termsLabel}\n className={LINK_CSS}\n />\n ),\n privacy: (\n <GradientText\n {...(privacy as object)}\n as={Link}\n type=\"accent\"\n text={privacyLabel}\n className={LINK_CSS}\n />\n ),\n })}\n </p>\n );\n};\n","import { Icon } from '@iconify/react';\nimport type { MouseEvent, ReactElement } from 'react';\n\nimport type { IClassName } from '../types/component.js';\n\n/** A service the person can sign in with. */\nexport interface ISocialProvider {\n /** The name of the service (\"Google\"): the link says \"Continue with Google\". */\n name: string;\n /** An icon of Iconify (`'logos:google-icon'`) or any element. */\n icon: string | ReactElement;\n /** Where the sign in starts. */\n href: string;\n}\n\nexport interface ISocialAuth extends IClassName {\n providers: readonly ISocialProvider[];\n /**\n * Called when a provider is pressed, before the browser goes to its address: the place to remember\n * where the person was, to bring them back after the sign in.\n */\n onProviderClick?: (provider: ISocialProvider, event: MouseEvent<HTMLAnchorElement>) => void;\n /** What a link says to assistive technology. @default `Continue with ${provider.name}` */\n getLabel?: (provider: ISocialProvider) => string;\n /** The name of the group of links. @default 'Sign in with' */\n label?: string;\n}\n\nconst defaultGetLabel = (provider: ISocialProvider) => `Continue with ${provider.name}`;\n\n/**\n * A row of icons, each a link that starts a sign in with a service (Google, GitHub...). They are plain\n * links, because signing in with a service leaves the app for the page of the service: an\n * `<a href>`, named \"Continue with Google\", that also works when opened in a new tab.\n *\n * The icons that are given by name come from the Iconify API unless the app has them registered\n * (`addIcon()`), which also makes them show without a network.\n */\nexport const SocialAuth = ({\n providers,\n onProviderClick,\n getLabel = defaultGetLabel,\n label = 'Sign in with',\n className = '',\n}: ISocialAuth) => {\n if (providers.length === 0) return null;\n\n return (\n <ul aria-label={label} className={`flex items-center justify-center gap-4 ${className}`}>\n {providers.map((provider) => (\n <li key={provider.name}>\n <a\n href={provider.href}\n aria-label={getLabel(provider)}\n className=\"block rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c\"\n onClick={(event) => {\n onProviderClick?.(provider, event);\n }}\n >\n {typeof provider.icon === 'string' ? (\n <Icon\n aria-hidden=\"true\"\n icon={provider.icon}\n className=\"border-primary/40 shadow-primary/50 h-12 w-12 shrink-0 rounded-xl border bg-white/90 p-2.5 shadow-sm backdrop-blur-sm transition-transform duration-500 hover:scale-110 motion-reduce:transition-none\"\n />\n ) : (\n provider.icon\n )}\n </a>\n </li>\n ))}\n </ul>\n );\n};\n"]}
|
package/dist/auth/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/auth/index.d.ts
CHANGED
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/auth/index.js
CHANGED
|
@@ -1,31 +1,9 @@
|
|
|
1
|
+
import { GradientText } from '@beautinique/frontend-components/ui';
|
|
1
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { Icon } from '@iconify/react';
|
|
2
4
|
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
4
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
var BASE_CSS = "text-fill-transparent w-fit";
|
|
6
|
-
var FORCED_COLORS_CSS = "forced-colors:bg-none forced-colors:[-webkit-text-fill-color:currentColor]";
|
|
7
|
-
var GRADIENT_CSS = {
|
|
8
|
-
accent: "bg-accent-duo",
|
|
9
|
-
silver: "bg-silver-duo"
|
|
10
|
-
};
|
|
11
|
-
var GradientText = /* @__PURE__ */ __name(({
|
|
12
|
-
as,
|
|
13
|
-
type,
|
|
14
|
-
text,
|
|
15
|
-
children,
|
|
16
|
-
className = "",
|
|
17
|
-
...rest
|
|
18
|
-
}) => {
|
|
19
|
-
const Component = as ?? "span";
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
Component,
|
|
22
|
-
{
|
|
23
|
-
...rest,
|
|
24
|
-
className: `${BASE_CSS} ${GRADIENT_CSS[type]} ${FORCED_COLORS_CSS} ${className}`,
|
|
25
|
-
children: children ?? text
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
}, "GradientText");
|
|
29
7
|
var defaultMessage = /* @__PURE__ */ __name(({ terms, privacy }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
8
|
"By continuing, you agree to our ",
|
|
31
9
|
terms,
|
|
@@ -68,7 +46,36 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
|
|
|
68
46
|
)
|
|
69
47
|
}) });
|
|
70
48
|
}, "AuthBottomInstructions");
|
|
49
|
+
var defaultGetLabel = /* @__PURE__ */ __name((provider) => `Continue with ${provider.name}`, "defaultGetLabel");
|
|
50
|
+
var SocialAuth = /* @__PURE__ */ __name(({
|
|
51
|
+
providers,
|
|
52
|
+
onProviderClick,
|
|
53
|
+
getLabel = defaultGetLabel,
|
|
54
|
+
label = "Sign in with",
|
|
55
|
+
className = ""
|
|
56
|
+
}) => {
|
|
57
|
+
if (providers.length === 0) return null;
|
|
58
|
+
return /* @__PURE__ */ jsx("ul", { "aria-label": label, className: `flex items-center justify-center gap-4 ${className}`, children: providers.map((provider) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
59
|
+
"a",
|
|
60
|
+
{
|
|
61
|
+
href: provider.href,
|
|
62
|
+
"aria-label": getLabel(provider),
|
|
63
|
+
className: "block rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c",
|
|
64
|
+
onClick: (event) => {
|
|
65
|
+
onProviderClick?.(provider, event);
|
|
66
|
+
},
|
|
67
|
+
children: typeof provider.icon === "string" ? /* @__PURE__ */ jsx(
|
|
68
|
+
Icon,
|
|
69
|
+
{
|
|
70
|
+
"aria-hidden": "true",
|
|
71
|
+
icon: provider.icon,
|
|
72
|
+
className: "border-primary/40 shadow-primary/50 h-12 w-12 shrink-0 rounded-xl border bg-white/90 p-2.5 shadow-sm backdrop-blur-sm transition-transform duration-500 hover:scale-110 motion-reduce:transition-none"
|
|
73
|
+
}
|
|
74
|
+
) : provider.icon
|
|
75
|
+
}
|
|
76
|
+
) }, provider.name)) });
|
|
77
|
+
}, "SocialAuth");
|
|
71
78
|
|
|
72
|
-
export { AuthBottomInstructions };
|
|
79
|
+
export { AuthBottomInstructions, SocialAuth };
|
|
73
80
|
//# sourceMappingURL=index.js.map
|
|
74
81
|
//# sourceMappingURL=index.js.map
|