Merge pull request #49 from TiE23/ISSUE-047

ISSUE-047 - Exported animated versions of a pair of styled-components…
This commit is contained in:
Kyle Geib authored and GitHub committed 2022-02-03 11:28:53 -05:00
commit 218dc84507
4 files changed
+13 -7

No files matched your search

@@ -1,10 +1,10 @@
import { animated, useSpring } from "@react-spring/web";
import { useSpring } from "@react-spring/web";
import { useDrag } from "@use-gesture/react";
import useMeasure from "react-use-measure";
import { clamp } from "lodash";
import {
ProgressSliderBar,
AnimatedProgressSliderBar,
ProgressSliderBarHandle,
ProgressSliderBarIndicator,
ProgressSliderBody,
@@ -55,8 +55,6 @@ export function ProgressSlider({
onChange(newValue);
}, { enabled: !disabled });
const AnimatedProgressSliderBar = animated(ProgressSliderBar);
return (
<ProgressSliderBody ref={bodyRef}>
<AnimatedProgressSliderBar
@@ -1,3 +1,4 @@
import { animated } from "@react-spring/web";
import styled from "styled-components";
export const ProgressSliderBody = styled.div`
@@ -33,6 +34,9 @@ export const ProgressSliderBar = styled.div<ProgressSliderBarProps>`
`;
ProgressSliderBar.displayName = "ProgressSliderBar";
export const AnimatedProgressSliderBar = animated(ProgressSliderBar);
AnimatedProgressSliderBar.displayName = "AnimatedProgressSliderBar";
type ProgressSliderBarHandleProps = {
color?: string,
};
@@ -1,8 +1,8 @@
import { useEffect, useMemo, useState } from "react";
import { animated, useSpringRef, useTransition } from "@react-spring/web";
import { useSpringRef, useTransition } from "@react-spring/web";
import { findPrefixCount } from "../../../../utils/strings";
import { SelectorLabel, SlotText, SlotWindow } from "./styles";
import { SelectorLabel, AnimatedSlotText, SlotWindow } from "./styles";
import { Inline } from "@bedrock-layout/inline";
type SlotSelectorProps = {
@@ -78,7 +78,7 @@ export function SlotSelector({
)}
<SlotWindow onClick={onClick} disabled={disabled} width={slotWidth}>
{transitions((style, i) => (
<SlotText as={animated.span} style={style}>{getItem(i)}</SlotText>
<AnimatedSlotText style={style}>{getItem(i)}</AnimatedSlotText>
))}
</SlotWindow>
</Inline>
@@ -1,3 +1,4 @@
import { animated } from "@react-spring/web";
import styled from "styled-components";
type SlotWindowProps = {
@@ -35,6 +36,9 @@ export const SlotText = styled.span`
`;
SlotText.displayName = "SlotText";
export const AnimatedSlotText = animated(SlotText);
AnimatedSlotText.displayName = "AnimatedSlotText";
export const SelectorLabel = styled.span`
font-family: ${p => p.theme.fonts.f1Regular};
font-size: ${p => p.theme.fontSizes.label};