shapes-ui 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +47 -0
- package/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +31 -0
- package/.github/pull_request_template.md +14 -0
- package/.github/workflows/pr-preview.yml +68 -0
- package/.github/workflows/release.yml +8 -0
- package/CHANGELOG.md +19 -0
- package/CODE_OF_CONDUCT.md +41 -0
- package/CONTRIBUTING.md +52 -0
- package/README.md +5 -0
- package/SECURITY.md +0 -0
- package/content/components/field.mdx +2 -2
- package/content/components/fieldset.mdx +1 -1
- package/content/components/radio.mdx +20 -0
- package/content/components/select.mdx +30 -0
- package/content/components/slider.mdx +48 -0
- package/content/components/switch.mdx +26 -0
- package/content/components/tabs.mdx +32 -0
- package/content/components/toast.mdx +60 -0
- package/content/components/toggle.mdx +34 -2
- package/content/components/toolbar.mdx +26 -0
- package/content/components/tooltip.mdx +25 -0
- package/content-collections.ts +1 -1
- package/examples/__index.tsx +186 -0
- package/examples/checkbox-demo.tsx +1 -1
- package/examples/checkbox-form.tsx +3 -3
- package/examples/field-custom-control.tsx +33 -9
- package/examples/form-demo.tsx +5 -10
- package/examples/menu-advanced.tsx +1 -3
- package/examples/menu-align.tsx +19 -16
- package/examples/menu-checkbox.tsx +2 -3
- package/examples/menu-demo.tsx +1 -3
- package/examples/menu-group.tsx +1 -3
- package/examples/menu-radio.tsx +1 -3
- package/examples/menu-submenu.tsx +2 -3
- package/examples/meter-demo.tsx +10 -2
- package/examples/meter-flip.tsx +8 -8
- package/examples/meter-no-label.tsx +9 -2
- package/examples/meter-no-value.tsx +7 -8
- package/examples/radio-card.tsx +28 -0
- package/examples/radio-demo.tsx +19 -1
- package/examples/radio-description.tsx +26 -0
- package/examples/radio-orientation.tsx +21 -0
- package/examples/select-alignment.tsx +51 -0
- package/examples/select-demo.tsx +36 -1
- package/examples/select-disabled.tsx +38 -0
- package/examples/select-groups.tsx +54 -0
- package/examples/select-invalid.tsx +41 -0
- package/examples/select-scrollable.tsx +112 -0
- package/examples/slider-controlled.tsx +28 -0
- package/examples/slider-demo.tsx +3 -1
- package/examples/slider-disabled.tsx +7 -0
- package/examples/slider-edge.tsx +13 -0
- package/examples/slider-multiple.tsx +7 -0
- package/examples/slider-range.tsx +5 -0
- package/examples/slider-vertical.tsx +10 -0
- package/examples/switch-demo.tsx +19 -1
- package/examples/switch-disabled.tsx +20 -0
- package/examples/switch-sizes.tsx +24 -0
- package/examples/switch-with-label.tsx +16 -0
- package/examples/tabs-demo.tsx +14 -1
- package/examples/tabs-disabled.tsx +21 -0
- package/examples/tabs-line.tsx +18 -0
- package/examples/tabs-vertical.tsx +13 -0
- package/examples/toast-action.tsx +39 -0
- package/examples/toast-anchored.tsx +36 -0
- package/examples/toast-demo.tsx +27 -1
- package/examples/toast-positions.tsx +54 -0
- package/examples/toast-promise.tsx +51 -0
- package/examples/toast-stacked.tsx +30 -0
- package/examples/toast-timeout.tsx +43 -0
- package/examples/toast-update.tsx +38 -0
- package/examples/toast-variants.tsx +54 -0
- package/examples/toggle-controlled.tsx +20 -0
- package/examples/toggle-demo.tsx +7 -51
- package/examples/toggle-group-demo.tsx +19 -0
- package/examples/toggle-group-multiple.tsx +19 -0
- package/examples/toggle-icon-fill.tsx +12 -0
- package/examples/toolbar-demo.tsx +45 -21
- package/examples/toolbar-input-link.tsx +35 -0
- package/examples/toolbar-menu.tsx +53 -0
- package/examples/tooltip-demo.tsx +48 -0
- package/examples/tooltip-positions.tsx +60 -0
- package/package.json +8 -8
- package/public/r/drawer.json +1 -1
- package/public/r/field.json +1 -1
- package/public/r/meter.json +1 -1
- package/public/r/number-field.json +1 -1
- package/public/r/progress.json +1 -1
- package/public/r/radio.json +1 -1
- package/public/r/select.json +1 -1
- package/public/r/slider.json +1 -1
- package/public/r/switch.json +1 -1
- package/public/r/tabs.json +1 -1
- package/public/r/toast.json +2 -1
- package/public/r/toggle.json +1 -1
- package/public/r/toolbar.json +1 -1
- package/public/r/tooltip.json +15 -0
- package/src/components/docs/layout/header.tsx +4 -14
- package/src/components/docs/layout/mobile-menu.tsx +27 -78
- package/src/components/docs/layout/nav-list.tsx +27 -21
- package/src/components/docs/layout/split-layout.tsx +6 -3
- package/src/components/ui/badge.tsx +1 -1
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/drawer.tsx +1 -1
- package/src/components/ui/field.tsx +9 -28
- package/src/components/ui/form.tsx +1 -1
- package/src/components/ui/meter.tsx +12 -26
- package/src/components/ui/number-field.tsx +1 -1
- package/src/components/ui/radio.tsx +32 -19
- package/src/components/ui/select.tsx +6 -6
- package/src/components/ui/slider.tsx +8 -5
- package/src/components/ui/switch.tsx +13 -17
- package/src/components/ui/tabs.tsx +23 -10
- package/src/components/ui/toast.tsx +190 -29
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/toolbar.tsx +17 -4
- package/src/components/ui/tooltip.tsx +54 -0
- package/src/routes/__root.tsx +3 -5
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a reproducible bug in Shapes UI
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels:
|
|
5
|
+
- bug
|
|
6
|
+
body:
|
|
7
|
+
- type: markdown
|
|
8
|
+
attributes:
|
|
9
|
+
value: |
|
|
10
|
+
Thanks for filing a bug report.
|
|
11
|
+
- type: input
|
|
12
|
+
id: summary
|
|
13
|
+
attributes:
|
|
14
|
+
label: Summary
|
|
15
|
+
description: Short description of the bug
|
|
16
|
+
placeholder: Button variant "ghost" has wrong text color
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: steps
|
|
21
|
+
attributes:
|
|
22
|
+
label: Steps to reproduce
|
|
23
|
+
description: Exact steps so we can reproduce reliably
|
|
24
|
+
placeholder: |
|
|
25
|
+
1. Go to ...
|
|
26
|
+
2. Click ...
|
|
27
|
+
3. See error ...
|
|
28
|
+
validations:
|
|
29
|
+
required: true
|
|
30
|
+
- type: textarea
|
|
31
|
+
id: expected
|
|
32
|
+
attributes:
|
|
33
|
+
label: Expected behavior
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: actual
|
|
38
|
+
attributes:
|
|
39
|
+
label: Actual behavior
|
|
40
|
+
validations:
|
|
41
|
+
required: true
|
|
42
|
+
- type: input
|
|
43
|
+
id: environment
|
|
44
|
+
attributes:
|
|
45
|
+
label: Environment
|
|
46
|
+
description: OS, browser, package manager, Node.js version
|
|
47
|
+
placeholder: macOS 15, Chrome 141, pnpm 9, Node 24
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose an improvement or new component
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels:
|
|
5
|
+
- enhancement
|
|
6
|
+
body:
|
|
7
|
+
- type: input
|
|
8
|
+
id: problem
|
|
9
|
+
attributes:
|
|
10
|
+
label: Problem to solve
|
|
11
|
+
description: What problem are you trying to solve?
|
|
12
|
+
placeholder: I need a compact tooltip pattern for dense UIs
|
|
13
|
+
validations:
|
|
14
|
+
required: true
|
|
15
|
+
- type: textarea
|
|
16
|
+
id: proposal
|
|
17
|
+
attributes:
|
|
18
|
+
label: Proposed solution
|
|
19
|
+
description: Describe the API/UX you expect
|
|
20
|
+
validations:
|
|
21
|
+
required: true
|
|
22
|
+
- type: textarea
|
|
23
|
+
id: alternatives
|
|
24
|
+
attributes:
|
|
25
|
+
label: Alternatives considered
|
|
26
|
+
description: Any alternatives or workarounds you tried?
|
|
27
|
+
- type: textarea
|
|
28
|
+
id: additional
|
|
29
|
+
attributes:
|
|
30
|
+
label: Additional context
|
|
31
|
+
description: Links, mockups, examples, prior art
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: PR Preview
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- reopened
|
|
8
|
+
- synchronize
|
|
9
|
+
- closed
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: pr-preview-${{ github.event.pull_request.number }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
deploy-preview:
|
|
17
|
+
name: Deploy Preview
|
|
18
|
+
if: github.event.action != 'closed'
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
pull-requests: write
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout Repo
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Setup Node.js 24
|
|
28
|
+
uses: actions/setup-node@v4
|
|
29
|
+
with:
|
|
30
|
+
node-version: 24
|
|
31
|
+
|
|
32
|
+
- name: Install pnpm
|
|
33
|
+
uses: pnpm/action-setup@v3
|
|
34
|
+
with:
|
|
35
|
+
version: 9
|
|
36
|
+
|
|
37
|
+
- name: Install Dependencies
|
|
38
|
+
run: pnpm install --frozen-lockfile
|
|
39
|
+
|
|
40
|
+
- name: Deploy Preview Worker
|
|
41
|
+
uses: cloudflare/wrangler-action@v3
|
|
42
|
+
with:
|
|
43
|
+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
44
|
+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
45
|
+
command: "deploy --name shapes-ui-pr-${{ github.event.pull_request.number }}"
|
|
46
|
+
|
|
47
|
+
- name: Comment Preview URL
|
|
48
|
+
uses: marocchino/sticky-pull-request-comment@v2
|
|
49
|
+
with:
|
|
50
|
+
header: preview-url
|
|
51
|
+
message: |
|
|
52
|
+
Preview deployed
|
|
53
|
+
|
|
54
|
+
https://shapes-ui-pr-${{ github.event.pull_request.number }}.workers.dev
|
|
55
|
+
|
|
56
|
+
cleanup-preview:
|
|
57
|
+
name: Cleanup Preview
|
|
58
|
+
if: github.event.action == 'closed'
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
permissions:
|
|
61
|
+
contents: read
|
|
62
|
+
steps:
|
|
63
|
+
- name: Delete Preview Worker
|
|
64
|
+
uses: cloudflare/wrangler-action@v3
|
|
65
|
+
with:
|
|
66
|
+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
67
|
+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
68
|
+
command: "delete shapes-ui-pr-${{ github.event.pull_request.number }} --force"
|
|
@@ -44,3 +44,11 @@ jobs:
|
|
|
44
44
|
title: "chore: version packages"
|
|
45
45
|
env:
|
|
46
46
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
+
|
|
48
|
+
- name: Deploy Production Worker
|
|
49
|
+
if: steps.changesets.outputs.published == 'true'
|
|
50
|
+
uses: cloudflare/wrangler-action@v3
|
|
51
|
+
with:
|
|
52
|
+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
53
|
+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
54
|
+
command: deploy
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# shapes-ui
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7d13a9b: Added tooltip and examples
|
|
8
|
+
- 798be1a: Updated component examples and styles
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 357a7eb: Switch style and exmaple updates
|
|
13
|
+
- 43bfe67: Updated toolbar and examples
|
|
14
|
+
- bc2c06c: UPdated select and select examples
|
|
15
|
+
- 84e7508: Updated toggle and toggle group styles and examples
|
|
16
|
+
- 1c68cea: Updated slider component and examples
|
|
17
|
+
- 46d5f5d: Updated mobile nav to use drawer cmpoennt
|
|
18
|
+
- 8fc90b8: Updated toast ui and examples
|
|
19
|
+
- 33459d3: Updated examples and dependencies
|
|
20
|
+
- 8ce682c: Updated tabs styles and examples
|
|
21
|
+
|
|
3
22
|
## 0.4.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our pledge
|
|
4
|
+
|
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone.
|
|
6
|
+
|
|
7
|
+
## Our standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to a positive environment:
|
|
10
|
+
|
|
11
|
+
- Being respectful and constructive
|
|
12
|
+
- Giving and accepting feedback gracefully
|
|
13
|
+
- Focusing on what is best for the community
|
|
14
|
+
- Showing empathy toward other people
|
|
15
|
+
|
|
16
|
+
Examples of unacceptable behavior:
|
|
17
|
+
|
|
18
|
+
- Harassment, discrimination, or personal attacks
|
|
19
|
+
- Trolling, insulting, or derogatory comments
|
|
20
|
+
- Public or private intimidation
|
|
21
|
+
- Publishing others' private information without permission
|
|
22
|
+
|
|
23
|
+
## Enforcement responsibilities
|
|
24
|
+
|
|
25
|
+
Project maintainers are responsible for clarifying and enforcing standards of acceptable behavior.
|
|
26
|
+
|
|
27
|
+
## Scope
|
|
28
|
+
|
|
29
|
+
This Code of Conduct applies in project spaces and in public spaces when an individual is representing the project.
|
|
30
|
+
|
|
31
|
+
## Reporting
|
|
32
|
+
|
|
33
|
+
To report violations, contact:
|
|
34
|
+
|
|
35
|
+
- **Email:** conduct@shapes-ui.dev
|
|
36
|
+
|
|
37
|
+
All reports will be reviewed and investigated promptly and fairly.
|
|
38
|
+
|
|
39
|
+
## Enforcement
|
|
40
|
+
|
|
41
|
+
Maintainers may take any action they deem appropriate in response to unacceptable behavior, including warning or temporary/permanent ban from participation.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Contributing to Shapes UI
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
- Use Node.js 24+
|
|
8
|
+
- Use pnpm 9+
|
|
9
|
+
|
|
10
|
+
Install dependencies:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Run locally:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Common commands
|
|
23
|
+
|
|
24
|
+
- `pnpm dev` — start local dev server
|
|
25
|
+
- `pnpm test` — run tests
|
|
26
|
+
- `pnpm lint` — run lint checks
|
|
27
|
+
- `pnpm build` — build app
|
|
28
|
+
- `pnpm build:cli` — build CLI
|
|
29
|
+
- `pnpm gen:examples` — generate examples
|
|
30
|
+
- `pnpm gen:registry` — generate registry artifacts
|
|
31
|
+
|
|
32
|
+
## Pull requests
|
|
33
|
+
|
|
34
|
+
Before opening a PR:
|
|
35
|
+
|
|
36
|
+
1. Keep changes focused and scoped.
|
|
37
|
+
2. Run `pnpm test` and `pnpm lint`.
|
|
38
|
+
3. Update docs/examples when behaviour changes.
|
|
39
|
+
4. Add a changeset when a publishable package change is intended.
|
|
40
|
+
|
|
41
|
+
PRs get a preview deployment automatically.
|
|
42
|
+
|
|
43
|
+
## Release process
|
|
44
|
+
|
|
45
|
+
Releases are handled through Changesets:
|
|
46
|
+
|
|
47
|
+
- A release PR is created from changesets.
|
|
48
|
+
- Production deployment runs when the release is published.
|
|
49
|
+
|
|
50
|
+
## Reporting issues
|
|
51
|
+
|
|
52
|
+
Use the issue templates for bug reports and feature requests so maintainers can triage quickly.
|
package/README.md
CHANGED
package/SECURITY.md
ADDED
|
File without changes
|
|
@@ -14,7 +14,7 @@ description: Accessible form field components with built-in validation, labels,
|
|
|
14
14
|
|
|
15
15
|
### Default
|
|
16
16
|
|
|
17
|
-
Compose fields using `
|
|
17
|
+
Compose fields using `Field`, `FieldLabel`, `FieldControl`, and `FieldDescription`.
|
|
18
18
|
|
|
19
19
|
<RenderPreview name="field-demo" />
|
|
20
20
|
|
|
@@ -38,6 +38,6 @@ Use the individual Field subcomponents to create custom field layouts with full
|
|
|
38
38
|
|
|
39
39
|
### Custom Control
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Use `FieldControl` as the form control element or compose Base-compatible controls inside `Field` for advanced cases.
|
|
42
42
|
|
|
43
43
|
<RenderPreview name="field-custom-control" />
|
|
@@ -14,7 +14,7 @@ description: Groups related form fields with an accessible legend for semantic o
|
|
|
14
14
|
|
|
15
15
|
### Default
|
|
16
16
|
|
|
17
|
-
Use `
|
|
17
|
+
Use `Fieldset` and `FieldsetLegend` to group related fields with a descriptive legend.
|
|
18
18
|
|
|
19
19
|
<RenderPreview name="fieldset-demo" />
|
|
20
20
|
|
|
@@ -3,3 +3,23 @@ title: Radio
|
|
|
3
3
|
slug: radio
|
|
4
4
|
description: Radio button component for selecting a single option from a group.
|
|
5
5
|
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="radio-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="radio" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Orientation
|
|
16
|
+
|
|
17
|
+
<RenderPreview name="radio-orientation" />
|
|
18
|
+
|
|
19
|
+
### Card Style
|
|
20
|
+
|
|
21
|
+
<RenderPreview name="radio-card" />
|
|
22
|
+
|
|
23
|
+
### Description
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="radio-description" />
|
|
@@ -3,3 +3,33 @@ title: Select
|
|
|
3
3
|
slug: select
|
|
4
4
|
description: Select component for choosing a predefined value in a dropdown menu.
|
|
5
5
|
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="select-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="select" />
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
### Alignment
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="select-alignment" />
|
|
20
|
+
|
|
21
|
+
### Groups
|
|
22
|
+
|
|
23
|
+
<RenderPreview name="select-groups" />
|
|
24
|
+
|
|
25
|
+
### Disabled
|
|
26
|
+
|
|
27
|
+
<RenderPreview name="select-disabled" />
|
|
28
|
+
|
|
29
|
+
### Invalid
|
|
30
|
+
|
|
31
|
+
<RenderPreview name="select-invalid" />
|
|
32
|
+
|
|
33
|
+
### Scrollable
|
|
34
|
+
|
|
35
|
+
<RenderPreview name="select-scrollable" />
|
|
@@ -3,3 +3,51 @@ title: Slider
|
|
|
3
3
|
slug: slider
|
|
4
4
|
description: Slider component for selecting a value or range of values.
|
|
5
5
|
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="slider-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="slider" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Basic
|
|
16
|
+
|
|
17
|
+
<RenderPreview name="slider-demo" />
|
|
18
|
+
|
|
19
|
+
### Range
|
|
20
|
+
|
|
21
|
+
Use an array with two values for a range slider.
|
|
22
|
+
|
|
23
|
+
<RenderPreview name="slider-range" />
|
|
24
|
+
|
|
25
|
+
### Multiple Thumbs
|
|
26
|
+
|
|
27
|
+
Use an array with multiple values for multiple thumbs.
|
|
28
|
+
|
|
29
|
+
<RenderPreview name="slider-multiple" />
|
|
30
|
+
|
|
31
|
+
### Vertical
|
|
32
|
+
|
|
33
|
+
Use `orientation="vertical"` for a vertical slider.
|
|
34
|
+
|
|
35
|
+
<RenderPreview name="slider-vertical" />
|
|
36
|
+
|
|
37
|
+
### Edge Alignment
|
|
38
|
+
|
|
39
|
+
Use `thumbAlignment="edge"` to inset thumbs so they align to the track edge at min/max.
|
|
40
|
+
|
|
41
|
+
<RenderPreview name="slider-edge" />
|
|
42
|
+
|
|
43
|
+
### Controlled
|
|
44
|
+
|
|
45
|
+
Use `value` and `onValueChange` to fully control slider state.
|
|
46
|
+
|
|
47
|
+
<RenderPreview name="slider-controlled" />
|
|
48
|
+
|
|
49
|
+
### Disabled
|
|
50
|
+
|
|
51
|
+
Use the `disabled` prop to disable the slider.
|
|
52
|
+
|
|
53
|
+
<RenderPreview name="slider-disabled" />
|
|
@@ -3,3 +3,29 @@ title: Switch
|
|
|
3
3
|
slug: switch
|
|
4
4
|
description: Switch component that indicates whether a setting is on or off.
|
|
5
5
|
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="switch-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="switch" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### With Label
|
|
16
|
+
|
|
17
|
+
Use labels and helper text to make intent clear.
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="switch-with-label" />
|
|
20
|
+
|
|
21
|
+
### Sizes
|
|
22
|
+
|
|
23
|
+
Switch supports default and small sizes via the `size` prop.
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="switch-sizes" />
|
|
26
|
+
|
|
27
|
+
### Disabled
|
|
28
|
+
|
|
29
|
+
Disable interaction while preserving the current state.
|
|
30
|
+
|
|
31
|
+
<RenderPreview name="switch-disabled" />
|
|
@@ -3,3 +3,35 @@ title: Tabs
|
|
|
3
3
|
slug: tabs
|
|
4
4
|
description: Tabs component for toggling between related panels on the same page.
|
|
5
5
|
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="tabs-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="tabs" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Default
|
|
16
|
+
|
|
17
|
+
A standard horizontal tabs layout.
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="tabs-demo" />
|
|
20
|
+
|
|
21
|
+
### Line Variant
|
|
22
|
+
|
|
23
|
+
Use the `line` variant for a compact, underlined appearance.
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="tabs-line" />
|
|
26
|
+
|
|
27
|
+
### Vertical
|
|
28
|
+
|
|
29
|
+
Set `orientation="vertical"` to stack triggers in a column.
|
|
30
|
+
|
|
31
|
+
<RenderPreview name="tabs-vertical" />
|
|
32
|
+
|
|
33
|
+
### Disabled Trigger
|
|
34
|
+
|
|
35
|
+
Disable individual tab triggers with the `disabled` prop.
|
|
36
|
+
|
|
37
|
+
<RenderPreview name="tabs-disabled" />
|
|
@@ -3,3 +3,63 @@ title: Toast
|
|
|
3
3
|
slug: toast
|
|
4
4
|
description: A brief message that appears temporarily to inform users of an action or event.
|
|
5
5
|
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="toast-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="toast" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Positions
|
|
16
|
+
|
|
17
|
+
Set `position` on `Toast` to choose where toasts appear in the viewport.
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="toast-positions" />
|
|
20
|
+
|
|
21
|
+
### Stacking
|
|
22
|
+
|
|
23
|
+
Toasts now stack with collapsed and expanded behavior based on Base UI's stack attributes.
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="toast-stacked" />
|
|
26
|
+
|
|
27
|
+
### Anchored
|
|
28
|
+
|
|
29
|
+
Pass `positionerProps` to `useToast().add` to anchor a toast to another element.
|
|
30
|
+
|
|
31
|
+
<RenderPreview name="toast-anchored" />
|
|
32
|
+
|
|
33
|
+
### Variants
|
|
34
|
+
|
|
35
|
+
Use toast `type` to style default, success, and error notifications.
|
|
36
|
+
|
|
37
|
+
<RenderPreview name="toast-variants" />
|
|
38
|
+
|
|
39
|
+
### Action
|
|
40
|
+
|
|
41
|
+
Use `actionProps` to render an inline action button like Undo.
|
|
42
|
+
|
|
43
|
+
<RenderPreview name="toast-action" />
|
|
44
|
+
|
|
45
|
+
### Promise
|
|
46
|
+
|
|
47
|
+
Show loading, success, and error states around async work with `useToast().promise`.
|
|
48
|
+
|
|
49
|
+
<RenderPreview name="toast-promise" />
|
|
50
|
+
|
|
51
|
+
### Update Existing Toast
|
|
52
|
+
|
|
53
|
+
Create a toast and then update it as the action progresses.
|
|
54
|
+
|
|
55
|
+
<RenderPreview name="toast-update" />
|
|
56
|
+
|
|
57
|
+
### Custom Timeout
|
|
58
|
+
|
|
59
|
+
Control auto-dismiss timing with the `timeout` option.
|
|
60
|
+
|
|
61
|
+
<RenderPreview name="toast-timeout" />
|
|
62
|
+
|
|
63
|
+
### Default
|
|
64
|
+
|
|
65
|
+
<RenderPreview name="toast-demo" />
|
|
@@ -4,8 +4,40 @@ slug: toggle
|
|
|
4
4
|
description: A button that can be toggled between two states.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
<RenderPreview
|
|
7
|
+
<RenderPreview name="toggle-demo" />
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
<InstallationBlock
|
|
11
|
+
<InstallationBlock name="toggle" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Toggle
|
|
16
|
+
|
|
17
|
+
Use `Toggle` for a single on/off state.
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="toggle-demo" />
|
|
20
|
+
|
|
21
|
+
### Controlled Toggle
|
|
22
|
+
|
|
23
|
+
Control the pressed state externally with `pressed` and `onPressedChange`.
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="toggle-controlled" />
|
|
26
|
+
|
|
27
|
+
### Icon Fill on Press
|
|
28
|
+
|
|
29
|
+
Add `data-slot="fill"` to a child icon to fill it when the toggle is pressed.
|
|
30
|
+
|
|
31
|
+
<RenderPreview name="toggle-icon-fill" />
|
|
32
|
+
|
|
33
|
+
### Toggle Group (Single)
|
|
34
|
+
|
|
35
|
+
Use `ToggleGroup` with `value` on each `Toggle` to create an exclusive selection.
|
|
36
|
+
|
|
37
|
+
<RenderPreview name="toggle-group-demo" />
|
|
38
|
+
|
|
39
|
+
### Toggle Group (Multiple)
|
|
40
|
+
|
|
41
|
+
Set `multiple` on `ToggleGroup` to allow more than one pressed toggle.
|
|
42
|
+
|
|
43
|
+
<RenderPreview name="toggle-group-multiple" />
|
|
@@ -3,3 +3,29 @@ title: Toolbar
|
|
|
3
3
|
slug: toolbar
|
|
4
4
|
description: A collection of buttons and controls organized in a horizontal bar.
|
|
5
5
|
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="toolbar-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="toolbar" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Demo
|
|
16
|
+
|
|
17
|
+
A simple formatting toolbar with grouped actions and separators.
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="toolbar-demo" />
|
|
20
|
+
|
|
21
|
+
### With Menu
|
|
22
|
+
|
|
23
|
+
Use `render` on `ToolbarButton` with a menu trigger to compose popup controls in the toolbar.
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="toolbar-menu" />
|
|
26
|
+
|
|
27
|
+
### Input and Link
|
|
28
|
+
|
|
29
|
+
A toolbar with a single trailing input and status link.
|
|
30
|
+
|
|
31
|
+
<RenderPreview name="toolbar-input-link" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tooltip
|
|
3
|
+
slug: tooltip
|
|
4
|
+
description: A popup that appears when an element is hovered or focused, showing a hint for sighted users.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="tooltip-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="tooltip" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Demo
|
|
16
|
+
|
|
17
|
+
A simple tooltip with multiple icon buttons and different messages.
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="tooltip-demo" />
|
|
20
|
+
|
|
21
|
+
### Positions
|
|
22
|
+
|
|
23
|
+
Position tooltips on different sides relative to the trigger element.
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="tooltip-positions" />
|
package/content-collections.ts
CHANGED