Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(documentation): update CSS card-control styles and merge docs pages with the one from the web-component #2847

Merged
Show file tree
Hide file tree
Changes from 116 commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
ac55cec
feat(components): add post-card-control (unfinished)
oliverschuerch Oct 6, 2023
f047766
feat(documentation): add card-control stories (unfinished)
oliverschuerch Oct 6, 2023
e456da6
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Nov 9, 2023
1e04974
feat(components): add new component card-control (unfinished)
oliverschuerch Nov 10, 2023
1d819eb
feat(styles): add new custom color variable $focus
oliverschuerch Nov 10, 2023
e5a9343
chore: add todo
oliverschuerch Nov 10, 2023
e6f51a6
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Dec 15, 2023
c53e701
fix(components): fix post-card-control group behaviour of
oliverschuerch Dec 19, 2023
4b29ccb
chore(components): update props and add controlChange event
oliverschuerch Dec 20, 2023
3918db9
feat(documentation): add card-control docs (unfinished)
oliverschuerch Dec 20, 2023
5c8ef53
chore: add more documentation details and fix smaller bugs in the car…
oliverschuerch Dec 22, 2023
a286ff6
feat(styles): add default background-color for form-check elements
oliverschuerch Dec 22, 2023
60bc278
chore(documentation): add forms sort order in storybook navigation
oliverschuerch Dec 22, 2023
3c826e5
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Jan 18, 2024
05690d2
feat(components): extend cypress getCompnent command to be able to in…
oliverschuerch Jan 19, 2024
127025b
feat(components): remove controlId as prop (autocreation)
oliverschuerch Jan 19, 2024
62c9a94
feat(components): add errors when required props not set
oliverschuerch Jan 19, 2024
cc7a7c7
refactor(components): remove default value 'on' for value prop
oliverschuerch Jan 19, 2024
7110b16
refactor(components): state property to make it resettable
oliverschuerch Jan 19, 2024
f6fd5d9
fix(components): move card click handler to listen on the host
oliverschuerch Jan 19, 2024
84f217f
feat(components): improve clickable areas within content area
oliverschuerch Jan 19, 2024
2d2f981
chore(components): update story and component definitions accordingly
oliverschuerch Jan 19, 2024
f14797d
test(components): add basic testing
oliverschuerch Jan 19, 2024
d79f1a7
fix(components): card-control e2e tests
oliverschuerch Jan 24, 2024
f98dddb
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Feb 2, 2024
b77ce94
chore(components): card-control add initialState state
oliverschuerch Feb 7, 2024
422621c
chore(components): card-control refactor required props checks
oliverschuerch Feb 7, 2024
ed5b52e
chore(components): card-control remove content area
oliverschuerch Feb 7, 2024
610565e
chore(components): card-control add slot docs
oliverschuerch Feb 7, 2024
ada227e
refactor(components): refactor card-control how the checked state is set
oliverschuerch Feb 7, 2024
c2cf3e8
chore(components): card-control remove custom controlChange event
oliverschuerch Feb 7, 2024
c6049ab
chore(components): card-control update props and add readonly prop
oliverschuerch Feb 7, 2024
4eb6c26
feat(components): card-control add form associated callbacks and corr…
oliverschuerch Feb 7, 2024
f60ebd5
feat(components): card-control add dark-bg styles
oliverschuerch Feb 7, 2024
eb91b56
feat(documentation): card-control add stories
oliverschuerch Feb 7, 2024
1bd3879
chore(components): card-control remove stories which will be included…
oliverschuerch Feb 7, 2024
99397b5
chore(components): card-component update property types
oliverschuerch Feb 7, 2024
4532d6b
chore(components): card-component implement native like custom events…
oliverschuerch Feb 8, 2024
9ab7100
chore(styles): remove wrongly added $focus variable (instead $outline…
oliverschuerch Feb 8, 2024
167e0c7
test(components): update card-control e2e tests
oliverschuerch Feb 8, 2024
e61fae1
feat(components): add reset and clearvalidity methods in card-control
oliverschuerch Feb 9, 2024
5e26582
test(components): add tests for methods and form-association
oliverschuerch Feb 9, 2024
5571ed0
chore(components): remove public method clearValidity out ouf card-co…
oliverschuerch Feb 9, 2024
ef74c50
chore(components): improve card-control background story
oliverschuerch Feb 9, 2024
8b40e3e
chore(components): adapt newest color definitions from design
oliverschuerch Feb 9, 2024
8e930ee
test(components): add radio-group tests
oliverschuerch Feb 9, 2024
1dababe
chore(components): add todos and fix some docs texts
oliverschuerch Feb 9, 2024
54ad560
chore(documentation): add card-control alert for the form-association…
oliverschuerch Feb 9, 2024
26193c2
feat(documentation): add uuid for card-control story
oliverschuerch Feb 16, 2024
994b14b
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Feb 16, 2024
c9476c4
test(documentation): add card-control snapshot test
oliverschuerch Feb 16, 2024
29919ce
feat(documentation): add card-control fieldset example
oliverschuerch Feb 16, 2024
e71d908
chore(documentation): update card-control lined up story
oliverschuerch Feb 16, 2024
df7773c
feat(components): add the possibility to stretch all card-control ele…
oliverschuerch Feb 16, 2024
86194c6
chore(components): fix codesmells reported by sonar
oliverschuerch Feb 20, 2024
0da9eb6
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Feb 20, 2024
79936b7
chore(components): add post-card-control to exported members
oliverschuerch Feb 20, 2024
f9d880c
chore(components): update eslint config
oliverschuerch Feb 20, 2024
44f0002
chore(components): remove todo comment reported by sonar
oliverschuerch Feb 20, 2024
f020ab6
chore: add changesets
oliverschuerch Feb 20, 2024
b5e8847
feat(components-angular): add `post-card-control` example to the cons…
oliverschuerch Feb 20, 2024
7f8ab0c
Update packages/components/src/components.d.ts
oliverschuerch Feb 22, 2024
5698dca
Update packages/documentation/src/stories/components/card-control/car…
oliverschuerch Feb 22, 2024
6615ff5
Update packages/documentation/src/stories/components/card-control/car…
oliverschuerch Feb 22, 2024
d18ea7b
Update packages/documentation/src/stories/components/card-control/car…
oliverschuerch Feb 22, 2024
95176a7
chore(documentation): remove `needs_revision` badge
oliverschuerch Feb 22, 2024
5380069
chore(components): add card-control comment for style order
oliverschuerch Feb 22, 2024
e4ac0ee
chore(components): update some generated files
oliverschuerch Feb 22, 2024
f4d202c
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Feb 22, 2024
4ecf48a
feat(components): add a111y test for card-control
oliverschuerch Feb 22, 2024
8cbbc55
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Mar 1, 2024
6570383
feat(components): add css modules for components package
oliverschuerch Mar 1, 2024
1b3ab73
feat(components): add sass-export util
oliverschuerch Mar 1, 2024
2fee563
chore(components): remove badges from card-control docs page
oliverschuerch Mar 1, 2024
1fb9e9a
fix(components): implement :host-context fallback for firefox and safari
oliverschuerch Mar 1, 2024
46dd288
refactor: post-card-control component
oliverschuerch Mar 12, 2024
0fd6370
feat(components-angular): add custom card-control-view
oliverschuerch Mar 12, 2024
3a85acb
test(components): update card-control tests
oliverschuerch Mar 13, 2024
9ff2620
test(components-angular): add post-card-control e2e test
oliverschuerch Mar 13, 2024
ad97d24
chore: update card-control form associated story
oliverschuerch Mar 13, 2024
3be777f
chore(components): remove unnecessary disconnectCallback in card-control
oliverschuerch Mar 13, 2024
632d765
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Mar 13, 2024
6604d32
fix(components-angular): fix issue in angular build process, by addin…
oliverschuerch Mar 14, 2024
e1a20df
fix: lint errors
oliverschuerch Mar 14, 2024
d944368
fix(components): add @HostListener istead of host property in directi…
oliverschuerch Mar 14, 2024
87c309c
chore(components-angular): add post-rating to home view
oliverschuerch Mar 14, 2024
bfcfb9d
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Mar 14, 2024
faff6bc
fix(components): prevent card-control from fiering errors, on startup
oliverschuerch Mar 14, 2024
62a9957
chore(components-angular): add a routerlink navigation
oliverschuerch Mar 14, 2024
e555dc7
chore(components-angular): add generated first-level-routes navigation
oliverschuerch Mar 14, 2024
6a18fc5
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
oliverschuerch Mar 14, 2024
26a3040
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Mar 20, 2024
f2013b2
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Mar 20, 2024
20089b2
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Mar 21, 2024
d091241
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Mar 21, 2024
241bfb3
chore(documentation): prepare card-control docs page for merging with…
oliverschuerch Mar 21, 2024
ce07d1a
chore(documentation): merge card-control docs
oliverschuerch Mar 22, 2024
c0029b2
chore: update choice-control-card styles and docs
oliverschuerch Mar 22, 2024
83de44f
chore(documentation): fix lint problems
oliverschuerch Mar 22, 2024
a1d6e86
chore(documentation): updateArgs in card-control form associated story
oliverschuerch Mar 22, 2024
8aa2c59
chore: update changeset
oliverschuerch Mar 22, 2024
8b3862e
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Mar 28, 2024
c6d8053
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 3, 2024
7c11c92
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 4, 2024
e3a1c41
fix: vite build errors
oliverschuerch Apr 4, 2024
f579359
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 4, 2024
736366f
chore: revert unnecessary change
oliverschuerch Apr 4, 2024
0f0d118
fix: typo
oliverschuerch Apr 4, 2024
eeac5e0
chore: add info about when to use the standard html and when the web-…
oliverschuerch Apr 4, 2024
e189762
chore(components): update hcm styles for card-control
oliverschuerch Apr 5, 2024
8cd0492
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 11, 2024
803adf0
chore: update todos in card-control styles
oliverschuerch Apr 11, 2024
885b5d6
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 11, 2024
f251649
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 11, 2024
29a3a8b
test(documentation): fix wrongly merged e2e test of CSS card component
oliverschuerch Apr 12, 2024
f53014f
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
imagoiq Apr 15, 2024
5022e5d
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 16, 2024
7c40c5d
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 19, 2024
3d0e496
Merge branch 'main' into chore/2674-merge-docs-pages-of-card-control-…
oliverschuerch Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/sixty-dancers-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@swisspost/design-system-components-angular-workspace': patch
'@swisspost/design-system-documentation': patch
'@swisspost/design-system-components': patch
'@swisspost/design-system-styles': patch
---

Merged the card-control, checkbox-card and radio button card docs pages and updated the choice-card-control styles.
oliverschuerch marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ <h2>Post Icon</h2>
<post-icon name="1001"></post-icon>
</div>

<div class="my-4">
<h2>Post Rating</h2>
<post-rating></post-rating>
</div>

<div class="my-4">
<h2>Post Popover</h2>
<button class="btn btn-secondary btn-large" data-popover-target="popover-one">
Expand All @@ -66,6 +61,11 @@ <h2>Post Popovercontainer</h2>
<post-popovercontainer></post-popovercontainer>
</div>

<div class="my-4">
<h2>Post Rating</h2>
<post-rating></post-rating>
</div>

<div class="my-4">
<h2>Post Tabs</h2>
<post-tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
border: post.$size-line solid var(--post-card-control-border-color);
border-radius: post.$border-radius;
color: var(--post-card-control-color);

cursor: pointer;
transition: background-color 100ms linear, border-color 100ms linear;

.card-control--input {
grid-area: input;
Expand All @@ -41,12 +39,19 @@
border-color: var(--post-card-control-input-border-color) !important;
color: var(--post-card-control-input-border-color) !important;
cursor: inherit;
transition: border-color 100ms ease-in-out;
transition: none;
oliverschuerch marked this conversation as resolved.
Show resolved Hide resolved

&:focus,
&:focus-visible {
box-shadow: none;
}

@include post.high-contrast-mode() {
&::after {
forced-color-adjust: none;
border-color: transparent;
}
}
}

.card-control--label {
Expand Down Expand Up @@ -88,6 +93,20 @@
&.is-checked {
--post-card-control-border-color: #{post.$black};
--post-card-control-bg: #{post.$yellow};

@include post.high-contrast-mode() {
--post-card-control-border-color: FieldText;
--post-card-control-bg: SelectedItem;
--post-card-control-color: SelectedItemText;
--post-card-control-input-border-color: SelectedItemText;
--post-card-control-input-bg: SelectedItem;

.card-control--input {
&::after {
background-color: var(--post-card-control-color) !important;
}
}
}
}

&.is-invalid {
Expand All @@ -101,6 +120,20 @@
--post-card-control-bg: #{post.$gray-60};
--post-card-control-color: #{post.$white};
--post-card-control-input-border-color: #{post.$black};

@include post.high-contrast-mode() {
--post-card-control-border-color: Highlight;
--post-card-control-bg: Field;
--post-card-control-color: FieldText;
--post-card-control-input-border-color: Highlight;
--post-card-control-input-bg: Field;

.card-control--input {
&::after {
color: FieldText;
}
}
}
}
}

Expand All @@ -126,6 +159,35 @@
.card-control--input {
border-style: dashed;
}

@include post.high-contrast-mode() {
--post-card-control-border-color: GrayText;
--post-card-control-color: GrayText;
--post-card-control-input-border-color: GrayText;

&.is-checked {
--post-card-control-input-bg: field;

position: relative;

&::before {
display: block;
content: '';
position: absolute;
inset: post.$size-line;
border-radius: post.$size-line * 0.5;
background-color: SelectedItem;
}

> * {
position: relative;
}

.card-control--input {
outline: post.$size-line solid Field;
}
}
}
}

