@arbor-education/design-system.components 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/components/articleCard/ArticleCard.d.ts +30 -0
- package/dist/components/articleCard/ArticleCard.d.ts.map +1 -0
- package/dist/components/articleCard/ArticleCard.js +24 -0
- package/dist/components/articleCard/ArticleCard.js.map +1 -0
- package/dist/components/articleCard/ArticleCard.stories.d.ts +18 -0
- package/dist/components/articleCard/ArticleCard.stories.d.ts.map +1 -0
- package/dist/components/articleCard/ArticleCard.stories.js +112 -0
- package/dist/components/articleCard/ArticleCard.stories.js.map +1 -0
- package/dist/components/articleCard/ArticleCard.test.d.ts +2 -0
- package/dist/components/articleCard/ArticleCard.test.d.ts.map +1 -0
- package/dist/components/articleCard/ArticleCard.test.js +49 -0
- package/dist/components/articleCard/ArticleCard.test.js.map +1 -0
- package/dist/components/card/Card.d.ts +41 -12
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +46 -17
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/card/Card.stories.d.ts +9 -84
- package/dist/components/card/Card.stories.d.ts.map +1 -1
- package/dist/components/card/Card.stories.js +15 -73
- package/dist/components/card/Card.stories.js.map +1 -1
- package/dist/components/card/Card.test.js +50 -152
- package/dist/components/card/Card.test.js.map +1 -1
- package/dist/components/formField/inputs/time/TimeInput.d.ts +1 -1
- package/dist/components/formField/inputs/time/TimeInput.stories.d.ts +1 -1
- package/dist/components/icoText/IcoText.d.ts +37 -0
- package/dist/components/icoText/IcoText.d.ts.map +1 -0
- package/dist/components/icoText/IcoText.js +29 -0
- package/dist/components/icoText/IcoText.js.map +1 -0
- package/dist/components/icoText/IcoText.stories.d.ts +34 -0
- package/dist/components/icoText/IcoText.stories.d.ts.map +1 -0
- package/dist/components/icoText/IcoText.stories.js +24 -0
- package/dist/components/icoText/IcoText.stories.js.map +1 -0
- package/dist/components/icoText/IcoText.test.d.ts +2 -0
- package/dist/components/icoText/IcoText.test.d.ts.map +1 -0
- package/dist/components/icoText/IcoText.test.js +27 -0
- package/dist/components/icoText/IcoText.test.js.map +1 -0
- package/dist/components/kpiCard/KPICard.d.ts +13 -0
- package/dist/components/kpiCard/KPICard.d.ts.map +1 -0
- package/dist/components/kpiCard/KPICard.js +8 -0
- package/dist/components/kpiCard/KPICard.js.map +1 -0
- package/dist/components/kpiCard/KPICard.stories.d.ts +9 -0
- package/dist/components/kpiCard/KPICard.stories.d.ts.map +1 -0
- package/dist/components/kpiCard/KPICard.stories.js +18 -0
- package/dist/components/kpiCard/KPICard.stories.js.map +1 -0
- package/dist/components/kpiCard/KPICard.test.d.ts +2 -0
- package/dist/components/kpiCard/KPICard.test.d.ts.map +1 -0
- package/dist/components/kpiCard/KPICard.test.js +37 -0
- package/dist/components/kpiCard/KPICard.test.js.map +1 -0
- package/dist/components/kvpList/KVPList.d.ts +34 -0
- package/dist/components/kvpList/KVPList.d.ts.map +1 -0
- package/dist/components/kvpList/KVPList.js +20 -0
- package/dist/components/kvpList/KVPList.js.map +1 -0
- package/dist/components/kvpList/KVPList.stories.d.ts +27 -0
- package/dist/components/kvpList/KVPList.stories.d.ts.map +1 -0
- package/dist/components/kvpList/KVPList.stories.js +18 -0
- package/dist/components/kvpList/KVPList.stories.js.map +1 -0
- package/dist/components/kvpList/KVPList.test.d.ts +2 -0
- package/dist/components/kvpList/KVPList.test.d.ts.map +1 -0
- package/dist/components/kvpList/KVPList.test.js +29 -0
- package/dist/components/kvpList/KVPList.test.js.map +1 -0
- package/dist/components/singleUser/SingleUser.d.ts +1 -1
- package/dist/components/tabs/TabsItem.stories.d.ts +2 -2
- package/dist/index.css +186 -22
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/articleCard/ArticleCard.stories.tsx +132 -0
- package/src/components/articleCard/ArticleCard.test.tsx +121 -0
- package/src/components/articleCard/ArticleCard.tsx +100 -0
- package/src/components/articleCard/articleCard.scss +39 -0
- package/src/components/card/Card.stories.tsx +35 -79
- package/src/components/card/Card.test.tsx +72 -190
- package/src/components/card/Card.tsx +117 -58
- package/src/components/card/card.scss +18 -31
- package/src/components/icoText/IcoText.stories.tsx +47 -0
- package/src/components/icoText/IcoText.test.tsx +41 -0
- package/src/components/icoText/IcoText.tsx +93 -0
- package/src/components/icoText/icoText.scss +34 -0
- package/src/components/kpiCard/KPICard.stories.tsx +47 -0
- package/src/components/kpiCard/KPICard.test.tsx +60 -0
- package/src/components/kpiCard/KPICard.tsx +45 -0
- package/src/components/kpiCard/kpiCard.scss +35 -0
- package/src/components/kvpList/KVPList.stories.tsx +51 -0
- package/src/components/kvpList/KVPList.test.tsx +66 -0
- package/src/components/kvpList/KVPList.tsx +109 -0
- package/src/components/kvpList/kvpList.scss +64 -0
- package/src/index.scss +4 -0
- package/src/index.ts +13 -4
- package/src/tokens.scss +6 -0
- package/tokens/json/Arbor.json +30 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
|
|
3
|
+
export type KVPListProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type KVPListRowProps = React.HTMLAttributes<HTMLDListElement> & {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type KVPListTermProps = React.HTMLAttributes<HTMLElement> & {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type KVPListDefinitionProps = React.HTMLAttributes<HTMLElement> & {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
isRow?: boolean;
|
|
19
|
+
isPercentage?: boolean;
|
|
20
|
+
prominence?: 'neutral' | 'strong';
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const KVPListRoot = ({
|
|
24
|
+
children,
|
|
25
|
+
className,
|
|
26
|
+
role,
|
|
27
|
+
'aria-label': ariaLabel,
|
|
28
|
+
'aria-labelledby': ariaLabelledBy,
|
|
29
|
+
...rest
|
|
30
|
+
}: KVPListProps): React.JSX.Element => (
|
|
31
|
+
<div
|
|
32
|
+
className={classNames('ds-kvp-list', className)}
|
|
33
|
+
role={role ?? (ariaLabel || ariaLabelledBy ? 'group' : undefined)}
|
|
34
|
+
aria-label={ariaLabel}
|
|
35
|
+
aria-labelledby={ariaLabelledBy}
|
|
36
|
+
{...rest}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const KVPListRow = ({
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
orientation = 'vertical',
|
|
46
|
+
...rest
|
|
47
|
+
}: KVPListRowProps): React.JSX.Element => (
|
|
48
|
+
<dl
|
|
49
|
+
className={classNames(
|
|
50
|
+
'ds-kvp-list__row',
|
|
51
|
+
`ds-kvp-list__row--${orientation}`,
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...rest}
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
</dl>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const KVPListTerm = ({
|
|
61
|
+
children,
|
|
62
|
+
className,
|
|
63
|
+
...rest
|
|
64
|
+
}: KVPListTermProps): React.JSX.Element => (
|
|
65
|
+
<dt className={classNames('ds-kvp-list__term', className)} {...rest}>
|
|
66
|
+
{children}
|
|
67
|
+
</dt>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const KVPListDefinition = ({
|
|
71
|
+
children,
|
|
72
|
+
className,
|
|
73
|
+
isRow = false,
|
|
74
|
+
isPercentage = false,
|
|
75
|
+
prominence = 'neutral',
|
|
76
|
+
...rest
|
|
77
|
+
}: KVPListDefinitionProps): React.JSX.Element => (
|
|
78
|
+
<dd
|
|
79
|
+
className={classNames(
|
|
80
|
+
'ds-kvp-list__description',
|
|
81
|
+
`ds-kvp-list__description--${prominence}`,
|
|
82
|
+
{
|
|
83
|
+
'ds-kvp-list__description--row': isRow,
|
|
84
|
+
},
|
|
85
|
+
className,
|
|
86
|
+
)}
|
|
87
|
+
{...rest}
|
|
88
|
+
>
|
|
89
|
+
{children}
|
|
90
|
+
{isPercentage
|
|
91
|
+
? (
|
|
92
|
+
<span className="ds-kvp-list__suffix">
|
|
93
|
+
%
|
|
94
|
+
</span>
|
|
95
|
+
)
|
|
96
|
+
: null}
|
|
97
|
+
</dd>
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
KVPListRoot.displayName = 'KVPList';
|
|
101
|
+
KVPListRow.displayName = 'KVPList.Row';
|
|
102
|
+
KVPListTerm.displayName = 'KVPList.Term';
|
|
103
|
+
KVPListDefinition.displayName = 'KVPList.Definition';
|
|
104
|
+
|
|
105
|
+
export const KVPList = Object.assign(KVPListRoot, {
|
|
106
|
+
Row: KVPListRow,
|
|
107
|
+
Term: KVPListTerm,
|
|
108
|
+
Definition: KVPListDefinition,
|
|
109
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.ds-kvp-list {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--spacing-medium);
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ds-kvp-list__term,
|
|
10
|
+
.ds-kvp-list__description {
|
|
11
|
+
margin: 0;
|
|
12
|
+
flex: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ds-kvp-list__term,
|
|
16
|
+
.ds-kvp-list__description--neutral {
|
|
17
|
+
color: var(--kvp-list-color-text-subtle);
|
|
18
|
+
font-family: var(--type-body-p-family);
|
|
19
|
+
font-size: var(--type-body-p-size);
|
|
20
|
+
font-weight: var(--type-body-p-weight);
|
|
21
|
+
line-height: var(--type-body-line-height);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ds-kvp-list__description--strong {
|
|
25
|
+
color: var(--kvp-list-color-text-strong);
|
|
26
|
+
font-family: var(--type-headings-h2-family);
|
|
27
|
+
font-size: var(--type-headings-h2-size);
|
|
28
|
+
font-weight: var(--type-headings-h2-weight);
|
|
29
|
+
line-height: var(--type-headings-h2-line-height);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ds-kvp-list__description--row {
|
|
33
|
+
flex-basis: 100%;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ds-kvp-list__suffix {
|
|
38
|
+
margin-left: var(--spacing-xsmall);
|
|
39
|
+
font: inherit;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-kvp-list__description {
|
|
43
|
+
text-align: right;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ds-kvp-list__row {
|
|
47
|
+
display: flex;
|
|
48
|
+
width: 100%;
|
|
49
|
+
margin: 0;
|
|
50
|
+
gap: var(--spacing-small);
|
|
51
|
+
|
|
52
|
+
&--vertical {
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--horizontal {
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
align-items: center;
|
|
59
|
+
|
|
60
|
+
.ds-kvp-list__description:not(.ds-kvp-list__description--row) {
|
|
61
|
+
flex: 0 0 auto;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/index.scss
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
@use "./global.scss";
|
|
4
4
|
@use "components/button/button.scss";
|
|
5
5
|
@use "components/icon/icon.scss";
|
|
6
|
+
@use "components/icoText/icoText.scss";
|
|
6
7
|
@use "components/heading/heading.scss";
|
|
7
8
|
@use "components/card/card.scss";
|
|
9
|
+
@use "components/articleCard/articleCard.scss";
|
|
8
10
|
@use "components/dropdown/dropdown.scss";
|
|
9
11
|
@use "components/formField/formField.scss";
|
|
10
12
|
@use "components/formField/fieldset/fieldset.scss";
|
|
@@ -35,6 +37,8 @@
|
|
|
35
37
|
@use "components/banner/banner.scss";
|
|
36
38
|
@use "components/editableText/editableText.scss";
|
|
37
39
|
@use "components/progress/progress.scss";
|
|
40
|
+
@use "components/kpiCard/kpiCard.scss";
|
|
41
|
+
@use "components/kvpList/kvpList.scss";
|
|
38
42
|
@use "components/toast/toast.scss";
|
|
39
43
|
@use "components/datePicker/datePicker.scss";
|
|
40
44
|
@use "components/dateTimePicker/dateTimePicker.scss";
|
package/src/index.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
export { ArticleCard, type ArticleCardProps } from 'Components/articleCard/ArticleCard';
|
|
1
2
|
export { Avatar } from 'Components/avatar/Avatar';
|
|
2
3
|
export { AvatarGroup } from 'Components/avatarGroup/AvatarGroup';
|
|
3
4
|
export { Badge } from 'Components/badge/Badge';
|
|
4
5
|
export { Banner } from 'Components/banner/Banner';
|
|
5
6
|
export { Button } from 'Components/button/Button';
|
|
6
|
-
export { Card } from 'Components/card/Card';
|
|
7
|
+
export { Card, type CardProps } from 'Components/card/Card';
|
|
7
8
|
export { Combobox } from 'Components/combobox/Combobox';
|
|
8
9
|
export { DatePicker } from 'Components/datePicker/DatePicker';
|
|
9
10
|
export { DateTimePicker } from 'Components/dateTimePicker/DateTimePicker';
|
|
10
11
|
export { Dot } from 'Components/dot/Dot';
|
|
11
12
|
export { Dropdown } from 'Components/dropdown/Dropdown';
|
|
12
13
|
export { EditableText } from 'Components/editableText/EditableText';
|
|
14
|
+
export { Fieldset } from 'Components/formField/fieldset/Fieldset';
|
|
15
|
+
export { FormField } from 'Components/formField/FormField';
|
|
13
16
|
export { CheckboxGroup } from 'Components/formField/inputs/checkbox/CheckboxGroup';
|
|
14
17
|
export { CheckboxInput } from 'Components/formField/inputs/checkbox/CheckboxInput';
|
|
15
18
|
export { ColourPickerDropdown } from 'Components/formField/inputs/colourPickerDropdown/ColourPickerDropdown';
|
|
@@ -18,12 +21,13 @@ export { RadioButtonGroup } from 'Components/formField/inputs/radio/RadioButtonG
|
|
|
18
21
|
export { RadioButtonInput } from 'Components/formField/inputs/radio/RadioButtonInput';
|
|
19
22
|
export { SelectDropdown } from 'Components/formField/inputs/selectDropdown/SelectDropdown';
|
|
20
23
|
export { TextInput } from 'Components/formField/inputs/text/TextInput';
|
|
21
|
-
export { TimeInput } from 'Components/formField/inputs/time/TimeInput';
|
|
22
24
|
export { TextArea } from 'Components/formField/inputs/textArea/TextArea';
|
|
23
|
-
export {
|
|
24
|
-
export { FormField } from 'Components/formField/FormField';
|
|
25
|
+
export { TimeInput } from 'Components/formField/inputs/time/TimeInput';
|
|
25
26
|
export { Heading } from 'Components/heading/Heading';
|
|
26
27
|
export { Icon } from 'Components/icon/Icon';
|
|
28
|
+
export { IcoText, type IcoTextHeadingProps, type IcoTextIconProps, type IcoTextParagraphProps, type IcoTextProps } from 'Components/icoText/IcoText';
|
|
29
|
+
export { KPICard, type KPICardProps } from 'Components/kpiCard/KPICard';
|
|
30
|
+
export { KVPList, type KVPListDefinitionProps, type KVPListProps, type KVPListRowProps, type KVPListTermProps } from 'Components/kvpList/KVPList';
|
|
27
31
|
export { Modal } from 'Components/modal/Modal';
|
|
28
32
|
export { ModalManager } from 'Components/modal/modalManager/ModalManager';
|
|
29
33
|
export { Pill } from 'Components/pill/Pill';
|
|
@@ -35,6 +39,11 @@ export { Separator } from 'Components/separator/Separator';
|
|
|
35
39
|
export { SingleUser } from 'Components/singleUser/SingleUser';
|
|
36
40
|
export { Slideover } from 'Components/slideover/Slideover';
|
|
37
41
|
export { SlideoverManager } from 'Components/slideoverManager/SlideoverManager';
|
|
42
|
+
export { BooleanCellRenderer } from 'Components/table/cellRenderers/BooleanCellRenderer';
|
|
43
|
+
export { CheckboxCellRenderer } from 'Components/table/cellRenderers/CheckboxCellRenderer';
|
|
44
|
+
export { DefaultCellRenderer } from 'Components/table/cellRenderers/DefaultCellRenderer';
|
|
45
|
+
export { DSDefaultColDef } from 'Components/table/DSDefaultColDef';
|
|
46
|
+
export { GridApiContext } from 'Components/table/GridApiContext';
|
|
38
47
|
export { Table } from 'Components/table/Table';
|
|
39
48
|
export { Tabs } from 'Components/tabs/Tabs';
|
|
40
49
|
export { Tag } from 'Components/tag/Tag';
|
package/src/tokens.scss
CHANGED
|
@@ -211,6 +211,12 @@
|
|
|
211
211
|
--kpi-spacing-vertical: var(--spacing-large);
|
|
212
212
|
--kpi-color-benchmark-text: var(--color-grey-500);
|
|
213
213
|
--kpi-color-benchmark-text-bg: var(--color-grey-100);
|
|
214
|
+
--kvp-list-color-text-subtle: var(--color-grey-800);
|
|
215
|
+
--kvp-list-color-text-strong: var(--color-mono-black);
|
|
216
|
+
--ico-text-spacing-gap-horizontal: var(--spacing-large);
|
|
217
|
+
--ico-text-spacing-gap-vertical: var(--spacing-medium);
|
|
218
|
+
--kpi-card-color-text-label: var(--color-grey-800);
|
|
219
|
+
--kpi-card-color-text-value: var(--color-mono-black);
|
|
214
220
|
--tag-radius: var(--border-radius-round);
|
|
215
221
|
--tag-neutral-color-text: var(--color-grey-900);
|
|
216
222
|
--tag-neutral-color-background: var(--color-grey-050);
|
package/tokens/json/Arbor.json
CHANGED
|
@@ -51,6 +51,36 @@
|
|
|
51
51
|
"$value": "{color.grey.100}"
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
+
"kvp-list": {
|
|
55
|
+
"color-text-subtle": {
|
|
56
|
+
"$type": "color",
|
|
57
|
+
"$value": "{color.grey.800}"
|
|
58
|
+
},
|
|
59
|
+
"color-text-strong": {
|
|
60
|
+
"$type": "color",
|
|
61
|
+
"$value": "{color.mono.black}"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"ico-text": {
|
|
65
|
+
"spacing-gap-horizontal": {
|
|
66
|
+
"$type": "dimension",
|
|
67
|
+
"$value": "{spacing.large}"
|
|
68
|
+
},
|
|
69
|
+
"spacing-gap-vertical": {
|
|
70
|
+
"$type": "dimension",
|
|
71
|
+
"$value": "{spacing.medium}"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"kpi-card": {
|
|
75
|
+
"color-text-label": {
|
|
76
|
+
"$type": "color",
|
|
77
|
+
"$value": "{color.grey.800}"
|
|
78
|
+
},
|
|
79
|
+
"color-text-value": {
|
|
80
|
+
"$type": "color",
|
|
81
|
+
"$value": "{color.mono.black}"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
54
84
|
"tag": {
|
|
55
85
|
"radius": {
|
|
56
86
|
"$type": "borderRadius",
|