@artsy/palette-charts 39.1.0 → 39.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useIntersectionObserver = void 0;
7
- var _palette = require("@artsy/palette");
8
7
  var _react = require("react");
9
8
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
9
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -22,7 +21,6 @@ var useIntersectionObserver = function useIntersectionObserver(_ref) {
22
21
  } : _ref$options,
23
22
  onIntersection = _ref.onIntersection,
24
23
  onOffIntersection = _ref.onOffIntersection;
25
- var isClient = (0, _palette.useDidMount)();
26
24
  var ref = (0, _react.useRef)(null);
27
25
  var handleIntersect = function handleIntersect(entries) {
28
26
  if (!observer) return;
@@ -49,7 +47,7 @@ var useIntersectionObserver = function useIntersectionObserver(_ref) {
49
47
  onIntersection === null || onIntersection === void 0 ? void 0 : onIntersection(entries);
50
48
  };
51
49
  var _useState = (0, _react.useState)(function () {
52
- return isClient ? new IntersectionObserver(handleIntersect, options) : undefined;
50
+ return isClientSide ? new IntersectionObserver(handleIntersect, options) : undefined;
53
51
  }),
54
52
  _useState2 = _slicedToArray(_useState, 1),
55
53
  observer = _useState2[0];
@@ -65,4 +63,5 @@ var useIntersectionObserver = function useIntersectionObserver(_ref) {
65
63
  };
66
64
  };
67
65
  exports.useIntersectionObserver = useIntersectionObserver;
66
+ var isClientSide = typeof window !== "undefined";
68
67
  //# sourceMappingURL=useIntersectionObserver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIntersectionObserver.js","names":["_palette","require","_react","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","useIntersectionObserver","_ref","_ref$once","once","_ref$options","options","threshold","onIntersection","onOffIntersection","isClient","useDidMount","ref","useRef","handleIntersect","entries","observer","hasIntersected","some","_ref2","isIntersecting","disconnect","_useState","useState","IntersectionObserver","undefined","_useState2","useEffect","current","observe","exports"],"sources":["../../../src/elements/DataVis/useIntersectionObserver.ts"],"sourcesContent":["import { useDidMount } from \"@artsy/palette\"\nimport { RefObject, useEffect, useRef, useState } from \"react\"\n\ninterface UseIntersectionObserverProperties {\n ref?: RefObject<Element> | null\n once?: boolean\n options?: {\n threshold: number | number[]\n root?: Element\n rootMargin?: string\n }\n onIntersection?: (entries: IntersectionObserverEntry[]) => void\n onOffIntersection?: (entries: IntersectionObserverEntry[]) => void\n}\n\n// tslint:disable-next-line:completed-docs\nexport const useIntersectionObserver = ({\n once = true,\n options = { threshold: 0 },\n onIntersection,\n onOffIntersection,\n}: UseIntersectionObserverProperties) => {\n const isClient = useDidMount()\n\n const ref = useRef<HTMLElement | null>(null)\n\n const handleIntersect = (entries: IntersectionObserverEntry[]) => {\n if (!observer) return\n\n if (once) {\n const hasIntersected = entries.some(\n // tslint:disable-next-line:no-shadowed-variable\n ({ isIntersecting }) => isIntersecting\n )\n\n if (hasIntersected) {\n onIntersection?.(entries)\n observer.disconnect()\n } else {\n onOffIntersection?.(entries)\n }\n\n return\n }\n\n const isIntersecting = entries[entries.length - 1].isIntersecting\n\n if (!isIntersecting) {\n onOffIntersection?.(entries)\n return\n }\n\n onIntersection?.(entries)\n }\n\n const [observer] = useState(() =>\n isClient ? new IntersectionObserver(handleIntersect, options) : undefined\n )\n\n useEffect(() => {\n if (!ref.current || !observer) return\n\n observer.observe(ref.current)\n\n return () => {\n observer.disconnect()\n }\n }, [ref, observer])\n\n return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EAAHA;EAAI,CAAC;AAChB,CAAC;AAAAkB,OAAA,CAAA7B,uBAAA,GAAAA,uBAAA"}
