@salutejs/plasma-new-hope 0.170.0-canary.1488.11387414081.0 → 0.170.0-canary.1489.11387153757.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. package/cjs/index.css +0 -2
  2. package/cjs/index.js +0 -3
  3. package/cjs/index.js.map +1 -1
  4. package/emotion/cjs/examples/_helpers.js +14 -3
  5. package/emotion/cjs/examples/themes/declaration.d.ts +4 -0
  6. package/emotion/cjs/examples/themes/index.js +15 -0
  7. package/emotion/cjs/examples/themes/plasma_b2c.module.css +984 -0
  8. package/emotion/cjs/examples/themes/plasma_web.module.css +984 -0
  9. package/emotion/cjs/index.js +0 -11
  10. package/emotion/es/examples/_helpers.js +14 -3
  11. package/emotion/es/examples/themes/declaration.d.ts +4 -0
  12. package/emotion/es/examples/themes/index.js +7 -0
  13. package/emotion/es/examples/themes/plasma_b2c.module.css +984 -0
  14. package/emotion/es/examples/themes/plasma_web.module.css +984 -0
  15. package/emotion/es/index.js +1 -2
  16. package/es/index.css +0 -2
  17. package/es/index.js +0 -1
  18. package/es/index.js.map +1 -1
  19. package/package.json +4 -5
  20. package/styled-components/cjs/examples/_helpers.js +14 -3
  21. package/styled-components/cjs/examples/themes/declaration.d.ts +4 -0
  22. package/styled-components/cjs/examples/themes/index.js +15 -0
  23. package/styled-components/cjs/examples/themes/plasma_b2c.module.css +984 -0
  24. package/styled-components/cjs/examples/themes/plasma_web.module.css +984 -0
  25. package/styled-components/cjs/index.js +0 -11
  26. package/styled-components/es/examples/_helpers.js +14 -3
  27. package/styled-components/es/examples/themes/declaration.d.ts +4 -0
  28. package/styled-components/es/examples/themes/index.js +7 -0
  29. package/styled-components/es/examples/themes/plasma_b2c.module.css +984 -0
  30. package/styled-components/es/examples/themes/plasma_web.module.css +984 -0
  31. package/styled-components/es/index.js +1 -2
  32. package/types/examples/_helpers.d.ts.map +1 -1
  33. package/types/examples/themes/index.d.ts +6 -0
  34. package/types/examples/themes/index.d.ts.map +1 -0
  35. package/types/index.d.ts +0 -1
  36. package/types/index.d.ts.map +1 -1
  37. package/cjs/components/ViewContainer/ViewContainer.js +0 -38
  38. package/cjs/components/ViewContainer/ViewContainer.js.map +0 -1
  39. package/cjs/components/ViewContainer/ViewContainer_yiqfcb.css +0 -1
  40. package/cjs/components/ViewContainer/_view/base.js +0 -9
  41. package/cjs/components/ViewContainer/_view/base.js.map +0 -1
  42. package/cjs/components/ViewContainer/_view/base_x642ct.css +0 -1
  43. package/emotion/cjs/components/ViewContainer/ViewContainer.js +0 -49
  44. package/emotion/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +0 -82
  45. package/emotion/cjs/components/ViewContainer/_view/base.js +0 -8
  46. package/emotion/cjs/components/ViewContainer/_view/tokens.json +0 -1
  47. package/emotion/cjs/components/ViewContainer/index.js +0 -18
  48. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +0 -16
  49. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +0 -11
  50. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  51. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +0 -16
  52. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +0 -11
  53. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  54. package/emotion/es/components/ViewContainer/ViewContainer.js +0 -40
  55. package/emotion/es/components/ViewContainer/ViewContainer.template-doc.mdx +0 -82
  56. package/emotion/es/components/ViewContainer/_view/base.js +0 -2
  57. package/emotion/es/components/ViewContainer/_view/tokens.json +0 -1
  58. package/emotion/es/components/ViewContainer/index.js +0 -1
  59. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +0 -10
  60. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +0 -5
  61. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  62. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +0 -10
  63. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +0 -5
  64. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  65. package/es/components/ViewContainer/ViewContainer.js +0 -33
  66. package/es/components/ViewContainer/ViewContainer.js.map +0 -1
  67. package/es/components/ViewContainer/ViewContainer_yiqfcb.css +0 -1
  68. package/es/components/ViewContainer/_view/base.js +0 -5
  69. package/es/components/ViewContainer/_view/base.js.map +0 -1
  70. package/es/components/ViewContainer/_view/base_x642ct.css +0 -1
  71. package/styled-components/cjs/components/ViewContainer/ViewContainer.js +0 -40
  72. package/styled-components/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +0 -82
  73. package/styled-components/cjs/components/ViewContainer/_view/base.js +0 -8
  74. package/styled-components/cjs/components/ViewContainer/_view/tokens.json +0 -1
  75. package/styled-components/cjs/components/ViewContainer/index.js +0 -18
  76. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +0 -16
  77. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +0 -11
  78. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  79. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +0 -16
  80. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +0 -11
  81. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  82. package/styled-components/es/components/ViewContainer/ViewContainer.js +0 -31
  83. package/styled-components/es/components/ViewContainer/ViewContainer.template-doc.mdx +0 -82
  84. package/styled-components/es/components/ViewContainer/_view/base.js +0 -2
  85. package/styled-components/es/components/ViewContainer/_view/tokens.json +0 -1
  86. package/styled-components/es/components/ViewContainer/index.js +0 -1
  87. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +0 -10
  88. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +0 -5
  89. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  90. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +0 -10
  91. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +0 -5
  92. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +0 -65
  93. package/types/components/ViewContainer/ViewContainer.d.ts +0 -26
  94. package/types/components/ViewContainer/ViewContainer.d.ts.map +0 -1
  95. package/types/components/ViewContainer/_view/base.d.ts +0 -2
  96. package/types/components/ViewContainer/_view/base.d.ts.map +0 -1
  97. package/types/components/ViewContainer/index.d.ts +0 -2
  98. package/types/components/ViewContainer/index.d.ts.map +0 -1
  99. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts +0 -9
  100. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts.map +0 -1
  101. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts +0 -8
  102. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts.map +0 -1
  103. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts +0 -9
  104. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts.map +0 -1
  105. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts +0 -8
  106. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts.map +0 -1
