@omnific/icons 0.1.0 → 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.
package/README.md CHANGED
@@ -10,10 +10,9 @@ import { LoadingIcon } from '@omnific/icons';
10
10
 
11
11
  ## Icon preview
12
12
 
13
- The React preview app lives in `docs/icons` and is deployed to GitHub Pages from `main`:
13
+ The React preview app lives in `packages/icons/docs` (including `public`) and is deployed to GitHub Pages from `main`:
14
14
 
15
- - Local dev: `pnpm --dir docs/icons dev`
16
- - Production build: `pnpm --dir docs/icons build`
17
- - Local production preview: `pnpm --dir docs/icons preview`
18
- - Pages artifact check: `pnpm --dir docs/icons verify:pages`
15
+ - Local dev: `pnpm --dir packages/icons docs:dev`
16
+ - Production build: `pnpm --dir packages/icons docs:build`
17
+ - Local production preview: `pnpm --dir packages/icons docs:preview`
19
18
  - Online preview: https://monhan-97.github.io/omnific/
@@ -0,0 +1,11 @@
1
+ import { IconProps } from "./iconTypes.js";
2
+ //#region ChevronUp.d.ts
3
+ /**
4
+ Props accepted by {@link ChevronUp}.
5
+ */
6
+ export type ChevronUpProps = IconProps;
7
+ /**
8
+ Renders an upward chevron used for expand and menu controls.
9
+ */
10
+ export declare const ChevronUp: import("react").ComponentType<IconProps>;
11
+ //#endregion
@@ -0,0 +1,8 @@
1
+ import { createIcon } from "./createIcon.js";
2
+ //#region ChevronUp.tsx
3
+ /**
4
+ Renders an upward chevron used for expand and menu controls.
5
+ */
6
+ const ChevronUp = createIcon([["path", { d: "m18 15-6-6-6 6" }]]);
7
+ //#endregion
8
+ export { ChevronUp };
package/dist/EyeIcon.d.ts CHANGED
@@ -1,14 +1,11 @@
1
1
  import { IconProps } from "./iconTypes.js";
2
- import * as _$react from "react";
3
-
4
2
  //#region EyeIcon.d.ts
5
3
  /**
6
4
  Props accepted by {@link EyeIcon}.
7
5
  */
8
- type EyeIconProps = IconProps;
6
+ export type EyeIconProps = IconProps;
9
7
  /**
10
8
  Renders an eye used to indicate visible content.
11
9
  */
12
- declare const EyeIcon: _$react.ComponentType<IconProps>;
13
- //#endregion
14
- export { EyeIcon, EyeIconProps };
10
+ export declare const EyeIcon: import("react").ComponentType<IconProps>;
11
+ //#endregion
@@ -1,14 +1,11 @@
1
1
  import { IconProps } from "./iconTypes.js";
2
- import * as _$react from "react";
3
-
4
2
  //#region EyeOffIcon.d.ts
5
3
  /**
6
4
  Props accepted by {@link EyeOffIcon}.
7
5
  */
8
- type EyeOffIconProps = IconProps;
6
+ export type EyeOffIconProps = IconProps;
9
7
  /**
10
8
  Renders a crossed-out eye used to indicate hidden content.
11
9
  */
12
- declare const EyeOffIcon: _$react.ComponentType<IconProps>;
13
- //#endregion
14
- export { EyeOffIcon, EyeOffIconProps };
10
+ export declare const EyeOffIcon: import("react").ComponentType<IconProps>;
11
+ //#endregion
@@ -1,14 +1,11 @@
1
1
  import { IconProps } from "./iconTypes.js";
2
- import * as _$react from "react";
3
-
4
2
  //#region LoadingIcon.d.ts
5
3
  /**
6
4
  Props accepted by {@link LoadingIcon}.
7
5
  */
8
- type LoadingIconProps = IconProps;
6
+ export type LoadingIconProps = IconProps;
9
7
  /**
10
8
  Renders the package loading indicator.
11
9
  */
