@igne-agency/react-web-ui 0.0.0-stage → 0.2.1
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/LICENSE +21 -0
- package/README.md +200 -2
- package/dist/assets/spinner.js +28 -0
- package/dist/base.css +171 -0
- package/dist/components/accordion/accordion.css +93 -0
- package/dist/components/accordion/accordion.d.ts +46 -0
- package/dist/components/accordion/accordion.js +184 -0
- package/dist/components/accordion/accordion.module.js +16 -0
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/active-filters/active-filter-describers.d.ts +62 -0
- package/dist/components/active-filters/active-filter-describers.js +48 -0
- package/dist/components/active-filters/active-filters.d.ts +27 -0
- package/dist/components/active-filters/active-filters.js +96 -0
- package/dist/components/active-filters/index.d.ts +2 -0
- package/dist/components/active-filters/index.js +3 -0
- package/dist/components/attachment-tile/attachment-preview.d.ts +33 -0
- package/dist/components/attachment-tile/attachment-preview.js +181 -0
- package/dist/components/attachment-tile/attachment-tile.css +92 -0
- package/dist/components/attachment-tile/attachment-tile.d.ts +51 -0
- package/dist/components/attachment-tile/attachment-tile.js +126 -0
- package/dist/components/attachment-tile/attachment-tile.module.js +20 -0
- package/dist/components/attachment-tile/index.d.ts +2 -0
- package/dist/components/attachment-tile/index.js +3 -0
- package/dist/components/avatar/avatar.css +48 -0
- package/dist/components/avatar/avatar.d.ts +19 -0
- package/dist/components/avatar/avatar.js +98 -0
- package/dist/components/avatar/avatar.module.js +10 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/avatar-group/avatar-group-context.d.ts +15 -0
- package/dist/components/avatar-group/avatar-group-context.js +14 -0
- package/dist/components/avatar-group/avatar-group.css +62 -0
- package/dist/components/avatar-group/avatar-group.d.ts +96 -0
- package/dist/components/avatar-group/avatar-group.js +519 -0
- package/dist/components/avatar-group/avatar-group.module.js +20 -0
- package/dist/components/avatar-group/index.d.ts +1 -0
- package/dist/components/avatar-group/index.js +1 -0
- package/dist/components/badge/badge.css +101 -0
- package/dist/components/badge/badge.d.ts +17 -0
- package/dist/components/badge/badge.js +61 -0
- package/dist/components/badge/badge.module.js +4 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.css +57 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +105 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +710 -0
- package/dist/components/breadcrumbs/breadcrumbs.module.js +20 -0
- package/dist/components/breadcrumbs/index.d.ts +2 -0
- package/dist/components/breadcrumbs/index.js +3 -0
- package/dist/components/breadcrumbs/use-fold.d.ts +34 -0
- package/dist/components/breadcrumbs/use-fold.js +73 -0
- package/dist/components/button/button-attributes.d.ts +23 -0
- package/dist/components/button/button-attributes.js +17 -0
- package/dist/components/button/button.css +111 -0
- package/dist/components/button/button.d.ts +47 -0
- package/dist/components/button/button.js +210 -0
- package/dist/components/button/button.module.js +4 -0
- package/dist/components/button/close-button.d.ts +14 -0
- package/dist/components/button/close-button.js +30 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/checkbox-field/checkbox-field.d.ts +21 -0
- package/dist/components/checkbox-field/checkbox-field.js +181 -0
- package/dist/components/checkbox-field/checkbox-glyph.d.ts +12 -0
- package/dist/components/checkbox-field/checkbox-glyph.js +38 -0
- package/dist/components/checkbox-field/checkbox.css +128 -0
- package/dist/components/checkbox-field/checkbox.d.ts +14 -0
- package/dist/components/checkbox-field/checkbox.js +91 -0
- package/dist/components/checkbox-field/checkbox.module.js +14 -0
- package/dist/components/checkbox-field/index.d.ts +4 -0
- package/dist/components/checkbox-field/index.js +5 -0
- package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +14 -0
- package/dist/components/checkbox-field/tsf-checkbox-field.js +40 -0
- package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +33 -0
- package/dist/components/checkbox-group-field/checkbox-group-field.js +128 -0
- package/dist/components/checkbox-group-field/checkbox-group.css +31 -0
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +38 -0
- package/dist/components/checkbox-group-field/checkbox-group.js +102 -0
- package/dist/components/checkbox-group-field/checkbox-group.module.js +8 -0
- package/dist/components/checkbox-group-field/index.d.ts +3 -0
- package/dist/components/checkbox-group-field/index.js +4 -0
- package/dist/components/checkbox-group-field/tsf-checkbox-group-field.d.ts +15 -0
- package/dist/components/checkbox-group-field/tsf-checkbox-group-field.js +41 -0
- package/dist/components/collapsible/collapsible.css +88 -0
- package/dist/components/collapsible/collapsible.d.ts +33 -0
- package/dist/components/collapsible/collapsible.js +146 -0
- package/dist/components/collapsible/collapsible.module.js +14 -0
- package/dist/components/collapsible/index.d.ts +1 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/combobox-field/combobox-field.d.ts +66 -0
- package/dist/components/combobox-field/combobox-field.js +527 -0
- package/dist/components/combobox-field/combobox-items.d.ts +80 -0
- package/dist/components/combobox-field/combobox-items.js +27 -0
- package/dist/components/combobox-field/combobox-popup-body.d.ts +34 -0
- package/dist/components/combobox-field/combobox-popup-body.js +142 -0
- package/dist/components/combobox-field/combobox.css +535 -0
- package/dist/components/combobox-field/combobox.d.ts +105 -0
- package/dist/components/combobox-field/combobox.js +642 -0
- package/dist/components/combobox-field/combobox.module.js +46 -0
- package/dist/components/combobox-field/index.d.ts +7 -0
- package/dist/components/combobox-field/index.js +4 -0
- package/dist/components/combobox-field/item-lookups.d.ts +18 -0
- package/dist/components/combobox-field/item-lookups.js +8 -0
- package/dist/components/combobox-field/react-query.d.ts +15 -0
- package/dist/components/combobox-field/react-query.js +78 -0
- package/dist/components/combobox-field/selection.d.ts +50 -0
- package/dist/components/combobox-field/selection.js +38 -0
- package/dist/components/combobox-field/tsf-combobox-field.d.ts +33 -0
- package/dist/components/combobox-field/tsf-combobox-field.js +88 -0
- package/dist/components/combobox-field/value-state-view.css +21 -0
- package/dist/components/combobox-field/value-state-view.d.ts +35 -0
- package/dist/components/combobox-field/value-state-view.js +107 -0
- package/dist/components/combobox-field/value-state-view.module.js +10 -0
- package/dist/components/combobox-field/value-state.d.ts +49 -0
- package/dist/components/combobox-field/value-state.js +38 -0
- package/dist/components/composer/composer-attachments.d.ts +31 -0
- package/dist/components/composer/composer-attachments.js +158 -0
- package/dist/components/composer/composer-editor.css +104 -0
- package/dist/components/composer/composer-editor.d.ts +15 -0
- package/dist/components/composer/composer-editor.js +165 -0
- package/dist/components/composer/composer-editor.module.js +14 -0
- package/dist/components/composer/composer-mentions.d.ts +10 -0
- package/dist/components/composer/composer-mentions.js +294 -0
- package/dist/components/composer/composer.context.d.ts +56 -0
- package/dist/components/composer/composer.context.js +14 -0
- package/dist/components/composer/composer.css +81 -0
- package/dist/components/composer/composer.d.ts +77 -0
- package/dist/components/composer/composer.handle.d.ts +31 -0
- package/dist/components/composer/composer.handle.js +41 -0
- package/dist/components/composer/composer.js +428 -0
- package/dist/components/composer/composer.module.js +14 -0
- package/dist/components/composer/editor-behavior.d.ts +2 -0
- package/dist/components/composer/editor-behavior.js +99 -0
- package/dist/components/composer/index.d.ts +8 -0
- package/dist/components/composer/index.js +3 -0
- package/dist/components/composer/mention-node.d.ts +44 -0
- package/dist/components/composer/mention-node.js +71 -0
- package/dist/components/composer/mention-sources.d.ts +14 -0
- package/dist/components/composer/mention-text.css +14 -0
- package/dist/components/composer/mention-text.d.ts +66 -0
- package/dist/components/composer/mention-text.js +95 -0
- package/dist/components/composer/mention-text.module.js +4 -0
- package/dist/components/confirm-dialog/confirm-dialog.css +68 -0
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +75 -0
- package/dist/components/confirm-dialog/confirm-dialog.js +399 -0
- package/dist/components/confirm-dialog/confirm-dialog.module.js +14 -0
- package/dist/components/confirm-dialog/index.d.ts +1 -0
- package/dist/components/confirm-dialog/index.js +1 -0
- package/dist/components/conversation/conversation.context.d.ts +9 -0
- package/dist/components/conversation/conversation.context.js +4 -0
- package/dist/components/conversation/conversation.css +143 -0
- package/dist/components/conversation/conversation.d.ts +126 -0
- package/dist/components/conversation/conversation.js +761 -0
- package/dist/components/conversation/conversation.module.js +34 -0
- package/dist/components/conversation/group-messages.d.ts +34 -0
- package/dist/components/conversation/group-messages.js +64 -0
- package/dist/components/conversation/index.d.ts +4 -0
- package/dist/components/conversation/index.js +3 -0
- package/dist/components/conversation/moment.d.ts +11 -0
- package/dist/components/conversation/moment.js +15 -0
- package/dist/components/date-field/date-field.d.ts +45 -0
- package/dist/components/date-field/date-field.js +162 -0
- package/dist/components/date-field/date-input.d.ts +46 -0
- package/dist/components/date-field/date-input.js +109 -0
- package/dist/components/date-field/index.d.ts +4 -0
- package/dist/components/date-field/index.js +4 -0
- package/dist/components/date-field/tsf-date-field.d.ts +14 -0
- package/dist/components/date-field/tsf-date-field.js +40 -0
- package/dist/components/date-range-field/date-range-field.d.ts +53 -0
- package/dist/components/date-range-field/date-range-field.js +167 -0
- package/dist/components/date-range-field/date-range-input.d.ts +51 -0
- package/dist/components/date-range-field/date-range-input.js +109 -0
- package/dist/components/date-range-field/index.d.ts +4 -0
- package/dist/components/date-range-field/index.js +5 -0
- package/dist/components/date-range-field/tsf-date-range-field.d.ts +15 -0
- package/dist/components/date-range-field/tsf-date-range-field.js +58 -0
- package/dist/components/detail-list/detail-list.css +32 -0
- package/dist/components/detail-list/detail-list.d.ts +41 -0
- package/dist/components/detail-list/detail-list.js +163 -0
- package/dist/components/detail-list/detail-list.module.js +14 -0
- package/dist/components/detail-list/index.d.ts +1 -0
- package/dist/components/detail-list/index.js +1 -0
- package/dist/components/dialog/dialog.css +78 -0
- package/dist/components/dialog/dialog.d.ts +59 -0
- package/dist/components/dialog/dialog.js +245 -0
- package/dist/components/dialog/dialog.module.js +16 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/divider/divider.css +16 -0
- package/dist/components/divider/divider.d.ts +13 -0
- package/dist/components/divider/divider.js +47 -0
- package/dist/components/divider/divider.module.js +10 -0
- package/dist/components/divider/index.d.ts +1 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/drawer.css +168 -0
- package/dist/components/drawer/drawer.d.ts +65 -0
- package/dist/components/drawer/drawer.js +219 -0
- package/dist/components/drawer/drawer.module.js +16 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/email-field/email-field.d.ts +11 -0
- package/dist/components/email-field/email-field.js +45 -0
- package/dist/components/email-field/index.d.ts +2 -0
- package/dist/components/email-field/index.js +3 -0
- package/dist/components/email-field/tsf-email-field.d.ts +13 -0
- package/dist/components/email-field/tsf-email-field.js +14 -0
- package/dist/components/empty-message/empty-message.d.ts +16 -0
- package/dist/components/empty-message/empty-message.js +31 -0
- package/dist/components/empty-message/index.d.ts +1 -0
- package/dist/components/empty-message/index.js +1 -0
- package/dist/components/error-boundary/error-boundary.d.ts +43 -0
- package/dist/components/error-boundary/error-boundary.js +60 -0
- package/dist/components/error-boundary/index.d.ts +1 -0
- package/dist/components/error-boundary/index.js +1 -0
- package/dist/components/error-message/error-message.d.ts +15 -0
- package/dist/components/error-message/error-message.js +30 -0
- package/dist/components/error-message/index.d.ts +1 -0
- package/dist/components/error-message/index.js +1 -0
- package/dist/components/error-text/error-cascade.d.ts +32 -0
- package/dist/components/error-text/error-cascade.js +49 -0
- package/dist/components/error-text/error-text.css +27 -0
- package/dist/components/error-text/error-text.d.ts +22 -0
- package/dist/components/error-text/error-text.js +139 -0
- package/dist/components/error-text/error-text.module.js +11 -0
- package/dist/components/error-text/index.d.ts +1 -0
- package/dist/components/error-text/index.js +1 -0
- package/dist/components/field/choice-option.d.ts +11 -0
- package/dist/components/field/field-state.d.ts +51 -0
- package/dist/components/field/field-state.js +28 -0
- package/dist/components/field/field.css +50 -0
- package/dist/components/field/field.d.ts +183 -0
- package/dist/components/field/field.js +434 -0
- package/dist/components/field/field.module.js +20 -0
- package/dist/components/field/fieldset.d.ts +22 -0
- package/dist/components/field/fieldset.js +130 -0
- package/dist/components/field/hidden-input.d.ts +8 -0
- package/dist/components/field/hidden-input.js +12 -0
- package/dist/components/field/index.d.ts +6 -0
- package/dist/components/field/index.js +6 -0
- package/dist/components/field/input-parts.d.ts +49 -0
- package/dist/components/field/input-parts.js +94 -0
- package/dist/components/field/options-load.d.ts +54 -0
- package/dist/components/field/options-load.js +38 -0
- package/dist/components/field/rim-focus.d.ts +10 -0
- package/dist/components/field/rim-focus.js +23 -0
- package/dist/components/field/use-field-focus.d.ts +37 -0
- package/dist/components/field/use-field-focus.js +71 -0
- package/dist/components/field/use-field-state.d.ts +32 -0
- package/dist/components/field/use-field-state.js +77 -0
- package/dist/components/field-placeholder/field-placeholder.css +22 -0
- package/dist/components/field-placeholder/field-placeholder.d.ts +10 -0
- package/dist/components/field-placeholder/field-placeholder.js +54 -0
- package/dist/components/field-placeholder/field-placeholder.module.js +12 -0
- package/dist/components/field-placeholder/index.d.ts +1 -0
- package/dist/components/field-placeholder/index.js +1 -0
- package/dist/components/file-field/file-field.css +101 -0
- package/dist/components/file-field/file-field.d.ts +59 -0
- package/dist/components/file-field/file-field.js +296 -0
- package/dist/components/file-field/file-field.module.js +10 -0
- package/dist/components/file-field/file-input.d.ts +85 -0
- package/dist/components/file-field/file-input.js +334 -0
- package/dist/components/file-field/file-size.d.ts +21 -0
- package/dist/components/file-field/file-size.js +18 -0
- package/dist/components/file-field/file-type.d.ts +21 -0
- package/dist/components/file-field/file-type.js +28 -0
- package/dist/components/file-field/index.d.ts +3 -0
- package/dist/components/file-field/index.js +4 -0
- package/dist/components/file-field/tsf-file-field.d.ts +14 -0
- package/dist/components/file-field/tsf-file-field.js +48 -0
- package/dist/components/filter-bar/filter-bar.css +34 -0
- package/dist/components/filter-bar/filter-bar.d.ts +87 -0
- package/dist/components/filter-bar/filter-bar.js +311 -0
- package/dist/components/filter-bar/filter-bar.module.js +14 -0
- package/dist/components/filter-bar/index.d.ts +2 -0
- package/dist/components/filter-bar/index.js +3 -0
- package/dist/components/filter-bar/use-filter-view.d.ts +86 -0
- package/dist/components/filter-bar/use-filter-view.js +219 -0
- package/dist/components/form/first-invalid.d.ts +10 -0
- package/dist/components/form/first-invalid.js +31 -0
- package/dist/components/form/form-context.d.ts +23 -0
- package/dist/components/form/form-context.js +28 -0
- package/dist/components/form/form.css +14 -0
- package/dist/components/form/form.d.ts +68 -0
- package/dist/components/form/form.js +317 -0
- package/dist/components/form/form.module.js +8 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/icon/icon.css +9 -0
- package/dist/components/icon/icon.d.ts +31 -0
- package/dist/components/icon/icon.js +61 -0
- package/dist/components/icon/icon.module.js +4 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icon/index.js +1 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/index.js +1 -0
- package/dist/components/link/link.css +18 -0
- package/dist/components/link/link.d.ts +11 -0
- package/dist/components/link/link.js +45 -0
- package/dist/components/link/link.module.js +4 -0
- package/dist/components/link-button/index.d.ts +1 -0
- package/dist/components/link-button/index.js +1 -0
- package/dist/components/link-button/link-button.d.ts +23 -0
- package/dist/components/link-button/link-button.js +80 -0
- package/dist/components/loading-message/index.d.ts +1 -0
- package/dist/components/loading-message/index.js +1 -0
- package/dist/components/loading-message/loading-message.d.ts +22 -0
- package/dist/components/loading-message/loading-message.js +55 -0
- package/dist/components/locale-provider/index.d.ts +1 -0
- package/dist/components/locale-provider/index.js +1 -0
- package/dist/components/locale-provider/locale-provider.d.ts +22 -0
- package/dist/components/locale-provider/locale-provider.js +50 -0
- package/dist/components/menu/index.d.ts +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/menu/menu.css +122 -0
- package/dist/components/menu/menu.d.ts +78 -0
- package/dist/components/menu/menu.js +382 -0
- package/dist/components/menu/menu.module.js +20 -0
- package/dist/components/nav/index.d.ts +3 -0
- package/dist/components/nav/index.js +3 -0
- package/dist/components/nav/nav-context.d.ts +17 -0
- package/dist/components/nav/nav-context.js +5 -0
- package/dist/components/nav/nav-item-view.d.ts +63 -0
- package/dist/components/nav/nav-item-view.js +243 -0
- package/dist/components/nav/nav.css +310 -0
- package/dist/components/nav/nav.d.ts +87 -0
- package/dist/components/nav/nav.js +481 -0
- package/dist/components/nav/nav.module.js +32 -0
- package/dist/components/number-field/index.d.ts +4 -0
- package/dist/components/number-field/index.js +5 -0
- package/dist/components/number-field/number-field-formats.d.ts +24 -0
- package/dist/components/number-field/number-field-formats.js +43 -0
- package/dist/components/number-field/number-field.css +116 -0
- package/dist/components/number-field/number-field.d.ts +34 -0
- package/dist/components/number-field/number-field.js +168 -0
- package/dist/components/number-field/number-field.module.js +16 -0
- package/dist/components/number-field/number-input.d.ts +76 -0
- package/dist/components/number-field/number-input.js +383 -0
- package/dist/components/number-field/tsf-number-field.d.ts +14 -0
- package/dist/components/number-field/tsf-number-field.js +34 -0
- package/dist/components/otp-field/index.d.ts +3 -0
- package/dist/components/otp-field/index.js +4 -0
- package/dist/components/otp-field/otp-field.css +97 -0
- package/dist/components/otp-field/otp-field.d.ts +22 -0
- package/dist/components/otp-field/otp-field.js +91 -0
- package/dist/components/otp-field/otp-field.module.js +12 -0
- package/dist/components/otp-field/otp-input-context.d.ts +27 -0
- package/dist/components/otp-field/otp-input-context.js +15 -0
- package/dist/components/otp-field/otp-input.d.ts +76 -0
- package/dist/components/otp-field/otp-input.js +341 -0
- package/dist/components/otp-field/tsf-otp-field.d.ts +14 -0
- package/dist/components/otp-field/tsf-otp-field.js +34 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/pagination-context.d.ts +23 -0
- package/dist/components/pagination/pagination-context.js +14 -0
- package/dist/components/pagination/pagination.css +24 -0
- package/dist/components/pagination/pagination.d.ts +60 -0
- package/dist/components/pagination/pagination.js +341 -0
- package/dist/components/pagination/pagination.module.js +12 -0
- package/dist/components/password-field/index.d.ts +4 -0
- package/dist/components/password-field/index.js +4 -0
- package/dist/components/password-field/password-field.css +66 -0
- package/dist/components/password-field/password-field.d.ts +44 -0
- package/dist/components/password-field/password-field.js +227 -0
- package/dist/components/password-field/password-field.module.js +20 -0
- package/dist/components/password-field/password-strength.d.ts +27 -0
- package/dist/components/password-field/password-strength.js +124 -0
- package/dist/components/password-field/tsf-password-field.d.ts +14 -0
- package/dist/components/password-field/tsf-password-field.js +34 -0
- package/dist/components/phone-field/index.d.ts +2 -0
- package/dist/components/phone-field/index.js +3 -0
- package/dist/components/phone-field/phone-field.d.ts +14 -0
- package/dist/components/phone-field/phone-field.js +29 -0
- package/dist/components/phone-field/tsf-phone-field.d.ts +14 -0
- package/dist/components/phone-field/tsf-phone-field.js +14 -0
- package/dist/components/photo-field/index.d.ts +3 -0
- package/dist/components/photo-field/index.js +4 -0
- package/dist/components/photo-field/photo-field.d.ts +29 -0
- package/dist/components/photo-field/photo-field.js +183 -0
- package/dist/components/photo-field/photo-input.css +113 -0
- package/dist/components/photo-field/photo-input.d.ts +63 -0
- package/dist/components/photo-field/photo-input.js +327 -0
- package/dist/components/photo-field/photo-input.module.js +18 -0
- package/dist/components/photo-field/tsf-photo-field.d.ts +19 -0
- package/dist/components/photo-field/tsf-photo-field.js +56 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover.css +120 -0
- package/dist/components/popover/popover.d.ts +72 -0
- package/dist/components/popover/popover.js +434 -0
- package/dist/components/popover/popover.module.js +34 -0
- package/dist/components/radio-group-field/index.d.ts +3 -0
- package/dist/components/radio-group-field/index.js +4 -0
- package/dist/components/radio-group-field/radio-group-field.d.ts +26 -0
- package/dist/components/radio-group-field/radio-group-field.js +128 -0
- package/dist/components/radio-group-field/radio-group.css +116 -0
- package/dist/components/radio-group-field/radio-group.d.ts +38 -0
- package/dist/components/radio-group-field/radio-group.js +158 -0
- package/dist/components/radio-group-field/radio-group.module.js +12 -0
- package/dist/components/radio-group-field/tsf-radio-group-field.d.ts +15 -0
- package/dist/components/radio-group-field/tsf-radio-group-field.js +41 -0
- package/dist/components/search-field/index.d.ts +2 -0
- package/dist/components/search-field/index.js +3 -0
- package/dist/components/search-field/search-field.d.ts +17 -0
- package/dist/components/search-field/search-field.js +45 -0
- package/dist/components/search-field/tsf-search-field.d.ts +14 -0
- package/dist/components/search-field/tsf-search-field.js +14 -0
- package/dist/components/segmented-control-field/index.d.ts +3 -0
- package/dist/components/segmented-control-field/index.js +4 -0
- package/dist/components/segmented-control-field/segmented-control-field.d.ts +32 -0
- package/dist/components/segmented-control-field/segmented-control-field.js +166 -0
- package/dist/components/segmented-control-field/segmented-control.css +203 -0
- package/dist/components/segmented-control-field/segmented-control.d.ts +58 -0
- package/dist/components/segmented-control-field/segmented-control.js +209 -0
- package/dist/components/segmented-control-field/segmented-control.module.js +12 -0
- package/dist/components/segmented-control-field/tsf-segmented-control-field.d.ts +15 -0
- package/dist/components/segmented-control-field/tsf-segmented-control-field.js +41 -0
- package/dist/components/select-field/index.d.ts +3 -0
- package/dist/components/select-field/index.js +4 -0
- package/dist/components/select-field/select-context.d.ts +20 -0
- package/dist/components/select-field/select-context.js +15 -0
- package/dist/components/select-field/select-field.d.ts +32 -0
- package/dist/components/select-field/select-field.js +312 -0
- package/dist/components/select-field/select.css +233 -0
- package/dist/components/select-field/select.d.ts +78 -0
- package/dist/components/select-field/select.js +529 -0
- package/dist/components/select-field/select.module.js +30 -0
- package/dist/components/select-field/tsf-select-field.d.ts +15 -0
- package/dist/components/select-field/tsf-select-field.js +41 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/skeleton.css +16 -0
- package/dist/components/skeleton/skeleton.d.ts +13 -0
- package/dist/components/skeleton/skeleton.js +34 -0
- package/dist/components/skeleton/skeleton.module.js +9 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/spinner.css +7 -0
- package/dist/components/spinner/spinner.d.ts +15 -0
- package/dist/components/spinner/spinner.js +50 -0
- package/dist/components/spinner/spinner.module.js +4 -0
- package/dist/components/stale/index.d.ts +1 -0
- package/dist/components/stale/index.js +1 -0
- package/dist/components/stale/stale.css +60 -0
- package/dist/components/stale/stale.d.ts +68 -0
- package/dist/components/stale/stale.js +231 -0
- package/dist/components/stale/stale.module.js +16 -0
- package/dist/components/status-message/index.d.ts +1 -0
- package/dist/components/status-message/index.js +1 -0
- package/dist/components/status-message/status-message.css +122 -0
- package/dist/components/status-message/status-message.d.ts +72 -0
- package/dist/components/status-message/status-message.js +182 -0
- package/dist/components/status-message/status-message.module.js +16 -0
- package/dist/components/status-message/status-preset.d.ts +26 -0
- package/dist/components/status-message/status-preset.js +64 -0
- package/dist/components/switch-field/index.d.ts +3 -0
- package/dist/components/switch-field/index.js +4 -0
- package/dist/components/switch-field/switch-field.d.ts +23 -0
- package/dist/components/switch-field/switch-field.js +142 -0
- package/dist/components/switch-field/switch.css +145 -0
- package/dist/components/switch-field/switch.d.ts +35 -0
- package/dist/components/switch-field/switch.js +207 -0
- package/dist/components/switch-field/switch.module.js +12 -0
- package/dist/components/switch-field/tsf-switch-field.d.ts +14 -0
- package/dist/components/switch-field/tsf-switch-field.js +40 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/tabs.css +122 -0
- package/dist/components/tabs/tabs.d.ts +57 -0
- package/dist/components/tabs/tabs.js +194 -0
- package/dist/components/tabs/tabs.module.js +18 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/tag.css +120 -0
- package/dist/components/tag/tag.d.ts +36 -0
- package/dist/components/tag/tag.js +124 -0
- package/dist/components/tag/tag.module.js +10 -0
- package/dist/components/tag-group/index.d.ts +1 -0
- package/dist/components/tag-group/index.js +1 -0
- package/dist/components/tag-group/tag-group.css +155 -0
- package/dist/components/tag-group/tag-group.d.ts +53 -0
- package/dist/components/tag-group/tag-group.js +182 -0
- package/dist/components/tag-group/tag-group.module.js +12 -0
- package/dist/components/text-field/connect-text-preset.d.ts +13 -0
- package/dist/components/text-field/connect-text-preset.js +34 -0
- package/dist/components/text-field/index.d.ts +5 -0
- package/dist/components/text-field/index.js +5 -0
- package/dist/components/text-field/text-field.css +170 -0
- package/dist/components/text-field/text-field.d.ts +57 -0
- package/dist/components/text-field/text-field.js +247 -0
- package/dist/components/text-field/text-field.module.js +22 -0
- package/dist/components/text-field/text-input-context.d.ts +28 -0
- package/dist/components/text-field/text-input-context.js +16 -0
- package/dist/components/text-field/text-input.d.ts +79 -0
- package/dist/components/text-field/text-input.js +588 -0
- package/dist/components/text-field/text-preset.d.ts +7 -0
- package/dist/components/text-field/tsf-text-field.d.ts +14 -0
- package/dist/components/text-field/tsf-text-field.js +34 -0
- package/dist/components/textarea-field/index.d.ts +3 -0
- package/dist/components/textarea-field/index.js +4 -0
- package/dist/components/textarea-field/textarea-field.css +12 -0
- package/dist/components/textarea-field/textarea-field.d.ts +19 -0
- package/dist/components/textarea-field/textarea-field.js +168 -0
- package/dist/components/textarea-field/textarea-field.module.js +8 -0
- package/dist/components/textarea-field/textarea.d.ts +19 -0
- package/dist/components/textarea-field/textarea.js +108 -0
- package/dist/components/textarea-field/tsf-textarea-field.d.ts +14 -0
- package/dist/components/textarea-field/tsf-textarea-field.js +34 -0
- package/dist/components/textarea-field/use-autosize.d.ts +11 -0
- package/dist/components/textarea-field/use-autosize.js +65 -0
- package/dist/components/time-field/index.d.ts +3 -0
- package/dist/components/time-field/index.js +4 -0
- package/dist/components/time-field/time-field.d.ts +25 -0
- package/dist/components/time-field/time-field.js +115 -0
- package/dist/components/time-field/time-input.d.ts +30 -0
- package/dist/components/time-field/time-input.js +66 -0
- package/dist/components/time-field/tsf-time-field.d.ts +14 -0
- package/dist/components/time-field/tsf-time-field.js +40 -0
- package/dist/components/time-zone-provider/index.d.ts +1 -0
- package/dist/components/time-zone-provider/index.js +1 -0
- package/dist/components/time-zone-provider/time-zone-provider.d.ts +22 -0
- package/dist/components/time-zone-provider/time-zone-provider.js +39 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +3 -0
- package/dist/components/toast/toast-provider.css +99 -0
- package/dist/components/toast/toast-provider.d.ts +18 -0
- package/dist/components/toast/toast-provider.js +203 -0
- package/dist/components/toast/toast-provider.module.js +24 -0
- package/dist/components/toast/toast.d.ts +79 -0
- package/dist/components/toast/toast.js +68 -0
- package/dist/components/toggle-group-field/index.d.ts +3 -0
- package/dist/components/toggle-group-field/index.js +4 -0
- package/dist/components/toggle-group-field/toggle-group-field.d.ts +32 -0
- package/dist/components/toggle-group-field/toggle-group-field.js +158 -0
- package/dist/components/toggle-group-field/toggle-group.css +148 -0
- package/dist/components/toggle-group-field/toggle-group.d.ts +44 -0
- package/dist/components/toggle-group-field/toggle-group.js +156 -0
- package/dist/components/toggle-group-field/toggle-group.module.js +8 -0
- package/dist/components/toggle-group-field/tsf-toggle-group-field.d.ts +15 -0
- package/dist/components/toggle-group-field/tsf-toggle-group-field.js +41 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/tooltip.css +22 -0
- package/dist/components/tooltip/tooltip.d.ts +46 -0
- package/dist/components/tooltip/tooltip.js +175 -0
- package/dist/components/tooltip/tooltip.module.js +4 -0
- package/dist/data-table/data-table-content.d.ts +27 -0
- package/dist/data-table/data-table-content.js +311 -0
- package/dist/data-table/data-table-context.d.ts +33 -0
- package/dist/data-table/data-table-context.js +31 -0
- package/dist/data-table/data-table-selection.d.ts +42 -0
- package/dist/data-table/data-table-selection.js +299 -0
- package/dist/data-table/data-table.css +515 -0
- package/dist/data-table/data-table.d.ts +93 -0
- package/dist/data-table/data-table.js +215 -0
- package/dist/data-table/data-table.module.js +68 -0
- package/dist/data-table/index.d.ts +6 -0
- package/dist/data-table/index.js +5 -0
- package/dist/data-table/resolve-view.d.ts +31 -0
- package/dist/data-table/resolve-view.js +37 -0
- package/dist/data-table/table-features.d.ts +69 -0
- package/dist/data-table/table-features.js +41 -0
- package/dist/data-table/use-sticky-offsets.d.ts +21 -0
- package/dist/data-table/use-sticky-offsets.js +86 -0
- package/dist/data-view/index.d.ts +1 -0
- package/dist/data-view/index.js +1 -0
- package/dist/data-view/use-data-view.d.ts +83 -0
- package/dist/data-view/use-data-view.js +135 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.js +132 -0
- package/dist/lib/calendar/calendar-navigation.d.ts +19 -0
- package/dist/lib/calendar/calendar-navigation.js +216 -0
- package/dist/lib/calendar/calendar-state.d.ts +19 -0
- package/dist/lib/calendar/calendar-state.js +33 -0
- package/dist/lib/calendar/calendar-year.d.ts +20 -0
- package/dist/lib/calendar/calendar-year.js +342 -0
- package/dist/lib/calendar/temporal-value.d.ts +84 -0
- package/dist/lib/calendar/temporal-value.js +105 -0
- package/dist/lib/calendar/temporal.css +596 -0
- package/dist/lib/calendar/temporal.d.ts +134 -0
- package/dist/lib/calendar/temporal.js +783 -0
- package/dist/lib/calendar/temporal.module.js +80 -0
- package/dist/lib/format-bytes.d.ts +10 -0
- package/dist/lib/format-bytes.js +22 -0
- package/dist/lib/forms/context.d.ts +32 -0
- package/dist/lib/forms/context.js +33 -0
- package/dist/lib/forms/create-app-form.d.ts +24 -0
- package/dist/lib/forms/create-app-form.js +36 -0
- package/dist/lib/forms/errors.d.ts +23 -0
- package/dist/lib/forms/errors.js +25 -0
- package/dist/lib/forms/failed-submit.d.ts +16 -0
- package/dist/lib/forms/failed-submit.js +44 -0
- package/dist/lib/forms/index.d.ts +3 -0
- package/dist/lib/forms/index.js +4 -0
- package/dist/lib/forms/use-connected-field.d.ts +27 -0
- package/dist/lib/forms/use-connected-field.js +48 -0
- package/dist/lib/hooks/index.d.ts +5 -0
- package/dist/lib/hooks/index.js +6 -0
- package/dist/lib/hooks/use-busy-phase.d.ts +31 -0
- package/dist/lib/hooks/use-busy-phase.js +75 -0
- package/dist/lib/hooks/use-media-query.d.ts +8 -0
- package/dist/lib/hooks/use-media-query.js +34 -0
- package/dist/lib/hooks/use-presence.d.ts +25 -0
- package/dist/lib/hooks/use-presence.js +155 -0
- package/dist/lib/hooks/use-row-selection.d.ts +65 -0
- package/dist/lib/hooks/use-row-selection.js +136 -0
- package/dist/lib/hooks/use-theme.d.ts +28 -0
- package/dist/lib/hooks/use-theme.js +88 -0
- package/dist/lib/iso-zoned.d.ts +9 -0
- package/dist/lib/iso-zoned.js +19 -0
- package/dist/lib/password-strength/password-strength.d.ts +38 -0
- package/dist/lib/password-strength/password-strength.js +72 -0
- package/dist/lib/popup-edge-padding.d.ts +20 -0
- package/dist/lib/popup-edge-padding.js +41 -0
- package/dist/lib/sliding-indicator/index.d.ts +1 -0
- package/dist/lib/sliding-indicator/use-sliding-indicator.d.ts +27 -0
- package/dist/lib/sliding-indicator/use-sliding-indicator.js +84 -0
- package/dist/lib/storage.d.ts +21 -0
- package/dist/lib/storage.js +0 -0
- package/dist/lib/table-storage.d.ts +43 -0
- package/dist/lib/table-storage.js +62 -0
- package/dist/lib/text-length.d.ts +10 -0
- package/dist/lib/text-length.js +15 -0
- package/dist/lib/tone.d.ts +14 -0
- package/dist/lib/tone.js +0 -0
- package/dist/lib/unsaved-changes/before-unload.d.ts +8 -0
- package/dist/lib/unsaved-changes/before-unload.js +37 -0
- package/dist/lib/unsaved-changes/index.d.ts +4 -0
- package/dist/lib/unsaved-changes/index.js +5 -0
- package/dist/lib/unsaved-changes/leave-guard.d.ts +80 -0
- package/dist/lib/unsaved-changes/leave-guard.js +170 -0
- package/dist/lib/unsaved-changes/policy.d.ts +24 -0
- package/dist/lib/unsaved-changes/policy.js +17 -0
- package/dist/lib/unsaved-changes/registry.d.ts +36 -0
- package/dist/lib/unsaved-changes/registry.js +78 -0
- package/dist/lib/unsaved-changes/tanstack-router.d.ts +12 -0
- package/dist/lib/unsaved-changes/tanstack-router.js +50 -0
- package/dist/lib/use-infinite-scroll.d.ts +31 -0
- package/dist/lib/use-infinite-scroll.js +78 -0
- package/dist/lib/use-intent.d.ts +17 -0
- package/dist/lib/use-intent.js +77 -0
- package/dist/lib/use-required-context.d.ts +9 -0
- package/dist/lib/use-required-context.js +15 -0
- package/dist/terrazzo/index.d.ts +39 -0
- package/dist/terrazzo/index.js +93 -0
- package/dist/tokens.css +1102 -0
- package/dist/vendor/@material-design-icons/svg/outlined/add.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/block.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/check.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/close.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/description.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/download.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/error.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/info.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/mail.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/remove.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/restore.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/search.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +12 -0
- package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +12 -0
- package/package.json +452 -5
- package/tokens/dark.tokens.json +329 -0
- package/tokens/kit.resolver.json +38 -0
- package/tokens/ref.tokens.json +1436 -0
- package/tokens/sys.tokens.json +1267 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import './temporal.css';// src/lib/calendar/temporal.module.scss
|
|
2
|
+
var group = "_group_zywoe_3";
|
|
3
|
+
var input = "_input_zywoe_68";
|
|
4
|
+
var rangeInput = "_rangeInput_zywoe_81";
|
|
5
|
+
var rangeSeparator = "_rangeSeparator_zywoe_93";
|
|
6
|
+
var rangeSpacer = "_rangeSpacer_zywoe_97";
|
|
7
|
+
var segment = "_segment_zywoe_101";
|
|
8
|
+
var trigger = "_trigger_zywoe_117";
|
|
9
|
+
var popover = "_popover_zywoe_133";
|
|
10
|
+
var dialog = "_dialog_zywoe_163";
|
|
11
|
+
var calendar = "_calendar_zywoe_166";
|
|
12
|
+
var header = "_header_zywoe_171";
|
|
13
|
+
var navigation = "_navigation_zywoe_176";
|
|
14
|
+
var navField = "_navField_zywoe_186";
|
|
15
|
+
var navPortal = "_navPortal_zywoe_189";
|
|
16
|
+
var navTrigger = "_navTrigger_zywoe_194";
|
|
17
|
+
var navControl = "_navControl_zywoe_195";
|
|
18
|
+
var navInput = "_navInput_zywoe_251";
|
|
19
|
+
var navLabel = "_navLabel_zywoe_254";
|
|
20
|
+
var navSizer = "_navSizer_zywoe_258";
|
|
21
|
+
var navValue = "_navValue_zywoe_268";
|
|
22
|
+
var navChevron = "_navChevron_zywoe_285";
|
|
23
|
+
var navIcon = "_navIcon_zywoe_293";
|
|
24
|
+
var navPositioner = "_navPositioner_zywoe_298";
|
|
25
|
+
var navPopup = "_navPopup_zywoe_312";
|
|
26
|
+
var yearPopup = "_yearPopup_zywoe_337";
|
|
27
|
+
var yearEmpty = "_yearEmpty_zywoe_365";
|
|
28
|
+
var yearList = "_yearList_zywoe_380";
|
|
29
|
+
var navItem = "_navItem_zywoe_388";
|
|
30
|
+
var yearOption = "_yearOption_zywoe_389";
|
|
31
|
+
var navItemIndicator = "_navItemIndicator_zywoe_444";
|
|
32
|
+
var yearIndicator = "_yearIndicator_zywoe_445";
|
|
33
|
+
var yearValue = "_yearValue_zywoe_453";
|
|
34
|
+
var months = "_months_zywoe_457";
|
|
35
|
+
var grid = "_grid_zywoe_464";
|
|
36
|
+
var weekday = "_weekday_zywoe_477";
|
|
37
|
+
var day = "_day_zywoe_484";
|
|
38
|
+
var today = "_today_zywoe_533";
|
|
39
|
+
var rangeCalendar = "_rangeCalendar_zywoe_547";
|
|
40
|
+
var temporal_module_default = {
|
|
41
|
+
group,
|
|
42
|
+
input,
|
|
43
|
+
rangeInput,
|
|
44
|
+
rangeSeparator,
|
|
45
|
+
rangeSpacer,
|
|
46
|
+
segment,
|
|
47
|
+
trigger,
|
|
48
|
+
popover,
|
|
49
|
+
dialog,
|
|
50
|
+
calendar,
|
|
51
|
+
header,
|
|
52
|
+
navigation,
|
|
53
|
+
navField,
|
|
54
|
+
navPortal,
|
|
55
|
+
navTrigger,
|
|
56
|
+
navControl,
|
|
57
|
+
navInput,
|
|
58
|
+
navLabel,
|
|
59
|
+
navSizer,
|
|
60
|
+
navValue,
|
|
61
|
+
navChevron,
|
|
62
|
+
navIcon,
|
|
63
|
+
navPositioner,
|
|
64
|
+
navPopup,
|
|
65
|
+
yearPopup,
|
|
66
|
+
yearEmpty,
|
|
67
|
+
yearList,
|
|
68
|
+
navItem,
|
|
69
|
+
yearOption,
|
|
70
|
+
navItemIndicator,
|
|
71
|
+
yearIndicator,
|
|
72
|
+
yearValue,
|
|
73
|
+
months,
|
|
74
|
+
grid,
|
|
75
|
+
weekday,
|
|
76
|
+
day,
|
|
77
|
+
today,
|
|
78
|
+
rangeCalendar
|
|
79
|
+
};
|
|
80
|
+
export { calendar, day, temporal_module_default as default, dialog, grid, group, header, input, months, navChevron, navControl, navField, navIcon, navInput, navItem, navItemIndicator, navLabel, navPopup, navPortal, navPositioner, navSizer, navTrigger, navValue, navigation, popover, rangeCalendar, rangeInput, rangeSeparator, rangeSpacer, segment, today, trigger, weekday, yearEmpty, yearIndicator, yearList, yearOption, yearPopup, yearValue };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a byte count into a short, human-readable size, scaled to the
|
|
3
|
+
* largest fitting unit (base 1024, as used for file sizes). The number is
|
|
4
|
+
* formatted in `locale`; the symbols are the locale-invariant SI ones.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* formatBytes(1536, "nl-NL"); // "1,5 kB"
|
|
8
|
+
* formatBytes(10, "en-US"); // "10 B"
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatBytes: (bytes: number, locale: string) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/lib/format-bytes.ts
|
|
2
|
+
var BYTE_SYMBOLS = [
|
|
3
|
+
"B",
|
|
4
|
+
"kB",
|
|
5
|
+
"MB",
|
|
6
|
+
"GB",
|
|
7
|
+
"TB"
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Formats a byte count into a short, human-readable size, scaled to the
|
|
11
|
+
* largest fitting unit (base 1024, as used for file sizes). The number is
|
|
12
|
+
* formatted in `locale`; the symbols are the locale-invariant SI ones.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* formatBytes(1536, "nl-NL"); // "1,5 kB"
|
|
16
|
+
* formatBytes(10, "en-US"); // "10 B"
|
|
17
|
+
*/
|
|
18
|
+
var formatBytes = (bytes, locale) => {
|
|
19
|
+
const exponent = Math.min(bytes <= 0 ? 0 : Math.floor(Math.log2(bytes) / 10), BYTE_SYMBOLS.length - 1);
|
|
20
|
+
return `${new Intl.NumberFormat(locale, { maximumFractionDigits: exponent === 0 ? 0 : 1 }).format(bytes / 1024 ** exponent)} ${BYTE_SYMBOLS[exponent] ?? "B"}`;
|
|
21
|
+
};
|
|
22
|
+
export { formatBytes };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createFormHookContexts } from "@tanstack/react-form";
|
|
2
|
+
type FormHookContexts = ReturnType<typeof createFormHookContexts>;
|
|
3
|
+
/**
|
|
4
|
+
* The field context the form hook is built on, kept apart from the hook so a
|
|
5
|
+
* bridge can read its field without importing every other bridge.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <fieldContext.Provider value={field}>{children}</fieldContext.Provider>
|
|
9
|
+
*/
|
|
10
|
+
export declare const fieldContext: FormHookContexts["fieldContext"];
|
|
11
|
+
/**
|
|
12
|
+
* The form context the form hook is built on, which `Form.Root` provides.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <formContext.Provider value={form}>{children}</formContext.Provider>
|
|
16
|
+
*/
|
|
17
|
+
export declare const formContext: FormHookContexts["formContext"];
|
|
18
|
+
/**
|
|
19
|
+
* The field a bridge is rendered for, inside `form.AppField`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const field = useFieldContext<string>();
|
|
23
|
+
*/
|
|
24
|
+
export declare const useFieldContext: FormHookContexts["useFieldContext"];
|
|
25
|
+
/**
|
|
26
|
+
* The form a part is rendered inside, under `Form.Root` or `form.AppForm`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const form = useFormContext();
|
|
30
|
+
*/
|
|
31
|
+
export declare const useFormContext: FormHookContexts["useFormContext"];
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createFormHookContexts } from "@tanstack/react-form";
|
|
2
|
+
// src/lib/forms/context.tsx
|
|
3
|
+
var contexts = createFormHookContexts();
|
|
4
|
+
/**
|
|
5
|
+
* The field context the form hook is built on, kept apart from the hook so a
|
|
6
|
+
* bridge can read its field without importing every other bridge.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <fieldContext.Provider value={field}>{children}</fieldContext.Provider>
|
|
10
|
+
*/
|
|
11
|
+
var fieldContext = contexts.fieldContext;
|
|
12
|
+
/**
|
|
13
|
+
* The form context the form hook is built on, which `Form.Root` provides.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <formContext.Provider value={form}>{children}</formContext.Provider>
|
|
17
|
+
*/
|
|
18
|
+
var formContext = contexts.formContext;
|
|
19
|
+
/**
|
|
20
|
+
* The field a bridge is rendered for, inside `form.AppField`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const field = useFieldContext<string>();
|
|
24
|
+
*/
|
|
25
|
+
var useFieldContext = contexts.useFieldContext;
|
|
26
|
+
/**
|
|
27
|
+
* The form a part is rendered inside, under `Form.Root` or `form.AppForm`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const form = useFormContext();
|
|
31
|
+
*/
|
|
32
|
+
var useFormContext = contexts.useFormContext;
|
|
33
|
+
export { fieldContext, formContext, useFieldContext, useFormContext };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createFormHook } from "@tanstack/react-form";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
type Bridge = Readonly<{
|
|
4
|
+
bivarianceHack(props: object): ReactNode;
|
|
5
|
+
}>["bivarianceHack"];
|
|
6
|
+
/** The bridges a form hook renders through `form.AppField`, by the name a field reaches each under. */
|
|
7
|
+
export type AppFieldComponents = Readonly<Record<string, Bridge>>;
|
|
8
|
+
type FormComponents = Readonly<Record<string, never>>;
|
|
9
|
+
type AppFormHook<TFields extends AppFieldComponents> = ReturnType<typeof createFormHook<TFields, FormComponents>>;
|
|
10
|
+
/** The form hook `createAppForm` builds, with the form and field-group helpers bound to it. */
|
|
11
|
+
export type AppForm<TFields extends AppFieldComponents> = Readonly<Pick<AppFormHook<TFields>, "useAppForm" | "withForm" | "withFieldGroup">>;
|
|
12
|
+
/**
|
|
13
|
+
* The app's form hook, with only the bridges it registers. A form reaches each
|
|
14
|
+
* through `form.AppField` under its key, and a failed submit focuses the first
|
|
15
|
+
* invalid control of the `Form.Root` the form renders in.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* export const { useAppForm, withForm, withFieldGroup } = createAppForm({
|
|
19
|
+
* TextField: TSFTextField,
|
|
20
|
+
* SelectField: TSFSelectField,
|
|
21
|
+
* });
|
|
22
|
+
*/
|
|
23
|
+
export declare const createAppForm: <TFields extends AppFieldComponents>(fieldComponents: TFields) => AppForm<TFields>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { fieldContext, formContext } from "./context.js";
|
|
2
|
+
import { focusFirstInvalidField } from "./failed-submit.js";
|
|
3
|
+
import { createFormHook } from "@tanstack/react-form";
|
|
4
|
+
// src/lib/forms/create-app-form.ts
|
|
5
|
+
var formComponents = {};
|
|
6
|
+
/**
|
|
7
|
+
* The app's form hook, with only the bridges it registers. A form reaches each
|
|
8
|
+
* through `form.AppField` under its key, and a failed submit focuses the first
|
|
9
|
+
* invalid control of the `Form.Root` the form renders in.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* export const { useAppForm, withForm, withFieldGroup } = createAppForm({
|
|
13
|
+
* TextField: TSFTextField,
|
|
14
|
+
* SelectField: TSFSelectField,
|
|
15
|
+
* });
|
|
16
|
+
*/
|
|
17
|
+
var createAppForm = (fieldComponents) => {
|
|
18
|
+
const hook = createFormHook({
|
|
19
|
+
fieldContext,
|
|
20
|
+
formContext,
|
|
21
|
+
fieldComponents,
|
|
22
|
+
formComponents
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
useAppForm: (options) => hook.useAppForm({
|
|
26
|
+
...options,
|
|
27
|
+
onSubmitInvalid: (props) => {
|
|
28
|
+
options.onSubmitInvalid?.(props);
|
|
29
|
+
focusFirstInvalidField(props.formApi);
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
withForm: hook.withForm,
|
|
33
|
+
withFieldGroup: hook.withFieldGroup
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export { createAppForm };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Errors of any shape as the lines a field or form shows, each once: strings as
|
|
3
|
+
* they are, anything with a string `message` (a Standard Schema issue, an
|
|
4
|
+
* `Error`) as that message, and lists flattened. Anything else is dropped.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* normalizeFieldErrors(["Too short", { message: "Not an address" }]); // ["Too short", "Not an address"]
|
|
8
|
+
*/
|
|
9
|
+
export declare const normalizeFieldErrors: (errors: unknown) => readonly string[];
|
|
10
|
+
/** The part of a form's state `getFieldErrors` reads. */
|
|
11
|
+
export type FieldMetaState = Readonly<{
|
|
12
|
+
fieldMeta: Readonly<Record<string, Readonly<{
|
|
13
|
+
errors: unknown;
|
|
14
|
+
}> | undefined>>;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* The error lines of the named fields, in the order they are named, such as
|
|
18
|
+
* the errors of a group that shows them in one place.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* getFieldErrors(form.state, ["start", "end"]); // ["Enter a start date."]
|
|
22
|
+
*/
|
|
23
|
+
export declare const getFieldErrors: <TState extends FieldMetaState>(state: TState, fields: readonly (keyof TState["fieldMeta"] & string)[]) => readonly string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/lib/forms/errors.ts
|
|
2
|
+
var linesOf = (errors) => {
|
|
3
|
+
if (Array.isArray(errors)) return errors.flatMap(linesOf);
|
|
4
|
+
if (typeof errors === "string") return errors === "" ? [] : [errors];
|
|
5
|
+
if (typeof errors === "object" && errors !== null && "message" in errors && typeof errors.message === "string") return linesOf(errors.message);
|
|
6
|
+
return [];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Errors of any shape as the lines a field or form shows, each once: strings as
|
|
10
|
+
* they are, anything with a string `message` (a Standard Schema issue, an
|
|
11
|
+
* `Error`) as that message, and lists flattened. Anything else is dropped.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* normalizeFieldErrors(["Too short", { message: "Not an address" }]); // ["Too short", "Not an address"]
|
|
15
|
+
*/
|
|
16
|
+
var normalizeFieldErrors = (errors) => [...new Set(linesOf(errors))];
|
|
17
|
+
/**
|
|
18
|
+
* The error lines of the named fields, in the order they are named, such as
|
|
19
|
+
* the errors of a group that shows them in one place.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* getFieldErrors(form.state, ["start", "end"]); // ["Enter a start date."]
|
|
23
|
+
*/
|
|
24
|
+
var getFieldErrors = (state, fields) => fields.flatMap((field) => normalizeFieldErrors(state.fieldMeta[field]?.errors));
|
|
25
|
+
export { getFieldErrors, normalizeFieldErrors };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AnyFormApi } from "@tanstack/react-form";
|
|
2
|
+
/**
|
|
3
|
+
* Ties a form to the `Form.Root` it renders in, so a failed submit of that form
|
|
4
|
+
* can focus its first invalid control.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* useFailedSubmitFocus(form, () => setInvalidSubmits(count => count + 1));
|
|
8
|
+
*/
|
|
9
|
+
export declare const useFailedSubmitFocus: (form: AnyFormApi, focusFirstInvalid: () => void) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Focuses the first invalid control of the `Form.Root` a form renders in.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* onSubmitInvalid: ({ formApi }) => focusFirstInvalidField(formApi),
|
|
15
|
+
*/
|
|
16
|
+
export declare const focusFirstInvalidField: (form: AnyFormApi) => void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
// src/lib/forms/failed-submit.tsx
|
|
4
|
+
var invalidFocus = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
/**
|
|
6
|
+
* Ties a form to the `Form.Root` it renders in, so a failed submit of that form
|
|
7
|
+
* can focus its first invalid control.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* useFailedSubmitFocus(form, () => setInvalidSubmits(count => count + 1));
|
|
11
|
+
*/
|
|
12
|
+
var useFailedSubmitFocus = (form, focusFirstInvalid) => {
|
|
13
|
+
const $ = c(6);
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] !== focusFirstInvalid || $[1] !== form.store) {
|
|
16
|
+
t0 = () => {
|
|
17
|
+
invalidFocus.set(form.store, focusFirstInvalid);
|
|
18
|
+
return () => {
|
|
19
|
+
if (invalidFocus.get(form.store) === focusFirstInvalid) invalidFocus.delete(form.store);
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
$[0] = focusFirstInvalid;
|
|
23
|
+
$[1] = form.store;
|
|
24
|
+
$[2] = t0;
|
|
25
|
+
} else t0 = $[2];
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[3] !== focusFirstInvalid || $[4] !== form) {
|
|
28
|
+
t1 = [form, focusFirstInvalid];
|
|
29
|
+
$[3] = focusFirstInvalid;
|
|
30
|
+
$[4] = form;
|
|
31
|
+
$[5] = t1;
|
|
32
|
+
} else t1 = $[5];
|
|
33
|
+
useEffect(t0, t1);
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Focuses the first invalid control of the `Form.Root` a form renders in.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* onSubmitInvalid: ({ formApi }) => focusFirstInvalidField(formApi),
|
|
40
|
+
*/
|
|
41
|
+
var focusFirstInvalidField = (form) => {
|
|
42
|
+
invalidFocus.get(form.store)?.();
|
|
43
|
+
};
|
|
44
|
+
export { focusFirstInvalidField, useFailedSubmitFocus };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createAppForm } from "./create-app-form.js";
|
|
2
|
+
import { useFieldContext, useFormContext } from "./context.js";
|
|
3
|
+
import { getFieldErrors, normalizeFieldErrors } from "./errors.js";
|
|
4
|
+
export { createAppForm, getFieldErrors, normalizeFieldErrors, useFieldContext, useFormContext };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FieldBlurHandler } from "../../components/field/field.tsx";
|
|
2
|
+
import { useFieldContext } from "./context.tsx";
|
|
3
|
+
/** The field props a bridge passes at the top level, read off its field. */
|
|
4
|
+
export type ConnectedFieldProps = Readonly<{
|
|
5
|
+
name: string;
|
|
6
|
+
errors: unknown;
|
|
7
|
+
dirty: boolean;
|
|
8
|
+
touched: boolean;
|
|
9
|
+
pending: boolean;
|
|
10
|
+
onBlur: FieldBlurHandler;
|
|
11
|
+
}>;
|
|
12
|
+
/** What `useConnectedField` reads off its field. */
|
|
13
|
+
export type ConnectedField<TValue> = Readonly<{
|
|
14
|
+
field: ReturnType<typeof useFieldContext<TValue>>;
|
|
15
|
+
props: ConnectedFieldProps;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* The field a bridge renders for, and the props every field takes from it:
|
|
19
|
+
* its name, its errors as the validators returned them, `dirty`, `touched`,
|
|
20
|
+
* `pending` while it validates, and the blur handler. The value and its change
|
|
21
|
+
* handler are the control's own.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const { field, props } = useConnectedField<string>();
|
|
25
|
+
* <TextField {...props} value={field.state.value} onValueChange={field.handleChange} label={label} optionalLabel={optionalLabel} />
|
|
26
|
+
*/
|
|
27
|
+
export declare const useConnectedField: <TValue>() => ConnectedField<TValue>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useFieldContext } from "./context.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
// src/lib/forms/use-connected-field.ts
|
|
4
|
+
/**
|
|
5
|
+
* The field a bridge renders for, and the props every field takes from it:
|
|
6
|
+
* its name, its errors as the validators returned them, `dirty`, `touched`,
|
|
7
|
+
* `pending` while it validates, and the blur handler. The value and its change
|
|
8
|
+
* handler are the control's own.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { field, props } = useConnectedField<string>();
|
|
12
|
+
* <TextField {...props} value={field.state.value} onValueChange={field.handleChange} label={label} optionalLabel={optionalLabel} />
|
|
13
|
+
*/
|
|
14
|
+
var useConnectedField = () => {
|
|
15
|
+
const $ = c(10);
|
|
16
|
+
const field = useFieldContext();
|
|
17
|
+
const { meta } = field.state;
|
|
18
|
+
let t0;
|
|
19
|
+
if ($[0] !== field.handleBlur || $[1] !== field.name || $[2] !== meta.errors || $[3] !== meta.isDirty || $[4] !== meta.isTouched || $[5] !== meta.isValidating) {
|
|
20
|
+
t0 = {
|
|
21
|
+
name: field.name,
|
|
22
|
+
errors: meta.errors,
|
|
23
|
+
dirty: meta.isDirty,
|
|
24
|
+
touched: meta.isTouched,
|
|
25
|
+
pending: meta.isValidating,
|
|
26
|
+
onBlur: field.handleBlur
|
|
27
|
+
};
|
|
28
|
+
$[0] = field.handleBlur;
|
|
29
|
+
$[1] = field.name;
|
|
30
|
+
$[2] = meta.errors;
|
|
31
|
+
$[3] = meta.isDirty;
|
|
32
|
+
$[4] = meta.isTouched;
|
|
33
|
+
$[5] = meta.isValidating;
|
|
34
|
+
$[6] = t0;
|
|
35
|
+
} else t0 = $[6];
|
|
36
|
+
let t1;
|
|
37
|
+
if ($[7] !== field || $[8] !== t0) {
|
|
38
|
+
t1 = {
|
|
39
|
+
field,
|
|
40
|
+
props: t0
|
|
41
|
+
};
|
|
42
|
+
$[7] = field;
|
|
43
|
+
$[8] = t0;
|
|
44
|
+
$[9] = t1;
|
|
45
|
+
} else t1 = $[9];
|
|
46
|
+
return t1;
|
|
47
|
+
};
|
|
48
|
+
export { useConnectedField };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useBusyPhase } from "./use-busy-phase.js";
|
|
2
|
+
import { useMediaQuery } from "./use-media-query.js";
|
|
3
|
+
import { usePresence } from "./use-presence.js";
|
|
4
|
+
import { useRowSelection } from "./use-row-selection.js";
|
|
5
|
+
import { useTheme } from "./use-theme.js";
|
|
6
|
+
export { useBusyPhase, useMediaQuery, usePresence, useRowSelection, useTheme };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escalating phases of a wait.
|
|
3
|
+
* - `fresh`: not busy, or busy for less than `busyAfter`.
|
|
4
|
+
* - `busy`: busy longer than `busyAfter`.
|
|
5
|
+
* - `slow`: busy longer than `slowAfter`.
|
|
6
|
+
* - `stuck`: busy longer than `stuckAfter`.
|
|
7
|
+
*/
|
|
8
|
+
export type BusyPhase = "fresh" | "busy" | "slow" | "stuck";
|
|
9
|
+
export type BusyPhaseOptions = Readonly<{
|
|
10
|
+
/** Whether the work is in flight. */
|
|
11
|
+
busy: boolean;
|
|
12
|
+
/** Ms of `busy` before leaving `fresh`. @default 150 */
|
|
13
|
+
busyAfter?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Ms a phase past `fresh` holds once reached, even if the work finishes
|
|
16
|
+
* sooner. @default 200
|
|
17
|
+
*/
|
|
18
|
+
busyMinDuration?: number;
|
|
19
|
+
/** Ms of `busy` before reaching `slow`. @default 4000 */
|
|
20
|
+
slowAfter?: number;
|
|
21
|
+
/** Ms of `busy` before reaching `stuck`. @default 8000 */
|
|
22
|
+
stuckAfter?: number;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* The late-announcement bargain: a wait shows nothing until it has lasted
|
|
26
|
+
* `busyAfter`, then holds for at least `busyMinDuration` and escalates.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const phase = useBusyPhase({ busy: query.isFetching });
|
|
30
|
+
*/
|
|
31
|
+
export declare const useBusyPhase: ({ busy, busyAfter, busyMinDuration, slowAfter, stuckAfter, }: BusyPhaseOptions) => BusyPhase;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
// src/lib/hooks/use-busy-phase.ts
|
|
4
|
+
/**
|
|
5
|
+
* The late-announcement bargain: a wait shows nothing until it has lasted
|
|
6
|
+
* `busyAfter`, then holds for at least `busyMinDuration` and escalates.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const phase = useBusyPhase({ busy: query.isFetching });
|
|
10
|
+
*/
|
|
11
|
+
var useBusyPhase = (t0) => {
|
|
12
|
+
const $ = c(7);
|
|
13
|
+
const { busy, busyAfter: t1, busyMinDuration: t2, slowAfter: t3, stuckAfter: t4 } = t0;
|
|
14
|
+
const busyAfter = t1 === void 0 ? 150 : t1;
|
|
15
|
+
const busyMinDuration = t2 === void 0 ? 200 : t2;
|
|
16
|
+
const slowAfter = t3 === void 0 ? 4e3 : t3;
|
|
17
|
+
const stuckAfter = t4 === void 0 ? 8e3 : t4;
|
|
18
|
+
const [phase, setPhase] = useState("fresh");
|
|
19
|
+
const shownAt = useRef(null);
|
|
20
|
+
let t5;
|
|
21
|
+
let t6;
|
|
22
|
+
if ($[0] !== busy || $[1] !== busyAfter || $[2] !== busyMinDuration || $[3] !== slowAfter || $[4] !== stuckAfter) {
|
|
23
|
+
t5 = () => {
|
|
24
|
+
if (busy) {
|
|
25
|
+
const timers = [
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
shownAt.current = performance.now();
|
|
28
|
+
setPhase("busy");
|
|
29
|
+
}, busyAfter),
|
|
30
|
+
setTimeout(() => setPhase("slow"), slowAfter),
|
|
31
|
+
setTimeout(() => setPhase("stuck"), stuckAfter)
|
|
32
|
+
];
|
|
33
|
+
return () => {
|
|
34
|
+
for (const timer of timers) clearTimeout(timer);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const shown = shownAt.current;
|
|
38
|
+
const settle = () => {
|
|
39
|
+
shownAt.current = null;
|
|
40
|
+
setPhase("fresh");
|
|
41
|
+
};
|
|
42
|
+
if (shown === null) {
|
|
43
|
+
settle();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const remaining = busyMinDuration - (performance.now() - shown);
|
|
47
|
+
if (remaining <= 0) {
|
|
48
|
+
settle();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const settleId = setTimeout(settle, remaining);
|
|
52
|
+
return () => clearTimeout(settleId);
|
|
53
|
+
};
|
|
54
|
+
t6 = [
|
|
55
|
+
busy,
|
|
56
|
+
busyAfter,
|
|
57
|
+
busyMinDuration,
|
|
58
|
+
slowAfter,
|
|
59
|
+
stuckAfter
|
|
60
|
+
];
|
|
61
|
+
$[0] = busy;
|
|
62
|
+
$[1] = busyAfter;
|
|
63
|
+
$[2] = busyMinDuration;
|
|
64
|
+
$[3] = slowAfter;
|
|
65
|
+
$[4] = stuckAfter;
|
|
66
|
+
$[5] = t5;
|
|
67
|
+
$[6] = t6;
|
|
68
|
+
} else {
|
|
69
|
+
t5 = $[5];
|
|
70
|
+
t6 = $[6];
|
|
71
|
+
}
|
|
72
|
+
useEffect(t5, t6);
|
|
73
|
+
return phase;
|
|
74
|
+
};
|
|
75
|
+
export { useBusyPhase };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a CSS media query matches, re-evaluated whenever its answer changes.
|
|
3
|
+
* Reads outside a browser answer `false`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
7
|
+
*/
|
|
8
|
+
export declare const useMediaQuery: (query: string) => boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { useSyncExternalStore } from "react";
|
|
3
|
+
// src/lib/hooks/use-media-query.ts
|
|
4
|
+
/**
|
|
5
|
+
* Whether a CSS media query matches, re-evaluated whenever its answer changes.
|
|
6
|
+
* Reads outside a browser answer `false`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
10
|
+
*/
|
|
11
|
+
var useMediaQuery = (query) => {
|
|
12
|
+
const $ = c(3);
|
|
13
|
+
let t0;
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== query) {
|
|
16
|
+
t0 = (onChange) => {
|
|
17
|
+
const list = window.matchMedia(query);
|
|
18
|
+
list.addEventListener("change", onChange);
|
|
19
|
+
return () => list.removeEventListener("change", onChange);
|
|
20
|
+
};
|
|
21
|
+
t1 = () => window.matchMedia(query).matches;
|
|
22
|
+
$[0] = query;
|
|
23
|
+
$[1] = t0;
|
|
24
|
+
$[2] = t1;
|
|
25
|
+
} else {
|
|
26
|
+
t0 = $[1];
|
|
27
|
+
t1 = $[2];
|
|
28
|
+
}
|
|
29
|
+
return useSyncExternalStore(t0, t1, _temp);
|
|
30
|
+
};
|
|
31
|
+
function _temp() {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
export { useMediaQuery };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/** The state attributes `usePresence` puts on its element, as base-ui does. */
|
|
3
|
+
export type PresenceProps = Readonly<{
|
|
4
|
+
"data-open": "" | undefined;
|
|
5
|
+
"data-starting-style": "" | undefined;
|
|
6
|
+
"data-ending-style": "" | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
export type Presence = Readonly<{
|
|
9
|
+
/** Whether to render the element. */
|
|
10
|
+
mounted: boolean;
|
|
11
|
+
/** The state attributes to spread onto it. */
|
|
12
|
+
props: PresenceProps;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Keeps an element mounted until its exit transition has finished, and puts
|
|
16
|
+
* base-ui's state attributes on it, so a stylesheet animates both directions
|
|
17
|
+
* with `[data-starting-style]` and `[data-ending-style]`. Under reduced motion
|
|
18
|
+
* it mounts and unmounts at once.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const ref = useRef<HTMLDivElement>(null);
|
|
22
|
+
* const presence = usePresence(busy, ref);
|
|
23
|
+
* return presence.mounted ? <div ref={ref} {...presence.props} /> : null;
|
|
24
|
+
*/
|
|
25
|
+
export declare const usePresence: (open: boolean, ref: RefObject<Element | null>) => Presence;
|