@molecule/app-sidebar-layout-vue 0.0.0-stage → 1.1.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 +202 -0
- package/README.md +265 -2
- package/dist/SidebarLayout.d.ts +71 -0
- package/dist/SidebarLayout.d.ts.map +1 -0
- package/dist/SidebarLayout.js +182 -0
- package/dist/SidebarLayout.js.map +1 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +76 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +64 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,266 @@
|
|
|
1
|
-
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-11-21T12:47:19.818Z
|
|
7
|
+
-->
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
# @molecule/app-sidebar-layout-vue
|
|
10
|
+
|
|
11
|
+
Vue vertical sidebar app shell layout.
|
|
12
|
+
|
|
13
|
+
Exports `<SidebarLayout>` plus the `SidebarLayoutProps` and
|
|
14
|
+
`SidebarNavItem` types — fixed-width left sidebar with brand link,
|
|
15
|
+
vertical nav links, and bottom user-menu / theme-toggle slots; the main
|
|
16
|
+
area on the right scrolls and renders the routed view.
|
|
17
|
+
|
|
18
|
+
It is the Vue counterpart of `@molecule/app-sidebar-layout-react`: same
|
|
19
|
+
props and the same DOM for the same input. React renders React Router's
|
|
20
|
+
`<Outlet />` in the main area; here the routed view (`<RouterView />`) is the
|
|
21
|
+
default slot.
|
|
22
|
+
|
|
23
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
24
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
25
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { createApp, defineComponent, h } from 'vue'
|
|
31
|
+
import { RouterView } from 'vue-router'
|
|
32
|
+
import { SidebarLayout } from '@molecule/app-sidebar-layout-vue'
|
|
33
|
+
import type { SidebarNavItem } from '@molecule/app-sidebar-layout-vue'
|
|
34
|
+
|
|
35
|
+
const NAV: SidebarNavItem[] = [
|
|
36
|
+
{ key: 'dashboard', to: '/dashboard', icon: 'dashboard', label: 'Dashboard' },
|
|
37
|
+
{ key: 'projects', to: '/projects', icon: 'folder', label: 'Projects' },
|
|
38
|
+
{ key: 'settings', to: '/settings', icon: 'settings', label: 'Settings' },
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
const AppShell = defineComponent({
|
|
42
|
+
setup() {
|
|
43
|
+
return () =>
|
|
44
|
+
h(
|
|
45
|
+
SidebarLayout,
|
|
46
|
+
{ appName: 'Acme App', navItems: NAV },
|
|
47
|
+
{
|
|
48
|
+
default: () => [h(RouterView)],
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
createApp(AppShell).mount('#app')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Type
|
|
58
|
+
|
|
59
|
+
`feature`
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install @molecule/app-sidebar-layout-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## API
|
|
68
|
+
|
|
69
|
+
### Interfaces
|
|
70
|
+
|
|
71
|
+
#### `SidebarNavItem`
|
|
72
|
+
|
|
73
|
+
Describes a single item in the sidebar's vertical navigation list.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
interface SidebarNavItem {
|
|
77
|
+
/** Route path the link goes to. */
|
|
78
|
+
to: string
|
|
79
|
+
/** Stable key — used for list keys and i18n key suffix. */
|
|
80
|
+
key: string
|
|
81
|
+
/** Material symbol icon name. */
|
|
82
|
+
icon?: string
|
|
83
|
+
/** Visible label. Apps that route this through `t(...)` should pass the resolved string. */
|
|
84
|
+
label: string
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### `SidebarLayoutProps`
|
|
89
|
+
|
|
90
|
+
Props accepted by the {@link SidebarLayout} component.
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
interface SidebarLayoutProps {
|
|
94
|
+
/** Brand text shown at the top of the sidebar (typically the app name). */
|
|
95
|
+
appName: string
|
|
96
|
+
/** Path the brand link navigates to. Defaults to `'/'`. */
|
|
97
|
+
logoTo?: string
|
|
98
|
+
/** Vertical nav items rendered in the sidebar. */
|
|
99
|
+
navItems: ReadonlyArray<SidebarNavItem>
|
|
100
|
+
/**
|
|
101
|
+
* Slot rendered at the bottom of the sidebar (typically a `<UserMenu />`).
|
|
102
|
+
* Passed as a prop or as the same-named slot — both work.
|
|
103
|
+
*/
|
|
104
|
+
userMenu?: VNodeChild
|
|
105
|
+
/**
|
|
106
|
+
* Optional slot rendered next to the user menu (typically a theme toggle).
|
|
107
|
+
* Passed as a prop or as the same-named slot — both work.
|
|
108
|
+
*/
|
|
109
|
+
themeToggle?: VNodeChild
|
|
110
|
+
/**
|
|
111
|
+
* Aria-label for the primary `<nav>`. Overrides the translated default
|
|
112
|
+
* (`sidebarLayout.aria.primaryNavigation`, English `'Primary navigation'`);
|
|
113
|
+
* prop > `t()` > default.
|
|
114
|
+
*/
|
|
115
|
+
navAriaLabel?: string
|
|
116
|
+
/**
|
|
117
|
+
* Sidebar width — a stack-agnostic preset (`'sm'` | `'md'` | `'lg'`) or an
|
|
118
|
+
* exact pixel `number`. Applied via inline style. Defaults to `'md'` (240px).
|
|
119
|
+
*/
|
|
120
|
+
sidebarWidth?: SidebarWidth
|
|
121
|
+
/**
|
|
122
|
+
* Legacy sidebar-width prop retained only for backward compatibility: a
|
|
123
|
+
* `w-<n>` value is PARSED to a pixel width and applied via inline style
|
|
124
|
+
* (never re-emitted as a class). `sidebarWidth` takes precedence.
|
|
125
|
+
*
|
|
126
|
+
* @deprecated Use {@link SidebarLayoutProps.sidebarWidth} instead.
|
|
127
|
+
*/
|
|
128
|
+
sidebarWidthClass?: string
|
|
129
|
+
/** Extra classes on the outer wrapper. */
|
|
130
|
+
className?: string
|
|
131
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
132
|
+
dataMolId?: string
|
|
133
|
+
/**
|
|
134
|
+
* The routed page body — the DEFAULT slot. React renders React Router's
|
|
135
|
+
* `<Outlet />` here; pass the routed view (`<RouterView />`) or any content.
|
|
136
|
+
*/
|
|
137
|
+
children?: VNodeChild
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Types
|
|
142
|
+
|
|
143
|
+
#### `SidebarWidth`
|
|
144
|
+
|
|
145
|
+
Semantic sidebar width. Mapped to a fixed pixel width internally and applied
|
|
146
|
+
via inline style (a width is one of the "specific values" a styling-agnostic
|
|
147
|
+
ClassMap cannot express as a swappable token) so the sidebar renders the same
|
|
148
|
+
regardless of which ClassMap bond is active — no Tailwind width utility leaks
|
|
149
|
+
into consumer code.
|
|
150
|
+
|
|
151
|
+
- `sm` → 208px, `md` → 240px (default), `lg` → 256px.
|
|
152
|
+
- Pass a raw `number` for an exact pixel width.
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
type SidebarWidth = 'sm' | 'md' | 'lg' | number
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Constants
|
|
159
|
+
|
|
160
|
+
#### `SidebarLayout`
|
|
161
|
+
|
|
162
|
+
Vertical sidebar shell with brand + vertical nav + bottom user-menu slot.
|
|
163
|
+
|
|
164
|
+
The page body comes from the default slot, where React renders React
|
|
165
|
+
Router's `<Outlet />`. The sidebar WIDTH is the one value a styling-agnostic
|
|
166
|
+
ClassMap can't express, so it is applied via inline style from
|
|
167
|
+
`sidebarWidth`; active-nav highlighting picks the longest prefix-match of the
|
|
168
|
+
current path, and same-path links get a `#top` fragment appended.
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
const SidebarLayout: DefineComponent<
|
|
172
|
+
ExtractPropTypes<{
|
|
173
|
+
appName: { type: StringConstructor; required: true }
|
|
174
|
+
logoTo: { type: StringConstructor; default: string }
|
|
175
|
+
navItems: { type: PropType<ReadonlyArray<SidebarNavItem>>; required: true }
|
|
176
|
+
userMenu: null
|
|
177
|
+
themeToggle: null
|
|
178
|
+
navAriaLabel: StringConstructor
|
|
179
|
+
sidebarWidth: { type: PropType<string | number> }
|
|
180
|
+
sidebarWidthClass: StringConstructor
|
|
181
|
+
className: StringConstructor
|
|
182
|
+
dataMolId: StringConstructor
|
|
183
|
+
}>,
|
|
184
|
+
() => VNode,
|
|
185
|
+
{},
|
|
186
|
+
{},
|
|
187
|
+
{},
|
|
188
|
+
ComponentOptionsMixin,
|
|
189
|
+
ComponentOptionsMixin,
|
|
190
|
+
{},
|
|
191
|
+
string,
|
|
192
|
+
PublicProps,
|
|
193
|
+
Readonly<
|
|
194
|
+
ExtractPropTypes<{
|
|
195
|
+
appName: { type: StringConstructor; required: true }
|
|
196
|
+
logoTo: { type: StringConstructor; default: string }
|
|
197
|
+
navItems: { type: PropType<ReadonlyArray<SidebarNavItem>>; required: true }
|
|
198
|
+
userMenu: null
|
|
199
|
+
themeToggle: null
|
|
200
|
+
navAriaLabel: StringConstructor
|
|
201
|
+
sidebarWidth: { type: PropType<string | number> }
|
|
202
|
+
sidebarWidthClass: StringConstructor
|
|
203
|
+
className: StringConstructor
|
|
204
|
+
dataMolId: StringConstructor
|
|
205
|
+
}>
|
|
206
|
+
> &
|
|
207
|
+
Readonly<{}>,
|
|
208
|
+
{ logoTo: string },
|
|
209
|
+
{},
|
|
210
|
+
{},
|
|
211
|
+
{},
|
|
212
|
+
string,
|
|
213
|
+
ComponentProvideOptions,
|
|
214
|
+
true,
|
|
215
|
+
{},
|
|
216
|
+
any
|
|
217
|
+
>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
- `props` — Component props (see {@link SidebarLayoutProps}).
|
|
221
|
+
|
|
222
|
+
**Returns:** The sidebar layout component.
|
|
223
|
+
|
|
224
|
+
## Injection Notes
|
|
225
|
+
|
|
226
|
+
### Requirements
|
|
227
|
+
|
|
228
|
+
Peer dependencies:
|
|
229
|
+
|
|
230
|
+
- `@molecule/app-ui` ^1.3.11
|
|
231
|
+
- `@molecule/app-ui-vue` ^1.1.0
|
|
232
|
+
- `@molecule/app-vue` ^3.6.0
|
|
233
|
+
- `vue` ^3.4.0
|
|
234
|
+
|
|
235
|
+
### Runtime Dependencies
|
|
236
|
+
|
|
237
|
+
- `@molecule/app-ui`
|
|
238
|
+
- `@molecule/app-ui-vue`
|
|
239
|
+
- `@molecule/app-vue`
|
|
240
|
+
- `vue`
|
|
241
|
+
|
|
242
|
+
- Router required: reads the current location and renders router links, so
|
|
243
|
+
it must be mounted inside the molecule router provider (the app shell
|
|
244
|
+
does that at startup).
|
|
245
|
+
- Fully ClassMap-driven: every layout/surface/border/text/state class is
|
|
246
|
+
resolved through `getClassMap()` (`cm.pageShell`, `cm.page`, `cm.surface`,
|
|
247
|
+
`cm.borderR`, …), so swapping the ClassMap bond restyles the whole shell.
|
|
248
|
+
The sidebar WIDTH is applied via inline style from `sidebarWidth`
|
|
249
|
+
(`'sm'`|`'md'`|`'lg'`|pixel `number`); the old `sidebarWidthClass` prop is
|
|
250
|
+
`@deprecated` — parsed to pixels, never re-emitted as a class.
|
|
251
|
+
- `icon` values are Material Symbols ligature names rendered with the
|
|
252
|
+
`material-symbols-outlined` font class — the one documented icon-font
|
|
253
|
+
exception. Without the font loaded, the raw icon name shows as text.
|
|
254
|
+
- Active-nav highlighting picks the longest prefix-match of the current
|
|
255
|
+
path; same-path clicks get a `#top` fragment appended.
|
|
256
|
+
- `navAriaLabel` overrides the translated nav region name; without it the
|
|
257
|
+
label comes from `t('sidebarLayout.aria.primaryNavigation')` (English
|
|
258
|
+
default `'Primary navigation'`), so it follows a locale switch through its
|
|
259
|
+
companion locale bond (`@molecule/app-locales-sidebar-layout`). Nav item
|
|
260
|
+
`label`s stay plain caller strings — translate them upstream.
|
|
261
|
+
- Requires a bonded ClassMap. Sibling: `@molecule/app-shell-layout-vue` is
|
|
262
|
+
the top header/footer shell (router-free).
|
|
263
|
+
|
|
264
|
+
## Translations
|
|
265
|
+
|
|
266
|
+
Translation strings are provided by `@molecule/app-locales-sidebar-layout`.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue vertical sidebar app shell: brand link → vertical nav → bottom
|
|
3
|
+
* user-menu / theme-toggle slots, with the routed page body in a `<main>`.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-sidebar-layout-react`'s `SidebarLayout` —
|
|
6
|
+
* the same props (React names), the same DOM for the same input.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type PropType, type VNode } from 'vue';
|
|
11
|
+
import type { SidebarNavItem } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Vertical sidebar shell with brand + vertical nav + bottom user-menu slot.
|
|
14
|
+
*
|
|
15
|
+
* The page body comes from the default slot, where React renders React
|
|
16
|
+
* Router's `<Outlet />`. The sidebar WIDTH is the one value a styling-agnostic
|
|
17
|
+
* ClassMap can't express, so it is applied via inline style from
|
|
18
|
+
* `sidebarWidth`; active-nav highlighting picks the longest prefix-match of the
|
|
19
|
+
* current path, and same-path links get a `#top` fragment appended.
|
|
20
|
+
*
|
|
21
|
+
* @param props - Component props (see {@link SidebarLayoutProps}).
|
|
22
|
+
* @returns The sidebar layout component.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SidebarLayout: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
25
|
+
appName: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
logoTo: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
navItems: {
|
|
34
|
+
type: PropType<ReadonlyArray<SidebarNavItem>>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
userMenu: null;
|
|
38
|
+
themeToggle: null;
|
|
39
|
+
navAriaLabel: StringConstructor;
|
|
40
|
+
sidebarWidth: {
|
|
41
|
+
type: PropType<string | number>;
|
|
42
|
+
};
|
|
43
|
+
sidebarWidthClass: StringConstructor;
|
|
44
|
+
className: StringConstructor;
|
|
45
|
+
dataMolId: StringConstructor;
|
|
46
|
+
}>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
|
+
appName: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
logoTo: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
navItems: {
|
|
56
|
+
type: PropType<ReadonlyArray<SidebarNavItem>>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
userMenu: null;
|
|
60
|
+
themeToggle: null;
|
|
61
|
+
navAriaLabel: StringConstructor;
|
|
62
|
+
sidebarWidth: {
|
|
63
|
+
type: PropType<string | number>;
|
|
64
|
+
};
|
|
65
|
+
sidebarWidthClass: StringConstructor;
|
|
66
|
+
className: StringConstructor;
|
|
67
|
+
dataMolId: StringConstructor;
|
|
68
|
+
}>> & Readonly<{}>, {
|
|
69
|
+
logoTo: string;
|
|
70
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
71
|
+
//# sourceMappingURL=SidebarLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarLayout.d.ts","sourceRoot":"","sources":["../src/SidebarLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAmB,MAAM,KAAK,CAAA;AAKpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AA8ChD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;cAML,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;;;;;;;cAMd,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;;;;;UAwDxD,KAAK;;;;;;;;;;cA9DC,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;;;;;;;cAMd,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;;;;;;;4EAiKrE,CAAA"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue vertical sidebar app shell: brand link → vertical nav → bottom
|
|
3
|
+
* user-menu / theme-toggle slots, with the routed page body in a `<main>`.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-sidebar-layout-react`'s `SidebarLayout` —
|
|
6
|
+
* the same props (React names), the same DOM for the same input.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { defineComponent, h } from 'vue';
|
|
11
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
12
|
+
import { Link, useLocation, useTranslation } from '@molecule/app-vue';
|
|
13
|
+
/** Pixel widths for the `sm` / `md` / `lg` presets. */
|
|
14
|
+
const SIDEBAR_WIDTH_PX = {
|
|
15
|
+
sm: 208,
|
|
16
|
+
md: 240,
|
|
17
|
+
lg: 256,
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the effective sidebar pixel width from the stack-agnostic
|
|
21
|
+
* `sidebarWidth` prop, falling back to the deprecated `sidebarWidthClass`
|
|
22
|
+
* (a `w-<n>` Tailwind utility) for backward compatibility. The legacy class is
|
|
23
|
+
* PARSED to pixels — never re-emitted as a class.
|
|
24
|
+
*
|
|
25
|
+
* @param width - The stack-agnostic width preset or explicit pixel number.
|
|
26
|
+
* @param legacyWidthClass - Deprecated Tailwind width utility (e.g. `'w-64'`).
|
|
27
|
+
* @returns The sidebar width in pixels.
|
|
28
|
+
*/
|
|
29
|
+
const resolveSidebarWidthPx = (width, legacyWidthClass) => {
|
|
30
|
+
if (typeof width === 'number')
|
|
31
|
+
return width;
|
|
32
|
+
if (width === 'sm' || width === 'md' || width === 'lg')
|
|
33
|
+
return SIDEBAR_WIDTH_PX[width];
|
|
34
|
+
if (legacyWidthClass) {
|
|
35
|
+
// Tailwind spacing scale: `w-<n>` === n × 0.25rem === n × 4px at a 16px root.
|
|
36
|
+
const match = /^w-(\d+(?:\.\d+)?)$/.exec(legacyWidthClass.trim());
|
|
37
|
+
if (match)
|
|
38
|
+
return Number(match[1]) * 4;
|
|
39
|
+
}
|
|
40
|
+
return SIDEBAR_WIDTH_PX.md;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Resolves a node-valued prop that may also arrive as a same-named slot: the
|
|
44
|
+
* slot wins, and an absent pair contributes nothing.
|
|
45
|
+
*
|
|
46
|
+
* @param slot - The slot render function, when the caller passed the slot.
|
|
47
|
+
* @param prop - The prop value, when the caller passed the prop.
|
|
48
|
+
* @returns The children to render.
|
|
49
|
+
*/
|
|
50
|
+
const slotOrProp = (slot, prop) => {
|
|
51
|
+
if (slot)
|
|
52
|
+
return slot();
|
|
53
|
+
return prop != null ? [prop] : [];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Vertical sidebar shell with brand + vertical nav + bottom user-menu slot.
|
|
57
|
+
*
|
|
58
|
+
* The page body comes from the default slot, where React renders React
|
|
59
|
+
* Router's `<Outlet />`. The sidebar WIDTH is the one value a styling-agnostic
|
|
60
|
+
* ClassMap can't express, so it is applied via inline style from
|
|
61
|
+
* `sidebarWidth`; active-nav highlighting picks the longest prefix-match of the
|
|
62
|
+
* current path, and same-path links get a `#top` fragment appended.
|
|
63
|
+
*
|
|
64
|
+
* @param props - Component props (see {@link SidebarLayoutProps}).
|
|
65
|
+
* @returns The sidebar layout component.
|
|
66
|
+
*/
|
|
67
|
+
export const SidebarLayout = defineComponent({
|
|
68
|
+
name: 'SidebarLayout',
|
|
69
|
+
props: {
|
|
70
|
+
appName: { type: String, required: true },
|
|
71
|
+
logoTo: { type: String, default: '/' },
|
|
72
|
+
navItems: {
|
|
73
|
+
type: Array,
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
userMenu: null,
|
|
77
|
+
themeToggle: null,
|
|
78
|
+
navAriaLabel: String,
|
|
79
|
+
sidebarWidth: { type: [String, Number] },
|
|
80
|
+
sidebarWidthClass: String,
|
|
81
|
+
className: String,
|
|
82
|
+
dataMolId: String,
|
|
83
|
+
},
|
|
84
|
+
setup(props, { slots }) {
|
|
85
|
+
const cm = getClassMap();
|
|
86
|
+
const { t } = useTranslation();
|
|
87
|
+
const location = useLocation();
|
|
88
|
+
/**
|
|
89
|
+
* The nav region's accessible name: an explicit `navAriaLabel` wins,
|
|
90
|
+
* otherwise the translated default (the inline English keeps the DOM
|
|
91
|
+
* identical until a locale bond supplies the key).
|
|
92
|
+
*
|
|
93
|
+
* @returns The aria-label.
|
|
94
|
+
*/
|
|
95
|
+
const navLabel = () => props.navAriaLabel ??
|
|
96
|
+
t('sidebarLayout.aria.primaryNavigation', undefined, {
|
|
97
|
+
defaultValue: 'Primary navigation',
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* The key of the nav item whose `to` is the longest prefix-match of the
|
|
101
|
+
* current pathname.
|
|
102
|
+
*
|
|
103
|
+
* @param pathname - The current location's pathname.
|
|
104
|
+
* @returns The active item's key, or null when nothing matches.
|
|
105
|
+
*/
|
|
106
|
+
const activeKey = (pathname) => props.navItems.reduce((bestKey, item) => {
|
|
107
|
+
const isMatch = pathname === item.to || pathname.startsWith(`${item.to}/`);
|
|
108
|
+
if (!isMatch)
|
|
109
|
+
return bestKey;
|
|
110
|
+
if (bestKey === null)
|
|
111
|
+
return item.key;
|
|
112
|
+
const best = props.navItems.find((i) => i.key === bestKey);
|
|
113
|
+
return best && item.to.length > best.to.length ? item.key : bestKey;
|
|
114
|
+
}, null);
|
|
115
|
+
/**
|
|
116
|
+
* Appends `#top` when `to` is the current path, so a same-route click still
|
|
117
|
+
* produces an observable URL change.
|
|
118
|
+
*
|
|
119
|
+
* @param pathname - The current location's pathname.
|
|
120
|
+
* @param to - The link's destination.
|
|
121
|
+
* @returns The link target.
|
|
122
|
+
*/
|
|
123
|
+
const samePathTarget = (pathname, to) => {
|
|
124
|
+
const samePath = pathname === to || pathname + '/' === to;
|
|
125
|
+
if (!samePath)
|
|
126
|
+
return to;
|
|
127
|
+
// React passes `#top` as a RELATIVE destination and react-router resolves
|
|
128
|
+
// it against the current location ('/#top' on the home route). This
|
|
129
|
+
// binding's `Link` renders `to` verbatim, so the root case is spelled out.
|
|
130
|
+
return `${to.replace(/\/$/, '') || '/'}#top`;
|
|
131
|
+
};
|
|
132
|
+
return () => {
|
|
133
|
+
const pathname = location.value.pathname;
|
|
134
|
+
const active = activeKey(pathname);
|
|
135
|
+
const width = resolveSidebarWidthPx(props.sidebarWidth, props.sidebarWidthClass);
|
|
136
|
+
const userMenu = slotOrProp(slots.userMenu, props.userMenu);
|
|
137
|
+
const themeToggle = slotOrProp(slots.themeToggle, props.themeToggle);
|
|
138
|
+
const hasBottom = userMenu.length > 0 || themeToggle.length > 0;
|
|
139
|
+
return h('div', {
|
|
140
|
+
class: cm.cn(cm.pageShell, cm.page, props.className),
|
|
141
|
+
'data-mol-id': props.dataMolId,
|
|
142
|
+
}, [
|
|
143
|
+
h('aside', {
|
|
144
|
+
class: cm.cn(cm.sp('p', 4), cm.shrink0, cm.flex({ direction: 'col' }), cm.surface, cm.borderR),
|
|
145
|
+
style: { width: `${width}px` },
|
|
146
|
+
}, [
|
|
147
|
+
h(Link, {
|
|
148
|
+
to: samePathTarget(pathname, props.logoTo),
|
|
149
|
+
class: cm.cn(cm.textSize('xl'), cm.fontWeight('bold'), cm.sp('mb', 6), cm.displayBlock),
|
|
150
|
+
}, () => props.appName),
|
|
151
|
+
h('nav', { class: cm.cn(cm.flex1, cm.stack(1)), 'aria-label': navLabel() }, props.navItems.map((item) => {
|
|
152
|
+
const isActive = item.key === active;
|
|
153
|
+
return h(Link, {
|
|
154
|
+
key: item.key,
|
|
155
|
+
to: samePathTarget(pathname, item.to),
|
|
156
|
+
'data-mol-id': `nav-${item.key}`,
|
|
157
|
+
'aria-current': isActive ? 'page' : undefined,
|
|
158
|
+
class: cm.cn(cm.flex({ align: 'center', gap: 'sm' }), cm.sp('px', 3), cm.sp('py', 2), cm.textSize('sm'), cm.fontWeight('medium'), cm.roundedFull, isActive
|
|
159
|
+
? cm.cn(cm.bgPrimaryContainer, cm.textOnPrimaryContainer)
|
|
160
|
+
: cm.cn(cm.textMuted, cm.link)),
|
|
161
|
+
}, () => [
|
|
162
|
+
item.icon
|
|
163
|
+
? h('span', { class: cm.cn(cm.iconGlyphFont), 'aria-hidden': 'true' }, item.icon)
|
|
164
|
+
: null,
|
|
165
|
+
h('span', item.label),
|
|
166
|
+
]);
|
|
167
|
+
})),
|
|
168
|
+
hasBottom
|
|
169
|
+
? h('div', {
|
|
170
|
+
class: cm.cn(cm.sp('pt', 4), cm.flex({ align: 'center', justify: 'between', gap: 'sm' }), cm.borderT),
|
|
171
|
+
}, [
|
|
172
|
+
...(userMenu.length > 0 ? userMenu : [h('span', { 'aria-hidden': 'true' })]),
|
|
173
|
+
...themeToggle,
|
|
174
|
+
])
|
|
175
|
+
: null,
|
|
176
|
+
]),
|
|
177
|
+
h('main', { class: cm.cn(cm.pageShellContent), style: { minWidth: '0px' } }, slotOrProp(slots.default, null)),
|
|
178
|
+
]);
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
//# sourceMappingURL=SidebarLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarLayout.js","sourceRoot":"","sources":["../src/SidebarLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA8C,MAAM,KAAK,CAAA;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIrE,uDAAuD;AACvD,MAAM,gBAAgB,GAAuC;IAC3D,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;CACR,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,qBAAqB,GAAG,CAAC,KAAuB,EAAE,gBAAyB,EAAU,EAAE;IAC3F,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACtF,IAAI,gBAAg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AC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue vertical sidebar app shell layout.
|
|
3
|
+
*
|
|
4
|
+
* Exports `<SidebarLayout>` plus the `SidebarLayoutProps` and
|
|
5
|
+
* `SidebarNavItem` types — fixed-width left sidebar with brand link,
|
|
6
|
+
* vertical nav links, and bottom user-menu / theme-toggle slots; the main
|
|
7
|
+
* area on the right scrolls and renders the routed view.
|
|
8
|
+
*
|
|
9
|
+
* It is the Vue counterpart of `@molecule/app-sidebar-layout-react`: same
|
|
10
|
+
* props and the same DOM for the same input. React renders React Router's
|
|
11
|
+
* `<Outlet />` in the main area; here the routed view (`<RouterView />`) is the
|
|
12
|
+
* default slot.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { createApp, defineComponent, h } from 'vue'
|
|
17
|
+
* import { RouterView } from 'vue-router'
|
|
18
|
+
* import { SidebarLayout } from '@molecule/app-sidebar-layout-vue'
|
|
19
|
+
* import type { SidebarNavItem } from '@molecule/app-sidebar-layout-vue'
|
|
20
|
+
*
|
|
21
|
+
* const NAV: SidebarNavItem[] = [
|
|
22
|
+
* { key: 'dashboard', to: '/dashboard', icon: 'dashboard', label: 'Dashboard' },
|
|
23
|
+
* { key: 'projects', to: '/projects', icon: 'folder', label: 'Projects' },
|
|
24
|
+
* { key: 'settings', to: '/settings', icon: 'settings', label: 'Settings' },
|
|
25
|
+
* ]
|
|
26
|
+
*
|
|
27
|
+
* const AppShell = defineComponent({
|
|
28
|
+
* setup() {
|
|
29
|
+
* return () =>
|
|
30
|
+
* h(SidebarLayout, { appName: 'Acme App', navItems: NAV }, {
|
|
31
|
+
* default: () => [h(RouterView)],
|
|
32
|
+
* })
|
|
33
|
+
* },
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* createApp(AppShell).mount('#app')
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* - Router required: reads the current location and renders router links, so
|
|
41
|
+
* it must be mounted inside the molecule router provider (the app shell
|
|
42
|
+
* does that at startup).
|
|
43
|
+
* - Fully ClassMap-driven: every layout/surface/border/text/state class is
|
|
44
|
+
* resolved through `getClassMap()` (`cm.pageShell`, `cm.page`, `cm.surface`,
|
|
45
|
+
* `cm.borderR`, …), so swapping the ClassMap bond restyles the whole shell.
|
|
46
|
+
* The sidebar WIDTH is applied via inline style from `sidebarWidth`
|
|
47
|
+
* (`'sm'`|`'md'`|`'lg'`|pixel `number`); the old `sidebarWidthClass` prop is
|
|
48
|
+
* `@deprecated` — parsed to pixels, never re-emitted as a class.
|
|
49
|
+
* - `icon` values are Material Symbols ligature names rendered with the
|
|
50
|
+
* `material-symbols-outlined` font class — the one documented icon-font
|
|
51
|
+
* exception. Without the font loaded, the raw icon name shows as text.
|
|
52
|
+
* - Active-nav highlighting picks the longest prefix-match of the current
|
|
53
|
+
* path; same-path clicks get a `#top` fragment appended.
|
|
54
|
+
* - `navAriaLabel` overrides the translated nav region name; without it the
|
|
55
|
+
* label comes from `t('sidebarLayout.aria.primaryNavigation')` (English
|
|
56
|
+
* default `'Primary navigation'`), so it follows a locale switch through its
|
|
57
|
+
* companion locale bond (`@molecule/app-locales-sidebar-layout`). Nav item
|
|
58
|
+
* `label`s stay plain caller strings — translate them upstream.
|
|
59
|
+
* - Requires a bonded ClassMap. Sibling: `@molecule/app-shell-layout-vue` is
|
|
60
|
+
* the top header/footer shell (router-free).
|
|
61
|
+
*
|
|
62
|
+
* @module
|
|
63
|
+
*/
|
|
64
|
+
export * from './SidebarLayout.js';
|
|
65
|
+
export * from './types.js';
|
|
66
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue vertical sidebar app shell layout.
|
|
3
|
+
*
|
|
4
|
+
* Exports `<SidebarLayout>` plus the `SidebarLayoutProps` and
|
|
5
|
+
* `SidebarNavItem` types — fixed-width left sidebar with brand link,
|
|
6
|
+
* vertical nav links, and bottom user-menu / theme-toggle slots; the main
|
|
7
|
+
* area on the right scrolls and renders the routed view.
|
|
8
|
+
*
|
|
9
|
+
* It is the Vue counterpart of `@molecule/app-sidebar-layout-react`: same
|
|
10
|
+
* props and the same DOM for the same input. React renders React Router's
|
|
11
|
+
* `<Outlet />` in the main area; here the routed view (`<RouterView />`) is the
|
|
12
|
+
* default slot.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { createApp, defineComponent, h } from 'vue'
|
|
17
|
+
* import { RouterView } from 'vue-router'
|
|
18
|
+
* import { SidebarLayout } from '@molecule/app-sidebar-layout-vue'
|
|
19
|
+
* import type { SidebarNavItem } from '@molecule/app-sidebar-layout-vue'
|
|
20
|
+
*
|
|
21
|
+
* const NAV: SidebarNavItem[] = [
|
|
22
|
+
* { key: 'dashboard', to: '/dashboard', icon: 'dashboard', label: 'Dashboard' },
|
|
23
|
+
* { key: 'projects', to: '/projects', icon: 'folder', label: 'Projects' },
|
|
24
|
+
* { key: 'settings', to: '/settings', icon: 'settings', label: 'Settings' },
|
|
25
|
+
* ]
|
|
26
|
+
*
|
|
27
|
+
* const AppShell = defineComponent({
|
|
28
|
+
* setup() {
|
|
29
|
+
* return () =>
|
|
30
|
+
* h(SidebarLayout, { appName: 'Acme App', navItems: NAV }, {
|
|
31
|
+
* default: () => [h(RouterView)],
|
|
32
|
+
* })
|
|
33
|
+
* },
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* createApp(AppShell).mount('#app')
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* - Router required: reads the current location and renders router links, so
|
|
41
|
+
* it must be mounted inside the molecule router provider (the app shell
|
|
42
|
+
* does that at startup).
|
|
43
|
+
* - Fully ClassMap-driven: every layout/surface/border/text/state class is
|
|
44
|
+
* resolved through `getClassMap()` (`cm.pageShell`, `cm.page`, `cm.surface`,
|
|
45
|
+
* `cm.borderR`, …), so swapping the ClassMap bond restyles the whole shell.
|
|
46
|
+
* The sidebar WIDTH is applied via inline style from `sidebarWidth`
|
|
47
|
+
* (`'sm'`|`'md'`|`'lg'`|pixel `number`); the old `sidebarWidthClass` prop is
|
|
48
|
+
* `@deprecated` — parsed to pixels, never re-emitted as a class.
|
|
49
|
+
* - `icon` values are Material Symbols ligature names rendered with the
|
|
50
|
+
* `material-symbols-outlined` font class — the one documented icon-font
|
|
51
|
+
* exception. Without the font loaded, the raw icon name shows as text.
|
|
52
|
+
* - Active-nav highlighting picks the longest prefix-match of the current
|
|
53
|
+
* path; same-path clicks get a `#top` fragment appended.
|
|
54
|
+
* - `navAriaLabel` overrides the translated nav region name; without it the
|
|
55
|
+
* label comes from `t('sidebarLayout.aria.primaryNavigation')` (English
|
|
56
|
+
* default `'Primary navigation'`), so it follows a locale switch through its
|
|
57
|
+
* companion locale bond (`@molecule/app-locales-sidebar-layout`). Nav item
|
|
58
|
+
* `label`s stay plain caller strings — translate them upstream.
|
|
59
|
+
* - Requires a bonded ClassMap. Sibling: `@molecule/app-shell-layout-vue` is
|
|
60
|
+
* the top header/footer shell (router-free).
|
|
61
|
+
*
|
|
62
|
+
* @module
|
|
63
|
+
*/
|
|
64
|
+
export * from './SidebarLayout.js';
|
|
65
|
+
export * from './types.js';
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Vue vertical sidebar app shell.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { VNodeChild } from 'vue';
|
|
7
|
+
/** Describes a single item in the sidebar's vertical navigation list. */
|
|
8
|
+
export interface SidebarNavItem {
|
|
9
|
+
/** Route path the link goes to. */
|
|
10
|
+
to: string;
|
|
11
|
+
/** Stable key — used for list keys and i18n key suffix. */
|
|
12
|
+
key: string;
|
|
13
|
+
/** Material symbol icon name. */
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** Visible label. Apps that route this through `t(...)` should pass the resolved string. */
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Semantic sidebar width. Mapped to a fixed pixel width internally and applied
|
|
20
|
+
* via inline style (a width is one of the "specific values" a styling-agnostic
|
|
21
|
+
* ClassMap cannot express as a swappable token) so the sidebar renders the same
|
|
22
|
+
* regardless of which ClassMap bond is active — no Tailwind width utility leaks
|
|
23
|
+
* into consumer code.
|
|
24
|
+
*
|
|
25
|
+
* - `sm` → 208px, `md` → 240px (default), `lg` → 256px.
|
|
26
|
+
* - Pass a raw `number` for an exact pixel width.
|
|
27
|
+
*/
|
|
28
|
+
export type SidebarWidth = 'sm' | 'md' | 'lg' | number;
|
|
29
|
+
/** Props accepted by the {@link SidebarLayout} component. */
|
|
30
|
+
export interface SidebarLayoutProps {
|
|
31
|
+
/** Brand text shown at the top of the sidebar (typically the app name). */
|
|
32
|
+
appName: string;
|
|
33
|
+
/** Path the brand link navigates to. Defaults to `'/'`. */
|
|
34
|
+
logoTo?: string;
|
|
35
|
+
/** Vertical nav items rendered in the sidebar. */
|
|
36
|
+
navItems: ReadonlyArray<SidebarNavItem>;
|
|
37
|
+
/**
|
|
38
|
+
* Slot rendered at the bottom of the sidebar (typically a `<UserMenu />`).
|
|
39
|
+
* Passed as a prop or as the same-named slot — both work.
|
|
40
|
+
*/
|
|
41
|
+
userMenu?: VNodeChild;
|
|
42
|
+
/**
|
|
43
|
+
* Optional slot rendered next to the user menu (typically a theme toggle).
|
|
44
|
+
* Passed as a prop or as the same-named slot — both work.
|
|
45
|
+
*/
|
|
46
|
+
themeToggle?: VNodeChild;
|
|
47
|
+
/**
|
|
48
|
+
* Aria-label for the primary `<nav>`. Overrides the translated default
|
|
49
|
+
* (`sidebarLayout.aria.primaryNavigation`, English `'Primary navigation'`);
|
|
50
|
+
* prop > `t()` > default.
|
|
51
|
+
*/
|
|
52
|
+
navAriaLabel?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Sidebar width — a stack-agnostic preset (`'sm'` | `'md'` | `'lg'`) or an
|
|
55
|
+
* exact pixel `number`. Applied via inline style. Defaults to `'md'` (240px).
|
|
56
|
+
*/
|
|
57
|
+
sidebarWidth?: SidebarWidth;
|
|
58
|
+
/**
|
|
59
|
+
* Legacy sidebar-width prop retained only for backward compatibility: a
|
|
60
|
+
* `w-<n>` value is PARSED to a pixel width and applied via inline style
|
|
61
|
+
* (never re-emitted as a class). `sidebarWidth` takes precedence.
|
|
62
|
+
*
|
|
63
|
+
* @deprecated Use {@link SidebarLayoutProps.sidebarWidth} instead.
|
|
64
|
+
*/
|
|
65
|
+
sidebarWidthClass?: string;
|
|
66
|
+
/** Extra classes on the outer wrapper. */
|
|
67
|
+
className?: string;
|
|
68
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
69
|
+
dataMolId?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The routed page body — the DEFAULT slot. React renders React Router's
|
|
72
|
+
* `<Outlet />` here; pass the routed view (`<RouterView />`) or any content.
|
|
73
|
+
*/
|
|
74
|
+
children?: VNodeChild;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAA;IACX,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4FAA4F;IAC5F,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;AAEtD,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAA;IACf,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,QAAQ,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAA;CACtB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-sidebar-layout-vue",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Vertical sidebar app shell: brand block + vertical NavLinks + user-menu slot, with a router outlet for nested routes",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-sidebar-layout-vue",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "vue-tsc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"molecule",
|
|
27
|
+
"layout",
|
|
28
|
+
"sidebar",
|
|
29
|
+
"vue"
|
|
30
|
+
],
|
|
31
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
36
|
+
"directory": "packages/app/features/sidebar-layout-vue"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=20"
|
|
40
|
+
},
|
|
41
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@molecule/app-ui": "^1.3.11",
|
|
47
|
+
"@molecule/app-ui-vue": "^1.1.0",
|
|
48
|
+
"@molecule/app-vue": "^3.6.0",
|
|
49
|
+
"vue": "^3.4.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
53
|
+
"@molecule/app-i18n": "1.2.2",
|
|
54
|
+
"@molecule/app-icons": "1.0.4",
|
|
55
|
+
"@molecule/app-ui": "1.5.0",
|
|
56
|
+
"@molecule/app-ui-vue": "1.2.1",
|
|
57
|
+
"@molecule/app-vue": "3.9.0",
|
|
58
|
+
"@types/node": "26.6.5",
|
|
59
|
+
"jsdom": "30.1.3",
|
|
60
|
+
"typescript": "6.0.3",
|
|
61
|
+
"vite": "8.3.5",
|
|
62
|
+
"vitest": "4.1.12",
|
|
63
|
+
"vue": "3.5.44",
|
|
64
|
+
"vue-tsc": "3.3.13"
|
|
65
|
+
}
|
|
66
|
+
}
|