@redneckz/wildless-cms-uni-blocks 0.2.106 → 0.2.109

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 (70) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +25 -14
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/BaseTile/BaseTile.js +2 -2
  5. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  6. package/dist/components/CreditCalculator/CreditCalculator.js +1 -1
  7. package/dist/components/StepsBlock/StepsBlock.mobile.d.ts +5 -0
  8. package/dist/components/StepsBlock/StepsBlock.mobile.js +19 -0
  9. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -0
  10. package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -0
  11. package/dist/components/TariffsTable/TariffsTableCell.js +1 -1
  12. package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -1
  13. package/dist/components/Tile/Tile.js +2 -2
  14. package/dist/components/Tile/Tile.js.map +1 -1
  15. package/dist/model/SizeVersion.d.ts +8 -0
  16. package/dist/model/SizeVersion.js +2 -0
  17. package/dist/model/SizeVersion.js.map +1 -0
  18. package/dist/ui-kit/BlockItem/BlockItem.js +16 -8
  19. package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
  20. package/dist/ui-kit/BlockItem/BlockItemProps.d.ts +1 -0
  21. package/dist/ui-kit/Button/Button.js +1 -1
  22. package/dist/ui-kit/Icon/IconProps.d.ts +2 -2
  23. package/dist/ui-kit/Icon/IconProps.js +2 -2
  24. package/dist/ui-kit/Icon/IconProps.js.map +1 -1
  25. package/dist/ui-kit/Title/TitleProps.d.ts +4 -1
  26. package/dist/ui-kit/Title/TitleProps.js +3 -0
  27. package/dist/ui-kit/Title/TitleProps.js.map +1 -1
  28. package/lib/common.css +1 -1
  29. package/lib/components/BaseTile/BaseTile.js +2 -2
  30. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  31. package/lib/components/CreditCalculator/CreditCalculator.js +1 -1
  32. package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +8 -1
  33. package/lib/components/StepsBlock/StepsBlock.mobile.d.ts +5 -0
  34. package/lib/components/StepsBlock/StepsBlock.mobile.js +17 -0
  35. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -0
  36. package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -0
  37. package/lib/components/TariffsTable/TariffsTableCell.js +1 -1
  38. package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -1
  39. package/lib/components/Tile/Tile.js +2 -2
  40. package/lib/components/Tile/Tile.js.map +1 -1
  41. package/lib/model/SizeVersion.d.ts +8 -0
  42. package/lib/model/SizeVersion.js +2 -0
  43. package/lib/model/SizeVersion.js.map +1 -0
  44. package/lib/ui-kit/BlockItem/BlockItem.js +16 -8
  45. package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
  46. package/lib/ui-kit/BlockItem/BlockItemProps.d.ts +1 -0
  47. package/lib/ui-kit/Button/Button.js +1 -1
  48. package/lib/ui-kit/Icon/IconProps.d.ts +2 -2
  49. package/lib/ui-kit/Icon/IconProps.js +2 -2
  50. package/lib/ui-kit/Icon/IconProps.js.map +1 -1
  51. package/lib/ui-kit/Title/TitleProps.d.ts +4 -1
  52. package/lib/ui-kit/Title/TitleProps.js +3 -0
  53. package/lib/ui-kit/Title/TitleProps.js.map +1 -1
  54. package/package.json +3 -3
  55. package/src/components/BaseTile/BaseTile.tsx +10 -5
  56. package/src/components/ContentPage/ContentPage.page.json +2 -2
  57. package/src/components/CreditCalculator/CreditCalculator.tsx +1 -1
  58. package/src/components/StepsBlock/StepsBlock.fixture.tsx +89 -8
  59. package/src/components/StepsBlock/StepsBlock.mobile.tsx +71 -0
  60. package/src/components/StepsBlock/StepsBlockContent.ts +4 -0
  61. package/src/components/TariffsTable/TariffsTable.example.json +8 -12
  62. package/src/components/TariffsTable/TariffsTable.fixture.tsx +4 -4
  63. package/src/components/TariffsTable/TariffsTableCell.tsx +2 -3
  64. package/src/components/Tile/Tile.tsx +2 -2
  65. package/src/model/SizeVersion.ts +8 -0
  66. package/src/ui-kit/BlockItem/BlockItem.tsx +23 -12
  67. package/src/ui-kit/BlockItem/BlockItemProps.ts +1 -0
  68. package/src/ui-kit/Button/Button.tsx +1 -1
  69. package/src/ui-kit/Icon/IconProps.ts +2 -2
  70. package/src/ui-kit/Title/TitleProps.ts +3 -0
