shapes-ui 0.4.1 → 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/.idea/compiler.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/CHANGELOG.md +31 -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/menubar.mdx +4 -2
- package/content/components/meter.mdx +13 -1
- package/content/components/navigation-menu.mdx +6 -0
- package/content/components/number-field.mdx +24 -0
- package/content/components/popover.mdx +20 -0
- package/content/components/preview-card.mdx +11 -0
- package/content/components/progress.mdx +2 -0
- 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 +231 -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/menubar-advanced.tsx +91 -0
- package/examples/meter-demo.tsx +8 -21
- package/examples/meter-flip.tsx +13 -0
- package/examples/meter-no-label.tsx +12 -0
- package/examples/meter-no-value.tsx +12 -0
- package/examples/navigation-menu-demo.tsx +113 -1
- package/examples/number-field-buttons-end.tsx +20 -0
- package/examples/number-field-demo.tsx +17 -1
- package/examples/number-field-scrub.tsx +38 -0
- package/examples/popover-demo.tsx +18 -1
- package/examples/popover-form.tsx +46 -0
- package/examples/popover-positions.tsx +54 -0
- package/examples/preview-card-demo.tsx +26 -1
- package/examples/preview-card-links.tsx +38 -0
- package/examples/progress-demo.tsx +33 -1
- 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/menubar.json +1 -1
- package/public/r/meter.json +1 -1
- package/public/r/navigation-menu.json +1 -1
- package/public/r/number-field.json +4 -2
- package/public/r/popover.json +1 -1
- package/public/r/preview-card.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/menubar.tsx +52 -18
- package/src/components/ui/meter.tsx +12 -24
- package/src/components/ui/navigation-menu.tsx +121 -38
- package/src/components/ui/number-field.tsx +42 -46
- package/src/components/ui/popover.tsx +7 -2
- package/src/components/ui/preview-card.tsx +4 -2
- package/src/components/ui/progress.tsx +7 -18
- 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
|
@@ -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
package/examples/__index.tsx
CHANGED
|
@@ -574,12 +574,32 @@ export const examples: ExampleRegistry = {
|
|
|
574
574
|
title: "Demo",
|
|
575
575
|
code: lazy(() => import("./menubar-demo")),
|
|
576
576
|
},
|
|
577
|
+
{
|
|
578
|
+
name: "menubar-advanced",
|
|
579
|
+
title: "Advanced",
|
|
580
|
+
code: lazy(() => import("./menubar-advanced")),
|
|
581
|
+
},
|
|
577
582
|
],
|
|
578
583
|
},
|
|
579
584
|
"meter": {
|
|
580
585
|
title: "Meter",
|
|
581
586
|
code: lazy(() => import("../src/components/ui/meter").then(m => ({ default: m.Meter }))),
|
|
582
587
|
examples: [
|
|
588
|
+
{
|
|
589
|
+
name: "meter-no-value",
|
|
590
|
+
title: "No Value",
|
|
591
|
+
code: lazy(() => import("./meter-no-value")),
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: "meter-no-label",
|
|
595
|
+
title: "No Label",
|
|
596
|
+
code: lazy(() => import("./meter-no-label")),
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "meter-flip",
|
|
600
|
+
title: "Flip",
|
|
601
|
+
code: lazy(() => import("./meter-flip")),
|
|
602
|
+
},
|
|
583
603
|
{
|
|
584
604
|
name: "meter-demo",
|
|
585
605
|
title: "Demo",
|
|
@@ -602,17 +622,37 @@ export const examples: ExampleRegistry = {
|
|
|
602
622
|
title: "Number Field",
|
|
603
623
|
code: lazy(() => import("../src/components/ui/number-field").then(m => ({ default: m.NumberField }))),
|
|
604
624
|
examples: [
|
|
625
|
+
{
|
|
626
|
+
name: "number-field-scrub",
|
|
627
|
+
title: "Scrub",
|
|
628
|
+
code: lazy(() => import("./number-field-scrub")),
|
|
629
|
+
},
|
|
605
630
|
{
|
|
606
631
|
name: "number-field-demo",
|
|
607
632
|
title: "Demo",
|
|
608
633
|
code: lazy(() => import("./number-field-demo")),
|
|
609
634
|
},
|
|
635
|
+
{
|
|
636
|
+
name: "number-field-buttons-end",
|
|
637
|
+
title: "Buttons End",
|
|
638
|
+
code: lazy(() => import("./number-field-buttons-end")),
|
|
639
|
+
},
|
|
610
640
|
],
|
|
611
641
|
},
|
|
612
642
|
"popover": {
|
|
613
643
|
title: "Popover",
|
|
614
644
|
code: lazy(() => import("../src/components/ui/popover").then(m => ({ default: m.Popover }))),
|
|
615
645
|
examples: [
|
|
646
|
+
{
|
|
647
|
+
name: "popover-positions",
|
|
648
|
+
title: "Positions",
|
|
649
|
+
code: lazy(() => import("./popover-positions")),
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
name: "popover-form",
|
|
653
|
+
title: "Form",
|
|
654
|
+
code: lazy(() => import("./popover-form")),
|
|
655
|
+
},
|
|
616
656
|
{
|
|
617
657
|
name: "popover-demo",
|
|
618
658
|
title: "Demo",
|
|
@@ -624,6 +664,11 @@ export const examples: ExampleRegistry = {
|
|
|
624
664
|
title: "Preview Card",
|
|
625
665
|
code: lazy(() => import("../src/components/ui/preview-card").then(m => ({ default: m.PreviewCard }))),
|
|
626
666
|
examples: [
|
|
667
|
+
{
|
|
668
|
+
name: "preview-card-links",
|
|
669
|
+
title: "Links",
|
|
670
|
+
code: lazy(() => import("./preview-card-links")),
|
|
671
|
+
},
|
|
627
672
|
{
|
|
628
673
|
name: "preview-card-demo",
|
|
629
674
|
title: "Demo",
|
|
@@ -646,11 +691,26 @@ export const examples: ExampleRegistry = {
|
|
|
646
691
|
title: "Radio",
|
|
647
692
|
code: lazy(() => import("../src/components/ui/radio").then(m => ({ default: m.Radio }))),
|
|
648
693
|
examples: [
|
|
694
|
+
{
|
|
695
|
+
name: "radio-orientation",
|
|
696
|
+
title: "Orientation",
|
|
697
|
+
code: lazy(() => import("./radio-orientation")),
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
name: "radio-description",
|
|
701
|
+
title: "Description",
|
|
702
|
+
code: lazy(() => import("./radio-description")),
|
|
703
|
+
},
|
|
649
704
|
{
|
|
650
705
|
name: "radio-demo",
|
|
651
706
|
title: "Demo",
|
|
652
707
|
code: lazy(() => import("./radio-demo")),
|
|
653
708
|
},
|
|
709
|
+
{
|
|
710
|
+
name: "radio-card",
|
|
711
|
+
title: "Card",
|
|
712
|
+
code: lazy(() => import("./radio-card")),
|
|
713
|
+
},
|
|
654
714
|
],
|
|
655
715
|
},
|
|
656
716
|
"scroll-area": {
|
|
@@ -668,28 +728,98 @@ export const examples: ExampleRegistry = {
|
|
|
668
728
|
title: "Select",
|
|
669
729
|
code: lazy(() => import("../src/components/ui/select").then(m => ({ default: m.Select }))),
|
|
670
730
|
examples: [
|
|
731
|
+
{
|
|
732
|
+
name: "select-scrollable",
|
|
733
|
+
title: "Scrollable",
|
|
734
|
+
code: lazy(() => import("./select-scrollable")),
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: "select-invalid",
|
|
738
|
+
title: "Invalid",
|
|
739
|
+
code: lazy(() => import("./select-invalid")),
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
name: "select-groups",
|
|
743
|
+
title: "Groups",
|
|
744
|
+
code: lazy(() => import("./select-groups")),
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
name: "select-disabled",
|
|
748
|
+
title: "Disabled",
|
|
749
|
+
code: lazy(() => import("./select-disabled")),
|
|
750
|
+
},
|
|
671
751
|
{
|
|
672
752
|
name: "select-demo",
|
|
673
753
|
title: "Demo",
|
|
674
754
|
code: lazy(() => import("./select-demo")),
|
|
675
755
|
},
|
|
756
|
+
{
|
|
757
|
+
name: "select-alignment",
|
|
758
|
+
title: "Alignment",
|
|
759
|
+
code: lazy(() => import("./select-alignment")),
|
|
760
|
+
},
|
|
676
761
|
],
|
|
677
762
|
},
|
|
678
763
|
"slider": {
|
|
679
764
|
title: "Slider",
|
|
680
765
|
code: lazy(() => import("../src/components/ui/slider").then(m => ({ default: m.Slider }))),
|
|
681
766
|
examples: [
|
|
767
|
+
{
|
|
768
|
+
name: "slider-vertical",
|
|
769
|
+
title: "Vertical",
|
|
770
|
+
code: lazy(() => import("./slider-vertical")),
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
name: "slider-range",
|
|
774
|
+
title: "Range",
|
|
775
|
+
code: lazy(() => import("./slider-range")),
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
name: "slider-multiple",
|
|
779
|
+
title: "Multiple",
|
|
780
|
+
code: lazy(() => import("./slider-multiple")),
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
name: "slider-edge",
|
|
784
|
+
title: "Edge",
|
|
785
|
+
code: lazy(() => import("./slider-edge")),
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
name: "slider-disabled",
|
|
789
|
+
title: "Disabled",
|
|
790
|
+
code: lazy(() => import("./slider-disabled")),
|
|
791
|
+
},
|
|
682
792
|
{
|
|
683
793
|
name: "slider-demo",
|
|
684
794
|
title: "Demo",
|
|
685
795
|
code: lazy(() => import("./slider-demo")),
|
|
686
796
|
},
|
|
797
|
+
{
|
|
798
|
+
name: "slider-controlled",
|
|
799
|
+
title: "Controlled",
|
|
800
|
+
code: lazy(() => import("./slider-controlled")),
|
|
801
|
+
},
|
|
687
802
|
],
|
|
688
803
|
},
|
|
689
804
|
"switch": {
|
|
690
805
|
title: "Switch",
|
|
691
806
|
code: lazy(() => import("../src/components/ui/switch").then(m => ({ default: m.Switch }))),
|
|
692
807
|
examples: [
|
|
808
|
+
{
|
|
809
|
+
name: "switch-with-label",
|
|
810
|
+
title: "With Label",
|
|
811
|
+
code: lazy(() => import("./switch-with-label")),
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
name: "switch-sizes",
|
|
815
|
+
title: "Sizes",
|
|
816
|
+
code: lazy(() => import("./switch-sizes")),
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
name: "switch-disabled",
|
|
820
|
+
title: "Disabled",
|
|
821
|
+
code: lazy(() => import("./switch-disabled")),
|
|
822
|
+
},
|
|
693
823
|
{
|
|
694
824
|
name: "switch-demo",
|
|
695
825
|
title: "Demo",
|
|
@@ -701,6 +831,21 @@ export const examples: ExampleRegistry = {
|
|
|
701
831
|
title: "Tabs",
|
|
702
832
|
code: lazy(() => import("../src/components/ui/tabs").then(m => ({ default: m.Tabs }))),
|
|
703
833
|
examples: [
|
|
834
|
+
{
|
|
835
|
+
name: "tabs-vertical",
|
|
836
|
+
title: "Vertical",
|
|
837
|
+
code: lazy(() => import("./tabs-vertical")),
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
name: "tabs-line",
|
|
841
|
+
title: "Line",
|
|
842
|
+
code: lazy(() => import("./tabs-line")),
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
name: "tabs-disabled",
|
|
846
|
+
title: "Disabled",
|
|
847
|
+
code: lazy(() => import("./tabs-disabled")),
|
|
848
|
+
},
|
|
704
849
|
{
|
|
705
850
|
name: "tabs-demo",
|
|
706
851
|
title: "Demo",
|
|
@@ -712,28 +857,98 @@ export const examples: ExampleRegistry = {
|
|
|
712
857
|
title: "Toast",
|
|
713
858
|
code: lazy(() => import("../src/components/ui/toast").then(m => ({ default: m.Toast }))),
|
|
714
859
|
examples: [
|
|
860
|
+
{
|
|
861
|
+
name: "toast-variants",
|
|
862
|
+
title: "Variants",
|
|
863
|
+
code: lazy(() => import("./toast-variants")),
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
name: "toast-update",
|
|
867
|
+
title: "Update",
|
|
868
|
+
code: lazy(() => import("./toast-update")),
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
name: "toast-timeout",
|
|
872
|
+
title: "Timeout",
|
|
873
|
+
code: lazy(() => import("./toast-timeout")),
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
name: "toast-stacked",
|
|
877
|
+
title: "Stacked",
|
|
878
|
+
code: lazy(() => import("./toast-stacked")),
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
name: "toast-promise",
|
|
882
|
+
title: "Promise",
|
|
883
|
+
code: lazy(() => import("./toast-promise")),
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: "toast-positions",
|
|
887
|
+
title: "Positions",
|
|
888
|
+
code: lazy(() => import("./toast-positions")),
|
|
889
|
+
},
|
|
715
890
|
{
|
|
716
891
|
name: "toast-demo",
|
|
717
892
|
title: "Demo",
|
|
718
893
|
code: lazy(() => import("./toast-demo")),
|
|
719
894
|
},
|
|
895
|
+
{
|
|
896
|
+
name: "toast-anchored",
|
|
897
|
+
title: "Anchored",
|
|
898
|
+
code: lazy(() => import("./toast-anchored")),
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: "toast-action",
|
|
902
|
+
title: "Action",
|
|
903
|
+
code: lazy(() => import("./toast-action")),
|
|
904
|
+
},
|
|
720
905
|
],
|
|
721
906
|
},
|
|
722
907
|
"toggle": {
|
|
723
908
|
title: "Toggle",
|
|
724
909
|
code: lazy(() => import("../src/components/ui/toggle").then(m => ({ default: m.Toggle }))),
|
|
725
910
|
examples: [
|
|
911
|
+
{
|
|
912
|
+
name: "toggle-icon-fill",
|
|
913
|
+
title: "Icon Fill",
|
|
914
|
+
code: lazy(() => import("./toggle-icon-fill")),
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
name: "toggle-group-multiple",
|
|
918
|
+
title: "Group Multiple",
|
|
919
|
+
code: lazy(() => import("./toggle-group-multiple")),
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
name: "toggle-group-demo",
|
|
923
|
+
title: "Group Demo",
|
|
924
|
+
code: lazy(() => import("./toggle-group-demo")),
|
|
925
|
+
},
|
|
726
926
|
{
|
|
727
927
|
name: "toggle-demo",
|
|
728
928
|
title: "Demo",
|
|
729
929
|
code: lazy(() => import("./toggle-demo")),
|
|
730
930
|
},
|
|
931
|
+
{
|
|
932
|
+
name: "toggle-controlled",
|
|
933
|
+
title: "Controlled",
|
|
934
|
+
code: lazy(() => import("./toggle-controlled")),
|
|
935
|
+
},
|
|
731
936
|
],
|
|
732
937
|
},
|
|
733
938
|
"toolbar": {
|
|
734
939
|
title: "Toolbar",
|
|
735
940
|
code: lazy(() => import("../src/components/ui/toolbar").then(m => ({ default: m.Toolbar }))),
|
|
736
941
|
examples: [
|
|
942
|
+
{
|
|
943
|
+
name: "toolbar-menu",
|
|
944
|
+
title: "Menu",
|
|
945
|
+
code: lazy(() => import("./toolbar-menu")),
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
name: "toolbar-input-link",
|
|
949
|
+
title: "Input Link",
|
|
950
|
+
code: lazy(() => import("./toolbar-input-link")),
|
|
951
|
+
},
|
|
737
952
|
{
|
|
738
953
|
name: "toolbar-demo",
|
|
739
954
|
title: "Demo",
|
|
@@ -741,4 +956,20 @@ export const examples: ExampleRegistry = {
|
|
|
741
956
|
},
|
|
742
957
|
],
|
|
743
958
|
},
|
|
959
|
+
"tooltip": {
|
|
960
|
+
title: "Tooltip",
|
|
961
|
+
code: lazy(() => import("../src/components/ui/tooltip").then(m => ({ default: m.Tooltip }))),
|
|
962
|
+
examples: [
|
|
963
|
+
{
|
|
964
|
+
name: "tooltip-positions",
|
|
965
|
+
title: "Positions",
|
|
966
|
+
code: lazy(() => import("./tooltip-positions")),
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
name: "tooltip-demo",
|
|
970
|
+
title: "Demo",
|
|
971
|
+
code: lazy(() => import("./tooltip-demo")),
|
|
972
|
+
},
|
|
973
|
+
],
|
|
974
|
+
},
|
|
744
975
|
};
|
|
@@ -3,7 +3,7 @@ import { Field, FieldLabel } from "@/components/ui/field";
|
|
|
3
3
|
|
|
4
4
|
export default function CheckboxDemo() {
|
|
5
5
|
return (
|
|
6
|
-
<Field
|
|
6
|
+
<Field className="mx-auto flex-row items-center *:w-auto">
|
|
7
7
|
<Checkbox />
|
|
8
8
|
<FieldLabel>Accept terms and conditions</FieldLabel>
|
|
9
9
|
</Field>
|
|
@@ -6,7 +6,7 @@ import { Field, FieldDescription, FieldLabel } from "@/components/ui/field";
|
|
|
6
6
|
export default function CheckboxFormDemo() {
|
|
7
7
|
return (
|
|
8
8
|
<form className="max-w-md space-y-4">
|
|
9
|
-
<Field name="marketing"
|
|
9
|
+
<Field name="marketing">
|
|
10
10
|
<FieldLabel>
|
|
11
11
|
<Checkbox />
|
|
12
12
|
<span className="text-sm">Marketing emails</span>
|
|
@@ -14,7 +14,7 @@ export default function CheckboxFormDemo() {
|
|
|
14
14
|
<FieldDescription>Receive emails about new products and features.</FieldDescription>
|
|
15
15
|
</Field>
|
|
16
16
|
|
|
17
|
-
<Field name="newsletter"
|
|
17
|
+
<Field name="newsletter">
|
|
18
18
|
<FieldLabel>
|
|
19
19
|
<Checkbox />
|
|
20
20
|
<span className="text-sm">Newsletter</span>
|
|
@@ -22,7 +22,7 @@ export default function CheckboxFormDemo() {
|
|
|
22
22
|
<FieldDescription>Get our weekly newsletter with tips and updates.</FieldDescription>
|
|
23
23
|
</Field>
|
|
24
24
|
|
|
25
|
-
<Field name="security"
|
|
25
|
+
<Field name="security">
|
|
26
26
|
<FieldLabel>
|
|
27
27
|
<Checkbox defaultChecked />
|
|
28
28
|
<span className="text-sm">Security alerts</span>
|
|
@@ -1,17 +1,41 @@
|
|
|
1
1
|
import { Field, FieldLabel, FieldDescription } from "@/components/ui/field";
|
|
2
|
+
import {
|
|
3
|
+
Select,
|
|
4
|
+
SelectGroup,
|
|
5
|
+
SelectItem,
|
|
6
|
+
SelectLabel,
|
|
7
|
+
SelectPopup,
|
|
8
|
+
SelectTrigger,
|
|
9
|
+
SelectValue,
|
|
10
|
+
} from "@/components/ui/select";
|
|
2
11
|
|
|
3
12
|
export default function FieldCustomControl() {
|
|
4
13
|
return (
|
|
5
14
|
<Field name="color" className="max-w-md">
|
|
6
|
-
<FieldLabel>
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
<FieldLabel>Favourite Color</FieldLabel>
|
|
16
|
+
<Select items={colors}>
|
|
17
|
+
<SelectTrigger className="w-full max-w-48">
|
|
18
|
+
<SelectValue />
|
|
19
|
+
</SelectTrigger>
|
|
20
|
+
<SelectPopup>
|
|
21
|
+
<SelectGroup>
|
|
22
|
+
<SelectLabel>Colors</SelectLabel>
|
|
23
|
+
{colors.map((color) => (
|
|
24
|
+
<SelectItem key={color.value} value={color.value}>
|
|
25
|
+
{color.label}
|
|
26
|
+
</SelectItem>
|
|
27
|
+
))}
|
|
28
|
+
</SelectGroup>
|
|
29
|
+
</SelectPopup>
|
|
30
|
+
</Select>
|
|
31
|
+
<FieldDescription>Select your favourite color from the dropdown.</FieldDescription>
|
|
15
32
|
</Field>
|
|
16
33
|
);
|
|
17
34
|
}
|
|
35
|
+
|
|
36
|
+
const colors = [
|
|
37
|
+
{ value: "red", label: "Red" },
|
|
38
|
+
{ value: "blue", label: "Blue" },
|
|
39
|
+
{ value: "green", label: "Green" },
|
|
40
|
+
{ value: "yellow", label: "Yellow" },
|
|
41
|
+
];
|
package/examples/form-demo.tsx
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { Button } from "@/components/ui/button";
|
|
2
2
|
import { Field, FieldLabel, FieldControl, FieldDescription } from "@/components/ui/field";
|
|
3
3
|
import { Form } from "@/components/ui/form";
|
|
4
|
-
import { Input } from "@/components/ui/input";
|
|
5
4
|
|
|
6
5
|
export default function FormDemo() {
|
|
7
6
|
return (
|
|
8
|
-
<Form
|
|
9
|
-
<Field
|
|
7
|
+
<Form onFormSubmit={(event) => event.preventDefault()} className="w-full max-w-sm space-y-6">
|
|
8
|
+
<Field>
|
|
10
9
|
<FieldLabel>Email</FieldLabel>
|
|
11
|
-
<FieldControl
|
|
12
|
-
<Input type="email" placeholder="Enter your email" required />
|
|
13
|
-
</FieldControl>
|
|
10
|
+
<FieldControl type="email" placeholder="Enter your email" required />
|
|
14
11
|
<FieldDescription>We'll never share your email.</FieldDescription>
|
|
15
12
|
</Field>
|
|
16
|
-
<Field
|
|
13
|
+
<Field>
|
|
17
14
|
<FieldLabel>Password</FieldLabel>
|
|
18
|
-
<FieldControl
|
|
19
|
-
<Input type="password" placeholder="Enter your password" required />
|
|
20
|
-
</FieldControl>
|
|
15
|
+
<FieldControl type="password" placeholder="Enter your password" required />
|
|
21
16
|
</Field>
|
|
22
17
|
<Button type="submit" className="w-full">
|
|
23
18
|
Submit
|
|
@@ -35,9 +35,7 @@ export default function MenuAdvancedDemo() {
|
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<Menu>
|
|
38
|
-
<MenuTrigger>
|
|
39
|
-
<Button variant="outline">Advanced menu</Button>
|
|
40
|
-
</MenuTrigger>
|
|
38
|
+
<MenuTrigger render={<Button variant="outline">Advanced menu</Button>} />
|
|
41
39
|
|
|
42
40
|
<MenuPopup>
|
|
43
41
|
<div className="flex items-center gap-2 p-3">
|