lucide-uniwind 1.55.0-patch.1 → 1.55.0-patch.2

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.
@@ -17,11 +17,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
17
17
  * Uses auto mode for general style mapping (colors, etc.) and additionally extracts width/height
18
18
  * as props so that react-native-svg correctly sizes the SVG viewport.
19
19
  */
20
+ /** A width, height or size utility, possibly behind variants (`md:w-6`). */
21
+ var SIZE_CLASS = /(?:^|\s)(?:[\w-]+:)*(?:w|h|size)-/;
20
22
  function iconWithClassName(icon) {
21
23
  var Wrapped = (0, _uniwind.withUniwind)(icon);
22
24
  return function WrappedIcon(props) {
23
25
  var _props$className;
24
- var styles = (0, _uniwind.useResolveClassNames)((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '');
26
+ // withUniwind resolves the className for every other style; this second
27
+ // lookup only reads a size, so it is skipped when there is none.
28
+ var className = (_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '';
29
+ var styles = (0, _uniwind.useResolveClassNames)(SIZE_CLASS.test(className) ? className : '');
25
30
  var extraProps = {};
26
31
  if (styles.width !== undefined) extraProps.width = styles.width;
27
32
  if (styles.height !== undefined) extraProps.height = styles.height;
@@ -11,11 +11,16 @@ import { withUniwind, useResolveClassNames } from 'uniwind';
11
11
  * Uses auto mode for general style mapping (colors, etc.) and additionally extracts width/height
12
12
  * as props so that react-native-svg correctly sizes the SVG viewport.
13
13
  */
14
+ /** A width, height or size utility, possibly behind variants (`md:w-6`). */
15
+ var SIZE_CLASS = /(?:^|\s)(?:[\w-]+:)*(?:w|h|size)-/;
14
16
  export default function iconWithClassName(icon) {
15
17
  var Wrapped = withUniwind(icon);
16
18
  return function WrappedIcon(props) {
17
19
  var _props$className;
18
- var styles = useResolveClassNames((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '');
20
+ // withUniwind resolves the className for every other style; this second
21
+ // lookup only reads a size, so it is skipped when there is none.
22
+ var className = (_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '';
23
+ var styles = useResolveClassNames(SIZE_CLASS.test(className) ? className : '');
19
24
  var extraProps = {};
20
25
  if (styles.width !== undefined) extraProps.width = styles.width;
21
26
  if (styles.height !== undefined) extraProps.height = styles.height;
@@ -3,9 +3,4 @@ import type { LucideProps } from 'lucide-react-native';
3
3
  export type LucidePropsWithClassName = LucideProps & {
4
4
  className?: string;
5
5
  };
6
- /**
7
- * Helper function that wraps a LucideIcon with `withUniwind` to allow for styling with the `className` prop.
8
- * Uses auto mode for general style mapping (colors, etc.) and additionally extracts width/height
9
- * as props so that react-native-svg correctly sizes the SVG viewport.
10
- */
11
6
  export default function iconWithClassName(icon: (props: LucideProps) => ReactNode): (props: LucidePropsWithClassName) => ReactNode;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lucide-uniwind",
3
3
  "description": "Lucide icons for React Native, with a ClassName prop for Uniwind",
4
- "version": "1.55.0-patch.1",
4
+ "version": "1.55.0-patch.2",
5
5
  "packageManager": "yarn@4.5.2",
6
6
  "sideEffects": false,
7
7
  "author": "Alexander Nicholson & Jonas Derissen",