:host-context(:is(#{post.$dark-backgrounds})) & {
Expand All @@ -146,8 +208,12 @@
--post-card-control-input-border-color: #{post.$gray-80};
--post-card-control-input-bg: #{post.$white};

&.is-invalid {
--post-card-control-bg: #{post.$yellow};
@include post.high-contrast-mode() {
--post-card-control-border-color: FieldText;
--post-card-control-bg: SelectedItem;
--post-card-control-color: SelectedItemText;
--post-card-control-input-border-color: SelectedItemText;
--post-card-control-input-bg: SelectedItem;
}
}

Expand All @@ -157,6 +223,18 @@
--post-card-control-color: #{post.$error};
--post-card-control-input-border-color: #{post.$error};
--post-card-control-input-bg: #{post.$white};

&.is-checked {
--post-card-control-bg: #{post.$yellow};

@include post.high-contrast-mode() {
--post-card-control-border-color: FieldText;
--post-card-control-bg: SelectedItem;
--post-card-control-color: SelectedItemText;
--post-card-control-input-border-color: SelectedItemText;
--post-card-control-input-bg: SelectedItem;
}
}
}

&:hover {
Expand All @@ -165,6 +243,14 @@
--post-card-control-color: #{post.$black};
--post-card-control-input-border-color: #{post.$black};
--post-card-control-input-bg: #{post.$white};

@include post.high-contrast-mode() {
--post-card-control-border-color: Highlight;
--post-card-control-bg: Field;
--post-card-control-color: FieldText;
--post-card-control-input-border-color: Highlight;
--post-card-control-input-bg: Field;
}
}
}

