@tobedone-de/ameva-scrollbar 0.4.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ToBeDone.de
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,104 @@
1
+ # AMEVA Scrollbar
2
+
3
+ A framework-free overlay scrollbar with DOM-based tracks and thumbs that can be fully styled with CSS.
4
+
5
+ It was built for ameva.app viewport and element scroll containers, including custom visual effects such as glow, blur, gradients, shadows, and glass-style overlays.
6
+
7
+ ## Features
8
+
9
+ 1. Framework-free JavaScript and CSS scrollbar.
10
+ 2. Custom overlay scrollbar for viewport and element scroll containers.
11
+ 3. Fully stylable DOM-based track and thumb elements.
12
+ 4. Supports advanced CSS effects such as glow, blur, gradients, shadows, and glass-style overlays.
13
+ 5. Vertical and optional horizontal scrollbars.
14
+ 6. Data attribute based configuration.
15
+ 7. Runtime refresh and destroy helpers for dynamic interfaces.
16
+ 8. No runtime dependencies.
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ npm install @tobedone-de/ameva-scrollbar/
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```js
27
+ import { initializeScrollbar, refreshScrollbar } from '@tobedone-de/ameva-scrollbar/';
28
+ import '@tobedone-de/ameva-scrollbar/styles.css';
29
+
30
+ initializeScrollbar();
31
+ ```
32
+
33
+ Add `data-amevascrollbar` to scrollable elements:
34
+
35
+ ```html
36
+ <div data-amevascrollbar>
37
+ ...
38
+ </div>
39
+ ```
40
+
41
+ The viewport scrollbar is opt-in:
42
+
43
+ ```js
44
+ initializeScrollbar({
45
+ viewport: true,
46
+ });
47
+ ```
48
+
49
+ The package does not auto-detect app-specific body classes. Pass `viewport: true` when a page-level scrollbar should be created.
50
+
51
+ Initialize only the viewport scrollbar:
52
+
53
+ ```js
54
+ initializeScrollbar({
55
+ elements: false,
56
+ viewport: true,
57
+ });
58
+ ```
59
+
60
+ `initializeScrollbar()` and `refreshScrollbar()` return `{ elements, viewport }`, where `elements` is an array of element scrollbar instances and `viewport` is the viewport instance or `null`. `destroyScrollbar()` returns `{ elements, viewport }`, where `elements` is the number of destroyed element instances and `viewport` is a boolean.
61
+
62
+ ## Data Attributes
63
+
64
+ - `data-amevascrollbar-x="true"` enables a horizontal element scrollbar.
65
+ - `data-amevascrollbar-y="false"` disables the vertical element scrollbar.
66
+ - `data-amevascrollbar-edge="flush"` aligns element scrollbar overlays to the host edge.
67
+ - `data-amevascrollbar-width`, `data-amevascrollbar-size`, or `data-amevascrollbar-track-size` override visible track size.
68
+ - `data-amevascrollbar-hit-area` or `data-amevascrollbar-hit-size` override pointer hit area.
69
+ - `data-amevascrollbar-inset`, `data-amevascrollbar-inset-x`, `data-amevascrollbar-inset-y`, and `data-amevascrollbar-inline-end-inset` control element scrollbar placement.
70
+ - `data-amevascrollbar-thumb-min-size` and `data-amevascrollbar-thumb-padding` control thumb sizing.
71
+ - `data-amevascrollbar-top`, `data-amevascrollbar-right`, and `data-amevascrollbar-bottom` control viewport scrollbar offsets.
72
+
73
+ Generated DOM classes and CSS variables stay inside the `ameva-scrollbar` namespace.
74
+
75
+ ## Styling Hooks
76
+
77
+ - `--ameva-scrollbar-radius` controls track and thumb rounding.
78
+ - `--ameva-scrollbar-viewport-z-index` controls the viewport scrollbar layer.
79
+ - `--ameva-scrollbar-element-z-index` controls element scrollbar overlays.
80
+ - `--ameva-scrollbar-track-size`, `--ameva-scrollbar-hit-size`, `--ameva-scrollbar-thumb-min-size`, and `--ameva-scrollbar-thumb-padding` are set from data attributes at runtime and can also be overridden in CSS.
81
+
82
+ ## Exports
83
+
84
+ ```js
85
+ import {
86
+ AmevaScrollbar,
87
+ destroyElementScrollbar,
88
+ destroyScrollbar,
89
+ destroyViewportScrollbar,
90
+ getScopedElements,
91
+ initializeElementScrollbar,
92
+ initializeScrollbar,
93
+ initializeViewportScrollbar,
94
+ refreshScrollbar,
95
+ } from '@tobedone-de/ameva-scrollba';
96
+ ```
97
+
98
+ ## Notes
99
+
100
+ This package currently ships source ES modules and CSS directly. It has no runtime dependencies.
101
+
102
+ ## License
103
+
104
+ MIT © 2026 ToBeDone.de
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@tobedone-de/ameva-scrollbar",
3
+ "version": "0.4.2",
4
+ "description": "Framework-free overlay scrollbar with fully CSS-stylable tracks and thumbs for custom visual effects.",
5
+ "type": "module",
6
+ "main": "./src/index.js",
7
+ "module": "./src/index.js",
8
+ "exports": {
9
+ ".": "./src/index.js",
10
+ "./styles.css": "./src/styles.css"
11
+ },
12
+ "files": [
13
+ "src",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "sideEffects": [
18
+ "./src/styles.css"
19
+ ],
20
+ "keywords": [
21
+ "scrollbar",
22
+ "overlay-scrollbar",
23
+ "custom-scrollbar",
24
+ "ameva",
25
+ "tobedone"
26
+ ],
27
+ "author": "tobedone",
28
+ "homepage": "https://www.tobedone.de",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/tobedone-de/ameva-scrollbar.git"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/tobedone-de/ameva-scrollbar/issues"
35
+ },
36
+ "license": "MIT",
37
+ "publishConfig": {
38
+ "access": "public"
39
+ }
40
+ }