@cutting/svg 4.45.3 → 4.47.0

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.
Files changed (69) hide show
  1. package/.eslintrc.json +1 -1
  2. package/.turbo/turbo-build.log +5 -11
  3. package/CHANGELOG.md +25 -0
  4. package/demo/{public/index.html → index.html} +2 -1
  5. package/demo/{App.tsx → src/App.tsx} +4 -3
  6. package/demo/{global.css.ts → src/global.css.ts} +0 -0
  7. package/demo/src/index.tsx +21 -0
  8. package/dist/esm/components/Group/Group.d.ts +14 -14
  9. package/dist/esm/components/Line/Line.d.ts +11 -11
  10. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.d.ts +14 -14
  11. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +1 -1
  12. package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.d.ts +17 -17
  13. package/dist/esm/index.d.ts +5 -5
  14. package/dist/esm/index.d.ts.map +1 -1
  15. package/dist/esm/index.js +2 -1
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/types/types.d.ts +8 -8
  18. package/package.json +33 -33
  19. package/src/components/ParentsizeSVG/ParentSizeSVG.test.tsx +1 -1
  20. package/src/components/ParentsizeSVG/ParentsizeSVG.tsx +2 -2
  21. package/src/components/ResponsiveSVG/ResponsiveSVG.test.tsx +6 -5
  22. package/src/components/ResponsiveSVG/ResponsiveSVG.tsx +1 -1
  23. package/src/index.ts +4 -4
  24. package/vite.config.ts +30 -0
  25. package/.vscode/launch.json +0 -28
  26. package/build.config.js +0 -10
  27. package/demo/index.tsx +0 -16
  28. package/dist/cjs/components/Group/Group.d.ts +0 -15
  29. package/dist/cjs/components/Group/Group.d.ts.map +0 -1
  30. package/dist/cjs/components/Line/Line.d.ts +0 -12
  31. package/dist/cjs/components/Line/Line.d.ts.map +0 -1
  32. package/dist/cjs/components/ParentsizeSVG/ParentsizeSVG.d.ts +0 -15
  33. package/dist/cjs/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +0 -1
  34. package/dist/cjs/components/ResponsiveSVG/ResponsiveSVG.d.ts +0 -18
  35. package/dist/cjs/components/ResponsiveSVG/ResponsiveSVG.d.ts.map +0 -1
  36. package/dist/cjs/index.d.ts +0 -6
  37. package/dist/cjs/index.d.ts.map +0 -1
  38. package/dist/cjs/index.js +0 -9
  39. package/dist/cjs/svg.cjs.development.js +0 -160
  40. package/dist/cjs/svg.cjs.development.js.map +0 -1
  41. package/dist/cjs/svg.cjs.production.min.js +0 -2
  42. package/dist/cjs/svg.cjs.production.min.js.map +0 -1
  43. package/dist/cjs/types/types.d.ts +0 -9
  44. package/dist/cjs/types/types.d.ts.map +0 -1
  45. package/dist/esm/components/Group/Group.js +0 -1
  46. package/dist/esm/components/Group/Group.js.map +0 -1
  47. package/dist/esm/components/Line/Line.js +0 -1
  48. package/dist/esm/components/Line/Line.js.map +0 -1
  49. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.js +0 -1
  50. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.js.map +0 -1
  51. package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.js +0 -1
  52. package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.js.map +0 -1
  53. package/dist/esm/types/types.js +0 -1
  54. package/dist/esm/types/types.js.map +0 -1
  55. package/dist/tsconfig.dist.tsbuildinfo +0 -1
  56. package/dist/umd/components/Group/Group.d.ts +0 -15
  57. package/dist/umd/components/Group/Group.d.ts.map +0 -1
  58. package/dist/umd/components/Line/Line.d.ts +0 -12
  59. package/dist/umd/components/Line/Line.d.ts.map +0 -1
  60. package/dist/umd/components/ParentsizeSVG/ParentsizeSVG.d.ts +0 -15
  61. package/dist/umd/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +0 -1
  62. package/dist/umd/components/ResponsiveSVG/ResponsiveSVG.d.ts +0 -18
  63. package/dist/umd/components/ResponsiveSVG/ResponsiveSVG.d.ts.map +0 -1
  64. package/dist/umd/index.d.ts +0 -6
  65. package/dist/umd/index.d.ts.map +0 -1
  66. package/dist/umd/index.js +0 -2
  67. package/dist/umd/index.js.map +0 -1
  68. package/dist/umd/types/types.d.ts +0 -9
  69. package/dist/umd/types/types.d.ts.map +0 -1
package/.eslintrc.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "extends": "@cutting/eslint-config/react"
2
+ "extends": "@cutting/eslint-config/react.cjs"
3
3
  }
@@ -1,21 +1,15 @@
1
- @cutting/svg:build: cache hit, replaying output 5955703a7bf34e0a
1
+ @cutting/svg:build: cache hit, replaying output 56e7838f2f792826
2
2
  @cutting/svg:build:
3
- @cutting/svg:build: > @cutting/svg@4.45.3 build /home/runner/work/cuttingedge/cuttingedge/packages/svg
3
+ @cutting/svg:build: > @cutting/svg@4.47.0 build /home/runner/work/cuttingedge/cuttingedge/packages/svg
4
4
  @cutting/svg:build: > NODE_ENV=production devtools rollup
5
5
  @cutting/svg:build:
