@rcarls/rc-navigation-rail 0.0.0-next-20260921045401

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/CHANGELOG.md ADDED
@@ -0,0 +1,87 @@
1
+ # @rcarls/rc-navigation-rail
2
+
3
+ ## 0.0.0-next-20260921045401
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [50d5610]
8
+ - Updated dependencies [4341311]
9
+ - @rcarls/rc-common@0.0.0-next-20260921045401
10
+
11
+ ## 0.6.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [6683eb9]
16
+ - Updated dependencies [ee7ba6c]
17
+ - Updated dependencies [30eb232]
18
+ - @rcarls/rc-common@0.6.0
19
+
20
+ ## 0.5.0
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [4ae2ef0]
25
+ - Updated dependencies [689340c]
26
+ - @rcarls/rc-common@0.5.0
27
+
28
+ ## 0.4.2
29
+
30
+ ### Patch Changes
31
+
32
+ - @rcarls/rc-common@0.4.2
33
+
34
+ ## 0.4.1
35
+
36
+ ### Patch Changes
37
+
38
+ - @rcarls/rc-common@0.4.1
39
+
40
+ ## 0.4.0
41
+
42
+ ### Minor Changes
43
+
44
+ - dce5749: Replace the navigation rail's shadow-DOM fallback toggle with a consumer-authored light-DOM
45
+ button, and align collapsed and expanded item layouts across the default and reference themes.
46
+ - 4f77b8c: `rc-navigation-rail` no longer renders an internal `nav` landmark or exposes
47
+ the `label` property and attribute, matching the fix already applied to
48
+ `rc-navigation-bar`. Wrap it in a labeled native `<nav>` element instead.
49
+
50
+ BREAKING CHANGE: remove the `label` property/attribute and stop rendering an
51
+ internal `<nav aria-label>`; `rc-navigation-rail` now renders a plain `div`
52
+ for its `nav` part and expects the consumer to own landmark semantics.
53
+
54
+ - ccca8e2: Add navigation bar and rail packages with shared active-indicator positioning.
55
+
56
+ ### Patch Changes
57
+
58
+ - 3efe74a: Center navigation rail header content on the inline axis and remove Material
59
+ elevation from FABs placed in the header slot.
60
+ - 6f91e7a: Fix collapsed `rc-navigation-rail` items so the whole item's box wraps icon and
61
+ label, not just the icon. The shared component pulled the label out of flow
62
+ (`position: absolute`), so a theme's whole-item background or focus ring only
63
+ covered the icon; Material's detached-pill layout now lives in its own theme
64
+ stylesheet instead of the shared base. Substrate's collapsed rail also grows
65
+ from `5rem` to `6rem` so single-word labels like "Settings" stop wrapping.
66
+ - 55e8ab5: Preserve UA-like control and surface styling until an optional theme supplies decorative tokens.
67
+ Restore themed button hover and pressed state layers, including a pointer-origin Material ripple.
68
+ - e95e204: Document the `label`, `expanded`, `default-expanded`, `active-selector`, and
69
+ `indicator-target` attributes, document the previously-missing
70
+ `--rc-navigation-rail-indicator-border` and
71
+ `--rc-navigation-rail-item-text-decoration` custom properties, and correct
72
+ `--rc-navigation-rail-indicator-bg`, `--rc-navigation-rail-indicator-radius`,
73
+ `--rc-navigation-rail-indicator-duration`, `--rc-navigation-rail-focus-ring`,
74
+ and `--rc-navigation-rail-active-color`, which documented values from the
75
+ Material and Substrate theme recipes instead of the component's own base
76
+ defaults.
77
+ - 8c567e0: Fix `expanded` so assigning `undefined` releases control back to
78
+ `default-expanded`, matching the library's controlled/uncontrolled convention
79
+ used by `rc-switch`'s `checked` and other value-like properties. It previously
80
+ ignored `undefined` writes entirely, permanently locking the rail once
81
+ `expanded` had been set once.
82
+ - e88eff8: Use the system link accent as the theme-free active-link fallback for navigation
83
+ bar and rail destinations.
84
+ - Updated dependencies [e57277f]
85
+ - Updated dependencies [ccca8e2]
86
+ - Updated dependencies [037b1b3]
87
+ - @rcarls/rc-common@0.4.0
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # `@rcarls/rc-navigation-rail`
2
+
3
+ Navigation rail layout that styles consumer-authored links.
4
+
5
+ Docs: [https://richardcarls.github.io/rc-webcomponents/components/rc-navigation-rail](https://richardcarls.github.io/rc-webcomponents/components/rc-navigation-rail).
6
+
7
+ Use this for medium and expanded PWA layouts where native links should keep working before custom
8
+ element upgrade and remain compatible with framework routers.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install @rcarls/rc-navigation-rail
14
+ ```
15
+
16
+ ## Import
17
+
18
+ ```js
19
+ import '@rcarls/rc-navigation-rail/define';
20
+ ```
21
+
22
+ ## Basic usage
23
+
24
+ ```html
25
+ <nav aria-label="Main navigation">
26
+ <rc-navigation-rail>
27
+ <button slot="toggle" type="button" aria-label="Toggle navigation">
28
+ <span data-rc-navigation-expand-icon aria-hidden="true">menu</span>
29
+ <span data-rc-navigation-collapse-icon aria-hidden="true">menu_open</span>
30
+ </button>
31
+ <a href="/recipes" aria-current="page">
32
+ <span data-rc-navigation-indicator>
33
+ <span data-rc-navigation-icon aria-hidden="true">R</span>
34
+ <span>Recipes</span>
35
+ </span>
36
+ </a>
37
+ <a href="/settings">
38
+ <span data-rc-navigation-indicator>
39
+ <span data-rc-navigation-icon aria-hidden="true">S</span>
40
+ <span>Settings</span>
41
+ </span>
42
+ </a>
43
+ </rc-navigation-rail>
44
+ </nav>
45
+ ```
46
+
47
+ The consumer-authored `<nav>` provides the navigation landmark and accessible
48
+ label. `rc-navigation-rail` deliberately provides no landmark semantics.
49
+
50
+ ## Adaptive usage
51
+
52
+ Render this component from app layout code for windows at least 600 CSS pixels wide. Keep it
53
+ collapsed at medium widths, and only offer or persist `expanded` at widths of at least 840 CSS
54
+ pixels. Use the same destination data and
55
+ active-link rules as `rc-navigation-bar` so compact and rail layouts stay in
56
+ sync.
57
+
58
+ ## Slots
59
+
60
+ | Slot | Description |
61
+ | -------- | --------------------------------------------------------- |
62
+ | default | Navigation links. Direct `<a>` children are recommended. |
63
+ | `header` | Content above the navigation links. |
64
+ | `footer` | Content pinned after the navigation links. |
65
+ | `toggle` | Native `<button>` or `rc-button` expand/collapse control. |
66
+
67
+ ## API
68
+
69
+ | Property | Attribute | Type | Default | Description |
70
+ | ----------------- | ------------------ | --------- | ----------------------------------------------------------- | ------------------------------------------------------------ |
71
+ | `expanded` | `expanded` | `boolean` | `false` | Whether the rail is expanded. Host writes are silent. |
72
+ | `defaultExpanded` | `default-expanded` | `boolean` | `false` | Initial expanded state for uncontrolled usage. |
73
+ | `activeSelector` | `active-selector` | `string` | `a[aria-current]:not([aria-current="false"])` | Selector used to find the active link. |
74
+ | `indicatorTarget` | `indicator-target` | `string` | `[data-rc-navigation-indicator], [data-rc-navigation-icon]` | Selector inside the active link used for indicator geometry. |
75
+
76
+ | Method | Description |
77
+ | ------------------ | ----------------------- |
78
+ | `expand()` | Expands the rail. |
79
+ | `collapse()` | Collapses the rail. |
80
+ | `toggleExpanded()` | Toggles expanded state. |
81
+
82
+ | Event | Detail | Description |
83
+ | --------------------------- | ----------------------- | --------------------------------------------------------------- |
84
+ | `rc-navigation-rail-toggle` | `{ expanded: boolean }` | Fired when user interaction or a method toggles expanded state. |