@redneckz/wildless-cms-uni-blocks 0.5.1 → 0.5.3

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.
Files changed (196) hide show
  1. package/bin/migrate.js +2 -0
  2. package/bin/migrateContentUnit.js +26 -0
  3. package/bin/migration-scripts/0.4.0.js +3 -0
  4. package/bin/migration-scripts/0.4.1.js +3 -0
  5. package/bin/migration-scripts/0.4.5.js +109 -0
  6. package/bin/migration-scripts/0.4.5.spec.ts +352 -0
  7. package/bin/migration-scripts/index.js +21 -0
  8. package/bin/utils.js +24 -0
  9. package/bundle/blocks.schema.json +1 -1
  10. package/bundle/bundle.umd.js +27 -25
  11. package/bundle/bundle.umd.min.js +1 -1
  12. package/dist/components/CardTransfer/CardTransfer.js +7 -7
  13. package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  14. package/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
  15. package/dist/components/PictureText/PictureText.js +1 -1
  16. package/dist/components/PictureText/PictureText.js.map +1 -1
  17. package/dist/components/ProductTile/ProductTile.js +2 -2
  18. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  19. package/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  20. package/dist/components/Tabs/TabsContent.d.ts +8 -3
  21. package/dist/components/Tabs/renderGroupTab.js +1 -1
  22. package/dist/components/Tabs/renderGroupTab.js.map +1 -1
  23. package/dist/model/ButtonVersion.d.ts +2 -2
  24. package/dist/ui-kit/Button/Button.js +4 -1
  25. package/dist/ui-kit/Button/Button.js.map +1 -1
  26. package/dist/ui-kit/Button/Button.mobile.js +2 -0
  27. package/dist/ui-kit/Button/Button.mobile.js.map +1 -1
  28. package/dist/ui-kit/Button/ButtonInner.js +3 -2
  29. package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  30. package/dist/ui-kit/Button/ButtonSection.js +3 -2
  31. package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  32. package/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
  33. package/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  34. package/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  35. package/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  36. package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  37. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  38. package/dist/ui-kit/{Tabs/TabsProps.js → CurrencyInput/CurrencyInputProps.js} +1 -1
  39. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  40. package/dist/ui-kit/Select/Select.js +1 -1
  41. package/dist/ui-kit/Select/Select.js.map +1 -1
  42. package/lib/common.css +1 -1
  43. package/lib/components/CardTransfer/CardTransfer.js +7 -7
  44. package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  45. package/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
  46. package/lib/components/PictureText/PictureText.js +1 -1
  47. package/lib/components/PictureText/PictureText.js.map +1 -1
  48. package/lib/components/ProductTile/ProductTile.js +2 -2
  49. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  50. package/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  51. package/lib/components/Tabs/TabsContent.d.ts +8 -3
  52. package/lib/components/Tabs/renderGroupTab.js +1 -1
  53. package/lib/components/Tabs/renderGroupTab.js.map +1 -1
  54. package/lib/model/ButtonVersion.d.ts +2 -2
  55. package/lib/ui-kit/Button/Button.js +4 -1
  56. package/lib/ui-kit/Button/Button.js.map +1 -1
  57. package/lib/ui-kit/Button/Button.mobile.js +2 -0
  58. package/lib/ui-kit/Button/Button.mobile.js.map +1 -1
  59. package/lib/ui-kit/Button/ButtonInner.js +3 -2
  60. package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  61. package/lib/ui-kit/Button/ButtonSection.js +3 -2
  62. package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  63. package/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
  64. package/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  65. package/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  66. package/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  67. package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  68. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  69. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
  70. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  71. package/lib/ui-kit/Select/Select.js +1 -1
  72. package/lib/ui-kit/Select/Select.js.map +1 -1
  73. package/mobile/bundle/bundle.umd.js +9 -5
  74. package/mobile/bundle/bundle.umd.min.js +1 -1
  75. package/mobile/dist/components/CardTransfer/CardTransfer.js +7 -7
  76. package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  77. package/mobile/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
  78. package/mobile/dist/components/PictureText/PictureText.js +1 -1
  79. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  80. package/mobile/dist/components/ProductTile/ProductTile.js +2 -2
  81. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  82. package/mobile/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  83. package/mobile/dist/components/Tabs/TabsContent.d.ts +8 -3
  84. package/mobile/dist/components/Tabs/renderGroupTab.js +1 -1
  85. package/mobile/dist/components/Tabs/renderGroupTab.js.map +1 -1
  86. package/mobile/dist/model/ButtonVersion.d.ts +2 -2
  87. package/mobile/dist/ui-kit/Button/Button.js +2 -0
  88. package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
  89. package/mobile/dist/ui-kit/Button/ButtonInner.js +3 -2
  90. package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  91. package/mobile/dist/ui-kit/Button/ButtonSection.js +3 -2
  92. package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  93. package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
  94. package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  95. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  96. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  97. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  98. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  99. package/mobile/dist/ui-kit/{Tabs/TabsProps.js → CurrencyInput/CurrencyInputProps.js} +1 -1
  100. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  101. package/mobile/dist/ui-kit/Select/Select.js +1 -1
  102. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  103. package/mobile/lib/components/CardTransfer/CardTransfer.js +7 -7
  104. package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  105. package/mobile/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
  106. package/mobile/lib/components/PictureText/PictureText.js +1 -1
  107. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  108. package/mobile/lib/components/ProductTile/ProductTile.js +2 -2
  109. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  110. package/mobile/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  111. package/mobile/lib/components/Tabs/TabsContent.d.ts +8 -3
  112. package/mobile/lib/components/Tabs/renderGroupTab.js +1 -1
  113. package/mobile/lib/components/Tabs/renderGroupTab.js.map +1 -1
  114. package/mobile/lib/model/ButtonVersion.d.ts +2 -2
  115. package/mobile/lib/ui-kit/Button/Button.js +2 -0
  116. package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
  117. package/mobile/lib/ui-kit/Button/ButtonInner.js +3 -2
  118. package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  119. package/mobile/lib/ui-kit/Button/ButtonSection.js +3 -2
  120. package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  121. package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
  122. package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  123. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  124. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  125. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  126. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  127. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
  128. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  129. package/mobile/lib/ui-kit/Select/Select.js +1 -1
  130. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  131. package/mobile/src/components/CardTransfer/CardTransfer.example.json +6 -0
  132. package/mobile/src/components/CardTransfer/CardTransfer.tsx +46 -37
  133. package/mobile/src/components/CardTransfer/CardTransferContent.ts +7 -4
  134. package/mobile/src/components/ContentPage/ContentPage.page.json +7 -1
  135. package/mobile/src/components/PictureText/PictureText.tsx +1 -1
  136. package/mobile/src/components/ProductTile/ProductTile.tsx +4 -2
  137. package/mobile/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
  138. package/mobile/src/components/Tabs/TabsContent.ts +8 -3
  139. package/mobile/src/components/Tabs/renderGroupTab.tsx +2 -1
  140. package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
  141. package/mobile/src/model/ButtonVersion.ts +2 -2
  142. package/mobile/src/ui-kit/Button/Button.tsx +2 -0
  143. package/mobile/src/ui-kit/Button/ButtonInner.tsx +3 -2
  144. package/mobile/src/ui-kit/Button/ButtonSection.tsx +9 -4
  145. package/mobile/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
  146. package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
  147. package/mobile/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
  148. package/mobile/src/ui-kit/Select/Select.tsx +1 -1
  149. package/package.json +5 -1
  150. package/src/components/CardTransfer/CardTransfer.example.json +6 -0
  151. package/src/components/CardTransfer/CardTransfer.tsx +46 -37
  152. package/src/components/CardTransfer/CardTransferContent.ts +7 -4
  153. package/src/components/ContentPage/ContentPage.page.json +7 -1
  154. package/src/components/PictureText/PictureText.tsx +1 -1
  155. package/src/components/ProductGallery/ProductGallery.fixture.tsx +1 -1
  156. package/src/components/ProductTile/ProductTile.tsx +4 -2
  157. package/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
  158. package/src/components/StepsBlock/StepsBlock.fixture.tsx +2 -0
  159. package/src/components/Tabs/TabsContent.ts +8 -3
  160. package/src/components/Tabs/renderGroupTab.tsx +2 -1
  161. package/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
  162. package/src/model/ButtonVersion.ts +2 -2
  163. package/src/ui-kit/Button/Button.mobile.tsx +2 -0
  164. package/src/ui-kit/Button/Button.tsx +5 -3
  165. package/src/ui-kit/Button/ButtonInner.tsx +3 -2
  166. package/src/ui-kit/Button/ButtonSection.tsx +9 -4
  167. package/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
  168. package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
  169. package/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
  170. package/src/ui-kit/Select/Select.tsx +1 -1
  171. package/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
  172. package/dist/ui-kit/Tabs/Tabs.js +0 -17
  173. package/dist/ui-kit/Tabs/Tabs.js.map +0 -1
  174. package/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
  175. package/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
  176. package/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
  177. package/lib/ui-kit/Tabs/Tabs.js +0 -15
  178. package/lib/ui-kit/Tabs/Tabs.js.map +0 -1
  179. package/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
  180. package/lib/ui-kit/Tabs/TabsProps.js +0 -2
  181. package/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
  182. package/mobile/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
  183. package/mobile/dist/ui-kit/Tabs/Tabs.js +0 -17
  184. package/mobile/dist/ui-kit/Tabs/Tabs.js.map +0 -1
  185. package/mobile/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
  186. package/mobile/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
  187. package/mobile/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
  188. package/mobile/lib/ui-kit/Tabs/Tabs.js +0 -15
  189. package/mobile/lib/ui-kit/Tabs/Tabs.js.map +0 -1
  190. package/mobile/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
  191. package/mobile/lib/ui-kit/Tabs/TabsProps.js +0 -2
  192. package/mobile/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
  193. package/mobile/src/ui-kit/Tabs/Tabs.tsx +0 -52
  194. package/mobile/src/ui-kit/Tabs/TabsProps.ts +0 -20
  195. package/src/ui-kit/Tabs/Tabs.tsx +0 -52
  196. package/src/ui-kit/Tabs/TabsProps.ts +0 -20
