@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
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,MAAM,SAAS,GAAG,0DAA0D,CAAC;AAC7E,MAAM,gBAAgB,GAAG,gDAAgD,CAAC;AAE1E,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,cAAK,SAAS,EAAC,4CAA4C,EAAC,IAAI,EAAC,SAAS,YACvE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAC9C,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,CAAC,QAAQ,GAAG,KAAK,EAAE,EAAE,CAC/C,iBAAiB,QAAQ,CAAC,CAAC,CAAC,EAA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вкладка
4
- */
5
- export interface Tab {
6
- /** @title Имя вкладки */
7
- title?: string;
8
- /** @title Описание */
9
- description?: string;
10
- icon?: Picture;
11
- }
12
- export declare type TabClickHandler = (tabIndex: number) => void;
13
- export interface TabsProps {
14
- tabs?: Tab[];
15
- currentTabIndex: number;
16
- onTabClick: TabClickHandler;
17
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TabsProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabsProps.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/TabsProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { TabsProps } from './TabsProps';
2
- export declare const Tabs: import("@redneckz/uni-jsx").UNIComponent<TabsProps, any, any>;
@@ -1,17 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.Tabs = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const Img_1 = require("../Img/Img");
6
- const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
7
- const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
8
- exports.Tabs = (0, uni_jsx_1.JSX)(({ tabs, currentTabIndex, onTabClick }) => {
9
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end border-b border-main-stroke", role: "tablist", children: tabs?.map(renderTab(currentTabIndex, onTabClick)) }));
10
- });
11
- const tabDescriptionStyle = (isActive = false) => `text-xs-light ${isActive ? '' : 'text-secondary-text'}`;
12
- const renderTab = (currentTabIndex, onTabClick) => (tab, index) => {
13
- const isActive = currentTabIndex === index;
14
- return ((0, jsx_runtime_1.jsxs)("div", { className: `flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${isActive ? ACTIVE_TAB_STYLE : TAB_STYLE}`, role: "tab", onClick: () => onTabClick(index), "aria-selected": isActive, children: [tab?.icon ? renderIcon(tab, isActive) : null, (0, jsx_runtime_1.jsxs)("div", { children: [tab?.title ? (0, jsx_runtime_1.jsx)("h3", { className: "m-0 text-l font-medium", children: tab?.title }) : null, tab?.description ? ((0, jsx_runtime_1.jsx)("span", { className: tabDescriptionStyle(isActive), children: tab?.description })) : null] })] }, String(index)));
15
- };
16
- const renderIcon = (tab, isActive) => ((0, jsx_runtime_1.jsx)("div", { className: "h-full mt-1", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { className: `w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`, image: tab?.icon || 'CardIcon', asSVG: !isActive }) }));
17
- //# sourceMappingURL=Tabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/Tabs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,oCAAiC;AAGjC,MAAM,SAAS,GAAG,0DAA0D,CAAC;AAC7E,MAAM,gBAAgB,GAAG,gDAAgD,CAAC;AAE7D,QAAA,IAAI,GAAG,IAAA,aAAG,EAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,gCAAK,SAAS,EAAC,4CAA4C,EAAC,IAAI,EAAC,SAAS,YACvE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAC9C,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,CAAC,QAAQ,GAAG,KAAK,EAAE,EAAE,CAC/C,iBAAiB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,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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C,IAAI,EAC7C,0BACG,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,aAAI,SAAS,EAAC,wBAAwB,YAAE,GAAG,EAAE,KAAK,GAAM,CAAC,CAAC,CAAC,IAAI,EAC5E,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAClB,eAAM,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CAAC,YAAG,GAAG,EAAE,WAAW,GAAQ,CAC1E,CAAC,CAAC,CAAC,IAAI,IACJ,KAdD,MAAM,CAAC,KAAK,CAAC,CAed,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAE,QAAiB,EAAE,EAAE,CAAC,CAClD,cAAK,SAAS,EAAC,aAAa,YAC1B,KAAC,GAAG,IACF,SAAS,EAAE,gBAAgB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EACrD,KAAK,EAAE,GAAG,EAAE,IAAI,IAAI,UAAU,EAC9B,KAAK,EAAE,CAAC,QAAQ,GAChB,GACE,CACP,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { Picture } from '../../model/Picture';
2
- /**
3
- * @title Вкладка
4
- */
5
- export interface Tab {
6
- /** @title Имя вкладки */
7
- title?: string;
8
- /** @title Описание */
9
- description?: string;
10
- icon?: Picture;
11
- }
12
- export declare type TabClickHandler = (tabIndex: number) => void;
13
- export interface TabsProps {
14
- tabs?: Tab[];
15
- currentTabIndex: number;
16
- onTabClick: TabClickHandler;
17
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TabsProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabsProps.js","sourceRoot":"","sources":["../../../src/ui-kit/Tabs/TabsProps.ts"],"names":[],"mappings":""}
@@ -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
- }
@@ -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
- }