You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@nivo/theming

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nivo/theming - npm Package Compare versions

Comparing version
0.93.0
to
0.94.0
+16
dist/types/bridge.d.ts
import { TextStyle } from './types';
export type Engine = 'svg' | 'css' | 'canvas';
export type TextAlign = 'start' | 'center' | 'end';
export type TextBaseline = 'top' | 'center' | 'bottom';
export interface EngineStyleAttributesMapping {
textAlign: Record<TextAlign, string>;
textBaseline: Record<TextBaseline, string>;
}
export declare const svgStyleAttributesMapping: EngineStyleAttributesMapping;
export declare const cssStyleAttributesMapping: EngineStyleAttributesMapping;
export declare const canvasStyleAttributesMapping: EngineStyleAttributesMapping;
export declare const styleAttributesMapping: Record<Engine, EngineStyleAttributesMapping>;
export declare const convertStyleAttribute: <K extends keyof EngineStyleAttributesMapping>(engine: Engine, attr: K, value: keyof EngineStyleAttributesMapping[K]) => EngineStyleAttributesMapping[K][keyof EngineStyleAttributesMapping[K]];
export declare const sanitizeSvgTextStyle: (style: TextStyle) => Omit<TextStyle, "outlineWidth" | "outlineColor" | "outlineOpacity">;
export declare const sanitizeHtmlTextStyle: (style: TextStyle) => Omit<TextStyle, "outlineWidth" | "outlineColor" | "outlineOpacity" | "fill">;
//# sourceMappingURL=bridge.d.ts.map
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE7C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAClD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEtD,MAAM,WAAW,4BAA4B;IACzC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IACpC,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;CAC7C;AAED,eAAO,MAAM,yBAAyB,EAAE,4BAWvC,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,4BAWvC,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,4BAW1C,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAI/E,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,4BAA4B,EAC9E,QAAQ,MAAM,EACd,MAAM,CAAC,EACP,OAAO,MAAM,4BAA4B,CAAC,CAAC,CAAC,2EAG/C,CAAA;AAED,eAAO,MAAM,oBAAoB,GAC7B,OAAO,SAAS,KACjB,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAIpE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAC9B,OAAO,SAAS,KACjB,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,MAAM,CAO7E,CAAA"}
+1
-1

@@ -1,2 +0,2 @@

