@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IResolveParams, objectType } from "..";
|
|
3
|
+
interface Props {
|
|
4
|
+
state?: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
client_id: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
redirect_uri: string;
|
|
9
|
+
client_secret: string;
|
|
10
|
+
allow_signup?: boolean;
|
|
11
|
+
isOnlyGetToken?: boolean;
|
|
12
|
+
isOnlyGetCode?: boolean;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
onLoginStart?: () => void;
|
|
15
|
+
onLogoutSuccess?: () => void;
|
|
16
|
+
onReject: (reject: string | objectType) => void;
|
|
17
|
+
onResolve: ({ provider, data }: IResolveParams) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const LoginSocialGithub: ({ state, scope, client_id, client_secret, className, redirect_uri, allow_signup, isOnlyGetToken, isOnlyGetCode, children, onReject, onResolve, onLoginStart, }: Props) => JSX.Element;
|
|
20
|
+
declare const _default: React.MemoExoticComponent<({ state, scope, client_id, client_secret, className, redirect_uri, allow_signup, isOnlyGetToken, isOnlyGetCode, children, onReject, onResolve, onLoginStart, }: Props) => JSX.Element>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* LoginSocialGithub
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
// import { PASS_CORS_KEY } from '../helper/constants';
|
|
8
|
+
"use client";
|
|
9
|
+
|
|
10
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
11
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
12
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
|
+
import React, { memo, useCallback, useEffect } from 'react';
|
|
17
|
+
var GITHUB_URL = 'https://github.com';
|
|
18
|
+
var GITHUB_API_URL = 'https://api.github.com/';
|
|
19
|
+
var PREVENT_CORS_URL = ''; //https://cors.bridged.cc
|
|
20
|
+
|
|
21
|
+
export var LoginSocialGithub = function LoginSocialGithub(_ref) {
|
|
22
|
+
var _ref$state = _ref.state,
|
|
23
|
+
state = _ref$state === void 0 ? '' : _ref$state,
|
|
24
|
+
_ref$scope = _ref.scope,
|
|
25
|
+
scope = _ref$scope === void 0 ? 'repo,gist' : _ref$scope,
|
|
26
|
+
client_id = _ref.client_id,
|
|
27
|
+
client_secret = _ref.client_secret,
|
|
28
|
+
_ref$className = _ref.className,
|
|
29
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
30
|
+
redirect_uri = _ref.redirect_uri,
|
|
31
|
+
_ref$allow_signup = _ref.allow_signup,
|
|
32
|
+
allow_signup = _ref$allow_signup === void 0 ? false : _ref$allow_signup,
|
|
33
|
+
_ref$isOnlyGetToken = _ref.isOnlyGetToken,
|
|
34
|
+
isOnlyGetToken = _ref$isOnlyGetToken === void 0 ? false : _ref$isOnlyGetToken,
|
|
35
|
+
_ref$isOnlyGetCode = _ref.isOnlyGetCode,
|
|
36
|
+
isOnlyGetCode = _ref$isOnlyGetCode === void 0 ? false : _ref$isOnlyGetCode,
|
|
37
|
+
children = _ref.children,
|
|
38
|
+
onReject = _ref.onReject,
|
|
39
|
+
onResolve = _ref.onResolve,
|
|
40
|
+
onLoginStart = _ref.onLoginStart;
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
var popupWindowURL = new URL(window.location.href);
|
|
43
|
+
var code = popupWindowURL.searchParams.get('code');
|
|
44
|
+
var state = popupWindowURL.searchParams.get('state');
|
|
45
|
+
if (state !== null && state !== void 0 && state.includes('_github') && code) {
|
|
46
|
+
localStorage.setItem('github', code);
|
|
47
|
+
window.close();
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
var getProfile = useCallback(function (data) {
|
|
51
|
+
fetch("".concat(PREVENT_CORS_URL, "/").concat(GITHUB_API_URL, "/user"), {
|
|
52
|
+
method: 'GET',
|
|
53
|
+
headers: {
|
|
54
|
+
Authorization: "token ".concat(data.access_token)
|
|
55
|
+
// 'x-cors-grida-api-key': PASS_CORS_KEY,
|
|
56
|
+
}
|
|
57
|
+
}).then(function (res) {
|
|
58
|
+
return res.json();
|
|
59
|
+
}).then(function (response) {
|
|
60
|
+
onResolve({
|
|
61
|
+
provider: 'github',
|
|
62
|
+
data: _extends({}, response, data)
|
|
63
|
+
});
|
|
64
|
+
})["catch"](function (err) {
|
|
65
|
+
onReject(err);
|
|
66
|
+
});
|
|
67
|
+
}, [onReject, onResolve]);
|
|
68
|
+
var getAccessToken = useCallback(function (code) {
|
|
69
|
+
if (isOnlyGetCode) onResolve({
|
|
70
|
+
provider: 'github',
|
|
71
|
+
data: {
|
|
72
|
+
code: code
|
|
73
|
+
}
|
|
74
|
+
});else {
|
|
75
|
+
var params = {
|
|
76
|
+
code: code,
|
|
77
|
+
state: state,
|
|
78
|
+
redirect_uri: redirect_uri,
|
|
79
|
+
client_id: client_id,
|
|
80
|
+
client_secret: client_secret
|
|
81
|
+
};
|
|
82
|
+
var headers = new Headers({
|
|
83
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
84
|
+
// 'x-cors-grida-api-key': PASS_CORS_KEY,
|
|
85
|
+
});
|
|
86
|
+
fetch("".concat(PREVENT_CORS_URL, "/").concat(GITHUB_URL, "/login/oauth/access_token"), {
|
|
87
|
+
method: 'POST',
|
|
88
|
+
headers: headers,
|
|
89
|
+
body: new URLSearchParams(params)
|
|
90
|
+
}).then(function (response) {
|
|
91
|
+
return response.text();
|
|
92
|
+
}).then(function (response) {
|
|
93
|
+
var data = {};
|
|
94
|
+
var searchParams = new URLSearchParams(response);
|
|
95
|
+
var _iterator = _createForOfIteratorHelper(searchParams),
|
|
96
|
+
_step;
|
|
97
|
+
try {
|
|
98
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
99
|
+
var p = _step.value;
|
|
100
|
+
data[p[0]] = p[1];
|
|
101
|
+
}
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator.f();
|
|
106
|
+
}
|
|
107
|
+
if (data.access_token) {
|
|
108
|
+
if (isOnlyGetToken) onResolve({
|
|
109
|
+
provider: 'github',
|
|
110
|
+
data: data
|
|
111
|
+
});else getProfile(data);
|
|
112
|
+
} else onReject('no data');
|
|
113
|
+
})["catch"](function (err) {
|
|
114
|
+
onReject(err);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}, [state, onReject, getProfile, onResolve, client_id, redirect_uri, client_secret, isOnlyGetCode, isOnlyGetToken]);
|
|
118
|
+
var handlePostMessage = useCallback( /*#__PURE__*/function () {
|
|
119
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
120
|
+
var type, code, provider;
|
|
121
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
122
|
+
while (1) switch (_context.prev = _context.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
type = _ref2.type, code = _ref2.code, provider = _ref2.provider;
|
|
125
|
+
return _context.abrupt("return", type === 'code' && provider === 'github' && code && getAccessToken(code));
|
|
126
|
+
case 2:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
129
|
+
}
|
|
130
|
+
}, _callee);
|
|
131
|
+
}));
|
|
132
|
+
return function (_x) {
|
|
133
|
+
return _ref3.apply(this, arguments);
|
|
134
|
+
};
|
|
135
|
+
}(), [getAccessToken]);
|
|
136
|
+
var onChangeLocalStorage = useCallback(function () {
|
|
137
|
+
window.removeEventListener('storage', onChangeLocalStorage, false);
|
|
138
|
+
var code = localStorage.getItem('github');
|
|
139
|
+
if (code) {
|
|
140
|
+
handlePostMessage({
|
|
141
|
+
provider: 'github',
|
|
142
|
+
type: 'code',
|
|
143
|
+
code: code
|
|
144
|
+
});
|
|
145
|
+
localStorage.removeItem('github');
|
|
146
|
+
}
|
|
147
|
+
}, [handlePostMessage]);
|
|
148
|
+
var onLogin = useCallback(function () {
|
|
149
|
+
onLoginStart && onLoginStart();
|
|
150
|
+
window.addEventListener('storage', onChangeLocalStorage, false);
|
|
151
|
+
var oauthUrl = "".concat(GITHUB_URL, "/login/oauth/authorize?client_id=").concat(client_id, "&scope=").concat(scope, "&state=").concat(state + '_github', "&redirect_uri=").concat(redirect_uri, "&allow_signup=").concat(allow_signup);
|
|
152
|
+
var width = 450;
|
|
153
|
+
var height = 730;
|
|
154
|
+
var left = window.screen.width / 2 - width / 2;
|
|
155
|
+
var top = window.screen.height / 2 - height / 2;
|
|
156
|
+
window.open(oauthUrl, 'Github', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
|
|
157
|
+
}, [scope, state, client_id, redirect_uri, allow_signup, onLoginStart, onChangeLocalStorage]);
|
|
158
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: className,
|
|
160
|
+
onClick: onLogin
|
|
161
|
+
}, children);
|
|
162
|
+
};
|
|
163
|
+
export default /*#__PURE__*/memo(LoginSocialGithub);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { objectType, IResolveParams } from "..";
|
|
3
|
+
interface Props {
|
|
4
|
+
scope?: string;
|
|
5
|
+
prompt?: string;
|
|
6
|
+
ux_mode?: string;
|
|
7
|
+
client_id: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
login_hint?: string;
|
|
10
|
+
access_type?: string;
|
|
11
|
+
auto_select?: boolean;
|
|
12
|
+
redirect_uri?: string;
|
|
13
|
+
cookie_policy?: string;
|
|
14
|
+
hosted_domain?: string;
|
|
15
|
+
discoveryDocs?: string;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
onLoginStart?: () => void;
|
|
18
|
+
isOnlyGetToken?: boolean;
|
|
19
|
+
typeResponse?: 'idToken' | 'accessToken';
|
|
20
|
+
onReject: (reject: string | objectType) => void;
|
|
21
|
+
fetch_basic_profile?: boolean;
|
|
22
|
+
onResolve: ({ provider, data }: IResolveParams) => void;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: React.MemoExoticComponent<({ client_id, scope, prompt, typeResponse, ux_mode, className, login_hint, access_type, onLoginStart, onReject, onResolve, redirect_uri, auto_select, isOnlyGetToken, cookie_policy, hosted_domain, discoveryDocs, children, fetch_basic_profile, }: Props) => JSX.Element>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* LoginSocialGoogle
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
// import { PASS_CORS_KEY } from 'helper/constants';
|
|
8
|
+
"use client";
|
|
9
|
+
|
|
10
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
11
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
|
+
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
13
|
+
// const SCOPE = ''
|
|
14
|
+
// const JS_SRC = 'https://apis.google.com/js/api.js'
|
|
15
|
+
var JS_SRC = 'https://accounts.google.com/gsi/client';
|
|
16
|
+
var SCRIPT_ID = 'google-login';
|
|
17
|
+
var PREVENT_CORS_URL = '';
|
|
18
|
+
var _window = global.window;
|
|
19
|
+
var LoginSocialGoogle = function LoginSocialGoogle(_ref) {
|
|
20
|
+
var client_id = _ref.client_id,
|
|
21
|
+
_ref$scope = _ref.scope,
|
|
22
|
+
scope = _ref$scope === void 0 ? 'https://www.googleapis.com/auth/userinfo.profile' : _ref$scope,
|
|
23
|
+
_ref$prompt = _ref.prompt,
|
|
24
|
+
prompt = _ref$prompt === void 0 ? 'select_account' : _ref$prompt,
|
|
25
|
+
_ref$typeResponse = _ref.typeResponse,
|
|
26
|
+
typeResponse = _ref$typeResponse === void 0 ? 'accessToken' : _ref$typeResponse,
|
|
27
|
+
ux_mode = _ref.ux_mode,
|
|
28
|
+
_ref$className = _ref.className,
|
|
29
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
30
|
+
_ref$login_hint = _ref.login_hint,
|
|
31
|
+
login_hint = _ref$login_hint === void 0 ? '' : _ref$login_hint,
|
|
32
|
+
_ref$access_type = _ref.access_type,
|
|
33
|
+
access_type = _ref$access_type === void 0 ? 'online' : _ref$access_type,
|
|
34
|
+
onLoginStart = _ref.onLoginStart,
|
|
35
|
+
onReject = _ref.onReject,
|
|
36
|
+
onResolve = _ref.onResolve,
|
|
37
|
+
_ref$redirect_uri = _ref.redirect_uri,
|
|
38
|
+
redirect_uri = _ref$redirect_uri === void 0 ? '/' : _ref$redirect_uri,
|
|
39
|
+
_ref$auto_select = _ref.auto_select,
|
|
40
|
+
auto_select = _ref$auto_select === void 0 ? false : _ref$auto_select,
|
|
41
|
+
_ref$isOnlyGetToken = _ref.isOnlyGetToken,
|
|
42
|
+
isOnlyGetToken = _ref$isOnlyGetToken === void 0 ? false : _ref$isOnlyGetToken,
|
|
43
|
+
_ref$cookie_policy = _ref.cookie_policy,
|
|
44
|
+
cookie_policy = _ref$cookie_policy === void 0 ? 'single_host_origin' : _ref$cookie_policy,
|
|
45
|
+
_ref$hosted_domain = _ref.hosted_domain,
|
|
46
|
+
hosted_domain = _ref$hosted_domain === void 0 ? '' : _ref$hosted_domain,
|
|
47
|
+
_ref$discoveryDocs = _ref.discoveryDocs,
|
|
48
|
+
discoveryDocs = _ref$discoveryDocs === void 0 ? '' : _ref$discoveryDocs,
|
|
49
|
+
children = _ref.children,
|
|
50
|
+
_ref$fetch_basic_prof = _ref.fetch_basic_profile,
|
|
51
|
+
fetch_basic_profile = _ref$fetch_basic_prof === void 0 ? true : _ref$fetch_basic_prof;
|
|
52
|
+
var scriptNodeRef = useRef(null);
|
|
53
|
+
var _useState = useState(false),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
isSdkLoaded = _useState2[0],
|
|
56
|
+
setIsSdkLoaded = _useState2[1];
|
|
57
|
+
var _useState3 = useState(null),
|
|
58
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
|
+
instance = _useState4[0],
|
|
60
|
+
setInstance = _useState4[1];
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
!isSdkLoaded && load();
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
+
}, [isSdkLoaded]);
|
|
65
|
+
useEffect(function () {
|
|
66
|
+
return function () {
|
|
67
|
+
if (scriptNodeRef.current) scriptNodeRef.current.remove();
|
|
68
|
+
};
|
|
69
|
+
}, []);
|
|
70
|
+
var checkIsExistsSDKScript = useCallback(function () {
|
|
71
|
+
return !!document.getElementById(SCRIPT_ID);
|
|
72
|
+
}, []);
|
|
73
|
+
var insertScriptGoogle = useCallback(function (d) {
|
|
74
|
+
var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'script';
|
|
75
|
+
var id = arguments.length > 2 ? arguments[2] : undefined;
|
|
76
|
+
var jsSrc = arguments.length > 3 ? arguments[3] : undefined;
|
|
77
|
+
var cb = arguments.length > 4 ? arguments[4] : undefined;
|
|
78
|
+
var ggScriptTag = d.createElement(s);
|
|
79
|
+
ggScriptTag.id = id;
|
|
80
|
+
ggScriptTag.src = jsSrc;
|
|
81
|
+
ggScriptTag.async = true;
|
|
82
|
+
ggScriptTag.defer = true;
|
|
83
|
+
var scriptNode = document.getElementsByTagName('script')[0];
|
|
84
|
+
scriptNodeRef.current = ggScriptTag;
|
|
85
|
+
scriptNode && scriptNode.parentNode && scriptNode.parentNode.insertBefore(ggScriptTag, scriptNode);
|
|
86
|
+
ggScriptTag.onload = cb;
|
|
87
|
+
}, []);
|
|
88
|
+
var onGetMe = useCallback(function (res) {
|
|
89
|
+
if (typeResponse === 'accessToken') {
|
|
90
|
+
var headers = new Headers({
|
|
91
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
92
|
+
// 'x-cors-grida-api-key': PASS_CORS_KEY,
|
|
93
|
+
Authorization: 'Bearer ' + res.access_token
|
|
94
|
+
});
|
|
95
|
+
fetch("".concat(PREVENT_CORS_URL, "/https://www.googleapis.com/oauth2/v3/userinfo?alt=json"), {
|
|
96
|
+
method: 'GET',
|
|
97
|
+
headers: headers
|
|
98
|
+
}).then(function (response) {
|
|
99
|
+
return response.json();
|
|
100
|
+
}).then(function (response) {
|
|
101
|
+
var data = _extends({}, res, response);
|
|
102
|
+
onResolve({
|
|
103
|
+
provider: 'google',
|
|
104
|
+
data: data
|
|
105
|
+
});
|
|
106
|
+
})["catch"](function (err) {
|
|
107
|
+
onReject(err);
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
fetch("https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=".concat(res.credential), {
|
|
111
|
+
method: 'GET'
|
|
112
|
+
}).then(function (response) {
|
|
113
|
+
return response.json();
|
|
114
|
+
}).then(function (response) {
|
|
115
|
+
var data = _extends({}, res, response);
|
|
116
|
+
onResolve({
|
|
117
|
+
provider: 'google',
|
|
118
|
+
data: data
|
|
119
|
+
});
|
|
120
|
+
})["catch"](function (err) {
|
|
121
|
+
onReject(err);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}, [typeResponse, onReject, onResolve]);
|
|
125
|
+
var handleResponse = useCallback(function (res) {
|
|
126
|
+
if (res && access_type === 'offline') onResolve({
|
|
127
|
+
provider: 'google',
|
|
128
|
+
data: res
|
|
129
|
+
});else {
|
|
130
|
+
if (res !== null && res !== void 0 && res.access_token) {
|
|
131
|
+
if (isOnlyGetToken) onResolve({
|
|
132
|
+
provider: 'google',
|
|
133
|
+
data: res
|
|
134
|
+
});else onGetMe(res);
|
|
135
|
+
} else {
|
|
136
|
+
var data = res;
|
|
137
|
+
if (isOnlyGetToken) onResolve({
|
|
138
|
+
provider: 'google',
|
|
139
|
+
data: data
|
|
140
|
+
});else onGetMe(res);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, [access_type, isOnlyGetToken, onGetMe, onResolve]);
|
|
144
|
+
var handleError = useCallback(function (res) {
|
|
145
|
+
onReject({
|
|
146
|
+
provider: 'google',
|
|
147
|
+
data: res
|
|
148
|
+
});
|
|
149
|
+
}, [onReject]);
|
|
150
|
+
var load = useCallback(function () {
|
|
151
|
+
if (checkIsExistsSDKScript()) {
|
|
152
|
+
setIsSdkLoaded(true);
|
|
153
|
+
} else {
|
|
154
|
+
insertScriptGoogle(document, 'script', SCRIPT_ID, JS_SRC, function () {
|
|
155
|
+
var params = {
|
|
156
|
+
client_id: client_id,
|
|
157
|
+
ux_mode: ux_mode
|
|
158
|
+
};
|
|
159
|
+
var client = null;
|
|
160
|
+
if (typeResponse === 'idToken') {
|
|
161
|
+
_window.google.accounts.id.initialize(_extends({}, params, {
|
|
162
|
+
auto_select: auto_select,
|
|
163
|
+
prompt: 'select_account',
|
|
164
|
+
login_uri: redirect_uri,
|
|
165
|
+
callback: handleResponse,
|
|
166
|
+
native_callback: handleResponse,
|
|
167
|
+
error_callback: handleError
|
|
168
|
+
}));
|
|
169
|
+
} else {
|
|
170
|
+
var payload = _extends({}, params, {
|
|
171
|
+
scope: scope,
|
|
172
|
+
prompt: prompt,
|
|
173
|
+
login_hint: login_hint,
|
|
174
|
+
access_type: access_type,
|
|
175
|
+
hosted_domain: hosted_domain,
|
|
176
|
+
redirect_uri: redirect_uri,
|
|
177
|
+
cookie_policy: cookie_policy,
|
|
178
|
+
discoveryDocs: discoveryDocs,
|
|
179
|
+
immediate: true,
|
|
180
|
+
fetch_basic_profile: fetch_basic_profile,
|
|
181
|
+
callback: handleResponse,
|
|
182
|
+
error_callback: handleError
|
|
183
|
+
});
|
|
184
|
+
if (access_type === 'offline') client = _window.google.accounts.oauth2.initCodeClient(payload);else client = _window.google.accounts.oauth2.initTokenClient(payload);
|
|
185
|
+
}
|
|
186
|
+
if (client) setInstance(client);
|
|
187
|
+
setIsSdkLoaded(true);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}, [scope, prompt, ux_mode, client_id, login_hint, auto_select, access_type, redirect_uri, typeResponse, discoveryDocs, cookie_policy, hosted_domain, handleResponse, handleError, fetch_basic_profile, insertScriptGoogle, checkIsExistsSDKScript]);
|
|
191
|
+
var loginGoogle = useCallback(function () {
|
|
192
|
+
if (!isSdkLoaded) return;
|
|
193
|
+
if (!_window.google) {
|
|
194
|
+
load();
|
|
195
|
+
onReject("Google SDK isn't loaded!");
|
|
196
|
+
} else {
|
|
197
|
+
onLoginStart && onLoginStart();
|
|
198
|
+
if (instance) access_type === 'offline' ? instance.requestCode() : instance.requestAccessToken();else _window.google.accounts.id.prompt();
|
|
199
|
+
}
|
|
200
|
+
}, [access_type, instance, isSdkLoaded, load, onLoginStart, onReject]);
|
|
201
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
className: className,
|
|
203
|
+
onClick: loginGoogle
|
|
204
|
+
}, children);
|
|
205
|
+
};
|
|
206
|
+
export default /*#__PURE__*/memo(LoginSocialGoogle);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { objectType, IResolveParams } from "..";
|
|
3
|
+
interface Props {
|
|
4
|
+
scope?: string;
|
|
5
|
+
state?: string;
|
|
6
|
+
fields?: string;
|
|
7
|
+
client_id: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
client_secret: string;
|
|
10
|
+
redirect_uri: string;
|
|
11
|
+
response_type?: string;
|
|
12
|
+
isOnlyGetCode?: boolean;
|
|
13
|
+
isOnlyGetToken?: boolean;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
onLogoutSuccess?: () => void;
|
|
16
|
+
onLoginStart?: () => void;
|
|
17
|
+
onReject: (reject: string | objectType) => void;
|
|
18
|
+
onResolve: ({ provider, data }: IResolveParams) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const LoginSocialInstagram: ({ state, client_id, client_secret, className, redirect_uri, fields, scope, response_type, isOnlyGetCode, isOnlyGetToken, children, onReject, onResolve, onLoginStart, }: Props) => JSX.Element;
|
|
21
|
+
declare const _default: React.MemoExoticComponent<({ state, client_id, client_secret, className, redirect_uri, fields, scope, response_type, isOnlyGetCode, isOnlyGetToken, children, onReject, onResolve, onLoginStart, }: Props) => JSX.Element>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* LoginSocialInstagram
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
// import { PASS_CORS_KEY } from 'helper/constants';
|
|
8
|
+
"use client";
|
|
9
|
+
|
|
10
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
11
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
12
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
|
+
import React, { memo, useCallback, useEffect } from 'react';
|
|
14
|
+
var INSTAGRAM_URL = 'https://api.instagram.com';
|
|
15
|
+
var INSTAGRAM_API_URL = 'https://graph.instagram.com/';
|
|
16
|
+
var PREVENT_CORS_URL = '';
|
|
17
|
+
export var LoginSocialInstagram = function LoginSocialInstagram(_ref) {
|
|
18
|
+
var _ref$state = _ref.state,
|
|
19
|
+
state = _ref$state === void 0 ? '' : _ref$state,
|
|
20
|
+
client_id = _ref.client_id,
|
|
21
|
+
client_secret = _ref.client_secret,
|
|
22
|
+
className = _ref.className,
|
|
23
|
+
redirect_uri = _ref.redirect_uri,
|
|
24
|
+
_ref$fields = _ref.fields,
|
|
25
|
+
fields = _ref$fields === void 0 ? 'id,username,account_type,media_count' : _ref$fields,
|
|
26
|
+
_ref$scope = _ref.scope,
|
|
27
|
+
scope = _ref$scope === void 0 ? 'user_profile,user_media' : _ref$scope,
|
|
28
|
+
_ref$response_type = _ref.response_type,
|
|
29
|
+
response_type = _ref$response_type === void 0 ? 'code' : _ref$response_type,
|
|
30
|
+
_ref$isOnlyGetCode = _ref.isOnlyGetCode,
|
|
31
|
+
isOnlyGetCode = _ref$isOnlyGetCode === void 0 ? false : _ref$isOnlyGetCode,
|
|
32
|
+
_ref$isOnlyGetToken = _ref.isOnlyGetToken,
|
|
33
|
+
isOnlyGetToken = _ref$isOnlyGetToken === void 0 ? false : _ref$isOnlyGetToken,
|
|
34
|
+
children = _ref.children,
|
|
35
|
+
onReject = _ref.onReject,
|
|
36
|
+
onResolve = _ref.onResolve,
|
|
37
|
+
onLoginStart = _ref.onLoginStart;
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
var popupWindowURL = new URL(window.location.href);
|
|
40
|
+
var code = popupWindowURL.searchParams.get('code');
|
|
41
|
+
var state = popupWindowURL.searchParams.get('state');
|
|
42
|
+
if (state !== null && state !== void 0 && state.includes('_instagram') && code) {
|
|
43
|
+
localStorage.setItem('instagram', code);
|
|
44
|
+
window.close();
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
var getProfile = useCallback(function (data) {
|
|
48
|
+
fetch("".concat(PREVENT_CORS_URL, "/").concat(INSTAGRAM_API_URL, "/me?fields=").concat(fields, "&access_token=").concat(data.access_token), {
|
|
49
|
+
method: 'GET',
|
|
50
|
+
headers: {
|
|
51
|
+
// 'x-cors-grida-api-key': PASS_CORS_KEY,
|
|
52
|
+
}
|
|
53
|
+
}).then(function (res) {
|
|
54
|
+
return res.json();
|
|
55
|
+
}).then(function (res) {
|
|
56
|
+
onResolve({
|
|
57
|
+
provider: 'instagram',
|
|
58
|
+
data: _extends({}, res, data)
|
|
59
|
+
});
|
|
60
|
+
})["catch"](function (err) {
|
|
61
|
+
onReject(err);
|
|
62
|
+
});
|
|
63
|
+
}, [fields, onReject, onResolve]);
|
|
64
|
+
var getAccessToken = useCallback(function (code) {
|
|
65
|
+
if (isOnlyGetCode) onResolve({
|
|
66
|
+
provider: 'instagram',
|
|
67
|
+
data: {
|
|
68
|
+
code: code
|
|
69
|
+
}
|
|
70
|
+
});else {
|
|
71
|
+
var params = {
|
|
72
|
+
grant_type: 'authorization_code',
|
|
73
|
+
code: code,
|
|
74
|
+
redirect_uri: redirect_uri,
|
|
75
|
+
client_id: client_id,
|
|
76
|
+
client_secret: client_secret
|
|
77
|
+
};
|
|
78
|
+
var headers = new Headers({
|
|
79
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
80
|
+
// 'x-cors-grida-api-key': PASS_CORS_KEY,
|
|
81
|
+
});
|
|
82
|
+
fetch("".concat(PREVENT_CORS_URL, "/").concat(INSTAGRAM_URL, "/oauth/access_token"), {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
headers: headers,
|
|
85
|
+
body: new URLSearchParams(params)
|
|
86
|
+
}).then(function (response) {
|
|
87
|
+
return response.json();
|
|
88
|
+
}).then(function (data) {
|
|
89
|
+
if (data.access_token) {
|
|
90
|
+
if (isOnlyGetToken) onResolve({
|
|
91
|
+
provider: 'instagram',
|
|
92
|
+
data: data
|
|
93
|
+
});else getProfile(data);
|
|
94
|
+
} else onReject('no data');
|
|
95
|
+
})["catch"](function (err) {
|
|
96
|
+
onReject(err);
|
|
97
|
+
})["finally"](function () {});
|
|
98
|
+
}
|
|
99
|
+
}, [onReject, onResolve, getProfile, client_id, redirect_uri, client_secret, isOnlyGetCode, isOnlyGetToken]);
|
|
100
|
+
var handlePostMessage = useCallback( /*#__PURE__*/function () {
|
|
101
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
102
|
+
var type, code, provider;
|
|
103
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
104
|
+
while (1) switch (_context.prev = _context.next) {
|
|
105
|
+
case 0:
|
|
106
|
+
type = _ref2.type, code = _ref2.code, provider = _ref2.provider;
|
|
107
|
+
return _context.abrupt("return", type === 'code' && provider === 'instagram' && code && getAccessToken(code));
|
|
108
|
+
case 2:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context.stop();
|
|
111
|
+
}
|
|
112
|
+
}, _callee);
|
|
113
|
+
}));
|
|
114
|
+
return function (_x) {
|
|
115
|
+
return _ref3.apply(this, arguments);
|
|
116
|
+
};
|
|
117
|
+
}(), [getAccessToken]);
|
|
118
|
+
var onChangeLocalStorage = useCallback(function () {
|
|
119
|
+
window.removeEventListener('storage', onChangeLocalStorage, false);
|
|
120
|
+
var code = localStorage.getItem('instagram');
|
|
121
|
+
if (code) {
|
|
122
|
+
handlePostMessage({
|
|
123
|
+
provider: 'instagram',
|
|
124
|
+
type: 'code',
|
|
125
|
+
code: code
|
|
126
|
+
});
|
|
127
|
+
localStorage.removeItem('instagram');
|
|
128
|
+
}
|
|
129
|
+
}, [handlePostMessage]);
|
|
130
|
+
var onLogin = useCallback(function () {
|
|
131
|
+
onLoginStart && onLoginStart();
|
|
132
|
+
window.addEventListener('storage', onChangeLocalStorage, false);
|
|
133
|
+
var oauthUrl = "".concat(INSTAGRAM_URL, "/oauth/authorize?response_type=").concat(response_type, "&client_id=").concat(client_id, "&scope=").concat(scope, "&state=").concat(state + '_instagram', "&redirect_uri=").concat(redirect_uri);
|
|
134
|
+
var width = 450;
|
|
135
|
+
var height = 730;
|
|
136
|
+
var left = window.screen.width / 2 - width / 2;
|
|
137
|
+
var top = window.screen.height / 2 - height / 2;
|
|
138
|
+
window.open(oauthUrl, 'Instagram', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
|
|
139
|
+
}, [scope, state, client_id, redirect_uri, onLoginStart, response_type, onChangeLocalStorage]);
|
|
140
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: className,
|
|
142
|
+
onClick: onLogin
|
|
143
|
+
}, children);
|
|
144
|
+
};
|
|
145
|
+
export default /*#__PURE__*/memo(LoginSocialInstagram);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IResolveParams, objectType } from "..";
|
|
3
|
+
interface Props {
|
|
4
|
+
state?: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
client_id: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
redirect_uri: string;
|
|
9
|
+
client_secret: string;
|
|
10
|
+
response_type?: string;
|
|
11
|
+
isOnlyGetCode?: boolean;
|
|
12
|
+
isOnlyGetToken?: boolean;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
onLoginStart?: () => void;
|
|
15
|
+
onReject: (reject: string | objectType) => void;
|
|
16
|
+
onResolve: ({ provider, data }: IResolveParams) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const LoginSocialLinkedin: ({ state, scope, client_id, client_secret, className, redirect_uri, response_type, isOnlyGetCode, isOnlyGetToken, children, onLoginStart, onReject, onResolve, }: Props) => JSX.Element;
|
|
19
|
+
declare const _default: React.MemoExoticComponent<({ state, scope, client_id, client_secret, className, redirect_uri, response_type, isOnlyGetCode, isOnlyGetToken, children, onLoginStart, onReject, onResolve, }: Props) => JSX.Element>;
|
|
20
|
+
export default _default;
|