Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Document boolean icons in admin #4986

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpack = require('webpack');

const config = {
core: {
Expand Down Expand Up @@ -51,6 +52,8 @@ const config = {
path.resolve(__dirname, '../src/openforms/js'),
];

config.plugins.push(new webpack.DefinePlugin({STATIC_URL: JSON.stringify('./static/')}));

if (isEnvProduction) {
config.plugins.push(new MiniCssExtractPlugin({filename: 'static/bundles/[name].css'}));
}
Expand Down
16 changes: 16 additions & 0 deletions src/openforms/js/components/admin/BooleanIcons.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {ArgTypes, Canvas, Meta} from '@storybook/addon-docs';

import * as BooleanIconsStories from './BooleanIcons.stories';

<Meta of={BooleanIconsStories} />

# Boolean icons

You can use boolean icons to quickly represent the state of a boolean. Booleans are tri-state:
`true`, `false` or `null`.

<Canvas of={BooleanIconsStories.Yes} />

<Canvas of={BooleanIconsStories.No} />

<Canvas of={BooleanIconsStories.Unknown} />
18 changes: 18 additions & 0 deletions src/openforms/js/components/admin/BooleanIcons.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import BooleanIcon, {IconNo, IconUnknown, IconYes} from './BooleanIcons';

export default {
title: 'Admin / Django / BooleanIcons',
component: BooleanIcon,
};

export const Yes = {
render: () => <IconYes />,
};

export const No = {
render: () => <IconNo />,
};

export const Unknown = {
render: () => <IconUnknown />,
};
Loading