@apliteni/apliteni-ui 0.2.4 → 0.3.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
@@ -9,7 +9,7 @@ and light with **accent sub-themes**. Showcased and reviewed in **Storybook**, a
9
9
  published on **ui.apli.tech**.
10
10
 
11
11
  - 🎨 **Live site + Storybook** → [ui.apli.tech](https://ui.apli.tech)
12
- - 📦 **Package** → `@apliteni/apliteni-ui` (GitHub Packages)
12
+ - 📦 **Package** → [`@apliteni/apliteni-ui`](https://www.npmjs.com/package/@apliteni/apliteni-ui) (public npm)
13
13
 
14
14
  ## Why HTML + CSS (not React)
15
15
 
@@ -21,25 +21,12 @@ of truth — the portal imports it with no rewrite and no framework drift. Story
21
21
 
22
22
  ## Install
23
23
 
24
- The package lives in **GitHub Packages** (private to the `apliteni` org). Point the
25
- `@apliteni` scope at it and authenticate with a GitHub token that has `read:packages`.
26
-
27
- `.npmrc` in the consuming repo:
28
-
29
- ```
30
- @apliteni:registry=https://npm.pkg.github.com
31
- //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
32
- ```
33
-
34
- Then:
24
+ Published on the **public npm registry** no scope config, no token:
35
25
 
36
26
  ```bash
37
- NODE_AUTH_TOKEN=$(gh auth token) npm install @apliteni/apliteni-ui
27
+ npm install @apliteni/apliteni-ui
38
28
  ```
39
29
 
40
- In CI, `NODE_AUTH_TOKEN` is the workflow's `GITHUB_TOKEN`. In Docker, pass it as a
41
- build secret (see the strategy portal's Dockerfile for the pattern).
42
-
43
30
  ## Use it
44
31
 
45
32
  ```js
@@ -117,15 +104,15 @@ site/ # ui.apli.tech landing page + static server
117
104
  ## Develop
118
105
 
119
106
  ```bash
120
- NODE_AUTH_TOKEN=$(gh auth token) npm install
107
+ npm install
121
108
  npm run storybook # http://localhost:6006
122
109
  npm run build-storybook # -> storybook-static/
123
110
  node site/build.mjs # -> site/public/ (landing + kit.css)
124
111
  ```
125
112
 
126
- ## Publish (GitHub Packages)
113
+ ## Publish (public npm)
127
114
 
128
- Versioned publish runs from CI on a GitHub Release:
115
+ Versioned publish runs from CI on a GitHub Release (needs the `NPM_TOKEN` secret):
129
116
 
130
117
  ```bash
131
118
  npm version patch # or minor / major — bumps package.json + tags
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "Apliteni shared design system & UI kit — tokens, components and the deck theme, framework-agnostic (HTML + CSS).",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -25,6 +25,9 @@ const P = {
25
25
  search: '<circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/>',
26
26
  globe: '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z"/>',
27
27
  sparkle: '<path d="M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2 2M16 16l2 2M18 6l-2 2M8 16l-2 2"/>',
28
+ card: '<rect x="2" y="5" width="20" height="14" rx="2"/><path d="M2 10h20M6 15h4"/>',
29
+ doc: '<path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6M8 13h8M8 17h5"/>',
30
+ chart: '<path d="M3 3v18h18"/><path d="M8 17v-5M13 17V8M18 17v-8"/>',
28
31
  };
29
32
 
30
33
  export const icon = (name, cls = '') =>
@@ -13,8 +13,8 @@ export const ACCOUNT_NAV = [
13
13
  ['access', 'key', 'Access &amp; agents'],
14
14
  ];
15
15
 
16
- const sidebar = (nav, active) =>
17
- `<nav class="ui-side"><div class="cap">Account</div>` +
16
+ const sidebar = (nav, active, cap = 'Account') =>
17
+ `<nav class="ui-side"><div class="cap">${cap}</div>` +
18
18
  nav.map(([id, ic, label, href, target]) =>
19
19
  `<a href="${href || '#' + id}"${target ? ` target="${target}"` : ''}${id === active ? ' class="on"' : ''}>${icon(ic)}${label}</a>`).join('') +
20
20
  `<div class="ssep"></div><a class="out" href="#logout">${icon('logout')}Sign out</a></nav>`;
@@ -25,6 +25,8 @@ export function accountShell({
25
25
  account = {},
26
26
  nav = ACCOUNT_NAV,
27
27
  active = 'prefs',
28
+ cap = 'Account',
29
+ showSwitch = false,
28
30
  crumb,
29
31
  title = '',
30
32
  sub = '',
@@ -32,11 +34,11 @@ export function accountShell({
32
34
  } = {}) {
33
35
  return `<div style="position:relative;overflow:hidden;min-height:100vh">
34
36
  <span class="ui-glow ui-glow--purple" style="top:-120px;right:6%;opacity:.35"></span>
35
- ${topbar({ word, view: 'text', versions, account: { ...account, active, nav } })}
37
+ ${topbar({ word, view: 'text', showSwitch, versions, account: { ...account, active, nav } })}
36
38
  <div class="ui-shell">
37
- ${sidebar(nav, active)}
39
+ ${sidebar(nav, active, cap)}
38
40
  <div class="ui-shell__page">
39
- <div class="ui-shell__crumbs">Account / <b>${crumb || title}</b></div>
41
+ <div class="ui-shell__crumbs">${cap} / <b>${crumb || title}</b></div>
40
42
  <h1>${title}</h1>
41
43
  <div class="sub">${sub}</div>
42
44
  <div class="ui-card-stack">${body}</div>
@@ -26,6 +26,22 @@
26
26
  .ui-badge--danger { color: var(--pink); background: var(--glow-pink); }
27
27
  .ui-badge--archive { color: var(--muted); background: var(--surface); }
28
28
 
29
+ /* Semantic status variants — for record/row status in data tables
30
+ (paid / verified / pending / failed …). Same chip, mapped to meaning. */
31
+ .ui-badge--success { color: var(--green); background: var(--glow-green); }
32
+ .ui-badge--pending { color: var(--amber); background: color-mix(in srgb, var(--amber) 15%, transparent); }
33
+ .ui-badge--neutral { color: var(--muted); background: var(--surface-2); }
34
+
35
+ /* On the white light app the glow-tints wash out — give status chips a solid
36
+ tinted fill so they read at a glance. */
37
+ :root[data-theme="light"] .ui-badge--success,
38
+ :root[data-theme="light"] .ui-badge--live { color: #1f7a38; background: #dff3e4; }
39
+ :root[data-theme="light"] .ui-badge--pending,
40
+ :root[data-theme="light"] .ui-badge--warn { color: #8a5e00; background: #fbedd2; }
41
+ :root[data-theme="light"] .ui-badge--danger { color: #b7295f; background: #fbe0ea; }
42
+ :root[data-theme="light"] .ui-badge--neutral,
43
+ :root[data-theme="light"] .ui-badge--archive { color: #5c6270; background: #eceff4; }
44
+
29
45
  /* Pill: same shape, sentence case, a touch larger — a metadata chip */
30
46
  .ui-pill {
31
47
  display: inline-flex;
@@ -11,6 +11,19 @@
11
11
  position: relative;
12
12
  }
13
13
 
14
+ /* Light theme is an all-white app, so a filled card can't rely on a darker-
15
+ than-page surface the way the dark deck does — give it a hairline border +
16
+ soft shadow to read as a panel. Dark keeps the borderless deck look. */
17
+ :root[data-theme="light"] .ui-card {
18
+ border: 1px solid var(--border);
19
+ box-shadow: 0 1px 2px rgba(20, 25, 45, .04), 0 4px 14px rgba(20, 25, 45, .05);
20
+ }
21
+
22
+ /* A table wider than its card scrolls INSIDE the card instead of bleeding past
23
+ the rounded corners / clipping its last column. Clipping to the card's
24
+ border-box also keeps zebra stripes from escaping the radius. */
25
+ .ui-card:has(> .ui-table) { overflow-x: auto; }
26
+
14
27
  /* Vertical stacks space cards with the container's gap — see .ui-card-stack.
15
28
  (No `.ui-card + .ui-card` margin: it leaks into grid/flex rows and misaligns.) */
16
29
  .ui-card-stack { display: flex; flex-direction: column; gap: var(--space-5); }
@@ -34,6 +34,31 @@
34
34
  .ui-table tbody tr { transition: background var(--dur-fast) var(--ease); }
35
35
  .ui-table--hover tbody tr:hover { background: var(--surface-2); }
36
36
 
37
+ /* ── Data-table modifiers (composable) ──────────────────────────────────────
38
+ * Compose for a dense financial ledger: .ui-table--dense --zebra --hover.
39
+ * --dense compact row rhythm for many-row / many-column data
40
+ * --zebra row striping instead of per-row rules; 2px header rule; the
41
+ * (accent) hover tint out-ranks the stripe (defined after it)
42
+ * Cell helpers: .ui-table__num (right, tabular), .ui-table__code (plain
43
+ * monospace id — never a boxed code chip inside a table). */
44
+ .ui-table--dense th { padding: 0 14px 10px 0; }
45
+ .ui-table--dense td { padding: 10px 14px; font-size: var(--text-sm); white-space: nowrap; }
46
+ .ui-table--dense th:first-child,
47
+ .ui-table--dense td:first-child { padding-left: 12px; }
48
+ .ui-table--dense th:last-child,
49
+ .ui-table--dense td:last-child { padding-right: 12px; }
50
+
51
+ .ui-table--zebra th { border-bottom-width: 2px; }
52
+ .ui-table--zebra td { border-bottom: 0; }
53
+ .ui-table--zebra tbody tr:nth-child(even) td { background: var(--surface-2); }
54
+ .ui-table--zebra.ui-table--hover tbody tr:hover td,
55
+ .ui-table--zebra tbody tr:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
56
+
57
+ .ui-table__num { text-align: right; font-variant-numeric: tabular-nums; }
58
+ .ui-table th.ui-table__num { text-align: right; }
59
+ .ui-table__num--strong { color: var(--strong); font-weight: var(--weight-semibold); }
60
+ .ui-table__code { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); }
61
+
37
62
  /* Empty state inside a table area */
38
63
  .ui-empty {
39
64
  text-align: center;
@@ -149,19 +149,21 @@
149
149
  --pink: #d63c72;
150
150
  --amber: #b5730a;
151
151
 
152
- --bg: #f6f6f8;
152
+ /* A WHITE app: the page and cards are both white; cards are delineated by a
153
+ hairline border + soft shadow (see card.css), not a grey canvas. */
154
+ --bg: #ffffff;
153
155
  --bg-elevated: #ffffff;
154
156
  --surface: #ffffff;
155
- --surface-2: #f0f1f5;
156
- --surface-3: #e7e9f0;
157
+ --surface-2: #f5f6f9;
158
+ --surface-3: #eceef3;
157
159
  --seg-active-bg: #ffffff; /* white pill raised above the grey track in light */
158
- --border: #d7dae2;
159
- --border-strong: #c3c7d4;
160
+ --border: #e4e7ee;
161
+ --border-strong: #cdd2dc;
160
162
 
161
- --text: #1e232b;
162
- --strong: #0f0f13;
163
- --dim: #3d434e;
164
- --muted: #565c68;
163
+ --text: #1a1e27;
164
+ --strong: #0c0e13;
165
+ --dim: #3a404b;
166
+ --muted: #5c6270;
165
167
 
166
168
  --accent: #6a2dcc;
167
169
  --accent-strong: #6a2dcc; /* already dark enough for white text */