File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ function StepperExample({ theme }) {
3737 onChange = { ( v ) => setValue3 ( v ) }
3838 min = { 0 }
3939 max = { 10 }
40+ style = { { fontSize : 24 , color : theme . colors . primary } }
4041 />
4142 </ Section >
4243 </ Container >
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ import { withTheme } from "../theming";
66import type { Theme } from "../styles/DefaultTheme" ;
77import type { IconSlot } from "../interfaces/Icon" ;
88import IconButton from "./IconButton" ;
9+ import { extractStyles } from "../utilities" ;
910
1011type Props = {
1112 min : number ;
1213 max : number ;
1314 value ?: number ;
1415 defaultValue ?: number ;
15- style ?: StyleProp < ViewStyle > ;
16- typeStyle ?: StyleProp < TextStyle > ;
16+ style ?: StyleProp < ViewStyle | TextStyle > ;
1717 iconSize : number ;
1818 iconColor ?: string ;
1919 onChange ?: ( value : number ) => void ;
@@ -26,13 +26,13 @@ const Stepper: FC<Props> = ({
2626 value : valueProp ,
2727 defaultValue,
2828 style,
29- typeStyle,
3029 iconSize = 24 ,
3130 iconColor,
3231 onChange,
3332 theme : { colors, typography } ,
3433 Icon,
3534} ) => {
35+ const { viewStyles, textStyles } = extractStyles ( style ) ;
3636 const [ value , setValue ] = useState ( defaultValue ?? 0 ) ;
3737
3838 const isValidValue = ( valueArg : number ) => valueArg >= min && valueArg <= max ;
@@ -59,7 +59,7 @@ const Stepper: FC<Props> = ({
5959 } , [ valueProp ] ) ;
6060
6161 return (
62- < View style = { [ { flexDirection : "row" } , style ] } >
62+ < View style = { [ { flexDirection : "row" } , viewStyles ] } >
6363 < IconButton
6464 Icon = { Icon }
6565 icon = "MaterialIcons/remove"
@@ -79,7 +79,7 @@ const Stepper: FC<Props> = ({
7979 color : colors . medium ,
8080 marginHorizontal : 8 ,
8181 } ,
82- typeStyle ,
82+ textStyles ,
8383 ] }
8484 >
8585 { value }
Original file line number Diff line number Diff line change 66 createStaticNumberProp ,
77 Triggers ,
88 BLOCK_STYLES_SECTIONS ,
9+ StylesPanelSections ,
910} from "@draftbit/types" ;
1011
1112export const SEED_DATA = [
@@ -14,7 +15,10 @@ export const SEED_DATA = [
1415 tag : "Stepper" ,
1516 description : "A component used to control the quantity of something" ,
1617 category : COMPONENT_TYPES . control ,
17- stylesPanelSections : BLOCK_STYLES_SECTIONS ,
18+ stylesPanelSections : [
19+ StylesPanelSections . Typography ,
20+ ...BLOCK_STYLES_SECTIONS ,
21+ ] ,
1822 layout : { } ,
1923 triggers : [ Triggers . OnChange ] ,
2024 props : {
You can’t perform that action at this time.
0 commit comments