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.98.0
to
0.99.0
+33
dist/types/borderRadius.d.ts
export interface BorderRadiusCorners<V = number> {
topLeft: V;
topRight: V;
bottomRight: V;
bottomLeft: V;
}
export interface BorderRadiusObject<V = number> extends Partial<BorderRadiusCorners<V>> {
top?: V;
bottom?: V;
left?: V;
right?: V;
}
export type BorderRadius<V = number> = V | BorderRadiusObject<V>;
/**
* Normalize a borderRadius input into explicit corner values.
*
* Priority order is:
* 1. Uniform number
* 2. Explicit corner
* 3. Group (top/bottom/left/right)
* 4. 0
*
* We use a generic type here to allow for react-spring animated values.
*
* @param radius either a uniform number, or an object mixing group+corner values
* @returns an object with topLeft, topRight, bottomRight, bottomLeft
*/
export declare const normalizeBorderRadius: <V = number>(radius: BorderRadius<V>) => BorderRadiusCorners<V>;
/**
* Adjusts corner radii so they never exceed half of the width/height or sum constraints.
*/
export declare const constrainBorderRadius: (radius: BorderRadius, width: number, height: number) => BorderRadiusCorners;
//# sourceMappingURL=borderRadius.d.ts.map
{"version":3,"file":"borderRadius.d.ts","sourceRoot":"","sources":["../../src/borderRadius.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,MAAM;IAC3C,OAAO,EAAE,CAAC,CAAA;IACV,QAAQ,EAAE,CAAC,CAAA;IACX,WAAW,EAAE,CAAC,CAAA;IACd,UAAU,EAAE,CAAC,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,MAAM,CAAC,EAAE,CAAC,CAAA;IACV,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,CAAC,CAAA;CACZ;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAA;AAEhE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,GAAG,MAAM,EAC5C,QAAQ,YAAY,CAAC,CAAC,CAAC,KACxB,mBAAmB,CAAC,CAAC,CAqBvB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,YAAY,EACpB,OAAO,MAAM,EACb,QAAQ,MAAM,KACf,mBA0CF,CAAA"}
+1
-1

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

"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};
"use strict";var t=require("react"),e=require("lodash/merge.js"),o=require("lodash/get.js"),i=require("lodash/set.js"),r=require("react/jsx-runtime"),n=function(t){var e,o,i,r;if(null==t||"object"!=typeof t){return{topLeft:t,topRight:t,bottomRight:t,bottomLeft:t}}var n=t,l=n.top,a=n.bottom,s=n.left,u=n.right;return{topLeft:null!=(e=n.topLeft)?e:void 0!==l?l:null!=s?s:0,topRight:null!=(o=n.topRight)?o:void 0!==l?l:null!=u?u:0,bottomRight:null!=(i=n.bottomRight)?i:void 0!==a?a:null!=u?u:0,bottomLeft:null!=(r=n.bottomLeft)?r:void 0!==a?a:null!=s?s:0}};function l(){return l=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var i in o)({}).hasOwnProperty.call(o,i)&&(t[i]=o[i])}return t},l.apply(null,arguments)}function a(t,e){if(null==t)return{};var o={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;o[i]=t[i]}return o}var s=["outlineWidth","outlineColor","outlineOpacity"],u=["fill","outlineWidth","outlineColor","outlineOpacity"],f={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"}},p={textAlign:{start:"left",center:"center",end:"right"},textBaseline:{top:"top",center:"middle",bottom:"bottom"}},x={svg:f,css:d,canvas:p},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"],h=function(t,e){return l({},e,t)},m=function(t,r){var n=e({},t,r);return c.forEach((function(t){i(n,t,h(o(n,t),n.text))})),n},g=function(t,o){return o?e({},t,o):t},b={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}}},v=function(e){return t.useMemo((function(){return m(b,e)}),[e])},y=t.createContext(null),k={};exports.ThemeContext=y,exports.ThemeProvider=function(t){var e=t.theme,o=void 0===e?k:e,i=t.children,n=v(o);return r.jsx(y.Provider,{value:n,children:i})},exports.borderRadiusToCss=function(t){return t.topLeft+"px "+t.topRight+"px "+t.bottomRight+"px "+t.bottomLeft+"px"},exports.canvasStyleAttributesMapping=p,exports.constrainBorderRadius=function(t,e,o){var i=n(t),r=i.topLeft,l=i.topRight,a=i.bottomRight,s=i.bottomLeft,u=Math.max(0,r),f=Math.max(0,l),d=Math.max(0,a),p=Math.max(0,s),x=u+f;if(x>e){var c=e/x;u*=c,f*=c}var h=p+d;if(h>e){var m=e/h;p*=m,d*=m}var g=u+p;if(g>o){var b=o/g;u*=b,p*=b}var v=f+d;if(v>o){var y=o/v;f*=y,d*=y}return{topLeft:u,topRight:f,bottomRight:d,bottomLeft:p}},exports.convertStyleAttribute=function(t,e,o){return x[t][e][o]},exports.cssStyleAttributesMapping=d,exports.defaultTheme=b,exports.extendAxisTheme=g,exports.extendDefaultTheme=m,exports.inheritRootThemeText=h,exports.normalizeBorderRadius=n,exports.sanitizeHtmlTextStyle=function(t){var e=t.fill;return t.outlineWidth,t.outlineColor,t.outlineOpacity,l({},a(t,u),{color:e})},exports.sanitizeSvgTextStyle=function(t){return t.outlineWidth,t.outlineColor,t.outlineOpacity,a(t,s)},exports.styleAttributesMapping=x,exports.svgStyleAttributesMapping=f,exports.useExtendedAxisTheme=function(e,o){return t.useMemo((function(){return g(e,o)}),[e,o])},exports.usePartialTheme=v,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/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,O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jBoC,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"}
{"version":3,"file":"nivo-theming.cjs.js","sources":["../src/borderRadius.ts","../src/bridge.ts","../src/extend.ts","../src/defaults.ts","../src/hooks.ts","../src/context.tsx"],"sourcesContent":["export interface BorderRadiusCorners<V = number> {\n topLeft: V\n topRight: V\n bottomRight: V\n bottomLeft: V\n}\n\nexport interface BorderRadiusObject<V = number> extends Partial<BorderRadiusCorners<V>> {\n top?: V\n bottom?: V\n left?: V\n right?: V\n}\n\nexport type BorderRadius<V = number> = V | BorderRadiusObject<V>\n\n/**\n * Normalize a borderRadius input into explicit corner values.\n *\n * Priority order is:\n * 1. Uniform number\n * 2. Explicit corner\n * 3. Group (top/bottom/left/right)\n * 4. 0\n *\n * We use a generic type here to allow for react-spring animated values.\n *\n * @param radius either a uniform number, or an object mixing group+corner values\n * @returns an object with topLeft, topRight, bottomRight, bottomLeft\n */\nexport const normalizeBorderRadius = <V = number>(\n radius: BorderRadius<V>\n): BorderRadiusCorners<V> => {\n // Uniform number\n if (radius == null || typeof radius !== 'object') {\n const uniform = radius as V\n return { topLeft: uniform, topRight: uniform, bottomRight: uniform, bottomLeft: uniform }\n }\n\n // Groups and corners\n const obj = radius as BorderRadiusObject<V>\n const uniform = 0 as V\n const top = obj.top\n const bottom = obj.bottom\n const left = obj.left\n const right = obj.right\n\n return {\n topLeft: obj.topLeft ?? (top !== undefined ? top : (left ?? uniform)),\n topRight: obj.topRight ?? (top !== undefined ? top : (right ?? uniform)),\n bottomRight: obj.bottomRight ?? (bottom !== undefined ? bottom : (right ?? uniform)),\n bottomLeft: obj.bottomLeft ?? (bottom !== undefined ? bottom : (left ?? uniform)),\n }\n}\n\n/**\n * Adjusts corner radii so they never exceed half of the width/height or sum constraints.\n */\nexport const constrainBorderRadius = (\n radius: BorderRadius,\n width: number,\n height: number\n): BorderRadiusCorners => {\n const { topLeft, topRight, bottomRight, bottomLeft } = normalizeBorderRadius(radius)\n\n let topLeftConstrained = Math.max(0, topLeft)\n let topRightConstrained = Math.max(0, topRight)\n let bottomRightConstrained = Math.max(0, bottomRight)\n let bottomLeftConstrained = Math.max(0, bottomLeft)\n\n // Horizontal constraints per edge\n const sumTop = topLeftConstrained + topRightConstrained\n if (sumTop > width) {\n const scale = width / sumTop\n topLeftConstrained *= scale\n topRightConstrained *= scale\n }\n const sumBottom = bottomLeftConstrained + bottomRightConstrained\n if (sumBottom > width) {\n const scale = width / sumBottom\n bottomLeftConstrained *= scale\n bottomRightConstrained *= scale\n }\n\n // Vertical constraints per edge\n const sumLeft = topLeftConstrained + bottomLeftConstrained\n if (sumLeft > height) {\n const scale = height / sumLeft\n topLeftConstrained *= scale\n bottomLeftConstrained *= scale\n }\n const sumRight = topRightConstrained + bottomRightConstrained\n if (sumRight > height) {\n const scale = height / sumRight\n topRightConstrained *= scale\n bottomRightConstrained *= scale\n }\n\n return {\n topLeft: topLeftConstrained,\n topRight: topRightConstrained,\n bottomRight: bottomRightConstrained,\n bottomLeft: bottomLeftConstrained,\n }\n}\n","import { TextStyle } from './types'\nimport { BorderRadiusCorners } from './borderRadius'\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\n/**\n * Render a CSS-compatible border-radius string (e.g. \"4px 4px 0 0\").\n */\nexport const borderRadiusToCss = ({\n topLeft,\n topRight,\n bottomRight,\n bottomLeft,\n}: BorderRadiusCorners): string => {\n return `${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px`\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":["normalizeBorderRadius","radius","_obj$topLeft","_obj$topRight","_obj$bottomRight","_obj$bottomLeft","topLeft","topRight","bottomRight","bottomLeft","obj","top","bottom","left","right","undefined","svgStyleAttributesMapping","textAlign","start","center","end","textBaseline","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","width","height","_normalizeBorderRadiu","topLeftConstrained","Math","max","topRightConstrained","bottomRightConstrained","bottomLeftConstrained","sumTop","scale","sumBottom","sumLeft","sumRight","engine","attr","style","_objectWithoutPropertiesLoose","_excluded2","_excluded","useContext","Error"],"mappings":"sJA8BaA,EAAwB,SACjCC,GACyB,IAAAC,EAAAC,EAAAC,EAAAC,EAEzB,GAAc,MAAVJ,G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IAAMC,EAAYH,EAAwBD,EAC1C,GAAII,EAAYX,EAAO,CACnB,IAAMU,EAAQV,EAAQW,EACtBH,GAAyBE,EACzBH,GAA0BG,CAC9B,CAGA,IAAME,EAAUT,EAAqBK,EACrC,GAAII,EAAUX,EAAQ,CAClB,IAAMS,EAAQT,EAASW,EACvBT,GAAsBO,EACtBF,GAAyBE,CAC7B,CACA,IAAMG,EAAWP,EAAsBC,EACvC,GAAIM,EAAWZ,EAAQ,CACnB,IAAMS,EAAQT,EAASY,EACvBP,GAAuBI,EACvBH,GAA0BG,CAC9B,CAEA,MAAO,CACH9G,QAASuG,EACTtG,SAAUyG,EACVxG,YAAayG,EACbxG,WAAYyG,EAEpB,gCC9CqC,SACjCM,EACAC,EACAhB,GAEA,OAAOjF,EAAuBgG,GAAQC,GAAMhB,EAChD,iNAUqC,SACjCiB,GAEA,IAAQzE,EAAmEyE,EAAnEzE,KAER,OAF2EyE,EAA7DxE,aAA6DwE,EAA/CvE,aAA+CuE,EAAjCtE,eAE1CpB,KAFsE2F,EAAKD,EAAKE,GAGhE,CACZnD,MAAOxB,GAEf,+BAjBoC,SAChCyE,GAIA,OAFqEA,EAA7DxE,aAA6DwE,EAA/CvE,aAA+CuE,EAAjCtE,eAA4BuE,EAAKD,EAAKG,EAG9E,oGG/DoC,SAACjF,EAA0BC,GAC3D,OAAOkD,EAAOA,SAAC,WAAA,OAAMpD,EAAgBC,EAAWC,EAAU,GAAE,CAACD,EAAWC,GAC5E,6CCSwB,WACpB,IAAMT,EAAQ0F,aAAW9B,GACzB,GAAc,OAAV5D,EACA,MAAM,IAAI2F,MACN,uFAIR,OAAO3F,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)}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};
import{useMemo as t,createContext as e,useContext as o}from"react";import i from"lodash/merge.js";import n from"lodash/get.js";import r from"lodash/set.js";import{jsx as l}from"react/jsx-runtime";var a=function(t){var e,o,i,n;if(null==t||"object"!=typeof t){return{topLeft:t,topRight:t,bottomRight:t,bottomLeft:t}}var r=t,l=r.top,a=r.bottom,f=r.left,u=r.right;return{topLeft:null!=(e=r.topLeft)?e:void 0!==l?l:null!=f?f:0,topRight:null!=(o=r.topRight)?o:void 0!==l?l:null!=u?u:0,bottomRight:null!=(i=r.bottomRight)?i:void 0!==a?a:null!=u?u:0,bottomLeft:null!=(n=r.bottomLeft)?n:void 0!==a?a:null!=f?f:0}},f=function(t,e,o){var i=a(t),n=i.topLeft,r=i.topRight,l=i.bottomRight,f=i.bottomLeft,u=Math.max(0,n),d=Math.max(0,r),s=Math.max(0,l),c=Math.max(0,f),p=u+d;if(p>e){var h=e/p;u*=h,d*=h}var x=c+s;if(x>e){var m=e/x;c*=m,s*=m}var g=u+c;if(g>o){var b=o/g;u*=b,c*=b}var v=d+s;if(v>o){var k=o/v;d*=k,s*=k}return{topLeft:u,topRight:d,bottomRight:s,bottomLeft:c}};function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var i in o)({}).hasOwnProperty.call(o,i)&&(t[i]=o[i])}return t},u.apply(null,arguments)}function d(t,e){if(null==t)return{};var o={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;o[i]=t[i]}return o}var s=["outlineWidth","outlineColor","outlineOpacity"],c=["fill","outlineWidth","outlineColor","outlineOpacity"],p={textAlign:{start:"start",center:"middle",end:"end"},textBaseline:{top:"text-before-edge",center:"middle",bottom:"text-after-edge"}},h={textAlign:{start:"left",center:"center",end:"right"},textBaseline:{top:"top",center:"middle",bottom:"bottom"}},x={textAlign:{start:"left",center:"center",end:"right"},textBaseline:{top:"top",center:"middle",bottom:"bottom"}},m={svg:p,css:h,canvas:x},g=function(t,e,o){return m[t][e][o]},b=function(t){return t.outlineWidth,t.outlineColor,t.outlineOpacity,d(t,s)},v=function(t){var e=t.fill;return t.outlineWidth,t.outlineColor,t.outlineOpacity,u({},d(t,c),{color:e})},k=function(t){return t.topLeft+"px "+t.topRight+"px "+t.bottomRight+"px "+t.bottomLeft+"px"},y=["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"],W=function(t,e){return u({},e,t)},O=function(t,e){var o=i({},t,e);return y.forEach((function(t){r(o,t,W(n(o,t),o.text))})),o},R=function(t,e){return e?i({},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}}},L=function(e){return t((function(){return O(C,e)}),[e])},w=function(e,o){return t((function(){return R(e,o)}),[e,o])},S=e(null),j={},z=function(t){var e=t.theme,o=void 0===e?j:e,i=t.children,n=L(o);return l(S.Provider,{value:n,children:i})},M=function(){var t=o(S);if(null===t)throw new Error("Unable to find the theme, did you forget to wrap your component with ThemeProvider?");return t};export{S as ThemeContext,z as ThemeProvider,k as borderRadiusToCss,x as canvasStyleAttributesMapping,f as constrainBorderRadius,g as convertStyleAttribute,h as cssStyleAttributesMapping,C as defaultTheme,R as extendAxisTheme,O as extendDefaultTheme,W as inheritRootThemeText,a as normalizeBorderRadius,v as sanitizeHtmlTextStyle,b as sanitizeSvgTextStyle,m as styleAttributesMapping,p as svgStyleAttributesMapping,w as useExtendedAxisTheme,L as usePartialTheme,M as useTheme};
//# sourceMappingURL=nivo-theming.mjs.map

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

