Skip to content

Commit faa4f45

Browse files
committed
Merge branch '2.1'
All components started from scratch, 2026.
2 parents adc191b + bd3922b commit faa4f45

213 files changed

Lines changed: 64801 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [main, '2.0']
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: '20'
16+
cache: npm
17+
- run: npm ci
18+
- run: npm run test:ci

.gitignore

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
*~
2+
#*
3+
*#
4+
.#*
5+
notes.md
6+
drafts
7+
node_modules
8+
coverage
9+
test
10+
# Logs
11+
logs
12+
*.log
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
lerna-debug.log*
17+
18+
.claude
19+
*~
20+
21+
# Diagnostic reports (https://nodejs.org/api/report.html)
22+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
23+
24+
# Runtime data
25+
pids
26+
*.pid
27+
*.seed
28+
*.pid.lock
29+
30+
# Directory for instrumented libs generated by jscoverage/JSCover
31+
lib-cov
32+
33+
# Coverage directory used by tools like istanbul
34+
coverage
35+
*.lcov
36+
37+
# nyc test coverage
38+
.nyc_output
39+
40+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
41+
.grunt
42+
43+
# Bower dependency directory (https://bower.io/)
44+
bower_components
45+
46+
# node-waf configuration
47+
.lock-wscript
48+
49+
# Compiled binary addons (https://nodejs.org/api/addons.html)
50+
build/Release
51+
52+
# Dependency directories
53+
node_modules/
54+
jspm_packages/
55+
56+
# Snowpack dependency directory (https://snowpack.dev/)
57+
web_modules/
58+
59+
# TypeScript cache
60+
*.tsbuildinfo
61+
62+
# Optional npm cache directory
63+
.npm
64+
65+
# Optional eslint cache
66+
.eslintcache
67+
68+
# Optional stylelint cache
69+
.stylelintcache
70+
71+
# Optional REPL history
72+
.node_repl_history
73+
74+
# Output of 'npm pack'
75+
*.tgz
76+
77+
# Yarn Integrity file
78+
.yarn-integrity
79+
80+
# dotenv environment variable files
81+
.env
82+
.env.*
83+
!.env.example
84+
85+
# parcel-bundler cache (https://parceljs.org/)
86+
.cache
87+
.parcel-cache
88+
89+
# Next.js build output
90+
.next
91+
out
92+
93+
# Nuxt.js build / generate output
94+
.nuxt
95+
dist
96+
97+
# Gatsby files
98+
.cache/
99+
# Comment in the public line in if your project uses Gatsby and not Next.js
100+
# https://nextjs.org/blog/next-9-1#public-directory-support
101+
# public
102+
103+
# vuepress build output
104+
.vuepress/dist
105+
106+
# vuepress v2.x temp and cache directory
107+
.temp
108+
.cache
109+
110+
# Sveltekit cache directory
111+
.svelte-kit/
112+
113+
# vitepress build output
114+
**/.vitepress/dist
115+
116+
# vitepress cache directory
117+
**/.vitepress/cache
118+
119+
# Docusaurus cache and generated files
120+
.docusaurus
121+
122+
# Serverless directories
123+
.serverless/
124+
125+
# FuseBox cache
126+
.fusebox/
127+
128+
# DynamoDB Local files
129+
.dynamodb/
130+
131+
# Firebase cache directory
132+
.firebase/
133+
134+
# TernJS port file
135+
.tern-port
136+
137+
# Stores VSCode versions used for testing VSCode extensions
138+
.vscode-test
139+
140+
# yarn v3
141+
.pnp.*
142+
.yarn/*
143+
!.yarn/patches
144+
!.yarn/plugins
145+
!.yarn/releases
146+
!.yarn/sdks
147+
!.yarn/versions
148+
149+
# Vite logs files
150+
vite.config.js.timestamp-*
151+
vite.config.ts.timestamp-*

CSS_PLAN.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# CSS Customization Plan — sol-menu, sol-query, sol-include
2+
3+
Goal: every "magic value" in these three stylesheets resolves to `var(--token, fallback)` so a host page can theme without forking CSS.
4+
5+
## 0. Fonts (DONE)
6+
7+
- `--small-font: 16px; --medium-font: 20px; --large-font: 24px;`
8+
- `--font-size: var(--medium-font, 20px)` is the default base.
9+
- `:host` of each component declares `font-size` so the chain works in shadow scope.
10+
- No size resolves below 16px (the lone offender, `th::after` at .75em → 15px, now uses `--small-font`).
11+
12+
## 1. Spacing, sizing, radius tokens
13+
14+
Add to `root.css`:
15+
```css
16+
--space-xs: 2px;
17+
--space-sm: 4px;
18+
--space-md: 8px;
19+
--space-lg: 12px;
20+
--space-xl: 16px;
21+
--space-2xl: 24px;
22+
--radius-sm: 4px;
23+
--radius-md: 6px;
24+
```
25+
26+
Component-specific size knobs:
27+
- sol-menu: `--menu-nav-min-width: 140px; --menu-nav-max-width: 260px; --menu-popup-min-width: 160px;`
28+
- sol-query: `--bnode-modal-max-width: min(90vw, 700px); --bnode-modal-max-height: 80vh;`
29+
30+
Sweep raw `px` paddings/gaps/radii in the three component stylesheets and route them through these vars.
31+
32+
## 2. Colors / shadows / scrim
33+
34+
`root.css` already declares `--shadow`. Sweep remaining hex / rgba:
35+
- sol-menu popup `box-shadow: 0 4px 12px rgba(0,0,0,0.12)` → `var(--shadow-popup, 0 4px 12px rgba(0,0,0,0.12))`.
36+
- sol-query bnode modal `0 8px 24px var(--shadow, rgba(0,0,0,0.25))` → `var(--shadow-modal, 0 8px 24px rgba(0,0,0,0.25))`.
37+
- sol-query backdrop `rgba(0,0,0,0.4)` → `var(--scrim, rgba(0,0,0,0.4))`.
38+
- Audit anchor / link colors — already use `--accent`; nothing to change unless we want a `--link` alias.
39+
40+
## 3. Font-weight & line-height tokens
41+
42+
```css
43+
--font-weight-normal: 400;
44+
--font-weight-bold: 600;
45+
--line-height-tight: 1.25;
46+
--line-height-base: 1.5;
47+
```
48+
49+
Replace literal `600` (sol-menu group/active, sol-query th/dt/.subject-heading/.dl-field) and the `1.25` line-height in sol-include headings.
50+
51+
## 4. Per-component theming knobs
52+
53+
Prefix-scoped vars so a page can target one component without leaking to others.
54+
55+
sol-menu:
56+
- `--menu-button-padding`, `--menu-button-radius`, `--menu-active-bg`, `--menu-active-color`, `--menu-hover-bg`, `--menu-hover-color`.
57+
58+
sol-query:
59+
- `--query-th-bg` (alias of existing `--th-color`), `--query-th-color` (alias of `--th-text-color`), `--query-row-alt-bg` (alias of `--even-color`), `--query-link-color`, `--query-bnode-link-color`, `--query-cell-padding`.
60+
61+
sol-include:
62+
- `--include-code-bg`, `--include-code-padding`, `--include-blockquote-border`, `--include-blockquote-color`.
63+
64+
These layer on top of the global tokens — global vars stay the source of truth, prefix vars allow narrow overrides.
65+
66+
## 5. Cleanup / audit
67+
68+
- `root.css` declares `--text-muted` twice (lines 6 & 7); drop the first.
69+
- Decide whether `[data-theme="dark"]` should redefine the new font / spacing scales (probably not, but document).
70+
- Verify nothing else in the three stylesheets resolves below 16px after the spacing pass.
71+
- After each step: `npm run bundle` and spot-check in browser.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Solid Components
2+
3+
**This is a Work In Progress - More Help Coming Soon!**
4+
5+
This is a single npm package, **`solid-web-components`**, that ships both a set of browser web-components for Solid and a Node.js version of the same components for use in scripts or CLI tools. The same import path resolves to the right build for the runtime — for example, `import { SolQuery } from 'solid-web-components/query'` gives you the web component in a browser/bundler and the Node API in Node. You only pay for what you use.
6+
7+
```
8+
npm install solid-web-components
9+
```
10+
11+
Heavy environment-specific dependencies (`jsdom`, `@comunica/query-sparql`, `@inrupt/solid-client-authn-browser`, `@inrupt/solid-client-authn-node`, `openid-client`, `solid-ui`) are declared as optional peer dependencies — install only the ones you need.
12+
13+
Curent components:
14+
```
15+
+ = done but not documented
16+
- = in progress
17+
x = not applicable
18+
19+
web node
20+
sol-login + + login to Solid
21+
sol-form + - create solid-ui forms
22+
sol-solidos + x display resources in SolidOS
23+
sol-modal + x GUI modal
24+
sol-pod + ? expandable pod folder/file tree
25+
sol-pod-ops + ? complete file & folder management
26+
sol-wac + ? manage .acl files
27+
sol-live-edit + x RDF & other editors with graphic display of graphs
28+
sol-accordion + x GUI accordion
29+
sol-rolodex + ? GUI rolodex
30+
```
31+
32+
(c) 2023-2026, Jeff Zucker, may be freely distributed under an MIT or Apache license.

babel.config.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', { targets: { node: 'current' }, modules: false }],
4+
],
5+
};

core/adopt.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* Style helpers for Constructable Stylesheets + adoptedStyleSheets.
3+
*
4+
* `sheetFrom(css)` returns a `CSSStyleSheet` on evergreen browsers, or
5+
* `null` when the constructor is unavailable (e.g. Jest/node env). Callers
6+
* should keep the raw `CSS` string export alongside the sheet so they can
7+
* fall back to a `<style>` tag when `sheet` is null.
8+
*
9+
* `adopt(root, { sheet, css, extra })` wires a shadow root (or document)
10+
* with the baseline module sheet (+ any extras). If no sheet is available
11+
* it appends `<style>${css}</style>` into the root instead.
12+
*/
13+
14+
let _supports = null;
15+
function supports() {
16+
if (_supports !== null) return _supports;
17+
try {
18+
const s = new CSSStyleSheet();
19+
_supports = typeof s.replaceSync === 'function';
20+
} catch {
21+
_supports = false;
22+
}
23+
return _supports;
24+
}
25+
26+
export function sheetFrom(css) {
27+
if (!supports()) return null;
28+
const s = new CSSStyleSheet();
29+
s.replaceSync(css);
30+
return s;
31+
}
32+
33+
// Adopt a CSSStyleSheet into `root` (ShadowRoot or Document). When sheets
34+
// aren't supported, falls back to inserting a <style> with the given css.
35+
export function adopt(root, { sheet, css, extra = [] } = {}) {
36+
const host = root.adoptedStyleSheets !== undefined ? root : null;
37+
if (host && sheet) {
38+
const sheets = [sheet];
39+
const strings = [];
40+
for (const e of extra) {
41+
if (e instanceof CSSStyleSheet) sheets.push(e);
42+
else if (typeof e === 'string') strings.push(e);
43+
}
44+
host.adoptedStyleSheets = [...host.adoptedStyleSheets, ...sheets];
45+
for (const s of strings) appendStyle(root, s);
46+
return;
47+
}
48+
// Fallback path: inline <style> for baseline + extras.
49+
if (css) appendStyle(root, css);
50+
for (const e of extra) {
51+
if (typeof e === 'string') appendStyle(root, e);
52+
}
53+
}
54+
55+
function appendStyle(root, css) {
56+
const el = document.createElement('style');
57+
el.textContent = css;
58+
root.appendChild(el);
59+
}
60+
61+
// Ensure a named stylesheet exists in the given document/shadow-root head
62+
// exactly once. Useful for light-DOM components.
63+
export function ensureDocStyle(root, id, css) {
64+
const target = root.nodeType === 11 ? root : (root.ownerDocument || document);
65+
if (!target) return;
66+
if (target.getElementById?.(id)) return;
67+
const el = document.createElement('style');
68+
el.id = id;
69+
el.textContent = css;
70+
(target.head || target).appendChild(el);
71+
}

0 commit comments

Comments
 (0)