@moysklad/uikit 30.4.0 → 31.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/dist/colorVariables.css +23 -1
- package/dist/components/AutoComplete/AutoComplete.js +2 -2
- package/dist/components/BentoBlock/BentoBlock.d.ts +15 -0
- package/dist/components/BentoBlock/BentoBlock.js +20 -0
- package/dist/components/BentoBlock/BentoBlock.module.js +9 -0
- package/dist/components/BentoBlock/BentoBlock_module.css +50 -0
- package/dist/components/BentoBlock/consts.d.ts +14 -0
- package/dist/components/BentoBlock/consts.js +15 -0
- package/dist/components/Button/Button.d.ts +5 -2
- package/dist/components/Button/Button.js +28 -19
- package/dist/components/Button/Button_module.css +16 -14
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/DateRange/ArrowButton/ArrowButton.module.js +6 -0
- package/dist/components/DateRange/ArrowButton/ArrowButton_module.css +26 -0
- package/dist/components/DateRange/ArrowButton/index.d.ts +8 -0
- package/dist/components/DateRange/ArrowButton/index.js +23 -0
- package/dist/components/DateRange/Calendar/index.d.ts +12 -0
- package/dist/components/DateRange/Calendar/index.js +22 -0
- package/dist/components/DateRange/DateRange.d.ts +6 -0
- package/dist/components/DateRange/DateRange.js +51 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.d.ts +44 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.js +128 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.module.js +19 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger_module.css +170 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger.module.js +12 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger_module.css +43 -0
- package/dist/components/DateRange/DateRangeInput/DateRangeInput.d.ts +4 -0
- package/dist/components/DateRange/DateRangeInput/DateRangeInput.js +69 -0
- package/dist/components/DateRange/Day/Day.module.js +16 -0
- package/dist/components/DateRange/Day/Day_module.css +80 -0
- package/dist/components/DateRange/Day/index.d.ts +12 -0
- package/dist/components/DateRange/Day/index.js +39 -0
- package/dist/components/DateRange/DropdownContent/DropdownContent.module.js +10 -0
- package/dist/components/DateRange/DropdownContent/DropdownContent_module.css +34 -0
- package/dist/components/DateRange/DropdownContent/index.d.ts +24 -0
- package/dist/components/DateRange/DropdownContent/index.js +132 -0
- package/dist/components/DateRange/InputContent/InputContent.module.js +9 -0
- package/dist/components/DateRange/InputContent/InputContent_module.css +31 -0
- package/dist/components/DateRange/InputContent/index.d.ts +12 -0
- package/dist/components/DateRange/InputContent/index.js +59 -0
- package/dist/components/DateRange/Month/Month.module.js +7 -0
- package/dist/components/DateRange/Month/Month_module.css +17 -0
- package/dist/components/DateRange/Month/index.d.ts +15 -0
- package/dist/components/DateRange/Month/index.js +158 -0
- package/dist/components/DateRange/Month/utils.d.ts +2 -0
- package/dist/components/DateRange/Month/utils.js +8 -0
- package/dist/components/DateRange/MonthHeader/MonthHeader.module.js +5 -0
- package/dist/components/DateRange/MonthHeader/MonthHeader_module.css +10 -0
- package/dist/components/DateRange/MonthHeader/index.d.ts +5 -0
- package/dist/components/DateRange/MonthHeader/index.js +26 -0
- package/dist/components/DateRange/MonthList/MonthList.module.js +7 -0
- package/dist/components/DateRange/MonthList/MonthList_module.css +25 -0
- package/dist/components/DateRange/MonthList/index.d.ts +11 -0
- package/dist/components/DateRange/MonthList/index.js +91 -0
- package/dist/components/DateRange/PeriodVariantList/PeriodVariantList.module.js +9 -0
- package/dist/components/DateRange/PeriodVariantList/PeriodVariantList_module.css +18 -0
- package/dist/components/DateRange/PeriodVariantList/index.d.ts +18 -0
- package/dist/components/DateRange/PeriodVariantList/index.js +83 -0
- package/dist/components/DateRange/SideMenu/SideMenu.module.js +6 -0
- package/dist/components/DateRange/SideMenu/SideMenu_module.css +18 -0
- package/dist/components/DateRange/SideMenu/index.d.ts +13 -0
- package/dist/components/DateRange/SideMenu/index.js +73 -0
- package/dist/components/DateRange/TooltipedText/index.d.ts +8 -0
- package/dist/components/DateRange/TooltipedText/index.js +30 -0
- package/dist/components/DateRange/Year/Year.module.js +11 -0
- package/dist/components/DateRange/Year/Year_module.css +60 -0
- package/dist/components/DateRange/Year/index.d.ts +8 -0
- package/dist/components/DateRange/Year/index.js +47 -0
- package/dist/components/DateRange/YearsList/YearsList.module.js +5 -0
- package/dist/components/DateRange/YearsList/YearsList_module.css +15 -0
- package/dist/components/DateRange/YearsList/index.d.ts +12 -0
- package/dist/components/DateRange/YearsList/index.js +47 -0
- package/dist/components/DateRange/consts.d.ts +20 -0
- package/dist/components/DateRange/consts.js +81 -0
- package/dist/components/DateRange/formatDateRangeValue.d.ts +24 -0
- package/dist/components/DateRange/formatDateRangeValue.js +116 -0
- package/dist/components/DateRange/hooks/useCalendar.d.ts +13 -0
- package/dist/components/DateRange/hooks/useCalendar.js +88 -0
- package/dist/components/DateRange/hooks/useDateRange.d.ts +392 -0
- package/dist/components/DateRange/hooks/useDateRange.js +36 -0
- package/dist/components/DateRange/hooks/useDateRangeDropdown.d.ts +47 -0
- package/dist/components/DateRange/hooks/useDateRangeDropdown.js +117 -0
- package/dist/components/DateRange/hooks/useDateRangeValue.d.ts +56 -0
- package/dist/components/DateRange/hooks/useDateRangeValue.js +173 -0
- package/dist/components/DateRange/hooks/useMaskInput.d.ts +18 -0
- package/dist/components/DateRange/hooks/useMaskInput.js +169 -0
- package/dist/components/DateRange/hooks/useMonthList.d.ts +12 -0
- package/dist/components/DateRange/hooks/useMonthList.js +80 -0
- package/dist/components/DateRange/hooks/useSideMenu.d.ts +14 -0
- package/dist/components/DateRange/hooks/useSideMenu.js +113 -0
- package/dist/components/DateRange/index.d.ts +1 -0
- package/dist/components/DateRange/index.js +1 -0
- package/dist/components/DateRange/locale/en-US.d.ts +2 -0
- package/dist/components/DateRange/locale/en-US.js +82 -0
- package/dist/components/DateRange/locale/index.d.ts +4 -0
- package/dist/components/DateRange/locale/index.js +3 -0
- package/dist/components/DateRange/locale/ru-RU.d.ts +2 -0
- package/dist/components/DateRange/locale/ru-RU.js +82 -0
- package/dist/components/DateRange/locale/types.d.ts +9 -0
- package/dist/components/DateRange/locale/types.js +7 -0
- package/dist/components/DateRange/locale/useLocale.d.ts +8 -0
- package/dist/components/DateRange/locale/useLocale.js +31 -0
- package/dist/components/DateRange/props.d.ts +39 -0
- package/dist/components/DateRange/props.js +0 -0
- package/dist/components/DateRange/types.d.ts +126 -0
- package/dist/components/DateRange/types.js +13 -0
- package/dist/components/DateRange/utils.d.ts +33 -0
- package/dist/components/DateRange/utils.js +105 -0
- package/dist/components/Datepicker/Datepicker.d.ts +3 -1
- package/dist/components/Datepicker/Datepicker.js +4 -2
- package/dist/components/EditableDate/DropdownContent/DropdownContent.d.ts +9 -0
- package/dist/components/EditableDate/DropdownContent/DropdownContent.js +36 -0
- package/dist/components/EditableDate/EditableDate.d.ts +9 -0
- package/dist/components/EditableDate/EditableDate.js +142 -0
- package/dist/components/EditableDate/EditableDate.module.js +7 -0
- package/dist/components/EditableDate/EditableDate_module.css +32 -0
- package/dist/components/EditableTitle/EditableTitle.d.ts +7 -2
- package/dist/components/EditableTitle/EditableTitle.js +63 -31
- package/dist/components/EditableTitle/EditableTitle.module.js +1 -0
- package/dist/components/EditableTitle/EditableTitle_module.css +6 -0
- package/dist/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/components/EmptyStateLarge/EmptyStateLarge_module.css +2 -2
- package/dist/components/Help/Help_module.css +1 -1
- package/dist/components/Informer/Informer.d.ts +37 -0
- package/dist/components/Informer/Informer.js +36 -0
- package/dist/components/Informer/Informer.module.js +7 -0
- package/dist/components/Informer/Informer_module.css +24 -0
- package/dist/components/Input/Input.js +10 -5
- package/dist/components/Input/components/InfoBlock.d.ts +3 -1
- package/dist/components/Input/components/InfoBlock.js +7 -4
- package/dist/components/InputUnit/InputUnit.js +4 -4
- package/dist/components/LabelValue/LabelValue.d.ts +14 -10
- package/dist/components/LabelValue/LabelValue.js +46 -25
- package/dist/components/LabelValue/LabelValue.module.js +10 -4
- package/dist/components/LabelValue/LabelValue_module.css +53 -19
- package/dist/components/LabelValue/ValueBlock/ValueBlock.d.ts +2 -0
- package/dist/components/LabelValue/ValueBlock/ValueBlock.js +82 -0
- package/dist/components/LabelValue/ValueBlockWrapper.d.ts +5 -0
- package/dist/components/LabelValue/ValueBlockWrapper.js +13 -0
- package/dist/components/LabelValue/ValueIcon.d.ts +4 -0
- package/dist/components/LabelValue/ValueIcon.js +9 -0
- package/dist/components/LabelValue/ValueText.d.ts +10 -0
- package/dist/components/LabelValue/ValueText.js +24 -0
- package/dist/components/LabelValue/ValueTextWithHint.d.ts +12 -0
- package/dist/components/LabelValue/ValueTextWithHint.js +29 -0
- package/dist/components/LabelValue/hooks/useValueBlock.d.ts +29 -0
- package/dist/components/LabelValue/hooks/useValueBlock.js +72 -0
- package/dist/components/LabelValue/{ValueBlock/index.d.ts → types.d.ts} +8 -4
- package/dist/components/LabelValue/types.js +0 -0
- package/dist/components/LabelValueDate/LabelValueDate.js +2 -2
- package/dist/components/LabelValueFile/DeleteButton/DeleteButton.d.ts +9 -0
- package/dist/components/LabelValueFile/DeleteButton/DeleteButton.js +17 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.d.ts +7 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.js +15 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.module.js +6 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon_module.css +10 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview.d.ts +8 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview.js +53 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview.module.js +6 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview_module.css +13 -0
- package/dist/components/LabelValueFile/LabelValueFile.d.ts +7 -0
- package/dist/components/LabelValueFile/LabelValueFile.js +42 -0
- package/dist/components/LabelValueFile/LabelValueFile.module.js +12 -0
- package/dist/components/LabelValueFile/LabelValueFile_module.css +57 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock.d.ts +15 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock.js +130 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock.module.js +7 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock_module.css +17 -0
- package/dist/components/LabelValueInput/DropdownConnent/DropdownContent.d.ts +2 -0
- package/dist/components/LabelValueInput/DropdownConnent/DropdownContent.js +2 -0
- package/dist/components/LabelValueLink/LabelValueLink.d.ts +2 -0
- package/dist/components/LabelValueLink/LabelValueLink.js +76 -0
- package/dist/components/LabelValueLink/LabelValueLink.module.js +6 -0
- package/dist/components/LabelValueLink/LabelValueLink_module.css +11 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.d.ts +2 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.js +117 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.module.js +6 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock_module.css +8 -0
- package/dist/components/LabelValueLink/normalizeLinkValue.d.ts +1 -0
- package/dist/components/LabelValueLink/normalizeLinkValue.js +10 -0
- package/dist/components/LabelValueLink/useLinkDropdownValue.d.ts +15 -0
- package/dist/components/LabelValueLink/useLinkDropdownValue.js +26 -0
- package/dist/components/LabelValueSelect/Input/index.js +1 -1
- package/dist/components/LabelValueSelect/LabelValueSelect.d.ts +4 -2
- package/dist/components/Layout/Layout.d.ts +13 -0
- package/dist/components/Layout/Layout.js +41 -0
- package/dist/components/Layout/Layout.module.js +15 -0
- package/dist/components/Layout/Layout_module.css +77 -0
- package/dist/components/Link/Link.d.ts +5 -6
- package/dist/components/Link/Link.js +35 -9
- package/dist/components/Link/Link.module.js +1 -0
- package/dist/components/Link/Link_module.css +9 -0
- package/dist/components/MentionsTextfield/Mentions/style.css +2 -6
- package/dist/components/MentionsTextfield/MentionsTextfield.js +2 -1
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.d.ts +8 -0
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.js +13 -0
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.module.js +5 -0
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip_module.css +9 -0
- package/dist/components/Multiselect/DropdownContent/MultiselectDropdownContent.d.ts +12 -1
- package/dist/components/Multiselect/DropdownContent/MultiselectDropdownContent.js +20 -15
- package/dist/components/Multiselect/Input/Input.d.ts +6 -2
- package/dist/components/Multiselect/Input/Input.js +18 -4
- package/dist/components/Multiselect/Multiselect.d.ts +4 -2
- package/dist/components/Multiselect/Multiselect.js +14 -2
- package/dist/components/Multiselect/ShortDropdownContent/ShortDropdownContent.js +2 -1
- package/dist/components/Multiselect/TextField/MultiselectTextField.d.ts +5 -1
- package/dist/components/Multiselect/TextField/MultiselectTextField.js +15 -2
- package/dist/components/Multiselect/lib/consts.d.ts +1 -1
- package/dist/components/Multiselect/lib/consts.js +1 -1
- package/dist/components/Multiselect/lib/helpers.d.ts +24 -0
- package/dist/components/Multiselect/lib/helpers.js +15 -0
- package/dist/components/Multiselect/types.d.ts +2 -0
- package/dist/components/Panel/Panel.d.ts +34 -0
- package/dist/components/Panel/Panel.js +39 -0
- package/dist/components/Panel/Panel.module.js +6 -0
- package/dist/components/Panel/Panel_module.css +17 -0
- package/dist/components/Radiobutton/Radiobutton.js +1 -1
- package/dist/components/Radiobutton/Radiobutton_module.css +5 -0
- package/dist/components/SearchInput/SearchInput_module.css +1 -1
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.d.ts +3 -4
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.js +19 -24
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.module.js +1 -2
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue_module.css +5 -12
- package/dist/components/Select/Combobox/Combobox.d.ts +3 -1
- package/dist/components/Select/Combobox/Combobox.js +19 -8
- package/dist/components/Select/Combobox/Combobox.module.js +4 -3
- package/dist/components/Select/Combobox/Combobox_module.css +15 -9
- package/dist/components/Select/OptionsList/OptionsList.d.ts +3 -1
- package/dist/components/Select/OptionsList/OptionsList.js +37 -21
- package/dist/components/Select/OptionsList/OptionsList.module.js +2 -0
- package/dist/components/Select/OptionsList/OptionsList_module.css +15 -0
- package/dist/components/Select/Select.d.ts +2 -3
- package/dist/components/Select/Select.js +17 -7
- package/dist/components/Select/Select_module.css +5 -0
- package/dist/components/Select/ShortVariant/ShortVariant.js +1 -1
- package/dist/components/StatusBadge/StatusBadge.d.ts +28 -0
- package/dist/components/StatusBadge/StatusBadge.js +167 -0
- package/dist/components/StatusBadge/StatusBadge.module.js +37 -0
- package/dist/components/StatusBadge/StatusBadge_module.css +149 -0
- package/dist/components/StatusBadge/utils/StatusBadgeColor.d.ts +21 -0
- package/dist/components/StatusBadge/utils/StatusBadgeColor.js +20 -0
- package/dist/components/StatusBadge/utils/getStatusBadgeColor.d.ts +2 -0
- package/dist/components/StatusBadge/utils/getStatusBadgeColor.js +8 -0
- package/dist/components/Textfield/Textfield.d.ts +7 -2
- package/dist/components/Textfield/Textfield.js +2 -1
- package/dist/components/Textfield/components/Container/Container.d.ts +2 -0
- package/dist/components/Textfield/components/Container/Container.js +17 -6
- package/dist/components/Textfield/components/Container/Container.module.js +2 -1
- package/dist/components/Textfield/components/Container/Container_module.css +4 -0
- package/dist/components/Toggle/Toggle.js +1 -1
- package/dist/components/ViewersStack/ViewersStack.js +5 -3
- package/dist/components/_shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.d.ts +12 -0
- package/dist/components/{LabelValueDate/DropdownContent/index.js → _shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.js} +10 -10
- package/dist/components/_shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.module.js +9 -0
- package/dist/components/{LabelValueDate/DropdownContent/DropdownContent_module.css → _shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent_module.css} +6 -6
- package/dist/components/_shared/FieldLabel/FieldLabel.d.ts +18 -0
- package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.js +19 -12
- package/dist/components/_shared/FieldLabel/FieldLabel.module.js +11 -0
- package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel_module.css +8 -8
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.d.ts +1 -1
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.js +2 -2
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.module.js +1 -1
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton_module.css +1 -1
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.d.ts +1 -1
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.js +1 -1
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.module.js +3 -3
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow_module.css +3 -3
- package/dist/components/{Info → _shared/Info}/Info.d.ts +3 -1
- package/dist/components/{Info → _shared/Info}/Info.js +9 -6
- package/dist/components/_shared/Info/Info.module.js +9 -0
- package/dist/components/{Info → _shared/Info}/Info_module.css +6 -6
- package/dist/components/_shared/Info/types/index.d.ts +6 -0
- package/dist/components/_shared/Info/types/index.js +5 -0
- package/dist/components/{InputClear → _shared/InputClear}/InputClear.d.ts +1 -1
- package/dist/components/{InputClear → _shared/InputClear}/InputClear.js +2 -2
- package/dist/components/{InputClear → _shared/InputClear}/InputClear.module.js +3 -3
- package/dist/components/{InputClear → _shared/InputClear}/InputClear_module.css +5 -5
- package/dist/components/_shared/utils/polymorphicClickableTypes.d.ts +17 -0
- package/dist/components/_shared/utils/polymorphicClickableTypes.js +7 -0
- package/dist/data-grid/Filters/DateRangeFilter/DropdownContent/index.js +3 -3
- package/dist/data-grid/Filters/DateRangeFilter/InputContent/index.js +29 -26
- package/dist/data-grid/Filters/DateRangeFilter/PeriodVariantList/index.js +5 -3
- package/dist/data-grid/Filters/DateRangeFilter/Year/index.js +3 -3
- package/dist/data-grid/Filters/DateRangeFilter/consts.js +6 -6
- package/dist/data-grid/Filters/DateRangeFilter/hooks/useMaskInput.js +6 -6
- package/dist/data-grid/Filters/DateRangeFilter/hooks/useSideMenu.js +1 -4
- package/dist/data-grid/Filters/DateRangeFilter/types.d.ts +68 -56
- package/dist/data-grid/Filters/FiltersContainer/FiltersContainer.js +2 -1
- package/dist/data-grid/Filters/FiltersContainer/utils/useRenderParams.d.ts +1 -0
- package/dist/data-grid/Filters/FiltersContainer/utils/useRenderParams.js +14 -6
- package/dist/data-grid/Filters/MultiselectFilter/MultiselectFilter.js +2 -2
- package/dist/data-grid/Filters/OutlineInput/OutlineInput.js +2 -2
- package/dist/data-grid/Filters/OutlineInput/OutlineInput_module.css +1 -1
- package/dist/data-grid/Table/Table_module.css +0 -1
- package/dist/data-grid/cells/ImageCell/ImageMiniature/ImageMiniature_module.css +1 -1
- package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.d.ts +1 -0
- package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.js +17 -5
- package/dist/data-grid/cells/components/TableSelect/TableSelect.js +3 -2
- package/dist/data-grid/headers/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/data-grid/headers/components/HeaderBuilder/HeaderBuilder.js +1 -0
- package/dist/data-grid/index.d.ts +0 -4
- package/dist/data-grid/locale/en-US.js +68 -56
- package/dist/data-grid/locale/ru-RU.js +68 -56
- package/dist/data-grid/locale/useLocale.d.ts +6 -1
- package/dist/data-grid/locale/useLocale.js +14 -5
- package/dist/hooks/useIsElementOverflowing/index.d.ts +1 -0
- package/dist/hooks/useIsElementOverflowing/index.js +8 -2
- package/dist/hooks/useOverflowHint/index.d.ts +7 -0
- package/dist/hooks/useOverflowHint/index.js +16 -0
- package/dist/hooks/useTextField/useTextField.d.ts +1 -1
- package/dist/icon/components/MsLogo12Icon.d.ts +8 -0
- package/dist/icon/components/MsLogo12Icon.js +28 -0
- package/dist/icon/components/MsLogo16Icon.d.ts +8 -0
- package/dist/icon/components/MsLogo16Icon.js +26 -0
- package/dist/icon/components/MsLogo20Icon.d.ts +8 -0
- package/dist/icon/components/MsLogo20Icon.js +28 -0
- package/dist/icon/components/Phone12Icon.d.ts +8 -0
- package/dist/icon/components/Phone12Icon.js +18 -0
- package/dist/icon/components/Phone16Icon.d.ts +8 -0
- package/dist/icon/components/Phone16Icon.js +17 -0
- package/dist/icon/components/Phone20Icon.d.ts +8 -0
- package/dist/icon/components/Phone20Icon.js +18 -0
- package/dist/icon/index.d.ts +6 -0
- package/dist/icon/index.js +6 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +8 -0
- package/dist/utils/checkIsArchivedValue.d.ts +2 -0
- package/dist/utils/checkIsArchivedValue.js +5 -0
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +1 -0
- package/package.json +70 -13
- package/dist/components/FieldLabel/FieldLabel.d.ts +0 -17
- package/dist/components/FieldLabel/FieldLabel.module.js +0 -11
- package/dist/components/Info/Info.module.js +0 -9
- package/dist/components/LabelValue/ValueBlock/index.js +0 -138
- package/dist/components/LabelValue/hooks/useTooltip.d.ts +0 -8
- package/dist/components/LabelValue/hooks/useTooltip.js +0 -16
- package/dist/components/LabelValueDate/DropdownContent/DropdownContent.module.js +0 -9
- package/dist/components/LabelValueDate/DropdownContent/index.d.ts +0 -12
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.d.ts +0 -7
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.js +0 -27
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.module.js +0 -8
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory_module.css +0 -25
- package/dist/components/MentionsTextfield/OptionForStory/index.d.ts +0 -1
- package/dist/components/MentionsTextfield/OptionForStory/index.js +0 -1
- package/dist/components/Textfield/components/Label/Label.d.ts +0 -11
- package/dist/components/Textfield/components/Label/Label.js +0 -38
- package/dist/components/Textfield/components/Label/Label.module.js +0 -7
- package/dist/components/Textfield/components/Label/Label_module.css +0 -17
- package/dist/components/Textfield/components/Label/index.d.ts +0 -1
- package/dist/components/Textfield/components/Label/index.js +0 -1
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.constants.d.ts +0 -0
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.constants.js +0 -0
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/components/index.d.ts +0 -0
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/components/index.js +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { format } from "date-fns";
|
|
4
|
+
import { cn } from "../../common/css/index.js";
|
|
5
|
+
import { mergeRefs } from "../../common/react/mergeRefs.js";
|
|
6
|
+
import { Text } from "../Text/Text.js";
|
|
7
|
+
import { Date16Icon } from "../../icon/index.js";
|
|
8
|
+
import { Datepicker } from "../Datepicker/Datepicker.js";
|
|
9
|
+
import { dateFormatter, parseSelectedDate } from "../Datepicker/utils/index.js";
|
|
10
|
+
import { DROPDOWN_CLOSE_REASON, Dropdown, useDropdown } from "../Dropdown/Dropdown.js";
|
|
11
|
+
import { DropdownContent } from "./DropdownContent/DropdownContent.js";
|
|
12
|
+
import EditableDate_module from "./EditableDate.module.js";
|
|
13
|
+
const omitedDatepickerProps = [
|
|
14
|
+
'isTimeRequired',
|
|
15
|
+
'required',
|
|
16
|
+
'label',
|
|
17
|
+
'helperText',
|
|
18
|
+
'error',
|
|
19
|
+
'inline',
|
|
20
|
+
'frameless',
|
|
21
|
+
'fitInput',
|
|
22
|
+
'customRender',
|
|
23
|
+
'onTimeToggleChange',
|
|
24
|
+
'blurInputOnEsc',
|
|
25
|
+
'blurInputOnEnter',
|
|
26
|
+
'setInitialDateIntoInput',
|
|
27
|
+
'nullableValueWhenTimeIncomplete',
|
|
28
|
+
'placeholder',
|
|
29
|
+
'showTime',
|
|
30
|
+
'blurAfterChange',
|
|
31
|
+
'blurAfterPick'
|
|
32
|
+
];
|
|
33
|
+
const EditableDate = ({ prefix = 'от', selectedDate, localeFormat, dateTimeFormatOptions, disabled, iconPosition = 'end', onDayClick, ...props })=>{
|
|
34
|
+
const buttonRef = useRef(null);
|
|
35
|
+
const inputRef = useRef(null);
|
|
36
|
+
const lastDropdownElementRef = useRef(null);
|
|
37
|
+
const dropdownContentRef = useRef(null);
|
|
38
|
+
const calendarDropdown = useDropdown();
|
|
39
|
+
const [stringValue, setStringValue] = useState(null);
|
|
40
|
+
const formatter = dateFormatter.getFormatter(localeFormat, dateTimeFormatOptions);
|
|
41
|
+
const parsedSelectedDate = useMemo(()=>'string' == typeof selectedDate ? parseSelectedDate(selectedDate, formatter) : selectedDate, [
|
|
42
|
+
selectedDate,
|
|
43
|
+
formatter
|
|
44
|
+
]);
|
|
45
|
+
const dateToString = useCallback((date)=>format(date, formatter.dateTime.format), [
|
|
46
|
+
formatter.dateTime.format
|
|
47
|
+
]);
|
|
48
|
+
const handleDayClick = (date)=>{
|
|
49
|
+
onDayClick?.(date);
|
|
50
|
+
calendarDropdown.handleClose();
|
|
51
|
+
};
|
|
52
|
+
const handleInputKeyDown = (event)=>{
|
|
53
|
+
props.onInputKeyDown?.(event);
|
|
54
|
+
if ('Enter' !== event.key) return;
|
|
55
|
+
calendarDropdown.handleClose?.();
|
|
56
|
+
buttonRef.current?.focus();
|
|
57
|
+
};
|
|
58
|
+
const handleButtonMouseDown = (event)=>{
|
|
59
|
+
if (calendarDropdown.open) {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
useEffect(()=>{
|
|
65
|
+
const stringValue = parsedSelectedDate ? dateToString(parsedSelectedDate) : null;
|
|
66
|
+
setStringValue(stringValue);
|
|
67
|
+
}, [
|
|
68
|
+
dateToString,
|
|
69
|
+
parsedSelectedDate
|
|
70
|
+
]);
|
|
71
|
+
return /*#__PURE__*/ jsx(Datepicker, {
|
|
72
|
+
...props,
|
|
73
|
+
selectedDate: selectedDate,
|
|
74
|
+
localeFormat: localeFormat,
|
|
75
|
+
dateTimeFormatOptions: dateTimeFormatOptions,
|
|
76
|
+
showTime: true,
|
|
77
|
+
isTimeRequired: true,
|
|
78
|
+
inline: true,
|
|
79
|
+
frameless: true,
|
|
80
|
+
fitInput: true,
|
|
81
|
+
setInitialDateIntoInput: true,
|
|
82
|
+
nullableValueWhenTimeIncomplete: true,
|
|
83
|
+
iconPosition: iconPosition,
|
|
84
|
+
blurInputOnEsc: false,
|
|
85
|
+
blurInputOnEnter: false,
|
|
86
|
+
lastElementRef: lastDropdownElementRef,
|
|
87
|
+
inputRef: mergeRefs([
|
|
88
|
+
inputRef,
|
|
89
|
+
props.inputRef
|
|
90
|
+
]),
|
|
91
|
+
onDayClick: handleDayClick,
|
|
92
|
+
onInputKeyDown: handleInputKeyDown,
|
|
93
|
+
customRender: ({ input, calendar })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
94
|
+
children: [
|
|
95
|
+
/*#__PURE__*/ jsxs("button", {
|
|
96
|
+
ref: buttonRef,
|
|
97
|
+
className: cn(EditableDate_module.button, disabled && EditableDate_module.disabled),
|
|
98
|
+
"data-test-id": props.testId,
|
|
99
|
+
onClick: calendarDropdown.handleToggle,
|
|
100
|
+
disabled: disabled,
|
|
101
|
+
onMouseDown: handleButtonMouseDown,
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ jsxs(Text.BodyXL, {
|
|
104
|
+
className: EditableDate_module.title,
|
|
105
|
+
children: [
|
|
106
|
+
prefix,
|
|
107
|
+
" ",
|
|
108
|
+
/*#__PURE__*/ jsx("span", {
|
|
109
|
+
ref: calendarDropdown.triggerRef
|
|
110
|
+
}),
|
|
111
|
+
stringValue
|
|
112
|
+
]
|
|
113
|
+
}),
|
|
114
|
+
/*#__PURE__*/ jsx("div", {
|
|
115
|
+
className: EditableDate_module.iconContainer,
|
|
116
|
+
children: /*#__PURE__*/ jsx(Date16Icon, {})
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
}),
|
|
120
|
+
/*#__PURE__*/ jsx(Dropdown, {
|
|
121
|
+
open: calendarDropdown.open,
|
|
122
|
+
onClose: (reason)=>{
|
|
123
|
+
calendarDropdown.handleClose();
|
|
124
|
+
if (reason === DROPDOWN_CLOSE_REASON.ESCAPE) buttonRef.current?.focus();
|
|
125
|
+
},
|
|
126
|
+
triggerRef: calendarDropdown.triggerRef,
|
|
127
|
+
offsetY: -39,
|
|
128
|
+
shouldIgnoreOutsideInteraction: (element)=>dropdownContentRef.current?.contains(element) ?? false,
|
|
129
|
+
children: /*#__PURE__*/ jsx(DropdownContent, {
|
|
130
|
+
ref: dropdownContentRef,
|
|
131
|
+
testId: props.testId,
|
|
132
|
+
calendar: calendar,
|
|
133
|
+
input: input,
|
|
134
|
+
inputRef: inputRef,
|
|
135
|
+
lastDropdownElementRef: lastDropdownElementRef
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
export { EditableDate, omitedDatepickerProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.button-URdOeG {
|
|
2
|
+
all: unset;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
padding-top: 2px;
|
|
7
|
+
display: flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.button-URdOeG:hover, .button-URdOeG:active {
|
|
11
|
+
text-decoration: underline;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.disabled-wlENxh {
|
|
15
|
+
cursor: default;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.disabled-wlENxh:hover, .disabled-wlENxh:active {
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.button-URdOeG:focus-visible {
|
|
23
|
+
outline: 1px solid var(--border-focused, #091739);
|
|
24
|
+
outline-offset: -1px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.iconContainer-EFdoq_ {
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding-bottom: 2px;
|
|
30
|
+
display: flex;
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type IHasTestId } from '../../common/types';
|
|
3
3
|
declare const titleComponents: {
|
|
4
4
|
readonly H2: import("../Text/utils/polymorphicTextRef").TextComponent<import("../Text/components/types").TextVariantProps, "h2">;
|
|
@@ -8,6 +8,7 @@ declare const titleComponents: {
|
|
|
8
8
|
export interface EditableTitleProps extends IHasTestId {
|
|
9
9
|
onApplyValidValue?: (value: string) => void;
|
|
10
10
|
onChangeWithValidation?: (value: string) => string | undefined;
|
|
11
|
+
onToggle?: (isEdit: boolean) => void;
|
|
11
12
|
className?: string;
|
|
12
13
|
defaultValue?: string;
|
|
13
14
|
titleComponent?: keyof typeof titleComponents;
|
|
@@ -16,6 +17,10 @@ export interface EditableTitleProps extends IHasTestId {
|
|
|
16
17
|
maxWidth?: number;
|
|
17
18
|
maxLength?: number;
|
|
18
19
|
overflowTextAlert?: string;
|
|
20
|
+
prefix?: string;
|
|
21
|
+
titleClassName?: string;
|
|
22
|
+
inputWrapperClassName?: string;
|
|
23
|
+
hintZIndex?: number;
|
|
19
24
|
}
|
|
20
|
-
export declare const EditableTitle:
|
|
25
|
+
export declare const EditableTitle: React.MemoExoticComponent<React.ForwardRefExoticComponent<EditableTitleProps & React.RefAttributes<HTMLDivElement>>>;
|
|
21
26
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { forwardRef, memo, useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { useLatestValue } from "@dnd-kit/utilities";
|
|
4
4
|
import { cn } from "../../common/css/cn.js";
|
|
5
5
|
import { HintWithSkip } from "../_shared/HintWithSkip/HintWithSkip.js";
|
|
@@ -15,7 +15,7 @@ const titleComponents = {
|
|
|
15
15
|
H3: Text.H3,
|
|
16
16
|
BodyXL: Text.BodyXL
|
|
17
17
|
};
|
|
18
|
-
const EditableTitle = /*#__PURE__*/ memo(({ testId, className, onApplyValidValue, onChangeWithValidation, defaultValue, hintText, titleComponent = 'H2', withoutSaveButton = false, maxWidth, maxLength, overflowTextAlert })=>{
|
|
18
|
+
const EditableTitle = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(({ testId, className, onApplyValidValue, onChangeWithValidation, onToggle, defaultValue, hintText, titleComponent = 'H2', withoutSaveButton = false, maxWidth, maxLength, overflowTextAlert, prefix, titleClassName, inputWrapperClassName, hintZIndex }, ref)=>{
|
|
19
19
|
const [isEdit, setIsEdit] = useState(!defaultValue);
|
|
20
20
|
const [value, setValue] = useState((defaultValue ?? '').substring(0, maxLength));
|
|
21
21
|
const [alertHintText, setAlertHintText] = useState('');
|
|
@@ -25,9 +25,17 @@ const EditableTitle = /*#__PURE__*/ memo(({ testId, className, onApplyValidValue
|
|
|
25
25
|
const timeoutIdRef = useRef();
|
|
26
26
|
const isDirtyRef = useRef(false);
|
|
27
27
|
const Title = titleComponents[titleComponent];
|
|
28
|
+
const changeEditMode = useCallback((isEdit)=>{
|
|
29
|
+
if (onToggle) onToggle(isEdit);
|
|
30
|
+
setIsEdit(isEdit);
|
|
31
|
+
}, [
|
|
32
|
+
onToggle
|
|
33
|
+
]);
|
|
28
34
|
const handleClickTitle = useCallback(()=>{
|
|
29
|
-
|
|
30
|
-
}, [
|
|
35
|
+
changeEditMode(true);
|
|
36
|
+
}, [
|
|
37
|
+
changeEditMode
|
|
38
|
+
]);
|
|
31
39
|
const handleClearInput = useCallback(()=>{
|
|
32
40
|
setValue('');
|
|
33
41
|
}, []);
|
|
@@ -39,12 +47,13 @@ const EditableTitle = /*#__PURE__*/ memo(({ testId, className, onApplyValidValue
|
|
|
39
47
|
setAlertHintText(error);
|
|
40
48
|
setIsError(!!error);
|
|
41
49
|
if (error) return;
|
|
42
|
-
|
|
50
|
+
changeEditMode(!inputValue);
|
|
43
51
|
onApplyValidValue?.(inputValue);
|
|
44
52
|
isDirtyRef.current = false;
|
|
45
53
|
timeoutIdRef.current = void 0;
|
|
46
54
|
clearTimeout(timeoutIdRef.current);
|
|
47
55
|
}, [
|
|
56
|
+
changeEditMode,
|
|
48
57
|
latestValue,
|
|
49
58
|
onApplyValidValue,
|
|
50
59
|
onChangeWithValidation
|
|
@@ -101,7 +110,15 @@ const EditableTitle = /*#__PURE__*/ memo(({ testId, className, onApplyValidValue
|
|
|
101
110
|
useEffect(()=>()=>{
|
|
102
111
|
clearTimeout(timeoutIdRef.current);
|
|
103
112
|
}, []);
|
|
113
|
+
const trimmedPrefix = prefix?.trim();
|
|
114
|
+
const formattedPrefix = trimmedPrefix ? /*#__PURE__*/ jsxs(Fragment, {
|
|
115
|
+
children: [
|
|
116
|
+
trimmedPrefix,
|
|
117
|
+
"\xa0"
|
|
118
|
+
]
|
|
119
|
+
}) : null;
|
|
104
120
|
return /*#__PURE__*/ jsx("div", {
|
|
121
|
+
ref: ref,
|
|
105
122
|
"data-test-id": testId,
|
|
106
123
|
className: cn(EditableTitle_module.wrapper, className),
|
|
107
124
|
style: {
|
|
@@ -109,28 +126,39 @@ const EditableTitle = /*#__PURE__*/ memo(({ testId, className, onApplyValidValue
|
|
|
109
126
|
},
|
|
110
127
|
children: isEdit ? /*#__PURE__*/ jsxs(Fragment, {
|
|
111
128
|
children: [
|
|
112
|
-
/*#__PURE__*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
/*#__PURE__*/ jsxs("div", {
|
|
130
|
+
className: cn(EditableTitle_module.inputWrapper, inputWrapperClassName),
|
|
131
|
+
children: [
|
|
132
|
+
formattedPrefix && /*#__PURE__*/ jsx(Title, {
|
|
133
|
+
testId: testId ? `${testId}-prefix` : void 0,
|
|
134
|
+
tabIndex: -1,
|
|
135
|
+
children: formattedPrefix
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ jsx(HintWithSkip, {
|
|
138
|
+
skip: !alertHintText,
|
|
139
|
+
variant: HintVariant.Alert,
|
|
140
|
+
placement: Placement.BOTTOM,
|
|
141
|
+
visible: true,
|
|
142
|
+
overlay: /*#__PURE__*/ jsx(Text.Body, {
|
|
143
|
+
testId: testId ? `${testId}-alert-hint` : void 0,
|
|
144
|
+
colorToken: TextColor.critical,
|
|
145
|
+
children: alertHintText
|
|
146
|
+
}),
|
|
147
|
+
zIndex: hintZIndex,
|
|
148
|
+
children: /*#__PURE__*/ jsx(Input, {
|
|
149
|
+
testId: testId ? `${testId}-input` : void 0,
|
|
150
|
+
ref: inputRefCb,
|
|
151
|
+
name: "EditableTitleInput",
|
|
152
|
+
clearable: true,
|
|
153
|
+
onClear: handleClearInput,
|
|
154
|
+
value: value,
|
|
155
|
+
onChange: handleChangeInput,
|
|
156
|
+
error: isError,
|
|
157
|
+
autoComplete: "off",
|
|
158
|
+
onBlur: handleBlurInput
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
]
|
|
134
162
|
}),
|
|
135
163
|
!withoutSaveButton && /*#__PURE__*/ jsx(Button, {
|
|
136
164
|
testId: testId ? `${testId}-button` : void 0,
|
|
@@ -149,16 +177,20 @@ const EditableTitle = /*#__PURE__*/ memo(({ testId, className, onApplyValidValue
|
|
|
149
177
|
colorToken: TextColor.invert,
|
|
150
178
|
children: hintText
|
|
151
179
|
}),
|
|
152
|
-
|
|
180
|
+
zIndex: hintZIndex,
|
|
181
|
+
children: /*#__PURE__*/ jsxs(Title, {
|
|
153
182
|
testId: testId ? `${testId}-title` : void 0,
|
|
154
|
-
className: EditableTitle_module.title,
|
|
183
|
+
className: cn(EditableTitle_module.title, titleClassName),
|
|
155
184
|
onClick: handleClickTitle,
|
|
156
185
|
tabIndex: 0,
|
|
157
186
|
onKeyDown: handleEnterDownOnTitle,
|
|
158
|
-
children:
|
|
187
|
+
children: [
|
|
188
|
+
formattedPrefix,
|
|
189
|
+
value
|
|
190
|
+
]
|
|
159
191
|
})
|
|
160
192
|
})
|
|
161
193
|
});
|
|
162
|
-
});
|
|
194
|
+
}));
|
|
163
195
|
EditableTitle.displayName = 'EditableTitle';
|
|
164
196
|
export { EditableTitle };
|
|
@@ -30,5 +30,5 @@ export declare namespace EmptyState {
|
|
|
30
30
|
var displayName: string;
|
|
31
31
|
var Actions: ({ className, leftButtonSlot, centralButtonSlot, rightButtonSlot, ...restProps }: import("./Actions/Actions").ActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
32
32
|
var Image: typeof import("../_shared/Image/Image").Image;
|
|
33
|
-
var Button: import("
|
|
33
|
+
var Button: import("../_shared/utils/polymorphicClickableTypes").ClickableComponent<import("../Button/Button").ButtonOwnProps, "button">;
|
|
34
34
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import { type IHasTestId, type ValueOf } from '../../common/types';
|
|
3
|
+
export declare const InformerVariant: {
|
|
4
|
+
readonly blue: "blue";
|
|
5
|
+
readonly green: "green";
|
|
6
|
+
readonly red: "red";
|
|
7
|
+
};
|
|
8
|
+
export type InformerVariantValue = ValueOf<typeof InformerVariant>;
|
|
9
|
+
export type RenderTitleParams = {
|
|
10
|
+
title?: string;
|
|
11
|
+
testId?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Встроенный неинтерактивный информационный блок для контекста экрана или объекта
|
|
15
|
+
* (состояние, ограничение, пояснение логики). Без кнопок, ссылок и закрытия.
|
|
16
|
+
*
|
|
17
|
+
* По умолчанию `variant=blue`.
|
|
18
|
+
* Расширяется по ширине родителя.
|
|
19
|
+
*
|
|
20
|
+
* Ширину можно задать через родителя или через className.
|
|
21
|
+
*
|
|
22
|
+
* Текст должен быть кратким. В коде нет проверки длины; если сообщение занимает
|
|
23
|
+
* больше 4 строк, необходимо согласовать с дизайнером другой компонент.
|
|
24
|
+
*
|
|
25
|
+
* @param title - заголовок (опционально)
|
|
26
|
+
* @param description - основной текст
|
|
27
|
+
* @param variant - цветовой вариант отображения: blue (по умолчанию), green, red
|
|
28
|
+
* @param renderTitle - кастомный рендер заголовка. Можно передать в него пропу title, можно без title
|
|
29
|
+
*/
|
|
30
|
+
export interface InformerProps extends IHasTestId {
|
|
31
|
+
title?: string;
|
|
32
|
+
description: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
variant?: InformerVariantValue;
|
|
35
|
+
renderTitle?: (params: RenderTitleParams) => JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
export declare const Informer: import("react").ForwardRefExoticComponent<InformerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../../common/css/cn.js";
|
|
4
|
+
import { Text } from "../Text/Text.js";
|
|
5
|
+
import Informer_module from "./Informer.module.js";
|
|
6
|
+
const InformerVariant = {
|
|
7
|
+
blue: 'blue',
|
|
8
|
+
green: 'green',
|
|
9
|
+
red: 'red'
|
|
10
|
+
};
|
|
11
|
+
const defaultRenderTitle = ({ title, testId })=>title && /*#__PURE__*/ jsx(Text.BodyStrong, {
|
|
12
|
+
className: Informer_module.title,
|
|
13
|
+
testId: testId,
|
|
14
|
+
children: title
|
|
15
|
+
});
|
|
16
|
+
const Informer = /*#__PURE__*/ forwardRef(({ variant = InformerVariant.blue, testId, title, renderTitle: renderTitleProp, description, className }, ref)=>{
|
|
17
|
+
const renderTitle = renderTitleProp ?? defaultRenderTitle;
|
|
18
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
19
|
+
ref: ref,
|
|
20
|
+
role: "status",
|
|
21
|
+
"data-test-id": testId,
|
|
22
|
+
className: cn(Informer_module.container, Informer_module[variant], className),
|
|
23
|
+
children: [
|
|
24
|
+
renderTitle({
|
|
25
|
+
title,
|
|
26
|
+
testId: testId ? `${testId}-title` : void 0
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ jsx(Text.Body, {
|
|
29
|
+
testId: testId ? `${testId}-description` : void 0,
|
|
30
|
+
children: description
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
Informer.displayName = 'Informer';
|
|
36
|
+
export { Informer, InformerVariant };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.container-c0TyOV {
|
|
2
|
+
--informer-bg-color: var(--elements-bg-pressed);
|
|
3
|
+
--informer-border-color: var(--elements-accent);
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
background-color: var(--informer-bg-color);
|
|
6
|
+
border-left: 2px solid var(--informer-border-color);
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 4px;
|
|
10
|
+
width: 100%;
|
|
11
|
+
padding: 8px 12px 12px;
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.green-Ib8KMk {
|
|
16
|
+
--informer-bg-color: var(--badge-green-bgd);
|
|
17
|
+
--informer-border-color: var(--elements-positive);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.red-N9Z4qO {
|
|
21
|
+
--informer-bg-color: var(--badge-red-bgd);
|
|
22
|
+
--informer-border-color: var(--elements-critical);
|
|
23
|
+
}
|
|
24
|
+
|
|
@@ -2,10 +2,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useRef } from "react";
|
|
3
3
|
import { cn } from "../../common/css/cn.js";
|
|
4
4
|
import { createSyntheticEvent } from "../../common/react/createSyntheticEvent.js";
|
|
5
|
-
import { FieldLabel } from "../FieldLabel/FieldLabel.js";
|
|
6
|
-
import { FieldRow } from "../FieldRow/FieldRow.js";
|
|
5
|
+
import { FieldLabel } from "../_shared/FieldLabel/FieldLabel.js";
|
|
6
|
+
import { FieldRow } from "../_shared/FieldRow/FieldRow.js";
|
|
7
|
+
import { InfoSize } from "../_shared/Info/types/index.js";
|
|
8
|
+
import { InputClear } from "../_shared/InputClear/InputClear.js";
|
|
7
9
|
import { InfoBlock } from "./components/InfoBlock.js";
|
|
8
|
-
import {
|
|
10
|
+
import { TextVariant } from "../Text/Text.js";
|
|
9
11
|
import { useId } from "../../hooks/useId/index.js";
|
|
10
12
|
import { useIsElementOverflowing } from "../../hooks/useIsElementOverflowing/index.js";
|
|
11
13
|
import Input_module from "./Input.module.js";
|
|
@@ -22,6 +24,7 @@ const Input = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, inputClas
|
|
|
22
24
|
const ignoreBlurRef = useRef(false);
|
|
23
25
|
const largeStyle = 'L' === inputSize && Input_module.large;
|
|
24
26
|
const inputValue = String(value ?? '');
|
|
27
|
+
const labelVariant = 'L' === inputSize ? TextVariant.bodyL : TextVariant.body;
|
|
25
28
|
const handleChange = (e)=>{
|
|
26
29
|
onChange?.(e);
|
|
27
30
|
};
|
|
@@ -71,7 +74,8 @@ const Input = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, inputClas
|
|
|
71
74
|
htmlFor: inputId,
|
|
72
75
|
testId: testId,
|
|
73
76
|
className: Input_module.label,
|
|
74
|
-
helpProps: helpProps
|
|
77
|
+
helpProps: helpProps,
|
|
78
|
+
variant: labelVariant
|
|
75
79
|
}),
|
|
76
80
|
/*#__PURE__*/ jsx(FieldRow, {
|
|
77
81
|
helpComponent: helpComponent,
|
|
@@ -146,7 +150,8 @@ const Input = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, inputClas
|
|
|
146
150
|
maxLength: maxLength,
|
|
147
151
|
disabled: disabled,
|
|
148
152
|
showCounterLimit: showCounterLimit,
|
|
149
|
-
error: error
|
|
153
|
+
error: error,
|
|
154
|
+
size: 'L' === inputSize ? InfoSize.L : InfoSize.M
|
|
150
155
|
})
|
|
151
156
|
]
|
|
152
157
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type InfoSizeValue } from '../../_shared/Info/types';
|
|
1
2
|
type InfoBlockProps = {
|
|
2
3
|
info?: string;
|
|
3
4
|
error?: boolean;
|
|
@@ -7,6 +8,7 @@ type InfoBlockProps = {
|
|
|
7
8
|
showCounterLimit?: boolean;
|
|
8
9
|
maxLength?: number;
|
|
9
10
|
value?: string;
|
|
11
|
+
size?: InfoSizeValue;
|
|
10
12
|
};
|
|
11
|
-
export declare const InfoBlock: ({ info, error, disabled, isInfoEllipsis, testId, maxLength, showCounterLimit, value, }: InfoBlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export declare const InfoBlock: ({ info, error, disabled, isInfoEllipsis, testId, maxLength, showCounterLimit, value, size, }: InfoBlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
14
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Info } from "../../Info/Info.js";
|
|
2
|
+
import { Info } from "../../_shared/Info/Info.js";
|
|
3
|
+
import { InfoSize } from "../../_shared/Info/types/index.js";
|
|
3
4
|
import { Counter } from "../../Textfield/components/Counter/Counter.js";
|
|
4
5
|
import Input_module from "../Input.module.js";
|
|
5
|
-
const InfoBlock = ({ info, error, disabled, isInfoEllipsis, testId, maxLength, showCounterLimit, value })=>{
|
|
6
|
+
const InfoBlock = ({ info, error, disabled, isInfoEllipsis, testId, maxLength, showCounterLimit, value, size = InfoSize.M })=>{
|
|
6
7
|
if (!info && !showCounterLimit && !maxLength) return null;
|
|
7
8
|
return /*#__PURE__*/ jsxs("div", {
|
|
8
9
|
className: Input_module.infoBlock,
|
|
@@ -14,14 +15,16 @@ const InfoBlock = ({ info, error, disabled, isInfoEllipsis, testId, maxLength, s
|
|
|
14
15
|
error: error,
|
|
15
16
|
disabled: disabled,
|
|
16
17
|
isEllipsis: isInfoEllipsis,
|
|
17
|
-
testId: testId
|
|
18
|
+
testId: testId,
|
|
19
|
+
size: size
|
|
18
20
|
})
|
|
19
21
|
}),
|
|
20
22
|
showCounterLimit && maxLength && /*#__PURE__*/ jsx(Counter, {
|
|
21
23
|
testId: testId,
|
|
22
24
|
value: value,
|
|
23
25
|
hasHelp: false,
|
|
24
|
-
limit: maxLength
|
|
26
|
+
limit: maxLength,
|
|
27
|
+
size: size
|
|
25
28
|
})
|
|
26
29
|
]
|
|
27
30
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { cn } from "../../common/css/cn.js";
|
|
4
|
+
import { FieldLabel } from "../_shared/FieldLabel/FieldLabel.js";
|
|
5
|
+
import { FieldRow } from "../_shared/FieldRow/FieldRow.js";
|
|
6
|
+
import { Info } from "../_shared/Info/Info.js";
|
|
7
|
+
import { InputClear } from "../_shared/InputClear/InputClear.js";
|
|
4
8
|
import { Chip } from "../Chip/Chip.js";
|
|
5
9
|
import { Dropdown } from "../Dropdown/Dropdown.js";
|
|
6
10
|
import { useDropdown } from "../Dropdown/hooks/useDropdown.js";
|
|
7
11
|
import { getListboxTriggerA11y } from "../Dropdown/utils/getListboxTriggerA11y.js";
|
|
8
|
-
import { FieldLabel } from "../FieldLabel/FieldLabel.js";
|
|
9
|
-
import { FieldRow } from "../FieldRow/FieldRow.js";
|
|
10
|
-
import { Info } from "../Info/Info.js";
|
|
11
|
-
import { InputClear } from "../InputClear/InputClear.js";
|
|
12
12
|
import { OptionsList } from "../Select/OptionsList/OptionsList.js";
|
|
13
13
|
import { TextColor } from "../Text/Text.js";
|
|
14
14
|
import { useId } from "../../hooks/useId/index.js";
|