comark-table 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { n as theme } from "./theme-CoRWlEh3.mjs";
1
+ import { n as theme } from "./theme-WGjRIAmX.mjs";
2
2
  //#region src/styles.ts
3
3
  /**
4
4
  * A table that scrolls sideways in place, with a Copy button and a menu of formats above it and headers that sort, on the shared
package/dist/client.mjs CHANGED
@@ -1 +1 @@
1
- export { t as bar, r as css, n as start } from "./client-C87nMaxf.mjs";
1
+ export { t as bar, r as css, n as start } from "./client-CDdgxJF0.mjs";
package/dist/html.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as src_default, t as TABLE_TAG } from "./src-CoijxMxA.mjs";
2
- import { n as start, r as css, t as bar } from "./client-C87nMaxf.mjs";
1
+ import { n as src_default, t as TABLE_TAG } from "./src-BV7IF9ld.mjs";
2
+ import { n as start, r as css, t as bar } from "./client-CDdgxJF0.mjs";
3
3
  //#region src/html.ts
4
4
  const started = /* @__PURE__ */ new WeakSet();
5
5
  /** The table script as one inline `<script>`, once per render. */
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { t as TABLE_TAG, n as default } from "./src-CoijxMxA.mjs";
1
+ export { t as TABLE_TAG, n as default } from "./src-BV7IF9ld.mjs";
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as src_default, t as TABLE_TAG } from "./src-CoijxMxA.mjs";
2
- import { n as start, r as css, t as bar } from "./client-C87nMaxf.mjs";
1
+ import { n as src_default, t as TABLE_TAG } from "./src-BV7IF9ld.mjs";
2
+ import { n as start, r as css, t as bar } from "./client-CDdgxJF0.mjs";
3
3
  import { createElement, useEffect } from "react";
4
4
  //#region src/react.ts
5
5
  /** Tables for `@comark/react`. */
@@ -1,4 +1,4 @@
1
- import { t as statusColor } from "./theme-CoRWlEh3.mjs";
1
+ import { t as statusColor } from "./theme-WGjRIAmX.mjs";
2
2
  import { defineComarkPlugin } from "comark";
3
3
  import { resolveAttributes } from "comark/render";
4
4
  //#region ../../shared/text.ts
@@ -75,6 +75,29 @@ const colors = {
75
75
  };
76
76
  const groups = {
77
77
  status: Object.values(colors),
78
+ primary: [
79
+ [
80
+ "primary",
81
+ "ui-primary",
82
+ "primary",
83
+ "var(--_comark-foreground)",
84
+ "var(--_comark-foreground)"
85
+ ],
86
+ [
87
+ "primary-foreground",
88
+ "ui-text-inverted",
89
+ "primary-foreground",
90
+ "var(--_comark-background)",
91
+ "var(--_comark-background)"
92
+ ],
93
+ [
94
+ "secondary",
95
+ "ui-secondary",
96
+ "",
97
+ "var(--_comark-muted)",
98
+ "var(--_comark-muted)"
99
+ ]
100
+ ],
78
101
  shadow: [[
79
102
  "shadow",
80
103
  "",
@@ -102,14 +125,16 @@ function statusColor(name) {
102
125
  * They resolve on the component rather than `:root`, so a `.dark` class anywhere above it switches the theme, and a
103
126
  * `--comark-*` set on any ancestor still inherits down. `:where()` keeps them at zero specificity.
104
127
  *
105
- * Every block gets the core tokens. Name `"status"` for `--comark-success`, `-danger`, `-warning`, and `-info`, and
106
- * `"shadow"` for `--comark-shadow`, so a block that never draws them doesn't carry them.
128
+ * Every block gets the core tokens. Name `"status"` for `--comark-success`, `-danger`, `-warning`, and `-info`,
129
+ * `"primary"` for `--comark-primary`, `-primary-foreground`, and `-secondary`, and `"shadow"` for `--comark-shadow`, so
130
+ * a block that never draws them doesn't carry them.
107
131
  */
108
132
  function theme(selector, ...extras) {
109
133
  const where = `:where(${selector})`;
110
134
  const added = extras.flatMap((name) => groups[name]);
111
135
  const list = [...tokens, ...added];
112
- const classes = added.length ? `:where(.light,.light *)${where}{${resolve(added, 3)}}:where(.dark,.dark *)${where}{${resolve(added, 4)}}` : "";
136
+ const schemed = added.filter((token) => token[3] !== token[4]);
137
+ const classes = schemed.length ? `:where(.light,.light *)${where}{${resolve(schemed, 3)}}:where(.dark,.dark *)${where}{${resolve(schemed, 4)}}` : "";
113
138
  return `${where}{${resolve(list, 3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}@media (prefers-color-scheme:dark){${where}{${resolve(list, 4)}}}` + classes;
114
139
  }
115
140
  //#endregion
package/dist/vue.d.mts CHANGED
@@ -10,8 +10,8 @@ export declare const DataTable: import("vue").DefineComponent<import("vue").Extr
10
10
  sort: BooleanConstructor;
11
11
  copy: BooleanConstructor;
12
12
  }>> & Readonly<{}>, {
13
- sort: boolean;
14
13
  copy: boolean;
14
+ sort: boolean;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
16
  /** Pass these as `components` to `@comark/vue`. */
17
17
  export declare const components: {
@@ -24,8 +24,8 @@ export declare const components: {
24
24
  sort: BooleanConstructor;
25
25
  copy: BooleanConstructor;
26
26
  }>> & Readonly<{}>, {
27
- sort: boolean;
28
27
  copy: boolean;
28
+ sort: boolean;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
30
30
  };
31
31
  //#endregion
package/dist/vue.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as src_default, t as TABLE_TAG } from "./src-CoijxMxA.mjs";
2
- import { n as start, r as css, t as bar } from "./client-C87nMaxf.mjs";
1
+ import { n as src_default, t as TABLE_TAG } from "./src-BV7IF9ld.mjs";
2
+ import { n as start, r as css, t as bar } from "./client-CDdgxJF0.mjs";
3
3
  import { defineComponent, h, onBeforeUnmount, onMounted } from "vue";
4
4
  //#region src/vue.ts
5
5
  /** Tables for `@comark/vue`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comark-table",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Tables from CSV, TSV, and JSON files or fences, read while parsing, with copy buttons and sortable headers. A Comark plugin.",
5
5
  "keywords": [
6
6
  "comark",
@@ -57,7 +57,7 @@
57
57
  "react-dom": "^19.3.1",
58
58
  "svelte": "^5.57.2",
59
59
  "vue": "^3.5.44",
60
- "comark-zoom": "0.8.0"
60
+ "comark-zoom": "0.8.1"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@comark/html": "^0.8.0",