@salutejs/plasma-new-hope 0.176.0-canary.1513.11556365294.0 → 0.176.0-canary.1514.11559014063.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/cjs/components/Counter/Counter.css +1 -1
  2. package/cjs/components/Counter/Counter.js +12 -3
  3. package/cjs/components/Counter/Counter.js.map +1 -1
  4. package/cjs/components/Counter/Counter.tokens.js +4 -0
  5. package/cjs/components/Counter/Counter.tokens.js.map +1 -1
  6. package/cjs/components/Counter/variations/_size/base.js +1 -1
  7. package/cjs/components/Counter/variations/_size/base.js.map +1 -1
  8. package/cjs/components/Counter/variations/_size/{base_1z0ohiy.css → base_4mz17d.css} +1 -1
  9. package/cjs/index.css +1 -1
  10. package/emotion/cjs/components/Counter/Counter.js +12 -3
  11. package/emotion/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  12. package/emotion/cjs/components/Counter/Counter.tokens.js +4 -1
  13. package/emotion/cjs/components/Counter/variations/_size/base.js +1 -1
  14. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +12 -9
  15. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +7 -5
  16. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +6 -9
  17. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +6 -10
  18. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.config.js +12 -9
  19. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +7 -5
  20. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +6 -9
  21. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +6 -10
  22. package/emotion/es/components/Counter/Counter.js +12 -3
  23. package/emotion/es/components/Counter/Counter.template-doc.mdx +2 -2
  24. package/emotion/es/components/Counter/Counter.tokens.js +3 -0
  25. package/emotion/es/components/Counter/variations/_size/base.js +2 -2
  26. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.config.js +12 -9
  27. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +7 -5
  28. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +6 -9
  29. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +6 -10
  30. package/emotion/es/examples/plasma_web/components/Counter/Counter.config.js +12 -9
  31. package/emotion/es/examples/plasma_web/components/Counter/Counter.stories.tsx +7 -5
  32. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +6 -9
  33. package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +6 -10
  34. package/es/components/Counter/Counter.css +1 -1
  35. package/es/components/Counter/Counter.js +12 -3
  36. package/es/components/Counter/Counter.js.map +1 -1
  37. package/es/components/Counter/Counter.tokens.js +4 -1
  38. package/es/components/Counter/Counter.tokens.js.map +1 -1
  39. package/es/components/Counter/variations/_size/base.js +1 -1
  40. package/es/components/Counter/variations/_size/base.js.map +1 -1
  41. package/es/components/Counter/variations/_size/{base_1z0ohiy.css → base_4mz17d.css} +1 -1
  42. package/es/index.css +1 -1
  43. package/package.json +2 -2
  44. package/styled-components/cjs/components/Counter/Counter.js +12 -3
  45. package/styled-components/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  46. package/styled-components/cjs/components/Counter/Counter.tokens.js +4 -1
  47. package/styled-components/cjs/components/Counter/variations/_size/base.js +1 -1
  48. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +5 -2
  49. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +7 -5
  50. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +6 -9
  51. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +6 -10
  52. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.config.js +5 -2
  53. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +7 -5
  54. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +6 -9
  55. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +6 -10
  56. package/styled-components/es/components/Counter/Counter.js +12 -3
  57. package/styled-components/es/components/Counter/Counter.template-doc.mdx +2 -2
  58. package/styled-components/es/components/Counter/Counter.tokens.js +3 -0
  59. package/styled-components/es/components/Counter/variations/_size/base.js +2 -2
  60. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.config.js +5 -2
  61. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +7 -5
  62. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +6 -9
  63. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +6 -10
  64. package/styled-components/es/examples/plasma_web/components/Counter/Counter.config.js +5 -2
  65. package/styled-components/es/examples/plasma_web/components/Counter/Counter.stories.tsx +7 -5
  66. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +6 -9
  67. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +6 -10
  68. package/types/components/Counter/Counter.d.ts.map +1 -1
  69. package/types/components/Counter/Counter.tokens.d.ts +3 -0
  70. package/types/components/Counter/Counter.tokens.d.ts.map +1 -1
  71. package/types/components/Counter/Counter.types.d.ts +2 -2
  72. package/types/components/Counter/variations/_size/base.d.ts.map +1 -1
  73. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts +3 -0
  74. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts.map +1 -1
  75. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts +3 -0
  76. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts.map +1 -1
  77. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts +3 -0
  78. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts.map +1 -1
  79. package/types/examples/plasma_web/components/Counter/Counter.d.ts +3 -0
  80. package/types/examples/plasma_web/components/Counter/Counter.d.ts.map +1 -1
