@starci/grammar 0.16.5 → 0.17.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.
Files changed (51) hide show
  1. package/README.md +42 -2
  2. package/dist/.build-stamp.json +4 -4
  3. package/dist/common/registry.d.ts +2 -1
  4. package/dist/common/registry.d.ts.map +1 -1
  5. package/dist/common/registry.js +2 -2
  6. package/dist/common/registry.js.map +1 -1
  7. package/dist/common/renderers.d.ts +3 -2
  8. package/dist/common/renderers.d.ts.map +1 -1
  9. package/dist/common/renderers.js +1 -0
  10. package/dist/common/renderers.js.map +1 -1
  11. package/dist/common/styles.css +154 -4
  12. package/dist/core/branch/ListBox/index.d.ts.map +1 -1
  13. package/dist/core/branch/ListBox/index.js +4 -2
  14. package/dist/core/branch/ListBox/index.js.map +1 -1
  15. package/dist/core/branch/Tabs/index.d.ts.map +1 -1
  16. package/dist/core/branch/Tabs/index.js +3 -1
  17. package/dist/core/branch/Tabs/index.js.map +1 -1
  18. package/dist/core/composite/FillViewport/index.d.ts +2 -6
  19. package/dist/core/composite/FillViewport/index.d.ts.map +1 -1
  20. package/dist/core/composite/FillViewport/index.js +3 -41
  21. package/dist/core/composite/FillViewport/index.js.map +1 -1
  22. package/dist/core/composite/FillViewport/useFillMeasure.d.ts +13 -0
  23. package/dist/core/composite/FillViewport/useFillMeasure.d.ts.map +1 -0
  24. package/dist/core/composite/FillViewport/useFillMeasure.js +51 -0
  25. package/dist/core/composite/FillViewport/useFillMeasure.js.map +1 -0
  26. package/dist/core/composition/Page/PanesFill.d.ts +11 -0
  27. package/dist/core/composition/Page/PanesFill.d.ts.map +1 -0
  28. package/dist/core/composition/Page/PanesFill.js +12 -0
  29. package/dist/core/composition/Page/PanesFill.js.map +1 -0
  30. package/dist/core/composition/Page/index.d.ts +19 -4
  31. package/dist/core/composition/Page/index.d.ts.map +1 -1
  32. package/dist/core/composition/Page/index.js +9 -2
  33. package/dist/core/composition/Page/index.js.map +1 -1
  34. package/dist/core/composition/PaneGrid/index.d.ts +12 -4
  35. package/dist/core/composition/PaneGrid/index.d.ts.map +1 -1
  36. package/dist/core/composition/PaneGrid/index.js +62 -11
  37. package/dist/core/composition/PaneGrid/index.js.map +1 -1
  38. package/dist/core/composition/PaneGrid/layout.d.ts +2 -0
  39. package/dist/core/composition/PaneGrid/layout.d.ts.map +1 -1
  40. package/dist/core/composition/PaneGrid/layout.js +5 -3
  41. package/dist/core/composition/PaneGrid/layout.js.map +1 -1
  42. package/dist/core/composition/PaneSection/index.d.ts +28 -0
  43. package/dist/core/composition/PaneSection/index.d.ts.map +1 -0
  44. package/dist/core/composition/PaneSection/index.js +31 -0
  45. package/dist/core/composition/PaneSection/index.js.map +1 -0
  46. package/dist/core/paneContext.d.ts +12 -0
  47. package/dist/core/paneContext.d.ts.map +1 -0
  48. package/dist/core/paneContext.js +6 -0
  49. package/dist/core/paneContext.js.map +1 -0
  50. package/dist/core/styles.css +1 -1
  51. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ import { type ReactNode, type Ref } from "react";
