@sankhyatronics/sankhya-cms 0.0.0-stage → 0.0.9

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 (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -3
  3. package/custom-elements.json +4008 -0
  4. package/dist/bento-grid/index.d.ts +27 -0
  5. package/dist/bento-grid/index.js +10 -0
  6. package/dist/bento-grid/index.js.map +1 -0
  7. package/dist/card/index.d.ts +20 -0
  8. package/dist/card/index.js +9 -0
  9. package/dist/card/index.js.map +1 -0
  10. package/dist/carousel/index.d.ts +44 -0
  11. package/dist/carousel/index.js +10 -0
  12. package/dist/carousel/index.js.map +1 -0
  13. package/dist/chunk-23IHTBAB.js +557 -0
  14. package/dist/chunk-23IHTBAB.js.map +1 -0
  15. package/dist/chunk-2VZFHTBC.js +203 -0
  16. package/dist/chunk-2VZFHTBC.js.map +1 -0
  17. package/dist/chunk-3ERKQNZT.js +155 -0
  18. package/dist/chunk-3ERKQNZT.js.map +1 -0
  19. package/dist/chunk-3JU3R22O.js +193 -0
  20. package/dist/chunk-3JU3R22O.js.map +1 -0
  21. package/dist/chunk-3TCP25JG.js +347 -0
  22. package/dist/chunk-3TCP25JG.js.map +1 -0
  23. package/dist/chunk-3VE6VFJ4.js +87 -0
  24. package/dist/chunk-3VE6VFJ4.js.map +1 -0
  25. package/dist/chunk-4HKSA5UT.js +312 -0
  26. package/dist/chunk-4HKSA5UT.js.map +1 -0
  27. package/dist/chunk-5REZSZCK.js +266 -0
  28. package/dist/chunk-5REZSZCK.js.map +1 -0
  29. package/dist/chunk-5UFRGZWG.js +268 -0
  30. package/dist/chunk-5UFRGZWG.js.map +1 -0
  31. package/dist/chunk-74MILER4.js +215 -0
  32. package/dist/chunk-74MILER4.js.map +1 -0
  33. package/dist/chunk-7PSYCTEN.js +118 -0
  34. package/dist/chunk-7PSYCTEN.js.map +1 -0
  35. package/dist/chunk-E52WO7R7.js +279 -0
  36. package/dist/chunk-E52WO7R7.js.map +1 -0
  37. package/dist/chunk-EUXUH3YW.js +15 -0
  38. package/dist/chunk-EUXUH3YW.js.map +1 -0
  39. package/dist/chunk-IMACP7HN.js +156 -0
  40. package/dist/chunk-IMACP7HN.js.map +1 -0
  41. package/dist/chunk-LHU23TF6.js +273 -0
  42. package/dist/chunk-LHU23TF6.js.map +1 -0
  43. package/dist/chunk-OEX5FDMR.js +250 -0
  44. package/dist/chunk-OEX5FDMR.js.map +1 -0
  45. package/dist/chunk-RHAOQ6K4.js +138 -0
  46. package/dist/chunk-RHAOQ6K4.js.map +1 -0
  47. package/dist/chunk-RMIJVTFS.js +397 -0
  48. package/dist/chunk-RMIJVTFS.js.map +1 -0
  49. package/dist/chunk-TIU73O7I.js +221 -0
  50. package/dist/chunk-TIU73O7I.js.map +1 -0
  51. package/dist/chunk-USNFT4DU.js +125 -0
  52. package/dist/chunk-USNFT4DU.js.map +1 -0
  53. package/dist/chunk-VYON56QO.js +90 -0
  54. package/dist/chunk-VYON56QO.js.map +1 -0
  55. package/dist/chunk-WCO7JAIK.js +195 -0
  56. package/dist/chunk-WCO7JAIK.js.map +1 -0
  57. package/dist/chunk-XHBC23TV.js +254 -0
  58. package/dist/chunk-XHBC23TV.js.map +1 -0
  59. package/dist/chunk-XXPBFHWR.js +70 -0
  60. package/dist/chunk-XXPBFHWR.js.map +1 -0
  61. package/dist/chunk-YYK4GQUW.js +299 -0
  62. package/dist/chunk-YYK4GQUW.js.map +1 -0
  63. package/dist/cms-theme.css +15 -0
  64. package/dist/content-block/index.d.ts +25 -0
  65. package/dist/content-block/index.js +11 -0
  66. package/dist/content-block/index.js.map +1 -0
  67. package/dist/cookie-consent/index.d.ts +33 -0
  68. package/dist/cookie-consent/index.js +9 -0
  69. package/dist/cookie-consent/index.js.map +1 -0
  70. package/dist/dropdown/index.d.ts +89 -0
  71. package/dist/dropdown/index.js +9 -0
  72. package/dist/dropdown/index.js.map +1 -0
  73. package/dist/feature-split/index.d.ts +38 -0
  74. package/dist/feature-split/index.js +11 -0
  75. package/dist/feature-split/index.js.map +1 -0
  76. package/dist/features-section/index.d.ts +50 -0
  77. package/dist/features-section/index.js +14 -0
  78. package/dist/features-section/index.js.map +1 -0
  79. package/dist/footer/index.d.ts +64 -0
  80. package/dist/footer/index.js +9 -0
  81. package/dist/footer/index.js.map +1 -0
  82. package/dist/header/index.d.ts +112 -0
  83. package/dist/header/index.js +10 -0
  84. package/dist/header/index.js.map +1 -0
  85. package/dist/hero/index.d.ts +32 -0
  86. package/dist/hero/index.js +10 -0
  87. package/dist/hero/index.js.map +1 -0
  88. package/dist/icon-button/index.d.ts +23 -0
  89. package/dist/icon-button/index.js +9 -0
  90. package/dist/icon-button/index.js.map +1 -0
  91. package/dist/index.d.ts +22 -0
  92. package/dist/index.js +93 -0
  93. package/dist/index.js.map +1 -0
  94. package/dist/items-accordion/index.d.ts +31 -0
  95. package/dist/items-accordion/index.js +10 -0
  96. package/dist/items-accordion/index.js.map +1 -0
  97. package/dist/markdown/index.d.ts +33 -0
  98. package/dist/markdown/index.js +9 -0
  99. package/dist/markdown/index.js.map +1 -0
  100. package/dist/menu-grid/index.d.ts +21 -0
  101. package/dist/menu-grid/index.js +9 -0
  102. package/dist/menu-grid/index.js.map +1 -0
  103. package/dist/menu-grid-item/index.d.ts +53 -0
  104. package/dist/menu-grid-item/index.js +9 -0
  105. package/dist/menu-grid-item/index.js.map +1 -0
  106. package/dist/menu-item/index.d.ts +50 -0
  107. package/dist/menu-item/index.js +9 -0
  108. package/dist/menu-item/index.js.map +1 -0
  109. package/dist/promo-banner/index.d.ts +22 -0
  110. package/dist/promo-banner/index.js +10 -0
  111. package/dist/promo-banner/index.js.map +1 -0
  112. package/dist/schema/index.d.ts +72 -0
  113. package/dist/schema/index.js +75 -0
  114. package/dist/schema/index.js.map +1 -0
  115. package/dist/select/index.d.ts +77 -0
  116. package/dist/select/index.js +10 -0
  117. package/dist/select/index.js.map +1 -0
  118. package/dist/shared/icons.d.ts +77 -0
  119. package/dist/shared/icons.js +64 -0
  120. package/dist/shared/icons.js.map +1 -0
  121. package/dist/shared/styles.d.ts +90 -0
  122. package/dist/shared/styles.js +48 -0
  123. package/dist/shared/styles.js.map +1 -0
  124. package/dist/stats/index.d.ts +17 -0
  125. package/dist/stats/index.js +9 -0
  126. package/dist/stats/index.js.map +1 -0
  127. package/dist/testimonials/index.d.ts +25 -0
  128. package/dist/testimonials/index.js +10 -0
  129. package/dist/testimonials/index.js.map +1 -0
  130. package/dist/theme.css +292 -0
  131. package/dist/themes.css +65 -0
  132. package/dist/theming/index.d.ts +28 -0
  133. package/dist/theming/index.js +53 -0
  134. package/dist/theming/index.js.map +1 -0
  135. package/package.json +160 -3
package/dist/index.js ADDED
@@ -0,0 +1,93 @@
1
+ import {
2
+ Testimonials
3
+ } from "./chunk-WCO7JAIK.js";
4
+ import {
5
+ MenuGridItem
6
+ } from "./chunk-4HKSA5UT.js";
7
+ import {
8
+ MenuItem
9
+ } from "./chunk-LHU23TF6.js";
10
+ import {
11
+ PromoBanner
12
+ } from "./chunk-3ERKQNZT.js";
13
+ import {
14
+ Select
15
+ } from "./chunk-5UFRGZWG.js";
16
+ import {
17
+ Stats
18
+ } from "./chunk-USNFT4DU.js";
19
+ import {
20
+ FeatureItem,
21
+ FeaturesSection
22
+ } from "./chunk-E52WO7R7.js";
23
+ import {
24
+ Footer
25
+ } from "./chunk-YYK4GQUW.js";
26
+ import {
27
+ Header
28
+ } from "./chunk-23IHTBAB.js";
29
+ import "./chunk-3TCP25JG.js";
30
+ import {
31
+ Hero
32
+ } from "./chunk-TIU73O7I.js";
33
+ import {
34
+ IconButton
35
+ } from "./chunk-XXPBFHWR.js";
36
+ import {
37
+ ItemsAccordion
38
+ } from "./chunk-74MILER4.js";
39
+ import {
40
+ MenuGrid
41
+ } from "./chunk-VYON56QO.js";
42
+ import {
43
+ BentoGrid
44
+ } from "./chunk-OEX5FDMR.js";
45
+ import {
46
+ Card
47
+ } from "./chunk-7PSYCTEN.js";
48
+ import {
49
+ Carousel
50
+ } from "./chunk-XHBC23TV.js";
51
+ import {
52
+ ContentBlock
53
+ } from "./chunk-IMACP7HN.js";
54
+ import {
55
+ CookieConsent
56
+ } from "./chunk-2VZFHTBC.js";
57
+ import {
58
+ Dropdown
59
+ } from "./chunk-RMIJVTFS.js";
60
+ import {
61
+ FeatureSplit
62
+ } from "./chunk-5REZSZCK.js";
63
+ import {
64
+ Markdown
65
+ } from "./chunk-3JU3R22O.js";
66
+ import "./chunk-3VE6VFJ4.js";
67
+ import "./chunk-RHAOQ6K4.js";
68
+ import "./chunk-EUXUH3YW.js";
69
+ export {
70
+ BentoGrid,
71
+ Card,
72
+ Carousel,
73
+ ContentBlock,
74
+ CookieConsent,
75
+ Dropdown,
76
+ FeatureItem,
77
+ FeatureSplit,
78
+ FeaturesSection,
79
+ Footer,
80
+ Header,
81
+ Hero,
82
+ IconButton,
83
+ ItemsAccordion,
84
+ Markdown,
85
+ MenuGrid,
86
+ MenuGridItem,
87
+ MenuItem,
88
+ PromoBanner,
89
+ Select,
90
+ Stats,
91
+ Testimonials
92
+ };
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,31 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+
4
+ interface AccordionItem {
5
+ id: string;
6
+ title: string;
7
+ content: string;
8
+ }
9
+ /** A vertical list of collapsible title/content rows; one open at a time unless `allow-multiple`. */
10
+ declare class ItemsAccordion extends LitElement {
11
+ static styles: lit.CSSResult;
12
+ title: string;
13
+ subtitle: string;
14
+ items: AccordionItem[];
15
+ allowMultiple: boolean;
16
+ private openIds;
17
+ private toggle;
18
+ render(): lit.TemplateResult<1>;
19
+ }
20
+
21
+ interface AccordionToggleEventDetail {
22
+ id: string;
23
+ open: boolean;
24
+ }
25
+ declare global {
26
+ interface HTMLElementEventMap {
27
+ 'accordion-toggle': CustomEvent<AccordionToggleEventDetail>;
28
+ }
29
+ }
30
+
31
+ export { type AccordionItem, type AccordionToggleEventDetail, ItemsAccordion };
@@ -0,0 +1,10 @@
1
+ import {
2
+ ItemsAccordion
3
+ } from "../chunk-74MILER4.js";
4
+ import "../chunk-3VE6VFJ4.js";
5
+ import "../chunk-RHAOQ6K4.js";
6
+ import "../chunk-EUXUH3YW.js";
7
+ export {
8
+ ItemsAccordion
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,33 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement, nothing } from 'lit';
3
+
4
+ /**
5
+ * Renders Markdown (GFM, single newlines become `<br>`) from either an inline `content` string or
6
+ * a `src` URL it fetches. Ports `SankhyaUI`'s `useMarkdown` hook + `react-markdown` (remark-gfm,
7
+ * remark-breaks); output is sanitized with DOMPurify. `src` wins over `content` when both are set.
8
+ * While a fetch is pending it shows "Loading content..."; on failure "Error loading content." and
9
+ * a `markdown-error` event (detail: `{ error }`).
10
+ *
11
+ * Text color is inherited from the parent so inverted containers just work.
12
+ */
13
+ declare class Markdown extends LitElement {
14
+ static styles: lit.CSSResult;
15
+ /** Inline Markdown source. Ignored when `src` is set. */
16
+ content: string;
17
+ /** URL of a Markdown file to fetch. */
18
+ src: string;
19
+ private fetched;
20
+ private loading;
21
+ private error;
22
+ private abort?;
23
+ willUpdate(changed: Map<string, unknown>): void;
24
+ disconnectedCallback(): void;
25
+ private load;
26
+ render(): lit.TemplateResult<1> | typeof nothing;
27
+ }
28
+
29
+ interface MarkdownErrorEventDetail {
30
+ error: Error;
31
+ }
32
+
33
+ export { Markdown, type MarkdownErrorEventDetail };
@@ -0,0 +1,9 @@
1
+ import {
2
+ Markdown
3
+ } from "../chunk-3JU3R22O.js";
4
+ import "../chunk-RHAOQ6K4.js";
5
+ import "../chunk-EUXUH3YW.js";
6
+ export {
7
+ Markdown
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,21 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+
4
+ /**
5
+ * A responsive grid of `st-menu-grid-item`s — the "rich" nav-menu layout (icon + title +
6
+ * description per entry, arranged in columns), typically slotted into `st-dropdown`'s default
7
+ * slot. A 1:1 port of `SankhyaUI`'s React `MenuGrid` (`SankhyaCMS/SankhyaUI/src/components/Menu`):
8
+ * same markup (`.menu-grid-container` > `.menu-grid.columns-N`), gap and breakpoints (768px: 2–4
9
+ * columns → 2; 480px: everything → 1; a 1-column grid stays 1).
10
+ */
11
+ declare class MenuGrid extends LitElement {
12
+ static styles: lit.CSSResult;
13
+ /** Number of columns at full width (1–4, same as the source component's `columns-N` classes). */
14
+ columns: number;
15
+ /** Extra class(es) appended to the inner grid element — the source component's `gridClassName`.
16
+ * Its outer `className` is the host element itself here: set a `class` attribute on `st-menu-grid`. */
17
+ gridClassName: string;
18
+ render(): lit.TemplateResult<1>;
19
+ }
20
+
21
+ export { MenuGrid };
@@ -0,0 +1,9 @@
1
+ import {
2
+ MenuGrid
3
+ } from "../chunk-VYON56QO.js";
4
+ import "../chunk-RHAOQ6K4.js";
5
+ import "../chunk-EUXUH3YW.js";
6
+ export {
7
+ MenuGrid
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,53 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+
4
+ /**
5
+ * One entry in an `st-menu-grid` — icon (via `slot="icon"`) + title on one line, an optional
6
+ * description below, and an optional corner badge ("New", "Popular", ...). A 1:1 port of
7
+ * `SankhyaUI`'s React `MenuGridItem` (`SankhyaCMS/SankhyaUI/src/components/Menu`): same markup and
8
+ * CSS, with its `motion` effects redone in CSS — fades up the first time it scrolls into view,
9
+ * scales to 1.02 on hover / 0.98 while pressed, the icon tilts on hover, the badge pops in.
10
+ * Colors come from the suite theme rather than per-item utility classes.
11
+ *
12
+ * An `http(s)` `href` opens in a new tab, like the source. Any other `href` fires a *cancelable*
13
+ * `menu-grid-item-select` event (detail: `{ href }`) first: a host doing client-side routing calls
14
+ * `event.preventDefault()` on it, which also cancels the anchor's own navigation (the source used
15
+ * react-router's `Link` here; the suite apps have no router).
16
+ */
17
+ declare class MenuGridItem extends LitElement {
18
+ /** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key between items. */
19
+ static shadowRootOptions: {
20
+ delegatesFocus: boolean;
21
+ clonable?: boolean;
22
+ customElementRegistry?: CustomElementRegistry | null;
23
+ mode: ShadowRootMode;
24
+ serializable?: boolean;
25
+ slotAssignment?: SlotAssignmentMode;
26
+ };
27
+ static styles: lit.CSSResult;
28
+ title: string;
29
+ description: string;
30
+ href: string;
31
+ /** Small corner label, e.g. "New"/"Beta" — omit for none. */
32
+ badge: string;
33
+ compact: boolean;
34
+ /** Suppresses the description even when `description` is set (source: `showDescription`, default `true`). */
35
+ showDescription: boolean;
36
+ /** Whether `slot="icon"` has content, so an omitted icon leaves no empty box. */
37
+ private hasIcon;
38
+ /** True until the item first scrolls into view (the source's `whileInView ... once`). */
39
+ private pending;
40
+ private observer?;
41
+ connectedCallback(): void;
42
+ disconnectedCallback(): void;
43
+ private onIconSlotChange;
44
+ private get isExternal();
45
+ private onClick;
46
+ render(): lit.TemplateResult<1>;
47
+ }
48
+
49
+ interface MenuGridItemSelectEventDetail {
50
+ href: string;
51
+ }
52
+
53
+ export { MenuGridItem, type MenuGridItemSelectEventDetail };
@@ -0,0 +1,9 @@
1
+ import {
2
+ MenuGridItem
3
+ } from "../chunk-4HKSA5UT.js";
4
+ import "../chunk-RHAOQ6K4.js";
5
+ import "../chunk-EUXUH3YW.js";
6
+ export {
7
+ MenuGridItem
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,50 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+
4
+ /**
5
+ * A single flat nav row — icon (`slot="icon"`) + title + badge on one line, an optional
6
+ * description below — as opposed to `st-menu-grid-item`'s card for a multi-column grid. A 1:1
7
+ * port of `SankhyaUI`'s React `MenuItem` (`SankhyaCMS/SankhyaUI/src/components/Menu`): same
8
+ * markup and CSS, with its `motion` effects redone in CSS — nudges right and scales to 1.01 on
9
+ * hover / 0.99 while pressed, the icon tilts on hover, the badge pops in, the description fades
10
+ * in. Colors come from the suite theme rather than per-item utility classes.
11
+ *
12
+ * Renders a real `<a href>` but fires a *cancelable* `menu-item-select` event (detail: `{ href }`)
13
+ * before navigating — a host doing client-side routing calls `event.preventDefault()` on it (the
14
+ * source used react-router's `Link` here; the suite apps have no router).
15
+ */
16
+ declare class MenuItem extends LitElement {
17
+ /** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key between items. */
18
+ static shadowRootOptions: {
19
+ delegatesFocus: boolean;
20
+ clonable?: boolean;
21
+ customElementRegistry?: CustomElementRegistry | null;
22
+ mode: ShadowRootMode;
23
+ serializable?: boolean;
24
+ slotAssignment?: SlotAssignmentMode;
25
+ };
26
+ static styles: lit.CSSResult;
27
+ title: string;
28
+ href: string;
29
+ description: string;
30
+ /** Small trailing label, e.g. a count or "New"/"Beta" — omit for none. */
31
+ badge: string;
32
+ /** Highlights this row as the current page (source: `isActive`). */
33
+ active: boolean;
34
+ compact: boolean;
35
+ /** Suppresses the description even when `description` is set (source: `showDescription`, default `true`). */
36
+ showDescription: boolean;
37
+ /** `target` for the `<a>` (source default `_self`). */
38
+ target: string;
39
+ /** Whether `slot="icon"` has content, so an omitted icon leaves no empty box. */
40
+ private hasIcon;
41
+ private onIconSlotChange;
42
+ private onClick;
43
+ render(): lit.TemplateResult<1>;
44
+ }
45
+
46
+ interface MenuItemSelectEventDetail {
47
+ href: string;
48
+ }
49
+
50
+ export { MenuItem, type MenuItemSelectEventDetail };
@@ -0,0 +1,9 @@
1
+ import {
2
+ MenuItem
3
+ } from "../chunk-LHU23TF6.js";
4
+ import "../chunk-RHAOQ6K4.js";
5
+ import "../chunk-EUXUH3YW.js";
6
+ export {
7
+ MenuItem
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,22 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+
4
+ /**
5
+ * Rounded call-to-action banner (title, subtitle, one outlined button) on a dark panel or a
6
+ * background image. Port of `SankhyaUI`'s React `PromoBanner`; the button fires an `action` event
7
+ * (detail `{ href }`, empty unless set) in place of `onAction`.
8
+ */
9
+ declare class PromoBanner extends LitElement {
10
+ static styles: lit.CSSResult;
11
+ title: string;
12
+ subtitle: string;
13
+ actionLabel: string;
14
+ href: string;
15
+ imageSrc: string;
16
+ inverted: boolean;
17
+ protected willUpdate(): void;
18
+ private onAction;
19
+ render(): lit.TemplateResult<1>;
20
+ }
21
+
22
+ export { PromoBanner };
@@ -0,0 +1,10 @@
1
+ import {
2
+ PromoBanner
3
+ } from "../chunk-3ERKQNZT.js";
4
+ import "../chunk-3VE6VFJ4.js";
5
+ import "../chunk-RHAOQ6K4.js";
6
+ import "../chunk-EUXUH3YW.js";
7
+ export {
8
+ PromoBanner
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,72 @@
1
+ /** Dependency-free node types, safe to import from the content API layer. */
2
+ /** Action reference in JSON, resolved against the `handlers` prop of `DynamicRenderer`. */
3
+ type ActionRef = `@action:${string}`;
4
+ /** Keys the renderer owns; everything else on a node is passed to the component as a prop. */
5
+ interface NodeEnvelope<TNode> {
6
+ id?: string;
7
+ /** Named slot in the parent (e.g. Header: "utility"). Omit for the default slot. */
8
+ slot?: string;
9
+ /** Editor-only label, never passed to the component. */
10
+ label?: string;
11
+ children?: TNode[];
12
+ }
13
+ /**
14
+ * A node as it appears in JSON: flat, no `data` wrapper.
15
+ * `{ "type": "Hero", "id": "home-hero", "title": "...", "children": [...] }`
16
+ */
17
+ interface ComponentNode extends NodeEnvelope<ComponentNode> {
18
+ type: string;
19
+ [prop: string]: unknown;
20
+ }
21
+ /** A page is a list of nodes. */
22
+ type PageContent = ComponentNode[];
23
+ declare function isComponentNode(value: unknown): value is ComponentNode;
24
+
25
+ /**
26
+ * Returns a copy of `nodes` where the node with the given `id` has `props` merged in.
27
+ * Use it to inject runtime state (e.g. the selected language) into fetched JSON without mutating it.
28
+ */
29
+ declare function patchNodeById(nodes: ComponentNode[], id: string, props: Record<string, unknown>): ComponentNode[];
30
+
31
+ /**
32
+ * The JSON `type` of every base component, and the Lit element that renders it.
33
+ * This is the contract page JSON is written against — renderers (React, or any other binding)
34
+ * map each `type` to their own component for that element.
35
+ */
36
+ declare const componentTags: {
37
+ readonly BentoGrid: "st-bento-grid";
38
+ readonly Card: "st-card";
39
+ readonly Carousel: "st-carousel";
40
+ readonly ContentBlock: "st-content-block";
41
+ readonly CookieConsent: "st-cookie-consent";
42
+ readonly Dropdown: "st-dropdown";
43
+ readonly FeatureItem: "st-feature-item";
44
+ readonly FeatureSplit: "st-feature-split";
45
+ readonly FeaturesSection: "st-features-section";
46
+ readonly Footer: "st-footer";
47
+ readonly Header: "st-header";
48
+ readonly Hero: "st-hero";
49
+ readonly IconButton: "st-icon-button";
50
+ readonly ItemsAccordion: "st-items-accordion";
51
+ readonly MenuGrid: "st-menu-grid";
52
+ readonly MenuGridItem: "st-menu-grid-item";
53
+ readonly MenuItem: "st-menu-item";
54
+ readonly PromoBanner: "st-promo-banner";
55
+ readonly Select: "st-select";
56
+ readonly Stats: "st-stats";
57
+ readonly Testimonials: "st-testimonials";
58
+ };
59
+ /** Every `type` the base set knows. */
60
+ type ComponentType = keyof typeof componentTags;
61
+ declare function isBaseComponentType(type: string): type is ComponentType;
62
+
63
+ /**
64
+ * Returns the schema violations for a node and its descendants (empty when valid).
65
+ * `isKnownType` defaults to the base component set; pass a wider predicate when a renderer also
66
+ * registers custom components.
67
+ */
68
+ declare function validateNode(node: unknown, where?: string, isKnownType?: (type: string) => boolean): string[];
69
+ /** Validates a page: a node or a list of nodes. */
70
+ declare function validatePage(page: unknown, isKnownType?: (type: string) => boolean): string[];
71
+
72
+ export { type ActionRef, type ComponentNode, type ComponentType, type NodeEnvelope, type PageContent, componentTags, isBaseComponentType, isComponentNode, patchNodeById, validateNode, validatePage };
@@ -0,0 +1,75 @@
1
+ import "../chunk-EUXUH3YW.js";
2
+
3
+ // src/schema/node.ts
4
+ function isComponentNode(value) {
5
+ return typeof value === "object" && value !== null && !Array.isArray(value) && typeof value.type === "string" && value.type.trim().length > 0;
6
+ }
7
+
8
+ // src/schema/nodeUtils.ts
9
+ function patchNodeById(nodes, id, props) {
10
+ return nodes.map((node) => {
11
+ const patched = node.id === id ? { ...node, ...props } : node;
12
+ return patched.children ? { ...patched, children: patchNodeById(patched.children, id, props) } : patched;
13
+ });
14
+ }
15
+
16
+ // src/schema/components.ts
17
+ var componentTags = {
18
+ BentoGrid: "st-bento-grid",
19
+ Card: "st-card",
20
+ Carousel: "st-carousel",
21
+ ContentBlock: "st-content-block",
22
+ CookieConsent: "st-cookie-consent",
23
+ Dropdown: "st-dropdown",
24
+ FeatureItem: "st-feature-item",
25
+ FeatureSplit: "st-feature-split",
26
+ FeaturesSection: "st-features-section",
27
+ Footer: "st-footer",
28
+ Header: "st-header",
29
+ Hero: "st-hero",
30
+ IconButton: "st-icon-button",
31
+ ItemsAccordion: "st-items-accordion",
32
+ MenuGrid: "st-menu-grid",
33
+ MenuGridItem: "st-menu-grid-item",
34
+ MenuItem: "st-menu-item",
35
+ PromoBanner: "st-promo-banner",
36
+ Select: "st-select",
37
+ Stats: "st-stats",
38
+ Testimonials: "st-testimonials"
39
+ };
40
+ function isBaseComponentType(type) {
41
+ return Object.hasOwn(componentTags, type);
42
+ }
43
+
44
+ // src/schema/validate.ts
45
+ var LEGACY_KEYS = ["data", "embeddedView", "data-position", "image", "contentUrl"];
46
+ function validateNode(node, where = "node", isKnownType = isBaseComponentType) {
47
+ if (typeof node !== "object" || node === null || Array.isArray(node)) return [`${where}: node must be an object`];
48
+ const n = node;
49
+ const found = [];
50
+ if (typeof n.type !== "string" || !isKnownType(n.type)) found.push(`${where}: unknown type "${String(n.type)}"`);
51
+ for (const legacy of LEGACY_KEYS) {
52
+ if (legacy in n) found.push(`${where}: legacy key "${legacy}"`);
53
+ }
54
+ if (Array.isArray(n.items) && n.items.some((item) => typeof item === "object" && item !== null && "type" in item)) {
55
+ found.push(`${where}: "items" must hold plain data; nest components under "children"`);
56
+ }
57
+ if (n.children !== void 0) {
58
+ if (!Array.isArray(n.children)) found.push(`${where}: children must be an array`);
59
+ else n.children.forEach((child, i) => found.push(...validateNode(child, `${where}.children[${i}]`, isKnownType)));
60
+ }
61
+ return found;
62
+ }
63
+ function validatePage(page, isKnownType) {
64
+ const nodes = Array.isArray(page) ? page : [page];
65
+ return nodes.flatMap((node, i) => validateNode(node, `[${i}]`, isKnownType));
66
+ }
67
+ export {
68
+ componentTags,
69
+ isBaseComponentType,
70
+ isComponentNode,
71
+ patchNodeById,
72
+ validateNode,
73
+ validatePage
74
+ };
75
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema/node.ts","../../src/schema/nodeUtils.ts","../../src/schema/components.ts","../../src/schema/validate.ts"],"sourcesContent":["/** Dependency-free node types, safe to import from the content API layer. */\r\n\r\n/** Action reference in JSON, resolved against the `handlers` prop of `DynamicRenderer`. */\r\nexport type ActionRef = `@action:${string}`;\r\n\r\n/** Keys the renderer owns; everything else on a node is passed to the component as a prop. */\r\nexport interface NodeEnvelope<TNode> {\r\n id?: string;\r\n /** Named slot in the parent (e.g. Header: \"utility\"). Omit for the default slot. */\r\n slot?: string;\r\n /** Editor-only label, never passed to the component. */\r\n label?: string;\r\n children?: TNode[];\r\n}\r\n\r\n/**\r\n * A node as it appears in JSON: flat, no `data` wrapper.\r\n * `{ \"type\": \"Hero\", \"id\": \"home-hero\", \"title\": \"...\", \"children\": [...] }`\r\n */\r\nexport interface ComponentNode extends NodeEnvelope<ComponentNode> {\r\n type: string;\r\n [prop: string]: unknown;\r\n}\r\n\r\n/** A page is a list of nodes. */\r\nexport type PageContent = ComponentNode[];\r\n\r\nexport function isComponentNode(value: unknown): value is ComponentNode {\r\n return (\r\n typeof value === 'object' &&\r\n value !== null &&\r\n !Array.isArray(value) &&\r\n typeof (value as { type?: unknown }).type === 'string' &&\r\n (value as { type: string }).type.trim().length > 0\r\n );\r\n}\r\n","import type { ComponentNode } from './node';\n\n/**\n * Returns a copy of `nodes` where the node with the given `id` has `props` merged in.\n * Use it to inject runtime state (e.g. the selected language) into fetched JSON without mutating it.\n */\nexport function patchNodeById(nodes: ComponentNode[], id: string, props: Record<string, unknown>): ComponentNode[] {\n return nodes.map(node => {\n const patched = node.id === id ? { ...node, ...props } : node;\n return patched.children\n ? { ...patched, children: patchNodeById(patched.children, id, props) }\n : patched;\n });\n}\n","/**\n * The JSON `type` of every base component, and the Lit element that renders it.\n * This is the contract page JSON is written against — renderers (React, or any other binding)\n * map each `type` to their own component for that element.\n */\nexport const componentTags = {\n BentoGrid: 'st-bento-grid',\n Card: 'st-card',\n Carousel: 'st-carousel',\n ContentBlock: 'st-content-block',\n CookieConsent: 'st-cookie-consent',\n Dropdown: 'st-dropdown',\n FeatureItem: 'st-feature-item',\n FeatureSplit: 'st-feature-split',\n FeaturesSection: 'st-features-section',\n Footer: 'st-footer',\n Header: 'st-header',\n Hero: 'st-hero',\n IconButton: 'st-icon-button',\n ItemsAccordion: 'st-items-accordion',\n MenuGrid: 'st-menu-grid',\n MenuGridItem: 'st-menu-grid-item',\n MenuItem: 'st-menu-item',\n PromoBanner: 'st-promo-banner',\n Select: 'st-select',\n Stats: 'st-stats',\n Testimonials: 'st-testimonials'\n} as const;\n\n/** Every `type` the base set knows. */\nexport type ComponentType = keyof typeof componentTags;\n\nexport function isBaseComponentType(type: string): type is ComponentType {\n return Object.hasOwn(componentTags, type);\n}\n","import { isBaseComponentType } from './components';\nimport type { ComponentNode } from './node';\n\n/** Keys from the pre-flat schema; their presence means the JSON still needs `scripts/migrate-json.mjs`. */\nconst LEGACY_KEYS = ['data', 'embeddedView', 'data-position', 'image', 'contentUrl'] as const;\n\n/**\n * Returns the schema violations for a node and its descendants (empty when valid).\n * `isKnownType` defaults to the base component set; pass a wider predicate when a renderer also\n * registers custom components.\n */\nexport function validateNode(node: unknown, where = 'node', isKnownType: (type: string) => boolean = isBaseComponentType): string[] {\n if (typeof node !== 'object' || node === null || Array.isArray(node)) return [`${where}: node must be an object`];\n const n = node as ComponentNode;\n const found: string[] = [];\n if (typeof n.type !== 'string' || !isKnownType(n.type)) found.push(`${where}: unknown type \"${String(n.type)}\"`);\n for (const legacy of LEGACY_KEYS) {\n if (legacy in n) found.push(`${where}: legacy key \"${legacy}\"`);\n }\n if (Array.isArray(n.items) && n.items.some(item => typeof item === 'object' && item !== null && 'type' in item)) {\n found.push(`${where}: \"items\" must hold plain data; nest components under \"children\"`);\n }\n if (n.children !== undefined) {\n if (!Array.isArray(n.children)) found.push(`${where}: children must be an array`);\n else n.children.forEach((child, i) => found.push(...validateNode(child, `${where}.children[${i}]`, isKnownType)));\n }\n return found;\n}\n\n/** Validates a page: a node or a list of nodes. */\nexport function validatePage(page: unknown, isKnownType?: (type: string) => boolean): string[] {\n const nodes = Array.isArray(page) ? page : [page];\n return nodes.flatMap((node, i) => validateNode(node, `[${i}]`, isKnownType));\n}\n"],"mappings":";;;AA2BO,SAAS,gBAAgB,OAAwC;AACpE,SACI,OAAO,UAAU,YACjB,UAAU,QACV,CAAC,MAAM,QAAQ,KAAK,KACpB,OAAQ,MAA6B,SAAS,YAC7C,MAA2B,KAAK,KAAK,EAAE,SAAS;AAEzD;;;AC7BO,SAAS,cAAc,OAAwB,IAAY,OAAiD;AAC/G,SAAO,MAAM,IAAI,UAAQ;AACrB,UAAM,UAAU,KAAK,OAAO,KAAK,EAAE,GAAG,MAAM,GAAG,MAAM,IAAI;AACzD,WAAO,QAAQ,WACT,EAAE,GAAG,SAAS,UAAU,cAAc,QAAQ,UAAU,IAAI,KAAK,EAAE,IACnE;AAAA,EACV,CAAC;AACL;;;ACRO,IAAM,gBAAgB;AAAA,EACzB,WAAW;AAAA,EACX,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,UAAU;AAAA,EACV,aAAa;AAAA,EACb,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,cAAc;AAAA,EACd,UAAU;AAAA,EACV,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAClB;AAKO,SAAS,oBAAoB,MAAqC;AACrE,SAAO,OAAO,OAAO,eAAe,IAAI;AAC5C;;;AC9BA,IAAM,cAAc,CAAC,QAAQ,gBAAgB,iBAAiB,SAAS,YAAY;AAO5E,SAAS,aAAa,MAAe,QAAQ,QAAQ,cAAyC,qBAA+B;AAChI,MAAI,OAAO,SAAS,YAAY,SAAS,QAAQ,MAAM,QAAQ,IAAI,EAAG,QAAO,CAAC,GAAG,KAAK,0BAA0B;AAChH,QAAM,IAAI;AACV,QAAM,QAAkB,CAAC;AACzB,MAAI,OAAO,EAAE,SAAS,YAAY,CAAC,YAAY,EAAE,IAAI,EAAG,OAAM,KAAK,GAAG,KAAK,mBAAmB,OAAO,EAAE,IAAI,CAAC,GAAG;AAC/G,aAAW,UAAU,aAAa;AAC9B,QAAI,UAAU,EAAG,OAAM,KAAK,GAAG,KAAK,iBAAiB,MAAM,GAAG;AAAA,EAClE;AACA,MAAI,MAAM,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,UAAQ,OAAO,SAAS,YAAY,SAAS,QAAQ,UAAU,IAAI,GAAG;AAC7G,UAAM,KAAK,GAAG,KAAK,kEAAkE;AAAA,EACzF;AACA,MAAI,EAAE,aAAa,QAAW;AAC1B,QAAI,CAAC,MAAM,QAAQ,EAAE,QAAQ,EAAG,OAAM,KAAK,GAAG,KAAK,6BAA6B;AAAA,QAC3E,GAAE,SAAS,QAAQ,CAAC,OAAO,MAAM,MAAM,KAAK,GAAG,aAAa,OAAO,GAAG,KAAK,aAAa,CAAC,KAAK,WAAW,CAAC,CAAC;AAAA,EACpH;AACA,SAAO;AACX;AAGO,SAAS,aAAa,MAAe,aAAmD;AAC3F,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AAChD,SAAO,MAAM,QAAQ,CAAC,MAAM,MAAM,aAAa,MAAM,IAAI,CAAC,KAAK,WAAW,CAAC;AAC/E;","names":[]}
@@ -0,0 +1,77 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement, PropertyValues } from 'lit';
3
+
4
+ interface SelectChangedEventDetail {
5
+ value: string;
6
+ }
7
+ interface SelectOption {
8
+ value: string;
9
+ label: string;
10
+ /** Optional web URL this option points to (e.g. a SharePoint library) — set when a consumer wants to link out to it, such as a breadcrumb's first crumb. */
11
+ url?: string;
12
+ }
13
+
14
+ /**
15
+ * A fully custom-styled replacement for native `<select>`, used everywhere
16
+ * the wizard needs a single-choice dropdown (template source, list, document
17
+ * library, admin roles, ...).
18
+ *
19
+ * Built on the CSS Customizable Select API (`appearance: base-select`) —
20
+ * still a real `<select>`/`<option>` element tree, so focus, keyboard
21
+ * (arrows/Home/End/typeahead), and ARIA all come from the browser for free,
22
+ * but the trigger (`<button>`/`<selectedcontent>`) and popup
23
+ * (`::picker(select)`) are fully styleable instead of OS-rendered. Chromium
24
+ * only for now (Firefox/Safari fall back to an unstyled native `<select>` —
25
+ * the extra `<button>`/`<selectedcontent>` markup is simply not rendered by
26
+ * browsers that don't support the parsing/CSS additions, so the control
27
+ * still works there, just without the custom look).
28
+ *
29
+ * `options` intentionally has no "unselected" placeholder entry — set
30
+ * `value=""` (or any value with no matching option) and it falls back to
31
+ * showing `placeholder` in the trigger instead, letting callers swap the
32
+ * placeholder text dynamically (e.g. "Select a list" vs "Select a list
33
+ * first") without needing a synthetic option in the list. Internally this is
34
+ * a real hidden/disabled `<option value="">`, since a native `<select>`
35
+ * always has *some* option selected.
36
+ *
37
+ * Fires `select-change` (detail: `{ value }`) only when the value actually
38
+ * changes, matching native `<select>`'s `change` event semantics.
39
+ *
40
+ * `link-href` optionally renders an external-link button in front of
41
+ * `field-label` — the same glyph/placement as the "open library" links
42
+ * placed next to the Templates/Save-location breadcrumbs — for callers that
43
+ * want a one-click way to open whatever the current selection points at
44
+ * (e.g. the SharePoint site or library) in a new tab.
45
+ */
46
+ declare class Select extends LitElement {
47
+ static styles: lit.CSSResult;
48
+ options: SelectOption[];
49
+ value: string;
50
+ placeholder: string;
51
+ /** Renders an internal `<label>` above the trigger, associated via `aria-labelledby`. Leave empty when the field is labeled some other way (e.g. context alone). */
52
+ fieldLabel: string;
53
+ /**
54
+ * Optional URL for an external-link button rendered in front of
55
+ * `field-label` (same glyph/placement as the "open library" links next to
56
+ * the Templates/Save-location breadcrumbs) — e.g. a link to the
57
+ * SharePoint site or library the current selection points at. Ignored
58
+ * when `field-label` is empty, since there'd be nothing to place it in
59
+ * front of.
60
+ */
61
+ linkHref: string;
62
+ /** Accessible name/title for the `link-href` button. */
63
+ linkLabel: string;
64
+ /** Accessible name for the trigger when there's no visible `field-label` (e.g. a filter-row select). Ignored when `field-label` is set. */
65
+ selectLabel: string;
66
+ disabled: boolean;
67
+ /** Borderless variant for a header/toolbar utility slot — see the `:host([ghost])` styles. */
68
+ ghost: boolean;
69
+ private readonly selectEl;
70
+ private readonly instanceId;
71
+ private readonly fieldLabelId;
72
+ protected updated(changed: PropertyValues): void;
73
+ render(): lit.TemplateResult<1>;
74
+ private onChange;
75
+ }
76
+
77
+ export { Select, type SelectChangedEventDetail, type SelectOption };
@@ -0,0 +1,10 @@
1
+ import {
2
+ Select
3
+ } from "../chunk-5UFRGZWG.js";
4
+ import "../chunk-3TCP25JG.js";
5
+ import "../chunk-RHAOQ6K4.js";
6
+ import "../chunk-EUXUH3YW.js";
7
+ export {
8
+ Select
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}