@fichap/icons-react 1.0.8 → 1.0.9

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
@@ -28,6 +28,12 @@ export function Demo() {
28
28
  <ArrowLeftIcon size={24} className='text-white' />
29
29
  <Icon name='arrowLeft' size={24} className='text-red-500' />
30
30
  <Icon name='arrowLeft' variant='bold' size={24} />
31
+ <Icon
32
+ name='warning'
33
+ decorative={false}
34
+ aria-label='Advertencia'
35
+ size={20}
36
+ />
31
37
  <p>Regular icons: {iconNamesByVariant.regular.length}</p>
32
38
  </>
33
39
  );
@@ -38,6 +44,9 @@ export function Demo() {
38
44
 
39
45
  - For app consumers, prefer the `Icon` wrapper plus `name` when you want a single stable import.
40
46
  - `variant` is optional and defaults to `regular`.
47
+ - `Icon` applies accessibility defaults automatically:
48
+ - Decorative icon (default): `aria-hidden={true}` + `focusable={false}`.
49
+ - Meaningful icon (`decorative={false}` or when `aria-label`/`aria-labelledby` is present): `role="img"` + `focusable={false}`.
41
50
  - For bold icons, keep the same canonical `name` and pass `variant="bold"`.
42
51
  - Do not append `Bold` to the `name` prop unless that exact canonical icon name exists in the catalog.
43
52
  - Use direct icon imports when you explicitly want component-level imports, custom wrappers, or tighter control over what is imported.
@@ -51,11 +60,35 @@ export function Demo() {
51
60
  - `height?: number | string`
52
61
  - `className?: string`
53
62
  - plus all standard SVG props
63
+ - `Icon` wrapper extras:
64
+ - `decorative?: boolean`
65
+ - `name: IconName`
66
+ - `variant?: 'regular' | 'bold'`
54
67
  - `size` applies to `width` and `height`.
55
68
  - Si pasás `width`/`height`, tienen prioridad sobre `size`.
56
69
  - Hardcoded black colors are normalized to `currentColor` during generation.
57
70
  - Kebab-case SVG attributes are converted to React-compatible props.
58
71
 
72
+ ## Accessibility quick guide
73
+
74
+ Use these patterns with `Icon`:
75
+
76
+ ```tsx
77
+ import { Icon } from "@fichap/icons-react";
78
+
79
+ // Decorative icon (default): hidden from screen readers
80
+ <Icon name='arrowLeft' size={20} />;
81
+
82
+ // Meaningful icon: exposed with accessible name
83
+ <Icon name='dangerTriangle' decorative={false} aria-label='Error' size={20} />;
84
+ ```
85
+
86
+ Notes:
87
+
88
+ - If you use `decorative={false}`, pass an accessible name with `aria-label` or `aria-labelledby`.
89
+ - If you pass `decorative`, that value takes precedence over auto behavior.
90
+ - Dev-only warnings are emitted for conflicting setups (for example, `decorative={false}` without accessible name).
91
+
59
92
  ## Build
60
93
 
61
94
  ```bash
package/dist/index.d.mts CHANGED
@@ -2231,10 +2231,15 @@ type FichapIconProps = IconSvgProps & {
2231
2231
  name: IconName;
2232
2232
  /** Defaults to 'regular' when omitted. */
2233
2233
  variant?: IconVariant;
2234
+ /**
2235
+ * Defaults to true when no accessible name is provided.
2236
+ * Set to false for meaningful icons and pass aria-label or aria-labelledby.
2237
+ */
2238
+ decorative?: boolean;
2234
2239
  };
2235
2240
  /**
2236
2241
  * Resolves a generated icon by name and variant while preserving the shared SVG props contract.
2237
2242
  */
2238
- declare function Icon({ name, variant, ...props }: FichapIconProps): React.JSX.Element | null;
2243
+ declare function Icon({ name, variant, decorative, ...props }: FichapIconProps): React.JSX.Element | null;
2239
2244
 
2240
2245
  export { AccidentRegular, Activity2Regular, ActivityBold, ActivityRegular, AddUserBold, AddUserRegular, AiBrainIdeaRegular, AiBrainLikeRegular, AlarmSpeakerRegular, AlignLeftRegular, AnthropicRegular, ArrowDown2Bold, ArrowDown2Regular, ArrowDown3Bold, ArrowDown3Regular, ArrowDownBold, ArrowDownCircleBold, ArrowDownCircleRegular, ArrowDownRegular, ArrowDownRightsmRegular, ArrowDownSquareBold, ArrowDownSquareRegular, ArrowLeft22Regular, ArrowLeft2Bold, ArrowLeft2Regular, ArrowLeft3Bold, ArrowLeft3Regular, ArrowLeftBold, ArrowLeftCircleBold, ArrowLeftCircleRegular, ArrowLeftRegular, ArrowLeftSquareBold, ArrowLeftSquareRegular, ArrowRight22Regular, ArrowRight2Bold, ArrowRight2Regular, ArrowRight3Bold, ArrowRight3Regular, ArrowRightBold, ArrowRightCircleBold, ArrowRightCircleRegular, ArrowRightRegular, ArrowRightSmRegular, ArrowRightSquareBold, ArrowRightSquareRegular, ArrowUp2Bold, ArrowUp2Regular, ArrowUp3Bold, ArrowUp3Regular, ArrowUpBold, ArrowUpCircleBold, ArrowUpCircleRegular, ArrowUpRegular, ArrowUpRightsmRegular, ArrowUpSquareBold, ArrowUpSquareRegular, ArrowsDiagonalContractRegular, AttachRegular, Bag2Bold, Bag3Regular, Bag4Regular, BagBold, BagRegular, BankCardInformationRegular, BoardTasksRegular, BoldRegular, BookBold, BookRegular, BookmarkBold, BookmarkRegular, BotRegular, BuildingOffice2Regular, BuildingOffice3Regular, BuildingOfficeRegular, BuildingRegular, BulletedListRegular, BuyBold, BuyRegular, Calendar2Bold, Calendar2Regular, CalendarAddRegular, CalendarArrowRightRegular, CalendarBold, CalendarCheckBold, CalendarCheckRegular, CalendarDashRegular, CalendarDone2Regular, CalendarDoneRegular, CalendarEditBold, CalendarEditRegular, CalendarForwardBold, CalendarHourglassRegular, CalendarPinRegular, CalendarRegular, CalendarSettingsRegular, CalendarTickRegular, CalendarTimeBold, CalendarTimeBoldRegular, CalendarTimeRegular, CalendarUsersRegular, CallBold, CallMissedBold, CallMissedRegular, CallRegular, CallSilentBold, CallSilentRegular, CallingBold, CallingRegular, CameraAutoRegular, CameraBold, CameraPlusRegular, CameraRegular, CaptchaDiamondStarBold, CaptchaQuestionMarkSquareBold, CarCrashRegular, CatSquareRegular, CategoriesRegular, CategoryBold, CategoryRegular, CenterLayoutRegular, Chart3BarRefreshRegular, Chart3BarTimeRegular, ChartAnalysishRegular, ChartBold, ChartInformationRegular, ChartRegular, ChatBold, ChatQuoteBold, ChatQuoteRegular, ChatRegular, CheckCircleBold, CheckCircleRegular, CheckmarkRegular, ChevronExpandVericalRegular, CircleGridInterfaceRegular, CircleMessage2TextRegular, CircleMessage2UpRegular, ClockAddPlusBold, ClockAddPlusRegular, ClockCloseRegular, ClockFireRegular, ClockOffSleepBold, CloseRegular, CloseSquare2Regular, CloseSquareBold, CloseSquareRegular, CloudRemoveBold, CloudUploadRegular, Code2Regular, CodeBold, CodeRegular, ColorPaletteBold, CommentRegular, CommentsRegular, CopyLineEditRegular, CounterClockwiseUndoBold, CreativeQuoteOpenSquareRegular, CrecimientoRegular, DangerBold, DangerCircleRegular, DangerTriangleRegular, DarkAndLight2Regular, DarkAndLightRegular, Dashboardcustomize24Dp000000Fill1Wght400Grad0Opsz241Bold, Dcoument3LinesRegular, DcoumentAnalyzeBold, DecrecimientoRegular, DeleteBold, DeleteRegular, DiscountBold, DiscountRegular, DiscoveryBold, DiscoveryRegular, Docuemtn2LineEditRegular, DocumentBadgePlusBold, DocumentBold, DocumentCheckRegular, DocumentErrorRegular, DocumentExploreRegular, DocumentPdfBold, DocumentPdfRegular, DocumentPencilBold, DocumentPin2LinesBold, DocumentPinRegular, DocumentRegular, DocumentRemoveRegular, DocumentStarRegular, DocumentVerifiedRegular, DollarAddRegular, DollarCircle3Bold, DollarDocumentRegular, DoubleHeart3Regular, DownLineRegular, DownSquareLineRegular, DownloadBold, DownloadRegular, DraghorizontalRegular, EarthRegular, EditBold, EditRegular, EditSquareBold, EditSquareRegular, ExpandRegular, Eye2Bold, FaceIdFailRegular, FaceIdSuccesRegular, FacebookBold, type FichapIconProps, Film2Regular, Filter2Bold, Filter3Regular, FilterBold, FilterRegular, FlagBold, FlagRegular, FlashBold, FlashRegular, FlipBackwardRegular, FlipForwardRegular, FlipcalendarBlankRegular, FlipcalendarPercentRegular, FlipcalendarTimeRegular, FlowChartRegular, FolderBold, FolderFileAddPlusRegular, FolderFileBold, FolderFileSearchBold, FolderFileUpRegular, FolderRegular, ForwardClockTimer10Bold, FrameRegular, GalleryViewRegular, GameBold, GameRegular, GgiftRegular, GiftRegular, GiveDocumentRegular, GraphBold, GraphRegular, GridInterface2Regular, GridInterface3Regular, GridInterface4Regular, GridInterfaceAddPlusRegular, GridInterfaceRegular, GridInterfaceTickRegular, HappyDateRegular, HashtagRegular, HealthClipboardRegular, Heart2Bold, HeartBold, HeartPlusBold, HeartRegular, HideBold, HideRegular, Home2Regular, HomeBold, HomeRegular, HomeStarRegular, HospitalRegular, HotDrinkBold, HotDrinkRegular, HourglassRegular, Icon, Icon2UserBold, Icon2UserRegular, Icon3UserBold, Icon3UserRegular, type IconComponent, type IconName, IconSeparateRegular, type IconSvgProps, type IconVariant, IconlyRegularBoldArrowsDiagonalMaximizeRegular, IconlyRegularBoldBoardPinRegular, IconlyRegularBoldCharityCoinsRegular, IconlyRegularBoldChevronExpandVericalRegular, IconlyRegularBoldCircleGridInterface2Regular, IconlyRegularBoldCircleGridInterfaceRegular, IconlyRegularBoldContacts2Regular, IconlyRegularBoldController1Regular, IconlyRegularBoldCupRegular, IconlyRegularBoldDocumentPencilRegular, IconlyRegularBoldExitRegular, IconlyRegularBoldExpandLeftStopRegular, IconlyRegularBoldEye2Regular, IconlyRegularBoldHamburgerMenuRegular, IconlyRegularBoldHashtagSquareRegular, IconlyRegularBoldSalaryRegular, IconlyRegularBoldServersConnect7Regular, IconlyRegularBoldSidebarClose2Regular, IconlyRegularBoldSidebarCloseRegular, IconlyRegularBoldThumbLikeRegular, IconlyRegularBoldUserCheckedRegular, IconlyRegularBoldUserSearchRegular, IconlyRegularBoldVectoruserCheckedRegular, IconlyRegularLighExternalLinkRegular, Image2Bold, Image3Regular, ImageAi2Regular, ImageAiRegular, ImageBold, ImageDownRegular, ImageRecognitionRegular, ImageRegular, ImageUp2Regular, ImageUpRegular, InboxRegular, IndentRegular, InfoCircle2Bold, InfoCircleBold, InfoCircleRegular, InfoSquareBold, InfoSquareRegular, InformationRegular, InstagramBold, InsuranceHand2Regular, InsuranceHandRegular, ItalicRegular, JourneyRegular, LeavesRegular, LessRegular, LineChartUpwardRegular, Link2Regular, LinkRegular, LinkedinBold, ListCheckRegular, Loading2Regular, LoadingCircle3Regular, LoadingRegular, LocationBold, LocationRegular, LockBold, LockRegular, LoginBold, LoginRegular, LoginUserRegular, LogoutBold, LogoutRegular, MacNotebookBold, MacNotebookRegular, MagicWandRegular, MapCloseBold, MapCloseRegular, MapRegular, Marker2Regular, MarkerRegular, MedalRegular, MediumBold, Menu2Regular, MenuCloseLeft2Regular, MenuCloseLeftRegular, MenuRegular, MenuhorizontalRegular, MessageBold, MessageRegular, MessagesBold, MicrosoftExelRegular, MicrosoftWordRegular, Minus1Regular, Minus2Bold, Minus2Regular, Minus2VectorRegular, Minus3Bold, Minus4Regular, Monitor2Regular, MoonBold, MoonvectorRegular, MoreCircleBold, MoreCircleRegular, MoreSquareBold, MoreSquareRegular, MoveRegular, MovieTime2Regular, MovieTimeRegular, NewNotificationRegular, NoteLockRegular, NotificationBold, NotificationRegular, NumberedlistRegular, OfficechairRegular, OpenaiRegular, OrderedListRegular, OutdentRegular, PaintingPaletteRegular, PaperBold, PaperDownloadBold, PaperDownloadRegular, PaperFailBold, PaperFailRegular, PaperNegativeBold, PaperNegativeRegular, PaperPlus2Regular, PaperPlusBold, PaperPlusRegular, PaperRegular, PaperUploadBold, PaperUploadRegular, PasswordBold, PasswordRegular, PauseCircleRegular, Pen2Regular, PenRegular, PhotoRegular, PinMapRegular, PlaneCheckBold, PlaneCheckRegular, PlayBold, PlayRegular, Plus1Regular, Plus2Regular, Plus4Regular, PlusBold, PlusRegular, PowerButtonRegular, PrinterRegular, ProfileBold, ProfileRegular, QuestionMarkCircleRegular, QuestionMarkSquareRegular, QuestionsRegular, Refresh2Regular, RefreshRegular, RemoveCircleBold, RemoveUserBold, RemoveUserRegular, ReverseLeftRegular, ReverseRightRegular, RightUpSquareRegular, RoadmapRegular, RocketRegular, RotationRegular, SadDateRegular, SaveRegular, ScaleRegular, ScanBold, ScanRegular, ScreenSizeRegular, SearchBold, SearchDiscountPercentRegular, SearchRegular, Send2Bold, SendBold, SendRegular, SettingBold, SettingRegular, SettingSquareRegular, SettingToolCircleRegular, Share2Regular, ShareRegular, ShieldDoneBold, ShieldDoneRegular, ShieldFailBold, ShieldFailRegular, ShowBold, ShowRegular, Sign1Regular, Sign2Regular, SlightlyFrowningBold, SmilingAddRegular, SmilingRegular, SortDownRegular, SortRegular, SoundWaveRegular, SpeakerMegaphone5Bold, SpeakerMegaphone5Regular, SpeakerMegaphoneRegular, SquareBold, StarBold, StarRegular, StarRemoveRegular, StarsCircleRegular, StickerAddBold, StopCircleRegular, StopwatchPlayBold, StopwatchSpeedRegular, StopwatchStopBold, StrikethroughRegular, SuccessDocumentsRegular, Sun2Bold, SunBold, SunRegular, SunvectorRegular, SwapBold, SwapHorizontalRegular, SwapRegular, SwitchListRegular, SymbolpngRegular, TableRegular, TagBold, TagRegular, TargetRegular, TextAlignCenterRegular, TextAlignLeftRegular, TextAlignRightRegular, TextColorRegular, TextFieldRegular, ThumbDislikeBold, ThumbDislikeRegular, ThumbLikeBold, TickSquareBold, TickSquareRegular, TicketBold, TicketRegular, TicketStarBold, TicketStarRegular, TiktokBold, TimeCircle2Bold, TimeCircleBold, TimeCircleRegular, TimeSquareBold, TimeSquareRegular, TimerPlusBold, TimerRegular, TiredBold, TiredRegular, ToggleRegular, ToolsRegular, TranslateLanguageBold, TranslateLanguageRegular, TranslateVectorRegular, Triangle2Regular, TwitterBold, TypeRegular, UnderlineRegular, UniversityRegular, UnlockBold, UnlockRegular, UnorderedListRegular, UpLineRegular, UpSquareLineRegular, UpdateRight2Regular, UpdateRightRegular, UploadBold, UploadRegular, UserBadgeBold, UserBadgeRegular, UserBoardRegular, UserCheckedBold, UserContactRegular, UserDeleteBold, UserInformation2Regular, UserInformationRegular, UserLockRegular, UserRegular, UserSearchBold, UsersGroupRegular, UsersRegular, VectorcalendarRegular, VectorhomeRegular, VectorinfoSquareRegular, VectorprofileRegular, VectorsettingRegular, VectorstarRegular, VectorworkRegular, VerticalBarChart2Regular, VideoBold, VideoRegular, Voice2Bold, Voice3Regular, VoiceBold, VoiceRegular, VolumeDownBold, VolumeDownRegular, VolumeOffBold, VolumeOffRegular, VolumeUpBold, VolumeUpRegular, WalletBold, WalletRegular, WebPage2Regular, WebPage4Regular, WebPageEdit2Regular, WebPageEditRegular, Weight1Regular, WhatsappRegular, Wheelchair2Regular, WheelchairRegular, WorkBold, WorldRegular, WrenchRegular, XcomBold, XcomRegular, YoutubeBold, ZoomInRegular, ZoomOutRegular, iconNames, iconNamesByVariant, icons, iconsByVariant };
package/dist/index.d.ts CHANGED
@@ -2231,10 +2231,15 @@ type FichapIconProps = IconSvgProps & {
2231
2231
  name: IconName;
2232
2232
  /** Defaults to 'regular' when omitted. */
2233
2233
  variant?: IconVariant;
2234
+ /**
2235
+ * Defaults to true when no accessible name is provided.
2236
+ * Set to false for meaningful icons and pass aria-label or aria-labelledby.
2237
+ */
2238
+ decorative?: boolean;
2234
2239
  };
2235
2240
  /**
2236
2241
  * Resolves a generated icon by name and variant while preserving the shared SVG props contract.
2237
2242
  */
2238
- declare function Icon({ name, variant, ...props }: FichapIconProps): React.JSX.Element | null;
2243
+ declare function Icon({ name, variant, decorative, ...props }: FichapIconProps): React.JSX.Element | null;
2239
2244
 
2240
2245
  export { AccidentRegular, Activity2Regular, ActivityBold, ActivityRegular, AddUserBold, AddUserRegular, AiBrainIdeaRegular, AiBrainLikeRegular, AlarmSpeakerRegular, AlignLeftRegular, AnthropicRegular, ArrowDown2Bold, ArrowDown2Regular, ArrowDown3Bold, ArrowDown3Regular, ArrowDownBold, ArrowDownCircleBold, ArrowDownCircleRegular, ArrowDownRegular, ArrowDownRightsmRegular, ArrowDownSquareBold, ArrowDownSquareRegular, ArrowLeft22Regular, ArrowLeft2Bold, ArrowLeft2Regular, ArrowLeft3Bold, ArrowLeft3Regular, ArrowLeftBold, ArrowLeftCircleBold, ArrowLeftCircleRegular, ArrowLeftRegular, ArrowLeftSquareBold, ArrowLeftSquareRegular, ArrowRight22Regular, ArrowRight2Bold, ArrowRight2Regular, ArrowRight3Bold, ArrowRight3Regular, ArrowRightBold, ArrowRightCircleBold, ArrowRightCircleRegular, ArrowRightRegular, ArrowRightSmRegular, ArrowRightSquareBold, ArrowRightSquareRegular, ArrowUp2Bold, ArrowUp2Regular, ArrowUp3Bold, ArrowUp3Regular, ArrowUpBold, ArrowUpCircleBold, ArrowUpCircleRegular, ArrowUpRegular, ArrowUpRightsmRegular, ArrowUpSquareBold, ArrowUpSquareRegular, ArrowsDiagonalContractRegular, AttachRegular, Bag2Bold, Bag3Regular, Bag4Regular, BagBold, BagRegular, BankCardInformationRegular, BoardTasksRegular, BoldRegular, BookBold, BookRegular, BookmarkBold, BookmarkRegular, BotRegular, BuildingOffice2Regular, BuildingOffice3Regular, BuildingOfficeRegular, BuildingRegular, BulletedListRegular, BuyBold, BuyRegular, Calendar2Bold, Calendar2Regular, CalendarAddRegular, CalendarArrowRightRegular, CalendarBold, CalendarCheckBold, CalendarCheckRegular, CalendarDashRegular, CalendarDone2Regular, CalendarDoneRegular, CalendarEditBold, CalendarEditRegular, CalendarForwardBold, CalendarHourglassRegular, CalendarPinRegular, CalendarRegular, CalendarSettingsRegular, CalendarTickRegular, CalendarTimeBold, CalendarTimeBoldRegular, CalendarTimeRegular, CalendarUsersRegular, CallBold, CallMissedBold, CallMissedRegular, CallRegular, CallSilentBold, CallSilentRegular, CallingBold, CallingRegular, CameraAutoRegular, CameraBold, CameraPlusRegular, CameraRegular, CaptchaDiamondStarBold, CaptchaQuestionMarkSquareBold, CarCrashRegular, CatSquareRegular, CategoriesRegular, CategoryBold, CategoryRegular, CenterLayoutRegular, Chart3BarRefreshRegular, Chart3BarTimeRegular, ChartAnalysishRegular, ChartBold, ChartInformationRegular, ChartRegular, ChatBold, ChatQuoteBold, ChatQuoteRegular, ChatRegular, CheckCircleBold, CheckCircleRegular, CheckmarkRegular, ChevronExpandVericalRegular, CircleGridInterfaceRegular, CircleMessage2TextRegular, CircleMessage2UpRegular, ClockAddPlusBold, ClockAddPlusRegular, ClockCloseRegular, ClockFireRegular, ClockOffSleepBold, CloseRegular, CloseSquare2Regular, CloseSquareBold, CloseSquareRegular, CloudRemoveBold, CloudUploadRegular, Code2Regular, CodeBold, CodeRegular, ColorPaletteBold, CommentRegular, CommentsRegular, CopyLineEditRegular, CounterClockwiseUndoBold, CreativeQuoteOpenSquareRegular, CrecimientoRegular, DangerBold, DangerCircleRegular, DangerTriangleRegular, DarkAndLight2Regular, DarkAndLightRegular, Dashboardcustomize24Dp000000Fill1Wght400Grad0Opsz241Bold, Dcoument3LinesRegular, DcoumentAnalyzeBold, DecrecimientoRegular, DeleteBold, DeleteRegular, DiscountBold, DiscountRegular, DiscoveryBold, DiscoveryRegular, Docuemtn2LineEditRegular, DocumentBadgePlusBold, DocumentBold, DocumentCheckRegular, DocumentErrorRegular, DocumentExploreRegular, DocumentPdfBold, DocumentPdfRegular, DocumentPencilBold, DocumentPin2LinesBold, DocumentPinRegular, DocumentRegular, DocumentRemoveRegular, DocumentStarRegular, DocumentVerifiedRegular, DollarAddRegular, DollarCircle3Bold, DollarDocumentRegular, DoubleHeart3Regular, DownLineRegular, DownSquareLineRegular, DownloadBold, DownloadRegular, DraghorizontalRegular, EarthRegular, EditBold, EditRegular, EditSquareBold, EditSquareRegular, ExpandRegular, Eye2Bold, FaceIdFailRegular, FaceIdSuccesRegular, FacebookBold, type FichapIconProps, Film2Regular, Filter2Bold, Filter3Regular, FilterBold, FilterRegular, FlagBold, FlagRegular, FlashBold, FlashRegular, FlipBackwardRegular, FlipForwardRegular, FlipcalendarBlankRegular, FlipcalendarPercentRegular, FlipcalendarTimeRegular, FlowChartRegular, FolderBold, FolderFileAddPlusRegular, FolderFileBold, FolderFileSearchBold, FolderFileUpRegular, FolderRegular, ForwardClockTimer10Bold, FrameRegular, GalleryViewRegular, GameBold, GameRegular, GgiftRegular, GiftRegular, GiveDocumentRegular, GraphBold, GraphRegular, GridInterface2Regular, GridInterface3Regular, GridInterface4Regular, GridInterfaceAddPlusRegular, GridInterfaceRegular, GridInterfaceTickRegular, HappyDateRegular, HashtagRegular, HealthClipboardRegular, Heart2Bold, HeartBold, HeartPlusBold, HeartRegular, HideBold, HideRegular, Home2Regular, HomeBold, HomeRegular, HomeStarRegular, HospitalRegular, HotDrinkBold, HotDrinkRegular, HourglassRegular, Icon, Icon2UserBold, Icon2UserRegular, Icon3UserBold, Icon3UserRegular, type IconComponent, type IconName, IconSeparateRegular, type IconSvgProps, type IconVariant, IconlyRegularBoldArrowsDiagonalMaximizeRegular, IconlyRegularBoldBoardPinRegular, IconlyRegularBoldCharityCoinsRegular, IconlyRegularBoldChevronExpandVericalRegular, IconlyRegularBoldCircleGridInterface2Regular, IconlyRegularBoldCircleGridInterfaceRegular, IconlyRegularBoldContacts2Regular, IconlyRegularBoldController1Regular, IconlyRegularBoldCupRegular, IconlyRegularBoldDocumentPencilRegular, IconlyRegularBoldExitRegular, IconlyRegularBoldExpandLeftStopRegular, IconlyRegularBoldEye2Regular, IconlyRegularBoldHamburgerMenuRegular, IconlyRegularBoldHashtagSquareRegular, IconlyRegularBoldSalaryRegular, IconlyRegularBoldServersConnect7Regular, IconlyRegularBoldSidebarClose2Regular, IconlyRegularBoldSidebarCloseRegular, IconlyRegularBoldThumbLikeRegular, IconlyRegularBoldUserCheckedRegular, IconlyRegularBoldUserSearchRegular, IconlyRegularBoldVectoruserCheckedRegular, IconlyRegularLighExternalLinkRegular, Image2Bold, Image3Regular, ImageAi2Regular, ImageAiRegular, ImageBold, ImageDownRegular, ImageRecognitionRegular, ImageRegular, ImageUp2Regular, ImageUpRegular, InboxRegular, IndentRegular, InfoCircle2Bold, InfoCircleBold, InfoCircleRegular, InfoSquareBold, InfoSquareRegular, InformationRegular, InstagramBold, InsuranceHand2Regular, InsuranceHandRegular, ItalicRegular, JourneyRegular, LeavesRegular, LessRegular, LineChartUpwardRegular, Link2Regular, LinkRegular, LinkedinBold, ListCheckRegular, Loading2Regular, LoadingCircle3Regular, LoadingRegular, LocationBold, LocationRegular, LockBold, LockRegular, LoginBold, LoginRegular, LoginUserRegular, LogoutBold, LogoutRegular, MacNotebookBold, MacNotebookRegular, MagicWandRegular, MapCloseBold, MapCloseRegular, MapRegular, Marker2Regular, MarkerRegular, MedalRegular, MediumBold, Menu2Regular, MenuCloseLeft2Regular, MenuCloseLeftRegular, MenuRegular, MenuhorizontalRegular, MessageBold, MessageRegular, MessagesBold, MicrosoftExelRegular, MicrosoftWordRegular, Minus1Regular, Minus2Bold, Minus2Regular, Minus2VectorRegular, Minus3Bold, Minus4Regular, Monitor2Regular, MoonBold, MoonvectorRegular, MoreCircleBold, MoreCircleRegular, MoreSquareBold, MoreSquareRegular, MoveRegular, MovieTime2Regular, MovieTimeRegular, NewNotificationRegular, NoteLockRegular, NotificationBold, NotificationRegular, NumberedlistRegular, OfficechairRegular, OpenaiRegular, OrderedListRegular, OutdentRegular, PaintingPaletteRegular, PaperBold, PaperDownloadBold, PaperDownloadRegular, PaperFailBold, PaperFailRegular, PaperNegativeBold, PaperNegativeRegular, PaperPlus2Regular, PaperPlusBold, PaperPlusRegular, PaperRegular, PaperUploadBold, PaperUploadRegular, PasswordBold, PasswordRegular, PauseCircleRegular, Pen2Regular, PenRegular, PhotoRegular, PinMapRegular, PlaneCheckBold, PlaneCheckRegular, PlayBold, PlayRegular, Plus1Regular, Plus2Regular, Plus4Regular, PlusBold, PlusRegular, PowerButtonRegular, PrinterRegular, ProfileBold, ProfileRegular, QuestionMarkCircleRegular, QuestionMarkSquareRegular, QuestionsRegular, Refresh2Regular, RefreshRegular, RemoveCircleBold, RemoveUserBold, RemoveUserRegular, ReverseLeftRegular, ReverseRightRegular, RightUpSquareRegular, RoadmapRegular, RocketRegular, RotationRegular, SadDateRegular, SaveRegular, ScaleRegular, ScanBold, ScanRegular, ScreenSizeRegular, SearchBold, SearchDiscountPercentRegular, SearchRegular, Send2Bold, SendBold, SendRegular, SettingBold, SettingRegular, SettingSquareRegular, SettingToolCircleRegular, Share2Regular, ShareRegular, ShieldDoneBold, ShieldDoneRegular, ShieldFailBold, ShieldFailRegular, ShowBold, ShowRegular, Sign1Regular, Sign2Regular, SlightlyFrowningBold, SmilingAddRegular, SmilingRegular, SortDownRegular, SortRegular, SoundWaveRegular, SpeakerMegaphone5Bold, SpeakerMegaphone5Regular, SpeakerMegaphoneRegular, SquareBold, StarBold, StarRegular, StarRemoveRegular, StarsCircleRegular, StickerAddBold, StopCircleRegular, StopwatchPlayBold, StopwatchSpeedRegular, StopwatchStopBold, StrikethroughRegular, SuccessDocumentsRegular, Sun2Bold, SunBold, SunRegular, SunvectorRegular, SwapBold, SwapHorizontalRegular, SwapRegular, SwitchListRegular, SymbolpngRegular, TableRegular, TagBold, TagRegular, TargetRegular, TextAlignCenterRegular, TextAlignLeftRegular, TextAlignRightRegular, TextColorRegular, TextFieldRegular, ThumbDislikeBold, ThumbDislikeRegular, ThumbLikeBold, TickSquareBold, TickSquareRegular, TicketBold, TicketRegular, TicketStarBold, TicketStarRegular, TiktokBold, TimeCircle2Bold, TimeCircleBold, TimeCircleRegular, TimeSquareBold, TimeSquareRegular, TimerPlusBold, TimerRegular, TiredBold, TiredRegular, ToggleRegular, ToolsRegular, TranslateLanguageBold, TranslateLanguageRegular, TranslateVectorRegular, Triangle2Regular, TwitterBold, TypeRegular, UnderlineRegular, UniversityRegular, UnlockBold, UnlockRegular, UnorderedListRegular, UpLineRegular, UpSquareLineRegular, UpdateRight2Regular, UpdateRightRegular, UploadBold, UploadRegular, UserBadgeBold, UserBadgeRegular, UserBoardRegular, UserCheckedBold, UserContactRegular, UserDeleteBold, UserInformation2Regular, UserInformationRegular, UserLockRegular, UserRegular, UserSearchBold, UsersGroupRegular, UsersRegular, VectorcalendarRegular, VectorhomeRegular, VectorinfoSquareRegular, VectorprofileRegular, VectorsettingRegular, VectorstarRegular, VectorworkRegular, VerticalBarChart2Regular, VideoBold, VideoRegular, Voice2Bold, Voice3Regular, VoiceBold, VoiceRegular, VolumeDownBold, VolumeDownRegular, VolumeOffBold, VolumeOffRegular, VolumeUpBold, VolumeUpRegular, WalletBold, WalletRegular, WebPage2Regular, WebPage4Regular, WebPageEdit2Regular, WebPageEditRegular, Weight1Regular, WhatsappRegular, Wheelchair2Regular, WheelchairRegular, WorkBold, WorldRegular, WrenchRegular, XcomBold, XcomRegular, YoutubeBold, ZoomInRegular, ZoomOutRegular, iconNames, iconNamesByVariant, icons, iconsByVariant };
package/dist/index.js CHANGED
@@ -15024,6 +15024,57 @@ var icons = __spreadValues(__spreadValues({}, iconsByVariant.regular), iconsByVa
15024
15024
 
15025
15025
  // src/Icon.tsx
15026
15026
  var warnedMissingIcons = /* @__PURE__ */ new Set();
15027
+ var warnedA11y = /* @__PURE__ */ new Set();
15028
+ function isDevEnvironment() {
15029
+ var _a, _b;
15030
+ const nodeEnv = (_b = (_a = globalThis.process) == null ? void 0 : _a.env) == null ? void 0 : _b.NODE_ENV;
15031
+ return nodeEnv !== "production" && typeof console !== "undefined";
15032
+ }
15033
+ function warnA11y(message, cacheKey) {
15034
+ if (!isDevEnvironment() || warnedA11y.has(cacheKey)) {
15035
+ return;
15036
+ }
15037
+ warnedA11y.add(cacheKey);
15038
+ console.warn(message);
15039
+ }
15040
+ function hasAccessibleName(props) {
15041
+ const ariaLabel = props["aria-label"];
15042
+ const ariaLabelledBy = props["aria-labelledby"];
15043
+ return typeof ariaLabel === "string" && ariaLabel.trim().length > 0 || typeof ariaLabelledBy === "string" && ariaLabelledBy.trim().length > 0;
15044
+ }
15045
+ function resolveA11yProps(name, variant, decorative, props) {
15046
+ const hasName = hasAccessibleName(props);
15047
+ const isDecorative = decorative != null ? decorative : !hasName;
15048
+ const resolvedProps = __spreadValues({}, props);
15049
+ if (decorative === false && !hasName) {
15050
+ warnA11y(
15051
+ '[fichap/icons-react] Icon "' + name + '" with variant "' + variant + '" is marked as decorative={false} but has no accessible name. Pass aria-label or aria-labelledby.',
15052
+ variant + ":" + name + ":missing-accessible-name"
15053
+ );
15054
+ }
15055
+ if (decorative === true && hasName) {
15056
+ warnA11y(
15057
+ '[fichap/icons-react] Icon "' + name + '" with variant "' + variant + '" has decorative={true} and an accessible name. The accessible name may be ignored by assistive technologies.',
15058
+ variant + ":" + name + ":decorative-with-name"
15059
+ );
15060
+ }
15061
+ if (isDecorative) {
15062
+ if (resolvedProps["aria-hidden"] === void 0) {
15063
+ resolvedProps["aria-hidden"] = true;
15064
+ }
15065
+ if (resolvedProps.focusable === void 0) {
15066
+ resolvedProps.focusable = false;
15067
+ }
15068
+ return resolvedProps;
15069
+ }
15070
+ if (resolvedProps.role === void 0) {
15071
+ resolvedProps.role = "img";
15072
+ }
15073
+ if (resolvedProps.focusable === void 0) {
15074
+ resolvedProps.focusable = false;
15075
+ }
15076
+ return resolvedProps;
15077
+ }
15027
15078
  function getMissingIconHint(name, variant, regularIcons, boldIcons) {
15028
15079
  if (variant !== "regular" || !name.endsWith("Bold")) {
15029
15080
  return "";
@@ -15035,9 +15086,7 @@ function getMissingIconHint(name, variant, regularIcons, boldIcons) {
15035
15086
  return ' Did you mean <Icon name="' + canonicalName + '" variant="bold" />?';
15036
15087
  }
15037
15088
  function warnMissingIcon(name, variant, regularIcons, boldIcons) {
15038
- var _a, _b;
15039
- const nodeEnv = (_b = (_a = globalThis.process) == null ? void 0 : _a.env) == null ? void 0 : _b.NODE_ENV;
15040
- if (nodeEnv === "production" || typeof console === "undefined") {
15089
+ if (!isDevEnvironment()) {
15041
15090
  return;
15042
15091
  }
15043
15092
  const cacheKey = variant + ":" + name;
@@ -15050,17 +15099,18 @@ function warnMissingIcon(name, variant, regularIcons, boldIcons) {
15050
15099
  );
15051
15100
  }
15052
15101
  function Icon(_a) {
15053
- var _b = _a, { name, variant = "regular" } = _b, props = __objRest(_b, ["name", "variant"]);
15102
+ var _b = _a, { name, variant = "regular", decorative } = _b, props = __objRest(_b, ["name", "variant", "decorative"]);
15054
15103
  var _a2, _b2;
15055
15104
  const selectedIcons = iconsByVariant[variant];
15056
15105
  const regularIcons = iconsByVariant.regular;
15057
15106
  const boldIcons = iconsByVariant.bold;
15107
+ const resolvedA11yProps = resolveA11yProps(name, variant, decorative, props);
15058
15108
  const Component = (_b2 = (_a2 = selectedIcons[name]) != null ? _a2 : regularIcons[name]) != null ? _b2 : boldIcons[name];
15059
15109
  if (!Component) {
15060
15110
  warnMissingIcon(name, variant, regularIcons, boldIcons);
15061
15111
  return null;
15062
15112
  }
15063
- return /* @__PURE__ */ React580.createElement(Component, __spreadValues({}, props));
15113
+ return /* @__PURE__ */ React580.createElement(Component, __spreadValues({}, resolvedA11yProps));
15064
15114
  }
15065
15115
  // Annotate the CommonJS export names for ESM import in node:
15066
15116
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -14408,6 +14408,57 @@ var icons = __spreadValues(__spreadValues({}, iconsByVariant.regular), iconsByVa
14408
14408
 
14409
14409
  // src/Icon.tsx
14410
14410
  var warnedMissingIcons = /* @__PURE__ */ new Set();
14411
+ var warnedA11y = /* @__PURE__ */ new Set();
14412
+ function isDevEnvironment() {
14413
+ var _a, _b;
14414
+ const nodeEnv = (_b = (_a = globalThis.process) == null ? void 0 : _a.env) == null ? void 0 : _b.NODE_ENV;
14415
+ return nodeEnv !== "production" && typeof console !== "undefined";
14416
+ }
14417
+ function warnA11y(message, cacheKey) {
14418
+ if (!isDevEnvironment() || warnedA11y.has(cacheKey)) {
14419
+ return;
14420
+ }
14421
+ warnedA11y.add(cacheKey);
14422
+ console.warn(message);
14423
+ }
14424
+ function hasAccessibleName(props) {
14425
+ const ariaLabel = props["aria-label"];
14426
+ const ariaLabelledBy = props["aria-labelledby"];
14427
+ return typeof ariaLabel === "string" && ariaLabel.trim().length > 0 || typeof ariaLabelledBy === "string" && ariaLabelledBy.trim().length > 0;
14428
+ }
14429
+ function resolveA11yProps(name, variant, decorative, props) {
14430
+ const hasName = hasAccessibleName(props);
14431
+ const isDecorative = decorative != null ? decorative : !hasName;
14432
+ const resolvedProps = __spreadValues({}, props);
14433
+ if (decorative === false && !hasName) {
14434
+ warnA11y(
14435
+ '[fichap/icons-react] Icon "' + name + '" with variant "' + variant + '" is marked as decorative={false} but has no accessible name. Pass aria-label or aria-labelledby.',
14436
+ variant + ":" + name + ":missing-accessible-name"
14437
+ );
14438
+ }
14439
+ if (decorative === true && hasName) {
14440
+ warnA11y(
14441
+ '[fichap/icons-react] Icon "' + name + '" with variant "' + variant + '" has decorative={true} and an accessible name. The accessible name may be ignored by assistive technologies.',
14442
+ variant + ":" + name + ":decorative-with-name"
14443
+ );
14444
+ }
14445
+ if (isDecorative) {
14446
+ if (resolvedProps["aria-hidden"] === void 0) {
14447
+ resolvedProps["aria-hidden"] = true;
14448
+ }
14449
+ if (resolvedProps.focusable === void 0) {
14450
+ resolvedProps.focusable = false;
14451
+ }
14452
+ return resolvedProps;
14453
+ }
14454
+ if (resolvedProps.role === void 0) {
14455
+ resolvedProps.role = "img";
14456
+ }
14457
+ if (resolvedProps.focusable === void 0) {
14458
+ resolvedProps.focusable = false;
14459
+ }
14460
+ return resolvedProps;
14461
+ }
14411
14462
  function getMissingIconHint(name, variant, regularIcons, boldIcons) {
14412
14463
  if (variant !== "regular" || !name.endsWith("Bold")) {
14413
14464
  return "";
@@ -14419,9 +14470,7 @@ function getMissingIconHint(name, variant, regularIcons, boldIcons) {
14419
14470
  return ' Did you mean <Icon name="' + canonicalName + '" variant="bold" />?';
14420
14471
  }
14421
14472
  function warnMissingIcon(name, variant, regularIcons, boldIcons) {
14422
- var _a, _b;
14423
- const nodeEnv = (_b = (_a = globalThis.process) == null ? void 0 : _a.env) == null ? void 0 : _b.NODE_ENV;
14424
- if (nodeEnv === "production" || typeof console === "undefined") {
14473
+ if (!isDevEnvironment()) {
14425
14474
  return;
14426
14475
  }
14427
14476
  const cacheKey = variant + ":" + name;
@@ -14434,17 +14483,18 @@ function warnMissingIcon(name, variant, regularIcons, boldIcons) {
14434
14483
  );
14435
14484
  }
14436
14485
  function Icon(_a) {
14437
- var _b = _a, { name, variant = "regular" } = _b, props = __objRest(_b, ["name", "variant"]);
14486
+ var _b = _a, { name, variant = "regular", decorative } = _b, props = __objRest(_b, ["name", "variant", "decorative"]);
14438
14487
  var _a2, _b2;
14439
14488
  const selectedIcons = iconsByVariant[variant];
14440
14489
  const regularIcons = iconsByVariant.regular;
14441
14490
  const boldIcons = iconsByVariant.bold;
14491
+ const resolvedA11yProps = resolveA11yProps(name, variant, decorative, props);
14442
14492
  const Component = (_b2 = (_a2 = selectedIcons[name]) != null ? _a2 : regularIcons[name]) != null ? _b2 : boldIcons[name];
14443
14493
  if (!Component) {
14444
14494
  warnMissingIcon(name, variant, regularIcons, boldIcons);
14445
14495
  return null;
14446
14496
  }
14447
- return /* @__PURE__ */ React580.createElement(Component, __spreadValues({}, props));
14497
+ return /* @__PURE__ */ React580.createElement(Component, __spreadValues({}, resolvedA11yProps));
14448
14498
  }
14449
14499
  export {
14450
14500
  AccidentRegular_default as AccidentRegular,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fichap/icons-react",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Fichap Iconly-based icon library for React.",
5
5
  "license": "MIT",
6
6
  "keywords": [