@myst-theme/landing-pages 0.14.2 → 0.15.0

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.
@@ -26,7 +26,7 @@ export function CenteredBlock(props) {
26
26
  if (!body) {
27
27
  return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "centered" }));
28
28
  }
29
- return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsx("div", { className: "relative text-center", children: _jsxs("div", { className: "py-20 sm:py-28", children: [subtitle && (_jsx("p", { className: "my-0 font-semibold text-indigo-400 uppercase", children: _jsx(MyST, { ast: subtitle.children }) })), heading && (_jsx(BlockHeading, { node: heading, className: "mt-2 mb-0 text-5xl font-semibold tracking-tight" })), body && (_jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body }) })), links && (_jsx("div", { className: "flex items-center justify-center gap-4 mt-8", children: _jsx(MyST, { ast: links }) }))] }) }) })));
29
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsx("div", { className: "relative text-center", children: _jsxs("div", { className: "py-20 sm:py-28", children: [subtitle && (_jsx("p", { className: "my-0 font-semibold text-indigo-400 uppercase", children: _jsx(MyST, { ast: subtitle.children }) })), heading && (_jsx(BlockHeading, { node: heading, className: "mt-2 mb-0 text-5xl font-semibold tracking-tight" })), body && (_jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body }) })), links && (_jsx("div", { className: "flex flex-row flex-wrap items-center justify-center gap-4 mt-8", children: _jsx(MyST, { ast: links }) }))] }) }) })));
30
30
  }
31
31
  export const CENTERED_RENDERERS = {
32
32
  block: {
@@ -1 +1 @@
1
- {"version":3,"file":"JustifiedBlock.d.ts","sourceRoot":"","sources":["../src/JustifiedBlock.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,2CA4DxE;AAED,eAAO,MAAM,mBAAmB,EAAE,aAIjC,CAAC"}
1
+ {"version":3,"file":"JustifiedBlock.d.ts","sourceRoot":"","sources":["../src/JustifiedBlock.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,2CAsDxE;AAED,eAAO,MAAM,mBAAmB,EAAE,aAIjC,CAAC"}
@@ -26,7 +26,7 @@ export function JustifiedBlock(props) {
26
26
  if (!body) {
27
27
  return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "justified" }));
28
28
  }
29
- return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "py-20 sm:py-28 lg:px-8", children: [subtitle && (_jsx("p", { className: "my-0 font-semibold text-indigo-400 uppercase", children: _jsx(MyST, { ast: subtitle.children }) })), _jsxs("div", { className: "flex flex-col lg:content-center lg:justify-between lg:flex-row", children: [_jsxs("div", { className: "flex flex-col", children: [heading && (_jsx(BlockHeading, { node: heading, className: "mt-2 mb-0 text-5xl font-semibold tracking-tight" })), body && (_jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body }) }))] }), _jsx("div", { className: "flex flex-col mt-8 lg:mt-0", children: links && (_jsx("div", { className: "flex flex-row items-center gap-4", children: _jsx(MyST, { ast: links }) })) })] })] }) })));
29
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "grid-areas-just-narrow md:grid-areas-just-wide grid grid-cols-[auto_1fr_auto] justify-between gap-2 py-20 sm:py-28 lg:px-8", children: [subtitle && (_jsx("p", { className: "grid-area-subtitle my-0 font-semibold text-indigo-400 uppercase", children: _jsx(MyST, { ast: subtitle.children }) })), heading && (_jsx(BlockHeading, { node: heading, className: "grid-area-title mt-2 mb-0 text-5xl font-semibold tracking-tight" })), body && (_jsx("div", { className: "grid-area-body mt-6", children: _jsx(MyST, { ast: body }) })), links && (_jsx("div", { className: "grid-area-links flex flex-row flex-wrap items-center gap-4", children: _jsx(MyST, { ast: links }) }))] }) })));
30
30
  }
