|
| 1 | +import{Story}from"@storybook/react" |
| 2 | +import{WorkspaceParameter,WorkspaceParameterProps}from"./WorkspaceParameter" |
| 3 | + |
| 4 | +exportdefault{ |
| 5 | +title:"components/WorkspaceParameter", |
| 6 | +component:WorkspaceParameter, |
| 7 | +} |
| 8 | + |
| 9 | +constTemplate:Story<WorkspaceParameterProps>=(args)=><WorkspaceParameter{...args}/> |
| 10 | + |
| 11 | +exportconstRegion=Template.bind({}) |
| 12 | +Region.args={ |
| 13 | +templateParameter:{ |
| 14 | +name:"Region", |
| 15 | +default_value:"canada", |
| 16 | +description:"Select a location for your workspace to live.", |
| 17 | +icon:"/emojis/1f30e.png", |
| 18 | +mutable:false, |
| 19 | +options:[ |
| 20 | +{ |
| 21 | +name:"Toronto, Canada", |
| 22 | +description:"", |
| 23 | +icon:"/emojis/1f1e8-1f1e6.png", |
| 24 | +value:"canada", |
| 25 | +}, |
| 26 | +{ |
| 27 | +name:"Hamina, Finland", |
| 28 | +description:"", |
| 29 | +icon:"/emojis/1f1eb-1f1ee.png", |
| 30 | +value:"finland", |
| 31 | +}, |
| 32 | +{ |
| 33 | +name:"Warsaw, Poland", |
| 34 | +description:"", |
| 35 | +icon:"/emojis/1f1f5-1f1f1.png", |
| 36 | +value:"poland", |
| 37 | +}, |
| 38 | +{ |
| 39 | +name:"Madrid, Spain", |
| 40 | +description:"", |
| 41 | +icon:"/emojis/1f1ea-1f1f8.png", |
| 42 | +value:"spain", |
| 43 | +}, |
| 44 | +{ |
| 45 | +name:"London, England", |
| 46 | +description:"", |
| 47 | +icon:"/emojis/1f1ec-1f1e7.png", |
| 48 | +value:"england", |
| 49 | +}, |
| 50 | +{ |
| 51 | +name:"Dallas, Texas", |
| 52 | +description:"", |
| 53 | +icon:"/emojis/1f920.png", |
| 54 | +value:"texas", |
| 55 | +}, |
| 56 | +], |
| 57 | +type:"string", |
| 58 | +validation_max:0, |
| 59 | +validation_min:0, |
| 60 | +validation_regex:"", |
| 61 | +validation_error:"", |
| 62 | +}, |
| 63 | +workspaceBuildParameter:{ |
| 64 | +name:"Region", |
| 65 | +value:"canada", |
| 66 | +}, |
| 67 | +} |
| 68 | + |
| 69 | +exportconstRepo=Template.bind({}) |
| 70 | +Repo.args={ |
| 71 | +templateParameter:{ |
| 72 | +name:"Repo", |
| 73 | +default_value:"coder", |
| 74 | +description:"Select a repository to work on. This will automatically be cloned.", |
| 75 | +icon:"/icon/github.svg", |
| 76 | +mutable:false, |
| 77 | +options:[ |
| 78 | +{ |
| 79 | +name:"coder/coder", |
| 80 | +description: |
| 81 | +"Remote development environments on your infrastructure provisioned with Terraform", |
| 82 | +icon:"", |
| 83 | +value:"https://github.com/coder/coder", |
| 84 | +}, |
| 85 | +{ |
| 86 | +name:"coder/v1", |
| 87 | +description:"The home for Coder v1!", |
| 88 | +icon:"", |
| 89 | +value:"https://github.com/coder/v1", |
| 90 | +}, |
| 91 | +], |
| 92 | +type:"string", |
| 93 | +validation_max:0, |
| 94 | +validation_min:0, |
| 95 | +validation_regex:"", |
| 96 | +validation_error:"", |
| 97 | +}, |
| 98 | +workspaceBuildParameter:{ |
| 99 | +name:"Repo", |
| 100 | +value:"https://github.com/coder/coder", |
| 101 | +}, |
| 102 | +} |
| 103 | + |
| 104 | +exportconstSize=Template.bind({}) |
| 105 | +Size.args={ |
| 106 | +templateParameter:{ |
| 107 | +name:"Instance Size", |
| 108 | +default_value:"8", |
| 109 | +description:"", |
| 110 | +icon:"/emojis/1f916.png", |
| 111 | +mutable:true, |
| 112 | +options:[ |
| 113 | +{ |
| 114 | +name:"Small", |
| 115 | +description:"A tiny 4 core machine for small projects.", |
| 116 | +icon:"/emojis/1f90f.png", |
| 117 | +value:"4", |
| 118 | +}, |
| 119 | +{ |
| 120 | +name:"Medium", |
| 121 | +description:"A larger 8 core machine for heavy-ish workloads.", |
| 122 | +icon:"/emojis/1f44c.png", |
| 123 | +value:"8", |
| 124 | +}, |
| 125 | +{ |
| 126 | +name:"Large", |
| 127 | +description:"A beefy 16 core machine that can power most workloads.", |
| 128 | +icon:"/emojis/1f4aa.png", |
| 129 | +value:"16", |
| 130 | +}, |
| 131 | +], |
| 132 | +type:"string", |
| 133 | +validation_max:0, |
| 134 | +validation_min:0, |
| 135 | +validation_regex:"", |
| 136 | +validation_error:"", |
| 137 | +}, |
| 138 | +workspaceBuildParameter:{ |
| 139 | +name:"Instance Size", |
| 140 | +value:"8", |
| 141 | +}, |
| 142 | +} |
| 143 | + |
| 144 | +exportconstDotfiles=Template.bind({}) |
| 145 | +Dotfiles.args={ |
| 146 | +templateParameter:{ |
| 147 | +name:"Dotfiles URL", |
| 148 | +default_value:"https://github.com/ammario/dotfiles", |
| 149 | +description: |
| 150 | +"A Git URL that points to your personal dotfiles! These will be automatically cloned at start.", |
| 151 | +icon:"/emojis/1f3a8.png", |
| 152 | +mutable:true, |
| 153 | +type:"string", |
| 154 | +options:[], |
| 155 | +validation_max:0, |
| 156 | +validation_min:0, |
| 157 | +validation_regex:"((git|ssh|http(s)?)|(git@[w.]+))(:(//)?)([w.@:/-~]+)(/)?", |
| 158 | +validation_error:"Must be a valid Git URL!", |
| 159 | +}, |
| 160 | +workspaceBuildParameter:{ |
| 161 | +name:"Dotfiles URL", |
| 162 | +value:"", |
| 163 | +}, |
| 164 | +} |
| 165 | + |
| 166 | +exportconstDiskSize=Template.bind({}) |
| 167 | +DiskSize.args={ |
| 168 | +templateParameter:{ |
| 169 | +name:"Disk Size", |
| 170 | +default_value:"10", |
| 171 | +description:"The number of gigabytes for your persistent home volume.", |
| 172 | +icon:"", |
| 173 | +mutable:true, |
| 174 | +type:"number", |
| 175 | +options:[], |
| 176 | +validation_max:200, |
| 177 | +validation_min:10, |
| 178 | +validation_regex:"", |
| 179 | +validation_error:"Some GB", |
| 180 | +}, |
| 181 | +workspaceBuildParameter:{ |
| 182 | +name:"Dotfiles URL", |
| 183 | +value:"", |
| 184 | +}, |
| 185 | +} |