@preply/ds-web-core
Advanced tools
Comparing version 0.6.1-beta.ea6f45f47c13e3218fea90c7c088a895e1d5cfa3.45 to 0.6.1-beta.f7f9ce4354c62b4f45d95bf82b5b14597a9cc12d.45
@@ -11,2 +11,3 @@ import type { ColorSchemeName } from '@preply/ds-core'; | ||
getClassName(): string; | ||
getStyles(): CSSModule[]; | ||
} |
@@ -16,2 +16,5 @@ import { safeClassName } from '../../css-module/index.js'; | ||
} | ||
getStyles() { | ||
return [this.styles]; | ||
} | ||
} | ||
@@ -21,2 +24,2 @@ ColorScheme.PREFIX = 'ds-'; | ||
export { ColorScheme }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29sb3JTY2hlbWUuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb2xvci1zY2hlbWUvY2xhc3Nlcy9Db2xvclNjaGVtZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IENvbG9yU2NoZW1lTmFtZSB9IGZyb20gJ0BwcmVwbHkvZHMtY29yZSc7XG5cbmltcG9ydCB7IHNhZmVDbGFzc05hbWUgfSBmcm9tICcuLi8uLi9jc3MtbW9kdWxlJztcbmltcG9ydCB0eXBlIHsgQ1NTTW9kdWxlIH0gZnJvbSAnLi4vLi4vY3NzLW1vZHVsZS90eXBlcyc7XG5pbXBvcnQgdHlwZSB7IENvbG9yU2NoZW1lSW50ZXJmYWNlIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY2xhc3MgQ29sb3JTY2hlbWUgaW1wbGVtZW50cyBDb2xvclNjaGVtZUludGVyZmFjZSB7XG4gICAgc3RhdGljIFBSRUZJWCA9ICdkcy0nO1xuXG4gICAgcHJpdmF0ZSBzdHlsZXM6IENTU01vZHVsZTtcbiAgICBwcml2YXRlIGV4dGVuZD86IENvbG9yU2NoZW1lTmFtZVtdO1xuICAgIHB1YmxpYyByZWFkb25seSBuYW1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FBQyxNQUFNLElBQUksRUFBRSxDQUFDO1FBQzFDLE1BQU0sVUFBVSxHQUFHLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxHQUFHLGVBQWUsQ0FBQyxDQUFDO1FBQ25ELE9BQU8sVUFBVTthQUNaLEdBQUcsQ0FBQyxTQUFTLElBQ1YsYUFBYSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsR0FBRyxXQUFXLENBQUMsTUFBTSxXQUFXLFNBQVMsRUFBRSxDQUFDLENBQzFFO2FBQ0EsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0tBQ2xCO0lBRUQsU0FBUztRQUNMLE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDeEI7O0FBeEJNLGtCQUFNLEdBQUcsS0FBSzs7OzsifQ== |
import { useContext } from 'react'; | ||
import { useStyleExtract } from '../../ssr/hooks/useStyleExtract.js'; | ||
import { ColorSchemeContext } from '../providers/ColorSchemeProvider.js'; | ||
@@ -9,2 +10,4 @@ | ||
} | ||
const styles = colorScheme.getStyles(); | ||
styles.forEach(useStyleExtract); | ||
return { colorScheme }; | ||
@@ -14,2 +17,2 @@ }; | ||
export { useColorScheme }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlQ29sb3JTY2hlbWUuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb2xvci1zY2hlbWUvaG9va3MvdXNlQ29sb3JTY2hlbWUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdXNlQ29udGV4dCB9IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHsgQ29sb3JTY2hlbWVDb250ZXh0LCBDb2xvclNjaGVtZUNvbnRleHRTdGF0ZSB9IGZyb20gJy4uL3Byb3ZpZGVycy9Db2xvclNjaGVtZVByb3ZpZGVyJztcblxuZXhwb3J0IGNvbnN0IHVzZUNvbG9yU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vdmlkZXJzL0NvbG9yU2NoZW1lUHJvdmlkZXInO1xuXG5leHBvcnQgY29uc3QgdXNlQ29sb3JTY2hlbWUgPSAoKTogQ29sb3JTY2hlbWVDb250ZXh0U3RhdGUgPT4ge1xuICAgIGNvbnN0IHsgY29sb3JTY2hlbWUgfSA9IHVzZUNvbnRleHQoQ29sb3JTY2hlbWVDb250ZXh0KTtcbiAgICBpZiAoIWNvbG9yU2NoZW1lKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcigndXNlQ29sb3JTY2hlbWUoKSBtdXN0IGJlIHVzZWQgd2l0aGluIGEgQ29sb3JTY2hlbWVQcm92aWRlcicpO1xuICAgIH1cblxuICAgIGNvbnN0IHN0eWxlcyA9IGNvbG9yU2NoZW1lLmdldFN0eWxlcygpO1xuICAgIHN0eWxlcy5mb3JFYWNoKHVzZVN0eWxlRXh0cmFjdCk7XG5cbiAgICByZXR1cm4geyBjb2xvclNjaGVtZSB9O1xufTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O01BS2EsY0FBYyxHQUFHO0lBQzFCLE1BQU0sRUFBRSxXQUFXLEVBQUUsR0FBRyxVQUFVLENBQUMsa0JBQWtCLENBQUMsQ0FBQztJQUN2RCxJQUFJLENBQUMsV0FBVyxFQUFFO1FBQ2QsTUFBTSxJQUFJLEtBQUssQ0FBQyw0REFBNEQsQ0FBQyxDQUFDO0tBQ2pGO0lBRUQsTUFBTSxNQUFNLEdBQUcsV0FBVyxDQUFDLFNBQVMsRUFBRSxDQUFDO0lBQ3ZDLE1BQU0sQ0FBQyxPQUFPLENBQUMsZUFBZSxDQUFDLENBQUM7SUFFaEMsT0FBTyxFQUFFLFdBQVcsRUFBRSxDQUFDO0FBQzNCOzs7OyJ9 |
import { ColorSchemeName } from '@preply/ds-core'; | ||
import { CSSModule } from '../css-module/types'; | ||
export interface ColorSchemeInterface { | ||
name: ColorSchemeName; | ||
getClassName(): string; | ||
getStyles(): CSSModule[]; | ||
} |
@@ -1,7 +0,8 @@ | ||
import { FC } from 'react'; | ||
import type { CSSModule, CSSModuleContent, CSSModuleId } from '../../css-module/types'; | ||
export declare class ServerStyleSheet { | ||
styles: Record<CSSModuleId, CSSModuleContent>; | ||
import { ReactNode } from 'react'; | ||
import type { CSSModule } from '../../css-module/types'; | ||
import type { ServerStyleSheetInterface } from '../types'; | ||
export declare class ServerStyleSheet implements ServerStyleSheetInterface { | ||
styles: Record<string, string>; | ||
addStyle({ __id: id, __css: css }: CSSModule): void; | ||
getStyleElement: FC; | ||
getStyleElement: () => ReactNode; | ||
} |
@@ -22,2 +22,2 @@ import React from 'react'; | ||
export { ServerStyleSheet }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2VydmVyU3R5bGVTaGVldC5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3Nzci9jbGFzc2VzL1NlcnZlclN0eWxlU2hlZXQudHN4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBGQyB9IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHR5cGUgeyBDU1NNb2R1bGUsIENTU01vZHVsZUNvbnRlbnQsIENTU01vZHVsZUlkIH0gZnJvbSAnLi4vLi4vY3NzLW1vZHVsZS90eXBlcyc7XG5cbmV4cG9ydCBjbGFzcyBTZXJ2ZXJTdHlsZVNoZWV0IHtcbiAgICBzdHlsZXM6IFJlY29yZDxDU1NNb2R1bGVJZCwgQ1NTTW9kdWxlQ29udGVudD4gPSB7fTtcblxuICAgIGFkZFN0eWxlKHsgX19pZDogaWQsIF9fY3NzOiBjc3MgfTogQ1NTTW9kdWxlKTogdm9pZCB7XG4gICAgICAgIHRoaXMuc3R5bGVzW2lkXSA9IGNzcztcbiAgICB9XG5cbiAgICBnZXRTdHlsZUVsZW1lbnQ6IEZDID0gKCkgPT4ge1xuICAgICAgICBjb25zdCBzdHlsZXMgPSBPYmplY3QudmFsdW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HRtbDogaHRtbCxcbiAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgKTtcbiAgICB9O1xufVxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O01BS2EsZ0JBQWdCO0lBQTdCO1FBQ0ksV0FBTSxHQUEyQixFQUFFLENBQUM7UUFNcEMsb0JBQWUsR0FBRztZQUNkLE1BQU0sTUFBTSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQztZQUNuRCxNQUFNLElBQUksR0FBRywyQ0FBMkMsTUFBTSxFQUFFLENBQUM7WUFDakUsUUFDSTs7Z0JBRUksdUJBQXVCLEVBQUU7b0JBQ3JCLE1BQU0sRUFBRSxJQUFJO2lCQUNmLEdBQ0gsRUFDSjtTQUNMLENBQUM7S0FDTDtJQWhCRyxRQUFRLENBQUMsRUFBRSxJQUFJLEVBQUUsRUFBRSxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQWE7UUFDeEMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsR0FBRyxHQUFHLENBQUM7S0FDekI7Ozs7OyJ9 |
import React, { FC } from 'react'; | ||
import { ServerStyleSheet } from '../classes/ServerStyleSheet'; | ||
export declare type StyleExtractContextState = ServerStyleSheet; | ||
export declare const StyleExtractContext: React.Context<ServerStyleSheet>; | ||
import { ServerStyleSheetInterface } from '../types'; | ||
export declare type StyleExtractContextState = ServerStyleSheetInterface; | ||
export declare const StyleExtractContext: React.Context<ServerStyleSheetInterface>; | ||
interface StyleExtractProviderProps { | ||
stylesheet: ServerStyleSheet; | ||
stylesheet: ServerStyleSheetInterface; | ||
} | ||
export declare const StyleExtractProvider: FC<StyleExtractProviderProps>; | ||
export {}; |
@@ -9,2 +9,2 @@ import React, { createContext } from 'react'; | ||
export { StyleExtractContext, StyleExtractProvider }; | ||
//# sourceMapping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FxuICAgICAgICA8U3R5bGVFeHRyYWN0Q29udGV4dC5Qcm92aWRlciB2YWx1ZT17c3R5bGVzaGVldH0+e2NoaWxkcmVufTwvU3R5bGVFeHRyYWN0Q29udGV4dC5Qcm92aWRlcj5cbiAgICApO1xufTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztNQU1hLG1CQUFtQixHQUFHLGFBQWEsQ0FDNUMsRUFBK0IsRUFDakM7TUFNVyxvQkFBb0IsR0FBa0MsQ0FBQyxFQUFFLFFBQVEsRUFBRSxVQUFVLEVBQUU7SUFDeEYsUUFDSSxvQkFBQyxtQkFBbUIsQ0FBQyxRQUFRLElBQUMsS0FBSyxFQUFFLFVBQVUsSUFBRyxRQUFRLENBQWdDLEVBQzVGO0FBQ047Ozs7In0= |
@@ -0,1 +1,2 @@ | ||
export type { ServerStyleSheetInterface } from './types'; | ||
export { ServerStyleSheet } from './classes/ServerStyleSheet'; | ||
@@ -2,0 +3,0 @@ export { StyleExtractContext, StyleExtractProvider } from './contexts/StyleExtractContext'; |
@@ -6,3 +6,2 @@ import type { ThemeName } from '@preply/ds-core'; | ||
static PREFIX: string; | ||
static ROOT_CLASS: string; | ||
private styles; | ||
@@ -12,6 +11,7 @@ private values?; | ||
private extend; | ||
readonly name: any; | ||
constructor(styles: CSSModule, name: ThemeName, extend?: Theme[], values?: TokenMap, tokens?: TokenMap); | ||
readonly name: ThemeName; | ||
constructor(styles: CSSModule, name: ThemeName, extend?: ThemeInterface[], values?: TokenMap, tokens?: TokenMap); | ||
private token; | ||
getClassName(): string; | ||
getStyles(): CSSModule[]; | ||
fgColor(component: string, variant: string): string; | ||
@@ -18,0 +18,0 @@ bgColor(component: string, variant: string): string; |
@@ -31,2 +31,6 @@ import { safeClassName } from '../../css-module/index.js'; | ||
} | ||
getStyles() { | ||
const extendedStyles = this.extend.map(theme => theme.getStyles()).flat() || []; | ||
return [this.styles, ...extendedStyles]; | ||
} | ||
fgColor(component, variant) { | ||
@@ -43,5 +47,4 @@ return this.token(`${TOKEN_COLOR_FG}-${component}-${variant}`); | ||
Theme.PREFIX = 'ds-'; | ||
Theme.ROOT_CLASS = 'root'; | ||
export { Theme }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGhlbWUuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90aGVtZS9jbGFzc2VzL1RoZW1lLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgVGhlbWVOYW1lIH0gZnJvbSAnQHByZXBseS9kcy1jb3JlJztcblxuaW1wb3J0IHsgc2FmZUNsYXNzTmFtZSB9IGZyb20gJy4uLy4uL2Nzcy1tb2R1bGUnO1xuaW1wb3J0IHR5cGUgeyBDU1NNb2R1bGUgfSBmcm9tICcuLi8uLi9jc3MtbW9kdWxlL3R5cGVzJztcbmltcG9ydCB7IFRPS0VOX0NPTE9SX0JHLCBUT0tFTl9DT0xPUl9GRywgVE9LRU5fUkFESVVTIH0gZnJvbSAnLi4vY29uc3RhbnRzJztcbmltcG9ydCB0eXBlIHsgVGhlbWVJbnRlcmZhY2UsIFRva2VuTWFwIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY2xhc3MgVGhlbWUgaW1wbGVtZW50cyBUaGVtZUludGVyZmFjZSB7XG4gICAgc3RhdGljIFBSRUZJWCA9ICdkcy0nO1xuICAgIHN0YXRpYyBST09UX0NMQVNTID0gJ3Jvb3QnO1xuXG4gICAgcHJpdmF0ZSBzdHlsZXM6IENTU01vZHVsZTtcbiAgICBwcml2YXRlIHZhbHVlcz86IFRva2VuTWFwO1xuICAgIHByaXZhdGUgdG9rZW5zPzogVG9rZW5NYXA7XG4gICAgcHJpdmF0ZSBleHRlbmQ6IFRoZW1lW107XG4gICAgcHVibGljIHJlYWRvbmx5IG5hbWU7XG5cbiAgICBjb25zdHJ1Y3RvcihcbiAgICAgICAgc3R5bGVzOiBDU1NNb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7S0FDM0M7SUFFRCxPQUFPLENBQUMsU0FBaUIsRUFBRSxPQUFlO1FBQ3RDLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLGNBQWMsSUFBSSxTQUFTLElBQUksT0FBTyxFQUFFLENBQUMsQ0FBQztLQUNsRTtJQUVELE9BQU8sQ0FBQyxTQUFpQixFQUFFLE9BQWU7UUFDdEMsT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLEdBQUcsY0FBYyxJQUFJLFNBQVMsSUFBSSxPQUFPLEVBQUUsQ0FBQyxDQUFDO0tBQ2xFO0lBRUQsTUFBTSxDQUFDLFNBQWlCO1FBQ3BCLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLFlBQVksSUFBSSxTQUFTLEVBQUUsQ0FBQyxDQUFDO0tBQ3JEOztBQTFETSxZQUFNLEdBQUcsS0FBSzs7OzsifQ== |
import { useContext } from 'react'; | ||
import { useStyleExtract } from '../../ssr/hooks/useStyleExtract.js'; | ||
import { ThemeContext } from '../providers/ThemeProvider.js'; | ||
@@ -9,2 +10,4 @@ | ||
} | ||
const styles = theme.getStyles(); | ||
styles.forEach(useStyleExtract); | ||
return { theme }; | ||
@@ -14,2 +17,2 @@ }; | ||
export { useTheme }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlVGhlbWUuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90aGVtZS9ob29rcy91c2VUaGVtZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDb250ZXh0IH0gZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgdHlwZSB7IFRoZW1lQ29udGV4dFN0YXRlIH0gZnJvbSAnLi4vcHJvdmlkZXJzL1RoZW1lUHJvdmlkZXInO1xuaW1wb3J0IHsgVGhlbWVDb250ZXh0IH0gZnJvbSAnLi4vcHJvdmlkZXJzL1RoZW1lU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m92aWRlcnMvVGhlbWVQcm92aWRlcic7XG5cbmV4cG9ydCBjb25zdCB1c2VUaGVtZSA9ICgpOiBUaGVtZUNvbnRleHRTdGF0ZSA9PiB7XG4gICAgY29uc3QgeyB0aGVtZSB9ID0gdXNlQ29udGV4dChUaGVtZUNvbnRleHQpO1xuICAgIGlmICghdGhlbWUpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1c2VUaGVtZSgpIG11c3QgYmUgdXNlZCB3aXRoaW4gYSBUaGVtZVByb3ZpZGVyJyk7XG4gICAgfVxuXG4gICAgY29uc3Qgc3R5bGVzID0gdGhlbWUuZ2V0U3R5bGVzKCk7XG4gICAgc3R5bGVzLmZvckVhY2godXNlU3R5bGVFeHRyYWN0KTtcblxuICAgIHJldHVybiB7IHRoZW1lIH07XG59O1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7TUFNYSxRQUFRLEdBQUc7SUFDcEIsTUFBTSxFQUFFLEtBQUssRUFBRSxHQUFHLFVBQVUsQ0FBQyxZQUFZLENBQUMsQ0FBQztJQUMzQyxJQUFJLENBQUMsS0FBSyxFQUFFO1FBQ1IsTUFBTSxJQUFJLEtBQUssQ0FBQyxnREFBZ0QsQ0FBQyxDQUFDO0tBQ3JFO0lBRUQsTUFBTSxNQUFNLEdBQUcsS0FBSyxDQUFDLFNBQVMsRUFBRSxDQUFDO0lBQ2pDLE1BQU0sQ0FBQyxPQUFPLENBQUMsZUFBZSxDQUFDLENBQUM7SUFFaEMsT0FBTyxFQUFFLEtBQUssRUFBRSxDQUFDO0FBQ3JCOzs7OyJ9 |
import { ThemeName } from '@preply/ds-core'; | ||
import { CSSModule } from '../css-module/types'; | ||
export declare type TokenMap = { | ||
@@ -8,2 +9,3 @@ [key: string]: string; | ||
getClassName(): string; | ||
getStyles(): CSSModule[]; | ||
fgColor(component: string, variant: string): void; | ||
@@ -10,0 +12,0 @@ bgColor(component: string, variant: string): void; |
{ | ||
"name": "@preply/ds-web-core", | ||
"version": "0.6.1-beta.ea6f45f47c13e3218fea90c7c088a895e1d5cfa3.45+ea6f45f", | ||
"version": "0.6.1-beta.f7f9ce4354c62b4f45d95bf82b5b14597a9cc12d.45+f7f9ce4", | ||
"publishConfig": { | ||
@@ -22,3 +22,3 @@ "access": "public" | ||
"dependencies": { | ||
"@preply/ds-core": "^0.6.1-beta.ea6f45f47c13e3218fea90c7c088a895e1d5cfa3.45+ea6f45f" | ||
"@preply/ds-core": "^0.6.1-beta.f7f9ce4354c62b4f45d95bf82b5b14597a9cc12d.45+f7f9ce4" | ||
}, | ||
@@ -30,3 +30,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "ea6f45f47c13e3218fea90c7c088a895e1d5cfa3" | ||
"gitHead": "f7f9ce4354c62b4f45d95bf82b5b14597a9cc12d" | ||
} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
111098
103
1061