@loja-integrada/admin-components 0.19.2 → 1.0.0-beta.0
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/LICENSE +1 -1
- package/dist/chunk-7RSXJRXE.js +7 -0
- package/dist/chunk-AYBQ5B4L.js +1 -0
- package/dist/chunk-LTWCICTK.js +1 -0
- package/dist/chunk-QCTWLTAA.js +1 -0
- package/dist/chunk-YV57ZIX5.js +7 -0
- package/dist/chunk-YXT4UVSS.js +6 -0
- package/dist/components/Button/Button.d.ts +52 -0
- package/dist/components/Button/Button.js +3 -0
- package/dist/components/Button/index.d.ts +6 -0
- package/dist/components/Button/index.js +4 -0
- package/dist/components/Icon/Icon.d.ts +127 -0
- package/dist/components/Icon/Icon.js +1 -0
- package/dist/components/Icon/index.d.ts +3 -0
- package/dist/components/Icon/index.js +2 -0
- package/dist/{Icons → components}/IconCircular/IconCircular.d.ts +22 -19
- package/dist/components/IconCircular/IconCircular.js +3 -0
- package/dist/components/IconCircular/index.d.ts +4 -0
- package/dist/components/IconCircular/index.js +4 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +6 -8
- package/package.json +60 -140
- package/README.md +0 -82
- package/dist/Components/Button/Button.d.ts +0 -42
- package/dist/Components/Button/Button.spec.d.ts +0 -1
- package/dist/Components/Button/Button.stories.d.ts +0 -11
- package/dist/Components/Button/index.d.ts +0 -1
- package/dist/Components/HelpLink/HelpLink.spec.d.ts +0 -1
- package/dist/Components/HelpLink/HelpLink.stories.d.ts +0 -6
- package/dist/Components/HelpLink/index.d.ts +0 -28
- package/dist/Components/LoadingPlaceholder/LoadingPlaceholder.d.ts +0 -5
- package/dist/Components/LoadingPlaceholder/LoadingPlaceholder.stories.d.ts +0 -4
- package/dist/Components/LoadingPlaceholder/index.d.ts +0 -1
- package/dist/Components/Modal/Modal.d.ts +0 -48
- package/dist/Components/Modal/Modal.spec.d.ts +0 -1
- package/dist/Components/Modal/Modal.stories.d.ts +0 -7
- package/dist/Components/Modal/index.d.ts +0 -1
- package/dist/Components/SidebarFixed/SidebarFixed.d.ts +0 -30
- package/dist/Components/SidebarFixed/SidebarFixed.spec.d.ts +0 -1
- package/dist/Components/SidebarFixed/SidebarFixed.stories.d.ts +0 -4
- package/dist/Components/SidebarFixed/index.d.ts +0 -1
- package/dist/Components/Table/Table.d.ts +0 -81
- package/dist/Components/Table/Table.stories.d.ts +0 -8
- package/dist/Components/Table/index.d.ts +0 -1
- package/dist/Components/TableList/TableList.d.ts +0 -38
- package/dist/Components/TableList/TableList.spec.d.ts +0 -1
- package/dist/Components/TableList/TableList.stories.d.ts +0 -7
- package/dist/Components/TableList/TableListItem.d.ts +0 -3
- package/dist/Components/TableList/TableListItem.interface.d.ts +0 -68
- package/dist/Components/TableList/TableListItem.spec.d.ts +0 -1
- package/dist/Components/TableList/TableListItem.stories.d.ts +0 -4
- package/dist/Components/TableList/TableListItemLoading.d.ts +0 -3
- package/dist/Components/TableList/TableListItemLoading.spec.d.ts +0 -1
- package/dist/Components/TableList/TableListItemLoading.stories.d.ts +0 -4
- package/dist/Components/TableList/TableListItemWrapper.d.ts +0 -12
- package/dist/Components/TableList/TableListItemWrapper.spec.d.ts +0 -1
- package/dist/Components/TableList/TableListItemWrapper.stories.d.ts +0 -4
- package/dist/Components/TableList/index.d.ts +0 -4
- package/dist/Components/Tabs/Tabs.d.ts +0 -21
- package/dist/Components/Tabs/Tabs.spec.d.ts +0 -1
- package/dist/Components/Tabs/Tabs.stories.d.ts +0 -5
- package/dist/Components/Tabs/TabsItem.d.ts +0 -14
- package/dist/Components/Tabs/TabsItem.interface.d.ts +0 -19
- package/dist/Components/Tabs/index.d.ts +0 -1
- package/dist/Components/Timeline/Timeline.d.ts +0 -25
- package/dist/Components/Timeline/Timeline.spec.d.ts +0 -1
- package/dist/Components/Timeline/Timeline.stories.d.ts +0 -7
- package/dist/Components/Timeline/TimelineItem.d.ts +0 -6
- package/dist/Components/Timeline/TimelineItem.interface.d.ts +0 -32
- package/dist/Components/Timeline/index.d.ts +0 -1
- package/dist/Components/index.d.ts +0 -8
- package/dist/Forms/Checkbox/Checkbox.d.ts +0 -27
- package/dist/Forms/Checkbox/Checkbox.spec.d.ts +0 -1
- package/dist/Forms/Checkbox/Checkbox.stories.d.ts +0 -10
- package/dist/Forms/Checkbox/index.d.ts +0 -1
- package/dist/Forms/Dropdown/Dropdown.d.ts +0 -168
- package/dist/Forms/Dropdown/Dropdown.spec.d.ts +0 -1
- package/dist/Forms/Dropdown/Dropdown.stories.d.ts +0 -19
- package/dist/Forms/Dropdown/index.d.ts +0 -1
- package/dist/Forms/FloatingLabelInput/FloatingLabelInput.d.ts +0 -11
- package/dist/Forms/FloatingLabelInput/FloatingLabelInput.spec.d.ts +0 -1
- package/dist/Forms/FloatingLabelInput/FloatingLabelInput.stories.d.ts +0 -10
- package/dist/Forms/FloatingLabelInput/index.d.ts +0 -1
- package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.d.ts +0 -49
- package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.d.ts +0 -1
- package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.d.ts +0 -10
- package/dist/Forms/FloatingLabelInputCurrency/index.d.ts +0 -1
- package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.d.ts +0 -18
- package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.d.ts +0 -1
- package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.d.ts +0 -19
- package/dist/Forms/FloatingLabelInputMask/index.d.ts +0 -1
- package/dist/Forms/Input/Input.d.ts +0 -36
- package/dist/Forms/Input/Input.spec.d.ts +0 -1
- package/dist/Forms/Input/Input.stories.d.ts +0 -21
- package/dist/Forms/Input/index.d.ts +0 -1
- package/dist/Forms/InputCurrency/InputCurrency.d.ts +0 -47
- package/dist/Forms/InputCurrency/InputCurrency.spec.d.ts +0 -1
- package/dist/Forms/InputCurrency/InputCurrency.stories.d.ts +0 -8
- package/dist/Forms/InputCurrency/index.d.ts +0 -1
- package/dist/Forms/InputCurrency/utils.d.ts +0 -22
- package/dist/Forms/InputHelpText/InputHelpText.d.ts +0 -16
- package/dist/Forms/InputHelpText/InputHelpText.spec.d.ts +0 -1
- package/dist/Forms/InputHelpText/InputHelpText.stories.d.ts +0 -4
- package/dist/Forms/InputHelpText/index.d.ts +0 -1
- package/dist/Forms/InputLabel/InputLabel.d.ts +0 -28
- package/dist/Forms/InputLabel/InputLabel.spec.d.ts +0 -1
- package/dist/Forms/InputLabel/InputLabel.stories.d.ts +0 -5
- package/dist/Forms/InputLabel/index.d.ts +0 -1
- package/dist/Forms/InputMask/InputMask.d.ts +0 -18
- package/dist/Forms/InputMask/InputMask.spec.d.ts +0 -1
- package/dist/Forms/InputMask/InputMask.stories.d.ts +0 -17
- package/dist/Forms/InputMask/index.d.ts +0 -1
- package/dist/Forms/InputMask/maskDate.d.ts +0 -7
- package/dist/Forms/InputMask/utils.d.ts +0 -65
- package/dist/Forms/RadioButton/RadioButton.d.ts +0 -24
- package/dist/Forms/RadioButton/RadioButton.spec.d.ts +0 -1
- package/dist/Forms/RadioButton/RadioButton.stories.d.ts +0 -6
- package/dist/Forms/RadioButton/index.d.ts +0 -1
- package/dist/Forms/Select/Select.d.ts +0 -31
- package/dist/Forms/Select/Select.spec.d.ts +0 -1
- package/dist/Forms/Select/Select.stories.d.ts +0 -8
- package/dist/Forms/Select/index.d.ts +0 -1
- package/dist/Forms/Toggle/Toggle.d.ts +0 -5
- package/dist/Forms/Toggle/Toggle.spec.d.ts +0 -1
- package/dist/Forms/Toggle/Toggle.stories.d.ts +0 -8
- package/dist/Forms/Toggle/index.d.ts +0 -1
- package/dist/Forms/ToggleButton/ToggleButton.d.ts +0 -24
- package/dist/Forms/ToggleButton/ToggleButton.spec.d.ts +0 -1
- package/dist/Forms/ToggleButton/ToggleButton.stories.d.ts +0 -7
- package/dist/Forms/ToggleButton/index.d.ts +0 -1
- package/dist/Forms/commonStyles.d.ts +0 -16
- package/dist/Forms/index.d.ts +0 -14
- package/dist/Icons/Icon/Icon.d.ts +0 -34
- package/dist/Icons/Icon/Icon.spec.d.ts +0 -1
- package/dist/Icons/Icon/Icon.stories.d.ts +0 -9
- package/dist/Icons/Icon/index.d.ts +0 -1
- package/dist/Icons/IconCircular/IconCircular.spec.d.ts +0 -1
- package/dist/Icons/IconCircular/IconCircular.stories.d.ts +0 -6
- package/dist/Icons/IconCircular/index.d.ts +0 -1
- package/dist/Icons/IconList.d.ts +0 -3
- package/dist/Icons/icons-path/Adjust.d.ts +0 -2
- package/dist/Icons/icons-path/AngleDiagonal.d.ts +0 -2
- package/dist/Icons/icons-path/AngleDown.d.ts +0 -2
- package/dist/Icons/icons-path/AngleHeight.d.ts +0 -2
- package/dist/Icons/icons-path/AngleLeft.d.ts +0 -2
- package/dist/Icons/icons-path/AngleRight.d.ts +0 -2
- package/dist/Icons/icons-path/AngleWidth.d.ts +0 -2
- package/dist/Icons/icons-path/App.d.ts +0 -2
- package/dist/Icons/icons-path/Arrow.d.ts +0 -2
- package/dist/Icons/icons-path/ArrowLeft.d.ts +0 -2
- package/dist/Icons/icons-path/ArrowRight.d.ts +0 -2
- package/dist/Icons/icons-path/Back.d.ts +0 -2
- package/dist/Icons/icons-path/Ban.d.ts +0 -2
- package/dist/Icons/icons-path/BarcodeRead.d.ts +0 -2
- package/dist/Icons/icons-path/Bell.d.ts +0 -2
- package/dist/Icons/icons-path/Blog.d.ts +0 -2
- package/dist/Icons/icons-path/Bullhorn.d.ts +0 -2
- package/dist/Icons/icons-path/Calculator.d.ts +0 -2
- package/dist/Icons/icons-path/CalendarAlt.d.ts +0 -2
- package/dist/Icons/icons-path/Camera.d.ts +0 -2
- package/dist/Icons/icons-path/Check.d.ts +0 -2
- package/dist/Icons/icons-path/CheckCircle.d.ts +0 -2
- package/dist/Icons/icons-path/Clock.d.ts +0 -2
- package/dist/Icons/icons-path/Clockwise.d.ts +0 -2
- package/dist/Icons/icons-path/Close.d.ts +0 -2
- package/dist/Icons/icons-path/Cog.d.ts +0 -2
- package/dist/Icons/icons-path/Copy.d.ts +0 -2
- package/dist/Icons/icons-path/CreditCard.d.ts +0 -2
- package/dist/Icons/icons-path/DashedCircle.d.ts +0 -2
- package/dist/Icons/icons-path/DefaultCursor.d.ts +0 -2
- package/dist/Icons/icons-path/Desktop.d.ts +0 -2
- package/dist/Icons/icons-path/Discount.d.ts +0 -2
- package/dist/Icons/icons-path/DotsThree.d.ts +0 -2
- package/dist/Icons/icons-path/Download.d.ts +0 -2
- package/dist/Icons/icons-path/Edit.d.ts +0 -2
- package/dist/Icons/icons-path/Envelope.d.ts +0 -2
- package/dist/Icons/icons-path/Exchange.d.ts +0 -2
- package/dist/Icons/icons-path/ExchangeY.d.ts +0 -2
- package/dist/Icons/icons-path/Exclamation.d.ts +0 -2
- package/dist/Icons/icons-path/ExclamationCircle.d.ts +0 -2
- package/dist/Icons/icons-path/ExclamationTriangle.d.ts +0 -2
- package/dist/Icons/icons-path/ExternalLink.d.ts +0 -2
- package/dist/Icons/icons-path/Eye.d.ts +0 -2
- package/dist/Icons/icons-path/EyeSlash.d.ts +0 -2
- package/dist/Icons/icons-path/Filter.d.ts +0 -2
- package/dist/Icons/icons-path/HalfBack.d.ts +0 -2
- package/dist/Icons/icons-path/Hashtag.d.ts +0 -2
- package/dist/Icons/icons-path/Home.d.ts +0 -2
- package/dist/Icons/icons-path/IconSolidEnviali.d.ts +0 -2
- package/dist/Icons/icons-path/IconSolidLI.d.ts +0 -2
- package/dist/Icons/icons-path/IdentificationBadge.d.ts +0 -2
- package/dist/Icons/icons-path/Image.d.ts +0 -2
- package/dist/Icons/icons-path/InfoCircle.d.ts +0 -2
- package/dist/Icons/icons-path/Lightbulb.d.ts +0 -2
- package/dist/Icons/icons-path/Link.d.ts +0 -2
- package/dist/Icons/icons-path/ListItems.d.ts +0 -2
- package/dist/Icons/icons-path/Loading.d.ts +0 -2
- package/dist/Icons/icons-path/Minus.d.ts +0 -2
- package/dist/Icons/icons-path/MinusCircle.d.ts +0 -2
- package/dist/Icons/icons-path/MinusCircleSolid.d.ts +0 -2
- package/dist/Icons/icons-path/Mobile.d.ts +0 -2
- package/dist/Icons/icons-path/MoneyBill.d.ts +0 -2
- package/dist/Icons/icons-path/Move.d.ts +0 -2
- package/dist/Icons/icons-path/Nav.d.ts +0 -2
- package/dist/Icons/icons-path/Order.d.ts +0 -2
- package/dist/Icons/icons-path/Pagali.d.ts +0 -2
- package/dist/Icons/icons-path/PaperList.d.ts +0 -2
- package/dist/Icons/icons-path/PieChart.d.ts +0 -2
- package/dist/Icons/icons-path/Pix.d.ts +0 -2
- package/dist/Icons/icons-path/Plus.d.ts +0 -2
- package/dist/Icons/icons-path/PlusCircle.d.ts +0 -2
- package/dist/Icons/icons-path/Print.d.ts +0 -2
- package/dist/Icons/icons-path/Product.d.ts +0 -2
- package/dist/Icons/icons-path/QuestionCircle.d.ts +0 -2
- package/dist/Icons/icons-path/Reload.d.ts +0 -2
- package/dist/Icons/icons-path/Rocket.d.ts +0 -2
- package/dist/Icons/icons-path/Search.d.ts +0 -2
- package/dist/Icons/icons-path/ShoppingCart.d.ts +0 -2
- package/dist/Icons/icons-path/SortDown.d.ts +0 -2
- package/dist/Icons/icons-path/Store.d.ts +0 -2
- package/dist/Icons/icons-path/Sync.d.ts +0 -2
- package/dist/Icons/icons-path/ThinAngleRight.d.ts +0 -2
- package/dist/Icons/icons-path/TimesCircle.d.ts +0 -2
- package/dist/Icons/icons-path/Trash.d.ts +0 -2
- package/dist/Icons/icons-path/Trophy.d.ts +0 -2
- package/dist/Icons/icons-path/Truck.d.ts +0 -2
- package/dist/Icons/icons-path/Tv.d.ts +0 -2
- package/dist/Icons/icons-path/Upload.d.ts +0 -2
- package/dist/Icons/icons-path/UsdCircle.d.ts +0 -2
- package/dist/Icons/icons-path/User.d.ts +0 -2
- package/dist/Icons/icons-path/WhatsApp.d.ts +0 -2
- package/dist/Icons/icons-path/index.d.ts +0 -96
- package/dist/Icons/index.d.ts +0 -2
- package/dist/Indicators/Alert/Alert.d.ts +0 -48
- package/dist/Indicators/Alert/Alert.spec.d.ts +0 -1
- package/dist/Indicators/Alert/Alert.stories.d.ts +0 -5
- package/dist/Indicators/Alert/index.d.ts +0 -1
- package/dist/Indicators/Badge/Badge.d.ts +0 -44
- package/dist/Indicators/Badge/Badge.spec.d.ts +0 -1
- package/dist/Indicators/Badge/Badge.stories.d.ts +0 -6
- package/dist/Indicators/Badge/index.d.ts +0 -1
- package/dist/Indicators/InformationBox/InformationBox.d.ts +0 -25
- package/dist/Indicators/InformationBox/InformationBox.spec.d.ts +0 -1
- package/dist/Indicators/InformationBox/InformationBoxt.stories.d.ts +0 -4
- package/dist/Indicators/InformationBox/index.d.ts +0 -1
- package/dist/Indicators/Status/Status.d.ts +0 -25
- package/dist/Indicators/Status/Status.spec.d.ts +0 -1
- package/dist/Indicators/Status/Status.stories.d.ts +0 -4
- package/dist/Indicators/Status/index.d.ts +0 -1
- package/dist/Indicators/Tag/Tag.d.ts +0 -32
- package/dist/Indicators/Tag/Tag.spec.d.ts +0 -1
- package/dist/Indicators/Tag/Tag.stories.d.ts +0 -5
- package/dist/Indicators/Tag/index.d.ts +0 -1
- package/dist/Indicators/Toast/Toast.d.ts +0 -6
- package/dist/Indicators/Toast/Toast.spec.d.ts +0 -1
- package/dist/Indicators/Toast/Toast.stories.d.ts +0 -3
- package/dist/Indicators/Toast/index.d.ts +0 -1
- package/dist/Indicators/Tooltip/Tooltip.d.ts +0 -39
- package/dist/Indicators/Tooltip/Tooltip.spec.d.ts +0 -1
- package/dist/Indicators/Tooltip/Tooltip.stories.d.ts +0 -4
- package/dist/Indicators/Tooltip/index.d.ts +0 -1
- package/dist/Indicators/index.d.ts +0 -7
- package/dist/Layout/ActionBar/ActionBar.d.ts +0 -12
- package/dist/Layout/ActionBar/ActionBar.spec.d.ts +0 -1
- package/dist/Layout/ActionBar/ActionBar.stories.d.ts +0 -5
- package/dist/Layout/ActionBar/index.d.ts +0 -1
- package/dist/Layout/Box/Box.d.ts +0 -33
- package/dist/Layout/Box/Box.spec.d.ts +0 -1
- package/dist/Layout/Box/Box.stories.d.ts +0 -21
- package/dist/Layout/Box/Components/Content/BoxContent.d.ts +0 -9
- package/dist/Layout/Box/Components/Content/BoxContent.spec.d.ts +0 -1
- package/dist/Layout/Box/Components/Content/BoxContent.stories.d.ts +0 -4
- package/dist/Layout/Box/Components/Header/BoxHeader.d.ts +0 -22
- package/dist/Layout/Box/Components/Header/BoxHeader.spec.d.ts +0 -1
- package/dist/Layout/Box/Components/Header/BoxHeader.stories.d.ts +0 -7
- package/dist/Layout/Box/Components/Separator/BoxSeparator.d.ts +0 -2
- package/dist/Layout/Box/Components/Separator/BoxSeparator.spec.d.ts +0 -1
- package/dist/Layout/Box/Components/Separator/BoxSeparator.stories.d.ts +0 -4
- package/dist/Layout/Box/Components/utils.d.ts +0 -32
- package/dist/Layout/Box/index.d.ts +0 -1
- package/dist/Layout/Container/Container.d.ts +0 -16
- package/dist/Layout/Container/Container.spec.d.ts +0 -1
- package/dist/Layout/Container/Container.stories.d.ts +0 -5
- package/dist/Layout/Container/index.d.ts +0 -1
- package/dist/Layout/ListActions/ListActions.d.ts +0 -42
- package/dist/Layout/ListActions/ListActions.spec.d.ts +0 -1
- package/dist/Layout/ListActions/ListActions.stories.d.ts +0 -4
- package/dist/Layout/ListActions/index.d.ts +0 -1
- package/dist/Layout/Sidebar/Item.d.ts +0 -34
- package/dist/Layout/Sidebar/ItemSub.d.ts +0 -16
- package/dist/Layout/Sidebar/Sidebar.d.ts +0 -17
- package/dist/Layout/Sidebar/Sidebar.stories.d.ts +0 -4
- package/dist/Layout/Sidebar/index.d.ts +0 -3
- package/dist/Layout/Topbar/Topbar.d.ts +0 -21
- package/dist/Layout/Topbar/Topbar.stories.d.ts +0 -4
- package/dist/Layout/Topbar/index.d.ts +0 -1
- package/dist/Layout/constants.d.ts +0 -4
- package/dist/Layout/index.d.ts +0 -6
- package/dist/Navigation/Breadcrumb/Breadcrumb.spec.d.ts +0 -1
- package/dist/Navigation/Breadcrumb/Breadcrumb.stories.d.ts +0 -11
- package/dist/Navigation/Breadcrumb/index.d.ts +0 -45
- package/dist/Navigation/Pagination/Pagination.spec.d.ts +0 -1
- package/dist/Navigation/Pagination/Pagination.stories.d.ts +0 -6
- package/dist/Navigation/Pagination/PaginationInfo.d.ts +0 -24
- package/dist/Navigation/Pagination/PaginationNav.d.ts +0 -16
- package/dist/Navigation/Pagination/index.d.ts +0 -10
- package/dist/Navigation/Stepper/Stepper.spec.d.ts +0 -1
- package/dist/Navigation/Stepper/Stepper.stories.d.ts +0 -8
- package/dist/Navigation/Stepper/index.d.ts +0 -29
- package/dist/Navigation/index.d.ts +0 -2
- package/dist/admin-components.cjs.development.js +0 -49805
- package/dist/admin-components.cjs.development.js.map +0 -1
- package/dist/admin-components.cjs.production.min.js +0 -2
- package/dist/admin-components.cjs.production.min.js.map +0 -1
- package/dist/admin-components.esm.js +0 -49743
- package/dist/admin-components.esm.js.map +0 -1
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/testConstants.d.ts +0 -3
- package/src/Components/Button/Button.spec.tsx +0 -75
- package/src/Components/Button/Button.stories.tsx +0 -63
- package/src/Components/Button/Button.tsx +0 -194
- package/src/Components/Button/index.tsx +0 -1
- package/src/Components/HelpLink/HelpLink.spec.tsx +0 -33
- package/src/Components/HelpLink/HelpLink.stories.tsx +0 -39
- package/src/Components/HelpLink/index.tsx +0 -80
- package/src/Components/LoadingPlaceholder/LoadingPlaceholder.stories.tsx +0 -14
- package/src/Components/LoadingPlaceholder/LoadingPlaceholder.tsx +0 -17
- package/src/Components/LoadingPlaceholder/index.tsx +0 -1
- package/src/Components/Modal/Modal.spec.tsx +0 -15
- package/src/Components/Modal/Modal.stories.tsx +0 -129
- package/src/Components/Modal/Modal.tsx +0 -141
- package/src/Components/Modal/index.tsx +0 -1
- package/src/Components/SidebarFixed/SidebarFixed.spec.tsx +0 -36
- package/src/Components/SidebarFixed/SidebarFixed.stories.tsx +0 -39
- package/src/Components/SidebarFixed/SidebarFixed.tsx +0 -119
- package/src/Components/SidebarFixed/index.tsx +0 -1
- package/src/Components/Table/Table.stories.tsx +0 -188
- package/src/Components/Table/Table.tsx +0 -346
- package/src/Components/Table/index.tsx +0 -1
- package/src/Components/TableList/TableList.spec.tsx +0 -86
- package/src/Components/TableList/TableList.stories.tsx +0 -168
- package/src/Components/TableList/TableList.tsx +0 -169
- package/src/Components/TableList/TableListItem.interface.ts +0 -69
- package/src/Components/TableList/TableListItem.spec.tsx +0 -75
- package/src/Components/TableList/TableListItem.stories.tsx +0 -44
- package/src/Components/TableList/TableListItem.tsx +0 -79
- package/src/Components/TableList/TableListItemLoading.spec.tsx +0 -19
- package/src/Components/TableList/TableListItemLoading.stories.tsx +0 -22
- package/src/Components/TableList/TableListItemLoading.tsx +0 -40
- package/src/Components/TableList/TableListItemWrapper.spec.tsx +0 -33
- package/src/Components/TableList/TableListItemWrapper.stories.tsx +0 -38
- package/src/Components/TableList/TableListItemWrapper.tsx +0 -40
- package/src/Components/TableList/index.tsx +0 -4
- package/src/Components/Tabs/Tabs.spec.tsx +0 -38
- package/src/Components/Tabs/Tabs.stories.tsx +0 -62
- package/src/Components/Tabs/Tabs.tsx +0 -66
- package/src/Components/Tabs/TabsItem.interface.ts +0 -19
- package/src/Components/Tabs/TabsItem.tsx +0 -50
- package/src/Components/Tabs/index.tsx +0 -1
- package/src/Components/Timeline/Timeline.spec.tsx +0 -66
- package/src/Components/Timeline/Timeline.stories.tsx +0 -58
- package/src/Components/Timeline/Timeline.tsx +0 -75
- package/src/Components/Timeline/TimelineItem.interface.ts +0 -32
- package/src/Components/Timeline/TimelineItem.tsx +0 -65
- package/src/Components/Timeline/index.tsx +0 -1
- package/src/Components/index.ts +0 -8
- package/src/Forms/Checkbox/Checkbox.spec.tsx +0 -26
- package/src/Forms/Checkbox/Checkbox.stories.tsx +0 -65
- package/src/Forms/Checkbox/Checkbox.tsx +0 -166
- package/src/Forms/Checkbox/index.tsx +0 -1
- package/src/Forms/Dropdown/Dropdown.spec.tsx +0 -38
- package/src/Forms/Dropdown/Dropdown.stories.tsx +0 -152
- package/src/Forms/Dropdown/Dropdown.tsx +0 -433
- package/src/Forms/Dropdown/index.ts +0 -1
- package/src/Forms/FloatingLabelInput/FloatingLabelInput.spec.tsx +0 -26
- package/src/Forms/FloatingLabelInput/FloatingLabelInput.stories.tsx +0 -73
- package/src/Forms/FloatingLabelInput/FloatingLabelInput.tsx +0 -93
- package/src/Forms/FloatingLabelInput/index.ts +0 -1
- package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.tsx +0 -16
- package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.tsx +0 -72
- package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.tsx +0 -251
- package/src/Forms/FloatingLabelInputCurrency/index.ts +0 -1
- package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.tsx +0 -66
- package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.tsx +0 -148
- package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.tsx +0 -56
- package/src/Forms/FloatingLabelInputMask/index.ts +0 -1
- package/src/Forms/Input/Input.spec.tsx +0 -80
- package/src/Forms/Input/Input.stories.tsx +0 -170
- package/src/Forms/Input/Input.tsx +0 -158
- package/src/Forms/Input/index.ts +0 -1
- package/src/Forms/InputCurrency/InputCurrency.spec.tsx +0 -32
- package/src/Forms/InputCurrency/InputCurrency.stories.tsx +0 -45
- package/src/Forms/InputCurrency/InputCurrency.tsx +0 -224
- package/src/Forms/InputCurrency/index.ts +0 -1
- package/src/Forms/InputCurrency/utils.ts +0 -36
- package/src/Forms/InputHelpText/InputHelpText.spec.tsx +0 -22
- package/src/Forms/InputHelpText/InputHelpText.stories.tsx +0 -16
- package/src/Forms/InputHelpText/InputHelpText.tsx +0 -31
- package/src/Forms/InputHelpText/index.ts +0 -1
- package/src/Forms/InputLabel/InputLabel.spec.tsx +0 -30
- package/src/Forms/InputLabel/InputLabel.stories.tsx +0 -24
- package/src/Forms/InputLabel/InputLabel.tsx +0 -52
- package/src/Forms/InputLabel/index.ts +0 -1
- package/src/Forms/InputMask/InputMask.spec.tsx +0 -97
- package/src/Forms/InputMask/InputMask.stories.tsx +0 -126
- package/src/Forms/InputMask/InputMask.tsx +0 -51
- package/src/Forms/InputMask/index.ts +0 -1
- package/src/Forms/InputMask/maskDate.ts +0 -81
- package/src/Forms/InputMask/utils.ts +0 -154
- package/src/Forms/RadioButton/RadioButton.spec.tsx +0 -27
- package/src/Forms/RadioButton/RadioButton.stories.tsx +0 -40
- package/src/Forms/RadioButton/RadioButton.tsx +0 -80
- package/src/Forms/RadioButton/index.tsx +0 -1
- package/src/Forms/Select/Select.spec.tsx +0 -41
- package/src/Forms/Select/Select.stories.tsx +0 -58
- package/src/Forms/Select/Select.tsx +0 -148
- package/src/Forms/Select/index.ts +0 -1
- package/src/Forms/Toggle/Toggle.spec.tsx +0 -29
- package/src/Forms/Toggle/Toggle.stories.tsx +0 -43
- package/src/Forms/Toggle/Toggle.tsx +0 -85
- package/src/Forms/Toggle/index.tsx +0 -1
- package/src/Forms/ToggleButton/ToggleButton.spec.tsx +0 -29
- package/src/Forms/ToggleButton/ToggleButton.stories.tsx +0 -51
- package/src/Forms/ToggleButton/ToggleButton.tsx +0 -95
- package/src/Forms/ToggleButton/index.tsx +0 -1
- package/src/Forms/commonStyles.ts +0 -29
- package/src/Forms/index.ts +0 -14
- package/src/Icons/Icon/Icon.spec.tsx +0 -27
- package/src/Icons/Icon/Icon.stories.tsx +0 -12
- package/src/Icons/Icon/Icon.tsx +0 -56
- package/src/Icons/Icon/index.ts +0 -1
- package/src/Icons/IconCircular/IconCircular.spec.tsx +0 -24
- package/src/Icons/IconCircular/IconCircular.stories.tsx +0 -24
- package/src/Icons/IconCircular/IconCircular.tsx +0 -67
- package/src/Icons/IconCircular/index.ts +0 -1
- package/src/Icons/IconList.tsx +0 -27
- package/src/Icons/icons-path/Adjust.tsx +0 -16
- package/src/Icons/icons-path/AngleDiagonal.tsx +0 -20
- package/src/Icons/icons-path/AngleDown.tsx +0 -9
- package/src/Icons/icons-path/AngleHeight.tsx +0 -17
- package/src/Icons/icons-path/AngleLeft.tsx +0 -9
- package/src/Icons/icons-path/AngleRight.tsx +0 -9
- package/src/Icons/icons-path/AngleWidth.tsx +0 -17
- package/src/Icons/icons-path/App.tsx +0 -9
- package/src/Icons/icons-path/Arrow.tsx +0 -11
- package/src/Icons/icons-path/ArrowLeft.tsx +0 -9
- package/src/Icons/icons-path/ArrowRight.tsx +0 -9
- package/src/Icons/icons-path/Back.tsx +0 -5
- package/src/Icons/icons-path/Ban.tsx +0 -9
- package/src/Icons/icons-path/BarcodeRead.tsx +0 -9
- package/src/Icons/icons-path/Bell.tsx +0 -9
- package/src/Icons/icons-path/Blog.tsx +0 -9
- package/src/Icons/icons-path/Bullhorn.tsx +0 -9
- package/src/Icons/icons-path/Calculator.tsx +0 -9
- package/src/Icons/icons-path/CalendarAlt.tsx +0 -9
- package/src/Icons/icons-path/Camera.tsx +0 -9
- package/src/Icons/icons-path/Check.tsx +0 -9
- package/src/Icons/icons-path/CheckCircle.tsx +0 -9
- package/src/Icons/icons-path/Clock.tsx +0 -9
- package/src/Icons/icons-path/Clockwise.tsx +0 -22
- package/src/Icons/icons-path/Close.tsx +0 -9
- package/src/Icons/icons-path/Cog.tsx +0 -9
- package/src/Icons/icons-path/Copy.tsx +0 -9
- package/src/Icons/icons-path/CreditCard.tsx +0 -9
- package/src/Icons/icons-path/DashedCircle.tsx +0 -32
- package/src/Icons/icons-path/DefaultCursor.tsx +0 -14
- package/src/Icons/icons-path/Desktop.tsx +0 -9
- package/src/Icons/icons-path/Discount.tsx +0 -9
- package/src/Icons/icons-path/DotsThree.tsx +0 -9
- package/src/Icons/icons-path/Download.tsx +0 -9
- package/src/Icons/icons-path/Edit.tsx +0 -9
- package/src/Icons/icons-path/Envelope.tsx +0 -9
- package/src/Icons/icons-path/Exchange.tsx +0 -9
- package/src/Icons/icons-path/ExchangeY.tsx +0 -9
- package/src/Icons/icons-path/Exclamation.tsx +0 -17
- package/src/Icons/icons-path/ExclamationCircle.tsx +0 -9
- package/src/Icons/icons-path/ExclamationTriangle.tsx +0 -9
- package/src/Icons/icons-path/ExternalLink.tsx +0 -9
- package/src/Icons/icons-path/Eye.tsx +0 -9
- package/src/Icons/icons-path/EyeSlash.tsx +0 -9
- package/src/Icons/icons-path/Filter.tsx +0 -9
- package/src/Icons/icons-path/HalfBack.tsx +0 -12
- package/src/Icons/icons-path/Hashtag.tsx +0 -13
- package/src/Icons/icons-path/Home.tsx +0 -9
- package/src/Icons/icons-path/IconSolidEnviali.tsx +0 -9
- package/src/Icons/icons-path/IconSolidLI.tsx +0 -12
- package/src/Icons/icons-path/IdentificationBadge.tsx +0 -22
- package/src/Icons/icons-path/Image.tsx +0 -9
- package/src/Icons/icons-path/InfoCircle.tsx +0 -9
- package/src/Icons/icons-path/Lightbulb.tsx +0 -9
- package/src/Icons/icons-path/Link.tsx +0 -9
- package/src/Icons/icons-path/ListItems.tsx +0 -14
- package/src/Icons/icons-path/Loading.tsx +0 -19
- package/src/Icons/icons-path/Minus.tsx +0 -5
- package/src/Icons/icons-path/MinusCircle.tsx +0 -26
- package/src/Icons/icons-path/MinusCircleSolid.tsx +0 -30
- package/src/Icons/icons-path/Mobile.tsx +0 -9
- package/src/Icons/icons-path/MoneyBill.tsx +0 -9
- package/src/Icons/icons-path/Move.tsx +0 -9
- package/src/Icons/icons-path/Nav.tsx +0 -11
- package/src/Icons/icons-path/Order.tsx +0 -9
- package/src/Icons/icons-path/Pagali.tsx +0 -16
- package/src/Icons/icons-path/PaperList.tsx +0 -9
- package/src/Icons/icons-path/PieChart.tsx +0 -9
- package/src/Icons/icons-path/Pix.tsx +0 -8
- package/src/Icons/icons-path/Plus.tsx +0 -9
- package/src/Icons/icons-path/PlusCircle.tsx +0 -9
- package/src/Icons/icons-path/Print.tsx +0 -9
- package/src/Icons/icons-path/Product.tsx +0 -9
- package/src/Icons/icons-path/QuestionCircle.tsx +0 -9
- package/src/Icons/icons-path/Reload.tsx +0 -9
- package/src/Icons/icons-path/Rocket.tsx +0 -22
- package/src/Icons/icons-path/Search.tsx +0 -11
- package/src/Icons/icons-path/ShoppingCart.tsx +0 -11
- package/src/Icons/icons-path/SortDown.tsx +0 -9
- package/src/Icons/icons-path/Store.tsx +0 -9
- package/src/Icons/icons-path/Sync.tsx +0 -9
- package/src/Icons/icons-path/ThinAngleRight.tsx +0 -12
- package/src/Icons/icons-path/TimesCircle.tsx +0 -9
- package/src/Icons/icons-path/Trash.tsx +0 -9
- package/src/Icons/icons-path/Trophy.tsx +0 -22
- package/src/Icons/icons-path/Truck.tsx +0 -9
- package/src/Icons/icons-path/Tv.tsx +0 -9
- package/src/Icons/icons-path/Upload.tsx +0 -11
- package/src/Icons/icons-path/UsdCircle.tsx +0 -9
- package/src/Icons/icons-path/User.tsx +0 -9
- package/src/Icons/icons-path/WhatsApp.tsx +0 -9
- package/src/Icons/icons-path/index.ts +0 -186
- package/src/Icons/index.ts +0 -2
- package/src/Indicators/Alert/Alert.spec.tsx +0 -53
- package/src/Indicators/Alert/Alert.stories.tsx +0 -39
- package/src/Indicators/Alert/Alert.tsx +0 -141
- package/src/Indicators/Alert/index.tsx +0 -1
- package/src/Indicators/Badge/Badge.spec.tsx +0 -73
- package/src/Indicators/Badge/Badge.stories.tsx +0 -40
- package/src/Indicators/Badge/Badge.tsx +0 -80
- package/src/Indicators/Badge/index.tsx +0 -1
- package/src/Indicators/InformationBox/InformationBox.spec.tsx +0 -31
- package/src/Indicators/InformationBox/InformationBox.tsx +0 -93
- package/src/Indicators/InformationBox/InformationBoxt.stories.tsx +0 -29
- package/src/Indicators/InformationBox/index.tsx +0 -1
- package/src/Indicators/Status/Status.spec.tsx +0 -47
- package/src/Indicators/Status/Status.stories.tsx +0 -16
- package/src/Indicators/Status/Status.tsx +0 -65
- package/src/Indicators/Status/index.tsx +0 -1
- package/src/Indicators/Tag/Tag.spec.tsx +0 -39
- package/src/Indicators/Tag/Tag.stories.tsx +0 -33
- package/src/Indicators/Tag/Tag.tsx +0 -55
- package/src/Indicators/Tag/index.tsx +0 -1
- package/src/Indicators/Toast/Toast.spec.tsx +0 -18
- package/src/Indicators/Toast/Toast.stories.tsx +0 -32
- package/src/Indicators/Toast/Toast.tsx +0 -76
- package/src/Indicators/Toast/index.tsx +0 -1
- package/src/Indicators/Tooltip/Tooltip.spec.tsx +0 -18
- package/src/Indicators/Tooltip/Tooltip.stories.tsx +0 -33
- package/src/Indicators/Tooltip/Tooltip.tsx +0 -80
- package/src/Indicators/Tooltip/index.tsx +0 -1
- package/src/Indicators/Tooltip/style.scss +0 -72
- package/src/Indicators/index.ts +0 -7
- package/src/Layout/ActionBar/ActionBar.spec.tsx +0 -20
- package/src/Layout/ActionBar/ActionBar.stories.tsx +0 -42
- package/src/Layout/ActionBar/ActionBar.tsx +0 -89
- package/src/Layout/ActionBar/index.tsx +0 -1
- package/src/Layout/Box/Box.spec.tsx +0 -73
- package/src/Layout/Box/Box.stories.tsx +0 -165
- package/src/Layout/Box/Box.tsx +0 -81
- package/src/Layout/Box/Components/Content/BoxContent.spec.tsx +0 -20
- package/src/Layout/Box/Components/Content/BoxContent.stories.tsx +0 -23
- package/src/Layout/Box/Components/Content/BoxContent.tsx +0 -26
- package/src/Layout/Box/Components/Header/BoxHeader.spec.tsx +0 -22
- package/src/Layout/Box/Components/Header/BoxHeader.stories.tsx +0 -32
- package/src/Layout/Box/Components/Header/BoxHeader.tsx +0 -93
- package/src/Layout/Box/Components/Separator/BoxSeparator.spec.tsx +0 -20
- package/src/Layout/Box/Components/Separator/BoxSeparator.stories.tsx +0 -30
- package/src/Layout/Box/Components/Separator/BoxSeparator.tsx +0 -19
- package/src/Layout/Box/Components/utils.ts +0 -50
- package/src/Layout/Box/index.tsx +0 -1
- package/src/Layout/Container/Container.spec.tsx +0 -22
- package/src/Layout/Container/Container.stories.tsx +0 -51
- package/src/Layout/Container/Container.tsx +0 -42
- package/src/Layout/Container/index.tsx +0 -1
- package/src/Layout/ListActions/ListActions.spec.tsx +0 -23
- package/src/Layout/ListActions/ListActions.stories.tsx +0 -71
- package/src/Layout/ListActions/ListActions.tsx +0 -149
- package/src/Layout/ListActions/index.tsx +0 -1
- package/src/Layout/Sidebar/Item.tsx +0 -106
- package/src/Layout/Sidebar/ItemSub.tsx +0 -42
- package/src/Layout/Sidebar/Sidebar.stories.tsx +0 -25
- package/src/Layout/Sidebar/Sidebar.tsx +0 -51
- package/src/Layout/Sidebar/index.tsx +0 -3
- package/src/Layout/Topbar/Topbar.stories.tsx +0 -18
- package/src/Layout/Topbar/Topbar.tsx +0 -43
- package/src/Layout/Topbar/index.tsx +0 -1
- package/src/Layout/constants.ts +0 -4
- package/src/Layout/index.ts +0 -6
- package/src/Navigation/Breadcrumb/Breadcrumb.spec.tsx +0 -75
- package/src/Navigation/Breadcrumb/Breadcrumb.stories.tsx +0 -79
- package/src/Navigation/Breadcrumb/index.tsx +0 -153
- package/src/Navigation/Pagination/Pagination.spec.tsx +0 -45
- package/src/Navigation/Pagination/Pagination.stories.tsx +0 -39
- package/src/Navigation/Pagination/PaginationInfo.tsx +0 -70
- package/src/Navigation/Pagination/PaginationNav.tsx +0 -122
- package/src/Navigation/Pagination/index.tsx +0 -44
- package/src/Navigation/Stepper/Stepper.spec.tsx +0 -68
- package/src/Navigation/Stepper/Stepper.stories.tsx +0 -68
- package/src/Navigation/Stepper/index.tsx +0 -97
- package/src/Navigation/index.ts +0 -2
- package/src/index.ts +0 -6
- package/src/tailwind.scss +0 -9
- package/src/utils/index.ts +0 -19
- package/src/utils/testConstants.ts +0 -3
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { Row, useTable } from 'react-table'
|
|
4
|
-
import { Checkbox } from '../../Forms'
|
|
5
|
-
import { LoadingPlaceholder } from '../LoadingPlaceholder'
|
|
6
|
-
|
|
7
|
-
const textAligns = {
|
|
8
|
-
right: 'text-right',
|
|
9
|
-
left: 'text-left',
|
|
10
|
-
center: 'text-center',
|
|
11
|
-
}
|
|
12
|
-
// const placeholderSizes = {
|
|
13
|
-
// default: "pv4",
|
|
14
|
-
// large: "pv8"
|
|
15
|
-
// }
|
|
16
|
-
|
|
17
|
-
interface TdWrapperProps {
|
|
18
|
-
Wrapper?: CellWrapperProp
|
|
19
|
-
children: React.ReactNode
|
|
20
|
-
props?: { [key: string]: unknown }
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const TdClasses = `p-0 break-words border-t border-card-stroke first:rounded-bl last:rounded-br`
|
|
24
|
-
const TdWrapperClasses = `block p-4 no-underline`
|
|
25
|
-
const TdWrapper = ({ Wrapper, props = {}, children }: TdWrapperProps) =>
|
|
26
|
-
Wrapper ? (
|
|
27
|
-
<Wrapper className={TdWrapperClasses} {...props}>
|
|
28
|
-
{children}
|
|
29
|
-
</Wrapper>
|
|
30
|
-
) : (
|
|
31
|
-
<div className={TdWrapperClasses} {...props}>
|
|
32
|
-
{children}
|
|
33
|
-
</div>
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
const TableComponent = ({
|
|
37
|
-
columns: columnsProps,
|
|
38
|
-
rows: rowsProps = [],
|
|
39
|
-
selectable = false,
|
|
40
|
-
isLoading = false,
|
|
41
|
-
emptyText = 'Nenhum registro encontrado',
|
|
42
|
-
onChange,
|
|
43
|
-
selectedData,
|
|
44
|
-
disabledRows = [],
|
|
45
|
-
id,
|
|
46
|
-
}: TableProps) => {
|
|
47
|
-
const rowsPropsMemoized = React.useMemo(() => rowsProps, [rowsProps])
|
|
48
|
-
const [selectedRows, setSelectedRows] = React.useState<number[]>([])
|
|
49
|
-
|
|
50
|
-
const columns = React.useMemo(
|
|
51
|
-
() =>
|
|
52
|
-
columnsProps.map((column) => {
|
|
53
|
-
return {
|
|
54
|
-
Header: column.label as any,
|
|
55
|
-
accessor: column.id as string,
|
|
56
|
-
textAlign: column.textAlign,
|
|
57
|
-
...(column.size && { size: column.size }),
|
|
58
|
-
Cell: ({ value, cellWrapperProps }: any) => (
|
|
59
|
-
<TdWrapper Wrapper={column.cellWrapper} props={cellWrapperProps}>
|
|
60
|
-
{value}
|
|
61
|
-
</TdWrapper>
|
|
62
|
-
),
|
|
63
|
-
}
|
|
64
|
-
}),
|
|
65
|
-
[columnsProps]
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } =
|
|
69
|
-
useTable({ columns, data: rowsPropsMemoized })
|
|
70
|
-
|
|
71
|
-
const handleSelect = React.useCallback(
|
|
72
|
-
(newSelectedRows: number[]) => {
|
|
73
|
-
setSelectedRows(newSelectedRows)
|
|
74
|
-
const mapped = rows.filter(
|
|
75
|
-
(element, index) => newSelectedRows.includes(index) && element
|
|
76
|
-
)
|
|
77
|
-
onChange?.(mapped)
|
|
78
|
-
return
|
|
79
|
-
},
|
|
80
|
-
[rows, onChange]
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
const handleSelectRow = React.useCallback(
|
|
84
|
-
(index: number, event: React.ChangeEvent<HTMLInputElement>) => {
|
|
85
|
-
const isChecked = event.target.checked
|
|
86
|
-
const newSelectedRows = [...selectedRows]
|
|
87
|
-
if (isChecked && !disabledRows.includes(index)) {
|
|
88
|
-
newSelectedRows.push(index)
|
|
89
|
-
} else {
|
|
90
|
-
const existentRow = newSelectedRows.indexOf(index)
|
|
91
|
-
if (existentRow !== -1) newSelectedRows.splice(existentRow, 1)
|
|
92
|
-
}
|
|
93
|
-
handleSelect(newSelectedRows)
|
|
94
|
-
},
|
|
95
|
-
[selectedRows, disabledRows, handleSelect]
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
const handleSelectAllRows = React.useCallback(
|
|
99
|
-
(event: React.ChangeEvent<HTMLInputElement>) => {
|
|
100
|
-
const isChecked = event.target.checked
|
|
101
|
-
const newSelectedRows: number[] = []
|
|
102
|
-
if (isChecked) {
|
|
103
|
-
rows.forEach((_, index) => {
|
|
104
|
-
if (!disabledRows.includes(index)) newSelectedRows.push(index)
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
handleSelect(newSelectedRows)
|
|
108
|
-
return
|
|
109
|
-
},
|
|
110
|
-
[rows, disabledRows, handleSelect]
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
React.useEffect(() => {
|
|
114
|
-
if (selectedData) {
|
|
115
|
-
let isDataEqual = true
|
|
116
|
-
if (selectedRows.length > selectedData.length) {
|
|
117
|
-
isDataEqual = selectedRows.every((v, i) => v === selectedData[i])
|
|
118
|
-
} else {
|
|
119
|
-
isDataEqual = selectedData.every((v, i) => v === selectedRows[i])
|
|
120
|
-
}
|
|
121
|
-
if (!isDataEqual) setSelectedRows(selectedData)
|
|
122
|
-
}
|
|
123
|
-
}, [selectedData, selectedRows])
|
|
124
|
-
|
|
125
|
-
const isHeaderSelectChecked = React.useMemo(() => {
|
|
126
|
-
return selectedRows.length === rows.length - disabledRows.length
|
|
127
|
-
}, [selectedRows, disabledRows, rows])
|
|
128
|
-
|
|
129
|
-
const isHeaderSelectDisabled = React.useMemo(() => {
|
|
130
|
-
return disabledRows.length === rows.length
|
|
131
|
-
}, [disabledRows, rows])
|
|
132
|
-
|
|
133
|
-
const isHeaderSelectedIndeterminate = React.useMemo(() => {
|
|
134
|
-
return (
|
|
135
|
-
selectedRows.length < rows.length - disabledRows.length &&
|
|
136
|
-
selectedRows.length > 0
|
|
137
|
-
)
|
|
138
|
-
}, [selectedRows, disabledRows, rows])
|
|
139
|
-
|
|
140
|
-
const columnsLength = React.useMemo(() => {
|
|
141
|
-
return selectable ? columns.length + 1 : columns.length
|
|
142
|
-
}, [columns, selectable])
|
|
143
|
-
|
|
144
|
-
const tableId = React.useMemo(() => {
|
|
145
|
-
return id ? `${id.charAt(0).toUpperCase()}${id.slice(1)}` : ''
|
|
146
|
-
}, [id])
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<div className="max-w-full overflow-x-auto">
|
|
150
|
-
<table
|
|
151
|
-
{...getTableProps()}
|
|
152
|
-
id={id}
|
|
153
|
-
className={`w-full bg-base-1 rounded border-separate border border-card-stroke`}
|
|
154
|
-
cellSpacing="0"
|
|
155
|
-
>
|
|
156
|
-
<thead className={`text-left`}>
|
|
157
|
-
{headerGroups.map((headerGroup) => {
|
|
158
|
-
const { key, ...restHeaderGroupProps } =
|
|
159
|
-
headerGroup.getHeaderGroupProps()
|
|
160
|
-
return (
|
|
161
|
-
<tr key={key} {...restHeaderGroupProps} className="bg-base-2">
|
|
162
|
-
{selectable && (
|
|
163
|
-
<th
|
|
164
|
-
colSpan={1}
|
|
165
|
-
className={`py-2 px-4 first:rounded-tl last:rounded-tr`}
|
|
166
|
-
>
|
|
167
|
-
<Checkbox
|
|
168
|
-
onChange={(e) => handleSelectAllRows(e)}
|
|
169
|
-
checked={isHeaderSelectChecked}
|
|
170
|
-
indeterminate={isHeaderSelectedIndeterminate}
|
|
171
|
-
disabled={isHeaderSelectDisabled}
|
|
172
|
-
id={`checkboxSelectAllRows${tableId}`}
|
|
173
|
-
/>
|
|
174
|
-
</th>
|
|
175
|
-
)}
|
|
176
|
-
{headerGroup.headers.map((column) => {
|
|
177
|
-
const { key, ...restHeaderProps } = column.getHeaderProps()
|
|
178
|
-
const columnAsAny = column as { [key: string]: any }
|
|
179
|
-
const textAlign: TextAlignProp =
|
|
180
|
-
columnAsAny.textAlign || 'left'
|
|
181
|
-
return (
|
|
182
|
-
<th
|
|
183
|
-
key={key}
|
|
184
|
-
{...restHeaderProps}
|
|
185
|
-
className={`py-2 px-4 text-inverted-2 text-xs font-semibold first:rounded-tl last:rounded-tr ${
|
|
186
|
-
textAligns[textAlign]
|
|
187
|
-
} ${columnAsAny.size || ''}`}
|
|
188
|
-
>
|
|
189
|
-
{column.render('Header')}
|
|
190
|
-
</th>
|
|
191
|
-
)
|
|
192
|
-
})}
|
|
193
|
-
</tr>
|
|
194
|
-
)
|
|
195
|
-
})}
|
|
196
|
-
</thead>
|
|
197
|
-
<tbody {...getTableBodyProps()} className="text-sm text-on-base">
|
|
198
|
-
{isLoading ? (
|
|
199
|
-
<tr>
|
|
200
|
-
{Array(columnsLength)
|
|
201
|
-
.fill(0)
|
|
202
|
-
.map((_, key) => (
|
|
203
|
-
<td key={key} className={`${TdClasses}`}>
|
|
204
|
-
<TdWrapper>
|
|
205
|
-
<LoadingPlaceholder />
|
|
206
|
-
</TdWrapper>
|
|
207
|
-
</td>
|
|
208
|
-
))}
|
|
209
|
-
</tr>
|
|
210
|
-
) : !rows || !rows.length ? (
|
|
211
|
-
<tr>
|
|
212
|
-
<td colSpan={columnsLength || 1} className={`${TdClasses}`}>
|
|
213
|
-
<TdWrapper>
|
|
214
|
-
<div className="text-center py-16 text-xl font-semibold text-on-base-2">
|
|
215
|
-
{emptyText}
|
|
216
|
-
</div>
|
|
217
|
-
</TdWrapper>
|
|
218
|
-
</td>
|
|
219
|
-
</tr>
|
|
220
|
-
) : (
|
|
221
|
-
rows.map((row, index) => {
|
|
222
|
-
prepareRow(row)
|
|
223
|
-
const { key, ...restRowProps } = row.getRowProps()
|
|
224
|
-
const isRowDisabled = disabledRows.includes(index)
|
|
225
|
-
const isRowChecked = selectedRows.includes(index)
|
|
226
|
-
return (
|
|
227
|
-
<tr
|
|
228
|
-
key={key}
|
|
229
|
-
{...restRowProps}
|
|
230
|
-
className={`hover:bg-base-2 ${
|
|
231
|
-
isRowChecked ? 'bg-primary-light' : ''
|
|
232
|
-
}`}
|
|
233
|
-
>
|
|
234
|
-
{selectable && (
|
|
235
|
-
<td className={`${TdClasses} py-2 px-4`}>
|
|
236
|
-
<Checkbox
|
|
237
|
-
onChange={(e) => handleSelectRow(index, e)}
|
|
238
|
-
checked={isRowChecked}
|
|
239
|
-
disabled={isRowDisabled}
|
|
240
|
-
id={`checkboxRow${index}${tableId}`}
|
|
241
|
-
/>
|
|
242
|
-
</td>
|
|
243
|
-
)}
|
|
244
|
-
{row.cells.map((cell) => {
|
|
245
|
-
const { key, ...restCellProps } = cell.getCellProps()
|
|
246
|
-
const column = cell.column as { [key: string]: any }
|
|
247
|
-
const textAlign: TextAlignProp = column.textAlign || 'left'
|
|
248
|
-
return (
|
|
249
|
-
<td
|
|
250
|
-
key={key}
|
|
251
|
-
{...restCellProps}
|
|
252
|
-
className={`${TdClasses} ${textAligns[textAlign]}`}
|
|
253
|
-
>
|
|
254
|
-
{cell.render('Cell', {
|
|
255
|
-
cellWrapperProps: cell.row.original.cellWrapperProps,
|
|
256
|
-
})}
|
|
257
|
-
</td>
|
|
258
|
-
)
|
|
259
|
-
})}
|
|
260
|
-
</tr>
|
|
261
|
-
)
|
|
262
|
-
})
|
|
263
|
-
)}
|
|
264
|
-
</tbody>
|
|
265
|
-
</table>
|
|
266
|
-
</div>
|
|
267
|
-
)
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export const Table = React.memo(TableComponent)
|
|
271
|
-
|
|
272
|
-
type CellWrapperProp = React.ComponentClass<any> | React.FunctionComponent<any>
|
|
273
|
-
type TextAlignProp = 'left' | 'right' | 'center'
|
|
274
|
-
type TableRowProp = {
|
|
275
|
-
/**
|
|
276
|
-
* Cell content. `Key` must be equal to `columns.id` value
|
|
277
|
-
*/
|
|
278
|
-
[key: string]: unknown
|
|
279
|
-
/**
|
|
280
|
-
* Props to `columns.cellWrapper` component. Usually an `href` or related
|
|
281
|
-
*/
|
|
282
|
-
cellWrapperProps?: { [key: string]: unknown }
|
|
283
|
-
}
|
|
284
|
-
export interface TableProps {
|
|
285
|
-
/**
|
|
286
|
-
* Columns of the Table
|
|
287
|
-
*/
|
|
288
|
-
columns: {
|
|
289
|
-
/**
|
|
290
|
-
* ID of the column
|
|
291
|
-
*/
|
|
292
|
-
id: string
|
|
293
|
-
/**
|
|
294
|
-
* Label of the column. Can be an String or Component
|
|
295
|
-
*/
|
|
296
|
-
label: string | React.ReactNode
|
|
297
|
-
/**
|
|
298
|
-
* Size of the column
|
|
299
|
-
*/
|
|
300
|
-
size?: string
|
|
301
|
-
/**
|
|
302
|
-
* Component to wrap a cell. Usually an <a> or related. Props of each cell are placed at `rows.cellWrapperProps`
|
|
303
|
-
*/
|
|
304
|
-
cellWrapper?: CellWrapperProp
|
|
305
|
-
/**
|
|
306
|
-
* Text align of the column
|
|
307
|
-
*/
|
|
308
|
-
textAlign?: TextAlignProp
|
|
309
|
-
}[]
|
|
310
|
-
/**
|
|
311
|
-
* Rows of the table
|
|
312
|
-
*/
|
|
313
|
-
rows: TableRowProp[]
|
|
314
|
-
/** Table is loading
|
|
315
|
-
* @default false
|
|
316
|
-
*/
|
|
317
|
-
isLoading?: boolean
|
|
318
|
-
/** Content to show when table is empty
|
|
319
|
-
* @default 'Nenhum registro encontrado'
|
|
320
|
-
*/
|
|
321
|
-
emptyText?: string | React.ReactNode
|
|
322
|
-
/**
|
|
323
|
-
* Makes rows selectable.
|
|
324
|
-
* @default false
|
|
325
|
-
*/
|
|
326
|
-
selectable?: boolean
|
|
327
|
-
/**
|
|
328
|
-
* Fired when the row is selectable and the Checkbox of the header/row is clicked
|
|
329
|
-
*/
|
|
330
|
-
onChange?: (selectedRows: Row<TableRowProp>[]) => void
|
|
331
|
-
/**
|
|
332
|
-
* Array containing the index of selected rows.
|
|
333
|
-
* @default undefined
|
|
334
|
-
*/
|
|
335
|
-
selectedData?: number[]
|
|
336
|
-
/**
|
|
337
|
-
* Array containing the index of disabled rows.
|
|
338
|
-
* @default []
|
|
339
|
-
*/
|
|
340
|
-
disabledRows?: number[]
|
|
341
|
-
/**
|
|
342
|
-
* Id of the table.
|
|
343
|
-
* @default undefined
|
|
344
|
-
*/
|
|
345
|
-
id?: string
|
|
346
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Table'
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { composeStories } from "@storybook/testing-react"
|
|
3
|
-
import { mount } from "@cypress/react"
|
|
4
|
-
import * as stories from "./TableList.stories"
|
|
5
|
-
const specTitle = require('cypress-sonarqube-reporter/specTitle');
|
|
6
|
-
|
|
7
|
-
const { Default, WithLoading, WithEmpty, WithLink } = composeStories(stories)
|
|
8
|
-
|
|
9
|
-
describe(specTitle('TableListItem tests'), () => {
|
|
10
|
-
|
|
11
|
-
it('Default', () => {
|
|
12
|
-
mount(<Default />)
|
|
13
|
-
cy.get('.table-list')
|
|
14
|
-
.should('exist')
|
|
15
|
-
.find('.table-list-group')
|
|
16
|
-
.should('have.length', 6)
|
|
17
|
-
|
|
18
|
-
cy.get('.table-list .table-list-group')
|
|
19
|
-
.first()
|
|
20
|
-
.find('.table-list-title')
|
|
21
|
-
.should('have.class', 'relative lg:hidden')
|
|
22
|
-
.contains('11 de abril')
|
|
23
|
-
|
|
24
|
-
cy.get('.table-list .table-list-group')
|
|
25
|
-
.first()
|
|
26
|
-
.find('.group-items .table-item')
|
|
27
|
-
.should('have.length', 6)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('WithLoading', () => {
|
|
31
|
-
mount(<WithLoading />)
|
|
32
|
-
cy.get('.table-list .table-list-loading')
|
|
33
|
-
.should('exist')
|
|
34
|
-
.find('.table-item-loading')
|
|
35
|
-
.should('have.length', 4)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('WithEmpty', () => {
|
|
39
|
-
mount(<WithEmpty />)
|
|
40
|
-
cy.get('.table-list .table-list-empty')
|
|
41
|
-
.should('exist')
|
|
42
|
-
.find('.table-list-empty-illustration')
|
|
43
|
-
.should('exist')
|
|
44
|
-
.find('svg')
|
|
45
|
-
.should('exist')
|
|
46
|
-
cy.get('.table-list .table-list-empty')
|
|
47
|
-
.find('.table-list-empty-title')
|
|
48
|
-
.should('exist')
|
|
49
|
-
.contains('Você ainda não fez nenhuma venda conosco')
|
|
50
|
-
cy.get('.table-list .table-list-empty')
|
|
51
|
-
.find('.table-list-empty-subtitle')
|
|
52
|
-
.should('exist')
|
|
53
|
-
.contains('Continua firme, você consegue')
|
|
54
|
-
cy.get('.table-list .table-list-empty')
|
|
55
|
-
.find('.table-list-empty-action')
|
|
56
|
-
.should('exist')
|
|
57
|
-
.contains('Voltar')
|
|
58
|
-
|
|
59
|
-
mount(<WithEmpty empty={undefined} />)
|
|
60
|
-
cy.get('.table-list .table-list-empty')
|
|
61
|
-
.should('exist')
|
|
62
|
-
.find('.table-list-empty-illustration')
|
|
63
|
-
.should('not.exist')
|
|
64
|
-
cy.get('.table-list .table-list-empty')
|
|
65
|
-
.find('.table-list-empty-title')
|
|
66
|
-
.should('exist')
|
|
67
|
-
.contains('Nenhum registro encontrado')
|
|
68
|
-
cy.get('.table-list .table-list-empty')
|
|
69
|
-
.find('.table-list-empty-subtitle')
|
|
70
|
-
.should('not.exist')
|
|
71
|
-
cy.get('.table-list .table-list-empty')
|
|
72
|
-
.find('.table-list-empty-action')
|
|
73
|
-
.should('not.exist')
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
it('WithLink', () => {
|
|
77
|
-
mount(<WithLink />)
|
|
78
|
-
cy.get('.table-list .table-item')
|
|
79
|
-
.first()
|
|
80
|
-
.find('a.table-item-wrapper')
|
|
81
|
-
.should('exist')
|
|
82
|
-
.should('have.attr', 'href', '#link')
|
|
83
|
-
.should('have.class', 'hover:bg-base-2 before:hover:block')
|
|
84
|
-
.should('have.class', 'after:hover:block')
|
|
85
|
-
})
|
|
86
|
-
})
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Story, Meta } from '@storybook/react'
|
|
3
|
-
import { withDesign } from 'storybook-addon-designs'
|
|
4
|
-
|
|
5
|
-
import { Icon } from '../../Icons'
|
|
6
|
-
import { Button } from '../Button'
|
|
7
|
-
import { TableList, TableListProps } from './TableList'
|
|
8
|
-
|
|
9
|
-
const exampleItems = [
|
|
10
|
-
{
|
|
11
|
-
title: 'R$ 3.599,99 cancelada',
|
|
12
|
-
description: '#JZW55MBEIX - QA Loja Integrada via pix',
|
|
13
|
-
timestampTime: '11:18',
|
|
14
|
-
timestampDate: '11 de abril',
|
|
15
|
-
itemWrapperProps: { href: '#link' },
|
|
16
|
-
withIcon: { class: 'bg-danger-light text-danger-dark', icon: 'close', tooltip: {placement: 'right', message: 'I am a tooltip!'} }
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
title: 'R$ 3.599,99 cancelada',
|
|
20
|
-
description: '#P0UYL7PWBF - QA Loja Integrada via pix',
|
|
21
|
-
timestampTime: '05:38',
|
|
22
|
-
timestampDate: '11 de abril',
|
|
23
|
-
itemWrapperProps: { href: '#link' },
|
|
24
|
-
withIcon: { class: 'bg-danger-light text-danger-dark', icon: 'close' }
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
title: 'R$ 12,00 incompleta',
|
|
28
|
-
description: '#67JYUCMTR1',
|
|
29
|
-
timestampTime: '05:37',
|
|
30
|
-
timestampDate: '11 de abril',
|
|
31
|
-
itemWrapperProps: { href: '#link' },
|
|
32
|
-
withIcon: { class: 'bg-primary-light text-inverted-2', icon: 'clock' }
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
title: 'R$ 0,50 cancelada',
|
|
36
|
-
description: '#JTRM6NBP41 - QA Store 1 via pix',
|
|
37
|
-
timestampTime: '05:36',
|
|
38
|
-
timestampDate: '11 de abril',
|
|
39
|
-
itemWrapperProps: { href: '#link' },
|
|
40
|
-
withIcon: { class: 'bg-danger-light text-danger-dark', icon: 'close' }
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
title: 'R$ 0,01 incompleta',
|
|
44
|
-
description: '#39YDAHYA1F',
|
|
45
|
-
timestampTime: '05:35',
|
|
46
|
-
timestampDate: '11 de abril',
|
|
47
|
-
itemWrapperProps: { href: '#link' },
|
|
48
|
-
withIcon: { class: 'bg-primary-light text-inverted-2', icon: 'clock' }
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
title: 'R$ 12,00 incompleta',
|
|
52
|
-
description: '#ZPN7P3BZI3',
|
|
53
|
-
timestampTime: '05:33',
|
|
54
|
-
timestampDate: '11 de abril',
|
|
55
|
-
itemWrapperProps: { href: '#link' },
|
|
56
|
-
withIcon: { class: 'bg-primary-light text-inverted-2', icon: 'clock' }
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
title: 'R$ 229,05 aprovada',
|
|
60
|
-
description: '#0XGQZQ164P - QA Loja Integrada via boleto',
|
|
61
|
-
timestampTime: '15:40',
|
|
62
|
-
timestampDate: '07 de abril',
|
|
63
|
-
itemWrapperProps: { href: '#link' },
|
|
64
|
-
withIcon: { class: 'bg-success-light text-success-dark', icon: 'check' }
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
title: 'R$ 232,56 devolvida',
|
|
68
|
-
description: '#V1KZRJS49J - QA Loja Integrada via credit_card',
|
|
69
|
-
timestampTime: '05:46',
|
|
70
|
-
timestampDate: '05 de abril',
|
|
71
|
-
itemWrapperProps: { href: '#link' },
|
|
72
|
-
withIcon: { class: 'bg-[#E7DDF3] text-inverted-1', icon: 'back' }
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
title: 'R$ 2.666,79 devolvida parcialmente',
|
|
76
|
-
description: '#RB3JJLLKV9 - QA Loja Integrada via credit_card',
|
|
77
|
-
timestampTime: '13:46',
|
|
78
|
-
timestampDate: '04 de abril',
|
|
79
|
-
itemWrapperProps: { href: '#link' },
|
|
80
|
-
withIcon: { class: 'bg-[#E7DDF3] text-inverted-1', icon: 'halfBack' }
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
title: 'R$ 144,00 criada',
|
|
84
|
-
description: '#FLGXE26Q62 - Joazinho do Teste via credit_card',
|
|
85
|
-
timestampTime: '14:59',
|
|
86
|
-
timestampDate: '29 de março',
|
|
87
|
-
itemWrapperProps: { href: '#link' },
|
|
88
|
-
withIcon: { class: 'bg-primary-light text-inverted-2', icon: 'clock' }
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
title: 'R$ 311,64 criada',
|
|
92
|
-
description: '#1RS5OPTW34 - Joazinho do Teste via credit_card',
|
|
93
|
-
timestampTime: '14:23',
|
|
94
|
-
timestampDate: '29 de março',
|
|
95
|
-
itemWrapperProps: { href: '#link' },
|
|
96
|
-
withIcon: { class: 'bg-primary-light text-inverted-2', icon: 'clock' }
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
title: 'R$ 360,00 cancelada',
|
|
100
|
-
description: '#D4RHATKP9E',
|
|
101
|
-
timestampTime: '16:10',
|
|
102
|
-
timestampDate: '24 de março',
|
|
103
|
-
itemWrapperProps: { href: '#link' },
|
|
104
|
-
withIcon: { class: 'bg-danger-light text-danger-dark', icon: 'close' }
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
title: 'R$ 350,56 cancelada',
|
|
108
|
-
description: '#4UZDIZJCNS',
|
|
109
|
-
timestampTime: '16:05',
|
|
110
|
-
timestampDate: '24 de março',
|
|
111
|
-
itemWrapperProps: { href: '#link' },
|
|
112
|
-
withIcon: { class: 'bg-danger-light text-danger-dark', icon: 'close' }
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
title: 'R$ 23,30 cancelada',
|
|
116
|
-
description: '#WNLVZQDREA',
|
|
117
|
-
timestampTime: '16:04',
|
|
118
|
-
timestampDate: '24 de março',
|
|
119
|
-
itemWrapperProps: { href: '#link' },
|
|
120
|
-
withIcon: { class: 'bg-danger-light text-danger-dark', icon: 'close' }
|
|
121
|
-
},
|
|
122
|
-
]
|
|
123
|
-
|
|
124
|
-
export default {
|
|
125
|
-
title: 'Components/TableList',
|
|
126
|
-
component: TableList,
|
|
127
|
-
decorators: [withDesign],
|
|
128
|
-
parameters: {
|
|
129
|
-
layout: 'padded',
|
|
130
|
-
},
|
|
131
|
-
args: {
|
|
132
|
-
items: exampleItems,
|
|
133
|
-
},
|
|
134
|
-
} as Meta
|
|
135
|
-
|
|
136
|
-
const Template: Story<TableListProps> = (args) => <TableList {...args} />
|
|
137
|
-
|
|
138
|
-
export const Default = Template.bind({})
|
|
139
|
-
|
|
140
|
-
export const WithLoading = Template.bind({})
|
|
141
|
-
WithLoading.args = {
|
|
142
|
-
isLoading: true,
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export const WithEmpty = Template.bind({})
|
|
146
|
-
WithEmpty.args = {
|
|
147
|
-
items: [],
|
|
148
|
-
empty: {
|
|
149
|
-
title: 'Poxa, que pena! Você ainda não fez nenhuma venda conosco.',
|
|
150
|
-
illustration: <Icon icon="ban" size={9} className="text-primary" />,
|
|
151
|
-
subTitle: 'Mas fica tranquilo que quando você começar a vender, suas transações aparecerão aqui. Continua firme, você consegue!',
|
|
152
|
-
action: <Button variant="secondary">Voltar</Button>
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const CellLink = (props: any) => {
|
|
157
|
-
const { href = '/', children, ...restProps } = props
|
|
158
|
-
return (
|
|
159
|
-
<a href={href} {...restProps}>{children}</a>
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export const WithLink = Template.bind({})
|
|
164
|
-
WithLink.args = {
|
|
165
|
-
withHover: true,
|
|
166
|
-
isInsideContainer: true,
|
|
167
|
-
itemWrapper: CellLink,
|
|
168
|
-
}
|