"use strict";var e=require("react"),t=require("lodash/merge.js"),i=require("lodash/get.js"),n=require("lodash/set.js"),o=require("react/jsx-runtime");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},r.apply(null,arguments)}var l=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],s=function(e,t){return r({},t,e)},a=function(e,o){var r=t({},e,o);return l.forEach((function(e){n(r,e,s(i(r,e),r.text))})),r},u=function(e,i){return i?t({},e,i):e},f={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"#ffffff",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}},d=function(t){return e.useMemo((function(){return a(f,t)}),[t])},x=e.createContext(null),h={},c=["outlineWidth","outlineColor","outlineOpacity"];exports.ThemeContext=x,exports.ThemeProvider=function(e){var t=e.theme,i=void 0===t?h:t,n=e.children,r=d(i);return o.jsx(x.Provider,{value:r,children:n})},exports.defaultTheme=f,exports.extendAxisTheme=u,exports.extendDefaultTheme=a,exports.inheritRootThemeText=s,exports.sanitizeSvgTextStyle=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,c)},exports.useExtendedAxisTheme=function(t,i){return e.useMemo((function(){return u(t,i)}),[t,i])},exports.usePartialTheme=d,exports.useTheme=function(){var t=e.useContext(x);if(null===t)throw new Error("Unable to find the theme, did you forget to wrap your component with ThemeProvider?");return t};
"use strict";var t=require("react"),e=require("lodash/merge.js"),i=require("lodash/get.js"),n=require("lodash/set.js"),o=require("react/jsx-runtime");function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},r.apply(null,arguments)}function l(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}var s=["outlineWidth","outlineColor","outlineOpacity"],a=["fill","outlineWidth","outlineColor","outlineOpacity"],u={textAlign:{start:"start",center:"middle",end:"end"},textBaseline:{top:"text-before-edge",center:"middle",bottom:"text-after-edge"}},d={textAlign:{start:"left",center:"center",end:"right"},textBaseline:{top:"top",center:"middle",bottom:"bottom"}},f={textAlign:{start:"left",center:"center",end:"right"},textBaseline:{top:"top",center:"middle",bottom:"bottom"}},x={svg:u,css:d,canvas:f},c=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],p=function(t,e){return r({},e,t)},h=function(t,o){var r=e({},t,o);return c.forEach((function(t){n(r,t,p(i(r,t),r.text))})),r},g=function(t,i){return i?e({},t,i):t},m={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"#ffffff",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}},b=function(e){return t.useMemo((function(){return h(m,e)}),[e])},y=t.createContext(null),k={};exports.ThemeContext=y,exports.ThemeProvider=function(t){var e=t.theme,i=void 0===e?k:e,n=t.children,r=b(i);return o.jsx(y.Provider,{value:r,children:n})},exports.canvasStyleAttributesMapping=f,exports.convertStyleAttribute=function(t,e,i){return x[t][e][i]},exports.cssStyleAttributesMapping=d,exports.defaultTheme=m,exports.extendAxisTheme=g,exports.extendDefaultTheme=h,exports.inheritRootThemeText=p,exports.sanitizeHtmlTextStyle=function(t){var e=t.fill;return t.outlineWidth,t.outlineColor,t.outlineOpacity,r({},l(t,a),{color:e})},exports.sanitizeSvgTextStyle=function(t){return t.outlineWidth,t.outlineColor,t.outlineOpacity,l(t,s)},exports.styleAttributesMapping=x,exports.svgStyleAttributesMapping=u,exports.useExtendedAxisTheme=function(e,i){return t.useMemo((function(){return g(e,i)}),[e,i])},exports.usePartialTheme=b,exports.useTheme=function(){var e=t.useContext(y);if(null===e)throw new Error("Unable to find the theme, did you forget to wrap your component with ThemeProvider?");return e};
//# sourceMappingURL=nivo-theming.cjs.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"nivo-theming.cjs.js","sources":["../src/extend.ts","../src/defaults.ts","../src/hooks.ts","../src/context.tsx","../src/svg.ts"],"sourcesContent":["import merge from 'lodash/merge.js'\nimport get from 'lodash/get.js'\nimport set from 'lodash/set.js'\nimport { ThemeWithoutInheritance, PartialTheme, Theme, TextStyle } from './types'\n\nconst textPropsWithInheritance = [\n 'axis.ticks.text',\n 'axis.legend.text',\n 'legends.title.text',\n 'legends.text',\n 'legends.ticks.text',\n 'legends.title.text',\n 'labels.text',\n 'dots.text',\n 'markers.text',\n 'annotations.text',\n]\n\nexport const inheritRootThemeText = (\n partialStyle: Partial<TextStyle>,\n rootStyle: TextStyle\n): TextStyle => ({\n ...rootStyle,\n ...partialStyle,\n})\n\nexport const extendDefaultTheme = (\n defaultTheme: ThemeWithoutInheritance,\n customTheme: PartialTheme\n) => {\n const theme = merge({}, defaultTheme, customTheme) as Theme\n\n textPropsWithInheritance.forEach(prop => {\n set(theme, prop, inheritRootThemeText(get(theme, prop), theme.text))\n })\n\n return theme\n}\n\n// We support various types of axes, top, right, bottom, polar...\n// Adding new entries for each axis type is not necessarily ideal to\n// allow the customization of the theme for a specific axis.\n// We might even support multiple axes of the same type in the future.\n// We can use this helper to extend the theme for a specific axis type,\n// the overrides being provided as a property of the axis type.\n// This helper assumes that we're extending a complete theme,\n// because it's going to be used deeper in the component tree.\nexport const extendAxisTheme = (\n axisTheme: Theme['axis'],\n overrides: PartialTheme['axis']\n): Theme['axis'] => {\n if (!overrides) return axisTheme\n return merge({}, axisTheme, overrides)\n}\n","import { ThemeWithoutInheritance } from './types'\n\nexport const defaultTheme: ThemeWithoutInheritance = {\n background: 'transparent',\n text: {\n fontFamily: 'sans-serif',\n fontSize: 11,\n fill: '#333333',\n outlineWidth: 0,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n axis: {\n domain: {\n line: {\n stroke: 'transparent',\n strokeWidth: 1,\n },\n },\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {},\n },\n legend: {\n text: {\n fontSize: 12,\n },\n },\n },\n grid: {\n line: {\n stroke: '#dddddd',\n strokeWidth: 1,\n },\n },\n legends: {\n hidden: {\n symbol: {\n fill: '#333333',\n opacity: 0.6,\n },\n text: {\n fill: '#333333',\n opacity: 0.6,\n },\n },\n text: {},\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {\n fontSize: 10,\n },\n },\n title: {\n text: {},\n },\n },\n labels: {\n text: {},\n },\n markers: {\n lineColor: '#000000',\n lineStrokeWidth: 1,\n text: {},\n },\n dots: {\n text: {},\n },\n tooltip: {\n container: {\n background: 'white',\n color: 'inherit',\n fontSize: 'inherit',\n borderRadius: '2px',\n boxShadow: '0 1px 2px rgba(0, 0, 0, 0.25)',\n padding: '5px 9px',\n },\n basic: {\n whiteSpace: 'pre',\n display: 'flex',\n alignItems: 'center',\n },\n chip: {\n marginRight: 7,\n },\n table: {},\n tableCell: {\n padding: '3px 5px',\n },\n tableCellValue: {\n fontWeight: 'bold',\n },\n },\n crosshair: {\n line: {\n stroke: '#000000',\n strokeWidth: 1,\n strokeOpacity: 0.75,\n strokeDasharray: '6 6',\n },\n },\n annotations: {\n text: {\n fontSize: 13,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n link: {\n stroke: '#000000',\n strokeWidth: 1,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n outline: {\n fill: 'none',\n stroke: '#000000',\n strokeWidth: 2,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n symbol: {\n fill: '#000000',\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n },\n}\n","import { useMemo } from 'react'\nimport { extendDefaultTheme, extendAxisTheme } from './extend'\nimport { defaultTheme } from './defaults'\nimport { PartialTheme, Theme } from './types'\n\nexport const usePartialTheme = (partialTheme: PartialTheme) => {\n return useMemo(() => extendDefaultTheme(defaultTheme, partialTheme), [partialTheme])\n}\n\nexport const useExtendedAxisTheme = (axisTheme: Theme['axis'], overrides: PartialTheme['axis']) => {\n return useMemo(() => extendAxisTheme(axisTheme, overrides), [axisTheme, overrides])\n}\n","import { createContext, useContext, PropsWithChildren } from 'react'\nimport { usePartialTheme } from './hooks'\nimport { PartialTheme, Theme } from './types'\n\nexport const ThemeContext = createContext<Theme | null>(null)\n\n// required to preserve equality\nconst defaultPartialTheme = {}\n\nexport const ThemeProvider = ({\n theme: partialTheme = defaultPartialTheme,\n children,\n}: PropsWithChildren<{\n theme: PartialTheme\n}>) => {\n const theme = usePartialTheme(partialTheme)\n\n return <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>\n}\n\nexport const useTheme = () => {\n const theme = useContext(ThemeContext)\n if (theme === null) {\n throw new Error(\n 'Unable to find the theme, did you forget to wrap your component with ThemeProvider?'\n )\n }\n\n return theme\n}\n","import { TextStyle } from './types'\n\n/**\n * Cleanup theme text style so that all properties\n * are valid for an SVG text element.\n */\nexport const sanitizeSvgTextStyle = (\n style: TextStyle\n): Omit<TextStyle, 'outlineWidth' | 'outlineColor' | 'outlineOpacity'> => {\n const { outlineWidth, outlineColor, outlineOpacity, ...sanitized } = style\n\n return sanitized\n}\n"],"names":["textPropsWithInheritance","inheritRootThemeText","partialStyle","rootStyle","_extends","extendDefaultTheme","defaultTheme","customTheme","theme","merge","forEach","prop","set","get","text","extendAxisTheme","axisTheme","overrides","background","fontFamily","fontSize","fill","outlineWidth","outlineColor","outlineOpacity","axis","domain","line","stroke","strokeWidth","ticks","legend","grid","legends","hidden","symbol","opacity","title","labels","markers","lineColor","lineStrokeWidth","dots","tooltip","container","color","borderRadius","boxShadow","padding","basic","whiteSpace","display","alignItems","chip","marginRight","table","tableCell","tableCellValue","fontWeight","crosshair","strokeOpacity","strokeDasharray","annotations","link","outline","usePartialTheme","partialTheme","useMemo","ThemeContext","createContext","defaultPartialTheme","_ref","_ref$theme","children","_jsx","jsx","Provider","value","style","_objectWithoutPropertiesLoose","_excluded","useContext","Error"],"mappings":"8WAKA,IAAMA,EAA2B,CAC7B,kBACA,mBACA,qBACA,eACA,qBACA,qBACA,cACA,YACA,eACA,oBAGSC,EAAuB,SAChCC,EACAC,GAAoB,OAAAC,EAAA,CAAA,EAEjBD,EACAD,EAAY,EAGNG,EAAqB,SAC9BC,EACAC,GAEA,IAAMC,EAAQC,EAAM,CAAE,EAAEH,EAAcC,GAMtC,OAJAP,EAAyBU,SAAQ,SAAAC,GAC7BC,EAAIJ,EAAOG,EAAMV,EAAqBY,EAAIL,EAAOG,GAAOH,EAAMM,MAClE,IAEON,CACX,EAUaO,EAAkB,SAC3BC,EACAC,GAEA,OAAKA,EACER,EAAM,CAAA,EAAIO,EAAWC,GADLD,CAE3B,ECnDaV,EAAwC,CACjDY,WAAY,cACZJ,KAAM,CACFK,WAAY,aACZC,SAAU,GACVC,KAAM,UACNC,aAAc,EACdC,aAAc,UACdC,eAAgB,GAEpBC,KAAM,CACFC,OAAQ,CACJC,KAAM,CACFC,OAAQ,cACRC,YAAa,IAGrBC,MAAO,CACHH,KAAM,CACFC,OAAQ,UACRC,YAAa,GAEjBf,KAAM,CAAC,GAEXiB,OAAQ,CACJjB,KAAM,CACFM,SAAU,MAItBY,KAAM,CACFL,KAAM,CACFC,OAAQ,UACRC,YAAa,IAGrBI,QAAS,CACLC,OAAQ,CACJC,OAAQ,CACJd,KAAM,UACNe,QAAS,IAEbtB,KAAM,CACFO,KAAM,UACNe,QAAS,KAGjBtB,KAAM,CAAE,EACRgB,MAAO,CACHH,KAAM,CACFC,OAAQ,UACRC,YAAa,GAEjBf,KAAM,CACFM,SAAU,KAGlBiB,MAAO,CACHvB,KAAM,CAAC,IAGfwB,OAAQ,CACJxB,KAAM,CAAC,GAEXyB,QAAS,CACLC,UAA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SAAC,WAAA,OAAMpD,EAAgBC,EAAWC,EAAU,GAAE,CAACD,EAAWC,GAC5E,6CCSwB,WACpB,IAAMT,EAAQyE,aAAWb,GACzB,GAAc,OAAV5D,EACA,MAAM,IAAI0E,MACN,uFAIR,OAAO1E,CACX"}
{"version":3,"file":"nivo-theming.cjs.js","sources":["../src/bridge.ts","../src/extend.ts","../src/defaults.ts","../src/hooks.ts","../src/context.tsx"],"sourcesContent":["import { TextStyle } from './types'\n\nexport type Engine = 'svg' | 'css' | 'canvas'\n\nexport type TextAlign = 'start' | 'center' | 'end'\nexport type TextBaseline = 'top' | 'center' | 'bottom'\n\nexport interface EngineStyleAttributesMapping {\n textAlign: Record<TextAlign, string>\n textBaseline: Record<TextBaseline, string>\n}\n\nexport const svgStyleAttributesMapping: EngineStyleAttributesMapping = {\n textAlign: {\n start: 'start',\n center: 'middle',\n end: 'end',\n },\n textBaseline: {\n top: 'text-before-edge',\n center: 'middle',\n bottom: 'text-after-edge',\n },\n}\n\nexport const cssStyleAttributesMapping: EngineStyleAttributesMapping = {\n textAlign: {\n start: 'left',\n center: 'center',\n end: 'right',\n },\n textBaseline: {\n top: 'top',\n center: 'middle',\n bottom: 'bottom',\n },\n}\n\nexport const canvasStyleAttributesMapping: EngineStyleAttributesMapping = {\n textAlign: {\n start: 'left',\n center: 'center',\n end: 'right',\n },\n textBaseline: {\n top: 'top',\n center: 'middle',\n bottom: 'bottom',\n },\n}\n\nexport const styleAttributesMapping: Record<Engine, EngineStyleAttributesMapping> = {\n svg: svgStyleAttributesMapping,\n css: cssStyleAttributesMapping,\n canvas: canvasStyleAttributesMapping,\n}\n\nexport const convertStyleAttribute = <K extends keyof EngineStyleAttributesMapping>(\n engine: Engine,\n attr: K,\n value: keyof EngineStyleAttributesMapping[K]\n) => {\n return styleAttributesMapping[engine][attr][value]\n}\n\nexport const sanitizeSvgTextStyle = (\n style: TextStyle\n): Omit<TextStyle, 'outlineWidth' | 'outlineColor' | 'outlineOpacity'> => {\n const { outlineWidth, outlineColor, outlineOpacity, ...sanitized } = style\n\n return sanitized\n}\n\nexport const sanitizeHtmlTextStyle = (\n style: TextStyle\n): Omit<TextStyle, 'outlineWidth' | 'outlineColor' | 'outlineOpacity' | 'fill'> => {\n const { fill, outlineWidth, outlineColor, outlineOpacity, ...sanitized } = style\n\n return {\n ...sanitized,\n color: fill,\n }\n}\n","import merge from 'lodash/merge.js'\nimport get from 'lodash/get.js'\nimport set from 'lodash/set.js'\nimport { ThemeWithoutInheritance, PartialTheme, Theme, TextStyle } from './types'\n\nconst textPropsWithInheritance = [\n 'axis.ticks.text',\n 'axis.legend.text',\n 'legends.title.text',\n 'legends.text',\n 'legends.ticks.text',\n 'legends.title.text',\n 'labels.text',\n 'dots.text',\n 'markers.text',\n 'annotations.text',\n]\n\nexport const inheritRootThemeText = (\n partialStyle: Partial<TextStyle>,\n rootStyle: TextStyle\n): TextStyle => ({\n ...rootStyle,\n ...partialStyle,\n})\n\nexport const extendDefaultTheme = (\n defaultTheme: ThemeWithoutInheritance,\n customTheme: PartialTheme\n) => {\n const theme = merge({}, defaultTheme, customTheme) as Theme\n\n textPropsWithInheritance.forEach(prop => {\n set(theme, prop, inheritRootThemeText(get(theme, prop), theme.text))\n })\n\n return theme\n}\n\n// We support various types of axes, top, right, bottom, polar...\n// Adding new entries for each axis type is not necessarily ideal to\n// allow the customization of the theme for a specific axis.\n// We might even support multiple axes of the same type in the future.\n// We can use this helper to extend the theme for a specific axis type,\n// the overrides being provided as a property of the axis type.\n// This helper assumes that we're extending a complete theme,\n// because it's going to be used deeper in the component tree.\nexport const extendAxisTheme = (\n axisTheme: Theme['axis'],\n overrides: PartialTheme['axis']\n): Theme['axis'] => {\n if (!overrides) return axisTheme\n return merge({}, axisTheme, overrides)\n}\n","import { ThemeWithoutInheritance } from './types'\n\nexport const defaultTheme: ThemeWithoutInheritance = {\n background: 'transparent',\n text: {\n fontFamily: 'sans-serif',\n fontSize: 11,\n fill: '#333333',\n outlineWidth: 0,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n axis: {\n domain: {\n line: {\n stroke: 'transparent',\n strokeWidth: 1,\n },\n },\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {},\n },\n legend: {\n text: {\n fontSize: 12,\n },\n },\n },\n grid: {\n line: {\n stroke: '#dddddd',\n strokeWidth: 1,\n },\n },\n legends: {\n hidden: {\n symbol: {\n fill: '#333333',\n opacity: 0.6,\n },\n text: {\n fill: '#333333',\n opacity: 0.6,\n },\n },\n text: {},\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {\n fontSize: 10,\n },\n },\n title: {\n text: {},\n },\n },\n labels: {\n text: {},\n },\n markers: {\n lineColor: '#000000',\n lineStrokeWidth: 1,\n text: {},\n },\n dots: {\n text: {},\n },\n tooltip: {\n container: {\n background: 'white',\n color: 'inherit',\n fontSize: 'inherit',\n borderRadius: '2px',\n boxShadow: '0 1px 2px rgba(0, 0, 0, 0.25)',\n padding: '5px 9px',\n },\n basic: {\n whiteSpace: 'pre',\n display: 'flex',\n alignItems: 'center',\n },\n chip: {\n marginRight: 7,\n },\n table: {},\n tableCell: {\n padding: '3px 5px',\n },\n tableCellValue: {\n fontWeight: 'bold',\n },\n },\n crosshair: {\n line: {\n stroke: '#000000',\n strokeWidth: 1,\n strokeOpacity: 0.75,\n strokeDasharray: '6 6',\n },\n },\n annotations: {\n text: {\n fontSize: 13,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n link: {\n stroke: '#000000',\n strokeWidth: 1,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n outline: {\n fill: 'none',\n stroke: '#000000',\n strokeWidth: 2,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n symbol: {\n fill: '#000000',\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n },\n}\n","import { useMemo } from 'react'\nimport { extendDefaultTheme, extendAxisTheme } from './extend'\nimport { defaultTheme } from './defaults'\nimport { PartialTheme, Theme } from './types'\n\nexport const usePartialTheme = (partialTheme: PartialTheme) => {\n return useMemo(() => extendDefaultTheme(defaultTheme, partialTheme), [partialTheme])\n}\n\nexport const useExtendedAxisTheme = (axisTheme: Theme['axis'], overrides: PartialTheme['axis']) => {\n return useMemo(() => extendAxisTheme(axisTheme, overrides), [axisTheme, overrides])\n}\n","import { createContext, useContext, PropsWithChildren } from 'react'\nimport { usePartialTheme } from './hooks'\nimport { PartialTheme, Theme } from './types'\n\nexport const ThemeContext = createContext<Theme | null>(null)\n\n// required to preserve equality\nconst defaultPartialTheme = {}\n\nexport const ThemeProvider = ({\n theme: partialTheme = defaultPartialTheme,\n children,\n}: PropsWithChildren<{\n theme: PartialTheme\n}>) => {\n const theme = usePartialTheme(partialTheme)\n\n return <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>\n}\n\nexport const useTheme = () => {\n const theme = useContext(ThemeContext)\n if (theme === null) {\n throw new Error(\n 'Unable to find the theme, did you forget to wrap your component with ThemeProvider?'\n )\n }\n\n return theme\n}\n"],"names":["svgStyleAttributesMapping","textAlign","start","center","end","textBaseline","top","bottom","cssStyleAttributesMapping","canvasStyleAttributesMapping","styleAttributesMapping","svg","css","canvas","textPropsWithInheritance","inheritRootThemeText","partialStyle","rootStyle","_extends","extendDefaultTheme","defaultTheme","customTheme","theme","merge","forEach","prop","set","get","text","extendAxisTheme","axisTheme","overrides","background","fontFamily","fontSize","fill","outlineWidth","outlineColor","outlineOpacity","axis","domain","line","stroke","strokeWidth","ticks","legend","grid","legends","hidden","symbol","opacity","title","labels","markers","lineColor","lineStrokeWidth","dots","tooltip","container","color","borderRadius","boxShadow","padding","basic","whiteSpace","display","alignItems","chip","marginRight","table","tableCell","tableCellValue","fontWeight","crosshair","strokeOpacity","strokeDasharray","annotations","link","outline","usePartialTheme","partialTheme","useMemo","ThemeContext","createContext","defaultPartialTheme","_ref","_ref$theme","children","_jsx","jsx","Provider","value","engine","attr","style","_objectWithoutPropertiesLoose","_excluded2","_excluded","useContext","Error"],"mappings":"4mBAYaA,EAA0D,CACnEC,UAAW,CACPC,MAAO,QACPC,OAAQ,SACRC,IAAK,OAETC,aAAc,CACVC,IAAK,mBACLH,OAAQ,SACRI,OAAQ,oBAIHC,EAA0D,CACnEP,UAAW,CACPC,MAAO,OACPC,OAAQ,SACRC,IAAK,SAETC,aAAc,CACVC,IAAK,MACLH,OAAQ,SACRI,OAAQ,WAIHE,EAA6D,CACtER,UAAW,CACPC,MAAO,OACPC,OAAQ,SACRC,IAAK,SAETC,aAAc,CACVC,IAAK,MACLH,OAAQ,SACRI,OAAQ,WAIHG,EAAuE,CAChFC,IAAKX,EACLY,IAAKJ,EACLK,OAAQJ,GCjDNK,EAA2B,CAC7B,kBACA,mBACA,qBACA,eACA,qBACA,qBACA,cACA,YACA,eACA,oBAGSC,EAAuB,SAChCC,EACAC,GAAoB,OAAAC,EAAA,CAAA,EAEjBD,EACAD,EAAY,EAGNG,EAAqB,SAC9BC,EACAC,GAEA,IAAMC,EAAQC,EAAM,CAAE,EAAEH,EAAcC,GAMtC,OAJAP,EAAyBU,SAAQ,SAAAC,GAC7BC,EAAIJ,EAAOG,EAAMV,EAAqBY,EAAIL,EAAOG,GAAOH,EAAMM,MAClE,IAEON,CACX,EAUaO,EAAkB,SAC3BC,EACAC,GAEA,OAAKA,EACER,EAAM,CAAA,EAAIO,EAAWC,GADLD,CAE3B,ECnDaV,EAAwC,CACjDY,WAAY,cACZJ,KAAM,CACFK,WAAY,aACZC,SAAU,GACVC,KAAM,UACNC,aAAc,EACdC,aAAc,UACdC,eAAgB,GAEpBC,KAAM,CACFC,OAAQ,CACJC,KAAM,CACFC,OAAQ,cACRC,YAAa,IAGrBC,MAAO,CACHH,KAAM,CACFC,OAAQ,UACRC,YAAa,GAEjBf,KAAM,CAAC,GAEXiB,OAAQ,CACJjB,KAAM,CACFM,SAAU,MAItBY,KAAM,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D,EAJH/D,MAAO0D,OAAeI,IAAHE,EAAGF,EAAmBE,EACzCC,EAAQF,EAARE,SAIMjE,EAAQyD,EAAgBC,GAE9B,OAAOQ,EAAAC,IAACP,EAAaQ,SAAQ,CAACC,MAAOrE,EAAMiE,SAAEA,GACjD,uEJuCqC,SACjCK,EACAC,EACAF,GAEA,OAAOjF,EAAuBkF,GAAQC,GAAMF,EAChD,iLAUqC,SACjCG,GAEA,IAAQ3D,EAAmE2D,EAAnE3D,KAER,OAF2E2D,EAA7D1D,aAA6D0D,EAA/CzD,aAA+CyD,EAAjCxD,eAE1CpB,KAFsE6E,EAAKD,EAAKE,GAGhE,CACZrC,MAAOxB,GAEf,+BAjBoC,SAChC2D,GAIA,OAFqEA,EAA7D1D,aAA6D0D,EAA/CzD,aAA+CyD,EAAjCxD,eAA4ByD,EAAKD,EAAKG,EAG9E,oGG9DoC,SAACnE,EAA0BC,GAC3D,OAAOkD,EAAOA,SAAC,WAAA,OAAMpD,EAAgBC,EAAWC,EAAU,GAAE,CAACD,EAAWC,GAC5E,6CCSwB,WACpB,IAAMT,EAAQ4E,aAAWhB,GACzB,GAAc,OAAV5D,EACA,MAAM,IAAI6E,MACN,uFAIR,OAAO7E,CACX"}

