@conveyorhq/arrow-ds 1.30.1 → 1.30.2
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.
- package/package.json +1 -1
- package/public/components/Svg/Svg.d.ts +3 -3
- package/public/components/Svg/Svg.js +1 -2
- package/src/components/Svg/Svg.story.mdx +36 -0
- package/src/components/Svg/Svg.tsx +6 -4
- package/public/components/Svg/Svg.story.d.ts +0 -1
- package/public/components/Svg/Svg.story.js +0 -14
- package/src/components/Svg/Svg.md +0 -14
- package/src/components/Svg/Svg.story.tsx +0 -15
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare type SvgProps = SVGAttributes<SVGElement>;
|
|
3
|
-
export declare const Svg:
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type SvgProps = React.SVGAttributes<SVGElement>;
|
|
3
|
+
export declare const Svg: React.ForwardRefExoticComponent<SvgProps & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -5,5 +5,4 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Svg = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
|
|
9
|
-
exports.Svg = Svg;
|
|
8
|
+
exports.Svg = react_1.default.forwardRef((props, forwardedRef) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", ref: forwardedRef }, props))));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Story,
|
|
3
|
+
Preview,
|
|
4
|
+
Meta,
|
|
5
|
+
SourceState,
|
|
6
|
+
} from "@storybook/addon-docs/blocks";
|
|
7
|
+
import { colors } from "../../tokens";
|
|
8
|
+
import { Svg } from "./Svg";
|
|
9
|
+
|
|
10
|
+
<Meta title="Components/Images/Svg" component={Svg} />
|
|
11
|
+
|
|
12
|
+
# Svg
|
|
13
|
+
|
|
14
|
+
`Svg` is a component to display
|
|
15
|
+
[vector images](https://developer.mozilla.org/en-US/docs/Web/SVG).
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
import { Svg } from "@conveyorhq/arrow-ds";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Basic usage
|
|
24
|
+
|
|
25
|
+
<Preview withSource={SourceState.OPEN}>
|
|
26
|
+
<Story name="Svg">
|
|
27
|
+
<Svg viewBox="0 0 300 100" fill={colors.gray["900"]}>
|
|
28
|
+
<circle cx="50" cy="50" r="40" />
|
|
29
|
+
</Svg>
|
|
30
|
+
</Story>
|
|
31
|
+
</Preview>
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
`Svg` has no special props; you may apply any valid
|
|
36
|
+
[attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute).
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
|
|
3
|
-
export type SvgProps = SVGAttributes<SVGElement>;
|
|
3
|
+
export type SvgProps = React.SVGAttributes<SVGElement>;
|
|
4
4
|
|
|
5
|
-
export const Svg
|
|
6
|
-
|
|
5
|
+
export const Svg = React.forwardRef<SVGSVGElement, SvgProps>(
|
|
6
|
+
(props, forwardedRef) => (
|
|
7
|
+
<svg xmlns="http://www.w3.org/2000/svg" ref={forwardedRef} {...props} />
|
|
8
|
+
),
|
|
7
9
|
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const react_2 = require("@storybook/react");
|
|
8
|
-
const Story_1 = __importDefault(require("../../storybook-components/Story"));
|
|
9
|
-
const tokens_1 = require("../../tokens");
|
|
10
|
-
const Svg_1 = require("./Svg");
|
|
11
|
-
const stories = react_2.storiesOf("Components/Images/Svg", module);
|
|
12
|
-
stories.add("Default", () => (react_1.default.createElement(Story_1.default, { title: "Svg" },
|
|
13
|
-
react_1.default.createElement(Svg_1.Svg, { viewBox: "0 0 300 100", fill: tokens_1.colors.gray["900"] },
|
|
14
|
-
react_1.default.createElement("circle", { cx: "50", cy: "50", r: "40" })))));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { storiesOf } from "@storybook/react";
|
|
3
|
-
import Story from "../../storybook-components/Story";
|
|
4
|
-
import { colors } from "../../tokens";
|
|
5
|
-
import { Svg } from "./Svg";
|
|
6
|
-
|
|
7
|
-
const stories = storiesOf("Components/Images/Svg", module);
|
|
8
|
-
|
|
9
|
-
stories.add("Default", () => (
|
|
10
|
-
<Story title="Svg">
|
|
11
|
-
<Svg viewBox="0 0 300 100" fill={colors.gray["900"]}>
|
|
12
|
-
<circle cx="50" cy="50" r="40" />
|
|
13
|
-
</Svg>
|
|
14
|
-
</Story>
|
|
15
|
-
));
|