{"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,SAA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zBC,YAAa,CACT3C,KAAM,CACFM,SAAU,GACV7B,aAAc,EACdC,aAAc,UACdC,eAAgB,GAEpBiE,KAAM,CACFlC,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"}
{"version":3,"file":"nivo-theming.mjs","sources":["../src/borderRadius.ts","../src/bridge.ts","../src/extend.ts","../src/defaults.ts","../src/hooks.ts","../src/context.tsx"],"sourcesContent":["export interface BorderRadiusCorners<V = number> {\n topLeft: V\n topRight: V\n bottomRight: V\n bottomLeft: V\n}\n\nexport interface BorderRadiusObject<V = number> extends Partial<BorderRadiusCorners<V>> {\n top?: V\n bottom?: V\n left?: V\n right?: V\n}\n\nexport type BorderRadius<V = number> = V | BorderRadiusObject<V>\n\n/**\n * Normalize a borderRadius input into explicit corner values.\n *\n * Priority order is:\n * 1. Uniform number\n * 2. Explicit corner\n * 3. Group (top/bottom/left/right)\n * 4. 0\n *\n * We use a generic type here to allow for react-spring animated values.\n *\n * @param radius either a uniform number, or an object mixing group+corner values\n * @returns an object with topLeft, topRight, bottomRight, bottomLeft\n */\nexport const normalizeBorderRadius = <V = number>(\n radius: BorderRadius<V>\n): BorderRadiusCorners<V> => {\n // Uniform number\n if (radius == null || typeof radius !== 'object') {\n const uniform = radius as V\n return { topLeft: uniform, topRight: uniform, bottomRight: uniform, bottomLeft: uniform }\n }\n\n // Groups and corners\n const obj = radius as BorderRadiusObject<V>\n const uniform = 0 as V\n const top = obj.top\n const bottom = obj.bottom\n const left = obj.left\n const right = obj.right\n\n return {\n topLeft: obj.topLeft ?? (top !== undefined ? top : (left ?? uniform)),\n topRight: obj.topRight ?? (top !== undefined ? top : (right ?? uniform)),\n bottomRight: obj.bottomRight ?? (bottom !== undefined ? bottom : (right ?? uniform)),\n bottomLeft: obj.bottomLeft ?? (bottom !== undefined ? bottom : (left ?? uniform)),\n }\n}\n\n/**\n * Adjusts corner radii so they never exceed half of the width/height or sum constraints.\n */\nexport const constrainBorderRadius = (\n radius: BorderRadius,\n width: number,\n height: number\n): BorderRadiusCorners => {\n const { topLeft, topRight, bottomRight, bottomLeft } = normalizeBorderRadius(radius)\n\n let topLeftConstrained = Math.max(0, topLeft)\n let topRightConstrained = Math.max(0, topRight)\n let bottomRightConstrained = Math.max(0, bottomRight)\n let bottomLeftConstrained = Math.max(0, bottomLeft)\n\n // Horizontal constraints per edge\n const sumTop = topLeftConstrained + topRightConstrained\n if (sumTop > width) {\n const scale = width / sumTop\n topLeftConstrained *= scale\n topRightConstrained *= scale\n }\n const sumBottom = bottomLeftConstrained + bottomRightConstrained\n if (sumBottom > width) {\n const scale = width / sumBottom\n bottomLeftConstrained *= scale\n bottomRightConstrained *= scale\n }\n\n // Vertical constraints per edge\n const sumLeft = topLeftConstrained + bottomLeftConstrained\n if (sumLeft > height) {\n const scale = height / sumLeft\n topLeftConstrained *= scale\n bottomLeftConstrained *= scale\n }\n const sumRight = topRightConstrained + bottomRightConstrained\n if (sumRight > height) {\n const scale = height / sumRight\n topRightConstrained *= scale\n bottomRightConstrained *= scale\n }\n\n return {\n topLeft: topLeftConstrained,\n topRight: topRightConstrained,\n bottomRight: bottomRightConstrained,\n bottomLeft: bottomLeftConstrained,\n }\n}\n","import { TextStyle } from './types'\nimport { BorderRadiusCorners } from './borderRadius'\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\n/**\n * Render a CSS-compatible border-radius string (e.g. \"4px 4px 0 0\").\n */\nexport const borderRadiusToCss = ({\n topLeft,\n topRight,\n bottomRight,\n bottomLeft,\n}: BorderRadiusCorners): string => {\n return `${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px`\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":["normalizeBorderRadius","radius","_obj$topLeft","_obj$topRight","_obj$bottomRight","_obj$bottomLeft","topLeft","topRight","bottomRight","bottomLeft","obj","top","bottom","left","right","undefined","constrainBorderRadius","width","height","_normalizeBorderRadiu","topLeftConstrained","Math","max","topRightConstrained","bottomRightConstrained","bottomLeftConstrained","sumTop","scale","sumBottom","sumLeft","sumRight","svgStyleAttributesMapping","textAlign","start","center","end","textBaseline","cssStyleAttributesMapping","canvasStyleAttributesMapping","styleAttributesMapping","svg","css","canvas","convertStyleAttribute","engine","attr","value","sanitizeSvgTextStyle","style","outlineWidth","outlineColor","outlineOpacity","_objectWithoutPropertiesLoose","_excluded","sanitizeHtmlTextStyle","fill","_extends","_excluded2","color","borderRadiusToCss","_ref","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$theme","children","_jsx","Provider","useTheme","useContext","Error"],"mappings":"wMA8BaA,EAAwB,SACjCC,GACyB,IAAAC,EAAAC,EAAAC,EAAAC,EAEzB,GAAc,MAAVJ,GAAoC,iBAAXA,EAAqB,CAE9C,MAAO,CAAEK,QADOL,EACWM,SADXN,EAC8BO,YAD9BP,EACoDQ,WADpDR,EAEpB,CAGA,IAAMS,EAAMT,EAENU,EAAMD,EAAIC,IACVC,EAASF,EAAIE,OACbC,EAAOH,EAAIG,KACXC,EAAQJ,EAAII,MAElB,MAAO,CACHR,eAAOJ,EAAEQ,EAAIJ,SAAOJ,OAAaa,IAARJ,EAAoBA,EAAOE,MAAAA,EAAAA,EAPxC,EAQZN,gBAAQJ,EAAEO,EAAIH,UAAQJ,OAAaY,IAARJ,EAAoBA,EAAOG,MAAAA,EAAAA,EAR1C,EASZN,mBAAWJ,EAAEM,EAAIF,aAAWJ,OAAgBW,IAAXH,EAAuBA,EAAUE,MAAAA,EAAAA,EATtD,EAUZL,kBAAUJ,EAAEK,EAAID,YAAUJ,OAAgBU,IAAXH,EAAuBA,EAAc,MAAJC,EAAAA,EAVpD,EAYpB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C,GAAQ,WAAA,OAAM/C,EAAgBC,EAAWC,EAAU,GAAE,CAACD,EAAWC,GAC5E,ECPa+C,EAAeC,EAA4B,MAGlDC,EAAsB,CAAA,EAEfC,EAAgB,SAAHnE,GAKnB,IAAAoE,EAAApE,EAJHQ,MAAOqD,OAAeK,IAAHE,EAAGF,EAAmBE,EACzCC,EAAQrE,EAARqE,SAIM7D,EAAQoD,EAAgBC,GAE9B,OAAOS,EAACN,EAAaO,SAAQ,CAACrF,MAAOsB,EAAM6D,SAAEA,GACjD,EAEaG,EAAW,WACpB,IAAMhE,EAAQiE,EAAWT,GACzB,GAAc,OAAVxD,EACA,MAAM,IAAIkE,MACN,uFAIR,OAAOlE,CACX"}
import { TextStyle } from './types';
import { BorderRadiusCorners } from './borderRadius';
export type Engine = 'svg' | 'css' | 'canvas';

@@ -16,2 +17,6 @@ export type TextAlign = 'start' | 'center' | 'end';

export declare const sanitizeHtmlTextStyle: (style: TextStyle) => Omit<TextStyle, "outlineWidth" | "outlineColor" | "outlineOpacity" | "fill">;
/**
* Render a CSS-compatible border-radius string (e.g. "4px 4px 0 0").
*/
export declare const borderRadiusToCss: ({ topLeft, topRight, bottomRight, bottomLeft, }: BorderRadiusCorners) => string;
//# sourceMappingURL=bridge.d.ts.map

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

{"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,M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AWvC,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;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,iDAK/B,mBAAmB,KAAG,MAExB,CAAA"}

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

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

@@ -2,0 +3,0 @@ export * from './context';

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

{"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"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,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.98.0",
"version": "0.99.0",
"license": "MIT",

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

},
"gitHead": "3bcbaaacb582b3ee9c4d23db2b0fe55125bae65e"
"gitHead": "a2d9dab855365926cb41267eb20af154ca8fd558"
}