File tree Expand file tree Collapse file tree 4 files changed +188
-0
lines changed
uswds/src/Templates/ButtonTemplates Expand file tree Collapse file tree 4 files changed +188
-0
lines changed Original file line number Diff line number Diff line change 6868 "react-is" : " ^18.2.0" ,
6969 "react-portal" : " ^4.2.2" ,
7070 "semantic-ui-react" : " ^2.1.3" ,
71+ <<<<<<< HEAD
7172 "uswds" : " ^2.14.0" ,
7273 "lucide-react" : " ^0.488.0"
74+ =======
75+ "uswds" : " ^2.14.0"
76+ >>>>>>> f066e3da (Add USWDS theme)
7377 },
7478 "devDependencies" : {
7579 "@babel/cli" : " ^7.23.9" ,
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ import { Theme as SuiTheme } from '@rjsf/semantic-ui';
44import { Theme as AntdTheme } from '@rjsf/antd' ;
55import { Theme as BootstrapTheme } from '@rjsf/react-bootstrap' ;
66import { Theme as ChakraUITheme } from '@rjsf/chakra-ui' ;
7+ < < << << < HEAD
78import { Theme as shadcnTheme } from '@rjsf/shadcn' ;
89import { Theme as DaisyUITheme } from '@rjsf/daisyui' ;
10+ = === ===
11+ >>> >>> > f066e3da ( Add USWDS theme )
912import { Theme as UswdsTheme } from '@rjsf/uswds' ;
1013import v8Validator , { customizeValidator } from '@rjsf/validator-ajv8' ;
1114import Ajv2019 from 'ajv/dist/2019.js' ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { AddButtonProps , IconButtonProps as RjsfIconButtonProps } from "@rjsf/utils" ;
3+ import IconButton from "./IconButton" ; // Import the generic IconButton
4+
5+ // Define specific button types using the generic IconButton
6+ const AddButton = ( props : AddButtonProps ) => (
7+ < IconButton
8+ { ...props }
9+ iconName = "add"
10+ uswdsStyle = "outline"
11+ title = "Add Item" // Default title
12+ >
13+ Add Item { / * Default text * / }
14+ < / I c o n B u t t o n >
15+ ) ;
16+
17+ const RemoveButton = ( props : RjsfIconButtonProps ) => (
18+ < IconButton
19+ { ...props }
20+ iconName = "remove"
21+ uswdsStyle = "unstyled"
22+ title = "Remove Item" // Default title
23+ / >
24+ ) ;
25+
26+ const MoveUpButton = ( props : RjsfIconButtonProps ) => (
27+ < IconButton
28+ { ...props }
29+ iconName = "arrow-upward"
30+ uswdsStyle = "unstyled"
31+ title = "Move Item Up" // Default title
32+ / >
33+ ) ;
34+
35+ const MoveDownButton = ( props : RjsfIconButtonProps ) => (
36+ < IconButton
37+ { ...props }
38+ iconName = "arrow-downward"
39+ uswdsStyle = "unstyled"
40+ title = "Move Item Down" // Default title
41+ / >
42+ ) ;
43+
44+ const CopyButton = ( props : RjsfIconButtonProps ) => (
45+ < IconButton
46+ { ...props }
47+ iconName = "copy" // Assuming 'copy' is added to iconMap
48+ uswdsStyle = "unstyled"
49+ title = "Copy Item" // Default title
50+ / >
51+ ) ;
52+
53+ // Export the pre-configured buttons
54+ export default {
55+ AddButton,
56+ CopyButton,
57+ MoveDownButton,
58+ MoveUpButton,
59+ RemoveButton,
60+ // You could also export the generic IconButton itself if needed elsewhere
61+ // IconButton,
62+ } ;
You can’t perform that action at this time.
0 commit comments