@sheetxl/utils-react 0.8.0-beta.20 → 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/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.20",
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.20",
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')}>`. `mode` is optional: omit it to inherit the ancestor's
16
- * mode via the CSS cascade; pass it when the region flips mode (a light grid in a dark app), which selects
17
- * the compound `[mode][surface]` cell.
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?: ThemeMode) => ThemeAttrs;
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