@versini/ui-icon-picker 1.2.1 → 2.0.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.
- package/dist/511.js +9 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/components/IconPicker/IconPicker.d.ts +2 -0
- package/dist/{index.js → components/IconPicker/IconPicker.js} +3 -38
- package/dist/{index.d.ts → components/IconPicker/IconPickerTypes.d.ts} +32 -39
- package/dist/components/IconPicker/IconRenderer.d.ts +4 -0
- package/dist/components/IconPicker/IconRenderer.js +36 -0
- package/dist/components/IconPicker/useIconPicker.d.ts +8 -0
- package/dist/components/index.d.ts +3 -0
- package/package.json +13 -5
- /package/dist/{data → components/IconPicker/data}/icon-IconAdd.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconAddLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconAnthropic.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBack.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBackLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBookSparkles.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBookSparklesLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBookmark.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBookmarkLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBranch.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBranchLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBrightness.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconBrightnessLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconChart.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconChartLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconChecked.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconCheckedLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconClose.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconCloseLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconCopied.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconCopiedLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconCopy.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconCopyLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconDelete.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconDeleteLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconDog.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconDown.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconDownLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconDownload.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconDownloadLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconEdit.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconEditLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconEditUser.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconEditUserLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconFrenchFlag.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconGitHub.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconGoogleGemini.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconHide.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconHideLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconHistory.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconHistoryLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconInfo.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconInfoLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconKey.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconKeyLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconLightBulb.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconLightBulbLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconList.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconListLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconLocked.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconLockedLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconMagic.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconMagicLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconMessages.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconMessagesLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconNext.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconNextLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconOpenAI.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconPasskey.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconPenField.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconPenFieldLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconPencilMechanical.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconPencilMechanicalLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconPrevious.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconPreviousLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconProfile.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconProfileLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconProofread.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconProofreadLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRefresh.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRefreshLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRestore.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRestoreLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRewrite.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRewriteLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRotateLeft.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconRotateLeftLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSearch.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSearchLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSelected.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSelectedLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSend.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSendLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSettings.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSettingsLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconShow.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconShowLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSliders.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSlidersLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSort.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSortDown.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSortDownLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSortLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSortUp.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconSortUpLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconStarInCircle.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconStarInCircleLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUnChecked.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUnCheckedLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUnSelected.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUnSelectedLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUnlocked.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUnlockedLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUp.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUpLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUpload.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUploadLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUser.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconUserLight.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconWebSearch.js +0 -0
- /package/dist/{data → components/IconPicker/data}/icon-IconWebSearchLight.js +0 -0
package/dist/511.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON_PICKER_CLASSNAME = "av-icon-picker";
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-icon-picker
|
|
2
|
+
@versini/ui-icon-picker v2.0.0
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { Button } from "@versini/ui-button/button";
|
|
8
7
|
import { ButtonIcon } from "@versini/ui-button/button-icon";
|
|
9
8
|
import { TextInput } from "@versini/ui-textinput";
|
|
10
9
|
import clsx from "clsx";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const ICON_PICKER_CLASSNAME = "av-icon-picker";
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
import { jsxs, useState, useMemo, useEffect, jsx } from "../../511.js";
|
|
16
11
|
|
|
17
12
|
|
|
18
13
|
|
|
@@ -60,32 +55,6 @@ const useIconPicker = ()=>{
|
|
|
60
55
|
|
|
61
56
|
|
|
62
57
|
|
|
63
|
-
|
|
64
|
-
const IconRenderer = ({ icon, ...rest })=>{
|
|
65
|
-
const [IconComponent, setIconComponent] = useState(null);
|
|
66
|
-
useEffect(()=>{
|
|
67
|
-
setIconComponent(null);
|
|
68
|
-
/* v8 ignore start -- dynamic template-literal imports are not instrumented by V8 */ (async ()=>{
|
|
69
|
-
try {
|
|
70
|
-
const mod = await import(`./data/icon-${icon}.js`);
|
|
71
|
-
if (mod && mod.default) {
|
|
72
|
-
setIconComponent(()=>mod.default);
|
|
73
|
-
}
|
|
74
|
-
} catch {
|
|
75
|
-
// Icon not found
|
|
76
|
-
}
|
|
77
|
-
})();
|
|
78
|
-
/* v8 ignore stop */ }, [
|
|
79
|
-
icon
|
|
80
|
-
]);
|
|
81
|
-
if (!IconComponent) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
return /*#__PURE__*/ jsx(IconComponent, {
|
|
85
|
-
"data-slot": "icon",
|
|
86
|
-
...rest
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
58
|
const IconPicker = ({ onChange, className, textInputMode = "dark", noSearch = false })=>{
|
|
90
59
|
const { search, setSearch, icons, loading } = useIconPicker();
|
|
91
60
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -136,9 +105,5 @@ const IconPicker = ({ onChange, className, textInputMode = "dark", noSearch = fa
|
|
|
136
105
|
]
|
|
137
106
|
});
|
|
138
107
|
};
|
|
139
|
-
/* export default */ const IconPicker_IconPicker = ((/* unused pure expression or super */ null && (IconPicker)));
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
108
|
|
|
144
|
-
export {
|
|
109
|
+
export { IconPicker };
|
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* The
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export declare const IconRenderer: ({ icon, ...rest }: {
|
|
36
|
-
icon: string;
|
|
37
|
-
} & React_2.ComponentPropsWithoutRef<"svg">) => JSX.Element | null;
|
|
38
|
-
|
|
39
|
-
export { }
|
|
1
|
+
export type IconModule = Record<string, React.FC<React.ComponentPropsWithoutRef<"svg">>>;
|
|
2
|
+
export type Icons = {
|
|
3
|
+
name: string;
|
|
4
|
+
friendlyName: string;
|
|
5
|
+
Component: React.FC<React.ComponentPropsWithoutRef<"svg">>;
|
|
6
|
+
};
|
|
7
|
+
export type IconPickerProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Optional class name for the root element of the IconPicker component.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Callback function that is called when an icon is selected. It receives the
|
|
14
|
+
* name of the selected icon as a parameter.
|
|
15
|
+
*/
|
|
16
|
+
onChange: (icon: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* The mode of the search input. It can be "dark", "light", "system" or
|
|
19
|
+
* "alt-system". The default value is "dark". This prop is used to set the mode
|
|
20
|
+
* of the search input, which can be useful for better integration with
|
|
21
|
+
* different themes.
|
|
22
|
+
*/
|
|
23
|
+
textInputMode?: "dark" | "light" | "system" | "alt-system";
|
|
24
|
+
/**
|
|
25
|
+
* If true, the search input will not be displayed. The default value is false.
|
|
26
|
+
* This prop can be useful if you want to use the IconPicker component without
|
|
27
|
+
* the search functionality, for example if you want to display all icons
|
|
28
|
+
* without filtering.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
noSearch?: boolean;
|
|
32
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
@versini/ui-icon-picker v2.0.0
|
|
3
|
+
© 2026 gizmette.com
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useState, useEffect, jsx } from "../../511.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const IconRenderer = ({ icon, ...rest })=>{
|
|
11
|
+
const [IconComponent, setIconComponent] = useState(null);
|
|
12
|
+
useEffect(()=>{
|
|
13
|
+
setIconComponent(null);
|
|
14
|
+
/* v8 ignore start -- dynamic template-literal imports are not instrumented by V8 */ (async ()=>{
|
|
15
|
+
try {
|
|
16
|
+
const mod = await import(`./data/icon-${icon}.js`);
|
|
17
|
+
if (mod && mod.default) {
|
|
18
|
+
setIconComponent(()=>mod.default);
|
|
19
|
+
}
|
|
20
|
+
} catch {
|
|
21
|
+
// Icon not found
|
|
22
|
+
}
|
|
23
|
+
})();
|
|
24
|
+
/* v8 ignore stop */ }, [
|
|
25
|
+
icon
|
|
26
|
+
]);
|
|
27
|
+
if (!IconComponent) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return /*#__PURE__*/ jsx(IconComponent, {
|
|
31
|
+
"data-slot": "icon",
|
|
32
|
+
...rest
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { IconRenderer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-icon-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,8 +12,16 @@
|
|
|
12
12
|
"url": "git@github.com:aversini/ui-components.git"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
|
-
"
|
|
16
|
-
|
|
15
|
+
"exports": {
|
|
16
|
+
"./icon-picker": {
|
|
17
|
+
"types": "./dist/components/IconPicker/IconPicker.d.ts",
|
|
18
|
+
"import": "./dist/components/IconPicker/IconPicker.js"
|
|
19
|
+
},
|
|
20
|
+
"./icon-renderer": {
|
|
21
|
+
"types": "./dist/components/IconPicker/IconRenderer.d.ts",
|
|
22
|
+
"import": "./dist/components/IconPicker/IconRenderer.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
17
25
|
"files": [
|
|
18
26
|
"dist",
|
|
19
27
|
"README.md"
|
|
@@ -23,7 +31,7 @@
|
|
|
23
31
|
"build:js": "rslib build",
|
|
24
32
|
"build:types": "echo 'Types now built with rslib'",
|
|
25
33
|
"build": "npm-run-all --serial clean build:check build:js build:data",
|
|
26
|
-
"build:data": "cp -r src/components/IconPicker/data dist/data",
|
|
34
|
+
"build:data": "cp -r src/components/IconPicker/data dist/components/IconPicker/data",
|
|
27
35
|
"build:list": "node scripts/generate-icon-data.js",
|
|
28
36
|
"clean": "rimraf dist tmp coverage",
|
|
29
37
|
"dev:js": "rslib build --watch",
|
|
@@ -52,5 +60,5 @@
|
|
|
52
60
|
"sideEffects": [
|
|
53
61
|
"**/*.css"
|
|
54
62
|
],
|
|
55
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "7f6eab72a0bd22defe4bb042cc240d60cfcdf98c"
|
|
56
64
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|