@@ -1,26 +1,107 @@
1
1
  import { context } from '../../setup-fixture';
2
2
  import { StepsBlock } from './StepsBlock';
3
+ import { StepsBlock as StepsBlockMobile } from './StepsBlock.mobile';
3
4
 
4
- export default (
5
- <div className="container grid grid-cols-12">
6
- <StepsBlock
7
- className="col-span-12"
5
+ const steps = [
6
+ {
7
+ label: 'Заявка на кредит',
8
+ description: 'Оставьте онлайн-заявку на потребительский кредит',
9
+ },
10
+ {
11
+ label: 'В случае одобрения',
12
+ description: 'Менеджер свяжется с вами и согласует встречу',
13
+ },
14
+ {
15
+ label: 'Получение наличных',
16
+ description: 'Получите наличные в отделении банка',
17
+ },
18
+ ];
19
+
20
+ export default {
21
+ default: (
22
+ <div className="container grid grid-cols-12">
23
+ <StepsBlock
24
+ className="col-span-12"
25
+ context={context}
26
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
27
+ steps={steps}
28
+ />
29
+ </div>
30
+ ),
31
+ mobile: (
32
+ <StepsBlockMobile
33
+ context={context}
34
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
35
+ description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
36
+ size="normal"
37
+ steps={steps}
38
+ />
39
+ ),
40
+ 'mobile only desc': (
41
+ <StepsBlockMobile
42
+ context={context}
43
+ description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
44
+ size="normal"
45
+ steps={steps}
46
+ />
47
+ ),
48
+
49
+ 'mobile small': (
50
+ <StepsBlockMobile
8
51
  context={context}
9
52
  title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
53
+ size="small"
54
+ steps={steps}
55
+ />
56
+ ),
57
+
58
+ 'mobile small multi-options': (
59
+ <StepsBlockMobile
60
+ context={context}
61
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
62
+ description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
63
+ size="small"
10
64
  steps={[
65
+ {
66
+ description: 'Оставьте онлайн-заявку на потребительский кредит',
67
+ icon: 'ClockIcon',
68
+ },
69
+ {
70
+ label: 'В случае одобрения',
71
+ icon: 'SignDocsIcon',
72
+ },
11
73
  {
12
74
  label: 'Заявка на кредит',
13
75
  description: 'Оставьте онлайн-заявку на потребительский кредит',
76
+ icon: 'ComfortableCompIcon',
77
+ },
78
+ {
79
+ label: 'Получение наличных',
80
+ icon: 'ClockIcon',
81
+ },
82
+ ]}
83
+ />
84
+ ),
85
+
86
+ 'mobile small icons': (
87
+ <StepsBlockMobile
88
+ context={context}
89
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
90
+ size="small"
91
+ steps={[
92
+ {
93
+ label: 'Заявка на кредит',
94
+ icon: 'EmptyWalletIcon',
14
95
  },
15
96
  {
16
97
  label: 'В случае одобрения',
17
- description: 'Менеджер свяжется с вами и согласует встречу',
98
+ icon: 'PercentageSquareIcon',
18
99
  },
19
100
  {
20
101
  label: 'Получение наличных',
21
- description: 'Получите наличные в отделении банка',
102
+ icon: 'CalendarIcon',
22
103
  },
23
104
  ]}
24
105
  />
25
- </div>
26
- );
106
+ ),
107
+ };
@@ -0,0 +1,71 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../types';
3
+ import { Icon } from '../../ui-kit/Icon/Icon';
4
+ import { Title } from '../../ui-kit/Title/Title';
5
+ import type { Step, StepsBlockContent } from './StepsBlockContent';
6
+
7
+ export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
8
+
9
+ export const StepsBlock = JSX<StepsBlockProps>(
10
+ ({ className, title, description, showLines = true, steps, size = 'normal' }) => {
11
+ return (
12
+ <section
13
+ className={`box-border font-sans text-primary-text bg-white px-20 py-[50px] flex flex-col ${
14
+ className || ''
15
+ }`}
16
+ >
17
+ {title && (
18
+ <Title size="3XS" className="font-medium m-0 text-center">
19
+ {title}
20
+ </Title>
21
+ )}
22
+ {description && <p className={`text-md text-center ${title && 'mt-2'}`}>{description}</p>}
23
+ {steps?.length ? (
24
+ <div className={`box-border py-0.5 mb-0.5 mt-5`}>
25
+ <div className="flex flex-col justify-between gap-x-[101px]">
26
+ {steps.map((step, i, array) => renderStepTitle({ step, size }, i, array))}
27
+ </div>
28
+ </div>
29
+ ) : null}
30
+ </section>
31
+ );
32
+ },
33
+ );
34
+
35
+ const renderStepTitle = ({ step: step, size: size }, i: number, array: Step[]) => {
36
+ const isLastStep = array.length - 1 === i;
37
+ const iconAreaSize =
38
+ size === 'normal'
39
+ ? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
40
+ : 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
41
+ const iconSize = size === 'normal' ? '38' : '27';
42
+ const margin = size === 'normal' ? 'ml-[34px]' : 'ml-[24px]';
43
+ return (
44
+ <div>
45
+ <div key={String(i)} className="flex flex-row text-center relative">
46
+ <div
47
+ className={`${iconAreaSize} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`}
48
+ >
49
+ <span className="font-medium text-title-xs text-secondary-text self-center">
50
+ {(step.icon && <Icon name={step.icon} width={iconSize} height={iconSize} />) || i + 1}
51
+ </span>
52
+ </div>
53
+ <div className="flex flex-col justify-center relative">
54
+ {step.label && (
55
+ <div className="font-medium text-mobile-md m-0 text-left">{step.label}</div>
56
+ )}
57
+ {step.description && (
58
+ <div
59
+ className={`font-normal text-sm text-secondary-text text-left ${
60
+ step.label ? 'mt-1' : ''
61
+ }`}
62
+ >
63
+ {step.description}
64
+ </div>
65
+ )}
66
+ </div>
67
+ </div>
68
+ {!isLastStep && <div className={`h-8 w-[2px] bg-secondary-light ${margin}`} />}
69
+ </div>
70
+ );
71
+ };
@@ -1,5 +1,7 @@
1
1
  import type { IconName } from '../../ui-kit/Icon/IconProps';
