Tab 1 Content
101 | ) 102 | }, { 103 | id: 'tab-2', 104 | label: 'Tab 2', 105 | view: () => ( 106 |Tab 2 Content
107 | ) 108 | }, { 109 | id: 'tab-3', 110 | label: 'Tab 3', 111 | view: TabComponent 112 | }]} 113 | /> 114 | ``` 115 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { IButtonProps } from './typings/Button'; 3 | import { ICheckboxProps } from './typings/Checkbox'; 4 | import { IInputProps } from './typings/Input'; 5 | import { IInputLabelProps } from './typings/InputLabel'; 6 | import { ITextareaProps } from './typings/Textarea'; 7 | import { IIconButtonProps } from './typings/IconButton'; 8 | import { ISelectOption, ISelectProps } from './typings/Select'; 9 | import { IOption as IOptionMenuOption, IOptionMenuProps } from './typings/OptionMenu'; 10 | import { ITab as ITabsTab, ITabsProps } from './typings/Tabs'; 11 | import { ControlSizes as EControlSizes, ButtonTypes as EButtonTypes } from './constants'; 12 | 13 | export type ISelectOption = ISelectOption; 14 | export type IOptionMenuOption = IOptionMenuOption; 15 | export type ITabsTab = ITabsTab; 16 | 17 | declare const ControlSizes: typeof EControlSizes; 18 | declare const ButtonTypes: typeof EButtonTypes; 19 | declare const Button: React.ComponentClass21 | {children} 22 |
23 | ); 24 | }) 25 | -------------------------------------------------------------------------------- /src/components/SectionTitle/index.ts: -------------------------------------------------------------------------------- 1 | export * from './SectionTitle'; 2 | -------------------------------------------------------------------------------- /src/components/Select/Select.module.scss: -------------------------------------------------------------------------------- 1 | .select, 2 | .optionsList { 3 | &.s { 4 | font-size: $font-size-s; 5 | } 6 | 7 | &.m { 8 | font-size: $font-size-m; 9 | } 10 | 11 | &.l { 12 | font-size: $font-size-l; 13 | } 14 | } 15 | 16 | .select { 17 | position: relative; 18 | box-sizing: border-box; 19 | display: flex; 20 | justify-content: flex-start; 21 | align-items: center; 22 | cursor: pointer; 23 | border: 1px solid rgba($color-dark, .1); 24 | height: 2.85em; 25 | padding: 0 0.857em; 26 | color: $color-darkgray; 27 | border-radius: 3px; 28 | user-select: none; 29 | 30 | &.extraRound { 31 | 32 | &, 33 | .optionsList { 34 | border-radius: 6px; 35 | } 36 | } 37 | 38 | &.cleanBorder { 39 | border: 1px solid transparent; 40 | 41 | &:hover { 42 | border: 1px solid rgba($color-dark, .1); 43 | 44 | .arrow { 45 | fill: $color-darkgray; 46 | } 47 | } 48 | 49 | .arrow { 50 | fill: $color-mediumgray; 51 | } 52 | } 53 | 54 | &.focus, 55 | &.cleanBorder.focus, 56 | &:focus { 57 | border: 2px solid $color-primary; 58 | padding: 0 calc(0.857em - 1px); 59 | } 60 | 61 | .input { 62 | display: none; 63 | } 64 | 65 | .placeholder { 66 | color: $color-mediumgray; 67 | } 68 | 69 | .value { 70 | display: flex; 71 | justify-content: flex-start; 72 | align-items: center; 73 | font-family: $font-family-body; 74 | 75 | .icon { 76 | display: flex; 77 | justify-content: center; 78 | align-items: center; 79 | margin-right: .5em; 80 | 81 | svg { 82 | height: 1em; 83 | width: auto; 84 | fill: currentColor; 85 | } 86 | } 87 | } 88 | 89 | .arrow { 90 | display: block; 91 | margin-left: auto; 92 | fill: $color-darkgray; 93 | } 94 | } 95 | 96 | .optionsList { 97 | position: absolute; 98 | display: block; 99 | overflow: auto; 100 | top: -2px; 101 | left: -2px; 102 | right: -2px; 103 | padding: .4em 0; 104 | margin: 0; 105 | list-style: none; 106 | background: $color-darkgray; 107 | color: $color-light; 108 | border-radius: 3px; 109 | box-shadow: 0 0 5px rgba($color-dark, .1); 110 | 111 | &.portaled { 112 | right: auto; 113 | } 114 | 115 | .option { 116 | position: relative; 117 | display: block; 118 | padding: .5em 1em .45em 3em; 119 | font-size: inherit; 120 | font-family: $font-family-body; 121 | 122 | &:hover { 123 | background: $color-primary; 124 | } 125 | 126 | .checkmark { 127 | position: absolute; 128 | top: 50%; 129 | left: .5em; 130 | fill: $color-light; 131 | transform: translateY(-48%); 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /src/components/Select/Select.stories.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ComponentStory, ComponentMeta } from '@storybook/react'; 3 | import { Select } from './Select'; 4 | 5 | export default { 6 | title: 'Select', 7 | component: Select, 8 | argTypes: { 9 | }, 10 | } as ComponentMeta