Skip to content

Commit

Permalink
Add type export of all icon names (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph authored Feb 2, 2023
1 parent 1475c1e commit 89155c1
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 1 deletion.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
150 changes: 150 additions & 0 deletions icons/icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
export type IconName =
| 'access-16'
| 'access-24'
| 'action-16'
| 'action-24'
| 'add-12'
| 'add-roundel-12'
| 'add-roundel-16'
| 'add-roundel-24'
| 'calendar-16'
| 'calendar-24'
| 'carat-down'
| 'carat-left'
| 'carat-right'
| 'carat-up'
| 'chat-16'
| 'chat-24'
| 'checkmark-12'
| 'clipboard-16'
| 'clipboard-24'
| 'close-12'
| 'close-16'
| 'close-8'
| 'cloud-16'
| 'cloud-24'
| 'compability-16'
| 'compatibility-24'
| 'contrast-16'
| 'contrast-24'
| 'cpu-16'
| 'cpu-24'
| 'cpu-large'
| 'cpu-small'
| 'delete-16'
| 'disabled-12'
| 'disk-large'
| 'disk-small'
| 'dislike-16'
| 'distro-alpine'
| 'distro-arch'
| 'distro-centos'
| 'distro-debian'
| 'distro-fedora'
| 'distro-freebsd'
| 'distro-ubuntu'
| 'distro-windows'
| 'document-16'
| 'document-24'
| 'dots-16'
| 'download-roundel-16'
| 'edit-16'
| 'email-16'
| 'error-12'
| 'error-16'
| 'filter-12'
| 'firewall-16'
| 'firewall-24'
| 'folder-16'
| 'folder-24'
| 'gateway-16'
| 'gateway-24'
| 'health-16'
| 'heart-24'
| 'help-16'
| 'hide-16'
| 'hourglass-16'
| 'hourglass-24'
| 'images-16'
| 'images-24'
| 'info-16'
| 'instances-16'
| 'instances-24'
| 'integration-16'
| 'ip-global-16'
| 'ip-global-24'
| 'ip-local-16'
| 'ip-local-24'
| 'issues-16'
| 'issues-24'
| 'key-12'
| 'key-16'
| 'key-24'
| 'like-16'
| 'link-16'
| 'load-balancer-16'
| 'load-balancer-24'
| 'loader-12'
| 'location-24'
| 'logs-16'
| 'logs-24'
| 'metrics-16'
| 'more-12'
| 'networking-16'
| 'networking-24'
| 'new-window-16'
| 'next-arrow-12'
| 'notifications-16'
| 'open-link-12'
| 'organization-16'
| 'organization-24'
| 'overview-16'
| 'overview-24'
| 'person-16'
| 'person-24'
| 'person-group-16'
| 'person-group-24'
| 'prev-arrow-12'
| 'profile-16'
| 'progress-24'
| 'prohibited-24'
| 'question-12'
| 'racks-24'
| 'ram-large'
| 'ram-small'
| 'refresh-16'
| 'repair-12'
| 'repair-16'
| 'resize-16'
| 'resize-24'
| 'router-16'
| 'router-24'
| 'safety-24'
| 'search-16'
| 'security-12'
| 'security-16'
| 'security-24'
| 'select-arrows-6'
| 'servers-16'
| 'settings-16'
| 'settings-24'
| 'show-16'
| 'snapshots-16'
| 'snapshots-24'
| 'software-update-16'
| 'software-update-24'
| 'speaker-24'
| 'storage-16'
| 'storage-24'
| 'subnet-16'
| 'subnet-24'
| 'success-12'
| 'tags-16'
| 'terminal-16'
| 'terminal-24'
| 'time-16'
| 'transmit-24'
| 'unauthorized-12'
| 'unread-indicator-6'
| 'warning-12'
| 'wireless-24'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"files": [
"styles/dist/*.css",
"styles/dist/tailwind-tokens.js",
"icons/**.svg"
"icons/**"
],
"repository": {
"type": "git",
Expand Down
9 changes: 9 additions & 0 deletions scripts/export-icons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ npx figma-export use-config
# Replace fills with current color
sed -i 's/fill=".*"/fill="currentColor"/g' icons/*

# Export icons type file
touch icons/icons.ts
echo "export type IconName =" > icons/icons.ts
for icon in icons/*.svg; do
echo "| \"${icon}\"" >> icons/icons.ts
done

sed -E -i 's|icons/(..*)\.svg|\1|g' icons/icons.ts

npm run fmt .

0 comments on commit 89155c1

Please sign in to comment.