@helpdice/ui 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-complete/auto-complete-context.d.ts +10 -0
- package/dist/auto-complete/auto-complete-dropdown.d.ts +12 -0
- package/dist/auto-complete/auto-complete-empty.d.ts +8 -0
- package/dist/auto-complete/auto-complete-item.d.ts +8 -0
- package/dist/auto-complete/auto-complete-searching.d.ts +38 -0
- package/dist/auto-complete/auto-complete.d.ts +32 -0
- package/dist/auto-complete/index.d.ts +13 -0
- package/dist/auto-complete/index.js +2334 -0
- package/dist/avatar/avatar-group.d.ts +43 -0
- package/dist/avatar/avatar.d.ts +43 -0
- package/dist/avatar/index.d.ts +9 -0
- package/dist/avatar/index.js +1192 -0
- package/dist/badge/badge-anchor.d.ts +11 -0
- package/dist/badge/badge.d.ts +46 -0
- package/dist/badge/index.d.ts +9 -0
- package/dist/badge/index.js +1290 -0
- package/dist/breadcrumbs/breadcrumbs-item.d.ts +15 -0
- package/dist/breadcrumbs/breadcrumbs-separator.d.ts +42 -0
- package/dist/breadcrumbs/breadcrumbs.d.ts +43 -0
- package/dist/breadcrumbs/index.d.ts +12 -0
- package/dist/breadcrumbs/index.js +1366 -0
- package/dist/button/button-icon.d.ts +10 -0
- package/dist/button/button-loading.d.ts +6 -0
- package/dist/button/button.d.ts +55 -0
- package/dist/button/button.drip.d.ts +10 -0
- package/dist/button/index.d.ts +4 -0
- package/dist/button/index.js +1679 -0
- package/dist/button/styles.d.ts +18 -0
- package/dist/button/utils.d.ts +8 -0
- package/dist/button-dropdown/button-dropdown-context.d.ts +10 -0
- package/dist/button-dropdown/button-dropdown-item.d.ts +13 -0
- package/dist/button-dropdown/button-dropdown.d.ts +49 -0
- package/dist/button-dropdown/icon.d.ts +7 -0
- package/dist/button-dropdown/index.d.ts +9 -0
- package/dist/button-dropdown/index.js +1474 -0
- package/dist/button-dropdown/styles.d.ts +11 -0
- package/dist/button-group/button-group-context.d.ts +10 -0
- package/dist/button-group/button-group.d.ts +47 -0
- package/dist/button-group/index.d.ts +4 -0
- package/dist/button-group/index.js +1183 -0
- package/dist/capacity/capacity.d.ts +43 -0
- package/dist/capacity/index.d.ts +3 -0
- package/dist/capacity/index.js +1186 -0
- package/dist/card/card-content.d.ts +42 -0
- package/dist/card/card-footer.d.ts +43 -0
- package/dist/card/card.d.ts +46 -0
- package/dist/card/index.d.ts +15 -0
- package/dist/card/index.js +1637 -0
- package/dist/card/styles.d.ts +8 -0
- package/dist/cart/index.d.ts +72 -0
- package/dist/cart/useLocalStorage.d.ts +1 -0
- package/dist/checkbox/checkbox-context.d.ts +9 -0
- package/dist/checkbox/checkbox-group.d.ts +45 -0
- package/dist/checkbox/checkbox.d.ts +57 -0
- package/dist/checkbox/checkbox.icon.d.ts +9 -0
- package/dist/checkbox/index.d.ts +9 -0
- package/dist/checkbox/index.js +1410 -0
- package/dist/checkbox/styles.d.ts +7 -0
- package/dist/code/code.d.ts +45 -0
- package/dist/code/index.d.ts +3 -0
- package/dist/code/index.js +1205 -0
- package/dist/code-block/index.d.ts +10 -0
- package/dist/col/index.js +567 -0
- package/dist/collapse/collapse-context.d.ts +7 -0
- package/dist/collapse/collapse-group.d.ts +43 -0
- package/dist/collapse/collapse-icon.d.ts +6 -0
- package/dist/collapse/collapse.d.ts +47 -0
- package/dist/collapse/index.d.ts +9 -0
- package/dist/collapse/index.js +1513 -0
- package/dist/css-baseline/css-baseline.d.ts +11 -0
- package/dist/css-baseline/index.d.ts +1 -0
- package/dist/css-baseline/index.js +839 -0
- package/dist/description/description.d.ts +42 -0
- package/dist/description/index.d.ts +3 -0
- package/dist/description/index.js +1149 -0
- package/dist/display/display.d.ts +44 -0
- package/dist/display/index.d.ts +3 -0
- package/dist/display/index.js +1153 -0
- package/dist/divider/divider.d.ts +46 -0
- package/dist/divider/index.d.ts +4 -0
- package/dist/divider/index.js +1172 -0
- package/dist/dot/dot.d.ts +45 -0
- package/dist/dot/index.d.ts +3 -0
- package/dist/dot/index.js +1159 -0
- package/dist/drawer/drawer-wrapper.d.ts +10 -0
- package/dist/drawer/drawer.d.ts +15 -0
- package/dist/drawer/helper.d.ts +9 -0
- package/dist/drawer/index.d.ts +13 -0
- package/dist/drawer/index.js +1839 -0
- package/dist/fieldset/fieldset-content.d.ts +42 -0
- package/dist/fieldset/fieldset-context.d.ts +12 -0
- package/dist/fieldset/fieldset-footer.d.ts +42 -0
- package/dist/fieldset/fieldset-group.d.ts +44 -0
- package/dist/fieldset/fieldset-subtitle.d.ts +8 -0
- package/dist/fieldset/fieldset-title.d.ts +8 -0
- package/dist/fieldset/fieldset.d.ts +46 -0
- package/dist/fieldset/index.d.ts +22 -0
- package/dist/fieldset/index.js +1444 -0
- package/dist/form/ErrorMessage.d.ts +17 -0
- package/dist/form/Field.d.ts +53 -0
- package/dist/form/FormWrapper.d.ts +62 -0
- package/dist/form/FormikContext.d.ts +6 -0
- package/dist/form/connect.d.ts +12 -0
- package/dist/form/constants.d.ts +1 -0
- package/dist/form/index.d.ts +9 -0
- package/dist/form/types.d.ts +249 -0
- package/dist/form/utils.d.ts +68 -0
- package/dist/form/withFormik.d.ts +68 -0
- package/dist/grid/basic-item.d.ts +19 -0
- package/dist/grid/grid-container.d.ts +299 -0
- package/dist/grid/grid-types.d.ts +11 -0
- package/dist/grid/grid.d.ts +296 -0
- package/dist/grid/index.d.ts +11 -0
- package/dist/grid/index.js +1262 -0
- package/dist/image/helpers.d.ts +2 -0
- package/dist/image/image-browser-https-icon.d.ts +3 -0
- package/dist/image/image-browser.d.ts +47 -0
- package/dist/image/image.d.ts +43 -0
- package/dist/image/image.skeleton.d.ts +7 -0
- package/dist/image/index.d.ts +9 -0
- package/dist/image/index.js +1470 -0
- package/dist/image/styles.d.ts +9 -0
- package/dist/index.d.ts +130 -0
- package/dist/index.js +34412 -0
- package/dist/input/index.d.ts +13 -0
- package/dist/input/index.js +1629 -0
- package/dist/input/input-block-label.d.ts +5 -0
- package/dist/input/input-icon-clear.d.ts +8 -0
- package/dist/input/input-icon.d.ts +8 -0
- package/dist/input/input-label.d.ts +6 -0
- package/dist/input/input-props.d.ts +29 -0
- package/dist/input/input.d.ts +38 -0
- package/dist/input/password-icon.d.ts +6 -0
- package/dist/input/password.d.ts +51 -0
- package/dist/input/styles.d.ts +8 -0
- package/dist/keyboard/index.d.ts +3 -0
- package/dist/keyboard/index.js +1127 -0
- package/dist/keyboard/keyboard.d.ts +46 -0
- package/dist/link/icon.d.ts +4 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.js +1260 -0
- package/dist/link/link.d.ts +45 -0
- package/dist/loading/index.d.ts +3 -0
- package/dist/loading/index.js +1170 -0
- package/dist/loading/loading.d.ts +47 -0
- package/dist/login-with/LoginSocialAmazon/index.d.ts +19 -0
- package/dist/login-with/LoginSocialApple/index.d.ts +14 -0
- package/dist/login-with/LoginSocialFacebook/index.d.ts +26 -0
- package/dist/login-with/LoginSocialGithub/index.d.ts +21 -0
- package/dist/login-with/LoginSocialGoogle/index.d.ts +25 -0
- package/dist/login-with/LoginSocialInstagram/index.d.ts +22 -0
- package/dist/login-with/LoginSocialLinkedin/index.d.ts +20 -0
- package/dist/login-with/LoginSocialMicrosoft/index.d.ts +24 -0
- package/dist/login-with/LoginSocialPinterest/index.d.ts +19 -0
- package/dist/login-with/LoginSocialTiktok/index.d.ts +16 -0
- package/dist/login-with/LoginSocialTwitter/index.d.ts +20 -0
- package/dist/login-with/index.d.ts +18 -0
- package/dist/modal/index.d.ts +18 -0
- package/dist/modal/index.js +2440 -0
- package/dist/modal/modal-action.d.ts +46 -0
- package/dist/modal/modal-actions.d.ts +5 -0
- package/dist/modal/modal-content.d.ts +42 -0
- package/dist/modal/modal-context.d.ts +6 -0
- package/dist/modal/modal-subtitle.d.ts +42 -0
- package/dist/modal/modal-title.d.ts +42 -0
- package/dist/modal/modal-wrapper.d.ts +8 -0
- package/dist/modal/modal.d.ts +50 -0
- package/dist/note/index.d.ts +3 -0
- package/dist/note/index.js +1177 -0
- package/dist/note/note.d.ts +48 -0
- package/dist/page/index.d.ts +16 -0
- package/dist/page/index.js +1313 -0
- package/dist/page/page-content.d.ts +42 -0
- package/dist/page/page-footer.d.ts +42 -0
- package/dist/page/page-header.d.ts +43 -0
- package/dist/page/page.d.ts +51 -0
- package/dist/pagination/index.d.ts +12 -0
- package/dist/pagination/index.js +1563 -0
- package/dist/pagination/pagination-context.d.ts +11 -0
- package/dist/pagination/pagination-ellipsis.d.ts +7 -0
- package/dist/pagination/pagination-item.d.ts +10 -0
- package/dist/pagination/pagination-next.d.ts +4 -0
- package/dist/pagination/pagination-pages.d.ts +9 -0
- package/dist/pagination/pagination-previous.d.ts +4 -0
- package/dist/pagination/pagination.d.ts +47 -0
- package/dist/popover/index.d.ts +10 -0
- package/dist/popover/index.js +1849 -0
- package/dist/popover/popover-context.d.ts +7 -0
- package/dist/popover/popover-item.d.ts +45 -0
- package/dist/popover/popover.d.ts +52 -0
- package/dist/progress/index.d.ts +3 -0
- package/dist/progress/index.js +1208 -0
- package/dist/progress/progress.d.ts +51 -0
- package/dist/radio/index.d.ts +13 -0
- package/dist/radio/index.js +1392 -0
- package/dist/radio/radio-context.d.ts +9 -0
- package/dist/radio/radio-description.d.ts +42 -0
- package/dist/radio/radio-group.d.ts +47 -0
- package/dist/radio/radio.d.ts +58 -0
- package/dist/radio/styles.d.ts +8 -0
- package/dist/rating/index.d.ts +3 -0
- package/dist/rating/index.js +1297 -0
- package/dist/rating/rating-icon.d.ts +3 -0
- package/dist/rating/rating.d.ts +54 -0
- package/dist/row/index.js +895 -0
- package/dist/search-bar/index.js +1176 -0
- package/dist/select/index.d.ts +9 -0
- package/dist/select/index.js +2125 -0
- package/dist/select/select-context.d.ts +11 -0
- package/dist/select/select-dropdown.d.ts +14 -0
- package/dist/select/select-icon-clear.d.ts +6 -0
- package/dist/select/select-icon.d.ts +3 -0
- package/dist/select/select-input.d.ts +8 -0
- package/dist/select/select-multiple-value.d.ts +7 -0
- package/dist/select/select-option.d.ts +47 -0
- package/dist/select/select.d.ts +62 -0
- package/dist/select/styles.d.ts +9 -0
- package/dist/shared/backdrop.d.ts +14 -0
- package/dist/shared/css-transition.d.ts +12 -0
- package/dist/shared/dropdown.d.ts +9 -0
- package/dist/shared/ellipsis.d.ts +6 -0
- package/dist/shared/expand.d.ts +7 -0
- package/dist/shared/highlight.d.ts +13 -0
- package/dist/skeleton/index.d.ts +14 -0
- package/dist/slider/index.d.ts +3 -0
- package/dist/slider/index.js +1461 -0
- package/dist/slider/slider-dot.d.ts +12 -0
- package/dist/slider/slider-mark.d.ts +10 -0
- package/dist/slider/slider.d.ts +54 -0
- package/dist/slider/styles.d.ts +6 -0
- package/dist/snippet/index.d.ts +4 -0
- package/dist/snippet/index.js +1547 -0
- package/dist/snippet/snippet-icon.d.ts +3 -0
- package/dist/snippet/snippet.d.ts +51 -0
- package/dist/snippet/styles.d.ts +8 -0
- package/dist/spacer/index.d.ts +3 -0
- package/dist/spacer/index.js +1109 -0
- package/dist/spacer/spacer.d.ts +41 -0
- package/dist/spinner/index.d.ts +3 -0
- package/dist/spinner/index.js +1166 -0
- package/dist/spinner/spinner.d.ts +40 -0
- package/dist/styled-jsx.cjs.js +748 -0
- package/dist/table/index.d.ts +5 -0
- package/dist/table/index.js +1486 -0
- package/dist/table/table-body.d.ts +18 -0
- package/dist/table/table-cell.d.ts +18 -0
- package/dist/table/table-column.d.ts +14 -0
- package/dist/table/table-context.d.ts +8 -0
- package/dist/table/table-head.d.ts +14 -0
- package/dist/table/table-types.d.ts +14 -0
- package/dist/table/table.d.ts +57 -0
- package/dist/tabs/index.d.ts +9 -0
- package/dist/tabs/index.js +1488 -0
- package/dist/tabs/tabs-context.d.ts +21 -0
- package/dist/tabs/tabs-item.d.ts +44 -0
- package/dist/tabs/tabs.d.ts +54 -0
- package/dist/tag/index.d.ts +3 -0
- package/dist/tag/index.js +1155 -0
- package/dist/tag/tag.d.ts +51 -0
- package/dist/text/child.d.ts +11 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.js +1251 -0
- package/dist/text/text.d.ts +59 -0
- package/dist/textarea/index.d.ts +3 -0
- package/dist/textarea/index.js +1298 -0
- package/dist/textarea/textarea.d.ts +54 -0
- package/dist/themes/index.d.ts +4 -0
- package/dist/themes/index.js +302 -0
- package/dist/themes/presets/dark.d.ts +8 -0
- package/dist/themes/presets/default.d.ts +8 -0
- package/dist/themes/presets/index.d.ts +90 -0
- package/dist/themes/presets/shared.d.ts +4 -0
- package/dist/themes/themes.d.ts +18 -0
- package/dist/toggle/index.d.ts +3 -0
- package/dist/toggle/index.js +1245 -0
- package/dist/toggle/styles.d.ts +6 -0
- package/dist/toggle/toggle.d.ts +60 -0
- package/dist/tooltip/helper.d.ts +10 -0
- package/dist/tooltip/index.d.ts +3 -0
- package/dist/tooltip/index.js +1709 -0
- package/dist/tooltip/placement.d.ts +29 -0
- package/dist/tooltip/styles.d.ts +7 -0
- package/dist/tooltip/tooltip-content.d.ts +18 -0
- package/dist/tooltip/tooltip-icon.d.ts +8 -0
- package/dist/tooltip/tooltip.d.ts +59 -0
- package/dist/tree/index.d.ts +10 -0
- package/dist/tree/index.js +1410 -0
- package/dist/tree/tree-context.d.ts +8 -0
- package/dist/tree/tree-file-icon.d.ts +8 -0
- package/dist/tree/tree-file.d.ts +12 -0
- package/dist/tree/tree-folder-icon.d.ts +8 -0
- package/dist/tree/tree-folder.d.ts +12 -0
- package/dist/tree/tree-help.d.ts +4 -0
- package/dist/tree/tree-indents.d.ts +6 -0
- package/dist/tree/tree-status-icon.d.ts +9 -0
- package/dist/tree/tree.d.ts +18 -0
- package/dist/ui-provider/index.d.ts +3 -0
- package/dist/ui-provider/index.js +2155 -0
- package/dist/ui-provider/theme-provider.d.ts +8 -0
- package/dist/ui-provider/ui-provider.d.ts +8 -0
- package/dist/use-all-themes/all-themes-context.d.ts +7 -0
- package/dist/use-all-themes/index.d.ts +3 -0
- package/dist/use-all-themes/index.js +318 -0
- package/dist/use-body-scroll/index.d.ts +3 -0
- package/dist/use-body-scroll/index.js +158 -0
- package/dist/use-body-scroll/use-body-scroll.d.ts +11 -0
- package/dist/use-classes/index.d.ts +2 -0
- package/dist/use-classes/index.js +47 -0
- package/dist/use-classes/use-classes.d.ts +4 -0
- package/dist/use-click-away/index.d.ts +2 -0
- package/dist/use-click-away/index.js +26 -0
- package/dist/use-click-away/use-click-away.d.ts +4 -0
- package/dist/use-clipboard/index.d.ts +3 -0
- package/dist/use-clipboard/index.js +158 -0
- package/dist/use-clipboard/use-clipboard.d.ts +8 -0
- package/dist/use-current-state/index.d.ts +2 -0
- package/dist/use-current-state/index.js +76 -0
- package/dist/use-current-state/use-current-state.d.ts +4 -0
- package/dist/use-input/index.d.ts +3 -0
- package/dist/use-input/index.js +112 -0
- package/dist/use-input/use-input.d.ts +13 -0
- package/dist/use-keyboard/codes.d.ts +92 -0
- package/dist/use-keyboard/helper.d.ts +3 -0
- package/dist/use-keyboard/index.d.ts +5 -0
- package/dist/use-keyboard/index.js +203 -0
- package/dist/use-keyboard/use-keyboard.d.ts +22 -0
- package/dist/use-media-query/index.d.ts +3 -0
- package/dist/use-media-query/index.js +455 -0
- package/dist/use-media-query/use-media-query.d.ts +12 -0
- package/dist/use-modal/index.d.ts +3 -0
- package/dist/use-modal/index.js +97 -0
- package/dist/use-modal/use-modal.d.ts +10 -0
- package/dist/use-scale/index.d.ts +6 -0
- package/dist/use-scale/index.js +592 -0
- package/dist/use-scale/scale-context.d.ts +50 -0
- package/dist/use-scale/utils.d.ts +68 -0
- package/dist/use-scale/with-scale.d.ts +35 -0
- package/dist/use-tabs/index.d.ts +2 -0
- package/dist/use-tabs/index.js +96 -0
- package/dist/use-tabs/use-tabs.d.ts +11 -0
- package/dist/use-theme/index.d.ts +2 -0
- package/dist/use-theme/index.js +316 -0
- package/dist/use-theme/theme-context.d.ts +4 -0
- package/dist/use-toasts/helpers.d.ts +17 -0
- package/dist/use-toasts/index.d.ts +3 -0
- package/dist/use-toasts/index.js +207 -0
- package/dist/use-toasts/toast-container.d.ts +3 -0
- package/dist/use-toasts/toast-item.d.ts +8 -0
- package/dist/use-toasts/use-toast.d.ts +40 -0
- package/dist/user/index.d.ts +8 -0
- package/dist/user/index.js +1392 -0
- package/dist/user/user-link.d.ts +11 -0
- package/dist/user/user.d.ts +46 -0
- package/dist/utils/calculations.d.ts +10 -0
- package/dist/utils/collections.d.ts +15 -0
- package/dist/utils/color.d.ts +2 -0
- package/dist/utils/layouts.d.ts +20 -0
- package/dist/utils/prop-types.d.ts +19 -0
- package/dist/utils/types.d.ts +3 -0
- package/dist/utils/use-body-scroll.d.ts +2 -0
- package/dist/utils/use-click-anywhere.d.ts +2 -0
- package/dist/utils/use-click-away.d.ts +2 -0
- package/dist/utils/use-clipboard.d.ts +2 -0
- package/dist/utils/use-current-state.d.ts +2 -0
- package/dist/utils/use-dom-observer.d.ts +3 -0
- package/dist/utils/use-drag.d.ts +8 -0
- package/dist/utils/use-hd-ui-context.d.ts +16 -0
- package/dist/utils/use-portal.d.ts +2 -0
- package/dist/utils/use-previous.d.ts +2 -0
- package/dist/utils/use-real-shape.d.ts +9 -0
- package/dist/utils/use-resize.d.ts +2 -0
- package/dist/utils/use-ssr.d.ts +6 -0
- package/dist/utils/use-warning.d.ts +2 -0
- package/esm/auto-complete/auto-complete-context.d.ts +10 -0
- package/esm/auto-complete/auto-complete-context.js +8 -0
- package/esm/auto-complete/auto-complete-dropdown.d.ts +12 -0
- package/esm/auto-complete/auto-complete-dropdown.js +43 -0
- package/esm/auto-complete/auto-complete-empty.d.ts +8 -0
- package/esm/auto-complete/auto-complete-empty.js +15 -0
- package/esm/auto-complete/auto-complete-item.d.ts +8 -0
- package/esm/auto-complete/auto-complete-item.js +45 -0
- package/esm/auto-complete/auto-complete-searching.d.ts +38 -0
- package/esm/auto-complete/auto-complete-searching.js +25 -0
- package/esm/auto-complete/auto-complete.d.ts +32 -0
- package/esm/auto-complete/auto-complete.js +197 -0
- package/esm/auto-complete/index.d.ts +13 -0
- package/esm/auto-complete/index.js +11 -0
- package/esm/avatar/avatar-group.d.ts +43 -0
- package/esm/avatar/avatar-group.js +25 -0
- package/esm/avatar/avatar.d.ts +43 -0
- package/esm/avatar/avatar.js +54 -0
- package/esm/avatar/index.d.ts +9 -0
- package/esm/avatar/index.js +6 -0
- package/esm/badge/badge-anchor.d.ts +11 -0
- package/esm/badge/badge-anchor.js +64 -0
- package/esm/badge/badge.d.ts +46 -0
- package/esm/badge/badge.js +50 -0
- package/esm/badge/index.d.ts +9 -0
- package/esm/badge/index.js +6 -0
- package/esm/breadcrumbs/breadcrumbs-item.d.ts +15 -0
- package/esm/breadcrumbs/breadcrumbs-item.js +43 -0
- package/esm/breadcrumbs/breadcrumbs-separator.d.ts +42 -0
- package/esm/breadcrumbs/breadcrumbs-separator.js +21 -0
- package/esm/breadcrumbs/breadcrumbs.d.ts +43 -0
- package/esm/breadcrumbs/breadcrumbs.js +41 -0
- package/esm/breadcrumbs/index.d.ts +12 -0
- package/esm/breadcrumbs/index.js +8 -0
- package/esm/button/button-icon.d.ts +10 -0
- package/esm/button/button-icon.js +26 -0
- package/esm/button/button-loading.d.ts +6 -0
- package/esm/button/button-loading.js +15 -0
- package/esm/button/button.d.ts +55 -0
- package/esm/button/button.drip.d.ts +10 -0
- package/esm/button/button.drip.js +58 -0
- package/esm/button/button.js +132 -0
- package/esm/button/index.d.ts +4 -0
- package/esm/button/index.js +4 -0
- package/esm/button/styles.d.ts +18 -0
- package/esm/button/styles.js +188 -0
- package/esm/button/utils.d.ts +8 -0
- package/esm/button/utils.js +40 -0
- package/esm/button-dropdown/button-dropdown-context.d.ts +10 -0
- package/esm/button-dropdown/button-dropdown-context.js +11 -0
- package/esm/button-dropdown/button-dropdown-item.d.ts +13 -0
- package/esm/button-dropdown/button-dropdown-item.js +47 -0
- package/esm/button-dropdown/button-dropdown.d.ts +49 -0
- package/esm/button-dropdown/button-dropdown.js +105 -0
- package/esm/button-dropdown/icon.d.ts +7 -0
- package/esm/button-dropdown/icon.js +28 -0
- package/esm/button-dropdown/index.d.ts +9 -0
- package/esm/button-dropdown/index.js +6 -0
- package/esm/button-dropdown/styles.d.ts +11 -0
- package/esm/button-dropdown/styles.js +46 -0
- package/esm/button-group/button-group-context.d.ts +10 -0
- package/esm/button-group/button-group-context.js +9 -0
- package/esm/button-group/button-group.d.ts +47 -0
- package/esm/button-group/button-group.js +63 -0
- package/esm/button-group/index.d.ts +4 -0
- package/esm/button-group/index.js +4 -0
- package/esm/capacity/capacity.d.ts +43 -0
- package/esm/capacity/capacity.js +46 -0
- package/esm/capacity/index.d.ts +3 -0
- package/esm/capacity/index.js +4 -0
- package/esm/card/card-content.d.ts +42 -0
- package/esm/card/card-content.js +24 -0
- package/esm/card/card-footer.d.ts +43 -0
- package/esm/card/card-footer.js +31 -0
- package/esm/card/card.d.ts +46 -0
- package/esm/card/card.js +57 -0
- package/esm/card/index.d.ts +15 -0
- package/esm/card/index.js +10 -0
- package/esm/card/styles.d.ts +8 -0
- package/esm/card/styles.js +53 -0
- package/esm/cart/index.d.ts +72 -0
- package/esm/cart/index.js +266 -0
- package/esm/cart/useLocalStorage.d.ts +1 -0
- package/esm/cart/useLocalStorage.js +28 -0
- package/esm/checkbox/checkbox-context.d.ts +9 -0
- package/esm/checkbox/checkbox-context.js +10 -0
- package/esm/checkbox/checkbox-group.d.ts +45 -0
- package/esm/checkbox/checkbox-group.js +64 -0
- package/esm/checkbox/checkbox.d.ts +57 -0
- package/esm/checkbox/checkbox.icon.d.ts +9 -0
- package/esm/checkbox/checkbox.icon.js +46 -0
- package/esm/checkbox/checkbox.js +103 -0
- package/esm/checkbox/index.d.ts +9 -0
- package/esm/checkbox/index.js +6 -0
- package/esm/checkbox/styles.d.ts +7 -0
- package/esm/checkbox/styles.js +27 -0
- package/esm/code/code.d.ts +45 -0
- package/esm/code/code.js +51 -0
- package/esm/code/index.d.ts +3 -0
- package/esm/code/index.js +4 -0
- package/esm/code-block/index.d.ts +10 -0
- package/esm/code-block/index.js +28 -0
- package/esm/col/col.js +26 -0
- package/esm/col/index.js +4 -0
- package/esm/collapse/collapse-context.d.ts +7 -0
- package/esm/collapse/collapse-context.js +8 -0
- package/esm/collapse/collapse-group.d.ts +43 -0
- package/esm/collapse/collapse-group.js +68 -0
- package/esm/collapse/collapse-icon.d.ts +6 -0
- package/esm/collapse/collapse-icon.js +26 -0
- package/esm/collapse/collapse.d.ts +47 -0
- package/esm/collapse/collapse.js +83 -0
- package/esm/collapse/index.d.ts +9 -0
- package/esm/collapse/index.js +6 -0
- package/esm/css-baseline/css-baseline.d.ts +11 -0
- package/esm/css-baseline/css-baseline.js +24 -0
- package/esm/css-baseline/index.d.ts +1 -0
- package/esm/css-baseline/index.js +3 -0
- package/esm/description/description.d.ts +42 -0
- package/esm/description/description.js +34 -0
- package/esm/description/index.d.ts +3 -0
- package/esm/description/index.js +4 -0
- package/esm/display/display.d.ts +44 -0
- package/esm/display/display.js +38 -0
- package/esm/display/index.d.ts +3 -0
- package/esm/display/index.js +4 -0
- package/esm/divider/divider.d.ts +46 -0
- package/esm/divider/divider.js +57 -0
- package/esm/divider/index.d.ts +4 -0
- package/esm/divider/index.js +4 -0
- package/esm/dot/dot.d.ts +45 -0
- package/esm/dot/dot.js +44 -0
- package/esm/dot/index.d.ts +3 -0
- package/esm/dot/index.js +4 -0
- package/esm/drawer/drawer-wrapper.d.ts +10 -0
- package/esm/drawer/drawer-wrapper.js +80 -0
- package/esm/drawer/drawer.d.ts +15 -0
- package/esm/drawer/drawer.js +73 -0
- package/esm/drawer/helper.d.ts +9 -0
- package/esm/drawer/helper.js +27 -0
- package/esm/drawer/index.d.ts +13 -0
- package/esm/drawer/index.js +10 -0
- package/esm/fieldset/fieldset-content.d.ts +42 -0
- package/esm/fieldset/fieldset-content.js +25 -0
- package/esm/fieldset/fieldset-context.d.ts +12 -0
- package/esm/fieldset/fieldset-context.js +9 -0
- package/esm/fieldset/fieldset-footer.d.ts +42 -0
- package/esm/fieldset/fieldset-footer.js +25 -0
- package/esm/fieldset/fieldset-group.d.ts +44 -0
- package/esm/fieldset/fieldset-group.js +79 -0
- package/esm/fieldset/fieldset-subtitle.d.ts +8 -0
- package/esm/fieldset/fieldset-subtitle.js +18 -0
- package/esm/fieldset/fieldset-title.d.ts +8 -0
- package/esm/fieldset/fieldset-title.js +20 -0
- package/esm/fieldset/fieldset.d.ts +46 -0
- package/esm/fieldset/fieldset.js +84 -0
- package/esm/fieldset/index.d.ts +22 -0
- package/esm/fieldset/index.js +15 -0
- package/esm/form/ErrorMessage.d.ts +17 -0
- package/esm/form/ErrorMessage.js +45 -0
- package/esm/form/FastField.js +147 -0
- package/esm/form/Field.d.ts +53 -0
- package/esm/form/Field.js +137 -0
- package/esm/form/FieldArray.js +281 -0
- package/esm/form/Form.js +23 -0
- package/esm/form/FormWrapper.d.ts +62 -0
- package/esm/form/FormWrapper.js +977 -0
- package/esm/form/FormikContext.d.ts +6 -0
- package/esm/form/FormikContext.js +11 -0
- package/esm/form/connect.d.ts +12 -0
- package/esm/form/connect.js +30 -0
- package/esm/form/constants.d.ts +1 -0
- package/esm/form/constants.js +1 -0
- package/esm/form/index.d.ts +9 -0
- package/esm/form/index.js +15 -0
- package/esm/form/types.d.ts +249 -0
- package/esm/form/types.js +1 -0
- package/esm/form/utils.d.ts +68 -0
- package/esm/form/utils.js +179 -0
- package/esm/form/withFormik.d.ts +68 -0
- package/esm/form/withFormik.js +107 -0
- package/esm/formik-native/src/index.js +12 -0
- package/esm/formik-native/test/blah.test.js +5 -0
- package/esm/grid/basic-item.d.ts +19 -0
- package/esm/grid/basic-item.js +87 -0
- package/esm/grid/grid-container.d.ts +299 -0
- package/esm/grid/grid-container.js +40 -0
- package/esm/grid/grid-types.d.ts +11 -0
- package/esm/grid/grid-types.js +8 -0
- package/esm/grid/grid.d.ts +296 -0
- package/esm/grid/grid.js +34 -0
- package/esm/grid/index.d.ts +11 -0
- package/esm/grid/index.js +6 -0
- package/esm/image/helpers.d.ts +2 -0
- package/esm/image/helpers.js +14 -0
- package/esm/image/image-browser-https-icon.d.ts +3 -0
- package/esm/image/image-browser-https-icon.js +21 -0
- package/esm/image/image-browser.d.ts +47 -0
- package/esm/image/image-browser.js +80 -0
- package/esm/image/image.d.ts +43 -0
- package/esm/image/image.js +82 -0
- package/esm/image/image.skeleton.d.ts +7 -0
- package/esm/image/image.skeleton.js +20 -0
- package/esm/image/index.d.ts +9 -0
- package/esm/image/index.js +4 -0
- package/esm/image/styles.d.ts +9 -0
- package/esm/image/styles.js +15 -0
- package/esm/index.d.ts +130 -0
- package/esm/index.js +78 -0
- package/esm/input/index.d.ts +13 -0
- package/esm/input/index.js +8 -0
- package/esm/input/input-block-label.d.ts +5 -0
- package/esm/input/input-block-label.js +16 -0
- package/esm/input/input-icon-clear.d.ts +8 -0
- package/esm/input/input-icon-clear.js +43 -0
- package/esm/input/input-icon.d.ts +8 -0
- package/esm/input/input-icon.js +18 -0
- package/esm/input/input-label.d.ts +6 -0
- package/esm/input/input-label.js +16 -0
- package/esm/input/input-props.d.ts +29 -0
- package/esm/input/input-props.js +1 -0
- package/esm/input/input.d.ts +38 -0
- package/esm/input/input.js +184 -0
- package/esm/input/password-icon.d.ts +6 -0
- package/esm/input/password-icon.js +28 -0
- package/esm/input/password.d.ts +51 -0
- package/esm/input/password.js +54 -0
- package/esm/input/styles.d.ts +8 -0
- package/esm/input/styles.js +31 -0
- package/esm/keyboard/index.d.ts +3 -0
- package/esm/keyboard/index.js +4 -0
- package/esm/keyboard/keyboard.d.ts +46 -0
- package/esm/keyboard/keyboard.js +43 -0
- package/esm/link/icon.d.ts +4 -0
- package/esm/link/icon.js +30 -0
- package/esm/link/index.d.ts +3 -0
- package/esm/link/index.js +2 -0
- package/esm/link/link.d.ts +45 -0
- package/esm/link/link.js +47 -0
- package/esm/loading/index.d.ts +3 -0
- package/esm/loading/index.js +2 -0
- package/esm/loading/loading.d.ts +47 -0
- package/esm/loading/loading.js +55 -0
- package/esm/login-with/LoginSocialAmazon/index.d.ts +19 -0
- package/esm/login-with/LoginSocialAmazon/index.js +142 -0
- package/esm/login-with/LoginSocialApple/index.d.ts +14 -0
- package/esm/login-with/LoginSocialApple/index.js +141 -0
- package/esm/login-with/LoginSocialFacebook/index.d.ts +26 -0
- package/esm/login-with/LoginSocialFacebook/index.js +148 -0
- package/esm/login-with/LoginSocialGithub/index.d.ts +21 -0
- package/esm/login-with/LoginSocialGithub/index.js +163 -0
- package/esm/login-with/LoginSocialGoogle/index.d.ts +25 -0
- package/esm/login-with/LoginSocialGoogle/index.js +206 -0
- package/esm/login-with/LoginSocialInstagram/index.d.ts +22 -0
- package/esm/login-with/LoginSocialInstagram/index.js +145 -0
- package/esm/login-with/LoginSocialLinkedin/index.d.ts +20 -0
- package/esm/login-with/LoginSocialLinkedin/index.js +151 -0
- package/esm/login-with/LoginSocialMicrosoft/index.d.ts +24 -0
- package/esm/login-with/LoginSocialMicrosoft/index.js +154 -0
- package/esm/login-with/LoginSocialPinterest/index.d.ts +19 -0
- package/esm/login-with/LoginSocialPinterest/index.js +171 -0
- package/esm/login-with/LoginSocialTiktok/index.d.ts +16 -0
- package/esm/login-with/LoginSocialTiktok/index.js +152 -0
- package/esm/login-with/LoginSocialTwitter/index.d.ts +20 -0
- package/esm/login-with/LoginSocialTwitter/index.js +177 -0
- package/esm/login-with/helper/signature.js +142 -0
- package/esm/login-with/index.d.ts +18 -0
- package/esm/login-with/index.js +11 -0
- package/esm/modal/index.d.ts +18 -0
- package/esm/modal/index.js +10 -0
- package/esm/modal/modal-action.d.ts +46 -0
- package/esm/modal/modal-action.js +69 -0
- package/esm/modal/modal-actions.d.ts +5 -0
- package/esm/modal/modal-actions.js +36 -0
- package/esm/modal/modal-content.d.ts +42 -0
- package/esm/modal/modal-content.js +24 -0
- package/esm/modal/modal-context.d.ts +6 -0
- package/esm/modal/modal-context.js +6 -0
- package/esm/modal/modal-subtitle.d.ts +42 -0
- package/esm/modal/modal-subtitle.js +25 -0
- package/esm/modal/modal-title.d.ts +42 -0
- package/esm/modal/modal-title.js +25 -0
- package/esm/modal/modal-wrapper.d.ts +8 -0
- package/esm/modal/modal-wrapper.js +74 -0
- package/esm/modal/modal.d.ts +50 -0
- package/esm/modal/modal.js +94 -0
- package/esm/note/index.d.ts +3 -0
- package/esm/note/index.js +2 -0
- package/esm/note/note.d.ts +48 -0
- package/esm/note/note.js +62 -0
- package/esm/page/index.d.ts +16 -0
- package/esm/page/index.js +9 -0
- package/esm/page/page-content.d.ts +42 -0
- package/esm/page/page-content.js +23 -0
- package/esm/page/page-footer.d.ts +42 -0
- package/esm/page/page-footer.js +21 -0
- package/esm/page/page-header.d.ts +43 -0
- package/esm/page/page-header.js +29 -0
- package/esm/page/page.d.ts +51 -0
- package/esm/page/page.js +80 -0
- package/esm/pagination/index.d.ts +12 -0
- package/esm/pagination/index.js +6 -0
- package/esm/pagination/pagination-context.d.ts +11 -0
- package/esm/pagination/pagination-context.js +8 -0
- package/esm/pagination/pagination-ellipsis.d.ts +7 -0
- package/esm/pagination/pagination-ellipsis.js +69 -0
- package/esm/pagination/pagination-item.d.ts +10 -0
- package/esm/pagination/pagination-item.js +43 -0
- package/esm/pagination/pagination-next.d.ts +4 -0
- package/esm/pagination/pagination-next.js +21 -0
- package/esm/pagination/pagination-pages.d.ts +9 -0
- package/esm/pagination/pagination-pages.js +86 -0
- package/esm/pagination/pagination-previous.d.ts +4 -0
- package/esm/pagination/pagination-previous.js +21 -0
- package/esm/pagination/pagination.d.ts +47 -0
- package/esm/pagination/pagination.js +96 -0
- package/esm/popover/index.d.ts +10 -0
- package/esm/popover/index.js +7 -0
- package/esm/popover/popover-context.d.ts +7 -0
- package/esm/popover/popover-context.js +9 -0
- package/esm/popover/popover-item.d.ts +45 -0
- package/esm/popover/popover-item.js +55 -0
- package/esm/popover/popover.d.ts +52 -0
- package/esm/popover/popover.js +86 -0
- package/esm/progress/index.d.ts +3 -0
- package/esm/progress/index.js +2 -0
- package/esm/progress/progress.d.ts +51 -0
- package/esm/progress/progress.js +68 -0
- package/esm/radio/index.d.ts +13 -0
- package/esm/radio/index.js +7 -0
- package/esm/radio/radio-context.d.ts +9 -0
- package/esm/radio/radio-context.js +9 -0
- package/esm/radio/radio-description.d.ts +42 -0
- package/esm/radio/radio-description.js +25 -0
- package/esm/radio/radio-group.d.ts +47 -0
- package/esm/radio/radio-group.js +57 -0
- package/esm/radio/radio.d.ts +58 -0
- package/esm/radio/radio.js +109 -0
- package/esm/radio/styles.d.ts +8 -0
- package/esm/radio/styles.js +31 -0
- package/esm/rating/index.d.ts +3 -0
- package/esm/rating/index.js +2 -0
- package/esm/rating/rating-icon.d.ts +3 -0
- package/esm/rating/rating-icon.js +18 -0
- package/esm/rating/rating.d.ts +54 -0
- package/esm/rating/rating.js +101 -0
- package/esm/row/index.js +2 -0
- package/esm/row/row.js +51 -0
- package/esm/search-bar/components/ClearIcon.js +42 -0
- package/esm/search-bar/components/Results.js +87 -0
- package/esm/search-bar/components/SearchIcon.js +24 -0
- package/esm/search-bar/components/SearchInput.js +75 -0
- package/esm/search-bar/components/index.js +302 -0
- package/esm/search-bar/config/config.js +26 -0
- package/esm/search-bar/index.js +2 -0
- package/esm/search-bar/utils/utils.js +14 -0
- package/esm/select/index.d.ts +9 -0
- package/esm/select/index.js +4 -0
- package/esm/select/select-context.d.ts +11 -0
- package/esm/select/select-context.js +9 -0
- package/esm/select/select-dropdown.d.ts +14 -0
- package/esm/select/select-dropdown.js +41 -0
- package/esm/select/select-icon-clear.d.ts +6 -0
- package/esm/select/select-icon-clear.js +37 -0
- package/esm/select/select-icon.d.ts +3 -0
- package/esm/select/select-icon.js +21 -0
- package/esm/select/select-input.d.ts +8 -0
- package/esm/select/select-input.js +35 -0
- package/esm/select/select-multiple-value.d.ts +7 -0
- package/esm/select/select-multiple-value.js +21 -0
- package/esm/select/select-option.d.ts +47 -0
- package/esm/select/select-option.js +86 -0
- package/esm/select/select.d.ts +62 -0
- package/esm/select/select.js +211 -0
- package/esm/select/styles.d.ts +9 -0
- package/esm/select/styles.js +36 -0
- package/esm/shared/backdrop.d.ts +14 -0
- package/esm/shared/backdrop.js +66 -0
- package/esm/shared/css-transition.d.ts +12 -0
- package/esm/shared/css-transition.js +65 -0
- package/esm/shared/dropdown.d.ts +9 -0
- package/esm/shared/dropdown.js +99 -0
- package/esm/shared/ellipsis.d.ts +6 -0
- package/esm/shared/ellipsis.js +13 -0
- package/esm/shared/expand.d.ts +7 -0
- package/esm/shared/expand.js +86 -0
- package/esm/shared/highlight.d.ts +13 -0
- package/esm/shared/highlight.js +46 -0
- package/esm/skeleton/index.d.ts +14 -0
- package/esm/skeleton/index.js +48 -0
- package/esm/slider/index.d.ts +3 -0
- package/esm/slider/index.js +2 -0
- package/esm/slider/slider-dot.d.ts +12 -0
- package/esm/slider/slider-dot.js +27 -0
- package/esm/slider/slider-mark.d.ts +10 -0
- package/esm/slider/slider-mark.js +35 -0
- package/esm/slider/slider.d.ts +54 -0
- package/esm/slider/slider.js +146 -0
- package/esm/slider/styles.d.ts +6 -0
- package/esm/slider/styles.js +21 -0
- package/esm/snippet/index.d.ts +4 -0
- package/esm/snippet/index.js +2 -0
- package/esm/snippet/snippet-icon.d.ts +3 -0
- package/esm/snippet/snippet-icon.js +25 -0
- package/esm/snippet/snippet.d.ts +51 -0
- package/esm/snippet/snippet.js +93 -0
- package/esm/snippet/styles.d.ts +8 -0
- package/esm/snippet/styles.js +48 -0
- package/esm/spacer/index.d.ts +3 -0
- package/esm/spacer/index.js +2 -0
- package/esm/spacer/spacer.d.ts +41 -0
- package/esm/spacer/spacer.js +24 -0
- package/esm/spinner/index.d.ts +3 -0
- package/esm/spinner/index.js +2 -0
- package/esm/spinner/spinner.d.ts +40 -0
- package/esm/spinner/spinner.js +40 -0
- package/esm/styled-jsx-server.es.js +5 -0
- package/esm/styled-jsx.es.js +737 -0
- package/esm/table/index.d.ts +5 -0
- package/esm/table/index.js +2 -0
- package/esm/table/table-body.d.ts +18 -0
- package/esm/table/table-body.js +45 -0
- package/esm/table/table-cell.d.ts +18 -0
- package/esm/table/table-cell.js +25 -0
- package/esm/table/table-column.d.ts +14 -0
- package/esm/table/table-column.js +33 -0
- package/esm/table/table-context.d.ts +8 -0
- package/esm/table/table-context.js +9 -0
- package/esm/table/table-head.d.ts +14 -0
- package/esm/table/table-head.js +51 -0
- package/esm/table/table-types.d.ts +14 -0
- package/esm/table/table-types.js +1 -0
- package/esm/table/table.d.ts +57 -0
- package/esm/table/table.js +104 -0
- package/esm/tabs/index.d.ts +9 -0
- package/esm/tabs/index.js +7 -0
- package/esm/tabs/tabs-context.d.ts +21 -0
- package/esm/tabs/tabs-context.js +8 -0
- package/esm/tabs/tabs-item.d.ts +44 -0
- package/esm/tabs/tabs-item.js +71 -0
- package/esm/tabs/tabs.d.ts +54 -0
- package/esm/tabs/tabs.js +138 -0
- package/esm/tag/index.d.ts +3 -0
- package/esm/tag/index.js +4 -0
- package/esm/tag/tag.d.ts +51 -0
- package/esm/tag/tag.js +71 -0
- package/esm/text/child.d.ts +11 -0
- package/esm/text/child.js +70 -0
- package/esm/text/index.d.ts +3 -0
- package/esm/text/index.js +4 -0
- package/esm/text/text.d.ts +59 -0
- package/esm/text/text.js +103 -0
- package/esm/textarea/index.d.ts +3 -0
- package/esm/textarea/index.js +2 -0
- package/esm/textarea/textarea.d.ts +54 -0
- package/esm/textarea/textarea.js +105 -0
- package/esm/themes/index.d.ts +4 -0
- package/esm/themes/index.js +2 -0
- package/esm/themes/presets/dark.d.ts +8 -0
- package/esm/themes/presets/dark.js +64 -0
- package/esm/themes/presets/default.d.ts +8 -0
- package/esm/themes/presets/default.js +64 -0
- package/esm/themes/presets/index.d.ts +90 -0
- package/esm/themes/presets/index.js +1 -0
- package/esm/themes/presets/shared.d.ts +4 -0
- package/esm/themes/presets/shared.js +42 -0
- package/esm/themes/themes.d.ts +18 -0
- package/esm/themes/themes.js +76 -0
- package/esm/toggle/index.d.ts +3 -0
- package/esm/toggle/index.js +2 -0
- package/esm/toggle/styles.d.ts +6 -0
- package/esm/toggle/styles.js +21 -0
- package/esm/toggle/toggle.d.ts +60 -0
- package/esm/toggle/toggle.js +76 -0
- package/esm/tooltip/__test__/index.test.js +168 -0
- package/esm/tooltip/helper.d.ts +10 -0
- package/esm/tooltip/helper.js +21 -0
- package/esm/tooltip/index.d.ts +3 -0
- package/esm/tooltip/index.js +2 -0
- package/esm/tooltip/placement.d.ts +29 -0
- package/esm/tooltip/placement.js +160 -0
- package/esm/tooltip/styles.d.ts +7 -0
- package/esm/tooltip/styles.js +16 -0
- package/esm/tooltip/tooltip-content.d.ts +18 -0
- package/esm/tooltip/tooltip-content.js +75 -0
- package/esm/tooltip/tooltip-icon.d.ts +8 -0
- package/esm/tooltip/tooltip-icon.js +28 -0
- package/esm/tooltip/tooltip.d.ts +59 -0
- package/esm/tooltip/tooltip.js +120 -0
- package/esm/tree/index.d.ts +10 -0
- package/esm/tree/index.js +6 -0
- package/esm/tree/tree-context.d.ts +8 -0
- package/esm/tree/tree-context.js +9 -0
- package/esm/tree/tree-file-icon.d.ts +8 -0
- package/esm/tree/tree-file-icon.js +34 -0
- package/esm/tree/tree-file.d.ts +12 -0
- package/esm/tree/tree-file.js +52 -0
- package/esm/tree/tree-folder-icon.d.ts +8 -0
- package/esm/tree/tree-folder-icon.js +31 -0
- package/esm/tree/tree-folder.d.ts +12 -0
- package/esm/tree/tree-folder.js +81 -0
- package/esm/tree/tree-help.d.ts +4 -0
- package/esm/tree/tree-help.js +16 -0
- package/esm/tree/tree-indents.d.ts +6 -0
- package/esm/tree/tree-indents.js +22 -0
- package/esm/tree/tree-status-icon.d.ts +9 -0
- package/esm/tree/tree-status-icon.js +44 -0
- package/esm/tree/tree.d.ts +18 -0
- package/esm/tree/tree.js +62 -0
- package/esm/ui-provider/index.d.ts +3 -0
- package/esm/ui-provider/index.js +2 -0
- package/esm/ui-provider/theme-provider.d.ts +8 -0
- package/esm/ui-provider/theme-provider.js +45 -0
- package/esm/ui-provider/ui-provider.d.ts +8 -0
- package/esm/ui-provider/ui-provider.js +55 -0
- package/esm/use-all-themes/all-themes-context.d.ts +7 -0
- package/esm/use-all-themes/all-themes-context.js +9 -0
- package/esm/use-all-themes/index.d.ts +3 -0
- package/esm/use-all-themes/index.js +2 -0
- package/esm/use-body-scroll/index.d.ts +3 -0
- package/esm/use-body-scroll/index.js +2 -0
- package/esm/use-body-scroll/use-body-scroll.d.ts +11 -0
- package/esm/use-body-scroll/use-body-scroll.js +63 -0
- package/esm/use-classes/index.d.ts +2 -0
- package/esm/use-classes/index.js +2 -0
- package/esm/use-classes/use-classes.d.ts +4 -0
- package/esm/use-classes/use-classes.js +32 -0
- package/esm/use-click-away/index.d.ts +2 -0
- package/esm/use-click-away/index.js +2 -0
- package/esm/use-click-away/use-click-away.d.ts +4 -0
- package/esm/use-click-away/use-click-away.js +21 -0
- package/esm/use-clipboard/index.d.ts +3 -0
- package/esm/use-clipboard/index.js +2 -0
- package/esm/use-clipboard/use-clipboard.d.ts +8 -0
- package/esm/use-clipboard/use-clipboard.js +39 -0
- package/esm/use-current-state/index.d.ts +2 -0
- package/esm/use-current-state/index.js +2 -0
- package/esm/use-current-state/use-current-state.d.ts +4 -0
- package/esm/use-current-state/use-current-state.js +23 -0
- package/esm/use-input/index.d.ts +3 -0
- package/esm/use-input/index.js +2 -0
- package/esm/use-input/use-input.d.ts +13 -0
- package/esm/use-input/use-input.js +29 -0
- package/esm/use-keyboard/codes.d.ts +92 -0
- package/esm/use-keyboard/codes.js +95 -0
- package/esm/use-keyboard/helper.d.ts +3 -0
- package/esm/use-keyboard/helper.js +26 -0
- package/esm/use-keyboard/index.d.ts +5 -0
- package/esm/use-keyboard/index.js +4 -0
- package/esm/use-keyboard/use-keyboard.d.ts +22 -0
- package/esm/use-keyboard/use-keyboard.js +70 -0
- package/esm/use-media-query/index.d.ts +3 -0
- package/esm/use-media-query/index.js +2 -0
- package/esm/use-media-query/use-media-query.d.ts +12 -0
- package/esm/use-media-query/use-media-query.js +81 -0
- package/esm/use-modal/index.d.ts +3 -0
- package/esm/use-modal/index.js +2 -0
- package/esm/use-modal/use-modal.d.ts +10 -0
- package/esm/use-modal/use-modal.js +22 -0
- package/esm/use-scale/index.d.ts +6 -0
- package/esm/use-scale/index.js +8 -0
- package/esm/use-scale/scale-context.d.ts +50 -0
- package/esm/use-scale/scale-context.js +37 -0
- package/esm/use-scale/utils.d.ts +68 -0
- package/esm/use-scale/utils.js +49 -0
- package/esm/use-scale/with-scale.d.ts +35 -0
- package/esm/use-scale/with-scale.js +102 -0
- package/esm/use-tabs/index.d.ts +2 -0
- package/esm/use-tabs/index.js +2 -0
- package/esm/use-tabs/use-tabs.d.ts +11 -0
- package/esm/use-tabs/use-tabs.js +21 -0
- package/esm/use-theme/index.d.ts +2 -0
- package/esm/use-theme/index.js +2 -0
- package/esm/use-theme/theme-context.d.ts +4 -0
- package/esm/use-theme/theme-context.js +9 -0
- package/esm/use-toasts/helpers.d.ts +17 -0
- package/esm/use-toasts/helpers.js +68 -0
- package/esm/use-toasts/index.d.ts +3 -0
- package/esm/use-toasts/index.js +2 -0
- package/esm/use-toasts/toast-container.d.ts +3 -0
- package/esm/use-toasts/toast-container.js +120 -0
- package/esm/use-toasts/toast-item.d.ts +8 -0
- package/esm/use-toasts/toast-item.js +43 -0
- package/esm/use-toasts/use-toast.d.ts +40 -0
- package/esm/use-toasts/use-toast.js +103 -0
- package/esm/user/index.d.ts +8 -0
- package/esm/user/index.js +4 -0
- package/esm/user/user-link.d.ts +11 -0
- package/esm/user/user-link.js +26 -0
- package/esm/user/user.d.ts +46 -0
- package/esm/user/user.js +44 -0
- package/esm/utils/calculations.d.ts +10 -0
- package/esm/utils/calculations.js +27 -0
- package/esm/utils/collections.d.ts +15 -0
- package/esm/utils/collections.js +126 -0
- package/esm/utils/color.d.ts +2 -0
- package/esm/utils/color.js +35 -0
- package/esm/utils/layouts.d.ts +20 -0
- package/esm/utils/layouts.js +73 -0
- package/esm/utils/prop-types.d.ts +19 -0
- package/esm/utils/prop-types.js +20 -0
- package/esm/utils/types.d.ts +3 -0
- package/esm/utils/types.js +1 -0
- package/esm/utils/use-body-scroll.d.ts +2 -0
- package/esm/utils/use-body-scroll.js +2 -0
- package/esm/utils/use-click-anywhere.d.ts +2 -0
- package/esm/utils/use-click-anywhere.js +15 -0
- package/esm/utils/use-click-away.d.ts +2 -0
- package/esm/utils/use-click-away.js +2 -0
- package/esm/utils/use-clipboard.d.ts +2 -0
- package/esm/utils/use-clipboard.js +2 -0
- package/esm/utils/use-context-state/create-geist-context.js +50 -0
- package/esm/utils/use-context-state/use-context-state.js +40 -0
- package/esm/utils/use-current-state.d.ts +2 -0
- package/esm/utils/use-current-state.js +2 -0
- package/esm/utils/use-default-props.js +17 -0
- package/esm/utils/use-dom-observer.d.ts +3 -0
- package/esm/utils/use-dom-observer.js +26 -0
- package/esm/utils/use-drag.d.ts +8 -0
- package/esm/utils/use-drag.js +66 -0
- package/esm/utils/use-hd-ui-context.d.ts +16 -0
- package/esm/utils/use-hd-ui-context.js +27 -0
- package/esm/utils/use-portal.d.ts +2 -0
- package/esm/utils/use-portal.js +34 -0
- package/esm/utils/use-previous.d.ts +2 -0
- package/esm/utils/use-previous.js +11 -0
- package/esm/utils/use-real-shape.d.ts +9 -0
- package/esm/utils/use-real-shape.js +47 -0
- package/esm/utils/use-resize.d.ts +2 -0
- package/esm/utils/use-resize.js +19 -0
- package/esm/utils/use-ssr.d.ts +6 -0
- package/esm/utils/use-ssr.js +19 -0
- package/esm/utils/use-warning.d.ts +2 -0
- package/esm/utils/use-warning.js +13 -0
- package/package.json +1 -1
package/esm/link/link.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["href", "showColor", "underline", "children", "className", "block", "icon"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import useTheme from '../use-theme';
|
|
7
|
+
import LinkIcon from './icon';
|
|
8
|
+
import { addColorAlpha } from '../utils/color';
|
|
9
|
+
import useScale, { withScale } from '../use-scale';
|
|
10
|
+
import useClasses from '../use-classes';
|
|
11
|
+
var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
12
|
+
var _ref$href = _ref.href,
|
|
13
|
+
href = _ref$href === void 0 ? '' : _ref$href,
|
|
14
|
+
_ref$showColor = _ref.showColor,
|
|
15
|
+
showColor = _ref$showColor === void 0 ? false : _ref$showColor,
|
|
16
|
+
_ref$underline = _ref.underline,
|
|
17
|
+
underline = _ref$underline === void 0 ? false : _ref$underline,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
_ref$className = _ref.className,
|
|
20
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
21
|
+
_ref$block = _ref.block,
|
|
22
|
+
block = _ref$block === void 0 ? false : _ref$block,
|
|
23
|
+
_ref$icon = _ref.icon,
|
|
24
|
+
icon = _ref$icon === void 0 ? false : _ref$icon,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var theme = useTheme();
|
|
27
|
+
var _useScale = useScale(),
|
|
28
|
+
SCALES = _useScale.SCALES;
|
|
29
|
+
var linkColor = showColor || block ? theme.palette.link : 'inherit';
|
|
30
|
+
var hoverColor = showColor || block ? theme.palette.successLight : 'inherit';
|
|
31
|
+
var decoration = underline ? 'underline' : 'none';
|
|
32
|
+
var classes = useClasses('link', {
|
|
33
|
+
block: block
|
|
34
|
+
}, className);
|
|
35
|
+
return /*#__PURE__*/React.createElement("a", _extends({
|
|
36
|
+
href: href
|
|
37
|
+
}, props, {
|
|
38
|
+
ref: ref,
|
|
39
|
+
className: _JSXStyle.dynamic([["442871747", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
40
|
+
}), children, icon && /*#__PURE__*/React.createElement(LinkIcon, null), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
41
|
+
id: "442871747",
|
|
42
|
+
dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
|
|
43
|
+
}, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:baseline;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;line-height:inherit;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
44
|
+
});
|
|
45
|
+
LinkComponent.displayName = 'Link';
|
|
46
|
+
var Link = withScale(LinkComponent);
|
|
47
|
+
export default Link;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NormalTypes } from "../utils/prop-types";
|
|
3
|
+
export type LoadingTypes = NormalTypes;
|
|
4
|
+
interface Props {
|
|
5
|
+
type?: LoadingTypes;
|
|
6
|
+
color?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
spaceRatio?: number;
|
|
9
|
+
}
|
|
10
|
+
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
|
|
11
|
+
export type LoadingProps = Props & NativeAttrs;
|
|
12
|
+
declare const Loading: React.ForwardRefExoticComponent<Props & NativeAttrs & {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
} & {
|
|
15
|
+
width?: string | number | undefined;
|
|
16
|
+
height?: string | number | undefined;
|
|
17
|
+
padding?: string | number | undefined;
|
|
18
|
+
margin?: string | number | undefined;
|
|
19
|
+
w?: string | number | undefined;
|
|
20
|
+
h?: string | number | undefined;
|
|
21
|
+
paddingLeft?: string | number | undefined;
|
|
22
|
+
paddingRight?: string | number | undefined;
|
|
23
|
+
paddingTop?: string | number | undefined;
|
|
24
|
+
paddingBottom?: string | number | undefined;
|
|
25
|
+
pl?: string | number | undefined;
|
|
26
|
+
pr?: string | number | undefined;
|
|
27
|
+
pt?: string | number | undefined;
|
|
28
|
+
pb?: string | number | undefined;
|
|
29
|
+
marginLeft?: string | number | undefined;
|
|
30
|
+
marginRight?: string | number | undefined;
|
|
31
|
+
marginTop?: string | number | undefined;
|
|
32
|
+
marginBottom?: string | number | undefined;
|
|
33
|
+
ml?: string | number | undefined;
|
|
34
|
+
mr?: string | number | undefined;
|
|
35
|
+
mt?: string | number | undefined;
|
|
36
|
+
mb?: string | number | undefined;
|
|
37
|
+
px?: string | number | undefined;
|
|
38
|
+
py?: string | number | undefined;
|
|
39
|
+
mx?: string | number | undefined;
|
|
40
|
+
my?: string | number | undefined;
|
|
41
|
+
font?: string | number | undefined;
|
|
42
|
+
unit?: string | undefined;
|
|
43
|
+
scale?: number | undefined;
|
|
44
|
+
children?: any;
|
|
45
|
+
className?: string | undefined;
|
|
46
|
+
} & React.InputHTMLAttributes<any> & React.RefAttributes<unknown>>;
|
|
47
|
+
export default Loading;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "type", "color", "className", "spaceRatio"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import useTheme from '../use-theme';
|
|
7
|
+
import useScale, { withScale } from '../use-scale';
|
|
8
|
+
import useClasses from '../use-classes';
|
|
9
|
+
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
10
|
+
var colors = {
|
|
11
|
+
"default": palette.accents_6,
|
|
12
|
+
secondary: palette.secondary,
|
|
13
|
+
success: palette.success,
|
|
14
|
+
warning: palette.warning,
|
|
15
|
+
error: palette.error
|
|
16
|
+
};
|
|
17
|
+
return color ? color : colors[type];
|
|
18
|
+
};
|
|
19
|
+
var LoadingComponent = function LoadingComponent(_ref) {
|
|
20
|
+
var children = _ref.children,
|
|
21
|
+
_ref$type = _ref.type,
|
|
22
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
23
|
+
color = _ref.color,
|
|
24
|
+
_ref$className = _ref.className,
|
|
25
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
26
|
+
_ref$spaceRatio = _ref.spaceRatio,
|
|
27
|
+
spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
|
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var theme = useTheme();
|
|
30
|
+
var _useScale = useScale(),
|
|
31
|
+
SCALES = _useScale.SCALES;
|
|
32
|
+
var classes = useClasses('loading-container', className);
|
|
33
|
+
var bgColor = useMemo(function () {
|
|
34
|
+
return getIconBgColor(type, theme.palette, color);
|
|
35
|
+
}, [type, theme.palette, color]);
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
37
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
38
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
39
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
|
|
40
|
+
}, children && /*#__PURE__*/React.createElement("label", {
|
|
41
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
42
|
+
}, children), /*#__PURE__*/React.createElement("i", {
|
|
43
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
44
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
45
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
46
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
47
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
48
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
49
|
+
id: "2201634259",
|
|
50
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]
|
|
51
|
+
}, ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")));
|
|
52
|
+
};
|
|
53
|
+
LoadingComponent.displayName = 'Loading';
|
|
54
|
+
var Loading = withScale(LoadingComponent);
|
|
55
|
+
export default Loading;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IResolveParams, objectType } from "..";
|
|
3
|
+
interface Props {
|
|
4
|
+
scope?: string;
|
|
5
|
+
state?: string;
|
|
6
|
+
client_id: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
redirect_uri?: string;
|
|
9
|
+
response_type?: string;
|
|
10
|
+
scope_data?: objectType;
|
|
11
|
+
isOnlyGetToken?: boolean;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
onLoginStart?: () => void;
|
|
14
|
+
onReject: (reject: string | objectType) => void;
|
|
15
|
+
onResolve: ({ provider, data }: IResolveParams) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const LoginSocialAmazon: ({ state, client_id, className, redirect_uri, scope, isOnlyGetToken: onlyGetToken, scope_data, response_type, children, onReject, onResolve, onLoginStart, }: Props) => JSX.Element;
|
|
18
|
+
declare const _default: React.MemoExoticComponent<({ state, client_id, className, redirect_uri, scope, isOnlyGetToken: onlyGetToken, scope_data, response_type, children, onReject, onResolve, onLoginStart, }: Props) => JSX.Element>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* LoginSocialAmazon
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
"use client";
|
|
8
|
+
|
|
9
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
10
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
11
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
|
+
import React, { memo, useEffect, useState, useCallback, useRef } from 'react';
|
|
14
|
+
var JS_SRC = 'https://assets.loginwithamazon.com/sdk/na/login1.js';
|
|
15
|
+
var SCRIPT_ID = 'amazon-login';
|
|
16
|
+
var _window = global.window;
|
|
17
|
+
export var LoginSocialAmazon = function LoginSocialAmazon(_ref) {
|
|
18
|
+
var _ref$state = _ref.state,
|
|
19
|
+
state = _ref$state === void 0 ? '' : _ref$state,
|
|
20
|
+
client_id = _ref.client_id,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
redirect_uri = _ref.redirect_uri,
|
|
23
|
+
_ref$scope = _ref.scope,
|
|
24
|
+
scope = _ref$scope === void 0 ? 'profile' : _ref$scope,
|
|
25
|
+
_ref$isOnlyGetToken = _ref.isOnlyGetToken,
|
|
26
|
+
onlyGetToken = _ref$isOnlyGetToken === void 0 ? false : _ref$isOnlyGetToken,
|
|
27
|
+
_ref$scope_data = _ref.scope_data,
|
|
28
|
+
scope_data = _ref$scope_data === void 0 ? {
|
|
29
|
+
profile: {
|
|
30
|
+
essential: true
|
|
31
|
+
}
|
|
32
|
+
} : _ref$scope_data,
|
|
33
|
+
_ref$response_type = _ref.response_type,
|
|
34
|
+
response_type = _ref$response_type === void 0 ? 'token' : _ref$response_type,
|
|
35
|
+
children = _ref.children,
|
|
36
|
+
onReject = _ref.onReject,
|
|
37
|
+
onResolve = _ref.onResolve,
|
|
38
|
+
onLoginStart = _ref.onLoginStart;
|
|
39
|
+
var scriptNodeRef = useRef(null);
|
|
40
|
+
var _useState = useState(false),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
isSdkLoaded = _useState2[0],
|
|
43
|
+
setIsSdkLoaded = _useState2[1];
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
!isSdkLoaded && load();
|
|
46
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
+
}, [isSdkLoaded]);
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
return function () {
|
|
50
|
+
if (scriptNodeRef.current) scriptNodeRef.current.remove();
|
|
51
|
+
};
|
|
52
|
+
}, []);
|
|
53
|
+
var checkIsExistsSDKScript = useCallback(function () {
|
|
54
|
+
return !!document.getElementById(SCRIPT_ID);
|
|
55
|
+
}, []);
|
|
56
|
+
var insertScriptGoogle = useCallback(function (d) {
|
|
57
|
+
var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'script';
|
|
58
|
+
var id = arguments.length > 2 ? arguments[2] : undefined;
|
|
59
|
+
var jsSrc = arguments.length > 3 ? arguments[3] : undefined;
|
|
60
|
+
var cb = arguments.length > 4 ? arguments[4] : undefined;
|
|
61
|
+
var ggScriptTag = d.createElement(s);
|
|
62
|
+
ggScriptTag.id = id;
|
|
63
|
+
ggScriptTag.src = jsSrc;
|
|
64
|
+
ggScriptTag.async = true;
|
|
65
|
+
ggScriptTag.defer = true;
|
|
66
|
+
var scriptNode = document.getElementsByTagName('script')[0];
|
|
67
|
+
scriptNodeRef.current = ggScriptTag;
|
|
68
|
+
scriptNode && scriptNode.parentNode && scriptNode.parentNode.insertBefore(ggScriptTag, scriptNode);
|
|
69
|
+
ggScriptTag.onload = cb;
|
|
70
|
+
}, []);
|
|
71
|
+
var getUserInfo = useCallback( /*#__PURE__*/function () {
|
|
72
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(res) {
|
|
73
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
74
|
+
while (1) switch (_context.prev = _context.next) {
|
|
75
|
+
case 0:
|
|
76
|
+
fetch("https://api.amazon.com/user/profile", {
|
|
77
|
+
headers: {
|
|
78
|
+
Authorization: "Bearer ".concat(res.access_token)
|
|
79
|
+
}
|
|
80
|
+
}).then(function (data) {
|
|
81
|
+
return data.json();
|
|
82
|
+
}).then(function (data) {
|
|
83
|
+
onResolve({
|
|
84
|
+
provider: 'amazon',
|
|
85
|
+
data: _extends({}, data, res)
|
|
86
|
+
});
|
|
87
|
+
})["catch"](function (err) {
|
|
88
|
+
onReject(err);
|
|
89
|
+
})["finally"](function () {});
|
|
90
|
+
case 1:
|
|
91
|
+
case "end":
|
|
92
|
+
return _context.stop();
|
|
93
|
+
}
|
|
94
|
+
}, _callee);
|
|
95
|
+
}));
|
|
96
|
+
return function (_x) {
|
|
97
|
+
return _ref2.apply(this, arguments);
|
|
98
|
+
};
|
|
99
|
+
}(), [onReject, onResolve]);
|
|
100
|
+
var handleResponse = useCallback(function (res) {
|
|
101
|
+
if (onlyGetToken) onResolve({
|
|
102
|
+
provider: 'amazon',
|
|
103
|
+
data: _extends({}, res)
|
|
104
|
+
});else getUserInfo(res);
|
|
105
|
+
}, [getUserInfo, onResolve, onlyGetToken]);
|
|
106
|
+
var handleError = useCallback(function (err) {
|
|
107
|
+
onReject(err);
|
|
108
|
+
}, [onReject]);
|
|
109
|
+
var load = useCallback(function () {
|
|
110
|
+
if (checkIsExistsSDKScript()) {
|
|
111
|
+
setIsSdkLoaded(true);
|
|
112
|
+
} else {
|
|
113
|
+
insertScriptGoogle(document, 'script', SCRIPT_ID, JS_SRC, function () {
|
|
114
|
+
_window.amazon.Login.setClientId(client_id);
|
|
115
|
+
setIsSdkLoaded(true);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}, [checkIsExistsSDKScript, client_id, insertScriptGoogle]);
|
|
119
|
+
var onLogin = useCallback(function () {
|
|
120
|
+
if (!isSdkLoaded) return;
|
|
121
|
+
if (!_window.amazon) {
|
|
122
|
+
load();
|
|
123
|
+
onReject("Google SDK isn't loaded!");
|
|
124
|
+
} else {
|
|
125
|
+
onLoginStart && onLoginStart();
|
|
126
|
+
_window.amazon.Login.authorize({
|
|
127
|
+
scope: scope,
|
|
128
|
+
scope_data: scope_data,
|
|
129
|
+
response_type: response_type,
|
|
130
|
+
redirect_uri: redirect_uri,
|
|
131
|
+
state: state
|
|
132
|
+
}, function (res) {
|
|
133
|
+
if (res.error) handleError(res.error);else handleResponse(res);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}, [load, scope, state, onReject, scope_data, isSdkLoaded, handleError, onLoginStart, redirect_uri, response_type, handleResponse]);
|
|
137
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: className,
|
|
139
|
+
onClick: onLogin
|
|
140
|
+
}, children);
|
|
141
|
+
};
|
|
142
|
+
export default /*#__PURE__*/memo(LoginSocialAmazon);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { objectType, IResolveParams } from "..";
|
|
3
|
+
interface Props {
|
|
4
|
+
scope?: string;
|
|
5
|
+
client_id: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
redirect_uri?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
onLoginStart?: () => void;
|
|
10
|
+
onReject: (reject: string | objectType) => void;
|
|
11
|
+
onResolve: ({ provider, data }: IResolveParams) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: React.MemoExoticComponent<({ client_id, scope, className, onLoginStart, onReject, onResolve, redirect_uri, children, }: Props) => JSX.Element>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* LoginSocialGoogle
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
"use client";
|
|
8
|
+
|
|
9
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
10
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
11
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
|
+
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
13
|
+
var JS_SRC = 'https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js';
|
|
14
|
+
var SCRIPT_ID = 'apple-login';
|
|
15
|
+
var _window = global.window;
|
|
16
|
+
var LoginSocialApple = function LoginSocialApple(_ref) {
|
|
17
|
+
var client_id = _ref.client_id,
|
|
18
|
+
_ref$scope = _ref.scope,
|
|
19
|
+
scope = _ref$scope === void 0 ? 'name email' : _ref$scope,
|
|
20
|
+
_ref$className = _ref.className,
|
|
21
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
22
|
+
onLoginStart = _ref.onLoginStart,
|
|
23
|
+
onReject = _ref.onReject,
|
|
24
|
+
onResolve = _ref.onResolve,
|
|
25
|
+
_ref$redirect_uri = _ref.redirect_uri,
|
|
26
|
+
redirect_uri = _ref$redirect_uri === void 0 ? '/' : _ref$redirect_uri,
|
|
27
|
+
children = _ref.children;
|
|
28
|
+
var scriptNodeRef = useRef(null);
|
|
29
|
+
var _useState = useState(false),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
isSdkLoaded = _useState2[0],
|
|
32
|
+
setIsSdkLoaded = _useState2[1];
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
!isSdkLoaded && load();
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
}, [isSdkLoaded]);
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
return function () {
|
|
39
|
+
if (scriptNodeRef.current) scriptNodeRef.current.remove();
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
var checkIsExistsSDKScript = useCallback(function () {
|
|
43
|
+
return !!document.getElementById(SCRIPT_ID);
|
|
44
|
+
}, []);
|
|
45
|
+
var insertScript = useCallback(function (d) {
|
|
46
|
+
var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'script';
|
|
47
|
+
var id = arguments.length > 2 ? arguments[2] : undefined;
|
|
48
|
+
var jsSrc = arguments.length > 3 ? arguments[3] : undefined;
|
|
49
|
+
var cb = arguments.length > 4 ? arguments[4] : undefined;
|
|
50
|
+
var appleScriptTag = d.createElement(s);
|
|
51
|
+
appleScriptTag.id = id;
|
|
52
|
+
appleScriptTag.src = jsSrc;
|
|
53
|
+
appleScriptTag.async = true;
|
|
54
|
+
appleScriptTag.defer = true;
|
|
55
|
+
var scriptNode = document.getElementsByTagName('script')[0];
|
|
56
|
+
scriptNodeRef.current = appleScriptTag;
|
|
57
|
+
scriptNode && scriptNode.parentNode && scriptNode.parentNode.insertBefore(appleScriptTag, scriptNode);
|
|
58
|
+
appleScriptTag.onload = cb;
|
|
59
|
+
}, []);
|
|
60
|
+
var handleResponse = useCallback(function (res) {
|
|
61
|
+
if (res !== null && res !== void 0 && res.access_token) {
|
|
62
|
+
onResolve({
|
|
63
|
+
provider: 'apple',
|
|
64
|
+
data: res
|
|
65
|
+
});
|
|
66
|
+
} else {
|
|
67
|
+
var data = res;
|
|
68
|
+
onResolve({
|
|
69
|
+
provider: 'apple',
|
|
70
|
+
data: data
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}, [onResolve]);
|
|
74
|
+
var load = useCallback(function () {
|
|
75
|
+
if (checkIsExistsSDKScript()) {
|
|
76
|
+
setIsSdkLoaded(true);
|
|
77
|
+
} else {
|
|
78
|
+
insertScript(document, 'script', SCRIPT_ID, JS_SRC, function () {
|
|
79
|
+
var options = {
|
|
80
|
+
clientId: client_id,
|
|
81
|
+
// This is the service ID we created.
|
|
82
|
+
scope: scope,
|
|
83
|
+
// To tell apple we want the user name and emails fields in the response it sends us.
|
|
84
|
+
redirectURI: redirect_uri,
|
|
85
|
+
// As registered along with our service ID
|
|
86
|
+
state: 'origin:web',
|
|
87
|
+
// Any string of your choice that you may use for some logic. It's optional and you may omit it.
|
|
88
|
+
usePopup: true // Important if we want to capture the data apple sends on the client side.
|
|
89
|
+
};
|
|
90
|
+
_window.AppleID.auth.init(options);
|
|
91
|
+
setIsSdkLoaded(true);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}, [scope, client_id, redirect_uri, insertScript, checkIsExistsSDKScript]);
|
|
95
|
+
var loginApple = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
96
|
+
var response;
|
|
97
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
98
|
+
while (1) switch (_context.prev = _context.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
if (isSdkLoaded) {
|
|
101
|
+
_context.next = 2;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
return _context.abrupt("return");
|
|
105
|
+
case 2:
|
|
106
|
+
if (_window.AppleID) {
|
|
107
|
+
_context.next = 7;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
load();
|
|
111
|
+
onReject("Apple SDK isn't loaded!");
|
|
112
|
+
_context.next = 18;
|
|
113
|
+
break;
|
|
114
|
+
case 7:
|
|
115
|
+
onLoginStart && onLoginStart();
|
|
116
|
+
_context.prev = 8;
|
|
117
|
+
_context.next = 11;
|
|
118
|
+
return _window.AppleID.auth.signIn();
|
|
119
|
+
case 11:
|
|
120
|
+
response = _context.sent;
|
|
121
|
+
handleResponse(response);
|
|
122
|
+
_context.next = 18;
|
|
123
|
+
break;
|
|
124
|
+
case 15:
|
|
125
|
+
_context.prev = 15;
|
|
126
|
+
_context.t0 = _context["catch"](8);
|
|
127
|
+
onReject({
|
|
128
|
+
err: _context.t0
|
|
129
|
+
});
|
|
130
|
+
case 18:
|
|
131
|
+
case "end":
|
|
132
|
+
return _context.stop();
|
|
133
|
+
}
|
|
134
|
+
}, _callee, null, [[8, 15]]);
|
|
135
|
+
})), [handleResponse, isSdkLoaded, load, onLoginStart, onReject]);
|
|
136
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
className: className,
|
|
138
|
+
onClick: loginApple
|
|
139
|
+
}, children);
|
|
140
|
+
};
|
|
141
|
+
export default /*#__PURE__*/memo(LoginSocialApple);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { objectType, IResolveParams } from "..";
|
|
3
|
+
interface Props {
|
|
4
|
+
appId: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
state?: boolean;
|
|
7
|
+
xfbml?: boolean;
|
|
8
|
+
cookie?: boolean;
|
|
9
|
+
version?: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
auth_type?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
isOnlyGetToken?: boolean;
|
|
15
|
+
onLoginStart?: () => void;
|
|
16
|
+
onLogoutSuccess?: () => void;
|
|
17
|
+
onReject: (reject: string | objectType) => void;
|
|
18
|
+
onResolve: ({ provider, data }: IResolveParams) => void;
|
|
19
|
+
redirect_uri?: string;
|
|
20
|
+
fieldsProfile?: string;
|
|
21
|
+
response_type?: string;
|
|
22
|
+
return_scopes?: boolean;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare const _default: React.MemoExoticComponent<({ appId, scope, state, xfbml, cookie, version, language, auth_type, className, onLoginStart, onReject, onResolve, redirect_uri, fieldsProfile, response_type, return_scopes, isOnlyGetToken, children, }: Props) => JSX.Element>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* LoginSocialFacebook
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
"use client";
|
|
8
|
+
|
|
9
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
10
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
11
|
+
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
12
|
+
var SDK_URL = 'https://connect.facebook.net/en_EN/sdk.js';
|
|
13
|
+
var SCRIPT_ID = 'facebook-jssdk';
|
|
14
|
+
var _window = global.window;
|
|
15
|
+
var LoginSocialFacebook = function LoginSocialFacebook(_ref) {
|
|
16
|
+
var appId = _ref.appId,
|
|
17
|
+
_ref$scope = _ref.scope,
|
|
18
|
+
scope = _ref$scope === void 0 ? 'email,public_profile' : _ref$scope,
|
|
19
|
+
_ref$state = _ref.state,
|
|
20
|
+
state = _ref$state === void 0 ? true : _ref$state,
|
|
21
|
+
_ref$xfbml = _ref.xfbml,
|
|
22
|
+
xfbml = _ref$xfbml === void 0 ? true : _ref$xfbml,
|
|
23
|
+
_ref$cookie = _ref.cookie,
|
|
24
|
+
cookie = _ref$cookie === void 0 ? true : _ref$cookie,
|
|
25
|
+
_ref$version = _ref.version,
|
|
26
|
+
version = _ref$version === void 0 ? 'v2.7' : _ref$version,
|
|
27
|
+
_ref$language = _ref.language,
|
|
28
|
+
language = _ref$language === void 0 ? 'en_EN' : _ref$language,
|
|
29
|
+
_ref$auth_type = _ref.auth_type,
|
|
30
|
+
auth_type = _ref$auth_type === void 0 ? '' : _ref$auth_type,
|
|
31
|
+
className = _ref.className,
|
|
32
|
+
onLoginStart = _ref.onLoginStart,
|
|
33
|
+
onReject = _ref.onReject,
|
|
34
|
+
onResolve = _ref.onResolve,
|
|
35
|
+
redirect_uri = _ref.redirect_uri,
|
|
36
|
+
_ref$fieldsProfile = _ref.fieldsProfile,
|
|
37
|
+
fieldsProfile = _ref$fieldsProfile === void 0 ? 'id,first_name,last_name,middle_name,name,name_format,picture,short_name,email,gender' : _ref$fieldsProfile,
|
|
38
|
+
_ref$response_type = _ref.response_type,
|
|
39
|
+
response_type = _ref$response_type === void 0 ? 'code' : _ref$response_type,
|
|
40
|
+
_ref$return_scopes = _ref.return_scopes,
|
|
41
|
+
return_scopes = _ref$return_scopes === void 0 ? true : _ref$return_scopes,
|
|
42
|
+
_ref$isOnlyGetToken = _ref.isOnlyGetToken,
|
|
43
|
+
isOnlyGetToken = _ref$isOnlyGetToken === void 0 ? false : _ref$isOnlyGetToken,
|
|
44
|
+
children = _ref.children;
|
|
45
|
+
var scriptNodeRef = useRef(null);
|
|
46
|
+
var _useState = useState(false),
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
isSdkLoaded = _useState2[0],
|
|
49
|
+
setIsSdkLoaded = _useState2[1];
|
|
50
|
+
var _useState3 = useState(false),
|
|
51
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
+
isProcessing = _useState4[0],
|
|
53
|
+
setIsProcessing = _useState4[1];
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
!isSdkLoaded && load();
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
}, [isSdkLoaded]);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
return function () {
|
|
60
|
+
if (scriptNodeRef.current) scriptNodeRef.current.remove();
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
var insertSDKScript = useCallback(function (document, cb) {
|
|
64
|
+
var fbScriptTag = document.createElement('script');
|
|
65
|
+
fbScriptTag.id = SCRIPT_ID;
|
|
66
|
+
fbScriptTag.src = SDK_URL;
|
|
67
|
+
var scriptNode = document.getElementsByTagName('script')[0];
|
|
68
|
+
scriptNode && scriptNode.parentNode && scriptNode.parentNode.insertBefore(fbScriptTag, scriptNode);
|
|
69
|
+
cb();
|
|
70
|
+
}, []);
|
|
71
|
+
var checkIsExistsSDKScript = useCallback(function () {
|
|
72
|
+
return !!document.getElementById(SCRIPT_ID);
|
|
73
|
+
}, []);
|
|
74
|
+
var initFbSDK = useCallback(function (config, document) {
|
|
75
|
+
var _window = window;
|
|
76
|
+
_window.fbAsyncInit = function () {
|
|
77
|
+
_window.FB && _window.FB.init(_extends({}, config));
|
|
78
|
+
setIsSdkLoaded(true);
|
|
79
|
+
var fbRoot = document.getElementById('fb-root');
|
|
80
|
+
if (!fbRoot) {
|
|
81
|
+
fbRoot = document.createElement('div');
|
|
82
|
+
fbRoot.id = 'fb-root';
|
|
83
|
+
document.body.appendChild(fbRoot);
|
|
84
|
+
}
|
|
85
|
+
scriptNodeRef.current = fbRoot;
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
var getMe = useCallback(function (authResponse) {
|
|
89
|
+
_window.FB.api('/me', {
|
|
90
|
+
locale: language,
|
|
91
|
+
fields: fieldsProfile
|
|
92
|
+
}, function (me) {
|
|
93
|
+
onResolve({
|
|
94
|
+
provider: 'facebook',
|
|
95
|
+
data: _extends({}, authResponse, me)
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}, [fieldsProfile, language, onResolve]);
|
|
99
|
+
var handleResponse = useCallback(function (response) {
|
|
100
|
+
if (response.authResponse) {
|
|
101
|
+
if (isOnlyGetToken) onResolve({
|
|
102
|
+
provider: 'facebook',
|
|
103
|
+
data: _extends({}, response.authResponse)
|
|
104
|
+
});else getMe(response.authResponse);
|
|
105
|
+
} else {
|
|
106
|
+
onReject(response);
|
|
107
|
+
}
|
|
108
|
+
setIsProcessing(false);
|
|
109
|
+
}, [getMe, isOnlyGetToken, onReject, onResolve]);
|
|
110
|
+
var load = useCallback(function () {
|
|
111
|
+
if (checkIsExistsSDKScript()) {
|
|
112
|
+
setIsSdkLoaded(true);
|
|
113
|
+
} else {
|
|
114
|
+
insertSDKScript(document, function () {
|
|
115
|
+
initFbSDK({
|
|
116
|
+
appId: appId,
|
|
117
|
+
xfbml: xfbml,
|
|
118
|
+
version: version,
|
|
119
|
+
state: state,
|
|
120
|
+
cookie: cookie,
|
|
121
|
+
redirect_uri: redirect_uri,
|
|
122
|
+
response_type: response_type
|
|
123
|
+
}, document);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}, [state, appId, xfbml, cookie, version, initFbSDK, redirect_uri, response_type, insertSDKScript, checkIsExistsSDKScript]);
|
|
127
|
+
var loginFB = useCallback(function () {
|
|
128
|
+
if (!isSdkLoaded || isProcessing) return;
|
|
129
|
+
if (!_window.FB) {
|
|
130
|
+
load();
|
|
131
|
+
onReject("Fb isn't loaded!");
|
|
132
|
+
setIsProcessing(false);
|
|
133
|
+
} else {
|
|
134
|
+
setIsProcessing(true);
|
|
135
|
+
onLoginStart && onLoginStart();
|
|
136
|
+
_window.FB.login(handleResponse, {
|
|
137
|
+
scope: scope,
|
|
138
|
+
return_scopes: return_scopes,
|
|
139
|
+
auth_type: auth_type
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}, [load, scope, onReject, auth_type, isSdkLoaded, onLoginStart, isProcessing, return_scopes, handleResponse]);
|
|
143
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: className,
|
|
145
|
+
onClick: loginFB
|
|
146
|
+
}, children);
|
|
147
|
+
};
|
|
148
|
+
export default /*#__PURE__*/memo(LoginSocialFacebook);
|