@charcoal-ui/icons 3.13.1 → 3.14.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/charcoalIconFiles.d.ts +1 -1
- package/dist/charcoalIconFiles.d.ts.map +1 -1
- package/dist/loaders/CharcoalIconFilesLoader.d.ts +1 -1
- package/dist/loaders/CharcoalIconFilesLoader.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/CustomIcon.mdx +38 -0
- package/src/PixivIcon.test.tsx +2 -1
- package/src/README.mdx +92 -0
- package/src/SSR.mdx +63 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import charcoalIconFiles from '@charcoal-ui/icon-files';
|
|
2
2
|
export default charcoalIconFiles;
|
|
3
3
|
export type KnownIconFile = keyof typeof charcoalIconFiles;
|
|
4
|
-
export declare const KNOWN_ICON_FILES: ("16/Add" | "16/Archive" | "16/ArrowDown" | "16/Artwork" | "16/Back" | "16/Book" | "16/BookmarkOff" | "16/BookmarkOn" | "16/Check" | "16/Comment" | "16/Dot" | "16/Error" | "16/Filter" | "16/ImageResponse" | "16/Info" | "16/Like" | "16/Menu" | "16/More" | "16/Nextworks" | "16/Pencil" | "16/Question" | "16/Ranking" | "16/Remove" | "16/Search" | "16/Smile" | "16/Speaker" | "16/View" | "16/Warning" | "24/Add" | "24/AddImage" | "24/AddModel" | "24/AddPeople" | "24/AddRubi" | "24/AddText" | "24/Alart" | "24/Announcement" | "24/Ar" | "24/Archive" | "24/ArrowDown" | "24/ArrowUp" | "24/Binet" | "24/Body" | "24/BodyEdit" | "24/Book" | "24/BringBackward" | "24/BringForward" | "24/Calendar" | "24/Camera" | "24/CameraVideo" | "24/ChangeCharactor" | "24/ChatBot" | "24/Check" | "24/ChromaticAberration" | "24/Click" | "24/Close" | "24/Codes" | "24/Collapse" | "24/CommentFill" | "24/CommentOutline" | "24/Contest" | "24/Contrast" | "24/Description" | "24/DeviceRotation" | "24/Discovery" | "24/Dot" | "24/DotAlt" | "24/Down" | "24/DownloadAlt" | "24/Duplicate" | "24/Dust" | "24/Emoji" | "24/Error" | "24/ErrorOctagon" | "24/Events" | "24/Expand" | "24/FaceEdit" | "24/Fashion" | "24/Feed" | "24/File" | "24/Filter" | "24/Flare" | "24/FormatAlignCenter" | "24/FormatAlignLeft" | "24/FormatAlignRight" | "24/FormatColorFill" | "24/FormatColorFillNoColor" | "24/FormatFontFamily" | "24/FormatFontSize" | "24/FormatLetterSpacing" | "24/FormatLineSpacing" | "24/Fov" | "24/FrameEffect" | "24/FrameSize" | "24/Gift" | "24/Glow" | "24/Groups" | "24/HairEdit" | "24/Hashtag" | "24/Hide" | "24/Home" | "24/Hue" | "24/Idea" | "24/Image" | "24/ImageAlt" | "24/ImageHidden" | "24/ImageReplace" | "24/Images" | "24/ImgContain" | "24/ImgCover" | "24/Index" | "24/Info" | "24/Invalid" | "24/Invoice" | "24/ItemRemove" | "24/LatestWorks" | "24/LikeOff" | "24/LikeOn" | "24/Link" | "24/List" | "24/LockLock" | "24/LockUnlock" | "24/Logout" | "24/Manga" | "24/Menu" | "24/Message" | "24/Microphone" | "24/MobilePhone" | "24/Move1" | "24/Next" | "24/NoImage" | "24/Notification" | "24/NotificationOff" | "24/Novels" | "24/OpenInNew" | "24/Options" | "24/OptionsAlt" | "24/Overlay" | "24/Palette" | "24/Pause" | "24/PauseAlt" | "24/Pencil" | "24/PencilAdd" | "24/PencilDraw" | "24/PencilLive" | "24/PencilText" | "24/Person" | "24/Play" | "24/Pose" | "24/Prev" | "24/Projects" | "24/PullDown" | "24/PullUp" | "24/Question" | "24/QuestionOutline" | "24/Ranking" | "24/ReadHorizontalLeft" | "24/ReadHorizontalRight" | "24/ReadVertical" | "24/Reload" | "24/ReloadLoop" | "24/Reorder" | "24/Roll" | "24/Rotate90DegreesC" | "24/Rotate90DegreesCc" | "24/RotateRight" | "24/Saturation" | "24/Save" | "24/Search" | "24/Send" | "24/Services" | "24/Set" | "24/Settings" | "24/ShareAndroid" | "24/ShareIos" | "24/Shopping" | "24/Show" | "24/ShowOutline" | "24/Shutter" | "24/Star" | "24/Subtract" | "24/Sun" | "24/Temperature" | "24/Text" | "24/Trash" | "24/TrashAlt" | "24/Up" | "24/Upload" | "24/UploadAlt" | "24/Usagi" | "24/UsagiAlt" | "24/Users" | "24/Video" | "24/ViewGrid2Columns" | "24/ViewGrid3Columns" | "24/ViewList" | "24/Warning" | "32/BookmarkOff" | "32/BookmarkOn" | "32/Camera" | "32/Close" | "32/Collapse" | "32/CommentOff" | "32/CommentOn" | "32/Delete" | "32/Dot" | "32/Edit" | "32/Expand" | "32/Gift" | "32/Home" | "32/HorizontalWriting" | "32/Index" | "32/LikeOff" | "32/LikeOn" | "32/LikeOnPrivate" | "32/Message" | "32/Next" | "32/Notification" | "32/NotificationOff" | "32/NovelViewerSettings" | "32/Pan" | "32/Prev" | "32/PullDown" | "32/PullUp" | "32/ReadHorizontalLeft" | "32/ReadHorizontalRight" | "32/ReadVertical" | "32/RollHorizontal" | "32/RollVertical" | "32/SansSerif" | "32/Serif" | "32/ShareAndroid" | "32/ShareIos" | "32/Shopping" | "32/Upload" | "32/User" | "32/VerticalWriting" | "32/ZoomIn" | "Inline/Add" | "Inline/BookmarkOff" | "Inline/BookmarkOn" | "Inline/Breadcrumbs" | "Inline/Check" | "Inline/Comment" | "Inline/ContextMenu" | "Inline/External" | "Inline/Filter" | "Inline/Folder" | "Inline/ImageResponse" | "Inline/Images" | "Inline/Like" | "Inline/LikeOff" | "Inline/List" | "Inline/Location" | "Inline/Lock" | "Inline/More" | "Inline/Nextworks" | "Inline/OpenInNew" | "Inline/Pencil" | "Inline/Remove" | "Inline/Smile" | "Inline/SmileOn" | "Inline/Users" | "Inline/View" | "Inline/ViewOutline")[];
|
|
4
|
+
export declare const KNOWN_ICON_FILES: ("16/Add" | "16/Archive" | "16/ArrowDown" | "16/Artwork" | "16/Back" | "16/Book" | "16/BookmarkOff" | "16/BookmarkOn" | "16/Check" | "16/Comment" | "16/Dot" | "16/Error" | "16/Filter" | "16/ImageResponse" | "16/Info" | "16/Like" | "16/Menu" | "16/More" | "16/Nextworks" | "16/Pencil" | "16/Question" | "16/Ranking" | "16/Remove" | "16/Search" | "16/Smile" | "16/Speaker" | "16/View" | "16/Warning" | "24/Add" | "24/AddImage" | "24/AddModel" | "24/AddPeople" | "24/AddRubi" | "24/AddText" | "24/Alart" | "24/Announcement" | "24/Ar" | "24/Archive" | "24/ArrowDown" | "24/ArrowUp" | "24/Binet" | "24/Body" | "24/BodyEdit" | "24/Book" | "24/BringBackward" | "24/BringForward" | "24/Calendar" | "24/Camera" | "24/CameraVideo" | "24/ChangeCharactor" | "24/ChatBot" | "24/Check" | "24/ChromaticAberration" | "24/Click" | "24/Close" | "24/Codes" | "24/Collapse" | "24/CommentFill" | "24/CommentOutline" | "24/Contest" | "24/Contrast" | "24/Description" | "24/DeviceRotation" | "24/Discovery" | "24/Dot" | "24/DotAlt" | "24/Down" | "24/DownloadAlt" | "24/Duplicate" | "24/Dust" | "24/Emoji" | "24/Error" | "24/ErrorOctagon" | "24/Events" | "24/Expand" | "24/FaceEdit" | "24/Fashion" | "24/Feed" | "24/File" | "24/Filter" | "24/Flare" | "24/FormatAlignCenter" | "24/FormatAlignJustified" | "24/FormatAlignLeft" | "24/FormatAlignRight" | "24/FormatColorFill" | "24/FormatColorFillNoColor" | "24/FormatFontFamily" | "24/FormatFontSize" | "24/FormatLetterSpacing" | "24/FormatLineSpacing" | "24/Fov" | "24/FrameEffect" | "24/FrameSize" | "24/Gift" | "24/Glow" | "24/Groups" | "24/HairEdit" | "24/Hashtag" | "24/Hide" | "24/Home" | "24/Hue" | "24/Idea" | "24/Image" | "24/ImageAlt" | "24/ImageHidden" | "24/ImageReplace" | "24/Images" | "24/ImgContain" | "24/ImgCover" | "24/Index" | "24/Info" | "24/Invalid" | "24/Invoice" | "24/ItemRemove" | "24/LatestWorks" | "24/LikeOff" | "24/LikeOn" | "24/Link" | "24/List" | "24/LockLock" | "24/LockUnlock" | "24/Logout" | "24/Manga" | "24/Menu" | "24/Message" | "24/Microphone" | "24/MobilePhone" | "24/Move1" | "24/Next" | "24/NoImage" | "24/Notification" | "24/NotificationOff" | "24/Novels" | "24/OpenInNew" | "24/Options" | "24/OptionsAlt" | "24/Overlay" | "24/Palette" | "24/Pause" | "24/PauseAlt" | "24/Pencil" | "24/PencilAdd" | "24/PencilDraw" | "24/PencilLive" | "24/PencilText" | "24/Person" | "24/Play" | "24/Pose" | "24/Prev" | "24/Projects" | "24/PullDown" | "24/PullUp" | "24/Question" | "24/QuestionOutline" | "24/Ranking" | "24/ReadHorizontalLeft" | "24/ReadHorizontalRight" | "24/ReadVertical" | "24/Redo" | "24/Reload" | "24/ReloadLoop" | "24/Reorder" | "24/Roll" | "24/Rotate90DegreesC" | "24/Rotate90DegreesCc" | "24/RotateRight" | "24/Saturation" | "24/Save" | "24/Search" | "24/Send" | "24/Services" | "24/Set" | "24/Settings" | "24/ShareAndroid" | "24/ShareIos" | "24/Shopping" | "24/Show" | "24/ShowOutline" | "24/Shutter" | "24/Star" | "24/Subtract" | "24/Sun" | "24/Temperature" | "24/Text" | "24/Trash" | "24/TrashAlt" | "24/Undo" | "24/Up" | "24/Upload" | "24/UploadAlt" | "24/Usagi" | "24/UsagiAlt" | "24/Users" | "24/Video" | "24/ViewGrid2Columns" | "24/ViewGrid3Columns" | "24/ViewList" | "24/Warning" | "32/BookmarkOff" | "32/BookmarkOn" | "32/Camera" | "32/Close" | "32/Collapse" | "32/CommentOff" | "32/CommentOn" | "32/Delete" | "32/Dot" | "32/Edit" | "32/Expand" | "32/Gift" | "32/Home" | "32/HorizontalWriting" | "32/Index" | "32/LikeOff" | "32/LikeOn" | "32/LikeOnPrivate" | "32/Message" | "32/Next" | "32/Notification" | "32/NotificationOff" | "32/NovelViewerSettings" | "32/Pan" | "32/Prev" | "32/PullDown" | "32/PullUp" | "32/ReadHorizontalLeft" | "32/ReadHorizontalRight" | "32/ReadVertical" | "32/RollHorizontal" | "32/RollVertical" | "32/SansSerif" | "32/Serif" | "32/ShareAndroid" | "32/ShareIos" | "32/Shopping" | "32/Upload" | "32/User" | "32/VerticalWriting" | "32/ZoomIn" | "Inline/Add" | "Inline/BookmarkOff" | "Inline/BookmarkOn" | "Inline/Breadcrumbs" | "Inline/Check" | "Inline/Comment" | "Inline/ContextMenu" | "Inline/External" | "Inline/Filter" | "Inline/Folder" | "Inline/ImageResponse" | "Inline/Images" | "Inline/Like" | "Inline/LikeOff" | "Inline/List" | "Inline/Location" | "Inline/Lock" | "Inline/More" | "Inline/Nextworks" | "Inline/OpenInNew" | "Inline/Pencil" | "Inline/Remove" | "Inline/Smile" | "Inline/SmileOn" | "Inline/Users" | "Inline/View" | "Inline/ViewOutline")[];
|
|
5
5
|
export declare function isKnownIconFile(name: string): name is KnownIconFile;
|
|
6
6
|
//# sourceMappingURL=charcoalIconFiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charcoalIconFiles.d.ts","sourceRoot":"","sources":["../src/charcoalIconFiles.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAA;AAEvD,eAAe,iBAAiB,CAAA;AAChC,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAC1D,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"charcoalIconFiles.d.ts","sourceRoot":"","sources":["../src/charcoalIconFiles.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAA;AAEvD,eAAe,iBAAiB,CAAA;AAChC,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAC1D,eAAO,MAAM,gBAAgB,+wIAET,CAAA;AAEpB,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAEnE"}
|
|
@@ -8,7 +8,7 @@ export declare class CharcoalIconFilesLoader implements Loadable {
|
|
|
8
8
|
private _resultSvg;
|
|
9
9
|
private _promise;
|
|
10
10
|
constructor(name: KnownIconFile);
|
|
11
|
-
get importIconFile(): (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>);
|
|
11
|
+
get importIconFile(): (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>);
|
|
12
12
|
fetch(): Promise<string>;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=CharcoalIconFilesLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharcoalIconFilesLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/CharcoalIconFilesLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;GAEG;AACH,qBAAa,uBAAwB,YAAW,QAAQ;IACtD,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,QAAQ,CAAyC;gBAE7C,IAAI,EAAE,aAAa;IAI/B,IAAI,cAAc,
|
|
1
|
+
{"version":3,"file":"CharcoalIconFilesLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/CharcoalIconFilesLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;GAEG;AACH,qBAAa,uBAAwB,YAAW,QAAQ;IACtD,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,QAAQ,CAAyC;gBAE7C,IAAI,EAAE,aAAa;IAI/B,IAAI,cAAc,gyNAEjB;IAEK,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;CAuB/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/icons",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"typescript": "^4.9.5"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@charcoal-ui/icon-files": "^3.
|
|
36
|
+
"@charcoal-ui/icon-files": "^3.14.0",
|
|
37
37
|
"dompurify": "^2.3.6",
|
|
38
38
|
"warning": "^4.0.3"
|
|
39
39
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
51
51
|
"directory": "packages/icons"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "694af78ad36f1caa108a4c3fae4f51ce54b7f78b"
|
|
54
54
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Meta, Story, Canvas, Props } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
<Meta title="icons/Custom" />
|
|
4
|
+
|
|
5
|
+
# 独自のアイコンを登録する
|
|
6
|
+
|
|
7
|
+
`<pixiv-icon>` の `name` に存在しない SVG をアイコンとして登録することができます。
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { PixivIcon } from '@charcoal-ui/icons'
|
|
11
|
+
import NewFeature from './icons/16/NewFeature.svg'
|
|
12
|
+
|
|
13
|
+
PixivIcon.extend({
|
|
14
|
+
'16/NewFeature': require('./icons/16/NewFeature.svg'),
|
|
15
|
+
'24/NewFeature': 'https://example.com/hoge.svg',
|
|
16
|
+
'32/NewFeature': NewFeature,
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
declare module '@charcoal-ui/icons' {
|
|
20
|
+
export interface KnownIconType {
|
|
21
|
+
'16/NewFeature': unknown
|
|
22
|
+
'24/NewFeature': unknown
|
|
23
|
+
'32/NewFeature': unknown
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
その場合も名前の形式は `{size}/{name}` である必要があります。
|
|
29
|
+
TypeScript 環境では、`KnownIconType` という型を拡張することで、カスタムアイコンに対しても補完が効くようになります。
|
|
30
|
+
|
|
31
|
+
## 独自アイコンのためのバンドラ設定
|
|
32
|
+
|
|
33
|
+
`PixivIcon.extend()` に渡すオブジェクトはキーがアイコン名、値が SVG ファイルに対するパス名または URL である必要があります(内部的には、ここで渡した文字列に対して `fetch()` が走ります)。
|
|
34
|
+
|
|
35
|
+
SVG ファイルを `import` して渡す場合、プロジェクトのバンドラが `*.svg` を **パス文字列として**(ファイルの内容の文字列ではなく)ロードする設定になっていることを確認してください。
|
|
36
|
+
|
|
37
|
+
例えば Webpack の場合、当該アイコンファイルに対するルールの type は [`asset/resource`](https://webpack.js.org/guides/asset-modules/) であるべきです。
|
|
38
|
+
[svgr](https://react-svgr.com/) など、SVG ファイルを文字列以外の値にトランスフォームするツールを使っているプロジェクトでは、`PixivIcon.extend()` に渡す用の `*.svg` ファイルをその対象から除いてください。
|
package/src/PixivIcon.test.tsx
CHANGED
package/src/README.mdx
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Meta, Story, Canvas, Props } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
<Meta title="icons/README" />
|
|
4
|
+
|
|
5
|
+
# @charcoal-ui/icons クイックスタート
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@charcoal-ui/icons)
|
|
8
|
+
|
|
9
|
+
## インストール
|
|
10
|
+
|
|
11
|
+
以下のいずれかのパッケージマネージャーを使用してインストールしてください
|
|
12
|
+
|
|
13
|
+
### npm
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @charcoal-ui/icons
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### yarn
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add @charcoal-ui/icons
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### pnpm
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm add @charcoal-ui/icons
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### bun
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
bun add @charcoal-ui/icons
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 概要
|
|
38
|
+
|
|
39
|
+
`@charcoal-ui/icons` は、SVG アイコンを [Web Components](https://developer.mozilla.org/ja/docs/Web/API/Web_components) の [Custom Elements](https://developer.mozilla.org/ja/docs/Web/API/Web_components/Using_custom_elements) として利用できるライブラリです。
|
|
40
|
+
|
|
41
|
+
## 使い方
|
|
42
|
+
|
|
43
|
+
アプリケーションのエントリポイントで `import` します。
|
|
44
|
+
Storybook の場合は `preview.(js|ts)` に書くと良いでしょう。
|
|
45
|
+
|
|
46
|
+
**`@charcoal-ui/react` の [`<Icon>`](/docs/react-icon--docs) コンポーネントを利用している場合、この `import` は内部で自動的に行われます。**
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import '@charcoal-ui/icons'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
これだけで、`<pixiv-icon>` という HTML タグが利用可能になります。
|
|
53
|
+
TypeScript の型定義がグローバルにインストールされるので、JSX で `<pixiv-icon>` を書く際にも型チェックが効きます。
|
|
54
|
+
|
|
55
|
+
## 収録アイコン
|
|
56
|
+
|
|
57
|
+
[PixivIcon](/docs/icons-pixivicon-pixiv-icon--docs) のページを見てください。
|
|
58
|
+
|
|
59
|
+
## 各種バンドラとの組み合わせ
|
|
60
|
+
|
|
61
|
+
`@charcoal-ui/icons@v2.0.0` 以前、このライブラリはアイコンを `.svg` ファイルとしてエクスポートしていました。
|
|
62
|
+
したがって、利用の際は各種バンドラで `.svg` ファイルを `import` できるように設定ファイルを変更する必要がありました。
|
|
63
|
+
|
|
64
|
+
`v2.0.0` 以降、アイコンは JavaScript の文字列としてエクスポートされるようになっています。
|
|
65
|
+
したがって、`@charcoal-ui/icons` に収録されたアイコンを利用するだけなら、バンドラの設定は必要ありません。
|
|
66
|
+
|
|
67
|
+
プロジェクト内の SVG ファイルをアイコンとして登録したい場合は、[必要に応じて .svg を import できるように設定してください](/docs/icons-custom-icon--docs)。
|
|
68
|
+
|
|
69
|
+
## React と組み合わせて使う
|
|
70
|
+
|
|
71
|
+
`@charcoal-ui/react` に `<Icon>` コンポーネントが収録されているので、基本的にはそちらを利用してください。
|
|
72
|
+
|
|
73
|
+
### `@charcoal-ui/react` を使わない場合
|
|
74
|
+
|
|
75
|
+
Custom Element は `className` という props を受け取ることが通常できません。
|
|
76
|
+
|
|
77
|
+
> Custom elements accept `class` rather than `className`, and `for` rather than `htmlFor`.
|
|
78
|
+
> [React 公式ドキュメントより](https://reactjs.org/docs/web-components.html#using-web-components-in-react)
|
|
79
|
+
|
|
80
|
+
もし `styled-components` などを使っていて `className` を渡せないと困るケースでは、ラッパーコンポーネントを作ることができます。
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { Props as IconProps } from '@charcoal-ui/icons'
|
|
84
|
+
|
|
85
|
+
interface Props extends Omit<IconProps, 'class'> {
|
|
86
|
+
className?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const Icon: React.FC<Props> = ({ className, ...props }) => (
|
|
90
|
+
<pixiv-icon class={className} {...props} />
|
|
91
|
+
)
|
|
92
|
+
```
|
package/src/SSR.mdx
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Meta, Story, Canvas, Props } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
<Meta title="icons/SSR Guide" />
|
|
4
|
+
|
|
5
|
+
# サーバーサイドレンダリング
|
|
6
|
+
|
|
7
|
+
`<pixiv-icon>` はサーバーサイドレンダリング時にも利用できます。
|
|
8
|
+
`@charcoal-ui/icons` は、Node.js の環境下で import されたり、API を呼び出されても問題が起きないように設計されています。
|
|
9
|
+
|
|
10
|
+
一方、Custom Element であるということは、**SVG アイコンの読み込みはクライアントサイドで行われます**。
|
|
11
|
+
したがって、大きさが確定せずにレイアウトシフトが起こりうるのは、SSR における注意点の一つと言えます。
|
|
12
|
+
|
|
13
|
+
以下のようなコードをリセット CSS に含めることで、`<pixiv-icon>` によるレイアウトシフトの発生を防ぐことができます。
|
|
14
|
+
(簡単のため、ネスト記法が利用できるケースを意図しています)
|
|
15
|
+
|
|
16
|
+
```css
|
|
17
|
+
pixiv-icon {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
width: calc(var(--icon-size, 1em) * var(--scale, 1));
|
|
20
|
+
height: calc(var(--icon-size, 1em) * var(--scale, 1));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[name~='16/'] {
|
|
24
|
+
--icon-size: 16px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&[name~='24/'] {
|
|
28
|
+
--icon-size: 24px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&[name~='32/'] {
|
|
32
|
+
--icon-size: 32px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[scale='2'] {
|
|
36
|
+
--scale: 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[scale='3'] {
|
|
40
|
+
--scale: 3;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* NOTICE: 現状と attr(... number) ほぼ変とのブラウザも少ない */
|
|
44
|
+
&[unsafe-non-guideline-scale] {
|
|
45
|
+
--scale: attr(unsafe-non-guideline-scale number);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
ただしコメントにもある通り、**現状 `unsafe-non-guideline-scale` をつけた要素は、リセット CSS だけではレイアウトシフトが防げません。**
|
|
50
|
+
CSS の `attr()` が数値の解釈をサポートするまで、個別にインラインスタイルを用いて大きさを確定させるなどのワークアラウンドが必要です。
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<pixiv-icon
|
|
54
|
+
name="24/Add"
|
|
55
|
+
unsafe-non-guideline-scale="0.5"
|
|
56
|
+
style="--scale: 0.5;"
|
|
57
|
+
></pixiv-icon>
|
|
58
|
+
<pixiv-icon
|
|
59
|
+
name="24/Add"
|
|
60
|
+
unsafe-non-guideline-scale="0.5"
|
|
61
|
+
style="width: 12px; height: 12px;"
|
|
62
|
+
></pixiv-icon>
|
|
63
|
+
```
|