@vdatacloud/cx-commons 0.1.3
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/LICENSE +21 -0
- package/README.md +125 -0
- package/index.ts +28 -0
- package/package.json +54 -0
- package/src/components/EyebrowLabel.astro +22 -0
- package/src/components/Footer.astro +41 -0
- package/src/components/Nav.astro +96 -0
- package/src/components/StatusBadge.astro +35 -0
- package/src/fonts/plus-jakarta-sans-italic-latin.woff2 +0 -0
- package/src/fonts/plus-jakarta-sans-latin.woff2 +0 -0
- package/src/sdk/status-colors.ts +15 -0
- package/src/styles/global.css +244 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DataCloud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Product CX Commons Platform (`@vdatacloud/cx-commons`)
|
|
2
|
+
|
|
3
|
+
Welcome to the **`cx-platform`** shared UI foundation and developer repository for Data Cloud web applications.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Problem Statement
|
|
8
|
+
|
|
9
|
+
Across Data Cloud's ecosystem of products—such as the **Stablecoin Escrow Platform (`daml-escrow`)**, administrative portals, and public-facing services—frontend implementations historically faced three major operational challenges:
|
|
10
|
+
|
|
11
|
+
1. **Fragmented UI & Styling Drift:** Custom CSS resets, ad-hoc color scales, and inconsistent typography diluted brand identity and generated maintenance overhead across repositories.
|
|
12
|
+
2. **Duplicated Boilerplate:** Common application shells (navigation bars, footers, dark-mode toggles, cookie consent banners, identity discovery popups) were re-implemented across independent frontend codebases.
|
|
13
|
+
3. **Integration Overhead:** Downstream applications had to manually configure complex post-processing pipelines and font loading, increasing setup time for new product frontends.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Strategy
|
|
18
|
+
|
|
19
|
+
The **`cx-platform`** strategy establishes a decoupled **Design-System-as-a-Package** and **Astro Integration Engine** housed in this standalone repository (`@vdatacloud/cx-commons`).
|
|
20
|
+
|
|
21
|
+
- **Centralized Design System Tokens:** Enforces the canonical **Data Cloud Look-and-Feel (LNF)** palette (`--color-brand-*`, `--color-status-*`), typography scale (*Plus Jakarta Sans*), micro-animations, and glassmorphism utilities.
|
|
22
|
+
- **Zero-Configuration Astro Integration:** Exposes a custom Astro Integration plugin (`cxCommons()`) that automatically injects global stylesheets and font declarations into page Server-Side Rendering (SSR) without requiring repetitive manual imports in downstream apps.
|
|
23
|
+
- **Framework-Agnostic UI Foundation:** Combines Tailwind CSS utility scales with native Astro components to ship **Zero JS by default**, injecting script tags only when user interaction (e.g. dark-mode toggle, consent state persistence) is required.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 3. Goals
|
|
28
|
+
|
|
29
|
+
- **Single Source of Truth:** Provide an immutable design and component reference for all Data Cloud web applications.
|
|
30
|
+
- **Rapid Onboarding:** Enable new applications to establish a brand-compliant layout in under 5 minutes using `astro.config.mjs`.
|
|
31
|
+
- **Performance & Accessibility:** Guarantee sub-second Largest Contentful Paint (LCP) performance, WCAG AA accessibility compliance, and built-in dark mode support.
|
|
32
|
+
- **Modular Maintainability:** Maintain clear architectural separation between domain application code (e.g., DAML contract state cards in `daml-escrow`) and platform UI code (in `cx-platform`).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 4. Architecture & Package Exports
|
|
37
|
+
|
|
38
|
+
This repository publishes `@vdatacloud/cx-commons` with modular export entry points defined in `package.json`:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
@vdatacloud/cx-commons
|
|
42
|
+
├── (default) --> exports index.ts (Astro integration plugin `cxCommons()`)
|
|
43
|
+
├── /styles/global.css --> exports canonical LNF design system tokens & Tailwind rules
|
|
44
|
+
├── /components/* --> exports shared Astro UI components (Nav, Footer)
|
|
45
|
+
└── /sdk/* --> exports optional browser/identity SDK helpers
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 5. Quick Start & Integration Guide
|
|
51
|
+
|
|
52
|
+
### Step 1: Install or Link Package
|
|
53
|
+
|
|
54
|
+
In your project's `package.json` (e.g. `daml-escrow/frontend/package.json`):
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@vdatacloud/cx-commons": "file:../../cx-commons"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 2: Register the Astro Plugin
|
|
65
|
+
|
|
66
|
+
In your application's `astro.config.mjs`:
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
import { defineConfig } from 'astro/config';
|
|
70
|
+
import cxCommons from '@vdatacloud/cx-commons';
|
|
71
|
+
|
|
72
|
+
export default defineConfig({
|
|
73
|
+
integrations: [
|
|
74
|
+
cxCommons() // Automatically injects global LNF CSS & font scales into SSR
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Step 3: Consume Shared Layout Components
|
|
80
|
+
|
|
81
|
+
In your Astro page layout (e.g. `src/layouts/Layout.astro`):
|
|
82
|
+
|
|
83
|
+
```astro
|
|
84
|
+
---
|
|
85
|
+
import Nav from '@vdatacloud/cx-commons/components/Nav';
|
|
86
|
+
import Footer from '@vdatacloud/cx-commons/components/Footer';
|
|
87
|
+
|
|
88
|
+
interface Props {
|
|
89
|
+
title: string;
|
|
90
|
+
}
|
|
91
|
+
const { title } = Astro.props;
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
<!DOCTYPE html>
|
|
95
|
+
<html lang="en">
|
|
96
|
+
<head>
|
|
97
|
+
<meta charset="UTF-8" />
|
|
98
|
+
<title>{title}</title>
|
|
99
|
+
</head>
|
|
100
|
+
<body class="bg-slate-50 dark:bg-slate-950 text-slate-900 dark:text-slate-100 min-h-screen flex flex-col">
|
|
101
|
+
<Nav brandName="Data Cloud Escrow" />
|
|
102
|
+
<main class="flex-grow">
|
|
103
|
+
<slot />
|
|
104
|
+
</main>
|
|
105
|
+
<Footer />
|
|
106
|
+
</body>
|
|
107
|
+
</html>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 6. Developer Documentation Index
|
|
113
|
+
|
|
114
|
+
Detailed guides for building, extending, and testing the platform are housed in the [`docs/`](./docs) directory:
|
|
115
|
+
|
|
116
|
+
- 🛠️ **[Developer Setup & Workflow Guide](./docs/DEVELOPMENT.md):** Local setup, TypeScript building, linking with downstream projects, and testing commands.
|
|
117
|
+
- 🏗️ **[Architecture & Design System Specification](./docs/ARCHITECTURE.md):** Deep-dive into design tokens, Astro plugin mechanics, CSS variables, and Tailwind setup.
|
|
118
|
+
- 🧩 **[Component Catalog & API Reference](./docs/COMPONENTS.md):** Comprehensive prop specifications, code snippets, and interactivity guidelines for all shared components.
|
|
119
|
+
- 🤝 **[Contributing & Release Guide](./docs/CONTRIBUTING.md):** Branching strategies, conventional commits, versioning policy, and initial commit checklists.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 7. License
|
|
124
|
+
|
|
125
|
+
UNLICENSED — Proprietary to Data Cloud LLC.
|
package/index.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AstroIntegration } from 'astro';
|
|
2
|
+
|
|
3
|
+
export interface CxCommonsOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Automatically inject the canonical DataCloud LNF global CSS tokens into every page at SSR.
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
injectGlobalCss?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Product CX Commons Astro Integration
|
|
13
|
+
* Provides shared Data Cloud LNF design system tokens and Astro UI components.
|
|
14
|
+
*/
|
|
15
|
+
export default function cxCommons(options: CxCommonsOptions = {}): AstroIntegration {
|
|
16
|
+
const { injectGlobalCss = true } = options;
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
name: '@vdatacloud/cx-commons',
|
|
20
|
+
hooks: {
|
|
21
|
+
'astro:config:setup': ({ injectScript }) => {
|
|
22
|
+
if (injectGlobalCss) {
|
|
23
|
+
injectScript('page-ssr', `import "@vdatacloud/cx-commons/styles/global.css";`);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vdatacloud/cx-commons",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Product CX Commons - Shared design system, UI components, and Astro integration for Data Cloud web applications",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/vdatacloud/cx-commons.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/vdatacloud/cx-commons#readme",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./index.ts",
|
|
14
|
+
"types": "./index.ts"
|
|
15
|
+
},
|
|
16
|
+
"./styles/global.css": "./src/styles/global.css",
|
|
17
|
+
"./components/*": "./src/components/*.astro",
|
|
18
|
+
"./sdk/*": "./src/sdk/*.ts"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"index.ts",
|
|
22
|
+
"src",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@tailwindcss/typography": "^0.5.0",
|
|
34
|
+
"astro": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
35
|
+
"tailwindcss": "^4.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@tailwindcss/typography": "^0.5.20",
|
|
39
|
+
"astro": "^7.3.2",
|
|
40
|
+
"typescript": "^5.7.0"
|
|
41
|
+
},
|
|
42
|
+
"overrides": {
|
|
43
|
+
"nanoid": "3.3.18"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"astro",
|
|
47
|
+
"astro-integration",
|
|
48
|
+
"design-system",
|
|
49
|
+
"tailwindcss",
|
|
50
|
+
"cx-commons"
|
|
51
|
+
],
|
|
52
|
+
"author": "Data Cloud LLC",
|
|
53
|
+
"license": "MIT"
|
|
54
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
text?: string;
|
|
4
|
+
color?: 'brand' | 'slate' | 'muted';
|
|
5
|
+
colorClass?: string;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { text, color = 'brand', colorClass, class: className = '' } = Astro.props;
|
|
10
|
+
|
|
11
|
+
const colorStyles = {
|
|
12
|
+
brand: 'text-brand-600 dark:text-brand-400',
|
|
13
|
+
slate: 'text-slate-800 dark:text-slate-200',
|
|
14
|
+
muted: 'text-slate-500 dark:text-slate-400',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const currentColor = colorClass || colorStyles[color];
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<span class={`block text-[10px] font-black uppercase tracking-widest mb-1.5 ${currentColor} ${className}`}>
|
|
21
|
+
<slot>{text}</slot>
|
|
22
|
+
</span>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
showTelemetry?: boolean;
|
|
4
|
+
}
|
|
5
|
+
const { showTelemetry = false } = Astro.props;
|
|
6
|
+
const year = new Date().getFullYear();
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<footer
|
|
10
|
+
class="bg-white dark:bg-slate-900 border-t border-slate-200 dark:border-slate-800 p-6 transition-colors duration-300 print:hidden"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
class="container mx-auto flex flex-col md:flex-row justify-between items-center gap-4 text-xs font-medium text-slate-500 dark:text-slate-400"
|
|
14
|
+
>
|
|
15
|
+
<div class="flex items-center gap-3">
|
|
16
|
+
<p>copyright (c) {year}, Data Cloud, LLC, All Rights Reserved</p>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="flex items-center gap-5 uppercase tracking-wider font-black text-[10px]">
|
|
20
|
+
<a href="/terms-and-conditions/" class="hover:text-brand-600 dark:hover:text-brand-400 transition-colors">
|
|
21
|
+
Terms and Conditions
|
|
22
|
+
</a>
|
|
23
|
+
<a href="/privacy-policy/" class="hover:text-brand-600 dark:hover:text-brand-400 transition-colors">
|
|
24
|
+
Privacy Policy
|
|
25
|
+
</a>
|
|
26
|
+
<button
|
|
27
|
+
id="open-cookie-preferences"
|
|
28
|
+
type="button"
|
|
29
|
+
class="hover:text-brand-600 dark:hover:text-brand-400 transition-colors border-none bg-transparent cursor-pointer uppercase tracking-wider font-black text-[10px] p-0"
|
|
30
|
+
>
|
|
31
|
+
Cookie Preferences
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</footer>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
document.getElementById('open-cookie-preferences')?.addEventListener('click', () => {
|
|
39
|
+
(window as typeof window & { openCookiePreferences?: () => void }).openCookiePreferences?.();
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface NavItem {
|
|
3
|
+
href: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Props {
|
|
8
|
+
navLinks?: NavItem[];
|
|
9
|
+
brandName?: string;
|
|
10
|
+
logoSrc?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
navLinks = [
|
|
15
|
+
{ href: '/', label: 'Home' },
|
|
16
|
+
{ href: '/products/tripart/', label: 'Products' },
|
|
17
|
+
{ href: '/blog/', label: 'Blog' },
|
|
18
|
+
{ href: '/about/', label: 'About' },
|
|
19
|
+
],
|
|
20
|
+
brandName = 'Data Cloud LLC',
|
|
21
|
+
logoSrc = '/favicon.svg'
|
|
22
|
+
} = Astro.props;
|
|
23
|
+
|
|
24
|
+
const currentPath = Astro.url.pathname;
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<nav class="glass-nav sticky top-0 z-50 transition-colors duration-300 print:hidden">
|
|
28
|
+
<div class="container mx-auto flex flex-wrap items-center justify-between gap-4 px-6 py-4">
|
|
29
|
+
<a href="/" class="flex items-center gap-3 group">
|
|
30
|
+
<img
|
|
31
|
+
src={logoSrc}
|
|
32
|
+
alt={brandName}
|
|
33
|
+
class="w-10 h-10 group-hover:scale-105 transition-transform duration-300"
|
|
34
|
+
/>
|
|
35
|
+
<span class="text-sm font-black tracking-tight text-slate-800 dark:text-white uppercase">{brandName}</span>
|
|
36
|
+
</a>
|
|
37
|
+
|
|
38
|
+
<div class="flex flex-wrap items-center gap-3 sm:gap-6 text-xs font-black uppercase tracking-wider">
|
|
39
|
+
{
|
|
40
|
+
navLinks.map((link) => {
|
|
41
|
+
const isActive = link.href === '/' ? currentPath === '/' : currentPath.startsWith(link.href);
|
|
42
|
+
return (
|
|
43
|
+
<a
|
|
44
|
+
href={link.href}
|
|
45
|
+
class:list={[
|
|
46
|
+
'transition-colors',
|
|
47
|
+
isActive
|
|
48
|
+
? 'text-brand-600 dark:text-brand-400'
|
|
49
|
+
: 'text-slate-600 dark:text-slate-400 hover:text-brand-600 dark:hover:text-brand-400',
|
|
50
|
+
]}
|
|
51
|
+
>
|
|
52
|
+
{link.label}
|
|
53
|
+
</a>
|
|
54
|
+
);
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
<div class="h-4 w-px bg-slate-200 dark:bg-slate-800 mx-1"></div>
|
|
58
|
+
<button
|
|
59
|
+
id="theme-toggle"
|
|
60
|
+
type="button"
|
|
61
|
+
aria-label="Toggle dark mode"
|
|
62
|
+
class="p-2 rounded-xl text-slate-500 dark:text-slate-400 hover:bg-slate-200/50 dark:hover:bg-slate-800/50 transition-colors border-none bg-transparent cursor-pointer"
|
|
63
|
+
>
|
|
64
|
+
<svg
|
|
65
|
+
id="theme-icon-sun"
|
|
66
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
67
|
+
class="h-4 w-4 hidden dark:block"
|
|
68
|
+
viewBox="0 0 20 20"
|
|
69
|
+
fill="currentColor"
|
|
70
|
+
>
|
|
71
|
+
<path
|
|
72
|
+
fill-rule="evenodd"
|
|
73
|
+
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
|
|
74
|
+
clip-rule="evenodd"></path>
|
|
75
|
+
</svg>
|
|
76
|
+
<svg
|
|
77
|
+
id="theme-icon-moon"
|
|
78
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
79
|
+
class="h-4 w-4 dark:hidden"
|
|
80
|
+
viewBox="0 0 20 20"
|
|
81
|
+
fill="currentColor"
|
|
82
|
+
>
|
|
83
|
+
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
|
|
84
|
+
</svg>
|
|
85
|
+
</button>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</nav>
|
|
89
|
+
|
|
90
|
+
<script>
|
|
91
|
+
const toggle = document.getElementById('theme-toggle');
|
|
92
|
+
toggle?.addEventListener('click', () => {
|
|
93
|
+
const isDark = document.documentElement.classList.toggle('dark');
|
|
94
|
+
localStorage.setItem('theme', isDark ? 'dark' : 'light');
|
|
95
|
+
});
|
|
96
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
status: 'DRAFT' | 'FUNDED' | 'ACTIVE' | 'PROPOSED' | 'DISPUTED' | 'ARBITRATION' | 'SETTLED' | 'AWAITING_CUSTODY_APPROVAL' | 'FIAT_PENDING' | 'LAPSED' | string;
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
colorClass?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { status, size = 'sm', colorClass } = Astro.props;
|
|
9
|
+
|
|
10
|
+
const statusUpper = status.toUpperCase();
|
|
11
|
+
|
|
12
|
+
const badgeStyles: Record<string, string> = {
|
|
13
|
+
DRAFT: 'text-status-draft bg-status-draft/10 border-status-draft/20 dark:bg-status-draft/5 dark:border-status-draft/10',
|
|
14
|
+
FUNDED: 'text-status-funded bg-status-funded/10 border-status-funded/20 dark:bg-status-funded/5 dark:border-status-funded/10',
|
|
15
|
+
ACTIVE: 'text-status-active bg-status-active/10 border-status-active/20 dark:bg-status-active/5 dark:border-status-active/10',
|
|
16
|
+
PROPOSED: 'text-status-proposed bg-status-proposed/10 border-status-proposed/20 dark:bg-status-proposed/5 dark:border-status-proposed/10',
|
|
17
|
+
DISPUTED: 'text-status-disputed bg-status-disputed/10 border-status-disputed/20 dark:bg-status-disputed/5 dark:border-status-disputed/10',
|
|
18
|
+
ARBITRATION: 'text-status-arbitration bg-status-arbitration/10 border-status-arbitration/20 dark:bg-status-arbitration/5 dark:border-status-arbitration/10',
|
|
19
|
+
SETTLED: 'text-status-settled bg-status-settled/10 border-status-settled/20 dark:bg-status-settled/5 dark:border-status-settled/10',
|
|
20
|
+
AWAITING_CUSTODY_APPROVAL: 'text-status-awaiting-custody-approval bg-status-awaiting-custody-approval/10 border-status-awaiting-custody-approval/20 dark:bg-status-awaiting-custody-approval/5 dark:border-status-awaiting-custody-approval/10',
|
|
21
|
+
FIAT_PENDING: 'text-status-fiat-pending bg-status-fiat-pending/10 border-status-fiat-pending/20 dark:bg-status-fiat-pending/5 dark:border-status-fiat-pending/10',
|
|
22
|
+
LAPSED: 'text-status-lapsed bg-status-lapsed/10 border-status-lapsed/20 dark:bg-status-lapsed/5 dark:border-status-lapsed/10',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const currentStyle = colorClass || badgeStyles[statusUpper] || badgeStyles.DRAFT;
|
|
26
|
+
|
|
27
|
+
const sizeStyles = {
|
|
28
|
+
sm: 'px-2.5 py-1 text-[10px] font-black tracking-widest',
|
|
29
|
+
md: 'px-3 py-1.5 text-xs font-bold tracking-wider',
|
|
30
|
+
};
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
<span class={`inline-flex items-center justify-center rounded-full border uppercase transition-all duration-300 ${currentStyle} ${sizeStyles[size]}`}>
|
|
34
|
+
<slot>{statusUpper.replace('_', ' ')}</slot>
|
|
35
|
+
</span>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const STATUS_HEX_COLORS: Record<string, string> = {
|
|
2
|
+
DRAFT: '#94a3b8',
|
|
3
|
+
FUNDED: '#3b82f6',
|
|
4
|
+
ACTIVE: '#10b981',
|
|
5
|
+
PROPOSED: '#f59e0b',
|
|
6
|
+
DISPUTED: '#f43f5e',
|
|
7
|
+
ARBITRATION: '#dc2626',
|
|
8
|
+
SETTLED: '#a855f7',
|
|
9
|
+
FIAT_PENDING: '#6366f1',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function getStatusHexColor(status: string): string {
|
|
13
|
+
const upper = status.toUpperCase();
|
|
14
|
+
return STATUS_HEX_COLORS[upper] || STATUS_HEX_COLORS.DRAFT;
|
|
15
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@source "../components";
|
|
3
|
+
@plugin "@tailwindcss/typography";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Plus Jakarta Sans, self-hosted (latin subset only -- every consuming site
|
|
7
|
+
* is English-only per its <html lang="en">). Previously loaded via a
|
|
8
|
+
* `@import url(fonts.googleapis.com/...)` at the top of this file, which
|
|
9
|
+
* PageSpeed Insights flagged as a fully serial 3-hop render-blocking chain
|
|
10
|
+
* (our CSS -> Google's CSS -> the actual woff2, ~1.7s on slow 4G) because a
|
|
11
|
+
* CSS @import is invisible to the browser's preload scanner until this
|
|
12
|
+
* file itself has downloaded and parsed. Self-hosting collapses that to a
|
|
13
|
+
* single same-origin request. Variable font (weight axis 300-800) so one
|
|
14
|
+
* file per style covers the whole weight range Tailwind's font-black
|
|
15
|
+
* through font-medium utilities need -- no separate file per weight.
|
|
16
|
+
* Files fetched from Google Fonts' own CDN (fonts.gstatic.com), latin
|
|
17
|
+
* subset (U+0000-00FF, U+0131, ... -- the same subset Google serves to a
|
|
18
|
+
* browser that only declares `Accept-Language: en`), version v12.
|
|
19
|
+
*/
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: 'Plus Jakarta Sans';
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-weight: 300 800;
|
|
24
|
+
font-display: swap;
|
|
25
|
+
src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
|
|
26
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: 'Plus Jakarta Sans';
|
|
31
|
+
font-style: italic;
|
|
32
|
+
font-weight: 300 800;
|
|
33
|
+
font-display: swap;
|
|
34
|
+
src: url('../fonts/plus-jakarta-sans-italic-latin.woff2') format('woff2');
|
|
35
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* Class-based dark mode (a .dark ancestor, toggled by Nav.astro's theme
|
|
40
|
+
* button + persisted to localStorage), not the prefers-color-scheme media
|
|
41
|
+
* query. Without this, Tailwind v4 defaults `dark:` utilities to the media
|
|
42
|
+
* query, which would leave the hand-written `.dark .glass-card` etc. rules
|
|
43
|
+
* below unreachable.
|
|
44
|
+
*/
|
|
45
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
46
|
+
|
|
47
|
+
@theme {
|
|
48
|
+
--font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
49
|
+
|
|
50
|
+
--color-slate-50: #f8fafc;
|
|
51
|
+
--color-slate-100: #f1f5f9;
|
|
52
|
+
--color-slate-200: #e2e8f0;
|
|
53
|
+
--color-slate-300: #cbd5e1;
|
|
54
|
+
--color-slate-400: #94a3b8;
|
|
55
|
+
--color-slate-500: #64748b;
|
|
56
|
+
--color-slate-600: #475569;
|
|
57
|
+
--color-slate-700: #334155;
|
|
58
|
+
--color-slate-800: #1e293b;
|
|
59
|
+
--color-slate-900: #0f172a;
|
|
60
|
+
--color-slate-950: #020617;
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
* Brand scale, rebuilt around the logo's actual blue (500) as an OKLCH-
|
|
64
|
+
* style ramp -- 2026-09-24, see the "Crayola palette anchored to the
|
|
65
|
+
* logo" design pass. brand-500 (#3a8eed) is the SVG logo's cloud color;
|
|
66
|
+
* leaf-500 is its data/green color, exposed as its own token below since
|
|
67
|
+
* nothing in the pre-existing brand-* scale carried it.
|
|
68
|
+
*/
|
|
69
|
+
--color-brand-50: #eff6ff;
|
|
70
|
+
--color-brand-100: #d9eaff;
|
|
71
|
+
--color-brand-200: #b7d7ff;
|
|
72
|
+
--color-brand-300: #89beff;
|
|
73
|
+
--color-brand-400: #4fa0ff;
|
|
74
|
+
--color-brand-500: #3a8eed; /* logo cloud */
|
|
75
|
+
--color-brand-600: #1671ce; /* links/text on light bg, 4.9:1 on white */
|
|
76
|
+
--color-brand-700: #005cb0;
|
|
77
|
+
--color-brand-800: #00498f;
|
|
78
|
+
--color-brand-900: #003a72;
|
|
79
|
+
--color-brand-950: #00264f;
|
|
80
|
+
|
|
81
|
+
--color-leaf-500: #68bc36; /* logo data */
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
* Escrow status tokens — a single named mapping so components stop
|
|
85
|
+
* disagreeing on which color a given status is. Values updated
|
|
86
|
+
* 2026-09-24 to the Crayola palette (status-lapsed was previously a
|
|
87
|
+
* duplicate of status-disputed; now its own color).
|
|
88
|
+
*/
|
|
89
|
+
--color-status-draft: #b0b7c6; /* Cadet Blue */
|
|
90
|
+
--color-status-funded: #3a8eed; /* logo blue */
|
|
91
|
+
--color-status-active: #68bc36; /* logo green */
|
|
92
|
+
--color-status-proposed: #ffae42; /* Yellow Orange */
|
|
93
|
+
--color-status-disputed: #fd5e53; /* Sunset Orange */
|
|
94
|
+
--color-status-arbitration: #ee204d; /* Red */
|
|
95
|
+
--color-status-settled: #926eae; /* Violet (Purple) */
|
|
96
|
+
--color-status-awaiting-custody-approval: #ff7538; /* Orange */
|
|
97
|
+
--color-status-fiat-pending: #7366bd; /* Blue Violet */
|
|
98
|
+
--color-status-lapsed: #cb4154; /* Brick Red */
|
|
99
|
+
|
|
100
|
+
--animate-slide-up: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
101
|
+
--animate-fade-in: fade-in 0.3s ease-out forwards;
|
|
102
|
+
--animate-pulse-slow: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/*
|
|
106
|
+
* Action-tier tokens (2026-09-24): a consistent danger axis for buttons,
|
|
107
|
+
* separate from the escrow-status tokens above (those describe contract
|
|
108
|
+
* *state*, these describe an action's own consequence). Warm = dangerous,
|
|
109
|
+
* cool = safe, per the SVG logo's own blue/green pairing. All fills pass
|
|
110
|
+
* 4.5:1 contrast with their paired ink color. Light-mode values live on
|
|
111
|
+
* :root; dark mode lightens/softens rather than darkening (critical stays
|
|
112
|
+
* put -- lightening red fails contrast with both inks). See each
|
|
113
|
+
* component's own button-to-tier mapping for which tier a given action
|
|
114
|
+
* uses (e.g. daml-escrow's EscrowCard.astro).
|
|
115
|
+
*/
|
|
116
|
+
:root {
|
|
117
|
+
--action-ink: #1b1f27; /* text on every tier except critical */
|
|
118
|
+
|
|
119
|
+
--action-critical: #e50b46; /* Crayola Red, deepened for white text */
|
|
120
|
+
--action-critical-hover: #c7003b;
|
|
121
|
+
--action-critical-ink: #ffffff;
|
|
122
|
+
--action-high: #ff7538; /* Orange */
|
|
123
|
+
--action-high-hover: #ea6120;
|
|
124
|
+
--action-elevated: #ffae42; /* Yellow Orange */
|
|
125
|
+
--action-elevated-hover: #ea9b28;
|
|
126
|
+
--action-routine: #68bc36; /* logo green */
|
|
127
|
+
--action-routine-hover: #55a91b;
|
|
128
|
+
--action-low: #1dacd6; /* Cerulean */
|
|
129
|
+
--action-low-hover: #0d98ba; /* Blue Green */
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.dark {
|
|
133
|
+
--action-high: #ff8d5f;
|
|
134
|
+
--action-high-hover: #ffa785;
|
|
135
|
+
--action-elevated: #ffc177;
|
|
136
|
+
--action-elevated-hover: #ffd7a9;
|
|
137
|
+
--action-routine: #7ac752;
|
|
138
|
+
--action-routine-hover: #8fd66b;
|
|
139
|
+
--action-low: #45b8df;
|
|
140
|
+
--action-low-hover: #63c7eb;
|
|
141
|
+
/* critical intentionally unchanged in dark mode, see comment above */
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@theme inline {
|
|
145
|
+
--color-action-ink: var(--action-ink);
|
|
146
|
+
--color-action-critical: var(--action-critical);
|
|
147
|
+
--color-action-critical-hover: var(--action-critical-hover);
|
|
148
|
+
--color-action-critical-ink: var(--action-critical-ink);
|
|
149
|
+
--color-action-high: var(--action-high);
|
|
150
|
+
--color-action-high-hover: var(--action-high-hover);
|
|
151
|
+
--color-action-elevated: var(--action-elevated);
|
|
152
|
+
--color-action-elevated-hover: var(--action-elevated-hover);
|
|
153
|
+
--color-action-routine: var(--action-routine);
|
|
154
|
+
--color-action-routine-hover: var(--action-routine-hover);
|
|
155
|
+
--color-action-low: var(--action-low);
|
|
156
|
+
--color-action-low-hover: var(--action-low-hover);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@keyframes slide-up {
|
|
160
|
+
from { opacity: 0; transform: translateY(12px); }
|
|
161
|
+
to { opacity: 1; transform: translateY(0); }
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@keyframes fade-in {
|
|
165
|
+
from { opacity: 0; }
|
|
166
|
+
to { opacity: 1; }
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Custom premium class declarations */
|
|
170
|
+
|
|
171
|
+
.glass-card {
|
|
172
|
+
background: rgba(255, 255, 255, 0.7);
|
|
173
|
+
backdrop-filter: blur(16px) saturate(120%);
|
|
174
|
+
-webkit-backdrop-filter: blur(16px) saturate(120%);
|
|
175
|
+
border: 1px solid rgba(226, 232, 240, 0.8);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.dark .glass-card {
|
|
179
|
+
background: rgba(15, 23, 42, 0.6);
|
|
180
|
+
backdrop-filter: blur(16px) saturate(120%);
|
|
181
|
+
-webkit-backdrop-filter: blur(16px) saturate(120%);
|
|
182
|
+
border: 1px solid rgba(30, 41, 59, 0.8);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.glass-nav {
|
|
186
|
+
background: rgba(255, 255, 255, 0.8);
|
|
187
|
+
backdrop-filter: blur(12px);
|
|
188
|
+
-webkit-backdrop-filter: blur(12px);
|
|
189
|
+
border-bottom: 1px solid rgba(226, 232, 240, 0.8);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.dark .glass-nav {
|
|
193
|
+
background: rgba(2, 6, 23, 0.8);
|
|
194
|
+
backdrop-filter: blur(12px);
|
|
195
|
+
-webkit-backdrop-filter: blur(12px);
|
|
196
|
+
border-bottom: 1px solid rgba(30, 41, 59, 0.8);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.glow-blue {
|
|
200
|
+
box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.glow-green {
|
|
204
|
+
box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.interactive-card {
|
|
208
|
+
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.interactive-card:hover {
|
|
212
|
+
transform: translateY(-4px);
|
|
213
|
+
box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.08);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.dark .interactive-card:hover {
|
|
217
|
+
box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.4);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.label-eyebrow {
|
|
221
|
+
font-size: 10px;
|
|
222
|
+
font-weight: 900;
|
|
223
|
+
text-transform: uppercase;
|
|
224
|
+
letter-spacing: 0.1em;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Custom Scrollbar */
|
|
228
|
+
::-webkit-scrollbar {
|
|
229
|
+
width: 6px;
|
|
230
|
+
height: 6px;
|
|
231
|
+
}
|
|
232
|
+
::-webkit-scrollbar-track {
|
|
233
|
+
background: transparent;
|
|
234
|
+
}
|
|
235
|
+
::-webkit-scrollbar-thumb {
|
|
236
|
+
background: #cbd5e1;
|
|
237
|
+
border-radius: 3px;
|
|
238
|
+
}
|
|
239
|
+
.dark ::-webkit-scrollbar-thumb {
|
|
240
|
+
background: #334155;
|
|
241
|
+
}
|
|
242
|
+
::-webkit-scrollbar-thumb:hover {
|
|
243
|
+
background: #94a3b8;
|
|
244
|
+
}
|