carbon-react 158.50.0-beta.1 → 159.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/__internal__/checkable-input/__next__/checkable-input.component.js +1 -1
- package/esm/__internal__/checkable-input/__next__/checkable-input.style.js +1 -1
- package/esm/__internal__/checkable-input/checkable-input.style.js +1 -1
- package/esm/__internal__/error-border/error-border.style.d.ts +4 -0
- package/esm/__internal__/error-border/error-border.style.js +1 -0
- package/esm/__internal__/fieldset/__next__/fieldset.component.js +1 -1
- package/esm/__internal__/fieldset/fieldset.component.js +1 -1
- package/esm/__internal__/fieldset-validation-context/fieldset-validation-context.d.ts +6 -0
- package/esm/__internal__/fieldset-validation-context/index.d.ts +1 -0
- package/esm/__internal__/fieldset-validation-context/index.js +1 -0
- package/esm/__internal__/form-field/form-field.component.d.ts +1 -1
- package/esm/__internal__/form-field/form-field.component.js +1 -1
- package/esm/__internal__/hint-text/hint-text.component.d.ts +6 -21
- package/esm/__internal__/hint-text/hint-text.component.js +1 -1
- package/esm/__internal__/hint-text/hint-text.style.d.ts +5 -2
- package/esm/__internal__/hint-text/hint-text.style.js +1 -1
- package/esm/__internal__/hint-text/index.d.ts +0 -1
- package/esm/__internal__/input/index.d.ts +2 -5
- package/esm/__internal__/input/index.js +1 -1
- package/esm/__internal__/input/input-style-overrides.style.d.ts +8 -0
- package/esm/__internal__/input/input-style-overrides.style.js +1 -0
- package/esm/__internal__/input/input.component.d.ts +22 -31
- package/esm/__internal__/input/input.component.js +1 -1
- package/esm/__internal__/input/input.style.d.ts +9 -5
- package/esm/__internal__/input/input.style.js +1 -1
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +9 -3
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.js +1 -1
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +7 -9
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
- package/esm/__internal__/label/index.d.ts +0 -1
- package/esm/__internal__/label/label.component.d.ts +14 -31
- package/esm/__internal__/label/label.component.js +1 -1
- package/esm/__internal__/label/label.style.d.ts +5 -22
- package/esm/__internal__/label/label.style.js +1 -1
- package/esm/__internal__/legacy-error-border/error-border.style.js +1 -0
- package/esm/__internal__/legacy-hint-text/hint-text.component.d.ts +27 -0
- package/esm/__internal__/legacy-hint-text/hint-text.component.js +1 -0
- package/esm/__internal__/legacy-hint-text/hint-text.style.d.ts +3 -0
- package/esm/__internal__/legacy-hint-text/hint-text.style.js +1 -0
- package/esm/__internal__/legacy-hint-text/index.d.ts +2 -0
- package/esm/__internal__/legacy-hint-text/index.js +1 -0
- package/esm/__internal__/legacy-input/index.d.ts +5 -0
- package/esm/__internal__/legacy-input/index.js +1 -0
- package/{lib/__internal__/input → esm/__internal__/legacy-input}/input-presentation.style.d.ts +1 -1
- package/esm/__internal__/{input → legacy-input}/input-presentation.style.js +1 -1
- package/esm/__internal__/legacy-input/input.component.d.ts +54 -0
- package/esm/__internal__/legacy-input/input.component.js +1 -0
- package/esm/__internal__/legacy-input/input.style.d.ts +3 -0
- package/esm/__internal__/legacy-input/input.style.js +1 -0
- package/esm/__internal__/legacy-label/index.d.ts +2 -0
- package/esm/__internal__/legacy-label/index.js +1 -0
- package/esm/__internal__/legacy-label/label.component.d.ts +37 -0
- package/esm/__internal__/legacy-label/label.component.js +1 -0
- package/esm/__internal__/legacy-label/label.style.d.ts +25 -0
- package/esm/__internal__/legacy-label/label.style.js +1 -0
- package/esm/__internal__/utils/helpers/combine-refs/index.d.ts +3 -0
- package/esm/__internal__/utils/helpers/combine-refs/index.js +1 -0
- package/esm/__internal__/validation-message/__next__/index.d.ts +1 -0
- package/esm/__internal__/validation-message/__next__/index.js +1 -0
- package/esm/__internal__/validation-message/__next__/validation-message.component.d.ts +20 -0
- package/esm/__internal__/validation-message/__next__/validation-message.component.js +1 -0
- package/esm/__internal__/validation-message/__next__/validation-message.style.d.ts +6 -0
- package/esm/__internal__/validation-message/__next__/validation-message.style.js +1 -0
- package/esm/__spec_helper__/mock-match-media.d.ts +0 -2
- package/esm/__spec_helper__/mock-match-media.js +1 -1
- package/esm/components/button-toggle/button-toggle-group/button-toggle-group.component.js +1 -1
- package/esm/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
- package/esm/components/checkbox/checkbox.style.js +1 -1
- package/esm/components/date/date.component.js +1 -1
- package/esm/components/date/date.style.js +1 -1
- package/esm/components/date-range/date-range.style.js +1 -1
- package/esm/components/file-input/file-input.component.d.ts +1 -1
- package/esm/components/file-input/file-input.component.js +1 -1
- package/esm/components/file-input/file-input.style.d.ts +1 -1
- package/esm/components/file-input/file-input.style.js +1 -1
- package/esm/components/icon/icon.style.js +1 -1
- package/esm/components/inline-inputs/inline-inputs.component.d.ts +5 -1
- package/esm/components/inline-inputs/inline-inputs.component.js +1 -1
- package/esm/components/inline-inputs/inline-inputs.style.js +1 -1
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
- package/esm/components/number/number.component.js +1 -1
- package/esm/components/numeral-date/numeral-date.component.d.ts +6 -3
- package/esm/components/numeral-date/numeral-date.component.js +1 -1
- package/esm/components/numeral-date/numeral-date.style.d.ts +2 -14
- package/esm/components/numeral-date/numeral-date.style.js +1 -1
- package/esm/components/pager/__internal__/pager-navigation.component.js +1 -1
- package/esm/components/pager/pager.component.js +1 -1
- package/esm/components/pager/pager.style.js +1 -1
- package/esm/components/search/search-button.style.js +1 -1
- package/esm/components/search/search.component.js +1 -1
- package/esm/components/search/search.style.js +1 -1
- package/esm/components/select/__internal__/select-textbox/select-textbox.component.d.ts +12 -3
- package/esm/components/select/__internal__/select-textbox/select-textbox.component.js +1 -1
- package/esm/components/select/__internal__/select-textbox/select-textbox.style.d.ts +10 -3
- package/esm/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
- package/esm/components/select/filterable-select/filterable-select.component.js +1 -1
- package/esm/components/select/multi-select/multi-select.component.js +1 -1
- package/esm/components/select/multi-select/multi-select.style.js +1 -1
- package/esm/components/select/select.style.js +1 -1
- package/esm/components/select/simple-select/simple-select.component.js +1 -1
- package/esm/components/simple-color-picker/simple-color/simple-color.style.d.ts +1 -1
- package/esm/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
- package/esm/components/switch/switch.component.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -1
- package/esm/components/text-editor/text-editor.component.js +1 -1
- package/esm/components/textarea/textarea.component.d.ts +4 -2
- package/esm/components/textarea/textarea.component.js +1 -1
- package/esm/components/textarea/textarea.style.js +1 -1
- package/esm/components/textbox/__internal__/__next__/index.d.ts +2 -0
- package/esm/components/textbox/__internal__/__next__/index.js +1 -0
- package/esm/components/textbox/__internal__/__next__/text-input.component.d.ts +91 -0
- package/esm/components/textbox/__internal__/__next__/text-input.component.js +1 -0
- package/esm/components/textbox/__internal__/__next__/text-input.style.d.ts +21 -0
- package/esm/components/textbox/__internal__/__next__/text-input.style.js +1 -0
- package/esm/components/textbox/__internal__/__next__/utils.d.ts +81 -0
- package/esm/components/textbox/__internal__/__next__/utils.js +1 -0
- package/esm/components/textbox/textbox.component.d.ts +21 -17
- package/esm/components/textbox/textbox.component.js +1 -1
- package/esm/components/tile-select/tile-select.style.d.ts +1 -1
- package/esm/components/tile-select/tile-select.style.js +1 -1
- package/esm/components/time/time.component.d.ts +1 -1
- package/esm/components/time/time.component.js +1 -1
- package/esm/components/time/time.style.d.ts +1 -1
- package/esm/components/time/time.style.js +1 -1
- package/esm/global.d.ts +0 -2
- package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +1 -1
- package/esm/hooks/__internal__/useRegisterValidationToTabs/index.d.ts +0 -0
- package/esm/hooks/__internal__/useRegisterValidationToTabs/index.js +1 -0
- package/esm/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.d.ts +2 -0
- package/esm/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js +1 -0
- package/esm/hooks/useMediaQuery/useMediaQuery.d.ts +1 -9
- package/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
- package/esm/style/themes/apply-base-theme.d.ts +3 -1
- package/esm/style/themes/apply-base-theme.js +1 -1
- package/lib/__internal__/checkable-input/__next__/checkable-input.component.js +1 -1
- package/lib/__internal__/checkable-input/__next__/checkable-input.style.js +1 -1
- package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
- package/lib/__internal__/error-border/error-border.style.d.ts +4 -0
- package/lib/__internal__/error-border/error-border.style.js +1 -0
- package/lib/__internal__/fieldset/__next__/fieldset.component.js +1 -1
- package/lib/__internal__/fieldset/fieldset.component.js +1 -1
- package/lib/__internal__/fieldset-validation-context/fieldset-validation-context.d.ts +6 -0
- package/lib/__internal__/fieldset-validation-context/index.d.ts +1 -0
- package/lib/__internal__/fieldset-validation-context/index.js +1 -0
- package/lib/__internal__/fieldset-validation-context/package.json +6 -0
- package/lib/__internal__/form-field/form-field.component.d.ts +1 -1
- package/lib/__internal__/form-field/form-field.component.js +1 -1
- package/lib/__internal__/hint-text/hint-text.component.d.ts +6 -21
- package/lib/__internal__/hint-text/hint-text.component.js +1 -1
- package/lib/__internal__/hint-text/hint-text.style.d.ts +5 -2
- package/lib/__internal__/hint-text/hint-text.style.js +1 -1
- package/lib/__internal__/hint-text/index.d.ts +0 -1
- package/lib/__internal__/input/index.d.ts +2 -5
- package/lib/__internal__/input/index.js +1 -1
- package/lib/__internal__/input/input-style-overrides.style.d.ts +8 -0
- package/lib/__internal__/input/input-style-overrides.style.js +1 -0
- package/lib/__internal__/input/input.component.d.ts +22 -31
- package/lib/__internal__/input/input.component.js +1 -1
- package/lib/__internal__/input/input.style.d.ts +9 -5
- package/lib/__internal__/input/input.style.js +1 -1
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +9 -3
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.js +1 -1
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +7 -9
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
- package/lib/__internal__/label/index.d.ts +0 -1
- package/lib/__internal__/label/label.component.d.ts +14 -31
- package/lib/__internal__/label/label.component.js +1 -1
- package/lib/__internal__/label/label.style.d.ts +5 -22
- package/lib/__internal__/label/label.style.js +1 -1
- package/lib/__internal__/legacy-error-border/error-border.style.js +1 -0
- package/lib/__internal__/legacy-hint-text/hint-text.component.d.ts +27 -0
- package/lib/__internal__/legacy-hint-text/hint-text.component.js +1 -0
- package/lib/__internal__/legacy-hint-text/hint-text.style.d.ts +3 -0
- package/lib/__internal__/legacy-hint-text/hint-text.style.js +1 -0
- package/lib/__internal__/legacy-hint-text/index.d.ts +2 -0
- package/lib/__internal__/legacy-hint-text/index.js +1 -0
- package/lib/__internal__/legacy-hint-text/package.json +6 -0
- package/lib/__internal__/legacy-input/index.d.ts +5 -0
- package/lib/__internal__/legacy-input/index.js +1 -0
- package/{esm/__internal__/input → lib/__internal__/legacy-input}/input-presentation.style.d.ts +1 -1
- package/lib/__internal__/{input → legacy-input}/input-presentation.style.js +1 -1
- package/lib/__internal__/legacy-input/input.component.d.ts +54 -0
- package/lib/__internal__/legacy-input/input.component.js +1 -0
- package/lib/__internal__/legacy-input/input.style.d.ts +3 -0
- package/lib/__internal__/legacy-input/input.style.js +1 -0
- package/lib/__internal__/legacy-input/package.json +6 -0
- package/lib/__internal__/legacy-label/index.d.ts +2 -0
- package/lib/__internal__/legacy-label/index.js +1 -0
- package/lib/__internal__/legacy-label/label.component.d.ts +37 -0
- package/lib/__internal__/legacy-label/label.component.js +1 -0
- package/lib/__internal__/legacy-label/label.style.d.ts +25 -0
- package/lib/__internal__/legacy-label/label.style.js +1 -0
- package/lib/__internal__/legacy-label/package.json +6 -0
- package/lib/__internal__/utils/helpers/combine-refs/index.d.ts +3 -0
- package/lib/__internal__/utils/helpers/combine-refs/index.js +1 -0
- package/lib/__internal__/utils/helpers/combine-refs/package.json +6 -0
- package/lib/__internal__/validation-message/__next__/index.d.ts +1 -0
- package/lib/__internal__/validation-message/__next__/index.js +1 -0
- package/lib/__internal__/validation-message/__next__/package.json +6 -0
- package/lib/__internal__/validation-message/__next__/validation-message.component.d.ts +20 -0
- package/lib/__internal__/validation-message/__next__/validation-message.component.js +1 -0
- package/lib/__internal__/validation-message/__next__/validation-message.style.d.ts +6 -0
- package/lib/__internal__/validation-message/__next__/validation-message.style.js +1 -0
- package/lib/__spec_helper__/mock-match-media.d.ts +0 -2
- package/lib/__spec_helper__/mock-match-media.js +1 -1
- package/lib/components/button-toggle/button-toggle-group/button-toggle-group.component.js +1 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
- package/lib/components/checkbox/checkbox.style.js +1 -1
- package/lib/components/date/date.component.js +1 -1
- package/lib/components/date/date.style.js +1 -1
- package/lib/components/date-range/date-range.style.js +1 -1
- package/lib/components/file-input/file-input.component.d.ts +1 -1
- package/lib/components/file-input/file-input.component.js +1 -1
- package/lib/components/file-input/file-input.style.d.ts +1 -1
- package/lib/components/file-input/file-input.style.js +1 -1
- package/lib/components/icon/icon.style.js +1 -1
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +5 -1
- package/lib/components/inline-inputs/inline-inputs.component.js +1 -1
- package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
- package/lib/components/number/number.component.js +1 -1
- package/lib/components/numeral-date/numeral-date.component.d.ts +6 -3
- package/lib/components/numeral-date/numeral-date.component.js +1 -1
- package/lib/components/numeral-date/numeral-date.style.d.ts +2 -14
- package/lib/components/numeral-date/numeral-date.style.js +1 -1
- package/lib/components/pager/__internal__/pager-navigation.component.js +1 -1
- package/lib/components/pager/pager.component.js +1 -1
- package/lib/components/pager/pager.style.js +1 -1
- package/lib/components/search/search-button.style.js +1 -1
- package/lib/components/search/search.component.js +1 -1
- package/lib/components/search/search.style.js +1 -1
- package/lib/components/select/__internal__/select-textbox/select-textbox.component.d.ts +12 -3
- package/lib/components/select/__internal__/select-textbox/select-textbox.component.js +1 -1
- package/lib/components/select/__internal__/select-textbox/select-textbox.style.d.ts +10 -3
- package/lib/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
- package/lib/components/select/filterable-select/filterable-select.component.js +1 -1
- package/lib/components/select/multi-select/multi-select.component.js +1 -1
- package/lib/components/select/multi-select/multi-select.style.js +1 -1
- package/lib/components/select/select.style.js +1 -1
- package/lib/components/select/simple-select/simple-select.component.js +1 -1
- package/lib/components/simple-color-picker/simple-color/simple-color.style.d.ts +1 -1
- package/lib/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
- package/lib/components/switch/switch.component.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -1
- package/lib/components/text-editor/text-editor.component.js +1 -1
- package/lib/components/textarea/textarea.component.d.ts +4 -2
- package/lib/components/textarea/textarea.component.js +1 -1
- package/lib/components/textarea/textarea.style.js +1 -1
- package/lib/components/textbox/__internal__/__next__/index.d.ts +2 -0
- package/lib/components/textbox/__internal__/__next__/index.js +1 -0
- package/lib/components/textbox/__internal__/__next__/package.json +6 -0
- package/lib/components/textbox/__internal__/__next__/text-input.component.d.ts +91 -0
- package/lib/components/textbox/__internal__/__next__/text-input.component.js +1 -0
- package/lib/components/textbox/__internal__/__next__/text-input.style.d.ts +21 -0
- package/lib/components/textbox/__internal__/__next__/text-input.style.js +1 -0
- package/lib/components/textbox/__internal__/__next__/utils.d.ts +81 -0
- package/lib/components/textbox/__internal__/__next__/utils.js +1 -0
- package/lib/components/textbox/textbox.component.d.ts +21 -17
- package/lib/components/textbox/textbox.component.js +1 -1
- package/lib/components/tile-select/tile-select.style.d.ts +1 -1
- package/lib/components/tile-select/tile-select.style.js +1 -1
- package/lib/components/time/time.component.d.ts +1 -1
- package/lib/components/time/time.component.js +1 -1
- package/lib/components/time/time.style.d.ts +1 -1
- package/lib/components/time/time.style.js +1 -1
- package/lib/global.d.ts +0 -2
- package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +1 -1
- package/lib/hooks/__internal__/useRegisterValidationToTabs/index.d.ts +0 -0
- package/lib/hooks/__internal__/useRegisterValidationToTabs/index.js +1 -0
- package/lib/hooks/__internal__/useRegisterValidationToTabs/package.json +6 -0
- package/lib/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.d.ts +2 -0
- package/lib/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js +1 -0
- package/lib/hooks/useMediaQuery/useMediaQuery.d.ts +1 -9
- package/lib/hooks/useMediaQuery/useMediaQuery.js +1 -1
- package/lib/style/themes/apply-base-theme.d.ts +3 -1
- package/lib/style/themes/apply-base-theme.js +1 -1
- package/package.json +1 -1
- package/esm/components/numeral-date/__internal__/numeral-date.context.d.ts +0 -6
- package/esm/components/select/__internal__/select-textbox/select-textbox.context.d.ts +0 -5
- package/esm/components/select/__internal__/select-textbox/select-textbox.context.js +0 -1
- package/esm/components/textbox/__internal__/prefix.style.d.ts +0 -5
- package/esm/components/textbox/__internal__/prefix.style.js +0 -1
- package/esm/components/textbox/textbox.style.js +0 -1
- package/lib/components/numeral-date/__internal__/numeral-date.context.d.ts +0 -6
- package/lib/components/select/__internal__/select-textbox/select-textbox.context.d.ts +0 -5
- package/lib/components/select/__internal__/select-textbox/select-textbox.context.js +0 -1
- package/lib/components/textbox/__internal__/prefix.style.d.ts +0 -5
- package/lib/components/textbox/__internal__/prefix.style.js +0 -1
- package/lib/components/textbox/textbox.style.js +0 -1
- /package/esm/{components/numeral-date/__internal__/numeral-date.context.js → __internal__/fieldset-validation-context/fieldset-validation-context.js} +0 -0
- /package/esm/{components/textbox/textbox.style.d.ts → __internal__/legacy-error-border/error-border.style.d.ts} +0 -0
- /package/esm/__internal__/{input → legacy-input}/input-presentation.component.d.ts +0 -0
- /package/esm/__internal__/{input → legacy-input}/input-presentation.component.js +0 -0
- /package/esm/__internal__/{input → legacy-input}/input-sizes.style.d.ts +0 -0
- /package/esm/__internal__/{input → legacy-input}/input-sizes.style.js +0 -0
- /package/esm/__internal__/{label → legacy-label}/icon-wrapper.style.d.ts +0 -0
- /package/esm/__internal__/{label → legacy-label}/icon-wrapper.style.js +0 -0
- /package/lib/{components/numeral-date/__internal__/numeral-date.context.js → __internal__/fieldset-validation-context/fieldset-validation-context.js} +0 -0
- /package/lib/{components/textbox/textbox.style.d.ts → __internal__/legacy-error-border/error-border.style.d.ts} +0 -0
- /package/lib/__internal__/{input → legacy-input}/input-presentation.component.d.ts +0 -0
- /package/lib/__internal__/{input → legacy-input}/input-presentation.component.js +0 -0
- /package/lib/__internal__/{input → legacy-input}/input-sizes.style.d.ts +0 -0
- /package/lib/__internal__/{input → legacy-input}/input-sizes.style.js +0 -0
- /package/lib/__internal__/{label → legacy-label}/icon-wrapper.style.d.ts +0 -0
- /package/lib/__internal__/{label → legacy-label}/icon-wrapper.style.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("../../../../__internal__/input/input-sizes.style.js");function l(e){return e&&e.__esModule?e:{default:e}}var
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../../../../__internal__/legacy-input/input-sizes.style.js");function l(e){return e&&e.__esModule?e:{default:e}}var s=l(e);const o=s.default.span.withConfig({displayName:"select-textbox.style__StyledSelectText",componentId:"sc-2396748c-0"})(["",""],(({$disabled:l,$hasPlaceholder:s,$readOnly:o,$transparent:i,$size:n})=>e.css(["align-items:center;align-self:stretch;display:inline-flex;flex-grow:1;font-size:14px;height:auto;outline:none;width:30px;z-index:1;padding-left:",";"," "," "," ",""],t.default[n].horizontalPadding,i&&e.css(["font-weight:500;text-align:right;"]),s&&e.css(["color:",";font-weight:",";user-select:none;"],i?"var(--colorsUtilityYin100)":"var(--colorsUtilityYin055)",i?500:"normal"),l&&e.css(["cursor:not-allowed;color:var(--colorsUtilityYin030);text-shadow:none;"]),o&&e.css(["cursor:default;color:var(--colorsUtilityYin065);text-shadow:none;"])))),i=s.default.span.withConfig({displayName:"select-textbox.style__StyledSelectTextChildrenWrapper",componentId:"sc-2396748c-1"})(["display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"," ",""],(({$isDisabled:t})=>t&&e.css(["cursor:not-allowed;"])),(({$readOnly:t})=>t&&e.css(["cursor:default;"])));exports.StyledSelectText=o,exports.StyledSelectTextChildrenWrapper=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant");require("../../../style/utils/filter-styled-system-padding-props.js");var r=require("../../../style/utils/filter-styled-system-margin-props.js"),l=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),o=require("../__internal__/select-textbox/select-textbox.component.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),a=require("../__internal__/utils/with-filter.hoc.js"),s=require("../select.style.js"),u=require("../__internal__/select-list/select-list.component.js"),c=require("../__internal__/utils/is-expected-option.js"),d=require("../__internal__/utils/are-objects-equal.js"),f=require("../__internal__/utils/is-navigation-key.js"),p=require("../../../hooks/__internal__/useStableCallback/useStableCallback.js"),b=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),v=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function y(e){return e&&e.__esModule?e:{default:e}}var m=y(t),g=y(n);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){h(e,t,n[t])}))}return e}function _(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant");require("../../../style/utils/filter-styled-system-padding-props.js");var r=require("../../../style/utils/filter-styled-system-margin-props.js"),l=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),o=require("../__internal__/select-textbox/select-textbox.component.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),a=require("../__internal__/utils/with-filter.hoc.js"),s=require("../select.style.js"),u=require("../__internal__/select-list/select-list.component.js"),c=require("../__internal__/utils/is-expected-option.js"),d=require("../__internal__/utils/are-objects-equal.js"),f=require("../__internal__/utils/is-navigation-key.js"),p=require("../../../hooks/__internal__/useStableCallback/useStableCallback.js"),b=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),v=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function y(e){return e&&e.__esModule?e:{default:e}}var m=y(t),g=y(n);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){h(e,t,n[t])}))}return e}function _(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const j=a.default(u.default),C=m.default.forwardRef(((n,a)=>{var{"aria-label":y,"aria-labelledby":h,value:C,id:w,name:S,label:x,children:k,onOpen:L,onChange:q,onFilterChange:E,onClick:P,onKeyDown:D,onFocus:A,onBlur:R,openOnFocus:F,noResultsMessage:M,listActionButton:B,listMaxHeight:T,onListAction:I,isLoading:V,disabled:H,readOnly:W,onListScrollBottom:K,tableHeader:N,multiColumn:z,"data-element":G,"data-role":J,tooltipPosition:Q,listPlacement:U="bottom",flipEnabled:X=!0,enableVirtualScroll:Y,virtualScrollOverscan:Z,disableDefaultFiltering:$=!1,required:ee,listWidth:te}=n,ne=function(e,t){if(null==e)return{};var n,r,l=function(e,t){if(null==e)return{};var n,r,l={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}(n,["aria-label","aria-labelledby","value","id","name","label","children","onOpen","onChange","onFilterChange","onClick","onKeyDown","onFocus","onBlur","openOnFocus","noResultsMessage","listActionButton","listMaxHeight","onListAction","isLoading","disabled","readOnly","onListScrollBottom","tableHeader","multiColumn","data-element","data-role","tooltipPosition","listPlacement","flipEnabled","enableVirtualScroll","virtualScrollOverscan","disableDefaultFiltering","required","listWidth"]);const[re,le]=t.useState(""),oe=t.useRef(i.default()),ie=t.useRef(null),ae=t.useRef(null),se=t.useRef(!1),ue=t.useRef(!1),[ce,de]=t.useState(),[fe,pe]=t.useState(!1),[be,ve]=t.useState(""),[ye,me]=t.useState(C||""),ge=t.useRef(C),[he,Oe]=t.useState(""),[_e,je]=t.useState(""),Ce=t.useRef(w||i.default()),{labelId:we}=b.default({id:Ce.current,label:x}),Se=t.useRef(null),xe=t.useRef(!1),ke=t.useCallback(((e,t)=>({target:_(O({},S&&{name:S},w&&{id:w}),{value:e}),selectionConfirmed:t})),[S,w]),Le=t.useCallback(((e,t)=>{q&&q(ke(e,t))}),[q,ke]),qe=t.useCallback(((e,t)=>{me((()=>{var n;const r=e.trimStart(),l=(o=r,i=k,m.default.Children.toArray(i).find((e=>{const{text:t}=e.props;return-1!==(null==t?void 0:t.toLowerCase().indexOf(null==o?void 0:o.toLowerCase()))})));var o,i;const a=t&&!e.length;return!l||a||l.props.disabled?(ve(e),Le("",!1),""):(r.length&&Le(l.props.value,!1),t?(ve(e),l.props.value):(r.length&&(null===(n=l.props.text)||void 0===n?void 0:n.toLowerCase().startsWith(r.toLowerCase()))?ve(l.props.text):ve(e),Oe(l.props.value),l.props.value))}))}),[k,Le]),Ee=t.useCallback(((e,t=!1)=>{var n;const r=m.default.Children.toArray(k).find((t=>m.default.isValidElement(t)&&c.default(t,e)));r&&void 0!==r.props.text?(t||(null===(n=r.props.text)||void 0===n?void 0:n.toLowerCase().startsWith(null==_e?void 0:_e.toLowerCase().trim())))&&ve(r.props.text):ve(_e||"")}),[k,_e]),Pe=t.useCallback((e=>{const t=e.target.value,{inputType:n}=e.nativeEvent;qe(t,"deleteContentBackward"===n||"deleteContentForward"===n||"delete"===n),je(t),pe(!0)}),[qe]),De=t.useCallback((e=>{je((t=>(null==t?void 0:t.length)===(null==be?void 0:be.length)-1&&e===be.slice(-1)?be:t))}),[be]),Ae=t.useCallback((e=>{const{key:t}=e;D&&D(e),W||(!e.defaultPrevented&&f.default(t)&&(e.preventDefault(),pe(!0)),De(t))}),[De,D,W]),Re=t.useCallback((e=>{const t=ie.current&&!ie.current.contains(e.target),n=ae.current&&!ae.current.contains(e.target);se.current=!1,t&&n&&(Ee(C,!0),pe(!1))}),[Ee,C]);t.useEffect((()=>{me((e=>(C&&e!==C&&Ee(C),C))),Oe(C)}),[C,q,k]);const Fe=p.default(L);t.useEffect((()=>{fe?Fe&&Fe():je("")}),[Fe,fe]),t.useEffect((()=>{const e=void 0!==B;g.default(!e||e&&I,"onListAction prop required when using listActionButton prop")}),[B,I]);const Me=t.useRef(!0);t.useEffect((()=>{Me.current&&Ee(ye),"object"==typeof C&&"object"==typeof ge.current?d.default(C,ge.current)||(Ee(C),ge.current=C):Ee(C)}),[C,k]);const Be=p.default(E);t.useEffect((()=>{Be&&!Me.current&&Be(_e)}),[Be,_e]),t.useEffect((()=>{Me.current=!1}),[]),t.useEffect((()=>{const e="click";return window.addEventListener(e,Re),function(){window.removeEventListener(e,Re)}}),[Re]),t.useEffect((()=>{const e=null==_e?void 0:_e.trimStart(),t=null==be?void 0:be.toLowerCase().startsWith(e.toLowerCase());!H&&!W&&ce&&e.length&&(null==be?void 0:be.length)>e.length&&t&&(ce.selectionStart=e.length)}),[be,_e,ce,H,W]);const Te=t.useCallback((e=>{const{id:t,text:n,value:r,selectionType:l,selectionConfirmed:o}=e;ve(n),Le(r,!!o),le(t),"navigationKey"!==l&&(xe.current=!!F,pe(!1),null==ce||ce.focus(),null==ce||ce.select(),xe.current=!1)}),[ce,Le,F]),Ie=t.useCallback((()=>{pe(!1),Ee(ye,!0)}),[ye,Ee]);function Ve(e){var t;se.current=!0,"input"!==(null===(t=e.target.dataset)||void 0===t?void 0:t.element)&&e.preventDefault()}t.useEffect((()=>()=>{Se.current&&clearTimeout(Se.current)}),[]),v.default((()=>pe(!1)));const He=t.useCallback((e=>{e&&(de(e),a&&("function"==typeof a?a(e):a.current=e))}),[a]);let We;switch(U){case"top":We="top-end";break;case"bottom":We="bottom-end";break;default:We=U}const Ke={ref:ae,id:oe.current,labelId:we,anchorElement:(null==ce?void 0:ce.parentElement)||void 0,onSelect:Te,onSelectListClose:Ie,onMouseDown:function(){se.current=!0},filterText:_e.trim(),highlightedValue:he,noResultsMessage:M,listActionButton:B,listMaxHeight:T,onListAction:function(){pe(!1),null==I||I()},isLoading:V,onListScrollBottom:K,tableHeader:N,multiColumn:z,listPlacement:void 0!==te?We:U,flipEnabled:X,isOpen:fe,enableVirtualScroll:Y,virtualScrollOverscan:Z,listWidth:te},Ne=$?e.jsx(u.default,_(O({},Ke),{children:k})):e.jsx(j,_(O({},Ke),{children:k})),ze=r.default(ne);return e.jsxs(s.default,_(O({hasTextCursor:!0,readOnly:W,disabled:H,"data-component":"filterable-select","data-role":J,"data-element":G,isOpen:fe,className:"filterable-select"},ze),{children:[e.jsx("div",{ref:ie,children:e.jsx(o.default,_(O({ref:He,activeDescendantId:re,ariaLabel:y,ariaLabelledby:h,labelId:x?we:void 0,"aria-controls":oe.current,isOpen:fe,selectType:"filterable"},_(O({id:Ce.current,name:S,label:x,disabled:H,readOnly:W,selectedValue:ye,formattedValue:be,onClick:function(e){se.current=!1,P&&P(e),pe(!0)},iconOnClick:function(e){se.current=!1,P&&P(e),pe((e=>(xe.current=e,!e)))},iconOnMouseDown:Ve,onFocus:function(e){const t=()=>null==A?void 0:A(e);if(F){if(Se.current&&clearTimeout(Se.current),xe.current)return;Se.current=setTimeout((()=>{pe((e=>(e||A&&!ue.current&&(t(),ue.current=!0),!0)))}))}else A&&!ue.current&&(t(),ue.current=!0)},onBlur:function(e){se.current||(ue.current=!1,R&&R(e))},onKeyDown:Ae,onChange:Pe,onMouseDown:Ve,tooltipPosition:Q,required:ee},l.default(ne)),{"data-component":void 0})),{onChange:Pe,value:be}))}),Ne]}))}));exports.FilterableSelect=C,exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var l=require("../../../style/utils/filter-styled-system-margin-props.js"),r=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),n=require("../__internal__/select-textbox/select-textbox.component.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),u=require("../__internal__/utils/with-filter.hoc.js"),o=require("../__internal__/select-list/select-list.component.js"),a=require("./multi-select.style.js"),s=require("../../pill/pill.component.js"),c=require("../__internal__/utils/is-expected-option.js"),d=require("../__internal__/utils/is-expected-value.js"),f=require("../__internal__/utils/is-navigation-key.js"),p=require("../../../hooks/__internal__/useStableCallback/useStableCallback.js"),b=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),v=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function m(e){return e&&e.__esModule?e:{default:e}}var y=m(t);function h(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function O(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})))),r.forEach((function(t){h(e,t,l[t])}))}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t}(Object(t)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})),e}const _=u.default(o.default),j=y.default.forwardRef(((u,o)=>{var{"aria-label":m,"aria-labelledby":h,value:j,id:C,label:S,name:x,disabled:k,readOnly:w,children:P,onOpen:q,onFilterChange:E,onChange:M,onClick:R,onFocus:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var l=require("../../../style/utils/filter-styled-system-margin-props.js"),r=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),n=require("../__internal__/select-textbox/select-textbox.component.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),u=require("../__internal__/utils/with-filter.hoc.js"),o=require("../__internal__/select-list/select-list.component.js"),a=require("./multi-select.style.js"),s=require("../../pill/pill.component.js"),c=require("../__internal__/utils/is-expected-option.js"),d=require("../__internal__/utils/is-expected-value.js"),f=require("../__internal__/utils/is-navigation-key.js"),p=require("../../../hooks/__internal__/useStableCallback/useStableCallback.js"),b=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),v=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function m(e){return e&&e.__esModule?e:{default:e}}var y=m(t);function h(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function O(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})))),r.forEach((function(t){h(e,t,l[t])}))}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t}(Object(t)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})),e}const _=u.default(o.default),j=y.default.forwardRef(((u,o)=>{var{"aria-label":m,"aria-labelledby":h,value:j,id:C,label:S,name:x,disabled:k,readOnly:w,children:P,onOpen:q,onFilterChange:E,onChange:M,onClick:R,onFocus:D,onBlur:L,onKeyDown:V,openOnFocus:F=!1,noResultsMessage:I,placeholder:T,isLoading:A,onListScrollBottom:B,tableHeader:H,multiColumn:z,tooltipPosition:K,size:W="medium","data-element":$,"data-role":N,listPlacement:G="bottom",listMaxHeight:J,flipEnabled:Q=!0,wrapPillText:U=!0,enableVirtualScroll:X,virtualScrollOverscan:Y,required:Z,listWidth:ee}=u,te=function(e,t){if(null==e)return{};var l,r,n=function(e,t){if(null==e)return{};var l,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(u,["aria-label","aria-labelledby","value","id","label","name","disabled","readOnly","children","onOpen","onFilterChange","onChange","onClick","onFocus","onBlur","onKeyDown","openOnFocus","noResultsMessage","placeholder","isLoading","onListScrollBottom","tableHeader","multiColumn","tooltipPosition","size","data-element","data-role","listPlacement","listMaxHeight","flipEnabled","wrapPillText","enableVirtualScroll","virtualScrollOverscan","required","listWidth"]);const[le,re]=t.useState(""),ne=t.useRef(i.default()),ie=t.useRef(i.default()),ue=t.useRef(null),oe=t.useRef(null),ae=t.useRef(!1),se=t.useRef(!1),ce=t.useRef(!1),de=t.useRef(!1),fe=t.useRef(!1),[pe,be]=t.useState(),[ve,me]=t.useState(!1),[ye,he]=t.useState(""),[Oe,ge]=t.useState(""),[_e,je]=t.useState(""),[Ce,Se]=t.useState(),xe=t.useRef(C||i.default()),{labelId:ke}=b.default({id:xe.current,label:S}),we=t.useRef(null),Pe=t.useCallback((()=>{me((e=>(!e&&q&&q(),!0)))}),[q]),qe=t.useCallback(((e,t)=>({target:g(O({},x&&{name:x},C&&{id:C}),{value:e}),selectionConfirmed:t})),[x,C]),Ee=t.useCallback(((e,t)=>{const l=e(j);l.length!==(null==j?void 0:j.length)&&M(qe(l,t))}),[qe,M,j]),Me=t.useCallback((e=>{const t=e.target.value,l=(r=t,n=P,y.default.Children.toArray(n).find((e=>{const{text:t}=e.props;return-1!==(null==t?void 0:t.toLowerCase().indexOf(null==r?void 0:r.toLowerCase()))})));var r,n;l&&ge(l.props.value),je(t),he(t),Pe()}),[P,Pe]),Re=t.useCallback((e=>{se.current=!0,Ee((t=>{if(!t.length)return t;const l=t.slice();return l.splice(e,1),l}),!0)}),[Ee]),De=t.useCallback((e=>{const{key:t}=e,l="Backspace"===t||"Delete"===t;V&&V(e),w||(!e.defaultPrevented&&f.default(t)&&(e.preventDefault(),Pe()),!l||""!==_e&&""!==ye||Re(-1))}),[V,w,_e,ye,Pe,Re]),Le=t.useMemo((()=>{var e;return j&&j.length?null===(e=y.default.Children.map(P,(e=>!(!y.default.isValidElement(e)||!j.includes(e.props.value))&&e.props.text)))||void 0===e?void 0:e.filter((e=>e)).reduce(((e,t)=>e?`${e}, ${t}`:t),""):null}),[P,j]),Ve=t.useCallback((e=>{if(ce.current=!1,!ve)return;const t=ue.current&&!ue.current.contains(e.target),l=oe.current&&!oe.current.contains(e.target);t&&l&&!se.current&&(he(""),je(""),ge(""),me(!1)),se.current=!1}),[ve]),Fe=t.useMemo((()=>{const t=!k&&!w;let l;return(null==j?void 0:j.length)?j.map(((r,n)=>{const i=y.default.Children.toArray(P).find((e=>y.default.isValidElement(e)&&c.default(e,r)));let u={};if(!i)return null;var o,d;y.default.isValidElement(i)&&(l=void 0!==(null==i||null===(o=i.props.value)||void 0===o?void 0:o.value)?null==i||null===(d=i.props.value)||void 0===d?void 0:d.value:null==i?void 0:i.props.value,u={title:i.props.text,fill:i.props.fill,borderColor:i.props.borderColor});const f=u.title||"",p=f+l||n;return e.jsx(a.StyledSelectPillContainer,{children:e.jsx(s.Pill,g(O({onDelete:t?()=>Re(n):void 0,wrapText:U},u),{children:f}))},p)})):""}),[P,k,w,j]);t.useEffect((()=>{const e=null==j?void 0:j.length;Se(e?" ":T)}),[j,T]),t.useEffect((()=>{const e="click";return window.addEventListener(e,Ve),function(){window.removeEventListener(e,Ve)}}),[Ve]);const Ie=p.default(E),Te=t.useRef(!0);function Ae(e){if(ce.current=!1,R&&R(e),!F||F&&!fe.current){if(ve)return je(""),void me(!1);null==q||q(),me(!0)}else fe.current=!1}function Be(e){ce.current=!1,R&&R(e),me((e=>e?(je(""),!1):(q&&q(),!0)))}function He(e){de.current=!1,ce.current||(ae.current=!1,L&&L(e))}function ze(e){var t;ce.current=!0;const l=e.target;"input"!==(null===(t=l.dataset)||void 0===t?void 0:t.element)&&e.preventDefault(),"input"===l.dataset.element&&(de.current=!0)}function Ke(e){const t=()=>null==D?void 0:D(e);F?(we.current&&clearTimeout(we.current),we.current=setTimeout((()=>{me((e=>(e||(q&&q(),D&&!ae.current&&(t(),ae.current=!0),fe.current=de.current),!0)))}))):D&&!ae.current&&(t(),ae.current=!0)}t.useEffect((()=>{Ie&&!Te.current&&Ie(_e)}),[Ie,_e]),t.useEffect((()=>{Te.current=!1}),[]),v.default((()=>me(!1)));const We=t.useCallback((e=>{const{value:t,selectionType:l,id:r,selectionConfirmed:n}=e;if("navigationKey"===l)return ge(t),void re(r);"click"===l&&(se.current=!0),he("");const i=-1!==(null==j?void 0:j.findIndex((e=>d.default(e,t))));null==pe||pe.focus(),ce.current=!1,Ee((e=>i?e:[...e,t]),n)}),[pe,j,Ee]),$e=t.useCallback((()=>{me(!1),je("")}),[]),Ne=t.useCallback((e=>{e&&(be(e),o&&("function"==typeof o?o(e):o.current=e))}),[o]);function Ge(){return g(O({id:xe.current,name:x,disabled:k,label:S,readOnly:w,placeholder:Ce,leftChildren:Fe,formattedValue:ye,selectedValue:j,onClick:Ae,onMouseDown:ze,onFocus:Ke,onBlur:He,iconOnClick:Be,iconOnMouseDown:ze,onKeyDown:De,onChange:Me,tooltipPosition:K,size:W,required:Z},r.default(te)),{"data-component":void 0})}let Je;switch(G){case"top":Je="top-end";break;case"bottom":Je="bottom-end";break;default:Je=G}const Qe=e.jsx(_,{ref:oe,id:ne.current,labelId:ke,anchorElement:(null==pe?void 0:pe.parentElement)||void 0,onSelect:We,onSelectListClose:$e,onMouseDown:function(){ce.current=!0},filterText:_e.trim(),highlightedValue:Oe,noResultsMessage:I,isLoading:A,onListScrollBottom:B,tableHeader:H,multiColumn:z,listPlacement:void 0!==ee?Je:G,listMaxHeight:J,flipEnabled:Q,multiselectValues:j,isOpen:ve,enableVirtualScroll:X,virtualScrollOverscan:Y,listWidth:ee,children:P}),Ue=l.default(te);return e.jsxs(a.StyledSelectMultiSelect,g(O({disabled:k,readOnly:w,hasTextCursor:!0,size:W,"data-component":"multiselect","data-role":N,"data-element":$,isOpen:ve,className:"multi-select"},Ue),{children:[e.jsxs("div",{ref:ue,children:[e.jsx(a.StyledAccessibilityLabelContainer,{"data-element":"accessibility-label",id:ie.current,children:Le}),e.jsx(n.default,O({ref:Ne,accessibilityLabelId:ie.current,activeDescendantId:le,"aria-controls":ne.current,ariaLabel:m,ariaLabelledby:h,isOpen:ve,labelId:ke,value:Ge().formattedValue,selectType:"multi"},Ge()))]}),Qe]}))}));exports.MultiSelect=j,exports.default=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("../../pill/pill.style.js"),
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../../pill/pill.style.js"),l=require("../../../style/themes/apply-base-theme.js"),i=require("../../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),s=require("../select.style.js");function n(e){return e&&e.__esModule?e:{default:e}}var d=n(e);const o=d.default.div.attrs(l.default).withConfig({displayName:"multi-select.style__StyledSelectPillContainer",componentId:"sc-4d4e5df5-0"})(["display:flex;flex-direction:column;justify-content:center;margin:3px 2px 3px 0;max-width:100%;&& ","{text-overflow:ellipsis;}"],t.default),a=d.default(s.default).withConfig({displayName:"multi-select.style__StyledSelectMultiSelect",componentId:"sc-4d4e5df5-1"})(["","{position:absolute;right:0;height:100%;}"],i.default),c=d.default.div.withConfig({displayName:"multi-select.style__StyledAccessibilityLabelContainer",componentId:"sc-4d4e5df5-2"})(["display:none;"]);exports.StyledAccessibilityLabelContainer=c,exports.StyledSelectMultiSelect=a,exports.StyledSelectPillContainer=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),i=require("../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),r=require("../../style/themes/apply-base-theme.js");function s(e){return e&&e.__esModule?e:{default:e}}const l=s(e).default.div.attrs(r.default).withConfig({displayName:"select.style__StyledSelect",componentId:"sc-aec7932c-0"})(["margin-bottom:var(--fieldSpacing);"," position:relative;","{margin-right:0;}"],t.margin,i.default);exports.default=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var r=require("../../../style/utils/filter-styled-system-margin-props.js"),n=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),l=require("../select.style.js"),i=require("../__internal__/select-textbox/select-textbox.component.js"),o=require("../__internal__/select-list/select-list.component.js"),a=require("../../../__internal__/utils/helpers/guid/index.js"),u=require("../__internal__/utils/get-next-child-by-text.js"),s=require("../__internal__/utils/is-expected-option.js"),c=require("../__internal__/utils/is-navigation-key.js"),d=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),f=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function b(e){return e&&e.__esModule?e:{default:e}}var p=b(t);function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}function O(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const v=p.default.forwardRef(((b,y)=>{var{"aria-describedby":v,"aria-label":g,"aria-labelledby":j,value:w,id:_,label:h,name:S,disabled:x,readOnly:k,children:C,transparent:P,openOnFocus:q=!1,onOpen:E,onChange:R,onClick:D,onFocus:L,onKeyDown:M,onBlur:T,isLoading:I,listMaxHeight:F,onListScrollBottom:V,tableHeader:B,multiColumn:H,tooltipPosition:K,"data-element":A,"data-role":W,listPlacement:z="bottom",flipEnabled:G=!0,enableVirtualScroll:J,virtualScrollOverscan:N,required:Q,listWidth:U}=b,X=function(e,t){if(null==e)return{};var r,n,l=function(e,t){if(null==e)return{};var r,n,l={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(b,["aria-describedby","aria-label","aria-labelledby","value","id","label","name","disabled","readOnly","children","transparent","openOnFocus","onOpen","onChange","onClick","onFocus","onKeyDown","onBlur","isLoading","listMaxHeight","onListScrollBottom","tableHeader","multiColumn","tooltipPosition","data-element","data-role","listPlacement","flipEnabled","enableVirtualScroll","virtualScrollOverscan","required","listWidth"]);const Y=t.useRef(a.default()),Z=t.useRef(null),$=t.useRef(null),ee=t.useRef(void 0),te=t.useRef(),re=t.useRef(),ne=t.useRef(),le=t.useRef(),[ie,oe]=t.useState(),[ae,ue]=t.useState(!1),[se,ce]=t.useState(""),[de,fe]=t.useState(""),[be,pe]=t.useState(w),ye=t.useRef(_||a.default()),{labelId:me}=d.default({id:ye.current,label:h}),Oe=t.useRef(void 0),ve=t.useRef(!1),ge=t.useMemo((()=>p.default.Children.toArray(C)),[C]),je=t.useCallback(((e,t=!1)=>({target:O(m({},S&&{name:S},_&&{id:_}),{value:e}),selectionConfirmed:t})),[S,_]),we=t.useCallback((e=>{const t=ge.findIndex((e=>p.default.isValidElement(e)&&s.default(e,be))),r=u.default(e,ge,t);r&&R(je(r.props.value))}),[ge,je,R,be]),_e=t.useCallback((e=>{if(re.current){const t=le.current+e;le.current=t,we(t),window.clearTimeout(ee.current)}else le.current=e,we(e);re.current=!0,window.clearTimeout(ee.current),ee.current=window.setTimeout((()=>{re.current=!1,le.current=""}),500)}),[we]),he=t.useCallback((e=>{const{key:t}=e;null==M||M(e),k||(" "===t||c.default(t)?(e.preventDefault(),ue((e=>(e||null==E||E(),!0)))):1!==t.length||e.metaKey||e.ctrlKey||_e(t))}),[_e,M,E,k]),Se=t.useCallback((e=>{const t=Z.current&&!Z.current.contains(e.target),r=$.current&&!$.current.contains(e.target);te.current=!1,t&&r&&!ne.current&&ue(!1),ne.current=!1}),[]);function xe(e){te.current=!1,null==D||D(e),ue((e=>(ve.current=e,!e&&(null==E||E(),!0))))}t.useEffect((()=>{pe(w)}),[w]),t.useEffect((()=>{const e=ge.find((e=>s.default(e,be)));let t="";e&&(t=e.props.text),fe(t)}),[be,ge]),t.useEffect((()=>{const e="click";return window.addEventListener(e,Se),function(){window.removeEventListener(e,Se)}}),[Se]),t.useEffect((()=>function(){window.clearTimeout(ee.current),window.clearTimeout(Oe.current)}),[]),f.default((()=>ue(!1)));const ke=t.useCallback((()=>{ue(!1)}),[]),Ce=t.useCallback((e=>{e&&(oe(e),y&&("function"==typeof y?y(e):y.current=e))}),[y]);let Pe;switch(z){case"top":Pe="top-end";break;case"bottom":Pe="bottom-end";break;default:Pe=z}const qe=e.jsx(o.default,{ref:$,id:Y.current,labelId:me,anchorElement:(null==ie?void 0:ie.parentElement)||void 0,onSelect:e=>{const{text:t,value:r,selectionType:n,id:l,selectionConfirmed:i}=e,o="click"===n;!function(e,t,r){null==R||R(je(e,r))}(r,0,i),ce(l),"navigationKey"!==n&&ue(!1),o&&(ne.current=!0,null==ie||ie.focus())},onMouseDown:function(){te.current=!0},onSelectListClose:ke,highlightedValue:be,listMaxHeight:F,isLoading:I,onListScrollBottom:V,tableHeader:B,multiColumn:H,listPlacement:void 0!==U?Pe:z,flipEnabled:G,isOpen:ae,enableVirtualScroll:J,virtualScrollOverscan:N,listWidth:U,children:C}),Ee=r.default(X);return e.jsxs(l.default,O(m({transparent:P,disabled:x,readOnly:k,"data-component":"simple-select","data-role":W,"data-element":A,isOpen:ae},Ee),{children:[e.jsx("div",{ref:Z,children:e.jsx(i.default,O(m({ref:Ce,ariaLabel:g,"aria-controls":Y.current,activeDescendantId:se,ariaLabelledby:j,"aria-describedby":v,isOpen:ae,value:de,selectType:"simple"},O(m({id:ye.current,name:S,disabled:x,readOnly:k,selectedValue:be,formattedValue:de,onClick:xe,iconOnClick:function(e){xe(e)},label:h,labelId:me,onMouseDown:function(){te.current=!0},onFocus:function(e){if(!ne.current)if(null==L||L(e),te.current)te.current=!1;else if(q){if(window.clearTimeout(Oe.current),ve.current)return void(ve.current=!1);Oe.current=window.setTimeout((()=>{ue((e=>(e||null==E||E(),!0)))}))}},onKeyDown:he,onBlur:function(e){te.current||null==T||T(e)},tooltipPosition:K,required:Q,transparent:P},n.default(X)),{"data-component":void 0})),{onChange:()=>{}}))}),qe]}))}));exports.SimpleSelect=v,exports.default=v;
|
|
@@ -2,7 +2,7 @@ export declare const StyledSimpleColor: import("styled-components").StyledCompon
|
|
|
2
2
|
export declare const StyledColorSampleBox: import("styled-components").StyledComponent<"div", any, {
|
|
3
3
|
color: string;
|
|
4
4
|
}, never>;
|
|
5
|
-
export declare const StyledSimpleColorInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../__internal__/input").InputProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>, any, {}, never>;
|
|
5
|
+
export declare const StyledSimpleColorInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../__internal__/legacy-input").InputProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>, any, {}, never>;
|
|
6
6
|
export declare const StyledTickIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {
|
|
7
7
|
color: string;
|
|
8
8
|
}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),o=require("../../../__internal__/input/input.component.js");require("react/jsx-runtime"),require("react"),require("../../../__internal__/input/input-presentation.style.js"),require("../../carbon-provider/__internal__/new-validation.context.js");var t=require("./checker-board.svg"),r=require("../../icon/icon.component.js"),i=require("../../../style/utils/get-rgb-values.js"),n=require("../../../style/utils/add-focus-styling.js");function l(e){return e&&e.__esModule?e:{default:e}}var s=l(e),a=l(t);const c=s.default.div.withConfig({displayName:"simple-color.style__StyledSimpleColor",componentId:"sc-
|
|
1
|
+
"use strict";var e=require("styled-components"),o=require("../../../__internal__/legacy-input/input.component.js");require("react/jsx-runtime"),require("react"),require("../../../__internal__/legacy-input/input-presentation.style.js"),require("../../carbon-provider/__internal__/new-validation.context.js");var t=require("./checker-board.svg"),r=require("../../icon/icon.component.js"),i=require("../../../style/utils/get-rgb-values.js"),n=require("../../../style/utils/add-focus-styling.js");function l(e){return e&&e.__esModule?e:{default:e}}var s=l(e),a=l(t);const c=s.default.div.withConfig({displayName:"simple-color.style__StyledSimpleColor",componentId:"sc-303f1be7-0"})(["width:var(--sizing700);height:var(--sizing700);margin-right:2px;margin-bottom:2px;&:hover{cursor:pointer;}"]),d=s.default.div.withConfig({displayName:"simple-color.style__StyledColorSampleBox",componentId:"sc-303f1be7-1"})(["height:100%;width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;"," ",""],(({color:o})=>"transparent"!==o&&e.css(["background-color:",";"],o)),(({color:o})=>"transparent"===o&&e.css(['background-color:#eeeeee;background-image:url("','");background-size:14px 14px;background-position:-2px -2px;'],a.default))),p=s.default(o.default).withConfig({displayName:"simple-color.style__StyledSimpleColorInput",componentId:"sc-303f1be7-2"})(["position:absolute;opacity:0;height:var(--sizing700);width:var(--sizing700);margin:0;&:hover{cursor:pointer;}&:disabled:hover{cursor:not-allowed;}&:focus + ","{","}"],d,n.default(!0)),u=s.default(r.default).withConfig({displayName:"simple-color.style__StyledTickIcon",componentId:"sc-303f1be7-3"})(["height:20px;width:20px;pointer-events:none;display:block;&::before{font-size:20px;color:",";}"],(({color:e})=>(e=>{const o=i.default(e),[t,r,n]=o;return(Math.round(299*t)+Math.round(587*r)+Math.round(114*n))/1e3<128?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)"})(e)));exports.StyledColorSampleBox=d,exports.StyledSimpleColor=c,exports.StyledSimpleColorInput=p,exports.StyledTickIcon=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../__internal__/utils/helpers/guid/index.js");require("../../style/utils/filter-styled-system-padding-props.js");var i=require("../../style/utils/filter-styled-system-margin-props.js"),l=require("../../hooks/__internal__/useLocale/useLocale.js"),n=require("../../hooks/useMediaQuery/useMediaQuery.js"),a=require("../loader/__next__/loader.component.js"),o=require("./switch.style.js"),s=require("../../__internal__/hint-text/hint-text.component.js");function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=c(t).default.forwardRef(((c,u)=>{var{checked:p,onChange:b,onBlur:h,onFocus:f,autoFocus:w,id:y,name:g,value:j,label:S,disabled:m,loading:x,processingLabel:O,processingLabelBelowSwitch:$=!1,size:v="small",labelInline:P=!1,labelSpacing:_,labelWidth:k,"data-element":L,"data-role":q,inputHint:T,required:H,labelHelp:z,fieldHelp:I,isDarkBackground:B,reverse:F,error:D,warning:M,info:R,validationOnLabel:W,fieldHelpInline:C,tooltipPosition:E,helpAriaLabel:A,validationMessagePositionTop:Q}=c,N=function(e,t){if(null==e)return{};var r,i,l=function(e,t){if(null==e)return{};var r,i,l={},n=Object.keys(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(c,["checked","onChange","onBlur","onFocus","autoFocus","id","name","value","label","disabled","loading","processingLabel","processingLabelBelowSwitch","size","labelInline","labelSpacing","labelWidth","data-element","data-role","inputHint","required","labelHelp","fieldHelp","isDarkBackground","reverse","error","warning","info","validationOnLabel","fieldHelpInline","tooltipPosition","helpAriaLabel","validationMessagePositionTop"]);const G=n.default("(prefers-reduced-motion: reduce)"),J=l.default(),K=J.switch.on(),U=J.switch.off(),V=null!=O?O:J.switch.processingLabel(),X=t.useRef(r.default()),Y=y||X.current,Z=t.useRef(`${r.default()}-label`),ee=t.useRef(`${r.default()}-hint`),te=null!=T?T:z,re=i.default(N);return e.jsxs(o.StyledSwitch,(ie=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){d(e,t,r[t])}))}return e}({"data-component":"switch","data-element":L,"data-role":q,$labelInline:P},re),le=null!=(le={children:[(S||te)&&e.jsxs(o.StyledSwitchLabelWrapper,{"data-role":"switch-label-wrapper",$labelInline:P,$labelWidth:P?k:void 0,children:[S&&e.jsx(o.StyledSwitchLabel,{htmlFor:Y,$disabled:m,$inputHint:!!te,$labelInline:P,$labelSpacing:P?_:void 0,$required:H,$size:v,id:Z.current,children:S}),te&&e.jsx(s.HintText,{"data-element":"input-hint",id:ee.current,isLarge:"large"===v,marginTop:"2px",children:te})]}),e.jsxs(o.StyledSwitchRow,{$size:v,$processingLabelBelowSwitch:x&&$,children:[e.jsxs(o.StyledSwitchTrack,{"data-role":"switch-track",$checked:p,$disabled:m,$size:v,$loading:x,$disableTransitions:!!G,children:[e.jsx(o.StyledSwitchInput,{ref:u,type:"checkbox",role:"switch",id:Y,name:g,value:j,checked:p,disabled:m||x,autoFocus:w,"aria-checked":p,onChange:b,onBlur:h,onFocus:f,"aria-describedby":te?ee.current:void 0,required:H}),x?e.jsx(o.StyledSwitchLoaderWrapper,{"data-role":"switch-loader-wrapper",$checked:p,$size:v,$disableTransitions:!!G,children:e.jsx(a.Loader,{"data-role":"switch-loader",loaderType:"ring",size:"large"===v?"small":"extra-small",showLabel:!1,inverse:p})}):e.jsx(o.StyledSwitchThumb,{"data-role":"switch-thumb",$checked:p,$disabled:m,$size:v,$disableTransitions:!!G})]}),x?e.jsx(o.StyledSwitchProcessingRow,{$below:$,"data-role":"switch-processing-row",children:e.jsx(o.StyledSwitchProcessingText,{$size:v,children:V})}):e.jsx(o.StyledSwitchStateText,{"aria-hidden":!0,$disabled:m,$size:v,children:p?K:U})]}),I&&e.jsx(s.HintText,{marginTop:"8px","data-element":"field-help",isLarge:"large"===v,children:I})]})?le:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(le)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(le)).forEach((function(e){Object.defineProperty(ie,e,Object.getOwnPropertyDescriptor(le,e))})),ie));var ie,le}));u.displayName="Switch",exports.Switch=u,exports.SwitchComponent=u,exports.default=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../__internal__/utils/helpers/guid/index.js");require("../../style/utils/filter-styled-system-padding-props.js");var i=require("../../style/utils/filter-styled-system-margin-props.js"),l=require("../../hooks/__internal__/useLocale/useLocale.js"),n=require("../../hooks/useMediaQuery/useMediaQuery.js"),a=require("../loader/__next__/loader.component.js"),o=require("./switch.style.js"),s=require("../../__internal__/legacy-hint-text/hint-text.component.js");function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=c(t).default.forwardRef(((c,u)=>{var{checked:p,onChange:b,onBlur:h,onFocus:f,autoFocus:w,id:y,name:g,value:j,label:S,disabled:m,loading:x,processingLabel:O,processingLabelBelowSwitch:$=!1,size:v="small",labelInline:P=!1,labelSpacing:_,labelWidth:k,"data-element":L,"data-role":q,inputHint:T,required:H,labelHelp:z,fieldHelp:I,isDarkBackground:B,reverse:F,error:D,warning:M,info:R,validationOnLabel:W,fieldHelpInline:C,tooltipPosition:E,helpAriaLabel:A,validationMessagePositionTop:Q}=c,N=function(e,t){if(null==e)return{};var r,i,l=function(e,t){if(null==e)return{};var r,i,l={},n=Object.keys(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(c,["checked","onChange","onBlur","onFocus","autoFocus","id","name","value","label","disabled","loading","processingLabel","processingLabelBelowSwitch","size","labelInline","labelSpacing","labelWidth","data-element","data-role","inputHint","required","labelHelp","fieldHelp","isDarkBackground","reverse","error","warning","info","validationOnLabel","fieldHelpInline","tooltipPosition","helpAriaLabel","validationMessagePositionTop"]);const G=n.default("(prefers-reduced-motion: reduce)"),J=l.default(),K=J.switch.on(),U=J.switch.off(),V=null!=O?O:J.switch.processingLabel(),X=t.useRef(r.default()),Y=y||X.current,Z=t.useRef(`${r.default()}-label`),ee=t.useRef(`${r.default()}-hint`),te=null!=T?T:z,re=i.default(N);return e.jsxs(o.StyledSwitch,(ie=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){d(e,t,r[t])}))}return e}({"data-component":"switch","data-element":L,"data-role":q,$labelInline:P},re),le=null!=(le={children:[(S||te)&&e.jsxs(o.StyledSwitchLabelWrapper,{"data-role":"switch-label-wrapper",$labelInline:P,$labelWidth:P?k:void 0,children:[S&&e.jsx(o.StyledSwitchLabel,{htmlFor:Y,$disabled:m,$inputHint:!!te,$labelInline:P,$labelSpacing:P?_:void 0,$required:H,$size:v,id:Z.current,children:S}),te&&e.jsx(s.HintText,{"data-element":"input-hint",id:ee.current,isLarge:"large"===v,marginTop:"2px",children:te})]}),e.jsxs(o.StyledSwitchRow,{$size:v,$processingLabelBelowSwitch:x&&$,children:[e.jsxs(o.StyledSwitchTrack,{"data-role":"switch-track",$checked:p,$disabled:m,$size:v,$loading:x,$disableTransitions:!!G,children:[e.jsx(o.StyledSwitchInput,{ref:u,type:"checkbox",role:"switch",id:Y,name:g,value:j,checked:p,disabled:m||x,autoFocus:w,"aria-checked":p,onChange:b,onBlur:h,onFocus:f,"aria-describedby":te?ee.current:void 0,required:H}),x?e.jsx(o.StyledSwitchLoaderWrapper,{"data-role":"switch-loader-wrapper",$checked:p,$size:v,$disableTransitions:!!G,children:e.jsx(a.Loader,{"data-role":"switch-loader",loaderType:"ring",size:"large"===v?"small":"extra-small",showLabel:!1,inverse:p})}):e.jsx(o.StyledSwitchThumb,{"data-role":"switch-thumb",$checked:p,$disabled:m,$size:v,$disableTransitions:!!G})]}),x?e.jsx(o.StyledSwitchProcessingRow,{$below:$,"data-role":"switch-processing-row",children:e.jsx(o.StyledSwitchProcessingText,{$size:v,children:V})}):e.jsx(o.StyledSwitchStateText,{"aria-hidden":!0,$disabled:m,$size:v,children:p?K:U})]}),I&&e.jsx(s.HintText,{marginTop:"8px","data-element":"field-help",isLarge:"large"===v,children:I})]})?le:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(le)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(le)).forEach((function(e){Object.defineProperty(ie,e,Object.getOwnPropertyDescriptor(le,e))})),ie));var ie,le}));u.displayName="Switch",exports.Switch=u,exports.SwitchComponent=u,exports.default=u;
|
package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalContentEditable"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalContentEditable"),t=require("react"),i=require("./content-editor.style.js");require("../../__plugins__/AutoLinker/auto-link.component.js"),require("@lexical/react/LexicalComposerContext"),require("@lexical/link"),require("@lexical/headless"),require("@lexical/html"),require("lexical"),require("@lexical/code"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("../../../text-editor.context.js");var o=require("../../__plugins__/useCursorAtEnd/index.js");require("../CharacterCounter/character-counter.style.js"),require("lodash/debounce"),require("../../../../../__internal__/i18n-context/index.js");var n=require("../LinkPreviewer/link-previewer.component.js");require("@lexical/react/LexicalTypeaheadMenuPlugin"),require("react-dom"),require("../Mentions/constants.js"),require("../Mentions/mentions.style.js"),require("../../../../tooltip/tooltip.component.js"),require("../../../../portrait/portrait.style.js"),require("../../../../../style/utils/filter-styled-system-padding-props.js"),require("../Placeholder/placeholder.style.js"),require("@lexical/utils"),require("../Toolbar/toolbar.style.js"),require("../../../../button/button.component.js"),require("../../../../box/box.component.js"),require("../Toolbar/buttons/typography-dropdown/dropdown.style.js"),require("../../../../icon/icon.component.js"),require("../Toolbar/button-group/button-group.style.js"),require("../../../../../__internal__/input/input.style.js"),require("../../../../../__internal__/validation-message/__next__/validation-message.style.js"),require("../../../../../__internal__/error-border/error-border.style.js"),require("../../../../textbox/__internal__/__next__/text-input.style.js"),require("../../../../../__internal__/hint-text/hint-text.style.js"),require("../../../../../__internal__/label/label.style.js"),require("../../../../tabs/__next__/tabs.style.js"),require("../../../../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),require("invariant"),require("../../../../../__internal__/validations/validation-icon.style.js"),require("../../../../../__internal__/character-count/character-count.style.js"),require("../../../../dialog/dialog.style.js"),require("../../../../heading/heading.style.js"),require("../../../../icon-button/icon-button.component.js"),require("../../../../typography/typography.component.js"),require("react-transition-group"),require("../../../../../hooks/__internal__/useScrollBlock/useScrollBlock.js"),require("../../../../portal/portal.js"),require("../../../../../__internal__/modal/modal-manager.js"),require("../../../../../__internal__/modal/modal.style.js"),require("../../../../../__internal__/modal/modal.context.js"),require("../../../../carbon-provider/__internal__/top-modal.context.js"),require("../../../../../__internal__/full-screen-heading/full-screen-heading.component.js"),require("../../../../form/form.component.js"),require("../../../../form/required-fields-indicator/required-fields-indicator.component.js");const a=t.forwardRef((({inputHint:t,namespace:a,previews:l=[],rows:s,readOnly:u,required:c,error:d,warning:_,validationMessagePositionTop:q,size:p="medium",id:j},x)=>{const m=o.default(),y=d||_?`${a}-validation-message`:"",b=t?`${a}-input-hint`:"",g=(q?`${y} ${b}`:`${b} ${y}`).trim();return e.jsxs(i.default,{"data-role":`${a}-content-editable`,error:d,warning:_,namespace:a,rows:s,readOnly:u,size:p,children:[e.jsx(r.ContentEditable,{id:j,ref:x,"aria-describedby":g,"aria-labelledby":`${a}-label`,"aria-required":c,"aria-invalid":d,className:`${a}-editable`,"data-role":`${a}-editable`,onBlur:e=>{var r;if(null===(r=e.relatedTarget)||void 0===r?void 0:r.classList.contains("toolbar-button")){var t;const r=null===(t=e.relatedTarget)||void 0===t?void 0:t.id;if(r){const e=document.querySelector(`[id="${r}"]`);e&&e.focus()}}},onFocus:e=>{e.relatedTarget&&e.relatedTarget.classList.contains("toolbar-button")||m(e)},"aria-autocomplete":void 0,"aria-readonly":void 0}),e.jsx(n.default,{previews:l})]})}));exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalComposer"),t=require("@lexical/react/LexicalClickableLinkPlugin"),n=require("@lexical/react/LexicalErrorBoundary"),i=require("@lexical/react/LexicalHistoryPlugin"),a=require("@lexical/react/LexicalMarkdownShortcutPlugin"),l=require("@lexical/react/LexicalRichTextPlugin"),o=require("@lexical/react/LexicalLinkPlugin"),s=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalOnChangePlugin"),d=require("./__internal__/__providers__/plugin-provider.js"),c=require("lexical"),_=require("react"),p=require("../../__internal__/label/label.component.js"),g=require("../../hooks/__internal__/useLocale/useLocale.js"),x=require("../../__internal__/utils/logger/index.js"),m=require("./__internal__/__utils__/constants.js"),j=require("./__internal__/__plugins__/AutoLinker/auto-link.component.js"),f=require("./__internal__/__plugins__/LinkMonitor/link-monitor.plugin.js"),v=require("./__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.js");require("./__internal__/__plugins__/useCursorAtEnd/index.js");var h=require("./__internal__/__plugins__/FormSubmission/form-submission.plugin.js"),b=require("./text-editor.context.js"),y=require("./text-editor.style.js"),q=require("./__internal__/__utils__/helpers.js"),P=require("../../__internal__/hint-text/hint-text.component.js"),w=require("../../__internal__/validation-message/validation-message.component.js"),O=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalComposer"),t=require("@lexical/react/LexicalClickableLinkPlugin"),n=require("@lexical/react/LexicalErrorBoundary"),i=require("@lexical/react/LexicalHistoryPlugin"),a=require("@lexical/react/LexicalMarkdownShortcutPlugin"),l=require("@lexical/react/LexicalRichTextPlugin"),o=require("@lexical/react/LexicalLinkPlugin"),s=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalOnChangePlugin"),d=require("./__internal__/__providers__/plugin-provider.js"),c=require("lexical"),_=require("react"),p=require("../../__internal__/legacy-label/label.component.js"),g=require("../../hooks/__internal__/useLocale/useLocale.js"),x=require("../../__internal__/utils/logger/index.js"),m=require("./__internal__/__utils__/constants.js"),j=require("./__internal__/__plugins__/AutoLinker/auto-link.component.js"),f=require("./__internal__/__plugins__/LinkMonitor/link-monitor.plugin.js"),v=require("./__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.js");require("./__internal__/__plugins__/useCursorAtEnd/index.js");var h=require("./__internal__/__plugins__/FormSubmission/form-submission.plugin.js"),b=require("./text-editor.context.js"),y=require("./text-editor.style.js"),q=require("./__internal__/__utils__/helpers.js"),P=require("../../__internal__/legacy-hint-text/hint-text.component.js"),w=require("../../__internal__/validation-message/validation-message.component.js"),O=require("../../__internal__/legacy-error-border/error-border.style.js");require("../../style/utils/filter-styled-system-padding-props.js");var E=require("../../style/utils/filter-styled-system-margin-props.js"),L=require("../../__internal__/utils/helpers/tags/tags.js"),S=require("./__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.js"),C=require("./__internal__/__utils__/theme.js"),T=require("./__internal__/__ui__/CharacterCounter/character-counter.component.js"),k=require("./__internal__/__ui__/ContentEditor/content-editor.component.js");require("./__internal__/__ui__/LinkPreviewer/link-previewer.style.js"),require("@lexical/react/LexicalComposerContext"),require("@lexical/react/LexicalTypeaheadMenuPlugin"),require("react-dom"),require("./__internal__/__ui__/Mentions/constants.js"),require("./__internal__/__ui__/Mentions/mentions.style.js"),require("../tooltip/tooltip.component.js"),require("../portrait/portrait.style.js");var M=require("./__internal__/__ui__/Placeholder/placeholder.component.js"),F=require("./__internal__/__ui__/Toolbar/toolbar.component.js");function $(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function R(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){$(e,r,t[r])}))}return e}let H=!1,B=!1,z=!1;const A=_.forwardRef((($,A)=>{var D,I,W,{characterLimit:N=3e3,error:V,footer:U,header:K,inputHint:X,labelText:G,namespace:J=m.COMPONENT_PREFIX,id:Q,onBlur:Y,onCancel:Z,onChange:ee,onFocus:re,onLinkAdded:te,onSave:ne,onFormSubmission:ie,placeholder:ae,previews:le=[],readOnly:oe=!1,required:se=!1,rows:ue,size:de="medium",warning:ce,customPlugins:_e,validationMessagePositionTop:pe=!1,toolbarControls:ge}=$,xe=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}($,["characterLimit","error","footer","header","inputHint","labelText","namespace","id","onBlur","onCancel","onChange","onFocus","onLinkAdded","onSave","onFormSubmission","placeholder","previews","readOnly","required","rows","size","warning","customPlugins","validationMessagePositionTop","toolbarControls"]);!H&&xe.value&&(H=!0,x.default.deprecate("`value` is deprecated in TextEditor and support will soon be removed. Please use `initialValue` instead.")),!B&&Z&&(B=!0,x.default.deprecate("`onCancel` is deprecated in TextEditor and support will soon be removed. Please ensure that `TextEditor` is used as a part of a `Form` component, which will handle the cancel functionality.")),!z&&ne&&(z=!0,x.default.deprecate("`onSave` is deprecated in TextEditor and support will soon be removed. Please ensure that `TextEditor` is used as a part of a `Form` component, which will handle the save functionality."));const me=_.useRef(null!==(W=null!==(I=xe.initialValue)&&void 0!==I?I:xe.value)&&void 0!==W?W:q.createEmpty()),je=g.default(),[fe,ve]=_.useState(void 0),he=_.useRef(null),[be,ye]=_.useState(null),[qe,Pe]=_.useState(!1);_.useImperativeHandle(A,(()=>({focus(){var e;null===(e=he.current)||void 0===e||e.focus()}})),[]),_.useEffect((()=>{const e=null==he?void 0:he.current,r=()=>{Pe(!0)},t=()=>{Pe(!1)};return null==e||e.addEventListener("focus",r),null==e||e.addEventListener("blur",t),()=>{null==e||e.removeEventListener("focus",r),null==e||e.removeEventListener("blur",t)}}),[he]);const we=_.useMemo((()=>({namespace:J,nodes:m.MARKDOWN_NODES,onError:e=>x.default.error(e.message),theme:C.getTheme(),editorState:me.current,editable:!oe})),[J,oe]),Oe=_.useCallback(((e,r)=>{const t=e.read((()=>c.$getRoot().getChildren().map((e=>e.getTextContent())).join("\n\n")));if(ee){const e=q.SerializeLexical(r);null==ee||ee(t,e)}if(N>0){const e=N-t.length;ve(e<0?je.textEditor.characterLimit(Math.abs(e)):void 0)}}),[N,je.textEditor,ee]),Ee=_.useCallback((e=>{if(!e.isEditable())return;if(!Z)return;const r=e.parseEditorState(me.current);e.setEditorState(r),Z()}),[Z]),Le=_.useMemo((()=>({namespace:J,onCancel:Z?Ee:void 0,onSave:ne,toolbarControls:ge})),[Ee,J,Z,ne,ge]),Se=ce||fe,Ce=()=>{switch(de){case"large":return"var(--spacing150)";case"small":return"var(--spacing050)";default:return"var(--spacing100)"}};return e.jsx(y.StyledTextEditorWrapper,(Te=R({"data-role":`${J}-editor-wrapper`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||null==Y||Y(e)},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||null==re||re(e)}},E.default(xe),L.default("text-editor",xe)),ke={children:e.jsxs(b.default.Provider,{value:{onLinkAdded:te},children:[e.jsx(p.default,{onClick:()=>{var e;return null===(e=he.current)||void 0===e?void 0:e.focus()},isRequired:se,labelId:`${J}-label`,children:G}),X&&!oe&&e.jsx(P.HintText,{id:`${J}-input-hint`,marginBottom:Ce(),children:X}),e.jsx(r.LexicalComposer,{initialConfig:we,children:e.jsxs(y.StyledWrapper,{"data-role":`${J}-wrapper`,ref:ye,children:[pe&&e.jsxs(e.Fragment,{children:[e.jsx(w.default,{error:V,warning:Se,validationId:`${J}-validation-message`,"data-role":`${J}-validation-message`,validationMessagePositionTop:pe}),(V||Se)&&e.jsx(O.default,{warning:!(V||!Se)})]}),e.jsxs(y.StyledEditorToolbarWrapper,{"data-role":`${J}-editor-toolbar-wrapper`,error:!!V,id:`${J}-editor-toolbar-wrapper`,children:[K&&e.jsx(y.StyledHeaderWrapper,{"data-role":`${J}-header-wrapper`,children:K}),oe?e.jsx(S.default,{"aria-label":G,initialValue:(null===(D=he.current)||void 0===D?void 0:D.innerHTML)||me.current,size:de}):e.jsxs(e.Fragment,{children:[e.jsx(F.default,R({contentEditorRef:he,hasHeader:Boolean(K),size:de},Le)),e.jsxs(y.StyledTextEditor,{"data-role":`${J}-editor`,error:!!V,children:[e.jsx(l.RichTextPlugin,{contentEditable:e.jsx(k.default,{id:Q,ref:he,inputHint:X,isFocused:qe,namespace:J,previews:le,rows:ue,readOnly:oe,required:se,error:!!V,warning:!!ce||!!fe,validationMessagePositionTop:pe,size:de}),placeholder:e.jsx(M.default,{namespace:J,text:ae}),ErrorBoundary:n.LexicalErrorBoundary}),e.jsx(s.ListPlugin,{}),e.jsx(i.HistoryPlugin,{}),e.jsx(a.MarkdownShortcutPlugin,{}),e.jsx(u.OnChangePlugin,{onChange:Oe,ignoreHistoryMergeTagChange:!0,ignoreSelectionChange:!0}),e.jsx(o.LinkPlugin,{validateUrl:q.validateUrl}),e.jsx(t.ClickableLinkPlugin,{newTab:!0}),e.jsx(j.default,{}),e.jsx(v.default,{}),e.jsx(h.FormSubmissionPlugin,{onFormSubmission:ie}),e.jsx(d.PluginProvider,{parentRef:be,children:_e})]})]}),U&&e.jsx(y.StyledFooterWrapper,{"data-role":`${J}-footer-wrapper`,size:de,children:U}),e.jsx(f.default,{})]}),!pe&&e.jsxs(e.Fragment,{children:[e.jsx(w.default,{error:V,warning:Se,validationId:`${J}-validation-message`,"data-role":`${J}-validation-message`,validationMessagePositionTop:pe}),(V||Se)&&e.jsx(O.default,{warning:!(V||!Se)})]}),N>0&&!oe&&e.jsx(T.default,{isFocused:qe,maxChars:N,namespace:J,marginTop:Ce()})]})})]})},ke=null!=ke?ke:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Te,Object.getOwnPropertyDescriptors(ke)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(ke)).forEach((function(e){Object.defineProperty(Te,e,Object.getOwnPropertyDescriptor(ke,e))})),Te));var Te,ke}));exports.TextEditor=A,exports.default=A;
|
|
@@ -3,14 +3,16 @@ import { MarginProps } from "styled-system";
|
|
|
3
3
|
import { IconType } from "../icon";
|
|
4
4
|
import { ValidationProps } from "../../__internal__/validations";
|
|
5
5
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
6
|
-
import { CommonInputProps } from "../../__internal__/input";
|
|
6
|
+
import { CommonInputProps } from "../../__internal__/legacy-input";
|
|
7
7
|
import { BorderRadiusType } from "../box/box.component";
|
|
8
8
|
export interface TextareaProps extends ValidationProps, MarginProps, Omit<CommonInputProps, "size">, TagProps {
|
|
9
9
|
/** Prop to specify the aria-labelledby property of the component */
|
|
10
10
|
"aria-labelledby"?: string;
|
|
11
11
|
/** id of the input */
|
|
12
12
|
id?: string;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set
|
|
15
|
+
**/
|
|
14
16
|
adaptiveLabelBreakpoint?: number;
|
|
15
17
|
/** Automatically focus the input on component mount */
|
|
16
18
|
autoFocus?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../__internal__/utils/helpers/tags/tags.js"),i=require("../../__internal__/legacy-input/input.component.js"),n=require("../../__internal__/legacy-input/input-presentation.component.js"),l=require("../../__internal__/form-field/form-field.component.js"),a=require("../../hooks/useCharacterCount/useCharacterCount.js"),o=require("../../__internal__/input-behaviour/input-behaviour.component.js"),d=require("../../__internal__/input-icon-toggle/input-icon-toggle.component.js"),s=require("../../__internal__/utils/helpers/guid/index.js"),u=require("./textarea.style.js"),c=require("../../__internal__/tooltip-provider/index.js"),p=require("../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),b=require("../carbon-provider/__internal__/new-validation.context.js"),f=require("../../__internal__/legacy-error-border/error-border.style.js"),g=require("../../__internal__/validation-message/validation-message.component.js"),h=require("../box/box.component.js"),v=require("../../__internal__/utils/logger/index.js"),_=require("../../__internal__/legacy-hint-text/hint-text.component.js");require("../../style/utils/filter-styled-system-padding-props.js");var y=require("../../style/utils/filter-styled-system-margin-props.js");function j(e){return e&&e.__esModule?e:{default:e}}function m(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function x(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},i=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),i.forEach((function(r){m(e,r,t[r])}))}return e}let O=!1,I=!1;const w=j(r).default.forwardRef(((j,m)=>{var{"aria-labelledby":w,"aria-describedby":H,autoFocus:q,inputHint:T,fieldHelp:P,label:E,children:L,characterLimit:A,onChange:B,onFocus:R,onBlur:F,disabled:M=!1,labelInline:S,labelAlign:k,labelHelp:C,labelSpacing:D,inputIcon:W,id:N,error:G,warning:U,info:z,name:V,readOnly:$=!1,placeholder:J,expandable:K=!1,rows:Q,validationOnLabel:X=!1,adaptiveLabelBreakpoint:Y,inputWidth:Z,maxWidth:ee,labelWidth:re=30,tooltipPosition:te,value:ie,"data-element":ne,"data-role":le,helpAriaLabel:ae,borderRadius:oe,hideBorders:de=!1,required:se,isOptional:ue,minHeight:ce=u.DEFAULT_MIN_HEIGHT,validationMessagePositionTop:pe=!0}=j,be=function(e,r){if(null==e)return{};var t,i,n=function(e,r){if(null==e)return{};var t,i,n={},l=Object.keys(e);for(i=0;i<l.length;i++)t=l[i],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)t=l[i],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(j,["aria-labelledby","aria-describedby","autoFocus","inputHint","fieldHelp","label","children","characterLimit","onChange","onFocus","onBlur","disabled","labelInline","labelAlign","labelHelp","labelSpacing","inputIcon","id","error","warning","info","name","readOnly","placeholder","expandable","rows","validationOnLabel","adaptiveLabelBreakpoint","inputWidth","maxWidth","labelWidth","tooltipPosition","value","data-element","data-role","helpAriaLabel","borderRadius","hideBorders","required","isOptional","minHeight","validationMessagePositionTop"]);!O&&ue&&(O=!0,v.default.deprecate("`isOptional` is deprecated in TextArea and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead."));const{validationRedesignOptIn:fe}=r.useContext(b.default),ge=!fe&&S,[he,ve]=r.useState(u.DEFAULT_MIN_HEIGHT),_e=e=>fe?void 0:e,{current:ye}=r.useRef(N||s.default()),je=r.useRef(null),me=r.useCallback((e=>{je.current=e,m&&("current"in m?m.current=e:m(e))}),[m]),[xe,Oe]=r.useState("off");Array.isArray(oe)&&oe.length>4&&!I&&(v.default.warn("The `borderRadius` prop in `Textarea` component only supports up to 4 values."),I=!0);const Ie=r.useCallback((()=>{const e=je.current;if((null==e?void 0:e.scrollHeight)&&(null==e?void 0:e.scrollHeight)>he){let r=e;for(;r&&!(null==r?void 0:r.scrollTop);)r=(null==r?void 0:r.parentElement)||null;const t=null==r?void 0:r.scrollTop;e.style.height="auto",e.style.height=`${Math.max(e.scrollHeight,he)}px`,r&&t&&(r.scrollTop=t)}}),[he]),{labelId:we,validationId:He,fieldHelpId:qe,ariaDescribedBy:Te}=p.default({id:ye,validationRedesignOptIn:fe,error:G,warning:U,info:z,label:E,fieldHelp:P}),[Pe,Ee]=a.default(ie,A,xe);r.useEffect((()=>{var e;ve(Q?(null==je||null===(e=je.current)||void 0===e?void 0:e.scrollHeight)||0:ce>u.DEFAULT_MIN_HEIGHT?ce:u.DEFAULT_MIN_HEIGHT)}),[ce,Q]),r.useEffect((()=>{K&&Ie()})),r.useEffect((()=>{var e,r;return K&&(window.addEventListener("resize",Ie),ve((null==je||null===(e=je.current)||void 0===e?void 0:e.clientHeight)||0),null===(r=document.fonts)||void 0===r||r.addEventListener("loadingdone",Ie)),()=>{var e;K&&(window.removeEventListener("resize",Ie),null===(e=document.fonts)||void 0===e||e.removeEventListener("loadingdone",Ie))}}),[Ie,K]);const Le=!!(W||He&&!X),Ae=r.useRef(s.default()),Be=T?Ae.current:void 0,Re=[...fe&&pe?[Te,Be]:[Be,Te],Ee,H].filter(Boolean).join(" "),Fe=e.jsxs(n.default,{disabled:M,readOnly:$,inputWidth:"number"==typeof Z?Z:100-re,maxWidth:ee,error:G,warning:U,info:z,borderRadius:oe,hideBorders:de,children:[e.jsx(i.default,x({"aria-invalid":!!G,"aria-labelledby":w,"aria-describedby":Re,autoFocus:q,name:V,value:ie,ref:me,onChange:B,onFocus:e=>{A&&Oe("polite"),null==R||R(e)},onBlur:e=>{A&&Oe("off"),null==F||F(e)},disabled:M,readOnly:$,placeholder:M?"":J,rows:Q,id:ye,as:"textarea",validationIconId:fe?void 0:He,inputBorderRadius:oe,required:se},be)),L,e.jsx(d.default,{disabled:M,readOnly:$,inputIcon:W,error:G,warning:U,info:z,validationIconId:fe?void 0:He,useValidationIcon:!(fe||X)})]}),Me=y.default(be);return e.jsx(c.TooltipProvider,{tooltipPosition:te,helpAriaLabel:ae,children:e.jsx(o.InputBehaviour,{children:e.jsx(u.default,(Se=x({labelInline:ge,hasIcon:Le,minHeight:he},Me,t.default("textarea",{"data-element":ne,"data-role":le})),ke={children:e.jsxs(l.default,{fieldHelp:_e(P),fieldHelpId:qe,error:G,warning:U,info:z,label:E,labelId:we,disabled:M,id:ye,labelInline:_e(ge),labelAlign:k,labelWidth:_e(re),labelHelp:_e(C),labelSpacing:D,isRequired:se,useValidationIcon:_e(X),adaptiveLabelBreakpoint:Y,validationRedesignOptIn:fe,my:0,children:[(T||C&&fe)&&e.jsx(_.HintText,{align:k,id:Be,"data-element":"input-hint",children:T||C}),fe?e.jsxs(h.Box,{position:"relative",children:[pe&&e.jsxs(e.Fragment,{children:[e.jsx(g.default,{error:G,validationId:He,warning:U,validationMessagePositionTop:pe}),(G||U)&&e.jsx(f.default,{warning:!(G||!U)})]}),Fe,!pe&&e.jsxs(e.Fragment,{children:[e.jsx(g.default,{error:G,validationId:He,warning:U,validationMessagePositionTop:pe}),(G||U)&&e.jsx(f.default,{warning:!(G||!U)})]})]}):Fe,Pe]})},ke=null!=ke?ke:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Se,Object.getOwnPropertyDescriptors(ke)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(ke)).forEach((function(e){Object.defineProperty(Se,e,Object.getOwnPropertyDescriptor(ke,e))})),Se))})});var Se,ke}));w.displayName="Textarea",exports.OriginalTextarea=w,exports.Textarea=w,exports.default=w;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),i=require("../../__internal__/input/input.style.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),i=require("../../__internal__/legacy-input/input.style.js"),a=require("../../__internal__/legacy-label/label.style.js"),n=require("../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),r=require("../../style/themes/apply-base-theme.js");function l(e){return e&&e.__esModule?e:{default:e}}const s=l(e).default.div.attrs(r.default).withConfig({displayName:"textarea.style__StyledTextarea",componentId:"sc-4ae1af1-0"})(["margin-bottom:var(--fieldSpacing);",";","{box-sizing:border-box;resize:none;"," padding:var(--spacing150) var(--spacing200);","}"," ","{height:40px;position:absolute;height:100%;top:0px;right:4px;}"],t.margin,i.default,(({minHeight:e})=>`min-height: ${e||64}px;`),(({hasIcon:e})=>e&&"padding-right: var(--spacing500);"),(({labelInline:t})=>t&&e.css(["","{align-items:flex-start;padding-top:6px;}"],a.StyledLabelContainer)),n.default);exports.DEFAULT_MIN_HEIGHT=64,exports.default=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./text-input.component.js");exports.default=e.TextInput;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { InputProps } from "../../../../__internal__/input";
|
|
4
|
+
import { ValidationProps } from "../../../../__internal__/validations";
|
|
5
|
+
import { TagProps } from "../../../../__internal__/utils/helpers/tags";
|
|
6
|
+
export interface TextInputProps extends Omit<ValidationProps, "info">, MarginProps, Omit<InputProps, "size" | "error">, TagProps {
|
|
7
|
+
/**
|
|
8
|
+
* @private @internal @ignore
|
|
9
|
+
* Sets the input's text alignment. Does not affect the position of the input's prefix or suffix icons.
|
|
10
|
+
*/
|
|
11
|
+
align?: "left" | "right";
|
|
12
|
+
/**
|
|
13
|
+
* The ID of the element(s) that describe the input, typically used to reference the hint and/or
|
|
14
|
+
* validation message(s) associated with the input. Can be a space-separated list of IDs if there
|
|
15
|
+
* are multiple descriptive elements.
|
|
16
|
+
*/
|
|
17
|
+
"aria-describedby"?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the element that labels the input, typically used to reference the input's label when
|
|
20
|
+
* the label is not properly associated with the input via the htmlFor attribute.
|
|
21
|
+
*/
|
|
22
|
+
"aria-labelledby"?: string;
|
|
23
|
+
/**
|
|
24
|
+
* If true, the input will automatically receive focus when the component is mounted.
|
|
25
|
+
*/
|
|
26
|
+
autoFocus?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Unique identifier for the input.
|
|
29
|
+
* Label id will be based on it, using following pattern: [id]-label.
|
|
30
|
+
* Will use a randomly generated GUID if none is provided
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* @private @internal @ignore
|
|
34
|
+
* `data-component` attribute to be added to the component's root element for testing and tracking purposes.
|
|
35
|
+
*/
|
|
36
|
+
"data-component"?: string;
|
|
37
|
+
/**
|
|
38
|
+
* @private @internal @ignore
|
|
39
|
+
* `data-is-open` attribute to be added to the component's root element when rendered as part of Select.
|
|
40
|
+
*/
|
|
41
|
+
"data-is-open"?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the input's id attribute, is not set a unique id will be generated and used.
|
|
44
|
+
* The label's htmlFor attribute will be set to match the input's id to ensure they are properly associated.
|
|
45
|
+
*/
|
|
46
|
+
id?: string;
|
|
47
|
+
/** A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input */
|
|
48
|
+
inputHint?: string;
|
|
49
|
+
/**
|
|
50
|
+
* @internal @private @ignore
|
|
51
|
+
* An Icon to be rendered next to the input
|
|
52
|
+
* */
|
|
53
|
+
inputIcon?: React.ReactNode;
|
|
54
|
+
/** The width of the input as a percentage (e.g., 50 for 50%) */
|
|
55
|
+
inputWidth?: number;
|
|
56
|
+
/** Label content */
|
|
57
|
+
label: string;
|
|
58
|
+
/** When true label is inline */
|
|
59
|
+
labelInline?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Slot to render additional content to the left of the input, such as a prefix.
|
|
62
|
+
*/
|
|
63
|
+
leftChildren?: React.ReactNode;
|
|
64
|
+
/** The maximum width of the component container */
|
|
65
|
+
maxWidth?: string;
|
|
66
|
+
/**
|
|
67
|
+
* @param ev - React's mouse event for the input element
|
|
68
|
+
* Callback called when mouse is clicked down on the input, but before it receives focus.
|
|
69
|
+
*/
|
|
70
|
+
onMouseDown?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
71
|
+
/**
|
|
72
|
+
* @param ev - React's mouse event for the input element
|
|
73
|
+
* Callback called when the input is clicked.
|
|
74
|
+
*/
|
|
75
|
+
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
76
|
+
/** Size of an input */
|
|
77
|
+
size?: "small" | "medium" | "large";
|
|
78
|
+
/**
|
|
79
|
+
* The type of the input, e.g., "text", "email", "password". This prop is passed directly
|
|
80
|
+
* to the underlying input element, so any valid HTML input type is accepted.
|
|
81
|
+
* The default value is "text".
|
|
82
|
+
*/
|
|
83
|
+
type?: string;
|
|
84
|
+
/**
|
|
85
|
+
* @private @internal @ignore
|
|
86
|
+
* If true, the validation message will be rendered above the input, otherwise it will be rendered below.
|
|
87
|
+
*/
|
|
88
|
+
validationMessagePositionTop?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
91
|
+
export default TextInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../../../__internal__/input/input.component.js"),n=require("../../../../__internal__/validation-message/__next__/validation-message.component.js");require("../../../../style/utils/filter-styled-system-padding-props.js");var i=require("../../../../style/utils/filter-styled-system-margin-props.js"),l=require("../../../../style/utils/filter-out-styled-system-spacing-props.js"),a=require("../../../../hooks/__internal__/useUniqueId/index.js"),o=require("../../../../__internal__/utils/helpers/guid/index.js"),s=require("../../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),u=require("../../../../__internal__/error-border/error-border.style.js"),d=require("./text-input.style.js"),c=require("../../../../__internal__/hint-text/hint-text.component.js"),p=require("../../../../__internal__/label/label.component.js"),b=require("../../../../hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js"),f=require("../../../../__internal__/utils/helpers/combine-refs/index.js"),y=require("../../../../__internal__/fieldset-validation-context/fieldset-validation-context.js");function _(e){return e&&e.__esModule?e:{default:e}}function j(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){j(e,r,t[r])}))}return e}function m(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const x=_(r).default.forwardRef(((_,j)=>{var{autoFocus:x,"aria-describedby":O,"aria-labelledby":g,children:v,"data-component":q="text-input","data-element":w,"data-is-open":I,"data-role":P,disabled:C,error:k,id:W,inputHint:$,inputIcon:z,inputWidth:T,label:D,labelInline:M=!1,leftChildren:R,maxWidth:S,name:E,onChange:F,onClick:B,onMouseDown:H,placeholder:V,prefix:A,readOnly:L,required:U,size:G="medium",type:J="text",validationMessagePositionTop:K,value:N,warning:Q}=_,X=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},l=Object.keys(e);for(n=0;n<l.length;n++)t=l[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)t=l[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(_,["autoFocus","aria-describedby","aria-labelledby","children","data-component","data-element","data-is-open","data-role","disabled","error","id","inputHint","inputIcon","inputWidth","label","labelInline","leftChildren","maxWidth","name","onChange","onClick","onMouseDown","placeholder","prefix","readOnly","required","size","type","validationMessagePositionTop","value","warning"]);const Y=r.useRef(null),Z=f.default(j,Y),{disableErrorBorder:ee}=r.useContext(y.default),re={disabled:C,readOnly:L},[te,ne]=a.default(W,E),{labelId:ie,validationId:le,ariaDescribedBy:ae}=s.default({id:te,validationRedesignOptIn:!0,error:k,warning:Q,label:D}),oe=r.useRef(o.default()),se=$?oe.current:void 0,ue=null!=T?T:M?80:100,de=[se,ae,O].filter(Boolean).join(" "),ce=!(!k&&!Q);b.default(!!k,!!Q,te);const pe=ce&&!ee&&e.jsx(n.default,{id:le,size:G,error:k,warning:Q}),be=ce&&!ee&&e.jsx(u.default,{"data-role":"error-border",$warning:!(k||!Q)}),fe=r.useCallback((e=>{C||L||null==H||H(e)}),[H,C,L]),ye=r.useCallback((e=>{C||L||null==B||B(e)}),[B,C,L]);return e.jsxs(d.StyledTextInput,m(h({"data-element":w,"data-role":P,"data-component":q,$size:G,$labelInline:M,$hasValidationFailure:M&&ce},i.default(X)),{children:[D&&e.jsxs(d.LabelWrapper,{"data-role":"label-wrapper",$labelInline:M,$size:G,$labelWrapperWidth:M&&"number"==typeof ue?100-ue:void 0,children:[e.jsx(p.default,m(h({id:ie,htmlFor:te,size:G,isRequired:U},re),{children:D})),$&&e.jsx(c.HintText,m(h({id:se,size:G},re),{children:$}))]}),e.jsxs(d.InputWrapper,{"data-role":"input-wrapper",$size:G,$maxWidth:S,$inputWidth:T,onClick:()=>{var e;C||L||document.activeElement===Y.current||null===(e=Y.current)||void 0===e||e.focus()},"data-is-open":I,children:[K&&pe,e.jsx(t.default,m(h({id:te,name:ne,"aria-invalid":!!k,"aria-describedby":de,"aria-labelledby":g,value:N,placeholder:C||L?void 0:V,required:U,ref:Z,autoFocus:x,onMouseDown:fe,onClick:ye,onChange:F,error:!!k,inputIcon:z,size:G,prefix:A,leftChildren:R,type:J},re,l.default(X)),{children:v})),!K&&pe,be]})]}))}));exports.TextInput=x,exports.default=x;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface StyledTextInputProps {
|
|
2
|
+
$labelInline?: boolean;
|
|
3
|
+
$size: "small" | "medium" | "large";
|
|
4
|
+
$hasValidationFailure?: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface LabelWrapperProps {
|
|
7
|
+
$labelInline?: boolean;
|
|
8
|
+
$labelWrapperWidth?: number;
|
|
9
|
+
$size: "small" | "medium" | "large";
|
|
10
|
+
}
|
|
11
|
+
interface InputWrapperProps {
|
|
12
|
+
$size: "small" | "medium" | "large";
|
|
13
|
+
$maxWidth?: string;
|
|
14
|
+
$inputWidth?: number;
|
|
15
|
+
}
|
|
16
|
+
declare const StyledTextInput: import("styled-components").StyledComponent<"div", any, {
|
|
17
|
+
theme: object;
|
|
18
|
+
} & StyledTextInputProps, "theme">;
|
|
19
|
+
declare const LabelWrapper: import("styled-components").StyledComponent<"div", any, LabelWrapperProps, never>;
|
|
20
|
+
declare const InputWrapper: import("styled-components").StyledComponent<"div", any, InputWrapperProps, never>;
|
|
21
|
+
export { StyledTextInput, LabelWrapper, InputWrapper };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("styled-components"),a=require("styled-system"),t=require("../../../../style/themes/apply-base-theme.js");function l(e){return e&&e.__esModule?e:{default:e}}var i=l(e);const s=i.default.div.attrs(t.default).withConfig({displayName:"text-input.style__StyledTextInput",componentId:"sc-bf599bd2-0"})(['[data-component="inline-inputs"] &,&[data-element="current-page"]{--fieldSpacing:0px;}margin-bottom:var(--fieldSpacing);'," display:flex;align-items:flex-start;flex-direction:",";gap:",";.time &{gap:unset;}.search &{flex:1 1 0%;}"],a.margin,(({$labelInline:e})=>e?"row":"column"),(({$labelInline:e,$size:a,$hasValidationFailure:t})=>{if(!e)switch(a){case"small":return"var(--global-space-comp-xs)";case"large":return"var(--global-space-comp-m)";default:return"var(--global-space-comp-s)"}return"large"===a?t?"var(--global-space-comp-l)":"var(--global-space-comp-m)":t?"var(--global-space-comp-l)":"var(--global-space-comp-s)"})),n=i.default.div.withConfig({displayName:"text-input.style__LabelWrapper",componentId:"sc-bf599bd2-1"})([""," display:flex;flex-direction:column;align-self:stretch;",""],(({$labelWrapperWidth:e})=>e&&`\n --label-spacing: ${e}%;\n\n [data-component="date-range"] & {\n --label-spacing: ${2*e}%;\n }\n `),(({$labelInline:a,$size:t})=>e.css([""," ",""],a&&e.css(["padding-top:var(--global-space-comp-",");justify-content:flex-start;align-items:flex-end;align-self:stretch;width:var(--label-spacing,auto);"],t.charAt(0)),!a&&e.css(["justify-content:flex-end;align-items:flex-start;"])))),p=i.default.div.withConfig({displayName:"text-input.style__InputWrapper",componentId:"sc-bf599bd2-2"})(["display:flex;flex-direction:column;position:relative;width:100%;min-width:0;gap:",";",' &[data-is-open="true"]{z-index:var(--adaptiveSidebarModalBackdrop,9999);}'],(({$size:e})=>"small"===e?"var(--global-space-comp-xs)":"var(--global-space-comp-s)"),(({$maxWidth:a,$inputWidth:t})=>e.css([""," width:",";"],a&&`max-width: ${a};`,t?`${t}%`:"100%")));exports.InputWrapper=p,exports.LabelWrapper=n,exports.StyledTextInput=s;
|