@primitiv-ui/icons 0.1.28 → 0.1.30
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/README.md +34 -1
- package/package.json +1 -1
- package/src/icons/Bold.tsx +20 -0
- package/src/icons/{Grid.tsx → GridIcon.tsx} +2 -2
- package/src/icons/Italic.tsx +20 -0
- package/src/icons/Pause.tsx +20 -0
- package/src/icons/Play.tsx +20 -0
- package/src/icons/Underline.tsx +20 -0
- package/src/icons/index.ts +6 -1
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ All other [SVG element attributes](https://developer.mozilla.org/en-US/docs/Web/
|
|
|
46
46
|
| [ArrowLeft](src/icons/ArrowLeft.tsx) | `import { ArrowLeft } from "@primitiv-ui/icons"` |
|
|
47
47
|
| [ArrowRight](src/icons/ArrowRight.tsx) | `import { ArrowRight } from "@primitiv-ui/icons"` |
|
|
48
48
|
| [Bell](src/icons/Bell.tsx) | `import { Bell } from "@primitiv-ui/icons"` |
|
|
49
|
+
| [Bold](src/icons/Bold.tsx) | `import { Bold } from "@primitiv-ui/icons"` |
|
|
49
50
|
| [Calendar](src/icons/Calendar.tsx) | `import { Calendar } from "@primitiv-ui/icons"` |
|
|
50
51
|
| [Check](src/icons/Check.tsx) | `import { Check } from "@primitiv-ui/icons"` |
|
|
51
52
|
| [ChevronDown](src/icons/ChevronDown.tsx) | `import { ChevronDown } from "@primitiv-ui/icons"` |
|
|
@@ -64,10 +65,11 @@ All other [SVG element attributes](https://developer.mozilla.org/en-US/docs/Web/
|
|
|
64
65
|
| [File](src/icons/File.tsx) | `import { File } from "@primitiv-ui/icons"` |
|
|
65
66
|
| [Filter](src/icons/Filter.tsx) | `import { Filter } from "@primitiv-ui/icons"` |
|
|
66
67
|
| [Folder](src/icons/Folder.tsx) | `import { Folder } from "@primitiv-ui/icons"` |
|
|
67
|
-
| [Grid](src/icons/
|
|
68
|
+
| [Grid](src/icons/GridIcon.tsx) | `import { GridIcon } from "@primitiv-ui/icons"` — exported as `GridIcon`, see below |
|
|
68
69
|
| [Home](src/icons/Home.tsx) | `import { Home } from "@primitiv-ui/icons"` |
|
|
69
70
|
| [Image](src/icons/Image.tsx) | `import { Image } from "@primitiv-ui/icons"` |
|
|
70
71
|
| [Info](src/icons/Info.tsx) | `import { Info } from "@primitiv-ui/icons"` |
|
|
72
|
+
| [Italic](src/icons/Italic.tsx) | `import { Italic } from "@primitiv-ui/icons"` |
|
|
71
73
|
| [Link](src/icons/Link.tsx) | `import { Link } from "@primitiv-ui/icons"` |
|
|
72
74
|
| [List](src/icons/List.tsx) | `import { List } from "@primitiv-ui/icons"` |
|
|
73
75
|
| [Mail](src/icons/Mail.tsx) | `import { Mail } from "@primitiv-ui/icons"` |
|
|
@@ -76,6 +78,8 @@ All other [SVG element attributes](https://developer.mozilla.org/en-US/docs/Web/
|
|
|
76
78
|
| [Minimize](src/icons/Minimize.tsx) | `import { Minimize } from "@primitiv-ui/icons"` |
|
|
77
79
|
| [Minus](src/icons/Minus.tsx) | `import { Minus } from "@primitiv-ui/icons"` |
|
|
78
80
|
| [Moon](src/icons/Moon.tsx) | `import { Moon } from "@primitiv-ui/icons"` |
|
|
81
|
+
| [Pause](src/icons/Pause.tsx) | `import { Pause } from "@primitiv-ui/icons"` |
|
|
82
|
+
| [Play](src/icons/Play.tsx) | `import { Play } from "@primitiv-ui/icons"` |
|
|
79
83
|
| [Plus](src/icons/Plus.tsx) | `import { Plus } from "@primitiv-ui/icons"` |
|
|
80
84
|
| [Search](src/icons/Search.tsx) | `import { Search } from "@primitiv-ui/icons"` |
|
|
81
85
|
| [Settings](src/icons/Settings.tsx) | `import { Settings } from "@primitiv-ui/icons"` |
|
|
@@ -83,6 +87,7 @@ All other [SVG element attributes](https://developer.mozilla.org/en-US/docs/Web/
|
|
|
83
87
|
| [Sort](src/icons/Sort.tsx) | `import { Sort } from "@primitiv-ui/icons"` |
|
|
84
88
|
| [Success](src/icons/Success.tsx) | `import { Success } from "@primitiv-ui/icons"` |
|
|
85
89
|
| [Sun](src/icons/Sun.tsx) | `import { Sun } from "@primitiv-ui/icons"` |
|
|
90
|
+
| [Underline](src/icons/Underline.tsx) | `import { Underline } from "@primitiv-ui/icons"` |
|
|
86
91
|
| [Upload](src/icons/Upload.tsx) | `import { Upload } from "@primitiv-ui/icons"` |
|
|
87
92
|
| [User](src/icons/User.tsx) | `import { User } from "@primitiv-ui/icons"` |
|
|
88
93
|
| [Warning](src/icons/Warning.tsx) | `import { Warning } from "@primitiv-ui/icons"` |
|
|
@@ -103,6 +108,34 @@ All other [SVG element attributes](https://developer.mozilla.org/en-US/docs/Web/
|
|
|
103
108
|
|
|
104
109
|
The five design sizes (`xs`=16, `sm`=20, `md`=24, `lg`=32, `xl`=48) are all driven by the `size` prop at runtime — only the `md` SVG needs to be exported from Figma.
|
|
105
110
|
|
|
111
|
+
### Exported-name overrides
|
|
112
|
+
|
|
113
|
+
An icon's exported name normally comes straight from its filename, which is what
|
|
114
|
+
keeps the SVG asset, the Figma glyph and the React export in lockstep. One icon
|
|
115
|
+
is an exception, via `NAME_OVERRIDES` in `scripts/generate.ts`:
|
|
116
|
+
|
|
117
|
+
| Glyph / SVG / Figma | Exported as |
|
|
118
|
+
|---|---|
|
|
119
|
+
| `grid` | **`GridIcon`** |
|
|
120
|
+
|
|
121
|
+
`Grid` is also a registry layout component (RFC 0022), so a consumer importing
|
|
122
|
+
both in the same module gets a duplicate-identifier error that fails the build
|
|
123
|
+
outright — which is exactly how this was found. Renaming the asset to
|
|
124
|
+
`grid-icon.svg` would fix it too, but it pushes a redundant `-icon` suffix onto
|
|
125
|
+
the SVG and the Figma glyph, where it reads as a mistake. Overriding only the
|
|
126
|
+
exported symbol leaves both of those named `grid`, so **nothing needs renaming
|
|
127
|
+
in Figma**.
|
|
128
|
+
|
|
129
|
+
Only add an override for a genuine collision, never for taste — every entry is
|
|
130
|
+
a place where the code name and the design name can drift.
|
|
131
|
+
|
|
132
|
+
**`List` is the same shape of collision and is deliberately *not* overridden.**
|
|
133
|
+
There is a registry `list` component too, but nothing imports both in one module
|
|
134
|
+
today, and renaming a published export is a breaking change that should not be
|
|
135
|
+
made speculatively. If you hit it, either alias at the import site
|
|
136
|
+
(`import { List as ListIcon } from "@primitiv-ui/icons"`) or add the override
|
|
137
|
+
here and take the break knowingly.
|
|
138
|
+
|
|
106
139
|
## Architecture
|
|
107
140
|
|
|
108
141
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitiv-ui/icons",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "Fill-based SVG icon library for the Primitiv ecosystem. Icons inherit currentColor, scale via a size prop, accept all native SVG attributes, and tree-shake cleanly.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import type { IconProps } from '../types.ts'
|
|
3
|
+
import { IconBase } from '../IconBase.tsx'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Bold icon.
|
|
7
|
+
*
|
|
8
|
+
* A fill-based SVG that inherits `currentColor` and scales via the
|
|
9
|
+
* `size` prop. Accepts all native `<svg>` attributes (see {@link IconProps}).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Bold size={20} aria-label="Bold" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const Bold = (props: IconProps): ReactElement => (
|
|
17
|
+
<IconBase {...props}>
|
|
18
|
+
<path fillRule="evenodd" d="M12.5 2.875c1.667 0 3.132.49 4.198 1.411 1.077.93 1.677 2.243 1.677 3.714 0 1.399-.544 2.634-1.528 3.531q.57.297 1.047.701A4.89 4.89 0 0 1 19.625 16c0 1.483-.623 2.803-1.746 3.73-1.108.915-2.63 1.395-4.379 1.395H5.375V2.875zm-4.875 16H13.5c1.35 0 2.329-.37 2.946-.88.602-.497.929-1.179.929-1.995 0-.821-.332-1.533-.943-2.057-.622-.531-1.597-.918-2.932-.918H7.625zm0-8.1H12.5c1.25 0 2.163-.344 2.742-.827.562-.468.883-1.123.883-1.948 0-.83-.325-1.516-.898-2.01-.583-.505-1.494-.865-2.727-.865H7.625z" clipRule="evenodd"/>
|
|
19
|
+
</IconBase>
|
|
20
|
+
)
|
|
@@ -10,10 +10,10 @@ import { IconBase } from '../IconBase.tsx'
|
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
13
|
-
* <
|
|
13
|
+
* <GridIcon size={20} aria-label="Grid" />
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
export const
|
|
16
|
+
export const GridIcon = (props: IconProps): ReactElement => (
|
|
17
17
|
<IconBase {...props}>
|
|
18
18
|
<path d="M11.75 2.25v9.5h-9.5v-9.5zm-8 8h6.5v-6.5h-6.5zm18-8v9.5h-9.5v-9.5zm-8 8h6.5v-6.5h-6.5zm-2 2v9.5h-9.5v-9.5zm-8 8h6.5v-6.5h-6.5zm18-8v9.5h-9.5v-9.5zm-8 8h6.5v-6.5h-6.5z"/>
|
|
19
19
|
</IconBase>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import type { IconProps } from '../types.ts'
|
|
3
|
+
import { IconBase } from '../IconBase.tsx'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Italic icon.
|
|
7
|
+
*
|
|
8
|
+
* A fill-based SVG that inherits `currentColor` and scales via the
|
|
9
|
+
* `size` prop. Accepts all native `<svg>` attributes (see {@link IconProps}).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Italic size={20} aria-label="Italic" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const Italic = (props: IconProps): ReactElement => (
|
|
17
|
+
<IconBase {...props}>
|
|
18
|
+
<path d="M18.5 5.75h-3.472l-4.465 12.5H14v1.5H5.5v-1.5h3.472l4.465-12.5H10v-1.5h8.5z"/>
|
|
19
|
+
</IconBase>
|
|
20
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import type { IconProps } from '../types.ts'
|
|
3
|
+
import { IconBase } from '../IconBase.tsx'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Pause icon.
|
|
7
|
+
*
|
|
8
|
+
* A fill-based SVG that inherits `currentColor` and scales via the
|
|
9
|
+
* `size` prop. Accepts all native `<svg>` attributes (see {@link IconProps}).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Pause size={20} aria-label="Pause" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const Pause = (props: IconProps): ReactElement => (
|
|
17
|
+
<IconBase {...props}>
|
|
18
|
+
<path d="M10.25 18.5h-1.5v-13h1.5zM15.25 18.5h-1.5v-13h1.5z"/>
|
|
19
|
+
</IconBase>
|
|
20
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import type { IconProps } from '../types.ts'
|
|
3
|
+
import { IconBase } from '../IconBase.tsx'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Play icon.
|
|
7
|
+
*
|
|
8
|
+
* A fill-based SVG that inherits `currentColor` and scales via the
|
|
9
|
+
* `size` prop. Accepts all native `<svg>` attributes (see {@link IconProps}).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Play size={20} aria-label="Play" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const Play = (props: IconProps): ReactElement => (
|
|
17
|
+
<IconBase {...props}>
|
|
18
|
+
<path fillRule="evenodd" d="M19.978 12 7.92 20.44V3.56zM9.42 17.56 17.362 12 9.42 6.44z" clipRule="evenodd"/>
|
|
19
|
+
</IconBase>
|
|
20
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import type { IconProps } from '../types.ts'
|
|
3
|
+
import { IconBase } from '../IconBase.tsx'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Underline icon.
|
|
7
|
+
*
|
|
8
|
+
* A fill-based SVG that inherits `currentColor` and scales via the
|
|
9
|
+
* `size` prop. Accepts all native `<svg>` attributes (see {@link IconProps}).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Underline size={20} aria-label="Underline" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const Underline = (props: IconProps): ReactElement => (
|
|
17
|
+
<IconBase {...props}>
|
|
18
|
+
<path d="M18.5 21.25h-13v-1.5h13zM7.75 11.5c0 2.615 1.893 4.5 4.25 4.5s4.25-1.885 4.25-4.5v-8h1.5v8c0 3.385-2.507 6-5.75 6s-5.75-2.615-5.75-6v-8h1.5z"/>
|
|
19
|
+
</IconBase>
|
|
20
|
+
)
|
package/src/icons/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ArrowLeft } from './ArrowLeft.tsx'
|
|
2
2
|
export { ArrowRight } from './ArrowRight.tsx'
|
|
3
3
|
export { Bell } from './Bell.tsx'
|
|
4
|
+
export { Bold } from './Bold.tsx'
|
|
4
5
|
export { Calendar } from './Calendar.tsx'
|
|
5
6
|
export { Check } from './Check.tsx'
|
|
6
7
|
export { ChevronDown } from './ChevronDown.tsx'
|
|
@@ -19,10 +20,11 @@ export { Eye } from './Eye.tsx'
|
|
|
19
20
|
export { File } from './File.tsx'
|
|
20
21
|
export { Filter } from './Filter.tsx'
|
|
21
22
|
export { Folder } from './Folder.tsx'
|
|
22
|
-
export {
|
|
23
|
+
export { GridIcon } from './GridIcon.tsx'
|
|
23
24
|
export { Home } from './Home.tsx'
|
|
24
25
|
export { Image } from './Image.tsx'
|
|
25
26
|
export { Info } from './Info.tsx'
|
|
27
|
+
export { Italic } from './Italic.tsx'
|
|
26
28
|
export { Link } from './Link.tsx'
|
|
27
29
|
export { List } from './List.tsx'
|
|
28
30
|
export { Mail } from './Mail.tsx'
|
|
@@ -31,6 +33,8 @@ export { Menu } from './Menu.tsx'
|
|
|
31
33
|
export { Minimize } from './Minimize.tsx'
|
|
32
34
|
export { Minus } from './Minus.tsx'
|
|
33
35
|
export { Moon } from './Moon.tsx'
|
|
36
|
+
export { Pause } from './Pause.tsx'
|
|
37
|
+
export { Play } from './Play.tsx'
|
|
34
38
|
export { Plus } from './Plus.tsx'
|
|
35
39
|
export { Search } from './Search.tsx'
|
|
36
40
|
export { Settings } from './Settings.tsx'
|
|
@@ -38,6 +42,7 @@ export { Share } from './Share.tsx'
|
|
|
38
42
|
export { Sort } from './Sort.tsx'
|
|
39
43
|
export { Success } from './Success.tsx'
|
|
40
44
|
export { Sun } from './Sun.tsx'
|
|
45
|
+
export { Underline } from './Underline.tsx'
|
|
41
46
|
export { Upload } from './Upload.tsx'
|
|
42
47
|
export { User } from './User.tsx'
|
|
43
48
|
export { Warning } from './Warning.tsx'
|