@lansforsakringar/icons 4.11.0 → 4.12.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog icons
2
+
3
+ ## 4.12.0
4
+
5
+ ### Added
6
+
7
+ - person-already-moved 72
8
+
9
+ ## 4.11.0
10
+
11
+ ### Added
12
+
13
+ - evelope-unread-mc 24
14
+ - write-alt (24, 32, 40)
15
+
16
+ ### Updated
17
+
18
+ - evelope (24, 32, 40, 72)
19
+ - padlock 24
20
+ - padlock-open 24
21
+ - pin (24, 32, 40, 72)
22
+ - search (24, 32)
23
+ - user 24
package/README.md CHANGED
@@ -2,87 +2,79 @@
2
2
 
3
3
  Icon library for Länsförsäkringar web and app development.
4
4
 
5
- ## Getting started
5
+ ## Scope of this README
6
6
 
7
- For web development, install via npm.
7
+ This README covers the icons package only (`packages/icons`).
8
8
 
9
- ```
9
+ - icon package install and usage
10
+ - icon export CLI and Node API
11
+ - icon contribution flow
12
+
13
+ For monorepo-level onboarding, use root [README.md](../../README.md).
14
+
15
+ ## Install
16
+
17
+ ```bash
10
18
  npm install @lansforsakringar/icons
11
19
  ```
12
20
 
13
- ## Usage
21
+ ## Package Contents
14
22
 
15
- The library provides a set of SVG icons distributed as individual files, sprites, and JSX + TSX.
23
+ The published package includes:
16
24
 
17
- The disitributed package (npm package) includes the following:
25
+ - Individual SVG files: `{icon-name}[-mc]-{size}.svg`
26
+ - Sprite files by size: `sprite[-mc]-{size}.svg`
27
+ - JSX icon components
28
+ - TSX icon components
29
+ - Format manifests: `manifest.{format}.json`
18
30
 
19
- - Individual svg icons `{icon-name}[-mc]-{size}.svg`
20
- - Set sizes (24, 32, 40, 48, 64, 72, 96) in multi color (mc) and monochrome.
21
- - Misc "special" icons (e.g. arrows, logotypes, etc.) of varying sizes
22
- - Sprites compiled per size `sprite[-mc]-{size}.svg`
23
- - Set sizes (24, 32, 40, 48, 64, 72, 96) and "special" sizes in multi color (mc) and monochrome.
24
- - Individual JSX components
25
- - Individual TSX components
26
- - Manifest files for each format `manifest.{format}.json`
31
+ Standard sizes are available in monochrome and multicolor variants.
27
32
 
28
- The build script can be integrated into your build chain as a CLI command or as Node.js module.
33
+ ## CLI
29
34
 
30
- ### CLI
35
+ Binary name in this package: `lfds-icons-export`.
31
36
 
32
- ```
37
+ ```text
33
38
  Usage
34
- $ lf-icons [options]
39
+ $ lfds-icons-export [options]
35
40
 
36
41
  Options
37
42
  --out, -o Output directory [dist]
38
- --format, f Output format (svg,sprite,jsx,tsx) [svg]
43
+ --format, -f Output format (svg,sprite,jsx,tsx) [svg]
39
44
  --grep, -g Filter icons by name
40
45
  --size, -s Size(s) to export, comma separated [all]
41
46
  --color, -c Include multicolor variants (disable: --no-color) [true]
42
47
  --mono, -m Include monochrome variants (disable: --no-mono) [true]
43
48
  --help Display this message
49
+ ```
50
+
51
+ Example:
44
52
 
45
- Example
46
- $ lf-icons -o dist/icons -f jsx -g bankid
53
+ ```bash
54
+ npx lfds-icons-export -o dist/icons -f jsx -g bankid
47
55
  ```
48
56
 
49
- ### Node.js
57
+ ## Node API
50
58
 
51
59
  ```js
52
60
  import { build } from '@lansforsakringar/icons'
53
61
 
54
- // Build JSX components for all sizes and colors of icons matching "bankid"
55
- await build({
56
- out: 'dist/icons',
57
- format: 'jsx',
58
- grep: 'bankid'
62
+ // Build JSX components for icons matching "bankid"
63
+ await build('dist/icons', {
64
+ formats: ['jsx'],
65
+ grep: 'bankid'
59
66
  })
60
67
  ```
61
68
 