@@ -95,44 +95,43 @@ const meta: Meta<typeof TextField> = {
95
95
  },
96
96
  hintText: {
97
97
  control: { type: 'text' },
98
- if: { arg: 'hasHint', thruthy: true },
99
98
  },
100
99
  hintView: {
101
100
  options: hintViews,
102
101
  control: {
103
102
  type: 'select',
104
103
  },
105
- if: { arg: 'hasHint', thruthy: true },
104
+ if: { arg: 'hintText', neq: '' },
106
105
  },
107
106
  hintSize: {
108
107
  options: hintSizes,
109
108
  control: {
110
109
  type: 'select',
111
110
  },
112
- if: { arg: 'hasHint', thruthy: true },
111
+ if: { arg: 'hintText', neq: '' },
113
112
  },
114
113
  hintTrigger: {
115
114
  options: hintTriggers,
116
115
  control: {
117
116
  type: 'inline-radio',
118
117
  },
119
- if: { arg: 'hasHint', thruthy: true },
118
+ if: { arg: 'hintText', neq: '' },
120
119
  },
121
120
  hintPlacement: {
122
121
  options: placements,
123
122
  control: {
124
123
  type: 'select',
125
124
  },
126
- if: { arg: 'hasHint', thruthy: true },
125
+ if: { arg: 'hintText', neq: '' },
127
126
  mappers: placements,
128
127
  },
129
128
  hintHasArrow: {
130
129
  control: { type: 'boolean' },
131
- if: { arg: 'hasHint', thruthy: true },
130
+ if: { arg: 'hintText', neq: '' },
132
131
  },
133
132
  hintWidth: {
134
133
  control: { type: 'text' },
135
- if: { arg: 'hasHint', thruthy: true },
134
+ if: { arg: 'hintText', neq: '' },
136
135
  },
137
136
  },
138
137
  };
@@ -159,7 +158,6 @@ type StoryPropsDefault = Omit<
159
158
  | 'chips'
160
159
  | 'onChangeChips'
161
160
  > & {
162
- hasHint: boolean;
163
161
  enableContentLeft: boolean;
164
162
  enableContentRight: boolean;
165
163
  };
@@ -224,7 +222,6 @@ export const Default: StoryObj<StoryPropsDefault> = {
224
222
  optional: false,
225
223
  required: false,
226
224
  requiredPlacement: 'right',
227
- hasHint: true,
228
225
  hintText: 'Текст подсказки',
229
226
  hintTrigger: 'hover',
230
227
  hintView: 'default',
@@ -254,7 +251,6 @@ type StoryPropsChips = Omit<
254
251
  | 'minLength'
255
252
  | 'enumerationType'
256
253
  > & {
257
- hasHint: boolean;
258
254
  enableContentLeft: boolean;
259
255
  enableContentRight: boolean;
260
256
  };
@@ -1,5 +1,5 @@
1
1
  .base_1vjakah_b15waymg__f123ad8a{color:var(--plasma-counter-color);background-color:var(--plasma-counter-background);}
2
2
 
3
- .base_1z0ohiy_b1t6e429__9712bb45{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}
3
+ .base_4mz17d_b1t6e429__b5e2cba4{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}.base_4mz17d_b1t6e429__b5e2cba4.base_4mz17d__PlasmaCounterRound__b5e2cba4{width:var(--plasma-counter-height);}
4
4
 
5
5
  .Counter_styles_1uue90v_b1dqw7l5__00d0b847{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:-webkit-max-content;width:-moz-max-content;width:max-content;}
@@ -1,23 +1,32 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef } from 'react';
3
+ import { cx } from '../../utils/index.js';
3
4
  import { base as base$1 } from './variations/_view/base.js';
4
5
  import { base as base$2 } from './variations/_size/base.js';
5
6
  import { base } from './Counter.styles.js';
7
+ import { classes } from './Counter.tokens.js';
6
8
 
