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

React Component Suggestions #50

Open
TSIA-SN opened this issue May 23, 2023 · 2 comments
Open

React Component Suggestions #50

TSIA-SN opened this issue May 23, 2023 · 2 comments

Comments

@TSIA-SN
Copy link

TSIA-SN commented May 23, 2023

I'm using the Font Awesome Icon Chooser React component to allow our content editors to choose icons to use in our content. As I'm not able to guarantee the component will be retained across selections, it would be quite useful if the following updates were made to the component:

  • Component Props
    • defaultStyleFilters: IconPrefix | IconPrefix[] | CssStyleClass | CssStyleClass[] | IconStyle | IconStyle[] | undefined - would allow us to pass in style filters that we want applied by default. Currently the default is hard-coded to Solid, Brands, and Uploaded. If the prop isn't set it would fall back to the current functionality. This will also help with retaining previous state.
      • Example: defaultStyleFilters='far'
      • Example: defaultStyleFilters={['fa-solid', 'fa-regular', 'fad']}
    • availableStyleFilters: IconPrefix | IconPrefix[] | CssStyleClass | CssStyleClass[] | IconStyle | IconStyle[] | undefined - would allow us to pass in style filters that we want to be available for selection. Currently all styles are displayed. If the prop isn't set it would fall back to the current functionality. If a UI is being built with a specific icon style, we may not need or want all of the filters to be available and this will simplify the UI.
      • Example: availableStyleFilters='far'
      • Example: availableStyleFilters={['fa-solid', 'fa-regular', 'fad']}
    • currentIcon: IconDefinition | IconLookup | undefined - would allow us to pass in the currently selected icon. It would turn on the applicable style filters and populate the search input with the icon name. If the style conflicts with availableStyleFilters, this prop would be treated as undefined. This will help with retaining the previous state.
  • Event Handlers
    • Include the user-selected style filters in the event.detail passed to the onFinish handler. This will allow us to store them as necessary and use them later (such as in defaultStyleFilters)
@Gilighost
Copy link

This would be useful in our project as well.

@mlwilkerson
Copy link
Member

@TSIA-SN and @Gilighost I've just released 0.7.0, which removes the defaultStyleFilters functionality entirely.

This is because it relied on a static/hardcoded list of familyStyles, which meant that this icon chooser could only support newly released familyStyles (there've been several--and more on the way!) when this component's source code is updated (which is not often enough!)

Could you let me know how this impacts your feature request, one way or another? At a minimum, it seems like the request would need to be reframed given the new UI.

At worst, perhaps you'll think this change throws a wrench in your content editor's existing workflows. Or maybe, like me, it'll seem like a welcome solution to a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants