nntc-ui 0.1.12 → 0.1.13

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
@@ -24,5 +24,5 @@
24
24
  "react-dom": "^18.0.0"
25
25
  },
26
26
  "name": "nntc-ui",
27
- "version": "0.1.12"
27
+ "version": "0.1.13"
28
28
  }
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export type Theme = 'light' | 'dark' | 'darkBlue';
3
+ export type StyleContainer = HTMLElement | ShadowRoot;
3
4
  export interface ThemeContextType {
4
5
  theme: Theme;
5
6
  toggleTheme: () => void;
@@ -9,7 +10,14 @@ export declare function useTheme(): ThemeContextType | null;
9
10
  export declare function useThemeWithFallback(): ThemeContextType;
10
11
  interface ThemeProviderProps {
11
12
  children: ReactNode;
13
+ /**
14
+ * Куда добавить глобальные стили и палитру темы.
15
+ * По умолчанию — document.head. Для MFE, отрисовывающихся в Shadow DOM,
16
+ * передайте сюда shadowRoot: стили попадут в теневое дерево (рядом с index.css),
17
+ * а :root будет автоматически заменён на :host.
18
+ */
19
+ styleContainer?: StyleContainer | null;
12
20
  }
13
- export declare function ThemeProvider({ children }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function ThemeProvider({ children, styleContainer }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
14
22
  export {};
15
23
  //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkD,MAAM,OAAO,CAAC;AAUlF,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,EAAE,CA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