@nice2dev/icons 1.3.4 → 1.3.5

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +31 -0
  3. package/dist/cjs/NiceIconStacker.js +120 -0
  4. package/dist/cjs/client.js +3 -0
  5. package/dist/cjs/createIcon.js +21 -3
  6. package/dist/cjs/icons/actions.js +25 -4
  7. package/dist/cjs/icons/ai.js +3 -0
  8. package/dist/cjs/icons/files.js +24 -7
  9. package/dist/cjs/icons/index.js +2 -2
  10. package/dist/cjs/icons/shapes.js +2 -10
  11. package/dist/cjs/icons/sustainability.js +2 -11
  12. package/dist/cjs/icons/ui.js +6 -0
  13. package/dist/cjs/icons/weather.js +3 -0
  14. package/dist/cjs/index.js +5 -2
  15. package/dist/cjs/nicetodev-icons.css +1 -1
  16. package/dist/cjs/stacking.js +100 -0
  17. package/dist/esm/NiceIconStacker.js +117 -0
  18. package/dist/esm/client.js +1 -0
  19. package/dist/esm/createIcon.js +22 -4
  20. package/dist/esm/icons/actions.js +25 -4
  21. package/dist/esm/icons/ai.js +3 -1
  22. package/dist/esm/icons/files.js +24 -7
  23. package/dist/esm/icons/index.js +4 -4
  24. package/dist/esm/icons/shapes.js +3 -10
  25. package/dist/esm/icons/sustainability.js +2 -10
  26. package/dist/esm/icons/ui.js +6 -0
  27. package/dist/esm/icons/weather.js +3 -1
  28. package/dist/esm/index.js +5 -4
  29. package/dist/esm/nicetodev-icons.css +1 -1
  30. package/dist/esm/stacking.js +92 -0
  31. package/dist/types/NiceIconStacker.d.ts +50 -0
  32. package/dist/types/client.d.ts +2 -0
  33. package/dist/types/createIcon.d.ts +5 -0
  34. package/dist/types/icons/ai.d.ts +2 -0
  35. package/dist/types/icons/index.d.ts +4 -4
  36. package/dist/types/icons/shapes.d.ts +0 -1
  37. package/dist/types/icons/sustainability.d.ts +0 -1
  38. package/dist/types/icons/weather.d.ts +2 -0
  39. package/dist/types/index.d.ts +3 -1
  40. package/dist/types/stacking.d.ts +41 -0
  41. package/dist/types/types.d.ts +23 -0
  42. package/package.json +2 -2
