@adamosuiteservices/ui 2.18.5 → 2.19.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/README.md +1 -1
- package/dist/accordion-rounded.cjs +8 -8
- package/dist/accordion-rounded.js +12 -12
- package/dist/alert.cjs +32 -23
- package/dist/alert.js +53 -43
- package/dist/amount-input.cjs +8 -0
- package/dist/amount-input.js +191 -0
- package/dist/avatar.cjs +7 -7
- package/dist/avatar.js +18 -18
- package/dist/badge.cjs +24 -28
- package/dist/badge.js +45 -42
- package/dist/breadcrumb.cjs +2 -3
- package/dist/breadcrumb.js +16 -17
- package/dist/button-CXFZVTXF.cjs +87 -0
- package/dist/button-dT8nqgU3.js +156 -0
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/{calendar-xBaFu2sB.js → calendar-6NvJv-sP.js} +238 -239
- package/dist/{calendar-Dorq3-wv.cjs → calendar-B8S5a0TG.cjs} +20 -22
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.cjs +3 -3
- package/dist/card.js +4 -4
- package/dist/checkbox-BBlvCoB1.cjs +24 -0
- package/dist/{checkbox-DL_jFvgl.js → checkbox-BuzBXARX.js} +54 -52
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/colors.css +1 -1
- package/dist/combobox-B002BLsg.js +692 -0
- package/dist/combobox-B2BkUl7v.cjs +57 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/components/layout/sidebar/sidebar.d.ts +2 -1
- package/dist/components/layout/toaster/toaster.d.ts +1 -1
- package/dist/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/amount-input/amount-input.d.ts +32 -0
- package/dist/components/ui/amount-input/index.d.ts +1 -0
- package/dist/components/ui/badge/badge.d.ts +3 -2
- package/dist/components/ui/calendar/calendar.d.ts +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +3 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +3 -1
- package/dist/components/ui/selectable-card/index.d.ts +1 -0
- package/dist/components/ui/selectable-card/selectable-card.d.ts +22 -0
- package/dist/components/ui/timeline/index.d.ts +1 -0
- package/dist/components/ui/timeline/timeline.d.ts +30 -0
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/context-menu.cjs +18 -19
- package/dist/context-menu.js +36 -37
- package/dist/date-picker-selector.cjs +1 -1
- package/dist/date-picker-selector.js +3 -3
- package/dist/dialog.cjs +7 -9
- package/dist/dialog.js +36 -38
- package/dist/dropdown-menu.cjs +57 -36
- package/dist/dropdown-menu.js +205 -172
- package/dist/field.cjs +12 -7
- package/dist/field.js +51 -45
- package/dist/file-upload-v2.cjs +11 -5
- package/dist/file-upload-v2.js +75 -60
- package/dist/file-upload.cjs +11 -5
- package/dist/file-upload.js +117 -109
- package/dist/index-BBT2EGq8.js +18 -0
- package/dist/index-DCsgSkBj.cjs +1 -0
- package/dist/input-8sEO5zwD.js +44 -0
- package/dist/input-AONeSXcs.cjs +22 -0
- package/dist/input-group-13VFVAxD.cjs +86 -0
- package/dist/input-group-D4S18xiq.js +240 -0
- package/dist/input-group.cjs +1 -84
- package/dist/input-group.js +7 -234
- package/dist/input-otp.cjs +5 -7
- package/dist/input-otp.js +58 -60
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/kbd.cjs +6 -7
- package/dist/kbd.js +14 -15
- package/dist/{label-DqfX9cHc.cjs → label-B7Z1D5-Q.cjs} +5 -4
- package/dist/{label-C6zVnc3d.js → label-_BWRIH7C.js} +14 -13
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/pagination.cjs +5 -5
- package/dist/pagination.js +18 -18
- package/dist/radio-group.cjs +12 -9
- package/dist/radio-group.js +65 -62
- package/dist/select.cjs +18 -16
- package/dist/select.js +17 -15
- package/dist/selectable-card.cjs +29 -0
- package/dist/selectable-card.js +129 -0
- package/dist/separator-DXdc7LcC.cjs +7 -0
- package/dist/{separator-CsaqP20m.js → separator-DZfXXbNt.js} +1 -1
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +1 -1
- package/dist/{sheet-C9vce0ut.js → sheet-DNwg4a6M.js} +8 -5
- package/dist/{sheet-Cnq7TCzu.cjs → sheet-va7o2x0w.cjs} +10 -10
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.cjs +10 -10
- package/dist/sidebar.js +83 -92
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +2 -4
- package/dist/switch.js +71 -73
- package/dist/table.cjs +14 -14
- package/dist/table.js +12 -12
- package/dist/tabs-underline.cjs +11 -15
- package/dist/tabs-underline.js +20 -24
- package/dist/tabs.cjs +10 -14
- package/dist/tabs.js +20 -24
- package/dist/tailwind-colors.css +1 -1
- package/dist/tailwind-theme.css +1 -1
- package/dist/textarea-BSooGyp-.cjs +18 -0
- package/dist/textarea-D_sj6ivo.js +39 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/themes.css +1 -1
- package/dist/timeline.cjs +4 -0
- package/dist/timeline.js +189 -0
- package/dist/toaster.cjs +5 -4
- package/dist/toaster.js +33 -32
- package/dist/toggle.cjs +4 -4
- package/dist/toggle.js +17 -17
- package/dist/tooltip.cjs +5 -6
- package/dist/tooltip.js +4 -5
- package/docs/components/layout/sidebar.md +81 -53
- package/docs/components/layout/toaster.md +35 -55
- package/docs/components/ui/accordion-rounded.md +12 -11
- package/docs/components/ui/alert.md +66 -36
- package/docs/components/ui/amount-input.md +229 -0
- package/docs/components/ui/avatar.md +28 -32
- package/docs/components/ui/badge.md +85 -32
- package/docs/components/ui/breadcrumb.md +5 -7
- package/docs/components/ui/button-group.md +16 -16
- package/docs/components/ui/button.md +23 -36
- package/docs/components/ui/calendar.md +54 -27
- package/docs/components/ui/card.md +5 -4
- package/docs/components/ui/checkbox.md +3 -3
- package/docs/components/ui/combobox.md +35 -1
- package/docs/components/ui/command.md +7 -7
- package/docs/components/ui/context-menu.md +14 -15
- package/docs/components/ui/date-picker-selector.md +31 -31
- package/docs/components/ui/dialog.md +47 -49
- package/docs/components/ui/dropdown-menu.md +34 -37
- package/docs/components/ui/field.md +25 -31
- package/docs/components/ui/file-upload-v2.md +11 -0
- package/docs/components/ui/file-upload.md +105 -108
- package/docs/components/ui/hover-card.md +28 -6
- package/docs/components/ui/icon.md +10 -9
- package/docs/components/ui/input-group.md +9 -9
- package/docs/components/ui/input.md +30 -33
- package/docs/components/ui/kbd.md +10 -9
- package/docs/components/ui/label.md +6 -6
- package/docs/components/ui/pagination.md +3 -3
- package/docs/components/ui/popover.md +1 -0
- package/docs/components/ui/progress.md +3 -3
- package/docs/components/ui/radio-group.md +18 -6
- package/docs/components/ui/scroll-area.md +4 -4
- package/docs/components/ui/select.md +14 -12
- package/docs/components/ui/selectable-card.md +204 -0
- package/docs/components/ui/separator.md +4 -4
- package/docs/components/ui/sheet.md +21 -3
- package/docs/components/ui/slider.md +3 -3
- package/docs/components/ui/switch.md +7 -7
- package/docs/components/ui/table.md +7 -4
- package/docs/components/ui/tabs-underline.md +36 -36
- package/docs/components/ui/tabs.md +6 -4
- package/docs/components/ui/textarea.md +6 -4
- package/docs/components/ui/timeline.md +214 -0
- package/docs/components/ui/toggle.md +1 -1
- package/docs/components/ui/tooltip.md +3 -3
- package/llm.txt +7 -4
- package/package.json +13 -1
- package/dist/button-BnUlAtuD.js +0 -132
- package/dist/button-CFJs0esR.cjs +0 -63
- package/dist/checkbox-3RIZX2HF.cjs +0 -22
- package/dist/combobox-MkeJiTXj.js +0 -637
- package/dist/combobox-jJRxvUsB.cjs +0 -40
- package/dist/input-BCiOr4Fy.js +0 -44
- package/dist/input-Bz5k4w94.cjs +0 -22
- package/dist/separator-CCGaTo09.cjs +0 -7
- package/dist/textarea-BRCnIxdB.js +0 -33
- package/dist/textarea-DkFUS_oS.cjs +0 -14
|
@@ -41,38 +41,38 @@ import {
|
|
|
41
41
|
</Dialog>
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
**Components**:
|
|
44
|
+
**Components**: 11 (Dialog, Trigger, Content, Header, Title, Description, Body, Footer, Close, Overlay, Portal)
|
|
45
45
|
|
|
46
46
|
## Main props
|
|
47
47
|
|
|
48
48
|
### Dialog (Root)
|
|
49
49
|
|
|
50
|
-
| Prop |
|
|
51
|
-
| -------------- | ------------------------- | ------- |
|
|
52
|
-
| `open` | `boolean` | - |
|
|
53
|
-
| `onOpenChange` | `(open: boolean) => void` | - | Callback
|
|
54
|
-
| `defaultOpen` | `boolean` | `false` |
|
|
50
|
+
| Prop | Type | Default | Description |
|
|
51
|
+
| -------------- | ------------------------- | ------- | ---------------------------------------- |
|
|
52
|
+
| `open` | `boolean` | - | Controlled dialog state |
|
|
53
|
+
| `onOpenChange` | `(open: boolean) => void` | - | Callback when state changes |
|
|
54
|
+
| `defaultOpen` | `boolean` | `false` | Initial uncontrolled state |
|
|
55
55
|
| `modal` | `boolean` | `true` | Blocks interaction with external content |
|
|
56
56
|
|
|
57
57
|
### DialogTrigger
|
|
58
58
|
|
|
59
|
-
| Prop | Type | Description
|
|
60
|
-
| ----------- | --------- |
|
|
59
|
+
| Prop | Type | Description |
|
|
60
|
+
| ----------- | --------- | ------------------------------------------------ |
|
|
61
61
|
| `asChild` | `boolean` | Pass props to child instead of rendering wrapper |
|
|
62
|
-
| `className` | `string` | Additional CSS classes
|
|
62
|
+
| `className` | `string` | Additional CSS classes |
|
|
63
63
|
|
|
64
64
|
### DialogContent
|
|
65
65
|
|
|
66
|
-
| Prop | Type | Default | Description
|
|
67
|
-
| ---------------------- | ----------------- | ------- |
|
|
68
|
-
| `showCloseButton` | `boolean` | `true` | Shows X button in top right corner
|
|
66
|
+
| Prop | Type | Default | Description |
|
|
67
|
+
| ---------------------- | ----------------- | ------- | ------------------------------------------------- |
|
|
68
|
+
| `showCloseButton` | `boolean` | `true` | Shows X button in top right corner |
|
|
69
69
|
| `theme` | `Theme` | - | Custom theme (default, dark, pay, sign, risk, id) |
|
|
70
|
-
| `className` | `string` | - | Additional CSS classes
|
|
71
|
-
| `onEscapeKeyDown` | `(event) => void` | - | Callback when pressing Escape
|
|
72
|
-
| `onPointerDownOutside` | `(event) => void` | - | Callback when clicking outside
|
|
73
|
-
| `onInteractOutside` | `(event) => void` | - | Callback when interacting outside
|
|
70
|
+
| `className` | `string` | - | Additional CSS classes |
|
|
71
|
+
| `onEscapeKeyDown` | `(event) => void` | - | Callback when pressing Escape |
|
|
72
|
+
| `onPointerDownOutside` | `(event) => void` | - | Callback when clicking outside |
|
|
73
|
+
| `onInteractOutside` | `(event) => void` | - | Callback when interacting outside |
|
|
74
74
|
|
|
75
|
-
**Default styles**: `max-w-
|
|
75
|
+
**Default styles**: `max-w-[610px]`, `max-w-[calc(100%-2rem)]` on mobile, centered, `rounded-2xl`, `p-6`, `shadow-xs`, `gap-4`
|
|
76
76
|
|
|
77
77
|
### DialogTitle
|
|
78
78
|
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
| ----------- | -------- | ---------------------- |
|
|
81
81
|
| `className` | `string` | Additional CSS classes |
|
|
82
82
|
|
|
83
|
-
**Styles**: `text-
|
|
83
|
+
**Styles**: `text-sm`, `font-semibold`, `text-foreground`
|
|
84
84
|
|
|
85
85
|
### DialogDescription
|
|
86
86
|
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
| ----------- | -------- | ---------------------- |
|
|
89
89
|
| `className` | `string` | Additional CSS classes |
|
|
90
90
|
|
|
91
|
-
**Styles**: `text-sm`, `text-
|
|
91
|
+
**Styles**: `text-sm`, `text-foreground`
|
|
92
92
|
|
|
93
93
|
### DialogBody
|
|
94
94
|
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
| ----------- | -------- | ---------------------- |
|
|
97
97
|
| `className` | `string` | Additional CSS classes |
|
|
98
98
|
|
|
99
|
-
**Styles**: `mt-
|
|
99
|
+
**Styles**: `mt-4 mb-10`
|
|
100
100
|
**Purpose**: Container for main dialog content between header and footer. Provides consistent vertical spacing.
|
|
101
101
|
|
|
102
102
|
### DialogHeader
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
| ----------- | -------- | ---------------------- |
|
|
106
106
|
| `className` | `string` | Additional CSS classes |
|
|
107
107
|
|
|
108
|
-
**Styles**: `flex flex-col gap-2
|
|
108
|
+
**Styles**: `flex flex-col gap-2`
|
|
109
109
|
|
|
110
110
|
### DialogFooter
|
|
111
111
|
|
|
@@ -113,14 +113,14 @@ import {
|
|
|
113
113
|
| ----------- | -------- | ---------------------- |
|
|
114
114
|
| `className` | `string` | Additional CSS classes |
|
|
115
115
|
|
|
116
|
-
**Styles**: `flex-
|
|
116
|
+
**Styles**: `flex gap-6`, `sm:flex-row sm:justify-start`
|
|
117
117
|
|
|
118
118
|
### DialogClose
|
|
119
119
|
|
|
120
|
-
| Prop | Type | Description
|
|
121
|
-
| ----------- | --------- |
|
|
120
|
+
| Prop | Type | Description |
|
|
121
|
+
| ----------- | --------- | ----------------------------------------------- |
|
|
122
122
|
| `asChild` | `boolean` | Pass props to child instead of rendering button |
|
|
123
|
-
| `className` | `string` | Additional CSS classes
|
|
123
|
+
| `className` | `string` | Additional CSS classes |
|
|
124
124
|
|
|
125
125
|
## Usage patterns
|
|
126
126
|
|
|
@@ -511,12 +511,12 @@ function App() {
|
|
|
511
511
|
|
|
512
512
|
## Common use cases
|
|
513
513
|
|
|
514
|
-
**
|
|
515
|
-
**
|
|
516
|
-
**
|
|
517
|
-
**
|
|
518
|
-
**
|
|
519
|
-
**
|
|
514
|
+
**Edit forms**: Edit profile, settings, preferences
|
|
515
|
+
**Destructive confirmations**: Delete account, remove items, clear data
|
|
516
|
+
**Create new items**: New project, add user, create record
|
|
517
|
+
**Share content**: Share links, export data, send invitations
|
|
518
|
+
**View details**: User info, product details, transaction summary
|
|
519
|
+
**Information**: Disclaimers, terms, help content
|
|
520
520
|
|
|
521
521
|
## States and data attributes
|
|
522
522
|
|
|
@@ -538,20 +538,20 @@ function App() {
|
|
|
538
538
|
|
|
539
539
|
## Keyboard navigation
|
|
540
540
|
|
|
541
|
-
- ✅ **Escape**:
|
|
542
|
-
- ✅ **Tab**:
|
|
543
|
-
- ✅ **Shift+Tab**:
|
|
544
|
-
- ✅ **Enter**:
|
|
541
|
+
- ✅ **Escape**: Closes the dialog (prevent with `onEscapeKeyDown`)
|
|
542
|
+
- ✅ **Tab**: Navigate between focusable elements inside the dialog
|
|
543
|
+
- ✅ **Shift+Tab**: Reverse navigation
|
|
544
|
+
- ✅ **Enter**: Activate focused button/element
|
|
545
545
|
|
|
546
546
|
## Accessibility
|
|
547
547
|
|
|
548
548
|
- ✅ **ARIA**: `role="dialog"`, `aria-labelledby` (title), `aria-describedby` (description)
|
|
549
|
-
- ✅ **Focus trap**: Focus
|
|
550
|
-
- ✅ **Focus restoration**: Focus
|
|
551
|
-
- ✅ **Screen readers**:
|
|
552
|
-
- ✅ **Keyboard navigation**:
|
|
553
|
-
- ✅ **Close button**: `aria-label="Close"`
|
|
554
|
-
- ✅ **Modal behavior**:
|
|
549
|
+
- ✅ **Focus trap**: Focus stays inside the dialog while it is open
|
|
550
|
+
- ✅ **Focus restoration**: Focus returns to trigger on close
|
|
551
|
+
- ✅ **Screen readers**: Announces title, description, and content
|
|
552
|
+
- ✅ **Keyboard navigation**: Fully keyboard navigable
|
|
553
|
+
- ✅ **Close button**: `aria-label="Close"` on the X button
|
|
554
|
+
- ✅ **Modal behavior**: Blocks interaction with external content
|
|
555
555
|
|
|
556
556
|
## Implementation notes
|
|
557
557
|
|
|
@@ -559,8 +559,9 @@ function App() {
|
|
|
559
559
|
- **Portal rendering**: Content is rendered in `document.body`
|
|
560
560
|
- **Overlay**: `bg-black/50`, `fixed inset-0`, `z-50`
|
|
561
561
|
- **Centered**: `top-[50%] left-[50%]`, `translate-x-[-50%] translate-y-[-50%]`
|
|
562
|
-
- **Responsive**: `max-w-[calc(100%-2rem)]` on mobile, `sm:max-w-
|
|
563
|
-
- **Close button**: Automatic
|
|
562
|
+
- **Responsive**: `max-w-[calc(100%-2rem)]` on mobile, `sm:max-w-[610px]` on desktop
|
|
563
|
+
- **Close button**: Automatic close icon in top right corner (`top-4 right-4`) if `showCloseButton={true}`
|
|
564
|
+
- **Close button focus**: `ring-4 ring-primary/10`
|
|
564
565
|
- **Auto-close**: Closes with Escape, click outside, or DialogClose
|
|
565
566
|
- **Focus management**: First focusable element receives focus when opening
|
|
566
567
|
- **Theme support**: `theme` prop applies `data-theme` to content
|
|
@@ -571,14 +572,11 @@ function App() {
|
|
|
571
572
|
### Mobile
|
|
572
573
|
|
|
573
574
|
- `max-w-[calc(100%-2rem)]`: 1rem margin on each side
|
|
574
|
-
- `text-center`: Centered header
|
|
575
|
-
- `flex-col-reverse`: Footer with stacked buttons (Confirm on top, Cancel below)
|
|
576
575
|
|
|
577
576
|
### Desktop (sm+)
|
|
578
577
|
|
|
579
|
-
- `sm:max-w-
|
|
580
|
-
- `sm:
|
|
581
|
-
- `sm:flex-row sm:justify-end`: Horizontal footer with buttons on the right
|
|
578
|
+
- `sm:max-w-[610px]`: Max width 610px
|
|
579
|
+
- `sm:flex-row sm:justify-start`: Footer buttons laid out horizontally on the left
|
|
582
580
|
|
|
583
581
|
## Width customization
|
|
584
582
|
|
|
@@ -591,7 +589,7 @@ function App() {
|
|
|
591
589
|
{
|
|
592
590
|
/* Medium (default) */
|
|
593
591
|
}
|
|
594
|
-
<DialogContent className="sm:max-w-
|
|
592
|
+
<DialogContent className="sm:max-w-[610px]">...</DialogContent>;
|
|
595
593
|
|
|
596
594
|
{
|
|
597
595
|
/* Large */
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
</DropdownMenu>
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
**Components**:
|
|
55
|
+
**Components**: 15 (Menu, Trigger, Content, Item, CheckboxItem, RadioGroup, RadioItem, Label, Separator, Shortcut, Sub, SubTrigger, SubContent, Group, Portal)
|
|
56
56
|
|
|
57
57
|
## Main props
|
|
58
58
|
|
|
@@ -67,11 +67,14 @@ import {
|
|
|
67
67
|
|
|
68
68
|
### DropdownMenuTrigger
|
|
69
69
|
|
|
70
|
-
| Prop | Type
|
|
71
|
-
| ----------- |
|
|
72
|
-
| `asChild` | `boolean`
|
|
73
|
-
| `disabled` | `boolean`
|
|
74
|
-
| `
|
|
70
|
+
| Prop | Type | Description |
|
|
71
|
+
| ----------- | ------------------- | -------------------------------------- |
|
|
72
|
+
| `asChild` | `boolean` | Pass props to child instead of wrapper |
|
|
73
|
+
| `disabled` | `boolean` | Disable the trigger |
|
|
74
|
+
| `size` | `"sm" \| "default"` | Trigger size (default: "default") |
|
|
75
|
+
| `className` | `string` | Additional CSS classes |
|
|
76
|
+
|
|
77
|
+
**Default styles**: Similar to Button/Select trigger - `rounded-md`, `border`, `bg-background`, `h-10` (default) or `h-9` (sm), with hover and focus states
|
|
75
78
|
|
|
76
79
|
### DropdownMenuContent
|
|
77
80
|
|
|
@@ -99,9 +102,11 @@ import {
|
|
|
99
102
|
| `variant` | `"default" \| "destructive"` | `"default"` | Item style |
|
|
100
103
|
| `className` | `string` | - | Additional CSS classes |
|
|
101
104
|
|
|
105
|
+
**Default styles**: `h-11`, `gap-3`, `pl-4`, `pr-10`, no border (use DropdownMenuSeparator for dividers)
|
|
106
|
+
|
|
102
107
|
**Variants**:
|
|
103
108
|
|
|
104
|
-
- `default`: `focus:bg-
|
|
109
|
+
- `default`: `focus:bg-muted`, `focus:text-foreground`
|
|
105
110
|
- `destructive`: `text-destructive`, `focus:bg-destructive/10`, `focus:text-destructive`
|
|
106
111
|
|
|
107
112
|
### DropdownMenuCheckboxItem
|
|
@@ -113,7 +118,9 @@ import {
|
|
|
113
118
|
| `disabled` | `boolean` | Disable the item |
|
|
114
119
|
| `className` | `string` | Additional CSS classes |
|
|
115
120
|
|
|
116
|
-
**Indicator**:
|
|
121
|
+
**Indicator**: Check icon (`text-xl text-success`) when `checked={true}`, positioned at `left-2`
|
|
122
|
+
|
|
123
|
+
**Default styles**: `h-11`, `gap-3`, `pl-8`, `pr-10`, `focus:bg-muted`
|
|
117
124
|
|
|
118
125
|
### DropdownMenuRadioGroup
|
|
119
126
|
|
|
@@ -130,7 +137,9 @@ import {
|
|
|
130
137
|
| `disabled` | `boolean` | Disable the item |
|
|
131
138
|
| `className` | `string` | Additional CSS classes |
|
|
132
139
|
|
|
133
|
-
**Indicator**:
|
|
140
|
+
**Indicator**: Circle icon when selected, positioned at `left-2`
|
|
141
|
+
|
|
142
|
+
**Default styles**: `h-11`, `gap-3`, `pl-8`, `pr-10`, `focus:bg-muted`
|
|
134
143
|
|
|
135
144
|
### DropdownMenuSub
|
|
136
145
|
|
|
@@ -147,6 +156,8 @@ import {
|
|
|
147
156
|
| `inset` | `boolean` | Left padding (`pl-8`) |
|
|
148
157
|
| `className` | `string` | Additional CSS classes |
|
|
149
158
|
|
|
159
|
+
**Default styles**: `h-11`, `gap-3`, `pl-4`, `pr-10`, `focus:bg-muted`, no border
|
|
160
|
+
|
|
150
161
|
**Indicator**: Automatic ChevronRightIcon with `ml-auto`
|
|
151
162
|
|
|
152
163
|
### DropdownMenuLabel
|
|
@@ -156,7 +167,7 @@ import {
|
|
|
156
167
|
| `inset` | `boolean` | Left padding (`pl-8`) |
|
|
157
168
|
| `className` | `string` | Additional CSS classes |
|
|
158
169
|
|
|
159
|
-
**Styles**: `
|
|
170
|
+
**Styles**: `text-xs`, `text-muted-foreground`, `px-2`, `py-1.5`
|
|
160
171
|
|
|
161
172
|
### DropdownMenuShortcut
|
|
162
173
|
|
|
@@ -395,8 +406,6 @@ import { Icon } from "@adamosuiteservices/ui/icon";
|
|
|
395
406
|
### File actions (more menu)
|
|
396
407
|
|
|
397
408
|
```tsx
|
|
398
|
-
import {
|
|
399
|
-
MoreHorizontalIcon,
|
|
400
409
|
import { Icon } from "@adamosuiteservices/ui/icon";
|
|
401
410
|
|
|
402
411
|
<DropdownMenu>
|
|
@@ -439,9 +448,6 @@ import { Icon } from "@adamosuiteservices/ui/icon";
|
|
|
439
448
|
### Simple actions with chevron
|
|
440
449
|
|
|
441
450
|
```tsx
|
|
442
|
-
import {
|
|
443
|
-
ChevronDownIcon,
|
|
444
|
-
EditIcon,
|
|
445
451
|
import { Icon } from "@adamosuiteservices/ui/icon";
|
|
446
452
|
|
|
447
453
|
<DropdownMenu>
|
|
@@ -476,12 +482,6 @@ import { Icon } from "@adamosuiteservices/ui/icon";
|
|
|
476
482
|
### Project menu (nested)
|
|
477
483
|
|
|
478
484
|
```tsx
|
|
479
|
-
import {
|
|
480
|
-
FolderIcon,
|
|
481
|
-
EditIcon,
|
|
482
|
-
ShareIcon,
|
|
483
|
-
CopyIcon,
|
|
484
|
-
UsersIcon,
|
|
485
485
|
import { Icon } from "@adamosuiteservices/ui/icon";
|
|
486
486
|
|
|
487
487
|
<DropdownMenu>
|
|
@@ -607,23 +607,20 @@ function App() {
|
|
|
607
607
|
|
|
608
608
|
### Items (MenuItem, SubTrigger)
|
|
609
609
|
|
|
610
|
-
- **Height**: `
|
|
611
|
-
- **Padding**: `
|
|
612
|
-
- **
|
|
613
|
-
- **
|
|
614
|
-
- **Gap**: `gap-2` between content elements
|
|
610
|
+
- **Height**: `h-11` (44px fixed)
|
|
611
|
+
- **Padding**: `pl-4 pr-10` (left/right for icon alignment)
|
|
612
|
+
- **Icon constraints**: Icons auto `size-4` and `text-muted-foreground` if no `size-*`/`text-*` class set
|
|
613
|
+
- **Gap**: `gap-3` between content elements
|
|
615
614
|
|
|
616
615
|
### CheckboxItem and RadioItem
|
|
617
616
|
|
|
618
|
-
- **Height**: `
|
|
617
|
+
- **Height**: `h-11` (44px fixed)
|
|
619
618
|
- **Padding**: `pl-8` (left), `pr-10` (right) - space for indicators
|
|
620
|
-
- **Rounded corners**: `first:rounded-t-sm`, `last:rounded-b-sm`
|
|
621
619
|
|
|
622
620
|
### Label
|
|
623
621
|
|
|
624
|
-
- **
|
|
625
|
-
- **
|
|
626
|
-
- **Display**: `flex items-center` for vertical centering
|
|
622
|
+
- **Padding**: `px-2 py-1.5`
|
|
623
|
+
- **Text**: `text-xs text-muted-foreground`
|
|
627
624
|
|
|
628
625
|
### Content
|
|
629
626
|
|
|
@@ -634,20 +631,20 @@ function App() {
|
|
|
634
631
|
### Separator
|
|
635
632
|
|
|
636
633
|
- **Height**: `h-px`
|
|
637
|
-
- **Margins**:
|
|
634
|
+
- **Margins**: `-mx-1 my-1`
|
|
638
635
|
- **Background**: `bg-border`
|
|
639
636
|
|
|
640
637
|
## States and data attributes
|
|
641
638
|
|
|
642
639
|
### DropdownMenuItem States
|
|
643
640
|
|
|
644
|
-
- **Focus**: `data-[highlighted]` → `bg-
|
|
641
|
+
- **Focus**: `data-[highlighted]` → `bg-muted`, `text-foreground`
|
|
645
642
|
- **Disabled**: `data-[disabled=true]` → `opacity-50`, `pointer-events-none`
|
|
646
643
|
- **Destructive**: `data-[variant=destructive]` → `text-destructive`
|
|
647
644
|
|
|
648
645
|
### DropdownMenuSubTrigger States
|
|
649
646
|
|
|
650
|
-
- **Open**: `data-[state=open]` → `bg-
|
|
647
|
+
- **Open**: `data-[state=open]` → `bg-muted`, `text-foreground`
|
|
651
648
|
|
|
652
649
|
### Content Animations
|
|
653
650
|
|
|
@@ -738,6 +735,6 @@ Complete control of menu positioning:
|
|
|
738
735
|
|
|
739
736
|
## References
|
|
740
737
|
|
|
741
|
-
- **Radix UI Dropdown Menu**: https://www.radix-ui.com/primitives/docs/components/dropdown-menu
|
|
742
|
-
- **shadcn/ui Dropdown Menu**: https://ui.shadcn.com/docs/components/dropdown-menu
|
|
743
|
-
- **ARIA Menu Pattern**: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button
|
|
738
|
+
- **Radix UI Dropdown Menu**: <https://www.radix-ui.com/primitives/docs/components/dropdown-menu>
|
|
739
|
+
- **shadcn/ui Dropdown Menu**: <https://ui.shadcn.com/docs/components/dropdown-menu>
|
|
740
|
+
- **ARIA Menu Pattern**: <https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/>
|
|
@@ -53,23 +53,18 @@ import {
|
|
|
53
53
|
|
|
54
54
|
### Field
|
|
55
55
|
|
|
56
|
-
| Prop
|
|
56
|
+
| Prop | Type | Default | Description |
|
|
57
|
+
| --------------- | -------------------------------------------- | ------------ | --------------------------------------------- |
|
|
58
|
+
| `orientation` | `"vertical" \| "horizontal" \| "responsive"` | `"vertical"` | Field layout orientation |
|
|
59
|
+
| `data-invalid` | `boolean` | - | Marks field as invalid (applies error styles) |
|
|
60
|
+
| `data-disabled` | `boolean` | - | Marks field as disabled |
|
|
61
|
+
| `className` | `string` | - | Additional CSS classes |
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
**Orientations**:
|
|
59
64
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| `data-disabled` | `boolean` | - | Marca field como deshabilitado || error | `string` | Mensaje de error |
|
|
65
|
-
|
|
66
|
-
| `className` | `string` | - | Clases CSS adicionales || required | `boolean` | Marca el campo como requerido |
|
|
67
|
-
|
|
68
|
-
**Orientaciones**:
|
|
69
|
-
|
|
70
|
-
- `vertical`: Label arriba, input abajo
|
|
71
|
-
- `horizontal`: Label e input lado a lado
|
|
72
|
-
- `responsive`: Vertical en mobile, horizontal en desktop (@md/field-group)
|
|
65
|
+
- `vertical`: Label above, input below
|
|
66
|
+
- `horizontal`: Label and input side by side
|
|
67
|
+
- `responsive`: Vertical on mobile, horizontal on desktop (`@md/field-group`)
|
|
73
68
|
|
|
74
69
|
### FieldLabel
|
|
75
70
|
|
|
@@ -86,7 +81,7 @@ import {
|
|
|
86
81
|
| ----------- | -------- | ---------------------- |
|
|
87
82
|
| `className` | `string` | Additional CSS classes |
|
|
88
83
|
|
|
89
|
-
**Styles**: `text-
|
|
84
|
+
**Styles**: `text-xs`, `text-foreground`, links with `hover:text-primary`
|
|
90
85
|
|
|
91
86
|
### FieldError
|
|
92
87
|
|
|
@@ -128,7 +123,7 @@ import {
|
|
|
128
123
|
| ----------- | -------- | ---------------------- |
|
|
129
124
|
| `className` | `string` | Additional CSS classes |
|
|
130
125
|
|
|
131
|
-
**Styles**: `@container/field-group`, `flex flex-col gap-
|
|
126
|
+
**Styles**: `@container/field-group`, `flex flex-col gap-4`, auto-adjust for nested groups
|
|
132
127
|
|
|
133
128
|
### FieldSeparator
|
|
134
129
|
|
|
@@ -593,20 +588,19 @@ function PriceRange() {
|
|
|
593
588
|
|
|
594
589
|
## Container queries
|
|
595
590
|
|
|
596
|
-
FieldGroup
|
|
591
|
+
FieldGroup uses `@container/field-group` for responsive layouts:
|
|
597
592
|
|
|
598
593
|
```tsx
|
|
599
594
|
<FieldGroup>
|
|
600
|
-
{" "}
|
|
601
595
|
{/* @container/field-group */}
|
|
602
596
|
<Field orientation="responsive">
|
|
603
|
-
{/* Vertical
|
|
604
|
-
{/* Horizontal
|
|
597
|
+
{/* Vertical by default */}
|
|
598
|
+
{/* Horizontal at @md/field-group */}
|
|
605
599
|
</Field>
|
|
606
600
|
</FieldGroup>
|
|
607
601
|
```
|
|
608
602
|
|
|
609
|
-
**Breakpoint**: `@md` (
|
|
603
|
+
**Breakpoint**: `@md` (approximately 448px container width)
|
|
610
604
|
|
|
611
605
|
## Accessibility
|
|
612
606
|
|
|
@@ -621,15 +615,15 @@ FieldGroup usa `@container/field-group` para layouts responsive:
|
|
|
621
615
|
|
|
622
616
|
## Implementation notes
|
|
623
617
|
|
|
624
|
-
- **Composable**:
|
|
625
|
-
- **Class Variance Authority**:
|
|
626
|
-
- **Container queries**: `@container/field-group`
|
|
627
|
-
- **Auto-styling**:
|
|
628
|
-
- **Choice cards**: FieldLabel
|
|
629
|
-
- **Error deduplication**: Auto-
|
|
630
|
-
- **Flexible**:
|
|
631
|
-
- **No wrapper div**: Field
|
|
632
|
-
- **Data attributes**: `data-slot`
|
|
618
|
+
- **Composable**: Each part is an independent component
|
|
619
|
+
- **Class Variance Authority**: Uses CVA for orientation variants
|
|
620
|
+
- **Container queries**: `@container/field-group` for responsive layouts
|
|
621
|
+
- **Auto-styling**: Detects checkbox/radio groups and adjusts gap
|
|
622
|
+
- **Choice cards**: FieldLabel detects child Field and applies card styles
|
|
623
|
+
- **Error deduplication**: Auto-deduplicates errors by message
|
|
624
|
+
- **Flexible**: Supports any type of input/select/textarea
|
|
625
|
+
- **No wrapper div**: Field is a `role="group"`, does not add unnecessary divs
|
|
626
|
+
- **Data attributes**: `data-slot` on each component for CSS targeting
|
|
633
627
|
- **Disabled state**: Propagates from Field to Label with opacity
|
|
634
628
|
|
|
635
629
|
## React Hook Form integration
|
|
@@ -1242,10 +1242,21 @@ function EventTrackingExample() {
|
|
|
1242
1242
|
## TypeScript types
|
|
1243
1243
|
|
|
1244
1244
|
```typescript
|
|
1245
|
+
export type FileStatus =
|
|
1246
|
+
| "idle"
|
|
1247
|
+
| "uploading"
|
|
1248
|
+
| "success"
|
|
1249
|
+
| "error"
|
|
1250
|
+
| "deleting";
|
|
1251
|
+
|
|
1245
1252
|
export type FileWithMetadata = {
|
|
1246
1253
|
id: string;
|
|
1247
1254
|
file: File;
|
|
1248
1255
|
metadata?: Record<string, unknown>;
|
|
1256
|
+
status?: FileStatus;
|
|
1257
|
+
deletable?: boolean;
|
|
1258
|
+
disabled?: boolean;
|
|
1259
|
+
error?: string;
|
|
1249
1260
|
};
|
|
1250
1261
|
|
|
1251
1262
|
export type FileUploadV2Labels = {
|