From cb09c8409f13078ebf58cca99fcd38298296d96a Mon Sep 17 00:00:00 2001 From: Michal Murawski Date: Tue, 11 Aug 2026 11:39:22 +0200 Subject: [PATCH] feat(design-system): add highEmphasis prop to DsButtonV3 [AR-77572] --- .changeset/tidy-buttons-round.md | 5 +++++ CONTEXT.md | 4 ++++ .../__snapshots__/ds-button-v3.docs.snap | 17 +++++++++++++++++ .../__tests__/ds-button-v3.browser.test.tsx | 16 ++++++++++++++++ .../ds-button-v3/ds-button-v3.module.scss | 7 ++++++- .../ds-button-v3/ds-button-v3.stories.tsx | 10 ++++++++++ .../components/ds-button-v3/ds-button-v3.tsx | 2 ++ .../ds-button-v3/ds-button-v3.types.ts | 8 ++++++++ .../ds-button-v3/ds-button-v4.figma.ts | 10 +++++++--- 9 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 .changeset/tidy-buttons-round.md diff --git a/.changeset/tidy-buttons-round.md b/.changeset/tidy-buttons-round.md new file mode 100644 index 000000000..e9f6f3096 --- /dev/null +++ b/.changeset/tidy-buttons-round.md @@ -0,0 +1,5 @@ +--- +'@drivenets/design-system': minor +--- + +Add `highEmphasis` prop to `DsButtonV3`. diff --git a/CONTEXT.md b/CONTEXT.md index 4119c77fb..523be81d6 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -12,6 +12,10 @@ _Avoid_: widget, element (unless HTML element), control (unless form field) A named visual or behavioral axis on a **Component**, backed by an `as const` array and union type in `*.types.ts`. _Avoid_: mode, type (when meaning visual style), theme +**High-emphasis**: +A boolean shape axis on `DsButtonV3` that raises corner radius for prominent surfaces (Sign in, Landing, NetGen). Purely rounding — not a priority/emphasis level (do not conflate with the `primary` **Variant**, which is the "highest-emphasis" action). +_Avoid_: rounded, pill + **Locale**: Optional prop bag of user-facing strings for a **Component**; keys name the UI role (e.g. `loading`, `noMatches`). Use a dedicated `Ds{Name}Locale` interface when there are many keys. _Avoid_: i18n, translations (this repo does not ship a global i18n framework) diff --git a/packages/design-system/src/components/ds-button-v3/__tests__/__snapshots__/ds-button-v3.docs.snap b/packages/design-system/src/components/ds-button-v3/__tests__/__snapshots__/ds-button-v3.docs.snap index a59b6963e..56c1744d1 100644 --- a/packages/design-system/src/components/ds-button-v3/__tests__/__snapshots__/ds-button-v3.docs.snap +++ b/packages/design-system/src/components/ds-button-v3/__tests__/__snapshots__/ds-button-v3.docs.snap @@ -93,6 +93,23 @@ const IconOnly = () => ; +## High Emphasis + +### Show code + {}} + size="medium" + variant="primary" +> + Button + + +### MCP manifest +const HighEmphasis = () => ; + ## On Dark ### Show code diff --git a/packages/design-system/src/components/ds-button-v3/__tests__/ds-button-v3.browser.test.tsx b/packages/design-system/src/components/ds-button-v3/__tests__/ds-button-v3.browser.test.tsx index a3674933e..5dd513474 100644 --- a/packages/design-system/src/components/ds-button-v3/__tests__/ds-button-v3.browser.test.tsx +++ b/packages/design-system/src/components/ds-button-v3/__tests__/ds-button-v3.browser.test.tsx @@ -39,6 +39,22 @@ describe('DsButtonV3', () => { await expect.element(button).toHaveAttribute('data-selected', 'true'); }); + it('applies data-high-emphasis when highEmphasis is set', async () => { + await page.render(Label); + + const button = page.getByRole('button', { name: 'Label' }); + + await expect.element(button).toHaveAttribute('data-high-emphasis', 'true'); + }); + + it('omits data-high-emphasis by default', async () => { + await page.render(Label); + + const button = page.getByRole('button', { name: 'Label' }); + + await expect.element(button).not.toHaveAttribute('data-high-emphasis'); + }); + it('sets data-color for error palette', async () => { await page.render(Delete); diff --git a/packages/design-system/src/components/ds-button-v3/ds-button-v3.module.scss b/packages/design-system/src/components/ds-button-v3/ds-button-v3.module.scss index e1f93b35e..dcebc3fd0 100644 --- a/packages/design-system/src/components/ds-button-v3/ds-button-v3.module.scss +++ b/packages/design-system/src/components/ds-button-v3/ds-button-v3.module.scss @@ -3,7 +3,8 @@ $height-large: 40px; $height-medium: 36px; $height-small: 28px; -$border-radius: 4px; +$border-radius: var(--3xs); +$border-radius-high-emphasis: var(--sm); $focus-ring-width: 2px; @mixin focus-ring($outer-color) { @@ -34,6 +35,10 @@ $focus-ring-width: 2px; cursor: not-allowed; } + &[data-high-emphasis] { + border-radius: $border-radius-high-emphasis; + } + &[data-loading] { cursor: default; pointer-events: none; diff --git a/packages/design-system/src/components/ds-button-v3/ds-button-v3.stories.tsx b/packages/design-system/src/components/ds-button-v3/ds-button-v3.stories.tsx index e1d853951..c4cc7744a 100644 --- a/packages/design-system/src/components/ds-button-v3/ds-button-v3.stories.tsx +++ b/packages/design-system/src/components/ds-button-v3/ds-button-v3.stories.tsx @@ -24,6 +24,7 @@ const meta: Meta = { size: { control: 'select', options: buttonV3Sizes }, loading: { control: 'boolean' }, disabled: { control: 'boolean' }, + highEmphasis: { control: 'boolean' }, className: { table: { disable: true } }, style: { table: { disable: true } }, ref: { table: { disable: true } }, @@ -88,6 +89,15 @@ export const Selected: Story = { args: { ...baseArgs, variant: 'secondary', selected: true }, }; +/** + * Raised corner radius (12px instead of 4px) for high-emphasis surfaces such as + * Sign in, Landing, and NetGen. Only affects rounding — color and priority are + * unchanged. + */ +export const HighEmphasis: Story = { + args: { ...baseArgs, variant: 'primary', highEmphasis: true }, +}; + /** * Palette tuned for dark-background surfaces. Use when the button sits on a dark * container rather than the default light UI. diff --git a/packages/design-system/src/components/ds-button-v3/ds-button-v3.tsx b/packages/design-system/src/components/ds-button-v3/ds-button-v3.tsx index d5d56a310..a3d7c1553 100644 --- a/packages/design-system/src/components/ds-button-v3/ds-button-v3.tsx +++ b/packages/design-system/src/components/ds-button-v3/ds-button-v3.tsx @@ -29,6 +29,7 @@ const DsButtonV3 = ({ variant = 'primary', size = 'medium', selected = false, + highEmphasis = false, type = 'button', ...rest }: DsButtonV3BaseProps) => { @@ -48,6 +49,7 @@ const DsButtonV3 = ({ data-variant={variant} data-size={size} data-selected={selected ? 'true' : undefined} + data-high-emphasis={highEmphasis ? 'true' : undefined} data-icon-only={isIconOnly || undefined} data-loading={loading && !disabled ? '' : undefined} {...rest} diff --git a/packages/design-system/src/components/ds-button-v3/ds-button-v3.types.ts b/packages/design-system/src/components/ds-button-v3/ds-button-v3.types.ts index 4004ac772..8a13dae7b 100644 --- a/packages/design-system/src/components/ds-button-v3/ds-button-v3.types.ts +++ b/packages/design-system/src/components/ds-button-v3/ds-button-v3.types.ts @@ -45,6 +45,14 @@ export interface DsButtonV3BaseProps extends ButtonHTMLAttributes` + ? figma.code`` : showIcon && icon - ? figma.code`${label}` - : figma.code`${label}`, + ? figma.code`${label}` + : figma.code`${label}`, imports: ["import { DsButtonV3 } from '@drivenets/design-system';"], id: 'ds-button-v4', metadata: { nestable: true },