Repository navigation
Generate Lucide icon components from the pinned icon set - #2506
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2434
What
Lucide icons as inline SVG components generated from the icon set, the last open item of #2434.
Icons.targetsadds aGenerateIconstarget to the Admin project:src/FluentCMS.Admin/Icons/icons.txtlists the icons the admin uses, one Lucide name per line.dotnet build src/FluentCMS.Admin -t:GenerateIconsdownloads the pinned Lucide release once per machine into a cache (%LocalAppData%\FluentCMS\lucideor~/.cache/fluentcms/lucide, like the Tailwind binary) and verifies it.Components/Iconsand copies the release's licence next to the list.XIcon,ChevronDownIcon), inFluentCMS.Admin.Components.Icons, which_Imports.razornow imports.<svg>attributes and shapes, witharia-hidden="true"and the classeslucide lucide-<name>merged with aClassparameter.stroke-width="3", oraria-hidden="false"with a label for an icon that carries meaning.[&_svg:not([class*='size-'])]:size-4).XIcon, CheckboxCheckIcon, Select and DiffViewChevronDownIcon, RadioGroupItemCircleIcon, CommandInputSearchIcon, the theme toggleSunIconandMoonIcon, and/uiPlusIcon. The markup they render is unchanged apart from thelucideclasses and thewidthandheightattributes Lucide carries./uihas an Icons section listing every generated icon with its component name.CONTRIBUTING.md: how to add an icon, how the set is pinned, and its licence.How the set is pinned and licensed
Pinned:
Icons.targetssetsLucideVersionto 1.59.0, the current release, and pins two SHA-256 checksums:lucide-icons-1.59.0.zipfrom the GitHub release;LICENSEat the1.59.0tag.Lucide publishes no checksums, so these were computed from the downloads and are recorded here. A download that does not match is deleted and the build fails. Every generated file names the version it came from, and a test fails if that version differs from the pin. Updating means changing the version and both checksums, then running the target.
Licensed: Lucide is ISC. The icons it took from Feather are MIT, and the licence file lists them; seven of the eight icons used here are among them (all but
sun). Both licences allow use and modification with the notice kept.src/FluentCMS.Admin/Icons/LICENSEis that file verbatim, and every generated component points to it.Boxes on #2434
Ticked with this pull request:
/uishowcase page rendering every component with its keyboard hints, in light and dark themes …". With Add the Textarea, Select, Switch, RadioGroup, Separator and Kbd components #2489 and Add the Tabs, Sheet, Popover, Tooltip and Toast components #2493 every component of the initial set is on/uiwith its hints, in both themes and for signed-in users only (Add the theme toggle, reconnect display and /ui showcase #2468).That leaves no open box, so this closes #2434. One item in the issue's Acceptance list has no box and is not done: automated WCAG 2.1 AA checks on
/ui(UX-04). They need a browser test tool, and #2468 proposed running axe-core through Playwright when Playwright arrives with the desk flows (F-DSK, #2422).Why
Tailwind.targets, and its one inline task turns an SVG file into a component.Iconsuffix. Several Lucide names collide with components (badge,command,table). lucide-react exports the suffixed names as well, so shadcn examples that useXIconread the same.No new package; the icons are data from the pinned release.
Tests
IconsTests:icons.txthas a generated component, and every component is listed.svg(view box, stroke, stroke width), hidden from assistive technology, with its classes merged.ShowcaseTests: 23 sections, and the Icons section renders every generated icon.Checked on
/ui: the icons render at the size their surroundings give them (16 px in buttons and inputs, 20 px in the Icons section); in dark mode the theme toggle shows the moon and hides the sun; the checkbox tick shows only when checked, with its heavier stroke; the radio dot shows only on the checked option.dotnet build -warnaserror, the full suite and markdownlint pass locally, and-t:GenerateIconsrun from an empty cache downloads, verifies and regenerates byte-identical files.Checklist
v2