@arc-ui/community-components 0.1.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/.turbo/turbo-build.log +16 -0
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/dist/Accordion/Accordion.cjs.js +31 -0
- package/dist/Accordion/Accordion.esm.js +29 -0
- package/dist/Author/Author.cjs.js +14 -0
- package/dist/Author/Author.esm.js +8 -0
- package/dist/Author/styles.css +1 -0
- package/dist/BannerWithTabs/BannerWithTabs.cjs.js +36 -0
- package/dist/BannerWithTabs/BannerWithTabs.esm.js +34 -0
- package/dist/BannerWithTabs/styles.css +1 -0
- package/dist/CopyLead/CopyLead.cjs.js +129 -0
- package/dist/CopyLead/CopyLead.esm.js +127 -0
- package/dist/CopyLead/styles.css +1 -0
- package/dist/DownloadList/DownloadList.cjs.js +26 -0
- package/dist/DownloadList/DownloadList.esm.js +24 -0
- package/dist/DownloadList/styles.css +1 -0
- package/dist/FeaturePost/FeaturePost.cjs.js +2281 -0
- package/dist/FeaturePost/FeaturePost.esm.js +2279 -0
- package/dist/FeaturePost/styles.css +1 -0
- package/dist/Highlights/Highlights.cjs.js +50 -0
- package/dist/Highlights/Highlights.esm.js +48 -0
- package/dist/Highlights/styles.css +1 -0
- package/dist/PromoListing/PromoListing.cjs.js +50 -0
- package/dist/PromoListing/PromoListing.esm.js +48 -0
- package/dist/PromoListing/styles.css +1 -0
- package/dist/Quote/Quote.cjs.js +27 -0
- package/dist/Quote/Quote.esm.js +25 -0
- package/dist/Quote/styles.css +1 -0
- package/dist/SectionHeading/SectionHeading.cjs.js +14 -0
- package/dist/SectionHeading/SectionHeading.esm.js +8 -0
- package/dist/SectionHeading/styles.css +1 -0
- package/dist/Statistics/Statistics.cjs.js +60 -0
- package/dist/Statistics/Statistics.esm.js +58 -0
- package/dist/Statistics/styles.css +1 -0
- package/dist/Summary/Summary.cjs.js +30 -0
- package/dist/Summary/Summary.esm.js +28 -0
- package/dist/Summary/styles.css +1 -0
- package/dist/_shared/cjs/Author-CAo-qryZ.js +30 -0
- package/dist/_shared/cjs/SectionHeading-L2EpTQ79.js +25 -0
- package/dist/_shared/cjs/filter-data-attrs-ajtUvDAC.js +15 -0
- package/dist/_shared/cjs/index-Bp6Dd2i1.js +94 -0
- package/dist/_shared/cjs/index.es-X428Cm3N.js +15 -0
- package/dist/_shared/cjs/tslib.es6-DBA0GFPJ.js +48 -0
- package/dist/_shared/esm/Author-Bx-cE9Pz.js +28 -0
- package/dist/_shared/esm/SectionHeading-C70XNhqJ.js +23 -0
- package/dist/_shared/esm/filter-data-attrs-V7cbJuwS.js +13 -0
- package/dist/_shared/esm/index-BfTCfPZ1.js +92 -0
- package/dist/_shared/esm/index.es-BzmvPxje.js +10 -0
- package/dist/_shared/esm/tslib.es6-Cv15O4Nx.js +46 -0
- package/dist/index.es.js +2796 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +2808 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types/components/Accordion/Accordion.d.ts +9 -0
- package/dist/types/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.d.ts +9 -0
- package/dist/types/components/Accordion/index.d.ts +1 -0
- package/dist/types/components/Author/Author.d.ts +17 -0
- package/dist/types/components/Author/index.d.ts +1 -0
- package/dist/types/components/BannerWithTabs/BannerWithTabs.d.ts +17 -0
- package/dist/types/components/BannerWithTabs/index.d.ts +1 -0
- package/dist/types/components/CopyLead/CopyLead.d.ts +42 -0
- package/dist/types/components/CopyLead/components/Button/Button.d.ts +3 -0
- package/dist/types/components/CopyLead/components/Button/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/Column/Column.d.ts +6 -0
- package/dist/types/components/CopyLead/components/Column/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/Container/Container.d.ts +9 -0
- package/dist/types/components/CopyLead/components/Container/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/IconList/IconList.d.ts +8 -0
- package/dist/types/components/CopyLead/components/IconList/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/Image/Image.d.ts +3 -0
- package/dist/types/components/CopyLead/components/Image/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/MediaContent/MediaContent.d.ts +9 -0
- package/dist/types/components/CopyLead/components/MediaContent/index.d.ts +1 -0
- package/dist/types/components/CopyLead/index.d.ts +1 -0
- package/dist/types/components/CopyLead/templates/Content/Content.d.ts +10 -0
- package/dist/types/components/CopyLead/templates/Content/index.d.ts +1 -0
- package/dist/types/components/CopyLead/templates/Media/Media.d.ts +16 -0
- package/dist/types/components/CopyLead/templates/Media/index.d.ts +1 -0
- package/dist/types/components/CopyLead/types/copy-lead-button.d.ts +2 -0
- package/dist/types/components/CopyLead/types/copy-lead-image.d.ts +4 -0
- package/dist/types/components/CopyLead/types/copy-lead-list-item.d.ts +6 -0
- package/dist/types/components/CopyLead/types/copy-lead-transcript-link.d.ts +6 -0
- package/dist/types/components/CopyLead/types/index.d.ts +4 -0
- package/dist/types/components/DownloadList/DownloadList.d.ts +10 -0
- package/dist/types/components/DownloadList/index.d.ts +1 -0
- package/dist/types/components/FeaturePost/FeaturePost.d.ts +45 -0
- package/dist/types/components/FeaturePost/components/Image/Image.d.ts +3 -0
- package/dist/types/components/FeaturePost/components/Image/index.d.ts +1 -0
- package/dist/types/components/FeaturePost/components/MediaContent/MediaContent.d.ts +15 -0
- package/dist/types/components/FeaturePost/index.d.ts +1 -0
- package/dist/types/components/FeaturePost/types/feature-post-app-button-footer.d.ts +6 -0
- package/dist/types/components/FeaturePost/types/feature-post-cta-footer.d.ts +7 -0
- package/dist/types/components/FeaturePost/types/feature-post-image.d.ts +4 -0
- package/dist/types/components/FeaturePost/types/index.d.ts +3 -0
- package/dist/types/components/Highlights/Highlights.d.ts +17 -0
- package/dist/types/components/Highlights/components/HighlightItem/HighlightItem.d.ts +14 -0
- package/dist/types/components/Highlights/components/HighlightList/HighlightList.d.ts +9 -0
- package/dist/types/components/Highlights/index.d.ts +1 -0
- package/dist/types/components/Highlights/types/highlight-list-item.d.ts +10 -0
- package/dist/types/components/Highlights/types/index.d.ts +1 -0
- package/dist/types/components/PromoListing/PromoListing.d.ts +38 -0
- package/dist/types/components/PromoListing/index.d.ts +1 -0
- package/dist/types/components/Quote/Quote.d.ts +11 -0
- package/dist/types/components/Quote/index.d.ts +1 -0
- package/dist/types/components/SectionHeading/SectionHeading.d.ts +25 -0
- package/dist/types/components/SectionHeading/index.d.ts +1 -0
- package/dist/types/components/Statistics/Statistics.d.ts +7 -0
- package/dist/types/components/Statistics/helpers/get-link-props.d.ts +2 -0
- package/dist/types/components/Statistics/index.d.ts +1 -0
- package/dist/types/components/Statistics/types/statistic-link.d.ts +6 -0
- package/dist/types/components/Statistics/types/statistic.d.ts +8 -0
- package/dist/types/components/Summary/Summary.d.ts +18 -0
- package/dist/types/components/Summary/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +11 -0
- package/dist/types/index.d.ts +1 -0
- package/eslint.config.js +4 -0
- package/package.json +105 -0
- package/postcss.config.cjs +5 -0
- package/rollup.config.js +101 -0
- package/src/components/Accordion/Accordion.tsx +38 -0
- package/src/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.tsx +44 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/Author/Author.module.css +9 -0
- package/src/components/Author/Author.tsx +60 -0
- package/src/components/Author/index.ts +1 -0
- package/src/components/BannerWithTabs/BannerWithTabs.module.css +19 -0
- package/src/components/BannerWithTabs/BannerWithTabs.tsx +74 -0
- package/src/components/BannerWithTabs/index.ts +1 -0
- package/src/components/CopyLead/CopyLead.module.css +127 -0
- package/src/components/CopyLead/CopyLead.tsx +102 -0
- package/src/components/CopyLead/components/Button/Button.tsx +13 -0
- package/src/components/CopyLead/components/Button/index.ts +1 -0
- package/src/components/CopyLead/components/Column/Column.tsx +10 -0
- package/src/components/CopyLead/components/Column/index.ts +1 -0
- package/src/components/CopyLead/components/Container/Container.tsx +32 -0
- package/src/components/CopyLead/components/Container/index.ts +1 -0
- package/src/components/CopyLead/components/IconList/IconList.tsx +49 -0
- package/src/components/CopyLead/components/IconList/index.ts +1 -0
- package/src/components/CopyLead/components/Image/Image.tsx +17 -0
- package/src/components/CopyLead/components/Image/index.ts +1 -0
- package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +36 -0
- package/src/components/CopyLead/components/MediaContent/index.ts +1 -0
- package/src/components/CopyLead/index.ts +1 -0
- package/src/components/CopyLead/templates/Content/Content.tsx +58 -0
- package/src/components/CopyLead/templates/Content/index.ts +1 -0
- package/src/components/CopyLead/templates/Media/Media.tsx +104 -0
- package/src/components/CopyLead/templates/Media/index.ts +1 -0
- package/src/components/CopyLead/types/copy-lead-button.ts +6 -0
- package/src/components/CopyLead/types/copy-lead-image.ts +19 -0
- package/src/components/CopyLead/types/copy-lead-list-item.ts +7 -0
- package/src/components/CopyLead/types/copy-lead-transcript-link.ts +6 -0
- package/src/components/CopyLead/types/index.ts +4 -0
- package/src/components/DownloadList/DownloadList.module.css +7 -0
- package/src/components/DownloadList/DownloadList.tsx +41 -0
- package/src/components/DownloadList/index.ts +1 -0
- package/src/components/FeaturePost/FeaturePost.module.css +58 -0
- package/src/components/FeaturePost/FeaturePost.tsx +203 -0
- package/src/components/FeaturePost/components/Image/Image.tsx +18 -0
- package/src/components/FeaturePost/components/Image/index.ts +1 -0
- package/src/components/FeaturePost/components/MediaContent/MediaContent.tsx +45 -0
- package/src/components/FeaturePost/components/MediaContent/index.ts +0 -0
- package/src/components/FeaturePost/index.ts +1 -0
- package/src/components/FeaturePost/types/feature-post-app-button-footer.ts +7 -0
- package/src/components/FeaturePost/types/feature-post-cta-footer.ts +11 -0
- package/src/components/FeaturePost/types/feature-post-image.ts +19 -0
- package/src/components/FeaturePost/types/index.ts +3 -0
- package/src/components/Highlights/Highlights.module.css +85 -0
- package/src/components/Highlights/Highlights.tsx +53 -0
- package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +68 -0
- package/src/components/Highlights/components/HighlightList/HighlightList.tsx +42 -0
- package/src/components/Highlights/index.ts +1 -0
- package/src/components/Highlights/types/highlight-list-item.ts +11 -0
- package/src/components/Highlights/types/index.ts +1 -0
- package/src/components/PromoListing/PromoListing.module.css +97 -0
- package/src/components/PromoListing/PromoListing.tsx +153 -0
- package/src/components/PromoListing/index.ts +1 -0
- package/src/components/Quote/Quote.module.css +60 -0
- package/src/components/Quote/Quote.tsx +57 -0
- package/src/components/Quote/index.ts +1 -0
- package/src/components/SectionHeading/SectionHeading.module.css +34 -0
- package/src/components/SectionHeading/SectionHeading.tsx +65 -0
- package/src/components/SectionHeading/index.ts +1 -0
- package/src/components/Statistics/Statistics.module.css +25 -0
- package/src/components/Statistics/Statistics.tsx +97 -0
- package/src/components/Statistics/helpers/get-link-props.ts +11 -0
- package/src/components/Statistics/index.ts +1 -0
- package/src/components/Statistics/types/statistic-link.ts +6 -0
- package/src/components/Statistics/types/statistic.ts +9 -0
- package/src/components/Summary/Summary.module.css +31 -0
- package/src/components/Summary/Summary.tsx +65 -0
- package/src/components/Summary/index.ts +1 -0
- package/src/components/index.ts +11 -0
- package/src/index.ts +5 -0
- package/src/types/file-types.d.ts +9 -0
- package/stylelint.config.js +4 -0
- package/tsconfig.json +11 -0
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arc-ui/community-components",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"homepage": "https://ui.digital-ent-int.bt.com",
|
|
6
|
+
"author": "BT Business Digital UI Team <ui-digital-ent-int@bt.com>",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"import": "./dist/index.es.js",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./src": "./src/index.ts",
|
|
14
|
+
"./styles.css": "./dist/styles.css",
|
|
15
|
+
"./*.css": "./dist/*/styles.css",
|
|
16
|
+
"./*": {
|
|
17
|
+
"types": "./dist/types/components/*/index.d.ts",
|
|
18
|
+
"import": "./dist/*/*.esm.js",
|
|
19
|
+
"require": "./dist/*/*.cjs.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@arc-ui/components": "12.0.0-beta.11",
|
|
27
|
+
"@arc-ui/theme-bt-business": "12.0.0-beta.11",
|
|
28
|
+
"@arc-ui/theme-bt-enterprise": "12.0.0-beta.11",
|
|
29
|
+
"@arc-ui/theme-ee": "12.0.0-beta.11",
|
|
30
|
+
"react": "^18.0.0",
|
|
31
|
+
"react-dom": "^18.0.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@arc-ui/theme-bt-enterprise": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"@arc-ui/theme-bt-business": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"@arc-ui/theme-ee": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@arc-ui/components": "12.0.0-beta.11",
|
|
46
|
+
"@arc-ui/icons-bt": "12.0.0-beta.11",
|
|
47
|
+
"@arc-ui/icons-ee": "12.0.0-beta.11",
|
|
48
|
+
"@arc-ui/theme-bt-business": "12.0.0-beta.11",
|
|
49
|
+
"@arc-ui/theme-bt-enterprise": "12.0.0-beta.11",
|
|
50
|
+
"@arc-ui/theme-ee": "12.0.0-beta.11",
|
|
51
|
+
"@arc-ui/tokens-arc": "12.0.0-beta.11",
|
|
52
|
+
"@arc-ui/tokens-bt-business": "12.0.0-beta.11",
|
|
53
|
+
"@arc-ui/tokens-bt-enterprise": "12.0.0-beta.11",
|
|
54
|
+
"@arc-ui/tokens-ee": "12.0.0-beta.11",
|
|
55
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
56
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
57
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
58
|
+
"@types/node": "^14.0.0",
|
|
59
|
+
"@types/react": "18.2.0",
|
|
60
|
+
"@types/react-dom": "18.2.7",
|
|
61
|
+
"classnames": "^2.2.6",
|
|
62
|
+
"date-fns": "2.30.0",
|
|
63
|
+
"eslint": "^8.57.1",
|
|
64
|
+
"react": "^18.0.0",
|
|
65
|
+
"react-dom": "^18.0.0",
|
|
66
|
+
"rimraf": "^6.0.1",
|
|
67
|
+
"rollup": "^4.27.3",
|
|
68
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
69
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
70
|
+
"rollup-plugin-postcss": "^4.0.0",
|
|
71
|
+
"stylelint": "^16.10.0",
|
|
72
|
+
"tslib": "^2.8.1",
|
|
73
|
+
"typescript": "^5.6.3",
|
|
74
|
+
"@arc-ui/community-typescript-config": "^1.0.0",
|
|
75
|
+
"@arc-ui/community-eslint-config": "^1.0.0",
|
|
76
|
+
"@arc-ui/community-css-config": "^1.0.0",
|
|
77
|
+
"@arc-ui/community-build-utils": "^1.0.0",
|
|
78
|
+
"@arc-ui/community-utils": "^1.0.0"
|
|
79
|
+
},
|
|
80
|
+
"browserslist": [
|
|
81
|
+
"defaults",
|
|
82
|
+
"last 1 Chrome version",
|
|
83
|
+
"last 1 ChromeAndroid version",
|
|
84
|
+
"last 1 Edge version",
|
|
85
|
+
"last 1 Firefox version",
|
|
86
|
+
"Firefox ESR",
|
|
87
|
+
"Firefox 91",
|
|
88
|
+
"Firefox 78",
|
|
89
|
+
"Firefox 68",
|
|
90
|
+
"Safari >= 14",
|
|
91
|
+
"iOS >= 14",
|
|
92
|
+
"Samsung >= 16",
|
|
93
|
+
"not IE 11",
|
|
94
|
+
"not Edge < 18",
|
|
95
|
+
"not and_qq > 0",
|
|
96
|
+
"not UCAndroid > 0",
|
|
97
|
+
"not OperaMini all"
|
|
98
|
+
],
|
|
99
|
+
"scripts": {
|
|
100
|
+
"lint:ts": "eslint .",
|
|
101
|
+
"lint:css": "stylelint '**/*.css'",
|
|
102
|
+
"ts:check": "tsc --noEmit",
|
|
103
|
+
"build": "rimraf dist && rollup -c && generate-subpath-css"
|
|
104
|
+
}
|
|
105
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import typescript from "@rollup/plugin-typescript";
|
|
2
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
3
|
+
import resolve from "@rollup/plugin-node-resolve";
|
|
4
|
+
import external from "rollup-plugin-peer-deps-external";
|
|
5
|
+
import postcss from "rollup-plugin-postcss";
|
|
6
|
+
import del from "rollup-plugin-delete";
|
|
7
|
+
|
|
8
|
+
import { getDirectories } from "@arc-ui/community-build-utils/get-directories";
|
|
9
|
+
import { getSubPathFileMap } from "@arc-ui/community-build-utils/get-subpath-file-map";
|
|
10
|
+
|
|
11
|
+
import postcssConfig from "./postcss.config.cjs";
|
|
12
|
+
|
|
13
|
+
const directories = getDirectories("components");
|
|
14
|
+
|
|
15
|
+
const basePlugins = [external(), resolve(), commonjs()];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* We have multiple output configs to support CommonJS and ES modules.
|
|
19
|
+
*/
|
|
20
|
+
export default [
|
|
21
|
+
// CommonJS
|
|
22
|
+
{
|
|
23
|
+
input: "src/index.ts",
|
|
24
|
+
output: {
|
|
25
|
+
dir: "dist",
|
|
26
|
+
format: "cjs",
|
|
27
|
+
exports: "named",
|
|
28
|
+
sourcemap: true,
|
|
29
|
+
},
|
|
30
|
+
plugins: [
|
|
31
|
+
...basePlugins,
|
|
32
|
+
del({
|
|
33
|
+
targets: ["dist/styles.js"],
|
|
34
|
+
}), // Remove empty files
|
|
35
|
+
// We do this here because we are able to use `dir` for cjs, and
|
|
36
|
+
// declaration exports require use of a dir. ES modules require a
|
|
37
|
+
// file so that we can specify standard .es.js file extension.
|
|
38
|
+
typescript({
|
|
39
|
+
declaration: true,
|
|
40
|
+
declarationDir: "dist/types",
|
|
41
|
+
exclude: [
|
|
42
|
+
"**/__mocks__/**/*.ts",
|
|
43
|
+
"**/__tests__/**/*.tsx",
|
|
44
|
+
"**/*.test.tsx",
|
|
45
|
+
"**/*.stories.tsx",
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
postcss(postcssConfig),
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
// ES Module
|
|
52
|
+
{
|
|
53
|
+
input: "src/index.ts",
|
|
54
|
+
output: [
|
|
55
|
+
{
|
|
56
|
+
file: "dist/index.es.js",
|
|
57
|
+
format: "esm",
|
|
58
|
+
exports: "named",
|
|
59
|
+
sourcemap: true,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
plugins: [
|
|
63
|
+
...basePlugins,
|
|
64
|
+
typescript(),
|
|
65
|
+
postcss({ ...postcssConfig, extract: false }),
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
// Sub path esm
|
|
69
|
+
{
|
|
70
|
+
input: getSubPathFileMap(directories, "esm"),
|
|
71
|
+
output: {
|
|
72
|
+
dir: "dist",
|
|
73
|
+
exports: "named",
|
|
74
|
+
format: "esm",
|
|
75
|
+
chunkFileNames: "_shared/esm/[name]-[hash].js",
|
|
76
|
+
},
|
|
77
|
+
plugins: [
|
|
78
|
+
...basePlugins,
|
|
79
|
+
typescript(),
|
|
80
|
+
postcss({ ...postcssConfig, extract: false }),
|
|
81
|
+
],
|
|
82
|
+
external: ["react", "react-dom"],
|
|
83
|
+
},
|
|
84
|
+
// Sub path cjs
|
|
85
|
+
{
|
|
86
|
+
input: getSubPathFileMap(directories, "cjs"),
|
|
87
|
+
output: {
|
|
88
|
+
dir: "dist",
|
|
89
|
+
exports: "named",
|
|
90
|
+
format: "cjs",
|
|
91
|
+
|
|
92
|
+
chunkFileNames: "_shared/cjs/[name]-[hash].js",
|
|
93
|
+
},
|
|
94
|
+
plugins: [
|
|
95
|
+
...basePlugins,
|
|
96
|
+
typescript(),
|
|
97
|
+
postcss({ ...postcssConfig, extract: false }),
|
|
98
|
+
],
|
|
99
|
+
external: ["react", "react-dom"],
|
|
100
|
+
},
|
|
101
|
+
];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
|
|
4
|
+
|
|
5
|
+
import { SectionHeading, type SectionHeadingProps } from "../SectionHeading";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
AccordionDisclosureList,
|
|
9
|
+
AccordionDisclosureListProps,
|
|
10
|
+
} from "./components/AccordionDisclosureList/AccordionDisclosureList";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Use the `Accordion` component to package together a title, content and a number of disclosure components into one section (maximum 10).
|
|
14
|
+
*/
|
|
15
|
+
export const Accordion: React.FC<AccordionProps> = ({
|
|
16
|
+
heading,
|
|
17
|
+
headingLevel,
|
|
18
|
+
content,
|
|
19
|
+
disclosureList,
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
22
|
+
return (
|
|
23
|
+
<div {...filterDataAttrs(props)}>
|
|
24
|
+
<SectionHeading
|
|
25
|
+
isPadded
|
|
26
|
+
data-testid="Accordion-header"
|
|
27
|
+
heading={heading}
|
|
28
|
+
headingLevel={headingLevel}
|
|
29
|
+
content={content}
|
|
30
|
+
/>
|
|
31
|
+
<AccordionDisclosureList disclosureList={disclosureList} />
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export interface AccordionProps
|
|
37
|
+
extends SectionHeadingProps,
|
|
38
|
+
AccordionDisclosureListProps {}
|
package/src/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.tsx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type DisclosureProps,
|
|
5
|
+
Disclosure,
|
|
6
|
+
} from "@arc-ui/components/dist/Disclosure";
|
|
7
|
+
|
|
8
|
+
export const AccordionDisclosureList: React.FC<
|
|
9
|
+
AccordionDisclosureListProps
|
|
10
|
+
> = ({ disclosureList }) => {
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
{disclosureList.map(
|
|
14
|
+
(
|
|
15
|
+
{
|
|
16
|
+
children,
|
|
17
|
+
summary,
|
|
18
|
+
isOpen = false,
|
|
19
|
+
indentDetails = false,
|
|
20
|
+
headingLevel,
|
|
21
|
+
},
|
|
22
|
+
index,
|
|
23
|
+
) => (
|
|
24
|
+
<Disclosure
|
|
25
|
+
key={index}
|
|
26
|
+
summary={summary}
|
|
27
|
+
isOpen={isOpen}
|
|
28
|
+
indentDetails={indentDetails}
|
|
29
|
+
headingLevel={headingLevel}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
</Disclosure>
|
|
33
|
+
),
|
|
34
|
+
)}
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export interface AccordionDisclosureListProps {
|
|
40
|
+
/**
|
|
41
|
+
* Array of `Disclosure` components. Maximum 10 in one `Accordion`.
|
|
42
|
+
*/
|
|
43
|
+
disclosureList: DisclosureProps[];
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion, type AccordionProps } from "./Accordion";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
|
|
4
|
+
|
|
5
|
+
import { Grid } from "@arc-ui/components/dist/Grid";
|
|
6
|
+
import { type AvatarProps, Avatar } from "@arc-ui/components/dist/Avatar";
|
|
7
|
+
import { Heading } from "@arc-ui/components/dist/Heading";
|
|
8
|
+
import { Text } from "@arc-ui/components/dist/Text";
|
|
9
|
+
|
|
10
|
+
import styles from "./Author.module.css";
|
|
11
|
+
|
|
12
|
+
export const Author: React.FC<AuthorProps> = ({
|
|
13
|
+
name,
|
|
14
|
+
title,
|
|
15
|
+
avatar = {},
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
const avatarSizes = ["s", "m", "l", "xl"];
|
|
19
|
+
avatar.size = avatarSizes.includes(avatar.size || "") ? avatar.size : "m";
|
|
20
|
+
|
|
21
|
+
const isLargeAvatar = avatar.size === "l" || avatar.size === "xl";
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div {...filterDataAttrs(props)}>
|
|
25
|
+
<Grid isFluid isGutterless>
|
|
26
|
+
<Grid.Row align="center">
|
|
27
|
+
<Grid.Col xs={isLargeAvatar ? 12 : "auto"}>
|
|
28
|
+
<div className={isLargeAvatar ? styles.largeAvatar : undefined}>
|
|
29
|
+
<Avatar {...avatar} />
|
|
30
|
+
</div>
|
|
31
|
+
</Grid.Col>
|
|
32
|
+
<Grid.Col>
|
|
33
|
+
<div
|
|
34
|
+
className={`${!isLargeAvatar && styles.authorContent}`}
|
|
35
|
+
data-testid="authorContent"
|
|
36
|
+
>
|
|
37
|
+
<Heading size="xs">{name}</Heading>
|
|
38
|
+
<Text size="s">{title}</Text>
|
|
39
|
+
</div>
|
|
40
|
+
</Grid.Col>
|
|
41
|
+
</Grid.Row>
|
|
42
|
+
</Grid>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface AuthorProps {
|
|
48
|
+
/**
|
|
49
|
+
* Name of the Author.
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
/**
|
|
53
|
+
* Job title of the Author.
|
|
54
|
+
*/
|
|
55
|
+
title: string;
|
|
56
|
+
/**
|
|
57
|
+
* Optional Avatar for the Author.
|
|
58
|
+
*/
|
|
59
|
+
avatar?: AvatarProps;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Author, type AuthorProps } from "./Author";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import url("@arc-ui/tokens-arc/dist/custom-media.css");
|
|
2
|
+
|
|
3
|
+
.contentSwitcherWrapper {
|
|
4
|
+
display: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.contentSwitcherDropdownWrapper {
|
|
8
|
+
display: block;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (--arc-custom-media-min-width-s-px) {
|
|
12
|
+
.contentSwitcherWrapper {
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.contentSwitcherDropdownWrapper {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { FC, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { HeroBanner } from "@arc-ui/components/dist/HeroBanner";
|
|
4
|
+
import { HeroBannerProps } from "@arc-ui/components/dist/types/components/HeroBanner/HeroBanner";
|
|
5
|
+
|
|
6
|
+
import { ContentSwitcher } from "@arc-ui/components/dist/ContentSwitcher";
|
|
7
|
+
import { ContentSwitcherDropdown } from "@arc-ui/components/dist/ContentSwitcherDropdown";
|
|
8
|
+
|
|
9
|
+
import styles from "./BannerWithTabs.module.css";
|
|
10
|
+
|
|
11
|
+
export const BannerWithTabs: FC<BannerWithTabsProps> = ({
|
|
12
|
+
tabs,
|
|
13
|
+
defaultValue,
|
|
14
|
+
}) => {
|
|
15
|
+
const initialTab = defaultValue ?? tabs[0]?.value;
|
|
16
|
+
const [selectedTab, setSelectedTab] = useState<string>(initialTab);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<div className={styles.contentSwitcherWrapper}>
|
|
21
|
+
<ContentSwitcher
|
|
22
|
+
value={selectedTab}
|
|
23
|
+
onValueChange={(value) => setSelectedTab(value)}
|
|
24
|
+
>
|
|
25
|
+
<ContentSwitcher.List isInset>
|
|
26
|
+
{tabs.map(({ label, value }, index) => (
|
|
27
|
+
<ContentSwitcher.Tab
|
|
28
|
+
label={label}
|
|
29
|
+
value={value}
|
|
30
|
+
key={`${index}-${value}`}
|
|
31
|
+
/>
|
|
32
|
+
))}
|
|
33
|
+
</ContentSwitcher.List>
|
|
34
|
+
{tabs.map(({ value, content }, index) => (
|
|
35
|
+
<ContentSwitcher.Content value={value} key={index}>
|
|
36
|
+
<HeroBanner {...content} />
|
|
37
|
+
</ContentSwitcher.Content>
|
|
38
|
+
))}
|
|
39
|
+
</ContentSwitcher>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div className={styles.contentSwitcherDropdownWrapper}>
|
|
43
|
+
<ContentSwitcherDropdown
|
|
44
|
+
value={selectedTab}
|
|
45
|
+
tabs={tabs}
|
|
46
|
+
isInset
|
|
47
|
+
isFluid
|
|
48
|
+
onValueChange={(value) => setSelectedTab(value)}
|
|
49
|
+
>
|
|
50
|
+
{tabs.map(({ value, content }, index) => (
|
|
51
|
+
<ContentSwitcherDropdown.Content
|
|
52
|
+
value={value}
|
|
53
|
+
key={`${index}-${value}`}
|
|
54
|
+
>
|
|
55
|
+
<HeroBanner {...content} />
|
|
56
|
+
</ContentSwitcherDropdown.Content>
|
|
57
|
+
))}
|
|
58
|
+
</ContentSwitcherDropdown>
|
|
59
|
+
</div>
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export interface BannerWithTabsProps {
|
|
65
|
+
/**
|
|
66
|
+
* Determine what tabs to render. They need both a `value` and `label` prop
|
|
67
|
+
*/
|
|
68
|
+
tabs: { value: string; label: string; content: HeroBannerProps }[];
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Default to an inital value of a tab. If this is left blank it will default to first tab.
|
|
72
|
+
*/
|
|
73
|
+
defaultValue?: string;
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BannerWithTabs, type BannerWithTabsProps } from "./BannerWithTabs";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
@import url("@arc-ui/tokens-arc/dist/custom-media.css");
|
|
2
|
+
|
|
3
|
+
.buttonContainer {
|
|
4
|
+
margin: var(--sem-space-padding-150) auto 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.col {
|
|
9
|
+
flex: 1 1 auto;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: var(--sem-space-padding-150);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.container--content {
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.container--media {
|
|
24
|
+
flex-direction: column-reverse;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.container--align-center {
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.container--align-top {
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.list {
|
|
36
|
+
list-style: none;
|
|
37
|
+
margin: 0;
|
|
38
|
+
max-width: 480px;
|
|
39
|
+
padding: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.listItem {
|
|
43
|
+
display: flex;
|
|
44
|
+
|
|
45
|
+
&:nth-of-type(n + 2) {
|
|
46
|
+
margin-top: var(--sem-space-padding-150);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.listItemCentered {
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.listItemIconContainer {
|
|
55
|
+
flex: 0 0 auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.listItemTextContainer {
|
|
59
|
+
flex: 1 1 auto;
|
|
60
|
+
padding: 0 0 0 var(--sem-space-padding-80);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.imgWrapper {
|
|
64
|
+
border-radius: var(--sem-border-radius-s);
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.mediaContainer {
|
|
69
|
+
margin-bottom: var(--sem-space-padding-150);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.content {
|
|
73
|
+
max-width: 715px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (--arc-custom-media-min-width-s-px) {
|
|
77
|
+
.buttonContainer {
|
|
78
|
+
width: max-content;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media (--arc-custom-media-min-width-m-px) {
|
|
83
|
+
.container {
|
|
84
|
+
gap: var(--sem-space-padding-110);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.container--media,
|
|
88
|
+
.container--content {
|
|
89
|
+
flex-direction: row;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.container--reverse {
|
|
93
|
+
flex-direction: row-reverse;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.buttonContainer {
|
|
97
|
+
margin: var(--sem-space-padding-150) 0 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.col {
|
|
101
|
+
width: 50%;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.list {
|
|
105
|
+
max-width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.listItemTextContainer {
|
|
109
|
+
padding: 0 var(--sem-space-padding-80);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media (--arc-custom-media-min-width-l-px) {
|
|
114
|
+
.listItemTextContainer {
|
|
115
|
+
padding: 0 var(--sem-space-padding-110);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (--arc-custom-media-min-width-xl-px) {
|
|
120
|
+
.container {
|
|
121
|
+
gap: var(--sem-space-padding-130);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.listItemTextContainer {
|
|
125
|
+
padding: 0 var(--sem-space-padding-130);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
|
|
3
|
+
|
|
4
|
+
import { type HeadingLevel } from "@arc-ui/components/dist/Heading";
|
|
5
|
+
import { type VideoPlayerProps } from "@arc-ui/components/dist/VideoPlayer";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
type CopyLeadButton,
|
|
9
|
+
type CopyLeadImage,
|
|
10
|
+
type CopyLeadListItem,
|
|
11
|
+
} from "./types";
|
|
12
|
+
|
|
13
|
+
import { MediaTemplate } from "./templates/Media";
|
|
14
|
+
import { ContentTemplate } from "./templates/Content";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Use `CopyLead` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link to a supporting explanatory video. An optional CTA can be used to link to further information or trigger a sales or enquiry journey.
|
|
18
|
+
*/
|
|
19
|
+
export const CopyLead: React.FC<CopyLeadProps> = ({
|
|
20
|
+
button,
|
|
21
|
+
heading,
|
|
22
|
+
headingLevel = "2",
|
|
23
|
+
listItems,
|
|
24
|
+
video,
|
|
25
|
+
image,
|
|
26
|
+
content,
|
|
27
|
+
isReverseOrder = false,
|
|
28
|
+
...props
|
|
29
|
+
}) => {
|
|
30
|
+
console.log(video);
|
|
31
|
+
if (video || image) {
|
|
32
|
+
return (
|
|
33
|
+
<MediaTemplate
|
|
34
|
+
content={content}
|
|
35
|
+
video={video}
|
|
36
|
+
image={image}
|
|
37
|
+
listItems={listItems}
|
|
38
|
+
heading={heading}
|
|
39
|
+
headingLevel={headingLevel}
|
|
40
|
+
button={button}
|
|
41
|
+
isReverseOrder={isReverseOrder}
|
|
42
|
+
{...filterDataAttrs(props)}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (content) {
|
|
48
|
+
return (
|
|
49
|
+
<ContentTemplate
|
|
50
|
+
listItems={listItems}
|
|
51
|
+
heading={heading}
|
|
52
|
+
headingLevel={headingLevel}
|
|
53
|
+
button={button}
|
|
54
|
+
content={content}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return null;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export interface CopyLeadProps {
|
|
63
|
+
/**
|
|
64
|
+
* heading for `CopyLead`.
|
|
65
|
+
*/
|
|
66
|
+
heading: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Determine a heading level for `<MediaTemplate />` and `<ContentTemplate />`
|
|
70
|
+
*/
|
|
71
|
+
headingLevel?: HeadingLevel;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Reverse the columns so the image / video appears on the left. Doesn't affect mobile layouts, and is only applied if there is a video or an image.
|
|
75
|
+
*/
|
|
76
|
+
isReverseOrder?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Text content for `CopyLead`.
|
|
80
|
+
*/
|
|
81
|
+
content?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Button for `CopyLead`.
|
|
85
|
+
*/
|
|
86
|
+
button?: CopyLeadButton;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Image for `CopyLead`.
|
|
90
|
+
*/
|
|
91
|
+
image?: CopyLeadImage;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Video embed. Supported platforms are YouTube and Vimeo.
|
|
95
|
+
*/
|
|
96
|
+
video?: VideoPlayerProps;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* List items for `CopyLead`
|
|
100
|
+
*/
|
|
101
|
+
listItems: CopyLeadListItem[];
|
|
102
|
+
}
|