@epilot/spark-ui 1.0.0-alpha.0 → 1.0.0-alpha.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/README.md +0 -111
- package/dist/index.cjs +1381 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +227 -3
- package/dist/index.d.ts +227 -3
- package/dist/index.js +1315 -52
- package/dist/index.js.map +1 -1
- package/package.json +30 -15
package/README.md
CHANGED
|
@@ -24,114 +24,3 @@ Theme selectors follow the same convention as the portal:
|
|
|
24
24
|
```ts
|
|
25
25
|
import '@epilot/spark-ui/styles'
|
|
26
26
|
```
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Button
|
|
31
|
-
|
|
32
|
-
Displays a button or a component that looks like a button.
|
|
33
|
-
|
|
34
|
-
### Usage
|
|
35
|
-
|
|
36
|
-
```tsx
|
|
37
|
-
import { Button } from '@epilot/spark-ui'
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
```tsx
|
|
41
|
-
<Button variant="primary">Button</Button>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Examples
|
|
45
|
-
|
|
46
|
-
#### Primary
|
|
47
|
-
|
|
48
|
-
```tsx
|
|
49
|
-
import { Button } from '@epilot/spark-ui'
|
|
50
|
-
|
|
51
|
-
export function ButtonPrimary() {
|
|
52
|
-
return <Button variant="primary">Primary</Button>
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
#### Secondary
|
|
57
|
-
|
|
58
|
-
```tsx
|
|
59
|
-
import { Button } from '@epilot/spark-ui'
|
|
60
|
-
|
|
61
|
-
export function ButtonSecondary() {
|
|
62
|
-
return <Button variant="secondary">Secondary</Button>
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
#### Tertiary
|
|
67
|
-
|
|
68
|
-
```tsx
|
|
69
|
-
import { Button } from '@epilot/spark-ui'
|
|
70
|
-
|
|
71
|
-
export function ButtonTertiary() {
|
|
72
|
-
return <Button variant="tertiary">Tertiary</Button>
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
#### Icon
|
|
77
|
-
|
|
78
|
-
```tsx
|
|
79
|
-
import { Button } from '@epilot/spark-ui'
|
|
80
|
-
import { SearchIcon } from 'lucide-react'
|
|
81
|
-
|
|
82
|
-
export function ButtonIcon() {
|
|
83
|
-
return (
|
|
84
|
-
<Button variant="icon" aria-label="Search">
|
|
85
|
-
<SearchIcon />
|
|
86
|
-
</Button>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
#### Size
|
|
92
|
-
|
|
93
|
-
Use the `size` prop to change the size of the button.
|
|
94
|
-
|
|
95
|
-
```tsx
|
|
96
|
-
import { Button } from '@epilot/spark-ui'
|
|
97
|
-
|
|
98
|
-
export function ButtonSizes() {
|
|
99
|
-
return (
|
|
100
|
-
<div className="flex items-center gap-2">
|
|
101
|
-
<Button size="small">Small</Button>
|
|
102
|
-
<Button size="default">Default</Button>
|
|
103
|
-
<Button size="medium">Medium</Button>
|
|
104
|
-
</div>
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
#### As Child
|
|
110
|
-
|
|
111
|
-
Use the `asChild` prop to render another component as a button. This is useful for rendering links that look like buttons.
|
|
112
|
-
|
|
113
|
-
```tsx
|
|
114
|
-
import Link from 'next/link'
|
|
115
|
-
import { Button } from '@epilot/spark-ui'
|
|
116
|
-
|
|
117
|
-
export function ButtonAsChild() {
|
|
118
|
-
return (
|
|
119
|
-
<Button asChild>
|
|
120
|
-
<Link href="/login">Login</Link>
|
|
121
|
-
</Button>
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### API Reference
|
|
127
|
-
|
|
128
|
-
#### Button
|
|
129
|
-
|
|
130
|
-
The `Button` component is a wrapper around the `button` element that adds styling and functionality.
|
|
131
|
-
|
|
132
|
-
| Prop | Type | Default |
|
|
133
|
-
| ------- | -------------------------------------------------------------------- | ----------- |
|
|
134
|
-
| variant | `"primary"` \| `"secondary"` \| `"tertiary"` \| `"bare"` \| `"icon"` | `"primary"` |
|
|
135
|
-
| size | `"small"` \| `"default"` \| `"medium"` | `"default"` |
|
|
136
|
-
| shape | `"default"` | `"default"` |
|
|
137
|
-
| asChild | `boolean` | `false` |
|