From 4413d9c1b7e603fa0f3ba85187a9f37b3ca07b73 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 21 Nov 2024 15:39:05 +0700 Subject: [PATCH 01/43] feat(form-control): add size 40 --- .../src/Component.screenshots.test.tsx | 4 +- packages/form-control/src/Component.test.tsx | 9 +- ...reenshots-size-prop-default-theme-snap.png | 4 +- ...creenshots-size-prop-mobile-theme-snap.png | 4 +- ...-screenshots-size-prop-site-theme-snap.png | 4 +- ...rol-screenshots-theme-corp-sprite-snap.png | 4 +- .../base-form-control/Component.tsx | 3 +- .../base-form-control/index.module.css | 21 +++++ .../src/desktop/desktop.module.css | 4 + .../src/docs/Component.stories.tsx | 2 +- .../form-control/src/docs/description.mdx | 92 ++++++++++--------- .../form-control/src/mobile/mobile.module.css | 4 + packages/form-control/src/vars.css | 4 + .../src/components/tag-list/component.tsx | 8 +- 14 files changed, 111 insertions(+), 56 deletions(-) diff --git a/packages/form-control/src/Component.screenshots.test.tsx b/packages/form-control/src/Component.screenshots.test.tsx index eb6d3aff2f..028e4fc0e6 100644 --- a/packages/form-control/src/Component.screenshots.test.tsx +++ b/packages/form-control/src/Component.screenshots.test.tsx @@ -45,7 +45,7 @@ describe('FormControl | screenshots size prop', () => { componentName: 'FormControl', knobs: { label: 'Label', - size: [48, 56, 64, 72], + size: [40, 48, 56, 64, 72], }, size: { width: 350, height: 150 }, }), @@ -151,7 +151,7 @@ describe('FormControl | screenshots theme corp', () => { componentName: 'FormControl', knobs: { block: true, - size: [48, 56, 64, 72], + size: [40, 48, 56, 64, 72], disabled: [false, true], error: ['', 'Error'], }, diff --git a/packages/form-control/src/Component.test.tsx b/packages/form-control/src/Component.test.tsx index aaccae1852..72c4af3d94 100644 --- a/packages/form-control/src/Component.test.tsx +++ b/packages/form-control/src/Component.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { cleanup, render } from '@testing-library/react'; +import { cleanup, render, screen } from '@testing-library/react'; import { getFormControlTestIds } from './utils'; import { FormControlDesktop as FormControl } from './desktop'; @@ -172,6 +172,13 @@ describe('FormControl', () => { expect(getByTestId(dataTestId).firstElementChild).toHaveClass('focused'); }); + + it('should set `size-40`', () => { + const dataTestId = 'test-id'; + render(); + + expect(screen.getByTestId(dataTestId)).toHaveClass('size-40'); + }); }); it('should unmount without errors', () => { diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png index 3013368001..c25178a033 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d73943912b305e6bcb32e07bcd0af069d78f806e84046d601c97508591da8c4 -size 12563 +oid sha256:0506de7662df134a79ca6e43d5860ea86b10e78d67ed75913280d0737377dc73 +size 15013 diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png index 3013368001..c25178a033 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d73943912b305e6bcb32e07bcd0af069d78f806e84046d601c97508591da8c4 -size 12563 +oid sha256:0506de7662df134a79ca6e43d5860ea86b10e78d67ed75913280d0737377dc73 +size 15013 diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png index efe4471d45..08f1a0d7b8 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4067bc45f46095bb7b9b31f017555e7f980f9093c5ca7b6e255d1f87531d45d3 -size 11658 +oid sha256:6a109f20f8164a536d777842b626cf4c274897d2797146d40afc6861fe8f9be0 +size 14193 diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-theme-corp-sprite-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-theme-corp-sprite-snap.png index d85512deef..7002457174 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-theme-corp-sprite-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-theme-corp-sprite-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:461a6b58c6d51910d40b61dd4fc7363c19b0cf0d7cd57836add607adc5369cc4 -size 48098 +oid sha256:8f3da6f089cb351cc548e02514f467af0a32191d8b53f54097c14fee4de4feef +size 59339 diff --git a/packages/form-control/src/components/base-form-control/Component.tsx b/packages/form-control/src/components/base-form-control/Component.tsx index 0faa0bcda7..977a1a2f3b 100644 --- a/packages/form-control/src/components/base-form-control/Component.tsx +++ b/packages/form-control/src/components/base-form-control/Component.tsx @@ -31,7 +31,7 @@ export type BaseFormControlProps = HTMLAttributes & { * Размер компонента * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - size?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + size?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Набор цветов для компонента @@ -156,6 +156,7 @@ const SIZE_TO_CLASSNAME_MAP = { m: 'size-56', l: 'size-64', xl: 'size-72', + 40: 'size-40', 48: 'size-48', 56: 'size-56', 64: 'size-64', diff --git a/packages/form-control/src/components/base-form-control/index.module.css b/packages/form-control/src/components/base-form-control/index.module.css index b586f7c448..1e63c83e0a 100644 --- a/packages/form-control/src/components/base-form-control/index.module.css +++ b/packages/form-control/src/components/base-form-control/index.module.css @@ -104,6 +104,27 @@ /* SIZES */ +.size-40 { + & .inner { + min-height: var(--form-control-40-min-height); + } + + & .hasInnerLabel .input > * { + padding: var(--form-control-labeled-40-paddings); + } + + & .label { + top: calc(var(--form-control-40-min-height) / 2); + } + + & .addons { + & > * { + width: 16px; + height: 16px; + } + } +} + .size-48 .inner { min-height: var(--form-control-s-min-height); } diff --git a/packages/form-control/src/desktop/desktop.module.css b/packages/form-control/src/desktop/desktop.module.css index c7ed37e9e8..2570af73c6 100644 --- a/packages/form-control/src/desktop/desktop.module.css +++ b/packages/form-control/src/desktop/desktop.module.css @@ -14,6 +14,10 @@ /* SIZES */ +.size-40 .inner { + border-radius: var(--form-control-40-border-radius); +} + .size-48 .inner { border-radius: var(--form-control-s-border-radius); } diff --git a/packages/form-control/src/docs/Component.stories.tsx b/packages/form-control/src/docs/Component.stories.tsx index a8b46c5d50..5a0d26a769 100644 --- a/packages/form-control/src/docs/Component.stories.tsx +++ b/packages/form-control/src/docs/Component.stories.tsx @@ -35,7 +35,7 @@ export const form_control: Story = { > - + + - - - @@ -44,7 +52,7 @@ ```jsx live
- -
``` ## Префиксы и суффиксы -Инпут может содержать предзаполненное значение, располагающееся спереди или сзади вводимого пользователем значения. +Инпут может содержать предзаполненное значение, располагающееся спереди или сзади вводимого пользователем значения. ```jsx live render(() => { @@ -100,10 +108,10 @@ render(() => { ```jsx live
- { return (
- { size='xs' alignIcon='left' /> - } + } /> - { size='xs' alignIcon='right' /> - } + } /> & FormControlProps & TagListOwnProps> = ({ +export const TagList: FC< + Partial & + TagListOwnProps & + Omit & { + size: Exclude; + } +> = ({ size = 72, open, disabled, From e04f87edcadc0484ffc57cfa98dd50363a8e7474 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 21 Nov 2024 19:05:55 +0700 Subject: [PATCH 02/43] feat(input): add size 40 --- .../input-screenshots-size-prop-default-theme-snap.png | 4 ++-- .../input-screenshots-size-prop-mobile-theme-snap.png | 4 ++-- .../input-screenshots-size-prop-site-theme-snap.png | 4 ++-- packages/input/src/component.screenshots.test.tsx | 2 +- packages/input/src/components/base-input/Component.tsx | 3 ++- packages/input/src/components/base-input/index.module.css | 4 ++++ packages/input/src/docs/Component.stories.tsx | 2 +- .../international-phone-input/src/Component.responsive.tsx | 4 +++- .../src/desktop/Component.desktop.tsx | 4 +++- .../src/mobile/Component.mobile.tsx | 4 +++- packages/number-input/src/Component.responsive.tsx | 7 ++++++- .../number-input/src/components/number-input/Component.tsx | 5 ++++- packages/number-input/src/desktop/Component.desktop.tsx | 7 ++++--- packages/number-input/src/mobile/Component.mobile.tsx | 7 ++++--- packages/password-input/src/component.tsx | 4 +++- packages/slider-input/src/Component.tsx | 5 ++++- packages/themes/src/mixins/form-control/site.css | 1 + 17 files changed, 49 insertions(+), 22 deletions(-) diff --git a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png index 6a709752d6..091da1a818 100644 --- a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png +++ b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb8631d087683572a013481784df0805b8f461b80fb98d866754a19e22ade4a6 -size 12548 +oid sha256:586aa70d1998d546601679f0293ebbfdbbd64ee5e3b04aee494f14dcdb606026 +size 15007 diff --git a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png index 6a709752d6..091da1a818 100644 --- a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png +++ b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb8631d087683572a013481784df0805b8f461b80fb98d866754a19e22ade4a6 -size 12548 +oid sha256:586aa70d1998d546601679f0293ebbfdbbd64ee5e3b04aee494f14dcdb606026 +size 15007 diff --git a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png index 90f5e4c8ed..2d9698322c 100644 --- a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png +++ b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5cf18c342437f9c579214aa73553762209cc8367eea2edd76eb9e7a515a48f82 -size 11657 +oid sha256:e09752261d94022081172bd02b2eb5148c572ba4c38b223c27c0698974fe61ed +size 13957 diff --git a/packages/input/src/component.screenshots.test.tsx b/packages/input/src/component.screenshots.test.tsx index c052a24643..f32a92716d 100644 --- a/packages/input/src/component.screenshots.test.tsx +++ b/packages/input/src/component.screenshots.test.tsx @@ -72,7 +72,7 @@ describe('Input | screenshots size prop', () => { componentName: 'Input', knobs: { label: 'Label', - size: [48, 56, 64, 72], + size: [40, 48, 56, 64, 72], }, size: { width: 350, height: 150 }, }), diff --git a/packages/input/src/components/base-input/Component.tsx b/packages/input/src/components/base-input/Component.tsx index 23e243dd8d..2e609e30f3 100644 --- a/packages/input/src/components/base-input/Component.tsx +++ b/packages/input/src/components/base-input/Component.tsx @@ -66,7 +66,7 @@ export type BaseInputProps = Omit< * Размер компонента * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - size?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + size?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Набор цветов для компонента @@ -215,6 +215,7 @@ const SIZE_TO_CLASSNAME_MAP = { m: 'size-56', l: 'size-64', xl: 'size-72', + 40: 'size-40', 48: 'size-48', 56: 'size-56', 64: 'size-64', diff --git a/packages/input/src/components/base-input/index.module.css b/packages/input/src/components/base-input/index.module.css index eb2aa4014e..ed951b9ae0 100644 --- a/packages/input/src/components/base-input/index.module.css +++ b/packages/input/src/components/base-input/index.module.css @@ -25,6 +25,10 @@ opacity: 0; } + &.size-40 { + height: var(--form-control-40-min-height); + } + &.size-48 { height: var(--form-control-s-min-height); } diff --git a/packages/input/src/docs/Component.stories.tsx b/packages/input/src/docs/Component.stories.tsx index 916dae8180..40ab63dd96 100644 --- a/packages/input/src/docs/Component.stories.tsx +++ b/packages/input/src/docs/Component.stories.tsx @@ -43,7 +43,7 @@ export const input: Story = { value={text('value', '')} block={boolean('block', false)} clear={boolean('clear', false)} - size={select('size', [48, 56, 64, 72], 48)} + size={select('size', [40, 48, 56, 64, 72], 48)} colors={colors} disabled={boolean('disabled', false)} placeholder={text('placeholder', '')} diff --git a/packages/international-phone-input/src/Component.responsive.tsx b/packages/international-phone-input/src/Component.responsive.tsx index 569a19eccb..ada803543a 100644 --- a/packages/international-phone-input/src/Component.responsive.tsx +++ b/packages/international-phone-input/src/Component.responsive.tsx @@ -8,7 +8,9 @@ import { InternationalPhoneInputProps } from './types'; export const InternationalPhoneInput = React.forwardRef< HTMLInputElement, - InternationalPhoneInputProps + Omit & { + size: Exclude; + } >( ( { diff --git a/packages/international-phone-input/src/desktop/Component.desktop.tsx b/packages/international-phone-input/src/desktop/Component.desktop.tsx index 6abbfe36fd..ed1fafb98b 100644 --- a/packages/international-phone-input/src/desktop/Component.desktop.tsx +++ b/packages/international-phone-input/src/desktop/Component.desktop.tsx @@ -12,7 +12,9 @@ import type { export const InternationalPhoneInputDesktop = forwardRef< HTMLInputElement, - InternationalPhoneInputDesktopProps + Omit & { + size: Exclude; + } >((props, ref) => ( & { + size: Exclude; + } >((props, ref) => ( ; -export const NumberInputResponsive = forwardRef( +export const NumberInputResponsive = forwardRef< + HTMLInputElement, + Omit & { + size?: Exclude; + } +>( ( { breakpoint, diff --git a/packages/number-input/src/components/number-input/Component.tsx b/packages/number-input/src/components/number-input/Component.tsx index 0fc7b5aae0..b25bc3bb1e 100644 --- a/packages/number-input/src/components/number-input/Component.tsx +++ b/packages/number-input/src/components/number-input/Component.tsx @@ -109,7 +109,10 @@ const SIZE_TO_CLASSNAME_MAP = { 72: 'size-72', }; -export const NumberInput = forwardRef( +export const NumberInput = forwardRef< + HTMLInputElement, + Omit & { size?: Exclude } +>( ( { value: propValue, diff --git a/packages/number-input/src/desktop/Component.desktop.tsx b/packages/number-input/src/desktop/Component.desktop.tsx index a991c3d447..96b4bf9574 100644 --- a/packages/number-input/src/desktop/Component.desktop.tsx +++ b/packages/number-input/src/desktop/Component.desktop.tsx @@ -6,6 +6,7 @@ import { NumberInput, NumberInputProps } from '../components/number-input'; export type NumberInputDesktopProps = Omit; -export const NumberInputDesktop = forwardRef( - (props, ref) => , -); +export const NumberInputDesktop = forwardRef< + HTMLInputElement, + Omit & { size: Exclude } +>((props, ref) => ); diff --git a/packages/number-input/src/mobile/Component.mobile.tsx b/packages/number-input/src/mobile/Component.mobile.tsx index 323f384234..a63750e0a5 100644 --- a/packages/number-input/src/mobile/Component.mobile.tsx +++ b/packages/number-input/src/mobile/Component.mobile.tsx @@ -6,6 +6,7 @@ import { NumberInput, NumberInputProps } from '../components/number-input'; export type NumberInputMobileProps = Omit; -export const NumberInputMobile = forwardRef( - (props, ref) => , -); +export const NumberInputMobile = forwardRef< + HTMLInputElement, + Omit & { size: Exclude } +>((props, ref) => ); diff --git a/packages/password-input/src/component.tsx b/packages/password-input/src/component.tsx index d223b34e77..db0c6f1d39 100644 --- a/packages/password-input/src/component.tsx +++ b/packages/password-input/src/component.tsx @@ -8,7 +8,9 @@ import { EyeOffMIcon } from '@alfalab/icons-glyph/EyeOffMIcon'; import styles from './index.module.css'; -export type PasswordInputProps = InputProps & { +export type PasswordInputProps = Omit & { + size: Exclude; +} & { /** * Управление видимостью пароля (controlled) */ diff --git a/packages/slider-input/src/Component.tsx b/packages/slider-input/src/Component.tsx index 83ff8a4aa9..97d79394eb 100644 --- a/packages/slider-input/src/Component.tsx +++ b/packages/slider-input/src/Component.tsx @@ -143,7 +143,10 @@ const SIZE_TO_CLASSNAME_MAP = { 72: 'size-72', }; -export const SliderInput = forwardRef( +export const SliderInput = forwardRef< + HTMLInputElement, + Omit & { size: Exclude } +>( ( { className, diff --git a/packages/themes/src/mixins/form-control/site.css b/packages/themes/src/mixins/form-control/site.css index 7567d23b49..372302e87c 100644 --- a/packages/themes/src/mixins/form-control/site.css +++ b/packages/themes/src/mixins/form-control/site.css @@ -1,5 +1,6 @@ @define-mixin form-control-site { /* theme */ + --form-control-40-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-s-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-m-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-l-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; From 817135918bc0917d68d22708159d6b40e96809a8 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 21 Nov 2024 20:30:22 +0700 Subject: [PATCH 03/43] feat(amount-input): add size 40 --- .../amount-input-screenshots-sprite-size-snap.png | 3 +++ .../amount-input/src/component.screenshots.test.tsx | 10 ++++++++++ packages/amount-input/src/docs/Component.stories.tsx | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png diff --git a/packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png b/packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png new file mode 100644 index 0000000000..5d99b9edb1 --- /dev/null +++ b/packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d350a503106407f6f2d48daf2a85f2b2c626c22cbbe2dc1f767a6bce4cecd06 +size 11020 diff --git a/packages/amount-input/src/component.screenshots.test.tsx b/packages/amount-input/src/component.screenshots.test.tsx index f3975f2cb4..ba57c81972 100644 --- a/packages/amount-input/src/component.screenshots.test.tsx +++ b/packages/amount-input/src/component.screenshots.test.tsx @@ -82,6 +82,16 @@ describe( }, }), ], + [ + 'sprite size', + createSpriteStorybookUrl({ + componentName: 'AmountInput', + knobs: { + minority: 100, + size: [40, 48, 56, 64, 72], + }, + }), + ], ], }), ); diff --git a/packages/amount-input/src/docs/Component.stories.tsx b/packages/amount-input/src/docs/Component.stories.tsx index a66899df5d..28c3b366fa 100644 --- a/packages/amount-input/src/docs/Component.stories.tsx +++ b/packages/amount-input/src/docs/Component.stories.tsx @@ -26,7 +26,7 @@ export const amount_input: Story = { positiveOnly={boolean('positiveOnly', true)} bold={boolean('bold', true)} block={boolean('block', false)} - size={select('size', [48, 56, 64, 72], 48)} + size={select('size', [40, 48, 56, 64, 72], 48)} disabled={boolean('disabled', false)} placeholder={text('placeholder', undefined)} label={text('label', '')} From e6f08a96a86b793b8b7a5d41ff6438e5bd32e115 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 21 Nov 2024 20:37:17 +0700 Subject: [PATCH 04/43] feat(input-autocomplete): add size 40 --- packages/input-autocomplete/src/docs/Component.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/input-autocomplete/src/docs/Component.stories.tsx b/packages/input-autocomplete/src/docs/Component.stories.tsx index f8a6d92b9f..59da69359e 100644 --- a/packages/input-autocomplete/src/docs/Component.stories.tsx +++ b/packages/input-autocomplete/src/docs/Component.stories.tsx @@ -58,7 +58,7 @@ const renderComponent = (Component: any, props?: Partial options={filteredOptions} selected={boolean('prevent select', true) ? [] : undefined} block={boolean('block', false)} - size={select('size', ['s', 'm', 'l', 'xl'], 's')} + size={select('size', [40, 48, 56, 64, 72], 48)} disabled={boolean('disabled', false)} error={text('error', '')} success={boolean('success', false)} From 504572e470f13d4986391bc861a0ba5dbf64a575 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 21 Nov 2024 21:18:04 +0700 Subject: [PATCH 05/43] feat(number-input): add size 40 --- .../src/components/base-form-control/index.module.css | 2 +- packages/number-input/src/Component.responsive.tsx | 7 +------ .../number-input/src/components/number-input/Component.tsx | 7 +++---- .../src/components/number-input/index.module.css | 5 +++++ .../number-input/src/components/steppers/Component.tsx | 7 +++++-- packages/number-input/src/desktop/Component.desktop.tsx | 7 +++---- packages/number-input/src/docs/Component.stories.tsx | 2 +- packages/number-input/src/mobile/Component.mobile.tsx | 7 +++---- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/form-control/src/components/base-form-control/index.module.css b/packages/form-control/src/components/base-form-control/index.module.css index 1e63c83e0a..55823cc6a2 100644 --- a/packages/form-control/src/components/base-form-control/index.module.css +++ b/packages/form-control/src/components/base-form-control/index.module.css @@ -118,7 +118,7 @@ } & .addons { - & > * { + & > svg { width: 16px; height: 16px; } diff --git a/packages/number-input/src/Component.responsive.tsx b/packages/number-input/src/Component.responsive.tsx index e4014fd6c8..55fa6e89a3 100644 --- a/packages/number-input/src/Component.responsive.tsx +++ b/packages/number-input/src/Component.responsive.tsx @@ -7,12 +7,7 @@ import { NumberInput, NumberInputProps } from './components/number-input'; export type NumberInputResponsiveProps = Omit; -export const NumberInputResponsive = forwardRef< - HTMLInputElement, - Omit & { - size?: Exclude; - } ->( +export const NumberInputResponsive = forwardRef( ( { breakpoint, diff --git a/packages/number-input/src/components/number-input/Component.tsx b/packages/number-input/src/components/number-input/Component.tsx index b25bc3bb1e..42aaad0ce8 100644 --- a/packages/number-input/src/components/number-input/Component.tsx +++ b/packages/number-input/src/components/number-input/Component.tsx @@ -103,16 +103,14 @@ const SIZE_TO_CLASSNAME_MAP = { m: 'size-56', l: 'size-64', xl: 'size-72', + 40: 'size-40', 48: 'size-48', 56: 'size-56', 64: 'size-64', 72: 'size-72', }; -export const NumberInput = forwardRef< - HTMLInputElement, - Omit & { size?: Exclude } ->( +export const NumberInput = forwardRef( ( { value: propValue, @@ -289,6 +287,7 @@ export const NumberInput = forwardRef< )} onIncrement={handleIncrement} onDecrement={handleDecrement} + size={size} /> ) : ( diff --git a/packages/number-input/src/components/number-input/index.module.css b/packages/number-input/src/components/number-input/index.module.css index 9162835bbd..1ec5d2571d 100644 --- a/packages/number-input/src/components/number-input/index.module.css +++ b/packages/number-input/src/components/number-input/index.module.css @@ -1,5 +1,10 @@ @import '../../../../vars/src/index.css'; +.size-40 { + margin-right: var(--gap-8-neg); + height: 32px; +} + .size-48 { margin-right: var(--gap-8-neg); } diff --git a/packages/number-input/src/components/steppers/Component.tsx b/packages/number-input/src/components/steppers/Component.tsx index 116fd72190..ace4715fc0 100644 --- a/packages/number-input/src/components/steppers/Component.tsx +++ b/packages/number-input/src/components/steppers/Component.tsx @@ -2,6 +2,7 @@ import React from 'react'; import cn from 'classnames'; import { IconButton } from '@alfalab/core-components-icon-button'; +import { InputProps } from '@alfalab/core-components-input'; import { getDataTestId } from '@alfalab/core-components-shared'; import { MinusMIcon } from '@alfalab/icons-glyph/MinusMIcon'; import { PlusMediumMIcon } from '@alfalab/icons-glyph/PlusMediumMIcon'; @@ -20,6 +21,7 @@ export type SteppersProps = { onDecrement: () => void; dataTestId?: string; colors: 'default' | 'inverted'; + size: InputProps['size']; }; const colorStyles = { @@ -41,6 +43,7 @@ export const Steppers: React.FC = ({ disabled, dataTestId, colors, + size, }) => { const decButtonDisabled = disabled || value <= min; const incButtonDisabled = disabled || value >= max; @@ -51,7 +54,7 @@ export const Steppers: React.FC = ({ colors={colors} disabled={decButtonDisabled} className={styles.button} - icon={} + icon={} aria-label='уменьшить' onMouseDown={preventDefault} onClick={onDecrement} @@ -63,7 +66,7 @@ export const Steppers: React.FC = ({ colors={colors} disabled={incButtonDisabled} className={styles.button} - icon={} + icon={} aria-label='увеличить' onMouseDown={preventDefault} onClick={onIncrement} diff --git a/packages/number-input/src/desktop/Component.desktop.tsx b/packages/number-input/src/desktop/Component.desktop.tsx index 96b4bf9574..a991c3d447 100644 --- a/packages/number-input/src/desktop/Component.desktop.tsx +++ b/packages/number-input/src/desktop/Component.desktop.tsx @@ -6,7 +6,6 @@ import { NumberInput, NumberInputProps } from '../components/number-input'; export type NumberInputDesktopProps = Omit; -export const NumberInputDesktop = forwardRef< - HTMLInputElement, - Omit & { size: Exclude } ->((props, ref) => ); +export const NumberInputDesktop = forwardRef( + (props, ref) => , +); diff --git a/packages/number-input/src/docs/Component.stories.tsx b/packages/number-input/src/docs/Component.stories.tsx index fa2a620e0e..e1b54c5c18 100644 --- a/packages/number-input/src/docs/Component.stories.tsx +++ b/packages/number-input/src/docs/Component.stories.tsx @@ -34,7 +34,7 @@ export const number_input: Story = { > {stepper ? ( ; -export const NumberInputMobile = forwardRef< - HTMLInputElement, - Omit & { size: Exclude } ->((props, ref) => ); +export const NumberInputMobile = forwardRef( + (props, ref) => , +); From ed904001cde4b6dfa0e2a1b5e54bd992ef36bf1a Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 22 Nov 2024 13:12:49 +0700 Subject: [PATCH 06/43] feat(universal-date-input): add size 40 --- packages/universal-date-input/src/docs/Component.stories.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/universal-date-input/src/docs/Component.stories.tsx b/packages/universal-date-input/src/docs/Component.stories.tsx index 3353179481..218561c7f7 100644 --- a/packages/universal-date-input/src/docs/Component.stories.tsx +++ b/packages/universal-date-input/src/docs/Component.stories.tsx @@ -22,6 +22,7 @@ export const universal_date_input: Story = { view={select('view', ['date', 'date-time', 'date-range', 'time'] as any, 'date')} picker={boolean('picker', false) as true} Calendar={Calendar} + size={select('size', [40, 48, 56, 64, 72], 48)} /> ); }, From 6628ede53aed0315a24fcc7dc3bcd1c939658bbe Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 22 Nov 2024 13:52:39 +0700 Subject: [PATCH 07/43] feat(textarea): add size 40 --- ...extarea-sprite-click-main-props-2-snap.png | 4 +-- .../textarea-sprite-click-main-props-snap.png | 4 +-- ...tarea-sprite-default-main-props-2-snap.png | 4 +-- ...extarea-sprite-default-main-props-snap.png | 4 +-- .../src/component.screenshots.test.tsx | 4 +-- packages/textarea/src/consts.ts | 1 + .../textarea/src/docs/Component.stories.mdx | 2 +- packages/textarea/src/index.module.css | 25 +++++++++++++++++++ 8 files changed, 37 insertions(+), 11 deletions(-) diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png index d4566019d2..89f6300c40 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ca0b56108ca683ad40db52e8009da4062fd22c5e3bf25656afa22ec83205306f -size 47582 +oid sha256:4503cbe8da92fda89d5841bc35e8be287a89357c04f3630ab12dfffa01b0c946 +size 66344 diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png index b4f34d4976..f4a22270ce 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6dfc68900c55437d34f31405eb43771993cad4ff9d78fcd258e78e86428b3ee4 -size 40848 +oid sha256:c1c80560278a9a91b9453c4f0e9ebd4eecaf05ab7642040a3cd20cf09a4db137 +size 64445 diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png index d4566019d2..89f6300c40 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ca0b56108ca683ad40db52e8009da4062fd22c5e3bf25656afa22ec83205306f -size 47582 +oid sha256:4503cbe8da92fda89d5841bc35e8be287a89357c04f3630ab12dfffa01b0c946 +size 66344 diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png index b4f34d4976..f4a22270ce 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6dfc68900c55437d34f31405eb43771993cad4ff9d78fcd258e78e86428b3ee4 -size 40848 +oid sha256:c1c80560278a9a91b9453c4f0e9ebd4eecaf05ab7642040a3cd20cf09a4db137 +size 64445 diff --git a/packages/textarea/src/component.screenshots.test.tsx b/packages/textarea/src/component.screenshots.test.tsx index f4fa883b85..9ad1047c41 100644 --- a/packages/textarea/src/component.screenshots.test.tsx +++ b/packages/textarea/src/component.screenshots.test.tsx @@ -40,7 +40,7 @@ describe('Textarea | sprite', () => { knobs: { value: 'Компонент текстового поля ввода.', block: true, - size: [48, 56, 64, 72], + size: [40, 48, 56, 64, 72], label: ['', 'Лейбл'], labelView: 'inner', placeholder: 'Плейсхолдер', @@ -55,7 +55,7 @@ describe('Textarea | sprite', () => { knobs: { value: 'Компонент текстового поля ввода.', block: true, - size: [48, 56, 64, 72], + size: [40, 48, 56, 64, 72], label: ['', 'Лейбл'], labelView: 'outer', placeholder: 'Плейсхолдер', diff --git a/packages/textarea/src/consts.ts b/packages/textarea/src/consts.ts index 66d7d3f9a8..6ec2df39b4 100644 --- a/packages/textarea/src/consts.ts +++ b/packages/textarea/src/consts.ts @@ -3,6 +3,7 @@ export const SIZE_TO_CLASSNAME_MAP = { m: 'size-56', l: 'size-64', xl: 'size-72', + 40: 'size-40', 48: 'size-48', 56: 'size-56', 64: 'size-64', diff --git a/packages/textarea/src/docs/Component.stories.mdx b/packages/textarea/src/docs/Component.stories.mdx index d4bbdbd266..5d19b840da 100644 --- a/packages/textarea/src/docs/Component.stories.mdx +++ b/packages/textarea/src/docs/Component.stories.mdx @@ -21,7 +21,7 @@ import Changelog from '../../CHANGELOG.md?raw'; autosize={boolean('autosize', true)} allowOverflow={boolean('allowOverflow', true)} block={boolean('block', false)} - size={select('size', [48, 56, 64, 72], 48)} + size={select('size', [40, 48, 56, 64, 72], 48)} disabled={boolean('disabled', false)} placeholder={text('placeholder', '')} resize={select('resize', ['none', 'vertical'], 'none')} diff --git a/packages/textarea/src/index.module.css b/packages/textarea/src/index.module.css index 341dc9084e..4556d76624 100644 --- a/packages/textarea/src/index.module.css +++ b/packages/textarea/src/index.module.css @@ -4,6 +4,7 @@ :root { /* min-height */ + --textarea-40-min-height: var(--form-control-40-min-height); --textarea-s-min-height: var(--form-control-s-min-height); --textarea-m-min-height: var(--form-control-m-min-height); --textarea-l-min-height: var(--form-control-l-min-height); @@ -11,24 +12,31 @@ /* spacer */ --textarea-spacer-style: solid transparent; + --textarea-40-spacer: 10px; --textarea-s-spacer: 14px; --textarea-m-spacer: 18px; --textarea-l-spacer: 22px; --textarea-xl-spacer: 24px; /* filled spacer-top */ + --textarea-40-filled-spacer-top: 19px; --textarea-s-filled-spacer-top: 24px; --textarea-m-filled-spacer-top: 24px; --textarea-l-filled-spacer-top: 32px; --textarea-xl-filled-spacer-top: 34px; /* filled spacer-bottom */ + --textarea-40-filled-spacer-bottom: 3px; --textarea-s-filled-spacer-bottom: 4px; --textarea-m-filled-spacer-bottom: 8px; --textarea-l-filled-spacer-bottom: 12px; --textarea-xl-filled-spacer-bottom: 14px; /* filled min-height */ + --textarea-40-filled-min-height: calc( + var(--textarea-40-min-height) - var(--textarea-40-filled-spacer-top) - + var(--textarea-40-filled-spacer-bottom) + ); --textarea-s-filled-min-height: calc( var(--textarea-s-min-height) - var(--textarea-s-filled-spacer-top) - var(--textarea-s-filled-spacer-bottom) @@ -140,6 +148,9 @@ /* FILLED STATE */ .textarea.filled.hasInnerLabel { padding-top: var(--gap-0); + &.size-40 { + min-height: var(--textarea-40-filled-min-height); + } &.size-48 { min-height: var(--textarea-s-filled-min-height); } @@ -156,6 +167,10 @@ /* Correct pseudoTextarea size */ .pseudoTextarea.filled.hasInnerLabel { + &.size-40 { + min-height: calc(100% - var(--textarea-40-filled-spacer-top)); + } + &.size-48 { min-height: calc(100% - var(--textarea-s-filled-spacer-top)); } @@ -182,6 +197,11 @@ /* Border нужен для того чтобы растянуть textarea на всю высоту FormControl , если заменить на padding, то лейбл не будет кликабельный */ .textarea { + &.size-40 { + border-top: var(--textarea-40-spacer) var(--textarea-spacer-style); + border-bottom: var(--textarea-40-spacer) var(--textarea-spacer-style); + } + &.size-48 { border-top: var(--textarea-s-spacer) var(--textarea-spacer-style); border-bottom: var(--textarea-s-spacer) var(--textarea-spacer-style); @@ -203,6 +223,11 @@ } &.hasInnerLabel { + &.size-40 { + border-top: var(--textarea-40-filled-spacer-top) var(--textarea-spacer-style); + border-bottom: var(--textarea-40-filled-spacer-bottom) var(--textarea-spacer-style); + } + &.size-48 { border-top: var(--textarea-s-filled-spacer-top) var(--textarea-spacer-style); border-bottom: var(--textarea-s-filled-spacer-bottom) var(--textarea-spacer-style); From 1d06e055f2499fdf7765e92de8e9ca4eb053b3c9 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 22 Nov 2024 14:57:07 +0700 Subject: [PATCH 08/43] feat(select): add size 40 --- .../select-click-theme-main-props-snap.png | 4 ++-- .../select-default-theme-main-props-snap.png | 4 ++-- packages/select/src/component.screenshots.test.tsx | 2 +- packages/select/src/components/option/index.module.css | 4 ++++ packages/select/src/consts.ts | 1 + packages/select/src/docs/Component.stories.tsx | 8 ++++---- packages/select/src/typings.ts | 10 +++++----- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png b/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png index 05bbb34998..a2249905a8 100644 --- a/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png +++ b/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3200d267cd0207302621909e43b90ea1f760f24048abae945391b00b5cb7180 -size 29665 +oid sha256:a7aab4f610c7db21193bc486274c818167da9242c4034e4b5193ec97561edc11 +size 39543 diff --git a/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png b/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png index 05bbb34998..a2249905a8 100644 --- a/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png +++ b/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3200d267cd0207302621909e43b90ea1f760f24048abae945391b00b5cb7180 -size 29665 +oid sha256:a7aab4f610c7db21193bc486274c818167da9242c4034e4b5193ec97561edc11 +size 39543 diff --git a/packages/select/src/component.screenshots.test.tsx b/packages/select/src/component.screenshots.test.tsx index 8fdb25e414..ff6e11a69b 100644 --- a/packages/select/src/component.screenshots.test.tsx +++ b/packages/select/src/component.screenshots.test.tsx @@ -76,7 +76,7 @@ describe('Select', () => { options: [[]], block: true, placeholder: 'Выберите элемент', - size: [48, 56, 64], + size: [40, 48, 56, 64], label: ['Элемент', ''], }, size: { width: 300, height: 120 }, diff --git a/packages/select/src/components/option/index.module.css b/packages/select/src/components/option/index.module.css index b34399cc57..2bb85b5cb1 100644 --- a/packages/select/src/components/option/index.module.css +++ b/packages/select/src/components/option/index.module.css @@ -37,6 +37,10 @@ } } +.size-40 { + min-height: var(--size-xs-height); +} + .size-48 { min-height: var(--size-s-height); } diff --git a/packages/select/src/consts.ts b/packages/select/src/consts.ts index 61e84fbc78..0894012517 100644 --- a/packages/select/src/consts.ts +++ b/packages/select/src/consts.ts @@ -5,6 +5,7 @@ export const SIZE_TO_CLASSNAME_MAP = { m: 'size-56', l: 'size-64', xl: 'size-72', + 40: 'size-40', 48: 'size-48', 56: 'size-56', 64: 'size-64', diff --git a/packages/select/src/docs/Component.stories.tsx b/packages/select/src/docs/Component.stories.tsx index 2bb09688bb..f000bea2d7 100644 --- a/packages/select/src/docs/Component.stories.tsx +++ b/packages/select/src/docs/Component.stories.tsx @@ -58,7 +58,7 @@ export const select: Story = { setSelected(selectedMultiple.map((option) => option.key)); }; const block = boolean('block', false); - const size = selectKnob('size', [48, 56, 64, 72], 48); + const size = selectKnob('size', [40, 48, 56, 64, 72], 48); const disabled = boolean('disabled', false); const error = text('error', ''); const hint = text('hint', ''); @@ -115,7 +115,7 @@ export const select_mobile: Story = { setSelected(selectedMultiple.map((option) => option.key)); }; const block = boolean('block', false); - const size = selectKnob('size', [48, 56, 64, 72], 48); + const size = selectKnob('size', [40, 48, 56, 64, 72], 48); const disabled = boolean('disabled', false); const error = text('error', ''); const hint = text('hint', ''); @@ -166,7 +166,7 @@ export const select_responsive: Story = { setSelected(selectedMultiple.map((option) => option.key)); }; const block = boolean('block', false); - const size = selectKnob('size', [48, 56, 64, 72], 48); + const size = selectKnob('size', [40, 48, 56, 64, 72], 48); const disabled = boolean('disabled', false); const error = text('error', ''); const hint = text('hint', ''); @@ -223,7 +223,7 @@ export const select_modal_mobile: Story = { setSelected(selectedMultiple.map((option) => option.key)); }; const block = boolean('block', false); - const size = selectKnob('size', [48, 56, 64, 72], 48); + const size = selectKnob('size', [40, 48, 56, 64, 72], 48); const disabled = boolean('disabled', false); const error = text('error', ''); const hint = text('hint', ''); diff --git a/packages/select/src/typings.ts b/packages/select/src/typings.ts index 12b1766bb5..65d000d0db 100644 --- a/packages/select/src/typings.ts +++ b/packages/select/src/typings.ts @@ -147,13 +147,13 @@ export type BaseSelectProps = { * Размер компонента * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - size?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + size?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Размер пунктов меню * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - optionsSize?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + optionsSize?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Растягивает компонент на ширину контейнера @@ -519,7 +519,7 @@ export type OptionsListProps = { * Размер компонента * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - size?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + size?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Компонент пункта меню @@ -668,7 +668,7 @@ export type OptgroupProps = { * Размер компонента * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - size?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + size?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Заголовок группы @@ -717,7 +717,7 @@ export type OptionProps = { * Размер компонента * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - size?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + size?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Контент пункта меню From 2bf5fc9985a2f8c94c32165eb00d4606b12ec70f Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 22 Nov 2024 15:39:23 +0700 Subject: [PATCH 09/43] feat(select): fix types --- .../src/Component.responsive.tsx | 4 +--- .../src/desktop/Component.desktop.tsx | 4 +--- .../src/mobile/Component.mobile.tsx | 4 +--- packages/password-input/src/component.tsx | 8 ++++++-- .../src/components/tag-list/component.tsx | 7 ++----- packages/slider-input/src/Component.tsx | 13 ++++++++----- 6 files changed, 19 insertions(+), 21 deletions(-) diff --git a/packages/international-phone-input/src/Component.responsive.tsx b/packages/international-phone-input/src/Component.responsive.tsx index ada803543a..569a19eccb 100644 --- a/packages/international-phone-input/src/Component.responsive.tsx +++ b/packages/international-phone-input/src/Component.responsive.tsx @@ -8,9 +8,7 @@ import { InternationalPhoneInputProps } from './types'; export const InternationalPhoneInput = React.forwardRef< HTMLInputElement, - Omit & { - size: Exclude; - } + InternationalPhoneInputProps >( ( { diff --git a/packages/international-phone-input/src/desktop/Component.desktop.tsx b/packages/international-phone-input/src/desktop/Component.desktop.tsx index ed1fafb98b..6abbfe36fd 100644 --- a/packages/international-phone-input/src/desktop/Component.desktop.tsx +++ b/packages/international-phone-input/src/desktop/Component.desktop.tsx @@ -12,9 +12,7 @@ import type { export const InternationalPhoneInputDesktop = forwardRef< HTMLInputElement, - Omit & { - size: Exclude; - } + InternationalPhoneInputDesktopProps >((props, ref) => ( & { - size: Exclude; - } + InternationalPhoneInputMobileProps >((props, ref) => ( & { - size: Exclude; -} & { + /** + * Размер компонента + * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно + */ + size?: Exclude; + /** * Управление видимостью пароля (controlled) */ diff --git a/packages/select-with-tags/src/components/tag-list/component.tsx b/packages/select-with-tags/src/components/tag-list/component.tsx index 21e7edb646..503a359610 100644 --- a/packages/select-with-tags/src/components/tag-list/component.tsx +++ b/packages/select-with-tags/src/components/tag-list/component.tsx @@ -27,6 +27,7 @@ import { Tag as DefaultTag } from '../tag'; import styles from './index.module.css'; type TagListOwnProps = { + size?: Exclude; value?: string; handleDeleteTag?: (key: string) => void; onInput?: (event: ChangeEvent) => void; @@ -56,11 +57,7 @@ const SIZE_TO_CLASSNAME_MAP = { }; export const TagList: FC< - Partial & - TagListOwnProps & - Omit & { - size: Exclude; - } + Partial & Omit & TagListOwnProps > = ({ size = 72, open, diff --git a/packages/slider-input/src/Component.tsx b/packages/slider-input/src/Component.tsx index 97d79394eb..78841d43ff 100644 --- a/packages/slider-input/src/Component.tsx +++ b/packages/slider-input/src/Component.tsx @@ -20,8 +20,14 @@ import styles from './index.module.css'; export type SliderInputProps = Omit< InputProps, - 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' + 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' | 'size' > & { + /** + * Размер компонента + * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно + */ + size?: Exclude; + /** * Мин. допустимое число */ @@ -143,10 +149,7 @@ const SIZE_TO_CLASSNAME_MAP = { 72: 'size-72', }; -export const SliderInput = forwardRef< - HTMLInputElement, - Omit & { size: Exclude } ->( +export const SliderInput = forwardRef( ( { className, From e513fbf034f45066463a77edf2a2b31251d4bc79 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 22 Nov 2024 15:55:23 +0700 Subject: [PATCH 10/43] feat: add changeset --- .changeset/stale-llamas-end.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .changeset/stale-llamas-end.md diff --git a/.changeset/stale-llamas-end.md b/.changeset/stale-llamas-end.md new file mode 100644 index 0000000000..4f352dd26d --- /dev/null +++ b/.changeset/stale-llamas-end.md @@ -0,0 +1,16 @@ +--- +'@alfalab/core-components-amount-input': minor +'@alfalab/core-components-form-control': minor +'@alfalab/core-components-input': minor +'@alfalab/core-components-input-autocomplete': minor +'@alfalab/core-components-number-input': minor +'@alfalab/core-components-password-input': minor +'@alfalab/core-components-select': minor +'@alfalab/core-components-select-with-tags': minor +'@alfalab/core-components-slider-input': minor +'@alfalab/core-components-textarea': minor +'@alfalab/core-components-themes': minor +'@alfalab/core-components-universal-date-input': minor +--- + +Добавлен 40 размер FormControl From df453eedf24cd519ae8134511906ca4d89ad44dd Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 14:56:58 +0700 Subject: [PATCH 11/43] feat: improve input 40 paddings --- .../src/components/base-form-control/Component.tsx | 9 +++++++-- .../src/components/base-form-control/index.module.css | 9 +++++++++ packages/input/src/components/base-input/Component.tsx | 1 + .../input/src/components/base-input/index.module.css | 5 +++++ packages/input/src/docs/Component.stories.tsx | 4 ++-- packages/number-input/src/docs/Component.stories.tsx | 2 +- packages/textarea/src/typings.ts | 2 +- 7 files changed, 26 insertions(+), 6 deletions(-) diff --git a/packages/form-control/src/components/base-form-control/Component.tsx b/packages/form-control/src/components/base-form-control/Component.tsx index 977a1a2f3b..188031f657 100644 --- a/packages/form-control/src/components/base-form-control/Component.tsx +++ b/packages/form-control/src/components/base-form-control/Component.tsx @@ -291,8 +291,13 @@ export const BaseFormControl = React.forwardRef )} - -
{children}
+
+ {children} +
{rightAddons && ( diff --git a/packages/form-control/src/components/base-form-control/index.module.css b/packages/form-control/src/components/base-form-control/index.module.css index 55823cc6a2..bf3402c017 100644 --- a/packages/form-control/src/components/base-form-control/index.module.css +++ b/packages/form-control/src/components/base-form-control/index.module.css @@ -107,6 +107,7 @@ .size-40 { & .inner { min-height: var(--form-control-40-min-height); + padding: var(--gap-0) var(--gap-4); } & .hasInnerLabel .input > * { @@ -122,6 +123,14 @@ width: 16px; height: 16px; } + + &.rightAddons { + padding-right: var(--gap-8); + } + + &.leftAddons { + padding-left: var(--gap-8); + } } } diff --git a/packages/input/src/components/base-input/Component.tsx b/packages/input/src/components/base-input/Component.tsx index 2e609e30f3..fda96a046b 100644 --- a/packages/input/src/components/base-input/Component.tsx +++ b/packages/input/src/components/base-input/Component.tsx @@ -442,6 +442,7 @@ export const BaseInput = React.forwardRef( [colorCommonStyles[colors].error]: error, [styles[SIZE_TO_CLASSNAME_MAP[size]]]: hasInnerLabel, + [styles['size-40']]: size === 40, [styles.hasInnerLabel]: hasInnerLabel, [colorCommonStyles[colors].hasInnerLabel]: hasInnerLabel, }, diff --git a/packages/input/src/components/base-input/index.module.css b/packages/input/src/components/base-input/index.module.css index ed951b9ae0..817eaff6b3 100644 --- a/packages/input/src/components/base-input/index.module.css +++ b/packages/input/src/components/base-input/index.module.css @@ -14,6 +14,11 @@ text-overflow: ellipsis; box-sizing: border-box; -webkit-appearance: none; + + &.size-40 { + @mixin paragraph_component_secondary; + padding: var(--gap-0) var(--gap-8); + } } .input::placeholder { diff --git a/packages/input/src/docs/Component.stories.tsx b/packages/input/src/docs/Component.stories.tsx index 40ab63dd96..5830388953 100644 --- a/packages/input/src/docs/Component.stories.tsx +++ b/packages/input/src/docs/Component.stories.tsx @@ -91,7 +91,7 @@ export const input_mobile: Story = { value={text('value', '')} block={boolean('block', false)} clear={boolean('clear', false)} - size={select('size', [48, 56, 64, 72], 48)} + size={select('size', [40, 48, 56, 64, 72], 48)} colors={colors} disabled={boolean('disabled', false)} placeholder={text('placeholder', '')} @@ -138,7 +138,7 @@ export const input_desktop: Story = { value={text('value', '')} block={boolean('block', false)} clear={boolean('clear', false)} - size={select('size', [48, 56, 64, 72], 48)} + size={select('size', [40, 48, 56, 64, 72], 48)} colors={colors} disabled={boolean('disabled', false)} placeholder={text('placeholder', '')} diff --git a/packages/number-input/src/docs/Component.stories.tsx b/packages/number-input/src/docs/Component.stories.tsx index e1b54c5c18..4b28f7b8fc 100644 --- a/packages/number-input/src/docs/Component.stories.tsx +++ b/packages/number-input/src/docs/Component.stories.tsx @@ -47,7 +47,7 @@ export const number_input: Story = { fractionLength={number('fractionLength', 2)} block={boolean('block', false)} clear={boolean('clear', false)} - size={select('size', [48, 56, 64, 72], 48)} + size={select('size', [40, 48, 56, 64, 72], 48)} colors={colors} disabled={boolean('disabled', false)} placeholder={text('placeholder', '')} diff --git a/packages/textarea/src/typings.ts b/packages/textarea/src/typings.ts index fbb697a8a7..f1600f0e99 100644 --- a/packages/textarea/src/typings.ts +++ b/packages/textarea/src/typings.ts @@ -28,7 +28,7 @@ export type TextareaIncomeProps = { * Размер компонента * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно */ - size?: 's' | 'm' | 'l' | 'xl' | 48 | 56 | 64 | 72; + size?: 's' | 'm' | 'l' | 'xl' | 40 | 48 | 56 | 64 | 72; /** * Набор цветов для компонента From 18ad211205a70f9e416d7f27da656cfe38281c52 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 15:24:47 +0700 Subject: [PATCH 12/43] feat(textarea): fix fontsize --- packages/textarea/src/index.module.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/textarea/src/index.module.css b/packages/textarea/src/index.module.css index 4556d76624..9a676a851c 100644 --- a/packages/textarea/src/index.module.css +++ b/packages/textarea/src/index.module.css @@ -74,6 +74,10 @@ color: transparent; caret-color: var(--input-color); } + + &.size-40 { + @mixin paragraph_component_secondary; + } } .overflowHidden.overflowHidden { From 0f76ba8f05bcfc858ab05b6cc41a7ee4ed19224f Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 16:24:39 +0700 Subject: [PATCH 13/43] feat(form-control): fix label font, position --- .../src/components/base-form-control/index.module.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/form-control/src/components/base-form-control/index.module.css b/packages/form-control/src/components/base-form-control/index.module.css index bf3402c017..d0df780243 100644 --- a/packages/form-control/src/components/base-form-control/index.module.css +++ b/packages/form-control/src/components/base-form-control/index.module.css @@ -115,7 +115,9 @@ } & .label { + @mixin paragraph_component_secondary; top: calc(var(--form-control-40-min-height) / 2); + left: var(--gap-8); } & .addons { From 8ce9fd51b5eb43c0458baaceaaf1de3c3ad28bb1 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 18:50:24 +0700 Subject: [PATCH 14/43] feat(input): change clear icon size --- .../src/components/base-input/Component.tsx | 1 + .../src/components/clear-button/Component.tsx | 14 ++++++++++++-- .../components/clear-button/index.module.css | 17 +++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/input/src/components/base-input/Component.tsx b/packages/input/src/components/base-input/Component.tsx index fda96a046b..281e3a2af9 100644 --- a/packages/input/src/components/base-input/Component.tsx +++ b/packages/input/src/components/base-input/Component.tsx @@ -374,6 +374,7 @@ export const BaseInput = React.forwardRef( disabled={disabled} colors={colors} dataTestId={getDataTestId(dataTestId, 'clear-icon')} + size={size} /> )} {rightAddons} diff --git a/packages/input/src/components/clear-button/Component.tsx b/packages/input/src/components/clear-button/Component.tsx index 8199319904..8aa1a24430 100644 --- a/packages/input/src/components/clear-button/Component.tsx +++ b/packages/input/src/components/clear-button/Component.tsx @@ -4,6 +4,8 @@ import cn from 'classnames'; import { Button } from '@alfalab/core-components-button'; import { CrossCircleMIcon } from '@alfalab/icons-glyph/CrossCircleMIcon'; +import { BaseInputProps } from '../base-input'; + import defaultColors from './default.module.css'; import styles from './index.module.css'; import invertedColors from './inverted.module.css'; @@ -18,6 +20,7 @@ interface ClearButtonProps { onClick: (event: React.MouseEvent) => void; colors: 'default' | 'inverted'; dataTestId?: string; + size: BaseInputProps['size']; } const preventDefault = (e: React.UIEvent) => e.preventDefault(); @@ -27,18 +30,25 @@ export const ClearButton: React.FC = ({ disabled, onClick, dataTestId, + size, }) => ( ); diff --git a/packages/input/src/components/clear-button/index.module.css b/packages/input/src/components/clear-button/index.module.css index 320b2a40d0..ef5048b759 100644 --- a/packages/input/src/components/clear-button/index.module.css +++ b/packages/input/src/components/clear-button/index.module.css @@ -6,8 +6,21 @@ transition: opacity 0.2s ease; } -.clearButton + * { - margin-left: var(--gap-4); +.clearIcon { + &.size-40 { + width: 16px; + height: 16px; + } +} + +.clearButton { + & + * { + margin-left: var(--gap-4); + } + + &.size-40 + * { + margin-left: 6px; + } } .clearButton + [data-addon='error-icon'] { From 3462ef076bd7619d39b1d3716b482579088ca2a9 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 19:03:25 +0700 Subject: [PATCH 15/43] feat(input): change success, error icon size --- .../src/components/base-input/Component.tsx | 17 +++++++++++++---- .../src/components/base-input/index.module.css | 8 ++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/input/src/components/base-input/Component.tsx b/packages/input/src/components/base-input/Component.tsx index 281e3a2af9..7b6a8d5e7c 100644 --- a/packages/input/src/components/base-input/Component.tsx +++ b/packages/input/src/components/base-input/Component.tsx @@ -379,19 +379,28 @@ export const BaseInput = React.forwardRef( )} {rightAddons} {error && ( -
+
)} {success && !error && ( -
+
diff --git a/packages/input/src/components/base-input/index.module.css b/packages/input/src/components/base-input/index.module.css index 817eaff6b3..7b14203f43 100644 --- a/packages/input/src/components/base-input/index.module.css +++ b/packages/input/src/components/base-input/index.module.css @@ -61,6 +61,10 @@ &:not(:only-child) { margin-left: var(--gap-4); } + + &.size-40:not(:only-child) { + margin-left: 6px; + } } * + .errorIcon { @@ -77,6 +81,10 @@ button[class*='eye'] + .errorIcon { &:not(:only-child) { margin-left: var(--gap-4); } + + &.size-40:not(:only-child) { + margin-left: 6px; + } } button[class*='eye'] + .successIcon { From 3726244f7cdf2c6c08a9a550b7ac7ec762dc7ecb Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 19:13:42 +0700 Subject: [PATCH 16/43] feat(input): typo --- packages/input/src/components/clear-button/Component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/input/src/components/clear-button/Component.tsx b/packages/input/src/components/clear-button/Component.tsx index 8aa1a24430..b86ac1495a 100644 --- a/packages/input/src/components/clear-button/Component.tsx +++ b/packages/input/src/components/clear-button/Component.tsx @@ -20,7 +20,7 @@ interface ClearButtonProps { onClick: (event: React.MouseEvent) => void; colors: 'default' | 'inverted'; dataTestId?: string; - size: BaseInputProps['size']; + size?: BaseInputProps['size']; } const preventDefault = (e: React.UIEvent) => e.preventDefault(); From 44e4f8fb7a8d96c1097c10b35489e14805528242 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 19:25:50 +0700 Subject: [PATCH 17/43] feat(input): update screenshots --- .../amount-input-screenshots-sprite-size-snap.png | 4 ++-- .../form-control-screenshots-size-prop-default-theme-snap.png | 4 ++-- .../form-control-screenshots-size-prop-mobile-theme-snap.png | 4 ++-- .../form-control-screenshots-size-prop-site-theme-snap.png | 4 ++-- .../input-screenshots-size-prop-default-theme-snap.png | 4 ++-- .../input-screenshots-size-prop-mobile-theme-snap.png | 4 ++-- .../input-screenshots-size-prop-site-theme-snap.png | 4 ++-- .../select-click-theme-main-props-snap.png | 4 ++-- .../select-default-theme-main-props-snap.png | 4 ++-- .../textarea-sprite-click-main-props-2-snap.png | 4 ++-- .../textarea-sprite-click-main-props-snap.png | 4 ++-- .../textarea-sprite-default-main-props-2-snap.png | 4 ++-- .../textarea-sprite-default-main-props-snap.png | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png b/packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png index 5d99b9edb1..6baa13b7dc 100644 --- a/packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png +++ b/packages/amount-input/src/__image_snapshots__/amount-input-screenshots-sprite-size-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8d350a503106407f6f2d48daf2a85f2b2c626c22cbbe2dc1f767a6bce4cecd06 -size 11020 +oid sha256:5f3db703a77a95bbed9175b297ca9d0fb5e4e3b426a6bb1708fb4af83d4eb2d5 +size 11559 diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png index c25178a033..ab81e94014 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-default-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0506de7662df134a79ca6e43d5860ea86b10e78d67ed75913280d0737377dc73 -size 15013 +oid sha256:07655547edde83db7ef9c22f6b59fdbb945863f160451809c4c0fadbb1efa2e3 +size 15562 diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png index c25178a033..ab81e94014 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-mobile-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0506de7662df134a79ca6e43d5860ea86b10e78d67ed75913280d0737377dc73 -size 15013 +oid sha256:07655547edde83db7ef9c22f6b59fdbb945863f160451809c4c0fadbb1efa2e3 +size 15562 diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png index 08f1a0d7b8..c1af3d7811 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a109f20f8164a536d777842b626cf4c274897d2797146d40afc6861fe8f9be0 -size 14193 +oid sha256:291ddea86ead4cc3d20eda09f3024ea1be4ee555682e7f5bdd17aa60290193bc +size 14480 diff --git a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png index 091da1a818..75a568db8e 100644 --- a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png +++ b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-default-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:586aa70d1998d546601679f0293ebbfdbbd64ee5e3b04aee494f14dcdb606026 -size 15007 +oid sha256:1dee65a5059621e59f3f3309fc5d15e07605a2db05b45fb3610cbcdf51fb83a6 +size 15552 diff --git a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png index 091da1a818..75a568db8e 100644 --- a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png +++ b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-mobile-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:586aa70d1998d546601679f0293ebbfdbbd64ee5e3b04aee494f14dcdb606026 -size 15007 +oid sha256:1dee65a5059621e59f3f3309fc5d15e07605a2db05b45fb3610cbcdf51fb83a6 +size 15552 diff --git a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png index 2d9698322c..3c604ad28a 100644 --- a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png +++ b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e09752261d94022081172bd02b2eb5148c572ba4c38b223c27c0698974fe61ed -size 13957 +oid sha256:d1bcf48e965a85acab11e51cdc36513bc4fcde37209d60e4873352d8858ffda7 +size 14481 diff --git a/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png b/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png index a2249905a8..d218bc4d1d 100644 --- a/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png +++ b/packages/select/src/__image_snapshots__/select-click-theme-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7aab4f610c7db21193bc486274c818167da9242c4034e4b5193ec97561edc11 -size 39543 +oid sha256:22290c16fc1eac066031a33eed602d55dd5d3a988c60f925d43a7bcd09270ffe +size 39512 diff --git a/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png b/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png index a2249905a8..d218bc4d1d 100644 --- a/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png +++ b/packages/select/src/__image_snapshots__/select-default-theme-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7aab4f610c7db21193bc486274c818167da9242c4034e4b5193ec97561edc11 -size 39543 +oid sha256:22290c16fc1eac066031a33eed602d55dd5d3a988c60f925d43a7bcd09270ffe +size 39512 diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png index 89f6300c40..04ba640c5a 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-2-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4503cbe8da92fda89d5841bc35e8be287a89357c04f3630ab12dfffa01b0c946 -size 66344 +oid sha256:6fd1fd08675be7b4dedc6b1d7fccf9fca7df9ee7fb7a640989a8f190f3e25c3e +size 71328 diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png index f4a22270ce..1e5920b1b3 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-click-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c1c80560278a9a91b9453c4f0e9ebd4eecaf05ab7642040a3cd20cf09a4db137 -size 64445 +oid sha256:f2a8470b56a0c5ed3aa8ddb01bc8e08aff5b3e22f63beddd045d0f99e019de03 +size 70585 diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png index 89f6300c40..04ba640c5a 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-2-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4503cbe8da92fda89d5841bc35e8be287a89357c04f3630ab12dfffa01b0c946 -size 66344 +oid sha256:6fd1fd08675be7b4dedc6b1d7fccf9fca7df9ee7fb7a640989a8f190f3e25c3e +size 71328 diff --git a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png index f4a22270ce..1e5920b1b3 100644 --- a/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png +++ b/packages/textarea/src/__image_snapshots__/textarea-sprite-default-main-props-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c1c80560278a9a91b9453c4f0e9ebd4eecaf05ab7642040a3cd20cf09a4db137 -size 64445 +oid sha256:f2a8470b56a0c5ed3aa8ddb01bc8e08aff5b3e22f63beddd045d0f99e019de03 +size 70585 From c1a32b262a9aff9c210f87aa8b13a1fa18ef5b43 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Thu, 28 Nov 2024 19:50:40 +0700 Subject: [PATCH 18/43] feat(form-control): fix site theme --- packages/form-control/src/desktop/desktop.module.css | 4 ++++ packages/form-control/src/mobile/mobile.module.css | 4 ++++ packages/themes/src/mixins/form-control/site.css | 1 + 3 files changed, 9 insertions(+) diff --git a/packages/form-control/src/desktop/desktop.module.css b/packages/form-control/src/desktop/desktop.module.css index 2570af73c6..60ad6834e5 100644 --- a/packages/form-control/src/desktop/desktop.module.css +++ b/packages/form-control/src/desktop/desktop.module.css @@ -16,6 +16,10 @@ .size-40 .inner { border-radius: var(--form-control-40-border-radius); + + &:before { + left: 0; + } } .size-48 .inner { diff --git a/packages/form-control/src/mobile/mobile.module.css b/packages/form-control/src/mobile/mobile.module.css index 48550e5449..8604d456bf 100644 --- a/packages/form-control/src/mobile/mobile.module.css +++ b/packages/form-control/src/mobile/mobile.module.css @@ -16,6 +16,10 @@ .size-40 .inner { border-radius: var(--form-control-mobile-40-border-radius); + + &:before { + left: 0; + } } .size-48 .inner { diff --git a/packages/themes/src/mixins/form-control/site.css b/packages/themes/src/mixins/form-control/site.css index 372302e87c..a1799a36e6 100644 --- a/packages/themes/src/mixins/form-control/site.css +++ b/packages/themes/src/mixins/form-control/site.css @@ -5,6 +5,7 @@ --form-control-m-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-l-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-xl-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; + --form-control-mobile-40-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-mobile-s-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-mobile-m-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; --form-control-mobile-l-border-radius: var(--border-radius-4) var(--border-radius-4) 0 0; From 3af40566a363fd6696e1534890974c7a56cf2ce7 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 29 Nov 2024 11:24:40 +0700 Subject: [PATCH 19/43] feat: update screenshots --- .../form-control-screenshots-size-prop-site-theme-snap.png | 2 +- .../input-screenshots-size-prop-site-theme-snap.png | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png index c1af3d7811..bae9fb3963 100644 --- a/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png +++ b/packages/form-control/src/__image_snapshots__/form-control-screenshots-size-prop-site-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:291ddea86ead4cc3d20eda09f3024ea1be4ee555682e7f5bdd17aa60290193bc +oid sha256:e042a3c3ef015490280ffed2d74732bdf9deecb1b5f8602c0cd644b3202f8a88 size 14480 diff --git a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png index 3c604ad28a..5deab2dbd2 100644 --- a/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png +++ b/packages/input/src/__image_snapshots__/input-screenshots-size-prop-site-theme-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d1bcf48e965a85acab11e51cdc36513bc4fcde37209d60e4873352d8858ffda7 -size 14481 +oid sha256:8e9ac3dbd88fb8c07692df4a6440c5aefd4e5330f8514b59a213f1843c7016d8 +size 14480 From 24bba885d11bc75affa8c21592fd9368abce673e Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 29 Nov 2024 12:08:35 +0700 Subject: [PATCH 20/43] feat(select): improve size 40 --- .../src/components/clear-button/Component.tsx | 7 +++++-- .../src/components/clear-button/index.module.css | 13 +++++++++++++ packages/select/src/components/field/Component.tsx | 11 ++++++++++- .../select/src/components/field/index.module.css | 4 ++++ packages/select/src/typings.ts | 6 ++++++ 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/packages/select/src/components/clear-button/Component.tsx b/packages/select/src/components/clear-button/Component.tsx index 0d37b1c41f..f56d44d3e5 100644 --- a/packages/select/src/components/clear-button/Component.tsx +++ b/packages/select/src/components/clear-button/Component.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import cn from 'classnames'; import { Button } from '@alfalab/core-components-button'; import { CrossCircleMIcon } from '@alfalab/icons-glyph/CrossCircleMIcon'; @@ -7,13 +8,15 @@ import { ClearButtonProps } from '../../typings'; import styles from './index.module.css'; -export const ClearButton = ({ disabled, onClick, dataTestId }: ClearButtonProps) => ( +export const ClearButton = ({ disabled, onClick, dataTestId, size }: ClearButtonProps) => (
) : null} diff --git a/packages/select/src/components/field/index.module.css b/packages/select/src/components/field/index.module.css index 7edd937537..9b47f09f74 100644 --- a/packages/select/src/components/field/index.module.css +++ b/packages/select/src/components/field/index.module.css @@ -44,6 +44,10 @@ overflow: hidden; text-overflow: ellipsis; text-align: left; + + &.size-40 { + @mixin paragraph_component_secondary; + } } .focusVisible { diff --git a/packages/select/src/typings.ts b/packages/select/src/typings.ts index 65d000d0db..18f48e1b48 100644 --- a/packages/select/src/typings.ts +++ b/packages/select/src/typings.ts @@ -950,4 +950,10 @@ export type ClearButtonProps = { * Идентификатор для систем автоматизированного тестирования */ dataTestId?: string; + + /** + * Размер компонента + * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно + */ + size?: FormControlProps['size']; }; From 4bc93e13f9bce85024d15ffb4657e5db5b77a9cb Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 29 Nov 2024 12:32:55 +0700 Subject: [PATCH 21/43] feat(select): fix chevron --- packages/select/src/components/arrow/Component.tsx | 12 +++++++++--- .../select/src/components/base-select/Component.tsx | 2 +- packages/select/src/typings.ts | 6 ++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/select/src/components/arrow/Component.tsx b/packages/select/src/components/arrow/Component.tsx index 38a35b0202..31c87aed30 100644 --- a/packages/select/src/components/arrow/Component.tsx +++ b/packages/select/src/components/arrow/Component.tsx @@ -2,11 +2,17 @@ import React from 'react'; import cn from 'classnames'; import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon'; +import { ChevronDownSIcon } from '@alfalab/icons-glyph/ChevronDownSIcon'; import { ArrowProps } from '../../typings'; import styles from './index.module.css'; -export const Arrow = ({ open, className }: ArrowProps) => ( - -); +export const Arrow = ({ open, className, size }: ArrowProps) => { + if (size && size === 40) { + return ( + + ); + } + return ; +}; diff --git a/packages/select/src/components/base-select/Component.tsx b/packages/select/src/components/base-select/Component.tsx index 97f96094b1..b38ebc453d 100644 --- a/packages/select/src/components/base-select/Component.tsx +++ b/packages/select/src/components/base-select/Component.tsx @@ -674,7 +674,7 @@ export const BaseSelect = forwardRef( placeholder={placeholder} label={label && {label}} labelView={labelView} - Arrow={Arrow && } + Arrow={Arrow && } error={error} hint={hint} valueRenderer={valueRenderer} diff --git a/packages/select/src/typings.ts b/packages/select/src/typings.ts index 18f48e1b48..8a06ede806 100644 --- a/packages/select/src/typings.ts +++ b/packages/select/src/typings.ts @@ -497,6 +497,12 @@ export type ArrowProps = { * Флаг, открыто ли меню */ open?: boolean; + + /** + * Размер компонента + * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно + */ + size?: BaseSelectProps['size']; }; export type OptionsListProps = { From 210fadf4f8b57064078c6223ffea1be0abfcad22 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 29 Nov 2024 12:45:04 +0700 Subject: [PATCH 22/43] feat(select): fix options size --- packages/select/src/components/option/index.module.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/select/src/components/option/index.module.css b/packages/select/src/components/option/index.module.css index 2bb85b5cb1..9668c7f5a6 100644 --- a/packages/select/src/components/option/index.module.css +++ b/packages/select/src/components/option/index.module.css @@ -39,6 +39,12 @@ .size-40 { min-height: var(--size-xs-height); + + & .textContent { + @mixin paragraph_component_secondary; + padding-top: 10px; + padding-bottom: 10px; + } } .size-48 { From 88420d919b85ab3486c839433086feb14138d700 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 29 Nov 2024 13:15:57 +0700 Subject: [PATCH 23/43] feat(phone-input): add size 40 --- .../src/Component.screenshots.test.ts | 33 ++++++++++++++++++- .../phone-input-size-sprite-snap.png | 3 ++ .../src/docs/Component.stories.tsx | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 packages/phone-input/src/__image_snapshots__/phone-input-size-sprite-snap.png diff --git a/packages/phone-input/src/Component.screenshots.test.ts b/packages/phone-input/src/Component.screenshots.test.ts index 49dbc23f02..73316250f1 100644 --- a/packages/phone-input/src/Component.screenshots.test.ts +++ b/packages/phone-input/src/Component.screenshots.test.ts @@ -1,4 +1,15 @@ -import { createPreview } from '../../screenshot-utils'; +import { + createPreview, + createSpriteStorybookUrl, + setupScreenshotTesting, +} from '../../screenshot-utils'; + +const screenshotTesting = setupScreenshotTesting({ + it, + beforeAll, + afterAll, + expect, +}); describe('PhoneInput ', () => createPreview( @@ -16,3 +27,23 @@ describe('PhoneInput ', () => viewport: { width: 1024, height: 600 }, }, )); + +describe('PhoneInput | size', () => { + screenshotTesting({ + cases: [ + [ + 'sprite', + createSpriteStorybookUrl({ + componentName: 'PhoneInput', + knobs: { + label: 'Телефон', + value: '+71234567890', + size: [40, 48, 56, 64, 72], + block: true, + }, + size: { width: 240, height: 150 }, + }), + ], + ], + })(); +}); diff --git a/packages/phone-input/src/__image_snapshots__/phone-input-size-sprite-snap.png b/packages/phone-input/src/__image_snapshots__/phone-input-size-sprite-snap.png new file mode 100644 index 0000000000..56a1f19888 --- /dev/null +++ b/packages/phone-input/src/__image_snapshots__/phone-input-size-sprite-snap.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b916c7c14f0e59cabbe788486e2afd02e23fd0d579f06f474f6638e647cba08 +size 28704 diff --git a/packages/phone-input/src/docs/Component.stories.tsx b/packages/phone-input/src/docs/Component.stories.tsx index 823df39535..4d55b0b34d 100644 --- a/packages/phone-input/src/docs/Component.stories.tsx +++ b/packages/phone-input/src/docs/Component.stories.tsx @@ -17,7 +17,7 @@ export const phone_input: Story = { render: () => ( Date: Fri, 29 Nov 2024 13:21:26 +0700 Subject: [PATCH 24/43] feat(select): fix lint --- packages/select/src/components/arrow/Component.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/select/src/components/arrow/Component.tsx b/packages/select/src/components/arrow/Component.tsx index 31c87aed30..e0a2e69089 100644 --- a/packages/select/src/components/arrow/Component.tsx +++ b/packages/select/src/components/arrow/Component.tsx @@ -14,5 +14,6 @@ export const Arrow = ({ open, className, size }: ArrowProps) => { ); } + return ; }; From f8e392a3ddf1f6fb9f94223ede5cadf1cb927ad0 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Fri, 29 Nov 2024 13:55:55 +0700 Subject: [PATCH 25/43] feat: update changeset --- .changeset/{stale-llamas-end.md => kind-carpets-wait.md} | 1 + 1 file changed, 1 insertion(+) rename .changeset/{stale-llamas-end.md => kind-carpets-wait.md} (93%) diff --git a/.changeset/stale-llamas-end.md b/.changeset/kind-carpets-wait.md similarity index 93% rename from .changeset/stale-llamas-end.md rename to .changeset/kind-carpets-wait.md index 4f352dd26d..38370e85b3 100644 --- a/.changeset/stale-llamas-end.md +++ b/.changeset/kind-carpets-wait.md @@ -5,6 +5,7 @@ '@alfalab/core-components-input-autocomplete': minor '@alfalab/core-components-number-input': minor '@alfalab/core-components-password-input': minor +'@alfalab/core-components-phone-input': minor '@alfalab/core-components-select': minor '@alfalab/core-components-select-with-tags': minor '@alfalab/core-components-slider-input': minor From a9b5df14c56f065cd8543c630fd365dc2cbf46ab Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Wed, 11 Dec 2024 15:53:33 +0700 Subject: [PATCH 26/43] feat(with-suffix): add size 40 --- packages/with-suffix/src/Component.tsx | 4 +++- packages/with-suffix/src/index.module.css | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/with-suffix/src/Component.tsx b/packages/with-suffix/src/Component.tsx index 4aaf5e2a6b..03c8350feb 100644 --- a/packages/with-suffix/src/Component.tsx +++ b/packages/with-suffix/src/Component.tsx @@ -108,7 +108,9 @@ export const withSuffix = (Input: FC
{visibleValue} {suffix && ( diff --git a/packages/with-suffix/src/index.module.css b/packages/with-suffix/src/index.module.css index 03237047e3..b4cf5eea28 100644 --- a/packages/with-suffix/src/index.module.css +++ b/packages/with-suffix/src/index.module.css @@ -11,6 +11,11 @@ align-items: center; display: none; pointer-events: none; + + &.size-40 { + @mixin paragraph_component_secondary; + padding: var(--gap-0) var(--gap-8); + } } input:focus:not(:read-only) + .suffixContainer, From 082e40a15e4113540ffde026a964656a81c8091a Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Wed, 11 Dec 2024 17:05:41 +0700 Subject: [PATCH 27/43] feat(input): fix icon size 40 for input and form-control --- .../src/__snapshots__/Component.test.tsx.snap | 10 ++--- .../src/__snapshots__/Component.test.tsx.snap | 12 +++--- .../src/__snapshots__/Component.test.tsx.snap | 10 ++--- .../src/__snapshots__/Component.test.tsx.snap | 4 +- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../base-form-control/index.module.css | 5 --- .../src/docs/Component.stories.tsx | 31 ++++++++++---- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/Component.test.tsx.snap | 4 +- .../src/components/base-input/Component.tsx | 14 ++----- .../src/components/clear-button/Component.tsx | 41 +++++++++---------- .../components/clear-button/index.module.css | 7 ---- packages/input/src/docs/Component.stories.tsx | 31 ++++++++++---- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/component.test.tsx.snap | 2 +- .../src/__snapshots__/Component.test.tsx.snap | 4 +- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/component.test.tsx.snap | 2 +- .../src/__snapshots__/Component.test.tsx.snap | 4 +- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/Component.test.tsx.snap | 8 ++-- .../src/__snapshots__/Component.test.tsx.snap | 2 +- 25 files changed, 106 insertions(+), 101 deletions(-) diff --git a/packages/amount-input/src/__snapshots__/Component.test.tsx.snap b/packages/amount-input/src/__snapshots__/Component.test.tsx.snap index 038801b918..d7c580dee6 100644 --- a/packages/amount-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/amount-input/src/__snapshots__/Component.test.tsx.snap @@ -21,7 +21,7 @@ Object { class="input" > diff --git a/packages/date-time-input/src/__snapshots__/Component.test.tsx.snap b/packages/date-time-input/src/__snapshots__/Component.test.tsx.snap index c6df6bc558..6a27557c68 100644 --- a/packages/date-time-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/date-time-input/src/__snapshots__/Component.test.tsx.snap @@ -18,7 +18,7 @@ exports[`DateTimeInput Display tests should match snapshot 1`] = ` class="input" > diff --git a/packages/form-control/src/components/base-form-control/index.module.css b/packages/form-control/src/components/base-form-control/index.module.css index d0df780243..596986b6fa 100644 --- a/packages/form-control/src/components/base-form-control/index.module.css +++ b/packages/form-control/src/components/base-form-control/index.module.css @@ -121,11 +121,6 @@ } & .addons { - & > svg { - width: 16px; - height: 16px; - } - &.rightAddons { padding-right: var(--gap-8); } diff --git a/packages/form-control/src/docs/Component.stories.tsx b/packages/form-control/src/docs/Component.stories.tsx index 5a0d26a769..c54a285dd5 100644 --- a/packages/form-control/src/docs/Component.stories.tsx +++ b/packages/form-control/src/docs/Component.stories.tsx @@ -2,6 +2,7 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; import { text, select, boolean } from '@storybook/addon-knobs'; import { StarMIcon } from '@alfalab/icons-glyph/StarMIcon'; +import { DiamondsSIcon } from '@alfalab/icons-glyph/DiamondsSIcon'; import { FormControl } from '@alfalab/core-components-form-control'; import { FormControlMobile } from '@alfalab/core-components-form-control/mobile'; import { FormControlDesktop } from '@alfalab/core-components-form-control/desktop'; @@ -18,6 +19,10 @@ export const form_control: Story = { name: 'FormControl', render: () => { const colors = select('colors', ['default', 'inverted'], 'default'); + const size = select('size', [40, 48, 56, 64, 72], 48); + + const IconComponent = size == 40 ? DiamondsSIcon : StarMIcon; + return (
} - leftAddons={boolean('leftAddons', false) && } + rightAddons={boolean('rightAddons', false) && } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} />
@@ -57,6 +62,10 @@ export const form_control_mobile: Story = { name: 'FormControlMobile', render: () => { const colors = select('colors', ['default', 'inverted'], 'default'); + const size = select('size', [40, 48, 56, 64, 72], 48); + + const IconComponent = size == 40 ? DiamondsSIcon : StarMIcon; + return (
} - leftAddons={boolean('leftAddons', false) && } + rightAddons={boolean('rightAddons', false) && } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} />
@@ -96,6 +105,10 @@ export const form_control_desktop: Story = { name: 'FormControlDesktop', render: () => { const colors = select('colors', ['default', 'inverted'], 'default'); + const size = select('size', [40, 48, 56, 64, 72], 48); + + const IconComponent = size == 40 ? DiamondsSIcon : StarMIcon; + return (
} - leftAddons={boolean('leftAddons', false) && } + rightAddons={boolean('rightAddons', false) && } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} />
diff --git a/packages/input-autocomplete/src/__snapshots__/Component.test.tsx.snap b/packages/input-autocomplete/src/__snapshots__/Component.test.tsx.snap index a97d91ef46..3301190c22 100644 --- a/packages/input-autocomplete/src/__snapshots__/Component.test.tsx.snap +++ b/packages/input-autocomplete/src/__snapshots__/Component.test.tsx.snap @@ -188,7 +188,7 @@ exports[`InputAutocompleteMobile Snapshots tests should match snapshot in open s class="input" > @@ -42,7 +42,7 @@ Object { class="input" > diff --git a/packages/input/src/components/base-input/Component.tsx b/packages/input/src/components/base-input/Component.tsx index 7b6a8d5e7c..99ff8a6f09 100644 --- a/packages/input/src/components/base-input/Component.tsx +++ b/packages/input/src/components/base-input/Component.tsx @@ -380,9 +380,7 @@ export const BaseInput = React.forwardRef( {rightAddons} {error && (
(
)} {success && !error && ( -
+
( {...restProps} className={cn( styles.input, + styles[`size-${size}`], colorCommonStyles[colors].input, { [styles.disableUserInput]: disableUserInput, [colorCommonStyles[colors].disableUserInput]: disableUserInput, - [colorCommonStyles[colors].error]: error, - [styles[SIZE_TO_CLASSNAME_MAP[size]]]: hasInnerLabel, - [styles['size-40']]: size === 40, [styles.hasInnerLabel]: hasInnerLabel, [colorCommonStyles[colors].hasInnerLabel]: hasInnerLabel, }, diff --git a/packages/input/src/components/clear-button/Component.tsx b/packages/input/src/components/clear-button/Component.tsx index b86ac1495a..9a5d931475 100644 --- a/packages/input/src/components/clear-button/Component.tsx +++ b/packages/input/src/components/clear-button/Component.tsx @@ -3,6 +3,7 @@ import cn from 'classnames'; import { Button } from '@alfalab/core-components-button'; import { CrossCircleMIcon } from '@alfalab/icons-glyph/CrossCircleMIcon'; +import { CrossCircleSIcon } from '@alfalab/icons-glyph/CrossCircleSIcon'; import { BaseInputProps } from '../base-input'; @@ -31,24 +32,22 @@ export const ClearButton: React.FC = ({ onClick, dataTestId, size, -}) => ( - -); +}) => { + const IconComponent = size === 40 ? CrossCircleSIcon : CrossCircleMIcon; + + return ( + + ); +}; diff --git a/packages/input/src/components/clear-button/index.module.css b/packages/input/src/components/clear-button/index.module.css index ef5048b759..4b79bfb194 100644 --- a/packages/input/src/components/clear-button/index.module.css +++ b/packages/input/src/components/clear-button/index.module.css @@ -6,13 +6,6 @@ transition: opacity 0.2s ease; } -.clearIcon { - &.size-40 { - width: 16px; - height: 16px; - } -} - .clearButton { & + * { margin-left: var(--gap-4); diff --git a/packages/input/src/docs/Component.stories.tsx b/packages/input/src/docs/Component.stories.tsx index 5830388953..2935279514 100644 --- a/packages/input/src/docs/Component.stories.tsx +++ b/packages/input/src/docs/Component.stories.tsx @@ -6,6 +6,7 @@ import { StarMIcon } from '@alfalab/icons-glyph/StarMIcon'; import { Input } from '@alfalab/core-components-input'; import { InputMobile } from '@alfalab/core-components-input/mobile'; import { InputDesktop } from '@alfalab/core-components-input/desktop'; +import { DiamondsSIcon } from '@alfalab/icons-glyph/DiamondsSIcon'; const meta: Meta = { title: 'Components/Input', @@ -19,6 +20,10 @@ export const input: Story = { name: 'Input', render: () => { const colors = select('colors', ['default', 'inverted'], 'default'); + const size = select('size', [40, 48, 56, 64, 72], 48); + + const IconComponent = size == 40 ? DiamondsSIcon : StarMIcon; + return (
} - leftAddons={boolean('leftAddons', false) && } + rightAddons={boolean('rightAddons', false) && } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} readOnly={boolean('readOnly', false)} disableUserInput={boolean('disableUserInput', false)} @@ -67,6 +72,10 @@ export const input_mobile: Story = { name: 'InputMobile', render: () => { const colors = select('colors', ['default', 'inverted'], 'default'); + const size = select('size', [40, 48, 56, 64, 72], 48); + + const IconComponent = size == 40 ? DiamondsSIcon : StarMIcon; + return (
} - leftAddons={boolean('leftAddons', false) && } + rightAddons={boolean('rightAddons', false) && } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} readOnly={boolean('readOnly', false)} /> @@ -114,6 +123,10 @@ export const input_desktop: Story = { name: 'InputDesktop', render: () => { const colors = select('colors', ['default', 'inverted'], 'default'); + const size = select('size', [40, 48, 56, 64, 72], 48); + + const IconComponent = size == 40 ? DiamondsSIcon : StarMIcon; + return (
} - leftAddons={boolean('leftAddons', false) && } + rightAddons={boolean('rightAddons', false) && } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} readOnly={boolean('readOnly', false)} /> diff --git a/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap b/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap index 0869b5e04b..ba47f56382 100644 --- a/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap @@ -87,7 +87,7 @@ exports[`InternationalPhoneInput should match snapshot 1`] = ` class="input" > diff --git a/packages/intl-phone-input/src/__snapshots__/component.test.tsx.snap b/packages/intl-phone-input/src/__snapshots__/component.test.tsx.snap index 06682e17ca..aa15f8145a 100644 --- a/packages/intl-phone-input/src/__snapshots__/component.test.tsx.snap +++ b/packages/intl-phone-input/src/__snapshots__/component.test.tsx.snap @@ -99,7 +99,7 @@ exports[`IntlPhoneInput should match snapshot 1`] = ` aria-controls="downshift-:r0:-menu" aria-labelledby="downshift-:r0:-label" autocomplete="off" - class="input input" + class="input size-m input" id="downshift-:r0:-input" tabindex="0" type="tel" diff --git a/packages/masked-input/src/__snapshots__/Component.test.tsx.snap b/packages/masked-input/src/__snapshots__/Component.test.tsx.snap index 214241c044..adcac3babc 100644 --- a/packages/masked-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/masked-input/src/__snapshots__/Component.test.tsx.snap @@ -18,7 +18,7 @@ Object { class="input" > @@ -42,7 +42,7 @@ Object { class="input" > diff --git a/packages/number-input/src/__snapshots__/Component.test.tsx.snap b/packages/number-input/src/__snapshots__/Component.test.tsx.snap index 643d398dcf..64a58278d8 100644 --- a/packages/number-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/number-input/src/__snapshots__/Component.test.tsx.snap @@ -15,7 +15,7 @@ exports[`NumberInput Snapshots tests should match snapshot 1`] = ` class="input" > diff --git a/packages/phone-input/src/__snapshots__/Component.test.tsx.snap b/packages/phone-input/src/__snapshots__/Component.test.tsx.snap index c62a8afe39..195b0cd22c 100644 --- a/packages/phone-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/phone-input/src/__snapshots__/Component.test.tsx.snap @@ -18,7 +18,7 @@ Object { class="input" > @@ -42,7 +42,7 @@ Object { class="input" > diff --git a/packages/slider-input/src/__snapshots__/Component.test.tsx.snap b/packages/slider-input/src/__snapshots__/Component.test.tsx.snap index 039494653e..ea1a753aa5 100644 --- a/packages/slider-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/slider-input/src/__snapshots__/Component.test.tsx.snap @@ -18,7 +18,7 @@ exports[`SliderInput should match snapshot 1`] = ` class="input" > diff --git a/packages/universal-date-input/src/__snapshots__/Component.test.tsx.snap b/packages/universal-date-input/src/__snapshots__/Component.test.tsx.snap index 3e1164191d..23330a7bdc 100644 --- a/packages/universal-date-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/universal-date-input/src/__snapshots__/Component.test.tsx.snap @@ -19,7 +19,7 @@ exports[`UniversalDateInput Snapshot tests should match snapshot 1`] = ` class="input" > From c15b9913e0dfc1d312bc09a275dcd690078563b8 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Wed, 11 Dec 2024 17:51:18 +0700 Subject: [PATCH 28/43] feat(select): fix chevron for size 40 --- .../src/__snapshots__/Component.test.tsx.snap | 2 +- .../src/__snapshots__/component.test.tsx.snap | 2 +- .../src/__snapshots__/component.test.tsx.snap | 4 ++-- .../select/src/__snapshots__/Component.test.tsx.snap | 8 ++++---- packages/select/src/components/arrow/Component.tsx | 12 ++++++------ .../select/src/components/arrow/index.module.css | 5 +++++ 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap b/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap index ba47f56382..70bb083de1 100644 --- a/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap +++ b/packages/international-phone-input/src/__snapshots__/Component.test.tsx.snap @@ -63,7 +63,7 @@ exports[`InternationalPhoneInput should match snapshot 1`] = ` { - if (size && size === 40) { - return ( - - ); - } + const ChevronComponent = size === 40 ? ChevronDownSIcon : ChevronDownMIcon; - return ; + return ( + + ); }; diff --git a/packages/select/src/components/arrow/index.module.css b/packages/select/src/components/arrow/index.module.css index 9ac07b5f39..8910d4ab8f 100644 --- a/packages/select/src/components/arrow/index.module.css +++ b/packages/select/src/components/arrow/index.module.css @@ -8,6 +8,11 @@ color: var(--select-arrow-color); transition: transform 0.15s ease-in-out, opacity 0.2s ease; + + &.size-40 { + width: 16px; + height: 16px; + } } .open { From 21510b2c730836a4a61e020a654d12366ceb3787 Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Wed, 11 Dec 2024 18:40:36 +0700 Subject: [PATCH 29/43] feat: update glyph --- package.json | 2 +- packages/accordion/package.json | 2 +- packages/attach/package.json | 2 +- packages/bank-card/package.json | 2 +- packages/calendar-input/package.json | 2 +- packages/calendar/package.json | 2 +- packages/checkbox/package.json | 2 +- packages/collapse/package.json | 2 +- packages/confirmation-v1/package.json | 2 +- packages/date-range-input/package.json | 2 +- packages/date-time-input/package.json | 2 +- packages/dropzone/package.json | 2 +- packages/file-upload-item-v1/package.json | 2 +- packages/filter-tag/package.json | 2 +- packages/gallery/package.json | 2 +- packages/input/package.json | 2 +- packages/international-phone-input/package.json | 2 +- packages/intl-phone-input/package.json | 2 +- packages/navigation-bar-private/package.json | 2 +- packages/navigation-bar/package.json | 2 +- packages/number-input/package.json | 2 +- packages/pagination/package.json | 2 +- packages/pass-code-v1/package.json | 2 +- packages/pass-code/package.json | 2 +- packages/password-input/package.json | 2 +- packages/picker-button/package.json | 2 +- packages/plate/package.json | 2 +- packages/product-cover/package.json | 2 +- packages/select-with-tags/package.json | 2 +- packages/select/package.json | 2 +- packages/sortable-list/package.json | 2 +- packages/status-badge/package.json | 2 +- packages/steps/package.json | 2 +- packages/tabs/package.json | 2 +- packages/toast-plate/package.json | 2 +- packages/universal-date-input/package.json | 2 +- yarn.lock | 7 ++++++- 37 files changed, 42 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index bc57cb75f9..750ee8c86d 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "dependencies": { "@alfalab/data": "^1.8.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.189.0", + "@alfalab/icons-glyph": "^2.210.0", "@alfalab/icons-logotype": "^2.27.0", "@alfalab/react-canvas-pattern-lock": "^2.0.7", "@alfalab/utils": "^1.15.2", diff --git a/packages/accordion/package.json b/packages/accordion/package.json index 7845d29f43..63d7e63eab 100644 --- a/packages/accordion/package.json +++ b/packages/accordion/package.json @@ -17,7 +17,7 @@ "classnames": "^2.3.1", "tslib": "^2.4.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@juggle/resize-observer": "^3.3.1", "@alfalab/core-components-typography": "^4.11.0" }, diff --git a/packages/attach/package.json b/packages/attach/package.json index 46eb145a82..78ad742ecd 100644 --- a/packages/attach/package.json +++ b/packages/attach/package.json @@ -17,7 +17,7 @@ "@alfalab/core-components-button": "^11.10.2", "@alfalab/core-components-keyboard-focusable": "^4.1.0", "@alfalab/core-components-progress-bar": "^3.5.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@alfalab/utils": "^1.15.2", "classnames": "^2.3.1", "react-merge-refs": "^1.1.0", diff --git a/packages/bank-card/package.json b/packages/bank-card/package.json index 020bedcfc9..5957673ec6 100644 --- a/packages/bank-card/package.json +++ b/packages/bank-card/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@alfalab/core-components-masked-input": "^6.3.27", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@alfalab/icons-logotype": "^2.27.0", "classnames": "^2.3.1", "tslib": "^2.4.0" diff --git a/packages/calendar-input/package.json b/packages/calendar-input/package.json index 91dd52e1d0..c67b260831 100644 --- a/packages/calendar-input/package.json +++ b/packages/calendar-input/package.json @@ -20,7 +20,7 @@ "@alfalab/core-components-mq": "^4.4.0", "@alfalab/core-components-popover": "^6.3.3", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "date-fns": "^2.16.1", "react-merge-refs": "^1.1.0", diff --git a/packages/calendar/package.json b/packages/calendar/package.json index 08703ef462..2d0b6b89cf 100644 --- a/packages/calendar/package.json +++ b/packages/calendar/package.json @@ -22,7 +22,7 @@ "@alfalab/core-components-shared": "^0.14.0", "@alfalab/core-components-typography": "^4.11.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@juggle/resize-observer": "^3.3.1", "classnames": "^2.3.1", "date-fns": "^2.16.1", diff --git a/packages/checkbox/package.json b/packages/checkbox/package.json index eb0f31c296..5cd7c8d254 100644 --- a/packages/checkbox/package.json +++ b/packages/checkbox/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@alfalab/core-components-shared": "^0.14.0", "classnames": "^2.3.1", "react-merge-refs": "^1.1.0", diff --git a/packages/collapse/package.json b/packages/collapse/package.json index 6313e34b3b..59dd261260 100644 --- a/packages/collapse/package.json +++ b/packages/collapse/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@alfalab/core-components-link": "^5.3.1", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@juggle/resize-observer": "^3.3.1", "classnames": "^2.3.1", "lodash.debounce": "^4.0.8", diff --git a/packages/confirmation-v1/package.json b/packages/confirmation-v1/package.json index 5dc9e475be..8e6ad78959 100644 --- a/packages/confirmation-v1/package.json +++ b/packages/confirmation-v1/package.json @@ -15,7 +15,7 @@ "@alfalab/core-components-link": "^5.3.1", "@alfalab/core-components-loader": "^3.2.1", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@alfalab/utils": "^1.15.2", "classnames": "^2.3.1", "tslib": "^2.4.0" diff --git a/packages/date-range-input/package.json b/packages/date-range-input/package.json index f953038579..27061e7d6c 100644 --- a/packages/date-range-input/package.json +++ b/packages/date-range-input/package.json @@ -21,7 +21,7 @@ "@alfalab/core-components-mq": "^4.4.0", "@alfalab/core-components-popover": "^6.3.3", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "date-fns": "^2.16.1", "react-merge-refs": "^1.1.0", diff --git a/packages/date-time-input/package.json b/packages/date-time-input/package.json index 3eb97a49e9..1c30ea1389 100644 --- a/packages/date-time-input/package.json +++ b/packages/date-time-input/package.json @@ -21,7 +21,7 @@ "@alfalab/core-components-mq": "^4.4.0", "@alfalab/core-components-popover": "^6.3.3", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "date-fns": "^2.16.1", "react-merge-refs": "^1.1.0", diff --git a/packages/dropzone/package.json b/packages/dropzone/package.json index 3b7dbdee0c..f2649c0943 100644 --- a/packages/dropzone/package.json +++ b/packages/dropzone/package.json @@ -14,7 +14,7 @@ "react": "^16.9.0 || ^17.0.1 || ^18.0.0" }, "dependencies": { - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0" }, diff --git a/packages/file-upload-item-v1/package.json b/packages/file-upload-item-v1/package.json index 0d44a56c1d..8e2a0d1df8 100644 --- a/packages/file-upload-item-v1/package.json +++ b/packages/file-upload-item-v1/package.json @@ -17,7 +17,7 @@ "@alfalab/core-components-icon-button": "^6.11.2", "@alfalab/core-components-link": "^5.3.0", "@alfalab/core-components-spinner": "^4.0.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0" }, diff --git a/packages/filter-tag/package.json b/packages/filter-tag/package.json index 8e121dccfd..c519b9874f 100644 --- a/packages/filter-tag/package.json +++ b/packages/filter-tag/package.json @@ -17,7 +17,7 @@ "dependencies": { "@alfalab/core-components-mq": "^4.4.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0", "@alfalab/core-components-shared": "^0.14.0" diff --git a/packages/gallery/package.json b/packages/gallery/package.json index 5b5b36d707..178990f2f3 100644 --- a/packages/gallery/package.json +++ b/packages/gallery/package.json @@ -20,7 +20,7 @@ "@alfalab/core-components-tooltip": "^7.8.0", "@alfalab/core-components-typography": "^4.11.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "hls.js": "^1.5.13", "element-closest": "^3.0.2", diff --git a/packages/input/package.json b/packages/input/package.json index b535c28360..aec3b14208 100644 --- a/packages/input/package.json +++ b/packages/input/package.json @@ -20,7 +20,7 @@ "@alfalab/core-components-mq": "^4.4.0", "@alfalab/core-components-shared": "^0.14.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "react-merge-refs": "^1.1.0", "tslib": "^2.4.0" diff --git a/packages/international-phone-input/package.json b/packages/international-phone-input/package.json index 33e43f4faa..9494dbb99b 100644 --- a/packages/international-phone-input/package.json +++ b/packages/international-phone-input/package.json @@ -20,7 +20,7 @@ "@alfalab/core-components-shared": "^0.14.0", "@alfalab/core-components-mq": "^4.4.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@maskito/core": "^1.7.0", "@maskito/react": "^1.7.0", "classnames": "^2.3.1", diff --git a/packages/intl-phone-input/package.json b/packages/intl-phone-input/package.json index 57dc90f169..bfe1a9a09b 100644 --- a/packages/intl-phone-input/package.json +++ b/packages/intl-phone-input/package.json @@ -17,7 +17,7 @@ "@alfalab/core-components-input-autocomplete": "12.6.6", "@alfalab/core-components-select": "^17.17.4", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@alfalab/utils": "^1.15.2", "classnames": "^2.3.1", "libphonenumber-js": "^1.10.30", diff --git a/packages/navigation-bar-private/package.json b/packages/navigation-bar-private/package.json index 56986fbcd8..708040150f 100644 --- a/packages/navigation-bar-private/package.json +++ b/packages/navigation-bar-private/package.json @@ -16,7 +16,7 @@ "@alfalab/core-components-typography": "^4.11.0", "@alfalab/core-components-shared": "^0.14.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "react-merge-refs": "^1.1.0", "tslib": "^2.4.0" diff --git a/packages/navigation-bar/package.json b/packages/navigation-bar/package.json index a0e0c64908..c843235597 100644 --- a/packages/navigation-bar/package.json +++ b/packages/navigation-bar/package.json @@ -17,7 +17,7 @@ "@alfalab/core-components-button": "^11.10.2", "@alfalab/core-components-typography": "^4.11.0", "@alfalab/core-components-shared": "^0.14.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0" }, diff --git a/packages/number-input/package.json b/packages/number-input/package.json index cdb5fd5c9f..72a7239b0d 100644 --- a/packages/number-input/package.json +++ b/packages/number-input/package.json @@ -18,7 +18,7 @@ "@alfalab/core-components-mq": "^4.4.0", "@alfalab/core-components-icon-button": "^6.11.2", "@alfalab/core-components-shared": "^0.14.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@maskito/core": "^1.7.0", "@maskito/react": "^1.7.0", "classnames": "^2.3.1", diff --git a/packages/pagination/package.json b/packages/pagination/package.json index 295a8dca36..5d0a9ce986 100644 --- a/packages/pagination/package.json +++ b/packages/pagination/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@alfalab/core-components-tag": "^8.6.2", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0" }, diff --git a/packages/pass-code-v1/package.json b/packages/pass-code-v1/package.json index 03a310ce1d..b8f6b7998b 100644 --- a/packages/pass-code-v1/package.json +++ b/packages/pass-code-v1/package.json @@ -18,7 +18,7 @@ "@alfalab/core-components-button": "^11.10.2", "@alfalab/core-components-gap": "^1.4.0", "@alfalab/core-components-shared": "^0.14.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "react-transition-group": "^4.4.5", "tslib": "^2.4.0" diff --git a/packages/pass-code/package.json b/packages/pass-code/package.json index 9844aee25a..5dbd80e775 100644 --- a/packages/pass-code/package.json +++ b/packages/pass-code/package.json @@ -18,7 +18,7 @@ "@alfalab/core-components-button": "^11.10.2", "@alfalab/core-components-gap": "^1.4.0", "@alfalab/core-components-shared": "^0.14.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "react-transition-group": "^4.4.5", "tslib": "^2.4.0", diff --git a/packages/password-input/package.json b/packages/password-input/package.json index 269b2a4860..c2a96e0be0 100644 --- a/packages/password-input/package.json +++ b/packages/password-input/package.json @@ -17,7 +17,7 @@ "dependencies": { "@alfalab/core-components-icon-button": "^6.11.2", "@alfalab/core-components-input": "^15.3.2", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0" }, diff --git a/packages/picker-button/package.json b/packages/picker-button/package.json index 8e422589d5..4a3aa1e95c 100644 --- a/packages/picker-button/package.json +++ b/packages/picker-button/package.json @@ -20,7 +20,7 @@ "@alfalab/core-components-select": "^17.17.4", "@alfalab/core-components-popover": "^6.3.3", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0", "@alfalab/core-components-shared": "^0.14.0" diff --git a/packages/plate/package.json b/packages/plate/package.json index c485ec419d..e02c8c49e7 100644 --- a/packages/plate/package.json +++ b/packages/plate/package.json @@ -18,7 +18,7 @@ "@alfalab/core-components-icon-button": "^6.11.2", "@alfalab/core-components-mq": "^4.4.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "react-merge-refs": "^1.1.0", "tslib": "^2.4.0" diff --git a/packages/product-cover/package.json b/packages/product-cover/package.json index 66919722a7..abcde00cd1 100644 --- a/packages/product-cover/package.json +++ b/packages/product-cover/package.json @@ -18,7 +18,7 @@ "@alfalab/core-components-button": "^11.10.2", "@alfalab/core-components-typography": "^4.11.0", "@alfalab/core-components-shared": "^0.14.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@alfalab/hooks": "^1.13.0", "@alfalab/utils": "^1.15.2", "classnames": "^2.3.1", diff --git a/packages/select-with-tags/package.json b/packages/select-with-tags/package.json index a2d1a5203e..4a564ef7dd 100644 --- a/packages/select-with-tags/package.json +++ b/packages/select-with-tags/package.json @@ -21,7 +21,7 @@ "@alfalab/core-components-mq": "^4.4.0", "@alfalab/core-components-popover": "^6.3.3", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "react-merge-refs": "^1.1.0", "tslib": "^2.4.0", diff --git a/packages/select/package.json b/packages/select/package.json index 9d567783c7..5f729b98a3 100644 --- a/packages/select/package.json +++ b/packages/select/package.json @@ -29,7 +29,7 @@ "@alfalab/core-components-skeleton": "^5.2.0", "@alfalab/core-components-shared": "^0.14.0", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@juggle/resize-observer": "^3.3.1", "compute-scroll-into-view": "^3.1.0", "classnames": "^2.3.1", diff --git a/packages/sortable-list/package.json b/packages/sortable-list/package.json index 06ed74ba64..34b7a6abf8 100644 --- a/packages/sortable-list/package.json +++ b/packages/sortable-list/package.json @@ -17,7 +17,7 @@ "dependencies": { "@alfalab/core-components-shared": "^0.14.0", "@alfalab/core-components-portal": "^3.3.4", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@dnd-kit/core": "^6.0.7", "@dnd-kit/sortable": "^7.0.2", "@dnd-kit/utilities": "^3.2.1", diff --git a/packages/status-badge/package.json b/packages/status-badge/package.json index 3eb29403db..86e431e7a7 100644 --- a/packages/status-badge/package.json +++ b/packages/status-badge/package.json @@ -14,7 +14,7 @@ "react": ">=16.8.0" }, "dependencies": { - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0" }, diff --git a/packages/steps/package.json b/packages/steps/package.json index 3d47344ca5..ad7032cf6a 100644 --- a/packages/steps/package.json +++ b/packages/steps/package.json @@ -16,7 +16,7 @@ "dependencies": { "@alfalab/core-components-badge": "^5.6.1", "@alfalab/hooks": "^1.13.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0" }, diff --git a/packages/tabs/package.json b/packages/tabs/package.json index 16c5c9f988..c6ecefcb4d 100644 --- a/packages/tabs/package.json +++ b/packages/tabs/package.json @@ -23,7 +23,7 @@ "@alfalab/core-components-shared": "^0.14.0", "@alfalab/core-components-icon-button": "^6.11.2", "@alfalab/core-components-skeleton": "^5.2.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "compute-scroll-into-view": "^3.1.0", "lodash.debounce": "^4.0.8", diff --git a/packages/toast-plate/package.json b/packages/toast-plate/package.json index 890dc99e14..1754b5af7c 100644 --- a/packages/toast-plate/package.json +++ b/packages/toast-plate/package.json @@ -18,7 +18,7 @@ "@alfalab/core-components-status-badge": "^1.2.0", "@alfalab/core-components-icon-button": "^6.11.2", "@alfalab/core-components-mq": "^4.4.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "classnames": "^2.3.1", "tslib": "^2.4.0", "@alfalab/core-components-shared": "^0.14.0" diff --git a/packages/universal-date-input/package.json b/packages/universal-date-input/package.json index ec3678fcbb..28c40aaf3b 100644 --- a/packages/universal-date-input/package.json +++ b/packages/universal-date-input/package.json @@ -18,7 +18,7 @@ "@alfalab/core-components-shared": "^0.14.0", "@alfalab/core-components-popover": "^6.3.3", "@alfalab/core-components-mq": "^4.4.0", - "@alfalab/icons-glyph": "^2.139.0", + "@alfalab/icons-glyph": "^2.210.0", "@maskito/core": "^1.7.0", "@maskito/react": "^1.7.0", "classnames": "^2.3.1", diff --git a/yarn.lock b/yarn.lock index 88bdcf4be8..46b9da9b4b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -80,7 +80,7 @@ "@alfalab/utils" "^1.13.2" uuid "^8.3.2" -"@alfalab/icons-glyph@^2.108.0", "@alfalab/icons-glyph@^2.139.0", "@alfalab/icons-glyph@^2.66.0": +"@alfalab/icons-glyph@^2.108.0", "@alfalab/icons-glyph@^2.66.0": version "2.140.0" resolved "https://registry.yarnpkg.com/@alfalab/icons-glyph/-/icons-glyph-2.140.0.tgz#31cb75bf2495b082a0b8d0e3f4a8c2c47e3e2eb6" integrity sha512-Mee0c9tyFVKIH0yN9IuKyLa0qoYf1ybwGFkng9Iy+1OGIvgl9ecb74erg/+n/NzR7bI2AAx1yVFDS/LEHivixw== @@ -90,6 +90,11 @@ resolved "https://registry.yarnpkg.com/@alfalab/icons-glyph/-/icons-glyph-2.190.0.tgz#70138633b408ba0541af097238a19d802c5050a3" integrity sha512-ExFc74a6OoA4iZ8Y++JGwZ9QiuwsE9tDK23zuSBHF0rJOVZrGAtPYpVqqp35ROu3dUgi5LrT39M3eQb9u1OeHw== +"@alfalab/icons-glyph@^2.210.0": + version "2.210.0" + resolved "https://registry.yarnpkg.com/@alfalab/icons-glyph/-/icons-glyph-2.210.0.tgz#55a2821539ad7e7689b5b0b5ee39ed31d44e48b4" + integrity sha512-/Jez34xqHxWaVD6qL0tbAkZn3Q4XFBcP9W3ZmSIIjCbEiv6RkP8TmR06AX9wZck4lJNNupsXDdgT5as2+9t+jQ== + "@alfalab/icons-logotype@^2.27.0": version "2.27.0" resolved "https://registry.yarnpkg.com/@alfalab/icons-logotype/-/icons-logotype-2.27.0.tgz#74510f49dbf0790b73b26d494cb77fde5b4cf9d0" From bc87e91e8205a22ea8469c88f07f7457510ba5ae Mon Sep 17 00:00:00 2001 From: Mikhail Lukin Date: Wed, 11 Dec 2024 19:25:48 +0700 Subject: [PATCH 30/43] feat: update addon sizes --- .../src/docs/Component.stories.tsx | 8 +++-- .../src/docs/Component.stories.tsx | 6 ++-- packages/input/src/docs/Component.stories.tsx | 6 ++-- .../src/docs/Component.stories.tsx | 11 +++--- .../src/__snapshots__/component.test.tsx.snap | 8 ++--- .../src/docs/Component.stories.tsx | 34 +++++++++++-------- .../textarea/src/docs/Component.stories.mdx | 10 ++++-- .../src/components/date-input/Component.tsx | 10 ++++-- .../universal-date-input/src/index.module.css | 4 +++ 9 files changed, 62 insertions(+), 35 deletions(-) diff --git a/packages/amount-input/src/docs/Component.stories.tsx b/packages/amount-input/src/docs/Component.stories.tsx index 28c3b366fa..f9b1f3b883 100644 --- a/packages/amount-input/src/docs/Component.stories.tsx +++ b/packages/amount-input/src/docs/Component.stories.tsx @@ -2,6 +2,7 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; import { text, select, boolean, number } from '@storybook/addon-knobs'; import { StarMIcon } from '@alfalab/icons-glyph/StarMIcon'; +import { DiamondsSIcon } from '@alfalab/icons-glyph/DiamondsSIcon'; import { AmountInput } from '@alfalab/core-components-amount-input'; const meta: Meta = { @@ -15,6 +16,9 @@ type Story = StoryObj; export const amount_input: Story = { name: 'AmountInput', render: () => { + const size = select('size', [40, 48, 56, 64, 72], 48); + const IconComponent = size === 40 ? DiamondsSIcon : StarMIcon; + return ( } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} clear={boolean('clear', false)} readOnly={boolean('readOnly', false)} diff --git a/packages/form-control/src/docs/Component.stories.tsx b/packages/form-control/src/docs/Component.stories.tsx index c54a285dd5..b737561a3d 100644 --- a/packages/form-control/src/docs/Component.stories.tsx +++ b/packages/form-control/src/docs/Component.stories.tsx @@ -21,7 +21,7 @@ export const form_control: Story = { const colors = select('colors', ['default', 'inverted'], 'default'); const size = select('size', [40, 48, 56, 64, 72], 48); - const IconComponent = size == 40 ? DiamondsSIcon : StarMIcon; + const IconComponent = size === 40 ? DiamondsSIcon : StarMIcon; return (
= { title: 'Components/NumberInput', @@ -17,6 +18,8 @@ export const number_input: Story = { render: () => { const colors = select('colors', ['default', 'inverted'], 'default'); const stepper = boolean('stepper', false); + const size = select('size', [40, 48, 56, 64, 72], 48); + const IconComponent = size === 40 ? DiamondsSIcon : StarMIcon; return (
{stepper ? ( } - leftAddons={boolean('leftAddons', false) && } + rightAddons={boolean('rightAddons', false) && } + leftAddons={boolean('leftAddons', false) && } bottomAddons={boolean('bottomAddons', false) && bottom text} readOnly={boolean('readOnly', false)} /> diff --git a/packages/password-input/src/__snapshots__/component.test.tsx.snap b/packages/password-input/src/__snapshots__/component.test.tsx.snap index c807821234..e477d2b225 100644 --- a/packages/password-input/src/__snapshots__/component.test.tsx.snap +++ b/packages/password-input/src/__snapshots__/component.test.tsx.snap @@ -45,14 +45,14 @@ exports[`PasswordInput snapshots tests should match snapshot 1`] = ` viewBox="0 0 24 24" width="24" > - + diff --git a/packages/phone-input/src/docs/Component.stories.tsx b/packages/phone-input/src/docs/Component.stories.tsx index 4d55b0b34d..37108b8820 100644 --- a/packages/phone-input/src/docs/Component.stories.tsx +++ b/packages/phone-input/src/docs/Component.stories.tsx @@ -3,6 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { text, select, boolean } from '@storybook/addon-knobs'; import { StarMIcon } from '@alfalab/icons-glyph/StarMIcon'; import { PhoneInput } from '@alfalab/core-components-phone-input'; +import { DiamondsSIcon } from '@alfalab/icons-glyph/DiamondsSIcon'; const meta: Meta = { title: 'Components/PhoneInput', @@ -14,20 +15,25 @@ type Story = StoryObj; export const phone_input: Story = { name: 'PhoneInput', - render: () => ( - } - rightAddons={boolean('rightAddons', false) && } - bottomAddons={boolean('bottomAddons', false) && bottom text} - /> - ), + render: () => { + const size = select('size', [40, 48, 56, 64, 72], 48); + const IconComponent = size === 40 ? DiamondsSIcon : StarMIcon; + + return ( + } + rightAddons={boolean('rightAddons', false) && } + bottomAddons={boolean('bottomAddons', false) && bottom text} + /> + ); + }, }; export default meta; diff --git a/packages/textarea/src/docs/Component.stories.mdx b/packages/textarea/src/docs/Component.stories.mdx index 5d19b840da..8d376b20e4 100644 --- a/packages/textarea/src/docs/Component.stories.mdx +++ b/packages/textarea/src/docs/Component.stories.mdx @@ -2,6 +2,7 @@ import { Meta, Story, Markdown } from '@storybook/addon-docs'; import { text, select, boolean, number } from '@storybook/addon-knobs'; import { ComponentHeader, Tabs } from 'storybook/blocks'; import { StarMIcon } from '@alfalab/icons-glyph/StarMIcon'; +import { DiamondsSIcon } from '@alfalab/icons-glyph/DiamondsSIcon'; import { Textarea } from '@alfalab/core-components-textarea'; import Description from './description.mdx'; @@ -14,6 +15,9 @@ import Changelog from '../../CHANGELOG.md?raw'; {React.createElement(() => { + const size = select('size', [40, 48, 56, 64, 72], 48); + const IconComponent = size === 40 ? DiamondsSIcon : StarMIcon; + return (