@lit-material/navigation 0.0.1 → 0.0.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/README.md +44 -8
- package/custom-elements.json +1403 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/navigation-bar-item-styles.d.ts +2 -0
- package/dist/navigation-bar-item-styles.d.ts.map +1 -0
- package/dist/navigation-bar-item-styles.js +125 -0
- package/dist/navigation-bar-item-styles.js.map +1 -0
- package/dist/navigation-bar-item.d.ts +50 -0
- package/dist/navigation-bar-item.d.ts.map +1 -0
- package/dist/navigation-bar-item.js +132 -0
- package/dist/navigation-bar-item.js.map +1 -0
- package/dist/navigation-bar-styles.d.ts +2 -0
- package/dist/navigation-bar-styles.d.ts.map +1 -0
- package/dist/navigation-bar-styles.js +23 -0
- package/dist/navigation-bar-styles.js.map +1 -0
- package/dist/navigation-bar.d.ts +44 -0
- package/dist/navigation-bar.d.ts.map +1 -0
- package/dist/navigation-bar.js +88 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation-drawer-item-styles.js +2 -2
- package/dist/navigation-rail-item-styles.js +3 -3
- package/dist/navigation-rail-item.d.ts +2 -1
- package/dist/navigation-rail-item.d.ts.map +1 -1
- package/dist/navigation-rail-item.js +2 -1
- package/dist/navigation-rail-item.js.map +1 -1
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @lit-material/navigation
|
|
2
2
|
|
|
3
|
-
Material Design 3 navigation drawer and navigation
|
|
3
|
+
Material Design 3 navigation drawer, navigation rail, and navigation bar web components built with
|
|
4
4
|
[Lit](https://lit.dev/). Part of [lit-material](https://github.com/bohdaq/lit-material).
|
|
5
5
|
|
|
6
|
-

|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -42,6 +42,18 @@ npm install @lit-material/navigation @lit-material/tokens
|
|
|
42
42
|
Videos
|
|
43
43
|
</lit-material-navigation-rail-item>
|
|
44
44
|
</lit-material-navigation-rail>
|
|
45
|
+
|
|
46
|
+
<!-- Navigation bar: a row of destinations sharing a bar's width equally, typically docked to the bottom. -->
|
|
47
|
+
<lit-material-navigation-bar selected="0">
|
|
48
|
+
<lit-material-navigation-bar-item>
|
|
49
|
+
<svg slot="icon">…</svg>
|
|
50
|
+
Music
|
|
51
|
+
</lit-material-navigation-bar-item>
|
|
52
|
+
<lit-material-navigation-bar-item>
|
|
53
|
+
<svg slot="icon">…</svg>
|
|
54
|
+
Videos
|
|
55
|
+
</lit-material-navigation-bar-item>
|
|
56
|
+
</lit-material-navigation-bar>
|
|
45
57
|
```
|
|
46
58
|
|
|
47
59
|
Listen for `change` to react to the selection:
|
|
@@ -109,14 +121,38 @@ Slots: default (label text, shown below the icon), `icon`, `badge` (positioned o
|
|
|
109
121
|
top-right corner). The ripple/focus-ring are scoped to the icon's pill-shaped active indicator,
|
|
110
122
|
not the whole item, matching the MD3 spec.
|
|
111
123
|
|
|
124
|
+
### `lit-material-navigation-bar`
|
|
125
|
+
|
|
126
|
+
| Property | Attribute | Type | Default |
|
|
127
|
+
| ---------- | ---------- | -------- | ------- |
|
|
128
|
+
| `selected` | `selected` | `number` | `-1` |
|
|
129
|
+
|
|
130
|
+
Slots: default (`lit-material-navigation-bar-item` elements). Unlike `lit-material-navigation-rail`,
|
|
131
|
+
there's no `alignment` property or `fab` slot — a bottom bar is a single row of equally-shared
|
|
132
|
+
destinations, not a strip with room to position things along its length.
|
|
133
|
+
|
|
134
|
+
### `lit-material-navigation-bar-item`
|
|
135
|
+
|
|
136
|
+
| Property | Attribute | Type | Default |
|
|
137
|
+
| ---------- | ---------- | --------- | ------- |
|
|
138
|
+
| `selected` | `selected` | `boolean` | `false` |
|
|
139
|
+
| `disabled` | `disabled` | `boolean` | `false` |
|
|
140
|
+
| `href` | `href` | `string` | `""` |
|
|
141
|
+
| `target` | `target` | `string` | `""` |
|
|
142
|
+
|
|
143
|
+
Slots: default (label text, shown below the icon), `icon`, `badge` (positioned over the icon's
|
|
144
|
+
top-right corner). Almost identical to `lit-material-navigation-rail-item` (same icon-pill +
|
|
145
|
+
label-below layout) — it shares the bar's width equally with its siblings instead of filling a
|
|
146
|
+
narrow vertical rail, and its indicator is 64px wide (the MD3 bar spec) rather than the rail's 56px.
|
|
147
|
+
|
|
112
148
|
## Behavior
|
|
113
149
|
|
|
114
|
-
|
|
115
|
-
same way `lit-material-tabs` does: set `selected` (an index) to reflect
|
|
116
|
-
section, and each item's own `selected` is kept in sync automatically.
|
|
117
|
-
`selected` and fires `change` — items don't manage selection themselves,
|
|
118
|
-
your router state (rather than reading it back out) is the expected
|
|
119
|
-
navigation.
|
|
150
|
+
`lit-material-navigation-drawer`, `lit-material-navigation-rail`, and `lit-material-navigation-bar`
|
|
151
|
+
all manage selection the same way `lit-material-tabs` does: set `selected` (an index) to reflect
|
|
152
|
+
your current route or section, and each item's own `selected` is kept in sync automatically.
|
|
153
|
+
Clicking an item updates `selected` and fires `change` — items don't manage selection themselves,
|
|
154
|
+
so binding `selected` to your router state (rather than reading it back out) is the expected
|
|
155
|
+
integration point for SPA navigation.
|
|
120
156
|
|
|
121
157
|
Fully out of scope for this first pass: responsive breakpoint switching (automatically swapping
|
|
122
158
|
between rail/drawer/bottom-navigation based on window size) — that's an app-level layout decision
|