mirror of
https://github.com/tabler/tabler.git
synced 2026-08-29 13:21:29 +04:00
Fix component props silently ignored or misapplied in shared/ui (#2828)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codecalm <1282324+codecalm@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@ const icon = (icons as unknown as Record<string, { svg: Record<string, string> }
|
||||
const classes = ['icon', className, color && `text-${color}`, inline && 'icon-inline', size && `icon-${size}`].filter(Boolean).join(' ')
|
||||
|
||||
let svg = icon?.svg?.[type] ?? ''
|
||||
svg = svg.replace('<path stroke="none" d="M0 0h24v24H0z" fill="none"/>', '')
|
||||
svg = svg.replace(/<path stroke="none" d="M0 0h24v24H0z" fill="none"\s*\/>/, '')
|
||||
svg = svg.replace(/class="[^"]+"/, `aria-hidden="true" focusable="false" class="${classes}"`)
|
||||
---
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ const mapOptions = data
|
||||
stroke: '#fff',
|
||||
opacity: 1,
|
||||
strokeWidth: 3,
|
||||
stokeOpacity: 0.5,
|
||||
strokeOpacity: 0.5,
|
||||
fill: `var(--tblr-${color})`,
|
||||
},
|
||||
hover: { fill: `var(--tblr-${color})`, stroke: `var(--tblr-${color})` },
|
||||
|
||||
@@ -18,7 +18,7 @@ const starClasses = ['icon', 'gl-star-full', color && `text-${color}`, size && `
|
||||
|
||||
const iconData = (icons as Record<string, { svg: Record<string, string | null> }>)[icon]
|
||||
let star = iconData?.svg?.filled ?? ''
|
||||
star = star.replace('<path stroke="none" d="M0 0h24v24H0z" fill="none"/>', '')
|
||||
star = star.replace(/<path stroke="none" d="M0 0h24v24H0z" fill="none"\s*\/>/, '')
|
||||
star = star.replace(/class="[^"]+"/, `aria-hidden="true" focusable="false" class="${starClasses}"`)
|
||||
|
||||
const ratingSelector = `#rating-${id}`
|
||||
|
||||
Reference in New Issue
Block a user