62
- #### Options
63
-
64
- - `out` Output directory, **default: `dist`**
65
- - `format` Output format (svg,sprite,jsx,tsx), **default: `svg`**
66
- - `grep` Filter icons by name
67
- - `size` Size(s) to export, list of numbers or "all", **default: `[all]`**
68
- - `color` Include multicolor variants, **default: `true`**
69
- - `mono` Include monochrome variants, **default: `true`**
70
-
71
- ### SVG usage
72
-
73
- The standalone SVG files can be referenced either as inline img tag or (depending on your frontend tool chain) as an embedded resource.
74
-
75
- #### As inline `img`
69
+ ## Usage
76
70
 
77
- Path should reflect where you store and host the built icons.
71
+ ### SVG file
78
72
 
79
73
  ```html
80
74
  <img src="/icons/wallet-24.svg" class="icon" alt="Wallet" />
81
75
  ```
82
76
 
83
- #### As a JavaScript module
84
-
85
- This method requires that your tool chain supports importing SVG files as modules.
77
+ ### SVG imported as module
86
78
 
87
79
  ```js
88
80
  import wallet24 from '@lansforsakringar/icons/wallet-24.svg'
@@ -93,99 +85,65 @@ img.classList.add('icon')
93
85
  document.body.appendChild(img)
94
86
  ```
95
87
 
96
- #### As CSS background
97
-
98
- Perferrably use CSS post-processing tools to inline the SVG as a data URI.
99
-
100
- ```css
101
- .wallet {
102
- width: 24px;
103
- height: 24px;
104
- background-image: url('./icons/wallet-24.svg');
105
- background-repeat: no-repeat;
106
- background-size: 100%;
107
- }
108
- ```
109
-
110
- ### Sprite usage
111
-
112
- Sprites can either be embedded in the markup or referenced as an external resource.
113
-
114
- #### Referenced as external resource
115
-
116
- Note that the href path should to point to where you host the sprite.
117
-
118
- ```html
119
- <svg class="icon" width="24" height="24">
120
- <use xlink:href="/icons/sprite-24.svg#wallet-24"></use>
121
- </svg>
122
- ```
123
-
124
- #### Referenced as embedded resource
125
-
126
- When embedded, they are to be included in the document _once_ and then referenced with the SVG `use` tag.
88
+ ### Sprite
127
89
 
128
90
  ```html
129
91
  <svg class="icon" width="24" height="24">
130
- <use xlink:href="#wallet-24"></use>
92
+ <use xlink:href="/icons/sprite-24.svg#wallet-24"></use>
131
93
  </svg>
132
-
133
- <!-- Embed the sprite somewhere in the document, preferably last -->
134
- <svg width="0" height="0" style="position:absolute"><symbol>…</symbol></svg>
135
94
  ```
136
95
 
