@aurora-ds/components 0.19.2 → 0.20.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/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/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/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 +235 -1
- 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 +1 -0
- package/dist/cjs/interfaces/theme.contracts.d.ts +235 -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/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/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/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/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 +235 -2
- 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 +1 -0
- package/dist/esm/interfaces/theme.contracts.d.ts +235 -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/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 +420 -108
- package/package.json +4 -5
|
@@ -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
|
};
|
|
@@ -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,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
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { CSSProperties, PropsWithChildren } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
export type PageSectionProps = PropsWithChildren<{
|
|
4
4
|
/** Gap between child elements */
|
|
5
|
-
gap?: keyof
|
|
5
|
+
gap?: keyof ThemeContract['spacing'];
|
|
6
6
|
/** Horizontal padding around the section */
|
|
7
|
-
paddingHorizontal?: keyof
|
|
7
|
+
paddingHorizontal?: keyof ThemeContract['spacing'];
|
|
8
8
|
/** Vertical padding around the section */
|
|
9
|
-
paddingVertical?: keyof
|
|
9
|
+
paddingVertical?: keyof ThemeContract['spacing'];
|
|
10
10
|
/** Alignment of items within the section */
|
|
11
11
|
alignItems?: CSSProperties['alignItems'];
|
|
12
12
|
/** Maximum width of the section */
|
|
@@ -25,9 +25,9 @@ export type PageSectionProps = PropsWithChildren<{
|
|
|
25
25
|
tabIndex?: number;
|
|
26
26
|
}>;
|
|
27
27
|
export type PageSectionStyleParams = {
|
|
28
|
-
gap?: keyof
|
|
29
|
-
paddingHorizontal?: keyof
|
|
30
|
-
paddingVertical?: keyof
|
|
28
|
+
gap?: keyof ThemeContract['spacing'];
|
|
29
|
+
paddingHorizontal?: keyof ThemeContract['spacing'];
|
|
30
|
+
paddingVertical?: keyof ThemeContract['spacing'];
|
|
31
31
|
alignItems?: CSSProperties['alignItems'];
|
|
32
32
|
maxWidth?: CSSProperties['maxWidth'];
|
|
33
33
|
minHeight?: CSSProperties['minHeight'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThemeContract } from '@/interfaces';
|
|
2
2
|
export type SeparatorProps = {
|
|
3
3
|
/** Direction of the separator */
|
|
4
4
|
direction?: 'horizontal' | 'vertical';
|
|
@@ -7,11 +7,11 @@ export type SeparatorProps = {
|
|
|
7
7
|
/** Custom height (overrides default) */
|
|
8
8
|
height?: string | number;
|
|
9
9
|
/** Custom color (overrides default) */
|
|
10
|
-
color?: keyof
|
|
10
|
+
color?: keyof ThemeContract['colors'];
|
|
11
11
|
};
|
|
12
12
|
export type SeparatorStyleParams = {
|
|
13
13
|
direction?: 'horizontal' | 'vertical';
|
|
14
|
-
color?: keyof
|
|
14
|
+
color?: keyof ThemeContract['colors'];
|
|
15
15
|
width?: string | number;
|
|
16
16
|
height?: string | number;
|
|
17
17
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
export type StackProps = {
|
|
4
4
|
/** Stack children elements */
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
/** Flex direction of the stack */
|
|
7
7
|
direction?: CSSProperties['flexDirection'];
|
|
8
8
|
/** Gap between children (theme spacing or CSS value) */
|
|
9
|
-
gap?: keyof
|
|
9
|
+
gap?: keyof ThemeContract['spacing'];
|
|
10
10
|
/** Width of the stack container */
|
|
11
11
|
width?: CSSProperties['width'];
|
|
12
12
|
/** Height of the stack container */
|
|
@@ -18,7 +18,7 @@ export type StackProps = {
|
|
|
18
18
|
/** Whether items should wrap */
|
|
19
19
|
wrap?: CSSProperties['flexWrap'];
|
|
20
20
|
/** Padding inside the stack */
|
|
21
|
-
padding?: keyof
|
|
21
|
+
padding?: keyof ThemeContract['spacing'];
|
|
22
22
|
/** Accessibility label for screen readers */
|
|
23
23
|
ariaLabel?: string;
|
|
24
24
|
/** ID of element that labels this stack */
|
|
@@ -32,11 +32,11 @@ export type StackProps = {
|
|
|
32
32
|
};
|
|
33
33
|
export type StackStyleParams = {
|
|
34
34
|
direction: CSSProperties['flexDirection'];
|
|
35
|
-
gap?: keyof
|
|
35
|
+
gap?: keyof ThemeContract['spacing'];
|
|
36
36
|
width?: CSSProperties['width'];
|
|
37
37
|
height?: CSSProperties['height'];
|
|
38
38
|
align?: CSSProperties['alignItems'];
|
|
39
39
|
justify?: CSSProperties['justifyContent'];
|
|
40
40
|
wrap?: CSSProperties['flexWrap'];
|
|
41
|
-
padding?: keyof
|
|
41
|
+
padding?: keyof ThemeContract['spacing'];
|
|
42
42
|
};
|
|
@@ -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 AccordionProps = {
|
|
4
4
|
/** Title displayed in the accordion header */
|
|
5
5
|
title: string;
|
|
@@ -16,7 +16,7 @@ export type AccordionProps = {
|
|
|
16
16
|
/** Optional icon to display before title */
|
|
17
17
|
icon?: ReactNode;
|
|
18
18
|
/** Optional background color */
|
|
19
|
-
backgroundColor?: keyof
|
|
19
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
20
20
|
/** Optional width */
|
|
21
21
|
width?: CSSProperties['width'];
|
|
22
22
|
/** Padding for the accordion header */
|
|
@@ -40,7 +40,7 @@ export type AccordionStyleParams = {
|
|
|
40
40
|
};
|
|
41
41
|
export type AccordionHeaderStyleParams = {
|
|
42
42
|
disabled: boolean;
|
|
43
|
-
backgroundColor?: keyof
|
|
43
|
+
backgroundColor?: keyof ThemeContract['colors'];
|
|
44
44
|
headerPadding?: CSSProperties['padding'];
|
|
45
45
|
};
|
|
46
46
|
export type AccordionContentStyleParams = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Theme } from '@aurora-ds/theme';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ThemeContract } from '@/interfaces';
|
|
3
3
|
export type MenuItemProps = {
|
|
4
4
|
label: string;
|
|
5
5
|
icon?: ReactNode;
|
|
6
6
|
onClick: () => void;
|
|
7
|
-
textColor?: keyof
|
|
8
|
-
iconColor?: keyof
|
|
7
|
+
textColor?: keyof ThemeContract['colors'];
|
|
8
|
+
iconColor?: keyof ThemeContract['colors'];
|
|
9
9
|
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export * from '@components/index';
|
|
2
2
|
export * from '@hooks/index';
|
|
3
|
+
export { defaultTheme } from '@/theme/defaultTheme';
|
|
4
|
+
export type { Theme } from '@/theme/theme.types';
|
|
5
|
+
export type { ThemeContract, ThemeColorContract, ThemeSpacingContract, ThemeRadiusContract, ThemeFontSizeContract, ThemeFontWeightContract, ThemeLineHeightContract, ThemeOpacityContract, ThemeShadowsContract, ThemeTransitionContract, ThemeBreakpointsContract, ThemeZIndexContract, } from '@interfaces/theme.contracts';
|
|
3
6
|
import '@styles/globals.css';
|
package/dist/esm/index.js
CHANGED
|
@@ -2369,7 +2369,7 @@ const Modal = ({ isOpen, onClose, label, children, isForm, action }) => {
|
|
|
2369
2369
|
}
|
|
2370
2370
|
};
|
|
2371
2371
|
// body of the modal
|
|
2372
|
-
const body = (jsxs(Fragment$1, { children: [jsxs(Stack, { justify: 'space-between', height: BUTTON_SIZE, width: '100%', children: [jsx(Text, { variant: 'h3', children: label }), !action && (jsx(IconButton, { icon: jsx(CloseIcon, {}), onClick: onClose, size: 'small', variant: 'text', textColor: 'text' }))] }), children, action && (jsxs(Stack, { justify: 'flex-end', width: '100%', children: [jsx(Button, { label: 'Cancel', onClick: onClose, variant: 'outlined' }), jsx(Button, { ...action, type: isForm ? 'submit' : 'button' })] }))] }));
|
|
2372
|
+
const body = (jsxs(Fragment$1, { children: [jsxs(Stack, { justify: 'space-between', height: BUTTON_SIZE, width: '100%', children: [jsx(Text, { variant: 'h3', children: label }), !action && (jsx(IconButton, { icon: jsx(CloseIcon, {}), onClick: onClose, size: 'small', variant: 'text', textColor: 'text' }))] }), children, action && (jsxs(Stack, { justify: 'flex-end', width: '100%', children: [jsx(Button, { label: 'Cancel', onClick: onClose, variant: 'outlined' }), jsx(Button, { ...action, type: isForm ? 'submit' : 'button', onClick: isForm ? undefined : action.onClick })] }))] }));
|
|
2373
2373
|
return createPortal(jsx(Fragment, { children: isVisible ? (jsx("div", { className: MODAL_STYLES.background(isFadingIn), ref: modalRef, children: jsx("div", { className: MODAL_STYLES.content(isFadingIn), children: isForm ? (jsx(Form, { onSubmit: (e) => { e.preventDefault(); safeInvokeAction(); }, children: body })) : (jsx(Fragment, { children: body })) }) })) : null }), document.body);
|
|
2374
2374
|
};
|
|
2375
2375
|
Modal.displayName = 'Modal';
|
|
@@ -2971,5 +2971,238 @@ const useAlert = () => {
|
|
|
2971
2971
|
return context;
|
|
2972
2972
|
};
|
|
2973
2973
|
|
|
2974
|
-
|
|
2974
|
+
/**
|
|
2975
|
+
* Default breakpoint tokens
|
|
2976
|
+
*/
|
|
2977
|
+
const themeBreakpoints = {
|
|
2978
|
+
xs: '480px', // Extra small devices (phones in landscape)
|
|
2979
|
+
sm: '640px', // Small devices (large phones, small tablets)
|
|
2980
|
+
md: '768px', // Medium devices (tablets)
|
|
2981
|
+
lg: '1024px', // Large devices (desktops)
|
|
2982
|
+
xl: '1280px', // Extra large devices (large desktops)
|
|
2983
|
+
'2xl': '1536px', // Extra extra large devices (wide screens)
|
|
2984
|
+
};
|
|
2985
|
+
|
|
2986
|
+
/**
|
|
2987
|
+
* Default color tokens
|
|
2988
|
+
* Uses color scales from @aurora-ds/theme
|
|
2989
|
+
*/
|
|
2990
|
+
const themeColors = {
|
|
2991
|
+
// Surface colors
|
|
2992
|
+
background: colors.slate[25],
|
|
2993
|
+
surface: colors.white,
|
|
2994
|
+
surfaceHover: colors.slate[100],
|
|
2995
|
+
surfaceActive: colors.slate[200],
|
|
2996
|
+
// Text colors
|
|
2997
|
+
text: colors.slate[800],
|
|
2998
|
+
textSecondary: colors.slate[500],
|
|
2999
|
+
textTertiary: colors.slate[400],
|
|
3000
|
+
// Primary colors (Indigo)
|
|
3001
|
+
primary: colors.indigo[600],
|
|
3002
|
+
primaryHover: colors.indigo[700],
|
|
3003
|
+
primaryActive: colors.indigo[800],
|
|
3004
|
+
primarySubtle: colors.indigo[50],
|
|
3005
|
+
primaryDisabled: colors.indigo[300],
|
|
3006
|
+
onPrimary: colors.white,
|
|
3007
|
+
// Secondary colors (Slate)
|
|
3008
|
+
secondary: colors.slate[100],
|
|
3009
|
+
secondaryHover: colors.slate[200],
|
|
3010
|
+
secondaryActive: colors.slate[300],
|
|
3011
|
+
secondarySubtle: colors.slate[50],
|
|
3012
|
+
secondaryDisabled: colors.slate[200],
|
|
3013
|
+
onSecondary: colors.slate[700],
|
|
3014
|
+
// Border colors
|
|
3015
|
+
border: colors.slate[200],
|
|
3016
|
+
// Disabled state
|
|
3017
|
+
disabledText: colors.slate[400],
|
|
3018
|
+
disabled: colors.slate[300],
|
|
3019
|
+
// Semantic colors - Success (Emerald)
|
|
3020
|
+
success: colors.emerald[600],
|
|
3021
|
+
successSubtle: colors.emerald[50],
|
|
3022
|
+
// Semantic colors - Warning (Amber)
|
|
3023
|
+
warning: colors.amber[500],
|
|
3024
|
+
warningSubtle: colors.amber[50],
|
|
3025
|
+
// Semantic colors - Error (Red)
|
|
3026
|
+
error: colors.red[600],
|
|
3027
|
+
errorHover: colors.red[700],
|
|
3028
|
+
errorSubtle: colors.red[50],
|
|
3029
|
+
onError: colors.white,
|
|
3030
|
+
// Semantic colors - Info (Blue)
|
|
3031
|
+
info: colors.blue[600],
|
|
3032
|
+
infoSubtle: colors.blue[50],
|
|
3033
|
+
// Semantic colors - Highlight (Orange)
|
|
3034
|
+
highlight: colors.orange[500],
|
|
3035
|
+
highlightSubtle: colors.orange[100],
|
|
3036
|
+
// Semantic colors - Accent (Purple)
|
|
3037
|
+
accent: colors.purple[500],
|
|
3038
|
+
accentSubtle: colors.purple[100],
|
|
3039
|
+
// Link colors (Indigo)
|
|
3040
|
+
link: colors.indigo[600],
|
|
3041
|
+
linkHover: colors.indigo[700],
|
|
3042
|
+
linkActive: colors.indigo[800],
|
|
3043
|
+
linkDisabled: colors.indigo[300],
|
|
3044
|
+
};
|
|
3045
|
+
|
|
3046
|
+
/**
|
|
3047
|
+
* Default font size tokens
|
|
3048
|
+
*/
|
|
3049
|
+
const themeFontSize = {
|
|
3050
|
+
'2xs': '0.625rem', // 10px
|
|
3051
|
+
xs: '0.75rem', // 12px
|
|
3052
|
+
sm: '0.875rem', // 14px
|
|
3053
|
+
md: '1rem', // 16px
|
|
3054
|
+
lg: '1.25rem', // 20px
|
|
3055
|
+
xl: '1.5rem', // 24px
|
|
3056
|
+
'2xl': '2rem', // 32px
|
|
3057
|
+
'3xl': '2.5rem', // 40px
|
|
3058
|
+
'4xl': '3rem', // 48px
|
|
3059
|
+
'5xl': '4rem', // 64px
|
|
3060
|
+
};
|
|
3061
|
+
|
|
3062
|
+
/**
|
|
3063
|
+
* Default font weight tokens
|
|
3064
|
+
*/
|
|
3065
|
+
const themeFontWeight = {
|
|
3066
|
+
light: 300,
|
|
3067
|
+
regular: 400,
|
|
3068
|
+
medium: 500,
|
|
3069
|
+
semibold: 600,
|
|
3070
|
+
bold: 700,
|
|
3071
|
+
};
|
|
3072
|
+
|
|
3073
|
+
/**
|
|
3074
|
+
* Default line height tokens
|
|
3075
|
+
*/
|
|
3076
|
+
const themeLineHeight = {
|
|
3077
|
+
none: 1,
|
|
3078
|
+
tight: 1.25,
|
|
3079
|
+
normal: 1.5,
|
|
3080
|
+
relaxed: 1.75,
|
|
3081
|
+
loose: 2,
|
|
3082
|
+
};
|
|
3083
|
+
|
|
3084
|
+
/**
|
|
3085
|
+
* Default opacity tokens
|
|
3086
|
+
*/
|
|
3087
|
+
const themeOpacity = {
|
|
3088
|
+
none: 0,
|
|
3089
|
+
lowest: 0.05,
|
|
3090
|
+
low: 0.1,
|
|
3091
|
+
medium: 0.25,
|
|
3092
|
+
high: 0.5,
|
|
3093
|
+
higher: 0.75,
|
|
3094
|
+
full: 1,
|
|
3095
|
+
};
|
|
3096
|
+
|
|
3097
|
+
/**
|
|
3098
|
+
* Default border radius tokens
|
|
3099
|
+
*/
|
|
3100
|
+
const themeRadius = {
|
|
3101
|
+
none: '0',
|
|
3102
|
+
xs: '0.125rem', // 2px
|
|
3103
|
+
sm: '0.25rem', // 4px
|
|
3104
|
+
md: '0.375rem', // 6px
|
|
3105
|
+
lg: '0.5rem', // 8px
|
|
3106
|
+
xl: '0.75rem', // 12px
|
|
3107
|
+
'2xl': '1rem', // 16px
|
|
3108
|
+
full: '9999px',
|
|
3109
|
+
};
|
|
3110
|
+
|
|
3111
|
+
/**
|
|
3112
|
+
* Default shadow tokens
|
|
3113
|
+
*/
|
|
3114
|
+
const themeShadows = {
|
|
3115
|
+
none: 'none',
|
|
3116
|
+
xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
|
|
3117
|
+
sm: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',
|
|
3118
|
+
md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
|
|
3119
|
+
lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
|
|
3120
|
+
xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
|
|
3121
|
+
'2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',
|
|
3122
|
+
inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
|
|
3123
|
+
focus: '0 0 0 3px rgb(99 102 241 / 0.4)',
|
|
3124
|
+
};
|
|
3125
|
+
|
|
3126
|
+
/**
|
|
3127
|
+
* Default spacing tokens
|
|
3128
|
+
*/
|
|
3129
|
+
const themeSpacing = {
|
|
3130
|
+
none: '0',
|
|
3131
|
+
'2xs': '0.125rem', // 2px
|
|
3132
|
+
xs: '0.25rem', // 4px
|
|
3133
|
+
sm: '0.5rem', // 8px
|
|
3134
|
+
md: '1rem', // 16px
|
|
3135
|
+
lg: '1.5rem', // 24px
|
|
3136
|
+
xl: '2rem', // 32px
|
|
3137
|
+
'2xl': '3rem', // 48px
|
|
3138
|
+
'3xl': '4rem', // 64px
|
|
3139
|
+
'4xl': '6rem', // 96px
|
|
3140
|
+
'5xl': '8rem', // 128px
|
|
3141
|
+
};
|
|
3142
|
+
|
|
3143
|
+
/**
|
|
3144
|
+
* Default transition tokens
|
|
3145
|
+
*/
|
|
3146
|
+
const themeTransition = {
|
|
3147
|
+
fast: '150ms ease-out',
|
|
3148
|
+
normal: '250ms ease-out',
|
|
3149
|
+
slow: '350ms ease-out',
|
|
3150
|
+
};
|
|
3151
|
+
|
|
3152
|
+
/**
|
|
3153
|
+
* Default z-index tokens
|
|
3154
|
+
*/
|
|
3155
|
+
const themeZIndex = {
|
|
3156
|
+
behind: -1,
|
|
3157
|
+
base: 0,
|
|
3158
|
+
dropdown: 1000,
|
|
3159
|
+
sticky: 1100,
|
|
3160
|
+
overlay: 1300,
|
|
3161
|
+
modal: 1400,
|
|
3162
|
+
popover: 1500,
|
|
3163
|
+
tooltip: 1600,
|
|
3164
|
+
toast: 1700,
|
|
3165
|
+
};
|
|
3166
|
+
|
|
3167
|
+
/**
|
|
3168
|
+
* Default theme for aurora-ds-components
|
|
3169
|
+
*
|
|
3170
|
+
* This theme is used by default if no custom theme is provided.
|
|
3171
|
+
* You can override it by passing your own theme to ThemeProvider:
|
|
3172
|
+
*
|
|
3173
|
+
* @example
|
|
3174
|
+
* ```tsx
|
|
3175
|
+
* import { ThemeProvider } from '@aurora-ds/theme'
|
|
3176
|
+
* import { defaultTheme } from '@aurora-ds/components'
|
|
3177
|
+
*
|
|
3178
|
+
* // Use default theme
|
|
3179
|
+
* <ThemeProvider theme={defaultTheme}>
|
|
3180
|
+
* <App />
|
|
3181
|
+
* </ThemeProvider>
|
|
3182
|
+
*
|
|
3183
|
+
* // Or extend/override it
|
|
3184
|
+
* const myTheme = {
|
|
3185
|
+
* ...defaultTheme,
|
|
3186
|
+
* colors: {
|
|
3187
|
+
* ...defaultTheme.colors,
|
|
3188
|
+
* primary: '#FF0000', // Override primary color
|
|
3189
|
+
* }
|
|
3190
|
+
* }
|
|
3191
|
+
* ```
|
|
3192
|
+
*/
|
|
3193
|
+
const defaultTheme = {
|
|
3194
|
+
colors: themeColors,
|
|
3195
|
+
spacing: themeSpacing,
|
|
3196
|
+
radius: themeRadius,
|
|
3197
|
+
shadows: themeShadows,
|
|
3198
|
+
fontSize: themeFontSize,
|
|
3199
|
+
fontWeight: themeFontWeight,
|
|
3200
|
+
lineHeight: themeLineHeight,
|
|
3201
|
+
zIndex: themeZIndex,
|
|
3202
|
+
transition: themeTransition,
|
|
3203
|
+
opacity: themeOpacity,
|
|
3204
|
+
breakpoints: themeBreakpoints,
|
|
3205
|
+
};
|
|
3206
|
+
|
|
3207
|
+
export { Accordion, Alert, AlertProvider, Avatar, AvatarGroup, Breadcrumb, BreadcrumbEllipsis, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Chip, DatePicker_default as DatePicker, DrawerItem, Form, Grid, Icon, IconButton, Input_default as Input, Menu, MenuGroup, MenuItem, Modal, Page, PageSection, Pagination, Select, Separator, Skeleton, Stack, TabItem, Tabs, Text, TextArea_default as TextArea, defaultTheme, useAlert, useAnchorPosition, useClickOutside, useTransitionRender };
|
|
2975
3208
|
//# sourceMappingURL=index.js.map
|