@redneckz/wildless-cms-uni-blocks 0.14.46 → 0.14.48

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 (58) hide show
  1. package/bin/migration-scripts/0.14.45.js +17 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +10 -10
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
  6. package/bundle/components/RollupItem/RollupItemContent.d.ts +6 -0
  7. package/dist/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
  8. package/dist/components/RollupItem/AccordionFoldButton.js +12 -0
  9. package/dist/components/RollupItem/AccordionFoldButton.js.map +1 -0
  10. package/dist/components/RollupItem/RollupItem.js +5 -5
  11. package/dist/components/RollupItem/RollupItem.js.map +1 -1
  12. package/dist/components/RollupItem/RollupItemContent.d.ts +6 -0
  13. package/lib/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
  14. package/lib/components/RollupItem/AccordionFoldButton.js +10 -0
  15. package/lib/components/RollupItem/AccordionFoldButton.js.map +1 -0
  16. package/lib/components/RollupItem/RollupItem.fixture.d.ts +2 -2
  17. package/lib/components/RollupItem/RollupItem.js +5 -5
  18. package/lib/components/RollupItem/RollupItem.js.map +1 -1
  19. package/lib/components/RollupItem/RollupItemContent.d.ts +6 -0
  20. package/lib/components/VerticalLayout/VerticalLayout.fixture.d.ts +1 -1
  21. package/mobile/bundle/bundle.umd.js +10 -10
  22. package/mobile/bundle/bundle.umd.min.js +1 -1
  23. package/mobile/bundle/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
  24. package/mobile/bundle/components/RollupItem/RollupItemContent.d.ts +6 -0
  25. package/mobile/dist/components/RollupItem/AccordionFoldButton.d.ts +12 -0
  26. package/mobile/dist/components/RollupItem/AccordionFoldButton.js +12 -0
  27. package/mobile/dist/components/RollupItem/AccordionFoldButton.js.map +1 -0
  28. package/mobile/dist/components/RollupItem/RollupItem.js +5 -5
  29. package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
  30. package/mobile/dist/components/RollupItem/RollupItemContent.d.ts +6 -0
  31. package/mobile/lib/components/RollupItem/AccordionFoldButton.d.ts +12 -0
  32. package/mobile/lib/components/RollupItem/AccordionFoldButton.js +10 -0
  33. package/mobile/lib/components/RollupItem/AccordionFoldButton.js.map +1 -0
  34. package/mobile/lib/components/RollupItem/RollupItem.js +5 -5
  35. package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
  36. package/mobile/lib/components/RollupItem/RollupItemContent.d.ts +6 -0
  37. package/mobile/src/components/RollupItem/{PrimaryFoldButton.tsx → AccordionFoldButton.tsx} +2 -2
  38. package/mobile/src/components/RollupItem/RollupItem.example.json +2 -1
  39. package/mobile/src/components/RollupItem/RollupItem.tsx +8 -9
  40. package/mobile/src/components/RollupItem/RollupItemContent.ts +7 -0
  41. package/package.json +1 -1
  42. package/src/components/RollupItem/{PrimaryFoldButton.tsx → AccordionFoldButton.tsx} +2 -2
  43. package/src/components/RollupItem/RollupItem.example.json +2 -1
  44. package/src/components/RollupItem/RollupItem.fixture.mobile.tsx +1 -1
  45. package/src/components/RollupItem/RollupItem.fixture.tsx +6 -6
  46. package/src/components/RollupItem/RollupItem.tsx +8 -9
  47. package/src/components/RollupItem/RollupItemContent.ts +7 -0
  48. package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +29 -28
  49. package/dist/components/RollupItem/PrimaryFoldButton.js +0 -12
  50. package/dist/components/RollupItem/PrimaryFoldButton.js.map +0 -1
  51. package/lib/components/RollupItem/PrimaryFoldButton.js +0 -10
  52. package/lib/components/RollupItem/PrimaryFoldButton.js.map +0 -1
  53. package/mobile/dist/components/RollupItem/PrimaryFoldButton.d.ts +0 -12
  54. package/mobile/dist/components/RollupItem/PrimaryFoldButton.js +0 -12
  55. package/mobile/dist/components/RollupItem/PrimaryFoldButton.js.map +0 -1
  56. package/mobile/lib/components/RollupItem/PrimaryFoldButton.d.ts +0 -12
  57. package/mobile/lib/components/RollupItem/PrimaryFoldButton.js +0 -10
  58. package/mobile/lib/components/RollupItem/PrimaryFoldButton.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { type IconName } from '../../icons/IconName';
2
2
  import { type Picture } from '../../model/Picture';
3
3
  import { type IconBgVersion } from '../../ui-kit/Icon/IconProps';
