-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04fe3a3
commit a5c65ac
Showing
3 changed files
with
114 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
src/stories/controls/NumericControls/NumericControl.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type { Meta, StoryObj } from "@storybook/react" | ||
import { StorybookAntDJsonForm } from "../../../common/StorybookAntDJsonForm"; | ||
|
||
import { | ||
numericMagnitudeSchema, | ||
numericWeightSchema, | ||
numericUISchema, | ||
numericTheNumberSchema, | ||
} from "../../../testSchemas/numericSchema/numericSchema"; | ||
|
||
|
||
const meta: Meta<typeof StorybookAntDJsonForm> = { | ||
title: "Control/Numeric Input", | ||
component: StorybookAntDJsonForm, | ||
tags: ["autodocs"], | ||
args: { | ||
uiSchema: numericUISchema, | ||
}, | ||
argTypes: { | ||
uiSchema: { | ||
control: "object", | ||
}, | ||
} | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof StorybookAntDJsonForm> | ||
|
||
export const RequiredFloatingPoint: Story = { | ||
tags: ["autodocs"], | ||
args: { | ||
jsonSchema: numericMagnitudeSchema, | ||
uiSchema: numericUISchema, | ||
}, | ||
} | ||
|
||
export const RequiredFloatingPointWithDefault: Story = { | ||
tags: ["autodocs"], | ||
args: { | ||
jsonSchema: numericTheNumberSchema, | ||
uiSchema: numericUISchema, | ||
}, | ||
} | ||
|
||
export const OptionalFloatingPoint: Story = { | ||
tags: ["autodocs"], | ||
args: { | ||
jsonSchema: numericWeightSchema, | ||
uiSchema: numericUISchema, | ||
}, | ||
} |
63 changes: 63 additions & 0 deletions
63
src/stories/controls/NumericControls/NumericSliderControl.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { Meta, StoryObj } from "@storybook/react" | ||
import { StorybookAntDJsonForm } from "../../../common/StorybookAntDJsonForm"; | ||
|
||
import { | ||
numericSliderBasisPointsSchema, | ||
numericSliderUISchema, | ||
numericSliderTemperatureSchema, | ||
numericSliderTemperatureUISchema, | ||
numericSliderFinalGradeSchema, | ||
numericSliderPercentageUISchema, | ||
numericSliderDonateNowSchema, | ||
numericSliderUSDUISchema, | ||
} from "../../../testSchemas/numericSchema/numericSliderSchema"; | ||
|
||
|
||
const meta: Meta<typeof StorybookAntDJsonForm> = { | ||
title: "Control/Numeric Slider", | ||
component: StorybookAntDJsonForm, | ||
tags: ["autodocs"], | ||
args: { | ||
uiSchema: numericSliderUISchema, | ||
}, | ||
argTypes: { | ||
uiSchema: { | ||
control: "object", | ||
}, | ||
} | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof StorybookAntDJsonForm> | ||
|
||
export const RequiredInteger: Story = { | ||
tags: ["autodocs"], | ||
args: { | ||
jsonSchema: numericSliderBasisPointsSchema, | ||
uiSchema: numericSliderUISchema, | ||
}, | ||
} | ||
|
||
export const RequiredIntegerWithUnits: Story = { | ||
tags: ["autodocs"], | ||
args: { | ||
jsonSchema: numericSliderTemperatureSchema, | ||
uiSchema: numericSliderTemperatureUISchema, | ||
}, | ||
} | ||
|
||
export const RequiredPercentageWithDefault: Story = { | ||
tags: ["autodocs"], | ||
args: { | ||
jsonSchema: numericSliderFinalGradeSchema, | ||
uiSchema: numericSliderPercentageUISchema, | ||
}, | ||
} | ||
|
||
export const OptionalUSDWithDefault: Story = { | ||
tags: ["autodocs"], | ||
args: { | ||
jsonSchema: numericSliderDonateNowSchema, | ||
uiSchema: numericSliderUSDUISchema, | ||
}, | ||
} |