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

[Feature] Styleguidist overhaul #766

Merged
merged 2 commits into from
Sep 4, 2023
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
2 changes: 1 addition & 1 deletion .styleguidist/StyleGuideRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Classes } from 'jss';
import Ribbon from 'react-styleguidist/lib/client/rsg-components/Ribbon';
import Version from 'react-styleguidist/lib/client/rsg-components/Version';
import * as Rsg from 'react-styleguidist/lib/typings';
import { Alert } from '../src/core/Alert/';
import { Alert } from '../src/core/Alert/Alert';

const styles = ({
color,
Expand Down
2 changes: 1 addition & 1 deletion .styleguidist/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { IconArchive } from 'suomifi-ui-components';
<IconArchive color="green" mousePointer />;
```

To use icons as a property for other components, simply give an icon element with the desired properties as a value for the component property.
To use icons as a property for other components, simply provide an icon element with the desired properties as a value for the component property.

```js
import { Button, IconLogin } from 'suomifi-ui-components';
Expand Down
46 changes: 16 additions & 30 deletions .styleguidist/styleguidist.sections.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
const path = require('path');
const glob = require('glob');
const versions = require('../styleguide.versions');

const primitiveComponents = [
const singularComponents = [
'Block',
'Button',
'Heading',
'Tooltip',
'VisuallyHidden',
'Pagination',
'Alert',
'InlineAlert',
'LoadingSpinner',
'Text',
'Paragraph',
'Notification',
'Toast',
['Form', 'TextInput'],
['Form', 'SearchInput'],
['Form', 'Textarea'],
['Form', 'DateInput'],
['Form', 'Label'],
['Form', 'HintText'],
['Form', 'StatusText'],
['Form/Select/MultiSelect/', 'MultiSelect'],
['Form/Select', 'SingleSelect'],
];

const getComponent = ({ name, underName }) =>
Expand Down Expand Up @@ -118,7 +126,7 @@ module.exports = {
{
name: 'Components',
content: './.styleguidist/components.md',
components: getComponents(primitiveComponents),
components: getComponents(singularComponents),
sections: [
{
name: 'Toggle',
Expand All @@ -127,21 +135,6 @@ module.exports = {
'ToggleInput/ToggleInput',
]),
},
{
name: 'Text',
components: getComponents(['Text', 'Paragraph']),
},
{
name: 'Alert',
components: getComponentWithVariants('Alert')([
'Alert/Alert',
'InlineAlert/InlineAlert',
]),
},
{
name: 'LoadingSpinner',
components: getComponents(['LoadingSpinner']),
},
{
name: 'Checkbox',
components: getComponentWithVariants('Form/Checkbox')([
Expand Down Expand Up @@ -183,7 +176,7 @@ module.exports = {
name: 'Icon',
content: './.styleguidist/icon.md',
},
{
/*{
name: 'MultiSelect',
components: getComponentWithVariants('Form/Select')([
'MultiSelect/MultiSelect/MultiSelect',
Expand All @@ -194,7 +187,7 @@ module.exports = {
components: getComponentWithVariants('Form/Select')([
'SingleSelect/SingleSelect',
]),
},
}, */
{
name: 'Breadcrumb',
components: getComponentWithVariants('Breadcrumb')([
Expand All @@ -217,32 +210,25 @@ module.exports = {
'LanguageMenuLink/LanguageMenuLink',
]),
},
{
name: 'Notification',
components: getComponents(['Notification']),
},
{
name: 'Expander',
components: getComponentWithVariants('Expander')([
'Expander/Expander',
'ExpanderGroup/ExpanderGroup',
'ExpanderTitle/ExpanderTitle',
'ExpanderTitleButton/ExpanderTitleButton',
'ExpanderContent/ExpanderContent',
'ExpanderGroup/ExpanderGroup',
'ExpanderTitle/ExpanderTitle',
]),
},
{
name: 'Modal',
components: getComponentWithVariants('Modal')([
'Modal/Modal',
'ModalContent/ModalContent',
'ModalTitle/ModalTitle',
'ModalFooter/ModalFooter',
]),
},
{
name: 'Toast',
components: getComponents(['Toast']),
},
{
name: 'WizardNavigation',
components: getComponentWithVariants('Navigation/WizardNavigation')([
Expand Down
Loading