@salutejs/sdds-cs 0.313.1-canary.1931.14570122322.0 → 0.314.0-canary.1715.14635441934.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,17 @@
1
1
  import React, { useState } from 'react';
2
2
  import type { ComponentProps } from 'react';
3
3
  import type { Meta, StoryObj } from '@storybook/react';
4
- import { disableProps, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
4
+ import { disableProps, InSpacingDecorator, getConfigVariations } from '@salutejs/plasma-sb-utils';
5
5
  import { IconDone } from '@salutejs/plasma-icons';
6
6
 
7
7
  import { Combobox } from './Combobox';
8
+ import { config } from './Combobox.config';
8
9
 
9
10
  type StorySelectProps = ComponentProps<typeof Combobox> & {
10
11
  enableContentLeft?: boolean;
11
12
  };
12
13
 
13
- const view = ['default', 'negative'];
14
+ const { views } = getConfigVariations(config);
14
15
  const chip = ['default', 'secondary', 'accent'];
15
16
  const variant = ['normal', 'tight'];
16
17
 
@@ -20,7 +21,7 @@ const meta: Meta<StorySelectProps> = {
20
21
  component: Combobox,
21
22
  argTypes: {
22
23
  view: {
23
- options: view,
24
+ options: views,
24
25
  control: {
25
26
  type: 'select',
26
27
  },
@@ -367,13 +368,12 @@ const items = [
367
368
  {
368
369
  value: 'africa',
369
370
  label: 'Африка',
370
- isDisabled: true,
371
+ disabled: true,
371
372
  },
372
373
  ];
373
374
 
374
375
  const SingleStory = (args: StorySelectProps) => {
375
376
  const [value, setValue] = useState('');
376
-
377
377
  return (
378
378
  <div style={{ width: '400px' }}>
379
379
  <Combobox
@@ -382,6 +382,7 @@ const SingleStory = (args: StorySelectProps) => {
382
382
  value={value}
383
383
  onChange={setValue}
384
384
  contentLeft={args.enableContentLeft ? <IconDone size="s" /> : undefined}
385
+ onToggle={(e) => console.log(e)}
385
386
  />
386
387
  </div>
387
388
  );
@@ -389,6 +390,9 @@ const SingleStory = (args: StorySelectProps) => {
389
390
 
390
391
  export const Single: StoryObj<StorySelectProps> = {
391
392
  render: (args) => <SingleStory {...args} />,
393
+ args: {
394
+ closeAfterSelect: true,
395
+ },
392
396
  parameters: {
393
397
  controls: {
394
398
  exclude: ['isTargetAmount'],
@@ -415,4 +419,7 @@ const MultipleStory = (args: StorySelectProps) => {
415
419
 
416
420
  export const Multiple: StoryObj<StorySelectProps> = {
417
421
  render: (args) => <MultipleStory {...args} />,
422
+ args: {
423
+ closeAfterSelect: false,
424
+ },
418
425
  };
@@ -1,18 +1,19 @@
1
1
  import React, { useState } from 'react';
2
2
  import type { ComponentProps } from 'react';
3
3
  import type { Meta, StoryObj } from '@storybook/react';
4
- import { disableProps, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
4
+ import { disableProps, InSpacingDecorator, getConfigVariations } from '@salutejs/plasma-sb-utils';
5
5
  import { IconPlasma } from '@salutejs/plasma-icons';
6
6
 
7
7
  import './style.css';
8
8
 
9
9
  import { Select } from './Select';
10
+ import { config } from './Select.config';
10
11
 
11
12
  type StorySelectProps = ComponentProps<typeof Select> & {
12
13
  enableContentLeft?: boolean;
13
14
  };
14
15
 
15
- const view = ['default', 'negative'];
16
+ const { views } = getConfigVariations(config);
16
17
  const variant = ['normal', 'tight'];
17
18
 
18
19
  const meta: Meta<StorySelectProps> = {
@@ -25,8 +26,8 @@ const meta: Meta<StorySelectProps> = {
25
26
  options: ['button-like', 'textfield-like'],
26
27
  },
27
28
  view: {
28
- control: 'select',
29
- options: view,
29
+ control: 'inline-radio',
30
+ options: views,
30
31
  },
31
32
  variant: {
32
33
  control: 'select',
@@ -2,19 +2,19 @@ import React, { ComponentProps, useState } from 'react';
2
2
  import type { StoryObj, Meta } from '@storybook/react';
3
3
  import { action } from '@storybook/addon-actions';
4
4
  import styled from 'styled-components';
5
- import { InSpacingDecorator, disableProps } from '@salutejs/plasma-sb-utils';
6
- import type { PopoverPlacement } from '@salutejs/plasma-new-hope';
5
+ import { InSpacingDecorator, disableProps, getConfigVariations } from '@salutejs/plasma-sb-utils';
7
6
  import { IconPlasma, IconLockOutline } from '@salutejs/plasma-icons';
7
+ import type { PopoverPlacement } from '@salutejs/plasma-new-hope';
8
8
 
9
- import { TextField } from '.';
9
+ import { TextField } from './TextField';
10
+ import { config } from './TextField.config';
10
11
 
11
12
  const onChange = action('onChange');
12
13
  const onFocus = action('onFocus');
13
14
  const onBlur = action('onBlur');
14
15
  const onSearch = action('onSearch');
15
16
 
16
- const sizes = ['s'];
17
- const views = ['default', 'negative'];
17
+ const { views, sizes } = getConfigVariations(config);
18
18
  const labelPlacements = ['outer'];
19
19
 
20
20
  const StyledIconLockOutline = styled(IconLockOutline)`
@@ -104,12 +104,6 @@ const meta: Meta<typeof TextField> = {
104
104
  eq: 'inner',
105
105
  },
106
106
  },
107
- size: {
108
- options: sizes,
109
- control: {
110
- type: 'inline-radio',
111
- },
112
- },
113
107
  titleCaption: {
114
108
  control: { type: 'text' },
115
109
  },
@@ -233,7 +227,6 @@ const StoryDemo = ({ enableContentLeft, enableContentRight, view, readOnly, ...r
233
227
  export const Default: StoryObj<StoryPropsDefault> = {
234
228
  args: {
235
229
  id: 'example-text-field',
236
- size: 's',
237
230
  view: 'default',
238
231
  label: 'Лейбл',
239
232
  labelPlacement: 'outer',
@@ -256,7 +249,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
256
249
  },
257
250
  parameters: {
258
251
  controls: {
259
- exclude: ['chipType'],
252
+ exclude: ['chipType', 'size'],
260
253
  },
261
254
  },
262
255
  render: (args) => <StoryDemo {...args} />,
@@ -1,16 +1,17 @@
1
1
  import React, { useState } from 'react';
2
2
  import type { ComponentProps } from 'react';
3
3
  import type { Meta, StoryObj } from '@storybook/react';
4
- import { disableProps, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
4
+ import { disableProps, InSpacingDecorator, getConfigVariations } from '@salutejs/plasma-sb-utils';
5
5
  import { IconDone } from '@salutejs/plasma-icons';
6
6
 
7
7
  import { Combobox } from './Combobox';
8
+ import { config } from './Combobox.config';
8
9
 
9
10
  type StorySelectProps = ComponentProps<typeof Combobox> & {
10
11
  enableContentLeft?: boolean;
11
12
  };
12
13
 
13
- const view = ['default', 'negative'];
14
+ const { views } = getConfigVariations(config);
14
15
  const chip = ['default', 'secondary', 'accent'];
15
16
  const variant = ['normal', 'tight'];
16
17
 
@@ -20,7 +21,7 @@ const meta: Meta<StorySelectProps> = {
20
21
  component: Combobox,
21
22
  argTypes: {
22
23
  view: {
23
- options: view,
24
+ options: views,
24
25
  control: {
25
26
  type: 'select',
26
27
  },
@@ -367,13 +368,12 @@ const items = [
367
368
  {
368
369
  value: 'africa',
369
370
  label: 'Африка',
370
- isDisabled: true,
371
+ disabled: true,
371
372
  },
372
373
  ];
373
374
 
374
375
  const SingleStory = (args: StorySelectProps) => {
375
376
  const [value, setValue] = useState('');
376
-
377
377
  return (
378
378
  <div style={{ width: '400px' }}>
379
379
  <Combobox
@@ -382,6 +382,7 @@ const SingleStory = (args: StorySelectProps) => {
382
382
  value={value}
383
383
  onChange={setValue}
384
384
  contentLeft={args.enableContentLeft ? <IconDone size="s" /> : undefined}
385
+ onToggle={(e) => console.log(e)}
385
386
  />
386
387
  </div>
387
388
  );
@@ -389,6 +390,9 @@ const SingleStory = (args: StorySelectProps) => {
389
390
 
390
391
  export const Single: StoryObj<StorySelectProps> = {
391
392
  render: (args) => <SingleStory {...args} />,
393
+ args: {
394
+ closeAfterSelect: true,
395
+ },
392
396
  parameters: {
393
397
  controls: {
394
398
  exclude: ['isTargetAmount'],
@@ -415,4 +419,7 @@ const MultipleStory = (args: StorySelectProps) => {
415
419
 
416
420
  export const Multiple: StoryObj<StorySelectProps> = {
417
421
  render: (args) => <MultipleStory {...args} />,
422
+ args: {
423
+ closeAfterSelect: false,
424
+ },
418
425
  };
@@ -1,18 +1,19 @@
1
1
  import React, { useState } from 'react';
2
2
  import type { ComponentProps } from 'react';
3
3
  import type { Meta, StoryObj } from '@storybook/react';
4
- import { disableProps, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
4
+ import { disableProps, InSpacingDecorator, getConfigVariations } from '@salutejs/plasma-sb-utils';
5
5
  import { IconPlasma } from '@salutejs/plasma-icons';
6
6
 
7
7
  import './style.css';
8
8
 
9
9
  import { Select } from './Select';
10
+ import { config } from './Select.config';
10
11
 
11
12
  type StorySelectProps = ComponentProps<typeof Select> & {
12
13
  enableContentLeft?: boolean;
13
14
  };
14
15
 
15
- const view = ['default', 'negative'];
16
+ const { views } = getConfigVariations(config);
16
17
  const variant = ['normal', 'tight'];
17
18
 
18
19
  const meta: Meta<StorySelectProps> = {
@@ -25,8 +26,8 @@ const meta: Meta<StorySelectProps> = {
25
26
  options: ['button-like', 'textfield-like'],
26
27
  },
27
28
  view: {
28
- control: 'select',
29
- options: view,
29
+ control: 'inline-radio',
30
+ options: views,
30
31
  },
31
32
  variant: {
32
33
  control: 'select',
@@ -2,19 +2,19 @@ import React, { ComponentProps, useState } from 'react';
2
2
  import type { StoryObj, Meta } from '@storybook/react';
3
3
  import { action } from '@storybook/addon-actions';
4
4
  import styled from 'styled-components';
5
- import { InSpacingDecorator, disableProps } from '@salutejs/plasma-sb-utils';
6
- import type { PopoverPlacement } from '@salutejs/plasma-new-hope';
5
+ import { InSpacingDecorator, disableProps, getConfigVariations } from '@salutejs/plasma-sb-utils';
7
6
  import { IconPlasma, IconLockOutline } from '@salutejs/plasma-icons';
7
+ import type { PopoverPlacement } from '@salutejs/plasma-new-hope';
8
8
 
9
- import { TextField } from '.';
9
+ import { TextField } from './TextField';
10
+ import { config } from './TextField.config';
10
11
 
11
12
  const onChange = action('onChange');
12
13
  const onFocus = action('onFocus');
13
14
  const onBlur = action('onBlur');
14
15
  const onSearch = action('onSearch');
15
16
 
16
- const sizes = ['s'];
17
- const views = ['default', 'negative'];
17
+ const { views, sizes } = getConfigVariations(config);
18
18
  const labelPlacements = ['outer'];
19
19
 
20
20
  const StyledIconLockOutline = styled(IconLockOutline)`
@@ -104,12 +104,6 @@ const meta: Meta<typeof TextField> = {
104
104
  eq: 'inner',
105
105
  },
106
106
  },
107
- size: {
108
- options: sizes,
109
- control: {
110
- type: 'inline-radio',
111
- },
112
- },
113
107
  titleCaption: {
114
108
  control: { type: 'text' },
115
109
  },
@@ -233,7 +227,6 @@ const StoryDemo = ({ enableContentLeft, enableContentRight, view, readOnly, ...r
233
227
  export const Default: StoryObj<StoryPropsDefault> = {
234
228
  args: {
235
229
  id: 'example-text-field',
236
- size: 's',
237
230
  view: 'default',
238
231
  label: 'Лейбл',
239
232
  labelPlacement: 'outer',
@@ -256,7 +249,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
256
249
  },
257
250
  parameters: {
258
251
  controls: {
259
- exclude: ['chipType'],
252
+ exclude: ['chipType', 'size'],
260
253
  },
261
254
  },
262
255
  render: (args) => <StoryDemo {...args} />,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/sdds-cs",
3
- "version": "0.313.1-canary.1931.14570122322.0",
3
+ "version": "0.314.0-canary.1715.14635441934.0",
4
4
  "description": "Salute Design System / React UI kit for SDDS CS web applications",
5
5
  "author": "Salute Frontend Team <salute.developers@gmail.com>",
6
6
  "license": "MIT",
@@ -30,8 +30,8 @@
30
30
  "directory": "packages/sdds-cs"
31
31
  },
32
32
  "dependencies": {
33
- "@salutejs/plasma-new-hope": "0.321.1-canary.1931.14570122322.0",
34
- "@salutejs/sdds-themes": "0.35.0"
33
+ "@salutejs/plasma-new-hope": "0.322.0-canary.1715.14635441934.0",
34
+ "@salutejs/sdds-themes": "0.36.0-canary.1715.14635441934.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@emotion/react": ">=11",
@@ -57,7 +57,7 @@
57
57
  "@salutejs/plasma-core": "1.196.0",
58
58
  "@salutejs/plasma-cy-utils": "0.127.0",
59
59
  "@salutejs/plasma-icons": "1.217.0",
60
- "@salutejs/plasma-sb-utils": "0.196.0",
60
+ "@salutejs/plasma-sb-utils": "0.197.0-canary.1715.14635441934.0",
61
61
  "@storybook/addon-docs": "7.6.17",
62
62
  "@storybook/addon-essentials": "7.6.17",
63
63
  "@storybook/addons": "7.6.17",
@@ -123,5 +123,5 @@
123
123
  "Anton Vinogradov"
124
124
  ],
125
125
  "sideEffects": false,
126
- "gitHead": "b403573fce2d1c1d61b0be26f9505f297cc4e239"
126
+ "gitHead": "98b24824a12b42a82106125a6d02a7dd79fe506a"
127
127
  }