@sankhyatronics/sankhya-cms 0.1.11 → 0.1.12

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.
@@ -31,6 +31,17 @@
31
31
  "default": "''",
32
32
  "description": "Bold line at the top of the panel.",
33
33
  "attribute": "heading"
34
+ },
35
+ {
36
+ "kind": "field",
37
+ "name": "hasIcon",
38
+ "type": {
39
+ "text": "boolean"
40
+ },
41
+ "default": "false",
42
+ "description": "Set when an element is slotted into `icon`, so the icon tile only renders with an icon.",
43
+ "attribute": "has-icon",
44
+ "reflects": true
34
45
  }
35
46
  ],
36
47
  "attributes": [
@@ -51,6 +62,15 @@
51
62
  "default": "''",
52
63
  "description": "Bold line at the top of the panel.",
53
64
  "fieldName": "heading"
65
+ },
66
+ {
67
+ "name": "has-icon",
68
+ "type": {
69
+ "text": "boolean"
70
+ },
71
+ "default": "false",
72
+ "description": "Set when an element is slotted into `icon`, so the icon tile only renders with an icon.",
73
+ "fieldName": "hasIcon"
54
74
  }
55
75
  ],
56
76
  "superclass": {
@@ -890,6 +910,192 @@
890
910
  }
891
911
  ]
892
912
  },
913
+ {
914
+ "kind": "javascript-module",
915
+ "path": "src/content-block/ContentBlock.ts",
916
+ "declarations": [
917
+ {
918
+ "kind": "class",
919
+ "description": "A long-form article section: centered title/subtitle, an optional featured image with caption,\nthen Markdown body text. Ports `SankhyaUI`'s React `ContentBlock`. The body comes from\n`content-src` (a Markdown URL, as in the source) or an inline `content` string (added so the\nblock works without a fetch); `content-src` wins when both are set.",
920
+ "name": "ContentBlock",
921
+ "cssProperties": [
922
+ {
923
+ "description": "Overrides the block's padding.",
924
+ "name": "--st-content-block-padding"
925
+ }
926
+ ],
927
+ "members": [
928
+ {
929
+ "kind": "field",
930
+ "name": "title",
931
+ "type": {
932
+ "text": "string"
933
+ },
934
+ "default": "''",
935
+ "attribute": "title"
936
+ },
937
+ {
938
+ "kind": "field",
939
+ "name": "subtitle",
940
+ "type": {
941
+ "text": "string"
942
+ },
943
+ "default": "''",
944
+ "attribute": "subtitle"
945
+ },
946
+ {
947
+ "kind": "field",
948
+ "name": "contentSrc",
949
+ "type": {
950
+ "text": "string"
951
+ },
952
+ "default": "''",
953
+ "description": "URL of a Markdown file.",
954
+ "attribute": "content-src"
955
+ },
956
+ {
957
+ "kind": "field",
958
+ "name": "content",
959
+ "type": {
960
+ "text": "string"
961
+ },
962
+ "default": "''",
963
+ "description": "Inline Markdown, used when `content-src` is not set.",
964
+ "attribute": "content"
965
+ },
966
+ {
967
+ "kind": "field",
968
+ "name": "imageSrc",
969
+ "type": {
970
+ "text": "string"
971
+ },
972
+ "default": "''",
973
+ "attribute": "image-src"
974
+ },
975
+ {
976
+ "kind": "field",
977
+ "name": "imageAlt",
978
+ "type": {
979
+ "text": "string"
980
+ },
981
+ "default": "''",
982
+ "attribute": "image-alt"
983
+ },
984
+ {
985
+ "kind": "field",
986
+ "name": "imageCaption",
987
+ "type": {
988
+ "text": "string"
989
+ },
990
+ "default": "''",
991
+ "attribute": "image-caption"
992
+ },
993
+ {
994
+ "kind": "field",
995
+ "name": "inverted",
996
+ "type": {
997
+ "text": "boolean"
998
+ },
999
+ "default": "false",
1000
+ "attribute": "inverted",
1001
+ "reflects": true
1002
+ }
1003
+ ],
1004
+ "attributes": [
1005
+ {
1006
+ "name": "title",
1007
+ "type": {
1008
+ "text": "string"
1009
+ },
1010
+ "default": "''",
1011
+ "fieldName": "title"
1012
+ },
1013
+ {
1014
+ "name": "subtitle",
1015
+ "type": {
1016
+ "text": "string"
1017
+ },
1018
+ "default": "''",
1019
+ "fieldName": "subtitle"
1020
+ },
1021
+ {
1022
+ "name": "content-src",
1023
+ "type": {
1024
+ "text": "string"
1025
+ },
1026
+ "default": "''",
1027
+ "description": "URL of a Markdown file.",
1028
+ "fieldName": "contentSrc"
1029
+ },
1030
+ {
1031
+ "name": "content",
1032
+ "type": {
1033
+ "text": "string"
1034
+ },
1035
+ "default": "''",
1036
+ "description": "Inline Markdown, used when `content-src` is not set.",
1037
+ "fieldName": "content"
1038
+ },
1039
+ {
1040
+ "name": "image-src",
1041
+ "type": {
1042
+ "text": "string"
1043
+ },
1044
+ "default": "''",
1045
+ "fieldName": "imageSrc"
1046
+ },
1047
+ {
1048
+ "name": "image-alt",
1049
+ "type": {
1050
+ "text": "string"
1051
+ },
1052
+ "default": "''",
1053
+ "fieldName": "imageAlt"
1054
+ },
1055
+ {
1056
+ "name": "image-caption",
1057
+ "type": {
1058
+ "text": "string"
1059
+ },
1060
+ "default": "''",
1061
+ "fieldName": "imageCaption"
1062
+ },
1063
+ {
1064
+ "name": "inverted",
1065
+ "type": {
1066
+ "text": "boolean"
1067
+ },
1068
+ "default": "false",
1069
+ "fieldName": "inverted"
1070
+ }
1071
+ ],
1072
+ "superclass": {
1073
+ "name": "LitElement",
1074
+ "package": "lit"
1075
+ },
1076
+ "tagName": "st-content-block",
1077
+ "customElement": true
1078
+ }
1079
+ ],
1080
+ "exports": [
1081
+ {
1082
+ "kind": "js",
1083
+ "name": "ContentBlock",
1084
+ "declaration": {
1085
+ "name": "ContentBlock",
1086
+ "module": "src/content-block/ContentBlock.ts"
1087
+ }
1088
+ },
1089
+ {
1090
+ "kind": "custom-element-definition",
1091
+ "name": "st-content-block",
1092
+ "declaration": {
1093
+ "name": "ContentBlock",
1094
+ "module": "src/content-block/ContentBlock.ts"
1095
+ }
1096
+ }
1097
+ ]
1098
+ },
893
1099
  {
894
1100
  "kind": "javascript-module",
895
1101
  "path": "src/chip/Chip.ts",
@@ -1178,192 +1384,6 @@
1178
1384
  }
