@aurora-ds/components 0.19.3 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +196 -52
- package/dist/cjs/components/actions/button/Button.props.d.ts +9 -9
- package/dist/cjs/components/actions/icon-button/IconButton.props.d.ts +9 -10
- package/dist/cjs/components/data-display/chip/Chip.props.d.ts +5 -5
- package/dist/cjs/components/data-display/skeleton/Skeleton.props.d.ts +2 -2
- package/dist/cjs/components/data-display/skeleton/Skeleton.styles.d.ts +1 -1
- package/dist/cjs/components/data-display/status/Status.d.ts +16 -0
- package/dist/cjs/components/data-display/status/Status.props.d.ts +40 -0
- package/dist/cjs/components/data-display/status/Status.styles.d.ts +4 -0
- package/dist/cjs/components/data-display/status/index.d.ts +2 -0
- package/dist/cjs/components/foundation/icon/Icon.props.d.ts +6 -6
- package/dist/cjs/components/foundation/icon/Icon.styles.d.ts +1 -1
- package/dist/cjs/components/foundation/text/Text.props.d.ts +5 -5
- package/dist/cjs/components/index.d.ts +2 -2
- package/dist/cjs/components/layout/card/Card.props.d.ts +13 -13
- package/dist/cjs/components/layout/grid/Grid.props.d.ts +7 -7
- package/dist/cjs/components/layout/page-construction/page-section/PageSection.props.d.ts +7 -7
- package/dist/cjs/components/layout/separator/Separator.props.d.ts +3 -3
- package/dist/cjs/components/layout/stack/Stack.props.d.ts +5 -5
- package/dist/cjs/components/navigation/drawer-item/DrawerItem.props.d.ts +2 -2
- package/dist/cjs/components/overlay/accordion/Accordion.props.d.ts +3 -3
- package/dist/cjs/components/overlay/menu/MenuItem/MenuItem.props.d.ts +3 -3
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +326 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/button.types.d.ts +2 -2
- package/dist/cjs/interfaces/index.d.ts +2 -1
- package/dist/cjs/interfaces/status.types.d.ts +6 -0
- package/dist/cjs/interfaces/theme.contracts.d.ts +241 -0
- package/dist/cjs/theme/defaultTheme.d.ts +29 -0
- package/dist/cjs/theme/theme.module.d.ts +32 -0
- package/dist/cjs/theme/theme.types.d.ts +17 -0
- package/dist/cjs/theme/types/themeBreakpoints.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeColor.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeFontSize.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeFontWeight.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeLineHeight.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeOpacity.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeRadius.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeShadows.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeSpacing.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeTransition.types.d.ts +5 -0
- package/dist/cjs/theme/types/themeZIndex.types.d.ts +5 -0
- package/dist/cjs/theme/values/themeBreakpoints.d.ts +5 -0
- package/dist/cjs/theme/values/themeColors.d.ts +6 -0
- package/dist/cjs/theme/values/themeFontSize.d.ts +5 -0
- package/dist/cjs/theme/values/themeFontWeight.d.ts +5 -0
- package/dist/cjs/theme/values/themeLineHeight.d.ts +5 -0
- package/dist/cjs/theme/values/themeOpacity.d.ts +5 -0
- package/dist/cjs/theme/values/themeRadius.d.ts +5 -0
- package/dist/cjs/theme/values/themeShadows.d.ts +5 -0
- package/dist/cjs/theme/values/themeSpacing.d.ts +5 -0
- package/dist/cjs/theme/values/themeTransition.d.ts +5 -0
- package/dist/cjs/theme/values/themeZIndex.d.ts +5 -0
- package/dist/cjs/utils/ui/components/actions/button/getButtonSizeStyles.utils.d.ts +4 -4
- package/dist/cjs/utils/ui/components/actions/icon-button/getIconButtonSizeStyles.utils.d.ts +3 -3
- package/dist/cjs/utils/ui/components/data-display/avatar/getAvatarSizes.utils.d.ts +2 -2
- package/dist/cjs/utils/ui/components/data-display/chip/getChipColorStyles.utils.d.ts +2 -2
- package/dist/cjs/utils/ui/components/data-display/chip/getChipSizeStyles.utils.d.ts +2 -2
- package/dist/cjs/utils/ui/components/data-display/status/getStatusColorStyles.utils.d.ts +7 -0
- package/dist/cjs/utils/ui/components/data-display/status/getStatusContentSize.utils.d.ts +8 -0
- package/dist/cjs/utils/ui/components/data-display/status/getStatusSizeStyles.utils.d.ts +12 -0
- package/dist/cjs/utils/ui/components/foundation/text/getTextVariantStyles.utils.d.ts +2 -2
- package/dist/cjs/utils/ui/components/overlay/alert/getAlertVariantColors.utils.d.ts +2 -2
- package/dist/esm/components/actions/button/Button.props.d.ts +9 -9
- package/dist/esm/components/actions/icon-button/IconButton.props.d.ts +9 -10
- package/dist/esm/components/data-display/chip/Chip.props.d.ts +5 -5
- package/dist/esm/components/data-display/skeleton/Skeleton.props.d.ts +2 -2
- package/dist/esm/components/data-display/skeleton/Skeleton.styles.d.ts +1 -1
- package/dist/esm/components/data-display/status/Status.d.ts +16 -0
- package/dist/esm/components/data-display/status/Status.props.d.ts +40 -0
- package/dist/esm/components/data-display/status/Status.styles.d.ts +4 -0
- package/dist/esm/components/data-display/status/index.d.ts +2 -0
- package/dist/esm/components/foundation/icon/Icon.props.d.ts +6 -6
- package/dist/esm/components/foundation/icon/Icon.styles.d.ts +1 -1
- package/dist/esm/components/foundation/text/Text.props.d.ts +5 -5
- package/dist/esm/components/index.d.ts +2 -2
- package/dist/esm/components/layout/card/Card.props.d.ts +13 -13
- package/dist/esm/components/layout/grid/Grid.props.d.ts +7 -7
- package/dist/esm/components/layout/page-construction/page-section/PageSection.props.d.ts +7 -7
- package/dist/esm/components/layout/separator/Separator.props.d.ts +3 -3
- package/dist/esm/components/layout/stack/Stack.props.d.ts +5 -5
- package/dist/esm/components/navigation/drawer-item/DrawerItem.props.d.ts +2 -2
- package/dist/esm/components/overlay/accordion/Accordion.props.d.ts +3 -3
- package/dist/esm/components/overlay/menu/MenuItem/MenuItem.props.d.ts +3 -3
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +325 -23
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/button.types.d.ts +2 -2
- package/dist/esm/interfaces/index.d.ts +2 -1
- package/dist/esm/interfaces/status.types.d.ts +6 -0
- package/dist/esm/interfaces/theme.contracts.d.ts +241 -0
- package/dist/esm/theme/defaultTheme.d.ts +29 -0
- package/dist/esm/theme/theme.module.d.ts +32 -0
- package/dist/esm/theme/theme.types.d.ts +17 -0
- package/dist/esm/theme/types/themeBreakpoints.types.d.ts +5 -0
- package/dist/esm/theme/types/themeColor.types.d.ts +5 -0
- package/dist/esm/theme/types/themeFontSize.types.d.ts +5 -0
- package/dist/esm/theme/types/themeFontWeight.types.d.ts +5 -0
- package/dist/esm/theme/types/themeLineHeight.types.d.ts +5 -0
- package/dist/esm/theme/types/themeOpacity.types.d.ts +5 -0
- package/dist/esm/theme/types/themeRadius.types.d.ts +5 -0
- package/dist/esm/theme/types/themeShadows.types.d.ts +5 -0
- package/dist/esm/theme/types/themeSpacing.types.d.ts +5 -0
- package/dist/esm/theme/types/themeTransition.types.d.ts +5 -0
- package/dist/esm/theme/types/themeZIndex.types.d.ts +5 -0
- package/dist/esm/theme/values/themeBreakpoints.d.ts +5 -0
- package/dist/esm/theme/values/themeColors.d.ts +6 -0
- package/dist/esm/theme/values/themeFontSize.d.ts +5 -0
- package/dist/esm/theme/values/themeFontWeight.d.ts +5 -0
- package/dist/esm/theme/values/themeLineHeight.d.ts +5 -0
- package/dist/esm/theme/values/themeOpacity.d.ts +5 -0
- package/dist/esm/theme/values/themeRadius.d.ts +5 -0
- package/dist/esm/theme/values/themeShadows.d.ts +5 -0
- package/dist/esm/theme/values/themeSpacing.d.ts +5 -0
- package/dist/esm/theme/values/themeTransition.d.ts +5 -0
- package/dist/esm/theme/values/themeZIndex.d.ts +5 -0
- package/dist/esm/utils/ui/components/actions/button/getButtonSizeStyles.utils.d.ts +4 -4
- package/dist/esm/utils/ui/components/actions/icon-button/getIconButtonSizeStyles.utils.d.ts +3 -3
- package/dist/esm/utils/ui/components/data-display/avatar/getAvatarSizes.utils.d.ts +2 -2
- package/dist/esm/utils/ui/components/data-display/chip/getChipColorStyles.utils.d.ts +2 -2
- package/dist/esm/utils/ui/components/data-display/chip/getChipSizeStyles.utils.d.ts +2 -2
- package/dist/esm/utils/ui/components/data-display/status/getStatusColorStyles.utils.d.ts +7 -0
- package/dist/esm/utils/ui/components/data-display/status/getStatusContentSize.utils.d.ts +8 -0
- package/dist/esm/utils/ui/components/data-display/status/getStatusSizeStyles.utils.d.ts +12 -0
- package/dist/esm/utils/ui/components/foundation/text/getTextVariantStyles.utils.d.ts +2 -2
- package/dist/esm/utils/ui/components/overlay/alert/getAlertVariantColors.utils.d.ts +2 -2
- package/dist/index.d.ts +440 -122
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -2,75 +2,219 @@
|
|
|
2
2
|
|
|
3
3
|
> ⚠️ **Personal Project Notice**
|
|
4
4
|
>
|
|
5
|
-
> This library is designed for my personal projects and is not intended for public use.
|
|
5
|
+
> This library is designed for my personal projects and is not intended for public use. Feel free to use it as inspiration or reference, but no support or maintenance is guaranteed.
|
|
6
6
|
|
|
7
|
-
A React component library
|
|
7
|
+
A React component library with **default theme included**. Ready to use in 3 lines of code.
|
|
8
|
+
|
|
9
|
+
**Key Features:**
|
|
10
|
+
- ✅ **Default theme included** - No configuration needed
|
|
11
|
+
- ✅ **TypeScript autocomplete** - Full IntelliSense support
|
|
12
|
+
- ✅ **Easy to customize** - Spread operator to override
|
|
13
|
+
- ✅ **Built with `@aurora-ds/theme` v3** - Powerful theming system
|
|
8
14
|
|
|
9
15
|
## Installation
|
|
10
16
|
|
|
11
17
|
```bash
|
|
12
|
-
yarn add @aurora-ds/components
|
|
18
|
+
yarn add @aurora-ds/components @aurora-ds/theme react react-dom
|
|
13
19
|
```
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
## Quick Start
|
|
16
22
|
|
|
17
|
-
```
|
|
18
|
-
|
|
23
|
+
```tsx
|
|
24
|
+
import { ThemeProvider } from '@aurora-ds/theme'
|
|
25
|
+
import { defaultTheme, Button } from '@aurora-ds/components'
|
|
26
|
+
|
|
27
|
+
function App() {
|
|
28
|
+
return (
|
|
29
|
+
<ThemeProvider theme={defaultTheme}>
|
|
30
|
+
<Button label="Click me" variant="contained" />
|
|
31
|
+
</ThemeProvider>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
19
34
|
```
|
|
20
35
|
|
|
21
|
-
|
|
36
|
+
That's it! 🎉
|
|
37
|
+
|
|
38
|
+
## 🎨 Customization
|
|
39
|
+
|
|
40
|
+
### Use Case 1: Change Token Values
|
|
41
|
+
|
|
42
|
+
You have two options to customize the theme:
|
|
22
43
|
|
|
23
|
-
|
|
44
|
+
#### Option A: Using spread operator (simple)
|
|
24
45
|
|
|
25
46
|
```tsx
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
47
|
+
import { defaultTheme } from '@aurora-ds/components'
|
|
48
|
+
import { colors } from '@aurora-ds/theme'
|
|
28
49
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const myTheme = {
|
|
51
|
+
...defaultTheme,
|
|
52
|
+
colors: {
|
|
53
|
+
...defaultTheme.colors,
|
|
54
|
+
primary: colors.purple[600], // Change primary color
|
|
55
|
+
success: colors.teal[600], // Change success color
|
|
56
|
+
},
|
|
57
|
+
spacing: {
|
|
58
|
+
...defaultTheme.spacing,
|
|
59
|
+
lg: '2rem', // Change large spacing
|
|
60
|
+
},
|
|
61
|
+
radius: {
|
|
62
|
+
...defaultTheme.radius,
|
|
63
|
+
md: '1rem', // Change medium radius
|
|
64
|
+
}
|
|
42
65
|
}
|
|
66
|
+
|
|
67
|
+
<ThemeProvider theme={myTheme}>
|
|
68
|
+
<App />
|
|
69
|
+
</ThemeProvider>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### Option B: Using `createTheme` (type-safe)
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { createTheme, colors } from '@aurora-ds/theme'
|
|
76
|
+
import { defaultTheme } from '@aurora-ds/components'
|
|
77
|
+
|
|
78
|
+
const myTheme = createTheme({
|
|
79
|
+
...defaultTheme,
|
|
80
|
+
colors: {
|
|
81
|
+
...defaultTheme.colors,
|
|
82
|
+
primary: colors.purple[600],
|
|
83
|
+
success: colors.teal[600],
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
<ThemeProvider theme={myTheme}>
|
|
88
|
+
<App />
|
|
89
|
+
</ThemeProvider>
|
|
43
90
|
```
|
|
44
91
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
92
|
+
Both approaches work! `createTheme` provides additional type validation.
|
|
93
|
+
|
|
94
|
+
### Use Case 2: Add Custom Tokens
|
|
95
|
+
|
|
96
|
+
If you need tokens that don't exist in `defaultTheme` (for very specific use cases):
|
|
97
|
+
|
|
98
|
+
**Step 1: Create your theme types**
|
|
99
|
+
```typescript
|
|
100
|
+
// src/theme/theme.types.ts
|
|
101
|
+
import type { Theme as BaseTheme } from '@aurora-ds/components'
|
|
102
|
+
|
|
103
|
+
export interface Theme extends BaseTheme {
|
|
104
|
+
colors: BaseTheme['colors'] & {
|
|
105
|
+
brand: string // New custom token
|
|
106
|
+
custom: string // New custom token
|
|
107
|
+
}
|
|
108
|
+
customSpacing: { // Entirely new category
|
|
109
|
+
hero: string
|
|
110
|
+
section: string
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Step 2: Create module augmentation**
|
|
116
|
+
```typescript
|
|
117
|
+
// src/theme/theme.module.ts
|
|
118
|
+
import type { Theme } from './theme.types'
|
|
119
|
+
|
|
120
|
+
declare module '@aurora-ds/theme' {
|
|
121
|
+
interface ThemeRegistry {
|
|
122
|
+
theme: Theme
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Step 3: Create your theme with `createTheme`**
|
|
128
|
+
```typescript
|
|
129
|
+
// src/theme/theme.ts
|
|
130
|
+
import './theme.module'
|
|
131
|
+
import { createTheme, colors } from '@aurora-ds/theme'
|
|
132
|
+
import { defaultTheme } from '@aurora-ds/components'
|
|
133
|
+
|
|
134
|
+
export const myTheme = createTheme({
|
|
135
|
+
...defaultTheme,
|
|
136
|
+
colors: {
|
|
137
|
+
...defaultTheme.colors,
|
|
138
|
+
brand: colors.purple[600], // Your custom token
|
|
139
|
+
custom: colors.pink[500], // Your custom token
|
|
140
|
+
},
|
|
141
|
+
customSpacing: { // Your custom category
|
|
142
|
+
hero: '10rem',
|
|
143
|
+
section: '5rem',
|
|
144
|
+
}
|
|
145
|
+
} as Theme)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Step 4: Use it**
|
|
149
|
+
```typescript
|
|
150
|
+
// src/App.tsx
|
|
151
|
+
import { myTheme } from './theme/theme'
|
|
152
|
+
|
|
153
|
+
<ThemeProvider theme={myTheme}>
|
|
154
|
+
<App />
|
|
155
|
+
</ThemeProvider>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Now you get autocomplete on your custom tokens! ✅
|
|
159
|
+
|
|
160
|
+
> **Note:** Most projects won't need this. The default theme already includes common tokens like `highlight`, `accent`, and `link`.
|
|
161
|
+
|
|
162
|
+
### Use Case 3: Multiple Themes (Light/Dark)
|
|
163
|
+
|
|
164
|
+
Create multiple theme variants:
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { createTheme, colors } from '@aurora-ds/theme'
|
|
168
|
+
import { defaultTheme } from '@aurora-ds/components'
|
|
169
|
+
|
|
170
|
+
// Light theme (use default)
|
|
171
|
+
export const lightTheme = defaultTheme
|
|
172
|
+
|
|
173
|
+
// Dark theme with createTheme
|
|
174
|
+
export const darkTheme = createTheme({
|
|
175
|
+
...defaultTheme,
|
|
176
|
+
colors: {
|
|
177
|
+
...defaultTheme.colors,
|
|
178
|
+
background: colors.slate[950],
|
|
179
|
+
surface: colors.slate[900],
|
|
180
|
+
text: colors.slate[50],
|
|
181
|
+
primary: colors.indigo[400],
|
|
182
|
+
secondary: colors.slate[800],
|
|
183
|
+
border: colors.slate[800],
|
|
184
|
+
// ... other dark mode colors
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
// In your app
|
|
189
|
+
const [isDark, setIsDark] = useState(false)
|
|
190
|
+
|
|
191
|
+
<ThemeProvider theme={isDark ? darkTheme : lightTheme}>
|
|
192
|
+
<App />
|
|
193
|
+
</ThemeProvider>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## 📦 Available Tokens
|
|
197
|
+
|
|
198
|
+
The `defaultTheme` includes these token categories:
|
|
199
|
+
|
|
200
|
+
- **colors**: `primary`, `secondary`, `error`, `success`, `warning`, `info`, `highlight`, `accent`, `link`, `text`, `background`, etc.
|
|
201
|
+
- **spacing**: `none`, `2xs` (2px), `xs` (4px), `sm` (8px), `md` (16px), `lg` (24px), `xl` (32px), etc.
|
|
202
|
+
- **radius**: `none`, `xs` (2px), `sm` (4px), `md` (6px), `lg` (8px), `xl` (12px), `2xl` (16px), `full`
|
|
203
|
+
- **fontSize**: `2xs` (10px), `xs` (12px), `sm` (14px), `md` (16px), `lg` (20px), `xl` (24px), etc.
|
|
204
|
+
- **fontWeight**: `light` (300), `regular` (400), `medium` (500), `semibold` (600), `bold` (700)
|
|
205
|
+
- **shadows**, **transition**, **breakpoints**, **zIndex**, etc.
|
|
206
|
+
|
|
207
|
+
💡 See all values in `src/theme/values/`
|
|
208
|
+
|
|
209
|
+
## 🧩 Available Components
|
|
210
|
+
|
|
211
|
+
**Buttons:** Button, IconButton
|
|
212
|
+
**Layout:** Card, Stack, Grid, Page, PageSection, Separator
|
|
213
|
+
**Typography:** Text
|
|
214
|
+
**Forms:** Input, TextArea, Select, DatePicker, Form
|
|
215
|
+
**Data Display:** Status, Avatar, AvatarGroup, Icon
|
|
216
|
+
**Navigation:** Breadcrumb, Tabs, DrawerItem, Menu, Pagination
|
|
217
|
+
**Feedback:** Alert, Accordion
|
|
74
218
|
|
|
75
219
|
## License
|
|
76
220
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { ReactNode, MouseEvent } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
import { ButtonVariants, IconButtonSizes } from '@interfaces/button.types.ts';
|
|
4
4
|
export type ButtonProps = {
|
|
5
5
|
/** Button text label */
|
|
@@ -19,13 +19,13 @@ export type ButtonProps = {
|
|
|
19
19
|
/** Disabled state */
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
/** Custom text color (overrides variant color) */
|
|
22
|
-
textColor?: keyof
|
|
22
|
+
textColor?: keyof ThemeContract['colors'];
|
|
23
23
|
/** Custom backgroundColor (overrides variant backgroundColor) */
|
|
24
|
-
backgroundColor?: keyof
|
|
24
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
25
25
|
/** Custom hover backgroundColor (overrides variant hover backgroundColor) */
|
|
26
|
-
hoverBackgroundColor?: keyof
|
|
26
|
+
hoverBackgroundColor?: keyof ThemeContract['colors'];
|
|
27
27
|
/** Custom active backgroundColor (overrides variant active backgroundColor) */
|
|
28
|
-
activeBackgroundColor?: keyof
|
|
28
|
+
activeBackgroundColor?: keyof ThemeContract['colors'];
|
|
29
29
|
/** Size of the button */
|
|
30
30
|
size?: IconButtonSizes;
|
|
31
31
|
/** Accessibility label for screen readers */
|
|
@@ -42,9 +42,9 @@ export type ButtonProps = {
|
|
|
42
42
|
export type ButtonStyleParams = {
|
|
43
43
|
variant?: ButtonVariants;
|
|
44
44
|
active?: boolean;
|
|
45
|
-
textColor?: keyof
|
|
46
|
-
backgroundColor?: keyof
|
|
47
|
-
hoverBackgroundColor?: keyof
|
|
48
|
-
activeBackgroundColor?: keyof
|
|
45
|
+
textColor?: keyof ThemeContract['colors'];
|
|
46
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
47
|
+
hoverBackgroundColor?: keyof ThemeContract['colors'];
|
|
48
|
+
activeBackgroundColor?: keyof ThemeContract['colors'];
|
|
49
49
|
size?: IconButtonSizes;
|
|
50
50
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
3
|
-
import { IconButtonSizes, IconButtonVariants } from '@/interfaces';
|
|
2
|
+
import { IconButtonSizes, IconButtonVariants, ThemeContract } from '@/interfaces';
|
|
4
3
|
export type IconButtonProps = {
|
|
5
4
|
/** IconButton icon */
|
|
6
5
|
icon?: ReactNode;
|
|
@@ -15,13 +14,13 @@ export type IconButtonProps = {
|
|
|
15
14
|
/** Disabled state */
|
|
16
15
|
disabled?: boolean;
|
|
17
16
|
/** Custom text/icon color (overrides variant color) */
|
|
18
|
-
textColor?: keyof
|
|
17
|
+
textColor?: keyof ThemeContract['colors'];
|
|
19
18
|
/** Custom backgroundColor (overrides variant backgroundColor) */
|
|
20
|
-
backgroundColor?: keyof
|
|
19
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
21
20
|
/** Custom hover backgroundColor (overrides variant hover backgroundColor) */
|
|
22
|
-
hoverBackgroundColor?: keyof
|
|
21
|
+
hoverBackgroundColor?: keyof ThemeContract['colors'];
|
|
23
22
|
/** Custom active backgroundColor (overrides variant active backgroundColor) */
|
|
24
|
-
activeBackgroundColor?: keyof
|
|
23
|
+
activeBackgroundColor?: keyof ThemeContract['colors'];
|
|
25
24
|
/** Size of the icon button */
|
|
26
25
|
size?: IconButtonSizes;
|
|
27
26
|
/** Accessibility label for screen readers */
|
|
@@ -39,8 +38,8 @@ export type IconButtonStyleParams = {
|
|
|
39
38
|
variant?: IconButtonVariants;
|
|
40
39
|
active?: boolean;
|
|
41
40
|
size?: IconButtonSizes;
|
|
42
|
-
textColor?: keyof
|
|
43
|
-
backgroundColor?: keyof
|
|
44
|
-
hoverBackgroundColor?: keyof
|
|
45
|
-
activeBackgroundColor?: keyof
|
|
41
|
+
textColor?: keyof ThemeContract['colors'];
|
|
42
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
43
|
+
hoverBackgroundColor?: keyof ThemeContract['colors'];
|
|
44
|
+
activeBackgroundColor?: keyof ThemeContract['colors'];
|
|
46
45
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
import { ChipColor, ChipSize, ChipVariant } from '@interfaces/chip.types';
|
|
4
4
|
export type ChipProps = {
|
|
5
5
|
/** Text label to display */
|
|
@@ -13,9 +13,9 @@ export type ChipProps = {
|
|
|
13
13
|
/** Chip size */
|
|
14
14
|
size?: ChipSize;
|
|
15
15
|
/** Gap between icon and text (theme spacing key) */
|
|
16
|
-
gap?: keyof
|
|
16
|
+
gap?: keyof ThemeContract['spacing'];
|
|
17
17
|
/** Border radius from theme */
|
|
18
|
-
radius?: keyof
|
|
18
|
+
radius?: keyof ThemeContract['radius'];
|
|
19
19
|
/** Disabled state */
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
/** Accessibility label for screen readers */
|
|
@@ -35,6 +35,6 @@ export type ChipStyleParams = {
|
|
|
35
35
|
size: ChipSize;
|
|
36
36
|
isIconOnly: boolean;
|
|
37
37
|
disabled: boolean;
|
|
38
|
-
gap?: keyof
|
|
39
|
-
radius?: keyof
|
|
38
|
+
gap?: keyof ThemeContract['spacing'];
|
|
39
|
+
radius?: keyof ThemeContract['radius'];
|
|
40
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
export type SkeletonProps = {
|
|
4
4
|
width: CSSProperties['width'];
|
|
5
5
|
height: CSSProperties['height'];
|
|
6
|
-
borderRadius?: keyof
|
|
6
|
+
borderRadius?: keyof ThemeContract['radius'];
|
|
7
7
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const SKELETON_STYLES: {
|
|
2
|
-
root: (width?: import("csstype").Property.Width<string | number> | undefined, height?: import("csstype").Property.Height<string | number> | undefined, borderRadius?: keyof import("
|
|
2
|
+
root: (width?: import("csstype").Property.Width<string | number> | undefined, height?: import("csstype").Property.Height<string | number> | undefined, borderRadius?: keyof import("@/interfaces").ThemeRadiusContract | undefined) => string;
|
|
3
3
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { StatusProps } from '@components/data-display/status/Status.props';
|
|
3
|
+
/**
|
|
4
|
+
* Status component
|
|
5
|
+
*
|
|
6
|
+
* A compact element for displaying status, tags, or information.
|
|
7
|
+
*
|
|
8
|
+
* **Variants:**
|
|
9
|
+
* - `filled`: Solid background (default)
|
|
10
|
+
* - `outlined`: Border only
|
|
11
|
+
*
|
|
12
|
+
* **Colors:**
|
|
13
|
+
* - `default`, `primary`, `success`, `warning`, `error`, `info`, `highlight`, `accent`, `new`, `rose`, `yellow`
|
|
14
|
+
*/
|
|
15
|
+
declare const Status: FC<StatusProps>;
|
|
16
|
+
export default Status;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
|
+
import { StatusColor, StatusSize, StatusVariant } from '@interfaces/status.types';
|
|
4
|
+
export type StatusProps = {
|
|
5
|
+
/** Text label to display */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Icon to display before the label */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** Status variant style */
|
|
10
|
+
variant?: StatusVariant;
|
|
11
|
+
/** Status color from theme */
|
|
12
|
+
color?: StatusColor;
|
|
13
|
+
/** Status size */
|
|
14
|
+
size?: StatusSize;
|
|
15
|
+
/** Gap between icon and text (theme spacing key) */
|
|
16
|
+
gap?: keyof ThemeContract['spacing'];
|
|
17
|
+
/** Border radius from theme */
|
|
18
|
+
radius?: keyof ThemeContract['radius'];
|
|
19
|
+
/** Disabled state */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Accessibility label for screen readers */
|
|
22
|
+
ariaLabel?: string;
|
|
23
|
+
/** ID of element that labels this status */
|
|
24
|
+
ariaLabelledBy?: string;
|
|
25
|
+
/** ID of element that describes this status */
|
|
26
|
+
ariaDescribedBy?: string;
|
|
27
|
+
/** ARIA role */
|
|
28
|
+
role?: string;
|
|
29
|
+
/** Tab index for keyboard navigation */
|
|
30
|
+
tabIndex?: number;
|
|
31
|
+
};
|
|
32
|
+
export type StatusStyleParams = {
|
|
33
|
+
variant: StatusVariant;
|
|
34
|
+
color: StatusColor;
|
|
35
|
+
size: StatusSize;
|
|
36
|
+
isIconOnly: boolean;
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
gap?: keyof ThemeContract['spacing'];
|
|
39
|
+
radius?: keyof ThemeContract['radius'];
|
|
40
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
export type IconProps = PropsWithChildren<{
|
|
4
4
|
/** Icon size based on theme font sizes */
|
|
5
|
-
size?: keyof
|
|
5
|
+
size?: keyof ThemeContract['fontSize'];
|
|
6
6
|
/** Icon stroke/line color from theme */
|
|
7
|
-
color?: keyof
|
|
7
|
+
color?: keyof ThemeContract['colors'];
|
|
8
8
|
/** Background color from theme */
|
|
9
|
-
backgroundColor?: keyof
|
|
9
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
10
10
|
/** Padding from theme spacing */
|
|
11
|
-
padding?: keyof
|
|
11
|
+
padding?: keyof ThemeContract['spacing'];
|
|
12
12
|
/** Border radius from theme */
|
|
13
|
-
borderRadius?: keyof
|
|
13
|
+
borderRadius?: keyof ThemeContract['radius'];
|
|
14
14
|
/** Accessibility label for screen readers */
|
|
15
15
|
ariaLabel?: string;
|
|
16
16
|
/** ID of element that labels this icon */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const ICON_STYLES: {
|
|
2
|
-
root: (size?: keyof import("
|
|
2
|
+
root: (size?: keyof import("@/interfaces").ThemeFontSizeContract | undefined, color?: keyof import("@/interfaces").ThemeColorContract | undefined, backgroundColor?: keyof import("@/interfaces").ThemeColorContract | undefined, padding?: keyof import("@/interfaces").ThemeSpacingContract | undefined, borderRadius?: keyof import("@/interfaces").ThemeRadiusContract | undefined) => string;
|
|
3
3
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
import { TextVariants } from '@interfaces/text.types.ts';
|
|
4
4
|
export type TextProps = PropsWithChildren<{
|
|
5
5
|
/** Text variant that determines the HTML tag and default styling */
|
|
6
6
|
variant?: TextVariants;
|
|
7
7
|
/** Text color from theme */
|
|
8
|
-
color?: keyof
|
|
8
|
+
color?: keyof ThemeContract['colors'];
|
|
9
9
|
/** Font size from theme (overrides variant fontSize if provided) */
|
|
10
|
-
fontSize?: keyof
|
|
10
|
+
fontSize?: keyof ThemeContract['fontSize'];
|
|
11
11
|
/** Font family override (CSS value) */
|
|
12
12
|
fontFamily?: string;
|
|
13
13
|
/** Maximum number of lines before truncation with ellipsis */
|
|
@@ -29,8 +29,8 @@ export type TextProps = PropsWithChildren<{
|
|
|
29
29
|
}>;
|
|
30
30
|
export type TextStyleParams = {
|
|
31
31
|
variant?: TextVariants;
|
|
32
|
-
color?: keyof
|
|
33
|
-
fontSize?: keyof
|
|
32
|
+
color?: keyof ThemeContract['colors'];
|
|
33
|
+
fontSize?: keyof ThemeContract['fontSize'];
|
|
34
34
|
fontFamily?: string;
|
|
35
35
|
maxLines?: number;
|
|
36
36
|
underline?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@components/foundation/icon';
|
|
2
2
|
export * from '@components/foundation/text';
|
|
3
|
-
export * from '@components/data-display/
|
|
3
|
+
export * from '@components/data-display/status';
|
|
4
4
|
export * from '@components/data-display/avatar';
|
|
5
5
|
export * from '@components/data-display/skeleton';
|
|
6
6
|
export * from '@components/actions/button';
|
|
@@ -27,5 +27,5 @@ export * from '@components/navigation/pagination';
|
|
|
27
27
|
export type { AlertVariant, AlertPosition } from '@interfaces/alert.types';
|
|
28
28
|
export type { ButtonVariants, ButtonVariantStyle } from '@interfaces/button.types';
|
|
29
29
|
export type { TextVariants, TextVariantStyle } from '@interfaces/text.types';
|
|
30
|
-
export type {
|
|
30
|
+
export type { StatusVariant, StatusColor, StatusSize } from '@interfaces/status.types';
|
|
31
31
|
export type { SelectOption } from '@interfaces/select.types';
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
export type CardProps = {
|
|
4
4
|
/** Card children elements */
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
/** Flex direction of the card content */
|
|
7
7
|
direction?: CSSProperties['flexDirection'];
|
|
8
8
|
/** Padding inside the card (theme spacing key) */
|
|
9
|
-
padding?: keyof
|
|
9
|
+
padding?: keyof ThemeContract['spacing'];
|
|
10
10
|
/** Width of the card */
|
|
11
11
|
width?: CSSProperties['width'];
|
|
12
12
|
/** Height of the card */
|
|
13
13
|
height?: CSSProperties['height'];
|
|
14
14
|
/** Gap between children (theme spacing key) */
|
|
15
|
-
gap?: keyof
|
|
15
|
+
gap?: keyof ThemeContract['spacing'];
|
|
16
16
|
/** Border radius of the card */
|
|
17
|
-
radius?: keyof
|
|
17
|
+
radius?: keyof ThemeContract['radius'];
|
|
18
18
|
/** Shadow depth of the card */
|
|
19
|
-
shadow?: keyof
|
|
19
|
+
shadow?: keyof ThemeContract['shadows'];
|
|
20
20
|
/** Alignment of items on the cross axis */
|
|
21
21
|
align?: CSSProperties['alignItems'];
|
|
22
22
|
/** Justification of items on the main axis */
|
|
23
23
|
justify?: CSSProperties['justifyContent'];
|
|
24
24
|
/** Background color of the card */
|
|
25
|
-
backgroundColor?: keyof
|
|
25
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
26
26
|
/** Border color of the card */
|
|
27
|
-
borderColor?: keyof
|
|
27
|
+
borderColor?: keyof ThemeContract['colors'];
|
|
28
28
|
/** Accessibility label for screen readers */
|
|
29
29
|
ariaLabel?: string;
|
|
30
30
|
/** ID of element that labels this card */
|
|
@@ -38,14 +38,14 @@ export type CardProps = {
|
|
|
38
38
|
};
|
|
39
39
|
export type CardStyleParams = {
|
|
40
40
|
direction: CSSProperties['flexDirection'];
|
|
41
|
-
padding?: keyof
|
|
41
|
+
padding?: keyof ThemeContract['spacing'];
|
|
42
42
|
width?: CSSProperties['width'];
|
|
43
43
|
height?: CSSProperties['height'];
|
|
44
|
-
gap?: keyof
|
|
45
|
-
radius: keyof
|
|
46
|
-
shadow: keyof
|
|
44
|
+
gap?: keyof ThemeContract['spacing'];
|
|
45
|
+
radius: keyof ThemeContract['radius'];
|
|
46
|
+
shadow: keyof ThemeContract['shadows'];
|
|
47
47
|
align?: CSSProperties['alignItems'];
|
|
48
48
|
justify?: CSSProperties['justifyContent'];
|
|
49
|
-
backgroundColor: keyof
|
|
50
|
-
borderColor?: keyof
|
|
49
|
+
backgroundColor: keyof ThemeContract['colors'];
|
|
50
|
+
borderColor?: keyof ThemeContract['colors'];
|
|
51
51
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
export type GridProps = {
|
|
4
4
|
/** Grid children elements */
|
|
5
5
|
children: ReactNode;
|
|
@@ -8,9 +8,9 @@ export type GridProps = {
|
|
|
8
8
|
/** Number of rows. */
|
|
9
9
|
rows?: number;
|
|
10
10
|
/** Gap between columns (theme spacing key) */
|
|
11
|
-
columnGap?: keyof
|
|
11
|
+
columnGap?: keyof ThemeContract['spacing'];
|
|
12
12
|
/** Gap between rows (theme spacing key) */
|
|
13
|
-
rowGap?: keyof
|
|
13
|
+
rowGap?: keyof ThemeContract['spacing'];
|
|
14
14
|
/** Width of the grid container */
|
|
15
15
|
width?: CSSProperties['width'];
|
|
16
16
|
/** Height of the grid container */
|
|
@@ -26,7 +26,7 @@ export type GridProps = {
|
|
|
26
26
|
/** Justification of the entire grid within its container (main axis) */
|
|
27
27
|
justifyContent?: CSSProperties['justifyContent'];
|
|
28
28
|
/** Padding inside the grid */
|
|
29
|
-
padding?: keyof
|
|
29
|
+
padding?: keyof ThemeContract['spacing'];
|
|
30
30
|
/** Minimum width for each grid child. Enables responsive auto-fill behavior. */
|
|
31
31
|
minChildWidth?: CSSProperties['width'];
|
|
32
32
|
/** Accessibility label for screen readers */
|
|
@@ -43,8 +43,8 @@ export type GridProps = {
|
|
|
43
43
|
export type GridStyleParams = {
|
|
44
44
|
columns?: number;
|
|
45
45
|
rows?: number;
|
|
46
|
-
columnGap?: keyof
|
|
47
|
-
rowGap?: keyof
|
|
46
|
+
columnGap?: keyof ThemeContract['spacing'];
|
|
47
|
+
rowGap?: keyof ThemeContract['spacing'];
|
|
48
48
|
width?: CSSProperties['width'];
|
|
49
49
|
height?: CSSProperties['height'];
|
|
50
50
|
minHeight?: CSSProperties['minHeight'];
|
|
@@ -52,6 +52,6 @@ export type GridStyleParams = {
|
|
|
52
52
|
justifyItems?: CSSProperties['justifyItems'];
|
|
53
53
|
alignContent?: CSSProperties['alignContent'];
|
|
54
54
|
justifyContent?: CSSProperties['justifyContent'];
|
|
55
|
-
padding?: keyof
|
|
55
|
+
padding?: keyof ThemeContract['spacing'];
|
|
56
56
|
minChildWidth?: CSSProperties['width'];
|
|
57
57
|
};
|