@@ -0,0 +1,50 @@
1
+ import React, { type ComponentType } from 'react';
2
+ import type { IconStackAlign, IconVariant, NtdIconProps } from './types';
3
+ import './NiceIconStacker.css';
4
+ /**
5
+ * One icon of a stack (1.3.5). The first layer is the base — the outermost icon; every other layer
6
+ * is stacked in it (`<Base><Layer stackAlign …>text</Layer></Base>`).
7
+ */
8
+ export interface NiceIconStackLayer {
9
+ /** Stable id of the layer in the list. */
10
+ id: string;
11
+ /** Icon export name, e.g. `'NtdStar'`. */
12
+ icon: string;
13
+ /** Variant; a layer drawn like the base leaves it unset and follows the base. */
14
+ variant?: IconVariant;
15
+ /** Where the layer sits in the base (layers only). Default `'center'`. */
16
+ align?: IconStackAlign;
17
+ /** Share of the base (layers only). Default by `align`: 0.6 centred, 0.5 elsewhere. */
18
+ size?: number;
19
+ /** Text centred on the layer's icon. */
20
+ text?: string;
21
+ }
22
+ export interface NiceIconStackerProps {
23
+ /** Resolves an icon name to its component — a map of exports or a function. */
24
+ icons: Record<string, ComponentType<NtdIconProps>> | ((name: string) => ComponentType<NtdIconProps> | undefined);
25
+ /** The stack (controlled). */
26
+ layers?: NiceIconStackLayer[];
27
+ /** The initial stack (uncontrolled). */
28
+ defaultLayers?: NiceIconStackLayer[];
29
+ /** Fired with the new stack after every change. */
30
+ onLayersChange?: (layers: NiceIconStackLayer[]) => void;
31
+ /** The icon the "add" button puts on the stack — e.g. the one open in an icon browser. */
32
+ current?: {
33
+ icon: string;
34
+ variant?: IconVariant;
35
+ };
36
+ /** Props for the preview of the stack: colours, stroke width, the base's variant. */
37
+ previewProps?: Partial<NtdIconProps>;
38
+ className?: string;
39
+ }
40
+ /** The stack as JSX, the base wrapping its layers. */
41
+ export declare function niceIconStackCode(layers: readonly NiceIconStackLayer[]): string;
42
+ /**
43
+ * NiceIconStacker (1.3.5) — builds an icon stack: the base icon and the icons stacked in it, each
44
+ * with its position, size and text, shown live at three sizes and as the JSX that draws it. Icons
45
+ * come in through `current` (the "add" button) and leave one by one or all at once.
46
+ */
47
+ export declare function NiceIconStacker({ icons, layers: layersProp, defaultLayers, onLayersChange, current, previewProps, className, }: NiceIconStackerProps): React.ReactElement;
48
+ export declare namespace NiceIconStacker {
49
+ var displayName: string;
50
+ }
@@ -19,6 +19,8 @@ export { AnimationController, InteractiveIcon, useAnimationSequence, createAnima
19
19
  export type { AnimationStep, AnimationSequenceConfig, AnimationPlaybackState, AnimationTrigger, InteractiveAnimationConfig, AnimationControllerHandle, AnimationControllerProps, InteractiveIconProps, } from './animationControls';
20
20
  export { NiceIconPicker } from './NiceIconPicker';
21
21
  export type { NiceIconPickerProps, NiceIconPickerHandle, IconPickerEntry } from './NiceIconPicker';
22
+ export { NiceIconStacker, niceIconStackCode } from './NiceIconStacker';
23
+ export type { NiceIconStackerProps, NiceIconStackLayer } from './NiceIconStacker';
22
24
  export { NtdIconMorph, NtdPathMorph, NtdMorphPair, useMorphState } from './NtdIconMorph';
23
25
  export type { NtdIconMorphProps, NtdPathMorphProps, NtdMorphPairProps, MorphTrigger, } from './NtdIconMorph';
24
26
  export { NtdBadge, NtdStatusDot, NtdIconOverlay, NtdIconStack } from './NtdIconBadge';
@@ -68,5 +68,10 @@ export interface CreateIconOptions {
68
68
  /** Vivid variant — colorful multi-fill using primaryColor & secondaryColor as dominant hues. Falls back to solid if not defined. */
69
69
  vivid?: IconPathRenderer;
70
70
  };
71
+ /**
72
+ * The icon's visual centre, where text children are centred (1.3.5). Default `[12, 12]`; set it
73
+ * for a shape whose middle lies elsewhere (a star, a heart, a triangle).
74
+ */
75
+ textCenter?: readonly [number, number];
71
76
  }
72
77
  export declare function createIcon(options: CreateIconOptions): import("react").ForwardRefExoticComponent<NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
