Skip to content

Commit

Permalink
fix: fix build + update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkpatchaa committed Aug 14, 2024
1 parent d3ae8da commit b0f14bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ Icon components accept all props that you can pass to a normal SVG element, incl
- **size?**: `number | string` – Icon height & width. As with standard React elements, this can be a number, or a string with units in `px`, `%`, `em`, `rem`, `pt`, `cm`, `mm`, `in`.
- **weight?**: `"thin" | "light" | "regular" | "bold" | "fill" | "duotone"` – Icon weight/style. Can also be used, for example, to "toggle" an icon's state: a rating component could use Stars with `weight="regular"` to denote an empty star, and `weight="fill"` to denote a filled star.
- **mirrored?**: `boolean` – Flip the icon horizontally. Can be useful in RTL languages where normal icon orientation is not appropriate.
- **title?**: `string` – Accessibility label
- **titleId?**: `string` – Accessibility label ID

### Context

Expand Down
6 changes: 3 additions & 3 deletions generator/generate-svg.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const generateIconWithWeight = (icon, weight) => {
}).then((tsCode) => {
tsCode = tsCode
.replace(/import type .*;\n/g, '')
.replace('const', "import { IconProps } from '../lib'\n\nconst")
.replace('props: SvgProps', 'props: IconProps')
.replace('const', "import type { IconProps } from '../lib'\n\nconst")
.replace('SvgProps', 'IconProps')
.replace(' xmlns="http://www.w3.org/2000/svg"', '')
.replace(
'<Svg ',
Expand Down Expand Up @@ -129,7 +129,7 @@ const generateMainIconFile = (icon) => {
const componentFileName = fileNameMap[component] || component;
const componentName = componentNameMap[component] || component;
const componentCode = `import React, { useContext, useMemo } from 'react'
import { IconProps, IconContext } from '../lib'
import { type IconProps, IconContext } from '../lib'
import bold from '../bold/${componentFileName}'
import duotone from '../duotone/${componentFileName}'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phosphor-react-native",
"version": "2.1.1",
"version": "2.1.2",
"description": "Flexible icons for React Native",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
Expand Down Expand Up @@ -144,4 +144,4 @@
]
]
}
}
}

0 comments on commit b0f14bf

Please sign in to comment.