diff --git a/packages/beeq/project.json b/packages/beeq/project.json index 0b7a02f21..bd9f9e17a 100644 --- a/packages/beeq/project.json +++ b/packages/beeq/project.json @@ -120,15 +120,12 @@ }, "icons": { "executor": "@beeq/tools:icons", - "outputs": ["{options.downloadPath}", "{options.extractToPath}", "{options.outputDir}"], + "outputs": ["{options.downloadPath}", "{options.extractToPath}"], "options": { "assetsFolder": "assets", "downloadPath": "tmp", "extractToPath": "packages/beeq/src/components/icon/svg", "fileName": "main.zip", - "helperFile": "icons-set.ts", - "outputDir": "packages/beeq/src/components/icon/helper", - "sourceDir": "packages/beeq/src/components/icon/svg/regular", "svgFolder": "core-main", "sourceUrl": "https://github.com/phosphor-icons/core/archive/refs/heads" } diff --git a/packages/beeq/src/components/icon/_storybook/bq-icon.stories.tsx b/packages/beeq/src/components/icon/_storybook/bq-icon.stories.tsx index b779673f2..9dd8be3aa 100644 --- a/packages/beeq/src/components/icon/_storybook/bq-icon.stories.tsx +++ b/packages/beeq/src/components/icon/_storybook/bq-icon.stories.tsx @@ -1,12 +1,9 @@ import type { Args, Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit-html'; import { ifDefined } from 'lit-html/directives/if-defined.js'; -import { repeat } from 'lit-html/directives/repeat.js'; import mdx from './bq-icon.mdx'; -import { getRandomFromArray } from '../../../shared/utils'; import { ICON_WEIGHT } from '../bq-icon.types'; -import { ICONS_SET } from '../helper/icons-set'; const meta: Meta = { title: 'Components/Icon', @@ -21,7 +18,7 @@ const meta: Meta = { icons: { table: { disable: true } }, color: { control: 'text' }, label: { control: 'text' }, - name: { control: 'select', options: [...ICONS_SET] }, + name: { control: 'text' }, size: { control: 'number' }, src: { control: 'text' }, weight: { control: 'select', options: [...ICON_WEIGHT] }, @@ -66,15 +63,15 @@ export const Custom: Story = { }; export const ExploreIcons: Story = { - render: (args: Args) => html` + render: () => html` -
+

We didn't reinvent the wheel

-

+

BEEQ icons are based on

- + Explore all the icons available - + -
- ${repeat( - getRandomFromArray(args.icons, 36), - (icon) => icon, - (icon) => html` -
-
- ${Template({ ...args, name: icon })} -
- ${icon} -
- `, - )} -
`, - args: { - icons: ICONS_SET, - }, parameters: { chromatic: { disableSnapshot: true }, }, diff --git a/packages/beeq/src/components/icon/helper/icons-set.ts b/packages/beeq/src/components/icon/helper/icons-set.ts deleted file mode 100644 index 655b60225..000000000 --- a/packages/beeq/src/components/icon/helper/icons-set.ts +++ /dev/null @@ -1,1258 +0,0 @@ -/** - * ❗️❗️ This file gets autogenerated from the command line by running: - * "npx nx run beeq:icons" - * - * ❌ Please do not modify it manually, always use "npx nx run bee-q:generateIcons" - * and commit any change resulted after running the build command. - */ - -export const ICONS_SET = [ - 'address-book', - 'air-traffic-control', - 'airplane-in-flight', - 'airplane-landing', - 'airplane-takeoff', - 'airplane-tilt', - 'airplane', - 'airplay', - 'alarm', - 'alien', - 'align-bottom-simple', - 'align-bottom', - 'align-center-horizontal-simple', - 'align-center-horizontal', - 'align-center-vertical-simple', - 'align-center-vertical', - 'align-left-simple', - 'align-left', - 'align-right-simple', - 'align-right', - 'align-top-simple', - 'align-top', - 'amazon-logo', - 'anchor-simple', - 'anchor', - 'android-logo', - 'angular-logo', - 'aperture', - 'app-store-logo', - 'app-window', - 'apple-logo', - 'apple-podcasts-logo', - 'archive-box', - 'archive-tray', - 'archive', - 'armchair', - 'arrow-arc-left', - 'arrow-arc-right', - 'arrow-bend-double-up-left', - 'arrow-bend-double-up-right', - 'arrow-bend-down-left', - 'arrow-bend-down-right', - 'arrow-bend-left-down', - 'arrow-bend-left-up', - 'arrow-bend-right-down', - 'arrow-bend-right-up', - 'arrow-bend-up-left', - 'arrow-bend-up-right', - 'arrow-circle-down-left', - 'arrow-circle-down-right', - 'arrow-circle-down', - 'arrow-circle-left', - 'arrow-circle-right', - 'arrow-circle-up-left', - 'arrow-circle-up-right', - 'arrow-circle-up', - 'arrow-clockwise', - 'arrow-counter-clockwise', - 'arrow-down-left', - 'arrow-down-right', - 'arrow-down', - 'arrow-elbow-down-left', - 'arrow-elbow-down-right', - 'arrow-elbow-left-down', - 'arrow-elbow-left-up', - 'arrow-elbow-left', - 'arrow-elbow-right-down', - 'arrow-elbow-right-up', - 'arrow-elbow-right', - 'arrow-elbow-up-left', - 'arrow-elbow-up-right', - 'arrow-fat-down', - 'arrow-fat-left', - 'arrow-fat-line-down', - 'arrow-fat-line-left', - 'arrow-fat-line-right', - 'arrow-fat-line-up', - 'arrow-fat-lines-down', - 'arrow-fat-lines-left', - 'arrow-fat-lines-right', - 'arrow-fat-lines-up', - 'arrow-fat-right', - 'arrow-fat-up', - 'arrow-left', - 'arrow-line-down-left', - 'arrow-line-down-right', - 'arrow-line-down', - 'arrow-line-left', - 'arrow-line-right', - 'arrow-line-up-left', - 'arrow-line-up-right', - 'arrow-line-up', - 'arrow-right', - 'arrow-square-down-left', - 'arrow-square-down-right', - 'arrow-square-down', - 'arrow-square-in', - 'arrow-square-left', - 'arrow-square-out', - 'arrow-square-right', - 'arrow-square-up-left', - 'arrow-square-up-right', - 'arrow-square-up', - 'arrow-u-down-left', - 'arrow-u-down-right', - 'arrow-u-left-down', - 'arrow-u-left-up', - 'arrow-u-right-down', - 'arrow-u-right-up', - 'arrow-u-up-left', - 'arrow-u-up-right', - 'arrow-up-left', - 'arrow-up-right', - 'arrow-up', - 'arrows-clockwise', - 'arrows-counter-clockwise', - 'arrows-down-up', - 'arrows-horizontal', - 'arrows-in-cardinal', - 'arrows-in-line-horizontal', - 'arrows-in-line-vertical', - 'arrows-in-simple', - 'arrows-in', - 'arrows-left-right', - 'arrows-merge', - 'arrows-out-cardinal', - 'arrows-out-line-horizontal', - 'arrows-out-line-vertical', - 'arrows-out-simple', - 'arrows-out', - 'arrows-split', - 'arrows-vertical', - 'article-medium', - 'article-ny-times', - 'article', - 'asterisk-simple', - 'asterisk', - 'at', - 'atom', - 'baby', - 'backpack', - 'backspace', - 'bag-simple', - 'bag', - 'balloon', - 'bandaids', - 'bank', - 'barbell', - 'barcode', - 'barricade', - 'baseball-cap', - 'baseball', - 'basket', - 'basketball', - 'bathtub', - 'battery-charging-vertical', - 'battery-charging', - 'battery-empty', - 'battery-full', - 'battery-high', - 'battery-low', - 'battery-medium', - 'battery-plus-vertical', - 'battery-plus', - 'battery-vertical-empty', - 'battery-vertical-full', - 'battery-vertical-high', - 'battery-vertical-low', - 'battery-vertical-medium', - 'battery-warning-vertical', - 'battery-warning', - 'bed', - 'beer-bottle', - 'beer-stein', - 'behance-logo', - 'bell-ringing', - 'bell-simple-ringing', - 'bell-simple-slash', - 'bell-simple-z', - 'bell-simple', - 'bell-slash', - 'bell-z', - 'bell', - 'bezier-curve', - 'bicycle', - 'binoculars', - 'bird', - 'bluetooth-connected', - 'bluetooth-slash', - 'bluetooth-x', - 'bluetooth', - 'boat', - 'bone', - 'book-bookmark', - 'book-open-text', - 'book-open', - 'book', - 'bookmark-simple', - 'bookmark', - 'bookmarks-simple', - 'bookmarks', - 'books', - 'boot', - 'bounding-box', - 'bowl-food', - 'brackets-angle', - 'brackets-curly', - 'brackets-round', - 'brackets-square', - 'brain', - 'brandy', - 'bridge', - 'briefcase-metal', - 'briefcase', - 'broadcast', - 'broom', - 'browser', - 'browsers', - 'bug-beetle', - 'bug-droid', - 'bug', - 'buildings', - 'bus', - 'butterfly', - 'cactus', - 'cake', - 'calculator', - 'calendar-blank', - 'calendar-check', - 'calendar-plus', - 'calendar-x', - 'calendar', - 'call-bell', - 'camera-plus', - 'camera-rotate', - 'camera-slash', - 'camera', - 'campfire', - 'car-profile', - 'car-simple', - 'car', - 'cardholder', - 'cards', - 'caret-circle-double-down', - 'caret-circle-double-left', - 'caret-circle-double-right', - 'caret-circle-double-up', - 'caret-circle-down', - 'caret-circle-left', - 'caret-circle-right', - 'caret-circle-up-down', - 'caret-circle-up', - 'caret-double-down', - 'caret-double-left', - 'caret-double-right', - 'caret-double-up', - 'caret-down', - 'caret-left', - 'caret-right', - 'caret-up-down', - 'caret-up', - 'carrot', - 'cassette-tape', - 'castle-turret', - 'cat', - 'cell-signal-full', - 'cell-signal-high', - 'cell-signal-low', - 'cell-signal-medium', - 'cell-signal-none', - 'cell-signal-slash', - 'cell-signal-x', - 'certificate', - 'chair', - 'chalkboard-simple', - 'chalkboard-teacher', - 'chalkboard', - 'champagne', - 'charging-station', - 'chart-bar-horizontal', - 'chart-bar', - 'chart-donut', - 'chart-line-down', - 'chart-line-up', - 'chart-line', - 'chart-pie-slice', - 'chart-pie', - 'chart-polar', - 'chart-scatter', - 'chat-centered-dots', - 'chat-centered-text', - 'chat-centered', - 'chat-circle-dots', - 'chat-circle-text', - 'chat-circle', - 'chat-dots', - 'chat-teardrop-dots', - 'chat-teardrop-text', - 'chat-teardrop', - 'chat-text', - 'chat', - 'chats-circle', - 'chats-teardrop', - 'chats', - 'check-circle', - 'check-fat', - 'check-square-offset', - 'check-square', - 'check', - 'checks', - 'church', - 'circle-dashed', - 'circle-half-tilt', - 'circle-half', - 'circle-notch', - 'circle', - 'circles-four', - 'circles-three-plus', - 'circles-three', - 'circuitry', - 'clipboard-text', - 'clipboard', - 'clock-afternoon', - 'clock-clockwise', - 'clock-countdown', - 'clock-counter-clockwise', - 'clock', - 'closed-captioning', - 'cloud-arrow-down', - 'cloud-arrow-up', - 'cloud-check', - 'cloud-fog', - 'cloud-lightning', - 'cloud-moon', - 'cloud-rain', - 'cloud-slash', - 'cloud-snow', - 'cloud-sun', - 'cloud-warning', - 'cloud-x', - 'cloud', - 'club', - 'coat-hanger', - 'coda-logo', - 'code-block', - 'code-simple', - 'code', - 'codepen-logo', - 'codesandbox-logo', - 'coffee', - 'coin-vertical', - 'coin', - 'coins', - 'columns', - 'command', - 'compass-tool', - 'compass', - 'computer-tower', - 'confetti', - 'contactless-payment', - 'control', - 'cookie', - 'cooking-pot', - 'copy-simple', - 'copy', - 'copyleft', - 'copyright', - 'corners-in', - 'corners-out', - 'couch', - 'cpu', - 'credit-card', - 'crop', - 'cross', - 'crosshair-simple', - 'crosshair', - 'crown-simple', - 'crown', - 'cube-focus', - 'cube-transparent', - 'cube', - 'currency-btc', - 'currency-circle-dollar', - 'currency-cny', - 'currency-dollar-simple', - 'currency-dollar', - 'currency-eth', - 'currency-eur', - 'currency-gbp', - 'currency-inr', - 'currency-jpy', - 'currency-krw', - 'currency-kzt', - 'currency-ngn', - 'currency-rub', - 'cursor-click', - 'cursor-text', - 'cursor', - 'cylinder', - 'database', - 'desktop-tower', - 'desktop', - 'detective', - 'dev-to-logo', - 'device-mobile-camera', - 'device-mobile-speaker', - 'device-mobile', - 'device-tablet-camera', - 'device-tablet-speaker', - 'device-tablet', - 'devices', - 'diamond', - 'diamonds-four', - 'dice-five', - 'dice-four', - 'dice-one', - 'dice-six', - 'dice-three', - 'dice-two', - 'disc', - 'discord-logo', - 'divide', - 'dna', - 'dog', - 'door-open', - 'door', - 'dot-outline', - 'dot', - 'dots-nine', - 'dots-six-vertical', - 'dots-six', - 'dots-three-circle-vertical', - 'dots-three-circle', - 'dots-three-outline-vertical', - 'dots-three-outline', - 'dots-three-vertical', - 'dots-three', - 'download-simple', - 'download', - 'dress', - 'dribbble-logo', - 'drop-half-bottom', - 'drop-half', - 'drop', - 'dropbox-logo', - 'ear-slash', - 'ear', - 'egg-crack', - 'egg', - 'eject-simple', - 'eject', - 'elevator', - 'engine', - 'envelope-open', - 'envelope-simple-open', - 'envelope-simple', - 'envelope', - 'equalizer', - 'equals', - 'eraser', - 'escalator-down', - 'escalator-up', - 'exam', - 'exclude-square', - 'exclude', - 'export', - 'eye-closed', - 'eye-slash', - 'eye', - 'eyedropper-sample', - 'eyedropper', - 'eyeglasses', - 'face-mask', - 'facebook-logo', - 'factory', - 'faders-horizontal', - 'faders', - 'fan', - 'fast-forward-circle', - 'fast-forward', - 'feather', - 'figma-logo', - 'file-archive', - 'file-arrow-down', - 'file-arrow-up', - 'file-audio', - 'file-cloud', - 'file-code', - 'file-css', - 'file-csv', - 'file-dashed', - 'file-doc', - 'file-html', - 'file-image', - 'file-jpg', - 'file-js', - 'file-jsx', - 'file-lock', - 'file-magnifying-glass', - 'file-minus', - 'file-pdf', - 'file-plus', - 'file-png', - 'file-ppt', - 'file-rs', - 'file-sql', - 'file-svg', - 'file-text', - 'file-ts', - 'file-tsx', - 'file-video', - 'file-vue', - 'file-x', - 'file-xls', - 'file-zip', - 'file', - 'files', - 'film-reel', - 'film-script', - 'film-slate', - 'film-strip', - 'fingerprint-simple', - 'fingerprint', - 'finn-the-human', - 'fire-extinguisher', - 'fire-simple', - 'fire', - 'first-aid-kit', - 'first-aid', - 'fish-simple', - 'fish', - 'flag-banner', - 'flag-checkered', - 'flag-pennant', - 'flag', - 'flame', - 'flashlight', - 'flask', - 'floppy-disk-back', - 'floppy-disk', - 'flow-arrow', - 'flower-lotus', - 'flower-tulip', - 'flower', - 'flying-saucer', - 'folder-dashed', - 'folder-lock', - 'folder-minus', - 'folder-notch-minus', - 'folder-notch-open', - 'folder-notch-plus', - 'folder-notch', - 'folder-open', - 'folder-plus', - 'folder-simple-dashed', - 'folder-simple-lock', - 'folder-simple-minus', - 'folder-simple-plus', - 'folder-simple-star', - 'folder-simple-user', - 'folder-simple', - 'folder-star', - 'folder-user', - 'folder', - 'folders', - 'football', - 'footprints', - 'fork-knife', - 'frame-corners', - 'framer-logo', - 'function', - 'funnel-simple', - 'funnel', - 'game-controller', - 'garage', - 'gas-can', - 'gas-pump', - 'gauge', - 'gavel', - 'gear-fine', - 'gear-six', - 'gear', - 'gender-female', - 'gender-intersex', - 'gender-male', - 'gender-neuter', - 'gender-nonbinary', - 'gender-transgender', - 'ghost', - 'gif', - 'gift', - 'git-branch', - 'git-commit', - 'git-diff', - 'git-fork', - 'git-merge', - 'git-pull-request', - 'github-logo', - 'gitlab-logo-simple', - 'gitlab-logo', - 'globe-hemisphere-east', - 'globe-hemisphere-west', - 'globe-simple', - 'globe-stand', - 'globe', - 'goggles', - 'goodreads-logo', - 'google-cardboard-logo', - 'google-chrome-logo', - 'google-drive-logo', - 'google-logo', - 'google-photos-logo', - 'google-play-logo', - 'google-podcasts-logo', - 'gradient', - 'graduation-cap', - 'grains-slash', - 'grains', - 'graph', - 'grid-four', - 'grid-nine', - 'guitar', - 'hamburger', - 'hammer', - 'hand-coins', - 'hand-eye', - 'hand-fist', - 'hand-grabbing', - 'hand-heart', - 'hand-palm', - 'hand-pointing', - 'hand-soap', - 'hand-swipe-left', - 'hand-swipe-right', - 'hand-tap', - 'hand-waving', - 'hand', - 'handbag-simple', - 'handbag', - 'hands-clapping', - 'hands-praying', - 'handshake', - 'hard-drive', - 'hard-drives', - 'hash-straight', - 'hash', - 'headlights', - 'headphones', - 'headset', - 'heart-break', - 'heart-half', - 'heart-straight-break', - 'heart-straight', - 'heart', - 'heartbeat', - 'hexagon', - 'high-heel', - 'highlighter-circle', - 'hoodie', - 'horse', - 'hourglass-high', - 'hourglass-low', - 'hourglass-medium', - 'hourglass-simple-high', - 'hourglass-simple-low', - 'hourglass-simple-medium', - 'hourglass-simple', - 'hourglass', - 'house-line', - 'house-simple', - 'house', - 'ice-cream', - 'identification-badge', - 'identification-card', - 'image-square', - 'image', - 'images-square', - 'images', - 'infinity', - 'info', - 'instagram-logo', - 'intersect-square', - 'intersect-three', - 'intersect', - 'jeep', - 'kanban', - 'key-return', - 'key', - 'keyboard', - 'keyhole', - 'knife', - 'ladder-simple', - 'ladder', - 'lamp', - 'laptop', - 'layout', - 'leaf', - 'lifebuoy', - 'lightbulb-filament', - 'lightbulb', - 'lighthouse', - 'lightning-a', - 'lightning-slash', - 'lightning', - 'line-segment', - 'line-segments', - 'link-break', - 'link-simple-break', - 'link-simple-horizontal-break', - 'link-simple-horizontal', - 'link-simple', - 'link', - 'linkedin-logo', - 'linux-logo', - 'list-bullets', - 'list-checks', - 'list-dashes', - 'list-magnifying-glass', - 'list-numbers', - 'list-plus', - 'list', - 'lock-key-open', - 'lock-key', - 'lock-laminated-open', - 'lock-laminated', - 'lock-open', - 'lock-simple-open', - 'lock-simple', - 'lock', - 'lockers', - 'magic-wand', - 'magnet-straight', - 'magnet', - 'magnifying-glass-minus', - 'magnifying-glass-plus', - 'magnifying-glass', - 'map-pin-line', - 'map-pin', - 'map-trifold', - 'marker-circle', - 'martini', - 'mask-happy', - 'mask-sad', - 'math-operations', - 'medal-military', - 'medal', - 'medium-logo', - 'megaphone-simple', - 'megaphone', - 'messenger-logo', - 'meta-logo', - 'metronome', - 'microphone-slash', - 'microphone-stage', - 'microphone', - 'microsoft-excel-logo', - 'microsoft-outlook-logo', - 'microsoft-powerpoint-logo', - 'microsoft-teams-logo', - 'microsoft-word-logo', - 'minus-circle', - 'minus-square', - 'minus', - 'money', - 'monitor-play', - 'monitor', - 'moon-stars', - 'moon', - 'moped-front', - 'moped', - 'mosque', - 'motorcycle', - 'mountains', - 'mouse-simple', - 'mouse', - 'music-note-simple', - 'music-note', - 'music-notes-plus', - 'music-notes-simple', - 'music-notes', - 'navigation-arrow', - 'needle', - 'newspaper-clipping', - 'newspaper', - 'notches', - 'note-blank', - 'note-pencil', - 'note', - 'notebook', - 'notepad', - 'notification', - 'notion-logo', - 'number-circle-eight', - 'number-circle-five', - 'number-circle-four', - 'number-circle-nine', - 'number-circle-one', - 'number-circle-seven', - 'number-circle-six', - 'number-circle-three', - 'number-circle-two', - 'number-circle-zero', - 'number-eight', - 'number-five', - 'number-four', - 'number-nine', - 'number-one', - 'number-seven', - 'number-six', - 'number-square-eight', - 'number-square-five', - 'number-square-four', - 'number-square-nine', - 'number-square-one', - 'number-square-seven', - 'number-square-six', - 'number-square-three', - 'number-square-two', - 'number-square-zero', - 'number-three', - 'number-two', - 'number-zero', - 'nut', - 'ny-times-logo', - 'octagon', - 'office-chair', - 'option', - 'orange-slice', - 'package', - 'paint-brush-broad', - 'paint-brush-household', - 'paint-brush', - 'paint-bucket', - 'paint-roller', - 'palette', - 'pants', - 'paper-plane-right', - 'paper-plane-tilt', - 'paper-plane', - 'paperclip-horizontal', - 'paperclip', - 'parachute', - 'paragraph', - 'parallelogram', - 'park', - 'password', - 'path', - 'patreon-logo', - 'pause-circle', - 'pause', - 'paw-print', - 'paypal-logo', - 'peace', - 'pen-nib-straight', - 'pen-nib', - 'pen', - 'pencil-circle', - 'pencil-line', - 'pencil-simple-line', - 'pencil-simple-slash', - 'pencil-simple', - 'pencil-slash', - 'pencil', - 'pentagram', - 'pepper', - 'percent', - 'person-arms-spread', - 'person-simple-bike', - 'person-simple-run', - 'person-simple-throw', - 'person-simple-walk', - 'person-simple', - 'person', - 'perspective', - 'phone-call', - 'phone-disconnect', - 'phone-incoming', - 'phone-outgoing', - 'phone-plus', - 'phone-slash', - 'phone-x', - 'phone', - 'phosphor-logo', - 'pi', - 'piano-keys', - 'picture-in-picture', - 'piggy-bank', - 'pill', - 'pinterest-logo', - 'pinwheel', - 'pizza', - 'placeholder', - 'planet', - 'plant', - 'play-circle', - 'play-pause', - 'play', - 'playlist', - 'plug-charging', - 'plug', - 'plugs-connected', - 'plugs', - 'plus-circle', - 'plus-minus', - 'plus-square', - 'plus', - 'poker-chip', - 'police-car', - 'polygon', - 'popcorn', - 'potted-plant', - 'power', - 'prescription', - 'presentation-chart', - 'presentation', - 'printer', - 'prohibit-inset', - 'prohibit', - 'projector-screen-chart', - 'projector-screen', - 'pulse', - 'push-pin-simple-slash', - 'push-pin-simple', - 'push-pin-slash', - 'push-pin', - 'puzzle-piece', - 'qr-code', - 'question', - 'queue', - 'quotes', - 'radical', - 'radio-button', - 'radio', - 'radioactive', - 'rainbow-cloud', - 'rainbow', - 'read-cv-logo', - 'receipt-x', - 'receipt', - 'record', - 'rectangle', - 'recycle', - 'reddit-logo', - 'repeat-once', - 'repeat', - 'rewind-circle', - 'rewind', - 'road-horizon', - 'robot', - 'rocket-launch', - 'rocket', - 'rows', - 'rss-simple', - 'rss', - 'rug', - 'ruler', - 'scales', - 'scan', - 'scissors', - 'scooter', - 'screencast', - 'scribble-loop', - 'scroll', - 'seal-check', - 'seal-question', - 'seal-warning', - 'seal', - 'selection-all', - 'selection-background', - 'selection-foreground', - 'selection-inverse', - 'selection-plus', - 'selection-slash', - 'selection', - 'shapes', - 'share-fat', - 'share-network', - 'share', - 'shield-check', - 'shield-checkered', - 'shield-chevron', - 'shield-plus', - 'shield-slash', - 'shield-star', - 'shield-warning', - 'shield', - 'shirt-folded', - 'shooting-star', - 'shopping-bag-open', - 'shopping-bag', - 'shopping-cart-simple', - 'shopping-cart', - 'shower', - 'shrimp', - 'shuffle-angular', - 'shuffle-simple', - 'shuffle', - 'sidebar-simple', - 'sidebar', - 'sigma', - 'sign-in', - 'sign-out', - 'signature', - 'signpost', - 'sim-card', - 'siren', - 'sketch-logo', - 'skip-back-circle', - 'skip-back', - 'skip-forward-circle', - 'skip-forward', - 'skull', - 'slack-logo', - 'sliders-horizontal', - 'sliders', - 'slideshow', - 'smiley-angry', - 'smiley-blank', - 'smiley-meh', - 'smiley-nervous', - 'smiley-sad', - 'smiley-sticker', - 'smiley-wink', - 'smiley-x-eyes', - 'smiley', - 'snapchat-logo', - 'sneaker-move', - 'sneaker', - 'snowflake', - 'soccer-ball', - 'sort-ascending', - 'sort-descending', - 'soundcloud-logo', - 'spade', - 'sparkle', - 'speaker-hifi', - 'speaker-high', - 'speaker-low', - 'speaker-none', - 'speaker-simple-high', - 'speaker-simple-low', - 'speaker-simple-none', - 'speaker-simple-slash', - 'speaker-simple-x', - 'speaker-slash', - 'speaker-x', - 'spinner-gap', - 'spinner', - 'spiral', - 'split-horizontal', - 'split-vertical', - 'spotify-logo', - 'square-half-bottom', - 'square-half', - 'square-logo', - 'square-split-horizontal', - 'square-split-vertical', - 'square', - 'squares-four', - 'stack-overflow-logo', - 'stack-simple', - 'stack', - 'stairs', - 'stamp', - 'star-and-crescent', - 'star-four', - 'star-half', - 'star-of-david', - 'star', - 'steering-wheel', - 'steps', - 'stethoscope', - 'sticker', - 'stool', - 'stop-circle', - 'stop', - 'storefront', - 'strategy', - 'stripe-logo', - 'student', - 'subtitles', - 'subtract-square', - 'subtract', - 'suitcase-rolling', - 'suitcase-simple', - 'suitcase', - 'sun-dim', - 'sun-horizon', - 'sun', - 'sunglasses', - 'swap', - 'swatches', - 'swimming-pool', - 'sword', - 'synagogue', - 'syringe', - 't-shirt', - 'table', - 'tabs', - 'tag-chevron', - 'tag-simple', - 'tag', - 'target', - 'taxi', - 'telegram-logo', - 'television-simple', - 'television', - 'tennis-ball', - 'tent', - 'terminal-window', - 'terminal', - 'test-tube', - 'text-a-underline', - 'text-aa', - 'text-align-center', - 'text-align-justify', - 'text-align-left', - 'text-align-right', - 'text-b', - 'text-columns', - 'text-h-five', - 'text-h-four', - 'text-h-one', - 'text-h-six', - 'text-h-three', - 'text-h-two', - 'text-h', - 'text-indent', - 'text-italic', - 'text-outdent', - 'text-strikethrough', - 'text-t', - 'text-underline', - 'textbox', - 'thermometer-cold', - 'thermometer-hot', - 'thermometer-simple', - 'thermometer', - 'thumbs-down', - 'thumbs-up', - 'ticket', - 'tidal-logo', - 'tiktok-logo', - 'timer', - 'tipi', - 'toggle-left', - 'toggle-right', - 'toilet-paper', - 'toilet', - 'toolbox', - 'tooth', - 'tote-simple', - 'tote', - 'trademark-registered', - 'trademark', - 'traffic-cone', - 'traffic-sign', - 'traffic-signal', - 'train-regional', - 'train-simple', - 'train', - 'tram', - 'translate', - 'trash-simple', - 'trash', - 'tray', - 'tree-evergreen', - 'tree-palm', - 'tree-structure', - 'tree', - 'trend-down', - 'trend-up', - 'triangle', - 'trophy', - 'truck', - 'twitch-logo', - 'twitter-logo', - 'umbrella-simple', - 'umbrella', - 'unite-square', - 'unite', - 'upload-simple', - 'upload', - 'usb', - 'user-circle-gear', - 'user-circle-minus', - 'user-circle-plus', - 'user-circle', - 'user-focus', - 'user-gear', - 'user-list', - 'user-minus', - 'user-plus', - 'user-rectangle', - 'user-square', - 'user-switch', - 'user', - 'users-four', - 'users-three', - 'users', - 'van', - 'vault', - 'vibrate', - 'video-camera-slash', - 'video-camera', - 'video', - 'vignette', - 'vinyl-record', - 'virtual-reality', - 'virus', - 'voicemail', - 'volleyball', - 'wall', - 'wallet', - 'warehouse', - 'warning-circle', - 'warning-diamond', - 'warning-octagon', - 'warning', - 'watch', - 'wave-sawtooth', - 'wave-sine', - 'wave-square', - 'wave-triangle', - 'waveform', - 'waves', - 'webcam-slash', - 'webcam', - 'webhooks-logo', - 'wechat-logo', - 'whatsapp-logo', - 'wheelchair-motion', - 'wheelchair', - 'wifi-high', - 'wifi-low', - 'wifi-medium', - 'wifi-none', - 'wifi-slash', - 'wifi-x', - 'wind', - 'windows-logo', - 'wine', - 'wrench', - 'x-circle', - 'x-square', - 'x', - 'yin-yang', - 'youtube-logo', -]; diff --git a/packages/beeq/src/shared/utils/assetsPath.ts b/packages/beeq/src/shared/utils/assetsPath.ts index 54be35547..31d64ca86 100644 --- a/packages/beeq/src/shared/utils/assetsPath.ts +++ b/packages/beeq/src/shared/utils/assetsPath.ts @@ -11,7 +11,7 @@ const findConfigScript = () => scripts.find((script) => script.hasAttribute('dat const findFallbackScript = () => scripts.find((script) => /beeq(\.esm)?\.js($|\?)/.test(script.src)); -const getScriptPath = (script: HTMLScriptElement) => script.getAttribute('src')!.split('/').slice(0, -1).join('/'); +const getScriptPath = (script: HTMLScriptElement) => script.getAttribute('src').split('/').slice(0, -1).join('/'); /** * Returns the base path for the Assets. @@ -30,7 +30,7 @@ export const getBasePath = (subpath = '') => { const script = configScript || fallbackScript; if (script) { - const path = configScript ? script.getAttribute('data-beeq')! : getScriptPath(script); + const path = configScript ? script.getAttribute('data-beeq') : getScriptPath(script); setBasePath(path); } } diff --git a/tools/src/executors/icons/executor.ts b/tools/src/executors/icons/executor.ts index 794220aef..ed8a2bb8e 100644 --- a/tools/src/executors/icons/executor.ts +++ b/tools/src/executors/icons/executor.ts @@ -1,5 +1,5 @@ import { createSpinner } from 'nanospinner'; -import { createIconsSetFile, downloadIcons, extractIcons } from './helpers'; +import { downloadIcons, extractIcons } from './helpers'; import { IconsExecutorSchema } from './schema'; @@ -8,9 +8,6 @@ export default async function runExecutor({ downloadPath, extractToPath, fileName, - helperFile, - outputDir, - sourceDir, sourceUrl, svgFolder, }: IconsExecutorSchema) { @@ -27,11 +24,6 @@ export default async function runExecutor({ logSpinner.start({ text: 'Extract and copy all the SVG icon files into the icon component assets folder' }); await extractIcons({ assetsFolder, downloadPath, extractToPath, fileName, svgFolder }); logSpinner.success(); - - // At the end, it will generate a file that will list all the icon's names available - logSpinner.start({ text: 'Generate the `icons-set.ts` helper file' }); - await createIconsSetFile({ fileName: helperFile, outputDir, sourceDir }); - logSpinner.success(); } catch (error) { success = false; logSpinner.error({ text: `Ups! Something went wrong while generating the Bee-Q SVG icon files. ${error}` }); diff --git a/tools/src/executors/icons/helpers/create.ts b/tools/src/executors/icons/helpers/create.ts deleted file mode 100644 index a8ba38284..000000000 --- a/tools/src/executors/icons/helpers/create.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { readdirSync, writeFileSync } from 'fs-extra'; -import { join, parse } from 'path'; -import { format } from 'prettier'; - -interface ICreateIconsSetFile { - fileName: string; - outputDir: string; - sourceDir: string; -} - -export const createIconsSetFile = async ({ fileName, outputDir, sourceDir }: ICreateIconsSetFile) => { - try { - const files = readdirSync(sourceDir).sort((a, b) => a.localeCompare(b)); - const svgArrayNames = files.map((filename) => parse(filename).name); - const fileContent = ` - /** - * ❗️❗️ This file gets autogenerated from the command line by running: - * "npx nx run beeq:icons" - * - * ❌ Please do not modify it manually, always use "npx nx run bee-q:generateIcons" - * and commit any change resulted after running the build command. - */ - - export const ICONS_SET=${JSON.stringify(svgArrayNames)} - `; - - const formattedContent = await format(fileContent, { - parser: 'babel', - bracketSpacing: true, - endOfLine: 'auto', - semi: true, - singleQuote: true, - trailingComma: 'all', - }); - writeFileSync(join(outputDir, fileName), formattedContent); - - Promise.resolve(); - } catch (error) { - Promise.reject(error); - } -}; diff --git a/tools/src/executors/icons/helpers/download.ts b/tools/src/executors/icons/helpers/download.ts index dd1e640c6..d1a572dbf 100644 --- a/tools/src/executors/icons/helpers/download.ts +++ b/tools/src/executors/icons/helpers/download.ts @@ -18,8 +18,7 @@ export const downloadIcons = async ({ downloadPath, fileName, sourceUrl }: IDown // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error await finished(Readable.fromWeb(response.body).pipe(ws)); - Promise.resolve(); } catch (error) { - Promise.reject(error); + throw new Error(error); } }; diff --git a/tools/src/executors/icons/helpers/extract.ts b/tools/src/executors/icons/helpers/extract.ts index f5aa16ec6..d5eb0ea5e 100644 --- a/tools/src/executors/icons/helpers/extract.ts +++ b/tools/src/executors/icons/helpers/extract.ts @@ -31,8 +31,7 @@ export const extractIcons = async ({ await copy(oldPath, newPath, { overwrite: true }); } } - Promise.resolve(); } catch (error) { - Promise.reject(error); + throw new Error(error); } }; diff --git a/tools/src/executors/icons/helpers/index.ts b/tools/src/executors/icons/helpers/index.ts index 0bf3b0876..cb0d16f71 100644 --- a/tools/src/executors/icons/helpers/index.ts +++ b/tools/src/executors/icons/helpers/index.ts @@ -1,3 +1,2 @@ -export * from './create'; export * from './download'; export * from './extract'; diff --git a/tools/src/executors/icons/schema.d.ts b/tools/src/executors/icons/schema.d.ts index f48c61655..3840e2611 100644 --- a/tools/src/executors/icons/schema.d.ts +++ b/tools/src/executors/icons/schema.d.ts @@ -7,9 +7,6 @@ export interface IconsExecutorSchema { downloadPath: string; extractToPath: string; fileName: string; - helperFile: string; - outputDir: string; - sourceDir: string; sourceUrl: string; svgFolder: string; }