@redneckz/wildless-cms-uni-blocks 0.2.30 → 0.2.32

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 (130) hide show
  1. package/dist/Blocks.d.ts +2 -3
  2. package/dist/Blocks.js +4 -6
  3. package/dist/Blocks.js.map +1 -1
  4. package/dist/ContentPage.js +4 -4
  5. package/dist/ContentPage.js.map +1 -1
  6. package/dist/ContentPageContext.d.ts +2 -0
  7. package/dist/Header/Header.d.ts +7 -0
  8. package/dist/Header/Header.js +24 -0
  9. package/dist/Header/Header.js.map +1 -0
  10. package/dist/Header/HeaderContent.d.ts +9 -0
  11. package/dist/Header/HeaderContent.js +2 -0
  12. package/dist/Header/HeaderContent.js.map +1 -0
  13. package/dist/Header/HeaderSecondaryMenu.d.ts +6 -0
  14. package/dist/Header/HeaderSecondaryMenu.js +11 -0
  15. package/dist/Header/HeaderSecondaryMenu.js.map +1 -0
  16. package/dist/Header/HeaderSecondaryMenuButton.d.ts +5 -0
  17. package/dist/Header/HeaderSecondaryMenuButton.js +6 -0
  18. package/dist/Header/HeaderSecondaryMenuButton.js.map +1 -0
  19. package/dist/Header/index.d.ts +3 -0
  20. package/dist/Header/index.js +5 -0
  21. package/dist/Header/index.js.map +1 -0
  22. package/dist/Header/isSubItemActive.d.ts +3 -0
  23. package/dist/Header/isSubItemActive.js +10 -0
  24. package/dist/Header/isSubItemActive.js.map +1 -0
  25. package/dist/Header/isTopItemActive.d.ts +3 -0
  26. package/dist/Header/isTopItemActive.js +14 -0
  27. package/dist/Header/isTopItemActive.js.map +1 -0
  28. package/dist/Header/mergeTopItems.d.ts +2 -0
  29. package/dist/Header/mergeTopItems.js +10 -0
  30. package/dist/Header/mergeTopItems.js.map +1 -0
  31. package/dist/Icons.d.ts +9 -0
  32. package/dist/Icons.js +16 -4
  33. package/dist/Icons.js.map +1 -1
  34. package/{lib/ProductBlock.d.ts → dist/ProductTile.d.ts} +5 -4
  35. package/dist/ProductTile.js +27 -0
  36. package/dist/ProductTile.js.map +1 -0
  37. package/dist/types.d.ts +6 -3
  38. package/dist/ui-kit/BlockItem.d.ts +3 -0
  39. package/dist/ui-kit/BlockItem.js +10 -2
  40. package/dist/ui-kit/BlockItem.js.map +1 -1
  41. package/dist/ui-kit/Button.d.ts +3 -2
  42. package/dist/ui-kit/Button.js +13 -5
  43. package/dist/ui-kit/Button.js.map +1 -1
  44. package/dist/ui-kit/HeaderItem.js +2 -3
  45. package/dist/ui-kit/HeaderItem.js.map +1 -1
  46. package/dist/ui-kit/Logo.js +1 -1
  47. package/dist/ui-kit/Logo.js.map +1 -1
  48. package/dist/ui-kit/SVG.d.ts +10 -4
  49. package/dist/ui-kit/SVG.js +2 -2
  50. package/dist/ui-kit/SVG.js.map +1 -1
  51. package/dist/ui-kit/TopItem.d.ts +1 -0
  52. package/dist/ui-kit/TopItem.js +4 -4
  53. package/dist/ui-kit/TopItem.js.map +1 -1
  54. package/dist/utils/url.d.ts +2 -0
  55. package/dist/utils/url.js +7 -0
  56. package/dist/utils/url.js.map +1 -0
  57. package/lib/Blocks.d.ts +2 -3
  58. package/lib/Blocks.js +3 -5
  59. package/lib/Blocks.js.map +1 -1
  60. package/lib/ContentPage.js +4 -4
  61. package/lib/ContentPage.js.map +1 -1
  62. package/lib/ContentPageContext.d.ts +2 -0
  63. package/lib/Header/Header.d.ts +7 -0
  64. package/lib/Header/Header.js +22 -0
  65. package/lib/Header/Header.js.map +1 -0
  66. package/lib/Header/HeaderContent.d.ts +9 -0
  67. package/lib/Header/HeaderContent.js +2 -0
  68. package/lib/Header/HeaderContent.js.map +1 -0
  69. package/lib/Header/HeaderSecondaryMenu.d.ts +6 -0
  70. package/lib/Header/HeaderSecondaryMenu.js +9 -0
  71. package/lib/Header/HeaderSecondaryMenu.js.map +1 -0
  72. package/lib/Header/HeaderSecondaryMenuButton.d.ts +5 -0
  73. package/lib/Header/HeaderSecondaryMenuButton.js +4 -0
  74. package/lib/Header/HeaderSecondaryMenuButton.js.map +1 -0
  75. package/lib/Header/index.d.ts +3 -0
  76. package/lib/Header/index.js +2 -0
  77. package/lib/Header/index.js.map +1 -0
  78. package/lib/Header/isSubItemActive.d.ts +3 -0
  79. package/lib/Header/isSubItemActive.js +7 -0
  80. package/lib/Header/isSubItemActive.js.map +1 -0
  81. package/lib/Header/isTopItemActive.d.ts +3 -0
  82. package/lib/Header/isTopItemActive.js +11 -0
  83. package/lib/Header/isTopItemActive.js.map +1 -0
  84. package/lib/Header/mergeTopItems.d.ts +2 -0
  85. package/lib/Header/mergeTopItems.js +7 -0
  86. package/lib/Header/mergeTopItems.js.map +1 -0
  87. package/lib/Icons.d.ts +9 -0
  88. package/lib/Icons.js +9 -3
  89. package/lib/Icons.js.map +1 -1
  90. package/{dist/ProductBlock.d.ts → lib/ProductTile.d.ts} +5 -4
  91. package/lib/ProductTile.js +25 -0
  92. package/lib/ProductTile.js.map +1 -0
  93. package/lib/common.css +1 -1
  94. package/lib/types.d.ts +6 -3
  95. package/lib/ui-kit/BlockItem.d.ts +3 -0
  96. package/lib/ui-kit/BlockItem.js +10 -2
  97. package/lib/ui-kit/BlockItem.js.map +1 -1
  98. package/lib/ui-kit/Button.d.ts +3 -2
  99. package/lib/ui-kit/Button.js +13 -5
  100. package/lib/ui-kit/Button.js.map +1 -1
  101. package/lib/ui-kit/HeaderItem.js +3 -4
  102. package/lib/ui-kit/HeaderItem.js.map +1 -1
  103. package/lib/ui-kit/Logo.js +1 -1
  104. package/lib/ui-kit/Logo.js.map +1 -1
  105. package/lib/ui-kit/SVG.d.ts +10 -4
  106. package/lib/ui-kit/SVG.js +2 -2
  107. package/lib/ui-kit/SVG.js.map +1 -1
  108. package/lib/ui-kit/TopItem.d.ts +1 -0
  109. package/lib/ui-kit/TopItem.js +4 -4
  110. package/lib/ui-kit/TopItem.js.map +1 -1
  111. package/lib/utils/url.d.ts +2 -0
  112. package/lib/utils/url.js +3 -0
  113. package/lib/utils/url.js.map +1 -0
  114. package/package.json +9 -2
  115. package/dist/Header.d.ts +0 -15
  116. package/dist/Header.js +0 -33
  117. package/dist/Header.js.map +0 -1
  118. package/dist/ProductBlock.js +0 -27
  119. package/dist/ProductBlock.js.map +0 -1
  120. package/dist/ProductColumnBlock.d.ts +0 -13
  121. package/dist/ProductColumnBlock.js +0 -11
  122. package/dist/ProductColumnBlock.js.map +0 -1
  123. package/lib/Header.d.ts +0 -15
  124. package/lib/Header.js +0 -31
  125. package/lib/Header.js.map +0 -1
  126. package/lib/ProductBlock.js +0 -25
  127. package/lib/ProductBlock.js.map +0 -1
  128. package/lib/ProductColumnBlock.d.ts +0 -13
  129. package/lib/ProductColumnBlock.js +0 -9
  130. package/lib/ProductColumnBlock.js.map +0 -1
