This commit is contained in:
Silas 2022-02-12 16:27:45 -05:00
parent 3828128165
commit fb0561e3a2
Signed by: silentsilas
GPG Key ID: 4199EFB7DAA34349
4 changed files with 14 additions and 9 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@intended/intended-ui",
"version": "0.1.19",
"version": "0.1.21",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@intended/intended-ui",
"version": "0.1.19",
"version": "0.1.21",
"license": "MIT",
"dependencies": {
"polished": "^4.1.3",

View File

@ -2,7 +2,7 @@
"name": "@intended/intended-ui",
"description": "Storybook UI library for Intended Link",
"license": "MIT",
"version": "0.1.19",
"version": "0.1.21",
"private": false,
"main": "dist/index.js",
"repository": "https://git.silentsilas.com/Intended/attendant.git",

View File

@ -16,4 +16,10 @@ const Template: ComponentStory<typeof Select> = (args: SelectProps) => (
);
export const Default = Template.bind({});
Default.args = { id: "testId" };
Default.args = {
children: [
"<option value='github'>Github</option>",
"<option value='facebook'>Facebook</option>"
],
id: "testId"
};

View File

@ -1,4 +1,4 @@
import React, { FC } from "react";
import React, { FC, ReactNode } from "react";
import styled from "styled-components";
import CSS from "csstype";
@ -11,18 +11,17 @@ import {
} from "../shared/styles";
export interface SelectProps {
children: ReactNode | null;
style?: CSS.Properties;
id: string;
value?: string;
onChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
}
const Select: FC<SelectProps> = ({ style, id, value = "github", onChange }) => {
const Select: FC<SelectProps> = ({ children, style, id, value = "github", onChange }) => {
return (
<StyledSelect style={style} id={id} value={value} onChange={onChange}>
<option value="github">Github</option>
<option value="facebook">Facebook</option>
<option value="Google">Google</option>
{ children }
</StyledSelect>
);
};