├── .gitignore ├── .prettierignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── lerna.json ├── package.json ├── packages ├── Alert │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Avatar │ ├── AvatarImage.tsx │ ├── AvatarStatus.tsx │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── BaseInput │ ├── Check.tsx │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Button │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── ButtonGroup │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Checkbox │ ├── index.tsx │ ├── package.json │ └── yarn.lock ├── ContainerHorizontal │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── ContainerVertical │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── ContentTitle │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Datepicker │ ├── Datepicker.tsx │ ├── DatepickerContainer.tsx │ ├── MonthListView.tsx │ ├── MonthView.tsx │ ├── YearListView.tsx │ ├── defaultRenders.tsx │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ ├── types.ts │ ├── useDatepickerValue.ts │ ├── useDatepickerView.ts │ ├── useVisibleDate.ts │ └── utils.ts ├── Divider │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Dropdown │ ├── DropdownButton.tsx │ ├── DropdownItem.tsx │ ├── DropdownMenu.tsx │ ├── index.tsx │ ├── package.json │ └── styles.scss ├── FormGroup │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── FormGroupContainer │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Icon │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ ├── uikon.eot │ ├── uikon.svg │ ├── uikon.ttf │ ├── uikon.woff │ └── yarn.lock ├── LoaderDots │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Modal │ ├── ModalBody.tsx │ ├── ModalBodySecondary.tsx │ ├── ModalFooter.tsx │ ├── ModalHeader.tsx │ ├── ModalTitle.tsx │ ├── Overlay.tsx │ ├── index.tsx │ ├── package.json │ └── styles.scss ├── NavLink │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── NavPanel │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── NavSection │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── NavSectionTitle │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── NavTitle │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── OuterEventsHandler │ ├── index.tsx │ ├── package.json │ └── styles.scss ├── Progress │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── README.md ├── Radio │ ├── index.tsx │ └── package.json ├── ScrollArea │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Select │ ├── SelectButton.tsx │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ ├── types.ts │ ├── utils.tsx │ └── yarn.lock ├── SelectDate │ ├── defaultRenders.tsx │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ ├── types.ts │ └── yarn.lock ├── Tabs │ ├── TabItem.tsx │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── TextArea │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── TextField │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Toggle │ ├── index.tsx │ └── package.json ├── TopBar │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── TopBarLink │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── TopBarLinkContainer │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── TopBarMenuDivider │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── TopBarSection │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── TopBarTitle │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── Widget │ ├── Widget.tsx │ ├── WidgetContainer.tsx │ ├── WidgetContent.tsx │ ├── WidgetHeader.tsx │ ├── WidgetTable.tsx │ ├── index.tsx │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── copyTypes.script.js ├── core │ ├── _mixins.scss │ ├── _vars.scss │ ├── index.ts │ ├── normalize.scss │ ├── package-lock.json │ ├── package.json │ ├── styles.scss │ └── yarn.lock ├── createSimpleComponent │ ├── index.tsx │ ├── package.json │ └── yarn.lock ├── docs │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── now.json │ ├── package.json │ ├── public │ │ ├── OGDocumentation.jpg │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ ├── src │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── Docs │ │ │ ├── React │ │ │ │ ├── Alert │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Avatar │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── BuildingForms │ │ │ │ │ └── index.tsx │ │ │ │ ├── BuildingLayout │ │ │ │ │ └── index.tsx │ │ │ │ ├── BuildingNavPanel │ │ │ │ │ └── index.tsx │ │ │ │ ├── BuildingTabNavigation │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── BuildingTopBar │ │ │ │ │ └── index.tsx │ │ │ │ ├── Button │ │ │ │ │ ├── CustomRendering.tsx │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── ButtonGroup │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Checkbox │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── ComponentProperty │ │ │ │ │ └── index.tsx │ │ │ │ ├── ContainerHorizontal │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── ContainerVertical │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── DatePicker │ │ │ │ │ ├── CustomRendering.tsx │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Dropdown │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Icon │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ ├── docs-icons.module.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── Installation │ │ │ │ │ └── index.tsx │ │ │ │ ├── Modal │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── NavLink │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── NavPanel │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── NavSection │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── NavSectionTitle │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── NavTitle │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── OuterEventsHandler │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Overview │ │ │ │ │ └── index.tsx │ │ │ │ ├── Progress │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Radio │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── ScrollArea │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Select │ │ │ │ │ ├── ExampleSelectBasic.tsx │ │ │ │ │ ├── ExampleSelectControlledValue.tsx │ │ │ │ │ ├── ExampleSelectItemProps.tsx │ │ │ │ │ ├── ExampleSelectMulti.tsx │ │ │ │ │ ├── ExampleSelectUsers.tsx │ │ │ │ │ ├── ExampleSelectUsersSearch.tsx │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── select.module.scss │ │ │ │ ├── SelectDate │ │ │ │ │ ├── CustomRendering.tsx │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Styleguide │ │ │ │ │ ├── components │ │ │ │ │ │ ├── ColorScheme.tsx │ │ │ │ │ │ ├── ComponentTitle.tsx │ │ │ │ │ │ ├── Content.tsx │ │ │ │ │ │ ├── TopBar.tsx │ │ │ │ │ │ ├── TopBarTitle.tsx │ │ │ │ │ │ ├── base.tsx │ │ │ │ │ │ └── styleguide.module.scss │ │ │ │ │ ├── index.tsx │ │ │ │ │ ├── sections │ │ │ │ │ │ ├── Avatars.tsx │ │ │ │ │ │ ├── Buttons.tsx │ │ │ │ │ │ ├── Checkboxes.tsx │ │ │ │ │ │ ├── Inputs.tsx │ │ │ │ │ │ ├── Radios.tsx │ │ │ │ │ │ ├── Toggles.tsx │ │ │ │ │ │ ├── Typography.tsx │ │ │ │ │ │ ├── styleguide-buttons.module.scss │ │ │ │ │ │ ├── styleguide-checkboxes.module.scss │ │ │ │ │ │ └── styleguide-typography.module.scss │ │ │ │ │ └── styleguide.module.scss │ │ │ │ ├── TabItem │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Tabs │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── TextArea │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── TextField │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── Theming │ │ │ │ │ ├── colors.ts │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── theming.module.scss │ │ │ │ ├── Toggle │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── TopBar │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── TopBarLink │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── TopBarLinkContainer │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── TopBarSection │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── TopBarTitle │ │ │ │ │ ├── PropTable.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── UseInCreateReactApp │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── links.ts │ │ │ ├── TopBar │ │ │ │ ├── index.tsx │ │ │ │ └── topbar.module.scss │ │ │ ├── components │ │ │ │ ├── DocsContentPage.tsx │ │ │ │ ├── ExampleTable.tsx │ │ │ │ ├── ImportPath.tsx │ │ │ │ ├── PageContent.tsx │ │ │ │ ├── PageMock.tsx │ │ │ │ ├── PropTable.tsx │ │ │ │ ├── Table.tsx │ │ │ │ ├── docspage.module.scss │ │ │ │ ├── index.ts │ │ │ │ ├── properties.tsx │ │ │ │ └── types.ts │ │ │ └── index.tsx │ │ ├── assets │ │ │ ├── a01.jpg │ │ │ ├── a02.jpg │ │ │ ├── a03.jpg │ │ │ ├── a04.jpg │ │ │ ├── a05.jpg │ │ │ ├── a06.jpg │ │ │ ├── a07.jpg │ │ │ ├── a08.jpg │ │ │ ├── a09.jpg │ │ │ ├── a10.jpg │ │ │ ├── a11.jpg │ │ │ ├── a12.jpg │ │ │ ├── a13.jpg │ │ │ ├── a14.jpg │ │ │ ├── a15.jpg │ │ │ ├── a16.jpg │ │ │ ├── a17.jpg │ │ │ ├── a18.jpg │ │ │ ├── a19.jpg │ │ │ ├── a20.jpg │ │ │ ├── a21.jpg │ │ │ ├── a22.jpg │ │ │ ├── a23.jpg │ │ │ ├── a24.jpg │ │ │ ├── a25.jpg │ │ │ ├── a26.jpg │ │ │ ├── a27.jpg │ │ │ ├── a28.jpg │ │ │ ├── a29.jpg │ │ │ ├── a30.jpg │ │ │ ├── a31.jpg │ │ │ ├── a32.jpg │ │ │ ├── buildings │ │ │ │ ├── b01.jpg │ │ │ │ ├── b02.jpg │ │ │ │ ├── b03.jpg │ │ │ │ ├── b04.jpg │ │ │ │ ├── b05.jpg │ │ │ │ ├── b06.jpg │ │ │ │ ├── b07.jpg │ │ │ │ ├── b08.jpg │ │ │ │ ├── b09.jpg │ │ │ │ ├── b10.jpg │ │ │ │ ├── b100.jpg │ │ │ │ ├── b101.jpg │ │ │ │ ├── b102.jpg │ │ │ │ ├── b103.jpg │ │ │ │ ├── b104.jpg │ │ │ │ ├── b105.jpg │ │ │ │ ├── b11.jpg │ │ │ │ ├── b12.jpg │ │ │ │ ├── b13.jpg │ │ │ │ ├── b14.jpg │ │ │ │ ├── b15.jpg │ │ │ │ ├── b16.jpg │ │ │ │ ├── b17.jpg │ │ │ │ ├── b18.jpg │ │ │ │ ├── b19.jpg │ │ │ │ ├── b20.jpg │ │ │ │ ├── b21.jpg │ │ │ │ ├── b22.jpg │ │ │ │ ├── b23.jpg │ │ │ │ ├── b24.jpg │ │ │ │ ├── b25.jpg │ │ │ │ ├── b26.jpg │ │ │ │ └── map.jpg │ │ │ ├── flag01.jpg │ │ │ ├── flags │ │ │ │ ├── Czechia.png │ │ │ │ ├── France.png │ │ │ │ ├── Ireland.png │ │ │ │ ├── Norway.png │ │ │ │ ├── Tuvalu.png │ │ │ │ └── Uk.png │ │ │ ├── index.ts │ │ │ ├── pl01.jpg │ │ │ ├── social │ │ │ │ ├── jpegs │ │ │ │ │ ├── s01.jpg │ │ │ │ │ ├── s02.jpg │ │ │ │ │ ├── s03.jpg │ │ │ │ │ ├── s04.jpg │ │ │ │ │ ├── s05.jpg │ │ │ │ │ ├── s06.jpg │ │ │ │ │ ├── s07.jpg │ │ │ │ │ ├── s08.jpg │ │ │ │ │ └── s09.jpg │ │ │ │ ├── original │ │ │ │ │ ├── 4a075a428e564d7a47e3a41525d455a7495f847f.png │ │ │ │ │ ├── s01.png │ │ │ │ │ ├── s02.png │ │ │ │ │ ├── s03.png │ │ │ │ │ ├── s04.png │ │ │ │ │ ├── s05.png │ │ │ │ │ ├── s06.png │ │ │ │ │ ├── s07.png │ │ │ │ │ ├── s08.png │ │ │ │ │ └── s09.png │ │ │ │ ├── s01.jpg │ │ │ │ ├── s02.jpg │ │ │ │ ├── s03.jpg │ │ │ │ ├── s04.jpg │ │ │ │ ├── s05.jpg │ │ │ │ ├── s06.jpg │ │ │ │ ├── s07.jpg │ │ │ │ ├── s08.jpg │ │ │ │ └── s09.jpg │ │ │ ├── t01.jpg │ │ │ ├── t02.jpg │ │ │ ├── t03.jpg │ │ │ ├── t04.jpg │ │ │ ├── t05.jpg │ │ │ ├── t06.jpg │ │ │ ├── ua01.svg │ │ │ ├── ua02.svg │ │ │ ├── vt01.jpg │ │ │ ├── vt02.jpg │ │ │ ├── vt03.jpg │ │ │ ├── vt04.jpg │ │ │ └── vt05.jpg │ │ ├── bootstrap.css │ │ ├── components │ │ │ ├── Code │ │ │ │ ├── atom-dark.scss │ │ │ │ ├── code.module.scss │ │ │ │ ├── index.tsx │ │ │ │ └── vs.scss │ │ │ ├── CodeExample │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.scss │ │ │ ├── CodeRH │ │ │ │ ├── docspage.module.scss │ │ │ │ └── index.tsx │ │ │ ├── ExtLink.tsx │ │ │ ├── H1.tsx │ │ │ ├── PageScroll │ │ │ │ ├── index.tsx │ │ │ │ └── page-scroll.module.scss │ │ │ └── index.ts │ │ ├── index.tsx │ │ ├── logo.svg │ │ ├── react-app-env.d.ts │ │ ├── serviceWorker.ts │ │ ├── types │ │ │ └── react-element-to-jsx-string.d.ts │ │ └── utils │ │ │ ├── camelToSnake.ts │ │ │ ├── camelToText.ts │ │ │ ├── combineText.ts │ │ │ ├── copyToClipboard.ts │ │ │ ├── index.ts │ │ │ ├── jsxToString.ts │ │ │ ├── sortString.ts │ │ │ ├── useInputControls.ts │ │ │ └── useLocalStorage.ts │ ├── tsconfig-paths.json │ ├── tsconfig.json │ └── yarn.lock ├── kit │ ├── cssbundle.js │ ├── index.ts │ ├── package.json │ └── styles.scss ├── module.d.ts ├── tsconfig.json ├── useOpenState │ ├── index.tsx │ └── package.json ├── utils │ ├── index.ts │ └── package.json ├── webpack.config.js └── webpack.cssbundle.config.js ├── prettier.config.js ├── tsconfig.json ├── tslint.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | # envs 4 | .env.local 5 | .env.development.local 6 | .env.test.local 7 | .env.production.local 8 | 9 | # logs 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | lerna-debug.log* 14 | 15 | dist 16 | __generated_types -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.d.ts -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.eol": "\n", 3 | "files.associations": { 4 | "*.jsx": "javascript" 5 | }, 6 | "editor.tabSize": 2, 7 | // Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down. 8 | "editor.formatOnSave": true, 9 | // "javascript.format.enable": false, 10 | // "javascript.validate.enable": false, 11 | "typescript.format.enable": true, 12 | "editor.codeActionsOnSave": { 13 | "source.fixAll.tslint": true, 14 | }, 15 | // Use 'prettier-eslint' instead of 'prettier'. Other settings will only be fallbacks in case they could not be inferred from eslint rules. 16 | "prettier.eslintIntegration": true 17 | } 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Roman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ⚠️ This repository is no longer maintained ⚠️ 2 | 3 | ___ 4 | 5 | # Dashboard UI kit 6 | 7 | React UI component library for rapid UI development. Written in Typescript. 8 | 9 | ### Features 10 | 11 | - Typescript 12 | - Light/Dark/Custom Theme support 13 | - Bootstrap friendly 14 | - Minimum dependencies 15 | - Simple Component API 16 | - Lightweight 17 | 18 | ![Dashboard UI Kit](http://preview.dashboard-ui.com/OGDocumentation.jpg) 19 | 20 | ### Links 21 | 22 | - Read the docs: https://developer.dashboard-ui.com 23 | - Quick 3 mins Installation guide: https://developer.dashboard-ui.com/docs/react/installation 24 | - Precoded screen previews: https://preview.dashboard-ui.com/ 25 | - Download Design Kit and prevoded previews (Sketch, PS, XD): http://janlosert.com/dashboard 26 | 27 | ## Usage 28 | 29 | `import { Button } from '@duik/it'` 30 | 31 | --- 32 | 33 | Need help with your project? Feel free to contact me [march08@outlook.com](mailto:march08@outlook.com) 34 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmClient": "yarn", 3 | "packages": [ 4 | "packages/*" 5 | ], 6 | "version": "0.6.0" 7 | } 8 | -------------------------------------------------------------------------------- /packages/Alert/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import classnames from "classnames"; 3 | import cls from "./styles.scss"; 4 | 5 | export type AlertProps = JSX.IntrinsicElements["div"] & { 6 | primary?: boolean; 7 | success?: boolean; 8 | warning?: boolean; 9 | danger?: boolean; 10 | leftEl?: React.ReactNode; 11 | rightEl?: React.ReactNode; 12 | }; 13 | 14 | export const Alert = (props: AlertProps) => { 15 | const { 16 | className, 17 | primary, 18 | success, 19 | warning, 20 | danger, 21 | children, 22 | leftEl, 23 | rightEl, 24 | ...rest 25 | } = props; 26 | return ( 27 |
37 | {leftEl &&
{leftEl}
} 38 |
{children}
39 | {rightEl &&
{rightEl}
} 40 |
41 | ); 42 | }; 43 | 44 | Alert.displayName = "Alert"; 45 | 46 | export default Alert; 47 | -------------------------------------------------------------------------------- /packages/Alert/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/alert", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Alert", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0" 21 | }, 22 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 23 | } 24 | -------------------------------------------------------------------------------- /packages/Alert/styles.scss: -------------------------------------------------------------------------------- 1 | @import '@duik/core/_vars.scss'; 2 | 3 | .alert { 4 | border-radius: 4px; 5 | background: $bg-base; 6 | border: $border-default-base; 7 | font-size: 0.875rem; 8 | font-weight: 500; 9 | padding: 0.875rem 1rem; 10 | line-height: 1.4; 11 | display: flex; 12 | justify-content: space-between; 13 | align-items: flex-start; 14 | width: calc(100% - 60px); 15 | max-width: 760px; 16 | 17 | & > * { 18 | flex-grow: 1; 19 | } 20 | } 21 | 22 | .alert-left-el { 23 | flex-grow: 0; 24 | margin-right: 1rem; 25 | margin-top: 2px; 26 | } 27 | 28 | .alert-right-el { 29 | flex-grow: 0; 30 | margin-left: 1rem; 31 | 32 | :global(.close) { 33 | font-size: 1rem; 34 | display: block; 35 | 36 | &, 37 | &:focus, 38 | &:hover, 39 | &:active { 40 | padding: 1px; 41 | outline: 0; 42 | box-shadow: none; 43 | background: transparent; 44 | background-image: none; 45 | border: none !important; 46 | } 47 | } 48 | } 49 | 50 | .alert[class*='alert-'] { 51 | color: $text-adverse-main; 52 | 53 | p, 54 | h1, 55 | h2, 56 | h3, 57 | h4, 58 | h5, 59 | h6 { 60 | color: $text-adverse-main; 61 | } 62 | 63 | p { 64 | opacity: 0.8; 65 | } 66 | 67 | .alert-left-el, 68 | .alert-right-el { 69 | color: $text-adverse-main; 70 | } 71 | 72 | :global(.close) { 73 | color: $text-adverse-main; 74 | } 75 | } 76 | 77 | @include generateColorDomainProperty('.alert', 'background-color'); 78 | -------------------------------------------------------------------------------- /packages/Avatar/AvatarStatus.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import cls from "./styles.scss"; 3 | 4 | export type AvatarStatusProps = { 5 | status: React.ReactNode; 6 | }; 7 | 8 | export const AvatarStatus = ({ status }: AvatarStatusProps) => ( 9 |
10 | {status === "uik_online" ? ( 11 |
12 | ) : ( 13 | {status} 14 | )} 15 |
16 | ); 17 | 18 | AvatarStatus.displayName = "AvatarStatus"; 19 | 20 | export default AvatarStatus; 21 | -------------------------------------------------------------------------------- /packages/Avatar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/avatar", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Avatar", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0", 21 | "@duik/loader-dots": "^0.6.0" 22 | }, 23 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 24 | } 25 | -------------------------------------------------------------------------------- /packages/BaseInput/Check.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import cls from './styles.scss'; 4 | 5 | /* eslint-disable max-len */ 6 | export const CheckboxIcon = () => ( 7 | 14 | 15 | 22 | 27 | 28 | 32 | 33 | 34 | 35 | 36 | ); 37 | 38 | CheckboxIcon.displayName = 'CheckboxIcon'; 39 | -------------------------------------------------------------------------------- /packages/BaseInput/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import classnames from 'classnames'; 3 | import cls from './styles.scss'; 4 | import { CheckboxIcon } from './Check'; 5 | 6 | export type InputBaseProps = JSX.IntrinsicElements['input'] & { 7 | label?: React.ReactNode; 8 | description?: React.ReactNode; 9 | }; 10 | 11 | export const BaseInput = ({ 12 | label, 13 | className, 14 | description, 15 | toggle, 16 | name, 17 | type, 18 | ...rest 19 | }: InputBaseProps & { 20 | toggle?: boolean; 21 | }) => { 22 | const isRadio = type === 'radio'; 23 | return ( 24 | 44 | ); 45 | }; 46 | 47 | BaseInput.displayName = 'BaseInput'; 48 | 49 | export default BaseInput; 50 | -------------------------------------------------------------------------------- /packages/BaseInput/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/base-input", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Base input for checkbox, toggle and radio", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0" 21 | }, 22 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 23 | } 24 | -------------------------------------------------------------------------------- /packages/Button/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/button", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Button", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0", 21 | "@duik/loader-dots": "^0.6.0" 22 | }, 23 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 24 | } 25 | -------------------------------------------------------------------------------- /packages/ButtonGroup/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import classnames from "classnames"; 3 | 4 | import cls from "./styles.scss"; 5 | 6 | export type ButtonGroupProps = JSX.IntrinsicElements["div"] & { 7 | vertical?: boolean; 8 | sm?: boolean; 9 | lg?: boolean; 10 | }; 11 | 12 | export const ButtonGroup = ({ 13 | children, 14 | className, 15 | vertical, 16 | sm, 17 | lg, 18 | ...rest 19 | }: ButtonGroupProps) => ( 20 |
29 | {children} 30 |
31 | ); 32 | 33 | ButtonGroup.defaultProps = { 34 | className: null, 35 | children: null, 36 | vertical: false 37 | }; 38 | 39 | ButtonGroup.displayName = "ButtonGroup"; 40 | 41 | export default ButtonGroup; 42 | -------------------------------------------------------------------------------- /packages/ButtonGroup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/button-group", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Button Group", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0" 21 | }, 22 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 23 | } 24 | -------------------------------------------------------------------------------- /packages/Checkbox/index.tsx: -------------------------------------------------------------------------------- 1 | import { BaseInput } from "@duik/base-input"; 2 | 3 | export const Checkbox = BaseInput; 4 | 5 | Checkbox.displayName = "Checkbox"; 6 | 7 | export default Checkbox; 8 | -------------------------------------------------------------------------------- /packages/Checkbox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/checkbox", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Checkbox", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/base-input": "^0.6.0" 21 | }, 22 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 23 | } 24 | -------------------------------------------------------------------------------- /packages/ContainerHorizontal/index.tsx: -------------------------------------------------------------------------------- 1 | import createSimpleComponent from "@duik/create-simple-component"; 2 | import cls from "./styles.scss"; 3 | 4 | export const ContainerHorizontal = createSimpleComponent({ 5 | displayName: "ContainerHorizontal", 6 | className: cls["container-horizontal"], 7 | Component: "div" 8 | }); 9 | 10 | export default ContainerHorizontal; 11 | -------------------------------------------------------------------------------- /packages/ContainerHorizontal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/container-horizontal", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Layout Horizontal Container", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0", 21 | "@duik/create-simple-component": "^0.6.0" 22 | }, 23 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 24 | } 25 | -------------------------------------------------------------------------------- /packages/ContainerHorizontal/styles.scss: -------------------------------------------------------------------------------- 1 | .container-horizontal { 2 | display: flex; 3 | flex-grow: 1; 4 | height: 100%; 5 | min-width: 1px; 6 | width: 100%; 7 | 8 | &>* { 9 | min-width: 1px; 10 | } 11 | } -------------------------------------------------------------------------------- /packages/ContainerVertical/index.tsx: -------------------------------------------------------------------------------- 1 | import createSimpleComponent from "@duik/create-simple-component"; 2 | import cls from "./styles.scss"; 3 | 4 | export const ContainerVertical = createSimpleComponent({ 5 | displayName: "ContainerVertical", 6 | className: cls["container-vertical"], 7 | Component: "div" 8 | }); 9 | 10 | export default ContainerVertical; 11 | -------------------------------------------------------------------------------- /packages/ContainerVertical/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/container-vertical", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Layout Vertical Container", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0", 21 | "@duik/create-simple-component": "^0.6.0" 22 | }, 23 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 24 | } 25 | -------------------------------------------------------------------------------- /packages/ContainerVertical/styles.scss: -------------------------------------------------------------------------------- 1 | .container-vertical { 2 | display: flex; 3 | flex-direction: column; 4 | height: 100%; 5 | flex-grow: 1; 6 | min-height: 1px; 7 | 8 | &>* { 9 | min-height: 1px; 10 | } 11 | } -------------------------------------------------------------------------------- /packages/ContentTitle/index.tsx: -------------------------------------------------------------------------------- 1 | import createSimpleComponent from "@duik/create-simple-component"; 2 | import cls from "./styles.scss"; 3 | 4 | export const ContentTitle = createSimpleComponent({ 5 | displayName: "ContentTitle", 6 | className: cls["content-title"], 7 | Component: "span" 8 | }); 9 | 10 | export default ContentTitle; 11 | -------------------------------------------------------------------------------- /packages/ContentTitle/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/content-title", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit ContentTitle", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0", 21 | "@duik/create-simple-component": "^0.6.0" 22 | }, 23 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 24 | } 25 | -------------------------------------------------------------------------------- /packages/ContentTitle/styles.scss: -------------------------------------------------------------------------------- 1 | @import "@duik/core/_vars.scss"; 2 | 3 | .content-title { 4 | @include content-title(); 5 | } -------------------------------------------------------------------------------- /packages/Datepicker/DatepickerContainer.tsx: -------------------------------------------------------------------------------- 1 | import createSimpleComponent from "@duik/create-simple-component"; 2 | import cls from "./styles.scss"; 3 | 4 | export const DatepickerContainer = createSimpleComponent({ 5 | displayName: "DatepickerContainer", 6 | className: cls["datepicker-container"], 7 | Component: "div" 8 | }); 9 | 10 | export default DatepickerContainer; 11 | -------------------------------------------------------------------------------- /packages/Datepicker/MonthListView.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import cls from './styles.scss'; 4 | 5 | import { generateArrayOfLen, isMonthDisabled } from './utils'; 6 | 7 | export type MonthListViewProps = { 8 | handleMonthSelect: (monthNumber: number) => void; 9 | renderMonthName: (monthNumber: number) => React.ReactNode; 10 | minDate?: Date; 11 | maxDate?: Date; 12 | visibleDate: Date; 13 | }; 14 | 15 | export const MonthListView = (props: MonthListViewProps) => { 16 | const { 17 | handleMonthSelect, 18 | renderMonthName, 19 | minDate, 20 | maxDate, 21 | visibleDate 22 | } = props; 23 | 24 | const visibleYear = visibleDate.getFullYear(); 25 | 26 | return ( 27 |
28 | {generateArrayOfLen(12, 0).map(monthNumber => { 29 | const onClickMonth = () => { 30 | handleMonthSelect(monthNumber); 31 | }; 32 | return ( 33 | 46 | ); 47 | })} 48 |
49 | ); 50 | }; 51 | 52 | MonthListView.displayName = 'MonthListView'; 53 | -------------------------------------------------------------------------------- /packages/Datepicker/YearListView.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import cls from './styles.scss'; 4 | 5 | import { generateArrayOfLen, isYearDisabled } from './utils'; 6 | 7 | export type YearListViewProps = { 8 | handleYearSelect: (yearNumber: number) => void; 9 | minDate?: Date; 10 | maxDate?: Date; 11 | visibleDate: Date; 12 | }; 13 | 14 | export const YearListView = (props: YearListViewProps) => { 15 | const { visibleDate, handleYearSelect, minDate, maxDate } = props; 16 | const currentYear = visibleDate.getFullYear(); 17 | const startYear = currentYear - (currentYear % 12); 18 | return ( 19 |
20 | {generateArrayOfLen(12, startYear).map(yearNumber => { 21 | const onClickMonth = () => { 22 | handleYearSelect(yearNumber); 23 | }; 24 | return ( 25 | 38 | ); 39 | })} 40 |
41 | ); 42 | }; 43 | 44 | YearListView.displayName = 'YearListView'; 45 | -------------------------------------------------------------------------------- /packages/Datepicker/defaultRenders.tsx: -------------------------------------------------------------------------------- 1 | import { DatepickerView } from "./useDatepickerView"; 2 | 3 | const months = [ 4 | "January", 5 | "February", 6 | "March", 7 | "April", 8 | "May", 9 | "June", 10 | "July", 11 | "August", 12 | "September", 13 | "October", 14 | "November", 15 | "December" 16 | ]; 17 | 18 | export const getMonthText = (date: Date) => { 19 | const monthNumber = date.getMonth(); 20 | return months[monthNumber]; 21 | }; 22 | 23 | export const getMonthTextByMonthNumber = (monthNumber: number) => { 24 | return months[monthNumber]; 25 | }; 26 | 27 | const weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; 28 | 29 | export const defaultRenderTitle = ( 30 | visibleDate: Date, 31 | activeView: DatepickerView 32 | ) => { 33 | switch (activeView) { 34 | case DatepickerView.month: 35 | return `${getMonthText(visibleDate)} ${visibleDate.getFullYear()}`; 36 | case DatepickerView.monthList: 37 | return visibleDate.getFullYear(); 38 | default: 39 | return "Select Year"; 40 | } 41 | }; 42 | 43 | export const defaultRenderMonthName = (monthNumber: number) => 44 | getMonthTextByMonthNumber(monthNumber); 45 | 46 | export const defaultRenderWeekdayShort = (weekdayNumber: number) => { 47 | return weekdaysShort[weekdayNumber]; 48 | }; 49 | -------------------------------------------------------------------------------- /packages/Datepicker/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./Datepicker"; 2 | export * from "./DatepickerContainer"; 3 | export * from "./types"; 4 | export * from "./useDatepickerValue"; 5 | -------------------------------------------------------------------------------- /packages/Datepicker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/datepicker", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Datepicker", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "peerDependencies": { 15 | "classnames": "^2.2.6", 16 | "react": "^16.8.0", 17 | "react-dom": "^16.8.0" 18 | }, 19 | "dependencies": { 20 | "@duik/core": "^0.6.0", 21 | "@duik/create-simple-component": "^0.6.0" 22 | }, 23 | "gitHead": "efe4e90b5b41da75ba32d08b41f180519daca614" 24 | } 25 | -------------------------------------------------------------------------------- /packages/Datepicker/types.ts: -------------------------------------------------------------------------------- 1 | export type DatepickerRangeValue = { 2 | from?: Date | null | undefined; 3 | to?: Date | null | undefined; 4 | }; 5 | 6 | export type DatepickerSimpleValue = Date | null | undefined; 7 | 8 | export type DatepickerValue = M extends true 9 | ? DatepickerRangeValue 10 | : DatepickerSimpleValue; 11 | 12 | export type DatepickerOnChange = ( 13 | value: DatepickerValue 14 | ) => void; 15 | -------------------------------------------------------------------------------- /packages/Datepicker/useDatepickerValue.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { DatepickerValue, DatepickerOnChange } from "./types"; 4 | 5 | const getValue = ( 6 | value?: DatepickerValue, 7 | isRange?: M 8 | ) => { 9 | if (!!isRange && !value) { 10 | return { from: undefined, to: undefined } as DatepickerValue; 11 | } 12 | 13 | return value; 14 | }; 15 | 16 | export const useDatepickerValue = ( 17 | controlledValue?: DatepickerValue, 18 | isRange?: M, 19 | onDateChange?: DatepickerOnChange 20 | ) => { 21 | const defaultValue = getValue(controlledValue, isRange); 22 | 23 | const [innerValue, setInnerValue] = React.useState< 24 | DatepickerValue | undefined 25 | >(defaultValue); 26 | 27 | const value = 28 | typeof controlledValue === "undefined" ? innerValue : controlledValue; 29 | 30 | const setValue = (value: DatepickerValue) => { 31 | setInnerValue(value); 32 | if (onDateChange) { 33 | onDateChange(value); 34 | } 35 | }; 36 | 37 | return { 38 | value, 39 | setValue 40 | }; 41 | }; 42 | -------------------------------------------------------------------------------- /packages/Datepicker/useDatepickerView.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export enum DatepickerView { 4 | month = "MONTH", 5 | monthList = "MONTH_LIST", 6 | yearList = "YEAR_LIST" 7 | } 8 | 9 | export const useDatepickerView = ( 10 | initialView: DatepickerView = DatepickerView.month 11 | ) => { 12 | const [activeView, setView] = React.useState(initialView); 13 | 14 | const setNextView = () => { 15 | if (activeView === DatepickerView.yearList) { 16 | setView(DatepickerView.monthList); 17 | } else if (activeView === DatepickerView.monthList) { 18 | setView(DatepickerView.month); 19 | } 20 | }; 21 | 22 | const setPrevView = () => { 23 | if (activeView === DatepickerView.monthList) { 24 | setView(DatepickerView.yearList); 25 | } else if (activeView === DatepickerView.month) { 26 | setView(DatepickerView.monthList); 27 | } 28 | }; 29 | 30 | return { 31 | activeView, 32 | setNextView, 33 | setPrevView, 34 | setView 35 | }; 36 | }; 37 | -------------------------------------------------------------------------------- /packages/Divider/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import classnames from "classnames"; 3 | 4 | import cls from "./styles.scss"; 5 | 6 | export type DividerProps = JSX.IntrinsicElements["div"] & { 7 | vertical?: boolean; 8 | margin?: boolean; 9 | }; 10 | 11 | export const Divider = ({ 12 | children, 13 | className, 14 | vertical, 15 | margin, 16 | ...rest 17 | }: DividerProps) => ( 18 |
28 | {children} 29 |
30 | ); 31 | 32 | Divider.defaultProps = { 33 | className: null, 34 | children: null, 35 | vertical: false 36 | }; 37 | 38 | Divider.displayName = "Divider"; 39 | 40 | export default Divider; 41 | -------------------------------------------------------------------------------- /packages/Divider/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@duik/divider", 3 | "version": "0.6.0", 4 | "description": "Dashboard UI Kit Divider", 5 | "main": "dist/index.js", 6 | "repository": "https://github.com/march08/duik", 7 | "homepage": "https://developer.dashboard-ui.com", 8 | "author": "Roman Nguyen ", 9 | "license": "MIT", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "private": false, 14 | "dependencies": { 15 | "@duik/core": "^0.6.0" 16 | }, 17 | "peerDependencies": { 18 | "classnames": "^2.2.6", 19 | "react": "^16.8.0", 20 | "react-dom": "^16.8.0" 21 | }, 22 | "gitHead": "7eed8237276864892b18bf2999daaf73ffc04739" 23 | } 24 | -------------------------------------------------------------------------------- /packages/Divider/styles.scss: -------------------------------------------------------------------------------- 1 | @import '@duik/core/_vars.scss'; 2 | 3 | .divider-horizontal { 4 | height: 1px; 5 | width: 100%; 6 | background: $border-color-base; 7 | 8 | &.divider-margin { 9 | margin-top: 24px; 10 | margin-bottom: 24px; 11 | } 12 | } 13 | 14 | .divider-vertical { 15 | width: 1px; 16 | height: 100%; 17 | background: $border-color-base; 18 | 19 | &.divider-margin { 20 | margin-left: 24px; 21 | margin-right: 24px; 22 | } 23 | } -------------------------------------------------------------------------------- /packages/Dropdown/DropdownButton.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import classnames from 'classnames'; 3 | import { Button, ButtonPropsBase, ButtonRefObject } from '@duik/button'; 4 | 5 | import { OpenStateControls } from '@duik/use-open-state'; 6 | import cls from './styles.scss'; 7 | 8 | export type DropdownButtonProps

