@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,147 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
var _excluded = ["validate", "name", "render", "as", "children", "component", "shouldUpdate", "formik"],
|
|
9
|
+
_excluded2 = ["validate", "validationSchema"],
|
|
10
|
+
_excluded3 = ["innerRef"],
|
|
11
|
+
_excluded4 = ["innerRef"];
|
|
12
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import invariant from 'tiny-warning';
|
|
16
|
+
import { getIn, isEmptyChildren, isFunction } from './utils';
|
|
17
|
+
import { connect } from './connect';
|
|
18
|
+
/**
|
|
19
|
+
* Custom Field component for quickly hooking into Formik
|
|
20
|
+
* context and wiring up forms.
|
|
21
|
+
*/
|
|
22
|
+
var FastFieldInner = /*#__PURE__*/function (_React$Component) {
|
|
23
|
+
function FastFieldInner(props) {
|
|
24
|
+
var _this;
|
|
25
|
+
_classCallCheck(this, FastFieldInner);
|
|
26
|
+
_this = _callSuper(this, FastFieldInner, [props]);
|
|
27
|
+
var render = props.render,
|
|
28
|
+
children = props.children,
|
|
29
|
+
component = props.component,
|
|
30
|
+
is = props.as,
|
|
31
|
+
name = props.name;
|
|
32
|
+
invariant(!render, "<FastField render> has been deprecated. Please use a child callback function instead: <FastField name={".concat(name, "}>{props => ...}</FastField> instead."));
|
|
33
|
+
invariant(!(component && render), 'You should not use <FastField component> and <FastField render> in the same <FastField> component; <FastField component> will be ignored');
|
|
34
|
+
invariant(!(is && children && isFunction(children)), 'You should not use <FastField as> and <FastField children> as a function in the same <FastField> component; <FastField as> will be ignored.');
|
|
35
|
+
invariant(!(component && children && isFunction(children)), 'You should not use <FastField component> and <FastField children> as a function in the same <FastField> component; <FastField component> will be ignored.');
|
|
36
|
+
invariant(!(render && children && !isEmptyChildren(children)), 'You should not use <FastField render> and <FastField children> in the same <FastField> component; <FastField children> will be ignored');
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
_inherits(FastFieldInner, _React$Component);
|
|
40
|
+
return _createClass(FastFieldInner, [{
|
|
41
|
+
key: "shouldComponentUpdate",
|
|
42
|
+
value: function shouldComponentUpdate(props) {
|
|
43
|
+
if (this.props.shouldUpdate) {
|
|
44
|
+
return this.props.shouldUpdate(props, this.props);
|
|
45
|
+
} else if (props.name !== this.props.name || getIn(props.formik.values, this.props.name) !== getIn(this.props.formik.values, this.props.name) || getIn(props.formik.errors, this.props.name) !== getIn(this.props.formik.errors, this.props.name) || getIn(props.formik.touched, this.props.name) !== getIn(this.props.formik.touched, this.props.name) || Object.keys(this.props).length !== Object.keys(props).length || props.formik.isSubmitting !== this.props.formik.isSubmitting) {
|
|
46
|
+
return true;
|
|
47
|
+
} else {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "componentDidMount",
|
|
53
|
+
value: function componentDidMount() {
|
|
54
|
+
// Register the Field with the parent Formik. Parent will cycle through
|
|
55
|
+
// registered Field's validate fns right prior to submit
|
|
56
|
+
this.props.formik.registerField(this.props.name, {
|
|
57
|
+
validate: this.props.validate
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "componentDidUpdate",
|
|
62
|
+
value: function componentDidUpdate(prevProps) {
|
|
63
|
+
if (this.props.name !== prevProps.name) {
|
|
64
|
+
this.props.formik.unregisterField(prevProps.name);
|
|
65
|
+
this.props.formik.registerField(this.props.name, {
|
|
66
|
+
validate: this.props.validate
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (this.props.validate !== prevProps.validate) {
|
|
70
|
+
this.props.formik.registerField(this.props.name, {
|
|
71
|
+
validate: this.props.validate
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "componentWillUnmount",
|
|
77
|
+
value: function componentWillUnmount() {
|
|
78
|
+
this.props.formik.unregisterField(this.props.name);
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "render",
|
|
82
|
+
value: function render() {
|
|
83
|
+
var _ref = this.props,
|
|
84
|
+
validate = _ref.validate,
|
|
85
|
+
name = _ref.name,
|
|
86
|
+
render = _ref.render,
|
|
87
|
+
is = _ref.as,
|
|
88
|
+
children = _ref.children,
|
|
89
|
+
component = _ref.component,
|
|
90
|
+
shouldUpdate = _ref.shouldUpdate,
|
|
91
|
+
formik = _ref.formik,
|
|
92
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
93
|
+
var _validate = formik.validate,
|
|
94
|
+
_validationSchema = formik.validationSchema,
|
|
95
|
+
restOfFormik = _objectWithoutProperties(formik, _excluded2);
|
|
96
|
+
var field = formik.getFieldProps(_extends({
|
|
97
|
+
name: name
|
|
98
|
+
}, props));
|
|
99
|
+
var meta = {
|
|
100
|
+
value: getIn(formik.values, name),
|
|
101
|
+
error: getIn(formik.errors, name),
|
|
102
|
+
touched: !!getIn(formik.touched, name),
|
|
103
|
+
initialValue: getIn(formik.initialValues, name),
|
|
104
|
+
initialTouched: !!getIn(formik.initialTouched, name),
|
|
105
|
+
initialError: getIn(formik.initialErrors, name)
|
|
106
|
+
};
|
|
107
|
+
var bag = {
|
|
108
|
+
field: field,
|
|
109
|
+
meta: meta,
|
|
110
|
+
form: restOfFormik
|
|
111
|
+
};
|
|
112
|
+
if (render) {
|
|
113
|
+
return render(bag);
|
|
114
|
+
}
|
|
115
|
+
if (isFunction(children)) {
|
|
116
|
+
return children(bag);
|
|
117
|
+
}
|
|
118
|
+
if (component) {
|
|
119
|
+
// This behavior is backwards compat with earlier Formik 0.9 to 1.x
|
|
120
|
+
if (typeof component === 'string') {
|
|
121
|
+
var innerRef = props.innerRef,
|
|
122
|
+
rest = _objectWithoutProperties(props, _excluded3);
|
|
123
|
+
return /*#__PURE__*/React.createElement(component, _extends({
|
|
124
|
+
ref: innerRef
|
|
125
|
+
}, field, rest), children);
|
|
126
|
+
}
|
|
127
|
+
// We don't pass `meta` for backwards compat
|
|
128
|
+
return /*#__PURE__*/React.createElement(component, _extends({
|
|
129
|
+
field: field,
|
|
130
|
+
form: formik
|
|
131
|
+
}, props), children);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// default to input here so we can check for both `as` and `children` above
|
|
135
|
+
var asElement = is || 'input';
|
|
136
|
+
if (typeof asElement === 'string') {
|
|
137
|
+
var _innerRef = props.innerRef,
|
|
138
|
+
_rest = _objectWithoutProperties(props, _excluded4);
|
|
139
|
+
return /*#__PURE__*/React.createElement(asElement, _extends({
|
|
140
|
+
ref: _innerRef
|
|
141
|
+
}, field, _rest), children);
|
|
142
|
+
}
|
|
143
|
+
return /*#__PURE__*/React.createElement(asElement, _extends({}, field, props), children);
|
|
144
|
+
}
|
|
145
|
+
}]);
|
|
146
|
+
}(React.Component);
|
|
147
|
+
export var FastField = connect(FastFieldInner);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FormikProps, GenericFieldHTMLAttributes, FieldMetaProps, FieldHelperProps, FieldInputProps, FieldValidator } from "./types";
|
|
3
|
+
export interface FieldProps<V = any, FormValues = any> {
|
|
4
|
+
field: FieldInputProps<V>;
|
|
5
|
+
form: FormikProps<FormValues>;
|
|
6
|
+
meta: FieldMetaProps<V>;
|
|
7
|
+
}
|
|
8
|
+
export interface FieldConfig<V = any> {
|
|
9
|
+
/**
|
|
10
|
+
* Field component to render. Can either be a string like 'select' or a component.
|
|
11
|
+
*/
|
|
12
|
+
component?: string | React.ComponentType<FieldProps<V>> | React.ComponentType | React.ForwardRefExoticComponent<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component.
|
|
15
|
+
*/
|
|
16
|
+
as?: React.ComponentType<FieldProps<V>['field']> | string | React.ComponentType | React.ForwardRefExoticComponent<any>;
|
|
17
|
+
/**
|
|
18
|
+
* Render prop (works like React router's <Route render={props =>} />)
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
21
|
+
render?: (props: FieldProps<V>) => React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Children render function <Field name>{props => ...}</Field>)
|
|
24
|
+
*/
|
|
25
|
+
children?: ((props: FieldProps<V>) => React.ReactNode) | React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Validate a single field value independently
|
|
28
|
+
*/
|
|
29
|
+
validate?: FieldValidator;
|
|
30
|
+
/**
|
|
31
|
+
* Used for 'select' and related input types.
|
|
32
|
+
*/
|
|
33
|
+
multiple?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Field name
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/** HTML input type */
|
|
39
|
+
type?: string;
|
|
40
|
+
/** Field value */
|
|
41
|
+
value?: any;
|
|
42
|
+
/** Inner ref */
|
|
43
|
+
innerRef?: (instance: any) => void;
|
|
44
|
+
}
|
|
45
|
+
export type FieldAttributes<T> = {
|
|
46
|
+
className?: string;
|
|
47
|
+
} & GenericFieldHTMLAttributes & FieldConfig<T> & T & {
|
|
48
|
+
name: string;
|
|
49
|
+
};
|
|
50
|
+
export type FieldHookConfig<T> = GenericFieldHTMLAttributes & FieldConfig<T>;
|
|
51
|
+
export declare function useField<Val = any>(propsOrFieldName: string | FieldHookConfig<Val>): [FieldInputProps<Val>, FieldMetaProps<Val>, FieldHelperProps<Val>];
|
|
52
|
+
export declare function Field({ validate, name, render, children, as: is, // `as` is reserved in typescript lol
|
|
53
|
+
component, className, ...props }: FieldAttributes<any>): any;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["validate", "name", "render", "children", "as", "component", "className"],
|
|
6
|
+
_excluded2 = ["validate", "validationSchema"],
|
|
7
|
+
_excluded3 = ["innerRef"],
|
|
8
|
+
_excluded4 = ["innerRef"];
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { useFormikContext } from './FormikContext';
|
|
11
|
+
import { isFunction, isEmptyChildren, isObject } from './utils';
|
|
12
|
+
import invariant from 'tiny-warning';
|
|
13
|
+
import { __DEV__ } from './constants';
|
|
14
|
+
export function useField(propsOrFieldName) {
|
|
15
|
+
var formik = useFormikContext();
|
|
16
|
+
var getFieldProps = formik.getFieldProps,
|
|
17
|
+
getFieldMeta = formik.getFieldMeta,
|
|
18
|
+
getFieldHelpers = formik.getFieldHelpers,
|
|
19
|
+
registerField = formik.registerField,
|
|
20
|
+
unregisterField = formik.unregisterField;
|
|
21
|
+
var isAnObject = isObject(propsOrFieldName);
|
|
22
|
+
|
|
23
|
+
// Normalize propsOrFieldName to FieldHookConfig<Val>
|
|
24
|
+
var props = isAnObject ? propsOrFieldName : {
|
|
25
|
+
name: propsOrFieldName
|
|
26
|
+
};
|
|
27
|
+
var fieldName = props.name,
|
|
28
|
+
validateFn = props.validate;
|
|
29
|
+
React.useEffect(function () {
|
|
30
|
+
if (fieldName) {
|
|
31
|
+
registerField(fieldName, {
|
|
32
|
+
validate: validateFn
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return function () {
|
|
36
|
+
if (fieldName) {
|
|
37
|
+
unregisterField(fieldName);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}, [registerField, unregisterField, fieldName, validateFn]);
|
|
41
|
+
if (__DEV__) {
|
|
42
|
+
invariant(formik, 'useField() / <Field /> must be used underneath a <Formik> component or withFormik() higher order component');
|
|
43
|
+
}
|
|
44
|
+
invariant(fieldName, 'Invalid field name. Either pass `useField` a string or an object containing a `name` key.');
|
|
45
|
+
var fieldHelpers = React.useMemo(function () {
|
|
46
|
+
return getFieldHelpers(fieldName);
|
|
47
|
+
}, [getFieldHelpers, fieldName]);
|
|
48
|
+
return [getFieldProps(props), getFieldMeta(fieldName), fieldHelpers];
|
|
49
|
+
}
|
|
50
|
+
export function Field(_ref) {
|
|
51
|
+
var validate = _ref.validate,
|
|
52
|
+
name = _ref.name,
|
|
53
|
+
render = _ref.render,
|
|
54
|
+
children = _ref.children,
|
|
55
|
+
is = _ref.as,
|
|
56
|
+
component = _ref.component,
|
|
57
|
+
className = _ref.className,
|
|
58
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
59
|
+
var _useFormikContext = useFormikContext(),
|
|
60
|
+
_validate = _useFormikContext.validate,
|
|
61
|
+
_validationSchema = _useFormikContext.validationSchema,
|
|
62
|
+
formik = _objectWithoutProperties(_useFormikContext, _excluded2);
|
|
63
|
+
if (__DEV__) {
|
|
64
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
65
|
+
React.useEffect(function () {
|
|
66
|
+
invariant(!render, "<Field render> has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace <Field name=\"".concat(name, "\" render={({field, form}) => ...} /> with <Field name=\"").concat(name, "\">{({field, form, meta}) => ...}</Field>"));
|
|
67
|
+
invariant(!(is && children && isFunction(children)), 'You should not use <Field as> and <Field children> as a function in the same <Field> component; <Field as> will be ignored.');
|
|
68
|
+
invariant(!(component && children && isFunction(children)), 'You should not use <Field component> and <Field children> as a function in the same <Field> component; <Field component> will be ignored.');
|
|
69
|
+
invariant(!(render && children && !isEmptyChildren(children)), 'You should not use <Field render> and <Field children> in the same <Field> component; <Field children> will be ignored');
|
|
70
|
+
// eslint-disable-next-line
|
|
71
|
+
}, []);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Register field and field-level validation with parent <Formik>
|
|
75
|
+
var registerField = formik.registerField,
|
|
76
|
+
unregisterField = formik.unregisterField;
|
|
77
|
+
React.useEffect(function () {
|
|
78
|
+
registerField(name, {
|
|
79
|
+
validate: validate
|
|
80
|
+
});
|
|
81
|
+
return function () {
|
|
82
|
+
unregisterField(name);
|
|
83
|
+
};
|
|
84
|
+
}, [registerField, unregisterField, name, validate]);
|
|
85
|
+
var field = formik.getFieldProps(_extends({
|
|
86
|
+
name: name
|
|
87
|
+
}, props));
|
|
88
|
+
var meta = formik.getFieldMeta(name);
|
|
89
|
+
var legacyBag = {
|
|
90
|
+
field: field,
|
|
91
|
+
form: formik
|
|
92
|
+
};
|
|
93
|
+
if (render) {
|
|
94
|
+
return render(_extends({}, legacyBag, {
|
|
95
|
+
meta: meta
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
if (isFunction(children)) {
|
|
99
|
+
return children(_extends({}, legacyBag, {
|
|
100
|
+
meta: meta
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
if (component) {
|
|
104
|
+
// This behavior is backwards compat with earlier Formik 0.9 to 1.x
|
|
105
|
+
if (typeof component === 'string') {
|
|
106
|
+
var innerRef = props.innerRef,
|
|
107
|
+
rest = _objectWithoutProperties(props, _excluded3);
|
|
108
|
+
return /*#__PURE__*/React.createElement(component, _extends({
|
|
109
|
+
ref: innerRef
|
|
110
|
+
}, field, rest, {
|
|
111
|
+
className: className
|
|
112
|
+
}), children);
|
|
113
|
+
}
|
|
114
|
+
// We don't pass `meta` for backwards compat
|
|
115
|
+
return /*#__PURE__*/React.createElement(component, _extends({
|
|
116
|
+
field: field,
|
|
117
|
+
form: formik
|
|
118
|
+
}, props, {
|
|
119
|
+
className: className
|
|
120
|
+
}), children);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// default to input here so we can check for both `as` and `children` above
|
|
124
|
+
var asElement = is || 'input';
|
|
125
|
+
if (typeof asElement === 'string') {
|
|
126
|
+
var _innerRef = props.innerRef,
|
|
127
|
+
_rest = _objectWithoutProperties(props, _excluded4);
|
|
128
|
+
return /*#__PURE__*/React.createElement(asElement, _extends({
|
|
129
|
+
ref: _innerRef
|
|
130
|
+
}, field, _rest, {
|
|
131
|
+
className: className
|
|
132
|
+
}), children);
|
|
133
|
+
}
|
|
134
|
+
return /*#__PURE__*/React.createElement(asElement, _extends({}, field, props, {
|
|
135
|
+
className: className
|
|
136
|
+
}), children);
|
|
137
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
9
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
10
|
+
var _excluded = ["validate", "validationSchema"];
|
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import isEqual from 'react-fast-compare';
|
|
16
|
+
import { connect } from './connect';
|
|
17
|
+
import { getIn, isEmptyArray, isEmptyChildren, isFunction, isObject, setIn } from './utils';
|
|
18
|
+
/**
|
|
19
|
+
* Some array helpers!
|
|
20
|
+
*/
|
|
21
|
+
export var move = function move(array, from, to) {
|
|
22
|
+
var copy = copyArrayLike(array);
|
|
23
|
+
var value = copy[from];
|
|
24
|
+
copy.splice(from, 1);
|
|
25
|
+
copy.splice(to, 0, value);
|
|
26
|
+
return copy;
|
|
27
|
+
};
|
|
28
|
+
export var swap = function swap(arrayLike, indexA, indexB) {
|
|
29
|
+
var copy = copyArrayLike(arrayLike);
|
|
30
|
+
var a = copy[indexA];
|
|
31
|
+
copy[indexA] = copy[indexB];
|
|
32
|
+
copy[indexB] = a;
|
|
33
|
+
return copy;
|
|
34
|
+
};
|
|
35
|
+
export var insert = function insert(arrayLike, index, value) {
|
|
36
|
+
var copy = copyArrayLike(arrayLike);
|
|
37
|
+
copy.splice(index, 0, value);
|
|
38
|
+
return copy;
|
|
39
|
+
};
|
|
40
|
+
export var replace = function replace(arrayLike, index, value) {
|
|
41
|
+
var copy = copyArrayLike(arrayLike);
|
|
42
|
+
copy[index] = value;
|
|
43
|
+
return copy;
|
|
44
|
+
};
|
|
45
|
+
var copyArrayLike = function copyArrayLike(arrayLike) {
|
|
46
|
+
if (!arrayLike) {
|
|
47
|
+
return [];
|
|
48
|
+
} else if (Array.isArray(arrayLike)) {
|
|
49
|
+
return _toConsumableArray(arrayLike);
|
|
50
|
+
} else {
|
|
51
|
+
var maxIndex = Object.keys(arrayLike).map(function (key) {
|
|
52
|
+
return parseInt(key);
|
|
53
|
+
}).reduce(function (max, el) {
|
|
54
|
+
return el > max ? el : max;
|
|
55
|
+
}, 0);
|
|
56
|
+
return Array.from(_extends({}, arrayLike, {
|
|
57
|
+
length: maxIndex + 1
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var createAlterationHandler = function createAlterationHandler(alteration, defaultFunction) {
|
|
62
|
+
var fn = typeof alteration === 'function' ? alteration : defaultFunction;
|
|
63
|
+
return function (data) {
|
|
64
|
+
if (Array.isArray(data) || isObject(data)) {
|
|
65
|
+
var clone = copyArrayLike(data);
|
|
66
|
+
return fn(clone);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// This can be assumed to be a primitive, which
|
|
70
|
+
// is a case for top level validation errors
|
|
71
|
+
return data;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
var FieldArrayInner = /*#__PURE__*/function (_React$Component) {
|
|
75
|
+
function FieldArrayInner(props) {
|
|
76
|
+
var _this;
|
|
77
|
+
_classCallCheck(this, FieldArrayInner);
|
|
78
|
+
_this = _callSuper(this, FieldArrayInner, [props]);
|
|
79
|
+
// We need TypeScript generics on these, so we'll bind them in the constructor
|
|
80
|
+
// @todo Fix TS 3.2.1
|
|
81
|
+
_defineProperty(_this, "updateArrayField", function (fn, alterTouched, alterErrors) {
|
|
82
|
+
var _this$props = _this.props,
|
|
83
|
+
name = _this$props.name,
|
|
84
|
+
setFormikState = _this$props.formik.setFormikState;
|
|
85
|
+
setFormikState(function (prevState) {
|
|
86
|
+
var updateErrors = createAlterationHandler(alterErrors, fn);
|
|
87
|
+
var updateTouched = createAlterationHandler(alterTouched, fn);
|
|
88
|
+
|
|
89
|
+
// values fn should be executed before updateErrors and updateTouched,
|
|
90
|
+
// otherwise it causes an error with unshift.
|
|
91
|
+
var values = setIn(prevState.values, name, fn(getIn(prevState.values, name)));
|
|
92
|
+
var fieldError = alterErrors ? updateErrors(getIn(prevState.errors, name)) : undefined;
|
|
93
|
+
var fieldTouched = alterTouched ? updateTouched(getIn(prevState.touched, name)) : undefined;
|
|
94
|
+
if (isEmptyArray(fieldError)) {
|
|
95
|
+
fieldError = undefined;
|
|
96
|
+
}
|
|
97
|
+
if (isEmptyArray(fieldTouched)) {
|
|
98
|
+
fieldTouched = undefined;
|
|
99
|
+
}
|
|
100
|
+
return _extends({}, prevState, {
|
|
101
|
+
values: values,
|
|
102
|
+
errors: alterErrors ? setIn(prevState.errors, name, fieldError) : prevState.errors,
|
|
103
|
+
touched: alterTouched ? setIn(prevState.touched, name, fieldTouched) : prevState.touched
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
_defineProperty(_this, "push", function (value) {
|
|
108
|
+
return _this.updateArrayField(function (arrayLike) {
|
|
109
|
+
return [].concat(_toConsumableArray(copyArrayLike(arrayLike)), [cloneDeep(value)]);
|
|
110
|
+
}, false, false);
|
|
111
|
+
});
|
|
112
|
+
_defineProperty(_this, "handlePush", function (value) {
|
|
113
|
+
return function () {
|
|
114
|
+
return _this.push(value);
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
_defineProperty(_this, "swap", function (indexA, indexB) {
|
|
118
|
+
return _this.updateArrayField(function (array) {
|
|
119
|
+
return swap(array, indexA, indexB);
|
|
120
|
+
}, true, true);
|
|
121
|
+
});
|
|
122
|
+
_defineProperty(_this, "handleSwap", function (indexA, indexB) {
|
|
123
|
+
return function () {
|
|
124
|
+
return _this.swap(indexA, indexB);
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
_defineProperty(_this, "move", function (from, to) {
|
|
128
|
+
return _this.updateArrayField(function (array) {
|
|
129
|
+
return move(array, from, to);
|
|
130
|
+
}, true, true);
|
|
131
|
+
});
|
|
132
|
+
_defineProperty(_this, "handleMove", function (from, to) {
|
|
133
|
+
return function () {
|
|
134
|
+
return _this.move(from, to);
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
_defineProperty(_this, "insert", function (index, value) {
|
|
138
|
+
return _this.updateArrayField(function (array) {
|
|
139
|
+
return insert(array, index, value);
|
|
140
|
+
}, function (array) {
|
|
141
|
+
return insert(array, index, null);
|
|
142
|
+
}, function (array) {
|
|
143
|
+
return insert(array, index, null);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
_defineProperty(_this, "handleInsert", function (index, value) {
|
|
147
|
+
return function () {
|
|
148
|
+
return _this.insert(index, value);
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
_defineProperty(_this, "replace", function (index, value) {
|
|
152
|
+
return _this.updateArrayField(function (array) {
|
|
153
|
+
return replace(array, index, value);
|
|
154
|
+
}, false, false);
|
|
155
|
+
});
|
|
156
|
+
_defineProperty(_this, "handleReplace", function (index, value) {
|
|
157
|
+
return function () {
|
|
158
|
+
return _this.replace(index, value);
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
_defineProperty(_this, "unshift", function (value) {
|
|
162
|
+
var length = -1;
|
|
163
|
+
_this.updateArrayField(function (array) {
|
|
164
|
+
var arr = array ? [value].concat(_toConsumableArray(array)) : [value];
|
|
165
|
+
length = arr.length;
|
|
166
|
+
return arr;
|
|
167
|
+
}, function (array) {
|
|
168
|
+
return array ? [null].concat(_toConsumableArray(array)) : [null];
|
|
169
|
+
}, function (array) {
|
|
170
|
+
return array ? [null].concat(_toConsumableArray(array)) : [null];
|
|
171
|
+
});
|
|
172
|
+
return length;
|
|
173
|
+
});
|
|
174
|
+
_defineProperty(_this, "handleUnshift", function (value) {
|
|
175
|
+
return function () {
|
|
176
|
+
return _this.unshift(value);
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
_defineProperty(_this, "handleRemove", function (index) {
|
|
180
|
+
return function () {
|
|
181
|
+
return _this.remove(index);
|
|
182
|
+
};
|
|
183
|
+
});
|
|
184
|
+
_defineProperty(_this, "handlePop", function () {
|
|
185
|
+
return function () {
|
|
186
|
+
return _this.pop();
|
|
187
|
+
};
|
|
188
|
+
});
|
|
189
|
+
_this.remove = _this.remove.bind(_this);
|
|
190
|
+
_this.pop = _this.pop.bind(_this);
|
|
191
|
+
return _this;
|
|
192
|
+
}
|
|
193
|
+
_inherits(FieldArrayInner, _React$Component);
|
|
194
|
+
return _createClass(FieldArrayInner, [{
|
|
195
|
+
key: "componentDidUpdate",
|
|
196
|
+
value: function componentDidUpdate(prevProps) {
|
|
197
|
+
if (this.props.validateOnChange && this.props.formik.validateOnChange && !isEqual(getIn(prevProps.formik.values, prevProps.name), getIn(this.props.formik.values, this.props.name))) {
|
|
198
|
+
this.props.formik.validateForm(this.props.formik.values);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}, {
|
|
202
|
+
key: "remove",
|
|
203
|
+
value: function remove(index) {
|
|
204
|
+
// We need to make sure we also remove relevant pieces of `touched` and `errors`
|
|
205
|
+
var result;
|
|
206
|
+
this.updateArrayField(
|
|
207
|
+
// so this gets call 3 times
|
|
208
|
+
function (array) {
|
|
209
|
+
var copy = array ? copyArrayLike(array) : [];
|
|
210
|
+
if (!result) {
|
|
211
|
+
result = copy[index];
|
|
212
|
+
}
|
|
213
|
+
if (isFunction(copy.splice)) {
|
|
214
|
+
copy.splice(index, 1);
|
|
215
|
+
}
|
|
216
|
+
// if the array only includes undefined values we have to return an empty array
|
|
217
|
+
return isFunction(copy.every) ? copy.every(function (v) {
|
|
218
|
+
return v === undefined;
|
|
219
|
+
}) ? [] : copy : copy;
|
|
220
|
+
}, true, true);
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
key: "pop",
|
|
225
|
+
value: function pop() {
|
|
226
|
+
// Remove relevant pieces of `touched` and `errors` too!
|
|
227
|
+
var result;
|
|
228
|
+
this.updateArrayField(
|
|
229
|
+
// so this gets call 3 times
|
|
230
|
+
function (array) {
|
|
231
|
+
var tmp = array.slice();
|
|
232
|
+
if (!result) {
|
|
233
|
+
result = tmp && tmp.pop && tmp.pop();
|
|
234
|
+
}
|
|
235
|
+
return tmp;
|
|
236
|
+
}, true, true);
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "render",
|
|
241
|
+
value: function render() {
|
|
242
|
+
var arrayHelpers = {
|
|
243
|
+
push: this.push,
|
|
244
|
+
pop: this.pop,
|
|
245
|
+
swap: this.swap,
|
|
246
|
+
move: this.move,
|
|
247
|
+
insert: this.insert,
|
|
248
|
+
replace: this.replace,
|
|
249
|
+
unshift: this.unshift,
|
|
250
|
+
remove: this.remove,
|
|
251
|
+
handlePush: this.handlePush,
|
|
252
|
+
handlePop: this.handlePop,
|
|
253
|
+
handleSwap: this.handleSwap,
|
|
254
|
+
handleMove: this.handleMove,
|
|
255
|
+
handleInsert: this.handleInsert,
|
|
256
|
+
handleReplace: this.handleReplace,
|
|
257
|
+
handleUnshift: this.handleUnshift,
|
|
258
|
+
handleRemove: this.handleRemove
|
|
259
|
+
};
|
|
260
|
+
var _this$props2 = this.props,
|
|
261
|
+
component = _this$props2.component,
|
|
262
|
+
render = _this$props2.render,
|
|
263
|
+
children = _this$props2.children,
|
|
264
|
+
name = _this$props2.name,
|
|
265
|
+
_this$props2$formik = _this$props2.formik,
|
|
266
|
+
_validate = _this$props2$formik.validate,
|
|
267
|
+
_validationSchema = _this$props2$formik.validationSchema,
|
|
268
|
+
restOfFormik = _objectWithoutProperties(_this$props2$formik, _excluded);
|
|
269
|
+
var props = _extends({}, arrayHelpers, {
|
|
270
|
+
form: restOfFormik,
|
|
271
|
+
name: name
|
|
272
|
+
});
|
|
273
|
+
return component ? /*#__PURE__*/React.createElement(component, props) : render ? render(props) : children // children come last, always called
|
|
274
|
+
? typeof children === 'function' ? children(props) : !isEmptyChildren(children) ? React.Children.only(children) : null : null;
|
|
275
|
+
}
|
|
276
|
+
}]);
|
|
277
|
+
}(React.Component);
|
|
278
|
+
_defineProperty(FieldArrayInner, "defaultProps", {
|
|
279
|
+
validateOnChange: true
|
|
280
|
+
});
|
|
281
|
+
export var FieldArray = connect(FieldArrayInner);
|
package/esm/form/Form.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["action"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useFormikContext } from './FormikContext';
|
|
6
|
+
// @todo tests
|
|
7
|
+
export var Form = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
8
|
+
// iOS needs an "action" attribute for nice input: https://stackoverflow.com/a/39485162/406725
|
|
9
|
+
// We default the action to "#" in case the preventDefault fails (just updates the URL hash)
|
|
10
|
+
var action = props.action,
|
|
11
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
12
|
+
var _action = action !== null && action !== void 0 ? action : '#';
|
|
13
|
+
var _useFormikContext = useFormikContext(),
|
|
14
|
+
handleReset = _useFormikContext.handleReset,
|
|
15
|
+
handleSubmit = _useFormikContext.handleSubmit;
|
|
16
|
+
return /*#__PURE__*/React.createElement("form", _extends({
|
|
17
|
+
onSubmit: handleSubmit,
|
|
18
|
+
ref: ref,
|
|
19
|
+
onReset: handleReset,
|
|
20
|
+
action: _action
|
|
21
|
+
}, rest));
|
|
22
|
+
});
|
|
23
|
+
Form.displayName = 'Form';
|