sheerly 0.0.1

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.
Files changed (140) hide show
  1. package/README.md +3 -0
  2. package/lib/accordion.css +1 -0
  3. package/lib/accordion.d.ts +6 -0
  4. package/lib/alert.css +1 -0
  5. package/lib/alert.d.ts +8 -0
  6. package/lib/avatar.css +1 -0
  7. package/lib/avatar.d.ts +13 -0
  8. package/lib/badge.css +1 -0
  9. package/lib/badge.d.ts +5 -0
  10. package/lib/breadcrumb.css +1 -0
  11. package/lib/breadcrumb.d.ts +8 -0
  12. package/lib/button.css +1 -0
  13. package/lib/button.d.ts +7 -0
  14. package/lib/card.css +1 -0
  15. package/lib/card.d.ts +14 -0
  16. package/lib/carousel.css +1 -0
  17. package/lib/carousel.d.ts +21 -0
  18. package/lib/checkbox.css +1 -0
  19. package/lib/checkbox.d.ts +3 -0
  20. package/lib/cn.d.ts +5 -0
  21. package/lib/dialog.css +1 -0
  22. package/lib/dialog.d.ts +15 -0
  23. package/lib/dropdown-menu.css +1 -0
  24. package/lib/dropdown-menu.d.ts +49 -0
  25. package/lib/hover-card.css +1 -0
  26. package/lib/hover-card.d.ts +7 -0
  27. package/lib/index.css +1 -0
  28. package/lib/index.d.ts +33 -0
  29. package/lib/index.js +652 -0
  30. package/lib/input.css +1 -0
  31. package/lib/input.d.ts +5 -0
  32. package/lib/kbd.css +1 -0
  33. package/lib/kbd.d.ts +5 -0
  34. package/lib/label.css +1 -0
  35. package/lib/label.d.ts +5 -0
  36. package/lib/pagination.css +1 -0
  37. package/lib/pagination.d.ts +17 -0
  38. package/lib/popover.css +1 -0
  39. package/lib/popover.d.ts +7 -0
  40. package/lib/progress.css +1 -0
  41. package/lib/progress.d.ts +6 -0
  42. package/lib/radio.css +1 -0
  43. package/lib/radio.d.ts +5 -0
  44. package/lib/root.css +1 -0
  45. package/lib/select.css +1 -0
  46. package/lib/select.d.ts +10 -0
  47. package/lib/separator.css +1 -0
  48. package/lib/separator.d.ts +5 -0
  49. package/lib/sheet.css +1 -0
  50. package/lib/sheet.d.ts +16 -0
  51. package/lib/skeleton.css +1 -0
  52. package/lib/skeleton.d.ts +3 -0
  53. package/lib/slider.css +1 -0
  54. package/lib/slider.d.ts +3 -0
  55. package/lib/spinner.css +1 -0
  56. package/lib/spinner.d.ts +10 -0
  57. package/lib/switch.css +1 -0
  58. package/lib/switch.d.ts +5 -0
  59. package/lib/table.css +1 -0
  60. package/lib/table.d.ts +5 -0
  61. package/lib/tabs.css +1 -0
  62. package/lib/tabs.d.ts +13 -0
  63. package/lib/textarea.css +1 -0
  64. package/lib/textarea.d.ts +3 -0
  65. package/lib/toggle.css +1 -0
  66. package/lib/toggle.d.ts +16 -0
  67. package/lib/tooltip.css +1 -0
  68. package/lib/tooltip.d.ts +7 -0
  69. package/lib/typography.css +1 -0
  70. package/lib/typography.d.ts +9 -0
  71. package/package.json +33 -0
  72. package/src/accordion.css +108 -0
  73. package/src/accordion.tsx +15 -0
  74. package/src/alert.css +126 -0
  75. package/src/alert.tsx +25 -0
  76. package/src/avatar.css +75 -0
  77. package/src/avatar.tsx +30 -0
  78. package/src/badge.css +71 -0
  79. package/src/badge.tsx +19 -0
  80. package/src/breadcrumb.css +166 -0
  81. package/src/breadcrumb.tsx +71 -0
  82. package/src/button.css +214 -0
  83. package/src/button.tsx +30 -0
  84. package/src/card.css +99 -0
  85. package/src/card.tsx +41 -0
  86. package/src/carousel.css +183 -0
  87. package/src/carousel.tsx +30 -0
  88. package/src/checkbox.css +56 -0
  89. package/src/checkbox.tsx +10 -0
  90. package/src/cn.ts +7 -0
  91. package/src/dialog.css +175 -0
  92. package/src/dialog.tsx +47 -0
  93. package/src/dropdown-menu.css +257 -0
  94. package/src/dropdown-menu.tsx +88 -0
  95. package/src/hover-card.css +75 -0
  96. package/src/hover-card.tsx +16 -0
  97. package/src/index.css +33 -0
  98. package/src/index.ts +37 -0
  99. package/src/input.css +62 -0
  100. package/src/input.tsx +10 -0
  101. package/src/kbd.css +32 -0
  102. package/src/kbd.tsx +14 -0
  103. package/src/label.css +17 -0
  104. package/src/label.tsx +10 -0
  105. package/src/pagination.css +150 -0
  106. package/src/pagination.tsx +95 -0
  107. package/src/popover.css +65 -0
  108. package/src/popover.tsx +16 -0
  109. package/src/progress.css +79 -0
  110. package/src/progress.tsx +19 -0
  111. package/src/radio.css +61 -0
  112. package/src/radio.tsx +14 -0
  113. package/src/root.css +78 -0
  114. package/src/select.css +164 -0
  115. package/src/select.tsx +22 -0
  116. package/src/separator.css +14 -0
  117. package/src/separator.tsx +10 -0
  118. package/src/sheet.css +225 -0
  119. package/src/sheet.tsx +48 -0
  120. package/src/skeleton.css +15 -0
  121. package/src/skeleton.tsx +8 -0
  122. package/src/slider.css +68 -0
  123. package/src/slider.tsx +8 -0
  124. package/src/spinner.css +43 -0
  125. package/src/spinner.tsx +24 -0
  126. package/src/switch.css +79 -0
  127. package/src/switch.tsx +18 -0
  128. package/src/table.css +77 -0
  129. package/src/table.tsx +14 -0
  130. package/src/tabs.css +110 -0
  131. package/src/tabs.tsx +38 -0
  132. package/src/textarea.css +38 -0
  133. package/src/textarea.tsx +8 -0
  134. package/src/toggle.css +148 -0
  135. package/src/toggle.tsx +47 -0
  136. package/src/tooltip.css +60 -0
  137. package/src/tooltip.tsx +16 -0
  138. package/src/types.d.ts +42 -0
  139. package/src/typography.css +176 -0
  140. package/src/typography.tsx +13 -0
