@scaleflex/ui-tw 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +33 -0
- package/README.md +28 -0
- package/core/accordion/accordion.component.d.ts +3 -0
- package/core/accordion/accordion.component.js +50 -0
- package/core/accordion/accordion.props.d.ts +13 -0
- package/core/accordion/accordion.props.js +1 -0
- package/core/accordion/accordion.styles.d.ts +6 -0
- package/core/accordion/accordion.styles.js +12 -0
- package/core/accordion/index.d.ts +2 -0
- package/core/accordion/index.js +1 -0
- package/core/accordion-details/accordion-details.component.d.ts +3 -0
- package/core/accordion-details/accordion-details.component.js +16 -0
- package/core/accordion-details/accordion-details.props.d.ts +4 -0
- package/core/accordion-details/accordion-details.props.js +1 -0
- package/core/accordion-details/accordion-details.styles.d.ts +6 -0
- package/core/accordion-details/accordion-details.styles.js +12 -0
- package/core/accordion-details/index.d.ts +2 -0
- package/core/accordion-details/index.js +1 -0
- package/core/accordion-header/accordion-header.component.d.ts +3 -0
- package/core/accordion-header/accordion-header.component.js +48 -0
- package/core/accordion-header/accordion-header.props.d.ts +11 -0
- package/core/accordion-header/accordion-header.props.js +1 -0
- package/core/accordion-header/accordion-header.styles.d.ts +19 -0
- package/core/accordion-header/accordion-header.styles.js +44 -0
- package/core/accordion-header/index.d.ts +2 -0
- package/core/accordion-header/index.js +1 -0
- package/core/arrow/arrow.component.d.ts +3 -0
- package/core/arrow/arrow.component.js +23 -0
- package/core/arrow/arrow.mixin.d.ts +6 -0
- package/core/arrow/arrow.mixin.js +4 -0
- package/core/arrow/arrow.props.d.ts +14 -0
- package/core/arrow/arrow.props.js +6 -0
- package/core/arrow/arrow.styles.d.ts +9 -0
- package/core/arrow/arrow.styles.js +18 -0
- package/core/arrow/index.d.ts +2 -0
- package/core/arrow/index.js +1 -0
- package/core/arrow-tick/arrow-tick.component.d.ts +3 -0
- package/core/arrow-tick/arrow-tick.component.js +28 -0
- package/core/arrow-tick/arrow-tick.mixin.d.ts +6 -0
- package/core/arrow-tick/arrow-tick.mixin.js +4 -0
- package/core/arrow-tick/arrow-tick.props.d.ts +14 -0
- package/core/arrow-tick/arrow-tick.props.js +6 -0
- package/core/arrow-tick/arrow-tick.styles.d.ts +7 -0
- package/core/arrow-tick/arrow-tick.styles.js +18 -0
- package/core/arrow-tick/index.d.ts +2 -0
- package/core/arrow-tick/index.js +1 -0
- package/core/button/button.component.d.ts +9 -0
- package/core/button/button.component.js +71 -0
- package/core/button/button.types.d.ts +34 -0
- package/core/button/button.types.js +21 -0
- package/core/button/button.utils.d.ts +3 -0
- package/core/button/button.utils.js +18 -0
- package/core/button/components/end-icon.d.ts +12 -0
- package/core/button/components/end-icon.js +33 -0
- package/core/button/components/start-icon.d.ts +14 -0
- package/core/button/components/start-icon.js +40 -0
- package/core/button/index.d.ts +4 -0
- package/core/button/index.js +3 -0
- package/core/check-box/check-box.component.d.ts +3 -0
- package/core/check-box/check-box.component.js +62 -0
- package/core/check-box/check-box.mixin.d.ts +4 -0
- package/core/check-box/check-box.mixin.js +8 -0
- package/core/check-box/check-box.props.d.ts +15 -0
- package/core/check-box/check-box.props.js +1 -0
- package/core/check-box/check-box.styles.d.ts +19 -0
- package/core/check-box/check-box.styles.js +42 -0
- package/core/check-box/check-box.utils.d.ts +3 -0
- package/core/check-box/check-box.utils.js +21 -0
- package/core/check-box/index.d.ts +2 -0
- package/core/check-box/index.js +1 -0
- package/core/check-box/types/index.d.ts +2 -0
- package/core/check-box/types/index.js +2 -0
- package/core/check-box/types/size.d.ts +4 -0
- package/core/check-box/types/size.js +4 -0
- package/core/check-box/types/type.d.ts +4 -0
- package/core/check-box/types/type.js +4 -0
- package/core/check-box-group/check-box-group.component.d.ts +3 -0
- package/core/check-box-group/check-box-group.component.js +74 -0
- package/core/check-box-group/check-box-group.mixin.d.ts +5 -0
- package/core/check-box-group/check-box-group.mixin.js +10 -0
- package/core/check-box-group/check-box-group.props.d.ts +19 -0
- package/core/check-box-group/check-box-group.props.js +1 -0
- package/core/check-box-group/check-box-group.styles.d.ts +19 -0
- package/core/check-box-group/check-box-group.styles.js +33 -0
- package/core/check-box-group/index.d.ts +2 -0
- package/core/check-box-group/index.js +1 -0
- package/core/check-box-group/types/index.d.ts +1 -0
- package/core/check-box-group/types/index.js +1 -0
- package/core/check-box-group/types/label-position.d.ts +4 -0
- package/core/check-box-group/types/label-position.js +4 -0
- package/core/cross-button/cross-button.component.d.ts +3 -0
- package/core/cross-button/cross-button.component.js +35 -0
- package/core/cross-button/cross-button.props.d.ts +8 -0
- package/core/cross-button/cross-button.props.js +1 -0
- package/core/cross-button/cross-button.styles.d.ts +9 -0
- package/core/cross-button/cross-button.styles.js +21 -0
- package/core/cross-button/index.d.ts +2 -0
- package/core/cross-button/index.js +1 -0
- package/core/cross-button/types/index.d.ts +1 -0
- package/core/cross-button/types/index.js +1 -0
- package/core/cross-button/types/size.d.ts +6 -0
- package/core/cross-button/types/size.js +6 -0
- package/core/dot/dot.component.d.ts +3 -0
- package/core/dot/dot.component.js +17 -0
- package/core/dot/dot.props.d.ts +4 -0
- package/core/dot/dot.props.js +1 -0
- package/core/dot/dot.styles.d.ts +18 -0
- package/core/dot/dot.styles.js +32 -0
- package/core/dot/index.d.ts +2 -0
- package/core/dot/index.js +1 -0
- package/core/dots-navigation/dots-navigation.component.d.ts +3 -0
- package/core/dots-navigation/dots-navigation.component.js +24 -0
- package/core/dots-navigation/dots-navigation.props.d.ts +5 -0
- package/core/dots-navigation/dots-navigation.props.js +1 -0
- package/core/dots-navigation/dots-navigation.styles.d.ts +6 -0
- package/core/dots-navigation/dots-navigation.styles.js +15 -0
- package/core/dots-navigation/index.d.ts +2 -0
- package/core/dots-navigation/index.js +1 -0
- package/core/input/index.d.ts +2 -0
- package/core/input/index.js +1 -0
- package/core/input/input.component.d.ts +3 -0
- package/core/input/input.component.js +293 -0
- package/core/input/input.mixin.d.ts +18 -0
- package/core/input/input.mixin.js +25 -0
- package/core/input/input.props.d.ts +40 -0
- package/core/input/input.props.js +1 -0
- package/core/input/input.styles.d.ts +78 -0
- package/core/input/input.styles.js +148 -0
- package/core/input/input.utils.d.ts +4 -0
- package/core/input/input.utils.js +30 -0
- package/core/input/types/index.d.ts +1 -0
- package/core/input/types/index.js +1 -0
- package/core/input/types/type.d.ts +4 -0
- package/core/input/types/type.js +4 -0
- package/core/modal/index.d.ts +2 -0
- package/core/modal/index.js +1 -0
- package/core/modal/modal-menu-context.d.ts +5 -0
- package/core/modal/modal-menu-context.js +10 -0
- package/core/modal/modal.component.d.ts +3 -0
- package/core/modal/modal.component.js +97 -0
- package/core/modal/modal.mixin.d.ts +7 -0
- package/core/modal/modal.mixin.js +4 -0
- package/core/modal/modal.props.d.ts +16 -0
- package/core/modal/modal.props.js +1 -0
- package/core/modal/modal.styles.d.ts +22 -0
- package/core/modal/modal.styles.js +51 -0
- package/core/modal/modal.utils.d.ts +1 -0
- package/core/modal/modal.utils.js +4 -0
- package/core/modal/types/index.d.ts +1 -0
- package/core/modal/types/index.js +1 -0
- package/core/modal/types/size.d.ts +7 -0
- package/core/modal/types/size.js +7 -0
- package/core/modal-actions/index.d.ts +2 -0
- package/core/modal-actions/index.js +1 -0
- package/core/modal-actions/modal-actions.component.d.ts +3 -0
- package/core/modal-actions/modal-actions.component.js +18 -0
- package/core/modal-actions/modal-actions.props.d.ts +8 -0
- package/core/modal-actions/modal-actions.props.js +1 -0
- package/core/modal-actions/modal-actions.styles.d.ts +7 -0
- package/core/modal-actions/modal-actions.styles.js +17 -0
- package/core/modal-actions/types/align.d.ts +5 -0
- package/core/modal-actions/types/align.js +5 -0
- package/core/modal-actions/types/index.d.ts +1 -0
- package/core/modal-actions/types/index.js +1 -0
- package/core/modal-content/index.d.ts +2 -0
- package/core/modal-content/index.js +1 -0
- package/core/modal-content/modal-content.component.d.ts +3 -0
- package/core/modal-content/modal-content.component.js +15 -0
- package/core/modal-content/modal-content.props.d.ts +4 -0
- package/core/modal-content/modal-content.props.js +1 -0
- package/core/modal-content/modal-content.styles.d.ts +6 -0
- package/core/modal-content/modal-content.styles.js +12 -0
- package/core/modal-title/index.d.ts +2 -0
- package/core/modal-title/index.js +1 -0
- package/core/modal-title/modal-title.component.d.ts +6 -0
- package/core/modal-title/modal-title.component.js +37 -0
- package/core/modal-title/modal-title.props.d.ts +14 -0
- package/core/modal-title/modal-title.props.js +1 -0
- package/core/modal-title/modal-title.styles.d.ts +31 -0
- package/core/modal-title/modal-title.styles.js +64 -0
- package/core/modal-title/types/index.d.ts +1 -0
- package/core/modal-title/types/index.js +1 -0
- package/core/modal-title/types/variant.d.ts +4 -0
- package/core/modal-title/types/variant.js +4 -0
- package/core/pagination/index.d.ts +2 -0
- package/core/pagination/index.js +1 -0
- package/core/pagination/pagination.component.d.ts +3 -0
- package/core/pagination/pagination.component.js +81 -0
- package/core/pagination/pagination.props.d.ts +11 -0
- package/core/pagination/pagination.props.js +1 -0
- package/core/pagination/pagination.styles.d.ts +19 -0
- package/core/pagination/pagination.styles.js +36 -0
- package/core/popper/index.d.ts +2 -0
- package/core/popper/index.js +1 -0
- package/core/popper/popper.component.d.ts +3 -0
- package/core/popper/popper.component.js +150 -0
- package/core/popper/popper.mixin.d.ts +17 -0
- package/core/popper/popper.mixin.js +5 -0
- package/core/popper/popper.props.d.ts +41 -0
- package/core/popper/popper.props.js +1 -0
- package/core/popper/popper.styles.d.ts +25 -0
- package/core/popper/popper.styles.js +48 -0
- package/core/popper/popper.utils.d.ts +1 -0
- package/core/popper/popper.utils.js +10 -0
- package/core/popper/types/index.d.ts +3 -0
- package/core/popper/types/index.js +3 -0
- package/core/popper/types/phases.d.ts +11 -0
- package/core/popper/types/phases.js +11 -0
- package/core/popper/types/position.d.ts +17 -0
- package/core/popper/types/position.js +17 -0
- package/core/popper/types/strategy.d.ts +4 -0
- package/core/popper/types/strategy.js +4 -0
- package/core/radio/index.d.ts +3 -0
- package/core/radio/index.js +2 -0
- package/core/radio/radio.component.d.ts +3 -0
- package/core/radio/radio.component.js +38 -0
- package/core/radio/radio.mixin.d.ts +13 -0
- package/core/radio/radio.mixin.js +13 -0
- package/core/radio/radio.props.d.ts +13 -0
- package/core/radio/radio.props.js +1 -0
- package/core/radio/radio.styles.d.ts +19 -0
- package/core/radio/radio.styles.js +44 -0
- package/core/radio/size.d.ts +4 -0
- package/core/radio/size.js +4 -0
- package/core/radio-group/index.d.ts +2 -0
- package/core/radio-group/index.js +1 -0
- package/core/radio-group/radio-group.component.d.ts +3 -0
- package/core/radio-group/radio-group.component.js +48 -0
- package/core/radio-group/radio-group.props.d.ts +15 -0
- package/core/radio-group/radio-group.props.js +1 -0
- package/core/radio-group/radio-group.styles.d.ts +14 -0
- package/core/radio-group/radio-group.styles.js +30 -0
- package/core/switcher/index.d.ts +3 -0
- package/core/switcher/index.js +2 -0
- package/core/switcher/switcher-size.d.ts +5 -0
- package/core/switcher/switcher-size.js +5 -0
- package/core/switcher/switcher.component.d.ts +3 -0
- package/core/switcher/switcher.component.js +54 -0
- package/core/switcher/switcher.mixin.d.ts +21 -0
- package/core/switcher/switcher.mixin.js +17 -0
- package/core/switcher/switcher.props.d.ts +14 -0
- package/core/switcher/switcher.props.js +1 -0
- package/core/switcher/switcher.styles.d.ts +27 -0
- package/core/switcher/switcher.styles.js +54 -0
- package/core/switcher/switcher.utils.d.ts +4 -0
- package/core/switcher/switcher.utils.js +37 -0
- package/core/switcher-group/index.d.ts +2 -0
- package/core/switcher-group/index.js +1 -0
- package/core/switcher-group/switcher-group.component.d.ts +3 -0
- package/core/switcher-group/switcher-group.component.js +41 -0
- package/core/switcher-group/switcher-group.props.d.ts +13 -0
- package/core/switcher-group/switcher-group.props.js +1 -0
- package/core/switcher-group/switcher-group.styles.d.ts +10 -0
- package/core/switcher-group/switcher-group.styles.js +30 -0
- package/core/tab/index.d.ts +2 -0
- package/core/tab/index.js +1 -0
- package/core/tab/tab.component.d.ts +6 -0
- package/core/tab/tab.component.js +52 -0
- package/core/tab/tab.mixin.d.ts +11 -0
- package/core/tab/tab.mixin.js +15 -0
- package/core/tab/tab.props.d.ts +15 -0
- package/core/tab/tab.props.js +1 -0
- package/core/tab/tab.styles.d.ts +26 -0
- package/core/tab/tab.styles.js +61 -0
- package/core/tab/types/index.d.ts +1 -0
- package/core/tab/types/index.js +1 -0
- package/core/tab/types/size.d.ts +5 -0
- package/core/tab/types/size.js +5 -0
- package/core/tab-panel/index.d.ts +2 -0
- package/core/tab-panel/index.js +1 -0
- package/core/tab-panel/tab-panel.component.d.ts +3 -0
- package/core/tab-panel/tab-panel.component.js +18 -0
- package/core/tab-panel/tab-panel.props.d.ts +6 -0
- package/core/tab-panel/tab-panel.props.js +1 -0
- package/core/tab-panel/tab-panel.styles.d.ts +6 -0
- package/core/tab-panel/tab-panel.styles.js +12 -0
- package/core/upload-input/index.d.ts +2 -0
- package/core/upload-input/index.js +1 -0
- package/core/upload-input/upload-input.component.d.ts +3 -0
- package/core/upload-input/upload-input.component.js +68 -0
- package/core/upload-input/upload-input.props.d.ts +9 -0
- package/core/upload-input/upload-input.props.js +1 -0
- package/core/upload-input/upload-input.styles.d.ts +11 -0
- package/core/upload-input/upload-input.styles.js +53 -0
- package/hooks/README.md +26 -0
- package/hooks/use-controlled.d.ts +1 -0
- package/hooks/use-controlled.js +20 -0
- package/hooks/use-debounce.d.ts +2 -0
- package/hooks/use-debounce.js +19 -0
- package/hooks/use-drag.d.ts +5 -0
- package/hooks/use-drag.js +37 -0
- package/hooks/use-enhanced-effect.d.ts +3 -0
- package/hooks/use-enhanced-effect.js +3 -0
- package/hooks/use-event-callback.d.ts +4 -0
- package/hooks/use-event-callback.js +19 -0
- package/hooks/use-pagination.d.ts +3 -0
- package/hooks/use-pagination.js +106 -0
- package/hooks/use-portal.d.ts +14 -0
- package/hooks/use-portal.js +75 -0
- package/package.json +63 -0
- package/theme/README.md +46 -0
- package/theme/entity/index.d.ts +1 -0
- package/theme/entity/index.js +1 -0
- package/theme/entity/theme.d.ts +34 -0
- package/theme/hooks/index.d.ts +2 -0
- package/theme/hooks/index.js +2 -0
- package/theme/hooks/use-media-query.d.ts +1 -0
- package/theme/hooks/use-media-query.js +27 -0
- package/theme/hooks/use-theme.d.ts +2 -0
- package/theme/hooks/use-theme.js +4 -0
- package/theme/index.d.ts +3 -0
- package/theme/index.js +1 -0
- package/theme/roots/breakpoints/entity/breakpoints-map.d.ts +8 -0
- package/theme/roots/breakpoints/entity/breakpoints.d.ts +73 -0
- package/theme/roots/breakpoints/entity/create-breakpoints.d.ts +3 -0
- package/theme/roots/breakpoints/entity/create-breakpoints.js +65 -0
- package/theme/roots/breakpoints/entity/default-breakpoints.d.ts +26 -0
- package/theme/roots/breakpoints/entity/default-breakpoints.js +22 -0
- package/theme/roots/breakpoints/entity/index.d.ts +3 -0
- package/theme/roots/breakpoints/entity/index.js +2 -0
- package/theme/roots/breakpoints/index.d.ts +3 -0
- package/theme/roots/breakpoints/index.js +1 -0
- package/theme/roots/common-styles.d.ts +2 -0
- package/theme/roots/common-styles.js +6 -0
- package/theme/roots/index.d.ts +2 -0
- package/theme/roots/index.js +2 -0
- package/theme/roots/palette/entity/colors-map.d.ts +4 -0
- package/theme/roots/palette/entity/default-palette.d.ts +282 -0
- package/theme/roots/palette/entity/default-palette.js +22 -0
- package/theme/roots/palette/entity/index.d.ts +2 -0
- package/theme/roots/palette/entity/index.js +2 -0
- package/theme/roots/palette/index.d.ts +2 -0
- package/theme/roots/palette/index.js +1 -0
- package/theme/roots/shadows/entity/default-shadows.d.ts +16 -0
- package/theme/roots/shadows/entity/default-shadows.js +5 -0
- package/theme/roots/shadows/entity/index.d.ts +2 -0
- package/theme/roots/shadows/entity/index.js +2 -0
- package/theme/roots/shadows/entity/shadows-map.d.ts +4 -0
- package/theme/roots/shadows/index.d.ts +2 -0
- package/theme/roots/shadows/index.js +1 -0
- package/theme/roots/shape/index.d.ts +1 -0
- package/theme/roots/shape/index.js +1 -0
- package/theme/roots/shape/shape.props.d.ts +5 -0
- package/theme/roots/shape/shape.props.js +1 -0
- package/theme/roots/typography/entity/default-typography.d.ts +398 -0
- package/theme/roots/typography/entity/default-typography.js +237 -0
- package/theme/roots/typography/entity/index.d.ts +1 -0
- package/theme/roots/typography/entity/index.js +1 -0
- package/theme/roots/typography/index.d.ts +3 -0
- package/theme/roots/typography/index.js +2 -0
- package/theme/roots/typography/typography.component.d.ts +2 -0
- package/theme/roots/typography/typography.component.js +7 -0
- package/theme/roots/typography/typography.props.d.ts +15 -0
- package/theme/roots/typography/typography.props.js +1 -0
- package/theme/theme-provider/index.d.ts +2 -0
- package/theme/theme-provider/index.js +1 -0
- package/theme/theme-provider/theme-provider.context.d.ts +4 -0
- package/theme/theme-provider/theme-provider.context.js +48 -0
- package/theme/theme-provider/theme-provider.props.d.ts +6 -0
- package/theme/theme-provider/theme-provider.props.js +1 -0
- package/theme/theme.css +100 -0
- package/tsconfig.json +22 -0
- package/utils/README.md +11 -0
- package/utils/functions/apply-display-names.d.ts +6 -0
- package/utils/functions/apply-display-names.js +12 -0
- package/utils/functions/apply-polymorphic-function-prop.d.ts +6 -0
- package/utils/functions/apply-polymorphic-function-prop.js +11 -0
- package/utils/functions/color-picker/color-converters.d.ts +11 -0
- package/utils/functions/color-picker/color-converters.js +159 -0
- package/utils/functions/color-picker/map-number.d.ts +1 -0
- package/utils/functions/color-picker/map-number.js +3 -0
- package/utils/functions/color-picker/restrict-number.d.ts +1 -0
- package/utils/functions/color-picker/restrict-number.js +8 -0
- package/utils/functions/convert-to-string.d.ts +1 -0
- package/utils/functions/convert-to-string.js +3 -0
- package/utils/functions/escape-regexp.d.ts +1 -0
- package/utils/functions/escape-regexp.js +3 -0
- package/utils/functions/generate-class-names.d.ts +1 -0
- package/utils/functions/generate-class-names.js +22 -0
- package/utils/functions/get-elem-document-coords.d.ts +6 -0
- package/utils/functions/get-elem-document-coords.js +21 -0
- package/utils/functions/ignore-event.d.ts +1 -0
- package/utils/functions/ignore-event.js +9 -0
- package/utils/functions/index.d.ts +14 -0
- package/utils/functions/index.js +15 -0
- package/utils/functions/intrinsic-component.d.ts +0 -0
- package/utils/functions/intrinsic-component.js +28 -0
- package/utils/functions/object-keys.d.ts +6 -0
- package/utils/functions/object-keys.js +6 -0
- package/utils/functions/object-values.d.ts +7 -0
- package/utils/functions/object-values.js +6 -0
- package/utils/functions/on-click-by-mouse-down.d.ts +2 -0
- package/utils/functions/on-click-by-mouse-down.js +9 -0
- package/utils/functions/scrollbar.d.ts +2 -0
- package/utils/functions/scrollbar.js +6 -0
- package/utils/functions/set-ref.d.ts +8 -0
- package/utils/functions/set-ref.js +13 -0
- package/utils/functions/shadcn-utils.d.ts +2 -0
- package/utils/functions/shadcn-utils.js +8 -0
- package/utils/functions/slider/utils.d.ts +47 -0
- package/utils/functions/slider/utils.js +124 -0
- package/utils/functions/use-fork-ref.d.ts +2 -0
- package/utils/functions/use-fork-ref.js +18 -0
- package/utils/types/color/icon-button-color.d.ts +5 -0
- package/utils/types/color/icon-button-color.js +5 -0
- package/utils/types/color/index.d.ts +2 -0
- package/utils/types/color/index.js +2 -0
- package/utils/types/color/input-background-color.d.ts +4 -0
- package/utils/types/color/input-background-color.js +4 -0
- package/utils/types/css/align.d.ts +11 -0
- package/utils/types/css/align.js +11 -0
- package/utils/types/css/breakpoint.d.ts +18 -0
- package/utils/types/css/breakpoint.js +18 -0
- package/utils/types/css/direction.d.ts +8 -0
- package/utils/types/css/direction.js +4 -0
- package/utils/types/css/index.d.ts +4 -0
- package/utils/types/css/index.js +4 -0
- package/utils/types/css/position.d.ts +6 -0
- package/utils/types/css/position.js +6 -0
- package/utils/types/index.d.ts +8 -0
- package/utils/types/index.js +3 -0
- package/utils/types/intrinsic-component.d.ts +1 -0
- package/utils/types/keys.d.ts +4 -0
- package/utils/types/palette/color.d.ts +133 -0
- package/utils/types/palette/color.js +133 -0
- package/utils/types/palette/index.d.ts +1 -0
- package/utils/types/palette/index.js +1 -0
- package/utils/types/position/index.d.ts +1 -0
- package/utils/types/position/index.js +1 -0
- package/utils/types/position/position.d.ts +6 -0
- package/utils/types/position/position.js +6 -0
- package/utils/types/prop-types/index.d.ts +1 -0
- package/utils/types/prop-types/index.js +1 -0
- package/utils/types/prop-types/record.d.ts +1 -0
- package/utils/types/prop-types/record.js +6 -0
- package/utils/types/shadows/index.d.ts +1 -0
- package/utils/types/shadows/index.js +1 -0
- package/utils/types/shadows/shadows.d.ts +14 -0
- package/utils/types/shadows/shadows.js +14 -0
- package/utils/types/shape/border-radius-size.d.ts +5 -0
- package/utils/types/shape/border-radius-size.js +5 -0
- package/utils/types/shape/index.d.ts +1 -0
- package/utils/types/shape/index.js +1 -0
- package/utils/types/size/index.d.ts +1 -0
- package/utils/types/size/index.js +1 -0
- package/utils/types/size/input-size.d.ts +4 -0
- package/utils/types/size/input-size.js +4 -0
- package/utils/types/stylable-component.d.ts +7 -0
- package/utils/types/typography/font-variant.d.ts +58 -0
- package/utils/types/typography/font-variant.js +58 -0
- package/utils/types/typography/font-weight.d.ts +11 -0
- package/utils/types/typography/font-weight.js +11 -0
- package/utils/types/typography/index.d.ts +4 -0
- package/utils/types/typography/index.js +4 -0
- package/utils/types/typography/text-align.d.ts +5 -0
- package/utils/types/typography/text-align.js +5 -0
- package/utils/types/typography/text-decoration.d.ts +5 -0
- package/utils/types/typography/text-decoration.js +5 -0
- package/utils/types/values.d.ts +4 -0
- package/utils/types/with.d.ts +4 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SwitcherSize } from './switcher-size';
|
|
2
|
+
export var getSwitcherSize = function getSwitcherSize(sizeName) {
|
|
3
|
+
switch (sizeName) {
|
|
4
|
+
case SwitcherSize.Lg:
|
|
5
|
+
return 30;
|
|
6
|
+
case SwitcherSize.Md:
|
|
7
|
+
return 20;
|
|
8
|
+
case SwitcherSize.Sm:
|
|
9
|
+
return 16;
|
|
10
|
+
default:
|
|
11
|
+
return 16;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export var getSwitcherFont = function getSwitcherFont(sizeName) {
|
|
15
|
+
switch (sizeName) {
|
|
16
|
+
case SwitcherSize.Lg:
|
|
17
|
+
return 14;
|
|
18
|
+
case SwitcherSize.Md:
|
|
19
|
+
return 10;
|
|
20
|
+
case SwitcherSize.Sm:
|
|
21
|
+
return 8;
|
|
22
|
+
default:
|
|
23
|
+
return 14;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export var getSwitcherIconSize = function getSwitcherIconSize(sizeName) {
|
|
27
|
+
switch (sizeName) {
|
|
28
|
+
case SwitcherSize.Lg:
|
|
29
|
+
return 24;
|
|
30
|
+
case SwitcherSize.Md:
|
|
31
|
+
return 16;
|
|
32
|
+
case SwitcherSize.Sm:
|
|
33
|
+
return 12;
|
|
34
|
+
default:
|
|
35
|
+
return 12;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './switcher-group.component';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["size", "label", "switcherProps", "SwitcherProps", "checked", "onChange", "readOnly", "disabled", "ref"];
|
|
4
|
+
import { cn } from '@scaleflex/ui-tw/utils/functions/shadcn-utils';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import Switcher from '../switcher';
|
|
7
|
+
import { SwitcherSize } from '../switcher/switcher-size';
|
|
8
|
+
var SwitcherGroup = function SwitcherGroup(_ref) {
|
|
9
|
+
var _ref$size = _ref.size,
|
|
10
|
+
size = _ref$size === void 0 ? SwitcherSize.Sm : _ref$size,
|
|
11
|
+
label = _ref.label,
|
|
12
|
+
switcherProps = _ref.switcherProps,
|
|
13
|
+
SwitcherProps = _ref.SwitcherProps,
|
|
14
|
+
_ref$checked = _ref.checked,
|
|
15
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
16
|
+
onChange = _ref.onChange,
|
|
17
|
+
readOnly = _ref.readOnly,
|
|
18
|
+
disabled = _ref.disabled,
|
|
19
|
+
ref = _ref.ref,
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var cursorStyleClasses = disabled ? 'cursor-default' : 'cursor-pointer';
|
|
22
|
+
var switcherGroupLabelClasses = cn('relative inline-flex items-center', cursorStyleClasses);
|
|
23
|
+
var switcherGroupLabelTextClasses = cn('flex items-center ml-2', "".concat(disabled ? 'text-icons-muted' : 'text-textprimary'),
|
|
24
|
+
// TODO: add styles from ${fontSizeSwitcherMixin[size]}
|
|
25
|
+
cursorStyleClasses);
|
|
26
|
+
return /*#__PURE__*/React.createElement("label", _extends({
|
|
27
|
+
className: switcherGroupLabelClasses,
|
|
28
|
+
ref: ref
|
|
29
|
+
}, rest), /*#__PURE__*/React.createElement(Switcher, {
|
|
30
|
+
size: size,
|
|
31
|
+
SwitcherPropsData: SwitcherProps,
|
|
32
|
+
switcherProps: switcherProps,
|
|
33
|
+
readOnly: readOnly,
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
onChange: onChange,
|
|
36
|
+
checked: checked
|
|
37
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
className: switcherGroupLabelTextClasses
|
|
39
|
+
}, label));
|
|
40
|
+
};
|
|
41
|
+
export default SwitcherGroup;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChangeEvent, Ref } from 'react';
|
|
2
|
+
import { SwitcherSizeType } from '../switcher/switcher.props';
|
|
3
|
+
export interface SwitcherGroupProps extends Omit<React.HTMLAttributes<HTMLLabelElement>, 'onChange'> {
|
|
4
|
+
label?: string;
|
|
5
|
+
switcherProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>;
|
|
6
|
+
SwitcherProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
size?: SwitcherSizeType;
|
|
12
|
+
ref?: Ref<HTMLLabelElement>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SwitcherGroupProps } from './switcher-group.props';
|
|
2
|
+
declare const Styled: {
|
|
3
|
+
SwitcherGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLLabelElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLLabelElement> | null | undefined;
|
|
5
|
+
}>, never>, SwitcherGroupProps>> & string;
|
|
6
|
+
Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
7
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
8
|
+
}>, never>, SwitcherGroupProps>> & string;
|
|
9
|
+
};
|
|
10
|
+
export default Styled;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { applyDisplayNames, generateClassNames } from '../../utils/functions';
|
|
3
|
+
import { Color as PColor } from '../../utils/types/palette';
|
|
4
|
+
import { SwitcherSize } from '../switcher/switcher-size';
|
|
5
|
+
import { fontSizeSwitcherMixin } from '../switcher/switcher.mixin';
|
|
6
|
+
var baseClassName = 'SwitcherGroup';
|
|
7
|
+
var Label = /*#__PURE__*/styled.span.attrs({
|
|
8
|
+
className: generateClassNames(baseClassName, 'Label')
|
|
9
|
+
}).withConfig({
|
|
10
|
+
componentId: "sc-15hhrwc-0"
|
|
11
|
+
})(function (_ref) {
|
|
12
|
+
var disabled = _ref.disabled,
|
|
13
|
+
_ref$size = _ref.size,
|
|
14
|
+
size = _ref$size === void 0 ? SwitcherSize.Sm : _ref$size,
|
|
15
|
+
theme = _ref.theme;
|
|
16
|
+
return css(["display:flex;align-items:center;margin-left:8px;color:", ";cursor:", ";", ";"], disabled ? theme.palette[PColor.ButtonDisabledText] : theme.palette[PColor.TextPrimary], disabled ? 'default' : 'pointer', fontSizeSwitcherMixin[size]);
|
|
17
|
+
});
|
|
18
|
+
var SwitcherGroup = /*#__PURE__*/styled.label.attrs({
|
|
19
|
+
className: generateClassNames(baseClassName, 'root')
|
|
20
|
+
}).withConfig({
|
|
21
|
+
componentId: "sc-15hhrwc-1"
|
|
22
|
+
})(function (_ref2) {
|
|
23
|
+
var disabled = _ref2.disabled;
|
|
24
|
+
return css(["position:relative;display:inline-flex;cursor:", ";"], disabled ? 'default' : 'pointer');
|
|
25
|
+
});
|
|
26
|
+
var Styled = applyDisplayNames({
|
|
27
|
+
SwitcherGroup: SwitcherGroup,
|
|
28
|
+
Label: Label
|
|
29
|
+
});
|
|
30
|
+
export default Styled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './tab.component';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["icon", "label", "active", "disabled", "notification", "className", "size", "ref"];
|
|
4
|
+
import { cn } from '@scaleflex/ui-tw/utils/functions/shadcn-utils';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Size } from './types';
|
|
7
|
+
var Tab = function Tab(_ref) {
|
|
8
|
+
var _ref$icon = _ref.icon,
|
|
9
|
+
icon = _ref$icon === void 0 ? false : _ref$icon,
|
|
10
|
+
label = _ref.label,
|
|
11
|
+
active = _ref.active,
|
|
12
|
+
disabled = _ref.disabled,
|
|
13
|
+
notification = _ref.notification,
|
|
14
|
+
className = _ref.className,
|
|
15
|
+
_ref$size = _ref.size,
|
|
16
|
+
size = _ref$size === void 0 ? Size.Md : _ref$size,
|
|
17
|
+
ref = _ref.ref,
|
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var transitionClasses = 'transition-all duration-100 ease-out';
|
|
20
|
+
var fontClasses = '';
|
|
21
|
+
var svgSizeClasses = '';
|
|
22
|
+
if (size === Size.Lg) {
|
|
23
|
+
fontClasses = 'text-lg';
|
|
24
|
+
svgSizeClasses = '[&_svg]:h-5 [&_svg]:w-5';
|
|
25
|
+
}
|
|
26
|
+
if (size === Size.Md) {
|
|
27
|
+
fontClasses = 'text-base';
|
|
28
|
+
svgSizeClasses = '[&_svg]:h-4 [&_svg]:w-4';
|
|
29
|
+
}
|
|
30
|
+
if (size === Size.Sm) {
|
|
31
|
+
fontClasses = 'text-sm';
|
|
32
|
+
svgSizeClasses = '[&_svg]:h-3.5 [&_svg]:w-3.5';
|
|
33
|
+
}
|
|
34
|
+
var tabClasses = cn(className, 'group/tab relative inline-flex items-center text-center py-2', disabled ? 'text-icons-muted' : 'text-textprimary', active ? 'active text-primary-active' : '', !disabled ? 'cursor-pointer hover:text-primary-hover active:text-primary-active hover:border-b-2 hover:border-accent-1-8-Opacity active:border-b-2 active:border-primary-active' : '', transitionClasses, fontClasses);
|
|
35
|
+
var groupChildrenColorClasses = !disabled ? 'group-hover/tab:text-primary-hover group-active/tab:text-primary-active' : '';
|
|
36
|
+
var iconClasses = "".concat(disabled ? 'text-icons-muted' : active ? 'text-accent-primary' : 'text-icons-primary', " ").concat(groupChildrenColorClasses, " ").concat(transitionClasses, " ").concat(fontClasses, " ").concat(svgSizeClasses);
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
38
|
+
ref: ref
|
|
39
|
+
}, rest, {
|
|
40
|
+
className: tabClasses
|
|
41
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
42
|
+
className: "relative"
|
|
43
|
+
}, icon && /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: iconClasses /*size={size}*/
|
|
45
|
+
}, icon), notification && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: "bg-icons-free absolute -top-0.5 -right-1 box-content h-1.5 w-1.5 rounded-full border-1 border-solid border-white group-active/tab:hidden ".concat(active ? 'hidden' : '')
|
|
47
|
+
})), label && /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "ml-2 ".concat(transitionClasses, " ").concat(active ? 'text-accent-primary' : '')
|
|
49
|
+
}, label));
|
|
50
|
+
};
|
|
51
|
+
Tab.displayName = 'Tab';
|
|
52
|
+
export default Tab;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WithTheme } from '../../theme/entity';
|
|
2
|
+
export declare const tabSizeMixin: {
|
|
3
|
+
lg: ({ theme: { typography: { font }, }, }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
4
|
+
md: ({ theme: { typography: { font }, }, }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
5
|
+
sm: ({ theme: { typography: { font }, }, }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
6
|
+
};
|
|
7
|
+
export declare const iconSizeMixin: {
|
|
8
|
+
sm: import("styled-components").RuleSet<object>;
|
|
9
|
+
md: import("styled-components").RuleSet<object>;
|
|
10
|
+
lg: import("styled-components").RuleSet<object>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { css } from 'styled-components';
|
|
3
|
+
import { FontVariant as FV } from '../../utils/types/typography/font-variant';
|
|
4
|
+
import { Size } from './types';
|
|
5
|
+
export var tabSizeMixin = _defineProperty(_defineProperty(_defineProperty({}, Size.Lg, function (_ref) {
|
|
6
|
+
var font = _ref.theme.typography.font;
|
|
7
|
+
return css(["", " padding:8px 0px;"], font[FV.LabelLargeUp]);
|
|
8
|
+
}), Size.Md, function (_ref2) {
|
|
9
|
+
var font = _ref2.theme.typography.font;
|
|
10
|
+
return css(["", " padding:8px 0px;"], font[FV.LabelMedium]);
|
|
11
|
+
}), Size.Sm, function (_ref3) {
|
|
12
|
+
var font = _ref3.theme.typography.font;
|
|
13
|
+
return css(["", " padding:8px 0px;"], font[FV.LabelSmall]);
|
|
14
|
+
});
|
|
15
|
+
export var iconSizeMixin = _defineProperty(_defineProperty(_defineProperty({}, Size.Sm, css(["width:14px;height:14px;"])), Size.Md, css(["width:16px;height:16px;"])), Size.Lg, css(["width:20px;height:20px;"]));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import type { Values } from '../../utils/types';
|
|
3
|
+
import { Size } from './types';
|
|
4
|
+
export type TabSizeType = Values<typeof Size>;
|
|
5
|
+
export interface TabProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
size?: TabSizeType;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
badge?: React.ReactNode;
|
|
10
|
+
value?: string | number;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
notification?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
ref?: Ref<HTMLDivElement>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TabProps } from './tab.props';
|
|
2
|
+
declare const Styled: {
|
|
3
|
+
Tab: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}>, never>, TabProps & {
|
|
6
|
+
theme: import("styled-components").DefaultTheme;
|
|
7
|
+
}>> & string;
|
|
8
|
+
Icons: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
9
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
10
|
+
}>, never>, never>> & string;
|
|
11
|
+
Icon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
+
}>, never>, TabProps & {
|
|
14
|
+
theme: import("styled-components").DefaultTheme;
|
|
15
|
+
}>> & string;
|
|
16
|
+
Dot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
17
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
18
|
+
}>, never>, never>> & string;
|
|
19
|
+
Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
20
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
21
|
+
}>, never>, never>> & string;
|
|
22
|
+
Badge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
23
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
24
|
+
}>, never>, never>> & string;
|
|
25
|
+
};
|
|
26
|
+
export default Styled;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { applyDisplayNames, generateClassNames } from '../../utils/functions';
|
|
3
|
+
import { Color as PColor } from '../../utils/types/palette';
|
|
4
|
+
import { iconSizeMixin, tabSizeMixin } from './tab.mixin';
|
|
5
|
+
import { Size } from './types';
|
|
6
|
+
var baseClassName = 'Tab';
|
|
7
|
+
var Dot = /*#__PURE__*/styled.span.attrs({
|
|
8
|
+
className: generateClassNames(baseClassName, 'Dot')
|
|
9
|
+
}).withConfig({
|
|
10
|
+
componentId: "sc-se8mpx-0"
|
|
11
|
+
})(["position:absolute;display:flex;top:-5%;right:15%;border:1px solid white;border-radius:50%;"]);
|
|
12
|
+
var Icon = /*#__PURE__*/styled.div.attrs({
|
|
13
|
+
className: generateClassNames(baseClassName, 'Icon')
|
|
14
|
+
}).withConfig({
|
|
15
|
+
componentId: "sc-se8mpx-1"
|
|
16
|
+
})(function (_ref) {
|
|
17
|
+
var palette = _ref.theme.palette,
|
|
18
|
+
_ref$disabled = _ref.disabled,
|
|
19
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
20
|
+
_ref$size = _ref.size,
|
|
21
|
+
size = _ref$size === void 0 ? Size.Md : _ref$size;
|
|
22
|
+
return css(["margin-right:8px;color:", ";transition:all 100ms ease-out;svg{", "}"], disabled ? palette[PColor.IconsMuted] : palette[PColor.IconsPrimary], iconSizeMixin[size]);
|
|
23
|
+
});
|
|
24
|
+
var Label = /*#__PURE__*/styled.div.attrs({
|
|
25
|
+
className: generateClassNames(baseClassName, 'Label')
|
|
26
|
+
}).withConfig({
|
|
27
|
+
componentId: "sc-se8mpx-2"
|
|
28
|
+
})(["transition:all 100ms ease-out;"]);
|
|
29
|
+
var Tab = /*#__PURE__*/styled.div.attrs({
|
|
30
|
+
className: generateClassNames(baseClassName, 'root')
|
|
31
|
+
}).withConfig({
|
|
32
|
+
componentId: "sc-se8mpx-3"
|
|
33
|
+
})(function (_ref2) {
|
|
34
|
+
var palette = _ref2.theme.palette,
|
|
35
|
+
_ref2$icon = _ref2.icon,
|
|
36
|
+
icon = _ref2$icon === void 0 ? false : _ref2$icon,
|
|
37
|
+
_ref2$disabled = _ref2.disabled,
|
|
38
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
39
|
+
_ref2$size = _ref2.size,
|
|
40
|
+
size = _ref2$size === void 0 ? Size.Md : _ref2$size;
|
|
41
|
+
return css(["", " position:relative;display:inline-flex;align-items:center;text-align:center;color:", ";transition:all 100ms ease-out;", ""], tabSizeMixin[size], disabled ? palette[PColor.ButtonDisabledText] : palette[PColor.TextPrimary], !disabled && css(["cursor:pointer;&:hover{", "{color:", ";}", "{color:", ";}box-shadow:", ";}&:active{", "{display:none;}", "{color:", ";}", "{color:", ";}box-shadow:", ";}&.active{", "{display:none;}", "{color:", ";}", "{color:", ";}box-shadow:inset 0px -2px 0px ", ";}"], Icon, palette[PColor.AccentPrimaryHover], Label, palette[PColor.AccentPrimaryHover], icon ? "inset 0px -2px 0px ".concat(palette[PColor.BorderHoverBottom]) : '', Dot, Icon, palette[PColor.AccentPrimaryActive], Label, palette[PColor.AccentPrimaryActive], icon ? "inset 0px -2px 0px ".concat(palette[PColor.BorderActiveBottom]) : '', Dot, Icon, palette[PColor.AccentPrimary], Label, palette[PColor.AccentPrimary], palette[PColor.AccentPrimary]));
|
|
42
|
+
});
|
|
43
|
+
var Icons = /*#__PURE__*/styled.span.attrs({
|
|
44
|
+
className: generateClassNames(baseClassName, 'Icons')
|
|
45
|
+
}).withConfig({
|
|
46
|
+
componentId: "sc-se8mpx-4"
|
|
47
|
+
})(["position:relative;"]);
|
|
48
|
+
var Badge = /*#__PURE__*/styled.span.attrs({
|
|
49
|
+
className: generateClassNames(baseClassName, 'Badge')
|
|
50
|
+
}).withConfig({
|
|
51
|
+
componentId: "sc-se8mpx-5"
|
|
52
|
+
})(["display:flex;margin-left:5px;"]);
|
|
53
|
+
var Styled = applyDisplayNames({
|
|
54
|
+
Tab: Tab,
|
|
55
|
+
Icons: Icons,
|
|
56
|
+
Icon: Icon,
|
|
57
|
+
Dot: Dot,
|
|
58
|
+
Label: Label,
|
|
59
|
+
Badge: Badge
|
|
60
|
+
});
|
|
61
|
+
export default Styled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './size';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './size';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './tab-panel.component';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["value", "index", "ref"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
var TabPanel = function TabPanel(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
index = _ref.index,
|
|
8
|
+
ref = _ref.ref,
|
|
9
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
10
|
+
if (value !== index) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
14
|
+
className: "mt-4",
|
|
15
|
+
ref: ref
|
|
16
|
+
}, rest));
|
|
17
|
+
};
|
|
18
|
+
export default TabPanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const Styled: {
|
|
2
|
+
TabPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}>, never>, never>> & string;
|
|
5
|
+
};
|
|
6
|
+
export default Styled;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { applyDisplayNames, generateClassNames } from '../../utils/functions';
|
|
3
|
+
var baseClassName = 'TabPanel';
|
|
4
|
+
var TabPanel = /*#__PURE__*/styled.div.attrs({
|
|
5
|
+
className: generateClassNames(baseClassName, 'root')
|
|
6
|
+
}).withConfig({
|
|
7
|
+
componentId: "sc-olkkoz-0"
|
|
8
|
+
})(["margin-top:20px;"]);
|
|
9
|
+
var Styled = applyDisplayNames({
|
|
10
|
+
TabPanel: TabPanel
|
|
11
|
+
});
|
|
12
|
+
export default Styled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './upload-input.component';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["error", "buttonLabel", "buttonVariant", "placeholder", "onChange", "ref"];
|
|
5
|
+
import { cn } from '@scaleflex/ui-tw/utils/functions/shadcn-utils';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
import Button, { ButtonVariant } from '../button';
|
|
8
|
+
var UploadInput = function UploadInput(_ref) {
|
|
9
|
+
var error = _ref.error,
|
|
10
|
+
_ref$buttonLabel = _ref.buttonLabel,
|
|
11
|
+
buttonLabel = _ref$buttonLabel === void 0 ? 'Choose file' : _ref$buttonLabel,
|
|
12
|
+
_ref$buttonVariant = _ref.buttonVariant,
|
|
13
|
+
buttonVariant = _ref$buttonVariant === void 0 ? ButtonVariant.Primary : _ref$buttonVariant,
|
|
14
|
+
_ref$placeholder = _ref.placeholder,
|
|
15
|
+
placeholder = _ref$placeholder === void 0 ? 'No file chosen' : _ref$placeholder,
|
|
16
|
+
_onChange = _ref.onChange,
|
|
17
|
+
ref = _ref.ref,
|
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var _useState = useState(''),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
valueState = _useState2[0],
|
|
22
|
+
setValueState = _useState2[1];
|
|
23
|
+
var uploadInputWrapClasses = cn('upload-input-wrap relative border-1 border-solid w-75 flex items-center pl-2 justify-end rounded-sm overflow-hidden', 'transition-all duration-100 ease-out', 'hover:border-borders-primary-hover', 'active:border-accent-primary', "".concat(error ? 'bg-background-secondary border-error' : 'border-borders-primary-stateless'));
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: uploadInputWrapClasses,
|
|
26
|
+
ref: ref,
|
|
27
|
+
onClick: function onClick(_ref2) {
|
|
28
|
+
var currentTarget = _ref2.currentTarget;
|
|
29
|
+
var fileInputElem = currentTarget.querySelector('input[type=file]');
|
|
30
|
+
if (fileInputElem) {
|
|
31
|
+
fileInputElem.click();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
35
|
+
className: "pointer-events-none absolute left-3 ".concat(valueState ? 'text-textprimary' : 'text-textplaceholder')
|
|
36
|
+
}, valueState ? valueState : placeholder), /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
variant: buttonVariant
|
|
38
|
+
// border left added to simulate button hover event and change it's color
|
|
39
|
+
// margin-right is to hide white gap between button and wraper div border
|
|
40
|
+
,
|
|
41
|
+
className: "my-0 -mr-1 ml-0 rounded-tl-none rounded-bl-none border-l-230 pr-5",
|
|
42
|
+
style: {
|
|
43
|
+
borderColor: 'unset'
|
|
44
|
+
}
|
|
45
|
+
}, buttonLabel), /*#__PURE__*/React.createElement("input", _extends({
|
|
46
|
+
className: "file-input-field hidden"
|
|
47
|
+
}, rest, {
|
|
48
|
+
type: "file",
|
|
49
|
+
onChange: function onChange(event) {
|
|
50
|
+
var files = event.target.files;
|
|
51
|
+
if (files) {
|
|
52
|
+
if (files.length === 0) {
|
|
53
|
+
setValueState('');
|
|
54
|
+
} else if (files.length === 1) {
|
|
55
|
+
setValueState(files[0].name);
|
|
56
|
+
} else if (files.length > 1) {
|
|
57
|
+
setValueState("".concat(files.length, " files"));
|
|
58
|
+
} else {
|
|
59
|
+
setValueState(event.target.value);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (typeof _onChange === 'function') {
|
|
63
|
+
_onChange(event);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
})));
|
|
67
|
+
};
|
|
68
|
+
export default UploadInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonVariantType } from '@scaleflex/ui-tw/core/button/button.types';
|
|
2
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
3
|
+
export interface UploadInputProps extends HTMLAttributes<HTMLInputElement> {
|
|
4
|
+
buttonLabel?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
buttonVariant?: ButtonVariantType;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
ref?: Ref<HTMLInputElement>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const Styled: {
|
|
2
|
+
UploadInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}>, never>, {
|
|
5
|
+
theme: import("styled-components").DefaultTheme;
|
|
6
|
+
}>> & string;
|
|
7
|
+
FileInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
8
|
+
ref?: ((instance: HTMLInputElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
9
|
+
}>, never>, never>> & string;
|
|
10
|
+
};
|
|
11
|
+
export default Styled;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { applyDisplayNames, generateClassNames } from '../../utils/functions';
|
|
3
|
+
import IStyled from '../input/input.styles';
|
|
4
|
+
var baseClassName = 'UploadInput';
|
|
5
|
+
var FileInput = /*#__PURE__*/styled.input.attrs({
|
|
6
|
+
className: generateClassNames(baseClassName, 'FileInput')
|
|
7
|
+
}).withConfig({
|
|
8
|
+
componentId: "sc-hwl9p2-0"
|
|
9
|
+
})(["display:none;"]);
|
|
10
|
+
|
|
11
|
+
// const UploadInput = styled.div.attrs({
|
|
12
|
+
// className: generateClassNames(baseClassName, 'root'),
|
|
13
|
+
// })<WithTheme>(
|
|
14
|
+
// ({ theme }) => css`
|
|
15
|
+
// position: relative;
|
|
16
|
+
//
|
|
17
|
+
// ${IStyled.Input} {
|
|
18
|
+
// padding: unset;
|
|
19
|
+
// width: 299px;
|
|
20
|
+
// column-gap: 0;
|
|
21
|
+
// transition: all 100ms ease-out;
|
|
22
|
+
//
|
|
23
|
+
// &:hover {
|
|
24
|
+
// ${BStyled.Button} {
|
|
25
|
+
// background-color: ${theme.palette[PaletteColor.AccentPrimaryHover]};
|
|
26
|
+
// transition: all 100ms ease-out;
|
|
27
|
+
// border: none;
|
|
28
|
+
// }
|
|
29
|
+
// }
|
|
30
|
+
// }
|
|
31
|
+
//
|
|
32
|
+
// ${IStyled.Base} {
|
|
33
|
+
// padding: 12px 8px 12px 12px;
|
|
34
|
+
// }
|
|
35
|
+
//
|
|
36
|
+
// ${BStyled.Button} {
|
|
37
|
+
// border-radius: 0 4px 4px 0;
|
|
38
|
+
// }
|
|
39
|
+
// `,
|
|
40
|
+
// )
|
|
41
|
+
|
|
42
|
+
var UploadInput = /*#__PURE__*/styled.div.attrs({
|
|
43
|
+
className: generateClassNames(baseClassName, 'root')
|
|
44
|
+
}).withConfig({
|
|
45
|
+
componentId: "sc-hwl9p2-1"
|
|
46
|
+
})(function () {
|
|
47
|
+
return css(["position:relative;", "{padding:unset;width:299px;column-gap:0;transition:all 100ms ease-out;}", "{padding:12px 8px 12px 12px;}"], IStyled.Input, IStyled.Base);
|
|
48
|
+
});
|
|
49
|
+
var Styled = applyDisplayNames({
|
|
50
|
+
UploadInput: UploadInput,
|
|
51
|
+
FileInput: FileInput
|
|
52
|
+
});
|
|
53
|
+
export default Styled;
|