diff --git a/.changeset/proud-actors-knock.md b/.changeset/proud-actors-knock.md new file mode 100644 index 0000000000..96980d3ac4 --- /dev/null +++ b/.changeset/proud-actors-knock.md @@ -0,0 +1,6 @@ +--- +'@swisspost/design-system-styles': major +'@swisspost/design-system-documentation': minor +--- + +Updated the margin, padding, and gap utility classes to use the pixel values (1, 2, ... , 112) instead of size names (hair, line, ..., bigger-giant). diff --git a/packages/components-angular/projects/consumer-app/src/app/app.component.html b/packages/components-angular/projects/consumer-app/src/app/app.component.html index d67562cfc9..b129ac5352 100644 --- a/packages/components-angular/projects/consumer-app/src/app/app.component.html +++ b/packages/components-angular/projects/consumer-app/src/app/app.component.html @@ -1,6 +1,6 @@
-
-
+

Hurray, it works!

diff --git a/packages/components-angular/projects/consumer-app/src/app/routes/card-control/card-control.component.html b/packages/components-angular/projects/consumer-app/src/app/routes/card-control/card-control.component.html index 100f13963c..26b9e8a2c2 100644 --- a/packages/components-angular/projects/consumer-app/src/app/routes/card-control/card-control.component.html +++ b/packages/components-angular/projects/consumer-app/src/app/routes/card-control/card-control.component.html @@ -2,7 +2,7 @@

CardControl Forms

Form Builder Form

-
+
Post Card Control Checkbox @@ -30,7 +30,7 @@

Form Builder Form

-
+
Post Card Control Radio Group @@ -61,7 +61,7 @@

Form Builder Form

-
+
diff --git a/packages/components-angular/projects/consumer-app/src/app/routes/home/home.component.html b/packages/components-angular/projects/consumer-app/src/app/routes/home/home.component.html index 835d642c11..09ed936f43 100644 --- a/packages/components-angular/projects/consumer-app/src/app/routes/home/home.component.html +++ b/packages/components-angular/projects/consumer-app/src/app/routes/home/home.component.html @@ -1,4 +1,4 @@ -
+

Post Accordion

@@ -18,37 +18,37 @@

Post Accordion

-
+

Post Alert

Contentus momentus vero siteos et accusam iretea et justo.

-
+

Post Card-Control

-
+

Post Collapsible

- +

Contentus momentus vero siteos et accusam iretea et justo.

-
+

Post Icon

-
+

Post Logo

Logo of the Post, To the homepage
-
+

Post Popover

-
+

Post Popovercontainer

-
+

Post Rating

-
+

Post Tabs

Unua langeto @@ -93,12 +93,12 @@

Post Tabs

-
+

Post Tag

Tag
-
+

Post Tooltip

Hi there 👋 diff --git a/packages/components/cypress/fixtures/post-card-control.form-association.test.html b/packages/components/cypress/fixtures/post-card-control.form-association.test.html index 8a06dfcfb3..d551a6534e 100644 --- a/packages/components/cypress/fixtures/post-card-control.form-association.test.html +++ b/packages/components/cypress/fixtures/post-card-control.form-association.test.html @@ -41,7 +41,7 @@
-
+
diff --git a/packages/components/src/index.html b/packages/components/src/index.html index 0c95129ca8..16672c7e7f 100644 --- a/packages/components/src/index.html +++ b/packages/components/src/index.html @@ -13,6 +13,6 @@ -
Add your component here and start developing!
+
Add your component here and start developing!
diff --git a/packages/demo/src/app/bootstrap/components/accordion/accordion-demo-page/accordion-demo-page.component.html b/packages/demo/src/app/bootstrap/components/accordion/accordion-demo-page/accordion-demo-page.component.html index b5ce4cf38d..e99d6c7ebc 100644 --- a/packages/demo/src/app/bootstrap/components/accordion/accordion-demo-page/accordion-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/accordion/accordion-demo-page/accordion-demo-page.component.html @@ -1,9 +1,9 @@ -
+

Accordion

-
+

Bootstrap accordions are deprecated and will soon be removed.

For a similar behavior, check out our new @@ -20,21 +20,21 @@

Accordion

Using JavaScript

-
+

For the JavaScript accordion to work properly, you need to import collapse.js from Bootstrap into your component.

diff --git a/packages/demo/src/app/bootstrap/components/alert/action-alert-demo/action-alert-demo.component.html b/packages/demo/src/app/bootstrap/components/alert/action-alert-demo/action-alert-demo.component.html index 5063d58adb..1be8e4d59f 100644 --- a/packages/demo/src/app/bootstrap/components/alert/action-alert-demo/action-alert-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/alert/action-alert-demo/action-alert-demo.component.html @@ -1,8 +1,8 @@ - + - +
diff --git a/packages/demo/src/app/bootstrap/components/background/background-demo-page/background-demo-page.component.html b/packages/demo/src/app/bootstrap/components/background/background-demo-page/background-demo-page.component.html index d8716059be..93ca730887 100644 --- a/packages/demo/src/app/bootstrap/components/background/background-demo-page/background-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/background/background-demo-page/background-demo-page.component.html @@ -1,4 +1,4 @@ -
+

Background

Custom Post Backgrounds

@@ -10,8 +10,8 @@

Infos

be checked individually.

-

Default backgrounds

-
+

Default backgrounds

+

Default backgrounds

