@react-spectrum/parcel-transformer-s2-icon 3.0.0-nightly-086ad3115-240912 → 3.0.0-nightly-73414999f-240914

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 (2) hide show
  1. package/IconTransformer.js +14 -11
  2. package/package.json +1 -1
@@ -57,10 +57,10 @@ module.exports = new Transformer({
57
57
  'var(--spectrum-global-color-gray-800, #292929)': `var(--iconPrimary, var(--lightningcss-light, ${tokens['gray-800'].sets.light.value}) var(--lightningcss-dark, ${tokens['gray-800'].sets.dark.value}))`
58
58
  },
59
59
  typescript: true,
60
+ ref: true,
60
61
  plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx']
61
62
  })
62
- ).replace('export default SvgComponent;', '');
63
- // will need to use svgr's templating to add ref support if we want that https://github.com/facebook/create-react-app/pull/5457
63
+ ).replace('export default ForwardRef;', '');
64
64
  let newFile = template(asset, iconName, optimized);
65
65
  return [{
66
66
  type: 'tsx',
@@ -87,6 +87,7 @@ function template(asset, iconName, svg) {
87
87
  import {IconProps, ${context}, IconContextValue} from '${normalizedPath.includes('@react-spectrum/s2') ? '~/src/Icon' : '@react-spectrum/s2'}';
88
88
  import {SVGProps, useRef} from 'react';
89
89
  import {useContextProps} from 'react-aria-components';
90
+ import {SkeletonWrapper, useSkeletonIcon} from '~/src/Skeleton';
90
91
 
91
92
  ${svg.replace('import { SVGProps } from "react";', '')}
92
93
 
@@ -110,15 +111,17 @@ export default function ${iconRename}(props: IconProps) {
110
111
  }
111
112
 
112
113
  let svg = (
113
- <SvgComponent
114
- {...otherProps}
115
- focusable={false}
116
- aria-label={ariaLabel}
117
- aria-hidden={ariaLabel ? (ariaHidden || undefined) : true}
118
- role="img"
119
- data-slot={slot}
120
- className={(UNSAFE_className ?? '') + ' ' + (styles || '')}
121
- style={UNSAFE_style} />
114
+ <SkeletonWrapper>
115
+ <ForwardRef
116
+ {...otherProps}
117
+ focusable={false}
118
+ aria-label={ariaLabel}
119
+ aria-hidden={ariaLabel ? (ariaHidden || undefined) : true}
120
+ role="img"
121
+ data-slot={slot}
122
+ className={(UNSAFE_className ?? '') + ' ' + useSkeletonIcon(styles)}
123
+ style={UNSAFE_style} />
124
+ </SkeletonWrapper>
122
125
  );
123
126
 
124
127
  if (render) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/parcel-transformer-s2-icon",
3
- "version": "3.0.0-nightly-086ad3115-240912",
3
+ "version": "3.0.0-nightly-73414999f-240914",
4
4
  "main": "IconTransformer.js",
5
5
  "engines": {
6
6
  "parcel": "2.0.0-dev.1599"