linear-react-components-ui 0.4.77-beta.9 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +99 -0
- package/.gitlab-ci.yml +19 -0
- package/.husky/pre-push +4 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +5 -2
- package/babel.config.json +11 -0
- package/config/getHttpsConfig.js +56 -0
- package/config/paths.js +140 -0
- package/config/webpackDevServer.config.js +128 -0
- package/jest.config.js +3 -3
- package/lib/@types/Align.d.ts +3 -0
- package/lib/@types/Align.js +5 -0
- package/lib/@types/ButtonTypes.d.ts +3 -0
- package/lib/@types/ButtonTypes.js +5 -0
- package/lib/@types/ColorStyles.d.ts +3 -0
- package/lib/@types/ColorStyles.js +5 -0
- package/lib/@types/DataCombo.d.ts +3 -0
- package/lib/@types/DataCombo.js +5 -0
- package/lib/@types/Icon.d.ts +5 -0
- package/lib/@types/Icon.js +5 -0
- package/lib/@types/LabelStyles.d.ts +3 -0
- package/lib/@types/Period.d.ts +6 -0
- package/lib/@types/Period.js +5 -0
- package/lib/@types/PermissionAttr.d.ts +14 -0
- package/lib/@types/PointerEvents.d.ts +3 -0
- package/lib/@types/Position.d.ts +3 -0
- package/lib/@types/PositionAlert.d.ts +3 -0
- package/lib/@types/PositionAlert.js +5 -0
- package/lib/@types/Size.d.ts +3 -0
- package/lib/@types/SizePixels.d.ts +3 -0
- package/lib/@types/StorageMock.d.ts +5 -0
- package/lib/@types/StorageMock.js +5 -0
- package/lib/alerts/AlertContainer.d.ts +16 -0
- package/lib/alerts/AlertContainer.js +16 -21
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +13 -18
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/BaseAlert.js +8 -11
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/Message.js +41 -50
- package/lib/alerts/helpers.d.ts +7 -0
- package/lib/alerts/helpers.js +4 -7
- package/lib/alerts/index.d.ts +6 -0
- package/lib/alerts/index.js +5 -5
- package/lib/alerts/types.d.ts +48 -0
- package/lib/alerts/types.js +5 -0
- package/lib/alerts/withAlert.d.ts +7 -0
- package/lib/alerts/withAlert.js +8 -8
- package/lib/assets/styles/commons.scss +0 -10
- package/lib/assets/styles/dropdown.scss +0 -1
- package/lib/assets/styles/list.scss +0 -8
- package/lib/assets/styles/sidenav.scss +42 -93
- package/lib/assets/styles/table.scss +7 -2
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/index.js +21 -66
- package/lib/avatar/types.d.ts +31 -0
- package/lib/avatar/types.js +5 -0
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/index.js +11 -27
- package/lib/badge/types.d.ts +13 -0
- package/lib/badge/types.js +5 -0
- package/lib/buttons/ActivateButton.d.ts +9 -0
- package/lib/buttons/ActivateButton.js +6 -6
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/AddButton.js +6 -6
- package/lib/buttons/Button.d.ts +12 -0
- package/lib/buttons/Button.js +22 -14
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/ButtonGroups.js +4 -9
- package/lib/buttons/CancelButton.d.ts +9 -0
- package/lib/buttons/CancelButton.js +19 -6
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DangerButton.js +16 -21
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +73 -135
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/DestroyButton.js +16 -7
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/EditButton.js +6 -6
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.js +6 -6
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/InfoButton.js +16 -21
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.js +16 -21
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.js +6 -6
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SaveButton.js +18 -5
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/SuccessButton.js +15 -20
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/WarningButton.js +15 -20
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/button_container/index.js +10 -23
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/index.js +18 -18
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +18 -35
- package/lib/buttons/types.d.ts +44 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/DangerCalendar.js +15 -6
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.js +15 -6
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.js +15 -6
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.js +15 -6
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.js +15 -6
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Day.js +8 -14
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Month.js +5 -10
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/Week.js +5 -11
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +9 -9
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/base/index.js +44 -47
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/index.js +9 -9
- package/lib/calendar/types.d.ts +25 -0
- package/lib/calendar/types.js +5 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/Label.js +7 -17
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +52 -89
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Alert.js +9 -14
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +26 -34
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Error.js +7 -12
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Information.js +7 -12
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Question.js +14 -25
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/Warning.js +7 -12
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Content.js +4 -13
- package/lib/dialog/base/Footer.d.ts +6 -0
- package/lib/dialog/base/Footer.js +6 -12
- package/lib/dialog/base/Header.d.ts +6 -0
- package/lib/dialog/base/Header.js +17 -31
- package/lib/dialog/base/index.d.ts +6 -0
- package/lib/dialog/base/index.js +13 -35
- package/lib/dialog/base/style.js +2 -2
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/form/index.js +34 -44
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/index.js +10 -10
- package/lib/dialog/types.d.ts +68 -0
- package/lib/dialog/types.js +5 -0
- package/lib/drawer/Content.d.ts +7 -0
- package/lib/drawer/Content.js +7 -16
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +36 -57
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/Header.js +28 -47
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/helpers.js +4 -4
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/index.js +6 -6
- package/lib/drawer/types.d.ts +34 -0
- package/lib/drawer/types.js +5 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +36 -20
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/helper.js +2 -2
- package/lib/dropdown/types.d.ts +43 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +22 -47
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +19 -50
- package/lib/fieldset/types.d.ts +28 -0
- package/lib/fieldset/types.js +5 -0
- package/lib/form/Field.d.ts +6 -0
- package/lib/form/Field.js +22 -49
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +27 -57
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +10 -32
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +29 -51
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +11 -17
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +68 -103
- package/lib/form/types.d.ts +167 -0
- package/lib/form/types.js +5 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +45 -125
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +20 -41
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridCol.js +7 -22
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/GridRow.js +8 -28
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/index.js +5 -5
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/gridlayout/types.js +5 -0
- package/lib/icons/helper.d.ts +560 -0
- package/lib/icons/helper.js +560 -563
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/index.js +28 -45
- package/lib/icons/types.d.ts +28 -0
- package/lib/index.d.ts +50 -0
- package/lib/index.js +140 -14
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +54 -163
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +9 -9
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/base/types.js +5 -0
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/index.js +40 -38
- package/lib/inputs/color/types.d.ts +14 -0
- package/lib/inputs/color/types.js +5 -0
- package/lib/inputs/date/Dialog.d.ts +10 -0
- package/lib/inputs/date/Dialog.js +4 -11
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/Dropdown.js +21 -73
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/helpers.js +4 -4
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/index.js +259 -415
- package/lib/inputs/date/types.d.ts +53 -0
- package/lib/inputs/date/types.js +5 -0
- package/lib/inputs/inputHOC.d.ts +11 -0
- package/lib/inputs/inputHOC.js +48 -100
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/BaseMask.js +6 -20
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +17 -24
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +18 -26
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/Phone.js +5 -13
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.js +5 -5
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/helpers.js +21 -36
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +188 -257
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/index.js +8 -8
- package/lib/inputs/mask/types.d.ts +66 -0
- package/lib/inputs/mask/types.js +5 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +10 -0
- package/lib/inputs/multiSelect/ActionButtons.js +9 -21
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.js +60 -87
- package/lib/inputs/multiSelect/helper.d.ts +9 -0
- package/lib/inputs/multiSelect/helper.js +2 -2
- package/lib/inputs/multiSelect/index.d.ts +10 -0
- package/lib/inputs/multiSelect/index.js +67 -90
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/multiSelect/types.js +5 -0
- package/lib/inputs/number/BaseNumber.d.ts +9 -0
- package/lib/inputs/number/BaseNumber.js +15 -27
- package/lib/inputs/number/Currency.d.ts +9 -0
- package/lib/inputs/number/Currency.js +8 -18
- package/lib/inputs/number/Decimal.d.ts +9 -0
- package/lib/inputs/number/Decimal.js +4 -4
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/index.d.ts +11 -0
- package/lib/inputs/number/index.js +14 -20
- package/lib/inputs/number/types.d.ts +27 -0
- package/lib/inputs/number/types.js +5 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dialog.js +4 -11
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/Dropdown.js +19 -73
- package/lib/inputs/period/PeriodList.d.ts +11 -0
- package/lib/inputs/period/PeriodList.js +12 -25
- package/lib/inputs/period/helper.d.ts +19 -0
- package/lib/inputs/period/helper.js +33 -74
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +136 -186
- package/lib/inputs/period/types.d.ts +58 -0
- package/lib/inputs/period/types.js +5 -0
- package/lib/inputs/search/index.d.ts +11 -0
- package/lib/inputs/search/index.js +133 -265
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/ActionButtons.js +19 -25
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/Dropdown.js +42 -75
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/helper.js +18 -14
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +15 -16
- package/lib/inputs/select/multiple/Selecteds.d.ts +10 -0
- package/lib/inputs/select/multiple/Selecteds.js +9 -17
- package/lib/inputs/select/multiple/index.d.ts +10 -0
- package/lib/inputs/select/multiple/index.js +293 -418
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.js +310 -463
- package/lib/inputs/select/types.d.ts +97 -0
- package/lib/inputs/select/types.js +5 -0
- package/lib/inputs/text/index.d.ts +9 -0
- package/lib/inputs/text/index.js +5 -4
- package/lib/inputs/text/types.d.ts +22 -0
- package/lib/inputs/text/types.js +5 -0
- package/lib/inputs/textarea/index.d.ts +5 -0
- package/lib/inputs/textarea/index.js +9 -19
- package/lib/inputs/textarea/types.d.ts +8 -0
- package/lib/inputs/textarea/types.js +5 -0
- package/lib/inputs/types.d.ts +146 -0
- package/lib/inputs/types.js +5 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/colorStyles.js +2 -2
- package/lib/internals/constants.d.ts +11 -0
- package/lib/internals/types.d.ts +21 -0
- package/lib/internals/withTooltip.d.ts +11 -0
- package/lib/internals/withTooltip.js +32 -40
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/index.js +34 -52
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DangerLabel.js +16 -7
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +31 -63
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/InfoLabel.js +16 -7
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.js +16 -7
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.js +16 -7
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.js +16 -7
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/index.js +10 -10
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/label_container/index.js +7 -17
- package/lib/labels/types.d.ts +24 -0
- package/lib/labels/types.js +5 -0
- package/lib/list/Header.d.ts +7 -0
- package/lib/list/Header.js +5 -18
- package/lib/list/Item.d.ts +7 -0
- package/lib/list/Item.js +39 -77
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/Separator.js +4 -4
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +2 -2
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +47 -66
- package/lib/list/types.d.ts +64 -0
- package/lib/list/types.js +5 -0
- package/lib/menus/float/MenuItem.d.ts +7 -0
- package/lib/menus/float/MenuItem.js +17 -37
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/helpers.js +4 -4
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/index.js +17 -37
- package/lib/menus/float/types.d.ts +27 -0
- package/lib/menus/float/types.js +5 -0
- package/lib/menus/index.d.ts +6 -0
- package/lib/menus/index.js +4 -4
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/ExpandMenu.js +6 -18
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/MenuLink.js +5 -19
- package/lib/menus/sidenav/NavMenuGroup.d.ts +10 -0
- package/lib/menus/sidenav/NavMenuGroup.js +6 -17
- package/lib/menus/sidenav/NavMenuItem.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuItem.js +30 -56
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +10 -21
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/helpers.js +5 -5
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/index.js +39 -69
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +9 -18
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.js +25 -24
- package/lib/menus/sidenav/types.d.ts +82 -0
- package/lib/menus/sidenav/types.js +5 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/noPermission/index.js +7 -7
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/Content.js +14 -26
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/DangerPanel.js +6 -6
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +25 -52
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/Header.js +18 -40
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/InfoPanel.js +6 -6
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.js +6 -6
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.js +6 -6
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/ToolBar.js +4 -9
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/WarningPanel.js +6 -6
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/helpers.js +9 -5
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/index.js +11 -11
- package/lib/panel/types.d.ts +4 -0
- package/lib/panel/types.js +5 -0
- package/lib/permissionValidations.d.ts +14 -0
- package/lib/permissionValidations.js +14 -12
- package/lib/popover/PopoverText.d.ts +8 -0
- package/lib/popover/PopoverText.js +4 -9
- package/lib/popover/PopoverTitle.d.ts +8 -0
- package/lib/popover/PopoverTitle.js +4 -9
- package/lib/popover/index.d.ts +13 -0
- package/lib/popover/index.js +35 -49
- package/lib/popover/types.d.ts +21 -0
- package/lib/popover/types.js +5 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/Bar.js +42 -52
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/index.js +14 -24
- package/lib/progress/types.d.ts +37 -0
- package/lib/progress/types.js +5 -0
- package/lib/radio/index.d.ts +12 -0
- package/lib/radio/index.js +28 -52
- package/lib/radio/types.d.ts +18 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +4 -17
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +13 -32
- package/lib/skeleton/types.d.ts +21 -0
- package/lib/skeleton/types.js +5 -0
- package/lib/spinner/SpinnerLoading.d.ts +7 -0
- package/lib/spinner/SpinnerLoading.js +45 -53
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/index.js +28 -33
- package/lib/spinner/types.d.ts +20 -0
- package/lib/spinner/types.js +5 -0
- package/lib/split/Split.d.ts +6 -0
- package/lib/split/Split.js +52 -69
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/SplitSide.js +7 -27
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/helpers.js +4 -4
- package/lib/split/index.d.ts +5 -0
- package/lib/split/index.js +5 -5
- package/lib/split/types.d.ts +34 -0
- package/lib/split/types.js +5 -0
- package/lib/table/Body.d.ts +6 -0
- package/lib/table/Body.js +21 -28
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +18 -25
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +13 -27
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +13 -34
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +18 -36
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/helpers.js +5 -5
- package/lib/table/index.d.ts +11 -0
- package/lib/table/index.js +19 -57
- package/lib/table/types.d.ts +77 -0
- package/lib/table/types.js +5 -0
- package/lib/tabs/DropdownItems.d.ts +9 -0
- package/lib/tabs/DropdownItems.js +20 -30
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/Menu.js +21 -25
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +33 -47
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +24 -57
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/index.js +89 -83
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/tabHelpers.js +10 -9
- package/lib/tabs/types.d.ts +63 -0
- package/lib/tabs/types.js +5 -0
- package/lib/toolbar/ButtonBar.d.ts +10 -0
- package/lib/toolbar/ButtonBar.js +51 -32
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +42 -29
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/Separator.js +4 -4
- package/lib/toolbar/ToolBarGroup.d.ts +10 -0
- package/lib/toolbar/ToolBarGroup.js +10 -16
- package/lib/toolbar/helpers.d.ts +10 -0
- package/lib/toolbar/helpers.js +3 -3
- package/lib/toolbar/index.d.ts +14 -0
- package/lib/toolbar/index.js +26 -34
- package/lib/toolbar/types.d.ts +43 -0
- package/lib/toolbar/types.js +5 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/index.js +34 -43
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/tooltip/types.js +5 -0
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Header.js +5 -17
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +265 -391
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +2 -3
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +369 -554
- package/lib/treeview/types.d.ts +104 -0
- package/lib/treeview/types.js +5 -0
- package/lib/treeview_old/Header.js +7 -7
- package/lib/treeview_old/Node.js +18 -18
- package/lib/treeview_old/index.js +9 -9
- package/lib/types-3c6f1c20.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/index.d.ts +6 -0
- package/lib/uitour/index.js +28 -45
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/package.json +57 -18
- package/scripts/start.js +135 -0
- package/tsconfig.json +32 -0
- package/tsup.config.ts +10 -0
- package/.eslintrc.js +0 -26
- package/.husky/pre-commit +0 -4
- package/lib/alerts/alert.spec.js +0 -133
- package/lib/avatar/avatar.spec.js +0 -190
- package/lib/badge/badge.spec.js +0 -127
- package/lib/buttons/SpinnerLoading.js +0 -230
- package/lib/buttons/buttons.spec.js +0 -504
- package/lib/calendar/calendar.spec.js +0 -171
- package/lib/checkbox/checkbox.spec.js +0 -215
- package/lib/dialog/dialog.spec.js +0 -488
- package/lib/drawer/Drawer.spec.js +0 -258
- package/lib/dropdown/dropdown.spec.js +0 -168
- package/lib/fieldset/fieldset.spec.js +0 -329
- package/lib/form/form.spec.js +0 -293
- package/lib/gridlayout/gridLayout.spec.js +0 -169
- package/lib/icons/icons.spec.js +0 -86
- package/lib/inputs/base/base.spec.js +0 -690
- package/lib/inputs/base/index.js +0 -1
- package/lib/inputs/color/color_input.spec.js +0 -174
- package/lib/inputs/date/date.spec.js +0 -354
- package/lib/inputs/mask/input_mask.spec.js +0 -607
- package/lib/inputs/number/numberfield.spec.js +0 -215
- package/lib/inputs/search/search_input.spec.js +0 -209
- package/lib/inputs/select/select.spec.js +0 -391
- package/lib/inputs/text/textfield.spec.js +0 -215
- package/lib/inputs/textarea/textarea.spec.js +0 -59
- package/lib/labelMessages/labelMessages.spec.js +0 -176
- package/lib/labels/label.spec.js +0 -162
- package/lib/list/list.spec.js +0 -768
- package/lib/menus/float/float-menu.spec.js +0 -221
- package/lib/menus/sidenav/sidenav.spec.js +0 -379
- package/lib/panel/panel.spec.js +0 -216
- package/lib/popover/popover.spec.js +0 -146
- package/lib/progress/progress.spec.js +0 -86
- package/lib/radio/radio.spec.js +0 -189
- package/lib/spinner/spinner.spec.js +0 -152
- package/lib/split/split.spec.js +0 -151
- package/lib/table/table.spec.js +0 -352
- package/lib/tabs/tabs.spec.js +0 -349
- package/lib/toolbar/toolbar.spec.js +0 -394
- package/lib/tooltip/tooltip.spec.js +0 -203
- package/lib/treeview/treeview.spec.js +0 -279
- package/lib/uitour/uitour.spec.js +0 -176
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linear-react-components-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"description": "Linear Sistemas ReactJs Components",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.cjs",
|
|
6
7
|
"scripts": {
|
|
7
|
-
"lib": "babel src/lib/ -d lib/ && babel src/lib/assets -d lib/assets --copy-files",
|
|
8
|
+
"lib": "babel src/lib/ -d lib/ --extensions \".js,.jsx,.ts,.tsx\" --ignore **/*.spec.tsx && babel src/lib/assets -d lib/assets --copy-files && npm run lib:types",
|
|
9
|
+
"lib:types": "tsup --dts-only --dts --external react",
|
|
8
10
|
"lib:watch": "babel src/lib -w -d lib/ ",
|
|
9
|
-
"demo": "
|
|
11
|
+
"demo": "node scripts/start.js",
|
|
10
12
|
"demo:prod": "webpack -p",
|
|
11
|
-
"check:js": "./node_modules/.bin/eslint ./src/* --ext
|
|
13
|
+
"check:js": "./node_modules/.bin/eslint ./src/* --ext=.jsx,.js,.tsx,.ts",
|
|
12
14
|
"deploy:heroku": "npm run demo:prod && cd demo && git commit -am 'Deploy' && git push heroku master",
|
|
13
15
|
"publish:npm": "npm run lib && npm publish",
|
|
14
16
|
"publish:npm:beta": "npm run lib && npm publish --tag beta",
|
|
@@ -32,32 +34,49 @@
|
|
|
32
34
|
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.36",
|
|
33
35
|
"@babel/preset-env": "^7.0.0-beta.36",
|
|
34
36
|
"@babel/preset-react": "^7.0.0-beta.36",
|
|
37
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
38
|
+
"@es-pack/esbuild-sass-plugin": "^2.0.1",
|
|
39
|
+
"@swc/core": "^1.3.14",
|
|
35
40
|
"@testing-library/jest-dom": "^5.14.1",
|
|
36
41
|
"@testing-library/react": "^12.0.0",
|
|
42
|
+
"@types/lodash": "^4.14.182",
|
|
43
|
+
"@types/node": "^17.0.31",
|
|
44
|
+
"@types/react": "^18.0.12",
|
|
45
|
+
"@types/react-dev-utils": "^9.0.10",
|
|
46
|
+
"@types/react-dom": "^18.0.5",
|
|
47
|
+
"@types/react-router-dom": "^5.3.3",
|
|
48
|
+
"@types/react-syntax-highlighter": "^15.5.5",
|
|
49
|
+
"@types/react-transition-group": "^4.4.5",
|
|
50
|
+
"@types/uuid": "^8.3.4",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
|
52
|
+
"@typescript-eslint/parser": "^5.23.0",
|
|
37
53
|
"babel-eslint": "^7.2.3",
|
|
38
54
|
"babel-jest": "^27.0.5",
|
|
39
|
-
"babel-loader": "^
|
|
55
|
+
"babel-loader": "^9.1.0",
|
|
40
56
|
"babel-polyfill": "^6.26.0",
|
|
41
57
|
"css-loader": "^0.28.8",
|
|
42
|
-
"
|
|
58
|
+
"esbuild": "^0.15.13",
|
|
59
|
+
"esbuild-plugin-babel": "^0.2.3",
|
|
60
|
+
"esbuild-plugin-sass": "^1.0.1",
|
|
61
|
+
"eslint": "^8.15.0",
|
|
43
62
|
"eslint-config-airbnb": "16.1.0",
|
|
63
|
+
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
64
|
+
"eslint-import-resolver-typescript": "^2.7.1",
|
|
44
65
|
"eslint-plugin-class-property": "1.1.0",
|
|
45
|
-
"eslint-plugin-import": "2.
|
|
66
|
+
"eslint-plugin-import": "^2.26.0",
|
|
46
67
|
"eslint-plugin-jsx-a11y": "6.0.3",
|
|
47
68
|
"eslint-plugin-react": "7.5.1",
|
|
48
69
|
"file-loader": "^1.1.6",
|
|
49
|
-
"html-webpack-plugin": "^
|
|
70
|
+
"html-webpack-plugin": "^5.5.0",
|
|
50
71
|
"husky": "^6.0.0",
|
|
51
72
|
"identity-obj-proxy": "^3.0.0",
|
|
52
73
|
"jest": "^27.0.5",
|
|
53
|
-
"react": "^16.
|
|
54
|
-
"react-dom": "^16.
|
|
55
|
-
"react-router-dom": "^5.1.2",
|
|
74
|
+
"react": "^16.14.0",
|
|
75
|
+
"react-dom": "^16.14.0",
|
|
56
76
|
"react-transition-group": "^4.3.0",
|
|
57
77
|
"style-loader": "^0.23.1",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"webpack-dev-server": "^2.9.7"
|
|
78
|
+
"tsup": "^6.4.0",
|
|
79
|
+
"typescript": "^4.6.4"
|
|
61
80
|
},
|
|
62
81
|
"author": "Deivisson Bruno <deivisson.bruno@linearsistemas.com.br>",
|
|
63
82
|
"homepage": "",
|
|
@@ -66,16 +85,36 @@
|
|
|
66
85
|
"url": "git@gitlab.com:linear-front/linear-react-components-ui.git"
|
|
67
86
|
},
|
|
68
87
|
"dependencies": {
|
|
88
|
+
"@types/react-dom": "^18.0.5",
|
|
69
89
|
"attach-dom-events": "^1.0.0",
|
|
90
|
+
"browserslist": "^4.18.1",
|
|
70
91
|
"history": "^5.0.0",
|
|
71
|
-
"imask": "^
|
|
92
|
+
"imask": "^6.4.3",
|
|
72
93
|
"init": "^0.1.2",
|
|
73
94
|
"lodash": "^4.17.21",
|
|
74
95
|
"moment": "^2.29.1",
|
|
75
|
-
"node-sass": "^4.13.0",
|
|
76
96
|
"prop-types": "^15.7.2",
|
|
77
|
-
"react-
|
|
97
|
+
"react-dev-utils": "^12.0.0",
|
|
98
|
+
"react-router-dom": "^5.1.2",
|
|
99
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
100
|
+
"sass": "^1.56.0",
|
|
78
101
|
"sass-loader": "^7.3.1",
|
|
79
|
-
"
|
|
102
|
+
"semver": "^7.3.5",
|
|
103
|
+
"uuid": "^3.3.3",
|
|
104
|
+
"webpack": "^5.64.4",
|
|
105
|
+
"webpack-dev-server": "^4.6.0",
|
|
106
|
+
"webpack-manifest-plugin": "^4.0.2"
|
|
107
|
+
},
|
|
108
|
+
"browserslist": {
|
|
109
|
+
"production": [
|
|
110
|
+
">0.2%",
|
|
111
|
+
"not dead",
|
|
112
|
+
"not op_mini all"
|
|
113
|
+
],
|
|
114
|
+
"development": [
|
|
115
|
+
"last 1 chrome version",
|
|
116
|
+
"last 1 firefox version",
|
|
117
|
+
"last 1 safari version"
|
|
118
|
+
]
|
|
80
119
|
}
|
|
81
120
|
}
|
package/scripts/start.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/* eslint-disable global-require */
|
|
2
|
+
/* eslint-disable import/no-dynamic-require */
|
|
3
|
+
|
|
4
|
+
// Do this as the first thing so that any code reading it knows the right env.
|
|
5
|
+
process.env.BABEL_ENV = 'development';
|
|
6
|
+
process.env.NODE_ENV = 'development';
|
|
7
|
+
|
|
8
|
+
// Makes the script crash on unhandled rejections instead of silently
|
|
9
|
+
// ignoring them. In the future, promise rejections that are not handled will
|
|
10
|
+
// terminate the Node.js process with a non-zero exit code.
|
|
11
|
+
process.on('unhandledRejection', (err) => {
|
|
12
|
+
throw err;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const chalk = require('react-dev-utils/chalk');
|
|
17
|
+
const webpack = require('webpack');
|
|
18
|
+
const WebpackDevServer = require('webpack-dev-server');
|
|
19
|
+
const clearConsole = require('react-dev-utils/clearConsole');
|
|
20
|
+
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
|
21
|
+
const {
|
|
22
|
+
choosePort,
|
|
23
|
+
createCompiler,
|
|
24
|
+
prepareProxy,
|
|
25
|
+
prepareUrls,
|
|
26
|
+
} = require('react-dev-utils/WebpackDevServerUtils');
|
|
27
|
+
const openBrowser = require('react-dev-utils/openBrowser');
|
|
28
|
+
const semver = require('semver');
|
|
29
|
+
// We require that you explicitly set browsers and do not fall back to
|
|
30
|
+
// browserslist defaults.
|
|
31
|
+
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
|
|
32
|
+
const config = require('../config/webpack.config');
|
|
33
|
+
const paths = require('../config/paths');
|
|
34
|
+
const createDevServerConfig = require('../config/webpackDevServer.config');
|
|
35
|
+
|
|
36
|
+
const react = require(require.resolve('react', { paths: [paths.appPath] }));
|
|
37
|
+
|
|
38
|
+
const useYarn = fs.existsSync(paths.yarnLockFile);
|
|
39
|
+
const isInteractive = process.stdout.isTTY;
|
|
40
|
+
|
|
41
|
+
// Warn and crash if required files are missing
|
|
42
|
+
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Tools like Cloud9 rely on this.
|
|
47
|
+
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3001;
|
|
48
|
+
const HOST = process.env.HOST || '0.0.0.0';
|
|
49
|
+
|
|
50
|
+
if (process.env.HOST) {
|
|
51
|
+
console.log(chalk.cyan(`Attempting to bind to HOST environment variable: ${chalk.yellow(chalk.bold(process.env.HOST))}`));
|
|
52
|
+
console.log('If this was unintentional, check that you haven\'t mistakenly set it in your shell.');
|
|
53
|
+
console.log(`Learn more here: ${chalk.yellow('https://cra.link/advanced-config')}`);
|
|
54
|
+
console.log();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
checkBrowsers(paths.appPath, isInteractive)
|
|
58
|
+
.then(() =>
|
|
59
|
+
// We attempt to use the default port but if it is busy, we offer the user to
|
|
60
|
+
// run on a different port. `choosePort()` Promise resolves to the next free port.
|
|
61
|
+
choosePort(HOST, DEFAULT_PORT))
|
|
62
|
+
.then((port) => {
|
|
63
|
+
if (port == null) {
|
|
64
|
+
// We have not found a port.
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
|
69
|
+
const appName = require(paths.appPackageJson).name;
|
|
70
|
+
|
|
71
|
+
const useTypeScript = fs.existsSync(paths.appTsConfig);
|
|
72
|
+
const urls = prepareUrls(
|
|
73
|
+
protocol,
|
|
74
|
+
HOST,
|
|
75
|
+
port,
|
|
76
|
+
paths.publicUrlOrPath.slice(0, -1),
|
|
77
|
+
);
|
|
78
|
+
// Create a webpack compiler that is configured with custom messages.
|
|
79
|
+
const compiler = createCompiler({
|
|
80
|
+
appName,
|
|
81
|
+
config,
|
|
82
|
+
urls,
|
|
83
|
+
useYarn,
|
|
84
|
+
useTypeScript,
|
|
85
|
+
webpack,
|
|
86
|
+
});
|
|
87
|
+
// Load proxy config
|
|
88
|
+
const proxySetting = require(paths.appPackageJson).proxy;
|
|
89
|
+
const proxyConfig = prepareProxy(
|
|
90
|
+
proxySetting,
|
|
91
|
+
paths.appPublic,
|
|
92
|
+
paths.publicUrlOrPath,
|
|
93
|
+
);
|
|
94
|
+
// Serve webpack assets generated by the compiler over a web server.
|
|
95
|
+
const serverConfig = {
|
|
96
|
+
...createDevServerConfig(proxyConfig, urls.lanUrlForConfig),
|
|
97
|
+
host: HOST,
|
|
98
|
+
port,
|
|
99
|
+
};
|
|
100
|
+
const devServer = new WebpackDevServer(serverConfig, compiler);
|
|
101
|
+
// Launch WebpackDevServer.
|
|
102
|
+
devServer.startCallback(() => {
|
|
103
|
+
if (isInteractive) {
|
|
104
|
+
clearConsole();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (semver.lt(react.version, '16.10.0')) {
|
|
108
|
+
console.log(chalk.yellow(`Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
console.log(chalk.cyan('Starting the development server...\n'));
|
|
112
|
+
openBrowser(urls.localUrlForBrowser);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
['SIGINT', 'SIGTERM'].forEach((sig) => {
|
|
116
|
+
process.on(sig, () => {
|
|
117
|
+
devServer.close();
|
|
118
|
+
process.exit();
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
if (process.env.CI !== 'true') {
|
|
123
|
+
// Gracefully exit when stdin ends
|
|
124
|
+
process.stdin.on('end', () => {
|
|
125
|
+
devServer.close();
|
|
126
|
+
process.exit();
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
.catch((err) => {
|
|
131
|
+
if (err && err.message) {
|
|
132
|
+
console.log(err.message);
|
|
133
|
+
}
|
|
134
|
+
process.exit(1);
|
|
135
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"baseUrl": ".",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"jsx": "react",
|
|
11
|
+
"lib": [
|
|
12
|
+
"dom",
|
|
13
|
+
"dom.iterable",
|
|
14
|
+
"esnext"
|
|
15
|
+
],
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"target": "es2018"
|
|
22
|
+
},
|
|
23
|
+
"exclude": [
|
|
24
|
+
"!node_modules/@types",
|
|
25
|
+
"node_modules",
|
|
26
|
+
"src/**/*.spec.ts",
|
|
27
|
+
"src/**/*.test.ts"
|
|
28
|
+
],
|
|
29
|
+
"include": ["src/**/*"],
|
|
30
|
+
"typeRoots": ["./node_modules/@types"],
|
|
31
|
+
"types": ["node"]
|
|
32
|
+
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
2
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
3
|
+
import { defineConfig } from 'tsup';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
entry: ['src/lib/**/!(*.d|*.spec).ts*'],
|
|
7
|
+
external: ['react', 'sass'],
|
|
8
|
+
clean: true,
|
|
9
|
+
outDir: 'lib',
|
|
10
|
+
});
|
package/.eslintrc.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"extends": "airbnb",
|
|
3
|
-
"env": {
|
|
4
|
-
"browser": true,
|
|
5
|
-
"jest": true
|
|
6
|
-
},
|
|
7
|
-
"parser": "babel-eslint",
|
|
8
|
-
"rules": {
|
|
9
|
-
"prefer-destructuring": ["error", {"object": true, "array": false}],
|
|
10
|
-
'react/forbid-prop-types': ['error', { forbid: ['array'] }],
|
|
11
|
-
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
|
|
12
|
-
'react/jsx-closing-bracket-location': ['error', 'after-props'],
|
|
13
|
-
'react/no-unused-prop-types': ['0'],
|
|
14
|
-
"jsx-a11y/anchor-is-valid": [ "error", {
|
|
15
|
-
"components": [ "Link" ],
|
|
16
|
-
"specialLink": [ "hrefLeft", "hrefRight" ],
|
|
17
|
-
"aspects": ["preferButton" ]
|
|
18
|
-
}],
|
|
19
|
-
'jsx-a11y/no-autofocus': ['0'],
|
|
20
|
-
"object-curly-newline": [0],
|
|
21
|
-
"jsx-a11y/label-has-for": [0],
|
|
22
|
-
},
|
|
23
|
-
"plugins": [
|
|
24
|
-
"class-property"
|
|
25
|
-
]
|
|
26
|
-
};
|
package/.husky/pre-commit
DELETED
package/lib/alerts/alert.spec.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
|
|
5
|
-
require("babel-polyfill");
|
|
6
|
-
|
|
7
|
-
require("@testing-library/jest-dom");
|
|
8
|
-
|
|
9
|
-
var _react2 = require("@testing-library/react");
|
|
10
|
-
|
|
11
|
-
var _Message = _interopRequireDefault(require("./Message"));
|
|
12
|
-
|
|
13
|
-
var _icons = _interopRequireDefault(require("../icons"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
-
|
|
17
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
18
|
-
|
|
19
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
20
|
-
|
|
21
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
-
|
|
23
|
-
var mockAlert = function mockAlert(props) {
|
|
24
|
-
return /*#__PURE__*/_react["default"].createElement(_Message["default"], _extends({
|
|
25
|
-
id: 3,
|
|
26
|
-
message: "Alerta",
|
|
27
|
-
position: "rightTop",
|
|
28
|
-
closeButton: true,
|
|
29
|
-
customClass: "mock-alert",
|
|
30
|
-
timeout: 500
|
|
31
|
-
}, props));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
describe('Alert', function () {
|
|
35
|
-
describe('Message', function () {
|
|
36
|
-
it('should render correctly', function () {
|
|
37
|
-
var mockHandleClose = jest.fn();
|
|
38
|
-
|
|
39
|
-
var _render = (0, _react2.render)(mockAlert({
|
|
40
|
-
handleClose: mockHandleClose
|
|
41
|
-
})),
|
|
42
|
-
container = _render.container;
|
|
43
|
-
|
|
44
|
-
expect(container.firstChild).toBeTruthy();
|
|
45
|
-
expect(container.firstChild).toHaveTextContent('Alerta');
|
|
46
|
-
});
|
|
47
|
-
it('should close with timeout 500ms', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
48
|
-
var mockHandleClose;
|
|
49
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
50
|
-
while (1) {
|
|
51
|
-
switch (_context.prev = _context.next) {
|
|
52
|
-
case 0:
|
|
53
|
-
mockHandleClose = jest.fn();
|
|
54
|
-
(0, _react2.render)(mockAlert({
|
|
55
|
-
handleClose: mockHandleClose
|
|
56
|
-
}));
|
|
57
|
-
_context.next = 4;
|
|
58
|
-
return (0, _react2.waitFor)(function () {
|
|
59
|
-
return expect(mockHandleClose).toBeCalledTimes(1);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
case 4:
|
|
63
|
-
case "end":
|
|
64
|
-
return _context.stop();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}, _callee);
|
|
68
|
-
})));
|
|
69
|
-
it('should apply custom class', function () {
|
|
70
|
-
var mockHandleClose = jest.fn();
|
|
71
|
-
|
|
72
|
-
var _render2 = (0, _react2.render)(mockAlert({
|
|
73
|
-
handleClose: mockHandleClose
|
|
74
|
-
})),
|
|
75
|
-
container = _render2.container;
|
|
76
|
-
|
|
77
|
-
expect(container.firstChild).toHaveClass('mock-alert');
|
|
78
|
-
});
|
|
79
|
-
it('should render icon', function () {
|
|
80
|
-
var mockHandleClose = jest.fn();
|
|
81
|
-
|
|
82
|
-
var _render3 = (0, _react2.render)(mockAlert({
|
|
83
|
-
handleClose: mockHandleClose,
|
|
84
|
-
icon: /*#__PURE__*/_react["default"].createElement(_icons["default"], {
|
|
85
|
-
name: "user"
|
|
86
|
-
})
|
|
87
|
-
})),
|
|
88
|
-
container = _render3.container,
|
|
89
|
-
getByTestId = _render3.getByTestId;
|
|
90
|
-
|
|
91
|
-
expect(container.querySelector('.-icon')).toContainElement(getByTestId('icon'));
|
|
92
|
-
});
|
|
93
|
-
it('should render icon by iconName', function () {
|
|
94
|
-
var mockHandleClose = jest.fn();
|
|
95
|
-
|
|
96
|
-
var _render4 = (0, _react2.render)(mockAlert({
|
|
97
|
-
handleClose: mockHandleClose,
|
|
98
|
-
iconName: 'user'
|
|
99
|
-
})),
|
|
100
|
-
container = _render4.container,
|
|
101
|
-
getByTestId = _render4.getByTestId;
|
|
102
|
-
|
|
103
|
-
expect(container.querySelector('.-icon')).toContainElement(getByTestId('icon'));
|
|
104
|
-
});
|
|
105
|
-
it('should change icon color', function () {
|
|
106
|
-
var mockHandleClose = jest.fn();
|
|
107
|
-
|
|
108
|
-
var _render5 = (0, _react2.render)(mockAlert({
|
|
109
|
-
handleClose: mockHandleClose,
|
|
110
|
-
iconName: 'user',
|
|
111
|
-
color: 'red'
|
|
112
|
-
})),
|
|
113
|
-
getByTestId = _render5.getByTestId;
|
|
114
|
-
|
|
115
|
-
expect(getByTestId('icon')).toHaveAttribute('fill', 'red');
|
|
116
|
-
});
|
|
117
|
-
it('should fire event on click', function () {
|
|
118
|
-
var mockHandleClose = jest.fn();
|
|
119
|
-
|
|
120
|
-
var _render6 = (0, _react2.render)(mockAlert({
|
|
121
|
-
handleClose: mockHandleClose
|
|
122
|
-
})),
|
|
123
|
-
container = _render6.container,
|
|
124
|
-
getByRole = _render6.getByRole;
|
|
125
|
-
|
|
126
|
-
_react2.fireEvent.click(getByRole('button'));
|
|
127
|
-
|
|
128
|
-
expect(container.querySelector('.close')).toBeInTheDocument();
|
|
129
|
-
expect(container.querySelector('.close-button')).toBeInTheDocument();
|
|
130
|
-
expect(mockHandleClose).toBeCalledTimes(1);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
});
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
require("babel-polyfill");
|
|
8
|
-
|
|
9
|
-
require("@testing-library/jest-dom/extend-expect");
|
|
10
|
-
|
|
11
|
-
var _react2 = require("@testing-library/react");
|
|
12
|
-
|
|
13
|
-
var _ = _interopRequireDefault(require("."));
|
|
14
|
-
|
|
15
|
-
var _icons = _interopRequireDefault(require("../icons"));
|
|
16
|
-
|
|
17
|
-
var _list = _interopRequireWildcard(require("../list"));
|
|
18
|
-
|
|
19
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
-
|
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
24
|
-
|
|
25
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
26
|
-
|
|
27
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
28
|
-
|
|
29
|
-
describe('Avatar', function () {
|
|
30
|
-
it('should render correctly', function () {
|
|
31
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
32
|
-
label: "B"
|
|
33
|
-
})),
|
|
34
|
-
container = _render.container;
|
|
35
|
-
|
|
36
|
-
expect(container.firstChild).toHaveClass('avatar-component -default');
|
|
37
|
-
expect(container.firstChild).toHaveTextContent('B');
|
|
38
|
-
expect(_react2.screen.getByRole('button')).toBeInTheDocument();
|
|
39
|
-
});
|
|
40
|
-
it('should apply customClass', function () {
|
|
41
|
-
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
42
|
-
label: "B",
|
|
43
|
-
customClass: "avatarteste"
|
|
44
|
-
})),
|
|
45
|
-
container = _render2.container;
|
|
46
|
-
|
|
47
|
-
expect(container.firstChild).toHaveClass('avatarteste');
|
|
48
|
-
});
|
|
49
|
-
it('should change color', function () {
|
|
50
|
-
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
51
|
-
label: "B",
|
|
52
|
-
color: "#333"
|
|
53
|
-
})),
|
|
54
|
-
container = _render3.container;
|
|
55
|
-
|
|
56
|
-
expect(container.firstChild).toHaveStyle('background-color: #333');
|
|
57
|
-
});
|
|
58
|
-
it('should change to square', function () {
|
|
59
|
-
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
60
|
-
label: "B",
|
|
61
|
-
square: true
|
|
62
|
-
})),
|
|
63
|
-
container = _render4.container;
|
|
64
|
-
|
|
65
|
-
expect(container.firstChild).toHaveClass('-square');
|
|
66
|
-
});
|
|
67
|
-
it('should change to mini', function () {
|
|
68
|
-
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
69
|
-
label: "B",
|
|
70
|
-
size: "mini"
|
|
71
|
-
})),
|
|
72
|
-
container = _render5.container;
|
|
73
|
-
|
|
74
|
-
expect(container.firstChild).toHaveClass('-mini');
|
|
75
|
-
});
|
|
76
|
-
it('should render icon with iconName', function () {
|
|
77
|
-
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
78
|
-
iconName: "calc"
|
|
79
|
-
})),
|
|
80
|
-
container = _render6.container;
|
|
81
|
-
|
|
82
|
-
expect(container.firstChild).toContainElement(_react2.screen.getByTestId('icon'));
|
|
83
|
-
});
|
|
84
|
-
it('should render Icon with icon', function () {
|
|
85
|
-
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
86
|
-
icon: /*#__PURE__*/_react["default"].createElement(_icons["default"], {
|
|
87
|
-
name: "user"
|
|
88
|
-
})
|
|
89
|
-
})),
|
|
90
|
-
container = _render7.container;
|
|
91
|
-
|
|
92
|
-
expect(container.firstChild).toContainElement(_react2.screen.getByTestId('icon'));
|
|
93
|
-
});
|
|
94
|
-
it('should render with image', function () {
|
|
95
|
-
var mockAvatar = /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
96
|
-
src: "https://yt3.ggpht.com/a-/AAuE7mDGQh9L3n_EULfeZEO9rs_JR4BY376CSrlxdw=s900-mo-c-c0xffffffff-rj-k-no",
|
|
97
|
-
srcAlt: "Avatar Teste"
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
var _render8 = (0, _react2.render)(mockAvatar),
|
|
101
|
-
container = _render8.container;
|
|
102
|
-
|
|
103
|
-
expect(container.firstChild).toContainElement(_react2.screen.getByAltText('Avatar Teste'));
|
|
104
|
-
expect(_react2.screen.getByAltText('Avatar Teste')).toHaveClass('imgavatar');
|
|
105
|
-
});
|
|
106
|
-
it('should not render icon if has image', function () {
|
|
107
|
-
var mockAvatar = /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
108
|
-
src: "https://yt3.ggpht.com/a-/AAuE7mDGQh9L3n_EULfeZEO9rs_JR4BY376CSrlxdw=s900-mo-c-c0xffffffff-rj-k-no",
|
|
109
|
-
srcAlt: "Avatar Teste"
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
var _render9 = (0, _react2.render)(mockAvatar),
|
|
113
|
-
container = _render9.container;
|
|
114
|
-
|
|
115
|
-
expect(container.firstChild).not.toContainElement(document.querySelector('.icon-component'));
|
|
116
|
-
});
|
|
117
|
-
it('should change size', function () {
|
|
118
|
-
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
119
|
-
label: "B",
|
|
120
|
-
width: "56px",
|
|
121
|
-
height: "56px"
|
|
122
|
-
})),
|
|
123
|
-
container = _render10.container;
|
|
124
|
-
|
|
125
|
-
expect(container.firstChild).toHaveStyle('width: 56px; height:56px');
|
|
126
|
-
});
|
|
127
|
-
it('should open dropdown and render chilren', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
128
|
-
var mockAvatar, _render11, container;
|
|
129
|
-
|
|
130
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
131
|
-
while (1) {
|
|
132
|
-
switch (_context.prev = _context.next) {
|
|
133
|
-
case 0:
|
|
134
|
-
mockAvatar = /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
135
|
-
label: "B",
|
|
136
|
-
dropdown: true
|
|
137
|
-
}, /*#__PURE__*/_react["default"].createElement(_list["default"], null, /*#__PURE__*/_react["default"].createElement(_list.ListItem, {
|
|
138
|
-
rightIconName: "exclamation",
|
|
139
|
-
text: "Icone na direita"
|
|
140
|
-
}), /*#__PURE__*/_react["default"].createElement(_list.ListItem, {
|
|
141
|
-
rightIconName: "user",
|
|
142
|
-
text: "Icone na direita"
|
|
143
|
-
}), /*#__PURE__*/_react["default"].createElement(_list.ListItem, {
|
|
144
|
-
text: "Itemlist sem \xEDcone"
|
|
145
|
-
}), /*#__PURE__*/_react["default"].createElement(_list.ListItem, {
|
|
146
|
-
text: "Itemlist sem \xEDcone Disabled",
|
|
147
|
-
disabled: true
|
|
148
|
-
})));
|
|
149
|
-
_render11 = (0, _react2.render)(mockAvatar), container = _render11.container;
|
|
150
|
-
|
|
151
|
-
_react2.fireEvent.click(container.firstChild);
|
|
152
|
-
|
|
153
|
-
_context.next = 5;
|
|
154
|
-
return (0, _react2.waitFor)(function () {
|
|
155
|
-
return _react2.screen.getByTestId('dropdown-component');
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
case 5:
|
|
159
|
-
expect(container.firstChild).toHaveTextContent('B');
|
|
160
|
-
expect(_react2.screen.getByTestId('dropdown-component')).toBeInTheDocument();
|
|
161
|
-
|
|
162
|
-
case 7:
|
|
163
|
-
case "end":
|
|
164
|
-
return _context.stop();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, _callee);
|
|
168
|
-
})));
|
|
169
|
-
it('should callback function onClick', function () {
|
|
170
|
-
var mockOnClick = jest.fn();
|
|
171
|
-
|
|
172
|
-
var _render12 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
173
|
-
label: "B",
|
|
174
|
-
onClick: mockOnClick
|
|
175
|
-
})),
|
|
176
|
-
container = _render12.container;
|
|
177
|
-
|
|
178
|
-
_react2.fireEvent.click(container.firstChild);
|
|
179
|
-
|
|
180
|
-
expect(mockOnClick).toBeCalledTimes(1);
|
|
181
|
-
});
|
|
182
|
-
it('should use targetRef', function () {
|
|
183
|
-
var mockTargetRef = jest.fn();
|
|
184
|
-
(0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_["default"], {
|
|
185
|
-
label: "B",
|
|
186
|
-
targetRef: mockTargetRef
|
|
187
|
-
}));
|
|
188
|
-
expect(mockTargetRef).toBeCalledTimes(1);
|
|
189
|
-
});
|
|
190
|
-
});
|