@salutejs/plasma-new-hope 0.174.0-canary.1511.11518967304.0 → 0.174.1-canary.1512.11549467998.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Drawer/Drawer.js +2 -1
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -1
- package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
- package/cjs/components/Popover/Popover.js +2 -1
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/components/ViewContainer/ViewContainer.js +38 -0
- package/cjs/components/ViewContainer/ViewContainer.js.map +1 -0
- package/cjs/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
- package/cjs/components/{NumberInput/variations → ViewContainer}/_view/base.js +2 -2
- package/cjs/components/ViewContainer/_view/base.js.map +1 -0
- package/cjs/index.css +1 -24
- package/cjs/index.js +3 -6
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Drawer/Drawer.js +4 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -1
- package/emotion/cjs/components/Popover/Popover.js +2 -1
- package/emotion/cjs/components/ViewContainer/ViewContainer.js +49 -0
- package/emotion/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/emotion/cjs/components/ViewContainer/_view/base.js +8 -0
- package/emotion/cjs/components/ViewContainer/_view/tokens.json +1 -0
- package/emotion/cjs/components/ViewContainer/index.js +18 -0
- package/emotion/cjs/examples/_helpers.js +3 -14
- package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
- package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
- package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
- package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
- package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/cjs/index.js +4 -4
- package/emotion/es/components/Drawer/Drawer.js +2 -1
- package/emotion/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -1
- package/emotion/es/components/Popover/Popover.js +2 -1
- package/emotion/es/components/ViewContainer/ViewContainer.js +40 -0
- package/emotion/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/emotion/es/components/ViewContainer/_view/base.js +2 -0
- package/emotion/es/components/ViewContainer/_view/tokens.json +1 -0
- package/emotion/es/components/ViewContainer/index.js +1 -0
- package/emotion/es/examples/_helpers.js +3 -14
- package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
- package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
- package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
- package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
- package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/es/index.js +1 -1
- package/es/components/Drawer/Drawer.js +2 -1
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -1
- package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
- package/es/components/Popover/Popover.js +2 -1
- package/es/components/Popover/Popover.js.map +1 -1
- package/es/components/ViewContainer/ViewContainer.js +33 -0
- package/es/components/ViewContainer/ViewContainer.js.map +1 -0
- package/es/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
- package/es/components/{NumberInput/variations/_segmentation → ViewContainer/_view}/base.js +2 -2
- package/es/components/ViewContainer/_view/base.js.map +1 -0
- package/es/index.css +1 -24
- package/es/index.js +1 -2
- package/es/index.js.map +1 -1
- package/package.json +3 -2
- package/styled-components/cjs/components/Drawer/Drawer.js +4 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -1
- package/styled-components/cjs/components/Popover/Popover.js +2 -1
- package/styled-components/cjs/components/ViewContainer/ViewContainer.js +40 -0
- package/styled-components/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/styled-components/cjs/components/{NumberInput/NumberInput.styles.js → ViewContainer/_view/base.js} +1 -1
- package/styled-components/cjs/components/ViewContainer/_view/tokens.json +1 -0
- package/styled-components/cjs/components/ViewContainer/index.js +18 -0
- package/styled-components/cjs/examples/_helpers.js +3 -14
- package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
- package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
- package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/cjs/index.js +4 -4
- package/styled-components/es/components/Drawer/Drawer.js +2 -1
- package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -1
- package/styled-components/es/components/Popover/Popover.js +2 -1
- package/styled-components/es/components/ViewContainer/ViewContainer.js +31 -0
- package/styled-components/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/styled-components/es/components/ViewContainer/_view/base.js +2 -0
- package/styled-components/es/components/ViewContainer/_view/tokens.json +1 -0
- package/styled-components/es/components/ViewContainer/index.js +1 -0
- package/styled-components/es/examples/_helpers.js +3 -14
- package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
- package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
- package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
- package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/es/index.js +1 -1
- package/types/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts.map +1 -1
- package/types/components/Popover/Popover.d.ts.map +1 -1
- package/types/components/ViewContainer/ViewContainer.d.ts +26 -0
- package/types/components/ViewContainer/ViewContainer.d.ts.map +1 -0
- package/types/components/ViewContainer/_view/base.d.ts.map +1 -0
- package/types/components/ViewContainer/index.d.ts +2 -0
- package/types/components/ViewContainer/index.d.ts.map +1 -0
- package/types/examples/_helpers.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts +9 -0
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts +8 -0
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts.map +1 -0
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts +9 -0
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts +8 -0
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts.map +1 -0
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/cjs/components/NumberInput/NumberInput.css +0 -54
- package/cjs/components/NumberInput/NumberInput.js +0 -188
- package/cjs/components/NumberInput/NumberInput.js.map +0 -1
- package/cjs/components/NumberInput/NumberInput.styles.js +0 -9
- package/cjs/components/NumberInput/NumberInput.styles.js.map +0 -1
- package/cjs/components/NumberInput/NumberInput.styles_jeawjl.css +0 -1
- package/cjs/components/NumberInput/NumberInput.tokens.js +0 -90
- package/cjs/components/NumberInput/NumberInput.tokens.js.map +0 -1
- package/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -19
- package/cjs/components/NumberInput/ui/ActionButton/ActionButton.js.map +0 -1
- package/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -22
- package/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js.map +0 -1
- package/cjs/components/NumberInput/ui/Input/Input.css +0 -15
- package/cjs/components/NumberInput/ui/Input/Input.js +0 -190
- package/cjs/components/NumberInput/ui/Input/Input.js.map +0 -1
- package/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -96
- package/cjs/components/NumberInput/ui/Input/Input.styles.js.map +0 -1
- package/cjs/components/NumberInput/ui/Input/Input.styles_jszc0c.css +0 -8
- package/cjs/components/NumberInput/utils/index.js +0 -8
- package/cjs/components/NumberInput/utils/index.js.map +0 -1
- package/cjs/components/NumberInput/variations/_background-type/base.js +0 -9
- package/cjs/components/NumberInput/variations/_background-type/base.js.map +0 -1
- package/cjs/components/NumberInput/variations/_background-type/base_1jmdljr.css +0 -1
- package/cjs/components/NumberInput/variations/_clear/base.js +0 -9
- package/cjs/components/NumberInput/variations/_clear/base.js.map +0 -1
- package/cjs/components/NumberInput/variations/_clear/base_3l8dqb.css +0 -1
- package/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
- package/cjs/components/NumberInput/variations/_disabled/base.js.map +0 -1
- package/cjs/components/NumberInput/variations/_disabled/base_1sl0mh8.css +0 -1
- package/cjs/components/NumberInput/variations/_segmentation/base.js +0 -9
- package/cjs/components/NumberInput/variations/_segmentation/base.js.map +0 -1
- package/cjs/components/NumberInput/variations/_segmentation/base_nl8ve.css +0 -1
- package/cjs/components/NumberInput/variations/_shape/base.js +0 -9
- package/cjs/components/NumberInput/variations/_shape/base.js.map +0 -1
- package/cjs/components/NumberInput/variations/_shape/base_k05biw.css +0 -1
- package/cjs/components/NumberInput/variations/_size/base.js +0 -9
- package/cjs/components/NumberInput/variations/_size/base.js.map +0 -1
- package/cjs/components/NumberInput/variations/_size/base_1pju5qf.css +0 -1
- package/cjs/components/NumberInput/variations/_view/base.js.map +0 -1
- package/cjs/components/NumberInput/variations/_view/base_cghr9q.css +0 -1
- package/emotion/cjs/components/NumberInput/NumberInput.js +0 -198
- package/emotion/cjs/components/NumberInput/NumberInput.styles.js +0 -17
- package/emotion/cjs/components/NumberInput/NumberInput.tokens.js +0 -87
- package/emotion/cjs/components/NumberInput/NumberInput.types.js +0 -5
- package/emotion/cjs/components/NumberInput/index.js +0 -31
- package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -18
- package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -16
- package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -5
- package/emotion/cjs/components/NumberInput/ui/Input/Input.js +0 -198
- package/emotion/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -82
- package/emotion/cjs/components/NumberInput/ui/Input/Input.types.js +0 -5
- package/emotion/cjs/components/NumberInput/ui/index.js +0 -19
- package/emotion/cjs/components/NumberInput/utils/index.js +0 -7
- package/emotion/cjs/components/NumberInput/variations/_background-type/base.js +0 -10
- package/emotion/cjs/components/NumberInput/variations/_background-type/tokens.json +0 -6
- package/emotion/cjs/components/NumberInput/variations/_clear/base.js +0 -12
- package/emotion/cjs/components/NumberInput/variations/_clear/tokens.json +0 -5
- package/emotion/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
- package/emotion/cjs/components/NumberInput/variations/_disabled/tokens.json +0 -4
- package/emotion/cjs/components/NumberInput/variations/_segmentation/base.js +0 -12
- package/emotion/cjs/components/NumberInput/variations/_segmentation/tokens.json +0 -1
- package/emotion/cjs/components/NumberInput/variations/_shape/base.js +0 -11
- package/emotion/cjs/components/NumberInput/variations/_shape/tokens.json +0 -1
- package/emotion/cjs/components/NumberInput/variations/_size/base.js +0 -13
- package/emotion/cjs/components/NumberInput/variations/_size/tokens.json +0 -22
- package/emotion/cjs/components/NumberInput/variations/_view/base.js +0 -13
- package/emotion/cjs/components/NumberInput/variations/_view/tokens.json +0 -14
- package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -48
- package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -11
- package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -48
- package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.js +0 -11
- package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/emotion/cjs/examples/themes/declaration.d.ts +0 -4
- package/emotion/cjs/examples/themes/index.js +0 -15
- package/emotion/cjs/examples/themes/plasma_b2c.module.css +0 -984
- package/emotion/cjs/examples/themes/plasma_web.module.css +0 -984
- package/emotion/es/components/NumberInput/NumberInput.js +0 -190
- package/emotion/es/components/NumberInput/NumberInput.styles.js +0 -11
- package/emotion/es/components/NumberInput/NumberInput.tokens.js +0 -81
- package/emotion/es/components/NumberInput/NumberInput.types.js +0 -1
- package/emotion/es/components/NumberInput/index.js +0 -2
- package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -11
- package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -9
- package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -1
- package/emotion/es/components/NumberInput/ui/Input/Input.js +0 -189
- package/emotion/es/components/NumberInput/ui/Input/Input.styles.js +0 -75
- package/emotion/es/components/NumberInput/ui/Input/Input.types.js +0 -1
- package/emotion/es/components/NumberInput/ui/index.js +0 -2
- package/emotion/es/components/NumberInput/utils/index.js +0 -1
- package/emotion/es/components/NumberInput/variations/_background-type/base.js +0 -4
- package/emotion/es/components/NumberInput/variations/_background-type/tokens.json +0 -6
- package/emotion/es/components/NumberInput/variations/_clear/base.js +0 -6
- package/emotion/es/components/NumberInput/variations/_clear/tokens.json +0 -5
- package/emotion/es/components/NumberInput/variations/_disabled/base.js +0 -3
- package/emotion/es/components/NumberInput/variations/_disabled/tokens.json +0 -4
- package/emotion/es/components/NumberInput/variations/_segmentation/base.js +0 -6
- package/emotion/es/components/NumberInput/variations/_segmentation/tokens.json +0 -1
- package/emotion/es/components/NumberInput/variations/_shape/base.js +0 -5
- package/emotion/es/components/NumberInput/variations/_shape/tokens.json +0 -1
- package/emotion/es/components/NumberInput/variations/_size/base.js +0 -7
- package/emotion/es/components/NumberInput/variations/_size/tokens.json +0 -22
- package/emotion/es/components/NumberInput/variations/_view/base.js +0 -7
- package/emotion/es/components/NumberInput/variations/_view/tokens.json +0 -14
- package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -42
- package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -5
- package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -42
- package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.js +0 -5
- package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/emotion/es/examples/themes/declaration.d.ts +0 -4
- package/emotion/es/examples/themes/index.js +0 -7
- package/emotion/es/examples/themes/plasma_b2c.module.css +0 -984
- package/emotion/es/examples/themes/plasma_web.module.css +0 -984
- package/es/components/NumberInput/NumberInput.css +0 -54
- package/es/components/NumberInput/NumberInput.js +0 -183
- package/es/components/NumberInput/NumberInput.js.map +0 -1
- package/es/components/NumberInput/NumberInput.styles.js +0 -5
- package/es/components/NumberInput/NumberInput.styles.js.map +0 -1
- package/es/components/NumberInput/NumberInput.styles_jeawjl.css +0 -1
- package/es/components/NumberInput/NumberInput.tokens.js +0 -84
- package/es/components/NumberInput/NumberInput.tokens.js.map +0 -1
- package/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -15
- package/es/components/NumberInput/ui/ActionButton/ActionButton.js.map +0 -1
- package/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -18
- package/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js.map +0 -1
- package/es/components/NumberInput/ui/Input/Input.css +0 -15
- package/es/components/NumberInput/ui/Input/Input.js +0 -186
- package/es/components/NumberInput/ui/Input/Input.js.map +0 -1
- package/es/components/NumberInput/ui/Input/Input.styles.js +0 -85
- package/es/components/NumberInput/ui/Input/Input.styles.js.map +0 -1
- package/es/components/NumberInput/ui/Input/Input.styles_jszc0c.css +0 -8
- package/es/components/NumberInput/utils/index.js +0 -4
- package/es/components/NumberInput/utils/index.js.map +0 -1
- package/es/components/NumberInput/variations/_background-type/base.js +0 -5
- package/es/components/NumberInput/variations/_background-type/base.js.map +0 -1
- package/es/components/NumberInput/variations/_background-type/base_1jmdljr.css +0 -1
- package/es/components/NumberInput/variations/_clear/base.js +0 -5
- package/es/components/NumberInput/variations/_clear/base.js.map +0 -1
- package/es/components/NumberInput/variations/_clear/base_3l8dqb.css +0 -1
- package/es/components/NumberInput/variations/_disabled/base.js +0 -5
- package/es/components/NumberInput/variations/_disabled/base.js.map +0 -1
- package/es/components/NumberInput/variations/_disabled/base_1sl0mh8.css +0 -1
- package/es/components/NumberInput/variations/_segmentation/base.js.map +0 -1
- package/es/components/NumberInput/variations/_segmentation/base_nl8ve.css +0 -1
- package/es/components/NumberInput/variations/_shape/base.js +0 -5
- package/es/components/NumberInput/variations/_shape/base.js.map +0 -1
- package/es/components/NumberInput/variations/_shape/base_k05biw.css +0 -1
- package/es/components/NumberInput/variations/_size/base.js +0 -5
- package/es/components/NumberInput/variations/_size/base.js.map +0 -1
- package/es/components/NumberInput/variations/_size/base_1pju5qf.css +0 -1
- package/es/components/NumberInput/variations/_view/base.js +0 -5
- package/es/components/NumberInput/variations/_view/base.js.map +0 -1
- package/es/components/NumberInput/variations/_view/base_cghr9q.css +0 -1
- package/styled-components/cjs/components/NumberInput/NumberInput.js +0 -198
- package/styled-components/cjs/components/NumberInput/NumberInput.tokens.js +0 -87
- package/styled-components/cjs/components/NumberInput/NumberInput.types.js +0 -5
- package/styled-components/cjs/components/NumberInput/index.js +0 -31
- package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -18
- package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -15
- package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -5
- package/styled-components/cjs/components/NumberInput/ui/Input/Input.js +0 -198
- package/styled-components/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -49
- package/styled-components/cjs/components/NumberInput/ui/Input/Input.types.js +0 -5
- package/styled-components/cjs/components/NumberInput/ui/index.js +0 -19
- package/styled-components/cjs/components/NumberInput/utils/index.js +0 -7
- package/styled-components/cjs/components/NumberInput/variations/_background-type/base.js +0 -10
- package/styled-components/cjs/components/NumberInput/variations/_background-type/tokens.json +0 -6
- package/styled-components/cjs/components/NumberInput/variations/_clear/base.js +0 -12
- package/styled-components/cjs/components/NumberInput/variations/_clear/tokens.json +0 -5
- package/styled-components/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
- package/styled-components/cjs/components/NumberInput/variations/_disabled/tokens.json +0 -4
- package/styled-components/cjs/components/NumberInput/variations/_segmentation/base.js +0 -12
- package/styled-components/cjs/components/NumberInput/variations/_segmentation/tokens.json +0 -1
- package/styled-components/cjs/components/NumberInput/variations/_shape/base.js +0 -11
- package/styled-components/cjs/components/NumberInput/variations/_shape/tokens.json +0 -1
- package/styled-components/cjs/components/NumberInput/variations/_size/base.js +0 -13
- package/styled-components/cjs/components/NumberInput/variations/_size/tokens.json +0 -22
- package/styled-components/cjs/components/NumberInput/variations/_view/base.js +0 -13
- package/styled-components/cjs/components/NumberInput/variations/_view/tokens.json +0 -14
- package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -48
- package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -11
- package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -48
- package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.js +0 -11
- package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/styled-components/cjs/examples/themes/declaration.d.ts +0 -4
- package/styled-components/cjs/examples/themes/index.js +0 -15
- package/styled-components/cjs/examples/themes/plasma_b2c.module.css +0 -984
- package/styled-components/cjs/examples/themes/plasma_web.module.css +0 -984
- package/styled-components/es/components/NumberInput/NumberInput.js +0 -190
- package/styled-components/es/components/NumberInput/NumberInput.styles.js +0 -2
- package/styled-components/es/components/NumberInput/NumberInput.tokens.js +0 -81
- package/styled-components/es/components/NumberInput/NumberInput.types.js +0 -1
- package/styled-components/es/components/NumberInput/index.js +0 -2
- package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -11
- package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -8
- package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -1
- package/styled-components/es/components/NumberInput/ui/Input/Input.js +0 -189
- package/styled-components/es/components/NumberInput/ui/Input/Input.styles.js +0 -42
- package/styled-components/es/components/NumberInput/ui/Input/Input.types.js +0 -1
- package/styled-components/es/components/NumberInput/ui/index.js +0 -2
- package/styled-components/es/components/NumberInput/utils/index.js +0 -1
- package/styled-components/es/components/NumberInput/variations/_background-type/base.js +0 -4
- package/styled-components/es/components/NumberInput/variations/_background-type/tokens.json +0 -6
- package/styled-components/es/components/NumberInput/variations/_clear/base.js +0 -6
- package/styled-components/es/components/NumberInput/variations/_clear/tokens.json +0 -5
- package/styled-components/es/components/NumberInput/variations/_disabled/base.js +0 -3
- package/styled-components/es/components/NumberInput/variations/_disabled/tokens.json +0 -4
- package/styled-components/es/components/NumberInput/variations/_segmentation/base.js +0 -6
- package/styled-components/es/components/NumberInput/variations/_segmentation/tokens.json +0 -1
- package/styled-components/es/components/NumberInput/variations/_shape/base.js +0 -5
- package/styled-components/es/components/NumberInput/variations/_shape/tokens.json +0 -1
- package/styled-components/es/components/NumberInput/variations/_size/base.js +0 -7
- package/styled-components/es/components/NumberInput/variations/_size/tokens.json +0 -22
- package/styled-components/es/components/NumberInput/variations/_view/base.js +0 -7
- package/styled-components/es/components/NumberInput/variations/_view/tokens.json +0 -14
- package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -42
- package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -5
- package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -42
- package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.js +0 -5
- package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -109
- package/styled-components/es/examples/themes/declaration.d.ts +0 -4
- package/styled-components/es/examples/themes/index.js +0 -7
- package/styled-components/es/examples/themes/plasma_b2c.module.css +0 -984
- package/styled-components/es/examples/themes/plasma_web.module.css +0 -984
- package/types/components/NumberInput/NumberInput.d.ts +0 -42
- package/types/components/NumberInput/NumberInput.d.ts.map +0 -1
- package/types/components/NumberInput/NumberInput.styles.d.ts +0 -2
- package/types/components/NumberInput/NumberInput.styles.d.ts.map +0 -1
- package/types/components/NumberInput/NumberInput.tokens.d.ts +0 -76
- package/types/components/NumberInput/NumberInput.tokens.d.ts.map +0 -1
- package/types/components/NumberInput/NumberInput.types.d.ts +0 -112
- package/types/components/NumberInput/NumberInput.types.d.ts.map +0 -1
- package/types/components/NumberInput/index.d.ts +0 -3
- package/types/components/NumberInput/index.d.ts.map +0 -1
- package/types/components/NumberInput/ui/ActionButton/ActionButton.d.ts +0 -4
- package/types/components/NumberInput/ui/ActionButton/ActionButton.d.ts.map +0 -1
- package/types/components/NumberInput/ui/ActionButton/ActionButton.styles.d.ts +0 -45
- package/types/components/NumberInput/ui/ActionButton/ActionButton.styles.d.ts.map +0 -1
- package/types/components/NumberInput/ui/ActionButton/ActionButton.types.d.ts +0 -7
- package/types/components/NumberInput/ui/ActionButton/ActionButton.types.d.ts.map +0 -1
- package/types/components/NumberInput/ui/Input/Input.d.ts +0 -16
- package/types/components/NumberInput/ui/Input/Input.d.ts.map +0 -1
- package/types/components/NumberInput/ui/Input/Input.styles.d.ts +0 -30
- package/types/components/NumberInput/ui/Input/Input.styles.d.ts.map +0 -1
- package/types/components/NumberInput/ui/Input/Input.types.d.ts +0 -16
- package/types/components/NumberInput/ui/Input/Input.types.d.ts.map +0 -1
- package/types/components/NumberInput/ui/index.d.ts +0 -3
- package/types/components/NumberInput/ui/index.d.ts.map +0 -1
- package/types/components/NumberInput/utils/index.d.ts +0 -2
- package/types/components/NumberInput/utils/index.d.ts.map +0 -1
- package/types/components/NumberInput/variations/_background-type/base.d.ts.map +0 -1
- package/types/components/NumberInput/variations/_clear/base.d.ts +0 -2
- package/types/components/NumberInput/variations/_clear/base.d.ts.map +0 -1
- package/types/components/NumberInput/variations/_disabled/base.d.ts +0 -2
- package/types/components/NumberInput/variations/_disabled/base.d.ts.map +0 -1
- package/types/components/NumberInput/variations/_segmentation/base.d.ts +0 -2
- package/types/components/NumberInput/variations/_segmentation/base.d.ts.map +0 -1
- package/types/components/NumberInput/variations/_shape/base.d.ts +0 -2
- package/types/components/NumberInput/variations/_shape/base.d.ts.map +0 -1
- package/types/components/NumberInput/variations/_size/base.d.ts +0 -2
- package/types/components/NumberInput/variations/_size/base.d.ts.map +0 -1
- package/types/components/NumberInput/variations/_view/base.d.ts +0 -2
- package/types/components/NumberInput/variations/_view/base.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/NumberInput/NumberInput.config.d.ts +0 -41
- package/types/examples/plasma_b2c/components/NumberInput/NumberInput.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/NumberInput/NumberInput.d.ts +0 -84
- package/types/examples/plasma_b2c/components/NumberInput/NumberInput.d.ts.map +0 -1
- package/types/examples/plasma_web/components/NumberInput/NumberInput.config.d.ts +0 -41
- package/types/examples/plasma_web/components/NumberInput/NumberInput.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/NumberInput/NumberInput.d.ts +0 -84
- package/types/examples/plasma_web/components/NumberInput/NumberInput.d.ts.map +0 -1
- package/types/examples/themes/index.d.ts +0 -6
- package/types/examples/themes/index.d.ts.map +0 -1
- /package/cjs/components/{NumberInput/ui/ActionButton/ActionButton.styles_x642ct.css → ViewContainer/_view/base_x642ct.css} +0 -0
- /package/es/components/{NumberInput/ui/ActionButton/ActionButton.styles_x642ct.css → ViewContainer/_view/base_x642ct.css} +0 -0
- /package/types/components/{NumberInput/variations/_background-type → ViewContainer/_view}/base.d.ts +0 -0
@@ -0,0 +1,82 @@
|
|
1
|
+
---
|
2
|
+
id: viewContainer
|
3
|
+
title: ViewContainer
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable, Description } from '@site/src/components';
|
7
|
+
|
8
|
+
# ViewContainer
|
9
|
+
<Description name="ViewContainer" />
|
10
|
+
<PropsTable name="ViewContainer" exclude={['css']} />
|
11
|
+
|
12
|
+
# Описание
|
13
|
+
|
14
|
+
Данный компонент представляет собой обёртку, которая инвертирует токены компонент, которые в неё помещены, в зависимости от выбранного значения свойства view - `onDark` или `onLight`.
|
15
|
+
|
16
|
+
При этом, независимо от режима темы (тёмный или светлый) для всего приложения, токены внутри не будут меняться.
|
17
|
+
|
18
|
+
Этот механизм необходим для случаев, когда требуется отобразить компонент на специфичном бэкграунде, чтобы избежать наложение цветов.
|
19
|
+
|
20
|
+
# Пример использования
|
21
|
+
|
22
|
+
```tsx live
|
23
|
+
import React from 'react';
|
24
|
+
import { ViewContainer, Button, Checkbox, TextField } from '@salutejs/{{ package }}';
|
25
|
+
|
26
|
+
export function App() {
|
27
|
+
return (
|
28
|
+
<div>
|
29
|
+
<ViewContainer
|
30
|
+
style=\{{
|
31
|
+
padding: '1rem',
|
32
|
+
borderRadius: '1rem',
|
33
|
+
display: 'flex',
|
34
|
+
flexDirection: 'column',
|
35
|
+
gap: '1rem',
|
36
|
+
}}
|
37
|
+
>
|
38
|
+
<h3 style=\{{ margin: 0 }}>Inside default ViewContainer</h3>
|
39
|
+
<Button text="default Button" />
|
40
|
+
<Checkbox checked label="Label" />
|
41
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
42
|
+
</ViewContainer>
|
43
|
+
<br />
|
44
|
+
<ViewContainer
|
45
|
+
view="onDark"
|
46
|
+
style=\{{
|
47
|
+
background: '#1a1a1a',
|
48
|
+
color: 'white',
|
49
|
+
padding: '1rem',
|
50
|
+
borderRadius: '1rem',
|
51
|
+
display: 'flex',
|
52
|
+
flexDirection: 'column',
|
53
|
+
gap: '1rem',
|
54
|
+
}}
|
55
|
+
>
|
56
|
+
<h3 style=\{{ margin: 0 }}>Inside onDark ViewContainer</h3>
|
57
|
+
<Button text="default Button" />
|
58
|
+
<Checkbox checked label="Label" />
|
59
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
60
|
+
</ViewContainer>
|
61
|
+
<br />
|
62
|
+
<ViewContainer
|
63
|
+
view="onLight"
|
64
|
+
style=\{{
|
65
|
+
background: '#ededed',
|
66
|
+
color: 'black',
|
67
|
+
padding: '1rem',
|
68
|
+
borderRadius: '1rem',
|
69
|
+
display: 'flex',
|
70
|
+
flexDirection: 'column',
|
71
|
+
gap: '1rem',
|
72
|
+
}}
|
73
|
+
>
|
74
|
+
<h3 style=\{{ margin: 0 }}>Inside onLight ViewContainer</h3>
|
75
|
+
<Button text="default Button" />
|
76
|
+
<Checkbox checked label="Label" />
|
77
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
78
|
+
</ViewContainer>
|
79
|
+
</div>
|
80
|
+
);
|
81
|
+
}
|
82
|
+
```
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.base = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
+
var base = exports.base = /*#__PURE__*/(0, _react.css)(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9fdmlldy9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUV1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ZpZXdDb250YWluZXIvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgYDtcbiJdfQ== */"));
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "viewContainerConfig", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _ViewContainer.viewContainerConfig;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "viewContainerRoot", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _ViewContainer.viewContainerRoot;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
var _ViewContainer = /*#__PURE__*/require("./ViewContainer");
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.WithTheme = void 0;
|
7
7
|
exports.argTypesFromConfig = argTypesFromConfig;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
9
|
-
var _themes = /*#__PURE__*/require("./themes");
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
10
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
12
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
@@ -15,19 +14,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
15
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
16
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
17
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
var themeName = context.title.split('/')[0];
|
22
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
23
|
-
id: "theme-root",
|
24
|
-
className: _themes.themes === null || _themes.themes === void 0 || (_themes$themeName = _themes.themes[themeName]) === null || _themes$themeName === void 0 ? void 0 : _themes$themeName[themeType],
|
25
|
-
style: {
|
26
|
-
padding: '1rem',
|
27
|
-
minHeight: '100vh',
|
28
|
-
boxSizing: 'border-box'
|
29
|
-
}
|
30
|
-
}, /*#__PURE__*/_react["default"].createElement(Story, null));
|
17
|
+
// TODO: Удалить в отдельном пр из всех компонент
|
18
|
+
var WithTheme = exports.WithTheme = function WithTheme(Story) {
|
19
|
+
return /*#__PURE__*/_react["default"].createElement(Story, null);
|
31
20
|
};
|
32
21
|
function argTypesFromConfig(config) {
|
33
22
|
var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.config = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
+
var _plasma_b2c = /*#__PURE__*/require("@salutejs/plasma-themes/tokens/plasma_b2c");
|
9
|
+
var config = exports.config = {
|
10
|
+
variations: {
|
11
|
+
view: {
|
12
|
+
onDark: /*#__PURE__*/(0, _react.css)(_plasma_b2c.viewContainer.dark, ";;label:plasma-new-hope__onDark;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU11QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfYjJjL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */")),
|
13
|
+
onLight: /*#__PURE__*/(0, _react.css)(_plasma_b2c.viewContainer.light, ";;label:plasma-new-hope__onLight;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVN3QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfYjJjL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */"))
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ViewContainer = void 0;
|
7
|
+
var _ViewContainer = /*#__PURE__*/require("../../../../components/ViewContainer");
|
8
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
+
var _ViewContainer2 = /*#__PURE__*/require("./ViewContainer.config");
|
10
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_ViewContainer.viewContainerConfig, _ViewContainer2.config);
|
11
|
+
var ViewContainer = exports.ViewContainer = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
|
4
|
+
import { Button } from '../Button/Button';
|
5
|
+
import { TextField } from '../TextField/TextField';
|
6
|
+
import { Checkbox } from '../Checkbox/Checkbox';
|
7
|
+
|
8
|
+
import { ViewContainer } from './ViewContainer';
|
9
|
+
|
10
|
+
type StoryViewProps = ComponentProps<typeof ViewContainer>;
|
11
|
+
|
12
|
+
const meta: Meta<StoryViewProps> = {
|
13
|
+
title: 'plasma_b2c/ViewContainer',
|
14
|
+
};
|
15
|
+
|
16
|
+
export default meta;
|
17
|
+
|
18
|
+
type Story = StoryObj<StoryViewProps>;
|
19
|
+
|
20
|
+
const ViewExample = ({ view }: StoryViewProps) => {
|
21
|
+
const style = view
|
22
|
+
? {
|
23
|
+
background: view === 'onDark' ? '#1a1a1a' : '#ededed',
|
24
|
+
color: view === 'onDark' ? 'white' : 'black',
|
25
|
+
}
|
26
|
+
: undefined;
|
27
|
+
|
28
|
+
return (
|
29
|
+
<>
|
30
|
+
<h4>view: {view ?? 'default'}</h4>
|
31
|
+
<div>
|
32
|
+
<ViewContainer
|
33
|
+
view={view}
|
34
|
+
style={{
|
35
|
+
...style,
|
36
|
+
padding: '1rem',
|
37
|
+
borderRadius: '1rem',
|
38
|
+
display: 'flex',
|
39
|
+
flexDirection: 'column',
|
40
|
+
gap: '1rem',
|
41
|
+
}}
|
42
|
+
>
|
43
|
+
<h3 style={{ margin: 0 }}>Inside ViewContainer</h3>
|
44
|
+
<Button text="default Button" />
|
45
|
+
<Checkbox checked label="Label" />
|
46
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
47
|
+
</ViewContainer>
|
48
|
+
</div>
|
49
|
+
</>
|
50
|
+
);
|
51
|
+
};
|
52
|
+
|
53
|
+
export const Default: Story = {
|
54
|
+
render: () => {
|
55
|
+
return (
|
56
|
+
<>
|
57
|
+
<ViewExample />
|
58
|
+
<br />
|
59
|
+
<ViewExample view="onDark" />
|
60
|
+
<br />
|
61
|
+
<ViewExample view="onLight" />
|
62
|
+
</>
|
63
|
+
);
|
64
|
+
},
|
65
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.config = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
+
var _plasma_b2c = /*#__PURE__*/require("@salutejs/plasma-themes/tokens/plasma_b2c");
|
9
|
+
var config = exports.config = {
|
10
|
+
variations: {
|
11
|
+
view: {
|
12
|
+
onDark: /*#__PURE__*/(0, _react.css)(_plasma_b2c.viewContainer.dark, ";;label:plasma-new-hope__onDark;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU11QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfd2ViL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */")),
|
13
|
+
onLight: /*#__PURE__*/(0, _react.css)(_plasma_b2c.viewContainer.light, ";;label:plasma-new-hope__onLight;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVN3QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfd2ViL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */"))
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ViewContainer = void 0;
|
7
|
+
var _ViewContainer = /*#__PURE__*/require("../../../../components/ViewContainer");
|
8
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
+
var _ViewContainer2 = /*#__PURE__*/require("./ViewContainer.config");
|
10
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_ViewContainer.viewContainerConfig, _ViewContainer2.config);
|
11
|
+
var ViewContainer = exports.ViewContainer = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
|
4
|
+
import { Button } from '../Button/Button';
|
5
|
+
import { TextField } from '../TextField/TextField';
|
6
|
+
import { Checkbox } from '../Checkbox/Checkbox';
|
7
|
+
|
8
|
+
import { ViewContainer } from './ViewContainer';
|
9
|
+
|
10
|
+
type StoryViewProps = ComponentProps<typeof ViewContainer>;
|
11
|
+
|
12
|
+
const meta: Meta<StoryViewProps> = {
|
13
|
+
title: 'plasma_web/ViewContainer',
|
14
|
+
};
|
15
|
+
|
16
|
+
export default meta;
|
17
|
+
|
18
|
+
type Story = StoryObj<StoryViewProps>;
|
19
|
+
|
20
|
+
const ViewExample = ({ view }: StoryViewProps) => {
|
21
|
+
const style = view
|
22
|
+
? {
|
23
|
+
background: view === 'onDark' ? '#1a1a1a' : '#ededed',
|
24
|
+
color: view === 'onDark' ? 'white' : 'black',
|
25
|
+
}
|
26
|
+
: undefined;
|
27
|
+
|
28
|
+
return (
|
29
|
+
<>
|
30
|
+
<h4>view: {view ?? 'default'}</h4>
|
31
|
+
<div>
|
32
|
+
<ViewContainer
|
33
|
+
view={view}
|
34
|
+
style={{
|
35
|
+
...style,
|
36
|
+
padding: '1rem',
|
37
|
+
borderRadius: '1rem',
|
38
|
+
display: 'flex',
|
39
|
+
flexDirection: 'column',
|
40
|
+
gap: '1rem',
|
41
|
+
}}
|
42
|
+
>
|
43
|
+
<h3 style={{ margin: 0 }}>Inside ViewContainer</h3>
|
44
|
+
<Button text="default Button" />
|
45
|
+
<Checkbox checked label="Label" />
|
46
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
47
|
+
</ViewContainer>
|
48
|
+
</div>
|
49
|
+
</>
|
50
|
+
);
|
51
|
+
};
|
52
|
+
|
53
|
+
export const Default: Story = {
|
54
|
+
render: () => {
|
55
|
+
return (
|
56
|
+
<>
|
57
|
+
<ViewExample />
|
58
|
+
<br />
|
59
|
+
<ViewExample view="onDark" />
|
60
|
+
<br />
|
61
|
+
<ViewExample view="onLight" />
|
62
|
+
</>
|
63
|
+
);
|
64
|
+
},
|
65
|
+
};
|
package/emotion/cjs/index.js
CHANGED
@@ -674,14 +674,14 @@ Object.keys(_Attach).forEach(function (key) {
|
|
674
674
|
}
|
675
675
|
});
|
676
676
|
});
|
677
|
-
var
|
678
|
-
Object.keys(
|
677
|
+
var _ViewContainer = /*#__PURE__*/require("./components/ViewContainer");
|
678
|
+
Object.keys(_ViewContainer).forEach(function (key) {
|
679
679
|
if (key === "default" || key === "__esModule") return;
|
680
|
-
if (key in exports && exports[key] ===
|
680
|
+
if (key in exports && exports[key] === _ViewContainer[key]) return;
|
681
681
|
Object.defineProperty(exports, key, {
|
682
682
|
enumerable: true,
|
683
683
|
get: function get() {
|
684
|
-
return
|
684
|
+
return _ViewContainer[key];
|
685
685
|
}
|
686
686
|
});
|
687
687
|
});
|
@@ -3,13 +3,14 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
5
|
import React, { forwardRef, useMemo } from 'react';
|
6
|
-
import {
|
6
|
+
import { useForkRef, safeUseId } from '@salutejs/plasma-core';
|
7
7
|
import { component, mergeConfig } from '../../engines';
|
8
8
|
import { usePopupContext } from '../Popup';
|
9
9
|
import { Overlay } from '../Overlay';
|
10
10
|
import { DEFAULT_Z_INDEX } from '../Popup/utils';
|
11
11
|
import { panelConfig } from '../Panel';
|
12
12
|
import { cx, getSizeValueFromProp } from '../../utils';
|
13
|
+
import { useFocusTrap } from '../../hooks';
|
13
14
|
import { classes, tokens } from './Drawer.tokens';
|
14
15
|
import { base as viewCSS } from './variations/_view/base';
|
15
16
|
import { base as sizeCSS } from './variations/_size/base';
|
@@ -3,7 +3,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
5
|
import React, { forwardRef, useRef } from 'react';
|
6
|
-
import {
|
6
|
+
import { useForkRef, useUniqId } from '@salutejs/plasma-core';
|
7
|
+
import { useFocusTrap } from '../../../../hooks';
|
7
8
|
import { base as viewCSS } from './variations/_view/base';
|
8
9
|
import { base as sizeCSS } from './variations/_size/base';
|
9
10
|
import { StyledDropdown, StyledPopover } from './Dropdown.styles';
|
@@ -16,7 +16,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
16
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
17
17
|
import React, { useRef, useCallback, useEffect, useState, forwardRef } from 'react';
|
18
18
|
import { usePopper } from 'react-popper';
|
19
|
-
import {
|
19
|
+
import { useForkRef } from '@salutejs/plasma-core';
|
20
|
+
import { useFocusTrap } from '../../hooks';
|
20
21
|
import { cx } from '../../utils';
|
21
22
|
import { Portal } from '../Portal';
|
22
23
|
import { base as viewCSS } from './variations/_view/base';
|
@@ -0,0 +1,40 @@
|
|
1
|
+
var _excluded = ["children"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
6
|
+
import React, { forwardRef } from 'react';
|
7
|
+
import { css } from '@emotion/react';
|
8
|
+
import { base as viewCSS } from './_view/base';
|
9
|
+
var base = process.env.NODE_ENV === "production" ? {
|
10
|
+
name: "y6axm9-plasma-new-hope__base",
|
11
|
+
styles: "position:relative;label:plasma-new-hope__base;"
|
12
|
+
} : {
|
13
|
+
name: "y6axm9-plasma-new-hope__base",
|
14
|
+
styles: "position:relative;label:plasma-new-hope__base;",
|
15
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPZ0IiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IGZvcndhcmRSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB0eXBlIHsgUm9vdFByb3BzIH0gZnJvbSAnLi4vLi4vZW5naW5lcy90eXBlcyc7XG5cbmltcG9ydCB7IGJhc2UgYXMgdmlld0NTUyB9IGZyb20gJy4vX3ZpZXcvYmFzZSc7XG5cbmNvbnN0IGJhc2UgPSBjc3NgXG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuYDtcblxuZXhwb3J0IHR5cGUgVmlld0NvbnRhaW5lckN1c3RvbVByb3BzID0ge1xuICAgIC8qKlxuICAgICAqINCS0LjQtCDQutC+0LzQv9C+0L3QtdC90YLQsFxuICAgICAqL1xuICAgIHZpZXc/OiBzdHJpbmc7XG59O1xuXG50eXBlIFZpZXdDb250YWluZXJQcm9wcyA9IFJlYWN0LkhUTUxBdHRyaWJ1dGVzPEhUTUxEaXZFbGVtZW50PiAmIFZpZXdDb250YWluZXJDdXN0b21Qcm9wcztcblxuZXhwb3J0IGNvbnN0IHZpZXdDb250YWluZXJSb290ID0gKFJvb3Q6IFJvb3RQcm9wczxIVE1MQW5jaG9yRWxlbWVudCwgVmlld0NvbnRhaW5lclByb3BzPikgPT5cbiAgICBmb3J3YXJkUmVmPEhUTUxBbmNob3JFbGVtZW50LCBWaWV3Q29udGFpbmVyUHJvcHM+KChwcm9wcywgcmVmKSA9PiB7XG4gICAgICAgIGNvbnN0IHsgY2hpbGRyZW4sIC4uLnJlc3QgfSA9IHByb3BzO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8Um9vdCByZWY9e3JlZn0gey4uLnJlc3R9PlxuICAgICAgICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgICAgIDwvUm9vdD5cbiAgICAgICAgKTtcbiAgICB9KTtcblxuZXhwb3J0IGNvbnN0IHZpZXdDb250YWluZXJDb25maWcgPSB7XG4gICAgbmFtZTogJ1ZpZXdDb250YWluZXInLFxuICAgIHRhZzogJ2RpdicsXG4gICAgbGF5b3V0OiB2aWV3Q29udGFpbmVyUm9vdCxcbiAgICBiYXNlLFxuICAgIHZhcmlhdGlvbnM6IHtcbiAgICAgICAgdmlldzoge1xuICAgICAgICAgICAgY3NzOiB2aWV3Q1NTLFxuICAgICAgICB9LFxuICAgIH0sXG4gICAgZGVmYXVsdHM6IHtcbiAgICAgICAgdmlldzogdW5kZWZpbmVkLFxuICAgIH0sXG59O1xuIl19 */",
|
16
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
17
|
+
};
|
18
|
+
export var viewContainerRoot = function viewContainerRoot(Root) {
|
19
|
+
return /*#__PURE__*/forwardRef(function (props, ref) {
|
20
|
+
var children = props.children,
|
21
|
+
rest = _objectWithoutProperties(props, _excluded);
|
22
|
+
return /*#__PURE__*/React.createElement(Root, _extends({
|
23
|
+
ref: ref
|
24
|
+
}, rest), children);
|
25
|
+
});
|
26
|
+
};
|
27
|
+
export var viewContainerConfig = {
|
28
|
+
name: 'ViewContainer',
|
29
|
+
tag: 'div',
|
30
|
+
layout: viewContainerRoot,
|
31
|
+
base: base,
|
32
|
+
variations: {
|
33
|
+
view: {
|
34
|
+
css: viewCSS
|
35
|
+
}
|
36
|
+
},
|
37
|
+
defaults: {
|
38
|
+
view: undefined
|
39
|
+
}
|
40
|
+
};
|
@@ -0,0 +1,82 @@
|
|
1
|
+
---
|
2
|
+
id: viewContainer
|
3
|
+
title: ViewContainer
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable, Description } from '@site/src/components';
|
7
|
+
|
8
|
+
# ViewContainer
|
9
|
+
<Description name="ViewContainer" />
|
10
|
+
<PropsTable name="ViewContainer" exclude={['css']} />
|
11
|
+
|
12
|
+
# Описание
|
13
|
+
|
14
|
+
Данный компонент представляет собой обёртку, которая инвертирует токены компонент, которые в неё помещены, в зависимости от выбранного значения свойства view - `onDark` или `onLight`.
|
15
|
+
|
16
|
+
При этом, независимо от режима темы (тёмный или светлый) для всего приложения, токены внутри не будут меняться.
|
17
|
+
|
18
|
+
Этот механизм необходим для случаев, когда требуется отобразить компонент на специфичном бэкграунде, чтобы избежать наложение цветов.
|
19
|
+
|
20
|
+
# Пример использования
|
21
|
+
|
22
|
+
```tsx live
|
23
|
+
import React from 'react';
|
24
|
+
import { ViewContainer, Button, Checkbox, TextField } from '@salutejs/{{ package }}';
|
25
|
+
|
26
|
+
export function App() {
|
27
|
+
return (
|
28
|
+
<div>
|
29
|
+
<ViewContainer
|
30
|
+
style=\{{
|
31
|
+
padding: '1rem',
|
32
|
+
borderRadius: '1rem',
|
33
|
+
display: 'flex',
|
34
|
+
flexDirection: 'column',
|
35
|
+
gap: '1rem',
|
36
|
+
}}
|
37
|
+
>
|
38
|
+
<h3 style=\{{ margin: 0 }}>Inside default ViewContainer</h3>
|
39
|
+
<Button text="default Button" />
|
40
|
+
<Checkbox checked label="Label" />
|
41
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
42
|
+
</ViewContainer>
|
43
|
+
<br />
|
44
|
+
<ViewContainer
|
45
|
+
view="onDark"
|
46
|
+
style=\{{
|
47
|
+
background: '#1a1a1a',
|
48
|
+
color: 'white',
|
49
|
+
padding: '1rem',
|
50
|
+
borderRadius: '1rem',
|
51
|
+
display: 'flex',
|
52
|
+
flexDirection: 'column',
|
53
|
+
gap: '1rem',
|
54
|
+
}}
|
55
|
+
>
|
56
|
+
<h3 style=\{{ margin: 0 }}>Inside onDark ViewContainer</h3>
|
57
|
+
<Button text="default Button" />
|
58
|
+
<Checkbox checked label="Label" />
|
59
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
60
|
+
</ViewContainer>
|
61
|
+
<br />
|
62
|
+
<ViewContainer
|
63
|
+
view="onLight"
|
64
|
+
style=\{{
|
65
|
+
background: '#ededed',
|
66
|
+
color: 'black',
|
67
|
+
padding: '1rem',
|
68
|
+
borderRadius: '1rem',
|
69
|
+
display: 'flex',
|
70
|
+
flexDirection: 'column',
|
71
|
+
gap: '1rem',
|
72
|
+
}}
|
73
|
+
>
|
74
|
+
<h3 style=\{{ margin: 0 }}>Inside onLight ViewContainer</h3>
|
75
|
+
<Button text="default Button" />
|
76
|
+
<Checkbox checked label="Label" />
|
77
|
+
<TextField value="Example Value" label="Label" labelPlacement="inner" />
|
78
|
+
</ViewContainer>
|
79
|
+
</div>
|
80
|
+
);
|
81
|
+
}
|
82
|
+
```
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { css } from '@emotion/react';
|
2
|
+
export var base = /*#__PURE__*/css(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9fdmlldy9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUV1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ZpZXdDb250YWluZXIvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgYDtcbiJdfQ== */"));
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1 @@
|
|
1
|
+
export { viewContainerRoot, viewContainerConfig } from './ViewContainer';
|
@@ -6,20 +6,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
6
6
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
8
8
|
import React from 'react';
|
9
|
-
|
10
|
-
export var WithTheme = function WithTheme(Story
|
11
|
-
|
12
|
-
var themeType = context.globals.theme;
|
13
|
-
var themeName = context.title.split('/')[0];
|
14
|
-
return /*#__PURE__*/React.createElement("div", {
|
15
|
-
id: "theme-root",
|
16
|
-
className: themes === null || themes === void 0 || (_themes$themeName = themes[themeName]) === null || _themes$themeName === void 0 ? void 0 : _themes$themeName[themeType],
|
17
|
-
style: {
|
18
|
-
padding: '1rem',
|
19
|
-
minHeight: '100vh',
|
20
|
-
boxSizing: 'border-box'
|
21
|
-
}
|
22
|
-
}, /*#__PURE__*/React.createElement(Story, null));
|
9
|
+
// TODO: Удалить в отдельном пр из всех компонент
|
10
|
+
export var WithTheme = function WithTheme(Story) {
|
11
|
+
return /*#__PURE__*/React.createElement(Story, null);
|
23
12
|
};
|
24
13
|
export function argTypesFromConfig(config) {
|
25
14
|
var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { css } from '@emotion/react';
|
2
|
+
import { viewContainer } from '@salutejs/plasma-themes/tokens/plasma_b2c';
|
3
|
+
export var config = {
|
4
|
+
variations: {
|
5
|
+
view: {
|
6
|
+
onDark: /*#__PURE__*/css(viewContainer.dark, ";;label:plasma-new-hope__onDark;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU11QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfYjJjL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */")),
|
7
|
+
onLight: /*#__PURE__*/css(viewContainer.light, ";;label:plasma-new-hope__onLight;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVN3QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfYjJjL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */"))
|
8
|
+
}
|
9
|
+
}
|
10
|
+
};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { viewContainerConfig } from '../../../../components/ViewContainer';
|
2
|
+
import { component, mergeConfig } from '../../../../engines';
|
3
|
+
import { config } from './ViewContainer.config';
|
4
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(viewContainerConfig, config);
|
5
|
+
export var ViewContainer = /*#__PURE__*/component(mergedConfig);
|