gospelo-iconcraft-react 0.3.5 → 0.3.7

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/index.d.ts CHANGED
@@ -571,6 +571,13 @@ interface IconCraftViewProps {
571
571
  notchColor?: string;
572
572
  /** Reticle color (default: '#000') */
573
573
  reticleColor?: string;
574
+ /**
575
+ * External CSS rotation preview (degrees).
576
+ * Applied only to the shape+icon layer via CSS transform,
577
+ * keeping dial and reticle layers fixed.
578
+ * Set to null/undefined to disable.
579
+ */
580
+ cssRotation?: number | null;
574
581
  }
575
582
  /** Props passed to custom reticle renderer */
576
583
  interface ReticleProps {
@@ -611,7 +618,7 @@ interface DialLabelProps {
611
618
  * <IconCraftView instance={icon} zIndex={10} />
612
619
  * ```
613
620
  */
614
- declare function IconCraftView({ instance, animation, animationTarget, animateOnHover, zIndex, className, style, onClick, onLoad, onError, showRotationDial, onRotationChange, rotationSnap, renderRing: renderRingProp, renderNotch: renderNotchProp, renderLabel: renderLabelProp, dialPreset, showReticle, renderReticle: renderReticleProp, reticlePreset, dialColor: dialColorProp, notchColor: notchColorProp, reticleColor: reticleColorProp, }: IconCraftViewProps): react_jsx_runtime.JSX.Element | null;
621
+ declare function IconCraftView({ instance, animation, animationTarget, animateOnHover, zIndex, className, style, onClick, onLoad, onError, showRotationDial, onRotationChange, rotationSnap, renderRing: renderRingProp, renderNotch: renderNotchProp, renderLabel: renderLabelProp, dialPreset, showReticle, renderReticle: renderReticleProp, reticlePreset, dialColor: dialColorProp, notchColor: notchColorProp, reticleColor: reticleColorProp, cssRotation, }: IconCraftViewProps): react_jsx_runtime.JSX.Element | null;
615
622
 
616
623
  /**
617
624
  * IconCraftSimple Props
package/dist/index.js CHANGED
@@ -1578,7 +1578,8 @@ function IconCraftView({
1578
1578
  reticlePreset,
1579
1579
  dialColor: dialColorProp,
1580
1580
  notchColor: notchColorProp,
1581
- reticleColor: reticleColorProp
1581
+ reticleColor: reticleColorProp,
1582
+ cssRotation
1582
1583
  }) {
1583
1584
  const resolvedDial = dialPreset ?? (renderRingProp || renderNotchProp || renderLabelProp ? void 0 : dialPresetDotted);
1584
1585
  const renderRing = resolvedDial?.renderRing ?? renderRingProp;
@@ -1952,12 +1953,18 @@ function IconCraftView({
1952
1953
  return null;
1953
1954
  }
1954
1955
  const previewDeg = isRotating ? dialDeg - rotation : 0;
1956
+ const cssRotateDeg = cssRotation != null ? cssRotation - rotation : 0;
1957
+ const shapeTransformDeg = previewDeg || cssRotateDeg;
1955
1958
  if (!showRotationDial && !showReticle) {
1956
1959
  return /* @__PURE__ */ jsx2(
1957
1960
  "div",
1958
1961
  {
1959
1962
  className,
1960
- style: { ...containerStyle, ...cssVars },
1963
+ style: {
1964
+ ...containerStyle,
1965
+ ...cssVars,
1966
+ ...shapeTransformDeg ? { transform: `rotate(${shapeTransformDeg}deg)` } : {}
1967
+ },
1961
1968
  onClick,
1962
1969
  onMouseEnter: hoverAnim ? () => setIsHovering(true) : void 0,
1963
1970
  onMouseLeave: hoverAnim ? () => setIsHovering(false) : void 0,
@@ -2038,7 +2045,7 @@ function IconCraftView({
2038
2045
  position: "relative",
2039
2046
  zIndex: 1,
2040
2047
  ...cssVars,
2041
- ...previewDeg !== 0 ? { transform: `rotate(${previewDeg}deg)` } : {}
2048
+ ...shapeTransformDeg ? { transform: `rotate(${shapeTransformDeg}deg)` } : {}
2042
2049
  },
2043
2050
  dangerouslySetInnerHTML: { __html: sanitizeSvg(animationStyles + processedSvg) }
2044
2051
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gospelo-iconcraft-react",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "IconCraft React components - 3D decorative icon shapes from SVG",
5
5
  "license": "MIT",
6
6
  "author": "gorosun <goro-hayakawa@no-studio.net>",
@@ -32,7 +32,7 @@
32
32
  "react-dom": ">=18.0.0"
33
33
  },
34
34
  "dependencies": {
35
- "gospelo-iconcraft-wasm": "workspace:*",
35
+ "gospelo-iconcraft-wasm": "^0.3.5",
36
36
  "ulid": "^3.0.2"
37
37
  },
38
38
  "devDependencies": {