@bloom-housing/ui-components 10.0.14 → 10.0.15
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/dist/src/text/Description.d.ts +2 -1
- package/dist/src/text/Description.js.map +1 -1
- package/dist/src/text/Description.stories.d.ts +11 -0
- package/dist/src/text/Description.stories.js +21 -0
- package/dist/src/text/Description.stories.js.map +1 -0
- package/package.json +1 -1
- package/src/text/Description.scss +34 -41
- package/src/text/Description.stories.tsx +47 -0
- package/src/text/Description.tsx +2 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import "./Description.scss";
|
|
2
3
|
import { MarkdownToJSX } from "markdown-to-jsx";
|
|
3
4
|
export interface DescriptionProps {
|
|
4
5
|
term: string;
|
|
5
|
-
description:
|
|
6
|
+
description: string | React.ReactNode;
|
|
6
7
|
dtClassName?: string;
|
|
7
8
|
markdown?: boolean;
|
|
8
9
|
markdownProps?: MarkdownToJSX.Options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../src/text/Description.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,QAA2B,MAAM,iBAAiB,CAAA;AAUzD,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,KAAuB;IACjD,IAAM,SAAS,GAAG,CAAC,mBAAmB,CAAC,CAAA;IACvC,IAAI,KAAK,CAAC,WAAW;QAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;IAExD,OAAO,CACL;QACE,4BAAI,SAAS,EAAC,oBAAoB,IAAE,KAAK,CAAC,IAAI,CAAM;QACnD,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAChB,4BAAI,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;YAChC,oBAAC,QAAQ,IACP,OAAO,aAAI,qBAAqB,EAAE,IAAI,IAAK,KAAK,CAAC,aAAa,GAC9D,QAAQ,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../src/text/Description.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,QAA2B,MAAM,iBAAiB,CAAA;AAUzD,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,KAAuB;IACjD,IAAM,SAAS,GAAG,CAAC,mBAAmB,CAAC,CAAA;IACvC,IAAI,KAAK,CAAC,WAAW;QAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;IAExD,OAAO,CACL;QACE,4BAAI,SAAS,EAAC,oBAAoB,IAAE,KAAK,CAAC,IAAI,CAAM;QACnD,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAChB,4BAAI,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;YAChC,oBAAC,QAAQ,IACP,OAAO,aAAI,qBAAqB,EAAE,IAAI,IAAK,KAAK,CAAC,aAAa,GAC9D,QAAQ,EAAE,KAAK,CAAC,WAAqB,GACrC,CACC,CACN,CAAC,CAAC,CAAC,CACF,4BAAI,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAG,KAAK,CAAC,WAAW,CAAM,CAC7D,CACA,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BADGES } from "../../.storybook/constants";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
5
|
+
parameters: {
|
|
6
|
+
badges: BADGES[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
export declare const Default: () => JSX.Element;
|
|
11
|
+
export declare const LongStrings: () => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Description } from "./Description";
|
|
3
|
+
import { BADGES } from "../../.storybook/constants";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Text/Description 🚩",
|
|
6
|
+
decorators: [function (storyFn) { return React.createElement("div", { style: { padding: "1rem" } }, storyFn()); }],
|
|
7
|
+
parameters: {
|
|
8
|
+
badges: [BADGES.GEN2],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export var Default = function () { return (React.createElement("dl", { className: "column-definition-list" },
|
|
12
|
+
React.createElement(Description, { term: "Title", description: "Description" }),
|
|
13
|
+
React.createElement(Description, { term: "Title", description: "Description" }),
|
|
14
|
+
React.createElement(Description, { term: "Title", description: "Description" }),
|
|
15
|
+
React.createElement(Description, { term: "Title", description: "This last description takes up the full width" }))); };
|
|
16
|
+
export var LongStrings = function () { return (React.createElement("dl", { className: "column-definition-list" },
|
|
17
|
+
React.createElement(Description, { term: "Natoque penatibus", description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Leo a diam sollicitudin tempor id eu. Porttitor lacus luctus accumsan tortor. Viverra mauris in aliquam sem fringilla. At augue eget arcu dictum. Penatibus et magnis dis parturient montes nascetur ridiculus mus mauris. Velit euismod in pellentesque massa placerat duis ultricies lacus sed. Aliquam vestibulum morbi blandit cursus risus. Tellus at urna condimentum mattis pellentesque id nibh. Interdum consectetur libero id faucibus." }),
|
|
18
|
+
React.createElement(Description, { term: "Sed vulputate", description: "Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Tristique senectus et netus et malesuada." }),
|
|
19
|
+
React.createElement(Description, { term: "Quam lacus suspendisse faucibus interdum", description: "Ultrices neque ornare aenean euismod elementum. Tellus elementum sagittis vitae et leo duis. In egestas erat imperdiet sed euismod nisi porta. Nisl purus in mollis nunc sed id semper risus. Ac turpis egestas sed tempus urna et pharetra pharetra. Nibh mauris cursus mattis molestie a iaculis at erat pellentesque. Ultricies mi eget mauris pharetra et ultrices. Enim facilisis gravida neque convallis a cras semper auctor. Risus pretium quam vulputate dignissim suspendisse in est ante. Cursus vitae congue mauris rhoncus aenean vel." }),
|
|
20
|
+
React.createElement(Description, { term: "Auctor", description: "Bibendum arcu vitae elementum curabitur vitae nunc sed velit dignissim." }))); };
|
|
21
|
+
//# sourceMappingURL=Description.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Description.stories.js","sourceRoot":"","sources":["../../../src/text/Description.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,eAAe;IACb,KAAK,EAAE,qBAAqB;IAC5B,UAAU,EAAE,CAAC,UAAC,OAAY,IAAK,OAAA,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,OAAO,EAAE,CAAO,EAAlD,CAAkD,CAAC;IAClF,UAAU,EAAE;QACV,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;KACtB;CACF,CAAA;AAED,MAAM,CAAC,IAAM,OAAO,GAAG,cAAM,OAAA,CAC3B,4BAAI,SAAS,EAAC,wBAAwB;IACpC,oBAAC,WAAW,IAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,GAAI;IAC1D,oBAAC,WAAW,IAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,GAAI;IAC1D,oBAAC,WAAW,IAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,GAAI;IAC1D,oBAAC,WAAW,IAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,+CAA+C,GAAI,CACzF,CACN,EAP4B,CAO5B,CAAA;AAED,MAAM,CAAC,IAAM,WAAW,GAAG,cAAM,OAAA,CAC/B,4BAAI,SAAS,EAAC,wBAAwB;IACpC,oBAAC,WAAW,IACV,IAAI,EAAE,mBAAmB,EACzB,WAAW,EACT,+iBAA+iB,GAEjjB;IACF,oBAAC,WAAW,IACV,IAAI,EAAE,eAAe,EACrB,WAAW,EACT,iHAAiH,GAEnH;IACF,oBAAC,WAAW,IACV,IAAI,EAAE,0CAA0C,EAChD,WAAW,EACT,qhBAAqhB,GAEvhB;IACF,oBAAC,WAAW,IACV,IAAI,EAAE,QAAQ,EACd,WAAW,EAAE,yEAAyE,GACtF,CACC,CACN,EAzBgC,CAyBhC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.15",
|
|
4
4
|
"author": "Sean Albert <sean.albert@exygy.com>",
|
|
5
5
|
"description": "Shared user interface components for Bloom affordable housing system",
|
|
6
6
|
"homepage": "https://github.com/bloom-housing/ui-components",
|
|
@@ -1,61 +1,54 @@
|
|
|
1
1
|
@import "../global/mixins.scss";
|
|
2
2
|
|
|
3
|
-
// Description
|
|
4
|
-
.description__title {
|
|
5
|
-
@apply font-serif;
|
|
6
|
-
@apply text-xl;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.description__body {
|
|
10
|
-
@apply mb-4;
|
|
11
|
-
|
|
12
|
-
@screen md {
|
|
13
|
-
padding-top: 0.4em;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Data lists
|
|
18
3
|
.column-definition-list {
|
|
19
4
|
@include clearfix;
|
|
20
5
|
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
--title-font-family: var(--bloom-font-serif);
|
|
7
|
+
--title-font-size-desktop: var(--bloom-font-size-xl);
|
|
8
|
+
--title-font-size-mobile: var(--bloom-font-size-lg);
|
|
9
|
+
--title-text-color: var(--bloom-color-gray-800);
|
|
10
|
+
--body-font-size: var(--bloom-font-size-sm);
|
|
11
|
+
--border-color: var(--bloom-color-gray-450);
|
|
12
|
+
--last-row-grid: span 2 / span 2;
|
|
13
|
+
|
|
14
|
+
@media (min-width: $screen-md) {
|
|
15
|
+
display: grid;
|
|
23
16
|
grid-template-columns: 1fr 1fr;
|
|
24
|
-
|
|
17
|
+
column-gap: var(--bloom-s4);
|
|
25
18
|
grid-row-gap: 0.15rem;
|
|
26
19
|
}
|
|
27
|
-
|
|
20
|
+
|
|
28
21
|
.description__title {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
font-family: var(--title-font-family);
|
|
23
|
+
font-size: var(--title-font-size-mobile);
|
|
24
|
+
color: var(--title-text-color);
|
|
25
|
+
margin-bottom: var(--bloom-s1);
|
|
32
26
|
clear: left;
|
|
33
|
-
height:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@screen
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
height: auto;
|
|
28
|
+
width: 100%;
|
|
29
|
+
|
|
30
|
+
@media (min-width: $screen-md) {
|
|
31
|
+
padding-left: var(--bloom-s4);
|
|
32
|
+
border-left: 2px solid var(--border-color);
|
|
33
|
+
float: left;
|
|
34
|
+
margin-bottom: var(--bloom-s3);
|
|
35
|
+
font-size: var(--title-font-size-desktop);
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
38
|
|
|
44
39
|
.description__body {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
font-size: var(--body-font-size);
|
|
41
|
+
margin-bottom: var(--bloom-s5);
|
|
42
|
+
width: 100%;
|
|
43
|
+
|
|
44
|
+
@media (min-width: $screen-md) {
|
|
45
|
+
margin-bottom: 0;
|
|
46
|
+
float: left;
|
|
47
|
+
padding-top: 0.4em;
|
|
48
48
|
|
|
49
|
-
@screen md {
|
|
50
|
-
@apply mb-0;
|
|
51
|
-
@apply float-left;
|
|
52
49
|
&:last-of-type {
|
|
53
|
-
|
|
50
|
+
grid-column: var(--last-row-grid);
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
|
-
|
|
57
|
-
&:last-of-type {
|
|
58
|
-
@apply w-full
|
|
59
|
-
}
|
|
60
53
|
}
|
|
61
54
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Description } from "./Description"
|
|
3
|
+
import { BADGES } from "../../.storybook/constants"
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Text/Description 🚩",
|
|
7
|
+
decorators: [(storyFn: any) => <div style={{ padding: "1rem" }}>{storyFn()}</div>],
|
|
8
|
+
parameters: {
|
|
9
|
+
badges: [BADGES.GEN2],
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Default = () => (
|
|
14
|
+
<dl className="column-definition-list">
|
|
15
|
+
<Description term={"Title"} description={"Description"} />
|
|
16
|
+
<Description term={"Title"} description={"Description"} />
|
|
17
|
+
<Description term={"Title"} description={"Description"} />
|
|
18
|
+
<Description term={"Title"} description={"This last description takes up the full width"} />
|
|
19
|
+
</dl>
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
export const LongStrings = () => (
|
|
23
|
+
<dl className="column-definition-list">
|
|
24
|
+
<Description
|
|
25
|
+
term={"Natoque penatibus"}
|
|
26
|
+
description={
|
|
27
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Leo a diam sollicitudin tempor id eu. Porttitor lacus luctus accumsan tortor. Viverra mauris in aliquam sem fringilla. At augue eget arcu dictum. Penatibus et magnis dis parturient montes nascetur ridiculus mus mauris. Velit euismod in pellentesque massa placerat duis ultricies lacus sed. Aliquam vestibulum morbi blandit cursus risus. Tellus at urna condimentum mattis pellentesque id nibh. Interdum consectetur libero id faucibus."
|
|
28
|
+
}
|
|
29
|
+
/>
|
|
30
|
+
<Description
|
|
31
|
+
term={"Sed vulputate"}
|
|
32
|
+
description={
|
|
33
|
+
"Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Tristique senectus et netus et malesuada."
|
|
34
|
+
}
|
|
35
|
+
/>
|
|
36
|
+
<Description
|
|
37
|
+
term={"Quam lacus suspendisse faucibus interdum"}
|
|
38
|
+
description={
|
|
39
|
+
"Ultrices neque ornare aenean euismod elementum. Tellus elementum sagittis vitae et leo duis. In egestas erat imperdiet sed euismod nisi porta. Nisl purus in mollis nunc sed id semper risus. Ac turpis egestas sed tempus urna et pharetra pharetra. Nibh mauris cursus mattis molestie a iaculis at erat pellentesque. Ultricies mi eget mauris pharetra et ultrices. Enim facilisis gravida neque convallis a cras semper auctor. Risus pretium quam vulputate dignissim suspendisse in est ante. Cursus vitae congue mauris rhoncus aenean vel."
|
|
40
|
+
}
|
|
41
|
+
/>
|
|
42
|
+
<Description
|
|
43
|
+
term={"Auctor"}
|
|
44
|
+
description={"Bibendum arcu vitae elementum curabitur vitae nunc sed velit dignissim."}
|
|
45
|
+
/>
|
|
46
|
+
</dl>
|
|
47
|
+
)
|
package/src/text/Description.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import Markdown, { MarkdownToJSX } from "markdown-to-jsx"
|
|
|
4
4
|
|
|
5
5
|
export interface DescriptionProps {
|
|
6
6
|
term: string
|
|
7
|
-
description:
|
|
7
|
+
description: string | React.ReactNode
|
|
8
8
|
dtClassName?: string
|
|
9
9
|
markdown?: boolean
|
|
10
10
|
markdownProps?: MarkdownToJSX.Options
|
|
@@ -21,7 +21,7 @@ export const Description = (props: DescriptionProps) => {
|
|
|
21
21
|
<dd className={dtClasses.join(" ")}>
|
|
22
22
|
<Markdown
|
|
23
23
|
options={{ disableParsingRawHTML: true, ...props.markdownProps }}
|
|
24
|
-
children={props.description}
|
|
24
|
+
children={props.description as string}
|
|
25
25
|
/>
|
|
26
26
|
</dd>
|
|
27
27
|
) : (
|