@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.
- package/bin/migrate.js +2 -0
- package/bin/migrateContentUnit.js +26 -0
- package/bin/migration-scripts/0.4.0.js +3 -0
- package/bin/migration-scripts/0.4.1.js +3 -0
- package/bin/migration-scripts/0.4.5.js +109 -0
- package/bin/migration-scripts/0.4.5.spec.ts +352 -0
- package/bin/migration-scripts/index.js +21 -0
- package/bin/utils.js +24 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +27 -25
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/CardTransfer/CardTransfer.js +7 -7
- package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/dist/components/PictureText/PictureText.js +1 -1
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +2 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/dist/components/Tabs/TabsContent.d.ts +8 -3
- package/dist/components/Tabs/renderGroupTab.js +1 -1
- package/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/dist/model/ButtonVersion.d.ts +2 -2
- package/dist/ui-kit/Button/Button.js +4 -1
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Button/Button.mobile.js +2 -0
- package/dist/ui-kit/Button/Button.mobile.js.map +1 -1
- package/dist/ui-kit/Button/ButtonInner.js +3 -2
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Button/ButtonSection.js +3 -2
- package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/dist/ui-kit/{Tabs/TabsProps.js → CurrencyInput/CurrencyInputProps.js} +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/dist/ui-kit/Select/Select.js +1 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/CardTransfer/CardTransfer.js +7 -7
- package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/lib/components/PictureText/PictureText.js +1 -1
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js +2 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/lib/components/Tabs/TabsContent.d.ts +8 -3
- package/lib/components/Tabs/renderGroupTab.js +1 -1
- package/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/lib/model/ButtonVersion.d.ts +2 -2
- package/lib/ui-kit/Button/Button.js +4 -1
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Button/Button.mobile.js +2 -0
- package/lib/ui-kit/Button/Button.mobile.js.map +1 -1
- package/lib/ui-kit/Button/ButtonInner.js +3 -2
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Button/ButtonSection.js +3 -2
- package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
- package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/lib/ui-kit/Select/Select.js +1 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +9 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/CardTransfer/CardTransfer.js +7 -7
- package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/mobile/dist/components/PictureText/PictureText.js +1 -1
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +2 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/mobile/dist/components/Tabs/TabsContent.d.ts +8 -3
- package/mobile/dist/components/Tabs/renderGroupTab.js +1 -1
- package/mobile/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/dist/model/ButtonVersion.d.ts +2 -2
- package/mobile/dist/ui-kit/Button/Button.js +2 -0
- package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js +3 -2
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonSection.js +3 -2
- package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/mobile/dist/ui-kit/{Tabs/TabsProps.js → CurrencyInput/CurrencyInputProps.js} +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.js +1 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/components/CardTransfer/CardTransfer.js +7 -7
- package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/mobile/lib/components/PictureText/PictureText.js +1 -1
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +2 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/mobile/lib/components/Tabs/TabsContent.d.ts +8 -3
- package/mobile/lib/components/Tabs/renderGroupTab.js +1 -1
- package/mobile/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/lib/model/ButtonVersion.d.ts +2 -2
- package/mobile/lib/ui-kit/Button/Button.js +2 -0
- package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js +3 -2
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonSection.js +3 -2
- package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.js +1 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/src/components/CardTransfer/CardTransfer.example.json +6 -0
- package/mobile/src/components/CardTransfer/CardTransfer.tsx +46 -37
- package/mobile/src/components/CardTransfer/CardTransferContent.ts +7 -4
- package/mobile/src/components/ContentPage/ContentPage.page.json +7 -1
- package/mobile/src/components/PictureText/PictureText.tsx +1 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +4 -2
- package/mobile/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
- package/mobile/src/components/Tabs/TabsContent.ts +8 -3
- package/mobile/src/components/Tabs/renderGroupTab.tsx +2 -1
- package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
- package/mobile/src/model/ButtonVersion.ts +2 -2
- package/mobile/src/ui-kit/Button/Button.tsx +2 -0
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +3 -2
- package/mobile/src/ui-kit/Button/ButtonSection.tsx +9 -4
- package/mobile/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
- package/mobile/src/ui-kit/Select/Select.tsx +1 -1
- package/package.json +5 -1
- package/src/components/CardTransfer/CardTransfer.example.json +6 -0
- package/src/components/CardTransfer/CardTransfer.tsx +46 -37
- package/src/components/CardTransfer/CardTransferContent.ts +7 -4
- package/src/components/ContentPage/ContentPage.page.json +7 -1
- package/src/components/PictureText/PictureText.tsx +1 -1
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +1 -1
- package/src/components/ProductTile/ProductTile.tsx +4 -2
- package/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +2 -0
- package/src/components/Tabs/TabsContent.ts +8 -3
- package/src/components/Tabs/renderGroupTab.tsx +2 -1
- package/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
- package/src/model/ButtonVersion.ts +2 -2
- package/src/ui-kit/Button/Button.mobile.tsx +2 -0
- package/src/ui-kit/Button/Button.tsx +5 -3
- package/src/ui-kit/Button/ButtonInner.tsx +3 -2
- package/src/ui-kit/Button/ButtonSection.tsx +9 -4
- package/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
- package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
- package/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
- package/src/ui-kit/Select/Select.tsx +1 -1
- package/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/dist/ui-kit/Tabs/Tabs.js +0 -17
- package/dist/ui-kit/Tabs/Tabs.js.map +0 -1
- package/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/lib/ui-kit/Tabs/Tabs.js +0 -15
- package/lib/ui-kit/Tabs/Tabs.js.map +0 -1
- package/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/lib/ui-kit/Tabs/TabsProps.js +0 -2
- package/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/mobile/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/mobile/dist/ui-kit/Tabs/Tabs.js +0 -17
- package/mobile/dist/ui-kit/Tabs/Tabs.js.map +0 -1
- package/mobile/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/mobile/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/mobile/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/mobile/lib/ui-kit/Tabs/Tabs.js +0 -15
- package/mobile/lib/ui-kit/Tabs/Tabs.js.map +0 -1
- package/mobile/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/mobile/lib/ui-kit/Tabs/TabsProps.js +0 -2
- package/mobile/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/mobile/src/ui-kit/Tabs/Tabs.tsx +0 -52
- package/mobile/src/ui-kit/Tabs/TabsProps.ts +0 -20
- package/src/ui-kit/Tabs/Tabs.tsx +0 -52
- 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
|
|
31
|
+
className={`relative font-sans py-12 px-28 ${VersionStyleMap[version]} ${className}`}
|
|
32
32
|
context={context}
|
|
33
33
|
{...rest}
|
|
34
34
|
>
|
|
@@ -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]}`}>
|
|
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('
|
|
6
|
+
const [selectedOption, setSelectedOption] = useState('option2');
|
|
7
7
|
|
|
8
8
|
const onChange = (_: React.ChangeEvent<HTMLInputElement>) => setSelectedOption(_.target.value);
|
|
9
9
|
|
|
@@ -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
|
-
*
|
|
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 =
|
|
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
|
|
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} {...
|
|
23
|
+
<DisabledButton rounded={rounded} {...usedProps}>
|
|
22
24
|
{buttonInner}
|
|
23
25
|
</DisabledButton>
|
|
24
26
|
) : (
|
|
25
|
-
<RegularButton rounded={rounded} {...
|
|
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(
|
|
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=
|
|
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"
|
|
41
|
+
<span className="text-xl-light absolute right-4">₽</span>
|
|
66
42
|
</div>
|
|
67
43
|
</div>
|
|
68
44
|
);
|
|
@@ -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/dist/ui-kit/Tabs/Tabs.js
DELETED
|
@@ -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,MAA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C1E,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":""}
|
package/lib/ui-kit/Tabs/Tabs.js
DELETED
|
@@ -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,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AAG,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabsProps.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/TabsProps.ts"],"names":[],"mappings":""}
|
|
@@ -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,EAA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B,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,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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AAE,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":""}
|