1179
1385
  ]
1180
1386
  },
1181
- {
1182
- "kind": "javascript-module",
1183
- "path": "src/content-block/ContentBlock.ts",
1184
- "declarations": [
1185
- {
1186
- "kind": "class",
1187
- "description": "A long-form article section: centered title/subtitle, an optional featured image with caption,\nthen Markdown body text. Ports `SankhyaUI`'s React `ContentBlock`. The body comes from\n`content-src` (a Markdown URL, as in the source) or an inline `content` string (added so the\nblock works without a fetch); `content-src` wins when both are set.",
1188
- "name": "ContentBlock",
1189
- "cssProperties": [
1190
- {
1191
- "description": "Overrides the block's padding.",
1192
- "name": "--st-content-block-padding"
1193
- }
1194
- ],
1195
- "members": [
1196
- {
1197
- "kind": "field",
1198
- "name": "title",
1199
- "type": {
1200
- "text": "string"
1201
- },
1202
- "default": "''",
1203
- "attribute": "title"
1204
- },
1205
- {
1206
- "kind": "field",
1207
- "name": "subtitle",
1208
- "type": {
1209
- "text": "string"
1210
- },
1211
- "default": "''",
1212
- "attribute": "subtitle"
1213
- },
1214
- {
1215
- "kind": "field",
1216
- "name": "contentSrc",
1217
- "type": {
1218
- "text": "string"
1219
- },
1220
- "default": "''",
1221
- "description": "URL of a Markdown file.",
1222
- "attribute": "content-src"
1223
- },
1224
- {
1225
- "kind": "field",
1226
- "name": "content",
1227
- "type": {
1228
- "text": "string"
1229
- },
1230
- "default": "''",
1231
- "description": "Inline Markdown, used when `content-src` is not set.",
1232
- "attribute": "content"
1233
- },
1234
- {
1235
- "kind": "field",
1236
- "name": "imageSrc",
1237
- "type": {
1238
- "text": "string"
1239
- },
1240
- "default": "''",
1241
- "attribute": "image-src"
1242
- },
1243
- {
1244
- "kind": "field",
1245
- "name": "imageAlt",
1246
- "type": {
1247
- "text": "string"
1248
- },
1249
- "default": "''",
1250
- "attribute": "image-alt"
1251
- },
1252
- {
1253
- "kind": "field",
1254
- "name": "imageCaption",
1255
- "type": {
1256
- "text": "string"
1257
- },
1258
- "default": "''",
1259
- "attribute": "image-caption"
1260
- },
1261
- {
1262
- "kind": "field",
1263
- "name": "inverted",
1264
- "type": {
1265
- "text": "boolean"
1266
- },
1267
- "default": "false",
1268
- "attribute": "inverted",
1269
- "reflects": true
1270
- }
1271
- ],
1272
- "attributes": [
1273
- {
1274
- "name": "title",
1275
- "type": {
1276
- "text": "string"
1277
- },
1278
- "default": "''",
1279
- "fieldName": "title"
1280
- },
1281
- {
1282
- "name": "subtitle",
1283
- "type": {
1284
- "text": "string"
1285
- },
1286
- "default": "''",
1287
- "fieldName": "subtitle"
1288
- },
1289
- {
1290
- "name": "content-src",
1291
- "type": {
1292
- "text": "string"
1293
- },
1294
- "default": "''",
1295
- "description": "URL of a Markdown file.",
1296
- "fieldName": "contentSrc"
1297
- },
1298
- {
1299
- "name": "content",
1300
- "type": {
1301
- "text": "string"
1302
- },
1303
- "default": "''",
1304
- "description": "Inline Markdown, used when `content-src` is not set.",
1305
- "fieldName": "content"
1306
- },
1307
- {
1308
- "name": "image-src",
1309
- "type": {
1310
- "text": "string"
1311
- },
1312
- "default": "''",
1313
- "fieldName": "imageSrc"
1314
- },
1315
- {
1316
- "name": "image-alt",
1317
- "type": {
1318
- "text": "string"
1319
- },
1320
- "default": "''",
1321
- "fieldName": "imageAlt"
1322
- },
1323
- {
1324
- "name": "image-caption",
1325
- "type": {
1326
- "text": "string"
1327
- },
1328
- "default": "''",
1329
- "fieldName": "imageCaption"
1330
- },
1331
- {
1332
- "name": "inverted",
1333
- "type": {
1334
- "text": "boolean"
1335
- },
1336
- "default": "false",
1337
- "fieldName": "inverted"
1338
- }
1339
- ],
1340
- "superclass": {
1341
- "name": "LitElement",
1342
- "package": "lit"
1343
- },
1344
- "tagName": "st-content-block",
1345
- "customElement": true
1346
- }
1347
- ],
1348
- "exports": [
1349
- {
1350
- "kind": "js",
1351
- "name": "ContentBlock",
1352
- "declaration": {
1353
- "name": "ContentBlock",
1354
- "module": "src/content-block/ContentBlock.ts"
1355
- }
1356
- },
1357
- {
1358
- "kind": "custom-element-definition",
1359
- "name": "st-content-block",
1360
- "declaration": {
1361
- "name": "ContentBlock",
1362
- "module": "src/content-block/ContentBlock.ts"
1363
- }
1364
- }
1365
- ]
1366
- },
1367
1387
  {
1368
1388
  "kind": "javascript-module",
1369
1389
  "path": "src/date-tile/DateTile.ts",
@@ -14,6 +14,9 @@ declare class AttentionPanel extends LitElement {
14
14
  tone: 'accent' | 'warning' | 'danger';
15
15
  /** Bold line at the top of the panel. */
16
16
  heading: string;
17
+ /** Set when an element is slotted into `icon`, so the icon tile only renders with an icon. */
18
+ hasIcon: boolean;
19
+ connectedCallback(): void;
17
20
  render(): lit.TemplateResult<1>;
18
21
  }
19
22
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AttentionPanel
3
- } from "../chunk-TVE4EPVK.js";
3
+ } from "../chunk-4PXZPGWQ.js";
4
4
  import "../chunk-KMU6ABQF.js";
