@molecule/app-settings-container-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 +425 -2
- package/dist/SettingsContent.d.ts +25 -0
- package/dist/SettingsContent.d.ts.map +1 -0
- package/dist/SettingsContent.js +30 -0
- package/dist/SettingsContent.js.map +1 -0
- package/dist/SettingsLayout.d.ts +31 -0
- package/dist/SettingsLayout.d.ts.map +1 -0
- package/dist/SettingsLayout.js +47 -0
- package/dist/SettingsLayout.js.map +1 -0
- package/dist/SettingsSection.d.ts +33 -0
- package/dist/SettingsSection.d.ts.map +1 -0
- package/dist/SettingsSection.js +56 -0
- package/dist/SettingsSection.js.map +1 -0
- package/dist/SettingsSidebar.d.ts +53 -0
- package/dist/SettingsSidebar.d.ts.map +1 -0
- package/dist/SettingsSidebar.js +68 -0
- package/dist/SettingsSidebar.js.map +1 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes.d.ts +29 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +34 -0
- package/dist/nodes.js.map +1 -0
- package/dist/types.d.ts +85 -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 +63 -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,426 @@
|
|
|
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:16.998Z
|
|
7
|
+
-->
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
# @molecule/app-settings-container-vue
|
|
10
|
+
|
|
11
|
+
Vue Settings-page scaffold (layout chrome only).
|
|
12
|
+
|
|
13
|
+
Exports:
|
|
14
|
+
|
|
15
|
+
- `<SettingsLayout>` — two-column [sidebar, content] with an optional
|
|
16
|
+
`header` slot rendered above both.
|
|
17
|
+
- `<SettingsSidebar>` — controlled side-nav (`items`, `activeId`,
|
|
18
|
+
`onSelect`, optional `footer`); `SettingsSidebarItem` is
|
|
19
|
+
`{ id, label, icon? }`.
|
|
20
|
+
- `<SettingsContent>` — stacked wrapper for the right column.
|
|
21
|
+
- `<SettingsSection>` — Card-wrapped titled section (`title`,
|
|
22
|
+
`description?`, `footer?` action row, `dataMolId?`).
|
|
23
|
+
|
|
24
|
+
It is the Vue counterpart of `@molecule/app-settings-container-react`: the
|
|
25
|
+
same props (React names), the same ClassMap tokens, and the same DOM for the
|
|
26
|
+
same input, so an app moves between frameworks by changing the package name
|
|
27
|
+
in its imports.
|
|
28
|
+
|
|
29
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
30
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
31
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { defineComponent, h, ref } from 'vue'
|
|
37
|
+
|
|
38
|
+
import {
|
|
39
|
+
SettingsContent,
|
|
40
|
+
SettingsLayout,
|
|
41
|
+
SettingsSection,
|
|
42
|
+
SettingsSidebar,
|
|
43
|
+
} from '@molecule/app-settings-container-vue'
|
|
44
|
+
|
|
45
|
+
const NAV = [
|
|
46
|
+
{ id: 'profile', label: 'Profile' },
|
|
47
|
+
{ id: 'notifications', label: 'Notifications' },
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
export const SettingsPage = defineComponent({
|
|
51
|
+
setup() {
|
|
52
|
+
const active = ref('profile')
|
|
53
|
+
return () =>
|
|
54
|
+
h(SettingsLayout, null, {
|
|
55
|
+
sidebar: () => [
|
|
56
|
+
h(SettingsSidebar, {
|
|
57
|
+
items: NAV,
|
|
58
|
+
activeId: active.value,
|
|
59
|
+
onSelect: (id: string) => (active.value = id),
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
62
|
+
default: () => [
|
|
63
|
+
h(SettingsContent, null, {
|
|
64
|
+
default: () => [
|
|
65
|
+
h(
|
|
66
|
+
SettingsSection,
|
|
67
|
+
{
|
|
68
|
+
title: 'Profile',
|
|
69
|
+
description: 'Update your display name and avatar.',
|
|
70
|
+
},
|
|
71
|
+
{ default: () => [h('p', null, 'Form fields go here.')] },
|
|
72
|
+
),
|
|
73
|
+
],
|
|
74
|
+
}),
|
|
75
|
+
],
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Type
|
|
82
|
+
|
|
83
|
+
`feature`
|
|
84
|
+
|
|
85
|
+
## Installation
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm install @molecule/app-settings-container-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## API
|
|
92
|
+
|
|
93
|
+
### Interfaces
|
|
94
|
+
|
|
95
|
+
#### `SettingsLayoutProps`
|
|
96
|
+
|
|
97
|
+
Props accepted by the {@link SettingsLayout} component.
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
interface SettingsLayoutProps {
|
|
101
|
+
/**
|
|
102
|
+
* Left-side navigation (typically `<SettingsSidebar>`). Passed as a prop or
|
|
103
|
+
* as the same-named slot — both work.
|
|
104
|
+
*/
|
|
105
|
+
sidebar?: VNodeChild
|
|
106
|
+
/** Main content area — the DEFAULT slot (usually one or more `<SettingsSection>`s). */
|
|
107
|
+
children?: VNodeChild
|
|
108
|
+
/**
|
|
109
|
+
* Optional header (breadcrumb, title, save button) rendered above both
|
|
110
|
+
* columns. NOT sticky — apply your own sticky positioning if needed. Passed
|
|
111
|
+
* as a prop or as the same-named slot.
|
|
112
|
+
*/
|
|
113
|
+
header?: VNodeChild
|
|
114
|
+
/** Extra classes on the outer wrapper. */
|
|
115
|
+
className?: string
|
|
116
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
117
|
+
dataMolId?: string
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### `SettingsContentProps`
|
|
122
|
+
|
|
123
|
+
Props accepted by the {@link SettingsContent} component.
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
interface SettingsContentProps {
|
|
127
|
+
/** Active section content — the DEFAULT slot. */
|
|
128
|
+
children?: VNodeChild
|
|
129
|
+
/** Extra classes. */
|
|
130
|
+
className?: string
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### `SettingsSidebarItem`
|
|
135
|
+
|
|
136
|
+
A single navigable item in the settings sidebar.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
interface SettingsSidebarItem {
|
|
140
|
+
/** Unique id; the active item is the one whose id equals `activeId`. */
|
|
141
|
+
id: string
|
|
142
|
+
/** Visible label (a VNode or plain text). */
|
|
143
|
+
label: VNodeChild
|
|
144
|
+
/** Optional leading icon (a VNode). */
|
|
145
|
+
icon?: VNodeChild
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### `SettingsSidebarProps`
|
|
150
|
+
|
|
151
|
+
Props accepted by the {@link SettingsSidebar} component.
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
interface SettingsSidebarProps {
|
|
155
|
+
/** Items to render, in order. */
|
|
156
|
+
items: SettingsSidebarItem[]
|
|
157
|
+
/** The id of the active item (controlled — the caller owns it). */
|
|
158
|
+
activeId: string
|
|
159
|
+
/** Called with the clicked item's id. */
|
|
160
|
+
onSelect: (id: string) => void
|
|
161
|
+
/**
|
|
162
|
+
* Optional footer inside the sidebar (sign-out, plan indicator). Passed as a
|
|
163
|
+
* prop or as the same-named slot.
|
|
164
|
+
*/
|
|
165
|
+
footer?: VNodeChild
|
|
166
|
+
/**
|
|
167
|
+
* Accessible name for the `<nav>` region. Overrides the translated /
|
|
168
|
+
* `defaultValue` `'Settings'` (prop > `t()` > default).
|
|
169
|
+
*/
|
|
170
|
+
ariaLabel?: string
|
|
171
|
+
/** Extra classes. */
|
|
172
|
+
className?: string
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### `SettingsSectionProps`
|
|
177
|
+
|
|
178
|
+
Props accepted by the {@link SettingsSection} component.
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
interface SettingsSectionProps {
|
|
182
|
+
/** Section heading. Passed as a prop or as the same-named slot. */
|
|
183
|
+
title?: VNodeChild
|
|
184
|
+
/**
|
|
185
|
+
* Optional description under the heading. Passed as a prop or as the
|
|
186
|
+
* same-named slot.
|
|
187
|
+
*/
|
|
188
|
+
description?: VNodeChild
|
|
189
|
+
/** Section body — the DEFAULT slot. */
|
|
190
|
+
children?: VNodeChild
|
|
191
|
+
/**
|
|
192
|
+
* Optional footer row (save button, last-saved indicator). Passed as a prop
|
|
193
|
+
* or as the same-named slot.
|
|
194
|
+
*/
|
|
195
|
+
footer?: VNodeChild
|
|
196
|
+
/** Extra classes on the Card. */
|
|
197
|
+
className?: string
|
|
198
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
199
|
+
dataMolId?: string
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Constants
|
|
204
|
+
|
|
205
|
+
#### `SettingsContent`
|
|
206
|
+
|
|
207
|
+
Wrapper for the right-hand column of `<SettingsLayout>`. Just a
|
|
208
|
+
vertically-stacked container for one or more `<SettingsSection>`s — useful
|
|
209
|
+
as a semantic landmark and for consistent spacing.
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
const SettingsContent: DefineComponent<
|
|
213
|
+
ExtractPropTypes<{ className: PropType<SettingsContentProps['className']> }>,
|
|
214
|
+
() => VNode,
|
|
215
|
+
{},
|
|
216
|
+
{},
|
|
217
|
+
{},
|
|
218
|
+
ComponentOptionsMixin,
|
|
219
|
+
ComponentOptionsMixin,
|
|
220
|
+
{},
|
|
221
|
+
string,
|
|
222
|
+
PublicProps,
|
|
223
|
+
Readonly<ExtractPropTypes<{ className: PropType<SettingsContentProps['className']> }>> &
|
|
224
|
+
Readonly<{}>,
|
|
225
|
+
{},
|
|
226
|
+
{},
|
|
227
|
+
{},
|
|
228
|
+
{},
|
|
229
|
+
string,
|
|
230
|
+
ComponentProvideOptions,
|
|
231
|
+
true,
|
|
232
|
+
{},
|
|
233
|
+
any
|
|
234
|
+
>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
- `props` — Component props (see {@link SettingsContentProps}).
|
|
238
|
+
|
|
239
|
+
**Returns:** The settings content component.
|
|
240
|
+
|
|
241
|
+
#### `SettingsLayout`
|
|
242
|
+
|
|
243
|
+
Two-column Settings page scaffold: sidebar on the left, content on the
|
|
244
|
+
right, optional (non-sticky) header above both.
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
const SettingsLayout: DefineComponent<
|
|
248
|
+
ExtractPropTypes<{
|
|
249
|
+
sidebar: null
|
|
250
|
+
header: null
|
|
251
|
+
className: PropType<SettingsLayoutProps['className']>
|
|
252
|
+
dataMolId: PropType<SettingsLayoutProps['dataMolId']>
|
|
253
|
+
}>,
|
|
254
|
+
() => VNode,
|
|
255
|
+
{},
|
|
256
|
+
{},
|
|
257
|
+
{},
|
|
258
|
+
ComponentOptionsMixin,
|
|
259
|
+
ComponentOptionsMixin,
|
|
260
|
+
{},
|
|
261
|
+
string,
|
|
262
|
+
PublicProps,
|
|
263
|
+
Readonly<
|
|
264
|
+
ExtractPropTypes<{
|
|
265
|
+
sidebar: null
|
|
266
|
+
header: null
|
|
267
|
+
className: PropType<SettingsLayoutProps['className']>
|
|
268
|
+
dataMolId: PropType<SettingsLayoutProps['dataMolId']>
|
|
269
|
+
}>
|
|
270
|
+
> &
|
|
271
|
+
Readonly<{}>,
|
|
272
|
+
{},
|
|
273
|
+
{},
|
|
274
|
+
{},
|
|
275
|
+
{},
|
|
276
|
+
string,
|
|
277
|
+
ComponentProvideOptions,
|
|
278
|
+
true,
|
|
279
|
+
{},
|
|
280
|
+
any
|
|
281
|
+
>
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
- `props` — Component props (see {@link SettingsLayoutProps}).
|
|
285
|
+
|
|
286
|
+
**Returns:** The settings layout component.
|
|
287
|
+
|
|
288
|
+
#### `SettingsSection`
|
|
289
|
+
|
|
290
|
+
One configuration section inside a Settings page — Card-wrapped, with
|
|
291
|
+
title / description header, body slot, and optional footer action row.
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
const SettingsSection: DefineComponent<
|
|
295
|
+
ExtractPropTypes<{
|
|
296
|
+
title: null
|
|
297
|
+
description: null
|
|
298
|
+
footer: null
|
|
299
|
+
className: PropType<SettingsSectionProps['className']>
|
|
300
|
+
dataMolId: PropType<SettingsSectionProps['dataMolId']>
|
|
301
|
+
}>,
|
|
302
|
+
() => VNode,
|
|
303
|
+
{},
|
|
304
|
+
{},
|
|
305
|
+
{},
|
|
306
|
+
ComponentOptionsMixin,
|
|
307
|
+
ComponentOptionsMixin,
|
|
308
|
+
{},
|
|
309
|
+
string,
|
|
310
|
+
PublicProps,
|
|
311
|
+
Readonly<
|
|
312
|
+
ExtractPropTypes<{
|
|
313
|
+
title: null
|
|
314
|
+
description: null
|
|
315
|
+
footer: null
|
|
316
|
+
className: PropType<SettingsSectionProps['className']>
|
|
317
|
+
dataMolId: PropType<SettingsSectionProps['dataMolId']>
|
|
318
|
+
}>
|
|
319
|
+
> &
|
|
320
|
+
Readonly<{}>,
|
|
321
|
+
{},
|
|
322
|
+
{},
|
|
323
|
+
{},
|
|
324
|
+
{},
|
|
325
|
+
string,
|
|
326
|
+
ComponentProvideOptions,
|
|
327
|
+
true,
|
|
328
|
+
{},
|
|
329
|
+
any
|
|
330
|
+
>
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
- `props` — Component props (see {@link SettingsSectionProps}).
|
|
334
|
+
|
|
335
|
+
**Returns:** The settings section component.
|
|
336
|
+
|
|
337
|
+
#### `SettingsSidebar`
|
|
338
|
+
|
|
339
|
+
Vertical side-nav for Settings pages. Controlled — the caller owns
|
|
340
|
+
`activeId`; every item calls `onSelect` with its id.
|
|
341
|
+
|
|
342
|
+
The nav region's accessible name resolves through `t()` with the
|
|
343
|
+
`settingsContainer.aria.settings` key, so it follows the active locale;
|
|
344
|
+
`ariaLabel` overrides it.
|
|
345
|
+
|
|
346
|
+
```typescript
|
|
347
|
+
const SettingsSidebar: DefineComponent<
|
|
348
|
+
ExtractPropTypes<{
|
|
349
|
+
items: { type: PropType<SettingsSidebarProps['items']>; default: () => never[] }
|
|
350
|
+
activeId: PropType<SettingsSidebarProps['activeId']>
|
|
351
|
+
onSelect: PropType<SettingsSidebarProps['onSelect']>
|
|
352
|
+
footer: null
|
|
353
|
+
ariaLabel: { type: StringConstructor; default: undefined }
|
|
354
|
+
className: PropType<SettingsSidebarProps['className']>
|
|
355
|
+
}>,
|
|
356
|
+
() => VNode,
|
|
357
|
+
{},
|
|
358
|
+
{},
|
|
359
|
+
{},
|
|
360
|
+
ComponentOptionsMixin,
|
|
361
|
+
ComponentOptionsMixin,
|
|
362
|
+
{},
|
|
363
|
+
string,
|
|
364
|
+
PublicProps,
|
|
365
|
+
Readonly<
|
|
366
|
+
ExtractPropTypes<{
|
|
367
|
+
items: { type: PropType<SettingsSidebarProps['items']>; default: () => never[] }
|
|
368
|
+
activeId: PropType<SettingsSidebarProps['activeId']>
|
|
369
|
+
onSelect: PropType<SettingsSidebarProps['onSelect']>
|
|
370
|
+
footer: null
|
|
371
|
+
ariaLabel: { type: StringConstructor; default: undefined }
|
|
372
|
+
className: PropType<SettingsSidebarProps['className']>
|
|
373
|
+
}>
|
|
374
|
+
> &
|
|
375
|
+
Readonly<{}>,
|
|
376
|
+
{ items: SettingsSidebarItem[]; ariaLabel: string },
|
|
377
|
+
{},
|
|
378
|
+
{},
|
|
379
|
+
{},
|
|
380
|
+
string,
|
|
381
|
+
ComponentProvideOptions,
|
|
382
|
+
true,
|
|
383
|
+
{},
|
|
384
|
+
any
|
|
385
|
+
>
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
- `props` — Component props (see {@link SettingsSidebarProps}).
|
|
389
|
+
|
|
390
|
+
**Returns:** The settings sidebar component.
|
|
391
|
+
|
|
392
|
+
## Injection Notes
|
|
393
|
+
|
|
394
|
+
### Requirements
|
|
395
|
+
|
|
396
|
+
Peer dependencies:
|
|
397
|
+
|
|
398
|
+
- `@molecule/app-ui` ^1.0.1
|
|
399
|
+
- `@molecule/app-ui-vue` ^1.1.0
|
|
400
|
+
- `@molecule/app-vue` ^3.5.0
|
|
401
|
+
- `vue` ^3.4.0
|
|
402
|
+
|
|
403
|
+
### Runtime Dependencies
|
|
404
|
+
|
|
405
|
+
- `@molecule/app-ui`
|
|
406
|
+
- `@molecule/app-ui-vue`
|
|
407
|
+
- `@molecule/app-vue`
|
|
408
|
+
- `vue`
|
|
409
|
+
|
|
410
|
+
- The `header` slot is rendered above the columns but is NOT sticky —
|
|
411
|
+
apply your own sticky positioning if you need it pinned.
|
|
412
|
+
- The two columns do not collapse responsively — swap the sidebar for a
|
|
413
|
+
drawer on small screens yourself.
|
|
414
|
+
- Requires a bonded ClassMap. Labels are your own nodes (translate
|
|
415
|
+
upstream); the sidebar nav's `aria-label="Settings"` is hardcoded
|
|
416
|
+
English.
|
|
417
|
+
- Don't confuse with `@molecule/app-settings-panel-vue`: that package is the
|
|
418
|
+
batteries-included panel (prebuilt Account/Auth/Billing/… sections wired
|
|
419
|
+
to molecule APIs). THIS package is empty layout chrome for building your
|
|
420
|
+
own settings pages.
|
|
421
|
+
- Node-valued props (`header`, `sidebar`, `footer`, `title`, `description`)
|
|
422
|
+
arrive as a prop AND a same-named slot; components accept either.
|
|
423
|
+
|
|
424
|
+
## Translations
|
|
425
|
+
|
|
426
|
+
Translation strings are provided by `@molecule/app-locales-settings-container`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue wrapper for the right-hand column of the settings layout.
|
|
3
|
+
*
|
|
4
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
5
|
+
* `SettingsContent` — the same props (React names) and the same DOM for the
|
|
6
|
+
* same input.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type PropType, type VNode } from 'vue';
|
|
11
|
+
import type { SettingsContentProps } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Wrapper for the right-hand column of `<SettingsLayout>`. Just a
|
|
14
|
+
* vertically-stacked container for one or more `<SettingsSection>`s — useful
|
|
15
|
+
* as a semantic landmark and for consistent spacing.
|
|
16
|
+
*
|
|
17
|
+
* @param props - Component props (see {@link SettingsContentProps}).
|
|
18
|
+
* @returns The settings content component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SettingsContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
21
|
+
className: PropType<SettingsContentProps["className"]>;
|
|
22
|
+
}>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
className: PropType<SettingsContentProps["className"]>;
|
|
24
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
//# sourceMappingURL=SettingsContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsContent.d.ts","sourceRoot":"","sources":["../src/SettingsContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AAInE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;eAGH,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;UAKrD,KAAK;eALK,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;iGAOlE,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue wrapper for the right-hand column of the settings layout.
|
|
3
|
+
*
|
|
4
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
5
|
+
* `SettingsContent` — the same props (React names) and the same DOM for the
|
|
6
|
+
* same input.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { defineComponent, h } from 'vue';
|
|
11
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
12
|
+
/**
|
|
13
|
+
* Wrapper for the right-hand column of `<SettingsLayout>`. Just a
|
|
14
|
+
* vertically-stacked container for one or more `<SettingsSection>`s — useful
|
|
15
|
+
* as a semantic landmark and for consistent spacing.
|
|
16
|
+
*
|
|
17
|
+
* @param props - Component props (see {@link SettingsContentProps}).
|
|
18
|
+
* @returns The settings content component.
|
|
19
|
+
*/
|
|
20
|
+
export const SettingsContent = defineComponent({
|
|
21
|
+
name: 'SettingsContent',
|
|
22
|
+
props: {
|
|
23
|
+
className: String,
|
|
24
|
+
},
|
|
25
|
+
setup(props, { slots }) {
|
|
26
|
+
const cm = getClassMap();
|
|
27
|
+
return () => h('div', { class: cm.cn(cm.stack(6), props.className) }, slots.default?.());
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=SettingsContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsContent.js","sourceRoot":"","sources":["../src/SettingsContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA6B,MAAM,KAAK,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;IAC7C,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE;QACL,SAAS,EAAE,MAAqD;KACjE;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;QACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QAExB,OAAO,GAAU,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IACjG,CAAC;CACF,CAAC,CAAA"}
|