@nice2dev/icons 1.3.7 → 1.3.9
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 +90 -0
- package/README.md +33 -16
- package/dist/cjs/NiceIconPicker.js +289 -92
- package/dist/cjs/NiceIconStacker.js +137 -108
- package/dist/cjs/client.js +6 -0
- package/dist/cjs/createIcon.js +17 -4
- package/dist/cjs/iconHtml.js +122 -0
- package/dist/cjs/iconParts.js +24 -2
- package/dist/cjs/iconStack.js +76 -5
- package/dist/cjs/icons/accessibility.js +9 -8
- package/dist/cjs/icons/actions.js +38 -35
- package/dist/cjs/icons/ai.js +12 -11
- package/dist/cjs/icons/brand.js +2 -2
- package/dist/cjs/icons/business.js +14 -16
- package/dist/cjs/icons/devtech.js +17 -15
- package/dist/cjs/icons/ecommerce.js +7 -12
- package/dist/cjs/icons/education.js +14 -16
- package/dist/cjs/icons/files.js +46 -22
- package/dist/cjs/icons/fintech.js +2 -11
- package/dist/cjs/icons/food.js +12 -8
- package/dist/cjs/icons/fun.js +11 -11
- package/dist/cjs/icons/gaming.js +20 -13
- package/dist/cjs/icons/health.js +9 -12
- package/dist/cjs/icons/index.js +1 -0
- package/dist/cjs/icons/input.js +31 -21
- package/dist/cjs/icons/legal.js +11 -11
- package/dist/cjs/icons/media.js +24 -15
- package/dist/cjs/icons/navigation.js +16 -13
- package/dist/cjs/icons/omniverk.js +2 -7
- package/dist/cjs/icons/realestate.js +14 -14
- package/dist/cjs/icons/saas.js +0 -10
- package/dist/cjs/icons/science.js +12 -12
- package/dist/cjs/icons/shapes.js +20 -17
- package/dist/cjs/icons/smarthome.js +0 -11
- package/dist/cjs/icons/social.js +7 -6
- package/dist/cjs/icons/sports.js +5 -6
- package/dist/cjs/icons/sustainability.js +12 -11
- package/dist/cjs/icons/travel.js +9 -9
- package/dist/cjs/icons/ui.js +55 -31
- package/dist/cjs/icons/weather.js +8 -13
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/nicetodev-icons.css +1 -1
- package/dist/cjs/resolver.js +1 -0
- package/dist/cjs/stacking.js +38 -11
- package/dist/esm/NiceIconPicker.js +292 -95
- package/dist/esm/NiceIconStacker.js +141 -112
- package/dist/esm/client.js +2 -1
- package/dist/esm/createIcon.js +18 -5
- package/dist/esm/iconHtml.js +117 -0
- package/dist/esm/iconParts.js +24 -3
- package/dist/esm/iconStack.js +74 -6
- package/dist/esm/icons/accessibility.js +9 -8
- package/dist/esm/icons/actions.js +39 -36
- package/dist/esm/icons/ai.js +12 -11
- package/dist/esm/icons/brand.js +2 -2
- package/dist/esm/icons/business.js +15 -17
- package/dist/esm/icons/devtech.js +17 -15
- package/dist/esm/icons/ecommerce.js +7 -12
- package/dist/esm/icons/education.js +14 -16
- package/dist/esm/icons/files.js +47 -23
- package/dist/esm/icons/fintech.js +2 -11
- package/dist/esm/icons/food.js +12 -8
- package/dist/esm/icons/fun.js +11 -11
- package/dist/esm/icons/gaming.js +21 -14
- package/dist/esm/icons/health.js +9 -12
- package/dist/esm/icons/index.js +1 -1
- package/dist/esm/icons/input.js +31 -21
- package/dist/esm/icons/legal.js +12 -12
- package/dist/esm/icons/media.js +25 -16
- package/dist/esm/icons/navigation.js +16 -13
- package/dist/esm/icons/omniverk.js +2 -7
- package/dist/esm/icons/realestate.js +15 -15
- package/dist/esm/icons/saas.js +0 -10
- package/dist/esm/icons/science.js +12 -12
- package/dist/esm/icons/shapes.js +20 -17
- package/dist/esm/icons/smarthome.js +0 -11
- package/dist/esm/icons/social.js +8 -7
- package/dist/esm/icons/sports.js +6 -7
- package/dist/esm/icons/sustainability.js +12 -11
- package/dist/esm/icons/travel.js +10 -10
- package/dist/esm/icons/ui.js +56 -33
- package/dist/esm/icons/weather.js +9 -14
- package/dist/esm/index.js +3 -2
- package/dist/esm/nicetodev-icons.css +1 -1
- package/dist/esm/resolver.js +1 -0
- package/dist/esm/stacking.js +36 -12
- package/dist/types/NiceIconPicker.d.ts +66 -20
- package/dist/types/NiceIconStacker.d.ts +30 -9
- package/dist/types/client.d.ts +4 -2
- package/dist/types/createIcon.d.ts +16 -2
- package/dist/types/iconHtml.d.ts +44 -0
- package/dist/types/iconParts.d.ts +8 -2
- package/dist/types/iconStack.d.ts +30 -3
- package/dist/types/icons/index.d.ts +1 -1
- package/dist/types/icons/ui.d.ts +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/stacking.d.ts +25 -5
- package/dist/types/types.d.ts +11 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,95 @@
|
|
|
1
1
|
# @nice2dev/icons — Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f5f6251: **NiceIconPicker: a bindable value, stored as HTML, with icons stacked in its panel; a tidier NiceIconStacker.**
|
|
8
|
+
|
|
9
|
+
NiceIconPicker:
|
|
10
|
+
|
|
11
|
+
- Binds both ways: `value` / `defaultValue` + `onChange` (and `values` / `defaultValues` in
|
|
12
|
+
multi-select). Without a value it keeps its own selection — before, an uncontrolled picker showed
|
|
13
|
+
nothing after a pick.
|
|
14
|
+
- `valueFormat="html"`: the value is the icon drawn as an `<svg>` (1em, `currentColor`) to store in a
|
|
15
|
+
database, with what it was drawn from in `data-ntd-*` attributes, so the picker reads it back. The
|
|
16
|
+
ids inside are named after the drawing, so the markup can sit in another page. `parseIconHtml(html)`
|
|
17
|
+
reads it; `NiceIconHtml` draws it in React from the data, never injecting the markup.
|
|
18
|
+
- `stackable`: an "Overlays" tab in the panel with the NiceIconStacker — icons put on the chosen one,
|
|
19
|
+
nested, placed, sized, with text and colours; the stack goes into the same HTML (the default format
|
|
20
|
+
then). Swapping the icon keeps its stack.
|
|
21
|
+
- `displayMode`: the trigger shows the icon alone or the icon and its name; `optionDisplayMode` lists
|
|
22
|
+
the panel's icons alone or with names. Names show without `Ntd` everywhere (grid, search, names
|
|
23
|
+
read aloud), or as the entry's new `label`.
|
|
24
|
+
- `name` (a hidden input for forms), `aria-label` (the field's label, the icon's name after it), `id`,
|
|
25
|
+
`testId`, `iconProps` (what the icons are drawn with; the accent now follows the page background,
|
|
26
|
+
so cut-outs and stacked icons show in a dark theme).
|
|
27
|
+
- The panel opens above the trigger when there is more room there and never grows past what the
|
|
28
|
+
window and clipping ancestors leave visible.
|
|
29
|
+
- Fixed: the favourites star was a button inside the icon's button (invalid HTML, a console error);
|
|
30
|
+
with several icons selected the trigger shows their count (it showed the first icon); Escape while
|
|
31
|
+
picking an icon to stack goes back to the stack.
|
|
32
|
+
|
|
33
|
+
NiceIconStacker:
|
|
34
|
+
|
|
35
|
+
- Laid out to fit the picker's panel and less technical: the stack drawn large and small, the layers
|
|
36
|
+
as a list (select one to edit it — new icons go into it; Delete removes it), and under it the
|
|
37
|
+
selected layer only — its position on a pad shaped like its parent instead of a list of
|
|
38
|
+
`half-top-left`-style values, its size and text; turn, nudge, colours (swatches) and binding fold
|
|
39
|
+
under "More", the JSX code under "JSX code". Names show without `Ntd`.
|
|
40
|
+
- `onAddClick(target)` (the add button asks the host for the icon), the handle's `add(icon?)`,
|
|
41
|
+
`iconLabel`, `showCode`, `keepBase`.
|
|
42
|
+
- `addStackLayer` / `removeStackLayer` / `iconDisplayName` exported; new layers get short ids (`'1'`,
|
|
43
|
+
`'2'`…).
|
|
44
|
+
|
|
45
|
+
Behaviour changes: `values` passed as a constant `[]` no longer falls back to the picker's own
|
|
46
|
+
selection (a frozen controlled value, as with any controlled prop); the stacker's DOM is new (tests
|
|
47
|
+
that queried its `select` or radios need updating).
|
|
48
|
+
|
|
49
|
+
## 1.3.8
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- f389149: Duotone draws the larger area in primary. 373 of the 541 core icons drew their body in pale
|
|
54
|
+
secondary under a primary outline.
|
|
55
|
+
|
|
56
|
+
- Icons with details now draw duotone as the solid, with those details in full secondary
|
|
57
|
+
(`paths.duotone` may be left out; `createIcon` derives it that way).
|
|
58
|
+
- Icons without details, and the fills-only splits whose larger part was secondary (Download,
|
|
59
|
+
Upload, User, Dollar, PieChart, Undo / Redo, Wifi, …), have their colours swapped through the
|
|
60
|
+
new `swapDuotone` helper: body primary, outline and details secondary.
|
|
61
|
+
- NtdSearch / NtdZoomIn / NtdZoomOut fill the lens in primary under a secondary handle and glyph.
|
|
62
|
+
- NtdForge got a duotone of its own.
|
|
63
|
+
|
|
64
|
+
A duotone without a `secondaryColor` now reads as one colour where it used to rely on
|
|
65
|
+
`secondaryOpacity`; pass a secondary colour for two tones.
|
|
66
|
+
|
|
67
|
+
- a947882: Icon feedback round 39:
|
|
68
|
+
|
|
69
|
+
- NtdBriefcase: the handle is 1.5 × the stroke width on the filled cases.
|
|
70
|
+
- NtdCode: twice the stroke width in every variant but outline (vivid had a fixed 2.2), with sharp
|
|
71
|
+
points. Duotone is vivid's split: right bracket primary, left secondary.
|
|
72
|
+
- NtdMoreHorizontal / NtdMoreVertical: in vivid, the outer dots are primary and the middle one
|
|
73
|
+
secondary. The last dot was a fixed `#3B82F6`, and the white sheen is gone.
|
|
74
|
+
- NtdTrash: the lid is flat with its ends bent down, as round as the bin's bottom corners.
|
|
75
|
+
|
|
76
|
+
- cbee657: Core container icons keep a spot for stacked icons and text. Each spot was measured as the largest
|
|
77
|
+
circle inside the icon's silhouette, then checked by eye: NtdBell / NtdBellRing (the body above
|
|
78
|
+
the clapper), NtdBookmark, NtdBubble, NtdChat, NtdCalendar, NtdCamera, NtdClipboard, NtdCloud,
|
|
79
|
+
NtdCoffee, NtdDroplet, NtdEgg, NtdFile and every paper icon (the page below the fold), NtdFolder /
|
|
80
|
+
NtdFolderOpen, NtdMonitor, NtdAward, NtdTrophy, NtdLock, NtdBriefcase, NtdBattery, NtdBackspace,
|
|
81
|
+
NtdDiamond, NtdPentagon, NtdPlay, NtdVideo, NtdFlag, NtdGhost, NtdWishlist and the gaming
|
|
82
|
+
NtdShield / NtdStar / NtdTrophy.
|
|
83
|
+
- 8eca993: Icons keep a spot for what is stacked in them. `createIcon` takes `perfectStackX` /
|
|
84
|
+
`perfectStackY` (the spot's centre in the 24-unit box), `perfectStackRotation` and
|
|
85
|
+
`perfectStackSize`. A child without a `stackAlign` goes there (the new default `'perfect'`), and
|
|
86
|
+
so does text, turned with it and scaled to it. Without them, the spot is the icon's `textCenter`,
|
|
87
|
+
else the box centre. `stackAlign="center"` is still the middle of the box. NtdPin keeps its head,
|
|
88
|
+
NtdTag the stretch past its hole, turned 45° along the tag. NtdPin no longer has the dot; the pin
|
|
89
|
+
with the dot is the new `NtdMapPin` (`'map-pin'` in the resolver). NiceIconStacker offers
|
|
90
|
+
`perfect` first, shows the spot's size and turn as the layer's defaults, and writes `stackAlign`
|
|
91
|
+
only for another position.
|
|
92
|
+
|
|
3
93
|
## 1.3.7
|
|
4
94
|
|
|
5
95
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -207,12 +207,13 @@ See [Full Animation Catalog](#full-animation-catalog) for the complete list.
|
|
|
207
207
|
|
|
208
208
|
### Stacking icons
|
|
209
209
|
|
|
210
|
-
Nest icons to stack them in one SVG. A child icon sits where its `stackAlign` says
|
|
211
|
-
|
|
210
|
+
Nest icons to stack them in one SVG. A child icon sits where its `stackAlign` says. Without one, it
|
|
211
|
+
goes to the spot its parent keeps for stacked icons (a pin's head, along a tag), or the centre if
|
|
212
|
+
the parent keeps none. Text goes to that spot too:
|
|
212
213
|
|
|
213
214
|
```tsx
|
|
214
215
|
<NtdSquare variant="solid">
|
|
215
|
-
<NtdStar
|
|
216
|
+
<NtdStar>1</NtdStar>
|
|
216
217
|
</NtdSquare>
|
|
217
218
|
|
|
218
219
|
<NtdFolder>
|
|
@@ -221,6 +222,12 @@ centred on the icon:
|
|
|
221
222
|
|
|
222
223
|
<NtdCircle>42</NtdCircle>
|
|
223
224
|
|
|
225
|
+
<NtdPin>
|
|
226
|
+
<NtdStar />
|
|
227
|
+
</NtdPin>
|
|
228
|
+
|
|
229
|
+
<NtdTag>SALE</NtdTag>
|
|
230
|
+
|
|
224
231
|
<NtdBitcoin>
|
|
225
232
|
<NtdStar>
|
|
226
233
|
<NtdSparkle>1</NtdSparkle>
|
|
@@ -230,10 +237,19 @@ centred on the icon:
|
|
|
230
237
|
|
|
231
238
|
Stacks nest any number of levels deep, with the colours flipping at every level.
|
|
232
239
|
|
|
233
|
-
- **`stackAlign`:** `
|
|
234
|
-
`top
|
|
235
|
-
`half-bottom-right`, …), halfway from the centre to that
|
|
236
|
-
|
|
240
|
+
- **`stackAlign`:** `perfect` (default: the parent's own spot), `center` (the middle of the box),
|
|
241
|
+
`top`, `bottom`, `left`, `right`, `top-left`, `top-right`, `bottom-left`, `bottom-right`, plus
|
|
242
|
+
each of them with `half-` (`half-top`, `half-bottom-right`, …), halfway from the centre to that
|
|
243
|
+
edge or corner.
|
|
244
|
+
- **The parent's own spot:** an icon declares it with `createIcon`'s `perfectStackX` /
|
|
245
|
+
`perfectStackY` (its centre in the 24-unit box), `perfectStackRotation` (degrees clockwise) and
|
|
246
|
+
`perfectStackSize` (a child's share). For example, `NtdPin` keeps its head (12, 10, half the
|
|
247
|
+
pin) and `NtdTag` the stretch past its hole, turned 45° along the tag. Without them, the spot is
|
|
248
|
+
the icon's `textCenter`, else the centre. A child there takes the spot's size and turn, unless
|
|
249
|
+
it sets its own `stackSize` / `stackRotation`; text there turns with it and scales to its size.
|
|
250
|
+
`NtdMapPin` is the pin with the dot in its head (`NtdPin` had it until 1.3.8).
|
|
251
|
+
- **`stackSize`:** the child's share of its parent. Default: the spot's size at `perfect`, `0.6`
|
|
252
|
+
centred, `0.5` elsewhere.
|
|
237
253
|
- **Colours** follow the parent unless the child sets its own:
|
|
238
254
|
- In the centre or at an edge, a filled parent cuts the content out. The child takes the
|
|
239
255
|
parent's accent and its text the parent's primary. On `outline` / `wireframe` everything stays
|
|
@@ -421,14 +437,15 @@ export const NtdMyIcon = createIcon({
|
|
|
421
437
|
|
|
422
438
|
### CreateIconOptions
|
|
423
439
|
|
|
424
|
-
| Field
|
|
425
|
-
|
|
|
426
|
-
| `displayName`
|
|
427
|
-
| `viewBox`
|
|
428
|
-
| `paths.solid`
|
|
429
|
-
| `paths.outline`
|
|
430
|
-
| `paths.duotone`
|
|
431
|
-
| `
|
|
440
|
+
| Field | Type | Default | Description |
|
|
441
|
+
| ------------------------------------------------------------------------------- | ------------------ | --------------------------------- | --------------------------------------------------------- |
|
|
442
|
+
| `displayName` | `string` | **required** | React display name |
|
|
443
|
+
| `viewBox` | `string` | `'0 0 24 24'` | SVG viewBox |
|
|
444
|
+
| `paths.solid` | `IconPathRenderer` | **required** | Solid variant renderer |
|
|
445
|
+
| `paths.outline` | `IconPathRenderer` | **required** | Outline variant renderer |
|
|
446
|
+
| `paths.duotone` | `IconPathRenderer` | solid, details in secondary | Duotone variant renderer: the larger part primary (1.3.8) |
|
|
447
|
+
| `perfectStackX` / `perfectStackY` / `perfectStackRotation` / `perfectStackSize` | `number` | `textCenter` / box centre, 0, 0.6 | The spot stacked icons and text go to (1.3.8) |
|
|
448
|
+
| `paths.flat` | `IconPathRenderer` | **required** | Flat (badge) variant renderer |
|
|
432
449
|
|
|
433
450
|
### IconPathRenderer
|
|
434
451
|
|
|
@@ -467,7 +484,7 @@ Properties passed to every path renderer (pre-resolved from user props):
|
|
|
467
484
|
|
|
468
485
|
### UI & Status (27 icons)
|
|
469
486
|
|
|
470
|
-
`NtdHome` · `NtdUser` · `NtdUsers` · `NtdHeart` · `NtdStar` · `NtdBell` · `NtdEye` · `NtdEyeOff` · `NtdInfo` · `NtdWarning` · `NtdError` · `NtdSuccess` · `NtdHelp` · `NtdClock` · `NtdHourglass` · `NtdCalendar` · `NtdTag` · `NtdBookmark` · `NtdFlag` · `NtdThumbUp` · `NtdThumbDown` · `NtdShield` · `NtdGlobe` · `NtdMap` · `NtdPin` · `NtdSun` · `NtdMoon`
|
|
487
|
+
`NtdHome` · `NtdUser` · `NtdUsers` · `NtdHeart` · `NtdStar` · `NtdBell` · `NtdEye` · `NtdEyeOff` · `NtdInfo` · `NtdWarning` · `NtdError` · `NtdSuccess` · `NtdHelp` · `NtdClock` · `NtdHourglass` · `NtdCalendar` · `NtdTag` · `NtdBookmark` · `NtdFlag` · `NtdThumbUp` · `NtdThumbDown` · `NtdShield` · `NtdGlobe` · `NtdMap` · `NtdPin` · `NtdMapPin` · `NtdSun` · `NtdMoon`
|
|
471
488
|
|
|
472
489
|
### Media & Communication (19 icons)
|
|
473
490
|
|