-
+
Default backgrounds
-
+
Default backgrounds
-

Thematic backgrounds

-
+

Thematic backgrounds

+

Thematic backgrounds

-
+
Thematic backgrounds
-
+
Thematic backgrounds
-

Contextual backgrounds (Intranet only)

-
+

Contextual backgrounds (Intranet only)

+

Contextual backgrounds (Intranet only)

-
+
Contextual backgrounds (Intranet only)
-
+
diff --git a/packages/demo/src/app/bootstrap/components/badge/badge-demo-page/badge-demo-page.component.html b/packages/demo/src/app/bootstrap/components/badge/badge-demo-page/badge-demo-page.component.html index 0b50c8fb78..bab5cb8eec 100644 --- a/packages/demo/src/app/bootstrap/components/badge/badge-demo-page/badge-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/badge/badge-demo-page/badge-demo-page.component.html @@ -1,4 +1,4 @@ -
+

Badge

diff --git a/packages/demo/src/app/bootstrap/components/badge/badge-interactive-demo/badge-interactive-demo.component.html b/packages/demo/src/app/bootstrap/components/badge/badge-interactive-demo/badge-interactive-demo.component.html index a93b8e158d..c205e03b35 100644 --- a/packages/demo/src/app/bootstrap/components/badge/badge-interactive-demo/badge-interactive-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/badge/badge-interactive-demo/badge-interactive-demo.component.html @@ -1,12 +1,12 @@

Links

-
+ -
+

Buttons

-
+
-
+

Checkable

-
+
@@ -82,7 +82,7 @@

Checkable

-
+

Dismissable

-
+
Dismissible Badge @@ -137,7 +137,7 @@

Dismissable

-
+
Nested Dismissible Badge 10 diff --git a/packages/demo/src/app/bootstrap/components/blockquotes/blockquotes-demo-page/blockquotes-demo-page.component.html b/packages/demo/src/app/bootstrap/components/blockquotes/blockquotes-demo-page/blockquotes-demo-page.component.html index 24e89e438b..0f65c40657 100644 --- a/packages/demo/src/app/bootstrap/components/blockquotes/blockquotes-demo-page/blockquotes-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/blockquotes/blockquotes-demo-page/blockquotes-demo-page.component.html @@ -1,4 +1,4 @@ -
+

Blockquotes

@@ -6,7 +6,7 @@

Blockquotes

Basic blockquotes

@@ -14,7 +14,7 @@

Basic blockquotes

Nested blockquotes

@@ -24,7 +24,7 @@

Just quotes without any extra styling

diff --git a/packages/demo/src/app/bootstrap/components/blockquotes/quotes-demo/quotes-demo.component.html b/packages/demo/src/app/bootstrap/components/blockquotes/quotes-demo/quotes-demo.component.html index ff31152e5b..9f703725fb 100644 --- a/packages/demo/src/app/bootstrap/components/blockquotes/quotes-demo/quotes-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/blockquotes/quotes-demo/quotes-demo.component.html @@ -1,13 +1,13 @@ Just quotes -Just quotes with a different language +Just quotes with a different language - + Long quotes, Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. - + Long quotes with nested inside, Lorem ipsum dolor sit amet, consetetur sadipscing elitr , sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, voluptua. diff --git a/packages/demo/src/app/bootstrap/components/button-group/button-group-demo-page/button-group-demo-page.component.html b/packages/demo/src/app/bootstrap/components/button-group/button-group-demo-page/button-group-demo-page.component.html index a8aa42d114..320f1e97fe 100644 --- a/packages/demo/src/app/bootstrap/components/button-group/button-group-demo-page/button-group-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/button-group/button-group-demo-page/button-group-demo-page.component.html @@ -1,4 +1,4 @@ -
+

Button Group

@@ -42,18 +42,18 @@

Checkbox buttons

- - + + @@ -99,14 +99,14 @@

Radio buttons

- - + + - + diff --git a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo-page/buttons-demo-page.component.html b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo-page/buttons-demo-page.component.html index 4b7c2a2c82..fa806f5522 100644 --- a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo-page/buttons-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo-page/buttons-demo-page.component.html @@ -1,4 +1,4 @@ -
+

Buttons

diff --git a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/button-disabled/button-disabled.component.html b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/button-disabled/button-disabled.component.html index 9c2b68da8f..5ca68c878c 100644 --- a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/button-disabled/button-disabled.component.html +++ b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/button-disabled/button-disabled.component.html @@ -1,10 +1,10 @@ -
+
-
+
diff --git a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/buttons-demo.component.html b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/buttons-demo.component.html index bef49b7623..d2c65729b9 100644 --- a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/buttons-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/buttons-demo.component.html @@ -16,7 +16,7 @@

Disabled buttons

Accessibility

Disabled controls are an accessibility anti-pattern for various reasons:

