@salutejs/plasma-new-hope 0.195.0-canary.1574.11921374356.0 → 0.195.0-dev.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/cjs/components/Autocomplete/Autocomplete.js +1 -7
  2. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  3. package/cjs/components/Badge/Badge.css +4 -4
  4. package/cjs/components/Badge/Badge.js +17 -7
  5. package/cjs/components/Badge/Badge.js.map +1 -1
  6. package/cjs/components/Badge/Badge.tokens.js +10 -5
  7. package/cjs/components/Badge/Badge.tokens.js.map +1 -1
  8. package/cjs/components/Badge/variations/_clear/base.js +1 -1
  9. package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
  10. package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  11. package/cjs/components/Badge/variations/_size/base.js +1 -1
  12. package/cjs/components/Badge/variations/_size/base.js.map +1 -1
  13. package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  14. package/cjs/components/Badge/variations/_transparent/base.js +1 -1
  15. package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
  16. package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  17. package/cjs/components/Badge/variations/_view/base.js +1 -1
  18. package/cjs/components/Badge/variations/_view/base.js.map +1 -1
  19. package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  20. package/cjs/index.css +4 -4
  21. package/emotion/cjs/components/Autocomplete/Autocomplete.js +1 -7
  22. package/emotion/cjs/components/Badge/Badge.js +17 -7
  23. package/emotion/cjs/components/Badge/Badge.template-doc.mdx +40 -16
  24. package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
  25. package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
  26. package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
  27. package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
  28. package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
  29. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  30. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  31. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  32. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  33. package/emotion/es/components/Autocomplete/Autocomplete.js +1 -7
  34. package/emotion/es/components/Badge/Badge.js +18 -8
  35. package/emotion/es/components/Badge/Badge.template-doc.mdx +40 -16
  36. package/emotion/es/components/Badge/Badge.tokens.js +9 -5
  37. package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
  38. package/emotion/es/components/Badge/variations/_size/base.js +3 -2
  39. package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
  40. package/emotion/es/components/Badge/variations/_view/base.js +2 -2
  41. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  42. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  43. package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  44. package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  45. package/es/components/Autocomplete/Autocomplete.js +1 -7
  46. package/es/components/Autocomplete/Autocomplete.js.map +1 -1
  47. package/es/components/Badge/Badge.css +4 -4
  48. package/es/components/Badge/Badge.js +20 -10
  49. package/es/components/Badge/Badge.js.map +1 -1
  50. package/es/components/Badge/Badge.tokens.js +10 -6
  51. package/es/components/Badge/Badge.tokens.js.map +1 -1
  52. package/es/components/Badge/variations/_clear/base.js +1 -1
  53. package/es/components/Badge/variations/_clear/base.js.map +1 -1
  54. package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  55. package/es/components/Badge/variations/_size/base.js +1 -1
  56. package/es/components/Badge/variations/_size/base.js.map +1 -1
  57. package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  58. package/es/components/Badge/variations/_transparent/base.js +1 -1
  59. package/es/components/Badge/variations/_transparent/base.js.map +1 -1
  60. package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  61. package/es/components/Badge/variations/_view/base.js +1 -1
  62. package/es/components/Badge/variations/_view/base.js.map +1 -1
  63. package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  64. package/es/index.css +4 -4
  65. package/package.json +2 -2
  66. package/styled-components/cjs/components/Autocomplete/Autocomplete.js +1 -7
  67. package/styled-components/cjs/components/Badge/Badge.js +17 -7
  68. package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +40 -16
  69. package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
  70. package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
  71. package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
  72. package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
  73. package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
  74. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  75. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  76. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  77. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  78. package/styled-components/es/components/Autocomplete/Autocomplete.js +1 -7
  79. package/styled-components/es/components/Badge/Badge.js +18 -8
  80. package/styled-components/es/components/Badge/Badge.template-doc.mdx +40 -16
  81. package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
  82. package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
  83. package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
  84. package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
  85. package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
  86. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  87. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  88. package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  89. package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  90. package/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  91. package/types/components/Autocomplete/Autocomplete.types.d.ts +0 -4
  92. package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
  93. package/types/components/Badge/Badge.d.ts.map +1 -1
  94. package/types/components/Badge/Badge.tokens.d.ts +8 -4
  95. package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
  96. package/types/components/Badge/Badge.types.d.ts +18 -5
  97. package/types/components/Badge/Badge.types.d.ts.map +1 -1
  98. package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
  99. package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
  100. package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
  101. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +61 -4
  102. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
  103. package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
  104. package/types/examples/plasma_web/components/Badge/Badge.d.ts +61 -4
  105. package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
  106. package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  107. package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  108. package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
  109. package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  110. package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  111. package/es/components/Badge/variations/_view/base_qlxank.css +0 -1
@@ -34,6 +34,10 @@ const meta: Meta<typeof Badge> = {
34
34
  maxWidth: {
35
35
  control: { type: 'text' },
36
36
  },
37
+ text: {
38
+ control: { type: 'text' },
39
+ if: { arg: 'enableText', truthy: true },
40
+ },
37
41
  ...disableProps(['contentLeft', 'contentRight']),
38
42
  },
39
43
  };
@@ -43,6 +47,7 @@ export default meta;
43
47
  type StoryProps = ComponentProps<typeof Badge> & {
44
48
  enableContentLeft: boolean;
45
49
  enableContentRight: boolean;
50
+ enableText: boolean;
46
51
  };
47
52
  type Story = StoryObj<StoryProps>;
48
53
 
@@ -63,13 +68,14 @@ export const Default: Story = {
63
68
  },
64
69
  enableContentRight: {
65
70
  control: { type: 'boolean' },
66
- if: { arg: 'enableContentLeft', truthy: false },
71
+ if: { arg: 'enableText', truthy: true },
67
72
  },
68
73
  },
69
74
  args: {
70
- text: 'Hello Kitty',
71
75
  view: 'default',
72
76
  size: 'm',
77
+ enableText: true,
78
+ text: 'Hello',
73
79
  enableContentLeft: false,
74
80
  enableContentRight: false,
75
81
  clear: false,
@@ -77,13 +83,24 @@ export const Default: Story = {
77
83
  transparent: false,
78
84
  maxWidth: '',
79
85
  },
80
- render: ({ enableContentLeft, enableContentRight, size, ...rest }: StoryProps) => {
81
- const iconSize = size === 'l' ? '1rem' : '0.75rem';
86
+ render: ({ enableContentLeft, enableContentRight, enableText, size, ...rest }: StoryProps) => {
87
+ const iconSize = () => {
88
+ switch (size) {
89
+ case 'l':
90
+ return '1rem';
91
+ case 'xs':
92
+ return '0.625rem';
93
+ default:
94
+ return '0.75rem';
95
+ }
96
+ };
82
97
 
83
98
  return (
84
99
  <Badge
85
- contentLeft={enableContentLeft ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
86
- contentRight={enableContentRight ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
100
+ contentLeft={
101
+ enableContentLeft || !enableText ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined
102
+ }
103
+ contentRight={enableContentRight ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined}
87
104
  size={size}
88
105
  {...rest}
89
106
  />