Expand All @@ -175,13 +261,22 @@
}
}

// TODO: update white alpha colors with design-system alpha colors, once they are defined
&.is-disabled {
--post-card-control-border-color: #{#{rgba(post.$white, 0.8)}};
--post-card-control-border-color: post.$white-alpha-80;
--post-card-control-bg: transparent;
--post-card-control-color: #{#{rgba(post.$white, 0.8)}};
--post-card-control-input-border-color: #{#{rgba(post.$white, 0.8)}};
--post-card-control-color: post.$white-alpha-80;
--post-card-control-input-border-color: post.$white-alpha-80;
--post-card-control-input-bg: transparent;

@include post.high-contrast-mode() {
--post-card-control-border-color: GrayText;
--post-card-control-color: GrayText;
--post-card-control-input-border-color: GrayText;

&.is-checked {
--post-card-control-input-bg: Field;
}
}
}
}
}
Expand Down Expand Up @@ -213,8 +308,12 @@
--post-card-control-input-border-color: #{post.$gray-80};
--post-card-control-input-bg: #{post.$white};

&.is-invalid {
--post-card-control-bg: #{post.$yellow};
@include post.high-contrast-mode() {
--post-card-control-border-color: FieldText;
--post-card-control-bg: SelectedItem;
--post-card-control-color: SelectedItemText;
--post-card-control-input-border-color: SelectedItemText;
--post-card-control-input-bg: SelectedItem;
}
}

