@openziti/ziti-console-lib 1.5.2 → 1.5.4

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.
@@ -48,6 +48,30 @@ body {
48
48
  --tableText: #22222a;
49
49
  --groupText: #78859f;
50
50
  --table: #ffffff;
51
+
52
+ /* ListTable (custom list table) tokens. The default look is a flat list-page
53
+ pattern (flat white rows, no zebra, hover-driven, uppercase hairline-divided
54
+ headers, roomy rows) while still drawing color from the host app's tokens
55
+ (--primary, --background, --stroke, ...). Consuming apps reskin the table by
56
+ overriding these (or the underlying tokens) in their own global styles. */
57
+ --lt-bg: transparent;
58
+ --lt-header-bg: var(--background);
59
+ --lt-header-text: var(--groupText);
60
+ --lt-header-underline: var(--stroke);
61
+ --lt-row-bg: transparent;
62
+ --lt-row-alt-bg: transparent; /* no zebra — rows read via the hairline divider + hover */
63
+ --lt-row-hover: var(--tableRowHover, rgba(0, 39, 171, 0.06));
64
+ --lt-row-selected: color-mix(in srgb, var(--primary) 8%, transparent);
65
+ --lt-cell-text: var(--text);
66
+ --lt-link: var(--primary);
67
+ --lt-border: var(--stroke);
68
+ --lt-icon: var(--icon);
69
+ --lt-icon-active: var(--primary);
70
+ --lt-row-height: 3.125rem;
71
+ --lt-radius: var(--inputBorderRadius);
72
+ --lt-toolbar-height: 2.5rem;
73
+ --lt-control-bg: var(--background);
74
+ --lt-font: 'Open Sans', sans-serif;
51
75
  --redShadow: rgba(255, 13, 73, 0.3);
52
76
  --redText: #9c0027;
53
77
  --shadow: 0rem 0rem 0.5rem 0.125rem rgba(0,0,0,0.08);
@@ -2262,6 +2286,199 @@ a {
2262
2286
  }
2263
2287
  }
2264
2288
 