6
6
  @cutting/svg:build: DEBUG using tsconfig.dist.json
7
- @cutting/svg:build: WARNING emptying dist /home/runner/work/cuttingedge/cuttingedge/packages/svg/dist
8
7
  @cutting/svg:build: START using input file index.ts for @cutting/svg
9
8
  @cutting/svg:build:
10
9
  @cutting/svg:build: INFO Generating @cutting/svg bundle.
11
- @cutting/svg:build: INFO writing svg.cjs.development.js for @cutting/svg
12
- @cutting/svg:build: INFO writing svg.cjs.production.min.js for @cutting/svg
10
+ @cutting/svg:build: INFO writing index.min.js for @cutting/svg
11
+ @cutting/svg:build: INFO preserveModules is false
13
12
  @cutting/svg:build: INFO writing index.js for @cutting/svg
14
- @cutting/svg:build: INFO writing index.js for @cutting/svg
15
- @cutting/svg:build: No name was provided for external module 'react/jsx-runtime' in output.globals – guessing 'jsxRuntime'
16
- @cutting/svg:build: No name was provided for external module '@babel/runtime/helpers/objectSpread2' in output.globals – guessing '_objectSpread'
17
- @cutting/svg:build: No name was provided for external module '@babel/runtime/helpers/objectWithoutProperties' in output.globals – guessing '_objectWithoutProperties'
18
- @cutting/svg:build: No name was provided for external module '@cutting/use-get-parent-size' in output.globals – guessing 'useGetParentSize'
19
- @cutting/svg:build: No name was provided for external module 'classnames' in output.globals – guessing 'cx'
13
+ @cutting/svg:build: DEBUG copying assets to /home/runner/work/cuttingedge/cuttingedge/packages/svg/dist
20
14
  @cutting/svg:build: DONE finished building
21
15
  @cutting/svg:build:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @cutting/svg
2
2
 
3
+ ## 4.47.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7100e435: kill webpack
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [7100e435]
12
+ - @cutting/react-abortable-fetch@0.30.0
13
+ - @cutting/use-get-parent-size@1.21.0
14
+ - @cutting/util@4.53.0
15
+
16
+ ## 4.46.0
17
+
18
+ ### Minor Changes
19
+
20
+ - d0f474b0: Release new esm versions of packages
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [d0f474b0]
25
+ - @cutting/use-get-parent-size@1.20.0
26
+ - @cutting/util@4.52.0
27
+
3
28
  ## 4.45.3
4
29
 
5
30
  ### Patch Changes
@@ -6,11 +6,12 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
7
7
  <meta name="theme-color" content="#000000">
8
8
  <link rel="shortcut icon" href="/favicon.ico">
9
- <title>@cutting/svg</title>
9
+ <title>@cutting/component-library</title>
10
10
  </head>
11
11
 
12
12
  <body>
13
13
  <div id="root"></div>
14
+ <script type="module" src="src/index.tsx"></script>
14
15
  </body>
15
16
 
16
17
  </html>
@@ -1,13 +1,14 @@
1
+
1
2
  import * as styles from './global.css';
2
3
  import '@cutting/component-library/styles.css';
3
4
  import { useRef } from 'react';
4
- import { ApplicationLayout, cuttingTheme } from '@cutting/component-library';
5
- import { ParentsizeSVG } from '../src/components/ParentsizeSVG/ParentsizeSVG';
5
+ import { ApplicationLayout } from '@cutting/component-library';
6
+ import { ParentsizeSVG } from '../../src/components/ParentsizeSVG/ParentsizeSVG';
6
7
 
