@molecule/app-settings-container-vue 0.0.0-stage → 0.0.1-stage
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 +10 -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,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @molecule/app-settings-container-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vue layout for Settings pages (sidebar + content + section cards)
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install @molecule/app-settings-container-vue
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Part of the [Molecule](https://www.molecule.dev) package fleet. This page carries the manifest summary; the full generated documentation ships with the package's first committed version.
|
|
10
|
+
|
|
11
|
+
License: Apache-2.0
|
|
@@ -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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue two-column settings-page scaffold: optional header, sidebar on the left,
|
|
3
|
+
* content on the right.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
6
|
+
* `SettingsLayout` — the same props (React names), the same ClassMap tokens,
|
|
7
|
+
* and the same DOM for the same input.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { type PropType, type VNode } from 'vue';
|
|
12
|
+
import type { SettingsLayoutProps } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Two-column Settings page scaffold: sidebar on the left, content on the
|
|
15
|
+
* right, optional (non-sticky) header above both.
|
|
16
|
+
*
|
|
17
|
+
* @param props - Component props (see {@link SettingsLayoutProps}).
|
|
18
|
+
* @returns The settings layout component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SettingsLayout: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
21
|
+
sidebar: null;
|
|
22
|
+
header: null;
|
|
23
|
+
className: PropType<SettingsLayoutProps["className"]>;
|
|
24
|
+
dataMolId: PropType<SettingsLayoutProps["dataMolId"]>;
|
|
25
|
+
}>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
+
sidebar: null;
|
|
27
|
+
header: null;
|
|
28
|
+
className: PropType<SettingsLayoutProps["className"]>;
|
|
29
|
+
dataMolId: PropType<SettingsLayoutProps["dataMolId"]>;
|
|
30
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
//# sourceMappingURL=SettingsLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsLayout.d.ts","sourceRoot":"","sources":["../src/SettingsLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AAKnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;eAOF,QAAQ,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;eAC1C,QAAQ,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;UAKpD,KAAK;;;eANK,QAAQ,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;eAC1C,QAAQ,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;iGAuBjE,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue two-column settings-page scaffold: optional header, sidebar on the left,
|
|
3
|
+
* content on the right.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
6
|
+
* `SettingsLayout` — the same props (React names), the same ClassMap tokens,
|
|
7
|
+
* and the same DOM for the same input.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { defineComponent, h } from 'vue';
|
|
12
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
13
|
+
import { nodeValue } from './nodes.js';
|
|
14
|
+
/**
|
|
15
|
+
* Two-column Settings page scaffold: sidebar on the left, content on the
|
|
16
|
+
* right, optional (non-sticky) header above both.
|
|
17
|
+
*
|
|
18
|
+
* @param props - Component props (see {@link SettingsLayoutProps}).
|
|
19
|
+
* @returns The settings layout component.
|
|
20
|
+
*/
|
|
21
|
+
export const SettingsLayout = defineComponent({
|
|
22
|
+
name: 'SettingsLayout',
|
|
23
|
+
props: {
|
|
24
|
+
// Node-valued props: declared with `null` (any runtime type, no
|
|
25
|
+
// validation — a VNode, a string, or `null` to omit).
|
|
26
|
+
sidebar: null,
|
|
27
|
+
header: null,
|
|
28
|
+
className: String,
|
|
29
|
+
dataMolId: String,
|
|
30
|
+
},
|
|
31
|
+
setup(props, { slots }) {
|
|
32
|
+
const cm = getClassMap();
|
|
33
|
+
return () => h('div', {
|
|
34
|
+
'data-mol-id': props.dataMolId,
|
|
35
|
+
class: cm.cn(cm.stack(4), props.className),
|
|
36
|
+
}, [
|
|
37
|
+
...nodeValue(props.header, slots.header),
|
|
38
|
+
h('div', { class: cm.flex({ align: 'start', gap: 'lg' }) }, [
|
|
39
|
+
h('aside', { class: cm.shrink0 }, nodeValue(props.sidebar, slots.sidebar)),
|
|
40
|
+
h('main', { class: cm.flex1 }, [
|
|
41
|
+
h('div', { class: cm.stack(6) }, nodeValue(undefined, slots.default)),
|
|
42
|
+
]),
|
|
43
|
+
]),
|
|
44
|
+
]);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=SettingsLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsLayout.js","sourceRoot":"","sources":["../src/SettingsLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA6B,MAAM,KAAK,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAGtC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC;IAC5C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE;QACL,gEAAgE;QAChE,sDAAsD;QACtD,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,MAAoD;QAC/D,SAAS,EAAE,MAAoD;KAChE;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;QACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QAExB,OAAO,GAAU,EAAE,CACjB,CAAC,CACC,KAAK,EACL;YACE,aAAa,EAAE,KAAK,CAAC,SAAS;YAC9B,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;SAC3C,EACD;YACE,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACxC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;gBAC1D,CAAC,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC1E,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE;oBAC7B,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;iBACtE,CAAC;aACH,CAAC;SACH,CACF,CAAA;IACL,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue Card-wrapped settings section: heading, optional description, body and
|
|
3
|
+
* optional footer action row.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
6
|
+
* `SettingsSection` — the same props (React names), the same ClassMap tokens,
|
|
7
|
+
* and the same DOM for the same input.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { type PropType, type VNode } from 'vue';
|
|
12
|
+
import type { SettingsSectionProps } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* One configuration section inside a Settings page — Card-wrapped, with
|
|
15
|
+
* title / description header, body slot, and optional footer action row.
|
|
16
|
+
*
|
|
17
|
+
* @param props - Component props (see {@link SettingsSectionProps}).
|
|
18
|
+
* @returns The settings section component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SettingsSection: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
21
|
+
title: null;
|
|
22
|
+
description: null;
|
|
23
|
+
footer: null;
|
|
24
|
+
className: PropType<SettingsSectionProps["className"]>;
|
|
25
|
+
dataMolId: PropType<SettingsSectionProps["dataMolId"]>;
|
|
26
|
+
}>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
title: null;
|
|
28
|
+
description: null;
|
|
29
|
+
footer: null;
|
|
30
|
+
className: PropType<SettingsSectionProps["className"]>;
|
|
31
|
+
dataMolId: PropType<SettingsSectionProps["dataMolId"]>;
|
|
32
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
//# sourceMappingURL=SettingsSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsSection.d.ts","sourceRoot":"","sources":["../src/SettingsSection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AAMnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;eAQH,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;eAC3C,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;UAKrD,KAAK;;;;eANK,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;eAC3C,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;iGA0ClE,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue Card-wrapped settings section: heading, optional description, body and
|
|
3
|
+
* optional footer action row.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
6
|
+
* `SettingsSection` — the same props (React names), the same ClassMap tokens,
|
|
7
|
+
* and the same DOM for the same input.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { defineComponent, h } from 'vue';
|
|
12
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
13
|
+
import { Card } from '@molecule/app-ui-vue';
|
|
14
|
+
import { hasNode, nodeValue } from './nodes.js';
|
|
15
|
+
/**
|
|
16
|
+
* One configuration section inside a Settings page — Card-wrapped, with
|
|
17
|
+
* title / description header, body slot, and optional footer action row.
|
|
18
|
+
*
|
|
19
|
+
* @param props - Component props (see {@link SettingsSectionProps}).
|
|
20
|
+
* @returns The settings section component.
|
|
21
|
+
*/
|
|
22
|
+
export const SettingsSection = defineComponent({
|
|
23
|
+
name: 'SettingsSection',
|
|
24
|
+
props: {
|
|
25
|
+
// Node-valued props: declared with `null` (any runtime type, no
|
|
26
|
+
// validation — a VNode, a string, or `null` to omit).
|
|
27
|
+
title: null,
|
|
28
|
+
description: null,
|
|
29
|
+
footer: null,
|
|
30
|
+
className: String,
|
|
31
|
+
dataMolId: String,
|
|
32
|
+
},
|
|
33
|
+
setup(props, { slots }) {
|
|
34
|
+
const cm = getClassMap();
|
|
35
|
+
return () => h(Card, {
|
|
36
|
+
className: props.className,
|
|
37
|
+
'data-mol-id': props.dataMolId,
|
|
38
|
+
}, {
|
|
39
|
+
default: () => [
|
|
40
|
+
h('div', { class: cm.stack(4) }, [
|
|
41
|
+
h('header', { class: cm.stack(1) }, [
|
|
42
|
+
h('h2', { class: cm.cn(cm.textSize('lg'), cm.fontWeight('semibold')) }, nodeValue(props.title, slots.title)),
|
|
43
|
+
hasNode(props.description, slots.description)
|
|
44
|
+
? h('p', { class: cm.textSize('sm') }, nodeValue(props.description, slots.description))
|
|
45
|
+
: null,
|
|
46
|
+
]),
|
|
47
|
+
h('div', null, nodeValue(undefined, slots.default)),
|
|
48
|
+
hasNode(props.footer, slots.footer)
|
|
49
|
+
? h('footer', { class: cm.flex({ justify: 'end', align: 'center', gap: 'sm' }) }, nodeValue(props.footer, slots.footer))
|
|
50
|
+
: null,
|
|
51
|
+
]),
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=SettingsSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsSection.js","sourceRoot":"","sources":["../src/SettingsSection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA6B,MAAM,KAAK,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;IAC7C,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE;QACL,gEAAgE;QAChE,sDAAsD;QACtD,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,MAAqD;QAChE,SAAS,EAAE,MAAqD;KACjE;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;QACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QAExB,OAAO,GAAU,EAAE,CACjB,CAAC,CACC,IAAI,EACJ;YACE,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,aAAa,EAAE,KAAK,CAAC,SAAS;SAC/B,EACD;YACE,OAAO,EAAE,GAAG,EAAE,CAAC;gBACb,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC/B,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAU,CAAC,EAAE,EAAE;wBAC3C,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,EAC9D,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CACpC;wBACD,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;4BAC3C,CAAC,CAAC,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAC5B,SAAS,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAChD;4BACH,CAAC,CAAC,IAAI;qBACT,CAAC;oBACF,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;oBACnD,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;wBACjC,CAAC,CAAC,CAAC,CACC,QAAQ,EACR,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAClE,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CACtC;wBACH,CAAC,CAAC,IAAI;iBACT,CAAC;aACH;SACF,CACF,CAAA;IACL,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue controlled settings side-nav.
|
|
3
|
+
*
|
|
4
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
5
|
+
* `SettingsSidebar` — the same props (React names), the same ClassMap tokens,
|
|
6
|
+
* and the same DOM for the same input.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type PropType, type VNode } from 'vue';
|
|
11
|
+
import type { SettingsSidebarItem, SettingsSidebarProps } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Vertical side-nav for Settings pages. Controlled — the caller owns
|
|
14
|
+
* `activeId`; every item calls `onSelect` with its id.
|
|
15
|
+
*
|
|
16
|
+
* The nav region's accessible name resolves through `t()` with the
|
|
17
|
+
* `settingsContainer.aria.settings` key, so it follows the active locale;
|
|
18
|
+
* `ariaLabel` overrides it.
|
|
19
|
+
*
|
|
20
|
+
* @param props - Component props (see {@link SettingsSidebarProps}).
|
|
21
|
+
* @returns The settings sidebar component.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SettingsSidebar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
24
|
+
items: {
|
|
25
|
+
type: PropType<SettingsSidebarProps["items"]>;
|
|
26
|
+
default: () => never[];
|
|
27
|
+
};
|
|
28
|
+
activeId: PropType<SettingsSidebarProps["activeId"]>;
|
|
29
|
+
onSelect: PropType<SettingsSidebarProps["onSelect"]>;
|
|
30
|
+
footer: null;
|
|
31
|
+
ariaLabel: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
className: PropType<SettingsSidebarProps["className"]>;
|
|
36
|
+
}>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
|
+
items: {
|
|
38
|
+
type: PropType<SettingsSidebarProps["items"]>;
|
|
39
|
+
default: () => never[];
|
|
40
|
+
};
|
|
41
|
+
activeId: PropType<SettingsSidebarProps["activeId"]>;
|
|
42
|
+
onSelect: PropType<SettingsSidebarProps["onSelect"]>;
|
|
43
|
+
footer: null;
|
|
44
|
+
ariaLabel: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
className: PropType<SettingsSidebarProps["className"]>;
|
|
49
|
+
}>> & Readonly<{}>, {
|
|
50
|
+
items: SettingsSidebarItem[];
|
|
51
|
+
ariaLabel: string;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
53
|
+
//# sourceMappingURL=SettingsSidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsSidebar.d.ts","sourceRoot":"","sources":["../src/SettingsSidebar.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAmB,MAAM,KAAK,CAAA;AAMpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAE3E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe;;cAIP,QAAQ,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;;;cAGpC,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;cACxC,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;;;;;;eAK3C,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;UA8BrD,KAAK;;cAvCC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;;;cAGpC,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;cACxC,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;;;;;;eAK3C,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;;;;4EA+ClE,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue controlled settings side-nav.
|
|
3
|
+
*
|
|
4
|
+
* Vue counterpart of `@molecule/app-settings-container-react`'s
|
|
5
|
+
* `SettingsSidebar` — the same props (React names), the same ClassMap tokens,
|
|
6
|
+
* and 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 { useTranslation } from '@molecule/app-vue';
|
|
13
|
+
import { hasNode, nodeValue } from './nodes.js';
|
|
14
|
+
/**
|
|
15
|
+
* Vertical side-nav for Settings pages. Controlled — the caller owns
|
|
16
|
+
* `activeId`; every item calls `onSelect` with its id.
|
|
17
|
+
*
|
|
18
|
+
* The nav region's accessible name resolves through `t()` with the
|
|
19
|
+
* `settingsContainer.aria.settings` key, so it follows the active locale;
|
|
20
|
+
* `ariaLabel` overrides it.
|
|
21
|
+
*
|
|
22
|
+
* @param props - Component props (see {@link SettingsSidebarProps}).
|
|
23
|
+
* @returns The settings sidebar component.
|
|
24
|
+
*/
|
|
25
|
+
export const SettingsSidebar = defineComponent({
|
|
26
|
+
name: 'SettingsSidebar',
|
|
27
|
+
props: {
|
|
28
|
+
items: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => [],
|
|
31
|
+
},
|
|
32
|
+
activeId: String,
|
|
33
|
+
onSelect: Function,
|
|
34
|
+
// Node-valued prop: declared with `null` (any runtime type, no validation
|
|
35
|
+
// — a VNode, a string, or `null` to omit).
|
|
36
|
+
footer: null,
|
|
37
|
+
ariaLabel: { type: String, default: undefined },
|
|
38
|
+
className: String,
|
|
39
|
+
},
|
|
40
|
+
setup(props, { slots }) {
|
|
41
|
+
const cm = getClassMap();
|
|
42
|
+
const { t } = useTranslation();
|
|
43
|
+
/** One nav item's button (React's per-item classes and `aria-current`). */
|
|
44
|
+
const item = (entry) => {
|
|
45
|
+
const active = entry.id === props.activeId;
|
|
46
|
+
return h('button', {
|
|
47
|
+
// React keys each row by the item's `id`; Vue's `key` keeps the same
|
|
48
|
+
// DOM nodes across an equal or re-ordered array.
|
|
49
|
+
key: entry.id,
|
|
50
|
+
type: 'button',
|
|
51
|
+
onClick: () => props.onSelect?.(entry.id),
|
|
52
|
+
'aria-current': active ? 'page' : undefined,
|
|
53
|
+
class: cm.cn(cm.flex({ align: 'center', gap: 'sm' }), cm.sp('px', 3), cm.sp('py', 2), cm.textSize('sm'), active ? cm.fontWeight('semibold') : cm.fontWeight('medium')),
|
|
54
|
+
}, [entry.icon, h('span', null, [entry.label])]);
|
|
55
|
+
};
|
|
56
|
+
return () => h('nav', {
|
|
57
|
+
class: cm.cn(cm.stack(1), props.className),
|
|
58
|
+
'aria-label': props.ariaLabel ??
|
|
59
|
+
t('settingsContainer.aria.settings', undefined, { defaultValue: 'Settings' }),
|
|
60
|
+
}, [
|
|
61
|
+
...props.items.map(item),
|
|
62
|
+
...(hasNode(props.footer, slots.footer)
|
|
63
|
+
? [h('div', { class: cm.sp('mt', 4) }, nodeValue(props.footer, slots.footer))]
|
|
64
|
+
: []),
|
|
65
|
+
]);
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=SettingsSidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsSidebar.js","sourceRoot":"","sources":["../src/SettingsSidebar.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,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG/C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;IAC7C,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,KAAgD;YACtD,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;SAClB;QACD,QAAQ,EAAE,MAAoD;QAC9D,QAAQ,EAAE,QAAsD;QAChE,0EAA0E;QAC1E,2CAA2C;QAC3C,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;QAC/C,SAAS,EAAE,MAAqD;KACjE;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;QACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QACxB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;QAE9B,2EAA2E;QAC3E,MAAM,IAAI,GAAG,CAAC,KAA0B,EAAS,EAAE;YACjD,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,QAAQ,CAAA;YAC1C,OAAO,CAAC,CACN,QAAQ,EACR;gBACE,qEAAqE;gBACrE,iDAAiD;gBACjD,GAAG,EAAE,KAAK,CAAC,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBAC3C,KAAK,EAAE,EAAE,CAAC,EAAE,CACV,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EACvC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EACd,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EACd,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EACjB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAC7D;aACF,EACD,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAC7C,CAAA;QACH,CAAC,CAAA;QAED,OAAO,GAAU,EAAE,CACjB,CAAC,CACC,KAAK,EACL;YACE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;YACnD,YAAY,EACV,KAAK,CAAC,SAAS;gBACf,CAAC,CAAC,iCAAiC,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;SAChF,EACD;YACE,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;YACxB,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;gBACrC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC9E,CAAC,CAAC,EAAE,CAAC;SACQ,CAClB,CAAA;IACL,CAAC;CACF,CAAC,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue Settings-page scaffold (layout chrome only).
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `<SettingsLayout>` — two-column [sidebar, content] with an optional
|
|
6
|
+
* `header` slot rendered above both.
|
|
7
|
+
* - `<SettingsSidebar>` — controlled side-nav (`items`, `activeId`,
|
|
8
|
+
* `onSelect`, optional `footer`); `SettingsSidebarItem` is
|
|
9
|
+
* `{ id, label, icon? }`.
|
|
10
|
+
* - `<SettingsContent>` — stacked wrapper for the right column.
|
|
11
|
+
* - `<SettingsSection>` — Card-wrapped titled section (`title`,
|
|
12
|
+
* `description?`, `footer?` action row, `dataMolId?`).
|
|
13
|
+
*
|
|
14
|
+
* It is the Vue counterpart of `@molecule/app-settings-container-react`: the
|
|
15
|
+
* same props (React names), the same ClassMap tokens, and the same DOM for the
|
|
16
|
+
* same input, so an app moves between frameworks by changing the package name
|
|
17
|
+
* in its imports.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { defineComponent, h, ref } from 'vue'
|
|
22
|
+
*
|
|
23
|
+
* import {
|
|
24
|
+
* SettingsContent,
|
|
25
|
+
* SettingsLayout,
|
|
26
|
+
* SettingsSection,
|
|
27
|
+
* SettingsSidebar,
|
|
28
|
+
* } from '@molecule/app-settings-container-vue'
|
|
29
|
+
*
|
|
30
|
+
* const NAV = [
|
|
31
|
+
* { id: 'profile', label: 'Profile' },
|
|
32
|
+
* { id: 'notifications', label: 'Notifications' },
|
|
33
|
+
* ]
|
|
34
|
+
*
|
|
35
|
+
* export const SettingsPage = defineComponent({
|
|
36
|
+
* setup() {
|
|
37
|
+
* const active = ref('profile')
|
|
38
|
+
* return () =>
|
|
39
|
+
* h(SettingsLayout, null, {
|
|
40
|
+
* sidebar: () => [
|
|
41
|
+
* h(SettingsSidebar, {
|
|
42
|
+
* items: NAV,
|
|
43
|
+
* activeId: active.value,
|
|
44
|
+
* onSelect: (id: string) => (active.value = id),
|
|
45
|
+
* }),
|
|
46
|
+
* ],
|
|
47
|
+
* default: () => [
|
|
48
|
+
* h(SettingsContent, null, {
|
|
49
|
+
* default: () => [
|
|
50
|
+
* h(
|
|
51
|
+
* SettingsSection,
|
|
52
|
+
* {
|
|
53
|
+
* title: 'Profile',
|
|
54
|
+
* description: 'Update your display name and avatar.',
|
|
55
|
+
* },
|
|
56
|
+
* { default: () => [h('p', null, 'Form fields go here.')] },
|
|
57
|
+
* ),
|
|
58
|
+
* ],
|
|
59
|
+
* }),
|
|
60
|
+
* ],
|
|
61
|
+
* })
|
|
62
|
+
* },
|
|
63
|
+
* })
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* - The `header` slot is rendered above the columns but is NOT sticky —
|
|
68
|
+
* apply your own sticky positioning if you need it pinned.
|
|
69
|
+
* - The two columns do not collapse responsively — swap the sidebar for a
|
|
70
|
+
* drawer on small screens yourself.
|
|
71
|
+
* - Requires a bonded ClassMap. Labels are your own nodes (translate
|
|
72
|
+
* upstream); the sidebar nav's `aria-label="Settings"` is hardcoded
|
|
73
|
+
* English.
|
|
74
|
+
* - Don't confuse with `@molecule/app-settings-panel-vue`: that package is the
|
|
75
|
+
* batteries-included panel (prebuilt Account/Auth/Billing/… sections wired
|
|
76
|
+
* to molecule APIs). THIS package is empty layout chrome for building your
|
|
77
|
+
* own settings pages.
|
|
78
|
+
* - Node-valued props (`header`, `sidebar`, `footer`, `title`, `description`)
|
|
79
|
+
* arrive as a prop AND a same-named slot; components accept either.
|
|
80
|
+
*
|
|
81
|
+
* @module
|
|
82
|
+
*/
|
|
83
|
+
export * from './SettingsContent.js';
|
|
84
|
+
export * from './SettingsLayout.js';
|
|
85
|
+
export * from './SettingsSection.js';
|
|
86
|
+
export * from './SettingsSidebar.js';
|
|
87
|
+
export * from './types.js';
|
|
88
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue Settings-page scaffold (layout chrome only).
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `<SettingsLayout>` — two-column [sidebar, content] with an optional
|
|
6
|
+
* `header` slot rendered above both.
|
|
7
|
+
* - `<SettingsSidebar>` — controlled side-nav (`items`, `activeId`,
|
|
8
|
+
* `onSelect`, optional `footer`); `SettingsSidebarItem` is
|
|
9
|
+
* `{ id, label, icon? }`.
|
|
10
|
+
* - `<SettingsContent>` — stacked wrapper for the right column.
|
|
11
|
+
* - `<SettingsSection>` — Card-wrapped titled section (`title`,
|
|
12
|
+
* `description?`, `footer?` action row, `dataMolId?`).
|
|
13
|
+
*
|
|
14
|
+
* It is the Vue counterpart of `@molecule/app-settings-container-react`: the
|
|
15
|
+
* same props (React names), the same ClassMap tokens, and the same DOM for the
|
|
16
|
+
* same input, so an app moves between frameworks by changing the package name
|
|
17
|
+
* in its imports.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { defineComponent, h, ref } from 'vue'
|
|
22
|
+
*
|
|
23
|
+
* import {
|
|
24
|
+
* SettingsContent,
|
|
25
|
+
* SettingsLayout,
|
|
26
|
+
* SettingsSection,
|
|
27
|
+
* SettingsSidebar,
|
|
28
|
+
* } from '@molecule/app-settings-container-vue'
|
|
29
|
+
*
|
|
30
|
+
* const NAV = [
|
|
31
|
+
* { id: 'profile', label: 'Profile' },
|
|
32
|
+
* { id: 'notifications', label: 'Notifications' },
|
|
33
|
+
* ]
|
|
34
|
+
*
|
|
35
|
+
* export const SettingsPage = defineComponent({
|
|
36
|
+
* setup() {
|
|
37
|
+
* const active = ref('profile')
|
|
38
|
+
* return () =>
|
|
39
|
+
* h(SettingsLayout, null, {
|
|
40
|
+
* sidebar: () => [
|
|
41
|
+
* h(SettingsSidebar, {
|
|
42
|
+
* items: NAV,
|
|
43
|
+
* activeId: active.value,
|
|
44
|
+
* onSelect: (id: string) => (active.value = id),
|
|
45
|
+
* }),
|
|
46
|
+
* ],
|
|
47
|
+
* default: () => [
|
|
48
|
+
* h(SettingsContent, null, {
|
|
49
|
+
* default: () => [
|
|
50
|
+
* h(
|
|
51
|
+
* SettingsSection,
|
|
52
|
+
* {
|
|
53
|
+
* title: 'Profile',
|
|
54
|
+
* description: 'Update your display name and avatar.',
|
|
55
|
+
* },
|
|
56
|
+
* { default: () => [h('p', null, 'Form fields go here.')] },
|
|
57
|
+
* ),
|
|
58
|
+
* ],
|
|
59
|
+
* }),
|
|
60
|
+
* ],
|
|
61
|
+
* })
|
|
62
|
+
* },
|
|
63
|
+
* })
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* - The `header` slot is rendered above the columns but is NOT sticky —
|
|
68
|
+
* apply your own sticky positioning if you need it pinned.
|
|
69
|
+
* - The two columns do not collapse responsively — swap the sidebar for a
|
|
70
|
+
* drawer on small screens yourself.
|
|
71
|
+
* - Requires a bonded ClassMap. Labels are your own nodes (translate
|
|
72
|
+
* upstream); the sidebar nav's `aria-label="Settings"` is hardcoded
|
|
73
|
+
* English.
|
|
74
|
+
* - Don't confuse with `@molecule/app-settings-panel-vue`: that package is the
|
|
75
|
+
* batteries-included panel (prebuilt Account/Auth/Billing/… sections wired
|
|
76
|
+
* to molecule APIs). THIS package is empty layout chrome for building your
|
|
77
|
+
* own settings pages.
|
|
78
|
+
* - Node-valued props (`header`, `sidebar`, `footer`, `title`, `description`)
|
|
79
|
+
* arrive as a prop AND a same-named slot; components accept either.
|
|
80
|
+
*
|
|
81
|
+
* @module
|
|
82
|
+
*/
|
|
83
|
+
export * from './SettingsContent.js';
|
|
84
|
+
export * from './SettingsLayout.js';
|
|
85
|
+
export * from './SettingsSection.js';
|
|
86
|
+
export * from './SettingsSidebar.js';
|
|
87
|
+
export * from './types.js';
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA"}
|
package/dist/nodes.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-prop resolution for the Vue settings-page scaffold: every node-valued
|
|
3
|
+
* React prop arrives here as a prop AND a same-named slot, and the two must
|
|
4
|
+
* resolve to exactly what React renders.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import type { VNodeChild } from 'vue';
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a node-valued prop that may also arrive as a same-named slot: a
|
|
11
|
+
* given prop wins (React's single source of truth — a later `null` removes the
|
|
12
|
+
* node), and the slot is used only while the prop is absent. An absent pair
|
|
13
|
+
* contributes nothing.
|
|
14
|
+
*
|
|
15
|
+
* @param prop - The prop value, when the caller passed the prop.
|
|
16
|
+
* @param slot - The slot render function, when the caller passed the slot.
|
|
17
|
+
* @returns The children to render.
|
|
18
|
+
*/
|
|
19
|
+
export declare const nodeValue: (prop: VNodeChild, slot: (() => VNodeChild[]) | undefined) => VNodeChild[];
|
|
20
|
+
/**
|
|
21
|
+
* Whether a node-valued prop or its same-named slot would render anything —
|
|
22
|
+
* React's `{node && …}` branch condition.
|
|
23
|
+
*
|
|
24
|
+
* @param prop - The prop value.
|
|
25
|
+
* @param slot - The slot render function, when provided.
|
|
26
|
+
* @returns True when the node renders.
|
|
27
|
+
*/
|
|
28
|
+
export declare const hasNode: (prop: VNodeChild, slot: (() => VNodeChild[]) | undefined) => boolean;
|
|
29
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,MAAM,UAAU,EAChB,MAAM,CAAC,MAAM,UAAU,EAAE,CAAC,GAAG,SAAS,KACrC,UAAU,EAIZ,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,UAAU,EAAE,CAAC,GAAG,SAAS,KAAG,OACtB,CAAA"}
|
package/dist/nodes.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-prop resolution for the Vue settings-page scaffold: every node-valued
|
|
3
|
+
* React prop arrives here as a prop AND a same-named slot, and the two must
|
|
4
|
+
* resolve to exactly what React renders.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a node-valued prop that may also arrive as a same-named slot: a
|
|
10
|
+
* given prop wins (React's single source of truth — a later `null` removes the
|
|
11
|
+
* node), and the slot is used only while the prop is absent. An absent pair
|
|
12
|
+
* contributes nothing.
|
|
13
|
+
*
|
|
14
|
+
* @param prop - The prop value, when the caller passed the prop.
|
|
15
|
+
* @param slot - The slot render function, when the caller passed the slot.
|
|
16
|
+
* @returns The children to render.
|
|
17
|
+
*/
|
|
18
|
+
export const nodeValue = (prop, slot) => {
|
|
19
|
+
if (prop !== undefined)
|
|
20
|
+
return prop === null ? [] : [prop];
|
|
21
|
+
if (slot)
|
|
22
|
+
return slot();
|
|
23
|
+
return [];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Whether a node-valued prop or its same-named slot would render anything —
|
|
27
|
+
* React's `{node && …}` branch condition.
|
|
28
|
+
*
|
|
29
|
+
* @param prop - The prop value.
|
|
30
|
+
* @param slot - The slot render function, when provided.
|
|
31
|
+
* @returns True when the node renders.
|
|
32
|
+
*/
|
|
33
|
+
export const hasNode = (prop, slot) => Boolean(prop) || (prop === undefined && slot !== undefined);
|
|
34
|
+
//# sourceMappingURL=nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,IAAgB,EAChB,IAAsC,EACxB,EAAE;IAChB,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAC1D,IAAI,IAAI;QAAE,OAAO,IAAI,EAAE,CAAA;IACvB,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAE,IAAsC,EAAW,EAAE,CAC3F,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Vue settings-page scaffold.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { VNodeChild } from 'vue';
|
|
7
|
+
/** Props accepted by the {@link SettingsLayout} component. */
|
|
8
|
+
export interface SettingsLayoutProps {
|
|
9
|
+
/**
|
|
10
|
+
* Left-side navigation (typically `<SettingsSidebar>`). Passed as a prop or
|
|
11
|
+
* as the same-named slot — both work.
|
|
12
|
+
*/
|
|
13
|
+
sidebar?: VNodeChild;
|
|
14
|
+
/** Main content area — the DEFAULT slot (usually one or more `<SettingsSection>`s). */
|
|
15
|
+
children?: VNodeChild;
|
|
16
|
+
/**
|
|
17
|
+
* Optional header (breadcrumb, title, save button) rendered above both
|
|
18
|
+
* columns. NOT sticky — apply your own sticky positioning if needed. Passed
|
|
19
|
+
* as a prop or as the same-named slot.
|
|
20
|
+
*/
|
|
21
|
+
header?: VNodeChild;
|
|
22
|
+
/** Extra classes on the outer wrapper. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
25
|
+
dataMolId?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Props accepted by the {@link SettingsContent} component. */
|
|
28
|
+
export interface SettingsContentProps {
|
|
29
|
+
/** Active section content — the DEFAULT slot. */
|
|
30
|
+
children?: VNodeChild;
|
|
31
|
+
/** Extra classes. */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/** A single navigable item in the settings sidebar. */
|
|
35
|
+
export interface SettingsSidebarItem {
|
|
36
|
+
/** Unique id; the active item is the one whose id equals `activeId`. */
|
|
37
|
+
id: string;
|
|
38
|
+
/** Visible label (a VNode or plain text). */
|
|
39
|
+
label: VNodeChild;
|
|
40
|
+
/** Optional leading icon (a VNode). */
|
|
41
|
+
icon?: VNodeChild;
|
|
42
|
+
}
|
|
43
|
+
/** Props accepted by the {@link SettingsSidebar} component. */
|
|
44
|
+
export interface SettingsSidebarProps {
|
|
45
|
+
/** Items to render, in order. */
|
|
46
|
+
items: SettingsSidebarItem[];
|
|
47
|
+
/** The id of the active item (controlled — the caller owns it). */
|
|
48
|
+
activeId: string;
|
|
49
|
+
/** Called with the clicked item's id. */
|
|
50
|
+
onSelect: (id: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Optional footer inside the sidebar (sign-out, plan indicator). Passed as a
|
|
53
|
+
* prop or as the same-named slot.
|
|
54
|
+
*/
|
|
55
|
+
footer?: VNodeChild;
|
|
56
|
+
/**
|
|
57
|
+
* Accessible name for the `<nav>` region. Overrides the translated /
|
|
58
|
+
* `defaultValue` `'Settings'` (prop > `t()` > default).
|
|
59
|
+
*/
|
|
60
|
+
ariaLabel?: string;
|
|
61
|
+
/** Extra classes. */
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
/** Props accepted by the {@link SettingsSection} component. */
|
|
65
|
+
export interface SettingsSectionProps {
|
|
66
|
+
/** Section heading. Passed as a prop or as the same-named slot. */
|
|
67
|
+
title?: VNodeChild;
|
|
68
|
+
/**
|
|
69
|
+
* Optional description under the heading. Passed as a prop or as the
|
|
70
|
+
* same-named slot.
|
|
71
|
+
*/
|
|
72
|
+
description?: VNodeChild;
|
|
73
|
+
/** Section body — the DEFAULT slot. */
|
|
74
|
+
children?: VNodeChild;
|
|
75
|
+
/**
|
|
76
|
+
* Optional footer row (save button, last-saved indicator). Passed as a prop
|
|
77
|
+
* or as the same-named slot.
|
|
78
|
+
*/
|
|
79
|
+
footer?: VNodeChild;
|
|
80
|
+
/** Extra classes on the Card. */
|
|
81
|
+
className?: string;
|
|
82
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
83
|
+
dataMolId?: string;
|
|
84
|
+
}
|
|
85
|
+
//# 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,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAA;IACV,6CAA6C;IAC7C,KAAK,EAAE,UAAU,CAAA;IACjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,KAAK,EAAE,mBAAmB,EAAE,CAAA;IAC5B,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAA;IAChB,yCAAyC;IACzC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
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,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-settings-container-vue",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1-stage",
|
|
4
|
+
"description": "Vue layout for Settings pages (sidebar + content + section cards)",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-settings-container-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
|
+
"settings-container",
|
|
28
|
+
"vue"
|
|
29
|
+
],
|
|
30
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
35
|
+
"directory": "packages/app/features/settings-container-vue"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
39
|
+
},
|
|
40
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@molecule/app-ui": "^1.0.1",
|
|
46
|
+
"@molecule/app-ui-vue": "^1.1.0",
|
|
47
|
+
"@molecule/app-vue": "^3.5.0",
|
|
48
|
+
"vue": "^3.4.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
52
|
+
"@molecule/app-i18n": "1.2.2",
|
|
53
|
+
"@molecule/app-icons": "1.0.4",
|
|
54
|
+
"@molecule/app-ui": "1.4.0",
|
|
55
|
+
"@molecule/app-ui-vue": "1.1.5",
|
|
56
|
+
"@molecule/app-vue": "3.7.2",
|
|
57
|
+
"@types/node": "26.6.5",
|
|
58
|
+
"jsdom": "30.1.3",
|
|
59
|
+
"typescript": "6.0.3",
|
|
60
|
+
"vite": "8.3.5",
|
|
61
|
+
"vitest": "4.1.12",
|
|
62
|
+
"vue": "3.5.44",
|
|
63
|
+
"vue-tsc": "3.3.13"
|
|
64
|
+
}
|
|
65
|
+
}
|