Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
border-top-left-radius: 0;
border-top-right-radius: 0;
}

&.onlyLeftBorder {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}

&.onlyRightBorder {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}

&.error {
border-color: var(--snackskal);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from "react";
import { LabelledSelect } from "./LabelledSelect";
import { Box } from "@stenajs-webui/core";
import { LabelledTextInput } from "../labelled-text-input/LabelledTextInput";

export default {
title: "forms/LabelledSelect",
Expand All @@ -12,6 +13,9 @@ const options = (
<option id={"1"} value={"dev"}>
Developer
</option>
<option id={"2"} value={"man"}>
Manager
</option>
<option id={"2"} value={"des"}>
Designer
</option>
Expand Down Expand Up @@ -42,6 +46,44 @@ export const Mobile = () => (
</Box>
);

export const Combined = () => (
<Box gap={5}>
<Box width={"500px"} display={"flex"} flexDirection={"row"}>
<LabelledSelect
label={"Who rocks?"}
name={"thebest"}
borderVariant="onlyLeftBorder"
onValueChange={(v) => console.log("Changed to", v)}
>
{options}
</LabelledSelect>
<LabelledTextInput
label={"Who rocks?"}
name={"thebest"}
borderRadiusVariant="onlyRight"
onValueChange={(v) => console.log("Changed to", v)}
/>
</Box>
<Box width={"500px"} display={"flex"} flexDirection={"row"}>
<LabelledTextInput
label={"Who rocks?"}
name={"thebest"}
borderRadiusVariant="onlyLeft"
onValueChange={(v) => console.log("Changed to", v)}
/>
<LabelledSelect
label={"Who rocks?"}
name={"thebest"}
borderVariant="onlyRightBorder"
onValueChange={(v) => console.log("Changed to", v)}
>
{options}
</LabelledSelect>
</Box>
</Box>

);

Mobile.parameters = {
viewport: {
defaultViewport: "mobile1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { SelectElementProps } from "@stenajs-webui/core";
export type SelectBorderVariant =
| "normalBorder"
| "onlyTopBorder"
| "onlyBottomBorder";
| "onlyBottomBorder"
| "onlyLeftBorder"
| "onlyRightBorder";

export interface LabelledSelectProps
extends ValueAndOnValueChangeProps<string>,
Expand Down