diff --git a/icons.js b/icons.js index 7b8623d..4a60d1f 100644 --- a/icons.js +++ b/icons.js @@ -1,4 +1,4 @@ -// Generated by build.js at 2024-10-31T11:34:40.142Z +// Generated by build.js at 2025-06-02T19:10:44.448Z export default { "a-b-2": " \n", @@ -55,6 +55,7 @@ export default { "alarm-minus": " \n", "alarm-off": " \n", "alarm-plus": " \n", + "alarm-smoke": " \n", "alarm-snooze": " \n", "alarm": " \n", "album-off": " \n", @@ -157,9 +158,13 @@ export default { "arrow-bar-down": " \n", "arrow-bar-left": " \n", "arrow-bar-right": " \n", + "arrow-bar-to-down-dashed": " \n", "arrow-bar-to-down": " \n", + "arrow-bar-to-left-dashed": " \n", "arrow-bar-to-left": " \n", + "arrow-bar-to-right-dashed": " \n", "arrow-bar-to-right": " \n", + "arrow-bar-to-up-dashed": " \n", "arrow-bar-to-up": " \n", "arrow-bar-up": " \n", "arrow-bear-left-2": " \n", @@ -327,8 +332,8 @@ export default { "article": " \n", "aspect-ratio-off": " \n", "aspect-ratio": " \n", - "assembly-off": " \n", - "assembly": " \n", + "assembly-off": " \n", + "assembly": " \n", "asset": " \n", "asterisk-simple": " \n", "asterisk": " \n", @@ -357,9 +362,12 @@ export default { "backpack": " \n", "backslash": " \n", "backspace": " \n", + "badge-2k": " \n", "badge-3d": " \n", + "badge-3k": " \n", "badge-4k": " \n", - "badge-8k": " \n", + "badge-5k": " \n", + "badge-8k": " \n", "badge-ad-off": " \n", "badge-ad": " \n", "badge-ar": " \n", @@ -502,6 +510,7 @@ export default { "blender": " \n", "blob": " \n", "blockquote": " \n", + "blocks": " \n", "bluetooth-connected": " \n", "bluetooth-off": " \n", "bluetooth-x": " \n", @@ -567,6 +576,7 @@ export default { "bowl-chopsticks": " \n", "bowl-spoon": " \n", "bowl": " \n", + "bowling": " \n", "box-align-bottom-left": " \n", "box-align-bottom-right": " \n", "box-align-bottom": " \n", @@ -767,7 +777,7 @@ export default { "brand-hipchat": " \n", "brand-html5": " \n", "brand-inertia": " \n", - "brand-instagram": " \n", + "brand-instagram": " \n", "brand-intercom": " \n", "brand-itch": " \n", "brand-javascript": " \n", @@ -782,7 +792,7 @@ export default { "brand-leetcode": " \n", "brand-letterboxd": " \n", "brand-line": " \n", - "brand-linkedin": " \n", + "brand-linkedin": " \n", "brand-linktree": " \n", "brand-linqpad": " \n", "brand-livewire": " \n", @@ -898,13 +908,14 @@ export default { "brand-svelte": " \n", "brand-swift": " \n", "brand-symfony": " \n", - "brand-tabler": " \n", + "brand-tabler": " \n", "brand-tailwind": " \n", "brand-taobao": " \n", "brand-teams": " \n", "brand-ted": " \n", "brand-telegram": " \n", "brand-terraform": " \n", + "brand-tesla": " \n", "brand-tether": " \n", "brand-thingiverse": " \n", "brand-threads": " \n", @@ -987,10 +998,13 @@ export default { "broadcast-off": " \n", "broadcast": " \n", "browser-check": " \n", + "browser-maximize": " \n", + "browser-minus": " \n", "browser-off": " \n", - "browser-plus": " \n", + "browser-plus": " \n", + "browser-share": " \n", "browser-x": " \n", - "browser": " \n", + "browser": " \n", "brush-off": " \n", "brush": " \n", "bubble-minus": " \n", @@ -1051,6 +1065,7 @@ export default { "cactus-off": " \n", "cactus": " \n", "cake-off": " \n", + "cake-roll": " \n", "cake": " \n", "calculator-off": " \n", "calculator": " \n", @@ -1068,7 +1083,7 @@ export default { "calendar-exclamation": " \n", "calendar-heart": " \n", "calendar-minus": " \n", - "calendar-month": " \n", + "calendar-month": " \n", "calendar-off": " \n", "calendar-pause": " \n", "calendar-pin": " \n", @@ -1084,7 +1099,7 @@ export default { "calendar-time": " \n", "calendar-up": " \n", "calendar-user": " \n", - "calendar-week": " \n", + "calendar-week": " \n", "calendar-x": " \n", "calendar": " \n", "camera-ai": " \n", @@ -1117,7 +1132,7 @@ export default { "camper": " \n", "campfire": " \n", "cancel": " \n", - "candle": " \n", + "candle": " \n", "candy-off": " \n", "candy": " \n", "cane": " \n", @@ -1157,11 +1172,23 @@ export default { "carousel-vertical": " \n", "carrot-off": " \n", "carrot": " \n", + "cash-banknote-edit": " \n", + "cash-banknote-heart": " \n", + "cash-banknote-minus": " \n", + "cash-banknote-move-back": " \n", + "cash-banknote-move": " \n", "cash-banknote-off": " \n", - "cash-banknote": " \n", + "cash-banknote-plus": " \n", + "cash-banknote": " \n", + "cash-edit": " \n", + "cash-heart": " \n", + "cash-minus": " \n", + "cash-move-back": " \n", + "cash-move": " \n", "cash-off": " \n", + "cash-plus": " \n", "cash-register": " \n", - "cash": " \n", + "cash": " \n", "cast-off": " \n", "cast": " \n", "cat": " \n", @@ -1184,6 +1211,7 @@ export default { "certificate": " \n", "chair-director": " \n", "chalkboard-off": " \n", + "chalkboard-teacher": " \n", "chalkboard": " \n", "charging-pile": " \n", "chart-arcs-3": " \n", @@ -1440,6 +1468,7 @@ export default { "clipboard-list": " \n", "clipboard-off": " \n", "clipboard-plus": " \n", + "clipboard-search": " \n", "clipboard-smile": " \n", "clipboard-text": " \n", "clipboard-typography": " \n", @@ -1532,6 +1561,9 @@ export default { "code-minus": " \n", "code-off": " \n", "code-plus": " \n", + "code-variable-minus": " \n", + "code-variable-plus": " \n", + "code-variable": " \n", "code": " \n", "coffee-off": " \n", "coffee": " \n", @@ -2088,8 +2120,8 @@ export default { "equal": " \n", "eraser-off": " \n", "eraser": " \n", - "error-404-off": " \n", - "error-404": " \n", + "error-404-off": " \n", + "error-404": " \n", "escalator-down": " \n", "escalator-up": " \n", "escalator": " \n", @@ -2103,10 +2135,10 @@ export default { "exposure-0": " \n", "exposure-minus-1": " \n", "exposure-minus-2": " \n", - "exposure-off": " \n", + "exposure-off": " \n", "exposure-plus-1": " \n", "exposure-plus-2": " \n", - "exposure": " \n", + "exposure": " \n", "external-link-off": " \n", "external-link": " \n", "eye-bitcoin": " \n", @@ -2150,7 +2182,7 @@ export default { "feather": " \n", "fence-off": " \n", "fence": " \n", - "ferry": " ", + "ferry": " \n", "fidget-spinner": " \n", "file-3d": " \n", "file-ai": " \n", @@ -2213,6 +2245,7 @@ export default { "file-star": " \n", "file-symlink": " \n", "file-text-ai": " \n", + "file-text-shield": " \n", "file-text-spark": " \n", "file-text": " \n", "file-time": " \n", @@ -2249,6 +2282,27 @@ export default { "file": " \n", "files-off": " \n", "files": " \n", + "filter-2-bolt": " \n", + "filter-2-cancel": " \n", + "filter-2-check": " \n", + "filter-2-code": " \n", + "filter-2-cog": " \n", + "filter-2-discount": " \n", + "filter-2-dollar": " \n", + "filter-2-down": " \n", + "filter-2-edit": " \n", + "filter-2-exclamation": " \n", + "filter-2-minus": " \n", + "filter-2-pause": " \n", + "filter-2-pin": " \n", + "filter-2-plus": " \n", + "filter-2-question": " \n", + "filter-2-search": " \n", + "filter-2-share": " \n", + "filter-2-spark": " \n", + "filter-2-up": " \n", + "filter-2-x": " \n", + "filter-2": " \n", "filter-bolt": " \n", "filter-cancel": " \n", "filter-check": " \n", @@ -2268,6 +2322,7 @@ export default { "filter-question": " \n", "filter-search": " \n", "filter-share": " \n", + "filter-spark": " \n", "filter-star": " \n", "filter-up": " \n", "filter-x": " \n", @@ -2316,7 +2371,7 @@ export default { "flag-x": " \n", "flag": " \n", "flame-off": " \n", - "flame": " \n", + "flame": " \n", "flare": " \n", "flask-2-off": " \n", "flask-2": " \n", @@ -2363,7 +2418,7 @@ export default { "folder-x": " \n", "folder": " \n", "folders-off": " \n", - "folders": " \n", + "folders": " \n", "forbid-2": " \n", "forbid": " \n", "forklift": " \n", @@ -2472,6 +2527,7 @@ export default { "h-6": " \n", "hammer-off": " \n", "hammer": " \n", + "hand-click-off": " \n", "hand-click": " \n", "hand-finger-down": " \n", "hand-finger-left": " \n", @@ -2654,16 +2710,26 @@ export default { "hours-12": " \n", "hours-24": " \n", "html": " \n", - "http-connect": " \n", - "http-delete": " \n", + "http-connect-off": " \n", + "http-connect": " \n", + "http-delete-off": " \n", + "http-delete": " \n", + "http-get-off": " \n", "http-get": " \n", + "http-head-off": " \n", "http-head": " \n", - "http-options": " \n", + "http-options-off": " \n", + "http-options": " \n", + "http-patch-off": " \n", "http-patch": " \n", - "http-post": " \n", + "http-post-off": " \n", + "http-post": " \n", + "http-put-off": " \n", "http-put": " \n", - "http-que": " \n", - "http-trace": " \n", + "http-que-off": " \n", + "http-que": " \n", + "http-trace-off": " \n", + "http-trace": " \n", "ice-cream-2": " \n", "ice-cream-off": " \n", "ice-cream": " \n", @@ -3114,6 +3180,7 @@ export default { "math-y-minus-y": " \n", "math-y-plus-y": " \n", "math": " \n", + "matrix": " \n", "maximize-off": " \n", "maximize": " \n", "meat-off": " \n", @@ -3235,7 +3302,13 @@ export default { "mist": " \n", "mobiledata-off": " \n", "mobiledata": " \n", - "moneybag": " \n", + "moneybag-edit": " \n", + "moneybag-heart": " \n", + "moneybag-minus": " \n", + "moneybag-move-back": " \n", + "moneybag-move": " \n", + "moneybag-plus": " \n", + "moneybag": " \n", "monkeybar": " \n", "mood-angry": " \n", "mood-annoyed-2": " \n", @@ -3497,7 +3570,7 @@ export default { "number-99-small": " \n", "number": " \n", "numbers": " \n", - "nurse": " \n", + "nurse": " \n", "nut": " \n", "object-scan": " \n", "octagon-minus-2": " \n", @@ -3884,6 +3957,7 @@ export default { "repeat-once": " \n", "repeat": " \n", "replace-off": " \n", + "replace-user": " \n", "replace": " \n", "report-analytics": " \n", "report-medical": " \n", @@ -4023,8 +4097,8 @@ export default { "search": " \n", "section-sign": " \n", "section": " \n", - "seeding-off": " \n", - "seeding": " \n", + "seedling-off": " \n", + "seedling": " \n", "select-all": " \n", "select": " \n", "selector": " \n", @@ -4207,7 +4281,7 @@ export default { "sort-descending-small-big": " \n", "sort-descending": " \n", "sort-z-a": " \n", - "sos": " \n", + "sos": " \n", "soup-off": " \n", "soup": " \n", "source-code": " \n", @@ -4219,7 +4293,7 @@ export default { "spade": " \n", "sparkles": " \n", "speakerphone": " \n", - "speedboat": " \n", + "speedboat": " \n", "sphere-off": " \n", "sphere-plus": " \n", "sphere": " \n", @@ -4245,6 +4319,7 @@ export default { "square-chevrons-left": " \n", "square-chevrons-right": " \n", "square-chevrons-up": " \n", + "square-dashed": " \n", "square-dot": " \n", "square-f0": " \n", "square-f1": " \n", @@ -4439,6 +4514,7 @@ export default { "swords": " \n", "table-alias": " \n", "table-column": " \n", + "table-dashed": " \n", "table-down": " \n", "table-export": " \n", "table-heart": " \n", @@ -4452,7 +4528,9 @@ export default { "table-shortcut": " \n", "table-spark": " \n", "table": " \n", + "tag-minus": " \n", "tag-off": " \n", + "tag-plus": " \n", "tag-starred": " \n", "tag": " \n", "tags-off": " \n", @@ -4581,7 +4659,7 @@ export default { "traffic-cone": " \n", "traffic-lights-off": " \n", "traffic-lights": " \n", - "train": " \n", + "train": " \n", "transaction-bitcoin": " \n", "transaction-dollar": " \n", "transaction-euro": " \n", @@ -4643,6 +4721,7 @@ export default { "u-turn-right": " \n", "ufo-off": " \n", "ufo": " \n", + "uhd": " \n", "umbrella-2": " \n", "umbrella-closed-2": " \n", "umbrella-closed": " \n", @@ -4787,6 +4866,8 @@ export default { "webhook-off": " \n", "webhook": " \n", "weight": " \n", + "wheat-off": " \n", + "wheat": " \n", "wheel": " \n", "wheelchair-off": " \n", "wheelchair": " \n", diff --git a/package-lock.json b/package-lock.json index fee093d..aa673d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@cdransf/eleventy-tabler-icons-filled", - "version": "2.1.0", + "version": "2.13.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cdransf/eleventy-tabler-icons-filled", - "version": "2.1.0", + "version": "2.13.1", "license": "MIT", "devDependencies": { "@11ty/eleventy": "v3.0.0", - "@tabler/icons": "^3.20.0" + "@tabler/icons": "^3.34.0" } }, "node_modules/@11ty/dependency-tree": { @@ -349,9 +349,9 @@ } }, "node_modules/@tabler/icons": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.20.0.tgz", - "integrity": "sha512-nXSeUzsCOxX/Of+kdUVQfxL9bG+ck8XCWNf9dGSpE+nhVexRwk/4HiDQDxFDysfT7vfgSut6GXnrZsU5M5dSlA==", + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.34.0.tgz", + "integrity": "sha512-jtVqv0JC1WU2TTEBN32D9+R6mc1iEBuPwLnBsWaR02SIEciu9aq5806AWkCHuObhQ4ERhhXErLEK7Fs+tEZxiA==", "dev": true, "license": "MIT", "funding": { diff --git a/package.json b/package.json index 45dd9d2..ca7971f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cdransf/eleventy-tabler-icons-filled", - "version": "2.1.1", + "version": "2.13.1", "description": "Shortcodes to add filled Tabler icons to your Eleventy projects", "type": "module", "main": "tablericons.js", @@ -25,15 +25,15 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/cdransf/eleventy-tabler-icons-filled.git" + "url": "git+https://git.apps.coryd.dev/cdransf/eleventy-tabler-icons-filled.git" }, - "homepage": "https://github.com/cdransf/eleventy-tabler-icons-filled#readme", + "homepage": "https://git.apps.coryd.dev/cdransf/eleventy-tabler-icons-filled#readme", "bugs": { - "url": "https://github.com/cdransf/eleventy-tabler-icons-filled/issues" + "url": "https://git.apps.coryd.dev/cdransf/eleventy-tabler-icons-filled/issues" }, "license": "MIT", "devDependencies": { "@11ty/eleventy": "v3.0.0", - "@tabler/icons": "^3.20.0" + "@tabler/icons": "^3.34.0" } } diff --git a/tablericons.js b/tablericons.js index b959cba..4cb477e 100644 --- a/tablericons.js +++ b/tablericons.js @@ -1,48 +1,58 @@ -import ICONS from './icons.js' +import ICONS from './icons.js'; const tablericons = (eleventyConfig, config = {}) => { - const { className = '', errorOnMissing = false } = config + const { className = '', errorOnMissing = false } = config; - const renderIcon = (context = this, name, alt, attrs) => { - const contents = ICONS[name] + const renderIcon = (context = {}, name, alt = '', attrs = {}) => { + const contents = ICONS[name]; if (!contents) { - handleMissingIcon(name, context.page.inputPath) - return '' + handleMissingIcon(name, context.page?.inputPath); + return ''; } - return `${head(alt, className, name, attrs)}${contents}${ICONS.TAIL}` - } + return `${buildHead(alt, className, name, attrs)}${contents}${ICONS.TAIL}`; + }; const handleMissingIcon = (name, inputPath) => { - const message = `No tablericons found for name '${name}'` + const message = `No tablericon found for name '${name}'`; if (errorOnMissing) { - throw new Error(message) + throw new Error(message); } else { - console.warn(`${message} in ${inputPath}`) + console.warn(`${message}${inputPath ? ` in ${inputPath}` : ''}`); } - } + }; - // Register shortcode for Eleventy 3.0 - eleventyConfig.addShortcode('tablericon', (name, alt, attrs) => { - return renderIcon(this, name, alt, attrs) - }) -} + eleventyConfig.addShortcode('tablericon', function (name, alt, attrs) { + return renderIcon(this, name, alt, attrs); + }); +}; -const head = (alt, className, iconName, attrs) => { - let output = `${ICONS.HEAD.slice(0, -1)} aria-hidden='true'` +const buildHead = (alt = '', className = '', iconName, attrs = {}) => { + let output = `${ICONS.HEAD.slice(0, -1)} aria-hidden="true"`; - if (className) output += ` class='${className}'` - output += ` data-tablericon-name='${iconName}'` + if (className) output += ` class="${className}"`; + output += ` data-tablericon-name="${iconName}"`; if (typeof attrs === 'string') { - output += ` ${attrs}` + output += ` ${attrs}`; } else if (attrs && typeof attrs === 'object') { output += Object.entries(attrs) - .map(([property, value]) => (property && value ? ` ${property}='${value}'` : '')) - .join('') + .map(([key, val]) => (key && val ? ` ${key}="${val}"` : '')) + .join(''); } - return `${output}>` + return `${output}>`; +}; + +export function renderTablerIcon(name, alt = '', attrs = {}, options = {}) { + const context = { page: { inputPath: options.inputPath || '' } }; + const contents = ICONS[name]; + if (!contents) { + console.warn(`No tablericon found for name '${name}'${options.inputPath ? ` in ${options.inputPath}` : ''}`); + return ''; + } + + return `${buildHead(alt, options.className || '', name, attrs)}${contents}${ICONS.TAIL}`; } -export default tablericons \ No newline at end of file +export default tablericons;