@ricsam/react-spreadsheets 0.0.4 → 0.0.6
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/README.md +20 -2
- package/dist/cjs/lib.cjs +12 -12
- package/dist/cjs/lib.cjs.map +3 -3
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/lib.mjs +12 -12
- package/dist/mjs/lib.mjs.map +3 -3
- package/dist/mjs/package.json +1 -1
- package/dist/styles.css +197 -179
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,8 +88,9 @@ top of `FormulaSheet`.
|
|
|
88
88
|
|
|
89
89
|
## Theming
|
|
90
90
|
|
|
91
|
-
All colors, fonts and sizes are CSS custom properties
|
|
92
|
-
|
|
91
|
+
All colors, fonts and sizes are CSS custom properties. The package only ever
|
|
92
|
+
*reads* the public `--rsp-*` names, so an override on **any** ancestor of the
|
|
93
|
+
grid always wins:
|
|
93
94
|
|
|
94
95
|
```css
|
|
95
96
|
.my-panel {
|
|
@@ -100,6 +101,16 @@ you can override them from **any** ancestor of the grid:
|
|
|
100
101
|
}
|
|
101
102
|
```
|
|
102
103
|
|
|
104
|
+
An override replaces both schemes, so pick a value that works in the mode(s) you
|
|
105
|
+
support, or scope it per scheme:
|
|
106
|
+
|
|
107
|
+
```css
|
|
108
|
+
.my-panel { --rsp-bg: #ffffff; }
|
|
109
|
+
@media (prefers-color-scheme: dark) {
|
|
110
|
+
.my-panel { --rsp-bg: #10131a; }
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
103
114
|
### Light and dark
|
|
104
115
|
|
|
105
116
|
By default the grid follows the user's OS preference.
|
|
@@ -129,6 +140,13 @@ switches.
|
|
|
129
140
|
> declaration, which makes shared-root tokens compute to an invalid value — in
|
|
130
141
|
> production builds only. An equivalent space-toggle is used instead.
|
|
131
142
|
|
|
143
|
+
> **Note** — internally each public token is aliased to a private `--_rsp-*`
|
|
144
|
+
> property declared on `.rsp-root`, and the rules consume the private name. A
|
|
145
|
+
> custom property containing `var()` is substituted at the element where it is
|
|
146
|
+
> *declared*, so themed values declared on `:root` would be resolved against the
|
|
147
|
+
> document root and a subtree pin could never change them. Treat `--_rsp-*` as
|
|
148
|
+
> private and always override the public `--rsp-*` name.
|
|
149
|
+
|
|
132
150
|
### Cell fills stay readable
|
|
133
151
|
|
|
134
152
|
A `backgroundColor` coming from your document model is usually a single literal
|
package/dist/cjs/lib.cjs
CHANGED
|
@@ -2747,7 +2747,7 @@ var Spreadsheet = import_react4.forwardRef(({
|
|
|
2747
2747
|
height: 0,
|
|
2748
2748
|
visibility: "hidden",
|
|
2749
2749
|
pointerEvents: "none",
|
|
2750
|
-
color: "var(--
|
|
2750
|
+
color: "var(--_rsp-gridline)"
|
|
2751
2751
|
}
|
|
2752
2752
|
}),
|
|
2753
2753
|
/* @__PURE__ */ jsx_runtime3.jsx("canvas", {
|
|
@@ -3673,32 +3673,32 @@ function FormulaSheet({
|
|
|
3673
3673
|
const isLastColumn = cell.colIndex === tableInfo.start.colIndex + tableInfo.headers.size - 1;
|
|
3674
3674
|
const isLastRow = tableInfo.endRow.type === "number" ? cell.rowIndex === tableInfo.endRow.value : false;
|
|
3675
3675
|
const style = {
|
|
3676
|
-
border: "1px solid var(--
|
|
3676
|
+
border: "1px solid var(--_rsp-table-border-light)"
|
|
3677
3677
|
};
|
|
3678
3678
|
if (isHeaderRow) {
|
|
3679
|
-
style.backgroundColor = "var(--
|
|
3680
|
-
style.color = "var(--
|
|
3679
|
+
style.backgroundColor = "var(--_rsp-table-header-bg)";
|
|
3680
|
+
style.color = "var(--_rsp-table-header-color)";
|
|
3681
3681
|
style.fontWeight = "bold";
|
|
3682
|
-
style.borderBottom = "2px solid var(--
|
|
3682
|
+
style.borderBottom = "2px solid var(--_rsp-table-header-border)";
|
|
3683
3683
|
} else {
|
|
3684
3684
|
const dataRowIndex = cell.rowIndex - tableInfo.start.rowIndex - 1;
|
|
3685
3685
|
if (dataRowIndex % 2 === 0) {
|
|
3686
|
-
style.backgroundColor = "var(--
|
|
3686
|
+
style.backgroundColor = "var(--_rsp-table-even-row-bg)";
|
|
3687
3687
|
} else {
|
|
3688
|
-
style.backgroundColor = "var(--
|
|
3688
|
+
style.backgroundColor = "var(--_rsp-table-odd-row-bg)";
|
|
3689
3689
|
}
|
|
3690
3690
|
}
|
|
3691
3691
|
if (isFirstColumn) {
|
|
3692
|
-
style.borderLeft = "2px solid var(--
|
|
3692
|
+
style.borderLeft = "2px solid var(--_rsp-table-border-color)";
|
|
3693
3693
|
}
|
|
3694
3694
|
if (isLastColumn) {
|
|
3695
|
-
style.borderRight = "2px solid var(--
|
|
3695
|
+
style.borderRight = "2px solid var(--_rsp-table-border-color)";
|
|
3696
3696
|
}
|
|
3697
3697
|
if (isHeaderRow) {
|
|
3698
|
-
style.borderTop = "2px solid var(--
|
|
3698
|
+
style.borderTop = "2px solid var(--_rsp-table-border-color)";
|
|
3699
3699
|
}
|
|
3700
3700
|
if (isLastRow) {
|
|
3701
|
-
style.borderBottom = "2px solid var(--
|
|
3701
|
+
style.borderBottom = "2px solid var(--_rsp-table-border-color)";
|
|
3702
3702
|
}
|
|
3703
3703
|
if (conditionalStyle?.backgroundColor) {
|
|
3704
3704
|
style.backgroundColor = conditionalStyle.backgroundColor;
|
|
@@ -4163,4 +4163,4 @@ var useClickAway = (ref, callback) => {
|
|
|
4163
4163
|
}, [ref, callback]);
|
|
4164
4164
|
};
|
|
4165
4165
|
|
|
4166
|
-
//# debugId=
|
|
4166
|
+
//# debugId=1230B1E8DDE11E4864756E2164756E21
|