@@ -1,2 +0,2 @@

import{useMemo as t,createContext as e,useContext as i}from"react";import n from"lodash/merge.js";import o from"lodash/get.js";import r from"lodash/set.js";import{jsx as l}from"react/jsx-runtime";function a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},a.apply(null,arguments)}var f=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],s=function(t,e){return a({},e,t)},u=function(t,e){var i=n({},t,e);return f.forEach((function(t){r(i,t,s(o(i,t),i.text))})),i},d=function(t,e){return e?n({},t,e):t},c={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"#ffffff",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}},h=function(e){return t((function(){return u(c,e)}),[e])},p=function(e,i){return t((function(){return d(e,i)}),[e,i])},x=e(null),k={},m=function(t){var e=t.theme,i=void 0===e?k:e,n=t.children,o=h(i);return l(x.Provider,{value:o,children:n})},g=function(){var t=i(x);if(null===t)throw new Error("Unable to find the theme, did you forget to wrap your component with ThemeProvider?");return t},y=["outlineWidth","outlineColor","outlineOpacity"],b=function(t){return t.outlineWidth,t.outlineColor,t.outlineOpacity,function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,y)};export{x as ThemeContext,m as ThemeProvider,c as defaultTheme,d as extendAxisTheme,u as extendDefaultTheme,s as inheritRootThemeText,b as sanitizeSvgTextStyle,p as useExtendedAxisTheme,h as usePartialTheme,g as useTheme};
import{useMemo as t,createContext as e,useContext as i}from"react";import n from"lodash/merge.js";import o from"lodash/get.js";import r from"lodash/set.js";import{jsx as l}from"react/jsx-runtime";function a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},a.apply(null,arguments)}function f(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}var s=["outlineWidth","outlineColor","outlineOpacity"],d=["fill","outlineWidth","outlineColor","outlineOpacity"],u={textAlign:{start:"start",center:"middle",end:"end"},textBaseline:{top:"text-before-edge",center:"middle",bottom:"text-after-edge"}},c={textAlign:{start:"left",center:"center",end:"right"},textBaseline:{top:"top",center:"middle",bottom:"bottom"}},h={textAlign:{start:"left",center:"center",end:"right"},textBaseline:{top:"top",center:"middle",bottom:"bottom"}},p={svg:u,css:c,canvas:h},x=function(t,e,i){return p[t][e][i]},m=function(t){return t.outlineWidth,t.outlineColor,t.outlineOpacity,f(t,s)},g=function(t){var e=t.fill;return t.outlineWidth,t.outlineColor,t.outlineOpacity,a({},f(t,d),{color:e})},k=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],b=function(t,e){return a({},e,t)},y=function(t,e){var i=n({},t,e);return k.forEach((function(t){r(i,t,b(o(i,t),i.text))})),i},W=function(t,e){return e?n({},t,e):t},v={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"#ffffff",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}},O=function(e){return t((function(){return y(v,e)}),[e])},C=function(e,i){return t((function(){return W(e,i)}),[e,i])},w=e(null),S={},j=function(t){var e=t.theme,i=void 0===e?S:e,n=t.children,o=O(i);return l(w.Provider,{value:o,children:n})},z=function(){var t=i(w);if(null===t)throw new Error("Unable to find the theme, did you forget to wrap your component with ThemeProvider?");return t};export{w as ThemeContext,j as ThemeProvider,h as canvasStyleAttributesMapping,x as convertStyleAttribute,c as cssStyleAttributesMapping,v as defaultTheme,W as extendAxisTheme,y as extendDefaultTheme,b as inheritRootThemeText,g as sanitizeHtmlTextStyle,m as sanitizeSvgTextStyle,p as styleAttributesMapping,u as svgStyleAttributesMapping,C as useExtendedAxisTheme,O as usePartialTheme,z as useTheme};
//# sourceMappingURL=nivo-theming.mjs.map

