Skip to content

Commit

Permalink
feat: add chart icon and small fixes (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman authored Jan 16, 2025
1 parent 67f3d1b commit 3ddc362
Show file tree
Hide file tree
Showing 9 changed files with 318 additions and 235 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build:fix:storybook": "perl -pi -w -e 's/%40/@/g;' storybook-static/index.html",
"storybook:serve-static": "yarn build:storybook && http-server storybook-static",
"build": "rimraf dist && tsc --noEmit && vite build",
"build:no-tsc": "rimraf dist && vite build",
"build:watch": "rimraf dist && vite build --watch",
"clean": "rimraf storybook-static dist",
"test": "vitest --run",
Expand Down Expand Up @@ -156,4 +157,4 @@
"eslint --fix --ext ts,tsx,js,jsx"
]
}
}
}
9 changes: 7 additions & 2 deletions src/components/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { type ComponentPropsWithRef } from '@react-spring/web'
import { useMemo, useRef } from 'react'
import {
type AriaSwitchProps,
VisuallyHidden,
useSwitch as useAriaSwitch,
useFocusRing,
} from 'react-aria'
import { useToggleState } from 'react-stately'
import { type ToggleState, useToggleState } from 'react-stately'
import styled from 'styled-components'

export type SwitchStyleProps = {
Expand Down Expand Up @@ -109,7 +110,11 @@ export const useSwitch = ({
disabled,
readOnly,
...props
}: UseSwitchProps) => {
}: UseSwitchProps): {
inputProps: ComponentPropsWithRef<'input'>
styleProps: SwitchStyleProps
state: ToggleState
} => {
const ariaProps: AriaSwitchProps = {
isSelected: checked,
isDisabled: disabled,
Expand Down
42 changes: 42 additions & 0 deletions src/components/icons/ChartIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import createIcon from './createIcon'

export default createIcon(({ size, color }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
viewBox="0 0 16 16"
fill="none"
>
<path
d="M0.5 14.9V1.5"
stroke={color}
strokeMiterlimit="10"
/>
<path
d="M3.5 14.9V4.40002"
stroke={color}
strokeMiterlimit="10"
/>
<path
d="M6.5 14.9V8.19995"
stroke={color}
strokeMiterlimit="10"
/>
<path
d="M9.3999 14.9V11.2"
stroke={color}
strokeMiterlimit="10"
/>
<path
d="M12.3999 14.9V2.69995"
stroke={color}
strokeMiterlimit="10"
/>
<path
d="M15.3999 14.9V5.5"
stroke={color}
strokeMiterlimit="10"
/>
</svg>
))
Loading

0 comments on commit 3ddc362

Please sign in to comment.