@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,293 @@
|
|
|
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 = ["inputType", "children", "iconStart", "iconEnd", "iconChange", "inputActions", "clearIcon", "iconClickStart", "iconClickEnd", "clearIconClick", "size", "className", "style", "fullWidth", "readOnly", "disabled", "hideCopyIcon", "focusOnMount", "focusOnClick", "isEllipsis", "copyTextMessage", "copySuccessIcon", "error", "renderTags", "showPlaceholder", "InputProps", "ref"];
|
|
5
|
+
import CopyOutline from '@scaleflex/icons-tw/copy-outline';
|
|
6
|
+
import EyeClosed from '@scaleflex/icons-tw/eye-closed';
|
|
7
|
+
import EyeOpen from '@scaleflex/icons-tw/eye-open';
|
|
8
|
+
import Success from '@scaleflex/icons-tw/success';
|
|
9
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
10
|
+
import { cn } from '../../utils/functions/shadcn-utils';
|
|
11
|
+
import { InputSize } from '../../utils/types';
|
|
12
|
+
import { handleCopyIcon } from './input.utils';
|
|
13
|
+
import { Type } from './types';
|
|
14
|
+
var getIconSize = function getIconSize(sizeName, iconType) {
|
|
15
|
+
switch (sizeName) {
|
|
16
|
+
case InputSize.Md:
|
|
17
|
+
return iconType === 'start' ? 15 : 14;
|
|
18
|
+
case InputSize.Sm:
|
|
19
|
+
default:
|
|
20
|
+
return iconType === 'start' ? 13 : 10;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var getPasswordIconSize = function getPasswordIconSize(sizeName) {
|
|
24
|
+
switch (sizeName) {
|
|
25
|
+
case InputSize.Md:
|
|
26
|
+
return 16;
|
|
27
|
+
case InputSize.Sm:
|
|
28
|
+
default:
|
|
29
|
+
return 14;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var Input = function Input(_ref) {
|
|
33
|
+
var _rest$selectedItems;
|
|
34
|
+
var inputType = _ref.inputType,
|
|
35
|
+
children = _ref.children,
|
|
36
|
+
iconStart = _ref.iconStart,
|
|
37
|
+
iconEnd = _ref.iconEnd,
|
|
38
|
+
iconChange = _ref.iconChange,
|
|
39
|
+
inputActions = _ref.inputActions,
|
|
40
|
+
clearIcon = _ref.clearIcon,
|
|
41
|
+
iconClickStart = _ref.iconClickStart,
|
|
42
|
+
iconClickEnd = _ref.iconClickEnd,
|
|
43
|
+
clearIconClick = _ref.clearIconClick,
|
|
44
|
+
_ref$size = _ref.size,
|
|
45
|
+
size = _ref$size === void 0 ? InputSize.Md : _ref$size,
|
|
46
|
+
className = _ref.className,
|
|
47
|
+
style = _ref.style,
|
|
48
|
+
_ref$fullWidth = _ref.fullWidth,
|
|
49
|
+
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
50
|
+
_ref$readOnly = _ref.readOnly,
|
|
51
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
|
52
|
+
_ref$disabled = _ref.disabled,
|
|
53
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
54
|
+
_ref$hideCopyIcon = _ref.hideCopyIcon,
|
|
55
|
+
hideCopyIcon = _ref$hideCopyIcon === void 0 ? false : _ref$hideCopyIcon,
|
|
56
|
+
_ref$focusOnMount = _ref.focusOnMount,
|
|
57
|
+
focusOnMount = _ref$focusOnMount === void 0 ? false : _ref$focusOnMount,
|
|
58
|
+
_ref$focusOnClick = _ref.focusOnClick,
|
|
59
|
+
focusOnClick = _ref$focusOnClick === void 0 ? true : _ref$focusOnClick,
|
|
60
|
+
_ref$isEllipsis = _ref.isEllipsis,
|
|
61
|
+
isEllipsis = _ref$isEllipsis === void 0 ? false : _ref$isEllipsis,
|
|
62
|
+
_ref$copyTextMessage = _ref.copyTextMessage,
|
|
63
|
+
copyTextMessage = _ref$copyTextMessage === void 0 ? 'Copied!' : _ref$copyTextMessage,
|
|
64
|
+
_ref$copySuccessIcon = _ref.copySuccessIcon,
|
|
65
|
+
copySuccessIcon = _ref$copySuccessIcon === void 0 ? /*#__PURE__*/React.createElement(Success, {
|
|
66
|
+
size: 16
|
|
67
|
+
}) : _ref$copySuccessIcon,
|
|
68
|
+
_ref$error = _ref.error,
|
|
69
|
+
error = _ref$error === void 0 ? false : _ref$error,
|
|
70
|
+
renderTags = _ref.renderTags,
|
|
71
|
+
showPlaceholder = _ref.showPlaceholder,
|
|
72
|
+
InputPropsData = _ref.InputProps,
|
|
73
|
+
ref = _ref.ref,
|
|
74
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
75
|
+
var _useState = useState(false),
|
|
76
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
77
|
+
isHovering = _useState2[0],
|
|
78
|
+
setIsHovering = _useState2[1];
|
|
79
|
+
var _useState3 = useState(false),
|
|
80
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
|
+
showCopyMessage = _useState4[0],
|
|
82
|
+
setShowCopyMessage = _useState4[1];
|
|
83
|
+
var _useState5 = useState(false),
|
|
84
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
85
|
+
isVisible = _useState6[0],
|
|
86
|
+
setIsVisible = _useState6[1];
|
|
87
|
+
var inputRef = useRef(null);
|
|
88
|
+
var isSelectedItems = (_rest$selectedItems = rest.selectedItems) === null || _rest$selectedItems === void 0 ? void 0 : _rest$selectedItems.length;
|
|
89
|
+
var placeholder = rest.value || isSelectedItems ? '' : rest.placeholder;
|
|
90
|
+
var showCopyIcon = isHovering && readOnly && rest.value.length > 0 && !hideCopyIcon;
|
|
91
|
+
var handleFocus = function handleFocus() {
|
|
92
|
+
var _inputRef$current;
|
|
93
|
+
if (disabled || readOnly) return;
|
|
94
|
+
showPlaceholder === null || showPlaceholder === void 0 || showPlaceholder(false);
|
|
95
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
96
|
+
};
|
|
97
|
+
useEffect(function () {
|
|
98
|
+
if (focusOnMount) {
|
|
99
|
+
handleFocus();
|
|
100
|
+
}
|
|
101
|
+
}, []);
|
|
102
|
+
useEffect(function () {
|
|
103
|
+
setTimeout(function () {
|
|
104
|
+
return setShowCopyMessage(false);
|
|
105
|
+
}, 2000);
|
|
106
|
+
}, [showCopyMessage]);
|
|
107
|
+
var handleEntering = function handleEntering() {
|
|
108
|
+
setTimeout(function () {
|
|
109
|
+
setIsHovering(true);
|
|
110
|
+
}, 150);
|
|
111
|
+
};
|
|
112
|
+
var handleLeaving = function handleLeaving() {
|
|
113
|
+
setTimeout(function () {
|
|
114
|
+
setIsHovering(false);
|
|
115
|
+
}, 200);
|
|
116
|
+
};
|
|
117
|
+
var handleIconClick = function handleIconClick(event, type) {
|
|
118
|
+
if (disabled || readOnly) return;
|
|
119
|
+
if (focusOnClick) {
|
|
120
|
+
handleFocus();
|
|
121
|
+
}
|
|
122
|
+
if (type === 'start') {
|
|
123
|
+
if (iconClickStart) {
|
|
124
|
+
iconClickStart(event);
|
|
125
|
+
}
|
|
126
|
+
} else if (type === 'end') {
|
|
127
|
+
if (iconClickEnd) {
|
|
128
|
+
iconClickEnd(event);
|
|
129
|
+
}
|
|
130
|
+
} else if (clearIconClick) {
|
|
131
|
+
var _inputRef$current2;
|
|
132
|
+
event.stopPropagation();
|
|
133
|
+
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();
|
|
134
|
+
clearIconClick(event);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
var handleInputChange = function handleInputChange(event) {
|
|
138
|
+
var _rest$onChange;
|
|
139
|
+
var value = event.target.value;
|
|
140
|
+
if (value !== null && value !== void 0 && value.startsWith('-0')) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
(_rest$onChange = rest.onChange) === null || _rest$onChange === void 0 || _rest$onChange.call(rest, event);
|
|
144
|
+
};
|
|
145
|
+
var renderIcon = function renderIcon(_icon, type) {
|
|
146
|
+
return _icon ? /*#__PURE__*/React.createElement("span", {
|
|
147
|
+
className: cn('renderIcon', 'text-icons-primary', 'flex', 'shrink-0', "".concat((iconClickStart || iconClickEnd) && !disabled && !readOnly ? 'pointer' : 'default'), "".concat(type === 'end' ? 'text-icons-secondary' : ''), "".concat(disabled && '!text-textplaceholder')),
|
|
148
|
+
onClick: function onClick(event) {
|
|
149
|
+
return handleIconClick(event, type);
|
|
150
|
+
}
|
|
151
|
+
}, typeof _icon === 'function' ? _icon({
|
|
152
|
+
size: getIconSize(size, type)
|
|
153
|
+
}) : _icon) : undefined;
|
|
154
|
+
};
|
|
155
|
+
var renderClearIcon = function renderClearIcon() {
|
|
156
|
+
return disabled || readOnly || !clearIcon ? undefined : /*#__PURE__*/React.createElement("span", {
|
|
157
|
+
className: "renderClearIcon text-icons-primary flex cursor-pointer",
|
|
158
|
+
onClick: function onClick(event) {
|
|
159
|
+
return handleIconClick(event, 'clear');
|
|
160
|
+
}
|
|
161
|
+
}, typeof clearIcon === 'function' ? clearIcon({
|
|
162
|
+
size: getIconSize(size, 'clear')
|
|
163
|
+
}) : clearIcon);
|
|
164
|
+
};
|
|
165
|
+
var copyIconClasses = 'text-icons-secondary flex cursor-pointer';
|
|
166
|
+
var renderCopyIcon = function renderCopyIcon(icon) {
|
|
167
|
+
return showCopyIcon ? /*#__PURE__*/React.createElement("span", {
|
|
168
|
+
className: copyIconClasses,
|
|
169
|
+
onClick: function onClick() {
|
|
170
|
+
return handleCopyIcon(rest.value, setShowCopyMessage);
|
|
171
|
+
}
|
|
172
|
+
}, icon) : undefined;
|
|
173
|
+
};
|
|
174
|
+
var toggleVisibility = function toggleVisibility(event) {
|
|
175
|
+
event.stopPropagation();
|
|
176
|
+
setIsVisible(!isVisible);
|
|
177
|
+
};
|
|
178
|
+
var renderPasswordIcon = function renderPasswordIcon() {
|
|
179
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
180
|
+
className: copyIconClasses,
|
|
181
|
+
onClick: function onClick(event) {
|
|
182
|
+
return toggleVisibility(event);
|
|
183
|
+
}
|
|
184
|
+
}, isVisible ? /*#__PURE__*/React.createElement(EyeClosed, {
|
|
185
|
+
size: getPasswordIconSize(size)
|
|
186
|
+
}) : /*#__PURE__*/React.createElement(EyeOpen, {
|
|
187
|
+
size: getPasswordIconSize(size)
|
|
188
|
+
}));
|
|
189
|
+
};
|
|
190
|
+
var getInputType = function getInputType() {
|
|
191
|
+
if (!inputType && rest !== null && rest !== void 0 && rest.type) {
|
|
192
|
+
return rest === null || rest === void 0 ? void 0 : rest.type;
|
|
193
|
+
}
|
|
194
|
+
if (inputType === Type.Password && !isVisible) {
|
|
195
|
+
return Type.Password;
|
|
196
|
+
}
|
|
197
|
+
return Type.Text;
|
|
198
|
+
};
|
|
199
|
+
var renderField = function renderField() {
|
|
200
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
201
|
+
className: cn('inline-flex h-full max-h-30 w-full flex-wrap gap-2 [&::-webkit-scrollbar]:hidden', "".concat(isSelectedItems ? 'overflow-y-auto' : ''))
|
|
202
|
+
}, renderTags && renderTags(), /*#__PURE__*/React.createElement("input", _extends({
|
|
203
|
+
className: cn('file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex min-w-0 rounded-md text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive', '[&::placeholder]:text-textplaceholder m-0 block w-full min-w-fit border-0 bg-transparent p-0 text-inherit outline-none', "".concat(isEllipsis ? 'text-ellipsis' : ''))
|
|
204
|
+
}, rest, {
|
|
205
|
+
"data-slot": "input",
|
|
206
|
+
placeholder: placeholder,
|
|
207
|
+
ref: inputRef,
|
|
208
|
+
readOnly: Boolean(readOnly),
|
|
209
|
+
type: getInputType(),
|
|
210
|
+
onChange: handleInputChange
|
|
211
|
+
})));
|
|
212
|
+
};
|
|
213
|
+
var renderCopyText = function renderCopyText() {
|
|
214
|
+
var bottomValue = size === InputSize.Md ? 'bottom-11' : 'bottom-9';
|
|
215
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
216
|
+
className: "shadow-(0px 2px 6px) shadow-large-shadow absolute right-0 flex max-h-8 items-center gap-1.5 rounded-sm bg-white ".concat(bottomValue, " ")
|
|
217
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
218
|
+
className: "text-icons-primary flex"
|
|
219
|
+
}, copySuccessIcon), /*#__PURE__*/React.createElement("span", {
|
|
220
|
+
className: "text-textprimary flex flex-nowrap"
|
|
221
|
+
}, copyTextMessage), /*#__PURE__*/React.createElement("span", {
|
|
222
|
+
className: "text-textprimary flex whitespace-nowrap"
|
|
223
|
+
}, copyTextMessage));
|
|
224
|
+
};
|
|
225
|
+
var renderInputActions = function renderInputActions(inputActions) {
|
|
226
|
+
if (!inputActions) return;
|
|
227
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
228
|
+
className: "box-border w-full pt-4"
|
|
229
|
+
}, inputActions);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// ==========================
|
|
233
|
+
// ==========================
|
|
234
|
+
|
|
235
|
+
var divContainerWrapClassNames = cn(className, 'relative', 'flex', 'box-border', 'gap-2', 'cursor-text', 'transition-all', 'duration-100', 'ease-out', 'border-1', 'border-solid', 'rounded-sm', 'box-content', 'hover:[&_svg]:!text-secondary-hover');
|
|
236
|
+
if (inputActions) {
|
|
237
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'items-stretch', 'column');
|
|
238
|
+
} else {
|
|
239
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'row');
|
|
240
|
+
}
|
|
241
|
+
if (fullWidth) {
|
|
242
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'w-full');
|
|
243
|
+
} else {
|
|
244
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'w-80'); // w-80 == 320px
|
|
245
|
+
}
|
|
246
|
+
if (readOnly || disabled) {
|
|
247
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'bg-background-hover');
|
|
248
|
+
if (disabled) {
|
|
249
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'pointer-events-none', 'text-textplaceholder', 'border-borders-secondary');
|
|
250
|
+
}
|
|
251
|
+
if (readOnly) {
|
|
252
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'border-borders-item');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
//.
|
|
256
|
+
} else {
|
|
257
|
+
// !readonly && !disabled
|
|
258
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'pointer-events-auto', 'bg-background-stateless', 'border-borders-primary-stateless', 'hover:bg-background-stateless', 'hover:border-borders-primary-hover', 'hover:[&_svg]:text-icons-primary',
|
|
259
|
+
// &:hover svg { color: ... }
|
|
260
|
+
|
|
261
|
+
'focus-within:!bg-background-secondary', 'focus-within:border-accent-primary', 'focus-within:hover:border-accent-primary');
|
|
262
|
+
}
|
|
263
|
+
if (InputSize.Sm) {
|
|
264
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'py-2 px-3 h-8');
|
|
265
|
+
}
|
|
266
|
+
if (InputSize.Md) {
|
|
267
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'py-3 px-4 h-10');
|
|
268
|
+
}
|
|
269
|
+
if (isSelectedItems) {
|
|
270
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'h-fit');
|
|
271
|
+
}
|
|
272
|
+
if (error) {
|
|
273
|
+
divContainerWrapClassNames = cn(divContainerWrapClassNames, 'bg-background-secondary', 'border-1', 'border-error');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ==========================
|
|
277
|
+
// ==========================
|
|
278
|
+
|
|
279
|
+
var divContainerClassNames = cn('flex', 'items-center', 'w-full', 'gap-2', 'box-border');
|
|
280
|
+
divContainerClassNames = cn(divContainerClassNames, '');
|
|
281
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
282
|
+
ref: ref,
|
|
283
|
+
className: divContainerWrapClassNames,
|
|
284
|
+
onMouseEnter: handleEntering,
|
|
285
|
+
onMouseLeave: handleLeaving,
|
|
286
|
+
style: style
|
|
287
|
+
}, InputPropsData || {}), /*#__PURE__*/React.createElement("div", {
|
|
288
|
+
className: divContainerClassNames
|
|
289
|
+
}, renderIcon(iconStart, 'start'), renderField(), renderCopyIcon(/*#__PURE__*/React.createElement(CopyOutline, {
|
|
290
|
+
size: getIconSize(size, 'copy')
|
|
291
|
+
})), showCopyMessage && renderCopyText(), renderClearIcon(), inputType === Type.Password && renderPasswordIcon(), renderIcon(iconEnd, 'end'), renderIcon(iconChange, ''), children && /*#__PURE__*/React.createElement(React.Fragment, null, children)), renderInputActions(inputActions));
|
|
292
|
+
};
|
|
293
|
+
export default Input;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WithTheme } from '../../theme/entity';
|
|
2
|
+
export declare const sizeInputMixin: {
|
|
3
|
+
sm: string;
|
|
4
|
+
md: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const sizeCrossInputMixin: {
|
|
7
|
+
sm: string;
|
|
8
|
+
md: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const fontSizeInputMixin: {
|
|
11
|
+
sm: ({ theme: { typography: { font }, }, }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
12
|
+
md: ({ theme: { typography: { font }, }, }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
13
|
+
};
|
|
14
|
+
export declare const sizeInputLabelMixin: {
|
|
15
|
+
sm: ({ theme: { typography: { font }, }, }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
16
|
+
md: ({ theme: { typography: { font }, }, }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
17
|
+
};
|
|
18
|
+
export declare const errorMixin: ({ theme: { palette } }: WithTheme) => import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { css } from 'styled-components';
|
|
3
|
+
import { InputSize } from '../../utils/types';
|
|
4
|
+
import { Color as PaletteColor } from '../../utils/types/palette';
|
|
5
|
+
import { FontVariant as FV } from '../../utils/types/typography';
|
|
6
|
+
export var sizeInputMixin = _defineProperty(_defineProperty({}, InputSize.Sm, "\n padding: 8px 12px;\n height: 32px;\n "), InputSize.Md, "\n padding: 11px 16px;\n height: 40px;\n ");
|
|
7
|
+
export var sizeCrossInputMixin = _defineProperty(_defineProperty({}, InputSize.Sm, "\n padding: 4px 6px 4px 12px;\n max-height: 32px;\n "), InputSize.Md, "\n padding: 0px 4px 0px 16px;\n max-height: 40px;\n ");
|
|
8
|
+
export var fontSizeInputMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function (_ref) {
|
|
9
|
+
var font = _ref.theme.typography.font;
|
|
10
|
+
return css(["", ""], font[FV.InputMd]);
|
|
11
|
+
}), InputSize.Md, function (_ref2) {
|
|
12
|
+
var font = _ref2.theme.typography.font;
|
|
13
|
+
return css(["", ""], font[FV.InputLg]);
|
|
14
|
+
});
|
|
15
|
+
export var sizeInputLabelMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function (_ref3) {
|
|
16
|
+
var font = _ref3.theme.typography.font;
|
|
17
|
+
return css(font[FV.LabelSmall]);
|
|
18
|
+
}), InputSize.Md, function (_ref4) {
|
|
19
|
+
var font = _ref4.theme.typography.font;
|
|
20
|
+
return css(font[FV.LabelMedium]);
|
|
21
|
+
});
|
|
22
|
+
export var errorMixin = function errorMixin(_ref5) {
|
|
23
|
+
var palette = _ref5.theme.palette;
|
|
24
|
+
return css(["background:", " !important;border:1px solid ", " !important;"], palette[PaletteColor.BackgroundSecondary], palette[PaletteColor.Error]);
|
|
25
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IconProps } from '@scaleflex/icons-tw/icon.props';
|
|
2
|
+
import React, { Ref } from 'react';
|
|
3
|
+
import type { Values } from '../../utils/types';
|
|
4
|
+
import { InputBackgroundColor, InputSize } from '../../utils/types';
|
|
5
|
+
export type InputSizeType = Values<typeof InputSize>;
|
|
6
|
+
export type InputBackgroundType = Values<typeof InputBackgroundColor>;
|
|
7
|
+
export type IconFuncType = (props: IconProps) => React.ReactNode;
|
|
8
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
isEllipsis?: boolean;
|
|
12
|
+
isHovering?: boolean;
|
|
13
|
+
size?: InputSizeType;
|
|
14
|
+
iconStart?: React.ReactNode | IconFuncType;
|
|
15
|
+
iconEnd?: React.ReactNode | IconFuncType;
|
|
16
|
+
inputActions?: React.ReactNode;
|
|
17
|
+
iconChange?: React.ReactNode | IconFuncType;
|
|
18
|
+
clearIcon?: React.ReactNode | IconFuncType;
|
|
19
|
+
inputType?: string;
|
|
20
|
+
type?: any;
|
|
21
|
+
error?: boolean;
|
|
22
|
+
fullWidth?: boolean;
|
|
23
|
+
isSearchInput?: boolean;
|
|
24
|
+
hideCopyIcon?: boolean;
|
|
25
|
+
copyTextMessage?: string;
|
|
26
|
+
copySuccessIcon?: React.ReactNode;
|
|
27
|
+
value?: any;
|
|
28
|
+
selectedItems?: any;
|
|
29
|
+
isSelectedItems?: boolean;
|
|
30
|
+
renderTags?: () => React.ReactNode;
|
|
31
|
+
iconClickStart?: (event: Event) => void;
|
|
32
|
+
iconClickEnd?: (event: Event) => void;
|
|
33
|
+
clearIconClick?: (event: Event) => void;
|
|
34
|
+
focusOnMount?: boolean;
|
|
35
|
+
focusOnClick?: boolean;
|
|
36
|
+
showPlaceholder?: (value: boolean) => void;
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
InputProps?: React.HtmlHTMLAttributes<HTMLDivElement>;
|
|
39
|
+
ref?: Ref<HTMLInputElement>;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { InputProps } from './input.props';
|
|
2
|
+
declare const Styled: {
|
|
3
|
+
Input: 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>, {
|
|
6
|
+
$isSelectedItems?: boolean;
|
|
7
|
+
$fullWidth?: boolean;
|
|
8
|
+
$error?: boolean;
|
|
9
|
+
$hasInputActions?: boolean;
|
|
10
|
+
} & InputProps & {
|
|
11
|
+
theme: import("styled-components").DefaultTheme;
|
|
12
|
+
}>> & string;
|
|
13
|
+
Container: 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"> & {
|
|
14
|
+
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;
|
|
15
|
+
}>, never>, InputProps>> & string;
|
|
16
|
+
Base: 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").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
17
|
+
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;
|
|
18
|
+
}>, never>, {
|
|
19
|
+
$isEllipsis?: boolean;
|
|
20
|
+
} & {
|
|
21
|
+
theme: import("styled-components").DefaultTheme;
|
|
22
|
+
}>> & string;
|
|
23
|
+
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<HTMLSpanElement>, HTMLSpanElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
24
|
+
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;
|
|
25
|
+
}>, never>, {
|
|
26
|
+
$iconType: string;
|
|
27
|
+
} & InputProps & {
|
|
28
|
+
theme: import("styled-components").DefaultTheme;
|
|
29
|
+
}>> & string;
|
|
30
|
+
CopyIcon: 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"> & {
|
|
31
|
+
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;
|
|
32
|
+
}>, never>, {
|
|
33
|
+
theme: import("styled-components").DefaultTheme;
|
|
34
|
+
}>> & string;
|
|
35
|
+
PasswordIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<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"> & {
|
|
36
|
+
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;
|
|
37
|
+
}>, never>, "theme"> & {
|
|
38
|
+
theme: import("styled-components").DefaultTheme;
|
|
39
|
+
}, 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"> & {
|
|
40
|
+
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;
|
|
41
|
+
}>, never>, "theme"> & {
|
|
42
|
+
theme: import("styled-components").DefaultTheme;
|
|
43
|
+
}>, never>, never>> & string;
|
|
44
|
+
ClearIcon: 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"> & {
|
|
45
|
+
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;
|
|
46
|
+
}>, never>, {
|
|
47
|
+
theme: import("styled-components").DefaultTheme;
|
|
48
|
+
}>> & string;
|
|
49
|
+
NotificationBox: 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"> & {
|
|
50
|
+
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;
|
|
51
|
+
}>, never>, {
|
|
52
|
+
isTextarea?: boolean;
|
|
53
|
+
} & InputProps & {
|
|
54
|
+
theme: import("styled-components").DefaultTheme;
|
|
55
|
+
}>> & string;
|
|
56
|
+
NotificationIcon: 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"> & {
|
|
57
|
+
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;
|
|
58
|
+
}>, never>, {
|
|
59
|
+
theme: import("styled-components").DefaultTheme;
|
|
60
|
+
}>> & string;
|
|
61
|
+
NotificationText: 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"> & {
|
|
62
|
+
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;
|
|
63
|
+
}>, never>, {
|
|
64
|
+
theme: import("styled-components").DefaultTheme;
|
|
65
|
+
}>> & string;
|
|
66
|
+
FieldWrapper: 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"> & {
|
|
67
|
+
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;
|
|
68
|
+
}>, never>, {
|
|
69
|
+
$isSelectedItems: boolean;
|
|
70
|
+
}>> & string;
|
|
71
|
+
InputActions: 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"> & {
|
|
72
|
+
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;
|
|
73
|
+
}>, never>, never>> & string;
|
|
74
|
+
InputContent: 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"> & {
|
|
75
|
+
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;
|
|
76
|
+
}>, never>, never>> & string;
|
|
77
|
+
};
|
|
78
|
+
export default Styled;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { applyDisplayNames, generateClassNames } from '../../utils/functions';
|
|
3
|
+
import { InputSize } from '../../utils/types';
|
|
4
|
+
import { Color as PColor } from '../../utils/types/palette';
|
|
5
|
+
import { BorderRadiusSize as BRSize } from '../../utils/types/shape';
|
|
6
|
+
import { FontVariant as FV } from '../../utils/types/typography';
|
|
7
|
+
import { errorMixin, fontSizeInputMixin, sizeInputMixin } from './input.mixin';
|
|
8
|
+
import { getInputBackgroundColor, getInputBorderColor, getInputTextColor } from './input.utils';
|
|
9
|
+
var baseClassName = 'Input';
|
|
10
|
+
var Icon = /*#__PURE__*/styled.span.attrs({
|
|
11
|
+
className: generateClassNames(baseClassName, 'Icon')
|
|
12
|
+
}).withConfig({
|
|
13
|
+
componentId: "sc-p6n03x-0"
|
|
14
|
+
})(function (_ref) {
|
|
15
|
+
var iconClickStart = _ref.iconClickStart,
|
|
16
|
+
iconClickEnd = _ref.iconClickEnd,
|
|
17
|
+
disabled = _ref.disabled,
|
|
18
|
+
readOnly = _ref.readOnly,
|
|
19
|
+
$iconType = _ref.$iconType,
|
|
20
|
+
palette = _ref.theme.palette;
|
|
21
|
+
return css(["display:flex;color:", ";cursor:", ";flex-shrink:0;", ""], palette[PColor.IconsPrimary], (iconClickStart || iconClickEnd) && !disabled && !readOnly ? 'pointer' : 'default', $iconType === 'end' && css(["color:", ";"], palette[PColor.IconsSecondary]));
|
|
22
|
+
});
|
|
23
|
+
var CopyIcon = /*#__PURE__*/styled.span.attrs({
|
|
24
|
+
className: generateClassNames(baseClassName, 'CopyIcon')
|
|
25
|
+
}).withConfig({
|
|
26
|
+
componentId: "sc-p6n03x-1"
|
|
27
|
+
})(function (_ref2) {
|
|
28
|
+
var palette = _ref2.theme.palette;
|
|
29
|
+
return css(["display:flex;color:", ";cursor:pointer;"], palette[PColor.IconsSecondary]);
|
|
30
|
+
});
|
|
31
|
+
var PasswordIcon = /*#__PURE__*/styled(CopyIcon).attrs({
|
|
32
|
+
className: generateClassNames(baseClassName, 'PasswordIcon')
|
|
33
|
+
}).withConfig({
|
|
34
|
+
componentId: "sc-p6n03x-2"
|
|
35
|
+
})([""]);
|
|
36
|
+
var Container = /*#__PURE__*/styled.div.attrs({
|
|
37
|
+
className: generateClassNames(baseClassName, 'Container')
|
|
38
|
+
}).withConfig({
|
|
39
|
+
componentId: "sc-p6n03x-3"
|
|
40
|
+
})(function () {
|
|
41
|
+
return css(["display:block;color:inherit;font-size:inherit;width:100%;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;"]);
|
|
42
|
+
});
|
|
43
|
+
var Base = /*#__PURE__*/styled.input.attrs({
|
|
44
|
+
className: generateClassNames(baseClassName, 'Base')
|
|
45
|
+
}).withConfig({
|
|
46
|
+
componentId: "sc-p6n03x-4"
|
|
47
|
+
})(function (_ref3) {
|
|
48
|
+
var palette = _ref3.theme.palette,
|
|
49
|
+
_ref3$$isEllipsis = _ref3.$isEllipsis,
|
|
50
|
+
$isEllipsis = _ref3$$isEllipsis === void 0 ? false : _ref3$$isEllipsis;
|
|
51
|
+
return css(["display:block;color:inherit;width:100%;min-width:fit-content;margin:0;padding:0;border:0;background-color:transparent;outline:none;", " &::placeholder{color:", ";}"], $isEllipsis && css(["text-overflow:ellipsis;"]), palette[PColor.TextPlaceholder]);
|
|
52
|
+
});
|
|
53
|
+
var Input = /*#__PURE__*/styled.div.attrs({
|
|
54
|
+
className: generateClassNames(baseClassName, 'root')
|
|
55
|
+
}).withConfig({
|
|
56
|
+
componentId: "sc-p6n03x-5"
|
|
57
|
+
})(function (_ref4) {
|
|
58
|
+
var _ref4$size = _ref4.size,
|
|
59
|
+
size = _ref4$size === void 0 ? InputSize.Md : _ref4$size,
|
|
60
|
+
_ref4$$error = _ref4.$error,
|
|
61
|
+
$error = _ref4$$error === void 0 ? false : _ref4$$error,
|
|
62
|
+
_ref4$$fullWidth = _ref4.$fullWidth,
|
|
63
|
+
$fullWidth = _ref4$$fullWidth === void 0 ? false : _ref4$$fullWidth,
|
|
64
|
+
_ref4$readOnly = _ref4.readOnly,
|
|
65
|
+
readOnly = _ref4$readOnly === void 0 ? false : _ref4$readOnly,
|
|
66
|
+
_ref4$disabled = _ref4.disabled,
|
|
67
|
+
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
68
|
+
_ref4$isHovering = _ref4.isHovering,
|
|
69
|
+
isHovering = _ref4$isHovering === void 0 ? false : _ref4$isHovering,
|
|
70
|
+
_ref4$$isSelectedItem = _ref4.$isSelectedItems,
|
|
71
|
+
$isSelectedItems = _ref4$$isSelectedItem === void 0 ? false : _ref4$$isSelectedItem,
|
|
72
|
+
_ref4$$hasInputAction = _ref4.$hasInputActions,
|
|
73
|
+
$hasInputActions = _ref4$$hasInputAction === void 0 ? false : _ref4$$hasInputAction,
|
|
74
|
+
theme = _ref4.theme;
|
|
75
|
+
return css(["position:relative;display:flex;flex-direction:", ";", " box-sizing:border-box;column-gap:8px;cursor:text;transition:all 100ms ease-out;width:", ";pointer-events:", ";background-color:", ";border-radius:", ";border:1px solid ", ";color:", ";", " ", ";", "{", "}", " ", " &:hover{color:", ";}", ""], !$hasInputActions ? 'row' : 'column', $hasInputActions && 'align-items: stretch;', $fullWidth ? '100%' : '300px', disabled ? 'none' : 'auto', getInputBackgroundColor(readOnly, disabled), theme.shape.borderRadius[BRSize.Md], getInputBorderColor(readOnly, disabled), disabled ? theme.palette[PColor.TextPlaceholder] : theme.palette[PColor.TextPrimary], sizeInputMixin[size], $isSelectedItems && "\n height: fit-content;\n\n ".concat(Base, " {\n max-width: fit-content;\n min-width: 20px;\n flex-grow: 1;\n width: 40px;\n }\n "), Base, fontSizeInputMixin[size], !readOnly && !disabled && css(["&:focus-within{background-color:", "!important;border:1px solid ", ";&:hover{border:1px solid ", ";", "{color:", ";}}}", " &:hover{background-color:", ";border:1px solid ", ";", "{color:", ";}}"], theme.palette[PColor.BackgroundSecondary], theme.palette[PColor.AccentStateless], theme.palette[PColor.AccentStateless], Icon, theme.palette[PColor.IconsPrimary], isHovering && css(["", "{color:", ";}"], Icon, theme.palette[PColor.IconsPrimaryHover]), theme.palette[PColor.BackgroundStateless], theme.palette[PColor.BordersPrimaryHover], Icon, theme.palette[PColor.IconsPrimaryHover]), disabled && css(["", "{color:", ";}"], Icon, theme.palette[PColor.IconsMuted]), getInputTextColor(readOnly, disabled), $error && errorMixin);
|
|
76
|
+
});
|
|
77
|
+
var ClearIcon = /*#__PURE__*/styled.span.attrs({
|
|
78
|
+
className: generateClassNames(baseClassName, 'ClearIcon')
|
|
79
|
+
}).withConfig({
|
|
80
|
+
componentId: "sc-p6n03x-6"
|
|
81
|
+
})(function (_ref5) {
|
|
82
|
+
var palette = _ref5.theme.palette;
|
|
83
|
+
return css(["display:flex;cursor:pointer;color:", ";"], palette[PColor.IconsPrimary]);
|
|
84
|
+
});
|
|
85
|
+
var NotificationBox = /*#__PURE__*/styled.div.attrs({
|
|
86
|
+
className: generateClassNames(baseClassName, 'NotificationBox')
|
|
87
|
+
}).withConfig({
|
|
88
|
+
componentId: "sc-p6n03x-7"
|
|
89
|
+
})(function (_ref6) {
|
|
90
|
+
var _ref6$size = _ref6.size,
|
|
91
|
+
size = _ref6$size === void 0 ? InputSize.Md : _ref6$size,
|
|
92
|
+
_ref6$isTextarea = _ref6.isTextarea,
|
|
93
|
+
isTextarea = _ref6$isTextarea === void 0 ? false : _ref6$isTextarea,
|
|
94
|
+
palette = _ref6.theme.palette;
|
|
95
|
+
return css(["display:flex;position:absolute;align-items:center;max-height:34px;right:0px;padding:8px 12px;gap:6px;bottom:", ";box-shadow:0px 2px 6px ", ";background-color:", ";border-radius:4px;align-items:center;", ""], size === InputSize.Md ? '45px' : '35px', palette[PColor.LargeShadow], palette[PColor.BackgroundStateless], isTextarea && "\n bottom: ".concat(size === InputSize.Md ? 27 : 22, "px;\n right: ").concat(size === InputSize.Md ? 16 : 12, "px;\n "));
|
|
96
|
+
});
|
|
97
|
+
var NotificationIcon = /*#__PURE__*/styled.span.attrs({
|
|
98
|
+
className: generateClassNames(baseClassName, 'NotificationIcon')
|
|
99
|
+
}).withConfig({
|
|
100
|
+
componentId: "sc-p6n03x-8"
|
|
101
|
+
})(function (_ref7) {
|
|
102
|
+
var palette = _ref7.theme.palette;
|
|
103
|
+
return css(["display:flex;color:", ";"], palette[PColor.IconsPrimary]);
|
|
104
|
+
});
|
|
105
|
+
var NotificationText = /*#__PURE__*/styled.span.attrs({
|
|
106
|
+
className: generateClassNames(baseClassName, 'NotificationText')
|
|
107
|
+
}).withConfig({
|
|
108
|
+
componentId: "sc-p6n03x-9"
|
|
109
|
+
})(function (_ref8) {
|
|
110
|
+
var _ref8$theme = _ref8.theme,
|
|
111
|
+
palette = _ref8$theme.palette,
|
|
112
|
+
font = _ref8$theme.typography.font;
|
|
113
|
+
return css(["display:flex;white-space:nowrap;", ";color:", ";"], font[FV.TextSmall], palette[PColor.TextPrimary]);
|
|
114
|
+
});
|
|
115
|
+
var FieldWrapper = /*#__PURE__*/styled.div.attrs({
|
|
116
|
+
className: generateClassNames(baseClassName, 'fieldWrapper')
|
|
117
|
+
}).withConfig({
|
|
118
|
+
componentId: "sc-p6n03x-10"
|
|
119
|
+
})(function (_ref9) {
|
|
120
|
+
var $isSelectedItems = _ref9.$isSelectedItems;
|
|
121
|
+
return css(["width:100%;height:100%;display:inline-flex;flex-wrap:wrap;gap:8px;max-height:120px;", ";::-webkit-scrollbar{display:none;}"], $isSelectedItems && "\n overflow-y: auto;\n ");
|
|
122
|
+
});
|
|
123
|
+
var InputActions = /*#__PURE__*/styled.div.attrs({
|
|
124
|
+
className: generateClassNames(baseClassName, 'inputActions')
|
|
125
|
+
}).withConfig({
|
|
126
|
+
componentId: "sc-p6n03x-11"
|
|
127
|
+
})(["padding-top:16px;width:100%;box-sizing:border-box;"]);
|
|
128
|
+
var InputContent = /*#__PURE__*/styled.div.attrs({
|
|
129
|
+
className: generateClassNames(baseClassName, 'inputContent')
|
|
130
|
+
}).withConfig({
|
|
131
|
+
componentId: "sc-p6n03x-12"
|
|
132
|
+
})(["display:flex;align-items:center;width:100%;column-gap:8px;box-sizing:border-box;"]);
|
|
133
|
+
var Styled = applyDisplayNames({
|
|
134
|
+
Input: Input,
|
|
135
|
+
Container: Container,
|
|
136
|
+
Base: Base,
|
|
137
|
+
Icon: Icon,
|
|
138
|
+
CopyIcon: CopyIcon,
|
|
139
|
+
PasswordIcon: PasswordIcon,
|
|
140
|
+
ClearIcon: ClearIcon,
|
|
141
|
+
NotificationBox: NotificationBox,
|
|
142
|
+
NotificationIcon: NotificationIcon,
|
|
143
|
+
NotificationText: NotificationText,
|
|
144
|
+
FieldWrapper: FieldWrapper,
|
|
145
|
+
InputActions: InputActions,
|
|
146
|
+
InputContent: InputContent
|
|
147
|
+
});
|
|
148
|
+
export default Styled;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getInputBackgroundColor: (readOnly?: boolean, disabled?: boolean) => string | undefined;
|
|
2
|
+
export declare const getInputTextColor: (readOnly?: boolean, disabled?: boolean) => string | undefined;
|
|
3
|
+
export declare const getInputBorderColor: (readOnly?: boolean, disabled?: boolean) => string | undefined;
|
|
4
|
+
export declare const handleCopyIcon: (value: string, setShowCopyMessage: any) => void;
|