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

docs[DST-519]: Clean up Marigold Docs/ Improve Nav #4161

Merged
merged 33 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
518597c
change sturcture of navigation and delete some pages
sarahgm Sep 11, 2024
7ce1ca5
adjust recipes
sarahgm Sep 11, 2024
75e37fe
add icons to overview
sarahgm Sep 12, 2024
3a30832
remove loog
sarahgm Sep 12, 2024
3e8176a
add overview page to concepts and foundation
sarahgm Sep 12, 2024
e36eaca
add overview for resources
sarahgm Sep 12, 2024
4ac555e
update overview page
sarahgm Sep 12, 2024
46d8f6a
add overview page for components
sarahgm Sep 12, 2024
125c4d4
typo
sarahgm Sep 12, 2024
3dc6491
make link correctly and add better responsible nav
sarahgm Sep 12, 2024
102057e
fix types in navigation
sarahgm Sep 12, 2024
5ad30c2
Create sweet-toys-shop.md
sarahgm Sep 12, 2024
bea6cd2
Merge branch 'main' into clean-up-documentation
sarahgm Sep 12, 2024
e6231f9
update overview page
sarahgm Sep 13, 2024
3a40008
Merge branch 'main' into clean-up-documentation
sarahgm Sep 16, 2024
9612453
adjust overview page for foundations
sarahgm Sep 16, 2024
478e68e
change order of foundations
sarahgm Sep 16, 2024
b43ac36
rename getting started to installation
sarahgm Sep 16, 2024
e416db6
moving stuff around
sarahgm Sep 16, 2024
daec023
update installation
sarahgm Sep 16, 2024
adff0b2
better icon and remove concepts
sarahgm Sep 16, 2024
3bb242d
fix type error in navigation
sarahgm Sep 16, 2024
8336676
changeback
sarahgm Sep 16, 2024
72420bc
upsi
sarahgm Sep 16, 2024
2d3b2b5
uodate concept links
sarahgm Sep 16, 2024
c434a27
.
sarahgm Sep 16, 2024
68d5de3
update other links from getting started and foundations
sarahgm Sep 16, 2024
21af079
Update sweet-toys-shop.md
sarahgm Sep 16, 2024
e3921dd
change order
sarahgm Sep 17, 2024
b2fe163
save
sarahgm Sep 17, 2024
49ca06a
should work now
sarahgm Sep 17, 2024
e29e0b8
update correctly
sarahgm Sep 17, 2024
a8cdd97
Update sweet-toys-shop.md
sarahgm Sep 18, 2024
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
12 changes: 12 additions & 0 deletions .changeset/sweet-toys-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@marigold/docs": patch
---

docs[DST-519]: Clean up Marigold Docs/ Improve Navigation

