Skip to content
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-theme-builder): Actualize default tokens #1127

Merged
merged 9 commits into from
Mar 21, 2024

Conversation

neretin-trike
Copy link
Collaborator

@neretin-trike neretin-trike commented Mar 18, 2024

Plasma Theme Builder

  • произведён рефакторинг методов, которые генерируют токены
  • актуализированы базовые токены, которые генерируются сервисом ThemeBuilder
  • добавлена новая группа outline, используемая в обводках / рамках

What/why changed

Необходимо было произвести актуализацию токенов, т.к. добавилось много новых + обновились старые

🐤 Download canary assets:
borderRadius
borderRadius_caldera_online_react-native--canary.1127.8374885890.ts
borderRadius_caldera_react-native--canary.1127.8374885890.ts
borderRadius_default_react-native--canary.1127.8374885890.ts
borderRadius_flamingo_react-native--canary.1127.8374885890.ts
borderRadius_plasma_b2c_react-native--canary.1127.8374885890.ts
borderRadius_plasma_web_react-native--canary.1127.8374885890.ts
borderRadius_sberHealth_react-native--canary.1127.8374885890.ts
borderRadius_sbermarket_business_react-native--canary.1127.8374885890.ts
borderRadius_sbermarket_metro_react-native--canary.1127.8374885890.ts
borderRadius_sbermarket_react-native--canary.1127.8374885890.ts
borderRadius_sbermarket_selgros_react-native--canary.1127.8374885890.ts
borderRadius_sbermarket_wlbusiness_react-native--canary.1127.8374885890.ts
borderRadius_sberonline_react-native--canary.1127.8374885890.ts
borderRadius_sberprime_react-native--canary.1127.8374885890.ts
borderRadius_sdds_serv_react-native--canary.1127.8374885890.ts
borderRadius_stylesSalute_react-native--canary.1127.8374885890.ts
color
color_caldera_ios-swift--canary.1127.8374885890.swift
color_caldera_kotlin--canary.1127.8374885890.kt
color_caldera_online_ios-swift--canary.1127.8374885890.swift
color_caldera_online_kotlin--canary.1127.8374885890.kt
color_caldera_online_react-native--canary.1127.8374885890.ts
color_caldera_online_xml--canary.1127.8374885890.xml
color_caldera_react-native--canary.1127.8374885890.ts
color_caldera_xml--canary.1127.8374885890.xml
color_default_ios-swift--canary.1127.8374885890.swift
color_default_kotlin--canary.1127.8374885890.kt
color_default_react-native--canary.1127.8374885890.ts
color_default_xml--canary.1127.8374885890.xml
color_flamingo_ios-swift--canary.1127.8374885890.swift
color_flamingo_kotlin--canary.1127.8374885890.kt
color_flamingo_react-native--canary.1127.8374885890.ts
color_flamingo_xml--canary.1127.8374885890.xml
color_plasma_b2c_ios-swift--canary.1127.8374885890.swift
color_plasma_b2c_kotlin--canary.1127.8374885890.kt
color_plasma_b2c_react-native--canary.1127.8374885890.ts
color_plasma_b2c_xml--canary.1127.8374885890.xml
color_plasma_web_ios-swift--canary.1127.8374885890.swift
color_plasma_web_kotlin--canary.1127.8374885890.kt
color_plasma_web_react-native--canary.1127.8374885890.ts
color_plasma_web_xml--canary.1127.8374885890.xml
color_sberHealth_ios-swift--canary.1127.8374885890.swift
color_sberHealth_kotlin--canary.1127.8374885890.kt
color_sberHealth_react-native--canary.1127.8374885890.ts
color_sberHealth_xml--canary.1127.8374885890.xml
color_sbermarket_business_ios-swift--canary.1127.8374885890.swift
color_sbermarket_business_kotlin--canary.1127.8374885890.kt
color_sbermarket_business_react-native--canary.1127.8374885890.ts
color_sbermarket_business_xml--canary.1127.8374885890.xml
color_sbermarket_ios-swift--canary.1127.8374885890.swift
color_sbermarket_kotlin--canary.1127.8374885890.kt
color_sbermarket_metro_ios-swift--canary.1127.8374885890.swift
color_sbermarket_metro_kotlin--canary.1127.8374885890.kt
color_sbermarket_metro_react-native--canary.1127.8374885890.ts
color_sbermarket_metro_xml--canary.1127.8374885890.xml
color_sbermarket_react-native--canary.1127.8374885890.ts
color_sbermarket_selgros_ios-swift--canary.1127.8374885890.swift
color_sbermarket_selgros_kotlin--canary.1127.8374885890.kt
color_sbermarket_selgros_react-native--canary.1127.8374885890.ts
color_sbermarket_selgros_xml--canary.1127.8374885890.xml
color_sbermarket_wlbusiness_ios-swift--canary.1127.8374885890.swift
color_sbermarket_wlbusiness_kotlin--canary.1127.8374885890.kt
color_sbermarket_wlbusiness_react-native--canary.1127.8374885890.ts
color_sbermarket_wlbusiness_xml--canary.1127.8374885890.xml
color_sbermarket_xml--canary.1127.8374885890.xml
color_sberonline_ios-swift--canary.1127.8374885890.swift
color_sberonline_kotlin--canary.1127.8374885890.kt
color_sberonline_react-native--canary.1127.8374885890.ts
color_sberonline_xml--canary.1127.8374885890.xml
color_sberprime_ios-swift--canary.1127.8374885890.swift
color_sberprime_kotlin--canary.1127.8374885890.kt
color_sberprime_react-native--canary.1127.8374885890.ts
color_sberprime_xml--canary.1127.8374885890.xml
color_sdds_serv_ios-swift--canary.1127.8374885890.swift
color_sdds_serv_kotlin--canary.1127.8374885890.kt
color_sdds_serv_react-native--canary.1127.8374885890.ts
color_sdds_serv_xml--canary.1127.8374885890.xml
color_stylesSalute_ios-swift--canary.1127.8374885890.swift
color_stylesSalute_kotlin--canary.1127.8374885890.kt
color_stylesSalute_react-native--canary.1127.8374885890.ts
color_stylesSalute_xml--canary.1127.8374885890.xml
shadow
shadow_caldera_online_react-native--canary.1127.8374885890.ts
shadow_caldera_react-native--canary.1127.8374885890.ts
shadow_default_react-native--canary.1127.8374885890.ts
shadow_flamingo_react-native--canary.1127.8374885890.ts
shadow_plasma_b2c_react-native--canary.1127.8374885890.ts
shadow_plasma_web_react-native--canary.1127.8374885890.ts
shadow_sberHealth_react-native--canary.1127.8374885890.ts
shadow_sbermarket_business_react-native--canary.1127.8374885890.ts
shadow_sbermarket_metro_react-native--canary.1127.8374885890.ts
shadow_sbermarket_react-native--canary.1127.8374885890.ts
shadow_sbermarket_selgros_react-native--canary.1127.8374885890.ts
shadow_sbermarket_wlbusiness_react-native--canary.1127.8374885890.ts
shadow_sberonline_react-native--canary.1127.8374885890.ts
shadow_sberprime_react-native--canary.1127.8374885890.ts
shadow_sdds_serv_react-native--canary.1127.8374885890.ts
shadow_stylesSalute_react-native--canary.1127.8374885890.ts
spacing
spacing_caldera_online_react-native--canary.1127.8374885890.ts
spacing_caldera_react-native--canary.1127.8374885890.ts
spacing_default_react-native--canary.1127.8374885890.ts
spacing_flamingo_react-native--canary.1127.8374885890.ts
spacing_plasma_b2c_react-native--canary.1127.8374885890.ts
spacing_plasma_web_react-native--canary.1127.8374885890.ts
spacing_sberHealth_react-native--canary.1127.8374885890.ts
spacing_sbermarket_business_react-native--canary.1127.8374885890.ts
spacing_sbermarket_metro_react-native--canary.1127.8374885890.ts
spacing_sbermarket_react-native--canary.1127.8374885890.ts
spacing_sbermarket_selgros_react-native--canary.1127.8374885890.ts
spacing_sbermarket_wlbusiness_react-native--canary.1127.8374885890.ts
spacing_sberonline_react-native--canary.1127.8374885890.ts
spacing_sberprime_react-native--canary.1127.8374885890.ts
spacing_sdds_serv_react-native--canary.1127.8374885890.ts
spacing_stylesSalute_react-native--canary.1127.8374885890.ts
typo
typo_mage_ios-swift--canary.1127.8374885890.swift
typo_mage_kotlin--canary.1127.8374885890.kt
typo_mage_react-native--canary.1127.8374885890.ts
typo_plasma_ios-swift--canary.1127.8374885890.swift
typo_plasma_kotlin--canary.1127.8374885890.kt
typo_plasma_react-native--canary.1127.8374885890.ts
typo_ruler_ios-swift--canary.1127.8374885890.swift
typo_ruler_kotlin--canary.1127.8374885890.kt
typo_ruler_react-native--canary.1127.8374885890.ts
typo_sage_ios-swift--canary.1127.8374885890.swift
typo_sage_kotlin--canary.1127.8374885890.kt
typo_sage_react-native--canary.1127.8374885890.ts
typo_sbermarket_ios-swift--canary.1127.8374885890.swift
typo_sbermarket_kotlin--canary.1127.8374885890.kt
typo_sbermarket_react-native--canary.1127.8374885890.ts
typo_soulmate_ios-swift--canary.1127.8374885890.swift
typo_soulmate_kotlin--canary.1127.8374885890.kt
typo_soulmate_react-native--canary.1127.8374885890.ts
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
# or 
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]