1
+ {"version":3,"file":"useIntersectionObserver.js","names":["_react","require","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","useIntersectionObserver","_ref","_ref$once","once","_ref$options","options","threshold","onIntersection","onOffIntersection","ref","useRef","handleIntersect","entries","observer","hasIntersected","some","_ref2","isIntersecting","disconnect","_useState","useState","isClientSide","IntersectionObserver","undefined","_useState2","useEffect","current","observe","exports","window"],"sources":["../../../src/elements/DataVis/useIntersectionObserver.ts"],"sourcesContent":["import { RefObject, useEffect, useRef, useState } from \"react\"\n\ninterface UseIntersectionObserverProperties {\n ref?: RefObject<Element> | null\n once?: boolean\n options?: {\n threshold: number | number[]\n root?: Element\n rootMargin?: string\n }\n onIntersection?: (entries: IntersectionObserverEntry[]) => void\n onOffIntersection?: (entries: IntersectionObserverEntry[]) => void\n}\n\n// tslint:disable-next-line:completed-docs\nexport const useIntersectionObserver = ({\n once = true,\n options = { threshold: 0 },\n onIntersection,\n onOffIntersection,\n}: UseIntersectionObserverProperties) => {\n const ref = useRef<HTMLElement | null>(null)\n\n const handleIntersect = (entries: IntersectionObserverEntry[]) => {\n if (!observer) return\n\n if (once) {\n const hasIntersected = entries.some(\n // tslint:disable-next-line:no-shadowed-variable\n ({ isIntersecting }) => isIntersecting\n )\n\n if (hasIntersected) {\n onIntersection?.(entries)\n observer.disconnect()\n } else {\n onOffIntersection?.(entries)\n }\n\n return\n }\n\n const isIntersecting = entries[entries.length - 1].isIntersecting\n\n if (!isIntersecting) {\n onOffIntersection?.(entries)\n return\n }\n\n onIntersection?.(entries)\n }\n\n const [observer] = useState(() =>\n isClientSide\n ? new IntersectionObserver(handleIntersect, options)\n : undefined\n )\n\n useEffect(() => {\n if (!ref.current || !observer) return\n\n observer.observe(ref.current)\n\n return () => {\n observer.disconnect()\n }\n }, [ref, observer])\n\n return { ref }\n}\n\nconst isClientSide = typeof window !== \"undefined\"\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA8D,SAAAC,eAAAC,GAAA,EAAAC,CAAA,WAAAC,eAAA,CAAAF,GAAA,KAAAG,qBAAA,CAAAH,GAAA,EAAAC,CAAA,KAAAG,2BAAA,CAAAJ,GAAA,EAAAC,CAAA,KAAAI,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAG,CAAA,EAAAC,MAAA,SAAAD,CAAA,qBAAAA,CAAA,sBAAAE,iBAAA,CAAAF,CAAA,EAAAC,MAAA,OAAAE,CAAA,GAAAC,MAAA,CAAAC,SAAA,CAAAC,QAAA,CAAAC,IAAA,CAAAP,CAAA,EAAAQ,KAAA,aAAAL,CAAA,iBAAAH,CAAA,CAAAS,WAAA,EAAAN,CAAA,GAAAH,CAAA,CAAAS,WAAA,CAAAC,IAAA,MAAAP,CAAA,cAAAA,CAAA,mBAAAQ,KAAA,CAAAC,IAAA,CAAAZ,CAAA,OAAAG,CAAA,+DAAAU,IAAA,CAAAV,CAAA,UAAAD,iBAAA,CAAAF,CAAA,EAAAC,MAAA;AAAA,SAAAC,kBAAAT,GAAA,EAAAqB,GAAA,QAAAA,GAAA,YAAAA,GAAA,GAAArB,GAAA,CAAAsB,MAAA,EAAAD,GAAA,GAAArB,GAAA,CAAAsB,MAAA,WAAArB,CAAA,MAAAsB,IAAA,OAAAL,KAAA,CAAAG,GAAA,GAAApB,CAAA,GAAAoB,GAAA,EAAApB,CAAA,MAAAsB,IAAA,CAAAtB,CAAA,IAAAD,GAAA,CAAAC,CAAA,YAAAsB,IAAA;AAAA,SAAApB,sBAAAH,GAAA,EAAAC,CAAA,QAAAuB,EAAA,WAAAxB,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EAAE,CAACT,GAAG,EAAEI,QAAQ,CAAC,CAAC;EAEnB,OAAO;IAAEJ,GAAG,EAAHA;EAAI,CAAC;AAChB,CAAC;AAAAmB,OAAA,CAAA5B,uBAAA,GAAAA,uBAAA;AAED,IAAMqB,YAAY,GAAG,OAAOQ,MAAM,KAAK,WAAW"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@artsy/palette-charts",
3
3
  "sideEffects": false,
4
- "version": "39.1.0",
4
+ "version": "39.1.1",
5
5
  "description": "Design system library for react components",
6
6
  "main": "dist/index.js",
7
7
  "publishConfig": {
@@ -21,7 +21,7 @@
21
21
  "type-check": "tsc --noEmit --pretty",
22
22
  "type-declarations": "tsc --emitDeclarationOnly",
23
23
  "watch": "concurrently --raw --kill-others 'yarn compile -w' 'yarn type-declarations -w'",
24
- "storybook": "start-storybook -p 6006 --quiet",
24
+ "storybook": "export NODE_OPTIONS=--openssl-legacy-provider && start-storybook -p 6006 --quiet",
25
25
  "build-storybook": "build-storybook",
26
26
  "visual-test": "chromatic test --exit-zero-on-changes --app-code n02zjqmdqq"
27
27
  },
@@ -178,6 +178,5 @@
178
178
  "testEnvironmentOptions": {
179
179
  "url": "http://localhost"
180
180
  }
181
- },
182
- "gitHead": "ded06f2ad4829e135a8694e7b0aecaf8a65c0a0d"
181
+ }
183
182
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 Artsy Inc. <dev@artsymail.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- /**
3
- * Bar is the main component responsible for rendering an individual bar
4
- * in a bar chart.
5
- *
6
- * It not publically usable
7
- *
8
- * It is responsible for rendering a visible bar of a specific height and 0-2 labels.
9
- *
10
- * If a 'highlight' label is given, the bar will measure itself to help it's parent
11
- * container set an appropriate min-height property. This prevents the highlight
12
- * label from obscuring content above the bar chart.
13
- */
14
- export declare const Bar: ({ heightPercent, label, highlightLabel, hasEnteredViewport, onMeasureHeight, highlightLabelRef, onClick, onHover, }: {
15
- heightPercent: number;
16
- label: React.ReactNode;
17
- axisLabelX: React.ReactNode;
18
- highlightLabel?: React.ReactNode;
19
- hasEnteredViewport: boolean;
20
- onMeasureHeight?: (height: number) => void;
21
- highlightLabelRef?: React.RefObject<HTMLDivElement>;
22
- onClick?: any;
23
- onHover?: any;
24
- }) => React.JSX.Element;
@@ -1,21 +0,0 @@
1
- import React from "react";
2
- import { ChartTooltipProps } from "../DataVis/ChartTooltip";
3
- export interface BarDescriptor {
4
- value: number;
5
- label?: React.ReactNode | ChartTooltipProps;
6
- axisLabelX?: React.ReactNode;
7
- highlightLabel?: React.ReactNode | ChartTooltipProps;
8
- onClick?: any;
9
- onHover?: any;
10
- }
11
- export interface BarChartProps {
12
- bars: BarDescriptor[];
13
- minLabel: React.ReactNode;
14
- maxLabel: React.ReactNode;
15
- }
16
- /**
17
- * BarChart is a component which displays some bars of varying heights in a row.
18
- * Useful for histograms etc.
19
- * @param props props
20
- */
21
- export declare const BarChart: ({ bars, minLabel, maxLabel }: BarChartProps) => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const Default: () => React.JSX.Element;
@@ -1,2 +0,0 @@
1
- export * from "./BarChart";
2
- export * from "./Bar";
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- /**
3
- * Tooltip for bar and line charts
4
- */
5
- export declare const ChartHoverTooltip: ({ children }: {
6
- children: any;
7
- }) => React.JSX.Element;
8
- /**
9
- * Base component for positioning tooltips
10
- */
11
- export declare const BaseTooltipPositioner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@artsy/palette").BoxProps> & import("@artsy/palette").BoxProps, "ref"> & {
12
- ref?: ((instance: HTMLDivElement) => void) | React.RefObject<HTMLDivElement>;
13
- }, keyof import("@artsy/palette").BoxProps> & import("@artsy/palette").BoxProps, never>> & string;
@@ -1,23 +0,0 @@
1
- import { FlexProps } from "@artsy/palette";
2
- import React from "react";
3
- /**
4
- * Returns tooltip component based on the type of tooltip param passed to it
5
- * @param tooltip either a component or hash containing `title` and `description`
6
- */
7
- export declare const coerceTooltip: (tooltip: React.ReactNode | ChartTooltipProps) => string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
8
- /**
9
- * Similart to `coerceTooltip` but without padding
10
- * @param tooltip
11
- */
12
- export declare const coerceTooltipWithoutPadding: (tooltip: React.ReactNode | ChartTooltipProps) => string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
13
- export interface ChartTooltipProps extends FlexProps {
14
- title: React.ReactNode;
15
- description: React.ReactNode;
16
- noPadding?: boolean;
17
- }
18
- export declare function isChartTooltipProps(obj: any): obj is ChartTooltipProps;
19
- /**
20
- * ChartTooltip is the default content format for a label on a BarChart.
21
- * @param props
22
- */
23
- export declare const ChartTooltip: ({ title, description, noPadding, ...others }: ChartTooltipProps) => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- export declare const MousePositionContext: React.Context<{
3
- x: number;
4
- y: number;
5
- }>;
6
- export declare const ProvideMousePosition: React.FC<React.PropsWithChildren<unknown>>;
@@ -1,16 +0,0 @@
1
- import { RefObject } from "react";
2
- interface UseIntersectionObserverProperties {
3
- ref?: RefObject<Element> | null;
4
- once?: boolean;
5
- options?: {
6
- threshold: number | number[];
7
- root?: Element;
8
- rootMargin?: string;
9
- };
10
- onIntersection?: (entries: IntersectionObserverEntry[]) => void;
11
- onOffIntersection?: (entries: IntersectionObserverEntry[]) => void;
12
- }
13
- export declare const useIntersectionObserver: ({ once, options, onIntersection, onOffIntersection, }: UseIntersectionObserverProperties) => {
14
- ref: import("react").MutableRefObject<HTMLElement>;
15
- };
16
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { ChartTooltipProps } from "../ChartTooltip";
3
- export interface PointDescriptor {
4
- value: number;
5
- axisLabelX?: React.ReactNode | ChartTooltipProps;
6
- tooltip?: React.ReactNode | ChartTooltipProps;
7
- }
8
- export interface ChartProps {
9
- points: PointDescriptor[];
10
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Returns width of container element
3
- * @param ref reference to wrapper component
4
- */
5
- export declare const useWrapperWidth: (ref: React.RefObject<HTMLElement>) => number;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { ChartProps } from "../DataVis/utils/SharedTypes";
3
- export interface DonutChartProps extends ChartProps {
4
- margin?: number;
5
- }
6
- /**
7
- * DonutChart is a component that displays data points with donut shaped arcs.
8
- * Good for illustrating numerical proportions.
9
- */
10
- export declare const DonutChart: React.FC<React.PropsWithChildren<DonutChartProps>>;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const Default: () => React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./DonutChart";
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- /**
3
- * Line is the component responsible for rendering a line that goes through all of the data points
4
- * in a line chart.
5
- */
6
- export declare const Line: ({ path }: {
7
- path: string;
8
- }) => React.JSX.Element;
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { ChartProps } from "../DataVis/utils/SharedTypes";
3
- export interface LineChartProps extends ChartProps {
4
- height?: number;
5
- }
6
- /**
7
- * LineChart is a component that displays some data points connected by lines.
8
- * Useful for visualizing a time series, etc.
9
- */
10
- export declare const LineChart: React.FC<React.PropsWithChildren<LineChartProps>>;
11
- /**
12
- * The rectangle area around Dots which triggers mouseover for tooltip
13
- */
14
- export declare const PointHoverArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- import { PointDescriptor } from "../DataVis/utils/SharedTypes";
3
- interface LineChartSVGProps {
4
- width: number;
5
- height: number;
6
- margin: number;
7
- points: PointDescriptor[];
8
- hoverIndex: number;
9
- hasEnteredViewport?: boolean;
10
- }
11
- /**
12
- * Component rendering the SVG part of the line chart (e.g line and points)
13
- */
14
- export declare const LineChartSVG: React.FC<React.PropsWithChildren<LineChartSVGProps>>;
15
- export {};
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- /**
3
- * Point is the component responsible for rendering a data point
4
- * in a line chart.
5
- */
6
- export declare const Point: ({ cx, cy, opacity, hovered, }: {
7
- cx: number;
8
- cy: number;
9
- opacity: number;
10
- hovered: boolean;
11
- }) => React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./LineChart";
@@ -1,3 +0,0 @@
1
- export * from "./BarChart";
2
- export * from "./DonutChart";
3
- export * from "./LineChart";
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./elements";