@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,219 +0,0 @@
1
- import { Button as HeadlessButton } from "@headlessui/react";
2
- import { clsx } from "clsx";
3
- import React from "react";
4
- import { Link } from "./link";
5
-
6
- const styles = {
7
- base: [
8
- // Base
9
- "relative isolate inline-flex items-center justify-center gap-x-2 rounded-lg border text-base/6 font-semibold",
10
-
11
- // Sizing
12
- "px-[calc(theme(spacing[3.5])-1px)] py-[calc(theme(spacing[2.5])-1px)] sm:px-[calc(theme(spacing.3)-1px)] sm:py-[calc(theme(spacing[1.5])-1px)] sm:text-sm/6",
13
-
14
- // Focus
15
- "focus:outline-none data-[focus]:outline data-[focus]:outline-2 data-[focus]:outline-offset-2 data-[focus]:outline-blue-500",
16
-
17
- // Disabled
18
- "data-[disabled]:opacity-50",
19
-
20
- // Icon
21
- "[&>[data-slot=icon]]:-mx-0.5 [&>[data-slot=icon]]:my-0.5 [&>[data-slot=icon]]:size-5 [&>[data-slot=icon]]:shrink-0 [&>[data-slot=icon]]:text-[--btn-icon] [&>[data-slot=icon]]:sm:my-1 [&>[data-slot=icon]]:sm:size-4 forced-colors:[--btn-icon:ButtonText] forced-colors:data-[hover]:[--btn-icon:ButtonText]",
22
- ],
23
- solid: [
24
- // Optical border, implemented as the button background to avoid corner artifacts
25
- "border-transparent bg-[--btn-border]",
26
-
27
- // Dark mode: border is rendered on `after` so background is set to button background
28
- "dark:bg-[--btn-bg]",
29
-
30
- // Button background, implemented as foreground layer to stack on top of pseudo-border layer
31
- "before:absolute before:inset-0 before:-z-10 before:rounded-[calc(theme(borderRadius.lg)-1px)] before:bg-[--btn-bg]",
32
-
33
- // Drop shadow, applied to the inset `before` layer so it blends with the border
34
- "before:shadow",
35
-
36
- // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
37
- "dark:before:hidden",
38
-
39
- // Dark mode: Subtle white outline is applied using a border
40
- "dark:border-white/5",
41
-
42
- // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow
43
- "after:absolute after:inset-0 after:-z-10 after:rounded-[calc(theme(borderRadius.lg)-1px)]",
44
-
45
- // Inner highlight shadow
46
- "after:shadow-[shadow:inset_0_1px_theme(colors.white/15%)]",
47
-
48
- // White overlay on hover
49
- "after:data-[active]:bg-[--btn-hover-overlay] after:data-[hover]:bg-[--btn-hover-overlay]",
50
-
51
- // Dark mode: `after` layer expands to cover entire button
52
- "dark:after:-inset-px dark:after:rounded-lg",
53
-
54
- // Disabled
55
- "before:data-[disabled]:shadow-none after:data-[disabled]:shadow-none",
56
- ],
57
- outline: [
58
- // Base
59
- "border-zinc-950/10 text-zinc-950 data-[active]:bg-zinc-950/[2.5%] data-[hover]:bg-zinc-950/[2.5%]",
60
-
61
- // Dark mode
62
- "dark:border-white/15 dark:text-white dark:[--btn-bg:transparent] dark:data-[active]:bg-white/5 dark:data-[hover]:bg-white/5",
63
-
64
- // Icon
65
- "[--btn-icon:theme(colors.zinc.500)] data-[active]:[--btn-icon:theme(colors.zinc.700)] data-[hover]:[--btn-icon:theme(colors.zinc.700)] dark:data-[active]:[--btn-icon:theme(colors.zinc.400)] dark:data-[hover]:[--btn-icon:theme(colors.zinc.400)]",
66
- ],
67
- plain: [
68
- // Base
69
- "border-transparent text-zinc-950 data-[active]:bg-zinc-950/5 data-[hover]:bg-zinc-950/5",
70
-
71
- // Dark mode
72
- "dark:text-white dark:data-[active]:bg-white/10 dark:data-[hover]:bg-white/10",
73
-
74
- // Icon
75
- "[--btn-icon:theme(colors.zinc.500)] data-[active]:[--btn-icon:theme(colors.zinc.700)] data-[hover]:[--btn-icon:theme(colors.zinc.700)] dark:[--btn-icon:theme(colors.zinc.500)] dark:data-[active]:[--btn-icon:theme(colors.zinc.400)] dark:data-[hover]:[--btn-icon:theme(colors.zinc.400)]",
76
- ],
77
- colors: {
78
- "dark/zinc": [
79
- "text-white [--btn-bg:theme(colors.zinc.900)] [--btn-border:theme(colors.zinc.950/90%)] [--btn-hover-overlay:theme(colors.white/10%)]",
80
- "dark:text-white dark:[--btn-bg:theme(colors.zinc.600)] dark:[--btn-hover-overlay:theme(colors.white/5%)]",
81
- "[--btn-icon:theme(colors.zinc.400)] data-[active]:[--btn-icon:theme(colors.zinc.300)] data-[hover]:[--btn-icon:theme(colors.zinc.300)]",
82
- ],
83
- light: [
84
- "text-zinc-950 [--btn-bg:white] [--btn-border:theme(colors.zinc.950/10%)] [--btn-hover-overlay:theme(colors.zinc.950/2.5%)] data-[active]:[--btn-border:theme(colors.zinc.950/15%)] data-[hover]:[--btn-border:theme(colors.zinc.950/15%)]",
85
- "dark:text-white dark:[--btn-hover-overlay:theme(colors.white/5%)] dark:[--btn-bg:theme(colors.zinc.800)]",
86
- "[--btn-icon:theme(colors.zinc.500)] data-[active]:[--btn-icon:theme(colors.zinc.700)] data-[hover]:[--btn-icon:theme(colors.zinc.700)] dark:[--btn-icon:theme(colors.zinc.500)] dark:data-[active]:[--btn-icon:theme(colors.zinc.400)] dark:data-[hover]:[--btn-icon:theme(colors.zinc.400)]",
87
- ],
88
- "dark/white": [
89
- "text-white [--btn-bg:theme(colors.zinc.900)] [--btn-border:theme(colors.zinc.950/90%)] [--btn-hover-overlay:theme(colors.white/10%)]",
90
- "dark:text-zinc-950 dark:[--btn-bg:white] dark:[--btn-hover-overlay:theme(colors.zinc.950/5%)]",
91
- "[--btn-icon:theme(colors.zinc.400)] data-[active]:[--btn-icon:theme(colors.zinc.300)] data-[hover]:[--btn-icon:theme(colors.zinc.300)] dark:[--btn-icon:theme(colors.zinc.500)] dark:data-[active]:[--btn-icon:theme(colors.zinc.400)] dark:data-[hover]:[--btn-icon:theme(colors.zinc.400)]",
92
- ],
93
- dark: [
94
- "text-white [--btn-bg:theme(colors.zinc.900)] [--btn-border:theme(colors.zinc.950/90%)] [--btn-hover-overlay:theme(colors.white/10%)]",
95
- "dark:[--btn-hover-overlay:theme(colors.white/5%)] dark:[--btn-bg:theme(colors.zinc.800)]",
96
- "[--btn-icon:theme(colors.zinc.400)] data-[active]:[--btn-icon:theme(colors.zinc.300)] data-[hover]:[--btn-icon:theme(colors.zinc.300)]",
97
- ],
98
- white: [
99
- "text-zinc-950 [--btn-bg:white] [--btn-border:theme(colors.zinc.950/10%)] [--btn-hover-overlay:theme(colors.zinc.950/2.5%)] data-[active]:[--btn-border:theme(colors.zinc.950/15%)] data-[hover]:[--btn-border:theme(colors.zinc.950/15%)]",
100
- "dark:[--btn-hover-overlay:theme(colors.zinc.950/5%)]",
101
- "[--btn-icon:theme(colors.zinc.400)] data-[active]:[--btn-icon:theme(colors.zinc.500)] data-[hover]:[--btn-icon:theme(colors.zinc.500)]",
102
- ],
103
- zinc: [
104
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.zinc.600)] [--btn-border:theme(colors.zinc.700/90%)]",
105
- "dark:[--btn-hover-overlay:theme(colors.white/5%)]",
106
- "[--btn-icon:theme(colors.zinc.400)] data-[active]:[--btn-icon:theme(colors.zinc.300)] data-[hover]:[--btn-icon:theme(colors.zinc.300)]",
107
- ],
108
- indigo: [
109
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.indigo.500)] [--btn-border:theme(colors.indigo.600/90%)]",
110
- "[--btn-icon:theme(colors.indigo.300)] data-[active]:[--btn-icon:theme(colors.indigo.200)] data-[hover]:[--btn-icon:theme(colors.indigo.200)]",
111
- ],
112
- cyan: [
113
- "text-cyan-950 [--btn-bg:theme(colors.cyan.300)] [--btn-border:theme(colors.cyan.400/80%)] [--btn-hover-overlay:theme(colors.white/25%)]",
114
- "[--btn-icon:theme(colors.cyan.500)]",
115
- ],
116
- red: [
117
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.red.600)] [--btn-border:theme(colors.red.700/90%)]",
118
- "[--btn-icon:theme(colors.red.300)] data-[active]:[--btn-icon:theme(colors.red.200)] data-[hover]:[--btn-icon:theme(colors.red.200)]",
119
- ],
120
- orange: [
121
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.orange.500)] [--btn-border:theme(colors.orange.600/90%)]",
122
- "[--btn-icon:theme(colors.orange.300)] data-[active]:[--btn-icon:theme(colors.orange.200)] data-[hover]:[--btn-icon:theme(colors.orange.200)]",
123
- ],
124
- amber: [
125
- "text-amber-950 [--btn-hover-overlay:theme(colors.white/25%)] [--btn-bg:theme(colors.amber.400)] [--btn-border:theme(colors.amber.500/80%)]",
126
- "[--btn-icon:theme(colors.amber.600)]",
127
- ],
128
- yellow: [
129
- "text-yellow-950 [--btn-hover-overlay:theme(colors.white/25%)] [--btn-bg:theme(colors.yellow.300)] [--btn-border:theme(colors.yellow.400/80%)]",
130
- "[--btn-icon:theme(colors.yellow.600)] data-[active]:[--btn-icon:theme(colors.yellow.700)] data-[hover]:[--btn-icon:theme(colors.yellow.700)]",
131
- ],
132
- lime: [
133
- "text-lime-950 [--btn-hover-overlay:theme(colors.white/25%)] [--btn-bg:theme(colors.lime.300)] [--btn-border:theme(colors.lime.400/80%)]",
134
- "[--btn-icon:theme(colors.lime.600)] data-[active]:[--btn-icon:theme(colors.lime.700)] data-[hover]:[--btn-icon:theme(colors.lime.700)]",
135
- ],
136
- green: [
137
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.green.600)] [--btn-border:theme(colors.green.700/90%)]",
138
- "[--btn-icon:theme(colors.white/60%)] data-[active]:[--btn-icon:theme(colors.white/80%)] data-[hover]:[--btn-icon:theme(colors.white/80%)]",
139
- ],
140
- emerald: [
141
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.emerald.600)] [--btn-border:theme(colors.emerald.700/90%)]",
142
- "[--btn-icon:theme(colors.white/60%)] data-[active]:[--btn-icon:theme(colors.white/80%)] data-[hover]:[--btn-icon:theme(colors.white/80%)]",
143
- ],
144
- teal: [
145
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.teal.600)] [--btn-border:theme(colors.teal.700/90%)]",
146
- "[--btn-icon:theme(colors.white/60%)] data-[active]:[--btn-icon:theme(colors.white/80%)] data-[hover]:[--btn-icon:theme(colors.white/80%)]",
147
- ],
148
- sky: [
149
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.sky.500)] [--btn-border:theme(colors.sky.600/80%)]",
150
- "[--btn-icon:theme(colors.white/60%)] data-[active]:[--btn-icon:theme(colors.white/80%)] data-[hover]:[--btn-icon:theme(colors.white/80%)]",
151
- ],
152
- blue: [
153
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.blue.600)] [--btn-border:theme(colors.blue.700/90%)]",
154
- "[--btn-icon:theme(colors.blue.400)] data-[active]:[--btn-icon:theme(colors.blue.300)] data-[hover]:[--btn-icon:theme(colors.blue.300)]",
155
- ],
156
- violet: [
157
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.violet.500)] [--btn-border:theme(colors.violet.600/90%)]",
158
- "[--btn-icon:theme(colors.violet.300)] data-[active]:[--btn-icon:theme(colors.violet.200)] data-[hover]:[--btn-icon:theme(colors.violet.200)]",
159
- ],
160
- purple: [
161
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.purple.500)] [--btn-border:theme(colors.purple.600/90%)]",
162
- "[--btn-icon:theme(colors.purple.300)] data-[active]:[--btn-icon:theme(colors.purple.200)] data-[hover]:[--btn-icon:theme(colors.purple.200)]",
163
- ],
164
- fuchsia: [
165
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.fuchsia.500)] [--btn-border:theme(colors.fuchsia.600/90%)]",
166
- "[--btn-icon:theme(colors.fuchsia.300)] data-[active]:[--btn-icon:theme(colors.fuchsia.200)] data-[hover]:[--btn-icon:theme(colors.fuchsia.200)]",
167
- ],
168
- pink: [
169
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.pink.500)] [--btn-border:theme(colors.pink.600/90%)]",
170
- "[--btn-icon:theme(colors.pink.300)] data-[active]:[--btn-icon:theme(colors.pink.200)] data-[hover]:[--btn-icon:theme(colors.pink.200)]",
171
- ],
172
- rose: [
173
- "text-white [--btn-hover-overlay:theme(colors.white/10%)] [--btn-bg:theme(colors.rose.500)] [--btn-border:theme(colors.rose.600/90%)]",
174
- "[--btn-icon:theme(colors.rose.300)] data-[active]:[--btn-icon:theme(colors.rose.200)] data-[hover]:[--btn-icon:theme(colors.rose.200)]",
175
- ],
176
- },
177
- };
178
-
179
- export const Button = React.forwardRef(function Button(
180
- { color, outline, plain, className, children, ...props },
181
- ref
182
- ) {
183
- let classes = clsx(
184
- styles.base,
185
- outline
186
- ? styles.outline
187
- : plain
188
- ? styles.plain
189
- : clsx(styles.solid, styles.colors[color ?? "dark/zinc"]),
190
- className
191
- );
192
-
193
- return "href" in props ? (
194
- <Link {...props} className={classes} ref={ref}>
195
- <TouchTarget>{children}</TouchTarget>
196
- </Link>
197
- ) : (
198
- <HeadlessButton
199
- {...props}
200
- className={clsx(classes, "cursor-default")}
201
- ref={ref}
202
- >
203
- <TouchTarget>{children}</TouchTarget>
204
- </HeadlessButton>
205
- );
206
- });
207
-
208
- /* Expand the hit area to at least 44×44px on touch devices */
209
- export function TouchTarget({ children }) {
210
- return (
211
- <>
212
- {children}
213
- <span
214
- className="absolute left-1/2 top-1/2 size-[max(100%,2.75rem)] -translate-x-1/2 -translate-y-1/2 [@media(pointer:fine)]:hidden"
215
- aria-hidden="true"
216
- />
217
- </>
218
- );
219
- }
@@ -1,39 +0,0 @@
1
- import clsx from "clsx";
2
-
3
- function H1({ className, children, ...props }) {
4
- const cls = clsx("text-3xl font-bold", className);
5
- return (
6
- <h1 className={cls} {...props}>
7
- {children}
8
- </h1>
9
- );
10
- }
11
-
12
- function H2({ className, children, ...props }) {
13
- const cls = clsx("text-2xl font-bold", className);
14
- return (
15
- <h2 className={cls} {...props}>
16
- {children}
17
- </h2>
18
- );
19
- }
20
-
21
- function H3({ className, children, ...props }) {
22
- const cls = clsx("text-xl font-bold", className);
23
- return (
24
- <h3 className={cls} {...props}>
25
- {children}
26
- </h3>
27
- );
28
- }
29
-
30
- function H4({ className, children, ...props }) {
31
- const cls = clsx("text-lg font-bold", className);
32
- return (
33
- <h4 className={cls} {...props}>
34
- {children}
35
- </h4>
36
- );
37
- }
38
-
39
- export { H1, H2, H3, H4 };
@@ -1,48 +0,0 @@
1
- import { clsx } from "clsx";
2
- import { Link } from "../link";
3
-
4
- export function Text({ className, ...props }) {
5
- return (
6
- <p
7
- {...props}
8
- data-slot="text"
9
- className={clsx(
10
- className,
11
- "text-base/6 text-zinc-500 sm:text-sm/6 dark:text-zinc-400"
12
- )}
13
- />
14
- );
15
- }
16
-
17
- export function TextLink({ className, ...props }) {
18
- return (
19
- <Link
20
- {...props}
21
- className={clsx(
22
- className,
23
- "text-zinc-950 underline decoration-zinc-950/50 data-[hover]:decoration-zinc-950 dark:text-white dark:decoration-white/50 dark:data-[hover]:decoration-white"
24
- )}
25
- />
26
- );
27
- }
28
-
29
- export function Strong({ className, ...props }) {
30
- return (
31
- <strong
32
- {...props}
33
- className={clsx(className, "font-medium text-zinc-950 dark:text-white")}
34
- />
35
- );
36
- }
37
-
38
- export function Code({ className, ...props }) {
39
- return (
40
- <code
41
- {...props}
42
- className={clsx(
43
- className,
44
- "rounded border border-zinc-950/10 bg-zinc-950/[2.5%] px-0.5 text-sm font-medium text-zinc-950 sm:text-[0.8125rem] dark:border-white/20 dark:bg-white/5 dark:text-white"
45
- )}
46
- />
47
- );
48
- }
@@ -1,51 +0,0 @@
1
- import { Container } from "./layout/container";
2
- /**
3
- * @name Hero
4
- * @description A full width, full height hero component with a title, subtitle, and optional image.
5
- * @param {string} title - The title of the hero.
6
- * @param {string} subtitle - The subtitle of the hero.
7
- * @param {string} image - The image to display in the hero.
8
- * @param {string} alt - The alt text for the image.
9
- * @param {ReactNode} children - Custom children to display in the hero.
10
- * @example
11
- * <Hero
12
- * title="Groundwork"
13
- * subtitle="React Component Library"
14
- * image="/nww-lucky-peak-dam.jpg"
15
- * alt="Lucky Peak Dam"
16
- * >
17
- */
18
- function Hero({ title, subtitle, image, alt, children }) {
19
- return (
20
- <div className="relative">
21
- <div className="h-56 w-full overflow-clip bg-zinc-950 md:h-1/5 md:max-h-[500px]">
22
- <img
23
- src={image}
24
- alt={alt}
25
- className="object-cover object-center w-full h-full"
26
- />
27
- </div>
28
- <div className="absolute inset-0 bg-zinc-950/50" />
29
- {children && (
30
- <div className="absolute inset-0 flex items-center justify-center">
31
- {children}
32
- </div>
33
- )}
34
- {title && (
35
- <Container className="relative">
36
- <div className="absolute bottom-0 left-0 max-w-7xl mx-auto px-4">
37
- <div className="pb-8">
38
- <h1 className="text-4xl font-extrabold tracking-tight text-white sm:text-5xl lg:text-6xl">
39
- {title}
40
- </h1>
41
- <p className="mt-1 text-xl text-zinc-200">{subtitle}</p>
42
- </div>
43
- </div>
44
- </Container>
45
- )}
46
- </div>
47
- );
48
- }
49
-
50
- export default Hero;
51
- export { Hero };
@@ -1,13 +0,0 @@
1
- import clsx from "clsx";
2
-
3
- function Container({ className, children, fluid }) {
4
- const containerClass = clsx(
5
- "w-full mx-auto px-4 box-border",
6
- fluid ? "max-w-full" : "max-w-[1140px]",
7
- className
8
- );
9
- return <div className={containerClass}>{children}</div>;
10
- }
11
-
12
- export default Container;
13
- export { Container };
@@ -1,26 +0,0 @@
1
- import clsx from "clsx";
2
-
3
- function UsaceBox({ children, className, title, customTitle }) {
4
- const CustomTitle = customTitle;
5
- const boxClass = "mb-10 relative";
6
- const beforeClass =
7
- "before:block before:bg-usace-box-light-gray before:h-8 before:mb-[-12px] before:w-full";
8
- const afterClass =
9
- "after:block after:absolute after:top-0 after:left-0 after:bg-usace-box-red after:h-[5px] after:w-[50px] after:z-[2]";
10
-
11
- return (
12
- <div className={clsx(className, boxClass, beforeClass, afterClass)}>
13
- <h2
14
- style={{ fontSize: "1.3rem", lineHeight: "1.4rem" }}
15
- className="font-bold mb-6"
16
- >
17
- {title}
18
- {CustomTitle && <CustomTitle />}
19
- </h2>
20
- {children}
21
- </div>
22
- );
23
- }
24
-
25
- export default UsaceBox;
26
- export { UsaceBox };
@@ -1,18 +0,0 @@
1
- /*
2
- TODO: Update this component to use your client-side framework's link
3
- component. We've provided examples of how to do this for Next.js,
4
- Remix, and Inertia.js in the Catalyst documentation:
5
-
6
- https://catalyst.tailwindui.com/docs#client-side-router-integration
7
- */
8
-
9
- import { DataInteractive as HeadlessDataInteractive } from '@headlessui/react'
10
- import React from 'react'
11
-
12
- export const Link = React.forwardRef(function Link(props, ref) {
13
- return (
14
- <HeadlessDataInteractive>
15
- <a {...props} ref={ref} />
16
- </HeadlessDataInteractive>
17
- )
18
- })
@@ -1,146 +0,0 @@
1
- "use client";
2
-
3
- import { clsx } from "clsx";
4
- import { createContext, useContext, useState } from "react";
5
- import { Link } from "./link";
6
-
7
- const TableContext = createContext({
8
- bleed: false,
9
- dense: false,
10
- grid: false,
11
- striped: false,
12
- });
13
-
14
- export function Table({
15
- bleed = false,
16
- dense = false,
17
- grid = false,
18
- striped = false,
19
- className,
20
- children,
21
- ...props
22
- }) {
23
- return (
24
- <TableContext.Provider value={{ bleed, dense, grid, striped }}>
25
- <div className="flow-root">
26
- <div
27
- {...props}
28
- className={clsx(
29
- className,
30
- "-mx-[--gutter] overflow-x-auto whitespace-nowrap"
31
- )}
32
- >
33
- <div
34
- className={clsx(
35
- "inline-block min-w-full align-middle",
36
- !bleed && "sm:px-[--gutter]"
37
- )}
38
- >
39
- <table className="min-w-full text-left text-sm/6">{children}</table>
40
- </div>
41
- </div>
42
- </div>
43
- </TableContext.Provider>
44
- );
45
- }
46
-
47
- export function TableHead({ className, ...props }) {
48
- return (
49
- <thead
50
- className={clsx(className, "text-zinc-500 dark:text-zinc-400")}
51
- {...props}
52
- />
53
- );
54
- }
55
-
56
- export function TableBody(props) {
57
- return <tbody {...props} />;
58
- }
59
-
60
- const TableRowContext = createContext({
61
- href: undefined,
62
- target: undefined,
63
- title: undefined,
64
- });
65
-
66
- export function TableRow({
67
- href,
68
- target,
69
- title,
70
- className,
71
- children,
72
- ...props
73
- }) {
74
- let { striped } = useContext(TableContext);
75
-
76
- return (
77
- <TableRowContext.Provider value={{ href, target, title }}>
78
- <tr
79
- {...props}
80
- className={clsx(
81
- className,
82
- href &&
83
- "has-[[data-row-link][data-focus]]:outline has-[[data-row-link][data-focus]]:outline-2 has-[[data-row-link][data-focus]]:-outline-offset-2 has-[[data-row-link][data-focus]]:outline-blue-500 dark:focus-within:bg-white/[2.5%]",
84
- striped && "even:bg-zinc-950/[2.5%] dark:even:bg-white/[2.5%]",
85
- href && striped && "hover:bg-zinc-950/5 dark:hover:bg-white/5",
86
- href &&
87
- !striped &&
88
- "hover:bg-zinc-950/[2.5%] dark:hover:bg-white/[2.5%]"
89
- )}
90
- >
91
- {children}
92
- </tr>
93
- </TableRowContext.Provider>
94
- );
95
- }
96
-
97
- export function TableHeader({ className, ...props }) {
98
- let { bleed, grid } = useContext(TableContext);
99
-
100
- return (
101
- <th
102
- {...props}
103
- className={clsx(
104
- className,
105
- "border-b border-b-zinc-950/10 px-4 py-2 font-medium first:pl-[var(--gutter,theme(spacing.2))] last:pr-[var(--gutter,theme(spacing.2))] dark:border-b-white/10",
106
- grid &&
107
- "border-l border-l-zinc-950/5 first:border-l-0 dark:border-l-white/5",
108
- !bleed && "sm:first:pl-2 sm:last:pr-2"
109
- )}
110
- />
111
- );
112
- }
113
-
114
- export function TableCell({ className, children, ...props }) {
115
- let { bleed, dense, grid, striped } = useContext(TableContext);
116
- let { href, target, title } = useContext(TableRowContext);
117
- let [cellRef, setCellRef] = useState(null);
118
-
119
- return (
120
- <td
121
- ref={href ? setCellRef : undefined}
122
- {...props}
123
- className={clsx(
124
- className,
125
- "relative px-4 first:pl-[var(--gutter,theme(spacing.2))] last:pr-[var(--gutter,theme(spacing.2))]",
126
- !striped && "border-b border-zinc-950/5 dark:border-white/5",
127
- grid &&
128
- "border-l border-l-zinc-950/5 first:border-l-0 dark:border-l-white/5",
129
- dense ? "py-2.5" : "py-4",
130
- !bleed && "sm:first:pl-2 sm:last:pr-2"
131
- )}
132
- >
133
- {href && (
134
- <Link
135
- data-row-link
136
- href={href}
137
- target={target}
138
- aria-label={title}
139
- tabIndex={cellRef?.previousElementSibling === null ? 0 : -1}
140
- className="absolute inset-0 focus:outline-none"
141
- />
142
- )}
143
- {children}
144
- </td>
145
- );
146
- }
@@ -1,12 +0,0 @@
1
- const base = import.meta.env.BASE_URL;
2
-
3
- function Essayons() {
4
- return (
5
- <div
6
- className={`absolute bottom-[56px] left-[50%] h-[125px] w-[112px] ml-[-56px] bg-[url(${base}essayonscrest.png)]`}
7
- />
8
- );
9
- }
10
-
11
- export default Essayons;
12
- export { Essayons };
@@ -1,33 +0,0 @@
1
- function FooterLinks({ links = [], columnCount = 2 }) {
2
- return (
3
- <ul
4
- className="list-none"
5
- style={{
6
- columnCount: columnCount,
7
- columnGap: "40px",
8
- margin: 0,
9
- padding: "0 0 0 2px",
10
- }}
11
- >
12
- {links.map((link, i) => {
13
- const target = link.href.startsWith("http") ? "_blank" : "";
14
- const rel = link.href.startsWith("http") ? "noopener noreferrer" : "";
15
- return (
16
- <li key={link.text + i} className="mb-2">
17
- <a
18
- href={link.href}
19
- target={target}
20
- rel={rel}
21
- className="hover:underline"
22
- >
23
- {link.text}
24
- </a>
25
- </li>
26
- );
27
- })}
28
- </ul>
29
- );
30
- }
31
-
32
- export default FooterLinks;
33
- export { FooterLinks };