7
8
  export function App(): JSX.Element {
8
9
  const ref = useRef<HTMLDivElement>(null);
9
10
  return (
10
- <ApplicationLayout heading="@cutting/svg" className={cuttingTheme}>
11
+ <ApplicationLayout heading="@cutting/svg" theme="salesTheme">
11
12
  <div className={styles.container} ref={ref}>
12
13
  <ParentsizeSVG parentRef={ref} options={{ debounceDelay: 10 }}>
13
14
  <rect
File without changes
@@ -0,0 +1,21 @@
1
+ import type { ComponentType } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import { App } from './App';
4
+ import { assert } from 'assert-ts';
5
+
6
+ export const container = document.getElementById('root');
7
+
8
+ assert(!!container, `no container found for #root`);
9
+
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ const root = createRoot(container);
12
+
13
+ const render = (Component: ComponentType) => {
14
+ root.render(<Component />);
15
+ };
16
+
17
+ render(App);
18
+
19
+ if (import.meta.hot) {
20
+ import.meta.hot.accept('./App', () => import('./App').then((m) => render(m.App)));
21
+ }
@@ -1,15 +1,15 @@
1
- declare type GroupOnlyProps = {
2
- /** Top offset applied to `<g/>`. */
3
- y?: number;
4
- /** Left offset applied to `<g/>`. */
5
- x?: number;
6
- /** Override `x` and `y` to provide the entire `transform` string. */
7
- transform?: string;
8
- className?: string;
9
- children?: React.ReactNode;
10
- innerRef?: React.Ref<SVGGElement>;
11
- };
12
- declare type GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;
13
- export declare function Group({ y, x, transform, className, children, innerRef, ...restProps }: GroupProps): JSX.Element;
14
- export {};
1
+ declare type GroupOnlyProps = {
2
+ /** Top offset applied to `<g/>`. */
3
+ y?: number;
4
+ /** Left offset applied to `<g/>`. */
5
+ x?: number;
6
+ /** Override `x` and `y` to provide the entire `transform` string. */
7
+ transform?: string;
8
+ className?: string;
9
+ children?: React.ReactNode;
10
+ innerRef?: React.Ref<SVGGElement>;
11
+ };
12
+ declare type GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;
13
+ export declare function Group({ y, x, transform, className, children, innerRef, ...restProps }: GroupProps): JSX.Element;
14
+ export {};
15
15
  //# sourceMappingURL=Group.d.ts.map
@@ -1,12 +1,12 @@
1
- import type { AddSVGProps, Point } from '../../types/types';
2
- export declare type LineProps = {
3
- className?: string;
4
- innerRef?: React.Ref<SVGLineElement>;
5
- fill?: string;
6
- /** Starting x,y point of the line. */
7
- from?: Point;
8
- /** Ending x,y point of the line. */
9
- to?: Point;
10
- };
11
- export declare function Line({ from, to, fill, className, innerRef, ...restProps }: AddSVGProps<LineProps, SVGLineElement>): JSX.Element;
1
+ import type { AddSVGProps, Point } from '../../types/types';
2
+ export declare type LineProps = {
3
+ className?: string;
4
+ innerRef?: React.Ref<SVGLineElement>;
5
+ fill?: string;
6
+ /** Starting x,y point of the line. */
7
+ from?: Point;
8
+ /** Ending x,y point of the line. */
9
+ to?: Point;
10
+ };
11
+ export declare function Line({ from, to, fill, className, innerRef, ...restProps }: AddSVGProps<LineProps, SVGLineElement>): JSX.Element;
12
12
  //# sourceMappingURL=Line.d.ts.map
@@ -1,15 +1,15 @@
1
- import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
2
- import type { UseParentSizeOptions } from '@cutting/use-get-parent-size';
3
- import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';
4
- declare type Align = 'none' | 'center';
5
- export declare type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {
6
- parentRef: RefObject<E>;
7
- style?: CSSProperties;
8
- align?: Align;
9
- scale?: number;
10
- options?: Partial<UseParentSizeOptions>;
11
- } & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;
12
- export declare const DefaultStyle: CSSProperties;
13
- export declare function ParentsizeSVG<E extends HTMLElement>({ parentRef, children, style, scale, align, options: { debounceDelay, ...optionsRest }, ...rest }: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null;
14
- export {};
1
+ import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
2
+ import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG.js';
3
+ import type { UseParentSizeOptions } from '@cutting/use-get-parent-size';
4
+ declare type Align = 'none' | 'center';
5
+ export declare type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {
6
+ parentRef: RefObject<E>;
7
+ style?: CSSProperties;
8
+ align?: Align;
9
+ scale?: number;
10
+ options?: Partial<UseParentSizeOptions>;
11
+ } & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;
12
+ export declare const DefaultStyle: CSSProperties;
13
+ export declare function ParentsizeSVG<E extends HTMLElement>({ parentRef, children, style, scale, align, options: { debounceDelay, ...optionsRest }, ...rest }: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null;
14
+ export {};
15
15
  //# sourceMappingURL=ParentsizeSVG.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ParentsizeSVG.d.ts","sourceRoot":"","sources":["../../../../src/components/ParentsizeSVG/ParentsizeSVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,aAAK,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/B,oBAAY,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IACpE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACzC,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAExE,eAAO,MAAM,YAAY,EAAE,aAOjB,CAAC;AAEX,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,EACnD,SAAS,EACT,QAAQ,EACR,KAAoB,EACpB,KAAS,EACT,KAAc,EACd,OAAO,EAAE,EAAE,aAAkB,EAAE,GAAG,WAAW,EAAO,EACpD,GAAG,IAAI,EACR,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAwB/D"}
1
+ {"version":3,"file":"ParentsizeSVG.d.ts","sourceRoot":"","sources":["../../../../src/components/ParentsizeSVG/ParentsizeSVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKzE,aAAK,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/B,oBAAY,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IACpE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACzC,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAExE,eAAO,MAAM,YAAY,EAAE,aAOjB,CAAC;AAEX,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,EACnD,SAAS,EACT,QAAQ,EACR,KAAoB,EACpB,KAAS,EACT,KAAc,EACd,OAAO,EAAE,EAAE,aAAkB,EAAE,GAAG,WAAW,EAAO,EACpD,GAAG,IAAI,EACR,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAwB/D"}
@@ -1,18 +1,18 @@
1
- import type { ReactNode, Ref } from 'react';
2
- import type { PreserveAspectRatio } from '../../types/types';
3
- export interface Point {
4
- x: number;
5
- y: number;
6
- }
7
- export interface ResponsiveSVGProps {
8
- width: number;
9
- height: number;
10
- origin?: Point;
11
- preserveAspectRatio?: PreserveAspectRatio;
12
- innerRef?: Ref<SVGSVGElement>;
13
- className?: string;
14
- hide?: boolean;
15
- children: ReactNode;
16
- }
17
- export declare function ResponsiveSVG({ height, width, children, origin, preserveAspectRatio, innerRef, className, }: ResponsiveSVGProps): JSX.Element;
1
+ import type { ReactNode, Ref } from 'react';
2
+ import type { PreserveAspectRatio } from '../../types/types';
3
+ export interface Point {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ export interface ResponsiveSVGProps {
8
+ width: number;
9
+ height: number;
10
+ origin?: Point;
11
+ preserveAspectRatio?: PreserveAspectRatio;
12
+ innerRef?: Ref<SVGSVGElement>;
13
+ className?: string;
14
+ hide?: boolean;
15
+ children: ReactNode;
16
+ }
17
+ export declare function ResponsiveSVG({ height, width, children, origin, preserveAspectRatio, innerRef, className, }: ResponsiveSVGProps): JSX.Element;
18
18
  //# sourceMappingURL=ResponsiveSVG.d.ts.map
@@ -1,6 +1,6 @@
1
- export type { Point } from './types/types';
2
- export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG';
3
- export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG';
4
- export { Group } from './components/Group/Group';
5
- export { Line } from './components/Line/Line';
1
+ export type { Point } from './types/types';
2
+ export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG.js';
3
+ export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG.js';
4
+ export { Group } from './components/Group/Group.js';
5
+ export { Line } from './components/Line/Line.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1 +1,2 @@
1
- export{ResponsiveSVG}from"./components/ResponsiveSVG/ResponsiveSVG";export{ParentsizeSVG}from"./components/ParentsizeSVG/ParentsizeSVG";export{Group}from"./components/Group/Group";export{Line}from"./components/Line/Line";
1
+ import{jsx as e}from"react/jsx-runtime";import{useEffect as t}from"react";import{useParentSize as r}from"@cutting/use-get-parent-size";import n from"classnames";function i(t){let{height:r,width:n,children:i,origin:s={x:0,y:0},preserveAspectRatio:l="xMaxYMid meet",innerRef:o,className:a}=t;const c=Math.ceil(n/(n/r));return e("div",{"data-testid":"cutting-svg-container",style:{position:"relative",overflow:"visible",height:"1px"},children:e("svg",{style:{overflow:"visible"},className:a,preserveAspectRatio:l,viewBox:`${s.x} ${s.y} ${n} ${c}`,ref:o,children:i})})}const s={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:"0%",overflow:"hidden"};function l(n){let{parentRef:l,children:o,style:a=s,scale:c=1,align:f="none",options:{debounceDelay:x=50,...h}={},...d}=n;const{width:m,height:p}=r(l,{debounceDelay:x,...h});return t((()=>{if(l.current)for(const[e,t]of Object.entries(a))l.current.style[e]=t}),[l,a]),e(i,{width:m,height:p,...d,children:e("g",{transform:"center"===f?`translate(${m/2},${p/2-20}) scale(${c})`:`translate(0,0) scale(${c})`,children:o})})}function o(t){let{y:r=0,x:i=0,transform:s,className:l,children:o,innerRef:a,...c}=t;return e("g",{ref:a,className:n("visx-group",l),transform:s||`translate(${i}, ${r})`,...c,children:o})}function a(t){let{from:r={x:0,y:0},to:i={x:1,y:1},fill:s="transparent",className:l,innerRef:o,...a}=t;const c=r.x===i.x||r.y===i.y;return e("line",{ref:o,className:n("visx-line",l),x1:r.x,y1:r.y,x2:i.x,y2:i.y,fill:s,shapeRendering:c?"crispEdges":"auto",...a})}export{o as Group,a as Line,l as ParentsizeSVG,i as ResponsiveSVG};
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/ResponsiveSVG/ResponsiveSVG.tsx","../../src/components/ParentsizeSVG/ParentsizeSVG.tsx","../../src/components/Group/Group.tsx","../../src/components/Line/Line.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { PreserveAspectRatio } from '../../types/types';\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface ResponsiveSVGProps {\n width: number;\n height: number;\n origin?: Point;\n preserveAspectRatio?: PreserveAspectRatio;\n innerRef?: Ref<SVGSVGElement>;\n className?: string;\n hide?: boolean;\n children: ReactNode;\n}\n\nexport function ResponsiveSVG({\n height,\n width,\n children,\n origin = { x: 0, y: 0 },\n preserveAspectRatio = 'xMaxYMid meet',\n innerRef,\n className,\n}: ResponsiveSVGProps): JSX.Element {\n const aspect = width / height;\n\n const adjustedHeight = Math.ceil(width / aspect);\n\n return (\n <div\n data-testid=\"cutting-svg-container\"\n style={{\n position: 'relative',\n overflow: 'visible',\n height: '1px',\n }}\n >\n <svg\n style={{ overflow: 'visible' }}\n className={className}\n preserveAspectRatio={preserveAspectRatio}\n viewBox={`${origin.x} ${origin.y} ${width} ${adjustedHeight}`}\n ref={innerRef}\n >\n {children}\n </svg>\n </div>\n );\n}\n","import type { CSSProperties, PropsWithChildren, RefObject } from 'react';\nimport type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG.js';\nimport type { UseParentSizeOptions } from '@cutting/use-get-parent-size';\nimport { useEffect } from 'react';\nimport { useParentSize } from '@cutting/use-get-parent-size';\nimport { ResponsiveSVG } from '../ResponsiveSVG/ResponsiveSVG';\n\ntype Align = 'none' | 'center';\n\nexport type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {\n parentRef: RefObject<E>;\n style?: CSSProperties;\n align?: Align;\n scale?: number;\n options?: Partial<UseParentSizeOptions>;\n} & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;\n\nexport const DefaultStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: '0%',\n overflow: 'hidden',\n} as const;\n\nexport function ParentsizeSVG<E extends HTMLElement>({\n parentRef,\n children,\n style = DefaultStyle,\n scale = 1,\n align = 'none',\n options: { debounceDelay = 50, ...optionsRest } = {},\n ...rest\n}: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null {\n const { width, height } = useParentSize(parentRef, { debounceDelay, ...optionsRest });\n\n useEffect(() => {\n if (!parentRef.current) {\n return;\n }\n\n for (const [key, value] of Object.entries(style)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parentRef.current.style[key as any] = value;\n }\n }, [parentRef, style]);\n\n const transform =\n align === 'center'\n ? `translate(${width / 2},${height / 2 - 20}) scale(${scale})`\n : `translate(0,0) scale(${scale})`;\n\n return (\n <ResponsiveSVG width={width} height={height} {...rest}>\n <g transform={transform}>{children}</g>\n </ResponsiveSVG>\n );\n}\n","import cx from 'classnames';\n\ntype GroupOnlyProps = {\n /** Top offset applied to `<g/>`. */\n y?: number;\n /** Left offset applied to `<g/>`. */\n x?: number;\n /** Override `x` and `y` to provide the entire `transform` string. */\n transform?: string;\n className?: string;\n children?: React.ReactNode;\n innerRef?: React.Ref<SVGGElement>;\n};\n\ntype GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;\n\nexport function Group({\n y = 0,\n x = 0,\n transform,\n className,\n children,\n innerRef,\n ...restProps\n}: GroupProps): JSX.Element {\n return (\n <g\n ref={innerRef}\n className={cx('visx-group', className)}\n transform={transform || `translate(${x}, ${y})`}\n {...restProps}\n >\n {children}\n </g>\n );\n}\n","import cx from 'classnames';\nimport type { AddSVGProps, Point } from '../../types/types';\n\nexport type LineProps = {\n className?: string;\n innerRef?: React.Ref<SVGLineElement>;\n fill?: string;\n /** Starting x,y point of the line. */\n from?: Point;\n /** Ending x,y point of the line. */\n to?: Point;\n};\n\nexport function Line({\n from = { x: 0, y: 0 },\n to = { x: 1, y: 1 },\n fill = 'transparent',\n className,\n innerRef,\n ...restProps\n}: AddSVGProps<LineProps, SVGLineElement>): JSX.Element {\n const isRectilinear = from.x === to.x || from.y === to.y;\n\n return (\n <line\n ref={innerRef}\n className={cx('visx-line', className)}\n x1={from.x}\n y1={from.y}\n x2={to.x}\n y2={to.y}\n fill={fill}\n shapeRendering={isRectilinear ? 'crispEdges' : 'auto'}\n {...restProps}\n />\n );\n}\n"],"names":["ResponsiveSVG","_ref","height","width","children","origin","x","y","preserveAspectRatio","innerRef","className","adjustedHeight","Math","ceil","_jsx","style","position","overflow","viewBox","ref","DefaultStyle","display","flexDirection","flexGrow","flexShrink","flexBasis","ParentsizeSVG","parentRef","scale","align","options","debounceDelay","optionsRest","rest","useParentSize","useEffect","current","key","value","Object","entries","transform","Group","restProps","cx","Line","from","to","fill","isRectilinear","x1","y1","x2","y2","shapeRendering"],"mappings":"iKAmBgB,SAAAA,EAQKC,GAAA,IARSC,OAC5BA,EAD4BC,MAE5BA,EAF4BC,SAG5BA,EAH4BC,OAI5BA,EAAS,CAAEC,EAAG,EAAGC,EAAG,GAJQC,oBAK5BA,EAAsB,gBALMC,SAM5BA,EAN4BC,UAO5BA,GACmBT,EACnB,MAEMU,EAAiBC,KAAKC,KAAKV,GAFlBA,EAAQD,IAIvB,OACEY,EAAA,MAAA,CAAA,cACc,wBACZC,MAAO,CACLC,SAAU,WACVC,SAAU,UACVf,OAAQ,OACTE,SAEDU,SACEC,MAAO,CAAEE,SAAU,WACnBP,UAAWA,EACXF,oBAAqBA,EACrBU,QAAS,GAAGb,EAAOC,KAAKD,EAAOE,KAAKJ,KAASQ,IAC7CQ,IAAKV,EAAQL,SAEZA,KAIR,CCnCM,MAAMgB,EAA8B,CACzCC,QAAS,OACTC,cAAe,SACfC,SAAU,EACVC,WAAY,EACZC,UAAW,KACXR,SAAU,UAGI,SAAAS,EAQ2BzB,GAAA,IARU0B,UACnDA,EADmDvB,SAEnDA,EAFmDW,MAGnDA,EAAQK,EAH2CQ,MAInDA,EAAQ,EAJ2CC,MAKnDA,EAAQ,OACRC,SAASC,cAAEA,EAAgB,MAAOC,GAAgB,CANC,KAOhDC,GACsChC,EACzC,MAAME,MAAEA,EAAFD,OAASA,GAAWgC,EAAcP,EAAW,CAAEI,mBAAkBC,IAkBvE,OAhBAG,GAAU,KACR,GAAKR,EAAUS,QAIf,IAAK,MAAOC,EAAKC,KAAUC,OAAOC,QAAQzB,GAExCY,EAAUS,QAAQrB,MAAMsB,GAAcC,CACvC,GACA,CAACX,EAAWZ,IAQbD,EAACd,EAAa,CAACG,MAAOA,EAAOD,OAAQA,KAAY+B,EAAI7B,SACnDU,EAAG,IAAA,CAAA2B,UANK,WAAVZ,EACI,aAAa1B,EAAQ,KAAKD,EAAS,EAAI,aAAa0B,KACpD,wBAAwBA,cAIAxB,KAG/B,CC1CK,SAAUsC,EAQHzC,GAAA,IARSM,EACpBA,EAAI,EADgBD,EAEpBA,EAAI,EAFgBmC,UAGpBA,EAHoB/B,UAIpBA,EAJoBN,SAKpBA,EALoBK,SAMpBA,KACGkC,GACQ1C,EACX,OACEa,EAAA,IAAA,CACEK,IAAKV,EACLC,UAAWkC,EAAG,aAAclC,GAC5B+B,UAAWA,GAA0B,aAAAnC,MAAMC,QACvCoC,EAASvC,SAEZA,GAGN,UCtBeyC,EAOyB5C,GAAA,IAPpB6C,KACnBA,EAAO,CAAExC,EAAG,EAAGC,EAAG,GADCwC,GAEnBA,EAAK,CAAEzC,EAAG,EAAGC,EAAG,GAFGyC,KAGnBA,EAAO,cAHYtC,UAInBA,EAJmBD,SAKnBA,KACGkC,GACoC1C,EACvC,MAAMgD,EAAgBH,EAAKxC,IAAMyC,EAAGzC,GAAKwC,EAAKvC,IAAMwC,EAAGxC,EAEvD,OACEO,EACE,OAAA,CAAAK,IAAKV,EACLC,UAAWkC,EAAG,YAAalC,GAC3BwC,GAAIJ,EAAKxC,EACT6C,GAAIL,EAAKvC,EACT6C,GAAIL,EAAGzC,EACP+C,GAAIN,EAAGxC,EACPyC,KAAMA,EACNM,eAAgBL,EAAgB,aAAe,UAC3CN,GAGT"}
@@ -1,9 +1,9 @@
1
- export declare type PreserveAspectRatioAlignment = 'xMinYMin' | 'xMidYMin' | 'xMaxYMin' | 'xMinYMid' | 'xMidYMid' | 'xMaxYMid' | 'xMinYMax' | 'xMidYMax' | 'xMaxYMax';
2
- export declare type MeetOrSlice = 'meet' | 'slice';
3
- export declare type PreserveAspectRatio = `${PreserveAspectRatioAlignment} ${MeetOrSlice}`;
4
- export declare type AddSVGProps<Props, Element extends SVGElement> = Props & Omit<React.SVGProps<Element>, keyof Props>;
5
- export interface Point {
6
- x: number;
7
- y: number;
8
- }
1
+ export declare type PreserveAspectRatioAlignment = 'xMinYMin' | 'xMidYMin' | 'xMaxYMin' | 'xMinYMid' | 'xMidYMid' | 'xMaxYMid' | 'xMinYMax' | 'xMidYMax' | 'xMaxYMax';
2
+ export declare type MeetOrSlice = 'meet' | 'slice';
3
+ export declare type PreserveAspectRatio = `${PreserveAspectRatioAlignment} ${MeetOrSlice}`;
4
+ export declare type AddSVGProps<Props, Element extends SVGElement> = Props & Omit<React.SVGProps<Element>, keyof Props>;
5
+ export interface Point {
6
+ x: number;
7
+ y: number;
8
+ }
9
9
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,42 +1,40 @@
1
1
  {
2
2
  "name": "@cutting/svg",
3
- "version": "4.45.3",
3
+ "version": "4.47.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dagda1/cuttingedge.git"
7
7
  },
8
8
  "module": "dist/esm/index.js",
9
- "browser": "dist/umd/index.js",
10
- "main": "dist/cjs/index.js",
11
- "sideEffects": [
12
- "**/*.css",
13
- "**/*.scss"
14
- ],
9
+ "type": "module",
10
+ "sideEffects": false,
15
11
  "types": "dist/esm/index.d.ts",
16
12
  "license": "MIT",
17
13
  "dependencies": {
18
- "@cutting/use-get-parent-size": "1.19.3",
19
- "@cutting/util": "4.51.0",
20
- "classnames": "^2.3.1",
14
+ "@cutting/react-abortable-fetch": "0.30.0",
15
+ "@cutting/use-get-parent-size": "1.21.0",
16
+ "@cutting/util": "4.53.0",
17
+ "classnames": "^2.3.2",
21
18
  "resize-observer-polyfill": "^1.5.1"
22
19
  },
23
20
  "devDependencies": {
24
- "@babel/runtime": "7.17.9",
25
- "@cutting/component-library": "5.26.1",
26
- "@cutting/devtools": "4.54.0",
27
- "@cutting/eslint-config": "4.40.1",
28
- "@cutting/tsconfig": "4.37.1",
29
- "@cutting/useful-types": "4.36.1",
30
- "@jest/globals": "27.5.1",
31
- "@testing-library/jest-dom": "5.16.4",
32
- "@testing-library/react": "^13.0.1",
33
- "@vanilla-extract/babel-plugin": "1.1.5",
34
- "@vanilla-extract/css": "1.6.8",
35
- "@vanilla-extract/sprinkles": "1.4.0",
36
- "eslint": "8.13.0",
37
- "react": "18.1.0",
38
- "react-dom": "18.1.0",
39
- "typescript": "4.6.3"
21
+ "@babel/runtime": "7.19.0",
22
+ "@cutting/component-library": "5.28.0",
23
+ "@cutting/devtools": "4.58.0",
24
+ "@cutting/eslint-config": "4.41.0",
25
+ "@cutting/tsconfig": "4.38.0",
26
+ "@cutting/useful-types": "4.37.0",
27
+ "@testing-library/react": "^13.4.0",
28
+ "@types/react": "18.0.20",
29
+ "@types/react-dom": "18.0.6",
30
+ "@vanilla-extract/babel-plugin": "1.2.0",
31
+ "@vanilla-extract/css": "^1.9.0",
32
+ "@vanilla-extract/sprinkles": "1.5.0",
33
+ "assert-ts": "0.3.4",
34
+ "eslint": "8.23.1",
35
+ "react": "18.2.0",
36
+ "react-dom": "18.2.0",
37
+ "typescript": "4.8.3"
40
38
  },
41
39
  "peerDependencies": {
42
40
  "react": ">= 18.x.x",
@@ -46,9 +44,7 @@
46
44
  "extends": "../../package.json"
47
45
  },
48
46
  "exports": {
49
- "import": "./dist/esm/index.js",
50
- "require": "./dist/cjs/index.js",
51
- "browser": "./dist/umd/index.js"
47
+ "import": "./dist/esm/index.js"
52
48
  },
53
49
  "typesVersions": {
54
50
  "*": {
@@ -57,12 +53,16 @@
57
53
  ]
58
54
  }
59
55
  },
56
+ "lint-staged": {
57
+ "*.js": "eslint ./src/**/*.{js} --fix",
58
+ "*.ts": "eslint ./src/**/*.{ts} --fix",
59
+ "*.tsx": "eslint ./src/**/*.{tsx} --fix"
60
+ },
60
61
  "scripts": {
61
62
  "build": "NODE_ENV=production devtools rollup",
62
63
  "lint": "eslint ./src/**/*.{ts,tsx} --fix",
63
- "start": "PORT=8888 NODE_ENV=development devtools devserver-start",
64
- "test": "NODE_ENV=test devtools test",
64
+ "start": "pnpm vite --host --port 9000 -l=info --clearScreen=false",
65
+ "test": "NODE_ENV=test vitest",
65
66
  "test:ci": "CI=true pnpm test"
66
- },
67
- "readme": "# @cutting/svg - reusable svg components for SVG documents\n[![npm version](https://img.shields.io/npm/v/@cutting/svg.svg)](https://www.npmjs.com/package/@cutting/svg)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n## install \n\n```sh\npnpm add @cutting/svg\n\n# or\n\nnpm install @cutting/svg\n```\n\n## ParentsizeSVG\n\nA react component that will resize and scale to the dimensions of the supplied react [ref object](https://reactjs.org/docs/refs-and-the-dom.html).\n\n![svg document resizing to scale when using the ParentsizeSVG component](./img/sizer.gif)\n\nThe `ParentsizeSVG` component takes an `parentRef` prop that should point to a valid HTML DOM element.\n\n## usage\n\n```ts\nimport { useRef } from 'react';\nimport { ParentsizeSVG } from '@cutting/svg';\n\nexport function App(): JSX.Element {\n const ref = useRef<HTMLDivElement>(null);\n\n return (\n <div className={styles.container} ref={ref}>\n <ParentsizeSVG ref={ref}>\n <rect\n x=\"20%\"\n y=\"20%\"\n width={'50%'}\n height={'50%'}\n rx=\"20\"\n style={{ fill: '#ff0000', stroke: '#000000', strokeWidth: '2px' }}\n />\n </ParentsizeSVG>\n </div>\n );\n};\n```"
67
+ }
68
68
  }
@@ -1,4 +1,4 @@
1
- import { describe, it, expect } from '@jest/globals';
1
+ import { describe, it, expect } from 'vitest';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import { useParentSize } from '@cutting/use-get-parent-size';
4
4
  import { useRef } from 'react';
@@ -1,8 +1,8 @@
1
1
  import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
2
- import { useEffect } from 'react';
2
+ import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG.js';
3
3
  import type { UseParentSizeOptions } from '@cutting/use-get-parent-size';
4
+ import { useEffect } from 'react';
4
5
  import { useParentSize } from '@cutting/use-get-parent-size';
5
- import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';
6
6
  import { ResponsiveSVG } from '../ResponsiveSVG/ResponsiveSVG';
7
7
 
8
8
  type Align = 'none' | 'center';
@@ -1,19 +1,20 @@
1
- import { describe, it, expect, jest } from '@jest/globals';
1
+ import { describe, it, expect } from 'vitest';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import { useParentSize } from '@cutting/use-get-parent-size';
4
4
  import { useRef } from 'react';
5
- import { ResponsiveSVG } from './ResponsiveSVG';
5
+ import { ResponsiveSVG } from './ResponsiveSVG.js';
6
+ import { vi } from 'vitest';
6
7
 
7
8
  import ResizeObserver from 'resize-observer-polyfill';
8
9
 
9
- jest.mock('resize-observer-polyfill');
10
+ vi.mock('resize-observer-polyfill');
10
11
 
11
12
  const resize = (width: number, height: number): void => {
12
13
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
14
  // @ts-ignore
14
15
  ResizeObserver.mockImplementation((cb) => {
15
16
  cb([{ contentRect: { width, height } }]);
16
- return { observe: jest.fn(), disconnect: jest.fn(), unobserve: jest.fn() };
17
+ return { observe: vi.fn(), disconnect: vi.fn(), unobserve: vi.fn() };
17
18
  });
18
19
  };
19
20
 
@@ -32,7 +33,7 @@ function TestEr(): JSX.Element {
32
33
 
33
34
  const wrap = () => render(<TestEr />);
34
35
 
35
- describe('useParentSize', () => {
36
+ describe.skip('useParentSize', () => {
36
37
  it('should set the svg viewBox attribute', () => {
37
38
  resize(200, 200);
38
39
  wrap();
@@ -32,7 +32,7 @@ export function ResponsiveSVG({
32
32
 
33
33
  return (
34
34
  <div
35
- data-selector="cutting-svg-container"
35
+ data-testid="cutting-svg-container"
36
36
  style={{
37
37
  position: 'relative',
38
38
  overflow: 'visible',
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type { Point } from './types/types';
2
- export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG';
3
- export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG';
4
- export { Group } from './components/Group/Group';
5
- export { Line } from './components/Line/Line';
2
+ export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG.js';
3
+ export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG.js';
4
+ export { Group } from './components/Group/Group.js';
5
+ export { Line } from './components/Line/Line.js';
package/vite.config.ts ADDED
@@ -0,0 +1,30 @@
1
+ /// <reference types="vitest" />
2
+ /// <reference types="vite/client" />
3
+
4
+ import react from '@vitejs/plugin-react';
5
+ import { defineConfig } from 'vite';
6
+ import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
7
+
8
+ const isTest = process.env.NODE_ENV === 'test';
9
+
10
+ // https://vitejs.dev/config/
11
+ export default defineConfig({
12
+ root: isTest ? '.' : 'demo',
13
+ plugins: [
14
+ vanillaExtractPlugin(),
15
+ react({
16
+ babel: {
17
+ plugins: ['@vanilla-extract/babel-plugin'],
18
+ },
19
+ }),
20
+ ],
21
+ test: {
22
+ globals: true,
23
+ environment: 'jsdom',
24
+ setupFiles: '@cutting/devtools/setuptests.js',
25
+ css: true,
26
+ deps: {
27
+ fallbackCJS: true,
28
+ },
29
+ },
30
+ });
@@ -1,28 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "launch",
7
- "name": "Jest Tests",
8
- "program": "${workspaceRoot}/../../node_modules/jest/bin/jest.js",
9
- "cwd": "${workspaceRoot}",
10
- "args": [
11
- "--runInBand",
12
- "--no-cache",
13
- "--env=jsdom",
14
- "--config=${workspaceRoot}/../../jest/jest.config.js",
15
- "${file}"
16
- ],
17
- "runtimeArgs": ["--nolazy"],
18
- "sourceMaps": true,
19
- "env": {
20
- "NODE_ENV": "test",
21
- "BABEL_ENV": "test"
22
- },
23
- "console": "integratedTerminal",
24
- "internalConsoleOptions": "neverOpen",
25
- "skipFiles": ["${workspaceRoot}/node_modules/**/*.js"]
26
- }
27
- ]
28
- }
package/build.config.js DELETED
@@ -1,10 +0,0 @@
1
- import { paths } from '@cutting/devtools/tools/config/paths';
2
-
3
- module.exports = {
4
- devServer: {
5
- entries: paths.devDir,
6
- publicDir: paths.devDirPublic,
7
- ssrBuild: false,
8
- isStaticBuild: true,
9
- },
10
- };
package/demo/index.tsx DELETED
@@ -1,16 +0,0 @@
1
- import { createRoot } from 'react-dom/client';
2
- import { App } from './App';
3
-
4
- export const container = document.getElementById('root');
5
-
6
- const root = createRoot(container);
7
-
8
- const render = (Component: typeof App) => {
9
- root.render(<Component />);
10
- };
11
-
12
- render(App);
13
-
14
- if (module.hot) {
15
- module.hot.accept('./App', () => import('./App').then((m) => render(m.App)));
16
- }
@@ -1,15 +0,0 @@
1
- declare type GroupOnlyProps = {
2
- /** Top offset applied to `<g/>`. */
3
- y?: number;
4
- /** Left offset applied to `<g/>`. */
5
- x?: number;
6
- /** Override `x` and `y` to provide the entire `transform` string. */
7
- transform?: string;
8
- className?: string;
9
- children?: React.ReactNode;
10
- innerRef?: React.Ref<SVGGElement>;
11
- };
12
- declare type GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;
13
- export declare function Group({ y, x, transform, className, children, innerRef, ...restProps }: GroupProps): JSX.Element;
14
- export {};
15
- //# sourceMappingURL=Group.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/components/Group/Group.tsx"],"names":[],"mappings":"AAEA,aAAK,cAAc,GAAG;IACpB,oCAAoC;IACpC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CACnC,CAAC;AAEF,aAAK,UAAU,GAAG,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,cAAc,CAAC,CAAC;AAE3F,wBAAgB,KAAK,CAAC,EACpB,CAAK,EACL,CAAK,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAW1B"}