@mailstep/design-system 0.5.1-beta.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +40 -20
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +5 -2
- package/ui/Blocks/CommonGrid/CommonGrid.js +12 -22
- package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +66 -0
- package/ui/Blocks/CommonGrid/StandardButtons.d.ts +4 -0
- package/ui/Blocks/CommonGrid/StandardButtons.js +36 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +50 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +18 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +45 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +37 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +13 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +32 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +1 -1
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +58 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +20 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/DataRow.js +4 -4
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +113 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +3 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +43 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/FilterRow.js +2 -3
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +46 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.d.ts +10 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +19 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/HeadCell.js +1 -4
- package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +18 -0
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +29 -0
- package/ui/Blocks/CommonGrid/components/IconList/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +20 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +47 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.d.ts +3 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +76 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/types.d.ts +17 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -0
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +1 -4
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +26 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/Table.d.ts +0 -6
- package/ui/Blocks/CommonGrid/components/Table.js +0 -5
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +32 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +89 -0
- package/ui/Blocks/CommonGrid/components/TextRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/types.d.ts +21 -0
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -0
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +22 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/{icons/ArrowSimple.js → gridCells/ButtonInCell.js} +4 -2
- package/ui/Blocks/CommonGrid/components/gridCells/Date.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +8 -0
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -0
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +33 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +18 -0
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +23 -0
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +8 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +24 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +30 -0
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +16 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +30 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +14 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +14 -0
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +4 -0
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +14 -0
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +15 -0
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +70 -0
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.d.ts +3 -0
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +13 -0
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.d.ts +7 -0
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -0
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.d.ts +8 -0
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +25 -0
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +19 -0
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +34 -0
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +8 -0
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +15 -0
- package/ui/Blocks/CommonGrid/index.d.ts +7 -71
- package/ui/Blocks/CommonGrid/index.js +7 -15
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +4 -4
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +3 -2
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +3 -2
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +2 -2
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +2 -1
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.d.ts +1 -0
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +8 -0
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +1 -17
- package/ui/Blocks/CommonGrid/styles.d.ts +14 -0
- package/ui/Blocks/CommonGrid/styles.js +33 -0
- package/ui/Blocks/CommonGrid/translations.d.ts +1 -0
- package/ui/Blocks/CommonGrid/translations.js +6 -0
- package/ui/Blocks/CommonGrid/types.d.ts +29 -15
- package/ui/Blocks/CommonGrid/utils/index.d.ts +4 -1
- package/ui/Blocks/CommonGrid/utils/index.js +19 -0
- package/ui/Blocks/HidePrint/HidePrint.d.ts +6 -0
- package/ui/Blocks/HidePrint/HidePrint.js +13 -0
- package/ui/Blocks/Modal/Modal.js +2 -2
- package/ui/Blocks/Modal/stories/Modal.stories.js +5 -1
- package/ui/Blocks/Modal/styles.d.ts +4 -0
- package/ui/Blocks/Modal/styles.js +10 -3
- package/ui/Blocks/Popover/index.d.ts +12 -0
- package/ui/Blocks/Popover/index.js +21 -0
- package/ui/Elements/DatePicker/DatePicker.d.ts +20 -0
- package/ui/Elements/DatePicker/DatePicker.js +65 -0
- package/ui/Elements/DatePicker/Datetime/DateTime.d.ts +95 -0
- package/ui/Elements/DatePicker/Datetime/DateTime.js +516 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +8 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +57 -0
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.d.ts +9 -0
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +16 -0
- package/ui/Elements/DatePicker/Datetime/types.d.ts +61 -0
- package/ui/Elements/DatePicker/Datetime/types.js +7 -0
- package/ui/Elements/DatePicker/Datetime/views/DaysView.d.ts +14 -0
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +145 -0
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.d.ts +10 -0
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +111 -0
- package/ui/Elements/DatePicker/Datetime/views/YearsView.d.ts +15 -0
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +117 -0
- package/ui/Elements/DatePicker/index.d.ts +2 -0
- package/ui/Elements/DatePicker/index.js +2 -0
- package/ui/Elements/DatePicker/styles.d.ts +2 -0
- package/ui/Elements/DatePicker/styles.js +8 -0
- package/ui/Elements/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/ui/Elements/DropdownMenu/DropdownMenu.js +36 -0
- package/ui/Elements/DropdownMenu/components/DefaultItem.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +16 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.js +51 -0
- package/ui/Elements/DropdownMenu/components/MenuList.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/MenuList.js +10 -0
- package/ui/Elements/DropdownMenu/index.d.ts +1 -0
- package/ui/Elements/DropdownMenu/index.js +1 -0
- package/ui/Elements/DropdownMenu/types.d.ts +41 -0
- package/ui/Elements/DropdownMenu/types.js +1 -0
- package/ui/Elements/DropdownSelect/DropdownSelect.d.ts +21 -0
- package/ui/Elements/DropdownSelect/DropdownSelect.js +47 -0
- package/ui/Elements/DropdownSelect/index.d.ts +4 -0
- package/ui/Elements/DropdownSelect/index.js +3 -0
- package/ui/Elements/ErrorMessage/ErrorMessage.js +1 -1
- package/ui/Elements/HighlightBox/HighlightBox.d.ts +50 -0
- package/ui/Elements/HighlightBox/HighlightBox.js +65 -0
- package/ui/Elements/HighlightBox/index.d.ts +2 -0
- package/ui/Elements/HighlightBox/index.js +2 -0
- package/ui/Elements/Icon/icons/Company.d.ts +3 -0
- package/ui/Elements/Icon/icons/Company.js +13 -0
- package/ui/Elements/Icon/icons/Integrations.d.ts +3 -0
- package/ui/Elements/Icon/icons/Integrations.js +13 -0
- package/ui/Elements/Icon/icons/ShoppingBag.d.ts +3 -0
- package/ui/Elements/Icon/icons/ShoppingBag.js +13 -0
- package/ui/Elements/Icon/icons/Truck.d.ts +3 -0
- package/ui/Elements/Icon/icons/Truck.js +13 -0
- package/ui/Elements/Icon/icons/TwoUsers.d.ts +3 -0
- package/ui/Elements/Icon/icons/TwoUsers.js +13 -0
- package/ui/Elements/Icon/icons/index.d.ts +5 -0
- package/ui/Elements/Icon/icons/index.js +5 -0
- package/ui/Elements/MultiSelect/MultiSelect.d.ts +6 -0
- package/ui/Elements/MultiSelect/MultiSelect.js +29 -0
- package/ui/Elements/MultiSelect/index.d.ts +2 -0
- package/ui/Elements/MultiSelect/index.js +2 -0
- package/ui/Elements/Pagination/Pagination.d.ts +4 -3
- package/ui/Elements/Pagination/Pagination.js +11 -3
- package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +1 -1
- package/ui/Elements/Pagination/styled.js +6 -6
- package/ui/Elements/Select/Select.d.ts +3 -0
- package/ui/Elements/Select/Select.js +69 -0
- package/ui/Elements/Select/index.d.ts +2 -0
- package/ui/Elements/Select/index.js +2 -0
- package/ui/Elements/Select/styles.d.ts +5 -0
- package/ui/Elements/Select/styles.js +12 -0
- package/ui/Elements/Select/themes/CustomComponents.d.ts +8 -0
- package/ui/Elements/Select/themes/CustomComponents.js +125 -0
- package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
- package/ui/Elements/Select/themes/baseStyles.js +87 -0
- package/ui/Elements/Select/themes/formStyles.d.ts +24 -0
- package/ui/Elements/Select/themes/formStyles.js +102 -0
- package/ui/Elements/Select/themes/index.d.ts +3 -0
- package/ui/Elements/Select/themes/index.js +43 -0
- package/ui/Elements/Select/types.d.ts +55 -0
- package/ui/Elements/Select/types.js +1 -0
- package/ui/Elements/SingleSelect/SingleSelect.d.ts +20 -0
- package/ui/Elements/SingleSelect/SingleSelect.js +197 -0
- package/ui/Elements/SingleSelect/index.d.ts +2 -0
- package/ui/Elements/SingleSelect/index.js +2 -0
- package/ui/Elements/Text/types.d.ts +2 -2
- package/ui/Elements/Toggle/Toggle.d.ts +1 -1
- package/ui/Elements/Toggle/Toggle.js +2 -2
- package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +1 -1
- package/ui/Elements/Toggle/types.d.ts +1 -0
- package/ui/Forms/Checkbox/Checkbox.js +3 -2
- package/ui/Forms/Checkbox/stories/Checkbox.stories.js +1 -1
- package/ui/Forms/Checkbox/styles.d.ts +1 -1
- package/ui/Forms/Checkbox/styles.js +1 -1
- package/ui/Forms/Input/types.d.ts +2 -2
- package/ui/Forms/RadioButton/RadioButton.js +4 -1
- package/ui/Forms/RadioButton/styles.d.ts +1 -1
- package/ui/Forms/RadioButton/styles.js +1 -1
- package/ui/Forms/TextArea/TextArea.d.ts +20 -0
- package/ui/Forms/TextArea/TextArea.js +34 -0
- package/ui/Forms/TextArea/index.d.ts +2 -0
- package/ui/Forms/TextArea/index.js +2 -0
- package/ui/Forms/TextArea/styles.d.ts +12 -0
- package/ui/Forms/TextArea/styles.js +31 -0
- package/ui/ThemeProvider/ThemeProvider.d.ts +3 -1
- package/ui/ThemeProvider/ThemeProvider.js +4 -2
- package/ui/ThemeProvider/types.d.ts +1 -0
- package/ui/index.d.ts +17 -3
- package/ui/index.es.js +42483 -8531
- package/ui/index.js +17 -3
- package/ui/index.umd.js +1658 -273
- package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +0 -12
- package/ui/Blocks/CommonGrid/CommonGridContext.js +0 -45
- package/ui/Blocks/CommonGrid/components/ActionColumnHead.d.ts +0 -4
- package/ui/Blocks/CommonGrid/components/ActionColumnHead.js +0 -16
- package/ui/Blocks/CommonGrid/components/ButtonStrip.d.ts +0 -7
- package/ui/Blocks/CommonGrid/components/ButtonStrip.js +0 -35
- package/ui/Blocks/CommonGrid/components/ConfigForm.d.ts +0 -9
- package/ui/Blocks/CommonGrid/components/ConfigForm.js +0 -58
- package/ui/Blocks/CommonGrid/components/DefaultPaginator.d.ts +0 -3
- package/ui/Blocks/CommonGrid/components/DefaultPaginator.js +0 -11
- package/ui/Blocks/CommonGrid/components/Dialog.d.ts +0 -11
- package/ui/Blocks/CommonGrid/components/Dialog.js +0 -19
- package/ui/Blocks/CommonGrid/components/DropdownMenu.d.ts +0 -21
- package/ui/Blocks/CommonGrid/components/DropdownMenu.js +0 -59
- package/ui/Blocks/CommonGrid/components/DropdownSelect.d.ts +0 -15
- package/ui/Blocks/CommonGrid/components/DropdownSelect.js +0 -35
- package/ui/Blocks/CommonGrid/components/FloatingButton.d.ts +0 -6
- package/ui/Blocks/CommonGrid/components/FloatingButton.js +0 -13
- package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +0 -2
- package/ui/Blocks/CommonGrid/hooks/useControlButtons.d.ts +0 -10
- package/ui/Blocks/CommonGrid/hooks/useControlButtons.js +0 -64
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +0 -13
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +0 -49
- package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +0 -2
- package/ui/Blocks/CommonGrid/storybook/utils/filters.js +0 -23
- package/ui/Blocks/CommonGrid/utils/public.d.ts +0 -16
- package/ui/Blocks/CommonGrid/utils/public.js +0 -52
- package/ui/Elements/Paragraph/Paragraph.d.ts +0 -2
- package/ui/Elements/Paragraph/Paragraph.js +0 -3
- package/ui/Elements/Paragraph/index.d.ts +0 -3
- package/ui/Elements/Paragraph/index.js +0 -3
- package/ui/Elements/Paragraph/stories/Paragraph.stories.d.ts +0 -17
- package/ui/Elements/Paragraph/stories/Paragraph.stories.js +0 -34
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
|
+
if (ar || !(i in from)) {
|
|
51
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
+
ar[i] = from[i];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
|
+
};
|
|
57
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
58
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
59
|
+
import { createFilter } from 'react-select';
|
|
60
|
+
import Select from '../Select';
|
|
61
|
+
import omit from 'lodash/fp/omit';
|
|
62
|
+
import { nanoid } from 'nanoid';
|
|
63
|
+
import { i18n } from '@lingui/core';
|
|
64
|
+
var CREATE = "_create_".concat(nanoid(), "_");
|
|
65
|
+
var defaultFilterOption = createFilter();
|
|
66
|
+
var creatableFilterOption = function (option, rawInput) {
|
|
67
|
+
if ((option === null || option === void 0 ? void 0 : option.value) == CREATE)
|
|
68
|
+
return true;
|
|
69
|
+
return defaultFilterOption(option, rawInput);
|
|
70
|
+
};
|
|
71
|
+
var getOptionValue = function (selectedOption) {
|
|
72
|
+
if (selectedOption === null) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
else if (Array.isArray(selectedOption)) {
|
|
76
|
+
return selectedOption.map(function (option) { return option.value; });
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return selectedOption.value;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var loadingMessage = function () { return i18n._({ id: 'components.dropdown.loading', message: 'Loading...' }); };
|
|
83
|
+
var SingleSelect = function (props) {
|
|
84
|
+
var name = props.name, onChange = props.onChange, onBlur = props.onBlur, onValueChange = props.onValueChange, loadOptions = props.loadOptions, _a = props.asyncLoadMinChars, asyncLoadMinChars = _a === void 0 ? 0 : _a, isLocked = props.isLocked, _b = props.lockedText, lockedText = _b === void 0 ? i18n._({ id: 'components.dropdown.notReact', message: 'Select related values first...' }) : _b, disabled = props.disabled, _c = props.placeholder, placeholder = _c === void 0 ? i18n._({ id: 'components.dropdown.placeholder', message: 'Select...' }) : _c, preload = props.preload, initialOptions = props.initialOptions, onCreateOption = props.onCreateOption, options = props.options, filterOption = props.filterOption;
|
|
85
|
+
var _d = useState(false), isCreating = _d[0], setIsCreating = _d[1];
|
|
86
|
+
var asAsync = !!loadOptions || !!onCreateOption;
|
|
87
|
+
var noOptionsMessage = useCallback(function (inputValue) {
|
|
88
|
+
return loadOptions && inputValue.length < asyncLoadMinChars
|
|
89
|
+
? i18n._({
|
|
90
|
+
id: 'components.dropdown.writeMoreChars',
|
|
91
|
+
message: 'Write at least ${asyncLoadMinChars} characters.',
|
|
92
|
+
})
|
|
93
|
+
: i18n._({ id: 'components.dropdown.noOptions', message: 'No options' });
|
|
94
|
+
}, [loadOptions, asyncLoadMinChars]);
|
|
95
|
+
var handleLoadOptions = useCallback(function (inputValue) {
|
|
96
|
+
if (onCreateOption) {
|
|
97
|
+
if (!inputValue.trim())
|
|
98
|
+
return Promise.resolve(options || []);
|
|
99
|
+
return Promise.resolve(__spreadArray(__spreadArray([], (options || []), true), [
|
|
100
|
+
{
|
|
101
|
+
value: CREATE,
|
|
102
|
+
label: "".concat(inputValue, " (").concat(i18n._({ id: 'components.dropdown.newOption', message: 'new value' }), ")"),
|
|
103
|
+
inputValue: inputValue,
|
|
104
|
+
},
|
|
105
|
+
], false));
|
|
106
|
+
}
|
|
107
|
+
else if (!loadOptions || inputValue.length < asyncLoadMinChars) {
|
|
108
|
+
return Promise.resolve([]);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return loadOptions(inputValue, false);
|
|
112
|
+
}
|
|
113
|
+
}, [onCreateOption, loadOptions, asyncLoadMinChars, options]);
|
|
114
|
+
var _e = useState(options || []), loadedDefaultOptions = _e[0], setLoadedDefaultOptions = _e[1];
|
|
115
|
+
useEffect(function () {
|
|
116
|
+
if (loadOptions && preload && !props.value)
|
|
117
|
+
loadOptions('', false).then(setLoadedDefaultOptions);
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
+
}, [loadOptions]); // this is intentional
|
|
120
|
+
var _f = useState(null), storedSelectedOption = _f[0], setStoredSelectedOption = _f[1];
|
|
121
|
+
useEffect(function () {
|
|
122
|
+
if (initialOptions && initialOptions.length) {
|
|
123
|
+
var selectedOption = initialOptions.find(function (option) { return option.value == props.value; }) || null;
|
|
124
|
+
setStoredSelectedOption(selectedOption);
|
|
125
|
+
}
|
|
126
|
+
if (loadOptions && !initialOptions && props.value) {
|
|
127
|
+
loadOptions(String(props.value), true).then(function (selectedOptions) { return setStoredSelectedOption((selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions[0]) || null); });
|
|
128
|
+
}
|
|
129
|
+
// ignored because of props.value, this only finds option for initial value
|
|
130
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
|
+
}, [initialOptions, setStoredSelectedOption]);
|
|
132
|
+
var handleChange = useCallback(function (option) { return __awaiter(void 0, void 0, void 0, function () {
|
|
133
|
+
var value, newOption;
|
|
134
|
+
var _a, _b, _c, _d;
|
|
135
|
+
return __generator(this, function (_e) {
|
|
136
|
+
switch (_e.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
if (!(onCreateOption && (option === null || option === void 0 ? void 0 : option.value) == CREATE)) return [3 /*break*/, 4];
|
|
139
|
+
if (!((option === null || option === void 0 ? void 0 : option.inputValue) && ((_b = (_a = option === null || option === void 0 ? void 0 : option.inputValue) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) < 2)) return [3 /*break*/, 1];
|
|
140
|
+
props === null || props === void 0 ? void 0 : props.form.setFieldTouched(name, true, true);
|
|
141
|
+
props === null || props === void 0 ? void 0 : props.form.setFieldError(name, i18n._({ id: 'form.general.min2Chars', message: 'Minimal length is 2 characters.' }));
|
|
142
|
+
return [2 /*return*/];
|
|
143
|
+
case 1:
|
|
144
|
+
setIsCreating(true);
|
|
145
|
+
return [4 /*yield*/, onCreateOption((_d = (_c = option === null || option === void 0 ? void 0 : option.inputValue) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '')];
|
|
146
|
+
case 2:
|
|
147
|
+
newOption = _e.sent();
|
|
148
|
+
value = getOptionValue(newOption);
|
|
149
|
+
setIsCreating(false);
|
|
150
|
+
_e.label = 3;
|
|
151
|
+
case 3: return [3 /*break*/, 5];
|
|
152
|
+
case 4:
|
|
153
|
+
value = getOptionValue(option);
|
|
154
|
+
loadOptions && setStoredSelectedOption(option);
|
|
155
|
+
_e.label = 5;
|
|
156
|
+
case 5:
|
|
157
|
+
if (onChange) {
|
|
158
|
+
onChange({
|
|
159
|
+
target: {
|
|
160
|
+
name: name !== null && name !== void 0 ? name : '',
|
|
161
|
+
type: 'change',
|
|
162
|
+
value: value,
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (onValueChange) {
|
|
167
|
+
onValueChange(value);
|
|
168
|
+
}
|
|
169
|
+
return [2 /*return*/];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}); }, [onCreateOption, loadOptions, onChange, onValueChange, props === null || props === void 0 ? void 0 : props.form, name]);
|
|
173
|
+
var handleBlur = useCallback(function (option) {
|
|
174
|
+
if (onBlur) {
|
|
175
|
+
onBlur({
|
|
176
|
+
target: {
|
|
177
|
+
name: name,
|
|
178
|
+
type: 'blur',
|
|
179
|
+
value: getOptionValue(option),
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}, [name, onBlur]);
|
|
184
|
+
var omitted = ['onValueChange', 'placeholder', 'options', 'loadOptions', 'asyncLoadMinChars'];
|
|
185
|
+
var displayLockedText = isLocked && !disabled;
|
|
186
|
+
var placeholderValue = displayLockedText ? lockedText : placeholder;
|
|
187
|
+
var defaultOptions = useMemo(function () {
|
|
188
|
+
if (!asAsync)
|
|
189
|
+
return undefined; // relates only to asAsync true
|
|
190
|
+
var staticOptions = onCreateOption ? options : loadedDefaultOptions;
|
|
191
|
+
if (!storedSelectedOption)
|
|
192
|
+
return staticOptions || undefined;
|
|
193
|
+
return staticOptions ? __spreadArray(__spreadArray([], staticOptions, true), [storedSelectedOption], false) : [storedSelectedOption];
|
|
194
|
+
}, [asAsync, loadedDefaultOptions, onCreateOption, options, storedSelectedOption]);
|
|
195
|
+
return (_jsx(Select, __assign({}, omit(omitted, props), { filterOption: (filterOption || creatableFilterOption), disabled: disabled || isLocked, onChange: handleChange, onBlur: handleBlur, placeholder: placeholderValue, loadingMessage: loadingMessage, noOptionsMessage: noOptionsMessage, loadOptions: asAsync ? handleLoadOptions : undefined, containerVariant: asAsync ? 'search' : undefined, defaultOptions: defaultOptions, options: !asAsync ? options : undefined, isLoading: isCreating || props.isLoading })));
|
|
196
|
+
};
|
|
197
|
+
export default SingleSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export type TextProps = {
|
|
3
|
-
children?:
|
|
3
|
+
children?: ReactNode | ReactNode[];
|
|
4
4
|
fontSize?: number;
|
|
5
5
|
fontWeight?: string;
|
|
6
6
|
variant?: 'normal' | 'medium' | 'semiBold' | 'bold';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Props } from './types';
|
|
2
|
-
declare const Toggle: ({ onChange, label, name, checked, defaultChecked, spaceAround, disabled, labelPosition, variant, spaceBetween, ...rest }: Props) => JSX.Element;
|
|
2
|
+
declare const Toggle: ({ onChange, label, name, checked, defaultChecked, spaceAround, disabled, labelPosition, variant, spaceBetween, readOnly, ...rest }: Props) => JSX.Element;
|
|
3
3
|
export default Toggle;
|
|
@@ -45,8 +45,8 @@ var HiddenInput = styled.input(templateObject_6 || (templateObject_6 = __makeTem
|
|
|
45
45
|
});
|
|
46
46
|
var Wrapper = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n border-radius: 8px;\n overflow: hidden;\n flex-shrink: 0;\n &[data-appearance='primary'] {\n width: 24px;\n height: 14px;\n ", " {\n height: 10px;\n }\n }\n &[data-appearance='grid'] {\n width: 28px;\n height: 16px;\n ", " {\n height: 12px;\n }\n }\n"], ["\n position: relative;\n border-radius: 8px;\n overflow: hidden;\n flex-shrink: 0;\n &[data-appearance='primary'] {\n width: 24px;\n height: 14px;\n ", " {\n height: 10px;\n }\n }\n &[data-appearance='grid'] {\n width: 28px;\n height: 16px;\n ", " {\n height: 12px;\n }\n }\n"])), StyledDot, StyledDot);
|
|
47
47
|
var Toggle = function (_a) {
|
|
48
|
-
var onChange = _a.onChange, label = _a.label, name = _a.name, checked = _a.checked, defaultChecked = _a.defaultChecked, _b = _a.spaceAround, spaceAround = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.labelPosition, labelPosition = _d === void 0 ? 'default' : _d, _e = _a.variant, variant = _e === void 0 ? 'primary' : _e, _f = _a.spaceBetween, spaceBetween = _f === void 0 ? false : _f, rest = __rest(_a, ["onChange", "label", "name", "checked", "defaultChecked", "spaceAround", "disabled", "labelPosition", "variant", "spaceBetween"]);
|
|
49
|
-
return (_jsxs(StyledSpaceAroundWrap, { spaceBetween: spaceBetween, spaceAround: spaceAround, "$labelPosition": labelPosition, children: [label && (_jsx(StyledFieldLabel, { htmlFor: name, labelPosition: labelPosition, children: label })), _jsxs(Wrapper, { "data-appearance": variant, children: [_jsx(HiddenInput, { name: name, type: "checkbox", checked: checked, "$enabled": !disabled, defaultChecked: defaultChecked, onChange: !disabled ? onChange : undefined, disabled: disabled, "data-cy": "".concat(name, "Switch") }), _jsx(StyledToggle, __assign({ active: !!checked, disabled: disabled }, rest, { children: _jsx(StyledDot, {}) }))] })] }));
|
|
48
|
+
var onChange = _a.onChange, label = _a.label, name = _a.name, checked = _a.checked, defaultChecked = _a.defaultChecked, _b = _a.spaceAround, spaceAround = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.labelPosition, labelPosition = _d === void 0 ? 'default' : _d, _e = _a.variant, variant = _e === void 0 ? 'primary' : _e, _f = _a.spaceBetween, spaceBetween = _f === void 0 ? false : _f, readOnly = _a.readOnly, rest = __rest(_a, ["onChange", "label", "name", "checked", "defaultChecked", "spaceAround", "disabled", "labelPosition", "variant", "spaceBetween", "readOnly"]);
|
|
49
|
+
return (_jsxs(StyledSpaceAroundWrap, { spaceBetween: spaceBetween, spaceAround: spaceAround, "$labelPosition": labelPosition, children: [label && (_jsx(StyledFieldLabel, { htmlFor: name, labelPosition: labelPosition, children: label })), _jsxs(Wrapper, { "data-appearance": variant, children: [_jsx(HiddenInput, { name: name, type: "checkbox", checked: checked, "$enabled": !disabled, defaultChecked: defaultChecked, onChange: !disabled ? onChange : undefined, disabled: disabled, "data-cy": "".concat(name, "Switch"), readOnly: readOnly }), _jsx(StyledToggle, __assign({ active: !!checked, disabled: disabled }, rest, { children: _jsx(StyledDot, {}) }))] })] }));
|
|
50
50
|
};
|
|
51
51
|
export default Toggle;
|
|
52
52
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { StoryObj } from '@storybook/react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ onChange, label, name, checked, defaultChecked, spaceAround, disabled, labelPosition, variant, spaceBetween, ...rest }: import("../types").Props) => JSX.Element;
|
|
5
|
+
component: ({ onChange, label, name, checked, defaultChecked, spaceAround, disabled, labelPosition, variant, spaceBetween, readOnly, ...rest }: import("../types").Props) => JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
argTypes: {};
|
|
8
8
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
2
|
+
import { memo, useId } from 'react';
|
|
3
3
|
import { CheckboxWrap, CheckIcon, FakeInput, Label } from './styles';
|
|
4
4
|
import { th, useTheme } from '@xstyled/styled-components';
|
|
5
5
|
var Checkbox = function (_a) {
|
|
6
6
|
var name = _a.name, label = _a.label, onChange = _a.onChange, checked = _a.checked, defaultChecked = _a.defaultChecked, _b = _a.size, size = _b === void 0 ? 4 : _b, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, readOnly = _a.readOnly, _c = _a.minusIcon, minusIcon = _c === void 0 ? false : _c;
|
|
7
7
|
var theme = useTheme();
|
|
8
8
|
var themeSize = th.fontSize(size)({ theme: theme });
|
|
9
|
-
|
|
9
|
+
var id = useId();
|
|
10
|
+
return (_jsxs(CheckboxWrap, { size: themeSize, className: className, children: [_jsx("input", { type: "checkbox", ref: inputRef, name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onChange: onChange, value: "", readOnly: readOnly, "data-cy": name && "".concat(name, "Checkbox"), id: id }), _jsx(FakeInput, { size: themeSize, children: _jsx(CheckIcon, { icon: minusIcon ? 'minus' : 'check', size: themeSize }) }), label && _jsx(Label, { htmlFor: id, children: label })] }));
|
|
10
11
|
};
|
|
11
12
|
export default memo(Checkbox);
|
|
@@ -8,4 +8,4 @@ export declare const CheckIcon: import("styled-components").StyledComponent<({ i
|
|
|
8
8
|
export declare const CheckboxWrap: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
9
9
|
size: string | number;
|
|
10
10
|
}, never>;
|
|
11
|
-
export declare const Label: import("styled-components").StyledComponent<"
|
|
11
|
+
export declare const Label: import("styled-components").StyledComponent<"label", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -22,5 +22,5 @@ export var CheckboxWrap = styled.div(templateObject_3 || (templateObject_3 = __m
|
|
|
22
22
|
var size = _a.size;
|
|
23
23
|
return size;
|
|
24
24
|
});
|
|
25
|
-
export var Label = styled.
|
|
25
|
+
export var Label = styled.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"], ["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"])));
|
|
26
26
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent, Dispatch, FocusEvent, InputHTMLAttributes, MouseEvent, ReactNode, RefObject, SetStateAction } from 'react';
|
|
1
|
+
import { ChangeEvent, Dispatch, FocusEvent, InputHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SetStateAction } from 'react';
|
|
2
2
|
export type SpaceAround = boolean | SpaceAroundProps;
|
|
3
3
|
export type SpaceAroundProps = {
|
|
4
4
|
marginTop?: number;
|
|
@@ -27,7 +27,7 @@ export type InputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
|
27
27
|
onEnter?: () => void;
|
|
28
28
|
onClear?: () => void;
|
|
29
29
|
alwaysShowClear?: boolean;
|
|
30
|
-
error?: string;
|
|
30
|
+
error?: string | ReactElement;
|
|
31
31
|
isInvalid?: boolean;
|
|
32
32
|
spaceAround?: SpaceAround;
|
|
33
33
|
isLoading?: boolean;
|
|
@@ -22,8 +22,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import { CenterDot, Item, Label, PaintoverLayer, StyledRadio, Wrapper } from './styles';
|
|
25
|
+
import { useId } from 'react';
|
|
25
26
|
var RadioButton = function (_a) {
|
|
26
27
|
var label = _a.label, id = _a.id, name = _a.name, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, rest = __rest(_a, ["label", "id", "name", "disabled", "onChange"]);
|
|
27
|
-
|
|
28
|
+
var customId = useId();
|
|
29
|
+
var inputId = id || customId;
|
|
30
|
+
return (_jsxs(Wrapper, { children: [_jsxs(Item, { children: [_jsx(StyledRadio, __assign({ type: "radio", id: inputId, name: name, disabled: disabled, onChange: onChange }, rest)), _jsx(PaintoverLayer, { disabled: disabled, children: _jsx(CenterDot, {}) })] }), label && _jsx(Label, { htmlFor: inputId, children: label })] }));
|
|
28
31
|
};
|
|
29
32
|
export default RadioButton;
|
|
@@ -7,4 +7,4 @@ export declare const CenterDot: import("styled-components").StyledComponent<"spa
|
|
|
7
7
|
export declare const StyledRadio: import("styled-components").StyledComponent<"input", import("@xstyled/system").Theme, {
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
}, never>;
|
|
10
|
-
export declare const Label: import("styled-components").StyledComponent<"
|
|
10
|
+
export declare const Label: import("styled-components").StyledComponent<"label", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -11,5 +11,5 @@ export var StyledRadio = styled.input(templateObject_5 || (templateObject_5 = __
|
|
|
11
11
|
var disabled = _a.disabled;
|
|
12
12
|
return (disabled ? 'default' : 'pointer');
|
|
13
13
|
});
|
|
14
|
-
export var Label = styled.
|
|
14
|
+
export var Label = styled.label(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"], ["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"])));
|
|
15
15
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChangeEvent, FocusEvent } from 'react';
|
|
2
|
+
import { SpaceAround } from '../Input/types';
|
|
3
|
+
export type Props = {
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
9
|
+
onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;
|
|
10
|
+
error?: boolean | string;
|
|
11
|
+
isInvalid?: boolean;
|
|
12
|
+
spaceAround?: SpaceAround;
|
|
13
|
+
className?: string;
|
|
14
|
+
resize?: 'none' | 'both' | 'horizontal' | 'vertical' | 'initial' | 'inherit';
|
|
15
|
+
icon?: string;
|
|
16
|
+
rows?: HTMLTextAreaElement['rows'];
|
|
17
|
+
Footer?: JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
declare const TextArea: ({ name, label, value, disabled, error, spaceAround, isInvalid, className, resize, icon, rows, Footer, ...rest }: Props) => JSX.Element;
|
|
20
|
+
export default TextArea;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { StyledTextArea, TextAreaWrap, InnerWrap, BorderWrap, IconWrap } from './styles';
|
|
25
|
+
import { SpaceAroundWrap } from '../../Elements/SpaceAround';
|
|
26
|
+
import FaIcon from '../../Elements/Icon/Icon';
|
|
27
|
+
import { FieldLabel } from '../../Elements/Label';
|
|
28
|
+
import ErrorMessage from '../../Elements/ErrorMessage/ErrorMessage';
|
|
29
|
+
var TextArea = function (_a) {
|
|
30
|
+
var name = _a.name, label = _a.label, value = _a.value, disabled = _a.disabled, error = _a.error, _b = _a.spaceAround, spaceAround = _b === void 0 ? false : _b, _c = _a.isInvalid, isInvalid = _c === void 0 ? undefined : _c, className = _a.className, resize = _a.resize, icon = _a.icon, _d = _a.rows, rows = _d === void 0 ? 4 : _d, Footer = _a.Footer, rest = __rest(_a, ["name", "label", "value", "disabled", "error", "spaceAround", "isInvalid", "className", "resize", "icon", "rows", "Footer"]);
|
|
31
|
+
var $isInvalid = isInvalid !== undefined ? isInvalid : !!error;
|
|
32
|
+
return (_jsxs(SpaceAroundWrap, { spaceAround: spaceAround, children: [_jsxs(TextAreaWrap, { children: [label && (_jsx(FieldLabel, { htmlFor: name, "$isInvalid": $isInvalid, children: label })), _jsxs(BorderWrap, { "$isInvalid": $isInvalid, disabled: disabled, children: [_jsxs(InnerWrap, { children: [icon && (_jsx(IconWrap, { children: _jsx(FaIcon, { icon: icon }) })), _jsx(StyledTextArea, __assign({ name: name, value: value, disabled: disabled, className: className, "$isInvalid": $isInvalid, "$resize": resize }, rest, { rows: rows }))] }), Footer] })] }), error && _jsx(ErrorMessage, { children: error })] }));
|
|
33
|
+
};
|
|
34
|
+
export default TextArea;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const IconWrap: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
2
|
+
export declare const StyledTextArea: import("styled-components").StyledComponent<"textarea", import("@xstyled/system").Theme, {
|
|
3
|
+
$resize?: string | undefined;
|
|
4
|
+
$isInvalid?: boolean | undefined;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const TextAreaWrap: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
8
|
+
export declare const BorderWrap: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
9
|
+
$isInvalid?: boolean | undefined;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
}, never>;
|
|
12
|
+
export declare const InnerWrap: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import styled, { css } from '@xstyled/styled-components';
|
|
6
|
+
import { system, th } from '@xstyled/system';
|
|
7
|
+
export var IconWrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 12px;\n color: ", ";\n\n & svg {\n margin-top: 2;\n margin-right: 1;\n }\n"], ["\n font-size: 12px;\n color: ", ";\n\n & svg {\n margin-top: 2;\n margin-right: 1;\n }\n"])), th.color('lightGray5'));
|
|
8
|
+
export var StyledTextArea = styled.textarea(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n display: block;\n width: 100%;\n font-size: 1;\n font-family: ", ";\n line-height: 0;\n transition: inputTransition;\n border: none;\n font-weight: 800;\n color: ", ";\n background-color: transparent;\n :focus {\n outline: 0;\n color: blue2;\n }\n ", "\n\n ::placeholder {\n color: lightGray5;\n font-size: 14px;\n font-weight: 400;\n }\n"], ["\n ", ";\n display: block;\n width: 100%;\n font-size: 1;\n font-family: ", ";\n line-height: 0;\n transition: inputTransition;\n border: none;\n font-weight: 800;\n color: ", ";\n background-color: transparent;\n :focus {\n outline: 0;\n color: blue2;\n }\n ", "\n\n ::placeholder {\n color: lightGray5;\n font-size: 14px;\n font-weight: 400;\n }\n"])), system, th('fonts.primary'), function (_a) {
|
|
9
|
+
var $isInvalid = _a.$isInvalid, disabled = _a.disabled;
|
|
10
|
+
return ($isInvalid ? th.color('red1') : disabled ? th.color('gray') : th.color('typoPrimary'));
|
|
11
|
+
}, function (_a) {
|
|
12
|
+
var $resize = _a.$resize;
|
|
13
|
+
return $resize
|
|
14
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n resize: ", ";\n "], ["\n resize: ", ";\n "])), $resize) : '';
|
|
15
|
+
});
|
|
16
|
+
export var TextAreaWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
17
|
+
export var BorderWrap = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n background-color: white;\n padding-top: 1;\n padding-bottom: 1;\n padding-right: 1;\n padding-left: 12px;\n border: slim;\n border-color: ", ";\n color: ", ";\n background-color: ", ";\n background-clip: padding-box;\n border-radius: lg;\n\n :focus-within {\n background-color: white;\n border-color: blue2;\n color: blue2;\n }\n\n :hover {\n border-color: ", ";\n }\n\n :disabled {\n background-color: lightGray1;\n }\n"], ["\n display: flex;\n flex-direction: column;\n background-color: white;\n padding-top: 1;\n padding-bottom: 1;\n padding-right: 1;\n padding-left: 12px;\n border: slim;\n border-color: ", ";\n color: ", ";\n background-color: ", ";\n background-clip: padding-box;\n border-radius: lg;\n\n :focus-within {\n background-color: white;\n border-color: blue2;\n color: blue2;\n }\n\n :hover {\n border-color: ", ";\n }\n\n :disabled {\n background-color: lightGray1;\n }\n"])), function (_a) {
|
|
18
|
+
var $isInvalid = _a.$isInvalid;
|
|
19
|
+
return ($isInvalid ? th.color('red1') : th.color('lightGray6'));
|
|
20
|
+
}, function (_a) {
|
|
21
|
+
var $isInvalid = _a.$isInvalid;
|
|
22
|
+
return ($isInvalid ? th.color('red1') : th.color('gray'));
|
|
23
|
+
}, function (_a) {
|
|
24
|
+
var disabled = _a.disabled;
|
|
25
|
+
return (disabled ? th('colors.lightGray1') : 'unset');
|
|
26
|
+
}, function (_a) {
|
|
27
|
+
var disabled = _a.disabled;
|
|
28
|
+
return (disabled ? th('colors.lightGray3') : th('colors.gray5'));
|
|
29
|
+
});
|
|
30
|
+
export var InnerWrap = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n position: relative;\n"], ["\n display: flex;\n position: relative;\n"])));
|
|
31
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Props } from './types';
|
|
2
|
-
declare const
|
|
3
|
+
export declare const LanguageContext: import("react").Context<string>;
|
|
4
|
+
declare const MailstepThemeProvider: ({ children, theme, preflight, language }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
export default MailstepThemeProvider;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ThemeProvider, Preflight } from '@xstyled/styled-components';
|
|
3
3
|
import themes from './themes';
|
|
4
|
+
import { createContext } from 'react';
|
|
5
|
+
export var LanguageContext = createContext('en');
|
|
4
6
|
var MailstepThemeProvider = function (_a) {
|
|
5
|
-
var children = _a.children, _b = _a.theme, theme = _b === void 0 ? 'default' : _b, _c = _a.preflight, preflight = _c === void 0 ? true : _c;
|
|
6
|
-
return (_jsxs(ThemeProvider, { theme: themes[theme], children: [preflight && _jsx(Preflight, {}), children] }));
|
|
7
|
+
var children = _a.children, _b = _a.theme, theme = _b === void 0 ? 'default' : _b, _c = _a.preflight, preflight = _c === void 0 ? true : _c, _d = _a.language, language = _d === void 0 ? 'en' : _d;
|
|
8
|
+
return (_jsx(LanguageContext.Provider, { value: language, children: _jsxs(ThemeProvider, { theme: themes[theme], children: [preflight && _jsx(Preflight, {}), children] }) }));
|
|
7
9
|
};
|
|
8
10
|
export default MailstepThemeProvider;
|
package/ui/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ import Line from './Elements/Line';
|
|
|
18
18
|
import Link from './Elements/Link';
|
|
19
19
|
import Logo from './Elements/Logo';
|
|
20
20
|
import Pagination from './Elements/Pagination';
|
|
21
|
-
import Paragraph from './Elements/Paragraph';
|
|
22
21
|
import Portal from './Elements/Portal';
|
|
23
22
|
import ProgressBar from './Elements/ProgressBar';
|
|
24
23
|
import SimpleLink from './Elements/SimpleLink';
|
|
@@ -33,7 +32,15 @@ import Input from './Forms/Input';
|
|
|
33
32
|
import RadioButton from './Forms/RadioButton';
|
|
34
33
|
import ThemeProvider from './ThemeProvider';
|
|
35
34
|
import utils from './utils';
|
|
36
|
-
|
|
35
|
+
import DatePicker from './Elements/DatePicker';
|
|
36
|
+
import CommonGrid from './Blocks/CommonGrid';
|
|
37
|
+
import Popover from './Blocks/Popover';
|
|
38
|
+
import SingleSelect from './Elements/SingleSelect';
|
|
39
|
+
import MultiSelect from './Elements/MultiSelect';
|
|
40
|
+
import Select from './Elements/Select';
|
|
41
|
+
import DropdownSelect from './Elements/DropdownSelect';
|
|
42
|
+
import TextArea from './Forms/TextArea';
|
|
43
|
+
export { DropdownSelect, DatePicker, CommonGrid, Popover, SingleSelect, MultiSelect, Select, Card, CornerDialog, ImageList, LightBox, Modal, Tabs, Alert, Avatar, Badge, BorderedBox, Button, Dropdown, ErrorMessage, Icon, Image, Label, Line, Link, Logo, Pagination, Portal, ProgressBar, SimpleLink, SpaceAround, Spinner, Tag, Toast, Toggle, Typography, Checkbox, Input, RadioButton, ThemeProvider, utils, TextArea, };
|
|
37
44
|
export * from './Blocks/CornerDialog';
|
|
38
45
|
export * from './Blocks/ImageList';
|
|
39
46
|
export * from './Blocks/LightBox';
|
|
@@ -54,7 +61,6 @@ export * from './Elements/Line';
|
|
|
54
61
|
export * from './Elements/Link';
|
|
55
62
|
export * from './Elements/Logo';
|
|
56
63
|
export * from './Elements/Pagination';
|
|
57
|
-
export * from './Elements/Paragraph';
|
|
58
64
|
export * from './Elements/Portal';
|
|
59
65
|
export * from './Elements/ProgressBar';
|
|
60
66
|
export * from './Elements/SimpleLink';
|
|
@@ -69,3 +75,11 @@ export * from './Forms/Input';
|
|
|
69
75
|
export * from './Forms/RadioButton';
|
|
70
76
|
export * from './ThemeProvider';
|
|
71
77
|
export * from './utils';
|
|
78
|
+
export * from './Elements/DatePicker';
|
|
79
|
+
export * from './Blocks/CommonGrid';
|
|
80
|
+
export * from './Blocks/Popover';
|
|
81
|
+
export * from './Elements/SingleSelect';
|
|
82
|
+
export * from './Elements/MultiSelect';
|
|
83
|
+
export * from './Elements/Select';
|
|
84
|
+
export * from './Elements/DropdownSelect';
|
|
85
|
+
export * from './Forms/TextArea';
|