musae 0.3.2 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/avatar/context.d.ts +1 -1
- package/dist/components/avatar/group.d.ts +1 -1
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/bench/bench.cjs +8 -10
- package/dist/components/bench/bench.mjs +8 -10
- package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/item.d.ts +1 -1
- package/dist/components/button/button.cjs +12 -11
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.mjs +7 -6
- package/dist/components/button/hooks.d.ts +2 -2
- package/dist/components/calendar/calendar.d.ts +1 -1
- package/dist/components/calendar/contribution.cjs +251 -0
- package/dist/components/calendar/contribution.d.ts +13 -0
- package/dist/components/calendar/contribution.mjs +249 -0
- package/dist/components/calendar/hooks.d.ts +1 -1
- package/dist/components/calendar/index.d.ts +2 -2
- package/dist/components/cascader/cascader.d.ts +1 -1
- package/dist/components/cascader/hooks.d.ts +1 -1
- package/dist/components/cascader/utils.d.ts +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/context.d.ts +1 -1
- package/dist/components/checkbox/group.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/styles.cjs +1 -1
- package/dist/components/checkbox/styles.d.ts +1 -1
- package/dist/components/checkbox/styles.mjs +1 -1
- package/dist/components/clock/clock.cjs +1 -2
- package/dist/components/clock/clock.d.ts +1 -1
- package/dist/components/clock/clock.mjs +1 -2
- package/dist/components/clock/column.cjs +9 -9
- package/dist/components/clock/column.d.ts +1 -1
- package/dist/components/clock/column.mjs +8 -8
- package/dist/components/collapse/collapse.d.ts +1 -1
- package/dist/components/collapse/context.d.ts +1 -1
- package/dist/components/collapse/hooks.d.ts +1 -1
- package/dist/components/collapse/item.d.ts +1 -1
- package/dist/components/config/context.d.ts +1 -1
- package/dist/components/config/hooks.d.ts +1 -1
- package/dist/components/config/provider.cjs +2 -2
- package/dist/components/config/provider.d.ts +1 -1
- package/dist/components/config/provider.mjs +2 -2
- package/dist/components/countdown/countdown.d.ts +2 -2
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/hooks.d.ts +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +1 -1
- package/dist/components/date-range-picker/hooks.d.ts +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -1
- package/dist/components/dialog/hooks.d.ts +1 -1
- package/dist/components/dialog/popup.d.ts +1 -1
- package/dist/components/divider/divider.d.ts +1 -1
- package/dist/components/divider/hooks.d.ts +1 -1
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/hooks.d.ts +1 -1
- package/dist/components/drawer/popup.cjs +51 -17
- package/dist/components/drawer/popup.d.ts +2 -2
- package/dist/components/drawer/popup.mjs +51 -17
- package/dist/components/{floating-action-button/floating-action-button.cjs → fab/fab.cjs} +2 -2
- package/dist/components/fab/fab.d.ts +4 -0
- package/dist/components/{floating-action-button/floating-action-button.mjs → fab/fab.mjs} +2 -2
- package/dist/components/{floating-action-button → fab}/floatable.d.ts +1 -1
- package/dist/components/fab/index.d.ts +2 -0
- package/dist/components/grid/col.d.ts +1 -1
- package/dist/components/grid/index.d.ts +2 -2
- package/dist/components/grid/row.d.ts +1 -1
- package/dist/components/highlight/highlight.d.ts +1 -1
- package/dist/components/i18n-button/i18n-button.cjs +11 -3
- package/dist/components/i18n-button/i18n-button.d.ts +2 -2
- package/dist/components/i18n-button/i18n-button.mjs +12 -4
- package/dist/components/icon/hoc.d.ts +2 -2
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icons/action/check-circle-outline.d.ts +1 -1
- package/dist/components/icon/icons/action/check-circle.d.ts +1 -1
- package/dist/components/icon/icons/action/code.d.ts +1 -1
- package/dist/components/icon/icons/action/delete.cjs +20 -0
- package/dist/components/icon/icons/action/delete.d.ts +3 -0
- package/dist/components/icon/icons/action/delete.mjs +18 -0
- package/dist/components/icon/icons/action/done-outline.d.ts +1 -1
- package/dist/components/icon/icons/action/done.d.ts +1 -1
- package/dist/components/icon/icons/action/index.cjs +7 -1
- package/dist/components/icon/icons/action/index.d.ts +18 -14
- package/dist/components/icon/icons/action/index.mjs +6 -2
- package/dist/components/icon/icons/action/open-in-new.d.ts +1 -1
- package/dist/components/icon/icons/action/swap-horiz.d.ts +1 -1
- package/dist/components/icon/icons/action/swap-vert.d.ts +1 -1
- package/dist/components/icon/icons/action/three-d-rotation.cjs +28 -0
- package/dist/components/icon/icons/action/three-d-rotation.d.ts +3 -0
- package/dist/components/icon/icons/action/three-d-rotation.mjs +26 -0
- package/dist/components/icon/icons/action/translate.d.ts +1 -1
- package/dist/components/icon/icons/action/visibility-off.d.ts +1 -1
- package/dist/components/icon/icons/action/visibility.d.ts +1 -1
- package/dist/components/icon/icons/action/zoom-in.d.ts +1 -1
- package/dist/components/icon/icons/action/zoom-out.d.ts +1 -1
- package/dist/components/icon/icons/alert/add-alert.d.ts +1 -1
- package/dist/components/icon/icons/alert/auto-delete.d.ts +1 -1
- package/dist/components/icon/icons/alert/error-outline.d.ts +1 -1
- package/dist/components/icon/icons/alert/error.d.ts +1 -1
- package/dist/components/icon/icons/alert/index.d.ts +7 -7
- package/dist/components/icon/icons/alert/notification-important.d.ts +1 -1
- package/dist/components/icon/icons/alert/warning-amber.d.ts +1 -1
- package/dist/components/icon/icons/alert/warning.d.ts +1 -1
- package/dist/components/icon/icons/content/clear.d.ts +1 -1
- package/dist/components/icon/icons/content/font-download.d.ts +1 -1
- package/dist/components/icon/icons/content/index.d.ts +5 -5
- package/dist/components/icon/icons/content/link-off.d.ts +1 -1
- package/dist/components/icon/icons/content/redo.d.ts +1 -1
- package/dist/components/icon/icons/content/undo.d.ts +1 -1
- package/dist/components/icon/icons/editor/attch-file.cjs +20 -0
- package/dist/components/icon/icons/editor/attch-file.d.ts +3 -0
- package/dist/components/icon/icons/editor/attch-file.mjs +18 -0
- package/dist/components/icon/icons/editor/checklist.d.ts +1 -1
- package/dist/components/icon/icons/editor/format-bold.d.ts +1 -1
- package/dist/components/icon/icons/editor/format-italic.d.ts +1 -1
- package/dist/components/icon/icons/editor/format-strikethrough.d.ts +1 -1
- package/dist/components/icon/icons/editor/format-underlined.d.ts +1 -1
- package/dist/components/icon/icons/editor/index.cjs +4 -1
- package/dist/components/icon/icons/editor/index.d.ts +12 -10
- package/dist/components/icon/icons/editor/index.mjs +4 -2
- package/dist/components/icon/icons/editor/insert-link.d.ts +1 -1
- package/dist/components/icon/icons/editor/notes.d.ts +1 -1
- package/dist/components/icon/icons/editor/subscript.d.ts +1 -1
- package/dist/components/icon/icons/editor/superscript.d.ts +1 -1
- package/dist/components/icon/icons/hardware/index.d.ts +6 -6
- package/dist/components/icon/icons/hardware/keyboard-arrow-down.d.ts +1 -1
- package/dist/components/icon/icons/hardware/keyboard-arrow-left.d.ts +1 -1
- package/dist/components/icon/icons/hardware/keyboard-arrow-right.d.ts +1 -1
- package/dist/components/icon/icons/hardware/keyboard-arrow-up.d.ts +1 -1
- package/dist/components/icon/icons/hardware/keyboard-double-arrow-left.d.ts +1 -1
- package/dist/components/icon/icons/hardware/keyboard-double-arrow-right.d.ts +1 -1
- package/dist/components/icon/icons/image/bedtime.d.ts +1 -1
- package/dist/components/icon/icons/image/edit.d.ts +1 -1
- package/dist/components/icon/icons/image/index.d.ts +11 -11
- package/dist/components/icon/icons/image/looks-five.d.ts +1 -1
- package/dist/components/icon/icons/image/looks-four.d.ts +1 -1
- package/dist/components/icon/icons/image/looks-one.d.ts +1 -1
- package/dist/components/icon/icons/image/looks-six.d.ts +1 -1
- package/dist/components/icon/icons/image/looks-three.d.ts +1 -1
- package/dist/components/icon/icons/image/looks-two.d.ts +1 -1
- package/dist/components/icon/icons/image/rotate-left.d.ts +1 -1
- package/dist/components/icon/icons/image/rotate-right.d.ts +1 -1
- package/dist/components/icon/icons/image/wb-sunny.d.ts +1 -1
- package/dist/components/icon/icons/index.cjs +6 -0
- package/dist/components/icon/icons/index.mjs +3 -0
- package/dist/components/icon/icons/mock/github.d.ts +1 -1
- package/dist/components/icon/icons/mock/index.d.ts +2 -2
- package/dist/components/icon/icons/mock/loading.d.ts +1 -1
- package/dist/components/icon/icons/navigation/cancel.d.ts +1 -1
- package/dist/components/icon/icons/navigation/check.d.ts +1 -1
- package/dist/components/icon/icons/navigation/close.d.ts +1 -1
- package/dist/components/icon/icons/navigation/index.d.ts +5 -5
- package/dist/components/icon/icons/navigation/more-horiz.d.ts +1 -1
- package/dist/components/icon/icons/navigation/unfold-more.d.ts +1 -1
- package/dist/components/icon/icons/toggle/index.d.ts +3 -3
- package/dist/components/icon/icons/toggle/star-half.d.ts +1 -1
- package/dist/components/icon/icons/toggle/star-outline.d.ts +1 -1
- package/dist/components/icon/icons/toggle/star.d.ts +1 -1
- package/dist/components/icon/index.d.ts +0 -5
- package/dist/components/image/hooks.d.ts +1 -1
- package/dist/components/image/image.cjs +2 -2
- package/dist/components/image/image.d.ts +1 -1
- package/dist/components/image/image.mjs +2 -2
- package/dist/components/image/index.d.ts +2 -2
- package/dist/components/image/preview/context.d.ts +1 -1
- package/dist/components/image/preview/group.d.ts +1 -1
- package/dist/components/image/preview/operations.d.ts +1 -1
- package/dist/components/image/preview/preview.d.ts +1 -1
- package/dist/components/input/hooks.d.ts +1 -1
- package/dist/components/input/index.d.ts +1 -2
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/kbd/kbd.d.ts +1 -1
- package/dist/components/kbd/utils.d.ts +1 -1
- package/dist/components/layout/footer.d.ts +1 -1
- package/dist/components/layout/header.d.ts +1 -1
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/components/layout/layout.d.ts +1 -1
- package/dist/components/layout/main.d.ts +1 -1
- package/dist/components/layout/sider.d.ts +1 -1
- package/dist/components/loading/loading.d.ts +1 -1
- package/dist/components/menu/hooks.cjs +7 -7
- package/dist/components/menu/hooks.d.ts +1 -2
- package/dist/components/menu/hooks.mjs +8 -8
- package/dist/components/menu/item.d.ts +2 -3
- package/dist/components/message/hooks.d.ts +1 -1
- package/dist/components/message/messager.d.ts +1 -1
- package/dist/components/notification/holder.d.ts +1 -1
- package/dist/components/notification/hooks.d.ts +1 -1
- package/dist/components/notification/index.d.ts +1 -1
- package/dist/components/notification/notification.d.ts +1 -1
- package/dist/components/notification/notifier.d.ts +1 -1
- package/dist/components/number-input/number-input.d.ts +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -1
- package/dist/components/pagination/pagination.cjs +1 -1
- package/dist/components/pagination/pagination.mjs +2 -2
- package/dist/components/picker/context.d.ts +1 -1
- package/dist/components/picker/picker.d.ts +1 -1
- package/dist/components/popconfirm/popconfirm.d.ts +1 -1
- package/dist/components/popover/hooks.d.ts +1 -1
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/popover.cjs +1 -1
- package/dist/components/popover/popover.d.ts +1 -1
- package/dist/components/popover/popover.mjs +1 -1
- package/dist/components/popper/dropdown.cjs +44 -22
- package/dist/components/popper/dropdown.d.ts +2 -2
- package/dist/components/popper/dropdown.mjs +46 -24
- package/dist/components/popper/hooks.cjs +88 -89
- package/dist/components/popper/hooks.d.ts +8 -14
- package/dist/components/popper/hooks.mjs +91 -91
- package/dist/components/popper/index.d.ts +0 -2
- package/dist/components/popper/popper.d.ts +1 -1
- package/dist/components/portal/portal.d.ts +1 -1
- package/dist/components/progress/circular.d.ts +1 -1
- package/dist/components/progress/linear.d.ts +1 -1
- package/dist/components/progress/progress.d.ts +1 -1
- package/dist/components/quote/quote.d.ts +1 -1
- package/dist/components/radio/context.d.ts +1 -1
- package/dist/components/radio/group.d.ts +1 -1
- package/dist/components/radio/index.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/rate/hooks.d.ts +1 -1
- package/dist/components/rate/rate.d.ts +1 -1
- package/dist/components/rate/star.d.ts +1 -1
- package/dist/components/rich-text-editor/dropdown.cjs +1 -1
- package/dist/components/rich-text-editor/dropdown.d.ts +1 -1
- package/dist/components/rich-text-editor/dropdown.mjs +1 -1
- package/dist/components/rich-text-editor/index.cjs +20 -2
- package/dist/components/rich-text-editor/index.d.ts +1 -1
- package/dist/components/rich-text-editor/index.mjs +20 -2
- package/dist/components/rich-text-editor/plugins/controlled-state/index.cjs +1 -2
- package/dist/components/rich-text-editor/plugins/controlled-state/index.d.ts +1 -1
- package/dist/components/rich-text-editor/plugins/controlled-state/index.mjs +1 -2
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.cjs +5 -4
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.d.ts +3 -3
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.mjs +3 -4
- package/dist/components/rich-text-editor/rich-text-editor.cjs +13 -10
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.mjs +12 -9
- package/dist/components/ripple/hooks.d.ts +1 -1
- package/dist/components/ripple/ripple.d.ts +1 -1
- package/dist/components/select/hooks.d.ts +1 -1
- package/dist/components/select/select.cjs +4 -1
- package/dist/components/select/select.mjs +5 -2
- package/dist/components/select/selections.d.ts +1 -1
- package/dist/components/select/selector.d.ts +1 -1
- package/dist/components/select/utils.cjs +1 -3
- package/dist/components/select/utils.d.ts +2 -2
- package/dist/components/select/utils.mjs +2 -4
- package/dist/components/skeleton/skeleton.cjs +20 -46
- package/dist/components/skeleton/skeleton.d.ts +2 -2
- package/dist/components/skeleton/skeleton.mjs +20 -46
- package/dist/components/space/space.d.ts +1 -1
- package/dist/components/steps/context.d.ts +1 -1
- package/dist/components/steps/item.d.ts +1 -1
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/switch/switch.cjs +9 -8
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.mjs +9 -8
- package/dist/components/table/body.cjs +3 -1
- package/dist/components/table/body.mjs +3 -1
- package/dist/components/tabs/context.d.ts +1 -1
- package/dist/components/tabs/hooks.d.ts +2 -2
- package/dist/components/tabs/navigation.d.ts +1 -1
- package/dist/components/tabs/panels.d.ts +1 -1
- package/dist/components/tabs/tab.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/theme/hooks.cjs +6 -6
- package/dist/components/theme/hooks.d.ts +1 -1
- package/dist/components/theme/hooks.mjs +6 -6
- package/dist/components/theme/theme-provider.cjs +12 -6
- package/dist/components/theme/theme-provider.d.ts +2 -2
- package/dist/components/theme/theme-provider.mjs +12 -6
- package/dist/components/theme/tokens.stylex.cjs +7 -0
- package/dist/components/theme/tokens.stylex.d.ts +8 -6
- package/dist/components/theme/tokens.stylex.mjs +7 -1
- package/dist/components/time-picker/hooks.d.ts +1 -1
- package/dist/components/time-picker/panel.d.ts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/timeline/context.d.ts +1 -1
- package/dist/components/timeline/item.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/transfer/context.d.ts +1 -1
- package/dist/components/transfer/hooks.d.ts +1 -1
- package/dist/components/transfer/item.d.ts +1 -1
- package/dist/components/transfer/list.d.ts +1 -1
- package/dist/components/transfer/transfer.d.ts +1 -1
- package/dist/components/upload/upload.cjs +31 -6
- package/dist/components/upload/upload.d.ts +2 -2
- package/dist/components/upload/upload.mjs +31 -6
- package/dist/components/upload/uploadeds.cjs +119 -55
- package/dist/components/upload/uploadeds.d.ts +1 -1
- package/dist/components/upload/uploadeds.mjs +121 -57
- package/dist/components/upload/utils.cjs +9 -0
- package/dist/components/upload/utils.d.ts +6 -0
- package/dist/components/upload/utils.mjs +9 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +1 -1
- package/dist/components/waterfall/sequential.d.ts +1 -1
- package/dist/components/waterfall/waterfall.d.ts +1 -1
- package/dist/components/watermark/hooks.d.ts +1 -1
- package/dist/components/watermark/watermark.d.ts +1 -1
- package/dist/hooks/use-class-names.d.ts +8 -1
- package/dist/hooks/use-closable.cjs +0 -8
- package/dist/hooks/use-closable.mjs +0 -8
- package/dist/hooks/use-container.d.ts +1 -1
- package/dist/hooks/use-lazy-boolean.cjs +2 -2
- package/dist/hooks/use-lazy-boolean.mjs +2 -2
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -1
- package/dist/locale/context.d.ts +1 -1
- package/dist/locale/locales/en_US.cjs +5 -1
- package/dist/locale/locales/en_US.mjs +5 -1
- package/dist/locale/locales/zh_CN.cjs +5 -1
- package/dist/locale/locales/zh_CN.mjs +5 -1
- package/dist/locale/use-locale.d.ts +1 -1
- package/dist/styles.css +23 -12
- package/dist/{components/clock/types.d.ts → types/clock.d.ts} +1 -5
- package/dist/{components/config/types.d.ts → types/config.d.ts} +2 -2
- package/dist/{components/countdown/types.d.ts → types/countdown.d.ts} +3 -3
- package/dist/{components/date-picker/types.d.ts → types/date-picker.d.ts} +1 -1
- package/dist/{components/dialog/types.d.ts → types/dialog.d.ts} +2 -2
- package/dist/{components/divider/types.d.ts → types/divider.d.ts} +1 -1
- package/dist/{components/drawer/types.d.ts → types/drawer.d.ts} +6 -1
- package/dist/types/element.d.ts +1 -56
- package/dist/{components/floating-action-button/types.d.ts → types/fab.d.ts} +3 -3
- package/dist/types/form.d.ts +39 -1
- package/dist/{components/grid/types.d.ts → types/grid.d.ts} +1 -1
- package/dist/{components/i18n-button/types.d.ts → types/i18n-button.d.ts} +3 -2
- package/dist/types/locale.d.ts +6 -0
- package/dist/types/menu.d.ts +9 -4
- package/dist/{components/message/types.d.ts → types/message.d.ts} +1 -1
- package/dist/{components/popconfirm/types.d.ts → types/popconfirm.d.ts} +2 -2
- package/dist/{components/popper/types.d.ts → types/popper.d.ts} +2 -2
- package/dist/{components/quote/types.d.ts → types/quote.d.ts} +1 -1
- package/dist/{components/radio/types.d.ts → types/radio.d.ts} +1 -1
- package/dist/types/rich-text-editor.d.ts +2 -1
- package/dist/types/skeleton.d.ts +12 -0
- package/dist/{components/space/types.d.ts → types/space.d.ts} +1 -1
- package/dist/{components/theme/types.d.ts → types/theme.d.ts} +1 -1
- package/dist/types/tour.d.ts +1 -1
- package/dist/types/tree.d.ts +7 -2
- package/dist/{components/upload/types.d.ts → types/upload.d.ts} +59 -22
- package/dist/{components/waterfall/types.d.ts → types/waterfall.d.ts} +3 -3
- package/dist/utils/class-name.cjs +10 -1
- package/dist/utils/class-name.d.ts +24 -3
- package/dist/utils/class-name.mjs +11 -2
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/component-token.cjs +2 -0
- package/dist/utils/component-token.d.ts +3 -1
- package/dist/utils/component-token.mjs +2 -0
- package/dist/utils/date.cjs +13 -0
- package/dist/utils/date.d.ts +6 -0
- package/dist/utils/date.mjs +13 -0
- package/package.json +25 -25
- package/dist/components/clock/hooks.cjs +0 -12
- package/dist/components/clock/hooks.d.ts +0 -2
- package/dist/components/clock/hooks.mjs +0 -12
- package/dist/components/clock/types.cjs +0 -6
- package/dist/components/clock/types.mjs +0 -8
- package/dist/components/floating-action-button/floating-action-button.d.ts +0 -4
- package/dist/components/floating-action-button/index.d.ts +0 -2
- package/dist/components/icon/icons/three-dimension-rotation.d.ts +0 -3
- package/dist/components/skeleton/types.d.ts +0 -19
- package/dist/utils/layer.cjs +0 -23
- package/dist/utils/layer.d.ts +0 -7
- package/dist/utils/layer.mjs +0 -23
- /package/dist/components/{floating-action-button → fab}/floatable.cjs +0 -0
- /package/dist/components/{floating-action-button → fab}/floatable.mjs +0 -0
- /package/dist/{components/avatar/types.d.ts → types/avatar.d.ts} +0 -0
- /package/dist/{components/badge/types.d.ts → types/badge.d.ts} +0 -0
- /package/dist/{components/breadcrumb/types.d.ts → types/breadcrumb.d.ts} +0 -0
- /package/dist/{components/button/types.d.ts → types/button.d.ts} +0 -0
- /package/dist/{components/calendar/types.d.ts → types/calendar.d.ts} +0 -0
- /package/dist/{components/cascader/types.d.ts → types/cascader.d.ts} +0 -0
- /package/dist/{components/checkbox/types.d.ts → types/checkbox.d.ts} +0 -0
- /package/dist/{components/collapse/types.d.ts → types/collapse.d.ts} +0 -0
- /package/dist/{components/date-range-picker/types.d.ts → types/date-range-picker.d.ts} +0 -0
- /package/dist/{components/highlight/types.d.ts → types/highlight.d.ts} +0 -0
- /package/dist/{components/icon/types.d.ts → types/icon.d.ts} +0 -0
- /package/dist/{components/image/types.d.ts → types/image.d.ts} +0 -0
- /package/dist/{components/input/types.d.ts → types/input.d.ts} +0 -0
- /package/dist/{components/kbd/types.d.ts → types/kbd.d.ts} +0 -0
- /package/dist/{components/layout/types.d.ts → types/layout.d.ts} +0 -0
- /package/dist/{components/loading/types.d.ts → types/loading.d.ts} +0 -0
- /package/dist/{components/notification/types.d.ts → types/notification.d.ts} +0 -0
- /package/dist/{components/number-input/types.d.ts → types/number-input.d.ts} +0 -0
- /package/dist/{components/otp-input/types.d.ts → types/otp-input.d.ts} +0 -0
- /package/dist/{components/popover/types.d.ts → types/popover.d.ts} +0 -0
- /package/dist/{components/portal/types.d.ts → types/portal.d.ts} +0 -0
- /package/dist/{components/progress/types.d.ts → types/progress.d.ts} +0 -0
- /package/dist/{components/rate/types.d.ts → types/rate.d.ts} +0 -0
- /package/dist/{components/ripple/types.d.ts → types/ripple.d.ts} +0 -0
- /package/dist/{components/steps/types.d.ts → types/steps.d.ts} +0 -0
- /package/dist/{components/switch/types.d.ts → types/switch.d.ts} +0 -0
- /package/dist/{components/tabs/types.d.ts → types/tabs.d.ts} +0 -0
- /package/dist/{components/tag/types.d.ts → types/tag.d.ts} +0 -0
- /package/dist/{components/time-picker/types.d.ts → types/time-picker.d.ts} +0 -0
- /package/dist/{components/timeline/types.d.ts → types/timeline.d.ts} +0 -0
- /package/dist/{components/tooltip/types.d.ts → types/tooltip.d.ts} +0 -0
- /package/dist/{components/transfer/types.d.ts → types/transfer.d.ts} +0 -0
- /package/dist/{components/visually-hidden/types.d.ts → types/visually-hidden.d.ts} +0 -0
- /package/dist/{components/watermark/types.d.ts → types/watermark.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { BadgeProps } from "
|
|
2
|
+
import type { BadgeProps } from "musae/types/badge";
|
|
3
3
|
declare const Badge: ({ className, style, children, content, invisible, placement, }: BadgeProps) => React.JSX.Element;
|
|
4
4
|
export default Badge;
|
|
@@ -138,24 +138,22 @@ var Bench = function Bench(_ref) {
|
|
|
138
138
|
}))), /*#__PURE__*/React.createElement("span", {
|
|
139
139
|
className: styled.title.className,
|
|
140
140
|
style: styled.title.style
|
|
141
|
-
}, title), /*#__PURE__*/React.createElement(menu.default,
|
|
141
|
+
}, title), /*#__PURE__*/React.createElement(menu.default, {
|
|
142
142
|
items: topMenuItems,
|
|
143
143
|
onClick: navigate,
|
|
144
144
|
mode: "horizontal",
|
|
145
145
|
className: styled.headerNavigation.className,
|
|
146
|
-
style: styled.headerNavigation.style
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
})), trailing), sideMenuItems.length > 0 && (/*#__PURE__*/React.createElement(Sider, {
|
|
146
|
+
style: styled.headerNavigation.style,
|
|
147
|
+
selectedKeys: selectedKeys[0]
|
|
148
|
+
}), trailing), sideMenuItems.length > 0 && (/*#__PURE__*/React.createElement(Sider, {
|
|
150
149
|
className: styled.sider.className,
|
|
151
150
|
style: styled.sider.style
|
|
152
|
-
}, /*#__PURE__*/React.createElement(menu.default,
|
|
151
|
+
}, /*#__PURE__*/React.createElement(menu.default, {
|
|
153
152
|
items: sideMenuItems,
|
|
154
153
|
onClick: navigate,
|
|
155
|
-
defaultExpandedKeys: defaultExpandedKeys
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
})))), /*#__PURE__*/React.createElement(Main, {
|
|
154
|
+
defaultExpandedKeys: defaultExpandedKeys,
|
|
155
|
+
selectedKeys: selectedKeys[1]
|
|
156
|
+
}))), /*#__PURE__*/React.createElement(Main, {
|
|
159
157
|
className: relax.clsx(mainClassName, styled.main.className),
|
|
160
158
|
style: styled.main.style
|
|
161
159
|
}, children));
|
|
@@ -136,24 +136,22 @@ var Bench = function Bench(_ref) {
|
|
|
136
136
|
}))), /*#__PURE__*/React.createElement("span", {
|
|
137
137
|
className: styled.title.className,
|
|
138
138
|
style: styled.title.style
|
|
139
|
-
}, title), /*#__PURE__*/React.createElement(Menu,
|
|
139
|
+
}, title), /*#__PURE__*/React.createElement(Menu, {
|
|
140
140
|
items: topMenuItems,
|
|
141
141
|
onClick: navigate,
|
|
142
142
|
mode: "horizontal",
|
|
143
143
|
className: styled.headerNavigation.className,
|
|
144
|
-
style: styled.headerNavigation.style
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
})), trailing), sideMenuItems.length > 0 && (/*#__PURE__*/React.createElement(Sider, {
|
|
144
|
+
style: styled.headerNavigation.style,
|
|
145
|
+
selectedKeys: selectedKeys[0]
|
|
146
|
+
}), trailing), sideMenuItems.length > 0 && (/*#__PURE__*/React.createElement(Sider, {
|
|
148
147
|
className: styled.sider.className,
|
|
149
148
|
style: styled.sider.style
|
|
150
|
-
}, /*#__PURE__*/React.createElement(Menu,
|
|
149
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
151
150
|
items: sideMenuItems,
|
|
152
151
|
onClick: navigate,
|
|
153
|
-
defaultExpandedKeys: defaultExpandedKeys
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
})))), /*#__PURE__*/React.createElement(Main, {
|
|
152
|
+
defaultExpandedKeys: defaultExpandedKeys,
|
|
153
|
+
selectedKeys: selectedKeys[1]
|
|
154
|
+
}))), /*#__PURE__*/React.createElement(Main, {
|
|
157
155
|
className: clsx(mainClassName, styled.main.className),
|
|
158
156
|
style: styled.main.style
|
|
159
157
|
}, children));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { BreadcrumbProps } from "
|
|
2
|
+
import type { BreadcrumbProps } from "musae/types/breadcrumb";
|
|
3
3
|
declare const Breadcrumb: ({ items, className, separator, style }: BreadcrumbProps) => React.JSX.Element | null;
|
|
4
4
|
export default Breadcrumb;
|
|
@@ -6,14 +6,15 @@ var React = require('react');
|
|
|
6
6
|
var className = require('../../utils/class-name.cjs');
|
|
7
7
|
var relax = require('@aiszlab/relax');
|
|
8
8
|
var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
|
|
9
|
+
var tokens_stylex = require('../theme/tokens.stylex.cjs');
|
|
9
10
|
var hooks = require('../theme/hooks.cjs');
|
|
10
11
|
var hooks$1 = require('./hooks.cjs');
|
|
11
12
|
var ripple = require('../ripple/ripple.cjs');
|
|
12
13
|
var theme = require('../theme/theme.cjs');
|
|
13
14
|
var colors = require('../../utils/colors.cjs');
|
|
14
|
-
var layer = require('../../utils/layer.cjs');
|
|
15
15
|
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
16
16
|
var componentToken = require('../../utils/component-token.cjs');
|
|
17
|
+
var color = require('@aiszlab/fuzzy/color');
|
|
17
18
|
|
|
18
19
|
var _excluded = ["children", "className", "style", "color", "size", "variant", "shape", "disabled", "ripple", "type", "onClick", "prefix", "suffix"];
|
|
19
20
|
var styles = {
|
|
@@ -232,7 +233,7 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
232
233
|
className$1 = _ref.className,
|
|
233
234
|
style = _ref.style,
|
|
234
235
|
_ref$color = _ref.color,
|
|
235
|
-
color = _ref$color === void 0 ? "primary" : _ref$color,
|
|
236
|
+
color$1 = _ref$color === void 0 ? "primary" : _ref$color,
|
|
236
237
|
_ref$size = _ref.size,
|
|
237
238
|
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
238
239
|
_ref$variant = _ref.variant,
|
|
@@ -263,22 +264,22 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
263
264
|
styles[size],
|
|
264
265
|
// variant
|
|
265
266
|
variant === "filled" && styles.filled({
|
|
266
|
-
backgroundColor: theme$1.colors[color],
|
|
267
|
-
color: theme$1.colors["on-".concat(color)]
|
|
267
|
+
backgroundColor: theme$1.colors[color$1],
|
|
268
|
+
color: theme$1.colors["on-".concat(color$1)]
|
|
268
269
|
}), variant === "outlined" && styles.outlined({
|
|
269
|
-
color: theme$1.colors[color],
|
|
270
|
-
hoveredBackgroundColor:
|
|
270
|
+
color: theme$1.colors[color$1],
|
|
271
|
+
hoveredBackgroundColor: color.hexToRgba(theme$1.colors[colors.ColorToken.Primary], tokens_stylex.OPACITY.thin)
|
|
271
272
|
}), variant === "text" && styles.text({
|
|
272
|
-
color: theme$1.colors[color],
|
|
273
|
-
hoveredBackgroundColor:
|
|
273
|
+
color: theme$1.colors[color$1],
|
|
274
|
+
hoveredBackgroundColor: color.hexToRgba(theme$1.colors[colors.ColorToken.Primary], tokens_stylex.OPACITY.thin)
|
|
274
275
|
}),
|
|
275
276
|
// shape
|
|
276
277
|
styles[shape],
|
|
277
278
|
// disabled
|
|
278
279
|
disabled && styles.disabled({
|
|
279
|
-
backgroundColor: variant === "filled" ?
|
|
280
|
-
color:
|
|
281
|
-
outlineColor: variant === "outlined" ?
|
|
280
|
+
backgroundColor: variant === "filled" ? color.hexToRgba(theme$1.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.medium) : "transparent",
|
|
281
|
+
color: color.hexToRgba(theme$1.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.thicker),
|
|
282
|
+
outlineColor: variant === "outlined" ? color.hexToRgba(theme$1.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.thicker) : null
|
|
282
283
|
}))
|
|
283
284
|
};
|
|
284
285
|
return /*#__PURE__*/React.createElement("button", _objectSpread({
|
|
@@ -4,14 +4,15 @@ import React, { forwardRef } from 'react';
|
|
|
4
4
|
import { ButtonClassToken } from '../../utils/class-name.mjs';
|
|
5
5
|
import { clsx } from '@aiszlab/relax';
|
|
6
6
|
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
7
|
+
import { OPACITY } from '../theme/tokens.stylex.mjs';
|
|
7
8
|
import { useTheme } from '../theme/hooks.mjs';
|
|
8
9
|
import { useButton } from './hooks.mjs';
|
|
9
10
|
import Ripple from '../ripple/ripple.mjs';
|
|
10
11
|
import { typography } from '../theme/theme.mjs';
|
|
11
12
|
import { ColorToken } from '../../utils/colors.mjs';
|
|
12
|
-
import { layer } from '../../utils/layer.mjs';
|
|
13
13
|
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
14
14
|
import { ComponentToken } from '../../utils/component-token.mjs';
|
|
15
|
+
import { hexToRgba } from '@aiszlab/fuzzy/color';
|
|
15
16
|
|
|
16
17
|
var _excluded = ["children", "className", "style", "color", "size", "variant", "shape", "disabled", "ripple", "type", "onClick", "prefix", "suffix"];
|
|
17
18
|
var styles = {
|
|
@@ -265,18 +266,18 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
265
266
|
color: theme.colors["on-".concat(color)]
|
|
266
267
|
}), variant === "outlined" && styles.outlined({
|
|
267
268
|
color: theme.colors[color],
|
|
268
|
-
hoveredBackgroundColor:
|
|
269
|
+
hoveredBackgroundColor: hexToRgba(theme.colors[ColorToken.Primary], OPACITY.thin)
|
|
269
270
|
}), variant === "text" && styles.text({
|
|
270
271
|
color: theme.colors[color],
|
|
271
|
-
hoveredBackgroundColor:
|
|
272
|
+
hoveredBackgroundColor: hexToRgba(theme.colors[ColorToken.Primary], OPACITY.thin)
|
|
272
273
|
}),
|
|
273
274
|
// shape
|
|
274
275
|
styles[shape],
|
|
275
276
|
// disabled
|
|
276
277
|
disabled && styles.disabled({
|
|
277
|
-
backgroundColor: variant === "filled" ?
|
|
278
|
-
color:
|
|
279
|
-
outlineColor: variant === "outlined" ?
|
|
278
|
+
backgroundColor: variant === "filled" ? hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.medium) : "transparent",
|
|
279
|
+
color: hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.thicker),
|
|
280
|
+
outlineColor: variant === "outlined" ? hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.thicker) : null
|
|
280
281
|
}))
|
|
281
282
|
};
|
|
282
283
|
return /*#__PURE__*/React.createElement("button", _objectSpread({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type MouseEvent } from "react";
|
|
2
|
-
import type { ButtonProps } from "
|
|
2
|
+
import type { ButtonProps } from "musae/types/button";
|
|
3
3
|
/**
|
|
4
4
|
* @description
|
|
5
5
|
* hooks for button component
|
|
6
6
|
*/
|
|
7
7
|
export declare const useButton: (props: Pick<ButtonProps, "onClick">) => {
|
|
8
|
-
ripples: import("
|
|
8
|
+
ripples: import("../../types/ripple").Ripple[];
|
|
9
9
|
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
10
10
|
clear: (key: import("react").Key) => void;
|
|
11
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { CalendarProps } from "
|
|
2
|
+
import type { CalendarProps } from "musae/types/calendar";
|
|
3
3
|
declare const Calendar: ({ className, style, value, onClick: _onClick, focusedAt: _focusedAt, }: CalendarProps) => React.JSX.Element;
|
|
4
4
|
export default Calendar;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
|
+
var dayjs = require('dayjs');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
|
|
7
|
+
var hooks = require('../theme/hooks.cjs');
|
|
8
|
+
var theme = require('../theme/theme.cjs');
|
|
9
|
+
var tooltip = require('../tooltip/tooltip.cjs');
|
|
10
|
+
var relax = require('@aiszlab/relax');
|
|
11
|
+
var date = require('../../utils/date.cjs');
|
|
12
|
+
|
|
13
|
+
var styles = {
|
|
14
|
+
calendar: {
|
|
15
|
+
variables: function variables(props) {
|
|
16
|
+
return [{
|
|
17
|
+
"--cell-size": "musaex-1erll0c",
|
|
18
|
+
"--cell-color": "musaex-1utc1yc",
|
|
19
|
+
$$css: true
|
|
20
|
+
}, {
|
|
21
|
+
"----cell-color": props.color != null ? props.color : "initial"
|
|
22
|
+
}];
|
|
23
|
+
},
|
|
24
|
+
"default": {
|
|
25
|
+
borderCollapse: "musaex-1vathgz",
|
|
26
|
+
borderSpacing: "musaex-g5hwcv",
|
|
27
|
+
$$css: true
|
|
28
|
+
},
|
|
29
|
+
scrollable: {
|
|
30
|
+
maxWidth: "musaex-193iq5w",
|
|
31
|
+
overflow: "musaex-ysyzu8",
|
|
32
|
+
overflowX: null,
|
|
33
|
+
overflowY: null,
|
|
34
|
+
$$css: true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
cell: {
|
|
38
|
+
"default": {
|
|
39
|
+
minWidth: "musaex-1q6qbx2",
|
|
40
|
+
minHeight: "musaex-189dakb",
|
|
41
|
+
padding: "musaex-1717udv",
|
|
42
|
+
paddingInline: null,
|
|
43
|
+
paddingStart: null,
|
|
44
|
+
paddingLeft: null,
|
|
45
|
+
paddingEnd: null,
|
|
46
|
+
paddingRight: null,
|
|
47
|
+
paddingBlock: null,
|
|
48
|
+
paddingTop: null,
|
|
49
|
+
paddingBottom: null,
|
|
50
|
+
borderRadius: "musaex-llun4g",
|
|
51
|
+
borderStartStartRadius: null,
|
|
52
|
+
borderStartEndRadius: null,
|
|
53
|
+
borderEndStartRadius: null,
|
|
54
|
+
borderEndEndRadius: null,
|
|
55
|
+
borderTopLeftRadius: null,
|
|
56
|
+
borderTopRightRadius: null,
|
|
57
|
+
borderBottomLeftRadius: null,
|
|
58
|
+
borderBottomRightRadius: null,
|
|
59
|
+
cursor: "musaex-1ypdohk",
|
|
60
|
+
backgroundColor: "musaex-1204rnj",
|
|
61
|
+
$$css: true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
weekday: {
|
|
65
|
+
cell: {
|
|
66
|
+
padding: "musaex-1717udv",
|
|
67
|
+
paddingInline: null,
|
|
68
|
+
paddingStart: null,
|
|
69
|
+
paddingLeft: null,
|
|
70
|
+
paddingEnd: null,
|
|
71
|
+
paddingRight: null,
|
|
72
|
+
paddingBlock: null,
|
|
73
|
+
paddingTop: null,
|
|
74
|
+
paddingBottom: null,
|
|
75
|
+
$$css: true
|
|
76
|
+
},
|
|
77
|
+
"default": {
|
|
78
|
+
height: "musaex-sahybl",
|
|
79
|
+
overflow: "musaex-1rea2x4",
|
|
80
|
+
overflowX: null,
|
|
81
|
+
overflowY: null,
|
|
82
|
+
display: "musaex-78zum5",
|
|
83
|
+
alignItems: "musaex-6s0dn4",
|
|
84
|
+
$$css: true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
month: {
|
|
88
|
+
cell: {
|
|
89
|
+
padding: "musaex-1717udv",
|
|
90
|
+
paddingInline: null,
|
|
91
|
+
paddingStart: null,
|
|
92
|
+
paddingLeft: null,
|
|
93
|
+
paddingEnd: null,
|
|
94
|
+
paddingRight: null,
|
|
95
|
+
paddingBlock: null,
|
|
96
|
+
paddingTop: null,
|
|
97
|
+
paddingBottom: null,
|
|
98
|
+
position: "musaex-1n2onr6",
|
|
99
|
+
$$css: true
|
|
100
|
+
},
|
|
101
|
+
leading: {
|
|
102
|
+
visibility: "musaex-lshs6z",
|
|
103
|
+
$$css: true
|
|
104
|
+
},
|
|
105
|
+
"default": {
|
|
106
|
+
position: "musaex-10l6tqk",
|
|
107
|
+
top: "musaex-13vifvy",
|
|
108
|
+
insetInlineStart: "musaex-1o0tod",
|
|
109
|
+
left: null,
|
|
110
|
+
right: null,
|
|
111
|
+
$$css: true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* @description
|
|
117
|
+
* contribution calendar
|
|
118
|
+
* inspired by github
|
|
119
|
+
*/
|
|
120
|
+
var ContributionCalendar = function ContributionCalendar(_ref) {
|
|
121
|
+
var year = _ref.year;
|
|
122
|
+
_ref.gaps;
|
|
123
|
+
var _ref$dataSource = _ref.dataSource,
|
|
124
|
+
dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource;
|
|
125
|
+
var theme$1 = hooks.useTheme();
|
|
126
|
+
var _useMemo = React.useMemo(function () {
|
|
127
|
+
var _to = relax.min([dayjs().subtract(1, "day"), dayjs("".concat(year, "-12-31"))], function (_value) {
|
|
128
|
+
return _value.valueOf();
|
|
129
|
+
});
|
|
130
|
+
var _from = _to.subtract(1, "year").add(1, "day");
|
|
131
|
+
return [_from, _to];
|
|
132
|
+
}, [year]),
|
|
133
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
134
|
+
from = _useMemo2[0],
|
|
135
|
+
to = _useMemo2[1];
|
|
136
|
+
var _useMemo3 = React.useMemo(function () {
|
|
137
|
+
return [from.startOf("week"), to.endOf("week")];
|
|
138
|
+
}, [from, to]),
|
|
139
|
+
_useMemo4 = _slicedToArray(_useMemo3, 2),
|
|
140
|
+
start = _useMemo4[0],
|
|
141
|
+
end = _useMemo4[1];
|
|
142
|
+
var columns = React.useMemo(function () {
|
|
143
|
+
return end.diff(start, "week") + 1;
|
|
144
|
+
}, [start, end]);
|
|
145
|
+
var months = React.useMemo(function () {
|
|
146
|
+
return Array.from({
|
|
147
|
+
length: 13
|
|
148
|
+
}).reduce(function (prev, _, monthAt) {
|
|
149
|
+
var _month = from.clone().add(monthAt, "month");
|
|
150
|
+
var _from = monthAt > 0 ? date.firstSundayInMonth(_month) : _month.startOf("month");
|
|
151
|
+
var _to = _from.clone().endOf("month");
|
|
152
|
+
prev.push({
|
|
153
|
+
start: Math.max(_from.diff(start, "week"), 0),
|
|
154
|
+
end: Math.min(_to.diff(start, "week") + 1, columns),
|
|
155
|
+
month: _from.format("MMM")
|
|
156
|
+
});
|
|
157
|
+
return prev;
|
|
158
|
+
}, []);
|
|
159
|
+
}, [from, start, columns]);
|
|
160
|
+
var heats = React.useMemo(function () {
|
|
161
|
+
return dataSource.reduce(function (prev, _ref2) {
|
|
162
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
163
|
+
date = _ref3[0],
|
|
164
|
+
count = _ref3[1];
|
|
165
|
+
return prev.set(date, count);
|
|
166
|
+
}, new Map());
|
|
167
|
+
}, [dataSource]);
|
|
168
|
+
var styled = {
|
|
169
|
+
scrollable: stylex.default.props(styles.calendar.scrollable),
|
|
170
|
+
calendar: stylex.default.props(styles.calendar.variables({
|
|
171
|
+
color: theme$1.colors.primary
|
|
172
|
+
}), styles.calendar["default"]),
|
|
173
|
+
cell: stylex.default.props(styles.cell["default"]),
|
|
174
|
+
weekday: {
|
|
175
|
+
cell: stylex.default.props(styles.weekday.cell, theme.typography.body.small),
|
|
176
|
+
"default": stylex.default.props(styles.weekday["default"])
|
|
177
|
+
},
|
|
178
|
+
month: {
|
|
179
|
+
cell: stylex.default.props(styles.month.cell, theme.typography.body.small),
|
|
180
|
+
"default": stylex.default.props(styles.month["default"]),
|
|
181
|
+
leading: stylex.default.props(styles.month.cell, theme.typography.body.small, styles.month.leading)
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
185
|
+
className: styled.scrollable.className,
|
|
186
|
+
style: styled.scrollable.style
|
|
187
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
188
|
+
className: styled.calendar.className,
|
|
189
|
+
style: styled.calendar.style
|
|
190
|
+
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
191
|
+
className: styled.month.leading.className,
|
|
192
|
+
style: styled.month.leading.style
|
|
193
|
+
}, "W/M"), months.map(function (_ref4, _key, _months) {
|
|
194
|
+
var start = _ref4.start,
|
|
195
|
+
end = _ref4.end,
|
|
196
|
+
month = _ref4.month;
|
|
197
|
+
var colSpan = end - start;
|
|
198
|
+
if (colSpan === 0) return null;
|
|
199
|
+
// render headers
|
|
200
|
+
// if col span is less than 2, skip render label
|
|
201
|
+
// ISSUE: if leading month has rendered, the trailing month will be rendered twice
|
|
202
|
+
var skip = colSpan < 2 || _months.length - 1 === _key && _months[0].end - _months[0].start >= 2;
|
|
203
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
204
|
+
key: _key,
|
|
205
|
+
colSpan: colSpan,
|
|
206
|
+
className: styled.month.cell.className,
|
|
207
|
+
style: styled.month.cell.style
|
|
208
|
+
}, !skip && (/*#__PURE__*/React.createElement("div", {
|
|
209
|
+
className: styled.month["default"].className,
|
|
210
|
+
style: styled.month["default"].style
|
|
211
|
+
}, month)));
|
|
212
|
+
}))), /*#__PURE__*/React.createElement("tbody", null, Array.from({
|
|
213
|
+
length: 7
|
|
214
|
+
}).map(function (_, weekday) {
|
|
215
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
216
|
+
key: weekday
|
|
217
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
218
|
+
className: styled.weekday.cell.className,
|
|
219
|
+
style: styled.weekday.cell.style
|
|
220
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
221
|
+
className: styled.weekday["default"].className,
|
|
222
|
+
style: styled.weekday["default"].style
|
|
223
|
+
}, [1, 3, 5].includes(weekday) && (/*#__PURE__*/React.createElement("span", null, dayjs().day(weekday).format("ddd"))))), Array.from({
|
|
224
|
+
length: columns
|
|
225
|
+
}).map(function (_, column) {
|
|
226
|
+
var gap = column * 7 + weekday;
|
|
227
|
+
var _at = start.add(gap, "day");
|
|
228
|
+
if (column === 0 && !_at.isAfter(from)) {
|
|
229
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
230
|
+
key: column
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (column === columns - 1 && _at.isAfter(to)) {
|
|
234
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
235
|
+
key: column
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
var date = _at.format("YYYY-MM-DD");
|
|
239
|
+
var count = heats.get(date);
|
|
240
|
+
return /*#__PURE__*/React.createElement(tooltip.default, {
|
|
241
|
+
key: column,
|
|
242
|
+
title: "".concat(count, " contributions at ").concat(_at.format("YYYY-MM-DD"))
|
|
243
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
244
|
+
className: styled.cell.className,
|
|
245
|
+
style: styled.cell.style
|
|
246
|
+
}));
|
|
247
|
+
}));
|
|
248
|
+
}))));
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
exports.default = ContributionCalendar;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
year: number;
|
|
4
|
+
gaps?: number[];
|
|
5
|
+
dataSource?: [string, number][];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* contribution calendar
|
|
10
|
+
* inspired by github
|
|
11
|
+
*/
|
|
12
|
+
declare const ContributionCalendar: ({ year, gaps, dataSource }: Props) => React.JSX.Element;
|
|
13
|
+
export default ContributionCalendar;
|