Expand All @@ -224,6 +323,18 @@
--post-card-control-color: #{post.$error};
--post-card-control-input-border-color: #{post.$error};
--post-card-control-input-bg: #{post.$white};

&.is-checked {
--post-card-control-bg: #{post.$yellow};

@include post.high-contrast-mode() {
--post-card-control-border-color: FieldText;
--post-card-control-bg: SelectedItem;
--post-card-control-color: SelectedItemText;
--post-card-control-input-border-color: SelectedItemText;
--post-card-control-input-bg: SelectedItem;
}
}
}

&:hover {
Expand All @@ -232,6 +343,14 @@
--post-card-control-color: #{post.$black};
--post-card-control-input-border-color: #{post.$black};
--post-card-control-input-bg: #{post.$white};

@include post.high-contrast-mode() {
oliverschuerch marked this conversation as resolved.
Show resolved Hide resolved
--post-card-control-border-color: Highlight;
--post-card-control-bg: Field;
--post-card-control-color: FieldText;
--post-card-control-input-border-color: Highlight;
--post-card-control-input-bg: Field;
}
}
}

Expand All @@ -242,13 +361,22 @@
}
}

// TODO: update white alpha colors with design-system alpha colors, once they are defined
&.is-disabled {
--post-card-control-border-color: post.$white-alpha-80;
--post-card-control-bg: transparent;
--post-card-control-color: post.$white-alpha-80;
--post-card-control-input-border-color: post.$white-alpha-80;
--post-card-control-input-bg: transparent;

@include post.high-contrast-mode() {
--post-card-control-border-color: GrayText;
--post-card-control-color: GrayText;
--post-card-control-input-border-color: GrayText;

&.is-checked {
--post-card-control-input-bg: Field;
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Choice-card', () => {
describe('Accessibility', () => {
beforeEach(() => {
cy.visit('/iframe.html?id=snapshots--choice-card');
cy.visit('/iframe.html?id=snapshots--card-control-standard-html');
cy.get('.radio-button-card', { timeout: 30000 }).should('be.visible');
cy.injectAxe();
});
Expand Down
Loading
Loading