@sp-days-framework/docusaurus-frontpage-collection 1.0.2

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 (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +339 -0
  3. package/lib/components/Block/index.d.ts +22 -0
  4. package/lib/components/Block/index.d.ts.map +1 -0
  5. package/lib/components/Block/index.js +32 -0
  6. package/lib/components/Block/index.js.map +1 -0
  7. package/lib/components/Block/styles.module.css +26 -0
  8. package/lib/components/Columns/index.d.ts +68 -0
  9. package/lib/components/Columns/index.d.ts.map +1 -0
  10. package/lib/components/Columns/index.js +119 -0
  11. package/lib/components/Columns/index.js.map +1 -0
  12. package/lib/components/Columns/styles.module.css +196 -0
  13. package/lib/components/CourseFeature/index.d.ts +99 -0
  14. package/lib/components/CourseFeature/index.d.ts.map +1 -0
  15. package/lib/components/CourseFeature/index.js +188 -0
  16. package/lib/components/CourseFeature/index.js.map +1 -0
  17. package/lib/components/CourseFeature/styles.module.css +204 -0
  18. package/lib/components/FancyHeader/index.d.ts +24 -0
  19. package/lib/components/FancyHeader/index.d.ts.map +1 -0
  20. package/lib/components/FancyHeader/index.js +32 -0
  21. package/lib/components/FancyHeader/index.js.map +1 -0
  22. package/lib/components/FancyHeader/styles.module.css +23 -0
  23. package/lib/components/GetStarted/index.d.ts +99 -0
  24. package/lib/components/GetStarted/index.d.ts.map +1 -0
  25. package/lib/components/GetStarted/index.js +127 -0
  26. package/lib/components/GetStarted/index.js.map +1 -0
  27. package/lib/components/GetStarted/styles.module.css +174 -0
  28. package/lib/components/HeroBanner/DotCrossGrid.d.ts +25 -0
  29. package/lib/components/HeroBanner/DotCrossGrid.d.ts.map +1 -0
  30. package/lib/components/HeroBanner/DotCrossGrid.js +283 -0
  31. package/lib/components/HeroBanner/DotCrossGrid.js.map +1 -0
  32. package/lib/components/HeroBanner/DotCrossGrid.module.css +9 -0
  33. package/lib/components/HeroBanner/index.d.ts +42 -0
  34. package/lib/components/HeroBanner/index.d.ts.map +1 -0
  35. package/lib/components/HeroBanner/index.js +116 -0
  36. package/lib/components/HeroBanner/index.js.map +1 -0
  37. package/lib/components/HeroBanner/styles.module.css +204 -0
  38. package/lib/components/IconContainer/index.d.ts +76 -0
  39. package/lib/components/IconContainer/index.d.ts.map +1 -0
  40. package/lib/components/IconContainer/index.js +119 -0
  41. package/lib/components/IconContainer/index.js.map +1 -0
  42. package/lib/components/IconContainer/styles.module.css +147 -0
  43. package/lib/components/Iconify/index.d.ts +56 -0
  44. package/lib/components/Iconify/index.d.ts.map +1 -0
  45. package/lib/components/Iconify/index.js +88 -0
  46. package/lib/components/Iconify/index.js.map +1 -0
  47. package/lib/components/Iconify/styles.module.css +30 -0
  48. package/lib/index.d.ts +36 -0
  49. package/lib/index.d.ts.map +1 -0
  50. package/lib/index.js +73 -0
  51. package/lib/index.js.map +1 -0
  52. package/lib/utils/IconifyIcon.d.ts +17 -0
  53. package/lib/utils/IconifyIcon.d.ts.map +1 -0
  54. package/lib/utils/IconifyIcon.js +26 -0
  55. package/lib/utils/IconifyIcon.js.map +1 -0
  56. package/lib/utils/InlineSvg.d.ts +29 -0
  57. package/lib/utils/InlineSvg.d.ts.map +1 -0
  58. package/lib/utils/InlineSvg.js +90 -0
  59. package/lib/utils/InlineSvg.js.map +1 -0
  60. package/lib/utils/ThemedIcon.d.ts +61 -0
  61. package/lib/utils/ThemedIcon.d.ts.map +1 -0
  62. package/lib/utils/ThemedIcon.js +128 -0
  63. package/lib/utils/ThemedIcon.js.map +1 -0
  64. package/lib/utils/constants.d.ts +23 -0
  65. package/lib/utils/constants.d.ts.map +1 -0
  66. package/lib/utils/constants.js +36 -0
  67. package/lib/utils/constants.js.map +1 -0
  68. package/lib/utils/index.d.ts +9 -0
  69. package/lib/utils/index.d.ts.map +1 -0
  70. package/lib/utils/index.js +19 -0
  71. package/lib/utils/index.js.map +1 -0
  72. package/lib/utils/logger.d.ts +21 -0
  73. package/lib/utils/logger.d.ts.map +1 -0
  74. package/lib/utils/logger.js +38 -0
  75. package/lib/utils/logger.js.map +1 -0
  76. package/lib/utils/types.d.ts +129 -0
  77. package/lib/utils/types.d.ts.map +1 -0
  78. package/lib/utils/types.js +6 -0
  79. package/lib/utils/types.js.map +1 -0
  80. package/package.json +73 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Helse Sør-Øst
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,339 @@
1
+ # @sp-days-framework/docusaurus-frontpage-collection
2
+
3
+ A collection of React components for Docusaurus with TypeScript support and flexible theming.
4
+
5
+ ## Features
6
+
7
+ - **Rich Component Library**: 8 polished components including HeroBanner, Columns, CourseFeature, Iconify, and more
8
+ - **Flexible Icon System**: Supports both Iconify's 200,000+ icons and custom themed images
9
+ - **Interactive Effects**: Engaging animations like the dot cross grid in HeroBanner
10
+ - **Full TypeScript Support**: Complete type definitions for all components and props
11
+ - **Theme-Aware**: Automatic light/dark mode support with customizable colors
12
+ - **Responsive by Default**: Mobile-first design with container queries and media queries
13
+ - **Zero Configuration**: Works out of the box with sensible defaults
14
+ - **MDX-Optimized**: Designed specifically for Docusaurus MDX pages
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @sp-days-framework/docusaurus-frontpage-collection
20
+ ```
21
+
22
+ ## Quick Start
23
+
24
+ ```tsx
25
+ import {
26
+ HeroBanner,
27
+ Columns,
28
+ Left,
29
+ Right,
30
+ Block,
31
+ } from "@sp-days-framework/docusaurus-frontpage-collection";
32
+
33
+ export default function MyPage() {
34
+ return (
35
+ <>
36
+ <HeroBanner
37
+ bannerText="Build amazing documentation sites"
38
+ iconify="mdi:rocket-launch"
39
+ />
40
+
41
+ <Columns leftRatio="60">
42
+ <Left>## Main content here</Left>
43
+ <Right>
44
+ <Block>### Sidebar content</Block>
45
+ </Right>
46
+ </Columns>
47
+ </>
48
+ );
49
+ }
50
+ ```
51
+
52
+ ## Components Overview
53
+
54
+ ### HeroBanner
55
+
56
+ Full-width banner with animated dot cross grid background.
57
+
58
+ ```tsx
59
+ <HeroBanner
60
+ bannerText="Learn with our hands-on course"
61
+ iconify="mdi:docker"
62
+ iconColors={{
63
+ light: "#2496ED",
64
+ dark: "#2496ED"
65
+ }}
66
+ />
67
+ ```
68
+
69
+ **Key Props:**
70
+ - `bannerText` - Description text below tagline
71
+ - `iconify` - Iconify icon name or configuration
72
+ - `customIcon` - Custom images for light/dark themes
73
+ - `iconColors` - Color overrides for Iconify icons
74
+ - `enableDotCrossEffect` - Interactive background animation (default: `true`)
75
+
76
+ > Title and tagline are automatically pulled from `docusaurus.config.js`.
77
+
78
+ ### Columns
79
+
80
+ Responsive two-column layout with customizable ratios.
81
+
82
+ ```tsx
83
+ <Columns leftRatio="70">
84
+ <Left>### Main content (70%)</Left>
85
+ <Right>### Sidebar (30%)</Right>
86
+ </Columns>
87
+ ```
88
+
89
+ **Key Props:**
90
+ - `leftRatio` - Width percentage for left column (default: `'50'`)
91
+ - `equalHeight` - Match column heights (default: `true`)
92
+ - `minWidth` - Breakpoint for stacking (default: `'700px'`)
93
+
94
+ ### CourseFeature
95
+
96
+ Display what's included and not included in your course.
97
+
98
+ ```tsx
99
+ <CourseFeature>
100
+ <Included>
101
+ - **Docker Fundamentals**: Core concepts
102
+ - **Container Management**: Hands-on labs
103
+ </Included>
104
+ <NotIncluded>
105
+ - **Kubernetes**: Covered in advanced course
106
+ </NotIncluded>
107
+ </CourseFeature>
108
+ ```
109
+
110
+ **Key Props:**
111
+ - `iconifyIncluded` - Custom Iconify icon for included section
112
+ - `iconifyNotIncluded` - Custom Iconify icon for not included section
113
+ - `customIconIncluded` / `customIconNotIncluded` - Custom images
114
+
115
+ ### IconContainersSection
116
+
117
+ Grid of clickable icon cards for navigation or information.
118
+
119
+ ```tsx
120
+ <IconContainersSection>
121
+ <IconContainerBlock
122
+ title="Git Knowledge"
123
+ iconify="mdi:git"
124
+ link="/docs/git"
125
+ />
126
+ <IconContainerBlock
127
+ title="Docker Basics"
128
+ iconify="mdi:docker"
129
+ link="/docs/docker"
130
+ />
131
+ </IconContainersSection>
132
+ ```
133
+
134
+ **Key Props:**
135
+ - `title` - Display title
136
+ - `iconify` - Iconify icon name or configuration
137
+ - `customIcon` - Custom images for light/dark themes
138
+ - `iconColors` - Custom colors for light/dark themes
139
+ - `link` - Navigation URL
140
+
141
+ ### GetStarted
142
+
143
+ Call-to-action section with optional exploration grid.
144
+
145
+ ```tsx
146
+ <GetStarted buttonText="Start Course" buttonLink="/module-1">
147
+ ## Ready to begin?
148
+
149
+ <Explore>
150
+ <ExploreItem
151
+ title="Documentation"
152
+ iconify="mdi:book"
153
+ link="/docs"
154
+ >
155
+ Browse our guides
156
+ </ExploreItem>
157
+ </Explore>
158
+ </GetStarted>
159
+ ```
160
+
161
+ **Key Props:**
162
+ - `buttonText` - CTA button label
163
+ - `buttonLink` - CTA button URL
164
+
165
+ ### FancyHeader
166
+
167
+ Section header with decorative underline.
168
+
169
+ ```tsx
170
+ <FancyHeader as="h2">What You'll Learn</FancyHeader>
171
+ ```
172
+
173
+ **Key Props:**
174
+ - `as` - Heading level: `'h1'` through `'h6'` (default: `'h2'`)
175
+
176
+ ### Block
177
+
178
+ Simple styled container with hover effects.
179
+
180
+ ```tsx
181
+ <Block>
182
+ ### Quick Stats
183
+ - Duration: 4 weeks
184
+ - Level: Intermediate
185
+ </Block>
186
+ ```
187
+
188
+ ### Iconify
189
+
190
+ Simple component for adding Iconify icons to pages with theme-aware colors.
191
+
192
+ ```tsx
193
+ <Iconify
194
+ icon="mdi:docker"
195
+ width="250px"
196
+ iconColors={{
197
+ light: "#2496ED",
198
+ dark: "#2496ED"
199
+ }}
200
+ />
201
+ ```
202
+
203
+ **Key Props:**
204
+ - `icon` - Iconify icon name (e.g., "mdi:tools")
205
+ - `width` / `height` - Optional sizing (default: `'200px'`)
206
+ - `alignment` - Page alignment: `'left'`, `'center'`, or `'right'` (default: `'center'`)
207
+ - `iconColors` - Color configuration for light/dark themes
208
+
209
+ ## Icon System
210
+
211
+ All components support flexible icon configuration:
212
+
213
+ ### Iconify Icons
214
+
215
+ ```tsx
216
+ <HeroBanner
217
+ iconify="mdi:docker"
218
+ iconColors={{
219
+ light: "#2496ED",
220
+ dark: "#2496ED"
221
+ }}
222
+ />
223
+ ```
224
+
225
+ Browse 200,000+ icons at [Iconify](https://icon-sets.iconify.design/).
226
+
227
+ ### Custom Images
228
+
229
+ ```tsx
230
+ <HeroBanner
231
+ customIcon={{
232
+ light: "img/logo-light.svg",
233
+ dark: "img/logo-dark.svg"
234
+ }}
235
+ />
236
+ ```
237
+
238
+ ### Advanced Iconify Configuration
239
+
240
+ ```tsx
241
+ <IconContainerBlock
242
+ title="Linux"
243
+ iconify={{
244
+ icon: "mdi:linux",
245
+ width: "100%",
246
+ height: "100%",
247
+ colors: {
248
+ light: "#FCC624",
249
+ lightHover: "#DB9D0C",
250
+ dark: "#FFD65A",
251
+ darkHover: "#FFE89E"
252
+ }
253
+ }}
254
+ link="/docs/linux"
255
+ />
256
+ ```
257
+
258
+ ## Complete Example
259
+
260
+ ```mdx
261
+ ---
262
+ title: My Course
263
+ description: Learn with our hands-on course
264
+ hide_table_of_contents: true
265
+ ---
266
+
267
+ import {
268
+ HeroBanner,
269
+ FancyHeader,
270
+ CourseFeature,
271
+ Included,
272
+ NotIncluded,
273
+ IconContainersSection,
274
+ IconContainerBlock,
275
+ GetStarted,
276
+ Explore,
277
+ ExploreItem,
278
+ } from "@sp-days-framework/docusaurus-frontpage-collection";
279
+
280
+ <HeroBanner
281
+ bannerText="Learn with our hands-on course"
282
+ iconify="mdi:school"
283
+ />
284
+
285
+ <FancyHeader>What You'll Learn</FancyHeader>
286
+
287
+ <CourseFeature>
288
+ <Included>
289
+ - **Core Concepts**: Fundamentals
290
+ - **Hands-on Labs**: Practical exercises
291
+ </Included>
292
+ <NotIncluded>
293
+ - **Advanced Topics**: Covered separately
294
+ </NotIncluded>
295
+ </CourseFeature>
296
+
297
+ <FancyHeader>Requirements</FancyHeader>
298
+
299
+ <IconContainersSection>
300
+ <IconContainerBlock
301
+ title="Git Knowledge"
302
+ iconify="mdi:git"
303
+ link="/docs/git"
304
+ />
305
+ <IconContainerBlock
306
+ title="Terminal Skills"
307
+ iconify="mdi:console"
308
+ link="/docs/terminal"
309
+ />
310
+ </IconContainersSection>
311
+
312
+ <GetStarted buttonText="Start Learning" buttonLink="/docs">
313
+ ## Ready to Begin?
314
+
315
+ <Explore>
316
+ <ExploreItem
317
+ title="Documentation"
318
+ iconify="mdi:book-open-variant"
319
+ link="/docs"
320
+ >
321
+ Comprehensive guides
322
+ </ExploreItem>
323
+ </Explore>
324
+ </GetStarted>
325
+ ```
326
+
327
+ ## TypeScript Support
328
+
329
+ All components are fully typed with TypeScript:
330
+
331
+ ```typescript
332
+ import type {
333
+ HeroBannerProps,
334
+ ColumnsProps,
335
+ IconifyConfig,
336
+ CustomIconConfig,
337
+ IconColorConfig
338
+ } from "@sp-days-framework/docusaurus-frontpage-collection";
339
+ ```
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import type { StyledComponentProps } from '../../utils/types';
3
+ export interface BlockProps extends StyledComponentProps {
4
+ }
5
+ /**
6
+ * Block Component
7
+ *
8
+ * A simple styled block container for Markdown content with hover effects.
9
+ * Perfect for creating card-like sections in your documentation.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Block>
14
+ * ## Your Content
15
+ *
16
+ * This is some markdown content inside a styled block.
17
+ * </Block>
18
+ * ```
19
+ */
20
+ export declare const Block: React.FC<BlockProps>;
21
+ export default Block;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Block/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG9D,MAAM,WAAW,UAAW,SAAQ,oBAAoB;CAAG;AAE3D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAQtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Block = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const clsx_1 = __importDefault(require("clsx"));
9
+ const react_2 = require("@mdx-js/react");
10
+ const styles_module_css_1 = __importDefault(require("./styles.module.css"));
11
+ /**
12
+ * Block Component
13
+ *
14
+ * A simple styled block container for Markdown content with hover effects.
15
+ * Perfect for creating card-like sections in your documentation.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <Block>
20
+ * ## Your Content
21
+ *
22
+ * This is some markdown content inside a styled block.
23
+ * </Block>
24
+ * ```
25
+ */
26
+ const Block = ({ className, children, style }) => {
27
+ return (react_1.default.createElement("div", { className: (0, clsx_1.default)(styles_module_css_1.default.block, className), style: style },
28
+ react_1.default.createElement(react_2.MDXProvider, null, children)));
29
+ };
30
+ exports.Block = Block;
31
+ exports.default = exports.Block;
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Block/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,yCAA4C;AAE5C,4EAAyC;AAIzC;;;;;;;;;;;;;;GAcG;AACI,MAAM,KAAK,GAAyB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5E,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,cAAI,EAAC,2BAAM,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK;QACzD,8BAAC,mBAAW,QACT,QAAQ,CACG,CACV,CACP,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,KAAK,SAQhB;AAEF,kBAAe,aAAK,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Block component styles
3
+ */
4
+
5
+ .block {
6
+ padding: 0.5rem 1rem 1rem 1rem;
7
+ margin: 0rem 0.6rem 1.2rem 0.6rem;
8
+ border-radius: 8px;
9
+ background-color: var(--ifm-color-emphasis-100);
10
+ box-shadow: var(--ifm-global-shadow-lw);
11
+ height: 100%;
12
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
13
+ }
14
+
15
+ .block:hover {
16
+ transform: translateY(-1px);
17
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
18
+ }
19
+
20
+ .block h2 {
21
+ margin-top: 0;
22
+ }
23
+
24
+ .block h3 {
25
+ margin-top: 0;
26
+ }
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ import type { WithChildren } from '../../utils/types';
3
+ export interface LeftProps extends WithChildren {
4
+ }
5
+ export interface RightProps extends WithChildren {
6
+ }
7
+ export interface ColumnsProps extends WithChildren {
8
+ /** Width ratio of left column as percentage (default: '50') */
9
+ leftRatio?: string;
10
+ /** Whether columns should have equal height (default: true) */
11
+ equalHeight?: boolean;
12
+ /** Minimum width before columns stack (default: '700px') */
13
+ minWidth?: string;
14
+ /** Prevent columns from stretching to fill container height (default: false) */
15
+ noStretch?: boolean;
16
+ }
17
+ /**
18
+ * Left Column Component
19
+ *
20
+ * Must be used as a child of the Columns component.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <Columns>
25
+ * <Left>Content for left column</Left>
26
+ * <Right>Content for right column</Right>
27
+ * </Columns>
28
+ * ```
29
+ */
30
+ export declare const Left: React.FC<LeftProps>;
31
+ /**
32
+ * Right Column Component
33
+ *
34
+ * Must be used as a child of the Columns component.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <Columns>
39
+ * <Left>Content for left column</Left>
40
+ * <Right>Content for right column</Right>
41
+ * </Columns>
42
+ * ```
43
+ */
44
+ export declare const Right: React.FC<RightProps>;
45
+ /**
46
+ * Columns Component
47
+ *
48
+ * A responsive two-column layout with customizable width ratios.
49
+ * Automatically stacks on smaller screens.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * // Equal columns (50/50)
54
+ * <Columns>
55
+ * <Left>Left content</Left>
56
+ * <Right>Right content</Right>
57
+ * </Columns>
58
+ *
59
+ * // Custom ratio (70/30)
60
+ * <Columns leftRatio="70">
61
+ * <Left>Larger left content</Left>
62
+ * <Right>Smaller right content</Right>
63
+ * </Columns>
64
+ * ```
65
+ */
66
+ export declare const Columns: React.FC<ColumnsProps>;
67
+ export default Columns;
68
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Columns/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,MAAM,WAAW,SAAU,SAAQ,YAAY;CAAG;AAElD,MAAM,WAAW,UAAW,SAAQ,YAAY;CAAG;AAEnD,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAYpC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAYtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8D1C,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Columns = exports.Right = exports.Left = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_2 = require("@mdx-js/react");
9
+ const styles_module_css_1 = __importDefault(require("./styles.module.css"));
10
+ /**
11
+ * Left Column Component
12
+ *
13
+ * Must be used as a child of the Columns component.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <Columns>
18
+ * <Left>Content for left column</Left>
19
+ * <Right>Content for right column</Right>
20
+ * </Columns>
21
+ * ```
22
+ */
23
+ const Left = ({ children }) => {
24
+ return (react_1.default.createElement("div", { className: styles_module_css_1.default.leftColumn },
25
+ react_1.default.createElement("div", { className: styles_module_css_1.default.columnContent },
26
+ react_1.default.createElement("div", { className: styles_module_css_1.default.mdxContainer },
27
+ react_1.default.createElement(react_2.MDXProvider, null, children)))));
28
+ };
29
+ exports.Left = Left;
30
+ /**
31
+ * Right Column Component
32
+ *
33
+ * Must be used as a child of the Columns component.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * <Columns>
38
+ * <Left>Content for left column</Left>
39
+ * <Right>Content for right column</Right>
40
+ * </Columns>
41
+ * ```
42
+ */
43
+ const Right = ({ children }) => {
44
+ return (react_1.default.createElement("div", { className: styles_module_css_1.default.rightColumn },
45
+ react_1.default.createElement("div", { className: styles_module_css_1.default.columnContent },
46
+ react_1.default.createElement("div", { className: styles_module_css_1.default.mdxContainer },
47
+ react_1.default.createElement(react_2.MDXProvider, null, children)))));
48
+ };
49
+ exports.Right = Right;
50
+ /**
51
+ * Columns Component
52
+ *
53
+ * A responsive two-column layout with customizable width ratios.
54
+ * Automatically stacks on smaller screens.
55
+ *
56
+ * @example
57
+ * ```tsx
58
+ * // Equal columns (50/50)
59
+ * <Columns>
60
+ * <Left>Left content</Left>
61
+ * <Right>Right content</Right>
62
+ * </Columns>
63
+ *
64
+ * // Custom ratio (70/30)
65
+ * <Columns leftRatio="70">
66
+ * <Left>Larger left content</Left>
67
+ * <Right>Smaller right content</Right>
68
+ * </Columns>
69
+ * ```
70
+ */
71
+ const Columns = ({ leftRatio = '50', equalHeight = true, minWidth = '700px', noStretch = false, children }) => {
72
+ // Calculate the right ratio as the remaining percentage
73
+ const leftRatioNum = parseInt(leftRatio, 10);
74
+ const rightRatioNum = 100 - leftRatioNum;
75
+ // Find Left and Right components among children
76
+ let leftColumn = null;
77
+ let rightColumn = null;
78
+ react_1.default.Children.forEach(children, (child) => {
79
+ if (react_1.default.isValidElement(child)) {
80
+ if (child.type === exports.Left) {
81
+ leftColumn = child;
82
+ }
83
+ else if (child.type === exports.Right) {
84
+ rightColumn = child;
85
+ }
86
+ }
87
+ });
88
+ // Calculate common styles
89
+ const commonStyles = {
90
+ overflow: 'hidden',
91
+ minWidth: minWidth,
92
+ alignSelf: noStretch ? 'flex-start' : 'stretch',
93
+ };
94
+ // Set up grid template based on ratio
95
+ const gridTemplate = `${leftRatioNum}fr ${rightRatioNum}fr`;
96
+ return (react_1.default.createElement("div", { className: styles_module_css_1.default.columnsContainer, style: {
97
+ gridTemplateColumns: gridTemplate,
98
+ minWidth: '100%',
99
+ maxWidth: '100%',
100
+ width: '100%'
101
+ } },
102
+ leftColumn && react_1.default.cloneElement(leftColumn, {
103
+ style: {
104
+ ...commonStyles,
105
+ minWidth: 0,
106
+ maxWidth: '100%',
107
+ }
108
+ }),
109
+ rightColumn && react_1.default.cloneElement(rightColumn, {
110
+ style: {
111
+ ...commonStyles,
112
+ minWidth: 0,
113
+ maxWidth: '100%',
114
+ }
115
+ })));
116
+ };
117
+ exports.Columns = Columns;
118
+ exports.default = exports.Columns;
119
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Columns/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yCAA4C;AAE5C,4EAAyC;AAiBzC;;;;;;;;;;;;GAYG;AACI,MAAM,IAAI,GAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxD,OAAO,CACL,uCAAK,SAAS,EAAE,2BAAM,CAAC,UAAU;QAC/B,uCAAK,SAAS,EAAE,2BAAM,CAAC,aAAa;YAClC,uCAAK,SAAS,EAAE,2BAAM,CAAC,YAAY;gBACjC,8BAAC,mBAAW,QACT,QAAQ,CACG,CACV,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,IAAI,QAYf;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,KAAK,GAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1D,OAAO,CACL,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