@saas-ui/react 3.0.0-next.37 → 3.0.0-next.39
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/dist/.tsbuildinfo.json +1 -1
- package/dist/components/accordion/accordion.recipe.js +2 -2
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/editable/editable.recipe.js +7 -1
- package/dist/components/editable/index.d.ts +1 -1
- package/dist/components/editable/index.js +1 -1
- package/dist/components/heading/heading.recipe.d.ts +33 -11
- package/dist/components/heading/heading.recipe.js +55 -11
- package/dist/components/menu/menu.recipe.d.ts +7 -6
- package/dist/components/menu/menu.recipe.js +12 -11
- package/dist/components/navbar/navbar.d.ts +2 -1
- package/dist/components/navbar/navbar.js +2 -1
- package/dist/components/navbar/navbar.recipe.d.ts +14 -2
- package/dist/components/navbar/navbar.recipe.js +22 -3
- package/dist/components/persona/index.d.ts +1 -2
- package/dist/components/persona/index.js +1 -1
- package/dist/components/persona/persona-composed.d.ts +63 -0
- package/dist/components/persona/persona-composed.js +19 -0
- package/dist/components/persona/persona.context.d.ts +9 -1
- package/dist/components/persona/persona.context.js +1 -1
- package/dist/components/persona/persona.d.ts +61 -47
- package/dist/components/persona/persona.js +62 -13
- package/dist/components/radio/radiomark.recipe.js +1 -0
- package/dist/components/sidebar/sidebar-nav-item.recipe.js +3 -0
- package/dist/components/skeleton/skeleton.recipe.d.ts +1 -0
- package/dist/components/skeleton/skeleton.recipe.js +1 -0
- package/dist/components/switch/switch.recipe.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/theme/global-css.js +0 -4
- package/dist/theme/layer-styles.js +1 -1
- package/dist/theme/recipes.d.ts +34 -11
- package/dist/theme/semantic-tokens/colors.js +2 -2
- package/dist/theme/semantic-tokens/shadows.d.ts +6 -0
- package/dist/theme/semantic-tokens/shadows.js +6 -0
- package/dist/theme/slot-recipes.d.ts +21 -8
- package/dist/theme/text-styles.js +59 -15
- package/dist/theme/tokens/letter-spacing.d.ts +39 -0
- package/dist/theme/tokens/letter-spacing.js +18 -5
- package/dist/theme/tokens/line-heights.d.ts +49 -13
- package/dist/theme/tokens/line-heights.js +25 -13
- package/package.json +2 -2
- package/dist/components/persona/persona-primitive.d.ts +0 -77
- package/dist/components/persona/persona-primitive.js +0 -58
@@ -1419,7 +1419,7 @@ export declare const slotRecipes: {
|
|
1419
1419
|
subtle: {
|
1420
1420
|
item: {
|
1421
1421
|
_highlighted: {
|
1422
|
-
bg: "bg.
|
1422
|
+
bg: "bg.emphasized";
|
1423
1423
|
};
|
1424
1424
|
};
|
1425
1425
|
};
|
@@ -1436,18 +1436,19 @@ export declare const slotRecipes: {
|
|
1436
1436
|
sm: {
|
1437
1437
|
content: {
|
1438
1438
|
minW: "8rem";
|
1439
|
-
padding: "
|
1439
|
+
padding: "1";
|
1440
|
+
borderRadius: "panel.md";
|
1440
1441
|
};
|
1441
1442
|
item: {
|
1442
1443
|
gap: "1";
|
1443
1444
|
textStyle: "xs";
|
1444
|
-
|
1445
|
+
minH: "6";
|
1445
1446
|
px: "1.5";
|
1446
1447
|
ps: "var(--menu-item-inset, {sizes.1.5})";
|
1447
1448
|
};
|
1448
1449
|
itemGroupLabel: {
|
1449
1450
|
textStyle: "xs";
|
1450
|
-
|
1451
|
+
minH: "6";
|
1451
1452
|
px: "1.5";
|
1452
1453
|
};
|
1453
1454
|
};
|
@@ -1459,13 +1460,13 @@ export declare const slotRecipes: {
|
|
1459
1460
|
item: {
|
1460
1461
|
gap: "2";
|
1461
1462
|
textStyle: "sm";
|
1462
|
-
|
1463
|
+
minH: "7";
|
1463
1464
|
px: "2";
|
1464
1465
|
ps: "var(--menu-item-inset, {sizes.2})";
|
1465
1466
|
};
|
1466
1467
|
itemGroupLabel: {
|
1467
1468
|
textStyle: "sm";
|
1468
|
-
|
1469
|
+
minH: "7";
|
1469
1470
|
px: "2";
|
1470
1471
|
};
|
1471
1472
|
};
|
@@ -3700,7 +3701,7 @@ export declare const slotRecipes: {
|
|
3700
3701
|
};
|
3701
3702
|
};
|
3702
3703
|
}>;
|
3703
|
-
suiNavbar: import("@chakra-ui/react").SlotRecipeDefinition<"content" | "link" | "root" | "item" | "brand", {
|
3704
|
+
suiNavbar: import("@chakra-ui/react").SlotRecipeDefinition<"content" | "link" | "root" | "item" | "itemGroup" | "brand", {
|
3704
3705
|
variant: {
|
3705
3706
|
neutral: {
|
3706
3707
|
root: {
|
@@ -3710,9 +3711,21 @@ export declare const slotRecipes: {
|
|
3710
3711
|
};
|
3711
3712
|
solid: {
|
3712
3713
|
root: {
|
3713
|
-
bg: "colorPalette.
|
3714
|
+
bg: "colorPalette.solid";
|
3714
3715
|
color: "colorPalette.contrast";
|
3715
3716
|
};
|
3717
|
+
link: {
|
3718
|
+
_hover: {
|
3719
|
+
bg: "colorPalette.contrast/10";
|
3720
|
+
};
|
3721
|
+
};
|
3722
|
+
};
|
3723
|
+
glass: {
|
3724
|
+
root: {
|
3725
|
+
bg: "bg.overlay";
|
3726
|
+
backdropFilter: "var(--overlay-effect)";
|
3727
|
+
color: "fg";
|
3728
|
+
};
|
3716
3729
|
};
|
3717
3730
|
};
|
3718
3731
|
size: {
|
@@ -1,35 +1,79 @@
|
|
1
1
|
import { defineTextStyles } from '@chakra-ui/react';
|
2
2
|
export const textStyles = defineTextStyles({
|
3
|
-
'2xs': {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
'2xs': {
|
4
|
+
value: {
|
5
|
+
fontSize: '2xs',
|
6
|
+
lineHeight: '2xs',
|
7
|
+
},
|
8
|
+
},
|
9
|
+
xs: {
|
10
|
+
value: {
|
11
|
+
fontSize: 'xs',
|
12
|
+
lineHeight: 'xs',
|
13
|
+
},
|
14
|
+
},
|
15
|
+
sm: {
|
16
|
+
value: {
|
17
|
+
fontSize: 'sm',
|
18
|
+
lineHeight: 'sm',
|
19
|
+
},
|
20
|
+
},
|
21
|
+
md: {
|
22
|
+
value: {
|
23
|
+
fontSize: 'md',
|
24
|
+
lineHeight: 'md',
|
25
|
+
},
|
26
|
+
},
|
27
|
+
lg: {
|
28
|
+
value: {
|
29
|
+
fontSize: 'lg',
|
30
|
+
lineHeight: 'lg',
|
31
|
+
},
|
32
|
+
},
|
33
|
+
xl: {
|
34
|
+
value: {
|
35
|
+
fontSize: 'xl',
|
36
|
+
lineHeight: 'xl',
|
37
|
+
},
|
38
|
+
},
|
39
|
+
'2xl': {
|
40
|
+
value: {
|
41
|
+
fontSize: '2xl',
|
42
|
+
lineHeight: '2xl',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
'3xl': {
|
46
|
+
value: {
|
47
|
+
fontSize: '3xl',
|
48
|
+
lineHeight: '3xl',
|
49
|
+
},
|
50
|
+
},
|
11
51
|
'4xl': {
|
12
52
|
value: {
|
13
53
|
fontSize: '4xl',
|
14
|
-
lineHeight: '
|
15
|
-
letterSpacing: '
|
54
|
+
lineHeight: '4xl',
|
55
|
+
letterSpacing: 'tight',
|
16
56
|
},
|
17
57
|
},
|
18
58
|
'5xl': {
|
19
59
|
value: {
|
20
60
|
fontSize: '5xl',
|
21
|
-
lineHeight: '
|
22
|
-
letterSpacing: '
|
61
|
+
lineHeight: '5xl',
|
62
|
+
letterSpacing: 'tight',
|
23
63
|
},
|
24
64
|
},
|
25
65
|
'6xl': {
|
26
|
-
value: {
|
66
|
+
value: {
|
67
|
+
fontSize: '6xl',
|
68
|
+
lineHeight: '6xl',
|
69
|
+
letterSpacing: 'tighter',
|
70
|
+
},
|
27
71
|
},
|
28
72
|
'7xl': {
|
29
73
|
value: {
|
30
74
|
fontSize: '7xl',
|
31
|
-
lineHeight: '
|
32
|
-
letterSpacing: '
|
75
|
+
lineHeight: '7xl',
|
76
|
+
letterSpacing: 'tightest',
|
33
77
|
},
|
34
78
|
},
|
35
79
|
none: {
|
@@ -1,10 +1,16 @@
|
|
1
1
|
export declare const letterSpacings: {
|
2
|
+
tightest: {
|
3
|
+
value: string;
|
4
|
+
};
|
2
5
|
tighter: {
|
3
6
|
value: string;
|
4
7
|
};
|
5
8
|
tight: {
|
6
9
|
value: string;
|
7
10
|
};
|
11
|
+
normal: {
|
12
|
+
value: string;
|
13
|
+
};
|
8
14
|
wide: {
|
9
15
|
value: string;
|
10
16
|
};
|
@@ -14,4 +20,37 @@ export declare const letterSpacings: {
|
|
14
20
|
widest: {
|
15
21
|
value: string;
|
16
22
|
};
|
23
|
+
'heading.xs': {
|
24
|
+
value: string;
|
25
|
+
};
|
26
|
+
'heading.sm': {
|
27
|
+
value: string;
|
28
|
+
};
|
29
|
+
'heading.md': {
|
30
|
+
value: string;
|
31
|
+
};
|
32
|
+
'heading.lg': {
|
33
|
+
value: string;
|
34
|
+
};
|
35
|
+
'heading.xl': {
|
36
|
+
value: string;
|
37
|
+
};
|
38
|
+
'heading.2xl': {
|
39
|
+
value: string;
|
40
|
+
};
|
41
|
+
'heading.3xl': {
|
42
|
+
value: string;
|
43
|
+
};
|
44
|
+
'heading.4xl': {
|
45
|
+
value: string;
|
46
|
+
};
|
47
|
+
'heading.5xl': {
|
48
|
+
value: string;
|
49
|
+
};
|
50
|
+
'heading.6xl': {
|
51
|
+
value: string;
|
52
|
+
};
|
53
|
+
'heading.7xl': {
|
54
|
+
value: string;
|
55
|
+
};
|
17
56
|
};
|
@@ -1,8 +1,21 @@
|
|
1
1
|
import { defineTokens } from '@chakra-ui/react';
|
2
2
|
export const letterSpacings = defineTokens.letterSpacings({
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
tightest: { value: '-0.05em' },
|
4
|
+
tighter: { value: '-0.025em' },
|
5
|
+
tight: { value: '-0.0125em' },
|
6
|
+
normal: { value: '0' },
|
7
|
+
wide: { value: '0.0125em' },
|
8
|
+
wider: { value: '0.025em' },
|
9
|
+
widest: { value: '0.05em' },
|
10
|
+
'heading.xs': { value: '0.0025em' },
|
11
|
+
'heading.sm': { value: '0' },
|
12
|
+
'heading.md': { value: '0' },
|
13
|
+
'heading.lg': { value: '-0.0025em' },
|
14
|
+
'heading.xl': { value: '-0.005' },
|
15
|
+
'heading.2xl': { value: '-0.00625em' },
|
16
|
+
'heading.3xl': { value: '-0.0075em' },
|
17
|
+
'heading.4xl': { value: '-0.01em' },
|
18
|
+
'heading.5xl': { value: '-0.025em' },
|
19
|
+
'heading.6xl': { value: '-0.03em' },
|
20
|
+
'heading.7xl': { value: '-0.035em' },
|
8
21
|
});
|
@@ -1,41 +1,77 @@
|
|
1
1
|
export declare const lineHeights: {
|
2
|
-
|
2
|
+
'2xs': {
|
3
3
|
value: string;
|
4
4
|
};
|
5
|
-
|
5
|
+
xs: {
|
6
6
|
value: string;
|
7
7
|
};
|
8
|
-
|
8
|
+
sm: {
|
9
9
|
value: string;
|
10
10
|
};
|
11
|
-
|
11
|
+
md: {
|
12
12
|
value: string;
|
13
13
|
};
|
14
|
-
|
14
|
+
lg: {
|
15
15
|
value: string;
|
16
16
|
};
|
17
|
-
|
17
|
+
xl: {
|
18
18
|
value: string;
|
19
19
|
};
|
20
|
-
'
|
20
|
+
'2xl': {
|
21
21
|
value: string;
|
22
22
|
};
|
23
|
-
'
|
23
|
+
'3xl': {
|
24
24
|
value: string;
|
25
25
|
};
|
26
|
-
'
|
26
|
+
'4xl': {
|
27
27
|
value: string;
|
28
28
|
};
|
29
|
-
'
|
29
|
+
'5xl': {
|
30
30
|
value: string;
|
31
31
|
};
|
32
|
-
'
|
32
|
+
'6xl': {
|
33
33
|
value: string;
|
34
34
|
};
|
35
|
-
'
|
35
|
+
'7xl': {
|
36
36
|
value: string;
|
37
37
|
};
|
38
|
-
'
|
38
|
+
'8xl': {
|
39
|
+
value: string;
|
40
|
+
};
|
41
|
+
'9xl': {
|
42
|
+
value: string;
|
43
|
+
};
|
44
|
+
'heading.xs': {
|
45
|
+
value: string;
|
46
|
+
};
|
47
|
+
'heading.sm': {
|
48
|
+
value: string;
|
49
|
+
};
|
50
|
+
'heading.md': {
|
51
|
+
value: string;
|
52
|
+
};
|
53
|
+
'heading.lg': {
|
54
|
+
value: string;
|
55
|
+
};
|
56
|
+
'heading.xl': {
|
57
|
+
value: string;
|
58
|
+
};
|
59
|
+
'heading.2xl': {
|
60
|
+
value: string;
|
61
|
+
};
|
62
|
+
'heading.3xl': {
|
63
|
+
value: string;
|
64
|
+
};
|
65
|
+
'heading.4xl': {
|
66
|
+
value: string;
|
67
|
+
};
|
68
|
+
'heading.5xl': {
|
69
|
+
value: string;
|
70
|
+
};
|
71
|
+
'heading.6xl': {
|
72
|
+
value: string;
|
73
|
+
};
|
74
|
+
'heading.7xl': {
|
39
75
|
value: string;
|
40
76
|
};
|
41
77
|
};
|
@@ -1,17 +1,29 @@
|
|
1
1
|
import { defineTokens } from '@chakra-ui/react';
|
2
2
|
import { scaleToken } from "../utils.js";
|
3
3
|
export const lineHeights = defineTokens.lineHeights({
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
'
|
11
|
-
'
|
12
|
-
'
|
13
|
-
'
|
14
|
-
'
|
15
|
-
'
|
16
|
-
'
|
4
|
+
'2xs': { value: scaleToken('0.845rem') }, // 1.25
|
5
|
+
xs: { value: scaleToken('1rem') }, //1.33
|
6
|
+
sm: { value: scaleToken('1.1375rem') }, // 1.4
|
7
|
+
md: { value: scaleToken('1.26rem') }, // 1.44
|
8
|
+
lg: { value: scaleToken('1.5rem') }, // 1.5
|
9
|
+
xl: { value: scaleToken('1.62rem') }, // 1.44
|
10
|
+
'2xl': { value: scaleToken('1.75rem') }, // 1.4
|
11
|
+
'3xl': { value: scaleToken('1.95rem') }, // 1.3
|
12
|
+
'4xl': { value: scaleToken('2.345rem') }, // 1.25
|
13
|
+
'5xl': { value: scaleToken('2.7rem') }, // 1.2
|
14
|
+
'6xl': { value: scaleToken('3.45rem') }, // 1.15
|
15
|
+
'7xl': { value: scaleToken('4.125rem') }, // 1.1
|
16
|
+
'8xl': { value: scaleToken('4.5rem') }, // 1
|
17
|
+
'9xl': { value: scaleToken('6rem') }, // 1
|
18
|
+
'heading.xs': { value: scaleToken('0.95rem') }, // 1.33
|
19
|
+
'heading.sm': { value: scaleToken('1rem') }, // 1.28
|
20
|
+
'heading.md': { value: scaleToken('1.20rem') }, // 1.375
|
21
|
+
'heading.lg': { value: scaleToken('1.33rem') }, // 1.33
|
22
|
+
'heading.xl': { value: scaleToken('1.46rem') }, // 1.3
|
23
|
+
'heading.2xl': { value: scaleToken('1.55rem') }, // 1.25
|
24
|
+
'heading.3xl': { value: scaleToken('1.8rem') }, // 1.2
|
25
|
+
'heading.4xl': { value: scaleToken('2.15rem') }, // 1.15
|
26
|
+
'heading.5xl': { value: scaleToken('2.475rem') }, // 1.1
|
27
|
+
'heading.6xl': { value: scaleToken('3rem') }, // 1
|
28
|
+
'heading.7xl': { value: scaleToken('3.75rem') }, // 1
|
17
29
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@saas-ui/react",
|
3
|
-
"version": "3.0.0-next.
|
3
|
+
"version": "3.0.0-next.39",
|
4
4
|
"description": "Saas UI - The React component library for startups.",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -62,7 +62,7 @@
|
|
62
62
|
"dependencies": {
|
63
63
|
"@ark-ui/react": "^5.9.1",
|
64
64
|
"next-themes": "^0.4.6",
|
65
|
-
"@saas-ui/core": "3.0.0-next.
|
65
|
+
"@saas-ui/core": "3.0.0-next.11",
|
66
66
|
"@saas-ui/hooks": "3.0.0-next.3"
|
67
67
|
},
|
68
68
|
"peerDependencies": {
|
@@ -1,77 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { HTMLChakraProps, type ImageProps, type SlotRecipeProps } from '@chakra-ui/react';
|
3
|
-
import { type AvatarProps } from '../avatar/avatar.tsx';
|
4
|
-
import type { PersonaVariantProps } from './persona.recipe.ts';
|
5
|
-
import type { PersonaPresence } from './presence.ts';
|
6
|
-
interface PersonaRootProps extends HTMLChakraProps<'div'>, SlotRecipeProps<'suiPersona'>, PersonaVariantProps {
|
7
|
-
/**
|
8
|
-
* Indicates that a person is out of office. Changes the presence badge style.
|
9
|
-
*/
|
10
|
-
outOfOffice?: boolean;
|
11
|
-
/**
|
12
|
-
* The presence status of the person
|
13
|
-
*/
|
14
|
-
presence?: PersonaPresence;
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* The root component that provides context and styles.
|
18
|
-
*
|
19
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
20
|
-
*/
|
21
|
-
declare const PersonaRoot: React.ForwardRefExoticComponent<PersonaRootProps & React.RefAttributes<HTMLDivElement>>;
|
22
|
-
interface PersonaAvatarOptions {
|
23
|
-
/**
|
24
|
-
* The name of the person in the avatar.
|
25
|
-
*
|
26
|
-
* - if `src` has loaded, the name will be used as the `alt` attribute of the `img`
|
27
|
-
* - If `src` is not loaded, the name will be used to create the initials
|
28
|
-
*/
|
29
|
-
name?: string;
|
30
|
-
}
|
31
|
-
interface PersonaAvatarProps extends PersonaAvatarOptions, AvatarProps {
|
32
|
-
src?: string;
|
33
|
-
srcSet?: string;
|
34
|
-
loading?: ImageProps['loading'];
|
35
|
-
icon?: React.ReactElement;
|
36
|
-
fallback?: React.ReactNode;
|
37
|
-
getInitials?: (name?: string | null) => string | null;
|
38
|
-
}
|
39
|
-
/**
|
40
|
-
* An avatar with optional status badge.
|
41
|
-
*
|
42
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
43
|
-
*/
|
44
|
-
declare const PersonaAvatar: React.ForwardRefExoticComponent<PersonaAvatarProps & React.RefAttributes<HTMLDivElement>>;
|
45
|
-
interface PersonaPresenceBadgeProps extends HTMLChakraProps<'span'> {
|
46
|
-
}
|
47
|
-
declare const PersonaPresenceBadge: React.ForwardRefExoticComponent<PersonaPresenceBadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
48
|
-
interface PersonaDetailsProps extends HTMLChakraProps<'div'> {
|
49
|
-
}
|
50
|
-
/**
|
51
|
-
* Wrapper component for the labels.
|
52
|
-
*
|
53
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
54
|
-
*/
|
55
|
-
declare const PersonaDetails: React.ForwardRefExoticComponent<PersonaDetailsProps & React.RefAttributes<HTMLDivElement>>;
|
56
|
-
interface PersonaLabelProps extends HTMLChakraProps<'span'> {
|
57
|
-
}
|
58
|
-
/**
|
59
|
-
* The main label, usually a name.
|
60
|
-
*
|
61
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
62
|
-
*/
|
63
|
-
declare const PersonaLabel: React.ForwardRefExoticComponent<PersonaLabelProps & React.RefAttributes<HTMLSpanElement>>;
|
64
|
-
/**
|
65
|
-
* The secondary label, usually the role of a person.
|
66
|
-
*
|
67
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
68
|
-
*/
|
69
|
-
declare const PersonaSecondaryLabel: React.ForwardRefExoticComponent<PersonaLabelProps & React.RefAttributes<HTMLSpanElement>>;
|
70
|
-
/**
|
71
|
-
* The tertiary label, typically a status message.
|
72
|
-
*
|
73
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
74
|
-
*/
|
75
|
-
declare const PersonaTertiaryLabel: React.ForwardRefExoticComponent<PersonaLabelProps & React.RefAttributes<HTMLSpanElement>>;
|
76
|
-
export { PersonaRoot as Root, PersonaAvatar as Avatar, PersonaPresenceBadge as PresenceBadge, PersonaDetails as Details, PersonaLabel as Label, PersonaSecondaryLabel as SecondaryLabel, PersonaTertiaryLabel as TertiaryLabel, };
|
77
|
-
export type { PersonaRootProps as RootProps, PersonaAvatarProps as AvatarProps, PersonaPresenceBadgeProps as PresenceBadgeProps, PersonaDetailsProps as DetailsProps, PersonaLabelProps as LabelProps, };
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { forwardRef } from 'react';
|
3
|
-
import { chakra, } from '@chakra-ui/react';
|
4
|
-
import { dataAttr } from '@saas-ui/core/utils';
|
5
|
-
import { Avatar } from "../avatar/avatar.js";
|
6
|
-
import { withContext, withProvider } from "./persona.context.js";
|
7
|
-
/**
|
8
|
-
* The root component that provides context and styles.
|
9
|
-
*
|
10
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
11
|
-
*/
|
12
|
-
const PersonaRoot = withProvider(forwardRef((props, ref) => {
|
13
|
-
const { outOfOffice, presence, ...rest } = props;
|
14
|
-
return (_jsx(chakra.div, { ref: ref, ...rest, "data-out-of-office": dataAttr(outOfOffice), "data-presence": presence, css: [
|
15
|
-
presence
|
16
|
-
? {
|
17
|
-
'--persona-presence': `colors.presence.${presence}`,
|
18
|
-
}
|
19
|
-
: undefined,
|
20
|
-
rest.css,
|
21
|
-
] }));
|
22
|
-
}), 'root');
|
23
|
-
/**
|
24
|
-
* An avatar with optional status badge.
|
25
|
-
*
|
26
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
27
|
-
*/
|
28
|
-
const PersonaAvatar = forwardRef((props, ref) => {
|
29
|
-
const { children, ...rest } = props;
|
30
|
-
return (_jsx(Avatar, { ref: ref, ...rest, children: children }));
|
31
|
-
});
|
32
|
-
const PersonaPresenceBadge = withContext('span', 'presence');
|
33
|
-
/**
|
34
|
-
* Wrapper component for the labels.
|
35
|
-
*
|
36
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
37
|
-
*/
|
38
|
-
const PersonaDetails = withContext('div', 'details');
|
39
|
-
/**
|
40
|
-
* The main label, usually a name.
|
41
|
-
*
|
42
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
43
|
-
*/
|
44
|
-
const PersonaLabel = withContext('span', 'label');
|
45
|
-
PersonaLabel.displayName = 'PersonaLabel';
|
46
|
-
/**
|
47
|
-
* The secondary label, usually the role of a person.
|
48
|
-
*
|
49
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
50
|
-
*/
|
51
|
-
const PersonaSecondaryLabel = withContext('span', 'secondaryLabel');
|
52
|
-
/**
|
53
|
-
* The tertiary label, typically a status message.
|
54
|
-
*
|
55
|
-
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
56
|
-
*/
|
57
|
-
const PersonaTertiaryLabel = withContext('span', 'tertiaryLabel');
|
58
|
-
export { PersonaRoot as Root, PersonaAvatar as Avatar, PersonaPresenceBadge as PresenceBadge, PersonaDetails as Details, PersonaLabel as Label, PersonaSecondaryLabel as SecondaryLabel, PersonaTertiaryLabel as TertiaryLabel, };
|