Skip to content

Commit

Permalink
Add beta.ts and update HairballProps in hairball.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
mhnpd committed Dec 22, 2023
1 parent 96b2fc6 commit 75ced84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jest-environment-jsdom',
Expand Down
2 changes: 2 additions & 0 deletions src/beta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './experimental/hairball'
export * from './experimental/whirl'
7 changes: 3 additions & 4 deletions src/experimental/hairball.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const HAIRBALL_DEFAULT_COLOR = FourColorsSchema.sunset

export interface HairballProps extends PrimaryProps {
colors?: HairballCustomColor
preset?: HairballPresetType
preset?: HairballPresetType | string
backgroundColor?: string
speed?: number
width?: number
Expand All @@ -37,14 +37,12 @@ export const Hairball: FC<HairballProps> = ({
wrapperStyle = {},
preset,
}) => {
const colorSchema = FourColorsSchema.sunset
return null
const {
fillColor1 = HairballPresetColors.dawn.fillColor1,
fillColor2 = HairballPresetColors.dawn.fillColor2,
fillColor3 = HairballPresetColors.dawn.fillColor3,
fillColor4 = HairballPresetColors.dawn.fillColor4,
} = colorSchema
} = preset ? HairballPresetColors?.[preset] : colors

if (!visible) {
return null
Expand All @@ -66,6 +64,7 @@ export const Hairball: FC<HairballProps> = ({
viewBox="0 0 100 100"
preserveAspectRatio="xMidYMid"
role="progressbar"
data-testid="hairball"
>
<g transform="translate(50,50)">
<g transform="scale(0.8)">
Expand Down

0 comments on commit 75ced84

Please # to comment.