2289
+ // Flat, card-based skin for a list table (via `class="lt-skin"`). Overrides the
2290
+ // --lt-* defaults for that table's subtree only, drawing from ZAC's own tokens so it
2291
+ // matches the app and follows its theming; the legacy page (.ag-cell) is untouched.
2292
+ .lt-skin {
2293
+ --lt-bg: var(--background);
2294
+ --lt-header-bg: var(--shaded);
2295
+ --lt-header-text: var(--groupText);
2296
+ --lt-header-underline: var(--stroke);
2297
+ --lt-row-bg: var(--background);
2298
+ --lt-row-alt-bg: transparent;
2299
+ --lt-row-hover: var(--shaded);
2300
+ --lt-row-selected: color-mix(in srgb, var(--primary) 8%, transparent);
2301
+ --lt-cell-text: var(--text);
2302
+ --lt-link: var(--primary);
2303
+ --lt-icon: var(--icon);
2304
+ --lt-icon-active: var(--primary);
2305
+ --lt-border: var(--stroke);
2306
+ --lt-control-bg: var(--background);
2307
+ --lt-radius: 0.375rem;
2308
+ --lt-row-height: 3.375rem;
2309
+
2310
+ // extra skin knobs; defaults match the values above so ZAC is unchanged
2311
+ --lt-control-border: var(--lt-border);
2312
+ --lt-header-sorted-text: var(--lt-icon-active);
2313
+ --lt-header-sorted-weight: 700;
2314
+ --lt-name-text: var(--tableText);
2315
+ --lt-name-weight: 700;
2316
+ --lt-name-size: 0.8125rem;
2317
+ --lt-name-hover: var(--lt-link);
2318
+ --lt-toolbar-margin-y: 0;
2319
+ --lt-toolbar-pad-bottom: 0.625rem;
2320
+ --lt-container-reserve: 5.625rem;
2321
+ }
2322
+
2323
+ // Skinned page: the table becomes a bordered card floating on a subtle page surface,
2324
+ // with the toolbar + footer on the page around it.
2325
+ .lt-skin-page {
2326
+ background: var(--formBackground);
2327
+ --inputBorderRadius: 0.375rem;
2328
+ }
2329
+
2330
+ .lt-skin .lt-scroll {
2331
+ border: 1px solid var(--lt-control-border, var(--lt-border));
2332
+ border-radius: var(--lt-radius);
2333
+ }
2334
+
2335
+ // the card's own bottom edge replaces the last row's divider (avoids a doubled line)
2336
+ .lt-skin .lt-row:last-child td {
2337
+ border-bottom: none;
2338
+ }
2339
+
2340
+ // name cell (scoped to .lt-cell; legacy .ag-cell untouched)
2341
+ .lt-cell .cell-name-link {
2342
+ color: var(--lt-name-text, var(--tableText));
2343
+ }
2344
+ .lt-cell .cell-name-renderer strong {
2345
+ color: var(--lt-name-text, var(--tableText));
2346
+ font-weight: var(--lt-name-weight, 700);
2347
+ font-size: var(--lt-name-size, 0.8125rem);
2348
+ }
2349
+ .lt-cell .cell-name-link:hover,
2350
+ .lt-cell .cell-name-link:hover strong {
2351
+ color: var(--lt-name-hover, var(--lt-link));
2352
+ }
2353
+
2354
+ // New list-table cell-content overrides. Scoped to .lt-cell so the legacy ag-grid
2355
+ // page (which uses .ag-cell) is untouched: compact, aligned O/S glyphs and light
2356
+ // role chips that follow the table's accent token (so they pick up the skin).
2357
+ .lt-cell .os {
2358
+ width: 1.375rem;
2359
+ height: 1.375rem;
2360
+ top: 0;
2361
+ vertical-align: middle;
2362
+ cursor: default;
2363
+ }
2364
+
2365
+ // Role/named-attribute chips: role (#) = primary, named (@) = secondary — the tag
2366
+ // selector's distinction, kept as soft tinted pills rather than solid fills.
2367
+ .lt-cell .lt-chip {
2368
+ display: inline-flex;
2369
+ align-items: center;
2370
+ margin-right: 0.25rem;
2371
+ padding: 0.125rem 0.5rem;
2372
+ font-size: 0.75rem;
2373
+ font-weight: 600;
2374
+ line-height: 1.4;
2375
+ color: var(--lt-link);
2376
+ background: color-mix(in srgb, var(--lt-link) 12%, transparent);
2377
+ border-radius: 0.25rem;
2378
+ vertical-align: middle;
2379
+ }
2380
+
2381
+ .lt-cell .lt-chip-at {
2382
+ color: var(--secondary);
2383
+ background: color-mix(in srgb, var(--secondary) 14%, transparent);
2384
+ }
2385
+
2386
+ // Online/Offline status pill (Status column): online gets a green checkmark
2387
+ // (like the Is Admin badge), offline a muted dot. Both icons are drawn via
2388
+ // ::before because inline <svg> is stripped from [innerHTML] cellHtml output.
2389
+ .lt-cell .lt-status {
2390
+ display: inline-flex;
2391
+ align-items: center;
2392
+ gap: 0.375rem;
2393
+ padding: 0.1875rem 0.5rem 0.1875rem 0.4375rem;
2394
+ font-size: 0.75rem;
2395
+ font-weight: 600;
2396
+ line-height: 1.2;
2397
+ border-radius: 999px;
2398
+
2399
+ &::before {
2400
+ content: '';
2401
+ flex: 0 0 auto;
2402
+ }
2403
+ }
2404
+
2405
+ .lt-cell .lt-status-online::before {
2406
+ width: 0.8125rem;
2407
+ height: 0.8125rem;
2408
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 7.6 5.7 10.8 11.5 3.6'/%3E%3C/svg%3E");
2409
+ background-repeat: no-repeat;
2410
+ background-position: center;
2411
+ background-size: contain;
2412
+ }
2413
+
2414
+ .lt-cell .lt-status-offline::before {
2415
+ width: 0.4375rem;
2416
+ height: 0.4375rem;
2417
+ border-radius: 50%;
2418
+ background: currentColor;
2419
+ }
2420
+
2421
+ // Color-coded Type pill: Default = blue, Router = green, each with a small icon.
2422
+ // Icon via ::before (data-URI SVG, hued to match) because inline <svg> is stripped
2423
+ // from [innerHTML] cellHtml.
2424
+ .lt-type-badge {
2425
+ display: inline-flex;
2426
+ align-items: center;
2427
+ gap: 0.375rem;
2428
+ padding: 0.1875rem 0.5rem 0.1875rem 0.4375rem;
2429
+ font-size: 0.75rem;
2430
+ font-weight: 600;
2431
+ line-height: 1.2;
2432
+ border-radius: 999px;
2433
+
2434
+ &::before {
2435
+ content: '';
2436
+ flex: 0 0 auto;
2437
+ width: 0.8125rem;
2438
+ height: 0.8125rem;
2439
+ background-repeat: no-repeat;
2440
+ background-position: center;
2441
+ background-size: contain;
2442
+ }
2443
+ }
2444
+
2445
+ .lt-type-default {
2446
+ color: #1d4ed8;
2447
+ background: color-mix(in srgb, #2563eb 12%, transparent);
2448
+
2449
+ &::before {
2450
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='%232563eb' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3' width='11' height='7' rx='1'/%3E%3Cpath d='M6 12.5h4M8 10v2.5'/%3E%3C/g%3E%3C/svg%3E");
2451
+ }
2452
+ }
2453
+
2454
+ .lt-type-router {
2455
+ color: #15803d;
2456
+ background: color-mix(in srgb, #16a34a 12%, transparent);
2457
+
2458
+ &::before {
2459
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='%2316a34a' stroke-width='1.3'%3E%3Cpath d='M8 5.4 4.5 11M8 5.4 11.5 11'/%3E%3C/g%3E%3Cg fill='%2316a34a'%3E%3Ccircle cx='8' cy='4' r='1.7'/%3E%3Ccircle cx='4' cy='12' r='1.7'/%3E%3Ccircle cx='12' cy='12' r='1.7'/%3E%3C/g%3E%3C/svg%3E");
2460
+ }
2461
+ }
2462
+
2463
+ .lt-type-other {
2464
+ color: var(--lt-cell-text);
2465
+ background: color-mix(in srgb, var(--lt-border) 45%, transparent);
2466
+
2467
+ &::before {
2468
+ display: none;
2469
+ }
2470
+ }
2471
+
2472
+ .lt-cell .lt-status-online {
2473
+ color: #15803d;
2474
+ background: color-mix(in srgb, #16a34a 12%, transparent);
2475
+ }
2476
+
2477
+ .lt-cell .lt-status-offline {
2478
+ color: var(--groupText);
2479
+ background: color-mix(in srgb, var(--groupText) 14%, transparent);
2480
+ }
2481
+
2265
2482
  .cert {
2266
2483
  cursor: pointer;
2267
2484
  width: 1.875rem;
@@ -0,0 +1,83 @@
1
+ /*
2
+ Copyright NetFoundry Inc.
3
+ Licensed under the Apache License, Version 2.0.
4
+
5
+ ─────────────────────────────────────────────────────────────────────────────
6
+ ListTable theming reference + re-skin example
7
+ ─────────────────────────────────────────────────────────────────────────────
8
+
9
+ The shared list table (`<lib-list-table>`, replacing the ag-grid `lib-data-table`)
10
+ is fully driven by CSS custom properties and hardcodes NO colors, fonts, or
11
+ key dimensions. There are two layers:
12
+
13
+ 1. UNDERLYING app tokens (--primary, --formBackground, --stroke, --icon, …).
14
+ Each `--lt-*` token DEFAULTS to one of these, so the table automatically
15
+ takes on the host app's palette:
16
+ • In OpenZiti ZAC it uses ZAC's tokens → the default look shipped here.
17
+ • In a consuming app it uses that app's tokens → it picks up that app's
18
+ colors/surfaces with zero extra work.
19
+
20
+ 2. The `--lt-*` layer (defined in shared-assets/styles/global.scss `body{}`).
21
+ Override these to fine-tune table-specific styling per host without touching
22
+ the component code or the ZAC default.
23
+
24
+ The full token contract (defaults shown in global.scss):
25
+
26
+ --lt-font typography for all table text/controls
27
+ --lt-bg scroll-area surface (default: transparent → page bg)
28
+ --lt-header-bg header row background
29
+ --lt-header-text header label color
30
+ --lt-header-underline the accent rule under the header
31
+ --lt-row-bg base row background (default transparent)
32
+ --lt-row-alt-bg zebra row background
33
+ --lt-row-hover row hover background
34
+ --lt-row-selected selected row background
35
+ --lt-cell-text cell text color
36
+ --lt-link accent (links, active sort, chips, focus)
37
+ --lt-border borders / dividers / resize grips
38
+ --lt-icon default icon color
39
+ --lt-icon-active icon hover/active color
40
+ --lt-control-bg solid surface for popovers, inputs, chips, menus
41
+ --lt-radius control/border radius
42
+ --lt-row-height body row height
43
+ --lt-toolbar-height search / filter / columns control height
44
+
45
+ ─────────────────────────────────────────────────────────────────────────────
46
+ HOW TO RE-SKIN IN A CONSUMING APP
47
+ ─────────────────────────────────────────────────────────────────────────────
48
+
49
+ In the host app's global stylesheet (loaded AFTER the lib's global.scss — e.g.
50
+ an app-level overrides.scss), drop in the block below. Most colors already follow
51
+ the host's own tokens; these tune the table-specific bits toward a flat, card-based
52
+ look. Replace the fallback literals with the matching host design tokens where they
53
+ exist.
54
+
55
+ NOTE: this file is an EXAMPLE/reference — it is not imported by the lib build.
56
+ */
57
+
58
+ // Example flat, card-based flavor — apply in the consuming app, not here.
59
+ body {
60
+ // typography
61
+ --lt-font: var(--font-family, 'Inter', system-ui, -apple-system, sans-serif);
62
+
63
+ // surfaces: flat white table, no heavy zebra — hover-driven
64
+ --lt-header-bg: var(--surface-raised, #ffffff);
65
+ --lt-header-text: var(--text-secondary, #6b7280);
66
+ --lt-header-underline: var(--border-color, #e5e7eb); // subtle rule
67
+ --lt-row-bg: var(--surface-base, #ffffff);
68
+ --lt-row-alt-bg: transparent; // no zebra; rely on hover
69
+ --lt-row-hover: var(--surface-sunken, #f6f8fb);
70
+ --lt-row-selected: color-mix(in srgb, var(--brand-primary, #1d4ed8) 8%, #ffffff);
71
+ --lt-cell-text: var(--text-primary, #111827);
72
+
73
+ // accent + chrome
74
+ --lt-link: var(--brand-primary, #1d4ed8);
75
+ --lt-icon-active: var(--brand-primary, #1d4ed8);
76
+ --lt-border: var(--border-color, #e5e7eb);
77
+ --lt-control-bg: var(--surface-raised, #ffffff);
78
+
79
+ // shape + density: softer corners, roomier rows
80
+ --lt-radius: 0.5rem;
81
+ --lt-row-height: 3.5rem;
82
+ --lt-toolbar-height: 2.5rem;
83
+ }