@medalsocial/meda 0.1.0 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2023-2026 Medal Social
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,268 +1,81 @@
1
1
  # @medalsocial/meda
2
2
 
3
- Shared Meda UI shell/runtime package.
3
+ Shared UI shell and runtime primitives — the navigation chrome, panels, tab bars, command palette, and workbench layout that power Medal's apps. Published as Apache-2.0.
4
4
 
5
- Current scope:
6
- - shell layout primitives
7
- - shell navigation and rail renderers
8
- - shell header and tab chrome
9
- - shell state runtime
10
- - shell layout and route utilities
5
+ ![npm](https://img.shields.io/npm/v/@medalsocial/meda)
11
6
 
12
- Non-goals for this package:
13
- - duplicating the full shadcn primitive layer
14
- - Picasso-specific route config, workspace data, or panel content
15
- - router-specific runtime assumptions
7
+ ## Install
16
8
 
17
- ## Import Surface
18
-
19
- Primary root import:
20
-
21
- ```ts
22
- import {
23
- NavigationArea,
24
- ShellAppRail,
25
- ShellDesktopPanelDock,
26
- ShellFrame,
27
- ShellHeaderFrame,
28
- ShellModuleNav,
29
- ShellPanelRail,
30
- ShellScrollableContent,
31
- ShellStateProvider,
32
- ShellTabBar,
33
- WorkbenchLayout,
34
- } from '@medalsocial/meda'
35
- ```
36
-
37
- The root package is the curated public API. It is the default import surface for app consumers.
38
-
39
- Shell subpath:
40
-
41
- ```ts
42
- import { ShellFrame, ShellStateProvider } from '@medalsocial/meda/shell'
9
+ ```bash
10
+ pnpm add @medalsocial/meda
43
11
  ```
44
12
 
45
- The `@medalsocial/meda/shell` subpath is broader. Use it when you intentionally need lower-level shell helpers that are not part of the primary root contract yet.
46
-
47
- ## Stable Root Surface
48
-
49
- Root exports currently include:
50
- - shell chrome: `ShellFrame`, `ShellHeaderFrame`, `ShellPanelToggle`, `NavigationArea`
51
- - shell navigation: `ShellAppRail`, `ShellModuleNav`, `ShellPanelRail`, `ShellTabBar`
52
- - shell layout/runtime: `ShellDesktopPanelDock`, `ShellScrollableContent`, `WorkbenchLayout`
53
- - shell state: `ShellStateProvider`, `useShellState`
54
- - shared contracts: `ShellModuleDefinition`, `ShellPanelDefinition`, `ShellRailItem`, `ShellTab`, `ShellViewDefinition`
55
- - shared utilities: route-handle helpers, panel helpers, layout helpers, section-command builder, shortcut-map builder
13
+ Peer deps: `react >= 19`, `react-dom >= 19`.
56
14
 
57
- Lower-level shell internals remain available from `@medalsocial/meda/shell`.
15
+ ## Tailwind CSS v4 setup
58
16
 
59
- ## Minimal Consumer Shape
17
+ Meda ships a `styles.css` with its design tokens. Import it once in your entry stylesheet or entry script:
60
18
 
61
- Typical consumer setup:
62
-
63
- ```ts
64
- import {
65
- ShellFrame,
66
- ShellHeaderFrame,
67
- ShellStateProvider,
68
- ShellTabBar,
69
- type ShellModuleDefinition,
70
- } from '@medalsocial/meda'
19
+ ```css
20
+ @import '@medalsocial/meda/styles.css';
71
21
  ```
72
22
 
73
- Then the host app provides:
74
- - router integration through `renderLink` callbacks and search-param adapters
75
- - module definitions and panel registries
76
- - workspace/business state
77
- - app-specific menus and content renderers
78
-
79
- ## Recipes
80
-
81
- ### 1. Define app modules
82
-
83
- ```ts
84
- import { Home, Package } from 'lucide-react'
85
- import type { ShellModuleDefinition } from '@medalsocial/meda'
86
-
87
- export const modules: Record<string, ShellModuleDefinition> = {
88
- lab: {
89
- id: 'lab',
90
- label: 'Labs',
91
- description: 'Hardware R&D workspace',
92
- items: [
93
- {
94
- to: '/lab',
95
- label: 'Overview',
96
- description: 'Program status and entry points',
97
- icon: Home,
98
- shortcut: '1',
99
- },
100
- {
101
- to: '/lab/products',
102
- label: 'Products',
103
- description: 'Every form factor and BOM',
104
- icon: Package,
105
- shortcut: '2',
106
- },
107
- ],
108
- headerTabs: [
109
- { id: 'overview', to: '/lab', label: 'Overview' },
110
- { id: 'products', to: '/lab/products', label: 'Products' },
111
- ],
112
- },
113
- }
114
- ```
23
+ ## Usage
115
24
 
116
- ### 2. Connect shell state to host routing
25
+ `ShellStateProvider` stores panel/selection state in URL search params and is router-agnostic. You provide a `ShellSearchParamsAdapter` so it can read and update them however your router prefers. A minimal, in-memory adapter:
117
26
 
118
- ```ts
119
- import { ShellStateProvider } from '@medalsocial/meda'
120
- import { useSearchParams } from 'react-router'
27
+ ```tsx
28
+ import { useState } from 'react';
29
+ import { ShellStateProvider, ShellFrame } from '@medalsocial/meda';
121
30
 
122
- export function AppShellState({ children }: { children: React.ReactNode }) {
123
- const [searchParams, setSearchParams] = useSearchParams()
31
+ export function App() {
32
+ const [searchParams, setSearchParams] = useState(() => new URLSearchParams());
124
33
 
125
34
  return (
126
35
  <ShellStateProvider
127
36
  adapter={{
128
37
  searchParams,
129
- setSearchParams: (updater) => {
130
- setSearchParams((current) => updater(current))
131
- },
38
+ setSearchParams: (updater) => setSearchParams((current) => updater(current)),
132
39
  }}
133
- initialActiveRail="lab"
134
- selectionQueryParam="product"
135
- sidePanelWidthStorageKey="my-app.side-panel.width"
136
40
  >
137
- {children}
41
+ <ShellFrame>{/* your app */}</ShellFrame>
138
42
  </ShellStateProvider>
139
- )
43
+ );
140
44
  }
141
45
  ```
142
46
 
143
- ### 3. Render router-aware tabs
47
+ For a real app, wire the adapter to your router (e.g. TanStack Router's `useSearch`/`useNavigate`, React Router's `useSearchParams`) so URL changes persist state.
144
48
 
145
- ```ts
146
- import { ShellTabBar, type ShellTab } from '@medalsocial/meda'
147
- import Link from 'next/link'
49
+ See the [demo app](./demo) for a live playground.
148
50
 
149
- export function AppTabs({ tabs, activeTab }: { tabs: ShellTab[]; activeTab?: string }) {
150
- return (
151
- <ShellTabBar
152
- tabs={tabs}
153
- activeTab={activeTab}
154
- ariaLabel="Workspace tabs"
155
- renderLink={({ children, className, tab, isActive }) => (
156
- <Link
157
- key={tab.id}
158
- href={tab.to ?? '#'}
159
- aria-current={isActive ? 'page' : undefined}
160
- className={className}
161
- >
162
- {children}
163
- </Link>
164
- )}
165
- />
166
- )
167
- }
168
- ```
51
+ ## Exports
169
52
 
170
- ### 4. Compose the shell frame
171
-
172
- ```tsx
173
- <ShellFrame
174
- header={
175
- <ShellHeaderFrame
176
- left={<WorkspaceMenu />}
177
- center={<AppTabs tabs={tabs} activeTab={activeTab} />}
178
- right={<HeaderActions />}
179
- />
180
- }
181
- navigation={
182
- <NavigationArea>
183
- <AppRail />
184
- <SectionSidebar />
185
- </NavigationArea>
186
- }
187
- content={
188
- <ShellScrollableContent
189
- layout="workspace"
190
- maxWidth={1120}
191
- desktopDockOffset={panelOpen ? 392 : 0}
192
- >
193
- <Outlet />
194
- </ShellScrollableContent>
195
- }
196
- desktopDock={
197
- panelOpen ? (
198
- <ShellDesktopPanelDock
199
- defaultView={activeView}
200
- panelOpen
201
- width={panelWidth}
202
- onWidthChange={setPanelWidth}
203
- renderPanel={({ defaultView, className }) => (
204
- <MyPanel defaultView={defaultView} className={className} />
205
- )}
206
- />
207
- ) : null
208
- }
209
- />
210
- ```
53
+ - `@medalsocial/meda` curated public API (components + helpers)
54
+ - `@medalsocial/meda/shell` — shell-only subpath
55
+ - `@medalsocial/meda/styles.css` — design tokens + base styles
211
56
 
212
- ### 5. Build section commands
57
+ ## Alternative: shadcn registry
213
58
 
214
- ```ts
215
- import { buildShellSectionCommands } from '@medalsocial/meda'
59
+ Prefer to copy source into your project instead of installing? The shadcn-compatible registry lives at [`./registry`](./registry). Serve it statically and run:
216
60
 
217
- const commands = [
218
- ...buildShellSectionCommands(activeModule),
219
- { id: 'settings', label: 'Settings', to: '/settings', icon: Settings, group: 'Global' },
220
- ]
61
+ ```bash
62
+ npx shadcn add <registry-url>/r/meda-shell.json
221
63
  ```
222
64
 
223
- ### 6. Resolve route-provided shell metadata
224
-
225
- ```ts
226
- import {
227
- getShellActionsFromMatches,
228
- getShellContentLayoutFromMatches,
229
- getShellPanelViewsFromMatches,
230
- getShellTabsFromMatches,
231
- } from '@medalsocial/meda'
65
+ ## Development
232
66
 
233
- const contentLayout = getShellContentLayoutFromMatches(matches)
234
- const shellTabs = getShellTabsFromMatches(matches, pathname)
235
- const shellActions = getShellActionsFromMatches(matches, pathname)
236
- const panelViewIds = getShellPanelViewsFromMatches(matches)
67
+ ```bash
68
+ pnpm install
69
+ pnpm build # compile dist/
70
+ pnpm test # vitest (jsdom)
71
+ pnpm registry:validate
72
+ pnpm demo:dev # run the playground locally
237
73
  ```
238
74
 
239
- ## Host Responsibilities
240
-
241
- Consumers own:
242
- - routing and link rendering
243
- - module definitions
244
- - panel definitions and renderers
245
- - workspace/business state
246
- - app-specific header/workspace menus
247
-
248
- Meda owns:
249
- - reusable shell chrome and runtime
250
- - generic shell state persistence and query-param wiring through adapters
251
- - layout math and route-handle helpers
252
-
253
- ## Router Guidance
254
-
255
- Meda should stay React-first and router-agnostic.
256
-
257
- - React Router apps: pass `Link`/`NavLink` through render props and connect `useSearchParams` to `ShellStateProvider`
258
- - Next.js apps: pass `next/link` wrappers and a host search-param adapter
259
- - TanStack Router apps: pass router link wrappers and route/search adapters from the host
75
+ ## Release
260
76
 
261
- The package should not import app-router internals directly.
77
+ Changesets + GitHub Actions (OIDC trusted publishing). Add a changeset with `pnpm changeset`, merge to the release branch, and the `Release` workflow handles npm publish with provenance.
262
78
 
263
- ## Current Verification
79
+ ## License
264
80
 
265
- The package is currently verified by:
266
- - package-level unit tests in `software/meda/src/shell/*.test.tsx`
267
- - Picasso dashboard consuming the package in `software/dashboard`
268
- - a separate consumer fixture in `software/meda-fixture`
81
+ Apache-2.0. See [LICENSE](./LICENSE) and [NOTICE](./NOTICE).
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './shell/public';
1
+ export * from './shell/public.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from './shell/public';
1
+ export * from './shell/public.js';
@@ -1,15 +1,15 @@
1
- export * from './navigation-area';
2
- export * from './shell-app-rail';
3
- export * from './shell-desktop-panel-dock';
4
- export * from './shell-frame';
5
- export * from './shell-header';
6
- export * from './shell-layout-utils';
7
- export * from './shell-module-nav';
8
- export * from './shell-panel-rail';
9
- export * from './shell-route-utils';
10
- export * from './shell-scrollable-content';
11
- export * from './shell-state';
12
- export * from './shell-tab-bar';
13
- export * from './types';
14
- export * from './utils';
15
- export * from './workbench-layout';
1
+ export * from './navigation-area.js';
2
+ export * from './shell-app-rail.js';
3
+ export * from './shell-desktop-panel-dock.js';
4
+ export * from './shell-frame.js';
5
+ export * from './shell-header.js';
6
+ export * from './shell-layout-utils.js';
7
+ export * from './shell-module-nav.js';
8
+ export * from './shell-panel-rail.js';
9
+ export * from './shell-route-utils.js';
10
+ export * from './shell-scrollable-content.js';
11
+ export * from './shell-state.js';
12
+ export * from './shell-tab-bar.js';
13
+ export * from './types.js';
14
+ export * from './utils.js';
15
+ export * from './workbench-layout.js';
@@ -1,15 +1,15 @@
1
- export * from './navigation-area';
2
- export * from './shell-app-rail';
3
- export * from './shell-desktop-panel-dock';
4
- export * from './shell-frame';
5
- export * from './shell-header';
6
- export * from './shell-layout-utils';
7
- export * from './shell-module-nav';
8
- export * from './shell-panel-rail';
9
- export * from './shell-route-utils';
10
- export * from './shell-scrollable-content';
11
- export * from './shell-state';
12
- export * from './shell-tab-bar';
13
- export * from './types';
14
- export * from './utils';
15
- export * from './workbench-layout';
1
+ export * from './navigation-area.js';
2
+ export * from './shell-app-rail.js';
3
+ export * from './shell-desktop-panel-dock.js';
4
+ export * from './shell-frame.js';
5
+ export * from './shell-header.js';
6
+ export * from './shell-layout-utils.js';
7
+ export * from './shell-module-nav.js';
8
+ export * from './shell-panel-rail.js';
9
+ export * from './shell-route-utils.js';
10
+ export * from './shell-scrollable-content.js';
11
+ export * from './shell-state.js';
12
+ export * from './shell-tab-bar.js';
13
+ export * from './types.js';
14
+ export * from './utils.js';
15
+ export * from './workbench-layout.js';
@@ -1,4 +1,2 @@
1
- export { NavigationArea, ShellAppRail, ShellDesktopPanelDock, ShellFrame, ShellHeaderFrame, ShellPanelToggle, ShellModuleNav, ShellPanelRail, ShellScrollableContent, ShellStateProvider, ShellTabBar, WorkbenchLayout, } from './index';
2
- export { buildShellSectionCommands, buildShellShortcutMap, getDefaultShellPanelView, getShellPanelCollection, getShellPanelView, getShellActionsFromMatches, getShellContentLayoutFromMatches, getShellContentMaxWidth, getShellPanelViewsFromMatches, getShellTabsFromMatches, getResolvedShellPanelWidth, isShellPanelViewAvailable, resolveShellPanelView, } from './index';
3
- export type { ShellCommandDefinition, ShellContentLayout, ShellHostAdapter, ShellModuleDefinition, ShellNavItem, ShellPanelDefinition, ShellRailItem, ShellRenderContext, ShellRouteContext, ShellSearchParamsAdapter, ShellStateContextValue, ShellTab, ShellViewDefinition, ShellViewportBand, } from './index';
4
- export { useShellState } from './index';
1
+ export type { ShellCommandDefinition, ShellContentLayout, ShellHostAdapter, ShellModuleDefinition, ShellNavItem, ShellPanelDefinition, ShellRailItem, ShellRenderContext, ShellRouteContext, ShellSearchParamsAdapter, ShellStateContextValue, ShellTab, ShellViewDefinition, ShellViewportBand, } from './index.js';
2
+ export { buildShellSectionCommands, buildShellShortcutMap, getDefaultShellPanelView, getResolvedShellPanelWidth, getShellActionsFromMatches, getShellContentLayoutFromMatches, getShellContentMaxWidth, getShellPanelCollection, getShellPanelView, getShellPanelViewsFromMatches, getShellTabsFromMatches, isShellPanelViewAvailable, NavigationArea, resolveShellPanelView, ShellAppRail, ShellDesktopPanelDock, ShellFrame, ShellHeaderFrame, ShellModuleNav, ShellPanelRail, ShellPanelToggle, ShellScrollableContent, ShellStateProvider, ShellTabBar, useShellState, WorkbenchLayout, } from './index.js';
@@ -1,3 +1 @@
1
- export { NavigationArea, ShellAppRail, ShellDesktopPanelDock, ShellFrame, ShellHeaderFrame, ShellPanelToggle, ShellModuleNav, ShellPanelRail, ShellScrollableContent, ShellStateProvider, ShellTabBar, WorkbenchLayout, } from './index';
2
- export { buildShellSectionCommands, buildShellShortcutMap, getDefaultShellPanelView, getShellPanelCollection, getShellPanelView, getShellActionsFromMatches, getShellContentLayoutFromMatches, getShellContentMaxWidth, getShellPanelViewsFromMatches, getShellTabsFromMatches, getResolvedShellPanelWidth, isShellPanelViewAvailable, resolveShellPanelView, } from './index';
3
- export { useShellState } from './index';
1
+ export { buildShellSectionCommands, buildShellShortcutMap, getDefaultShellPanelView, getResolvedShellPanelWidth, getShellActionsFromMatches, getShellContentLayoutFromMatches, getShellContentMaxWidth, getShellPanelCollection, getShellPanelView, getShellPanelViewsFromMatches, getShellTabsFromMatches, isShellPanelViewAvailable, NavigationArea, resolveShellPanelView, ShellAppRail, ShellDesktopPanelDock, ShellFrame, ShellHeaderFrame, ShellModuleNav, ShellPanelRail, ShellPanelToggle, ShellScrollableContent, ShellStateProvider, ShellTabBar, useShellState, WorkbenchLayout, } from './index.js';
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ShellRailItem } from './types';
2
+ import type { ShellRailItem } from './types.js';
3
3
  interface ShellAppRailRenderArgs {
4
4
  children: ReactNode;
5
5
  className: string;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { PanelRightClose, PanelRightOpen } from 'lucide-react';
3
3
  export function ShellHeaderFrame({ left, center, right, className, }) {
4
- return (_jsxs("header", { role: "banner", className: [
4
+ return (_jsxs("header", { className: [
5
5
  'relative z-[var(--z-sticky)] grid h-[var(--header-height)] w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 bg-[var(--header)] px-3 shadow-[var(--shadow-header)] sm:px-4',
6
6
  className,
7
7
  ]
@@ -1,4 +1,4 @@
1
- import type { ShellContentLayout, ShellViewportBand } from './types';
1
+ import type { ShellContentLayout, ShellViewportBand } from './types.js';
2
2
  export declare function getShellContentMaxWidth(layout: ShellContentLayout, viewportBand: ShellViewportBand): 1120 | 1280 | 1400 | 1440 | 1760 | 1920 | undefined;
3
3
  export declare function getResolvedShellPanelWidth({ preferredWidth, viewportWidth, sidebarOpen, sidebarWidth, }: {
4
4
  preferredWidth: number;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ShellModuleDefinition, ShellNavItem } from './types';
2
+ import type { ShellModuleDefinition, ShellNavItem } from './types.js';
3
3
  interface ShellModuleNavRenderArgs {
4
4
  children: ReactNode;
5
5
  className: string;
@@ -1,4 +1,4 @@
1
- import type { ShellPanelDefinition } from './types';
1
+ import type { ShellPanelDefinition } from './types.js';
2
2
  export interface ShellPanelRailProps {
3
3
  moduleViews: ShellPanelDefinition[];
4
4
  globalViews: ShellPanelDefinition[];
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ShellContentLayout, ShellTab } from './types';
2
+ import type { ShellContentLayout, ShellTab } from './types.js';
3
3
  interface ShellRouteMatchLike {
4
4
  handle?: unknown;
5
5
  params?: Record<string, string | undefined>;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ShellContentLayout } from './types';
2
+ import type { ShellContentLayout } from './types.js';
3
3
  export interface ShellScrollableContentProps {
4
4
  children: ReactNode;
5
5
  desktopDockOffset?: number;
@@ -10,7 +10,9 @@ export function clampSidePanelWidth(width) {
10
10
  function readStoredSidePanelWidth(storageKey) {
11
11
  if (typeof window === 'undefined')
12
12
  return DEFAULT_SIDE_PANEL_WIDTH;
13
- const storedValue = typeof window.localStorage?.getItem === 'function' ? window.localStorage.getItem(storageKey) : null;
13
+ const storedValue = typeof window.localStorage?.getItem === 'function'
14
+ ? window.localStorage.getItem(storageKey)
15
+ : null;
14
16
  const stored = Number(storedValue);
15
17
  return Number.isFinite(stored) && stored > 0
16
18
  ? clampSidePanelWidth(stored)
@@ -102,6 +104,7 @@ export function ShellStateProvider({ children, adapter, initialActiveRail = 'hom
102
104
  function closeCommandPalette() {
103
105
  setCommandPaletteOpen(false);
104
106
  }
107
+ // biome-ignore lint/correctness/useExhaustiveDependencies: inner setters/handlers are re-created each render; wrapping all of them in useCallback is a separate refactor — deps here are the observable state values only.
105
108
  const value = useMemo(() => ({
106
109
  activePanelView,
107
110
  lastPanelView: lastPanelViewRef.current,
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ShellTab } from './types';
2
+ import type { ShellTab } from './types.js';
3
3
  interface ShellTabBarRenderArgs {
4
4
  children: ReactNode;
5
5
  className: string;
@@ -20,7 +20,7 @@ export function ShellTabBar({ tabs, activeTab, onTabChange, className, ariaLabel
20
20
  });
21
21
  }) }));
22
22
  }
23
- return (_jsx("div", { "aria-label": ariaLabel, className: joinClasses(tabBarClassName, className), children: tabs.map((tab) => {
23
+ return (_jsx("nav", { "aria-label": ariaLabel, className: joinClasses(tabBarClassName, className), children: tabs.map((tab) => {
24
24
  const isActive = tab.id === activeTab;
25
25
  return (_jsx("button", { type: "button", "data-active": isActive, onClick: () => onTabChange?.(tab.id), className: joinClasses(tabClassName, isActive ? activeTabClassName : inactiveTabClassName), children: tab.label }, tab.id));
26
26
  }) }));
@@ -1,4 +1,4 @@
1
- import type { ShellCommandDefinition, ShellModuleDefinition, ShellPanelDefinition } from './types';
1
+ import type { ShellCommandDefinition, ShellModuleDefinition, ShellPanelDefinition } from './types.js';
2
2
  export interface ShellPanelCollection {
3
3
  globalViews: ShellPanelDefinition[];
4
4
  moduleViews: ShellPanelDefinition[];
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ShellViewportBand } from './types';
2
+ import type { ShellViewportBand } from './types.js';
3
3
  export interface WorkbenchLayoutProps {
4
4
  viewportBand: ShellViewportBand;
5
5
  main: ReactNode;
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "@medalsocial/meda",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Shared Meda UI shell and runtime package.",
5
5
  "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Medal-Social/meda.git"
9
+ },
10
+ "homepage": "https://github.com/Medal-Social/meda#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/Medal-Social/meda/issues"
13
+ },
6
14
  "type": "module",
7
15
  "main": "./dist/index.js",
8
16
  "types": "./dist/index.d.ts",
9
- "packageManager": "pnpm@10.28.0",
10
17
  "files": [
11
18
  "README.md",
12
19
  "components.json",
@@ -23,14 +30,8 @@
23
30
  },
24
31
  "./styles.css": "./dist/styles.css"
25
32
  },
26
- "scripts": {
27
- "build": "pnpm exec tsc -p tsconfig.build.json && node ./scripts/build.mjs",
28
- "prepack": "pnpm build",
29
- "test": "vitest run --environment jsdom",
30
- "test:run": "vitest run --environment jsdom",
31
- "typecheck": "tsc --noEmit",
32
- "version": "changeset version",
33
- "release": "pnpm build && pnpm publish --access public --no-git-checks"
33
+ "publishConfig": {
34
+ "access": "public"
34
35
  },
35
36
  "peerDependencies": {
36
37
  "react": ">=19",
@@ -49,14 +50,34 @@
49
50
  "vaul": "^1.1.2"
50
51
  },
51
52
  "devDependencies": {
53
+ "@biomejs/biome": "^2.4.12",
52
54
  "@changesets/changelog-github": "^0.5.1",
53
55
  "@changesets/cli": "^2.29.0",
54
56
  "@testing-library/jest-dom": "^6.9.1",
55
57
  "@testing-library/react": "^16.3.2",
56
58
  "@types/react": "^19.2.14",
57
59
  "@types/react-dom": "^19.2.3",
60
+ "@vitejs/plugin-react": "^6.0.1",
61
+ "husky": "^9.1.7",
58
62
  "jsdom": "^29.0.2",
63
+ "react": "^19.2.4",
64
+ "react-dom": "^19.2.4",
59
65
  "typescript": "~6.0.2",
66
+ "vite": "^8.0.4",
60
67
  "vitest": "^4.1.4"
68
+ },
69
+ "scripts": {
70
+ "build": "pnpm exec tsc -p tsconfig.build.json && node ./scripts/build.mjs",
71
+ "lint": "biome check .",
72
+ "lint:fix": "biome check --write .",
73
+ "format": "biome format --write .",
74
+ "demo:dev": "vite --config vite.config.demo.ts",
75
+ "demo:build": "vite build --config vite.config.demo.ts",
76
+ "test": "vitest run --environment jsdom",
77
+ "test:run": "vitest run --environment jsdom",
78
+ "typecheck": "tsc --noEmit",
79
+ "version": "changeset version",
80
+ "release": "pnpm build && pnpm publish --access public --no-git-checks",
81
+ "registry:validate": "node ./registry/scripts/validate-registry.mjs"
61
82
  }
62
- }
83
+ }