2
+ export type PaneSectionProps = {
3
+ readonly children: ReactNode;
4
+ /** Takes the remaining block size of the pane (min-height 0). */
5
+ readonly grow?: boolean;
6
+ /** Its own vertical scroll owner (OVERFLOW-4/5) with the inset inside the scroller. Implies grow. */
7
+ readonly scroll?: {
8
+ readonly label: string;
9
+ readonly role?: "log" | "region";
10
+ readonly tone?: "surface" | "background";
11
+ readonly scrollRef?: Ref<HTMLDivElement>;
12
+ };
13
+ /** Head band centred in a shared grid row. Default `start`. */
14
+ readonly align?: "start" | "center";
15
+ /** `inline`: the one horizontal scroller in it reaches both pane edges and takes the inset as scroll padding. */
16
+ readonly bleed?: "inline";
17
+ /** Gap between its own children. Default `row`. */
18
+ readonly gap?: "inline" | "row" | "section";
19
+ readonly as?: "div" | "header" | "footer";
20
+ };
21
+ /**
22
+ * One band of a Pane: it pads inline by the pane's inset, the sections of a pane stack with the row gap between them,
23
+ * the first takes the pane's block-start inset and the last its block-end inset. With `scroll` the band is its own
24
+ * full-bleed scroll owner and the inset sits on its content, so the scrollbar stays on the pane edge. A section outside
25
+ * a Pane throws `PANE_SECTION_OUTSIDE_PANE`.
26
+ */
27
+ export declare const PaneSection: ({ children, grow, scroll, align, bleed, gap, as }: PaneSectionProps) => import("react").JSX.Element;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composition/PaneSection/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAA;AAI1E,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,qGAAqG;IACrG,QAAQ,CAAC,MAAM,CAAC,EAAE;QACd,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;QAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,YAAY,CAAA;QACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;KAC3C,CAAA;IACD,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACnC,iHAAiH;IACjH,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAA;IACzB,mDAAmD;IACnD,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAA;IAC3C,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAC5C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,mDAAqF,gBAAgB,gCA8BhI,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createElement, useEffect } from "react";
4
+ import { VerticalScrollRegion } from "../../composite/VerticalScrollRegion/index.js";
5
+ import { usePaneContext } from "../../paneContext.js";
6
+ /**
7
+ * One band of a Pane: it pads inline by the pane's inset, the sections of a pane stack with the row gap between them,
8
+ * the first takes the pane's block-start inset and the last its block-end inset. With `scroll` the band is its own
9
+ * full-bleed scroll owner and the inset sits on its content, so the scrollbar stays on the pane edge. A section outside
10
+ * a Pane throws `PANE_SECTION_OUTSIDE_PANE`.
11
+ */
12
+ export const PaneSection = ({ children, grow = false, scroll, align = "start", bleed, gap = "row", as = "div" }) => {
13
+ const pane = usePaneContext();
14
+ useEffect(() => pane?.register(), [pane]);
15
+ if (pane === undefined)
16
+ throw new Error("PANE_SECTION_OUTSIDE_PANE");
17
+ const shared = {
18
+ "data-component": "PaneSection",
19
+ "data-tier": "composition",
20
+ "data-grammar-pane-section-align": align,
21
+ "data-grammar-pane-section-gap": gap,
22
+ "data-grammar-pane-section-bleed": bleed,
23
+ "data-grammar-pane-section-grow": grow || scroll !== undefined ? "true" : undefined,
24
+ };
25
+ const contract = "PADDING-4 GAP-3";
26
+ if (scroll === undefined) {
27
+ return createElement(as, { ...shared, className: "starci-core-pane-section", "data-contract": contract }, children);
28
+ }
29
+ return (_jsx(VerticalScrollRegion, { ...shared, "aria-label": scroll.label, className: "starci-core-pane-section", "data-grammar-pane-section-scroll": "true", isScrollable: true, ...(scroll.role === undefined ? {} : { role: scroll.role }), ...(scroll.tone === undefined ? {} : { tone: scroll.tone }), ...(scroll.scrollRef === undefined ? {} : { ref: scroll.scrollRef }), children: createElement(as, { className: "starci-core-pane-section-content", "data-contract": contract }, children) }));
30
+ };
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composition/PaneSection/index.tsx"],"names":[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C,YAAY,WACR,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,KACxD,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,KACxD,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,YAEpE,aAAa,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,kCAAkC,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,GACvF,CAC1B,CAAA;AACL,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ /** What a Pane gives its descendants: `content` publishes the Grammar pane inset to its PaneSections, `flush` publishes none. */
2
+ export type PaneInset = "content" | "flush";
3
+ export type PaneContextValue = {
4
+ readonly area: string;
5
+ readonly inset: PaneInset;
6
+ /** A PaneSection or nested PaneGrid announces itself on mount; the returned function withdraws it. */
7
+ readonly register: () => () => void;
8
+ };
9
+ /** Internal to the composition tier: not exported from the public entries. */
10
+ export declare const PaneContext: import("react").Context<PaneContextValue | undefined>;
11
+ export declare const usePaneContext: () => PaneContextValue | undefined;
12
+ //# sourceMappingURL=paneContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paneContext.d.ts","sourceRoot":"","sources":["../../src/core/paneContext.tsx"],"names":[],"mappings":"AAIA,iIAAiI;AACjI,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AAE3C,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,sGAAsG;IACtG,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,IAAI,CAAA;CACtC,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,uDAAyD,CAAA;AAEjF,eAAO,MAAM,cAAc,QAAO,gBAAgB,GAAG,SAAoC,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ /** Internal to the composition tier: not exported from the public entries. */
4
+ export const PaneContext = createContext(undefined);
5
+ export const usePaneContext = () => useContext(PaneContext);
6
+ //# sourceMappingURL=paneContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paneContext.js","sourceRoot":"","sources":["../../src/core/paneContext.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAYjD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAA;AAEjF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAiC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA"}
@@ -149,7 +149,7 @@
149
149
  .grammar-common-root[data-grammar-family="core"]
150
150
  .starci-core-surface-card[data-grammar-surface-labelled="true"][data-grammar-surface-placement="panel"][data-grammar-frame="bounded"]
151
151
  > [data-grammar-surface-label] {
152
- --starci-core-surface-label-padding: var(--starci-core-surface-inset, 1rem) var(--starci-core-surface-inset, 1rem) 0;
152
+ --starci-core-surface-label-padding: var(--grammar-card-padding-block, 1rem) var(--grammar-card-padding-inline, 1rem) 0;
153
153
  }
154
154
 
155
155
  .grammar-common-root[data-grammar-family="core"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/grammar",
3
- "version": "0.16.5",
3
+ "version": "0.17.1",
4
4
  "description": "Reusable StarCi React components, compositions, and packaged visual DNA.",
5
5
  "keywords": [
6
6
  "starci",