@wisdomgarden/torque 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/dist/common/components.types.d.ts +60 -0
- package/dist/common/components.types.js +1 -0
- package/dist/common/dayjs.d.ts +7 -0
- package/dist/common/dayjs.js +10 -0
- package/dist/common/use-css-variable-value.d.ts +6 -0
- package/dist/common/use-css-variable-value.js +23 -0
- package/dist/common/use-css-variable-values.d.ts +10 -0
- package/dist/common/use-css-variable-values.js +25 -0
- package/dist/common/use-form-wrapper-props.d.ts +48 -0
- package/dist/common/use-form-wrapper-props.js +59 -0
- package/dist/common/use-ime-safe-input.d.ts +10 -0
- package/dist/common/use-ime-safe-input.js +23 -0
- package/dist/common/use-notification-a11y.d.ts +4 -0
- package/dist/common/use-notification-a11y.js +18 -0
- package/dist/common/use-sticky-box.d.ts +9 -0
- package/dist/common/use-sticky-box.js +217 -0
- package/dist/common/util.d.ts +5 -0
- package/dist/common/util.js +14 -0
- package/dist/components/_inner/base-select/common/searchable.d.ts +5 -0
- package/dist/components/_inner/base-select/common/searchable.js +6 -0
- package/dist/components/_inner/base-select/common/select.types.d.ts +169 -0
- package/dist/components/_inner/base-select/common/select.types.js +1 -0
- package/dist/components/_inner/base-select/search-select/index.d.ts +6 -0
- package/dist/components/_inner/base-select/search-select/index.js +106 -0
- package/dist/components/_inner/base-select/search-select/search-select.module.css.js +10 -0
- package/dist/components/_inner/base-select/single-select/index.d.ts +1 -0
- package/dist/components/_inner/base-select/single-select/index.js +5 -0
- package/dist/components/_inner/base-select/single-select/single-select.d.ts +5 -0
- package/dist/components/_inner/base-select/single-select/single-select.js +58 -0
- package/dist/components/_inner/base-select/target/single-select-target.d.ts +15 -0
- package/dist/components/_inner/base-select/target/single-select-target.js +56 -0
- package/dist/components/_inner/bottom-action/bottom-action-item.d.ts +11 -0
- package/dist/components/_inner/bottom-action/bottom-action-item.js +140 -0
- package/dist/components/_inner/bottom-action/bottom-action.d.ts +6 -0
- package/dist/components/_inner/bottom-action/bottom-action.js +161 -0
- package/dist/components/_inner/bottom-action/bottom-action.module.css.js +46 -0
- package/dist/components/_inner/bottom-action/bottom-action.types.d.ts +117 -0
- package/dist/components/_inner/bottom-action/index.d.ts +2 -0
- package/dist/components/_inner/bottom-action/index.js +5 -0
- package/dist/components/_inner/drawer/base-bottom-drawer.d.ts +32 -0
- package/dist/components/_inner/drawer/base-bottom-drawer.js +91 -0
- package/dist/components/_inner/drawer/base-bottom-drawer.module.css.js +18 -0
- package/dist/components/_inner/dropdown/empty-state.d.ts +6 -0
- package/dist/components/_inner/dropdown/empty-state.js +16 -0
- package/dist/components/_inner/dropdown/empty-state.module.css.js +12 -0
- package/dist/components/_inner/dropdown/options-drop-down.d.ts +22 -0
- package/dist/components/_inner/dropdown/options-drop-down.js +95 -0
- package/dist/components/_inner/dropdown/options-drop-down.module.css.js +18 -0
- package/dist/components/_inner/menu/_mobile/menu.mobile.d.ts +11 -0
- package/dist/components/_inner/menu/_mobile/menu.mobile.js +15 -0
- package/dist/components/_inner/menu/_web/menu-web.module.css.js +18 -0
- package/dist/components/_inner/menu/_web/menu.web.d.ts +6 -0
- package/dist/components/_inner/menu/_web/menu.web.js +198 -0
- package/dist/components/_inner/number/number-input-left.d.ts +5 -0
- package/dist/components/_inner/number/number-input-left.js +29 -0
- package/dist/components/_inner/number/number-input-right.d.ts +6 -0
- package/dist/components/_inner/number/number-input-right.js +62 -0
- package/dist/components/_inner/number/number.module.css.js +12 -0
- package/dist/components/_inner/table/head/table-head-filter-multi-select.d.ts +25 -0
- package/dist/components/_inner/table/head/table-head-filter-multi-select.js +139 -0
- package/dist/components/_inner/table/head/table-head-filter-search.d.ts +18 -0
- package/dist/components/_inner/table/head/table-head-filter-search.js +102 -0
- package/dist/components/_inner/table/head/table-head-filter-single-select.d.ts +21 -0
- package/dist/components/_inner/table/head/table-head-filter-single-select.js +76 -0
- package/dist/components/_inner/table/head/table-head-sort.d.ts +16 -0
- package/dist/components/_inner/table/head/table-head-sort.js +51 -0
- package/dist/components/_inner/table/head/table-head.module.css.js +40 -0
- package/dist/components/_inner/table/index.d.ts +5 -0
- package/dist/components/_inner/table/index.js +13 -0
- package/dist/components/_inner/table/table-header-title.d.ts +7 -0
- package/dist/components/_inner/table/table-header-title.js +24 -0
- package/dist/components/_inner/table/table-header-title.module.css.js +12 -0
- package/dist/components/_inner/tags-input/hooks/use-height-transition.d.ts +15 -0
- package/dist/components/_inner/tags-input/hooks/use-height-transition.js +31 -0
- package/dist/components/_inner/tags-input/hooks/use-is-wrapped.d.ts +12 -0
- package/dist/components/_inner/tags-input/hooks/use-is-wrapped.js +24 -0
- package/dist/components/_inner/tags-input/index.d.ts +2 -0
- package/dist/components/_inner/tags-input/index.js +5 -0
- package/dist/components/_inner/tags-input/styles/tags-input.module.css.js +48 -0
- package/dist/components/_inner/tags-input/tags-input-tag.d.ts +13 -0
- package/dist/components/_inner/tags-input/tags-input-tag.js +53 -0
- package/dist/components/_inner/tags-input/tags-input.d.ts +9 -0
- package/dist/components/_inner/tags-input/tags-input.js +143 -0
- package/dist/components/_inner/tags-input/tags-input.types.d.ts +57 -0
- package/dist/components/alert/alert.d.ts +6 -0
- package/dist/components/alert/alert.js +102 -0
- package/dist/components/alert/alert.module.css.js +20 -0
- package/dist/components/alert/alert.types.d.ts +18 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +6 -0
- package/dist/components/base-input/base-input.d.ts +5 -0
- package/dist/components/base-input/base-input.js +143 -0
- package/dist/components/base-input/base-input.types.d.ts +89 -0
- package/dist/components/base-input/index.d.ts +5 -0
- package/dist/components/base-input/index.js +11 -0
- package/dist/components/base-input/styles/base-input-variables.module.css.js +8 -0
- package/dist/components/base-input/styles/base-input.module.css.js +24 -0
- package/dist/components/base-input/subs/base-input-left-section.d.ts +10 -0
- package/dist/components/base-input/subs/base-input-left-section.js +29 -0
- package/dist/components/base-input/subs/base-input-right-section.d.ts +23 -0
- package/dist/components/base-input/subs/base-input-right-section.js +87 -0
- package/dist/components/base-input/subs/base-input-target.d.ts +11 -0
- package/dist/components/base-input/subs/base-input-target.js +35 -0
- package/dist/components/base-input/subs/base-input-wrapper.d.ts +18 -0
- package/dist/components/base-input/subs/base-input-wrapper.js +51 -0
- package/dist/components/base-input/util.d.ts +8 -0
- package/dist/components/base-input/util.js +16 -0
- package/dist/components/bottom-drawer/bottom-drawer.d.ts +6 -0
- package/dist/components/bottom-drawer/bottom-drawer.js +16 -0
- package/dist/components/bottom-drawer/index.d.ts +2 -0
- package/dist/components/bottom-drawer/index.js +5 -0
- package/dist/components/box/box.d.ts +2 -0
- package/dist/components/box/box.js +27 -0
- package/dist/components/box/box.module.css.js +8 -0
- package/dist/components/box/box.types.d.ts +36 -0
- package/dist/components/box/index.d.ts +2 -0
- package/dist/components/box/index.js +5 -0
- package/dist/components/button/button.d.ts +17 -0
- package/dist/components/button/button.js +91 -0
- package/dist/components/button/button.types.d.ts +88 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +5 -0
- package/dist/components/button/styles/button-variables.module.css.js +8 -0
- package/dist/components/button/styles/button.module.css.js +18 -0
- package/dist/components/checkbox/checkbox-group.d.ts +7 -0
- package/dist/components/checkbox/checkbox-group.js +51 -0
- package/dist/components/checkbox/checkbox-variables.module.css.js +8 -0
- package/dist/components/checkbox/checkbox.d.ts +9 -0
- package/dist/components/checkbox/checkbox.js +93 -0
- package/dist/components/checkbox/checkbox.module.css.js +12 -0
- package/dist/components/checkbox/checkbox.types.d.ts +41 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.js +8 -0
- package/dist/components/combobox/combobox-context.d.ts +9 -0
- package/dist/components/combobox/combobox-context.js +15 -0
- package/dist/components/combobox/combobox-dropdown.d.ts +13 -0
- package/dist/components/combobox/combobox-dropdown.js +35 -0
- package/dist/components/combobox/combobox-infinite-dropdown.d.ts +51 -0
- package/dist/components/combobox/combobox-infinite-dropdown.js +56 -0
- package/dist/components/combobox/combobox-option.d.ts +3 -0
- package/dist/components/combobox/combobox-option.js +50 -0
- package/dist/components/combobox/combobox-options.d.ts +8 -0
- package/dist/components/combobox/combobox-options.js +38 -0
- package/dist/components/combobox/combobox-search.d.ts +27 -0
- package/dist/components/combobox/combobox-search.js +29 -0
- package/dist/components/combobox/combobox-target.d.ts +15 -0
- package/dist/components/combobox/combobox-target.js +49 -0
- package/dist/components/combobox/combobox.d.ts +61 -0
- package/dist/components/combobox/combobox.js +53 -0
- package/dist/components/combobox/combobox.types.d.ts +58 -0
- package/dist/components/combobox/hooks/use-combobox-search-input.d.ts +11 -0
- package/dist/components/combobox/hooks/use-combobox-search-input.js +22 -0
- package/dist/components/combobox/hooks/use-combobox-target-key-down.d.ts +12 -0
- package/dist/components/combobox/hooks/use-combobox-target-key-down.js +35 -0
- package/dist/components/combobox/hooks/use-combobox.d.ts +58 -0
- package/dist/components/combobox/hooks/use-combobox.js +90 -0
- package/dist/components/combobox/index.d.ts +5 -0
- package/dist/components/combobox/index.js +9 -0
- package/dist/components/combobox/styles/combobox.module.css.js +14 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-dropdown.d.ts +10 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-dropdown.js +14 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-target.d.ts +3 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-target.js +20 -0
- package/dist/components/data-filter/data-filter-content.d.ts +13 -0
- package/dist/components/data-filter/data-filter-content.js +46 -0
- package/dist/components/data-filter/data-filter-drawer.d.ts +19 -0
- package/dist/components/data-filter/data-filter-drawer.js +73 -0
- package/dist/components/data-filter/data-filter-inline.d.ts +6 -0
- package/dist/components/data-filter/data-filter-inline.js +12 -0
- package/dist/components/data-filter/data-filter-panel.d.ts +13 -0
- package/dist/components/data-filter/data-filter-panel.js +40 -0
- package/dist/components/data-filter/data-filter.d.ts +2 -0
- package/dist/components/data-filter/data-filter.js +94 -0
- package/dist/components/data-filter/data-filter.module.css.js +56 -0
- package/dist/components/data-filter/data-filter.types.d.ts +29 -0
- package/dist/components/data-filter/filter-condition-tags/filter-condition-tags.d.ts +16 -0
- package/dist/components/data-filter/filter-condition-tags/filter-condition-tags.js +114 -0
- package/dist/components/data-filter/filter-condition-tags/index.d.ts +1 -0
- package/dist/components/data-filter/filter-condition-tags/index.js +5 -0
- package/dist/components/data-filter/hooks/use-data-filter-open-state.d.ts +10 -0
- package/dist/components/data-filter/hooks/use-data-filter-open-state.js +21 -0
- package/dist/components/data-filter/hooks/use-data-filter-state.d.ts +11 -0
- package/dist/components/data-filter/hooks/use-data-filter-state.js +48 -0
- package/dist/components/data-filter/index.d.ts +3 -0
- package/dist/components/data-filter/index.js +7 -0
- package/dist/components/date-picker/components/common/calendar-header.d.ts +10 -0
- package/dist/components/date-picker/components/common/calendar-header.js +70 -0
- package/dist/components/date-picker/components/common/calendar-panel.d.ts +6 -0
- package/dist/components/date-picker/components/common/calendar-panel.js +133 -0
- package/dist/components/date-picker/components/common/date-cell.d.ts +8 -0
- package/dist/components/date-picker/components/common/date-cell.js +46 -0
- package/dist/components/date-picker/components/common/decade-view.d.ts +8 -0
- package/dist/components/date-picker/components/common/decade-view.js +36 -0
- package/dist/components/date-picker/components/common/month-view.d.ts +5 -0
- package/dist/components/date-picker/components/common/month-view.js +65 -0
- package/dist/components/date-picker/components/common/picker-footer.d.ts +28 -0
- package/dist/components/date-picker/components/common/picker-footer.js +29 -0
- package/dist/components/date-picker/components/common/picker-sections.d.ts +14 -0
- package/dist/components/date-picker/components/common/picker-sections.js +31 -0
- package/dist/components/date-picker/components/common/picker-target-input.d.ts +7 -0
- package/dist/components/date-picker/components/common/picker-target-input.js +11 -0
- package/dist/components/date-picker/components/common/time-column.d.ts +6 -0
- package/dist/components/date-picker/components/common/time-column.js +121 -0
- package/dist/components/date-picker/components/common/time-input-row.d.ts +20 -0
- package/dist/components/date-picker/components/common/time-input-row.js +65 -0
- package/dist/components/date-picker/components/common/time-panel.d.ts +6 -0
- package/dist/components/date-picker/components/common/time-panel.js +86 -0
- package/dist/components/date-picker/components/common/year-view.d.ts +8 -0
- package/dist/components/date-picker/components/common/year-view.js +36 -0
- package/dist/components/date-picker/components/picker-focus-context.d.ts +21 -0
- package/dist/components/date-picker/components/picker-focus-context.js +16 -0
- package/dist/components/date-picker/components/range/range-panel.d.ts +33 -0
- package/dist/components/date-picker/components/range/range-panel.js +101 -0
- package/dist/components/date-picker/components/range/range-shell.d.ts +6 -0
- package/dist/components/date-picker/components/range/range-shell.js +110 -0
- package/dist/components/date-picker/components/single/picker-shell.d.ts +6 -0
- package/dist/components/date-picker/components/single/picker-shell.js +109 -0
- package/dist/components/date-picker/date-picker.d.ts +6 -0
- package/dist/components/date-picker/date-picker.js +76 -0
- package/dist/components/date-picker/date-picker.types.d.ts +543 -0
- package/dist/components/date-picker/date-picker.types.js +5 -0
- package/dist/components/date-picker/date-range-picker.d.ts +5 -0
- package/dist/components/date-picker/date-range-picker.js +103 -0
- package/dist/components/date-picker/date-time-picker.d.ts +6 -0
- package/dist/components/date-picker/date-time-picker.js +181 -0
- package/dist/components/date-picker/date-time-range-picker.d.ts +6 -0
- package/dist/components/date-picker/date-time-range-picker.js +157 -0
- package/dist/components/date-picker/hooks/date-disabled.d.ts +27 -0
- package/dist/components/date-picker/hooks/date-disabled.js +60 -0
- package/dist/components/date-picker/hooks/time-utils.d.ts +17 -0
- package/dist/components/date-picker/hooks/time-utils.js +14 -0
- package/dist/components/date-picker/hooks/use-calendar.d.ts +12 -0
- package/dist/components/date-picker/hooks/use-calendar.js +28 -0
- package/dist/components/date-picker/hooks/use-date-parser.d.ts +17 -0
- package/dist/components/date-picker/hooks/use-date-parser.js +16 -0
- package/dist/components/date-picker/hooks/use-grid-keyboard.d.ts +22 -0
- package/dist/components/date-picker/hooks/use-grid-keyboard.js +74 -0
- package/dist/components/date-picker/hooks/use-range-draft.d.ts +61 -0
- package/dist/components/date-picker/hooks/use-range-draft.js +84 -0
- package/dist/components/date-picker/hooks/use-range-session.d.ts +14 -0
- package/dist/components/date-picker/hooks/use-range-session.js +11 -0
- package/dist/components/date-picker/hooks/use-resolved-format.d.ts +15 -0
- package/dist/components/date-picker/hooks/use-resolved-format.js +25 -0
- package/dist/components/date-picker/index.d.ts +21 -0
- package/dist/components/date-picker/index.js +15 -0
- package/dist/components/date-picker/styles/calendar-header.module.css.js +14 -0
- package/dist/components/date-picker/styles/calendar-panel.module.css.js +12 -0
- package/dist/components/date-picker/styles/date-cell.module.css.js +8 -0
- package/dist/components/date-picker/styles/month-view.module.css.js +12 -0
- package/dist/components/date-picker/styles/panel-layout.module.css.js +12 -0
- package/dist/components/date-picker/styles/picker-footer.module.css.js +10 -0
- package/dist/components/date-picker/styles/picker-shell.module.css.js +12 -0
- package/dist/components/date-picker/styles/range-panel.module.css.js +12 -0
- package/dist/components/date-picker/styles/time-column.module.css.js +10 -0
- package/dist/components/date-picker/styles/time-input-row.module.css.js +16 -0
- package/dist/components/date-picker/styles/time-panel.module.css.js +8 -0
- package/dist/components/date-picker/styles/year-view.module.css.js +10 -0
- package/dist/components/date-picker/time-picker.d.ts +6 -0
- package/dist/components/date-picker/time-picker.js +81 -0
- package/dist/components/date-picker/time-range-picker.d.ts +6 -0
- package/dist/components/date-picker/time-range-picker.js +135 -0
- package/dist/components/drawer/drawer-events.d.ts +28 -0
- package/dist/components/drawer/drawer-events.js +14 -0
- package/dist/components/drawer/drawer.d.ts +33 -0
- package/dist/components/drawer/drawer.js +86 -0
- package/dist/components/drawer/drawer.module.css.js +34 -0
- package/dist/components/drawer/drawes.d.ts +4 -0
- package/dist/components/drawer/drawes.js +82 -0
- package/dist/components/drawer/index.d.ts +4 -0
- package/dist/components/drawer/index.js +9 -0
- package/dist/components/filter/filter-popover.d.ts +11 -0
- package/dist/components/filter/filter-popover.js +53 -0
- package/dist/components/filter/filter.d.ts +5 -0
- package/dist/components/filter/filter.js +29 -0
- package/dist/components/filter/filter.module.css.js +12 -0
- package/dist/components/filter/filter.types.d.ts +27 -0
- package/dist/components/filter/filter.types.js +1 -0
- package/dist/components/filter/icon-filter.d.ts +6 -0
- package/dist/components/filter/icon-filter.js +25 -0
- package/dist/components/filter/index.d.ts +4 -0
- package/dist/components/filter/index.js +9 -0
- package/dist/components/filter/multi-filter.d.ts +5 -0
- package/dist/components/filter/multi-filter.js +52 -0
- package/dist/components/flex/flex.d.ts +9 -0
- package/dist/components/flex/flex.js +28 -0
- package/dist/components/flex/flex.module.css.js +8 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +5 -0
- package/dist/components/flex/layout.types.d.ts +69 -0
- package/dist/components/form-wrapper/form-item-wrapper-defaults-context.d.ts +10 -0
- package/dist/components/form-wrapper/form-item-wrapper-defaults-context.js +19 -0
- package/dist/components/form-wrapper/form-item-wrapper.d.ts +5 -0
- package/dist/components/form-wrapper/form-item-wrapper.js +111 -0
- package/dist/components/form-wrapper/form-item-wrapper.module.css.js +28 -0
- package/dist/components/form-wrapper/form-wrapper.types.d.ts +15 -0
- package/dist/components/form-wrapper/index.d.ts +3 -0
- package/dist/components/form-wrapper/index.js +8 -0
- package/dist/components/group/group.d.ts +8 -0
- package/dist/components/group/group.js +36 -0
- package/dist/components/group/group.module.css.js +8 -0
- package/dist/components/group/index.d.ts +1 -0
- package/dist/components/group/index.js +5 -0
- package/dist/components/icon-button/icon-button.d.ts +20 -0
- package/dist/components/icon-button/icon-button.js +20 -0
- package/dist/components/icon-button/icon-button.module.css.js +8 -0
- package/dist/components/icon-button/icon-button.types.d.ts +7 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +5 -0
- package/dist/components/link-button/index.d.ts +1 -0
- package/dist/components/link-button/index.js +5 -0
- package/dist/components/link-button/link-button.d.ts +31 -0
- package/dist/components/link-button/link-button.js +31 -0
- package/dist/components/link-icon-button/index.d.ts +1 -0
- package/dist/components/link-icon-button/index.js +5 -0
- package/dist/components/link-icon-button/link-icon-button.d.ts +37 -0
- package/dist/components/link-icon-button/link-icon-button.js +30 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +5 -0
- package/dist/components/menu/menu.d.ts +33 -0
- package/dist/components/menu/menu.js +17 -0
- package/dist/components/menu/menu.types.d.ts +46 -0
- package/dist/components/message/index.d.ts +2 -0
- package/dist/components/message/index.js +5 -0
- package/dist/components/message/message.d.ts +2 -0
- package/dist/components/message/message.js +42 -0
- package/dist/components/message/message.module.css.js +14 -0
- package/dist/components/message/message.types.d.ts +7 -0
- package/dist/components/message/messages.d.ts +10 -0
- package/dist/components/message/messages.js +37 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +5 -0
- package/dist/components/modal/modal.d.ts +6 -0
- package/dist/components/modal/modal.js +51 -0
- package/dist/components/modal/modal.module.css.js +10 -0
- package/dist/components/multi-select/base-multi-select.d.ts +3 -0
- package/dist/components/multi-select/base-multi-select.js +100 -0
- package/dist/components/multi-select/index.d.ts +1 -0
- package/dist/components/multi-select/index.js +5 -0
- package/dist/components/multi-select/multi-select-input.d.ts +29 -0
- package/dist/components/multi-select/multi-select-input.js +74 -0
- package/dist/components/multi-select/multi-select.d.ts +28 -0
- package/dist/components/multi-select/multi-select.js +34 -0
- package/dist/components/multi-select/multi-select.mobile.d.ts +4 -0
- package/dist/components/multi-select/multi-select.mobile.js +59 -0
- package/dist/components/multi-select/multi-select.types.d.ts +56 -0
- package/dist/components/multi-select/multi-select.types.js +1 -0
- package/dist/components/multi-select/styles/base-multi-select.module.css.js +16 -0
- package/dist/components/notifications/index.d.ts +3 -0
- package/dist/components/notifications/index.js +7 -0
- package/dist/components/notifications/notification.d.ts +11 -0
- package/dist/components/notifications/notification.js +79 -0
- package/dist/components/notifications/notification.module.css.js +14 -0
- package/dist/components/notifications/notification.types.d.ts +25 -0
- package/dist/components/notifications/notifications.d.ts +42 -0
- package/dist/components/notifications/notifications.js +42 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-input/index.js +5 -0
- package/dist/components/number-input/number-input.d.ts +8 -0
- package/dist/components/number-input/number-input.js +161 -0
- package/dist/components/number-input/number-input.module.css.js +8 -0
- package/dist/components/number-input/number-input.types.d.ts +65 -0
- package/dist/components/paper/index.d.ts +1 -0
- package/dist/components/paper/index.js +5 -0
- package/dist/components/paper/paper.d.ts +7 -0
- package/dist/components/paper/paper.js +15 -0
- package/dist/components/paper/paper.module.css.js +8 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/index.js +5 -0
- package/dist/components/password-input/password-input.d.ts +15 -0
- package/dist/components/password-input/password-input.js +32 -0
- package/dist/components/popover/hooks.d.ts +17 -0
- package/dist/components/popover/hooks.js +131 -0
- package/dist/components/popover/index.d.ts +8 -0
- package/dist/components/popover/index.js +13 -0
- package/dist/components/popover/popover-context.d.ts +4 -0
- package/dist/components/popover/popover-context.js +16 -0
- package/dist/components/popover/popover-dropdown.d.ts +3 -0
- package/dist/components/popover/popover-dropdown.js +149 -0
- package/dist/components/popover/popover-stack.d.ts +10 -0
- package/dist/components/popover/popover-stack.js +24 -0
- package/dist/components/popover/popover-target.d.ts +3 -0
- package/dist/components/popover/popover-target.js +55 -0
- package/dist/components/popover/popover.d.ts +3 -0
- package/dist/components/popover/popover.js +175 -0
- package/dist/components/popover/popover.types.d.ts +211 -0
- package/dist/components/popover/styles/popover.module.css.js +12 -0
- package/dist/components/radio/index.d.ts +8 -0
- package/dist/components/radio/index.js +12 -0
- package/dist/components/radio/radio-group.d.ts +18 -0
- package/dist/components/radio/radio-group.js +54 -0
- package/dist/components/radio/radio-variables.module.css.js +8 -0
- package/dist/components/radio/radio.d.ts +17 -0
- package/dist/components/radio/radio.js +56 -0
- package/dist/components/radio/radio.module.css.js +14 -0
- package/dist/components/radio/radio.types.d.ts +59 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/index.js +5 -0
- package/dist/components/select/select.d.ts +15 -0
- package/dist/components/select/select.js +48 -0
- package/dist/components/select/select.mobile.d.ts +12 -0
- package/dist/components/select/select.mobile.js +53 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +5 -0
- package/dist/components/stack/stack.d.ts +6 -0
- package/dist/components/stack/stack.js +10 -0
- package/dist/components/sticky-box.d.ts +2 -0
- package/dist/components/sticky-box.js +10 -0
- package/dist/components/switch/index.d.ts +4 -0
- package/dist/components/switch/index.js +7 -0
- package/dist/components/switch/switch-group.d.ts +26 -0
- package/dist/components/switch/switch-group.js +12 -0
- package/dist/components/switch/switch.d.ts +27 -0
- package/dist/components/switch/switch.js +23 -0
- package/dist/components/switch/switch.module.css.js +7 -0
- package/dist/components/tab/index.d.ts +7 -0
- package/dist/components/tab/index.js +13 -0
- package/dist/components/tab/styles/tabs-variables.module.css.js +8 -0
- package/dist/components/tab/styles/tabs.module.css.js +22 -0
- package/dist/components/tab/subs/tabs-link-tab.d.ts +10 -0
- package/dist/components/tab/subs/tabs-link-tab.js +28 -0
- package/dist/components/tab/subs/tabs-list.d.ts +6 -0
- package/dist/components/tab/subs/tabs-list.js +59 -0
- package/dist/components/tab/subs/tabs-panel.d.ts +6 -0
- package/dist/components/tab/subs/tabs-panel.js +40 -0
- package/dist/components/tab/subs/tabs-tab.d.ts +6 -0
- package/dist/components/tab/subs/tabs-tab.js +52 -0
- package/dist/components/tab/tabs-context.d.ts +3 -0
- package/dist/components/tab/tabs-context.js +13 -0
- package/dist/components/tab/tabs.d.ts +20 -0
- package/dist/components/tab/tabs.js +83 -0
- package/dist/components/tab/tabs.types.d.ts +107 -0
- package/dist/components/tab/use-tabs-data-props.d.ts +9 -0
- package/dist/components/tab/use-tabs-data-props.js +12 -0
- package/dist/components/tab/use-tabs-keyboard-navigation.d.ts +13 -0
- package/dist/components/tab/use-tabs-keyboard-navigation.js +44 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/index.js +16 -0
- package/dist/components/table/table.d.ts +23 -0
- package/dist/components/table/table.js +159 -0
- package/dist/components/table/table.module.css.js +56 -0
- package/dist/components/table/table.types.d.ts +55 -0
- package/dist/components/table-pagination/index.d.ts +3 -0
- package/dist/components/table-pagination/index.js +8 -0
- package/dist/components/table-pagination/pagination.d.ts +10 -0
- package/dist/components/table-pagination/pagination.js +115 -0
- package/dist/components/table-pagination/pagination.module.css.js +14 -0
- package/dist/components/table-pagination/table-pagination.d.ts +15 -0
- package/dist/components/table-pagination/table-pagination.js +123 -0
- package/dist/components/table-pagination/table-pagination.module.css.js +18 -0
- package/dist/components/tag/closable-tag.d.ts +2 -0
- package/dist/components/tag/closable-tag.js +35 -0
- package/dist/components/tag/icon-tag.d.ts +2 -0
- package/dist/components/tag/icon-tag.js +36 -0
- package/dist/components/tag/index.d.ts +5 -0
- package/dist/components/tag/index.js +11 -0
- package/dist/components/tag/link-tag.d.ts +11 -0
- package/dist/components/tag/link-tag.js +31 -0
- package/dist/components/tag/styles/tag-variables.module.css.js +8 -0
- package/dist/components/tag/styles/tag.module.css.js +18 -0
- package/dist/components/tag/tag.d.ts +28 -0
- package/dist/components/tag/tag.js +40 -0
- package/dist/components/tag/tag.types.d.ts +72 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/index.js +5 -0
- package/dist/components/text/text.d.ts +3 -0
- package/dist/components/text/text.js +36 -0
- package/dist/components/text/text.module.css.js +8 -0
- package/dist/components/text/text.types.d.ts +11 -0
- package/dist/components/text-area/index.d.ts +2 -0
- package/dist/components/text-area/index.js +5 -0
- package/dist/components/text-area/text-area.d.ts +9 -0
- package/dist/components/text-area/text-area.js +125 -0
- package/dist/components/text-area/text-area.module.css.js +22 -0
- package/dist/components/text-area/text-area.types.d.ts +46 -0
- package/dist/components/text-input/index.d.ts +2 -0
- package/dist/components/text-input/index.js +5 -0
- package/dist/components/text-input/text-input.d.ts +14 -0
- package/dist/components/text-input/text-input.js +24 -0
- package/dist/components/tooltip/floating-arrow.d.ts +13 -0
- package/dist/components/tooltip/floating-arrow.js +40 -0
- package/dist/components/tooltip/get-arrow-position-styles.d.ts +11 -0
- package/dist/components/tooltip/get-arrow-position-styles.js +63 -0
- package/dist/components/tooltip/index.d.ts +54 -0
- package/dist/components/tooltip/index.js +150 -0
- package/dist/components/tooltip/styles.module.css.js +10 -0
- package/dist/components/tooltip/types.d.ts +13 -0
- package/dist/components/tooltip/use-merged-events.d.ts +18 -0
- package/dist/components/tooltip/use-merged-events.js +22 -0
- package/dist/components/tooltip/use-tooltip-trigger.d.ts +13 -0
- package/dist/components/tooltip/use-tooltip-trigger.js +59 -0
- package/dist/components/tooltip/utils.d.ts +4 -0
- package/dist/components/tooltip/utils.js +35 -0
- package/dist/components/tree/hooks/use-custom-click-behavior-feature.d.ts +16 -0
- package/dist/components/tree/hooks/use-custom-click-behavior-feature.js +125 -0
- package/dist/components/tree/hooks/use-tree-animation.d.ts +12 -0
- package/dist/components/tree/hooks/use-tree-animation.js +111 -0
- package/dist/components/tree/hooks/use-tree-config.d.ts +22 -0
- package/dist/components/tree/hooks/use-tree-config.js +96 -0
- package/dist/components/tree/hooks/use-tree-search.d.ts +19 -0
- package/dist/components/tree/hooks/use-tree-search.js +57 -0
- package/dist/components/tree/hooks/use-tree-value.d.ts +16 -0
- package/dist/components/tree/hooks/use-tree-value.js +37 -0
- package/dist/components/tree/hooks/use-tree.d.ts +13 -0
- package/dist/components/tree/hooks/use-tree.js +111 -0
- package/dist/components/tree/index.d.ts +7 -0
- package/dist/components/tree/index.js +16 -0
- package/dist/components/tree/styles/tree.module.css.js +44 -0
- package/dist/components/tree/tree-content.d.ts +15 -0
- package/dist/components/tree/tree-content.js +77 -0
- package/dist/components/tree/tree-context.d.ts +19 -0
- package/dist/components/tree/tree-context.js +13 -0
- package/dist/components/tree/tree-node-list.d.ts +9 -0
- package/dist/components/tree/tree-node-list.js +21 -0
- package/dist/components/tree/tree-node.d.ts +11 -0
- package/dist/components/tree/tree-node.js +137 -0
- package/dist/components/tree/tree.d.ts +20 -0
- package/dist/components/tree/tree.js +22 -0
- package/dist/components/tree/tree.types.d.ts +126 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +5 -0
- package/dist/components/tree-select/styles/tree-select.module.css.js +20 -0
- package/dist/components/tree-select/tree-select-dropdown.d.ts +9 -0
- package/dist/components/tree-select/tree-select-dropdown.js +36 -0
- package/dist/components/tree-select/tree-select-target.d.ts +18 -0
- package/dist/components/tree-select/tree-select-target.js +116 -0
- package/dist/components/tree-select/tree-select.d.ts +21 -0
- package/dist/components/tree-select/tree-select.js +201 -0
- package/dist/components/tree-select/tree-select.types.d.ts +39 -0
- package/dist/components/unstyled-button/index.d.ts +1 -0
- package/dist/components/unstyled-button/index.js +5 -0
- package/dist/components/unstyled-button/unstyled-button.d.ts +3 -0
- package/dist/components/unstyled-button/unstyled-button.js +19 -0
- package/dist/components/unstyled-button/unstyled-button.module.css.js +8 -0
- package/dist/components/virtualized-tree-select/index.d.ts +2 -0
- package/dist/components/virtualized-tree-select/index.js +5 -0
- package/dist/components/virtualized-tree-select/virtualized-tree-select.d.ts +25 -0
- package/dist/components/virtualized-tree-select/virtualized-tree-select.js +253 -0
- package/dist/components/virtualized-tree-select/virtualized-tree-select.module.css.js +20 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +214 -0
- package/dist/locale/ar.d.ts +2 -0
- package/dist/locale/ar.js +58 -0
- package/dist/locale/en.d.ts +2 -0
- package/dist/locale/en.js +58 -0
- package/dist/locale/index.d.ts +6 -0
- package/dist/locale/index.js +15 -0
- package/dist/locale/ko.d.ts +2 -0
- package/dist/locale/ko.js +58 -0
- package/dist/locale/types.d.ts +55 -0
- package/dist/locale/types.js +8 -0
- package/dist/locale/zh-Hans.d.ts +2 -0
- package/dist/locale/zh-Hans.js +58 -0
- package/dist/locale/zh-Hant.d.ts +2 -0
- package/dist/locale/zh-Hant.js +58 -0
- package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-number-format/dist/react-number-format.es.js +572 -0
- package/dist/provider/hooks.d.ts +24 -0
- package/dist/provider/hooks.js +26 -0
- package/dist/provider/index.d.ts +7 -0
- package/dist/provider/index.js +16 -0
- package/dist/provider/ui-context.d.ts +16 -0
- package/dist/provider/ui-context.js +14 -0
- package/dist/provider/ui-link.d.ts +22 -0
- package/dist/provider/ui-link.js +10 -0
- package/dist/provider/ui-provider.d.ts +19 -0
- package/dist/provider/ui-provider.js +21 -0
- package/package.json +198 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as o, jsx as i, Fragment as d } from "react/jsx-runtime";
|
|
3
|
+
import { Stack as s, Group as m, Space as n, Text as f } from "@mantine/core";
|
|
4
|
+
import { hideNotification as h, showNotification as p } from "@mantine/notifications";
|
|
5
|
+
import { Icon as u } from "@wisdomgarden/torque-icons";
|
|
6
|
+
import { useNotificationA11y as w } from "../../common/use-notification-a11y.js";
|
|
7
|
+
import "../../provider/ui-context.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import { useLocale as N } from "../../provider/hooks.js";
|
|
10
|
+
import { IconButton as x } from "../icon-button/icon-button.js";
|
|
11
|
+
import a from "./notification.module.css.js";
|
|
12
|
+
function C(e) {
|
|
13
|
+
const t = N(), r = {
|
|
14
|
+
success: "success-fill",
|
|
15
|
+
info: "info-fill",
|
|
16
|
+
warning: "warning-fill-triangle",
|
|
17
|
+
error: "error-fill"
|
|
18
|
+
};
|
|
19
|
+
let l = e.title, c = e.message;
|
|
20
|
+
l || (l = c, c = void 0);
|
|
21
|
+
const g = w();
|
|
22
|
+
return /* @__PURE__ */ o(s, { gap: 0, className: a.notification, children: [
|
|
23
|
+
/* @__PURE__ */ o(m, { gap: 0, wrap: "nowrap", children: [
|
|
24
|
+
/* @__PURE__ */ i(s, { gap: 0, children: /* @__PURE__ */ i(
|
|
25
|
+
u,
|
|
26
|
+
{
|
|
27
|
+
name: r[e.type ?? "info"],
|
|
28
|
+
useOriginalColor: !0,
|
|
29
|
+
width: 28,
|
|
30
|
+
height: 28,
|
|
31
|
+
role: "img",
|
|
32
|
+
"aria-label": g[e.type ?? "info"]
|
|
33
|
+
}
|
|
34
|
+
) }),
|
|
35
|
+
/* @__PURE__ */ i(n, { w: 16 }),
|
|
36
|
+
/* @__PURE__ */ o(s, { gap: 0, className: a.contentStack, children: [
|
|
37
|
+
/* @__PURE__ */ i(f, { span: !0, fw: 600, className: a.title, fz: 14, lh: "22px", children: l }),
|
|
38
|
+
/* @__PURE__ */ i(n, { w: 6 }),
|
|
39
|
+
/* @__PURE__ */ i(f, { span: !0, className: a.message, fz: 14, lh: "22px", children: c })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ i(n, { w: 16 }),
|
|
42
|
+
/* @__PURE__ */ i(
|
|
43
|
+
x,
|
|
44
|
+
{
|
|
45
|
+
iconName: "close",
|
|
46
|
+
"aria-label": t.close,
|
|
47
|
+
variant: "text",
|
|
48
|
+
onClick: () => {
|
|
49
|
+
h(e.getId());
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }),
|
|
54
|
+
e.renderBottom && /* @__PURE__ */ o(d, { children: [
|
|
55
|
+
/* @__PURE__ */ i(n, { h: 8 }),
|
|
56
|
+
/* @__PURE__ */ i(m, { children: e.renderBottom(e.getId) })
|
|
57
|
+
] })
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
function M(e) {
|
|
61
|
+
let t = "";
|
|
62
|
+
const r = {
|
|
63
|
+
...e,
|
|
64
|
+
getId: () => t
|
|
65
|
+
};
|
|
66
|
+
return t = p({
|
|
67
|
+
id: e.id,
|
|
68
|
+
message: /* @__PURE__ */ i(C, { ...r }),
|
|
69
|
+
autoClose: e.autoClose ?? 5e3,
|
|
70
|
+
withCloseButton: !1,
|
|
71
|
+
onClose: e.onClose,
|
|
72
|
+
onOpen: e.onOpen,
|
|
73
|
+
position: "top-right"
|
|
74
|
+
}), t;
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
C as Notification,
|
|
78
|
+
M as showNotification
|
|
79
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const t = "_notification_rnwhl_2", n = "_contentStack_rnwhl_11", e = "_title_rnwhl_17", c = "_message_rnwhl_26", o = {
|
|
3
|
+
notification: t,
|
|
4
|
+
contentStack: n,
|
|
5
|
+
title: e,
|
|
6
|
+
message: c
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
n as contentStack,
|
|
10
|
+
o as default,
|
|
11
|
+
c as message,
|
|
12
|
+
t as notification,
|
|
13
|
+
e as title
|
|
14
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NotificationData } from '@mantine/notifications';
|
|
2
|
+
/**
|
|
3
|
+
* 全局通知组件的配置选项
|
|
4
|
+
*/
|
|
5
|
+
export interface NotificationOption {
|
|
6
|
+
/** 通知的唯一标识符。如果不提供,将自动生成一个随机 ID */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** 通知的标题。如果未提供 `message`,则 `title` 将作为主要文本显示 */
|
|
9
|
+
title?: string | React.ReactNode;
|
|
10
|
+
/** 通知的详细内容描述 */
|
|
11
|
+
message?: string | React.ReactNode;
|
|
12
|
+
/** 通知类型,决定图标和无障碍播报内容 */
|
|
13
|
+
type?: 'success' | 'error' | 'warning' | 'info';
|
|
14
|
+
/** 自动关闭的时间(毫秒)。设置为 false 则不自动关闭。默认为 5000ms */
|
|
15
|
+
autoClose?: boolean | number;
|
|
16
|
+
/** 通知关闭时的回调函数 */
|
|
17
|
+
onClose?: (props: NotificationData) => void;
|
|
18
|
+
/** 通知打开时的回调函数 */
|
|
19
|
+
onOpen?: (props: NotificationData) => void;
|
|
20
|
+
/**
|
|
21
|
+
* 自定义渲染底部区域(如操作按钮)。
|
|
22
|
+
* @param getId - 获取当前通知 ID 的函数,可用于在点击按钮后手动关闭该通知
|
|
23
|
+
*/
|
|
24
|
+
renderBottom?: (getId: () => string) => React.ReactNode;
|
|
25
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cleanNotifications, cleanNotificationsQueue, hideNotification, updateNotification, updateNotificationsState } from '@mantine/notifications';
|
|
2
|
+
import { NotificationOption } from './notification.types';
|
|
3
|
+
/**
|
|
4
|
+
* 全局通知指令
|
|
5
|
+
* 用于在屏幕右上角显示较为详细的反馈信息、操作引导或系统通知。
|
|
6
|
+
*/
|
|
7
|
+
export declare const notifications: {
|
|
8
|
+
/**
|
|
9
|
+
* 显示一个默认(通常为 info 类型)的通知
|
|
10
|
+
* @param option - 通知配置项
|
|
11
|
+
* @returns 通知的唯一 ID
|
|
12
|
+
*/
|
|
13
|
+
show: (option: NotificationOption) => string;
|
|
14
|
+
/**
|
|
15
|
+
* 显示一个错误类型的通知
|
|
16
|
+
* @param option - 通知配置项
|
|
17
|
+
* @returns 通知的唯一 ID
|
|
18
|
+
*/
|
|
19
|
+
showError: (option: NotificationOption) => string;
|
|
20
|
+
/**
|
|
21
|
+
* 显示一个成功类型的通知
|
|
22
|
+
* @param option - 通知配置项
|
|
23
|
+
* @returns 通知的唯一 ID
|
|
24
|
+
*/
|
|
25
|
+
showSuccess: (option: NotificationOption) => string;
|
|
26
|
+
/**
|
|
27
|
+
* 显示一个警告类型的通知
|
|
28
|
+
* @param option - 通知配置项
|
|
29
|
+
* @returns 通知的唯一 ID
|
|
30
|
+
*/
|
|
31
|
+
showWarning: (option: NotificationOption) => string;
|
|
32
|
+
/** 根据 ID 隐藏指定的通知 */
|
|
33
|
+
hide: typeof hideNotification;
|
|
34
|
+
/** 更新已存在的通知内容 */
|
|
35
|
+
update: typeof updateNotification;
|
|
36
|
+
/** 清除所有当前显示的通知 */
|
|
37
|
+
clean: typeof cleanNotifications;
|
|
38
|
+
/** 清除通知队列 */
|
|
39
|
+
cleanQueue: typeof cleanNotificationsQueue;
|
|
40
|
+
/** 更新通知状态 */
|
|
41
|
+
updateState: typeof updateNotificationsState;
|
|
42
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { updateNotificationsState as i, cleanNotificationsQueue as o, cleanNotifications as r, updateNotification as a, hideNotification as n } from "@mantine/notifications";
|
|
3
|
+
import { showNotification as e } from "./notification.js";
|
|
4
|
+
const u = {
|
|
5
|
+
/**
|
|
6
|
+
* 显示一个默认(通常为 info 类型)的通知
|
|
7
|
+
* @param option - 通知配置项
|
|
8
|
+
* @returns 通知的唯一 ID
|
|
9
|
+
*/
|
|
10
|
+
show: (t) => e(t),
|
|
11
|
+
/**
|
|
12
|
+
* 显示一个错误类型的通知
|
|
13
|
+
* @param option - 通知配置项
|
|
14
|
+
* @returns 通知的唯一 ID
|
|
15
|
+
*/
|
|
16
|
+
showError: (t) => (t.type = "error", e(t)),
|
|
17
|
+
/**
|
|
18
|
+
* 显示一个成功类型的通知
|
|
19
|
+
* @param option - 通知配置项
|
|
20
|
+
* @returns 通知的唯一 ID
|
|
21
|
+
*/
|
|
22
|
+
showSuccess: (t) => (t.type = "success", e(t)),
|
|
23
|
+
/**
|
|
24
|
+
* 显示一个警告类型的通知
|
|
25
|
+
* @param option - 通知配置项
|
|
26
|
+
* @returns 通知的唯一 ID
|
|
27
|
+
*/
|
|
28
|
+
showWarning: (t) => (t.type = "warning", e(t)),
|
|
29
|
+
/** 根据 ID 隐藏指定的通知 */
|
|
30
|
+
hide: n,
|
|
31
|
+
/** 更新已存在的通知内容 */
|
|
32
|
+
update: a,
|
|
33
|
+
/** 清除所有当前显示的通知 */
|
|
34
|
+
clean: r,
|
|
35
|
+
/** 清除通知队列 */
|
|
36
|
+
cleanQueue: o,
|
|
37
|
+
/** 更新通知状态 */
|
|
38
|
+
updateState: i
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
u as notifications
|
|
42
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NumberInputProps } from './number-input.types';
|
|
2
|
+
/**
|
|
3
|
+
* 数字输入框组件 (NumberInput)
|
|
4
|
+
*
|
|
5
|
+
* 基于 `react-number-format` 和 `@mantine/hooks` 封装,提供带加减按钮的数字输入能力,
|
|
6
|
+
* 支持严格/失焦/自动等多种极值约束 (clamp) 行为,并统一项目表单 UI 规范。
|
|
7
|
+
*/
|
|
8
|
+
export declare function NumberInput(props: NumberInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l, Fragment as F, jsxs as T } from "react/jsx-runtime";
|
|
3
|
+
import { Space as A } from "@mantine/core";
|
|
4
|
+
import { useId as O, useMergedRef as J, useUncontrolled as K } from "@mantine/hooks";
|
|
5
|
+
import { clsx as Q } from "clsx";
|
|
6
|
+
import { useRef as X, useState as W } from "react";
|
|
7
|
+
import { NumericFormat as Y } from "../../node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-number-format/dist/react-number-format.es.js";
|
|
8
|
+
import { useFormWrapperProps as Z } from "../../common/use-form-wrapper-props.js";
|
|
9
|
+
import { NumberInputLeft as $ } from "../_inner/number/number-input-left.js";
|
|
10
|
+
import { NumberInputRight as ee } from "../_inner/number/number-input-right.js";
|
|
11
|
+
import { BaseInput as te } from "../base-input/base-input.js";
|
|
12
|
+
import { FormItemWrapper as re } from "../form-wrapper/form-item-wrapper.js";
|
|
13
|
+
import ne from "./number-input.module.css.js";
|
|
14
|
+
const L = (t, n, o) => {
|
|
15
|
+
if (t === void 0)
|
|
16
|
+
return !0;
|
|
17
|
+
const f = n === void 0 || t >= n, u = o === void 0 || t <= o;
|
|
18
|
+
return f && u;
|
|
19
|
+
}, v = (t, n, o) => n !== void 0 && t < n ? n : o !== void 0 && t > o ? o : t;
|
|
20
|
+
function be(t) {
|
|
21
|
+
const n = O(t.id), { wrapProps: o, rest: f, outerDescribedBy: u } = Z(t, n), {
|
|
22
|
+
value: p,
|
|
23
|
+
defaultValue: y,
|
|
24
|
+
onChange: _,
|
|
25
|
+
onBlur: R,
|
|
26
|
+
onInput: D,
|
|
27
|
+
onFocus: C,
|
|
28
|
+
clampBehavior: g = ["auto", "blur"],
|
|
29
|
+
buttonPosition: B = "both-sides",
|
|
30
|
+
formatOnBlurOnly: h = !0,
|
|
31
|
+
fixedDecimalScale: N = !0,
|
|
32
|
+
ref: S,
|
|
33
|
+
...E
|
|
34
|
+
} = f, { min: i, max: s, decimalScale: M } = E, P = X(null), j = J(P, S), V = Array.isArray(g) ? g : [g], [I, c] = K({
|
|
35
|
+
value: p,
|
|
36
|
+
defaultValue: y?.toString(),
|
|
37
|
+
finalValue: "",
|
|
38
|
+
onChange: _
|
|
39
|
+
}), [w, x] = W(null), d = h && w !== null, U = (e) => {
|
|
40
|
+
h && w === null && x(e.currentTarget.value), C?.(e);
|
|
41
|
+
}, k = (e) => V.includes("strict") ? L(e.floatValue, i, s) : !0, q = (e, r) => {
|
|
42
|
+
r.source === "event" && (d && x(e.formattedValue), c(e.floatValue ?? ""));
|
|
43
|
+
}, z = (e) => {
|
|
44
|
+
if (h && w !== null) {
|
|
45
|
+
const a = e.currentTarget.value, m = parseFloat(a);
|
|
46
|
+
if (isNaN(m))
|
|
47
|
+
c("");
|
|
48
|
+
else {
|
|
49
|
+
let b = V.length > 0 ? v(m, i, s) : m;
|
|
50
|
+
M !== void 0 && (b = Number(b.toFixed(M))), c(b);
|
|
51
|
+
}
|
|
52
|
+
x(null), R?.(e);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let r = I;
|
|
56
|
+
if (V.includes("blur")) {
|
|
57
|
+
const a = Number(I);
|
|
58
|
+
r = isNaN(a) ? "" : v(a, i, s), c(r), e.target.value = r.toString();
|
|
59
|
+
}
|
|
60
|
+
R?.(e);
|
|
61
|
+
}, G = (e) => {
|
|
62
|
+
const r = e.currentTarget.value;
|
|
63
|
+
if (!r) {
|
|
64
|
+
c("");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!d && V.includes("auto")) {
|
|
68
|
+
const a = parseFloat(r);
|
|
69
|
+
if (isNaN(a))
|
|
70
|
+
return;
|
|
71
|
+
const m = I.toString(), b = !m, H = r.length < m.length && i !== void 0 && a < i;
|
|
72
|
+
if (b || H)
|
|
73
|
+
return;
|
|
74
|
+
L(a, i, s) ? r.endsWith("-") && (e.currentTarget.value = v(-a, i, s).toString()) : e.currentTarget.value = v(a, i, s).toString();
|
|
75
|
+
}
|
|
76
|
+
D?.(e);
|
|
77
|
+
};
|
|
78
|
+
return /* @__PURE__ */ l(re, { ...o, id: n, children: /* @__PURE__ */ l(
|
|
79
|
+
oe,
|
|
80
|
+
{
|
|
81
|
+
...E,
|
|
82
|
+
fixedDecimalScale: d ? !1 : N,
|
|
83
|
+
...d ? { decimalScale: void 0 } : {},
|
|
84
|
+
id: n,
|
|
85
|
+
"aria-describedby": u,
|
|
86
|
+
buttonPosition: B,
|
|
87
|
+
onValueSet: (e) => {
|
|
88
|
+
const r = v(e, i, s);
|
|
89
|
+
c(r), d && x(r.toString()), P.current?.focus();
|
|
90
|
+
},
|
|
91
|
+
renderRoot: (e) => /* @__PURE__ */ l(
|
|
92
|
+
Y,
|
|
93
|
+
{
|
|
94
|
+
getInputRef: j,
|
|
95
|
+
onValueChange: q,
|
|
96
|
+
onBlur: z,
|
|
97
|
+
onInput: G,
|
|
98
|
+
onFocus: U,
|
|
99
|
+
allowNegative: i === void 0 || i < 0,
|
|
100
|
+
isAllowed: k,
|
|
101
|
+
allowedDecimalSeparators: [".", "。", "."],
|
|
102
|
+
...e
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
value: d ? w : I?.toString()
|
|
106
|
+
}
|
|
107
|
+
) });
|
|
108
|
+
}
|
|
109
|
+
const oe = (t) => {
|
|
110
|
+
const [n, o] = W(!1), f = O(t.id), {
|
|
111
|
+
onValueSet: u,
|
|
112
|
+
hideControls: p,
|
|
113
|
+
buttonPosition: y,
|
|
114
|
+
min: _,
|
|
115
|
+
max: R,
|
|
116
|
+
clampBehavior: D,
|
|
117
|
+
step: C,
|
|
118
|
+
disableManualInput: g,
|
|
119
|
+
renderRightSection: B,
|
|
120
|
+
renderLeftSection: h,
|
|
121
|
+
...N
|
|
122
|
+
} = t, S = { ...t.classNames };
|
|
123
|
+
return S.wrapper = Q(
|
|
124
|
+
S.wrapper,
|
|
125
|
+
!p && ne.wrapperWithControls
|
|
126
|
+
), /* @__PURE__ */ l(
|
|
127
|
+
te,
|
|
128
|
+
{
|
|
129
|
+
borderRadius: "sm",
|
|
130
|
+
...N,
|
|
131
|
+
readOnly: N.readOnly || g,
|
|
132
|
+
imeSafe: !1,
|
|
133
|
+
classNames: S,
|
|
134
|
+
id: f,
|
|
135
|
+
onMouseEnter: () => {
|
|
136
|
+
o(!0);
|
|
137
|
+
},
|
|
138
|
+
onMouseLeave: () => {
|
|
139
|
+
o(!1);
|
|
140
|
+
},
|
|
141
|
+
renderLeftSection: /* @__PURE__ */ l(F, { children: h || !p && /* @__PURE__ */ T(F, { children: [
|
|
142
|
+
/* @__PURE__ */ l($, { ...t, onValueSet: u }),
|
|
143
|
+
/* @__PURE__ */ l(A, { w: 8 })
|
|
144
|
+
] }) }),
|
|
145
|
+
renderRightSection: /* @__PURE__ */ l(F, { children: B || !p && /* @__PURE__ */ T(F, { children: [
|
|
146
|
+
/* @__PURE__ */ l(A, { w: 8 }),
|
|
147
|
+
/* @__PURE__ */ l(
|
|
148
|
+
ee,
|
|
149
|
+
{
|
|
150
|
+
...t,
|
|
151
|
+
onValueSet: u,
|
|
152
|
+
mouseEnter: n
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] }) })
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
be as NumberInput
|
|
161
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { NumericFormatProps } from 'react-number-format';
|
|
2
|
+
import { InnerInputProps } from '../base-input';
|
|
3
|
+
/**
|
|
4
|
+
* 边界值约束行为类型
|
|
5
|
+
* - `strict`: 严格模式,不允许输入超出 min/max 范围的值。
|
|
6
|
+
* - `blur`: 失焦时触发,当输入框失去焦点时,自动将值修正(clamp)到 min/max 范围内。
|
|
7
|
+
* - `auto`: 自动模式,在输入时自动修正值到 min/max 范围内。
|
|
8
|
+
*/
|
|
9
|
+
export type ClampBehavior = 'strict' | 'blur' | 'auto';
|
|
10
|
+
/**
|
|
11
|
+
* 数字输入框特有的样式与控制属性
|
|
12
|
+
*/
|
|
13
|
+
export interface NumberInputStyleProps {
|
|
14
|
+
/**
|
|
15
|
+
* 控制加减按钮的显示位置
|
|
16
|
+
* - `both-sides`: 输入框两侧分别显示减号和加号按钮(默认)
|
|
17
|
+
* - `end-side`: 输入框右侧集中显示加减按钮(类似原生 type="number")
|
|
18
|
+
*/
|
|
19
|
+
buttonPosition?: 'both-sides' | 'end-side';
|
|
20
|
+
/** 允许输入的最小值 */
|
|
21
|
+
min?: number;
|
|
22
|
+
/** 允许输入的最大值 */
|
|
23
|
+
max?: number;
|
|
24
|
+
/**
|
|
25
|
+
* 边界值约束行为,可以是单个行为或组合数组。
|
|
26
|
+
* 默认为 `['auto', 'blur']`
|
|
27
|
+
*/
|
|
28
|
+
clampBehavior?: ClampBehavior | ClampBehavior[];
|
|
29
|
+
/** 当前数值(受控模式) */
|
|
30
|
+
value?: number | string;
|
|
31
|
+
/** 值变化时的回调函数 */
|
|
32
|
+
onChange?: (value: number | string) => void;
|
|
33
|
+
/** 点击加减按钮时,每次增加或减少的步长。默认为 1 */
|
|
34
|
+
step?: number;
|
|
35
|
+
/**
|
|
36
|
+
* 仅禁止键盘手动输入,左右加减按钮仍可点击改值。
|
|
37
|
+
*
|
|
38
|
+
* 用于「只能按固定 step 调整、不允许手输」的场景(如课堂表现成绩按计分单位加减)。
|
|
39
|
+
* 与 `readOnly` / `disabled` 的区别:那两者会连加减按钮一起锁死,表达的是「整体不可编辑」。
|
|
40
|
+
*/
|
|
41
|
+
disableManualInput?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* 仅在失焦时格式化。默认开启(产品默认行为)。
|
|
44
|
+
*
|
|
45
|
+
* 开启后,输入过程中不应用 decimalScale / fixedDecimalScale 补位与 clamp 修正,
|
|
46
|
+
* 所见即所输(可自由输入 `1.`、删除补位的 `0` 等);失焦时统一做
|
|
47
|
+
* clamp(遵循 clampBehavior,配置为空数组则不钳制)并按 decimalScale 四舍五入后提交。
|
|
48
|
+
* 传 `false` 恢复 react-number-format 的边输入边格式化行为。
|
|
49
|
+
*/
|
|
50
|
+
formatOnBlurOnly?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 小数位不足时是否用 0 补齐(需配合 decimalScale 使用)。
|
|
53
|
+
* 封装层默认开启(react-number-format 原生默认为 false):
|
|
54
|
+
* decimalScale=1 时整数 5 显示为 `5.0`。传 `false` 关闭补位。
|
|
55
|
+
*/
|
|
56
|
+
fixedDecimalScale?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 数字输入框组件的完整属性接口
|
|
60
|
+
* 结合了项目内部的 InputProps、react-number-format 的属性以及特有控制属性。
|
|
61
|
+
*/
|
|
62
|
+
export type NumberInputProps = Omit<InnerInputProps, 'value' | 'onChange'> & Omit<NumericFormatProps, keyof InnerInputProps | 'onValueChange' | 'customInput'> & NumberInputStyleProps & {
|
|
63
|
+
/** 是否隐藏加减控制按钮。设为 true 时,仅显示为一个纯净的数字输入框 */
|
|
64
|
+
hideControls?: boolean;
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Paper } from './paper';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LayoutElement } from '../box/box.types';
|
|
2
|
+
import type { PaperProps } from '../flex/layout.types';
|
|
3
|
+
/**
|
|
4
|
+
* 视觉表面容器(卡片/面板)。默认 `--t-fill-8` 主题化背景,
|
|
5
|
+
* 可配置阴影和圆角。不参与布局——内部排版请嵌套 Flex / Group / Stack。
|
|
6
|
+
*/
|
|
7
|
+
export declare function Paper<T extends LayoutElement = 'div'>(props: PaperProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { clsx as i } from "clsx";
|
|
4
|
+
import { Box as n } from "../box/box.js";
|
|
5
|
+
import c from "./paper.module.css.js";
|
|
6
|
+
function u(t) {
|
|
7
|
+
const { shadow: o, radius: r = "lg", className: s, ...a } = t, e = {
|
|
8
|
+
...o && o !== "none" && { "data-shadow": o },
|
|
9
|
+
"data-radius": r
|
|
10
|
+
};
|
|
11
|
+
return /* @__PURE__ */ m(n, { className: i(c.root, s), ...e, ...a });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
u as Paper
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InnerInputProps } from '../base-input';
|
|
2
|
+
/**
|
|
3
|
+
* 密码输入框组件的属性接口。
|
|
4
|
+
* 继承自内部基础输入框属性 `InnerInputProps`。
|
|
5
|
+
*/
|
|
6
|
+
export type PasswordInputProps = InnerInputProps;
|
|
7
|
+
/**
|
|
8
|
+
* 密码输入框组件 (PasswordInput)
|
|
9
|
+
*
|
|
10
|
+
* 该组件封装了底层的 `BaseInput`,并内置了密码可见性的切换功能(显示/隐藏密码)。
|
|
11
|
+
* 同时集成了表单包装器 (`FormItemWrapper`),支持直接传入 label、description、error 等表单常用属性。
|
|
12
|
+
*
|
|
13
|
+
* @param props 密码输入框的属性配置
|
|
14
|
+
*/
|
|
15
|
+
export declare const PasswordInput: (props: PasswordInputProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useId as d } from "@mantine/hooks";
|
|
4
|
+
import { useState as n } from "react";
|
|
5
|
+
import { useFormWrapperProps as f } from "../../common/use-form-wrapper-props.js";
|
|
6
|
+
import "../../provider/ui-context.js";
|
|
7
|
+
import { useLocale as l } from "../../provider/hooks.js";
|
|
8
|
+
import { BaseInput as w } from "../base-input/base-input.js";
|
|
9
|
+
import { getFormProps as u } from "../base-input/util.js";
|
|
10
|
+
import { FormItemWrapper as I } from "../form-wrapper/form-item-wrapper.js";
|
|
11
|
+
const L = (r) => {
|
|
12
|
+
const s = l(), [o, a] = n("password"), e = d(r.id), { wrapProps: i, rest: m, outerDescribedBy: p } = f(r, e), c = () => {
|
|
13
|
+
a(o === "password" ? "text" : "password");
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ t(I, { ...i, id: e, children: /* @__PURE__ */ t(
|
|
16
|
+
w,
|
|
17
|
+
{
|
|
18
|
+
...m,
|
|
19
|
+
...u(r, r.onClear),
|
|
20
|
+
imeSafe: !1,
|
|
21
|
+
type: o,
|
|
22
|
+
rightIconName: o === "password" ? "eye-close" : "eye",
|
|
23
|
+
rightIconAriaLabel: o === "password" ? s.showPassword : s.hidePassword,
|
|
24
|
+
onRightIconClick: c,
|
|
25
|
+
id: e,
|
|
26
|
+
"aria-describedby": p
|
|
27
|
+
}
|
|
28
|
+
) });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
L as PasswordInput
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopoverSide, PopoverTrigger } from './popover.types';
|
|
3
|
+
export declare function useAnimatedMount(opened: boolean, keepMounted?: boolean): {
|
|
4
|
+
mounted: boolean;
|
|
5
|
+
animState: 'open' | 'closing';
|
|
6
|
+
handleTransitionEnd: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function usePopoverFocus(trigger: PopoverTrigger, opened: boolean, animState: 'open' | 'closing', mounted: boolean, floatingRef: React.RefObject<HTMLDivElement | null>, getFloatingScopeElements: () => HTMLElement[], initialFocusRef?: React.RefObject<HTMLElement | null>, preventAutoFocus?: boolean): void;
|
|
9
|
+
export declare function getFocusableElements(containers: Array<HTMLElement | null>): HTMLElement[];
|
|
10
|
+
export declare function useEscapeClose(closeOnEscape: boolean, opened: boolean, close: () => void, referenceRef: React.RefObject<HTMLElement | null>, id: string, depth: number, restoreFocus?: () => void): void;
|
|
11
|
+
export declare function useArrowStyle(withArrow: boolean, arrowData: {
|
|
12
|
+
x?: number;
|
|
13
|
+
y?: number;
|
|
14
|
+
} | undefined, resolvedSide: PopoverSide, arrowSize: number): React.CSSProperties;
|
|
15
|
+
export declare function useTriggerProps(disabled: boolean, trigger: PopoverTrigger, mergedReferenceRef: React.Ref<HTMLElement>, id: string, toggle: () => void, opened: boolean, setOpen: (next: boolean) => void, hoverTimerRef: React.RefObject<number | undefined>, userOnClick?: React.MouseEventHandler<HTMLElement>, userOnKeyDown?: React.KeyboardEventHandler<HTMLElement>): React.HTMLAttributes<HTMLElement> & {
|
|
16
|
+
ref?: React.Ref<HTMLElement>;
|
|
17
|
+
};
|