@nstc-design/icons 0.0.5 → 0.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.
@@ -1,13 +0,0 @@
1
- import type * as React from "react";
2
-
3
- export interface IconCommonProps {
4
- size?: number | string;
5
- color?: string;
6
- originColor?: boolean;
7
- }
8
- export type IconSvgProps = IconCommonProps & { button?: false; background?: never } & React.SVGProps<SVGSVGElement>;
9
- export type IconButtonProps = IconCommonProps & { button: true; background?: boolean } & React.ButtonHTMLAttributes<HTMLButtonElement>;
10
- export declare const FileExcelColor: {
11
- (props: IconSvgProps & React.RefAttributes<SVGSVGElement>): React.ReactElement | null;
12
- (props: IconButtonProps & React.RefAttributes<HTMLButtonElement>): React.ReactElement | null;
13
- };
@@ -1,41 +0,0 @@
1
- import { createElement, forwardRef } from "react";
2
-
3
- const toSize = (size) => typeof size === "number" ? `${size}px` : size;
4
- const toButtonIconSize = (size) => typeof size === "number" ? `${Math.max(0, size - 8)}px` : `max(0px, calc(${size} - 8px))`;
5
- const joinClassNames = (...values) => values.filter(Boolean).join(" ");
6
- export const FileExcelColor = forwardRef(function FileExcelColor(props, ref) {
7
- const {
8
- size,
9
- color,
10
- originColor = true,
11
- button = false,
12
- background = true,
13
- className,
14
- style,
15
- ...attributes
16
- } = props;
17
- const renderedSize = size ?? 16;
18
- const buttonSize = size ?? 24;
19
- const svgAttributes = { "fill": "none", "viewBox": "0 0 36 36", "xmlns": "http://www.w3.org/2000/svg" };
20
- const svgStyle = color === undefined ? style : { ...style, color };
21
- const buttonStyle = { ...svgStyle, width: toSize(buttonSize), height: toSize(buttonSize) };
22
- const svg = createElement(
23
- "svg",
24
- button
25
- ? { ...svgAttributes, width: toButtonIconSize(buttonSize), height: toButtonIconSize(buttonSize), "aria-hidden": true }
26
- : { ...attributes, ...svgAttributes, ref, width: toSize(renderedSize), height: toSize(renderedSize), className, style: svgStyle },
27
- createElement("g", { "clipPath": "url(#file-excel-color_svg__a)" }, createElement("path", { "d": "M6.3 1.8h19.381L33.3 9.483V30.6a3.6 3.6 0 0 1-3.6 3.6H6.3a3.6 3.6 0 0 1-3.6-3.6V5.4a3.6 3.6 0 0 1 3.6-3.6", "fill": originColor ? "#00a98b" : "currentColor" }), createElement("mask", { "height": "34", "id": "file-excel-color_svg__b", "maskUnits": "userSpaceOnUse", "width": "32", "x": "2", "y": "1" }, createElement("path", { "d": "M6.3 1.8h19.381L33.3 9.483V30.6a3.6 3.6 0 0 1-3.6 3.6H6.3a3.6 3.6 0 0 1-3.6-3.6V5.4a3.6 3.6 0 0 1 3.6-3.6", "fill": "#fff" })), createElement("g", { "mask": "url(#file-excel-color_svg__b)" }, createElement("g", { "filter": "url(#file-excel-color_svg__c)" }, createElement("path", { "d": "M26.329 6.107V1.8L34.2 9.707H29.93a3.6 3.6 0 0 1-3.6-3.6", "fill": originColor ? "#000" : "currentColor" })), createElement("path", { "d": "M26.329 6.107V1.8L34.2 9.707H29.93a3.6 3.6 0 0 1-3.6-3.6", "fill": originColor ? "#10ceac" : "currentColor" })), createElement("path", { "d": "M24.3 22.677 22.677 24.3 11.7 13.324l1.623-1.624zm-8.438-4.168 1.628 1.628-4.162 4.163-1.628-1.628zm8.438-5.181L20.126 17.5 18.5 15.874l4.174-4.174z", "fill": originColor ? "#fff" : "currentColor" })), createElement("defs", { }, createElement("clipPath", { "id": "file-excel-color_svg__a" }, createElement("path", { "d": "M0 0h36v36H0z", "fill": "#fff" })), createElement("filter", { "colorInterpolationFilters": "sRGB", "filterUnits": "userSpaceOnUse", "height": "20.867", "id": "file-excel-color_svg__c", "width": "20.831", "x": "19.849", "y": "-5.76" }, createElement("feFlood", { "floodOpacity": "0", "result": "BackgroundImageFix" }), createElement("feColorMatrix", { "in": "SourceAlpha", "result": "hardAlpha", "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), createElement("feOffset", { "dy": "-1.08" }), createElement("feGaussianBlur", { "stdDeviation": "3.24" }), createElement("feColorMatrix", { "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0" }), createElement("feBlend", { "in2": "BackgroundImageFix", "result": "effect1_dropShadow_1743_1071" }), createElement("feBlend", { "in": "SourceGraphic", "in2": "effect1_dropShadow_1743_1071", "result": "shape" }))),
28
- );
29
- if (!button) return svg;
30
- return createElement(
31
- "button",
32
- {
33
- ...attributes,
34
- ref,
35
- type: attributes.type ?? "button",
36
- className: joinClassNames("nstc-icon-button", background && "nstc-icon-button--background", className),
37
- style: buttonStyle,
38
- },
39
- svg,
40
- );
41
- });
@@ -1,10 +0,0 @@
1
- import type { DefineComponent } from "vue";
2
-
3
- export interface IconProps {
4
- size?: number | string;
5
- color?: string;
6
- originColor?: boolean;
7
- button?: boolean;
8
- background?: boolean;
9
- }
10
- export declare const FileExcelColor: DefineComponent<IconProps>;
@@ -1,39 +0,0 @@
1
- import { defineComponent, h, ref } from "vue";
2
-
3
- const toSize = (size) => typeof size === "number" ? `${size}px` : size;
4
- const toButtonIconSize = (size) => typeof size === "number" ? `${Math.max(0, size - 8)}px` : `max(0px, calc(${size} - 8px))`;
5
- const joinClassNames = (...values) => values.filter(Boolean).join(" ");
6
- export const FileExcelColor = defineComponent({
7
- name: "FileExcelColor",
8
- inheritAttrs: false,
9
- props: {
10
- size: { type: [String, Number], default: undefined },
11
- color: { type: String, default: undefined },
12
- originColor: { type: Boolean, default: true },
13
- button: { type: Boolean, default: false },
14
- background: { type: Boolean, default: true },
15
- },
16
- setup(props, { attrs, expose }) {
17
- const root = ref(null);
18
- expose({ el: root });
19
- return () => {
20
- const originColor = props.originColor;
21
- const renderedSize = props.size ?? 16;
22
- const buttonSize = props.size ?? 24;
23
- const svgAttributes = { "fill": "none", "viewBox": "0 0 36 36", "xmlns": "http://www.w3.org/2000/svg" };
24
- const style = props.color === undefined ? attrs.style : [attrs.style, { color: props.color }];
25
- const buttonStyle = [style, { width: toSize(buttonSize), height: toSize(buttonSize) }];
26
- const svg = h("svg", props.button
27
- ? { ...svgAttributes, width: toButtonIconSize(buttonSize), height: toButtonIconSize(buttonSize), "aria-hidden": true }
28
- : { ...attrs, ...svgAttributes, ref: root, width: toSize(renderedSize), height: toSize(renderedSize), style }, [h("g", { "clip-path": "url(#file-excel-color_svg__a)" }, [h("path", { "d": "M6.3 1.8h19.381L33.3 9.483V30.6a3.6 3.6 0 0 1-3.6 3.6H6.3a3.6 3.6 0 0 1-3.6-3.6V5.4a3.6 3.6 0 0 1 3.6-3.6", "fill": originColor ? "#00a98b" : "currentColor" }), h("mask", { "height": "34", "id": "file-excel-color_svg__b", "maskUnits": "userSpaceOnUse", "width": "32", "x": "2", "y": "1" }, [h("path", { "d": "M6.3 1.8h19.381L33.3 9.483V30.6a3.6 3.6 0 0 1-3.6 3.6H6.3a3.6 3.6 0 0 1-3.6-3.6V5.4a3.6 3.6 0 0 1 3.6-3.6", "fill": "#fff" })]), h("g", { "mask": "url(#file-excel-color_svg__b)" }, [h("g", { "filter": "url(#file-excel-color_svg__c)" }, [h("path", { "d": "M26.329 6.107V1.8L34.2 9.707H29.93a3.6 3.6 0 0 1-3.6-3.6", "fill": originColor ? "#000" : "currentColor" })]), h("path", { "d": "M26.329 6.107V1.8L34.2 9.707H29.93a3.6 3.6 0 0 1-3.6-3.6", "fill": originColor ? "#10ceac" : "currentColor" })]), h("path", { "d": "M24.3 22.677 22.677 24.3 11.7 13.324l1.623-1.624zm-8.438-4.168 1.628 1.628-4.162 4.163-1.628-1.628zm8.438-5.181L20.126 17.5 18.5 15.874l4.174-4.174z", "fill": originColor ? "#fff" : "currentColor" })]), h("defs", { }, [h("clipPath", { "id": "file-excel-color_svg__a" }, [h("path", { "d": "M0 0h36v36H0z", "fill": "#fff" })]), h("filter", { "color-interpolation-filters": "sRGB", "filterUnits": "userSpaceOnUse", "height": "20.867", "id": "file-excel-color_svg__c", "width": "20.831", "x": "19.849", "y": "-5.76" }, [h("feFlood", { "flood-opacity": "0", "result": "BackgroundImageFix" }), h("feColorMatrix", { "in": "SourceAlpha", "result": "hardAlpha", "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), h("feOffset", { "dy": "-1.08" }), h("feGaussianBlur", { "stdDeviation": "3.24" }), h("feColorMatrix", { "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0" }), h("feBlend", { "in2": "BackgroundImageFix", "result": "effect1_dropShadow_1743_1071" }), h("feBlend", { "in": "SourceGraphic", "in2": "effect1_dropShadow_1743_1071", "result": "shape" })])])]);
29
- if (!props.button) return svg;
30
- return h("button", {
31
- ...attrs,
32
- ref: root,
33
- type: attrs.type ?? "button",
34
- class: joinClassNames("nstc-icon-button", props.background && "nstc-icon-button--background", attrs.class),
35
- style: buttonStyle,
36
- }, [svg]);
37
- };
38
- },
39
- });
@@ -1,5 +0,0 @@
1
- import "./index.js";
2
- import type { Plugin } from "vue";
3
-
4
- declare const install: Plugin<[]>;
5
- export default install;