12
- declare const LoadingIcon: _$react.ComponentType<IconProps>;
13
- //#endregion
14
- export { LoadingIcon, LoadingIconProps };
10
+ export declare const LoadingIcon: import("react").ComponentType<IconProps>;
11
+ //#endregion
@@ -0,0 +1,11 @@
1
+ import { IconProps } from "./iconTypes.js";
2
+ //#region PanelLeftClose.d.ts
3
+ /**
4
+ Props accepted by {@link PanelLeftClose}.
5
+ */
6
+ export type PanelLeftCloseProps = IconProps;
7
+ /**
8
+ Renders a left panel with a close chevron used for collapsing sidebars.
9
+ */
10
+ export declare const PanelLeftClose: import("react").ComponentType<IconProps>;
11
+ //#endregion
@@ -0,0 +1,18 @@
1
+ import { createIcon } from "./createIcon.js";
2
+ //#region PanelLeftClose.tsx
3
+ /**
4
+ Renders a left panel with a close chevron used for collapsing sidebars.
5
+ */
6
+ const PanelLeftClose = createIcon([
7
+ ["rect", {
8
+ width: "18",
9
+ height: "18",
10
+ x: "3",
11
+ y: "3",
12
+ rx: "2"
13
+ }],
14
+ ["path", { d: "M9 3v18" }],
15
+ ["path", { d: "m16 15-3-3 3-3" }]
16
+ ]);
17
+ //#endregion
18
+ export { PanelLeftClose };
@@ -0,0 +1,11 @@
1
+ import { IconProps } from "./iconTypes.js";
2
+ //#region RotateCw.d.ts
3
+ /**
4
+ Props accepted by {@link RotateCw}.
5
+ */
6
+ export type RotateCwProps = IconProps;
7
+ /**
8
+ Renders a clockwise arrow used for reset and refresh actions.
9
+ */
10
+ export declare const RotateCw: import("react").ComponentType<IconProps>;
11
+ //#endregion
@@ -0,0 +1,8 @@
1
+ import { createIcon } from "./createIcon.js";
2
+ //#region RotateCw.tsx
3
+ /**
4
+ Renders a clockwise arrow used for reset and refresh actions.
5
+ */
6
+ const RotateCw = createIcon([["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }], ["path", { d: "M21 3v5h-5" }]]);
7
+ //#endregion
8
+ export { RotateCw };
@@ -0,0 +1,11 @@
1
+ import { IconProps } from "./iconTypes.js";
2
+ //#region Search.d.ts
3
+ /**
4
+ Props accepted by {@link Search}.
5
+ */
6
+ export type SearchProps = IconProps;
7
+ /**
8
+ Renders a magnifying glass used for search actions.
9
+ */
10
+ export declare const Search: import("react").ComponentType<IconProps>;
11
+ //#endregion
package/dist/Search.js ADDED
@@ -0,0 +1,12 @@
1
+ import { createIcon } from "./createIcon.js";
2
+ //#region Search.tsx
3
+ /**
4
+ Renders a magnifying glass used for search actions.
5
+ */
6
+ const Search = createIcon([["path", { d: "m21 21-4.34-4.34" }], ["circle", {
7
+ cx: "11",
8
+ cy: "11",
9
+ r: "8"
10
+ }]]);
11
+ //#endregion
12
+ export { Search };
@@ -0,0 +1,11 @@
1
+ import { IconProps } from "./iconTypes.js";
2
+ //#region SlidersHorizontal.d.ts
3
+ /**
4
+ Props accepted by {@link SlidersHorizontal}.
5
+ */
6
+ export type SlidersHorizontalProps = IconProps;
7
+ /**
8
+ Renders horizontal sliders used for filter and customization controls.
9
+ */
10
+ export declare const SlidersHorizontal: import("react").ComponentType<IconProps>;
11
+ //#endregion
@@ -0,0 +1,18 @@
1
+ import { createIcon } from "./createIcon.js";
2
+ //#region SlidersHorizontal.tsx
3
+ /**
4
+ Renders horizontal sliders used for filter and customization controls.
5
+ */
6
+ const SlidersHorizontal = createIcon([
7
+ ["path", { d: "M10 5H3" }],
8
+ ["path", { d: "M12 19H3" }],
9
+ ["path", { d: "M14 3v4" }],
10
+ ["path", { d: "M16 17v4" }],
11
+ ["path", { d: "M21 12h-9" }],
12
+ ["path", { d: "M21 19h-5" }],
13
+ ["path", { d: "M21 5h-7" }],
14
+ ["path", { d: "M8 10v4" }],
15
+ ["path", { d: "M8 12H3" }]
16
+ ]);
17
+ //#endregion
18
+ export { SlidersHorizontal };
package/dist/SvgIcon.d.ts CHANGED
@@ -1,12 +1,9 @@
1
1
  import { IconProps } from "./iconTypes.js";
2
- import * as _$react from "react";
3
-
4
2
  //#region SvgIcon.d.ts
5
3
  /**
6
4
  * SvgIcon 组件,用于渲染自定义的 SVG 图标
7
5
  * @param {IconProps} props - 组件的属性对象
8
6
  * @returns {JSX.Element} 返回一个 SVG 元素
9
7
  */
10
- declare const SvgIcon: (props: IconProps) => _$react.JSX.Element;
11
- //#endregion
12
- export { SvgIcon };
8
+ export declare const SvgIcon: (props: IconProps) => import("react").JSX.Element;
9
+ //#endregion
package/dist/X.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { IconProps } from "./iconTypes.js";
2
+ //#region X.d.ts
3
+ /**
4
+ Props accepted by {@link X}.
5
+ */
6
+ export type XProps = IconProps;
7
+ /**
8
+ Renders an X used for dismiss and clear actions.
9
+ */
10
+ export declare const X: import("react").ComponentType<IconProps>;
11
+ //#endregion
package/dist/X.js ADDED
@@ -0,0 +1,8 @@
1
+ import { createIcon } from "./createIcon.js";
2
+ //#region X.tsx
3
+ /**
4
+ Renders an X used for dismiss and clear actions.
5
+ */
6
+ const X = createIcon([["path", { d: "M18 6 6 18" }], ["path", { d: "m6 6 12 12" }]]);
7
+ //#endregion
8
+ export { X };
@@ -1,13 +1,14 @@
1
1
  import { SvgIcon } from "./SvgIcon.js";
2
+ import { uniqueId } from "@omnific/utils";
2
3
  import { createElement } from "react";
3
4
  //#region createIcon.ts
4
5
  /**
5
6
  Creates a named package icon from immutable SVG artwork nodes.
6
7
  */
7
8
  const createIcon = (nodes) => {
8
- const artwork = nodes.map(([tag, attributes], index) => createElement(tag, {
9
+ const artwork = nodes.map(([tag, attributes]) => createElement(tag, {
9
10
  ...attributes,
10
- key: `${tag}-${index}`
11
+ key: uniqueId(`${tag}-`)
11
12
  }));
12
13
  const Icon = (props) => {
13
14
  const { children, ...properties } = props;
@@ -1,22 +1,20 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from "react";
2
-
3
2
  //#region iconTypes.d.ts
4
3
  /**
5
4
  Props shared by the package's SVG icon components.
6
5
  */
7
- type IconProps = ComponentPropsWithRef<'svg'> & {
6
+ export type IconProps = ComponentPropsWithRef<'svg'> & {
8
7
  /**
9
- Icon width and height in pixels.
10
- */
8
+ Icon width and height in pixels.
9
+ */
11
10
  size?: number | string;
12
11
  /**
13
- Keeps the apparent stroke width constant when the icon is resized.
14
- */
12
+ Keeps the apparent stroke width constant when the icon is resized.
13
+ */
15
14
  absoluteStrokeWidth?: boolean;
16
15
  /**
17
- Optional artwork or consumer content rendered after the icon nodes.
18
- */
16
+ Optional artwork or consumer content rendered after the icon nodes.
17
+ */
19
18
  children?: ReactNode;
20
19
  };
21
- //#endregion
22
- export { IconProps };
20
+ //#endregion
package/dist/main.d.ts CHANGED
@@ -1,4 +1,10 @@
1
+ import { ChevronUp, ChevronUpProps } from "./ChevronUp.js";
1
2
  import { EyeIcon, EyeIconProps } from "./EyeIcon.js";
2
3
  import { EyeOffIcon, EyeOffIconProps } from "./EyeOffIcon.js";
3
4
  import { LoadingIcon, LoadingIconProps } from "./LoadingIcon.js";
4
- export { EyeIcon, type EyeIconProps, EyeOffIcon, type EyeOffIconProps, LoadingIcon, type LoadingIconProps };
5
+ import { PanelLeftClose, PanelLeftCloseProps } from "./PanelLeftClose.js";
6
+ import { RotateCw, RotateCwProps } from "./RotateCw.js";
7
+ import { Search, SearchProps } from "./Search.js";
8
+ import { SlidersHorizontal, SlidersHorizontalProps } from "./SlidersHorizontal.js";
9
+ import { X, XProps } from "./X.js";
10
+ export { ChevronUp, type ChevronUpProps, EyeIcon, type EyeIconProps, EyeOffIcon, type EyeOffIconProps, LoadingIcon, type LoadingIconProps, PanelLeftClose, type PanelLeftCloseProps, RotateCw, type RotateCwProps, Search, type SearchProps, SlidersHorizontal, type SlidersHorizontalProps, X, type XProps };
package/dist/main.js CHANGED
@@ -1,4 +1,10 @@
1
+ import { ChevronUp } from "./ChevronUp.js";
1
2
  import { EyeIcon } from "./EyeIcon.js";
2
3
  import { EyeOffIcon } from "./EyeOffIcon.js";
3
4
  import { LoadingIcon } from "./LoadingIcon.js";
4
- export { EyeIcon, EyeOffIcon, LoadingIcon };
5
+ import { PanelLeftClose } from "./PanelLeftClose.js";
6
+ import { RotateCw } from "./RotateCw.js";
7
+ import { Search } from "./Search.js";
8
+ import { SlidersHorizontal } from "./SlidersHorizontal.js";
9
+ import { X } from "./X.js";
10
+ export { ChevronUp, EyeIcon, EyeOffIcon, LoadingIcon, PanelLeftClose, RotateCw, Search, SlidersHorizontal, X };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnific/icons",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "React icon components for Omnific",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,6 +27,11 @@
27
27
  "import": "./dist/main.js",
28
28
  "default": "./dist/main.js"
29
29
  },
30
+ "./ChevronUp": {
31
+ "types": "./dist/ChevronUp.d.ts",
32
+ "import": "./dist/ChevronUp.js",
33
+ "default": "./dist/ChevronUp.js"
34
+ },
30
35
  "./EyeIcon": {
31
36
  "types": "./dist/EyeIcon.d.ts",
32
37
  "import": "./dist/EyeIcon.js",
@@ -41,6 +46,31 @@
41
46
  "types": "./dist/LoadingIcon.d.ts",
42
47
  "import": "./dist/LoadingIcon.js",
43
48
  "default": "./dist/LoadingIcon.js"
49
+ },
50
+ "./PanelLeftClose": {
51
+ "types": "./dist/PanelLeftClose.d.ts",
52
+ "import": "./dist/PanelLeftClose.js",
53
+ "default": "./dist/PanelLeftClose.js"
54
+ },
55
+ "./RotateCw": {
56
+ "types": "./dist/RotateCw.d.ts",
57
+ "import": "./dist/RotateCw.js",
58
+ "default": "./dist/RotateCw.js"
59
+ },
60
+ "./Search": {
61
+ "types": "./dist/Search.d.ts",
62
+ "import": "./dist/Search.js",
63
+ "default": "./dist/Search.js"
64
+ },
65
+ "./SlidersHorizontal": {
66
+ "types": "./dist/SlidersHorizontal.d.ts",
67
+ "import": "./dist/SlidersHorizontal.js",
68
+ "default": "./dist/SlidersHorizontal.js"
69
+ },
70
+ "./X": {
71
+ "types": "./dist/X.d.ts",
72
+ "import": "./dist/X.js",
73
+ "default": "./dist/X.js"
44
74
  }
45
75
  },
46
76
  "sideEffects": false,
@@ -48,18 +78,37 @@
48
78
  "dist",
49
79
  "README.md"
50
80
  ],
81
+ "scripts": {
82
+ "build": "tsdown -c tsdown.config.mjs",
83
+ "test": "vitest run",
84
+ "typecheck": "tsc -p tsconfig.json --noEmit",
85
+ "docs:dev": "react-scripts dev",
86
+ "docs:build": "react-scripts build",
87
+ "docs:preview": "react-scripts dev",
88
+ "docs:typecheck": "pnpm typecheck",
89
+ "docs:lint": "eslint react-scripts.config.ts docs",
90
+ "docs:test": "vitest run --root ../.. packages/icons/docs"
91
+ },
92
+ "dependencies": {
93
+ "@omnific/utils": "workspace:*"
94
+ },
51
95
  "peerDependencies": {
52
96
  "react": "^19.0.0"
53
97
  },
54
98
  "devDependencies": {
55
- "@types/react": "^19.2.18",
56
- "react": "^19.2.8",
57
- "vitest": "^4.1.10",
58
- "@omnific/tsconfig": "0.2.0"
99
+ "@omnific/react-scripts": "workspace:*",
100
+ "@omnific/tsconfig": "workspace:*",
101
+ "@swc/helpers": "0.5.23",
102
+ "@types/react": "^19.3.0",
103
+ "@types/react-dom": "19.3.0",
104
+ "clsx": "2.1.1",
105
+ "react": "^19.3.0",
106
+ "react-dom": "19.3.0"
59
107
  },
60
- "scripts": {
61
- "build": "tsdown -c tsdown.config.mjs",
62
- "test": "vitest run",
63
- "typecheck": "tsc -p tsconfig.json --noEmit"
64
- }
65
- }
108
+ "browserslist": [
109
+ "last 2 Chrome versions",
110
+ "last 2 Firefox versions",
111
+ "last 2 Safari versions",
112
+ "not dead"
113
+ ]
114
+ }