@ttoss/components 2.8.0 → 2.10.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/dist/SpotlightCard/index.d.ts +10 -10
- package/dist/esm/SpotlightCard/index.js +45 -44
- package/package.json +4 -4
|
@@ -6,21 +6,21 @@ import * as React from 'react';
|
|
|
6
6
|
type ButtonPropType = ButtonProps | React.ReactNode;
|
|
7
7
|
type SpotlightCardProps = {
|
|
8
8
|
icon: IconType;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Title of the card. Pass a ReactNode for styling.
|
|
11
|
+
*/
|
|
12
|
+
title: string | React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Badge text. Renders as a badge/tag next to the title.
|
|
15
|
+
*/
|
|
16
|
+
badge?: string | React.ReactNode;
|
|
11
17
|
description: string;
|
|
12
18
|
firstButton?: ButtonPropType;
|
|
13
19
|
secondButton?: ButtonPropType;
|
|
14
|
-
|
|
15
|
-
* Visual variant of the card.
|
|
16
|
-
* - 'accent': (Default) Highlighted background (Action Accent) with shine animation.
|
|
17
|
-
* - 'dark': Dark background (Action Primary).
|
|
18
|
-
* @default 'accent'
|
|
19
|
-
*/
|
|
20
|
-
variant?: 'accent' | 'dark';
|
|
20
|
+
variant?: 'accent' | 'primary';
|
|
21
21
|
};
|
|
22
22
|
declare const SpotlightCard: {
|
|
23
|
-
({ icon, title,
|
|
23
|
+
({ icon, title, badge, description, firstButton, secondButton, variant, }: SpotlightCardProps): react_jsx_runtime.JSX.Element;
|
|
24
24
|
displayName: string;
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -3,37 +3,35 @@ import { Icon } from "../chunk-2R7AUPJL.js";
|
|
|
3
3
|
import { __name } from "../chunk-V4MHYKRI.js";
|
|
4
4
|
|
|
5
5
|
// src/components/SpotlightCard/SpotlightCard.tsx
|
|
6
|
-
import { Box, Button, Card, Flex, Text } from "@ttoss/ui";
|
|
6
|
+
import { Box, Button, Card, Flex, keyframes, Text } from "@ttoss/ui";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
var SpotlightCard = /* @__PURE__ */__name(({
|
|
9
9
|
icon,
|
|
10
10
|
title,
|
|
11
|
-
|
|
11
|
+
badge,
|
|
12
12
|
description,
|
|
13
13
|
firstButton,
|
|
14
14
|
secondButton,
|
|
15
15
|
variant = "accent"
|
|
16
16
|
}) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
100% { background-position: 0% 50%; }
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
document.head.appendChild(style);
|
|
17
|
+
const gradientFlow = keyframes({
|
|
18
|
+
"0%": {
|
|
19
|
+
backgroundPosition: "0% 50%"
|
|
20
|
+
},
|
|
21
|
+
"50%": {
|
|
22
|
+
backgroundPosition: "100% 50%"
|
|
23
|
+
},
|
|
24
|
+
"100%": {
|
|
25
|
+
backgroundPosition: "0% 50%"
|
|
30
26
|
}
|
|
31
|
-
}
|
|
27
|
+
});
|
|
32
28
|
const hasButtons = !!firstButton || !!secondButton;
|
|
33
29
|
const isAccent = variant === "accent";
|
|
34
30
|
const textColorToken = isAccent ? "action.text.accent.default" : "action.text.primary.default";
|
|
35
31
|
const iconColorToken = isAccent ? "action.text.accent.default" : "display.text.accent.default";
|
|
36
32
|
const iconBgToken = isAccent ? "rgba(255,255,255,0.3)" : "action.background.secondary.default";
|
|
33
|
+
const badgeBgToken = isAccent ? "action.background.primary.default" : "action.background.accent.default";
|
|
34
|
+
const badgeTextToken = isAccent ? "action.text.primary.default" : "action.text.accent.default";
|
|
37
35
|
const btnPrimaryVariant = isAccent ? "primary" : "accent";
|
|
38
36
|
const btnPrimaryColorToken = isAccent ? "action.text.primary.default" : "action.text.accent.default";
|
|
39
37
|
const btnSecondaryColorToken = textColorToken;
|
|
@@ -89,7 +87,7 @@ var SpotlightCard = /* @__PURE__ */__name(({
|
|
|
89
87
|
return `linear-gradient(270deg, ${bgStart}, ${bgMiddle}, ${bgStart})`;
|
|
90
88
|
}, "background"),
|
|
91
89
|
backgroundSize: isAccent ? "200% 100%, auto" : "400% 400%",
|
|
92
|
-
animation:
|
|
90
|
+
animation: `${gradientFlow} 6s ease infinite`,
|
|
93
91
|
width: "100%",
|
|
94
92
|
minHeight: "104px",
|
|
95
93
|
borderRadius: "xl",
|
|
@@ -113,8 +111,8 @@ var SpotlightCard = /* @__PURE__ */__name(({
|
|
|
113
111
|
}
|
|
114
112
|
}, /* @__PURE__ */React.createElement(Box, {
|
|
115
113
|
sx: {
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
114
|
+
width: 64,
|
|
115
|
+
height: 64,
|
|
118
116
|
borderRadius: "2xl",
|
|
119
117
|
backgroundColor: iconBgToken,
|
|
120
118
|
display: "flex",
|
|
@@ -125,7 +123,7 @@ var SpotlightCard = /* @__PURE__ */__name(({
|
|
|
125
123
|
}
|
|
126
124
|
}, /* @__PURE__ */React.createElement(Icon, {
|
|
127
125
|
icon,
|
|
128
|
-
width:
|
|
126
|
+
width: 32
|
|
129
127
|
})), /* @__PURE__ */React.createElement(Box, {
|
|
130
128
|
sx: {
|
|
131
129
|
minWidth: 0
|
|
@@ -133,40 +131,43 @@ var SpotlightCard = /* @__PURE__ */__name(({
|
|
|
133
131
|
}, /* @__PURE__ */React.createElement(Text, {
|
|
134
132
|
as: "div",
|
|
135
133
|
sx: {
|
|
136
|
-
fontFamily: "
|
|
137
|
-
|
|
138
|
-
fontSize: "
|
|
139
|
-
lineHeight: 1.
|
|
134
|
+
fontFamily: "mono",
|
|
135
|
+
// Tamanho da fonte aumentado para dar mais presença ao OneClick
|
|
136
|
+
fontSize: "32px",
|
|
137
|
+
lineHeight: 1.1,
|
|
140
138
|
color: "inherit",
|
|
141
139
|
whiteSpace: "nowrap",
|
|
142
140
|
display: "flex",
|
|
143
|
-
alignItems: "
|
|
144
|
-
gap: "
|
|
145
|
-
}
|
|
146
|
-
}, /* @__PURE__ */React.createElement("span", {
|
|
147
|
-
style: {
|
|
148
|
-
fontWeight: 800,
|
|
149
|
-
letterSpacing: "-0.5px",
|
|
150
|
-
verticalAlign: "middle",
|
|
151
|
-
lineHeight: 1.1
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
gap: "3"
|
|
152
143
|
}
|
|
153
|
-
}, title
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
144
|
+
}, title, badge && /* @__PURE__ */React.createElement(Box, {
|
|
145
|
+
as: "span",
|
|
146
|
+
sx: {
|
|
147
|
+
backgroundColor: badgeBgToken,
|
|
148
|
+
color: badgeTextToken,
|
|
149
|
+
fontFamily: "mono",
|
|
150
|
+
fontWeight: "bold",
|
|
151
|
+
fontSize: "11px",
|
|
152
|
+
lineHeight: 1,
|
|
153
|
+
paddingX: "6px",
|
|
154
|
+
paddingY: "3px",
|
|
155
|
+
borderRadius: "md",
|
|
156
|
+
textTransform: "uppercase",
|
|
157
|
+
letterSpacing: "0.05em",
|
|
158
|
+
display: "inline-flex",
|
|
159
|
+
alignItems: "center",
|
|
160
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
|
|
161
|
+
transform: "translateY(3px)"
|
|
161
162
|
}
|
|
162
|
-
},
|
|
163
|
+
}, badge)), /* @__PURE__ */React.createElement(Text, {
|
|
163
164
|
as: "div",
|
|
164
165
|
sx: {
|
|
165
166
|
fontFamily: "body",
|
|
166
167
|
fontWeight: 400,
|
|
167
|
-
fontSize: "
|
|
168
|
+
fontSize: "16px",
|
|
168
169
|
color: "inherit",
|
|
169
|
-
opacity: 0.
|
|
170
|
+
opacity: 0.9,
|
|
170
171
|
mt: "1",
|
|
171
172
|
overflow: "hidden",
|
|
172
173
|
textOverflow: "ellipsis",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "React components for ttoss ecosystem.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -120,12 +120,12 @@
|
|
|
120
120
|
"react": "^19.2.0",
|
|
121
121
|
"tsup": "^8.5.1",
|
|
122
122
|
"tsx": "^4.19.2",
|
|
123
|
-
"@ttoss/config": "^1.35.12",
|
|
124
123
|
"@ttoss/react-i18n": "^2.0.24",
|
|
125
|
-
"@ttoss/
|
|
126
|
-
"@ttoss/react-icons": "^0.5.5",
|
|
124
|
+
"@ttoss/config": "^1.35.12",
|
|
127
125
|
"@ttoss/i18n-cli": "^0.7.38",
|
|
126
|
+
"@ttoss/react-hooks": "^2.1.10",
|
|
128
127
|
"@ttoss/test-utils": "^4.0.1",
|
|
128
|
+
"@ttoss/react-icons": "^0.5.5",
|
|
129
129
|
"@ttoss/ui": "^6.0.4"
|
|
130
130
|
},
|
|
131
131
|
"keywords": [
|