@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
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @wisdomgarden/torque
|
|
2
|
+
|
|
3
|
+
基于 Web 2.0 设计规范的 Wisdom Garden UI 组件库,提供统一的组件 API 与 `--t-*` 设计 token。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @wisdomgarden/torque @wisdomgarden/torque-styles @wisdomgarden/torque-icons
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
三个包是一组:
|
|
12
|
+
|
|
13
|
+
| 包 | 作用 | 为什么是 peerDependency |
|
|
14
|
+
| ------------------------- | -------------------------- | ----------------------------------------------- |
|
|
15
|
+
| `@wisdomgarden/torque-styles` | `--t-*` 设计 token(纯 CSS) | 组件样式全部建立在这些变量上,不引入等于没有样式 |
|
|
16
|
+
| `@wisdomgarden/torque-icons` | 图标集 + `<Icon>` | `setIconLoader` 是模块级状态,必须单实例 |
|
|
17
|
+
|
|
18
|
+
react / react-dom / `@mantine/*` 同样是 peerDependency —— 它们不打进本包产物,版本跟随宿主,保证单实例。
|
|
19
|
+
|
|
20
|
+
## 接入
|
|
21
|
+
|
|
22
|
+
样式入口按 `@layer reset, mantine, lib` 分层,顺序不能乱:
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@layer reset, mantine, lib;
|
|
26
|
+
|
|
27
|
+
@import '@mantine/core/styles.css' layer(mantine);
|
|
28
|
+
@import '@wisdomgarden/torque/dist/index.css';
|
|
29
|
+
@import '@wisdomgarden/torque-styles';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`@wisdomgarden/torque-styles` 能写成裸路径,是因为它声明了 `style` 字段 —— postcss-import
|
|
33
|
+
不解析 `exports` 表,认的是这个字段。
|
|
34
|
+
|
|
35
|
+
组件侧挂 Provider:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { UiProvider } from '@wisdomgarden/torque';
|
|
39
|
+
import { zhHans } from '@wisdomgarden/torque/locale';
|
|
40
|
+
|
|
41
|
+
<UiProvider locale={zhHans} deviceType={deviceType}>
|
|
42
|
+
{children}
|
|
43
|
+
</UiProvider>;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `locale` —— 组件内部的文案(关闭、清除、暂无数据、分页……),包内附 5 个语言预设,本包零 i18n 依赖
|
|
47
|
+
- `deviceType` —— 决定下拉、菜单等组件走桌面浮层还是移动端抽屉
|
|
48
|
+
|
|
49
|
+
图标开箱即用,不需要注册任何东西,详见 `@wisdomgarden/torque-icons`。
|
|
50
|
+
|
|
51
|
+
## 用法
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { Button, Select, Table } from '@wisdomgarden/torque';
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
也可以按组件深路径引,少走一层桶:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { Button } from '@wisdomgarden/torque/components/button';
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 样式约定
|
|
64
|
+
|
|
65
|
+
组件样式一律是组件级 CSS Module,包在 `@layer lib` 内,颜色/间距/圆角全部走 `--t-*`。
|
|
66
|
+
**包内不使用 Tailwind 工具类** —— 那需要宿主的构建管线扫描生成,发布成 npm 包后无法依赖。
|
|
67
|
+
|
|
68
|
+
根节点带稳定类名(如 `t-button`)供外部覆盖;因为组件样式在 `@layer lib` 里,宿主
|
|
69
|
+
未分层的样式天然优先级更高,直接写 className 即可覆盖。
|
|
70
|
+
|
|
71
|
+
## 构建
|
|
72
|
+
|
|
73
|
+
Vite lib mode,`preserveModules` 保持一模块一文件。entry 由 `package.json` 的
|
|
74
|
+
`exports` 表驱动 —— 那是"哪些路径必须存在"的契约,由它生成 entry 可以保证两者不会
|
|
75
|
+
不一致。构建末尾 `verify-exports.mjs` 会把每个子路径解析一遍并落盘检查。
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { UseFormReturnType } from '@mantine/form';
|
|
2
|
+
import { Ref } from 'react';
|
|
3
|
+
/** 组件基础尺寸定义,包含极小(xs)到极大(xl)的所有选项 */
|
|
4
|
+
export type ComponentSizeBase = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
/** 精简版组件尺寸定义,去除了极小(xs)和极大(xl),常用于输入框、选择器等 */
|
|
6
|
+
export type SimpleComponentSizeBase = Exclude<ComponentSizeBase, 'xs' | 'xl'>;
|
|
7
|
+
/** 按钮组件尺寸 */
|
|
8
|
+
export type ButtonSize = ComponentSizeBase;
|
|
9
|
+
/** 输入框组件尺寸 */
|
|
10
|
+
export type InputSize = SimpleComponentSizeBase;
|
|
11
|
+
/** 下拉选择器组件尺寸 */
|
|
12
|
+
export type SelectSize = SimpleComponentSizeBase;
|
|
13
|
+
/** 标签页组件尺寸 */
|
|
14
|
+
export type TabSize = SimpleComponentSizeBase;
|
|
15
|
+
/** 图标按钮(IconButton)的主题颜色 */
|
|
16
|
+
export type IconButtonColor = 'brand' | 'red' | 'black' | 'white';
|
|
17
|
+
/**
|
|
18
|
+
* 根节点类名属性
|
|
19
|
+
* 用于外部传入自定义类名
|
|
20
|
+
*/
|
|
21
|
+
export interface RootClassNameProps {
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface InputWrapProps {
|
|
25
|
+
/** 用于提示或警告的文本,支持 ReactNode 以嵌入链接、图标等 */
|
|
26
|
+
description?: string | React.ReactNode;
|
|
27
|
+
/** 发生错误时显示的提示信息,或布尔值标识错误状态 */
|
|
28
|
+
error?: boolean | string;
|
|
29
|
+
/** 表单字段的名称/标签,支持 ReactNode 以嵌入图标等 */
|
|
30
|
+
label?: string | React.ReactNode;
|
|
31
|
+
/** true: 必填, false: 非必填 */
|
|
32
|
+
required?: boolean;
|
|
33
|
+
/** true: 显示必填星号 (*), false: 不显示星号 */
|
|
34
|
+
withAsterisk?: boolean;
|
|
35
|
+
/** 布局方式,vertical: 标签在上方, horizontal: 标签在左侧。默认值为 vertical */
|
|
36
|
+
layout?: 'vertical' | 'horizontal';
|
|
37
|
+
/** 当布局为 horizontal 时,此属性代表左侧标签区域的宽度,默认值为 70 */
|
|
38
|
+
labelWidth?: string | number;
|
|
39
|
+
/** true: 在没有星号时仍保留星号占用的宽度空间, false: 不保留。默认值为 false */
|
|
40
|
+
keepAsteriskWidth?: boolean;
|
|
41
|
+
/** 当 borderRadius 为 'full' 时,标签会带有 4px 的左边距 */
|
|
42
|
+
borderRadius?: 'full' | 'sm';
|
|
43
|
+
/** 标签的自定义 className */
|
|
44
|
+
labelClassName?: string;
|
|
45
|
+
/** 错误提示节点的自定义 className */
|
|
46
|
+
errorClassName?: string;
|
|
47
|
+
/** 水平布局下标签容器的自定义 style,与默认 style 合并以覆盖 width / maxWidth / paddingTop 等 */
|
|
48
|
+
labelWrapperStyle?: React.CSSProperties;
|
|
49
|
+
}
|
|
50
|
+
export interface FormProps {
|
|
51
|
+
/** 传入form表单对象,内部会自动处理表单属性 */
|
|
52
|
+
form?: UseFormReturnType<any, (values: any) => any>;
|
|
53
|
+
/** 字段的属性名 */
|
|
54
|
+
fieldName?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface RefProps<T extends HTMLElement> {
|
|
57
|
+
/** React ref 引用,用于访问底层 DOM 元素或组件实例 */
|
|
58
|
+
ref?: Ref<T | null>;
|
|
59
|
+
}
|
|
60
|
+
export type CommonColor = 'red' | 'orange' | 'yellow' | 'green' | 'brand' | 'blue' | 'air-blue' | 'violet' | 'grape' | 'magenta' | 'gray';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComputedColorScheme as c } from "@mantine/core";
|
|
3
|
+
import { useState as n, useEffect as l } from "react";
|
|
4
|
+
const S = (e) => {
|
|
5
|
+
const [r, o] = n(""), u = c();
|
|
6
|
+
return l(() => {
|
|
7
|
+
try {
|
|
8
|
+
if (e.startsWith("var(")) {
|
|
9
|
+
const t = e.match(/var\((--[^)]+)\)/)?.[1];
|
|
10
|
+
if (t) {
|
|
11
|
+
const m = getComputedStyle(document.documentElement).getPropertyValue(t).trim() || e;
|
|
12
|
+
o(m);
|
|
13
|
+
}
|
|
14
|
+
} else
|
|
15
|
+
o(e);
|
|
16
|
+
} catch (t) {
|
|
17
|
+
console.error("Error getting CSS variable:", t), o(e);
|
|
18
|
+
}
|
|
19
|
+
}, [e, u]), r;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
S as useCssVariableValue
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 批量获取多个 CSS 变量的实际值。
|
|
3
|
+
*
|
|
4
|
+
* 相比多次调用 `useCssVariableValue`,此 hook 在一次 effect 内只调用一次
|
|
5
|
+
* `getComputedStyle`,并合并为单个 state,适合图表等一次需要读取大量颜色变量的场景。
|
|
6
|
+
*
|
|
7
|
+
* @param cssVariables - 键为业务别名、值为变量名或 `var()` 字符串的对象
|
|
8
|
+
* @returns 与入参同名的解析结果对象,解析失败时回退为原始值
|
|
9
|
+
*/
|
|
10
|
+
export declare const useCssVariableValues: <K extends string>(cssVariables: Record<K, string>) => Record<K, string>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComputedColorScheme as l } from "@mantine/core";
|
|
3
|
+
import { useState as y, useEffect as S } from "react";
|
|
4
|
+
const v = (o) => {
|
|
5
|
+
const m = l(), r = Object.keys(o), u = r.map((e) => `${e}:${o[e]}`).join("|"), [s, p] = y(
|
|
6
|
+
() => Object.fromEntries(r.map((e) => [e, ""]))
|
|
7
|
+
);
|
|
8
|
+
return S(() => {
|
|
9
|
+
try {
|
|
10
|
+
const e = getComputedStyle(document.documentElement), f = (t) => {
|
|
11
|
+
if (!t.startsWith("var(")) return t;
|
|
12
|
+
const c = t.match(/var\((--[^)]+)\)/)?.[1];
|
|
13
|
+
return c && e.getPropertyValue(c).trim() || t;
|
|
14
|
+
}, n = {};
|
|
15
|
+
for (const t of Object.keys(o))
|
|
16
|
+
n[t] = f(o[t]);
|
|
17
|
+
p(n);
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.error("Error getting CSS variables:", e);
|
|
20
|
+
}
|
|
21
|
+
}, [u, m]), s;
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
v as useCssVariableValues
|
|
25
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { GetInputPropsReturnType } from '@mantine/form';
|
|
2
|
+
import { FormProps, InputWrapProps } from './components.types';
|
|
3
|
+
/**
|
|
4
|
+
* 用于从表单组件属性中获取 InputWrap 属性的工具函数。
|
|
5
|
+
*
|
|
6
|
+
* @param props - 表单组件属性
|
|
7
|
+
* @param id - 外部已生成的稳定 id(来自 useId),用于派生 errorId / descriptionId
|
|
8
|
+
* 以及合并 aria-describedby。不传时仅做 props 拆分,不生成 a11y 关联。
|
|
9
|
+
*/
|
|
10
|
+
export declare const useFormWrapperProps: <T extends FormProps & InputWrapProps & {
|
|
11
|
+
className?: string;
|
|
12
|
+
}>(props: T, id?: string) => {
|
|
13
|
+
wrapProps: {
|
|
14
|
+
description: import("react").ReactNode;
|
|
15
|
+
label: import("react").ReactNode;
|
|
16
|
+
required: boolean | undefined;
|
|
17
|
+
withAsterisk: boolean | undefined;
|
|
18
|
+
labelWidth: string | number | undefined;
|
|
19
|
+
layout: "vertical" | "horizontal" | undefined;
|
|
20
|
+
keepAsteriskWidth: boolean | undefined;
|
|
21
|
+
borderRadius: "sm" | "full" | undefined;
|
|
22
|
+
labelWrapperStyle: import("react").CSSProperties | undefined;
|
|
23
|
+
className: string | undefined;
|
|
24
|
+
error: any;
|
|
25
|
+
errorId: string | undefined;
|
|
26
|
+
descriptionId: string | undefined;
|
|
27
|
+
labelId: string | undefined;
|
|
28
|
+
labelClassName: string | undefined;
|
|
29
|
+
errorClassName: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
rest: Omit<T, "error" | "form" | "label" | "className" | "description" | "required" | "withAsterisk" | "labelWidth" | "layout" | "keepAsteriskWidth" | "borderRadius" | "labelWrapperStyle" | "fieldName" | "labelClassName" | "errorClassName"> & {
|
|
32
|
+
borderRadius: "sm" | "full" | undefined;
|
|
33
|
+
error: any;
|
|
34
|
+
onChange?: any;
|
|
35
|
+
value?: any;
|
|
36
|
+
defaultValue?: any;
|
|
37
|
+
checked?: any;
|
|
38
|
+
defaultChecked?: any;
|
|
39
|
+
onFocus?: any;
|
|
40
|
+
onBlur?: any;
|
|
41
|
+
required: boolean | undefined;
|
|
42
|
+
};
|
|
43
|
+
formProps: GetInputPropsReturnType | undefined;
|
|
44
|
+
outerDescribedBy: string | undefined;
|
|
45
|
+
errorId: string | undefined;
|
|
46
|
+
descriptionId: string | undefined;
|
|
47
|
+
labelId: string | undefined;
|
|
48
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const $ = (l, r) => {
|
|
3
|
+
const {
|
|
4
|
+
description: a,
|
|
5
|
+
error: u,
|
|
6
|
+
label: i,
|
|
7
|
+
required: n,
|
|
8
|
+
withAsterisk: m,
|
|
9
|
+
labelWidth: f,
|
|
10
|
+
layout: y,
|
|
11
|
+
keepAsteriskWidth: v,
|
|
12
|
+
borderRadius: c,
|
|
13
|
+
labelWrapperStyle: P,
|
|
14
|
+
className: I,
|
|
15
|
+
form: d,
|
|
16
|
+
fieldName: p,
|
|
17
|
+
labelClassName: N,
|
|
18
|
+
errorClassName: W,
|
|
19
|
+
...h
|
|
20
|
+
} = l;
|
|
21
|
+
let e;
|
|
22
|
+
d && p && (e = { ...d.getInputProps(p) });
|
|
23
|
+
const o = e?.error ?? u, k = l["aria-describedby"], s = r && o && typeof o == "string" ? `${r}-error` : void 0, t = r && a ? `${r}-description` : void 0, b = r && i ? `${r}-label` : void 0, w = [k, s, t].filter(Boolean).join(" ") || void 0;
|
|
24
|
+
return {
|
|
25
|
+
wrapProps: {
|
|
26
|
+
description: a,
|
|
27
|
+
label: i,
|
|
28
|
+
required: n,
|
|
29
|
+
withAsterisk: m,
|
|
30
|
+
labelWidth: f,
|
|
31
|
+
layout: y,
|
|
32
|
+
keepAsteriskWidth: v,
|
|
33
|
+
borderRadius: c,
|
|
34
|
+
labelWrapperStyle: P,
|
|
35
|
+
className: I,
|
|
36
|
+
error: o,
|
|
37
|
+
errorId: s,
|
|
38
|
+
descriptionId: t,
|
|
39
|
+
labelId: b,
|
|
40
|
+
labelClassName: N,
|
|
41
|
+
errorClassName: W
|
|
42
|
+
},
|
|
43
|
+
rest: {
|
|
44
|
+
...h,
|
|
45
|
+
required: n,
|
|
46
|
+
...e,
|
|
47
|
+
borderRadius: c,
|
|
48
|
+
error: o
|
|
49
|
+
},
|
|
50
|
+
formProps: e,
|
|
51
|
+
outerDescribedBy: w,
|
|
52
|
+
errorId: s,
|
|
53
|
+
descriptionId: t,
|
|
54
|
+
labelId: b
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
$ as useFormWrapperProps
|
|
59
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChangeEvent, CompositionEvent } from 'react';
|
|
2
|
+
type InputLikeElement = HTMLInputElement | HTMLTextAreaElement;
|
|
3
|
+
type InputValue = string | number | readonly string[] | undefined;
|
|
4
|
+
export declare function useImeSafeInput(externalValue: InputValue, commit: (value: string) => void): {
|
|
5
|
+
value: InputValue;
|
|
6
|
+
onChange(event: ChangeEvent<InputLikeElement>): void;
|
|
7
|
+
onCompositionStart(): void;
|
|
8
|
+
onCompositionEnd(event: CompositionEvent<InputLikeElement>): void;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as s, useState as a } from "react";
|
|
3
|
+
function i(l, u) {
|
|
4
|
+
const n = s(!1), [r, t] = a(null);
|
|
5
|
+
return {
|
|
6
|
+
value: r ?? l,
|
|
7
|
+
onChange(o) {
|
|
8
|
+
const e = o.currentTarget.value;
|
|
9
|
+
n.current ? t(e) : (r !== null && t(null), u(e));
|
|
10
|
+
},
|
|
11
|
+
onCompositionStart() {
|
|
12
|
+
n.current = !0;
|
|
13
|
+
},
|
|
14
|
+
onCompositionEnd(o) {
|
|
15
|
+
n.current = !1;
|
|
16
|
+
const e = o.currentTarget.value;
|
|
17
|
+
t(null), u(e);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
i as useImeSafeInput
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../provider/ui-context.js";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { useLocale as r } from "../provider/hooks.js";
|
|
6
|
+
const s = () => {
|
|
7
|
+
const o = r();
|
|
8
|
+
return {
|
|
9
|
+
success: o.success,
|
|
10
|
+
info: o.tip,
|
|
11
|
+
warning: o.warning,
|
|
12
|
+
help: o.tip,
|
|
13
|
+
error: o.error
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
s as useNotificationA11y
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export type StickyBoxConfig = {
|
|
3
|
+
offsetTop?: number;
|
|
4
|
+
offsetBottom?: number;
|
|
5
|
+
bottom?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type UseStickyBoxOptions = StickyBoxConfig;
|
|
8
|
+
export declare const useStickyBox: ({ offsetTop, offsetBottom, bottom, }?: StickyBoxConfig) => import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
|
|
9
|
+
export type StickyBoxCompProps = StickyBoxConfig & Pick<ComponentProps<'div'>, 'children' | 'className' | 'style'>;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as V, useEffect as D } from "react";
|
|
3
|
+
const j = (t) => {
|
|
4
|
+
let e = t;
|
|
5
|
+
for (; e = e.parentElement; ) {
|
|
6
|
+
const s = getComputedStyle(e, null).getPropertyValue(
|
|
7
|
+
"overflow-y"
|
|
8
|
+
);
|
|
9
|
+
if (e === document.body) return window;
|
|
10
|
+
if (s === "auto" || s === "scroll" || s === "overlay")
|
|
11
|
+
return e;
|
|
12
|
+
}
|
|
13
|
+
return window;
|
|
14
|
+
}, M = (t) => t.firstChild ? t.firstChild.offsetParent === t : !0, z = (t, e) => {
|
|
15
|
+
let s = t, n = 0;
|
|
16
|
+
M(e) || (n += t.offsetTop - e.offsetTop, e = t.offsetParent, n += -t.offsetTop);
|
|
17
|
+
do
|
|
18
|
+
n += s.offsetTop, s = s.offsetParent;
|
|
19
|
+
while (s && s !== e);
|
|
20
|
+
return n;
|
|
21
|
+
}, I = (t) => {
|
|
22
|
+
let e = t.parentElement;
|
|
23
|
+
for (; e && getComputedStyle(e, null).getPropertyValue("display") === "contents"; )
|
|
24
|
+
e = e.parentElement;
|
|
25
|
+
return e || window;
|
|
26
|
+
};
|
|
27
|
+
let S = null;
|
|
28
|
+
typeof CSS < "u" && CSS.supports && (CSS.supports("position", "sticky") ? S = "sticky" : CSS.supports("position", "-webkit-sticky") && (S = "-webkit-sticky"));
|
|
29
|
+
let C = !1;
|
|
30
|
+
try {
|
|
31
|
+
const t = Object.defineProperty({}, "passive", {
|
|
32
|
+
get() {
|
|
33
|
+
C = { passive: !0 };
|
|
34
|
+
}
|
|
35
|
+
}), e = () => {
|
|
36
|
+
};
|
|
37
|
+
window.addEventListener("testPassive", e, t), window.removeEventListener("testPassive", e, t);
|
|
38
|
+
} catch {
|
|
39
|
+
}
|
|
40
|
+
const L = (t) => {
|
|
41
|
+
const { el: e, onChange: s, unsubs: n, measure: i } = t;
|
|
42
|
+
if (e === window) {
|
|
43
|
+
const l = () => ({
|
|
44
|
+
top: 0,
|
|
45
|
+
left: 0,
|
|
46
|
+
height: window.innerHeight,
|
|
47
|
+
width: window.innerWidth
|
|
48
|
+
}), r = i(l()), u = () => {
|
|
49
|
+
Object.assign(r, i(l())), s();
|
|
50
|
+
};
|
|
51
|
+
return window.addEventListener("resize", u, C), n.push(() => window.removeEventListener("resize", u)), r;
|
|
52
|
+
} else {
|
|
53
|
+
const l = i(e.getBoundingClientRect()), r = () => {
|
|
54
|
+
Object.assign(
|
|
55
|
+
l,
|
|
56
|
+
i(e.getBoundingClientRect())
|
|
57
|
+
), s();
|
|
58
|
+
}, u = new ResizeObserver(r);
|
|
59
|
+
return u.observe(e), n.push(() => u.disconnect()), l;
|
|
60
|
+
}
|
|
61
|
+
}, N = (t) => {
|
|
62
|
+
const e = getComputedStyle(t, null), s = parseInt(
|
|
63
|
+
e.getPropertyValue("padding-top"),
|
|
64
|
+
10
|
|
65
|
+
), n = parseInt(
|
|
66
|
+
e.getPropertyValue("padding-bottom"),
|
|
67
|
+
10
|
|
68
|
+
);
|
|
69
|
+
return { top: s, bottom: n };
|
|
70
|
+
}, A = (t, e, s) => {
|
|
71
|
+
const { bottom: n, offsetBottom: i, offsetTop: l } = s, r = j(t);
|
|
72
|
+
let u = !1;
|
|
73
|
+
const E = () => {
|
|
74
|
+
u || requestAnimationFrame(() => {
|
|
75
|
+
const o = k();
|
|
76
|
+
if (o !== d)
|
|
77
|
+
m(o);
|
|
78
|
+
else if (o === 1 && !n) {
|
|
79
|
+
const { height: f } = w, { height: a } = P;
|
|
80
|
+
t.style.top = `${f - a - i}px`;
|
|
81
|
+
} else if (o === 2) {
|
|
82
|
+
const { height: f, offsetTop: a } = w, { height: p, naturalTop: c } = b, { height: y } = P, h = Math.max(
|
|
83
|
+
0,
|
|
84
|
+
a + g + f - (c + y + i)
|
|
85
|
+
);
|
|
86
|
+
if (n) {
|
|
87
|
+
const v = Math.max(
|
|
88
|
+
0,
|
|
89
|
+
p - y - h
|
|
90
|
+
);
|
|
91
|
+
t.style.bottom = `${v}px`;
|
|
92
|
+
} else
|
|
93
|
+
t.style.top = `${h}px`;
|
|
94
|
+
}
|
|
95
|
+
u = !1;
|
|
96
|
+
}), u = !0;
|
|
97
|
+
};
|
|
98
|
+
let g = r === window ? window.scrollY : r.scrollTop;
|
|
99
|
+
const $ = (o) => {
|
|
100
|
+
const { offsetTop: f, height: a } = w, { naturalTop: p } = b, { height: c } = P;
|
|
101
|
+
return o + f + a >= p + c + x + i;
|
|
102
|
+
}, k = () => {
|
|
103
|
+
const { height: o } = w, { height: f } = P;
|
|
104
|
+
return f + l + i <= o ? 3 : $(g) ? 1 : 2;
|
|
105
|
+
}, R = r !== window && M(r), w = L({
|
|
106
|
+
el: r,
|
|
107
|
+
onChange: E,
|
|
108
|
+
unsubs: e,
|
|
109
|
+
measure: ({ height: o, top: f }) => ({
|
|
110
|
+
height: o,
|
|
111
|
+
offsetTop: R ? f : 0
|
|
112
|
+
})
|
|
113
|
+
}), T = I(t), O = T === window ? { top: 0, bottom: 0 } : N(T), b = L({
|
|
114
|
+
el: T,
|
|
115
|
+
onChange: E,
|
|
116
|
+
unsubs: e,
|
|
117
|
+
measure: ({ height: o }) => ({
|
|
118
|
+
height: o - O.top - O.bottom,
|
|
119
|
+
naturalTop: T === window ? 0 : z(T, r) + O.top + w.offsetTop
|
|
120
|
+
})
|
|
121
|
+
}), P = L({
|
|
122
|
+
el: t,
|
|
123
|
+
onChange: E,
|
|
124
|
+
unsubs: e,
|
|
125
|
+
measure: ({ height: o }) => ({ height: o })
|
|
126
|
+
});
|
|
127
|
+
let x = 0, d = k();
|
|
128
|
+
const m = (o) => {
|
|
129
|
+
const f = d;
|
|
130
|
+
if (d = o, f === 2 && (x = -1), o === 3) {
|
|
131
|
+
t.style.position = S, n ? t.style.bottom = `${i}px` : t.style.top = `${l}px`;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const { height: a, offsetTop: p } = w, { height: c, naturalTop: y } = b, { height: h } = P;
|
|
135
|
+
if (o === 2)
|
|
136
|
+
if (t.style.position = "relative", x = f === 0 ? Math.max(
|
|
137
|
+
0,
|
|
138
|
+
p + g - y + l
|
|
139
|
+
) : Math.max(
|
|
140
|
+
0,
|
|
141
|
+
p + g + a - (y + h + i)
|
|
142
|
+
), n) {
|
|
143
|
+
const v = Math.max(
|
|
144
|
+
0,
|
|
145
|
+
c - h - x
|
|
146
|
+
);
|
|
147
|
+
t.style.bottom = `${v}px`;
|
|
148
|
+
} else
|
|
149
|
+
t.style.top = `${x}px`;
|
|
150
|
+
else
|
|
151
|
+
t.style.position = S, o === 1 ? n ? t.style.bottom = `${i}px` : t.style.top = `${a - h - i}px` : n ? t.style.bottom = `${a - h - i}px` : t.style.top = `${l}px`;
|
|
152
|
+
};
|
|
153
|
+
m(d);
|
|
154
|
+
const B = (o) => {
|
|
155
|
+
if (o === g) return;
|
|
156
|
+
const f = o - g;
|
|
157
|
+
if (g = o, d === 3) return;
|
|
158
|
+
const { offsetTop: a, height: p } = w, { naturalTop: c, height: y } = b, { height: h } = P;
|
|
159
|
+
if (f > 0)
|
|
160
|
+
if (d === 0) {
|
|
161
|
+
if (o + a + l > c) {
|
|
162
|
+
const v = Math.max(
|
|
163
|
+
0,
|
|
164
|
+
a + g - c + l
|
|
165
|
+
);
|
|
166
|
+
o + a + p <= c + h + v + i ? m(
|
|
167
|
+
2
|
|
168
|
+
/* relative */
|
|
169
|
+
) : m(
|
|
170
|
+
1
|
|
171
|
+
/* stickyBottom */
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
} else d === 2 && $(o) && m(
|
|
175
|
+
1
|
|
176
|
+
/* stickyBottom */
|
|
177
|
+
);
|
|
178
|
+
else if (d === 1) {
|
|
179
|
+
if (a + o + p < c + y + i) {
|
|
180
|
+
const v = Math.max(
|
|
181
|
+
0,
|
|
182
|
+
a + g + p - (c + h + i)
|
|
183
|
+
);
|
|
184
|
+
a + o + l >= c + v ? m(
|
|
185
|
+
2
|
|
186
|
+
/* relative */
|
|
187
|
+
) : m(
|
|
188
|
+
0
|
|
189
|
+
/* stickyTop */
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
} else d === 2 && a + o + l < c + x && m(
|
|
193
|
+
0
|
|
194
|
+
/* stickyTop */
|
|
195
|
+
);
|
|
196
|
+
}, H = r === window ? () => B(window.scrollY) : () => B(r.scrollTop);
|
|
197
|
+
r.addEventListener("scroll", H, C), r.addEventListener("mousewheel", H, C), e.push(
|
|
198
|
+
() => r.removeEventListener("scroll", H),
|
|
199
|
+
() => r.removeEventListener("mousewheel", H)
|
|
200
|
+
);
|
|
201
|
+
}, F = ({
|
|
202
|
+
offsetTop: t = 0,
|
|
203
|
+
offsetBottom: e = 0,
|
|
204
|
+
bottom: s = !1
|
|
205
|
+
} = {}) => {
|
|
206
|
+
const [n, i] = V(null);
|
|
207
|
+
return D(() => {
|
|
208
|
+
if (!n || !S) return;
|
|
209
|
+
const l = [];
|
|
210
|
+
return A(n, l, { offsetBottom: e, offsetTop: t, bottom: s }), () => {
|
|
211
|
+
l.forEach((r) => r());
|
|
212
|
+
};
|
|
213
|
+
}, [n, e, t, s]), i;
|
|
214
|
+
};
|
|
215
|
+
export {
|
|
216
|
+
F as useStickyBox
|
|
217
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const o = {
|
|
3
|
+
transition: {
|
|
4
|
+
in: { opacity: 1, transform: "scaleY(1)" },
|
|
5
|
+
out: { opacity: 0, transform: "scaleY(0)" },
|
|
6
|
+
common: { transformOrigin: "top" },
|
|
7
|
+
transitionProperty: "transform, opacity"
|
|
8
|
+
},
|
|
9
|
+
duration: 200,
|
|
10
|
+
timingFunction: "ease"
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
o as comboboxTransitionProps
|
|
14
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SelectOptions } from './select.types';
|
|
2
|
+
/** 低于该选项数的短列表一屏可览,搜索框反而是干扰。 */
|
|
3
|
+
export declare const SEARCHABLE_OPTION_THRESHOLD = 10;
|
|
4
|
+
/** 显式传入的 `searchable` 优先;未传时按选项数量自动判断。 */
|
|
5
|
+
export declare const resolveSearchable: (searchable: boolean | undefined, options: SelectOptions[] | undefined) => boolean;
|