forked from harness/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrate form components to a new structure and update imports
- Renamed and exported ButtonGroup as a standalone component. - Removed deprecated FormErrorMessage and FormLegend components. - Introduced new form components: Caption, Checkbox, ControlGroup, Fieldset, Input, Label, Legend, Message, Option, Radio, Select, Separator, Textarea. - Updated imports across various components to use the new form structure. - Adjusted styling and class names for consistency. - Refactored error handling to utilize the new Message component.
- Loading branch information
1 parent
7ef40bd
commit 23c59c4
Showing
32 changed files
with
497 additions
and
278 deletions.
There are no files selected for viewing
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
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
2 changes: 1 addition & 1 deletion
2
packages/ui/src/components/filters/filters-bar/filter-variants/calendar.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
2 changes: 1 addition & 1 deletion
2
packages/ui/src/components/filters/filters-bar/filter-variants/checkbox.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
2 changes: 1 addition & 1 deletion
2
packages/ui/src/components/filters/filters-bar/filter-variants/number.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
2 changes: 1 addition & 1 deletion
2
packages/ui/src/components/filters/filters-bar/filter-variants/text.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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
import { PropsWithChildren } from 'react' | ||
|
||
import { Text } from '@/components' | ||
import { cn } from '@utils/cn' | ||
|
||
interface CaptionProps extends PropsWithChildren { | ||
className?: string | ||
} | ||
|
||
/** | ||
* Caption component that renders supplementary text below form inputs. | ||
* Used to provide additional context or hints for form fields. | ||
* | ||
* @param {CaptionProps} props - The properties for the Caption component. | ||
* @param {React.ReactNode} props.children - The content to be displayed as the caption text. | ||
* @param {string} [props.className] - Optional additional class names for styling. | ||
* @returns {JSX.Element} The rendered Caption component. | ||
*/ | ||
export function Caption({ children, className }: CaptionProps) { | ||
return ( | ||
<Text className={cn('text-foreground-4 mt-1 leading-snug', className)} size={2}> | ||
{children} | ||
</Text> | ||
) | ||
} |
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
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
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
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,13 @@ | ||
export * from './caption' | ||
export * from './checkbox' | ||
export * from './control-group' | ||
export * from './fieldset' | ||
export * from './input' | ||
export * from './label' | ||
export * from './legend' | ||
export * from './message' | ||
export * from './option' | ||
export * from './radio' | ||
export * from './select' | ||
export * from './textarea' | ||
export * from './separator' |
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
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
Oops, something went wrong.