@salutejs/plasma-new-hope 0.167.0-canary.1459.11350127444.0 → 0.167.0-canary.1475.11350736392.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Autocomplete/Autocomplete.css +19 -34
- package/cjs/components/Autocomplete/Autocomplete.js +2 -6
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +18 -38
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +18 -38
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +18 -38
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +19 -34
- package/cjs/components/DatePicker/RangeDate/RangeDate.js +77 -15
- package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +18 -33
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +14 -7
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/variations/_size/base.js +1 -1
- package/cjs/components/DatePicker/RangeDate/variations/_size/base.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/variations/_size/base_1d0sbzw.css +1 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +20 -35
- package/cjs/components/DatePicker/SingleDate/SingleDate.js +33 -8
- package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
- package/cjs/components/DatePicker/hooks/useDatePicker.js +20 -48
- package/cjs/components/DatePicker/hooks/useDatePicker.js.map +1 -1
- package/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +11 -1
- package/cjs/components/DatePicker/hooks/useKeyboardNavigation.js.map +1 -1
- package/cjs/components/DatePicker/utils/dateHelper.js +31 -0
- package/cjs/components/DatePicker/utils/dateHelper.js.map +1 -1
- package/cjs/components/Range/Range.css +19 -39
- package/cjs/components/Slider/Slider.css +19 -39
- package/cjs/components/Slider/Slider.js +0 -2
- package/cjs/components/Slider/Slider.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.css +19 -39
- package/cjs/components/TextArea/TextArea.js +30 -110
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.styles.js +63 -160
- package/cjs/components/TextArea/TextArea.styles.js.map +1 -1
- package/cjs/components/TextArea/TextArea.styles_es0miz.css +11 -0
- package/cjs/components/TextArea/TextArea.tokens.js +4 -43
- package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
- package/cjs/components/TextArea/hooks/useAutoResize.js +4 -2
- package/cjs/components/TextArea/hooks/useAutoResize.js.map +1 -1
- package/cjs/components/TextArea/variations/_clear/base.js +1 -1
- package/cjs/components/TextArea/variations/_clear/base.js.map +1 -1
- package/cjs/components/TextArea/variations/_clear/base_vidplj.css +1 -0
- package/cjs/components/TextArea/variations/_view/base.js +1 -1
- package/cjs/components/TextArea/variations/_view/base.js.map +1 -1
- package/cjs/components/TextArea/variations/_view/base_td55th.css +1 -0
- package/cjs/components/TextField/TextField.js +9 -98
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.styles.js +23 -76
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/TextField.styles_1d2ryq.css +15 -0
- package/cjs/components/TextField/TextField.tokens.js +1 -40
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/variations/_clear/base.js +1 -1
- package/cjs/components/TextField/variations/_clear/base.js.map +1 -1
- package/cjs/components/TextField/variations/_clear/base_rit6gc.css +1 -0
- package/cjs/components/TextField/variations/_disabled/base.js +1 -1
- package/cjs/components/TextField/variations/_disabled/{base_4d3opa.css → base_2tv0nz.css} +1 -1
- package/cjs/components/TextField/variations/_label-placement/base.js +1 -1
- package/cjs/components/TextField/variations/_label-placement/base.js.map +1 -1
- package/cjs/components/TextField/variations/_label-placement/base_1ghihns.css +1 -0
- package/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/cjs/components/TextField/variations/_read-only/base.js.map +1 -1
- package/cjs/components/TextField/variations/_read-only/base_1n7tghz.css +1 -0
- package/cjs/components/TextField/variations/_size/base.js +1 -1
- package/cjs/components/TextField/variations/_size/base.js.map +1 -1
- package/cjs/components/TextField/variations/_size/base_1h8l0kj.css +1 -0
- package/cjs/components/TextField/variations/_view/base.js +1 -1
- package/cjs/components/TextField/variations/_view/base.js.map +1 -1
- package/cjs/components/TextField/variations/_view/base_1noe46b.css +1 -0
- package/cjs/components/TextFieldGroup/TextFieldGroup.css +1 -1
- package/cjs/components/TextFieldGroup/variations/_shape/base.js +1 -1
- package/cjs/components/TextFieldGroup/variations/_shape/base_1e0je21.css +1 -0
- package/cjs/index.css +35 -55
- package/emotion/cjs/components/Autocomplete/Autocomplete.js +2 -6
- package/emotion/cjs/components/DatePicker/RangeDate/RangeDate.js +77 -15
- package/emotion/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +14 -7
- package/emotion/cjs/components/DatePicker/RangeDate/variations/_size/base.js +1 -1
- package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +33 -8
- package/emotion/cjs/components/DatePicker/hooks/useDatePicker.js +20 -48
- package/emotion/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +11 -1
- package/emotion/cjs/components/DatePicker/utils/dateHelper.js +31 -1
- package/emotion/cjs/components/TextArea/TextArea.js +35 -113
- package/emotion/cjs/components/TextArea/TextArea.styles.js +41 -99
- package/emotion/cjs/components/TextArea/TextArea.template-doc.mdx +1 -6
- package/emotion/cjs/components/TextArea/TextArea.tokens.js +4 -43
- package/emotion/cjs/components/TextArea/hooks/useAutoResize.js +4 -2
- package/emotion/cjs/components/TextArea/variations/_clear/base.js +1 -1
- package/emotion/cjs/components/TextArea/variations/_view/base.js +1 -2
- package/emotion/cjs/components/TextField/TextField.js +12 -100
- package/emotion/cjs/components/TextField/TextField.styles.js +37 -84
- package/emotion/cjs/components/TextField/TextField.template-doc.mdx +1 -7
- package/emotion/cjs/components/TextField/TextField.tokens.js +1 -40
- package/emotion/cjs/components/TextField/variations/_clear/base.js +1 -1
- package/emotion/cjs/components/TextField/variations/_label-placement/base.js +1 -1
- package/emotion/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/emotion/cjs/components/TextField/variations/_size/base.js +1 -1
- package/emotion/cjs/components/TextField/variations/_view/base.js +1 -1
- package/emotion/cjs/components/_Icon/index.js +1 -8
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +10 -19
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +0 -70
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +13 -22
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +1 -71
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +10 -19
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +0 -70
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.config.js +13 -22
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -80
- package/emotion/es/components/Autocomplete/Autocomplete.js +2 -6
- package/emotion/es/components/DatePicker/RangeDate/RangeDate.js +79 -17
- package/emotion/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +14 -7
- package/emotion/es/components/DatePicker/RangeDate/variations/_size/base.js +1 -1
- package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +34 -9
- package/emotion/es/components/DatePicker/hooks/useDatePicker.js +21 -49
- package/emotion/es/components/DatePicker/hooks/useKeyboardNavigation.js +11 -1
- package/emotion/es/components/DatePicker/utils/dateHelper.js +30 -0
- package/emotion/es/components/TextArea/TextArea.js +36 -114
- package/emotion/es/components/TextArea/TextArea.styles.js +40 -98
- package/emotion/es/components/TextArea/TextArea.template-doc.mdx +1 -6
- package/emotion/es/components/TextArea/TextArea.tokens.js +4 -43
- package/emotion/es/components/TextArea/hooks/useAutoResize.js +4 -2
- package/emotion/es/components/TextArea/variations/_clear/base.js +2 -2
- package/emotion/es/components/TextArea/variations/_view/base.js +1 -2
- package/emotion/es/components/TextField/TextField.js +12 -100
- package/emotion/es/components/TextField/TextField.styles.js +36 -83
- package/emotion/es/components/TextField/TextField.template-doc.mdx +1 -7
- package/emotion/es/components/TextField/TextField.tokens.js +1 -40
- package/emotion/es/components/TextField/variations/_clear/base.js +2 -2
- package/emotion/es/components/TextField/variations/_label-placement/base.js +1 -1
- package/emotion/es/components/TextField/variations/_read-only/base.js +2 -2
- package/emotion/es/components/TextField/variations/_size/base.js +2 -2
- package/emotion/es/components/TextField/variations/_view/base.js +2 -2
- package/emotion/es/components/_Icon/index.js +1 -2
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +10 -19
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +0 -70
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.config.js +13 -22
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +1 -71
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.config.js +10 -19
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +0 -70
- package/emotion/es/examples/plasma_web/components/TextField/TextField.config.js +13 -22
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -80
- package/es/components/Autocomplete/Autocomplete.css +19 -34
- package/es/components/Autocomplete/Autocomplete.js +2 -6
- package/es/components/Autocomplete/Autocomplete.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +18 -38
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +18 -38
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +18 -38
- package/es/components/DatePicker/RangeDate/RangeDate.css +19 -34
- package/es/components/DatePicker/RangeDate/RangeDate.js +79 -17
- package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +18 -33
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +14 -7
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
- package/es/components/DatePicker/RangeDate/variations/_size/base.js +1 -1
- package/es/components/DatePicker/RangeDate/variations/_size/base.js.map +1 -1
- package/es/components/DatePicker/RangeDate/variations/_size/base_1d0sbzw.css +1 -0
- package/es/components/DatePicker/SingleDate/SingleDate.css +20 -35
- package/es/components/DatePicker/SingleDate/SingleDate.js +34 -9
- package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
- package/es/components/DatePicker/hooks/useDatePicker.js +21 -49
- package/es/components/DatePicker/hooks/useDatePicker.js.map +1 -1
- package/es/components/DatePicker/hooks/useKeyboardNavigation.js +11 -1
- package/es/components/DatePicker/hooks/useKeyboardNavigation.js.map +1 -1
- package/es/components/DatePicker/utils/dateHelper.js +31 -1
- package/es/components/DatePicker/utils/dateHelper.js.map +1 -1
- package/es/components/Range/Range.css +19 -39
- package/es/components/Slider/Slider.css +19 -39
- package/es/components/Slider/Slider.js +0 -2
- package/es/components/Slider/Slider.js.map +1 -1
- package/es/components/Slider/components/Double/Double.css +19 -39
- package/es/components/TextArea/TextArea.js +34 -114
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.styles.js +64 -155
- package/es/components/TextArea/TextArea.styles.js.map +1 -1
- package/es/components/TextArea/TextArea.styles_es0miz.css +11 -0
- package/es/components/TextArea/TextArea.tokens.js +4 -43
- package/es/components/TextArea/TextArea.tokens.js.map +1 -1
- package/es/components/TextArea/hooks/useAutoResize.js +4 -2
- package/es/components/TextArea/hooks/useAutoResize.js.map +1 -1
- package/es/components/TextArea/variations/_clear/base.js +1 -1
- package/es/components/TextArea/variations/_clear/base.js.map +1 -1
- package/es/components/TextArea/variations/_clear/base_vidplj.css +1 -0
- package/es/components/TextArea/variations/_view/base.js +1 -1
- package/es/components/TextArea/variations/_view/base.js.map +1 -1
- package/es/components/TextArea/variations/_view/base_td55th.css +1 -0
- package/es/components/TextField/TextField.js +11 -100
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.styles.js +24 -71
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/TextField.styles_1d2ryq.css +15 -0
- package/es/components/TextField/TextField.tokens.js +1 -40
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/variations/_clear/base.js +1 -1
- package/es/components/TextField/variations/_clear/base.js.map +1 -1
- package/es/components/TextField/variations/_clear/base_rit6gc.css +1 -0
- package/es/components/TextField/variations/_disabled/base.js +1 -1
- package/es/components/TextField/variations/_disabled/{base_4d3opa.css → base_2tv0nz.css} +1 -1
- package/es/components/TextField/variations/_label-placement/base.js +1 -1
- package/es/components/TextField/variations/_label-placement/base.js.map +1 -1
- package/es/components/TextField/variations/_label-placement/base_1ghihns.css +1 -0
- package/es/components/TextField/variations/_read-only/base.js +1 -1
- package/es/components/TextField/variations/_read-only/base.js.map +1 -1
- package/es/components/TextField/variations/_read-only/base_1n7tghz.css +1 -0
- package/es/components/TextField/variations/_size/base.js +1 -1
- package/es/components/TextField/variations/_size/base.js.map +1 -1
- package/es/components/TextField/variations/_size/base_1h8l0kj.css +1 -0
- package/es/components/TextField/variations/_view/base.js +1 -1
- package/es/components/TextField/variations/_view/base.js.map +1 -1
- package/es/components/TextField/variations/_view/base_1noe46b.css +1 -0
- package/es/components/TextFieldGroup/TextFieldGroup.css +1 -1
- package/es/components/TextFieldGroup/variations/_shape/base.js +1 -1
- package/es/components/TextFieldGroup/variations/_shape/base_1e0je21.css +1 -0
- package/es/index.css +35 -55
- package/package.json +2 -2
- package/styled-components/cjs/components/Autocomplete/Autocomplete.js +2 -6
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +77 -15
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +14 -7
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_size/base.js +1 -1
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +33 -8
- package/styled-components/cjs/components/DatePicker/hooks/useDatePicker.js +20 -48
- package/styled-components/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +11 -1
- package/styled-components/cjs/components/DatePicker/utils/dateHelper.js +31 -1
- package/styled-components/cjs/components/TextArea/TextArea.js +34 -112
- package/styled-components/cjs/components/TextArea/TextArea.styles.js +42 -85
- package/styled-components/cjs/components/TextArea/TextArea.template-doc.mdx +1 -6
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +4 -43
- package/styled-components/cjs/components/TextArea/hooks/useAutoResize.js +4 -2
- package/styled-components/cjs/components/TextArea/variations/_clear/base.js +1 -1
- package/styled-components/cjs/components/TextArea/variations/_view/base.js +1 -2
- package/styled-components/cjs/components/TextField/TextField.js +11 -99
- package/styled-components/cjs/components/TextField/TextField.styles.js +21 -46
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +1 -7
- package/styled-components/cjs/components/TextField/TextField.tokens.js +1 -40
- package/styled-components/cjs/components/TextField/variations/_clear/base.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_label-placement/base.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_view/base.js +1 -1
- package/styled-components/cjs/components/_Icon/index.js +1 -8
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +9 -18
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +0 -70
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +9 -18
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +1 -71
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +9 -18
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +0 -70
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +9 -18
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -80
- package/styled-components/es/components/Autocomplete/Autocomplete.js +2 -6
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +79 -17
- package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +14 -7
- package/styled-components/es/components/DatePicker/RangeDate/variations/_size/base.js +1 -1
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +34 -9
- package/styled-components/es/components/DatePicker/hooks/useDatePicker.js +21 -49
- package/styled-components/es/components/DatePicker/hooks/useKeyboardNavigation.js +11 -1
- package/styled-components/es/components/DatePicker/utils/dateHelper.js +30 -0
- package/styled-components/es/components/TextArea/TextArea.js +35 -113
- package/styled-components/es/components/TextArea/TextArea.styles.js +41 -84
- package/styled-components/es/components/TextArea/TextArea.template-doc.mdx +1 -6
- package/styled-components/es/components/TextArea/TextArea.tokens.js +4 -43
- package/styled-components/es/components/TextArea/hooks/useAutoResize.js +4 -2
- package/styled-components/es/components/TextArea/variations/_clear/base.js +2 -2
- package/styled-components/es/components/TextArea/variations/_view/base.js +1 -2
- package/styled-components/es/components/TextField/TextField.js +11 -99
- package/styled-components/es/components/TextField/TextField.styles.js +20 -45
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +1 -7
- package/styled-components/es/components/TextField/TextField.tokens.js +1 -40
- package/styled-components/es/components/TextField/variations/_clear/base.js +2 -2
- package/styled-components/es/components/TextField/variations/_label-placement/base.js +1 -1
- package/styled-components/es/components/TextField/variations/_read-only/base.js +2 -2
- package/styled-components/es/components/TextField/variations/_size/base.js +2 -2
- package/styled-components/es/components/TextField/variations/_view/base.js +2 -2
- package/styled-components/es/components/_Icon/index.js +1 -2
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +9 -18
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +0 -70
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +9 -18
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +1 -71
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +9 -18
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +0 -70
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +9 -18
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -80
- package/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts +0 -424
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts +0 -424
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts.map +1 -1
- package/types/components/DatePicker/DatePickerBase.types.d.ts +8 -6
- package/types/components/DatePicker/DatePickerBase.types.d.ts.map +1 -1
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts +10 -10
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -1
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts +16 -6
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts.map +1 -1
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.d.ts +1 -1
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.d.ts.map +1 -1
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.d.ts +2 -1
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.d.ts.map +1 -1
- package/types/components/DatePicker/RangeDate/variations/_size/base.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts +2 -2
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts +0 -424
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +14 -4
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -1
- package/types/components/DatePicker/hooks/useDatePicker.d.ts +2 -3
- package/types/components/DatePicker/hooks/useDatePicker.d.ts.map +1 -1
- package/types/components/DatePicker/hooks/useKeyboardNavigation.d.ts +3 -1
- package/types/components/DatePicker/hooks/useKeyboardNavigation.d.ts.map +1 -1
- package/types/components/DatePicker/utils/dateHelper.d.ts +10 -0
- package/types/components/DatePicker/utils/dateHelper.d.ts.map +1 -1
- package/types/components/Popover/Popover.types.d.ts +1 -1
- package/types/components/Range/Range.styles.d.ts +0 -424
- package/types/components/Range/Range.styles.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.styles.d.ts +0 -424
- package/types/components/Slider/components/Double/Double.styles.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.d.ts +3 -9
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.styles.d.ts +1 -11
- package/types/components/TextArea/TextArea.styles.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +0 -39
- package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.types.d.ts +3 -83
- package/types/components/TextArea/TextArea.types.d.ts.map +1 -1
- package/types/components/TextArea/hooks/useAutoResize.d.ts.map +1 -1
- package/types/components/TextArea/variations/_clear/base.d.ts.map +1 -1
- package/types/components/TextArea/variations/_view/base.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts +3 -9
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.styles.d.ts +0 -8
- package/types/components/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/TextField/TextField.tokens.d.ts +0 -39
- package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
- package/types/components/TextField/TextField.types.d.ts +2 -78
- package/types/components/TextField/TextField.types.d.ts.map +1 -1
- package/types/components/TextField/variations/_clear/base.d.ts.map +1 -1
- package/types/components/TextField/variations/_label-placement/base.d.ts.map +1 -1
- package/types/components/TextField/variations/_read-only/base.d.ts.map +1 -1
- package/types/components/TextField/variations/_size/base.d.ts.map +1 -1
- package/types/components/TextField/variations/_view/base.d.ts.map +1 -1
- package/types/components/_Icon/index.d.ts +0 -1
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts +6 -6
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts +12 -788
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +0 -9
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +0 -473
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts +0 -9
- package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +0 -433
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -1
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts +6 -6
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Mask/Mask.d.ts +12 -788
- package/types/examples/plasma_web/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts +0 -9
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts +0 -473
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextField/TextField.config.d.ts +0 -9
- package/types/examples/plasma_web/components/TextField/TextField.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextField/TextField.d.ts +0 -433
- package/types/examples/plasma_web/components/TextField/TextField.d.ts.map +1 -1
- package/cjs/components/DatePicker/RangeDate/variations/_size/base_1911nyw.css +0 -1
- package/cjs/components/TextArea/TextArea.styles_mcxlmk.css +0 -17
- package/cjs/components/TextArea/variations/_clear/base_1ezvvtt.css +0 -1
- package/cjs/components/TextArea/variations/_hint-size/base.js +0 -9
- package/cjs/components/TextArea/variations/_hint-size/base.js.map +0 -1
- package/cjs/components/TextArea/variations/_hint-size/base_1ipgv90.css +0 -1
- package/cjs/components/TextArea/variations/_hint-view/base.js +0 -9
- package/cjs/components/TextArea/variations/_hint-view/base.js.map +0 -1
- package/cjs/components/TextArea/variations/_hint-view/base_111a0qe.css +0 -1
- package/cjs/components/TextArea/variations/_view/base_1xgrm3x.css +0 -1
- package/cjs/components/TextField/TextField.styles_17xt45g.css +0 -21
- package/cjs/components/TextField/variations/_clear/base_1pkwm4m.css +0 -1
- package/cjs/components/TextField/variations/_hint-size/base.js +0 -9
- package/cjs/components/TextField/variations/_hint-size/base.js.map +0 -1
- package/cjs/components/TextField/variations/_hint-size/base_1x99605.css +0 -1
- package/cjs/components/TextField/variations/_hint-view/base.js +0 -9
- package/cjs/components/TextField/variations/_hint-view/base.js.map +0 -1
- package/cjs/components/TextField/variations/_hint-view/base_l8etux.css +0 -1
- package/cjs/components/TextField/variations/_label-placement/base_3domm.css +0 -1
- package/cjs/components/TextField/variations/_read-only/base_17ypmu7.css +0 -1
- package/cjs/components/TextField/variations/_size/base_1xdmaqh.css +0 -1
- package/cjs/components/TextField/variations/_view/base_qhyte8.css +0 -1
- package/cjs/components/TextFieldGroup/variations/_shape/base_52bndd.css +0 -1
- package/cjs/components/_Icon/Icon.assets/InfoCircleOutline.js +0 -23
- package/cjs/components/_Icon/Icon.assets/InfoCircleOutline.js.map +0 -1
- package/cjs/components/_Icon/Icons/IconInfoCircleOutline.js +0 -23
- package/cjs/components/_Icon/Icons/IconInfoCircleOutline.js.map +0 -1
- package/emotion/cjs/components/TextArea/variations/_hint-size/base.js +0 -11
- package/emotion/cjs/components/TextArea/variations/_hint-size/tokens.json +0 -21
- package/emotion/cjs/components/TextArea/variations/_hint-view/base.js +0 -11
- package/emotion/cjs/components/TextArea/variations/_hint-view/tokens.json +0 -5
- package/emotion/cjs/components/TextField/variations/_hint-size/base.js +0 -11
- package/emotion/cjs/components/TextField/variations/_hint-size/tokens.json +0 -21
- package/emotion/cjs/components/TextField/variations/_hint-view/base.js +0 -11
- package/emotion/cjs/components/TextField/variations/_hint-view/tokens.json +0 -5
- package/emotion/cjs/components/_Icon/Icon.assets/InfoCircleOutline.js +0 -22
- package/emotion/cjs/components/_Icon/Icons/IconInfoCircleOutline.js +0 -22
- package/emotion/es/components/TextArea/variations/_hint-size/base.js +0 -5
- package/emotion/es/components/TextArea/variations/_hint-size/tokens.json +0 -21
- package/emotion/es/components/TextArea/variations/_hint-view/base.js +0 -5
- package/emotion/es/components/TextArea/variations/_hint-view/tokens.json +0 -5
- package/emotion/es/components/TextField/variations/_hint-size/base.js +0 -5
- package/emotion/es/components/TextField/variations/_hint-size/tokens.json +0 -21
- package/emotion/es/components/TextField/variations/_hint-view/base.js +0 -5
- package/emotion/es/components/TextField/variations/_hint-view/tokens.json +0 -5
- package/emotion/es/components/_Icon/Icon.assets/InfoCircleOutline.js +0 -15
- package/emotion/es/components/_Icon/Icons/IconInfoCircleOutline.js +0 -15
- package/es/components/DatePicker/RangeDate/variations/_size/base_1911nyw.css +0 -1
- package/es/components/TextArea/TextArea.styles_mcxlmk.css +0 -17
- package/es/components/TextArea/variations/_clear/base_1ezvvtt.css +0 -1
- package/es/components/TextArea/variations/_hint-size/base.js +0 -5
- package/es/components/TextArea/variations/_hint-size/base.js.map +0 -1
- package/es/components/TextArea/variations/_hint-size/base_1ipgv90.css +0 -1
- package/es/components/TextArea/variations/_hint-view/base.js +0 -5
- package/es/components/TextArea/variations/_hint-view/base.js.map +0 -1
- package/es/components/TextArea/variations/_hint-view/base_111a0qe.css +0 -1
- package/es/components/TextArea/variations/_view/base_1xgrm3x.css +0 -1
- package/es/components/TextField/TextField.styles_17xt45g.css +0 -21
- package/es/components/TextField/variations/_clear/base_1pkwm4m.css +0 -1
- package/es/components/TextField/variations/_hint-size/base.js +0 -5
- package/es/components/TextField/variations/_hint-size/base.js.map +0 -1
- package/es/components/TextField/variations/_hint-size/base_1x99605.css +0 -1
- package/es/components/TextField/variations/_hint-view/base.js +0 -5
- package/es/components/TextField/variations/_hint-view/base.js.map +0 -1
- package/es/components/TextField/variations/_hint-view/base_l8etux.css +0 -1
- package/es/components/TextField/variations/_label-placement/base_3domm.css +0 -1
- package/es/components/TextField/variations/_read-only/base_17ypmu7.css +0 -1
- package/es/components/TextField/variations/_size/base_1xdmaqh.css +0 -1
- package/es/components/TextField/variations/_view/base_qhyte8.css +0 -1
- package/es/components/TextFieldGroup/variations/_shape/base_52bndd.css +0 -1
- package/es/components/_Icon/Icon.assets/InfoCircleOutline.js +0 -19
- package/es/components/_Icon/Icon.assets/InfoCircleOutline.js.map +0 -1
- package/es/components/_Icon/Icons/IconInfoCircleOutline.js +0 -19
- package/es/components/_Icon/Icons/IconInfoCircleOutline.js.map +0 -1
- package/styled-components/cjs/components/TextArea/variations/_hint-size/base.js +0 -11
- package/styled-components/cjs/components/TextArea/variations/_hint-size/tokens.json +0 -21
- package/styled-components/cjs/components/TextArea/variations/_hint-view/base.js +0 -11
- package/styled-components/cjs/components/TextArea/variations/_hint-view/tokens.json +0 -5
- package/styled-components/cjs/components/TextField/variations/_hint-size/base.js +0 -11
- package/styled-components/cjs/components/TextField/variations/_hint-size/tokens.json +0 -21
- package/styled-components/cjs/components/TextField/variations/_hint-view/base.js +0 -11
- package/styled-components/cjs/components/TextField/variations/_hint-view/tokens.json +0 -5
- package/styled-components/cjs/components/_Icon/Icon.assets/InfoCircleOutline.js +0 -22
- package/styled-components/cjs/components/_Icon/Icons/IconInfoCircleOutline.js +0 -22
- package/styled-components/es/components/TextArea/variations/_hint-size/base.js +0 -5
- package/styled-components/es/components/TextArea/variations/_hint-size/tokens.json +0 -21
- package/styled-components/es/components/TextArea/variations/_hint-view/base.js +0 -5
- package/styled-components/es/components/TextArea/variations/_hint-view/tokens.json +0 -5
- package/styled-components/es/components/TextField/variations/_hint-size/base.js +0 -5
- package/styled-components/es/components/TextField/variations/_hint-size/tokens.json +0 -21
- package/styled-components/es/components/TextField/variations/_hint-view/base.js +0 -5
- package/styled-components/es/components/TextField/variations/_hint-view/tokens.json +0 -5
- package/styled-components/es/components/_Icon/Icon.assets/InfoCircleOutline.js +0 -15
- package/styled-components/es/components/_Icon/Icons/IconInfoCircleOutline.js +0 -15
- package/types/components/TextArea/variations/_hint-size/base.d.ts +0 -2
- package/types/components/TextArea/variations/_hint-size/base.d.ts.map +0 -1
- package/types/components/TextArea/variations/_hint-view/base.d.ts +0 -2
- package/types/components/TextArea/variations/_hint-view/base.d.ts.map +0 -1
- package/types/components/TextField/variations/_hint-size/base.d.ts +0 -2
- package/types/components/TextField/variations/_hint-size/base.d.ts.map +0 -1
- package/types/components/TextField/variations/_hint-view/base.d.ts +0 -2
- package/types/components/TextField/variations/_hint-view/base.d.ts.map +0 -1
- package/types/components/_Icon/Icon.assets/InfoCircleOutline.d.ts +0 -4
- package/types/components/_Icon/Icon.assets/InfoCircleOutline.d.ts.map +0 -1
- package/types/components/_Icon/Icons/IconInfoCircleOutline.d.ts +0 -4
- package/types/components/_Icon/Icons/IconInfoCircleOutline.d.ts.map +0 -1
@@ -1,11 +1,9 @@
|
|
1
1
|
import { classes } from '../DatePicker.tokens';
|
2
|
-
import { formatCalendarValue, formatInputValue, getDateFromFormat, getMaskedDateOnInput } from '../utils/dateHelper';
|
3
|
-
import { customDayjs } from '../../../utils/datejs';
|
2
|
+
import { formatCalendarValue, formatInputValue, getDateFromFormat, getMaskedDateOnInput, validateDateWithFullMonth } from '../utils/dateHelper';
|
4
3
|
export var useDatePicker = function useDatePicker(_ref) {
|
5
4
|
var currentValue = _ref.currentValue,
|
6
5
|
setInputValue = _ref.setInputValue,
|
7
6
|
setCalendarValue = _ref.setCalendarValue,
|
8
|
-
setIsInnerOpen = _ref.setIsInnerOpen,
|
9
7
|
dateFormatDelimiter = _ref.dateFormatDelimiter,
|
10
8
|
format = _ref.format,
|
11
9
|
_ref$lang = _ref.lang,
|
@@ -15,24 +13,12 @@ export var useDatePicker = function useDatePicker(_ref) {
|
|
15
13
|
maskWithFormat = _ref.maskWithFormat,
|
16
14
|
valueError = _ref.valueError,
|
17
15
|
valueSuccess = _ref.valueSuccess,
|
18
|
-
inputRef = _ref.inputRef,
|
19
16
|
name = _ref.name,
|
20
|
-
onToggle = _ref.onToggle,
|
21
17
|
onChangeValue = _ref.onChangeValue,
|
22
18
|
onCommitDate = _ref.onCommitDate,
|
23
19
|
onChange = _ref.onChange;
|
24
20
|
var datePickerErrorClass = valueError ? classes.datePickerError : undefined;
|
25
21
|
var datePickerSuccessClass = valueSuccess ? classes.datePickerSuccess : undefined;
|
26
|
-
var handleToggle = function handleToggle(opened, event) {
|
27
|
-
if (disabled || readOnly) {
|
28
|
-
return;
|
29
|
-
}
|
30
|
-
var isCalendarOpen = event.target === (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) ? true : opened;
|
31
|
-
if (onToggle) {
|
32
|
-
return onToggle(isCalendarOpen, event);
|
33
|
-
}
|
34
|
-
setIsInnerOpen(isCalendarOpen);
|
35
|
-
};
|
36
22
|
var handleChangeValue = function handleChangeValue(event) {
|
37
23
|
if (disabled || readOnly) {
|
38
24
|
return;
|
@@ -55,24 +41,14 @@ export var useDatePicker = function useDatePicker(_ref) {
|
|
55
41
|
});
|
56
42
|
return;
|
57
43
|
}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
var isLengthEqual;
|
67
|
-
if (hasMonthFullName) {
|
68
|
-
customDayjs.locale(lang);
|
69
|
-
var firstIndexOfMonth = format.indexOf('M');
|
70
|
-
var lastIndexOfMonth = newValue.indexOf(dateFormatDelimiter(), firstIndexOfMonth);
|
71
|
-
var fullMonthName = !lastIndexOfMonth ? newValue.slice(firstIndexOfMonth) : newValue.slice(firstIndexOfMonth, lastIndexOfMonth);
|
72
|
-
var monthFormatting = format.replace(/[^M]/g, '');
|
73
|
-
isValidMonth = customDayjs("01 ".concat(fullMonthName, " 1970"), "DD ".concat(monthFormatting, " YYYY"), true).isValid();
|
74
|
-
isLengthEqual = format.length - monthFormatting.length === newValue.length - fullMonthName.length;
|
75
|
-
}
|
44
|
+
var _validateDateWithFull = validateDateWithFullMonth({
|
45
|
+
currentValue: newValue,
|
46
|
+
format: format,
|
47
|
+
lang: lang
|
48
|
+
}),
|
49
|
+
hasMonthFullName = _validateDateWithFull.hasMonthFullName,
|
50
|
+
isValidMonth = _validateDateWithFull.isValidMonth,
|
51
|
+
isLengthEqual = _validateDateWithFull.isLengthEqual;
|
76
52
|
if (!hasMonthFullName && (newValue === null || newValue === void 0 ? void 0 : newValue.length) === (format === null || format === void 0 ? void 0 : format.length) || isValidMonth && isLengthEqual) {
|
77
53
|
setCalendarValue(formatCalendarValue(newValue, format, lang));
|
78
54
|
}
|
@@ -102,20 +78,18 @@ export var useDatePicker = function useDatePicker(_ref) {
|
|
102
78
|
return onCommitDate === null || onCommitDate === void 0 ? void 0 : onCommitDate('', false, true);
|
103
79
|
}
|
104
80
|
if (isCalendarValue) {
|
105
|
-
|
106
|
-
setInputValue(formatInputValue({
|
81
|
+
var _formattedInputValue = formatInputValue({
|
107
82
|
value: date,
|
108
83
|
format: format,
|
109
84
|
lang: lang
|
110
|
-
})
|
85
|
+
});
|
86
|
+
setCalendarValue(formatCalendarValue(date, format, lang));
|
87
|
+
setInputValue(_formattedInputValue);
|
111
88
|
onCommitDate === null || onCommitDate === void 0 || onCommitDate(date, false, true, dateInfo);
|
89
|
+
onChangeValue === null || onChangeValue === void 0 || onChangeValue(null, _formattedInputValue);
|
112
90
|
onChange === null || onChange === void 0 || onChange({
|
113
91
|
target: {
|
114
|
-
value:
|
115
|
-
value: date,
|
116
|
-
format: format,
|
117
|
-
lang: lang
|
118
|
-
}),
|
92
|
+
value: _formattedInputValue,
|
119
93
|
name: name
|
120
94
|
}
|
121
95
|
});
|
@@ -126,19 +100,18 @@ export var useDatePicker = function useDatePicker(_ref) {
|
|
126
100
|
newDate = _getDateFromFormat.value,
|
127
101
|
isError = _getDateFromFormat.isError,
|
128
102
|
isSuccess = _getDateFromFormat.isSuccess;
|
129
|
-
|
130
|
-
setInputValue(formatInputValue({
|
103
|
+
var formattedInputValue = formatInputValue({
|
131
104
|
value: newDate,
|
132
105
|
format: format,
|
133
106
|
lang: lang
|
134
|
-
})
|
107
|
+
});
|
108
|
+
setCalendarValue(formatCalendarValue(newDate, format, lang));
|
109
|
+
setInputValue(formattedInputValue);
|
135
110
|
onCommitDate === null || onCommitDate === void 0 || onCommitDate(newDate, isError, isSuccess);
|
111
|
+
onChangeValue === null || onChangeValue === void 0 || onChangeValue(null, formattedInputValue);
|
136
112
|
onChange === null || onChange === void 0 || onChange({
|
137
113
|
target: {
|
138
|
-
value:
|
139
|
-
value: date,
|
140
|
-
format: format
|
141
|
-
}),
|
114
|
+
value: formattedInputValue,
|
142
115
|
name: name
|
143
116
|
}
|
144
117
|
});
|
@@ -146,7 +119,6 @@ export var useDatePicker = function useDatePicker(_ref) {
|
|
146
119
|
return {
|
147
120
|
datePickerErrorClass: datePickerErrorClass,
|
148
121
|
datePickerSuccessClass: datePickerSuccessClass,
|
149
|
-
handleToggle: handleToggle,
|
150
122
|
handleChangeValue: handleChangeValue,
|
151
123
|
handleCommitDate: handleCommitDate
|
152
124
|
};
|
@@ -1,8 +1,10 @@
|
|
1
1
|
export var keys = {
|
2
|
-
Space: 'Space'
|
2
|
+
Space: 'Space',
|
3
|
+
Escape: 'Escape'
|
3
4
|
};
|
4
5
|
export var useKeyNavigation = function useKeyNavigation(_ref) {
|
5
6
|
var isCalendarOpen = _ref.isCalendarOpen,
|
7
|
+
closeOnEsc = _ref.closeOnEsc,
|
6
8
|
onToggle = _ref.onToggle;
|
7
9
|
var onKeyDown = function onKeyDown(event) {
|
8
10
|
switch (event.code) {
|
@@ -14,6 +16,14 @@ export var useKeyNavigation = function useKeyNavigation(_ref) {
|
|
14
16
|
}
|
15
17
|
break;
|
16
18
|
}
|
19
|
+
case keys.Escape:
|
20
|
+
{
|
21
|
+
if (isCalendarOpen && closeOnEsc) {
|
22
|
+
event.preventDefault();
|
23
|
+
onToggle(false, event);
|
24
|
+
}
|
25
|
+
break;
|
26
|
+
}
|
17
27
|
default:
|
18
28
|
{
|
19
29
|
break;
|
@@ -78,4 +78,34 @@ export var getMaskedDateOnInput = function getMaskedDateOnInput(value, format, d
|
|
78
78
|
return value + delimiter;
|
79
79
|
}
|
80
80
|
return value;
|
81
|
+
};
|
82
|
+
export var validateDateWithFullMonth = function validateDateWithFullMonth(_ref2) {
|
83
|
+
var currentValue = _ref2.currentValue,
|
84
|
+
format = _ref2.format,
|
85
|
+
lang = _ref2.lang;
|
86
|
+
/**
|
87
|
+
* NOTE: если в формате даты есть месяц в полном названии или сокращенном,
|
88
|
+
* нужно дополнительно проводить валидацию на полноту введенной даты.
|
89
|
+
* Иначе dayjs циклически будет пытаться отформатировать некорректную дату.
|
90
|
+
*/
|
91
|
+
var hasMonthFullName = /M{3,4}/g.test(format);
|
92
|
+
if (!hasMonthFullName) {
|
93
|
+
return {
|
94
|
+
hasMonthFullName: hasMonthFullName,
|
95
|
+
isValidMonth: false,
|
96
|
+
isLengthEqual: false
|
97
|
+
};
|
98
|
+
}
|
99
|
+
customDayjs.locale(lang);
|
100
|
+
var firstIndexOfMonth = format.indexOf('M');
|
101
|
+
var lastIndexOfMonth = currentValue.indexOf(getDateFormatDelimiter(format), firstIndexOfMonth);
|
102
|
+
var fullMonthName = !lastIndexOfMonth ? currentValue.slice(firstIndexOfMonth) : currentValue.slice(firstIndexOfMonth, lastIndexOfMonth);
|
103
|
+
var monthFormatting = format.replace(/[^M]/g, '');
|
104
|
+
var isValidMonth = customDayjs("01 ".concat(fullMonthName, " 1970"), "DD ".concat(monthFormatting, " YYYY"), true).isValid();
|
105
|
+
var isLengthEqual = format.length - monthFormatting.length === currentValue.length - fullMonthName.length;
|
106
|
+
return {
|
107
|
+
hasMonthFullName: hasMonthFullName,
|
108
|
+
isValidMonth: isValidMonth,
|
109
|
+
isLengthEqual: isLengthEqual
|
110
|
+
};
|
81
111
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
var
|
3
|
-
|
2
|
+
var _excluded = ["helperText", "status", "resize", "rightHelper", "leftHelper", "contentRight", "autoResize", "minAuto", "maxAuto", "label", "labelPlacement", "placeholder", "defaultValue", "height", "width", "value", "disabled", "required", "requiredPlacement", "optional", "clear", "hasDivider", "size", "view", "id", "style", "className", "readOnly", "rows", "cols", "onChange"];
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
5
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
6
6
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
@@ -10,7 +10,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
10
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
12
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
13
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
14
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
15
14
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
16
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
@@ -19,22 +18,18 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
19
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
20
19
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
21
20
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
22
|
-
import React, { forwardRef, useState, createRef, useCallback
|
21
|
+
import React, { forwardRef, useState, createRef, useCallback } from 'react';
|
23
22
|
import { css } from 'styled-components';
|
24
|
-
import {
|
25
|
-
import { cx, mergeRefs
|
26
|
-
import { IconInfoCircleOutline } from '../_Icon';
|
27
|
-
import { useOutsideClick } from '../../hooks';
|
23
|
+
import { useResizeObserver } from '@salutejs/plasma-core';
|
24
|
+
import { cx, mergeRefs } from '../../utils';
|
28
25
|
import { applyDynamicLabel } from './mixins';
|
29
26
|
import { useAutoResize, ROOT_FONT_SIZE } from './hooks';
|
30
|
-
import { StyledContent, StyledHelpers, StyledLeftHelper, StyledRightHelper, StyledLabel, StyledPlaceholder, StyledTextArea, StyledTextAreaWrapper, StyledContainer, StyledIndicator, StyledOptionalText
|
27
|
+
import { StyledContent, StyledHelpers, StyledLeftHelper, StyledRightHelper, StyledLabel, StyledPlaceholder, StyledTextArea, StyledTextAreaWrapper, StyledContainer, StyledIndicator, StyledOptionalText } from './TextArea.styles';
|
31
28
|
import { classes } from './TextArea.tokens';
|
32
29
|
import { base as viewCSS } from './variations/_view/base';
|
33
30
|
import { base as sizeCSS } from './variations/_size/base';
|
34
31
|
import { base as clearCSS } from './variations/_clear/base';
|
35
32
|
import { base as disabledCSS } from './variations/_disabled/base';
|
36
|
-
import { base as hintViewCSS } from './variations/_hint-view/base';
|
37
|
-
import { base as hintSizeCSS } from './variations/_hint-size/base';
|
38
33
|
var innerPlaceholderUp = classes.innerPlaceholderUp,
|
39
34
|
focusedOuterPlaceholderColor = classes.focusedOuterPlaceholderColor,
|
40
35
|
hidePlaceHolder = classes.hidePlaceHolder,
|
@@ -89,7 +84,6 @@ export var textAreaRoot = function textAreaRoot(Root) {
|
|
89
84
|
label = props.label,
|
90
85
|
_props$labelPlacement = props.labelPlacement,
|
91
86
|
labelPlacement = _props$labelPlacement === void 0 ? 'inner' : _props$labelPlacement,
|
92
|
-
titleCaption = props.titleCaption,
|
93
87
|
placeholder = props.placeholder,
|
94
88
|
defaultValue = props.defaultValue,
|
95
89
|
height = props.height,
|
@@ -112,47 +106,21 @@ export var textAreaRoot = function textAreaRoot(Root) {
|
|
112
106
|
readOnly = props.readOnly,
|
113
107
|
rows = props.rows,
|
114
108
|
cols = props.cols,
|
115
|
-
hasHint = props.hasHint,
|
116
|
-
_props$hintTrigger = props.hintTrigger,
|
117
|
-
hintTrigger = _props$hintTrigger === void 0 ? 'hover' : _props$hintTrigger,
|
118
|
-
hintText = props.hintText,
|
119
|
-
_props$hintView = props.hintView,
|
120
|
-
hintView = _props$hintView === void 0 ? 'default' : _props$hintView,
|
121
|
-
_props$hintSize = props.hintSize,
|
122
|
-
hintSize = _props$hintSize === void 0 ? 'm' : _props$hintSize,
|
123
|
-
hintTargetIcon = props.hintTargetIcon,
|
124
|
-
_props$hintPlacement = props.hintPlacement,
|
125
|
-
hintPlacement = _props$hintPlacement === void 0 ? 'auto' : _props$hintPlacement,
|
126
|
-
hintHasArrow = props.hintHasArrow,
|
127
|
-
_props$hintOffset = props.hintOffset,
|
128
|
-
hintOffset = _props$hintOffset === void 0 ? [0, 0] : _props$hintOffset,
|
129
|
-
hintWidth = props.hintWidth,
|
130
|
-
hintContentLeft = props.hintContentLeft,
|
131
109
|
onChange = props.onChange,
|
132
110
|
rest = _objectWithoutProperties(props, _excluded);
|
133
|
-
var _useState = useState(
|
111
|
+
var _useState = useState(width ? "".concat(width, "rem") : '100%'),
|
134
112
|
_useState2 = _slicedToArray(_useState, 2),
|
135
|
-
|
136
|
-
|
137
|
-
var _useState3 = useState(
|
113
|
+
helperWidth = _useState2[0],
|
114
|
+
setHelperWidth = _useState2[1];
|
115
|
+
var _useState3 = useState(false),
|
138
116
|
_useState4 = _slicedToArray(_useState3, 2),
|
139
|
-
|
140
|
-
|
141
|
-
var _useState5 = useState(
|
117
|
+
focused = _useState4[0],
|
118
|
+
setFocused = _useState4[1];
|
119
|
+
var _useState5 = useState(),
|
142
120
|
_useState6 = _slicedToArray(_useState5, 2),
|
143
|
-
|
144
|
-
|
145
|
-
var _useState7 = useState(),
|
146
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
147
|
-
uncontrolledValue = _useState8[0],
|
148
|
-
setUncontrolledValue = _useState8[1];
|
121
|
+
uncontrolledValue = _useState6[0],
|
122
|
+
setUncontrolledValue = _useState6[1];
|
149
123
|
var outerRef = /*#__PURE__*/createRef();
|
150
|
-
var hintId = safeUseId();
|
151
|
-
var hintRef = useOutsideClick(function () {
|
152
|
-
setIsHintVisible(false);
|
153
|
-
});
|
154
|
-
var hintInnerRef = useRef(null);
|
155
|
-
var hintForkRef = useForkRef(hintRef, hintInnerRef);
|
156
124
|
var innerOptional = required ? false : optional;
|
157
125
|
var hasHelper = Boolean(leftHelper || rightHelper || helperText);
|
158
126
|
var hasOuterLabel = Boolean(label && labelPlacement === 'outer');
|
@@ -163,27 +131,9 @@ export var textAreaRoot = function textAreaRoot(Root) {
|
|
163
131
|
var applyCustomWidth = resize !== 'horizontal' && resize !== 'both' && !cols;
|
164
132
|
var placeholderLabel = hasInnerLabel ? label : placeholder;
|
165
133
|
var clearClass = clear ? classes.clear : undefined;
|
166
|
-
var hasHintClass = hasHint ? classes.hasHint : undefined;
|
167
134
|
var hasRightContentClass = contentRight ? classes.hasRightContent : undefined;
|
168
135
|
var hasDividerClass = hasDivider ? classes.hasDivider : undefined;
|
169
136
|
var requiredPlacementClass = requiredPlacement === 'right' ? 'align-right ' : undefined;
|
170
|
-
var handleHintShow = function handleHintShow() {
|
171
|
-
return setIsHintVisible(true);
|
172
|
-
};
|
173
|
-
var handleHintHide = function handleHintHide() {
|
174
|
-
return setIsHintVisible(false);
|
175
|
-
};
|
176
|
-
var handleHintClick = function handleHintClick(event) {
|
177
|
-
if (hasHint && hintTrigger === 'click') {
|
178
|
-
var _hintInnerRef$current;
|
179
|
-
event.stopPropagation();
|
180
|
-
var targetIsPopover = event.target === hintInnerRef.current;
|
181
|
-
var rootHasTarget = (_hintInnerRef$current = hintInnerRef.current) === null || _hintInnerRef$current === void 0 ? void 0 : _hintInnerRef$current.contains(event.target);
|
182
|
-
if (!targetIsPopover && !rootHasTarget) {
|
183
|
-
setIsHintVisible(true);
|
184
|
-
}
|
185
|
-
}
|
186
|
-
};
|
187
137
|
useResizeObserver(outerRef, function (currentElement) {
|
188
138
|
var inlineWidth = currentElement.style.width;
|
189
139
|
if (inlineWidth || cols) {
|
@@ -206,6 +156,17 @@ export var textAreaRoot = function textAreaRoot(Root) {
|
|
206
156
|
}
|
207
157
|
onChange === null || onChange === void 0 || onChange(event);
|
208
158
|
}, [value, onChange]);
|
159
|
+
var handleTextAreaFocus = function handleTextAreaFocus() {
|
160
|
+
if (readOnly || disabled || !(outerRef !== null && outerRef !== void 0 && outerRef.current)) {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
outerRef.current.scrollTo({
|
164
|
+
top: 0,
|
165
|
+
left: outerRef.current.offsetLeft,
|
166
|
+
behavior: 'smooth'
|
167
|
+
});
|
168
|
+
outerRef.current.focus();
|
169
|
+
};
|
209
170
|
var dynamicLabelClasses = getDynamicLabelClasses({
|
210
171
|
size: size,
|
211
172
|
readOnly: readOnly,
|
@@ -214,35 +175,8 @@ export var textAreaRoot = function textAreaRoot(Root) {
|
|
214
175
|
value: value || uncontrolledValue || defaultValue,
|
215
176
|
rows: rows
|
216
177
|
}, focused);
|
217
|
-
var optionalTextNode = innerOptional ? /*#__PURE__*/React.createElement(StyledOptionalText,
|
218
|
-
|
219
|
-
}, Boolean(hasPlaceholderOptional ? placeholderLabel : label) && '\xa0', optionalText) : null;
|
220
|
-
var HintComponent = useMemo(function () {
|
221
|
-
return /*#__PURE__*/React.createElement(Hint, {
|
222
|
-
ref: hintForkRef,
|
223
|
-
text: String(hintText),
|
224
|
-
opened: isHintVisible,
|
225
|
-
target: /*#__PURE__*/React.createElement(HintTargetWrapper, _extends({
|
226
|
-
id: hintId
|
227
|
-
}, hintTrigger === 'hover' ? {
|
228
|
-
onMouseEnter: handleHintShow,
|
229
|
-
onMouseLeave: handleHintHide
|
230
|
-
} : {
|
231
|
-
onClick: handleHintClick
|
232
|
-
}), hintTargetIcon || _IconInfoCircleOutlin || (_IconInfoCircleOutlin = /*#__PURE__*/React.createElement(IconInfoCircleOutline, {
|
233
|
-
size: "xs",
|
234
|
-
color: "inherit"
|
235
|
-
}))),
|
236
|
-
placement: hintPlacement,
|
237
|
-
hasArrow: hintHasArrow,
|
238
|
-
offset: hintOffset,
|
239
|
-
minWidth: hintWidth,
|
240
|
-
maxWidth: hintWidth,
|
241
|
-
contentLeft: hintContentLeft,
|
242
|
-
frame: hintId
|
243
|
-
});
|
244
|
-
}, [hintText, isHintVisible, hintId, hintTrigger, handleHintShow, handleHintHide, handleHintClick, hintTargetIcon, hintPlacement, hintHasArrow, hintOffset, hintWidth, hintContentLeft]);
|
245
|
-
return /*#__PURE__*/React.createElement(Root, _extends({
|
178
|
+
var optionalTextNode = innerOptional ? /*#__PURE__*/React.createElement(StyledOptionalText, null, Boolean(hasPlaceholderOptional ? placeholderLabel : label) && '\xa0', optionalText) : null;
|
179
|
+
return /*#__PURE__*/React.createElement(Root, {
|
246
180
|
view: overriddenView,
|
247
181
|
size: size,
|
248
182
|
disabled: disabled,
|
@@ -251,24 +185,18 @@ export var textAreaRoot = function textAreaRoot(Root) {
|
|
251
185
|
style: _objectSpread({
|
252
186
|
width: helperWidth
|
253
187
|
}, style),
|
254
|
-
className: cx(clearClass, hasDividerClass,
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
}),
|
259
|
-
isInnnerLabel: labelPlacement === 'inner'
|
260
|
-
}, hasOuterLabel && /*#__PURE__*/React.createElement(StyledIndicatorWrapper, null, /*#__PURE__*/React.createElement(StyledLabel, null, label), hasHint && /*#__PURE__*/React.createElement(StyledHintWrapper, null, HintComponent), required && /*#__PURE__*/React.createElement(StyledIndicator, {
|
261
|
-
className: cx(classes.outerLabelPlacement, requiredPlacementClass, hasHintClass)
|
262
|
-
}), optionalTextNode), titleCaption && /*#__PURE__*/React.createElement(TitleCaption, null, titleCaption)), /*#__PURE__*/React.createElement(StyledContainer, {
|
188
|
+
className: cx(clearClass, hasDividerClass, className),
|
189
|
+
onClick: handleTextAreaFocus
|
190
|
+
}, hasOuterLabel && /*#__PURE__*/React.createElement(StyledLabel, null, required && /*#__PURE__*/React.createElement(StyledIndicator, {
|
191
|
+
className: cx(classes.outerLabelPlacement, requiredPlacementClass)
|
192
|
+
}), label, optionalTextNode), /*#__PURE__*/React.createElement(StyledContainer, {
|
263
193
|
className: cx.apply(void 0, [styledContainer].concat(_toConsumableArray(dynamicLabelClasses))),
|
264
194
|
width: helperWidth,
|
265
195
|
onFocus: onFocusHandler,
|
266
196
|
onBlur: onBlurHandler
|
267
|
-
},
|
197
|
+
}, required && !hasOuterLabel && /*#__PURE__*/React.createElement(StyledIndicator, {
|
268
198
|
className: cx(classes.innerLabelPlacement, requiredPlacementClass)
|
269
|
-
}),
|
270
|
-
className: classes.innerLabelPlacement
|
271
|
-
}, HintComponent)), contentRight && /*#__PURE__*/React.createElement(StyledContent, null, contentRight), /*#__PURE__*/React.createElement(StyledTextAreaWrapper, {
|
199
|
+
}), contentRight && /*#__PURE__*/React.createElement(StyledContent, null, contentRight), /*#__PURE__*/React.createElement(StyledTextAreaWrapper, {
|
272
200
|
className: styledTextAreaWrapper,
|
273
201
|
hasHelper: hasHelper
|
274
202
|
}, /*#__PURE__*/React.createElement(StyledTextArea, _extends({
|
@@ -322,12 +250,6 @@ export var textAreaConfig = {
|
|
322
250
|
},
|
323
251
|
readOnly: {
|
324
252
|
attrs: true
|
325
|
-
},
|
326
|
-
hintView: {
|
327
|
-
css: hintViewCSS
|
328
|
-
},
|
329
|
-
hintSize: {
|
330
|
-
css: hintSizeCSS
|
331
253
|
}
|
332
254
|
},
|
333
255
|
defaults: {
|
@@ -1,119 +1,76 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
2
|
import { applyEllipsis } from '../../mixins';
|
3
|
-
import { tooltipConfig } from '../Tooltip';
|
4
|
-
import { component, mergeConfig } from '../../engines';
|
5
3
|
import { classes, tokens } from './TextArea.tokens';
|
6
|
-
var mergedConfig = /*#__PURE__*/mergeConfig(tooltipConfig);
|
7
|
-
var Tooltip = /*#__PURE__*/component(mergedConfig);
|
8
|
-
export var Hint = /*#__PURE__*/styled(Tooltip).withConfig({
|
9
|
-
componentId: "plasma-new-hope__sc-pxxv3p-0"
|
10
|
-
})([""]);
|
11
|
-
export var OuterLabelWrapper = /*#__PURE__*/styled.div.withConfig({
|
12
|
-
componentId: "plasma-new-hope__sc-pxxv3p-1"
|
13
|
-
})(["display:flex;align-items:center;margin-bottom:", ";"], function (_ref) {
|
14
|
-
var isInnnerLabel = _ref.isInnnerLabel;
|
15
|
-
return isInnnerLabel ? "var(".concat(tokens.titleCaptionInnerLabelOffset, ")") : "var(".concat(tokens.labelMarginBottom, ")");
|
16
|
-
});
|
17
4
|
export var StyledLabel = /*#__PURE__*/styled.div.withConfig({
|
18
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
19
|
-
})(["position:relative;display:inline-flex;color:var(", ",var(", "));font-family:var(", ",var(", "));font-size:var(", ",var(", "));font-style:var(", ",var(", "));font-weight:var(", ",var(", "));letter-spacing:var(", ",var(", "));line-height:var(", ",var(", "));"], tokens.labelOuterColor, tokens.inputColor, tokens.labelOuterFontFamily, tokens.inputFontFamily, tokens.labelOuterFontSize, tokens.inputFontSize, tokens.labelOuterFontStyle, tokens.inputFontStyle, tokens.labelOuterFontWeight, tokens.inputFontWeight, tokens.labelOuterLetterSpacing, tokens.inputLetterSpacing, tokens.labelOuterLineHeight, tokens.inputLineHeight);
|
20
|
-
export var TitleCaption = /*#__PURE__*/styled.div.withConfig({
|
21
|
-
componentId: "plasma-new-hope__sc-pxxv3p-3"
|
22
|
-
})(["display:inline-block;margin-left:auto;font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight);
|
23
|
-
export var StyledIndicatorWrapper = /*#__PURE__*/styled.div.withConfig({
|
24
|
-
componentId: "plasma-new-hope__sc-pxxv3p-4"
|
25
|
-
})(["position:relative;display:inline-flex;align-items:center;"]);
|
5
|
+
componentId: "plasma-new-hope__sc-pxxv3p-0"
|
6
|
+
})(["position:relative;display:inline-flex;margin-bottom:var(", ");color:var(", ",var(", "));font-family:var(", ",var(", "));font-size:var(", ",var(", "));font-style:var(", ",var(", "));font-weight:var(", ",var(", "));letter-spacing:var(", ",var(", "));line-height:var(", ",var(", "));"], tokens.labelMarginBottom, tokens.labelOuterColor, tokens.inputColor, tokens.labelOuterFontFamily, tokens.inputFontFamily, tokens.labelOuterFontSize, tokens.inputFontSize, tokens.labelOuterFontStyle, tokens.inputFontStyle, tokens.labelOuterFontWeight, tokens.inputFontWeight, tokens.labelOuterLetterSpacing, tokens.inputLetterSpacing, tokens.labelOuterLineHeight, tokens.inputLineHeight);
|
26
7
|
export var StyledOptionalText = /*#__PURE__*/styled.span.withConfig({
|
27
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
28
|
-
})(["color:var(", ");
|
29
|
-
var inheritFont = _ref2.inheritFont;
|
30
|
-
return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontFamily, ", var(").concat(tokens.inputFontFamily, "))");
|
31
|
-
}, function (_ref3) {
|
32
|
-
var inheritFont = _ref3.inheritFont;
|
33
|
-
return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontSize, ", var(").concat(tokens.inputFontSize, "))");
|
34
|
-
}, function (_ref4) {
|
35
|
-
var inheritFont = _ref4.inheritFont;
|
36
|
-
return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontStyle, ", var(").concat(tokens.inputFontStyle, "))");
|
37
|
-
}, function (_ref5) {
|
38
|
-
var inheritFont = _ref5.inheritFont;
|
39
|
-
return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontWeight, ", var(").concat(tokens.inputFontWeight, "))");
|
40
|
-
}, function (_ref6) {
|
41
|
-
var inheritFont = _ref6.inheritFont;
|
42
|
-
return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterLetterSpacing, ", var(").concat(tokens.inputLetterSpacing, "))");
|
43
|
-
}, function (_ref7) {
|
44
|
-
var inheritFont = _ref7.inheritFont;
|
45
|
-
return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterLineHeight, ", var(").concat(tokens.inputLineHeight, "))");
|
46
|
-
});
|
47
|
-
export var StyledHintWrapper = /*#__PURE__*/styled.div.withConfig({
|
48
|
-
componentId: "plasma-new-hope__sc-pxxv3p-6"
|
49
|
-
})(["display:inline-block;line-height:0;margin:var(", ");&.", "{position:absolute;margin:0;inset:var(", ");}"], tokens.hintMargin, classes.innerLabelPlacement, tokens.hintInnerLabelPlacementOffset);
|
50
|
-
export var HintTargetWrapper = /*#__PURE__*/styled.div.withConfig({
|
51
|
-
componentId: "plasma-new-hope__sc-pxxv3p-7"
|
52
|
-
})(["color:var(", ");width:var(", ");height:var(", ");display:flex;justify-content:center;align-items:center;"], tokens.hintIconColor, tokens.hintTargetSize, tokens.hintTargetSize);
|
8
|
+
componentId: "plasma-new-hope__sc-pxxv3p-1"
|
9
|
+
})(["color:var(", ");"], tokens.optionalColor);
|
53
10
|
export var StyledTextAreaWrapper = /*#__PURE__*/styled.div.withConfig({
|
54
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
55
|
-
})(["background-color:var(", ");padding-top:var(", ");padding-bottom:", ";border-radius:", ";"], tokens.inputBackgroundColor, tokens.inputPaddingTop, function (
|
56
|
-
var hasHelper =
|
11
|
+
componentId: "plasma-new-hope__sc-pxxv3p-2"
|
12
|
+
})(["background-color:var(", ");padding-top:var(", ");padding-bottom:", ";border-radius:", ";"], tokens.inputBackgroundColor, tokens.inputPaddingTop, function (_ref) {
|
13
|
+
var hasHelper = _ref.hasHelper;
|
57
14
|
return hasHelper ? "var(".concat(tokens.inputPaddingBottomWithHelpers, ")") : "var(".concat(tokens.inputPaddingBottom, ")");
|
58
|
-
}, function (
|
59
|
-
var hasHelper =
|
15
|
+
}, function (_ref2) {
|
16
|
+
var hasHelper = _ref2.hasHelper;
|
60
17
|
return hasHelper ? "var(".concat(tokens.borderRadiusWithHelpers, ")") : "var(".concat(tokens.borderRadius, ")");
|
61
18
|
});
|
62
19
|
export var StyledContent = /*#__PURE__*/styled.div.withConfig({
|
63
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
20
|
+
componentId: "plasma-new-hope__sc-pxxv3p-3"
|
64
21
|
})(["position:absolute;display:flex;align-items:center;bottom:0;z-index:1;color:var(", ",var(", "));top:var(", ");right:var(", ");height:var(", ");"], tokens.rightContentColor, tokens.inputColor, tokens.rightContentTop, tokens.rightContentRight, tokens.rightContentHeight);
|
65
22
|
export var StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
66
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
67
|
-
})(["display:inline-flex;flex-direction:column;width:", ";position:relative;"], function (
|
68
|
-
var width =
|
23
|
+
componentId: "plasma-new-hope__sc-pxxv3p-4"
|
24
|
+
})(["display:inline-flex;flex-direction:column;width:", ";position:relative;"], function (_ref3) {
|
25
|
+
var width = _ref3.width;
|
69
26
|
return width;
|
70
27
|
});
|
71
28
|
export var StyledTextArea = /*#__PURE__*/styled.textarea.withConfig({
|
72
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
73
|
-
})(["display:block;box-sizing:border-box;outline:none;border:none;-webkit-appearance:none;background-color:transparent;color:var(", ");caret-color:var(", ");resize:", ";--plasma_private-textarea-height:", ";--plasma_private-textarea-width:", ";--plasma_private-textarea-computed-height:", ";--plasma_private-textarea-computed-width:", ";height:var(--plasma_private-textarea-computed-height);width:var(--plasma_private-textarea-computed-width);min-width:", ";max-width:", ";min-height:var(", ");padding-right:", ";padding-left:var(", ");padding-top:0;padding-bottom:0;--plasma_private-textarea-helpers-computed-height:calc( var(", ") + var(", ") + var(", ") );--plasma_private-textarea-input-with-helpers-height:calc( var(--plasma_private-textarea-height) - var(--plasma_private-textarea-helpers-computed-height) + var(", ") );--plasma_private-textarea-input-without-helpers-height:calc( var(--plasma_private-textarea-computed-height) - var(", ") );--plasma_private-textarea-input-actual-height:", ";height:var(--plasma_private-textarea-input-actual-height);font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");&::placeholder{opacity:0;}&:read-only{cursor:default;}&:focus:not(:disabled){color:var(", ");}&::-webkit-scrollbar{width:var(", ");}&::-webkit-scrollbar-thumb{background-color:var(", ");background-clip:content-box;border:var(", ") solid transparent;border-radius:1rem;}&::-webkit-scrollbar-track{background-color:var(", ");background-clip:content-box;border:var(", ") solid transparent;border-radius:1rem;}"], tokens.inputColor, tokens.inputCaretColor, function (
|
74
|
-
var resize =
|
29
|
+
componentId: "plasma-new-hope__sc-pxxv3p-5"
|
30
|
+
})(["display:block;box-sizing:border-box;outline:none;border:none;-webkit-appearance:none;background-color:transparent;color:var(", ");caret-color:var(", ");resize:", ";--plasma_private-textarea-height:", ";--plasma_private-textarea-width:", ";--plasma_private-textarea-computed-height:", ";--plasma_private-textarea-computed-width:", ";height:var(--plasma_private-textarea-computed-height);width:var(--plasma_private-textarea-computed-width);min-width:", ";max-width:", ";min-height:var(", ");padding-right:", ";padding-left:var(", ");padding-top:0;padding-bottom:0;--plasma_private-textarea-helpers-computed-height:calc( var(", ") + var(", ") + var(", ") );--plasma_private-textarea-input-with-helpers-height:calc( var(--plasma_private-textarea-height) - var(--plasma_private-textarea-helpers-computed-height) + var(", ") );--plasma_private-textarea-input-without-helpers-height:calc( var(--plasma_private-textarea-computed-height) - var(", ") );--plasma_private-textarea-input-actual-height:", ";height:var(--plasma_private-textarea-input-actual-height);font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");&::placeholder{opacity:0;}&:read-only{cursor:default;}&:focus:not(:disabled){color:var(", ");}&::-webkit-scrollbar{width:var(", ");}&::-webkit-scrollbar-thumb{background-color:var(", ");background-clip:content-box;border:var(", ") solid transparent;border-radius:1rem;}&::-webkit-scrollbar-track{background-color:var(", ");background-clip:content-box;border:var(", ") solid transparent;border-radius:1rem;}"], tokens.inputColor, tokens.inputCaretColor, function (_ref4) {
|
31
|
+
var resize = _ref4.resize;
|
75
32
|
return resize || 'none';
|
76
|
-
}, function (
|
77
|
-
var height =
|
33
|
+
}, function (_ref5) {
|
34
|
+
var height = _ref5.height;
|
78
35
|
return !Number.isNaN(Number(height)) ? "calc(".concat(height, "rem - 0.875rem)") : height || "var(".concat(tokens.inputHeight, ")");
|
79
|
-
}, function (
|
80
|
-
var width =
|
36
|
+
}, function (_ref6) {
|
37
|
+
var width = _ref6.width;
|
81
38
|
return !Number.isNaN(Number(width)) ? "".concat(width, "rem") : width || "var(".concat(tokens.inputWidth, ")");
|
82
|
-
}, function (
|
83
|
-
var rows =
|
39
|
+
}, function (_ref7) {
|
40
|
+
var rows = _ref7.rows;
|
84
41
|
return rows ? 'unset' : 'var(--plasma_private-textarea-height)';
|
85
|
-
}, function (
|
86
|
-
var cols =
|
42
|
+
}, function (_ref8) {
|
43
|
+
var cols = _ref8.cols;
|
87
44
|
return cols ? 'unset' : 'var(--plasma_private-textarea-width)';
|
88
|
-
}, function (
|
89
|
-
var applyCustomWidth =
|
45
|
+
}, function (_ref9) {
|
46
|
+
var applyCustomWidth = _ref9.applyCustomWidth;
|
90
47
|
return applyCustomWidth ? 'var(--plasma_private-textarea-width)' : 'auto';
|
91
|
-
}, function (
|
92
|
-
var applyCustomWidth =
|
48
|
+
}, function (_ref10) {
|
49
|
+
var applyCustomWidth = _ref10.applyCustomWidth;
|
93
50
|
return applyCustomWidth ? 'var(--plasma_private-textarea-width)' : 'auto';
|
94
|
-
}, tokens.inputMinHeight, function (
|
95
|
-
var hasContentRight =
|
51
|
+
}, tokens.inputMinHeight, function (_ref11) {
|
52
|
+
var hasContentRight = _ref11.hasContentRight;
|
96
53
|
return hasContentRight ? "var(".concat(tokens.inputPaddingRightWithRightContent, ")") : "var(".concat(tokens.inputPaddingRight, ")");
|
97
|
-
}, tokens.inputPaddingLeft, tokens.helpersPaddingTop, tokens.helpersPaddingBottom, tokens.helpersLineHeight, tokens.helpersOffset, tokens.inputPaddingBottom, function (
|
98
|
-
var hasHelper =
|
99
|
-
rows =
|
54
|
+
}, tokens.inputPaddingLeft, tokens.helpersPaddingTop, tokens.helpersPaddingBottom, tokens.helpersLineHeight, tokens.helpersOffset, tokens.inputPaddingBottom, function (_ref12) {
|
55
|
+
var hasHelper = _ref12.hasHelper,
|
56
|
+
rows = _ref12.rows;
|
100
57
|
return hasHelper && !rows ? 'var(--plasma_private-textarea-input-with-helpers-height)' : 'var(--plasma_private-textarea-input-without-helpers-height)';
|
101
58
|
}, tokens.inputFontFamily, tokens.inputFontSize, tokens.inputFontStyle, tokens.inputFontWeight, tokens.inputLetterSpacing, tokens.inputLineHeight, tokens.inputColorFocus, tokens.scrollbarWidth, tokens.scrollbarThumbBackgroundColor, tokens.scrollbarBorderWidth, tokens.scrollbarTrackBackgroundColor, tokens.scrollbarBorderWidth);
|
102
59
|
export var StyledHelpers = /*#__PURE__*/styled.div.withConfig({
|
103
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
60
|
+
componentId: "plasma-new-hope__sc-pxxv3p-6"
|
104
61
|
})(["box-sizing:border-box;display:flex;justify-content:space-between;transition:background-color 0.1s ease-in-out;background-color:var(", ");padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ");border-bottom-left-radius:var(", ");border-bottom-right-radius:var(", ");"], tokens.helpersBackgroundColor, tokens.helpersPaddingTop, tokens.helpersPaddingRight, tokens.helpersPaddingBottom, tokens.helpersPaddingLeft, tokens.borderRadius, tokens.borderRadius);
|
105
62
|
export var StyledLeftHelper = /*#__PURE__*/styled.span.withConfig({
|
106
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
63
|
+
componentId: "plasma-new-hope__sc-pxxv3p-7"
|
107
64
|
})(["", ";display:block;font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");color:var(", ");"], /*#__PURE__*/applyEllipsis(), tokens.helpersFontFamily, tokens.helpersFontSize, tokens.helpersFontStyle, tokens.helpersFontWeight, tokens.helpersLetterSpacing, tokens.helpersLineHeight, tokens.leftHelperColor);
|
108
65
|
export var StyledRightHelper = /*#__PURE__*/styled(StyledLeftHelper).withConfig({
|
109
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
66
|
+
componentId: "plasma-new-hope__sc-pxxv3p-8"
|
110
67
|
})(["color:var(", ");margin-left:auto;"], tokens.rightHelperColor);
|
111
68
|
export var StyledPlaceholder = /*#__PURE__*/styled.label.withConfig({
|
112
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
113
|
-
})(["box-sizing:border-box;position:absolute;pointer-events:none;display:inline-flex;align-items:center;transition:all 0.1s ease-in-out;transform-origin:top left;color:var(", ");width:100%;height:auto;top:var(", ");padding-left:var(", ");padding-right:", ";font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.placeholderColor, tokens.inputPaddingTop, tokens.inputPaddingLeft, function (
|
114
|
-
var hasContentRight =
|
69
|
+
componentId: "plasma-new-hope__sc-pxxv3p-9"
|
70
|
+
})(["box-sizing:border-box;position:absolute;pointer-events:none;display:inline-flex;align-items:center;transition:all 0.1s ease-in-out;transform-origin:top left;color:var(", ");width:100%;height:auto;top:var(", ");padding-left:var(", ");padding-right:", ";font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.placeholderColor, tokens.inputPaddingTop, tokens.inputPaddingLeft, function (_ref13) {
|
71
|
+
var hasContentRight = _ref13.hasContentRight;
|
115
72
|
return hasContentRight ? "var(".concat(tokens.inputPaddingRightWithRightContent, ")") : "var(".concat(tokens.inputPaddingRight, ")");
|
116
73
|
}, tokens.inputFontFamily, tokens.inputFontSize, tokens.inputFontStyle, tokens.inputFontWeight, tokens.inputLetterSpacing, tokens.inputLineHeight);
|
117
74
|
export var StyledIndicator = /*#__PURE__*/styled.div.withConfig({
|
118
|
-
componentId: "plasma-new-hope__sc-pxxv3p-
|
119
|
-
})(["position:absolute;border-radius:50%;background-color:var(", ");&.", "{width:var(", ");height:var(", ");inset:var(", ");&.align-right{inset:var(", ")
|
75
|
+
componentId: "plasma-new-hope__sc-pxxv3p-10"
|
76
|
+
})(["position:absolute;border-radius:50%;background-color:var(", ");&.", "{width:var(", ");height:var(", ");inset:var(", ");&.align-right{inset:var(", ");}}&.", "{width:var(", ");height:var(", ");inset:var(", ");&.align-right{inset:var(", ");}}"], tokens.indicatorColor, classes.outerLabelPlacement, tokens.indicatorSizeOuter, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementOuterRight, classes.innerLabelPlacement, tokens.indicatorSizeInner, tokens.indicatorSizeInner, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementInnerRight);
|
@@ -134,8 +134,7 @@ export function App() {
|
|
134
134
|
```
|
135
135
|
|
136
136
|
### Подсказка
|
137
|
-
Для вывода подсказки снизу от поля используйте свойство `leftHelper` и/или `rightHelper
|
138
|
-
для подсказки в виде Tooltip - `hasHint`, для подсказки сверху справа - `titleCaption`:
|
137
|
+
Для вывода подсказки снизу от поля используйте свойство `leftHelper` и/или `rightHelper`.
|
139
138
|
|
140
139
|
```tsx live
|
141
140
|
import React from 'react';
|
@@ -149,10 +148,6 @@ export function App() {
|
|
149
148
|
defaultValue="Значение"
|
150
149
|
leftHelper="Подсказка снизу слева"
|
151
150
|
rightHelper="Подсказка снизу справа"
|
152
|
-
hasHint
|
153
|
-
hintText="Подсказка в виде Tooltip"
|
154
|
-
hintView="default"
|
155
|
-
hintSize="m"
|
156
151
|
/>
|
157
152
|
</div>
|
158
153
|
);
|