2
2
 
3
+ import type { SizeVersion } from '../../model/SizeVersion';
4
+
3
5
  /**
4
6
  * @title Шаг
5
7
  */
@@ -17,6 +19,7 @@ export interface Step {
17
19
  export interface StepsBlockContent {
18
20
  /** @title Заголовок */
19
21
  title?: string;
22
+ description?: string; // TODO: mobile content
20
23
  /** @title Линии */
21
24
  showLines?: boolean;
22
25
  /**
@@ -25,4 +28,5 @@ export interface StepsBlockContent {
25
28
  * @maxItems 3
26
29
  */
27
30
  steps?: Step[];
31
+ size?: SizeVersion; // TODO: mobile content
28
32
  }
@@ -46,14 +46,17 @@
46
46
  "icon": "AppleIcon",
47
47
  "rounded": true,
48
48
  "version": "secondary",
49
- "href": "/_blank",
50
- "target": "_blank"
49
+ "href": "/",
50
+ "target": "_blank",
51
+ "text": ""
51
52
  },
52
53
  {
53
54
  "icon": "PlayMarketIcon",
54
55
  "rounded": true,
55
56
  "version": "secondary",
56
- "href": "/secondary"
57
+ "href": "/",
58
+ "target": "_blank",
59
+ "text": ""
57
60
  }