5
5
  import "../chunk-EUXUH3YW.js";
6
6
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BarChart
3
- } from "../chunk-2TPTJN36.js";
3
+ } from "../chunk-AG2COC64.js";
4
4
  import "../chunk-KMU6ABQF.js";
5
5
  import "../chunk-EUXUH3YW.js";
6
6
  export {
@@ -6,17 +6,22 @@ import {
6
6
  } from "./chunk-EUXUH3YW.js";
7
7
 
8
8
  // src/attention-panel/AttentionPanel.ts
9
- import { LitElement, css, html } from "lit";
9
+ import { LitElement, css, html, nothing } from "lit";
10
10
  import { customElement, property } from "lit/decorators.js";
11
11
  var AttentionPanel = class extends LitElement {
12
12
  constructor() {
13
13
  super(...arguments);
14
14
  this.tone = "accent";
15
15
  this.heading = "";
16
+ this.hasIcon = false;
17
+ }
18
+ connectedCallback() {
19
+ super.connectedCallback();
20
+ this.hasIcon = this.querySelector('[slot="icon"]') !== null;
16
21
  }
17
22
  render() {
18
23
  return html`
19
- <span class="icon" part="icon"><slot name="icon"></slot></span>
24
+ ${this.hasIcon ? html`<span class="icon" part="icon"><slot name="icon"></slot></span>` : nothing}
20
25
  <div class="body">
21
26
  <p class="title" part="title">${this.heading}</p>
22
27
  <div class="detail" part="detail"><slot></slot></div>
@@ -109,6 +114,9 @@ __decorateClass([
109
114
  __decorateClass([
110
115
  property({ type: String })
111
116
  ], AttentionPanel.prototype, "heading", 2);
117
+ __decorateClass([
118
+ property({ type: Boolean, reflect: true, attribute: "has-icon" })
119
+ ], AttentionPanel.prototype, "hasIcon", 2);
112
120
  AttentionPanel = __decorateClass([
113
121
  customElement("st-attention-panel")
114
122
  ], AttentionPanel);
@@ -116,4 +124,4 @@ AttentionPanel = __decorateClass([
116
124
  export {
117
125
  AttentionPanel
118
126
  };
119
- //# sourceMappingURL=chunk-TVE4EPVK.js.map
127
+ //# sourceMappingURL=chunk-4PXZPGWQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/attention-panel/AttentionPanel.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\n/**\n * A tinted panel that calls out the most serious item needing action: an icon, a title, a line of\n * detail and an action link. `tone` picks the colour: `warning` (amber) for things due soon,\n * `danger` (red) for overdue or failing items, `accent` (blue) for set-up tips.\n *\n * Slots: `icon` (a glyph beside the title), default (the detail text), `action` (a link or button).\n */\n@customElement('st-attention-panel')\nexport class AttentionPanel extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: flex;\n align-items: flex-start;\n gap: var(--st-space-12);\n padding: var(--st-space-16);\n border-radius: var(--st-radius-md);\n background: var(--st-color-accent-subtle);\n color: var(--st-color-text);\n }\n\n :host([tone='warning']) {\n background: var(--st-color-warning-subtle);\n }\n\n :host([tone='danger']) {\n background: var(--st-color-danger-subtle);\n }\n\n .icon {\n display: inline-grid;\n place-items: center;\n width: 32px;\n height: 32px;\n border-radius: var(--st-radius-sm);\n background: var(--st-color-surface);\n flex: none;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n gap: var(--st-space-4);\n min-width: 0;\n flex: 1;\n }\n\n .title {\n margin: 0;\n font-size: var(--st-text-lg);\n font-weight: var(--st-font-weight-semibold);\n color: var(--st-color-text-strong);\n }\n\n .detail {\n font-size: var(--st-text-base);\n line-height: 1.5;\n color: var(--st-color-text-secondary);\n }\n\n .action {\n margin-top: var(--st-space-6);\n font-size: var(--st-text-base);\n font-weight: var(--st-font-weight-semibold);\n }\n\n :host([tone='warning']) .action {\n color: var(--st-color-warning-text);\n }\n\n :host([tone='danger']) .action {\n color: var(--st-color-danger-text);\n }\n\n :host([tone='accent']) .action {\n color: var(--st-color-accent-text);\n }\n\n .action:empty {\n display: none;\n }\n\n .icon:empty {\n display: none;\n }\n `;\n\n /** Colour of the panel: `accent` for tips, `warning` for due soon, `danger` for overdue. */\n @property({ type: String, reflect: true })\n tone: 'accent' | 'warning' | 'danger' = 'accent';\n\n /** Bold line at the top of the panel. */\n @property({ type: String })\n heading = '';\n\n /** Set when an element is slotted into `icon`, so the icon tile only renders with an icon. */\n @property({ type: Boolean, reflect: true, attribute: 'has-icon' })\n hasIcon = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.hasIcon = this.querySelector('[slot=\"icon\"]') !== null;\n }\n\n render() {\n return html`\n ${this.hasIcon ? html`<span class=\"icon\" part=\"icon\"><slot name=\"icon\"></slot></span>` : nothing}\n <div class=\"body\">\n <p class=\"title\" part=\"title\">${this.heading}</p>\n <div class=\"detail\" part=\"detail\"><slot></slot></div>\n <div class=\"action\" part=\"action\"><slot name=\"action\"></slot></div>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,gBAAgB;AAYjC,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAAxC;AAAA;AAkFL,gBAAwC;AAIxC,mBAAU;AAIV,mBAAU;AAAA;AAAA,EAEV,oBAAoB;AAClB,UAAM,kBAAkB;AACxB,SAAK,UAAU,KAAK,cAAc,eAAe,MAAM;AAAA,EACzD;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,QACH,KAAK,UAAU,wEAAwE,OAAO;AAAA;AAAA,wCAE9D,KAAK,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlD;AACF;AA3Ga,eACJ,SAAS;AAAA,MACZ,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgFpB;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAjF9B,eAkFX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GArFf,eAsFX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,WAAW,CAAC;AAAA,GAzFtD,eA0FX;AA1FW,iBAAN;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB;","names":[]}
@@ -149,6 +149,7 @@ BarChart.styles = css`
149
149
 
150
150
  .bar {
151
151
  width: 100%;
152
+ height: 100%;
152
153
  border-radius: 4px 4px 0 0;
153
154
  background: var(--st-color-accent);
154
155
  min-height: 2px;
@@ -213,4 +214,4 @@ BarChart = __decorateClass([
213
214
  export {
214
215
  BarChart
215
216
  };
216
- //# sourceMappingURL=chunk-2TPTJN36.js.map
217
+ //# sourceMappingURL=chunk-AG2COC64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bar-chart/BarChart.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\nexport interface BarChartBar {\n /** Category under the bar (for example a month abbreviation). */\n label: string;\n /** Bar height in the chart's units. `null` draws a grey stub, for periods not reached yet. */\n value: number | null;\n /** The value text above the bar. Format it before passing it in (for example \"5.74 L\"). */\n valueLabel?: string;\n /** Highlights this bar in the lighter accent, for the current period. */\n current?: boolean;\n}\n\nexport interface BarChartTick {\n /** Height of the gridline, in the chart's units. */\n value: number;\n /** Text at the left edge of the gridline, already formatted. */\n label: string;\n}\n\n/**\n * A vertical bar chart for a fixed set of categories: value labels above the bars, gridlines with\n * labels on the left, and category labels underneath. Heights scale to `max`, or to the largest\n * bar or tick when `max` is not set. Values are not formatted here: pass `valueLabel` and tick\n * labels already formatted (currency, lakh/crore), so this element stays locale-free.\n */\n@customElement('st-bar-chart')\nexport class BarChart extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: block;\n min-width: 0;\n color: var(--st-color-text-muted);\n }\n\n .frame {\n position: relative;\n display: grid;\n grid-template-columns: auto 1fr;\n column-gap: var(--st-space-10);\n }\n\n .axis {\n position: relative;\n height: var(--st-bar-chart-height, 200px);\n font-size: var(--st-text-xs);\n font-variant-numeric: tabular-nums;\n }\n\n .axis span {\n position: absolute;\n right: 0;\n transform: translateY(50%);\n white-space: nowrap;\n }\n\n .plot {\n position: relative;\n height: var(--st-bar-chart-height, 200px);\n border-bottom: 1px solid var(--st-color-border);\n }\n\n .grid {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n .grid i {\n position: absolute;\n left: 0;\n right: 0;\n border-top: 1px dashed var(--st-color-border);\n }\n\n .bars {\n position: absolute;\n inset: 0;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n align-items: end;\n gap: var(--st-space-8);\n }\n\n .col {\n position: relative;\n height: 100%;\n min-width: 0;\n }\n\n /* The bar and its value label share one box, anchored to the baseline, so the label always\n sits just above the bar's top edge. */\n .stack {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n .value {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 100%;\n padding-bottom: var(--st-space-4);\n text-align: center;\n font-size: var(--st-text-xs);\n font-weight: var(--st-font-weight-medium);\n white-space: nowrap;\n color: var(--st-color-text-secondary);\n }\n\n .bar {\n width: 100%;\n height: 100%;\n border-radius: 4px 4px 0 0;\n background: var(--st-color-accent);\n min-height: 2px;\n }\n\n .col[data-state='current'] .bar {\n background: color-mix(in oklch, var(--st-color-accent) 70%, #ffffff);\n }\n\n .col[data-state='future'] .bar {\n background: var(--st-color-subtle);\n min-height: 4px;\n }\n\n .col[data-state='current'] .value {\n color: var(--st-color-accent-text);\n font-weight: var(--st-font-weight-semibold);\n }\n\n .categories {\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n gap: var(--st-space-8);\n margin-top: var(--st-space-8);\n font-size: var(--st-text-xs);\n text-align: center;\n }\n\n .categories .current {\n font-weight: var(--st-font-weight-semibold);\n color: var(--st-color-accent-text);\n }\n\n .empty {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 120px;\n font-size: var(--st-text-base);\n }\n `;\n\n /** The bars, in order from left to right. */\n @property({ attribute: false })\n bars: BarChartBar[] = [];\n\n /** Optional gridlines with labels. */\n @property({ attribute: false })\n ticks: BarChartTick[] = [];\n\n /** The value that maps to the top of the plot. Defaults to the largest bar or tick. */\n @property({ type: Number })\n max: number | null = null;\n\n /** Plot height in pixels, excluding category labels. */\n @property({ type: Number, attribute: 'plot-height' })\n plotHeight = 200;\n\n /** Accessible name for the chart. */\n @property({ type: String, attribute: 'chart-label' })\n chartLabel = '';\n\n private topValue(): number {\n if (this.max !== null && this.max > 0) return this.max;\n const values = [...this.bars.map(bar => bar.value ?? 0), ...this.ticks.map(tick => tick.value)];\n return Math.max(...values, 0) || 1;\n }\n\n private heightPct(value: number | null): number {\n if (value === null) return 0;\n return Math.max(0, Math.min(100, (value / this.topValue()) * 100));\n }\n\n render() {\n if (!this.bars.length) {\n return html`<div class=\"empty\">${this.chartLabel || nothing}</div>`;\n }\n const top = this.topValue();\n return html`\n <div class=\"frame\" role=\"img\" aria-label=${this.chartLabel || nothing} style=\"--st-bar-chart-height: ${this.plotHeight}px\">\n <div class=\"axis\" aria-hidden=\"true\">\n ${this.ticks.map(tick => html`<span style=\"bottom: ${(tick.value / top) * 100}%\">${tick.label}</span>`)}\n </div>\n <div class=\"plot\">\n <div class=\"grid\" aria-hidden=\"true\">\n ${this.ticks.map(tick => html`<i style=\"bottom: ${(tick.value / top) * 100}%\"></i>`)}\n </div>\n <div class=\"bars\">\n ${this.bars.map(bar => {\n const state = bar.value === null ? 'future' : bar.current ? 'current' : 'default';\n return html`<div class=\"col\" data-state=${state} title=${bar.valueLabel ?? bar.label}>\n <div class=\"stack\" style=\"height: ${this.heightPct(bar.value)}%\">\n ${bar.valueLabel ? html`<span class=\"value\">${bar.valueLabel}</span>` : nothing}\n <div class=\"bar\"></div>\n </div>\n </div>`;\n })}\n </div>\n </div>\n <div></div>\n <div class=\"categories\" aria-hidden=\"true\">\n ${this.bars.map(bar => html`<span class=${bar.current ? 'current' : ''}>${bar.label}</span>`)}\n </div>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,gBAAgB;AA6BjC,IAAM,WAAN,cAAuB,WAAW;AAAA,EAAlC;AAAA;AAwIL,gBAAsB,CAAC;AAIvB,iBAAwB,CAAC;AAIzB,eAAqB;AAIrB,sBAAa;AAIb,sBAAa;AAAA;AAAA,EAEL,WAAmB;AACzB,QAAI,KAAK,QAAQ,QAAQ,KAAK,MAAM,EAAG,QAAO,KAAK;AACnD,UAAM,SAAS,CAAC,GAAG,KAAK,KAAK,IAAI,SAAO,IAAI,SAAS,CAAC,GAAG,GAAG,KAAK,MAAM,IAAI,UAAQ,KAAK,KAAK,CAAC;AAC9F,WAAO,KAAK,IAAI,GAAG,QAAQ,CAAC,KAAK;AAAA,EACnC;AAAA,EAEQ,UAAU,OAA8B;AAC9C,QAAI,UAAU,KAAM,QAAO;AAC3B,WAAO,KAAK,IAAI,GAAG,KAAK,IAAI,KAAM,QAAQ,KAAK,SAAS,IAAK,GAAG,CAAC;AAAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsIpB;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAvInB,SAwIX;AAIA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA3InB,SA4IX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA/If,SAgJX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAnJzC,SAoJX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAvJzC,SAwJX;AAxJW,WAAN;AAAA,EADN,cAAc,cAAc;AAAA,GAChB;","names":[]}
@@ -137,6 +137,11 @@ KpiCard.styles = css`
137
137
  color: var(--st-color-text-muted);
138
138
  }
139
139
 
140
+ :host([hero]) ::slotted(st-chip) {
141
+ background: color-mix(in oklch, var(--st-color-on-solid) 18%, transparent);
142
+ color: var(--st-color-on-solid);
143
+ }
144
+
140
145
  :host([hero]) .sub {
141
146
  color: var(--st-color-on-solid);
142
147
  opacity: 0.85;
@@ -182,4 +187,4 @@ KpiCard = __decorateClass([
182
187
  export {
183
188
  KpiCard
184
189
  };
185
- //# sourceMappingURL=chunk-YLY5DXQE.js.map
190
+ //# sourceMappingURL=chunk-T55CG4YG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/kpi-card/KpiCard.ts"],"sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { cardShellStyles, fontFamilyStyles } from '../shared/styles';\n\n/**\n * A key-figure card for dashboards: a label, one large value with an optional unit (for example\n * \"lakh\" or \"crore\"), a secondary line, and a row of chips. The `icon` slot sits beside the label.\n * `hero` gives the blue gradient card used for the headline figure. The value is shown exactly as\n * passed in: format numbers (Indian grouping, currency symbols) before setting it.\n *\n * Slots: `icon` (optional glyph), `chips` (a row of `st-chip`), `footer` (anything below the chips).\n */\n@customElement('st-kpi-card')\nexport class KpiCard extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: flex;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n padding: var(--st-space-20);\n ${cardShellStyles}\n color: var(--st-color-text);\n }\n\n :host([hero]) {\n position: relative;\n overflow: hidden;\n border: 0;\n background: linear-gradient(135deg, var(--st-color-accent) 0%, color-mix(in oklch, var(--st-color-accent) 70%, #3aa8e8) 100%);\n color: var(--st-color-on-solid);\n }\n\n :host([hero])::after {\n content: '';\n position: absolute;\n top: -40%;\n right: -20%;\n width: 60%;\n padding-bottom: 60%;\n border-radius: var(--st-radius-circle);\n background: color-mix(in oklch, var(--st-color-on-solid) 10%, transparent);\n pointer-events: none;\n }\n\n .head {\n display: flex;\n align-items: center;\n gap: var(--st-space-10);\n min-height: 32px;\n font-size: var(--st-text-md);\n font-weight: var(--st-font-weight-medium);\n color: var(--st-color-text-secondary);\n }\n\n :host([hero]) .head {\n color: var(--st-color-on-solid);\n opacity: 0.85;\n }\n\n .icon {\n display: inline-grid;\n place-items: center;\n width: 32px;\n height: 32px;\n border-radius: var(--st-radius-sm);\n background: var(--st-color-accent-subtle);\n flex: none;\n }\n\n :host(:not([has-icon])) .icon {\n display: none;\n }\n\n .value {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: var(--st-space-6);\n margin-top: var(--st-space-14);\n font-size: var(--st-text-kpi);\n font-weight: var(--st-font-weight-bold);\n line-height: 1.1;\n letter-spacing: -0.02em;\n font-variant-numeric: tabular-nums;\n color: var(--st-color-text-strong);\n }\n\n :host([hero]) .value {\n color: var(--st-color-on-solid);\n font-size: var(--st-text-hero);\n }\n\n .unit {\n font-size: var(--st-text-lg);\n font-weight: var(--st-font-weight-medium);\n color: var(--st-color-text-secondary);\n }\n\n :host([hero]) .unit {\n color: var(--st-color-on-solid);\n opacity: 0.85;\n }\n\n .sub {\n margin-top: var(--st-space-6);\n font-size: var(--st-text-base);\n color: var(--st-color-text-muted);\n }\n\n :host([hero]) .sub {\n color: var(--st-color-on-solid);\n opacity: 0.85;\n }\n\n .chips {\n display: flex;\n flex-wrap: wrap;\n gap: var(--st-space-8);\n margin-top: var(--st-space-14);\n }\n\n .chips:empty {\n display: none;\n }\n\n .footer:empty {\n display: none;\n }\n `;\n\n /** Label above the figure. */\n @property({ type: String })\n label = '';\n\n /** The figure, already formatted (for example \"25.88\"). */\n @property({ type: String })\n value = '';\n\n /** Unit shown beside the figure (for example \"lakh\"). */\n @property({ type: String })\n unit = '';\n\n /** Secondary line below the figure (for example the exact amount and the period). */\n @property({ type: String })\n sub = '';\n\n /** The blue gradient headline card. */\n @property({ type: Boolean, reflect: true })\n hero = false;\n\n /** Set when an element is slotted into `icon`, so the icon tile only shows when there is an icon. */\n @property({ type: Boolean, reflect: true, attribute: 'has-icon' })\n hasIcon = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.hasIcon = this.querySelector('[slot=\"icon\"]') !== null;\n }\n\n render() {\n return html`\n <div class=\"head\" part=\"head\">\n <span class=\"icon\" part=\"icon\"><slot name=\"icon\"></slot></span>\n <span part=\"label\">${this.label}</span>\n </div>\n <div class=\"value\" part=\"value\">\n <span>${this.value}</span>\n ${this.unit ? html`<span class=\"unit\" part=\"unit\">${this.unit}</span>` : ''}\n </div>\n ${this.sub ? html`<div class=\"sub\" part=\"sub\">${this.sub}</div>` : ''}\n <div class=\"chips\" part=\"chips\"><slot name=\"chips\"></slot></div>\n <div class=\"footer\" part=\"footer\"><slot name=\"footer\"></slot></div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,YAAY,KAAK,YAAY;AACtC,SAAS,eAAe,gBAAgB;AAajC,IAAM,UAAN,cAAsB,WAAW;AAAA,EAAjC;AAAA;AA0HL,iBAAQ;AAIR,iBAAQ;AAIR,gBAAO;AAIP,eAAM;AAIN,gBAAO;AAIP,mBAAU;AAAA;AAAA,EAEV,oBAAoB;AAClB,UAAM,kBAAkB;AACxB,SAAK,UAAU,KAAK,cAAc,eAAe,MAAM;AAAA,EACzD;AAAA,EAEA,SAAS;AACP,WAAO;AAAA;AAAA;AAAA,6BAGkB,KAAK,KAAK;AAAA;AAAA;AAAA,gBAGvB,KAAK,KAAK;AAAA,UAChB,KAAK,OAAO,sCAAsC,KAAK,IAAI,YAAY,EAAE;AAAA;AAAA,QAE3E,KAAK,MAAM,mCAAmC,KAAK,GAAG,WAAW,EAAE;AAAA;AAAA;AAAA;AAAA,EAIzE;AACF;AApKa,QACJ,SAAS;AAAA,MACZ,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQd,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgHrB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAzHf,QA0HX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA7Hf,QA8HX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAjIf,QAkIX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GArIf,QAsIX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAzI/B,QA0IX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,WAAW,CAAC;AAAA,GA7ItD,QA8IX;AA9IW,UAAN;AAAA,EADN,cAAc,aAAa;AAAA,GACf;","names":[]}
1
+ {"version":3,"sources":["../src/kpi-card/KpiCard.ts"],"sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { cardShellStyles, fontFamilyStyles } from '../shared/styles';\n\n/**\n * A key-figure card for dashboards: a label, one large value with an optional unit (for example\n * \"lakh\" or \"crore\"), a secondary line, and a row of chips. The `icon` slot sits beside the label.\n * `hero` gives the blue gradient card used for the headline figure. The value is shown exactly as\n * passed in: format numbers (Indian grouping, currency symbols) before setting it.\n *\n * Slots: `icon` (optional glyph), `chips` (a row of `st-chip`), `footer` (anything below the chips).\n */\n@customElement('st-kpi-card')\nexport class KpiCard extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: flex;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n padding: var(--st-space-20);\n ${cardShellStyles}\n color: var(--st-color-text);\n }\n\n :host([hero]) {\n position: relative;\n overflow: hidden;\n border: 0;\n background: linear-gradient(135deg, var(--st-color-accent) 0%, color-mix(in oklch, var(--st-color-accent) 70%, #3aa8e8) 100%);\n color: var(--st-color-on-solid);\n }\n\n :host([hero])::after {\n content: '';\n position: absolute;\n top: -40%;\n right: -20%;\n width: 60%;\n padding-bottom: 60%;\n border-radius: var(--st-radius-circle);\n background: color-mix(in oklch, var(--st-color-on-solid) 10%, transparent);\n pointer-events: none;\n }\n\n .head {\n display: flex;\n align-items: center;\n gap: var(--st-space-10);\n min-height: 32px;\n font-size: var(--st-text-md);\n font-weight: var(--st-font-weight-medium);\n color: var(--st-color-text-secondary);\n }\n\n :host([hero]) .head {\n color: var(--st-color-on-solid);\n opacity: 0.85;\n }\n\n .icon {\n display: inline-grid;\n place-items: center;\n width: 32px;\n height: 32px;\n border-radius: var(--st-radius-sm);\n background: var(--st-color-accent-subtle);\n flex: none;\n }\n\n :host(:not([has-icon])) .icon {\n display: none;\n }\n\n .value {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: var(--st-space-6);\n margin-top: var(--st-space-14);\n font-size: var(--st-text-kpi);\n font-weight: var(--st-font-weight-bold);\n line-height: 1.1;\n letter-spacing: -0.02em;\n font-variant-numeric: tabular-nums;\n color: var(--st-color-text-strong);\n }\n\n :host([hero]) .value {\n color: var(--st-color-on-solid);\n font-size: var(--st-text-hero);\n }\n\n .unit {\n font-size: var(--st-text-lg);\n font-weight: var(--st-font-weight-medium);\n color: var(--st-color-text-secondary);\n }\n\n :host([hero]) .unit {\n color: var(--st-color-on-solid);\n opacity: 0.85;\n }\n\n .sub {\n margin-top: var(--st-space-6);\n font-size: var(--st-text-base);\n color: var(--st-color-text-muted);\n }\n\n :host([hero]) ::slotted(st-chip) {\n background: color-mix(in oklch, var(--st-color-on-solid) 18%, transparent);\n color: var(--st-color-on-solid);\n }\n\n :host([hero]) .sub {\n color: var(--st-color-on-solid);\n opacity: 0.85;\n }\n\n .chips {\n display: flex;\n flex-wrap: wrap;\n gap: var(--st-space-8);\n margin-top: var(--st-space-14);\n }\n\n .chips:empty {\n display: none;\n }\n\n .footer:empty {\n display: none;\n }\n `;\n\n /** Label above the figure. */\n @property({ type: String })\n label = '';\n\n /** The figure, already formatted (for example \"25.88\"). */\n @property({ type: String })\n value = '';\n\n /** Unit shown beside the figure (for example \"lakh\"). */\n @property({ type: String })\n unit = '';\n\n /** Secondary line below the figure (for example the exact amount and the period). */\n @property({ type: String })\n sub = '';\n\n /** The blue gradient headline card. */\n @property({ type: Boolean, reflect: true })\n hero = false;\n\n /** Set when an element is slotted into `icon`, so the icon tile only shows when there is an icon. */\n @property({ type: Boolean, reflect: true, attribute: 'has-icon' })\n hasIcon = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.hasIcon = this.querySelector('[slot=\"icon\"]') !== null;\n }\n\n render() {\n return html`\n <div class=\"head\" part=\"head\">\n <span class=\"icon\" part=\"icon\"><slot name=\"icon\"></slot></span>\n <span part=\"label\">${this.label}</span>\n </div>\n <div class=\"value\" part=\"value\">\n <span>${this.value}</span>\n ${this.unit ? html`<span class=\"unit\" part=\"unit\">${this.unit}</span>` : ''}\n </div>\n ${this.sub ? html`<div class=\"sub\" part=\"sub\">${this.sub}</div>` : ''}\n <div class=\"chips\" part=\"chips\"><slot name=\"chips\"></slot></div>\n <div class=\"footer\" part=\"footer\"><slot name=\"footer\"></slot></div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,YAAY,KAAK,YAAY;AACtC,SAAS,eAAe,gBAAgB;AAajC,IAAM,UAAN,cAAsB,WAAW;AAAA,EAAjC;AAAA;AA+HL,iBAAQ;AAIR,iBAAQ;AAIR,gBAAO;AAIP,eAAM;AAIN,gBAAO;AAIP,mBAAU;AAAA;AAAA,EAEV,oBAAoB;AAClB,UAAM,kBAAkB;AACxB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IA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAtIf,QAuIX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA1If,QA2IX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GA9I/B,QA+IX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,WAAW,CAAC;AAAA,GAlJtD,QAmJX;AAnJW,UAAN;AAAA,EADN,cAAc,aAAa;AAAA,GACf;","names":[]}
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-ALI26WOB.js";
25
25
  import {
26
26
  KpiCard
27
- } from "./chunk-YLY5DXQE.js";
27
+ } from "./chunk-T55CG4YG.js";
28
28
  import {
29
29
  MegaMenu,
30
30
  MegaMenuColumn,
@@ -67,10 +67,10 @@ import {
67
67
  } from "./chunk-JKBWZLG4.js";
68
68
  import {
69
69
  AttentionPanel
70
- } from "./chunk-TVE4EPVK.js";
70
+ } from "./chunk-4PXZPGWQ.js";
71
71
  import {
72
72
  BarChart
73
- } from "./chunk-2TPTJN36.js";
73
+ } from "./chunk-AG2COC64.js";
74
74
  import {
75
75
  BentoGrid
76
76
  } from "./chunk-76AVBQUA.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  KpiCard