-
    +
    1. They are not focussable, screen reader users or keyboard users cannot focus the button and might miss information that is hidden e.g. in a tooltip. diff --git a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/default-buttons/default-buttons.component.html b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/default-buttons/default-buttons.component.html index bffabbb361..bc138dbcc6 100644 --- a/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/default-buttons/default-buttons.component.html +++ b/packages/demo/src/app/bootstrap/components/buttons/buttons-demo/default-buttons/default-buttons.component.html @@ -1,10 +1,10 @@ -
      +
      -
      +
      diff --git a/packages/demo/src/app/bootstrap/components/card/card-demo-page/card-demo-page.component.html b/packages/demo/src/app/bootstrap/components/card/card-demo-page/card-demo-page.component.html index b694ea4078..80dc111583 100644 --- a/packages/demo/src/app/bootstrap/components/card/card-demo-page/card-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/card/card-demo-page/card-demo-page.component.html @@ -1,5 +1,5 @@
      -
      +

      Cards

      diff --git a/packages/demo/src/app/bootstrap/components/card/card-demo/card-demo.component.html b/packages/demo/src/app/bootstrap/components/card/card-demo/card-demo.component.html index 3d4610d7f8..933d753372 100644 --- a/packages/demo/src/app/bootstrap/components/card/card-demo/card-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/card/card-demo/card-demo.component.html @@ -1,6 +1,6 @@
      -
      +
      @@ -13,16 +13,16 @@
      Card title
      -
      +
      This is some text within a card body.
      -
      +
      Card title
      -
      Card subtitle
      +
      Card subtitle

      Some quick example text to build on the card title and make up the bulk of the card's content. @@ -32,7 +32,7 @@

      Card subtitle
      -
      +
      @@ -43,7 +43,7 @@
      Card subtitle
      -
      +
      • Cras justo odio
      • @@ -52,7 +52,7 @@
        Card subtitle
      -
      +
      Featured
        @@ -62,7 +62,7 @@
        Card subtitle
      -
      +
      @@ -83,7 +83,7 @@
      Card title
      -
      +
      Featured
      @@ -95,7 +95,7 @@
      Special title treatment
      -
      +
      Featured
      @@ -107,7 +107,7 @@
      Special title treatment
      -
      +
      Quote
      @@ -126,7 +126,7 @@
      Special title treatment
      -
      +
      Featured
      @@ -139,7 +139,7 @@
      Special title treatment
      -
      +

      Post-Example

      diff --git a/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html b/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html index 454f39fc17..56acd20ed4 100644 --- a/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html @@ -7,8 +7,8 @@

      Images in cards

      -
      -
      +
      +
      Card title
      @@ -20,7 +20,7 @@
      Card title
      -
      +
      Card title
      @@ -41,7 +41,7 @@

      Bad example

      is legible on an image for every browser size and all different languages.
      -
      +
      @@ -63,7 +63,7 @@

      Card groups

      -
      +
      @@ -98,7 +98,7 @@
      Card title
      -
      +
      diff --git a/packages/demo/src/app/bootstrap/components/card/post-card-demo/post-card-demo.component.html b/packages/demo/src/app/bootstrap/components/card/post-card-demo/post-card-demo.component.html index 346b89e17f..5dd166e326 100644 --- a/packages/demo/src/app/bootstrap/components/card/post-card-demo/post-card-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/card/post-card-demo/post-card-demo.component.html @@ -1,4 +1,4 @@ -
      +
      @@ -50,7 +50,7 @@

      Telefonnummern

      -

      079 000 00 00

      +

      079 000 00 00

      nicht bestätigt

      076 111 11 11

      @@ -81,7 +81,7 @@

      Guthaben & ZahlungsmittelCHF 25.00

      Debit Direct - ****** 346 + ****** 346

      diff --git a/packages/demo/src/app/bootstrap/components/form-check/form-check-demo-page/form-check-demo-page.component.html b/packages/demo/src/app/bootstrap/components/form-check/form-check-demo-page/form-check-demo-page.component.html index 3cac2201f7..d2126c0fc5 100644 --- a/packages/demo/src/app/bootstrap/components/form-check/form-check-demo-page/form-check-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/form-check/form-check-demo-page/form-check-demo-page.component.html @@ -1,4 +1,4 @@ -
      +

      Forms checkbox

      diff --git a/packages/demo/src/app/bootstrap/components/form-check/form-check-demo/form-check-demo.component.html b/packages/demo/src/app/bootstrap/components/form-check/form-check-demo/form-check-demo.component.html index 05ecaac8c4..f7ede66a7a 100644 --- a/packages/demo/src/app/bootstrap/components/form-check/form-check-demo/form-check-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/form-check/form-check-demo/form-check-demo.component.html @@ -24,7 +24,7 @@

      Form check examples

      -
      +
      @@ -55,7 +55,7 @@

      Form check examples

      -

      Inline checks

      +

      Inline checks

      @@ -65,7 +65,7 @@

      Inline checks

      -

      Check without label

      +

      Check without label

      Check without label value="" /> -

      Check with long label

      +

      Check with long label

      @@ -89,7 +89,7 @@

      Check with long label

      -

      Validation

      +

      Validation

      @@ -107,7 +107,7 @@

      Validation

      -
      +
      @@ -129,7 +129,7 @@

      Validation

      -
      +
      diff --git a/packages/demo/src/app/bootstrap/components/form-control/form-control-demo-page/form-control-demo-page.component.html b/packages/demo/src/app/bootstrap/components/form-control/form-control-demo-page/form-control-demo-page.component.html index 1542f7feda..402c688878 100644 --- a/packages/demo/src/app/bootstrap/components/form-control/form-control-demo-page/form-control-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/form-control/form-control-demo-page/form-control-demo-page.component.html @@ -1,9 +1,9 @@ -
      +

      Form control

      -
      +

      We're deprecating the regular and medium sizes for text input, textarea and select.

      diff --git a/packages/demo/src/app/bootstrap/components/form-control/form-control-demo/form-control-demo.component.html b/packages/demo/src/app/bootstrap/components/form-control/form-control-demo/form-control-demo.component.html index d9e30141ca..ebca3b67cf 100644 --- a/packages/demo/src/app/bootstrap/components/form-control/form-control-demo/form-control-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/form-control/form-control-demo/form-control-demo.component.html @@ -31,7 +31,7 @@ type="text" /> -
      +
      Error message

      -
      +
      +

      Form file

      -
      +

      We're deprecating the regular and medium sizes for text input, textarea and select.

      diff --git a/packages/demo/src/app/bootstrap/components/form-file/form-file-demo/form-file-demo.component.html b/packages/demo/src/app/bootstrap/components/form-file/form-file-demo/form-file-demo.component.html index a4ee10cf51..baecac3ac5 100644 --- a/packages/demo/src/app/bootstrap/components/form-file/form-file-demo/form-file-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/form-file/form-file-demo/form-file-demo.component.html @@ -3,28 +3,28 @@
      -
      +
      -
      +
      -
      +
      -
      +

      Error message

      -
      +

      Success message (optional)

      diff --git a/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo-page/form-radio-demo-page.component.html b/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo-page/form-radio-demo-page.component.html index c47f190d76..fa1096ac54 100644 --- a/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo-page/form-radio-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo-page/form-radio-demo-page.component.html @@ -1,4 +1,4 @@ -
      +

      Form radio button

      diff --git a/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo/form-radio-demo.component.html b/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo/form-radio-demo.component.html index 6dc25a28e7..106db587ec 100644 --- a/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo/form-radio-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/form-radio/form-radio-demo/form-radio-demo.component.html @@ -18,7 +18,7 @@

      Form radio examples

      -
      +
      Form radio examples
      -

      Inline radios

      +

      Inline radios

      Inline radios
      -

      Radio without label

      +

      Radio without label

      Radio without label value="" /> -

      Radio with long label

      +

      Radio with long label

      @@ -94,7 +94,7 @@

      Radio with long label

      -

      Validation

      +

      Validation

      @@ -112,7 +112,7 @@

      Validation

      -
      +
      @@ -129,7 +129,7 @@

      Validation

      -
      +
      diff --git a/packages/demo/src/app/bootstrap/components/form-range/form-range-demo-page/form-range-demo-page.component.html b/packages/demo/src/app/bootstrap/components/form-range/form-range-demo-page/form-range-demo-page.component.html index ee89078958..ce2aec41d9 100644 --- a/packages/demo/src/app/bootstrap/components/form-range/form-range-demo-page/form-range-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/form-range/form-range-demo-page/form-range-demo-page.component.html @@ -1,4 +1,4 @@ -
      +

      Form range

      @@ -8,7 +8,7 @@

      Form range

      @@ -19,6 +19,6 @@

      Basic form range

      diff --git a/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo-page/form-select-multiple-demo-page.component.html b/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo-page/form-select-multiple-demo-page.component.html index 86b9f5930c..227b08bbac 100644 --- a/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo-page/form-select-multiple-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo-page/form-select-multiple-demo-page.component.html @@ -1,9 +1,9 @@ -
      +

      Form select multiple

      -
      +

      We're deprecating the regular and medium sizes for text input, textarea and select.

      diff --git a/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo/form-select-multiple-demo.component.html b/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo/form-select-multiple-demo.component.html index 7ff522a01c..ef47e708f8 100644 --- a/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo/form-select-multiple-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/form-select-multiple/form-select-multiple-demo/form-select-multiple-demo.component.html @@ -15,7 +15,7 @@

      size attribute

      -
      +

      In Safari on macOS, the size attribute only works as expected from 4+. This is a -

      +
      diff --git a/packages/demo/src/app/bootstrap/components/form-select/form-select-demo-page/form-select-demo-page.component.html b/packages/demo/src/app/bootstrap/components/form-select/form-select-demo-page/form-select-demo-page.component.html index 3cf688bb26..af882378c1 100644 --- a/packages/demo/src/app/bootstrap/components/form-select/form-select-demo-page/form-select-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/form-select/form-select-demo-page/form-select-demo-page.component.html @@ -1,9 +1,9 @@ -
      +

      Form select

      -
      +

      We're deprecating the regular and medium sizes for text input, textarea and select.

      @@ -22,7 +22,7 @@

      -

      />
      -

      Switch with long label

      +

      Switch with long label

      @@ -84,7 +84,7 @@

      Switch with long label

      -

      Validation

      +

      Validation

      diff --git a/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo-page/form-textarea-demo-page.component.html b/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo-page/form-textarea-demo-page.component.html index d54d60c6c5..82a7fd5026 100644 --- a/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo-page/form-textarea-demo-page.component.html +++ b/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo-page/form-textarea-demo-page.component.html @@ -1,9 +1,9 @@ -
      +

      Form textarea

      -
      +

      We're deprecating the regular and medium sizes for text input, textarea and select.

      diff --git a/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo/form-textarea-demo.component.html b/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo/form-textarea-demo.component.html index e048656bdc..caef602d81 100644 --- a/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo/form-textarea-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/form-textarea/form-textarea-demo/form-textarea-demo.component.html @@ -3,7 +3,7 @@
      -
      +
      -
      +
      @@ -267,7 +267,7 @@ Value -
      +
      @@ -285,7 +285,7 @@ Value -
      +
      @@ -303,7 +303,7 @@ Value -
      +
      -
      +

      This page could not be found.
      A reasons for this could be a misspelled URL.

      -

      +

      We kindly ask you to review this once again. It is also possible that we have moved, archived, or renamed the relevant page. Perhaps you can find the content you're looking for on our homepage. Or use the search on our portal to locate the desired page.

      -
      +
      Home page diff --git a/packages/documentation/src/stories/utilities/background/background.stories.ts b/packages/documentation/src/stories/utilities/background/background.stories.ts index b1cd3521ef..4ac0d880f4 100644 --- a/packages/documentation/src/stories/utilities/background/background.stories.ts +++ b/packages/documentation/src/stories/utilities/background/background.stories.ts @@ -15,20 +15,20 @@ export default meta; type Story = StoryObj; export const ColoredBackground: Story = { - render: () => html`
      Content
      `, + render: () => html`
      Content
      `, }; export const NestedBackgrounds: Story = { render: () => html` -
      +
      Content in .bg-gray container. -
      +
      Content in .bg-dark container. -
      +
      Content in .bg-light container. @@ -40,10 +40,10 @@ export const NestedBackgrounds: Story = { export const TranslucentBackgrounds: Story = { render: () => html` -
      Container with default opacity (1).
      -
      Container with opacity 0.8.
      -
      Container with opacity 0.6.
      -
      Container with opacity 0.4.
      -
      Container with opacity 0.2.
      +
      Container with default opacity (1).
      +
      Container with opacity 0.8.
      +
      Container with opacity 0.6.
      +
      Container with opacity 0.4.
      +
      Container with opacity 0.2.
      `, }; diff --git a/packages/documentation/src/stories/utilities/sizing/sizing.docs.mdx b/packages/documentation/src/stories/utilities/sizing/sizing.docs.mdx index 2eeea5d5fd..5e883563a4 100644 --- a/packages/documentation/src/stories/utilities/sizing/sizing.docs.mdx +++ b/packages/documentation/src/stories/utilities/sizing/sizing.docs.mdx @@ -44,7 +44,7 @@ Post sizes can be used as suffixes in the same way. To find out which size name #### Sass variables {/* prettier-ignore */} -
      +

      Sizing variables are deprecated

      The current set of the post-specific sizing variables is deprecated in favour of a new naming system that is consistent with the Design. For further information, please read the discussion on sizing variables on GitHub and have a look at the implementation in Figma.

      There is a new solution with updated naming system up coming for spacing sizes.

      diff --git a/packages/documentation/src/stories/utilities/sizing/sizing.stories.ts b/packages/documentation/src/stories/utilities/sizing/sizing.stories.ts index dbebae4cdc..38558d2899 100644 --- a/packages/documentation/src/stories/utilities/sizing/sizing.stories.ts +++ b/packages/documentation/src/stories/utilities/sizing/sizing.stories.ts @@ -70,7 +70,7 @@ function renderSizing(args: Args) { return html`
      -
      +
      diff --git a/packages/documentation/src/stories/utilities/spacing/spacing.docs.mdx b/packages/documentation/src/stories/utilities/spacing/spacing.docs.mdx index ecd61e9877..b6d2cb7ed9 100644 --- a/packages/documentation/src/stories/utilities/spacing/spacing.docs.mdx +++ b/packages/documentation/src/stories/utilities/spacing/spacing.docs.mdx @@ -1,63 +1,76 @@ import { Canvas, Controls, Meta } from '@storybook/blocks'; import * as SpacingStories from './spacing.stories'; +export const firstBreakpoint = Object.values(SpacingStories.SCSS_VARIABLES.firstBreakpoint)[0]; +export const breakpoints = Object.values(SpacingStories.SCSS_VARIABLES.breakpoints).map((breakpoint, i, arr) => [breakpoint, i !== arr.length - 1]); + # Spacing
      -Our spacing utility brings uniform and consistent spacing to your elements, +Ensure consistent spacing across all pages. +
      -By adhering to standardized spacing guidelines, we maintain visual alignment and -improve the overall user interface. +## Margin and Padding +
      +

      Avoid applying spacing classes to grid elements (e.g. `.row`, `.col`, `.col-*`).

      +

      The grid system uses negative margins and positive padding along the horizontal axis, and applying additional spacing classes can affect the layout unless done with careful consideration.

      -
      -

      Sizing variables are deprecated

      -

      The current set of the post-specific spacing utility is deprecated in favour of a new naming system that is consistent with the Design. For further information, please read the discussion on sizing variables on GitHub and have a look at the implementation in Figma.

      -

      There is a new solution with updated naming system up coming for spacing sizes.

      -
      +The naming convention for spacing utilities follows this pattern: +- For all breakpoints ({firstBreakpoint} and up): `{property}{sides}-{size}` +- Starting from a specific breakpoint ({breakpoints.map(([b, isLast]) => ({b}{isLast ? ', ' : ''}))}): `{property}{sides}-{breakpoint}-{size}` -## Padding & Margin +### Properties -You can apply the desired spacings for `margin` and/or `padding` all around an element using the classes `m-*` and `p-*`, or you can specify a position (e.g. `pt-*` , `pb-*` , `pe-*` , `ps-*` respectively for a padding at top, bottom, end/right and start/left). You can also set a spacing along the horizontal axis (i.e. right and left) using `mx-*` / `px-*` or along the vertical axis (i.e. top and bottom) using `my-*` / `py-*` . +- `m`: for classes that set margin +- `p`: for classes that set padding -Our base spacing classes with suffixes going from 0 to 5 (`*-0`, `*-1`, ..., `*-5`). +### Sides -Our custom sizes can be used in the same way: by adding the name of the desired size to a prefix. See our [sizing docs](/?path=/docs/e728de1f-0d71-4317-8bb8-cbef0bf8d5db--docs) to find out which size names are available. +- blank: for classes that set a margin or padding on all sides (top, bottom, left, and right) +- `x`: for classes that set a horizontal margin or padding (left and right) +- `y`: for classes that set a vertical margin or padding (top and bottom) +- `t`: for classes that set a margin or padding at the top +- `b`: for classes that set a margin or padding at the bottom +- `s`: for classes that set a margin or padding at the start (left in LTR) +- `e`: for classes that set a margin or padding at the end (right in LTR) -
      -

      Do not use spacing classes on grid elements (i.e. `.row`, `.col`, `.col-*`).

      -

      Our grid is built with negative margins and positive paddings on the x-axis. Therefore, use this spacing classes only if you know exactly what you are doing!

      -
      +### Sizes + +See all available sizes in the example bellow. - +### Example + +
      - +
      -## Responsive behavior - -By default, the above classes apply to all breakpoints. +## Gap -##### Manually specifying breakpoints +When using `display: grid` or `display: flex`, you can use the gap utilities to manage spacing between child elements. +These classes simplify the process of managing spacing without needing to individually add margin utilities to each child element. -If you need to change the size or spacing of an element based on the breakpoint, you should -mention it in the class name using one of the following infixes: {Object.values(SpacingStories.SCSS_VARIABLES.breakpoints).map((s, index, array) => ({`-${s}-`}{index !== array.length - 1 && ', '}))}. -When a breakpoint is specified, the size applies to that breakpoint and to all those that are -larger. +The format for gap classes is as follows: +- For all breakpoints ({firstBreakpoint} and up): `{property}-{size}` +- Starting from a specific breakpoint ({breakpoints.map(([b, isLast]) => ({b}{isLast ? ', ' : ''}))}): `gap-{breakpoint}-{size}` -The square below has a big padding from the large breakpoint (i.e. `.p-lg-big`) and a regular -padding below (i.e. `.p-regular`). +### Properties - +- `row-gap`: for classes that set a gap between rows +- `column-gap`: for classes that set a gap between columns +- `gap`: for classes that set a gap between both columns and rows -##### Using automatic responsive behavior +### Sizes -Another way to define a responsive size is to use the `-r` suffix. It allows to obtain a size which updates automatically and consistently depending on the breakpoint, without having to specify anything manually. +See all available sizes in the example bellow. -The square below has a "large" responsive padding, which means the padding size -automatically changes based on the breakpoint but remains visually consistent. +### Example - + +
      + +
      diff --git a/packages/documentation/src/stories/utilities/spacing/spacing.module.scss b/packages/documentation/src/stories/utilities/spacing/spacing.module.scss index 05a8bec5eb..0b5a6608cb 100644 --- a/packages/documentation/src/stories/utilities/spacing/spacing.module.scss +++ b/packages/documentation/src/stories/utilities/spacing/spacing.module.scss @@ -1,12 +1,18 @@ @use 'sass:list'; @use 'sass:map'; @use '@swisspost/design-system-styles/core' as post; +@use '@swisspost/design-system-styles/tokens/utilities' as tokens; :export { - @each $key, $value in post.$post-sizes { - sizes_#{$key}: #{$value}; + @each $key, $value in tokens.$post-spacing { + spacing_#{$key}: #{$value}; } @each $breakpoint in post.$grid-breakpoints-list { - breakpoints_#{$breakpoint}: $breakpoint; + @if (map.get(post.$grid-breakpoints, $breakpoint) == 0) { + firstBreakpoint_#{$breakpoint}: $breakpoint; + } + @if (map.get(post.$grid-breakpoints, $breakpoint) != 0) { + breakpoints_#{$breakpoint}: $breakpoint; + } } } diff --git a/packages/documentation/src/stories/utilities/spacing/spacing.snapshot.stories.ts b/packages/documentation/src/stories/utilities/spacing/spacing.snapshot.stories.ts new file mode 100644 index 0000000000..ae8276ebb8 --- /dev/null +++ b/packages/documentation/src/stories/utilities/spacing/spacing.snapshot.stories.ts @@ -0,0 +1,42 @@ +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; +import { html } from 'lit'; +import meta, { MarginAndPadding as MandP, Gap as G } from './spacing.stories'; +import './spacing.styles.scss'; + +const { id, ...metaWithoutId } = meta; + +export default { + ...metaWithoutId, + title: 'Snapshots', +}; + +type Story = StoryObj; + +export const MarginAndPadding: Story = { + render: (_args: Args, context: StoryContext) => { + const snapshotArgs = { + marginSize: '24', + paddingSize: '16', + breakpointClasses: 'm-md-48 p-md-32', + }; + + return html` +
      + ${MandP.render?.({ ...MandP.args, ...snapshotArgs }, context)} +
      + `; + }, +}; + +export const Gap: Story = { + render: (_args: Args, context: StoryContext) => { + const snapshotArgs = { + gapSize: '24', + breakpointClass: 'gap-md-48', + }; + + return html` +
      ${G.render?.({ ...G.args, ...snapshotArgs }, context)}
      + `; + }, +}; diff --git a/packages/documentation/src/stories/utilities/spacing/spacing.stories.ts b/packages/documentation/src/stories/utilities/spacing/spacing.stories.ts index 16aaeab012..4abdc3b371 100644 --- a/packages/documentation/src/stories/utilities/spacing/spacing.stories.ts +++ b/packages/documentation/src/stories/utilities/spacing/spacing.stories.ts @@ -1,179 +1,187 @@ import type { Args, StoryContext, StoryFn, StoryObj } from '@storybook/web-components'; +import { TemplateResult } from 'lit'; import { html } from 'lit/static-html.js'; -import './spacing.styles.scss'; +import { MetaExtended } from '@root/types'; import { parse } from '@/utils/sass-export'; import scss from './spacing.module.scss'; -import { MetaExtended } from '@root/types'; +import './spacing.styles.scss'; /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ export const SCSS_VARIABLES: any = parse(scss); -const sizingOptions = ['0', '1', '2', '3', '4', '5', 'auto', ...Object.keys(SCSS_VARIABLES.sizes)]; +const properties = ['margin', 'padding', 'gap']; +const sizes = properties.reduce((options, property) => { + return { + ...options, + [property]: Object.keys(SCSS_VARIABLES.spacing) + .filter((key: string) => key.startsWith(`post-utility-${property}-`)) + .map((key: string) => key.replace(`post-utility-${property}-`, '')), + }; +}, {} as { [property: string]: string[] }); -const positionOptions = { - null: 'All around', - x: 'Along the horizontal axis', - y: 'Along the vertical axis', - t: 'At the top', - b: 'At the bottom', - e: 'To the right', - s: 'To the left', +const sides = { + null: 'All sides', + x: 'x - Along the horizontal axis', + y: 'y - Along the vertical axis', + t: 't - At the top', + b: 'b - At the bottom', + s: 's - At the start', + e: 'e - At the end', }; const meta: MetaExtended = { id: 'facaacfd-18f1-49b4-80f1-a96680730fa0', title: 'Utilities/Spacing', - parameters: { - badges: [], - }, - args: { - marginSize: 'regular', - marginPosition: 'null', - paddingSize: 'regular', - paddingPosition: 'null', - }, +}; + +export default meta; + +type Story = StoryObj; + +function withLegend(template: TemplateResult, ...legendItems: string[]) { + legendItems.unshift('element'); + return html` +
      + ${template} +
        + ${legendItems.map( + item => html` +
      • +
        + ${item} +
      • + `, + )} +
      +
      + `; +} + +export const MarginAndPadding: Story = { argTypes: { - marginSize: { - name: 'Margin size', - description: 'Sets the size of the Margin.', + marginSides: { + name: 'Sides', + description: 'Sets the margin sides.', control: { type: 'select', + labels: sides, }, - options: sizingOptions, + options: Object.keys(sides), table: { - category: 'General', + category: 'Margin', }, }, - marginPosition: { - name: 'Margin Position', - description: 'Sets the position of the Margin.', + marginSize: { + name: 'Size', + description: 'Sets the margin size.', control: { type: 'select', - labels: positionOptions, }, - options: Object.keys(positionOptions), + options: sizes.margin, table: { - category: 'General', + category: 'Margin', }, }, - paddingSize: { - name: 'Padding size', - description: 'Sets the size of the Padding.', + paddingSides: { + name: 'Sides', + description: 'Sets the padding sides.', control: { type: 'select', + labels: sides, }, - options: sizingOptions.filter(option => option !== 'auto'), + options: Object.keys(sides), table: { - category: 'General', + category: 'Padding', }, }, - paddingPosition: { - name: 'Padding Position', - description: 'Sets the position of the Padding.', + paddingSize: { + name: 'Size', + description: 'Sets the padding size.', control: { type: 'select', - labels: positionOptions, }, - options: Object.keys(positionOptions), + options: sizes.padding, table: { - category: 'General', + category: 'Padding', }, }, }, -}; - -export default meta; + args: { + marginSides: 'null', + marginSize: '20', + paddingSides: 'null', + paddingSize: '12', + }, + render: (args: Args) => { + const getPosition = (position: string) => (position === 'null' ? '' : position); + const marginClass = `m${getPosition(args.marginSides)}-${args.marginSize}`; + const paddingClass = `p${getPosition(args.paddingSides)}-${args.paddingSize}`; -type Story = StoryObj; + // used only for the snapshots + const breakpointClasses = args.breakpointClasses ? ` ${args.breakpointClasses}` : ''; -export const Default: Story = { - render: (args: Args) => { - // this will be the only code visible in the code preview - return html` -
      - `; + return html`
      `; }, decorators: [ - // everything in here will be visible in the example, but only the content coming from the `story` function will be shown in the code preview - (story: StoryFn, { args, context }: StoryContext) => html` -
      -
      ${story(args, context)}
      - -
      -
      -
      -
      -
      -
      -
      - -
        -
      • -
        - margin -
      • -
      • -
        - padding -
      • -
      • -
        - content -
      • -
      -
      - `, + (story: StoryFn, context: StoryContext) => { + const storyTemplate = html` +
      ${story(context.args, context)}
      + `; + return withLegend(storyTemplate, 'margin', 'padding'); + }, ], }; -export const ResponsiveExample: Story = { - render: () => { - return html`
      `; +export const Gap: Story = { + argTypes: { + property: { + name: 'Property', + description: 'Sets the gap property.', + control: { + type: 'select', + }, + options: ['gap', 'row-gap', 'column-gap'], + table: { + category: 'Gap', + }, + }, + size: { + name: 'Size', + description: 'Sets the gap size.', + control: { + type: 'select', + }, + options: sizes.gap, + table: { + category: 'Gap', + }, + }, }, - decorators: [ - // everything in here will be visible in the example, but only the content coming from the `story` function will be shown in the code preview - (story: StoryFn, { args, context }: StoryContext) => html` -
      -
      ${story(args, context)}
      -
      -
      -
      -

      Resize the browser window to see changes.

      + args: { + property: 'gap', + size: '16', + }, + render: (args: Args) => { + // used only for the snapshots + const breakpointClass = args.breakpointClass ? ` ${args.breakpointClass}` : ''; + return html` +
      +
      First child
      +
      Second child
      +
      Third child
      +
      Fourth child
      +
      Fifth child
      +
      Sixth child
      - `, - ], -}; - -export const AutomaticResponsiveExample: Story = { - render: () => { - return html`
      `; + `; }, decorators: [ - (story: StoryFn, { args, context }: StoryContext) => html` -
      -
      ${story(args, context)}
      -
      -
      -
      -

      Resize the browser window to see changes.

      -
      - `, + (story: StoryFn, context: StoryContext) => { + const storyTemplate = html`
      ${story(context.args, context)}
      `; + return withLegend(storyTemplate, 'gap'); + }, ], }; diff --git a/packages/documentation/src/stories/utilities/spacing/spacing.styles.scss b/packages/documentation/src/stories/utilities/spacing/spacing.styles.scss index 4e6328d3c1..f9afc38bd2 100644 --- a/packages/documentation/src/stories/utilities/spacing/spacing.styles.scss +++ b/packages/documentation/src/stories/utilities/spacing/spacing.styles.scss @@ -1,24 +1,55 @@ +@use 'sass:color'; @use '@swisspost/design-system-styles/core' as post; -.spacing-example { +$margin-color: color.adjust(post.$coral-bright, $lightness: 30%); +$padding-color: color.complement($margin-color); +$gap-color: color.adjust(post.$aubergine-bright, $lightness: 30%); +$content-color: post.$white; +$border: 1px solid post.$gray-40; + +.margin-padding-example { + display: flex; + width: fit-content; + background-color: $margin-color; + + > div { + height: 100px; + width: 100px; + background-image: linear-gradient($content-color, $content-color), linear-gradient($padding-color, $padding-color); + background-clip: content-box, padding-box; + border: $border; + } +} + +.gap-example { + > div { + width: fit-content; + background-color: $gap-color; + border: $border; + text-align: center; + + > div { + background-color: $content-color; + padding: 12px 16px; + } + } +} + +.legend { .margin { - background-color: #f4cea3; + background-color: $margin-color; } + .padding { - background-color: #c4dab9; - border: 1px solid post.$gray-40; - } - .content { - background-color: post.$white; + background-color: $padding-color; } - .legend { - .padding { - border: 0 none; - } + .gap { + background-color: $gap-color; + } - .content { - border: 1px solid post.$gray-40; - } + .element { + background-color: $content-color; + border: $border; } } diff --git a/packages/documentation/src/stories/utilities/text/text.blocks.tsx b/packages/documentation/src/stories/utilities/text/text.blocks.tsx index c952fba55d..71d6315c27 100644 --- a/packages/documentation/src/stories/utilities/text/text.blocks.tsx +++ b/packages/documentation/src/stories/utilities/text/text.blocks.tsx @@ -31,7 +31,7 @@ export const TextUtilityAPI = (props: {
      Values:
      {props.values.map(value => ( - + {value} ))} diff --git a/packages/documentation/src/stories/utilities/text/text.docs.mdx b/packages/documentation/src/stories/utilities/text/text.docs.mdx index 15dc2b296e..d706b20076 100644 --- a/packages/documentation/src/stories/utilities/text/text.docs.mdx +++ b/packages/documentation/src/stories/utilities/text/text.docs.mdx @@ -49,7 +49,7 @@ import SampleColor from './text-color.sample.scss?raw'; ### Font Weight -
      +
      The `.bold`, `.regular`, and `.light` classes are deprecated in favor of the `.fw-*` classes.
      @@ -70,7 +70,7 @@ import SampleColor from './text-color.sample.scss?raw'; -

      +

      There are no Sass variables for font styles at this time.

      @@ -109,7 +109,7 @@ Define how text-blocks are displayed. ### Color -
      +
      The `.text-auto` class is deprecated since text color is now set by the{' '} [backgrounds](/?path=/docs/60852fac-a861-4415-8276-bd38d68653bb--docs) themselves.
      diff --git a/packages/icons/public/index.html b/packages/icons/public/index.html index e59b56b38a..4372e0a8fe 100644 --- a/packages/icons/public/index.html +++ b/packages/icons/public/index.html @@ -19,10 +19,10 @@ -
      +

      Icons

      - + Version:
      @@ -52,7 +52,7 @@

      Icons

      -

      Wrong ViewBox

      +

      Wrong ViewBox

      The viewBox attribute of the incoming SVG file is not set to "0 0 32 32".