@nationaldesignstudio/react 0.6.0 → 0.7.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/dist/accordion/index.d.ts +95 -0
- package/dist/accordion/index.js +143 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/background/index.d.ts +149 -0
- package/dist/background/index.js +200 -0
- package/dist/background/index.js.map +1 -0
- package/dist/banner/index.d.ts +101 -0
- package/dist/banner/index.js +81 -0
- package/dist/banner/index.js.map +1 -0
- package/dist/blurred-video-backdrop/index.d.ts +233 -0
- package/dist/blurred-video-backdrop/index.js +266 -0
- package/dist/blurred-video-backdrop/index.js.map +1 -0
- package/dist/button/index.d.ts +180 -0
- package/dist/button/index.js +169 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button-B2g5fH9b.d.ts +152 -0
- package/dist/card/index.d.ts +406 -0
- package/dist/card/index.js +219 -0
- package/dist/card/index.js.map +1 -0
- package/dist/card-grid/index.d.ts +90 -0
- package/dist/card-grid/index.js +74 -0
- package/dist/card-grid/index.js.map +1 -0
- package/dist/component-registry.md +136 -2
- package/dist/dev-toolbar/index.d.ts +8 -0
- package/dist/dev-toolbar/index.js +206 -0
- package/dist/dev-toolbar/index.js.map +1 -0
- package/dist/dialog/index.d.ts +268 -0
- package/dist/dialog/index.js +288 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/faq-section/index.d.ts +47 -0
- package/dist/faq-section/index.js +152 -0
- package/dist/faq-section/index.js.map +1 -0
- package/dist/grid-overlay/index.d.ts +10 -0
- package/dist/grid-overlay/index.js +38 -0
- package/dist/grid-overlay/index.js.map +1 -0
- package/dist/hero/index.d.ts +462 -0
- package/dist/hero/index.js +494 -0
- package/dist/hero/index.js.map +1 -0
- package/dist/hooks/index.d.ts +150 -0
- package/dist/hooks/index.js +339 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +46 -5339
- package/dist/index.js +157 -4080
- package/dist/index.js.map +1 -1
- package/dist/input/index.d.ts +404 -0
- package/dist/input/index.js +393 -0
- package/dist/input/index.js.map +1 -0
- package/dist/navbar/index.d.ts +68 -0
- package/dist/navbar/index.js +227 -0
- package/dist/navbar/index.js.map +1 -0
- package/dist/ndstudio-footer/index.d.ts +32 -0
- package/dist/ndstudio-footer/index.js +35 -0
- package/dist/ndstudio-footer/index.js.map +1 -0
- package/dist/pager-control/index.d.ts +173 -0
- package/dist/pager-control/index.js +267 -0
- package/dist/pager-control/index.js.map +1 -0
- package/dist/popover/index.d.ts +200 -0
- package/dist/popover/index.js +290 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/prose/index.d.ts +39 -0
- package/dist/prose/index.js +56 -0
- package/dist/prose/index.js.map +1 -0
- package/dist/quote-block/index.d.ts +156 -0
- package/dist/quote-block/index.js +321 -0
- package/dist/quote-block/index.js.map +1 -0
- package/dist/river/index.d.ts +100 -0
- package/dist/river/index.js +107 -0
- package/dist/river/index.js.map +1 -0
- package/dist/select/index.d.ts +188 -0
- package/dist/select/index.js +295 -0
- package/dist/select/index.js.map +1 -0
- package/dist/theme/index.d.ts +149 -0
- package/dist/theme/index.js +211 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme-CzBPUlh_.d.ts +332 -0
- package/dist/tooltip/index.d.ts +166 -0
- package/dist/tooltip/index.js +200 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tout/index.d.ts +157 -0
- package/dist/tout/index.js +315 -0
- package/dist/tout/index.js.map +1 -0
- package/dist/two-column-section/index.d.ts +122 -0
- package/dist/two-column-section/index.js +121 -0
- package/dist/two-column-section/index.js.map +1 -0
- package/dist/us-gov-banner/index.d.ts +141 -0
- package/dist/us-gov-banner/index.js +74 -0
- package/dist/us-gov-banner/index.js.map +1 -0
- package/dist/use-captions-AkKlJhov.d.ts +71 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/video-dialog/index.d.ts +106 -0
- package/dist/video-dialog/index.js +1305 -0
- package/dist/video-dialog/index.js.map +1 -0
- package/dist/video-player/index.d.ts +115 -0
- package/dist/video-player/index.js +879 -0
- package/dist/video-player/index.js.map +1 -0
- package/dist/video-player-qxf-BURH.d.ts +236 -0
- package/dist/video-with-backdrop/index.d.ts +267 -0
- package/dist/video-with-backdrop/index.js +1284 -0
- package/dist/video-with-backdrop/index.js.map +1 -0
- package/package.json +13 -2
- package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +5 -27
- package/src/theme/hooks.ts +2 -0
- package/src/theme/index.ts +2 -0
- package/src/theme/theme-provider.tsx +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/sections/two-column-section/two-column-section.tsx"],"names":["twMerge"],"mappings":";;;;;;AAKO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAOA,MAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACMA,IAAM,2BAA2B,EAAA,CAAG;AAAA;AAAA,EAEnC,IAAA,EAAM;AAAA,IACL,QAAA;AAAA;AAAA,IAEA,mBAAA;AAAA;AAAA,IAEA,mBAAA;AAAA;AAAA,IAEA;AAAA,GACD;AAAA,EACA,QAAA,EAAU;AAAA,IACT,WAAA,EAAa;AAAA,MACZ,IAAA,EAAM,cAAA;AAAA,MACN,KAAA,EAAO;AAAA,KACR;AAAA,IACA,MAAA,EAAQ;AAAA,MACP,UAAA,EAAY,EAAA;AAAA,MACZ,KAAA,EAAO;AAAA;AACR,GACD;AAAA,EACA,eAAA,EAAiB;AAAA,IAChB,WAAA,EAAa,MAAA;AAAA,IACb,MAAA,EAAQ;AAAA;AAEV,CAAC;AA8CD,IAAM,gBAAA,GAAyB,KAAA,CAAA,UAAA;AAAA,EAC9B,CACC;AAAA,IACC,SAAA;AAAA,IACA,WAAA,GAAc,MAAA;AAAA,IACd,MAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,GAAG;AAAA,KAEJ,GAAA,KACI;AACJ,IAAA,uBACC,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACA,GAAA;AAAA,QACA,WAAW,wBAAA,CAAyB;AAAA,UACnC,WAAA;AAAA,UACA,MAAA;AAAA,UACA,KAAA,EAAO;AAAA,SACP,CAAA;AAAA,QACA,GAAG,KAAA;AAAA,QAGJ,QAAA,kBAAA,IAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACA,SAAA,EAAW,EAAA;AAAA,cACV,gBAAA;AAAA,cACA,WAAA,KAAgB,SAAS,iBAAA,GAAoB,iBAAA;AAAA;AAAA,cAE7C,yBAAA;AAAA,cACA,MAAA,KAAW,UAAU,gBAAA,GAAmB;AAAA,aACzC;AAAA,YAGA,QAAA,EAAA;AAAA,8BAAA,GAAA;AAAA,gBAAC,IAAA;AAAA,gBAAA;AAAA,kBACA,SAAA,EAAW,EAAA;AAAA,oBACV,8BAAA;AAAA,oBACA,WAAA,KAAgB,SAAS,eAAA,GAAkB,eAAA;AAAA;AAAA,oBAE3C,WAAW,OAAA,IAAW;AAAA,mBACvB;AAAA,kBAEC,QAAA,EAAA;AAAA;AAAA,eACF;AAAA,8BAGA,IAAA;AAAA,gBAAC,KAAA;AAAA,gBAAA;AAAA,kBACA,SAAA,EAAW,EAAA;AAAA,oBACV,sBAAA;AAAA,oBACA,WAAW,OAAA,IAAW;AAAA,mBACvB;AAAA,kBAGC,QAAA,EAAA;AAAA,oBAAA,IAAA,oBACA,GAAA;AAAA,sBAAC,KAAA;AAAA,sBAAA;AAAA,wBACA,SAAA,EAAW,EAAA;AAAA,0BACV,uBAAA;AAAA,0BACA,WAAA,KAAgB,SAAS,eAAA,GAAkB;AAAA,yBAC5C;AAAA,wBAEC,iBAAO,IAAA,KAAS,QAAA,mBAAW,GAAA,CAAC,GAAA,EAAA,EAAG,gBAAK,CAAA,GAAO;AAAA;AAAA,qBAC7C;AAAA,oCAID,GAAA;AAAA,sBAAC,KAAA;AAAA,sBAAA;AAAA,wBACA,SAAA,EAAW,EAAA;AAAA,0BACV,gDAAA;AAAA,0BACA,WAAA,KAAgB,SAAS,eAAA,GAAkB;AAAA,yBAC5C;AAAA,wBAEC;AAAA;AAAA;AACF;AAAA;AAAA;AACD;AAAA;AAAA;AACD;AAAA,KACD;AAAA,EAEF;AACD;AACA,gBAAA,CAAiB,WAAA,GAAc,kBAAA","file":"index.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { cnBase as twMerge } from \"tailwind-variants\";\n\nexport { twMerge };\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * TwoColumnSection component for text-heavy content sections\n *\n * Layout:\n * - Desktop (lg+): Title left, content right with border-top divider\n * - Mobile/Tablet: Stacked vertically\n *\n * Uses the 24-column grid system.\n */\nconst twoColumnSectionVariants = tv({\n\t// Base styles - responsive padding using primitive spacing tokens\n\tbase: [\n\t\t\"w-full\",\n\t\t// Small (mobile): 20px x, 56px top, 20px bottom\n\t\t\"px-20 pt-56 pb-20\",\n\t\t// Medium (tablet): 56px x, 56px y\n\t\t\"md:px-56 md:py-56\",\n\t\t// Large (desktop): 72px x, 72px top, 112px bottom\n\t\t\"lg:px-72 lg:pt-72 lg:pb-112\",\n\t],\n\tvariants: {\n\t\tcolorScheme: {\n\t\t\tdark: \"bg-gray-1200\",\n\t\t\tlight: \"bg-white\",\n\t\t},\n\t\tlayout: {\n\t\t\tasymmetric: \"\",\n\t\t\tequal: \"\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tcolorScheme: \"dark\",\n\t\tlayout: \"asymmetric\",\n\t},\n});\n\nexport interface TwoColumnSectionProps\n\textends React.HTMLAttributes<HTMLElement>,\n\t\tVariantProps<typeof twoColumnSectionVariants> {\n\t/**\n\t * The title text displayed in the left column\n\t */\n\ttitle: string;\n\t/**\n\t * Lead content - prominently styled (brighter text)\n\t * Can be a string or ReactNode for rich content\n\t */\n\tlead?: React.ReactNode;\n\t/**\n\t * Body content - secondary styled (muted text)\n\t * Can be a string or ReactNode for rich content\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * Layout style for the columns\n\t * - \"asymmetric\" (default): Uses 24-column grid with ~40/60 split (title: 9, content: 15)\n\t * - \"equal\": Simple 2-column equal-width layout at md+ breakpoints\n\t */\n\tlayout?: \"asymmetric\" | \"equal\";\n}\n\n/**\n * TwoColumnSection component for text-heavy content with title/content split.\n *\n * Layout:\n * - Mobile/Tablet: Stacked (title above content)\n * - Desktop (lg+): Title left (~40%), Content right (~60%)\n *\n * @example\n * ```tsx\n * <TwoColumnSection\n * title=\"US Tech Force\"\n * lead=\"The US Tech Force is recruiting an elite corps of engineers...\"\n * variant=\"dark\"\n * >\n * <p>Through a two-year program, participants will work...</p>\n * <p>Upon completing the program, engineers can seek...</p>\n * </TwoColumnSection>\n * ```\n */\nconst TwoColumnSection = React.forwardRef<HTMLElement, TwoColumnSectionProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tcolorScheme = \"dark\",\n\t\t\tlayout,\n\t\t\ttitle,\n\t\t\tlead,\n\t\t\tchildren,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\treturn (\n\t\t\t<section\n\t\t\t\tref={ref}\n\t\t\t\tclassName={twoColumnSectionVariants({\n\t\t\t\t\tcolorScheme,\n\t\t\t\t\tlayout,\n\t\t\t\t\tclass: className,\n\t\t\t\t})}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{/* Inner container with border-top - uses primitive spacing tokens */}\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"border-t pt-36\",\n\t\t\t\t\t\tcolorScheme === \"dark\" ? \"border-gray-700\" : \"border-gray-300\",\n\t\t\t\t\t\t// Grid layout - uses primitive spacing tokens\n\t\t\t\t\t\t\"grid grid-cols-1 gap-56\",\n\t\t\t\t\t\tlayout === \"equal\" ? \"md:grid-cols-2\" : \"lg:grid-cols-24 lg:gap-56\",\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{/* Title column */}\n\t\t\t\t\t<h2\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"typography-subheading-medium\",\n\t\t\t\t\t\t\tcolorScheme === \"dark\" ? \"text-gray-100\" : \"text-gray-900\",\n\t\t\t\t\t\t\t// Column span based on layout\n\t\t\t\t\t\t\tlayout !== \"equal\" && \"lg:col-span-9\",\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</h2>\n\n\t\t\t\t\t{/* Content column - uses primitive spacing tokens */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"flex flex-col gap-56\",\n\t\t\t\t\t\t\tlayout !== \"equal\" && \"lg:col-span-15\",\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* Lead content - brighter/prominent */}\n\t\t\t\t\t\t{lead && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\"typography-body-large\",\n\t\t\t\t\t\t\t\t\tcolorScheme === \"dark\" ? \"text-gray-100\" : \"text-gray-900\",\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{typeof lead === \"string\" ? <p>{lead}</p> : lead}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{/* Body content - muted */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\"typography-body-medium flex flex-col gap-[1em]\",\n\t\t\t\t\t\t\t\tcolorScheme === \"dark\" ? \"text-gray-400\" : \"text-gray-600\",\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t);\n\t},\n);\nTwoColumnSection.displayName = \"TwoColumnSection\";\n\nexport { TwoColumnSection, twoColumnSectionVariants };\n"]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
|
|
6
|
+
declare const usGovBannerVariants: tailwind_variants.TVReturnType<{
|
|
7
|
+
variant: {
|
|
8
|
+
default: {
|
|
9
|
+
root: string;
|
|
10
|
+
content: string;
|
|
11
|
+
text: string;
|
|
12
|
+
};
|
|
13
|
+
inverted: {
|
|
14
|
+
root: string;
|
|
15
|
+
content: string;
|
|
16
|
+
text: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}, {
|
|
20
|
+
root: string;
|
|
21
|
+
content: string;
|
|
22
|
+
text: string;
|
|
23
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
24
|
+
variant: {
|
|
25
|
+
default: {
|
|
26
|
+
root: string;
|
|
27
|
+
content: string;
|
|
28
|
+
text: string;
|
|
29
|
+
};
|
|
30
|
+
inverted: {
|
|
31
|
+
root: string;
|
|
32
|
+
content: string;
|
|
33
|
+
text: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
variant: {
|
|
38
|
+
default: {
|
|
39
|
+
root: string;
|
|
40
|
+
content: string;
|
|
41
|
+
text: string;
|
|
42
|
+
};
|
|
43
|
+
inverted: {
|
|
44
|
+
root: string;
|
|
45
|
+
content: string;
|
|
46
|
+
text: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}>, {
|
|
50
|
+
variant: {
|
|
51
|
+
default: {
|
|
52
|
+
root: string;
|
|
53
|
+
content: string;
|
|
54
|
+
text: string;
|
|
55
|
+
};
|
|
56
|
+
inverted: {
|
|
57
|
+
root: string;
|
|
58
|
+
content: string;
|
|
59
|
+
text: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
root: string;
|
|
64
|
+
content: string;
|
|
65
|
+
text: string;
|
|
66
|
+
}, tailwind_variants.TVReturnType<{
|
|
67
|
+
variant: {
|
|
68
|
+
default: {
|
|
69
|
+
root: string;
|
|
70
|
+
content: string;
|
|
71
|
+
text: string;
|
|
72
|
+
};
|
|
73
|
+
inverted: {
|
|
74
|
+
root: string;
|
|
75
|
+
content: string;
|
|
76
|
+
text: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
root: string;
|
|
81
|
+
content: string;
|
|
82
|
+
text: string;
|
|
83
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
84
|
+
variant: {
|
|
85
|
+
default: {
|
|
86
|
+
root: string;
|
|
87
|
+
content: string;
|
|
88
|
+
text: string;
|
|
89
|
+
};
|
|
90
|
+
inverted: {
|
|
91
|
+
root: string;
|
|
92
|
+
content: string;
|
|
93
|
+
text: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
}, {
|
|
97
|
+
variant: {
|
|
98
|
+
default: {
|
|
99
|
+
root: string;
|
|
100
|
+
content: string;
|
|
101
|
+
text: string;
|
|
102
|
+
};
|
|
103
|
+
inverted: {
|
|
104
|
+
root: string;
|
|
105
|
+
content: string;
|
|
106
|
+
text: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
}>, unknown, unknown, undefined>>;
|
|
110
|
+
interface USGovBannerProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof usGovBannerVariants> {
|
|
111
|
+
/**
|
|
112
|
+
* Custom flag icon element. Defaults to a US flag SVG.
|
|
113
|
+
*/
|
|
114
|
+
flagIcon?: React.ReactNode;
|
|
115
|
+
/**
|
|
116
|
+
* Banner text content
|
|
117
|
+
* @default "An official website of the United States government"
|
|
118
|
+
*/
|
|
119
|
+
text?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* US Government official website banner.
|
|
123
|
+
* Displays the official government website notice with flag icon.
|
|
124
|
+
* Commonly placed at the very top of government websites.
|
|
125
|
+
*
|
|
126
|
+
* Variants:
|
|
127
|
+
* - default: Light background with dark text (for light pages)
|
|
128
|
+
* - inverted: Transparent background with white text/flag (for dark backgrounds/heroes)
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* // Default (light)
|
|
133
|
+
* <USGovBanner />
|
|
134
|
+
*
|
|
135
|
+
* // Inverted (for dark backgrounds)
|
|
136
|
+
* <USGovBanner variant="inverted" />
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
declare const USGovBanner: React.ForwardRefExoticComponent<USGovBannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
140
|
+
|
|
141
|
+
export { USGovBanner, type USGovBannerProps, usGovBannerVariants };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { tv } from 'tailwind-variants';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/components/organisms/us-gov-banner/us-gov-banner.tsx
|
|
6
|
+
var usGovBannerVariants = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
root: "flex w-full items-center justify-center py-12",
|
|
9
|
+
content: "flex items-center gap-8",
|
|
10
|
+
text: "text-[11px] leading-[13px] tracking-[0.17px]"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: {
|
|
15
|
+
root: "bg-gray-50",
|
|
16
|
+
content: "opacity-70",
|
|
17
|
+
text: "text-gray-900"
|
|
18
|
+
},
|
|
19
|
+
inverted: {
|
|
20
|
+
root: "bg-transparent",
|
|
21
|
+
content: "opacity-70",
|
|
22
|
+
text: "text-text-inverted"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var USGovBanner = React.forwardRef(
|
|
31
|
+
({
|
|
32
|
+
className,
|
|
33
|
+
variant,
|
|
34
|
+
flagIcon,
|
|
35
|
+
text = "An official website of the United States government",
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const styles = usGovBannerVariants({ variant });
|
|
39
|
+
return /* @__PURE__ */ jsx("div", { ref, className: styles.root({ class: className }), ...props, children: /* @__PURE__ */ jsxs("div", { className: styles.content(), children: [
|
|
40
|
+
flagIcon ?? /* @__PURE__ */ jsx(MonoUSFlag, {}),
|
|
41
|
+
/* @__PURE__ */ jsx("p", { className: styles.text(), children: text })
|
|
42
|
+
] }) });
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
USGovBanner.displayName = "USGovBanner";
|
|
46
|
+
function MonoUSFlag() {
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"svg",
|
|
49
|
+
{
|
|
50
|
+
width: "16",
|
|
51
|
+
height: "12",
|
|
52
|
+
viewBox: "0 0 16 12",
|
|
53
|
+
fill: "none",
|
|
54
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0H16V12H0V0Z", fill: "currentColor", fillOpacity: "0.1" }),
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
"path",
|
|
60
|
+
{
|
|
61
|
+
d: "M0 0H16V0.923077H0V0ZM0 1.84615H16V2.76923H0V1.84615ZM0 3.69231H16V4.61538H0V3.69231ZM0 5.53846H16V6.46154H0V5.53846ZM0 7.38462H16V8.30769H0V7.38462ZM0 9.23077H16V10.1538H0V9.23077ZM0 11.0769H16V12H0V11.0769Z",
|
|
62
|
+
fill: "currentColor",
|
|
63
|
+
fillOpacity: "0.8"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0H8V6.46154H0V0Z", fill: "currentColor", fillOpacity: "0.6" })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { USGovBanner, usGovBannerVariants };
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/organisms/us-gov-banner/us-gov-banner.tsx"],"names":[],"mappings":";;;;;AAGA,IAAM,sBAAsB,EAAA,CAAG;AAAA,EAC9B,KAAA,EAAO;AAAA,IACN,IAAA,EAAM,+CAAA;AAAA,IACN,OAAA,EAAS,yBAAA;AAAA,IACT,IAAA,EAAM;AAAA,GACP;AAAA,EACA,QAAA,EAAU;AAAA,IACT,OAAA,EAAS;AAAA,MACR,OAAA,EAAS;AAAA,QACR,IAAA,EAAM,YAAA;AAAA,QACN,OAAA,EAAS,YAAA;AAAA,QACT,IAAA,EAAM;AAAA,OACP;AAAA,MACA,QAAA,EAAU;AAAA,QACT,IAAA,EAAM,gBAAA;AAAA,QACN,OAAA,EAAS,YAAA;AAAA,QACT,IAAA,EAAM;AAAA;AACP;AACD,GACD;AAAA,EACA,eAAA,EAAiB;AAAA,IAChB,OAAA,EAAS;AAAA;AAEX,CAAC;AAkCD,IAAM,WAAA,GAAoB,KAAA,CAAA,UAAA;AAAA,EACzB,CACC;AAAA,IACC,SAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA,GAAO,qDAAA;AAAA,IACP,GAAG;AAAA,KAEJ,GAAA,KACI;AACJ,IAAA,MAAM,MAAA,GAAS,mBAAA,CAAoB,EAAE,OAAA,EAAS,CAAA;AAE9C,IAAA,2BACE,KAAA,EAAA,EAAI,GAAA,EAAU,WAAW,MAAA,CAAO,IAAA,CAAK,EAAE,KAAA,EAAO,SAAA,EAAW,CAAA,EAAI,GAAG,KAAA,EAChE,QAAA,kBAAA,IAAA,CAAC,SAAI,SAAA,EAAW,MAAA,CAAO,SAAQ,EAC7B,QAAA,EAAA;AAAA,MAAA,QAAA,wBAAa,UAAA,EAAA,EAAW,CAAA;AAAA,0BACxB,GAAA,EAAA,EAAE,SAAA,EAAW,MAAA,CAAO,IAAA,IAAS,QAAA,EAAA,IAAA,EAAK;AAAA,KAAA,EACpC,CAAA,EACD,CAAA;AAAA,EAEF;AACD;AACA,WAAA,CAAY,WAAA,GAAc,aAAA;AAE1B,SAAS,UAAA,GAAa;AACrB,EAAA,uBACC,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,KAAA,EAAM,IAAA;AAAA,MACN,MAAA,EAAO,IAAA;AAAA,MACP,OAAA,EAAQ,WAAA;AAAA,MACR,IAAA,EAAK,MAAA;AAAA,MACL,KAAA,EAAM,4BAAA;AAAA,MACN,aAAA,EAAY,MAAA;AAAA,MAEZ,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,UAAK,CAAA,EAAE,iBAAA,EAAkB,IAAA,EAAK,cAAA,EAAe,aAAY,KAAA,EAAM,CAAA;AAAA,wBAChE,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACA,CAAA,EAAE,kNAAA;AAAA,YACF,IAAA,EAAK,cAAA;AAAA,YACL,WAAA,EAAY;AAAA;AAAA,SACb;AAAA,4BACC,MAAA,EAAA,EAAK,CAAA,EAAE,uBAAsB,IAAA,EAAK,cAAA,EAAe,aAAY,KAAA,EAAM;AAAA;AAAA;AAAA,GACrE;AAEF","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nconst usGovBannerVariants = tv({\n\tslots: {\n\t\troot: \"flex w-full items-center justify-center py-12\",\n\t\tcontent: \"flex items-center gap-8\",\n\t\ttext: \"text-[11px] leading-[13px] tracking-[0.17px]\",\n\t},\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: {\n\t\t\t\troot: \"bg-gray-50\",\n\t\t\t\tcontent: \"opacity-70\",\n\t\t\t\ttext: \"text-gray-900\",\n\t\t\t},\n\t\t\tinverted: {\n\t\t\t\troot: \"bg-transparent\",\n\t\t\t\tcontent: \"opacity-70\",\n\t\t\t\ttext: \"text-text-inverted\",\n\t\t\t},\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"default\",\n\t},\n});\n\nexport interface USGovBannerProps\n\textends React.HTMLAttributes<HTMLDivElement>,\n\t\tVariantProps<typeof usGovBannerVariants> {\n\t/**\n\t * Custom flag icon element. Defaults to a US flag SVG.\n\t */\n\tflagIcon?: React.ReactNode;\n\t/**\n\t * Banner text content\n\t * @default \"An official website of the United States government\"\n\t */\n\ttext?: string;\n}\n\n/**\n * US Government official website banner.\n * Displays the official government website notice with flag icon.\n * Commonly placed at the very top of government websites.\n *\n * Variants:\n * - default: Light background with dark text (for light pages)\n * - inverted: Transparent background with white text/flag (for dark backgrounds/heroes)\n *\n * @example\n * ```tsx\n * // Default (light)\n * <USGovBanner />\n *\n * // Inverted (for dark backgrounds)\n * <USGovBanner variant=\"inverted\" />\n * ```\n */\nconst USGovBanner = React.forwardRef<HTMLDivElement, USGovBannerProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tvariant,\n\t\t\tflagIcon,\n\t\t\ttext = \"An official website of the United States government\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst styles = usGovBannerVariants({ variant });\n\n\t\treturn (\n\t\t\t<div ref={ref} className={styles.root({ class: className })} {...props}>\n\t\t\t\t<div className={styles.content()}>\n\t\t\t\t\t{flagIcon ?? <MonoUSFlag />}\n\t\t\t\t\t<p className={styles.text()}>{text}</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t},\n);\nUSGovBanner.displayName = \"USGovBanner\";\n\nfunction MonoUSFlag() {\n\treturn (\n\t\t<svg\n\t\t\twidth=\"16\"\n\t\t\theight=\"12\"\n\t\t\tviewBox=\"0 0 16 12\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<path d=\"M0 0H16V12H0V0Z\" fill=\"currentColor\" fillOpacity=\"0.1\" />\n\t\t\t<path\n\t\t\t\td=\"M0 0H16V0.923077H0V0ZM0 1.84615H16V2.76923H0V1.84615ZM0 3.69231H16V4.61538H0V3.69231ZM0 5.53846H16V6.46154H0V5.53846ZM0 7.38462H16V8.30769H0V7.38462ZM0 9.23077H16V10.1538H0V9.23077ZM0 11.0769H16V12H0V11.0769Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity=\"0.8\"\n\t\t\t/>\n\t\t\t<path d=\"M0 0H8V6.46154H0V0Z\" fill=\"currentColor\" fillOpacity=\"0.6\" />\n\t\t</svg>\n\t);\n}\n\nexport { USGovBanner, usGovBannerVariants };\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single caption cue parsed from VTT.
|
|
3
|
+
*/
|
|
4
|
+
interface CaptionCue {
|
|
5
|
+
/** Unique identifier for the cue */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Start time in seconds */
|
|
8
|
+
startTime: number;
|
|
9
|
+
/** End time in seconds */
|
|
10
|
+
endTime: number;
|
|
11
|
+
/** Caption text content */
|
|
12
|
+
text: string;
|
|
13
|
+
}
|
|
14
|
+
interface UseCaptionsOptions {
|
|
15
|
+
/** VTT file URL to fetch */
|
|
16
|
+
src?: string;
|
|
17
|
+
/** Pre-loaded VTT content string */
|
|
18
|
+
content?: string;
|
|
19
|
+
/** Strip VTT formatting tags from caption text */
|
|
20
|
+
stripTags?: boolean;
|
|
21
|
+
/** Current playback time in seconds (alternative to setCurrentTime) */
|
|
22
|
+
currentTime?: number;
|
|
23
|
+
}
|
|
24
|
+
interface UseCaptionsReturn {
|
|
25
|
+
/** All parsed caption cues */
|
|
26
|
+
cues: CaptionCue[];
|
|
27
|
+
/** Currently active cue based on current time */
|
|
28
|
+
activeCue: CaptionCue | null;
|
|
29
|
+
/** Update the current playback time to get active cue */
|
|
30
|
+
setCurrentTime: (time: number) => void;
|
|
31
|
+
/** Loading state */
|
|
32
|
+
isLoading: boolean;
|
|
33
|
+
/** Error state */
|
|
34
|
+
error: Error | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Hook for parsing VTT captions and tracking the active cue.
|
|
38
|
+
*
|
|
39
|
+
* @param options - Caption source options
|
|
40
|
+
* @returns Parsed cues, active cue, and state
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* function VideoPlayer() {
|
|
45
|
+
* const videoRef = React.useRef<HTMLVideoElement>(null);
|
|
46
|
+
* const { activeCue, setCurrentTime } = useCaptions({
|
|
47
|
+
* src: '/captions.vtt',
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* // Sync with video time
|
|
51
|
+
* React.useEffect(() => {
|
|
52
|
+
* const video = videoRef.current;
|
|
53
|
+
* if (!video) return;
|
|
54
|
+
*
|
|
55
|
+
* const handleTimeUpdate = () => setCurrentTime(video.currentTime);
|
|
56
|
+
* video.addEventListener('timeupdate', handleTimeUpdate);
|
|
57
|
+
* return () => video.removeEventListener('timeupdate', handleTimeUpdate);
|
|
58
|
+
* }, [setCurrentTime]);
|
|
59
|
+
*
|
|
60
|
+
* return (
|
|
61
|
+
* <div>
|
|
62
|
+
* <video ref={videoRef} src="/video.mp4" />
|
|
63
|
+
* {activeCue && <div className="caption">{activeCue.text}</div>}
|
|
64
|
+
* </div>
|
|
65
|
+
* );
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
declare function useCaptions(options?: UseCaptionsOptions): UseCaptionsReturn;
|
|
70
|
+
|
|
71
|
+
export { type CaptionCue as C, useCaptions as u };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { cnBase } from 'tailwind-variants';
|
|
3
|
+
export { cnBase as twMerge } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/lib/utils.ts
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return cnBase(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { cn };
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts"],"names":["twMerge"],"mappings":";;;;;AAKO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAOA,MAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B","file":"index.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { cnBase as twMerge } from \"tailwind-variants\";\n\nexport { twMerge };\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { BlurredVideoBackdropProps } from '../blurred-video-backdrop/index.js';
|
|
5
|
+
import { V as VideoPlayerProps } from '../video-player-qxf-BURH.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Video dialog container variants.
|
|
9
|
+
* Uses fixed positioning to cover the viewport.
|
|
10
|
+
*/
|
|
11
|
+
declare const videoDialogVariants: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], tailwind_variants_dist_config_js.TVConfig<unknown, {} | {}>, {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], tailwind_variants_dist_config_js.TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
|
|
12
|
+
/**
|
|
13
|
+
* Close button variants.
|
|
14
|
+
*/
|
|
15
|
+
declare const closeButtonVariants: tailwind_variants.TVReturnType<{
|
|
16
|
+
position: {
|
|
17
|
+
"top-right": string;
|
|
18
|
+
"top-left": string;
|
|
19
|
+
};
|
|
20
|
+
}, undefined, string[], tailwind_variants_dist_config_js.TVConfig<{
|
|
21
|
+
position: {
|
|
22
|
+
"top-right": string;
|
|
23
|
+
"top-left": string;
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
position: {
|
|
27
|
+
"top-right": string;
|
|
28
|
+
"top-left": string;
|
|
29
|
+
};
|
|
30
|
+
}>, {
|
|
31
|
+
position: {
|
|
32
|
+
"top-right": string;
|
|
33
|
+
"top-left": string;
|
|
34
|
+
};
|
|
35
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
36
|
+
position: {
|
|
37
|
+
"top-right": string;
|
|
38
|
+
"top-left": string;
|
|
39
|
+
};
|
|
40
|
+
}, undefined, string[], tailwind_variants_dist_config_js.TVConfig<{
|
|
41
|
+
position: {
|
|
42
|
+
"top-right": string;
|
|
43
|
+
"top-left": string;
|
|
44
|
+
};
|
|
45
|
+
}, {
|
|
46
|
+
position: {
|
|
47
|
+
"top-right": string;
|
|
48
|
+
"top-left": string;
|
|
49
|
+
};
|
|
50
|
+
}>, unknown, unknown, undefined>>;
|
|
51
|
+
/**
|
|
52
|
+
* Video container variants.
|
|
53
|
+
* Expands to fill viewport, constrained by height (maintains aspect ratio).
|
|
54
|
+
*/
|
|
55
|
+
declare const videoContainerVariants: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], tailwind_variants_dist_config_js.TVConfig<unknown, {} | {}>, {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], tailwind_variants_dist_config_js.TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
|
|
56
|
+
interface VideoDialogProps extends Omit<VideoPlayerProps, "videoRef" | "className"> {
|
|
57
|
+
/** Trigger element that opens the dialog */
|
|
58
|
+
trigger: React.ReactNode;
|
|
59
|
+
/** Blur intensity for backdrop (default: high) */
|
|
60
|
+
blur?: BlurredVideoBackdropProps["blur"];
|
|
61
|
+
/** Gradient overlay for backdrop (default: vignette) */
|
|
62
|
+
overlay?: BlurredVideoBackdropProps["overlay"];
|
|
63
|
+
/** Backdrop opacity (default: 0.6) */
|
|
64
|
+
backdropOpacity?: number;
|
|
65
|
+
/** Whether to show close button (default: true) */
|
|
66
|
+
showClose?: boolean;
|
|
67
|
+
/** Close button position (default: top-right) */
|
|
68
|
+
closePosition?: "top-right" | "top-left";
|
|
69
|
+
/** Video player rounded corners (default: lg) */
|
|
70
|
+
rounded?: VideoPlayerProps["rounded"];
|
|
71
|
+
/** Controlled open state */
|
|
72
|
+
open?: boolean;
|
|
73
|
+
/** Default open state */
|
|
74
|
+
defaultOpen?: boolean;
|
|
75
|
+
/** Callback when open state changes */
|
|
76
|
+
onOpenChange?: (open: boolean) => void;
|
|
77
|
+
/** Additional className for the dialog container */
|
|
78
|
+
className?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* VideoDialog - Fullscreen video modal with blurred video backdrop.
|
|
82
|
+
*
|
|
83
|
+
* Creates an immersive video viewing experience where the blurred video
|
|
84
|
+
* serves as the modal backdrop, with the main video centered on top.
|
|
85
|
+
* Based on the DGA modal pattern.
|
|
86
|
+
*
|
|
87
|
+
* Features:
|
|
88
|
+
* - Blurred video backdrop that syncs with main video
|
|
89
|
+
* - Configurable blur intensity and gradient overlays
|
|
90
|
+
* - Automatic play/pause when dialog opens/closes
|
|
91
|
+
* - HLS streaming support via Cloudflare Stream
|
|
92
|
+
* - Accessible dialog with focus trap and escape key handling
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <VideoDialog
|
|
97
|
+
* trigger={<Button>Watch Video</Button>}
|
|
98
|
+
* cloudflare={{ videoId: "abc123", customerCode: "xyz789" }}
|
|
99
|
+
* blur="high"
|
|
100
|
+
* overlay="vignette"
|
|
101
|
+
* />
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
declare const VideoDialog: React.ForwardRefExoticComponent<VideoDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
105
|
+
|
|
106
|
+
export { VideoDialog, type VideoDialogProps, closeButtonVariants, videoContainerVariants, videoDialogVariants };
|