@beautinique/frontend-components 1.0.7 → 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 +389 -14
- package/dist/auth/AuthBottomInstructions.d.cts +42 -0
- package/dist/auth/AuthBottomInstructions.d.cts.map +1 -0
- package/dist/auth/AuthBottomInstructions.d.ts +42 -0
- package/dist/auth/AuthBottomInstructions.d.ts.map +1 -0
- 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 +84 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +3 -0
- package/dist/auth/index.d.cts.map +1 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +81 -0
- package/dist/auth/index.js.map +1 -0
- 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 +21 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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/ScrollToTop.d.cts +36 -0
- package/dist/layout/ScrollToTop.d.cts.map +1 -0
- package/dist/layout/ScrollToTop.d.ts +36 -0
- package/dist/layout/ScrollToTop.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 +773 -0
- package/dist/layout/index.cjs.map +1 -0
- package/dist/layout/index.d.cts +14 -0
- package/dist/layout/index.d.cts.map +1 -0
- package/dist/layout/index.d.ts +14 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +753 -0
- package/dist/layout/index.js.map +1 -0
- 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/content.d.cts +7 -0
- package/dist/lib/content.d.cts.map +1 -0
- package/dist/lib/content.d.ts +7 -0
- package/dist/lib/content.d.ts.map +1 -0
- package/dist/lib/countdown.d.cts +13 -0
- package/dist/lib/countdown.d.cts.map +1 -0
- package/dist/lib/countdown.d.ts +13 -0
- package/dist/lib/countdown.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/stepper.d.cts +9 -0
- package/dist/lib/stepper.d.cts.map +1 -0
- package/dist/lib/stepper.d.ts +9 -0
- package/dist/lib/stepper.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/linear-gradient/LinearGradient.d.cts +13 -0
- package/dist/linear-gradient/LinearGradient.d.cts.map +1 -0
- package/dist/linear-gradient/LinearGradient.d.ts +13 -0
- package/dist/linear-gradient/LinearGradient.d.ts.map +1 -0
- package/dist/linear-gradient/index.cjs +25 -0
- package/dist/linear-gradient/index.cjs.map +1 -0
- package/dist/linear-gradient/index.d.cts +2 -0
- package/dist/linear-gradient/index.d.cts.map +1 -0
- package/dist/linear-gradient/index.d.ts +2 -0
- package/dist/linear-gradient/index.d.ts.map +1 -0
- package/dist/linear-gradient/index.js +23 -0
- package/dist/linear-gradient/index.js.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/Resend.d.cts +37 -0
- package/dist/resend/Resend.d.cts.map +1 -0
- package/dist/resend/Resend.d.ts +37 -0
- package/dist/resend/Resend.d.ts.map +1 -0
- package/dist/resend/index.cjs +115 -0
- package/dist/resend/index.cjs.map +1 -0
- package/dist/resend/index.d.cts +2 -0
- package/dist/resend/index.d.cts.map +1 -0
- package/dist/resend/index.d.ts +2 -0
- package/dist/resend/index.d.ts.map +1 -0
- package/dist/resend/index.js +113 -0
- package/dist/resend/index.js.map +1 -0
- 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/stepper/Stepper.d.cts +35 -0
- package/dist/stepper/Stepper.d.cts.map +1 -0
- package/dist/stepper/Stepper.d.ts +35 -0
- package/dist/stepper/Stepper.d.ts.map +1 -0
- package/dist/stepper/index.cjs +149 -0
- package/dist/stepper/index.cjs.map +1 -0
- package/dist/stepper/index.d.cts +2 -0
- package/dist/stepper/index.d.cts.map +1 -0
- package/dist/stepper/index.d.ts +2 -0
- package/dist/stepper/index.d.ts.map +1 -0
- package/dist/stepper/index.js +147 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/stepper/stepper-icons.d.cts +10 -0
- package/dist/stepper/stepper-icons.d.cts.map +1 -0
- package/dist/stepper/stepper-icons.d.ts +10 -0
- package/dist/stepper/stepper-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/theme/Theme.d.cts +23 -0
- package/dist/theme/Theme.d.cts.map +1 -0
- package/dist/theme/Theme.d.ts +23 -0
- package/dist/theme/Theme.d.ts.map +1 -0
- package/dist/theme/index.cjs +76 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +2 -0
- package/dist/theme/index.d.cts.map +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +74 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-icons.d.cts +21 -0
- package/dist/theme/theme-icons.d.cts.map +1 -0
- package/dist/theme/theme-icons.d.ts +21 -0
- package/dist/theme/theme-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/dist/ui/Badge.d.cts +12 -0
- package/dist/ui/Badge.d.cts.map +1 -0
- package/dist/ui/Badge.d.ts +12 -0
- package/dist/ui/Badge.d.ts.map +1 -0
- package/dist/ui/Divider.d.cts +12 -0
- package/dist/ui/Divider.d.cts.map +1 -0
- package/dist/ui/Divider.d.ts +12 -0
- package/dist/ui/Divider.d.ts.map +1 -0
- package/dist/ui/GradientText.d.cts +30 -0
- package/dist/ui/GradientText.d.cts.map +1 -0
- package/dist/ui/GradientText.d.ts +30 -0
- package/dist/ui/GradientText.d.ts.map +1 -0
- package/dist/ui/index.cjs +37 -3
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +3 -0
- package/dist/ui/index.d.cts.map +1 -1
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +35 -4
- package/dist/ui/index.js.map +1 -1
- package/package.json +108 -6
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,21 +36,40 @@ 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
|
|
33
|
-
use have a path of their own
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
| `@beautinique/frontend-components
|
|
39
|
-
| `@beautinique/frontend-components/
|
|
40
|
-
| `@beautinique/frontend-components/
|
|
41
|
-
|
|
42
|
-
`
|
|
39
|
+
Components that most screens use live in `/ui`, `/layout`, `/inputs`, `/theme` and `/toast`, and the root gives
|
|
40
|
+
all of them. Components that few screens use have a path of their own and are **not** in the root, so
|
|
41
|
+
an app only bundles what it imports.
|
|
42
|
+
|
|
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 |
|
|
64
|
+
|
|
65
|
+
What the root gives can be imported from the root or from its own path, it is the same component
|
|
66
|
+
either way:
|
|
43
67
|
|
|
44
68
|
```ts
|
|
45
69
|
import { Button } from '@beautinique/frontend-components'; // or
|
|
46
70
|
import { Button } from '@beautinique/frontend-components/ui';
|
|
71
|
+
|
|
72
|
+
import { Stepper } from '@beautinique/frontend-components/stepper'; // only from its own path
|
|
47
73
|
```
|
|
48
74
|
|
|
49
75
|
The root only re-exports, it does not copy: an app that imports only `Button` from the root bundles the
|
|
@@ -110,6 +136,343 @@ const hint = (
|
|
|
110
136
|
that is not there at all: the content is one level deeper in the DOM, so a css rule that looks at
|
|
111
137
|
the parent of the content (`space-y-*` on a parent, `> :first-child`) sees the wrapper.
|
|
112
138
|
|
|
139
|
+
### Badge, Divider, GradientText
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
import { Badge, Divider, GradientText } from '@beautinique/frontend-components';
|
|
143
|
+
|
|
144
|
+
<Badge content="New" />; // `content` is any React content: text, a number, an icon and a text
|
|
145
|
+
<Badge content={count > 0 && count} />; // nothing to show (null, undefined, false, '') draws no badge; 0 is shown
|
|
146
|
+
<Divider aria-hidden="true" />; // an <hr>; hide it from screen readers when it is only a line
|
|
147
|
+
<GradientText type="accent" text="Terms" />; // or <GradientText type="silver">any <b>content</b></GradientText>
|
|
148
|
+
<GradientText as={Link} to="/terms" type="accent" text="Terms" />; // the Link of the router, with its props
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- All three take the attributes of their element (`id`, `data-*`, `aria-*`, `ref`...), and the
|
|
152
|
+
classes you give are added after their own.
|
|
153
|
+
- `GradientText` takes `text` **or** `children`, not both (the compiler says so). In forced-colors mode
|
|
154
|
+
(Windows high contrast), where a gradient is not drawn, the text takes the colour of the system
|
|
155
|
+
instead of vanishing.
|
|
156
|
+
|
|
157
|
+
### LinearGradient
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
import { LinearGradient } from '@beautinique/frontend-components/linear-gradient';
|
|
161
|
+
|
|
162
|
+
<div className="relative overflow-x-auto">
|
|
163
|
+
<LinearGradient position="left" />
|
|
164
|
+
{/* the scrolling content */}
|
|
165
|
+
<LinearGradient position="right" />
|
|
166
|
+
</div>;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
A fade in the background colour over one edge (`top`, `bottom`, `left` or `right`) of a `relative`
|
|
170
|
+
container: it shows that there is more to scroll. It is decoration: the pointer goes through it and
|
|
171
|
+
assistive technology skips it.
|
|
172
|
+
|
|
173
|
+
### Stepper
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
import { Stepper } from '@beautinique/frontend-components/stepper';
|
|
177
|
+
|
|
178
|
+
<Stepper
|
|
179
|
+
label="Checkout progress"
|
|
180
|
+
activeStep={1}
|
|
181
|
+
steps={[
|
|
182
|
+
{ title: 'Account', description: 'Create your account' },
|
|
183
|
+
{ title: 'Address', description: 'Where to deliver', icon: 'solar:map-point-linear' },
|
|
184
|
+
{ title: 'Payment', disabled: true },
|
|
185
|
+
]}
|
|
186
|
+
onStepClick={(index) => setStep(index)} // optional: with it the steps are buttons
|
|
187
|
+
>
|
|
188
|
+
{/* optional: shown under the steps */}
|
|
189
|
+
</Stepper>;
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
- The steps are an ordered list and the current one has `aria-current="step"`. A completed step shows a
|
|
193
|
+
tick, and says "Completed" to a screen reader (`completedLabel` for another word).
|
|
194
|
+
- `activeStep` is kept inside the steps (`99` is the last one, `NaN` the first).
|
|
195
|
+
- With `onStepClick` the steps are real buttons (keyboard, focus ring); a step with `disabled` cannot be
|
|
196
|
+
clicked. Without it nothing in the stepper is a button.
|
|
197
|
+
- The tick is bundled with the package (registered with Iconify when a stepper renders), so it needs no
|
|
198
|
+
network. The `icon` of a step is an Iconify name that Iconify downloads the first time it is shown;
|
|
199
|
+
to have one offline, add it to the app with `addCollection`.
|
|
200
|
+
|
|
201
|
+
### Resend
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
import { Resend } from '@beautinique/frontend-components/resend';
|
|
205
|
+
|
|
206
|
+
<Resend
|
|
207
|
+
label="Not received OTP?"
|
|
208
|
+
count={sendCount >= 3 ? 0 : 30} // seconds to wait; 0 = no wait
|
|
209
|
+
onResend={handleResendOtp} // may return a promise
|
|
210
|
+
/>;
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
- "Resend in 30s", and when the wait is over a button. The wait starts when the component is shown and
|
|
214
|
+
again after each resend, with the `count` of that moment. A new email address? Give it a new `key`.
|
|
215
|
+
- **It is measured against the clock**, not counted tick by tick: a background tab, or a laptop that
|
|
216
|
+
slept, does not make people wait longer than the time that really went by.
|
|
217
|
+
- If `onResend` returns a promise the button waits for it (disabled, "Sending…", no double click)
|
|
218
|
+
and the wait starts when it resolves. If it rejects there is no wait, the button can be pressed
|
|
219
|
+
again and the error is reported to `window` (`reportError`). Handle the errors you can recover
|
|
220
|
+
from (a toast) inside it.
|
|
221
|
+
- A screen reader is not told the number every second (`role="timer"`), but is told once when the
|
|
222
|
+
button is back. The words (`resendLabel`, `countdownLabel`, `sendingLabel`, `readyLabel`,
|
|
223
|
+
`formatSeconds`) can be changed for another language.
|
|
224
|
+
|
|
225
|
+
### Theme
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
import { Theme } from '@beautinique/frontend-components';
|
|
229
|
+
import { createThemeStore } from '@beautinique/frontend-stores';
|
|
230
|
+
|
|
231
|
+
export const useThemeStore = createThemeStore(); // once, in a module of the app
|
|
232
|
+
|
|
233
|
+
<Theme store={useThemeStore} />;
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
A button that switches between the dark and the light theme (a sun while it is dark, a moon while it
|
|
237
|
+
is light). It only changes the store, which remembers the choice; putting the theme on the page is the
|
|
238
|
+
app's. Its name for assistive technology follows the theme ("Switch to light theme"; `labels` changes
|
|
239
|
+
the words). The icons move; for a person who asked for less motion (`prefers-reduced-motion`) it
|
|
240
|
+
shows still ones.
|
|
241
|
+
|
|
242
|
+
### ScrollToTop
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import { ScrollToTop } from '@beautinique/frontend-components';
|
|
246
|
+
|
|
247
|
+
const { pathname } = useLocation(); // from the router of the app
|
|
248
|
+
|
|
249
|
+
<div id="main">
|
|
250
|
+
<ScrollToTop pathname={pathname} />
|
|
251
|
+
</div>;
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Scrolls the element with `id="main"` to its top each time `pathname` changes (a router does not do it
|
|
255
|
+
for a single page app). It draws nothing. `id`, `behavior`, `block` and `inline` are the `id` of the
|
|
256
|
+
element and the options of `scrollIntoView` (`'auto'`, `'start'` and `'nearest'` unless told another);
|
|
257
|
+
a `'smooth'` scroll is made `'auto'` for a person who asked for less motion. `skipInitial` leaves the
|
|
258
|
+
first page where it is (when the browser restores the scroll on a reload).
|
|
259
|
+
|
|
260
|
+
### AuthBottomInstructions
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
import { AuthBottomInstructions } from '@beautinique/frontend-components/auth';
|
|
264
|
+
import { Link } from 'react-router-dom';
|
|
265
|
+
|
|
266
|
+
<AuthBottomInstructions as={Link} terms={{ to: '/terms' }} privacy={{ to: '/privacy' }} />;
|
|
267
|
+
// "By continuing, you agree to our Terms & Conditions and Privacy Policy."
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The small print under a sign-in form. `as` is what makes the links (`'a'` unless told another; for `'a'`
|
|
271
|
+
the compiler asks for `href`), `terms` and `privacy` are the props of those links. `termsLabel`,
|
|
272
|
+
`privacyLabel` and `message` change the words:
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
<AuthBottomInstructions
|
|
276
|
+
terms={{ href: '/terms' }}
|
|
277
|
+
privacy={{ href: '/privacy' }}
|
|
278
|
+
message={({ terms, privacy }) => (
|
|
279
|
+
<>
|
|
280
|
+
Entering means you accept our {terms} and our {privacy}.
|
|
281
|
+
</>
|
|
282
|
+
)}
|
|
283
|
+
/>
|
|
284
|
+
```
|
|
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
|
+
|
|
113
476
|
### Toasts
|
|
114
477
|
|
|
115
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.
|
|
@@ -164,14 +527,26 @@ The icons of the toasts are bundled, so a toast shows its icon without a network
|
|
|
164
527
|
|
|
165
528
|
## Rules for the code of this package
|
|
166
529
|
|
|
167
|
-
- **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` and `/toast` (`tsup.config.ts` keeps them external, and `built-files.test.ts` checks the built files after `npm run build`).
|
|
168
|
-
- **The root has what most screens use** (`/ui`,
|
|
169
|
-
screens use gets a path of its own and is not in the root.
|
|
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
|
|
532
|
+
few screens use gets a path of its own and is not in the root.
|
|
533
|
+
- **Icons are Iconify icons, bundled and registered.** A component draws its icons with Iconify's
|
|
534
|
+
`Icon`, and the icon data is in the package (`toast-icons.ts`, `stepper-icons.ts`,
|
|
535
|
+
`theme-icons.ts`, `inputs-icons.ts`, `media-icons.ts`..., registered with `addCollection`), so they show without a network and without
|
|
536
|
+
waiting for the Iconify API. A component registers its own icons when it renders (not when its file
|
|
537
|
+
is imported), so an app only carries the icons of the components it uses. Iconify draws icons in the
|
|
538
|
+
browser only: on a server a placeholder is in their place (fine for the Vite apps).
|
|
539
|
+
- **Components are accessible by default**: real elements (`button`, `ol`, `hr`), names for what has no
|
|
540
|
+
text, a focus ring for the keyboard (`focus-visible`), `prefers-reduced-motion` and forced-colors
|
|
541
|
+
mode taken care of, and nothing that moves or announces every second.
|
|
170
542
|
- **A component's own css lives next to the component** and is imported by it, not by the styles
|
|
171
543
|
package. It uses the variables of the styles package (`var(--smoke-eerie)`, ...) and does not
|
|
172
544
|
import them again: importing them a second time, after the app's own css, would undo the app's
|
|
173
545
|
overrides.
|
|
174
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.
|
|
175
550
|
|
|
176
551
|
## Development
|
|
177
552
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComponentProps, ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What the link to a page needs, as the component that makes the link asks for it: `{ to: '/terms' }`
|
|
4
|
+
* for the `Link` of a router, `{ href: '/terms' }` for a plain `<a>` (which has to have one).
|
|
5
|
+
*/
|
|
6
|
+
export type TAuthLinkProps<TAs extends ElementType> = Omit<ComponentPropsWithRef<TAs>, 'children' | 'className' | 'text' | 'type'> & (TAs extends 'a' ? {
|
|
7
|
+
href: string;
|
|
8
|
+
} : unknown);
|
|
9
|
+
/** The two links of the sentence, ready to be put in it. */
|
|
10
|
+
export interface IAuthLinks {
|
|
11
|
+
terms: ReactNode;
|
|
12
|
+
privacy: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
interface IAuthBottomInstructionsOwnProps<TAs extends ElementType> {
|
|
15
|
+
/**
|
|
16
|
+
* What makes the links: `'a'`, or the `Link` of the router of the app. The router is the app's,
|
|
17
|
+
* not this package's.
|
|
18
|
+
* @default 'a'
|
|
19
|
+
*/
|
|
20
|
+
as?: TAs;
|
|
21
|
+
/** The link to the terms and conditions, in the props of `as`. */
|
|
22
|
+
terms: TAuthLinkProps<TAs>;
|
|
23
|
+
/** The link to the privacy policy, in the props of `as`. */
|
|
24
|
+
privacy: TAuthLinkProps<TAs>;
|
|
25
|
+
/** @default 'Terms & Conditions' */
|
|
26
|
+
termsLabel?: string;
|
|
27
|
+
/** @default 'Privacy Policy' */
|
|
28
|
+
privacyLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The sentence around the two links, for another wording or another language.
|
|
31
|
+
* @default ({ terms, privacy }) => <>By continuing, you agree to our {terms} and {privacy}.</>
|
|
32
|
+
*/
|
|
33
|
+
message?: (links: IAuthLinks) => ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export type IAuthBottomInstructions<TAs extends ElementType = 'a'> = IAuthBottomInstructionsOwnProps<TAs> & Omit<ComponentProps<'p'>, 'children'>;
|
|
36
|
+
/**
|
|
37
|
+
* The small print under a sign-in or sign-up form: that going on means accepting the terms and the
|
|
38
|
+
* privacy policy, with a link to each.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AuthBottomInstructions: <TAs extends ElementType = "a">({ as, terms, privacy, termsLabel, privacyLabel, message, className, ...pProps }: IAuthBottomInstructions<TAs>) => import("react").JSX.Element;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=AuthBottomInstructions.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthBottomInstructions.d.cts","sourceRoot":"","sources":["../../src/auth/AuthBottomInstructions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3F;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,WAAW,IAAI,IAAI,CACxD,qBAAqB,CAAC,GAAG,CAAC,EAC1B,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAC3C,GACC,CAAC,GAAG,SAAS,GAAG,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,CAAC;AAEjD,4DAA4D;AAC5D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,+BAA+B,CAAC,GAAG,SAAS,WAAW;IAC/D;;;;OAIG;IACH,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,kEAAkE;IAClE,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3B,4DAA4D;IAC5D,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC;CAC5C;AAED,MAAM,MAAM,uBAAuB,CAAC,GAAG,SAAS,WAAW,GAAG,GAAG,IAC/D,+BAA+B,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;AAU/E;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,GAAG,SAAS,WAAW,GAAG,GAAG,EAAE,iFASnE,uBAAuB,CAAC,GAAG,CAAC,gCA2B9B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComponentProps, ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What the link to a page needs, as the component that makes the link asks for it: `{ to: '/terms' }`
|
|
4
|
+
* for the `Link` of a router, `{ href: '/terms' }` for a plain `<a>` (which has to have one).
|
|
5
|
+
*/
|
|
6
|
+
export type TAuthLinkProps<TAs extends ElementType> = Omit<ComponentPropsWithRef<TAs>, 'children' | 'className' | 'text' | 'type'> & (TAs extends 'a' ? {
|
|
7
|
+
href: string;
|
|
8
|
+
} : unknown);
|
|
9
|
+
/** The two links of the sentence, ready to be put in it. */
|
|
10
|
+
export interface IAuthLinks {
|
|
11
|
+
terms: ReactNode;
|
|
12
|
+
privacy: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
interface IAuthBottomInstructionsOwnProps<TAs extends ElementType> {
|
|
15
|
+
/**
|
|
16
|
+
* What makes the links: `'a'`, or the `Link` of the router of the app. The router is the app's,
|
|
17
|
+
* not this package's.
|
|
18
|
+
* @default 'a'
|
|
19
|
+
*/
|
|
20
|
+
as?: TAs;
|
|
21
|
+
/** The link to the terms and conditions, in the props of `as`. */
|
|
22
|
+
terms: TAuthLinkProps<TAs>;
|
|
23
|
+
/** The link to the privacy policy, in the props of `as`. */
|
|
24
|
+
privacy: TAuthLinkProps<TAs>;
|
|
25
|
+
/** @default 'Terms & Conditions' */
|
|
26
|
+
termsLabel?: string;
|
|
27
|
+
/** @default 'Privacy Policy' */
|
|
28
|
+
privacyLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The sentence around the two links, for another wording or another language.
|
|
31
|
+
* @default ({ terms, privacy }) => <>By continuing, you agree to our {terms} and {privacy}.</>
|
|
32
|
+
*/
|
|
33
|
+
message?: (links: IAuthLinks) => ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export type IAuthBottomInstructions<TAs extends ElementType = 'a'> = IAuthBottomInstructionsOwnProps<TAs> & Omit<ComponentProps<'p'>, 'children'>;
|
|
36
|
+
/**
|
|
37
|
+
* The small print under a sign-in or sign-up form: that going on means accepting the terms and the
|
|
38
|
+
* privacy policy, with a link to each.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AuthBottomInstructions: <TAs extends ElementType = "a">({ as, terms, privacy, termsLabel, privacyLabel, message, className, ...pProps }: IAuthBottomInstructions<TAs>) => import("react").JSX.Element;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=AuthBottomInstructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthBottomInstructions.d.ts","sourceRoot":"","sources":["../../src/auth/AuthBottomInstructions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3F;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,WAAW,IAAI,IAAI,CACxD,qBAAqB,CAAC,GAAG,CAAC,EAC1B,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAC3C,GACC,CAAC,GAAG,SAAS,GAAG,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,CAAC;AAEjD,4DAA4D;AAC5D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,+BAA+B,CAAC,GAAG,SAAS,WAAW;IAC/D;;;;OAIG;IACH,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,kEAAkE;IAClE,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3B,4DAA4D;IAC5D,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC;CAC5C;AAED,MAAM,MAAM,uBAAuB,CAAC,GAAG,SAAS,WAAW,GAAG,GAAG,IAC/D,+BAA+B,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;AAU/E;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,GAAG,SAAS,WAAW,GAAG,GAAG,EAAE,iFASnE,uBAAuB,CAAC,GAAG,CAAC,gCA2B9B,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.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"}
|