@via-profit/ui-kit 0.5.0 → 0.7.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/Accordion/AccordionActions.d.ts +1 -1
- package/Accordion/AccordionActions.js +2 -1
- package/Accordion/AccordionContainer.d.ts +1 -1
- package/Accordion/AccordionContainer.js +2 -14
- package/Accordion/AccordionContent.d.ts +1 -1
- package/Accordion/AccordionContent.js +5 -1
- package/Accordion/AccordionHeader.d.ts +2 -2
- package/Accordion/AccordionHeader.js +6 -2
- package/Accordion/index.d.ts +9 -9
- package/Accordion/index.js +18 -9
- package/Autocomplete/AutocompleteContainer.d.ts +2 -2
- package/Autocomplete/AutocompleteContainer.js +17 -7
- package/Autocomplete/AutocompleteItem.js +2 -1
- package/Autocomplete/context.d.ts +3 -3
- package/Autocomplete/index.d.ts +2 -2
- package/Avatar/AvatarContainer.d.ts +2 -2
- package/Avatar/AvatarPicture.d.ts +2 -2
- package/Avatar/index.js +1 -2
- package/Badge/BadgeBase.d.ts +1 -1
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeDeleteButton.d.ts +2 -2
- package/Badge/BadgeStyled.js +1 -1
- package/Badge/index.d.ts +1 -1
- package/Badge/index.js +1 -2
- package/Button/ButtonBase.d.ts +2 -2
- package/Button/ButtonContainer.d.ts +4 -4
- package/Button/ButtonContainer.js +22 -5
- package/Button/ButtonIconWrapper.d.ts +1 -1
- package/Button/ButtonStyled.d.ts +1 -1
- package/Button/ButtonTextWrapper.d.ts +1 -1
- package/Button/buttonVariants.d.ts +1 -1
- package/Button/buttonVariants.js +3 -2
- package/Button/index.d.ts +1 -1
- package/Button/index.js +1 -20
- package/ButtonGroup/index.js +4 -3
- package/CHANGELOG.md +49 -1
- package/Calendar/CalendarComponent.js +18 -9
- package/Calendar/CalendarControlButton.d.ts +2 -2
- package/Calendar/CalendarPaper.js +1 -1
- package/Calendar/CalendarWeekDayLabel.d.ts +2 -2
- package/Calendar/CalendarWeekRowButton.d.ts +1 -1
- package/Calendar/IconChevronDown.js +17 -7
- package/Calendar/index.d.ts +1 -1
- package/Calendar/index.js +17 -7
- package/Checkbox/CheckboxAsterisk.js +17 -7
- package/Checkbox/CheckboxBox.d.ts +2 -2
- package/Checkbox/CheckboxBox.js +1 -1
- package/Checkbox/CheckboxContainer.d.ts +2 -2
- package/Checkbox/CheckboxErrorText.js +17 -7
- package/Checkbox/index.d.ts +10 -10
- package/Checkbox/index.js +1 -2
- package/Checkbox/useCheckboxColor.d.ts +1 -1
- package/ClickOutside/index.js +5 -2
- package/DatePicker/index.d.ts +1 -1
- package/ErrorBoundary/RenderError.js +17 -7
- package/ErrorBoundary/index.d.ts +1 -1
- package/Grid/index.d.ts +17 -5
- package/Grid/index.js +7 -2
- package/Highlighted/index.js +1 -2
- package/LoadingIndicator/LoadingOverlay.js +17 -7
- package/LoadingIndicator/Spinner.js +17 -7
- package/LoadingIndicator/SpinnerCircle.d.ts +2 -3
- package/Menu/MenuContainer.d.ts +2 -2
- package/Menu/MenuContainer.js +19 -10
- package/Menu/MenuItem.js +5 -1
- package/Menu/MenuList.js +1 -1
- package/Menu/context.d.ts +1 -1
- package/Menu/index.d.ts +1 -1
- package/Modal/BaseModal/ModalInner.js +2 -0
- package/Modal/BaseModal/ModalWrapper.js +30 -37
- package/Modal/BaseModal/context.d.ts +1 -1
- package/Modal/BaseModal/index.js +1 -2
- package/Modal/ConfirmBox/ConfirmBoxContent.js +5 -1
- package/Modal/ConfirmBox/ConfirmBoxFooter.js +5 -1
- package/Modal/ConfirmBox/ConfirmBoxHeader.js +5 -1
- package/Modal/ConfirmBox/index.js +1 -2
- package/Modal/Dialog/DialogInner.js +5 -1
- package/Modal/Dialog/index.js +18 -9
- package/Modal/Drawer/DrawerCloseIcon.js +17 -7
- package/Modal/Drawer/DrawerFooter.js +5 -1
- package/Modal/Drawer/DrawerHeader.d.ts +4 -4
- package/Modal/Drawer/DrawerHeader.js +5 -1
- package/Modal/Drawer/index.js +18 -9
- package/Modal/MessageBox/MessageBoxContent.js +5 -1
- package/Modal/MessageBox/MessageBoxFooter.js +5 -1
- package/Modal/MessageBox/MessageBoxHeader.js +5 -1
- package/Modal/MessageBox/index.js +18 -9
- package/Modal/index.js +17 -7
- package/Pagination/PaginationContainer.d.ts +9 -0
- package/Pagination/PaginationContainer.js +34 -0
- package/Pagination/PaginationGap.d.ts +4 -0
- package/Pagination/PaginationGap.js +22 -0
- package/Pagination/PaginationIcons.d.ts +6 -0
- package/Pagination/PaginationIcons.js +21 -0
- package/Pagination/PaginationItem.d.ts +44 -0
- package/Pagination/PaginationItem.js +59 -0
- package/Pagination/getPaginationItems.d.ts +22 -0
- package/Pagination/getPaginationItems.js +42 -0
- package/Pagination/index.d.ts +104 -0
- package/Pagination/index.js +98 -0
- package/Pagination/usePagination.d.ts +105 -0
- package/Pagination/usePagination.js +66 -0
- package/PhoneField/CountryFlagComponent.d.ts +1 -1
- package/PhoneField/UnknownFlag.d.ts +0 -1
- package/PhoneField/flags/BY.js +17 -7
- package/PhoneField/flags/CN.js +17 -7
- package/PhoneField/flags/IL.js +17 -7
- package/PhoneField/flags/JP.js +17 -7
- package/PhoneField/flags/KZ.js +17 -7
- package/PhoneField/flags/RU.js +17 -7
- package/PhoneField/flags/UA.js +17 -7
- package/PhoneField/flags/US.js +17 -7
- package/PhoneField/flags/Unknown.js +17 -7
- package/PhoneField/templates.d.ts +2 -2
- package/Popper/Popper.js +1 -2
- package/Radio/RadioBox.d.ts +1 -1
- package/Radio/RadioBox.js +1 -1
- package/Radio/RadioContainer.d.ts +2 -2
- package/Radio/index.d.ts +5 -5
- package/Radio/index.js +1 -2
- package/Radio/useRadioColor.d.ts +1 -1
- package/RadioGroup/RadioGroupAsterisk.js +17 -7
- package/RadioGroup/RadioGroupErrorText.js +17 -7
- package/RadioGroup/RadioGroupItems.d.ts +1 -1
- package/RadioGroup/index.d.ts +11 -11
- package/RadioGroup/index.js +1 -2
- package/Selectbox/SelectboxButton.d.ts +4 -4
- package/Selectbox/SelectboxButton.js +25 -10
- package/Selectbox/SelectboxButtonWrapper.d.ts +2 -2
- package/Selectbox/SelectboxButtonWrapper.js +19 -10
- package/Selectbox/SelectboxMenu.d.ts +2 -2
- package/Selectbox/SelectboxMenu.js +17 -7
- package/Selectbox/index.d.ts +2 -2
- package/Selectbox/index.js +18 -9
- package/Slider/SliderRail.d.ts +1 -1
- package/Slider/SliderThumb.d.ts +1 -1
- package/Slider/SliderTrack.d.ts +1 -1
- package/Slider/index.js +1 -2
- package/Slider/useSliderColor.d.ts +1 -1
- package/Stack/index.d.ts +18 -6
- package/Stack/index.js +7 -2
- package/Surface/SurfaceContainer.d.ts +3 -3
- package/Surface/SurfaceContainer.js +1 -1
- package/Surface/SurfaceContent.d.ts +2 -2
- package/Surface/SurfaceContent.js +18 -11
- package/Surface/SurfaceFooter.d.ts +2 -2
- package/Surface/SurfaceFooter.js +5 -1
- package/Surface/SurfaceHeader.d.ts +2 -2
- package/Surface/SurfaceHeader.js +6 -2
- package/Surface/SurfaceSubheader.d.ts +2 -2
- package/Surface/SurfaceSubheader.js +6 -2
- package/Surface/index.d.ts +10 -10
- package/Surface/index.js +18 -9
- package/Swiper/Swiper.d.ts +83 -15
- package/Swiper/Swiper.js +285 -143
- package/Swiper/SwiperContainer.d.ts +2 -2
- package/Swiper/SwiperSlide.js +20 -7
- package/Swiper/SwiperSlidesRenderer.d.ts +4 -0
- package/Swiper/SwiperSlidesRenderer.js +19 -8
- package/Swiper/SwiperTrack.d.ts +22 -2
- package/Swiper/SwiperTrack.js +45 -12
- package/Swiper/SwiperWrapper.d.ts +5 -2
- package/Swiper/SwiperWrapper.js +22 -11
- package/Switch/SwitchAsterisk.js +17 -7
- package/Switch/SwitchContainer.d.ts +2 -2
- package/Switch/SwitchDot.d.ts +1 -1
- package/Switch/SwitchDot.js +2 -4
- package/Switch/SwitchErrorText.js +17 -7
- package/Switch/SwitchTrack.d.ts +1 -1
- package/Switch/index.d.ts +9 -9
- package/Switch/index.js +1 -2
- package/Switch/useSwitchColor.d.ts +1 -1
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +1 -1
- package/Table/TableCaption.js +5 -1
- package/Table/TableCell.js +6 -2
- package/Table/TableFooter.js +2 -1
- package/Table/TableHeaderCell.js +6 -2
- package/Tabs/Tab.js +4 -1
- package/Tabs/TabPanel.d.ts +1 -1
- package/Tabs/Tabs.d.ts +7 -7
- package/Tabs/Tabs.js +1 -2
- package/Tabs/useTabsColor.d.ts +1 -1
- package/TextArea/TextAreaIconWrapper.d.ts +3 -3
- package/TextArea/TextAreaIconWrapper.js +17 -7
- package/TextArea/TextAreaInput.js +23 -8
- package/TextArea/index.js +18 -9
- package/TextField/TextFieldContainer.js +17 -7
- package/TextField/TextFieldErrorText.js +17 -7
- package/TextField/TextFieldIconWrapper.d.ts +3 -3
- package/TextField/TextFieldIconWrapper.js +17 -7
- package/TextField/TextFieldInput.js +23 -8
- package/TextField/TextFieldInputWrapper.d.ts +5 -5
- package/TextField/TextFieldInputWrapper.js +22 -9
- package/TextField/TextFieldLabel.js +17 -7
- package/TextField/TextFieldLabelAsterisk.js +17 -7
- package/TextField/index.d.ts +1 -1
- package/TextField/index.js +18 -9
- package/ThemeProvider/createTheme.js +7 -3
- package/ThemeProvider/index.d.ts +45 -12
- package/ThemeProvider/index.js +1 -4
- package/ThemeProvider/tokens.d.ts +54 -3
- package/ThemeProvider/tokens.js +61 -3
- package/Toast/ToastCard.js +5 -2
- package/Toast/ToastContainer.js +1 -2
- package/Tooltip/TooltipContainer.js +2 -0
- package/Tooltip/index.js +3 -4
- package/Typography/Base.d.ts +2 -3
- package/Typography/Blockquote.d.ts +2 -3
- package/Typography/List.d.ts +6 -7
- package/Typography/Paragraph.d.ts +1 -1
- package/Typography/Paragraph.js +17 -7
- package/Typography/SectionDescription.d.ts +2 -3
- package/Typography/U.d.ts +2 -3
- package/esm/Accordion/AccordionActions.js +2 -1
- package/esm/Accordion/AccordionContainer.js +2 -14
- package/esm/Accordion/AccordionContent.js +5 -1
- package/esm/Accordion/AccordionHeader.js +7 -3
- package/esm/Accordion/index.js +1 -2
- package/esm/Autocomplete/AutocompleteItem.js +2 -1
- package/esm/Avatar/index.js +1 -2
- package/esm/Badge/BadgeStyled.js +2 -2
- package/esm/Badge/index.js +1 -2
- package/esm/Button/ButtonContainer.js +23 -6
- package/esm/Button/buttonVariants.js +3 -2
- package/esm/Button/index.js +1 -20
- package/esm/ButtonGroup/index.js +4 -3
- package/esm/Calendar/CalendarComponent.js +1 -2
- package/esm/Calendar/CalendarPaper.js +1 -1
- package/esm/Checkbox/CheckboxBox.js +2 -2
- package/esm/Checkbox/index.js +1 -2
- package/esm/ClickOutside/index.js +5 -2
- package/esm/Grid/index.js +7 -2
- package/esm/Highlighted/index.js +1 -2
- package/esm/Menu/MenuContainer.js +2 -3
- package/esm/Menu/MenuItem.js +5 -1
- package/esm/Menu/MenuList.js +1 -1
- package/esm/Modal/BaseModal/ModalInner.js +2 -0
- package/esm/Modal/BaseModal/ModalWrapper.js +30 -37
- package/esm/Modal/BaseModal/index.js +1 -2
- package/esm/Modal/ConfirmBox/ConfirmBoxContent.js +5 -1
- package/esm/Modal/ConfirmBox/ConfirmBoxFooter.js +5 -1
- package/esm/Modal/ConfirmBox/ConfirmBoxHeader.js +5 -1
- package/esm/Modal/ConfirmBox/index.js +1 -2
- package/esm/Modal/Dialog/DialogInner.js +5 -1
- package/esm/Modal/Dialog/index.js +1 -2
- package/esm/Modal/Drawer/DrawerFooter.js +5 -1
- package/esm/Modal/Drawer/DrawerHeader.js +5 -1
- package/esm/Modal/Drawer/index.js +1 -2
- package/esm/Modal/MessageBox/MessageBoxContent.js +5 -1
- package/esm/Modal/MessageBox/MessageBoxFooter.js +5 -1
- package/esm/Modal/MessageBox/MessageBoxHeader.js +5 -1
- package/esm/Modal/MessageBox/index.js +1 -2
- package/esm/Pagination/PaginationContainer.js +29 -0
- package/esm/Pagination/PaginationGap.js +17 -0
- package/esm/Pagination/PaginationIcons.js +15 -0
- package/esm/Pagination/PaginationItem.js +54 -0
- package/esm/Pagination/getPaginationItems.js +40 -0
- package/esm/Pagination/index.js +77 -0
- package/esm/Pagination/usePagination.js +61 -0
- package/esm/Popper/Popper.js +1 -2
- package/esm/Radio/RadioBox.js +2 -2
- package/esm/Radio/index.js +1 -2
- package/esm/RadioGroup/index.js +1 -2
- package/esm/Selectbox/SelectboxButton.js +8 -3
- package/esm/Selectbox/SelectboxButtonWrapper.js +2 -3
- package/esm/Selectbox/index.js +1 -2
- package/esm/Slider/index.js +1 -2
- package/esm/Stack/index.js +7 -2
- package/esm/Surface/SurfaceContainer.js +1 -1
- package/esm/Surface/SurfaceContent.js +18 -11
- package/esm/Surface/SurfaceFooter.js +5 -1
- package/esm/Surface/SurfaceHeader.js +6 -2
- package/esm/Surface/SurfaceSubheader.js +6 -2
- package/esm/Surface/index.js +1 -2
- package/esm/Swiper/Swiper.js +268 -136
- package/esm/Swiper/SwiperSlide.js +3 -0
- package/esm/Swiper/SwiperSlidesRenderer.js +2 -1
- package/esm/Swiper/SwiperTrack.js +28 -5
- package/esm/Swiper/SwiperWrapper.js +5 -4
- package/esm/Switch/SwitchDot.js +2 -4
- package/esm/Switch/index.js +1 -2
- package/esm/Table/Table.js +1 -1
- package/esm/Table/TableCaption.js +5 -1
- package/esm/Table/TableCell.js +6 -2
- package/esm/Table/TableFooter.js +2 -1
- package/esm/Table/TableHeaderCell.js +6 -2
- package/esm/Tabs/Tab.js +5 -2
- package/esm/Tabs/Tabs.js +1 -2
- package/esm/TextArea/TextAreaInput.js +6 -1
- package/esm/TextArea/index.js +1 -2
- package/esm/TextField/TextFieldInput.js +6 -1
- package/esm/TextField/TextFieldInputWrapper.js +5 -2
- package/esm/TextField/index.js +1 -2
- package/esm/ThemeProvider/createTheme.js +7 -3
- package/esm/ThemeProvider/index.js +0 -2
- package/esm/ThemeProvider/tokens.js +55 -2
- package/esm/Toast/ToastCard.js +6 -3
- package/esm/Toast/ToastContainer.js +1 -2
- package/esm/Tooltip/TooltipContainer.js +2 -0
- package/esm/Tooltip/index.js +3 -4
- package/esm/utils/getElementRef.js +13 -0
- package/package.json +46 -11
- package/utils/getElementRef.d.ts +8 -0
- package/utils/getElementRef.js +18 -0
- package/ThemeProvider/components.d.ts +0 -79
- package/ThemeProvider/components.js +0 -3
- package/ThemeProvider/useThemeProps.d.ts +0 -7
- package/ThemeProvider/useThemeProps.js +0 -34
- package/esm/ThemeProvider/components.js +0 -2
- package/esm/ThemeProvider/useThemeProps.js +0 -29
package/ButtonGroup/index.js
CHANGED
|
@@ -18,8 +18,9 @@ const react_1 = __importDefault(require("react"));
|
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const react_2 = require("@emotion/react");
|
|
20
20
|
const ButtonGroupContext_1 = __importDefault(require("./ButtonGroupContext"));
|
|
21
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
21
22
|
/**
|
|
22
|
-
* The buttons are glued: the inner corners are square and the borders overlap.
|
|
23
|
+
* The buttons are glued: the inner corners are square and the borders overlap by the width of the border.
|
|
23
24
|
* `:not(...)` raises the specificity above the own styles of the button.
|
|
24
25
|
* `-of-type`, not `-child`: with SSR emotion inserts <style> elements between the children
|
|
25
26
|
*/
|
|
@@ -44,7 +45,7 @@ const StyledGroup = styled_1.default.div `
|
|
|
44
45
|
${({ $orientation }) => $orientation === 'vertical'
|
|
45
46
|
? (0, react_2.css) `
|
|
46
47
|
& > *:not(:first-of-type) {
|
|
47
|
-
margin-top: -
|
|
48
|
+
margin-top: calc(-1 * ${tokens_1.CONTROL_BORDER});
|
|
48
49
|
border-top-left-radius: 0;
|
|
49
50
|
border-top-right-radius: 0;
|
|
50
51
|
}
|
|
@@ -55,7 +56,7 @@ const StyledGroup = styled_1.default.div `
|
|
|
55
56
|
`
|
|
56
57
|
: (0, react_2.css) `
|
|
57
58
|
& > *:not(:first-of-type) {
|
|
58
|
-
margin-left: -
|
|
59
|
+
margin-left: calc(-1 * ${tokens_1.CONTROL_BORDER});
|
|
59
60
|
border-top-left-radius: 0;
|
|
60
61
|
border-bottom-left-radius: 0;
|
|
61
62
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
Все заметные изменения пакета `@via-profit/ui-kit`. Формат основан на [Keep a Changelog](https://keepachangelog.com/ru/1.1.0/), версии следуют [семантическому версионированию](https://semver.org/lang/ru/).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 0.7.0 — 2026-10-09
|
|
6
|
+
|
|
7
|
+
Swiper: дробный `slidesPerView` и `centered`, вертикальная прокрутка, затухание и бегущая лента.
|
|
8
|
+
|
|
9
|
+
### Добавлено
|
|
10
|
+
|
|
11
|
+
- **Swiper**: дробный `slidesPerView` (например, `1.2` — слайд и часть соседнего) и `centered` — текущий слайд посередине, соседи видны по краям;
|
|
12
|
+
- **Swiper**: `direction="vertical"` — вертикальная прокрутка, стрелки ↑/↓;
|
|
13
|
+
- **Swiper**: `effect="fade"` — смена слайдов затуханием;
|
|
14
|
+
- **Swiper**: `speed` — длительность смены слайда;
|
|
15
|
+
- **Swiper**: `autoScroll` — бегущая лента с постоянной скоростью в пикселях в секунду. Останавливается при наведении и при включённом в системе уменьшении движения.
|
|
16
|
+
|
|
17
|
+
### Исправлено
|
|
18
|
+
|
|
19
|
+
- **Swiper**: ширину слайда задаёт только `slidesPerView`. Раньше слайд с широким содержимым растягивался, и лента сдвигалась;
|
|
20
|
+
- **Swiper**: если слайдов меньше, чем нужно для бесконечной прокрутки, она выключается целиком. Раньше в консоль выводилась ошибка, но индексы считались с копиями слайдов, которых не было.
|
|
21
|
+
|
|
22
|
+
## 0.6.0 — 2026-10-07
|
|
23
|
+
|
|
24
|
+
Поддержка React 19. Тема снова задаёт только токены. Оформление компонентов в теме убрано: оно делало внутренние части компонентов публичным контрактом и добавляло работы при каждой отрисовке.
|
|
25
|
+
|
|
26
|
+
Версия содержит несовместимые изменения. Как обновиться с 0.5:
|
|
27
|
+
|
|
28
|
+
- `ThemeProvider`: уберите `components` из `createTheme`. Части отдельного компонента по-прежнему заменяются его свойством `overrides`, а свойства по умолчанию передайте сами — например, через свою обёртку над компонентом.
|
|
29
|
+
- размеры: кнопки и поля теперь одной высоты, у вкладок, пунктов меню и ячеек таблицы одинаковые отступы. Если ваша вёрстка рассчитана на прежнюю высоту, задайте `padding` в теме.
|
|
30
|
+
|
|
31
|
+
### Добавлено
|
|
32
|
+
|
|
33
|
+
- **Stack**, **Grid**: свойство `as` — элемент контейнера, например `<Stack as="ul">` или `<Grid as="dl">`. У списков убираются отступы и маркеры браузера;
|
|
34
|
+
- **Pagination**: новый компонент — переключение страниц с пропусками `…`, контролируемый и неконтролируемый режимы, кнопки «назад/вперёд» и «в начало/в конец», настройка видимых страниц (`siblings`, `boundaries`), подписи для программ чтения с экрана (`getItemLabel`) и замена частей через `overrides` — например, ссылки вместо кнопок. Хук `usePagination` — вся логика без разметки для своей пагинации, функция `getPaginationItems` — номера страниц с пропусками;
|
|
35
|
+
- **ThemeProvider**: токены `padding` — внутренние отступы по классам элементов: `control` (контролы), `item` (строки списков) и `container` (панели). Они меняют плотность интерфейса без изменения шрифта. Хелперы `themePadding`, `controlHeight` и `fieldPadding` в `ThemeProvider/tokens`.
|
|
36
|
+
|
|
37
|
+
### Изменено
|
|
38
|
+
|
|
39
|
+
- Обводки тоньше и одной толщины: `0.0625em` — `1px` при шрифте `16px`. Раньше у кнопок `outlined`, бейджей и кнопок в группе было `0.14em` (около `2px`), у чекбоксов, радиокнопок и линий таблицы — `0.1em`, у полей ввода — `1px`. Контролы стали ниже примерно на `2px`. Толщина доступна как `BORDER_WIDTH` в `ThemeProvider/tokens`; рамка фокуса не изменилась;
|
|
40
|
+
- **ThemeProvider**: тени унифицированы. У всех компонентов одного уровня `elevation` одна тень по умолчанию: `popup` — меню, календарь, уведомления, подсказки, модальные окна; `surface` — `Surface`, `Accordion`, `Table`; новый уровень `control` — ручка `Switch`. Раньше у `Accordion`, `Calendar`, `Toast` и `Switch` были свои тени, а у модальных окон и подсказок теней не было. Хелпер `elevation(theme, level)` принимает собственную тень третьим аргументом необязательно, тени по умолчанию — `defaultElevation(theme)`;
|
|
41
|
+
- **Button**, **TextField**, **TextArea**, **Selectbox**, **DatePicker**, **Autocomplete**: одна высота у всех контролов и у всех вариантов кнопки (раньше `standard` была на 4px ниже `outlined`, а поля — выше кнопок). Кнопка-иконка — квадрат высоты контрола;
|
|
42
|
+
- **Menu**, **Table**, **Tabs**: одинаковые отступы строк из `padding.item` — пункты меню стали чуть выше, ячейки таблицы чуть ниже, вкладки уже;
|
|
43
|
+
- **Surface**, **Accordion**, модальные окна, **Drawer**, **Toast**: отступы из `padding.container`. Заголовок аккордеона выровнен по содержимому. Заголовок и подзаголовок `Surface` и их отступы заданы в `em` вместо `rem` и масштабируются вместе с компонентом.
|
|
44
|
+
|
|
45
|
+
### Удалено
|
|
46
|
+
|
|
47
|
+
- **ThemeProvider**: `components` в теме (`defaultProps` и `overrides` по имени компонента), хук `useThemeProps` и типы `UIThemeComponents`, `ThemeComponentConfig`, `ThemeComponentName`. Токены `typography`, `focusRing` и `elevation` остаются.
|
|
48
|
+
|
|
49
|
+
### Исправлено
|
|
50
|
+
|
|
51
|
+
- Совместимость с React 19. Типы компонентов используют `React.JSX` вместо глобального пространства `JSX`, которого нет в `@types/react` 19, — проект на React 19 собирается без ошибок типов. **ClickOutside** и **Tooltip** больше не выводят в консоль предупреждение «Accessing element.ref was removed in React 19»: в React 19 ref дочернего элемента берётся из его свойств. React 18 по-прежнему поддерживается;
|
|
52
|
+
- **Button**: при смене варианта (например, у выбранной кнопки в группе) кнопка на мгновение увеличивалась и сдвигала соседние элементы: анимировались рамка и отступы. Теперь анимируются только цвета, тень и обводка;
|
|
53
|
+
- **Modal**: при открытии окна страница больше не сдвигается по горизонтали. Ширина полосы прокрутки, которая заменяется отступом, считалась по `<body>`, а не по окну, и почти всегда получалась `0`; к тому же она пересчитывалась при каждой отрисовке, уже без полосы. Теперь она измеряется один раз — до того как полоса скрывается — и доступна в CSS-переменной `--modal-scroll-width` на `<html>`.
|
|
6
54
|
|
|
7
55
|
## 0.5.0 — 2026-10-02
|
|
8
56
|
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
@@ -56,7 +66,6 @@ const CalendarWeekDaysBar_1 = __importDefault(require("./CalendarWeekDaysBar"));
|
|
|
56
66
|
const use_calendar_1 = require("./use-calendar");
|
|
57
67
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
58
68
|
const react_2 = require("@emotion/react");
|
|
59
|
-
const useThemeProps_1 = __importDefault(require("../ThemeProvider/useThemeProps"));
|
|
60
69
|
__exportStar(require("./use-calendar"), exports);
|
|
61
70
|
__exportStar(require("./CalendarWeekDaysBar"), exports);
|
|
62
71
|
const viewAppear = (0, react_2.keyframes) `
|
|
@@ -149,7 +158,7 @@ const computeCalendarDate = (params) => {
|
|
|
149
158
|
};
|
|
150
159
|
const CalendarComponent = react_1.default.forwardRef((props, ref) => {
|
|
151
160
|
var _a;
|
|
152
|
-
const { minDate: inputMinDate, maxDate: inputMaxDate, weekStartDay = 'monday', locale = 'ru-RU', displayLeadingZero = false, onChange, badges = [], markToday = true, weekDayLabelFormat = 'short', accentColor = 'primary', defaultValue, value: inputValue, initialView: inputInitialView, view: inputView, views: inputViews, resetButtonLabel, todayButtonLabel, heading, subheading, footer, overrides, range = false, prevButtonLabel = 'Previous', nextButtonLabel = 'Next', } =
|
|
161
|
+
const { minDate: inputMinDate, maxDate: inputMaxDate, weekStartDay = 'monday', locale = 'ru-RU', displayLeadingZero = false, onChange, badges = [], markToday = true, weekDayLabelFormat = 'short', accentColor = 'primary', defaultValue, value: inputValue, initialView: inputInitialView, view: inputView, views: inputViews, resetButtonLabel, todayButtonLabel, heading, subheading, footer, overrides, range = false, prevButtonLabel = 'Previous', nextButtonLabel = 'Next', } = props;
|
|
153
162
|
/**
|
|
154
163
|
* Validations
|
|
155
164
|
*/
|
|
@@ -4,8 +4,8 @@ export type CalendarControlButtonProps = ButtonProps & {
|
|
|
4
4
|
readonly isActive?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: React.ForwardRefExoticComponent<import("../Button/ButtonBase").ButtonBaseProps & {
|
|
7
|
-
readonly variant?: "standard" | "outlined" | "plain"
|
|
7
|
+
readonly variant?: "standard" | "outlined" | "plain";
|
|
8
8
|
} & {
|
|
9
|
-
readonly isActive?: boolean
|
|
9
|
+
readonly isActive?: boolean;
|
|
10
10
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
export default _default;
|
|
@@ -25,7 +25,7 @@ const StyledCalendarPaper = styled_1.default.div `
|
|
|
25
25
|
justify-content: stretch;
|
|
26
26
|
background-color: ${({ theme }) => theme.color.surface.toString()};
|
|
27
27
|
border-radius: ${({ theme }) => theme.shape.radiusFactor}em;
|
|
28
|
-
box-shadow: ${({ theme }) => (0, tokens_1.elevation)(theme, 'popup'
|
|
28
|
+
box-shadow: ${({ theme }) => (0, tokens_1.elevation)(theme, 'popup')};
|
|
29
29
|
`;
|
|
30
30
|
const CalendarPaper = (props, ref) => {
|
|
31
31
|
const { children } = props, restProps = __rest(props, ["children"]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: React.NamedExoticComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme
|
|
4
|
-
as?: React.ElementType
|
|
3
|
+
theme?: import("@emotion/react").Theme;
|
|
4
|
+
as?: React.ElementType;
|
|
5
5
|
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>>;
|
|
6
6
|
export default _default;
|
|
@@ -6,7 +6,7 @@ export type CalendarWeekRowButtonProps = React.HTMLAttributes<HTMLButtonElement>
|
|
|
6
6
|
readonly week: Week;
|
|
7
7
|
};
|
|
8
8
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & {
|
|
9
|
-
readonly isSelected?: boolean
|
|
9
|
+
readonly isSelected?: boolean;
|
|
10
10
|
readonly accentColor: string;
|
|
11
11
|
readonly week: Week;
|
|
12
12
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
const React = __importStar(require("react"));
|
|
27
37
|
const react_1 = require("react");
|
package/Calendar/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { CalendarProps, CalendarRef } from './CalendarComponent';
|
|
3
3
|
export * from './CalendarComponent';
|
|
4
4
|
declare const _default: <IsRangeValue extends boolean | undefined = undefined>(props: CalendarProps<IsRangeValue> & {
|
|
5
|
-
ref?: React.Ref<CalendarRef<IsRangeValue
|
|
5
|
+
ref?: React.Ref<CalendarRef<IsRangeValue>>;
|
|
6
6
|
}) => React.ReactElement;
|
|
7
7
|
export default _default;
|
package/Calendar/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -13,10 +13,10 @@ declare const _default: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttr
|
|
|
13
13
|
/**
|
|
14
14
|
* Shows the dash instead of the check mark (e.g. «select all» when only some items are selected)
|
|
15
15
|
*/
|
|
16
|
-
readonly indeterminate?: boolean
|
|
16
|
+
readonly indeterminate?: boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Paints the border with the error color
|
|
19
19
|
*/
|
|
20
|
-
readonly error?: boolean
|
|
20
|
+
readonly error?: boolean;
|
|
21
21
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
22
22
|
export default _default;
|
package/Checkbox/CheckboxBox.js
CHANGED
|
@@ -49,7 +49,7 @@ const Square = styled_1.default.span `
|
|
|
49
49
|
display: flex;
|
|
50
50
|
width: 100%;
|
|
51
51
|
height: 100%;
|
|
52
|
-
border-width:
|
|
52
|
+
border-width: ${tokens_1.BORDER_WIDTH};
|
|
53
53
|
border-style: solid;
|
|
54
54
|
/* Scaled down: the square is small, the full radius would turn it into a circle */
|
|
55
55
|
border-radius: ${({ theme }) => theme.shape.radiusFactor * 0.6}em;
|
|
@@ -17,11 +17,11 @@ declare const _default: React.ForwardRefExoticComponent<React.LabelHTMLAttribute
|
|
|
17
17
|
* Position of the label relative to the checkbox
|
|
18
18
|
* Default: `end`
|
|
19
19
|
*/
|
|
20
|
-
readonly labelPosition?: CheckboxLabelPosition
|
|
20
|
+
readonly labelPosition?: CheckboxLabelPosition;
|
|
21
21
|
/**
|
|
22
22
|
* If `true` the checkbox state can not be changed
|
|
23
23
|
* Default: false;
|
|
24
24
|
*/
|
|
25
|
-
readonly disabled?: boolean
|
|
25
|
+
readonly disabled?: boolean;
|
|
26
26
|
} & React.RefAttributes<HTMLLabelElement>>;
|
|
27
27
|
export default _default;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
package/Checkbox/index.d.ts
CHANGED
|
@@ -94,41 +94,41 @@ declare const _default: React.ForwardRefExoticComponent<Omit<CheckboxBoxProps, "
|
|
|
94
94
|
* The state of the controlled checkbox. Pass it together with `onChange`
|
|
95
95
|
* Default: undefined
|
|
96
96
|
*/
|
|
97
|
-
readonly checked?: boolean
|
|
97
|
+
readonly checked?: boolean;
|
|
98
98
|
/**
|
|
99
99
|
* The initial state of the uncontrolled checkbox
|
|
100
100
|
* Default: false
|
|
101
101
|
*/
|
|
102
|
-
readonly defaultChecked?: boolean
|
|
102
|
+
readonly defaultChecked?: boolean;
|
|
103
103
|
/**
|
|
104
104
|
* Called when the user toggles the checkbox. The new value is `event.currentTarget.checked`
|
|
105
105
|
*/
|
|
106
|
-
readonly onChange?: React.ChangeEventHandler<HTMLInputElement
|
|
106
|
+
readonly onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
107
107
|
/**
|
|
108
108
|
* Shows the dash instead of the check mark, e.g. «select all» when only some items are selected.\
|
|
109
109
|
* Only the look changes: `checked` keeps its value
|
|
110
110
|
* Default: false
|
|
111
111
|
*/
|
|
112
|
-
readonly indeterminate?: boolean
|
|
112
|
+
readonly indeterminate?: boolean;
|
|
113
113
|
/**
|
|
114
114
|
* If `true` the checkbox state can not be changed
|
|
115
115
|
* Default: false
|
|
116
116
|
*/
|
|
117
|
-
readonly disabled?: boolean
|
|
117
|
+
readonly disabled?: boolean;
|
|
118
118
|
/**
|
|
119
119
|
* You can pass the primary, default, secondary name of the colors or your specified color value
|
|
120
120
|
* Default: `default`
|
|
121
121
|
*/
|
|
122
|
-
readonly color?:
|
|
122
|
+
readonly color?: "default" | "primary" | "secondary" | string;
|
|
123
123
|
/**
|
|
124
124
|
* Position of the label relative to the checkbox
|
|
125
125
|
* Default: `end`
|
|
126
126
|
*/
|
|
127
|
-
readonly labelPosition?: CheckboxLabelPosition
|
|
127
|
+
readonly labelPosition?: CheckboxLabelPosition;
|
|
128
128
|
/**
|
|
129
129
|
* If true then `errorText` value will be displayed under the checkbox
|
|
130
130
|
*/
|
|
131
|
-
readonly error?: boolean
|
|
131
|
+
readonly error?: boolean;
|
|
132
132
|
/**
|
|
133
133
|
* Text or ReactNode to show in the error element.\
|
|
134
134
|
* Will be displayed only if `error` property is true
|
|
@@ -138,7 +138,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<CheckboxBoxProps, "
|
|
|
138
138
|
* If is true then the asterisk will be displayed in label\
|
|
139
139
|
* If is ReactNode then ReactNode will be displayed in label
|
|
140
140
|
*/
|
|
141
|
-
readonly requiredAsterisk?: React.ReactNode;
|
|
142
|
-
readonly overrides?: CheckboxOverrides
|
|
141
|
+
readonly requiredAsterisk?: boolean | React.ReactNode;
|
|
142
|
+
readonly overrides?: CheckboxOverrides;
|
|
143
143
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
144
144
|
export default _default;
|
package/Checkbox/index.js
CHANGED
|
@@ -22,9 +22,8 @@ const CheckboxIcon_1 = __importDefault(require("./CheckboxIcon"));
|
|
|
22
22
|
const CheckboxTextWrapper_1 = __importDefault(require("./CheckboxTextWrapper"));
|
|
23
23
|
const CheckboxAsterisk_1 = __importDefault(require("./CheckboxAsterisk"));
|
|
24
24
|
const CheckboxErrorText_1 = __importDefault(require("./CheckboxErrorText"));
|
|
25
|
-
const useThemeProps_1 = __importDefault(require("../ThemeProvider/useThemeProps"));
|
|
26
25
|
const Checkbox = (props, ref) => {
|
|
27
|
-
const
|
|
26
|
+
const { checked, defaultChecked, onChange, indeterminate = false, disabled, color, labelPosition, error, errorText, requiredAsterisk, overrides, children, className, style } = props, nativeProps = __rest(props, ["checked", "defaultChecked", "onChange", "indeterminate", "disabled", "color", "labelPosition", "error", "errorText", "requiredAsterisk", "overrides", "children", "className", "style"]);
|
|
28
27
|
const inputRef = react_1.default.useRef(null);
|
|
29
28
|
const [internalChecked, setInternalChecked] = react_1.default.useState(Boolean(defaultChecked));
|
|
30
29
|
const isControlled = typeof checked !== 'undefined';
|
|
@@ -2,5 +2,5 @@ import Color from '../Color';
|
|
|
2
2
|
/**
|
|
3
3
|
* Resolves the `color` property of the Checkbox to the Color instance
|
|
4
4
|
*/
|
|
5
|
-
declare const useCheckboxColor: (color:
|
|
5
|
+
declare const useCheckboxColor: (color: "default" | "primary" | "secondary" | string | undefined) => Color;
|
|
6
6
|
export default useCheckboxColor;
|
package/ClickOutside/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.mouseEventMap = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const getElementRef_1 = __importDefault(require("../utils/getElementRef"));
|
|
8
9
|
exports.mouseEventMap = {
|
|
9
10
|
onClick: 'click',
|
|
10
11
|
onMouseDown: 'mousedown',
|
|
@@ -43,7 +44,7 @@ const ClickOutside = props => {
|
|
|
43
44
|
};
|
|
44
45
|
}, [onOutsideClick, mouseEvent]);
|
|
45
46
|
// Keep the child's own ref working alongside ours
|
|
46
|
-
const childRef = children
|
|
47
|
+
const childRef = (0, getElementRef_1.default)(children);
|
|
47
48
|
const setRef = react_1.default.useCallback((el) => {
|
|
48
49
|
ref.current = el;
|
|
49
50
|
if (typeof childRef === 'function') {
|
|
@@ -53,6 +54,8 @@ const ClickOutside = props => {
|
|
|
53
54
|
childRef.current = el;
|
|
54
55
|
}
|
|
55
56
|
}, [childRef]);
|
|
56
|
-
return react_1.default.createElement(react_1.default.Fragment, null, react_1.default.cloneElement(children, {
|
|
57
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, react_1.default.cloneElement(children, {
|
|
58
|
+
ref: setRef,
|
|
59
|
+
})));
|
|
57
60
|
};
|
|
58
61
|
exports.default = ClickOutside;
|
package/DatePicker/index.d.ts
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
package/ErrorBoundary/index.d.ts
CHANGED
|
@@ -23,6 +23,6 @@ export type ErrorBoundaryProps = {
|
|
|
23
23
|
declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, State> {
|
|
24
24
|
constructor(props: ErrorBoundaryProps);
|
|
25
25
|
static getDerivedStateFromError(error: Error): State;
|
|
26
|
-
render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
26
|
+
render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
27
27
|
}
|
|
28
28
|
export default ErrorBoundary;
|
package/Grid/index.d.ts
CHANGED
|
@@ -28,6 +28,12 @@ export type GridProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
28
28
|
* **Default:** `stretch`
|
|
29
29
|
*/
|
|
30
30
|
readonly align?: React.CSSProperties['alignItems'];
|
|
31
|
+
/**
|
|
32
|
+
* The element of the grid: `ul`, `ol`, `dl`, `nav`, `section` and others.
|
|
33
|
+
* The lists lose the default margins and markers\
|
|
34
|
+
* **Default:** `div`
|
|
35
|
+
*/
|
|
36
|
+
readonly as?: React.ElementType;
|
|
31
37
|
};
|
|
32
38
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
33
39
|
/**
|
|
@@ -35,26 +41,32 @@ declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTM
|
|
|
35
41
|
* On a narrow screen the columns become one column by themselves, without breakpoints.\
|
|
36
42
|
* Wins over `columns`
|
|
37
43
|
*/
|
|
38
|
-
readonly minColumnWidth?: string
|
|
44
|
+
readonly minColumnWidth?: string;
|
|
39
45
|
/**
|
|
40
46
|
* A number — that many equal columns, a string — the `grid-template-columns` value
|
|
41
47
|
* (e.g. `'2fr 1fr'` or `'auto 1fr'`)\
|
|
42
48
|
* **Default:** `1`
|
|
43
49
|
*/
|
|
44
|
-
readonly columns?:
|
|
50
|
+
readonly columns?: number | string;
|
|
45
51
|
/**
|
|
46
52
|
* The gap between the cells: a step of the theme spacing scale or any CSS length\
|
|
47
53
|
* **Default:** `md`
|
|
48
54
|
*/
|
|
49
|
-
readonly gap?: Spacing
|
|
55
|
+
readonly gap?: Spacing;
|
|
50
56
|
/**
|
|
51
57
|
* The gap between the rows, if it differs from `gap`
|
|
52
58
|
*/
|
|
53
|
-
readonly rowGap?: Spacing
|
|
59
|
+
readonly rowGap?: Spacing;
|
|
54
60
|
/**
|
|
55
61
|
* The vertical alignment of the cells in a row (`align-items`)\
|
|
56
62
|
* **Default:** `stretch`
|
|
57
63
|
*/
|
|
58
|
-
readonly align?:
|
|
64
|
+
readonly align?: React.CSSProperties["alignItems"];
|
|
65
|
+
/**
|
|
66
|
+
* The element of the grid: `ul`, `ol`, `dl`, `nav`, `section` and others.
|
|
67
|
+
* The lists lose the default margins and markers\
|
|
68
|
+
* **Default:** `div`
|
|
69
|
+
*/
|
|
70
|
+
readonly as?: React.ElementType;
|
|
59
71
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
60
72
|
export default _default;
|
package/Grid/index.js
CHANGED
|
@@ -17,6 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const spacing_1 = require("../utils/spacing");
|
|
20
|
+
/**
|
|
21
|
+
* The lists are the rows of the elements here: no default margins and markers
|
|
22
|
+
*/
|
|
23
|
+
const LIST_TAGS = ['ul', 'ol', 'dl'];
|
|
20
24
|
const StyledGrid = styled_1.default.div `
|
|
21
25
|
display: grid;
|
|
22
26
|
grid-template-columns: ${({ $template }) => $template};
|
|
@@ -24,6 +28,7 @@ const StyledGrid = styled_1.default.div `
|
|
|
24
28
|
${({ theme, $rowGap }) => typeof $rowGap !== 'undefined' ? `row-gap: ${(0, spacing_1.resolveSpacing)(theme, $rowGap)};` : ''}
|
|
25
29
|
align-items: ${({ $align }) => $align !== null && $align !== void 0 ? $align : 'stretch'};
|
|
26
30
|
min-width: 0;
|
|
31
|
+
${({ $isList }) => ($isList ? 'margin: 0; padding: 0; list-style: none;' : '')}
|
|
27
32
|
`;
|
|
28
33
|
const getTemplate = (minColumnWidth, columns) => {
|
|
29
34
|
if (minColumnWidth) {
|
|
@@ -37,7 +42,7 @@ const getTemplate = (minColumnWidth, columns) => {
|
|
|
37
42
|
* The grid of cells with the same gap. The children are the cells: no wrappers for the items
|
|
38
43
|
*/
|
|
39
44
|
const Grid = (props, ref) => {
|
|
40
|
-
const { children, minColumnWidth, columns = 1, gap = 'md', rowGap, align } = props, nativeProps = __rest(props, ["children", "minColumnWidth", "columns", "gap", "rowGap", "align"]);
|
|
41
|
-
return (react_1.default.createElement(StyledGrid, Object.assign({}, nativeProps, { "$template": getTemplate(minColumnWidth, columns), "$gap": gap, "$rowGap": rowGap, "$align": align, ref: ref }), children));
|
|
45
|
+
const { children, minColumnWidth, columns = 1, gap = 'md', rowGap, align, as } = props, nativeProps = __rest(props, ["children", "minColumnWidth", "columns", "gap", "rowGap", "align", "as"]);
|
|
46
|
+
return (react_1.default.createElement(StyledGrid, Object.assign({}, nativeProps, { "$template": getTemplate(minColumnWidth, columns), "$gap": gap, "$rowGap": rowGap, "$align": align, "$isList": Boolean(as && LIST_TAGS.includes(as)), as: as, ref: ref }), children));
|
|
42
47
|
};
|
|
43
48
|
exports.default = react_1.default.forwardRef(Grid);
|
package/Highlighted/index.js
CHANGED
|
@@ -20,14 +20,13 @@ const react_1 = __importDefault(require("react"));
|
|
|
20
20
|
const HighlightedContainer_1 = __importDefault(require("./HighlightedContainer"));
|
|
21
21
|
const HighlightedMark_1 = __importDefault(require("./HighlightedMark"));
|
|
22
22
|
const HighlightedText_1 = __importDefault(require("./HighlightedText"));
|
|
23
|
-
const useThemeProps_1 = __importDefault(require("../ThemeProvider/useThemeProps"));
|
|
24
23
|
const escapeRegex = (pattern) => pattern.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
25
24
|
exports.escapeRegex = escapeRegex;
|
|
26
25
|
/**
|
|
27
26
|
* The component allows you to highlight text matches in a string
|
|
28
27
|
*/
|
|
29
28
|
const Highlighted = (props, ref) => {
|
|
30
|
-
const
|
|
29
|
+
const { text, highlight, overrides, disabledHighlighting = false, caseSensitive = false } = props, nativeProps = __rest(props, ["text", "highlight", "overrides", "disabledHighlighting", "caseSensitive"]);
|
|
31
30
|
const patterns = react_1.default.useMemo(() => (typeof highlight === 'string' ? [highlight] : highlight)
|
|
32
31
|
.filter(h => h.trim() !== '')
|
|
33
32
|
// Longest first: the alternation takes the first matching pattern,
|