@@ -1,5 +0,0 @@
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);
@@ -1,65 +0,0 @@
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
- };
@@ -1,10 +0,0 @@
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU11QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfd2ViL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */")),
7
- onLight: /*#__PURE__*/css(viewContainer.light, ";;label:plasma-new-hope__onLight;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9WaWV3Q29udGFpbmVyL1ZpZXdDb250YWluZXIuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVN3QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfd2ViL2NvbXBvbmVudHMvVmlld0NvbnRhaW5lci9WaWV3Q29udGFpbmVyLmNvbmZpZy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHZpZXdDb250YWluZXIgfSBmcm9tICdAc2FsdXRlanMvcGxhc21hLXRoZW1lcy90b2tlbnMvcGxhc21hX2IyYyc7XG5cbmV4cG9ydCBjb25zdCBjb25maWcgPSB7XG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBvbkRhcms6IGNzc2BcbiAgICAgICAgICAgICAgICAke3ZpZXdDb250YWluZXIuZGFya31cbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBvbkxpZ2h0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt2aWV3Q29udGFpbmVyLmxpZ2h0fVxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdfQ== */"))
8
- }
9
- }
10
- };
@@ -1,5 +0,0 @@
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);
@@ -1,65 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
1
- import './ViewContainer_yiqfcb.css';
2
- import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
3
- import React, { forwardRef } from 'react';
4
- import { base as base$1 } from './_view/base.js';
5
-
6
- var _excluded = ["children"];
7
- var base = "bemjbnt";
8
- var viewContainerRoot = function viewContainerRoot(Root) {
9
- return /*#__PURE__*/forwardRef(function (props, ref) {
10
- var children = props.children,
11
- rest = _objectWithoutProperties(props, _excluded);
12
- return /*#__PURE__*/React.createElement(Root, _extends({
13
- ref: ref
14
- }, rest), children);
15
- });
16
- };
17
- var viewContainerConfig = {
18
- name: 'ViewContainer',
19
- tag: 'div',
20
- layout: viewContainerRoot,
21
- base: base,
22
- variations: {
23
- view: {
24
- css: base$1
25
- }
26
- },
27
- defaults: {
28
- view: undefined
29
- }
30
- };
31
-
32
- export { viewContainerConfig, viewContainerRoot };
33
- //# sourceMappingURL=ViewContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewContainer.js","sources":["../../../src/components/ViewContainer/ViewContainer.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { css } from '@linaria/core';\n\nimport type { RootProps } from '../../engines/types';\n\nimport { base as viewCSS } from './_view/base';\n\nconst base = css`\n position: relative;\n`;\n\nexport type ViewContainerCustomProps = {\n /**\n * Вид компонента\n */\n view?: string;\n};\n\ntype ViewContainerProps = React.HTMLAttributes<HTMLDivElement> & ViewContainerCustomProps;\n\nexport const viewContainerRoot = (Root: RootProps<HTMLAnchorElement, ViewContainerProps>) =>\n forwardRef<HTMLAnchorElement, ViewContainerProps>((props, ref) => {\n const { children, ...rest } = props;\n\n return (\n <Root ref={ref} {...rest}>\n {children}\n </Root>\n );\n });\n\nexport const viewContainerConfig = {\n name: 'ViewContainer',\n tag: 'div',\n layout: viewContainerRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: undefined,\n },\n};\n"],"names":["base","viewContainerRoot","Root","forwardRef","props","ref","children","rest","_excluded","React","createElement","_extends","viewContainerConfig","name","tag","layout","variations","view","css","viewCSS","defaults","undefined"],"mappings":";;;;;AAOA,IAAMA,IAAI,GAET,SAAA,CAAA;IAWYC,iBAAiB,GAAGA,SAApBA,iBAAiBA,CAAIC,IAAsD,EAAA;AAAA,EAAA,oBACpFC,UAAU,CAAwC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAC9D,IAAA,IAAQC,QAAQ,GAAcF,KAAK,CAA3BE,QAAQ;AAAKC,MAAAA,IAAAA,GAAAA,wBAAAA,CAASH,KAAK,EAAAI,SAAA,CAAA,CAAA;AAEnC,IAAA,oBACIC,KAAA,CAAAC,aAAA,CAACR,IAAI,EAAAS,QAAA,CAAA;AAACN,MAAAA,GAAG,EAAEA,GAAAA;KAASE,EAAAA,IAAI,CACnBD,EAAAA,QACC,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMM,mBAAmB,GAAG;AAC/BC,EAAAA,IAAI,EAAE,eAAe;AACrBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEd,iBAAiB;AACzBD,EAAAA,IAAI,EAAJA,IAAI;AACJgB,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNH,IAAAA,IAAI,EAAEI,SAAAA;AACV,GAAA;AACJ;;;;"}
@@ -1 +0,0 @@
1
- .bemjbnt{position:relative;}
@@ -1,5 +0,0 @@
1
- import './base_x642ct.css';
2
- var base = "bhhdltp";
3
-
4
- export { base };
5
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sources":["../../../../src/components/ViewContainer/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.viewContainerRoot = exports.viewContainerConfig = void 0;
8
- var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
- var _styledComponents = /*#__PURE__*/require("styled-components");
10
- var _base = /*#__PURE__*/require("./_view/base");
11
- var _excluded = ["children"];
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
14
- 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); }
15
- 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; }
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
- var base = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;"]);
18
- var viewContainerRoot = exports.viewContainerRoot = function viewContainerRoot(Root) {
19
- return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
20
- var children = props.children,
21
- rest = _objectWithoutProperties(props, _excluded);
22
- return /*#__PURE__*/_react["default"].createElement(Root, _extends({
23
- ref: ref
24
- }, rest), children);
25
- });
26
- };
27
- var viewContainerConfig = exports.viewContainerConfig = {
28
- name: 'ViewContainer',
29
- tag: 'div',
30
- layout: viewContainerRoot,
31
- base: base,
32
- variations: {
33
- view: {
34
- css: _base.base
35
- }
36
- },
37
- defaults: {
38
- view: undefined
39
- }
40
- };
@@ -1,82 +0,0 @@
1
- ---
2
- id: link
3
- title: Link
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
- ```
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.base = void 0;
7
- var _styledComponents = /*#__PURE__*/require("styled-components");
8
- var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)([""]);
@@ -1,18 +0,0 @@
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");
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.config = void 0;
7
- var _styledComponents = /*#__PURE__*/require("styled-components");
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, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.dark),
13
- onLight: /*#__PURE__*/(0, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.light)
14
- }
15
- }
16
- };
@@ -1,11 +0,0 @@
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);
@@ -1,65 +0,0 @@
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
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.config = void 0;
7
- var _styledComponents = /*#__PURE__*/require("styled-components");
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, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.dark),
13
- onLight: /*#__PURE__*/(0, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.light)
14
- }
15
- }
16
- };
@@ -1,11 +0,0 @@
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);
@@ -1,65 +0,0 @@
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
- };
@@ -1,31 +0,0 @@
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
- import React, { forwardRef } from 'react';
6
- import { css } from 'styled-components';
7
- import { base as viewCSS } from './_view/base';
8
- var base = /*#__PURE__*/css(["position:relative;"]);
9
- export var viewContainerRoot = function viewContainerRoot(Root) {
10
- return /*#__PURE__*/forwardRef(function (props, ref) {
11
- var children = props.children,
12
- rest = _objectWithoutProperties(props, _excluded);
13
- return /*#__PURE__*/React.createElement(Root, _extends({
14
- ref: ref
15
- }, rest), children);
16
- });
17
- };
18
- export var viewContainerConfig = {
19
- name: 'ViewContainer',
20
- tag: 'div',
21
- layout: viewContainerRoot,
22
- base: base,
23
- variations: {
24
- view: {
25
- css: viewCSS
26
- }
27
- },
28
- defaults: {
29
- view: undefined
30
- }
31
- };