-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plasma-new-hope): Add calendar with new architecture #821
Conversation
95b6d3d
to
3706cc7
Compare
|
||
const getRefs = useCallback( | ||
(element: HTMLDivElement, i: number, j: number) => { | ||
outerRefs.current[i][j] = element; |
Check warning
Code scanning / Semgrep
Semgrep Finding: gitlab.eslint.detect-object-injection Warning
|
||
const getRefs = useCallback( | ||
(element: HTMLDivElement, i: number, j: number) => { | ||
outerRefs.current[i][j] = element; |
Check warning
Code scanning / Semgrep
Semgrep Finding: gitlab.eslint.detect-object-injection Warning
|
||
const getRefs = useCallback( | ||
(element: HTMLDivElement, i: number, j: number) => { | ||
outerRefs.current[i][j] = element; |
Check warning
Code scanning / Semgrep
Semgrep Finding: gitlab.eslint.detect-object-injection Warning
|
||
const getRefs = useCallback( | ||
(element: HTMLDivElement, i: number, j: number) => { | ||
outerRefs.current[i][j] = element; |
Check warning
Code scanning / Semgrep
Semgrep Finding: gitlab.eslint.detect-object-injection Warning
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-821/ |
3706cc7
to
1fe5406
Compare
export const IconRoot: React.FC<IconRootProps> = ({ icon: IconComponent, size, color, className }) => { | ||
const c = color || 'var(--plasma-colors-primary)'; | ||
|
||
const w = `${sizeMap[size]}rem`; |
Check warning
Code scanning / Semgrep
Semgrep Finding: gitlab.eslint.detect-object-injection Warning
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-821/ |
|
const [prevValue, setPrevValue] = useState(value); | ||
const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0); | ||
|
||
const [state, dispatch] = useReducer(reducer, getInitialState(value, [5, 6], type)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а что такое [5,6] ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по-моему это размерность, только чего уже не помню )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Размер сетки для календаря для useKeyNavigation
packages/plasma-new-hope/src/components/Calendar/shared/mixins.ts
Outdated
Show resolved
Hide resolved
packages/plasma-new-hope/src/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.ts
Outdated
Show resolved
Hide resolved
|
||
${flexCenter()}; | ||
|
||
&.${String(classes.daySideLeft)} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему приходится к строке явно приводить?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Особенность linaria. Иначе не собираются стили
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
надо собрать все такие места куда-то в проблемы с linaria и начинать править их babel процессор или писать своё =/
@@ -0,0 +1,100 @@ | |||
import React, { forwardRef, memo } from 'react'; | |||
|
|||
import { cx } from '../../../../utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
что-то меня смущает что приходится использовать cx =/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну это кастомная штука, кажется в таком случае норм
packages/plasma-new-hope/src/components/Calendar/shared/tokens.ts
Outdated
Show resolved
Hide resolved
1fe5406
to
8b26a2e
Compare
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-821/ |
8b26a2e
to
496b57b
Compare
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-821/ |
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-821/ |
packages/plasma-new-hope/src/components/Calendar/shared/tokens.ts
Outdated
Show resolved
Hide resolved
@@ -89,7 +81,7 @@ export interface Calendar extends HTMLAttributes<HTMLDivElement> { | |||
/** | |||
* Выбранное значение. | |||
*/ | |||
value: CalendarValueType; | |||
value?: CalendarValueType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это безопасное изменение но обратно уже будет поломка API
тут точно опциональное?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему стало опционально?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вернул как было
|
||
&.${String(classes.daySideRight)} { | ||
&:before { | ||
right: ${({ offset }) => `${offset}px`}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
этот offset часто меняется?
потому что если да, то для styled-components это жопа
если разок за жизнь компонента то ок
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yeti-or Объясни пожалуйста почему - это жопа?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/plasma-new-hope/src/examples/sds_engineer/components/Calendar/Calendar.stories.tsx
Outdated
Show resolved
Hide resolved
|
||
const onChangeValue = action('onChangeValue'); | ||
|
||
const StyledCalendar = styled(Calendar)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я тут только понял что это сторя, почем нам нужно календарь стилизовать в сторей?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для поповера стилизацию сделал небольшую. Можно и без нее сделать
packages/plasma-new-hope/src/components/Calendar/shared/mixins.ts
Outdated
Show resolved
Hide resolved
packages/plasma-new-hope/src/components/Calendar/shared/types.ts
Outdated
Show resolved
Hide resolved
packages/plasma-new-hope/src/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.ts
Show resolved
Hide resolved
packages/plasma-new-hope/src/components/_Icon/Icon.assets/DisclosureRight.tsx
Show resolved
Hide resolved
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-821/ |
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-821/ |
82b2548
to
eca7b3f
Compare
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-821/ |
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-821/ |
eca7b3f
to
842d204
Compare
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-821/ |
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-821/ |
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
2 similar comments
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
4 similar comments
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀 |
Release Notes
Добавлена реализация компонента Calendar в новой архитектуре.
Добавлены сборки компонента для новых тем plasma_web, plasma_b2c, sds_engineer.
Добавлены сборки компонента для старых библиотек @salutejs/plasma-web, @salutejs/plasma-b2c.
Удалён компонент Calendar из @salutejs/plasma-hope.
Поправил небольшой баг (issue) с типизацией для mergeConfig: если у компонента были обязательные пропсы ts ругался, что их не хватает в самом конфиге.
fixes: #597
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
🐤 Download canary assets:
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via:
Version
Published prerelease version:
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
Changelog
Release Notes
feat(plasma-new-hope): Add calendar with new architecture (#821)
Добавлена реализация компонента Calendar в новой архитектуре.
Добавлены сборки компонента для новых тем plasma_web, plasma_b2c, sds_engineer.
Добавлены сборки компонента для старых библиотек @salutejs/plasma-web, @salutejs/plasma-b2c.
Удалён компонент Calendar из @salutejs/plasma-hope.
Поправил небольшой баг (issue) с типизацией для mergeConfig: если у компонента были обязательные пропсы ts ругался, что их не хватает в самом конфиге.
fixes: #597
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
⚡ Component performance testing
Result: 🟢 OK
🚀 Enhancement
@salutejs/plasma-new-hope
@salutejs/plasma-b2c
,@salutejs/plasma-new-hope
,@salutejs/plasma-web
@salutejs/plasma-hope
@salutejs/plasma-b2c
,@salutejs/plasma-hope
,@salutejs/plasma-web
Authors: 1