@redneckz/wildless-cms-uni-blocks 0.5.2 → 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 +8 -6
- package/bundle/bundle.umd.min.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/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/Select/Select.js +1 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/lib/common.css +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/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/Select/Select.js +1 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +7 -5
- package/mobile/bundle/bundle.umd.min.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/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/Select/Select.js +1 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +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/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/Select/Select.js +1 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +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 +6 -6
- 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/Select/Select.tsx +1 -1
- package/package.json +5 -1
- package/src/components/Tabs/TabsContent.ts +8 -3
- package/src/components/Tabs/renderGroupTab.tsx +2 -1
- package/src/components/__snapshots__/Blocks.spec.tsx.snap +6 -6
- package/src/ui-kit/Button/ButtonInner.tsx +3 -2
- package/src/ui-kit/Button/ButtonSection.tsx +9 -4
- 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 +0 -2
- 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 +0 -2
- 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
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Picture } from '../../model/Picture';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @title Вкладка
|
|
5
|
-
*/
|
|
6
|
-
export interface Tab {
|
|
7
|
-
/** @title Имя вкладки */
|
|
8
|
-
title?: string;
|
|
9
|
-
/** @title Описание */
|
|
10
|
-
description?: string;
|
|
11
|
-
icon?: Picture;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type TabClickHandler = (tabIndex: number) => void;
|
|
15
|
-
|
|
16
|
-
export interface TabsProps {
|
|
17
|
-
tabs?: Tab[];
|
|
18
|
-
currentTabIndex: number;
|
|
19
|
-
onTabClick: TabClickHandler;
|
|
20
|
-
}
|
package/src/ui-kit/Tabs/Tabs.tsx
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { Img } from '../Img/Img';
|
|
3
|
-
import type { Tab, TabClickHandler, TabsProps } from './TabsProps';
|
|
4
|
-
|
|
5
|
-
const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
|
|
6
|
-
const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
|
|
7
|
-
|
|
8
|
-
export const Tabs = JSX<TabsProps>(({ tabs, currentTabIndex, onTabClick }) => {
|
|
9
|
-
return (
|
|
10
|
-
<div className="flex items-end border-b border-main-stroke" role="tablist">
|
|
11
|
-
{tabs?.map(renderTab(currentTabIndex, onTabClick))}
|
|
12
|
-
</div>
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const tabDescriptionStyle = (isActive = false) =>
|
|
17
|
-
`text-xs-light ${isActive ? '' : 'text-secondary-text'}`;
|
|
18
|
-
|
|
19
|
-
const renderTab =
|
|
20
|
-
(currentTabIndex: number, onTabClick: TabClickHandler) => (tab: Tab, index: number) => {
|
|
21
|
-
const isActive = currentTabIndex === index;
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div
|
|
25
|
-
key={String(index)}
|
|
26
|
-
className={`flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${
|
|
27
|
-
isActive ? ACTIVE_TAB_STYLE : TAB_STYLE
|
|
28
|
-
}`}
|
|
29
|
-
role="tab"
|
|
30
|
-
onClick={() => onTabClick(index)}
|
|
31
|
-
aria-selected={isActive}
|
|
32
|
-
>
|
|
33
|
-
{tab?.icon ? renderIcon(tab, isActive) : null}
|
|
34
|
-
<div>
|
|
35
|
-
{tab?.title ? <h3 className="m-0 text-l font-medium">{tab?.title}</h3> : null}
|
|
36
|
-
{tab?.description ? (
|
|
37
|
-
<span className={tabDescriptionStyle(isActive)}>{tab?.description}</span>
|
|
38
|
-
) : null}
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const renderIcon = (tab: Tab, isActive: boolean) => (
|
|
45
|
-
<div className="h-full mt-1">
|
|
46
|
-
<Img
|
|
47
|
-
className={`w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`}
|
|
48
|
-
image={tab?.icon || 'CardIcon'}
|
|
49
|
-
asSVG={!isActive}
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Picture } from '../../model/Picture';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @title Вкладка
|
|
5
|
-
*/
|
|
6
|
-
export interface Tab {
|
|
7
|
-
/** @title Имя вкладки */
|
|
8
|
-
title?: string;
|
|
9
|
-
/** @title Описание */
|
|
10
|
-
description?: string;
|
|
11
|
-
icon?: Picture;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type TabClickHandler = (tabIndex: number) => void;
|
|
15
|
-
|
|
16
|
-
export interface TabsProps {
|
|
17
|
-
tabs?: Tab[];
|
|
18
|
-
currentTabIndex: number;
|
|
19
|
-
onTabClick: TabClickHandler;
|
|
20
|
-
}
|