58
61
  ]
59
62
  }
@@ -61,23 +64,16 @@
61
64
  [
62
65
  {
63
66
  "image": {
64
- "src": "payment-systems.png",
65
67
  "format": "webp",
66
68
  "size": {
67
69
  "width": 288,
68
70
  "height": 56
69
- },
70
- "alt": "Описание картинки",
71
- "title": "Подсказка"
71
+ }
72
72
  }
73
73
  },
74
74
  {
75
75
  "list": {
76
- "items": [
77
- "item 1",
78
- "item 2",
79
- "item 3"
80
- ]
76
+ "items": ["item 1", "item 2", "item 3"]
81
77
  }
82
78
  }
83
79
  ]
@@ -1,6 +1,6 @@
1
+ import type { Picture } from '../../model/Picture';
1
2
  import { context } from '../../setup-fixture';
2
3
  import { TariffsTable } from './TariffsTable';
3
- import type { Picture } from '../../model/Picture';
4
4
  import type { TariffsTableColumn, TariffsTableRowHeader } from './TariffsTableContent';
5
5
 
6
6
  const image: Picture = {
@@ -48,14 +48,15 @@ const columns: TariffsTableColumn[] = [
48
48
  icon: 'AppleIcon',
49
49
  rounded: true,
50
50
  version: 'secondary',
51
- href: '/_blank',
51
+ href: '/',
52
52
  target: '_blank',
53
53
  },
54
54
  {
55
55
  icon: 'PlayMarketIcon',
56
56
  rounded: true,
57
57
  version: 'secondary',
58
- href: '/secondary',
58
+ href: '/',
59
+ target: '_blank',
59
60
  },
60
61
  ],
61
62
  },
