Skip to content

Commit

Permalink
Merge branch 'main' into slots2024
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepiercy authored Feb 24, 2024
2 parents 3496942 + 2901c72 commit 594c5f9
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 13 deletions.
21 changes: 21 additions & 0 deletions packages/components/.storybook/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion packages/components/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const config: StorybookConfig = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-mdx-gfm',
],
framework: {
name: '@storybook/react-vite',
Expand Down
6 changes: 6 additions & 0 deletions packages/components/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/manager-api';
import theme from './theme';

addons.setConfig({
theme,
});
2 changes: 2 additions & 0 deletions packages/components/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './storybook-base.css';

export const parameters = {
backgrounds: {
default: 'light',
Expand Down
15 changes: 15 additions & 0 deletions packages/components/.storybook/storybook-base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Base styles */
:root {
--basic-font-family: system-ui;
--basic-font-size: 16px;
background: var(--background-color);
font-family: var(--basic-font-family);
font-size: var(--basic-font-size);
line-height: 1.5;
}

.sbdocs.sbdocs-content {
p {
font-size: 16px;
}
}
10 changes: 10 additions & 0 deletions packages/components/.storybook/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { create } from '@storybook/theming/create';
import logo from './Logo.svg';

export default create({
base: 'light',
brandTitle: '@plone/components StoryBook',
brandUrl: 'https://plone-components.netlify.app/',
brandImage: logo,
brandTarget: '_self',
});
10 changes: 10 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@

<!-- towncrier release notes start -->

## 2.0.0-alpha.2 (2024-02-23)

### Bugfix

- Move basic general CSS rules to StoryBook so we don't spoil the build @sneridagh [#5791](https://github.com/plone/volto/issues/5791)

### Internal

- Improve StoryBook look and feel @sneridagh [#5791](https://github.com/plone/volto/issues/5791)

## 2.0.0-alpha.1 (2024-02-18)

### Bugfix
Expand Down
4 changes: 3 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"license": "MIT",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.2",
"repository": {
"type": "git",
"url": "http://github.com/plone/components.git"
Expand Down Expand Up @@ -91,9 +91,11 @@
"@storybook/addon-links": "^7.5.1",
"@storybook/addon-mdx-gfm": "^7.5.1",
"@storybook/blocks": "^7.5.1",
"@storybook/manager-api": "^7.6.17",
"@storybook/react": "^7.5.1",
"@storybook/react-vite": "^7.5.1",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.6.17",
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "14.0.0",
"@types/jest-axe": "^3.5.7",
Expand Down
35 changes: 35 additions & 0 deletions packages/components/src/stories/Introduction.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Meta } from '@storybook/blocks';

<Meta title="Introduction" />


# `@plone/components`

This package contains ReactJS components for using Plone as a headless CMS.

The purpose of this package is to provide an agnostic set of baseline components to build Plone sites upon.

## Usage

Using the package manager of your choice (npm, yarn, pnpm) install the package:

```shell
yarn add @plone/components
```

Whenever you want to use the components, all are exported as named exports:

```ts
import { TextField } from '@plone/components';

const MyComponent = (props) => {
return (
<>
<TextField label="Username" />
</>;
)
}

export default MyComponent;
```

10 changes: 0 additions & 10 deletions packages/components/src/styles/basic/theme.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
@import '../quanta/colors.css';

/* Base styles */
:root {
--basic-font-family: system-ui;
--basic-font-size: 14px;
background: var(--background-color);
font-family: var(--basic-font-family);
font-size: var(--basic-font-size);
line-height: 1.5;
}

/* color themes for dark and light modes, generated with Leonardo.
* Light: https://leonardocolor.io/theme.html?name=Light&config=%7B%22baseScale%22%3A%22Gray%22%2C%22colorScales%22%3A%5B%7B%22name%22%3A%22Gray%22%2C%22colorKeys%22%3A%5B%22%23000000%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Purple%22%2C%22colorKeys%22%3A%5B%22%235e30eb%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Red%22%2C%22colorKeys%22%3A%5B%22%23e32400%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%5D%2C%22lightness%22%3A98%2C%22contrast%22%3A1%2C%22saturation%22%3A100%2C%22formula%22%3A%22wcag2%22%7D */
:root {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
"stylelint-prettier": "4.0.2"
},
"peerDependencies": {
"@plone/volto": "^17.0.0"
"@plone/volto": "^18.0.0"
}
}
1 change: 1 addition & 0 deletions packages/generator-volto/news/5780.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switch peerDependencies to Volto 18 for generator-volto alpha's/latest.
82 changes: 82 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 594c5f9

Please sign in to comment.