@usace/groundwork 1.0.1 → 1.0.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.
Files changed (79) hide show
  1. package/dist/groundwork.es.js +5131 -0
  2. package/dist/groundwork.umd.js +30 -0
  3. package/dist/style.css +1 -0
  4. package/package.json +17 -3
  5. package/.eslintrc.cjs +0 -18
  6. package/.github/workflows/deploy-docs.yml +0 -59
  7. package/.github/workflows/publish.yml +0 -19
  8. package/index.html +0 -13
  9. package/lib/catalyst/alert.jsx +0 -110
  10. package/lib/catalyst/avatar.jsx +0 -64
  11. package/lib/catalyst/badge.jsx +0 -72
  12. package/lib/catalyst/checkbox.jsx +0 -160
  13. package/lib/catalyst/dialog.jsx +0 -101
  14. package/lib/catalyst/dropdown.jsx +0 -202
  15. package/lib/catalyst/fieldset.jsx +0 -87
  16. package/lib/catalyst/input.jsx +0 -78
  17. package/lib/catalyst/listbox.jsx +0 -195
  18. package/lib/catalyst/pagination.jsx +0 -75
  19. package/lib/catalyst/radio.jsx +0 -144
  20. package/lib/catalyst/select.jsx +0 -78
  21. package/lib/catalyst/switch.jsx +0 -203
  22. package/lib/catalyst/textarea.jsx +0 -59
  23. package/lib/components/breadcrumbs.jsx +0 -46
  24. package/lib/components/button.jsx +0 -219
  25. package/lib/components/display/headings.jsx +0 -39
  26. package/lib/components/display/text.jsx +0 -48
  27. package/lib/components/hero.jsx +0 -51
  28. package/lib/components/layout/container.jsx +0 -13
  29. package/lib/components/layout/usace-box.jsx +0 -26
  30. package/lib/components/link.jsx +0 -18
  31. package/lib/components/table.jsx +0 -146
  32. package/lib/composite/footer/essayons.jsx +0 -12
  33. package/lib/composite/footer/footer-links.jsx +0 -33
  34. package/lib/composite/footer/index.jsx +0 -148
  35. package/lib/composite/footer/logo-banner.jsx +0 -55
  36. package/lib/composite/footer/social-links.jsx +0 -60
  37. package/lib/composite/header/index.jsx +0 -83
  38. package/lib/composite/header/navbar-links.jsx +0 -113
  39. package/lib/composite/header/usa-banner/USABanner.jsx +0 -114
  40. package/lib/composite/header/usa-banner/usa-banner.css +0 -220
  41. package/lib/composite/site-wrapper/index.jsx +0 -52
  42. package/lib/index.jsx +0 -19
  43. package/postcss.config.js +0 -6
  44. package/public/Magnifying_glass_icon.svg +0 -5
  45. package/public/armystar-logo-rb.svg +0 -4
  46. package/public/cwbi-logo.png +0 -0
  47. package/public/essayonscrest.png +0 -0
  48. package/public/icon-dot-gov.svg +0 -1
  49. package/public/icon-https.svg +0 -1
  50. package/public/nww-lucky-peak-dam.jpg +0 -0
  51. package/public/rsgis-logo.png +0 -0
  52. package/public/us_flag_small.png +0 -0
  53. package/public/usace-logo-color.svg +0 -1
  54. package/src/App.jsx +0 -38
  55. package/src/app-bundles/index.js +0 -4
  56. package/src/app-bundles/route-bundle.js +0 -36
  57. package/src/app-components/code-example.jsx +0 -17
  58. package/src/app-components/copy-button.jsx +0 -32
  59. package/src/app-components/props-table.jsx +0 -43
  60. package/src/app-components/sub-site-banner.jsx +0 -15
  61. package/src/app-pages/documentation/_docs-page.jsx +0 -31
  62. package/src/app-pages/documentation/_docs-sidebar.jsx +0 -111
  63. package/src/app-pages/documentation/_template.jsx +0 -55
  64. package/src/app-pages/documentation/app-shell/index.jsx +0 -39
  65. package/src/app-pages/documentation/app-shell/site-wrapper.jsx +0 -190
  66. package/src/app-pages/documentation/buttons/index.jsx +0 -170
  67. package/src/app-pages/documentation/index.jsx +0 -57
  68. package/src/app-pages/documentation/layout/container.jsx +0 -68
  69. package/src/app-pages/documentation/layout/index.jsx +0 -52
  70. package/src/app-pages/documentation/layout/usace-box.jsx +0 -76
  71. package/src/app-pages/documentation/navigation/breadcrumbs.jsx +0 -119
  72. package/src/app-pages/documentation/navigation/index.jsx +0 -31
  73. package/src/app-pages/documentation/types/index.jsx +0 -31
  74. package/src/app-pages/documentation/types/link.jsx +0 -72
  75. package/src/app-pages/home.jsx +0 -71
  76. package/src/index.css +0 -3
  77. package/src/main.jsx +0 -18
  78. package/tailwind.config.js +0 -31
  79. package/vite.config.js +0 -46