@@ -105,7 +106,6 @@ const columns: TariffsTableColumn[] = [
105
106
  { label: '69 рублей в месяц' },
106
107
  {
107
108
  list: {
108
- version: 'primary',
109
109
  items: ['item 1', 'item 2', 'item 3'],
110
110
  },
111
111
  },
@@ -1,10 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { DIVIDER_CLASSES } from './constants';
3
2
  import { BlockItem } from '../../ui-kit/BlockItem/BlockItem';
4
- import { Img } from '../../ui-kit/Img';
5
3
  import { Button } from '../../ui-kit/Button/Button';
6
- import type { TariffsTableCellData } from './TariffsTableContent';
7
4
  import { Icon } from '../../ui-kit/Icon/Icon';
5
+ import { Img } from '../../ui-kit/Img';
6
+ import type { TariffsTableCellData } from './TariffsTableContent';
8
7
 
9
8
  export interface TariffsTableCellProps {
10
9
  cell: TariffsTableCellData[];
@@ -15,11 +15,11 @@ const tileStyleMap: Record<BlockVersion, string> = {
15
15
  };
16
16
 
17
17
  export const Tile = JSX<TileProps>((props) => {
18
- const { children, className, version = 'primary', role } = props;
18
+ const { children, className = '', version = 'primary', role } = props;
19
19
 
20
20
  return (
21
21
  <section
22
- className={`font-sans p-9 box-border ${className || ''} ${
22
+ className={`font-sans p-9 box-border ${className} ${
23
23
  tileStyleMap[version]
24
24
  } ${getContainerPaddingRight(className)} ${getContainerMinHeight(className)} `}
25
25
  role={role}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @title Размер
3
+ * @enumNames [
4
+ * "Обычный",
5
+ * "Уменьшенный"
6
+ * ]
7
+ */
8
+ export type SizeVersion = 'normal' | 'small';
@@ -1,25 +1,36 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import type { BlockVersion } from '../../model/BlockVersion';
2
3
  import { BlockItemProps, BlockItemVersion } from './BlockItemProps';
3
4
 
4
- const listStyleMap: Record<BlockItemVersion, string> = {
5
- primary: 'bg-secondary-text w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full',
6
- secondary: 'bg-white w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full',
5
+ const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3';
6
+
7
+ const TEXT_STYLE_MAP: Record<BlockItemVersion, string> = {
8
+ primary: 'text-primary-text',
9
+ secondary: 'text-secondary-text',
7
10
  };
8
11
 
9
- const textStyleMap: Record<BlockItemVersion, string> = {
10
- primary: 'text-secondary-text',
11
- secondary: '',
12
+ const LIST_STYLE_MAP: Record<BlockItemVersion, string> = {
13
+ primary: 'bg-primary-main',
14
+ secondary: 'bg-secondary-text',
12
15
  };
13
16
 
14
17
  export const BlockItem = JSX<BlockItemProps>(
15
- ({ className, isDotted = true, text, children, version = 'primary' }) => {
18
+ ({ className = '', isDotted = true, text, children, version = 'primary', white }) => {
16
19
  return (
17
- <div className={`inline-block flex ${className || ''}`} role="listitem">
18
- {isDotted && <div className={`inline-block mr-3 ${listStyleMap[version]}`} />}
19
- <span className={`text-base font-normal font-sans mr-3 ${textStyleMap[version]}`}>
20
- {text || children}
21
- </span>
20
+ <div className={`font-sans inline-block flex ${className}`} role="listitem">
21
+ {isDotted && <div className={getListStyle(version, white)} />}
22
+ <span className={white ? 'text-white' : TEXT_STYLE_MAP[version]}>{text || children}</span>
22
23
  </div>
23
24
  );
24
25
  },
25
26
  );
27
+
28
+ const getListStyle = (version: BlockVersion, white?: boolean) => {
29
+ const color = white ? 'bg-white' : LIST_STYLE_MAP[version];
30
+ const size =
31
+ version === 'primary'
32
+ ? 'w-[8px] h-[8px] min-w-[8px] min-h-[8px] mt-2'
33
+ : 'w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5';
34
+
35
+ return `${LIST_STYLE_CLASSES} ${color} ${size}`;
36
+ };
@@ -17,6 +17,7 @@ export interface BlockItemContent {
17
17
  export interface BlockItemProps extends BlockItemContent {
18
18
  className?: string;
19
19
  version?: BlockItemVersion;
20
+ white?: boolean;
20
21
  /** @title Маркер */
21
22
  isDotted?: boolean;
22
23
  }
@@ -85,7 +85,7 @@ export const ButtonInner = JSX<ButtonInner>(({ text, aboveText, appendLeft, roun
85
85
  {appendLeft ? appendLeft : null}
86
86
  {!withoutText ? (
87
87
  <div>
88
- <div className="text-xxs text-left">{aboveText}</div>
88
+ <div className="text-2xs text-left">{aboveText}</div>
89
89
  <div className="text-sm font-medium text-left">{text}</div>
90
90
  </div>
91
91
  ) : null}
@@ -61,8 +61,8 @@ export enum IconMap {
61
61
  'UserTickIcon',
62
62
  'VisaIcon',
63
63
  'VKIcon',
64
- 'WalletAdd',
65
- 'WalletAdd2',
64
+ 'WalletAddIcon',
65
+ 'WalletAdd2Icon',
66
66
  'WalletIcon',
67
67
  'WalletWithMoneyIcon',
68
68
  }
@@ -3,6 +3,9 @@ export enum SizeTableClass {
3
3
  'L' = 'text-title',
4
4
  'M' = 'text-title-sm',
5
5
  'S' = 'text-title-xs',
6
+ 'XS' = 'text-title-xs',
7
+ '2XS' = 'text-title-2xs',
8
+ '3XS' = 'text-title-3xs',
6
9
  }
7
10
 
8
11
  export type TitleSize = keyof typeof SizeTableClass;