@sheetxl/utils-react 0.8.0-beta.21 → 0.8.0-beta.22
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/browser/esm/{C74v7_u2uwgwlCTV.mjs → BoN5GNv_OCJUxgqa.mjs} +2 -2
- package/browser/esm/{B8oCr4YRlNEgrVTE.mjs → CA9JhaRnLQnZ152c.mjs} +2 -2
- package/browser/esm/{B6U1YOdlMBIiMwIo.mjs → Hp5-MO2wVxkCzmog.mjs} +1 -1
- package/browser/esm/index.mjs +1103 -1088
- package/node/esm/{CZoJwu33P3QdiHsu.mjs → BQslMd4UYY47M7dX.mjs} +1 -1
- package/node/esm/{BRFcIf1L6jIUdzP7.mjs → BuKRRQ8FGiZxTYQ1.mjs} +1 -1
- package/node/esm/index.mjs +291 -275
- package/package.json +2 -2
- package/types/src/theme/ThemeStyle.d.ts +22 -0
- package/types/src/theme/index.d.ts +1 -0
- package/types/src/theme/themeAttrs.d.ts +5 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-react",
|
|
3
3
|
"description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.22",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@floating-ui/react-dom": "^2.1.9",
|
|
43
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
43
|
+
"@sheetxl/utils": "^0.8.0-beta.22",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"detect-it": "^4.0.1",
|
|
46
46
|
"prop-types": "^15.8.1",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Puts the `sxl-*` cascade-layer order statement first in `root` (the document's `<head>`, or a shadow
|
|
4
|
+
* root), once per root.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Layer order is fixed by the first place each layer name appears in document order. A host's stylesheet
|
|
8
|
+
* that writes `@layer sxl-overrides { … }` usually sits in `<head>` ahead of anything a component renders,
|
|
9
|
+
* which would make `sxl-overrides` the lowest layer. Placing the statement before every other sheet keeps
|
|
10
|
+
* `sxl-defaults` < `sxl-app` < `sxl-overrides` however the host's sheets are ordered.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ensureThemeLayerOrder: (root?: Document | ShadowRoot) => void;
|
|
13
|
+
export interface ThemeStyleProps {
|
|
14
|
+
/** A layered theme sheet, e.g. from `buildThemeCSS({ layer })`. */
|
|
15
|
+
css: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a layered theme stylesheet inline and makes sure the layer order is declared first in the
|
|
19
|
+
* document or shadow root it lands in ({@link ensureThemeLayerOrder}).
|
|
20
|
+
*/
|
|
21
|
+
export declare const ThemeStyle: React.MemoExoticComponent<({ css }: ThemeStyleProps) => React.JSX.Element>;
|
|
22
|
+
//# sourceMappingURL=ThemeStyle.d.ts.map
|
|
@@ -3,6 +3,7 @@ export * from './defaultTheme';
|
|
|
3
3
|
export * from './createThemeVars';
|
|
4
4
|
export * from './buildThemeCSS';
|
|
5
5
|
export * from './themeAttrs';
|
|
6
|
+
export * from './ThemeStyle';
|
|
6
7
|
export * from './zIndex';
|
|
7
8
|
export * from './TokenThemeProvider';
|
|
8
9
|
export * from './useResolvedThemeMode';
|
|
@@ -12,11 +12,12 @@ export interface ThemeAttrs {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* The selection attributes for a surface container, ready to spread onto the element — e.g.
|
|
15
|
-
* `<div {...themeSurfaceProps('grid', 'dark')}>`.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* `<div {...themeSurfaceProps('grid', 'dark')}>`.
|
|
16
|
+
*
|
|
17
|
+
* `mode` is required: a surface container always states its own mode, so every themed region matches the
|
|
18
|
+
* compound `[data-sxl-theme-mode][data-sxl-theme-surface]` selector — the one a client override addresses.
|
|
18
19
|
*/
|
|
19
|
-
export declare const themeSurfaceProps: (surface: string, mode
|
|
20
|
+
export declare const themeSurfaceProps: (surface: string, mode: ThemeMode) => ThemeAttrs;
|
|
20
21
|
/**
|
|
21
22
|
* A stable, CSS-safe per-instance scope **class name** (no leading dot) for a theme instance root — e.g.
|
|
22
23
|
* `sheetxl-studio-r0`. Set it as the element's `className` and, for the matching `@scope` selector, prefix a
|