@@ -22,6 +22,8 @@ export declare const NtdModel: import("react").ForwardRefExoticComponent<import(
22
22
  export declare const NtdTraining: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
23
23
  export declare const NtdInference: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
24
24
  export declare const NtdSparkle: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
25
+ /** @deprecated The same four-pointed star as {@link NtdSparkle} — use that. */
26
+ export declare const NtdStar4: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
25
27
  export declare const NtdMagicWand: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
26
28
  export declare const NtdPrompt: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
27
29
  export declare const aiIcons: {
@@ -1,14 +1,14 @@
1
1
  export { NtdArrowUp, NtdArrowDown, NtdArrowLeft, NtdArrowRight, NtdChevronUp, NtdChevronDown, NtdChevronLeft, NtdChevronRight, NtdMenu, NtdClose, NtdMoreHorizontal, NtdMoreVertical, NtdExternalLink, NtdRefresh, } from './navigation';
2
2
  export { NtdSearch, NtdEdit, NtdEditDetail, NtdTrash, NtdSave, NtdDownload, NtdUpload, NtdShare, NtdCopy, NtdClipboard, NtdPlus, NtdMinus, NtdCheck, NtdFilter, NtdSort, NtdPrint, NtdZoomIn, NtdZoomOut, NtdUndo, NtdRedo, NtdReply, NtdLink, NtdSettings, NtdLogIn, NtdLogOut, NtdLock, NtdUnlock, NtdGroup, NtdUngroup, } from './actions';
3
3
  export { NtdHome, NtdUser, NtdAdmin, NtdUsers, NtdHeart, NtdStar, NtdBell, NtdEye, NtdEyeOff, NtdInfo, NtdWarning, NtdError, NtdSuccess, NtdHelp, NtdClock, NtdHourglass, NtdCalendar, NtdTag, NtdBackspace, NtdBookmark, NtdFlag, NtdThumbUp, NtdThumbDown, NtdShield, NtdGlobe, NtdMap, NtdPin, NtdSun, NtdMoon, NtdCursor, NtdWireframe, } from './ui';
4
- export { NtdRecycle, NtdCompost, NtdTrashSort, NtdSolarPanel, NtdWindTurbine, NtdEvCharger, NtdHydropower, NtdCarbonFootprint, NtdCo2, NtdNetZero, NtdEcoFriendly, NtdOrganic, NtdBiodegradable, NtdPlantTree, NtdWildlife, sustainabilityIcons, } from './sustainability';
4
+ export { NtdRecycle, NtdCompost, NtdTrashSort, NtdSolarPanel, NtdWindTurbine, NtdEvCharger, NtdCarbonFootprint, NtdCo2, NtdNetZero, NtdEcoFriendly, NtdOrganic, NtdBiodegradable, NtdPlantTree, NtdWildlife, sustainabilityIcons, } from './sustainability';
5
5
  export { NtdAccessibility, NtdWheelchair, NtdBlind, NtdDeaf, NtdSignLanguage, NtdBraille, NtdAudioDescription, NtdClosedCaptions, NtdDyslexia, NtdEasyRead, NtdScreenReader, NtdHearingAid, NtdAssistiveTech, accessibilityIcons, } from './accessibility';
6
6
  export { NtdContract, NtdLegalDocument, NtdTermsOfService, NtdPrivacyPolicy, NtdGdpr, NtdCcpa, NtdCookieConsent, NtdCopyright, NtdTrademark, NtdPatent, NtdCompliance, NtdCertified, NtdAudit, legalIcons, } from './legal';
7
7
  export { NtdPlay, NtdPause, NtdStop, NtdSkipForward, NtdSkipBack, NtdVolume, NtdVolumeMute, NtdImage, NtdCamera, NtdVideo, NtdMicrophone, NtdMicrophoneOff, NtdMusic, NtdMail, NtdInbox, NtdPhone, NtdChat, NtdSend, NtdNotification, NtdWifi, NtdBluetooth, NtdPalette, NtdBrush, NtdPenTool, NtdSpline, } from './media';
8
8
  export { NtdFile, NtdFileText, NtdFolder, NtdFolderOpen, NtdArchive, NtdDatabase, NtdCloud, NtdCloudUpload, NtdCloudDownload, NtdTerminal, NtdCode, NtdGit, NtdPackage, NtdLayers, NtdGrid, NtdList, NtdTable, NtdSmartphone, NtdMonitor, NtdCpu, NtdKey, NtdAward, NtdCoffee, NtdCart, NtdShoppingCart, NtdCreditCard, NtdPieChart, NtdBarChart, NtdActivity, NtdTarget, NtdTruck, } from './files';
9
9
  export { NtdDumpsterFire, NtdRocket, NtdGamepadOldschool, NtdPuzzle, NtdPartyPopper, NtdTrophy, NtdCrown, NtdDice, NtdSmile, NtdSmiley, NtdSad, NtdSkull, NtdGhost, NtdLightning, NtdZap, } from './fun';
10
- export { NtdSunrise, NtdSunset, NtdRain, NtdSnow, NtdThunderstorm, NtdWind, NtdDroplet, NtdThermometer, NtdUmbrella, NtdLeaf, NtdFlower, NtdTree, NtdMountain, NtdWave, NtdFire, NtdSnowflake, NtdCompass, NtdAnchor, NtdFeather, NtdBug, } from './weather';
11
- export { NtdArrowUpCircle, NtdArrowDownCircle, NtdArrowLeftCircle, NtdArrowRightCircle, NtdSquare, NtdCircle, NtdTriangle, NtdHexagon, NtdOctagon, NtdDiamond, NtdPentagon, NtdCross, NtdStar4, NtdCornerUpLeft, NtdCornerUpRight, NtdCornerDownLeft, NtdCornerDownRight, NtdMaximize, NtdMinimize, NtdMove, NtdRepeat, NtdShuffle, NtdPoint, NtdSegment, NtdPerpendicular, NtdParallel, NtdMidpoint, NtdAngleBisector, } from './shapes';
10
+ export { NtdSunrise, NtdSunset, NtdRain, NtdSnow, NtdThunderstorm, NtdWind, NtdDroplet, NtdHydropower, NtdThermometer, NtdUmbrella, NtdLeaf, NtdFlower, NtdTree, NtdMountain, NtdWave, NtdFire, NtdSnowflake, NtdCompass, NtdAnchor, NtdFeather, NtdBug, } from './weather';
11
+ export { NtdArrowUpCircle, NtdArrowDownCircle, NtdArrowLeftCircle, NtdArrowRightCircle, NtdSquare, NtdCircle, NtdTriangle, NtdHexagon, NtdOctagon, NtdDiamond, NtdPentagon, NtdCross, NtdCornerUpLeft, NtdCornerUpRight, NtdCornerDownLeft, NtdCornerDownRight, NtdMaximize, NtdMinimize, NtdMove, NtdRepeat, NtdShuffle, NtdPoint, NtdSegment, NtdPerpendicular, NtdParallel, NtdMidpoint, NtdAngleBisector, } from './shapes';
12
12
  export { NtdBriefcase, NtdDollar, NtdWallet, NtdReceipt, NtdBank, NtdTrendUp, NtdTrendDown, NtdPercent, NtdInvoice, NtdInvoiceDoc, NtdStore, NtdBarcode, NtdCalculator, NtdPresentation, NtdClipboardCheck, NtdPiggyBank, NtdCoins, NtdKanban, NtdMilestone, } from './business';
13
13
  export { NtdAtSign, NtdPhoneOff, NtdBubble, NtdThumbsUp, NtdThumbsDown, NtdBellRing, NtdMegaphone, NtdQrCode, } from './social';
14
14
  export { NtdBrackets, NtdServer, NtdGitBranch, NtdGitCommit, NtdGitMerge, NtdBattery, NtdSlash, NtdHash, NtdBugDev, NtdBlueprint, NtdPrototype, NtdComponent, NtdNodes, NtdFlow, NtdAIBrain, NtdNeural, NtdForge, NtdPipeline, NtdDeploy, NtdGateway, NtdDataMesh, NtdFeatureFlag, NtdViteLogo, NtdBunLogo, NtdDenoLogo, NtdTauriLogo, NtdSvelteLogo, NtdNextJsLogo, NtdAstroLogo, NtdQwikLogo, NtdSolidJsLogo, } from './devtech';
@@ -19,7 +19,7 @@ export { NtdSmartBulb, NtdThermostat, NtdSmartCamera, NtdDoorbell, NtdMotionSens
19
19
  export { NtdApple, NtdPizza, NtdGlass, NtdHeartPulse, NtdPill, NtdSyringe, NtdStethoscope, NtdWeight, NtdBandaid, NtdCake, NtdEgg, NtdHamburger, NtdDna, } from './health';
20
20
  export { NtdNiceToDev, NtdOmniVerk, NtdOmniVerkLogo, NtdOmniVerkSpinner, NtdOmniVerkBadge, NtdOmniVerkWatermark, NtdOmniVerkAnimated, } from './brand';
21
21
  export { NtdGamepad, NtdGamepadController, NtdJoystick, NtdVrHeadset, NtdTrophy as NtdTrophyGaming, NtdLeaderboard, NtdHealthBar, NtdXpBar, NtdStar as NtdStarGaming, NtdTwitch, NtdYoutubeLive, NtdDiscord, NtdDice as NtdDiceGaming, NtdSword, NtdShield as NtdShieldGaming, NtdPotion, gamingIcons, } from './gaming';
22
- export { NtdNeuralNetwork, NtdBrain, NtdDeepLearning, NtdChatbot, NtdRobot, NtdVoiceAssistant as NtdAIAssistant, NtdTensor, NtdGradient, NtdDataset, NtdModel, NtdTraining, NtdInference, NtdSparkle, NtdMagicWand, NtdPrompt, aiIcons, } from './ai';
22
+ export { NtdNeuralNetwork, NtdBrain, NtdDeepLearning, NtdChatbot, NtdRobot, NtdVoiceAssistant as NtdAIAssistant, NtdTensor, NtdGradient, NtdDataset, NtdModel, NtdTraining, NtdInference, NtdSparkle, NtdStar4, NtdMagicWand, NtdPrompt, aiIcons, } from './ai';
23
23
  export { NtdGraduationCap, NtdDiploma, NtdSchool, NtdUniversity, NtdBook, NtdBookBookmark, NtdOpenBook, NtdNotebook, NtdPencil, NtdPen, NtdOnlineCourse, NtdWebinar, NtdCertificate, NtdQuiz, NtdExam, NtdFlashcard, NtdBackpack, NtdCalculator as NtdCalculatorEdu, educationIcons, } from './education';
24
24
  export { NtdBeaker, NtdFlask, NtdTestTube, NtdPetriDish, NtdMicroscope, NtdDna as NtdDnaScience, NtdAtom, NtdMolecule, NtdPeriodictable, NtdMagnet, NtdTelescope, NtdPlanet, NtdRocket as NtdRocketScience, NtdResearch, NtdHypothesis, NtdExperiment, scienceIcons, } from './science';
25
25
  export { NtdHouse as NtdHouseRealEstate, NtdApartment, NtdCondo, NtdVilla, NtdOfficeBuilding, NtdWarehouse, NtdKey as NtdKeyRealEstate, NtdFloorPlan, NtdSquareMeters, NtdBedroom, NtdBathroom, NtdGarage, NtdPool, NtdForSale, NtdForRent, NtdSold, NtdMortgage, realestateIcons, } from './realestate';
@@ -10,7 +10,6 @@ export declare const NtdOctagon: import("react").ForwardRefExoticComponent<impor
10
10
  export declare const NtdDiamond: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
11
11
  export declare const NtdPentagon: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
12
12
  export declare const NtdCross: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
13
- export declare const NtdStar4: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
14
13
  export declare const NtdCornerUpLeft: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
15
14
  export declare const NtdCornerUpRight: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
16
15
  export declare const NtdCornerDownLeft: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
@@ -15,7 +15,6 @@ export declare const NtdTrashSort: import("react").ForwardRefExoticComponent<imp
15
15
  export declare const NtdSolarPanel: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
16
16
  export declare const NtdWindTurbine: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
17
17
  export declare const NtdEvCharger: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
18
- export declare const NtdHydropower: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
19
18
  export declare const NtdCarbonFootprint: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
20
19
  export declare const NtdCo2: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
21
20
  export declare const NtdNetZero: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
@@ -12,6 +12,8 @@ export declare const NtdWind: import("react").ForwardRefExoticComponent<import("
12
12
  * arc was what made it look round and fat.
13
13
  */
14
14
  export declare const NtdDroplet: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
15
+ /** @deprecated The same drop as {@link NtdDroplet} — use that. */
16
+ export declare const NtdHydropower: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
15
17
  export declare const NtdThermometer: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
16
18
  export declare const NtdUmbrella: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
17
19
  export declare const NtdLeaf: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
@@ -47,13 +47,15 @@
47
47
  * @module @nicetodev/icons
48
48
  */
49
49
  import './animations.css';
50
- export type { IconSize, IconVariant, IconAnimation, CutoutShape, GradientPreset, GradientType, GradientAnimation, SemanticColor, NtdIconProps, IconRenderProps, } from './types';
50
+ export type { IconSize, IconVariant, IconAnimation, CutoutShape, GradientPreset, GradientType, GradientAnimation, SemanticColor, NtdIconProps, IconRenderProps, IconStackAlign, } from './types';
51
51
  export { SIZE_MAP, GRADIENT_PRESETS, SEMANTIC_COLOR_DEFAULTS, SEMANTIC_COLOR_VARS } from './types';
52
52
  export { createIcon } from './createIcon';
53
53
  export { generateSmilAnimation, SmilAnimationWrapper as NiceSmilAnimationWrapper, SmilAnimationWrapper, createSmilAnimationDef, isSmilSupported, SMIL_ANIMATION_TYPES, } from './smilAnimations';
54
54
  export type { SmilAnimationType, SmilAnimationConfig, SmilAnimationWrapperProps, } from './smilAnimations';
55
55
  export { NiceIconPicker } from './NiceIconPicker';
56
56
  export type { NiceIconPickerProps, NiceIconPickerHandle, IconPickerEntry } from './NiceIconPicker';
57
+ export { NiceIconStacker, niceIconStackCode } from './NiceIconStacker';
58
+ export type { NiceIconStackerProps, NiceIconStackLayer } from './NiceIconStacker';
57
59
  export { AnimationController as NiceAnimationController, AnimationController, InteractiveIcon as NiceInteractiveIcon, InteractiveIcon, useAnimationSequence, createAnimationSequence, createHoverAnimation, createClickAnimation, createVisibilityAnimation, PRESET_SEQUENCES, PRESET_INTERACTIONS, } from './animationControls';
58
60
  export type { AnimationStep, AnimationSequenceConfig, AnimationPlaybackState, AnimationTrigger, InteractiveAnimationConfig, AnimationControllerHandle, AnimationControllerProps, InteractiveIconProps, } from './animationControls';
59
61
  export { exportIconToFigmaNode, exportIconToSvgString, exportIconToDataUrl, generateFigmaPluginManifest, downloadIconAsSvg, downloadIconAsPng, copyIconToClipboard, batchExportIcons, } from './figmaExport';
@@ -0,0 +1,41 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import type { IconStackAlign, IconVariant, NtdIconProps } from './types';
3
+ /**
4
+ * Icons stacked by nesting (1.3.5): `<NtdSquare><NtdStar stackAlign="center">1</NtdStar></NtdSquare>`.
5
+ * An icon draws its children inside its own `<svg>` — an icon child as a nested `<svg>` placed by
6
+ * its `stackAlign` / `stackSize`, text centred on the icon, anything else as it is. So the stack
7
+ * is one SVG: it exports and copies like any icon.
8
+ */
9
+ /** Set on every component createIcon makes, so a parent icon tells its icon children apart. */
10
+ export declare const NTD_ICON_MARK = "ntdIcon";
11
+ export declare function isNtdIconElement(node: ReactNode): node is ReactElement<NtdIconProps>;
12
+ export declare function isFilledVariant(variant: IconVariant): boolean;
13
+ /** Default share of the parent: centred children larger, edge and corner badges smaller. */
14
+ export declare function defaultStackSize(align: IconStackAlign): number;
15
+ /** Top-left corner of a stacked icon `size` units big inside the 24-unit box. */
16
+ export declare function stackPlacement(align: IconStackAlign, size: number): [number, number];
17
+ /** Font size of text children by length: one character 12, two 10, three 8, more 6.5. */
18
+ export declare function defaultTextSize(length: number): number;
19
+ export interface StackContext {
20
+ variant: IconVariant;
21
+ /** The parent's primary as drawn (a gradient's `url(#…)` included). */
22
+ primaryColor: string;
23
+ accentColor: string;
24
+ /** The cutout variant's tile colour — what fills the cut shape's surroundings. */
25
+ tileColor: string;
26
+ strokeWidth: number;
27
+ /** Where text is centred — the icon's visual centre. */
28
+ textCenter: readonly [number, number];
29
+ textColor?: string;
30
+ textSize?: number;
31
+ }
32
+ /**
33
+ * The children of an icon, drawn into it. Colours given on a child win; otherwise:
34
+ * - content inside — centred or at an edge — is cut out of a filled parent: an icon child takes
35
+ * the parent's accent as its primary (and the parent's primary as its accent, so its own text
36
+ * and details read), text the accent; on `outline` / `wireframe` it stays in the parent's
37
+ * colours; in a cutout it takes the tile's colour, drawn solid in the cut;
38
+ * - a corner badge keeps the parent's colours and sits on a disc of the accent colour a little
39
+ * larger than itself — a gap cut into the parent where they overlap, unseen beyond it.
40
+ */
41
+ export declare function renderStackChildren(children: ReactNode, ctx: StackContext): ReactNode;
@@ -269,9 +269,32 @@ export interface NtdIconProps extends Omit<SVGProps<SVGSVGElement>, 'ref'> {
269
269
  * @example `transformOrigin="top left"`
270
270
  */
271
271
  transformOrigin?: string;
272
+ /**
273
+ * Where this icon sits when it is a child of another icon (1.3.5):
274
+ * `<NtdSquare><NtdStar stackAlign="top-right" /></NtdSquare>`. Default `'center'`. Text children
275
+ * (`<NtdStar>1</NtdStar>`) are centred on the icon.
276
+ */
277
+ stackAlign?: IconStackAlign;
278
+ /**
279
+ * This icon's size as a share of the icon it is stacked in (1.3.5). Default `0.6` centred, `0.5`
280
+ * at an edge or a corner.
281
+ */
282
+ stackSize?: number;
283
+ /**
284
+ * Colour of text children (1.3.5). Default: the accent colour on a filled variant (the text reads
285
+ * as a cut), primary on `outline` / `wireframe`.
286
+ */
287
+ textColor?: string;
288
+ /** Font size of text children in the 24-unit box (1.3.5). Default by length: 12, 10, 8, 6.5. */
289
+ textSize?: number;
272
290
  /** Accessible title for screen readers */
273
291
  title?: string;
274
292
  }
293
+ /**
294
+ * Where a stacked icon sits inside the icon it is a child of — the centre, an edge or a corner
295
+ * (1.3.5).
296
+ */
297
+ export type IconStackAlign = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
275
298
  /**
276
299
  * Props received by icon path renderer functions inside {@link CreateIconOptions.paths}.
277
300
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/icons",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Beautiful, lightweight, multi-color SVG icon library for React with animations",
5
5
  "author": "NiceToDev <contact@nicetodev.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -109,7 +109,7 @@
109
109
  },
110
110
  "devDependencies": {
111
111
  "@chromatic-com/storybook": "^5.3.1",
112
- "@nice2dev/ui-core": "^1.3.4",
112
+ "@nice2dev/ui-core": "^1.3.5",
113
113
  "@rollup/plugin-commonjs": "^29.0.3",
114
114
  "@rollup/plugin-node-resolve": "^16.0.3",
115
115
  "@rollup/plugin-typescript": "^12.3.0",