- deleted old files (scripts, about , release)
- updated some faqs
- improved the navigation structure
- added overview pages
- improved folder structure in code (a bit)
- adjust some links
35 changes: 19 additions & 16 deletions docs/app/_components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface NavigationLink {

interface NavigationSubsection {
name: string;
links: NavigationLink[];
links?: NavigationLink[];
}
interface NavigationSection {
name: string;
Expand All @@ -27,7 +27,7 @@ interface NavigationSection {
}

export const useNavigation = (): NavigationSection[] => {
const navigation = siteConfig.navigation;
const navigation = [...siteConfig.navigation] as NavigationSection[];

return navigation.map(({ name, slug, subsections = [] }) => {
// Section Page = has a section but NO subsection
Expand All @@ -44,19 +44,22 @@ export const useNavigation = (): NavigationSection[] => {
href: `/${page.slug}`,
badge: page.badge,
})),
subsections: subsections.map(subsection => ({
name: subsection.name,
links: allContentPages
.filter(
// Subsection Page = has a section AND a subsection
page => page.section === slug && page.subsection === subsection.slug
)
.map(page => ({
name: page.title,
href: `/${page.slug}`,
badge: page.badge,
})),
})),
subsections: subsections.map(
(subsection: { name: string; slug: string }) => ({
name: subsection.name,
links: allContentPages
.filter(
// Subsection Page = has a section AND a subsection
page =>
page.section === slug && page.subsection === subsection.slug
)
.map(page => ({
name: page.title,
href: `/${page.slug}`,
badge: page.badge,
})),
})
),
};
});
};
Expand Down Expand Up @@ -99,7 +102,7 @@ export const Navigation = ({ onClick }: NavigationProps) => {
{name}
</div>
<div className="border-secondary-300 ml-0.5 flex flex-col border-l">
{links.map(({ name, href, badge }) => (
{links?.map(({ name, href, badge }) => (
<div key={href}>
<NavLink
className="flex items-center gap-4"
Expand Down
4 changes: 2 additions & 2 deletions docs/app/_components/SiteHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const SiteHeader = () => (
<SiteLogo />
<SiteNavigation />
</div>
<div className="hidden md:block">
<div className="hidden lg:block">
<Link href="https://marigold-rapp.vercel.app/" variant="cta">
<span className="hidden xl:inline">Discover new </span>Tutorials!
<span className="hidden 2xl:inline">Discover new </span>Tutorials!
</Link>
</div>
<div className="flex flex-1 flex-col items-stretch md:block md:flex-initial">
Expand Down
5 changes: 1 addition & 4 deletions docs/app/_components/SiteNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export const SiteNavigation = () => {
const sections = navigation.map(section => ({
name: section.name,
slug: section.slug,
link:
section.subsections.length > 0
? section.subsections[0].links[0]
: section.links[0],
link: section.links[0],
}));

return (
Expand Down
2 changes: 1 addition & 1 deletion docs/content/components/application/provider/provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ caption: Provider which applies the theme.
Without the `<MarigoldProvider>` you can't get the theme on your components. So it is necessary to use.

You just have to wrap your components around the `<MarigoldProvider>` to make it work.
If you want to get more information about the setup go to [Getting Started](/introduction/getting-started/#bootstrapping).
If you want to get more information about the setup go to [Getting Started](/getting-started/installation/#bootstrapping).

```tsx
import { Button, MarigoldProvider } from '@marigold/components';
Expand Down
4 changes: 2 additions & 2 deletions docs/content/components/collection/table/table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ To make async sorting more convenient, you can use the `useAsyncList` hook. The

### Handling numeric values

With our formatting helper components for dates and numeric values you can easily ensure consistent and accurate display. See [NumericFormat](../formatters/numericformat/numericFormat), [DateFormat](../formatters/dateformat/dateFormat) for more informations.
With our formatting helper components for dates and numeric values you can easily ensure consistent and accurate display. See [NumericFormat](../formatters/numericformat), [DateFormat](../formatters/dateformat) for more informations.

Also you see how to use the `align` property on the columns. With that you can set the content of a column to left, center or right.

Expand Down Expand Up @@ -317,7 +317,7 @@ Choosing the right alternative to data tables is crucial for effectively display
</li>
</ul>

Is there still not the right alternative for you please [get in touch](../../introduction/get-in-touch) with us!
Is there still not the right alternative for you please [get in touch](../../resources/get-in-touch) with us!

## Related

Expand Down
6 changes: 3 additions & 3 deletions docs/content/components/content/icon/icon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ title: Icon
caption: Component to render Icons.
---

On this page you can learn how [Marigold Icons](/concepts/icons/) should be used.
On this page you can learn how [Marigold Icons](/foundations/icons/) should be used.
Icons itself can be used to improve visual interest and get users attention.

The size of the icon can be change via the `size` prop. The default size is `24px`.
The color of the icon refers to the property [`currentcolor`](https://www.w3schools.com/colors/colors_currentcolor.asp).

For a full list of the available Icons go to the [Marigold Icons](/concepts/icons/).
For a full list of the available Icons go to the [Marigold Icons](/foundations/icons/).

## Import

Expand All @@ -33,7 +33,7 @@ To import a specific component you just have to use the name of the icon directl
import { DesignTicket } from '@marigold/icons';
```

Alternatively you can go to [Marigold Icons](/concepts/icons/) and click on an Icon in the list to copy them as `<svg>` Element.
Alternatively you can go to [Marigold Icons](/foundations/icons/) and click on an Icon in the list to copy them as `<svg>` Element.

## Props

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ import { SectionMessage } from '@marigold/components';

### Info Section Message

This is the default info `<SectionMessage>`. The color is in a blue tone and contains the [`<Info>`](/concepts/icons/#info) icon.
This is the default info `<SectionMessage>`. The color is in a blue tone and contains the [`<Info>`](/foundations/icons/#info) icon.

<ComponentDemo file="./section-message-info.demo.tsx" />

### Warning Section Message

Here you can see the warning `<SectionMessage>`. The color is in a yellow tone and contains the[`<Notification>`](/concepts/icons/#info) icon.
Here you can see the warning `<SectionMessage>`. The color is in a yellow tone and contains the[`<Notification>`](/foundations/icons/#info) icon.

<ComponentDemo file="./section-message-warn.demo.tsx" />

### Error Section Message

The error `<SectionMessage>` is colored in a red tone and contains the [`<Exclamation>`](/concepts/icons/#info) icon.
The error `<SectionMessage>` is colored in a red tone and contains the [`<Exclamation>`](/foundations/icons/#info) icon.

<ComponentDemo file="./section-message-error.demo.tsx" />
2 changes: 1 addition & 1 deletion docs/content/components/content/svg/svg.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ In this example you can see how to use the `<SVG>` element.

### Colorize

To modify the color, adjust the `color` prop using a [design token](/introduction/design-tokens).
To modify the color, adjust the `color` prop using a [design token](/foundations/design-tokens).

<ComponentDemo file="./svg-color.demo.tsx" />
6 changes: 3 additions & 3 deletions docs/content/components/form/form/form.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ caption: Wrap your fields to submit user data and enable input validation.

The `<Form>` component acts as a container for a set of fields, enabling data transmission to a server. It operates like a standard HTML form, initiating either a request based on the specified `method` attribute.

Additionally, the `<Form>` allows to validate user input and offers feedback for incorrect data entries, enhancing the overall resilience and user-friendliness of the form submission process. See the [Validation](/concepts/validation) guide to learn more about form validation.
Additionally, the `<Form>` allows to validate user input and offers feedback for incorrect data entries, enhancing the overall resilience and user-friendliness of the form submission process. See the [Validation](/foundations/validation) guide to learn more about form validation.

## Import

Expand Down Expand Up @@ -41,7 +41,7 @@ The `<Form>` component handles passed errors, typically received from a server a

<ComponentDemo file="./form-validation-errors.demo.tsx" />

For more information about form validation, see the [Validation](/concepts/validation) guide.
For more information about form validation, see the [Validation](/foundations/validation) guide.

### Focus Management

Expand All @@ -54,6 +54,6 @@ As you can see in the previous server errors example, when a user submits a form
<SectionMessage type="info">
<SectionMessage.Title>Want more?!</SectionMessage.Title>
<SectionMessage.Content>
You can find more examples and usages of the `<Form>` component on the [Validation](/concepts/validation) page and in the [Forms](/recipes/form-recipes) recipes.
You can find more examples and usages of the `<Form>` component on the [Validation](/foundations/validation) page and in the [Forms](/recipes/form-recipes) recipes.
</SectionMessage.Content>
</SectionMessage>
2 changes: 1 addition & 1 deletion docs/content/components/form/number-field/number-field.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ the user about the error. The message disappears automatically when all requirem
},
{
title: 'NumericFormat',
href: '../formatters/numericformat/numericFormat',
href: '../formatters/numericformat',
caption:
'Helper component for formatting numeric based on the current language and locale-specific conventions.',
icon: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can pass the following parameters to your useResponsiveValue hook:

The first parameter of the hook will be the values as array which defines the breakpoints. The second argument must be the `defaultIndex` which points opn the default value.

If you want to have a look on all possible breakpoints from the theme you can have a look [here](../introduction/design-tokens#breakpoints).
If you want to have a look on all possible breakpoints from the theme you can have a look [here](../foundations/design-tokens#breakpoints).

Also with Tailwind some new class names came along which you can use to add styles by using the responsive modifiers (like: sm:text-sm).

Expand Down
6 changes: 3 additions & 3 deletions docs/content/components/layout/inline/inline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ badge: updated

The `<Inline>` component is a responsive layout component based on [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox). It aligns its content horizontally in a row and automatically wraps to a new line when there isn't enough space on the screen.

Use the inline component in combination with other layout components to easily [create customized layouts](../../concepts/layouts).
Use the inline component in combination with other layout components to easily [create customized layouts](../../foundations/layouts).

## Usage

If you have more than two elements you can use the `<Inline>` component to arrange elements horizontally according to the space required.
For adding the space between the elements you need to use the `space` property and set it to a supported [space value](../../introduction/design-tokens#spacing).
For adding the space between the elements you need to use the `space` property and set it to a supported [space value](../../foundations/design-tokens#spacing).

<ComponentDemo file="./inline-elements.demo.tsx" />

Expand Down Expand Up @@ -51,7 +51,7 @@ For horizontally alignment you can use the `alignX` prop.
items={[
{
title: 'Building layouts',
href: '../../concepts/layouts',
href: '../../foundations/layouts',
caption: 'Learn how to build layouts.',
icon: (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="size-6">
Expand Down
2 changes: 1 addition & 1 deletion docs/content/components/layout/split/split.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ What applies to the inline is also possible with the stack component. You have t
items={[
{
title: 'Building layouts',
href: '../../concepts/layouts',
href: '../../foundations/layouts',
caption: 'Learn how to build layouts.',
icon: (
<svg
Expand Down
6 changes: 3 additions & 3 deletions docs/content/components/layout/stack/stack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ badge: updated

The `<Stack>` component is a responsive layout component based on [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox). The stack is basically a flexbox column that acts as a container that aligns its children vertically in new lines. The component should be used wherever you need to arrange elements stacked on top of each other.

Use the stack component in combination with other layout components to easily [create customized layouts](../../concepts/layouts).
Use the stack component in combination with other layout components to easily [create customized layouts](../../foundations/layouts).

## Usage

The use of `<Stack>` is recommended if you have two or more elements that must be the same distance apart. For the space you have to use our supported [space values](../../introduction/design-tokens#spacing).
The use of `<Stack>` is recommended if you have two or more elements that must be the same distance apart. For the space you have to use our supported [space values](../../foundations/design-tokens#spacing).

In this example you can see, the space prop ensures that each child is separated by the same space which maintains visual consistency.

Expand Down Expand Up @@ -59,7 +59,7 @@ The following example shows how stacks can be nested within each other. You see
items={[
{
title: 'Building layouts',
href: '../../concepts/layouts',
href: '../../foundations/layouts',
caption: 'Learn how to build layouts.',
icon: (
<svg
Expand Down
Loading
Loading