carbon-react 158.50.0 → 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/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/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/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/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/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/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
|
-
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import n,{useRef as i,useContext as o,useLayoutEffect as c,useEffect as l}from"react";import{StyledCheckableInput as
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import n,{useRef as i,useContext as o,useLayoutEffect as c,useEffect as l}from"react";import{StyledCheckableInput as a,StyledCheckableInputWrapper as s,StyledAccordion as d,StyledLineContainer as u,StyledAccordionLine as m,StyledAccordionContent as p}from"./checkable-input.style.js";import f from"../hidden-checkable-input.component.js";import b from"../../utils/helpers/guid/index.js";import h from"../../legacy-label/label.component.js";import{HintText as g}from"../../legacy-hint-text/hint-text.component.js";import y from"../../../hooks/useMediaQuery/useMediaQuery.js";import{TabsContext as j}from"../../../components/tabs/__next__/tabs.context.js";import{TabContext as O}from"../../../components/tabs/__next__/tab.context.js";function v(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]:{},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){v(e,r,t[r])}))}return e}const w=n.forwardRef(((n,v)=>{var{children:w,disabled:k,id:_,name:$,type:P,value:z,label:D,inputHint:S,checked:H,progressiveDisclosure:E,size:I="medium",error:B,warning:L}=n,M=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(n,["children","disabled","id","name","type","value","label","inputHint","checked","progressiveDisclosure","size","error","warning"]);const{current:Q}=i(_||b()),A=S?`${Q}-hint`:void 0,C=i(null),F=y("screen and (prefers-reduced-motion: no-preference)"),{scrollHeight:N}=C.current||{},R=H&&N?String(N):"0",{setErrors:W,setWarnings:q}=o(j),{tabId:G}=o(O),J=i(!1);return c((()=>(J.current=!0,()=>{J.current=!1})),[]),l((()=>(W&&W(Q,G||"",!!B),q&&q(Q,G||"",!!L),()=>{J.current||(W&&W(Q,G||"",!1),q&&q(Q,G||"",!1))})),[Q,W,q,B,L,G]),e(r,{children:[e(a,{$size:I,children:[e(s,{children:[t(f,x({id:Q,type:P,name:$,value:z,disabled:k,checked:H,ref:v,ariaDescribedBy:A},M)),w]}),D&&t(h,{htmlFor:Q,disabled:k,isLarge:"large"===I,children:D}),S&&t(g,{id:A,marginBottom:"0",isDisabled:k,isLarge:"large"===I,children:S})]}),E&&e(d,{"data-role":"progressive-disclosure-accordion",ref:C,$expanded:H,$contentHeight:R,$allowAnimation:F,children:[t(u,{$size:I,children:t(m,{$size:I})}),t(p,{children:E})]})]})}));w.displayName="CheckableInput";export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{css as i}from"styled-components";import t,{StyledLabelContainer as a}from"../../legacy-label/label.style.js";import l from"../../legacy-hint-text/hint-text.style.js";const o={small:"var(--global-font-static-comp-regular-s)",medium:"var(--global-font-static-comp-regular-m)",large:"var(--global-font-static-comp-regular-l)"},n=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInput",componentId:"sc-49f7bf7-0"})(["display:grid;grid-template-columns:auto 1fr;grid-column-gap:var(--global-space-comp-s);","{padding:0;margin:0;}","{","}","{grid-area:2 / 2;}"],a,t,(({$size:e})=>e&&i(["font:",";"],o[e])),l),s=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInputWrapper",componentId:"sc-49f7bf7-1"})(["display:flex;align-items:center;min-height:var(--global-size-xs);"]),c=e.div.withConfig({displayName:"checkable-input.style__StyledAccordion",componentId:"sc-49f7bf7-2"})(["overflow-y:hidden;visibility:hidden;max-height:0;position:relative;display:grid;grid-template-columns:auto 1fr;grid-column-gap:var(--global-space-comp-s);"," ",""],(({$allowAnimation:e})=>e&&i(["transition:all 0.4s;"])),(({$expanded:e,$contentHeight:t})=>i(["",""],e&&i(["visibility:visible;max-height:","px;"],t)))),p={small:{top:"var(--global-space-comp-xs)",width:"var(--global-size-3-xs)"},medium:{top:"var(--global-space-comp-s)",width:"var(--global-size-xs)"},large:{top:"var(--global-space-comp-m)",width:"var(--global-size-s)"}},d="var(--global-space-comp-m)",r=e.div.withConfig({displayName:"checkable-input.style__StyledLineContainer",componentId:"sc-49f7bf7-3"})(["display:flex;justify-content:center;",""],(({$size:e})=>e&&i(["width:",";"],p[e].width))),m=e.div.withConfig({displayName:"checkable-input.style__StyledAccordionLine",componentId:"sc-49f7bf7-4"})(["position:absolute;width:2px;background-color:var(--input-typical-border-alt);border-radius:2px;",""],(({$size:e})=>e&&i(["top:",";height:calc( 100% - ("," + ",") );"],p[e].top,p[e].top,d))),g=e.div.withConfig({displayName:"checkable-input.style__StyledAccordionContent",componentId:"sc-49f7bf7-5"})(["padding:"," 0;"],d);export{c as StyledAccordion,g as StyledAccordionContent,m as StyledAccordionLine,n as StyledCheckableInput,s as StyledCheckableInputWrapper,r as StyledLineContainer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{css as i}from"styled-components";import l from"../field-help/field-help.style.js";import{FieldLineStyle as t}from"../form-field/form-field.style.js";import o,{StyledLabelContainer as n}from"../label/label.style.js";import r from"../validations/validation-icon.style.js";import a from"../../components/help/help.style.js";import d from"./hidden-checkable-input.style.js";const s=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInput",componentId:"sc-
|
|
1
|
+
import e,{css as i}from"styled-components";import l from"../field-help/field-help.style.js";import{FieldLineStyle as t}from"../form-field/form-field.style.js";import o,{StyledLabelContainer as n}from"../legacy-label/label.style.js";import r from"../validations/validation-icon.style.js";import a from"../../components/help/help.style.js";import d from"./hidden-checkable-input.style.js";const s=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInput",componentId:"sc-e1e587cd-0"})(["display:inline-block;position:relative;"]),p=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInputWrapper",componentId:"sc-e1e587cd-1"})(["",""],(({disabled:e,fieldHelpInline:p,inputWidth:c,labelWidth:f,labelInline:m,reverse:h,isDarkBackground:y})=>i(["width:100% !important;","{display:flex;}","{"," padding-top:0;width:auto;& ",",& ","{color:var(--colorsUtilityYin065);vertical-align:middle;&:hover,&:focus{color:var(--colorsUtilityYin090);}}}","{"," flex-basis:100%;}"," "," "," "," ",""],t,n,m&&i(["justify-content:",";"],h?"flex-start":"flex-end"),a,r,l,y&&i(["color:var(--colorsUtilityYang080);"]),e&&i(["",",","{&:hover,&:focus{outline:none;cursor:not-allowed;}}"],d,o),p&&i(["","{flex-wrap:nowrap;}","{margin-right:0;margin-left:8px;}","{flex-grow:0;flex-basis:auto;padding-left:0;width:auto;}"],t,s,l),h&&p&&i(["","{margin-left:0;}","{flex-grow:1;}"],s,l),void 0!==c&&0!==c&&i(["","{width:","% !important;min-width:67px;}"],s,c),void 0!==f&&0!==f&&`\n ${n} {\n width: ${f}% !important;\n }\n `)));export{s as StyledCheckableInput,p as StyledCheckableInputWrapper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r,{css as o}from"styled-components";const t=r.span.withConfig({displayName:"error-border.style__ErrorBorder",componentId:"sc-f2eef804-0"})([""," transform:translateZ(0);.numeral-date-wrapper &{display:none;}"],(({$warning:r})=>o(["width:2px;position:absolute;left:-10px;top:0px;bottom:0px;z-index:6;background-color:",";"],r?"var(--input-validation-bar-warn)":"var(--input-validation-border-error)")));export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useRef as i}from"react";import{StyledFieldset as n,StyledLegend as o,StyledFieldsetContentWrapper as l}from"./fieldset.style.js";import s from"../../legacy-error-border/error-border.style.js";import a from"../../validation-message/validation-message.component.js";import{HintText as c}from"../../legacy-hint-text/hint-text.component.js";import d from"../../utils/helpers/guid/index.js";import"../../../style/utils/filter-styled-system-padding-props.js";import g from"../../../style/utils/filter-styled-system-margin-props.js";function p(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const m=m=>{var{children:f,name:u,id:b,legend:y,legendAlign:O,legendHint:j,error:v,warning:h,isRequired:P,isDisabled:w,validationMessagePositionTop:$,size:D="medium"}=m,x=function(e,r){if(null==e)return{};var t,i,n=function(e,r){if(null==e)return{};var t,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)t=o[i],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)t=o[i],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(m,["children","name","id","legend","legendAlign","legendHint","error","warning","isRequired","isDisabled","validationMessagePositionTop","size"]);const S=i(d()),z=b||S.current,k=j?`${z}-hint`:void 0,q=(v||h)&&`${z}-validation-message`,E=[k,q].filter(Boolean).join(" "),L=()=>v||h?e(t,{children:[r(a,{error:v,warning:h,validationId:q,isLarge:"large"===D}),r(s,{warning:!(v||!h)})]}):null;return e(n,(M=function(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){p(e,r,t[r])}))}return e}({"data-component":"fieldset",id:z,name:u,"aria-describedby":E,$validationMessagePositionTop:$,$size:D},g(x),x),R=null!=(R={children:[y&&r(o,{"data-element":"legend",$align:O,$isRequired:P,$isDisabled:w,$isLarge:"large"===D,children:y}),j&&r(c,{id:k,isDisabled:w,align:O,isLarge:"large"===D,marginBottom:"0",children:j}),e(l,{$size:D,children:[$&&L(),f,!$&&L()]})]})?R:{},Object.getOwnPropertyDescriptors?Object.defineProperties(M,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(e){Object.defineProperty(M,e,Object.getOwnPropertyDescriptor(R,e))})),M));var M,R};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as i}from"react/jsx-runtime";import{useContext as n,useState as t,useRef as o,useEffect as l}from"react";import{StyledFieldset as a,StyledLegend as s,StyledIconWrapper as d}from"./fieldset.style.js";import{ValidationIcon as p}from"../validations/validation-icon.component.js";import c from"../../components/carbon-provider/__internal__/new-validation.context.js";import{InputGroupBehaviour as u,InputGroupContext as m}from"../input-behaviour/input-group-behaviour.component.js";import{Help as f}from"../../components/help/help.component.js";import{Typography as g}from"../../components/typography/typography.component.js";import{Box as b}from"../../components/box/box.component.js";import y from"../legacy-error-border/error-border.style.js";import h from"../validation-message/validation-message.component.js";import{HintText as j}from"../legacy-hint-text/hint-text.component.js";import{FieldHelp as v}from"../field-help/field-help.component.js";import O from"../utils/helpers/guid/index.js";import w from"../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js";import"../../style/utils/filter-styled-system-padding-props.js";import P from"../../style/utils/filter-styled-system-margin-props.js";function x(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}function D(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable})))),n.forEach((function(r){x(e,r,i[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 i=Object.getOwnPropertySymbols(e);r.push.apply(r,i)}return r}(Object(r)).forEach((function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})),e}const S=x=>{var{legend:S,children:H,inline:I=!1,legendWidth:_,legendAlign:k,legendSpacing:A=2,error:R,warning:q,info:B,isRequired:E,blockGroupBehaviour:L,legendMargin:F={},isDisabled:G,labelHelp:T,fieldHelp:z,inputHint:N,validationMessagePositionTop:V,applyNewValidation:W=!1,id:C,size:$}=x,J=function(e,r){if(null==e)return{};var i,n,t=function(e,r){if(null==e)return{};var i,n,t={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],r.indexOf(i)>=0||(t[i]=e[i]);return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],r.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}(x,["legend","children","inline","legendWidth","legendAlign","legendSpacing","error","warning","info","isRequired","blockGroupBehaviour","legendMargin","isDisabled","labelHelp","fieldHelp","inputHint","validationMessagePositionTop","applyNewValidation","id","size"]);const{validationRedesignOptIn:K}=n(c),Q=P(J),[U,X]=t(null),[Y,Z]=t(!1),ee=o(O()),re=C||ee.current,ie=N?`${re}-hint`:void 0;l((()=>{U&&E&&Array.from(U.querySelectorAll("input")||[]).forEach((e=>{e.setAttribute("required","")}))}),[U,E]);let ne;ne=I&&!k?"right":k||"left";const{validationId:te,fieldHelpId:oe,ariaDescribedBy:le}=w({id:re,validationRedesignOptIn:!0,error:R,warning:q,info:B,fieldHelp:z}),ae=(V?[le,ie]:[ie,le]).filter(Boolean).join(" "),se=()=>R||q?e(i,{children:[r(h,{error:R,warning:q,validationId:te,validationMessagePositionTop:V,isLarge:"large"===$}),r(y,{warning:!(R||!q)})]}):null;return W?e(a,M(D({ref:X,"data-component":"fieldset",id:re,"aria-describedby":ae||void 0},J,Q),{children:[S&&r(s,{align:ne,isRequired:E,isDisabled:G,"data-element":"legend","data-role":"legend",isLarge:"large"===$,children:S}),N&&r(j,{id:ie,isDisabled:G,align:ne,isLarge:"large"===$,children:N}),e(b,{position:"relative",mt:1,children:[V&&se(),H,!V&&se()]})]})):r(u,{blockGroupBehaviour:L,children:e(a,M(D({ref:X,"data-component":"fieldset",id:re,"aria-describedby":le||void 0},J,Q),{children:[S&&r(m.Consumer,{children:({onMouseEnter:i,onMouseLeave:n})=>e(s,M(D({onMouseEnter:i,onMouseLeave:n,inline:I,width:_,align:ne,rightPadding:A},F),{"data-element":"legend","data-role":"legend",isRequired:E,isDisabled:G,children:[S,!K&&(R||q||B?r(d,{"aria-hidden":"true",children:r(p,{error:R,warning:q,info:B,tooltipFlipOverrides:["top","bottom"]})}):T?r(d,M(D({},{onFocus:()=>Z(!0),onBlur:()=>Z(!1)}),{children:r(f,{isFocused:Y,children:T})})):null)]}))}),!K&&r(g,{screenReaderOnly:!0,id:te,children:R||q||B}),e(b,{display:"flex",flexDirection:"column",mt:I?0:1,children:[H,z&&r(v,{id:oe,children:z})]})]}))})};export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./fieldset-validation-context";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default}from"./fieldset-validation-context.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
3
|
import { ValidationProps } from "../validations";
|
|
4
|
-
import { LabelProps } from "../label";
|
|
4
|
+
import { LabelProps } from "../legacy-label";
|
|
5
5
|
import { TagProps } from "../utils/helpers/tags/tags";
|
|
6
6
|
import { IconType } from "../../components/icon";
|
|
7
7
|
interface CommonFormFieldProps extends MarginProps, ValidationProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as n,useContext as r,useRef as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as n,useContext as r,useRef as l,useLayoutEffect as i,useEffect as o}from"react";import a from"invariant";import s,{FieldLineStyle as d}from"./form-field.style.js";import p from"../legacy-label/label.component.js";import{FieldHelp as c}from"../field-help/field-help.component.js";import b from"../utils/helpers/tags/tags.js";import f from"../../hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js";import"../../style/utils/filter-styled-system-padding-props.js";import u from"../../style/utils/filter-styled-system-margin-props.js";import{TabsContext as m}from"../../components/tabs/__next__/tabs.context.js";import{TabContext as y}from"../../components/tabs/__next__/tab.context.js";function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g=g=>{var{maxWidth:I,children:j,"data-component":h,disabled:v,loading:w,fieldHelp:P,fieldHelpInline:_,error:x,warning:H,info:k,tooltipId:S,fieldHelpId:W,label:A,labelId:R,labelAlign:q,labelHelp:B,labelHelpIcon:D,labelInline:E,labelSpacing:F=2,labelWidth:V,labelAs:L,id:N,reverse:U,useValidationIcon:$,adaptiveLabelBreakpoint:z,isRequired:C,validationIconId:G,validationRedesignOptIn:J}=g,K=function(e,t){if(null==e)return{};var n,r,l=function(e,t){if(null==e)return{};var n,r,l={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}(g,["maxWidth","children","data-component","disabled","loading","fieldHelp","fieldHelpInline","error","warning","info","tooltipId","fieldHelpId","label","labelId","labelAlign","labelHelp","labelHelpIcon","labelInline","labelSpacing","labelWidth","labelAs","id","reverse","useValidationIcon","adaptiveLabelBreakpoint","isRequired","validationIconId","validationRedesignOptIn"]);const M=n((()=>{const e={error:!!x,warning:!!H,info:!!k};if(v&&!w)return Object.keys(e).find((t=>e[t]))}),[x,H,k,v,w]);a(void 0===M,`Prop \`${M}\` cannot be used in conjunction with \`disabled\`. Use \`readOnly\` if you require users to see validations with a non-interactive field`);const Q=f(z);let T=E;z&&(T=Q);const{setErrors:X,setWarnings:Y,setInfos:Z}=r(m),{tabId:ee}=r(y),te=u(K),ne=l(!1);i((()=>(ne.current=!0,()=>{ne.current=!1})),[]),o((()=>(X&&X(N,ee||"",x||!1),Y&&Y(N,ee||"",H||!1),Z&&Z(N,ee||"",k||!1),()=>{ne.current||(X&&X(N,ee||"",!1),Y&&Y(N,ee||"",!1),Z&&Z(N,ee||"",!1))})),[N,X,Y,x,H,k,ee,Z]);const re=P?t(c,{labelInline:T,labelWidth:V,id:W,children:P}):null;return e(s,(le=function(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){O(e,t,n[t])}))}return e}({},b(h,K),te),ie=null!=(ie={children:[e(d,{"data-role":"field-line",inline:T,maxWidth:I,children:[U&&j,A&&t(p,{labelId:R,align:q,disabled:v,error:!J&&x,warning:!J&&H,info:!J&&k,help:B,tooltipId:S,htmlFor:N,helpIcon:D,inline:T,width:V,useValidationIcon:$,pr:U?void 0:F,pl:U?F:void 0,isRequired:C,validationIconId:G,as:L,children:A}),_&&re,!U&&j]}),!_&&re]})?ie:{},Object.getOwnPropertyDescriptors?Object.defineProperties(le,Object.getOwnPropertyDescriptors(ie)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(ie)).forEach((function(e){Object.defineProperty(le,e,Object.getOwnPropertyDescriptor(ie,e))})),le));var le,ie};g.displayName="FormField";export{g as default};
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface HintTextProps {
|
|
3
|
-
/**
|
|
4
|
-
align?: "left" | "right";
|
|
5
|
-
/** Children elements */
|
|
3
|
+
/** Child elements */
|
|
6
4
|
children?: React.ReactNode;
|
|
7
|
-
/** Sets the
|
|
8
|
-
fontWeight?: string;
|
|
9
|
-
/** Sets the id for the component. */
|
|
5
|
+
/** Sets the id for the component */
|
|
10
6
|
id?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
isDarkBackground?: boolean;
|
|
15
|
-
/** Indicates whether the parent component is disabled. */
|
|
16
|
-
isDisabled?: boolean;
|
|
17
|
-
/** Margin bottom for the hint text */
|
|
18
|
-
marginBottom?: string;
|
|
19
|
-
/** Margin top for the hint text */
|
|
20
|
-
marginTop?: string;
|
|
21
|
-
/** Max width for the hint text */
|
|
22
|
-
maxWidth?: string;
|
|
23
|
-
/** Set large font-size */
|
|
24
|
-
isLarge?: boolean;
|
|
7
|
+
size: "small" | "medium" | "large";
|
|
8
|
+
/** If true, the hint text will display in disabled styling */
|
|
9
|
+
disabled?: boolean;
|
|
25
10
|
}
|
|
26
|
-
export declare const HintText: ({
|
|
11
|
+
export declare const HintText: ({ children, id, size, disabled }: HintTextProps) => React.JSX.Element;
|
|
27
12
|
export default HintText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import"react";import e from"./hint-text.style.js";const i=({children:i,id:r,size:d,disabled:a})=>t(e,{"data-element":"input-hint","data-role":"hint-text",id:r,$size:d,$disabled:a,children:i});export{i as HintText,i as default};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface StyledHintTextProps {
|
|
2
|
+
$size: "small" | "medium" | "large";
|
|
3
|
+
$disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const StyledHintText: import("styled-components").StyledComponent<"span", any, StyledHintTextProps, never>;
|
|
3
6
|
export default StyledHintText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t
|
|
1
|
+
import t from"styled-components";const a=t.span.withConfig({displayName:"hint-text.style__StyledHintText",componentId:"sc-8ce52069-0"})(["color:",";font:",";"],(({$disabled:t})=>t?"var(--input-labelset-label-disabled)":"var(--input-labelset-label-alt)"),(({$size:t})=>(t=>{switch(t){case"small":return"var(--global-font-static-comp-regular-s)";case"large":return"var(--global-font-static-comp-regular-l)";default:return"var(--global-font-static-comp-regular-m)"}})(t)));export{a as default};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type { InputProps, CommonInputProps, EnterKeyHintTypes, } from "./input.component";
|
|
4
|
-
export { Input, InputPresentation };
|
|
5
|
-
export default Input;
|
|
1
|
+
export { default } from "./input.component";
|
|
2
|
+
export type { InputProps } from "./input.component";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default}from"./input.component.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overrides for input when part of Date component
|
|
3
|
+
*/
|
|
4
|
+
export declare const dateStyleOverrides: import("styled-components").FlattenSimpleInterpolation;
|
|
5
|
+
export declare const searchStyleOverrides: import("styled-components").FlattenSimpleInterpolation;
|
|
6
|
+
export declare const selectStyleOverrides: ($size?: string, $isDisabled?: boolean, $isReadOnly?: boolean) => import("styled-components").FlattenSimpleInterpolation;
|
|
7
|
+
export declare const pagerStyleOverrides: import("styled-components").FlattenSimpleInterpolation;
|
|
8
|
+
export declare const numeralDateStyles: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css as t}from"styled-components";const a=t([".date &{.input-text-container input{padding:0 0 0 12px;margin-right:-12px;}}"]),n=t([".search &{height:40px;box-sizing:border-box;.input-text-container{flex-wrap:wrap;}input{width:30px;}}"]),e=t([".search:not(.with-button):not(.has-value) &:not(:focus-within){border-color:transparent;background:transparent;}"]),o=t([".search.with-button &{border-top-right-radius:0;border-bottom-right-radius:0;}"]),r=t([".search.dark-background &{input{::-moz-placeholder{color:var(--colorsUtilityYang080);opacity:1;}::placeholder{color:var(--colorsUtilityYang080);}}}"]),i=t([".search.dark-background:not(.with-button) &{input{color:var(--input-typical-inverse-txt-default);}}.search.dark-background.has-value:not(.with-button) &{.input-text-container,input{color:var(--colorsUtilityYang080);}.input-text-container:hover{input{color:var(--colorsUtilityYang100);}}}"]),p=t([".search.dark-background.with-button:not(.has-value) &{input{color:var(--colorsUtilityYang100);}}"]),l=t([".search.dark-background:not(.with-button) &{background-color:transparent;border-color:var(--colorsUtilityYang080);}"]),c=t([""," "," "," "," "," "," ",""],n,e,o,r,i,p,l),s=t(['[data-role="select-textbox"] &[data-is-transparent="false"]{.input-text-container{position:relative;.select-text:not(.disabled):not(.read-only){position:absolute;top:0;left:0;width:calc(100% - 48px);height:100%;padding:var(--global-space-none) var(--global-space-none) var(--global-space-none) var(--global-space-comp-m);cursor:pointer;}}}']),d=t([".multi-select &,.filterable-select &{.input-text-container:not(.disabled):not(.read-only){cursor:text;input{cursor:text;}}}"]),g=t(['[data-element="simple-select-input"] &{input{opacity:0;}input{cursor:pointer;}}']),u=(a,n,e)=>t([""," "," "," "," ",""],g,((a,n)=>t(['&[data-is-transparent="true"]{&&&{background:transparent;border:none;}'," input{text-align:right;position:absolute;padding:var(--global-space-none);&::placeholder{color:var(--colorsUtilityYin100);}}}"],!a&&!n&&t(["cursor:pointer;*{cursor:pointer;}"])))(n,e),s,d,(a=>t([".multi-select &{input{padding:var(--global-space-none);width:30px;}.input-text-container{"," "," ","}}"],"small"===a&&t(["padding:var(--global-space-none) var(--global-space-comp-2-xl) var(--global-space-none) var(--global-space-comp-s);"]),"medium"===a&&t(["padding:var(--global-space-none) 40px var(--global-space-none) var(--global-space-comp-m);"]),"large"===a&&t(["padding:var(--global-space-none) 48px var(--global-space-none) var(--global-space-comp-l);"])))(a)),h=t([".pager-navigation &{margin:4px 8px;height:26px;min-height:unset;.input-text-container{padding:0px;line-height:26px;min-height:24px;input{text-align:center;padding:0;}}}"]),b=t(["&&&{.pager-size-options &{min-height:unset;.input-text-container{width:64px;height:26px;min-height:26px;min-width:10px;margin:0px;.select-text:not(.disabled):not(.read-only){width:calc(100% - 28px);}}}}"]),x=t([""," ",""],h,b),v=t([".numeral-date-wrapper &{.input-text-container input{text-align:center;}}"]);export{a as dateStyleOverrides,v as numeralDateStyles,x as pagerStyleOverrides,c as searchStyleOverrides,u as selectStyleOverrides};
|
|
@@ -1,54 +1,45 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
export type EnterKeyHintTypes = "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
|
|
4
|
-
export interface CommonInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "value"> {
|
|
5
|
-
align?: "right" | "left";
|
|
2
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "size"> {
|
|
6
3
|
/** The ID of the input's description, is set along with hint text and error message. */
|
|
7
4
|
"aria-describedby"?: string;
|
|
8
|
-
/** Override the variant component */
|
|
9
|
-
as?: React.ElementType;
|
|
10
|
-
/** If true the Component will be focused when rendered */
|
|
11
|
-
autoFocus?: boolean;
|
|
12
5
|
/** If true, the component will be disabled */
|
|
13
6
|
disabled?: boolean;
|
|
14
7
|
/** HTML id attribute of the input */
|
|
15
8
|
id?: string;
|
|
16
|
-
/** Specify a custom border radius for the input. Any valid border-radius design token, or an array of border-radius design tokens. */
|
|
17
|
-
inputBorderRadius?: BorderRadiusType | BorderRadiusType[];
|
|
18
9
|
/** Name of the input */
|
|
19
10
|
name?: string;
|
|
20
11
|
/** Specify a callback triggered on blur */
|
|
21
12
|
onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
|
|
22
13
|
/** Specify a callback triggered on change */
|
|
23
|
-
onChange
|
|
24
|
-
/** Specify a callback triggered on click */
|
|
25
|
-
onClick?: (ev: React.MouseEvent<HTMLInputElement>) => void;
|
|
14
|
+
onChange: (ev: React.ChangeEvent<HTMLInputElement>) => void;
|
|
26
15
|
/** Specify a callback triggered on focus */
|
|
27
16
|
onFocus?: (ev: React.FocusEvent<HTMLInputElement>) => void;
|
|
28
|
-
/** Specify a callback triggered on keyDown */
|
|
29
|
-
onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
30
17
|
/** Placeholder string to be displayed in input */
|
|
31
18
|
placeholder?: string;
|
|
32
19
|
/** If true, the component will be read-only */
|
|
33
20
|
readOnly?: boolean;
|
|
34
21
|
/** Flag to configure component as mandatory */
|
|
35
22
|
required?: boolean;
|
|
36
|
-
/** Id of the validation icon */
|
|
37
|
-
validationIconId?: string;
|
|
38
23
|
/** The value of the input */
|
|
39
|
-
value: string | readonly string[] | number
|
|
24
|
+
value: string | readonly string[] | number;
|
|
25
|
+
/** If true, the input will display error styling */
|
|
26
|
+
error?: boolean;
|
|
27
|
+
/** The width of the input as a percentage (e.g., 50 for 50%) */
|
|
28
|
+
inputWidth?: number;
|
|
29
|
+
/** Type of the icon that will be rendered next to the input */
|
|
30
|
+
inputIcon?: React.ReactNode;
|
|
31
|
+
/** Size of the input */
|
|
32
|
+
size?: "small" | "medium" | "large";
|
|
33
|
+
/** Emphasised text to be displayed before the input */
|
|
34
|
+
prefix?: string;
|
|
35
|
+
/** Additional children to be rendered before the input */
|
|
36
|
+
leftChildren?: React.ReactNode;
|
|
37
|
+
/** Text alignment within the input */
|
|
38
|
+
align?: "left" | "right";
|
|
39
|
+
/**
|
|
40
|
+
* @private @internal @ignore
|
|
41
|
+
*/
|
|
42
|
+
"data-is-transparent"?: boolean;
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
/** The visible width of the text control, in average character widths */
|
|
43
|
-
cols?: number;
|
|
44
|
-
/** Integer to determine a timeout for the deferred callback */
|
|
45
|
-
deferTimeout?: number;
|
|
46
|
-
/** Deferred callback to be called after the onChange event */
|
|
47
|
-
onChangeDeferred?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
|
|
48
|
-
/** The number of visible text lines for the control */
|
|
49
|
-
rows?: number;
|
|
50
|
-
/** HTML type attribute of the input */
|
|
51
|
-
type?: string;
|
|
52
|
-
}
|
|
53
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
44
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
54
45
|
export default Input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{useRef as n,useEffect as i,useCallback as a}from"react";import o from"./input.style.js";import l from"../utils/helpers/combine-refs/index.js";function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(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){c(e,t,r[t])}))}return e}const d=r.forwardRef(((r,c)=>{var{align:d="left","aria-describedby":s,"aria-labelledby":p,autoFocus:f,error:b,"data-is-transparent":y,children:m,disabled:O,id:h,inputIcon:v,inputWidth:x,leftChildren:g,name:j,onFocus:$,prefix:w,readOnly:P,size:S,type:F="text"}=r,E=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,["align","aria-describedby","aria-labelledby","autoFocus","error","data-is-transparent","children","disabled","id","inputIcon","inputWidth","leftChildren","name","onFocus","prefix","readOnly","size","type"]);const z=n(null),I=l(c,z),R=w?`${h}-prefix`:void 0;i((()=>{var e;f&&(null===(e=z.current)||void 0===e||e.focus())}),[f]);const k=a((e=>{var t;null==$||$(e),"text"===F&&(t=z,setTimeout((()=>{if(null==t?void 0:t.current){const{selectionStart:e,selectionEnd:r,value:n}=t.current,{length:i}=n;(0===e&&0===r||e===i&&r===i)&&document.activeElement===t.current&&t.current.setSelectionRange(0,i)}})))}),[$,F]),C=R?`${R} ${p||""}`.trim():p;return e(o,{$align:d,"data-role":"input-container",$error:b,$size:S,$isDisabled:O,$isReadOnly:P,"data-is-transparent":y,children:[e("div",{"data-role":"input-text-container",role:"presentation",className:`input-text-container ${O?"disabled":""} ${P?"read-only":""}`,children:[g,w&&t("span",{id:R,"data-element":"textbox-prefix",children:w}),t("input",u({ref:I,"data-element":"input","data-role":"input",disabled:O,readOnly:P,"aria-describedby":s,"aria-labelledby":C,type:F,onFocus:k,id:h,name:j,"data-has-autofocus":!!f||void 0},E)),v]}),m]})}));export{d as default};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface InputContainerProps {
|
|
2
|
+
$align?: "left" | "right";
|
|
3
|
+
$error?: boolean;
|
|
4
|
+
$isDisabled?: boolean;
|
|
5
|
+
$isReadOnly?: boolean;
|
|
6
|
+
$size?: "small" | "medium" | "large";
|
|
7
|
+
}
|
|
8
|
+
declare const InputContainer: import("styled-components").StyledComponent<"div", any, InputContainerProps, never>;
|
|
9
|
+
export default InputContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a,{css as l}from"styled-components";import t from"../../style/utils/add-focus-styling.js";import{dateStyleOverrides as r,searchStyleOverrides as e,selectStyleOverrides as o,pagerStyleOverrides as i,numeralDateStyles as n}from"./input-style-overrides.style.js";const s=a.div.withConfig({displayName:"input.style__InputContainer",componentId:"sc-c3a17c62-0"})([""," "," "," "," "," ",""],(({$align:a,$error:r,$isDisabled:e,$isReadOnly:o,$size:i})=>l(["display:flex;align-items:center;align-self:stretch;max-width:100%;border-radius:var(--global-radius-action-m);"," "," "," &&&{"," ","}"," "," .input-text-container{display:flex;flex-wrap:wrap;align-items:center;flex:1 0 0;max-width:100%;align-self:stretch;input{align-self:stretch;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;flex:1 0 0;min-width:0;overflow:hidden;border:none;outline:none;background:transparent;text-overflow:ellipsis;text-align:",";"," "," "," "," "," ",'}[data-element="textbox-prefix"]{font-weight:500;margin-left:var(--global-space-comp-m);}}'],"small"===i&&l(["min-height:var(--global-size-s);"]),"medium"===i&&l(["min-height:var(--global-size-m);"]),"large"===i&&l(["min-height:var(--global-size-l);"]),o&&l(["cursor:default;*{cursor:default;}background:var(--input-typical-bg-read-only);border:var(--global-borderwidth-xs) solid var(--input-typical-border-read-only);&:focus-within:has(:focus:not(button)){"," z-index:2;}"],t()),e&&l(["cursor:not-allowed;background:var(--input-typical-bg-disabled);border:var(--global-borderwidth-xs) solid var(--input-typical-border-disabled);*{cursor:not-allowed;}"]),!e&&!o&&l(["cursor:text;&:focus-within:has(:focus:not(button)){"," z-index:2;}"],t()),!e&&!o&&l(["background:var(--input-typical-bg-default);border:",";"],r?"var(--global-borderwidth-s) solid var(--input-validation-border-error)":"var(--global-borderwidth-xs) solid var(--input-typical-border-default)"),a,o&&l(["color:var(--input-typical-txt-read-only);"]),e&&l(["color:var(--input-typical-txt-disabled);"]),!o&&!e&&l(["color:var(--input-typical-txt-default);"]),"small"===i&&l(["font:var(--global-font-static-comp-regular-s);padding:var(--global-space-none) var(--global-space-comp-s);"]),"medium"===i&&l(["font:var(--global-font-static-comp-regular-m);padding:var(--global-space-none) var(--global-space-comp-m);"]),"large"===i&&l(["font:var(--global-font-static-comp-regular-l);padding:var(--global-space-none) var(--global-space-comp-l);"]))),r,e,(({$size:a,$isDisabled:l,$isReadOnly:t})=>o(a,l,t)),i,n);export{s as default};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IconType } from "../../components/icon";
|
|
3
|
-
import { InputIconToggleStyleProps } from "./input-icon-toggle.style";
|
|
4
3
|
import { ValidationProps } from "../validations/validation-icon.component";
|
|
5
|
-
export interface InputIconToggleProps extends
|
|
4
|
+
export interface InputIconToggleProps extends ValidationProps {
|
|
6
5
|
align?: "left" | "right";
|
|
7
6
|
disabled?: boolean;
|
|
8
7
|
iconTabIndex?: number;
|
|
@@ -14,6 +13,13 @@ export interface InputIconToggleProps extends InputIconToggleStyleProps, Validat
|
|
|
14
13
|
useValidationIcon?: boolean;
|
|
15
14
|
/** Id of the validation icon */
|
|
16
15
|
validationIconId?: string;
|
|
16
|
+
onClick?: (event: React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent<HTMLSpanElement>) => void;
|
|
17
|
+
size?: "small" | "medium" | "large";
|
|
18
|
+
/**
|
|
19
|
+
* @private @ignore @internal
|
|
20
|
+
* Whether to apply focus styling to input icon
|
|
21
|
+
* */
|
|
22
|
+
blockFocusStyling?: boolean;
|
|
17
23
|
}
|
|
18
|
-
declare const InputIconToggle: ({ disabled, readOnly, size, inputIcon: type, onClick, onFocus, onBlur, onMouseDown, error, warning, info, useValidationIcon, align, iconTabIndex, validationIconId, }: InputIconToggleProps) => React.JSX.Element | null;
|
|
24
|
+
declare const InputIconToggle: ({ disabled, readOnly, size, inputIcon: type, onClick, onFocus, onBlur, onMouseDown, error, warning, info, useValidationIcon, align, iconTabIndex, validationIconId, blockFocusStyling, }: InputIconToggleProps) => React.JSX.Element | null;
|
|
19
25
|
export default InputIconToggle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import"react";import
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import i from"../../components/icon/icon.component.js";import t from"./input-icon-toggle.style.js";import{ValidationIcon as e}from"../validations/validation-icon.component.js";const r=({disabled:r,readOnly:l,size:a,inputIcon:c,onClick:s,onFocus:d,onBlur:u,onMouseDown:p,error:g,warning:f,info:m,useValidationIcon:y,align:I,iconTabIndex:b,validationIconId:k,blockFocusStyling:w})=>{const v=n((o=>{if(" "===o.key||"Enter"===o.key)return o.preventDefault(),null==s?void 0:s(o)}),[s]);return y&&!r&&(({error:o,warning:n,info:i})=>"string"==typeof(o||n||i||null))({error:g,warning:f,info:m})?o(t,{$size:a,children:o(e,{error:g,warning:f,info:m,size:a,onClick:s,onFocus:d,onBlur:u,isPartOfInput:!0,tabIndex:b,tooltipId:k,tooltipPosition:"right"===I?"left":"right"})}):c?o(t,{$size:a,onClick:s,onFocus:d,onBlur:u,onMouseDown:p,onKeyDown:s&&v,"data-element":"input-icon-toggle",$disabled:r,$readOnly:l,"data-role":"input-icon-toggle","aria-hidden":"true",tabIndex:w?void 0:-1,$blockFocusStyling:w,children:o(i,{disabled:r||l,type:c})}):null};export{r as default};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { ValidationProps } from "../validations";
|
|
2
|
-
|
|
3
|
-
size?: "small" | "medium" | "large";
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
readOnly?: boolean;
|
|
6
|
-
|
|
2
|
+
interface InputIconToggleStyleProps extends ValidationProps {
|
|
3
|
+
$size?: "small" | "medium" | "large";
|
|
4
|
+
$disabled?: boolean;
|
|
5
|
+
$readOnly?: boolean;
|
|
6
|
+
$blockFocusStyling?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare const InputIconToggleStyle: import("styled-components").StyledComponent<"span", any, {
|
|
9
|
-
onKeyDown: (event: React.KeyboardEvent<HTMLSpanElement>) => void | import("react").KeyboardEvent<HTMLSpanElement>;
|
|
10
|
-
} & InputIconToggleStyleProps & {
|
|
8
|
+
declare const InputIconToggleStyle: import("styled-components").StyledComponent<"span", any, InputIconToggleStyleProps & {
|
|
11
9
|
tabIndex?: number;
|
|
12
|
-
},
|
|
10
|
+
}, never>;
|
|
13
11
|
export default InputIconToggleStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{css as t}from"styled-components";import s from"../legacy-input/input-sizes.style.js";import i from"../../style/utils/add-focus-styling.js";const l=e.span.withConfig({displayName:"input-icon-toggle.style__InputIconToggleStyle",componentId:"sc-d77c1680-0"})(["align-items:center;cursor:pointer;display:flex;justify-content:center;align-self:stretch;"," "," "," "," .pager-size-options &{margin-left:0;width:20px;height:24px;align-self:center;}.multi-select &,.filterable-select &{cursor:pointer;}"],(({$size:e="medium"})=>t(["width:",";"],s[e].height)),(({$disabled:e})=>e&&t(["cursor:not-allowed;"])),(({$readOnly:e})=>e&&t(["cursor:default;"])),(({$blockFocusStyling:e})=>!e&&t(["&:focus{","}"],i())));export{l as default};
|
|
@@ -1,37 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { ValidationProps } from "../validations";
|
|
4
|
-
import { IconType } from "../../components/icon";
|
|
5
|
-
export interface LabelProps extends ValidationProps, StyledLabelProps, StyledLabelContainerProps {
|
|
6
|
-
as?: "span" | "label";
|
|
2
|
+
export interface LabelProps {
|
|
7
3
|
/** Children elements */
|
|
8
4
|
children?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
help?: React.ReactNode;
|
|
11
|
-
/** Icon type */
|
|
12
|
-
helpIcon?: IconType;
|
|
13
|
-
/** A string that represents the ID of another form element */
|
|
5
|
+
/** HTML for attribute to associate label with input */
|
|
14
6
|
htmlFor?: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
* @internal
|
|
26
|
-
* Sets className for component. INTERNAL USE ONLY. */
|
|
27
|
-
className?: string;
|
|
28
|
-
/** Sets aria-label for label element */
|
|
29
|
-
"aria-label"?: string;
|
|
30
|
-
/** Whether this component is shown against a dark background */
|
|
31
|
-
isDarkBackground?: boolean;
|
|
32
|
-
/** @internal @private */
|
|
33
|
-
onClick?: () => void;
|
|
7
|
+
/** Sets the id for the component */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** If true, uses large font size */
|
|
10
|
+
size: "small" | "medium" | "large";
|
|
11
|
+
/** If true, displays a required indicator (*) */
|
|
12
|
+
isRequired?: boolean;
|
|
13
|
+
/** If true, the label will display in disabled styling */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** If true, the label will display in read-only styling */
|
|
16
|
+
readOnly?: boolean;
|
|
34
17
|
}
|
|
35
|
-
export declare const Label: ({
|
|
36
|
-
declare const _default: React.MemoExoticComponent<({
|
|
18
|
+
export declare const Label: ({ children, id, htmlFor, size, isRequired, disabled, readOnly, }: LabelProps) => React.JSX.Element;
|
|
19
|
+
declare const _default: React.MemoExoticComponent<({ children, id, htmlFor, size, isRequired, disabled, readOnly, }: LabelProps) => React.JSX.Element>;
|
|
37
20
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import r from"react";import a from"./label.style.js";const l=({children:r,id:l,htmlFor:i,size:t,isRequired:d,disabled:m,readOnly:o})=>e(a,{id:l,htmlFor:i,$size:t,$isRequired:d,$disabled:m,$readOnly:o,"data-component":"label","data-element":"label",children:r});var i=r.memo(l);export{l as Label,i as default};
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Flag to determine whether to use colours for dark backgrounds */
|
|
7
|
-
isDarkBackground?: boolean;
|
|
8
|
-
/** Set large font-size */
|
|
9
|
-
isLarge?: boolean;
|
|
1
|
+
interface StyledLabelProps {
|
|
2
|
+
$size: "small" | "medium" | "large";
|
|
3
|
+
$isRequired?: boolean;
|
|
4
|
+
$disabled?: boolean;
|
|
5
|
+
$readOnly?: boolean;
|
|
10
6
|
}
|
|
11
7
|
declare const StyledLabel: import("styled-components").StyledComponent<"label", any, StyledLabelProps, never>;
|
|
12
|
-
export interface StyledLabelContainerProps {
|
|
13
|
-
/** Label alignment */
|
|
14
|
-
align?: "left" | "right";
|
|
15
|
-
/** When true, label is placed in line an input */
|
|
16
|
-
inline?: boolean;
|
|
17
|
-
/** Padding right, integer multiplied by base spacing constant (8) */
|
|
18
|
-
pr?: 1 | 2;
|
|
19
|
-
/** Padding left, integer multiplied by base spacing constant (8) */
|
|
20
|
-
pl?: 1 | 2;
|
|
21
|
-
/** Label width */
|
|
22
|
-
width?: number;
|
|
23
|
-
}
|
|
24
|
-
export declare const StyledLabelContainer: import("styled-components").StyledComponent<"div", any, StyledLabelContainerProps, never>;
|
|
25
8
|
export default StyledLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{css as l}from"styled-components";const a=e=>{switch(e){case"small":return"var(--global-font-static-comp-medium-s)";case"large":return"var(--global-font-static-comp-medium-l)";default:return"var(--global-font-static-comp-medium-m)"}},t=e.label.withConfig({displayName:"label.style__StyledLabel",componentId:"sc-bf6c67e5-0"})(["",";font:",";"," .numeral-date-wrapper &,.time &{font:var(--global-font-static-comp-regular-m);}"],(({$disabled:e,$readOnly:l})=>e?"\n cursor: not-allowed;\n color: var(--input-labelset-label-disabled);\n ":l?"\n cursor: pointer;\n color: var(--input-labelset-label-readOnly);\n ":"\n cursor: pointer;\n color: var(--input-labelset-label-default);\n "),(({$size:e})=>a(e)),(({$isRequired:e,$size:t,$disabled:r})=>e&&l(['display:inline-flex;align-items:center;::after{content:"*";color:',";font:",";margin-left:4px;}"],r?"var(--input-labelset-label-disabled)":"var(--input-labelset-label-required)",a(t))));export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o,{css as e}from"styled-components";const r=o.span.withConfig({displayName:"error-border.style__ErrorBorder",componentId:"sc-16eee200-0"})(["",""],(({warning:o})=>e(["position:absolute;z-index:6;width:2px;background-color:",";left:-12px;bottom:0px;top:0px;"],o?"var(--colorsSemanticCaution500)":"var(--colorsSemanticNegative500)")));export{r as default};
|