sonance-brand-mcp 1.3.1 → 1.3.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/dist/assets/api/sonance-analyze/route.ts +1116 -0
- package/dist/assets/api/sonance-assets/route.ts +113 -0
- package/dist/assets/api/sonance-components/route.ts +41 -0
- package/dist/assets/api/sonance-inject-id/route.ts +363 -0
- package/dist/assets/api/sonance-save-logo/route.ts +426 -0
- package/dist/assets/api/sonance-theme/route.ts +106 -0
- package/dist/assets/brand-system.ts +1265 -0
- package/dist/assets/components/accordion.stories.tsx +26 -26
- package/dist/assets/components/accordion.tsx +3 -3
- package/dist/assets/components/alert-dialog.stories.tsx +7 -7
- package/dist/assets/components/alert-dialog.tsx +2 -1
- package/dist/assets/components/alert.stories.tsx +3 -3
- package/dist/assets/components/alert.tsx +4 -3
- package/dist/assets/components/aspect-ratio.stories.tsx +4 -1
- package/dist/assets/components/autocomplete.stories.tsx +9 -9
- package/dist/assets/components/autocomplete.tsx +3 -3
- package/dist/assets/components/avatar.stories.tsx +5 -5
- package/dist/assets/components/avatar.tsx +4 -4
- package/dist/assets/components/badge.stories.tsx +10 -10
- package/dist/assets/components/badge.tsx +3 -3
- package/dist/assets/components/breadcrumbs.stories.tsx +7 -7
- package/dist/assets/components/breadcrumbs.tsx +13 -8
- package/dist/assets/components/button.stories.tsx +74 -74
- package/dist/assets/components/button.tsx +2 -0
- package/dist/assets/components/calendar.stories.tsx +11 -11
- package/dist/assets/components/calendar.tsx +4 -4
- package/dist/assets/components/card.stories.tsx +22 -22
- package/dist/assets/components/card.tsx +7 -3
- package/dist/assets/components/carousel.stories.tsx +6 -6
- package/dist/assets/components/carousel.tsx +10 -8
- package/dist/assets/components/chart.tsx +5 -5
- package/dist/assets/components/checkbox-group.stories.tsx +6 -6
- package/dist/assets/components/checkbox-group.tsx +3 -3
- package/dist/assets/components/checkbox.stories.tsx +23 -20
- package/dist/assets/components/checkbox.tsx +13 -16
- package/dist/assets/components/code.stories.tsx +24 -24
- package/dist/assets/components/code.tsx +7 -14
- package/dist/assets/components/collapsible.stories.tsx +3 -3
- package/dist/assets/components/command.stories.tsx +14 -14
- package/dist/assets/components/command.tsx +4 -3
- package/dist/assets/components/context-menu.stories.tsx +1 -1
- package/dist/assets/components/context-menu.tsx +3 -7
- package/dist/assets/components/date-input.stories.tsx +9 -9
- package/dist/assets/components/date-input.tsx +2 -2
- package/dist/assets/components/date-picker.stories.tsx +9 -9
- package/dist/assets/components/date-picker.tsx +3 -3
- package/dist/assets/components/date-range-picker.stories.tsx +12 -12
- package/dist/assets/components/date-range-picker.tsx +3 -3
- package/dist/assets/components/dialog.stories.tsx +40 -40
- package/dist/assets/components/dialog.tsx +8 -12
- package/dist/assets/components/divider.stories.tsx +30 -30
- package/dist/assets/components/divider.tsx +4 -8
- package/dist/assets/components/drawer.stories.tsx +32 -31
- package/dist/assets/components/drawer.tsx +7 -6
- package/dist/assets/components/dropdown-menu.tsx +3 -7
- package/dist/assets/components/dropdown.stories.tsx +12 -12
- package/dist/assets/components/dropdown.tsx +5 -5
- package/dist/assets/components/form.stories.tsx +30 -29
- package/dist/assets/components/form.tsx +5 -5
- package/dist/assets/components/hover-card.stories.tsx +12 -10
- package/dist/assets/components/hover-card.tsx +1 -1
- package/dist/assets/components/image.stories.tsx +48 -25
- package/dist/assets/components/image.tsx +8 -5
- package/dist/assets/components/input-otp.stories.tsx +15 -15
- package/dist/assets/components/input-otp.tsx +5 -5
- package/dist/assets/components/input.stories.tsx +30 -25
- package/dist/assets/components/input.tsx +7 -4
- package/dist/assets/components/kbd.stories.tsx +34 -34
- package/dist/assets/components/kbd.tsx +5 -5
- package/dist/assets/components/link.stories.tsx +36 -36
- package/dist/assets/components/link.tsx +4 -0
- package/dist/assets/components/listbox.stories.tsx +5 -5
- package/dist/assets/components/listbox.tsx +4 -4
- package/dist/assets/components/menubar.tsx +3 -7
- package/dist/assets/components/navbar.stories.tsx +24 -24
- package/dist/assets/components/navbar.tsx +8 -14
- package/dist/assets/components/navigation-menu.stories.tsx +11 -9
- package/dist/assets/components/navigation-menu.tsx +1 -1
- package/dist/assets/components/number-input.stories.tsx +11 -11
- package/dist/assets/components/number-input.tsx +3 -3
- package/dist/assets/components/pagination.stories.tsx +13 -13
- package/dist/assets/components/pagination.tsx +6 -6
- package/dist/assets/components/popover.stories.tsx +35 -35
- package/dist/assets/components/popover.tsx +98 -15
- package/dist/assets/components/progress.stories.tsx +5 -5
- package/dist/assets/components/progress.tsx +5 -5
- package/dist/assets/components/radio-group.stories.tsx +7 -7
- package/dist/assets/components/radio-group.tsx +3 -3
- package/dist/assets/components/range-calendar.stories.tsx +18 -18
- package/dist/assets/components/range-calendar.tsx +3 -3
- package/dist/assets/components/resizable.stories.tsx +23 -23
- package/dist/assets/components/resizable.tsx +1 -1
- package/dist/assets/components/scroll-area.stories.tsx +15 -15
- package/dist/assets/components/scroll-area.tsx +1 -1
- package/dist/assets/components/scroll-shadow.stories.tsx +17 -17
- package/dist/assets/components/scroll-shadow.tsx +2 -2
- package/dist/assets/components/select.stories.tsx +20 -19
- package/dist/assets/components/select.tsx +10 -6
- package/dist/assets/components/separator.tsx +1 -1
- package/dist/assets/components/sheet.tsx +3 -7
- package/dist/assets/components/sidebar.stories.tsx +30 -30
- package/dist/assets/components/sidebar.tsx +24 -27
- package/dist/assets/components/skeleton.stories.tsx +3 -3
- package/dist/assets/components/skeleton.tsx +2 -2
- package/dist/assets/components/slider.stories.tsx +6 -6
- package/dist/assets/components/slider.tsx +3 -3
- package/dist/assets/components/spacer.stories.tsx +11 -11
- package/dist/assets/components/spacer.tsx +2 -2
- package/dist/assets/components/spinner.stories.tsx +8 -8
- package/dist/assets/components/spinner.tsx +5 -5
- package/dist/assets/components/switch.stories.tsx +24 -20
- package/dist/assets/components/switch.tsx +14 -6
- package/dist/assets/components/table.stories.tsx +7 -7
- package/dist/assets/components/table.tsx +8 -8
- package/dist/assets/components/tabs.stories.tsx +37 -37
- package/dist/assets/components/tabs.tsx +3 -3
- package/dist/assets/components/textarea.stories.tsx +13 -12
- package/dist/assets/components/textarea.tsx +3 -3
- package/dist/assets/components/theme-toggle.stories.tsx +31 -30
- package/dist/assets/components/theme-toggle.tsx +2 -2
- package/dist/assets/components/time-input.stories.tsx +16 -16
- package/dist/assets/components/time-input.tsx +2 -2
- package/dist/assets/components/toast.stories.tsx +8 -5
- package/dist/assets/components/toast.tsx +6 -6
- package/dist/assets/components/toggle-group.tsx +1 -1
- package/dist/assets/components/toggle.tsx +1 -1
- package/dist/assets/components/tooltip.stories.tsx +49 -27
- package/dist/assets/components/tooltip.tsx +1 -1
- package/dist/assets/components/user.stories.tsx +23 -23
- package/dist/assets/components/user.tsx +7 -4
- package/dist/assets/dev-tools/SonanceDevTools.tsx +4201 -0
- package/dist/assets/dev-tools/index.ts +10 -0
- package/dist/assets/globals.css +9 -0
- package/dist/assets/styles/brand-overrides.css +37 -0
- package/dist/index.js +1776 -7
- package/package.json +1 -1
|
@@ -61,7 +61,7 @@ export const WithIcons: Story = {
|
|
|
61
61
|
|
|
62
62
|
export const CustomSeparator: Story = {
|
|
63
63
|
args: {
|
|
64
|
-
separator: <span className="text-foreground-muted">/</span>,
|
|
64
|
+
separator: <span id="custom-separator-span" className="text-foreground-muted">/</span>,
|
|
65
65
|
items: [
|
|
66
66
|
{ label: 'Home', href: '#' },
|
|
67
67
|
{ label: 'Category', href: '#' },
|
|
@@ -89,7 +89,7 @@ export const AllExamples: Story = {
|
|
|
89
89
|
render: () => (
|
|
90
90
|
<div className="space-y-6">
|
|
91
91
|
<div>
|
|
92
|
-
<p className="text-xs text-foreground-muted mb-2">Simple</p>
|
|
92
|
+
<p id="all-examples-p-simple" className="text-xs text-foreground-muted mb-2">Simple</p>
|
|
93
93
|
<Breadcrumbs
|
|
94
94
|
items={[
|
|
95
95
|
{ label: 'Home', href: '#' },
|
|
@@ -98,7 +98,7 @@ export const AllExamples: Story = {
|
|
|
98
98
|
/>
|
|
99
99
|
</div>
|
|
100
100
|
<div>
|
|
101
|
-
<p className="text-xs text-foreground-muted mb-2">With Home Icon</p>
|
|
101
|
+
<p id="all-examples-p-with-home-icon" className="text-xs text-foreground-muted mb-2">With Home Icon</p>
|
|
102
102
|
<Breadcrumbs
|
|
103
103
|
showHome
|
|
104
104
|
items={[
|
|
@@ -108,7 +108,7 @@ export const AllExamples: Story = {
|
|
|
108
108
|
/>
|
|
109
109
|
</div>
|
|
110
110
|
<div>
|
|
111
|
-
<p className="text-xs text-foreground-muted mb-2">Deep Navigation</p>
|
|
111
|
+
<p id="all-examples-p-deep-navigation" className="text-xs text-foreground-muted mb-2">Deep Navigation</p>
|
|
112
112
|
<Breadcrumbs
|
|
113
113
|
items={[
|
|
114
114
|
{ label: 'Level 1', href: '#' },
|
|
@@ -128,7 +128,7 @@ export const ResponsiveMatrix: Story = {
|
|
|
128
128
|
<div className="space-y-8">
|
|
129
129
|
{/* Mobile */}
|
|
130
130
|
<div>
|
|
131
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Mobile (375px)</h4>
|
|
131
|
+
<h4 id="responsive-matrix-h4-mobile-375px" className="text-xs uppercase text-foreground-muted mb-2">Mobile (375px)</h4>
|
|
132
132
|
<div className="w-[375px] border border-dashed border-border p-4">
|
|
133
133
|
<Breadcrumbs
|
|
134
134
|
items={[
|
|
@@ -140,7 +140,7 @@ export const ResponsiveMatrix: Story = {
|
|
|
140
140
|
</div>
|
|
141
141
|
{/* Tablet */}
|
|
142
142
|
<div>
|
|
143
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Tablet (768px)</h4>
|
|
143
|
+
<h4 id="responsive-matrix-h4-tablet-768px" className="text-xs uppercase text-foreground-muted mb-2">Tablet (768px)</h4>
|
|
144
144
|
<div className="w-[768px] border border-dashed border-border p-4">
|
|
145
145
|
<Breadcrumbs
|
|
146
146
|
showHome
|
|
@@ -155,7 +155,7 @@ export const ResponsiveMatrix: Story = {
|
|
|
155
155
|
</div>
|
|
156
156
|
{/* Desktop */}
|
|
157
157
|
<div>
|
|
158
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Desktop (1280px)</h4>
|
|
158
|
+
<h4 id="responsive-matrix-h4-desktop-1280px" className="text-xs uppercase text-foreground-muted mb-2">Desktop (1280px)</h4>
|
|
159
159
|
<div className="w-[1280px] border border-dashed border-border p-4">
|
|
160
160
|
<Breadcrumbs
|
|
161
161
|
showHome
|
|
@@ -34,20 +34,21 @@ export function Breadcrumbs({
|
|
|
34
34
|
: items;
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<nav aria-label="Breadcrumb" className={cn("flex items-center", className)}>
|
|
37
|
+
<nav data-sonance-name="breadcrumbs" aria-label="Breadcrumb" className={cn("flex items-center", className)}>
|
|
38
38
|
<ol className="flex items-center gap-2">
|
|
39
39
|
{allItems.map((item, index) => {
|
|
40
40
|
const isLast = index === allItems.length - 1;
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
|
-
<li key={index} className="flex items-center gap-2">
|
|
43
|
+
<li data-sonance-name="breadcrumbs" key={index} className="flex items-center gap-2">
|
|
44
44
|
{index > 0 && (
|
|
45
|
-
<span className="text-foreground-muted" aria-hidden="true">
|
|
45
|
+
<span id="nav-span-separatorelement" className="text-foreground-muted" aria-hidden="true">
|
|
46
46
|
{separatorElement}
|
|
47
47
|
</span>
|
|
48
48
|
)}
|
|
49
49
|
{isLast ? (
|
|
50
50
|
<span
|
|
51
|
+
id="breadcrumbs-span-itemicon-itemlabel"
|
|
51
52
|
className="flex items-center gap-1.5 text-sm font-medium text-foreground"
|
|
52
53
|
aria-current="page"
|
|
53
54
|
>
|
|
@@ -56,6 +57,7 @@ export function Breadcrumbs({
|
|
|
56
57
|
</span>
|
|
57
58
|
) : (
|
|
58
59
|
<a
|
|
60
|
+
id="breadcrumbs-a"
|
|
59
61
|
href={item.href}
|
|
60
62
|
className={cn(
|
|
61
63
|
"flex items-center gap-1.5 text-sm text-foreground-muted",
|
|
@@ -81,7 +83,7 @@ export const BreadcrumbList = forwardRef<
|
|
|
81
83
|
>(({ className, ...props }, ref) => (
|
|
82
84
|
<ol
|
|
83
85
|
ref={ref}
|
|
84
|
-
className={cn("flex items-center gap-2 flex-wrap", className)}
|
|
86
|
+
className={cn("flex items-center gap-2 flex-wrap", className)} data-sonance-name="breadcrumbs"
|
|
85
87
|
{...props}
|
|
86
88
|
/>
|
|
87
89
|
));
|
|
@@ -94,7 +96,7 @@ export const BreadcrumbItem = forwardRef<
|
|
|
94
96
|
>(({ className, ...props }, ref) => (
|
|
95
97
|
<li
|
|
96
98
|
ref={ref}
|
|
97
|
-
className={cn("flex items-center gap-2", className)}
|
|
99
|
+
className={cn("flex items-center gap-2", className)} data-sonance-name="breadcrumbs"
|
|
98
100
|
{...props}
|
|
99
101
|
/>
|
|
100
102
|
));
|
|
@@ -106,11 +108,12 @@ export const BreadcrumbLink = forwardRef<
|
|
|
106
108
|
React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
107
109
|
>(({ className, ...props }, ref) => (
|
|
108
110
|
<a
|
|
111
|
+
id="breadcrumb-link-a"
|
|
109
112
|
ref={ref}
|
|
110
113
|
className={cn(
|
|
111
114
|
"text-sm text-foreground-muted hover:text-foreground transition-colors",
|
|
112
115
|
className
|
|
113
|
-
)}
|
|
116
|
+
)} data-sonance-name="breadcrumbs"
|
|
114
117
|
{...props}
|
|
115
118
|
/>
|
|
116
119
|
));
|
|
@@ -122,9 +125,10 @@ export const BreadcrumbPage = forwardRef<
|
|
|
122
125
|
React.HTMLAttributes<HTMLSpanElement>
|
|
123
126
|
>(({ className, ...props }, ref) => (
|
|
124
127
|
<span
|
|
128
|
+
id="breadcrumb-page-span"
|
|
125
129
|
ref={ref}
|
|
126
130
|
aria-current="page"
|
|
127
|
-
className={cn("text-sm font-medium text-foreground", className)}
|
|
131
|
+
className={cn("text-sm font-medium text-foreground", className)} data-sonance-name="breadcrumbs"
|
|
128
132
|
{...props}
|
|
129
133
|
/>
|
|
130
134
|
));
|
|
@@ -136,9 +140,10 @@ export const BreadcrumbSeparator = forwardRef<
|
|
|
136
140
|
React.HTMLAttributes<HTMLSpanElement>
|
|
137
141
|
>(({ className, children, ...props }, ref) => (
|
|
138
142
|
<span
|
|
143
|
+
id="breadcrumb-separator-span"
|
|
139
144
|
ref={ref}
|
|
140
145
|
aria-hidden="true"
|
|
141
|
-
className={cn("text-foreground-muted", className)}
|
|
146
|
+
className={cn("text-foreground-muted", className)} data-sonance-name="breadcrumbs"
|
|
142
147
|
{...props}
|
|
143
148
|
>
|
|
144
149
|
{children || <ChevronRight className="h-4 w-4" />}
|
|
@@ -135,11 +135,11 @@ export const Disabled: Story = {
|
|
|
135
135
|
export const AllVariants: Story = {
|
|
136
136
|
render: () => (
|
|
137
137
|
<div className="flex flex-wrap gap-4">
|
|
138
|
-
<Button variant="primary">Primary</Button>
|
|
139
|
-
<Button variant="secondary">Secondary</Button>
|
|
140
|
-
<Button variant="ghost">Ghost</Button>
|
|
138
|
+
<Button id="all-variants-button-primary" variant="primary">Primary</Button>
|
|
139
|
+
<Button id="all-variants-button-secondary" variant="secondary">Secondary</Button>
|
|
140
|
+
<Button id="all-variants-button-ghost" variant="ghost">Ghost</Button>
|
|
141
141
|
<div className="bg-sonance-charcoal p-2 rounded">
|
|
142
|
-
<Button variant="inverted">Inverted</Button>
|
|
142
|
+
<Button id="all-variants-button-inverted" variant="inverted">Inverted</Button>
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
145
145
|
),
|
|
@@ -149,9 +149,9 @@ export const AllVariants: Story = {
|
|
|
149
149
|
export const AllSizes: Story = {
|
|
150
150
|
render: () => (
|
|
151
151
|
<div className="flex items-center gap-4">
|
|
152
|
-
<Button size="sm">Small</Button>
|
|
153
|
-
<Button size="md">Medium</Button>
|
|
154
|
-
<Button size="lg">Large</Button>
|
|
152
|
+
<Button id="all-sizes-button" size="sm">Small</Button>
|
|
153
|
+
<Button id="all-sizes-button" size="md">Medium</Button>
|
|
154
|
+
<Button id="all-sizes-button" size="lg">Large</Button>
|
|
155
155
|
</div>
|
|
156
156
|
),
|
|
157
157
|
};
|
|
@@ -161,30 +161,30 @@ export const VariantMatrix: Story = {
|
|
|
161
161
|
render: () => (
|
|
162
162
|
<div className="space-y-6">
|
|
163
163
|
<div>
|
|
164
|
-
<h3 className="text-sm font-medium text-foreground-muted mb-3">Primary</h3>
|
|
164
|
+
<h3 id="variant-matrix-h3-primary" className="text-sm font-medium text-foreground-muted mb-3">Primary</h3>
|
|
165
165
|
<div className="flex items-center gap-4">
|
|
166
|
-
<Button variant="primary" size="sm">Small</Button>
|
|
167
|
-
<Button variant="primary" size="md">Medium</Button>
|
|
168
|
-
<Button variant="primary" size="lg">Large</Button>
|
|
169
|
-
<Button variant="primary" size="md" disabled>Disabled</Button>
|
|
166
|
+
<Button id="variant-matrix-button-primary" variant="primary" size="sm">Small</Button>
|
|
167
|
+
<Button id="variant-matrix-button-primary" variant="primary" size="md">Medium</Button>
|
|
168
|
+
<Button id="variant-matrix-button-primary" variant="primary" size="lg">Large</Button>
|
|
169
|
+
<Button id="variant-matrix-button-primary" variant="primary" size="md" disabled>Disabled</Button>
|
|
170
170
|
</div>
|
|
171
171
|
</div>
|
|
172
172
|
<div>
|
|
173
|
-
<h3 className="text-sm font-medium text-foreground-muted mb-3">Secondary</h3>
|
|
173
|
+
<h3 id="variant-matrix-h3-secondary" className="text-sm font-medium text-foreground-muted mb-3">Secondary</h3>
|
|
174
174
|
<div className="flex items-center gap-4">
|
|
175
|
-
<Button variant="secondary" size="sm">Small</Button>
|
|
176
|
-
<Button variant="secondary" size="md">Medium</Button>
|
|
177
|
-
<Button variant="secondary" size="lg">Large</Button>
|
|
178
|
-
<Button variant="secondary" size="md" disabled>Disabled</Button>
|
|
175
|
+
<Button id="variant-matrix-button-secondary" variant="secondary" size="sm">Small</Button>
|
|
176
|
+
<Button id="variant-matrix-button-secondary" variant="secondary" size="md">Medium</Button>
|
|
177
|
+
<Button id="variant-matrix-button-secondary" variant="secondary" size="lg">Large</Button>
|
|
178
|
+
<Button id="variant-matrix-button-secondary" variant="secondary" size="md" disabled>Disabled</Button>
|
|
179
179
|
</div>
|
|
180
180
|
</div>
|
|
181
181
|
<div>
|
|
182
|
-
<h3 className="text-sm font-medium text-foreground-muted mb-3">Ghost</h3>
|
|
182
|
+
<h3 id="variant-matrix-h3-ghost" className="text-sm font-medium text-foreground-muted mb-3">Ghost</h3>
|
|
183
183
|
<div className="flex items-center gap-4">
|
|
184
|
-
<Button variant="ghost" size="sm">Small</Button>
|
|
185
|
-
<Button variant="ghost" size="md">Medium</Button>
|
|
186
|
-
<Button variant="ghost" size="lg">Large</Button>
|
|
187
|
-
<Button variant="ghost" size="md" disabled>Disabled</Button>
|
|
184
|
+
<Button id="variant-matrix-button-ghost" variant="ghost" size="sm">Small</Button>
|
|
185
|
+
<Button id="variant-matrix-button-ghost" variant="ghost" size="md">Medium</Button>
|
|
186
|
+
<Button id="variant-matrix-button-ghost" variant="ghost" size="lg">Large</Button>
|
|
187
|
+
<Button id="variant-matrix-button-ghost" variant="ghost" size="md" disabled>Disabled</Button>
|
|
188
188
|
</div>
|
|
189
189
|
</div>
|
|
190
190
|
</div>
|
|
@@ -195,27 +195,27 @@ export const VariantMatrix: Story = {
|
|
|
195
195
|
export const PrimaryStates: Story = {
|
|
196
196
|
render: () => (
|
|
197
197
|
<div className="space-y-4">
|
|
198
|
-
<h3 className="text-sm font-medium text-foreground-muted">Primary Button States</h3>
|
|
198
|
+
<h3 id="primary-states-h3-primary-button-state" className="text-sm font-medium text-foreground-muted">Primary Button States</h3>
|
|
199
199
|
<div className="flex items-center gap-4">
|
|
200
200
|
<div className="text-center">
|
|
201
|
-
<Button variant="primary" state="default">Default</Button>
|
|
202
|
-
<p className="text-xs text-foreground-muted mt-2">Default</p>
|
|
201
|
+
<Button id="primary-states-button-primary" variant="primary" state="default">Default</Button>
|
|
202
|
+
<p id="primary-states-p-default" className="text-xs text-foreground-muted mt-2">Default</p>
|
|
203
203
|
</div>
|
|
204
204
|
<div className="text-center">
|
|
205
|
-
<Button variant="primary" state="hover">Hover</Button>
|
|
206
|
-
<p className="text-xs text-foreground-muted mt-2">Hover</p>
|
|
205
|
+
<Button id="primary-states-button-primary" variant="primary" state="hover">Hover</Button>
|
|
206
|
+
<p id="primary-states-p-hover" className="text-xs text-foreground-muted mt-2">Hover</p>
|
|
207
207
|
</div>
|
|
208
208
|
<div className="text-center">
|
|
209
|
-
<Button variant="primary" state="active">Active</Button>
|
|
210
|
-
<p className="text-xs text-foreground-muted mt-2">Active</p>
|
|
209
|
+
<Button id="primary-states-button-primary" variant="primary" state="active">Active</Button>
|
|
210
|
+
<p id="primary-states-p-active" className="text-xs text-foreground-muted mt-2">Active</p>
|
|
211
211
|
</div>
|
|
212
212
|
<div className="text-center">
|
|
213
|
-
<Button variant="primary" state="focus">Focus</Button>
|
|
214
|
-
<p className="text-xs text-foreground-muted mt-2">Focus</p>
|
|
213
|
+
<Button id="primary-states-button-primary" variant="primary" state="focus">Focus</Button>
|
|
214
|
+
<p id="primary-states-p-focus" className="text-xs text-foreground-muted mt-2">Focus</p>
|
|
215
215
|
</div>
|
|
216
216
|
<div className="text-center">
|
|
217
|
-
<Button variant="primary" state="disabled">Disabled</Button>
|
|
218
|
-
<p className="text-xs text-foreground-muted mt-2">Disabled</p>
|
|
217
|
+
<Button id="primary-states-button-primary" variant="primary" state="disabled">Disabled</Button>
|
|
218
|
+
<p id="primary-states-p-disabled" className="text-xs text-foreground-muted mt-2">Disabled</p>
|
|
219
219
|
</div>
|
|
220
220
|
</div>
|
|
221
221
|
</div>
|
|
@@ -225,27 +225,27 @@ export const PrimaryStates: Story = {
|
|
|
225
225
|
export const SecondaryStates: Story = {
|
|
226
226
|
render: () => (
|
|
227
227
|
<div className="space-y-4">
|
|
228
|
-
<h3 className="text-sm font-medium text-foreground-muted">Secondary Button States</h3>
|
|
228
|
+
<h3 id="secondary-states-h3-secondary-button-sta" className="text-sm font-medium text-foreground-muted">Secondary Button States</h3>
|
|
229
229
|
<div className="flex items-center gap-4">
|
|
230
230
|
<div className="text-center">
|
|
231
|
-
<Button variant="secondary" state="default">Default</Button>
|
|
232
|
-
<p className="text-xs text-foreground-muted mt-2">Default</p>
|
|
231
|
+
<Button id="secondary-states-button-secondary" variant="secondary" state="default">Default</Button>
|
|
232
|
+
<p id="secondary-states-p-default" className="text-xs text-foreground-muted mt-2">Default</p>
|
|
233
233
|
</div>
|
|
234
234
|
<div className="text-center">
|
|
235
|
-
<Button variant="secondary" state="hover">Hover</Button>
|
|
236
|
-
<p className="text-xs text-foreground-muted mt-2">Hover</p>
|
|
235
|
+
<Button id="secondary-states-button-secondary" variant="secondary" state="hover">Hover</Button>
|
|
236
|
+
<p id="secondary-states-p-hover" className="text-xs text-foreground-muted mt-2">Hover</p>
|
|
237
237
|
</div>
|
|
238
238
|
<div className="text-center">
|
|
239
|
-
<Button variant="secondary" state="active">Active</Button>
|
|
240
|
-
<p className="text-xs text-foreground-muted mt-2">Active</p>
|
|
239
|
+
<Button id="secondary-states-button-secondary" variant="secondary" state="active">Active</Button>
|
|
240
|
+
<p id="secondary-states-p-active" className="text-xs text-foreground-muted mt-2">Active</p>
|
|
241
241
|
</div>
|
|
242
242
|
<div className="text-center">
|
|
243
|
-
<Button variant="secondary" state="focus">Focus</Button>
|
|
244
|
-
<p className="text-xs text-foreground-muted mt-2">Focus</p>
|
|
243
|
+
<Button id="secondary-states-button-secondary" variant="secondary" state="focus">Focus</Button>
|
|
244
|
+
<p id="secondary-states-p-focus" className="text-xs text-foreground-muted mt-2">Focus</p>
|
|
245
245
|
</div>
|
|
246
246
|
<div className="text-center">
|
|
247
|
-
<Button variant="secondary" state="disabled">Disabled</Button>
|
|
248
|
-
<p className="text-xs text-foreground-muted mt-2">Disabled</p>
|
|
247
|
+
<Button id="secondary-states-button-secondary" variant="secondary" state="disabled">Disabled</Button>
|
|
248
|
+
<p id="secondary-states-p-disabled" className="text-xs text-foreground-muted mt-2">Disabled</p>
|
|
249
249
|
</div>
|
|
250
250
|
</div>
|
|
251
251
|
</div>
|
|
@@ -255,27 +255,27 @@ export const SecondaryStates: Story = {
|
|
|
255
255
|
export const GhostStates: Story = {
|
|
256
256
|
render: () => (
|
|
257
257
|
<div className="space-y-4">
|
|
258
|
-
<h3 className="text-sm font-medium text-foreground-muted">Ghost Button States</h3>
|
|
258
|
+
<h3 id="ghost-states-h3-ghost-button-states" className="text-sm font-medium text-foreground-muted">Ghost Button States</h3>
|
|
259
259
|
<div className="flex items-center gap-4">
|
|
260
260
|
<div className="text-center">
|
|
261
|
-
<Button variant="ghost" state="default">Default</Button>
|
|
262
|
-
<p className="text-xs text-foreground-muted mt-2">Default</p>
|
|
261
|
+
<Button id="ghost-states-button-ghost" variant="ghost" state="default">Default</Button>
|
|
262
|
+
<p id="ghost-states-p-default" className="text-xs text-foreground-muted mt-2">Default</p>
|
|
263
263
|
</div>
|
|
264
264
|
<div className="text-center">
|
|
265
|
-
<Button variant="ghost" state="hover">Hover</Button>
|
|
266
|
-
<p className="text-xs text-foreground-muted mt-2">Hover</p>
|
|
265
|
+
<Button id="ghost-states-button-ghost" variant="ghost" state="hover">Hover</Button>
|
|
266
|
+
<p id="ghost-states-p-hover" className="text-xs text-foreground-muted mt-2">Hover</p>
|
|
267
267
|
</div>
|
|
268
268
|
<div className="text-center">
|
|
269
|
-
<Button variant="ghost" state="active">Active</Button>
|
|
270
|
-
<p className="text-xs text-foreground-muted mt-2">Active</p>
|
|
269
|
+
<Button id="ghost-states-button-ghost" variant="ghost" state="active">Active</Button>
|
|
270
|
+
<p id="ghost-states-p-active" className="text-xs text-foreground-muted mt-2">Active</p>
|
|
271
271
|
</div>
|
|
272
272
|
<div className="text-center">
|
|
273
|
-
<Button variant="ghost" state="focus">Focus</Button>
|
|
274
|
-
<p className="text-xs text-foreground-muted mt-2">Focus</p>
|
|
273
|
+
<Button id="ghost-states-button-ghost" variant="ghost" state="focus">Focus</Button>
|
|
274
|
+
<p id="ghost-states-p-focus" className="text-xs text-foreground-muted mt-2">Focus</p>
|
|
275
275
|
</div>
|
|
276
276
|
<div className="text-center">
|
|
277
|
-
<Button variant="ghost" state="disabled">Disabled</Button>
|
|
278
|
-
<p className="text-xs text-foreground-muted mt-2">Disabled</p>
|
|
277
|
+
<Button id="ghost-states-button-ghost" variant="ghost" state="disabled">Disabled</Button>
|
|
278
|
+
<p id="ghost-states-p-disabled" className="text-xs text-foreground-muted mt-2">Disabled</p>
|
|
279
279
|
</div>
|
|
280
280
|
</div>
|
|
281
281
|
</div>
|
|
@@ -289,7 +289,7 @@ export const StateMatrix: Story = {
|
|
|
289
289
|
const states: ButtonState[] = ['default', 'hover', 'active', 'focus', 'disabled'];
|
|
290
290
|
|
|
291
291
|
return (
|
|
292
|
-
<div className="space-y-8">
|
|
292
|
+
<div data-sonance-name="button.stories" className="space-y-8">
|
|
293
293
|
<div className="grid grid-cols-6 gap-4 text-center">
|
|
294
294
|
<div></div>
|
|
295
295
|
{states.map((state) => (
|
|
@@ -302,7 +302,7 @@ export const StateMatrix: Story = {
|
|
|
302
302
|
<div key={variant} className="grid grid-cols-6 gap-4 items-center">
|
|
303
303
|
<div className="text-xs font-medium text-foreground-muted uppercase">{variant}</div>
|
|
304
304
|
{states.map((state) => (
|
|
305
|
-
<Button key={`${variant}-${state}`} variant={variant} state={state}>
|
|
305
|
+
<Button id="state-matrix-button" key={`${variant}-${state}`} variant={variant} state={state}>
|
|
306
306
|
Button
|
|
307
307
|
</Button>
|
|
308
308
|
))}
|
|
@@ -319,41 +319,41 @@ export const ResponsiveMatrix: Story = {
|
|
|
319
319
|
<div className="space-y-8">
|
|
320
320
|
{/* Mobile */}
|
|
321
321
|
<div>
|
|
322
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Mobile (375px)</h4>
|
|
322
|
+
<h4 id="responsive-matrix-h4-mobile-375px" className="text-xs uppercase text-foreground-muted mb-2">Mobile (375px)</h4>
|
|
323
323
|
<div className="w-[375px] border border-dashed border-border p-4">
|
|
324
324
|
<div className="flex flex-col gap-2">
|
|
325
|
-
<Button variant="primary" className="w-full">Primary Button</Button>
|
|
326
|
-
<Button variant="secondary" className="w-full">Secondary Button</Button>
|
|
325
|
+
<Button id="responsive-matrix-button-primary" variant="primary" className="w-full">Primary Button</Button>
|
|
326
|
+
<Button id="responsive-matrix-button-secondary" variant="secondary" className="w-full">Secondary Button</Button>
|
|
327
327
|
<div className="flex gap-2">
|
|
328
|
-
<Button variant="primary" size="sm">Small</Button>
|
|
329
|
-
<Button variant="secondary" size="sm">Small</Button>
|
|
328
|
+
<Button id="responsive-matrix-button-primary" variant="primary" size="sm">Small</Button>
|
|
329
|
+
<Button id="responsive-matrix-button-secondary" variant="secondary" size="sm">Small</Button>
|
|
330
330
|
</div>
|
|
331
331
|
</div>
|
|
332
332
|
</div>
|
|
333
333
|
</div>
|
|
334
334
|
{/* Tablet */}
|
|
335
335
|
<div>
|
|
336
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Tablet (768px)</h4>
|
|
336
|
+
<h4 id="responsive-matrix-h4-tablet-768px" className="text-xs uppercase text-foreground-muted mb-2">Tablet (768px)</h4>
|
|
337
337
|
<div className="w-[768px] border border-dashed border-border p-4">
|
|
338
338
|
<div className="flex gap-4">
|
|
339
|
-
<Button variant="primary">Primary Button</Button>
|
|
340
|
-
<Button variant="secondary">Secondary Button</Button>
|
|
341
|
-
<Button variant="ghost">Ghost Button</Button>
|
|
339
|
+
<Button id="responsive-matrix-button-primary" variant="primary">Primary Button</Button>
|
|
340
|
+
<Button id="responsive-matrix-button-secondary" variant="secondary">Secondary Button</Button>
|
|
341
|
+
<Button id="responsive-matrix-button-ghost" variant="ghost">Ghost Button</Button>
|
|
342
342
|
</div>
|
|
343
343
|
</div>
|
|
344
344
|
</div>
|
|
345
345
|
{/* Desktop */}
|
|
346
346
|
<div>
|
|
347
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Desktop (1280px)</h4>
|
|
347
|
+
<h4 id="responsive-matrix-h4-desktop-1280px" className="text-xs uppercase text-foreground-muted mb-2">Desktop (1280px)</h4>
|
|
348
348
|
<div className="w-[1280px] border border-dashed border-border p-4">
|
|
349
349
|
<div className="flex gap-4 items-center">
|
|
350
|
-
<Button variant="primary" size="lg">Large Primary</Button>
|
|
351
|
-
<Button variant="secondary" size="lg">Large Secondary</Button>
|
|
352
|
-
<Button variant="ghost" size="lg">Large Ghost</Button>
|
|
353
|
-
<Button variant="primary" size="md">Medium</Button>
|
|
354
|
-
<Button variant="secondary" size="md">Medium</Button>
|
|
355
|
-
<Button variant="primary" size="sm">Small</Button>
|
|
356
|
-
<Button variant="secondary" size="sm">Small</Button>
|
|
350
|
+
<Button id="responsive-matrix-button-primary" variant="primary" size="lg">Large Primary</Button>
|
|
351
|
+
<Button id="responsive-matrix-button-secondary" variant="secondary" size="lg">Large Secondary</Button>
|
|
352
|
+
<Button id="responsive-matrix-button-ghost" variant="ghost" size="lg">Large Ghost</Button>
|
|
353
|
+
<Button id="responsive-matrix-button-primary" variant="primary" size="md">Medium</Button>
|
|
354
|
+
<Button id="responsive-matrix-button-secondary" variant="secondary" size="md">Medium</Button>
|
|
355
|
+
<Button id="responsive-matrix-button-primary" variant="primary" size="sm">Small</Button>
|
|
356
|
+
<Button id="responsive-matrix-button-secondary" variant="secondary" size="sm">Small</Button>
|
|
357
357
|
</div>
|
|
358
358
|
</div>
|
|
359
359
|
</div>
|
|
@@ -21,6 +21,7 @@ const buttonVariants = cva(
|
|
|
21
21
|
sm: "h-9 px-4 text-xs",
|
|
22
22
|
md: "h-11 px-6 text-sm",
|
|
23
23
|
lg: "h-14 px-8 text-sm",
|
|
24
|
+
icon: "h-10 w-10",
|
|
24
25
|
},
|
|
25
26
|
},
|
|
26
27
|
defaultVariants: {
|
|
@@ -77,6 +78,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
77
78
|
|
|
78
79
|
return (
|
|
79
80
|
<button
|
|
81
|
+
data-sonance-name="button"
|
|
80
82
|
className={cn(
|
|
81
83
|
buttonVariants({ variant, size, className }),
|
|
82
84
|
getStateStyles(variant, state)
|
|
@@ -38,7 +38,7 @@ export const Default: Story = {
|
|
|
38
38
|
render: () => {
|
|
39
39
|
const [selected, setSelected] = useState<Date | undefined>(undefined);
|
|
40
40
|
return (
|
|
41
|
-
<Calendar
|
|
41
|
+
<Calendar data-sonance-name="calendar.stories"
|
|
42
42
|
selected={selected}
|
|
43
43
|
onSelect={setSelected}
|
|
44
44
|
className="w-fit"
|
|
@@ -68,7 +68,7 @@ export const WithMinMaxDates: Story = {
|
|
|
68
68
|
const today = new Date();
|
|
69
69
|
return (
|
|
70
70
|
<div className="space-y-4">
|
|
71
|
-
<p className="text-sm text-foreground-muted">
|
|
71
|
+
<p id="with-min-max-dates-p-only-dates-within-th" className="text-sm text-foreground-muted">
|
|
72
72
|
Only dates within the next 30 days are selectable
|
|
73
73
|
</p>
|
|
74
74
|
<Calendar
|
|
@@ -93,7 +93,7 @@ export const DisabledWeekends: Story = {
|
|
|
93
93
|
};
|
|
94
94
|
return (
|
|
95
95
|
<div className="space-y-4">
|
|
96
|
-
<p className="text-sm text-foreground-muted">
|
|
96
|
+
<p id="disabled-weekends-p-weekends-are-disable" className="text-sm text-foreground-muted">
|
|
97
97
|
Weekends are disabled
|
|
98
98
|
</p>
|
|
99
99
|
<Calendar
|
|
@@ -114,7 +114,7 @@ export const PastDatesOnly: Story = {
|
|
|
114
114
|
const today = new Date();
|
|
115
115
|
return (
|
|
116
116
|
<div className="space-y-4">
|
|
117
|
-
<p className="text-sm text-foreground-muted">
|
|
117
|
+
<p id="past-dates-only-p-only-past-dates-are-" className="text-sm text-foreground-muted">
|
|
118
118
|
Only past dates are selectable (useful for birthdays)
|
|
119
119
|
</p>
|
|
120
120
|
<Calendar
|
|
@@ -134,7 +134,7 @@ export const Mini: Story = {
|
|
|
134
134
|
const [selected, setSelected] = useState<Date | undefined>(new Date());
|
|
135
135
|
return (
|
|
136
136
|
<div className="space-y-4">
|
|
137
|
-
<p className="text-sm text-foreground-muted">
|
|
137
|
+
<p id="mini-p-compact-calendar-for" className="text-sm text-foreground-muted">
|
|
138
138
|
Compact calendar for smaller spaces
|
|
139
139
|
</p>
|
|
140
140
|
<MiniCalendar
|
|
@@ -173,7 +173,7 @@ export const BookingExample: Story = {
|
|
|
173
173
|
|
|
174
174
|
return (
|
|
175
175
|
<div className="space-y-4">
|
|
176
|
-
<p className="text-sm text-foreground-muted">
|
|
176
|
+
<p id="booking-example-p-select-an-available-" className="text-sm text-foreground-muted">
|
|
177
177
|
Select an available appointment date
|
|
178
178
|
</p>
|
|
179
179
|
<Calendar
|
|
@@ -185,7 +185,7 @@ export const BookingExample: Story = {
|
|
|
185
185
|
className="w-fit"
|
|
186
186
|
/>
|
|
187
187
|
{selected && (
|
|
188
|
-
<p className="text-sm text-foreground">
|
|
188
|
+
<p id="booking-example-p-selected-selectedtol" className="text-sm text-foreground">
|
|
189
189
|
Selected: {selected.toLocaleDateString()}
|
|
190
190
|
</p>
|
|
191
191
|
)}
|
|
@@ -205,7 +205,7 @@ export const ResponsiveMatrix: Story = {
|
|
|
205
205
|
<div className="space-y-8">
|
|
206
206
|
{/* Mobile */}
|
|
207
207
|
<div>
|
|
208
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Mobile (375px)</h4>
|
|
208
|
+
<h4 id="responsive-matrix-h4-mobile-375px" className="text-xs uppercase text-foreground-muted mb-2">Mobile (375px)</h4>
|
|
209
209
|
<div className="w-[375px] border border-dashed border-border p-4">
|
|
210
210
|
<MiniCalendar
|
|
211
211
|
selected={mobile}
|
|
@@ -216,7 +216,7 @@ export const ResponsiveMatrix: Story = {
|
|
|
216
216
|
</div>
|
|
217
217
|
{/* Tablet */}
|
|
218
218
|
<div>
|
|
219
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Tablet (768px)</h4>
|
|
219
|
+
<h4 id="responsive-matrix-h4-tablet-768px" className="text-xs uppercase text-foreground-muted mb-2">Tablet (768px)</h4>
|
|
220
220
|
<div className="w-[768px] border border-dashed border-border p-4">
|
|
221
221
|
<Calendar
|
|
222
222
|
selected={tablet}
|
|
@@ -227,7 +227,7 @@ export const ResponsiveMatrix: Story = {
|
|
|
227
227
|
</div>
|
|
228
228
|
{/* Desktop */}
|
|
229
229
|
<div>
|
|
230
|
-
<h4 className="text-xs uppercase text-foreground-muted mb-2">Desktop (1280px)</h4>
|
|
230
|
+
<h4 id="responsive-matrix-h4-desktop-1280px" className="text-xs uppercase text-foreground-muted mb-2">Desktop (1280px)</h4>
|
|
231
231
|
<div className="w-[1280px] border border-dashed border-border p-4">
|
|
232
232
|
<div className="flex gap-8">
|
|
233
233
|
<Calendar
|
|
@@ -236,7 +236,7 @@ export const ResponsiveMatrix: Story = {
|
|
|
236
236
|
className="w-fit"
|
|
237
237
|
/>
|
|
238
238
|
<div className="text-sm text-foreground-muted">
|
|
239
|
-
{desktop && <p>Selected: {desktop.toLocaleDateString()}</p>}
|
|
239
|
+
{desktop && <p id="responsive-matrix-p-selected-desktoptolo">Selected: {desktop.toLocaleDateString()}</p>}
|
|
240
240
|
</div>
|
|
241
241
|
</div>
|
|
242
242
|
</div>
|
|
@@ -62,7 +62,7 @@ export function Calendar({
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
return (
|
|
65
|
-
<div className={cn("p-4 bg-card border border-border rounded-sm", className)}>
|
|
65
|
+
<div data-sonance-name="calendar" className={cn("p-4 bg-card border border-border rounded-sm", className)}>
|
|
66
66
|
{/* Header */}
|
|
67
67
|
<div className="flex items-center justify-between mb-4">
|
|
68
68
|
<button
|
|
@@ -73,7 +73,7 @@ export function Calendar({
|
|
|
73
73
|
>
|
|
74
74
|
<ChevronLeft className="h-4 w-4 text-foreground" />
|
|
75
75
|
</button>
|
|
76
|
-
<h2 className="text-sm font-medium text-foreground">
|
|
76
|
+
<h2 id="calendar-h2-formatcurrentmonth-m" className="text-sm font-medium text-foreground">
|
|
77
77
|
{format(currentMonth, "MMMM yyyy")}
|
|
78
78
|
</h2>
|
|
79
79
|
<button
|
|
@@ -107,7 +107,7 @@ export function Calendar({
|
|
|
107
107
|
const isDisabled = isDateDisabled(day);
|
|
108
108
|
|
|
109
109
|
return (
|
|
110
|
-
<button
|
|
110
|
+
<button data-sonance-name="calendar"
|
|
111
111
|
key={day.toISOString()}
|
|
112
112
|
type="button"
|
|
113
113
|
onClick={() => handleSelectDate(day)}
|
|
@@ -140,6 +140,6 @@ interface MiniCalendarProps extends CalendarProps {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
export function MiniCalendar({ className, ...props }: MiniCalendarProps) {
|
|
143
|
-
return <Calendar {...props} className={cn("p-3", className)} />;
|
|
143
|
+
return <Calendar data-sonance-name="calendar" {...props} className={cn("p-3", className)} />;
|
|
144
144
|
}
|
|
145
145
|
|