@rdna/radiants 0.1.0 → 0.1.2
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/components/core/Accordion/Accordion.dna.json +16 -0
- package/components/core/Accordion/Accordion.schema.json +48 -0
- package/components/core/Alert/Alert.dna.json +56 -0
- package/components/core/Alert/Alert.schema.json +66 -0
- package/components/core/Badge/Badge.dna.json +48 -0
- package/components/core/Badge/Badge.schema.json +49 -0
- package/components/core/Breadcrumbs/Breadcrumbs.dna.json +29 -0
- package/components/core/Breadcrumbs/Breadcrumbs.schema.json +39 -0
- package/components/core/Button/Button.dna.json +58 -0
- package/components/core/Button/Button.schema.json +84 -0
- package/components/core/Card/Card.dna.json +21 -0
- package/components/core/Card/Card.schema.json +23 -0
- package/components/core/Checkbox/Checkbox.dna.json +38 -0
- package/components/core/Checkbox/Checkbox.schema.json +55 -0
- package/components/core/ContextMenu/ContextMenu.dna.json +25 -0
- package/components/core/ContextMenu/ContextMenu.schema.json +30 -0
- package/components/core/CountdownTimer/CountdownTimer.dna.json +79 -0
- package/components/core/CountdownTimer/CountdownTimer.schema.json +71 -0
- package/components/core/Dialog/Dialog.dna.json +28 -0
- package/components/core/Dialog/Dialog.schema.json +40 -0
- package/components/core/Divider/Divider.dna.json +16 -0
- package/components/core/Divider/Divider.schema.json +41 -0
- package/components/core/DropdownMenu/DropdownMenu.dna.json +28 -0
- package/components/core/DropdownMenu/DropdownMenu.schema.json +55 -0
- package/components/core/HelpPanel/HelpPanel.dna.json +24 -0
- package/components/core/HelpPanel/HelpPanel.schema.json +47 -0
- package/components/core/Input/Input.dna.json +33 -0
- package/components/core/Input/Input.schema.json +33 -0
- package/components/core/MockStatesPopover/MockStatesPopover.dna.json +33 -0
- package/components/core/MockStatesPopover/MockStatesPopover.schema.json +80 -0
- package/components/core/Popover/Popover.dna.json +10 -0
- package/components/core/Popover/Popover.schema.json +46 -0
- package/components/core/Progress/Progress.dna.json +29 -0
- package/components/core/Progress/Progress.schema.json +57 -0
- package/components/core/Select/Select.dna.json +42 -0
- package/components/core/Select/Select.schema.json +66 -0
- package/components/core/Sheet/Sheet.dna.json +28 -0
- package/components/core/Sheet/Sheet.schema.json +53 -0
- package/components/core/Slider/Slider.dna.json +49 -0
- package/components/core/Slider/Slider.schema.json +70 -0
- package/components/core/Switch/Switch.dna.json +47 -0
- package/components/core/Switch/Switch.schema.json +64 -0
- package/components/core/Tabs/Tabs.dna.json +39 -0
- package/components/core/Tabs/Tabs.schema.json +62 -0
- package/components/core/Toast/Toast.dna.json +31 -0
- package/components/core/Toast/Toast.schema.json +57 -0
- package/components/core/Tooltip/Tooltip.dna.json +46 -0
- package/components/core/Tooltip/Tooltip.schema.json +58 -0
- package/components/core/Web3ActionBar/Web3ActionBar.dna.json +23 -0
- package/components/core/Web3ActionBar/Web3ActionBar.schema.json +50 -0
- package/dist/schemas/index.d.mts +6446 -0
- package/dist/schemas/index.mjs +2386 -0
- package/dist/schemas/index.mjs.map +1 -0
- package/package.json +11 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ContextMenu",
|
|
3
|
+
"description": "Right-click context menu with customizable items. Provides a native-feeling context menu experience with support for icons, separators, and destructive actions.",
|
|
4
|
+
"subcomponents": ["ContextMenuContent", "ContextMenuItem", "ContextMenuSeparator"],
|
|
5
|
+
"props": {
|
|
6
|
+
"className": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Additional CSS classes for the trigger container"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"slots": {
|
|
12
|
+
"children": {
|
|
13
|
+
"description": "Content that triggers context menu on right-click, plus ContextMenuContent with menu items"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"examples": [
|
|
17
|
+
{
|
|
18
|
+
"name": "Basic context menu",
|
|
19
|
+
"code": "<ContextMenu>\n <div>Right-click me</div>\n <ContextMenuContent>\n <ContextMenuItem onClick={() => console.log('Edit')}>Edit</ContextMenuItem>\n <ContextMenuItem onClick={() => console.log('Copy')}>Copy</ContextMenuItem>\n <ContextMenuSeparator />\n <ContextMenuItem onClick={() => console.log('Delete')} destructive>Delete</ContextMenuItem>\n </ContextMenuContent>\n</ContextMenu>"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "With icons",
|
|
23
|
+
"code": "<ContextMenu>\n <div>Right-click me</div>\n <ContextMenuContent>\n <ContextMenuItem icon={<EditIcon />}>Edit</ContextMenuItem>\n <ContextMenuItem icon={<CopyIcon />}>Copy</ContextMenuItem>\n <ContextMenuItem icon={<TrashIcon />} destructive>Delete</ContextMenuItem>\n </ContextMenuContent>\n</ContextMenu>"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "With disabled items",
|
|
27
|
+
"code": "<ContextMenu>\n <div>Right-click me</div>\n <ContextMenuContent>\n <ContextMenuItem>Enabled action</ContextMenuItem>\n <ContextMenuItem disabled>Disabled action</ContextMenuItem>\n </ContextMenuContent>\n</ContextMenu>"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "CountdownTimer",
|
|
3
|
+
"description": "Token bindings for CountdownTimer component variants",
|
|
4
|
+
"tokenBindings": {
|
|
5
|
+
"base": {
|
|
6
|
+
"textAlign": "center",
|
|
7
|
+
"font": "mono"
|
|
8
|
+
},
|
|
9
|
+
"default": {
|
|
10
|
+
"background": "surface-primary",
|
|
11
|
+
"border": "edge-primary",
|
|
12
|
+
"padding": "spacing-md",
|
|
13
|
+
"borderRadius": "md"
|
|
14
|
+
},
|
|
15
|
+
"compact": {
|
|
16
|
+
"background": "surface-primary",
|
|
17
|
+
"border": "edge-primary",
|
|
18
|
+
"paddingX": "spacing-sm",
|
|
19
|
+
"paddingY": "spacing-xs",
|
|
20
|
+
"borderRadius": "sm"
|
|
21
|
+
},
|
|
22
|
+
"large": {
|
|
23
|
+
"background": "surface-primary",
|
|
24
|
+
"border": "edge-primary",
|
|
25
|
+
"padding": "spacing-lg",
|
|
26
|
+
"borderRadius": "md",
|
|
27
|
+
"shadow": "card"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"elements": {
|
|
31
|
+
"label": {
|
|
32
|
+
"font": "mono",
|
|
33
|
+
"textOpacity": "60%"
|
|
34
|
+
},
|
|
35
|
+
"timer": {
|
|
36
|
+
"display": "flex",
|
|
37
|
+
"alignItems": "center",
|
|
38
|
+
"justifyContent": "center"
|
|
39
|
+
},
|
|
40
|
+
"segment": {
|
|
41
|
+
"display": "flex",
|
|
42
|
+
"flexDirection": "column",
|
|
43
|
+
"alignItems": "center"
|
|
44
|
+
},
|
|
45
|
+
"segmentLarge": {
|
|
46
|
+
"background": "surface-muted",
|
|
47
|
+
"border": "edge-primary",
|
|
48
|
+
"borderRadius": "sm",
|
|
49
|
+
"paddingX": "spacing-sm",
|
|
50
|
+
"paddingY": "spacing-xs"
|
|
51
|
+
},
|
|
52
|
+
"value": {
|
|
53
|
+
"font": "heading",
|
|
54
|
+
"text": "content-primary",
|
|
55
|
+
"fontVariantNumeric": "tabular-nums"
|
|
56
|
+
},
|
|
57
|
+
"unit": {
|
|
58
|
+
"font": "mono",
|
|
59
|
+
"textTransform": "uppercase",
|
|
60
|
+
"textOpacity": "50%"
|
|
61
|
+
},
|
|
62
|
+
"separator": {
|
|
63
|
+
"font": "heading",
|
|
64
|
+
"textOpacity": "40%"
|
|
65
|
+
},
|
|
66
|
+
"endedMessage": {
|
|
67
|
+
"font": "heading",
|
|
68
|
+
"textOpacity": "60%"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"states": {
|
|
72
|
+
"ended": {
|
|
73
|
+
"textOpacity": "60%"
|
|
74
|
+
},
|
|
75
|
+
"upcoming": {
|
|
76
|
+
"labelText": "Starts in"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "CountdownTimer",
|
|
3
|
+
"description": "Live countdown timer for auction and event countdowns. Supports multiple size variants with automatic status detection (active, ended, upcoming).",
|
|
4
|
+
"props": {
|
|
5
|
+
"endTime": {
|
|
6
|
+
"type": "number | Date",
|
|
7
|
+
"required": true,
|
|
8
|
+
"description": "Target timestamp (Unix ms or Date object) when the countdown ends"
|
|
9
|
+
},
|
|
10
|
+
"startTime": {
|
|
11
|
+
"type": "number | Date",
|
|
12
|
+
"description": "Optional start time for detecting 'upcoming' status before countdown begins"
|
|
13
|
+
},
|
|
14
|
+
"variant": {
|
|
15
|
+
"type": "enum",
|
|
16
|
+
"values": ["default", "compact", "large"],
|
|
17
|
+
"default": "default",
|
|
18
|
+
"description": "Size variant controlling container, text sizes, and spacing"
|
|
19
|
+
},
|
|
20
|
+
"label": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Label text shown above the timer display"
|
|
23
|
+
},
|
|
24
|
+
"onComplete": {
|
|
25
|
+
"type": "function",
|
|
26
|
+
"description": "Callback fired when countdown reaches zero"
|
|
27
|
+
},
|
|
28
|
+
"endedMessage": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"default": "Ended",
|
|
31
|
+
"description": "Custom message displayed when countdown has ended"
|
|
32
|
+
},
|
|
33
|
+
"upcomingMessage": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"default": "Starting soon",
|
|
36
|
+
"description": "Custom message displayed when countdown has not yet started"
|
|
37
|
+
},
|
|
38
|
+
"showDays": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": true,
|
|
41
|
+
"description": "Show days segment when remaining time exceeds 24 hours"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"slots": {},
|
|
45
|
+
"examples": [
|
|
46
|
+
{
|
|
47
|
+
"name": "Default countdown",
|
|
48
|
+
"code": "<CountdownTimer endTime={Date.now() + 3600000} />"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "Countdown with label",
|
|
52
|
+
"code": "<CountdownTimer endTime={auctionEndTime} label=\"Auction ends in\" />"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "Compact variant",
|
|
56
|
+
"code": "<CountdownTimer variant=\"compact\" endTime={deadline} />"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Large variant with callback",
|
|
60
|
+
"code": "<CountdownTimer variant=\"large\" endTime={eventTime} onComplete={() => alert('Time is up!')} />"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "Upcoming countdown",
|
|
64
|
+
"code": "<CountdownTimer startTime={futureStart} endTime={futureEnd} />"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "Custom ended message",
|
|
68
|
+
"code": "<CountdownTimer endTime={pastTime} endedMessage=\"Auction closed\" />"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "Dialog",
|
|
3
|
+
"tokenBindings": {
|
|
4
|
+
"overlay": {
|
|
5
|
+
"background": "surface-secondary/50"
|
|
6
|
+
},
|
|
7
|
+
"content": {
|
|
8
|
+
"background": "surface-primary",
|
|
9
|
+
"border": "edge-primary",
|
|
10
|
+
"shadow": "shadow-card"
|
|
11
|
+
},
|
|
12
|
+
"header": {
|
|
13
|
+
"border": "edge-primary/20"
|
|
14
|
+
},
|
|
15
|
+
"title": {
|
|
16
|
+
"text": "content-primary"
|
|
17
|
+
},
|
|
18
|
+
"description": {
|
|
19
|
+
"text": "content-primary/70"
|
|
20
|
+
},
|
|
21
|
+
"body": {
|
|
22
|
+
"text": "content-primary"
|
|
23
|
+
},
|
|
24
|
+
"footer": {
|
|
25
|
+
"border": "edge-primary/20"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Dialog",
|
|
3
|
+
"description": "Modal dialog with overlay for focused user interactions. Supports controlled and uncontrolled states with keyboard accessibility.",
|
|
4
|
+
"subcomponents": ["DialogTrigger", "DialogContent", "DialogHeader", "DialogTitle", "DialogDescription", "DialogBody", "DialogFooter", "DialogClose"],
|
|
5
|
+
"props": {
|
|
6
|
+
"open": {
|
|
7
|
+
"type": "boolean",
|
|
8
|
+
"description": "Controlled open state for the dialog"
|
|
9
|
+
},
|
|
10
|
+
"defaultOpen": {
|
|
11
|
+
"type": "boolean",
|
|
12
|
+
"default": false,
|
|
13
|
+
"description": "Default open state for uncontrolled usage"
|
|
14
|
+
},
|
|
15
|
+
"onOpenChange": {
|
|
16
|
+
"type": "function",
|
|
17
|
+
"description": "Callback when open state changes"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"slots": {
|
|
21
|
+
"children": {
|
|
22
|
+
"description": "Dialog subcomponents (DialogTrigger, DialogContent, etc.)"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"variants": {},
|
|
26
|
+
"examples": [
|
|
27
|
+
{
|
|
28
|
+
"name": "Basic dialog",
|
|
29
|
+
"code": "<Dialog>\n <DialogTrigger asChild>\n <Button>Open Dialog</Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Dialog Title</DialogTitle>\n <DialogDescription>This is a description of the dialog.</DialogDescription>\n </DialogHeader>\n <DialogBody>\n <p>Dialog content goes here.</p>\n </DialogBody>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">Cancel</Button>\n </DialogClose>\n <Button>Confirm</Button>\n </DialogFooter>\n </DialogContent>\n</Dialog>"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "Controlled dialog",
|
|
33
|
+
"code": "<Dialog open={isOpen} onOpenChange={setIsOpen}>\n <DialogTrigger asChild>\n <Button>Settings</Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Settings</DialogTitle>\n </DialogHeader>\n <DialogBody>\n <p>Configure your preferences.</p>\n </DialogBody>\n <DialogFooter>\n <Button onClick={() => setIsOpen(false)}>Save</Button>\n </DialogFooter>\n </DialogContent>\n</Dialog>"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "Simple confirmation dialog",
|
|
37
|
+
"code": "<Dialog>\n <DialogTrigger asChild>\n <Button variant=\"outline\">Delete</Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Confirm Deletion</DialogTitle>\n <DialogDescription>Are you sure you want to delete this item?</DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">Cancel</Button>\n </DialogClose>\n <Button>Delete</Button>\n </DialogFooter>\n </DialogContent>\n</Dialog>"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "Divider",
|
|
3
|
+
"description": "Token bindings for Divider component variants",
|
|
4
|
+
"tokenBindings": {
|
|
5
|
+
"base": {
|
|
6
|
+
"border": "edge-primary/20",
|
|
7
|
+
"lineHeight": "2px"
|
|
8
|
+
},
|
|
9
|
+
"decorated": {
|
|
10
|
+
"lineColor": "edge-primary/20",
|
|
11
|
+
"ornamentBackground": "action-primary",
|
|
12
|
+
"ornamentBorder": "edge-primary"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"states": {}
|
|
16
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Divider",
|
|
3
|
+
"description": "Visual separator for content sections. Supports horizontal and vertical orientations with solid, dashed, or decorated styling.",
|
|
4
|
+
"props": {
|
|
5
|
+
"orientation": {
|
|
6
|
+
"type": "enum",
|
|
7
|
+
"values": ["horizontal", "vertical"],
|
|
8
|
+
"default": "horizontal",
|
|
9
|
+
"description": "Direction of the divider line"
|
|
10
|
+
},
|
|
11
|
+
"variant": {
|
|
12
|
+
"type": "enum",
|
|
13
|
+
"values": ["solid", "dashed", "decorated"],
|
|
14
|
+
"default": "solid",
|
|
15
|
+
"description": "Visual style of the divider. Decorated adds a centered diamond ornament."
|
|
16
|
+
},
|
|
17
|
+
"className": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Additional CSS classes for customization"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"slots": {},
|
|
23
|
+
"examples": [
|
|
24
|
+
{
|
|
25
|
+
"name": "Horizontal solid",
|
|
26
|
+
"code": "<Divider />"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "Horizontal dashed",
|
|
30
|
+
"code": "<Divider variant=\"dashed\" />"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Decorated with diamond",
|
|
34
|
+
"code": "<Divider variant=\"decorated\" />"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "Vertical divider",
|
|
38
|
+
"code": "<Divider orientation=\"vertical\" />"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "DropdownMenu",
|
|
3
|
+
"description": "Token bindings for DropdownMenu component",
|
|
4
|
+
"tokenBindings": {
|
|
5
|
+
"content": {
|
|
6
|
+
"background": "surface-primary",
|
|
7
|
+
"border": "edge-primary",
|
|
8
|
+
"shadow": "edge-primary"
|
|
9
|
+
},
|
|
10
|
+
"item": {
|
|
11
|
+
"text": "content-primary",
|
|
12
|
+
"textDestructive": "status-error",
|
|
13
|
+
"backgroundHover": "content-primary/5"
|
|
14
|
+
},
|
|
15
|
+
"separator": {
|
|
16
|
+
"border": "edge-primary/20"
|
|
17
|
+
},
|
|
18
|
+
"label": {
|
|
19
|
+
"text": "content-primary/50"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"states": {
|
|
23
|
+
"disabled": {
|
|
24
|
+
"opacity": "50%",
|
|
25
|
+
"cursor": "not-allowed"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "DropdownMenu",
|
|
3
|
+
"description": "Dropdown menu triggered by a button or custom element. Provides accessible menu navigation with support for icons, separators, labels, and destructive actions.",
|
|
4
|
+
"subcomponents": [
|
|
5
|
+
"DropdownMenuTrigger",
|
|
6
|
+
"DropdownMenuContent",
|
|
7
|
+
"DropdownMenuItem",
|
|
8
|
+
"DropdownMenuSeparator",
|
|
9
|
+
"DropdownMenuLabel"
|
|
10
|
+
],
|
|
11
|
+
"props": {
|
|
12
|
+
"open": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Controlled open state"
|
|
15
|
+
},
|
|
16
|
+
"defaultOpen": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"default": false,
|
|
19
|
+
"description": "Default open state for uncontrolled usage"
|
|
20
|
+
},
|
|
21
|
+
"onOpenChange": {
|
|
22
|
+
"type": "function",
|
|
23
|
+
"description": "Callback when open state changes"
|
|
24
|
+
},
|
|
25
|
+
"position": {
|
|
26
|
+
"type": "enum",
|
|
27
|
+
"values": ["bottom-start", "bottom-end", "top-start", "top-end"],
|
|
28
|
+
"default": "bottom-start",
|
|
29
|
+
"description": "Position of the dropdown relative to the trigger"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"slots": {
|
|
33
|
+
"children": {
|
|
34
|
+
"description": "DropdownMenuTrigger and DropdownMenuContent components"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"examples": [
|
|
38
|
+
{
|
|
39
|
+
"name": "Basic dropdown menu",
|
|
40
|
+
"code": "<DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button>Open Menu</Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onClick={() => console.log('Edit')}>Edit</DropdownMenuItem>\n <DropdownMenuItem onClick={() => console.log('Copy')}>Copy</DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={() => console.log('Delete')} destructive>Delete</DropdownMenuItem>\n </DropdownMenuContent>\n</DropdownMenu>"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "With labels",
|
|
44
|
+
"code": "<DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button>Options</Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel>Actions</DropdownMenuLabel>\n <DropdownMenuItem>Edit</DropdownMenuItem>\n <DropdownMenuItem>Duplicate</DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuLabel>Danger Zone</DropdownMenuLabel>\n <DropdownMenuItem destructive>Delete</DropdownMenuItem>\n </DropdownMenuContent>\n</DropdownMenu>"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "Positioned menu",
|
|
48
|
+
"code": "<DropdownMenu position=\"bottom-end\">\n <DropdownMenuTrigger asChild>\n <Button iconOnly><MoreIcon /></Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem>Settings</DropdownMenuItem>\n <DropdownMenuItem>Help</DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem>Log out</DropdownMenuItem>\n </DropdownMenuContent>\n</DropdownMenu>"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "With disabled items",
|
|
52
|
+
"code": "<DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button>Actions</Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem>Available action</DropdownMenuItem>\n <DropdownMenuItem disabled>Unavailable action</DropdownMenuItem>\n </DropdownMenuContent>\n</DropdownMenu>"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "HelpPanel",
|
|
3
|
+
"tokenBindings": {
|
|
4
|
+
"overlay": {
|
|
5
|
+
"background": "surface-secondary/20"
|
|
6
|
+
},
|
|
7
|
+
"panel": {
|
|
8
|
+
"background": "surface-primary",
|
|
9
|
+
"border": "edge-primary",
|
|
10
|
+
"shadow": "card-lg"
|
|
11
|
+
},
|
|
12
|
+
"header": {
|
|
13
|
+
"border": "edge-primary",
|
|
14
|
+
"text": "content-primary"
|
|
15
|
+
},
|
|
16
|
+
"closeButton": {
|
|
17
|
+
"text": "content-primary/50",
|
|
18
|
+
"hoverText": "content-primary"
|
|
19
|
+
},
|
|
20
|
+
"content": {
|
|
21
|
+
"text": "content-primary"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "HelpPanel",
|
|
3
|
+
"description": "Slide-in help panel that appears from the right side of the window. Used to display contextual help content within app windows.",
|
|
4
|
+
"props": {
|
|
5
|
+
"isOpen": {
|
|
6
|
+
"type": "boolean",
|
|
7
|
+
"required": true,
|
|
8
|
+
"description": "Whether the panel is open"
|
|
9
|
+
},
|
|
10
|
+
"onClose": {
|
|
11
|
+
"type": "function",
|
|
12
|
+
"required": true,
|
|
13
|
+
"description": "Callback when panel should close"
|
|
14
|
+
},
|
|
15
|
+
"title": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"default": "Help",
|
|
18
|
+
"description": "Optional title for the help panel"
|
|
19
|
+
},
|
|
20
|
+
"className": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Additional CSS classes to apply"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"slots": {
|
|
26
|
+
"children": {
|
|
27
|
+
"description": "Help content to display"
|
|
28
|
+
},
|
|
29
|
+
"closeButton": {
|
|
30
|
+
"description": "Custom close button/icon slot - renders your own close button component"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"examples": [
|
|
34
|
+
{
|
|
35
|
+
"name": "Basic help panel",
|
|
36
|
+
"code": "<HelpPanel isOpen={showHelp} onClose={() => setShowHelp(false)}>\n <p>This is some helpful content.</p>\n</HelpPanel>"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Custom title",
|
|
40
|
+
"code": "<HelpPanel isOpen={showHelp} onClose={() => setShowHelp(false)} title=\"Getting Started\">\n <p>Welcome to the app!</p>\n</HelpPanel>"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Custom close button",
|
|
44
|
+
"code": "<HelpPanel isOpen={showHelp} onClose={() => setShowHelp(false)} closeButton={<XIcon />}>\n <p>Content with custom close icon.</p>\n</HelpPanel>"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "Input",
|
|
3
|
+
"tokenBindings": {
|
|
4
|
+
"default": {
|
|
5
|
+
"background": "surface-primary",
|
|
6
|
+
"text": "content-primary",
|
|
7
|
+
"border": "edge-primary",
|
|
8
|
+
"placeholder": "content-muted",
|
|
9
|
+
"focusRing": "edge-focus"
|
|
10
|
+
},
|
|
11
|
+
"error": {
|
|
12
|
+
"border": "status-error",
|
|
13
|
+
"focusRing": "status-error"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"sizes": {
|
|
17
|
+
"sm": {
|
|
18
|
+
"height": "2rem",
|
|
19
|
+
"padding": "0.5rem",
|
|
20
|
+
"fontSize": "0.875rem"
|
|
21
|
+
},
|
|
22
|
+
"md": {
|
|
23
|
+
"height": "2.5rem",
|
|
24
|
+
"padding": "0.75rem",
|
|
25
|
+
"fontSize": "1rem"
|
|
26
|
+
},
|
|
27
|
+
"lg": {
|
|
28
|
+
"height": "3rem",
|
|
29
|
+
"padding": "1rem",
|
|
30
|
+
"fontSize": "1rem"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Input",
|
|
3
|
+
"description": "Text input field with optional icon and error state",
|
|
4
|
+
"props": {
|
|
5
|
+
"size": {
|
|
6
|
+
"type": "enum",
|
|
7
|
+
"values": ["sm", "md", "lg"],
|
|
8
|
+
"default": "md",
|
|
9
|
+
"description": "Size preset for input height and padding"
|
|
10
|
+
},
|
|
11
|
+
"error": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"default": false,
|
|
14
|
+
"description": "Shows error state styling"
|
|
15
|
+
},
|
|
16
|
+
"fullWidth": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"default": false,
|
|
19
|
+
"description": "Makes input take full container width"
|
|
20
|
+
},
|
|
21
|
+
"iconName": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Icon name for leading icon slot"
|
|
24
|
+
},
|
|
25
|
+
"disabled": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": false,
|
|
28
|
+
"description": "Disables the input"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"slots": ["icon"],
|
|
32
|
+
"relatedComponents": ["TextArea", "Label"]
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "MockStatesPopover",
|
|
3
|
+
"tokenBindings": {
|
|
4
|
+
"popover": {
|
|
5
|
+
"background": "surface-primary",
|
|
6
|
+
"border": "edge-primary"
|
|
7
|
+
},
|
|
8
|
+
"header": {
|
|
9
|
+
"text": "content-primary",
|
|
10
|
+
"border": "edge-primary/20"
|
|
11
|
+
},
|
|
12
|
+
"content": {
|
|
13
|
+
"text": "content-primary"
|
|
14
|
+
},
|
|
15
|
+
"categoryLabel": {
|
|
16
|
+
"text": "content-secondary"
|
|
17
|
+
},
|
|
18
|
+
"stateButton": {
|
|
19
|
+
"text": "content-primary",
|
|
20
|
+
"description": "content-secondary",
|
|
21
|
+
"hoverBackground": "content-primary/5"
|
|
22
|
+
},
|
|
23
|
+
"stateButtonActive": {
|
|
24
|
+
"background": "action-primary",
|
|
25
|
+
"text": "content-primary"
|
|
26
|
+
},
|
|
27
|
+
"footer": {
|
|
28
|
+
"text": "content-secondary",
|
|
29
|
+
"background": "content-primary/5",
|
|
30
|
+
"border": "edge-primary/20"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "MockStatesPopover",
|
|
3
|
+
"description": "Development-only popover for toggling between mock states. Displays categorized mock state presets that can be applied to test different UI scenarios.",
|
|
4
|
+
"subcomponents": ["MockStatesPopoverTrigger", "MockStatesPopoverContent"],
|
|
5
|
+
"props": {
|
|
6
|
+
"isOpen": {
|
|
7
|
+
"type": "boolean",
|
|
8
|
+
"required": true,
|
|
9
|
+
"description": "Whether the popover is open"
|
|
10
|
+
},
|
|
11
|
+
"onClose": {
|
|
12
|
+
"type": "function",
|
|
13
|
+
"required": true,
|
|
14
|
+
"description": "Callback when the popover should close"
|
|
15
|
+
},
|
|
16
|
+
"mockStates": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"required": true,
|
|
19
|
+
"description": "Array of mock state definitions with id, name, description, category, and optional icon"
|
|
20
|
+
},
|
|
21
|
+
"activeMockState": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Currently active mock state ID"
|
|
24
|
+
},
|
|
25
|
+
"onSelectState": {
|
|
26
|
+
"type": "function",
|
|
27
|
+
"required": true,
|
|
28
|
+
"description": "Callback when a mock state is selected, receives the state ID"
|
|
29
|
+
},
|
|
30
|
+
"categories": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"description": "Categories to display (in order). States are grouped by category. Auto-derived from mockStates if not provided."
|
|
33
|
+
},
|
|
34
|
+
"title": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"default": "Mock States",
|
|
37
|
+
"description": "Title shown in the header"
|
|
38
|
+
},
|
|
39
|
+
"footerText": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"default": "Dev mode only",
|
|
42
|
+
"description": "Footer text displayed at the bottom"
|
|
43
|
+
},
|
|
44
|
+
"className": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Additional CSS classes for the popover container"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"variants": {
|
|
50
|
+
"state": {
|
|
51
|
+
"values": ["open", "closed"],
|
|
52
|
+
"description": "Visibility state of the popover"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"slots": {
|
|
56
|
+
"header": {
|
|
57
|
+
"description": "Header area with title and close button"
|
|
58
|
+
},
|
|
59
|
+
"content": {
|
|
60
|
+
"description": "Scrollable content area with categorized state buttons"
|
|
61
|
+
},
|
|
62
|
+
"footer": {
|
|
63
|
+
"description": "Footer area with optional text"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"examples": [
|
|
67
|
+
{
|
|
68
|
+
"name": "Basic usage",
|
|
69
|
+
"code": "<MockStatesPopover\n isOpen={isOpen}\n onClose={() => setIsOpen(false)}\n mockStates={[\n { id: 'wallet-connected', name: 'Connected', description: 'Wallet is connected', category: 'wallet' },\n { id: 'wallet-disconnected', name: 'Disconnected', description: 'No wallet', category: 'wallet' }\n ]}\n activeMockState={activeState}\n onSelectState={setActiveState}\n/>"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "With custom categories",
|
|
73
|
+
"code": "<MockStatesPopover\n isOpen={isOpen}\n onClose={handleClose}\n mockStates={mockStates}\n activeMockState={activeState}\n onSelectState={handleSelect}\n categories={[\n { id: 'wallet', label: 'Wallet States' },\n { id: 'auction', label: 'Auction States' }\n ]}\n/>"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "With icons",
|
|
77
|
+
"code": "<MockStatesPopover\n isOpen={isOpen}\n onClose={handleClose}\n mockStates={[\n { id: 'success', name: 'Success', description: 'Operation succeeded', category: 'status', icon: '\\u2713' },\n { id: 'error', name: 'Error', description: 'Operation failed', category: 'status', icon: '\\u2717' }\n ]}\n onSelectState={handleSelect}\n/>"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|