@preply/ds-web-core
Advanced tools
Comparing version 0.6.1-beta.fd5a7b0f7a76bff6c6b746cb73724ddc428b9c6d.45 to 0.7.0
@@ -11,2 +11,3 @@ import type { ColorSchemeName } from '@preply/ds-core'; | ||
getClassName(): string; | ||
getStyles(): CSSModule[]; | ||
} |
@@ -11,3 +11,3 @@ import { safeClassName } from '../../css-module/index.js'; | ||
const extendedClasses = this.extend || []; | ||
const classNames = [this.name, ...extendedClasses]; | ||
const classNames = [...extendedClasses, this.name]; | ||
return classNames | ||
@@ -17,2 +17,7 @@ .map(className => safeClassName(this.styles, `${ColorScheme.PREFIX}scheme--${className}`)) | ||
} | ||
getStyles() { | ||
// all color schemes share a single style file (global scheme class names) | ||
// actual scheme tokens are implemented in each theme's stylesheet | ||
return [this.styles]; | ||
} | ||
} | ||
@@ -22,2 +27,2 @@ ColorScheme.PREFIX = 'ds-'; | ||
export { ColorScheme }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29sb3JTY2hlbWUuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb2xvci1zY2hlbWUvY2xhc3Nlcy9Db2xvclNjaGVtZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IENvbG9yU2NoZW1lTmFtZSB9IGZyb20gJ0BwcmVwbHkvZHMtY29yZSc7XG5cbmltcG9ydCB7IHNhZmVDbGFzc05hbWUgfSBmcm9tICcuLi8uLi9jc3MtbW9kdWxlJztcbmltcG9ydCB0eXBlIHsgQ1NTTW9kdWxlIH0gZnJvbSAnLi4vLi4vY3NzLW1vZHVsZS90eXBlcyc7XG5pbXBvcnQgdHlwZSB7IENvbG9yU2NoZW1lSW50ZXJmYWNlIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY2xhc3MgQ29sb3JTY2hlbWUgaW1wbGVtZW50cyBDb2xvclNjaGVtZUludGVyZmFjZSB7XG4gICAgc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cbiAgICAgICAgcmV0dXJuIFt0aGlzLnN0eWxlc107XG4gICAgfVxufVxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O01BTWEsV0FBVztJQU9wQixZQUFZLE1BQWlCLEVBQUUsSUFBcUIsRUFBRSxNQUEwQjtRQUM1RSxJQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztRQUNyQixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztRQUNqQixJQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztLQUN4QjtJQUVELFlBQVk7UUFDUixNQUFNLGVBQWUsR0FBRyxJQUFJLENBQUMsTUFBTSxJQUFJLEVBQUUsQ0FBQztRQUMxQyxNQUFNLFVBQVUsR0FBRyxDQUFDLEdBQUcsZUFBZSxFQUFFLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUNuRCxPQUFPLFVBQVU7YUFDWixHQUFHLENBQUMsU0FBUyxJQUNWLGFBQWEsQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLEdBQUcsV0FBVyxDQUFDLE1BQU0sV0FBVyxTQUFTLEVBQUUsQ0FBQyxDQUMxRTthQUNBLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztLQUNsQjtJQUVELFNBQVM7OztRQUdMLE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDeEI7O0FBMUJNLGtCQUFNLEdBQUcsS0FBSzs7OzsifQ== |
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(); | ||
useStyleExtract(styles); | ||
return { colorScheme }; | ||
@@ -14,2 +17,2 @@ }; | ||
export { useColorScheme }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxl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NERBQTRELENBQUMsQ0FBQztLQUNqRjtJQUVELE1BQU0sTUFBTSxHQUFHLFdBQVcsQ0FBQyxTQUFTLEVBQUUsQ0FBQztJQUN2QyxlQUFlLENBQUMsTUFBTSxDQUFDLENBQUM7SUFFeEIsT0FBTyxFQUFFLFdBQVcsRUFBRSxDQUFDO0FBQzNCOzs7OyJ9 |
import styleInject from '../../external/style-inject/dist/style-inject.es.js'; | ||
var css_248z = ".ds-scheme--base {\n --scheme-name: 'base';\n}\n.ds-scheme--highlight {\n --scheme-name: 'highlight';\n}\n.ds-scheme--banner {\n --scheme-name: 'banner';\n}\n.ds-scheme--invert {\n --scheme-name: 'invert';\n}\n"; | ||
var styles = {__id:"/home/jenkins/workspace/design-system_PR-26/packages/web-core/src/color-scheme/styles/index.module.less",__css:css_248z,}; | ||
var styles = {__id:"/home/jenkins/workspace/design-system_main/packages/web-core/src/color-scheme/styles/index.module.less",__css:css_248z,}; | ||
var stylesheet=css_248z; | ||
@@ -6,0 +6,0 @@ styleInject(css_248z); |
import { ColorSchemeName } from '@preply/ds-core'; | ||
import { CSSModule } from '../css-module/types'; | ||
export interface ColorSchemeInterface { | ||
name: ColorSchemeName; | ||
getClassName(): string; | ||
getStyles(): CSSModule[]; | ||
} |
@@ -26,2 +26,2 @@ import { LAYOUT_GAP_DEFAULT } from '@preply/ds-core'; | ||
export { useLayoutFlexClassNames }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlTGF5b3V0RmxleENsYXNzTmFtZXMuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9sYXlvdXQvaG9va3MvdXNlTGF5b3V0RmxleENsYXNzTmFtZXMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBMYXlvdXRGbGV4UHJvcHMsIExheW91dFR5cGUgfSBmcm9tICdAcHJlcGx5L2RzLWNvcmUnO1xuaW1wb3J0IHsgTEFZT1VUX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UFDLENBQUM7SUFFeEIsTUFBTSxFQUNGLEdBQUcsR0FBRyxrQkFBa0IsRUFDeEIsTUFBTSxFQUNOLE1BQU0sRUFDTixPQUFPLEVBQ1AsY0FBYyxFQUNkLFVBQVUsRUFDVixNQUFNLEdBQ1QsR0FBRyxLQUFLLElBQUksRUFBRSxDQUFDO0lBQ2hCLE9BQU8sTUFBTSxLQUFLLE1BQU07VUFDbEI7WUFDSSxhQUFhLENBQUMsTUFBTSxFQUFFLFdBQVcsQ0FBQztZQUNsQyxHQUFHLFlBQVksQ0FBQyxNQUFNLEVBQUUsV0FBVyxFQUFFO2dCQUNqQyxDQUFDLEtBQUssRUFBRSxHQUFHLENBQUM7Z0JBQ1osQ0FBQyxNQUFNLEdBQUcsUUFBUSxHQUFHLFNBQVMsQ0FBQztnQkFDL0IsQ0FBQyxNQUFNLEdBQUcsUUFBUSxHQUFHLFNBQVMsQ0FBQztnQkFDL0IsQ0FBQyxNQUFNLEdBQUcsUUFBUSxHQUFHLEtBQUssRUFBRSxPQUFPLEdBQUcsS0FBSyxHQUFHLEtBQUssQ0FBQztnQkFDcEQsQ0FBQyxpQkFBaUIsRUFBRSxjQUFjLENBQUM7Z0JBQ25DLENBQUMsYUFBYSxFQUFFLFVBQVUsQ0FBQzthQUM5QixDQUFDO1NBQ0w7VUFDRCxFQUFFLENBQUM7QUFDYjs7OzsifQ== |
import styleInject from '../../external/style-inject/dist/style-inject.es.js'; | ||
var css_248z = "._15uGWh {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n._3rnoor {\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n}\n._1_IXQm {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n._1eu8AB {\n grid-gap: var(--layout--gap-none--space);\n gap: var(--layout--gap-none--space);\n}\n._3yYLRc {\n grid-gap: var(--layout--gap-small--space);\n gap: var(--layout--gap-small--space);\n}\n._1nDuVC {\n grid-gap: var(--layout--gap-base--space);\n gap: var(--layout--gap-base--space);\n}\n.ZknBAf {\n grid-gap: var(--layout--gap-medium--space);\n gap: var(--layout--gap-medium--space);\n}\n._1WqO9Z {\n grid-gap: var(--layout--gap-large--space);\n gap: var(--layout--gap-large--space);\n}\n.X4eHUe {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n}\n._3_M_4w {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: reverse;\n -ms-flex-direction: row-reverse;\n flex-direction: row-reverse;\n}\n._2ByMq1 {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n._3_8VIk {\n -webkit-box-orient: vertical;\n -webkit-box-direction: reverse;\n -ms-flex-direction: column-reverse;\n flex-direction: column-reverse;\n}\n._3Aw3T1 {\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n._10X-3Q {\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: start;\n}\n._33a0v9 {\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: end;\n}\n._3qMVGq {\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n._2REBgi {\n -ms-flex-pack: distribute;\n justify-content: space-around;\n}\n._3zq1C_ {\n -webkit-box-pack: space-evenly;\n -ms-flex-pack: space-evenly;\n justify-content: space-evenly;\n}\n.hUFwKI {\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n._1BOjPg {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: start;\n}\n._3AQmNs {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: end;\n}\n._3orDH1 {\n -webkit-box-align: stretch;\n -ms-flex-align: stretch;\n align-items: stretch;\n}\n.qh7on_ {\n -webkit-box-align: baseline;\n -ms-flex-align: baseline;\n align-items: baseline;\n}\n._1C0eq8 {\n display: grid;\n}\n._3JhbNt {\n grid-gap: var(--layout--gap-none--space);\n gap: var(--layout--gap-none--space);\n}\n.yQz5G0 {\n grid-gap: var(--layout--gap-small--space);\n gap: var(--layout--gap-small--space);\n}\n.sj0cbB {\n grid-gap: var(--layout--gap-base--space);\n gap: var(--layout--gap-base--space);\n}\n._22Ohoz {\n grid-gap: var(--layout--gap-medium--space);\n gap: var(--layout--gap-medium--space);\n}\n._16o5et {\n grid-gap: var(--layout--gap-large--space);\n gap: var(--layout--gap-large--space);\n}\n._25SpXB {\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n._3GDeqz {\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: start;\n}\n._2-jaGe {\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: end;\n}\n._3lGct7 {\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n._2wHTdX {\n -ms-flex-pack: distribute;\n justify-content: space-around;\n}\n._1BVKaN {\n -webkit-box-pack: space-evenly;\n -ms-flex-pack: space-evenly;\n justify-content: space-evenly;\n}\n._3QOaa3 {\n -ms-flex-line-pack: center;\n align-content: center;\n}\n._2pBQs3 {\n -ms-flex-line-pack: justify;\n align-content: space-between;\n}\n.gTA891 {\n -ms-flex-line-pack: distribute;\n align-content: space-around;\n}\n._H9jFl {\n -ms-flex-line-pack: space-evenly;\n align-content: space-evenly;\n}\n._2pB881 {\n -ms-flex-line-pack: stretch;\n align-content: stretch;\n}\n.ctOm0o {\n justify-items: start;\n}\n._3ZqB_F {\n justify-items: center;\n}\n.Ya0UyE {\n justify-items: end;\n}\n._180uXD {\n justify-items: stretch;\n}\n._1nyAA2 {\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n._1Xe-EI {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: start;\n}\n._3hQvqA {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: end;\n}\n.KBSz7h {\n -webkit-box-align: stretch;\n -ms-flex-align: stretch;\n align-items: stretch;\n}\n.KBW4yE {\n -webkit-box-align: baseline;\n -ms-flex-align: baseline;\n align-items: baseline;\n}\n"; | ||
var styles = {__id:"/home/jenkins/workspace/design-system_PR-26/packages/web-core/src/layout/style/index.module.less",__css:css_248z,"LayoutFlex":"_15uGWh","LayoutFlex--nowrap":"_3rnoor","LayoutFlex--inline":"_1_IXQm","LayoutFlex--gap-none":"_1eu8AB","LayoutFlex--gap-small":"_3yYLRc","LayoutFlex--gap-base":"_1nDuVC","LayoutFlex--gap-medium":"ZknBAf","LayoutFlex--gap-large":"_1WqO9Z","LayoutFlex--row-fwd":"X4eHUe","LayoutFlex--row-rev":"_3_M_4w","LayoutFlex--column-fwd":"_2ByMq1","LayoutFlex--column-rev":"_3_8VIk","LayoutFlex--justify-content-center":"_3Aw3T1","LayoutFlex--justify-content-start":"_10X-3Q","LayoutFlex--justify-content-end":"_33a0v9","LayoutFlex--justify-content-space-between":"_3qMVGq","LayoutFlex--justify-content-space-around":"_2REBgi","LayoutFlex--justify-content-space-evenly":"_3zq1C_","LayoutFlex--align-items-center":"hUFwKI","LayoutFlex--align-items-start":"_1BOjPg","LayoutFlex--align-items-end":"_3AQmNs","LayoutFlex--align-items-stretch":"_3orDH1","LayoutFlex--align-items-baseline":"qh7on_","LayoutGrid":"_1C0eq8","LayoutGrid--gap-none":"_3JhbNt","LayoutGrid--gap-small":"yQz5G0","LayoutGrid--gap-base":"sj0cbB","LayoutGrid--gap-medium":"_22Ohoz","LayoutGrid--gap-large":"_16o5et","LayoutGrid--justify-content-center":"_25SpXB","LayoutGrid--justify-content-start":"_3GDeqz","LayoutGrid--justify-content-end":"_2-jaGe","LayoutGrid--justify-content-space-between":"_3lGct7","LayoutGrid--justify-content-space-around":"_2wHTdX","LayoutGrid--justify-content-space-evenly":"_1BVKaN","LayoutGrid--align-content-center":"_3QOaa3","LayoutGrid--align-content-space-between":"_2pBQs3","LayoutGrid--align-content-space-around":"gTA891","LayoutGrid--align-content-space-evenly":"_H9jFl","LayoutGrid--align-content-stretch":"_2pB881","LayoutGrid--justify-items-start":"ctOm0o","LayoutGrid--justify-items-center":"_3ZqB_F","LayoutGrid--justify-items-end":"Ya0UyE","LayoutGrid--justify-items-stretch":"_180uXD","LayoutGrid--align-items-center":"_1nyAA2","LayoutGrid--align-items-start":"_1Xe-EI","LayoutGrid--align-items-end":"_3hQvqA","LayoutGrid--align-items-stretch":"KBSz7h","LayoutGrid--align-items-baseline":"KBW4yE"}; | ||
var styles = {__id:"/home/jenkins/workspace/design-system_main/packages/web-core/src/layout/style/index.module.less",__css:css_248z,"LayoutFlex":"_15uGWh","LayoutFlex--nowrap":"_3rnoor","LayoutFlex--inline":"_1_IXQm","LayoutFlex--gap-none":"_1eu8AB","LayoutFlex--gap-small":"_3yYLRc","LayoutFlex--gap-base":"_1nDuVC","LayoutFlex--gap-medium":"ZknBAf","LayoutFlex--gap-large":"_1WqO9Z","LayoutFlex--row-fwd":"X4eHUe","LayoutFlex--row-rev":"_3_M_4w","LayoutFlex--column-fwd":"_2ByMq1","LayoutFlex--column-rev":"_3_8VIk","LayoutFlex--justify-content-center":"_3Aw3T1","LayoutFlex--justify-content-start":"_10X-3Q","LayoutFlex--justify-content-end":"_33a0v9","LayoutFlex--justify-content-space-between":"_3qMVGq","LayoutFlex--justify-content-space-around":"_2REBgi","LayoutFlex--justify-content-space-evenly":"_3zq1C_","LayoutFlex--align-items-center":"hUFwKI","LayoutFlex--align-items-start":"_1BOjPg","LayoutFlex--align-items-end":"_3AQmNs","LayoutFlex--align-items-stretch":"_3orDH1","LayoutFlex--align-items-baseline":"qh7on_","LayoutGrid":"_1C0eq8","LayoutGrid--gap-none":"_3JhbNt","LayoutGrid--gap-small":"yQz5G0","LayoutGrid--gap-base":"sj0cbB","LayoutGrid--gap-medium":"_22Ohoz","LayoutGrid--gap-large":"_16o5et","LayoutGrid--justify-content-center":"_25SpXB","LayoutGrid--justify-content-start":"_3GDeqz","LayoutGrid--justify-content-end":"_2-jaGe","LayoutGrid--justify-content-space-between":"_3lGct7","LayoutGrid--justify-content-space-around":"_2wHTdX","LayoutGrid--justify-content-space-evenly":"_1BVKaN","LayoutGrid--align-content-center":"_3QOaa3","LayoutGrid--align-content-space-between":"_2pBQs3","LayoutGrid--align-content-space-around":"gTA891","LayoutGrid--align-content-space-evenly":"_H9jFl","LayoutGrid--align-content-stretch":"_2pB881","LayoutGrid--justify-items-start":"ctOm0o","LayoutGrid--justify-items-center":"_3ZqB_F","LayoutGrid--justify-items-end":"Ya0UyE","LayoutGrid--justify-items-stretch":"_180uXD","LayoutGrid--align-items-center":"_1nyAA2","LayoutGrid--align-items-start":"_1Xe-EI","LayoutGrid--align-items-end":"_3hQvqA","LayoutGrid--align-items-stretch":"KBSz7h","LayoutGrid--align-items-baseline":"KBW4yE"}; | ||
var stylesheet=css_248z; | ||
@@ -6,0 +6,0 @@ styleInject(css_248z); |
@@ -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; | ||
} |
@@ -7,5 +7,4 @@ import React from 'react'; | ||
this.getStyleElement = () => { | ||
const styles = Object.values(this.styles).join(''); | ||
const html = `/* @preply/ds-web-root critical CSS: */ ${styles}`; | ||
return (React.createElement("style", { | ||
const html = Object.values(this.styles).join(''); | ||
return (React.createElement("style", { "data-id": "@preply/ds-web-core critical CSS", | ||
// eslint-disable-next-line react/no-danger | ||
@@ -23,2 +22,2 @@ dangerouslySetInnerHTML: { | ||
export { ServerStyleSheet }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2VydmVyU3R5bGVTaGVldC5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3Nzci9jbGFzc2VzL1NlcnZlclN0eWxlU2hlZXQudHN4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBGQyB9IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHR5cGUgeyBDU1NNb2R1bGUsIENTU01vZHVsZUNvbnRlbnQsIENTU01vZHVsZUlkIH0gZnJvbSAnLi4vLi4vY3NzLW1vZHVsZS90eXBlcyc7XG5cbmV4cG9ydCBjbGFzcyBTZXJ2ZXJTdHlsZVNoZWV0IHtcbiAgICBzdHlsZXM6IFJlY29yZDxDU1NNb2R1bGVJZCwgQ1NTTW9kdWxlQ29udGVudD4gPSB7fTtcblxuICAgIGFkZFN0eWxlKHsgX19pZDogaWQsIF9fY3NzOiBjc3MgfTogQ1NTTW9kdWxlKTogdm9pZCB7XG4gICAgICAgIHRoaXMuc3R5bGVzW2lkXSA9IGNzcztcbiAgICB9XG5cbiAgICBnZXRTdHlsZUVsZW1lbnQ6IEZDID0gKCkgPT4ge1xuICAgICAgICBjb25zdCBzdHlsZXMgPSBPYmplY3QudmFsdWVzKHRoaXMuc3R5bGVzKS5qb2luKCcnKTtcbiAgICAgICAgY29uc3QgaHRtbCA9IGAvKiBAcHJlcGx5L2RzLXdlYi1yb290IGNyaXRpY2FsIENTUzogKi8gJHtzdHlsZXN9YDtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxzdHlsZVxuICAgICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSByZWFjdC9uby1kYW5nZXJcbiAgICAgICAgICAgICAgICBkYW5nZXJvdXNseVNldElubmVySFRNTD17e1xuICAgICAgICAgICAgICAgICAgICBfX2h0bWw6IGh0bWwsXG4gICAgICAgICAgICAgIC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LHVCQUF1QixFQUFFO29CQUNyQixNQUFNLEVBQUUsSUFBSTtpQkFDZixHQUNILEVBQ0o7U0FDTCxDQUFDO0tBQ0w7SUFoQkcsUUFBUSxDQUFDLEVBQUUsSUFBSSxFQUFFLEVBQUUsRUFBRSxLQUFLLEVBQUUsR0FBRyxFQUFhO1FBQ3hDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLEdBQUcsR0FBRyxDQUFDO0tBQ3pCOzs7OzsifQ== |
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 }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3R5bGVFeHRyYWN0Q29udGV4dC5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3Nzci9jb250ZXh0cy9TdHlsZUV4dHJhY3RDb250ZXh0LnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgRkMsIGNyZWF0ZUNvbnRleHQgfSBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCB7IFNlcnZlclN0eWxlU2hlZXQgfSBmcm9tICcuLi9jbGFzc2VzL1NlcnZlclN0eWxlU2hlZXQnO1xuXG5leHBvcnQgdHlwZSBTdHlsZUV4dHJhY3RDb250ZXh0U3RhdGUgPSBTZ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O0FBQ047Ozs7In0= |
import type { CSSModule } from '../../css-module/types'; | ||
export declare const useStyleExtract: (styles: CSSModule) => void; | ||
export declare const useStyleExtract: (styles: CSSModule | CSSModule[]) => void; |
@@ -7,3 +7,8 @@ import { useContext } from 'react'; | ||
if (stylesheet.addStyle) { | ||
stylesheet.addStyle(styles); | ||
if (Array.isArray(styles)) { | ||
styles.forEach(stylesheet.addStyle); | ||
} | ||
else { | ||
stylesheet.addStyle(styles); | ||
} | ||
} | ||
@@ -13,2 +18,2 @@ }; | ||
export { useStyleExtract }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlU3R5bGVFeHRyYWN0LmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3NyL2hvb2tzL3VzZVN0eWxlRXh0cmFjdC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDb250ZXh0IH0gZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgdHlwZSB7IENTU01vZHVsZSB9IGZyb20gJy4uLy4uL2Nzcy1tb2R1bGUvdHlwZXMnO1xuaW1wb3J0IHsgU3R5bGVFeHRyYWN0Q29udGV4dCB9IGZyb20gJy4uL2NvbnRleHRzL1N0eWxlRXh0cmFjdENvbnRleHQnO1xuXG5leHBvcnQgY29uc3QgdXNlU3R5bGVFeHRyYWN0ID0gKHN0eWxlczogQ1NTTW9kdWxlKTogdm9pZCA9PiB7XG4gICAgY29uc3Qgc3R5bGVzaGVldCA9IHVzZUNvbnRleHQoU3R5bGVFeHRyYWN0Q29udGV4dCk7XG4gICAgaWYgKHN0eWxlc2hlZXQuYWRkU3R5bGUpIHtcbiAgICAgICAgc3R5bGVzaGVldC5hZGRTdHlsZShzdHlsZXMpO1xuICAgIH1cbn07XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O01BS2EsZUFBZSxHQUFHLENBQUMsTUFBaUI7SUFDN0MsTUFBTSxV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ZUFBZSxHQUFHLENBQUMsTUFBK0I7SUFDM0QsTUFBTSxVQUFVLEdBQUcsVUFBVSxDQUFDLG1CQUFtQixDQUFDLENBQUM7SUFDbkQsSUFBSSxVQUFVLENBQUMsUUFBUSxFQUFFO1FBQ3JCLElBQUksS0FBSyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsRUFBRTtZQUN2QixNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxRQUFRLENBQUMsQ0FBQztTQUN2QzthQUFNO1lBQ0gsVUFBVSxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQztTQUMvQjtLQUNKO0FBQ0w7Ozs7In0= |
@@ -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; |
@@ -29,4 +29,9 @@ import { safeClassName } from '../../css-module/index.js'; | ||
const selfClass = safeClassName(this.styles, Theme.PREFIX + this.name); | ||
return [selfClass, ...extendedClasses].join(' '); | ||
return [...extendedClasses, selfClass].join(' '); | ||
} | ||
getStyles() { | ||
const extendedStyles = this.extend.map(theme => theme.getStyles()).flat() || []; | ||
// order matters, self styles should follow inherited theme(s) | ||
return [...extendedStyles, this.styles]; | ||
} | ||
fgColor(component, variant) { | ||
@@ -43,5 +48,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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGhlbWUuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90aGVtZS9jbGFzc2VzL1RoZW1lLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgVGhlbWVOYW1lIH0gZnJvbSAnQHByZXBseS9kcy1jb3JlJztcblxuaW1wb3J0IHsgc2FmZUNsYXNzTmFtZSB9IGZyb20gJy4uLy4uL2Nzcy1tb2R1bGUnO1xuaW1wb3J0IHR5cGUgeyBDU1NNb2R1bGUgfSBmcm9tICcuLi8uLi9jc3MtbW9kdWxlL3R5cGVzJztcbmltcG9ydCB7IFRPS0VOX0NPTE9SX0JHLCBUT0tFTl9DT0xPUl9GRywgVE9LRU5fUkFESVVTIH0gZnJvbSAnLi4vY29uc3RhbnRzJztcbmltcG9ydCB0eXBlIHsgVGhlbWVJbnRlcmZhY2UsIFRva2VuTWFwIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY2xhc3MgVGhlbWUgaW1wbGVtZW50cyBUaGVtZUludGVyZmFjZSB7XG4gICAgc3RhdGljIFBSRUZJWCA9ICdkcy0nO1xuICAgIHN0YXRpYyBST09UX0NMQVNTID0gJ3Jvb3QnO1xuXG4gICAgcHJpdmF0ZSBzdHlsZXM6IENTU01vZHVsZTtcbiAgICBwcml2YXRlIHZhbHVlcz86IFRva2VuTWFwO1xuICAgIHByaXZhdGUgdG9rZW5zPzogVG9rZW5NYXA7XG4gICAgcHJpdmF0ZSBleHRlbmQ6IFRoZW1lW107XG4gICAgcHVibGljIHJlYWRvbmx5IG5hbWU7XG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BSyxDQUFDLFNBQVMsRUFBRSxDQUFDLENBQUMsSUFBSSxFQUFFLElBQUksRUFBRSxDQUFDOztRQUVoRixPQUFPLENBQUMsR0FBRyxjQUFjLEVBQUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0tBQzNDO0lBRUQsT0FBTyxDQUFDLFNBQWlCLEVBQUUsT0FBZTtRQUN0QyxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxjQUFjLElBQUksU0FBUyxJQUFJLE9BQU8sRUFBRSxDQUFDLENBQUM7S0FDbEU7SUFFRCxPQUFPLENBQUMsU0FBaUIsRUFBRSxPQUFlO1FBQ3RDLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLGNBQWMsSUFBSSxTQUFTLElBQUksT0FBTyxFQUFFLENBQUMsQ0FBQztLQUNsRTtJQUVELE1BQU0sQ0FBQyxTQUFpQjtRQUNwQixPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxZQUFZLElBQUksU0FBUyxFQUFFLENBQUMsQ0FBQztLQUNyRDs7QUEzRE0sWUFBTSxHQUFHLEtBQUs7Ozs7In0= |
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(); | ||
useStyleExtract(styles); | ||
return { theme }; | ||
@@ -14,2 +17,2 @@ }; | ||
export { useTheme }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlVGhlbWUuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90aGVtZS9ob29rcy91c2VUaGVtZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDb250ZXh0IH0gZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgdHlwZSB7IFRoZW1lQ29udG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CB0eXBlIHsgVGhlbWVDb250ZXh0U3RhdGUgfSBmcm9tICcuLi9wcm92aWRlcnMvVGhlbWVQcm92aWRlcic7XG5pbXBvcnQgeyBUaGVtZUNvbnRleHQgfSBmcm9tICcuLi9wcm92aWRlcnMvVGhlbWVQcm92aWRlcic7XG5cbmV4cG9ydCBjb25zdCB1c2VUaGVtZSA9ICgpOiBUaGVtZUNvbnRleHRTdGF0ZSA9PiB7XG4gICAgY29uc3QgeyB0aGVtZSB9ID0gdXNlQ29udGV4dChUaGVtZUNvbnRleHQpO1xuICAgIGlmICghdGhlbWUpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1c2VUaGVtZSgpIG11c3QgYmUgdXNlZCB3aXRoaW4gYSBUaGVtZVByb3ZpZGVyJyk7XG4gICAgfVxuXG4gICAgY29uc3Qgc3R5bGVzID0gdGhlbWUuZ2V0U3R5bGVzKCk7XG4gICAgdXNlU3R5bGVFeHRyYWN0KHN0eWxlcyk7XG5cbiAgICByZXR1cm4geyB0aGVtZSB9O1xufTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O01BTWEsUUFBUSxHQUFHO0lBQ3BCLE1BQU0sRUFBRSxLQUFLLEVBQUUsR0FBRyxVQUFVLENBQUMsWUFBWSxDQUFDLENBQUM7SUFDM0MsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNSLE1BQU0sSUFBSSxLQUFLLENBQUMsZ0RBQWdELENBQUMsQ0FBQztLQUNyRTtJQUVELE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxTQUFTLEVBQUUsQ0FBQztJQUNqQyxlQUFlLENBQUMsTUFBTSxDQUFDLENBQUM7SUFFeEIsT0FBTyxFQUFFLEtBQUssRUFBRSxDQUFDO0FBQ3JCOzs7OyJ9 |
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.fd5a7b0f7a76bff6c6b746cb73724ddc428b9c6d.45+fd5a7b0", | ||
"version": "0.7.0", | ||
"publishConfig": { | ||
@@ -22,10 +22,10 @@ "access": "public" | ||
"dependencies": { | ||
"@preply/ds-core": "^0.6.1-beta.fd5a7b0f7a76bff6c6b746cb73724ddc428b9c6d.45+fd5a7b0" | ||
"@preply/ds-core": "0.7.0" | ||
}, | ||
"peerDependencies": { | ||
"@preply/ds-core": "0.6.0", | ||
"@preply/ds-core": "0.7.0", | ||
"react": "^16.8.3", | ||
"react-dom": "^16.8.3" | ||
}, | ||
"gitHead": "fd5a7b0f7a76bff6c6b746cb73724ddc428b9c6d" | ||
"gitHead": "747f8ae3f6506b5efc1d64947a27b6b69f55ce18" | ||
} |
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
111847
103
1071
0
+ Added@preply/ds-core@0.7.0(transitive)
- Removed@preply/ds-core@0.6.1-beta.fd5a7b0f7a76bff6c6b746cb73724ddc428b9c6d.45(transitive)
Updated@preply/ds-core@0.7.0