Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type export of all icon names #25

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so prettier doesn't keep autoformatting the changelog.

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 .