= OpenStateControls & 9 | ButtonPropsBase & 10 | JSX.IntrinsicElements['button'] & 11 | P & { 12 | hideArrows?: boolean; 13 | }; 14 | 15 | export const DropdownButton = (props: DropdownButtonProps) => { 16 | const { 17 | // remove this from ...rest 18 | handleClose, 19 | handleOpen, 20 | setOpenState, 21 | // using 22 | handleToggle, 23 | isOpen, 24 | children, 25 | className, 26 | hideArrows = false, 27 | ...rest 28 | } = props; 29 | return ( 30 | 42 | ); 43 | }; 44 | 45 | DropdownButton.defaultProps = { 46 | children: 'Action' 47 | }; 48 | 49 | DropdownButton.displayName = 'DropdownButton'; 50 | 51 | export default DropdownButton; 52 | -------------------------------------------------------------------------------- /packages/Dropdown/DropdownItem.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { AnyTag } from "@duik/core"; 3 | import classnames from "classnames"; 4 | import { Button, ButtonProps } from "@duik/button"; 5 | import cls from "./styles.scss"; 6 | 7 | export const DropdownItem: typeof Button = ( 8 | props: ButtonProps 9 | ) => { 10 | const { className, ...rest } = props; 11 | 12 | return ( 13 |