137
- ### JSX/TSX usage
138
-
139
- If you have special requirements for the output component format, e.g. JSX runtime, you can use the CLI or Node.js API to generate icons and override the default settings with a [SVGR configuration file](https://react-svgr.com/docs/configuration-files/).
96
+ ### JSX/TSX component
140
97
 
141
98
  ```jsx
142
99
  import Wallet24 from '@lansforsakringar/icons/Wallet24.jsx'
143
100
 
144
101
  export default function MyComponent() {
145
- return (
146
- <div>
147
- <Wallet24 class="icon" />
148
- </div>
149
- )
102
+ return <Wallet24 className="icon" />
150
103
  }
151
104
  ```
152
105
 
153
- ### Manifest
106
+ ## Manifest
107
+
108
+ A manifest is generated per format (`manifest.{format}.json`) and maps icon IDs to output paths.
154
109
 
155
- A build manifest is generated for each format (`manifest.{format}.json`). The manifest includes a mapping of icon id to the _absolute_ file path on disk.
110
+ Example:
156
111
 
157
112
  ```json
158
113
  {
159
- "wallet-24": "/dist/icons/wallet-24.svg"
114
+ "wallet-24": "/dist/icons/wallet-24.svg"
160
115
  }
161
116
  ```
162
117
 
163
- The sprite manifest includes not only the generated sprite file, but also mapping for each icon in the sprite for use as a `xlink:href`.
118
+ For sprites, icon IDs map to `xlink:href` values:
164
119
 
165
120
  ```json
166
121
  {
167
- "sprite-24": "/dist/icons/sprite-24.svg",
168
- "wallet-24": "/dist/icons/sprite-24.svg#wallet-24"
122
+ "sprite-24": "/dist/icons/sprite-24.svg",
123
+ "wallet-24": "/dist/icons/sprite-24.svg#wallet-24"
169
124
  }
170
125
  ```
171
126
 
172
- ### CSS
173
-
174
- The `.icon` CSS class is part of [LFUI Web Legacy](https://azuredo.lfnet.se/tfs/Lansforsakringar/Code-LFDS/_git/lfui-web-legacy) and helps with sizing and alignment. Colors are inherited from the text color (applied using the CSS color keyword `currentcolor`).
175
-
176
127
  ## Contributing
177
128
 
178
- After cloning the repo, install the dependencies and build our the icon sprites.
179
-
180
- ```
129
+ ```bash
181
130
  npm install
182
131
  npm run build
183
132
  ```
184
133
 
185
- To add an icon, export your icon from Figma. Make sure to use only filled outlines and in color `#005AA0`. The build script will replace that exact HEX with `currentcolor`.
134
+ To add an icon:
135
+
136
+ 1. Export from Figma using filled outlines in color `#005AA0`.
137
+ 2. Place the icon in `src/svg/{size}`.
138
+ 3. Run `npm run build`.
186
139
 
187
- Place the new icon in `src/svg/{size}` and build, `npm run build`.
140
+ The build pipeline replaces `#005AA0` with `currentcolor`.
188
141
 
189
- ## Deploy and release
142
+ ## Release
190
143
 
191
- After adding an icon, run `npm version minor`. A commit will be created that you should push. Then run `npm publish`. That's it.
144
+ After adding icons:
145
+
146
+ ```bash
147
+ npm version minor
148
+ npm publish
149
+ ```
package/bin.js CHANGED
@@ -3,7 +3,7 @@ import meow from 'meow'
3
3
  import { build } from './src/main.js'
4
4
 
5
5
  const cli = meow(
6
- `
6
+ `
7
7
  Usage
8
8
  $ lf-icons [options]
9
9
 
@@ -19,52 +19,52 @@ const cli = meow(
19
19
  Example
20
20
  $ lf-icons -o dist/icons -f svg -g bankid
21
21
  `,
22
- {
23
- importMeta: import.meta,
24
- flags: {
25
- out: {
26
- type: 'string',
27
- shortFlag: 'o',
28
- default: 'dist'
29
- },
30
- format: {
31
- type: 'string',
32
- shortFlag: 'f',
33
- default: 'svg'
34
- },
35
- grep: {
36
- type: 'string',
37
- shortFlag: 'g'
38
- },
39
- size: {
40
- type: 'string',
41
- shortFlag: 's',
42
- default: 'all'
43
- },
44
- color: {
45
- type: 'boolean',
46
- shortFlag: 'c',
47
- default: true
48
- },
49
- mono: {
50
- type: 'boolean',
51
- shortFlag: 'm',
52
- default: true
53
- },
54
- help: {
55
- type: 'boolean'
56
- }
57
- }
58
- }
22
+ {
23
+ importMeta: import.meta,
24
+ flags: {
25
+ out: {
26
+ type: 'string',
27
+ shortFlag: 'o',
28
+ default: 'dist'
29
+ },
30
+ format: {
31
+ type: 'string',
32
+ shortFlag: 'f',
33
+ default: 'svg'
34
+ },
35
+ grep: {
36
+ type: 'string',
37
+ shortFlag: 'g'
38
+ },
39
+ size: {
40
+ type: 'string',
41
+ shortFlag: 's',
42
+ default: 'all'
43
+ },
44
+ color: {
45
+ type: 'boolean',
46
+ shortFlag: 'c',
47
+ default: true
48
+ },
49
+ mono: {
50
+ type: 'boolean',
51
+ shortFlag: 'm',
52
+ default: true
53
+ },
54
+ help: {
55
+ type: 'boolean'
56
+ }
57
+ }
58
+ }
59
59
  )
60
60
 
61
61
  if (cli.flags.help) {
62
- cli.showHelp(0)
62
+ cli.showHelp(0)
63
63
  } else {
64
- const { out, format, size, ...opts } = cli.flags
65
- build(out, {
66
- ...opts,
67
- formats: format?.split(','),
68
- sizes: size?.split(',').map((s) => (isNaN(+s) ? s : +s))
69
- })
64
+ const { out, format, size, ...opts } = cli.flags
65
+ build(out, {
66
+ ...opts,
67
+ formats: format?.split(','),
68
+ sizes: size?.split(',').map((s) => (isNaN(+s) ? s : +s))
69
+ })
70
70
  }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ const PersonAlreadyMoved72 = props => <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 72 72" {...props}><path fill="currentColor" d="M50.116 38.652C57.22 38.652 63 44.45 63 51.576S57.22 64.5 50.116 64.5s-12.884-5.798-12.884-12.924 5.78-12.924 12.884-12.924m0 1.988c-6.011 0-10.902 4.906-10.902 10.936s4.89 10.936 10.902 10.936c6.01 0 10.902-4.907 10.902-10.936 0-6.03-4.891-10.936-10.902-10.936" /><path fill="currentColor" d="M42.187 50.582h15.858v1.988H42.186zM31.173 7.5c4.5 0 8.685 1.956 11.56 5.29l-1.497 1.301a13.25 13.25 0 0 0-10.063-4.603c-7.321 0-13.253 5.904-13.253 13.182s5.932 13.182 13.253 13.182 13.253-5.904 13.253-13.182q0-.86-.11-1.7H34.06c-3.165 0-6.4-2.352-7.985-5.649l1.786-.864c1.274 2.65 3.851 4.524 6.199 4.524h11.918l.156.805c.182.944.275 1.908.275 2.884 0 3.091-.93 5.966-2.525 8.364 3.195 1.244 5.494 3.132 6.867 5.642a16 16 0 0 0-2.291.074c-1.27-1.796-3.21-3.144-5.844-4.066a15.23 15.23 0 0 1-11.442 5.156 15.23 15.23 0 0 1-11.614-5.35c-5.783 1.714-8.577 5.259-8.577 10.8v19.883H9V43.29c0-6.227 3.161-10.44 9.309-12.491a15.04 15.04 0 0 1-2.371-8.13c0-8.38 6.823-15.169 15.235-15.169" /></svg>;
3
+ export default PersonAlreadyMoved72;
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
+ const PersonAlreadyMoved72 = (props: SVGProps<SVGSVGElement>) => <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 72 72" {...props}><path fill="currentColor" d="M50.116 38.652C57.22 38.652 63 44.45 63 51.576S57.22 64.5 50.116 64.5s-12.884-5.798-12.884-12.924 5.78-12.924 12.884-12.924m0 1.988c-6.011 0-10.902 4.906-10.902 10.936s4.89 10.936 10.902 10.936c6.01 0 10.902-4.907 10.902-10.936 0-6.03-4.891-10.936-10.902-10.936" /><path fill="currentColor" d="M42.187 50.582h15.858v1.988H42.186zM31.173 7.5c4.5 0 8.685 1.956 11.56 5.29l-1.497 1.301a13.25 13.25 0 0 0-10.063-4.603c-7.321 0-13.253 5.904-13.253 13.182s5.932 13.182 13.253 13.182 13.253-5.904 13.253-13.182q0-.86-.11-1.7H34.06c-3.165 0-6.4-2.352-7.985-5.649l1.786-.864c1.274 2.65 3.851 4.524 6.199 4.524h11.918l.156.805c.182.944.275 1.908.275 2.884 0 3.091-.93 5.966-2.525 8.364 3.195 1.244 5.494 3.132 6.867 5.642a16 16 0 0 0-2.291.074c-1.27-1.796-3.21-3.144-5.844-4.066a15.23 15.23 0 0 1-11.442 5.156 15.23 15.23 0 0 1-11.614-5.35c-5.783 1.714-8.577 5.259-8.577 10.8v19.883H9V43.29c0-6.227 3.161-10.44 9.309-12.491a15.04 15.04 0 0 1-2.371-8.13c0-8.38 6.823-15.169 15.235-15.169" /></svg>;
4
+ export default PersonAlreadyMoved72;
@@ -42,6 +42,7 @@
42
42
  "pig-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/Pig72.jsx",
43
43
  "phone-retro-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PhoneRetro72.jsx",
44
44
  "phone-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/Phone72.jsx",
45
+ "person-already-moved-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PersonAlreadyMoved72.jsx",
45
46
  "percent-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/Percent72.jsx",
46
47
  "pension-state-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PensionState72.jsx",
47
48
  "pension-private-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PensionPrivate72.jsx",
@@ -45,6 +45,7 @@
45
45
  "pig-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/sprite-72.svg#pig-72",
46
46
  "phone-retro-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/sprite-72.svg#phone-retro-72",
47
47
  "phone-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/sprite-72.svg#phone-72",
48
+ "person-already-moved-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/sprite-72.svg#person-already-moved-72",
48
49
  "percent-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/sprite-72.svg#percent-72",
49
50
  "pension-state-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/sprite-72.svg#pension-state-72",
50
51
  "pension-private-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/sprite-72.svg#pension-private-72",
@@ -42,6 +42,7 @@
42
42
  "pig-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/pig-72.svg",
43
43
  "phone-retro-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/phone-retro-72.svg",
44
44
  "phone-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/phone-72.svg",
45
+ "person-already-moved-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/person-already-moved-72.svg",
45
46
  "percent-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/percent-72.svg",
46
47
  "pension-state-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/pension-state-72.svg",
47
48
  "pension-private-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/pension-private-72.svg",
@@ -42,6 +42,7 @@
42
42
  "pig-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/Pig72.tsx",
43
43
  "phone-retro-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PhoneRetro72.tsx",
44
44
  "phone-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/Phone72.tsx",
45
+ "person-already-moved-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PersonAlreadyMoved72.tsx",
45
46
  "percent-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/Percent72.tsx",
46
47
  "pension-state-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PensionState72.tsx",
47
48
  "pension-private-72": "/Users/magnus/Code/Work/lfds/packages/icons/dist/PensionPrivate72.tsx",
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" fill="none" viewBox="0 0 72 72"><path fill="currentColor" d="M50.116 38.652C57.22 38.652 63 44.45 63 51.576S57.22 64.5 50.116 64.5s-12.884-5.798-12.884-12.924 5.78-12.924 12.884-12.924m0 1.988c-6.011 0-10.902 4.906-10.902 10.936s4.89 10.936 10.902 10.936c6.01 0 10.902-4.907 10.902-10.936 0-6.03-4.891-10.936-10.902-10.936"/><path fill="currentColor" d="M42.187 50.582h15.858v1.988H42.186zM31.173 7.5c4.5 0 8.685 1.956 11.56 5.29l-1.497 1.301a13.25 13.25 0 0 0-10.063-4.603c-7.321 0-13.253 5.904-13.253 13.182s5.932 13.182 13.253 13.182 13.253-5.904 13.253-13.182q0-.86-.11-1.7H34.06c-3.165 0-6.4-2.352-7.985-5.649l1.786-.864c1.274 2.65 3.851 4.524 6.199 4.524h11.918l.156.805c.182.944.275 1.908.275 2.884 0 3.091-.93 5.966-2.525 8.364 3.195 1.244 5.494 3.132 6.867 5.642a16 16 0 0 0-2.291.074c-1.27-1.796-3.21-3.144-5.844-4.066a15.23 15.23 0 0 1-11.442 5.156 15.23 15.23 0 0 1-11.614-5.35c-5.783 1.714-8.577 5.259-8.577 10.8v19.883H9V43.29c0-6.227 3.161-10.44 9.309-12.491a15.04 15.04 0 0 1-2.371-8.13c0-8.38 6.823-15.169 15.235-15.169"/></svg>
@@ -1 +1 @@
1
- <svg width="0" height="0" style="position:absolute"><symbol fill="none" viewBox="0 0 12 13" id="external-link-12" xmlns="http://www.w3.org/2000/svg"><g fill="currentColor" fill-rule="evenodd" clip-path="url(#aaa)" clip-rule="evenodd"><path d="m6.002.484-.006 1.75h2.84l-4.74 4.75 1.4 1.4 4.75-4.74v2.834h1.75V.484z"/><path d="M-.004 1.484v11h11v-4h-2v2h-7v-7h2v-2z"/></g><defs><clipPath id="aaa"><path fill="#fff" d="M-.004.484h12v12h-12z"/></clipPath></defs></symbol><symbol fill="none" viewBox="0 0 12 13" id="plus-12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M4.996 1.484h2v10h-2z"/><path fill="currentColor" d="M.996 5.484h10v2h-10z"/></symbol></svg>
1
+ <svg width="0" height="0" style="position:absolute"><symbol fill="none" viewBox="0 0 12 13" id="external-link-12" xmlns="http://www.w3.org/2000/svg"><g fill="currentColor" fill-rule="evenodd" clip-path="url(#aba)" clip-rule="evenodd"><path d="m6.002.484-.006 1.75h2.84l-4.74 4.75 1.4 1.4 4.75-4.74v2.834h1.75V.484z"/><path d="M-.004 1.484v11h11v-4h-2v2h-7v-7h2v-2z"/></g><defs><clipPath id="aba"><path fill="#fff" d="M-.004.484h12v12h-12z"/></clipPath></defs></symbol><symbol fill="none" viewBox="0 0 12 13" id="plus-12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M4.996 1.484h2v10h-2z"/><path fill="currentColor" d="M.996 5.484h10v2h-10z"/></symbol></svg>