silva-ui 1.3.0 → 1.3.1
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 +4 -0
- package/package.json +2 -1
- package/dist/library/previews/index.html +0 -51
package/README.md
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
A Hono JSX UI component library with framework-neutral styling and Tamagui-inspired theming, built on `@vanilla-extract/css` and `@vanilla-extract/sprinkles`.
|
|
20
20
|
|
|
21
|
+
Read the [Silva UI documentation](https://blacksilva.com/silva-ui) for installation, theming, foundations, components, and API guidance.
|
|
22
|
+
|
|
23
|
+
AI tools can use the [full Silva UI reference](https://blacksilva.com/silva-ui/llms-full.txt) for the complete published documentation in one file.
|
|
24
|
+
|
|
21
25
|
Contributions are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for
|
|
22
26
|
development setup, validation commands, and pull request expectations.
|
|
23
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silva-ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "A Hono JSX UI component library with framework-neutral styling and Tamagui-inspired theming.",
|
|
5
5
|
"main": "./dist/library/silva-ui.js",
|
|
6
6
|
"module": "./dist/library/silva-ui.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"dev": "vite",
|
|
32
32
|
"build": "vite build",
|
|
33
|
+
"build:previews": "vite build --config vite.previews.config.ts",
|
|
33
34
|
"build:library": "vite build --config vite.library.config.ts",
|
|
34
35
|
"build:types": "tsc -p tsconfig.types.json",
|
|
35
36
|
"build:package": "npm run build:library && npm run build:types",
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
5
|
-
<title>Silva UI live previews</title>
|
|
6
|
-
<style>
|
|
7
|
-
:root{--bg:#f8fafc;--card:#fff;--text:#172033;--muted:#64748b;--line:#dbe4ee;--primary:#0f766e;--primary-ink:#fff;--danger:#b42318;--shadow:0 8px 22px rgba(15,23,42,.07)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.shell{min-height:100vh;padding:20px}.demo{max-width:760px;margin:auto;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:22px;box-shadow:var(--shadow)}h1,h2,h3,p{margin:0}h2{font-size:18px}h3{font-size:16px}.muted{color:var(--muted)}.small{font-size:12px}.stack{display:grid;gap:14px}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}.panel{padding:16px;border:1px solid var(--line);border-radius:12px;background:#fff}.subtle{background:#f1f5f9}.button{border:1px solid var(--primary);background:var(--primary);color:var(--primary-ink);border-radius:9px;padding:8px 12px;font:inherit;font-weight:650;cursor:pointer}.button.outline{background:#fff;color:var(--primary)}.button.ghost{background:transparent;color:var(--primary);border-color:transparent}.field{display:grid;gap:6px;font-weight:600}.input,textarea,select{font:inherit;color:var(--text);width:100%;border:1px solid #b9c7d6;border-radius:8px;padding:9px;background:#fff}textarea{min-height:76px;resize:vertical}.checkbox,.radio{display:flex;gap:8px;align-items:center;font-weight:400}.progress{height:9px;overflow:hidden;background:#e2e8f0;border-radius:999px}.progress span{display:block;height:100%;width:56%;background:var(--primary);border-radius:inherit}.avatar{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;background:#cbd5e1;color:#334155;font-weight:700}.avatar.photo{background:linear-gradient(135deg,#f59e0b,#e879f9,#22c55e);color:#fff}.list{border:1px solid var(--line);border-radius:10px;overflow:hidden}.list .item{padding:12px;display:flex;gap:10px;align-items:center;border-bottom:1px solid var(--line)}.list .item:last-child{border:0}.dot{width:9px;height:9px;border-radius:50%;background:#22c55e}.spinner{width:28px;height:28px;border:3px solid #cbd5e1;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(1turn)}}.loader{height:5px;background:#dbeafe;border-radius:99px;overflow:hidden}.loader:after{content:"";display:block;width:42%;height:100%;background:var(--primary);animation:slide 1.2s ease-in-out infinite}@keyframes slide{0%{transform:translateX(-110%)}100%{transform:translateX(340%)}}.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line)}.tab{border:0;background:transparent;padding:9px 10px;color:var(--muted);cursor:pointer}.tab.active{color:var(--primary);border-bottom:2px solid var(--primary);font-weight:700}.tabpanel{padding-top:14px}.dialog-backdrop{background:rgba(15,23,42,.08);border-radius:10px;padding:18px}.dialog{max-width:420px;margin:auto;padding:18px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}.xgroup{display:inline-flex}.xgroup .button{border-radius:0}.xgroup .button:first-child{border-radius:9px 0 0 9px}.xgroup .button:last-child{border-radius:0 9px 9px 0}.sep{height:1px;background:var(--line);border:0;width:100%}.theme{background:#12201f;color:#e5fffb;border-color:#275750}.theme .panel{background:#1d302f;color:#e5fffb;border-color:#3a615d}.theme .muted{color:#a4c5c1}.toast{border-left:4px solid #22c55e}.notice{padding:10px 12px;border-radius:9px;background:#ecfdf5;color:#065f46}.swatches{display:flex;gap:8px}.swatch{padding:15px 10px;border-radius:8px;color:#fff;font-size:12px;font-weight:700}.a{background:#0f766e}.b{background:#14b8a6}.c{background:#0f172a}.server{background:#0f172a;color:#d1fae5;border-radius:10px;padding:14px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}.server b{color:#5eead4}@media(max-width:440px){.shell{padding:10px}.demo{padding:15px}}
|
|
8
|
-
</style></head>
|
|
9
|
-
<body><main class="shell"><section class="demo" id="app"></section></main>
|
|
10
|
-
<script>
|
|
11
|
-
const example = location.hash.slice(1) || new URLSearchParams(location.search).get('example') || 'default';
|
|
12
|
-
const app = document.querySelector('#app');
|
|
13
|
-
const button=(label,kind='')=>`<button class="button ${kind}" type="button">${label}</button>`;
|
|
14
|
-
const card=(content,extra='')=>`<div class="panel ${extra}">${content}</div>`;
|
|
15
|
-
const title=(name,sub='Interactive visual result')=>`<div class="stack"><div><h2>${name}</h2><p class="muted small">${sub}</p></div>`;
|
|
16
|
-
const end='</div>';
|
|
17
|
-
const previews={
|
|
18
|
-
'display-1':()=>title('Card')+card(`<div class="stack"><div class="row between"><div><h3>Storage</h3><p class="muted">18 GB of 50 GB used</p></div></div><div class="progress"><span style="width:36%"></span></div><div>${button('Manage storage','outline')}</div></div>`)+end,
|
|
19
|
-
'display-2':()=>title('Avatar and image')+`<div class="row"><div class="avatar photo">BS</div><div class="stack"><div class="panel subtle" style="width:210px;height:80px;display:grid;place-items:center;color:#475569">Product banner</div><p class="muted small">Image with fallback avatar</p></div></div>`+end,
|
|
20
|
-
'display-3':()=>title('List item')+`<div class="list"><div class="item"><div class="avatar" style="width:32px;height:32px">BS</div><div><b>BlackSilva</b><div class="muted small">Owner</div></div></div></div>`+end,
|
|
21
|
-
'display-4':()=>title('Loading states')+`<div class="row"><div class="spinner"></div><div class="stack" style="flex:1"><span class="muted small">Saving your changes</span><div class="loader"></div></div></div>`+end,
|
|
22
|
-
'forms-1':()=>title('Subscribe form')+`<form class="stack" onsubmit="event.preventDefault();this.querySelector('.notice').hidden=false"><label class="field">Email address<input class="input" type="email" placeholder="you@example.com" required></label><p class="muted small">We will only send product updates.</p>${button('Subscribe')}<p class="notice" hidden>Subscribed locally for this preview.</p></form>`+end,
|
|
23
|
-
'forms-2':()=>title('Message field')+`<label class="field">Message<textarea placeholder="Tell us what you need."></textarea></label>`+end,
|
|
24
|
-
'forms-3':()=>title('Choice controls')+`<div class="stack"><label class="checkbox"><input type="checkbox"> I agree to the terms</label><label class="checkbox"><input type="checkbox" checked> Enable alerts</label><div class="row"><label class="radio"><input type="radio" name="plan"> Starter</label><label class="radio"><input type="radio" name="plan" checked> Pro</label></div><div class="progress"><span style="width:72%"></span></div></div>`+end,
|
|
25
|
-
'forms-4':()=>title('Button variants')+`<div class="row">${button('Save changes')}${button('Preview','outline')}${button('Cancel','ghost')}</div>`+end,
|
|
26
|
-
'overlay-1':()=>title('Dialog')+`<div class="dialog-backdrop"><div class="dialog stack"><div><h3>Delete project?</h3><p class="muted">This cannot be undone.</p></div><div class="row" style="justify-content:flex-end">${button('Cancel','outline')}${button('Delete')}</div></div></div>`+end,
|
|
27
|
-
'overlay-2':()=>title('Tabs')+`<div class="tabs"><button class="tab active">Profile</button><button class="tab">Security</button></div><div class="tabpanel">Profile content</div>`+end,
|
|
28
|
-
'layout-1':()=>title('Box')+card('Content','subtle')+end,
|
|
29
|
-
'layout-2':()=>title('Stack layout')+card(`<div class="stack"><h3>Account settings</h3><div class="row between"><span>Email alerts</span><label><input type="checkbox" checked aria-label="Email alerts"></label></div></div>`)+end,
|
|
30
|
-
'layout-3':()=>title('XGroup')+`<div class="xgroup">${button('Day','outline')}${button('Week','outline')}${button('Month','outline')}</div>`+end,
|
|
31
|
-
'layout-4':()=>title('Separator')+`<div class="stack"><span>Content above</span><hr class="sep"><span>Content below</span></div>`+end,
|
|
32
|
-
'sprinkles-1':()=>title('Sprinkles surface')+card(`<h3>Build once, compose anywhere</h3><p class="muted">Spacing, colour and border-radius tokens are applied together.</p>`)+end,
|
|
33
|
-
'sprinkles-2':()=>title('Responsive layout')+`<div class="row"><div class="panel subtle" style="flex:1">Main content</div><div class="panel" style="flex:1">Sidebar</div></div>`+end,
|
|
34
|
-
'typography-1':()=>title('Text styles')+`<div class="stack"><strong>Strong emphasis</strong><p class="muted">Supporting copy</p></div>`+end,
|
|
35
|
-
'typography-2':()=>title('Headings')+`<div class="stack"><h1 style="font-size:26px">Build faster</h1><h3>A short, readable description.</h3><p class="muted">Clear hierarchy without custom CSS.</p></div>`+end,
|
|
36
|
-
'typography-3':()=>title('Paragraph')+`<p class="muted">A readable paragraph with semantic colour and comfortable line height.</p>`+end,
|
|
37
|
-
'intro-1':()=>title('Quick start')+card(`<div class="stack"><h3>Welcome to Silva UI</h3><p class="muted">Theme-aware components ready for composition.</p>${button('Get started')}</div>`)+end,
|
|
38
|
-
'install-1':()=>title('Style import','Bundled stylesheet ready')+`<div class="server"><b>✓</b> Silva UI styles loaded successfully</div>`+end,
|
|
39
|
-
'install-2':()=>`<div class="stack" style="max-width:400px;gap:16px"><h1 style="font-size:30px;line-height:1.2">Hello, Silva</h1><p class="muted">Your UI is ready to grow.</p>${button('Get started')}</div>`,
|
|
40
|
-
'recipes-1':()=>title('Settings row')+card(`<div class="row between"><div><b>Email notifications</b><div class="muted small">Receive a summary of account activity.</div></div><input type="checkbox" checked aria-label="Email notifications"></div>`)+end,
|
|
41
|
-
'recipes-2':()=>title('Empty state')+card(`<div class="stack" style="text-align:center;justify-items:center"><h3>No projects yet</h3><p class="muted">Create your first project to get started.</p>${button('Create project')}</div>`)+end,
|
|
42
|
-
'recipes-3':()=>title('Toast')+`<div class="panel toast"><b>Changes saved</b><div class="muted">Your profile is up to date.</div></div>`+end,
|
|
43
|
-
'recipes-4':()=>title('Theme preview')+`<div class="row"><div class="panel">light</div><div class="panel theme">dark</div><div class="panel" style="border-color:#14b8a6;color:#0f766e">emerald</div></div>`+end,
|
|
44
|
-
'theming-1':()=>title('Built-in dark theme')+card(`<p>Semantic tokens follow the active theme.</p>`,'theme')+end,
|
|
45
|
-
'theming-2':()=>title('Nested theme scopes')+card(`<div class="panel" style="background:#0f766e;color:#fff;border:0">This nested section uses emerald tokens.</div>`,'theme')+end,
|
|
46
|
-
'theming-3':()=>title('Custom theme definition')+`<div class="swatches"><div class="swatch a">primary</div><div class="swatch b">accent</div><div class="swatch c">surface</div></div>`+end,
|
|
47
|
-
'default':()=>title('Silva UI example')+card(`<div class="stack"><h3>Live component preview</h3><p class="muted">This is the rendered visual result of the example.</p>${button('Try action')}</div>`)+end
|
|
48
|
-
};
|
|
49
|
-
app.innerHTML=(previews[example]||previews.default)();
|
|
50
|
-
app.addEventListener('click',(event)=>{const tab=event.target.closest('.tab');if(tab){tab.parentElement.querySelectorAll('.tab').forEach(x=>x.classList.remove('active'));tab.classList.add('active');document.querySelector('.tabpanel').textContent=tab.textContent+' content';}});
|
|
51
|
-
</script></body></html>
|