diff --git a/CHANGELOG.md b/CHANGELOG.md index 624696de..efd6fb08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.0.0-beta.0](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.108...v1.0.0-beta.0) (2023-10-20) + +**Note:** Version bump only for package root + +# [1.0.0-alpha.108](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.107...v1.0.0-alpha.108) (2023-10-20) + +### Features + +- downloadable asset card ([c101af3](https://github.com/acid-info/logos-docusaurus-plugins/commit/c101af327f87cde154dab77b320b33bf77b31c9c)), closes [acid-info/logos-brand-guidelines#15](https://github.com/acid-info/logos-brand-guidelines/issues/15) +- external resource card ([d4e49e2](https://github.com/acid-info/logos-docusaurus-plugins/commit/d4e49e2395ffe6a9c72da2633d8543a367c222e5)), closes [acid-info/logos-brand-guidelines#13](https://github.com/acid-info/logos-brand-guidelines/issues/13) [acid-info/logos-brand-guidelines#14](https://github.com/acid-info/logos-brand-guidelines/issues/14) + # [1.0.0-alpha.107](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.106...v1.0.0-alpha.107) (2023-10-16) ### Features diff --git a/lerna.json b/lerna.json index e589d996..d0f34097 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-alpha.107", + "version": "1.0.0-beta.0", "npmClient": "yarn", "useWorkspaces": true, "$schema": "node_modules/lerna/schemas/lerna-schema.json" diff --git a/packages/docusaurus-fathom/CHANGELOG.md b/packages/docusaurus-fathom/CHANGELOG.md index ee60da5b..f52a670a 100644 --- a/packages/docusaurus-fathom/CHANGELOG.md +++ b/packages/docusaurus-fathom/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.0.0-beta.0](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.108...v1.0.0-beta.0) (2023-10-20) + +**Note:** Version bump only for package @acid-info/docusaurus-fathom + # [1.0.0-alpha.101](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.100...v1.0.0-alpha.101) (2023-09-22) ### Bug Fixes diff --git a/packages/docusaurus-fathom/package.json b/packages/docusaurus-fathom/package.json index 59fedc3c..248a90a2 100644 --- a/packages/docusaurus-fathom/package.json +++ b/packages/docusaurus-fathom/package.json @@ -1,6 +1,6 @@ { "name": "@acid-info/docusaurus-fathom", - "version": "1.0.0-alpha.101", + "version": "1.0.0-beta.0", "description": "Docusaurus fathom plugin", "main": "lib/index.js", "types": "src/plugin.d.ts", diff --git a/packages/docusaurus-og/CHANGELOG.md b/packages/docusaurus-og/CHANGELOG.md index c3c31d7d..520ae372 100644 --- a/packages/docusaurus-og/CHANGELOG.md +++ b/packages/docusaurus-og/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.0.0-beta.0](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.108...v1.0.0-beta.0) (2023-10-20) + +**Note:** Version bump only for package @acid-info/docusaurus-og + # [1.0.0-alpha.76](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.75...v1.0.0-alpha.76) (2023-07-11) ### Bug Fixes diff --git a/packages/docusaurus-og/package.json b/packages/docusaurus-og/package.json index d1fd0829..893c7246 100644 --- a/packages/docusaurus-og/package.json +++ b/packages/docusaurus-og/package.json @@ -1,6 +1,6 @@ { "name": "@acid-info/docusaurus-og", - "version": "1.0.0-alpha.76", + "version": "1.0.0-beta.0", "description": "Docusaurus local search plugin", "main": "lib/index.js", "repository": { diff --git a/packages/logos-docusaurus-preset/CHANGELOG.md b/packages/logos-docusaurus-preset/CHANGELOG.md index 6f5cf819..5ae263d5 100644 --- a/packages/logos-docusaurus-preset/CHANGELOG.md +++ b/packages/logos-docusaurus-preset/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.0.0-beta.0](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.108...v1.0.0-beta.0) (2023-10-20) + +**Note:** Version bump only for package @acid-info/logos-docusaurus-preset + +# [1.0.0-alpha.108](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.107...v1.0.0-alpha.108) (2023-10-20) + +**Note:** Version bump only for package @acid-info/logos-docusaurus-preset + # [1.0.0-alpha.107](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.106...v1.0.0-alpha.107) (2023-10-16) **Note:** Version bump only for package @acid-info/logos-docusaurus-preset diff --git a/packages/logos-docusaurus-preset/package.json b/packages/logos-docusaurus-preset/package.json index 332dc2f1..a9bb5a18 100644 --- a/packages/logos-docusaurus-preset/package.json +++ b/packages/logos-docusaurus-preset/package.json @@ -1,6 +1,6 @@ { "name": "@acid-info/logos-docusaurus-preset", - "version": "1.0.0-alpha.107", + "version": "1.0.0-beta.0", "description": "Docusaurus preset for Logos documentation websites", "main": "lib/index.js", "types": "src/preset.d.ts", @@ -16,9 +16,9 @@ "prepublishOnly": "yarn build" }, "dependencies": { - "@acid-info/docusaurus-og": "^1.0.0-alpha.76", - "@acid-info/logos-docusaurus-search-local": "^1.0.0-alpha.47", - "@acid-info/logos-docusaurus-theme": "^1.0.0-alpha.107", + "@acid-info/docusaurus-og": "^1.0.0-beta.0", + "@acid-info/logos-docusaurus-search-local": "^1.0.0-beta.0", + "@acid-info/logos-docusaurus-theme": "^1.0.0-beta.0", "@docusaurus/core": "^2.4.1", "@docusaurus/module-type-aliases": "^2.4.1", "@docusaurus/preset-classic": "^2.4.1", diff --git a/packages/logos-docusaurus-search-local/CHANGELOG.md b/packages/logos-docusaurus-search-local/CHANGELOG.md index 07b1d4cd..9e9e5ccb 100644 --- a/packages/logos-docusaurus-search-local/CHANGELOG.md +++ b/packages/logos-docusaurus-search-local/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.0.0-beta.0](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.108...v1.0.0-beta.0) (2023-10-20) + +**Note:** Version bump only for package @acid-info/logos-docusaurus-search-local + # [1.0.0-alpha.47](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.46...v1.0.0-alpha.47) (2023-06-19) ### Features diff --git a/packages/logos-docusaurus-search-local/package.json b/packages/logos-docusaurus-search-local/package.json index dae8a6ad..c0030252 100644 --- a/packages/logos-docusaurus-search-local/package.json +++ b/packages/logos-docusaurus-search-local/package.json @@ -1,6 +1,6 @@ { "name": "@acid-info/logos-docusaurus-search-local", - "version": "1.0.0-alpha.47", + "version": "1.0.0-beta.0", "description": "Docusaurus local search plugin", "main": "lib/index.js", "types": "src/plugin.d.ts", diff --git a/packages/logos-docusaurus-theme/CHANGELOG.md b/packages/logos-docusaurus-theme/CHANGELOG.md index 1d180e27..c70a2bab 100644 --- a/packages/logos-docusaurus-theme/CHANGELOG.md +++ b/packages/logos-docusaurus-theme/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.0.0-beta.0](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.108...v1.0.0-beta.0) (2023-10-20) + +**Note:** Version bump only for package @acid-info/logos-docusaurus-theme + +# [1.0.0-alpha.108](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.107...v1.0.0-alpha.108) (2023-10-20) + +### Features + +- downloadable asset card ([c101af3](https://github.com/acid-info/logos-docusaurus-plugins/commit/c101af327f87cde154dab77b320b33bf77b31c9c)), closes [acid-info/logos-brand-guidelines#15](https://github.com/acid-info/logos-brand-guidelines/issues/15) +- external resource card ([d4e49e2](https://github.com/acid-info/logos-docusaurus-plugins/commit/d4e49e2395ffe6a9c72da2633d8543a367c222e5)), closes [acid-info/logos-brand-guidelines#13](https://github.com/acid-info/logos-brand-guidelines/issues/13) [acid-info/logos-brand-guidelines#14](https://github.com/acid-info/logos-brand-guidelines/issues/14) + # [1.0.0-alpha.107](https://github.com/acid-info/logos-docusaurus-plugins/compare/v1.0.0-alpha.106...v1.0.0-alpha.107) (2023-10-16) ### Features diff --git a/packages/logos-docusaurus-theme/package.json b/packages/logos-docusaurus-theme/package.json index 7dc49118..12e71d20 100644 --- a/packages/logos-docusaurus-theme/package.json +++ b/packages/logos-docusaurus-theme/package.json @@ -1,6 +1,6 @@ { "name": "@acid-info/logos-docusaurus-theme", - "version": "1.0.0-alpha.107", + "version": "1.0.0-beta.0", "description": "A Docusaurus theme for Logos documentation websites", "main": "lib/index.js", "types": "src/theme.d.ts", @@ -20,7 +20,7 @@ "prepublishOnly": "yarn clean && yarn build" }, "dependencies": { - "@acid-info/docusaurus-og": "^1.0.0-alpha.76", + "@acid-info/docusaurus-og": "^1.0.0-beta.0", "@acid-info/lsd-react": "^0.1.0-alpha.17", "@docusaurus/core": "^2.4.1", "@docusaurus/mdx-loader": "^2.4.1", diff --git a/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx b/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx index a8693820..54ee13c9 100644 --- a/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx +++ b/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx @@ -31,6 +31,7 @@ import DiscordWhiteSvg from '../../static/icons/discord-white.svg' import TelegramWhiteSvg from '../../static/icons/telegram-white.svg' import XSvg from '../../static/icons/x.svg' import Avatar from '../../static/icons/avatar.svg' +import DownloadSvg from '../../static/icons/download.svg' type TIconProps = { size?: 's' | 'm' | 'l' @@ -227,3 +228,9 @@ export const IconAvatar = (props: TIconProps): JSX.Element => ( ) + +export const IconDownload = (props: TIconProps): JSX.Element => ( + + + +) diff --git a/packages/logos-docusaurus-theme/src/client/components/KeepRatio/KeepRatio.module.scss b/packages/logos-docusaurus-theme/src/client/components/KeepRatio/KeepRatio.module.scss new file mode 100644 index 00000000..503d34a3 --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/KeepRatio/KeepRatio.module.scss @@ -0,0 +1,38 @@ +.root { + position: relative; + display: inline-block; + font-size: 0 !important; + + &.fullWidth { + width: 100%; + height: auto; + } + + &.fullHeight { + width: auto; + height: 100%; + } + + .content { + top: 0; + left: 0; + width: 100%; + height: 100%; + position: absolute; + } + + &:not(.keep) { + .root { + height: auto; + width: auto; + } + + .content { + position: relative; + top: unset; + left: unset; + width: 100%; + height: 100%; + } + } +} diff --git a/packages/logos-docusaurus-theme/src/client/components/KeepRatio/KeepRatio.tsx b/packages/logos-docusaurus-theme/src/client/components/KeepRatio/KeepRatio.tsx new file mode 100644 index 00000000..7ccb1074 --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/KeepRatio/KeepRatio.tsx @@ -0,0 +1,77 @@ +import clsx from 'clsx' +import React from 'react' +import styles from './KeepRatio.module.scss' + +export const KeepRatio: React.FC< + React.PropsWithChildren<{ + width: number + height: number + fullWidth?: boolean + fullHeight?: boolean + rootProps?: React.DetailedHTMLProps< + React.HTMLAttributes, + HTMLDivElement + > + contentProps?: React.DetailedHTMLProps< + React.HTMLAttributes, + HTMLDivElement + > + + keep?: boolean + containerWidth?: number | string + containerHeight?: number | string + }> +> = ({ + children, + width, + height, + fullHeight: _fullHeight = false, + fullWidth: _fullWidth = true, + rootProps, + contentProps, + containerWidth, + containerHeight, + keep = true, +}) => { + const fullWidth = !_fullHeight && _fullWidth + const fullHeight = !fullWidth + const ratio = (fullHeight ? height / width : width / height) * 100 + + return ( +
+
+ {children} +
+ {keep && ( + + )} +
+ ) +} diff --git a/packages/logos-docusaurus-theme/src/client/components/KeepRatio/index.ts b/packages/logos-docusaurus-theme/src/client/components/KeepRatio/index.ts new file mode 100644 index 00000000..9a7d0c24 --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/KeepRatio/index.ts @@ -0,0 +1 @@ +export * from './KeepRatio' diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/AssetCard.scss b/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/AssetCard.scss new file mode 100644 index 00000000..67261ab5 --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/AssetCard.scss @@ -0,0 +1,70 @@ +@use '../../../css/utils'; +@use '../../../css/lsd'; + +.mdx-asset-card { + width: 216px; + display: flex; + flex-direction: column; + align-items: flex-start; + border: 1px solid rgb(var(--lsd-border-primary)); + border-bottom: none; + text-decoration: none !important; + min-height: 144px; +} + +.mdx-asset-card__inner { + width: 100%; + padding: 16px 16px 32px 16px; +} + +.mdx-asset-card__title { + margin-bottom: 16px; +} + +.mdx-asset-card__image { + img { + width: 100%; + height: 100%; + object-fit: contain; + object-position: center center; + } +} + +.mdx-asset-card__downloadables { + width: 100%; + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: stretch; + + & > * { + flex-grow: 1; + font-size: 12px; + text-decoration: none !important; + text-underline-offset: unset !important; + + button { + width: 100%; + justify-content: space-between; + text-decoration: none; + } + + &:first-child button { + border-left: none; + } + + &:last-child button { + border-right: none; + } + + &:not(:last-child) button { + border-right: none; + } + } +} + +.mdx-asset-card:not(.mdx-asset-card--downloadable) { + .mdx-asset-card__inner { + border-bottom: 1px solid rgb(var(--lsd-border-primary)); + } +} diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/AssetCard.tsx b/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/AssetCard.tsx new file mode 100644 index 00000000..4b3a279c --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/AssetCard.tsx @@ -0,0 +1,77 @@ +import { Button, Typography } from '@acid-info/lsd-react' +import clsx from 'clsx' +import React from 'react' +import { KeepRatio } from '../../KeepRatio' +import './AssetCard.scss' +import { IconDownload } from '../../Icon' + +export type AssetCardProps = Omit, 'title'> & { + title?: React.ReactNode + previewSrc: string + downloadable?: { + src: string + title: React.ReactNode + }[] +} + +export const AssetCard: React.FC = ({ + title, + previewSrc, + downloadable, + ...props +}) => { + const isDownloadable = downloadable && downloadable.length > 0 + + return ( +
+
+ {title && ( + + {title} + + )} + + {(typeof + +
+ { + // TODO: use LSD ButtonGroup + } + {isDownloadable && ( +
+ {downloadable.map((downloadable, index) => ( + + + + ))} +
+ )} +
+ ) +} diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/index.ts b/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/index.ts new file mode 100644 index 00000000..4d47f52f --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/AssetCard/index.ts @@ -0,0 +1 @@ +export * from './AssetCard' diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/ExternalResourceCard.scss b/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/ExternalResourceCard.scss new file mode 100644 index 00000000..1f0c440c --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/ExternalResourceCard.scss @@ -0,0 +1,90 @@ +@use '../../../css/utils'; +@use '../../../css/lsd'; + +.mdx-erc { + display: flex; + flex-direction: row; + align-items: flex-start; + border: 1px solid rgb(var(--lsd-border-primary)); + text-decoration: none !important; + min-height: 144px; +} + +.mdx-erc__icon { + padding: 16px 16px 16px 8px; +} + +.mdx-erc__inner { + flex-grow: 1; + padding: 16px; +} + +.mdx-erc:hover { + .mdx-erc__title { + text-decoration: underline !important; + } +} + +.mdx-erc__logo { + width: 32px !important; + height: 32px !important; + + svg { + width: 32px !important; + height: 32px !important; + } +} + +.mdx-erc__title { + margin-top: 32px; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + max-height: calc(2 * var(--lsd-body1-lineHeight)); +} + +.mdx-erc__description { + margin-top: 8px; +} + +.mdx-erc--with-preview { + display: flex; + flex-direction: column; + + .mdx-erc__preview-image { + width: 100%; + height: 100%; + object-fit: cover; + border-bottom: 1px solid rgb(var(--lsd-border-primary)); + } + + .mdx-erc__icon { + display: none; + } + + .mdx-erc__inner { + padding: 16px; + display: grid; + gap: 0 16px; + grid-template-columns: 32px auto; + grid-template-rows: auto auto; + } + + .mdx-erc__logo { + grid-column: 1; + grid-row: 1 / span 2; + align-self: center; + } + + .mdx-erc__title { + margin-top: 0; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + max-height: calc(1 * var(--lsd-body1-lineHeight)); + } + + .mdx-erc__description { + margin-top: 4px; + } +} diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/ExternalResourceCard.tsx b/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/ExternalResourceCard.tsx new file mode 100644 index 00000000..2fdaa2b0 --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/ExternalResourceCard.tsx @@ -0,0 +1,83 @@ +import { Typography } from '@acid-info/lsd-react' +import ThemedImage from '@theme/ThemedImage' +import clsx from 'clsx' +import React from 'react' +import { IconExternalLink } from '../../Icon' +import './ExternalResourceCard.scss' +import { KeepRatio } from '../../KeepRatio' + +export type ExternalResourceCardProps = Omit< + React.HTMLProps, + 'title' +> & { + logoSrc?: string + logoSrcDark?: string + title?: React.ReactNode + description?: React.ReactNode + previewSrc?: string + previewSrcDark?: string +} + +export const ExternalResourceCard: React.FC = ({ + title, + logoSrc, + logoSrcDark, + description, + previewSrc, + previewSrcDark, + ...props +}) => { + const withPreview = !!(previewSrc || previewSrcDark) + + return ( + + {withPreview && ( + + + + )} +
+ {(logoSrc || logoSrcDark) && ( + + )} + + {title} + + {description && ( + + {description} + + )} +
+
+ +
+
+ ) +} diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/index.ts b/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/index.ts new file mode 100644 index 00000000..da291d3d --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/ExternalResourceCard/index.ts @@ -0,0 +1 @@ +export * from './ExternalResourceCard' diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts b/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts index 0e8796e9..24e703e5 100644 --- a/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts @@ -1,8 +1,10 @@ export * from './AppCard' +export * from './AssetCard' export * from './Box' export * from './CallToActionButton' export * from './CallToActionSection' export * from './DocMetadata' +export * from './ExternalResourceCard' export * from './FeatureList' export * from './Grid' export * from './Hero' diff --git a/packages/logos-docusaurus-theme/src/client/static/icons/download.svg b/packages/logos-docusaurus-theme/src/client/static/icons/download.svg new file mode 100644 index 00000000..35f433bf --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/static/icons/download.svg @@ -0,0 +1,3 @@ + + +