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

v0.4.0 #36

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0c06223
Initial stuff
louisescher Dec 25, 2024
ecdc88e
Add new colors, standardize radii with radii.css
louisescher Dec 25, 2024
c6d3f2f
Fix spacing in tabs.ts
louisescher Dec 26, 2024
2628365
Remove leftover playground references
louisescher Dec 26, 2024
09c6000
Update astro version to 5.1.1 and typescript to 5.7.2
louisescher Dec 26, 2024
04928fd
Virtualize component scripts
louisescher Jan 14, 2025
abaf1a7
Update link for options documentation
louisescher Jan 14, 2025
2ffd4b1
Add ability to use custom CSS files for customization
louisescher Jan 15, 2025
be70bf5
Add accordion stuff
louisescher Jan 15, 2025
819f21b
Fix accordion logic
louisescher Jan 15, 2025
0832fd3
fix vite dep to conform to the rest of the StudioCMS Ecosystem (#37)
Adammatthiesen Jan 15, 2025
3ea97e6
Add accordion docs & finish component
louisescher Jan 16, 2025
45638fa
Allow for button to automatically render as anchor tag if href is passed
louisescher Jan 16, 2025
94ff475
Add badge to accordion in sidebar
louisescher Jan 16, 2025
5d74164
stuuuuuf
TheOtterlord Jan 16, 2025
f064ce6
Stuffs
louisescher Jan 16, 2025
b53742f
Add styles
louisescher Jan 16, 2025
8aa1a78
Merge changes
TheOtterlord Jan 16, 2025
ec25cd0
Ending conflicts and saving the world
TheOtterlord Jan 16, 2025
6ef4f32
Observe and update in response to theme change
TheOtterlord Jan 16, 2025
26a4a69
Format and add "no changes made" text
louisescher Jan 16, 2025
ca0262a
Final touches on dev toolbar app and docs for customization
louisescher Jan 16, 2025
d8ff9ff
Fix types on button component
louisescher Jan 16, 2025
7c82fa1
Update packages/studiocms_ui/src/integration.ts
louisescher Jan 16, 2025
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 .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["ui-playground", "docs"]
"ignore": ["docs"]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@
"editor.gotoLocation.multipleDefinitions": "goto",
"cSpell.words": [
"astrojs",
"checkmark",
"createtoast",
"dismissable",
"Eleventy",
"fira",
"fontsource",
"frontmatter",
"heroicons",
"iconify",
"louisescher",
"Matthiesen",
"onest",
"pathe",
"polyline",
"searchselect",
"socialproof",
"studiocms",
"themetoggle",
"Thum",
"tsconfigs",
"vite",
"withstudiocms"
]
}
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"recommended": true,
"suspicious": {
"noExplicitAny": "warn"
},
"style": {
"noNonNullAssertion": "off"
}
}
},
Expand Down
15 changes: 10 additions & 5 deletions docs/astro.config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import starlight from '@astrojs/starlight';
import onestWoff2 from '@fontsource-variable/onest/files/onest-latin-wght-normal.woff2?url';
import ui from '@studiocms/ui';
import { defineConfig, envField } from 'astro/config';
import rehypePluginKit from './src/plugins/rehypePluginKit';

