@vdatacloud/cx-commons 0.7.0 → 0.8.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 CHANGED
@@ -201,6 +201,24 @@ const { title } = Astro.props;
201
201
  </html>
202
202
  ```
203
203
 
204
+ For a signed-in app (the escrow portal, the operator console), `components/AppShell` is the whole frame: head,
205
+ sticky header with the mark and name, main column and footer. The app fills the slots:
206
+
207
+ ```astro
208
+ ---
209
+ import AppShell from '@vdatacloud/cx-commons/components/AppShell';
210
+ ---
211
+ <AppShell title={title} brandName="Operator console" brandTitle="Platform operator console">
212
+ <div slot="nav">…navigation, sign-in, language…</div>
213
+ <slot />
214
+ <Footer slot="footer" />
215
+ </AppShell>
216
+ <script>/* the app's own header behavior */</script>
217
+ ```
218
+
219
+ Slots: `head` (extra head tags), `nav` (right of the name), `below-nav` (under the header row), the default
220
+ (page) and `footer`.
221
+
204
222
  ---
205
223
 
206
224
  ## 6. Developer Documentation Index
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vdatacloud/cx-commons",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Product CX Commons - Shared design system, UI components, and Astro integration for Data Cloud web applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,74 @@
1
+ ---
2
+ // The page frame of a signed-in app: document head, sticky header with the
3
+ // app's mark and name, main column and footer. Shared by the escrow portal
4
+ // and the operator console (daml-escrow PLAN.md Phase 104.4); what an app
5
+ // puts in the header (navigation, sign-in, language) goes in its slots.
6
+ //
7
+ // <AppShell title="Scheduler" brandName="Operator console">
8
+ // <div slot="nav">…links…</div>
9
+ // <PriceTicker slot="below-nav" /> (optional, under the header row)
10
+ // …page…
11
+ // <Footer slot="footer" />
12
+ // </AppShell>
13
+ //
14
+ // A <script> or <style is:global> the app needs goes in its own layout, next
15
+ // to the AppShell, not inside it.
16
+
17
+ export interface Props {
18
+ /** The document title. */
19
+ title: string;
20
+ /** Shown beside the mark. */
21
+ brandName: string;
22
+ /** Hover text for the name (e.g. the long product name). */
23
+ brandTitle?: string;
24
+ logoSrc?: string;
25
+ logoAlt?: string;
26
+ homeHref?: string;
27
+ locale?: string;
28
+ }
29
+
30
+ const {
31
+ title,
32
+ brandName,
33
+ brandTitle,
34
+ logoSrc = '/favicon.svg',
35
+ logoAlt = brandName,
36
+ homeHref = '/',
37
+ } = Astro.props;
38
+ const locale = Astro.props.locale ?? (Astro.locals as { locale?: string }).locale ?? Astro.currentLocale ?? 'en';
39
+ ---
40
+
41
+ <!doctype html>
42
+ <html lang={locale}>
43
+ <head>
44
+ <meta charset="UTF-8" />
45
+ <meta name="viewport" content="width=device-width" />
46
+ <link rel="icon" type="image/svg+xml" href={logoSrc} />
47
+ <meta name="generator" content={Astro.generator} />
48
+ <title>{title}</title>
49
+ <slot name="head" />
50
+ </head>
51
+ <body class="bg-slate-50 text-slate-900 dark:bg-slate-950 dark:text-slate-100 min-h-screen flex flex-col font-sans transition-colors duration-300">
52
+ <nav class="glass-nav p-4 sticky top-0 z-50 transition-colors duration-300 print:hidden">
53
+ <div class="container mx-auto flex justify-between items-center gap-4">
54
+ <div class="flex items-center space-x-3">
55
+ <a href={homeHref} class="flex items-center space-x-3 group">
56
+ <div class="w-10 h-10 bg-brand-500/10 rounded-2xl flex items-center justify-center text-brand-500 shadow-sm border border-brand-500/20 group-hover:scale-105 transition-transform duration-300">
57
+ <img src={logoSrc} alt={logoAlt} class="w-7 h-7" />
58
+ </div>
59
+ <h1 class="cx-caps text-sm font-black tracking-tight text-slate-800 dark:text-white uppercase" title={brandTitle}>{brandName}</h1>
60
+ </a>
61
+ </div>
62
+ <slot name="nav" />
63
+ </div>
64
+ <slot name="below-nav" />
65
+ </nav>
66
+
67
+ <main class="container mx-auto p-6 flex-grow print:p-0 print:max-w-none">
68
+ <slot />
69
+ </main>
70
+ <div class="print:hidden">
71
+ <slot name="footer" />
72
+ </div>
73
+ </body>
74
+ </html>