package/src/avatar.css ADDED
@@ -0,0 +1,75 @@
1
+ /* Avatar — circular image with initials fallback */
2
+ .sheerly-avatar {
3
+ position: relative;
4
+ display: flex;
5
+ flex-shrink: 0;
6
+ overflow: hidden;
7
+ border-radius: var(--sheerly-radius-full);
8
+ user-select: none;
9
+
10
+ /* Default size (32px) */
11
+ width: 32px;
12
+ height: 32px;
13
+
14
+ &[data-size="sm"] {
15
+ width: 24px;
16
+ height: 24px;
17
+ }
18
+
19
+ &[data-size="lg"] {
20
+ width: 40px;
21
+ height: 40px;
22
+ }
23
+
24
+ &[data-size="xl"] {
25
+ width: 56px;
26
+ height: 56px;
27
+ }
28
+ }
29
+
30
+ .sheerly-avatar img {
31
+ aspect-ratio: 1;
32
+ width: 100%;
33
+ height: 100%;
34
+ object-fit: cover;
35
+ }
36
+
37
+ /* Shown when there's no image; typically holds initials */
38
+ .sheerly-avatar-fallback {
39
+ display: flex;
40
+ width: 100%;
41
+ height: 100%;
42
+ align-items: center;
43
+ justify-content: center;
44
+ border-radius: var(--sheerly-radius-full);
45
+ background-color: var(--sheerly-muted);
46
+ font-family: "Geist Sans", system-ui, -apple-system, sans-serif;
47
+ font-size: 14px;
48
+ font-weight: 500;
49
+ color: var(--sheerly-muted-foreground);
50
+ }
51
+
52
+ .sheerly-avatar[data-size="sm"] .sheerly-avatar-fallback {
53
+ font-size: 11px;
54
+ }
55
+
56
+ .sheerly-avatar[data-size="lg"] .sheerly-avatar-fallback {
57
+ font-size: 16px;
58
+ }
59
+
60
+ .sheerly-avatar[data-size="xl"] .sheerly-avatar-fallback {
61
+ font-size: 20px;
62
+ }
63
+
64
+ /* Overlapping stack of avatars */
65
+ .sheerly-avatar-group {
66
+ display: flex;
67
+
68
+ & .sheerly-avatar {
69
+ box-shadow: 0 0 0 2px var(--sheerly-background);
70
+ }
71
+
72
+ & .sheerly-avatar + .sheerly-avatar {
73
+ margin-left: -8px;
74
+ }
75
+ }
package/src/avatar.tsx ADDED
@@ -0,0 +1,30 @@
1
+ import type { HTMLAttributes, ImgHTMLAttributes } from 'react'
2
+ import { cn } from './cn'
3
+
4
+ export interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
5
+ 'data-size'?: 'sm' | 'default' | 'lg' | 'xl'
6
+ }
7
+
8
+ export function Avatar({ className, ...props }: AvatarProps) {
9
+ return <div className={cn('sheerly-avatar', className)} {...props} />
10
+ }
11
+
12
+ export interface AvatarImageProps extends ImgHTMLAttributes<HTMLImageElement> {
13
+ alt: string
14
+ }
15
+
16
+ export function AvatarImage(props: AvatarImageProps) {
17
+ return <img {...props} />
18
+ }
19
+
20
+ export type AvatarFallbackProps = HTMLAttributes<HTMLSpanElement>
21
+
22
+ export function AvatarFallback({ className, ...props }: AvatarFallbackProps) {
23
+ return <span className={cn('sheerly-avatar-fallback', className)} {...props} />
24
+ }
25
+
26
+ export type AvatarGroupProps = HTMLAttributes<HTMLDivElement>
27
+
28
+ export function AvatarGroup({ className, ...props }: AvatarGroupProps) {
29
+ return <div className={cn('sheerly-avatar-group', className)} {...props} />
30
+ }
package/src/badge.css ADDED
@@ -0,0 +1,71 @@
1
+ /* Badge — pill-shaped <span> label */
2
+ .sheerly-badge {
3
+ display: inline-flex;
4
+ width: fit-content;
5
+ flex-shrink: 0;
6
+ align-items: center;
7
+ justify-content: center;
8
+ gap: 4px;
9
+ overflow: hidden;
10
+ border-radius: var(--sheerly-radius-full);
11
+ border: 1px solid transparent;
12
+ padding: 2px 8px;
13
+ font-family: "Geist Sans", system-ui, -apple-system, sans-serif;
14
+ font-size: 12px;
15
+ font-weight: 500;
16
+ line-height: 16px;
17
+ white-space: nowrap;
18
+ transition: background-color 0.15s ease, color 0.15s ease;
19
+
20
+ /* Default variant */
21
+ background-color: var(--sheerly-foreground);
22
+ color: var(--sheerly-background);
23
+
24
+ & svg {
25
+ pointer-events: none;
26
+ flex-shrink: 0;
27
+ width: 12px;
28
+ height: 12px;
29
+ }
30
+
31
+ &[data-variant="secondary"] {
32
+ background-color: var(--sheerly-muted);
33
+ color: var(--sheerly-muted-foreground);
34
+ }
35
+
36
+ &[data-variant="destructive"] {
37
+ background-color: var(--sheerly-destructive);
38
+ color: #ffffff;
39
+ }
40
+
41
+ &[data-variant="outline"] {
42
+ border-color: var(--sheerly-border);
43
+ background-color: transparent;
44
+ color: var(--sheerly-foreground);
45
+ }
46
+
47
+ &[data-variant="ghost"] {
48
+ background-color: transparent;
49
+ color: var(--sheerly-foreground);
50
+ }
51
+
52
+ &[data-variant="success"] {
53
+ background-color: oklch(0.962 0.044 156.64);
54
+ color: oklch(0.393 0.095 152.53);
55
+ }
56
+
57
+ &[data-variant="warning"] {
58
+ background-color: oklch(0.962 0.059 95.27);
59
+ color: oklch(0.553 0.135 66.44);
60
+ }
61
+
62
+ &[data-variant="error"] {
63
+ background-color: oklch(0.936 0.032 17.72);
64
+ color: oklch(0.444 0.177 26.9);
65
+ }
66
+
67
+ &[data-variant="blue"] {
68
+ background-color: oklch(0.932 0.032 255.59);
69
+ color: oklch(0.488 0.243 264.38);
70
+ }
71
+ }
package/src/badge.tsx ADDED
@@ -0,0 +1,19 @@
1
+ import type { HTMLAttributes } from 'react'
2
+ import { cn } from './cn'
3
+
4
+ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
5
+ 'data-variant'?:
6
+ | 'default'
7
+ | 'secondary'
8
+ | 'destructive'
9
+ | 'outline'
10
+ | 'ghost'
11
+ | 'success'
12
+ | 'warning'
13
+ | 'error'
14
+ | 'blue'
15
+ }
16
+
17
+ export function Badge({ className, ...props }: BadgeProps) {
18
+ return <span className={cn('sheerly-badge', className)} {...props} />
19
+ }
@@ -0,0 +1,166 @@
1
+ /*
2
+ * Breadcrumb — the path to the current resource as a hierarchy of links. <nav>
3
+ *
4
+ * Structure:
5
+ * <nav class="sheerly-breadcrumb" aria-label="breadcrumb">
6
+ * <ol class="sheerly-breadcrumb-list">
7
+ * <li class="sheerly-breadcrumb-item">
8
+ * <a class="sheerly-breadcrumb-link" href="#">Home</a>
9
+ * </li>
10
+ * <li class="sheerly-breadcrumb-separator" role="presentation" aria-hidden="true"></li>
11
+ * <li class="sheerly-breadcrumb-item">
12
+ * <a class="sheerly-breadcrumb-link" href="#">Components</a>
13
+ * </li>
14
+ * <li class="sheerly-breadcrumb-separator" role="presentation" aria-hidden="true"></li>
15
+ * <li class="sheerly-breadcrumb-item">
16
+ * <span class="sheerly-breadcrumb-page" role="link" aria-disabled="true" aria-current="page">Breadcrumb</span>
17
+ * </li>
18
+ * </ol>
19
+ * </nav>
20
+ *
21
+ * The separator chevron is embedded in CSS (masked ::after) when the element is
22
+ * :empty — pass custom children (e.g. a dot) to override it. The ellipsis glyph
23
+ * is likewise embedded (masked ::before) when :empty — no <svg> child needed.
24
+ */
25
+ .sheerly-breadcrumb {
26
+ font-family: "Geist Sans", system-ui, -apple-system, sans-serif;
27
+ }
28
+
29
+ .sheerly-breadcrumb-list {
30
+ display: flex;
31
+ flex-wrap: wrap;
32
+ align-items: center;
33
+ gap: 6px;
34
+ margin: 0;
35
+ padding: 0;
36
+ list-style: none;
37
+ color: var(--sheerly-muted-foreground);
38
+ font-size: 14px;
39
+ line-height: 20px;
40
+ word-break: break-word;
41
+ }
42
+
43
+ @media (min-width: 640px) {
44
+ .sheerly-breadcrumb-list {
45
+ gap: 10px;
46
+ }
47
+ }
48
+
49
+ .sheerly-breadcrumb-item {
50
+ display: inline-flex;
51
+ align-items: center;
52
+ gap: 6px;
53
+ }
54
+
55
+ /* Link — muted, hover reveals the foreground color. */
56
+ .sheerly-breadcrumb-link {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ gap: 4px;
60
+ color: inherit;
61
+ text-decoration: none;
62
+ border-radius: var(--sheerly-radius-sm);
63
+ outline: none;
64
+ transition: color 0.15s ease;
65
+ cursor: pointer;
66
+
67
+ &:hover {
68
+ color: var(--sheerly-foreground);
69
+ }
70
+
71
+ &:focus-visible {
72
+ color: var(--sheerly-foreground);
73
+ box-shadow: var(--sheerly-focus-ring);
74
+ }
75
+
76
+ & svg {
77
+ pointer-events: none;
78
+ flex-shrink: 0;
79
+ width: 14px;
80
+ height: 14px;
81
+ }
82
+ }
83
+
84
+ /* Current page — non-interactive, foreground color. */
85
+ .sheerly-breadcrumb-page {
86
+ display: inline-flex;
87
+ align-items: center;
88
+ gap: 4px;
89
+ color: var(--sheerly-foreground);
90
+ font-weight: 400;
91
+
92
+ & svg {
93
+ pointer-events: none;
94
+ flex-shrink: 0;
95
+ width: 14px;
96
+ height: 14px;
97
+ }
98
+ }
99
+
100
+ /* Separator — embedded chevron glyph when :empty; children override it. */
101
+ .sheerly-breadcrumb-separator {
102
+ display: inline-flex;
103
+ align-items: center;
104
+ justify-content: center;
105
+ color: var(--sheerly-muted-foreground);
106
+
107
+ & svg {
108
+ width: 14px;
109
+ height: 14px;
110
+ }
111
+
112
+ &:empty::after {
113
+ content: "";
114
+ width: 14px;
115
+ height: 14px;
116
+ background-color: currentColor;
117
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
118
+ }
119
+ }
120
+
121
+ /* Ellipsis — collapsed-items indicator; embedded glyph when :empty. Styled
122
+ * like a ghost button so an interactive trigger (button / dropdown) reveals a
123
+ * hover / focus surface, matching shadcn's ghost-button ellipsis. */
124
+ .sheerly-breadcrumb-ellipsis {
125
+ display: inline-flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ width: 28px;
129
+ height: 28px;
130
+ padding: 0;
131
+ border: none;
132
+ border-radius: var(--sheerly-radius-lg);
133
+ background-color: transparent;
134
+ color: var(--sheerly-foreground);
135
+ outline: none;
136
+ transition: background-color 0.15s ease, color 0.15s ease;
137
+
138
+ & svg {
139
+ width: 16px;
140
+ height: 16px;
141
+ }
142
+
143
+ &:empty::before {
144
+ content: "";
145
+ width: 16px;
146
+ height: 16px;
147
+ background-color: currentColor;
148
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E") center / contain no-repeat;
149
+ }
150
+
151
+ /* Interactive (a <button> trigger or a dropdown trigger): ghost-button hover. */
152
+ &:is(button, [role="button"], a) {
153
+ cursor: pointer;
154
+
155
+ &:hover {
156
+ background-color: var(--sheerly-accent);
157
+ color: var(--sheerly-accent-foreground);
158
+ }
159
+
160
+ &:focus-visible {
161
+ background-color: var(--sheerly-accent);
162
+ color: var(--sheerly-accent-foreground);
163
+ box-shadow: var(--sheerly-focus-ring);
164
+ }
165
+ }
166
+ }
@@ -0,0 +1,71 @@
1
+ import type { AnchorHTMLAttributes, HTMLAttributes, OlHTMLAttributes } from 'react'
2
+ import { cn } from './cn'
3
+
4
+ export function Breadcrumb({ className, ...props }: HTMLAttributes<HTMLElement>) {
5
+ return (
6
+ <nav
7
+ aria-label="breadcrumb"
8
+ className={cn('sheerly-breadcrumb', className)}
9
+ {...props}
10
+ />
11
+ )
12
+ }
13
+
14
+ export function BreadcrumbList({ className, ...props }: OlHTMLAttributes<HTMLOListElement>) {
15
+ return <ol className={cn('sheerly-breadcrumb-list', className)} {...props} />
16
+ }
17
+
18
+ export function BreadcrumbItem({ className, ...props }: HTMLAttributes<HTMLLIElement>) {
19
+ return <li className={cn('sheerly-breadcrumb-item', className)} {...props} />
20
+ }
21
+
22
+ export function BreadcrumbLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnchorElement>) {
23
+ return <a className={cn('sheerly-breadcrumb-link', className)} {...props} />
24
+ }
25
+
26
+ export function BreadcrumbPage({ className, ...props }: HTMLAttributes<HTMLSpanElement>) {
27
+ return (
28
+ <span
29
+ role="link"
30
+ aria-disabled="true"
31
+ aria-current="page"
32
+ className={cn('sheerly-breadcrumb-page', className)}
33
+ {...props}
34
+ />
35
+ )
36
+ }
37
+
38
+ export function BreadcrumbSeparator({
39
+ className,
40
+ children,
41
+ ...props
42
+ }: HTMLAttributes<HTMLLIElement>) {
43
+ return (
44
+ <li
45
+ role="presentation"
46
+ aria-hidden="true"
47
+ className={cn('sheerly-breadcrumb-separator', className)}
48
+ {...props}
49
+ >
50
+ {children}
51
+ </li>
52
+ )
53
+ }
54
+
55
+ export function BreadcrumbEllipsis({
56
+ className,
57
+ children,
58
+ ...props
59
+ }: HTMLAttributes<HTMLSpanElement>) {
60
+ return (
61
+ <span
62
+ role="presentation"
63
+ aria-hidden="true"
64
+ aria-label="More"
65
+ className={cn('sheerly-breadcrumb-ellipsis', className)}
66
+ {...props}
67
+ >
68
+ {children}
69
+ </span>
70
+ )
71
+ }
package/src/button.css ADDED
@@ -0,0 +1,214 @@
1
+ /* Button — <button>; defaults to primary variant, default size (32px) */
2
+ .sheerly-button {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ gap: 6px;
7
+ flex-shrink: 0;
8
+ white-space: nowrap;
9
+ border-radius: var(--sheerly-radius-lg);
10
+ font-family: "Geist Sans", system-ui, -apple-system, sans-serif;
11
+ font-size: 14px;
12
+ font-weight: 500;
13
+ line-height: 20px;
14
+ transition: all 0.15s ease;
15
+ outline: none;
16
+ cursor: pointer;
17
+ border: 1px solid transparent;
18
+ text-decoration: none;
19
+ user-select: none;
20
+
21
+ /* Default = primary variant, default size (32px) */
22
+ background-color: var(--sheerly-primary);
23
+ color: var(--sheerly-primary-foreground);
24
+ padding: 0 10px;
25
+ height: 32px;
26
+
27
+ &:hover {
28
+ background-color: oklch(from var(--sheerly-primary) l c h / 80%);
29
+ }
30
+
31
+ &:active:not([aria-haspopup]) {
32
+ translate: 0 1px;
33
+ }
34
+
35
+ &:focus-visible {
36
+ border-color: var(--sheerly-ring);
37
+ box-shadow: var(--sheerly-focus-ring);
38
+ }
39
+
40
+ &:disabled {
41
+ pointer-events: none;
42
+ opacity: 0.5;
43
+ }
44
+
45
+ & svg {
46
+ pointer-events: none;
47
+ flex-shrink: 0;
48
+ width: 16px;
49
+ height: 16px;
50
+ }
51
+
52
+ /* Icon positioning */
53
+ & [data-icon="inline-start"] {
54
+ margin-inline-start: -2px;
55
+ }
56
+
57
+ & [data-icon="inline-end"] {
58
+ margin-inline-end: -2px;
59
+ }
60
+
61
+ /* Rounded (pill shape) */
62
+ &[data-rounded="full"] {
63
+ border-radius: var(--sheerly-radius-full);
64
+ }
65
+
66
+ /* ========== Variants ========== */
67
+
68
+ &[data-variant="default"],
69
+ &[data-variant="primary"] {
70
+ background-color: var(--sheerly-primary);
71
+ color: var(--sheerly-primary-foreground);
72
+
73
+ &:hover {
74
+ background-color: oklch(from var(--sheerly-primary) l c h / 80%);
75
+ }
76
+ }
77
+
78
+ &[data-variant="secondary"] {
79
+ background-color: var(--sheerly-secondary);
80
+ color: var(--sheerly-secondary-foreground);
81
+
82
+ &:hover {
83
+ background-color: color-mix(in oklch, var(--sheerly-secondary), var(--sheerly-foreground) 5%);
84
+ }
85
+ }
86
+
87
+ &[data-variant="tertiary"],
88
+ &[data-variant="ghost"] {
89
+ background-color: transparent;
90
+ color: var(--sheerly-foreground);
91
+
92
+ &:hover {
93
+ background-color: var(--sheerly-muted);
94
+ color: var(--sheerly-foreground);
95
+ }
96
+ }
97
+
98
+ &[data-variant="muted"] {
99
+ background-color: var(--sheerly-muted);
100
+ color: var(--sheerly-muted-foreground);
101
+
102
+ &:hover {
103
+ background-color: color-mix(in oklch, var(--sheerly-muted), var(--sheerly-foreground) 5%);
104
+ }
105
+ }
106
+
107
+ &[data-variant="destructive"],
108
+ &[data-variant="error"] {
109
+ background-color: oklch(from var(--sheerly-destructive) l c h / 10%);
110
+ color: var(--sheerly-destructive);
111
+
112
+ &:hover {
113
+ background-color: oklch(from var(--sheerly-destructive) l c h / 20%);
114
+ }
115
+
116
+ &:focus-visible {
117
+ border-color: oklch(from var(--sheerly-destructive) l c h / 40%);
118
+ box-shadow: 0 0 0 3px oklch(from var(--sheerly-destructive) l c h / 20%);
119
+ }
120
+ }
121
+
122
+ &[data-variant="outline"] {
123
+ background-color: var(--sheerly-background);
124
+ color: var(--sheerly-foreground);
125
+ border-color: var(--sheerly-border);
126
+
127
+ &:hover {
128
+ background-color: var(--sheerly-muted);
129
+ color: var(--sheerly-foreground);
130
+ }
131
+ }
132
+
133
+ &[data-variant="link"] {
134
+ background-color: transparent;
135
+ color: var(--sheerly-primary);
136
+ padding: 0;
137
+ height: auto;
138
+ border: none;
139
+ text-underline-offset: 4px;
140
+
141
+ &:hover {
142
+ text-decoration: underline;
143
+ }
144
+ }
145
+
146
+ /* ========== Sizes ========== */
147
+
148
+ /* XS (24px) */
149
+ &[data-size="xs"] {
150
+ height: 24px;
151
+ padding: 0 8px;
152
+ gap: 4px;
153
+ font-size: 12px;
154
+ border-radius: var(--sheerly-radius-md);
155
+
156
+ & svg {
157
+ width: 14px;
158
+ height: 14px;
159
+ }
160
+ }
161
+
162
+ /* SM (28px) */
163
+ &[data-size="sm"] {
164
+ height: 28px;
165
+ padding: 0 10px;
166
+ gap: 4px;
167
+ font-size: 13px;
168
+ border-radius: var(--sheerly-radius-md);
169
+ }
170
+
171
+ /* Default (32px) */
172
+ &[data-size="default"] {
173
+ height: 32px;
174
+ padding: 0 10px;
175
+ }
176
+
177
+ /* LG (36px) */
178
+ &[data-size="lg"] {
179
+ height: 36px;
180
+ padding: 0 10px;
181
+ }
182
+
183
+ /* Icon sizes */
184
+ &[data-size="icon"] {
185
+ width: 32px;
186
+ height: 32px;
187
+ padding: 0;
188
+ }
189
+
190
+ &[data-size="icon-xs"] {
191
+ width: 24px;
192
+ height: 24px;
193
+ padding: 0;
194
+ border-radius: var(--sheerly-radius-md);
195
+
196
+ & svg {
197
+ width: 14px;
198
+ height: 14px;
199
+ }
200
+ }
201
+
202
+ &[data-size="icon-sm"] {
203
+ width: 28px;
204
+ height: 28px;
205
+ padding: 0;
206
+ border-radius: var(--sheerly-radius-md);
207
+ }
208
+
209
+ &[data-size="icon-lg"] {
210
+ width: 36px;
211
+ height: 36px;
212
+ padding: 0;
213
+ }
214
+ }
package/src/button.tsx ADDED
@@ -0,0 +1,30 @@
1
+ import type { ButtonHTMLAttributes } from 'react'
2
+ import { cn } from './cn'
3
+
4
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ 'data-variant'?:
6
+ | 'default'
7
+ | 'primary'
8
+ | 'secondary'
9
+ | 'tertiary'
10
+ | 'ghost'
11
+ | 'muted'
12
+ | 'destructive'
13
+ | 'error'
14
+ | 'outline'
15
+ | 'link'
16
+ 'data-size'?:
17
+ | 'xs'
18
+ | 'sm'
19
+ | 'default'
20
+ | 'lg'
21
+ | 'icon'
22
+ | 'icon-xs'
23
+ | 'icon-sm'
24
+ | 'icon-lg'
25
+ 'data-rounded'?: 'full'
26
+ }
27
+
28
+ export function Button({ className, ...props }: ButtonProps) {
29
+ return <button className={cn('sheerly-button', className)} {...props} />
30
+ }