@saleor/macaw-ui 0.5.2 → 0.6.2
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/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +3 -3
- package/dist/types/CircleIndicator/CircleIndicator.d.ts +2 -0
- package/dist/types/Indicator/Circle.d.ts +5 -0
- package/dist/types/Indicator/CircleFilled.d.ts +8 -0
- package/dist/types/Indicator/CircleOutline.d.ts +8 -0
- package/dist/types/Indicator/Indicator.d.ts +14 -0
- package/dist/types/Indicator/Indicator.stories.d.ts +11 -0
- package/dist/types/Indicator/IndicatorCircle.d.ts +7 -0
- package/dist/types/Indicator/IndicatorCircle.stories.d.ts +7 -0
- package/dist/types/Indicator/IndicatorOutlined.d.ts +9 -0
- package/dist/types/Indicator/IndicatorOutlined.stories.d.ts +18 -0
- package/dist/types/Indicator/index.d.ts +3 -0
- package/dist/types/Indicator/styles.d.ts +5 -0
- package/dist/types/Pagination/Pagination.d.ts +5 -2
- package/dist/types/Pagination/PaginationActions.d.ts +16 -5
- package/dist/types/Tooltip/Arrow.d.ts +11 -0
- package/dist/types/Tooltip/Tooltip.d.ts +17 -3
- package/dist/types/Tooltip/Tooltip.stories.d.ts +7 -5
- package/dist/types/Tooltip/TooltipMountWrapper.d.ts +8 -0
- package/dist/types/Tooltip/index.d.ts +1 -0
- package/dist/types/Tooltip/styles.d.ts +10 -1
- package/dist/types/icons/20x20/BackSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/BookmarksSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/CheckboxSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/ChevronSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/CloseSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/DragSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/FilterSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/MinusSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/MoreSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/NextSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/PlusSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/SearchSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/SortBigSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/SortSmallSmallIcon.d.ts +10 -0
- package/dist/types/icons/20x20/index.d.ts +14 -0
- package/dist/types/icons/24x24/AddEnvironmentIcon.d.ts +10 -0
- package/dist/types/icons/24x24/AppsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ArrowRightIcon.d.ts +10 -0
- package/dist/types/icons/24x24/BackspaceIcon.d.ts +10 -0
- package/dist/types/icons/24x24/BagIcon.d.ts +10 -0
- package/dist/types/icons/24x24/BillingIcon.d.ts +10 -0
- package/dist/types/icons/24x24/BookmarkIcon.d.ts +10 -0
- package/dist/types/icons/24x24/CalendarIcon.d.ts +10 -0
- package/dist/types/icons/24x24/CheckIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ChevronIcon.d.ts +10 -0
- package/dist/types/icons/24x24/Close2Icon.d.ts +10 -0
- package/dist/types/icons/24x24/CloseIcon.d.ts +10 -0
- package/dist/types/icons/24x24/CodeIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ColumnsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/CopyIcon.d.ts +10 -0
- package/dist/types/icons/24x24/CustomersIcon.d.ts +10 -0
- package/dist/types/icons/24x24/DashboardIcon.d.ts +10 -0
- package/dist/types/icons/24x24/DeleteIcon.d.ts +10 -0
- package/dist/types/icons/24x24/DeveloperIcon.d.ts +10 -0
- package/dist/types/icons/24x24/DiscountsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/DownloadIcon.d.ts +10 -0
- package/dist/types/icons/24x24/DragIcon.d.ts +10 -0
- package/dist/types/icons/24x24/EditIcon.d.ts +10 -0
- package/dist/types/icons/24x24/EnvironmentIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ExpandIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ExpendableIcon.d.ts +10 -0
- package/dist/types/icons/24x24/EyeClosedIcon.d.ts +10 -0
- package/dist/types/icons/24x24/EyeIcon.d.ts +10 -0
- package/dist/types/icons/24x24/FilteringIcon.d.ts +10 -0
- package/dist/types/icons/24x24/GenerateIcon.d.ts +10 -0
- package/dist/types/icons/24x24/GithubIcon.d.ts +10 -0
- package/dist/types/icons/24x24/GridIcon.d.ts +10 -0
- package/dist/types/icons/24x24/HelpIcon.d.ts +10 -0
- package/dist/types/icons/24x24/HowToIcon.d.ts +10 -0
- package/dist/types/icons/24x24/LinkIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ListIcon.d.ts +10 -0
- package/dist/types/icons/24x24/MailIcon.d.ts +10 -0
- package/dist/types/icons/24x24/MigrateIcon.d.ts +10 -0
- package/dist/types/icons/24x24/MinusIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ModelsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/MoreHorizontalIcon.d.ts +10 -0
- package/dist/types/icons/24x24/NavigationIcon.d.ts +10 -0
- package/dist/types/icons/24x24/NavigatorIcon.d.ts +10 -0
- package/dist/types/icons/24x24/NextIcon.d.ts +10 -0
- package/dist/types/icons/24x24/NoConnectionIcon.d.ts +10 -0
- package/dist/types/icons/24x24/NotificationsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/OrdersIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PagesIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PermissionsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PhotoIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PlayIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PlusIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PresetIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PreviousIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PrinterIcon.d.ts +10 -0
- package/dist/types/icons/24x24/PrivacyIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ProcessIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ProductIcon.d.ts +10 -0
- package/dist/types/icons/24x24/RefreshIcon.d.ts +10 -0
- package/dist/types/icons/24x24/RemoveMemberIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ReplyIcon.d.ts +10 -0
- package/dist/types/icons/24x24/SearchIcon.d.ts +10 -0
- package/dist/types/icons/24x24/SettingsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/SnapshotsIcon.d.ts +10 -0
- package/dist/types/icons/24x24/SortDownIcon.d.ts +10 -0
- package/dist/types/icons/24x24/SortUpIcon.d.ts +10 -0
- package/dist/types/icons/24x24/TasksIcon.d.ts +10 -0
- package/dist/types/icons/24x24/TimeIcon.d.ts +10 -0
- package/dist/types/icons/24x24/ToIcon.d.ts +10 -0
- package/dist/types/icons/24x24/TransferIcon.d.ts +10 -0
- package/dist/types/icons/24x24/TranslateIcon.d.ts +10 -0
- package/dist/types/icons/24x24/TranslationIcon.d.ts +10 -0
- package/dist/types/icons/24x24/WebsiteIcon.d.ts +10 -0
- package/dist/types/icons/24x24/WifiIcon.d.ts +10 -0
- package/dist/types/icons/24x24/index.d.ts +74 -0
- package/dist/types/icons/32x32/AttributesLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/CustomerLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/DigitalLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/DiscountLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/FilteringLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/GiftCardLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/NavigationLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/NotesLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/OmnichannelLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/PermissionLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/ProductLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/SearchLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/ShippingLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/SiteSettingsLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/StaffMembersLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/TaxesLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/TokenLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/WarehouseLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/WifiLargeIcon.d.ts +10 -0
- package/dist/types/icons/32x32/index.d.ts +19 -0
- package/dist/types/icons/index.d.ts +9 -67
- package/dist/types/icons/indicator/index.d.ts +2 -0
- package/dist/types/icons/indicator/regular/ErrorIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/regular/FailIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/regular/FailOutlineIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/regular/HelpIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/regular/SuccessIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/regular/WarningIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/regular/index.d.ts +6 -0
- package/dist/types/icons/indicator/small/ErrorSmallIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/small/SuccessSmallIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/small/WarningSmallIndicatorIcon.d.ts +2 -0
- package/dist/types/icons/indicator/small/index.d.ts +3 -0
- package/dist/types/icons/styles.d.ts +1 -0
- package/dist/types/icons/types.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/mergeRefs.d.ts +1 -1
- package/package.json +21 -8
- package/src/CircleIndicator/CircleIndicator.tsx +2 -0
- package/src/Filter/FilterField/MultipleValueAutocompleteFilterField.tsx +42 -41
- package/src/Indicator/Circle.tsx +17 -0
- package/src/Indicator/CircleFilled.tsx +16 -0
- package/src/Indicator/CircleOutline.tsx +34 -0
- package/src/Indicator/Indicator.stories.tsx +49 -0
- package/src/Indicator/Indicator.tsx +65 -0
- package/src/Indicator/IndicatorCircle.stories.tsx +28 -0
- package/src/Indicator/IndicatorCircle.tsx +45 -0
- package/src/Indicator/IndicatorOutlined.stories.tsx +86 -0
- package/src/Indicator/IndicatorOutlined.tsx +63 -0
- package/src/Indicator/index.ts +3 -0
- package/src/Indicator/styles.ts +61 -0
- package/src/MultipleValueAutocomplete/MultipleValueAutocomplete.tsx +134 -133
- package/src/Pagination/Pagination.tsx +6 -4
- package/src/Pagination/PaginationActions.tsx +16 -9
- package/src/Pagination/PaginationRowNumberSelect.tsx +35 -34
- package/src/Tooltip/Arrow.tsx +54 -0
- package/src/Tooltip/Tooltip.stories.tsx +71 -8
- package/src/Tooltip/Tooltip.tsx +156 -15
- package/src/Tooltip/TooltipMountWrapper.tsx +25 -0
- package/src/Tooltip/index.ts +1 -0
- package/src/Tooltip/styles.ts +133 -9
- package/src/assets/icons/20x20/back_small_icon.svg +1 -0
- package/src/assets/icons/20x20/bookmarks_small_icon.svg +1 -0
- package/src/assets/icons/20x20/checkbox_small_icon.svg +1 -0
- package/src/assets/icons/20x20/chevron_small_icon.svg +1 -0
- package/src/assets/icons/20x20/close_small_icon.svg +1 -0
- package/src/assets/icons/20x20/drag_small_icon.svg +1 -0
- package/src/assets/icons/20x20/filter_small_icon.svg +1 -0
- package/src/assets/icons/20x20/minus_small_icon.svg +1 -0
- package/src/assets/icons/20x20/more_small_icon.svg +1 -0
- package/src/assets/icons/20x20/next_small_icon.svg +1 -0
- package/src/assets/icons/20x20/plus_small_icon.svg +1 -0
- package/src/assets/icons/20x20/search_small_icon.svg +1 -0
- package/src/assets/icons/20x20/sort_big_small_icon.svg +1 -0
- package/src/assets/icons/20x20/sort_small_small_icon.svg +1 -0
- package/src/assets/icons/24x24/add_environment_icon.svg +1 -0
- package/src/assets/icons/24x24/apps_icon.svg +1 -0
- package/src/assets/icons/24x24/arrow_right_icon.svg +1 -0
- package/src/assets/icons/24x24/backspace_icon.svg +1 -0
- package/src/assets/icons/24x24/bag_icon.svg +1 -0
- package/src/assets/icons/24x24/billing_icon.svg +1 -0
- package/src/assets/icons/24x24/bookmark_icon.svg +1 -0
- package/src/assets/icons/24x24/calendar_icon.svg +1 -0
- package/src/assets/icons/24x24/check_icon.svg +1 -0
- package/src/assets/icons/24x24/chevron_icon.svg +1 -0
- package/src/assets/icons/24x24/close_2_icon.svg +1 -0
- package/src/assets/icons/24x24/close_icon.svg +1 -0
- package/src/assets/icons/24x24/code_icon.svg +1 -0
- package/src/assets/icons/24x24/columns_icon.svg +1 -0
- package/src/assets/icons/24x24/copy_icon.svg +1 -0
- package/src/assets/icons/24x24/customers_icon.svg +1 -0
- package/src/assets/icons/24x24/dashboard_icon.svg +1 -0
- package/src/assets/icons/24x24/delete_icon.svg +1 -0
- package/src/assets/icons/24x24/developer_icon.svg +1 -0
- package/src/assets/icons/24x24/discounts_icon.svg +1 -0
- package/src/assets/icons/24x24/download_icon.svg +1 -0
- package/src/assets/icons/24x24/drag_icon.svg +1 -0
- package/src/assets/icons/24x24/edit_icon.svg +1 -0
- package/src/assets/icons/24x24/environment_icon.svg +1 -0
- package/src/assets/icons/24x24/expand_icon.svg +1 -0
- package/src/assets/icons/24x24/expendable_icon.svg +1 -0
- package/src/assets/icons/24x24/eye_closed_icon.svg +1 -0
- package/src/assets/icons/24x24/eye_icon.svg +1 -0
- package/src/assets/icons/24x24/filtering_icon.svg +1 -0
- package/src/assets/icons/24x24/generate_icon.svg +1 -0
- package/src/assets/icons/24x24/github_icon.svg +1 -0
- package/src/assets/icons/24x24/grid_icon.svg +1 -0
- package/src/assets/icons/24x24/help_icon.svg +1 -0
- package/src/assets/icons/24x24/how to_icon.svg +1 -0
- package/src/assets/icons/24x24/link_icon.svg +1 -0
- package/src/assets/icons/24x24/list_icon.svg +1 -0
- package/src/assets/icons/24x24/mail_icon.svg +1 -0
- package/src/assets/icons/24x24/migrate_icon.svg +1 -0
- package/src/assets/icons/24x24/minus_icon.svg +1 -0
- package/src/assets/icons/24x24/models_icon.svg +1 -0
- package/src/assets/icons/24x24/more_horizontal_icon.svg +1 -0
- package/src/assets/icons/24x24/navigation_icon.svg +1 -0
- package/src/assets/icons/24x24/navigator_icon.svg +1 -0
- package/src/assets/icons/24x24/next_icon.svg +1 -0
- package/src/assets/icons/24x24/no_connection_icon.svg +1 -0
- package/src/assets/icons/24x24/notifications_icon.svg +1 -0
- package/src/assets/icons/24x24/orders_icon.svg +1 -0
- package/src/assets/icons/24x24/pages_icon.svg +1 -0
- package/src/assets/icons/24x24/permissions_icon.svg +1 -0
- package/src/assets/icons/24x24/photo_icon.svg +1 -0
- package/src/assets/icons/24x24/play_icon.svg +1 -0
- package/src/assets/icons/24x24/plus_icon.svg +1 -0
- package/src/assets/icons/24x24/preset_icon.svg +1 -0
- package/src/assets/icons/24x24/previous_icon.svg +1 -0
- package/src/assets/icons/24x24/printer_icon.svg +1 -0
- package/src/assets/icons/24x24/privacy_icon.svg +1 -0
- package/src/assets/icons/24x24/process_icon.svg +1 -0
- package/src/assets/icons/24x24/product_icon.svg +1 -0
- package/src/assets/icons/24x24/refresh_icon.svg +1 -0
- package/src/assets/icons/24x24/remove_member_icon.svg +1 -0
- package/src/assets/icons/24x24/reply_icon.svg +1 -0
- package/src/assets/icons/24x24/search_icon.svg +1 -0
- package/src/assets/icons/24x24/settings_icon.svg +1 -0
- package/src/assets/icons/24x24/snapshots_icon.svg +1 -0
- package/src/assets/icons/24x24/sort_down_icon.svg +1 -0
- package/src/assets/icons/24x24/sort_up_icon.svg +1 -0
- package/src/assets/icons/24x24/tasks_icon.svg +1 -0
- package/src/assets/icons/24x24/time_icon.svg +1 -0
- package/src/assets/icons/24x24/to_icon.svg +1 -0
- package/src/assets/icons/24x24/transfer_icon.svg +1 -0
- package/src/assets/icons/24x24/translate_icon.svg +1 -0
- package/src/assets/icons/24x24/translation_icon.svg +1 -0
- package/src/assets/icons/24x24/website_icon.svg +1 -0
- package/src/assets/icons/24x24/wifi_icon.svg +1 -0
- package/src/assets/icons/32x32/attributes_large_icon.svg +1 -0
- package/src/assets/icons/32x32/customer_large_icon.svg +1 -0
- package/src/assets/icons/32x32/digital_large_icon.svg +1 -0
- package/src/assets/icons/32x32/discount_large_icon.svg +1 -0
- package/src/assets/icons/32x32/filtering_large_icon.svg +1 -0
- package/src/assets/icons/32x32/gift card_large_icon.svg +1 -0
- package/src/assets/icons/32x32/navigation_large_icon.svg +1 -0
- package/src/assets/icons/32x32/notes_large_icon.svg +1 -0
- package/src/assets/icons/32x32/omnichannel_large_icon.svg +1 -0
- package/src/assets/icons/32x32/permission_large_icon.svg +1 -0
- package/src/assets/icons/32x32/product_large_icon.svg +1 -0
- package/src/assets/icons/32x32/search_large_icon.svg +1 -0
- package/src/assets/icons/32x32/shipping_large_icon.svg +1 -0
- package/src/assets/icons/32x32/site settings_large_icon.svg +1 -0
- package/src/assets/icons/32x32/staff members_large_icon.svg +1 -0
- package/src/assets/icons/32x32/taxes_large_icon.svg +1 -0
- package/src/assets/icons/32x32/token_large_icon.svg +1 -0
- package/src/assets/icons/32x32/warehouse_large_icon.svg +1 -0
- package/src/assets/icons/32x32/wifi_large_icon.svg +1 -0
- package/src/assets/icons/indicator/regular/error_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/regular/fail_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/regular/fail_outline_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/regular/help_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/regular/success_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/regular/warning_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/small/error_small_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/small/success_small_indicator_icon.svg +1 -0
- package/src/assets/icons/indicator/small/warning_small_indicator_icon.svg +1 -0
- package/src/icons/20x20/BackSmallIcon.tsx +32 -0
- package/src/icons/20x20/BookmarksSmallIcon.tsx +29 -0
- package/src/icons/20x20/CheckboxSmallIcon.tsx +32 -0
- package/src/icons/20x20/ChevronSmallIcon.tsx +32 -0
- package/src/icons/20x20/CloseSmallIcon.tsx +31 -0
- package/src/icons/20x20/DragSmallIcon.tsx +31 -0
- package/src/icons/20x20/FilterSmallIcon.tsx +31 -0
- package/src/icons/20x20/MinusSmallIcon.tsx +32 -0
- package/src/icons/20x20/MoreSmallIcon.tsx +31 -0
- package/src/icons/20x20/NextSmallIcon.tsx +32 -0
- package/src/icons/20x20/PlusSmallIcon.tsx +32 -0
- package/src/icons/20x20/SearchSmallIcon.tsx +31 -0
- package/src/icons/20x20/SortBigSmallIcon.tsx +31 -0
- package/src/icons/20x20/SortSmallSmallIcon.tsx +31 -0
- package/src/icons/20x20/index.ts +14 -0
- package/src/icons/24x24/AddEnvironmentIcon.tsx +32 -0
- package/src/icons/24x24/AppsIcon.tsx +31 -0
- package/src/icons/24x24/ArrowRightIcon.tsx +32 -0
- package/src/icons/24x24/BackspaceIcon.tsx +32 -0
- package/src/icons/24x24/BagIcon.tsx +29 -0
- package/src/icons/24x24/BillingIcon.tsx +32 -0
- package/src/icons/24x24/BookmarkIcon.tsx +29 -0
- package/src/icons/24x24/CalendarIcon.tsx +32 -0
- package/src/icons/24x24/CheckIcon.tsx +32 -0
- package/src/icons/24x24/ChevronIcon.tsx +32 -0
- package/src/icons/24x24/Close2Icon.tsx +39 -0
- package/src/icons/24x24/CloseIcon.tsx +31 -0
- package/src/icons/24x24/CodeIcon.tsx +38 -0
- package/src/icons/24x24/ColumnsIcon.tsx +30 -0
- package/src/icons/24x24/CopyIcon.tsx +39 -0
- package/src/icons/24x24/CustomersIcon.tsx +33 -0
- package/src/icons/24x24/DashboardIcon.tsx +30 -0
- package/src/icons/24x24/DeleteIcon.tsx +32 -0
- package/src/icons/24x24/DeveloperIcon.tsx +44 -0
- package/src/icons/24x24/DiscountsIcon.tsx +31 -0
- package/src/icons/24x24/DownloadIcon.tsx +32 -0
- package/src/icons/24x24/DragIcon.tsx +31 -0
- package/src/icons/24x24/EditIcon.tsx +36 -0
- package/src/icons/24x24/EnvironmentIcon.tsx +36 -0
- package/src/icons/24x24/ExpandIcon.tsx +39 -0
- package/src/icons/24x24/ExpendableIcon.tsx +34 -0
- package/src/icons/24x24/EyeClosedIcon.tsx +30 -0
- package/src/icons/24x24/EyeIcon.tsx +31 -0
- package/src/icons/24x24/FilteringIcon.tsx +32 -0
- package/src/icons/24x24/GenerateIcon.tsx +32 -0
- package/src/icons/24x24/GithubIcon.tsx +40 -0
- package/src/icons/24x24/GridIcon.tsx +61 -0
- package/src/icons/24x24/HelpIcon.tsx +35 -0
- package/src/icons/24x24/HowToIcon.tsx +39 -0
- package/src/icons/24x24/LinkIcon.tsx +32 -0
- package/src/icons/24x24/ListIcon.tsx +34 -0
- package/src/icons/24x24/MailIcon.tsx +31 -0
- package/src/icons/24x24/MigrateIcon.tsx +36 -0
- package/src/icons/24x24/MinusIcon.tsx +32 -0
- package/src/icons/24x24/ModelsIcon.tsx +38 -0
- package/src/icons/24x24/MoreHorizontalIcon.tsx +31 -0
- package/src/icons/24x24/NavigationIcon.tsx +31 -0
- package/src/icons/24x24/NavigatorIcon.tsx +32 -0
- package/src/icons/24x24/NextIcon.tsx +32 -0
- package/src/icons/24x24/NoConnectionIcon.tsx +36 -0
- package/src/icons/24x24/NotificationsIcon.tsx +32 -0
- package/src/icons/24x24/OrdersIcon.tsx +36 -0
- package/src/icons/24x24/PagesIcon.tsx +32 -0
- package/src/icons/24x24/PermissionsIcon.tsx +32 -0
- package/src/icons/24x24/PhotoIcon.tsx +32 -0
- package/src/icons/24x24/PlayIcon.tsx +31 -0
- package/src/icons/24x24/PlusIcon.tsx +32 -0
- package/src/icons/24x24/PresetIcon.tsx +35 -0
- package/src/icons/24x24/PreviousIcon.tsx +32 -0
- package/src/icons/24x24/PrinterIcon.tsx +32 -0
- package/src/icons/24x24/PrivacyIcon.tsx +39 -0
- package/src/icons/24x24/ProcessIcon.tsx +73 -0
- package/src/icons/24x24/ProductIcon.tsx +32 -0
- package/src/icons/24x24/RefreshIcon.tsx +32 -0
- package/src/icons/24x24/RemoveMemberIcon.tsx +34 -0
- package/src/icons/24x24/ReplyIcon.tsx +32 -0
- package/src/icons/24x24/SearchIcon.tsx +39 -0
- package/src/icons/24x24/SettingsIcon.tsx +34 -0
- package/src/icons/24x24/SnapshotsIcon.tsx +39 -0
- package/src/icons/24x24/SortDownIcon.tsx +31 -0
- package/src/icons/24x24/SortUpIcon.tsx +31 -0
- package/src/icons/24x24/TasksIcon.tsx +32 -0
- package/src/icons/24x24/TimeIcon.tsx +39 -0
- package/src/icons/24x24/ToIcon.tsx +32 -0
- package/src/icons/24x24/TransferIcon.tsx +32 -0
- package/src/icons/24x24/TranslateIcon.tsx +32 -0
- package/src/icons/24x24/TranslationIcon.tsx +33 -0
- package/src/icons/24x24/WebsiteIcon.tsx +53 -0
- package/src/icons/24x24/WifiIcon.tsx +32 -0
- package/src/icons/24x24/index.ts +74 -0
- package/src/icons/32x32/AttributesLargeIcon.tsx +36 -0
- package/src/icons/32x32/CustomerLargeIcon.tsx +38 -0
- package/src/icons/32x32/DigitalLargeIcon.tsx +31 -0
- package/src/icons/32x32/DiscountLargeIcon.tsx +35 -0
- package/src/icons/32x32/FilteringLargeIcon.tsx +32 -0
- package/src/icons/32x32/GiftCardLargeIcon.tsx +44 -0
- package/src/icons/32x32/NavigationLargeIcon.tsx +39 -0
- package/src/icons/32x32/NotesLargeIcon.tsx +53 -0
- package/src/icons/32x32/OmnichannelLargeIcon.tsx +64 -0
- package/src/icons/32x32/PermissionLargeIcon.tsx +39 -0
- package/src/icons/32x32/ProductLargeIcon.tsx +31 -0
- package/src/icons/32x32/SearchLargeIcon.tsx +39 -0
- package/src/icons/32x32/ShippingLargeIcon.tsx +32 -0
- package/src/icons/32x32/SiteSettingsLargeIcon.tsx +32 -0
- package/src/icons/32x32/StaffMembersLargeIcon.tsx +40 -0
- package/src/icons/32x32/TaxesLargeIcon.tsx +55 -0
- package/src/icons/32x32/TokenLargeIcon.tsx +38 -0
- package/src/icons/32x32/WarehouseLargeIcon.tsx +32 -0
- package/src/icons/32x32/WifiLargeIcon.tsx +32 -0
- package/src/icons/32x32/index.ts +19 -0
- package/src/icons/index.ts +12 -67
- package/src/icons/indicator/index.ts +2 -0
- package/src/icons/indicator/regular/ErrorIndicatorIcon.tsx +24 -0
- package/src/icons/indicator/regular/FailIndicatorIcon.tsx +31 -0
- package/src/icons/indicator/regular/FailOutlineIndicatorIcon.tsx +31 -0
- package/src/icons/indicator/regular/HelpIndicatorIcon.tsx +30 -0
- package/src/icons/indicator/regular/SuccessIndicatorIcon.tsx +24 -0
- package/src/icons/indicator/regular/WarningIndicatorIcon.tsx +23 -0
- package/src/icons/indicator/regular/index.ts +6 -0
- package/src/icons/indicator/small/ErrorSmallIndicatorIcon.tsx +24 -0
- package/src/icons/indicator/small/SuccessSmallIndicatorIcon.tsx +24 -0
- package/src/icons/indicator/small/WarningSmallIndicatorIcon.tsx +23 -0
- package/src/icons/indicator/small/index.ts +3 -0
- package/src/icons/styles.ts +10 -0
- package/src/icons/types.ts +3 -0
- package/src/index.tsx +1 -0
- package/src/utils/Decorator.tsx +1 -0
- package/src/utils/mergeRefs.ts +4 -4
- package/src/icons/AddEnvironmentIcon.tsx +0 -12
- package/src/icons/AppsIcon.tsx +0 -12
- package/src/icons/ArrowRightIcon.tsx +0 -12
- package/src/icons/AttributesLargeIcon.tsx +0 -15
- package/src/icons/BackspaceIcon.tsx +0 -12
- package/src/icons/BillingIcon.tsx +0 -12
- package/src/icons/CalendarIcon.tsx +0 -12
- package/src/icons/ChevronIcon.tsx +0 -14
- package/src/icons/Close2Icon.tsx +0 -12
- package/src/icons/CloseIcon.tsx +0 -12
- package/src/icons/ColumnsIcon.tsx +0 -12
- package/src/icons/CopyIcon.tsx +0 -12
- package/src/icons/CustomersIcon.tsx +0 -12
- package/src/icons/DashboardIcon.tsx +0 -12
- package/src/icons/DeleteIcon.tsx +0 -12
- package/src/icons/DeveloperIcon.tsx +0 -38
- package/src/icons/DigitalLargeIcon.tsx +0 -15
- package/src/icons/DiscountsIcon.tsx +0 -20
- package/src/icons/DiscountsLargeIcon.tsx +0 -26
- package/src/icons/DownloadIcon.tsx +0 -12
- package/src/icons/DragIcon.tsx +0 -12
- package/src/icons/EditIcon.tsx +0 -12
- package/src/icons/EnvironmentIcon.tsx +0 -12
- package/src/icons/ExpandIcon.tsx +0 -22
- package/src/icons/EyeIcon.tsx +0 -12
- package/src/icons/FilteringIcon.tsx +0 -12
- package/src/icons/FilteringLargeIcon.tsx +0 -15
- package/src/icons/HelpIcon.tsx +0 -12
- package/src/icons/LinkIcon.tsx +0 -12
- package/src/icons/MailIcon.tsx +0 -16
- package/src/icons/MinusIcon.tsx +0 -12
- package/src/icons/MoreHorizontalIcon.tsx +0 -12
- package/src/icons/NavigationIcon.tsx +0 -26
- package/src/icons/NavigationLargeIcon.tsx +0 -15
- package/src/icons/NavigatorIcon.tsx +0 -14
- package/src/icons/NextIcon.tsx +0 -14
- package/src/icons/NoConnectionIcon.tsx +0 -25
- package/src/icons/NotesLargeIcon.tsx +0 -38
- package/src/icons/NotificationsIcon.tsx +0 -12
- package/src/icons/OmnichannelLargeIcon.tsx +0 -15
- package/src/icons/OrdersIcon.tsx +0 -12
- package/src/icons/PagesIcon.tsx +0 -12
- package/src/icons/PermissionLargeIcon.tsx +0 -15
- package/src/icons/PhotoIcon.tsx +0 -12
- package/src/icons/PlusIcon.tsx +0 -12
- package/src/icons/PreviousIcon.tsx +0 -14
- package/src/icons/PrinterIcon.tsx +0 -15
- package/src/icons/PrivacyIcon.tsx +0 -15
- package/src/icons/ProductIcon.tsx +0 -12
- package/src/icons/ProductLargeIcon.tsx +0 -16
- package/src/icons/RefreshIcon.tsx +0 -14
- package/src/icons/ReplyIcon.tsx +0 -12
- package/src/icons/SearchIcon.tsx +0 -12
- package/src/icons/SettingsIcon.tsx +0 -15
- package/src/icons/ShippingLargeIcon.tsx +0 -15
- package/src/icons/SnapshotsIcon.tsx +0 -12
- package/src/icons/TaxesLargeIcon.tsx +0 -15
- package/src/icons/TimeIcon.tsx +0 -12
- package/src/icons/TokenLargeIcon.tsx +0 -17
- package/src/icons/TransferIcon.tsx +0 -22
- package/src/icons/TranslationIcon.tsx +0 -12
- package/src/icons/WarehouseLargeIcon.tsx +0 -15
- package/src/icons/WebsiteIcon.tsx +0 -22
- package/src/icons/WifiIcon.tsx +0 -23
- package/src/icons/WifiLargeIcon.tsx +0 -33
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.6.2",
|
|
3
3
|
"license": "CC-BY-4.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"start": "concurrently -n w: npm:watch-* --prefix-colors=green,blue",
|
|
35
35
|
"build": "npm run build-esb && npm run build-tsc",
|
|
36
36
|
"test": "jest",
|
|
37
|
-
"lint": "
|
|
37
|
+
"lint": "eslint \"src/**/*.@(tsx|ts|jsx|js)\" --fix ; prettier --check \"src/**/*.@(tsx|ts|jsx|js)\" --write",
|
|
38
38
|
"prepare": "npm run build",
|
|
39
39
|
"size": "size-limit",
|
|
40
40
|
"analyze": "size-limit --why",
|
|
@@ -42,6 +42,13 @@
|
|
|
42
42
|
"build-storybook": "build-storybook",
|
|
43
43
|
"release": "np",
|
|
44
44
|
"chromatic": "npx chromatic --exit-zero-on-changes --skip 'dependabot/**'",
|
|
45
|
+
"generate-icons:32": "svgr --no-dimensions --no-prettier --out-dir src/icons/32x32 -- src/assets/icons/32x32/",
|
|
46
|
+
"generate-icons:24": "svgr --no-dimensions --no-prettier --out-dir src/icons/24x24 -- src/assets/icons/24x24/",
|
|
47
|
+
"generate-icons:20": "svgr --no-dimensions --no-prettier --out-dir src/icons/20x20 -- src/assets/icons/20x20/",
|
|
48
|
+
"generate-icons:indicator": "svgr --no-dimensions --no-prettier --config-file .svgrrc-nomaterial.js --out-dir src/icons/indicator -- src/assets/icons/indicator/",
|
|
49
|
+
"generate-icons": "npm run optimise-icons && npm run generate-icons:32 && npm run generate-icons:24 && npm run generate-icons:20 && npm run generate-icons:indicator && npm run lint",
|
|
50
|
+
"optimise-icons": "svgo -r -f src/assets/icons",
|
|
51
|
+
"optimise-icons:remove-color": "svgo --config svgo-colors.config.js",
|
|
45
52
|
"generate-icon": "hygen icon new",
|
|
46
53
|
"build-icons": "node scripts/icons.js"
|
|
47
54
|
},
|
|
@@ -50,7 +57,8 @@
|
|
|
50
57
|
"@material-ui/icons": "^4.11.2",
|
|
51
58
|
"@material-ui/lab": "^4.0.0-alpha.58",
|
|
52
59
|
"react": "^16.8.0 || ^17.0.0",
|
|
53
|
-
"react-helmet": "^6.1.0"
|
|
60
|
+
"react-helmet": "^6.1.0",
|
|
61
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
54
62
|
},
|
|
55
63
|
"np": {
|
|
56
64
|
"yarn": false
|
|
@@ -72,7 +80,7 @@
|
|
|
72
80
|
"size-limit": [
|
|
73
81
|
{
|
|
74
82
|
"path": "dist/cjs/index.js",
|
|
75
|
-
"limit": "
|
|
83
|
+
"limit": "100 KB"
|
|
76
84
|
},
|
|
77
85
|
{
|
|
78
86
|
"path": "dist/esm/index.js",
|
|
@@ -86,11 +94,14 @@
|
|
|
86
94
|
"@material-ui/icons": "^4.11.2",
|
|
87
95
|
"@material-ui/lab": "^4.0.0-alpha.58",
|
|
88
96
|
"@size-limit/preset-small-lib": "^4.10.2",
|
|
97
|
+
"@storybook/addon-controls": "^6.4.22",
|
|
89
98
|
"@storybook/addon-essentials": "^6.4.22",
|
|
90
99
|
"@storybook/addon-info": "^5.3.21",
|
|
91
100
|
"@storybook/addon-links": "^6.4.22",
|
|
101
|
+
"@storybook/addon-storysource": "^6.4.22",
|
|
92
102
|
"@storybook/addons": "^6.4.22",
|
|
93
103
|
"@storybook/react": "^6.4.22",
|
|
104
|
+
"@svgr/cli": "^6.2.1",
|
|
94
105
|
"@types/fuzzaldrin": "^2.1.4",
|
|
95
106
|
"@types/jest": "^27.0.2",
|
|
96
107
|
"@types/lodash": "^4.14.170",
|
|
@@ -109,23 +120,25 @@
|
|
|
109
120
|
"eslint-plugin-simple-import-sort": "^5.0.3",
|
|
110
121
|
"eslint-plugin-storybook": "^0.5.10",
|
|
111
122
|
"faker": "^5.5.3",
|
|
112
|
-
"husky": "^7.0.0",
|
|
113
123
|
"fuzzaldrin": "^2.1.0",
|
|
124
|
+
"husky": "^7.0.0",
|
|
114
125
|
"hygen": "^6.1.0",
|
|
115
126
|
"jest": "^27.2.4",
|
|
116
127
|
"jest-file": "^1.0.0",
|
|
117
128
|
"np": "^7.5.0",
|
|
118
|
-
"
|
|
119
|
-
"react": "^
|
|
120
|
-
"
|
|
129
|
+
"react": "^17.0.0",
|
|
130
|
+
"react-dom": "^17.0.0",
|
|
131
|
+
"prettier": "^2.6.2",
|
|
121
132
|
"react-is": "^17.0.2",
|
|
122
133
|
"size-limit": "^4.10.2",
|
|
123
134
|
"storybook-dark-mode": "^1.0.9",
|
|
135
|
+
"svgo": "^2.8.0",
|
|
124
136
|
"tslib": "^2.3.1",
|
|
125
137
|
"typescript": "^4.2.4",
|
|
126
138
|
"yargs": "^17.2.1"
|
|
127
139
|
},
|
|
128
140
|
"dependencies": {
|
|
141
|
+
"@floating-ui/react-dom-interactions": "^0.5.0",
|
|
129
142
|
"clsx": "^1.1.1",
|
|
130
143
|
"downshift": "^6.1.7",
|
|
131
144
|
"lodash": "^4.17.21",
|
|
@@ -11,6 +11,8 @@ export interface CircleIndicatorProps {
|
|
|
11
11
|
color: CircleIndicatorColor;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated use IndicatorCircle component instead */
|
|
14
16
|
export const CircleIndicator: React.FC<CircleIndicatorProps> = ({ color }) => {
|
|
15
17
|
const { themeType } = useTheme();
|
|
16
18
|
const classes = useStyles();
|
|
@@ -11,50 +11,51 @@ export interface FilterContentProps {
|
|
|
11
11
|
filter: FilterData;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const MultipleValueAutocompleteFilterField: React.FC<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export const MultipleValueAutocompleteFilterField: React.FC<
|
|
15
|
+
FilterContentProps
|
|
16
|
+
> = ({ filter }) => {
|
|
17
|
+
const classes = useStyles();
|
|
18
|
+
const { onChange } = useFilters();
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const { name, options } = filter;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
if (options.choices === undefined) {
|
|
23
|
+
throw new Error("FilterType.Autocomplete must be used with choices prop");
|
|
24
|
+
}
|
|
25
|
+
if (options.onInputChange === undefined) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
"FilterType.Autocomplete must be used with onInputChange prop"
|
|
28
|
+
);
|
|
29
|
+
}
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const handleChoiceChange = (event: SyntheticChangeEvent<string[]>) =>
|
|
32
|
+
onChange(name, event.target.value);
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
return (
|
|
35
|
+
<MultipleValueAutocomplete
|
|
36
|
+
className={classes.filterValue}
|
|
37
|
+
choices={options.choices!}
|
|
38
|
+
InputProps={{
|
|
39
|
+
classes: {
|
|
40
|
+
root: classes.filterMultipleValueInputInner,
|
|
41
|
+
},
|
|
42
|
+
}}
|
|
43
|
+
onChange={handleChoiceChange}
|
|
44
|
+
onInputChange={options.onInputChange}
|
|
45
|
+
value={filter.values}
|
|
46
|
+
>
|
|
47
|
+
{({ choices: filteredChoices, getItemProps, highlightedIndex }) =>
|
|
48
|
+
filteredChoices.map((choice, choiceIndex) => (
|
|
49
|
+
<MenuItem
|
|
50
|
+
selected={highlightedIndex === choiceIndex}
|
|
51
|
+
{...getItemProps({ item: choice, index: choiceIndex })}
|
|
52
|
+
>
|
|
53
|
+
{choice.label}
|
|
54
|
+
</MenuItem>
|
|
55
|
+
))
|
|
56
|
+
}
|
|
57
|
+
</MultipleValueAutocomplete>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
59
60
|
MultipleValueAutocompleteFilterField.displayName =
|
|
60
61
|
"MultipleValueAutocompleteFilterField";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export interface CircleProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const Circle = ({ className }: CircleProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<path
|
|
10
|
+
fill-rule="evenodd"
|
|
11
|
+
clip-rule="evenodd"
|
|
12
|
+
d="M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"
|
|
13
|
+
fill="currentColor"
|
|
14
|
+
className={className}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { IndicatorProps } from "./Indicator";
|
|
4
|
+
|
|
5
|
+
interface CircleFilledProps {
|
|
6
|
+
size?: IndicatorProps["size"];
|
|
7
|
+
className: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const CircleFilled = ({ className, size }: CircleFilledProps) => {
|
|
11
|
+
if (size === "small") {
|
|
12
|
+
return <circle cx={8} cy={8} r={8} className={className} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return <circle cx={12} cy={12} r={12} className={className} />;
|
|
16
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { IndicatorProps } from "./Indicator";
|
|
4
|
+
|
|
5
|
+
interface CircleOutlineProps {
|
|
6
|
+
size: IndicatorProps["size"];
|
|
7
|
+
className: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const CircleOutline = ({ className, size }: CircleOutlineProps) => {
|
|
11
|
+
if (size === "small") {
|
|
12
|
+
return (
|
|
13
|
+
<circle
|
|
14
|
+
cx={8}
|
|
15
|
+
cy={8}
|
|
16
|
+
r={7.25}
|
|
17
|
+
strokeWidth={1.5}
|
|
18
|
+
stroke="currentColor"
|
|
19
|
+
className={className}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<circle
|
|
26
|
+
cx={12}
|
|
27
|
+
cy={12}
|
|
28
|
+
r={11.25}
|
|
29
|
+
strokeWidth={1.5}
|
|
30
|
+
stroke="currentColor"
|
|
31
|
+
className={className}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { Indicator } from "./Indicator";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Indicator / Regular",
|
|
8
|
+
component: Indicator,
|
|
9
|
+
} as ComponentMeta<typeof Indicator>;
|
|
10
|
+
|
|
11
|
+
const Template: ComponentStory<typeof Indicator> = (args) => {
|
|
12
|
+
console.log(args);
|
|
13
|
+
return <Indicator {...args} />;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Warning = Template.bind({});
|
|
17
|
+
Warning.args = {
|
|
18
|
+
icon: "warning",
|
|
19
|
+
};
|
|
20
|
+
export const WarningSmall = Template.bind({});
|
|
21
|
+
WarningSmall.args = {
|
|
22
|
+
icon: "warning",
|
|
23
|
+
size: "small",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Error = Template.bind({});
|
|
27
|
+
Error.args = {
|
|
28
|
+
icon: "error",
|
|
29
|
+
};
|
|
30
|
+
export const ErrorSmall = Template.bind({});
|
|
31
|
+
ErrorSmall.args = {
|
|
32
|
+
icon: "error",
|
|
33
|
+
size: "small",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Fail = Template.bind({});
|
|
37
|
+
Fail.args = {
|
|
38
|
+
icon: "fail",
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Success = Template.bind({});
|
|
42
|
+
Success.args = {
|
|
43
|
+
icon: "success",
|
|
44
|
+
};
|
|
45
|
+
export const SuccessSmall = Template.bind({});
|
|
46
|
+
SuccessSmall.args = {
|
|
47
|
+
icon: "success",
|
|
48
|
+
size: "small",
|
|
49
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
ErrorIndicatorIcon,
|
|
6
|
+
ErrorSmallIndicatorIcon,
|
|
7
|
+
FailIndicatorIcon,
|
|
8
|
+
SuccessIndicatorIcon,
|
|
9
|
+
SuccessSmallIndicatorIcon,
|
|
10
|
+
WarningIndicatorIcon,
|
|
11
|
+
WarningSmallIndicatorIcon,
|
|
12
|
+
} from "../icons/indicator";
|
|
13
|
+
import { CircleFilled } from "./CircleFilled";
|
|
14
|
+
import { getSizeDimension, useStyles } from "./styles";
|
|
15
|
+
|
|
16
|
+
export type IndicatorIcon = "warning" | "error" | "success" | "fail";
|
|
17
|
+
|
|
18
|
+
export type IndicatorSize = "regular" | "small";
|
|
19
|
+
|
|
20
|
+
export type IndicatorCombinations = `${IndicatorIcon}-${IndicatorSize}`;
|
|
21
|
+
|
|
22
|
+
export interface IndicatorProps {
|
|
23
|
+
icon: IndicatorIcon;
|
|
24
|
+
variant?: "outline" | "filled" | "text" | "icon";
|
|
25
|
+
size?: IndicatorSize;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const mapVariantToIcon: Record<
|
|
30
|
+
IndicatorCombinations,
|
|
31
|
+
React.FunctionComponent<{ className?: string }>
|
|
32
|
+
> = {
|
|
33
|
+
"warning-regular": WarningIndicatorIcon,
|
|
34
|
+
"warning-small": WarningSmallIndicatorIcon,
|
|
35
|
+
"fail-regular": FailIndicatorIcon,
|
|
36
|
+
"fail-small": FailIndicatorIcon,
|
|
37
|
+
"error-regular": ErrorIndicatorIcon,
|
|
38
|
+
"error-small": ErrorSmallIndicatorIcon,
|
|
39
|
+
"success-regular": SuccessIndicatorIcon,
|
|
40
|
+
"success-small": SuccessSmallIndicatorIcon,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Indicator = React.forwardRef<HTMLSpanElement, IndicatorProps>(
|
|
44
|
+
({ icon, size = "regular", className }, ref) => {
|
|
45
|
+
const classes = useStyles({ icon, size });
|
|
46
|
+
|
|
47
|
+
const Icon = mapVariantToIcon[`${icon}-${size}` as IndicatorCombinations];
|
|
48
|
+
|
|
49
|
+
const viewBoxSize = getSizeDimension(size);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<span className={clsx(classes.wrapper, className)} ref={ref}>
|
|
53
|
+
<svg
|
|
54
|
+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
|
|
55
|
+
fill="none"
|
|
56
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
+
className={classes.absolute}
|
|
58
|
+
>
|
|
59
|
+
<CircleFilled size={size} className={classes.circlePath} />
|
|
60
|
+
</svg>
|
|
61
|
+
<Icon className={classes.absolute} />
|
|
62
|
+
</span>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { IndicatorCircle } from "./IndicatorCircle";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Indicator / Circle",
|
|
8
|
+
component: IndicatorCircle,
|
|
9
|
+
} as ComponentMeta<typeof IndicatorCircle>;
|
|
10
|
+
|
|
11
|
+
const Template: ComponentStory<typeof IndicatorCircle> = (args) => (
|
|
12
|
+
<IndicatorCircle {...args} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const Warning = Template.bind({});
|
|
16
|
+
Warning.args = {
|
|
17
|
+
icon: "warning",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Error = Template.bind({});
|
|
21
|
+
Error.args = {
|
|
22
|
+
icon: "error",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Success = Template.bind({});
|
|
26
|
+
Success.args = {
|
|
27
|
+
icon: "success",
|
|
28
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { Circle } from "./Circle";
|
|
5
|
+
import { IndicatorIcon } from "./Indicator";
|
|
6
|
+
import { getSizeDimension, useStyles } from "./styles";
|
|
7
|
+
|
|
8
|
+
export interface IndicatorCircleProps {
|
|
9
|
+
icon: IndicatorIcon;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const IndicatorCircle = ({ icon, className }: IndicatorCircleProps) => {
|
|
14
|
+
const classes = useStyles({ size: "regular", icon });
|
|
15
|
+
|
|
16
|
+
const viewBoxSize = getSizeDimension("regular");
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<span className={clsx(classes.wrapper, classes.wrapperCircle, className)}>
|
|
20
|
+
<svg
|
|
21
|
+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
|
|
22
|
+
fill="none"
|
|
23
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
+
className={classes.absolute}
|
|
25
|
+
>
|
|
26
|
+
<Circle className={classes.circlePath} />
|
|
27
|
+
</svg>
|
|
28
|
+
{icon === "success" && (
|
|
29
|
+
<svg
|
|
30
|
+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
|
|
31
|
+
fill="none"
|
|
32
|
+
className={classes.absolute}
|
|
33
|
+
>
|
|
34
|
+
<path
|
|
35
|
+
d="M8 12.8571L10.1053 15L16 9"
|
|
36
|
+
stroke="currentColor"
|
|
37
|
+
stroke-width="1.5"
|
|
38
|
+
stroke-linecap="round"
|
|
39
|
+
stroke-linejoin="round"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
)}
|
|
43
|
+
</span>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { IndicatorOutlined } from "./IndicatorOutlined";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Indicator / Outlined",
|
|
8
|
+
component: IndicatorOutlined,
|
|
9
|
+
} as ComponentMeta<typeof IndicatorOutlined>;
|
|
10
|
+
|
|
11
|
+
const Template: ComponentStory<typeof IndicatorOutlined> = (args) => (
|
|
12
|
+
<IndicatorOutlined {...args} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const Warning = Template.bind({});
|
|
16
|
+
Warning.args = {
|
|
17
|
+
icon: "warning",
|
|
18
|
+
};
|
|
19
|
+
export const WarningSmall = Template.bind({});
|
|
20
|
+
WarningSmall.args = {
|
|
21
|
+
icon: "warning",
|
|
22
|
+
size: "small",
|
|
23
|
+
};
|
|
24
|
+
export const WarningText = Template.bind({});
|
|
25
|
+
WarningText.args = {
|
|
26
|
+
icon: "warning",
|
|
27
|
+
color: "text",
|
|
28
|
+
};
|
|
29
|
+
export const WarningSmallText = Template.bind({});
|
|
30
|
+
WarningSmallText.args = {
|
|
31
|
+
icon: "warning",
|
|
32
|
+
color: "text",
|
|
33
|
+
size: "small",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Error = Template.bind({});
|
|
37
|
+
Error.args = {
|
|
38
|
+
icon: "error",
|
|
39
|
+
};
|
|
40
|
+
export const ErrorSmall = Template.bind({});
|
|
41
|
+
ErrorSmall.args = {
|
|
42
|
+
icon: "error",
|
|
43
|
+
size: "small",
|
|
44
|
+
};
|
|
45
|
+
export const ErrorText = Template.bind({});
|
|
46
|
+
ErrorText.args = {
|
|
47
|
+
icon: "error",
|
|
48
|
+
color: "text",
|
|
49
|
+
};
|
|
50
|
+
export const ErrorSmallText = Template.bind({});
|
|
51
|
+
ErrorSmallText.args = {
|
|
52
|
+
icon: "error",
|
|
53
|
+
color: "text",
|
|
54
|
+
size: "small",
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const Fail = Template.bind({});
|
|
58
|
+
Fail.args = {
|
|
59
|
+
icon: "fail",
|
|
60
|
+
};
|
|
61
|
+
export const FailText = Template.bind({});
|
|
62
|
+
FailText.args = {
|
|
63
|
+
icon: "fail",
|
|
64
|
+
color: "text",
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Success = Template.bind({});
|
|
68
|
+
Success.args = {
|
|
69
|
+
icon: "success",
|
|
70
|
+
};
|
|
71
|
+
export const SuccessSmall = Template.bind({});
|
|
72
|
+
SuccessSmall.args = {
|
|
73
|
+
icon: "success",
|
|
74
|
+
size: "small",
|
|
75
|
+
};
|
|
76
|
+
export const SuccessText = Template.bind({});
|
|
77
|
+
SuccessText.args = {
|
|
78
|
+
icon: "success",
|
|
79
|
+
color: "text",
|
|
80
|
+
};
|
|
81
|
+
export const SuccessSmallText = Template.bind({});
|
|
82
|
+
SuccessSmallText.args = {
|
|
83
|
+
icon: "success",
|
|
84
|
+
color: "text",
|
|
85
|
+
size: "small",
|
|
86
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { FailOutlineIndicatorIcon } from "../icons/indicator";
|
|
5
|
+
import { CircleOutline } from "./CircleOutline";
|
|
6
|
+
import {
|
|
7
|
+
IndicatorCombinations,
|
|
8
|
+
IndicatorIcon,
|
|
9
|
+
IndicatorSize,
|
|
10
|
+
mapVariantToIcon,
|
|
11
|
+
} from "./Indicator";
|
|
12
|
+
import { getSizeDimension, useStyles } from "./styles";
|
|
13
|
+
|
|
14
|
+
export interface IndicatorOutlinedProps {
|
|
15
|
+
icon: IndicatorIcon;
|
|
16
|
+
size?: IndicatorSize;
|
|
17
|
+
color?: "default" | "text";
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const getIconComponent = (icon: IndicatorIcon, size: IndicatorSize) => {
|
|
22
|
+
if (icon === "fail") {
|
|
23
|
+
return FailOutlineIndicatorIcon;
|
|
24
|
+
}
|
|
25
|
+
return mapVariantToIcon[`${icon}-${size}` as IndicatorCombinations];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const IndicatorOutlined = ({
|
|
29
|
+
icon,
|
|
30
|
+
size = "regular",
|
|
31
|
+
color = "default",
|
|
32
|
+
className,
|
|
33
|
+
}: IndicatorOutlinedProps) => {
|
|
34
|
+
const classes = useStyles({ icon, size });
|
|
35
|
+
|
|
36
|
+
const Icon = getIconComponent(icon, size);
|
|
37
|
+
const viewBoxSize = getSizeDimension(size);
|
|
38
|
+
|
|
39
|
+
const hasColor = color === "default";
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<span
|
|
43
|
+
className={clsx(
|
|
44
|
+
classes.wrapper,
|
|
45
|
+
hasColor && classes.wrapperOutline,
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
<svg
|
|
50
|
+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
|
|
51
|
+
fill="none"
|
|
52
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
53
|
+
className={classes.absolute}
|
|
54
|
+
>
|
|
55
|
+
<CircleOutline
|
|
56
|
+
size={size}
|
|
57
|
+
className={clsx(classes.absolute, hasColor && classes.circleOutline)}
|
|
58
|
+
/>
|
|
59
|
+
</svg>
|
|
60
|
+
<Icon />
|
|
61
|
+
</span>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { makeStyles, SaleorTheme } from "../theme";
|
|
2
|
+
import { IndicatorProps, IndicatorSize } from "./Indicator";
|
|
3
|
+
|
|
4
|
+
export const getIconColor =
|
|
5
|
+
(theme: SaleorTheme, type: "mid" | "dark") =>
|
|
6
|
+
(props: Pick<IndicatorProps, "icon">) => {
|
|
7
|
+
switch (props.icon) {
|
|
8
|
+
case "warning":
|
|
9
|
+
return theme.palette.saleor.warning[type];
|
|
10
|
+
case "success":
|
|
11
|
+
return theme.palette.saleor.success[type];
|
|
12
|
+
case "fail":
|
|
13
|
+
case "error":
|
|
14
|
+
return theme.palette.saleor.fail[type];
|
|
15
|
+
default:
|
|
16
|
+
return "inherit";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const getSizeDimension = (size: IndicatorSize) =>
|
|
21
|
+
size === "regular" ? 24 : 16;
|
|
22
|
+
|
|
23
|
+
export const useStyles = makeStyles<
|
|
24
|
+
Required<Pick<IndicatorProps, "icon" | "size">>,
|
|
25
|
+
| "wrapper"
|
|
26
|
+
| "wrapperCircle"
|
|
27
|
+
| "wrapperOutline"
|
|
28
|
+
| "absolute"
|
|
29
|
+
| "circlePath"
|
|
30
|
+
| "circleOutline"
|
|
31
|
+
>(
|
|
32
|
+
(theme) => ({
|
|
33
|
+
wrapper: {
|
|
34
|
+
position: "relative",
|
|
35
|
+
display: "inline-block",
|
|
36
|
+
width: (props) => `${getSizeDimension(props.size)}px`,
|
|
37
|
+
height: (props) => `${getSizeDimension(props.size)}px`,
|
|
38
|
+
color: theme.palette.saleor.main[1],
|
|
39
|
+
},
|
|
40
|
+
wrapperCircle: {
|
|
41
|
+
color: getIconColor(theme, "mid"),
|
|
42
|
+
},
|
|
43
|
+
wrapperOutline: {
|
|
44
|
+
color: getIconColor(theme, "dark"),
|
|
45
|
+
},
|
|
46
|
+
absolute: {
|
|
47
|
+
position: "absolute",
|
|
48
|
+
top: 0,
|
|
49
|
+
bottom: 0,
|
|
50
|
+
left: 0,
|
|
51
|
+
right: 0,
|
|
52
|
+
},
|
|
53
|
+
circlePath: {
|
|
54
|
+
fill: getIconColor(theme, "mid"),
|
|
55
|
+
},
|
|
56
|
+
circleOutline: {
|
|
57
|
+
stroke: getIconColor(theme, "dark"),
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
{ name: "Indicator" }
|
|
61
|
+
);
|