@@ -1,11 +1,17 @@
1
- interface SVGPath {
2
- d: string;
1
+ interface SVGPathOptions {
3
2
  fill?: string;
3
+ stroke?: string;
4
+ strokeLinecap?: string;
5
+ strokeLinejoin?: string;
6
+ strokeWidth?: string;
7
+ strokeMiterlimit?: string;
8
+ }
9
+ interface SVGPath extends SVGPathOptions {
10
+ d: string;
4
11
  }
5
- export interface SVGProps {
12
+ export interface SVGProps extends SVGPathOptions {
6
13
  className?: string;
7
14
  viewBox?: string;
8
- fill?: string;
9
15
  paths: SVGPath[];
10
16
  }
11
17
  export declare const SVG: (props: import("@redneckz/uni-jsx").PropsWithChildren<SVGProps, any>, context?: any) => any;
@@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.SVG = void 0;
3
3
  const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- exports.SVG = (0, uni_jsx_1.JSX)(({ className, viewBox, fill = 'none', paths }) => {
6
- return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, children: paths.map(({ d, fill }, i) => (0, jsx_runtime_1.jsx)("path", { d: d, fill: fill || 'currentColor' }, i)) }));
5
+ exports.SVG = (0, uni_jsx_1.JSX)(({ className, viewBox, fill = 'none', paths, ...commonOptions }) => {
6
+ return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, children: paths.map(({ d, fill, ...options }, i) => ((0, jsx_runtime_1.jsx)("path", { d: d, fill: fill || 'currentColor', ...commonOptions, ...options }, i))) }));
7
7
  });
8
8
  //# sourceMappingURL=SVG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SVG.js","sourceRoot":"","sources":["../../src/ui-kit/SVG.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAc3B,QAAA,GAAG,GAAG,IAAA,aAAG,EAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;IAChF,OAAO,CACL,gCAAK,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,YACvF,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iCAAc,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,cAAc,IAArC,CAAC,CAAwC,CAAC,GAChF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"SVG.js","sourceRoot":"","sources":["../../src/ui-kit/SVG.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAqB3B,QAAA,GAAG,GAAG,IAAA,aAAG,EACpB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,EAAE,EAAE,EAAE;IACjE,OAAO,CACL,gCAAK,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,YACvF,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CACzC,iCAAc,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,cAAc,KAAM,aAAa,KAAM,OAAO,IAArE,CAAC,CAAwE,CACrF,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -4,6 +4,7 @@ export interface TopItemContent extends LinkContent {
4
4
  }
5
5
  export interface TopItemProps extends TopItemContent {
6
6
  className?: string;
7
+ flat?: boolean;
7
8
  onClick?: (ev: MouseEvent) => any;
8
9
  }
9
10
  export declare const TopItem: (props: import("@redneckz/uni-jsx").PropsWithChildren<TopItemProps, any>, context?: any) => any;
