@sankhyatronics/sankhya-cms 0.1.9 → 0.1.11
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/custom-elements.json +851 -159
- package/dist/attention-panel/index.d.ts +20 -0
- package/dist/attention-panel/index.js +9 -0
- package/dist/attention-panel/index.js.map +1 -0
- package/dist/bar-chart/index.d.ts +43 -0
- package/dist/bar-chart/index.js +9 -0
- package/dist/bar-chart/index.js.map +1 -0
- package/dist/chip/index.d.ts +21 -0
- package/dist/chip/index.js +9 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/chunk-2TPTJN36.js +216 -0
- package/dist/chunk-2TPTJN36.js.map +1 -0
- package/dist/chunk-DAGSL2JV.js +83 -0
- package/dist/chunk-DAGSL2JV.js.map +1 -0
- package/dist/chunk-LGGLQNSU.js +93 -0
- package/dist/chunk-LGGLQNSU.js.map +1 -0
- package/dist/chunk-MG2VTZA4.js +122 -0
- package/dist/chunk-MG2VTZA4.js.map +1 -0
- package/dist/chunk-TVE4EPVK.js +119 -0
- package/dist/chunk-TVE4EPVK.js.map +1 -0
- package/dist/chunk-YLY5DXQE.js +185 -0
- package/dist/chunk-YLY5DXQE.js.map +1 -0
- package/dist/date-tile/index.d.ts +20 -0
- package/dist/date-tile/index.js +9 -0
- package/dist/date-tile/index.js.map +1 -0
- package/dist/fonts/inter-latin-400-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-500-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-600-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-700-normal.woff2 +0 -0
- package/dist/fonts.css +39 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +51 -27
- package/dist/kpi-card/index.d.ts +30 -0
- package/dist/kpi-card/index.js +9 -0
- package/dist/kpi-card/index.js.map +1 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.js +6 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/segmented-control/index.d.ts +30 -0
- package/dist/segmented-control/index.js +9 -0
- package/dist/segmented-control/index.js.map +1 -0
- package/dist/theme.css +77 -28
- package/dist/themes.css +20 -0
- package/package.json +28 -2
package/dist/schema/index.js
CHANGED
|
@@ -17,9 +17,13 @@ function patchNodeById(nodes, id, props) {
|
|
|
17
17
|
var componentTags = {
|
|
18
18
|
BentoGrid: "st-bento-grid",
|
|
19
19
|
Card: "st-card",
|
|
20
|
+
AttentionPanel: "st-attention-panel",
|
|
21
|
+
BarChart: "st-bar-chart",
|
|
20
22
|
Carousel: "st-carousel",
|
|
23
|
+
Chip: "st-chip",
|
|
21
24
|
ContentBlock: "st-content-block",
|
|
22
25
|
CookieConsent: "st-cookie-consent",
|
|
26
|
+
DateTile: "st-date-tile",
|
|
23
27
|
Dropdown: "st-dropdown",
|
|
24
28
|
FeatureItem: "st-feature-item",
|
|
25
29
|
FeatureSplit: "st-feature-split",
|
|
@@ -29,6 +33,7 @@ var componentTags = {
|
|
|
29
33
|
Hero: "st-hero",
|
|
30
34
|
IconButton: "st-icon-button",
|
|
31
35
|
ItemsAccordion: "st-items-accordion",
|
|
36
|
+
KpiCard: "st-kpi-card",
|
|
32
37
|
MegaMenu: "st-mega-menu",
|
|
33
38
|
MegaMenuColumn: "st-mega-menu-column",
|
|
34
39
|
MegaMenuFeature: "st-mega-menu-feature",
|
|
@@ -36,6 +41,7 @@ var componentTags = {
|
|
|
36
41
|
MenuGridItem: "st-menu-grid-item",
|
|
37
42
|
MenuItem: "st-menu-item",
|
|
38
43
|
PromoBanner: "st-promo-banner",
|
|
44
|
+
SegmentedControl: "st-segmented-control",
|
|
39
45
|
Section: "st-section",
|
|
40
46
|
Select: "st-select",
|
|
41
47
|
Stats: "st-stats",
|
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +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. */\n\n/** Action reference in JSON, resolved against the `handlers` prop of `DynamicRenderer`. */\nexport type ActionRef = `@action:${string}`;\n\n/** Keys the renderer owns; everything else on a node is passed to the component as a prop. */\nexport interface NodeEnvelope<TNode> {\n id?: string;\n /** Named slot in the parent (e.g. Header: \"utility\"). Omit for the default slot. */\n slot?: string;\n /** Editor-only label, never passed to the component. */\n label?: string;\n children?: TNode[];\n}\n\n/**\n * A node as it appears in JSON: flat, no `data` wrapper.\n * `{ \"type\": \"Hero\", \"id\": \"home-hero\", \"title\": \"...\", \"children\": [...] }`\n */\nexport interface ComponentNode extends NodeEnvelope<ComponentNode> {\n type: string;\n [prop: string]: unknown;\n}\n\n/** A page is a list of nodes. */\nexport type PageContent = ComponentNode[];\n\nexport function isComponentNode(value: unknown): value is ComponentNode {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n typeof (value as { type?: unknown }).type === 'string' &&\n (value as { type: string }).type.trim().length > 0\n );\n}\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 MegaMenu: 'st-mega-menu',\n MegaMenuColumn: 'st-mega-menu-column',\n MegaMenuFeature: 'st-mega-menu-feature',\n MenuGrid: 'st-menu-grid',\n MenuGridItem: 'st-menu-grid-item',\n MenuItem: 'st-menu-item',\n PromoBanner: 'st-promo-banner',\n Section: 'st-section',\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,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,cAAc;AAAA,EACd,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAClB;AAKO,SAAS,oBAAoB,MAAqC;AACrE,SAAO,OAAO,OAAO,eAAe,IAAI;AAC5C;;;
|
|
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. */\n\n/** Action reference in JSON, resolved against the `handlers` prop of `DynamicRenderer`. */\nexport type ActionRef = `@action:${string}`;\n\n/** Keys the renderer owns; everything else on a node is passed to the component as a prop. */\nexport interface NodeEnvelope<TNode> {\n id?: string;\n /** Named slot in the parent (e.g. Header: \"utility\"). Omit for the default slot. */\n slot?: string;\n /** Editor-only label, never passed to the component. */\n label?: string;\n children?: TNode[];\n}\n\n/**\n * A node as it appears in JSON: flat, no `data` wrapper.\n * `{ \"type\": \"Hero\", \"id\": \"home-hero\", \"title\": \"...\", \"children\": [...] }`\n */\nexport interface ComponentNode extends NodeEnvelope<ComponentNode> {\n type: string;\n [prop: string]: unknown;\n}\n\n/** A page is a list of nodes. */\nexport type PageContent = ComponentNode[];\n\nexport function isComponentNode(value: unknown): value is ComponentNode {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n typeof (value as { type?: unknown }).type === 'string' &&\n (value as { type: string }).type.trim().length > 0\n );\n}\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 AttentionPanel: 'st-attention-panel',\n BarChart: 'st-bar-chart',\n Carousel: 'st-carousel',\n Chip: 'st-chip',\n ContentBlock: 'st-content-block',\n CookieConsent: 'st-cookie-consent',\n DateTile: 'st-date-tile',\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 KpiCard: 'st-kpi-card',\n MegaMenu: 'st-mega-menu',\n MegaMenuColumn: 'st-mega-menu-column',\n MegaMenuFeature: 'st-mega-menu-feature',\n MenuGrid: 'st-menu-grid',\n MenuGridItem: 'st-menu-grid-item',\n MenuItem: 'st-menu-item',\n PromoBanner: 'st-promo-banner',\n SegmentedControl: 'st-segmented-control',\n Section: 'st-section',\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,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,cAAc;AAAA,EACd,eAAe;AAAA,EACf,UAAU;AAAA,EACV,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,SAAS;AAAA,EACT,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,cAAc;AAAA,EACd,UAAU;AAAA,EACV,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAClB;AAKO,SAAS,oBAAoB,MAAqC;AACrE,SAAO,OAAO,OAAO,eAAe,IAAI;AAC5C;;;ACxCA,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,30 @@
|
|
|
1
|
+
import * as lit from 'lit';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
|
|
4
|
+
interface SegmentedOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/** Fired when a segment is chosen. `detail.value` is the chosen option's `value`. */
|
|
9
|
+
interface SegmentChangeEventDetail {
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A row of mutually exclusive segments in a grey track, one of them lifted as white. Pass the
|
|
14
|
+
* segments as `options` and the chosen one as `value`; a `segment-change` event fires on choice.
|
|
15
|
+
* Keyboard: arrows move between segments, Home and End jump to the ends.
|
|
16
|
+
*/
|
|
17
|
+
declare class SegmentedControl extends LitElement {
|
|
18
|
+
static styles: lit.CSSResult;
|
|
19
|
+
/** The segments, in order. */
|
|
20
|
+
options: SegmentedOption[];
|
|
21
|
+
/** The chosen segment's `value`. */
|
|
22
|
+
value: string;
|
|
23
|
+
/** Names the group for assistive technology. */
|
|
24
|
+
groupLabel: string;
|
|
25
|
+
private select;
|
|
26
|
+
private onKeydown;
|
|
27
|
+
render(): lit.TemplateResult<1>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { type SegmentChangeEventDetail, SegmentedControl, type SegmentedOption };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/theme.css
CHANGED
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
/* =========================================================
|
|
30
30
|
PRIMARIES — override these for a rebrand.
|
|
31
31
|
========================================================= */
|
|
32
|
-
--st-primary-color:
|
|
33
|
-
--st-primary-background:
|
|
32
|
+
--st-primary-color: #14171F;
|
|
33
|
+
--st-primary-background: #F6F7F9;
|
|
34
34
|
--st-neutral-50: var(--st-primary-background);
|
|
35
35
|
--st-neutral-950: var(--st-primary-color);
|
|
36
36
|
--st-neutral-100: oklch(from color-mix(in oklch, var(--st-neutral-950) 8%, var(--st-neutral-50)) l calc(c * 2.1) h);
|
|
@@ -55,16 +55,37 @@
|
|
|
55
55
|
/* --st-brand-color is deliberately left undefined: set it (on :root) to
|
|
56
56
|
make the accent, the solid call-to-action buttons and checkboxes all
|
|
57
57
|
follow one host-app brand color. Unset, each keeps its own default. */
|
|
58
|
-
--st-primary-accent: var(--st-brand-color,
|
|
59
|
-
--st-primary-danger:
|
|
60
|
-
--st-primary-warning:
|
|
61
|
-
--st-primary-success:
|
|
58
|
+
--st-primary-accent: var(--st-brand-color, #3557E0);
|
|
59
|
+
--st-primary-danger: #C0364A;
|
|
60
|
+
--st-primary-warning: #B4610E;
|
|
61
|
+
--st-primary-success: #12805C;
|
|
62
62
|
|
|
63
63
|
/* Pure white/black anchors for the color-mix() ramps below and the
|
|
64
64
|
"text/icon on a solid fill" token — not general-purpose literals. */
|
|
65
|
-
--st-primary-canvas:
|
|
65
|
+
--st-primary-canvas: #FFFFFF;
|
|
66
66
|
--st-primary-ink: var(--st-neutral-950);
|
|
67
67
|
|
|
68
|
+
/* Fixed surface, line and text anchors. Named literals so the semantic
|
|
69
|
+
tokens below can match the design spec exactly. Themes that re-tint the
|
|
70
|
+
page (themes.css) do not change these. */
|
|
71
|
+
--st-primary-line: #E6E8EC;
|
|
72
|
+
--st-primary-divider: #EEF0F3;
|
|
73
|
+
--st-primary-text-secondary: #4B5263;
|
|
74
|
+
--st-primary-text-muted: #666E80;
|
|
75
|
+
|
|
76
|
+
/* Brand soft/ink: fixed, so they do not follow --st-brand-color. */
|
|
77
|
+
--st-primary-brand-soft: #EEF2FE;
|
|
78
|
+
--st-primary-brand-ink: #2440B8;
|
|
79
|
+
|
|
80
|
+
/* Status: the spec colour is for dots, icons and borders. Text on a soft
|
|
81
|
+
background uses the darker variant so it passes WCAG AA (4.5:1). */
|
|
82
|
+
--st-primary-success-soft: #E7F6F0;
|
|
83
|
+
--st-primary-warning-soft: #FDF3E6;
|
|
84
|
+
--st-primary-danger-soft: #FCECEE;
|
|
85
|
+
--st-primary-success-text: #0F6E4E;
|
|
86
|
+
--st-primary-warning-text: #8A4A0B;
|
|
87
|
+
--st-primary-danger-text: #B02E41;
|
|
88
|
+
|
|
68
89
|
--st-accent-subtle: color-mix(in oklch, var(--st-primary-accent) 8%, var(--st-primary-canvas));
|
|
69
90
|
--st-accent-border: color-mix(in oklch, var(--st-primary-accent) 22%, var(--st-primary-canvas));
|
|
70
91
|
--st-accent-muted: color-mix(in oklch, var(--st-primary-accent) 55%, var(--st-primary-canvas));
|
|
@@ -89,16 +110,17 @@
|
|
|
89
110
|
--st-color-page: var(--st-neutral-50);
|
|
90
111
|
--st-color-surface: var(--st-primary-canvas);
|
|
91
112
|
--st-color-subtle: var(--st-neutral-100);
|
|
92
|
-
--st-color-divider: var(--st-
|
|
113
|
+
--st-color-divider: var(--st-primary-divider);
|
|
93
114
|
--st-color-hover: var(--st-neutral-200);
|
|
94
|
-
--st-color-border: var(--st-
|
|
115
|
+
--st-color-border: var(--st-primary-line);
|
|
95
116
|
--st-color-skeleton: var(--st-neutral-300);
|
|
96
117
|
--st-color-folder-icon-bg: var(--st-neutral-300);
|
|
97
118
|
--st-color-border-strong: var(--st-neutral-400);
|
|
98
|
-
--st-color-text-faint: var(--st-
|
|
99
|
-
--st-color-text-muted: var(--st-
|
|
100
|
-
--st-color-text: var(--st-
|
|
101
|
-
--st-color-text
|
|
119
|
+
--st-color-text-faint: var(--st-primary-text-muted);
|
|
120
|
+
--st-color-text-muted: var(--st-primary-text-muted);
|
|
121
|
+
--st-color-text-secondary: var(--st-primary-text-secondary);
|
|
122
|
+
--st-color-text: var(--st-neutral-950);
|
|
123
|
+
--st-color-text-strong: var(--st-neutral-950);
|
|
102
124
|
|
|
103
125
|
/* Text/icon color for content sitting on a solid/dark fill (buttons,
|
|
104
126
|
avatars, active pills) — never hardcode "white" at the point of use. */
|
|
@@ -111,20 +133,27 @@
|
|
|
111
133
|
--st-color-accent-muted: var(--st-accent-muted);
|
|
112
134
|
--st-color-accent-text: var(--st-accent-text);
|
|
113
135
|
|
|
114
|
-
/*
|
|
136
|
+
/* Brand aliases for the design spec: primary = the accent, primary-soft and
|
|
137
|
+
primary-ink are the fixed brand tints (see --st-primary-brand-*). */
|
|
138
|
+
--st-color-primary: var(--st-color-accent);
|
|
139
|
+
--st-color-primary-soft: var(--st-primary-brand-soft);
|
|
140
|
+
--st-color-primary-ink: var(--st-primary-brand-ink);
|
|
141
|
+
|
|
142
|
+
/* ---- Semantic state ramps — status colour for dots, icons and borders;
|
|
143
|
+
the soft background and text tokens are fixed for contrast. ---- */
|
|
115
144
|
--st-color-danger: var(--st-primary-danger);
|
|
116
|
-
--st-color-danger-subtle: var(--st-danger-
|
|
145
|
+
--st-color-danger-subtle: var(--st-primary-danger-soft);
|
|
117
146
|
--st-color-danger-border: var(--st-danger-border);
|
|
118
|
-
--st-color-danger-text: var(--st-danger-text);
|
|
147
|
+
--st-color-danger-text: var(--st-primary-danger-text);
|
|
119
148
|
|
|
120
149
|
--st-color-warning: var(--st-primary-warning);
|
|
121
|
-
--st-color-warning-subtle: var(--st-warning-
|
|
150
|
+
--st-color-warning-subtle: var(--st-primary-warning-soft);
|
|
122
151
|
--st-color-warning-border: var(--st-warning-border);
|
|
123
|
-
--st-color-warning-text: var(--st-warning-text);
|
|
152
|
+
--st-color-warning-text: var(--st-primary-warning-text);
|
|
124
153
|
|
|
125
154
|
--st-color-success: var(--st-primary-success);
|
|
126
|
-
--st-color-success-subtle: var(--st-success-
|
|
127
|
-
--st-color-success-text: var(--st-success-text);
|
|
155
|
+
--st-color-success-subtle: var(--st-primary-success-soft);
|
|
156
|
+
--st-color-success-text: var(--st-primary-success-text);
|
|
128
157
|
|
|
129
158
|
/* ---- File-type badge colors ---- */
|
|
130
159
|
--st-color-type-word: var(--st-primary-type-word);
|
|
@@ -149,6 +178,11 @@
|
|
|
149
178
|
--st-shadow-color-lg: var(--st-neutral-300);
|
|
150
179
|
--st-shadow-color-xl: var(--st-neutral-300);
|
|
151
180
|
|
|
181
|
+
/* ---- Elevation presets, for the design spec's card and primary button.
|
|
182
|
+
Components reference these rather than writing their own shadows. ---- */
|
|
183
|
+
--st-shadow-card: 0 1px 2px rgba(20, 23, 31, 0.04);
|
|
184
|
+
--st-shadow-button-primary: 0 1px 2px rgba(53, 87, 224, 0.25), 0 4px 12px rgba(53, 87, 224, 0.18);
|
|
185
|
+
|
|
152
186
|
/* =========================================================
|
|
153
187
|
SPACING SCALE — padding/margin/gap/inset. Named by their px
|
|
154
188
|
value for exactness; override one step or the whole scale.
|
|
@@ -185,7 +219,7 @@
|
|
|
185
219
|
--st-radius-xs: 4px;
|
|
186
220
|
--st-radius-sm: 8px;
|
|
187
221
|
--st-radius-md: 10px;
|
|
188
|
-
--st-radius-lg:
|
|
222
|
+
--st-radius-lg: 14px;
|
|
189
223
|
--st-radius-full: 999px;
|
|
190
224
|
--st-radius-circle: 50%;
|
|
191
225
|
|
|
@@ -209,7 +243,10 @@
|
|
|
209
243
|
/* =========================================================
|
|
210
244
|
TYPOGRAPHY TOKENS
|
|
211
245
|
========================================================= */
|
|
212
|
-
|
|
246
|
+
/* Inter is loaded by @sankhyatronics/sankhya-cms/fonts.css. */
|
|
247
|
+
--st-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
248
|
+
/* Figures (KPIs, amounts, table numbers) line up in columns. */
|
|
249
|
+
--st-numeric-features: tabular-nums;
|
|
213
250
|
|
|
214
251
|
--st-text-2xs: 10px;
|
|
215
252
|
--st-text-xs: 11px;
|
|
@@ -219,6 +256,9 @@
|
|
|
219
256
|
--st-text-lg: 15px;
|
|
220
257
|
--st-text-xl: 16px;
|
|
221
258
|
--st-text-2xl: 20px;
|
|
259
|
+
--st-text-3xl: 28px;
|
|
260
|
+
--st-text-kpi: 34px;
|
|
261
|
+
--st-text-hero: 40px;
|
|
222
262
|
|
|
223
263
|
--st-font-weight-regular: 400;
|
|
224
264
|
--st-font-weight-medium: 500;
|
|
@@ -234,6 +274,7 @@
|
|
|
234
274
|
--st-tracking-normal: 0;
|
|
235
275
|
--st-tracking-wide: 0.3px;
|
|
236
276
|
--st-tracking-wider: 0.4px;
|
|
277
|
+
--st-tracking-display: -0.02em;
|
|
237
278
|
|
|
238
279
|
/* =========================================================
|
|
239
280
|
COMPONENT TOKENS — narrowly-scoped overrides for one piece
|
|
@@ -257,10 +298,11 @@
|
|
|
257
298
|
--st-button-font-size-sm: var(--st-text-base);
|
|
258
299
|
--st-button-font-weight: var(--st-font-weight-semibold);
|
|
259
300
|
--st-button-height: var(--st-size-40);
|
|
260
|
-
--st-button-radius: var(--st-radius-
|
|
261
|
-
--st-button-primary-bg: var(--st-
|
|
301
|
+
--st-button-radius: var(--st-radius-md);
|
|
302
|
+
--st-button-primary-bg: var(--st-color-accent);
|
|
262
303
|
--st-button-primary-color: var(--st-color-on-solid);
|
|
263
|
-
--st-button-primary-font-weight: var(--st-font-weight-
|
|
304
|
+
--st-button-primary-font-weight: var(--st-font-weight-semibold);
|
|
305
|
+
--st-button-primary-shadow: var(--st-shadow-button-primary);
|
|
264
306
|
|
|
265
307
|
/* ---- Checkboxes/radios (native controls, tinted via accent-color).
|
|
266
308
|
`auto` = the browser's own color. ---- */
|
|
@@ -268,8 +310,8 @@
|
|
|
268
310
|
|
|
269
311
|
/* ---- Keyboard focus ring, an `outline` shorthand. `auto` = the
|
|
270
312
|
browser's own ring; e.g. `2px solid #0b5cff` for a custom one. ---- */
|
|
271
|
-
--st-focus-ring:
|
|
272
|
-
--st-focus-ring-offset:
|
|
313
|
+
--st-focus-ring: 2px solid var(--st-color-accent);
|
|
314
|
+
--st-focus-ring-offset: 2px;
|
|
273
315
|
|
|
274
316
|
/* ---- Text inputs (search boxes, file names, new folder, pattern) ---- */
|
|
275
317
|
--st-input-font-family: var(--st-font-family);
|
|
@@ -278,7 +320,14 @@
|
|
|
278
320
|
--st-input-color: var(--st-color-text-strong);
|
|
279
321
|
--st-input-bg: var(--st-color-surface);
|
|
280
322
|
--st-input-border-color: var(--st-color-border);
|
|
281
|
-
--st-input-radius: var(--st-radius-
|
|
323
|
+
--st-input-radius: var(--st-radius-md);
|
|
324
|
+
|
|
325
|
+
/* ---- Cards and page chrome ---- */
|
|
326
|
+
--st-card-radius: var(--st-radius-lg);
|
|
327
|
+
--st-card-padding: var(--st-space-24);
|
|
328
|
+
--st-card-shadow: var(--st-shadow-card);
|
|
329
|
+
--st-page-padding: var(--st-space-32) var(--st-space-40);
|
|
330
|
+
--st-page-gap: var(--st-space-20);
|
|
282
331
|
|
|
283
332
|
/* ---- Wizard frame (<st-template-hub>). Set --st-wizard-bg to
|
|
284
333
|
`transparent` to sit on the host app's own card/page. ---- */
|
package/dist/themes.css
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
--st-primary-color: oklch(97.913% 0.00011 271.152);
|
|
3
3
|
--st-primary-background: oklch(11.862% 0.03663 260.411 / 0.808);
|
|
4
4
|
--st-font-family: "Open Sans";
|
|
5
|
+
|
|
6
|
+
/* The light-theme literals in theme.css, re-set for dark. Not part of the
|
|
7
|
+
light design spec: these keep every surface, line and status readable. */
|
|
8
|
+
--st-primary-canvas: #1B1F2B;
|
|
9
|
+
--st-primary-accent: var(--st-brand-color, #6F8BFF);
|
|
10
|
+
--st-primary-line: #2A3142;
|
|
11
|
+
--st-primary-divider: #232937;
|
|
12
|
+
--st-primary-text-secondary: #B9C0CE;
|
|
13
|
+
--st-primary-text-muted: #9AA2B5;
|
|
14
|
+
--st-primary-brand-soft: #1E2A4F;
|
|
15
|
+
--st-primary-brand-ink: #AFC3FF;
|
|
16
|
+
--st-primary-success: #2FB97F;
|
|
17
|
+
--st-primary-warning: #E0893A;
|
|
18
|
+
--st-primary-danger: #E0576B;
|
|
19
|
+
--st-primary-success-soft: #123329;
|
|
20
|
+
--st-primary-warning-soft: #3A2A12;
|
|
21
|
+
--st-primary-danger-soft: #3B1A22;
|
|
22
|
+
--st-primary-success-text: #6EDCA9;
|
|
23
|
+
--st-primary-warning-text: #F5C27A;
|
|
24
|
+
--st-primary-danger-text: #FF9AA8;
|
|
5
25
|
}
|
|
6
26
|
|
|
7
27
|
:root.red {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyatronics/sankhya-cms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sankhyatronics/SankhyaCMS.git",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"./cms-theme.css": "./dist/cms-theme.css",
|
|
20
20
|
"./theme.css": "./dist/theme.css",
|
|
21
|
+
"./fonts.css": "./dist/fonts.css",
|
|
21
22
|
"./themes.css": "./dist/themes.css",
|
|
22
23
|
"./bento-grid": {
|
|
23
24
|
"types": "./dist/bento-grid/index.d.ts",
|
|
@@ -27,6 +28,30 @@
|
|
|
27
28
|
"types": "./dist/card/index.d.ts",
|
|
28
29
|
"import": "./dist/card/index.js"
|
|
29
30
|
},
|
|
31
|
+
"./attention-panel": {
|
|
32
|
+
"types": "./dist/attention-panel/index.d.ts",
|
|
33
|
+
"import": "./dist/attention-panel/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./bar-chart": {
|
|
36
|
+
"types": "./dist/bar-chart/index.d.ts",
|
|
37
|
+
"import": "./dist/bar-chart/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./chip": {
|
|
40
|
+
"types": "./dist/chip/index.d.ts",
|
|
41
|
+
"import": "./dist/chip/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./date-tile": {
|
|
44
|
+
"types": "./dist/date-tile/index.d.ts",
|
|
45
|
+
"import": "./dist/date-tile/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./kpi-card": {
|
|
48
|
+
"types": "./dist/kpi-card/index.d.ts",
|
|
49
|
+
"import": "./dist/kpi-card/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./segmented-control": {
|
|
52
|
+
"types": "./dist/segmented-control/index.d.ts",
|
|
53
|
+
"import": "./dist/segmented-control/index.js"
|
|
54
|
+
},
|
|
30
55
|
"./carousel": {
|
|
31
56
|
"types": "./dist/carousel/index.d.ts",
|
|
32
57
|
"import": "./dist/carousel/index.js"
|
|
@@ -135,6 +160,7 @@
|
|
|
135
160
|
],
|
|
136
161
|
"sideEffects": true,
|
|
137
162
|
"dependencies": {
|
|
163
|
+
"@fontsource/inter": "^5.3.0",
|
|
138
164
|
"dompurify": "^3.4.16",
|
|
139
165
|
"iconify-icon": "^3.0.3",
|
|
140
166
|
"lit": "^3.3.3",
|
|
@@ -151,7 +177,7 @@
|
|
|
151
177
|
"access": "public"
|
|
152
178
|
},
|
|
153
179
|
"scripts": {
|
|
154
|
-
"build": "tsup src/index.ts src/schema/index.ts src/theming/index.ts src/shared/styles.ts src/shared/icons.ts src/bento-grid/index.ts src/card/index.ts src/carousel/index.ts src/content-block/index.ts src/cookie-consent/index.ts src/dropdown/index.ts src/feature-split/index.ts src/features-section/index.ts src/footer/index.ts src/header/index.ts src/hero/index.ts src/icon-button/index.ts src/items-accordion/index.ts src/markdown/index.ts src/mega-menu/index.ts src/menu-grid/index.ts src/menu-grid-item/index.ts src/menu-item/index.ts src/promo-banner/index.ts src/section/index.ts src/select/index.ts src/stats/index.ts src/testimonials/index.ts --format esm --dts --sourcemap --clean && node scripts/copy-theme.mjs && cem analyze",
|
|
180
|
+
"build": "tsup src/index.ts src/schema/index.ts src/theming/index.ts src/shared/styles.ts src/shared/icons.ts src/attention-panel/index.ts src/bar-chart/index.ts src/chip/index.ts src/date-tile/index.ts src/kpi-card/index.ts src/segmented-control/index.ts src/bento-grid/index.ts src/card/index.ts src/carousel/index.ts src/content-block/index.ts src/cookie-consent/index.ts src/dropdown/index.ts src/feature-split/index.ts src/features-section/index.ts src/footer/index.ts src/header/index.ts src/hero/index.ts src/icon-button/index.ts src/items-accordion/index.ts src/markdown/index.ts src/mega-menu/index.ts src/menu-grid/index.ts src/menu-grid-item/index.ts src/menu-item/index.ts src/promo-banner/index.ts src/section/index.ts src/select/index.ts src/stats/index.ts src/testimonials/index.ts --format esm --dts --sourcemap --clean && node scripts/copy-theme.mjs && node scripts/copy-fonts.mjs && cem analyze",
|
|
155
181
|
"dev": "tsup src/index.ts --watch --format esm --dts",
|
|
156
182
|
"typecheck": "tsc --noEmit",
|
|
157
183
|
"lint": "oxlint",
|