@nervure/icons 0.0.0-stage → 0.1.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 +15 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/cdn/nervure-icons.min.js +2 -0
- package/dist/cdn.d.ts +1 -0
- package/dist/cdn.js +14 -0
- package/dist/core.d.ts +18 -0
- package/dist/core.js +62 -0
- package/dist/element.d.ts +21 -0
- package/dist/element.js +68 -0
- package/dist/icons/activity.d.ts +2 -0
- package/dist/icons/activity.js +7 -0
- package/dist/icons/arrow-down.d.ts +2 -0
- package/dist/icons/arrow-down.js +8 -0
- package/dist/icons/arrow-left.d.ts +2 -0
- package/dist/icons/arrow-left.js +8 -0
- package/dist/icons/arrow-right.d.ts +2 -0
- package/dist/icons/arrow-right.js +8 -0
- package/dist/icons/arrow-up.d.ts +2 -0
- package/dist/icons/arrow-up.js +8 -0
- package/dist/icons/atom.d.ts +2 -0
- package/dist/icons/atom.js +12 -0
- package/dist/icons/ban.d.ts +2 -0
- package/dist/icons/ban.js +7 -0
- package/dist/icons/bank.d.ts +2 -0
- package/dist/icons/bank.js +7 -0
- package/dist/icons/battery.d.ts +2 -0
- package/dist/icons/battery.js +7 -0
- package/dist/icons/bell.d.ts +2 -0
- package/dist/icons/bell.js +8 -0
- package/dist/icons/bike.d.ts +2 -0
- package/dist/icons/bike.js +15 -0
- package/dist/icons/bolt.d.ts +2 -0
- package/dist/icons/bolt.js +7 -0
- package/dist/icons/bookmark.d.ts +2 -0
- package/dist/icons/bookmark.js +7 -0
- package/dist/icons/briefcase.d.ts +2 -0
- package/dist/icons/briefcase.js +12 -0
- package/dist/icons/building.d.ts +2 -0
- package/dist/icons/building.js +14 -0
- package/dist/icons/bus.d.ts +2 -0
- package/dist/icons/bus.js +15 -0
- package/dist/icons/calculator.d.ts +2 -0
- package/dist/icons/calculator.js +16 -0
- package/dist/icons/calendar.d.ts +2 -0
- package/dist/icons/calendar.js +7 -0
- package/dist/icons/car.d.ts +2 -0
- package/dist/icons/car.js +14 -0
- package/dist/icons/card.d.ts +2 -0
- package/dist/icons/card.js +7 -0
- package/dist/icons/cart.d.ts +2 -0
- package/dist/icons/cart.js +12 -0
- package/dist/icons/chart-area.d.ts +2 -0
- package/dist/icons/chart-area.js +7 -0
- package/dist/icons/chart-bar.d.ts +2 -0
- package/dist/icons/chart-bar.js +7 -0
- package/dist/icons/chart-donut.d.ts +2 -0
- package/dist/icons/chart-donut.js +7 -0
- package/dist/icons/chart-funnel.d.ts +2 -0
- package/dist/icons/chart-funnel.js +7 -0
- package/dist/icons/chart-line.d.ts +2 -0
- package/dist/icons/chart-line.js +7 -0
- package/dist/icons/chart-pie.d.ts +2 -0
- package/dist/icons/chart-pie.js +8 -0
- package/dist/icons/chart-scatter.d.ts +2 -0
- package/dist/icons/chart-scatter.js +7 -0
- package/dist/icons/chat.d.ts +2 -0
- package/dist/icons/chat.js +12 -0
- package/dist/icons/check.d.ts +2 -0
- package/dist/icons/check.js +7 -0
- package/dist/icons/chevron-down.d.ts +2 -0
- package/dist/icons/chevron-down.js +8 -0
- package/dist/icons/chevron-left.d.ts +2 -0
- package/dist/icons/chevron-left.js +8 -0
- package/dist/icons/chevron-right.d.ts +2 -0
- package/dist/icons/chevron-right.js +8 -0
- package/dist/icons/chevron-up.d.ts +2 -0
- package/dist/icons/chevron-up.js +8 -0
- package/dist/icons/clock.d.ts +2 -0
- package/dist/icons/clock.js +7 -0
- package/dist/icons/close.d.ts +2 -0
- package/dist/icons/close.js +7 -0
- package/dist/icons/cloud-sun.d.ts +2 -0
- package/dist/icons/cloud-sun.js +14 -0
- package/dist/icons/cloud.d.ts +2 -0
- package/dist/icons/cloud.js +7 -0
- package/dist/icons/coins.d.ts +2 -0
- package/dist/icons/coins.js +7 -0
- package/dist/icons/compass.d.ts +2 -0
- package/dist/icons/compass.js +8 -0
- package/dist/icons/contract.d.ts +2 -0
- package/dist/icons/contract.js +13 -0
- package/dist/icons/copy.d.ts +2 -0
- package/dist/icons/copy.js +8 -0
- package/dist/icons/dashboard.d.ts +2 -0
- package/dist/icons/dashboard.js +7 -0
- package/dist/icons/database.d.ts +2 -0
- package/dist/icons/database.js +11 -0
- package/dist/icons/dollar.d.ts +2 -0
- package/dist/icons/dollar.js +10 -0
- package/dist/icons/download.d.ts +2 -0
- package/dist/icons/download.js +7 -0
- package/dist/icons/drop.d.ts +2 -0
- package/dist/icons/drop.js +7 -0
- package/dist/icons/edit.d.ts +2 -0
- package/dist/icons/edit.js +8 -0
- package/dist/icons/error.d.ts +2 -0
- package/dist/icons/error.js +7 -0
- package/dist/icons/euro.d.ts +2 -0
- package/dist/icons/euro.js +7 -0
- package/dist/icons/expand.d.ts +2 -0
- package/dist/icons/expand.js +7 -0
- package/dist/icons/external-link.d.ts +2 -0
- package/dist/icons/external-link.js +12 -0
- package/dist/icons/eye-off.d.ts +2 -0
- package/dist/icons/eye-off.js +12 -0
- package/dist/icons/eye.d.ts +2 -0
- package/dist/icons/eye.js +7 -0
- package/dist/icons/file.d.ts +2 -0
- package/dist/icons/file.js +12 -0
- package/dist/icons/filter.d.ts +2 -0
- package/dist/icons/filter.js +8 -0
- package/dist/icons/flag.d.ts +2 -0
- package/dist/icons/flag.js +8 -0
- package/dist/icons/flame.d.ts +2 -0
- package/dist/icons/flame.js +10 -0
- package/dist/icons/folder.d.ts +2 -0
- package/dist/icons/folder.js +9 -0
- package/dist/icons/fuel.d.ts +2 -0
- package/dist/icons/fuel.js +13 -0
- package/dist/icons/gauge.d.ts +2 -0
- package/dist/icons/gauge.js +8 -0
- package/dist/icons/globe.d.ts +2 -0
- package/dist/icons/globe.js +7 -0
- package/dist/icons/grid.d.ts +2 -0
- package/dist/icons/grid.js +7 -0
- package/dist/icons/heart.d.ts +2 -0
- package/dist/icons/heart.js +9 -0
- package/dist/icons/help.d.ts +2 -0
- package/dist/icons/help.js +8 -0
- package/dist/icons/house.d.ts +2 -0
- package/dist/icons/house.js +7 -0
- package/dist/icons/image.d.ts +2 -0
- package/dist/icons/image.js +7 -0
- package/dist/icons/inbox.d.ts +2 -0
- package/dist/icons/inbox.js +12 -0
- package/dist/icons/index.d.ts +273 -0
- package/dist/icons/index.js +406 -0
- package/dist/icons/info.d.ts +2 -0
- package/dist/icons/info.js +7 -0
- package/dist/icons/key.d.ts +2 -0
- package/dist/icons/key.js +8 -0
- package/dist/icons/layers.d.ts +2 -0
- package/dist/icons/layers.js +7 -0
- package/dist/icons/leaf.d.ts +2 -0
- package/dist/icons/leaf.js +8 -0
- package/dist/icons/link.d.ts +2 -0
- package/dist/icons/link.js +7 -0
- package/dist/icons/list.d.ts +2 -0
- package/dist/icons/list.js +7 -0
- package/dist/icons/loader.d.ts +2 -0
- package/dist/icons/loader.js +7 -0
- package/dist/icons/lock.d.ts +2 -0
- package/dist/icons/lock.js +7 -0
- package/dist/icons/login.d.ts +2 -0
- package/dist/icons/login.js +8 -0
- package/dist/icons/logout.d.ts +2 -0
- package/dist/icons/logout.js +8 -0
- package/dist/icons/mail.d.ts +2 -0
- package/dist/icons/mail.js +7 -0
- package/dist/icons/map.d.ts +2 -0
- package/dist/icons/map.js +7 -0
- package/dist/icons/megaphone.d.ts +2 -0
- package/dist/icons/megaphone.js +11 -0
- package/dist/icons/menu.d.ts +2 -0
- package/dist/icons/menu.js +7 -0
- package/dist/icons/mic.d.ts +2 -0
- package/dist/icons/mic.js +7 -0
- package/dist/icons/minus.d.ts +2 -0
- package/dist/icons/minus.js +7 -0
- package/dist/icons/moon.d.ts +2 -0
- package/dist/icons/moon.js +8 -0
- package/dist/icons/more.d.ts +2 -0
- package/dist/icons/more.js +7 -0
- package/dist/icons/navigation.d.ts +2 -0
- package/dist/icons/navigation.js +8 -0
- package/dist/icons/percent.d.ts +2 -0
- package/dist/icons/percent.js +7 -0
- package/dist/icons/phone.d.ts +2 -0
- package/dist/icons/phone.js +10 -0
- package/dist/icons/pin.d.ts +2 -0
- package/dist/icons/pin.js +7 -0
- package/dist/icons/plane.d.ts +2 -0
- package/dist/icons/plane.js +10 -0
- package/dist/icons/plug.d.ts +2 -0
- package/dist/icons/plug.js +8 -0
- package/dist/icons/plus.d.ts +2 -0
- package/dist/icons/plus.js +7 -0
- package/dist/icons/power.d.ts +2 -0
- package/dist/icons/power.js +7 -0
- package/dist/icons/rain.d.ts +2 -0
- package/dist/icons/rain.js +12 -0
- package/dist/icons/receipt.d.ts +2 -0
- package/dist/icons/receipt.js +7 -0
- package/dist/icons/redo.d.ts +2 -0
- package/dist/icons/redo.js +8 -0
- package/dist/icons/refresh.d.ts +2 -0
- package/dist/icons/refresh.js +7 -0
- package/dist/icons/route.d.ts +2 -0
- package/dist/icons/route.js +7 -0
- package/dist/icons/search.d.ts +2 -0
- package/dist/icons/search.js +7 -0
- package/dist/icons/send.d.ts +2 -0
- package/dist/icons/send.js +8 -0
- package/dist/icons/settings.d.ts +2 -0
- package/dist/icons/settings.js +10 -0
- package/dist/icons/share.d.ts +2 -0
- package/dist/icons/share.js +7 -0
- package/dist/icons/shield-check.d.ts +2 -0
- package/dist/icons/shield-check.js +7 -0
- package/dist/icons/ship.d.ts +2 -0
- package/dist/icons/ship.js +7 -0
- package/dist/icons/sliders.d.ts +2 -0
- package/dist/icons/sliders.js +7 -0
- package/dist/icons/snow.d.ts +2 -0
- package/dist/icons/snow.js +12 -0
- package/dist/icons/sort.d.ts +2 -0
- package/dist/icons/sort.js +7 -0
- package/dist/icons/spinner.d.ts +2 -0
- package/dist/icons/spinner.js +16 -0
- package/dist/icons/star.d.ts +2 -0
- package/dist/icons/star.js +7 -0
- package/dist/icons/store.d.ts +2 -0
- package/dist/icons/store.js +12 -0
- package/dist/icons/success.d.ts +2 -0
- package/dist/icons/success.js +7 -0
- package/dist/icons/sun.d.ts +2 -0
- package/dist/icons/sun.js +17 -0
- package/dist/icons/table.d.ts +2 -0
- package/dist/icons/table.js +7 -0
- package/dist/icons/tag.d.ts +2 -0
- package/dist/icons/tag.js +11 -0
- package/dist/icons/target.d.ts +2 -0
- package/dist/icons/target.js +7 -0
- package/dist/icons/thermometer.d.ts +2 -0
- package/dist/icons/thermometer.js +7 -0
- package/dist/icons/thunder.d.ts +2 -0
- package/dist/icons/thunder.js +10 -0
- package/dist/icons/train.d.ts +2 -0
- package/dist/icons/train.js +14 -0
- package/dist/icons/trash.d.ts +2 -0
- package/dist/icons/trash.js +14 -0
- package/dist/icons/trend-down.d.ts +2 -0
- package/dist/icons/trend-down.js +8 -0
- package/dist/icons/trend-up.d.ts +2 -0
- package/dist/icons/trend-up.js +8 -0
- package/dist/icons/truck.d.ts +2 -0
- package/dist/icons/truck.js +8 -0
- package/dist/icons/umbrella.d.ts +2 -0
- package/dist/icons/umbrella.js +8 -0
- package/dist/icons/undo.d.ts +2 -0
- package/dist/icons/undo.js +8 -0
- package/dist/icons/unlock.d.ts +2 -0
- package/dist/icons/unlock.js +7 -0
- package/dist/icons/upload.d.ts +2 -0
- package/dist/icons/upload.js +7 -0
- package/dist/icons/user.d.ts +2 -0
- package/dist/icons/user.js +7 -0
- package/dist/icons/users.d.ts +2 -0
- package/dist/icons/users.js +12 -0
- package/dist/icons/video.d.ts +2 -0
- package/dist/icons/video.js +7 -0
- package/dist/icons/wallet.d.ts +2 -0
- package/dist/icons/wallet.js +8 -0
- package/dist/icons/warning.d.ts +2 -0
- package/dist/icons/warning.js +11 -0
- package/dist/icons/wifi.d.ts +2 -0
- package/dist/icons/wifi.js +12 -0
- package/dist/icons/wind.d.ts +2 -0
- package/dist/icons/wind.js +7 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +29 -0
- package/dist/react.d.ts +11 -0
- package/dist/react.js +54 -0
- package/dist/render.d.ts +19 -0
- package/dist/render.js +208 -0
- package/dist/styles.d.ts +22 -0
- package/dist/styles.js +124 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.js +1 -0
- package/dist/vue.d.ts +93 -0
- package/dist/vue.js +41 -0
- package/package.json +90 -4
- package/svg/activity.svg +1 -0
- package/svg/arrow-down.svg +1 -0
- package/svg/arrow-left.svg +1 -0
- package/svg/arrow-right.svg +1 -0
- package/svg/arrow-up.svg +1 -0
- package/svg/atom.svg +1 -0
- package/svg/ban.svg +1 -0
- package/svg/bank.svg +1 -0
- package/svg/battery.svg +1 -0
- package/svg/bell.svg +1 -0
- package/svg/bike.svg +1 -0
- package/svg/bolt.svg +1 -0
- package/svg/bookmark.svg +1 -0
- package/svg/briefcase.svg +1 -0
- package/svg/building.svg +1 -0
- package/svg/bus.svg +1 -0
- package/svg/calculator.svg +1 -0
- package/svg/calendar.svg +1 -0
- package/svg/car.svg +1 -0
- package/svg/card.svg +1 -0
- package/svg/cart.svg +1 -0
- package/svg/chart-area.svg +1 -0
- package/svg/chart-bar.svg +1 -0
- package/svg/chart-donut.svg +1 -0
- package/svg/chart-funnel.svg +1 -0
- package/svg/chart-line.svg +1 -0
- package/svg/chart-pie.svg +1 -0
- package/svg/chart-scatter.svg +1 -0
- package/svg/chat.svg +1 -0
- package/svg/check.svg +1 -0
- package/svg/chevron-down.svg +1 -0
- package/svg/chevron-left.svg +1 -0
- package/svg/chevron-right.svg +1 -0
- package/svg/chevron-up.svg +1 -0
- package/svg/clock.svg +1 -0
- package/svg/close.svg +1 -0
- package/svg/cloud-sun.svg +1 -0
- package/svg/cloud.svg +1 -0
- package/svg/coins.svg +1 -0
- package/svg/compass.svg +1 -0
- package/svg/contract.svg +1 -0
- package/svg/copy.svg +1 -0
- package/svg/dashboard.svg +1 -0
- package/svg/database.svg +1 -0
- package/svg/dollar.svg +1 -0
- package/svg/download.svg +1 -0
- package/svg/drop.svg +1 -0
- package/svg/duo/activity.svg +1 -0
- package/svg/duo/arrow-down.svg +1 -0
- package/svg/duo/arrow-left.svg +1 -0
- package/svg/duo/arrow-right.svg +1 -0
- package/svg/duo/arrow-up.svg +1 -0
- package/svg/duo/atom.svg +1 -0
- package/svg/duo/ban.svg +1 -0
- package/svg/duo/bank.svg +1 -0
- package/svg/duo/battery.svg +1 -0
- package/svg/duo/bell.svg +1 -0
- package/svg/duo/bike.svg +1 -0
- package/svg/duo/bolt.svg +1 -0
- package/svg/duo/bookmark.svg +1 -0
- package/svg/duo/briefcase.svg +1 -0
- package/svg/duo/building.svg +1 -0
- package/svg/duo/bus.svg +1 -0
- package/svg/duo/calculator.svg +1 -0
- package/svg/duo/calendar.svg +1 -0
- package/svg/duo/car.svg +1 -0
- package/svg/duo/card.svg +1 -0
- package/svg/duo/cart.svg +1 -0
- package/svg/duo/chart-area.svg +1 -0
- package/svg/duo/chart-bar.svg +1 -0
- package/svg/duo/chart-donut.svg +1 -0
- package/svg/duo/chart-funnel.svg +1 -0
- package/svg/duo/chart-line.svg +1 -0
- package/svg/duo/chart-pie.svg +1 -0
- package/svg/duo/chart-scatter.svg +1 -0
- package/svg/duo/chat.svg +1 -0
- package/svg/duo/check.svg +1 -0
- package/svg/duo/chevron-down.svg +1 -0
- package/svg/duo/chevron-left.svg +1 -0
- package/svg/duo/chevron-right.svg +1 -0
- package/svg/duo/chevron-up.svg +1 -0
- package/svg/duo/clock.svg +1 -0
- package/svg/duo/close.svg +1 -0
- package/svg/duo/cloud-sun.svg +1 -0
- package/svg/duo/cloud.svg +1 -0
- package/svg/duo/coins.svg +1 -0
- package/svg/duo/compass.svg +1 -0
- package/svg/duo/contract.svg +1 -0
- package/svg/duo/copy.svg +1 -0
- package/svg/duo/dashboard.svg +1 -0
- package/svg/duo/database.svg +1 -0
- package/svg/duo/dollar.svg +1 -0
- package/svg/duo/download.svg +1 -0
- package/svg/duo/drop.svg +1 -0
- package/svg/duo/edit.svg +1 -0
- package/svg/duo/error.svg +1 -0
- package/svg/duo/euro.svg +1 -0
- package/svg/duo/expand.svg +1 -0
- package/svg/duo/external-link.svg +1 -0
- package/svg/duo/eye-off.svg +1 -0
- package/svg/duo/eye.svg +1 -0
- package/svg/duo/file.svg +1 -0
- package/svg/duo/filter.svg +1 -0
- package/svg/duo/flag.svg +1 -0
- package/svg/duo/flame.svg +1 -0
- package/svg/duo/folder.svg +1 -0
- package/svg/duo/fuel.svg +1 -0
- package/svg/duo/gauge.svg +1 -0
- package/svg/duo/globe.svg +1 -0
- package/svg/duo/grid.svg +1 -0
- package/svg/duo/heart.svg +1 -0
- package/svg/duo/help.svg +1 -0
- package/svg/duo/house.svg +1 -0
- package/svg/duo/image.svg +1 -0
- package/svg/duo/inbox.svg +1 -0
- package/svg/duo/info.svg +1 -0
- package/svg/duo/key.svg +1 -0
- package/svg/duo/layers.svg +1 -0
- package/svg/duo/leaf.svg +1 -0
- package/svg/duo/link.svg +1 -0
- package/svg/duo/list.svg +1 -0
- package/svg/duo/loader.svg +1 -0
- package/svg/duo/lock.svg +1 -0
- package/svg/duo/login.svg +1 -0
- package/svg/duo/logout.svg +1 -0
- package/svg/duo/mail.svg +1 -0
- package/svg/duo/map.svg +1 -0
- package/svg/duo/megaphone.svg +1 -0
- package/svg/duo/menu.svg +1 -0
- package/svg/duo/mic.svg +1 -0
- package/svg/duo/minus.svg +1 -0
- package/svg/duo/moon.svg +1 -0
- package/svg/duo/more.svg +1 -0
- package/svg/duo/navigation.svg +1 -0
- package/svg/duo/percent.svg +1 -0
- package/svg/duo/phone.svg +1 -0
- package/svg/duo/pin.svg +1 -0
- package/svg/duo/plane.svg +1 -0
- package/svg/duo/plug.svg +1 -0
- package/svg/duo/plus.svg +1 -0
- package/svg/duo/power.svg +1 -0
- package/svg/duo/rain.svg +1 -0
- package/svg/duo/receipt.svg +1 -0
- package/svg/duo/redo.svg +1 -0
- package/svg/duo/refresh.svg +1 -0
- package/svg/duo/route.svg +1 -0
- package/svg/duo/search.svg +1 -0
- package/svg/duo/send.svg +1 -0
- package/svg/duo/settings.svg +1 -0
- package/svg/duo/share.svg +1 -0
- package/svg/duo/shield-check.svg +1 -0
- package/svg/duo/ship.svg +1 -0
- package/svg/duo/sliders.svg +1 -0
- package/svg/duo/snow.svg +1 -0
- package/svg/duo/sort.svg +1 -0
- package/svg/duo/spinner.svg +1 -0
- package/svg/duo/star.svg +1 -0
- package/svg/duo/store.svg +1 -0
- package/svg/duo/success.svg +1 -0
- package/svg/duo/sun.svg +1 -0
- package/svg/duo/table.svg +1 -0
- package/svg/duo/tag.svg +1 -0
- package/svg/duo/target.svg +1 -0
- package/svg/duo/thermometer.svg +1 -0
- package/svg/duo/thunder.svg +1 -0
- package/svg/duo/train.svg +1 -0
- package/svg/duo/trash.svg +1 -0
- package/svg/duo/trend-down.svg +1 -0
- package/svg/duo/trend-up.svg +1 -0
- package/svg/duo/truck.svg +1 -0
- package/svg/duo/umbrella.svg +1 -0
- package/svg/duo/undo.svg +1 -0
- package/svg/duo/unlock.svg +1 -0
- package/svg/duo/upload.svg +1 -0
- package/svg/duo/user.svg +1 -0
- package/svg/duo/users.svg +1 -0
- package/svg/duo/video.svg +1 -0
- package/svg/duo/wallet.svg +1 -0
- package/svg/duo/warning.svg +1 -0
- package/svg/duo/wifi.svg +1 -0
- package/svg/duo/wind.svg +1 -0
- package/svg/edit.svg +1 -0
- package/svg/error.svg +1 -0
- package/svg/euro.svg +1 -0
- package/svg/expand.svg +1 -0
- package/svg/external-link.svg +1 -0
- package/svg/eye-off.svg +1 -0
- package/svg/eye.svg +1 -0
- package/svg/file.svg +1 -0
- package/svg/filter.svg +1 -0
- package/svg/flag.svg +1 -0
- package/svg/flame.svg +1 -0
- package/svg/folder.svg +1 -0
- package/svg/fuel.svg +1 -0
- package/svg/gauge.svg +1 -0
- package/svg/globe.svg +1 -0
- package/svg/grid.svg +1 -0
- package/svg/heart.svg +1 -0
- package/svg/help.svg +1 -0
- package/svg/house.svg +1 -0
- package/svg/image.svg +1 -0
- package/svg/inbox.svg +1 -0
- package/svg/info.svg +1 -0
- package/svg/key.svg +1 -0
- package/svg/layers.svg +1 -0
- package/svg/leaf.svg +1 -0
- package/svg/link.svg +1 -0
- package/svg/list.svg +1 -0
- package/svg/loader.svg +1 -0
- package/svg/lock.svg +1 -0
- package/svg/login.svg +1 -0
- package/svg/logout.svg +1 -0
- package/svg/mail.svg +1 -0
- package/svg/map.svg +1 -0
- package/svg/megaphone.svg +1 -0
- package/svg/menu.svg +1 -0
- package/svg/mic.svg +1 -0
- package/svg/minus.svg +1 -0
- package/svg/moon.svg +1 -0
- package/svg/more.svg +1 -0
- package/svg/navigation.svg +1 -0
- package/svg/percent.svg +1 -0
- package/svg/phone.svg +1 -0
- package/svg/pin.svg +1 -0
- package/svg/plane.svg +1 -0
- package/svg/plug.svg +1 -0
- package/svg/plus.svg +1 -0
- package/svg/power.svg +1 -0
- package/svg/rain.svg +1 -0
- package/svg/receipt.svg +1 -0
- package/svg/redo.svg +1 -0
- package/svg/refresh.svg +1 -0
- package/svg/route.svg +1 -0
- package/svg/search.svg +1 -0
- package/svg/send.svg +1 -0
- package/svg/settings.svg +1 -0
- package/svg/share.svg +1 -0
- package/svg/shield-check.svg +1 -0
- package/svg/ship.svg +1 -0
- package/svg/sliders.svg +1 -0
- package/svg/snow.svg +1 -0
- package/svg/sort.svg +1 -0
- package/svg/spinner.svg +1 -0
- package/svg/star.svg +1 -0
- package/svg/store.svg +1 -0
- package/svg/success.svg +1 -0
- package/svg/sun.svg +1 -0
- package/svg/table.svg +1 -0
- package/svg/tag.svg +1 -0
- package/svg/target.svg +1 -0
- package/svg/thermometer.svg +1 -0
- package/svg/thunder.svg +1 -0
- package/svg/train.svg +1 -0
- package/svg/trash.svg +1 -0
- package/svg/trend-down.svg +1 -0
- package/svg/trend-up.svg +1 -0
- package/svg/truck.svg +1 -0
- package/svg/umbrella.svg +1 -0
- package/svg/undo.svg +1 -0
- package/svg/unlock.svg +1 -0
- package/svg/upload.svg +1 -0
- package/svg/user.svg +1 -0
- package/svg/users.svg +1 -0
- package/svg/video.svg +1 -0
- package/svg/wallet.svg +1 -0
- package/svg/warning.svg +1 -0
- package/svg/wifi.svg +1 -0
- package/svg/wind.svg +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const users = {
|
|
2
|
+
name: 'users',
|
|
3
|
+
category: 'ui',
|
|
4
|
+
tags: ['people', 'team', 'group'],
|
|
5
|
+
motion: 'bounce',
|
|
6
|
+
shapes: [
|
|
7
|
+
'*~o9 8.5 3.5',
|
|
8
|
+
'M2.8 20c.6-3.3 3-5.4 6.2-5.4s5.6 2.1 6.2 5.4',
|
|
9
|
+
'!~M15.2 5.3a3.5 3.5 0 0 1 0 6.4',
|
|
10
|
+
'!M17.6 14.9c2 .7 3.3 2.5 3.6 5.1',
|
|
11
|
+
],
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const warning = {
|
|
2
|
+
name: 'warning',
|
|
3
|
+
category: 'status',
|
|
4
|
+
tags: ['alert', 'caution', 'attention'],
|
|
5
|
+
motion: 'shake',
|
|
6
|
+
shapes: [
|
|
7
|
+
'*~M10.3 4.2a2 2 0 0 1 3.4 0l7.7 13.3a2 2 0 0 1-1.7 3H4.3a2 2 0 0 1-1.7-3z',
|
|
8
|
+
'!~M12 9.5V14',
|
|
9
|
+
'!#~o12 17 1.3',
|
|
10
|
+
],
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const wifi = {
|
|
2
|
+
name: 'wifi',
|
|
3
|
+
category: 'communication',
|
|
4
|
+
tags: ['wireless', 'network', 'signal', 'internet'],
|
|
5
|
+
motion: 'pop',
|
|
6
|
+
shapes: [
|
|
7
|
+
'!#^o12 19 1.3',
|
|
8
|
+
'^M8.5 15.5a5 5 0 0 1 7 0',
|
|
9
|
+
'^M5.5 12.3a9.3 9.3 0 0 1 13 0',
|
|
10
|
+
'^M2.5 9a13.8 13.8 0 0 1 19 0',
|
|
11
|
+
],
|
|
12
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type IconName } from './icons/index.ts';
|
|
2
|
+
import type { Category, IconDef, IconOptions } from './types.ts';
|
|
3
|
+
export { iconCss, injectStyles, play, reducedMotion, iconTree, toMarkup, ACCENT } from './core.ts';
|
|
4
|
+
export type { IconNode } from './core.ts';
|
|
5
|
+
export type * from './types.ts';
|
|
6
|
+
export * from './icons/index.ts';
|
|
7
|
+
/** The families, in the order of the documentation. */
|
|
8
|
+
export declare const categories: readonly {
|
|
9
|
+
readonly id: Category;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
}[];
|
|
12
|
+
/** The names of every icon, sorted. */
|
|
13
|
+
export declare const iconNames: IconName[];
|
|
14
|
+
/** An icon by its name, or the icon given. Throws on an unknown name. */
|
|
15
|
+
export declare function resolveIcon(name: IconName | IconDef): IconDef;
|
|
16
|
+
/** The icon as an `<svg>` element: `icon('bell', { animate: 'hover' })`. */
|
|
17
|
+
export declare const icon: (name: IconName | IconDef, options?: IconOptions, doc?: Document) => SVGSVGElement;
|
|
18
|
+
/** The icon as markup, for the server: `iconSvg('bell', { size: 20 })`. */
|
|
19
|
+
export declare const iconSvg: (name: IconName | IconDef, options?: IconOptions) => string;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { icon as iconOf, iconSvg as iconSvgOf } from "./core.js";
|
|
2
|
+
import { icons } from "./icons/index.js";
|
|
3
|
+
export { iconCss, injectStyles, play, reducedMotion, iconTree, toMarkup, ACCENT } from "./core.js";
|
|
4
|
+
export * from "./icons/index.js";
|
|
5
|
+
/** The families, in the order of the documentation. */
|
|
6
|
+
export const categories = [
|
|
7
|
+
{ id: 'ui', name: 'Interface' },
|
|
8
|
+
{ id: 'charts', name: 'Charts and data' },
|
|
9
|
+
{ id: 'business', name: 'Business and real estate' },
|
|
10
|
+
{ id: 'weather', name: 'Weather and energy' },
|
|
11
|
+
{ id: 'transport', name: 'Transport' },
|
|
12
|
+
{ id: 'communication', name: 'Communication' },
|
|
13
|
+
{ id: 'status', name: 'Status' },
|
|
14
|
+
];
|
|
15
|
+
/** The names of every icon, sorted. */
|
|
16
|
+
export const iconNames = Object.keys(icons);
|
|
17
|
+
/** An icon by its name, or the icon given. Throws on an unknown name. */
|
|
18
|
+
export function resolveIcon(name) {
|
|
19
|
+
if (typeof name !== 'string')
|
|
20
|
+
return name;
|
|
21
|
+
const def = icons[name];
|
|
22
|
+
if (!def)
|
|
23
|
+
throw new Error(`nervure icons: no icon named "${name}"`);
|
|
24
|
+
return def;
|
|
25
|
+
}
|
|
26
|
+
/** The icon as an `<svg>` element: `icon('bell', { animate: 'hover' })`. */
|
|
27
|
+
export const icon = (name, options, doc) => iconOf(resolveIcon(name), options, doc);
|
|
28
|
+
/** The icon as markup, for the server: `iconSvg('bell', { size: 20 })`. */
|
|
29
|
+
export const iconSvg = (name, options) => iconSvgOf(resolveIcon(name), options);
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactElement, type SVGProps } from 'react';
|
|
2
|
+
import type { IconName } from './icons/index.ts';
|
|
3
|
+
import type { IconDef, IconOptions } from './types.ts';
|
|
4
|
+
export type { IconName } from './icons/index.ts';
|
|
5
|
+
export type { IconDef, IconOptions, Trigger, Variant } from './types.ts';
|
|
6
|
+
export interface IconProps extends Omit<IconOptions, 'class' | 'css'>, Omit<SVGProps<SVGSVGElement>, keyof IconOptions | 'name' | 'ref'> {
|
|
7
|
+
name: IconName | IconDef;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/** `<Icon name="bell" animate="hover" />`. */
|
|
11
|
+
export declare function Icon(props: IconProps): ReactElement;
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createElement, useEffect } from 'react';
|
|
2
|
+
import { iconTree, injectStyles } from "./core.js";
|
|
3
|
+
import { resolveIcon } from "./index.js";
|
|
4
|
+
const RENAME = {
|
|
5
|
+
class: 'className',
|
|
6
|
+
'stroke-width': 'strokeWidth',
|
|
7
|
+
'stroke-linecap': 'strokeLinecap',
|
|
8
|
+
'stroke-linejoin': 'strokeLinejoin',
|
|
9
|
+
'fill-opacity': 'fillOpacity',
|
|
10
|
+
};
|
|
11
|
+
const styleObject = (style) => {
|
|
12
|
+
const out = {};
|
|
13
|
+
for (const part of style.split(';')) {
|
|
14
|
+
const at = part.indexOf(':');
|
|
15
|
+
if (at < 0)
|
|
16
|
+
continue;
|
|
17
|
+
const key = part.slice(0, at).trim();
|
|
18
|
+
out[key.startsWith('--') ? key : key.replace(/-(\w)/g, (_, c) => c.toUpperCase())] = part
|
|
19
|
+
.slice(at + 1)
|
|
20
|
+
.trim();
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
};
|
|
24
|
+
const toReact = (node, extra = {}) => {
|
|
25
|
+
const props = {};
|
|
26
|
+
for (const [k, v] of Object.entries(node.attrs)) {
|
|
27
|
+
if (k === 'xmlns')
|
|
28
|
+
continue;
|
|
29
|
+
props[RENAME[k] ?? k] = k === 'style' ? styleObject(v) : v;
|
|
30
|
+
}
|
|
31
|
+
Object.assign(props, extra);
|
|
32
|
+
const children = node.children.map((c) => (typeof c === 'string' ? c : toReact(c)));
|
|
33
|
+
return createElement(node.tag, props, ...children);
|
|
34
|
+
};
|
|
35
|
+
/** `<Icon name="bell" animate="hover" />`. */
|
|
36
|
+
export function Icon(props) {
|
|
37
|
+
const { name, size, color, accent, fill, variant, animate, strokeWidth, title, className, ...rest } = props;
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (animate && animate !== 'none')
|
|
40
|
+
injectStyles(document);
|
|
41
|
+
}, [animate]);
|
|
42
|
+
const tree = iconTree(resolveIcon(name), {
|
|
43
|
+
size,
|
|
44
|
+
color,
|
|
45
|
+
accent,
|
|
46
|
+
fill,
|
|
47
|
+
variant,
|
|
48
|
+
animate,
|
|
49
|
+
strokeWidth,
|
|
50
|
+
title,
|
|
51
|
+
class: className,
|
|
52
|
+
});
|
|
53
|
+
return toReact(tree, rest);
|
|
54
|
+
}
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IconDef, IconOptions } from './types.ts';
|
|
2
|
+
/** A node of the icon, written out as a string, DOM, React or Vue. */
|
|
3
|
+
export interface IconNode {
|
|
4
|
+
readonly tag: string;
|
|
5
|
+
readonly attrs: Readonly<Record<string, string>>;
|
|
6
|
+
readonly children: readonly (IconNode | string)[];
|
|
7
|
+
}
|
|
8
|
+
/** The nervure sap green: the accent when none is given. */
|
|
9
|
+
export declare const ACCENT = "#2a9d8f";
|
|
10
|
+
/** Same as `fixed`, for the static files: plain colours, no custom properties. */
|
|
11
|
+
export interface TreeMode {
|
|
12
|
+
readonly fixed?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Builds the tree of an icon. `animate` is the trigger already settled (reduced motion included). */
|
|
15
|
+
export declare function iconTree(def: IconDef, options?: IconOptions, mode?: TreeMode): IconNode;
|
|
16
|
+
/** Writes a tree as markup. */
|
|
17
|
+
export declare function toMarkup(node: IconNode | string): string;
|
|
18
|
+
/** Builds a tree as DOM nodes. */
|
|
19
|
+
export declare function toDom(node: IconNode, doc: Document): SVGElement;
|
package/dist/render.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { entering } from "./styles.js";
|
|
2
|
+
/** The nervure sap green: the accent when none is given. */
|
|
3
|
+
export const ACCENT = '#2a9d8f';
|
|
4
|
+
const accentVar = `var(--nv-icon-accent,${ACCENT})`;
|
|
5
|
+
const fillVar = `var(--nv-icon-fill,color-mix(in srgb,${accentVar} 28%,transparent))`;
|
|
6
|
+
const DIRS = {
|
|
7
|
+
u: [0, -1],
|
|
8
|
+
d: [0, 1],
|
|
9
|
+
l: [-1, 0],
|
|
10
|
+
r: [1, 0],
|
|
11
|
+
ur: [0.7, -0.7],
|
|
12
|
+
ul: [-0.7, -0.7],
|
|
13
|
+
dr: [0.7, 0.7],
|
|
14
|
+
dl: [-0.7, 0.7],
|
|
15
|
+
};
|
|
16
|
+
const FLAGS = '*!#%~^';
|
|
17
|
+
/** A colour given by the user goes in a style attribute: it may not close it. */
|
|
18
|
+
const safe = (value) => value.replace(/[;{}<>"\\]/g, '');
|
|
19
|
+
const shape = (spec) => {
|
|
20
|
+
let i = 0;
|
|
21
|
+
while (i < spec.length && FLAGS.includes(spec.charAt(i)))
|
|
22
|
+
i++;
|
|
23
|
+
const flags = spec.slice(0, i);
|
|
24
|
+
const body = spec.slice(i);
|
|
25
|
+
const kind = body.charAt(0);
|
|
26
|
+
const n = body
|
|
27
|
+
.slice(1)
|
|
28
|
+
.trim()
|
|
29
|
+
.split(/[\s,]+/);
|
|
30
|
+
if (kind === 'o')
|
|
31
|
+
return { flags, tag: 'circle', attrs: { cx: n[0], cy: n[1], r: n[2] } };
|
|
32
|
+
if (kind === 'e')
|
|
33
|
+
return { flags, tag: 'ellipse', attrs: { cx: n[0], cy: n[1], rx: n[2], ry: n[3] } };
|
|
34
|
+
if (kind === 'r') {
|
|
35
|
+
const attrs = { x: n[0], y: n[1], width: n[2], height: n[3] };
|
|
36
|
+
if (n[4])
|
|
37
|
+
attrs.rx = n[4];
|
|
38
|
+
return { flags, tag: 'rect', attrs };
|
|
39
|
+
}
|
|
40
|
+
return { flags, tag: 'path', attrs: { d: body } };
|
|
41
|
+
};
|
|
42
|
+
/** Builds the tree of an icon. `animate` is the trigger already settled (reduced motion included). */
|
|
43
|
+
export function iconTree(def, options = {}, mode = {}) {
|
|
44
|
+
const duo = options.variant === 'duo';
|
|
45
|
+
const animate = options.animate ?? 'none';
|
|
46
|
+
const live = animate !== 'none';
|
|
47
|
+
const enter = entering(def.motion);
|
|
48
|
+
const accent = mode.fixed ? ACCENT : accentVar;
|
|
49
|
+
const items = [];
|
|
50
|
+
let group = null;
|
|
51
|
+
let drawn = 0;
|
|
52
|
+
let solo = 0;
|
|
53
|
+
const moving = [];
|
|
54
|
+
const origin = def.origin
|
|
55
|
+
? def.origin
|
|
56
|
+
.split(/\s+/)
|
|
57
|
+
.map((v) => `${v}px`)
|
|
58
|
+
.join(' ')
|
|
59
|
+
: '';
|
|
60
|
+
const dir = def.dir ? DIRS[def.dir] : null;
|
|
61
|
+
const groupStyle = (n) => {
|
|
62
|
+
const parts = [];
|
|
63
|
+
if (origin)
|
|
64
|
+
parts.push(`transform-origin:${origin}`);
|
|
65
|
+
if (dir)
|
|
66
|
+
parts.push(`--dx:${dir[0]};--dy:${dir[1]}`);
|
|
67
|
+
if (n)
|
|
68
|
+
parts.push(`--n:${n}`);
|
|
69
|
+
return parts.join(';');
|
|
70
|
+
};
|
|
71
|
+
const groupNode = (children, n) => {
|
|
72
|
+
const attrs = { class: `nvi-m nvi-${def.motion}` };
|
|
73
|
+
const style = groupStyle(n);
|
|
74
|
+
if (style)
|
|
75
|
+
attrs.style = style;
|
|
76
|
+
return { tag: 'g', attrs, children };
|
|
77
|
+
};
|
|
78
|
+
for (const spec of def.shapes) {
|
|
79
|
+
const { flags, tag, attrs } = shape(spec);
|
|
80
|
+
const inGroup = flags.includes('~') || flags.includes('^');
|
|
81
|
+
const solid = flags.includes('#');
|
|
82
|
+
const accented = duo && flags.includes('!');
|
|
83
|
+
const style = [];
|
|
84
|
+
if (solid) {
|
|
85
|
+
attrs.stroke = 'none';
|
|
86
|
+
if (accented) {
|
|
87
|
+
if (mode.fixed)
|
|
88
|
+
attrs.fill = ACCENT;
|
|
89
|
+
else
|
|
90
|
+
style.push(`fill:${accent}`);
|
|
91
|
+
}
|
|
92
|
+
else
|
|
93
|
+
attrs.fill = 'currentColor';
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
if (duo && flags.includes('*')) {
|
|
97
|
+
if (mode.fixed) {
|
|
98
|
+
attrs.fill = ACCENT;
|
|
99
|
+
attrs['fill-opacity'] = '0.28';
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
style.push(`fill:${fillVar}`);
|
|
103
|
+
}
|
|
104
|
+
if (accented) {
|
|
105
|
+
if (mode.fixed)
|
|
106
|
+
attrs.stroke = ACCENT;
|
|
107
|
+
else
|
|
108
|
+
style.push(`stroke:${accent}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (flags.includes('%'))
|
|
112
|
+
attrs.opacity = '0.3';
|
|
113
|
+
if (live) {
|
|
114
|
+
const comesIn = inGroup && enter;
|
|
115
|
+
if (!solid && (!comesIn || def.motion === 'write'))
|
|
116
|
+
attrs.pathLength = '1';
|
|
117
|
+
if (!comesIn) {
|
|
118
|
+
attrs.class = solid ? 'nvi-p' : 'nvi-d';
|
|
119
|
+
const i = Math.min(drawn++, 8);
|
|
120
|
+
if (i)
|
|
121
|
+
style.push(`--i:${i}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (style.length)
|
|
125
|
+
attrs.style = style.join(';');
|
|
126
|
+
const node = { tag, attrs, children: [] };
|
|
127
|
+
if (!live || !inGroup) {
|
|
128
|
+
items.push(node);
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (flags.includes('^')) {
|
|
132
|
+
items.push(groupNode([node], ++solo));
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (!group) {
|
|
136
|
+
group = moving;
|
|
137
|
+
items.push(groupNode(moving, 0));
|
|
138
|
+
}
|
|
139
|
+
group.push(node);
|
|
140
|
+
}
|
|
141
|
+
const svgClass = ['nvi', `nvi-${def.name}`];
|
|
142
|
+
if (live && def.motion === 'draw')
|
|
143
|
+
svgClass.push('nvi-x');
|
|
144
|
+
if (options.class)
|
|
145
|
+
svgClass.push(safe(options.class));
|
|
146
|
+
const size = options.size ?? 24;
|
|
147
|
+
const attrs = {
|
|
148
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
149
|
+
width: String(size),
|
|
150
|
+
height: String(size),
|
|
151
|
+
viewBox: '0 0 24 24',
|
|
152
|
+
fill: 'none',
|
|
153
|
+
stroke: 'currentColor',
|
|
154
|
+
'stroke-width': String(options.strokeWidth ?? 2),
|
|
155
|
+
'stroke-linecap': 'round',
|
|
156
|
+
'stroke-linejoin': 'round',
|
|
157
|
+
class: svgClass.join(' '),
|
|
158
|
+
};
|
|
159
|
+
if (live) {
|
|
160
|
+
attrs['data-animate'] = animate;
|
|
161
|
+
attrs.overflow = 'visible';
|
|
162
|
+
}
|
|
163
|
+
if (duo)
|
|
164
|
+
attrs['data-variant'] = 'duo';
|
|
165
|
+
const style = [];
|
|
166
|
+
if (options.color)
|
|
167
|
+
style.push(`color:${safe(options.color)}`);
|
|
168
|
+
if (options.accent)
|
|
169
|
+
style.push(`--nv-icon-accent:${safe(options.accent)}`);
|
|
170
|
+
if (options.fill)
|
|
171
|
+
style.push(`--nv-icon-fill:${safe(options.fill)}`);
|
|
172
|
+
if (live && (animate === 'load' || animate === 'loop'))
|
|
173
|
+
style.push(`--nvi-w:${enter ? 250 : Math.min(drawn, 8) * 60 + 450}ms`);
|
|
174
|
+
if (style.length)
|
|
175
|
+
attrs.style = style.join(';');
|
|
176
|
+
const children = [];
|
|
177
|
+
if (options.title) {
|
|
178
|
+
attrs.role = 'img';
|
|
179
|
+
attrs['aria-label'] = options.title;
|
|
180
|
+
children.push({ tag: 'title', attrs: {}, children: [options.title] });
|
|
181
|
+
}
|
|
182
|
+
else
|
|
183
|
+
attrs['aria-hidden'] = 'true';
|
|
184
|
+
if (!live)
|
|
185
|
+
attrs.focusable = 'false';
|
|
186
|
+
return { tag: 'svg', attrs, children: [...children, ...items] };
|
|
187
|
+
}
|
|
188
|
+
const escape = (value) => value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
189
|
+
/** Writes a tree as markup. */
|
|
190
|
+
export function toMarkup(node) {
|
|
191
|
+
if (typeof node === 'string')
|
|
192
|
+
return escape(node);
|
|
193
|
+
const attrs = Object.entries(node.attrs)
|
|
194
|
+
.map(([k, v]) => ` ${k}="${escape(v)}"`)
|
|
195
|
+
.join('');
|
|
196
|
+
return `<${node.tag}${attrs}>${node.children.map(toMarkup).join('')}</${node.tag}>`;
|
|
197
|
+
}
|
|
198
|
+
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
199
|
+
/** Builds a tree as DOM nodes. */
|
|
200
|
+
export function toDom(node, doc) {
|
|
201
|
+
const el = doc.createElementNS(SVG_NS, node.tag);
|
|
202
|
+
for (const [k, v] of Object.entries(node.attrs))
|
|
203
|
+
if (k !== 'xmlns')
|
|
204
|
+
el.setAttribute(k, v);
|
|
205
|
+
for (const child of node.children)
|
|
206
|
+
el.append(typeof child === 'string' ? doc.createTextNode(child) : toDom(child, doc));
|
|
207
|
+
return el;
|
|
208
|
+
}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Motion } from './types.ts';
|
|
2
|
+
interface MotionSpec {
|
|
3
|
+
/** Keyframes, in percents only, ending on the resting state. */
|
|
4
|
+
readonly k: string;
|
|
5
|
+
/** Duration, ms. */
|
|
6
|
+
readonly t: number;
|
|
7
|
+
/** Turns around the box of the moving shape (`fill-box`) instead of a point of the grid. */
|
|
8
|
+
readonly box?: string;
|
|
9
|
+
/** Starts hidden: the moving shapes are not drawn in, they come in. */
|
|
10
|
+
readonly enter?: true;
|
|
11
|
+
/** Loops without a pause, at a steady speed. */
|
|
12
|
+
readonly steady?: true;
|
|
13
|
+
/** Default values of the custom properties it reads. */
|
|
14
|
+
readonly vars?: string;
|
|
15
|
+
}
|
|
16
|
+
/** The motions, by name. Every one ends where it started: the resting icon is the last frame. */
|
|
17
|
+
export declare const MOTIONS: Readonly<Record<Exclude<Motion, 'draw' | 'write'>, MotionSpec>>;
|
|
18
|
+
/** Motions whose shapes come in rather than move: they are not drawn in first. */
|
|
19
|
+
export declare const entering: (motion: Motion) => boolean;
|
|
20
|
+
/** The stylesheet of the animations: added once per document by `icon()`, or by hand with `iconSvg()`. */
|
|
21
|
+
export declare const iconCss: string;
|
|
22
|
+
export {};
|
package/dist/styles.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const N = 'transform:none';
|
|
2
|
+
/** The motions, by name. Every one ends where it started: the resting icon is the last frame. */
|
|
3
|
+
export const MOTIONS = {
|
|
4
|
+
ring: {
|
|
5
|
+
k: `0%,100%{${N}}10%{transform:rotate(14deg)}25%{transform:rotate(-12deg)}40%{transform:rotate(8deg)}55%{transform:rotate(-5deg)}70%{transform:rotate(2deg)}`,
|
|
6
|
+
t: 1000,
|
|
7
|
+
},
|
|
8
|
+
beat: {
|
|
9
|
+
k: `0%,100%{${N}}15%{transform:scale(1.16)}30%{transform:scale(.96)}45%{transform:scale(1.1)}65%{${N}}`,
|
|
10
|
+
t: 900,
|
|
11
|
+
box: '50% 55%',
|
|
12
|
+
},
|
|
13
|
+
spin: { k: `0%{${N}}100%{transform:rotate(360deg)}`, t: 1000, steady: true },
|
|
14
|
+
drop: {
|
|
15
|
+
k: `0%{transform:translateY(-6px);opacity:0}40%{opacity:1}62%{transform:translateY(1.2px)}80%{transform:translateY(-.4px)}100%{${N}}`,
|
|
16
|
+
t: 750,
|
|
17
|
+
enter: true,
|
|
18
|
+
},
|
|
19
|
+
rise: {
|
|
20
|
+
k: `0%{transform:translateY(6px);opacity:0}40%{opacity:1}62%{transform:translateY(-1.2px)}80%{transform:translateY(.4px)}100%{${N}}`,
|
|
21
|
+
t: 750,
|
|
22
|
+
enter: true,
|
|
23
|
+
},
|
|
24
|
+
grow: { k: `0%{transform:scaleY(0)}70%{transform:scaleY(1.08)}100%{${N}}`, t: 650, box: '50% 100%', enter: true },
|
|
25
|
+
fall: { k: `0%{transform:translateY(-4px);opacity:0}50%{opacity:1}100%{${N}}`, t: 650, enter: true },
|
|
26
|
+
flow: { k: `0%{transform:translateX(-5px);opacity:0}60%{opacity:1}100%{${N}}`, t: 700, enter: true },
|
|
27
|
+
fill: { k: `0%{transform:scaleX(0)}100%{${N}}`, t: 900, box: '0 50%', enter: true },
|
|
28
|
+
scan: {
|
|
29
|
+
k: `0%,100%{${N}}25%{transform:translate(-2px,-1.5px)}60%{transform:translate(2px,1px)}`,
|
|
30
|
+
t: 1100,
|
|
31
|
+
},
|
|
32
|
+
pulse: { k: `0%,100%{${N};opacity:1}40%{transform:scale(1.18);opacity:.75}`, t: 750, box: '50% 50%' },
|
|
33
|
+
swing: {
|
|
34
|
+
k: `0%,100%{${N}}20%{transform:rotate(-11deg)}45%{transform:rotate(8deg)}70%{transform:rotate(-3deg)}`,
|
|
35
|
+
t: 1000,
|
|
36
|
+
},
|
|
37
|
+
shake: {
|
|
38
|
+
k: `0%,100%{${N}}15%,55%{transform:translateX(-1.5px)}35%,75%{transform:translateX(1.5px)}`,
|
|
39
|
+
t: 600,
|
|
40
|
+
},
|
|
41
|
+
blink: { k: `0%,100%{${N}}35%,50%{transform:scaleY(.08)}`, t: 600 },
|
|
42
|
+
float: {
|
|
43
|
+
k: `0%,100%{${N}}35%{transform:translate(1.5px,-1px)}70%{transform:translate(-1px,.5px)}`,
|
|
44
|
+
t: 1600,
|
|
45
|
+
},
|
|
46
|
+
flicker: {
|
|
47
|
+
k: `0%,100%{${N}}20%{transform:scale(.93,1.08)}45%{transform:scale(1.05,.95)}70%{transform:scale(.97,1.04)}`,
|
|
48
|
+
t: 1000,
|
|
49
|
+
box: '50% 100%',
|
|
50
|
+
},
|
|
51
|
+
flash: { k: `0%,100%{opacity:1}15%,45%{opacity:.15}30%{opacity:1}`, t: 800 },
|
|
52
|
+
flip: { k: `0%,100%{${N}}25%,75%{transform:scaleX(.08)}50%{transform:scaleX(-1)}`, t: 1000, box: '50% 50%' },
|
|
53
|
+
send: {
|
|
54
|
+
k: `0%,100%{${N};opacity:1}40%{transform:translate(calc(var(--dx)*7px),calc(var(--dy)*7px));opacity:0}41%{transform:translate(calc(var(--dx)*-7px),calc(var(--dy)*-7px));opacity:0}`,
|
|
55
|
+
t: 950,
|
|
56
|
+
vars: '--dx:1;--dy:-1;',
|
|
57
|
+
},
|
|
58
|
+
nudge: {
|
|
59
|
+
k: `0%,100%{${N}}40%{transform:translate(calc(var(--dx)*3px),calc(var(--dy)*3px))}`,
|
|
60
|
+
t: 650,
|
|
61
|
+
vars: '--dx:1;--dy:0;',
|
|
62
|
+
},
|
|
63
|
+
pop: {
|
|
64
|
+
k: `0%{transform:scale(0);opacity:0}60%{transform:scale(1.18);opacity:1}100%{${N}}`,
|
|
65
|
+
t: 520,
|
|
66
|
+
box: '50% 50%',
|
|
67
|
+
enter: true,
|
|
68
|
+
},
|
|
69
|
+
bounce: {
|
|
70
|
+
k: `0%,100%{${N}}30%{transform:translateY(-3.5px)}55%{${N}}72%{transform:translateY(-1.2px)}`,
|
|
71
|
+
t: 900,
|
|
72
|
+
},
|
|
73
|
+
tilt: { k: `0%,100%{${N}}35%,65%{transform:rotate(var(--r,-30deg))}`, t: 1100 },
|
|
74
|
+
lid: { k: `0%,100%{${N}}30%,60%{transform:translateY(-1.5px) rotate(-14deg)}`, t: 950 },
|
|
75
|
+
};
|
|
76
|
+
/** Motions whose shapes come in rather than move: they are not drawn in first. */
|
|
77
|
+
export const entering = (motion) => motion === 'write' || (motion !== 'draw' && MOTIONS[motion].enter === true);
|
|
78
|
+
const EASE = 'cubic-bezier(.34,.7,.3,1)';
|
|
79
|
+
/** A loop plays the motion in the first 60 % and rests for the rest. */
|
|
80
|
+
const REST = 0.6;
|
|
81
|
+
const squeeze = (k) => k.replace(/(\d+(?:\.\d+)?)%/g, (_, p) => `${Math.round(Number(p) * REST * 10) / 10}%`);
|
|
82
|
+
const LOAD = '.nvi[data-animate=load]';
|
|
83
|
+
const LOOP = '.nvi[data-animate=loop]';
|
|
84
|
+
const HOVER = ['.nvi[data-animate=hover]:hover', '.nv-icon-trigger:hover .nvi[data-animate=hover]'];
|
|
85
|
+
const CLICK = '.nvi.nvi-on[data-animate=click]';
|
|
86
|
+
const ON = [...HOVER, CLICK];
|
|
87
|
+
const all = (prefixes, child) => prefixes.map((p) => `${p} ${child}`).join(',');
|
|
88
|
+
const DRAW = `@keyframes nvi-draw{0%{stroke-dasharray:1 2;stroke-dashoffset:1.001;fill-opacity:0;stroke-opacity:0}10%{stroke-opacity:1}55%{fill-opacity:0}100%{stroke-dasharray:1 2;stroke-dashoffset:0;fill-opacity:1}}@keyframes nvi-draw-l{0%{stroke-dasharray:1 2;stroke-dashoffset:1.001;fill-opacity:0;stroke-opacity:0;opacity:1}4%{stroke-opacity:1}30%{stroke-dasharray:1 2;stroke-dashoffset:0;fill-opacity:1}88%{opacity:1}100%{opacity:0}}@keyframes nvi-dot{0%{transform:scale(0);opacity:0}100%{${N}}}`;
|
|
89
|
+
const build = () => {
|
|
90
|
+
const rules = [
|
|
91
|
+
'nv-icon{display:inline-block;line-height:0;vertical-align:middle}',
|
|
92
|
+
'.nvi{flex-shrink:0}',
|
|
93
|
+
'.nvi-m{transform-box:view-box;transform-origin:12px 12px}',
|
|
94
|
+
'.nvi-p{transform-box:fill-box;transform-origin:50% 50%}',
|
|
95
|
+
DRAW,
|
|
96
|
+
// Draw in, on load and at the start of a loop
|
|
97
|
+
`${all([LOAD, LOOP], '.nvi-d')}{animation:nvi-draw .7s cubic-bezier(.45,0,.2,1) calc(var(--i,0)*60ms) backwards}`,
|
|
98
|
+
`${all([LOAD, LOOP], '.nvi-p')}{animation:nvi-dot .4s ${EASE} calc(var(--i,0)*60ms + .25s) backwards}`,
|
|
99
|
+
// Icons whose motion is the drawing itself draw again on hover and click, and draw in loop
|
|
100
|
+
`${all(ON.map((s) => s.replace('.nvi', '.nvi.nvi-x')), '.nvi-d')}{animation:nvi-draw .7s cubic-bezier(.45,0,.2,1) calc(var(--i,0)*60ms) backwards}`,
|
|
101
|
+
`.nvi.nvi-x[data-animate=loop] .nvi-d{animation:nvi-draw-l 2.6s cubic-bezier(.45,0,.2,1) calc(var(--i,0)*60ms) infinite backwards}`,
|
|
102
|
+
// `write`: the marked strokes draw again
|
|
103
|
+
`${all([LOAD], '.nvi-write>*')}{animation:nvi-draw .8s cubic-bezier(.45,0,.2,1) calc(var(--nvi-w,0s) + var(--n,0)*110ms) backwards}`,
|
|
104
|
+
`${all(ON, '.nvi-write>*')}{animation:nvi-draw .8s cubic-bezier(.45,0,.2,1) calc(var(--n,0)*110ms) backwards}`,
|
|
105
|
+
`${LOOP} .nvi-write>*{animation:nvi-draw-l 2.6s cubic-bezier(.45,0,.2,1) calc(var(--nvi-w,0s) + var(--n,0)*110ms) infinite backwards}`,
|
|
106
|
+
];
|
|
107
|
+
for (const [name, m] of Object.entries(MOTIONS)) {
|
|
108
|
+
rules.push(`@keyframes nvi-${name}{${m.k}}`);
|
|
109
|
+
if (!m.steady)
|
|
110
|
+
rules.push(`@keyframes nvi-${name}-l{${squeeze(m.k)}}`);
|
|
111
|
+
const box = m.box ? `transform-box:fill-box;transform-origin:${m.box};` : '';
|
|
112
|
+
const loop = m.steady ? `nvi-${name} ${m.t * 1.2}ms linear` : `nvi-${name}-l ${Math.round(m.t / REST)}ms ${EASE}`;
|
|
113
|
+
const fill = m.enter ? 'both' : 'none';
|
|
114
|
+
rules.push(`.nvi-${name}{${box}${m.vars ?? ''}--nvi-k:nvi-${name};--nvi-t:${m.t}ms;--nvi-l:${loop};--nvi-f:${fill}}`);
|
|
115
|
+
}
|
|
116
|
+
rules.push(`${all([LOAD], '.nvi-m')}{animation:var(--nvi-k) var(--nvi-t) ${EASE} calc(var(--nvi-w,0s) + var(--n,0)*110ms) var(--nvi-f)}`, `${all(ON, '.nvi-m')}{animation:var(--nvi-k) var(--nvi-t) ${EASE} calc(var(--n,0)*110ms) var(--nvi-f)}`, `${LOOP} .nvi-m{animation:var(--nvi-l) calc(var(--nvi-w,0s) + var(--n,0)*110ms) infinite var(--nvi-f)}`,
|
|
117
|
+
// `write` moves its strokes, not its group
|
|
118
|
+
'.nvi .nvi-write{animation:none!important}',
|
|
119
|
+
// Readers who ask for less motion get the finished icon, at once
|
|
120
|
+
'@media (prefers-reduced-motion:reduce){.nvi,.nvi *{animation:none!important}}');
|
|
121
|
+
return rules.join('');
|
|
122
|
+
};
|
|
123
|
+
/** The stylesheet of the animations: added once per document by `icon()`, or by hand with `iconSvg()`. */
|
|
124
|
+
export const iconCss = build();
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** The families the icons are sorted in. */
|
|
2
|
+
export type Category = 'ui' | 'charts' | 'business' | 'weather' | 'transport' | 'communication' | 'status';
|
|
3
|
+
/**
|
|
4
|
+
* The motion an icon plays after it is drawn, or on hover, click or loop.
|
|
5
|
+
* `draw` redraws the whole icon; `write` redraws only its marked strokes.
|
|
6
|
+
*/
|
|
7
|
+
export type Motion = 'draw' | 'write' | 'ring' | 'beat' | 'spin' | 'drop' | 'rise' | 'grow' | 'fall' | 'flow' | 'fill' | 'scan' | 'pulse' | 'swing' | 'shake' | 'blink' | 'float' | 'flicker' | 'flash' | 'flip' | 'send' | 'nudge' | 'pop' | 'bounce' | 'tilt' | 'lid';
|
|
8
|
+
/** Direction of `nudge` and `send`. */
|
|
9
|
+
export type Direction = 'u' | 'd' | 'l' | 'r' | 'ur' | 'ul' | 'dr' | 'dl';
|
|
10
|
+
/**
|
|
11
|
+
* One icon, drawn on a 24 x 24 grid.
|
|
12
|
+
*
|
|
13
|
+
* Each shape is a string: optional flags, then a path (`M...`), a circle (`o cx cy r`),
|
|
14
|
+
* a rectangle (`r x y width height radius`) or an ellipse (`e cx cy rx ry`).
|
|
15
|
+
*
|
|
16
|
+
* Flags: `*` area filled in the duo colouring, `!` accent stroke in the duo colouring,
|
|
17
|
+
* `#` solid shape (no stroke), `%` faint shape, `~` part of the moving group,
|
|
18
|
+
* `^` moves on its own, one after the other.
|
|
19
|
+
*/
|
|
20
|
+
export interface IconDef {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly category: Category;
|
|
23
|
+
readonly tags: readonly string[];
|
|
24
|
+
readonly motion: Motion;
|
|
25
|
+
/** Pivot of the motion, in grid units ("12 3"). Defaults to the centre. */
|
|
26
|
+
readonly origin?: string;
|
|
27
|
+
readonly dir?: Direction;
|
|
28
|
+
readonly shapes: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/** `mono`: one colour, `currentColor`. `duo`: areas tinted and marks in the accent colour. */
|
|
31
|
+
export type Variant = 'mono' | 'duo';
|
|
32
|
+
/** When the icon moves. */
|
|
33
|
+
export type Trigger = 'none' | 'load' | 'hover' | 'loop' | 'click';
|
|
34
|
+
export interface IconOptions {
|
|
35
|
+
/** Width and height: a number of pixels or a CSS length. Default 24. */
|
|
36
|
+
size?: number | string;
|
|
37
|
+
/** Stroke colour (CSS `color`). Default `currentColor`. */
|
|
38
|
+
color?: string;
|
|
39
|
+
/** Accent colour of the duo colouring (`--nv-icon-accent`). */
|
|
40
|
+
accent?: string;
|
|
41
|
+
/** Fill of the areas in the duo colouring (`--nv-icon-fill`). */
|
|
42
|
+
fill?: string;
|
|
43
|
+
/** Default `mono`. */
|
|
44
|
+
variant?: Variant;
|
|
45
|
+
/** Default `none`. */
|
|
46
|
+
animate?: Trigger;
|
|
47
|
+
/** In grid units. Default 2. */
|
|
48
|
+
strokeWidth?: number;
|
|
49
|
+
/** Accessible name. Without it the icon is decorative (`aria-hidden`). */
|
|
50
|
+
title?: string;
|
|
51
|
+
/** Extra classes on the `<svg>`. */
|
|
52
|
+
class?: string;
|
|
53
|
+
/** `iconSvg` only: add the animation stylesheet inside the `<svg>`. Default false. */
|
|
54
|
+
css?: boolean;
|
|
55
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|