@y14e/path-bar 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yusuke Kamiyamane
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,89 @@
1
+ # Path Bar
2
+
3
+ Breadcrumb-style path bar implementation in TypeScript. Supports keyboard navigation, integrated menus, and seamless menu traversal.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @y14e/path-bar
9
+ ```
10
+
11
+ ```ts
12
+ // npm
13
+ import PathBar from '@y14e/path-bar@1.0.0';
14
+ // with middleware
15
+ import PathBar, { flip, offset, shift } from '@y14e/path-bar@1.0.0';
16
+
17
+ // CDNs
18
+ import PathBar from 'https://esm.sh/@y14e/path-bar@1.0.0';
19
+ // or
20
+ import PathBar from 'https://cdn.jsdelivr.net/npm/@y14e/path-bar@1.0.0/+esm';
21
+ // or
22
+ import PathBar from 'https://esm.unpkg.com/@y14e/path-bar@1.0.0';
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ```ts
28
+ new PathBar(root, options);
29
+ // => PathBar
30
+ //
31
+ // root: HTMLElement
32
+ // options (optional): PathBarOptions
33
+
34
+ ```
35
+
36
+ ## 🪄 Options
37
+
38
+ ```ts
39
+ interface PathBarOptions {
40
+ // Work in progress
41
+ }
42
+
43
+ interface PathBarPopoverOptions {
44
+ arrow?: boolean; // default: true
45
+ middleware?: Middleware[]; // default: [flip(), offset(), shift()]
46
+ placement?: Placement; // default: 'bottom-start'
47
+ }
48
+ ```
49
+
50
+ > [!NOTE]
51
+ > `Middleware` and `Placement` are provided by [Floating UI](https://floating-ui.com/). See the Floating UI docs for details.
52
+
53
+ ### ⚙️ Customize defaults
54
+
55
+ Override the global default settings applied to all path bar instances.
56
+
57
+ ```ts
58
+ import PathBar from '@y14e/path-bar';
59
+
60
+ PathBar.defaults = {
61
+ delay: 500,
62
+ selector: {
63
+ list: 'ul',
64
+ },
65
+ };
66
+
67
+ new PathBar(root);
68
+ ```
69
+
70
+ ## 📦 APIs
71
+
72
+ ### `destroy`
73
+
74
+ Destroys the instance and cleans up all event listeners and menus.
75
+
76
+ ```ts
77
+ pathBar.destroy(force);
78
+ // => Promise<void>
79
+ //
80
+ // force (optional): If true, skips waiting for animations to finish.
81
+ ```
82
+
83
+ ## Demo
84
+
85
+ https://y14e.github.io/path-bar/
86
+
87
+ ## Credits
88
+
89
+ * [Floating UI](https://floating-ui.com/)