Skip to content

Commit

Permalink
Feat(web): Introduce ActionGroup component #DS-1607
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelklibani committed Dec 30, 2024
1 parent b53a603 commit dac9b57
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 0 deletions.
57 changes: 57 additions & 0 deletions packages/web/src/scss/components/ActionGroup/ActionGroup.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@use 'sass:map';
@use 'theme' as theme;
@use '../../tools/breakpoint';
@use '../../tools/dictionaries';
@use '../../tools/responsive-properties';

.ActionGroup {
display: flex;
justify-content: left;

@include responsive-properties.create-cascade(
$property: 'column-gap',
$input-custom-property-base-name: 'flex-spacing-x',
$breakpoints: theme.$breakpoints,
$fallback-value: theme.$default-gap
);
@include responsive-properties.create-cascade(
$property: 'row-gap',
$input-custom-property-base-name: 'flex-spacing-y',
$breakpoints: theme.$breakpoints,
$fallback-value: theme.$default-gap
);
}

@each $breakpoint-name, $breakpoint-value in theme.$breakpoints {
$infix: breakpoint.get-modifier('infix', $breakpoint-name, $breakpoint-value);

@include breakpoint.up($breakpoint-value) {
.ActionGroup--#{$infix}row {
flex-direction: row;
}

.ActionGroup--#{$infix}rowReverse {
flex-direction: row-reverse;
}

.ActionGroup--#{$infix}column {
flex-direction: column;
}

.ActionGroup--#{$infix}columnReverse {
flex-direction: column-reverse;
}

.ActionGroup--#{$infix}column,
.ActionGroup--#{$infix}columnReverse {
width: 100%;
}

@include dictionaries.generate-alignments(
$class-name: 'ActionGroup',
$dictionary-values: theme.$alignment-x-dictionary,
$axis: 'x',
$infix: $infix
);
}
}
1 change: 1 addition & 0 deletions packages/web/src/scss/components/ActionGroup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ActionGroup
6 changes: 6 additions & 0 deletions packages/web/src/scss/components/ActionGroup/_theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@use '@tokens' as tokens;
@use '../../settings/dictionaries';

$alignment-x-dictionary: dictionaries.$alignments-x;
$breakpoints: tokens.$breakpoints;
$default-gap: tokens.$space-700;
197 changes: 197 additions & 0 deletions packages/web/src/scss/components/ActionGroup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
{{#> web/layout/default title="Action Group" parentPageName="Components" }}

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Row Layout</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--row">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Row Reverse Layout</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--rowReverse">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Column Layout</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--column">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Column Reverse Layout</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--columnReverse">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Responsive Row Reverse Layout</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--rowReverse ActionGroup--tablet--row">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Responsive Row → Column Layout</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--column ActionGroup--tablet--row">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Horizontal Alignment</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--row ActionGroup--alignmentXLeft">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

<div class="ActionGroup ActionGroup--row ActionGroup--alignmentXCenter">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

<div class="ActionGroup ActionGroup--row ActionGroup--alignmentXRight">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Responsive Horizontal Alignment</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--row ActionGroup--alignmentXLeft
ActionGroup--alignmentXRight
ActionGroup--tablet--alignmentXCenter ActionGroup--desktop--alignmentXLeft">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Custom Horizontal Spacing</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--row" style="--flex-spacing-x: var(--spirit-space-1200)">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Custom Vertical Spacing</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--column" style="--flex-spacing-y: var(--spirit-space-1200)">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Responsive Custom Horizontal Spacing</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--row" style="--flex-spacing-x: var(--spirit-space-700); --flex-spacing-x-tablet: var(--spirit-space-1200)">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

<section class="UNSTABLE_Section">
<div class="Container">
<h2 class="docs-Heading">Responsive Custom Vertical Spacing</h2>
<div class="docs-Stack docs-Stack--stretch">

<div class="ActionGroup ActionGroup--column" style="--flex-spacing-y: var(--spirit-space-700); --flex-spacing-y-tablet: var(--spirit-space-1200);">
<a href="#" role="button" class="Button Button--primary Button--medium">Primary Action</a>
<a href="#" role="button" class="Button Button--secondary Button--medium">Secondary Action</a>
<a href="#" role="button" class="Button Button--tertiary Button--medium">Tertiary Action</a>
</div>

</div>
</div>
</section>

{{/web/layout/default }}
1 change: 1 addition & 0 deletions packages/web/src/scss/components/ActionGroup/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@forward 'ActionGroup';
1 change: 1 addition & 0 deletions packages/web/src/scss/components/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This code is commented out until we switch it to the new token system
@forward 'Accordion';
@forward 'ActionGroup';
@forward 'Alert';
@forward 'Breadcrumbs';
@forward 'Button';
Expand Down

0 comments on commit dac9b57

Please sign in to comment.