-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Addon-docs: Extract SetValueButton shared component from control components #34263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
fe43b00
dbc932a
a9d487b
4bf1c9d
a0dd922
ae209b4
7776d43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,11 +1,11 @@ | ||||||
| import type { ChangeEvent, FC } from 'react'; | ||||||
| import React, { useCallback, useState } from 'react'; | ||||||
|
|
||||||
| import { Button, Form } from 'storybook/internal/components'; | ||||||
| import { Form } from 'storybook/internal/components'; | ||||||
|
|
||||||
| import { styled } from 'storybook/theming'; | ||||||
|
|
||||||
| import { getControlId, getControlSetterButtonId } from './helpers'; | ||||||
| import { getControlId, SetValueButton } from './helpers'; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use explicit extension for this relative import. Line 8 should include the file extension to match repository import rules. Suggested fix-import { getControlId, SetValueButton } from './helpers';
+import { getControlId, SetValueButton } from './helpers.tsx';As per coding guidelines: 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| import type { ControlProps, TextConfig, TextValue } from './types'; | ||||||
|
|
||||||
| export type TextProps = ControlProps<TextValue | undefined> & TextConfig; | ||||||
|
|
@@ -45,16 +45,9 @@ export const TextControl: FC<TextProps> = ({ | |||||
|
|
||||||
| if (value === undefined) { | ||||||
| return ( | ||||||
| <Button | ||||||
| ariaLabel={false} | ||||||
| variant="outline" | ||||||
| size="medium" | ||||||
| disabled={readonly} | ||||||
| id={getControlSetterButtonId(name, storyId)} | ||||||
| onClick={onForceVisible} | ||||||
| > | ||||||
| <SetValueButton name={name} storyId={storyId} onClick={onForceVisible} disabled={readonly}> | ||||||
| Set string | ||||||
| </Button> | ||||||
| </SetValueButton> | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Use explicit extension for this relative import.
The import path
./helpersshould include the file extension to match repository import rules.Suggested fix
As per coding guidelines:
**/*.{ts,tsx,js,jsx}requires "explicit file extensions for relative code imports and exports in TypeScript source, such as './foo.ts' or './bar.tsx'".📝 Committable suggestion
🤖 Prompt for AI Agents