@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.
- package/IconTransformer.js +14 -11
- package/package.json +1 -1
package/IconTransformer.js
CHANGED
@@ -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
|
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
|
-
<
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
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) {
|