@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1127/

Copy link

@ArthurIvanov ArthurIvanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё ок

@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1127/

const normalizedThemeData = useMemo(() => getNormalizeThemeSections(defaultThemeData), [defaultThemeData]);

return normalizedThemeData;
return useMemo(() => createTheme(defaultConfig), []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а зачем тут useMemo ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

просто хук useDefaultThemeData лежит в main файле, и вызывается на каждый ререндер (по-хорошему это нужно будет переделать), поэтому чтобы не делать тыщу раз большой объём вычислений замемоизировал

surfaceAccentMinorGradient: getSurfaceAccentMinorGradientTokens,
surfaceTransparentAccent: getSurfaceTransparentAccentTokens,
surfaceTransparentAccentGradient: getSurfaceTransparentAccentGradientTokens,
surfacePromo: getSurfacePromoTokens,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surfacePromo у нас в базовой теме теперь ??

Copy link
Collaborator Author

@neretin-trike neretin-trike Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ага, но как я и говорил вчера - эти токены отключены по умолчанию

Copy link
Collaborator Author

@neretin-trike neretin-trike Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

просто разные продукты иногда называют эти токены по-разному (например surfacePromoMAIN), и чтобы не было такого разнообразия (и неконсистетности), мы сами даём пользователям названия

comment,
darkValue,
lightValue,
darkSubGroup = 'onDark',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а почему тут то onDark то просто dark ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это только для background группы. Уже очень давно именно в этой группе мы сделал dark / light, т.к. это более семантически корректно. Ну то есть onDark бэграунд не может быть (это насколько я помню, мне Гена объяснял тогда)

| 'outlinePromoMinor'
| 'outlinePromoMinorGradient'
| 'outlineInfo'
| 'outlinePositiveMinor'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

интересный нейминиг
то primary / secondary
то _ / minor

=/

@@ -33,10 +32,6 @@ const GradientTokenLayers = styled.div`

const StyledTextArea = styled(TextArea)`
flex: 1;

textarea {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вот вот
и почему наши пользоватлеи так делали ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ну да :C Я помню, как тогда говорил о том, что в textArea нельзя высоту никак менять, поэтому костылял

Copy link
Contributor

Theme Builder app deployed!

https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1127/

@neretin-trike neretin-trike added this pull request to the merge queue Mar 21, 2024
Merged via the queue into dev with commit d062edc Mar 21, 2024
32 checks passed
@neretin-trike neretin-trike deleted the neretinaa/actualize-default-tokens branch March 21, 2024 21:11
This was referenced Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants