@nextui-org/react 1.0.2-alpha.2 → 1.0.2-beta.4
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 +10 -5
- package/cjs/avatar/avatar-group.js +1 -35
- package/cjs/avatar/avatar-group.styles.js +1 -52
- package/cjs/avatar/avatar.js +1 -75
- package/cjs/avatar/avatar.styles.js +1 -334
- package/cjs/avatar/index.js +1 -22
- package/cjs/backdrop/backdrop.js +1 -137
- package/cjs/backdrop/backdrop.styles.js +1 -119
- package/cjs/backdrop/index.js +1 -16
- package/cjs/button/button-group-context.js +1 -21
- package/cjs/button/button-group.js +1 -81
- package/cjs/button/button-group.styles.js +1 -136
- package/cjs/button/button-icon.js +1 -68
- package/cjs/button/button.js +1 -145
- package/cjs/button/button.styles.js +1 -695
- package/cjs/button/index.js +1 -25
- package/cjs/button/utils.js +1 -27
- package/cjs/card/card.js +1 -117
- package/cjs/card/card.styles.js +1 -267
- package/cjs/card/index.js +1 -24
- package/cjs/checkbox/checkbox-context.js +1 -25
- package/cjs/checkbox/checkbox-group.js +1 -89
- package/cjs/checkbox/checkbox.js +1 -192
- package/cjs/checkbox/checkbox.styles.js +1 -563
- package/cjs/checkbox/index.js +1 -26
- package/cjs/code/code.js +1 -42
- package/cjs/code/code.styles.js +1 -14
- package/cjs/code/index.js +1 -15
- package/cjs/col/col.js +1 -46
- package/cjs/col/col.styles.js +1 -16
- package/cjs/col/index.js +1 -14
- package/cjs/collapse/collapse-context.js +1 -20
- package/cjs/collapse/collapse-group.js +1 -90
- package/cjs/collapse/collapse-icon.js +1 -41
- package/cjs/collapse/collapse.js +1 -190
- package/cjs/collapse/collapse.styles.js +1 -254
- package/cjs/collapse/index.js +1 -22
- package/cjs/container/container.js +1 -91
- package/cjs/container/container.styles.js +1 -45
- package/cjs/container/index.js +1 -14
- package/cjs/css-baseline/css-baseline.js +1 -247
- package/cjs/css-baseline/index.js +1 -11
- package/cjs/divider/divider.js +1 -82
- package/cjs/divider/divider.styles.js +1 -77
- package/cjs/divider/index.js +1 -15
- package/cjs/grid/grid-container.js +1 -60
- package/cjs/grid/grid-item.js +1 -123
- package/cjs/grid/grid.js +1 -29
- package/cjs/grid/grid.styles.js +1 -15
- package/cjs/grid/index.js +1 -18
- package/cjs/image/image.js +1 -150
- package/cjs/image/image.skeleton.js +1 -50
- package/cjs/image/image.styles.js +1 -57
- package/cjs/image/index.js +1 -16
- package/cjs/index.js +1 -435
- package/cjs/input/index.js +1 -30
- package/cjs/input/input-password.js +1 -80
- package/cjs/input/input-props.js +1 -30
- package/cjs/input/input.js +1 -317
- package/cjs/input/input.styles.js +1 -878
- package/cjs/input/password-icon.js +1 -51
- package/cjs/link/icon.js +1 -42
- package/cjs/link/index.js +1 -15
- package/cjs/link/link.js +1 -42
- package/cjs/link/link.styles.js +1 -135
- package/cjs/loading/index.js +1 -24
- package/cjs/loading/loading.js +1 -80
- package/cjs/loading/loading.styles.js +1 -438
- package/cjs/loading/spinner.js +1 -47
- package/cjs/modal/index.js +1 -28
- package/cjs/modal/modal-body.js +1 -62
- package/cjs/modal/modal-close-button.js +1 -49
- package/cjs/modal/modal-context.js +1 -18
- package/cjs/modal/modal-footer.js +1 -69
- package/cjs/modal/modal-header.js +1 -69
- package/cjs/modal/modal-wrapper.js +1 -153
- package/cjs/modal/modal.js +1 -159
- package/cjs/modal/modal.styles.js +1 -243
- package/cjs/modal/use-modal.js +1 -25
- package/cjs/pagination/index.js +1 -19
- package/cjs/pagination/pagination-ellipsis.js +1 -86
- package/cjs/pagination/pagination-highlight.js +1 -52
- package/cjs/pagination/pagination-icon.js +1 -59
- package/cjs/pagination/pagination-item.js +1 -104
- package/cjs/pagination/pagination.js +1 -169
- package/cjs/pagination/pagination.styles.js +1 -361
- package/cjs/progress/index.js +1 -15
- package/cjs/progress/progress.js +1 -101
- package/cjs/progress/progress.styles.js +1 -165
- package/cjs/radio/index.js +1 -24
- package/cjs/radio/radio-context.js +1 -24
- package/cjs/radio/radio-group.js +1 -78
- package/cjs/radio/radio.js +1 -156
- package/cjs/radio/radio.styles.js +1 -240
- package/cjs/row/index.js +1 -14
- package/cjs/row/row.js +1 -54
- package/cjs/row/row.styles.js +1 -25
- package/cjs/snippet/index.js +1 -16
- package/cjs/snippet/snippet-icon.js +1 -52
- package/cjs/snippet/snippet.js +1 -137
- package/cjs/snippet/snippet.styles.js +1 -141
- package/cjs/spacer/index.js +1 -14
- package/cjs/spacer/spacer.js +1 -49
- package/cjs/spacer/spacer.styles.js +1 -24
- package/cjs/switch/index.js +1 -17
- package/cjs/switch/switch.js +1 -142
- package/cjs/switch/switch.styles.js +1 -283
- package/cjs/text/child.js +1 -83
- package/cjs/text/index.js +1 -14
- package/cjs/text/text.js +1 -124
- package/cjs/text/text.styles.js +1 -41
- package/cjs/textarea/index.js +1 -12
- package/cjs/textarea/textarea.js +1 -126
- package/cjs/textarea/utils.js +1 -126
- package/cjs/theme/common.js +1 -490
- package/cjs/theme/dark-theme.js +1 -38
- package/cjs/theme/index.js +1 -31
- package/cjs/theme/light-theme.js +1 -33
- package/cjs/theme/stitches.config.js +1 -88
- package/cjs/theme/theme-context.js +1 -22
- package/cjs/theme/theme-provider.js +1 -115
- package/cjs/theme/types.js +1 -3
- package/cjs/theme/utils.js +1 -113
- package/cjs/tooltip/index.js +1 -17
- package/cjs/tooltip/placement.js +1 -193
- package/cjs/tooltip/tooltip-content.js +1 -135
- package/cjs/tooltip/tooltip.js +1 -141
- package/cjs/tooltip/tooltip.styles.js +1 -159
- package/cjs/use-body-scroll/index.js +1 -12
- package/cjs/use-body-scroll/use-body-scroll.js +1 -77
- package/cjs/use-click-anywhere/index.js +1 -12
- package/cjs/use-click-anywhere/use-click-anywhere.js +1 -19
- package/cjs/use-click-away/index.js +1 -12
- package/cjs/use-click-away/use-click-away.js +1 -23
- package/cjs/use-clipboard/index.js +1 -12
- package/cjs/use-clipboard/use-clipboard.js +1 -57
- package/cjs/use-current-state/index.js +1 -12
- package/cjs/use-current-state/use-current-state.js +1 -28
- package/cjs/use-drip/index.js +1 -12
- package/cjs/use-drip/use-drip.js +1 -38
- package/cjs/use-input/index.js +1 -12
- package/cjs/use-input/use-input.js +1 -32
- package/cjs/use-keyboard/codes.js +1 -104
- package/cjs/use-keyboard/helper.js +1 -35
- package/cjs/use-keyboard/index.js +1 -15
- package/cjs/use-keyboard/use-keyboard.js +1 -76
- package/cjs/use-pagination/index.js +1 -88
- package/cjs/use-portal/index.js +1 -12
- package/cjs/use-portal/use-portal.js +1 -43
- package/cjs/use-real-shape/index.js +1 -12
- package/cjs/use-real-shape/use-real-shape.js +1 -55
- package/cjs/use-resize/index.js +1 -12
- package/cjs/use-resize/use-resize.js +1 -23
- package/cjs/use-ssr/index.js +1 -12
- package/cjs/use-ssr/use-ssr.js +1 -25
- package/cjs/use-theme/index.js +1 -12
- package/cjs/use-theme/use-theme.js +1 -16
- package/cjs/use-warning/index.js +1 -12
- package/cjs/use-warning/use-warning.js +1 -23
- package/cjs/user/index.js +1 -21
- package/cjs/user/user-link.js +1 -46
- package/cjs/user/user.js +1 -63
- package/cjs/user/user.styles.js +1 -56
- package/cjs/utils/assertion.js +1 -42
- package/cjs/utils/clear-icon.js +1 -70
- package/cjs/utils/clsx.js +1 -57
- package/cjs/utils/collections.js +1 -110
- package/cjs/utils/color.js +1 -187
- package/cjs/utils/css-transition.js +1 -76
- package/cjs/utils/deep-merge.js +1 -33
- package/cjs/utils/dimensions.js +1 -10
- package/cjs/utils/dom.js +1 -110
- package/cjs/utils/drip.js +1 -116
- package/cjs/utils/expand.js +1 -109
- package/cjs/utils/icons.js +1 -481
- package/cjs/utils/numbers.js +1 -23
- package/cjs/utils/object.js +1 -40
- package/cjs/utils/prop-types.js +1 -56
- package/cjs/utils/react.js +1 -24
- package/cjs/utils/strings.js +1 -18
- package/cjs/utils/types.d.js +1 -3
- package/cjs/utils/with-defaults.js +1 -13
- package/esm/avatar/avatar-group.js +1 -35
- package/esm/avatar/avatar-group.styles.js +1 -52
- package/esm/avatar/avatar.js +1 -75
- package/esm/avatar/avatar.styles.js +1 -334
- package/esm/avatar/index.js +1 -22
- package/esm/backdrop/backdrop.js +1 -137
- package/esm/backdrop/backdrop.styles.js +1 -119
- package/esm/backdrop/index.js +1 -16
- package/esm/button/button-group-context.js +1 -21
- package/esm/button/button-group.js +1 -81
- package/esm/button/button-group.styles.js +1 -136
- package/esm/button/button-icon.js +1 -68
- package/esm/button/button.js +1 -145
- package/esm/button/button.styles.js +1 -695
- package/esm/button/index.js +1 -25
- package/esm/button/utils.js +1 -27
- package/esm/card/card.js +1 -117
- package/esm/card/card.styles.js +1 -267
- package/esm/card/index.js +1 -24
- package/esm/checkbox/checkbox-context.js +1 -25
- package/esm/checkbox/checkbox-group.js +1 -89
- package/esm/checkbox/checkbox.js +1 -192
- package/esm/checkbox/checkbox.styles.js +1 -563
- package/esm/checkbox/index.js +1 -26
- package/esm/code/code.js +1 -42
- package/esm/code/code.styles.js +1 -14
- package/esm/code/index.js +1 -15
- package/esm/col/col.js +1 -46
- package/esm/col/col.styles.js +1 -16
- package/esm/col/index.js +1 -14
- package/esm/collapse/collapse-context.js +1 -20
- package/esm/collapse/collapse-group.js +1 -90
- package/esm/collapse/collapse-icon.js +1 -41
- package/esm/collapse/collapse.js +1 -190
- package/esm/collapse/collapse.styles.js +1 -254
- package/esm/collapse/index.js +1 -22
- package/esm/container/container.js +1 -91
- package/esm/container/container.styles.js +1 -45
- package/esm/container/index.js +1 -14
- package/esm/css-baseline/css-baseline.js +1 -247
- package/esm/css-baseline/index.js +1 -11
- package/esm/divider/divider.js +1 -82
- package/esm/divider/divider.styles.js +1 -77
- package/esm/divider/index.js +1 -15
- package/esm/grid/grid-container.js +1 -60
- package/esm/grid/grid-item.js +1 -123
- package/esm/grid/grid.js +1 -29
- package/esm/grid/grid.styles.js +1 -15
- package/esm/grid/index.js +1 -18
- package/esm/image/image.js +1 -150
- package/esm/image/image.skeleton.js +1 -50
- package/esm/image/image.styles.js +1 -57
- package/esm/image/index.js +1 -16
- package/esm/index.js +1 -435
- package/esm/input/index.js +1 -30
- package/esm/input/input-password.js +1 -80
- package/esm/input/input-props.js +1 -30
- package/esm/input/input.js +1 -317
- package/esm/input/input.styles.js +1 -878
- package/esm/input/password-icon.js +1 -51
- package/esm/link/icon.js +1 -42
- package/esm/link/index.js +1 -15
- package/esm/link/link.js +1 -42
- package/esm/link/link.styles.js +1 -135
- package/esm/loading/index.js +1 -24
- package/esm/loading/loading.js +1 -80
- package/esm/loading/loading.styles.js +1 -438
- package/esm/loading/spinner.js +1 -47
- package/esm/modal/index.js +1 -28
- package/esm/modal/modal-body.js +1 -62
- package/esm/modal/modal-close-button.js +1 -49
- package/esm/modal/modal-context.js +1 -18
- package/esm/modal/modal-footer.js +1 -69
- package/esm/modal/modal-header.js +1 -69
- package/esm/modal/modal-wrapper.js +1 -153
- package/esm/modal/modal.js +1 -159
- package/esm/modal/modal.styles.js +1 -243
- package/esm/modal/use-modal.js +1 -25
- package/esm/pagination/index.js +1 -19
- package/esm/pagination/pagination-ellipsis.js +1 -86
- package/esm/pagination/pagination-highlight.js +1 -52
- package/esm/pagination/pagination-icon.js +1 -59
- package/esm/pagination/pagination-item.js +1 -104
- package/esm/pagination/pagination.js +1 -169
- package/esm/pagination/pagination.styles.js +1 -361
- package/esm/progress/index.js +1 -15
- package/esm/progress/progress.js +1 -101
- package/esm/progress/progress.styles.js +1 -165
- package/esm/radio/index.js +1 -24
- package/esm/radio/radio-context.js +1 -24
- package/esm/radio/radio-group.js +1 -78
- package/esm/radio/radio.js +1 -156
- package/esm/radio/radio.styles.js +1 -240
- package/esm/row/index.js +1 -14
- package/esm/row/row.js +1 -54
- package/esm/row/row.styles.js +1 -25
- package/esm/snippet/index.js +1 -16
- package/esm/snippet/snippet-icon.js +1 -52
- package/esm/snippet/snippet.js +1 -137
- package/esm/snippet/snippet.styles.js +1 -141
- package/esm/spacer/index.js +1 -14
- package/esm/spacer/spacer.js +1 -49
- package/esm/spacer/spacer.styles.js +1 -24
- package/esm/switch/index.js +1 -17
- package/esm/switch/switch.js +1 -142
- package/esm/switch/switch.styles.js +1 -283
- package/esm/text/child.js +1 -83
- package/esm/text/index.js +1 -14
- package/esm/text/text.js +1 -124
- package/esm/text/text.styles.js +1 -41
- package/esm/textarea/index.js +1 -12
- package/esm/textarea/textarea.js +1 -126
- package/esm/textarea/utils.js +1 -126
- package/esm/theme/common.js +1 -490
- package/esm/theme/dark-theme.js +1 -38
- package/esm/theme/index.js +1 -31
- package/esm/theme/light-theme.js +1 -33
- package/esm/theme/stitches.config.js +1 -88
- package/esm/theme/theme-context.js +1 -22
- package/esm/theme/theme-provider.js +1 -115
- package/esm/theme/types.js +1 -3
- package/esm/theme/utils.js +1 -113
- package/esm/tooltip/index.js +1 -17
- package/esm/tooltip/placement.js +1 -193
- package/esm/tooltip/tooltip-content.js +1 -135
- package/esm/tooltip/tooltip.js +1 -141
- package/esm/tooltip/tooltip.styles.js +1 -159
- package/esm/use-body-scroll/index.js +1 -12
- package/esm/use-body-scroll/use-body-scroll.js +1 -77
- package/esm/use-click-anywhere/index.js +1 -12
- package/esm/use-click-anywhere/use-click-anywhere.js +1 -19
- package/esm/use-click-away/index.js +1 -12
- package/esm/use-click-away/use-click-away.js +1 -23
- package/esm/use-clipboard/index.js +1 -12
- package/esm/use-clipboard/use-clipboard.js +1 -57
- package/esm/use-current-state/index.js +1 -12
- package/esm/use-current-state/use-current-state.js +1 -28
- package/esm/use-drip/index.js +1 -12
- package/esm/use-drip/use-drip.js +1 -38
- package/esm/use-input/index.js +1 -12
- package/esm/use-input/use-input.js +1 -32
- package/esm/use-keyboard/codes.js +1 -104
- package/esm/use-keyboard/helper.js +1 -35
- package/esm/use-keyboard/index.js +1 -15
- package/esm/use-keyboard/use-keyboard.js +1 -76
- package/esm/use-pagination/index.js +1 -88
- package/esm/use-portal/index.js +1 -12
- package/esm/use-portal/use-portal.js +1 -43
- package/esm/use-real-shape/index.js +1 -12
- package/esm/use-real-shape/use-real-shape.js +1 -55
- package/esm/use-resize/index.js +1 -12
- package/esm/use-resize/use-resize.js +1 -23
- package/esm/use-ssr/index.js +1 -12
- package/esm/use-ssr/use-ssr.js +1 -25
- package/esm/use-theme/index.js +1 -12
- package/esm/use-theme/use-theme.js +1 -16
- package/esm/use-warning/index.js +1 -12
- package/esm/use-warning/use-warning.js +1 -23
- package/esm/user/index.js +1 -21
- package/esm/user/user-link.js +1 -46
- package/esm/user/user.js +1 -63
- package/esm/user/user.styles.js +1 -56
- package/esm/utils/assertion.js +1 -42
- package/esm/utils/clear-icon.js +1 -70
- package/esm/utils/clsx.js +1 -57
- package/esm/utils/collections.js +1 -110
- package/esm/utils/color.js +1 -187
- package/esm/utils/css-transition.js +1 -76
- package/esm/utils/deep-merge.js +1 -33
- package/esm/utils/dimensions.js +1 -10
- package/esm/utils/dom.js +1 -110
- package/esm/utils/drip.js +1 -116
- package/esm/utils/expand.js +1 -109
- package/esm/utils/icons.js +1 -481
- package/esm/utils/numbers.js +1 -23
- package/esm/utils/object.js +1 -40
- package/esm/utils/prop-types.js +1 -56
- package/esm/utils/react.js +1 -24
- package/esm/utils/strings.js +1 -18
- package/esm/utils/types.d.js +1 -3
- package/esm/utils/with-defaults.js +1 -13
- package/package.json +8 -3
- package/{cjs → types}/avatar/avatar-group.d.ts +0 -0
- package/{cjs → types}/avatar/avatar-group.styles.d.ts +82 -0
- package/{cjs → types}/avatar/avatar.d.ts +0 -0
- package/{esm → types}/avatar/avatar.styles.d.ts +41 -0
- package/{cjs → types}/avatar/index.d.ts +0 -0
- package/{cjs → types}/backdrop/backdrop.d.ts +1 -1
- package/{cjs → types}/backdrop/backdrop.styles.d.ts +123 -0
- package/{cjs → types}/backdrop/index.d.ts +0 -0
- package/{cjs → types}/button/button-group-context.d.ts +0 -0
- package/{cjs → types}/button/button-group.d.ts +0 -0
- package/{cjs → types}/button/button-group.styles.d.ts +41 -0
- package/{esm → types}/button/button-icon.d.ts +42 -0
- package/{cjs → types}/button/button.d.ts +1 -0
- package/{esm/backdrop/backdrop.styles.d.ts → types/button/button.styles.d.ts} +1286 -898
- package/{cjs → types}/button/index.d.ts +0 -0
- package/{cjs → types}/button/utils.d.ts +0 -0
- package/{cjs → types}/card/card.d.ts +0 -0
- package/{cjs → types}/card/card.styles.d.ts +164 -0
- package/{cjs → types}/card/index.d.ts +0 -0
- package/{cjs → types}/checkbox/checkbox-context.d.ts +0 -0
- package/{cjs → types}/checkbox/checkbox-group.d.ts +0 -0
- package/{cjs → types}/checkbox/checkbox.d.ts +0 -0
- package/{cjs → types}/checkbox/checkbox.styles.d.ts +369 -0
- package/{cjs → types}/checkbox/index.d.ts +0 -0
- package/{cjs → types}/code/code.d.ts +0 -0
- package/{esm → types}/code/code.styles.d.ts +82 -0
- package/{cjs → types}/code/index.d.ts +0 -0
- package/{cjs → types}/col/col.d.ts +0 -0
- package/{cjs → types}/col/col.styles.d.ts +41 -0
- package/{cjs → types}/col/index.d.ts +0 -0
- package/{cjs → types}/collapse/collapse-context.d.ts +0 -0
- package/{cjs → types}/collapse/collapse-group.d.ts +0 -0
- package/{cjs → types}/collapse/collapse-icon.d.ts +0 -0
- package/{esm → types}/collapse/collapse.d.ts +5 -3
- package/{esm → types}/collapse/collapse.styles.d.ts +205 -0
- package/{cjs → types}/collapse/index.d.ts +0 -0
- package/{cjs → types}/container/container.d.ts +0 -0
- package/{cjs → types}/container/container.styles.d.ts +41 -0
- package/{cjs → types}/container/index.d.ts +0 -0
- package/{cjs → types}/css-baseline/css-baseline.d.ts +0 -0
- package/{cjs → types}/css-baseline/index.d.ts +0 -0
- package/{cjs → types}/divider/divider.d.ts +0 -0
- package/{esm → types}/divider/divider.styles.d.ts +82 -0
- package/{cjs → types}/divider/index.d.ts +0 -0
- package/{cjs → types}/grid/grid-container.d.ts +0 -0
- package/{cjs → types}/grid/grid-item.d.ts +0 -0
- package/{cjs → types}/grid/grid.d.ts +0 -0
- package/{cjs → types}/grid/grid.styles.d.ts +82 -0
- package/{cjs → types}/grid/index.d.ts +0 -0
- package/{cjs → types}/image/image.d.ts +0 -0
- package/{cjs → types}/image/image.skeleton.d.ts +0 -0
- package/{esm → types}/image/image.styles.d.ts +123 -0
- package/{cjs → types}/image/index.d.ts +0 -0
- package/{cjs → types}/index.d.ts +0 -0
- package/{cjs → types}/input/index.d.ts +0 -0
- package/{cjs → types}/input/input-password.d.ts +0 -0
- package/{cjs → types}/input/input-props.d.ts +0 -0
- package/{cjs → types}/input/input.d.ts +0 -0
- package/{cjs → types}/input/input.styles.d.ts +451 -0
- package/{cjs → types}/input/password-icon.d.ts +0 -0
- package/{cjs → types}/link/icon.d.ts +0 -0
- package/{cjs → types}/link/index.d.ts +0 -0
- package/{cjs → types}/link/link.d.ts +1 -1
- package/{cjs → types}/link/link.styles.d.ts +83 -1
- package/{cjs → types}/loading/index.d.ts +0 -0
- package/{cjs → types}/loading/loading.d.ts +0 -0
- package/{esm → types}/loading/loading.styles.d.ts +246 -0
- package/{cjs → types}/loading/spinner.d.ts +0 -0
- package/{cjs → types}/modal/index.d.ts +0 -0
- package/{cjs → types}/modal/modal-body.d.ts +0 -0
- package/{cjs → types}/modal/modal-close-button.d.ts +0 -0
- package/{cjs → types}/modal/modal-context.d.ts +0 -0
- package/{cjs → types}/modal/modal-footer.d.ts +0 -0
- package/{cjs → types}/modal/modal-header.d.ts +0 -0
- package/{cjs → types}/modal/modal-wrapper.d.ts +0 -0
- package/{cjs → types}/modal/modal.d.ts +0 -0
- package/{cjs → types}/modal/modal.styles.d.ts +246 -0
- package/{cjs → types}/modal/use-modal.d.ts +0 -0
- package/{cjs → types}/pagination/index.d.ts +0 -0
- package/{cjs → types}/pagination/pagination-ellipsis.d.ts +0 -0
- package/{cjs → types}/pagination/pagination-highlight.d.ts +0 -0
- package/{cjs → types}/pagination/pagination-icon.d.ts +0 -0
- package/{cjs → types}/pagination/pagination-item.d.ts +0 -0
- package/{cjs → types}/pagination/pagination.d.ts +0 -0
- package/{esm → types}/pagination/pagination.styles.d.ts +246 -0
- package/{cjs → types}/progress/index.d.ts +0 -0
- package/{esm → types}/progress/progress.d.ts +1 -1
- package/{esm → types}/progress/progress.styles.d.ts +83 -1
- package/{cjs → types}/radio/index.d.ts +0 -0
- package/{cjs → types}/radio/radio-context.d.ts +0 -0
- package/{cjs → types}/radio/radio-group.d.ts +0 -0
- package/{cjs → types}/radio/radio.d.ts +0 -0
- package/{cjs → types}/radio/radio.styles.d.ts +246 -0
- package/{cjs → types}/row/index.d.ts +0 -0
- package/{cjs → types}/row/row.d.ts +0 -0
- package/{cjs → types}/row/row.styles.d.ts +41 -0
- package/{cjs → types}/snippet/index.d.ts +0 -0
- package/{cjs → types}/snippet/snippet-icon.d.ts +0 -0
- package/{cjs → types}/snippet/snippet.d.ts +0 -0
- package/{esm → types}/snippet/snippet.styles.d.ts +164 -0
- package/{cjs → types}/spacer/index.d.ts +0 -0
- package/{cjs → types}/spacer/spacer.d.ts +0 -0
- package/{cjs → types}/spacer/spacer.styles.d.ts +41 -0
- package/{cjs → types}/switch/index.d.ts +1 -1
- package/{cjs → types}/switch/switch.d.ts +0 -0
- package/{cjs → types}/switch/switch.styles.d.ts +164 -0
- package/{esm → types}/text/child.d.ts +2 -0
- package/{cjs → types}/text/index.d.ts +0 -0
- package/{cjs → types}/text/text.d.ts +3 -3
- package/{cjs → types}/text/text.styles.d.ts +41 -0
- package/{cjs → types}/textarea/index.d.ts +0 -0
- package/{cjs → types}/textarea/textarea.d.ts +0 -0
- package/{cjs → types}/textarea/utils.d.ts +0 -0
- package/{cjs → types}/theme/common.d.ts +76 -0
- package/{cjs → types}/theme/dark-theme.d.ts +10 -0
- package/{cjs → types}/theme/light-theme.d.ts +0 -0
- package/{cjs → types}/theme/stitches.config.d.ts +5411 -4087
- package/{cjs → types}/theme/theme-context.d.ts +0 -0
- package/{cjs → types}/theme/theme-provider.d.ts +0 -0
- package/{cjs → types}/theme/types.d.ts +1 -0
- package/{cjs → types}/theme/utils.d.ts +0 -0
- package/{cjs → types}/tooltip/index.d.ts +0 -0
- package/{cjs → types}/tooltip/placement.d.ts +0 -0
- package/{cjs → types}/tooltip/tooltip-content.d.ts +0 -0
- package/{esm → types}/tooltip/tooltip.d.ts +4 -1
- package/{esm → types}/tooltip/tooltip.styles.d.ts +164 -0
- package/{cjs → types}/use-body-scroll/index.d.ts +0 -0
- package/{cjs → types}/use-body-scroll/use-body-scroll.d.ts +0 -0
- package/{cjs → types}/use-click-anywhere/index.d.ts +0 -0
- package/{cjs → types}/use-click-anywhere/use-click-anywhere.d.ts +0 -0
- package/{cjs → types}/use-click-away/index.d.ts +0 -0
- package/{cjs → types}/use-click-away/use-click-away.d.ts +0 -0
- package/{cjs → types}/use-clipboard/index.d.ts +0 -0
- package/{cjs → types}/use-clipboard/use-clipboard.d.ts +0 -0
- package/{cjs → types}/use-current-state/index.d.ts +0 -0
- package/{cjs → types}/use-current-state/use-current-state.d.ts +0 -0
- package/{cjs → types}/use-drip/index.d.ts +0 -0
- package/{cjs → types}/use-drip/use-drip.d.ts +0 -0
- package/{cjs → types}/use-input/index.d.ts +0 -0
- package/{cjs → types}/use-input/use-input.d.ts +0 -0
- package/{cjs → types}/use-keyboard/codes.d.ts +0 -0
- package/{cjs → types}/use-keyboard/helper.d.ts +0 -0
- package/{cjs → types}/use-keyboard/index.d.ts +0 -0
- package/{cjs → types}/use-keyboard/use-keyboard.d.ts +0 -0
- package/{cjs → types}/use-pagination/index.d.ts +0 -0
- package/{cjs → types}/use-portal/index.d.ts +0 -0
- package/{cjs → types}/use-portal/use-portal.d.ts +0 -0
- package/{cjs → types}/use-real-shape/index.d.ts +0 -0
- package/{cjs → types}/use-real-shape/use-real-shape.d.ts +0 -0
- package/{cjs → types}/use-resize/index.d.ts +0 -0
- package/{cjs → types}/use-resize/use-resize.d.ts +0 -0
- package/{cjs → types}/use-ssr/index.d.ts +0 -0
- package/{cjs → types}/use-ssr/use-ssr.d.ts +0 -0
- package/{cjs → types}/use-theme/index.d.ts +0 -0
- package/{cjs → types}/use-theme/use-theme.d.ts +0 -0
- package/{cjs → types}/use-warning/index.d.ts +0 -0
- package/{cjs → types}/use-warning/use-warning.d.ts +0 -0
- package/{cjs → types}/user/index.d.ts +0 -0
- package/{cjs → types}/user/user-link.d.ts +0 -0
- package/{cjs → types}/user/user.d.ts +0 -0
- package/{cjs → types}/user/user.styles.d.ts +205 -0
- package/{cjs → types}/utils/assertion.d.ts +0 -0
- package/{cjs → types}/utils/clear-icon.d.ts +0 -0
- package/{cjs → types}/utils/clsx.d.ts +0 -0
- package/{cjs → types}/utils/collections.d.ts +0 -0
- package/{cjs → types}/utils/color.d.ts +0 -0
- package/{cjs → types}/utils/css-transition.d.ts +0 -0
- package/{cjs → types}/utils/deep-merge.d.ts +0 -0
- package/{cjs → types}/utils/dimensions.d.ts +0 -0
- package/{cjs → types}/utils/drip.d.ts +41 -0
- package/{cjs → types}/utils/expand.d.ts +0 -0
- package/{cjs → types}/utils/numbers.d.ts +0 -0
- package/{cjs → types}/utils/object.d.ts +0 -0
- package/{cjs → types}/utils/prop-types.d.ts +0 -0
- package/{cjs → types}/utils/with-defaults.d.ts +0 -0
- package/umd/nextui.js +4532 -602
- package/umd/nextui.min.js +1 -1
- package/cjs/avatar/avatar.styles.d.ts +0 -904
- package/cjs/button/button-icon.d.ts +0 -909
- package/cjs/button/button.styles.d.ts +0 -907
- package/cjs/code/code.styles.d.ts +0 -1782
- package/cjs/collapse/collapse.d.ts +0 -41
- package/cjs/collapse/collapse.styles.d.ts +0 -4472
- package/cjs/divider/divider.styles.d.ts +0 -1787
- package/cjs/image/image.styles.d.ts +0 -2676
- package/cjs/loading/loading.styles.d.ts +0 -5356
- package/cjs/pagination/pagination.styles.d.ts +0 -5369
- package/cjs/progress/progress.d.ts +0 -65
- package/cjs/progress/progress.styles.d.ts +0 -1793
- package/cjs/snippet/snippet.styles.d.ts +0 -3570
- package/cjs/text/child.d.ts +0 -21
- package/cjs/theme/ssr-provider.d.ts +0 -7
- package/cjs/theme/ssr-provider.js +0 -51
- package/cjs/tooltip/tooltip.d.ts +0 -56
- package/cjs/tooltip/tooltip.styles.d.ts +0 -3571
- package/esm/avatar/avatar-group.d.ts +0 -13
- package/esm/avatar/avatar-group.styles.d.ts +0 -1785
- package/esm/avatar/avatar.d.ts +0 -21
- package/esm/avatar/index.d.ts +0 -7
- package/esm/backdrop/backdrop.d.ts +0 -37
- package/esm/backdrop/index.d.ts +0 -5
- package/esm/button/button-group-context.d.ts +0 -20
- package/esm/button/button-group.d.ts +0 -34
- package/esm/button/button-group.styles.d.ts +0 -899
- package/esm/button/button.d.ts +0 -30
- package/esm/button/button.styles.d.ts +0 -907
- package/esm/button/index.d.ts +0 -10
- package/esm/button/utils.d.ts +0 -4
- package/esm/card/card.d.ts +0 -23
- package/esm/card/card.styles.d.ts +0 -3575
- package/esm/card/index.d.ts +0 -5
- package/esm/checkbox/checkbox-context.d.ts +0 -13
- package/esm/checkbox/checkbox-group.d.ts +0 -29
- package/esm/checkbox/checkbox.d.ts +0 -58
- package/esm/checkbox/checkbox.styles.d.ts +0 -8054
- package/esm/checkbox/index.d.ts +0 -6
- package/esm/code/code.d.ts +0 -15
- package/esm/code/index.d.ts +0 -5
- package/esm/col/col.d.ts +0 -20
- package/esm/col/col.styles.d.ts +0 -893
- package/esm/col/index.d.ts +0 -5
- package/esm/collapse/collapse-context.d.ts +0 -9
- package/esm/collapse/collapse-group.d.ts +0 -18
- package/esm/collapse/collapse-icon.d.ts +0 -19
- package/esm/collapse/index.d.ts +0 -6
- package/esm/container/container.d.ts +0 -40
- package/esm/container/container.styles.d.ts +0 -896
- package/esm/container/index.d.ts +0 -5
- package/esm/css-baseline/css-baseline.d.ts +0 -9
- package/esm/css-baseline/index.d.ts +0 -1
- package/esm/divider/divider.d.ts +0 -22
- package/esm/divider/index.d.ts +0 -5
- package/esm/grid/grid-container.d.ts +0 -22
- package/esm/grid/grid-item.d.ts +0 -37
- package/esm/grid/grid.d.ts +0 -9
- package/esm/grid/grid.styles.d.ts +0 -1783
- package/esm/grid/index.d.ts +0 -7
- package/esm/image/image.d.ts +0 -29
- package/esm/image/image.skeleton.d.ts +0 -19
- package/esm/image/index.d.ts +0 -5
- package/esm/index.d.ts +0 -79
- package/esm/input/index.d.ts +0 -7
- package/esm/input/input-password.d.ts +0 -98
- package/esm/input/input-props.d.ts +0 -66
- package/esm/input/input.d.ts +0 -18
- package/esm/input/input.styles.d.ts +0 -9854
- package/esm/input/password-icon.d.ts +0 -6
- package/esm/link/icon.d.ts +0 -4
- package/esm/link/index.d.ts +0 -5
- package/esm/link/link.d.ts +0 -43
- package/esm/link/link.styles.d.ts +0 -1788
- package/esm/loading/index.d.ts +0 -7
- package/esm/loading/loading.d.ts +0 -24
- package/esm/loading/spinner.d.ts +0 -17
- package/esm/modal/index.d.ts +0 -8
- package/esm/modal/modal-body.d.ts +0 -45
- package/esm/modal/modal-close-button.d.ts +0 -13
- package/esm/modal/modal-context.d.ts +0 -8
- package/esm/modal/modal-footer.d.ts +0 -24
- package/esm/modal/modal-header.d.ts +0 -24
- package/esm/modal/modal-wrapper.d.ts +0 -24
- package/esm/modal/modal.d.ts +0 -42
- package/esm/modal/modal.styles.d.ts +0 -5362
- package/esm/modal/use-modal.d.ts +0 -11
- package/esm/pagination/index.d.ts +0 -7
- package/esm/pagination/pagination-ellipsis.d.ts +0 -11
- package/esm/pagination/pagination-highlight.d.ts +0 -14
- package/esm/pagination/pagination-icon.d.ts +0 -16
- package/esm/pagination/pagination-item.d.ts +0 -22
- package/esm/pagination/pagination.d.ts +0 -46
- package/esm/progress/index.d.ts +0 -5
- package/esm/radio/index.d.ts +0 -4
- package/esm/radio/radio-context.d.ts +0 -13
- package/esm/radio/radio-group.d.ts +0 -30
- package/esm/radio/radio.d.ts +0 -45
- package/esm/radio/radio.styles.d.ts +0 -5357
- package/esm/row/index.d.ts +0 -5
- package/esm/row/row.d.ts +0 -21
- package/esm/row/row.styles.d.ts +0 -895
- package/esm/snippet/index.d.ts +0 -5
- package/esm/snippet/snippet-icon.d.ts +0 -21
- package/esm/snippet/snippet.d.ts +0 -35
- package/esm/spacer/index.d.ts +0 -5
- package/esm/spacer/spacer.d.ts +0 -41
- package/esm/spacer/spacer.styles.d.ts +0 -894
- package/esm/switch/index.d.ts +0 -5
- package/esm/switch/switch.d.ts +0 -82
- package/esm/switch/switch.styles.d.ts +0 -3576
- package/esm/text/index.d.ts +0 -4
- package/esm/text/text.d.ts +0 -59
- package/esm/text/text.styles.d.ts +0 -894
- package/esm/textarea/index.d.ts +0 -3
- package/esm/textarea/textarea.d.ts +0 -42
- package/esm/textarea/utils.d.ts +0 -13
- package/esm/theme/common.d.ts +0 -1584
- package/esm/theme/dark-theme.d.ts +0 -33
- package/esm/theme/light-theme.d.ts +0 -28
- package/esm/theme/ssr-provider.d.ts +0 -7
- package/esm/theme/ssr-provider.js +0 -51
- package/esm/theme/stitches.config.d.ts +0 -8700
- package/esm/theme/theme-context.d.ts +0 -5
- package/esm/theme/theme-provider.d.ts +0 -14
- package/esm/theme/types.d.ts +0 -75
- package/esm/theme/utils.d.ts +0 -16
- package/esm/tooltip/index.d.ts +0 -6
- package/esm/tooltip/placement.d.ts +0 -39
- package/esm/tooltip/tooltip-content.d.ts +0 -27
- package/esm/use-body-scroll/index.d.ts +0 -3
- package/esm/use-body-scroll/use-body-scroll.d.ts +0 -9
- package/esm/use-click-anywhere/index.d.ts +0 -2
- package/esm/use-click-anywhere/use-click-anywhere.d.ts +0 -2
- package/esm/use-click-away/index.d.ts +0 -2
- package/esm/use-click-away/use-click-away.d.ts +0 -3
- package/esm/use-clipboard/index.d.ts +0 -3
- package/esm/use-clipboard/use-clipboard.d.ts +0 -8
- package/esm/use-current-state/index.d.ts +0 -2
- package/esm/use-current-state/use-current-state.d.ts +0 -8
- package/esm/use-drip/index.d.ts +0 -2
- package/esm/use-drip/use-drip.d.ts +0 -9
- package/esm/use-input/index.d.ts +0 -2
- package/esm/use-input/use-input.d.ts +0 -13
- package/esm/use-keyboard/codes.d.ts +0 -92
- package/esm/use-keyboard/helper.d.ts +0 -3
- package/esm/use-keyboard/index.d.ts +0 -5
- package/esm/use-keyboard/use-keyboard.d.ts +0 -22
- package/esm/use-pagination/index.d.ts +0 -20
- package/esm/use-portal/index.d.ts +0 -2
- package/esm/use-portal/use-portal.d.ts +0 -2
- package/esm/use-real-shape/index.d.ts +0 -2
- package/esm/use-real-shape/use-real-shape.d.ts +0 -9
- package/esm/use-resize/index.d.ts +0 -2
- package/esm/use-resize/use-resize.d.ts +0 -2
- package/esm/use-ssr/index.d.ts +0 -2
- package/esm/use-ssr/use-ssr.d.ts +0 -6
- package/esm/use-theme/index.d.ts +0 -2
- package/esm/use-theme/use-theme.d.ts +0 -3
- package/esm/use-warning/index.d.ts +0 -2
- package/esm/use-warning/use-warning.d.ts +0 -2
- package/esm/user/index.d.ts +0 -6
- package/esm/user/user-link.d.ts +0 -32
- package/esm/user/user.d.ts +0 -35
- package/esm/user/user.styles.d.ts +0 -4456
- package/esm/utils/assertion.d.ts +0 -8
- package/esm/utils/clear-icon.d.ts +0 -16
- package/esm/utils/clsx.d.ts +0 -1
- package/esm/utils/collections.d.ts +0 -12
- package/esm/utils/color.d.ts +0 -28
- package/esm/utils/css-transition.d.ts +0 -27
- package/esm/utils/deep-merge.d.ts +0 -1
- package/esm/utils/dimensions.d.ts +0 -1
- package/esm/utils/drip.d.ts +0 -936
- package/esm/utils/expand.d.ts +0 -20
- package/esm/utils/numbers.d.ts +0 -9
- package/esm/utils/object.d.ts +0 -11
- package/esm/utils/prop-types.d.ts +0 -54
- package/esm/utils/with-defaults.d.ts +0 -3
package/cjs/utils/collections.js
CHANGED
|
@@ -1,110 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.setChildrenIndex = exports.pickChild = exports.pick = exports.isMac = exports.isChildElement = exports.isBrowser = exports.hasChild = exports.getId = exports.flattenArray = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
const getId = () => {
|
|
11
|
-
return Math.random().toString(32).slice(2, 10);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
exports.getId = getId;
|
|
15
|
-
|
|
16
|
-
const hasChild = (children, child) => {
|
|
17
|
-
const types = _react.default.Children.map(children, item => {
|
|
18
|
-
if (! /*#__PURE__*/_react.default.isValidElement(item)) return null;
|
|
19
|
-
return item.type;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
return (types || []).includes(child);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
exports.hasChild = hasChild;
|
|
26
|
-
|
|
27
|
-
const pick = (props, obj) => props.reduce((acc, prop) => {
|
|
28
|
-
acc[prop] = obj[prop];
|
|
29
|
-
return acc;
|
|
30
|
-
}, {});
|
|
31
|
-
|
|
32
|
-
exports.pick = pick;
|
|
33
|
-
|
|
34
|
-
const pickChild = (children, targetChild) => {
|
|
35
|
-
let target = [];
|
|
36
|
-
|
|
37
|
-
const withoutTargetChildren = _react.default.Children.map(children, item => {
|
|
38
|
-
if (! /*#__PURE__*/_react.default.isValidElement(item)) return item;
|
|
39
|
-
|
|
40
|
-
if (item.type === targetChild) {
|
|
41
|
-
target.push(item);
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return item;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const targetChildren = target.length >= 0 ? target : undefined;
|
|
49
|
-
return [withoutTargetChildren, targetChildren];
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
exports.pickChild = pickChild;
|
|
53
|
-
|
|
54
|
-
const isChildElement = (parent, child) => {
|
|
55
|
-
if (!parent || !child) return false; // eslint-disable-next-line no-undef
|
|
56
|
-
|
|
57
|
-
let node = child;
|
|
58
|
-
|
|
59
|
-
while (node) {
|
|
60
|
-
if (node === parent) return true;
|
|
61
|
-
node = node.parentNode;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return false;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
exports.isChildElement = isChildElement;
|
|
68
|
-
|
|
69
|
-
const isBrowser = () => {
|
|
70
|
-
return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
exports.isBrowser = isBrowser;
|
|
74
|
-
|
|
75
|
-
const isMac = () => {
|
|
76
|
-
if (!isBrowser()) return false;
|
|
77
|
-
return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
exports.isMac = isMac;
|
|
81
|
-
|
|
82
|
-
const setChildrenIndex = (children, targetComponents = []) => {
|
|
83
|
-
if (_react.default.Children.count(children) === 0) return [];
|
|
84
|
-
const allowAll = targetComponents.length === 0;
|
|
85
|
-
|
|
86
|
-
const clone = (child, props = {}) => /*#__PURE__*/_react.default.cloneElement(child, props);
|
|
87
|
-
|
|
88
|
-
let index = 0;
|
|
89
|
-
return _react.default.Children.map(children, item => {
|
|
90
|
-
if (! /*#__PURE__*/_react.default.isValidElement(item)) return item;
|
|
91
|
-
index = index + 1;
|
|
92
|
-
if (allowAll) return clone(item, {
|
|
93
|
-
index
|
|
94
|
-
});
|
|
95
|
-
const isAllowed = targetComponents.find(child => child === item.type);
|
|
96
|
-
if (isAllowed) return clone(item, {
|
|
97
|
-
index
|
|
98
|
-
});
|
|
99
|
-
index = index - 1;
|
|
100
|
-
return item;
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
exports.setChildrenIndex = setChildrenIndex;
|
|
105
|
-
|
|
106
|
-
const flattenArray = arr => {
|
|
107
|
-
return arr.reduce((acc, val) => acc.concat(Array.isArray(val) ? flattenArray(val) : val), []);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
exports.flattenArray = flattenArray;
|
|
1
|
+
var e=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.setChildrenIndex=exports.pickChild=exports.pick=exports.isMac=exports.isChildElement=exports.isBrowser=exports.hasChild=exports.getId=exports.flattenArray=void 0;var t=e(require("react"));exports.getId=()=>Math.random().toString(32).slice(2,10);exports.hasChild=(e,r)=>(t.default.Children.map(e,(e=>t.default.isValidElement(e)?e.type:null))||[]).includes(r);exports.pick=(e,t)=>e.reduce(((e,r)=>(e[r]=t[r],e)),{});exports.pickChild=(e,r)=>{let n=[];return[t.default.Children.map(e,(e=>t.default.isValidElement(e)&&e.type===r?(n.push(e),null):e)),n.length>=0?n:void 0]};exports.isChildElement=(e,t)=>{if(!e||!t)return!1;let r=t;for(;r;){if(r===e)return!0;r=r.parentNode}return!1};const r=()=>Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);exports.isBrowser=r;exports.isMac=()=>!!r()&&navigator.platform.toUpperCase().indexOf("MAC")>=0;exports.setChildrenIndex=(e,r=[])=>{if(0===t.default.Children.count(e))return[];const n=0===r.length,i=(e,r={})=>t.default.cloneElement(e,r);let l=0;return t.default.Children.map(e,(e=>{if(!t.default.isValidElement(e))return e;if(l+=1,n)return i(e,{index:l});return r.find((t=>t===e.type))?i(e,{index:l}):(l-=1,e)}))};const n=e=>e.reduce(((e,t)=>e.concat(Array.isArray(t)?n(t):t)),[]);exports.flattenArray=n;
|
package/cjs/utils/color.js
CHANGED
|
@@ -1,187 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.isNormalColor = exports.isHex = exports.isCssVar = exports.isColor = exports.invertHex = exports.hexToRgb = exports.hexToRGBA = exports.hexFromString = exports.getCssVar = exports.colorToRgbValues = exports.addColorAlpha = void 0;
|
|
5
|
-
|
|
6
|
-
var _propTypes = require("./prop-types");
|
|
7
|
-
|
|
8
|
-
const getCssVar = name => {
|
|
9
|
-
if (typeof document !== 'undefined' || !name) {
|
|
10
|
-
const property = isCssVar(name) ? name.replace('var(', '').replace(')', '') : `--${name}`;
|
|
11
|
-
return getComputedStyle(document.documentElement).getPropertyValue(property);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return '';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.getCssVar = getCssVar;
|
|
18
|
-
|
|
19
|
-
const isCssVar = property => {
|
|
20
|
-
return property && (property == null ? void 0 : property.indexOf('var(')) === 0 ? true : false;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* This function allows validate if a string is a hexadecimal
|
|
24
|
-
* value
|
|
25
|
-
* @param str [string] hexadecimal value
|
|
26
|
-
* @returns result [boolean]
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.isCssVar = isCssVar;
|
|
31
|
-
|
|
32
|
-
const isHex = str => {
|
|
33
|
-
const exp = /#[a-fA-F0-9]{3,6}/g;
|
|
34
|
-
return exp.test(str);
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @param hex [string]
|
|
39
|
-
* @param alpha [number]
|
|
40
|
-
* @returns [string]
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
exports.isHex = isHex;
|
|
45
|
-
|
|
46
|
-
const hexToRGBA = (hex, alpha = 1) => {
|
|
47
|
-
let r = 0,
|
|
48
|
-
g = 0,
|
|
49
|
-
b = 0; // 3 digits
|
|
50
|
-
|
|
51
|
-
if (hex.length == 4) {
|
|
52
|
-
r = '0x' + hex[1] + hex[1];
|
|
53
|
-
g = '0x' + hex[2] + hex[2];
|
|
54
|
-
b = '0x' + hex[3] + hex[3]; // 6 digits
|
|
55
|
-
} else if (hex.length == 7) {
|
|
56
|
-
r = '0x' + hex[1] + hex[2];
|
|
57
|
-
g = '0x' + hex[3] + hex[4];
|
|
58
|
-
b = '0x' + hex[5] + hex[6];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return `rgba(${+r}, ${+g},${+b},${alpha})`;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
exports.hexToRGBA = hexToRGBA;
|
|
65
|
-
|
|
66
|
-
const isNormalColor = color => {
|
|
67
|
-
let found = _propTypes.normalColors.find(el => el === color);
|
|
68
|
-
|
|
69
|
-
return found !== undefined && found !== null;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Function that checks color name support in the current browser
|
|
73
|
-
* @param strColor
|
|
74
|
-
* @returns boolean
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
exports.isNormalColor = isNormalColor;
|
|
79
|
-
|
|
80
|
-
const isColor = strColor => {
|
|
81
|
-
let s = new Option().style;
|
|
82
|
-
s.color = strColor;
|
|
83
|
-
return s.color == strColor;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
exports.isColor = isColor;
|
|
87
|
-
|
|
88
|
-
const hexToRgb = color => {
|
|
89
|
-
const fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
90
|
-
const full = color.replace(fullReg, (_, r, g, b) => `${r}${r}${g}${g}${b}${b}`);
|
|
91
|
-
const values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
|
|
92
|
-
|
|
93
|
-
if (!values) {
|
|
94
|
-
throw new Error(`Next UI: Unsupported ${color} color.`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
exports.hexToRgb = hexToRgb;
|
|
101
|
-
|
|
102
|
-
const hexFromString = (str, defaultColor = '', returnLast = false) => {
|
|
103
|
-
const fullReg = /#[a-fA-F0-9]{6}|#[a-fA-F0-9]{3}$/g;
|
|
104
|
-
const hexCodes = str.match(fullReg);
|
|
105
|
-
|
|
106
|
-
if (hexCodes && hexCodes.length > 0) {
|
|
107
|
-
return returnLast ? hexCodes[hexCodes.length - 1] : hexCodes;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return defaultColor;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
exports.hexFromString = hexFromString;
|
|
114
|
-
|
|
115
|
-
const colorToRgbValues = colorProp => {
|
|
116
|
-
const color = isCssVar(colorProp) ? getCssVar(colorProp) : colorProp;
|
|
117
|
-
if (color.charAt(0) === '#') return hexToRgb(color);
|
|
118
|
-
const safeColor = color.replace(/ /g, '');
|
|
119
|
-
const colorType = color.substr(0, 4);
|
|
120
|
-
const regArray = safeColor.match(/\((.+)\)/);
|
|
121
|
-
|
|
122
|
-
if (!colorType.startsWith('rgb') || !regArray) {
|
|
123
|
-
throw new Error(`Next UI: Only support ["RGB", "RGBA", "HEX"] color.`);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return regArray[1].split(',').map(str => Number.parseFloat(str));
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
exports.colorToRgbValues = colorToRgbValues;
|
|
130
|
-
|
|
131
|
-
const addColorAlpha = (colorProp, alpha = 1) => {
|
|
132
|
-
if (!colorProp) return '';
|
|
133
|
-
const color = isCssVar(colorProp) ? getCssVar(colorProp) : colorProp;
|
|
134
|
-
|
|
135
|
-
if (isHex(color)) {
|
|
136
|
-
return hexToRGBA(color, alpha);
|
|
137
|
-
} else if (!/^#|rgb|RGB/.test(color)) {
|
|
138
|
-
return color;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const [r, g, b] = colorToRgbValues(color);
|
|
142
|
-
const safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
|
|
143
|
-
return `rgba(${r}, ${g}, ${b}, ${safeAlpha})`;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
exports.addColorAlpha = addColorAlpha;
|
|
147
|
-
|
|
148
|
-
function padZero(str, len) {
|
|
149
|
-
len = len || 2;
|
|
150
|
-
var zeros = new Array(len).join('0');
|
|
151
|
-
return (zeros + str).slice(-len);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const invertHex = (hexProp, smooth = true) => {
|
|
155
|
-
let hex = isCssVar(hexProp) ? getCssVar(hexProp) : hexProp;
|
|
156
|
-
|
|
157
|
-
if (hex.indexOf('#') === 0) {
|
|
158
|
-
hex = hex.slice(1);
|
|
159
|
-
} // convert 3-digit hex to 6-digits.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (hex.length === 3) {
|
|
163
|
-
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (hex.length !== 6) {
|
|
167
|
-
return hexProp;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
let r = parseInt(hex.slice(0, 2), 16),
|
|
171
|
-
g = parseInt(hex.slice(2, 4), 16),
|
|
172
|
-
b = parseInt(hex.slice(4, 6), 16);
|
|
173
|
-
|
|
174
|
-
if (smooth) {
|
|
175
|
-
// http://stackoverflow.com/a/3943023/112731
|
|
176
|
-
return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF';
|
|
177
|
-
} // invert color components
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
r = 255 - r;
|
|
181
|
-
g = 255 - g;
|
|
182
|
-
b = 255 - b; // pad each with zeros and return
|
|
183
|
-
|
|
184
|
-
return '#' + padZero(r.toString(16)) + padZero(g.toString(16)) + padZero(b.toString(16));
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
exports.invertHex = invertHex;
|
|
1
|
+
exports.__esModule=!0,exports.isNormalColor=exports.isHex=exports.isCssVar=exports.isColor=exports.invertHex=exports.hexToRgb=exports.hexToRGBA=exports.hexFromString=exports.getCssVar=exports.colorToRgbValues=exports.addColorAlpha=void 0;var r=require("./prop-types");const e=r=>{if("undefined"!=typeof document||!r){const e=t(r)?r.replace("var(","").replace(")",""):`--${r}`;return getComputedStyle(document.documentElement).getPropertyValue(e)}return""};exports.getCssVar=e;const t=r=>!(!r||0!==(null==r?void 0:r.indexOf("var(")));exports.isCssVar=t;const o=r=>/#[a-fA-F0-9]{3,6}/g.test(r);exports.isHex=o;const s=(r,e=1)=>{let t=0,o=0,s=0;return 4==r.length?(t="0x"+r[1]+r[1],o="0x"+r[2]+r[2],s="0x"+r[3]+r[3]):7==r.length&&(t="0x"+r[1]+r[2],o="0x"+r[3]+r[4],s="0x"+r[5]+r[6]),`rgba(${+t}, ${+o},${+s},${e})`};exports.hexToRGBA=s;exports.isNormalColor=e=>{let t=r.normalColors.find((r=>r===e));return null!=t};exports.isColor=r=>{let e=(new Option).style;return e.color=r,e.color==r};const n=r=>{const e=r.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((r,e,t,o)=>`${e}${e}${t}${t}${o}${o}`)),t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)throw new Error(`Next UI: Unsupported ${r} color.`);return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)]};exports.hexToRgb=n;exports.hexFromString=(r,e="",t=!1)=>{const o=r.match(/#[a-fA-F0-9]{6}|#[a-fA-F0-9]{3}$/g);return o&&o.length>0?t?o[o.length-1]:o:e};const l=r=>{const o=t(r)?e(r):r;if("#"===o.charAt(0))return n(o);const s=o.replace(/ /g,""),l=o.substr(0,4),p=s.match(/\((.+)\)/);if(!l.startsWith("rgb")||!p)throw new Error('Next UI: Only support ["RGB", "RGBA", "HEX"] color.');return p[1].split(",").map((r=>Number.parseFloat(r)))};exports.colorToRgbValues=l;function p(r,e){return e=e||2,(new Array(e).join("0")+r).slice(-e)}exports.addColorAlpha=(r,n=1)=>{if(!r)return"";const p=t(r)?e(r):r;if(o(p))return s(p,n);if(!/^#|rgb|RGB/.test(p))return p;const[a,x,i]=l(p);return`rgba(${a}, ${x}, ${i}, ${n>1?1:n<0?0:n})`};exports.invertHex=(r,o=!0)=>{let s=t(r)?e(r):r;if(0===s.indexOf("#")&&(s=s.slice(1)),3===s.length&&(s=s[0]+s[0]+s[1]+s[1]+s[2]+s[2]),6!==s.length)return r;let n=parseInt(s.slice(0,2),16),l=parseInt(s.slice(2,4),16),a=parseInt(s.slice(4,6),16);return o?.299*n+.587*l+.114*a>186?"#000000":"#FFFFFF":(n=255-n,l=255-l,a=255-a,"#"+p(n.toString(16))+p(l.toString(16))+p(a.toString(16)))};
|
|
@@ -1,76 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _withDefaults = _interopRequireDefault(require("../utils/with-defaults"));
|
|
11
|
-
|
|
12
|
-
var _clsx = _interopRequireDefault(require("../utils/clsx"));
|
|
13
|
-
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
|
-
const defaultProps = {
|
|
19
|
-
visible: false,
|
|
20
|
-
enterTime: 60,
|
|
21
|
-
leaveTime: 60,
|
|
22
|
-
clearTime: 60,
|
|
23
|
-
className: '',
|
|
24
|
-
name: 'transition'
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const CSSTransition = ({
|
|
28
|
-
children,
|
|
29
|
-
className,
|
|
30
|
-
visible,
|
|
31
|
-
enterTime,
|
|
32
|
-
leaveTime,
|
|
33
|
-
clearTime,
|
|
34
|
-
name,
|
|
35
|
-
...props
|
|
36
|
-
}) => {
|
|
37
|
-
const [classes, setClasses] = (0, _react.useState)('');
|
|
38
|
-
const [renderable, setRenderable] = (0, _react.useState)(visible);
|
|
39
|
-
(0, _react.useEffect)(() => {
|
|
40
|
-
const statusClassName = visible ? 'enter' : 'leave';
|
|
41
|
-
const time = visible ? enterTime : leaveTime;
|
|
42
|
-
|
|
43
|
-
if (visible && !renderable) {
|
|
44
|
-
setRenderable(true);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
setClasses(`${name}-${statusClassName}`); // set class to active
|
|
48
|
-
|
|
49
|
-
const timer = setTimeout(() => {
|
|
50
|
-
setClasses(`${name}-${statusClassName} ${name}-${statusClassName}-active`);
|
|
51
|
-
clearTimeout(timer);
|
|
52
|
-
}, time); // remove classess when animation over
|
|
53
|
-
|
|
54
|
-
const clearClassesTimer = setTimeout(() => {
|
|
55
|
-
if (!visible) {
|
|
56
|
-
setClasses('');
|
|
57
|
-
setRenderable(false);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
clearTimeout(clearClassesTimer);
|
|
61
|
-
}, time + clearTime);
|
|
62
|
-
return () => {
|
|
63
|
-
clearTimeout(timer);
|
|
64
|
-
clearTimeout(clearClassesTimer);
|
|
65
|
-
};
|
|
66
|
-
}, [visible, renderable]);
|
|
67
|
-
if (! /*#__PURE__*/_react.default.isValidElement(children) || !renderable) return null;
|
|
68
|
-
return /*#__PURE__*/_react.default.cloneElement(children, { ...props,
|
|
69
|
-
className: (0, _clsx.default)(children.props.className, className, classes)
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
var _default = (0, _withDefaults.default)(CSSTransition, defaultProps);
|
|
74
|
-
|
|
75
|
-
exports.default = _default;
|
|
76
|
-
module.exports = exports.default;
|
|
1
|
+
var e=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.default=void 0;var t=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var a={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var n=u?Object.getOwnPropertyDescriptor(e,i):null;n&&(n.get||n.set)?Object.defineProperty(a,i,n):a[i]=e[i]}a.default=e,r&&r.set(e,a);return a}(require("react")),r=e(require("../utils/with-defaults")),a=e(require("../utils/clsx"));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}var u=(0,r.default)((({children:e,className:r,visible:l,enterTime:u,leaveTime:i,clearTime:n,name:o,...s})=>{const[c,f]=(0,t.useState)(""),[p,m]=(0,t.useState)(l);return(0,t.useEffect)((()=>{const e=l?"enter":"leave",t=l?u:i;l&&!p&&m(!0),f(`${o}-${e}`);const r=setTimeout((()=>{f(`${o}-${e} ${o}-${e}-active`),clearTimeout(r)}),t),a=setTimeout((()=>{l||(f(""),m(!1)),clearTimeout(a)}),t+n);return()=>{clearTimeout(r),clearTimeout(a)}}),[l,p]),t.default.isValidElement(e)&&p?t.default.cloneElement(e,{...s,className:(0,a.default)(e.props.className,r,c)}):null}),{visible:!1,enterTime:60,leaveTime:60,clearTime:60,className:"",name:"transition"});exports.default=u,module.exports=exports.default;
|
package/cjs/utils/deep-merge.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = deepMerge;
|
|
5
|
-
|
|
6
|
-
function deepMerge(result) {
|
|
7
|
-
var stack = Array.prototype.slice.call(arguments, 1);
|
|
8
|
-
var item;
|
|
9
|
-
var key;
|
|
10
|
-
|
|
11
|
-
while (stack.length) {
|
|
12
|
-
item = stack.shift();
|
|
13
|
-
|
|
14
|
-
for (key in item) {
|
|
15
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
16
|
-
if (item.hasOwnProperty(key)) {
|
|
17
|
-
if (typeof result[key] === 'object' && result[key] && Object.prototype.toString.call(result[key]) !== '[object Array]') {
|
|
18
|
-
if (typeof item[key] === 'object' && item[key] !== null) {
|
|
19
|
-
result[key] = deepMerge({}, result[key], item[key]);
|
|
20
|
-
} else {
|
|
21
|
-
result[key] = item[key];
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
result[key] = item[key];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = exports.default;
|
|
1
|
+
exports.__esModule=!0,exports.default=function t(e){var o,r,l=Array.prototype.slice.call(arguments,1);for(;l.length;)for(r in o=l.shift())o.hasOwnProperty(r)&&("object"==typeof e[r]&&e[r]&&"[object Array]"!==Object.prototype.toString.call(e[r])&&"object"==typeof o[r]&&null!==o[r]?e[r]=t({},e[r],o[r]):e[r]=o[r]);return e},module.exports=exports.default;
|
package/cjs/utils/dimensions.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.getMargin = void 0;
|
|
5
|
-
|
|
6
|
-
const getMargin = num => {
|
|
7
|
-
return `calc(${num * 15.25}pt + 1px * ${num - 1})`;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
exports.getMargin = getMargin;
|
|
1
|
+
exports.__esModule=!0,exports.getMargin=void 0;exports.getMargin=e=>`calc(${15.25*e}pt + 1px * ${e-1})`;
|
package/cjs/utils/dom.js
CHANGED
|
@@ -1,110 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.canUseDOM = canUseDOM;
|
|
5
|
-
exports.detectBrowser = detectBrowser;
|
|
6
|
-
exports.detectDeviceType = detectDeviceType;
|
|
7
|
-
exports.detectOS = detectOS;
|
|
8
|
-
exports.detectTouch = detectTouch;
|
|
9
|
-
exports.isBrowser = void 0;
|
|
10
|
-
|
|
11
|
-
function canUseDOM() {
|
|
12
|
-
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const isBrowser = canUseDOM();
|
|
16
|
-
exports.isBrowser = isBrowser;
|
|
17
|
-
|
|
18
|
-
function getUserAgentBrowser(navigator) {
|
|
19
|
-
const {
|
|
20
|
-
userAgent: ua,
|
|
21
|
-
vendor
|
|
22
|
-
} = navigator;
|
|
23
|
-
const android = /(android)/i.test(ua);
|
|
24
|
-
|
|
25
|
-
switch (true) {
|
|
26
|
-
case /CriOS/.test(ua):
|
|
27
|
-
return 'Chrome for iOS';
|
|
28
|
-
|
|
29
|
-
case /Edg\//.test(ua):
|
|
30
|
-
return 'Edge';
|
|
31
|
-
|
|
32
|
-
case android && /Silk\//.test(ua):
|
|
33
|
-
return 'Silk';
|
|
34
|
-
|
|
35
|
-
case /Chrome/.test(ua) && /Google Inc/.test(vendor):
|
|
36
|
-
return 'Chrome';
|
|
37
|
-
|
|
38
|
-
case /Firefox\/\d+\.\d+$/.test(ua):
|
|
39
|
-
return 'Firefox';
|
|
40
|
-
|
|
41
|
-
case android:
|
|
42
|
-
return 'AOSP';
|
|
43
|
-
|
|
44
|
-
case /MSIE|Trident/.test(ua):
|
|
45
|
-
return 'IE';
|
|
46
|
-
|
|
47
|
-
case /Safari/.test(navigator.userAgent) && /Apple Computer/.test(ua):
|
|
48
|
-
return 'Safari';
|
|
49
|
-
|
|
50
|
-
case /AppleWebKit/.test(ua):
|
|
51
|
-
return 'WebKit';
|
|
52
|
-
|
|
53
|
-
default:
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function getUserAgentOS(navigator) {
|
|
59
|
-
const {
|
|
60
|
-
userAgent: ua,
|
|
61
|
-
platform
|
|
62
|
-
} = navigator;
|
|
63
|
-
|
|
64
|
-
switch (true) {
|
|
65
|
-
case /Android/.test(ua):
|
|
66
|
-
return 'Android';
|
|
67
|
-
|
|
68
|
-
case /iPhone|iPad|iPod/.test(platform):
|
|
69
|
-
return 'iOS';
|
|
70
|
-
|
|
71
|
-
case /Win/.test(platform):
|
|
72
|
-
return 'Windows';
|
|
73
|
-
|
|
74
|
-
case /Mac/.test(platform):
|
|
75
|
-
return 'Mac';
|
|
76
|
-
|
|
77
|
-
case /CrOS/.test(ua):
|
|
78
|
-
return 'Chrome OS';
|
|
79
|
-
|
|
80
|
-
case /Firefox/.test(ua):
|
|
81
|
-
return 'Firefox OS';
|
|
82
|
-
|
|
83
|
-
default:
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function detectDeviceType(navigator) {
|
|
89
|
-
const {
|
|
90
|
-
userAgent: ua
|
|
91
|
-
} = navigator;
|
|
92
|
-
if (/(tablet)|(iPad)|(Nexus 9)/i.test(ua)) return 'tablet';
|
|
93
|
-
if (/(mobi)/i.test(ua)) return 'phone';
|
|
94
|
-
return 'desktop';
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function detectOS(os) {
|
|
98
|
-
if (!isBrowser) return false;
|
|
99
|
-
return getUserAgentOS(window.navigator) === os;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function detectBrowser(browser) {
|
|
103
|
-
if (!isBrowser) return false;
|
|
104
|
-
return getUserAgentBrowser(window.navigator) === browser;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function detectTouch() {
|
|
108
|
-
if (!isBrowser) return false;
|
|
109
|
-
return window.ontouchstart === null && window.ontouchmove === null && window.ontouchend === null;
|
|
110
|
-
}
|
|
1
|
+
function e(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}exports.__esModule=!0,exports.canUseDOM=e,exports.detectBrowser=function(e){return!!t&&function(e){const{userAgent:t,vendor:r}=e,n=/(android)/i.test(t);switch(!0){case/CriOS/.test(t):return"Chrome for iOS";case/Edg\//.test(t):return"Edge";case n&&/Silk\//.test(t):return"Silk";case/Chrome/.test(t)&&/Google Inc/.test(r):return"Chrome";case/Firefox\/\d+\.\d+$/.test(t):return"Firefox";case n:return"AOSP";case/MSIE|Trident/.test(t):return"IE";case/Safari/.test(e.userAgent)&&/Apple Computer/.test(t):return"Safari";case/AppleWebKit/.test(t):return"WebKit";default:return null}}(window.navigator)===e},exports.detectDeviceType=function(e){const{userAgent:t}=e;return/(tablet)|(iPad)|(Nexus 9)/i.test(t)?"tablet":/(mobi)/i.test(t)?"phone":"desktop"},exports.detectOS=function(e){return!!t&&function(e){const{userAgent:t,platform:r}=e;switch(!0){case/Android/.test(t):return"Android";case/iPhone|iPad|iPod/.test(r):return"iOS";case/Win/.test(r):return"Windows";case/Mac/.test(r):return"Mac";case/CrOS/.test(t):return"Chrome OS";case/Firefox/.test(t):return"Firefox OS";default:return null}}(window.navigator)===e},exports.detectTouch=function(){return!!t&&(null===window.ontouchstart&&null===window.ontouchmove&&null===window.ontouchend)},exports.isBrowser=void 0;const t=e();exports.isBrowser=t;
|
package/cjs/utils/drip.js
CHANGED
|
@@ -1,116 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = exports.StyledDrip = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _stitches = require("../theme/stitches.config");
|
|
11
|
-
|
|
12
|
-
var _withDefaults = _interopRequireDefault(require("../utils/with-defaults"));
|
|
13
|
-
|
|
14
|
-
var _clsx = _interopRequireDefault(require("../utils/clsx"));
|
|
15
|
-
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
const defaultProps = {
|
|
23
|
-
visible: false,
|
|
24
|
-
x: 0,
|
|
25
|
-
y: 0,
|
|
26
|
-
className: ''
|
|
27
|
-
};
|
|
28
|
-
const expand = (0, _stitches.keyframes)({
|
|
29
|
-
'0%': {
|
|
30
|
-
opacity: 0,
|
|
31
|
-
transform: 'scale(0.25)'
|
|
32
|
-
},
|
|
33
|
-
'30%': {
|
|
34
|
-
opacity: 1
|
|
35
|
-
},
|
|
36
|
-
'80%': {
|
|
37
|
-
opacity: 0.5
|
|
38
|
-
},
|
|
39
|
-
'100%': {
|
|
40
|
-
transform: 'scale(28)',
|
|
41
|
-
opacity: 0
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const StyledDrip = (0, _stitches.styled)('div', {
|
|
45
|
-
position: 'absolute',
|
|
46
|
-
left: 0,
|
|
47
|
-
right: 0,
|
|
48
|
-
top: 0,
|
|
49
|
-
bottom: 0,
|
|
50
|
-
'& svg': {
|
|
51
|
-
position: 'absolute',
|
|
52
|
-
animation: `350ms linear ${expand}`,
|
|
53
|
-
animationFillMode: 'forwards',
|
|
54
|
-
width: '$md',
|
|
55
|
-
height: '$md'
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
exports.StyledDrip = StyledDrip;
|
|
59
|
-
|
|
60
|
-
const Drip = ({
|
|
61
|
-
visible,
|
|
62
|
-
x,
|
|
63
|
-
y,
|
|
64
|
-
color,
|
|
65
|
-
onCompleted,
|
|
66
|
-
className,
|
|
67
|
-
...props
|
|
68
|
-
}) => {
|
|
69
|
-
const dripRef = (0, _react.useRef)(null);
|
|
70
|
-
const top = Number.isNaN(+y) ? 0 : y - 10;
|
|
71
|
-
const left = Number.isNaN(+x) ? 0 : x - 10;
|
|
72
|
-
(0, _react.useEffect)(() => {
|
|
73
|
-
if (!dripRef.current) return;
|
|
74
|
-
dripRef.current.addEventListener('animationend', onCompleted);
|
|
75
|
-
return () => {
|
|
76
|
-
if (!dripRef.current) return;
|
|
77
|
-
dripRef.current.removeEventListener('animationend', onCompleted);
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
if (!visible) return null;
|
|
81
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDrip, {
|
|
82
|
-
ref: dripRef,
|
|
83
|
-
className: (0, _clsx.default)('nextui-drip', className),
|
|
84
|
-
...props,
|
|
85
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
86
|
-
width: "20",
|
|
87
|
-
height: "20",
|
|
88
|
-
viewBox: "0 0 20 20",
|
|
89
|
-
style: {
|
|
90
|
-
top,
|
|
91
|
-
left
|
|
92
|
-
},
|
|
93
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
94
|
-
stroke: "none",
|
|
95
|
-
strokeWidth: "1",
|
|
96
|
-
fill: "none",
|
|
97
|
-
fillRule: "evenodd",
|
|
98
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
99
|
-
className: "nextui-drip-filler",
|
|
100
|
-
fill: color,
|
|
101
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
|
102
|
-
width: "100%",
|
|
103
|
-
height: "100%",
|
|
104
|
-
rx: "10"
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const MemoDrip = /*#__PURE__*/_react.default.memo(Drip);
|
|
113
|
-
|
|
114
|
-
var _default = (0, _withDefaults.default)(MemoDrip, defaultProps);
|
|
115
|
-
|
|
116
|
-
exports.default = _default;
|
|
1
|
+
var e=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.default=exports.StyledDrip=void 0;var t=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}i.default=e,r&&r.set(e,i);return i}(require("react")),r=require("../theme/stitches.config"),i=e(require("../utils/with-defaults")),n=e(require("../utils/clsx")),o=require("react/jsx-runtime");function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}const a=(0,r.keyframes)({"0%":{opacity:0,transform:"scale(0.25)"},"30%":{opacity:1},"80%":{opacity:.5},"100%":{transform:"scale(28)",opacity:0}}),s=(0,r.styled)("div",{position:"absolute",left:0,right:0,top:0,bottom:0,"& svg":{position:"absolute",animation:`350ms linear ${a}`,animationFillMode:"forwards",width:"$md",height:"$md"}});exports.StyledDrip=s;const u=({visible:e,x:r,y:i,color:l,onCompleted:a,className:u,...c})=>{const f=(0,t.useRef)(null),d=Number.isNaN(+i)?0:i-10,p=Number.isNaN(+r)?0:r-10;return(0,t.useEffect)((()=>{if(f.current)return f.current.addEventListener("animationend",a),()=>{f.current&&f.current.removeEventListener("animationend",a)}})),e?(0,o.jsx)(s,{ref:f,className:(0,n.default)("nextui-drip",u),...c,children:(0,o.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{top:d,left:p},children:(0,o.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,o.jsx)("g",{className:"nextui-drip-filler",fill:l,children:(0,o.jsx)("rect",{width:"100%",height:"100%",rx:"10"})})})})}):null},c=t.default.memo(u);var f=(0,i.default)(c,{visible:!1,x:0,y:0,className:""});exports.default=f;
|