description
+description
+indeterminate state of checkbox. It
+ is a know bug reported in{' '}
+
+ Webkit Bugzilla
+
+checkbox.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Should be focusable and tabable.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Should have an accessible name.',
+ comment: `Can be named by: aria-label propIDREF) set for the aria-labelledby prop that refers to an elementdark against white: 21:1, light against black: 20.9:1.',
+ status: 'DONE',
+ tests: 'N/A',
+ },
+ {
+ pattern:
+ 'Should have a color indicator with 3:1 contrast ratio against the background.',
+ comment:
+ 'dark against white: 21:1, light against black: 20.9:1.',
+ status: 'DONE',
+ tests: 'N/A',
+ },
+ {
+ pattern: 'Should respect prefers reduce motion settings.',
+ status: 'TO DO',
+ tests: 'N/A',
+ },
+ {
+ pattern:
+ 'Should be activated by pressing Space and mouse click.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Can have a clickable label.',
+ comment: 'The whole area of card is wrapped with clickable label.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+];
+
+export default rules;
diff --git a/src/components/card-interactive/stories/CardCustomisation.mdx b/src/components/card-interactive/stories/CardCustomisation.mdx
new file mode 100644
index 0000000000..719b0eaaab
--- /dev/null
+++ b/src/components/card-interactive/stories/CardCustomisation.mdx
@@ -0,0 +1,20 @@
+Component supports following css variables which can be overwritten using custom class or directly in component's style prop.
+
+```css
+'--card-background-color'?: React.CSSProperties[ 'backgroundColor' ];
+'--card-border-color'?: React.CSSProperties[ 'borderColor' ];
+'--card-border-color-hover'?: React.CSSProperties[ 'borderColor' ];
+'--card-border-color-invalid'?: React.CSSProperties[ 'borderColor' ];
+'--card-border-color-invalid-hover'?: React.CSSProperties[ 'borderColor' ];
+'--card-border-color-checked'?: React.CSSProperties[ 'borderColor' ];
+'--card-border-color-checked-hover'?: React.CSSProperties[ 'borderColor' ];
+'--card-indicator-color'?: React.CSSProperties[ 'color' ];
+
+'--card-focus-color'?: React.CSSProperties[ 'color' ];
+'--card-focus-inner-color'?: React.CSSProperties[ 'color' ];
+'--card-focus-outer-color'?: React.CSSProperties[ 'color' ];
+'--card-focus-color-invalid'?: React.CSSProperties[ 'color' ];
+'--card-focus-outer-color-invalid'?: React.CSSProperties[ 'color' ];
+
+'--card-press-scale-factor'?: number;
+```
diff --git a/src/components/card-interactive/stories/CardRadioGroup.a11y.mdx b/src/components/card-interactive/stories/CardRadioGroup.a11y.mdx
new file mode 100644
index 0000000000..08afb43a1d
--- /dev/null
+++ b/src/components/card-interactive/stories/CardRadioGroup.a11y.mdx
@@ -0,0 +1,11 @@
+import {rules, radioItemRules} from './CardRadioGroup.rules.a11y';
+
+### Rules
+
+#### CardRadioGroup
+
+radiogroup.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Should have only one checked radio at a time.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Should have descriptive information about invalid state.',
+ comment:
+ 'State can be described using aria-description or aria-describedby.',
+ status: 'DONE',
+ tests: 'TO DO',
+ },
+ {
+ pattern: 'Can have an accessible name.',
+ comment: `Can be named by: aria-label propIDREF) set for the aria-labelledby
+ prop that refers to an element.aria-activedescendant attribute identifies the checked Radio
+ within Radiogroup by referencing the id value of the radio button that is active.`,
+ status: 'TO DO',
+ tests: 'TO DO',
+ },
+ {
+ pattern: 'Can have an accessible description.',
+ comment:
+ 'Can be described by setting a value for aria-describedby prop.',
+ status: 'DONE',
+ tests: 'TO DO',
+ },
+];
+
+export const radioItemRules = [
+ {
+ pattern: 'Should have a role radio.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Should be focusable.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Should have an accessible name.',
+ comment: `Can be named by: aria-label propIDREF) set for the aria-labelledby prop that refers to an elementcolor should relate to the label color.',
+ status: 'DONE',
+ tests: 'N/A',
+ },
+ {
+ pattern:
+ 'Should have a color indicator with 3:1 contrast ratio against the background.',
+ comment:
+ 'dark against white: 21:1, light against black: 13.48:1.',
+ status: 'DONE',
+ tests: 'N/A',
+ },
+ {
+ pattern: 'Should respect Windows High Contrast mode.',
+ status: 'TO DO',
+ tests: 'N/A',
+ },
+ {
+ pattern:
+ 'Should have descriptive information about required and invalid state.',
+ comment:
+ 'Invalid state is indicated by color change. Both states can be described using aria-describedby prop.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Should respect prefers reduce motion settings.',
+ status: 'TO DO',
+ tests: 'N/A',
+ },
+ {
+ pattern: 'Should be focused and checked by pressing arrows.',
+ status: 'DONE',
+ tests: 'N/A',
+ },
+ {
+ pattern: 'Should be nested in a radiogroup ',
+ comment: 'CardRadioGroup component is required.',
+ status: 'DONE',
+ tests: 'N/A',
+ },
+ {
+ pattern: 'Can have a clickable label.',
+ comment: 'The whole area of card is wrapped with clickable label.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+ {
+ pattern: 'Can have an accessible description.',
+ comment:
+ 'Can be described by setting a value for aria-description prop.',
+ status: 'DONE',
+ tests: 'DONE',
+ },
+];
diff --git a/src/components/card-interactive/types.ts b/src/components/card-interactive/types.ts
new file mode 100644
index 0000000000..16e2f6aa55
--- /dev/null
+++ b/src/components/card-interactive/types.ts
@@ -0,0 +1,18 @@
+export type StyleType = React.CSSProperties & {
+ '--card-background-color'?: React.CSSProperties['backgroundColor'];
+ '--card-border-color'?: React.CSSProperties['borderColor'];
+ '--card-border-color-hover'?: React.CSSProperties['borderColor'];
+ '--card-border-color-invalid'?: React.CSSProperties['borderColor'];
+ '--card-border-color-invalid-hover'?: React.CSSProperties['borderColor'];
+ '--card-border-color-checked'?: React.CSSProperties['borderColor'];
+ '--card-border-color-checked-hover'?: React.CSSProperties['borderColor'];
+ '--card-indicator-color'?: React.CSSProperties['color'];
+
+ '--card-focus-color'?: React.CSSProperties['color'];
+ '--card-focus-inner-color'?: React.CSSProperties['color'];
+ '--card-focus-outer-color'?: React.CSSProperties['color'];
+ '--card-focus-color-invalid'?: React.CSSProperties['color'];
+ '--card-focus-outer-color-invalid'?: React.CSSProperties['color'];
+
+ '--card-press-scale-factor'?: number;
+};
diff --git a/src/index.ts b/src/index.ts
index d8500a55fd..0bba14d0bd 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -175,3 +175,7 @@ export type {ProgressBarPropsType} from './components/progress-bar/ProgressBar';
export {default as ProgressBar} from './components/progress-bar/ProgressBar';
export type {SparksPropsType} from './components/sparks/Sparks';
export {default as Sparks} from './components/sparks/Sparks';
+export {default as CardRadioGroup} from './components/card-interactive/CardRadioGroup';
+export type {CardRadioGroupPropsType} from './components/card-interactive/CardRadioGroup';
+export {default as CardCheckbox} from './components/card-interactive/CardCheckbox';
+export type {CardCheckboxPropsType} from './components/card-interactive/CardCheckbox';
diff --git a/src/sass/main.scss b/src/sass/main.scss
index d1c525a577..be4698287c 100644
--- a/src/sass/main.scss
+++ b/src/sass/main.scss
@@ -70,4 +70,5 @@ $sgFontsPath: 'fonts/' !default;
@import '../components/select-menu/select-menu';
@import '../components/progress-bar/progress-bar';
@import '../components/sparks/sparks';
+@import '../components/card-interactive/card';
@import '../components/chip/chip';
diff --git a/yarn.lock b/yarn.lock
index 8c338f6c05..1f6ee667be 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4183,6 +4183,18 @@
resolved "https://registry.yarnpkg.com/@react-hook/passive-layout-effect/-/passive-layout-effect-1.2.1.tgz#c06dac2d011f36d61259aa1c6df4f0d5e28bc55e"
integrity sha512-IwEphTD75liO8g+6taS+4oqz+nnroocNfWVHWz7j+N+ZO2vYrc6PV1q7GQhuahL0IOR7JccFTsFKQ/mb6iZWAg==
+"@rive-app/canvas@1.0.102":
+ version "1.0.102"
+ resolved "https://registry.yarnpkg.com/@rive-app/canvas/-/canvas-1.0.102.tgz#e34dd1bba5411bc16cca282b20c8f8050cda18cb"
+ integrity sha512-EoJ+rNHh6ORn6wH1dKoI9trNddwSPkmYnGrVA7ShZwaDKl3LTDP8eWwSJp1wYmB2HE3dBjHZHQabQpFW8ohX7g==
+
+"@rive-app/react-canvas@^3.0.38":
+ version "3.0.38"
+ resolved "https://registry.yarnpkg.com/@rive-app/react-canvas/-/react-canvas-3.0.38.tgz#b9532666c2186bb75058cdf0f9c1bd75f367c610"
+ integrity sha512-V5+/I1ZJP416sp1uIQqm0kn9mA1fq1pNx1Il/f5AQYQw8Fu4P7Ume4+2HrMfWN1EHMvSqEgaBfsBUpFtYMQ1vw==
+ dependencies:
+ "@rive-app/canvas" "1.0.102"
+
"@rushstack/node-core-library@3.53.3":
version "3.53.3"
resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.53.3.tgz#e78e0dc1545f6cd7d80b0408cf534aefc62fbbe2"