@threadlabs/looma 0.44.1 → 0.44.2

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/docs/README.md CHANGED
@@ -87,6 +87,16 @@ the `packageName` you configure below. That is package attribution, not the
87
87
  name of your design system. Shared CSS and recipe filenames are configured
88
88
  under `theme`; changing a site title does not require renaming those files.
89
89
 
90
+ A navigation link with `"position": "start"` appears before the generated component and
91
+ editor sections. Other links keep their order after those sections:
92
+
93
+ ```json
94
+ { "nav": [{ "label": "Get started", "href": "/getting-started/", "position": "start" }] }
95
+ ```
96
+
97
+ For documentation-site Markdown syntax and publishing options, see the
98
+ [Markupress documentation](https://threadlabs-studio.github.io/markupress/).
99
+
90
100
  ## Change the rule, keep the family consistent
91
101
 
92
102
  The authoring model groups shared decisions as Colour, Type, Size & spacing, Material and Motion. The controls expose shared intent: control roominess relative to text, rhythm, spacing, corners, inner and outer depth, and response pace.
package/docs/catalog.json CHANGED
@@ -463,7 +463,7 @@
463
463
  ],
464
464
  "schemaVersion": 1,
465
465
  "package": "@threadlabs/looma",
466
- "version": "0.44.1",
466
+ "version": "0.44.2",
467
467
  "groups": [
468
468
  {
469
469
  "id": "layout",
@@ -8399,6 +8399,9 @@
8399
8399
  {
8400
8400
  "name": "--ui-space-3"
8401
8401
  },
8402
+ {
8403
+ "name": "--ui-space-4"
8404
+ },
8402
8405
  {
8403
8406
  "name": "--ui-text-primary"
8404
8407
  },
@@ -8666,8 +8669,9 @@
8666
8669
  "name": "03-named-group",
8667
8670
  "title": "Named group and rich summary",
8668
8671
  "description": "Disclosures with the same name allow one open item; a summary slot can include emphasis or a count.",
8669
- "markup": "<ui-disclosure name=\"questions\" summary=\"Account\" heading-level=\"3\">\n <strong slot=\"summary\">Account <small>2 topics</small></strong>\n <p>Account settings and access.</p>\n</ui-disclosure>\n<ui-disclosure name=\"questions\" summary=\"Billing\" heading-level=\"3\">\n <p>Billing methods and invoices.</p>\n</ui-disclosure>",
8672
+ "markup": "<ui-stack gap=\"none\">\n <ui-disclosure name=\"questions\" summary=\"Account\" heading-level=\"3\">\n <strong slot=\"summary\">Account <small>2 topics</small></strong>\n <ui-text>Account settings and access.</ui-text>\n </ui-disclosure>\n <ui-disclosure name=\"questions\" summary=\"Billing\" heading-level=\"3\">\n <ui-text>Billing methods and invoices.</ui-text>\n </ui-disclosure>\n</ui-stack>",
8670
8673
  "resizable": false,
8674
+ "stretch": true,
8671
8675
  "bindings": "",
8672
8676
  "frameworks": {}
8673
8677
  }
package/docs/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface ThemeRecipe { schemaVersion: 1; values: Record<string, string>;
21
21
  export interface ThemeField { family: string; id: string; label: string; property: string | null; type: string; defaultValue: string; description: string; min?: number; max?: number; choices?: Record<string, string> }
22
22
  export interface DocumentationConfiguration {
23
23
  title?: string; base?: string; origin?: string; outDir?: string; content?: string;
24
- logo?: string | { light: string; dark?: string }; nav?: { label: string; href: string }[];
24
+ logo?: string | { light: string; dark?: string }; nav?: { label: string; href: string; position?: 'start' }[];
25
25
  components?: DiscoveryRoot[]; catalogs?: string[]; categories?: Record<string, string>;
26
26
  theme?: { recipe?: string; css?: string }; overrides?: string[];
27
27
  recipe?: ThemeRecipe;
@@ -0,0 +1,26 @@
1
+ /** Place explicitly leading links before Markupress's generated sections in server-rendered order. */
2
+ export function orderNavigation(options, { nav = [], base }) {
3
+ const order = new Map(nav.filter(entry => entry.position === 'start').map((entry, index) => [entry.href, index]));
4
+ const rank = entry => {
5
+ const href = entry.href.startsWith(base) ? '/' + entry.href.slice(base.length).replace(/^v\/[^/]+\//, '') : entry.href;
6
+ return order.get(href) ?? order.size;
7
+ };
8
+ const layout = layer => {
9
+ if (!layer?.server?.load) return layer;
10
+ const load = layer.server.load;
11
+ return { ...layer, server: { ...layer.server, async load(context) {
12
+ const result = await load(context);
13
+ const shell = result.data?.markupress;
14
+ if (!shell?.nav) return result;
15
+ const links = [...shell.nav].sort((left, right) => rank(left) - rank(right));
16
+ return { ...result,
17
+ props: { ...result.props, ...('nav' in (result.props ?? {}) ? { nav: links } : {}) },
18
+ data: { ...result.data, markupress: { ...shell, nav: links } },
19
+ };
20
+ } } };
21
+ };
22
+ return { ...options,
23
+ ...(options.pages ? { pages: options.pages.map(page => ({ ...page, layout: layout(page.layout) })) } : {}),
24
+ ...(options.layouts ? { layouts: Object.fromEntries(Object.entries(options.layouts).map(([name, layer]) => [name, layout(layer)])) } : {}),
25
+ };
26
+ }
package/docs/site.mjs CHANGED
@@ -10,6 +10,7 @@ import { customizerResource } from './customizer-render.mjs';
10
10
  import { catalogResource } from './catalog-view.mjs';
11
11
  import { cacheDirectory, rejectSymlink, withBuildLock } from './workspace.mjs';
12
12
  import { googleFontURL } from './fonts.mjs';
13
+ import { orderNavigation } from './navigation.mjs';
13
14
 
14
15
  const own = name => fileURLToPath(new URL(name, import.meta.url));
15
16
  /** Resolve import-only optional tooling peers in the consumer's ESM package scope. */
@@ -194,7 +195,10 @@ export async function documentationOptions(site) {
194
195
  const savedCSS = (site.config.themeCSSContents ?? themeCSS(recipe)).replace(`@import url("${imported}");`, remaining ? `@import url("${remaining}");` : '');
195
196
  await writeFile(savedTheme, savedCSS);
196
197
  const themeStyles = [savedTheme, ...await portableThemeStyles(site)];
197
- return { ...options, plugins: [...options.plugins, { name: 'looma-saved-theme', config: () => ({ css: themeStyles }) },
198
+ const plugins = options.plugins.map(plugin => plugin.name === 'markupress' ? { ...plugin,
199
+ config: async current => orderNavigation(await plugin.config(current), { nav: site.config.nav, base: site.base }),
200
+ } : plugin);
201
+ return { ...options, plugins: [...plugins, { name: 'looma-saved-theme', config: () => ({ css: themeStyles }) },
198
202
  // Markupress supplies its head script in its own config hook; compose after it.
199
203
  { name: 'looma-browser-theme', config: async current => ({ headScript: [current.headScript, await themeBootstrap(site)].filter(Boolean).join('\n;\n') }) }] };
200
204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.44.1",
3
+ "version": "0.44.2",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -112,7 +112,7 @@
112
112
  grid-template-rows: 1fr;
113
113
  }
114
114
  :scope:where([data-component~="ui-disclosure"])[data-ui-disclosure-state~="internalOpen"] .panel-inner {
115
- padding-block: 0 var(--ui-space-3) !important;
115
+ padding-block: var(--ui-space-4) !important;
116
116
  }
117
117
 
118
118
  /* A bounded accordion owns one flexible body, so its trigger never scrolls away. The
@@ -522,7 +522,7 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
522
522
  }
523
523
  :global(:scope[data-ui-disclosure-state~="internalOpen"]
524
524
  .panel-inner:where([data-hn-ui-disclosure])) {
525
- padding-block: 0 var(--ui-space-3) !important;
525
+ padding-block: var(--ui-space-4) !important;
526
526
  }
527
527
  :global(:scope[data-ui-disclosure-state~="fill"]:where([data-hn-ui-disclosure])) {
528
528
  display: flex !important;
@@ -398,6 +398,6 @@ var UiDisclosure_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
398
398
  }]]);
399
399
  };
400
400
  }
401
- }), [["__scopeId", "data-v-602000cf"]]);
401
+ }), [["__scopeId", "data-v-c67a3c7f"]]);
402
402
  //#endregion
403
403
  export { UiDisclosure_default as t };
@@ -4857,7 +4857,7 @@ footer:empty:where(:scope, :scope *):where([data-hn-ui-dialog]) {
4857
4857
  }
4858
4858
  :scope[data-ui-disclosure-state~="internalOpen"]
4859
4859
  .panel-inner:where([data-hn-ui-disclosure]) {
4860
- padding-block: 0 var(--ui-space-3) !important;
4860
+ padding-block: var(--ui-space-4) !important;
4861
4861
  }
4862
4862
  :scope[data-ui-disclosure-state~="fill"]:where([data-hn-ui-disclosure]) {
4863
4863
  display: flex !important;
@@ -15826,7 +15826,7 @@ html[data-ui-input-modality="touch"]
15826
15826
  grid-template-rows: 1fr;
15827
15827
  }
15828
15828
  :scope:where([data-component~="ui-disclosure"])[data-ui-disclosure-state~="internalOpen"] .panel-inner {
15829
- padding-block: 0 var(--ui-space-3) !important;
15829
+ padding-block: var(--ui-space-4) !important;
15830
15830
  }
15831
15831
 
15832
15832
  /* A bounded accordion owns one flexible body, so its trigger never scrolls away. The