@octaviaflow/mdx-components 1.1.3
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/README.md +215 -0
- package/components/_utils.scss +18 -0
- package/components/accordion/_accordion.scss +35 -0
- package/components/accordion/accordion.stories.jsx +33 -0
- package/components/accordion/accordion.tsx +55 -0
- package/components/anchor-links/_anchor-links.scss +67 -0
- package/components/anchor-links/anchor-link.tsx +50 -0
- package/components/anchor-links/anchor-links.stories.jsx +51 -0
- package/components/anchor-links/anchor-links.tsx +73 -0
- package/components/art-direction/art-direction.stories.jsx +44 -0
- package/components/art-direction/art-direction.tsx +63 -0
- package/components/art-direction/desktop.jpg +0 -0
- package/components/art-direction/mobile.jpg +0 -0
- package/components/art-direction/tablet.jpg +0 -0
- package/components/article-card/_article-card.scss +98 -0
- package/components/article-card/article-card.stories.jsx +59 -0
- package/components/article-card/article-card.tsx +208 -0
- package/components/article-card/article06.png +0 -0
- package/components/aside/_aside.scss +56 -0
- package/components/aside/aside.stories.jsx +50 -0
- package/components/aside/aside.tsx +72 -0
- package/components/caption/_caption.scss +30 -0
- package/components/caption/caption.stories.jsx +33 -0
- package/components/caption/caption.tsx +47 -0
- package/components/card-group/_card-group.scss +44 -0
- package/components/card-group/card-group.stories.jsx +85 -0
- package/components/card-group/card-group.tsx +65 -0
- package/components/card-group/sketch-icon.png +0 -0
- package/components/code/_code.scss +110 -0
- package/components/code/code.stories.jsx +32 -0
- package/components/code/code.tsx +71 -0
- package/components/code/inline-code.tsx +55 -0
- package/components/code/path.tsx +56 -0
- package/components/divider/_divider.scss +67 -0
- package/components/divider/divider.stories.jsx +74 -0
- package/components/divider/divider.tsx +54 -0
- package/components/do-dont/_do-dont.scss +191 -0
- package/components/do-dont/do-dont-row.tsx +51 -0
- package/components/do-dont/do-dont.stories.jsx +53 -0
- package/components/do-dont/do-dont.tsx +161 -0
- package/components/do-dont/light-theme.jpg +0 -0
- package/components/gif-player/_gif-player.scss +64 -0
- package/components/gif-player/cloud.gif +0 -0
- package/components/gif-player/cloud.jpg +0 -0
- package/components/gif-player/gif-player.stories.jsx +45 -0
- package/components/gif-player/gif-player.tsx +150 -0
- package/components/grid-transform/_grid.scss +13 -0
- package/components/grid-transform/column.tsx +102 -0
- package/components/grid-transform/grid.stories.jsx +72 -0
- package/components/grid-transform/grid.tsx +52 -0
- package/components/grid-transform/row.tsx +92 -0
- package/components/image-wrapper/_image-wrapper.scss +32 -0
- package/components/image-wrapper/accordion-style-3.png +0 -0
- package/components/image-wrapper/image-wrapper.stories.jsx +40 -0
- package/components/image-wrapper/image-wrapper.tsx +56 -0
- package/components/index.scss +31 -0
- package/components/inline-notification/_inline-notification.scss +29 -0
- package/components/inline-notification/inline-notification.stories.jsx +67 -0
- package/components/inline-notification/inline-notification.tsx +98 -0
- package/components/interfaces.ts +31 -0
- package/components/link/_link.scss +13 -0
- package/components/link/link.stories.jsx +36 -0
- package/components/link/link.tsx +51 -0
- package/components/markdown/_markdown.scss +140 -0
- package/components/markdown/autolink-header/_autolink-header.scss +57 -0
- package/components/markdown/autolink-header/autolink-header.tsx +107 -0
- package/components/markdown/blockquote.stories.jsx +38 -0
- package/components/markdown/blockquote.tsx +53 -0
- package/components/markdown/h1.tsx +92 -0
- package/components/markdown/h2.tsx +85 -0
- package/components/markdown/h3.tsx +72 -0
- package/components/markdown/h4.tsx +73 -0
- package/components/markdown/h5.tsx +59 -0
- package/components/markdown/h6.tsx +59 -0
- package/components/markdown/headings.stories.jsx +52 -0
- package/components/markdown/li.tsx +55 -0
- package/components/markdown/ol.stories.jsx +47 -0
- package/components/markdown/ol.tsx +93 -0
- package/components/markdown/p.stories.jsx +36 -0
- package/components/markdown/p.tsx +65 -0
- package/components/markdown/ul.stories.jsx +46 -0
- package/components/markdown/ul.tsx +93 -0
- package/components/mini-card/_mini-card.scss +55 -0
- package/components/mini-card/mini-card.stories.jsx +72 -0
- package/components/mini-card/mini-card.tsx +132 -0
- package/components/page-description/_page-description.scss +38 -0
- package/components/page-description/page-description.stories.jsx +36 -0
- package/components/page-description/page-description.tsx +61 -0
- package/components/page-table/_page-table.scss +51 -0
- package/components/page-table/page-table.stories.jsx +56 -0
- package/components/page-table/page-table.tsx +88 -0
- package/components/preview/_preview.scss +16 -0
- package/components/preview/preview.stories.jsx +41 -0
- package/components/preview/preview.tsx +80 -0
- package/components/resource-card/_resource-card.scss +165 -0
- package/components/resource-card/resource-card.stories.jsx +100 -0
- package/components/resource-card/resource-card.tsx +201 -0
- package/components/storybook-demo/_storybook-demo.scss +57 -0
- package/components/storybook-demo/storybook-demo.stories.jsx +70 -0
- package/components/storybook-demo/storybook-demo.tsx +190 -0
- package/components/tabs/_tabs.scss +98 -0
- package/components/tabs/select.tsx +60 -0
- package/components/tabs/tab-list.tsx +48 -0
- package/components/tabs/tab.tsx +125 -0
- package/components/tabs/tabs.stories.jsx +54 -0
- package/components/tabs/tabs.tsx +78 -0
- package/components/title/title.stories.jsx +43 -0
- package/components/title/title.tsx +47 -0
- package/components/utils.ts +102 -0
- package/components/video/_video.scss +89 -0
- package/components/video/local-poster.jpeg +0 -0
- package/components/video/local-video.mp4 +0 -0
- package/components/video/video.stories.jsx +45 -0
- package/components/video/video.tsx +255 -0
- package/es/index.js +71714 -0
- package/index.ts +59 -0
- package/lib/index.js +71767 -0
- package/package.json +64 -0
- package/telemetry.yml +21 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright IBM Corp. 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React from "react";
|
|
18
|
+
import { P } from "./p";
|
|
19
|
+
|
|
20
|
+
const stories = {
|
|
21
|
+
title: "Components/MDX Components/Markdown/P",
|
|
22
|
+
component: P,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default stories;
|
|
26
|
+
|
|
27
|
+
const Template = (args) => (
|
|
28
|
+
<P {...args}>
|
|
29
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean feugiat ex
|
|
30
|
+
massa, in tincidunt ipsum tempor in. Maecenas ultrices sem nec blandit
|
|
31
|
+
dictum. Fermentum ullamcorper pretium. Duis turpis elit.
|
|
32
|
+
</P>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export const Default = Template.bind({});
|
|
36
|
+
Default.args = {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright OctaviaFlow 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
import { Column, Grid } from "@octaviaflow/react";
|
|
17
|
+
import { clsx } from "clsx";
|
|
18
|
+
import PropTypes from "prop-types";
|
|
19
|
+
import React, { ReactNode } from "react";
|
|
20
|
+
|
|
21
|
+
import { MdxComponent } from "../interfaces";
|
|
22
|
+
import { withPrefix } from "../utils";
|
|
23
|
+
|
|
24
|
+
interface ParagraphProps {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
className?: string | null;
|
|
27
|
+
large?: boolean | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const P: MdxComponent<ParagraphProps> = ({
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
large,
|
|
34
|
+
...rest
|
|
35
|
+
}) => {
|
|
36
|
+
const classNames = clsx(withPrefix("paragraph"), {
|
|
37
|
+
[withPrefix("paragraph--large")]: large,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Grid
|
|
42
|
+
className={clsx(className, withPrefix("paragraph-container"))}
|
|
43
|
+
{...rest}
|
|
44
|
+
>
|
|
45
|
+
<Column sm={4} md={8} lg={8}>
|
|
46
|
+
<p className={classNames}>{children}</p>
|
|
47
|
+
</Column>
|
|
48
|
+
</Grid>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
P.propTypes = {
|
|
53
|
+
/**
|
|
54
|
+
* `Paragraph text.
|
|
55
|
+
*/
|
|
56
|
+
children: PropTypes.node as unknown as React.Validator<React.ReactNode>,
|
|
57
|
+
/**
|
|
58
|
+
* Optional class name on the wrapper grid.
|
|
59
|
+
*/
|
|
60
|
+
className: PropTypes.string,
|
|
61
|
+
/**
|
|
62
|
+
* Display large font size.
|
|
63
|
+
*/
|
|
64
|
+
large: PropTypes.bool,
|
|
65
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright IBM Corp. 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
import React from "react";
|
|
17
|
+
import { LI } from "./li";
|
|
18
|
+
import { UL } from "./ul";
|
|
19
|
+
|
|
20
|
+
const stories = {
|
|
21
|
+
title: "Components/MDX Components/Markdown/UL",
|
|
22
|
+
component: UL,
|
|
23
|
+
argTypes: {
|
|
24
|
+
children: {
|
|
25
|
+
control: false,
|
|
26
|
+
},
|
|
27
|
+
className: {
|
|
28
|
+
control: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default stories;
|
|
34
|
+
|
|
35
|
+
const Template = (args) => (
|
|
36
|
+
<div style={{ paddingLeft: "1rem" }}>
|
|
37
|
+
<UL {...args}>
|
|
38
|
+
<LI>list item 1</LI>
|
|
39
|
+
<LI>list item 2</LI>
|
|
40
|
+
<LI>list item 3</LI>
|
|
41
|
+
</UL>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export const Default = Template.bind({});
|
|
46
|
+
Default.args = {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright OctaviaFlow 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
import { Column, Grid, UnorderedList } from "@octaviaflow/react";
|
|
17
|
+
import { clsx } from "clsx";
|
|
18
|
+
import PropTypes from "prop-types";
|
|
19
|
+
import React, { ReactElement } from "react";
|
|
20
|
+
|
|
21
|
+
import { MdxComponent } from "../interfaces";
|
|
22
|
+
import { withPrefix } from "../utils";
|
|
23
|
+
import { LiConsumer } from "./li";
|
|
24
|
+
|
|
25
|
+
interface UlProps {
|
|
26
|
+
children: ReactElement | ReactElement[]; // This is how the types would be in TypeScript
|
|
27
|
+
className?: string | null;
|
|
28
|
+
[otherProp: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* For MDX files, steer away from using JSX components
|
|
33
|
+
* for lists in favor of standard markdown syntax.
|
|
34
|
+
*
|
|
35
|
+
*```
|
|
36
|
+
* - Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
37
|
+
* - dolore magna aliqua. Pharetra massa massa ultricies mi quis.
|
|
38
|
+
* - Massa eget egestas purus viverra accumsan in nisl nisi.
|
|
39
|
+
* - Dolor sit amet consectetur adipiscing.
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export const UL: MdxComponent<UlProps> = ({ children, className, ...rest }) => {
|
|
43
|
+
return (
|
|
44
|
+
<LiConsumer>
|
|
45
|
+
{(value) => {
|
|
46
|
+
if (value.hasListItemParent) {
|
|
47
|
+
return (
|
|
48
|
+
<UnorderedList
|
|
49
|
+
isExpressive
|
|
50
|
+
className={clsx(className, withPrefix("list"), withPrefix("ul"))}
|
|
51
|
+
nested
|
|
52
|
+
{...rest}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</UnorderedList>
|
|
56
|
+
);
|
|
57
|
+
} else {
|
|
58
|
+
return (
|
|
59
|
+
<Grid className={withPrefix("list-container")}>
|
|
60
|
+
<Column sm={4} md={8} lg={8}>
|
|
61
|
+
<UnorderedList
|
|
62
|
+
isExpressive
|
|
63
|
+
className={clsx(
|
|
64
|
+
className,
|
|
65
|
+
withPrefix("list"),
|
|
66
|
+
withPrefix("ul"),
|
|
67
|
+
)}
|
|
68
|
+
{...rest}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</UnorderedList>
|
|
72
|
+
</Column>
|
|
73
|
+
</Grid>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}}
|
|
77
|
+
</LiConsumer>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
UL.propTypes = {
|
|
82
|
+
/**
|
|
83
|
+
* Child LI elements
|
|
84
|
+
*/
|
|
85
|
+
children: PropTypes.oneOfType([
|
|
86
|
+
PropTypes.arrayOf(PropTypes.element.isRequired).isRequired,
|
|
87
|
+
PropTypes.element.isRequired,
|
|
88
|
+
]).isRequired,
|
|
89
|
+
/**
|
|
90
|
+
* Specify optional className for container element
|
|
91
|
+
*/
|
|
92
|
+
className: PropTypes.string,
|
|
93
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright OctaviaFlow 2022, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@use '@carbon/react/scss/spacing' as spacing;
|
|
9
|
+
@use '@carbon/react/scss/type' as type;
|
|
10
|
+
@use '@carbon/react/scss/theme' as theme;
|
|
11
|
+
@use '@carbon/react/scss/utilities/convert' as convert;
|
|
12
|
+
@use '@carbon/react/scss/motion' as motion;
|
|
13
|
+
|
|
14
|
+
@use '../utils' as *;
|
|
15
|
+
|
|
16
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
17
|
+
.#{with-prefix('mini-card')} {
|
|
18
|
+
transition: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.#{with-prefix('mini-card')} {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
background: theme.$layer-01;
|
|
27
|
+
block-size: convert.rem(64px);
|
|
28
|
+
transition: background motion.$duration-fast-02;
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
background: theme.$background-hover;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.#{with-prefix('wrapper')} {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
padding-inline: spacing.$spacing-05 spacing.$spacing-05;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.#{with-prefix('title')} {
|
|
42
|
+
@include type.type-style('body-short-01');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.#{with-prefix('image')},
|
|
46
|
+
.#{with-prefix('image')} [class*='mdx-icon'],
|
|
47
|
+
.#{with-prefix('image')} [class*='mdx-icon'] svg {
|
|
48
|
+
block-size: convert.rem(20px);
|
|
49
|
+
inline-size: convert.rem(20px);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.#{with-prefix('icon')} {
|
|
53
|
+
padding-block-start: spacing.$spacing-02;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright IBM Corp. 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
import React from "react";
|
|
17
|
+
import { CardGroup } from "../card-group/card-group";
|
|
18
|
+
import { MiniCard } from "./mini-card";
|
|
19
|
+
|
|
20
|
+
// TODO: add MdxIcon when migrated
|
|
21
|
+
// import MdxIcon from '@/components/mdx-icon'
|
|
22
|
+
|
|
23
|
+
const stories = {
|
|
24
|
+
title: "Components/MDX Components/Cards/MiniCard",
|
|
25
|
+
component: MiniCard,
|
|
26
|
+
parameters: {},
|
|
27
|
+
argTypes: {
|
|
28
|
+
children: {
|
|
29
|
+
control: false,
|
|
30
|
+
},
|
|
31
|
+
href: {
|
|
32
|
+
control: false,
|
|
33
|
+
},
|
|
34
|
+
actionIcon: {
|
|
35
|
+
control: false,
|
|
36
|
+
},
|
|
37
|
+
className: {
|
|
38
|
+
control: false,
|
|
39
|
+
},
|
|
40
|
+
linkProps: {
|
|
41
|
+
control: false,
|
|
42
|
+
},
|
|
43
|
+
title: {
|
|
44
|
+
control: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default stories;
|
|
50
|
+
|
|
51
|
+
const Template = (args) => (
|
|
52
|
+
<CardGroup {...args}>
|
|
53
|
+
<MiniCard
|
|
54
|
+
title="Tree view component"
|
|
55
|
+
href="https://carbon-website-git-fork-designertyler-treeview03092020.carbon-design-system.now.sh/components/tree-view/usage"
|
|
56
|
+
actionIcon="arrowRight"
|
|
57
|
+
/>
|
|
58
|
+
<MiniCard title="Angular tutorial" href="">
|
|
59
|
+
{/* <MdxIcon name="angular" /> */}
|
|
60
|
+
</MiniCard>
|
|
61
|
+
<MiniCard
|
|
62
|
+
title="Tree view component"
|
|
63
|
+
href="https://carbon-website-git-fork-designertyler-treeview03092020.carbon-design-system.now.sh/components/tree-view/usage"
|
|
64
|
+
actionIcon="launch"
|
|
65
|
+
/>
|
|
66
|
+
<MiniCard title="React tutorial" href="">
|
|
67
|
+
{/* <MdxIcon name="react" /> */}
|
|
68
|
+
</MiniCard>
|
|
69
|
+
</CardGroup>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
export const Default = Template.bind({});
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright OctaviaFlow 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
import { Column } from "@octaviaflow/react";
|
|
17
|
+
import {
|
|
18
|
+
ArrowRight,
|
|
19
|
+
Calendar,
|
|
20
|
+
Download,
|
|
21
|
+
Email,
|
|
22
|
+
Launch,
|
|
23
|
+
} from "@octaviaflow/icons-react";
|
|
24
|
+
import { clsx } from "clsx";
|
|
25
|
+
import PropTypes from "prop-types";
|
|
26
|
+
import React, { ReactNode } from "react";
|
|
27
|
+
|
|
28
|
+
import { MdxComponent } from "../interfaces";
|
|
29
|
+
import { withPrefix } from "../utils";
|
|
30
|
+
|
|
31
|
+
type ActionIcon = "arrowRight" | "download" | "email" | "calendar" | "launch";
|
|
32
|
+
|
|
33
|
+
interface MiniCardProps {
|
|
34
|
+
children?: ReactNode | null;
|
|
35
|
+
href?: string | null;
|
|
36
|
+
title: string | null;
|
|
37
|
+
actionIcon?: ActionIcon | null;
|
|
38
|
+
linkProps?: object | null;
|
|
39
|
+
className?: string | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const getIcon = ({ actionIcon }: { actionIcon: ActionIcon }) => {
|
|
43
|
+
switch (actionIcon) {
|
|
44
|
+
case "arrowRight":
|
|
45
|
+
return <ArrowRight size={20} aria-label="Open resource" />;
|
|
46
|
+
case "download":
|
|
47
|
+
return <Download size={20} aria-label="Download" />;
|
|
48
|
+
case "email":
|
|
49
|
+
return <Email size={20} aria-label="Email" />;
|
|
50
|
+
case "calendar":
|
|
51
|
+
return <Calendar size={20} aria-label="Calendar" />;
|
|
52
|
+
default:
|
|
53
|
+
return <Launch size={20} aria-label="Open resource" />;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
*The `<MiniCard>` component can be used in place of a `<ResourceCard>` if your content
|
|
59
|
+
allows it. Unless it is sitting beside your main content, it should always be wrapped
|
|
60
|
+
inside of a `<CardGroup>`. This allows the correct gutter and border placement between
|
|
61
|
+
a group of cards
|
|
62
|
+
*
|
|
63
|
+
Although the mini-resource card has a similar geometry to the button component, they
|
|
64
|
+
should not be used in place of a button. Buttons encourage action from the user and
|
|
65
|
+
affect the website's front-end or back-end. The resource cards, both large and mini
|
|
66
|
+
are essentially links. They are used for navigation and actions that do not affect
|
|
67
|
+
the website.
|
|
68
|
+
**/
|
|
69
|
+
export const MiniCard: MdxComponent<MiniCardProps> = ({
|
|
70
|
+
children,
|
|
71
|
+
href,
|
|
72
|
+
title,
|
|
73
|
+
actionIcon,
|
|
74
|
+
className,
|
|
75
|
+
linkProps,
|
|
76
|
+
...rest
|
|
77
|
+
}) => {
|
|
78
|
+
const cardContent = (
|
|
79
|
+
<div className={clsx(className, withPrefix("mini-card"))}>
|
|
80
|
+
<div className={withPrefix("wrapper")}>
|
|
81
|
+
<div className={withPrefix("title")}>{title}</div>
|
|
82
|
+
{children === undefined && actionIcon && (
|
|
83
|
+
<div className={withPrefix("icon")}>{getIcon({ actionIcon })}</div>
|
|
84
|
+
)}
|
|
85
|
+
{children !== undefined && (
|
|
86
|
+
<div className={withPrefix("image")}>{children}</div>
|
|
87
|
+
)}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<Column md={4} lg={4} sm={4} {...rest}>
|
|
94
|
+
<a href={href!} className={"ods--tile--clickable"} {...linkProps}>
|
|
95
|
+
{cardContent}
|
|
96
|
+
</a>
|
|
97
|
+
</Column>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
MiniCard.propTypes = {
|
|
102
|
+
/**
|
|
103
|
+
* Action icon to render.
|
|
104
|
+
*/
|
|
105
|
+
actionIcon: PropTypes.oneOf<ActionIcon>([
|
|
106
|
+
"arrowRight",
|
|
107
|
+
"download",
|
|
108
|
+
"email",
|
|
109
|
+
"calendar",
|
|
110
|
+
"launch",
|
|
111
|
+
]),
|
|
112
|
+
/**
|
|
113
|
+
* Use 32x32 image as child, will display in right-hand corner of the card
|
|
114
|
+
*/
|
|
115
|
+
children: PropTypes.element,
|
|
116
|
+
/**
|
|
117
|
+
* Optional container class name.
|
|
118
|
+
*/
|
|
119
|
+
className: PropTypes.string,
|
|
120
|
+
/**
|
|
121
|
+
* url to link to on click
|
|
122
|
+
*/
|
|
123
|
+
href: PropTypes.string,
|
|
124
|
+
/**
|
|
125
|
+
* Props to pass onto Link component.
|
|
126
|
+
*/
|
|
127
|
+
linkProps: PropTypes.object,
|
|
128
|
+
/**
|
|
129
|
+
* Provide the title of your `Card`.
|
|
130
|
+
*/
|
|
131
|
+
title: PropTypes.string.isRequired,
|
|
132
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright OctaviaFlow 2022, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@use '@carbon/react/scss/spacing' as spacing;
|
|
9
|
+
@use '@carbon/react/scss/type' as type;
|
|
10
|
+
@use '@carbon/react/scss/theme' as theme;
|
|
11
|
+
|
|
12
|
+
@use '../utils' as *;
|
|
13
|
+
|
|
14
|
+
.#{with-prefix('page-description')} {
|
|
15
|
+
color: theme.$text-primary;
|
|
16
|
+
margin-block-start: spacing.$spacing-07;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.#{with-prefix('page-description')},
|
|
20
|
+
.#{with-prefix('page-description')} p,
|
|
21
|
+
.#{with-prefix('page-description')} .ods--link {
|
|
22
|
+
@include type.type-style('fluid-heading-03', true);
|
|
23
|
+
|
|
24
|
+
display: inline;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.#{with-prefix('page-description')} > * {
|
|
28
|
+
margin-block-start: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.#{with-prefix('page-description')} > * + * {
|
|
32
|
+
margin-block-start: spacing.$spacing-06;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.#{with-prefix('page-description')} code {
|
|
36
|
+
font-size: 1.125rem;
|
|
37
|
+
line-height: 1.25;
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright IBM Corp. 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React from "react";
|
|
18
|
+
import { PageDescription } from "./page-description";
|
|
19
|
+
|
|
20
|
+
const stories = {
|
|
21
|
+
title: "Components/MDX Components/PageDescription",
|
|
22
|
+
component: PageDescription,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default stories;
|
|
26
|
+
|
|
27
|
+
const Template = (args) => (
|
|
28
|
+
<PageDescription {...args}>
|
|
29
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean feugiat ex
|
|
30
|
+
massa, in tincidunt ipsum tempor in. Maecenas ultrices sem nec blandit
|
|
31
|
+
dictum. Fermentum ullamcorper pretium. Duis turpis elit.
|
|
32
|
+
</PageDescription>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export const Default = Template.bind({});
|
|
36
|
+
Default.args = {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright OctaviaFlow 2022, 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Column, Grid } from "@octaviaflow/react";
|
|
18
|
+
import { clsx } from "clsx";
|
|
19
|
+
import PropTypes from "prop-types";
|
|
20
|
+
import React, { ReactNode } from "react";
|
|
21
|
+
|
|
22
|
+
import { MdxComponent } from "../interfaces";
|
|
23
|
+
import { withPrefix } from "../utils";
|
|
24
|
+
|
|
25
|
+
interface PageDescriptionProps {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
className?: string | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The `<PageDescription>` component is generally used for intro text at the top
|
|
32
|
+
* of the page using the type token `fluid-heading-03`.
|
|
33
|
+
*/
|
|
34
|
+
export const PageDescription: MdxComponent<PageDescriptionProps> = ({
|
|
35
|
+
children,
|
|
36
|
+
className,
|
|
37
|
+
...rest
|
|
38
|
+
}) => (
|
|
39
|
+
<Grid>
|
|
40
|
+
<Column
|
|
41
|
+
sm={4}
|
|
42
|
+
md={8}
|
|
43
|
+
lg={8}
|
|
44
|
+
className={clsx(withPrefix("page-description"), className)}
|
|
45
|
+
{...rest}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</Column>
|
|
49
|
+
</Grid>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
PageDescription.propTypes = {
|
|
53
|
+
/**
|
|
54
|
+
* Provide the contents of PageDescription
|
|
55
|
+
*/
|
|
56
|
+
children: PropTypes.node as unknown as React.Validator<React.ReactNode>,
|
|
57
|
+
/**
|
|
58
|
+
* Optional class name.
|
|
59
|
+
*/
|
|
60
|
+
className: PropTypes.string,
|
|
61
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright OctaviaFlow 2022, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@use '@carbon/react/scss/breakpoint' as breakpoint;
|
|
9
|
+
@use '@carbon/react/scss/spacing' as spacing;
|
|
10
|
+
@use '@carbon/react/scss/theme' as theme;
|
|
11
|
+
@use '@carbon/react/scss/type' as type;
|
|
12
|
+
|
|
13
|
+
@use '../utils' as *;
|
|
14
|
+
|
|
15
|
+
.#{with-prefix('page-table-container')} {
|
|
16
|
+
margin-block-start: spacing.$spacing-06;
|
|
17
|
+
overflow-x: auto;
|
|
18
|
+
|
|
19
|
+
.#{with-prefix('page-table')} {
|
|
20
|
+
inline-size: 100%;
|
|
21
|
+
|
|
22
|
+
thead th {
|
|
23
|
+
@include type.type-style('heading-01');
|
|
24
|
+
|
|
25
|
+
padding: spacing.$spacing-05;
|
|
26
|
+
background: theme.$layer-01;
|
|
27
|
+
text-align: start;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
tbody tr {
|
|
32
|
+
border-block-end: 1px solid theme.$border-subtle;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
tbody tr td {
|
|
36
|
+
@include type.type-style('body-compact-01');
|
|
37
|
+
|
|
38
|
+
padding: spacing.$spacing-05;
|
|
39
|
+
|
|
40
|
+
/* stylelint-disable max-nesting-depth */
|
|
41
|
+
@include breakpoint.breakpoint('lg') {
|
|
42
|
+
min-inline-size: 6.25rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@include breakpoint.breakpoint('xlg') {
|
|
46
|
+
min-inline-size: 9.375rem;
|
|
47
|
+
}
|
|
48
|
+
/* stylelint-enable max-nesting-depth */
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|