Skip to content

Commit 8c70904

Browse files
committed
add component size
1 parent 3bb57b3 commit 8c70904

File tree

1 file changed

+67
-43
lines changed
  • src/sections/Projects/Sistent/components/select

1 file changed

+67
-43
lines changed

src/sections/Projects/Sistent/components/select/index.js

+67-43
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React from "react";
22
import { navigate } from "gatsby";
33
import { useLocation } from "@reach/router";
44

5-
import { SistentThemeProvider, Button } from "@layer5/sistent";
5+
import { SistentThemeProvider } from "@layer5/sistent";
66
import TabButton from "../../../../../reusecore/Button";
77
import { SistentLayout } from "../../sistent-layout";
8-
import { Col, Row } from "../../../../../reusecore/Layout";
8+
import { Row } from "../../../../../reusecore/Layout";
99
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
1010
import {
1111
Container,
@@ -196,25 +196,19 @@ const SistentSelect = () => {
196196
<h2>Sizes</h2>
197197
</a>
198198
<p>
199-
For buttons to be fully effective, they can be adjusted in size to
200-
accommodate multiple use cases where they may apply. These size
201-
changes are usually done to the height of the buttons and not the
202-
width since buttons usually grow to contain their content. The
203-
height that makes up the different sizes of our buttons are gotten
204-
from our spacing system to retain space consistency. We have chosen
205-
two different sizes of buttons to provide options and more sizes can
206-
be added to fill the growing needs.
207-
</p>
208-
<h3>56px / 3.5rem</h3>
209-
<p>
210-
The 56px button is the first button size. It is currently the
211-
largest button available for use and it is available for both mobile
212-
and desktop resolutions, but it serves in different capacities
213-
across these different resolutions.
199+
The select component can be adjusted in size to accommodate various
200+
use cases. These size adjustments typically affect the height of the
201+
component, while the width adjusts to fit the content. The height of
202+
the select component is derived from our spacing system to maintain
203+
consistency. We offer multiple sizes to meet different needs.
214204
</p>
205+
<h3>Auto width</h3>
206+
{/* <p>
207+
The width of the component can scale
208+
</p> */}
215209
<Row $Hcenter className="image-container">
216210
<SistentThemeProvider initialMode={isDark ? "dark" : "light"}>
217-
<FormControl fullWidth>
211+
<FormControl sx={{ minWidth: "120px", m: 1 }}>
218212
<InputLabel id="demo-select-label">Age</InputLabel>
219213
<Select
220214
labelId="demo-select-label-standard"
@@ -229,32 +223,54 @@ const SistentSelect = () => {
229223
</FormControl>
230224
</SistentThemeProvider>
231225
</Row>
232-
<h3>48px / 3rem</h3>
233-
<p>
226+
<h3>Small</h3>
227+
{/* <p>
234228
The 48px button is the second button size currently in use and it is
235229
available from mobile to desktop resolutions, even though it serves
236230
in different capacities across these screen sizes.
237-
</p>
231+
</p> */}
238232
<Row $Hcenter className="image-container">
239233
<SistentThemeProvider initialMode={isDark ? "dark" : "light"}>
240-
<Button variant="contained" label="48px / 3rem" size="medium" />
234+
<FormControl sx={{ minWidth: "80px", m: 1 }} size="small">
235+
<InputLabel id="demo-select-label">Age</InputLabel>
236+
<Select
237+
labelId="demo-select-label-standard"
238+
id="demo-select-standard"
239+
label="Age"
240+
variant="standard"
241+
>
242+
<MenuItem value={10}>Ten</MenuItem>
243+
<MenuItem value={20}>Twenty</MenuItem>
244+
<MenuItem value={30}>Thirty</MenuItem>
245+
</Select>
246+
</FormControl>
241247
</SistentThemeProvider>
242248
</Row>
243249
<h3>Full width</h3>
244-
<p>
250+
{/* <p>
245251
Full width buttons are more efficient in mobile designs and rightly
246252
so in order to offer users with a wider touch area since the input
247253
devices - the fingers, are a lot larger than the cursor on a desktop
248254
or larger screen.
249-
</p>
255+
</p> */}
250256
<Row $Hcenter className="image-container">
251-
<Col sm={12}>
252-
<SistentThemeProvider initialMode={isDark ? "dark" : "light"}>
253-
<Button variant="contained" label="Full width" fullWidth />
254-
</SistentThemeProvider>
255-
</Col>
257+
<SistentThemeProvider initialMode={isDark ? "dark" : "light"}>
258+
<FormControl fullWidth sx={{ m: 1 }}>
259+
<InputLabel id="demo-select-label">Age</InputLabel>
260+
<Select
261+
labelId="demo-select-label-standard"
262+
id="demo-select-standard"
263+
label="Age"
264+
variant="standard"
265+
>
266+
<MenuItem value={10}>Ten</MenuItem>
267+
<MenuItem value={20}>Twenty</MenuItem>
268+
<MenuItem value={30}>Thirty</MenuItem>
269+
</Select>
270+
</FormControl>
271+
</SistentThemeProvider>
256272
</Row>
257-
<p>
273+
{/* <p>
258274
<strong>NOTE:</strong>
259275
</p>
260276
<p>
@@ -265,20 +281,28 @@ const SistentSelect = () => {
265281
48px is the default size. Preferred button sizes (height) are
266282
usually arrived at through exploration and proper consideration of
267283
industry standards and best practices.
268-
</p>
269-
<a id="Adding Icons">
270-
<h2>Adding Icons</h2>
284+
</p> */}
285+
<a id="Multiple select">
286+
<h2>Multiple select</h2>
271287
</a>
272-
<p>
273-
Sometimes, icons are used alongside labels in buttons to pass across
274-
specific information or relay added information for a higher level
275-
of understanding and better comprehension. Depending on the
276-
information being conveyed, the icons can be placed on the left side
277-
of the label text or on the right side of the label text. No
278-
specific rules apply apart from spacing tips which may be considered
279-
here. For full width buttons, if icons must be added, they should be
280-
centered in the button alongside the label text.
281-
</p>
288+
<Row $Hcenter className="image-container">
289+
<SistentThemeProvider initialMode={isDark ? "dark" : "light"}>
290+
<FormControl fullWidth sx={{ m: 1 }}>
291+
<InputLabel id="demo-select-label">Age</InputLabel>
292+
<Select
293+
labelId="demo-select-label-standard"
294+
id="demo-select-standard"
295+
label="Age"
296+
variant="standard"
297+
multiple
298+
>
299+
<MenuItem value={10}>Ten</MenuItem>
300+
<MenuItem value={20}>Twenty</MenuItem>
301+
<MenuItem value={30}>Thirty</MenuItem>
302+
</Select>
303+
</FormControl>
304+
</SistentThemeProvider>
305+
</Row>
282306
</div>
283307
</div>
284308
</SistentLayout>

0 commit comments

Comments
 (0)