@ds-mo/ui 12.3.0 → 12.4.1
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/dist/.build-stamp +1 -1
- package/dist/agent-patterns.json +89 -11
- package/dist/agent.json +548 -9
- package/dist/angular/ds-shell-app.d.ts +13 -2
- package/dist/angular/ds-shell-app.js +9 -5
- package/dist/angular/ds-shell-mobile-bar.d.ts +18 -0
- package/dist/angular/ds-shell-mobile-bar.js +46 -0
- package/dist/angular/ds-shell-mobile-nav.d.ts +23 -0
- package/dist/angular/ds-shell-mobile-nav.js +51 -0
- package/dist/angular/ds-shell-mobile-section-nav.d.ts +18 -0
- package/dist/angular/ds-shell-mobile-section-nav.js +42 -0
- package/dist/angular/ds-shell-tools.d.ts +42 -0
- package/dist/angular/ds-shell-tools.js +52 -0
- package/dist/angular/ds-toast.d.ts +1 -1
- package/dist/angular/ds-toast.js +3 -3
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +4 -0
- package/dist/angular/proxies.d.ts +4 -0
- package/dist/angular/proxies.js +4 -0
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-chart-donut.js +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-item.js.map +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-modal.js.map +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-nav.js.map +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-panel-tools.js.map +1 -1
- package/dist/components/ds-select-multi.js +1 -1
- package/dist/components/ds-select-multi.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-select.js.map +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-app.js.map +1 -1
- package/dist/components/ds-shell-gradient-picker.js +1 -1
- package/dist/components/ds-shell-gradient-picker.js.map +1 -1
- package/dist/components/ds-shell-gradient-swatch.js +1 -1
- package/dist/components/ds-shell-mobile-bar.d.ts +11 -0
- package/dist/components/ds-shell-mobile-bar.js +2 -0
- package/dist/components/ds-shell-mobile-bar.js.map +1 -0
- package/dist/components/ds-shell-mobile-nav.d.ts +11 -0
- package/dist/components/ds-shell-mobile-nav.js +2 -0
- package/dist/components/ds-shell-mobile-nav.js.map +1 -0
- package/dist/components/ds-shell-mobile-section-nav.d.ts +11 -0
- package/dist/components/ds-shell-mobile-section-nav.js +2 -0
- package/dist/components/ds-shell-mobile-section-nav.js.map +1 -0
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-page.js.map +1 -1
- package/dist/components/ds-shell-tools.d.ts +11 -0
- package/dist/components/ds-shell-tools.js +2 -0
- package/dist/components/ds-shell-tools.js.map +1 -0
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-tab-group.js.map +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-toast.js.map +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/p-B6Vuayt6.js +2 -0
- package/dist/components/p-B6Vuayt6.js.map +1 -0
- package/dist/components/p-BPS9VExm.js +2 -0
- package/dist/components/{p-D3DYxbC5.js.map → p-BPS9VExm.js.map} +1 -1
- package/dist/components/{p-Bi_bxbih.js → p-Biz6xo-z.js} +2 -2
- package/dist/components/p-BrusnEYP.js +2 -0
- package/dist/components/p-BrusnEYP.js.map +1 -0
- package/dist/components/p-C_0Q8Cnp.js +2 -0
- package/dist/components/{p-Dg3xLna0.js.map → p-C_0Q8Cnp.js.map} +1 -1
- package/dist/components/p-CgHTNfC1.js +2 -0
- package/dist/components/p-CgHTNfC1.js.map +1 -0
- package/dist/components/p-Co8hD3P-.js +2 -0
- package/dist/components/{p-DC7yOUQx.js.map → p-Co8hD3P-.js.map} +1 -1
- package/dist/components/{p-Cuw2Lo2g.js → p-CtD24EyI.js} +2 -2
- package/dist/components/{p-C0NPJ0h2.js → p-DXnFhmZF.js} +2 -2
- package/dist/components/p-NUNsefU1.js +2 -0
- package/dist/components/{p-CWlh7HAg.js.map → p-NUNsefU1.js.map} +1 -1
- package/dist/components/p-PZ6R_nGI.js +2 -0
- package/dist/components/p-PZ6R_nGI.js.map +1 -0
- package/dist/components/{p-J6xK6Ihq.js → p-g40DTeV8.js} +2 -2
- package/dist/components/p-yhj1lIPx.js +2 -0
- package/dist/components/p-yhj1lIPx.js.map +1 -0
- package/dist/docs/components.json +2172 -115
- package/dist/lib/components/BarNav/bar-nav-types.d.ts +2 -0
- package/dist/lib/components/PanelNav/panel-nav-types.d.ts +29 -0
- package/dist/lib/components/PanelTools/panel-tools-types.d.ts +40 -0
- package/dist/lib/components/TabGroup/tab-item-utils.d.ts +31 -0
- package/dist/lib/shell/index.d.ts +5 -0
- package/dist/lib/shell/index.js +36 -0
- package/dist/lib/shell/index.js.map +3 -3
- package/dist/lib/shell/shell-responsive.d.ts +13 -0
- package/dist/mcp-data/registry/conversation-list-item.json +1 -1
- package/dist/mcp-data/registry/modal.json +1 -1
- package/dist/mcp-data/registry/registry.json +559 -8
- package/dist/mcp-data/registry/shell-app.json +71 -11
- package/dist/mcp-data/registry/shell-mobile-bar.json +314 -0
- package/dist/mcp-data/registry/shell-mobile-nav.json +348 -0
- package/dist/mcp-data/registry/shell-mobile-section-nav.json +267 -0
- package/dist/mcp-data/registry/shell-page.json +1 -1
- package/dist/mcp-data/registry/shell-tools.json +450 -0
- package/dist/mcp-data/registry/toast.json +21 -2
- package/dist/react/components.d.ts +4 -0
- package/dist/react/components.js +4 -0
- package/dist/react/ds-shell-app.d.ts +7 -2
- package/dist/react/ds-shell-app.js +1 -1
- package/dist/react/ds-shell-mobile-bar.d.ts +13 -0
- package/dist/react/ds-shell-mobile-bar.js +15 -0
- package/dist/react/ds-shell-mobile-nav.d.ts +15 -0
- package/dist/react/ds-shell-mobile-nav.js +17 -0
- package/dist/react/ds-shell-mobile-section-nav.d.ts +12 -0
- package/dist/react/ds-shell-mobile-section-nav.js +12 -0
- package/dist/react/ds-shell-tools.d.ts +25 -0
- package/dist/react/ds-shell-tools.js +17 -0
- package/dist/types/components/ShellApp/ShellApp.d.ts +16 -0
- package/dist/types/components/ShellMobileBar/ShellMobileBar.d.ts +25 -0
- package/dist/types/components/ShellMobileBar/index.d.ts +4 -0
- package/dist/types/components/ShellMobileBar/shell-mobile-bar-types.d.ts +5 -0
- package/dist/types/components/ShellMobileNav/ShellMobileNav.d.ts +32 -0
- package/dist/types/components/ShellMobileNav/index.d.ts +2 -0
- package/dist/types/components/ShellMobileNav/shell-mobile-nav-types.d.ts +6 -0
- package/dist/types/components/ShellMobileSectionNav/ShellMobileSectionNav.d.ts +30 -0
- package/dist/types/components/ShellMobileSectionNav/index.d.ts +2 -0
- package/dist/types/components/ShellTools/ShellTools.d.ts +61 -0
- package/dist/types/components/ShellTools/index.d.ts +3 -0
- package/dist/types/components/Toast/Toast.d.ts +2 -0
- package/dist/types/components.d.ts +618 -2
- package/dist/types/shell/index.d.ts +5 -0
- package/dist/types/shell/shell-responsive.d.ts +14 -0
- package/package.json +1 -1
- package/dist/components/p-CWlh7HAg.js +0 -2
- package/dist/components/p-D3DYxbC5.js +0 -2
- package/dist/components/p-DC7yOUQx.js +0 -2
- package/dist/components/p-Dg3xLna0.js +0 -2
- /package/dist/components/{p-Bi_bxbih.js.map → p-Biz6xo-z.js.map} +0 -0
- /package/dist/components/{p-Cuw2Lo2g.js.map → p-CtD24EyI.js.map} +0 -0
- /package/dist/components/{p-C0NPJ0h2.js.map → p-DXnFhmZF.js.map} +0 -0
- /package/dist/components/{p-J6xK6Ihq.js.map → p-g40DTeV8.js.map} +0 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "shell-mobile-nav",
|
|
4
|
+
"title": "ShellMobileNav",
|
|
5
|
+
"description": "Full-height mobile primary navigation pane with local Dashboard and Settings browsing.",
|
|
6
|
+
"type": "registry:ui",
|
|
7
|
+
"meta": {
|
|
8
|
+
"library": "@ds-mo/ui",
|
|
9
|
+
"distribution": "npm",
|
|
10
|
+
"storybook": "https://zainadeel.github.io/compomo/?path=/story/shell-mobile-nav",
|
|
11
|
+
"source": "src/wc/components/ShellMobileNav/ShellMobileNav.tsx",
|
|
12
|
+
"intentStatus": "complete",
|
|
13
|
+
"intent": {
|
|
14
|
+
"audience": "specialized",
|
|
15
|
+
"status": "experimental",
|
|
16
|
+
"summary": "Full-height mobile primary navigation pane with local Dashboard and Settings browsing.",
|
|
17
|
+
"useWhen": [
|
|
18
|
+
"The mobile ShellApp Menu control needs to expose the complete primary navigation collection."
|
|
19
|
+
],
|
|
20
|
+
"avoidWhen": [
|
|
21
|
+
"Rendering desktop PanelNav.",
|
|
22
|
+
"Switching local page content."
|
|
23
|
+
],
|
|
24
|
+
"commonlyComposedWith": [
|
|
25
|
+
"component:ds-shell-app",
|
|
26
|
+
"component:ds-shell-mobile-bar"
|
|
27
|
+
],
|
|
28
|
+
"patterns": [
|
|
29
|
+
"pattern:application-shell"
|
|
30
|
+
],
|
|
31
|
+
"accessibility": [
|
|
32
|
+
"The pane is a named navigation landmark and retains visible labels for every destination.",
|
|
33
|
+
"Escape requests dismissal and opening moves focus to the selected or first available area."
|
|
34
|
+
],
|
|
35
|
+
"states": [
|
|
36
|
+
"Dashboard and Settings change only the collection being browsed.",
|
|
37
|
+
"Area, Help, and Account events express intent while the application owns navigation and product behavior."
|
|
38
|
+
],
|
|
39
|
+
"responsiveBehavior": [
|
|
40
|
+
"The pane fills the mobile content stage while the bottom bar remains available."
|
|
41
|
+
],
|
|
42
|
+
"references": [
|
|
43
|
+
{
|
|
44
|
+
"label": "Storybook",
|
|
45
|
+
"path": "src/wc/components/ShellMobileNav/ShellMobileNav.stories.ts"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"api": {
|
|
50
|
+
"props": {
|
|
51
|
+
"accountLabel": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"resolvedType": "string",
|
|
54
|
+
"attribute": "account-label",
|
|
55
|
+
"default": "'Account'",
|
|
56
|
+
"required": false,
|
|
57
|
+
"mutable": false
|
|
58
|
+
},
|
|
59
|
+
"browseContext": {
|
|
60
|
+
"type": "NavChromeStyle",
|
|
61
|
+
"resolvedType": "\"dashboard\" | \"settings\"",
|
|
62
|
+
"attribute": "browse-context",
|
|
63
|
+
"default": "'dashboard'",
|
|
64
|
+
"required": false,
|
|
65
|
+
"mutable": false
|
|
66
|
+
},
|
|
67
|
+
"currentUrl": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"resolvedType": "string",
|
|
70
|
+
"attribute": "current-url",
|
|
71
|
+
"default": "''",
|
|
72
|
+
"required": false,
|
|
73
|
+
"mutable": false
|
|
74
|
+
},
|
|
75
|
+
"dashboardGroups": {
|
|
76
|
+
"type": "PanelNavGroup[]",
|
|
77
|
+
"resolvedType": "PanelNavGroup[]",
|
|
78
|
+
"default": "[]",
|
|
79
|
+
"required": false,
|
|
80
|
+
"mutable": false
|
|
81
|
+
},
|
|
82
|
+
"dashboardLabel": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"resolvedType": "string",
|
|
85
|
+
"attribute": "dashboard-label",
|
|
86
|
+
"default": "'Dashboard'",
|
|
87
|
+
"required": false,
|
|
88
|
+
"mutable": false
|
|
89
|
+
},
|
|
90
|
+
"heading": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"resolvedType": "string",
|
|
93
|
+
"attribute": "heading",
|
|
94
|
+
"default": "'Navigation'",
|
|
95
|
+
"required": false,
|
|
96
|
+
"mutable": false
|
|
97
|
+
},
|
|
98
|
+
"helpLabel": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"resolvedType": "string",
|
|
101
|
+
"attribute": "help-label",
|
|
102
|
+
"default": "'Help & Support'",
|
|
103
|
+
"required": false,
|
|
104
|
+
"mutable": false
|
|
105
|
+
},
|
|
106
|
+
"navigationLabel": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"resolvedType": "string",
|
|
109
|
+
"attribute": "navigation-label",
|
|
110
|
+
"default": "'Application navigation'",
|
|
111
|
+
"required": false,
|
|
112
|
+
"mutable": false
|
|
113
|
+
},
|
|
114
|
+
"open": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"resolvedType": "boolean",
|
|
117
|
+
"attribute": "open",
|
|
118
|
+
"default": "false",
|
|
119
|
+
"required": false,
|
|
120
|
+
"mutable": false
|
|
121
|
+
},
|
|
122
|
+
"settingsGroups": {
|
|
123
|
+
"type": "PanelNavGroup[]",
|
|
124
|
+
"resolvedType": "PanelNavGroup[]",
|
|
125
|
+
"default": "[]",
|
|
126
|
+
"required": false,
|
|
127
|
+
"mutable": false
|
|
128
|
+
},
|
|
129
|
+
"settingsLabel": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"resolvedType": "string",
|
|
132
|
+
"attribute": "settings-label",
|
|
133
|
+
"default": "'Settings'",
|
|
134
|
+
"required": false,
|
|
135
|
+
"mutable": false
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"events": [
|
|
139
|
+
{
|
|
140
|
+
"name": "dsAreaSelect",
|
|
141
|
+
"detail": "string",
|
|
142
|
+
"bubbles": true,
|
|
143
|
+
"cancelable": true,
|
|
144
|
+
"composed": true
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "dsAuxiliarySelect",
|
|
148
|
+
"detail": "ShellMobileNavAuxiliaryDetail",
|
|
149
|
+
"bubbles": true,
|
|
150
|
+
"cancelable": true,
|
|
151
|
+
"composed": true
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "dsBrowseContextChange",
|
|
155
|
+
"detail": "NavChromeStyle",
|
|
156
|
+
"bubbles": true,
|
|
157
|
+
"cancelable": true,
|
|
158
|
+
"composed": true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "dsClose",
|
|
162
|
+
"detail": "void",
|
|
163
|
+
"bubbles": true,
|
|
164
|
+
"cancelable": true,
|
|
165
|
+
"composed": true
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"methods": [],
|
|
169
|
+
"slots": []
|
|
170
|
+
},
|
|
171
|
+
"props": {
|
|
172
|
+
"accountLabel": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"resolvedType": "string",
|
|
175
|
+
"attribute": "account-label",
|
|
176
|
+
"default": "'Account'",
|
|
177
|
+
"required": false,
|
|
178
|
+
"mutable": false
|
|
179
|
+
},
|
|
180
|
+
"browseContext": {
|
|
181
|
+
"type": "NavChromeStyle",
|
|
182
|
+
"resolvedType": "\"dashboard\" | \"settings\"",
|
|
183
|
+
"attribute": "browse-context",
|
|
184
|
+
"default": "'dashboard'",
|
|
185
|
+
"required": false,
|
|
186
|
+
"mutable": false
|
|
187
|
+
},
|
|
188
|
+
"currentUrl": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"resolvedType": "string",
|
|
191
|
+
"attribute": "current-url",
|
|
192
|
+
"default": "''",
|
|
193
|
+
"required": false,
|
|
194
|
+
"mutable": false
|
|
195
|
+
},
|
|
196
|
+
"dashboardGroups": {
|
|
197
|
+
"type": "PanelNavGroup[]",
|
|
198
|
+
"resolvedType": "PanelNavGroup[]",
|
|
199
|
+
"default": "[]",
|
|
200
|
+
"required": false,
|
|
201
|
+
"mutable": false
|
|
202
|
+
},
|
|
203
|
+
"dashboardLabel": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"resolvedType": "string",
|
|
206
|
+
"attribute": "dashboard-label",
|
|
207
|
+
"default": "'Dashboard'",
|
|
208
|
+
"required": false,
|
|
209
|
+
"mutable": false
|
|
210
|
+
},
|
|
211
|
+
"heading": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"resolvedType": "string",
|
|
214
|
+
"attribute": "heading",
|
|
215
|
+
"default": "'Navigation'",
|
|
216
|
+
"required": false,
|
|
217
|
+
"mutable": false
|
|
218
|
+
},
|
|
219
|
+
"helpLabel": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"resolvedType": "string",
|
|
222
|
+
"attribute": "help-label",
|
|
223
|
+
"default": "'Help & Support'",
|
|
224
|
+
"required": false,
|
|
225
|
+
"mutable": false
|
|
226
|
+
},
|
|
227
|
+
"navigationLabel": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"resolvedType": "string",
|
|
230
|
+
"attribute": "navigation-label",
|
|
231
|
+
"default": "'Application navigation'",
|
|
232
|
+
"required": false,
|
|
233
|
+
"mutable": false
|
|
234
|
+
},
|
|
235
|
+
"open": {
|
|
236
|
+
"type": "boolean",
|
|
237
|
+
"resolvedType": "boolean",
|
|
238
|
+
"attribute": "open",
|
|
239
|
+
"default": "false",
|
|
240
|
+
"required": false,
|
|
241
|
+
"mutable": false
|
|
242
|
+
},
|
|
243
|
+
"settingsGroups": {
|
|
244
|
+
"type": "PanelNavGroup[]",
|
|
245
|
+
"resolvedType": "PanelNavGroup[]",
|
|
246
|
+
"default": "[]",
|
|
247
|
+
"required": false,
|
|
248
|
+
"mutable": false
|
|
249
|
+
},
|
|
250
|
+
"settingsLabel": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"resolvedType": "string",
|
|
253
|
+
"attribute": "settings-label",
|
|
254
|
+
"default": "'Settings'",
|
|
255
|
+
"required": false,
|
|
256
|
+
"mutable": false
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"events": [
|
|
260
|
+
{
|
|
261
|
+
"name": "dsAreaSelect",
|
|
262
|
+
"detail": "string",
|
|
263
|
+
"bubbles": true,
|
|
264
|
+
"cancelable": true,
|
|
265
|
+
"composed": true
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "dsAuxiliarySelect",
|
|
269
|
+
"detail": "ShellMobileNavAuxiliaryDetail",
|
|
270
|
+
"bubbles": true,
|
|
271
|
+
"cancelable": true,
|
|
272
|
+
"composed": true
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "dsBrowseContextChange",
|
|
276
|
+
"detail": "NavChromeStyle",
|
|
277
|
+
"bubbles": true,
|
|
278
|
+
"cancelable": true,
|
|
279
|
+
"composed": true
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "dsClose",
|
|
283
|
+
"detail": "void",
|
|
284
|
+
"bubbles": true,
|
|
285
|
+
"cancelable": true,
|
|
286
|
+
"composed": true
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"methods": [],
|
|
290
|
+
"slots": [],
|
|
291
|
+
"exports": {
|
|
292
|
+
"customElement": "ds-shell-mobile-nav",
|
|
293
|
+
"react": "DsShellMobileNav",
|
|
294
|
+
"angular": "DsShellMobileNav"
|
|
295
|
+
},
|
|
296
|
+
"consumption": {
|
|
297
|
+
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
298
|
+
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
299
|
+
"customElements": {
|
|
300
|
+
"import": "import '@ds-mo/ui/dist/components/ds-shell-mobile-nav.js';",
|
|
301
|
+
"example": "<ds-shell-mobile-nav></ds-shell-mobile-nav>"
|
|
302
|
+
},
|
|
303
|
+
"react": {
|
|
304
|
+
"import": "import { DsShellMobileNav } from '@ds-mo/ui/react';",
|
|
305
|
+
"example": "<DsShellMobileNav />"
|
|
306
|
+
},
|
|
307
|
+
"angular": {
|
|
308
|
+
"import": "import { DsShellMobileNav } from '@ds-mo/ui/angular/ds-shell-mobile-nav';",
|
|
309
|
+
"example": "<ds-shell-mobile-nav></ds-shell-mobile-nav>"
|
|
310
|
+
},
|
|
311
|
+
"complexPropertyNote": "Assign these non-primitive values as JavaScript properties: dashboardGroups, settingsGroups.",
|
|
312
|
+
"peerDependencies": {
|
|
313
|
+
"required": [
|
|
314
|
+
"@ds-mo/tokens ^3.1.1",
|
|
315
|
+
"@ds-mo/icons ^6.4.0"
|
|
316
|
+
],
|
|
317
|
+
"frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"dependencies": [
|
|
322
|
+
"@ds-mo/ui",
|
|
323
|
+
"@ds-mo/tokens",
|
|
324
|
+
"@ds-mo/icons"
|
|
325
|
+
],
|
|
326
|
+
"registryDependencies": [
|
|
327
|
+
"icon",
|
|
328
|
+
"tab-group",
|
|
329
|
+
"text"
|
|
330
|
+
],
|
|
331
|
+
"files": [
|
|
332
|
+
{
|
|
333
|
+
"path": "src/wc/components/ShellMobileNav/ShellMobileNav.css",
|
|
334
|
+
"content": "@import '../../utils/control-density.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n\n:host {\n display: block;\n min-width: 0;\n min-height: 0;\n height: 100%;\n background: var(--color-background-primary);\n}\n\n:host(:not([open])) {\n display: none;\n}\n\n.shell-mobile-nav {\n display: grid;\n grid-template-rows: auto minmax(0, 1fr) auto;\n height: 100%;\n min-height: 0;\n background: var(--color-background-primary);\n}\n\n.shell-mobile-nav__header {\n display: grid;\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-200);\n border-bottom: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n}\n\n.shell-mobile-nav__body {\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n padding: var(--dimension-space-100);\n}\n\n.shell-mobile-nav__group + .shell-mobile-nav__group {\n margin-block-start: var(--dimension-space-200);\n}\n\n.shell-mobile-nav__group-label {\n display: block;\n padding: 0 var(--dimension-space-100) var(--dimension-space-050);\n}\n\n.shell-mobile-nav__items {\n display: grid;\n gap: var(--dimension-space-025);\n}\n\n.shell-mobile-nav__area,\n.shell-mobile-nav__auxiliary {\n appearance: none;\n width: 100%;\n border: 0;\n background: transparent;\n color: var(--color-foreground-secondary);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: var(--ds-control-content-gap);\n padding-inline: var(--dimension-space-100);\n cursor: pointer;\n text-align: start;\n}\n\n.shell-mobile-nav__area--selected {\n color: var(--color-foreground-primary);\n}\n\n.shell-mobile-nav__dot {\n width: var(--dimension-size-075);\n height: var(--dimension-size-075);\n margin-inline-start: auto;\n border-radius: var(--dimension-radius-half);\n background: var(--color-background-bold-brand);\n}\n\n.shell-mobile-nav__footer {\n display: grid;\n gap: var(--dimension-space-025);\n padding: var(--dimension-space-100);\n border-top: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n}\n",
|
|
335
|
+
"type": "registry:ui"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"path": "src/wc/components/ShellMobileNav/ShellMobileNav.tsx",
|
|
339
|
+
"content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n Watch,\n} from '@stencil/core';\nimport type { NavChromeStyle } from '../../shell/nav-chrome';\nimport { deriveActiveIdFromUrl } from '../PanelNav/panel-nav-utils';\nimport type { PanelNavGroup, PanelNavItem } from '../PanelNav/panel-nav-types';\nimport type {\n ShellMobileNavAuxiliaryDetail,\n ShellMobileNavAuxiliaryId,\n} from './shell-mobile-nav-types';\n\nconst CONTEXT_TABS = [\n { id: 'dashboard', label: 'Dashboard' },\n { id: 'settings', label: 'Settings' },\n];\n\n@Component({\n tag: 'ds-shell-mobile-nav',\n styleUrl: 'ShellMobileNav.css',\n scoped: true,\n})\nexport class ShellMobileNav {\n @Element() el!: HTMLElement;\n\n @Prop({ reflect: true }) open: boolean = false;\n @Prop() browseContext: NavChromeStyle = 'dashboard';\n @Prop() dashboardGroups: PanelNavGroup[] = [];\n @Prop() settingsGroups: PanelNavGroup[] = [];\n @Prop() currentUrl: string = '';\n @Prop() heading: string = 'Navigation';\n @Prop() navigationLabel: string = 'Application navigation';\n @Prop() dashboardLabel: string = 'Dashboard';\n @Prop() settingsLabel: string = 'Settings';\n @Prop() accountLabel: string = 'Account';\n @Prop() helpLabel: string = 'Help & Support';\n\n @Event() dsAreaSelect!: EventEmitter<string>;\n @Event() dsBrowseContextChange!: EventEmitter<NavChromeStyle>;\n @Event() dsAuxiliarySelect!: EventEmitter<ShellMobileNavAuxiliaryDetail>;\n @Event() dsClose!: EventEmitter<void>;\n\n private get groups(): PanelNavGroup[] {\n return this.browseContext === 'settings' ? this.settingsGroups : this.dashboardGroups;\n }\n\n private get items(): PanelNavItem[] {\n return this.groups.flatMap(group => group.items);\n }\n\n private get activeId(): string {\n return deriveActiveIdFromUrl(this.currentUrl, [\n ...this.dashboardGroups.flatMap(group => group.items),\n ...this.settingsGroups.flatMap(group => group.items),\n ]);\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n if (!open) return;\n requestAnimationFrame(() => {\n const selected = this.el.querySelector<HTMLElement>('[aria-current=\"page\"]');\n const first = this.el.querySelector<HTMLElement>('.shell-mobile-nav__area');\n (selected ?? first)?.focus({ preventScroll: true });\n });\n }\n\n @Listen('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (!this.open || event.key !== 'Escape') return;\n event.preventDefault();\n this.dsClose.emit();\n }\n\n private handleContextChange = (event: CustomEvent<string>) => {\n const next = event.detail === 'settings' ? 'settings' : 'dashboard';\n if (next === this.browseContext) return;\n this.dsBrowseContextChange.emit(next);\n };\n\n private selectAuxiliary(id: ShellMobileNavAuxiliaryId, event: MouseEvent) {\n this.dsAuxiliarySelect.emit({\n id,\n anchor: event.currentTarget as HTMLElement,\n });\n }\n\n private renderGroup(group: PanelNavGroup, index: number) {\n return (\n <section class=\"shell-mobile-nav__group\" aria-labelledby={group.label ? `mobile-nav-group-${group.id ?? index}` : undefined}>\n {group.label && (\n <ds-text\n id={`mobile-nav-group-${group.id ?? index}`}\n class=\"shell-mobile-nav__group-label\"\n as=\"h2\"\n variant=\"text-caption\"\n color=\"secondary\"\n >\n {group.label}\n </ds-text>\n )}\n <div class=\"shell-mobile-nav__items\">\n {group.items.map(item => {\n const selected = item.id === this.activeId;\n return (\n <button\n type=\"button\"\n class={{\n 'shell-mobile-nav__area': true,\n 'shell-mobile-nav__area--selected': selected,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': selected,\n }}\n aria-current={selected ? 'page' : undefined}\n onClick={() => this.dsAreaSelect.emit(item.id)}\n >\n <ds-icon name={item.icon} size=\"md\" color=\"inherit\" />\n <ds-text as=\"span\" variant=\"text-body-medium\" emphasis color=\"inherit\">\n {item.label}\n </ds-text>\n {item.dot && <span class=\"shell-mobile-nav__dot\" aria-hidden=\"true\" />}\n </button>\n );\n })}\n </div>\n </section>\n );\n }\n\n render() {\n const contextTabs = [\n { ...CONTEXT_TABS[0], label: this.dashboardLabel },\n { ...CONTEXT_TABS[1], label: this.settingsLabel },\n ];\n\n return (\n <Host aria-hidden={this.open ? undefined : 'true'} inert={this.open ? undefined : true}>\n <section\n id=\"ds-shell-mobile-navigation\"\n class=\"shell-mobile-nav\"\n aria-label={this.navigationLabel}\n >\n <header class=\"shell-mobile-nav__header\">\n <ds-text as=\"h1\" variant=\"text-title-medium\" emphasis>\n {this.heading}\n </ds-text>\n <ds-tab-group\n tabs={contextTabs}\n value={this.browseContext}\n aria-label=\"Navigation context\"\n onDsChange={this.handleContextChange}\n />\n </header>\n\n <nav class=\"shell-mobile-nav__body\" aria-label={this.navigationLabel}>\n {this.groups.map((group, index) => this.renderGroup(group, index))}\n </nav>\n\n <footer class=\"shell-mobile-nav__footer\">\n <button\n type=\"button\"\n class=\"shell-mobile-nav__auxiliary ds-control--md ds-focus-ring-inset ds-interaction-fill\"\n onClick={event => this.selectAuxiliary('help', event)}\n >\n <ds-icon name=\"CircleQuestion\" size=\"md\" color=\"inherit\" />\n <ds-text as=\"span\" variant=\"text-body-medium\" emphasis color=\"inherit\">\n {this.helpLabel}\n </ds-text>\n </button>\n <button\n type=\"button\"\n class=\"shell-mobile-nav__auxiliary ds-control--md ds-focus-ring-inset ds-interaction-fill\"\n onClick={event => this.selectAuxiliary('account', event)}\n >\n <ds-icon name=\"Avatar\" size=\"md\" color=\"inherit\" />\n <ds-text as=\"span\" variant=\"text-body-medium\" emphasis color=\"inherit\">\n {this.accountLabel}\n </ds-text>\n </button>\n </footer>\n </section>\n </Host>\n );\n }\n}\n",
|
|
340
|
+
"type": "registry:ui"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"path": "src/wc/components/ShellMobileNav/shell-mobile-nav-types.ts",
|
|
344
|
+
"content": "export type ShellMobileNavAuxiliaryId = 'account' | 'help';\n\nexport interface ShellMobileNavAuxiliaryDetail {\n id: ShellMobileNavAuxiliaryId;\n anchor: HTMLElement;\n}\n",
|
|
345
|
+
"type": "registry:ui"
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "shell-mobile-section-nav",
|
|
4
|
+
"title": "ShellMobileSectionNav",
|
|
5
|
+
"description": "Horizontally scrollable mobile route navigation corresponding to the active area's desktop BarNav.",
|
|
6
|
+
"type": "registry:ui",
|
|
7
|
+
"meta": {
|
|
8
|
+
"library": "@ds-mo/ui",
|
|
9
|
+
"distribution": "npm",
|
|
10
|
+
"storybook": "https://zainadeel.github.io/compomo/?path=/story/shell-mobile-section-nav",
|
|
11
|
+
"source": "src/wc/components/ShellMobileSectionNav/ShellMobileSectionNav.tsx",
|
|
12
|
+
"intentStatus": "complete",
|
|
13
|
+
"intent": {
|
|
14
|
+
"audience": "specialized",
|
|
15
|
+
"status": "experimental",
|
|
16
|
+
"summary": "Horizontally scrollable mobile route navigation corresponding to the active area's desktop BarNav.",
|
|
17
|
+
"useWhen": [
|
|
18
|
+
"ShellApp is rendering the below-768px routed workspace and the active area has peer route sections."
|
|
19
|
+
],
|
|
20
|
+
"avoidWhen": [
|
|
21
|
+
"Choices switch local content without navigation; use TabGroup.",
|
|
22
|
+
"Rendering the desktop or tablet secondary navigation; use BarNav."
|
|
23
|
+
],
|
|
24
|
+
"alternatives": [
|
|
25
|
+
{
|
|
26
|
+
"when": "The choices switch local content without changing routes.",
|
|
27
|
+
"component": "component:ds-tab-group",
|
|
28
|
+
"reason": "TabGroup owns local view selection."
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"commonlyComposedWith": [
|
|
32
|
+
"component:ds-shell-app",
|
|
33
|
+
"component:ds-shell-mobile-bar",
|
|
34
|
+
"component:ds-bar-nav"
|
|
35
|
+
],
|
|
36
|
+
"patterns": [
|
|
37
|
+
"pattern:application-shell"
|
|
38
|
+
],
|
|
39
|
+
"accessibility": [
|
|
40
|
+
"The row is a named navigation landmark and the selected section exposes aria-current.",
|
|
41
|
+
"Disabled route sections remain visible but cannot emit navigation intent."
|
|
42
|
+
],
|
|
43
|
+
"states": [
|
|
44
|
+
"The host router owns the current URL and handles dsTabChange.",
|
|
45
|
+
"Detail routes that do not match a section show the active-area heading."
|
|
46
|
+
],
|
|
47
|
+
"responsiveBehavior": [
|
|
48
|
+
"The row scrolls horizontally without wrapping and centers the selected section when selection changes."
|
|
49
|
+
],
|
|
50
|
+
"frameworkCaveats": {
|
|
51
|
+
"customElements": [
|
|
52
|
+
"Assign tabs as a JavaScript property and update currentUrl and basePath with router state."
|
|
53
|
+
],
|
|
54
|
+
"react": [
|
|
55
|
+
"Pass the same BarNavTab array used by the desktop BarNav through the generated React wrapper."
|
|
56
|
+
],
|
|
57
|
+
"angular": [
|
|
58
|
+
"Import the generated standalone adapter and bind tabs as a property."
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"references": [
|
|
62
|
+
{
|
|
63
|
+
"label": "Storybook",
|
|
64
|
+
"path": "src/wc/components/ShellMobileSectionNav/ShellMobileSectionNav.stories.ts"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"api": {
|
|
69
|
+
"props": {
|
|
70
|
+
"basePath": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"resolvedType": "string",
|
|
73
|
+
"attribute": "base-path",
|
|
74
|
+
"default": "''",
|
|
75
|
+
"required": false,
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"description": "Section base path used to derive the selected route tab."
|
|
78
|
+
},
|
|
79
|
+
"currentUrl": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"resolvedType": "string",
|
|
82
|
+
"attribute": "current-url",
|
|
83
|
+
"default": "''",
|
|
84
|
+
"required": false,
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"description": "Current application route."
|
|
87
|
+
},
|
|
88
|
+
"heading": {
|
|
89
|
+
"type": "string | undefined",
|
|
90
|
+
"resolvedType": "string | undefined",
|
|
91
|
+
"attribute": "heading",
|
|
92
|
+
"required": false,
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"description": "Active primary-area label shown when the route has no section row."
|
|
95
|
+
},
|
|
96
|
+
"navigationLabel": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"resolvedType": "string",
|
|
99
|
+
"attribute": "navigation-label",
|
|
100
|
+
"default": "'Section navigation'",
|
|
101
|
+
"required": false,
|
|
102
|
+
"mutable": false
|
|
103
|
+
},
|
|
104
|
+
"tabs": {
|
|
105
|
+
"type": "BarNavTab[]",
|
|
106
|
+
"resolvedType": "TabItem[]",
|
|
107
|
+
"default": "[]",
|
|
108
|
+
"required": false,
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"description": "Route sections shared with the corresponding desktop BarNav."
|
|
111
|
+
},
|
|
112
|
+
"tabsJson": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"resolvedType": "string",
|
|
115
|
+
"attribute": "tabs-json",
|
|
116
|
+
"default": "''",
|
|
117
|
+
"required": false,
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"description": "JSON fallback for `tabs`."
|
|
120
|
+
},
|
|
121
|
+
"value": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"resolvedType": "string",
|
|
124
|
+
"attribute": "value",
|
|
125
|
+
"default": "''",
|
|
126
|
+
"required": false,
|
|
127
|
+
"mutable": false,
|
|
128
|
+
"description": "Controlled selected tab when URL-derived selection is unavailable."
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"events": [
|
|
132
|
+
{
|
|
133
|
+
"name": "dsTabChange",
|
|
134
|
+
"detail": "string",
|
|
135
|
+
"bubbles": true,
|
|
136
|
+
"cancelable": true,
|
|
137
|
+
"composed": true,
|
|
138
|
+
"description": "Route intent; the application owns navigation."
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"methods": [],
|
|
142
|
+
"slots": []
|
|
143
|
+
},
|
|
144
|
+
"props": {
|
|
145
|
+
"basePath": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"resolvedType": "string",
|
|
148
|
+
"attribute": "base-path",
|
|
149
|
+
"default": "''",
|
|
150
|
+
"required": false,
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"description": "Section base path used to derive the selected route tab."
|
|
153
|
+
},
|
|
154
|
+
"currentUrl": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"resolvedType": "string",
|
|
157
|
+
"attribute": "current-url",
|
|
158
|
+
"default": "''",
|
|
159
|
+
"required": false,
|
|
160
|
+
"mutable": false,
|
|
161
|
+
"description": "Current application route."
|
|
162
|
+
},
|
|
163
|
+
"heading": {
|
|
164
|
+
"type": "string | undefined",
|
|
165
|
+
"resolvedType": "string | undefined",
|
|
166
|
+
"attribute": "heading",
|
|
167
|
+
"required": false,
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"description": "Active primary-area label shown when the route has no section row."
|
|
170
|
+
},
|
|
171
|
+
"navigationLabel": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"resolvedType": "string",
|
|
174
|
+
"attribute": "navigation-label",
|
|
175
|
+
"default": "'Section navigation'",
|
|
176
|
+
"required": false,
|
|
177
|
+
"mutable": false
|
|
178
|
+
},
|
|
179
|
+
"tabs": {
|
|
180
|
+
"type": "BarNavTab[]",
|
|
181
|
+
"resolvedType": "TabItem[]",
|
|
182
|
+
"default": "[]",
|
|
183
|
+
"required": false,
|
|
184
|
+
"mutable": false,
|
|
185
|
+
"description": "Route sections shared with the corresponding desktop BarNav."
|
|
186
|
+
},
|
|
187
|
+
"tabsJson": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"resolvedType": "string",
|
|
190
|
+
"attribute": "tabs-json",
|
|
191
|
+
"default": "''",
|
|
192
|
+
"required": false,
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"description": "JSON fallback for `tabs`."
|
|
195
|
+
},
|
|
196
|
+
"value": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"resolvedType": "string",
|
|
199
|
+
"attribute": "value",
|
|
200
|
+
"default": "''",
|
|
201
|
+
"required": false,
|
|
202
|
+
"mutable": false,
|
|
203
|
+
"description": "Controlled selected tab when URL-derived selection is unavailable."
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"events": [
|
|
207
|
+
{
|
|
208
|
+
"name": "dsTabChange",
|
|
209
|
+
"detail": "string",
|
|
210
|
+
"bubbles": true,
|
|
211
|
+
"cancelable": true,
|
|
212
|
+
"composed": true,
|
|
213
|
+
"description": "Route intent; the application owns navigation."
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"methods": [],
|
|
217
|
+
"slots": [],
|
|
218
|
+
"exports": {
|
|
219
|
+
"customElement": "ds-shell-mobile-section-nav",
|
|
220
|
+
"react": "DsShellMobileSectionNav",
|
|
221
|
+
"angular": "DsShellMobileSectionNav"
|
|
222
|
+
},
|
|
223
|
+
"consumption": {
|
|
224
|
+
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
225
|
+
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
226
|
+
"customElements": {
|
|
227
|
+
"import": "import '@ds-mo/ui/dist/components/ds-shell-mobile-section-nav.js';",
|
|
228
|
+
"example": "<ds-shell-mobile-section-nav></ds-shell-mobile-section-nav>"
|
|
229
|
+
},
|
|
230
|
+
"react": {
|
|
231
|
+
"import": "import { DsShellMobileSectionNav } from '@ds-mo/ui/react';",
|
|
232
|
+
"example": "<DsShellMobileSectionNav />"
|
|
233
|
+
},
|
|
234
|
+
"angular": {
|
|
235
|
+
"import": "import { DsShellMobileSectionNav } from '@ds-mo/ui/angular/ds-shell-mobile-section-nav';",
|
|
236
|
+
"example": "<ds-shell-mobile-section-nav></ds-shell-mobile-section-nav>"
|
|
237
|
+
},
|
|
238
|
+
"complexPropertyNote": "Assign these non-primitive values as JavaScript properties: tabs.",
|
|
239
|
+
"peerDependencies": {
|
|
240
|
+
"required": [
|
|
241
|
+
"@ds-mo/tokens ^3.1.1",
|
|
242
|
+
"@ds-mo/icons ^6.4.0"
|
|
243
|
+
],
|
|
244
|
+
"frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"dependencies": [
|
|
249
|
+
"@ds-mo/ui",
|
|
250
|
+
"@ds-mo/tokens"
|
|
251
|
+
],
|
|
252
|
+
"registryDependencies": [
|
|
253
|
+
"text"
|
|
254
|
+
],
|
|
255
|
+
"files": [
|
|
256
|
+
{
|
|
257
|
+
"path": "src/wc/components/ShellMobileSectionNav/ShellMobileSectionNav.css",
|
|
258
|
+
"content": "@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n\n:host {\n display: block;\n min-width: 0;\n background: var(--color-background-primary);\n color: var(--color-foreground-secondary);\n}\n\n.shell-mobile-section-nav {\n min-width: 0;\n min-height: var(--dimension-size-600);\n display: flex;\n align-items: center;\n border-bottom: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n background: var(--color-background-primary);\n}\n\n.shell-mobile-section-nav__scroller {\n width: 100%;\n min-width: 0;\n min-height: var(--dimension-size-600);\n display: flex;\n align-items: center;\n gap: var(--dimension-space-050);\n padding-inline: var(--dimension-space-100);\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-inline: contain;\n scrollbar-width: none;\n box-sizing: border-box;\n}\n\n.shell-mobile-section-nav__scroller::-webkit-scrollbar {\n display: none;\n}\n\n.shell-mobile-section-nav__tab {\n appearance: none;\n flex: 0 0 auto;\n min-height: var(--dimension-size-400);\n padding-inline: var(--dimension-space-100);\n border: 0;\n border-radius: var(--dimension-radius-100);\n background: transparent;\n color: inherit;\n display: inline-flex;\n align-items: center;\n gap: var(--dimension-space-050);\n cursor: pointer;\n}\n\n.shell-mobile-section-nav__tab--selected {\n color: var(--color-foreground-primary);\n}\n\n.shell-mobile-section-nav__tab:disabled {\n color: var(--color-foreground-tertiary);\n cursor: default;\n}\n\n.shell-mobile-section-nav__divider {\n flex: 0 0 auto;\n width: var(--dimension-stroke-width-012);\n height: var(--dimension-size-300);\n background: var(--color-border-tertiary);\n}\n\n.shell-mobile-section-nav__dot {\n width: var(--dimension-size-075);\n height: var(--dimension-size-075);\n border-radius: var(--dimension-radius-half);\n background: var(--color-background-bold-brand);\n}\n\n.shell-mobile-section-nav__heading {\n display: block;\n min-width: 0;\n padding-inline: var(--dimension-space-200);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n",
|
|
259
|
+
"type": "registry:ui"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"path": "src/wc/components/ShellMobileSectionNav/ShellMobileSectionNav.tsx",
|
|
263
|
+
"content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n} from '@stencil/core';\nimport type { BarNavTab } from '../BarNav/bar-nav-types';\nimport {\n deriveBarNavValueFromUrl,\n parseJsonArrayProp,\n} from '../BarNav/bar-nav-utils';\nimport { getSelectableTabs, isTabDivider } from '../TabGroup/tab-item-utils';\n\n@Component({\n tag: 'ds-shell-mobile-section-nav',\n styleUrl: 'ShellMobileSectionNav.css',\n scoped: true,\n})\nexport class ShellMobileSectionNav {\n @Element() el!: HTMLElement;\n\n /** Route sections shared with the corresponding desktop BarNav. */\n @Prop() tabs: BarNavTab[] = [];\n /** JSON fallback for `tabs`. */\n @Prop({ attribute: 'tabs-json' }) tabsJson: string = '';\n /** Controlled selected tab when URL-derived selection is unavailable. */\n @Prop() value: string = '';\n /** Active primary-area label shown when the route has no section row. */\n @Prop() heading: string | undefined;\n /** Section base path used to derive the selected route tab. */\n @Prop() basePath: string = '';\n /** Current application route. */\n @Prop() currentUrl: string = '';\n @Prop() navigationLabel: string = 'Section navigation';\n\n /** Route intent; the application owns navigation. */\n @Event() dsTabChange!: EventEmitter<string>;\n\n private lastScrolledValue = '';\n\n private get resolvedTabs(): BarNavTab[] {\n return this.tabsJson\n ? parseJsonArrayProp<BarNavTab>(this.tabsJson, [])\n : (this.tabs ?? []);\n }\n\n private get urlState() {\n return deriveBarNavValueFromUrl(this.currentUrl, this.basePath, this.resolvedTabs);\n }\n\n private get effectiveValue(): string {\n if (this.currentUrl && this.basePath) return this.urlState.value;\n return this.value;\n }\n\n componentDidLoad() {\n this.scrollSelectedIntoView();\n }\n\n componentDidRender() {\n this.scrollSelectedIntoView();\n }\n\n private scrollSelectedIntoView() {\n const selectedValue = this.effectiveValue;\n if (!selectedValue || selectedValue === this.lastScrolledValue) return;\n this.lastScrolledValue = selectedValue;\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(`[data-section-id=\"${CSS.escape(selectedValue)}\"]`)\n ?.scrollIntoView({ block: 'nearest', inline: 'center' });\n });\n }\n\n private selectTab(id: string, isInactive: boolean | undefined) {\n if (isInactive || id === this.effectiveValue) return;\n this.dsTabChange.emit(id);\n }\n\n render() {\n const tabs = this.resolvedTabs;\n const selectableTabs = getSelectableTabs(tabs);\n const showTabs = selectableTabs.length > 0 && !this.urlState.hideTabs;\n\n return (\n <Host>\n <nav class=\"shell-mobile-section-nav\" aria-label={this.navigationLabel}>\n {showTabs ? (\n <div class=\"shell-mobile-section-nav__scroller\">\n {tabs.map((tab, index) => {\n if (isTabDivider(tab)) {\n return (\n <span\n class=\"shell-mobile-section-nav__divider\"\n aria-hidden=\"true\"\n key={`divider-${index}`}\n />\n );\n }\n\n const selected = tab.id === this.effectiveValue;\n return (\n <button\n type=\"button\"\n class={{\n 'shell-mobile-section-nav__tab': true,\n 'shell-mobile-section-nav__tab--selected': selected,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n data-section-id={tab.id}\n disabled={tab.isInactive}\n aria-current={selected ? 'page' : undefined}\n onClick={() => this.selectTab(tab.id, tab.isInactive)}\n >\n <ds-text\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis={selected}\n color=\"inherit\"\n >\n {tab.label}\n </ds-text>\n {tab.dot && (\n <span class=\"shell-mobile-section-nav__dot\" aria-hidden=\"true\" />\n )}\n </button>\n );\n })}\n </div>\n ) : (\n <ds-text\n class=\"shell-mobile-section-nav__heading\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n >\n {this.heading ?? ''}\n </ds-text>\n )}\n </nav>\n </Host>\n );\n }\n}\n",
|
|
264
|
+
"type": "registry:ui"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}
|