@salutejs/plasma-new-hope 0.82.1-canary.1209.9162541836.0 → 0.83.0-canary.1194.9157747369.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/hooks/useFocusController.js +1 -0
- package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/cjs/components/Slider/Slider.css +69 -0
- package/cjs/components/Slider/Slider.js +48 -0
- package/cjs/components/Slider/Slider.js.map +1 -0
- package/cjs/components/Slider/Slider.tokens.js +79 -0
- package/cjs/components/Slider/Slider.tokens.js.map +1 -0
- package/cjs/components/Slider/components/Double/Double.css +62 -0
- package/cjs/components/Slider/components/Double/Double.js +288 -0
- package/cjs/components/Slider/components/Double/Double.js.map +1 -0
- package/cjs/components/Slider/components/Double/Double.styles.js +61 -0
- package/cjs/components/Slider/components/Double/Double.styles.js.map +1 -0
- package/cjs/components/Slider/components/Double/Double.styles_1jhda4u.css +7 -0
- package/cjs/components/Slider/components/Single/Single.css +16 -0
- package/cjs/components/Slider/components/Single/Single.js +164 -0
- package/cjs/components/Slider/components/Single/Single.js.map +1 -0
- package/cjs/components/Slider/components/Single/Single.styles.js +45 -0
- package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -0
- package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.css +4 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +82 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +33 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +4 -0
- package/cjs/components/Slider/ui/Handler/Handler.css +4 -0
- package/cjs/components/Slider/ui/Handler/Handler.js +174 -0
- package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -0
- package/cjs/components/Slider/ui/Handler/Handler.styles.js +21 -0
- package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -0
- package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.js +31 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +15 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
- package/cjs/components/Slider/utils/index.js +56 -0
- package/cjs/components/Slider/utils/index.js.map +1 -0
- package/cjs/components/Slider/variations/_disabled/base.js +9 -0
- package/cjs/components/Slider/variations/_disabled/base.js.map +1 -0
- package/cjs/components/Slider/variations/_disabled/base_x642ct.css +1 -0
- package/cjs/components/Slider/variations/_size/base.js +9 -0
- package/cjs/components/Slider/variations/_size/base.js.map +1 -0
- package/cjs/components/Slider/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Slider/variations/_view/base.js +9 -0
- package/cjs/components/Slider/variations/_view/base.js.map +1 -0
- package/cjs/components/Slider/variations/_view/base_x642ct.css +1 -0
- package/cjs/components/TextArea/TextArea.js +5 -7
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.tokens.js +0 -4
- package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
- package/cjs/components/TextArea/TextArea_qicm5y.css +1 -0
- package/cjs/components/TextField/TextField.js +12 -3
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/engines/common.js +4 -0
- package/cjs/engines/common.js.map +1 -1
- package/cjs/engines/index.js.map +1 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js +15 -0
- package/cjs/hooks/useIsomorphicLayoutEffect.js.map +1 -0
- package/cjs/index.css +26 -1
- package/cjs/index.js +14 -0
- package/cjs/index.js.map +1 -1
- package/cjs/utils/canUseDOM.js +12 -0
- package/cjs/utils/canUseDOM.js.map +1 -0
- package/cjs/utils/index.js.map +1 -1
- package/es/components/Combobox/hooks/useFocusController.js +1 -0
- package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/es/components/Slider/Slider.css +69 -0
- package/es/components/Slider/Slider.js +43 -0
- package/es/components/Slider/Slider.js.map +1 -0
- package/es/components/Slider/Slider.tokens.js +74 -0
- package/es/components/Slider/Slider.tokens.js.map +1 -0
- package/es/components/Slider/components/Double/Double.css +62 -0
- package/es/components/Slider/components/Double/Double.js +284 -0
- package/es/components/Slider/components/Double/Double.js.map +1 -0
- package/es/components/Slider/components/Double/Double.styles.js +51 -0
- package/es/components/Slider/components/Double/Double.styles.js.map +1 -0
- package/es/components/Slider/components/Double/Double.styles_1jhda4u.css +7 -0
- package/es/components/Slider/components/Single/Single.css +16 -0
- package/es/components/Slider/components/Single/Single.js +160 -0
- package/es/components/Slider/components/Single/Single.js.map +1 -0
- package/es/components/Slider/components/Single/Single.styles.js +36 -0
- package/es/components/Slider/components/Single/Single.styles.js.map +1 -0
- package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
- package/es/components/Slider/components/SliderBase/SliderBase.css +4 -0
- package/es/components/Slider/components/SliderBase/SliderBase.js +78 -0
- package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -0
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js +26 -0
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -0
- package/es/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +4 -0
- package/es/components/Slider/ui/Handler/Handler.css +4 -0
- package/es/components/Slider/ui/Handler/Handler.js +170 -0
- package/es/components/Slider/ui/Handler/Handler.js.map +1 -0
- package/es/components/Slider/ui/Handler/Handler.styles.js +16 -0
- package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -0
- package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
- package/es/components/Slider/ui/Thumb/Thumb.css +1 -0
- package/es/components/Slider/ui/Thumb/Thumb.js +27 -0
- package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -0
- package/es/components/Slider/ui/Thumb/Thumb.styles.js +11 -0
- package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -0
- package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
- package/es/components/Slider/utils/index.js +50 -0
- package/es/components/Slider/utils/index.js.map +1 -0
- package/es/components/Slider/variations/_disabled/base.js +5 -0
- package/es/components/Slider/variations/_disabled/base.js.map +1 -0
- package/es/components/Slider/variations/_disabled/base_x642ct.css +1 -0
- package/es/components/Slider/variations/_size/base.js +5 -0
- package/es/components/Slider/variations/_size/base.js.map +1 -0
- package/es/components/Slider/variations/_size/base_x642ct.css +1 -0
- package/es/components/Slider/variations/_view/base.js +5 -0
- package/es/components/Slider/variations/_view/base.js.map +1 -0
- package/es/components/Slider/variations/_view/base_x642ct.css +1 -0
- package/es/components/TextArea/TextArea.js +5 -7
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.tokens.js +0 -4
- package/es/components/TextArea/TextArea.tokens.js.map +1 -1
- package/es/components/TextArea/TextArea_qicm5y.css +1 -0
- package/es/components/TextField/TextField.js +12 -3
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/engines/common.js +4 -0
- package/es/engines/common.js.map +1 -1
- package/es/engines/index.js.map +1 -1
- package/es/hooks/useIsomorphicLayoutEffect.js +11 -0
- package/es/hooks/useIsomorphicLayoutEffect.js.map +1 -0
- package/es/index.css +26 -1
- package/es/index.js +8 -0
- package/es/index.js.map +1 -1
- package/es/utils/canUseDOM.js +8 -0
- package/es/utils/canUseDOM.js.map +1 -0
- package/es/utils/index.js.map +1 -1
- package/package.json +3 -2
- package/styled-components/cjs/components/Slider/Slider.js +47 -0
- package/styled-components/cjs/components/Slider/Slider.tokens.js +77 -0
- package/styled-components/cjs/components/Slider/Slider.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/Double/Double.js +300 -0
- package/styled-components/cjs/components/Slider/components/Double/Double.styles.js +36 -0
- package/styled-components/cjs/components/Slider/components/Double/Double.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/Single/Single.js +176 -0
- package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +27 -0
- package/styled-components/cjs/components/Slider/components/Single/Single.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +83 -0
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +21 -0
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/index.js +27 -0
- package/styled-components/cjs/components/Slider/index.js +32 -0
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +183 -0
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +15 -0
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.types.js +5 -0
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +32 -0
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +18 -0
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.types.js +5 -0
- package/styled-components/cjs/components/Slider/ui/index.js +63 -0
- package/styled-components/cjs/components/Slider/utils/index.js +55 -0
- package/styled-components/cjs/components/Slider/variations/_disabled/base.js +8 -0
- package/styled-components/cjs/components/Slider/variations/_disabled/tokens.json +4 -0
- package/styled-components/cjs/components/Slider/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/cjs/components/Slider/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/cjs/components/TextArea/TextArea.js +4 -6
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +0 -4
- package/styled-components/cjs/components/TextArea/mixins/applyDynamicLabel.js +1 -1
- package/styled-components/cjs/components/TextField/TextField.js +12 -3
- package/styled-components/cjs/engines/common.js +4 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +29 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.js +16 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +164 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +29 -0
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.js +16 -0
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +163 -0
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/cjs/hooks/index.js +8 -1
- package/styled-components/cjs/hooks/useIsomorphicLayoutEffect.js +12 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/cjs/utils/canUseDOM.js +11 -0
- package/styled-components/cjs/utils/index.js +7 -0
- package/styled-components/es/components/Slider/Slider.js +38 -0
- package/styled-components/es/components/Slider/Slider.tokens.js +71 -0
- package/styled-components/es/components/Slider/Slider.types.js +1 -0
- package/styled-components/es/components/Slider/components/Double/Double.js +292 -0
- package/styled-components/es/components/Slider/components/Double/Double.styles.js +29 -0
- package/styled-components/es/components/Slider/components/Double/Double.types.js +1 -0
- package/styled-components/es/components/Slider/components/Single/Single.js +168 -0
- package/styled-components/es/components/Slider/components/Single/Single.styles.js +20 -0
- package/styled-components/es/components/Slider/components/Single/Single.types.js +1 -0
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +74 -0
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +14 -0
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.types.js +1 -0
- package/styled-components/es/components/Slider/components/index.js +3 -0
- package/styled-components/es/components/Slider/index.js +3 -0
- package/styled-components/es/components/Slider/ui/Handler/Handler.js +174 -0
- package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +8 -0
- package/styled-components/es/components/Slider/ui/Handler/Handler.types.js +1 -0
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +25 -0
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +11 -0
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.types.js +1 -0
- package/styled-components/es/components/Slider/ui/index.js +5 -0
- package/styled-components/es/components/Slider/utils/index.js +47 -0
- package/styled-components/es/components/Slider/variations/_disabled/base.js +2 -0
- package/styled-components/es/components/Slider/variations/_disabled/tokens.json +4 -0
- package/styled-components/es/components/Slider/variations/_size/base.js +2 -0
- package/styled-components/es/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/es/components/Slider/variations/_view/base.js +2 -0
- package/styled-components/es/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/es/components/TextArea/TextArea.js +4 -6
- package/styled-components/es/components/TextArea/TextArea.tokens.js +0 -4
- package/styled-components/es/components/TextArea/mixins/applyDynamicLabel.js +1 -1
- package/styled-components/es/components/TextField/TextField.js +12 -3
- package/styled-components/es/engines/common.js +4 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +23 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.js +10 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +164 -0
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +23 -0
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.js +10 -0
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +163 -0
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/es/hooks/index.js +2 -1
- package/styled-components/es/hooks/useIsomorphicLayoutEffect.js +7 -0
- package/styled-components/es/index.js +2 -1
- package/styled-components/es/utils/canUseDOM.js +5 -0
- package/styled-components/es/utils/index.js +1 -0
- package/types/components/Slider/Slider.d.ts +27 -0
- package/types/components/Slider/Slider.d.ts.map +1 -0
- package/types/components/Slider/Slider.tokens.d.ts +72 -0
- package/types/components/Slider/Slider.tokens.d.ts.map +1 -0
- package/types/components/Slider/Slider.types.d.ts +3 -0
- package/types/components/Slider/Slider.types.d.ts.map +1 -0
- package/types/components/Slider/components/Double/Double.d.ts +4 -0
- package/types/components/Slider/components/Double/Double.d.ts.map +1 -0
- package/types/components/Slider/components/Double/Double.styles.d.ts +43 -0
- package/types/components/Slider/components/Double/Double.styles.d.ts.map +1 -0
- package/types/components/Slider/components/Double/Double.types.d.ts +65 -0
- package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -0
- package/types/components/Slider/components/Single/Single.d.ts +4 -0
- package/types/components/Slider/components/Single/Single.d.ts.map +1 -0
- package/types/components/Slider/components/Single/Single.styles.d.ts +8 -0
- package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -0
- package/types/components/Slider/components/Single/Single.types.d.ts +55 -0
- package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -0
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts +4 -0
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -0
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +6 -0
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -0
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +45 -0
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -0
- package/types/components/Slider/components/index.d.ts +6 -0
- package/types/components/Slider/components/index.d.ts.map +1 -0
- package/types/components/Slider/index.d.ts +6 -0
- package/types/components/Slider/index.d.ts.map +1 -0
- package/types/components/Slider/ui/Handler/Handler.d.ts +9 -0
- package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -0
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts +4 -0
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -0
- package/types/components/Slider/ui/Handler/Handler.types.d.ts +24 -0
- package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.d.ts +4 -0
- package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts +5 -0
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +12 -0
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -0
- package/types/components/Slider/ui/index.d.ts +6 -0
- package/types/components/Slider/ui/index.d.ts.map +1 -0
- package/types/components/Slider/utils/index.d.ts +33 -0
- package/types/components/Slider/utils/index.d.ts.map +1 -0
- package/types/components/Slider/variations/_disabled/base.d.ts +2 -0
- package/types/components/Slider/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/Slider/variations/_size/base.d.ts +2 -0
- package/types/components/Slider/variations/_size/base.d.ts.map +1 -0
- package/types/components/Slider/variations/_view/base.d.ts +2 -0
- package/types/components/Slider/variations/_view/base.d.ts.map +1 -0
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +0 -4
- package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
- package/types/components/TextArea/mixins/applyDynamicLabel.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/engines/common.d.ts +3 -3
- package/types/engines/common.d.ts.map +1 -1
- package/types/engines/index.d.ts +1 -1
- package/types/engines/index.d.ts.map +1 -1
- package/types/engines/types.d.ts +4 -0
- package/types/engines/types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts +22 -0
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +21 -0
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts +22 -0
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Slider/Slider.d.ts +21 -0
- package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -0
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/index.d.ts.map +1 -1
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +6 -0
- package/types/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/utils/canUseDOM.d.ts +6 -0
- package/types/utils/canUseDOM.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/TextArea/TextArea_ob9y3r.css +0 -1
- package/es/components/TextArea/TextArea_ob9y3r.css +0 -1
@@ -0,0 +1,56 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Расчитать значение слайдера с учетом его координат и шага изменений.
|
7
|
+
* @param {number} handleCenterXRelative
|
8
|
+
* @param {number} stepSize
|
9
|
+
* @param {number} min
|
10
|
+
* @param {number} max
|
11
|
+
* @return {number}
|
12
|
+
*/
|
13
|
+
function getSliderThumbValue(handleCenterXRelative, stepSize, min, max) {
|
14
|
+
var newValue = Math.round(handleCenterXRelative / stepSize) + min;
|
15
|
+
return Math.min(Math.max(newValue, min), max);
|
16
|
+
}
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Расчитывает значение отступа слайдера на основе его положения (справа, слева) на отрезке слайдера.
|
20
|
+
* Значение используется для правильного расчета ограничения движения слайдера.
|
21
|
+
* @param ref
|
22
|
+
* @param {'left' | 'right'} side
|
23
|
+
* @return Array<number>
|
24
|
+
*/
|
25
|
+
function getOffsets(ref, side) {
|
26
|
+
if (!ref || !('current' in ref) || !ref.current || !side) {
|
27
|
+
return [0, 0];
|
28
|
+
}
|
29
|
+
var size = ref.current.clientWidth;
|
30
|
+
if (side === 'left') {
|
31
|
+
return [0, size];
|
32
|
+
}
|
33
|
+
if (side === 'right') {
|
34
|
+
return [size, 0];
|
35
|
+
}
|
36
|
+
return [0, 0];
|
37
|
+
}
|
38
|
+
var sizeData = {
|
39
|
+
s: {
|
40
|
+
indent: 0.5,
|
41
|
+
fontSizeMultiplier: 16
|
42
|
+
},
|
43
|
+
m: {
|
44
|
+
indent: 0.75,
|
45
|
+
fontSizeMultiplier: 16
|
46
|
+
},
|
47
|
+
l: {
|
48
|
+
indent: 0.75,
|
49
|
+
fontSizeMultiplier: 16
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
exports.getOffsets = getOffsets;
|
54
|
+
exports.getSliderThumbValue = getSliderThumbValue;
|
55
|
+
exports.sizeData = sizeData;
|
56
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Slider/utils/index.ts"],"sourcesContent":["import { MutableRefObject } from 'react';\n\n/**\n * Расчитать значение слайдера с учетом его координат и шага изменений.\n * @param {number} handleCenterXRelative\n * @param {number} stepSize\n * @param {number} min\n * @param {number} max\n * @return {number}\n */\nexport function getSliderThumbValue(handleCenterXRelative: number, stepSize: number, min: number, max: number) {\n const newValue = Math.round(handleCenterXRelative / stepSize) + min;\n\n return Math.min(Math.max(newValue, min), max);\n}\n\n/**\n * Расчитывает значение отступа слайдера на основе его положения (справа, слева) на отрезке слайдера.\n * Значение используется для правильного расчета ограничения движения слайдера.\n * @param ref\n * @param {'left' | 'right'} side\n * @return Array<number>\n */\nexport function getOffsets(\n ref: ((instance: HTMLDivElement | null) => void) | MutableRefObject<HTMLDivElement | null> | null,\n side?: 'left' | 'right',\n): number[] {\n if (!ref || !('current' in ref) || !ref.current || !side) {\n return [0, 0];\n }\n\n const size = ref.current.clientWidth;\n\n if (side === 'left') {\n return [0, size];\n }\n\n if (side === 'right') {\n return [size, 0];\n }\n\n return [0, 0];\n}\n\nexport const sizeData = {\n s: {\n indent: 0.5,\n fontSizeMultiplier: 16,\n },\n m: {\n indent: 0.75,\n fontSizeMultiplier: 16,\n },\n l: {\n indent: 0.75,\n fontSizeMultiplier: 16,\n },\n};\n"],"names":["getSliderThumbValue","handleCenterXRelative","stepSize","min","max","newValue","Math","round","getOffsets","ref","side","current","size","clientWidth","sizeData","s","indent","fontSizeMultiplier","m","l"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAmBA,CAACC,qBAA6B,EAAEC,QAAgB,EAAEC,GAAW,EAAEC,GAAW,EAAE;EAC3G,IAAMC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACN,qBAAqB,GAAGC,QAAQ,CAAC,GAAGC,GAAG,CAAA;AAEnE,EAAA,OAAOG,IAAI,CAACH,GAAG,CAACG,IAAI,CAACF,GAAG,CAACC,QAAQ,EAAEF,GAAG,CAAC,EAAEC,GAAG,CAAC,CAAA;AACjD,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,UAAUA,CACtBC,GAAiG,EACjGC,IAAuB,EACf;AACR,EAAA,IAAI,CAACD,GAAG,IAAI,EAAE,SAAS,IAAIA,GAAG,CAAC,IAAI,CAACA,GAAG,CAACE,OAAO,IAAI,CAACD,IAAI,EAAE;AACtD,IAAA,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjB,GAAA;AAEA,EAAA,IAAME,IAAI,GAAGH,GAAG,CAACE,OAAO,CAACE,WAAW,CAAA;EAEpC,IAAIH,IAAI,KAAK,MAAM,EAAE;AACjB,IAAA,OAAO,CAAC,CAAC,EAAEE,IAAI,CAAC,CAAA;AACpB,GAAA;EAEA,IAAIF,IAAI,KAAK,OAAO,EAAE;AAClB,IAAA,OAAO,CAACE,IAAI,EAAE,CAAC,CAAC,CAAA;AACpB,GAAA;AAEA,EAAA,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjB,CAAA;AAEO,IAAME,QAAQ,GAAG;AACpBC,EAAAA,CAAC,EAAE;AACCC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,kBAAkB,EAAE,EAAA;GACvB;AACDC,EAAAA,CAAC,EAAE;AACCF,IAAAA,MAAM,EAAE,IAAI;AACZC,IAAAA,kBAAkB,EAAE,EAAA;GACvB;AACDE,EAAAA,CAAC,EAAE;AACCH,IAAAA,MAAM,EAAE,IAAI;AACZC,IAAAA,kBAAkB,EAAE,EAAA;AACxB,GAAA;AACJ;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_disabled/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":";;;;AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_size/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":";;;;AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_view/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":";;;;AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import './
|
1
|
+
import './TextArea_qicm5y.css';
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
@@ -40,17 +40,16 @@ var getDynamicLabelClasses = function getDynamicLabelClasses(props, focused) {
|
|
40
40
|
labelPlacement = props.labelPlacement,
|
41
41
|
autoResize = props.autoResize,
|
42
42
|
rows = props.rows,
|
43
|
-
value = props.value
|
44
|
-
size = props.size;
|
43
|
+
value = props.value;
|
45
44
|
|
46
45
|
// Добавить класс отвечающий за изменение цвета плейсхолдера при фокусе
|
47
46
|
var withFocusedOuterUpPlaceholder = !readOnly && focused && (!label || labelPlacement === 'outer') ? focusedOuterPlaceholderColor : undefined;
|
48
47
|
|
49
48
|
// Добавить класс отвечающий за поднятие и уменьшение плейсхолдера
|
50
|
-
var withInnerPlaceholderUp = labelPlacement === 'inner' && label && !autoResize && !rows &&
|
49
|
+
var withInnerPlaceholderUp = labelPlacement === 'inner' && label && !autoResize && !rows && (!readOnly && (value || focused) || readOnly && value) ? innerPlaceholderUp : undefined;
|
51
50
|
|
52
51
|
// Добавить класс отвечающий за скрытие плейсхолдера
|
53
|
-
var withHidePlaceholder = value && !label || labelPlacement === 'inner' && (focused && !readOnly || value) && label && (rows || autoResize) || labelPlacement === 'outer' && value
|
52
|
+
var withHidePlaceholder = value && !label || labelPlacement === 'inner' && (focused && !readOnly || value) && label && (rows || autoResize) || labelPlacement === 'outer' && value ? hidePlaceHolder : undefined;
|
54
53
|
return [withFocusedOuterUpPlaceholder, withInnerPlaceholderUp, withHidePlaceholder];
|
55
54
|
};
|
56
55
|
var textAreaRoot = function textAreaRoot(Root) {
|
@@ -102,7 +101,7 @@ var textAreaRoot = function textAreaRoot(Root) {
|
|
102
101
|
var overriddenView = status !== undefined ? fallbackStatusMap[status] : view;
|
103
102
|
var textareaHelperId = id ? "".concat(id, "-helper") : undefined;
|
104
103
|
var applyCustomWidth = resize !== 'horizontal' && resize !== 'both' && !cols;
|
105
|
-
var placeLabel = labelPlacement === 'inner' && label
|
104
|
+
var placeLabel = labelPlacement === 'inner' && label ? label : placeholder;
|
106
105
|
plasmaCore.useResizeObserver(outerRef, function (currentElement) {
|
107
106
|
var _currentElement$style = currentElement.style,
|
108
107
|
inlineWidth = _currentElement$style.width,
|
@@ -128,7 +127,6 @@ var textAreaRoot = function textAreaRoot(Root) {
|
|
128
127
|
onChange === null || onChange === void 0 || onChange(event);
|
129
128
|
}, [value, onChange]);
|
130
129
|
var dynamicLabelClasses = getDynamicLabelClasses({
|
131
|
-
size: size,
|
132
130
|
readOnly: readOnly,
|
133
131
|
label: label,
|
134
132
|
labelPlacement: labelPlacement,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import React, { forwardRef, useState, createRef, useCallback } from 'react';\nimport { css } from '@linaria/core';\nimport { useResizeObserver } from '@salutejs/plasma-core';\n\nimport { cx } from '../../utils';\nimport type { RootProps } from '../../engines/types';\n\nimport { applyDynamicLabel } from './mixins';\nimport { useAutoResize, ROOT_FONT_SIZE } from './hooks';\nimport {\n StyledContent,\n StyledHelpers,\n StyledLeftHelper,\n StyledRightHelper,\n StyledLabel,\n StyledPlaceholder,\n StyledTextArea,\n StyledTextAreaWrapper,\n StyledContainer,\n} from './TextArea.styles';\nimport { classes } from './TextArea.tokens';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport type { TextAreaProps } from './TextArea.types';\n\nconst {\n innerPlaceholderUp,\n focusedOuterPlaceholderColor,\n hidePlaceHolder,\n styledContainer,\n styledTextArea,\n styledTextAreaWrapper,\n styledPlaceholder,\n styledHelpers,\n} = classes;\n\nconst base = css`\n ${applyDynamicLabel};\n\n position: relative;\n box-sizing: border-box;\n`;\n\n// TODO: Удалить после отказа от старых библиотек plasma-web / plasma-b2c\nconst fallbackStatusMap = {\n '': 'primary',\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\n\n// TODO: Перенести этот метод в файл applyDynamicLabel.ts\nexport const getDynamicLabelClasses = (props: TextAreaProps, focused: boolean) => {\n const { readOnly, label, labelPlacement, autoResize, rows, value, size } = props;\n\n // Добавить класс отвечающий за изменение цвета плейсхолдера при фокусе\n const withFocusedOuterUpPlaceholder =\n !readOnly && focused && (!label || labelPlacement === 'outer') ? focusedOuterPlaceholderColor : undefined;\n\n // Добавить класс отвечающий за поднятие и уменьшение плейсхолдера\n const withInnerPlaceholderUp =\n labelPlacement === 'inner' &&\n label &&\n !autoResize &&\n !rows &&\n size !== 'xs' &&\n ((!readOnly && (value || focused)) || (readOnly && value))\n ? innerPlaceholderUp\n : undefined;\n\n // Добавить класс отвечающий за скрытие плейсхолдера\n const withHidePlaceholder =\n (value && !label) ||\n (labelPlacement === 'inner' && ((focused && !readOnly) || value) && label && (rows || autoResize)) ||\n (labelPlacement === 'outer' && value) ||\n (labelPlacement === 'inner' && size === 'xs' && value)\n ? hidePlaceHolder\n : undefined;\n\n return [withFocusedOuterUpPlaceholder, withInnerPlaceholderUp, withHidePlaceholder];\n};\n\nexport const textAreaRoot = (Root: RootProps<HTMLTextAreaElement, TextAreaProps>) =>\n forwardRef<HTMLTextAreaElement, TextAreaProps>((props, innerRef) => {\n const {\n helperText,\n status,\n resize,\n rightHelper,\n leftHelper,\n contentRight,\n autoResize = false,\n minAuto = 0,\n maxAuto,\n label,\n labelPlacement = 'inner',\n placeholder,\n defaultValue,\n height,\n width,\n value,\n disabled,\n size,\n view,\n id,\n style,\n className,\n readOnly,\n rows,\n cols,\n onChange,\n ...rest\n } = props;\n\n const [helperWidth, setHelperWidth] = useState<string>(width ? `${width}rem` : '100%');\n const [focused, setFocused] = useState(false);\n const [uncontrolledValue, setUncontrolledValue] = useState<string | undefined>();\n\n const outerRef = innerRef && 'current' in innerRef ? innerRef : createRef<HTMLTextAreaElement>();\n const hasHelper = Boolean(leftHelper || rightHelper || helperText);\n const overriddenView = status !== undefined ? fallbackStatusMap[status] : view;\n const textareaHelperId = id ? `${id}-helper` : undefined;\n const applyCustomWidth = resize !== 'horizontal' && resize !== 'both' && !cols;\n const placeLabel = labelPlacement === 'inner' && label && size !== 'xs' ? label : placeholder;\n\n useResizeObserver(outerRef, (currentElement) => {\n const { width: inlineWidth, height: inlineHeight } = currentElement.style;\n\n if (inlineWidth || inlineHeight || cols) {\n const { width: elementWidth } = currentElement.getBoundingClientRect();\n setHelperWidth(`${elementWidth / ROOT_FONT_SIZE}rem`);\n }\n });\n\n useAutoResize(autoResize, outerRef, value, minAuto, maxAuto);\n\n const onFocusHandler = useCallback(() => {\n setFocused(true);\n }, []);\n const onBlurHandler = useCallback(() => {\n setFocused(false);\n }, []);\n\n const onChangeHandler = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n // INFO: Для крайне редких кейсов, когда value снаружи не контролируется\n if (value === undefined) {\n setUncontrolledValue(event?.target.value);\n }\n\n onChange?.(event);\n },\n [value, onChange],\n );\n\n const dynamicLabelClasses = getDynamicLabelClasses(\n {\n size,\n readOnly,\n label,\n labelPlacement,\n autoResize,\n rows,\n value: value || uncontrolledValue || defaultValue,\n },\n focused,\n );\n\n return (\n <Root\n view={overriddenView}\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n style={style}\n className={className}\n >\n {label && labelPlacement === 'outer' && <StyledLabel>{label}</StyledLabel>}\n <StyledContainer\n className={cx(styledContainer, ...dynamicLabelClasses)}\n width={helperWidth}\n onFocus={onFocusHandler}\n onBlur={onBlurHandler}\n >\n {contentRight && <StyledContent>{contentRight}</StyledContent>}\n <StyledTextAreaWrapper className={styledTextAreaWrapper} hasHelper={hasHelper}>\n <StyledTextArea\n className={styledTextArea}\n id={id}\n hasContentRight={Boolean(contentRight)}\n hasHelper={hasHelper}\n applyCustomWidth={applyCustomWidth}\n ref={outerRef}\n disabled={disabled}\n height={autoResize ? minAuto : height}\n width={width}\n placeholder={placeLabel}\n aria-describedby={textareaHelperId}\n value={value}\n readOnly={readOnly}\n rows={rows}\n cols={cols}\n resize={resize}\n defaultValue={defaultValue}\n onChange={onChangeHandler}\n {...rest}\n />\n </StyledTextAreaWrapper>\n {hasHelper && (\n <StyledHelpers className={styledHelpers} id={textareaHelperId}>\n {(leftHelper || helperText) && (\n <StyledLeftHelper>{leftHelper || helperText}</StyledLeftHelper>\n )}\n {rightHelper && <StyledRightHelper>{rightHelper}</StyledRightHelper>}\n </StyledHelpers>\n )}\n {placeLabel && (\n <StyledPlaceholder\n hasContentRight={Boolean(contentRight)}\n className={styledPlaceholder}\n htmlFor={id}\n >\n {placeLabel}\n </StyledPlaceholder>\n )}\n </StyledContainer>\n </Root>\n );\n });\n\nexport const textAreaConfig = {\n name: 'TextArea',\n tag: 'div',\n layout: textAreaRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'primary',\n },\n};\n"],"names":["innerPlaceholderUp","classes","focusedOuterPlaceholderColor","hidePlaceHolder","styledContainer","styledTextArea","styledTextAreaWrapper","styledPlaceholder","styledHelpers","base","fallbackStatusMap","success","warning","error","getDynamicLabelClasses","props","focused","readOnly","label","labelPlacement","autoResize","rows","value","size","withFocusedOuterUpPlaceholder","undefined","withInnerPlaceholderUp","withHidePlaceholder","textAreaRoot","Root","forwardRef","innerRef","helperText","status","resize","rightHelper","leftHelper","contentRight","_props$autoResize","_props$minAuto","minAuto","maxAuto","_props$labelPlacement","placeholder","defaultValue","height","width","disabled","view","id","style","className","cols","onChange","rest","_excluded","_useState","useState","concat","_useState2","_slicedToArray","helperWidth","setHelperWidth","_useState3","_useState4","setFocused","_useState5","_useState6","uncontrolledValue","setUncontrolledValue","outerRef","createRef","hasHelper","Boolean","overriddenView","textareaHelperId","applyCustomWidth","placeLabel","useResizeObserver","currentElement","_currentElement$style","inlineWidth","inlineHeight","_currentElement$getBo","getBoundingClientRect","elementWidth","ROOT_FONT_SIZE","useAutoResize","onFocusHandler","useCallback","onBlurHandler","onChangeHandler","event","target","dynamicLabelClasses","React","createElement","StyledLabel","StyledContainer","cx","apply","_toConsumableArray","onFocus","onBlur","StyledContent","StyledTextAreaWrapper","StyledTextArea","_extends","hasContentRight","ref","StyledHelpers","StyledLeftHelper","StyledRightHelper","StyledPlaceholder","htmlFor","textAreaConfig","name","tag","layout","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;;;;;;;;;AA0BA,IACIA,kBAAkB,GAQlBC,uBAAO,CARPD,kBAAkB;EAClBE,4BAA4B,GAO5BD,uBAAO,CAPPC,4BAA4B;EAC5BC,eAAe,GAMfF,uBAAO,CANPE,eAAe;EACfC,eAAe,GAKfH,uBAAO,CALPG,eAAe;EACfC,cAAc,GAIdJ,uBAAO,CAJPI,cAAc;EACdC,qBAAqB,GAGrBL,uBAAO,CAHPK,qBAAqB;EACrBC,iBAAiB,GAEjBN,uBAAO,CAFPM,iBAAiB;EACjBC,aAAAA,GACAP,uBAAO,CADPO,aAAAA,CAAAA;AAGJ,IAAMC,IAAI,GAKT,SAAA,CAAA;;AAED;AACA,IAAMC,iBAAiB,GAAG;AACtB,EAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,OAAO,EAAE,UAAU;AACnBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,UAAA;AACX,CAAC,CAAA;;AAED;AACO,IAAMC,sBAAsB,GAAGA,SAAzBA,sBAAsBA,CAAIC,KAAoB,EAAEC,OAAgB,EAAK;AAC9E,EAAA,IAAQC,QAAQ,GAA2DF,KAAK,CAAxEE,QAAQ;IAAEC,KAAK,GAAoDH,KAAK,CAA9DG,KAAK;IAAEC,cAAc,GAAoCJ,KAAK,CAAvDI,cAAc;IAAEC,UAAU,GAAwBL,KAAK,CAAvCK,UAAU;IAAEC,IAAI,GAAkBN,KAAK,CAA3BM,IAAI;IAAEC,KAAK,GAAWP,KAAK,CAArBO,KAAK;IAAEC,IAAAA,GAASR,KAAK,CAAdQ,IAAAA,CAAAA;;AAElE;AACA,EAAA,IAAMC,6BAA6B,GAC/B,CAACP,QAAQ,IAAID,OAAO,KAAK,CAACE,KAAK,IAAIC,cA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EAAA;AACdL,MAAAA,eAAe,EAAEnC,OAAO,CAACpC,YAAY,CAAE;AACvCc,MAAAA,SAAS,EAAE5C,iBAAkB;AAC7B2G,MAAAA,OAAO,EAAEjE,EAAAA;KAER4B,EAAAA,UACc,CAEV,CACf,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMsC,cAAc,GAAG;AAC1BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE1F,YAAY;AACpBnB,EAAAA,IAAI,EAAJA,IAAI;AACJ8G,EAAAA,UAAU,EAAE;AACRhG,IAAAA,IAAI,EAAE;AACFiG,MAAAA,GAAG,EAAEC,WAAAA;KACR;AACDzE,IAAAA,IAAI,EAAE;AACFwE,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACD3E,IAAAA,QAAQ,EAAE;AACNyE,MAAAA,GAAG,EAAEG,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACD3G,IAAAA,QAAQ,EAAE;AACN2G,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtG,IAAAA,IAAI,EAAE,GAAG;AACTyB,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;;"}
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import React, { forwardRef, useState, createRef, useCallback } from 'react';\nimport { css } from '@linaria/core';\nimport { useResizeObserver } from '@salutejs/plasma-core';\n\nimport { cx } from '../../utils';\nimport type { RootProps } from '../../engines/types';\n\nimport { applyDynamicLabel } from './mixins';\nimport { useAutoResize, ROOT_FONT_SIZE } from './hooks';\nimport {\n StyledContent,\n StyledHelpers,\n StyledLeftHelper,\n StyledRightHelper,\n StyledLabel,\n StyledPlaceholder,\n StyledTextArea,\n StyledTextAreaWrapper,\n StyledContainer,\n} from './TextArea.styles';\nimport { classes } from './TextArea.tokens';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport type { TextAreaProps } from './TextArea.types';\n\nconst {\n innerPlaceholderUp,\n focusedOuterPlaceholderColor,\n hidePlaceHolder,\n styledContainer,\n styledTextArea,\n styledTextAreaWrapper,\n styledPlaceholder,\n styledHelpers,\n} = classes;\n\nconst base = css`\n ${applyDynamicLabel};\n\n position: relative;\n box-sizing: border-box;\n`;\n\n// TODO: Удалить после отказа от старых библиотек plasma-web / plasma-b2c\nconst fallbackStatusMap = {\n '': 'primary',\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\n\n// TODO: Перенести этот метод в файл applyDynamicLabel.ts\nexport const getDynamicLabelClasses = (props: TextAreaProps, focused: boolean) => {\n const { readOnly, label, labelPlacement, autoResize, rows, value } = props;\n\n // Добавить класс отвечающий за изменение цвета плейсхолдера при фокусе\n const withFocusedOuterUpPlaceholder =\n !readOnly && focused && (!label || labelPlacement === 'outer') ? focusedOuterPlaceholderColor : undefined;\n\n // Добавить класс отвечающий за поднятие и уменьшение плейсхолдера\n const withInnerPlaceholderUp =\n labelPlacement === 'inner' &&\n label &&\n !autoResize &&\n !rows &&\n ((!readOnly && (value || focused)) || (readOnly && value))\n ? innerPlaceholderUp\n : undefined;\n\n // Добавить класс отвечающий за скрытие плейсхолдера\n const withHidePlaceholder =\n (value && !label) ||\n (labelPlacement === 'inner' && ((focused && !readOnly) || value) && label && (rows || autoResize)) ||\n (labelPlacement === 'outer' && value)\n ? hidePlaceHolder\n : undefined;\n\n return [withFocusedOuterUpPlaceholder, withInnerPlaceholderUp, withHidePlaceholder];\n};\n\nexport const textAreaRoot = (Root: RootProps<HTMLTextAreaElement, TextAreaProps>) =>\n forwardRef<HTMLTextAreaElement, TextAreaProps>((props, innerRef) => {\n const {\n helperText,\n status,\n resize,\n rightHelper,\n leftHelper,\n contentRight,\n autoResize = false,\n minAuto = 0,\n maxAuto,\n label,\n labelPlacement = 'inner',\n placeholder,\n defaultValue,\n height,\n width,\n value,\n disabled,\n size,\n view,\n id,\n style,\n className,\n readOnly,\n rows,\n cols,\n onChange,\n ...rest\n } = props;\n\n const [helperWidth, setHelperWidth] = useState<string>(width ? `${width}rem` : '100%');\n const [focused, setFocused] = useState(false);\n const [uncontrolledValue, setUncontrolledValue] = useState<string | undefined>();\n\n const outerRef = innerRef && 'current' in innerRef ? innerRef : createRef<HTMLTextAreaElement>();\n const hasHelper = Boolean(leftHelper || rightHelper || helperText);\n const overriddenView = status !== undefined ? fallbackStatusMap[status] : view;\n const textareaHelperId = id ? `${id}-helper` : undefined;\n const applyCustomWidth = resize !== 'horizontal' && resize !== 'both' && !cols;\n const placeLabel = labelPlacement === 'inner' && label ? label : placeholder;\n\n useResizeObserver(outerRef, (currentElement) => {\n const { width: inlineWidth, height: inlineHeight } = currentElement.style;\n\n if (inlineWidth || inlineHeight || cols) {\n const { width: elementWidth } = currentElement.getBoundingClientRect();\n setHelperWidth(`${elementWidth / ROOT_FONT_SIZE}rem`);\n }\n });\n\n useAutoResize(autoResize, outerRef, value, minAuto, maxAuto);\n\n const onFocusHandler = useCallback(() => {\n setFocused(true);\n }, []);\n const onBlurHandler = useCallback(() => {\n setFocused(false);\n }, []);\n\n const onChangeHandler = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n // INFO: Для крайне редких кейсов, когда value снаружи не контролируется\n if (value === undefined) {\n setUncontrolledValue(event?.target.value);\n }\n\n onChange?.(event);\n },\n [value, onChange],\n );\n\n const dynamicLabelClasses = getDynamicLabelClasses(\n { readOnly, label, labelPlacement, autoResize, rows, value: value || uncontrolledValue || defaultValue },\n focused,\n );\n\n return (\n <Root\n view={overriddenView}\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n style={style}\n className={className}\n >\n {label && labelPlacement === 'outer' && <StyledLabel>{label}</StyledLabel>}\n <StyledContainer\n className={cx(styledContainer, ...dynamicLabelClasses)}\n width={helperWidth}\n onFocus={onFocusHandler}\n onBlur={onBlurHandler}\n >\n {contentRight && <StyledContent>{contentRight}</StyledContent>}\n <StyledTextAreaWrapper className={styledTextAreaWrapper} hasHelper={hasHelper}>\n <StyledTextArea\n className={styledTextArea}\n id={id}\n hasContentRight={Boolean(contentRight)}\n hasHelper={hasHelper}\n applyCustomWidth={applyCustomWidth}\n ref={outerRef}\n disabled={disabled}\n height={autoResize ? minAuto : height}\n width={width}\n placeholder={placeLabel}\n aria-describedby={textareaHelperId}\n value={value}\n readOnly={readOnly}\n rows={rows}\n cols={cols}\n resize={resize}\n defaultValue={defaultValue}\n onChange={onChangeHandler}\n {...rest}\n />\n </StyledTextAreaWrapper>\n {hasHelper && (\n <StyledHelpers className={styledHelpers} id={textareaHelperId}>\n {(leftHelper || helperText) && (\n <StyledLeftHelper>{leftHelper || helperText}</StyledLeftHelper>\n )}\n {rightHelper && <StyledRightHelper>{rightHelper}</StyledRightHelper>}\n </StyledHelpers>\n )}\n {placeLabel && (\n <StyledPlaceholder\n hasContentRight={Boolean(contentRight)}\n className={styledPlaceholder}\n htmlFor={id}\n >\n {placeLabel}\n </StyledPlaceholder>\n )}\n </StyledContainer>\n </Root>\n );\n });\n\nexport const textAreaConfig = {\n name: 'TextArea',\n tag: 'div',\n layout: textAreaRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'primary',\n },\n};\n"],"names":["innerPlaceholderUp","classes","focusedOuterPlaceholderColor","hidePlaceHolder","styledContainer","styledTextArea","styledTextAreaWrapper","styledPlaceholder","styledHelpers","base","fallbackStatusMap","success","warning","error","getDynamicLabelClasses","props","focused","readOnly","label","labelPlacement","autoResize","rows","value","withFocusedOuterUpPlaceholder","undefined","withInnerPlaceholderUp","withHidePlaceholder","textAreaRoot","Root","forwardRef","innerRef","helperText","status","resize","rightHelper","leftHelper","contentRight","_props$autoResize","_props$minAuto","minAuto","maxAuto","_props$labelPlacement","placeholder","defaultValue","height","width","disabled","size","view","id","style","className","cols","onChange","rest","_excluded","_useState","useState","concat","_useState2","_slicedToArray","helperWidth","setHelperWidth","_useState3","_useState4","setFocused","_useState5","_useState6","uncontrolledValue","setUncontrolledValue","outerRef","createRef","hasHelper","Boolean","overriddenView","textareaHelperId","applyCustomWidth","placeLabel","useResizeObserver","currentElement","_currentElement$style","inlineWidth","inlineHeight","_currentElement$getBo","getBoundingClientRect","elementWidth","ROOT_FONT_SIZE","useAutoResize","onFocusHandler","useCallback","onBlurHandler","onChangeHandler","event","target","dynamicLabelClasses","React","createElement","StyledLabel","StyledContainer","cx","apply","_toConsumableArray","onFocus","onBlur","StyledContent","StyledTextAreaWrapper","StyledTextArea","_extends","hasContentRight","ref","StyledHelpers","StyledLeftHelper","StyledRightHelper","StyledPlaceholder","htmlFor","textAreaConfig","name","tag","layout","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;;;;;;;;;AA0BA,IACIA,kBAAkB,GAQlBC,uBAAO,CARPD,kBAAkB;EAClBE,4BAA4B,GAO5BD,uBAAO,CAPPC,4BAA4B;EAC5BC,eAAe,GAMfF,uBAAO,CANPE,eAAe;EACfC,eAAe,GAKfH,uBAAO,CALPG,eAAe;EACfC,cAAc,GAIdJ,uBAAO,CAJPI,cAAc;EACdC,qBAAqB,GAGrBL,uBAAO,CAHPK,qBAAqB;EACrBC,iBAAiB,GAEjBN,uBAAO,CAFPM,iBAAiB;EACjBC,aAAAA,GACAP,uBAAO,CADPO,aAAAA,CAAAA;AAGJ,IAAMC,IAAI,GAKT,SAAA,CAAA;;AAED;AACA,IAAMC,iBAAiB,GAAG;AACtB,EAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,OAAO,EAAE,UAAU;AACnBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,UAAA;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area-label-inner-letter-spacing',
|
120
120
|
/** Высота строки для элемента label, когда он внутри и уменьшен */
|
121
121
|
labelInnerLineHeight: '--plasma-textarea-label-inner-line-height',
|
122
|
-
/** Отступ сверху для элемента textarea при фокусе */
|
123
|
-
labelInnerTop: '--plasma-textarea-label-inner-top',
|
124
|
-
/** Отступ между Label и TextArea */
|
125
|
-
labelInnerMarginBottom: '--plasma-textarea-label-inner-margin-bottom',
|
126
122
|
/** Шрифт для элемента textarea */
|
127
123
|
inputFontFamily: '--plasma-textarea-input-font-family',
|
128
124
|
/** Размер шрифта для элемента textarea */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextArea.tokens.js","sources":["../../../src/components/TextArea/TextArea.tokens.ts"],"sourcesContent":["export const classes = {\n /** Класс отвечающий за поднятие и уменьшение плейсхолдера */\n innerPlaceholderUp: 'inner-placeholder-up',\n /** Класс отвечающий за изменение цвета плейсхолдера при фокусе */\n focusedOuterPlaceholderColor: 'focused-outer-placeholder-color',\n /** Класс отвечающий за скрытие плейсхолдера */\n hidePlaceHolder: 'hide-placeholder',\n /** Класс для компонента `StyledContainer` */\n styledContainer: 'textarea-container',\n /** Класс для компонента `StyledTextArea` */\n styledTextArea: 'textarea',\n /** Класс для компонента `StyledTextAreaWrapper` */\n styledTextAreaWrapper: 'textarea-wrapper',\n /** Класс для компонента `StyledPlaceholder` */\n styledPlaceholder: 'textarea-placeholder',\n /** Класс для компонента `StyledHelpers` */\n styledHelpers: 'textarea-helpers',\n};\n\nexport const tokens = {\n /** Цвет фона для элемента textarea */\n inputBackgroundColor: '--plasma-textarea-input-background-color',\n /** Цвет фона для элемента textarea в состоянии hover */\n inputBackgroundColorHover: '--plasma-textarea-input-background-color-hover',\n /** Цвет фона для элемента textarea в состоянии active */\n inputBackgroundColorActive: '--plasma-textarea-input-background-color-active',\n /** Цвет фона для элемента textarea в состоянии focus */\n inputBackgroundColorFocus: '--plasma-textarea-input-background-color-focus',\n /** Цвета границы для элемента textarea */\n inputBorderColor: '--plasma-textarea-input-border-color',\n /** Цвета границы для элемента textarea в состоянии hover */\n inputBorderColorHover: '--plasma-textarea-input-border-color-hover',\n /** Цвета границы для элемента textarea в состоянии active */\n inputBorderColorActive: '--plasma-textarea-input-border-color-active',\n /** Цвета границы для элемента textarea в состоянии focus */\n inputBorderColorFocus: '--plasma-textarea-input-border-color-focus',\n /** Цвет фона для блока подписей снизу */\n helpersBackgroundColor: '--plasma-textarea-helpers-background-color',\n /** Цвет фона для блока подписей снизу в состоянии hover */\n helpersBackgroundColorHover: '--plasma-textarea-helpers-background-color-hover',\n /** Цвет фона для блока подписей снизу в состоянии active */\n helpersBackgroundColorActive: '--plasma-textarea-helpers-background-color-active',\n /** Цвет фона для блока подписей снизу в состоянии focus */\n helpersBackgroundColorFocus: '--plasma-textarea-helpers-background-color-focus',\n /** Цвет текста для элемента textarea */\n inputColor: '--plasma-textarea-input-color',\n /** Цвет текста для элемента textarea в состоянии focus */\n inputColorFocus: '--plasma-textarea-input-color-focus',\n /** Цвет каретки для элемента textarea */\n inputCaretColor: '--plasma-textarea-input-caret-color',\n /** Цвет элемента placeholder */\n placeholderColor: '--plasma-textarea-placeholder-color',\n /** Цвет элемента placeholder в состоянии focus */\n placeholderColorFocus: '--plasma-textarea-placeholder-color-focus',\n /** Цвет текста для левой подписи снизу */\n leftHelperColor: '--plasma-textarea-left-helper-color',\n /** Цвет текста для правой подписи снизу */\n rightHelperColor: '--plasma-textarea-right-helper-color',\n /** Цвета границы для всего компонента */\n borderColor: '--plasma-textarea-border-color',\n /** Цвета границы для всего компонента в состоянии hover */\n borderColorHover: '--plasma-textarea-border-color-hover',\n /** Цвета границы для всего компонента в состоянии focus */\n borderColorFocus: '--plasma-textarea-border-color-focus',\n\n /** Ширина элемента textarea */\n inputWidth: '--plasma-textarea-input-width',\n /** Высота элемента textarea */\n inputHeight: '--plasma-textarea-input-height',\n /** Минимальная высота элемента textarea */\n inputMinHeight: '--plasma-textarea-input-min-height',\n /** Толщина рамки всего компонента */\n borderSize: '--plasma-textarea-border-size',\n /** Размер скругления рамки всего компонента */\n borderRadius: '--plasma-textarea-border-radius',\n /** Размер скругления рамки всего компонента, когда есть блок подписей и у него нет рамки */\n borderRadiusWithHelpers: '--plasma-textarea-border-radius-with-helpers',\n /** Отступ сверху для элемента textarea */\n inputPaddingTop: '--plasma-textarea-input-padding-top',\n /** Отступ справа для элемента textarea */\n inputPaddingRight: '--plasma-textarea-input-padding-right',\n /** Отступ справа для элемента textarea, когда есть контент справа */\n inputPaddingRightWithRightContent: '--plasma-textarea-input-padding-right-with-right-content',\n /** Отступ снизу для элемента textarea */\n inputPaddingBottom: '--plasma-textarea-input-padding-bottom',\n /** Отступ снизу для элемента textarea, когда есть блок подписей */\n inputPaddingBottomWithHelpers: '--plasma-textarea-input-padding-bottom-with-helpers',\n /** Отступ слева для элемента textarea */\n inputPaddingLeft: '--plasma-textarea-input-padding-left',\n /** Отступ сверху для блока подписей */\n helpersPaddingTop: '--plasma-textarea-helpers-padding-top',\n /** Отступ справа для блока подписей */\n helpersPaddingRight: '--plasma-textarea-helpers-padding-right',\n /** Отступ снизу для блока подписей */\n helpersPaddingBottom: '--plasma-textarea-helpers-padding-bottom',\n /** Отступ слева для блока подписей */\n helpersPaddingLeft: '--plasma-textarea-helpers-padding-left',\n /** Вспомогательная высота для всего компонента, когда есть блок подписей и у него нет рамки */\n helpersOffset: '--plasma-textarea-helpers-offset',\n /** Отступ сверху для контента справа */\n rightContentTop: '--plasma-textarea-right-content-top',\n /** Отступ справа для контента справа */\n rightContentRight: '--plasma-textarea-right-content-right',\n /** Высота контента справа */\n rightContentHeight: '--plasma-textarea-right-content-height',\n /** Отступ сверху для элемента label, когда он внутри и уменьшен */\n labelMarginBottom: '--plasma-textarea-label-margin-bottom',\n /** Шрифт для элемента label, когда он внутри и уменьшен */\n labelInnerFontFamily: '--plasma-textarea-label-inner-font-family',\n /** Размер шрифта для элемента label, когда он внутри и уменьшен */\n labelInnerFontSize: '--plasma-textarea-label-inner-font-size',\n /** Стиль шрифта для элемента label, когда он внутри и уменьшен */\n labelInnerFontStyle: '--plasma-textarea-label-inner-font-style',\n /** Начертание шрифта для элемента label, когда он внутри и уменьшен */\n labelInnerFontWeight: '--plasma-textarea-label-inner-font-weight',\n /** Межсимвольное расстояние для элемента label, когда он внутри и уменьшен */\n labelInnerLetterSpacing: '--plasma-textarea-label-inner-letter-spacing',\n /** Высота строки для элемента label, когда он внутри и уменьшен */\n labelInnerLineHeight: '--plasma-textarea-label-inner-line-height',\n /** Отступ сверху для элемента textarea при фокусе */\n labelInnerTop: '--plasma-textarea-label-inner-top',\n /** Отступ между Label и TextArea */\n labelInnerMarginBottom: '--plasma-textarea-label-inner-margin-bottom',\n /** Шрифт для элемента textarea */\n inputFontFamily: '--plasma-textarea-input-font-family',\n /** Размер шрифта для элемента textarea */\n inputFontSize: '--plasma-textarea-input-font-size',\n /** Стиль шрифта для элемента textarea */\n inputFontStyle: '--plasma-textarea-input-font-style',\n /** Начертание шрифта для элемента textarea */\n inputFontWeight: '--plasma-textarea-input-font-weight',\n /** Межсимвольное расстояние шрифта для элемента textarea */\n inputLetterSpacing: '--plasma-textarea-input-letter-spacing',\n /** Высота строки шрифта для элемента textarea */\n inputLineHeight: '--plasma-textarea-input-line-height',\n /** Шрифт для элемента блока подписей снизу */\n helpersFontFamily: '--plasma-textarea-helpers-font-family',\n /** Размер шрифта для элемента блока подписей снизу */\n helpersFontSize: '--plasma-textarea-helpers-font-size',\n /** Стиль шрифта для элемента блока подписей снизу */\n helpersFontStyle: '--plasma-textarea-helpers-font-style',\n /** Начертание шрифта для элемента блока подписей снизу */\n helpersFontWeight: '--plasma-textarea-helpers-font-weight',\n /** Межсимвольное расстояние для элемента блока подписей снизу */\n helpersLetterSpacing: '--plasma-textarea-helpers-letter-spacing',\n /** Высота строки для элемента блока подписей снизу */\n helpersLineHeight: '--plasma-textarea-helpers-line-height',\n\n /** Прозрачность для всего компонента в состоянии disabled */\n disabledOpacity: '--plasma-textarea-disabled-opacity',\n /** Цвет текста для элемента textarea в состоянии disabled */\n inputColorDisabled: '--plasma-textarea-input-color-disabled',\n};\n"],"names":["classes","innerPlaceholderUp","focusedOuterPlaceholderColor","hidePlaceHolder","styledContainer","styledTextArea","styledTextAreaWrapper","styledPlaceholder","styledHelpers","tokens","inputBackgroundColor","inputBackgroundColorHover","inputBackgroundColorActive","inputBackgroundColorFocus","inputBorderColor","inputBorderColorHover","inputBorderColorActive","inputBorderColorFocus","helpersBackgroundColor","helpersBackgroundColorHover","helpersBackgroundColorActive","helpersBackgroundColorFocus","inputColor","inputColorFocus","inputCaretColor","placeholderColor","placeholderColorFocus","leftHelperColor","rightHelperColor","borderColor","borderColorHover","borderColorFocus","inputWidth","inputHeight","inputMinHeight","borderSize","borderRadius","borderRadiusWithHelpers","inputPaddingTop","inputPaddingRight","inputPaddingRightWithRightContent","inputPaddingBottom","inputPaddingBottomWithHelpers","inputPaddingLeft","helpersPaddingTop","helpersPaddingRight","helpersPaddingBottom","helpersPaddingLeft","helpersOffset","rightContentTop","rightContentRight","rightContentHeight","labelMarginBottom","labelInnerFontFamily","labelInnerFontSize","labelInnerFontStyle","labelInnerFontWeight","labelInnerLetterSpacing","labelInnerLineHeight","labelInnerTop","labelInnerMarginBottom","inputFontFamily","inputFontSize","inputFontStyle","inputFontWeight","inputLetterSpacing","inputLineHeight","helpersFontFamily","helpersFontSize","helpersFontStyle","helpersFontWeight","helpersLetterSpacing","helpersLineHeight","disabledOpacity","inputColorDisabled"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnB;AACAC,EAAAA,kBAAkB,EAAE,sBAAsB;AAC1C;AACAC,EAAAA,4BAA4B,EAAE,iCAAiC;AAC/D;AACAC,EAAAA,eAAe,EAAE,kBAAkB;AACnC;AACAC,EAAAA,eAAe,EAAE,oBAAoB;AACrC;AACAC,EAAAA,cAAc,EAAE,UAAU;AAC1B;AACAC,EAAAA,qBAAqB,EAAE,kBAAkB;AACzC;AACAC,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AA,eAAe,EAAE,qCAAqC;AACtD;AACAC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1D;AACAC,EAAAA,eAAe,EAAE,qCAAqC;AACtD;AACAC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxD;AACAC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1D;AACAC,EAAAA,oBAAoB,EAAE,0CAA0C;AAChE;AACAC,EAAAA,iBAAiB,EAAE,uCAAuC;AAE1D;AACAC,EAAAA,eAAe,EAAE,oCAAoC;AACrD;AACAC,EAAAA,kBAAkB,EAAE,wCAAA;AACxB;;;;;"}
|
1
|
+
{"version":3,"file":"TextArea.tokens.js","sources":["../../../src/components/TextArea/TextArea.tokens.ts"],"sourcesContent":["export const classes = {\n /** Класс отвечающий за поднятие и уменьшение плейсхолдера */\n innerPlaceholderUp: 'inner-placeholder-up',\n /** Класс отвечающий за изменение цвета плейсхолдера при фокусе */\n focusedOuterPlaceholderColor: 'focused-outer-placeholder-color',\n /** Класс отвечающий за скрытие плейсхолдера */\n hidePlaceHolder: 'hide-placeholder',\n /** Класс для компонента `StyledContainer` */\n styledContainer: 'textarea-container',\n /** Класс для компонента `StyledTextArea` */\n styledTextArea: 'textarea',\n /** Класс для компонента `StyledTextAreaWrapper` */\n styledTextAreaWrapper: 'textarea-wrapper',\n /** Класс для компонента `StyledPlaceholder` */\n styledPlaceholder: 'textarea-placeholder',\n /** Класс для компонента `StyledHelpers` */\n styledHelpers: 'textarea-helpers',\n};\n\nexport const tokens = {\n /** Цвет фона для элемента textarea */\n inputBackgroundColor: '--plasma-textarea-input-background-color',\n /** Цвет фона для элемента textarea в состоянии hover */\n inputBackgroundColorHover: '--plasma-textarea-input-background-color-hover',\n /** Цвет фона для элемента textarea в состоянии active */\n inputBackgroundColorActive: '--plasma-textarea-input-background-color-active',\n /** Цвет фона для элемента textarea в состоянии focus */\n inputBackgroundColorFocus: '--plasma-textarea-input-background-color-focus',\n /** Цвета границы для элемента textarea */\n inputBorderColor: '--plasma-textarea-input-border-color',\n /** Цвета границы для элемента textarea в состоянии hover */\n inputBorderColorHover: '--plasma-textarea-input-border-color-hover',\n /** Цвета границы для элемента textarea в состоянии active */\n inputBorderColorActive: '--plasma-textarea-input-border-color-active',\n /** Цвета границы для элемента textarea в состоянии focus */\n inputBorderColorFocus: '--plasma-textarea-input-border-color-focus',\n /** Цвет фона для блока подписей снизу */\n helpersBackgroundColor: '--plasma-textarea-helpers-background-color',\n /** Цвет фона для блока подписей снизу в состоянии hover */\n helpersBackgroundColorHover: '--plasma-textarea-helpers-background-color-hover',\n /** Цвет фона для блока подписей снизу в состоянии active */\n helpersBackgroundColorActive: '--plasma-textarea-helpers-background-color-active',\n /** Цвет фона для блока подписей снизу в состоянии focus */\n helpersBackgroundColorFocus: '--plasma-textarea-helpers-background-color-focus',\n /** Цвет текста для элемента textarea */\n inputColor: '--plasma-textarea-input-color',\n /** Цвет текста для элемента textarea в состоянии focus */\n inputColorFocus: '--plasma-textarea-input-color-focus',\n /** Цвет каретки для элемента textarea */\n inputCaretColor: '--plasma-textarea-input-caret-color',\n /** Цвет элемента placeholder */\n placeholderColor: '--plasma-textarea-placeholder-color',\n /** Цвет элемента placeholder в состоянии focus */\n placeholderColorFocus: '--plasma-textarea-placeholder-color-focus',\n /** Цвет текста для левой подписи снизу */\n leftHelperColor: '--plasma-textarea-left-helper-color',\n /** Цвет текста для правой подписи снизу */\n rightHelperColor: '--plasma-textarea-right-helper-color',\n /** Цвета границы для всего компонента */\n borderColor: '--plasma-textarea-border-color',\n /** Цвета границы для всего компонента в состоянии hover */\n borderColorHover: '--plasma-textarea-border-color-hover',\n /** Цвета границы для всего компонента в состоянии focus */\n borderColorFocus: '--plasma-textarea-border-color-focus',\n\n /** Ширина элемента textarea */\n inputWidth: '--plasma-textarea-input-width',\n /** Высота элемента textarea */\n inputHeight: '--plasma-textarea-input-height',\n /** Минимальная высота элемента textarea */\n inputMinHeight: '--plasma-textarea-input-min-height',\n /** Толщина рамки всего компонента */\n borderSize: '--plasma-textarea-border-size',\n /** Размер скругления рамки всего компонента */\n borderRadius: '--plasma-textarea-border-radius',\n /** Размер скругления рамки всего компонента, когда есть блок подписей и у него нет рамки */\n borderRadiusWithHelpers: '--plasma-textarea-border-radius-with-helpers',\n /** Отступ сверху для элемента textarea */\n inputPaddingTop: '--plasma-textarea-input-padding-top',\n /** Отступ справа для элемента textarea */\n inputPaddingRight: '--plasma-textarea-input-padding-right',\n /** Отступ справа для элемента textarea, когда есть контент справа */\n inputPaddingRightWithRightContent: '--plasma-textarea-input-padding-right-with-right-content',\n /** Отступ снизу для элемента textarea */\n inputPaddingBottom: '--plasma-textarea-input-padding-bottom',\n /** Отступ снизу для элемента textarea, когда есть блок подписей */\n inputPaddingBottomWithHelpers: '--plasma-textarea-input-padding-bottom-with-helpers',\n /** Отступ слева для элемента textarea */\n inputPaddingLeft: '--plasma-textarea-input-padding-left',\n /** Отступ сверху для блока подписей */\n helpersPaddingTop: '--plasma-textarea-helpers-padding-top',\n /** Отступ справа для блока подписей */\n helpersPaddingRight: '--plasma-textarea-helpers-padding-right',\n /** Отступ снизу для блока подписей */\n helpersPaddingBottom: '--plasma-textarea-helpers-padding-bottom',\n /** Отступ слева для блока подписей */\n helpersPaddingLeft: '--plasma-textarea-helpers-padding-left',\n /** Вспомогательная высота для всего компонента, когда есть блок подписей и у него нет рамки */\n helpersOffset: '--plasma-textarea-helpers-offset',\n /** Отступ сверху для контента справа */\n rightContentTop: '--plasma-textarea-right-content-top',\n /** Отступ справа для контента справа */\n rightContentRight: '--plasma-textarea-right-content-right',\n /** Высота контента справа */\n rightContentHeight: '--plasma-textarea-right-content-height',\n /** Отступ сверху для элемента label, когда он внутри и уменьшен */\n labelMarginBottom: '--plasma-textarea-label-margin-bottom',\n /** Шрифт для элемента label, когда он внутри и уменьшен */\n labelInnerFontFamily: '--plasma-textarea-label-inner-font-family',\n /** Размер шрифта для элемента label, когда он внутри и уменьшен */\n labelInnerFontSize: '--plasma-textarea-label-inner-font-size',\n /** Стиль шрифта для элемента label, когда он внутри и уменьшен */\n labelInnerFontStyle: '--plasma-textarea-label-inner-font-style',\n /** Начертание шрифта для элемента label, когда он внутри и уменьшен */\n labelInnerFontWeight: '--plasma-textarea-label-inner-font-weight',\n /** Межсимвольное расстояние для элемента label, когда он внутри и уменьшен */\n labelInnerLetterSpacing: '--plasma-textarea-label-inner-letter-spacing',\n /** Высота строки для элемента label, когда он внутри и уменьшен */\n labelInnerLineHeight: '--plasma-textarea-label-inner-line-height',\n /** Шрифт для элемента textarea */\n inputFontFamily: '--plasma-textarea-input-font-family',\n /** Размер шрифта для элемента textarea */\n inputFontSize: '--plasma-textarea-input-font-size',\n /** Стиль шрифта для элемента textarea */\n inputFontStyle: '--plasma-textarea-input-font-style',\n /** Начертание шрифта для элемента textarea */\n inputFontWeight: '--plasma-textarea-input-font-weight',\n /** Межсимвольное расстояние шрифта для элемента textarea */\n inputLetterSpacing: '--plasma-textarea-input-letter-spacing',\n /** Высота строки шрифта для элемента textarea */\n inputLineHeight: '--plasma-textarea-input-line-height',\n /** Шрифт для элемента блока подписей снизу */\n helpersFontFamily: '--plasma-textarea-helpers-font-family',\n /** Размер шрифта для элемента блока подписей снизу */\n helpersFontSize: '--plasma-textarea-helpers-font-size',\n /** Стиль шрифта для элемента блока подписей снизу */\n helpersFontStyle: '--plasma-textarea-helpers-font-style',\n /** Начертание шрифта для элемента блока подписей снизу */\n helpersFontWeight: '--plasma-textarea-helpers-font-weight',\n /** Межсимвольное расстояние для элемента блока подписей снизу */\n helpersLetterSpacing: '--plasma-textarea-helpers-letter-spacing',\n /** Высота строки для элемента блока подписей снизу */\n helpersLineHeight: '--plasma-textarea-helpers-line-height',\n\n /** Прозрачность для всего компонента в состоянии disabled */\n disabledOpacity: '--plasma-textarea-disabled-opacity',\n /** Цвет текста для элемента textarea в состоянии disabled */\n inputColorDisabled: '--plasma-textarea-input-color-disabled',\n};\n"],"names":["classes","innerPlaceholderUp","focusedOuterPlaceholderColor","hidePlaceHolder","styledContainer","styledTextArea","styledTextAreaWrapper","styledPlaceholder","styledHelpers","tokens","inputBackgroundColor","inputBackgroundColorHover","inputBackgroundColorActive","inputBackgroundColorFocus","inputBorderColor","inputBorderColorHover","inputBorderColorActive","inputBorderColorFocus","helpersBackgroundColor","helpersBackgroundColorHover","helpersBackgroundColorActive","helpersBackgroundColorFocus","inputColor","inputColorFocus","inputCaretColor","placeholderColor","placeholderColorFocus","leftHelperColor","rightHelperColor","borderColor","borderColorHover","borderColorFocus","inputWidth","inputHeight","inputMinHeight","borderSize","borderRadius","borderRadiusWithHelpers","inputPaddingTop","inputPaddingRight","inputPaddingRightWithRightContent","inputPaddingBottom","inputPaddingBottomWithHelpers","inputPaddingLeft","helpersPaddingTop","helpersPaddingRight","helpersPaddingBottom","helpersPaddingLeft","helpersOffset","rightContentTop","rightContentRight","rightContentHeight","labelMarginBottom","labelInnerFontFamily","labelInnerFontSize","labelInnerFontStyle","labelInnerFontWeight","labelInnerLetterSpacing","labelInnerLineHeight","inputFontFamily","inputFontSize","inputFontStyle","inputFontWeight","inputLetterSpacing","inputLineHeight","helpersFontFamily","helpersFontSize","helpersFontStyle","helpersFontWeight","helpersLetterSpacing","helpersLineHeight","disabledOpacity","inputColorDisabled"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnB;AACAC,EAAAA,kBAAkB,EAAE,sBAAsB;AAC1C;AACAC,EAAAA,4BAA4B,EAAE,iCAAiC;AAC/D;AACAC,EAAAA,eAAe,EAAE,kBAAkB;AACnC;AACAC,EAAAA,eAAe,EAAE,oBAAoB;AACrC;AACAC,EAAAA,cAAc,EAAE,UAAU;AAC1B;AACAC,EAAAA,qBAAqB,EAAE,kBAAkB;AACzC;AACAC,EAAAA,iBAAiB,EAAE,sBAAsB;AACzC;AACAC,EAAAA,aAAa,EAAE,kBAAA;AACnB,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClB;AACAC,EAAAA,oBAAoB,EAAE,0CAA0C;AAChE;AACAC,EA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C,EAAAA,iBAAiB,EAAE,uCAAuC;AAE1D;AACAC,EAAAA,eAAe,EAAE,oCAAoC;AACrD;AACAC,EAAAA,kBAAkB,EAAE,wCAAA;AACxB;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.b6rykm0{position:relative;box-sizing:border-box;}.b6rykm0 .inner-placeholder-up .textarea{height:calc(var(--plasma_private-textarea-input-actual-height) - 1rem);}.b6rykm0 .inner-placeholder-up .textarea-wrapper{padding-top:calc(var(--plasma-textarea-input-padding-top) + 1rem);}.b6rykm0 .inner-placeholder-up .textarea-placeholder{font-family:var(--plasma-textarea-label-inner-font-family);font-size:var(--plasma-textarea-label-inner-font-size);font-style:var(--plasma-textarea-label-inner-font-style);font-weight:var(--plasma-textarea-label-inner-font-weight);-webkit-letter-spacing:var(--plasma-textarea-label-inner-letter-spacing);-moz-letter-spacing:var(--plasma-textarea-label-inner-letter-spacing);-ms-letter-spacing:var(--plasma-textarea-label-inner-letter-spacing);letter-spacing:var(--plasma-textarea-label-inner-letter-spacing);line-height:var(--plasma-textarea-label-inner-line-height);}.b6rykm0 .hide-placeholder .textarea-placeholder{display:none;}.b6rykm0 .focused-outer-placeholder-color .textarea-placeholder{color:var(--plasma-textarea-placeholder-color-focus);}
|
@@ -17,11 +17,13 @@ var TextField_tokens = require('./TextField.tokens.js');
|
|
17
17
|
var TextFieldChip = require('./ui/TextFieldChip/TextFieldChip.js');
|
18
18
|
var useKeyNavigation = require('./hooks/useKeyNavigation.js');
|
19
19
|
|
20
|
-
var _excluded = ["id", "contentLeft", "contentRight", "label", "labelPlacement", "placeholder", "leftHelper", "enumerationType", "view", "size", "readOnly", "disabled", "chips", "onChange", "onChangeChips", "onSearch"];
|
20
|
+
var _excluded = ["id", "className", "style", "contentLeft", "contentRight", "label", "labelPlacement", "placeholder", "leftHelper", "enumerationType", "view", "size", "readOnly", "disabled", "chips", "onChange", "onChangeChips", "onSearch", "onKeyDown"];
|
21
21
|
var base = "bpunezx";
|
22
22
|
var textFieldRoot = function textFieldRoot(Root) {
|
23
23
|
return /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
24
24
|
var id = _ref.id,
|
25
|
+
className = _ref.className,
|
26
|
+
style = _ref.style,
|
25
27
|
contentLeft = _ref.contentLeft,
|
26
28
|
contentRight = _ref.contentRight,
|
27
29
|
label = _ref.label,
|
@@ -40,6 +42,7 @@ var textFieldRoot = function textFieldRoot(Root) {
|
|
40
42
|
onChange = _ref.onChange,
|
41
43
|
onChangeChips = _ref.onChangeChips,
|
42
44
|
onSearch = _ref.onSearch,
|
45
|
+
onKeyDown = _ref.onKeyDown,
|
43
46
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
44
47
|
var contentRef = React.useRef(null);
|
45
48
|
var inputRef = React.useRef(null);
|
@@ -119,6 +122,10 @@ var textFieldRoot = function textFieldRoot(Root) {
|
|
119
122
|
chipsRefs.current[index] = element;
|
120
123
|
}
|
121
124
|
};
|
125
|
+
var handleOnKeyDown = function handleOnKeyDown(event) {
|
126
|
+
handleInputKeydown(event);
|
127
|
+
onKeyDown && onKeyDown(event);
|
128
|
+
};
|
122
129
|
React.useEffect(function () {
|
123
130
|
if (!isChipEnumeration && !(values !== null && values !== void 0 && values.length)) {
|
124
131
|
return;
|
@@ -137,7 +144,9 @@ var textFieldRoot = function textFieldRoot(Root) {
|
|
137
144
|
disabled: disabled,
|
138
145
|
readOnly: !disabled && readOnly,
|
139
146
|
labelPlacement: innerLabelPlacementValue,
|
140
|
-
onClick: handleInputFocus
|
147
|
+
onClick: handleInputFocus,
|
148
|
+
className: className,
|
149
|
+
style: style
|
141
150
|
}, labelInside || innerLabelValue && /*#__PURE__*/React.createElement(TextField_styles.Label, {
|
142
151
|
id: labelId,
|
143
152
|
htmlFor: id
|
@@ -178,7 +187,7 @@ var textFieldRoot = function textFieldRoot(Root) {
|
|
178
187
|
disabled: disabled,
|
179
188
|
readOnly: !disabled && readOnly,
|
180
189
|
onChange: handleChange,
|
181
|
-
onKeyDown:
|
190
|
+
onKeyDown: handleOnKeyDown
|
182
191
|
})), labelInside && /*#__PURE__*/React.createElement(TextField_styles.Label, {
|
183
192
|
id: labelId,
|
184
193
|
htmlFor: innerId
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { ChangeEventHandler } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\nimport { css } from '@linaria/core';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { ChipValues, TextFieldPrimitiveValue, TextFieldProps } from './TextField.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_read-only/base';\nimport { base as labelPlacementCSS } from './variations/_label-placement/base';\nimport {\n Input,\n LeftHelper,\n Label,\n InputWrapper,\n InputLabelWrapper,\n StyledContentLeft,\n StyledContentRight,\n StyledChips,\n} from './TextField.styles';\nimport { classes } from './TextField.tokens';\nimport { TextFieldChip } from './ui';\nimport { useKeyNavigation } from './hooks';\n\nexport const base = css`\n /* NOTE: Webkit не применяет opacity к inline тегам */\n display: block;\n overflow: hidden;\n`;\n\nexport const textFieldRoot = (Root: RootProps<HTMLDivElement, TextFieldProps>) =>\n forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n\n // layout\n contentLeft,\n contentRight,\n label,\n labelPlacement,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n\n // variations\n view,\n size,\n readOnly = false,\n disabled = false,\n\n // controlled\n chips: values,\n\n // events\n onChange,\n onChangeChips,\n onSearch,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n\n const controlledRefs = { contentRef, inputRef, chipsRefs };\n\n const [chips, setChips] = useState<Array<ChipValues>>([]);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const labelId = safeUseId();\n const helperTextId = safeUseId();\n\n const isChipEnumeration = enumerationType === 'chip';\n const hideLabel = (size === 'xs' || isChipEnumeration) && labelPlacement === 'inner';\n const labelInside = size !== 'xs' && labelPlacement === 'inner';\n const innerLabelPlacementValue = hideLabel ? 'outer' : labelPlacement;\n const innerPlaceholderValue = hideLabel ? label : placeholder;\n const innerLabelValue = hideLabel ? undefined : label;\n\n const isChipsVisible = isChipEnumeration && chips?.length;\n const withHasChips = isChipsVisible ? classes.hasChips : undefined;\n const wrapperWithoutLeftContent = !contentLeft && isChipsVisible ? classes.hasEmptyContentLeft : undefined;\n const wrapperWithoutRightContent =\n !contentRight && isChipsVisible ? classes.hasEmptyContentRight : undefined;\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const { maxLength, value } = event.target;\n\n if (maxLength !== -1 && value.length > maxLength) {\n return;\n }\n\n onChange?.(event);\n };\n\n const updateChips = (newChips: Array<ChipValues>, newValues: Array<TextFieldPrimitiveValue>) => {\n setChips(newChips);\n onChangeChips?.(newValues);\n };\n\n const { handleInputKeydown, handleChipKeyDown, onChipClear, handleContentKeyDown } = useKeyNavigation({\n controlledRefs,\n disabled,\n readOnly,\n chips,\n enumerationType,\n updateChips,\n onSearch,\n onChange,\n });\n\n const onChipClick = (event: React.MouseEvent<HTMLButtonElement>) => event.stopPropagation();\n\n const handleInputFocus = () => {\n if (readOnly || disabled || !inputRef?.current) {\n return;\n }\n\n inputRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n\n inputRef.current.focus({ preventScroll: true });\n };\n\n const getRef = (element: HTMLButtonElement | null, index: number) => {\n if (element && chipsRefs?.current) {\n chipsRefs.current[index] = element;\n }\n };\n\n useEffect(() => {\n if (!isChipEnumeration && !values?.length) {\n return;\n }\n\n const newChips =\n values?.map((value, index) => ({\n id: `${index}_${value}`,\n text: value,\n })) || [];\n\n setChips(newChips);\n }, [isChipEnumeration, values]);\n\n return (\n <Root\n view={view}\n size={size}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n labelPlacement={innerLabelPlacementValue}\n onClick={handleInputFocus}\n >\n {labelInside ||\n (innerLabelValue && (\n <Label id={labelId} htmlFor={id}>\n {innerLabelValue}\n </Label>\n ))}\n <InputWrapper className={cx(withHasChips, wrapperWithoutLeftContent, wrapperWithoutRightContent)}>\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n <InputLabelWrapper\n tabIndex={-1}\n ref={contentRef}\n onKeyDown={handleContentKeyDown}\n className={withHasChips}\n >\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips>\n {chips?.map(({ id: chipId, text }, index) => {\n return (\n <TextFieldChip\n id={chipId}\n ref={(element) => getRef(element, index)}\n key={`${chipId}_${index}`}\n disabled={disabled}\n readOnly={readOnly}\n value={text}\n text={text}\n onKeyDown={(event) => handleChipKeyDown(event, chipId, index)}\n onClear={() => onChipClear(chipId, index)}\n onClick={onChipClick}\n />\n );\n })}\n </StyledChips>\n )}\n <Input\n {...rest}\n ref={inputForkRef}\n id={innerId}\n aria-labelledby={labelId}\n aria-describedby={helperTextId}\n placeholder={innerPlaceholderValue}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onChange={handleChange}\n onKeyDown={handleInputKeydown}\n />\n {labelInside && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n </Label>\n )}\n </InputLabelWrapper>\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </InputWrapper>\n {leftHelper && <LeftHelper id={helperTextId}>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const textFieldConfig = {\n name: 'TextField',\n tag: 'div',\n layout: textFieldRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n labelPlacement: {\n css: labelPlacementCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["base","textFieldRoot","Root","forwardRef","_ref","ref","id","contentLeft","contentRight","label","labelPlacement","placeholder","leftHelper","_ref$enumerationType","enumerationType","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","values","chips","onChange","onChangeChips","onSearch","rest","contentRef","useRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","_useState2","_slicedToArray","setChips","uniqId","safeUseId","innerId","labelId","helperTextId","isChipEnumeration","hideLabel","labelInside","innerLabelPlacementValue","innerPlaceholderValue","innerLabelValue","undefined","isChipsVisible","length","withHasChips","classes","hasChips","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","handleChange","event","_event$target","target","maxLength","value","updateChips","newChips","newValues","_useKeyNavigation","useKeyNavigation","handleInputKeydown","handleChipKeyDown","onChipClear","handleContentKeyDown","onChipClick","stopPropagation","handleInputFocus","current","scrollIntoView","behavior","block","inline","focus","preventScroll","getRef","element","index","useEffect","map","concat","text","React","createElement","onClick","Label","htmlFor","InputWrapper","className","cx","StyledContentLeft","InputLabelWrapper","tabIndex","onKeyDown","Boolean","StyledChips","_ref2","chipId","TextFieldChip","key","onClear","Input","_extends","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","labelPlacementCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BO,IAAMA,IAAI,GAIhB,UAAA;IAEYC,aAAa,GAAGA,SAAhBA,aAAaA,CAAIC,IAA+C,EAAA;AAAA,EAAA,oBACzEC,gBAAU,CACN,UAAAC,IAAA,EA6BIC,GAAG,EACF;AAAA,IAAA,IA5BGC,EAAE,GAAAF,IAA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AAI,EAAE,WAAW;AACjBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAErH,aAAa;AACrBD,EAAAA,IAAI,EAAJA,IAAI;AACJuH,EAAAA,UAAU,EAAE;AACRxG,IAAAA,IAAI,EAAE;AACFyG,MAAAA,GAAG,EAAEC,WAAAA;KACR;AACDzG,IAAAA,IAAI,EAAE;AACFwG,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDtG,IAAAA,QAAQ,EAAE;AACNoG,MAAAA,GAAG,EAAEG,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACD1G,IAAAA,QAAQ,EAAE;AACNsG,MAAAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDlH,IAAAA,cAAc,EAAE;AACZ8G,MAAAA,GAAG,EAAEM,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN/G,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;;"}
|
1
|
+
{"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { ChangeEventHandler, KeyboardEvent, ChangeEvent } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\nimport { css } from '@linaria/core';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { ChipValues, TextFieldPrimitiveValue, TextFieldProps } from './TextField.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_read-only/base';\nimport { base as labelPlacementCSS } from './variations/_label-placement/base';\nimport {\n Input,\n LeftHelper,\n Label,\n InputWrapper,\n InputLabelWrapper,\n StyledContentLeft,\n StyledContentRight,\n StyledChips,\n} from './TextField.styles';\nimport { classes } from './TextField.tokens';\nimport { TextFieldChip } from './ui';\nimport { useKeyNavigation } from './hooks';\n\nexport const base = css`\n /* NOTE: Webkit не применяет opacity к inline тегам */\n display: block;\n overflow: hidden;\n`;\n\nexport const textFieldRoot = (Root: RootProps<HTMLDivElement, TextFieldProps>) =>\n forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n style,\n\n // layout\n contentLeft,\n contentRight,\n label,\n labelPlacement,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n\n // variations\n view,\n size,\n readOnly = false,\n disabled = false,\n\n // controlled\n chips: values,\n\n // events\n onChange,\n onChangeChips,\n onSearch,\n onKeyDown,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n\n const controlledRefs = { contentRef, inputRef, chipsRefs };\n\n const [chips, setChips] = useState<Array<ChipValues>>([]);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const labelId = safeUseId();\n const helperTextId = safeUseId();\n\n const isChipEnumeration = enumerationType === 'chip';\n const hideLabel = (size === 'xs' || isChipEnumeration) && labelPlacement === 'inner';\n const labelInside = size !== 'xs' && labelPlacement === 'inner';\n const innerLabelPlacementValue = hideLabel ? 'outer' : labelPlacement;\n const innerPlaceholderValue = hideLabel ? label : placeholder;\n const innerLabelValue = hideLabel ? undefined : label;\n\n const isChipsVisible = isChipEnumeration && chips?.length;\n const withHasChips = isChipsVisible ? classes.hasChips : undefined;\n const wrapperWithoutLeftContent = !contentLeft && isChipsVisible ? classes.hasEmptyContentLeft : undefined;\n const wrapperWithoutRightContent =\n !contentRight && isChipsVisible ? classes.hasEmptyContentRight : undefined;\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const { maxLength, value } = event.target;\n\n if (maxLength !== -1 && value.length > maxLength) {\n return;\n }\n\n onChange?.(event);\n };\n\n const updateChips = (newChips: Array<ChipValues>, newValues: Array<TextFieldPrimitiveValue>) => {\n setChips(newChips);\n onChangeChips?.(newValues);\n };\n\n const { handleInputKeydown, handleChipKeyDown, onChipClear, handleContentKeyDown } = useKeyNavigation({\n controlledRefs,\n disabled,\n readOnly,\n chips,\n enumerationType,\n updateChips,\n onSearch,\n onChange,\n });\n\n const onChipClick = (event: React.MouseEvent<HTMLButtonElement>) => event.stopPropagation();\n\n const handleInputFocus = () => {\n if (readOnly || disabled || !inputRef?.current) {\n return;\n }\n\n inputRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n\n inputRef.current.focus({ preventScroll: true });\n };\n\n const getRef = (element: HTMLButtonElement | null, index: number) => {\n if (element && chipsRefs?.current) {\n chipsRefs.current[index] = element;\n }\n };\n\n const handleOnKeyDown = (event: ChangeEvent<HTMLInputElement> & KeyboardEvent<HTMLInputElement>) => {\n handleInputKeydown(event);\n onKeyDown && onKeyDown(event);\n };\n\n useEffect(() => {\n if (!isChipEnumeration && !values?.length) {\n return;\n }\n\n const newChips =\n values?.map((value, index) => ({\n id: `${index}_${value}`,\n text: value,\n })) || [];\n\n setChips(newChips);\n }, [isChipEnumeration, values]);\n\n return (\n <Root\n view={view}\n size={size}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n labelPlacement={innerLabelPlacementValue}\n onClick={handleInputFocus}\n className={className}\n style={style}\n >\n {labelInside ||\n (innerLabelValue && (\n <Label id={labelId} htmlFor={id}>\n {innerLabelValue}\n </Label>\n ))}\n <InputWrapper className={cx(withHasChips, wrapperWithoutLeftContent, wrapperWithoutRightContent)}>\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n <InputLabelWrapper\n tabIndex={-1}\n ref={contentRef}\n onKeyDown={handleContentKeyDown}\n className={withHasChips}\n >\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips>\n {chips?.map(({ id: chipId, text }, index) => {\n return (\n <TextFieldChip\n id={chipId}\n ref={(element) => getRef(element, index)}\n key={`${chipId}_${index}`}\n disabled={disabled}\n readOnly={readOnly}\n value={text}\n text={text}\n onKeyDown={(event) => handleChipKeyDown(event, chipId, index)}\n onClear={() => onChipClear(chipId, index)}\n onClick={onChipClick}\n />\n );\n })}\n </StyledChips>\n )}\n <Input\n {...rest}\n ref={inputForkRef}\n id={innerId}\n aria-labelledby={labelId}\n aria-describedby={helperTextId}\n placeholder={innerPlaceholderValue}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onChange={handleChange}\n onKeyDown={handleOnKeyDown}\n />\n {labelInside && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n </Label>\n )}\n </InputLabelWrapper>\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </InputWrapper>\n {leftHelper && <LeftHelper id={helperTextId}>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const textFieldConfig = {\n name: 'TextField',\n tag: 'div',\n layout: textFieldRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n labelPlacement: {\n css: labelPlacementCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["base","textFieldRoot","Root","forwardRef","_ref","ref","id","className","style","contentLeft","contentRight","label","labelPlacement","placeholder","leftHelper","_ref$enumerationType","enumerationType","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","values","chips","onChange","onChangeChips","onSearch","onKeyDown","rest","contentRef","useRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","_useState2","_slicedToArray","setChips","uniqId","safeUseId","innerId","labelId","helperTextId","isChipEnumeration","hideLabel","labelInside","innerLabelPlacementValue","innerPlaceholderValue","innerLabelValue","undefined","isChipsVisible","length","withHasChips","classes","hasChips","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","handleChange","event","_event$target","target","maxLength","value","updateChips","newChips","newValues","_useKeyNavigation","useKeyNavigation","handleInputKeydown","handleChipKeyDown","onChipClear","handleContentKeyDown","onChipClick","stopPropagation","handleInputFocus","current","scrollIntoView","behavior","block","inline","focus","preventScroll","getRef","element","index","handleOnKeyDown","useEffect","map","concat","text","React","createElement","onClick","Label","htmlFor","InputWrapper","cx","StyledContentLeft","InputLabelWrapper","tabIndex","Boolean","StyledChips","_ref2","chipId","TextFieldChip","key","onClear","Input","_extends","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","labelPlacementCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BO,IAAMA,IAAI,GAIhB,UAAA;IAEYC,aAAa,GAAGA,SAAhBA,aAAaA,CAAIC,IAA+C,EAAA;AAAA,EAAA,oBACzEC,gBAAU,CACN,UAAAC,IAAA,EAgCIC,GAAG,EACF;AAAA,IAAA,IA/BGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,SAAS,GAAAH,IAAA,CAATG,SAAS;MACTC,KAAK,GAAAJ,IAAA,CAALI,KAAK;MAGLC,WAAW,GAAAL,IAAA,CAAXK,WAAW;MACXC,YAAY,GAAAN,IAAA,CAAZM,YAAY;MACZC,KAAK,GAAAP,IAAA,CAALO,KAAK;MACLC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;MACdC,WAAW,GAAAT,IAAA,CAAXS,WAAW;MACXC,UAAU,GAAAV,IAAA,CAAVU,UAAU;MAAAC,oBAAA,GAAAX,IAAA,CACVY,eAAe;AAAfA,MAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,oBAAA;MAGzBE,IAAI,GAAAb,IAAA,CAAJa,IAAI;MACJC,IAAI,GAAAd,IAAA,CAAJc,IAAI;MAAAC,aAAA,GAA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yG,MAAAA,GAAG,EAAEC,WAAAA;KACR;AACDzG,IAAAA,IAAI,EAAE;AACFwG,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDtG,IAAAA,QAAQ,EAAE;AACNoG,MAAAA,GAAG,EAAEG,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACD1G,IAAAA,QAAQ,EAAE;AACNsG,MAAAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDlH,IAAAA,cAAc,EAAE;AACZ8G,MAAAA,GAAG,EAAEM,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN/G,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;;"}
|
package/cjs/engines/common.js
CHANGED
@@ -6,6 +6,10 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.j
|
|
6
6
|
var React = require('react');
|
7
7
|
var linaria = require('./linaria.js');
|
8
8
|
|
9
|
+
//
|
10
|
+
// Тип HTMLAttributesOmitOnChange требуется чтобы использовать компонент с кастомным пропсом onChange
|
11
|
+
//
|
12
|
+
|
9
13
|
var getStaticVariants = function getStaticVariants(config) {
|
10
14
|
if (!config.variations) {
|
11
15
|
return [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {
|
1
|
+
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLAnyAttributes,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesOmitOnChange,\n} from './types';\n\n//\n// Тип HTMLAttributesOmitOnChange требуется чтобы использовать компонент с кастомным пропсом onChange\n//\n\nexport const getStaticVariants = (config: ComponentConfig) => {\n if (!config.variations) {\n return [];\n }\n const res = [];\n const { variations } = config;\n\n // eslint-disable-next-line guard-for-in\n for (const key in variations) {\n const { css } = variations[key];\n css && res.push(css);\n }\n\n return res;\n};\n\nexport const getDynamicVariants = (config: ComponentConfig) => {\n return (props: HTMLAnyAttributes) => {\n const res = [];\n\n // eslint-disable-next-line guard-for-in\n for (const key in config.variations) {\n if (key in props) {\n const variant = config.variations[key];\n\n const css = variant[props[key]];\n // no css for { modifier: true }\n css && Array.isArray(css) ? res.push(...css) : res.push(css);\n }\n }\n\n return res;\n };\n};\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends React.HTMLAttributes<HTMLElement> | HTMLAttributesOmitOnChange,\n LayoutPropsUser extends React.HTMLAttributes<HTMLElement> | HTMLAttributesOmitOnChange | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends React.HTMLAttributes<HTMLElement> | HTMLAttributesOmitOnChange\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["getStaticVariants","config","variations","res","key","css","push","getDynamicVariants","props","variant","Array","isArray","apply","_toConsumableArray","mergeConfig","baseConfig","userConfig","_objectSpread","attrs","defaults","component","Comp","layout","_component","React","forwardRef","ref","createElement","_extends"],"mappings":";;;;;;;;AAYA;AACA;AACA;;IAEaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,MAAuB,EAAK;AAC1D,EAAA,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;AACpB,IAAA,OAAO,EAAE,CAAA;AACb,GAAA;EACA,IAAMC,GAAG,GAAG,EAAE,CAAA;AACd,EAAA,IAAQD,UAAU,GAAKD,MAAM,CAArBC,UAAU,CAAA;;AAElB;AACA,EAAA,KAAK,IAAME,GAAG,IAAIF,UAAU,EAAE;AAC1B,IAAA,IAAQG,GAAG,GAAKH,UAAU,CAACE,GAAG,CAAC,CAAvBC,GAAG,CAAA;AACXA,IAAAA,GAAG,IAAIF,GAAG,CAACG,IAAI,CAACD,GAAG,CAAC,CAAA;AACxB,GAAA;AAEA,EAAA,OAAOF,GAAG,CAAA;AACd,EAAC;IAEYI,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIN,MAAuB,EAAK;EAC3D,OAAO,UAACO,KAAwB,EAAK;IACjC,IAAML,GAAG,GAAG,EAAE,CAAA;;AAEd;AACA,IAAA,KAAK,IAAMC,GAAG,IAAIH,MAAM,CAACC,UAAU,EAAE;MACjC,IAAIE,GAAG,IAAII,KAAK,EAAE;AACd,QAAA,IAAMC,OAAO,GAAGR,MAAM,CAACC,UAAU,CAACE,GAAG,CAAC,CAAA;QAEtC,IAAMC,GAAG,GAAGI,O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,KAAK,EAAE;QAChBf,GAAG,CAACD,UAAU,CAACE,GAAG,CAAC,CAACc,KAAK,GAAGT,OAAO,CAACS,KAAK,CAAA;AAC7C,OAAA;AACJ,KAAA;AACJ,GAAA;;AAEA;EACA,KAAK,IAAMd,IAAG,IAAIW,UAAU,CAACI,QAAQ,IAAI,EAAE,EAAE;AACzC,IAAA,IAAI,EAAEf,IAAG,IAAID,GAAG,CAACgB,QAAQ,CAAC,EAAE;MACxBhB,GAAG,CAACgB,QAAQ,CAACf,IAAG,CAAC,GAAGW,UAAU,CAACI,QAAQ,CAACf,IAAG,CAAC,CAAA;AAChD,KAAA;AACJ,GAAA;AAEA,EAAA,OAAOD,GAAG,CAAA;AAMd,EAAC;AAEM,SAASiB,SAASA,CAMrBnB,MAAqE,EACjB;EACpD,IAAMoB,IAAI,GAAGpB,MAAM,CAACqB,MAAM,CAACC,kBAAU,CAAEtB,MAAqC,CAAC,CAAC,CAAA;AAE9E,EAAA,oBAAOuB,KAAK,CAACC,UAAU,CAAmC,UAACjB,KAAK,EAAEkB,GAAG,EAAA;AAAA,IAAA,oBACjEF,KAAA,CAAAG,aAAA,CAACN,IAAI,EAAAO,iCAAA,CAAA,EAAA,EAAK3B,MAAM,KAAA,IAAA,IAANA,MAAM,KAANA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAM,CAAEkB,QAAQ,EAAMX,KAAK,EAAA;AAAEkB,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAAA,GACtD,CAAC,CAAA;AACN;;;;;;;"}
|
package/cjs/engines/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/engines/index.ts"],"sourcesContent":["import { css as cssLibrary } from '@linaria/core';\n\nimport type { CSS } from './types';\n\nexport const css = cssLibrary as CSS;\nexport { mergeConfig, component } from './common';\n\nexport type { Variant, ComponentConfig, RootProps, CSS } from './types';\n"],"names":["css","cssLibrary"],"mappings":";;;;;;;;AAIO,IAAMA,GAAG,GAAGC;;;;"}
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/engines/index.ts"],"sourcesContent":["import { css as cssLibrary } from '@linaria/core';\n\nimport type { CSS } from './types';\n\nexport const css = cssLibrary as CSS;\nexport { mergeConfig, component } from './common';\n\nexport type { Variant, ComponentConfig, RootProps, CSS, RootPropsOmitOnChange } from './types';\n"],"names":["css","cssLibrary"],"mappings":";;;;;;;;AAIO,IAAMA,GAAG,GAAGC;;;;"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var React = require('react');
|
6
|
+
var canUseDOM = require('../utils/canUseDOM.js');
|
7
|
+
require('../utils/react.js');
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Runs effect safely on server.
|
11
|
+
*/
|
12
|
+
var useIsomorphicLayoutEffect = canUseDOM.canUseDOM ? React.useLayoutEffect : React.useEffect;
|
13
|
+
|
14
|
+
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
15
|
+
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useIsomorphicLayoutEffect.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nimport { canUseDOM } from '../utils';\n\n/**\n * Runs effect safely on server.\n */\nexport const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;\n"],"names":["useIsomorphicLayoutEffect","canUseDOM","useLayoutEffect","useEffect"],"mappings":";;;;;;;;AAIA;AACA;AACA;IACaA,yBAAyB,GAAGC,mBAAS,GAAGC,qBAAe,GAAGC;;;;"}
|