@redneckz/wildless-cms-uni-blocks 0.5.2 → 0.5.4

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 (129) 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 +14 -12
  11. package/bundle/bundle.umd.min.js +1 -1
  12. package/dist/components/ErrorBlock/ErrorBlock.js +3 -3
  13. package/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
  14. package/dist/components/ErrorBlock/ErrorBlockContent.d.ts +6 -6
  15. package/dist/components/OfficeServicesBlock/OfficeServicesBlock.js +3 -3
  16. package/dist/components/OfficeServicesBlock/OfficeServicesBlock.js.map +1 -1
  17. package/dist/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +2 -1
  18. package/dist/components/Tabs/TabsContent.d.ts +8 -3
  19. package/dist/components/Tabs/renderGroupTab.js +1 -1
  20. package/dist/components/Tabs/renderGroupTab.js.map +1 -1
  21. package/dist/ui-kit/Button/ButtonInner.js +3 -2
  22. package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  23. package/dist/ui-kit/Button/ButtonSection.js +3 -2
  24. package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  25. package/dist/ui-kit/Select/Select.js +1 -1
  26. package/dist/ui-kit/Select/Select.js.map +1 -1
  27. package/lib/common.css +1 -1
  28. package/lib/components/ErrorBlock/ErrorBlock.js +3 -3
  29. package/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
  30. package/lib/components/ErrorBlock/ErrorBlockContent.d.ts +6 -6
  31. package/lib/components/OfficeServicesBlock/OfficeServicesBlock.js +3 -3
  32. package/lib/components/OfficeServicesBlock/OfficeServicesBlock.js.map +1 -1
  33. package/lib/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +2 -1
  34. package/lib/components/Tabs/TabsContent.d.ts +8 -3
  35. package/lib/components/Tabs/renderGroupTab.js +1 -1
  36. package/lib/components/Tabs/renderGroupTab.js.map +1 -1
  37. package/lib/ui-kit/Button/ButtonInner.js +3 -2
  38. package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  39. package/lib/ui-kit/Button/ButtonSection.js +3 -2
  40. package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  41. package/lib/ui-kit/Select/Select.js +1 -1
  42. package/lib/ui-kit/Select/Select.js.map +1 -1
  43. package/mobile/bundle/bundle.umd.js +7 -5
  44. package/mobile/bundle/bundle.umd.min.js +1 -1
  45. package/mobile/dist/components/ErrorBlock/ErrorBlock.js +3 -3
  46. package/mobile/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
  47. package/mobile/dist/components/ErrorBlock/ErrorBlockContent.d.ts +6 -6
  48. package/mobile/dist/components/OfficeServicesBlock/OfficeServicesBlock.js +3 -3
  49. package/mobile/dist/components/OfficeServicesBlock/OfficeServicesBlock.js.map +1 -1
  50. package/mobile/dist/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +2 -1
  51. package/mobile/dist/components/Tabs/TabsContent.d.ts +8 -3
  52. package/mobile/dist/components/Tabs/renderGroupTab.js +1 -1
  53. package/mobile/dist/components/Tabs/renderGroupTab.js.map +1 -1
  54. package/mobile/dist/ui-kit/Button/ButtonInner.js +3 -2
  55. package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  56. package/mobile/dist/ui-kit/Button/ButtonSection.js +3 -2
  57. package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  58. package/mobile/dist/ui-kit/Select/Select.js +1 -1
  59. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  60. package/mobile/lib/components/ErrorBlock/ErrorBlock.js +3 -3
  61. package/mobile/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
  62. package/mobile/lib/components/ErrorBlock/ErrorBlockContent.d.ts +6 -6
  63. package/mobile/lib/components/OfficeServicesBlock/OfficeServicesBlock.js +3 -3
  64. package/mobile/lib/components/OfficeServicesBlock/OfficeServicesBlock.js.map +1 -1
  65. package/mobile/lib/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +2 -1
  66. package/mobile/lib/components/Tabs/TabsContent.d.ts +8 -3
  67. package/mobile/lib/components/Tabs/renderGroupTab.js +1 -1
  68. package/mobile/lib/components/Tabs/renderGroupTab.js.map +1 -1
  69. package/mobile/lib/ui-kit/Button/ButtonInner.js +3 -2
  70. package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  71. package/mobile/lib/ui-kit/Button/ButtonSection.js +3 -2
  72. package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  73. package/mobile/lib/ui-kit/Select/Select.js +1 -1
  74. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  75. package/mobile/src/components/ErrorBlock/ErrorBlock.example.json +5 -5
  76. package/mobile/src/components/ErrorBlock/ErrorBlock.tsx +12 -5
  77. package/mobile/src/components/ErrorBlock/ErrorBlockContent.ts +20 -6
  78. package/mobile/src/components/OfficeServicesBlock/OfficeServicesBlock.example.json +30 -16
  79. package/mobile/src/components/OfficeServicesBlock/OfficeServicesBlock.tsx +7 -6
  80. package/mobile/src/components/OfficeServicesBlock/OfficeServicesBlockContent.ts +2 -1
  81. package/mobile/src/components/Tabs/TabsContent.ts +8 -3
  82. package/mobile/src/components/Tabs/renderGroupTab.tsx +2 -1
  83. package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
  84. package/mobile/src/ui-kit/Button/ButtonInner.tsx +3 -2
  85. package/mobile/src/ui-kit/Button/ButtonSection.tsx +9 -4
  86. package/mobile/src/ui-kit/Select/Select.tsx +1 -1
  87. package/package.json +6 -1
  88. package/src/components/ErrorBlock/ErrorBlock.example.json +5 -5
  89. package/src/components/ErrorBlock/ErrorBlock.fixture.tsx +3 -3
  90. package/src/components/ErrorBlock/ErrorBlock.tsx +12 -5
  91. package/src/components/ErrorBlock/ErrorBlockContent.ts +20 -6
  92. package/src/components/OfficeServicesBlock/OfficeServicesBlock.example.json +30 -16
  93. package/src/components/OfficeServicesBlock/OfficeServicesBlock.fixture.tsx +7 -7
  94. package/src/components/OfficeServicesBlock/OfficeServicesBlock.tsx +7 -6
  95. package/src/components/OfficeServicesBlock/OfficeServicesBlockContent.ts +2 -1
  96. package/src/components/Tabs/TabsContent.ts +8 -3
  97. package/src/components/Tabs/renderGroupTab.tsx +2 -1
  98. package/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
  99. package/src/ui-kit/Button/ButtonInner.tsx +3 -2
  100. package/src/ui-kit/Button/ButtonSection.tsx +9 -4
  101. package/src/ui-kit/Select/Select.tsx +1 -1
  102. package/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
  103. package/dist/ui-kit/Tabs/Tabs.js +0 -17
  104. package/dist/ui-kit/Tabs/Tabs.js.map +0 -1
  105. package/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
  106. package/dist/ui-kit/Tabs/TabsProps.js +0 -2
  107. package/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
  108. package/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
  109. package/lib/ui-kit/Tabs/Tabs.js +0 -15
  110. package/lib/ui-kit/Tabs/Tabs.js.map +0 -1
  111. package/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
  112. package/lib/ui-kit/Tabs/TabsProps.js +0 -2
  113. package/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
  114. package/mobile/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
  115. package/mobile/dist/ui-kit/Tabs/Tabs.js +0 -17
  116. package/mobile/dist/ui-kit/Tabs/Tabs.js.map +0 -1
  117. package/mobile/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
  118. package/mobile/dist/ui-kit/Tabs/TabsProps.js +0 -2
  119. package/mobile/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
  120. package/mobile/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
  121. package/mobile/lib/ui-kit/Tabs/Tabs.js +0 -15
  122. package/mobile/lib/ui-kit/Tabs/Tabs.js.map +0 -1
  123. package/mobile/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
  124. package/mobile/lib/ui-kit/Tabs/TabsProps.js +0 -2
  125. package/mobile/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
  126. package/mobile/src/ui-kit/Tabs/Tabs.tsx +0 -52
  127. package/mobile/src/ui-kit/Tabs/TabsProps.ts +0 -20
  128. package/src/ui-kit/Tabs/Tabs.tsx +0 -52
  129. package/src/ui-kit/Tabs/TabsProps.ts +0 -20