4
- interface PrimaryFoldButtonProps {
4
+ interface RollupButtonProps {
5
5
  label?: string;
6
6
  labelIcon?: Picture;
7
7
  labelIconBgVersion?: IconBgVersion;
8
8
  icon?: IconName;
9
9
  onToggle?: () => void;
10
10
  }
11
- export declare const PrimaryFoldButton: import("@redneckz/uni-jsx").UNIComponent<PrimaryFoldButtonProps, any, any>;
11
+ export declare const AccordionFoldButton: import("@redneckz/uni-jsx").UNIComponent<RollupButtonProps, any, any>;
12
12
  export {};
@@ -1,5 +1,10 @@
1
1
  import { type LabelProps } from '../../model/HeadlineType';
2
2
  import { type UniBlockContent } from '../../model/JSXBlock';
3
+ /**
4
+ * @title Вид кнопки сворачивания
5
+ * @enumNames ["Основная", "Аккордион"]
6
+ */
7
+ export declare type FoldButtonVersion = 'default' | 'accordion';
3
8
  /**
4
9
  * @title Сворачивающаяся секция
5
10
  */
@@ -8,4 +13,5 @@ export declare type RollupItemContent = UniBlockContent & LabelProps & {
8
13
  isExpanded?: boolean;
9
14
  /** @title Кнопка сверху */
10
15
  isFoldButtonOnTop?: boolean;
16
+ foldButtonVersion?: FoldButtonVersion;
11
17
  };
@@ -0,0 +1,12 @@
1
+ import { type IconName } from '../../icons/IconName';
2
+ import { type Picture } from '../../model/Picture';
3
+ import { type IconBgVersion } from '../../ui-kit/Icon/IconProps';
4
+ interface RollupButtonProps {
5
+ label?: string;
6
+ labelIcon?: Picture;
7
+ labelIconBgVersion?: IconBgVersion;
8
+ icon?: IconName;
9
+ onToggle?: () => void;
10
+ }
11
+ export declare const AccordionFoldButton: import("@redneckz/uni-jsx").UNIComponent<RollupButtonProps, any, any>;
12
+ export {};
@@ -0,0 +1,12 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.AccordionFoldButton = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
+ const Icon_1 = require("../../ui-kit/Icon/Icon");
6
+ const Text_1 = require("../../ui-kit/Text/Text");
7
+ const TextWithIcon_1 = require("../../ui-kit/TextWithIcon/TextWithIcon");
8
+ const style_1 = require("../../utils/style");
9
+ const renderRoundedIcon_1 = require("./renderRoundedIcon");
10
+ const rollupIconVersion_1 = require("./rollupIconVersion");
11
+ exports.AccordionFoldButton = (0, uni_jsx_1.JSX)(({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => ((0, jsx_runtime_1.jsx)(TextWithIcon_1.TextWithIcon, { tag: "button", className: (0, style_1.style)('border-none bg-transparent items-center group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, textNode: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-start group-hover/button:text-primary-main gap-s", children: [(0, renderRoundedIcon_1.renderRoundedIcon)(labelIcon, labelIconBgVersion), label ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), iconNode: icon ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, iconVersion: rollupIconVersion_1.rollupIconVersion, width: "24", height: "24" }) : null })));
12
+ //# sourceMappingURL=AccordionFoldButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionFoldButton.js","sourceRoot":"","sources":["../../../src/components/RollupItem/AccordionFoldButton.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,iDAA8C;AAE9C,iDAA8C;AAC9C,yEAAsE;AACtE,6CAA0C;AAC1C,2DAAwD;AACxD,2DAAwD;AAU3C,QAAA,mBAAmB,GAAG,IAAA,aAAG,EACpC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAC5D,uBAAC,2BAAY,IACX,GAAG,EAAC,QAAQ,EACZ,SAAS,EAAE,IAAA,aAAK,EACd,sDAAsD,EACtD,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CACpC,EACD,OAAO,EAAE,QAAQ,EACjB,QAAQ,EACN,iCAAK,SAAS,EAAC,yEAAyE,aACrF,IAAA,qCAAiB,EAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,KAAK,CAAC,CAAC,CAAC,CACP,uBAAC,WAAI,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,aAAa,YACpC,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EAER,QAAQ,EACN,IAAI,CAAC,CAAC,CAAC,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAiB,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAE3F,CACH,CACF,CAAC"}
@@ -8,15 +8,15 @@ const DefaultFoldButton_1 = require("../../ui-kit/Foldable/DefaultFoldButton");
8
8
  const Foldable_1 = require("../../ui-kit/Foldable/Foldable");
9
9
  const FoldableSection_1 = require("../../ui-kit/Foldable/FoldableSection");
10
10
  const style_1 = require("../../utils/style");
11
+ const AccordionFoldButton_1 = require("./AccordionFoldButton");
11
12
  const foldableSectionStyles_1 = require("./foldableSectionStyles");
12
13
  const getIconName_1 = require("./getIconName");
13
- const PrimaryFoldButton_1 = require("./PrimaryFoldButton");
14
14
  const rollupItemStyles_1 = require("./rollupItemStyles");
15
- exports.RollupItem = (0, uni_jsx_1.JSX)(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion, version = 'primary', ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)('w-full', rollupItemStyles_1.rollupItemStyles, className), defaultPadding: "p-0", tag: "div", version: "transparent", ...rest, children: (0, jsx_runtime_1.jsx)(Foldable_1.Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => ((0, jsx_runtime_1.jsx)(FoldableSection_1.FoldableSection, { className: (0, style_1.style)('gap-lg', foldableSectionStyles_1.foldableSectionStyles), isUnfolded: isUnfolded, children: (0, renderChildren_1.renderChildren)({
15
+ exports.RollupItem = (0, uni_jsx_1.JSX)(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion, foldButtonVersion = 'accordion', ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)('w-full', rollupItemStyles_1.rollupItemStyles, className), defaultPadding: "p-0", tag: "div", version: "transparent", ...rest, children: (0, jsx_runtime_1.jsx)(Foldable_1.Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => ((0, jsx_runtime_1.jsx)(FoldableSection_1.FoldableSection, { className: (0, style_1.style)('gap-lg', foldableSectionStyles_1.foldableSectionStyles), isUnfolded: isUnfolded, children: (0, renderChildren_1.renderChildren)({
16
16
  ...rest,
17
17
  extraProps: { className: 'w-full', padding: 'p-0' },
18
18
  }) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
19
- version,
19
+ foldButtonVersion,
20
20
  label,
21
21
  labelIcon,
22
22
  labelIconBgVersion,
@@ -26,9 +26,9 @@ exports.RollupItem = (0, uni_jsx_1.JSX)(({ className = '', isExpanded, isFoldBut
26
26
  exports.RollupItem.childrenTypes = {
27
27
  exclude: ['RollupItem'],
28
28
  };
29
- const renderFoldButton = ({ version, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
29
+ const renderFoldButton = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
30
30
  const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
31
31
  const icon = (0, getIconName_1.getIconName)(isUnfolded);
32
- return version === 'primary' ? ((0, jsx_runtime_1.jsx)(PrimaryFoldButton_1.PrimaryFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : ((0, jsx_runtime_1.jsx)(DefaultFoldButton_1.DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
32
+ return foldButtonVersion === 'accordion' ? ((0, jsx_runtime_1.jsx)(AccordionFoldButton_1.AccordionFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : ((0, jsx_runtime_1.jsx)(DefaultFoldButton_1.DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
33
33
  };
34
34
  //# sourceMappingURL=RollupItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RollupItem.js","sourceRoot":"","sources":["../../../src/components/RollupItem/RollupItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uEAAoE;AAIpE,4DAAyD;AACzD,+EAA4E;AAC5E,6DAA0D;AAE1D,2EAAwE;AAExE,6CAA0C;AAC1C,mEAAgE;AAChE,+CAA4C;AAC5C,2DAAwD;AAExD,yDAAsD;AAOzC,QAAA,UAAU,GAA8B,IAAA,aAAG,EACtD,CAAC,EACC,SAAS,GAAG,EAAE,EACd,UAAU,EACV,iBAAiB,GAAG,IAAI,EACxB,KAAK,GAAG,YAAY,EACpB,SAAS,EACT,kBAAkB,EAClB,OAAO,GAAG,SAAS,EACnB,GAAG,IAAI,EACR,EAA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,IAChB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,CACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,OAAO,EAAE,QAAQ,GACjB,CACH,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"RollupItem.js","sourceRoot":"","sources":["../../../src/components/RollupItem/RollupItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uEAAoE;AAGpE,4DAAyD;AACzD,+EAA4E;AAC5E,6DAA0D;AAE1D,2EAAwE;AAExE,6CAA0C;AAC1C,+DAA4D;AAC5D,mEAAgE;AAChE,+CAA4C;AAE5C,yDAAsD;AAOzC,QAAA,UAAU,GAA8B,IAAA,aAAG,EACtD,CAAC,EACC,SAAS,GAAG,EAAE,EACd,UAAU,EACV,iBAAiB,GAAG,IAAI,EACxB,KAAK,GAAG,YAAY,EACpB,SAAS,EACT,kBAAkB,EAClB,iBAAiB,GAAG,WAAW,EAC/B,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,uBAAC,2BAAY,IACX,SAAS,EAAE,IAAA,aAAK,EAAC,QAAQ,EAAE,mCAAgB,EAAE,SAAS,CAAC,EACvD,cAAc,EAAC,KAAK,EACpB,GAAG,EAAC,KAAK,EACT,OAAO,EAAC,aAAa,KACjB,IAAI,YAER,uBAAC,mBAAQ,IACP,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,UAAU,EAC7B,qBAAqB,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACzC,uBAAC,iCAAe,IACd,SAAS,EAAE,IAAA,aAAK,EAAC,QAAQ,EAAE,6CAAqB,CAAC,EACjD,UAAU,EAAE,UAAU,YAErB,IAAA,+BAAc,EAAC;gBACd,GAAG,IAAI;gBACP,UAAU,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;aACpD,CAAC,GACc,CACnB,EACD,gBAAgB,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC7C,gBAAgB,CAAC;YACf,iBAAiB;YACjB,KAAK;YACL,SAAS;YACT,kBAAkB;YAClB,UAAU;YACV,QAAQ;SACT,CAAC,GAEJ,GACW,CAChB,CACF,CAAC;AAEF,kBAAU,CAAC,aAAa,GAAG;IACzB,OAAO,EAAE,CAAC,YAAY,CAAC;CACxB,CAAC;AAUF,MAAM,gBAAgB,GAAG,CAAC,EACxB,iBAAiB,EACjB,KAAK,EAAE,YAAY,EACnB,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,QAAQ,GACQ,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,IAAA,yBAAW,EAAC,UAAU,CAAC,CAAC;IAErC,OAAO,iBAAiB,KAAK,WAAW,CAAC,CAAC,CAAC,CACzC,uBAAC,yCAAmB,IAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,CACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,OAAO,EAAE,QAAQ,GACjB,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +1,10 @@
1
1
  import { type LabelProps } from '../../model/HeadlineType';
2
2
  import { type UniBlockContent } from '../../model/JSXBlock';
3
+ /**
4
+ * @title Вид кнопки сворачивания
5
+ * @enumNames ["Основная", "Аккордион"]
6
+ */
7
+ export declare type FoldButtonVersion = 'default' | 'accordion';
3
8
  /**
4
9
  * @title Сворачивающаяся секция
5
10
  */
@@ -8,4 +13,5 @@ export declare type RollupItemContent = UniBlockContent & LabelProps & {
8
13
  isExpanded?: boolean;
9
14
  /** @title Кнопка сверху */
10
15
  isFoldButtonOnTop?: boolean;
16
+ foldButtonVersion?: FoldButtonVersion;
11
17
  };
@@ -0,0 +1,12 @@
1
+ import { type IconName } from '../../icons/IconName';
2
+ import { type Picture } from '../../model/Picture';
3
+ import { type IconBgVersion } from '../../ui-kit/Icon/IconProps';
4
+ interface RollupButtonProps {
5
+ label?: string;
6
+ labelIcon?: Picture;
7
+ labelIconBgVersion?: IconBgVersion;
8
+ icon?: IconName;
9
+ onToggle?: () => void;
10
+ }
11
+ export declare const AccordionFoldButton: import("@redneckz/uni-jsx").UNIComponent<RollupButtonProps, any, any>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ import { Icon } from '../../ui-kit/Icon/Icon.js';
4
+ import { Text } from '../../ui-kit/Text/Text.js';
5
+ import { TextWithIcon } from '../../ui-kit/TextWithIcon/TextWithIcon.js';
6
+ import { style } from '../../utils/style.js';
7
+ import { renderRoundedIcon } from './renderRoundedIcon.js';
8
+ import { rollupIconVersion } from './rollupIconVersion.js';
9
+ export const AccordionFoldButton = JSX(({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => (_jsx(TextWithIcon, { tag: "button", className: style('border-none bg-transparent items-center group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, textNode: _jsxs("div", { className: "flex items-center text-start group-hover/button:text-primary-main gap-s", children: [renderRoundedIcon(labelIcon, labelIconBgVersion), label ? (_jsx(Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), iconNode: icon ? _jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null })));
10
+ //# sourceMappingURL=AccordionFoldButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionFoldButton.js","sourceRoot":"","sources":["../../../src/components/RollupItem/AccordionFoldButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAC5D,KAAC,YAAY,IACX,GAAG,EAAC,QAAQ,EACZ,SAAS,EAAE,KAAK,CACd,sDAAsD,EACtD,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CACpC,EACD,OAAO,EAAE,QAAQ,EACjB,QAAQ,EACN,eAAK,SAAS,EAAC,yEAAyE,aACrF,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,aAAa,YACpC,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EAER,QAAQ,EACN,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAE3F,CACH,CACF,CAAC"}
@@ -6,15 +6,15 @@ import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton.js';
6
6
  import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
7
7
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
8
8
  import { style } from '../../utils/style.js';
9
+ import { AccordionFoldButton } from './AccordionFoldButton.js';
9
10
  import { foldableSectionStyles } from './foldableSectionStyles.js';
10
11
  import { getIconName } from './getIconName.js';
11
- import { PrimaryFoldButton } from './PrimaryFoldButton.js';
12
12
  import { rollupItemStyles } from './rollupItemStyles.js';
13
- export const RollupItem = JSX(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion, version = 'primary', ...rest }) => (_jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), defaultPadding: "p-0", tag: "div", version: "transparent", ...rest, children: _jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (_jsx(FoldableSection, { className: style('gap-lg', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren({
13
+ export const RollupItem = JSX(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion, foldButtonVersion = 'accordion', ...rest }) => (_jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), defaultPadding: "p-0", tag: "div", version: "transparent", ...rest, children: _jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (_jsx(FoldableSection, { className: style('gap-lg', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren({
14
14
  ...rest,
15
15
  extraProps: { className: 'w-full', padding: 'p-0' },
16
16
  }) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
17
- version,
17
+ foldButtonVersion,
18
18
  label,
19
19
  labelIcon,
20
20
  labelIconBgVersion,
@@ -24,9 +24,9 @@ export const RollupItem = JSX(({ className = '', isExpanded, isFoldButtonOnTop =
24
24
  RollupItem.childrenTypes = {
25
25
  exclude: ['RollupItem'],
26
26
  };
27
- const renderFoldButton = ({ version, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
27
+ const renderFoldButton = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
28
28
  const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
29
29
  const icon = getIconName(isUnfolded);
30
- return version === 'primary' ? (_jsx(PrimaryFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : (_jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
30
+ return foldButtonVersion === 'accordion' ? (_jsx(AccordionFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : (_jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
31
31
  };
32
32
  //# sourceMappingURL=RollupItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RollupItem.js","sourceRoot":"","sources":["../../../src/components/RollupItem/RollupItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIpE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EA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AAG;IACzB,OAAO,EAAE,CAAC,YAAY,CAAC;CACxB,CAAC;AAUF,MAAM,gBAAgB,GAAG,CAAC,EACxB,iBAAiB,EACjB,KAAK,EAAE,YAAY,EACnB,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,QAAQ,GACQ,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAErC,OAAO,iBAAiB,KAAK,WAAW,CAAC,CAAC,CAAC,CACzC,KAAC,mBAAmB,IAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,OAAO,EAAE,QAAQ,GACjB,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +1,10 @@
1
1
  import { type LabelProps } from '../../model/HeadlineType';
2
2
  import { type UniBlockContent } from '../../model/JSXBlock';
3
+ /**
4
+ * @title Вид кнопки сворачивания
5
+ * @enumNames ["Основная", "Аккордион"]
6
+ */
7
+ export declare type FoldButtonVersion = 'default' | 'accordion';
3
8
  /**
4
9
  * @title Сворачивающаяся секция
5
10
  */
@@ -8,4 +13,5 @@ export declare type RollupItemContent = UniBlockContent & LabelProps & {
8
13
  isExpanded?: boolean;
9
14
  /** @title Кнопка сверху */
10
15
  isFoldButtonOnTop?: boolean;
16
+ foldButtonVersion?: FoldButtonVersion;
11
17
  };
@@ -9,7 +9,7 @@ import { style } from '../../utils/style';
9
9
  import { renderRoundedIcon } from './renderRoundedIcon';
10
10
  import { rollupIconVersion } from './rollupIconVersion';
11
11
 
12
- interface PrimaryFoldButtonProps {
12
+ interface RollupButtonProps {
13
13
  label?: string;
14
14
  labelIcon?: Picture;
15
15
  labelIconBgVersion?: IconBgVersion;
@@ -17,7 +17,7 @@ interface PrimaryFoldButtonProps {
17
17
  onToggle?: () => void;
18
18
  }
19
19
 
20
- export const PrimaryFoldButton = JSX<PrimaryFoldButtonProps>(
20
+ export const AccordionFoldButton = JSX<RollupButtonProps>(
21
21
  ({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => (
22
22
  <TextWithIcon
23
23
  tag="button"
@@ -2,7 +2,8 @@
2
2
  "content": {
3
3
  "label": "Сворачивающаяся секция 1",
4
4
  "isExpanded": true,
5
- "isFoldButtonOnTop": true
5
+ "isFoldButtonOnTop": true,
6
+ "foldButtonVersion": "default"
6
7
  },
7
8
  "blocks": [
8
9
  {
@@ -1,6 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { renderChildren } from '../../BlockRenderer/renderChildren';
3
- import { type BlockVersion } from '../../model/BlockVersion';
4
3
  import { type JSXBlock, type UniBlockProps } from '../../model/JSXBlock';
5
4
  import { type Picture } from '../../model/Picture';
6
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
@@ -10,10 +9,10 @@ import { type FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps'
10
9
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
11
10
  import { type IconBgVersion, type IconProps } from '../../ui-kit/Icon/IconProps';
12
11
  import { style } from '../../utils/style';
12
+ import { AccordionFoldButton } from './AccordionFoldButton';
13
13
  import { foldableSectionStyles } from './foldableSectionStyles';
14
14
  import { getIconName } from './getIconName';
15
- import { PrimaryFoldButton } from './PrimaryFoldButton';
16
- import { type RollupItemContent } from './RollupItemContent';
15
+ import { type FoldButtonVersion, type RollupItemContent } from './RollupItemContent';
17
16
  import { rollupItemStyles } from './rollupItemStyles';
18
17
 
19
18
  interface RollupItemProps extends RollupItemContent, UniBlockProps {
@@ -29,7 +28,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
29
28
  label = 'Развернуть',
30
29
  labelIcon,
31
30
  labelIconBgVersion,
32
- version = 'primary',
31
+ foldButtonVersion = 'accordion',
33
32
  ...rest
34
33
  }) => (
35
34
  <BlockWrapper
@@ -55,7 +54,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
55
54
  )}
56
55
  renderFoldButton={({ isUnfolded, onToggle }) =>
57
56
  renderFoldButton({
58
- version,
57
+ foldButtonVersion,
59
58
  label,
60
59
  labelIcon,
61
60
  labelIconBgVersion,
@@ -73,7 +72,7 @@ RollupItem.childrenTypes = {
73
72
  };
74
73
 
75
74
  interface FoldButtonProps extends FoldablePartProps {
76
- version?: BlockVersion;
75
+ foldButtonVersion?: FoldButtonVersion;
77
76
  label?: string;
78
77
  labelIcon?: IconProps;
79
78
  labelIconBgVersion?: IconBgVersion;
@@ -81,7 +80,7 @@ interface FoldButtonProps extends FoldablePartProps {
81
80
  }
82
81
 
83
82
  const renderFoldButton = ({
84
- version,
83
+ foldButtonVersion,
85
84
  label: defaultLabel,
86
85
  labelIcon,
87
86
  labelIconBgVersion,
@@ -91,8 +90,8 @@ const renderFoldButton = ({
91
90
  const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
92
91
  const icon = getIconName(isUnfolded);
93
92
 
94
- return version === 'primary' ? (
95
- <PrimaryFoldButton
93
+ return foldButtonVersion === 'accordion' ? (
94
+ <AccordionFoldButton
96
95
  label={label}
97
96
  labelIcon={labelIcon}
98
97
  labelIconBgVersion={labelIconBgVersion}
@@ -1,6 +1,12 @@
1
1
  import { type LabelProps } from '../../model/HeadlineType';
2
2
  import { type UniBlockContent } from '../../model/JSXBlock';
3
3
 
4
+ /**
5
+ * @title Вид кнопки сворачивания
6
+ * @enumNames ["Основная", "Аккордион"]
7
+ */
8
+ export type FoldButtonVersion = 'default' | 'accordion';
9
+
4
10
  /**
5
11
  * @title Сворачивающаяся секция
6
12
  */
@@ -10,4 +16,5 @@ export type RollupItemContent = UniBlockContent &
10
16
  isExpanded?: boolean;
11
17
  /** @title Кнопка сверху */
12
18
  isFoldButtonOnTop?: boolean;
19
+ foldButtonVersion?: FoldButtonVersion;
13
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.46",
3
+ "version": "0.14.48",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -9,7 +9,7 @@ import { style } from '../../utils/style';
9
9
  import { renderRoundedIcon } from './renderRoundedIcon';
10
10
  import { rollupIconVersion } from './rollupIconVersion';
11
11
 
12
- interface PrimaryFoldButtonProps {
12
+ interface RollupButtonProps {
13
13
  label?: string;
14
14
  labelIcon?: Picture;
15
15
  labelIconBgVersion?: IconBgVersion;
@@ -17,7 +17,7 @@ interface PrimaryFoldButtonProps {
17
17
  onToggle?: () => void;
18
18
  }
19
19
 
20
- export const PrimaryFoldButton = JSX<PrimaryFoldButtonProps>(
20
+ export const AccordionFoldButton = JSX<RollupButtonProps>(
21
21
  ({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => (
22
22
  <TextWithIcon
23
23
  tag="button"
@@ -2,7 +2,8 @@
2
2
  "content": {
3
3
  "label": "Сворачивающаяся секция 1",
4
4
  "isExpanded": true,
5
- "isFoldButtonOnTop": true
5
+ "isFoldButtonOnTop": true,
6
+ "foldButtonVersion": "default"
6
7
  },
7
8
  "blocks": [
8
9
  {
@@ -34,7 +34,7 @@ export default {
34
34
  labelIcon={labelIcon}
35
35
  labelIconBgVersion="primary"
36
36
  options={options}
37
- version="secondary"
37
+ foldButtonVersion="default"
38
38
  />
39
39
  <RollupItem {...ROLLUP_ITEM.content} block={ROLLUP_ITEM} options={options} />
40
40
  </div>
@@ -13,7 +13,9 @@ export default {
13
13
  default: (
14
14
  <RollupItem
15
15
  label="Rollup button 1"
16
- isExpanded={true}
16
+ foldButtonVersion="default"
17
+ isFoldButtonOnTop={false}
18
+ isExpanded={false}
17
19
  block={{
18
20
  type: 'RollupItem',
19
21
  blocks: [
@@ -24,11 +26,9 @@ export default {
24
26
  options={options}
25
27
  />
26
28
  ),
27
- secondary: (
29
+ accordion: (
28
30
  <RollupItem
29
31
  label="Rollup button 2"
30
- version="secondary"
31
- isFoldButtonOnTop={false}
32
32
  isExpanded={true}
33
33
  block={{
34
34
  type: 'RollupItem',
@@ -40,10 +40,10 @@ export default {
40
40
  options={options}
41
41
  />
42
42
  ),
43
- 'secondary default-open': (
43
+ 'default-open': (
44
44
  <RollupItem
45
- version="secondary"
46
45
  label="Rollup button 2"
46
+ foldButtonVersion="default"
47
47
  isExpanded={true}
48
48
  block={{
49
49
  type: 'RollupItem',
@@ -1,6 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { renderChildren } from '../../BlockRenderer/renderChildren';
3
- import { type BlockVersion } from '../../model/BlockVersion';
4
3
  import { type JSXBlock, type UniBlockProps } from '../../model/JSXBlock';
5
4
  import { type Picture } from '../../model/Picture';
6
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
@@ -10,10 +9,10 @@ import { type FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps'
10
9
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
11
10
  import { type IconBgVersion, type IconProps } from '../../ui-kit/Icon/IconProps';
12
11
  import { style } from '../../utils/style';
12
+ import { AccordionFoldButton } from './AccordionFoldButton';
13
13
  import { foldableSectionStyles } from './foldableSectionStyles';
14
14
  import { getIconName } from './getIconName';
15
- import { PrimaryFoldButton } from './PrimaryFoldButton';
16
- import { type RollupItemContent } from './RollupItemContent';
15
+ import { type FoldButtonVersion, type RollupItemContent } from './RollupItemContent';
17
16
  import { rollupItemStyles } from './rollupItemStyles';
18
17
 
19
18
  interface RollupItemProps extends RollupItemContent, UniBlockProps {
@@ -29,7 +28,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
29
28
  label = 'Развернуть',
30
29
  labelIcon,
31
30
  labelIconBgVersion,
32
- version = 'primary',
31
+ foldButtonVersion = 'accordion',
33
32
  ...rest
34
33
  }) => (
35
34
  <BlockWrapper
@@ -55,7 +54,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
55
54
  )}
56
55
  renderFoldButton={({ isUnfolded, onToggle }) =>
57
56
  renderFoldButton({
58
- version,
57
+ foldButtonVersion,
59
58
  label,
60
59
  labelIcon,
61
60
  labelIconBgVersion,
@@ -73,7 +72,7 @@ RollupItem.childrenTypes = {
73
72
  };
74
73
 
75
74
  interface FoldButtonProps extends FoldablePartProps {
76
- version?: BlockVersion;
75
+ foldButtonVersion?: FoldButtonVersion;
77
76
  label?: string;
78
77
  labelIcon?: IconProps;
79
78
  labelIconBgVersion?: IconBgVersion;
@@ -81,7 +80,7 @@ interface FoldButtonProps extends FoldablePartProps {
81
80
  }
82
81
 
83
82
  const renderFoldButton = ({
84
- version,
83
+ foldButtonVersion,
85
84
  label: defaultLabel,
86
85
  labelIcon,
87
86
  labelIconBgVersion,
@@ -91,8 +90,8 @@ const renderFoldButton = ({
91
90
  const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
92
91
  const icon = getIconName(isUnfolded);
93
92
 
94
- return version === 'primary' ? (
95
- <PrimaryFoldButton
93
+ return foldButtonVersion === 'accordion' ? (
94
+ <AccordionFoldButton
96
95
  label={label}
97
96
  labelIcon={labelIcon}
98
97
  labelIconBgVersion={labelIconBgVersion}
@@ -1,6 +1,12 @@
1
1
  import { type LabelProps } from '../../model/HeadlineType';
2
2
  import { type UniBlockContent } from '../../model/JSXBlock';
3
3
 
4
+ /**
5
+ * @title Вид кнопки сворачивания
6
+ * @enumNames ["Основная", "Аккордион"]
7
+ */
8
+ export type FoldButtonVersion = 'default' | 'accordion';
9
+
4
10
  /**
5
11
  * @title Сворачивающаяся секция
6
12
  */
@@ -10,4 +16,5 @@ export type RollupItemContent = UniBlockContent &
10
16
  isExpanded?: boolean;
11
17
  /** @title Кнопка сверху */
12
18
  isFoldButtonOnTop?: boolean;
19
+ foldButtonVersion?: FoldButtonVersion;
13
20
  };
@@ -137,19 +137,23 @@ export default {
137
137
  />
138
138
  </div>
139
139
  ),
140
+
140
141
  rollup: (
141
142
  <div className="container grid grid-cols-12">
142
143
  <VerticalLayout
144
+ gap="XS"
145
+ version="transparent"
143
146
  className="col-span-12"
144
- version="primary"
145
- isPadding={true}
146
147
  block={{
147
148
  type: 'VerticalLayout',
148
149
  blocks: [
149
150
  {
150
151
  type: 'RollupItem',
151
152
  content: {
152
- label: 'Rollup button 1',
153
+ label: 'Rollup button 1 with TEXT_BLOCK',
154
+ foldButtonVersion: 'default',
155
+ isFoldButtonOnTop: false,
156
+ isExpanded: true,
153
157
  },
154
158
  blocks: [
155
159
  { type: 'TextBlock', content: TEXT_BLOCK },
@@ -159,22 +163,14 @@ export default {
159
163
  {
160
164
  type: 'RollupItem',
161
165
  content: {
162
- label: 'Rollup button 2',
163
- isExpanded: true,
164
- },
165
- blocks: [{ type: 'LinkDocs', content: linkDocsExample }],
166
- },
167
- {
168
- type: 'RollupItem',
169
- content: {
170
- label: 'Rollup button 3 RichText',
166
+ label: 'Rollup button 2 with TEXT_BLOCK',
167
+ foldButtonVersion: 'default',
168
+ isFoldButtonOnTop: false,
171
169
  isExpanded: true,
172
170
  },
173
171
  blocks: [
174
- {
175
- type: 'RichTextBlock',
176
- content: RICH_TEXT_SEPARATOR,
177
- },
172
+ { type: 'TextBlock', content: TEXT_BLOCK },
173
+ { type: 'TextBlock', content: TEXT_BLOCK },
178
174
  ],
179
175
  },
180
176
  ],
@@ -183,22 +179,19 @@ export default {
183
179
  />
184
180
  </div>
185
181
  ),
186
- 'rollup secondary': (
182
+ 'rollup accordion': (
187
183
  <div className="container grid grid-cols-12">
188
184
  <VerticalLayout
189
- gap="XS"
190
- version="transparent"
191
185
  className="col-span-12"
186
+ version="primary"
187
+ isPadding={true}
192
188
  block={{
193
189
  type: 'VerticalLayout',
194
190
  blocks: [
195
191
  {
196
192
  type: 'RollupItem',
197
193
  content: {
198
- label: 'Rollup button 1 with TEXT_BLOCK',
199
- version: 'secondary',
200
- isFoldButtonOnTop: false,
201
- isExpanded: true,
194
+ label: 'Rollup button 1',
202
195
  },
203
196
  blocks: [
204
197
  { type: 'TextBlock', content: TEXT_BLOCK },
@@ -208,14 +201,22 @@ export default {
208
201
  {
209
202
  type: 'RollupItem',
210
203
  content: {
211
- label: 'Rollup button 2 with TEXT_BLOCK',
212
- version: 'secondary',
213
- isFoldButtonOnTop: false,
204
+ label: 'Rollup button 2',
205
+ isExpanded: true,
206
+ },
207
+ blocks: [{ type: 'LinkDocs', content: linkDocsExample }],
208
+ },
209
+ {
210
+ type: 'RollupItem',
211
+ content: {
212
+ label: 'Rollup button 3 RichText',
214
213
  isExpanded: true,
215
214
  },
216
215
  blocks: [
217
- { type: 'TextBlock', content: TEXT_BLOCK },
218
- { type: 'TextBlock', content: TEXT_BLOCK },
216
+ {
217
+ type: 'RichTextBlock',
218
+ content: RICH_TEXT_SEPARATOR,
219
+ },
219
220
  ],
220
221
  },
221
222
  ],
@@ -1,12 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.PrimaryFoldButton = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const Icon_1 = require("../../ui-kit/Icon/Icon");
6
- const Text_1 = require("../../ui-kit/Text/Text");
7
- const TextWithIcon_1 = require("../../ui-kit/TextWithIcon/TextWithIcon");
8
- const style_1 = require("../../utils/style");
9
- const renderRoundedIcon_1 = require("./renderRoundedIcon");
10
- const rollupIconVersion_1 = require("./rollupIconVersion");
11
- exports.PrimaryFoldButton = (0, uni_jsx_1.JSX)(({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => ((0, jsx_runtime_1.jsx)(TextWithIcon_1.TextWithIcon, { tag: "button", className: (0, style_1.style)('border-none bg-transparent items-center group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, textNode: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-start group-hover/button:text-primary-main gap-s", children: [(0, renderRoundedIcon_1.renderRoundedIcon)(labelIcon, labelIconBgVersion), label ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), iconNode: icon ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, iconVersion: rollupIconVersion_1.rollupIconVersion, width: "24", height: "24" }) : null })));
12
- //# sourceMappingURL=PrimaryFoldButton.js.map