@@ -2,9 +2,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.TopItem = void 0;
3
3
  const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- exports.TopItem = (0, uni_jsx_1.JSX)(({ className, text, href, target, active, onClick, children }) => {
6
- const linkStyle = active ? 'border-brand rounded-3xl' : 'border-transparent';
7
- const textStyle = active ? 'text-brand' : 'text-black hover:text-brand';
8
- return ((0, jsx_runtime_1.jsx)("a", { className: `${linkStyle} border border-solid inline-block bg-transparent px-4 py-2 text-center font-sans no-underline ${className || ''}`, href: href, target: target, onClick: onClick, children: (0, jsx_runtime_1.jsx)("span", { className: `${textStyle} text-base font-normal`, children: text || children }) }));
5
+ exports.TopItem = (0, uni_jsx_1.JSX)(({ className, text, href, target, active, flat, onClick, children }) => {
6
+ const linkStyle = active ? 'border-primary-main rounded-3xl' : 'border-transparent';
7
+ const textStyle = active ? 'text-primary-main' : 'text-primary-text hover:text-primary-main';
8
+ return ((0, jsx_runtime_1.jsx)("a", { className: `inline-block border border-solid bg-transparent text-center no-underline ${flat ? '' : 'px-4 py-2'} ${linkStyle} ${className || ''}`, href: href, target: target, onClick: onClick, children: (0, jsx_runtime_1.jsx)("span", { className: `font-sans font-normal text-sm ${textStyle}`, children: text || children }) }));
9
9
  });
10
10
  //# sourceMappingURL=TopItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopItem.js","sourceRoot":"","sources":["../../src/ui-kit/TopItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAY3B,QAAA,OAAO,GAAG,IAAA,aAAG,EACxB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/D,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAC7E,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,6BAA6B,CAAC;IACxE,OAAO,CACL,8BACE,SAAS,EAAE,GAAG,SAAS,iGACrB,SAAS,IAAI,EACf,EAAE,EACF,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,YAEhB,iCAAM,SAAS,EAAE,GAAG,SAAS,wBAAwB,YAAG,IAAI,IAAI,QAAQ,GAAQ,GAC9E,CACL,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"TopItem.js","sourceRoot":"","sources":["../../src/ui-kit/TopItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAa3B,QAAA,OAAO,GAAG,IAAA,aAAG,EACxB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IACrE,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,oBAAoB,CAAC;IACpF,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,2CAA2C,CAAC;IAC7F,OAAO,CACL,8BACE,SAAS,EAAE,4EACT,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WACd,IAAI,SAAS,IAAI,SAAS,IAAI,EAAE,EAAE,EAClC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,YAEhB,iCAAM,SAAS,EAAE,iCAAiC,SAAS,EAAE,YAAG,IAAI,IAAI,QAAQ,GAAQ,GACtF,CACL,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const isURL: (href?: string | undefined) => boolean | undefined;
2
+ export declare const withoutQuery: (href?: string | undefined) => string;
@@ -0,0 +1,7 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.withoutQuery = exports.isURL = void 0;
3
+ const isURL = (href) => href?.includes('//');
4
+ exports.isURL = isURL;
5
+ const withoutQuery = (href) => (href || '').replace(/\/?\?.*/, '');
6
+ exports.withoutQuery = withoutQuery;
7
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":";;AAAO,MAAM,KAAK,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AAAhD,QAAA,KAAK,SAA2C;AAEtD,MAAM,YAAY,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAAtE,QAAA,YAAY,gBAA0D"}
package/lib/Blocks.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  export declare const Blocks: {
2
- Header: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Header").HeaderProps, any>, context?: any) => any;
3
- ProductColumnBlock: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ProductColumnBlock").ProductColumnBlockProps, any>, context?: any) => any;
2
+ Header: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Header/Header").HeaderProps, any>, context?: any) => any;
4
3
  Text: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Text").TextProps, any>, context?: any) => any;
5
4
  TextWithImage: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./TextWithImage").TextWithImageProps, any>, context?: any) => any;
6
5
  RichText: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./RichText").RichTextProps, any>, context?: any) => any;
7
6
  Placeholder: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Placeholder").PlaceholderProps, any>, context?: any) => any;
8
- ProductBlock: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ProductBlock").ProductBlockProps, any>, context?: any) => any;
7
+ ProductTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ProductTile").ProductTileProps, any>, context?: any) => any;
9
8
  };
package/lib/Blocks.js CHANGED
@@ -1,17 +1,15 @@
1
- import { Header } from './Header.js';
1
+ import { Header } from './Header/index.js';
2
2
  import { Placeholder } from './Placeholder.js';
3
- import { ProductColumnBlock } from './ProductColumnBlock.js';
4
3
  import { RichText } from './RichText.js';
5
4
  import { Text } from './Text.js';
6
5
  import { TextWithImage } from './TextWithImage.js';
7
- import { ProductBlock } from './ProductBlock.js';
6
+ import { ProductTile } from './ProductTile.js';
8
7
  export const Blocks = {
9
8
  Header,
10
- ProductColumnBlock,
11
9
  Text,
12
10
  TextWithImage,
13
11
  RichText,
14
12
  Placeholder,
15
- ProductBlock,
13
+ ProductTile,
16
14
  };
17
15
  //# sourceMappingURL=Blocks.js.map
package/lib/Blocks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../src/Blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM;IACN,kBAAkB;IAClB,IAAI;IACJ,aAAa;IACb,QAAQ;IACR,WAAW;IACX,YAAY;CACb,CAAC"}
1
+ {"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../src/Blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM;IACN,IAAI;IACJ,aAAa;IACb,QAAQ;IACR,WAAW;IACX,WAAW;CACZ,CAAC"}
@@ -3,8 +3,8 @@ import { JSX } from '@redneckz/uni-jsx';
3
3
  import { Blocks } from './Blocks.js';
4
4
  import { LikeControl } from './LikeControl.js';
5
5
  const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
6
- export const ContentPage = JSX(({ className, data: { style: pageStyle, blocks, likeControl }, context, blockDecorator = defaultBlockDecorator, }) => {
7
- return (_jsxs("section", { className: "relative", children: [_jsx("div", { className: `grid grid-cols-12 ${style2className(pageStyle)} ${className}`, children: blocks?.length ? blocks.map(renderBlock) : null }), likeControl && (_jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: _jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
6
+ export const ContentPage = JSX(({ className, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, context, blockDecorator = defaultBlockDecorator, }) => {
7
+ return (_jsxs("section", { className: "relative", "data-theme": colorPalette, children: [_jsx("div", { className: `grid grid-cols-12 ${style2className(pageStyle)} ${className}`, children: blocks?.length ? blocks.map(renderBlock) : null }), likeControl && (_jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: _jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
8
8
  function renderBlock(block, i) {
9
9
  const { type } = block;
10
10
  if (!(type in Blocks)) {
@@ -16,8 +16,8 @@ export const ContentPage = JSX(({ className, data: { style: pageStyle, blocks, l
16
16
  blockClassName: style2className(block.style),
17
17
  block,
18
18
  render: (props) => {
19
- const { content, blocks } = props.block;
20
- return (_jsx(BlockComponent, { className: props.blockClassName, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
19
+ const { version, content, blocks } = props.block;
20
+ return (_jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
21
21
  },
22
22
  });
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAmB5C,MAAM,qBAAqB,GAAmB,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAClF,MAAM,CAAC,EA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AAC,WAAW,IACV,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAO,GAChB,GACE,CACP,IACO,CACX,CAAC;IAEF,SAAS,WAAW,CAAC,KAAe,EAAE,CAAS;QAC7C,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,iBAAiB,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC;SACb;QAED,MAAM,cAAc,GAAG,MAAM,CAAC,IAA2B,CAAC,CAAC;QAC3D,OAAO,cAAc,CAAC;YACpB,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC;YAC5C,KAAK;YACL,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;gBACjD,OAAO,CACL,KAAC,cAAc,IAEb,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,KACZ,OAAO,YAEV,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAN3C,GAAG,IAAI,IAAI,CAAC,EAAE,CAOJ,CAClB,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CACF,CAAC;AAEF,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { HeaderContent } from './Header';
1
2
  export interface Router {
2
3
  pathname: string;
3
4
  query: Record<string, string | string[] | undefined>;
@@ -12,6 +13,7 @@ export interface LikeService {
12
13
  }
13
14
  export interface ContentPageContext {
14
15
  useRouter: () => Router;
16
+ useSitemap: () => HeaderContent;
15
17
  useLikeService: () => LikeService;
16
18
  handlerDecorator?: <F extends Function>(handler: F) => F;
17
19
  }
@@ -0,0 +1,7 @@
1
+ import type { ContentPageContext } from '../ContentPageContext';
2
+ import type { HeaderContent } from './HeaderContent';
3
+ export interface HeaderProps extends HeaderContent {
4
+ className?: string;
5
+ context: ContentPageContext;
6
+ }
7
+ export declare const Header: (props: import("@redneckz/uni-jsx").PropsWithChildren<HeaderProps, any>, context?: any) => any;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ import { HeaderItem } from '../ui-kit/HeaderItem.js';
4
+ import { Logo } from '../ui-kit/Logo.js';
5
+ import { TopItem } from '../ui-kit/TopItem.js';
6
+ import { useLink } from '../useLink.js';
7
+ import { HeaderSecondaryMenu } from './HeaderSecondaryMenu.js';
8
+ import { isSubItemActive } from './isSubItemActive.js';
9
+ import { isTopItemActive } from './isTopItemActive.js';
10
+ import { mergeTopItems } from './mergeTopItems.js';
11
+ export const Header = JSX(({ className, location, context, topItems }) => {
12
+ const router = context.useRouter();
13
+ const sitemap = context.useSitemap();
14
+ const mergedItems = mergeTopItems(sitemap.topItems, topItems);
15
+ const activeTopItem = mergedItems.find(isTopItemActive(router));
16
+ const subItems = activeTopItem?.items;
17
+ const activeSubItem = subItems?.find(isSubItemActive(router));
18
+ const topMenu = mergedItems.map((_, i) => (_jsx(TopItem, { active: _ === activeTopItem, ...useLink(context, _) }, String(i))));
19
+ const subMenu = subItems?.map((_) => (_jsx(HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...useLink(context, _) }, _.href)));
20
+ return (_jsxs("div", { className: `pt-5 pb-8 px-20 bg-white rounded-bl-3xl rounded-br-3xl ${className || ''}`, children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Logo, { className: "mr-8" }), topMenu, _jsx(HeaderSecondaryMenu, { location: location, className: "ml-auto" })] }), _jsx("div", { className: "mt-5 h-[1px] bg-main-divider" }), _jsx("div", { className: "mt-5", children: subMenu })] }));
21
+ });
22
+ //# sourceMappingURL=Header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOhD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpF,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAErC,MAAM,WAAW,GAAG,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,aAAa,EAAE,KAAK,CAAC;IACtC,MAAM,aAAa,GAAG,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9D,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACxC,KAAC,OAAO,IAAiB,MAAM,EAAE,CAAC,KAAK,aAAa,KAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAA/D,MAAM,CAAC,CAAC,CAAC,CAA0D,CAClF,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACnC,KAAC,UAAU,IAET,SAAS,EAAC,MAAM,EAChB,MAAM,EAAE,CAAC,KAAK,aAAa,KACvB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAHlB,CAAC,CAAC,IAAI,CAIX,CACH,CAAC,CAAC;IAEH,OAAO,CACL,eAAK,SAAS,EAAE,0DAA0D,SAAS,IAAI,EAAE,EAAE,aACzF,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,GAAG,EACxB,OAAO,EACR,KAAC,mBAAmB,IAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,SAAS,GAAG,IAC3D,EACN,cAAK,SAAS,EAAC,8BAA8B,GAAG,EAChD,cAAK,SAAS,EAAC,MAAM,YAAE,OAAO,GAAO,IACjC,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { LinkContent } from '../ui-kit/Link';
2
+ export declare type HeaderMenuItem = LinkContent;
3
+ export interface TopMenuItem extends HeaderMenuItem {
4
+ items?: HeaderMenuItem[];
5
+ }
6
+ export interface HeaderContent {
7
+ location?: string;
8
+ topItems?: TopMenuItem[];
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HeaderContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderContent.js","sourceRoot":"","sources":["../../src/Header/HeaderContent.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ interface HeaderSecondaryMenuProps {
2
+ location?: string;
3
+ className?: string;
4
+ }
5
+ export declare const HeaderSecondaryMenu: (props: import("@redneckz/uni-jsx").PropsWithChildren<HeaderSecondaryMenuProps, any>, context?: any) => any;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ import { GridIcon, LoupeIcon, ProfileIcon } from '../Icons.js';
4
+ import { TopItem } from '../ui-kit/TopItem.js';
5
+ import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton.js';
6
+ export const HeaderSecondaryMenu = JSX(({ location, className }) => {
7
+ return (_jsxs("div", { className: `flex items-center ${className || ''}`, children: [_jsx(TopItem, { className: "mr-5", flat: true, href: "#", text: location }), _jsx(TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B" }), _jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", children: LoupeIcon() }), _jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", children: ProfileIcon() }), _jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-main hover:text-secondary-hover w-[32px]", children: GridIcon() })] }));
8
+ });
9
+ //# sourceMappingURL=HeaderSecondaryMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderSecondaryMenu.js","sourceRoot":"","sources":["../../src/Header/HeaderSecondaryMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAOxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAA2B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IAC3F,OAAO,CACL,eAAK,SAAS,EAAE,qBAAqB,SAAS,IAAI,EAAE,EAAE,aACpD,KAAC,OAAO,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAE,QAAQ,GAAI,EACjE,KAAC,OAAO,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,8FAAmB,GAAG,EAC1E,KAAC,yBAAyB,IAAC,SAAS,EAAC,gDAAgD,YAClF,SAAS,EAAE,GACc,EAC5B,KAAC,yBAAyB,IAAC,SAAS,EAAC,gDAAgD,YAClF,WAAW,EAAE,GACY,EAC5B,KAAC,yBAAyB,IAAC,SAAS,EAAC,oDAAoD,YACtF,QAAQ,EAAE,GACe,IACxB,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ interface HeaderSecondaryMenuButtonProps {
2
+ className?: string;
3
+ }
4
+ export declare const HeaderSecondaryMenuButton: (props: import("@redneckz/uni-jsx").PropsWithChildren<HeaderSecondaryMenuButtonProps, any>, context?: any) => any;
5
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ export const HeaderSecondaryMenuButton = JSX(({ className, children }) => (_jsx("button", { type: "button", className: `border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${className || ''}`, disabled: true, children: children })));
4
+ //# sourceMappingURL=HeaderSecondaryMenuButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderSecondaryMenuButton.js","sourceRoot":"","sources":["../../src/Header/HeaderSecondaryMenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAMxC,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAC1C,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC3B,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,qEACT,SAAS,IAAI,EACf,EAAE,EACF,QAAQ,EAAE,IAAI,YAEb,QAAQ,GACF,CACV,CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Header } from './Header';
2
+ export type { HeaderProps } from './Header';
3
+ export type { HeaderContent } from './HeaderContent';
@@ -0,0 +1,2 @@
1
+ export { Header } from './Header.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Router } from '../ContentPageContext';
2
+ import type { LinkContent } from '../ui-kit/Link';
3
+ export declare function isSubItemActive({ href, pathname }: Router): (item: LinkContent) => boolean;
@@ -0,0 +1,7 @@
1
+ import { isURL, withoutQuery } from '../utils/url.js';
2
+ export function isSubItemActive({ href, pathname }) {
3
+ return (item) => {
4
+ return withoutQuery(item.href) === (isURL(item.href) ? withoutQuery(href) : pathname);
5
+ };
6
+ }
7
+ //# sourceMappingURL=isSubItemActive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSubItemActive.js","sourceRoot":"","sources":["../../src/Header/isSubItemActive.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAU;IACxD,OAAO,CAAC,IAAiB,EAAW,EAAE;QACpC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxF,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Router } from '../ContentPageContext';
2
+ import type { LinkContent } from '../ui-kit/Link';
3
+ export declare function isTopItemActive({ href, pathname }: Router): (item: LinkContent) => boolean;
@@ -0,0 +1,11 @@
1
+ import { isURL, withoutQuery } from '../utils/url.js';
2
+ export function isTopItemActive({ href, pathname }) {
3
+ return (item) => {
4
+ const itemHref = withoutQuery(item.href);
5
+ if (isURL(itemHref)) {
6
+ return Boolean(href && href.startsWith(itemHref));
7
+ }
8
+ return Boolean(itemHref && pathname.startsWith(itemHref));
9
+ };
10
+ }
11
+ //# sourceMappingURL=isTopItemActive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isTopItemActive.js","sourceRoot":"","sources":["../../src/Header/isTopItemActive.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAU;IACxD,OAAO,CAAC,IAAiB,EAAW,EAAE;QACpC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE;YACnB,OAAO,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;SACnD;QACD,OAAO,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { TopMenuItem } from './HeaderContent';
2
+ export declare function mergeTopItems(left?: TopMenuItem[], right?: TopMenuItem[]): TopMenuItem[];
@@ -0,0 +1,7 @@
1
+ const cmp = (a) => (b) => a?.href === b?.href;
2
+ const substitute = (items, substitution) => (items || []).map((_) => substitution?.find(cmp(_)) || _);
3
+ const subtract = (minuend, subtrahend) => (minuend || []).filter((_) => !subtrahend?.find(cmp(_)));
4
+ export function mergeTopItems(left, right) {
5
+ return substitute(left, right).concat(subtract(right, left));
6
+ }
7
+ //# sourceMappingURL=mergeTopItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeTopItems.js","sourceRoot":"","sources":["../../src/Header/mergeTopItems.ts"],"names":[],"mappings":"AAEA,MAAM,GAAG,GAAG,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,EAAE,IAAI,CAAC;AAE1E,MAAM,UAAU,GAAG,CAAC,KAAqB,EAAE,YAA4B,EAAE,EAAE,CACzE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAE5D,MAAM,QAAQ,GAAG,CAAC,OAAuB,EAAE,UAA0B,EAAE,EAAE,CACvE,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D,MAAM,UAAU,aAAa,CAAC,IAAoB,EAAE,KAAqB;IACvE,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC"}
package/lib/Icons.d.ts CHANGED
@@ -1,5 +1,14 @@
1
+ export declare const CalendarIcon: () => any;
2
+ export declare const EmptyWalletIcon: () => any;
3
+ export declare const PercentageSquareIcon: () => any;
4
+ export declare const LoupeIcon: () => any;
5
+ export declare const ProfileIcon: () => any;
6
+ export declare const GridIcon: () => any;
1
7
  export declare const Icons: {
2
8
  EmptyWalletIcon: () => any;
3
9
  PercentageSquareIcon: () => any;
4
10
  CalendarIcon: () => any;
11
+ LoupeIcon: () => any;
12
+ ProfileIcon: () => any;
13
+ GridIcon: () => any;
5
14
  };
package/lib/Icons.js CHANGED
@@ -1,10 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- const CalendarIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("path", { stroke: "#1C1C1C", strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: "10", strokeWidth: "2", d: "M8 2v3M16 2v3M3.5 9.09h17M3 13.01V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5" }), _jsx("path", { stroke: "#42AB44", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "3", d: "M15.991 13h.018M15.991 17.006h.018M11.991 13h.018M11.991 17.006h.018M7.991 13h.018M7.991 17.006h.018" })] }));
3
- const EmptyWalletIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("path", { stroke: "#292D32", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.5 14.07v-2.56c0-2.07 1.69-3.76 3.76-3.76h11.48c2.07 0 3.76 1.69 3.76 3.76v1.44h-2.02c-.56 0-1.07.22-1.44.6-.42.41-.66 1-.6 1.63.09 1.08 1.08 1.87 2.16 1.87h1.9v1.19c0 2.07-1.69 3.76-3.76 3.76H6.26c-2.07 0-3.76-1.69-3.76-3.76M12.28 2.17a1.9 1.9 0 0 1 2.57 1.78v3.8" }), _jsx("path", { stroke: "#292D32", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.5 12.41V7.84c0-1.19.73-2.25 1.84-2.67l3.97-1.5M22.56 13.97v2.06c0 .55-.44 1-1 1.02H19.6c-1.08 0-2.07-.79-2.16-1.87-.06-.63.18-1.22.6-1.63.37-.38.88-.6 1.44-.6h2.08c.56.02 1 .47 1 1.02Z" }), _jsx("path", { stroke: "#42AB44", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M7 12h7" })] }));
4
- const PercentageSquareIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("path", { stroke: "#1C1C1C", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2 13.05V15c0 5 2 7 7 7h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9" }), _jsx("path", { stroke: "#42AB44", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m8.32 15.27 6.54-6.54M8.73 10.37a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46ZM15.27 16.09a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46Z" })] }));
2
+ export const CalendarIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("path", { stroke: "#1C1C1C", strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: "10", strokeWidth: "2", d: "M8 2v3M16 2v3M3.5 9.09h17M3 13.01V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5" }), _jsx("path", { stroke: "#42AB44", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "3", d: "M15.991 13h.018M15.991 17.006h.018M11.991 13h.018M11.991 17.006h.018M7.991 13h.018M7.991 17.006h.018" })] }));
3
+ export const EmptyWalletIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("path", { stroke: "#292D32", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.5 14.07v-2.56c0-2.07 1.69-3.76 3.76-3.76h11.48c2.07 0 3.76 1.69 3.76 3.76v1.44h-2.02c-.56 0-1.07.22-1.44.6-.42.41-.66 1-.6 1.63.09 1.08 1.08 1.87 2.16 1.87h1.9v1.19c0 2.07-1.69 3.76-3.76 3.76H6.26c-2.07 0-3.76-1.69-3.76-3.76M12.28 2.17a1.9 1.9 0 0 1 2.57 1.78v3.8" }), _jsx("path", { stroke: "#292D32", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.5 12.41V7.84c0-1.19.73-2.25 1.84-2.67l3.97-1.5M22.56 13.97v2.06c0 .55-.44 1-1 1.02H19.6c-1.08 0-2.07-.79-2.16-1.87-.06-.63.18-1.22.6-1.63.37-.38.88-.6 1.44-.6h2.08c.56.02 1 .47 1 1.02Z" }), _jsx("path", { stroke: "#42AB44", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M7 12h7" })] }));
4
+ export const PercentageSquareIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("path", { stroke: "#1C1C1C", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2 13.05V15c0 5 2 7 7 7h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9" }), _jsx("path", { stroke: "#42AB44", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m8.32 15.27 6.54-6.54M8.73 10.37a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46ZM15.27 16.09a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46Z" })] }));
5
+ export const LoupeIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M19.5 20.5 16 17a7.5 7.5 0 1 1 2.376-3" }) }));
6
+ export const ProfileIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M14.94 8.54c.22.44.35.94.35 1.47-.01 1.77-1.4 3.22-3.16 3.27a.963.963 0 0 0-.24 0 3.269 3.269 0 0 1-3.16-3.27c0-1.81 1.46-3.28 3.28-3.28M18.74 19.88A9.934 9.934 0 0 1 12 22.5c-2.6 0-4.96-.99-6.74-2.62.1-.94.7-1.86 1.77-2.58 2.74-1.82 7.22-1.82 9.94 0 1.07.72 1.67 1.64 1.77 2.58Z" }), _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M4 6.5c-1.25 1.67-2 3.75-2 6 0 5.52 4.48 10 10 10s10-4.48 10-10-4.48-10-10-10c-1.43 0-2.8.3-4.03.85" })] }));
7
+ export const GridIcon = () => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", children: [_jsx("rect", { y: ".5", width: "32", height: "32", rx: "16", fill: "currentColor" }), _jsx("path", { fill: "#1c1c1c", d: "M13 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM13 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM11.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM16.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 21.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 13a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM23 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" })] }));
5
8
  export const Icons = {
6
9
  EmptyWalletIcon,
7
10
  PercentageSquareIcon,
8
11
  CalendarIcon,
12
+ LoupeIcon,
13
+ ProfileIcon,
14
+ GridIcon,
9
15
  };
10
16
  //# sourceMappingURL=Icons.js.map
package/lib/Icons.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../src/Icons.tsx"],"names":[],"mappings":";AAAA,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,CACzB,eAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,aACrE,eACE,MAAM,EAAC,SAAS,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,gBAAgB,EAAC,IAAI,EACrB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,uGAAuG,GACzG,EACF,eACE,MAAM,EAAC,SAAS,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,sGAAsG,GACxG,IACE,CACP,CAAC;AACF,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,CAC5B,eAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,aACrE,eACE,MAAM,EAAC,SAAS,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,4QAA4Q,GAC9Q,EACF,eACE,MAAM,EAAC,SAAS,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,6LAA6L,GAC/L,EACF,eACE,MAAM,EAAC,SAAS,EAChB,aAAa,EAA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,OAAO,EAAC,WAAW,aACrE,eACE,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,yRAAyR,GAC3R,EACF,eACE,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,qGAAqG,GACvG,IACE,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,CAC5B,eAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,aACrE,eAAM,CAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,IAAI,EAAC,cAAc,GAAG,EAClE,eACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,uZAAuZ,GACzZ,IACE,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,eAAe;IACf,oBAAoB;IACpB,YAAY;IACZ,SAAS;IACT,WAAW;IACX,QAAQ;CACT,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { ContentPageContext } from './ContentPageContext';
2
2
  import { Icons } from './Icons';
3
- import { Picture } from './types';
3
+ import { BlockVersion, Picture } from './types';
4
4
  import type { ButtonProps } from './ui-kit/Button';
5
5
  import { BreadcrumbProps } from './ui-kit/Breadcrumb';
6
6
  export interface Benefit {
@@ -8,7 +8,7 @@ export interface Benefit {
8
8
  description?: string;
9
9
  icon?: keyof typeof Icons;
10
10
  }
11
- export interface ProductBlockContent {
11
+ export interface ProductTileContent {
12
12
  title?: string;
13
13
  description?: string;
14
14
  breadcrumbs?: BreadcrumbProps[];
@@ -17,8 +17,9 @@ export interface ProductBlockContent {
17
17
  items?: string[];
18
18
  buttons?: ButtonProps[];
19
19
  }
20
- export interface ProductBlockProps extends ProductBlockContent {
20
+ export interface ProductTileProps extends ProductTileContent {
21
21
  className?: string;
22
+ version?: BlockVersion;
22
23
  context: ContentPageContext;
23
24
  }
24
- export declare const ProductBlock: (props: import("@redneckz/uni-jsx").PropsWithChildren<ProductBlockProps, any>, context?: any) => any;
25
+ export declare const ProductTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<ProductTileProps, any>, context?: any) => any;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ import { Icons } from './Icons.js';
4
+ import { Img } from './Img.js';
5
+ import { BlockItem } from './ui-kit/BlockItem.js';
6
+ import { Button } from './ui-kit/Button.js';
7
+ import { Breadcrumb } from './ui-kit/Breadcrumb.js';
8
+ import { useLink } from './useLink.js';
9
+ const productBlockStyleMap = {
10
+ primary: 'bg-white text-primary-text',
11
+ secondary: 'bg-brand text-white',
12
+ };
13
+ export const ProductTile = JSX(({ className, context, title, description, breadcrumbs, benefits, buttons, image, items, version = 'primary' }) => {
14
+ return (_jsxs("section", { className: `font-sans p-9 rounded-[40px] flex justify-between items-stretch relative ${className || ''} ${productBlockStyleMap[version]}`, children: [_jsxs("div", { className: "flex flex-col", children: [breadcrumbs?.length ? (_jsx("div", { className: "text-xs mb-6", children: join(_jsx("span", { className: "text-secondary mx-2", children: "/" }))(breadcrumbs.map((breadcrumb, i) => (_jsx(Breadcrumb, { ...useLink(context, { className: 'text-secondary', ...breadcrumb }) }, String(i))))) })) : null, title && (_jsx("h1", { className: "font-medium text-title m-0 whitespace-pre-wrap", children: title })), description && (_jsx("div", { className: "font-normal text-base max-w-[600px] mt-4", children: description })), benefits?.length ? (_jsx("div", { className: "flex gap-6 mt-7", children: benefits.map(renderBenefit) })) : null, items?.length ? (_jsx("section", { className: "space-y-2.5 mt-5", role: "list", children: items.map((_, i) => (_jsx(BlockItem, { text: _, version: version }, String(i)))) })) : null, buttons?.length ? (_jsx("div", { className: "flex mt-auto gap-4", children: buttons.map((button, index) => renderButton(button, index, context)) })) : null] }), image && _jsx(Img, { image: image, className: "absolute bottom-9 right-9" })] }));
15
+ });
16
+ function renderBenefit(benefit, i) {
17
+ return (_jsxs("div", { className: "flex gap-4 items-center", children: [benefit.icon && (_jsx("div", { className: "h-11 w-11 min-w-11 min-h-11 bg-main rounded-full p-[10px] box-border", children: Icons[benefit.icon]() })), _jsxs("div", { className: "flex gap-1 flex-col h-full", children: [_jsx("h4", { className: "font-medium text-xl m-0", children: benefit.label }), benefit.description && (_jsx("div", { className: "font-normal text-sm text-secondary", children: benefit.description }))] })] }, String(i)));
18
+ }
19
+ function renderButton(button, i, context) {
20
+ return button?.text ? (_jsx(Button, { ...useLink(context, button), className: "mt-8", version: button.version }, String(i))) : null;
21
+ }
22
+ function join(sep) {
23
+ return (list) => list.reduce((acc, el) => (acc.length ? acc.concat(sep, el) : [el]), []);
24
+ }
25
+ //# sourceMappingURL=ProductTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../src/ProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,MAAM,oBAAoB,GAAiC;IACzD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,qBAAqB;CACjC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAmB,CAAC,EAAE,SAAS,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,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAC1B,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EACtD,EAAS,CACV,CAAC;AACJ,CAAC"}
package/lib/common.css CHANGED
@@ -1 +1 @@
1
- .pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.top-4{top:1rem}.right-4{right:1rem}.bottom-0{bottom:0}.right-0{right:0}.col-auto{grid-column:auto}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-6{grid-column:span 6/span 6}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-9{grid-column:span 9/span 9}.col-span-10{grid-column:span 10/span 10}.col-span-11{grid-column:span 11/span 11}.col-span-12{grid-column:span 12/span 12}.col-span-full{grid-column:1/-1}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.col-start-5{grid-column-start:5}.col-start-6{grid-column-start:6}.col-start-7{grid-column-start:7}.col-start-8{grid-column-start:8}.col-start-9{grid-column-start:9}.col-start-10{grid-column-start:10}.col-start-11{grid-column-start:11}.col-start-12{grid-column-start:12}.col-start-13{grid-column-start:13}.col-start-auto{grid-column-start:auto}.col-end-1{grid-column-end:1}.col-end-2{grid-column-end:2}.col-end-3{grid-column-end:3}.col-end-4{grid-column-end:4}.col-end-5{grid-column-end:5}.col-end-6{grid-column-end:6}.col-end-7{grid-column-end:7}.col-end-8{grid-column-end:8}.col-end-9{grid-column-end:9}.col-end-10{grid-column-end:10}.col-end-11{grid-column-end:11}.col-end-12{grid-column-end:12}.col-end-13{grid-column-end:13}.col-end-auto{grid-column-end:auto}.m-0{margin:0}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mr-8{margin-right:2rem}.mt-10{margin-top:2.5rem}.mb-6{margin-bottom:1.5rem}.mt-4{margin-top:1rem}.mt-7{margin-top:1.75rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-8{margin-top:2rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.ml-2\.5{margin-left:.625rem}.ml-2{margin-left:.5rem}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-8{height:2rem}.h-full{height:100%}.h-11{height:2.75rem}.h-\[2px\]{height:2px}.min-h-11{min-height:2.75rem}.w-full{width:100%}.w-8{width:2rem}.w-\[125px\]{width:125px}.w-11{width:2.75rem}.w-\[36px\]{width:36px}.w-10{width:2.5rem}.min-w-11{min-width:2.75rem}.min-w-\[7px\]{min-width:7px}.max-w-\[600px\]{max-width:600px}.rotate-180{--tw-rotate:180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.resize{resize:both}.grid-flow-col-dense{grid-auto-flow:column dense}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-5{gap:1.25rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.gap-4{gap:1rem}.gap-1{gap:.25rem}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-\[40px\]{border-radius:40px}.rounded-3xl{border-radius:1.5rem}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-bl-3xl{border-bottom-left-radius:1.5rem}.rounded-br-3xl{border-bottom-right-radius:1.5rem}.rounded-tl-\[74px\]{border-top-left-radius:74px}.rounded-br-\[40px\]{border-bottom-right-radius:40px}.border{border-width:1px}.border-2{border-width:2px}.border-0{border-width:0}.border-b-2{border-bottom-width:2px}.border-solid{border-style:solid}.border-main{--tw-border-opacity:1;border-color:rgb(240 244 240/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-brand{--tw-border-opacity:1;border-color:rgb(66 171 68/var(--tw-border-opacity))}.border-b-brand{--tw-border-opacity:1;border-bottom-color:rgb(66 171 68/var(--tw-border-opacity))}.bg-main{--tw-bg-opacity:1;background-color:rgb(240 244 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-promo,.bg-white{--tw-bg-opacity:1}.bg-promo{background-color:rgb(247 248 197/var(--tw-bg-opacity))}.bg-brand{--tw-bg-opacity:1;background-color:rgb(66 171 68/var(--tw-bg-opacity))}.bg-inherit{background-color:inherit}.p-20{padding:5rem}.p-2{padding:.5rem}.p-11{padding:2.75rem}.p-\[10px\]{padding:10px}.p-8{padding:2rem}.py-8{padding-bottom:2rem;padding-top:2rem}.px-20{padding-left:5rem;padding-right:5rem}.px-12{padding-left:3rem;padding-right:3rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-9{padding-left:2.25rem;padding-right:2.25rem}.py-3\.5{padding-bottom:.875rem;padding-top:.875rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.pt-0{padding-top:0}.pr-\[7\.5rem\]{padding-right:7.5rem}.text-center{text-align:center}.font-sans{font-family:Ubuntu,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-xs{font-size:.75rem;line-height:1rem}.text-title2{font-size:2.5rem;line-height:3rem}.text-base{font-size:1rem;line-height:1.5rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-title{font-size:2rem;line-height:2.5rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-bold{font-weight:700}.leading-snug{line-height:1.375}.text-primary-text{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}.text-secondary{--tw-text-opacity:1;color:rgb(159 167 159/var(--tw-text-opacity))}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity))}.text-white{color:rgb(255 255 255/var(--tw-text-opacity))}.text-brand,.text-white{--tw-text-opacity:1}.text-brand{color:rgb(66 171 68/var(--tw-text-opacity))}.no-underline{-webkit-text-decoration-line:none;text-decoration-line:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.rotate-180{transform:rotate(180deg)}.hover\:text-brand:hover{--tw-text-opacity:1;color:rgb(66 171 68/var(--tw-text-opacity))}
1
+ [data-theme=pc]{--color-primary-main:#42ab44;--color-primary-hover:#248341;--color-primary-active:#245f34;--color-secondary-hover:#c5e2c6;--color-secondary-active:#d8f2d9}[data-theme=bc]{--color-primary-main:#83b83e;--color-primary-hover:#5c921d;--color-primary-active:#3c5e10;--color-secondary-hover:#e8f4d9;--color-secondary-active:#d8e3ca}[data-theme=eo]{--color-primary-main:#ddb63d;--color-primary-hover:#bb9727;--color-primary-active:#7e630c;--color-secondary-hover:#f1ecdd;--color-secondary-active:#e5dec7}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.top-4{top:1rem}.right-4{right:1rem}.bottom-0{bottom:0}.right-0{right:0}.bottom-9{bottom:2.25rem}.right-9{right:2.25rem}.left-0{left:0}.-bottom-2{bottom:-.5rem}.col-auto{grid-column:auto}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-6{grid-column:span 6/span 6}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-9{grid-column:span 9/span 9}.col-span-10{grid-column:span 10/span 10}.col-span-11{grid-column:span 11/span 11}.col-span-12{grid-column:span 12/span 12}.col-span-full{grid-column:1/-1}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.col-start-5{grid-column-start:5}.col-start-6{grid-column-start:6}.col-start-7{grid-column-start:7}.col-start-8{grid-column-start:8}.col-start-9{grid-column-start:9}.col-start-10{grid-column-start:10}.col-start-11{grid-column-start:11}.col-start-12{grid-column-start:12}.col-start-13{grid-column-start:13}.col-start-auto{grid-column-start:auto}.col-end-1{grid-column-end:1}.col-end-2{grid-column-end:2}.col-end-3{grid-column-end:3}.col-end-4{grid-column-end:4}.col-end-5{grid-column-end:5}.col-end-6{grid-column-end:6}.col-end-7{grid-column-end:7}.col-end-8{grid-column-end:8}.col-end-9{grid-column-end:9}.col-end-10{grid-column-end:10}.col-end-11{grid-column-end:11}.col-end-12{grid-column-end:12}.col-end-13{grid-column-end:13}.col-end-auto{grid-column-end:auto}.m-0{margin:0}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mb-6{margin-bottom:1.5rem}.mt-4{margin-top:1rem}.mt-7{margin-top:1.75rem}.mt-5{margin-top:1.25rem}.mt-auto{margin-top:auto}.mt-8{margin-top:2rem}.mt-2{margin-top:.5rem}.mr-8{margin-right:2rem}.ml-auto{margin-left:auto}.mr-5{margin-right:1.25rem}.mr-7{margin-right:1.75rem}.ml-2\.5{margin-left:.625rem}.ml-2{margin-left:.5rem}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-8{height:2rem}.h-\[308px\]{height:308px}.h-full{height:100%}.h-11{height:2.75rem}.h-\[1px\]{height:1px}.h-\[8px\]{height:8px}.h-\[2px\]{height:2px}.min-h-11{min-height:2.75rem}.w-full{width:100%}.w-8{width:2rem}.w-\[125px\]{width:125px}.w-11{width:2.75rem}.w-\[32px\]{width:32px}.w-\[24px\]{width:24px}.w-\[8px\]{width:8px}.w-\[36px\]{width:36px}.w-10{width:2.5rem}.min-w-11{min-width:2.75rem}.max-w-\[600px\]{max-width:600px}.rotate-180{--tw-rotate:180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.resize{resize:both}.grid-flow-col-dense{grid-auto-flow:column dense}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-5{gap:1.25rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.gap-4{gap:1rem}.gap-1{gap:.25rem}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.625rem*var(--tw-space-y-reverse));margin-top:calc(.625rem*(1 - var(--tw-space-y-reverse)))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-\[40px\]{border-radius:40px}.rounded-3xl{border-radius:1.5rem}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-bl-3xl{border-bottom-left-radius:1.5rem}.rounded-br-3xl{border-bottom-right-radius:1.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-0{border-width:0}.border-solid{border-style:solid}.border-main{--tw-border-opacity:1;border-color:rgb(240 244 240/var(--tw-border-opacity))}.border-primary-main{border-color:var(--color-primary-main)}.border-transparent{border-color:transparent}.bg-main{--tw-bg-opacity:1;background-color:rgb(240 244 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-main-divider{--tw-bg-opacity:1;background-color:rgb(235 237 240/var(--tw-bg-opacity))}.bg-inherit{background-color:inherit}.bg-primary-main{background-color:var(--color-primary-main)}.bg-secondary-light{--tw-bg-opacity:1;background-color:rgb(245 247 249/var(--tw-bg-opacity))}.bg-secondary-dark{--tw-bg-opacity:1;background-color:rgb(226 228 229/var(--tw-bg-opacity))}.p-20{padding:5rem}.p-2{padding:.5rem}.p-9{padding:2.25rem}.p-\[10px\]{padding:10px}.p-0{padding:0}.px-20{padding-left:5rem;padding-right:5rem}.px-9{padding-left:2.25rem;padding-right:2.25rem}.py-3\.5{padding-bottom:.875rem;padding-top:.875rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pt-0{padding-top:0}.pt-5{padding-top:1.25rem}.pb-8{padding-bottom:2rem}.text-center{text-align:center}.font-sans{font-family:Ubuntu,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-xs{font-size:.75rem;line-height:1rem}.text-title{font-size:1.75rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-bold{font-weight:700}.leading-snug{line-height:1.375}.text-primary-text{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity))}.text-main{--tw-text-opacity:1;color:rgb(240 244 240/var(--tw-text-opacity))}.text-primary-main{color:var(--color-primary-main)}.text-secondary-text{--tw-text-opacity:1;color:rgb(125 126 127/var(--tw-text-opacity))}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.no-underline{-webkit-text-decoration-line:none;text-decoration-line:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.rotate-180{transform:rotate(180deg)}.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\:bg-secondary-hover:hover{background-color:var(--color-secondary-hover)}.hover\:text-primary-main:hover{color:var(--color-primary-main)}.hover\:text-secondary-hover:hover{color:var(--color-secondary-hover)}.active\:bg-primary-active:active{background-color:var(--color-primary-active)}.active\:bg-secondary-active:active{background-color:var(--color-secondary-active)}
package/lib/types.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import type { AvifOptions, FormatEnum, GifOptions, HeifOptions, JpegOptions, PngOptions, ResizeOptions, TiffOptions, WebpOptions } from 'sharp';
2
2
  import type { HeaderContent } from './Header';
3
3
  import type { PlaceholderContent } from './Placeholder';
4
- import type { ProductColumnBlockContent } from './ProductColumnBlock';
4
+ import type { ProductTileContent } from './ProductTile';
5
5
  import type { RichTextContent } from './RichText';
6
6
  import type { TextContent } from './Text';
7
7
  import type { TextWithImageContent } from './TextWithImage';
8
- import type { ProductBlockContent } from './ProductBlock';
9
- export declare type BlockContent = ProductColumnBlockContent | HeaderContent | TextContent | TextWithImageContent | RichTextContent | PlaceholderContent | ProductBlockContent;
8
+ export declare type BlockVersion = 'primary' | 'secondary';
9
+ export declare type ColorPalette = 'pc' | 'bc' | 'eo';
10
+ export declare type BlockContent = HeaderContent | TextContent | TextWithImageContent | RichTextContent | PlaceholderContent | ProductTileContent;
10
11
  export interface BlockDef {
11
12
  type: string;
12
13
  style?: string[];
14
+ version?: BlockVersion;
13
15
  content?: BlockContent;
14
16
  blocks?: BlockDef[];
15
17
  }
@@ -25,6 +27,7 @@ export interface ContentPageDef extends ContentPageMeta {
25
27
  style?: string[];
26
28
  blocks?: BlockDef[];
27
29
  likeControl?: boolean;
30
+ colorPalette?: ColorPalette;
28
31
  }
29
32
  export interface Img {
30
33
  src: string;
@@ -1,7 +1,10 @@
1
+ declare type BlockItemVersion = 'primary' | 'secondary';
1
2
  export interface BlockItemContent {
2
3
  text?: string;
3
4
  }
4
5
  export interface BlockItemProps extends BlockItemContent {
5
6
  className?: string;
7
+ version?: BlockItemVersion;
6
8
  }
7
9
  export declare const BlockItem: (props: import("@redneckz/uni-jsx").PropsWithChildren<BlockItemProps, any>, context?: any) => any;
10
+ export {};
@@ -1,6 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
- export const BlockItem = JSX(({ className, text, children }) => {
4
- return (_jsxs("div", { className: `inline-block flex items-center ${className || ''}`, role: "listitem", children: [_jsx("div", { className: "inline-block min-w-[7px] h-[2px] bg-brand" }), _jsx("span", { className: "text-base text-secondary font-normal font-sans mx-3", children: text || children })] }));
3
+ const listStyleMap = {
4
+ primary: 'bg-primary-main',
5
+ secondary: 'bg-white',
6
+ };
7
+ const textStyleMap = {
8
+ primary: 'text-primary-text',
9
+ secondary: 'text-white',
10
+ };
11
+ export const BlockItem = JSX(({ className, text, children, version = 'primary' }) => {
12
+ return (_jsxs("div", { className: `inline-block flex items-center ${className || ''}`, role: "listitem", children: [_jsx("div", { className: `inline-block w-[8px] h-[8px] rounded-full ${listStyleMap[version]}` }), _jsx("span", { className: `text-base font-normal font-sans mx-3 ${textStyleMap[version]}`, children: text || children })] }));
5
13
  });
6
14
  //# sourceMappingURL=BlockItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockItem.js","sourceRoot":"","sources":["../../src/ui-kit/BlockItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAUxC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAiB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7E,OAAO,CACL,eAAK,SAAS,EAAE,kCAAkC,SAAS,IAAI,EAAE,EAAE,EAAE,IAAI,EAAC,UAAU,aAClF,cAAK,SAAS,EAAC,2CAA2C,GAAO,EACjE,eAAM,SAAS,EAAC,qDAAqD,YAClE,IAAI,IAAI,QAAQ,GACZ,IACH,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"BlockItem.js","sourceRoot":"","sources":["../../src/ui-kit/BlockItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAYxC,MAAM,YAAY,GAAqC;IACrD,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,UAAU;CACtB,CAAC;AAEF,MAAM,YAAY,GAAqC;IACrD,OAAO,EAAE,mBAAmB;IAC5B,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAC1B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,EAAE,EAAE;IACrD,OAAO,CACL,eAAK,SAAS,EAAE,kCAAkC,SAAS,IAAI,EAAE,EAAE,EAAE,IAAI,EAAC,UAAU,aAClF,cAAK,SAAS,EAAE,6CAA6C,YAAY,CAAC,OAAO,CAAC,EAAE,GAAQ,EAC5F,eAAM,SAAS,EAAE,wCAAwC,YAAY,CAAC,OAAO,CAAC,EAAE,YAC7E,IAAI,IAAI,QAAQ,GACZ,IACH,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}