@@ -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
  }
@@ -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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -55,6 +55,7 @@
55
55
  "./*.cjs": "./*.cjs"
56
56
  },
57
57
  "files": [
58
+ "bin",
58
59
  "lib",
59
60
  "mobile/lib",
60
61
  "dist",
@@ -93,6 +94,7 @@
93
94
  "lint": "eslint ./src",
94
95
  "pretest": "npm run prepare && npm run lint",
95
96
  "test": "jest --coverage",
97
+ "test:bin": "jest --config ./jest.config.bin.js",
96
98
  "cosmos": "cosmos",
97
99
  "cosmos:mobile": "cosmos --config cosmos.config.mobile.json",
98
100
  "precosmos:export": "npm run build:icons",
@@ -121,6 +123,7 @@
121
123
  "unified": "^10.1.2"
122
124
  },
123
125
  "devDependencies": {
126
+ "@babel/preset-env": "^7.19.4",
124
127
  "@rollup/plugin-node-resolve": "^13.3.0",
125
128
  "@rollup/plugin-typescript": "^8.3.3",
126
129
  "@size-limit/file": "^7.0.8",
@@ -132,9 +135,11 @@
132
135
  "@typescript-eslint/experimental-utils": "^5.30.6",
133
136
  "@typescript-eslint/parser": "^5.30.6",
134
137
  "autoprefixer": "^10.4.7",
138
+ "babel-jest": "^28.1.3",
135
139
  "copyfiles": "^2.4.1",
136
140
  "css-loader": "^6.7.1",
137
141
  "cssnano": "^5.1.11",
142
+ "cypress-mochawesome-reporter": "^3.2.3",
138
143
  "eslint": "^8.21.0",
139
144
  "eslint-plugin-import": "^2.26.0",
140
145
  "eslint-plugin-local-eslint-rules": "./eslint-rules",
@@ -1,13 +1,13 @@
1
1
  {
2
- "title": "Страница не найдена",
3
- "subtitle": "Возможно неправильно набран адрес или такой странице не существует",
2
+ "title": "Заголовок",
3
+ "subtitle": "Описание",
4
4
  "error": {
5
5
  "errorContentType": "Code",
6
- "code": 404
6
+ "code": "404"
7
7
  },
8
8
  "button": {
9
- "text": "Вернуться на главную",
9
+ "text": "Кнопка",
10
10
  "version": "primary",
11
- "target": "_blank"
11
+ "target": "_self"
12
12
  }
13
13
  }
@@ -30,7 +30,7 @@ export default {
30
30
  subtitle="Возможно неправильно набран адрес или такой странице не существует"
31
31
  error={{
32
32
  errorContentType: 'Code',
33
- code: 404,
33
+ code: '404',
34
34
  }}
35
35
  button={buttonPrimary}
36
36
  />
@@ -41,8 +41,8 @@ export default {
41
41
  <ErrorBlock
42
42
  className="col-span-12"
43
43
  context={context}
44
- title="Страница не найдена"
45
- subtitle="Возможно неправильно набран адрес или такой странице не существует"
44
+ title="Ваш браузер устарел"
45
+ subtitle="Чтобы открыть наш сайт обновите Ваш браузер или скачайте обновленные версии браузеров"
46
46
  error={{
47
47
  errorContentType: 'Image',
48
48
  image: image,
@@ -10,11 +10,11 @@ export interface ErrorBlockProps extends ErrorBlockContent, UniBlockProps {}
10
10
 
11
11
  const renderErrorContent = (error: ErrorBlockContent['error']) => {
12
12
  if (error?.errorContentType === 'Image' && error?.image) {
13
- return <Img className="mb-7" image={error.image} />;
13
+ return <Img image={error.image} />;
14
14
  }
15
15
 
16
16
  if (error?.errorContentType === 'Code' && error.code) {
17
- return <div className="text-title-extra gradient-color-text">{error.code}</div>;
17
+ return <div className="font-mohave text-title-extra gradient-color-text">{error.code}</div>;
18
18
  }
19
19
 
20
20
  return null;
@@ -26,10 +26,17 @@ export const ErrorBlock = JSX<ErrorBlockProps>(
26
26
  const router = useRouter();
27
27
 
28
28
  return (
29
- <section className={`flex flex-col justify-center items-center ${className}`} role="listitem">
30
- <div className="flex justify-center mb-7">{renderErrorContent(error)}</div>
29
+ <section
30
+ className={`flex flex-col justify-center items-center mt-12 ${className}`}
31
+ role="listitem"
32
+ >
33
+ <div className="flex justify-center py-20">{renderErrorContent(error)}</div>
31
34
  {title ? <Heading headingType="h1" className="text-left mb-4" title={title} /> : null}
32
- {subtitle ? <div className="text-xl-light text-left mb-7">{subtitle}</div> : null}
35
+ {subtitle ? (
36
+ <div className="font-sans text-xl-light text-left mb-7 max-w-[613px] text-center">
37
+ {subtitle}
38
+ </div>
39
+ ) : null}
33
40
  {button?.text ? (
34
41
  <Button
35
42
  className="py-4 px-9"
@@ -1,4 +1,3 @@
1
- import type { EmptyOption } from '../../model/EmptyOptionType';
2
1
  import type { Picture } from '../../model/Picture';
3
2
  import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
4
3
 
@@ -8,7 +7,6 @@ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
8
7
  export type ErrorImageDef = {
9
8
  /** @default Image */
10
9
  errorContentType: 'Image';
11
- /** @title Изображение */
12
10
  image?: Picture;
13
11
  };
14
12
 
@@ -18,10 +16,27 @@ export type ErrorImageDef = {
18
16
  export type ErrorCodeDef = {
19
17
  /** @default Code */
20
18
  errorContentType: 'Code';
21
- /** @title Код ошибки */
22
- code?: number;
19
+ /** @default 404 */
20
+ code?: ErrorType;
23
21
  };
24
- export type ErrorContentDef = EmptyOption | ErrorImageDef | ErrorCodeDef;
22
+
23
+ /** @title Вид контента */
24
+ export type ErrorContentDef = ErrorCodeDef | ErrorImageDef;
25
+
26
+ /** @title Код */
27
+ export type ErrorType =
28
+ | ''
29
+ | '400'
30
+ | '401'
31
+ | '402'
32
+ | '403'
33
+ | '404'
34
+ | '500'
35
+ | '501'
36
+ | '502'
37
+ | '503'
38
+ | '504'
39
+ | '505';
25
40
 
26
41
  /**
27
42
  * @title Блок ошибки
@@ -31,7 +46,6 @@ export interface ErrorBlockContent {
31
46
  title?: string;
32
47
  /** @title Описание */
33
48
  subtitle?: string;
34
- /** @title Вид контента */
35
49
  error?: ErrorContentDef;
36
50
  /** @title Кнопка */
37
51
  button?: ButtonProps;
@@ -1,33 +1,47 @@
1
1
  {
2
- "title": "Услуги",
3
- "officesList": [
2
+ "title": "Заголовок",
3
+ "servicesList": [
4
4
  {
5
- "text": "Обслуживание физических лиц",
6
- "icon": { "icon": "CardTickIcon" }
5
+ "label": "Пункт 1",
6
+ "icon": {
7
+ "icon": "CardTickIcon"
8
+ }
7
9
  },
8
10
  {
9
- "text": "Обслуживание юридических лиц",
10
- "icon": { "icon": "EmptyWalletChangeIcon" }
11
+ "label": "Пункт 2",
12
+ "icon": {
13
+ "icon": "EmptyWalletChangeIcon"
14
+ }
11
15
  },
12
16
  {
13
- "text": "Продажа монет из драгоценных металлов",
14
- "icon": { "icon": "UserTickIcon" }
17
+ "label": "Пункт 3",
18
+ "icon": {
19
+ "icon": "UserTickIcon"
20
+ }
15
21
  },
16
22
  {
17
- "text": "Аренда индивидуальных сейфовых ячеек",
18
- "icon": { "icon": "UserTickIcon" }
23
+ "label": "Пункт 4",
24
+ "icon": {
25
+ "icon": "UserTickIcon"
26
+ }
19
27
  },
20
28
  {
21
- "text": "Операции с обезличенными металлическими счетами",
22
- "icon": { "icon": "ShieldTickIcon" }
29
+ "label": "Пункт 5",
30
+ "icon": {
31
+ "icon": "ShieldTickIcon"
32
+ }
23
33
  },
24
34
  {
25
- "text": "Операции со слитками драгоценных металлов",
26
- "icon": { "icon": "ShieldTickIcon" }
35
+ "label": "Пункт 6",
36
+ "icon": {
37
+ "icon": "ShieldTickIcon"
38
+ }
27
39
  },
28
40
  {
29
- "text": "Передача фото и голоса в Единую биометрическую систему",
30
- "icon": { "icon": "ShieldTickIcon" }
41
+ "label": "Пункт 7",
42
+ "icon": {
43
+ "icon": "ShieldTickIcon"
44
+ }
31
45
  }
32
46
  ]
33
47
  }
@@ -10,31 +10,31 @@ export default {
10
10
  title="Услуги"
11
11
  servicesList={[
12
12
  {
13
- text: 'Обслуживание физических лиц',
13
+ label: 'Обслуживание физических лиц',
14
14
  icon: { icon: 'CardTickIcon' },
15
15
  },
16
16
  {
17
- text: 'Обслуживание юридических лиц',
17
+ label: 'Обслуживание юридических лиц',
18
18
  icon: { icon: 'EmptyWalletChangeIcon' },
19
19
  },
20
20
  {
21
- text: 'Продажа монет из драгоценных металлов',
21
+ label: 'Продажа монет из драгоценных металлов',
22
22
  icon: { icon: 'UserTickIcon' },
23
23
  },
24
24
  {
25
- text: 'Аренда индивидуальных сейфовых ячеек',
25
+ label: 'Аренда индивидуальных сейфовых ячеек',
26
26
  icon: { icon: 'UserTickIcon' },
27
27
  },
28
28
  {
29
- text: 'Операции с обезличенными металлическими счетами',
29
+ label: 'Операции с обезличенными металлическими счетами',
30
30
  icon: { icon: 'ShieldTickIcon' },
31
31
  },
32
32
  {
33
- text: 'Операции со слитками драгоценных металлов',
33
+ label: 'Операции со слитками драгоценных металлов',
34
34
  icon: { icon: 'ShieldTickIcon' },
35
35
  },
36
36
  {
37
- text: 'Передача фото и голоса в Единую биометрическую систему',
37
+ label: 'Передача фото и голоса в Единую биометрическую систему',
38
38
  icon: { icon: 'ShieldTickIcon' },
39
39
  },
40
40
  ]}
@@ -11,14 +11,15 @@ import type {
11
11
  export interface OfficeServicesBlockProps extends OfficeServicesBlockContent, UniBlockProps {}
12
12
 
13
13
  export const OfficeServicesBlock = JSX<OfficeServicesBlockProps>(
14
- ({ className = '', context, title, servicesList, anchor = '' }) => {
14
+ ({ className = '', context, title, servicesList, anchor = '', ...rest }) => {
15
15
  return (
16
16
  <BlockWrapper
17
17
  context={context}
18
18
  id={anchor}
19
- className={`font-sans bg-white p-12 flex flex-col ${className}`}
19
+ className={`font-sans bg-white p-8 flex flex-col ${className}`}
20
+ {...rest}
20
21
  >
21
- {title ? <Heading headingType="h5" className="mb-2.5" title={title} /> : null}
22
+ {title ? <Heading headingType="h5" className="mb-5" title={title} /> : null}
22
23
  {servicesList?.length ? servicesList.map(renderListItems) : null}
23
24
  </BlockWrapper>
24
25
  );
@@ -26,16 +27,16 @@ export const OfficeServicesBlock = JSX<OfficeServicesBlockProps>(
26
27
  );
27
28
 
28
29
  const renderListItems = (itemList: OfficeServicesBlockList, i) => (
29
- <li key={`list_item_${String(i)}`} className="flex mb-2.5 list-none">
30
+ <li key={`list_item_${String(i)}`} className="flex mb-5 last:mb-0 list-none">
30
31
  {itemList.icon ? (
31
32
  <Img
32
- className="mr-[14px] max-w-6 max-h-6"
33
+ className="mr-3 max-w-6 max-h-6"
33
34
  width="24px"
34
35
  height="24px"
35
36
  asSVG
36
37
  image={itemList.icon}
37
38
  />
38
39
  ) : null}
39
- {itemList.text ? <span className="text-l-light">{itemList.text}</span> : null}
40
+ {itemList.label ? <span className="text-l-light">{itemList.label}</span> : null}
40
41
  </li>
41
42
  );
@@ -12,7 +12,8 @@ export interface OfficeServicesBlockList {
12
12
  * }
13
13
  */
14
14
  icon?: Picture;
15
- text?: string;
15
+ /** @title Текст */
16
+ label?: string;
16
17
  }
17
18
 
18
19
  /**
@@ -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
 
@@ -147,11 +147,11 @@ exports[`Blocks ComparisonTable should render block "ComparisonTable" without co
147
147
 
148
148
  exports[`Blocks ErrorBlock should render block "ErrorBlock" without content 1`] = `
149
149
  <section
150
- class="flex flex-col justify-center items-center "
150
+ class="flex flex-col justify-center items-center mt-12 "
151
151
  role="listitem"
152
152
  >
153
153
  <div
154
- class="flex justify-center mb-7"
154
+ class="flex justify-center py-20"
155
155
  />
156
156
  </section>
157
157
  `;
@@ -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
@@ -683,7 +683,7 @@ exports[`Blocks Navigation should render block "Navigation" without content 1`]
683
683
 
684
684
  exports[`Blocks OfficeServicesBlock should render block "OfficeServicesBlock" without content 1`] = `
685
685
  <section
686
- class="font-sans bg-white p-12 flex flex-col "
686
+ class="font-sans bg-white p-8 flex flex-col "
687
687
  />
688
688
  `;
689
689
 
@@ -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
  >
@@ -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
@@ -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
  }
@@ -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","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,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,iCAEE,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,4CACG,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,+BAAI,SAAS,EAAC,wBAAwB,YAAE,GAAG,EAAE,KAAK,GAAM,CAAC,CAAC,CAAC,IAAI,EAC5E,GAAG,EAAE,WAAW,CAAC,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,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
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,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