@@ -1,1 +0,1 @@

{"version":3,"file":"nivo-theming.mjs","sources":["../src/extend.ts","../src/defaults.ts","../src/hooks.ts","../src/context.tsx","../src/svg.ts"],"sourcesContent":["import merge from 'lodash/merge.js'\nimport get from 'lodash/get.js'\nimport set from 'lodash/set.js'\nimport { ThemeWithoutInheritance, PartialTheme, Theme, TextStyle } from './types'\n\nconst textPropsWithInheritance = [\n 'axis.ticks.text',\n 'axis.legend.text',\n 'legends.title.text',\n 'legends.text',\n 'legends.ticks.text',\n 'legends.title.text',\n 'labels.text',\n 'dots.text',\n 'markers.text',\n 'annotations.text',\n]\n\nexport const inheritRootThemeText = (\n partialStyle: Partial<TextStyle>,\n rootStyle: TextStyle\n): TextStyle => ({\n ...rootStyle,\n ...partialStyle,\n})\n\nexport const extendDefaultTheme = (\n defaultTheme: ThemeWithoutInheritance,\n customTheme: PartialTheme\n) => {\n const theme = merge({}, defaultTheme, customTheme) as Theme\n\n textPropsWithInheritance.forEach(prop => {\n set(theme, prop, inheritRootThemeText(get(theme, prop), theme.text))\n })\n\n return theme\n}\n\n// We support various types of axes, top, right, bottom, polar...\n// Adding new entries for each axis type is not necessarily ideal to\n// allow the customization of the theme for a specific axis.\n// We might even support multiple axes of the same type in the future.\n// We can use this helper to extend the theme for a specific axis type,\n// the overrides being provided as a property of the axis type.\n// This helper assumes that we're extending a complete theme,\n// because it's going to be used deeper in the component tree.\nexport const extendAxisTheme = (\n axisTheme: Theme['axis'],\n overrides: PartialTheme['axis']\n): Theme['axis'] => {\n if (!overrides) return axisTheme\n return merge({}, axisTheme, overrides)\n}\n","import { ThemeWithoutInheritance } from './types'\n\nexport const defaultTheme: ThemeWithoutInheritance = {\n background: 'transparent',\n text: {\n fontFamily: 'sans-serif',\n fontSize: 11,\n fill: '#333333',\n outlineWidth: 0,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n axis: {\n domain: {\n line: {\n stroke: 'transparent',\n strokeWidth: 1,\n },\n },\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {},\n },\n legend: {\n text: {\n fontSize: 12,\n },\n },\n },\n grid: {\n line: {\n stroke: '#dddddd',\n strokeWidth: 1,\n },\n },\n legends: {\n hidden: {\n symbol: {\n fill: '#333333',\n opacity: 0.6,\n },\n text: {\n fill: '#333333',\n opacity: 0.6,\n },\n },\n text: {},\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {\n fontSize: 10,\n },\n },\n title: {\n text: {},\n },\n },\n labels: {\n text: {},\n },\n markers: {\n lineColor: '#000000',\n lineStrokeWidth: 1,\n text: {},\n },\n dots: {\n text: {},\n },\n tooltip: {\n container: {\n background: 'white',\n color: 'inherit',\n fontSize: 'inherit',\n borderRadius: '2px',\n boxShadow: '0 1px 2px rgba(0, 0, 0, 0.25)',\n padding: '5px 9px',\n },\n basic: {\n whiteSpace: 'pre',\n display: 'flex',\n alignItems: 'center',\n },\n chip: {\n marginRight: 7,\n },\n table: {},\n tableCell: {\n padding: '3px 5px',\n },\n tableCellValue: {\n fontWeight: 'bold',\n },\n },\n crosshair: {\n line: {\n stroke: '#000000',\n strokeWidth: 1,\n strokeOpacity: 0.75,\n strokeDasharray: '6 6',\n },\n },\n annotations: {\n text: {\n fontSize: 13,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n link: {\n stroke: '#000000',\n strokeWidth: 1,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n outline: {\n fill: 'none',\n stroke: '#000000',\n strokeWidth: 2,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n symbol: {\n fill: '#000000',\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n },\n}\n","import { useMemo } from 'react'\nimport { extendDefaultTheme, extendAxisTheme } from './extend'\nimport { defaultTheme } from './defaults'\nimport { PartialTheme, Theme } from './types'\n\nexport const usePartialTheme = (partialTheme: PartialTheme) => {\n return useMemo(() => extendDefaultTheme(defaultTheme, partialTheme), [partialTheme])\n}\n\nexport const useExtendedAxisTheme = (axisTheme: Theme['axis'], overrides: PartialTheme['axis']) => {\n return useMemo(() => extendAxisTheme(axisTheme, overrides), [axisTheme, overrides])\n}\n","import { createContext, useContext, PropsWithChildren } from 'react'\nimport { usePartialTheme } from './hooks'\nimport { PartialTheme, Theme } from './types'\n\nexport const ThemeContext = createContext<Theme | null>(null)\n\n// required to preserve equality\nconst defaultPartialTheme = {}\n\nexport const ThemeProvider = ({\n theme: partialTheme = defaultPartialTheme,\n children,\n}: PropsWithChildren<{\n theme: PartialTheme\n}>) => {\n const theme = usePartialTheme(partialTheme)\n\n return <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>\n}\n\nexport const useTheme = () => {\n const theme = useContext(ThemeContext)\n if (theme === null) {\n throw new Error(\n 'Unable to find the theme, did you forget to wrap your component with ThemeProvider?'\n )\n }\n\n return theme\n}\n","import { TextStyle } from './types'\n\n/**\n * Cleanup theme text style so that all properties\n * are valid for an SVG text element.\n */\nexport const sanitizeSvgTextStyle = (\n style: TextStyle\n): Omit<TextStyle, 'outlineWidth' | 'outlineColor' | 'outlineOpacity'> => {\n const { outlineWidth, outlineColor, outlineOpacity, ...sanitized } = style\n\n return sanitized\n}\n"],"names":["textPropsWithInheritance","inheritRootThemeText","partialStyle","rootStyle","_extends","extendDefaultTheme","defaultTheme","customTheme","theme","merge","forEach","prop","set","get","text","extendAxisTheme","axisTheme","overrides","background","fontFamily","fontSize","fill","outlineWidth","outlineColor","outlineOpacity","axis","domain","line","stroke","strokeWidth","ticks","legend","grid","legends","hidden","symbol","opacity","title","labels","markers","lineColor","lineStrokeWidth","dots","tooltip","container","color","borderRadius","boxShadow","padding","basic","whiteSpace","display","alignItems","chip","marginRight","table","tableCell","tableCellValue","fontWeight","crosshair","strokeOpacity","strokeDasharray","annotations","link","outline","usePartialTheme","partialTheme","useMemo","useExtendedAxisTheme","ThemeContext","createContext","defaultPartialTheme","ThemeProvider","_ref","_ref$theme","children","_jsx","Provider","value","useTheme","useContext","Error","sanitizeSvgTextStyle","style","_objectWithoutPropertiesLoose","_excluded"],"mappings":"4ZAKA,IAAMA,EAA2B,CAC7B,kBACA,mBACA,qBACA,eACA,qBACA,qBACA,cACA,YACA,eACA,oBAGSC,EAAuB,SAChCC,EACAC,GAAoB,OAAAC,EAAA,CAAA,EAEjBD,EACAD,EAAY,EAGNG,EAAqB,SAC9BC,EACAC,GAEA,IAAMC,EAAQC,EAAM,CAAE,EAAEH,EAAcC,GAMtC,OAJAP,EAAyBU,SAAQ,SAAAC,GAC7BC,EAAIJ,EAAOG,EAAMV,EAAqBY,EAAIL,EAAOG,GAAOH,EAAMM,MAClE,IAEON,CACX,EAUaO,EAAkB,SAC3BC,EACAC,GAEA,OAAKA,EACER,EAAM,CAAA,EAAIO,EAAWC,GADLD,CAE3B,ECnDaV,EAAwC,CACjDY,WAAY,cACZJ,KAAM,CACFK,WAAY,aACZC,SAAU,GACVC,KAAM,UACNC,aAAc,EACdC,aAAc,UACdC,eAAgB,GAEpBC,KAAM,CACFC,OAAQ,CACJC,KAAM,CACFC,OAAQ,cACRC,YAAa,IAGrBC,MAAO,CACHH,KAAM,CACFC,OAAQ,UACRC,YAAa,GAEjBf,KAAM,CAAC,GAEXiB,OAAQ,CACJjB,KAAM,CACFM,SAAU,MAItBY,KAAM,CACFL,KAAM,CACFC,OAAQ,UACRC,YAAa,IAGrBI,QAAS,CACLC,OAAQ,CACJC,OAAQ,CACJd,KAAM,UACNe,QAAS,IAEbtB,KAAM,CACFO,KAAM,UACNe,QAAS,KAGjBtB,KAAM,CAAE,EACRgB,MAAO,CACHH,KAAM,CACFC,OAAQ,UACRC,YAAa,GAEjBf,KAAM,CACFM,SAAU,KAGlBiB,MAAO,CACHvB,KAAM,CAAC,IAGfwB,OAAQ,CACJxB,KAAM,CAAC,GAEXyB,QAAS,CACLC,UAAW,UACXC,gBAAiB,EACjB3B,KAA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MACN,uFAIR,OAAOzE,CACX,qDCvBa0E,EAAuB,SAChCC,GAIA,OAFqEA,EAA7D7D,aAA6D6D,EAA/C5D,aAA+C4D,EAAjC3D,0JAA4B4D,CAAKD,EAAKE,EAG9E"}
{"version":3,"file":"nivo-theming.mjs","sources":["../src/bridge.ts","../src/extend.ts","../src/defaults.ts","../src/hooks.ts","../src/context.tsx"],"sourcesContent":["import { TextStyle } from './types'\n\nexport type Engine = 'svg' | 'css' | 'canvas'\n\nexport type TextAlign = 'start' | 'center' | 'end'\nexport type TextBaseline = 'top' | 'center' | 'bottom'\n\nexport interface EngineStyleAttributesMapping {\n textAlign: Record<TextAlign, string>\n textBaseline: Record<TextBaseline, string>\n}\n\nexport const svgStyleAttributesMapping: EngineStyleAttributesMapping = {\n textAlign: {\n start: 'start',\n center: 'middle',\n end: 'end',\n },\n textBaseline: {\n top: 'text-before-edge',\n center: 'middle',\n bottom: 'text-after-edge',\n },\n}\n\nexport const cssStyleAttributesMapping: EngineStyleAttributesMapping = {\n textAlign: {\n start: 'left',\n center: 'center',\n end: 'right',\n },\n textBaseline: {\n top: 'top',\n center: 'middle',\n bottom: 'bottom',\n },\n}\n\nexport const canvasStyleAttributesMapping: EngineStyleAttributesMapping = {\n textAlign: {\n start: 'left',\n center: 'center',\n end: 'right',\n },\n textBaseline: {\n top: 'top',\n center: 'middle',\n bottom: 'bottom',\n },\n}\n\nexport const styleAttributesMapping: Record<Engine, EngineStyleAttributesMapping> = {\n svg: svgStyleAttributesMapping,\n css: cssStyleAttributesMapping,\n canvas: canvasStyleAttributesMapping,\n}\n\nexport const convertStyleAttribute = <K extends keyof EngineStyleAttributesMapping>(\n engine: Engine,\n attr: K,\n value: keyof EngineStyleAttributesMapping[K]\n) => {\n return styleAttributesMapping[engine][attr][value]\n}\n\nexport const sanitizeSvgTextStyle = (\n style: TextStyle\n): Omit<TextStyle, 'outlineWidth' | 'outlineColor' | 'outlineOpacity'> => {\n const { outlineWidth, outlineColor, outlineOpacity, ...sanitized } = style\n\n return sanitized\n}\n\nexport const sanitizeHtmlTextStyle = (\n style: TextStyle\n): Omit<TextStyle, 'outlineWidth' | 'outlineColor' | 'outlineOpacity' | 'fill'> => {\n const { fill, outlineWidth, outlineColor, outlineOpacity, ...sanitized } = style\n\n return {\n ...sanitized,\n color: fill,\n }\n}\n","import merge from 'lodash/merge.js'\nimport get from 'lodash/get.js'\nimport set from 'lodash/set.js'\nimport { ThemeWithoutInheritance, PartialTheme, Theme, TextStyle } from './types'\n\nconst textPropsWithInheritance = [\n 'axis.ticks.text',\n 'axis.legend.text',\n 'legends.title.text',\n 'legends.text',\n 'legends.ticks.text',\n 'legends.title.text',\n 'labels.text',\n 'dots.text',\n 'markers.text',\n 'annotations.text',\n]\n\nexport const inheritRootThemeText = (\n partialStyle: Partial<TextStyle>,\n rootStyle: TextStyle\n): TextStyle => ({\n ...rootStyle,\n ...partialStyle,\n})\n\nexport const extendDefaultTheme = (\n defaultTheme: ThemeWithoutInheritance,\n customTheme: PartialTheme\n) => {\n const theme = merge({}, defaultTheme, customTheme) as Theme\n\n textPropsWithInheritance.forEach(prop => {\n set(theme, prop, inheritRootThemeText(get(theme, prop), theme.text))\n })\n\n return theme\n}\n\n// We support various types of axes, top, right, bottom, polar...\n// Adding new entries for each axis type is not necessarily ideal to\n// allow the customization of the theme for a specific axis.\n// We might even support multiple axes of the same type in the future.\n// We can use this helper to extend the theme for a specific axis type,\n// the overrides being provided as a property of the axis type.\n// This helper assumes that we're extending a complete theme,\n// because it's going to be used deeper in the component tree.\nexport const extendAxisTheme = (\n axisTheme: Theme['axis'],\n overrides: PartialTheme['axis']\n): Theme['axis'] => {\n if (!overrides) return axisTheme\n return merge({}, axisTheme, overrides)\n}\n","import { ThemeWithoutInheritance } from './types'\n\nexport const defaultTheme: ThemeWithoutInheritance = {\n background: 'transparent',\n text: {\n fontFamily: 'sans-serif',\n fontSize: 11,\n fill: '#333333',\n outlineWidth: 0,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n axis: {\n domain: {\n line: {\n stroke: 'transparent',\n strokeWidth: 1,\n },\n },\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {},\n },\n legend: {\n text: {\n fontSize: 12,\n },\n },\n },\n grid: {\n line: {\n stroke: '#dddddd',\n strokeWidth: 1,\n },\n },\n legends: {\n hidden: {\n symbol: {\n fill: '#333333',\n opacity: 0.6,\n },\n text: {\n fill: '#333333',\n opacity: 0.6,\n },\n },\n text: {},\n ticks: {\n line: {\n stroke: '#777777',\n strokeWidth: 1,\n },\n text: {\n fontSize: 10,\n },\n },\n title: {\n text: {},\n },\n },\n labels: {\n text: {},\n },\n markers: {\n lineColor: '#000000',\n lineStrokeWidth: 1,\n text: {},\n },\n dots: {\n text: {},\n },\n tooltip: {\n container: {\n background: 'white',\n color: 'inherit',\n fontSize: 'inherit',\n borderRadius: '2px',\n boxShadow: '0 1px 2px rgba(0, 0, 0, 0.25)',\n padding: '5px 9px',\n },\n basic: {\n whiteSpace: 'pre',\n display: 'flex',\n alignItems: 'center',\n },\n chip: {\n marginRight: 7,\n },\n table: {},\n tableCell: {\n padding: '3px 5px',\n },\n tableCellValue: {\n fontWeight: 'bold',\n },\n },\n crosshair: {\n line: {\n stroke: '#000000',\n strokeWidth: 1,\n strokeOpacity: 0.75,\n strokeDasharray: '6 6',\n },\n },\n annotations: {\n text: {\n fontSize: 13,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n link: {\n stroke: '#000000',\n strokeWidth: 1,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n outline: {\n fill: 'none',\n stroke: '#000000',\n strokeWidth: 2,\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n symbol: {\n fill: '#000000',\n outlineWidth: 2,\n outlineColor: '#ffffff',\n outlineOpacity: 1,\n },\n },\n}\n","import { useMemo } from 'react'\nimport { extendDefaultTheme, extendAxisTheme } from './extend'\nimport { defaultTheme } from './defaults'\nimport { PartialTheme, Theme } from './types'\n\nexport const usePartialTheme = (partialTheme: PartialTheme) => {\n return useMemo(() => extendDefaultTheme(defaultTheme, partialTheme), [partialTheme])\n}\n\nexport const useExtendedAxisTheme = (axisTheme: Theme['axis'], overrides: PartialTheme['axis']) => {\n return useMemo(() => extendAxisTheme(axisTheme, overrides), [axisTheme, overrides])\n}\n","import { createContext, useContext, PropsWithChildren } from 'react'\nimport { usePartialTheme } from './hooks'\nimport { PartialTheme, Theme } from './types'\n\nexport const ThemeContext = createContext<Theme | null>(null)\n\n// required to preserve equality\nconst defaultPartialTheme = {}\n\nexport const ThemeProvider = ({\n theme: partialTheme = defaultPartialTheme,\n children,\n}: PropsWithChildren<{\n theme: PartialTheme\n}>) => {\n const theme = usePartialTheme(partialTheme)\n\n return <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>\n}\n\nexport const useTheme = () => {\n const theme = useContext(ThemeContext)\n if (theme === null) {\n throw new Error(\n 'Unable to find the theme, did you forget to wrap your component with ThemeProvider?'\n )\n }\n\n return theme\n}\n"],"names":["svgStyleAttributesMapping","textAlign","start","center","end","textBaseline","top","bottom","cssStyleAttributesMapping","canvasStyleAttributesMapping","styleAttributesMapping","svg","css","canvas","convertStyleAttribute","engine","attr","value","sanitizeSvgTextStyle","style","outlineWidth","outlineColor","outlineOpacity","_objectWithoutPropertiesLoose","_excluded","sanitizeHtmlTextStyle","fill","_extends","_excluded2","color","textPropsWithInheritance","inheritRootThemeText","partialStyle","rootStyle","extendDefaultTheme","defaultTheme","customTheme","theme","merge","forEach","prop","set","get","text","extendAxisTheme","axisTheme","overrides","background","fontFamily","fontSize","axis","domain","line","stroke","strokeWidth","ticks","legend","grid","legends","hidden","symbol","opacity","title","labels","markers","lineColor","lineStrokeWidth","dots","tooltip","container","borderRadius","boxShadow","padding","basic","whiteSpace","display","alignItems","chip","marginRight","table","tableCell","tableCellValue","fontWeight","crosshair","strokeOpacity","strokeDasharray","annotations","link","outline","usePartialTheme","partialTheme","useMemo","useExtendedAxisTheme","ThemeContext","createContext","defaultPartialTheme","ThemeProvider","_ref","_ref$theme","children","_jsx","Provider","useTheme","useContext","Error"],"mappings":"0pBAYaA,EAA0D,CACnEC,UAAW,CACPC,MAAO,QACPC,OAAQ,SACRC,IAAK,OAETC,aAAc,CACVC,IAAK,mBACLH,OAAQ,SACRI,OAAQ,oBAIHC,EAA0D,CACnEP,UAAW,CACPC,MAAO,OACPC,OAAQ,SACRC,IAAK,SAETC,aAAc,CACVC,IAAK,MACLH,OAAQ,SACRI,OAAQ,WAIHE,EAA6D,CACtER,UAAW,CACPC,MAAO,OACPC,OAAQ,SACRC,IAAK,SAETC,aAAc,CACVC,IAAK,MACLH,OAAQ,SACRI,OAAQ,WAIHG,EAAuE,CAChFC,IAAKX,EACLY,IAAKJ,EACLK,OAAQJ,GAGCK,EAAwB,SACjCC,EACAC,EACAC,GAEA,OAAOP,EAAuBK,GAAQC,GAAMC,EAChD,EAEaC,EAAuB,SAChCC,GAIA,OAFqEA,EAA7DC,aAA6DD,EAA/CE,aAA+CF,EAAjCG,eAA4BC,EAAKJ,EAAKK,EAG9E,EAEaC,EAAwB,SACjCN,GAEA,IAAQO,EAAmEP,EAAnEO,KAER,OAF2EP,EAA7DC,aAA6DD,EAA/CE,aAA+CF,EAAjCG,eAE1CK,KAFsEJ,EAAKJ,EAAKS,GAGhE,CACZC,MAAOH,GAEf,EC7EMI,EAA2B,CAC7B,kBACA,mBACA,qBACA,eACA,qBACA,qBACA,cACA,YACA,eACA,oBAGSC,EAAuB,SAChCC,EACAC,GAAoB,OAAAN,EAAA,CAAA,EAEjBM,EACAD,EAAY,EAGNE,EAAqB,SAC9BC,EACAC,GAEA,IAAMC,EAAQC,EAAM,CAAE,EAAEH,EAAcC,GAMtC,OAJAN,EAAyBS,SAAQ,SAAAC,GAC7BC,EAAIJ,EAAOG,EAAMT,EAAqBW,EAAIL,EAAOG,GAAOH,EAAMM,MAClE,IAEON,C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FlC,OAAQ,UACRC,YAAa,EACblC,aAAc,EACdC,aAAc,UACdC,eAAgB,GAEpBkE,QAAS,CACL9D,KAAM,OACN2B,OAAQ,UACRC,YAAa,EACblC,aAAc,EACdC,aAAc,UACdC,eAAgB,GAEpBsC,OAAQ,CACJlC,KAAM,UACNN,aAAc,EACdC,aAAc,UACdC,eAAgB,KChIfmE,EAAkB,SAACC,GAC5B,OAAOC,GAAQ,WAAA,OAAMzD,EAAmBC,EAAcuD,KAAe,CAACA,GAC1E,EAEaE,EAAuB,SAAC/C,EAA0BC,GAC3D,OAAO6C,GAAQ,WAAA,OAAM/C,EAAgBC,EAAWC,EAAU,GAAE,CAACD,EAAWC,GAC5E,ECPa+C,EAAeC,EAA4B,MAGlDC,EAAsB,CAAA,EAEfC,EAAgB,SAAHC,GAKnB,IAAAC,EAAAD,EAJH5D,MAAOqD,OAAeK,IAAHG,EAAGH,EAAmBG,EACzCC,EAAQF,EAARE,SAIM9D,EAAQoD,EAAgBC,GAE9B,OAAOU,EAACP,EAAaQ,SAAQ,CAACpF,MAAOoB,EAAM8D,SAAEA,GACjD,EAEaG,EAAW,WACpB,IAAMjE,EAAQkE,EAAWV,GACzB,GAAc,OAAVxD,EACA,MAAM,IAAImE,MACN,uFAIR,OAAOnE,CACX"}

@@ -0,1 +1,2 @@

export * from './bridge';
export * from './context';

@@ -5,4 +6,3 @@ export * from './defaults';

export * from './hooks';
export * from './svg';
export * from './types';
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
{
"name": "@nivo/theming",
"version": "0.93.0",
"version": "0.94.0",
"license": "MIT",

@@ -40,3 +40,3 @@ "author": {

},
"gitHead": "83293c9d3d4c8fd10e92077f6d8e64057e15221d"
"gitHead": "8a57c52bc10119d90cac8f32f0cad80c156580d1"
}
import { TextStyle } from './types';
/**
* Cleanup theme text style so that all properties
* are valid for an SVG text element.
*/
export declare const sanitizeSvgTextStyle: (style: TextStyle) => Omit<TextStyle, "outlineWidth" | "outlineColor" | "outlineOpacity">;
//# sourceMappingURL=svg.d.ts.map
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC7B,OAAO,SAAS,KACjB,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAIpE,CAAA"}