@thinking.tools/teff 1.0.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/LICENSE +21 -0
- package/README.md +87 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 thinking.tools
|
|
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
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# teff
|
|
2
|
+
|
|
3
|
+
Semantic UI, two tiny files. teff styles plain, accessible HTML out of the box and sprinkles behavior on top with vanilla web components — no framework, no build step, no dependencies.
|
|
4
|
+
|
|
5
|
+
- **~9 kB CSS + ~3 kB JS**, minified and gzipped
|
|
6
|
+
- Dark mode built in via `light-dark()`, WCAG AA contrast, respects `prefers-reduced-motion`
|
|
7
|
+
- The two files are independent — use either without the other
|
|
8
|
+
- A fork of [oat](https://github.com/knadh/oat) by [knadh](https://github.com/knadh) ([oat.ink](https://oat.ink))
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
**CDN — no build step:**
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<link rel="stylesheet" href="https://unpkg.com/@thinking.tools/teff/teff.min.css" />
|
|
16
|
+
<script src="https://unpkg.com/@thinking.tools/teff/teff.min.js"></script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**npm — bundlers (Vite, Next, …):**
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install @thinking.tools/teff
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
// once, in your app entry
|
|
27
|
+
import "teff/teff.min.css";
|
|
28
|
+
import "teff"; // optional: registers the custom elements + the `teff` global
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Use
|
|
32
|
+
|
|
33
|
+
Write semantic HTML — it's already styled:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<button>Save</button> <button class="outline">Cancel</button>
|
|
37
|
+
|
|
38
|
+
<label>Email <input type="email" required /></label>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary>Native accordion</summary>
|
|
42
|
+
<p>No JS involved.</p>
|
|
43
|
+
</details>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The CSS covers native elements (buttons, forms, tables, `<dialog>`, `<details>`, `<progress>`, `<meter>`, …) plus a handful of class-based pieces (`.badge`, `.card`, `.row`/`.col-*`). The JS adds:
|
|
47
|
+
|
|
48
|
+
- `<teff-tabs>` and `<teff-dropdown>` — custom elements that wire ARIA and keyboard navigation around your existing markup
|
|
49
|
+
- automatic enhancements, no markup changes: `title` attributes become styled tooltips, password fields grow a show/hide toggle, `[data-sidebar]` becomes a responsive shell
|
|
50
|
+
- two imperative calls: `teff.toast("Saved.", "Done", { variant: "success" })` and `teff.shake(el)`
|
|
51
|
+
|
|
52
|
+
Open `index.html` for the full component gallery with copy-paste examples.
|
|
53
|
+
|
|
54
|
+
## Theming
|
|
55
|
+
|
|
56
|
+
Flip presets on `<html>`, or override tokens directly:
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<html data-theme="dark" data-accent="blue" data-radius="soft" data-density="compact">
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```css
|
|
63
|
+
:root {
|
|
64
|
+
--primary: light-dark(#2068c9, #7ab3ff);
|
|
65
|
+
--radius-button: 0.75rem;
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## React
|
|
70
|
+
|
|
71
|
+
teff is just markup — classes and data attributes on plain HTML work in JSX as-is. Import both files once in your entry module (see above). Two notes:
|
|
72
|
+
|
|
73
|
+
- React 19 renders custom elements like `<teff-tabs>` natively; for TypeScript, declare them in `JSX.IntrinsicElements`.
|
|
74
|
+
- teff components emit plain DOM `CustomEvent`s — listen with a `ref` + `addEventListener`; React doesn't map custom events to `on*` props.
|
|
75
|
+
|
|
76
|
+
## Build from source
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
make dist # build dist/, print sizes (esbuild comes via npm install)
|
|
80
|
+
make clean
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
CSS files concatenate in the order listed in the `Makefile`; the JS bundles from `src/js/index.js`.
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thinking.tools/teff",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
6
|
+
},
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://git@codeberg.org/thinking_tools/teff.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"ui",
|
|
13
|
+
"components",
|
|
14
|
+
"component-library",
|
|
15
|
+
"css",
|
|
16
|
+
"web-components",
|
|
17
|
+
"semantic-html",
|
|
18
|
+
"dark-mode",
|
|
19
|
+
"teff"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"teff.min.css",
|
|
23
|
+
"teff.min.js",
|
|
24
|
+
"css",
|
|
25
|
+
"js"
|
|
26
|
+
],
|
|
27
|
+
"author": "https://codeberg.org/Jolly_Good",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"description": "An ultra-lightweight semantic UI library: one CSS file, one JS file. No framework, no build step, no dependencies — dark mode built in.",
|
|
30
|
+
"main": "teff.min.js",
|
|
31
|
+
"style": "teff.min.css",
|
|
32
|
+
"unpkg": "teff.min.js",
|
|
33
|
+
"jsdelivr": "teff.min.js",
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"esbuild": "^0.28.0",
|
|
36
|
+
"eslint": "^10.4.1"
|
|
37
|
+
}
|
|
38
|
+
}
|