7
- var _excluded = ["count", "maxCount", "size", "view"];
9
+ var _excluded = ["count", "maxCount", "size", "view", "className"];
10
+ var MIN_COUNT = 1;
8
11
  var counterRoot = function counterRoot(Root) {
9
12
  return /*#__PURE__*/forwardRef(function (props, ref) {
10
13
  var count = props.count,
11
14
  maxCount = props.maxCount,
12
15
  size = props.size,
13
16
  view = props.view,
17
+ className = props.className,
14
18
  rest = _objectWithoutProperties(props, _excluded);
15
- var content = maxCount && count > maxCount ? "".concat(maxCount, "+") : count;
19
+ var currCount = count < MIN_COUNT ? MIN_COUNT : count;
20
+ var currMaxCount = maxCount && maxCount < MIN_COUNT ? MIN_COUNT : maxCount;
21
+ var currMaxCountExceeded = currMaxCount && currCount > currMaxCount;
22
+ var content = currMaxCountExceeded ? "".concat(currMaxCount, "+") : currCount;
23
+ var roundClass = !currMaxCountExceeded && currCount >= 0 && currCount < 10 ? classes.round : undefined;
16
24
  return /*#__PURE__*/React.createElement(Root, _extends({
17
25
  ref: ref,
18
26
  view: view,
19
27
  size: size,
20
- count: count
28
+ count: count,
29
+ className: cx(roundClass, className)
21
30
  }, rest), content);
22
31
  });
23
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Counter.js","sources":["../../../src/components/Counter/Counter.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootProps } from '../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { CounterProps } from './Counter.types';\nimport { base } from './Counter.styles';\n\nexport const counterRoot = (Root: RootProps<HTMLDivElement, CounterProps>) =>\n forwardRef<HTMLDivElement, CounterProps>((props, ref) => {\n const { count, maxCount, size, view, ...rest } = props;\n\n const content = maxCount && count > maxCount ? `${maxCount}+` : count;\n\n return (\n <Root ref={ref} view={view} size={size} count={count} {...rest}>\n {content}\n </Root>\n );\n });\n\nexport const counterConfig = {\n name: 'Counter',\n tag: 'div',\n layout: counterRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'xs',\n },\n};\n"],"names":["counterRoot","Root","forwardRef","props","ref","count","maxCount","size","view","rest","_objectWithoutProperties","_excluded","content","concat","React","createElement","_extends","counterConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;IASaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBACrEC,UAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IAAQC,KAAK,GAAoCF,KAAK,CAA9CE,KAAK;MAAEC,QAAQ,GAA0BH,KAAK,CAAvCG,QAAQ;MAAEC,IAAI,GAAoBJ,KAAK,CAA7BI,IAAI;MAAEC,IAAI,GAAcL,KAAK,CAAvBK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,wBAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAEtD,IAAA,IAAMC,OAAO,GAAGN,QAAQ,IAAID,KAAK,GAAGC,QAAQ,GAAA,EAAA,CAAAO,MAAA,CAAMP,QAAQ,EAAA,GAAA,CAAA,GAAMD,KAAK,CAAA;AAErE,IAAA,oBACIS,KAAA,CAAAC,aAAA,CAACd,IAAI,EAAAe,QAAA,CAAA;AAACZ,MAAAA,GAAG,EAAEA,GAAI;AAACI,MAAAA,IAAI,EAAEA,IAAK;AAACD,MAAAA,IAAI,EAAEA,IAAK;AAACF,MAAAA,KAAK,EAAEA,KAAAA;KAAWI,EAAAA,IAAI,CACzDG,EAAAA,OACC,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMK,aAAa,GAAG;AACzBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEpB,WAAW;AACnBqB,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRd,IAAAA,IAAI,EAAE;AACFe,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDjB,IAAAA,IAAI,EAAE;AACFgB,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlB,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"Counter.js","sources":["../../../src/components/Counter/Counter.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { CounterProps } from './Counter.types';\nimport { base } from './Counter.styles';\nimport { classes } from './Counter.tokens';\n\nconst MIN_COUNT = 1;\n\nexport const counterRoot = (Root: RootProps<HTMLDivElement, CounterProps>) =>\n forwardRef<HTMLDivElement, CounterProps>((props, ref) => {\n const { count, maxCount, size, view, className, ...rest } = props;\n\n const currCount = count < MIN_COUNT ? MIN_COUNT : count;\n const currMaxCount = maxCount && maxCount < MIN_COUNT ? MIN_COUNT : maxCount;\n const currMaxCountExceeded = currMaxCount && currCount > currMaxCount;\n\n const content = currMaxCountExceeded ? `${currMaxCount}+` : currCount;\n\n const roundClass = !currMaxCountExceeded && currCount >= 0 && currCount < 10 ? classes.round : undefined;\n\n return (\n <Root ref={ref} view={view} size={size} count={count} className={cx(roundClass, className)} {...rest}>\n {content}\n </Root>\n );\n });\n\nexport const counterConfig = {\n name: 'Counter',\n tag: 'div',\n layout: counterRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'xs',\n },\n};\n"],"names":["MIN_COUNT","counterRoot","Root","forwardRef","props","ref","count","maxCount","size","view","className","rest","_objectWithoutProperties","_excluded","currCount","currMaxCount","currMaxCountExceeded","content","concat","roundClass","classes","round","undefined","React","createElement","_extends","cx","counterConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;AAWA,IAAMA,SAAS,GAAG,CAAC,CAAA;IAENC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBACrEC,UAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IAAQC,KAAK,GAA+CF,KAAK,CAAzDE,KAAK;MAAEC,QAAQ,GAAqCH,KAAK,CAAlDG,QAAQ;MAAEC,IAAI,GAA+BJ,KAAK,CAAxCI,IAAI;MAAEC,IAAI,GAAyBL,KAAK,CAAlCK,IAAI;MAAEC,SAAS,GAAcN,KAAK,CAA5BM,SAAS;AAAKC,MAAAA,IAAI,GAAAC,wBAAA,CAAKR,KAAK,EAAAS,SAAA,CAAA,CAAA;IAEjE,IAAMC,SAAS,GAAGR,KAAK,GAAGN,SAAS,GAAGA,SAAS,GAAGM,KAAK,CAAA;IACvD,IAAMS,YAAY,GAAGR,QAAQ,IAAIA,QAAQ,GAAGP,SAAS,GAAGA,SAAS,GAAGO,QAAQ,CAAA;AAC5E,IAAA,IAAMS,oBAAoB,GAAGD,YAAY,IAAID,SAAS,GAAGC,YAAY,CAAA;IAErE,IAAME,OAAO,GAAGD,oBAAoB,GAAA,EAAA,CAAAE,MAAA,CAAMH,YAAY,SAAMD,SAAS,CAAA;AAErE,IAAA,IAAMK,UAAU,GAAG,CAACH,oBAAoB,IAAIF,SAAS,IAAI,CAAC,IAAIA,SAAS,GAAG,EAAE,GAAGM,OAAO,CAACC,KAAK,GAAGC,SAAS,CAAA;AAExG,IAAA,oBACIC,KAAA,CAAAC,aAAA,CAACtB,IAAI,EAAAuB,QAAA,CAAA;AAACpB,MAAAA,GAAG,EAAEA,GAAI;AAACI,MAAAA,IAAI,EAAEA,IAAK;AAACD,MAAAA,IAAI,EAAEA,IAAK;AAACF,MAAAA,KAAK,EAAEA,KAAM;AAACI,MAAAA,SAAS,EAAEgB,EAAE,CAACP,UAAU,EAAET,SAAS,CAAA;KAAOC,EAAAA,IAAI,CAC/FM,EAAAA,OACC,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMU,aAAa,GAAG;AACzBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7B,WAAW;AACnB8B,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRvB,IAAAA,IAAI,EAAE;AACFwB,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACD1B,IAAAA,IAAI,EAAE;AACFyB,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN3B,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;"}
@@ -1,3 +1,6 @@
1
+ var classes = {
2
+ round: '--plasma-counter-round'
3
+ };
1
4
  var tokens = {
2
5
  background: '--plasma-counter-background',
3
6
  color: '--plasma-counter-color',
@@ -15,5 +18,5 @@ var tokens = {
15
18
  lineHeight: '--plasma-counter-lineheight'
16
19
  };
17
20
 
18
- export { tokens };
21
+ export { classes, tokens };
19
22
  //# sourceMappingURL=Counter.tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Counter.tokens.js","sources":["../../../src/components/Counter/Counter.tokens.ts"],"sourcesContent":["export const tokens = {\n background: '--plasma-counter-background',\n color: '--plasma-counter-color',\n\n borderRadius: '--plasma-counter-border-radius',\n height: '--plasma-counter-height',\n paddingTop: '--plasma-counter-padding-top',\n paddingRight: '--plasma-counter-padding-right',\n paddingBottom: '--plasma-counter-padding-bottom',\n paddingLeft: '--plasma-counter-padding-left',\n\n fontFamily: '--plasma-counter-font-family',\n fontSize: '--plasma-counter-font-size',\n fontStyle: '--plasma-counter-font-style',\n fontWeight: '--plasma-counter-font-weight',\n letterSpacing: '--plasma-counter-letter-spacing',\n lineHeight: '--plasma-counter-lineheight',\n};\n"],"names":["tokens","background","color","borderRadius","height","paddingTop","paddingRight","paddingBottom","paddingLeft","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight"],"mappings":"AAAO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,KAAK,EAAE,wBAAwB;AAE/BC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,MAAM,EAAE,yBAAyB;AACjCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,WAAW,EAAE,+BAA+B;AAE5CC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,QAAQ,EAAE,4BAA4B;AACtCC,EAAAA,SAAS,EAAE,6BAA6B;AACxCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,UAAU,EAAE,6BAAA;AAChB;;;;"}
1
+ {"version":3,"file":"Counter.tokens.js","sources":["../../../src/components/Counter/Counter.tokens.ts"],"sourcesContent":["export const classes = {\n round: '--plasma-counter-round',\n};\n\nexport const tokens = {\n background: '--plasma-counter-background',\n color: '--plasma-counter-color',\n\n borderRadius: '--plasma-counter-border-radius',\n height: '--plasma-counter-height',\n paddingTop: '--plasma-counter-padding-top',\n paddingRight: '--plasma-counter-padding-right',\n paddingBottom: '--plasma-counter-padding-bottom',\n paddingLeft: '--plasma-counter-padding-left',\n\n fontFamily: '--plasma-counter-font-family',\n fontSize: '--plasma-counter-font-size',\n fontStyle: '--plasma-counter-font-style',\n fontWeight: '--plasma-counter-font-weight',\n letterSpacing: '--plasma-counter-letter-spacing',\n lineHeight: '--plasma-counter-lineheight',\n};\n"],"names":["classes","round","tokens","background","color","borderRadius","height","paddingTop","paddingRight","paddingBottom","paddingLeft","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,KAAK,EAAE,wBAAA;AACX,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,KAAK,EAAE,wBAAwB;AAE/BC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,MAAM,EAAE,yBAAyB;AACjCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,WAAW,EAAE,+BAA+B;AAE5CC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,QAAQ,EAAE,4BAA4B;AACtCC,EAAAA,SAAS,EAAE,6BAA6B;AACxCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,UAAU,EAAE,6BAAA;AAChB;;;;"}
@@ -1,4 +1,4 @@
1
- import './base_1z0ohiy.css';
1
+ import './base_4mz17d.css';
2
2
  var base = "b1t6e429";
3
3
 
4
4
  export { base };
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sources":["../../../../../src/components/Counter/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../Counter.tokens';\n\nexport const base = css`\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${tokens.lineHeight});\n\n border-radius: var(${tokens.borderRadius});\n\n height: var(${tokens.height});\n\n padding-top: var(${tokens.paddingTop});\n padding-right: var(${tokens.paddingRight});\n padding-bottom: var(${tokens.paddingBottom});\n padding-left: var(${tokens.paddingLeft});\n`;\n"],"names":["base"],"mappings":"AAIO,IAAMA,IAAI,GAgBhB;;;;"}
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/Counter/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../Counter.tokens';\n\nexport const base = css`\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${tokens.lineHeight});\n\n border-radius: var(${tokens.borderRadius});\n\n height: var(${tokens.height});\n\n padding-top: var(${tokens.paddingTop});\n padding-right: var(${tokens.paddingRight});\n padding-bottom: var(${tokens.paddingBottom});\n padding-left: var(${tokens.paddingLeft});\n\n &.${classes.round} {\n width: var(${tokens.height});\n }\n`;\n"],"names":["base"],"mappings":"AAIO,IAAMA,IAAI,GAoBhB;;;;"}
@@ -1 +1 @@
1
- .b1t6e429{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}
1
+ .b1t6e429{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}.b1t6e429.--plasma-counter-round{width:var(--plasma-counter-height);}
package/es/index.css CHANGED
@@ -475,7 +475,7 @@
475
475
 
476
476
  .base_1vjakah_b15waymg__f123ad8a{color:var(--plasma-counter-color);background-color:var(--plasma-counter-background);}
477
477
 
478
- .base_1z0ohiy_b1t6e429__9712bb45{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}
478
+ .base_4mz17d_b1t6e429__b5e2cba4{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}.base_4mz17d_b1t6e429__b5e2cba4.base_4mz17d__PlasmaCounterRound__b5e2cba4{width:var(--plasma-counter-height);}
479
479
 
480
480
  .Counter_styles_1uue90v_b1dqw7l5__00d0b847{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:-webkit-max-content;width:-moz-max-content;width:max-content;}
481
481
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/plasma-new-hope",
3
- "version": "0.176.0-canary.1513.11556365294.0",
3
+ "version": "0.176.0-canary.1514.11559014063.0",
4
4
  "description": "Salute Design System blueprint",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",
@@ -128,5 +128,5 @@
128
128
  "sideEffects": [
129
129
  "*.css"
130
130
  ],
131
- "gitHead": "535a01c8885a93b8b783ce140037b80c04166642"
131
+ "gitHead": "625e62802b40879499128e47c39bd8554fd77d54"
132
132
  }
@@ -6,28 +6,37 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.counterRoot = exports.counterConfig = void 0;
8
8
  var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
+ var _utils = /*#__PURE__*/require("../../utils");
9
10
  var _base = /*#__PURE__*/require("./variations/_view/base");
10
11
  var _base2 = /*#__PURE__*/require("./variations/_size/base");
11
12
  var _Counter = /*#__PURE__*/require("./Counter.styles");
12
- var _excluded = ["count", "maxCount", "size", "view"];
13
+ var _Counter2 = /*#__PURE__*/require("./Counter.tokens");
14
+ var _excluded = ["count", "maxCount", "size", "view", "className"];
13
15
  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); }
