@aurora-ds/components 0.1.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 +58 -0
- package/dist/cjs/components/button/Button.d.ts +12 -0
- package/dist/cjs/components/button/Button.props.d.ts +24 -0
- package/dist/cjs/components/button/Button.styles.d.ts +18 -0
- package/dist/cjs/components/button/index.d.ts +2 -0
- package/dist/cjs/components/card/Card.d.ts +14 -0
- package/dist/cjs/components/card/Card.props.d.ts +37 -0
- package/dist/cjs/components/card/Card.styles.d.ts +7 -0
- package/dist/cjs/components/card/index.d.ts +2 -0
- package/dist/cjs/components/icon/Icon.d.ts +35 -0
- package/dist/cjs/components/icon/Icon.props.d.ts +14 -0
- package/dist/cjs/components/icon/Icon.styles.d.ts +3 -0
- package/dist/cjs/components/icon/index.d.ts +2 -0
- package/dist/cjs/components/icon-button/IconButton.d.ts +4 -0
- package/dist/cjs/components/icon-button/IconButton.props.d.ts +20 -0
- package/dist/cjs/components/icon-button/IconButton.styles.d.ts +4 -0
- package/dist/cjs/components/icon-button/index.d.ts +2 -0
- package/dist/cjs/components/index.d.ts +10 -0
- package/dist/cjs/components/stack/Stack.d.ts +13 -0
- package/dist/cjs/components/stack/Stack.props.d.ts +33 -0
- package/dist/cjs/components/stack/Stack.styles.d.ts +7 -0
- package/dist/cjs/components/stack/index.d.ts +2 -0
- package/dist/cjs/components/text/Text.d.ts +19 -0
- package/dist/cjs/components/text/Text.props.d.ts +19 -0
- package/dist/cjs/components/text/Text.styles.d.ts +4 -0
- package/dist/cjs/components/text/index.d.ts +2 -0
- package/dist/cjs/constants/globalConstants.d.ts +2 -0
- package/dist/cjs/index.css +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1767 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces/button.types.d.ts +22 -0
- package/dist/cjs/interfaces/card.types.d.ts +3 -0
- package/dist/cjs/interfaces/index.d.ts +4 -0
- package/dist/cjs/interfaces/stack.types.d.ts +7 -0
- package/dist/cjs/interfaces/text.types.d.ts +7 -0
- package/dist/cjs/utils/ui/components/button/getButtonVariantStyles.utils.d.ts +7 -0
- package/dist/cjs/utils/ui/components/text/getTextVariantStyles.utils.d.ts +7 -0
- package/dist/cjs/utils/ui/components/text/getTruncateTextStyles.utils.d.ts +17 -0
- package/dist/esm/components/button/Button.d.ts +12 -0
- package/dist/esm/components/button/Button.props.d.ts +24 -0
- package/dist/esm/components/button/Button.styles.d.ts +18 -0
- package/dist/esm/components/button/index.d.ts +2 -0
- package/dist/esm/components/card/Card.d.ts +14 -0
- package/dist/esm/components/card/Card.props.d.ts +37 -0
- package/dist/esm/components/card/Card.styles.d.ts +7 -0
- package/dist/esm/components/card/index.d.ts +2 -0
- package/dist/esm/components/icon/Icon.d.ts +35 -0
- package/dist/esm/components/icon/Icon.props.d.ts +14 -0
- package/dist/esm/components/icon/Icon.styles.d.ts +3 -0
- package/dist/esm/components/icon/index.d.ts +2 -0
- package/dist/esm/components/icon-button/IconButton.d.ts +4 -0
- package/dist/esm/components/icon-button/IconButton.props.d.ts +20 -0
- package/dist/esm/components/icon-button/IconButton.styles.d.ts +4 -0
- package/dist/esm/components/icon-button/index.d.ts +2 -0
- package/dist/esm/components/index.d.ts +10 -0
- package/dist/esm/components/stack/Stack.d.ts +13 -0
- package/dist/esm/components/stack/Stack.props.d.ts +33 -0
- package/dist/esm/components/stack/Stack.styles.d.ts +7 -0
- package/dist/esm/components/stack/index.d.ts +2 -0
- package/dist/esm/components/text/Text.d.ts +19 -0
- package/dist/esm/components/text/Text.props.d.ts +19 -0
- package/dist/esm/components/text/Text.styles.d.ts +4 -0
- package/dist/esm/components/text/index.d.ts +2 -0
- package/dist/esm/constants/globalConstants.d.ts +2 -0
- package/dist/esm/index.css +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +1760 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces/button.types.d.ts +22 -0
- package/dist/esm/interfaces/card.types.d.ts +3 -0
- package/dist/esm/interfaces/index.d.ts +4 -0
- package/dist/esm/interfaces/stack.types.d.ts +7 -0
- package/dist/esm/interfaces/text.types.d.ts +7 -0
- package/dist/esm/utils/ui/components/button/getButtonVariantStyles.utils.d.ts +7 -0
- package/dist/esm/utils/ui/components/text/getTextVariantStyles.utils.d.ts +7 -0
- package/dist/esm/utils/ui/components/text/getTruncateTextStyles.utils.d.ts +17 -0
- package/dist/index.d.ts +233 -0
- package/package.json +77 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { PropsWithChildren, FC, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import { Theme } from '@aurora-ds/theme';
|
|
3
|
+
|
|
4
|
+
type IconProps = PropsWithChildren<{
|
|
5
|
+
/** Icon size based on theme font sizes */
|
|
6
|
+
size?: keyof Theme['fontSize'];
|
|
7
|
+
/** Icon stroke/line color from theme */
|
|
8
|
+
color?: keyof Theme['colors'];
|
|
9
|
+
/** Background color from theme */
|
|
10
|
+
backgroundColor?: keyof Theme['colors'];
|
|
11
|
+
/** Padding from theme spacing */
|
|
12
|
+
padding?: keyof Theme['spacing'];
|
|
13
|
+
/** Border radius from theme */
|
|
14
|
+
borderRadius?: keyof Theme['radius'];
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Icon component - Wrapper for SVG icons with theme-aware styling
|
|
19
|
+
*
|
|
20
|
+
* **Features:**
|
|
21
|
+
* - Theme-aware sizing via font sizes
|
|
22
|
+
* - Color and fill support from theme
|
|
23
|
+
* - Optional background with padding and border radius
|
|
24
|
+
* - Transition animation on color changes
|
|
25
|
+
*
|
|
26
|
+
* **Usage:**
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { SomeIcon } from 'some-icon-library'
|
|
29
|
+
*
|
|
30
|
+
* <Icon size="md" color="primary">
|
|
31
|
+
* <SomeIcon />
|
|
32
|
+
* </Icon>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* **With background:**
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Icon
|
|
38
|
+
* size="lg"
|
|
39
|
+
* color="onPrimary"
|
|
40
|
+
* backgroundColor="primary"
|
|
41
|
+
* padding="sm"
|
|
42
|
+
* borderRadius="full"
|
|
43
|
+
* >
|
|
44
|
+
* <SomeIcon />
|
|
45
|
+
* </Icon>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare const Icon: FC<IconProps>;
|
|
49
|
+
|
|
50
|
+
type TextVariants = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'label';
|
|
51
|
+
type TextVariantStyle = {
|
|
52
|
+
tag: TextVariants;
|
|
53
|
+
fontSize: string;
|
|
54
|
+
fontWeight: number;
|
|
55
|
+
lineHeight: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type TextProps = PropsWithChildren<{
|
|
59
|
+
/** Text variant that determines the HTML tag and default styling */
|
|
60
|
+
variant?: TextVariants;
|
|
61
|
+
/** Text color from theme */
|
|
62
|
+
color?: keyof Theme['colors'];
|
|
63
|
+
/** Maximum number of lines before truncation with ellipsis */
|
|
64
|
+
maxLines?: number;
|
|
65
|
+
/** Add underline text decoration */
|
|
66
|
+
underline?: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Text component - Renders semantic HTML elements based on variant
|
|
71
|
+
*
|
|
72
|
+
* **Variants:**
|
|
73
|
+
* - `h1-h6`: Heading elements with appropriate styling
|
|
74
|
+
* - `p`: Paragraph element with relaxed line height
|
|
75
|
+
* - `span`: Inline text element (default)
|
|
76
|
+
* - `label`: Label element with medium font weight
|
|
77
|
+
*
|
|
78
|
+
* **Features:**
|
|
79
|
+
* - Automatic HTML tag selection based on variant
|
|
80
|
+
* - Theme-aware colors
|
|
81
|
+
* - Text truncation with `maxLines`
|
|
82
|
+
* - Underline support
|
|
83
|
+
*/
|
|
84
|
+
declare const Text: FC<TextProps>;
|
|
85
|
+
|
|
86
|
+
type ButtonVariants = 'contained' | 'outlined' | 'text';
|
|
87
|
+
type ButtonVariantStyle = {
|
|
88
|
+
default: {
|
|
89
|
+
backgroundColor: string;
|
|
90
|
+
color: string;
|
|
91
|
+
border: string;
|
|
92
|
+
};
|
|
93
|
+
hover: {
|
|
94
|
+
backgroundColor: string;
|
|
95
|
+
};
|
|
96
|
+
pressed: {
|
|
97
|
+
backgroundColor: string;
|
|
98
|
+
};
|
|
99
|
+
disabled: {
|
|
100
|
+
color: string;
|
|
101
|
+
cursor: string;
|
|
102
|
+
backgroundColor: string;
|
|
103
|
+
borderColor?: string;
|
|
104
|
+
};
|
|
105
|
+
textColor: keyof Theme['colors'];
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
type ButtonProps = {
|
|
109
|
+
/** Button text label */
|
|
110
|
+
label: string;
|
|
111
|
+
/** Optional icon to display before label */
|
|
112
|
+
startIcon?: ReactNode;
|
|
113
|
+
/** Optional icon to display after label */
|
|
114
|
+
endIcon?: ReactNode;
|
|
115
|
+
/** Click handler */
|
|
116
|
+
onClick?: () => void;
|
|
117
|
+
/** Visual variant of the button */
|
|
118
|
+
variant?: ButtonVariants;
|
|
119
|
+
/** Button type attribute */
|
|
120
|
+
type?: 'button' | 'submit';
|
|
121
|
+
/** Active/pressed state */
|
|
122
|
+
active?: boolean;
|
|
123
|
+
/** Disabled state */
|
|
124
|
+
disabled?: boolean;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Button component
|
|
129
|
+
*
|
|
130
|
+
* **Variants:**
|
|
131
|
+
* - `contained`: Solid background button (default)
|
|
132
|
+
* - `outlined`: Border only button
|
|
133
|
+
* - `text`: Text only button without background
|
|
134
|
+
*/
|
|
135
|
+
declare const Button: FC<ButtonProps>;
|
|
136
|
+
|
|
137
|
+
/** Stack wrap options */
|
|
138
|
+
type StackWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
139
|
+
/** Stack justify options */
|
|
140
|
+
type StackJustify = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
141
|
+
/** Stack alignment options */
|
|
142
|
+
type StackAlign = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
143
|
+
type StackDirection = 'row' | 'column';
|
|
144
|
+
|
|
145
|
+
/** Card direction - reuses StackDirection */
|
|
146
|
+
type CardDirection = StackDirection;
|
|
147
|
+
|
|
148
|
+
type IconButtonProps = {
|
|
149
|
+
/** IconButton icon */
|
|
150
|
+
icon?: ReactNode;
|
|
151
|
+
/** Click handler */
|
|
152
|
+
onClick?: () => void;
|
|
153
|
+
/** Visual variant of the button */
|
|
154
|
+
variant?: ButtonVariants;
|
|
155
|
+
/** Button type attribute */
|
|
156
|
+
type?: 'button' | 'submit';
|
|
157
|
+
/** Active/pressed state */
|
|
158
|
+
active?: boolean;
|
|
159
|
+
/** Disabled state */
|
|
160
|
+
disabled?: boolean;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
declare const IconButton: FC<IconButtonProps>;
|
|
164
|
+
|
|
165
|
+
type StackProps = {
|
|
166
|
+
/** Stack children elements */
|
|
167
|
+
children: ReactNode;
|
|
168
|
+
/** Flex direction of the stack */
|
|
169
|
+
direction?: StackDirection;
|
|
170
|
+
/** Gap between children (theme spacing or CSS value) */
|
|
171
|
+
gap?: keyof Theme['spacing'];
|
|
172
|
+
/** Width of the stack container */
|
|
173
|
+
width?: CSSProperties['width'];
|
|
174
|
+
/** Height of the stack container */
|
|
175
|
+
height?: CSSProperties['height'];
|
|
176
|
+
/** Alignment of items on the cross axis */
|
|
177
|
+
align?: StackAlign;
|
|
178
|
+
/** Justification of items on the main axis */
|
|
179
|
+
justify?: StackJustify;
|
|
180
|
+
/** Whether items should wrap */
|
|
181
|
+
wrap?: StackWrap;
|
|
182
|
+
/** Padding inside the stack */
|
|
183
|
+
padding?: keyof Theme['spacing'];
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Stack component
|
|
188
|
+
*
|
|
189
|
+
* A flexbox container for laying out children in a row or column.
|
|
190
|
+
*
|
|
191
|
+
* **Direction:**
|
|
192
|
+
* - `row`: Horizontal layout (default)
|
|
193
|
+
* - `column`: Vertical layout
|
|
194
|
+
*/
|
|
195
|
+
declare const Stack: FC<StackProps>;
|
|
196
|
+
|
|
197
|
+
type CardProps = {
|
|
198
|
+
/** Card children elements */
|
|
199
|
+
children: ReactNode;
|
|
200
|
+
/** Flex direction of the card content */
|
|
201
|
+
direction?: CardDirection;
|
|
202
|
+
/** Padding inside the card (theme spacing key) */
|
|
203
|
+
padding?: keyof Theme['spacing'];
|
|
204
|
+
/** Width of the card */
|
|
205
|
+
width?: CSSProperties['width'];
|
|
206
|
+
/** Height of the card */
|
|
207
|
+
height?: CSSProperties['height'];
|
|
208
|
+
/** Gap between children (theme spacing key) */
|
|
209
|
+
gap?: keyof Theme['spacing'];
|
|
210
|
+
/** Border radius of the card */
|
|
211
|
+
radius?: keyof Theme['radius'];
|
|
212
|
+
/** Shadow depth of the card */
|
|
213
|
+
shadow?: keyof Theme['shadows'];
|
|
214
|
+
/** Alignment of items on the cross axis */
|
|
215
|
+
align?: StackAlign;
|
|
216
|
+
/** Justification of items on the main axis */
|
|
217
|
+
justify?: StackJustify;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Card component
|
|
222
|
+
*
|
|
223
|
+
* A container component with a background, border radius, and optional shadow.
|
|
224
|
+
* Uses a Stack layout internally for organizing children.
|
|
225
|
+
*
|
|
226
|
+
* **Direction:**
|
|
227
|
+
* - `column`: Vertical layout (default)
|
|
228
|
+
* - `row`: Horizontal layout
|
|
229
|
+
*/
|
|
230
|
+
declare const Card: FC<CardProps>;
|
|
231
|
+
|
|
232
|
+
export { Button, Card, Icon, IconButton, Stack, Text };
|
|
233
|
+
export type { ButtonProps, ButtonVariantStyle, ButtonVariants, CardDirection, CardProps, IconButtonProps, IconProps, StackAlign, StackDirection, StackJustify, StackProps, StackWrap, TextProps, TextVariantStyle, TextVariants };
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aurora-ds/components",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Aurora Design System - React Components Library",
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "rollup -c",
|
|
14
|
+
"start": "storybook dev -p 6006",
|
|
15
|
+
"build-storybook": "storybook build",
|
|
16
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:watch": "vitest",
|
|
19
|
+
"prepublishOnly": "yarn build"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@aurora-ds/theme": "^1.0.3",
|
|
23
|
+
"react": "^18.0.0",
|
|
24
|
+
"react-dom": "^18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@aurora-ds/theme": "^1.0.3",
|
|
28
|
+
"@babel/core": "^7.23.0",
|
|
29
|
+
"@babel/preset-env": "^7.23.0",
|
|
30
|
+
"@babel/preset-react": "^7.23.0",
|
|
31
|
+
"@babel/preset-typescript": "^7.23.0",
|
|
32
|
+
"@eslint/js": "^9.39.2",
|
|
33
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
34
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
36
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
37
|
+
"@storybook/addon-links": "^10.1.10",
|
|
38
|
+
"@storybook/blocks": "^9.0.0-alpha.17",
|
|
39
|
+
"@storybook/react": "^10.1.10",
|
|
40
|
+
"@storybook/react-vite": "^10.1.10",
|
|
41
|
+
"@types/node": "^25.0.2",
|
|
42
|
+
"@types/react": "^18.2.0",
|
|
43
|
+
"@types/react-dom": "^18.2.0",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
45
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
46
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
47
|
+
"eslint": "^9.0.0",
|
|
48
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
49
|
+
"eslint-plugin-import": "^2.32.0",
|
|
50
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
51
|
+
"eslint-plugin-react": "^7.33.0",
|
|
52
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
53
|
+
"postcss": "^8.5.6",
|
|
54
|
+
"react": "^18.2.0",
|
|
55
|
+
"react-dom": "^18.2.0",
|
|
56
|
+
"rollup": "^4.0.0",
|
|
57
|
+
"rollup-plugin-dts": "^6.0.0",
|
|
58
|
+
"rollup-plugin-postcss": "^4.0.0",
|
|
59
|
+
"storybook": "^10.1.10",
|
|
60
|
+
"typescript": "^5.2.0",
|
|
61
|
+
"vite": "^5.0.0",
|
|
62
|
+
"vitest": "^2.0.0",
|
|
63
|
+
"eslint-plugin-storybook": "10.1.10",
|
|
64
|
+
"@storybook/addon-docs": "^10.1.10"
|
|
65
|
+
},
|
|
66
|
+
"license": "MIT",
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": ""
|
|
70
|
+
},
|
|
71
|
+
"keywords": [
|
|
72
|
+
"react",
|
|
73
|
+
"components",
|
|
74
|
+
"design-system",
|
|
75
|
+
"aurora"
|
|
76
|
+
]
|
|
77
|
+
}
|