31
31
  export const JUSTIFIED_RENDERERS = {
32
32
  block: {
@@ -1 +1 @@
1
- {"version":3,"file":"LandingBlock.d.ts","sourceRoot":"","sources":["../src/LandingBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAsB5E"}
1
+ {"version":3,"file":"LandingBlock.d.ts","sourceRoot":"","sources":["../src/LandingBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAoB5E"}
@@ -2,15 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useGridSystemProvider } from '@myst-theme/providers';
3
3
  import classNames from 'classnames';
4
4
  export function LandingBlock({ node, className, children }) {
5
- var _a, _b;
6
5
  const grid = useGridSystemProvider();
7
6
  const { key } = node;
7
+ const externalClassNames = classNames(className, node.class);
8
8
  const subGrid = node.visibility === 'hide' ? '' : `${grid} subgrid-gap col-page [&>*]:col-page`;
9
- const dataClassName = typeof ((_a = node.data) === null || _a === void 0 ? void 0 : _a.class) === 'string' ? (_b = node.data) === null || _b === void 0 ? void 0 : _b.class : undefined;
10
- // Hide the subgrid if either the dataClass or the className exists and includes `col-`
11
- const noSubGrid = (dataClassName && dataClassName.includes('col-')) || (className && className.includes('col-'));
12
- return (_jsx("div", { id: key, className: classNames('relative group/block py-6', className, dataClassName, {
13
- [subGrid]: !noSubGrid,
9
+ return (_jsx("div", { id: key, className: classNames('relative group/block py-6', externalClassNames, {
10
+ // Hide the subgrid if either the dataClass or the className exists and includes `col-`
11
+ [subGrid]: !(externalClassNames && externalClassNames.includes('col-')),
14
12
  hidden: node.visibility === 'remove',
15
13
  }), children: children }, `block-${key}`));
16
14
  }
@@ -22,7 +22,7 @@ export function LogoCloudBlock(props) {
22
22
  if (!grid) {
23
23
  return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "logo-cloud" }));
24
24
  }
25
- return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "py-20 text-center sm:py-28", children: [_jsx("div", { className: "font-semibold", children: _jsx(MyST, { ast: body }) }), grid && _jsx(MyST, { ast: grid }), links && (_jsx("div", { className: "flex items-center justify-center gap-4 mt-8", children: _jsx(MyST, { ast: links }) }))] }) })));
25
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "py-20 text-center sm:py-28", children: [_jsx("div", { className: "font-semibold", children: _jsx(MyST, { ast: body }) }), grid && _jsx(MyST, { ast: grid }), links && (_jsx("div", { className: "flex flex-row flex-wrap items-center justify-center gap-4 mt-8", children: _jsx(MyST, { ast: links }) }))] }) })));
26
26
  }
27
27
  export const LOGO_CLOUD_RENDERERS = {
28
28
  block: {
@@ -28,7 +28,7 @@ export function SplitImageBlock(props) {
28
28
  if (!image || !body) {
29
29
  return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "split-image" }));
30
30
  }
31
- return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "relative rounded-md bg-stone-900 dark:bg-stone-800", children: [_jsx("div", { className: "lg:absolute lg:h-full lg:w-[calc(50%)] md:absolute md:h-full md:w-[calc(100%/3)] h-80 relative [&_img]:h-full [&_img]:w-full [&_img]:object-cover [&_img]:m-0 [&_picture]:m-0 [&_picture]:inline", children: _jsx(MyST, { ast: image }) }), _jsx("div", { className: "relative py-24", children: _jsxs("div", { className: "lg:ml-auto lg:w-[calc(50%)] lg:p-8 lg:pl-24 md:ml-auto md:w-[calc(2*100%/3)] md:pl-16 md:p-8 px-6", children: [subtitle && (_jsx("p", { className: "my-0 font-semibold prose text-indigo-400 uppercase prose-invert", children: _jsx(MyST, { ast: subtitle.children }) })), heading && (_jsx(BlockHeading, { node: heading, className: "mt-2 mb-0 text-5xl font-semibold tracking-tight text-white" })), _jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body, className: "prose prose-invert" }) }), links && (_jsx("div", { className: "flex items-center gap-4 mt-8", children: _jsx(MyST, { ast: links, className: "prose prose-invert" }) }))] }) })] }) })));
31
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "relative rounded-md bg-stone-900 dark:bg-stone-800", children: [_jsx("div", { className: "lg:absolute lg:h-full lg:w-[calc(50%)] md:absolute md:h-full md:w-[calc(100%/3)] h-80 relative [&_img]:h-full [&_img]:w-full [&_img]:object-cover [&_img]:m-0 [&_picture]:m-0 [&_picture]:inline", children: _jsx(MyST, { ast: image }) }), _jsx("div", { className: "relative py-24", children: _jsxs("div", { className: "lg:ml-auto lg:w-[calc(50%)] lg:p-8 lg:pl-24 md:ml-auto md:w-[calc(2*100%/3)] md:pl-16 md:p-8 px-6", children: [subtitle && (_jsx("p", { className: "my-0 font-semibold prose text-indigo-400 uppercase prose-invert", children: _jsx(MyST, { ast: subtitle.children }) })), heading && (_jsx(BlockHeading, { node: heading, className: "mt-2 mb-0 text-5xl font-semibold tracking-tight text-white" })), _jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body, className: "prose prose-invert" }) }), links && (_jsx("div", { className: "flex flex-row flex-wrap items-center gap-4 mt-8", children: _jsx(MyST, { ast: links, className: "prose prose-invert" }) }))] }) })] }) })));
32
32
  }
33
33
  export const SPLIT_IMAGE_RENDERERS = {
34
34
  block: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/landing-pages",
3
- "version": "0.14.2",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,14 +20,14 @@
20
20
  "build": "npm-run-all -l clean -p build:esm"
21
21
  },
22
22
  "dependencies": {
23
- "@myst-theme/providers": "^0.14.2",
23
+ "@myst-theme/providers": "^0.15.0",
24
24
  "classnames": "^2.5.1",
25
25
  "myst-common": "^1.7.9",
26
26
  "myst-config": "^1.7.9",
27
27
  "myst-frontmatter": "^1.7.9",
28
28
  "myst-spec": "^0.0.5",
29
29
  "myst-spec-ext": "^1.7.9",
30
- "myst-to-react": "^0.14.2",
30
+ "myst-to-react": "^0.15.0",
31
31
  "unist-util-select": "^4.0.3",
32
32
  "unist-util-filter": "^4.0.0"
33
33
  },