@@ -1,55 +0,0 @@
1
- import { UsaceBox, Code } from "../../../../lib";
2
- import { CodeExample } from "../../../app-components/code-example";
3
- import PropsTable from "../../../app-components/props-table";
4
- import DocsPage from "../_docs-page";
5
-
6
- const pageBreadcrumbs = [
7
- {
8
- text: "Documentation",
9
- href: "/docs",
10
- },
11
- ];
12
-
13
- const componentProps = [
14
- {
15
- name: "headerLinks",
16
- type: "array[Link]",
17
- default: "[]",
18
- desc: "An array of objects to be used as links in the header. Each object should have an id, text, and href property. If you would like a drop-down of links include a children property which is an array of link objects to the top level link.",
19
- },
20
- ];
21
-
22
- function Docs() {
23
- return (
24
- <DocsPage breadcrumbs={pageBreadcrumbs}>
25
- <UsaceBox title="Site Wrapper">
26
- {/* Description of the component and what problem it solves */}
27
- <div className="pb-6">
28
- <p>Description of component</p>
29
- <p className="pt-3">Description continued</p>
30
- </div>
31
- {/* Example usage - remove if not needed */}
32
- <div className="rounded-md border border-dashed px-6 py-3 mb-3"></div>
33
- {/* Example code */}
34
- <CodeExample
35
- code={`import { } from "@usace/groundwork";
36
-
37
- function Component() {
38
- return ()
39
- }
40
-
41
- export default Component;
42
- `}
43
- />
44
- {/* Component props documentation */}
45
- <div className="font-bold text-lg pt-6">
46
- Component API - <Code className="p-2">{`<SiteWrapper />`}</Code>
47
- </div>
48
- <PropsTable propsList={componentProps} />
49
- </UsaceBox>
50
- </DocsPage>
51
- );
52
- }
53
-
54
- export default Docs;
55
- export { Docs };
@@ -1,39 +0,0 @@
1
- import { UsaceBox, H4 } from "../../../../lib";
2
- import DocsPage from "../_docs-page";
3
-
4
- const pageBreadcrumbs = [
5
- {
6
- text: "Documentation",
7
- href: "/docs",
8
- },
9
- {
10
- text: "Application Shell",
11
- href: "/docs/app-shell",
12
- },
13
- ];
14
-
15
- function AppShell() {
16
- return (
17
- <DocsPage breadcrumbs={pageBreadcrumbs}>
18
- <UsaceBox title="Application Shell">
19
- <div className="pb-6">
20
- The application shell consists of components that are shared across
21
- many pages, this way we can re-use components for the header, footer,
22
- etc... and don't have to worry about getting them all to match. The
23
- easiest way to start your app is to use the SiteWrapper component to
24
- wrap your custom page, then you only have to concentrate on your
25
- specific content.
26
- </div>
27
- <H4>Components</H4>
28
- <ul>
29
- <li>
30
- <a href="/docs/app-shell/site-wrapper">Site Wrapper</a>
31
- </li>
32
- </ul>
33
- </UsaceBox>
34
- </DocsPage>
35
- );
36
- }
37
-
38
- export default AppShell;
39
- export { AppShell };
@@ -1,190 +0,0 @@
1
- import { UsaceBox, Code } from "../../../../lib";
2
- import { CodeExample } from "../../../app-components/code-example";
3
- import PropsTable from "../../../app-components/props-table";
4
- import DocsPage from "../_docs-page";
5
-
6
- const pageBreadcrumbs = [
7
- {
8
- text: "Documentation",
9
- href: "/docs",
10
- },
11
- {
12
- text: "Application Shell",
13
- href: "/docs/app-shell",
14
- },
15
- {
16
- text: "Site Wrapper",
17
- href: "/docs/app-shell/site-wrapper",
18
- },
19
- ];
20
-
21
- const siteWrapperProps = [
22
- {
23
- name: "headerLinks",
24
- type: "array[Link]",
25
- default: "[]",
26
- desc: "An array of objects to be used as links in the header. Each object should have an id, text, and href property. If you would like a drop-down of links include a children property which is an array of link objects to the top level link.",
27
- },
28
- {
29
- name: "usaBanner",
30
- type: "boolean",
31
- default: "true",
32
- desc: "If true, the government website banner will be displayed at the top of the page.",
33
- },
34
- {
35
- name: "msgBanner",
36
- type: "component",
37
- default: "null",
38
- desc: "A custom component that will render between the government website banner and the header. This is useful for displaying a message banner that is specific to the site or page.",
39
- },
40
- {
41
- name: "title",
42
- type: "string",
43
- default: "US Army Corps of Engineers",
44
- desc: "The title to display in the header.",
45
- },
46
- {
47
- name: "subtitle",
48
- type: "string",
49
- default: "''",
50
- desc: "A subtitle to display in the header.",
51
- },
52
- {
53
- name: "missionText",
54
- type: "string",
55
- default: "''",
56
- desc: "The mission text to display in the footer.",
57
- },
58
- {
59
- name: "aboutText",
60
- type: "string",
61
- default: "''",
62
- desc: "The about text to display in the footer.",
63
- },
64
- {
65
- name: "facebookUrl",
66
- type: "string",
67
- default: "''",
68
- desc: "The URL to a Facebook page.",
69
- },
70
- {
71
- name: "twitterUrl",
72
- type: "string",
73
- default: "''",
74
- desc: "The URL to a Twitter page.",
75
- },
76
- {
77
- name: "youtubeUrl",
78
- type: "string",
79
- default: "''",
80
- desc: "The URL to a YouTube page.",
81
- },
82
- {
83
- name: "flickrUrl",
84
- type: "string",
85
- default: "''",
86
- desc: "The URL to a Flickr page.",
87
- },
88
- {
89
- name: "usaceLinks",
90
- type: "array[Link]",
91
- default: "[]",
92
- desc: "An array of objects to be used as links in the footer. These links should point to USACE websites. Each object should have an id, text, and href property.",
93
- },
94
- {
95
- name: "externalLinks",
96
- type: "array[Link]",
97
- default: "[]",
98
- desc: "An array of objects to be used as external links in the footer. Use these links to point to external non-USACE websites. Each object should have an id, text, and href property.",
99
- },
100
- {
101
- name: "armyLogo",
102
- type: "boolean",
103
- default: "true",
104
- desc: "If true, the Army logo will be displayed in the footer.",
105
- },
106
- {
107
- name: "usaceLogo",
108
- type: "boolean",
109
- default: "true",
110
- desc: "If true, the USACE logo will be displayed in the footer.",
111
- },
112
- {
113
- name: "rsgisLogo",
114
- type: "boolean",
115
- default: "false",
116
- desc: "If true, the RSGIS logo will be displayed in the footer.",
117
- },
118
- {
119
- name: "cwbiLogo",
120
- type: "boolean",
121
- default: "false",
122
- desc: "If true, the CWBI logo will be displayed in the footer.",
123
- },
124
- ];
125
-
126
- function SiteWrapperDocs() {
127
- return (
128
- <DocsPage breadcrumbs={pageBreadcrumbs}>
129
- <UsaceBox title="Site Wrapper">
130
- <div className="pb-6">
131
- <p>
132
- Use the Site Wrapper to add the header and footer to your page. The
133
- best way to do this is add SiteWrapper to the top level of your
134
- application and render any changing content as children of the
135
- SiteWrapper component.
136
- </p>
137
- <p className="pt-3">
138
- For example, in a Vite project you typically have a src/App.jsx file
139
- which is the top level component for the application. You would
140
- import the SiteWrapper component there and use it to wrap the rest
141
- of your application.
142
- </p>
143
- <p className="pt-3">
144
- Note that in the example below, the useConnect hook is used to get
145
- the current content that should be rendered based on the url. This
146
- uses a separate state management framework called{" "}
147
- <a
148
- className="underline"
149
- href="https://reduxbundler.com"
150
- target="_blank"
151
- referrer="noreferrer"
152
- >
153
- ReduxBundler
154
- </a>
155
- , which we highly recommend for React state management.
156
- </p>{" "}
157
- </div>
158
- <CodeExample
159
- code={`import { SiteWrapper } from "@usace/groundwork";
160
- import { useConnect } from "redux-bundler-hook";
161
-
162
- const links = [{ id: "docs", label: "Documentation", link: "/docs" }];
163
-
164
- function App() {
165
- const {
166
- route: Route,
167
- } = useConnect("selectRoute");
168
-
169
- return (
170
- <SiteWrapper links={links}>
171
- <Route />
172
- </SiteWrapper>
173
- );
174
- }
175
-
176
- export default App;
177
- `}
178
- />
179
-
180
- <div className="font-bold text-lg pt-6">
181
- Component API - <Code className="p-2">{`<SiteWrapper />`}</Code>
182
- </div>
183
- <PropsTable propsList={siteWrapperProps} />
184
- </UsaceBox>
185
- </DocsPage>
186
- );
187
- }
188
-
189
- export default SiteWrapperDocs;
190
- export { SiteWrapperDocs };
@@ -1,170 +0,0 @@
1
- import { UsaceBox, Code, Button } from "../../../../lib";
2
- import { CodeExample } from "../../../app-components/code-example";
3
- import PropsTable from "../../../app-components/props-table";
4
- import DocsPage from "../_docs-page";
5
-
6
- const pageBreadcrumbs = [
7
- {
8
- text: "Documentation",
9
- href: "/docs",
10
- },
11
- {
12
- text: "Buttons",
13
- href: "/docs/buttons",
14
- },
15
- ];
16
-
17
- const componentProps = [
18
- {
19
- name: "type",
20
- type: "string",
21
- default: "'button'",
22
- desc: "The html button type to use.",
23
- },
24
- {
25
- name: "color",
26
- type: "string",
27
- default: "'dark/zinc'",
28
- desc: "The solid color variant to use.",
29
- },
30
- {
31
- name: "outline",
32
- type: "boolean",
33
- default: "false",
34
- desc: "Render a button with an outline but no background.",
35
- },
36
- {
37
- name: "plain",
38
- type: "boolean",
39
- default: "false",
40
- desc: "Render a plain button with no background or outline.",
41
- },
42
- {
43
- name: "disabled",
44
- type: "boolean",
45
- default: "false",
46
- desc: "Disable the button.",
47
- },
48
- {
49
- name: "onClick",
50
- type: "function",
51
- default: "undefined",
52
- desc: "Handler that will fire on the click event, all other basic React event handlers are available as well.",
53
- },
54
- ];
55
-
56
- function ButtonsDocs() {
57
- return (
58
- <DocsPage breadcrumbs={pageBreadcrumbs}>
59
- <UsaceBox title="Buttons">
60
- {/* Description of the component and what problem it solves */}
61
- <div className="pb-6">
62
- <p>
63
- The Button component can be used to render a basic button with
64
- pre-defined styles. For more advanced configurations it's
65
- recommended that you implement your own button using the{" "}
66
- <Code>{"<button>"}</Code> primitive component.
67
- </p>
68
- </div>
69
- {/* Example usage - remove if not needed */}
70
- <div className="mt-4 mb-2 text-sm font-bold">Basic Usage</div>
71
- <div className="rounded-md border border-dashed px-6 py-3 mb-3">
72
- <div className="flex flex-row flex-wrap gap-3">
73
- <Button>Default</Button>
74
- <Button outline>Outlined</Button>
75
- <Button plain>Plain</Button>
76
- <Button disabled>Disabled</Button>
77
- <Button href="/docs/buttons">As a Link</Button>
78
- </div>
79
- </div>
80
- {/* Example code */}
81
- <CodeExample
82
- code={`import { Button } from "@usace/groundwork";
83
-
84
- function Component() {
85
- return (
86
- <div className="flex flex-row flex-wrap gap-3">
87
- <Button>Default</Button>
88
- <Button outline>Outlined</Button>
89
- <Button plain>Plain</Button>
90
- <Button disabled>Disabled</Button>
91
- <Button href="/docs/buttons">As a Link</Button>
92
- </div>
93
- )
94
- }
95
-
96
- export default Component;
97
- `}
98
- />
99
- {/* Example usage - remove if not needed */}
100
- <div className="mt-4 mb-2 text-sm font-bold">
101
- Built-in Color Options
102
- </div>
103
- <div className="rounded-md border border-dashed px-6 py-3 mb-3">
104
- <div className="flex flex-row flex-wrap gap-3">
105
- {[
106
- "dark/zinc",
107
- "light",
108
- "dark/white",
109
- "dark",
110
- "white",
111
- "zinc",
112
- "indigo",
113
- "cyan",
114
- "red",
115
- "orange",
116
- "amber",
117
- "yellow",
118
- "lime",
119
- "green",
120
- "emerald",
121
- "teal",
122
- "sky",
123
- "blue",
124
- "violet",
125
- "purple",
126
- "fuchsia",
127
- "pink",
128
- "rose",
129
- ].map((clr) => {
130
- return (
131
- <Button key={clr} color={clr}>
132
- {clr}
133
- </Button>
134
- );
135
- })}
136
- </div>
137
- </div>
138
- {/* Example code */}
139
- <CodeExample
140
- code={`import { Button } from "@usace/groundwork";
141
-
142
- function Component() {
143
- return (
144
- <div className="flex flex-row flex-wrap gap-3">
145
- {colors.map((clr) => {
146
- return (
147
- <Button key={clr} color={clr}>
148
- {clr}
149
- </Button>
150
- );
151
- })}
152
- </div>
153
- )
154
- }
155
-
156
- export default Component;
157
- `}
158
- />
159
- {/* Component props documentation */}
160
- <div className="font-bold text-lg pt-6">
161
- Component API - <Code className="p-2">{`<SiteWrapper />`}</Code>
162
- </div>
163
- <PropsTable propsList={componentProps} />
164
- </UsaceBox>
165
- </DocsPage>
166
- );
167
- }
168
-
169
- export default ButtonsDocs;
170
- export { ButtonsDocs };
@@ -1,57 +0,0 @@
1
- import { UsaceBox, Code, H4 } from "../../../lib";
2
- import CopyButton from "../../app-components/copy-button";
3
- import DocsPage from "./_docs-page";
4
-
5
- const pageBreadcrumbs = [
6
- {
7
- text: "Documentation",
8
- href: "/docs",
9
- },
10
- ];
11
-
12
- function Docs() {
13
- return (
14
- <DocsPage breadcrumbs={pageBreadcrumbs}>
15
- <UsaceBox title="Getting Started">
16
- <H4>Project Setup</H4>
17
- <div className="mt-3 mb-3">
18
- <p>
19
- Groundwork is a set of React components that are designed to be used
20
- by USACE Developers building internal and externally facing web
21
- pages and web apps. The library should be compatible with any React
22
- project using a build step. We test the framework and only support
23
- using the Vite build tool. See the{" "}
24
- <a
25
- className="underline"
26
- href="https://vitejs.dev/guide/"
27
- target="_blank"
28
- referrer="no-referrer"
29
- >
30
- Vite documentation
31
- </a>{" "}
32
- for more details on getting started.{" "}
33
- </p>
34
- <p className="mt-3">
35
- Set up a new project with Vite using the following command:
36
- <div className="flex flex-row justify-start space-between items-center gap-2 mt-3 mb-3">
37
- <Code className="block p-1 px-2">
38
- npm create vite@latest {`<app-name>`} --template react
39
- </Code>
40
- <CopyButton text="npm create vite@latest <app-name> --template react" />
41
- </div>
42
- </p>
43
- </div>
44
-
45
- <H4>Installation</H4>
46
- <div className="flex flex-row justify-start space-between items-center gap-2 mt-3 mb-3">
47
- <Code className="block p-1 px-2">npm install @usace/groundwork</Code>
48
- <CopyButton text="npm install @usace/groundwork" />
49
- </div>
50
- <div>Then go build stuff with the components</div>
51
- </UsaceBox>
52
- </DocsPage>
53
- );
54
- }
55
-
56
- export default Docs;
57
- export { Docs };
@@ -1,68 +0,0 @@
1
- import { UsaceBox, Code } from "../../../../lib";
2
- import { CodeExample } from "../../../app-components/code-example";
3
- import PropsTable from "../../../app-components/props-table";
4
- import DocsPage from "../_docs-page";
5
-
6
- const pageBreadcrumbs = [
7
- {
8
- text: "Documentation",
9
- href: "/docs",
10
- },
11
- {
12
- text: "Layout",
13
- href: "/docs/layout",
14
- },
15
- {
16
- text: "Container",
17
- href: "/docs/layout/container",
18
- },
19
- ];
20
-
21
- const componentProps = [
22
- {
23
- name: "fluid",
24
- type: "boolean",
25
- default: "false",
26
- desc: "If true, the container will be full width. If false, the container will have a max width of 1140px.",
27
- },
28
- ];
29
-
30
- function ContainerDocs() {
31
- return (
32
- <DocsPage breadcrumbs={pageBreadcrumbs}>
33
- <UsaceBox title="Container">
34
- {/* Description of the component and what problem it solves */}
35
- <div className="pb-6">
36
- <p>
37
- Use Container to add a section to your page with padding and a max
38
- with that keeps content within a readable width on users screens, or
39
- if you want full width all the time, you can set fluid == true.
40
- </p>
41
- </div>
42
- {/* Example usage */}
43
- <CodeExample
44
- code={`import { Container } from "@usace/groundwork";
45
-
46
- function MyComponent() {
47
- return (
48
- <Container>
49
- <div>{content}</div>
50
- </Container>
51
- )
52
- }
53
-
54
- export default MyComponent;
55
- `}
56
- />
57
- {/* Component props documentation */}
58
- <div className="font-bold text-lg pt-6">
59
- Component API - <Code className="p-2">{`<SiteWrapper />`}</Code>
60
- </div>
61
- <PropsTable propsList={componentProps} />
62
- </UsaceBox>
63
- </DocsPage>
64
- );
65
- }
66
-
67
- export default ContainerDocs;
68
- export { ContainerDocs };
@@ -1,52 +0,0 @@
1
- import { UsaceBox } from "../../../../lib";
2
- import DocsPage from "../_docs-page";
3
-
4
- const pageBreadcrumbs = [
5
- {
6
- text: "Documentation",
7
- href: "/docs",
8
- },
9
- {
10
- text: "Layout",
11
- href: "/docs/layout",
12
- },
13
- ];
14
-
15
- function Layout() {
16
- return (
17
- <DocsPage breadcrumbs={pageBreadcrumbs}>
18
- <UsaceBox title="Layout">
19
- <div>
20
- <p>
21
- Layout components are used to structure your content on the page.
22
- They include simple wrappers for using{" "}
23
- <a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox">
24
- Flexbox layouts
25
- </a>{" "}
26
- and styled containers for displaying content using the standard
27
- flourish (see the top of this section.)
28
- </p>
29
- <p className="mt-3">
30
- <ul>
31
- <a className="hover:underline" href="/docs/layout/container">
32
- <li>Container - a simple wrapper to manage margins.</li>
33
- </a>
34
- <a className="hover:underline" href="/docs/layout/flex">
35
- <li>Flex - easy to use flexbox layouts</li>
36
- </a>
37
- <a className="hover:underline" href="/docs/layout/usace-box">
38
- <li>
39
- USACE Box - A container with a header and the red and gray
40
- flourish on top.
41
- </li>
42
- </a>
43
- </ul>
44
- </p>
45
- </div>
46
- </UsaceBox>
47
- </DocsPage>
48
- );
49
- }
50
-
51
- export default Layout;
52
- export { Layout };