Expand Down Expand Up @@ -158,10 +159,6 @@ export default defineConfig({
{
label: 'Installation',
link: 'docs/',
badge: {
text: 'Updated!',
variant: 'success',
},
},
{
label: 'Release Notes',
Expand All @@ -174,7 +171,14 @@ export default defineConfig({
],
},
{
label: 'Upgrade Guides',
label: 'Guides',
autogenerate: {
directory: 'docs/guides',
collapsed: true,
},
},
{
label: 'Upgrading StudioCMS',
autogenerate: {
directory: 'docs/upgrade-guides',
collapsed: true,
Expand All @@ -196,5 +200,6 @@ export default defineConfig({
},
],
}),
ui()
],
});
4 changes: 4 additions & 0 deletions docs/src/content/docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ editUrl: false
This document contains release notes for the `@studiocms/ui` package.
For more information, see the [CHANGELOG file](https://github.com/withstudiocms/ui/blob/main/packages/studiocms_ui/CHANGELOG.md)

## 0.3.2

- [#33](https://github.com/withstudiocms/ui/pull/33) [`58e223c`](https://github.com/withstudiocms/ui/commit/58e223c861321e95c8db064be67e28e4563b4ff3) Thanks [@louisescher](https://github.com/louisescher)! - Fix tabs not being displayed correctly & dividers displaying backgrounds for empty slots

## 0.3.1

- [#27](https://github.com/withstudiocms/ui/pull/27) [`6b0b58f`](https://github.com/withstudiocms/ui/commit/6b0b58fbbe2a92d4bce7fa44c587164b8f2f53e5) Thanks [@louisescher](https://github.com/louisescher)! - Add pathe as a dependency to deal with path issues on Windows
Expand Down
139 changes: 139 additions & 0 deletions docs/src/content/docs/docs/components/accordion.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
title: Accordion
sidebar:
badge:
text: New!
variant: success
---

import { Tabs, TabItem } from '@astrojs/starlight/components';
import PreviewCard from '~/components/PreviewCard.astro';
import { Accordion, AccordionItem } from '@studiocms/ui/components';

An accordion component. Used to create small pockets of additional information.

## Usage

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Accordion>
<AccordionItem open>
<div slot="summary">This is the summary</div>
<div>These are the details</div>
</AccordionItem>
<AccordionItem>
<div slot="summary">This is the 2nd summary</div>
<div>These are the 2nd details</div>
</AccordionItem>
</Accordion>
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="AccordionExample.astro"
---
import { Accordion, AccordionItem } from '@studiocms/ui/components';
---

<Accordion>
<AccordionItem open>
<div slot="summary">This is the summary</div>
<div>These are the details</div>
</AccordionItem>
<AccordionItem>
<div slot="summary">This is the 2nd summary</div>
<div>These are the 2nd details</div>
</AccordionItem>
</Accordion>
```
</TabItem>
</Tabs>

### Opening an item by default

You can pass the `open` prop to any `<AccordionItem>` to have it be open by default, as seen above in the example.

### Styles

The accordion component has multiple different styles:

- `outlined` (Default)
- `separated`
- `filled`
- `blank`

They can be used via the `style` prop on the accordion parent. Here's an accordion with the `filled` style:

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Accordion style="filled">
<AccordionItem open>
<div slot="summary">This is the summary</div>
<div>These are the details</div>
</AccordionItem>
<AccordionItem>
<div slot="summary">This is the 2nd summary</div>
<div>These are the 2nd details</div>
</AccordionItem>
</Accordion>
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="AccordionStyleExample.astro"
---
import { Accordion, AccordionItem } from '@studiocms/ui/components';
---

<Accordion style="filled">
<AccordionItem open>
<div slot="summary">This is the summary</div>
<div>These are the details</div>
</AccordionItem>
<AccordionItem>
<div slot="summary">This is the 2nd summary</div>
<div>These are the 2nd details</div>
</AccordionItem>
</Accordion>
```
</TabItem>
</Tabs>

### Multiple Open Items

By default, users can open multiple items in the accordion at once. You can change this behavior by setting the `multipleOpen` prop on the `<Accordion>` element to false:

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Accordion multipleOpen={false}>
<AccordionItem open>
<div slot="summary">This is the summary</div>
<div>These are the details</div>
</AccordionItem>
<AccordionItem>
<div slot="summary">This is the 2nd summary</div>
<div>These are the 2nd details</div>
</AccordionItem>
</Accordion>
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="AccordionStyleExample.astro"
---
import { Accordion, AccordionItem } from '@studiocms/ui/components';
---

<Accordion multipleOpen={false}>
<AccordionItem open>
<div slot="summary">This is the summary</div>
<div>These are the details</div>
</AccordionItem>
<AccordionItem>
<div slot="summary">This is the 2nd summary</div>
<div>These are the 2nd details</div>
</AccordionItem>
</Accordion>
```
</TabItem>
</Tabs>
132 changes: 132 additions & 0 deletions docs/src/content/docs/docs/components/badge.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
title: Badge
sidebar:
badge:
text: New!
variant: success
---

import { Badge } from '@studiocms/ui/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
import PreviewCard from '~/components/PreviewCard.astro';

A button component with support for different colors, sizes and states out of the box. You can also customize it to your needs!

## Usage

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Badge label="Badge" icon="sparkles-16-solid" />
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="BadgeExample.astro"
---
import { Badge } from '@studiocms/ui/components';
---

<Badge label="Badge" icon="sparkles-16-solid" />
```
</TabItem>
</Tabs>

### Colors

The badge component has support for the following colors:

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Badge label="Primary" color="primary" />
<Badge label="Success" color="success" />
<Badge label="Warning" color="warning" />
<Badge label="Danger" color="danger" />
<Badge label="Info" color="info" />
<Badge label="Monochrome" color="mono" />
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="BadgeColorExample.astro"
---
import { Badge } from '@studiocms/ui/components';
---

<Badge label="Primary" color="primary" />
<Badge label="Success" color="success" />
<Badge label="Warning" color="warning" />
<Badge label="Danger" color="danger" />
<Badge label="Info" color="info" />
<Badge label="Monochrome" color="mono" />
```
</TabItem>
</Tabs>

### Variants

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Badge label="Default" variant="default" />
<Badge label="Outlined" variant="outlined" />
<Badge label="Flat" variant="flat" />
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="BadgeSizeExample.astro"
---
import { Badge } from '@studiocms/ui/components';
---

<Badge label="Default" variant="default" />
<Badge label="Outlined" variant="outlined" />
<Badge label="Flat" variant="flat" />
```
</TabItem>
</Tabs>

### Rounding

You can change the badge's border-radius by setting the `rounding` prop:

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Badge label="Full" rounding="full" />
<Badge label="Semi" rounding="semi" />
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="BadgeSizeExample.astro"
---
import { Badge } from '@studiocms/ui/components';
---

<Badge label="Full" rounding="full" />
<Badge label="Semi" rounding="semi" />
```
</TabItem>
</Tabs>

### Sizes

<Tabs>
<TabItem label="Preview">
<PreviewCard>
<Badge label="Small" size="sm" />
<Badge label="Medium" size="md" />
<Badge label="Large" size="lg" />
</PreviewCard>
</TabItem>
<TabItem label="Code">
```astro showLinenumbers title="BadgeSizeExample.astro"
---
import { Badge } from '@studiocms/ui/components';
---

<Badge label="Small" size="sm" />
<Badge label="Medium" size="md" />
<Badge label="Large" size="lg" />
```
</TabItem>
</Tabs>
Loading
Loading