14
16
  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; }
15
17
  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); }
16
18
  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; }
17
19
  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; }
20
+ var MIN_COUNT = 1;
18
21
  var counterRoot = exports.counterRoot = function counterRoot(Root) {
19
22
  return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
20
23
  var count = props.count,
21
24
  maxCount = props.maxCount,
22
25
  size = props.size,
23
26
  view = props.view,
27
+ className = props.className,
24
28
  rest = _objectWithoutProperties(props, _excluded);
25
- var content = maxCount && count > maxCount ? "".concat(maxCount, "+") : count;
29
+ var currCount = count < MIN_COUNT ? MIN_COUNT : count;
30
+ var currMaxCount = maxCount && maxCount < MIN_COUNT ? MIN_COUNT : maxCount;
31
+ var currMaxCountExceeded = currMaxCount && currCount > currMaxCount;
32
+ var content = currMaxCountExceeded ? "".concat(currMaxCount, "+") : currCount;
33
+ var roundClass = !currMaxCountExceeded && currCount >= 0 && currCount < 10 ? _Counter2.classes.round : undefined;
26
34
  return /*#__PURE__*/_react["default"].createElement(Root, _extends({
27
35
  ref: ref,
28
36
  view: view,
29
37
  size: size,
30
- count: count
38
+ count: count,
39
+ className: (0, _utils.cx)(roundClass, className)
31
40
  }, rest), content);
32
41
  });
