@podoba/react 0.0.21 → 0.0.23
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/package.json +3 -3
- package/src/components/tile.tsx +11 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@podoba/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "podoba React components — React Aria Components + Tailwind primitives + layout, built with uic.",
|
|
6
6
|
"repository": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@podoba/tokens": "^0.0.
|
|
29
|
-
"@podoba/tailwind": "^0.0.
|
|
28
|
+
"@podoba/tokens": "^0.0.23",
|
|
29
|
+
"@podoba/tailwind": "^0.0.23",
|
|
30
30
|
"react-aria-components": "1.18.0",
|
|
31
31
|
"class-variance-authority": "0.7.1",
|
|
32
32
|
"clsx": "2.1.1",
|
package/src/components/tile.tsx
CHANGED
|
@@ -20,11 +20,14 @@ import { type ReactElement, type ReactNode, cloneElement, isValidElement } from
|
|
|
20
20
|
*/
|
|
21
21
|
export type TileTheme = 'light' | 'dark' | 'teal' | 'yellow'
|
|
22
22
|
|
|
23
|
+
// Light tiles carry a visible hairline (border-border), matching StatsCard's
|
|
24
|
+
// lightSkin; dark/colored tiles use a transparent border so every tile keeps the
|
|
25
|
+
// same box size (no 1px layout shift between themes).
|
|
23
26
|
const THEME: Record<TileTheme, string> = {
|
|
24
|
-
light: 'bg-surface-card text-fg',
|
|
25
|
-
dark: 'bg-surface-inverted text-white',
|
|
26
|
-
teal: 'bg-brand-secondary text-fg',
|
|
27
|
-
yellow: 'bg-accent-yellow text-fg',
|
|
27
|
+
light: 'border border-border bg-surface-card text-fg',
|
|
28
|
+
dark: 'border border-transparent bg-surface-inverted text-white',
|
|
29
|
+
teal: 'border border-transparent bg-brand-secondary text-fg',
|
|
30
|
+
yellow: 'border border-transparent bg-accent-yellow text-fg',
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
/** Hover-lift + focus ring applied only when the tile is a link. */
|
|
@@ -103,7 +106,9 @@ export const tileStatClass = 'text-display font-medium leading-[30px] tracking-w
|
|
|
103
106
|
export type BadgeColor = 'green' | 'yellow' | 'grey' | 'dark'
|
|
104
107
|
|
|
105
108
|
const BADGE: Record<BadgeColor, string> = {
|
|
106
|
-
green
|
|
109
|
+
// gs `GSTag` green = the brand green (not the pale accent-mint). One saturated
|
|
110
|
+
// brand green for every green tag (New, Active, Published), matching gs 1:1.
|
|
111
|
+
green: 'bg-brand-green text-fg',
|
|
107
112
|
yellow: 'bg-accent-yellow text-fg',
|
|
108
113
|
grey: 'bg-surface-muted text-fg-muted',
|
|
109
114
|
dark: 'bg-surface-inverted text-white',
|
|
@@ -112,7 +117,7 @@ const BADGE: Record<BadgeColor, string> = {
|
|
|
112
117
|
export function Badge({ label, color = 'grey' }: { label: ReactNode; color?: BadgeColor }) {
|
|
113
118
|
return (
|
|
114
119
|
<span
|
|
115
|
-
className={`inline-flex items-center rounded-full px-
|
|
120
|
+
className={`inline-flex items-center rounded-full px-3 py-1 text-caption font-medium leading-none ${BADGE[color]}`}
|
|
116
121
|
>
|
|
117
122
|
{label}
|
|
118
123
|
</span>
|