Expose typings string union type with all the valid icons accepted by <calcite-icon> #8858
Closed
4 of 6 tasks
Labels
4 - verified
Issues that have been released and confirmed resolved.
ArcGIS Maps SDK for JavaScript
Issues logged by ArcGIS SDK for JavaScript team members.
calcite-components
Issues specific to the @esri/calcite-components package.
calcite-components-react
Issues specific to the @esri/calcite-components-react package.
enhancement
Issues tied to a new feature or request.
estimate - 3
A day or two of work, likely requires updates to tests.
impact - p3 - not time sensitive
User set priority impact status of p3 - not time sensitive
p - medium
Issue is non core or affecting less that 60% of people using the library
Milestone
Check existing issues
Description
In the Maps SDK we use icons extensively and we are looking into how we can have type safe icon names. For now we've created a script which generates typescript definitions from the currently-installed asset files, but it seems like it would be better if Calcite exposed typings directly.
Acceptance Criteria
components.d.ts
should expose aCalciteIconName
string union with all the valid icon names.CalciteIcon.icon
should be typed asicon?: CalciteIconName
instead oficon?: string
. In some cases the icon can be aboolean
, in which case it would be type asicon?: CalciteIcon | boolean
.Relevant Info
calcite-ui-icons
already exposes some typings: https://github.com/Esri/calcite-ui-icons/blob/master/index.d.tsThey are generated with https://github.com/Esri/calcite-ui-icons/blob/master/bin/path-data.js#L113-L123
For Calcite Components we'd need to convert to kebab case.
Which Component
Example Use Case
We're planning on using it in the Maps SDK for JavaScript to validate the names of all the default icons used in widgets.
Priority impact
p4 - not time sensitive
Calcite package
Esri team
ArcGIS Maps SDK for JavaScript
The text was updated successfully, but these errors were encountered: