diff --git a/src/Form.tsx b/src/Form.tsx index 64674dc..0d8a1f6 100644 --- a/src/Form.tsx +++ b/src/Form.tsx @@ -2,7 +2,7 @@ import './Form.scss' import CheckboxInput from './inputs/Checkbox' import TogglableColorPicker from './inputs/TogglableColorPicker' import IntegerInput from './inputs/Integer' -import { Color, SwatchConfig } from './types' +import { Color, SwatchConfig, StaggerType } from './types' import { getRandomNotWhiteColor } from './colorHelpers' import { totalColorSequenceLength, presetPickerColors } from './colorSequenceHelpers' import { mod } from './numberHelpers' @@ -14,7 +14,7 @@ function Form( { swatchData: SwatchConfig, setSwatchData: (data: SwatchConfig) => void, - staggerType?: 'normal' | 'colorStretched' | 'colorSwallowed', + staggerType?: StaggerType, showExperimentalFeatures: boolean, className?: string, } diff --git a/src/Swatch.tsx b/src/Swatch.tsx index 0e1fef5..02793b5 100644 --- a/src/Swatch.tsx +++ b/src/Swatch.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react' import { swatchMatrix, clusteredSwatchMatrix } from './swatchHelpers' -import { StitchPattern, Color, ColorSequenceArray, ClusterConfiguration } from './types' +import { StitchPattern, Color, ColorSequenceArray, ClusterConfiguration, StaggerType } from './types' import './Swatch.scss' const clusterConfiguration:Record = { //Todo: make this a class of some sort? @@ -42,7 +42,7 @@ function Stitch ({color} : { color: Color}) { } function Swatch( - { colorSequence, stitchesPerRow, stitchPattern, numberOfRows = 40, colorShift = 0, staggerLengths = false, staggerType = "normal", className} + { colorSequence, stitchesPerRow, stitchPattern, numberOfRows = 40, colorShift = 0, staggerLengths = false, staggerType = 'normal', className} : { colorSequence: ColorSequenceArray, stitchesPerRow: number, @@ -50,7 +50,7 @@ function Swatch( numberOfRows?: number, colorShift?: number, staggerLengths?: boolean, - staggerType?: 'normal' | 'colorStretched' | 'colorSwallowed' + staggerType?: StaggerType, className?: string } ) { diff --git a/src/SwatchWithForm.tsx b/src/SwatchWithForm.tsx index 3fe4ad9..dd8a927 100644 --- a/src/SwatchWithForm.tsx +++ b/src/SwatchWithForm.tsx @@ -1,13 +1,13 @@ import Swatch from './Swatch'; import Form from './Form'; -import { SwatchConfig } from './types' +import { SwatchConfig, StaggerType } from './types' import { useState } from 'react'; import CheckboxInput from './inputs/Checkbox' function SwatchWithForm({swatchConfig, setSwatchConfig, staggerType, showExperimentalFeatures, showRowNumbersInitially, formClasses, swatchClasses} : { swatchConfig: SwatchConfig, setSwatchConfig: (arg0: SwatchConfig) => void, - staggerType?: 'normal' | 'colorStretched' | 'colorSwallowed' + staggerType?: StaggerType, showExperimentalFeatures?: boolean, showRowNumbersInitially?: boolean, formClasses?: string, diff --git a/src/inputs/Dropdown.tsx b/src/inputs/Dropdown.tsx index 6013bae..4b6d946 100644 --- a/src/inputs/Dropdown.tsx +++ b/src/inputs/Dropdown.tsx @@ -1,5 +1,7 @@ +import ClickableTooltip from '../ClickableTooltip'; + function Dropdown( - { value, name, label, title, setValue, items } + { value, name, label, title, setValue, items, withTooltip } : { value: string, name: string, @@ -7,6 +9,7 @@ function Dropdown( title: string, setValue: (value: string) => void, items: Array<{value: string, label: string}>, + withTooltip?: boolean, } ){ @@ -16,6 +19,7 @@ function Dropdown( + { withTooltip ? : '' }