silva-ui 1.0.1 → 1.0.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 +20 -20
- package/README.md +2 -2
- package/dist/library/previews/index.html +51 -0
- package/dist/library/silva-ui.css +1 -1
- package/dist/library/silva-ui.js +3007 -2130
- package/dist/types/core/colors/index.d.ts +3 -2
- package/dist/types/core/sprinkles.css.d.ts +46 -16
- package/dist/types/core/theme/index.css.d.ts +30 -0
- package/package.json +5 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Blacksilva
|
|
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
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Blacksilva
|
|
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
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# silva-ui Component Library
|
|
2
2
|
|
|
3
|
-
[](https://github.com/black-silva/silva-ui/actions/workflows/publish-npm.yml)
|
|
4
|
+
[](https://bundlejs.com/?q=silva-ui)
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
[](./LICENSE)
|
|
7
7
|
|
|
@@ -0,0 +1,51 @@
|
|
|
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':()=>title('Hono JSX app','Server-rendered component output')+`<div class="server"><b>GET /</b> 200 OK<br><main>Silva UI is ready.</main></div>`+end,
|
|
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>
|