@salutejs/plasma-new-hope 0.192.3-canary.1550.11813906469.0 → 0.193.0-canary.1546.11814894884.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/cjs/components/Badge/Badge.css +4 -4
  2. package/cjs/components/Badge/Badge.js +17 -7
  3. package/cjs/components/Badge/Badge.js.map +1 -1
  4. package/cjs/components/Badge/Badge.tokens.js +10 -5
  5. package/cjs/components/Badge/Badge.tokens.js.map +1 -1
  6. package/cjs/components/Badge/variations/_clear/base.js +1 -1
  7. package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
  8. package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  9. package/cjs/components/Badge/variations/_size/base.js +1 -1
  10. package/cjs/components/Badge/variations/_size/base.js.map +1 -1
  11. package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  12. package/cjs/components/Badge/variations/_transparent/base.js +1 -1
  13. package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
  14. package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  15. package/cjs/components/Badge/variations/_view/base.js +1 -1
  16. package/cjs/components/Badge/variations/_view/base.js.map +1 -1
  17. package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  18. package/cjs/index.css +4 -4
  19. package/emotion/cjs/components/Badge/Badge.js +17 -7
  20. package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
  21. package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
  22. package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
  23. package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
  24. package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
  25. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  26. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  27. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  28. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  29. package/emotion/es/components/Badge/Badge.js +18 -8
  30. package/emotion/es/components/Badge/Badge.tokens.js +9 -5
  31. package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
  32. package/emotion/es/components/Badge/variations/_size/base.js +3 -2
  33. package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
  34. package/emotion/es/components/Badge/variations/_view/base.js +2 -2
  35. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  36. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  37. package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  38. package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  39. package/es/components/Badge/Badge.css +4 -4
  40. package/es/components/Badge/Badge.js +20 -10
  41. package/es/components/Badge/Badge.js.map +1 -1
  42. package/es/components/Badge/Badge.tokens.js +10 -6
  43. package/es/components/Badge/Badge.tokens.js.map +1 -1
  44. package/es/components/Badge/variations/_clear/base.js +1 -1
  45. package/es/components/Badge/variations/_clear/base.js.map +1 -1
  46. package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  47. package/es/components/Badge/variations/_size/base.js +1 -1
  48. package/es/components/Badge/variations/_size/base.js.map +1 -1
  49. package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  50. package/es/components/Badge/variations/_transparent/base.js +1 -1
  51. package/es/components/Badge/variations/_transparent/base.js.map +1 -1
  52. package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  53. package/es/components/Badge/variations/_view/base.js +1 -1
  54. package/es/components/Badge/variations/_view/base.js.map +1 -1
  55. package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  56. package/es/index.css +4 -4
  57. package/package.json +2 -2
  58. package/styled-components/cjs/components/Badge/Badge.js +17 -7
  59. package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
  60. package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
  61. package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
  62. package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
  63. package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
  64. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  65. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  66. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  67. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  68. package/styled-components/es/components/Badge/Badge.js +18 -8
  69. package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
  70. package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
  71. package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
  72. package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
  73. package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
  74. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  75. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  76. package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  77. package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  78. package/types/components/Badge/Badge.d.ts.map +1 -1
  79. package/types/components/Badge/Badge.tokens.d.ts +8 -4
  80. package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
  81. package/types/components/Badge/Badge.types.d.ts +18 -5
  82. package/types/components/Badge/Badge.types.d.ts.map +1 -1
  83. package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
  84. package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
  85. package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
  86. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +61 -4
  87. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
  88. package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
  89. package/types/examples/plasma_web/components/Badge/Badge.d.ts +61 -4
  90. package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
  91. package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  92. package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  93. package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
  94. package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  95. package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  96. 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
  />