@vnejs/uis.react.icon 0.1.2 → 0.1.4

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/dist/Icon.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import "./Icon.styl";
2
1
  export declare const Icon: ({ zIndex, transition, width, height, marginTop, marginRight, marginBottom, marginLeft, aspectRatioX, aspectRatioY, transformOriginX, transformOriginY, scale, opacity, className, src, srcHover, isDisabled, isNotRender, isOpacityOnHover, view, onClick, value, }: {
3
2
  zIndex?: any;
4
3
  transition?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAIrB,eAAO,MAAM,IAAI,GAAI;;;;;;;;;;;;;;;;;;;;;;;;CAwBpB,4CAyDA,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,GAAI;;;;;;;;;;;;;;;;;;;;;;;;CAwBpB,4CAyDA,CAAC"}
package/dist/Icon.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo } from "react";
3
- import { cn, getVneLength } from "@vnejs/uis.utils";
4
- import "./Icon.styl";
5
- const b = cn("Icon");
3
+ import { getVneLength } from "@vnejs/uis.utils";
4
+ import { b } from "./Icon.styles.js";
6
5
  export const Icon = ({ zIndex = null, transition = 300, width = 0, height = 0, marginTop = 0, marginRight = 0, marginBottom = 0, marginLeft = 0, aspectRatioX = 0, aspectRatioY = 0, transformOriginX = null, transformOriginY = null, scale = null, opacity = null, className, src, srcHover, isDisabled = false, isNotRender = false, isOpacityOnHover = false, view = "", onClick, value, }) => {
7
6
  const withHoverSrc = !isDisabled && Boolean(srcHover);
8
7
  const withOpacityOnHover = !isDisabled && isOpacityOnHover;
package/dist/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@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.styles.d.ts","sourceRoot":"","sources":["../src/Icon.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC,4BAAa,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { cn, injectStyles, sel } from "@vnejs/uis.utils";
2
+ export const b = cn("Icon");
3
+ const CSS = `
4
+ ${sel(b())} {
5
+ display: block;
6
+ background-size: 100% 100%;
7
+ background-position: center;
8
+ background-repeat: no-repeat;
9
+ background-image: var(--vne-icon-src);
10
+ }
11
+
12
+ ${sel(b({ withHoverSrc: true }))}[vne-cursor-target] {
13
+ background-image: var(--vne-icon-src-hover);
14
+ }
15
+
16
+ ${sel(b({ withOpacityOnHover: true }))} {
17
+ opacity: 1;
18
+ }
19
+
20
+ ${sel(b({ withOpacityOnHover: true }))}[vne-cursor-target] {
21
+ opacity: 0.75;
22
+ }
23
+ `;
24
+ injectStyles(CSS);
25
+ //# sourceMappingURL=Icon.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.styles.js","sourceRoot":"","sources":["../src/Icon.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;AAE5B,MAAM,GAAG,GAAG;EACV,GAAG,CAAC,CAAC,EAAE,CAAC;;;;;;;;EAQR,GAAG,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;;;;EAI9B,GAAG,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;;;;EAIpC,GAAG,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;;;CAGrC,CAAC;AAEF,YAAY,CAAC,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,31 +1,26 @@
1
1
  {
2
2
  "name": "@vnejs/uis.react.icon",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
7
- "build": "node ../../scripts/build-package.mjs",
8
- "publish:major:plugin": "npm run publish:major",
9
- "publish:minor:plugin": "npm run publish:minor",
10
- "publish:patch:plugin": "npm run publish:patch",
11
- "publish:major": "npm run build && npm version major && npm publish --access public",
12
- "publish:minor": "npm run build && npm version minor && npm publish --access public",
13
- "publish:patch": "npm run build && npm version patch && npm publish --access public"
7
+ "build": "npx @vnejs/monorepo package",
8
+ "publish:major:uis:react": "npm run publish:major",
9
+ "publish:minor:uis:react": "npm run publish:minor",
10
+ "publish:patch:uis:react": "npm run publish:patch",
11
+ "publish:major": "npx @vnejs/monorepo publish major --access public",
12
+ "publish:minor": "npx @vnejs/monorepo publish minor --access public",
13
+ "publish:patch": "npx @vnejs/monorepo publish patch --access public"
14
14
  },
15
15
  "peerDependencies": {
16
- "@bem-react/classname": "1.5.12",
17
- "@vnejs/uis.utils": "~0.1.0",
18
- "react": "19.2.4",
19
- "react-dom": "19.2.4"
16
+ "@vnejs/uis.utils": "~0.1.0"
20
17
  },
21
18
  "devDependencies": {
22
- "@vnejs/uis.react": "~0.1.0",
23
- "typescript": "^5.7.3",
24
- "@types/react": "^19.0.10",
25
- "@types/react-dom": "^19.0.4"
19
+ "@vnejs/uis.react": "~0.1.0"
26
20
  },
27
21
  "files": [
28
22
  "dist",
29
- "package.json"
23
+ "src",
24
+ "tsconfig.json"
30
25
  ]
31
26
  }
@@ -0,0 +1,34 @@
1
+ import { renderWithVneWrap, VneWrap } from "@vnejs/uis.react";
2
+
3
+ import { Icon, Flex } from "@vnejs/uis.react";
4
+
5
+ export const Common = {
6
+ args: {
7
+ ...VneWrap.DEFAULT_ARGS,
8
+
9
+ zIndex: 10,
10
+ width: 120,
11
+ height: 120,
12
+ transition: 300,
13
+ src: "./icons/Hide.png",
14
+ isDisabled: false,
15
+ },
16
+ };
17
+
18
+ export default {
19
+ title: "Primitives/Icon",
20
+ render: renderWithVneWrap((args) => <Icon {...args} />),
21
+ argTypes: {
22
+ ...VneWrap.ARGS,
23
+
24
+ // Icon
25
+ zIndex: { control: { type: "number", min: -100, max: 100, step: 5 } },
26
+ width: { control: { type: "number", min: 120, max: 600, step: 12 } },
27
+ height: { control: { type: "number", min: 60, max: 480, step: 12 } },
28
+ aspectRatioX: { control: { type: "number", min: 0, max: 20, step: 1 } },
29
+ aspectRatioY: { control: { type: "number", min: 0, max: 20, step: 1 } },
30
+ transition: { control: { type: "number", min: 0, max: 600, step: 30 } },
31
+ src: { control: { type: "select" }, options: ["./icons/Hide.png", "./icons/History.png", "./icons/Settings.png"] },
32
+ srcHover: { control: { type: "select" }, options: ["./icons/Hide_H.png", "./icons/History_H.png", "./icons/Settings_H.png"] },
33
+ },
34
+ };
@@ -0,0 +1,27 @@
1
+ import { cn, injectStyles, sel } from "@vnejs/uis.utils";
2
+
3
+ export const b = cn("Icon");
4
+
5
+ const CSS = `
6
+ ${sel(b())} {
7
+ display: block;
8
+ background-size: 100% 100%;
9
+ background-position: center;
10
+ background-repeat: no-repeat;
11
+ background-image: var(--vne-icon-src);
12
+ }
13
+
14
+ ${sel(b({ withHoverSrc: true }))}[vne-cursor-target] {
15
+ background-image: var(--vne-icon-src-hover);
16
+ }
17
+
18
+ ${sel(b({ withOpacityOnHover: true }))} {
19
+ opacity: 1;
20
+ }
21
+
22
+ ${sel(b({ withOpacityOnHover: true }))}[vne-cursor-target] {
23
+ opacity: 0.75;
24
+ }
25
+ `;
26
+
27
+ injectStyles(CSS);
package/src/Icon.tsx ADDED
@@ -0,0 +1,88 @@
1
+ import { useCallback, useMemo } from "react";
2
+
3
+ import { getVneLength } from "@vnejs/uis.utils";
4
+
5
+ import { b } from "./Icon.styles.js";
6
+
7
+ export const Icon = ({
8
+ zIndex = null,
9
+ transition = 300,
10
+ width = 0,
11
+ height = 0,
12
+ marginTop = 0,
13
+ marginRight = 0,
14
+ marginBottom = 0,
15
+ marginLeft = 0,
16
+ aspectRatioX = 0,
17
+ aspectRatioY = 0,
18
+ transformOriginX = null,
19
+ transformOriginY = null,
20
+ scale = null,
21
+ opacity = null,
22
+ className,
23
+ src,
24
+ srcHover,
25
+ isDisabled = false,
26
+ isNotRender = false,
27
+ isOpacityOnHover = false,
28
+ view = "",
29
+ onClick,
30
+ value,
31
+ }) => {
32
+ const withHoverSrc = !isDisabled && Boolean(srcHover);
33
+ const withOpacityOnHover = !isDisabled && isOpacityOnHover;
34
+
35
+ const style = useMemo(() => {
36
+ const result: Record<string, any> = {};
37
+
38
+ if (width) result.width = getVneLength(width);
39
+ if (height) result.height = getVneLength(height);
40
+
41
+ if (scale) result.transform = `scale(${scale})`;
42
+ if (transformOriginX !== null || transformOriginY !== null) result.transformOrigin = `${transformOriginX || 0} ${transformOriginY || 0}`;
43
+ if (aspectRatioX || aspectRatioY) result.aspectRatio = `${aspectRatioX || 1} / ${aspectRatioY || 1}`;
44
+ if (zIndex !== null) result.zIndex = zIndex;
45
+ if (opacity !== null) result.opacity = opacity;
46
+ if (transition !== null) result.transition = transition ? `${transition}ms` : "none";
47
+
48
+ if (marginTop) result.marginTop = getVneLength(marginTop);
49
+ if (marginRight) result.marginRight = getVneLength(marginRight);
50
+ if (marginBottom) result.marginBottom = getVneLength(marginBottom);
51
+ if (marginLeft) result.marginLeft = getVneLength(marginLeft);
52
+
53
+ if (src) result["--vne-icon-src"] = `url("${src}")`;
54
+ if (srcHover) result["--vne-icon-src-hover"] = `url("${srcHover}")`;
55
+
56
+ return result;
57
+ }, [
58
+ zIndex,
59
+ transition,
60
+ opacity,
61
+ width,
62
+ height,
63
+ aspectRatioX,
64
+ aspectRatioY,
65
+ transformOriginX,
66
+ transformOriginY,
67
+ scale,
68
+ src,
69
+ srcHover,
70
+ marginTop,
71
+ marginRight,
72
+ marginBottom,
73
+ marginLeft,
74
+ ]);
75
+
76
+ const onClickHandler = useCallback(() => !isDisabled && onClick && onClick(value), [onClick, value, isDisabled]);
77
+
78
+ if (isNotRender) return null;
79
+
80
+ return (
81
+ <div
82
+ className={b({ view, isDisabled, withHoverSrc, withOpacityOnHover }, [className])}
83
+ onClick={onClickHandler}
84
+ style={style}
85
+ vne-cursor-type={!isDisabled ? "pointer" : ""}
86
+ />
87
+ );
88
+ };
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./Icon";
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "../../../tsconfig.react.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "src"
6
+ },
7
+ "include": [
8
+ "src/**/*.ts",
9
+ "src/**/*.tsx",
10
+ "../../../globals.d.ts",
11
+ "../../../peer-modules.d.ts"
12
+ ],
13
+ "exclude": [
14
+ "dist",
15
+ "node_modules",
16
+ "src/**/*.stories.tsx"
17
+ ]
18
+ }
package/dist/Icon.styl DELETED
@@ -1,16 +0,0 @@
1
- .Icon
2
- display: block
3
-
4
- background-size: 100% 100%;
5
- background-position: center;
6
- background-repeat: no-repeat;
7
- background-image: var(--vne-icon-src)
8
-
9
- &_withHoverSrc[vne-cursor-target]
10
- background-image: var(--vne-icon-src-hover)
11
-
12
- &_withOpacityOnHover
13
- opacity: 1
14
-
15
- &[vne-cursor-target]
16
- opacity: 0.75