33
42
  };
@@ -12,7 +12,7 @@ import { PropsTable, Description } from '@site/src/components';
12
12
  ## Примеры
13
13
 
14
14
  ### Максимальное значение числового badge
15
- Задается с помощью свойства `maxCount`.
15
+ Задается с помощью свойства `maxCount`. Как и `count`, не может быть меньше 1.
16
16
 
17
17
  ```tsx live
18
18
  import React from 'react';
@@ -29,7 +29,7 @@ export function App() {
29
29
  ```
30
30
 
31
31
  ### Размер числового badge
32
- Размер задается с помощью свойства `size`. Возможные значения свойства: `"xs"` или `"xxs"`.
32
+ Размер задается с помощью свойства `size`. Возможные значения свойства: `xxs`, `xs`, `s`, `m`, `l`.
33
33
 
34
34
  ```tsx live
35
35
  import React from 'react';
@@ -3,7 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.tokens = void 0;
6
+ exports.tokens = exports.classes = void 0;
7
+ var classes = exports.classes = {
8
+ round: '--plasma-counter-round'
9
+ };
7
10
  var tokens = exports.tokens = {
8
11
  background: '--plasma-counter-background',
9
12
  color: '--plasma-counter-color',
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.base = void 0;
7
7
  var _styledComponents = /*#__PURE__*/require("styled-components");
8
8
  var _Counter = /*#__PURE__*/require("../../Counter.tokens");
9
- var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ");"], _Counter.tokens.fontFamily, _Counter.tokens.fontSize, _Counter.tokens.fontStyle, _Counter.tokens.fontWeight, _Counter.tokens.letterSpacing, _Counter.tokens.lineHeight, _Counter.tokens.borderRadius, _Counter.tokens.height, _Counter.tokens.paddingTop, _Counter.tokens.paddingRight, _Counter.tokens.paddingBottom, _Counter.tokens.paddingLeft);
9
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ");&.", "{width:var(", ");}"], _Counter.tokens.fontFamily, _Counter.tokens.fontSize, _Counter.tokens.fontStyle, _Counter.tokens.fontWeight, _Counter.tokens.letterSpacing, _Counter.tokens.lineHeight, _Counter.tokens.borderRadius, _Counter.tokens.height, _Counter.tokens.paddingTop, _Counter.tokens.paddingRight, _Counter.tokens.paddingBottom, _Counter.tokens.paddingLeft, _Counter.classes.round, _Counter.tokens.height);
@@ -22,8 +22,11 @@ var config = exports.config = {
22
22
  light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);"], _Counter.counterTokens.color, _Counter.counterTokens.background)
23
23
  },
24
24
  size: {
25
- xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
26
- xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
25
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.75rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
26
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.5rem;", ":0.5rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
27
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.25rem;", ":0.375rem;", ":0.375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
28
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
29
+ xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":0.75rem;", ":0.125rem;", ":0.125rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
27
30
  }
28
31
  }
29
32
  };
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { disableProps } from '@salutejs/plasma-sb-utils';
3
2
  import type { StoryObj, Meta } from '@storybook/react';
4
3
 
@@ -6,19 +5,22 @@ import { WithTheme } from '../../../_helpers';
6
5
 
7
6
  import { Counter } from './Counter';
8
7
 
8
+ const sizes = ['l', 'm', 's', 'xs', 'xxs'];
9
+ const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
10
+
9
11
  const meta: Meta<typeof Counter> = {
10
12
  title: 'plasma_b2c/Counter',
11
13
  component: Counter,
12
14
  decorators: [WithTheme],
13
15
  argTypes: {
14
16
  size: {
15
- options: ['xs', 'xxs'],
17
+ options: sizes,
16
18
  control: {
17
19
  type: 'select',
18
20
  },
19
21
  },
20
22
  view: {
21
- options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
23
+ options: views,
22
24
  control: {
23
25
  type: 'select',
24
26
  },
@@ -33,8 +35,8 @@ type Story = StoryObj<typeof Counter>;
33
35
 
34
36
  export const Default: Story = {
35
37
  args: {
36
- count: 25,
37
- maxCount: 100,
38
+ count: 123,
39
+ maxCount: 200,
38
40
  view: 'default',
39
41
  size: 'xs',
40
42
  },
@@ -37,7 +37,6 @@ const placements: Array<PopoverPlacement> = [
37
37
  ];
38
38
 
39
39
  type StoryTextAreaPropsCustom = {
40
- hasHint?: boolean;
41
40
  enableContentRight?: boolean;
42
41
  };
43
42
 
@@ -93,44 +92,43 @@ const meta: Meta<StoryTextAreaProps> = {
93
92
  },
94
93
  hintText: {
95
94
  control: { type: 'text' },
96
- if: { arg: 'hasHint', thruthy: true },
97
95
  },
98
96
  hintView: {
99
97
  options: hintViews,
100
98
  control: {
101
99
  type: 'select',
102
100
  },
103
- if: { arg: 'hasHint', thruthy: true },
101
+ if: { arg: 'hintText', neq: '' },
104
102
  },
105
103
  hintSize: {
106
104
  options: hintSizes,
107
105
  control: {
108
106
  type: 'select',
109
107
  },
110
- if: { arg: 'hasHint', thruthy: true },
108
+ if: { arg: 'hintText', neq: '' },
111
109
  },
112
110
  hintTrigger: {
113
111
  options: hintTriggers,
114
112
  control: {
115
113
  type: 'inline-radio',
116
114
  },
117
- if: { arg: 'hasHint', thruthy: true },
115
+ if: { arg: 'hintText', neq: '' },
118
116
  },
119
117
  hintPlacement: {
120
118
  options: placements,
121
119
  control: {
122
120
  type: 'select',
123
121
  },
124
- if: { arg: 'hasHint', thruthy: true },
122
+ if: { arg: 'hintText', neq: '' },
125
123
  mappers: placements,
126
124
  },
127
125
  hintHasArrow: {
128
126
  control: { type: 'boolean' },
129
- if: { arg: 'hasHint', thruthy: true },
127
+ if: { arg: 'hintText', neq: '' },
130
128
  },
131
129
  hintWidth: {
132
130
  control: { type: 'text' },
133
- if: { arg: 'hasHint', thruthy: true },
131
+ if: { arg: 'hintText', neq: '' },
134
132
  },
135
133
  },
136
134
  args: {
@@ -154,7 +152,6 @@ const meta: Meta<StoryTextAreaProps> = {
154
152
  requiredPlacement: 'right',
155
153
  clear: false,
156
154
  hasDivider: false,
157
- hasHint: true,
158
155
  hintText: 'Текст подсказки',
159
156
  hintTrigger: 'hover',
160
157
  hintView: 'default',
@@ -95,44 +95,43 @@ const meta: Meta<typeof TextField> = {
95
95
  },
96
96
  hintText: {
97
97
  control: { type: 'text' },
98
- if: { arg: 'hasHint', thruthy: true },
99
98
  },
100
99
  hintView: {
101
100
  options: hintViews,
102
101
  control: {
103
102
  type: 'select',
104
103
  },
105
- if: { arg: 'hasHint', thruthy: true },
104
+ if: { arg: 'hintText', neq: '' },
106
105
  },
107
106
  hintSize: {
108
107
  options: hintSizes,
109
108
  control: {
110
109
  type: 'select',
111
110
  },
112
- if: { arg: 'hasHint', thruthy: true },
111
+ if: { arg: 'hintText', neq: '' },
113
112
  },
114
113
  hintTrigger: {
115
114
  options: hintTriggers,
116
115
  control: {
117
116
  type: 'inline-radio',
118
117
  },
119
- if: { arg: 'hasHint', thruthy: true },
118
+ if: { arg: 'hintText', neq: '' },
120
119
  },
121
120
  hintPlacement: {
122
121
  options: placements,
123
122
  control: {
124
123
  type: 'select',
125
124
  },
126
- if: { arg: 'hasHint', thruthy: true },
125
+ if: { arg: 'hintText', neq: '' },
127
126
  mappers: placements,
128
127
  },
129
128
  hintHasArrow: {
130
129
  control: { type: 'boolean' },
131
- if: { arg: 'hasHint', thruthy: true },
130
+ if: { arg: 'hintText', neq: '' },
132
131
  },
133
132
  hintWidth: {
134
133
  control: { type: 'text' },
135
- if: { arg: 'hasHint', thruthy: true },
134
+ if: { arg: 'hintText', neq: '' },
136
135
  },
137
136
  },
138
137
  };
@@ -159,7 +158,6 @@ type StoryPropsDefault = Omit<
159
158
  | 'chips'
160
159
  | 'onChangeChips'
161
160
  > & {
162
- hasHint: boolean;
163
161
  enableContentLeft: boolean;
164
162
  enableContentRight: boolean;
165
163
  };
@@ -224,7 +222,6 @@ export const Default: StoryObj<StoryPropsDefault> = {
224
222
  requiredPlacement: 'right',
225
223
  clear: false,
226
224
  hasDivider: false,
227
- hasHint: true,
228
225
  hintText: 'Текст подсказки',
229
226
  hintTrigger: 'hover',
230
227
  hintView: 'default',
@@ -254,7 +251,6 @@ type StoryPropsChips = Omit<
254
251
  | 'minLength'
255
252
  | 'enumerationType'
256
253
  > & {
257
- hasHint: boolean;
258
254
  enableContentLeft: boolean;
259
255
  enableContentRight: boolean;
260
256
  };
@@ -22,8 +22,11 @@ var config = exports.config = {
22
22
  light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);"], _Counter.counterTokens.color, _Counter.counterTokens.background)
23
23
  },
24
24
  size: {
25
- xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
26
- xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
25
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.75rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
26
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.5rem;", ":0.5rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
27
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.25rem;", ":0.375rem;", ":0.375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
28
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
29
+ xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":0.75rem;", ":0.125rem;", ":0.125rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
27
30
  }
28
31
  }
29
32
  };
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { disableProps } from '@salutejs/plasma-sb-utils';
3
2
  import type { StoryObj, Meta } from '@storybook/react';
4
3
 
@@ -6,19 +5,22 @@ import { WithTheme } from '../../../_helpers';
6
5
 
7
6
  import { Counter } from './Counter';
8
7
 
8
+ const sizes = ['l', 'm', 's', 'xs', 'xxs'];
9
+ const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
10
+
9
11
  const meta: Meta<typeof Counter> = {
10
12
  title: 'plasma_web/Counter',
11
13
  component: Counter,
12
14
  decorators: [WithTheme],
13
15
  argTypes: {
14
16
  size: {
15
- options: ['xs', 'xxs'],
17
+ options: sizes,
16
18
  control: {
17
19
  type: 'select',
18
20
  },
19
21
  },
20
22
  view: {
21
- options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
23
+ options: views,
22
24
  control: {
23
25
  type: 'select',
24
26
  },
@@ -33,8 +35,8 @@ type Story = StoryObj<typeof Counter>;
33
35
 
34
36
  export const Default: Story = {
35
37
  args: {
36
- count: 25,
37
- maxCount: 100,
38
+ count: 123,
39
+ maxCount: 200,
38
40
  view: 'default',
39
41
  size: 'xs',
40
42
  },