3
- } from "../chunk-YLY5DXQE.js";
3
+ } from "../chunk-T55CG4YG.js";
4
4
  import "../chunk-KMU6ABQF.js";
5
5
  import "../chunk-EUXUH3YW.js";
6
6
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyatronics/sankhya-cms",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sankhyatronics/SankhyaCMS.git",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/bar-chart/BarChart.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\nexport interface BarChartBar {\n /** Category under the bar (for example a month abbreviation). */\n label: string;\n /** Bar height in the chart's units. `null` draws a grey stub, for periods not reached yet. */\n value: number | null;\n /** The value text above the bar. Format it before passing it in (for example \"5.74 L\"). */\n valueLabel?: string;\n /** Highlights this bar in the lighter accent, for the current period. */\n current?: boolean;\n}\n\nexport interface BarChartTick {\n /** Height of the gridline, in the chart's units. */\n value: number;\n /** Text at the left edge of the gridline, already formatted. */\n label: string;\n}\n\n/**\n * A vertical bar chart for a fixed set of categories: value labels above the bars, gridlines with\n * labels on the left, and category labels underneath. Heights scale to `max`, or to the largest\n * bar or tick when `max` is not set. Values are not formatted here: pass `valueLabel` and tick\n * labels already formatted (currency, lakh/crore), so this element stays locale-free.\n */\n@customElement('st-bar-chart')\nexport class BarChart extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: block;\n min-width: 0;\n color: var(--st-color-text-muted);\n }\n\n .frame {\n position: relative;\n display: grid;\n grid-template-columns: auto 1fr;\n column-gap: var(--st-space-10);\n }\n\n .axis {\n position: relative;\n height: var(--st-bar-chart-height, 200px);\n font-size: var(--st-text-xs);\n font-variant-numeric: tabular-nums;\n }\n\n .axis span {\n position: absolute;\n right: 0;\n transform: translateY(50%);\n white-space: nowrap;\n }\n\n .plot {\n position: relative;\n height: var(--st-bar-chart-height, 200px);\n border-bottom: 1px solid var(--st-color-border);\n }\n\n .grid {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n .grid i {\n position: absolute;\n left: 0;\n right: 0;\n border-top: 1px dashed var(--st-color-border);\n }\n\n .bars {\n position: absolute;\n inset: 0;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n align-items: end;\n gap: var(--st-space-8);\n }\n\n .col {\n position: relative;\n height: 100%;\n min-width: 0;\n }\n\n /* The bar and its value label share one box, anchored to the baseline, so the label always\n sits just above the bar's top edge. */\n .stack {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n .value {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 100%;\n padding-bottom: var(--st-space-4);\n text-align: center;\n font-size: var(--st-text-xs);\n font-weight: var(--st-font-weight-medium);\n white-space: nowrap;\n color: var(--st-color-text-secondary);\n }\n\n .bar {\n width: 100%;\n border-radius: 4px 4px 0 0;\n background: var(--st-color-accent);\n min-height: 2px;\n }\n\n .col[data-state='current'] .bar {\n background: color-mix(in oklch, var(--st-color-accent) 70%, #ffffff);\n }\n\n .col[data-state='future'] .bar {\n background: var(--st-color-subtle);\n min-height: 4px;\n }\n\n .col[data-state='current'] .value {\n color: var(--st-color-accent-text);\n font-weight: var(--st-font-weight-semibold);\n }\n\n .categories {\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n gap: var(--st-space-8);\n margin-top: var(--st-space-8);\n font-size: var(--st-text-xs);\n text-align: center;\n }\n\n .categories .current {\n font-weight: var(--st-font-weight-semibold);\n color: var(--st-color-accent-text);\n }\n\n .empty {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 120px;\n font-size: var(--st-text-base);\n }\n `;\n\n /** The bars, in order from left to right. */\n @property({ attribute: false })\n bars: BarChartBar[] = [];\n\n /** Optional gridlines with labels. */\n @property({ attribute: false })\n ticks: BarChartTick[] = [];\n\n /** The value that maps to the top of the plot. Defaults to the largest bar or tick. */\n @property({ type: Number })\n max: number | null = null;\n\n /** Plot height in pixels, excluding category labels. */\n @property({ type: Number, attribute: 'plot-height' })\n plotHeight = 200;\n\n /** Accessible name for the chart. */\n @property({ type: String, attribute: 'chart-label' })\n chartLabel = '';\n\n private topValue(): number {\n if (this.max !== null && this.max > 0) return this.max;\n const values = [...this.bars.map(bar => bar.value ?? 0), ...this.ticks.map(tick => tick.value)];\n return Math.max(...values, 0) || 1;\n }\n\n private heightPct(value: number | null): number {\n if (value === null) return 0;\n return Math.max(0, Math.min(100, (value / this.topValue()) * 100));\n }\n\n render() {\n if (!this.bars.length) {\n return html`<div class=\"empty\">${this.chartLabel || nothing}</div>`;\n }\n const top = this.topValue();\n return html`\n <div class=\"frame\" role=\"img\" aria-label=${this.chartLabel || nothing} style=\"--st-bar-chart-height: ${this.plotHeight}px\">\n <div class=\"axis\" aria-hidden=\"true\">\n ${this.ticks.map(tick => html`<span style=\"bottom: ${(tick.value / top) * 100}%\">${tick.label}</span>`)}\n </div>\n <div class=\"plot\">\n <div class=\"grid\" aria-hidden=\"true\">\n ${this.ticks.map(tick => html`<i style=\"bottom: ${(tick.value / top) * 100}%\"></i>`)}\n </div>\n <div class=\"bars\">\n ${this.bars.map(bar => {\n const state = bar.value === null ? 'future' : bar.current ? 'current' : 'default';\n return html`<div class=\"col\" data-state=${state} title=${bar.valueLabel ?? bar.label}>\n <div class=\"stack\" style=\"height: ${this.heightPct(bar.value)}%\">\n ${bar.valueLabel ? html`<span class=\"value\">${bar.valueLabel}</span>` : nothing}\n <div class=\"bar\"></div>\n </div>\n </div>`;\n })}\n </div>\n </div>\n <div></div>\n <div class=\"categories\" aria-hidden=\"true\">\n ${this.bars.map(bar => html`<span class=${bar.current ? 'current' : ''}>${bar.label}</span>`)}\n </div>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,gBAAgB;AA6BjC,IAAM,WAAN,cAAuB,WAAW;AAAA,EAAlC;AAAA;AAuIL,gBAAsB,CAAC;AAIvB,iBAAwB,CAAC;AAIzB,eAAqB;AAIrB,sBAAa;AAIb,sBAAa;AAAA;AAAA,EAEL,WAAmB;AACzB,QAAI,KAAK,QAAQ,QAAQ,KAAK,MAAM,EAAG,QAAO,KAAK;AACnD,UAAM,SAAS,CAAC,GAAG,KAAK,KAAK,IAAI,SAAO,IAAI,SAAS,CAAC,GAAG,GAAG,KAAK,MAAM,IAAI,UAAQ,KAAK,KAAK,CAAC;AAC9F,WAA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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqIpB;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAtInB,SAuIX;AAIA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA1InB,SA2IX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA9If,SA+IX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAlJzC,SAmJX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAtJzC,SAuJX;AAvJW,WAAN;AAAA,EADN,cAAc,cAAc;AAAA,GAChB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/attention-panel/AttentionPanel.ts"],"sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\n/**\n * A tinted panel that calls out the most serious item needing action: an icon, a title, a line of\n * detail and an action link. `tone` picks the colour: `warning` (amber) for things due soon,\n * `danger` (red) for overdue or failing items, `accent` (blue) for set-up tips.\n *\n * Slots: `icon` (a glyph beside the title), default (the detail text), `action` (a link or button).\n */\n@customElement('st-attention-panel')\nexport class AttentionPanel extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: flex;\n align-items: flex-start;\n gap: var(--st-space-12);\n padding: var(--st-space-16);\n border-radius: var(--st-radius-md);\n background: var(--st-color-accent-subtle);\n color: var(--st-color-text);\n }\n\n :host([tone='warning']) {\n background: var(--st-color-warning-subtle);\n }\n\n :host([tone='danger']) {\n background: var(--st-color-danger-subtle);\n }\n\n .icon {\n display: inline-grid;\n place-items: center;\n width: 32px;\n height: 32px;\n border-radius: var(--st-radius-sm);\n background: var(--st-color-surface);\n flex: none;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n gap: var(--st-space-4);\n min-width: 0;\n flex: 1;\n }\n\n .title {\n margin: 0;\n font-size: var(--st-text-lg);\n font-weight: var(--st-font-weight-semibold);\n color: var(--st-color-text-strong);\n }\n\n .detail {\n font-size: var(--st-text-base);\n line-height: 1.5;\n color: var(--st-color-text-secondary);\n }\n\n .action {\n margin-top: var(--st-space-6);\n font-size: var(--st-text-base);\n font-weight: var(--st-font-weight-semibold);\n }\n\n :host([tone='warning']) .action {\n color: var(--st-color-warning-text);\n }\n\n :host([tone='danger']) .action {\n color: var(--st-color-danger-text);\n }\n\n :host([tone='accent']) .action {\n color: var(--st-color-accent-text);\n }\n\n .action:empty {\n display: none;\n }\n\n .icon:empty {\n display: none;\n }\n `;\n\n /** Colour of the panel: `accent` for tips, `warning` for due soon, `danger` for overdue. */\n @property({ type: String, reflect: true })\n tone: 'accent' | 'warning' | 'danger' = 'accent';\n\n /** Bold line at the top of the panel. */\n @property({ type: String })\n heading = '';\n\n render() {\n return html`\n <span class=\"icon\" part=\"icon\"><slot name=\"icon\"></slot></span>\n <div class=\"body\">\n <p class=\"title\" part=\"title\">${this.heading}</p>\n <div class=\"detail\" part=\"detail\"><slot></slot></div>\n <div class=\"action\" part=\"action\"><slot name=\"action\"></slot></div>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,YAAY;AACtC,SAAS,eAAe,gBAAgB;AAYjC,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAAxC;AAAA;AAkFL,gBAAwC;AAIxC,mBAAU;AAAA;AAAA,EAEV,SAAS;AACP,WAAO;AAAA;AAAA;AAAA,wCAG6B,KAAK,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlD;AACF;AAlGa,eACJ,SAAS;AAAA,MACZ,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgFpB;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAjF9B,eAkFX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GArFf,eAsFX;AAtFW,iBAAN;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB;","names":[]}