@@ -28,7 +28,7 @@ export const PictureText = JSX<PictureTextProps>(
28
28
  }) => {
29
29
  return (
30
30
  <BlockWrapper
31
- className={`relative font-sans p-14 ${VersionStyleMap[version]} ${className}`}
31
+ className={`relative font-sans py-12 px-28 ${VersionStyleMap[version]} ${className}`}
32
32
  context={context}
33
33
  {...rest}
34
34
  >
@@ -50,7 +50,7 @@ const buttonsSecondary: ButtonWithIconProps[] = [
50
50
  href: 'https://rshb.ru',
51
51
  text: 'Подробнее',
52
52
  target: '_blank',
53
- version: 'secondary',
53
+ version: 'white',
54
54
  },
55
55
  ];
56
56
 
@@ -36,7 +36,7 @@ export const ProductTile = JSX<ProductTileProps>(
36
36
  >
37
37
  <Headline
38
38
  context={context}
39
- className={`!p-0 z-10 ${title || description ? 'mb-3.5' : ''}`}
39
+ className={`!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`}
40
40
  as="h2"
41
41
  title={title}
42
42
  description={description}
@@ -99,6 +99,8 @@ function renderAdditionalDescription(additionalDescription: string, version = 'p
99
99
  };
100
100
 
101
101
  return (
102
- <div className={`text-m-light mt-2.5 ${descStyleMap[version]}`}>{additionalDescription}</div>
102
+ <div className={`text-m-light mt-2.5 z-10 ${descStyleMap[version]}`}>
103
+ {additionalDescription}
104
+ </div>
103
105
  );
104
106
  }
@@ -3,7 +3,7 @@ import { useState } from '@redneckz/uni-jsx/lib/hooks/core';
3
3
  import { Radio } from '../../ui-kit/Radio/Radio';
4
4
 
5
5
  export const RenderRadioButtons = JSX(() => {
6
- const [selectedOption, setSelectedOption] = useState('option1');
6
+ const [selectedOption, setSelectedOption] = useState('option2');
7
7
 
8
8
  const onChange = (_: React.ChangeEvent<HTMLInputElement>) => setSelectedOption(_.target.value);
9
9
 
@@ -90,6 +90,8 @@ export default {
90
90
  text: 'Отправить заявку',
91
91
  href: 'https://www.rshb.ru/',
92
92
  target: '_blank',
93
+ icon: { icon: 'ComfortableCompIcon' },
94
+ iconRight: { icon: 'ComfortableCompIcon' },
93
95
  }}
94
96
  />
95
97
  </div>
@@ -1,7 +1,9 @@
1
1
  import type { LinkProps } from '../../model/LinkProps';
2
2
 
3
+ /**
4
+ * @title Группа
5
+ */
3
6
  export interface GroupTab {
4
- /** @default group */
5
7
  type: 'group';
6
8
  /** @title Тег */
7
9
  ref?: string;
@@ -9,13 +11,16 @@ export interface GroupTab {
9
11
  title?: string;
10
12
  }
11
13
 
14
+ /**
15
+ * @title Ссылка
16
+ */
12
17
  export type LinkTab = LinkProps & {
13
- /** @default link */
14
18
  type: 'link';
15
19
  };
16
20
 
17
21
  /**
18
- * @title Таб
22
+ * @title Таб
23
+ * @default {"type": "group"}
19
24
  */
20
25
  export type Tab = GroupTab | LinkTab;
21
26
 
@@ -9,7 +9,8 @@ import {
9
9
  } from './tabItemClasses';
10
10
  import type { GroupTab } from './TabsContent';
11
11
 
12
- const BADGE_CLASSES = 'min-w-[22px] w-[22px] h-[22px] rounded-full text-xs ml-2';
12
+ const BADGE_CLASSES =
13
+ 'min-w-[22px] w-[22px] h-[22px] rounded-full text-xs ml-2 flex justify-center items-center';
13
14
  const ACTIVE_BADGE_CLASSES = 'bg-white/30 text-white';
14
15
  const INACTIVE_BADGE_CLASSES = 'bg-main-divider text-secondary-text group-hover:text-primary-main';
15
16
 
@@ -353,7 +353,7 @@ exports[`Blocks Footer should render block "Footer" without content 1`] = `
353
353
  target="_blank"
354
354
  >
355
355
  <div
356
- class="flex items-center justify-center gap-2 py-4 px-9 "
356
+ class="group flex items-center justify-center gap-2 py-4 px-9 "
357
357
  >
358
358
  <div>
359
359
  <div
@@ -695,7 +695,7 @@ exports[`Blocks OtherProducts should render block "OtherProducts" without conten
695
695
 
696
696
  exports[`Blocks PictureText should render block "PictureText" without content 1`] = `
697
697
  <section
698
- class="relative font-sans p-14 bg-white text-primary-text "
698
+ class="relative font-sans py-12 px-28 bg-white text-primary-text "
699
699
  >
700
700
  <section
701
701
  class="font-sans flex flex-col p-[50px] gap-3 bg-white !p-0"
@@ -801,7 +801,7 @@ exports[`Blocks ProductTile should render block "ProductTile" without content 1`
801
801
  class="overflow-hidden font-sans p-9 box-border relative justify-between grid bg-white text-primary-text pr-[9.4rem] min-h-[360px]"
802
802
  >
803
803
  <section
804
- class="font-sans flex flex-col p-[50px] gap-2 bg-white !p-0 z-10 "
804
+ class="font-sans flex flex-col p-[50px] gap-2 bg-white !p-0 !bg-transparent z-10 "
805
805
  />
806
806
  <div
807
807
  class="z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline max-w-[calc(100%-186px)]"
@@ -894,7 +894,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
894
894
  Город
895
895
  </span>
896
896
  <select
897
- class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
897
+ class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
898
898
  placeholder=""
899
899
  style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
900
900
  >
@@ -917,7 +917,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
917
917
  Отделение
918
918
  </span>
919
919
  <select
920
- class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
920
+ class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
921
921
  placeholder=""
922
922
  style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
923
923
  >
@@ -991,7 +991,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
991
991
  Размер
992
992
  </span>
993
993
  <select
994
- class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
994
+ class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
995
995
  placeholder=""
996
996
  style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
997
997
  >
@@ -1014,7 +1014,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1014
1014
  Параметры ячейки, мм (ВхШхД)
1015
1015
  </span>
1016
1016
  <select
1017
- class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
1017
+ class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
1018
1018
  placeholder=""
1019
1019
  style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
1020
1020
  >
@@ -1044,7 +1044,6 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1044
1044
  class="flex items-center relative cursor-pointer"
1045
1045
  >
1046
1046
  <input
1047
- checked=""
1048
1047
  class="appearance-none flex justify-center items-center shrink-0 w-5 h-5 border-2 border-primary-main rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main"
1049
1048
  name="contractType"
1050
1049
  type="radio"
@@ -1062,6 +1061,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1062
1061
  class="flex items-center relative cursor-pointer"
1063
1062
  >
1064
1063
  <input
1064
+ checked=""
1065
1065
  class="appearance-none flex justify-center items-center shrink-0 w-5 h-5 border-2 border-primary-main rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main"
1066
1066
  name="contractType"
1067
1067
  type="radio"
@@ -1080,7 +1080,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1080
1080
  role="button"
1081
1081
  >
1082
1082
  <div
1083
- class="flex items-center justify-center gap-2 py-4 px-9 "
1083
+ class="group flex items-center justify-center gap-2 py-4 px-9 "
1084
1084
  >
1085
1085
  <div>
1086
1086
  <div
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @title Цвет кнопки
3
3
  * @default primary
4
- * @enumNames ["Основная", "Второстепенная", "Ссылка"]
4
+ * @enumNames ["Основная", "Второстепенная", "Белая", "Ссылка"]
5
5
  */
6
- export type ButtonVersion = 'primary' | 'secondary' | 'link';
6
+ export type ButtonVersion = 'primary' | 'secondary' | 'white' | 'link';
@@ -10,12 +10,14 @@ const buttonStyleMap: Record<ButtonVersion, string> = {
10
10
  primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
11
11
  secondary:
12
12
  'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
13
+ white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white',
13
14
  link: 'text-primary-main',
14
15
  };
15
16
 
16
17
  const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
17
18
  primary: 'bg-secondary-dark text-secondary-text',
18
19
  secondary: 'bg-secondary-light text-secondary-text',
20
+ white: 'bg-white text-primary-text',
19
21
  link: '',
20
22
  };
21
23
 
@@ -6,7 +6,9 @@ import { getDisabledButtonClasses } from './getDisabledButtonClasses';
6
6
 
7
7
  export const Button = JSX<ButtonWithIconProps>((props) => {
8
8
  const { text, aboveText, appendLeft, appendRight, children, disabled, rounded, ...rest } = props;
9
-
9
+ // its non valid HTML attribute. Must be excluded from "rest"
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+ const { asSVG, iconRight, icon, ...usedProps } = rest;
10
12
  const buttonInner = children ?? (
11
13
  <ButtonInner
12
14
  text={text}
@@ -18,11 +20,11 @@ export const Button = JSX<ButtonWithIconProps>((props) => {
18
20
  );
19
21
 
20
22
  return disabled ? (
21
- <DisabledButton rounded={rounded} {...rest}>
23
+ <DisabledButton rounded={rounded} {...usedProps}>
22
24
  {buttonInner}
23
25
  </DisabledButton>
24
26
  ) : (
25
- <RegularButton rounded={rounded} {...rest}>
27
+ <RegularButton rounded={rounded} {...usedProps}>
26
28
  {buttonInner}
27
29
  </RegularButton>
28
30
  );
@@ -24,7 +24,7 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
24
24
  });
25
25
 
26
26
  const getButtonStyle = (props: ButtonInnerProps) => {
27
- const { version, aboveText, rounded } = props;
27
+ const { className = '', version, aboveText, rounded } = props;
28
28
 
29
29
  if (version === 'link') {
30
30
  return '';
@@ -33,9 +33,10 @@ const getButtonStyle = (props: ButtonInnerProps) => {
33
33
  const withTextStyle = `gap-2 ${aboveText ? 'py-2.5 px-7' : 'py-4 px-9'}`;
34
34
 
35
35
  return [
36
- 'flex items-center justify-center',
36
+ 'group flex items-center justify-center',
37
37
  isWithText(props) ? withTextStyle : 'h-12 w-12',
38
38
  rounded ? 'rounded-full' : '',
39
+ className,
39
40
  ].join(' ');
40
41
  };
41
42
 
@@ -20,19 +20,24 @@ export const ButtonSection = JSX<ButtonSectionProps>(({ context, className = '',
20
20
  ) : null;
21
21
  });
22
22
 
23
- function renderButton({ icon, iconRight, ...button }: ButtonWithIconProps, i: number) {
23
+ function renderButton(
24
+ { icon, iconRight, version = 'primary', ...button }: ButtonWithIconProps,
25
+ i: number,
26
+ ) {
24
27
  if (!button?.text) {
25
28
  return null;
26
29
  }
30
+ const imgStyle = version === 'primary' ? 'group-hover:text-black' : 'group-hover:text-white';
27
31
 
28
32
  return icon ? (
29
33
  <Button
30
34
  key={String(i)}
31
- appendLeft={<Img image={icon} width="24" height="24" asSVG />}
32
- appendRight={<Img image={iconRight} width="24" height="24" asSVG />}
35
+ appendLeft={<Img imageClassName={imgStyle} image={icon} width="24" height="24" asSVG />}
36
+ appendRight={<Img imageClassName={imgStyle} image={iconRight} width="24" height="24" asSVG />}
37
+ version={version}
33
38
  {...button}
34
39
  />
35
40
  ) : (
36
- <Button key={String(i)} {...button} />
41
+ <Button key={String(i)} version={version} {...button} />
37
42
  );
38
43
  }
@@ -4,12 +4,14 @@ export const buttonStyleMap: Record<ButtonVersion, string> = {
4
4
  primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
5
5
  secondary:
6
6
  'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
7
+ white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white',
7
8
  link: '',
8
9
  };
9
10
 
10
11
  export const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
11
12
  primary: 'bg-secondary-dark text-secondary-text',
12
13
  secondary: 'bg-secondary-light text-secondary-text',
14
+ white: 'bg-white text-primary-text',
13
15
  link: '',
14
16
  };
15
17
 
@@ -1,37 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { clamp } from '../../utils/clamp';
3
-
4
- // ISO 4217 codes
5
- /**
6
- * @title Валюта
7
- * @enumNames ["Рубль", "Доллар", "Евро"]
8
- * @default "RUB"
9
- */
10
- type Currency = 'RUB' | 'USD' | 'EUR';
11
-
12
- const CurrencyMap: Record<Currency, string> = {
13
- RUB: '₽',
14
- USD: '$',
15
- EUR: '€',
16
- };
17
-
18
- type CurrencyInputProps = {
19
- className?: string;
20
- label?: string;
21
- currency?: Currency;
22
- onChange?: (value: string) => void;
23
- name?: string;
24
- value?: string;
25
- placeholder?: string;
26
- minValue?: number;
27
- maxValue?: number;
28
- };
3
+ import type { CurrencyInputProps } from './CurrencyInputProps';
29
4
 
30
5
  export const CurrencyInput = JSX<CurrencyInputProps>(
31
6
  ({
32
7
  className = '',
33
8
  label,
34
- currency = 'RUB',
35
9
  onChange,
36
10
  value = '',
37
11
  minValue = 0,
@@ -55,14 +29,16 @@ export const CurrencyInput = JSX<CurrencyInputProps>(
55
29
  <div className="h-[56px] relative flex items-center">
56
30
  <input
57
31
  type="number"
58
- className="text-l pl-4 pr-8 w-full h-full rounded-md border border-solid border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text"
32
+ className={
33
+ 'text-l pl-4 pr-8 w-full h-full rounded-md border border-solid border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text'
34
+ }
59
35
  onChange={handleChange}
60
36
  value={value}
61
37
  min={minValue}
62
38
  max={maxValue}
63
39
  {...inputProps}
64
40
  />
65
- <span className="text-xl-light absolute right-4">{CurrencyMap[currency]}</span>
41
+ <span className="text-xl-light absolute right-4">₽</span>
66
42
  </div>
67
43
  </div>
68
44
  );
@@ -0,0 +1,10 @@
1
+ export type CurrencyInputProps = {
2
+ className?: string;
3
+ label?: string;
4
+ onChange?: (value: string) => void;
5
+ name?: string;
6
+ value?: string;
7
+ placeholder?: string;
8
+ minValue?: number;
9
+ maxValue?: number;
10
+ };
@@ -16,7 +16,7 @@ export const Select = JSX<SelectProps>(
16
16
  ({ className = '', id, name, children, value, onChange }) => {
17
17
  return (
18
18
  <select
19
- className={`appearance-none ${className}`}
19
+ className={`appearance-none pl-0.5 ${className}`}
20
20
  style={selectStyle}
21
21
  id={id}
22
22
  name={name || id}
@@ -1,2 +0,0 @@
1
- import type { TabsProps } from './TabsProps';
2
- export declare const Tabs: import("@redneckz/uni-jsx").UNIComponent<TabsProps, any, any>;
@@ -1,17 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.Tabs = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const Img_1 = require("../Img/Img");
6
- const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
7
- const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
8
- exports.Tabs = (0, uni_jsx_1.JSX)(({ tabs, currentTabIndex, onTabClick }) => {
9
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end border-b border-main-stroke", role: "tablist", children: tabs?.map(renderTab(currentTabIndex, onTabClick)) }));
10
- });
11
- const tabDescriptionStyle = (isActive = false) => `text-xs-light ${isActive ? '' : 'text-secondary-text'}`;
12
- const renderTab = (currentTabIndex, onTabClick) => (tab, index) => {
13
- const isActive = currentTabIndex === index;
14
- return ((0, jsx_runtime_1.jsxs)("div", { className: `flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${isActive ? ACTIVE_TAB_STYLE : TAB_STYLE}`, role: "tab", onClick: () => onTabClick(index), "aria-selected": isActive, children: [tab?.icon ? renderIcon(tab, isActive) : null, (0, jsx_runtime_1.jsxs)("div", { children: [tab?.title ? (0, jsx_runtime_1.jsx)("h3", { className: "m-0 text-l font-medium", children: tab?.title }) : null, tab?.description ? ((0, jsx_runtime_1.jsx)("span", { className: tabDescriptionStyle(isActive), children: tab?.description })) : null] })] }, String(index)));
15
- };
16
- const renderIcon = (tab, isActive) => ((0, jsx_runtime_1.jsx)("div", { className: "h-full mt-1", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { className: `w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`, image: tab?.icon || 'CardIcon', asSVG: !isActive }) }));
17
- //# sourceMappingURL=Tabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","s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C,CAAC,CAAC,CAClB,iCAAM,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CAAC,YAAG,GAAG,EAAE,WAAW,GAAQ,CAC1E,CAAC,CAAC,CAAC,IAAI,IACJ,KAdD,MAAM,CAAC,KAAK,CAAC,CAed,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAE,QAAiB,EAAE,EAAE,CAAC,CAClD,gCAAK,SAAS,EAAC,aAAa,YAC1B,uBAAC,SAAG,IACF,SAAS,EAAE,gBAAgB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EACrD,KAAK,EAAE,GAAG,EAAE,IAAI,IAAI,UAAU,EAC9B,KAAK,EAAE,CAAC,QAAQ,GAChB,GACE,CACP,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { Picture } from '../../model/Picture';
2
- /**
3
- * @title Вкладка
4
- */
5
- export interface Tab {
6
- /** @title Имя вкладки */
7
- title?: string;
8
- /** @title Описание */
9
- description?: string;
10
- icon?: Picture;
11
- }
12
- export declare type TabClickHandler = (tabIndex: number) => void;
13
- export interface TabsProps {
14
- tabs?: Tab[];
15
- currentTabIndex: number;
16
- onTabClick: TabClickHandler;
17
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabsProps.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/TabsProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { TabsProps } from './TabsProps';
2
- export declare const Tabs: import("@redneckz/uni-jsx").UNIComponent<TabsProps, any, any>;
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { Img } from '../Img/Img.js';
4
- const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
5
- const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
6
- export const Tabs = JSX(({ tabs, currentTabIndex, onTabClick }) => {
7
- return (_jsx("div", { className: "flex items-end border-b border-main-stroke", role: "tablist", children: tabs?.map(renderTab(currentTabIndex, onTabClick)) }));
8
- });
9
- const tabDescriptionStyle = (isActive = false) => `text-xs-light ${isActive ? '' : 'text-secondary-text'}`;
10
- const renderTab = (currentTabIndex, onTabClick) => (tab, index) => {
11
- const isActive = currentTabIndex === index;
12
- return (_jsxs("div", { className: `flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${isActive ? ACTIVE_TAB_STYLE : TAB_STYLE}`, role: "tab", onClick: () => onTabClick(index), "aria-selected": isActive, children: [tab?.icon ? renderIcon(tab, isActive) : null, _jsxs("div", { children: [tab?.title ? _jsx("h3", { className: "m-0 text-l font-medium", children: tab?.title }) : null, tab?.description ? (_jsx("span", { className: tabDescriptionStyle(isActive), children: tab?.description })) : null] })] }, String(index)));
13
- };
14
- const renderIcon = (tab, isActive) => (_jsx("div", { className: "h-full mt-1", children: _jsx(Img, { className: `w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`, image: tab?.icon || 'CardIcon', asSVG: !isActive }) }));
15
- //# sourceMappingURL=Tabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,MAAM,SAAS,GAAG,0DAA0D,CAAC;AAC7E,MAAM,gBAAgB,GAAG,gDAAgD,CAAC;AAE1E,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,cAAK,SAAS,EAAC,4CAA4C,EAAC,IAAI,EAAC,SAAS,YACvE,IAAI,EAAE,GA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QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EACrD,KAAK,EAAE,GAAG,EAAE,IAAI,IAAI,UAAU,EAC9B,KAAK,EAAE,CAAC,QAAQ,GAChB,GACE,CACP,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { Picture } from '../../model/Picture';
2
- /**
3
- * @title Вкладка
4
- */
5
- export interface Tab {
6
- /** @title Имя вкладки */
7
- title?: string;
8
- /** @title Описание */
9
- description?: string;
10
- icon?: Picture;
11
- }
12
- export declare type TabClickHandler = (tabIndex: number) => void;
13
- export interface TabsProps {
14
- tabs?: Tab[];
15
- currentTabIndex: number;
16
- onTabClick: TabClickHandler;
17
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TabsProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabsProps.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/TabsProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { TabsProps } from './TabsProps';
2
- export declare const Tabs: import("@redneckz/uni-jsx").UNIComponent<TabsProps, any, any>;
@@ -1,17 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.Tabs = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const Img_1 = require("../Img/Img");
6
- const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
7
- const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
8
- exports.Tabs = (0, uni_jsx_1.JSX)(({ tabs, currentTabIndex, onTabClick }) => {
9
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end border-b border-main-stroke", role: "tablist", children: tabs?.map(renderTab(currentTabIndex, onTabClick)) }));
10
- });
11
- const tabDescriptionStyle = (isActive = false) => `text-xs-light ${isActive ? '' : 'text-secondary-text'}`;
12
- const renderTab = (currentTabIndex, onTabClick) => (tab, index) => {
13
- const isActive = currentTabIndex === index;
14
- return ((0, jsx_runtime_1.jsxs)("div", { className: `flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${isActive ? ACTIVE_TAB_STYLE : TAB_STYLE}`, role: "tab", onClick: () => onTabClick(index), "aria-selected": isActive, children: [tab?.icon ? renderIcon(tab, isActive) : null, (0, jsx_runtime_1.jsxs)("div", { children: [tab?.title ? (0, jsx_runtime_1.jsx)("h3", { className: "m-0 text-l font-medium", children: tab?.title }) : null, tab?.description ? ((0, jsx_runtime_1.jsx)("span", { className: tabDescriptionStyle(isActive), children: tab?.description })) : null] })] }, String(index)));
15
- };
16
- const renderIcon = (tab, isActive) => ((0, jsx_runtime_1.jsx)("div", { className: "h-full mt-1", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { className: `w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`, image: tab?.icon || 'CardIcon', asSVG: !isActive }) }));
17
- //# sourceMappingURL=Tabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/Tabs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,oCAAiC;AAGjC,MAAM,SAAS,GAAG,0DAA0D,CAAC;AAC7E,MAAM,gBAAgB,GAAG,gDAAgD,CAAC;AAE7D,QAAA,IAAI,GAAG,IAAA,aAAG,EAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,gCAAK,SAAS,EAAC,4CAA4C,EAAC,IAAI,EAAC,SAAS,YACvE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAC9C,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,CAAC,QAAQ,GAAG,KAAK,EAAE,EAAE,CAC/C,iBAAiB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC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кладка
4
- */
5
- export interface Tab {
6
- /** @title Имя вкладки */
7
- title?: string;
8
- /** @title Описание */
9
- description?: string;
10
- icon?: Picture;
11
- }
12
- export declare type TabClickHandler = (tabIndex: number) => void;
13
- export interface TabsProps {
14
- tabs?: Tab[];
15
- currentTabIndex: number;
16
- onTabClick: TabClickHandler;
17
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabsProps.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/TabsProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { TabsProps } from './TabsProps';
2
- export declare const Tabs: import("@redneckz/uni-jsx").UNIComponent<TabsProps, any, any>;
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { Img } from '../Img/Img.js';
4
- const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
5
- const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
6
- export const Tabs = JSX(({ tabs, currentTabIndex, onTabClick }) => {
7
- return (_jsx("div", { className: "flex items-end border-b border-main-stroke", role: "tablist", children: tabs?.map(renderTab(currentTabIndex, onTabClick)) }));
8
- });
9
- const tabDescriptionStyle = (isActive = false) => `text-xs-light ${isActive ? '' : 'text-secondary-text'}`;
10
- const renderTab = (currentTabIndex, onTabClick) => (tab, index) => {
11
- const isActive = currentTabIndex === index;
12
- return (_jsxs("div", { className: `flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${isActive ? ACTIVE_TAB_STYLE : TAB_STYLE}`, role: "tab", onClick: () => onTabClick(index), "aria-selected": isActive, children: [tab?.icon ? renderIcon(tab, isActive) : null, _jsxs("div", { children: [tab?.title ? _jsx("h3", { className: "m-0 text-l font-medium", children: tab?.title }) : null, tab?.description ? (_jsx("span", { className: tabDescriptionStyle(isActive), children: tab?.description })) : null] })] }, String(index)));
13
- };
14
- const renderIcon = (tab, isActive) => (_jsx("div", { className: "h-full mt-1", children: _jsx(Img, { className: `w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`, image: tab?.icon || 'CardIcon', asSVG: !isActive }) }));
15
- //# sourceMappingURL=Tabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,MAAM,SAAS,GAAG,0DAA0D,CAAC;AAC7E,MAAM,gBAAgB,GAAG,gDAAgD,CAAC;AAE1E,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,cAAK,SAAS,EAAC,4CAA4C,EAAC,IAAI,EAAC,SAAS,YACvE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAC9C,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,CAAC,QAAQ,GAAG,KAAK,EAAE,EAAE,CAC/C,iBAAiB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAAC;AAE3D,MAAM,SAAS,GACb,CAAC,eAAuB,EAAE,UAA2B,EAAE,EAAE,CAAC,CAAC,GAAQ,EAAE,KAAa,EAAE,EAAE;IACpF,MAAM,QAAQ,GAAG,eAAe,KAAK,KAAK,CAAC;IAE3C,OAAO,CACL,eAEE,SAAS,EAAE,gEACT,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAChC,EAAE,EACF,IAAI,EAAC,KAAK,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,mBACjB,QAAQ,aAEtB,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAC7C,0BACG,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,aAAI,SAAS,EAAC,wBAAwB,YAAE,GAAG,EAAE,KAAK,GAAM,CAAC,CAAC,CAAC,IAAI,EAC5E,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAClB,eAAM,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CAAC,YAAG,GAAG,EAAE,WAAW,GAAQ,CAC1E,CAAC,CAAC,CAAC,IAAI,IACJ,KAdD,MAAM,CAAC,KAAK,CAAC,CAed,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAE,QAAiB,EAAE,EAAE,CAAC,CAClD,cAAK,SAAS,EAAC,aAAa,YAC1B,KAAC,GAAG,IACF,SAAS,EAAE,gBAAgB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EACrD,KAAK,EAAE,GAAG,EAAE,IAAI,IAAI,UAAU,EAC9B,KAAK,EAAE,CAAC,QAAQ,GAChB,GACE,CACP,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { Picture } from '../../model/Picture';
2
- /**
3
- * @title Вкладка
4
- */
5
- export interface Tab {
6
- /** @title Имя вкладки */
7
- title?: string;
8
- /** @title Описание */
9
- description?: string;
10
- icon?: Picture;
11
- }
12
- export declare type TabClickHandler = (tabIndex: number) => void;
13
- export interface TabsProps {
14
- tabs?: Tab[];
15
- currentTabIndex: number;
16
- onTabClick: TabClickHandler;
17
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TabsProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabsProps.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/TabsProps.ts"],"names":[],"mappings":""}