From 2f14cfbac6b3dfef1fc7a4832c4e165d0852601f Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 14 Sep 2020 22:50:19 +0300 Subject: [PATCH 1/6] challenge submission --- .../Checkbox/__snapshots__/index.jsx.snap | 24 ++ .../components/GUIKit/Checkbox/index.jsx | 12 + .../Datepicker/__snapshots__/index.jsx.snap | 118 ++++++++++ .../components/GUIKit/Datepicker/index.jsx | 12 + .../Dropdown/__snapshots__/index.jsx.snap | 78 +++++++ .../components/GUIKit/Dropdown/index.jsx | 12 + .../__snapshots__/index.jsx.snap | 72 ++++++ .../components/GUIKit/DropdownTerms/index.jsx | 12 + .../RadioButton/__snapshots__/index.jsx.snap | 29 +++ .../components/GUIKit/RadioButton/index.jsx | 12 + .../TextInput/__snapshots__/index.jsx.snap | 15 ++ .../components/GUIKit/TextInput/index.jsx | 12 + .../Textarea/__snapshots__/index.jsx.snap | 15 ++ .../components/GUIKit/Textarea/index.jsx | 12 + .../Toggles/__snapshots__/index.jsx.snap | 16 ++ .../components/GUIKit/Toggles/index.jsx | 12 + config/default.js | 3 + .../GUIKit/Assets/Images/icon-next.svg | 11 + .../GUIKit/Assets/Images/icon-prev.svg | 13 ++ .../GUIKit/Assets/Styles/Includes/_mixin.scss | 72 ++++++ .../GUIKit/Assets/Styles/Includes/index.scss | 1 + .../GUIKit/Assets/Styles/_default.scss | 7 + .../components/GUIKit/Checkbox/index.jsx | 59 +++++ .../components/GUIKit/Checkbox/style.scss | 109 +++++++++ .../components/GUIKit/Datepicker/index.jsx | 88 ++++++++ .../components/GUIKit/Datepicker/style.scss | 203 +++++++++++++++++ .../components/GUIKit/Dropdown/index.jsx | 95 +++++--- .../components/GUIKit/Dropdown/style.scss | 208 +++++++++++++++++- .../components/GUIKit/DropdownTerms/index.jsx | 187 ++++++++++++++++ .../GUIKit/DropdownTerms/style.scss | 162 ++++++++++++++ .../components/GUIKit/JobListCard/style.scss | 2 +- .../components/GUIKit/Paginate/style.scss | 2 +- .../components/GUIKit/RadioButton/index.jsx | 66 ++++++ .../components/GUIKit/RadioButton/style.scss | 147 +++++++++++++ .../components/GUIKit/SearchCombo/style.scss | 2 +- .../components/GUIKit/TextInput/index.jsx | 69 ++++++ .../components/GUIKit/TextInput/style.scss | 63 ++++++ .../components/GUIKit/Textarea/index.jsx | 68 ++++++ .../components/GUIKit/Textarea/style.scss | 66 ++++++ .../components/GUIKit/Toggles/index.jsx | 53 +++++ .../components/GUIKit/Toggles/style.scss | 141 ++++++++++++ src/shared/components/GUIKit/_default.scss | 2 - .../examples/GUIKit/Checkbox/index.jsx | 189 ++++++++++++++++ .../examples/GUIKit/Checkbox/style.scss | 56 +++++ .../examples/GUIKit/Datepicker/index.jsx | 65 ++++++ .../examples/GUIKit/Datepicker/style.scss | 31 +++ .../examples/GUIKit/Dropdown/index.jsx | 87 ++++++++ .../examples/GUIKit/Dropdown/style.scss | 33 +++ .../examples/GUIKit/DropdownTerms/index.jsx | 83 +++++++ .../examples/GUIKit/DropdownTerms/style.scss | 33 +++ .../examples/GUIKit/RadioButton/index.jsx | 83 +++++++ .../examples/GUIKit/RadioButton/style.scss | 59 +++++ .../examples/GUIKit/TextInput/index.jsx | 76 +++++++ .../examples/GUIKit/TextInput/style.scss | 31 +++ .../examples/GUIKit/Textarea/index.jsx | 65 ++++++ .../examples/GUIKit/Textarea/style.scss | 33 +++ .../examples/GUIKit/Toggles/index.jsx | 127 +++++++++++ .../examples/GUIKit/Toggles/style.scss | 45 ++++ .../components/examples/GUIKit/index.jsx | 47 ++++ .../components/examples/GUIKit/style.scss | 16 ++ src/shared/routes/Examples/Examples.jsx | 2 + src/shared/utils/useWindowSize.js | 26 +++ 62 files changed, 3509 insertions(+), 40 deletions(-) create mode 100644 __tests__/shared/components/GUIKit/Checkbox/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/Checkbox/index.jsx create mode 100644 __tests__/shared/components/GUIKit/Datepicker/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/Datepicker/index.jsx create mode 100644 __tests__/shared/components/GUIKit/Dropdown/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/Dropdown/index.jsx create mode 100644 __tests__/shared/components/GUIKit/DropdownTerms/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/DropdownTerms/index.jsx create mode 100644 __tests__/shared/components/GUIKit/RadioButton/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/RadioButton/index.jsx create mode 100644 __tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/TextInput/index.jsx create mode 100644 __tests__/shared/components/GUIKit/Textarea/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/Textarea/index.jsx create mode 100644 __tests__/shared/components/GUIKit/Toggles/__snapshots__/index.jsx.snap create mode 100644 __tests__/shared/components/GUIKit/Toggles/index.jsx create mode 100644 src/shared/components/GUIKit/Assets/Images/icon-next.svg create mode 100644 src/shared/components/GUIKit/Assets/Images/icon-prev.svg create mode 100644 src/shared/components/GUIKit/Assets/Styles/Includes/_mixin.scss create mode 100644 src/shared/components/GUIKit/Assets/Styles/Includes/index.scss create mode 100644 src/shared/components/GUIKit/Assets/Styles/_default.scss create mode 100644 src/shared/components/GUIKit/Checkbox/index.jsx create mode 100644 src/shared/components/GUIKit/Checkbox/style.scss create mode 100644 src/shared/components/GUIKit/Datepicker/index.jsx create mode 100644 src/shared/components/GUIKit/Datepicker/style.scss create mode 100644 src/shared/components/GUIKit/DropdownTerms/index.jsx create mode 100644 src/shared/components/GUIKit/DropdownTerms/style.scss create mode 100644 src/shared/components/GUIKit/RadioButton/index.jsx create mode 100644 src/shared/components/GUIKit/RadioButton/style.scss create mode 100644 src/shared/components/GUIKit/TextInput/index.jsx create mode 100644 src/shared/components/GUIKit/TextInput/style.scss create mode 100644 src/shared/components/GUIKit/Textarea/index.jsx create mode 100644 src/shared/components/GUIKit/Textarea/style.scss create mode 100644 src/shared/components/GUIKit/Toggles/index.jsx create mode 100644 src/shared/components/GUIKit/Toggles/style.scss delete mode 100644 src/shared/components/GUIKit/_default.scss create mode 100644 src/shared/components/examples/GUIKit/Checkbox/index.jsx create mode 100644 src/shared/components/examples/GUIKit/Checkbox/style.scss create mode 100644 src/shared/components/examples/GUIKit/Datepicker/index.jsx create mode 100644 src/shared/components/examples/GUIKit/Datepicker/style.scss create mode 100644 src/shared/components/examples/GUIKit/Dropdown/index.jsx create mode 100644 src/shared/components/examples/GUIKit/Dropdown/style.scss create mode 100644 src/shared/components/examples/GUIKit/DropdownTerms/index.jsx create mode 100644 src/shared/components/examples/GUIKit/DropdownTerms/style.scss create mode 100644 src/shared/components/examples/GUIKit/RadioButton/index.jsx create mode 100644 src/shared/components/examples/GUIKit/RadioButton/style.scss create mode 100644 src/shared/components/examples/GUIKit/TextInput/index.jsx create mode 100644 src/shared/components/examples/GUIKit/TextInput/style.scss create mode 100644 src/shared/components/examples/GUIKit/Textarea/index.jsx create mode 100644 src/shared/components/examples/GUIKit/Textarea/style.scss create mode 100644 src/shared/components/examples/GUIKit/Toggles/index.jsx create mode 100644 src/shared/components/examples/GUIKit/Toggles/style.scss create mode 100644 src/shared/components/examples/GUIKit/index.jsx create mode 100644 src/shared/components/examples/GUIKit/style.scss create mode 100644 src/shared/utils/useWindowSize.js diff --git a/__tests__/shared/components/GUIKit/Checkbox/__snapshots__/index.jsx.snap b/__tests__/shared/components/GUIKit/Checkbox/__snapshots__/index.jsx.snap new file mode 100644 index 0000000000..3d56855d05 --- /dev/null +++ b/__tests__/shared/components/GUIKit/Checkbox/__snapshots__/index.jsx.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Default render 1`] = ` + +`; diff --git a/__tests__/shared/components/GUIKit/Checkbox/index.jsx b/__tests__/shared/components/GUIKit/Checkbox/index.jsx new file mode 100644 index 0000000000..e693ad4989 --- /dev/null +++ b/__tests__/shared/components/GUIKit/Checkbox/index.jsx @@ -0,0 +1,12 @@ +import React from 'react'; +import Renderer from 'react-test-renderer/shallow'; + +import Checkbox from 'components/GUIKit/Checkbox'; + + +const rnd = new Renderer(); + +it('Default render', () => { + rnd.render(()); + expect(rnd.getRenderOutput()).toMatchSnapshot(); +}); diff --git a/__tests__/shared/components/GUIKit/Datepicker/__snapshots__/index.jsx.snap b/__tests__/shared/components/GUIKit/Datepicker/__snapshots__/index.jsx.snap new file mode 100644 index 0000000000..6bf8ad76cf --- /dev/null +++ b/__tests__/shared/components/GUIKit/Datepicker/__snapshots__/index.jsx.snap @@ -0,0 +1,118 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Default render 1`] = ` +
+ + } + date={null} + daySize={53} + disableScroll={false} + disabled={false} + displayFormat="MMM DD, YYYY" + enableOutsideDays={true} + firstDayOfWeek={1} + focused={false} + hideKeyboardShortcutsPanel={true} + horizontalMargin={0} + horizontalMonthPadding={13} + id="null----false" + initialVisibleMonth={null} + inputIconPosition="after" + isDayBlocked={[Function]} + isDayHighlighted={[Function]} + isOutsideRange={[Function]} + isRTL={false} + keepFocusOnInput={false} + keepOpenOnDateSelect={false} + monthFormat="MMMM YYYY" + navNext={ + + } + navPrev={ + + } + noBorder={false} + numberOfMonths={1} + onClose={[Function]} + onDateChange={[Function]} + onFocusChange={[Function]} + onNextMonthClick={[Function]} + onPrevMonthClick={[Function]} + openDirection="down" + orientation="horizontal" + phrases={ + Object { + "calendarLabel": "Calendar", + "chooseAvailableDate": [Function], + "clearDate": "Clear Date", + "closeDatePicker": "Close", + "dateIsSelected": [Function], + "dateIsUnavailable": [Function], + "enterKey": "Enter key", + "escape": "Escape key", + "hideKeyboardShortcutsPanel": "Close the shortcuts panel.", + "homeEnd": "Home and end keys", + "jumpToNextMonth": "Move forward to switch to the next month.", + "jumpToPrevMonth": "Move backward to switch to the previous month.", + "keyboardNavigationInstructions": "Press the down arrow key to interact with the calendar and + select a date. Press the question mark key to get the keyboard shortcuts for changing dates.", + "keyboardShortcuts": "Keyboard Shortcuts", + "leftArrowRightArrow": "Right and left arrow keys", + "moveFocusByOneDay": "Move backward (left) and forward (right) by one day.", + "moveFocusByOneMonth": "Switch months.", + "moveFocusByOneWeek": "Move backward (up) and forward (down) by one week.", + "moveFocustoStartAndEndOfWeek": "Go to the first or last day of a week.", + "openThisPanel": "Open this panel.", + "pageUpPageDown": "page up and page down keys", + "questionMark": "Question mark", + "returnFocusToInput": "Return to the date input field.", + "selectFocusedDate": "Select the date in focus.", + "showKeyboardShortcutsPanel": "Open the keyboard shortcuts panel.", + "upArrowDownArrow": "up and down arrow keys", + } + } + placeholder="" + readOnly={false} + regular={false} + renderCalendarInfo={null} + renderDayContents={[Function]} + renderMonthElement={null} + renderMonthText={null} + reopenPickerOnClearDate={false} + required={false} + screenReaderInputMessage="" + showClearDate={false} + showDefaultInputIcon={false} + small={false} + verticalHeight={null} + verticalSpacing={22} + weekDayFormat="ddd" + withFullScreenPortal={false} + withPortal={false} + /> +
+`; diff --git a/__tests__/shared/components/GUIKit/Datepicker/index.jsx b/__tests__/shared/components/GUIKit/Datepicker/index.jsx new file mode 100644 index 0000000000..c0001cce99 --- /dev/null +++ b/__tests__/shared/components/GUIKit/Datepicker/index.jsx @@ -0,0 +1,12 @@ +import React from 'react'; +import Renderer from 'react-test-renderer/shallow'; + +import Datepicker from 'components/GUIKit/Datepicker'; + + +const rnd = new Renderer(); + +it('Default render', () => { + rnd.render(()); + expect(rnd.getRenderOutput()).toMatchSnapshot(); +}); diff --git a/__tests__/shared/components/GUIKit/Dropdown/__snapshots__/index.jsx.snap b/__tests__/shared/components/GUIKit/Dropdown/__snapshots__/index.jsx.snap new file mode 100644 index 0000000000..694bfadb1b --- /dev/null +++ b/__tests__/shared/components/GUIKit/Dropdown/__snapshots__/index.jsx.snap @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Default render 1`] = ` +
+
+ + + + + radio + +
+
+`; diff --git a/__tests__/shared/components/GUIKit/RadioButton/index.jsx b/__tests__/shared/components/GUIKit/RadioButton/index.jsx new file mode 100644 index 0000000000..f386d2bbbd --- /dev/null +++ b/__tests__/shared/components/GUIKit/RadioButton/index.jsx @@ -0,0 +1,12 @@ +import React from 'react'; +import Renderer from 'react-test-renderer/shallow'; + +import RadioButton from 'components/GUIKit/RadioButton'; + + +const rnd = new Renderer(); + +it('Default render', () => { + rnd.render(()); + expect(rnd.getRenderOutput()).toMatchSnapshot(); +}); diff --git a/__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap b/__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap new file mode 100644 index 0000000000..f85a42e507 --- /dev/null +++ b/__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Default render 1`] = ` +
+ +
+`; diff --git a/__tests__/shared/components/GUIKit/TextInput/index.jsx b/__tests__/shared/components/GUIKit/TextInput/index.jsx new file mode 100644 index 0000000000..fb49292a71 --- /dev/null +++ b/__tests__/shared/components/GUIKit/TextInput/index.jsx @@ -0,0 +1,12 @@ +import React from 'react'; +import Renderer from 'react-test-renderer/shallow'; + +import TextInput from 'components/GUIKit/TextInput'; + + +const rnd = new Renderer(); + +it('Default render', () => { + rnd.render(()); + expect(rnd.getRenderOutput()).toMatchSnapshot(); +}); diff --git a/__tests__/shared/components/GUIKit/Textarea/__snapshots__/index.jsx.snap b/__tests__/shared/components/GUIKit/Textarea/__snapshots__/index.jsx.snap new file mode 100644 index 0000000000..c1aa4a9108 --- /dev/null +++ b/__tests__/shared/components/GUIKit/Textarea/__snapshots__/index.jsx.snap @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Default render 1`] = ` +
+